identifier
stringlengths
42
383
collection
stringclasses
1 value
open_type
stringclasses
1 value
license
stringlengths
0
1.81k
date
float64
1.99k
2.02k
title
stringlengths
0
100
creator
stringlengths
1
39
language
stringclasses
157 values
language_type
stringclasses
2 values
word_count
int64
1
20k
token_count
int64
4
1.32M
text
stringlengths
5
1.53M
__index_level_0__
int64
0
57.5k
https://github.com/andrey625/query/blob/master/src/Field.php
Github Open Source
Open Source
MIT
2,017
query
andrey625
PHP
Code
379
1,138
<?php namespace Vda\Query; use Vda\Query\Operator\CompositeOperator; use Vda\Query\Operator\Operator; /** * @method Alias as(string $alias) Create an alias for this field */ class Field implements IExpression { private $type; private $name; private $propertyName; private $scope; public function __construct($type, $name = null, $propertyName = null, ISource $scope = null) { $this->type = $type; $this->name = $name; $this->propertyName = $propertyName; $this->scope = $scope; } public function init($fieldName, ISource $scope) { if ($this->propertyName === null) { $this->propertyName = $fieldName; } if ($this->name === null) { $this->name = $fieldName; } $this->scope = $scope; } /** * @return enum Type */ public function getType() { return $this->type; } /** * @return string */ public function getName() { return $this->name; } /** * @return string */ public function getPropertyName() { return $this->propertyName; } /** * @return ISource */ public function getScope() { return $this->scope; } /** * @return Order */ public function asc() { return new Order($this, Order::DIR_ASC); } /** * @return Order */ public function desc() { return new Order($this, Order::DIR_DESC); } /** * @param mixed $exp Either Field instance or scalar value * @return CompositeOperator */ public function eq($exp) { return Operator::eq($this, $exp); } public function gt($exp) { return Operator::gt($this, $exp); } public function gte($exp) { return Operator::gte($this, $exp); } public function lt($exp) { return Operator::lt($this, $exp); } public function lte($exp) { return Operator::lte($this, $exp); } public function like($exp) { return Operator::match($this, $exp); } public function ilike($exp) { return Operator::matchi($this, $exp); } public function notlike($exp) { return Operator::notmatch($this, $exp); } public function notilike($exp) { return Operator::notmatchi($this, $exp); } public function in($exp) { if (!is_array($exp) && !($exp instanceof Select && func_num_args() == 1)) { $exp = func_get_args(); } return Operator::in($this, $exp); } public function notin($exp) { if (!is_array($exp) && !($exp instanceof Select && func_num_args() == 1)) { $exp = func_get_args(); } return Operator::notin($this, $exp); } public function neq($exp) { return Operator::neq($this, $exp); } public function isnull() { return Operator::isnull($this); } public function notnull() { return Operator::notnull($this); } public function _as($alias) { return new Alias($this, $alias); } //TODO Get rid of this once PHP is fixed to allow keywords as method names public function __call($method, $args) { if ($method === 'as') { return $this->_as($args[0]); } trigger_error('Call to undefined method ' . __CLASS__ . '::' . $method, E_USER_ERROR); } public function onProcess(IQueryProcessor $processor) { return $processor->processField($this); } }
11,736
https://github.com/ilivewithian/sanity/blob/master/packages/@sanity/default-layout/src/stories/searchFieldMobile.tsx
Github Open Source
Open Source
MIT
2,021
sanity
ilivewithian
TSX
Code
120
439
import React from 'react' import {action} from 'part:@sanity/storybook/addons/actions' import {text, boolean, number} from 'part:@sanity/storybook/addons/knobs' import SearchField from '../navbar/search/SearchField' import SearchResults from '../navbar/search/SearchResults' export function SearchFieldMobileStory() { const hasResults = boolean('hasResults', false, 'props') const items: any[] = hasResults ? [ { hit: {_id: 'foo', _type: 'foo'}, score: 12, stories: {path: 'foo', score: 1, why: 'test'}, }, ] : [] const query = text('query', '', 'props') return ( <div style={{background: '#444', height: '100vh'}}> <div style={{background: '#fff', margin: '0 auto', position: 'relative'}}> <SearchField isBleeding isFocused={boolean('isFocused', false, 'props')} isOpen={boolean('isOpen', false, 'props')} results={ <SearchResults activeIndex={number('activeIndex', -1, 'props')} isBleeding isLoading={boolean('isLoading', false, 'props')} items={items} query={query} renderItem={(key) => ( <div key={key.hit._id} style={{padding: '0.75em 1em'}}> {key} </div> )} /> } value={query} onChange={() => action('onChange')} /> </div> </div> ) }
39,926
https://github.com/laigukf/LaiguSDK-iOS/blob/master/Laigu-SDK-Demo/Laigu-SDK-Demo/ViewController.m
Github Open Source
Open Source
MIT
2,021
LaiguSDK-iOS
laigukf
Objective-C
Code
493
2,607
// // ViewController.m // Laigu-SDK-Demo // // Created by zhangshunxing on 2017/12/18. // Copyright © 2017年 Laigu. All rights reserved. // #import "ViewController.h" #import "LGChatViewManager.h" #import "LGChatDeviceUtil.h" #import "DevelopViewController.h" #import <LaiGuSDK/LaiguSDK.h> #import "NSArray+LGFunctional.h" #import "LGBundleUtil.h" #import "LGAssetUtil.h" #import "LGImageUtil.h" #import "LGToast.h" #import "LGMessageFormInputModel.h" #import "LGMessageFormViewManager.h" #import <LaiGuSDK/LGManager.h> @interface ViewController () @property (nonatomic, strong) NSNumber *unreadMessagesCount; @end static CGFloat const kLGButtonVerticalSpacing = 16.0; static CGFloat const kLGButtonHeight = 42.0; static CGFloat const kLGButtonToBottomSpacing = 128.0; @implementation ViewController{ UIImageView *appIconImageView; UIButton *basicFunctionBtn; UIButton *devFunctionBtn; CGRect deviceFrame; CGFloat buttonWidth; } - (void)viewDidLoad { [super viewDidLoad]; deviceFrame = [LGChatDeviceUtil getDeviceFrameRect:self]; buttonWidth = deviceFrame.size.width / 2; self.navigationItem.title = @"来鼓 SDK"; [self initAppIcon]; [self initFunctionButtons]; } #pragma mark 集成第五步: 跳转到聊天界面 - (void)pushToLaiguVC:(UIButton *)button { #pragma mark 总之, 要自定义UI层 请参考 LGChatViewStyle.h类中的相关的方法 ,要修改逻辑相关的 请参考LGChatViewManager.h中相关的方法 #pragma mark 最简单的集成方法: 全部使用laigu的, 不做任何自定义UI. LGChatViewManager *chatViewManager = [[LGChatViewManager alloc] init]; [chatViewManager pushLGChatViewControllerInViewController:self]; // #pragma mark 觉得返回按钮系统的太丑 想自定义 采用下面的方法 // LGChatViewManager *chatViewManager = [[LGChatViewManager alloc] init]; // LGChatViewStyle *aStyle = [chatViewManager chatViewStyle]; //// [aStyle setNavBarTintColor:[UIColor blueColor]]; // [aStyle setNavBackButtonImage:[UIImage imageNamed:@"laigu-icon"]]; // [chatViewManager pushLGChatViewControllerInViewController:self]; #pragma mark 觉得头像 方形不好看 ,设置为圆形. // LGChatViewManager *chatViewManager = [[LGChatViewManager alloc] init]; // LGChatViewStyle *aStyle = [chatViewManager chatViewStyle]; // [aStyle setEnableRoundAvatar:YES]; // [aStyle setEnableOutgoingAvatar:NO]; //不显示用户头像 // [aStyle setEnableIncomingAvatar:NO]; //不显示客服头像 // [chatViewManager pushLGChatViewControllerInViewController:self]; #pragma mark 导航栏 右按钮 想自定义 ,但是不到万不得已,不推荐使用这个,会造成laigu功能的缺失,因为这个按钮 1 当你在工作台打开机器人开关后 显示转人工,点击转为人工客服. 2在人工客服时 还可以评价客服 // LGChatViewManager *chatViewManager = [[LGChatViewManager alloc] init]; // LGChatViewStyle *aStyle = [chatViewManager chatViewStyle]; // UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom]; // [bt setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal]; // [aStyle setNavBarRightButton:bt]; // [chatViewManager pushLGChatViewControllerInViewController:self]; #pragma mark 客户自定义信息 // LGChatViewManager *chatViewManager = [[LGChatViewManager alloc] init]; // [chatViewManager setClientInfo:@{@"name":@"来鼓测试777",@"gender":@"woman22",@"age":@"400",@"address":@"北京昌平回龙观"} override:YES]; // [chatViewManager setClientInfo:@{@"name":@"123测试123",@"gender":@"man11",@"age":@"100"}]; // [chatViewManager setLoginCustomizedId:@"12313812381263786786123698"]; // [chatViewManager pushLGChatViewControllerInViewController:self]; #pragma mark 预发送消息 // LGChatViewManager *chatViewManager = [[LGChatViewManager alloc] init]; // [chatViewManager setPreSendMessages: @[@"我想咨询的订单号:【1705045496811】"]]; // [chatViewManager pushLGChatViewControllerInViewController:self]; #pragma mark 如果你想绑定自己的用户系统 ,当然推荐你使用 客户自定义信息来绑定用户的相关个人信息 #pragma mark 切记切记切记 一定要确保 customId 是唯一的,这样保证 customId和laigu生成的用户ID是一对一的 // LGChatViewManager *chatViewManager = [[LGChatViewManager alloc] init]; // NSString *customId = @"获取你们自己的用户ID 或 其他唯一标识的"; // if (customId){ // [chatViewManager setLoginCustomizedId:customId]; // }else{ // #pragma mark 切记切记切记 下面这一行是错误的写法 , 这样会导致 ID = "notadda" 和 laigu多个用户绑定,最终导致 对话内容错乱 A客户能看到 B C D的客户的对话内容 // //[chatViewManager setLoginCustomizedId:@"notadda"]; // } // [chatViewManager pushLGChatViewControllerInViewController:self]; #pragma mark 留言模式 适用于 刚起步,人工客服成本没有,只能留言. // [self feedback]; } - (void)feedback { LGMessageFormViewManager *messageFormViewManager = [[LGMessageFormViewManager alloc] init]; LGMessageFormViewStyle *style = [messageFormViewManager messageFormViewStyle]; style.navBarColor = [UIColor whiteColor]; [messageFormViewManager presentLGMessageFormViewControllerInViewController:self]; } #pragma 开发者的高级功能 其中有调用来鼓SDK的API接口 - (void)didTapDevFunctionBtn:(UIButton *)button { //开发者功能 DevelopViewController *viewController = [[DevelopViewController alloc] init]; [self.navigationController pushViewController:viewController animated:YES]; } - (void)initAppIcon { CGFloat imageWidth = deviceFrame.size.width / 4; appIconImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"laigu-icon"]]; appIconImageView.frame = CGRectMake(deviceFrame.size.width/2 - imageWidth/2, deviceFrame.size.height / 4, imageWidth, imageWidth); appIconImageView.backgroundColor = [UIColor clearColor]; [self.view addSubview:appIconImageView]; } - (void)initFunctionButtons { devFunctionBtn = [UIButton buttonWithType:UIButtonTypeCustom]; devFunctionBtn.frame = CGRectMake(deviceFrame.size.width/2 - buttonWidth/2, deviceFrame.size.height - kLGButtonToBottomSpacing, buttonWidth, kLGButtonHeight); devFunctionBtn.backgroundColor = [UIColor colorWithHexString:@"#0044ff"]; [devFunctionBtn setTitle:@"开发者功能" forState:UIControlStateNormal]; [devFunctionBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [self.view addSubview:devFunctionBtn]; basicFunctionBtn = [UIButton buttonWithType:UIButtonTypeCustom]; basicFunctionBtn.frame = CGRectMake(devFunctionBtn.frame.origin.x, devFunctionBtn.frame.origin.y - kLGButtonVerticalSpacing - kLGButtonHeight, buttonWidth, kLGButtonHeight); basicFunctionBtn.backgroundColor = devFunctionBtn.backgroundColor; [basicFunctionBtn setTitle:@"在线客服" forState:UIControlStateNormal]; [basicFunctionBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [self.view addSubview:basicFunctionBtn]; [devFunctionBtn addTarget:self action:@selector(didTapDevFunctionBtn:) forControlEvents:UIControlEventTouchUpInside]; [basicFunctionBtn addTarget:self action:@selector(pushToLaiguVC:) forControlEvents:UIControlEventTouchUpInside]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } @end
23,453
https://github.com/DJC-1984/DJC-1984.github.io/blob/master/widgets/Swipe/setting/nls/lv/strings.js
Github Open Source
Open Source
Apache-2.0
2,019
DJC-1984.github.io
DJC-1984
JavaScript
Code
55
217
define({ "styleText": "Izvēlieties pārvilkšanas rīka stilu", "vertical": "Vertikālā josla", "horizontal": "Horizontālā josla", "scope": "Tālskatis", "barColor": "Joslas krāsa", "layerText": "Izvēlieties slāni, kas jāpārvelk pēc noklusējuma.", "spyglassText": "Izvēlieties slāni, kas tiks rādīts tālskatī pēc noklusējuma.", "layerHint": "Piezīme. Ja slānis ir paslēpts augšējos slāņos, pārvilkšanai nebūs nekāda efekta.", "isZoom": "Pietuvināt uz pārvilkto slāni", "layersAvailable": "Izvēlieties pārvelkamos slāņus:" });
1,076
https://github.com/kraushm/hpctools/blob/master/reframechecks/debug/src_cuda/GDB/clist.py
Github Open Source
Open Source
BSD-3-Clause
2,021
hpctools
kraushm
Python
Code
36
107
# call with: source ./thisfile.py # if interactive, uncomment: #uncomment: python import re txt=gdb.execute('info args', to_string=True) regex = r'\s+clist = std::vector of length (\d+),' res = re.findall(regex, txt) gdb.execute('set $clist_len = %s' % res[0]) #uncomment: end
14,404
https://github.com/v-yahan/Interop-TestSuites/blob/master/ExchangeWebServices/Source/MS-OXWSCONT/Adapter/CaptureCode.cs
Github Open Source
Open Source
MIT
2,022
Interop-TestSuites
v-yahan
C#
Code
8,275
26,973
namespace Microsoft.Protocols.TestSuites.MS_OXWSCONT { using System; using Microsoft.Protocols.TestSuites.Common; using Microsoft.Protocols.TestTools; /// <summary> /// The class provides methods to verify data/operation format in MS-OXWSCONT. /// </summary> public partial class MS_OXWSCONTAdapter { #region Verify requirements related to GetItem operation /// <summary> /// Capture GetItemResponseType related requirements. /// </summary> /// <param name="getItemResponse">The response message of GetItem operation.</param> /// <param name="isSchemaValidated">A boolean value indicates the schema validation result. True means the response conforms with the schema, false means not.</param> private void VerifyGetContactItem(GetItemResponseType getItemResponse, bool isSchemaValidated) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R114"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R114 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 114, @"[In GetItem] The following is the WSDL port type specification for the GetItem operation:<wsdl:operation name=""GetItem""> <wsdl:input message=""tns:GetItemSoapIn"" /> <wsdl:output message=""tns:GetItemSoapOut"" /> </wsdl:operation>"); ContactItemType[] contacts = Common.GetItemsFromInfoResponse<ContactItemType>(getItemResponse); foreach (ContactItemType contact in contacts) { // Capture ContactItemType Complex Type related requirements. this.VerifyContactItemTypeComplexType(contact, isSchemaValidated); } } #endregion #region Verify requirements related to DeleteItem operation /// <summary> /// Capture DeleteItemResponseType related requirements. /// </summary> /// <param name="isSchemaValidated">A boolean value indicates the schema validation result. True means the response conforms with the schema, false means not.</param> private void VerifyDeleteContactItem(bool isSchemaValidated) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R274"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R274 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 274, @"[In DeleteItem] The following is the WSDL port type specification for the DeleteItem operation: <wsdl:operation name=""DeleteItem""> <wsdl:input message=""tns:DeleteItemSoapIn"" /> <wsdl:output message=""tns:DeleteItemSoapOut"" /> </wsdl:operation>"); } #endregion #region Verify requirements related to UpdateItem operation /// <summary> /// Capture UpdateItemResponseType related requirements. /// </summary> /// <param name="isSchemaValidated">A boolean value indicates the schema validation result. True means the response conforms with the schema, false means not.</param> private void VerifyUpdateContactItem(bool isSchemaValidated) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R280"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R280 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 280, @"[In UpdateItem] The following is the WSDL port type specification for the UpdateItem operation: <wsdl:operation name=""UpdateItem""> <wsdl:input message=""tns:UpdateItemSoapIn"" /> <wsdl:output message=""tns:UpdateItemSoapOut"" /> </wsdl:operation>"); } #endregion #region Verify requirements related to MoveItem operation /// <summary> /// Capture MoveItemResponseType related requirements. /// </summary> /// <param name="isSchemaValidated">A boolean value indicates the schema validation result. True means the response conforms with the schema, false means not.</param> private void VerifyMoveContactItem(bool isSchemaValidated) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R286"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R286 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 286, @"[In MoveItem] The following is the WSDL port type specification for the MoveItem operation: <wsdl:operation name=""MoveItem""> <wsdl:input message=""tns:MoveItemSoapIn"" /> <wsdl:output message=""tns:MoveItemSoapOut"" /> </wsdl:operation>"); } #endregion #region Verify requirements related to CopyItem operation /// <summary> /// Capture CopyItemResponseType related requirements. /// </summary> /// <param name="isSchemaValidated">A boolean value indicates the schema validation result. True means the response conforms with the schema, false means not.</param> private void VerifyCopyContactItem(CopyItemResponseType copyItemResponse,bool isSchemaValidated) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R292"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R292 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 292, @"[In CopyItem] The following is the WSDL port type specification for the CopyItem operation: <wsdl:operation name=""CopyItem""> <wsdl:input message=""tns:CopyItemSoapIn"" /> <wsdl:output message=""tns:CopyItemSoapOut"" /> </wsdl:operation>"); // Verify the BaseResponseMessageType schema. this.VerifyBaseResponseMessageType(copyItemResponse); } #endregion #region Verify requirements related to AbchPersonItemType complex types /// <summary> /// Capture AbchPersonItemType Complex Type related requirements. /// </summary> /// <param name="abchPersonItemType">A person item from the response package of GetItem operation.</param> /// <param name="isSchemaValidated">A boolean value indicates the schema validation result. True means the response conforms with the schema, false means not.</param> private void VerifyAbchPersonItemTypeComplexType(AbchPersonItemType abchPersonItemType, bool isSchemaValidated) { Site.Assert.IsTrue(isSchemaValidated, "The schema validation result should be true!"); if (Common.IsRequirementEnabled(336002, this.Site) && abchPersonItemType != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R16003"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R16003 // If the abchPersonItemType element is not null and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 16003, @"[In t:AbchPersonItemType Complex Type] The type [AbchPersonItemType] is defined as follow: <xs:complexType name=""AbchPersonItemType"" > < xs:complexContent > < xs:extension base = ""t:ItemType"" > < xs:sequence > < xs:element name = ""PersonIdGuid"" type = ""t:GuidType"" minOccurs = ""0"" /> < xs:element name = ""PersonId"" type = ""xs:int"" minOccurs = ""0"" /> < xs:element name = ""FavoriteOrder"" type = ""xs:int"" minOccurs = ""0"" /> < xs:element name = ""TrustLevel"" type = ""xs:int"" minOccurs = ""0"" /> < xs:element name = ""RelevanceOrder1"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""RelevanceOrder2"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""AntiLinkInfo"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""ContactCategories"" type = ""t:ArrayOfStringsType"" minOccurs = ""0"" /> < xs:element name = ""ContactHandles"" type = ""t:ArrayOfAbchPersonContactHandlesType"" minOccurs = ""0"" /> < xs:element name = ""ExchangePersonIdGuid"" type = ""t:GuidType"" minOccurs = ""0"" /> </ xs:sequence > </ xs:extension > </ xs:complexContent > </ xs:complexType > "); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R336002"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R336002 // If the schema is validated, // the requirement can be validated. Site.CaptureRequirement( 336002, @"[In Appendix C: Product Behavior] Implementation does support the AbchPersonItemType complex type which specifies a person. (Exchange 2016 and above follow this behavior.)"); if (abchPersonItemType.AntiLinkInfo != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R16005"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R16005 Site.CaptureRequirementIfIsInstanceOfType( abchPersonItemType.AntiLinkInfo, typeof(String), 16005, @"[In t:AbchPersonItemType Complex Type] The type of child element AntiLinkInfo is xs:string ([XMLSCHEMA2])."); } if (abchPersonItemType.ContactCategories != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R16011"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R16011 Site.CaptureRequirementIfIsInstanceOfType( abchPersonItemType.ContactCategories, typeof(String[]), 16011, @"[In t:AbchPersonItemType Complex Type] The type of child element ContactCategories is t:ArrayOfStringsType ([MS-OXWSCDATA] section 2.2.4.13)."); } if(abchPersonItemType.FavoriteOrderSpecified == true) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R16019"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R16019 Site.CaptureRequirementIfIsInstanceOfType( abchPersonItemType.FavoriteOrder, typeof(int), 16019, @"[In t:AbchPersonItemType Complex Type] The type of child element FavoriteOrder is xs:int."); } } } #endregion #region Verify requirements related to CreateItem operation /// <summary> /// Capture CreateItemResponseType related requirements. /// </summary> /// <param name="isSchemaValidated">A boolean value indicates the schema validation result. True means the response conforms with the schema, false means not.</param> private void VerifyCreateContactItem(bool isSchemaValidated) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R298"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R298 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 298, @"[In CreateItem] The following is the WSDL port type specification for the CreateItem operation:<wsdl:operation name=""CreateItem""> <wsdl:input message=""tns:CreateItemSoapIn"" /> <wsdl:output message=""tns:CreateItemSoapOut"" /> </wsdl:operation>"); } #endregion #region Verify requirements related to ContactItemType complex types /// <summary> /// Capture ContactItemType Complex Type related requirements. /// </summary> /// <param name="contactItemType">A contact item from the response package of GetItem operation.</param> /// <param name="isSchemaValidated">A boolean value indicates the schema validation result. True means the response conforms with the schema, false means not.</param> private void VerifyContactItemTypeComplexType(ContactItemType contactItemType, bool isSchemaValidated) { Site.Assert.IsTrue(isSchemaValidated, "The schema validation result should be true!"); if (contactItemType != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R19"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R19 // If the contactItemType element is not null and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 19, @"[In t: ContactItemType Complex Type] The type[ContactItemType] is defined as follow: < xs:complexType name = ""ContactItemType"" > < xs:complexContent > < xs:extension base = ""t: ItemType"" > < xs:sequence > < xs:element name = ""FileAs"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""FileAsMapping"" type = ""t: FileAsMappingType"" minOccurs = ""0"" /> < xs:element name = ""DisplayName"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""GivenName"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""Initials"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""MiddleName"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""Nickname"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""CompleteName"" type = ""t: CompleteNameType"" minOccurs = ""0"" /> < xs:element name = ""CompanyName"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""EmailAddresses"" type = ""t: EmailAddressDictionaryType"" minOccurs = ""0"" /> < xs:element name = ""PhysicalAddresses"" type = ""t: PhysicalAddressDictionaryType"" minOccurs = ""0"" /> < xs:element name = ""PhoneNumbers"" type = ""t: PhoneNumberDictionaryType"" minOccurs = ""0"" /> < xs:element name = ""AssistantName"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""Birthday"" type = ""xs: dateTime"" minOccurs = ""0"" /> < xs:element name = ""BusinessHomePage"" type = ""xs: anyURI"" minOccurs = ""0"" /> < xs:element name = ""Children"" type = ""t: ArrayOfStringsType"" minOccurs = ""0"" /> < xs:element name = ""Companies"" type = ""t: ArrayOfStringsType"" minOccurs = ""0"" /> < xs:element name = ""ContactSource"" type = ""t: ContactSourceType"" minOccurs = ""0"" /> < xs:element name = ""Department"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""Generation"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""ImAddresses"" type = ""t: ImAddressDictionaryType"" minOccurs = ""0"" /> < xs:element name = ""JobTitle"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""Manager"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""Mileage"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""OfficeLocation"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""PostalAddressIndex"" type = ""t: PhysicalAddressIndexType"" minOccurs = ""0"" /> < xs:element name = ""Profession"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""SpouseName"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""Surname"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""WeddingAnniversary"" type = ""xs: dateTime"" minOccurs = ""0"" /> < xs:element name = ""HasPicture"" type = ""xs: boolean"" minOccurs = ""0"" /> < xs:element name = ""PhoneticFullName"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""PhoneticFirstName"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""PhoneticLastName"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""Alias"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""Notes"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""Photo"" type = ""xs: base64Binary"" minOccurs = ""0"" /> < xs:element name = ""UserSMIMECertificate"" type = ""t: ArrayOfBinaryType"" minOccurs = ""0"" /> < xs:element name = ""MSExchangeCertificate"" type = ""t: ArrayOfBinaryType"" minOccurs = ""0"" /> < xs:element name = ""DirectoryId"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""ManagerMailbox"" type = ""t: SingleRecipientType"" minOccurs = ""0"" /> < xs:element name = ""DirectReports"" type = ""t: ArrayOfRecipientsType"" minOccurs = ""0"" /> < xs:element name = ""AccountName"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""IsAutoUpdateDisabled"" type = ""xs: boolean"" minOccurs = ""0"" /> < xs:element name = ""IsMessengerEnabled"" type = ""xs: boolean"" minOccurs = ""0"" /> < xs:element name = ""Comment"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""ContactShortId"" type = ""xs: int"" minOccurs = ""0"" /> < xs:element name = ""ContactType"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""Gender"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""IsHidden"" type = ""xs: boolean"" minOccurs = ""0"" /> < xs:element name = ""ObjectId"" type = ""xs: string"" minOccurs = ""0"" /> < xs:element name = ""PassportId"" type = ""xs: long"" minOccurs = ""0"" /> < xs:element name = ""IsPrivate"" type = ""xs: boolean"" minOccurs = ""0"" /> < xs:element name = ""SourceId"" type = ""xs: string"" minOccurs = ""0"" /> <xs:element name=""TrustLevel"" type = ""xs:int"" minOccurs = ""0"" /> < xs:element name = ""CreatedBy"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""Urls"" type = ""t:ContactUrlDictionaryType"" minOccurs = ""0"" /> < xs:element name = ""AbchEmailAddresses"" type = ""t: AbchEmailAddressDictionaryType"" minOccurs = ""0"" /> < xs:element name = ""Cid"" type = ""xs:long"" minOccurs = ""0"" /> < xs:element name = ""SkypeAuthCertificate"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""SkypeContext"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""SkypeId"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""SkypeRelationship"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""YomiNickname"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""XboxLiveTag"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""InviteFree"" type = ""xs:boolean"" minOccurs = ""0"" /> < xs:element name = ""HidePresenceAndProfile"" type = ""xs:boolean"" minOccurs = ""0"" /> < xs:element name = ""IsPendingOutbound"" type = ""xs:boolean"" minOccurs = ""0"" /> < xs:element name = ""SupportGroupFeeds"" type = ""xs:boolean"" minOccurs = ""0"" /> < xs:element name = ""UserTileHash"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""UnifiedInbox"" type = ""xs:boolean"" minOccurs = ""0"" /> < xs:element name = ""Mris"" type = ""t:ArrayOfStringsType"" minOccurs = ""0"" /> < xs:element name = ""Wlid"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""AbchContactId"" type = ""t:GuidType"" minOccurs = ""0"" /> < xs:element name = ""NotInBirthdayCalendar"" type = ""xs:boolean"" minOccurs = ""0"" /> < xs:element name = ""ShellContactType"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""ImMri"" type = ""xs:int"" minOccurs = ""0"" /> < xs:element name = ""PresenceTrustLevel"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""OtherMri"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""ProfileLastChanged"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""MobileImEnabled"" type = ""xs:boolean"" minOccurs = ""0"" /> < xs:element name = ""DisplayNamePrefix"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""YomiGivenName"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""YomiSurname"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""PersonalNotes"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""PersonId"" type = ""xs: int"" minOccurs = ""0"" /> </ xs:sequence > </ xs:entension > </ xs:complexContent > </ xs:complexType > "); } if (Common.IsRequirementEnabled(1275004, this.Site) && contactItemType.AccountName != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R334001"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R334001 Site.CaptureRequirementIfIsInstanceOfType( contactItemType.AccountName, typeof(string), 334001, @"[In t:ContactItemType Complex Type] The type of element AccountName is xs:string."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275004"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275004 // If schema is validated, the requirement can be validated. this.Site.CaptureRequirement( 1275004, @"[In Appendix C: Product Behavior] Implementation does support AccountName element. (Exchange 2016 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275006, this.Site)) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R334003"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R334003 // If schema is validated, the requirement can be validated. Site.CaptureRequirementIfIsInstanceOfType( contactItemType.IsAutoUpdateDisabled, typeof(Boolean), 334003, @"[In t:ContactItemType Complex Type] The type of element IsAutoUpdateDisabled is xs:boolean."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275006"); // Verify MS - OXWSCONT requirement: MS - OXWSCONT_R1275006 // If schema is validated, the requirement can be validated. Site.CaptureRequirement( 1275006, @"[In Appendix C: Product Behavior] Implementation does support the IsAutoUpdateDisabled element. (Exchange 2016 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275008, this.Site) && contactItemType.Comment != null) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R334007"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R334007 Site.CaptureRequirementIfIsInstanceOfType( contactItemType.Comment, typeof(string), 334007, @"[In t:ContactItemType Complex Type] The type of element Comment is xs:string."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275008"); // Verify MS - OXWSCONT requirement: MS - OXWSCONT_R1275008 // If schema is validated, the requirement can be validated. this.Site.CaptureRequirement( 1275008, @"[In Appendix C: Product Behavior] Implementation does support the Comment element. (Exchange 2016 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275012, this.Site) && contactItemType.ContactType != null) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R334007"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R334011 Site.CaptureRequirementIfIsInstanceOfType( contactItemType.ContactType, typeof(string), 334011, @"[In t:ContactItemType Complex Type] The type of element ContactType is xs:string."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275012"); // Verify MS - OXWSCONT requirement: MS - OXWSCONT_R1275012 // If schema is validated, the requirement can be validated. this.Site.CaptureRequirement( 1275012, @"[In Appendix C: Product Behavior] Implementation does support the ContactType element. (Exchange 2016 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275014, this.Site) && contactItemType.Gender != null) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R334013"); Site.CaptureRequirementIfIsInstanceOfType( contactItemType.Gender, typeof(string), 334013, @"[In t:ContactItemType Complex Type] The type of element Gender is xs:string."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275014"); // Verify MS - OXWSCONT requirement: MS - OXWSCONT_R1275014 // If schema is validated, the requirement can be validated. Site.CaptureRequirement( 1275014, @"[In Appendix C: Product Behavior] Implementation does support the Gender element. (Exchange 2016 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275018, this.Site) && contactItemType.ObjectId != null) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R334017"); Site.CaptureRequirementIfIsInstanceOfType( contactItemType.ObjectId, typeof(string), 334017, @"[In t:ContactItemType Complex Type] The type of element ObjectId is xs:string."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275018"); // Verify MS - OXWSCONT requirement: MS - OXWSCONT_R1275018 // If schema is validated, the requirement can be validated. Site.CaptureRequirement( 1275018, @"[In Appendix C: Product Behavior] Implementation does support the ObjectId element. (Exchange 2016 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275026, this.Site) && contactItemType.SourceId != null) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R334025"); Site.CaptureRequirementIfIsInstanceOfType( contactItemType.SourceId, typeof(string), 334025, @"[In t:ContactItemType Complex Type] The type of element SourceId is xs:string."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275026"); // Verify MS - OXWSCONT requirement: MS - OXWSCONT_R1275026 // If schema is validated, the requirement can be validated. Site.CaptureRequirement( 1275026, @"[In Appendix C: Product Behavior] Implementation does support the SourceId element. (Exchange 2016 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275034, this.Site) && contactItemType.CidSpecified) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R334033"); Site.CaptureRequirementIfIsInstanceOfType( contactItemType.Cid, typeof(long), 334033, @"[In t:ContactItemType Complex Type] The type of element Cid is xs:long."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275034"); // Verify MS - OXWSCONT requirement: MS - OXWSCONT_R1275034 // If schema is validated, the requirement can be validated. Site.CaptureRequirement( 1275034, @"[In Appendix C: Product Behavior] Implementation does support the Cid element. (Exchange 2016 and above follow this behavior.)"); } if(contactItemType.PersonId != null) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R334021"); // Verify MS - OXWSCONT requirement: MS - OXWSCONT_R334021 // If schema is validated, the requirement can be validated. Site.CaptureRequirementIfIsInstanceOfType( contactItemType.PersonId, typeof(ItemIdType), 334021, @"[In t:ContactItemType Complex Type] The type of element PersonId is t:ItemIdType ([MS-OXWSCORE] section 2.2.4.25)."); } if (Common.IsRequirementEnabled(1275036, this.Site) && contactItemType.SkypeAuthCertificate != null) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R334035"); Site.CaptureRequirementIfIsInstanceOfType( contactItemType.SkypeAuthCertificate, typeof(string), 334035, @"[In t:ContactItemType Complex Type] The type of element SkypeAuthCertificate is xs:string."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275036"); // Verify MS - OXWSCONT requirement: MS - OXWSCONT_R1275036 // If schema is validated, the requirement can be validated. Site.CaptureRequirement( 1275036, @"[In Appendix C: Product Behavior] Implementation does support the SkypeAuthCertificate element. (Exchange 2016 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275040, this.Site) && contactItemType.SkypeId != null) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R334039"); Site.CaptureRequirementIfIsInstanceOfType( contactItemType.SkypeId, typeof(string), 334039, @"[In t:ContactItemType Complex Type] The type of element SkypeId is xs:string."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275040"); // Verify MS - OXWSCONT requirement: MS - OXWSCONT_R1275040 // If schema is validated, the requirement can be validated. Site.CaptureRequirement( 1275040, @"[In Appendix C: Product Behavior] Implementation does support the SkypeId element. (Exchange 2016 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275044, this.Site) && contactItemType.YomiNickname != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R334043"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R334043 Site.CaptureRequirementIfIsInstanceOfType( contactItemType.YomiNickname, typeof(string), 334043, @"[In t:ContactItemType Complex Type] The type of element YomiNickname is xs:string."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275044"); // Verify MS - OXWSCONT requirement: MS - OXWSCONT_R1275044 // If schema is validated, the requirement can be validated. this.Site.CaptureRequirement( 1275044, @"[In Appendix C: Product Behavior] Implementation does support the YomiNickname element. (Exchange 2016 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275118, this.Site) && contactItemType.YomiGivenName != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R334069"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R334069 Site.CaptureRequirementIfIsInstanceOfType( contactItemType.YomiGivenName, typeof(string), 334069, @"[In t:ContactItemType Complex Type] The type of element YomiGivenName is xs:string."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275118"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275118 // If schema is validated, the requirement can be validated. this.Site.CaptureRequirement( 1275118, @"[In Appendix C: Product Behavior] Implementation does support the YomiGivenName element. (Exchange 2016 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275120, this.Site) && contactItemType.YomiSurname != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R334071"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R334071 Site.CaptureRequirementIfIsInstanceOfType( contactItemType.YomiSurname, typeof(string), 334071, @"[In t:ContactItemType Complex Type] The type of element YomiSurname is xs:string."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275120"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275120 // If schema is validated, the requirement can be validated. this.Site.CaptureRequirement( 1275120, @"[In Appendix C: Product Behavior] Implementation does support the YomiSurname element. (Exchange 2016 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275116, this.Site) && contactItemType.DisplayNamePrefix != null) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R334067"); Site.CaptureRequirementIfIsInstanceOfType( contactItemType.DisplayNamePrefix, typeof(string), 334067, @"[In t:ContactItemType Complex Type] The type of element DisplayNamePrefix is xs:string."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275116"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275116 // If the DisplayNamePrefix element is specified and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 1275116, @"[In Appendix C: Product Behavior] Implementation does support the DisplayNamePrefix element. (Exchange 2016 and above follow this behavior.)"); } if (contactItemType.FileAsMappingSpecified) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R128"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R128 // If the FileAsMapping element is specified and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 128, @"[In t:FileAsMappingType Simple Type] The type [FileAsMappingType] is defined as follow: <xs:simpleType name=""FileAsMappingType""> <xs:restriction base=""xs:string"" > <xs:enumeration value=""None"" /> <xs:enumeration value=""LastCommaFirst"" /> <xs:enumeration value=""FirstSpaceLast"" /> <xs:enumeration value=""Company"" /> <xs:enumeration value=""LastCommaFirstCompany"" /> <xs:enumeration value=""CompanyLastFirst"" /> <xs:enumeration value=""LastFirst"" /> <xs:enumeration value=""LastFirstCompany"" /> <xs:enumeration value=""CompanyLastCommaFirst"" /> <xs:enumeration value=""LastFirstSuffix"" /> <xs:enumeration value=""LastSpaceFirstCompany"" /> <xs:enumeration value=""CompanyLastSpaceFirst"" /> <xs:enumeration value=""LastSpaceFirst"" /> <xs:enumeration value=""DisplayName"" /> <xs:enumeration value=""FirstName"" /> <xs:enumeration value=""LastFirstMiddleSuffix"" /> <xs:enumeration value=""LastName"" /> <xs:enumeration value=""Empty"" /> </xs:restriction> </xs:simpleType>"); if (Common.IsRequirementEnabled(1275096, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275096"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275096 // If the FileAsMapping element is specified and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 1275096, @"[In Appendix C: Product Behavior] Implementation does support the DisplayName attribute. (Exchange 2010 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275098, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275098"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275098 // If the FileAsMapping element is specified and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 1275098, @"[In Appendix C: Product Behavior] Implementation does support the FirstName attribute. (Exchange 2010 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275100, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275100"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275100 // If the FileAsMapping element is specified and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 1275100, @"[In Appendix C: Product Behavior] Implementation does support the LastFirstMiddleSuffix attribute. (Exchange 2010 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275102, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275102"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275102 // If the FileAsMapping element is specified and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 1275102, @"[In Appendix C: Product Behavior] Implementation does support the LastName attribute. (Exchange 2010 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275104, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275104"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275104 // If the FileAsMapping element is specified and the schema is validated, // the requirement can be validated. Site.CaptureRequirement( 1275104, @"[In Appendix C: Product Behavior] Implementation does support the Empty attribute. (Exchange 2010 and above follow this behavior.)"); } } if (Common.IsRequirementEnabled(1275032, this.Site) && contactItemType.Urls != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R224011"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R224011 // If the Urls element is not null and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 224011, @"[In t:ContactUrlDictionaryType Complex Type] The type [ContactUrlDictionaryType] is defined as follow: <xs:complexType name=""ContactUrlDictionaryType"" > < xs:sequence > < xs:element name = ""Url"" type = ""t:ContactUrlDictionaryEntryType"" maxOccurs = ""unbounded"" /> </ xs:sequence > </ xs:complexType > "); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275032"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275032 // If the Urls element is not null and the schema is validated, // the requirement can be validated. Site.CaptureRequirement( 1275032, @"[In Appendix C: Product Behavior] Implementation does support the Urls element. (Exchange 2016 and above follow this behavior.)"); if (Common.IsRequirementEnabled(1275084, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R334031"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R334031 // If the Urls element is not null and the schema is validated, // the requirement can be validated. Site.CaptureRequirement( 334031, @"[In t:ContactItemType Complex Type] The type of element Urls is t:ContactUrlDictionaryType (section 3.1.4.1.1.9)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275084"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275084 // If the Urls element is not null and the schema is validated, // the requirement can be validated. Site.CaptureRequirement( 1275084, @"[In Appendix C: Product Behavior] Implementation does support the ContactUrlDictionaryType complex type. (Exchange 2016 and above follow this behavior.)."); } for (int i = 0; i < contactItemType.Urls.Length; i++) { if (contactItemType.Urls[i] != null) { if (Common.IsRequirementEnabled(1275082, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275082"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275082 // If the entry of Urls is not null and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 1275082, @"[In Appendix C: Product Behavior] Implementation does support the ContactUrlDictionaryEntryType complex type. (Exchange 2016 and above follow this behavior.)"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R224002"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R224002 // If the entry of Urls is not null and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 224002, @"[In t:ContactUrlDictionaryEntryType Complex Type] The type [ContactUrlDictionaryEntryType] is defined as follow: <xs:complexType name=""ContactUrlDictionaryEntryType"" > < xs:sequence > < xs:element name = ""Type"" type = ""t:ContactUrlKeyType"" minOccurs = ""1"" /> < xs:element name = ""Address"" type = ""xs:string"" minOccurs = ""0"" /> < xs:element name = ""Name"" type = ""xs:string"" minOccurs = ""0"" /> </ xs:sequence > </ xs:complexType > "); } if (Common.IsRequirementEnabled(1275094, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275094"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275094 // The Type element is a required element of ContactUrlDictionaryEntryType, if the entry as ContactUrlDictionaryEntryType is not null, // and the schema is validated, this requirement can be validated. Site.CaptureRequirement( 1275094, @"[In Appendix C: Product Behavior] Implementation does support the ContactUrlKeyType simple type. (Exchange 2016 and above follow this behavior.)"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R120009"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R120009 // The Type element is a required element of ContactUrlDictionaryEntryType, if the entry as ContactUrlDictionaryEntryType is not null, // and the schema is validated, this requirement can be validated. Site.CaptureRequirement( 120009, @"[In t:ContactUrlKeyType Simple Type] The type [ContactUrlKeyType] is defined as follow: <xs:simpleType name=""ContactUrlKeyType"" > < xs:restriction base = ""xs:string"" > < xs:enumeration value = ""Personal"" /> < xs:enumeration value = ""Business"" /> < xs:enumeration value = ""Attachment"" /> < xs:enumeration value = ""EbcDisplayDefinition"" /> < xs:enumeration value = ""EbcFinalImage"" /> < xs:enumeration value = ""EbcLogo"" /> < xs:enumeration value = ""Feed"" /> < xs:enumeration value = ""Image"" /> < xs:enumeration value = ""InternalMarker"" /> < xs:enumeration value = ""Other"" /> </ xs:restriction > </ xs:simpleType > "); } else { Site.Assert.Fail("The entry of PhysicalAddresses should not be null!"); } } } } if (contactItemType.Companies != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCDATA_R1081"); // Verify MS-OXWSCDATA requirement: MS-OXWSCDATA_R1081 // If the Companies element is not null and schema is validated, // the requirement can be validated. Site.CaptureRequirement( "MS-OXWSCDATA", 1081, @"[In t:ArrayOfStringsType Complex Type] The type [ArrayOfStringsType] is defined as follow: <xs:complexType name=""ArrayOfStringsType""> <xs:sequence> <xs:element name=""String"" type=""xs:string"" minOccurs=""0"" maxOccurs=""unbounded""/> </xs:sequence> </xs:complexType>"); } if (contactItemType.PostalAddressIndexSpecified) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R178"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R178 // If the PostalAddressIndex element is specified and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 178, @"[t:PhysicalAddressIndexType Simple Type] The type [PhysicalAddressIndexType] is defined as follow:<xs:simpleType name=""PhysicalAddressIndexType""> <xs:restriction base=""xs:string"" > <xs:enumeration value=""None"" /> <xs:enumeration value=""Business"" /> <xs:enumeration value=""Home"" /> <xs:enumeration value=""Other"" /> </xs:restriction> </xs:simpleType>"); } if (contactItemType.CompleteName != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R192"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R192 // If the CompleteName element is not null and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 192, @"[In t:CompleteNameType Complex Type] The type [CompleteNameType] is defined as follow:<xs:complexType name=""CompleteNameType""> <xs:sequence> <xs:element name=""Title"" type=""xs:string"" minOccurs=""0"" /> <xs:element name=""FirstName"" type=""xs:string"" minOccurs=""0"" /> <xs:element name=""MiddleName"" type=""xs:string"" minOccurs=""0"" /> <xs:element name=""LastName"" type=""xs:string"" minOccurs=""0"" /> <xs:element name=""Suffix"" type=""xs:string"" minOccurs=""0"" /> <xs:element name=""Initials"" type=""xs:string"" minOccurs=""0"" /> <xs:element name=""FullName"" type=""xs:string"" minOccurs=""0"" /> <xs:element name=""Nickname"" type=""xs:string"" minOccurs=""0"" /> <xs:element name=""YomiFirstName"" type=""xs:string"" minOccurs=""0"" /> <xs:element name=""YomiLastName"" type=""xs:string"" minOccurs=""0"" /> </xs:sequence> </xs:complexType>"); } if (contactItemType.EmailAddresses != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R236"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R236 // If the EmailAddresses is not null and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 236, @"[In t:EmailAddressDictionaryType Complex Type] The type [EmailAddressDictionaryType] is defined as follow:<xs:complexType name=""EmailAddressDictionaryType""> <xs:sequence> <xs:element name=""Entry"" type=""t:EmailAddressDictionaryEntryType"" maxOccurs=""unbounded"" /> </xs:sequence> </xs:complexType>"); for (int i = 0; i < contactItemType.EmailAddresses.Length; i++) { if (contactItemType.EmailAddresses[i] != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R226"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R226 // If the entry of EmailAddresses is not null and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 226, @"[In t: EmailAddressDictionaryEntryType Complex Type] The type[EmailAddressDictionaryEntryType] is defined as follow: < xs:complexType name = ""EmailAddressDictionaryEntryType"" > < xs:simpleContent > < xs:extension base = ""xs: string"" > < xs:attribute name = ""Key"" type = ""t: EmailAddressKeyType"" use = ""required"" /> < xs:attribute name = ""Name"" type = ""xs: string"" use = ""optional"" /> < xs:attribute name = ""RoutingType"" type = ""xs: string"" use = ""optional"" /> < xs:attribute name = ""MailboxType"" type = ""t: MailboxTypeType"" use = ""optional"" /> </ xs:extension > </ xs:simpleContent > </ xs:complexType > "); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R122"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R122 // The Key element is a required element of EmailAddressDictionaryEntryType, if the entry as EmailAddressDictionaryEntryType is not null, // and the schema is validated, this requirement can be validated. Site.CaptureRequirement( 122, @"[In t:EmailAddressKeyType Simple Type] The type [EmailAddressKeyType] is defined as follow: <xs:simpleType name=""EmailAddressKeyType""> <xs:restriction base=""xs:string"" > <xs:enumeration value=""EmailAddress1"" /> <xs:enumeration value=""EmailAddress2"" /> <xs:enumeration value=""EmailAddress3"" /> </xs:restriction> </xs:simpleType>"); if (Common.IsRequirementEnabled(1275086, this.Site) && contactItemType.EmailAddresses[i].Name !=null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275086"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275086 // If the Name is not null and the schema is validated, this requirement can be validated. Site.CaptureRequirement( 1275086, @"[In Appendix C: Product Behavior] Implementation does support the Name attribute. (Exchange 2010 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275088, this.Site) && contactItemType.EmailAddresses[i].RoutingType != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275088"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275088 // If the Name is not null and the schema is validated, this requirement can be validated. Site.CaptureRequirement( 1275088, @"[In Appendix C: Product Behavior] Implementation does support the Name attribute. (Exchange 2010 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275090, this.Site) && contactItemType.EmailAddresses[i].MailboxTypeSpecified == true) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275090"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275090 // If the Name is not null and the schema is validated, this requirement can be validated. Site.CaptureRequirement( 1275090, @"[In Appendix C: Product Behavior] Implementation does support the Name attribute. (Exchange 2010 and above follow this behavior.)"); } } else { Site.Assert.Fail("The entry of EmailAddresses should not be null!"); } } } if (contactItemType.ImAddresses != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R244"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R244 // If the ImAddresses is not null and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 244, @"[In t:ImAddressDictionaryType Complex Type] The type [ImAddressDictionaryType] is defined as follow:<xs:complexType name=""ImAddressDictionaryType""> <xs:sequence> <xs:element name=""Entry"" type=""t:ImAddressDictionaryEntryType"" maxOccurs=""unbounded"" /> </xs:sequence> </xs:complexType>"); for (int i = 0; i < contactItemType.ImAddresses.Length; i++) { if (contactItemType.ImAddresses[i] != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R240"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R240 // If the entry of ImAddresses is not null and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 240, @"[In t:ImAddressDictionaryEntryType Complex Type] The type [ImAddressDictionaryEntryType] is defined as follow:<xs:complexType name=""ImAddressDictionaryEntryType""> <xs:simpleContent> <xs:extension base=""xs:string"" > <xs:attribute name=""key"" type=""t:ImAddressKeyType"" use=""required"" /> </xs:extension> </xs:simpleContent> </xs:complexType>"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R149"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R149 // The Key element is a required element of ImAddressDictionaryEntryType, if the entry as ImAddressDictionaryEntryType is not null, // and the schema is validated, this requirement can be validated. Site.CaptureRequirement( 149, @"[In t:ImAddressKeyType Simple Type] The type [ImAddressKeyType] is defined as follow: <xs:simpleType name=""ImAddressKeyType""> <xs:restriction base=""xs:string"" > <xs:enumeration value=""ImAddress1"" /> <xs:enumeration value=""ImAddress2"" /> <xs:enumeration value=""ImAddress3"" /> </xs:restriction> </xs:simpleType>"); } else { Site.Assert.Fail("The entry of ImAddresses should not be null!"); } } } if (contactItemType.PhoneNumbers != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R252"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R252 // If the PhoneNumbers is not null and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 252, @"[In t:PhoneNumberDictionaryType Complex Type] The type [PhoneNumberDictionaryType] is defined as follow:<xs:complexType name=""PhoneNumberDictionaryType""> <xs:sequence> <xs:element name=""Entry"" type=""t:PhoneNumberDictionaryEntryType"" maxOccurs=""unbounded"" /> </xs:sequence> </xs:complexType>"); for (int i = 0; i < contactItemType.PhoneNumbers.Length; i++) { if (contactItemType.PhoneNumbers[i] != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R248"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R248 // If the entry of PhoneNumbers is not null and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 248, @"[In t:PhoneNumberDictionaryEntryType Complex Type] The type [PhoneNumberDictionaryEntryType] is defined as follow:<xs:complexType name=""PhoneNumberDictionaryEntryType""> <xs:simpleContent> <xs:extension base=""xs:string"" > <xs:attribute name=""Key"" type=""t:PhoneNumberKeyType"" use=""required"" /> </xs:extension> </xs:simpleContent> </xs:complexType>"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R155"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R155 // The Key element is a required element of PhoneNumberDictionaryEntryType, if the entry as PhoneNumberDictionaryEntryType is not null, // and the schema is validated, this requirement can be validated. Site.CaptureRequirement( 155, @"[In t: PhoneNumberKeyType Simple Type] The type[PhoneNumberKeyType] is defined as follow: < xs:simpleType name = ""PhoneNumberKeyType"" > < xs:restriction base = ""xs: string"" > < xs:enumeration value = ""AssistantPhone"" /> < xs:enumeration value = ""BusinessFax"" /> < xs:enumeration value = ""BusinessPhone"" /> < xs:enumeration value = ""BusinessPhone2"" /> < xs:enumeration value = ""Callback"" /> < xs:enumeration value = ""CarPhone"" /> < xs:enumeration value = ""CompanyMainPhone"" /> < xs:enumeration value = ""HomeFax"" /> < xs:enumeration value = ""HomePhone"" /> < xs:enumeration value = ""HomePhone2"" /> < xs:enumeration value = ""Isdn"" /> < xs:enumeration value = ""MobilePhone"" /> < xs:enumeration value = ""OtherFax"" /> < xs:enumeration value = ""OtherTelephone"" /> < xs:enumeration value = ""Pager"" /> < xs:enumeration value = ""PrimaryPhone"" /> < xs:enumeration value = ""RadioPhone"" /> < xs:enumeration value = ""Telex"" /> < xs:enumeration value = ""TtyTddPhone"" /> < xs:enumeration value = ""BusinessMobile"" /> < xs:enumeration value = ""IPPhone"" /> < xs:enumeration value = ""Mms"" /> < xs:enumeration value = ""Msn"" /> </ xs:restriction > </ xs:simpleType > "); if (Common.IsRequirementEnabled(1275106, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275106"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275106 // If BusinessMobile is not null and the schema is verifed, this requirement can be validated. Site.CaptureRequirementIfIsNotNull( PhoneNumberKeyType.BusinessMobile, 1275106, @"[In Appendix C: Product Behavior] Implementation does support the IPPhone value. (Exchange 2016 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1275108, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275108"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275108 // If IPPhone is not null and the schema is verifed, this requirement can be validated. Site.CaptureRequirementIfIsNotNull( PhoneNumberKeyType.IPPhone, 1275108, @"[In Appendix C: Product Behavior] Implementation does support the IPPhone value. (Exchange 2016 and above follow this behavior.)"); } } else { Site.Assert.Fail("The entry of PhoneNumbers should not be null!"); } } } if (contactItemType.PhysicalAddresses != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R270"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R270 // If the PhysicalAddresses is not null and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 270, @"[In t:PhysicalAddressDictionaryType Complex Type] The type [PhysicalAddressDictionaryType] is defined as follow:<xs:complexType name=""PhysicalAddressDictionaryType""> <xs:sequence> <xs:element name=""entry"" type=""t:PhysicalAddressDictionaryEntryType"" maxOccurs=""unbounded"" /> </xs:sequence> </xs:complexType>"); for (int i = 0; i < contactItemType.PhysicalAddresses.Length; i++) { if (contactItemType.PhysicalAddresses[i] != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R256"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R256 // If the entry of PhysicalAddresses is not null and schema is validated, // the requirement can be validated. Site.CaptureRequirement( 256, @"[In t:PhysicalAddressDictionaryEntryType Complex Type] The type [PhysicalAddressDictionaryEntryType] is defined as follow:<xs:complexType name=""PhysicalAddressDictionaryEntryType""> <xs:sequence> <xs:element name=""Street"" type=""xs:string"" minOccurs=""0"" /> <xs:element name=""City"" type=""xs:string"" minOccurs=""0"" /> <xs:element name=""State"" type=""xs:string"" minOccurs=""0"" /> <xs:element name=""CountryOrRegion"" type=""xs:string"" minOccurs=""0"" /> <xs:element name=""PostalCode"" type=""xs:string"" minOccurs=""0"" /> </xs:sequence> <xs:attribute name=""Key"" type=""t:PhysicalAddressKeyType"" use=""required"" /> </xs:complexType>"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R185"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R185 // The Key element is a required element of PhysicalAddressDictionaryEntryType, if the entry as PhysicalAddressDictionaryEntryType is not null, // and the schema is validated, this requirement can be validated. Site.CaptureRequirement( 185, @"[In t:PhysicalAddressKeyType Simple Type] The type [PhysicalAddressKeyType] is defined as follow:<xs:simpleType name=""PhysicalAddressKeyType""> <xs:restriction base=""xs:string"" > <xs:enumeration value=""Business"" /> <xs:enumeration value=""Home"" /> <xs:enumeration value=""Other"" /> </xs:restriction> </xs:simpleType>"); } else { Site.Assert.Fail("The entry of PhysicalAddresses should not be null!"); } } } } #endregion #region Verify BaseResponseMessageType Structure /// <summary> /// Verify the BaseResponseMessageType structure. /// </summary> /// <param name="baseResponseMessage">A BaseResponseMessageType instance.</param> private void VerifyBaseResponseMessageType(BaseResponseMessageType baseResponseMessage) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCDATA_R1081001"); // Verify MS-OXWSCORE requirement: MS-OXWSCDATA_R1081001 Site.CaptureRequirementIfIsNotNull( baseResponseMessage, "MS-OXWSCDATA", 1081001, @"[In m:BaseResponseMessageType Complex Type] The type [BaseResponseMessageType] is defined as follow: <xs:complexType name=""BaseResponseMessageType""> <xs:sequence> <xs:element name=""ResponseMessages"" type=""m:ArrayOfResponseMessagesType"" /> </xs:sequence> </xs:complexType>"); } #endregion #region Verify ResponseMessageType Structure /// <summary> /// Verify the ResponseMessageType structure. /// </summary> /// <param name="responseMessage">A ResponseMessageType instance.</param> private void VerifyResponseMessageType(ResponseMessageType responseMessage) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCDATA_R114701"); // Verify MS-OXWSCORE requirement: MS-OXWSCDATA_R114701 Site.CaptureRequirementIfIsNotNull( responseMessage, "MS-OXWSCDATA", 114701, @"[In m:ResponseMessageType Complex Type] The type [ResponseMessageType] is defined as follow: <xs:complexType name=""ResponseMessageType""> <xs:sequence minOccurs=""0"" > <xs:element name=""MessageText"" type=""xs:string"" minOccurs=""0"" /> <xs:element name=""ResponseCode"" type=""m:ResponseCodeType"" minOccurs=""0"" /> <xs:element name=""DescriptiveLinkKey"" type=""xs:int"" minOccurs=""0"" /> <xs:element name=""MessageXml"" minOccurs=""0"" > <xs:complexType> <xs:sequence> <xs:any process_contents=""lax"" minOccurs=""0"" maxOccurs=""unbounded"" /> </xs:sequence> <xs:attribute name=""ResponseClass"" type=""t:ResponseClassType"" use=""required"" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType>"); } #region Verify ServerVersionInfo Structure /// <summary> /// Verify the ServerVersionInfo structure. /// </summary> /// <param name="serverVersionInfo">A ServerVersionInfo instance.</param> /// <param name="isSchemaValidated">Indicate whether the schema is verified.</param> private void VerifyServerVersionInfo(ServerVersionInfo serverVersionInfo, bool isSchemaValidated) { Site.Assert.IsTrue(isSchemaValidated, "The schema should be validated."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCDATA_R368004"); // Verify MS-OXWSCORE requirement: MS-OXWSCDATA_R368004 Site.CaptureRequirementIfIsNotNull( serverVersionInfo, "MS-OXWSCDATA", 368004, @"[In t:ServerVersionInfo Element] <xs:element name=""t:ServerVersionInfo""> <xs:complexType> <xs:attribute name=""MajorVersion"" type=""xs:int"" use=""optional"" /> <xs:attribute name=""MinorVersion"" type=""xs:int"" use=""optional"" /> <xs:attribute name=""MajorBuildNumber"" type=""xs:int"" use=""optional"" /> <xs:attribute name=""MinorBuildNumber"" type=""xs:int"" use=""optional"" /> <xs:attribute name=""Version"" type=""xs:string"" use=""optional"" /> </xs:complexType> </xs:element>"); if (serverVersionInfo.MajorVersionSpecified) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCDATA_R368005"); // Verify MS-OXWSCORE requirement: MS-OXWSCDATA_R368005 // If MajorVersion element is specified, and the schema is validated, // this requirement can be validated. Site.CaptureRequirement( "MS-OXWSCDATA", 368005, "[In t:ServerVersionInfo Element] The type of the attribute MajorVersion is xs:int ([XMLSCHEMA2])"); // Verify MS-OXWSCORE requirement: MS-OXWSCDATA_R368006 // If MinorVersion element is not null, and the schema is validated, // this requirement can be validated. Site.CaptureRequirementIfIsNotNull( serverVersionInfo.MajorVersion, "MS-OXWSCDATA", 368006, @"[In t:ServerVersionInfo Element] MajorVersion attribute: Specifies the server's major version number."); } if (serverVersionInfo.MinorVersionSpecified) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCDATA_R368007"); // Verify MS-OXWSCORE requirement: MS-OXWSCDATA_R368007 // If MinorVersion element is specified, and the schema is validated, // this requirement can be validated. Site.CaptureRequirement( "MS-OXWSCDATA", 368007, "[In t:ServerVersionInfo Element] The type of the attribute MinorVersion is xs:int "); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCDATA_R368008"); // Verify MS-OXWSCORE requirement: MS-OXWSCDATA_R368008 // If MinorVersion element is not null, and the schema is validated, // this requirement can be validated. Site.CaptureRequirementIfIsNotNull( serverVersionInfo.MinorVersion, "MS-OXWSCDATA", 368008, "[In t:ServerVersionInfo Element] MinorVersion attribute: Specifies the server's minor version number."); } if (serverVersionInfo.MajorBuildNumberSpecified) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCDATA_R368009"); // Verify MS-OXWSCORE requirement: MS-OXWSCDATA_R368009 // If MajorBuildNumber element is specified, and the schema is validated, // this requirement can be validated. Site.CaptureRequirement( "MS-OXWSCDATA", 368009, "[In t:ServerVersionInfo Element] The type of the attribute MajorBuildNumber is xs:int"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCDATA_R368010"); // Verify MS-OXWSCORE requirement: MS-OXWSCDATA_R368010 // If MajorBuildNumber element is not null, and the schema is validated, // this requirement can be validated. Site.CaptureRequirementIfIsNotNull( serverVersionInfo.MajorBuildNumber, "MS-OXWSCDATA", 368010, "[In t:ServerVersionInfo Element] MajorBuildNumber attribute: Specifies the server's major build number."); } if (serverVersionInfo.MinorBuildNumberSpecified) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCDATA_R368011"); // Verify MS-OXWSCORE requirement: MS-OXWSCDATA_R368011 // If MinorBuildNumber element is specified, and the schema is validated, // this requirement can be validated. Site.CaptureRequirement( "MS-OXWSCDATA", 368011, "[In t:ServerVersionInfo Element] The type of the attribute MinorBuildNumber is xs:int"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCDATA_R368012"); // Verify MS-OXWSCORE requirement: MS-OXWSCDATA_R368012 // If MinorBuildNumber element is not null, and the schema is validated, // this requirement can be validated. Site.CaptureRequirementIfIsNotNull( serverVersionInfo.MinorBuildNumber, "MS-OXWSCDATA", 368012, "[In t:ServerVersionInfo Element] MinorBuildNumber attribute: Specifies the server's minor build number."); } if (serverVersionInfo.Version != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCDATA_R368013"); // Verify MS-OXWSCORE requirement: MS-OXWSCDATA_R368013 // If Version element is not null, and the schema is validated, // this requirement can be validated. Site.CaptureRequirement( "MS-OXWSCDATA", 368013, "[In t:ServerVersionInfo Element] The type of the attribute Version is xs:string ([XMLSCHEMA2])"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCDATA_R368014"); // Verify MS-OXWSCORE requirement: MS-OXWSCDATA_R368014 // If MS-OXWSCDATA_r368013 is verifed successfully, this requirement can be validated directly Site.CaptureRequirement( "MS-OXWSCDATA", 368014, "[In t:ServerVersionInfo Element] Version attribute: specifies the server's version number including the major version number, minor version number, major build number, and minor build number in that order."); } } #endregion #endregion #region Verify SetUserPhotoMessageResponseType Structure /// <summary> /// Capture SetuserPhotoResponseMessageType related requirements. /// </summary> /// <param name="getUserPhotoMessageResponse">Specified SetUserPhotoResponseMessageType instance.</param> /// <param name="isSchemaValidated">A boolean value indicates the schema validation result. True means the response conforms with the schema, false means not.</param> private void VerifySetUserPhotoResponseMessageType(SetUserPhotoResponseMessageType setUserPhotoMessageResponse, bool isSchemaValidated) { // Verify the base type ResponseMessageType related requirements. this.VerifyResponseMessageType(setUserPhotoMessageResponse as ResponseMessageType); // If the schema validation and the above base type verification are successful, then MS-OXWSCONT_R302126 can be captured. // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R302126"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R302126 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 302126, @"[In SetUserPhotoResponseMessageType] The following is the SetUserPhotoResponseMessageType complex type specification. <xs:complexType name=""SetUserPhotoResponseMessageType"" > < xs:complexContent > < xs:extension base = ""m:ResponseMessageType"" /> </ xs:complexContent > < / xs:complexType > "); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275114"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275114 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 1275114, @"[In Appendix C: Product Behavior] Implementation does support the SetUserPhoto operation. (Exchange 2016 and above follow this behavior.)"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R302125"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302125 this.Site.CaptureRequirementIfIsNotNull( setUserPhotoMessageResponse, 302125, @"[In SetUserPhotoResponseMessageType] This type extends the ResponseMessageType complex type, as specified by [MS-OXWSCDATA] section 2.2.4.67."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R302078"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302078 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 302078, @"[In SetUserPhoto] The following is the WSDL port type specification of the SetUserPhoto WSDL operation. <wsdl:operation name=""SetUserPhoto"" > < wsdl:input message = ""tns:SetUserPhotoSoapIn"" /> < wsdl:output message = ""tns:SetUserPhotoSoapOut"" /> </ wsdl:operation > "); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R302079"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302079 Site.CaptureRequirementIfIsNotNull( setUserPhotoMessageResponse, 302079, @"[In SetUserPhoto] The following is the WSDL binding specification of the SetUserPhoto WSDL operation. <wsdl:operation name=""SetUserPhoto"" > < soap:operation soapAction = ""http://schemas.microsoft.com/exchange/services/2006/messages/SetUserPhoto"" /> < wsdl:input > < soap:header message = ""tns:SetUserPhotoSoapIn"" part = ""RequestVersion"" use = ""literal"" /> < soap:body parts = ""request"" use = ""literal"" /> </ wsdl:input > < wsdl:output > < soap:body parts = ""SetUserPhotoResult"" use = ""literal"" /> < soap:header message = ""tns:SetUserPhotoSoapOut"" part = ""ServerVersion"" use = ""literal"" /> </ wsdl:output > </ wsdl:operation > "); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R302094"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302094 Site.CaptureRequirementIfIsNotNull( setUserPhotoMessageResponse, 302094, @"[In SetUserPhotoSoapOut] The following is the SetUserPhotoSoapOut WSDL message specification. <wsdl:message name=""SetUserPhotoSoapOut"" > < wsdl:part name = ""SetUserPhotoResult"" element = ""tns:SetUserPhotoResponse"" /> < wsdl:part name = ""ServerVersion"" element = ""t:ServerVersionInfo"" /> </ wsdl:message > "); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R302097"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302097 Site.CaptureRequirementIfIsNotNull( setUserPhotoMessageResponse, 302097, @"[In SetUserPhotoSoapOut] The element of the part SetUserPhotoResult is tns:SetUserPhotoResponse (section 3.1.4.8.2.2)"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R302098"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302098 // According to the schema, getUserPhotoMessageResponse is the SOAP body of a response message returned by server, this requirement can be verified directly. Site.CaptureRequirement( 302098, @"[In SetUserPhotoSoapOut] SetUserPhotoResult part: Specifies the SOAP body of the response to a SetUserPhoto WSDL operation request."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R302099"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302099 Site.CaptureRequirementIfIsNotNull( this.exchangeServiceBinding.ServerVersionInfoValue, 302099, @"[In SetUserPhotoSoapOut] The element of the part ServerVersion is t:ServerVersionInfo ([MS-OXWSCDATA] section 2.2.3.12)"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R302100"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302100 // According to the schema, ServerVersion is the SOAP header that contains the server version information, this requirement can be verified directly. Site.CaptureRequirement( 302100, @"[In SetUserPhotoSoapOut] ServerVersion part: Specifies a SOAP header that identifies the server version for the response."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R302107"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302107 Site.CaptureRequirementIfIsNotNull( setUserPhotoMessageResponse, 302107, @"[In SetUserPhotoResponse] The following is the SetUserPhotoResponse element specification. <xs:element name=""SetUserPhotoResponse"" type =""m: SetUserPhotoResponseMessageType"" /> "); } #endregion #region Verify GetUserPhotoMessageResponseType Structure /// <summary> /// Capture GetuserPhotoResponseMessageType related requirements. /// </summary> /// <param name="getUserPhotoMessageResponse">Specified GetUserPhotoResponseMessageType instance.</param> /// <param name="isSchemaValidated">A boolean value indicates the schema validation result. True means the response conforms with the schema, false means not.</param> private void VerifyGetUserPhotoResponseMessageType(GetUserPhotoResponseMessageType getUserPhotoMessageResponse, bool isSchemaValidated) { // Verify the base type ResponseMessageType related requirements. this.VerifyResponseMessageType(getUserPhotoMessageResponse as ResponseMessageType); // If the schema validation and the above base type verification are successful, then MS-OXWSCONT_R302053, MS-OXWSCONT_R302055, MS-OXWSCONT_R302057 and MS-OXWSCONT_R1275124 can be captured. // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R302053"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R302053 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 302053, @"[In GetUserPhotoResponseMessageType] The following is the GetUserPhotoResponseMessageType complex type specification. <xs:complexType name=""GetUserPhotoResponseMessageType"" > < xs:complexContent > < xs:extension base = ""m:ResponseMessageType"" > < xs:sequence > < xs:element name = ""HasChanged"" type = ""xs:boolean"" minOccurs = ""1"" maxOccurs = ""1"" /> < xs:element name = ""PictureData"" type = ""xs:base64Binary"" minOccurs = ""0"" maxOccurs = ""1"" /> < xs:element name = ""ContentType"" type = ""xs:string"" minOccurs = ""0"" maxOccurs = ""1"" /> </ xs:sequence > </ xs:extension > </ xs:complexContent > </ xs:complexType > "); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R302052"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302052 Site.CaptureRequirementIfIsNotNull( getUserPhotoMessageResponse, 302052, @"[In GetUserPhotoResponseMessageType] This type [GetUserPhotoResponseMessageType] extends the ResponseMessageType complex type, as specified in [MS-OXWSCDATA] section 2.2.4.67."); // Add debug information. Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R302055"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302055 Site.CaptureRequirementIfIsInstanceOfType( getUserPhotoMessageResponse.HasChanged, typeof(Boolean), 302055, @"[In GetUserPhotoResponseMessageType] The type of the element HasChanged is xs:boolean ([XMLSCHEMA2])"); // Add debug information. Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R302057"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302057 Site.CaptureRequirementIfIsInstanceOfType( getUserPhotoMessageResponse.PictureData, typeof(byte[]), 302057, @"[In GetUserPhotoResponseMessageType] The type of the element PictureData is xs:base64Binary ([XMLSCHEMA2])"); // Add debug information. Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R302155"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302155 Site.CaptureRequirementIfIsInstanceOfType( getUserPhotoMessageResponse.ContentType, typeof(String), 302155, @"[In GetUserPhotoResponseMessageType] The type of the element ContentType is xs:string ([XMLSCHEMA2])"); // Add debug information. Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R1275124"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1275124 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 1275124, @"[In Appendix C: Product Behavior] Implementation does support the ContentType element. (Exchange 2013 and above follow this behavior.)"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R302002"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302002 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 302002, @"[In GetUserPhoto] The following is the WSDL port type specification of the GetUserPhoto WSDL operation. <wsdl:operation name=""GetUserPhoto"" > < wsdl:input message = ""tns:GetUserPhotoSoapIn"" /> < wsdl:output message = ""tns:GetUserPhotoSoapOut"" /> </ wsdl:operation > "); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R302003"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302003 Site.CaptureRequirementIfIsNotNull( getUserPhotoMessageResponse, 302003, @"[In GetUserPhoto] The following is the WSDL binding specification of the GetUserPhoto WSDL operation. <wsdl:operation name=""GetUserPhoto"" > < soap:operation soapAction = ""http://schemas.microsoft.com/exchange/services/2006/messages/GetUserPhoto"" /> < wsdl:input > < soap:body parts = ""request"" use = ""literal"" /> < soap:header message = ""tns:GetUserPhotoSoapIn"" part = ""RequestVersion"" use = ""literal"" /> </ wsdl:input > < wsdl:output > < soap:header message = ""tns:GetUserPhotoSoapOut"" part = ""ServerVersion"" use = ""literal"" /> < soap:body parts = ""GetUserPhotoResult"" use = ""literal"" /> </ wsdl:output > </ wsdl:operation > "); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R302017"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302017 Site.CaptureRequirementIfIsNotNull( getUserPhotoMessageResponse, 302017, @"[In GetUserPhotoSoapOut] The following is the GetUserPhotoSoapOut WSDL message specification. <wsdl:message name=""GetUserPhotoSoapOut"" > < wsdl:part name = ""GetUserPhotoResult"" element = ""tns:GetUserPhotoResponse"" /> < wsdl:part name = ""ServerVersion"" element = ""t:ServerVersionInfo"" /> </ wsdl:message > "); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R302020"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302020 Site.CaptureRequirementIfIsNotNull( getUserPhotoMessageResponse, 302020, @"[In GetUserPhotoSoapOut] The element of the part GetUserPhotoResult is tns:GetUserPhotoResponse (section 3.1.4.7.2.2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R302021"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302021 // According to the schema, getUserPhotoMessageResponse is the SOAP body of a response message returned by server, this requirement can be verified directly. Site.CaptureRequirement( 302021, @"[In GetUserPhotoSoapOut] GetUserPhotoResult part: Specifies the SOAP body of the response to a GetUserPhoto WSDL operation request."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R302022"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302022 Site.CaptureRequirementIfIsNotNull( this.exchangeServiceBinding.ServerVersionInfoValue, 302022, @"[In GetUserPhotoSoapOut] The element of the part ServerVersion is t:ServerVersionInfo ([MS-OXWSCDATA] section 2.2.3.12)"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R302023"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302023 // According to the schema, ServerVersion is the SOAP header that contains the server version information, this requirement can be verified directly. Site.CaptureRequirement( 302023, @"[In GetUserPhotoSoapOut] ServerVersion part: Specifies a SOAP header that identifies the server version for the response."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R302034"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R302034 Site.CaptureRequirementIfIsNotNull( getUserPhotoMessageResponse, 302034, @"[In GetUserPhotoResponse] The following is the GetUserPhotoResponse element specification. <xs:element name=""GetUserPhotoResponse"" type = ""m:GetUserPhotoResponseMessageType"" xmlns: xs = ""http://www.w3.org/2001/XMLSchema"" /> "); } #endregion #region Verify requirements related to SOAP version /// <summary> /// Verify the SOAP version. /// </summary> private void VerifySoapVersion() { // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R1 // According to the implementation of adapter, the message is formatted as SOAP 1.1. If the operation is invoked successfully, then this requirement can be verified. Site.CaptureRequirement( 1, @"[In Transport] The SOAP version supported is SOAP 1.1, as specified in [SOAP1.1]."); } #endregion #region Verify transport related requirements. /// <summary> /// Verify the transport related requirements. /// </summary> private void VerifyTransportType() { // Get the transport type TransportProtocol transport = (TransportProtocol)Enum.Parse(typeof(TransportProtocol), Common.GetConfigurationPropertyValue("TransportType", Site), true); if (Common.IsRequirementEnabled(335001, this.Site) && transport == TransportProtocol.HTTPS) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R335001"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R335001 // When test suite running on HTTPS, if there are no exceptions or error messages returned from server, this requirement will be captured. Site.CaptureRequirement( 335001, @"[In Appendix B: Product Behavior] Implementation does use secure communications via HTTPS, as defined in [RFC2818]. (Exchange 2007 and above follow this behavior.)"); } if (transport == TransportProtocol.HTTP) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R101"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R101 // When test suite running on HTTP, if there are no exceptions or error messages returned from server, this requirement will be captured. Site.CaptureRequirement( 101, @"[In Transport] The protocol MUST support SOAP over HTTP, as specified in [RFC2616]. "); } } #endregion } }
1,791
https://github.com/Shada/edit87/blob/master/Interface/Interface/Forms/PanTextures.Designer.cs
Github Open Source
Open Source
MIT
2,021
edit87
Shada
C#
Code
251
1,036
namespace LevelEditor { partial class PanTextures { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PanTextures)); this.lv_Textures = new System.Windows.Forms.ListView(); this.textureList = new System.Windows.Forms.ImageList(this.components); this.label8 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // lv_Textures // this.lv_Textures.LargeImageList = this.textureList; this.lv_Textures.Location = new System.Drawing.Point(6, 32); this.lv_Textures.Name = "lv_Textures"; this.lv_Textures.Size = new System.Drawing.Size(180, 141); this.lv_Textures.SmallImageList = this.textureList; this.lv_Textures.TabIndex = 31; this.lv_Textures.UseCompatibleStateImageBehavior = false; this.lv_Textures.SelectedIndexChanged += new System.EventHandler(this.lv_Textures_SelectedIndexChanged); // // textureList // this.textureList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("textureList.ImageStream"))); this.textureList.TransparentColor = System.Drawing.Color.Transparent; this.textureList.Images.SetKeyName(0, "dirt.png"); this.textureList.Images.SetKeyName(1, "grass.png"); this.textureList.Images.SetKeyName(2, "rock.png"); // // label8 // this.label8.AutoSize = true; this.label8.Location = new System.Drawing.Point(7, 8); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(46, 13); this.label8.TabIndex = 32; this.label8.Text = "Texture:"; // // PanTextures // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(184, 182); this.Controls.Add(this.lv_Textures); this.Controls.Add(this.label8); this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "PanTextures"; this.Text = "PanTextures"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.PanTextures_FormClosing); this.SizeChanged += new System.EventHandler(this.PanTextures_SizeChanged); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.ListView lv_Textures; private System.Windows.Forms.Label label8; private System.Windows.Forms.ImageList textureList; } }
25,984
https://github.com/connectomes/cellSketches/blob/master/components/iplChart/iplHistogram.directive.js
Github Open Source
Open Source
MIT
null
cellSketches
connectomes
JavaScript
Code
636
2,394
(function () { 'use strict'; angular.module('app.iplChartModule') .directive('iplHistogram', iplHistogram); iplHistogram.$inject = ['$log', 'visUtils', 'iplChartData']; function iplHistogram($log, visUtils, iplChartData) { return { scope: { value: '=', maxValue: '=', histogram: '=', width: '=', height: '=', chartData: '=', domain: '=', /* these are x-axis. angular doesn't like that name for binding*/ range: '=', yAxisRange: '=', yAxisDomain: '=', numBins: '=', toggle: '=', numTicks: '=', label: '=', supposedToUseMesh: '=', hoverIndex: '=', onUpdateHover: '&' }, link: link, restrict: 'E' }; function getMargins(width, height) { var margin = {}; margin.left = width * (1.0 / 8.0); margin.right = width * (1.0 / 8.0); margin.top = height * (1.0 / 8.0); margin.bottom = height * (1.0 / 8.0); return margin; } function link(scope, element, attribute) { var self = {}; //scope.$watch('chartData', cellsChanged); scope.$watch('toggle', cellsChanged); scope.$watch('hoverIndex', hoverIndexChanged); self.svg = d3.select(element[0]) .append('svg') .attr("id", scope.value) .attr('width', scope.width) .attr('height', scope.height) .append('g'); var div = d3.select(element[0]).append("div") .attr("class", "tooltip") .style("opacity", 0); visUtils.clearGroup(self.svg); cellsChanged(); function cellsChanged() { $log.debug('iplHistogram - cellsChanged', scope); visUtils.clearGroup(self.svg); var width = scope.width; var height = scope.height; var margin = getMargins(width, height); d3.select(element[0]) .select("svg") .attr("id", 'conversion-' + scope.value + '-' + scope.$parent.$parent.model.ui.selectedVerticalAxisMode.name); visUtils.addOutlineToGroup(self.svg, width, height, '#222222'); self.svg.append('text') .text(scope.value + " - " + scope.label) .attr('text-anchor', 'start') .attr('x', '5') .attr('y', '15'); var group = self.svg.append('g') .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')'); var x = d3.scale.linear() .domain(scope.domain) .range(scope.range); var yAxisDomain = [Math.min(scope.yAxisDomain[0], 0), scope.yAxisDomain[1]]; var y = d3.scale.linear() .domain(yAxisDomain) .range(scope.yAxisRange); var xAxis = d3.svg.axis() .scale(x) .orient("bottom") .tickValues(scope.domain); var yAxis = d3.svg.axis() .scale(y) .orient('left') .tickFormat(function (d) { // Return integers or round to 2 decimal places if (Math.round(d) == d) { return d; } else if (Math.abs(d - 0.0) < 0.001) { return "0.00"; } else { return d.toFixed(2); } }) .ticks(10); var yAxisTicks = d3.svg.axis() .scale(y) .orient('left') .ticks(scope.numTicks) .tickSize(-(scope.width - margin.left - margin.right)) .tickFormat(function (d) { return; }); // Create x axis group.append("g") .attr("class", "x axis") .attr("transform", "translate(0," + (height - margin.bottom - margin.top) + ")") .attr({ 'font-size': '9px' }) .call(xAxis); var data = iplChartData.getHistogramBins(scope.chartData, scope.numBins, scope.yAxisDomain, scope.yAxisRange); var allPointsUsedMesh = true; var isPointAdded = []; var numPointsWithoutMesh = 0; for (var i = 0; i < data.length; ++i) { var currData = data[i]; var currDetails = []; for (var j = 0; j < currData.length; ++j) { for (var k = 0; k < scope.chartData.length; ++k) { var currDistance = scope.chartData[k].value; if ((isPointAdded[k] == undefined) && currDistance == currData[j]) { isPointAdded[k] = true; currDetails.push(scope.chartData[k]); allPointsUsedMesh &= scope.chartData[k].usedMesh; if (!scope.chartData[k].usedMesh) { numPointsWithoutMesh++; } } } currData.details = currDetails; } } self.percentPointsWithoutMesh = (numPointsWithoutMesh / scope.chartData.length) * 100; if (scope.supposedToUseMesh && !allPointsUsedMesh) { self.svg.append('circle') .attr('text-anchor', 'end') .attr('cx', 10) .attr('cy', 25) .attr('r', 3) .attr("fill", "lightgrey") .on("mouseover", onConversionMarkMouseOver) .on("mouseout", onConversionMarkMouseOut) } var yRange = Math.abs(height - (margin.bottom + margin.top)); var bar = group.selectAll(".iplHistogramBar") .data(data) .enter() .append("rect") .attr("transform", function (d, i) { return "translate(" + 0.5 + "," + ((yRange / (data.length)) * i) + ")"; }) .attr("x", 0) .attr("height", function (d) { return (yRange / (data.length + 1)); }) .attr('width', function (d) { return x(d.length); }) .attr("class", "iplHistogramBar") .on('click', onHistogramBarClicked) .on('mouseover', onHistogramBarMouseOver) .on('mouseout', onHistogramBarMouseOut); group.append('g') .attr({ class: 'y axis', 'font-size': '9px', 'transform': 'translate(0,0)' }) .call(yAxis); group.append('g') .attr({ class: 'y-axis-ticks', 'font-size': '9px', 'transform': 'translate(0,0)' }) .call(yAxisTicks); } function onConversionMarkMouseOver() { div.transition() .duration(200) .style("opacity", .9); div.html(self.percentPointsWithoutMesh.toFixed(2) + "% of the points were converted using a weighted average instead of mesh intersection.") .style("left", (d3.event.pageX) + 10 + "px") .style("top", (d3.event.pageY) + 5 + "px"); } function onConversionMarkMouseOut() { div.transition() .duration(500) .style("opacity", 0); } function onHistogramBarMouseOver(d, i) { scope.onUpdateHover({index: i}); } function onHistogramBarClicked(d, i) { $log.warn(d.details.length); } function onHistogramBarMouseOut(d, i) { scope.onUpdateHover({index: -1}); } function hoverIndexChanged(newValue, oldValue) { if (newValue == oldValue) { return; } if (newValue == -1) { self.svg.selectAll(".iplHistogramBar") .filter(function (d, i) { return i == oldValue; }).style("fill", "darkgrey"); } else if (newValue != -1) { self.svg.selectAll(".iplHistogramBar") .filter(function (d, i) { return i == newValue; }).style("fill", "#FFC800"); } } } } })();
24,573
https://github.com/shenqiang-Yuan/mysecondRepo/blob/master/semantic-segmentation/libraries/semantic/fcn.py
Github Open Source
Open Source
Apache-2.0
2,022
mysecondRepo
shenqiang-Yuan
Python
Code
972
3,579
#!/usr/bin/python3 import os import random import datetime import re import math import logging import multiprocessing import h5py import numpy as np import tensorflow as tf import keras import keras.backend as KB import keras.callbacks as KC import keras.layers as KL import keras.engine as KE import keras.models as KM import keras.optimizers as KO import keras.preprocessing as KP import keras.applications as KA import semantic.models import semantic.metrics import semantic.losses import semantic.utils import semantic.SegDataGenerator as SegDataGenerator class FCN(object): """Encapsulates FCN model functionality. https://arxiv.org/abs/1605.06211 https://github.com/shelhamer/fcn.berkeleyvision.org The actual Keras model is in the keras_model property. """ def __init__(self, config, model_dir): """ config: A Sub-class of the Config class model_dir: Directory to save training logs and trained weights """ self.config = config self.model_dir = model_dir self.set_log_dir() self.keras_model = self.build(config=config) def build(self, config): model = semantic.models.AtrousFCN_Resnet50_16s( weight_decay=config.WEIGHT_DECAY, input_shape=config.IMAGE_SHAPE, batch_momentum=config.BATCH_MOMENTUM, classes=config.NUM_CLASSES) return model def train(self, train_dataset, validation_dataset, learning_schedule, epochs, layers, augmentation=None): # Pre-defined layer regular expressions layer_regex = { # all layers but the backbone "head": r"(classify.*)", # From a specific Resnet stage and up "3+": r"(res3.*)|(bn3.*)|(res4.*)|(bn4.*)|(res5.*)|(bn5.*)|(classify.*)", "4+": r"(res4.*)|(bn4.*)|(res5.*)|(bn5.*)|(classify.*)", "5+": r"(res5.*)|(bn5.*)|(classify.*)", # All layers "all": ".*", } if layers in layer_regex.keys(): layers = layer_regex[layers] self.set_trainable(layers) self.compile(learning_schedule) # Data generators # generator mostly unchanged from https://github.com/aurora95/Keras-FCN train_file_path = '' data_dir = '' data_suffix = '' label_dir = '' label_suffix = '' classes = '' target_size = (self.config.IMAGE_MAX_DIM, self.config.IMAGE_MAX_DIM) label_cval = 0 batch_size = self.config.BATCH_SIZE loss_shape = None train_datagen = SegDataGenerator.SegDataGenerator(dataset=train_dataset, zoom_range=[ 0.5, 2.0], zoom_maintain_shape=True, crop_mode='random', crop_size=target_size, # pad_size=(505, 505), rotation_range=0., shear_range=0, horizontal_flip=True, channel_shift_range=20., fill_mode='constant', label_cval=label_cval) train_generator = train_datagen.flow_from_directory( file_path=train_file_path, data_dir=data_dir, data_suffix=data_suffix, label_dir=label_dir, label_suffix=label_suffix, classes=classes, target_size=target_size, color_mode='rgb', batch_size=batch_size, shuffle=True, loss_shape=loss_shape, ignore_label=0 # save_to_dir='Images/' ) val_datagen = SegDataGenerator.SegDataGenerator(dataset=validation_dataset, zoom_range=[ 0.5, 2.0], zoom_maintain_shape=True, crop_mode='random', crop_size=target_size, # pad_size=(505, 505), rotation_range=0., shear_range=0, horizontal_flip=True, channel_shift_range=20., fill_mode='constant', label_cval=label_cval) validation_generator = val_datagen.flow_from_directory( file_path=train_file_path, data_dir=data_dir, data_suffix=data_suffix, label_dir=label_dir, label_suffix=label_suffix, classes=classes, target_size=target_size, color_mode='rgb', batch_size=batch_size, shuffle=True, loss_shape=loss_shape, ignore_label=0 # save_to_dir='Images/' ) # Callbacks callbacks = [ KC.TensorBoard(log_dir=self.log_dir, histogram_freq=0, write_graph=True, write_images=False), KC.ModelCheckpoint(self.checkpoint_path, verbose=0, save_weights_only=True), KC.LearningRateScheduler(learning_schedule) ] self.keras_model.fit_generator( generator=train_generator, initial_epoch=self.epoch, epochs=epochs, steps_per_epoch=self.config.STEPS_PER_EPOCH, callbacks=callbacks, validation_data=validation_generator, validation_steps=self.config.VALIDATION_STEPS, max_queue_size=100, workers=multiprocessing.cpu_count(), use_multiprocessing=True, ) self.epoch = max(self.epoch, epochs) def predict(self, pil_image): pil_image.thumbnail( (self.config.IMAGE_MAX_DIM, self.config.IMAGE_MAX_DIM)) image = KP.image.img_to_array(pil_image) image = semantic.utils.zero_pad_array( image, self.config.IMAGE_MAX_DIM, self.config.IMAGE_MAX_DIM) image = np.expand_dims(image, axis=0) image = KA.imagenet_utils.preprocess_input(image) result = self.keras_model.predict(image, batch_size=1) result = np.argmax(np.squeeze(result), axis=-1).astype(np.uint8) return result def compile(self, schedule): loss = semantic.losses.softmax_sparse_crossentropy_ignoring_last_label optimizer = KO.SGD(lr=schedule(0), momentum=self.config.LEARNING_MOMENTUM) metrics = [semantic.metrics.sparse_accuracy_ignoring_last_label] self.keras_model.compile(loss=loss, optimizer=optimizer, metrics=metrics) def load_weights(self, filepath, by_name=False, exclude=None): """Modified version of the correspoding Keras function with the addition of multi-GPU support and the ability to exclude some layers from loading. exlude: list of layer names to excluce """ if exclude: by_name = True f = h5py.File(filepath, mode='r') if 'layer_names' not in f.attrs and 'model_weights' in f: f = f['model_weights'] layers = self.keras_model.layers # Exclude some layers if exclude: layers = filter(lambda l: l.name not in exclude, layers) if by_name: KE.topology.load_weights_from_hdf5_group_by_name(f, layers) else: KE.topology.load_weights_from_hdf5_group(f, layers) if hasattr(f, 'close'): f.close() # Update the log directory self.set_log_dir(filepath) def set_trainable(self, layer_regex, keras_model=None, indent=0, verbose=1): """Sets model layers as trainable if their names match the given regular expression. """ # Print message on the first call (but not on recursive calls) if verbose > 0 and keras_model is None: semantic.utils.log("Selecting layers to train...") keras_model = keras_model or self.keras_model layers = keras_model.layers for layer in layers: # Is the layer a model? if layer.__class__.__name__ == 'Model': print("In model: ", layer.name) self.set_trainable( layer_regex, keras_model=layer, indent=indent + 4) continue if not layer.weights: continue # Is it trainable? trainable = bool(re.fullmatch(layer_regex, layer.name)) # Update layer. If layer is a container, update inner layer. if layer.__class__.__name__ == 'TimeDistributed': layer.layer.trainable = trainable else: layer.trainable = trainable # Print trainble layer names if trainable and verbose > 0: semantic.utils.log("{}{:20} ({})".format(" " * indent, layer.name, layer.__class__.__name__)) def find_trainable_layer(self, layer): """If a layer is encapsulated by another layer, this function digs through the encapsulation and returns the layer that holds the weights. """ if layer.__class__.__name__ == 'TimeDistributed': return self.find_trainable_layer(layer.layer) return layer def get_trainable_layers(self): """Returns a list of layers that have weights.""" layers = [] # Loop through all layers for l in self.keras_model.layers: # If layer is a wrapper, find inner trainable layer l = self.find_trainable_layer(l) # Include layer if it has weights if l.get_weights(): layers.append(l) return layers def set_log_dir(self, model_path=None): """Sets the model log directory and epoch counter. model_path: If None, or a format different from what this code uses then set a new log directory and start epochs from 0. Otherwise, extract the log directory and the epoch counter from the file name. """ # Set date and epoch counter as if starting a new model self.epoch = 0 now = datetime.datetime.now() # If we have a model path with date and epochs use them if model_path: # Continue from we left of. Get epoch and date from the file name # A sample model path might look like: # /path/to/logs/coco20171029T2315/fcn_coco_0001.h5 regex = r".*/\w+(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})/fcn\_\w+(\d{4})\.h5" m = re.match(regex, model_path) if m: now = datetime.datetime(int(m.group(1)), int(m.group(2)), int(m.group(3)), int(m.group(4)), int(m.group(5))) # Epoch number in file is 1-based, and in Keras code it's 0-based. # So, adjust for that then increment by one to start from the next epoch self.epoch = int(m.group(6)) - 1 + 1 # Directory for training logs self.log_dir = os.path.join(self.model_dir, "{}{:%Y%m%dT%H%M}".format( self.config.NAME.lower(), now)) # Path to save after each epoch. Include placeholders that get filled by Keras. self.checkpoint_path = os.path.join(self.log_dir, "fcn_{}_*epoch*.h5".format( self.config.NAME.lower())) self.checkpoint_path = self.checkpoint_path.replace( "*epoch*", "{epoch:04d}") def find_last(self): """Finds the last checkpoint file of the last trained model in the model directory. Returns: log_dir: The directory where events and weights are saved checkpoint_path: the path to the last checkpoint file """ # Get directory names. Each directory corresponds to a model dir_names = next(os.walk(self.model_dir))[1] key = self.config.NAME.lower() dir_names = filter(lambda f: f.startswith(key), dir_names) dir_names = sorted(dir_names) if not dir_names: return None, None # Pick last directory dir_name = os.path.join(self.model_dir, dir_names[-1]) # Find the last checkpoint checkpoints = next(os.walk(dir_name))[2] checkpoints = filter(lambda f: f.startswith("fcn"), checkpoints) checkpoints = sorted(checkpoints) if not checkpoints: return dir_name, None checkpoint = os.path.join(dir_name, checkpoints[-1]) return dir_name, checkpoint
20,790
https://github.com/airicyu/fortel-codex/blob/master/main.js
Github Open Source
Open Source
MIT
2,022
fortel-codex
airicyu
JavaScript
Code
9
27
'use strict'; const codex = require('./src/codex'); module.exports = codex;
11,573
https://github.com/jsdelivrbot/dockerfiles-1/blob/master/data/d/dumfan/telegram/Dockerfile
Github Open Source
Open Source
MIT
2,018
dockerfiles-1
jsdelivrbot
Dockerfile
Code
49
100
FROM mhart/alpine-node WORKDIR /app ADD . . # If you have native dependencies, you'll need extra tools # RUN apk add --no-cache make gcc g++ python # If you need npm, don't use a base tag RUN npm install --production && npm run build EXPOSE 3000 CMD ["npm", "start"]
17,974
https://github.com/kib-ev/laravel-shop/blob/master/app/Http/Controllers/ProductCategoryController.php
Github Open Source
Open Source
MIT
2,020
laravel-shop
kib-ev
PHP
Code
102
374
<?php namespace App\Http\Controllers; use App\Models\Meta; use App\Models\Product; use App\Models\ProductCategory; use Illuminate\Http\Request; class ProductCategoryController extends Controller { public function index() { // } public function create() { // } public function store(Request $request) { // } public function show(int $productCategoryId) { $productCategory = ProductCategory::with('products')->findOrFail($productCategoryId); /** @var Meta $meta */ $meta = meta(); $meta->setTitleIfEmpty($productCategory->name); $productsIds = $productCategory->products->pluck('id'); foreach($productCategory->children as $childrenCategory) { $productsIds = $productsIds->merge($childrenCategory->products->pluck('id')); } $products = Product::whereIn('id', $productsIds)->paginate(config('site.products.per_page')); return view('public.pages.products', [ 'category' => $productCategory, 'products' => $products, ]); } public function edit(ProductCategory $productCategory) { // } public function update(Request $request, ProductCategory $productCategory) { // } public function destroy(ProductCategory $productCategory) { // } }
8,696
https://github.com/augustoperes1/samourai-wallet-android/blob/master/app/src/main/java/com/samourai/wallet/whirlpool/newPool/WhirlpoolDialog.java
Github Open Source
Open Source
Unlicense
2,022
samourai-wallet-android
augustoperes1
Java
Code
150
835
package com.samourai.wallet.whirlpool.newPool; import android.app.Dialog; import android.content.Intent; import android.os.Bundle; import com.google.android.material.bottomsheet.BottomSheetBehavior; import com.google.android.material.bottomsheet.BottomSheetDialogFragment; import androidx.coordinatorlayout.widget.CoordinatorLayout; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; import com.samourai.wallet.R; import com.samourai.wallet.send.SendActivity; import com.samourai.wallet.whirlpool.WhirlpoolMeta; import static com.samourai.wallet.whirlpool.WhirlpoolMain.NEWPOOL_REQ_CODE; public class WhirlpoolDialog extends BottomSheetDialogFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.bottomsheet_deposit_or_choose_utxo, null); Window window = getActivity().getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.setStatusBarColor(getResources().getColor(R.color.off_black)); view.findViewById(R.id.whirlpool_dialog_choose_utxos_btn).setOnClickListener(view1 -> { getActivity().startActivityForResult(new Intent(getActivity(), NewPoolActivity.class),NEWPOOL_REQ_CODE); this.dismiss(); }); view.findViewById(R.id.spend_btn_whirlpool_dialog).setOnClickListener(view1 -> { Intent intent = new Intent(getActivity(), SendActivity.class); intent.putExtra("_account", WhirlpoolMeta.getInstance(getContext()).getWhirlpoolPostmix()); startActivity(intent); }); return view; } @Override public void onDestroy() { Window window = getActivity().getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.setStatusBarColor(getResources().getColor(R.color.whirlpoolBlue)); super.onDestroy(); } @Override public void onStart() { super.onStart(); Dialog dialog = getDialog(); if (dialog != null) { View bottomSheet = dialog.findViewById(R.id.design_bottom_sheet); bottomSheet.getLayoutParams().height = ViewGroup.LayoutParams.MATCH_PARENT; } View view = getView(); view.post(() -> { View parent = (View) view.getParent(); CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) (parent).getLayoutParams(); CoordinatorLayout.Behavior behavior = params.getBehavior(); BottomSheetBehavior bottomSheetBehavior = (BottomSheetBehavior) behavior; bottomSheetBehavior.setPeekHeight(view.getMeasuredHeight()); }); } }
2,534
https://github.com/netrek/netrek-client-mactrek/blob/master/netrek-server-vanilla/ntserv/data.c
Github Open Source
Open Source
ClArtistic
null
netrek-client-mactrek
netrek
C
Code
2,284
7,178
/* $Id: data.c,v 1.7 2006/05/06 12:06:39 quozl Exp $ */ #include "copyright.h" #include "config.h" #include "defs.h" #include "struct.h" #include "data.h" struct player *players; struct player *me; struct torp *torps; struct context *context; struct status *status; struct ship *myship; struct stats *mystats; struct planet *planets; struct phaser *phasers; struct mctl *mctl; struct message *messages; struct message *uplink; struct message *oob; struct team *teams; struct ship *shipvals; struct pqueue *queues; struct queuewait *waiting; struct ban *bans; int oldalert = PFGREEN; /* Avoid changing more than we have to */ int remap[9] = { 0, 1, 2, -1, 3, -1, -1, -1, 4 }; int fps; /* simulation frames per second */ int distortion; /* time distortion constant, 10 is normal */ int minups; /* minimum client updates per second */ int defups; /* default client updates per second */ int maxups; /* maximum client updates per second */ int messpend; int lastcount; int mdisplayed; int redrawall; int udcounter; int lastm; int delay; /* delay for decaring war */ int rdelay; /* delay for refitting */ int doosher = 0; /* NBT 11-4-92 print doosh messages */ int dooshignore = 0; /* NBT 3/30/92 ignore doosh messages */ int macroignore = 0; int whymess = 0; /* NBT 6/1/93 improved why dead messages */ int show_sysdef=0; /* NBT 6/1/93 show sysdef on galactic */ int max_pop=999; /* NBT 9/9/93 sysdef for max planet pop */ int mapmode = 1; int namemode = 1; int showStats; int showShields; int warncount = 0; int warntimer = -1; int infomapped = 0; int mustexit = 0; int messtime = MESSTIME; int keeppeace = 0; int showlocal = 2; int showgalactic = 2; char *shipnos="0123456789abcdefghijklmnopqrstuvwxyz"; int sock= -1; int xtrekPort=27320; int shipPick; int teamPick; int repCount=0; char namePick[NAME_LEN]; char passPick[NAME_LEN]; fd_set inputMask; int nextSocket; char *host; char *ip; int userVersion=0, userUdpVersion=0; int bypassed=0; int top_armies=30; /*initial army count default */ int errorlevel=1; /* controlling amount of error info */ int dead_warp=0; /* use warp 14 for death detection */ int surrenderStart=1; /* # of planets to start surrender counter */ int sbplanets=5; /* # of planets to get a base */ int sborbit=0; /* Disallow bases to orbit enemy planets */ int restrict_3rd_drop=0; /* Disallow dropping on 3rd space planets */ int restrict_bomb=1; /* Disallow bombing outside of T-Mode */ int no_unwarring_bombing=1; /* No 3rd space bombing */ char *shipnames[NUM_TYPES] = { "Scout", "Destroyer", "Cruiser", "Battleship", "Assault", "Starbase", "SGalaxy", "AT&T" }; char *shiptypes[NUM_TYPES] = {"SC", "DD", "CA", "BB", "AS", "SB", "GA", "AT"}; char *weapontypes[WP_MAX] = {"PLASMA", "TRACTOR"}; char *planettypes[MAXPLANETS] = { "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39" }; #ifdef RSA /* NBT added */ char RSA_client_type[256]; /* from LAB 4/15/93 */ char testdata[KEY_SIZE]; int RSA_Client; #else char testdata[NAME_LEN]; #endif int checkmessage = 0; int logall=0; int loggod=0; int eventlog=0; int manager_type = 0; int manager_pid = 0; int why_dead=0; int Observer=0; int switch_to_observer=0; int switch_to_player=0; int SBhours=0; int testtime= -1; int tournplayers=5; int safe_idle=0; int shipsallowed[NUM_TYPES]; int weaponsallowed[WP_MAX]; int plkills=2; int ddrank=0; int garank=0; int sbrank=3; int startplanets[MAXPLANETS]; int binconfirm=1; int chaosmode=0; int topgun=0; /* added 12/9/90 TC */ int nodiag=1; int classictourn=0; int report_users=1; int killer=1; /* added 1/28/93 NBT */ int resetgalaxy=0; /* added 2/6/93 NBT */ int newturn=0; /* added 1/20/91 TC */ int planet_move=0; /* added 9/28/92 NBT */ int RSA_confirm=0; /* added 10/18/92 NBT */ int check_scum=0; /* added 7/21/93 NBT */ int wrap_galaxy=0; /* added 6/29/95 JRP */ int pingpong_plasma=0; /* added 7/6/95 JRP */ int max_chaos_bases=2; /* added 7/7/95 JRP */ int errors; /*fd to try and fix stderrs being sent over socket NBT 9/23/93*/ int hourratio=1; /* Fix thing to make guests advance fast */ int minRank=0; /* isae - Minimal rank allowed to play */ int clue=0; /* NBT - clue flag for time_access() */ int cluerank=6; int clueVerified=0; int clueFuse=0; int clueCount=0; char *clueString; int hiddenenemy=1; int vectortorps = 0; int galactic_smooth = 0; int udpSock=(-1); /* UDP - the almighty socket */ int commMode=0; /* UDP - initial mode is TCP only */ int udpAllowed=1; /* UDP - sysdefaults */ int bind_udp_port_base=0; double oldmax = 0.0; extern double Sin[], Cos[]; /* Initialized in sintab.c */ char teamlet[] = {'I', 'F', 'R', 'X', 'K', 'X', 'X', 'X', 'O'}; char *teamshort[9] = {"IND", "FED", "ROM", "X", "KLI", "X", "X", "X", "ORI"}; char login[PSEUDOSIZE]; struct rank ranks[NUMRANKS] = { { 0.0, 0.0, 0.0, "Ensign", "Esgn"}, { 2.0, 1.0, 0.0, "Lieutenant", "Lt "}, { 4.0, 2.0, 0.0, "Lt. Cmdr.", "LtCm"}, { 8.0, 3.0, 0.0, "Commander", "Cder"}, {15.0, 4.0, 0.0, "Captain", "Capt"}, {20.0, 5.0, 0.0, "Flt. Capt.", "FltC"}, /* change: 6/2/07 KA turn the defense measure into offense to challenge those players who just come in for the initial bombing and planet taking scumming; this is intended to improve team play amongst such players */ {25.0, 6.0, 1.0, "Commodore", "Cdor"}, {30.0, 7.0, 1.2, "Rear Adm.", "RAdm"}, {40.0, 8.0, 1.4, "Admiral", "Admr"}}; int startTkills, startTlosses, startTarms, startTplanets, startTticks; int startSBkills, startSBlosses, startSBticks; int ping=0; /* to ping or not to ping, client's decision*/ LONG packets_sent=0; /* # all packets sent to client */ LONG packets_received=0; /* # all packets received from client */ int ping_ghostbust=0; /* ghostbust timer */ /* defaults variables */ int ping_freq=1; /* ping freq. in seconds */ int ping_iloss_interval=10; /* in values of ping_freq */ int ping_allow_ghostbust=0; /* allow ghostbust detection from ping_ghostbust (cheating possible)*/ int ping_ghostbust_interval=5; /* in ping_freq, when to ghostbust if allowed */ int ghostbust_timer=30; int twarpMode=0; /* isae - SB transwarp */ int twarpSpeed=60; /* isae - Warp speed */ int twarpDelay=1; /* quozl - start delay in milliseconds */ int send_short = 0; int send_threshold = 0; /* infinity */ int actual_threshold = 0; /* == send_threshold / numupdates */ int numupdates = 5; /* For threshold */ int adminexec = 0; char admin_password[ADMIN_PASS_LEN]; char script_tourn_start[FNAMESIZE]; char script_tourn_end[FNAMESIZE]; char Global[FNAMESIZE]; char Scores[FNAMESIZE]; char PlFile[FNAMESIZE]; char Motd[FNAMESIZE] = N_MOTD ; char Motd_Path[FNAMESIZE]; char Daemon[FNAMESIZE]; char Robot[FNAMESIZE]; char LogFileName[FNAMESIZE]; char PlayerFile[FNAMESIZE]; char PlayerIndexFile[FNAMESIZE]; char ConqFile[FNAMESIZE]; char SysDef_File[FNAMESIZE]; char Time_File[FNAMESIZE]; char Clue_Bypass[FNAMESIZE]; char Banned_File[FNAMESIZE]; char Scum_File[FNAMESIZE]; char Error_File[FNAMESIZE]; char Bypass_File[FNAMESIZE]; #ifdef RSA char RSA_Key_File[FNAMESIZE]; #endif #ifdef AUTOMOTD char MakeMotd[FNAMESIZE]; #endif char MesgLog[FNAMESIZE]; char GodLog[FNAMESIZE]; char Feature_File[FNAMESIZE]; #ifdef ONCHECK char On_File[FNAMESIZE]; #endif #ifdef BASEPRACTICE char Basep[FNAMESIZE]; #endif #ifdef NEWBIESERVER char Newbie[FNAMESIZE]; int newbie_balance_humans=1; int min_newbie_slots=12; int max_newbie_players=8; #endif #ifdef PRETSERVER char PreT[FNAMESIZE]; int pret_guest = 0; int pret_planets = 3; int pret_save_galaxy = 1; int pret_galaxy_lifetime = 600; int pret_save_armies = 1; #endif int robot_debug_target = -1; int robot_debug_level = 0; #if defined(BASEPRACTICE) || defined(NEWBIESERVER) || defined(PRETSERVER) char Robodir[FNAMESIZE]; char robofile[FNAMESIZE]; char robot_host[FNAMESIZE]; int is_robot_by_host = 1; #endif #ifdef DOGFIGHT char Mars[FNAMESIZE]; #endif char Puck[FNAMESIZE]; char Inl[FNAMESIZE]; int inl_record = 0; int inl_draft_style = 0; char NoCount_File[FNAMESIZE]; char Prog[FNAMESIZE]; char LogFile[FNAMESIZE]; #ifdef DOGFIGHT /* Needed for Mars */ int nummatch=4; int contestsize=4; int dogcounts=0; #endif char Cambot[FNAMESIZE]; char Cambot_out[FNAMESIZE]; int num_distress; /* the following copied out of BRM data.c */ int num_distress; /* the index into distmacro array should correspond with the correct dist_type */ struct dmacro_list distmacro[] = { { 'X', "no zero", "this should never get looked at" }, { 't', "taking", " %T%c->%O (%S) Carrying %a to %l%?%n>-1%{ @ %n%}\0"}, { 'o', "ogg", " %T%c->%O Help Ogg %p at %l\0" }, { 'b', "bomb", " %T%c->%O %?%n>4%{bomb %l @ %n%!bomb %l%}\0"}, { 'c', "space_control", " %T%c->%O Help Control at %L\0" }, { '1', "save_planet", " %T%c->%O Emergency at %L!!!!\0" }, { '2', "base_ogg", " %T%c->%O Sync with --]> %g <[-- OGG ogg OGG base!!\0" }, { '3', "help1", " %T%c->%O Help me! %d%% dam, %s%% shd, %f%% fuel %a armies.\0" }, { '4', "help2", " %T%c->%O Help me! %d%% dam, %s%% shd, %f%% fuel %a armies.\0" }, { 'e', "escorting", " %T%c->%O ESCORTING %g (%d%%D %s%%S %f%%F)\0" }, { 'p', "ogging", " %T%c->%O Ogging %h\0" }, { 'm', "bombing", " %T%c->%O Bombing %l @ %n\0" }, { 'l', "controlling", " %T%c->%O Controlling at %l\0" }, { '5', "asw", " %T%c->%O Anti-bombing %p near %b.\0" } , { '6', "asbomb", " %T%c->%O DON'T BOMB %l. Let me bomb it (%S)\0" } , { '7', "doing1", " %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%% dam, %s%% shd, %f%% fuel)\0" } , { '8', "doing2", " %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%% dam, %s%% shd, %f%% fuel)\0" } , { 'f', "free_beer", " %T%c->%O %p is free beer\0" }, { 'n', "no_gas", " %T%c->%O %p @ %l has no gas\0" }, { 'h', "crippled", " %T%c->%O %p @ %l crippled\0" }, { '9', "pickup", " %T%c->%O %p++ @ %l\0" }, { '0', "pop", " %T%c->%O %l%?%n>-1%{ @ %n%}!\0"}, { 'F', "carrying", " %T%c->%O %?%S=SB%{Your Starbase is c%!C%}arrying %?%a>0%{%a%!NO%} arm%?%a=1%{y%!ies%}.\0" }, { '@', "other1", " %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%%D, %s%%S, %f%%F)\0" }, { '#', "other2", " %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%%D, %s%%S, %f%%F)\0" }, { 'E', "help", " %T%c->%O Help(%S)! %s%% shd, %d%% dmg, %f%% fuel,%?%S=SB%{ %w%% wtmp,%!%}%E%{ ETEMP!%}%W%{ WTEMP!%} %a armies!\0" }, { '\0', '\0', '\0'}, }; /*------------------------------------------------------------------------ Stolen direct from the Paradise 2.2.6 server code This code is used to set shipvalues from .sysdef Added 1/9/94 by Steve Sheldon ------------------------------------------------------------------------*/ #define OFFSET_OF(field) ( (char*)(&((struct ship*)0)->field) -\ (char*)0) struct field_desc ship_fields[] = { {"turns", FT_INT, OFFSET_OF (s_turns)}, {"accs", FT_SHORT, OFFSET_OF (s_accs)}, {"torpdamage", FT_SHORT, OFFSET_OF (s_torpdamage)}, {"phaserdamage", FT_SHORT, OFFSET_OF (s_phaserdamage)}, {"phaserfuse", FT_SHORT, OFFSET_OF (s_phaserfuse)}, {"plasmadamage", FT_SHORT, OFFSET_OF (s_plasmadamage)}, {"torpspeed", FT_SHORT, OFFSET_OF (s_torpspeed)}, {"torpfuse", FT_SHORT, OFFSET_OF (s_torpfuse)}, {"torpturns", FT_SHORT, OFFSET_OF (s_torpturns)}, {"plasmaspeed", FT_SHORT, OFFSET_OF (s_plasmaspeed)}, {"plasmafuse", FT_SHORT, OFFSET_OF (s_plasmafuse)}, {"plasmaturns", FT_SHORT, OFFSET_OF (s_plasmaturns)}, {"maxspeed", FT_INT, OFFSET_OF (s_maxspeed)}, {"repair", FT_SHORT, OFFSET_OF (s_repair)}, {"maxfuel", FT_INT, OFFSET_OF (s_maxfuel)}, {"torpcost", FT_SHORT, OFFSET_OF (s_torpcost)}, {"plasmacost", FT_SHORT, OFFSET_OF (s_plasmacost)}, {"phasercost", FT_SHORT, OFFSET_OF (s_phasercost)}, {"detcost", FT_SHORT, OFFSET_OF (s_detcost)}, {"warpcost", FT_SHORT, OFFSET_OF (s_warpcost)}, {"cloakcost", FT_SHORT, OFFSET_OF (s_cloakcost)}, {"recharge", FT_SHORT, OFFSET_OF (s_recharge)}, {"accint", FT_INT, OFFSET_OF (s_accint)}, {"decint", FT_INT, OFFSET_OF (s_decint)}, {"maxshield", FT_INT, OFFSET_OF (s_maxshield)}, {"maxdamage", FT_INT, OFFSET_OF (s_maxdamage)}, {"maxegntemp", FT_INT, OFFSET_OF (s_maxegntemp)}, {"maxwpntemp", FT_INT, OFFSET_OF (s_maxwpntemp)}, {"egncoolrate", FT_SHORT, OFFSET_OF (s_egncoolrate)}, {"wpncoolrate", FT_SHORT, OFFSET_OF (s_wpncoolrate)}, {"maxarmies", FT_SHORT, OFFSET_OF (s_maxarmies)}, {"width", FT_SHORT, OFFSET_OF (s_width)}, {"height", FT_SHORT, OFFSET_OF (s_height)}, {"type", FT_SHORT, OFFSET_OF (s_type)}, {"mass", FT_SHORT, OFFSET_OF (s_mass)}, {"tractstr", FT_SHORT, OFFSET_OF (s_tractstr)}, {"tractrng", FT_FLOAT, OFFSET_OF (s_tractrng)}, {0} }; int F_client_feature_packets = 0; int F_ship_cap = 0; int F_cloak_maxwarp = 0; int F_rc_distress = 0; int F_self_8flags = 0; int F_19flags = 0; /* pack 19 flags into spare bytes */ int F_show_all_tractors = 0; int F_sp_generic_32 = 0; /* Repair time, etc. */ int A_sp_generic_32 = 0; int F_full_direction_resolution = 0; /* Use SP_PLAYER instead of * SP_S_PLAYER */ int F_full_weapon_resolution = 0; /* Send certain weapons data * beyond tactical range */ int F_check_planets = 0; /* allow client to confirm * planet info is correct */ int F_show_army_count = 0; /* army count by planet */ int F_show_other_speed = 0; /* show other player's speed */ int F_show_cloakers = 0; /* show other cloakers on tactical */ int F_turn_keys = 0; /* use keyboard to turn */ int F_show_visibility_range = 0; /* allow client to show range at * which enemies can see self */ int F_flags_all = 0; /* SP_FLAGS_ALL packet may be sent */ int F_why_dead_2 = 0; /* Use additional p_whydead states */ int F_auto_weapons = 0; /* allow client to autoaim/fire */ int F_sp_rank = 0; /* send rank_spacket */ int F_sp_ltd = 0; /* send ltd_spacket */ int F_tips = 0; /* supports motd clearing and tips */ int mute = 0; int muteall = 0; int remoteaddr = -1; /* inet address in net format */ int observer_muting = 0; int observer_keeps_game_alive = 0; int whitelisted = 0; int blacklisted = 0; int hidden = 0; int ignored[MAXPLAYER]; int voting=0; int ban_vote_enable=0; int ban_vote_duration=3600; int ban_noconnect=0; int eject_vote_enable=0; int eject_vote_only_if_queue=0; int eject_vote_vicious=0; int duplicates=3; int deny_duplicates=0; int blogging=1; int genoquit=0; #ifdef STURGEON int sturgeon = 0; int sturgeon_special_weapons = 1; int sturgeon_maxupgrades = 100; int sturgeon_extrakills = 0; int sturgeon_planetupgrades = 0; int sturgeon_lite = 0; int upgradeable = 1; char *upgradename[] = { "misc", "shield", "hull", "fuel", "recharge", "maxwarp", "accel", "decel", "engine cool", "phaser damage", "torp speed", "torp fuse", "weapon cooling", "cloak", "tractor str", "tractor range", "repair", "fire while cloaked", "det own torps for damage" }; double baseupgradecost[] = { 0.0, 1.0, 1.5, 0.5, 1.0, 2.0, 0.5, 0.5, 1.0, 1.0, 2.0, 0.5, 1.0, 2.0, 1.0, 1.0, 1.0, 5.0, 5.0, 0.0 }; double adderupgradecost[]= { 0.0, 0.2, 0.5, 0.1, 1.5, 1.0, 0.1, 0.1, 0.5, 1.5, 3.0, 0.5, 1.5, 1.0, 0.5, 1.5, 1.0, 0.0, 0.0, 0.0 }; #endif /* starbase rebuild time first implemented by TC in 1992-04-15 */ int starbase_rebuild_time = 30; /* size of most recent UDP packet sent, for use by udpstats command */ int last_udp_size = 0; int ip_check_dns = 0; int ip_check_dns_verbose = 0; int offense_rank = 0; /* allow whitelisted entries to bypass ignore settings */ int whitelist_indiv = 0; int whitelist_team = 0; int whitelist_all = 0; int server_advertise_enable = 0; char server_advertise_filter[MSG_LEN]; float sb_minimal_offense = 0.0; float dd_minimal_offense = 0.0; /* classical style refit at < 75% hull damage */ int lame_refit = 1; /* classical style base refit at < 75% hull damage */ int lame_base_refit = 1; /* login time, in seconds, default set from Netrek XP in 2008-06 */ int logintime = 100; /* whether self destructing gives credit to nearest enemy */ int self_destruct_credit = 0; /* Whether to report the client identification of arriving players */ int report_ident = 0; int has_set_speed = 0; int has_set_course = 0; int has_shield_up = 0; int has_shield_down = 0; int has_bombed = 0; int has_beamed_up = 0; int has_beamed_down = 0; int has_repaired = 0;
16,161
https://github.com/davignola/olcPixelGameEngineManaged/blob/master/Extensions/Managed/Includes.cpp
Github Open Source
Open Source
BSD-3-Clause
2,020
olcPixelGameEngineManaged
davignola
C++
Code
16
62
#pragma once #define OLC_PGE_APPLICATION #include "PixelGameEngineManaged.h" void Dummy_ExportTemplated() { auto vec = gcnew olc::managed::vi2dm(0, 0); }
25,388
https://github.com/franciscosolla/react-native-firebase/blob/master/packages/analytics/e2e/analytics.e2e.js
Github Open Source
Open Source
Apache-2.0, CC-BY-3.0, LicenseRef-scancode-warranty-disclaimer, LicenseRef-scancode-unknown-license-reference
2,020
react-native-firebase
franciscosolla
JavaScript
Code
2,245
6,573
/* * Copyright (c) 2016-present Invertase Limited & Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this library except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ describe('analytics()', () => { describe('namespace', () => {}); describe('logEvent()', () => { it('log an event without parameters', async () => { await firebase.analytics().logEvent('invertase_event'); }); it('log an event with parameters', async () => { await firebase.analytics().logEvent('invertase_event', { boolean: true, number: 1, string: 'string', }); }); it('log an event with parameters', async () => { await firebase.analytics().logEvent('invertase_event', { boolean: true, number: 1, string: 'string', }); }); }); describe('setAnalyticsCollectionEnabled()', () => { it('true', async () => { await firebase.analytics().setAnalyticsCollectionEnabled(true); }); it('false', async () => { await firebase.analytics().setAnalyticsCollectionEnabled(false); }); }); describe('resetAnalyticsData()', () => { it('calls native fn without error', async () => { await firebase.analytics().resetAnalyticsData(); }); }); describe('setCurrentScreen()', () => { it('screenName only', async () => { await firebase.analytics().setCurrentScreen('invertase screen'); }); it('screenName with screenClassOverride', async () => { await firebase.analytics().setCurrentScreen('invertase screen', 'invertase class override'); }); it('errors if screenName not a string', async () => { try { await firebase.analytics().setCurrentScreen(666.1337); return Promise.reject(new Error('Did not throw.')); } catch (e) { e.message.should.containEql("'screenName' expected a string value"); } }); it('errors if screenClassOverride not a string', async () => { try { await firebase.analytics().setCurrentScreen('invertase screen', 666.1337); return Promise.reject(new Error('Did not throw.')); } catch (e) { e.message.should.containEql("'screenClassOverride' expected a string value"); } }); }); describe('setMinimumSessionDuration()', () => { it('default duration', async () => { await firebase.analytics().setMinimumSessionDuration(); }); it('errors if milliseconds not a number', async () => { try { await firebase.analytics().setMinimumSessionDuration('123'); return Promise.reject(new Error('Did not throw.')); } catch (e) { e.message.should.containEql("'milliseconds' expected a number value"); } }); it('errors if milliseconds is less than 0', async () => { try { await firebase.analytics().setMinimumSessionDuration(-100); return Promise.reject(new Error('Did not throw.')); } catch (e) { e.message.should.containEql("'milliseconds' expected a positive number value"); } }); it('custom duration', async () => { await firebase.analytics().setMinimumSessionDuration(1337); }); }); describe('setSessionTimeoutDuration()', () => { it('default duration', async () => { await firebase.analytics().setSessionTimeoutDuration(); }); it('errors if milliseconds not a number', async () => { try { await firebase.analytics().setSessionTimeoutDuration('123'); return Promise.reject(new Error('Did not throw.')); } catch (e) { e.message.should.containEql("'milliseconds' expected a number value"); } }); it('errors if milliseconds is less than 0', async () => { try { await firebase.analytics().setSessionTimeoutDuration(-100); return Promise.reject(new Error('Did not throw.')); } catch (e) { e.message.should.containEql("'milliseconds' expected a positive number value"); } }); it('custom duration', async () => { await firebase.analytics().setSessionTimeoutDuration(13371337); }); }); describe('setUserId()', () => { it('allows a null values to be set', async () => { await firebase.analytics().setUserId(null); }); it('accepts string values', async () => { await firebase.analytics().setUserId('rn-firebase'); }); it('throws if none string none null values', async () => { try { await firebase.analytics().setUserId(123); return Promise.reject(new Error('Did not throw.')); } catch (e) { e.message.should.containEql("'id' expected a string value"); } }); }); describe('setUserProperty()', () => { it('allows a null values to be set', async () => { await firebase.analytics().setUserProperty('invertase', null); }); it('accepts string values', async () => { await firebase.analytics().setUserProperty('invertase2', 'rn-firebase'); }); it('throws if name is not a string', async () => { try { await firebase.analytics().setUserProperty(1337, 'invertase'); return Promise.reject(new Error('Did not throw.')); } catch (e) { e.message.should.containEql("'name' expected a string value"); } }); it('throws if value is invalid', async () => { try { await firebase.analytics().setUserProperty('invertase3', 33.3333); return Promise.reject(new Error('Did not throw.')); } catch (e) { e.message.should.containEql("'value' expected a string value"); } }); }); describe('setUserProperties()', () => { it('throws if properties is not an object', async () => { try { await firebase.analytics().setUserProperties(1337); return Promise.reject(new Error('Did not throw.')); } catch (e) { e.message.should.containEql("'properties' expected an object of key/value pairs"); } }); it('throws if property value is invalid', async () => { try { await firebase.analytics().setUserProperties({ test: '123', foo: { bar: 'baz', }, }); return Promise.reject(new Error('Did not throw.')); } catch (e) { e.message.should.containEql("'properties' value for parameter 'foo' is invalid"); } }); it('throws if value is a number', async () => { try { await firebase.analytics().setUserProperties({ invertase1: 123 }); return Promise.reject(new Error('Did not throw.')); } catch (e) { e.message.should.containEql( "'properties' value for parameter 'invertase1' is invalid, expected a string.", ); } }); it('allows null values to be set', async () => { await firebase.analytics().setUserProperties({ invertase2: null }); }); it('accepts string values', async () => { await firebase.analytics().setUserProperties({ invertase3: 'rn-firebase' }); }); }); describe('logAddPaymentInfo()', () => { it('calls logEvent', async () => { await firebase.analytics().logAddPaymentInfo(); }); }); describe('logAddToCart()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logAddToCart(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('errors when compound values are not set', async () => { try { await firebase.analytics().logAddToCart({ item_id: 'foo', item_name: 'foo', item_category: 'foo', quantity: 1, value: 123, }); } catch (e) { e.message.should.containEql('parameter, you must also supply the'); } }); it('calls logAddToCart', async () => { await firebase.analytics().logAddToCart({ item_id: 'foo', item_name: 'foo', item_category: 'foo', quantity: 1, item_location_id: 'foo', start_date: '2019-01-01', value: 123, currency: 'GBP', }); }); }); describe('logAddToWishlist()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logAddToWishlist(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('errors when compound values are not set', async () => { try { await firebase.analytics().logAddToWishlist({ item_id: 'foo', item_name: 'foo', item_category: 'foo', quantity: 1, value: 123, }); } catch (e) { e.message.should.containEql('parameter, you must also supply the'); } }); it('calls logAddToWishlist', async () => { await firebase.analytics().logAddToWishlist({ item_id: 'foo', item_name: 'foo', item_category: 'foo', quantity: 1, item_location_id: 'foo', value: 123, currency: 'GBP', }); }); }); describe('logAppOpen()', () => { it('calls logAppOpen', async () => { await firebase.analytics().logAppOpen(); }); }); describe('logBeginCheckout()', () => { it('calls logBeginCheckout', async () => { await firebase.analytics().logBeginCheckout(); }); it('errors when compound values are not set', async () => { try { await firebase.analytics().logBeginCheckout({ value: 123, }); } catch (e) { e.message.should.containEql('parameter, you must also supply the'); } }); }); describe('logCampaignDetails()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logCampaignDetails(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('calls logCampaignDetails', async () => { await firebase.analytics().logCampaignDetails({ source: 'foo', medium: 'bar', campaign: 'baz', }); }); }); describe('logEarnVirtualCurrency()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logEarnVirtualCurrency(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('calls logEarnVirtualCurrency', async () => { await firebase.analytics().logEarnVirtualCurrency({ virtual_currency_name: 'foo', value: 123, }); }); }); describe('logEcommercePurchase()', () => { it('calls logEcommercePurchase with no params', async () => { await firebase.analytics().logEcommercePurchase(); }); it('calls logEcommercePurchase', async () => { await firebase.analytics().logEcommercePurchase({ currency: 'USD', value: 123, }); }); }); describe('logGenerateLead()', () => { it('calls logGenerateLead with no params', async () => { await firebase.analytics().logEcommercePurchase(); }); it('calls logGenerateLead', async () => { await firebase.analytics().logEcommercePurchase({ currency: 'USD', value: 123, }); }); }); describe('logJoinGroup()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logJoinGroup(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('calls logJoinGroup', async () => { await firebase.analytics().logJoinGroup({ group_id: '123', }); }); }); describe('logLevelEnd()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logLevelEnd(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('calls logLevelEnd', async () => { await firebase.analytics().logLevelEnd({ level: 123, success: 'yes', }); }); }); describe('logLevelStart()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logLevelStart(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('calls logLevelEnd', async () => { await firebase.analytics().logLevelStart({ level: 123, }); }); }); describe('logLevelUp()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logLevelUp(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('calls logLevelUp', async () => { await firebase.analytics().logLevelUp({ level: 123, character: 'foo', }); }); }); describe('logLogin()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logLogin(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('calls logLogin', async () => { await firebase.analytics().logLogin({ method: 'facebook.com', }); }); }); describe('logPostScore()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logPostScore(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('calls logPostScore', async () => { await firebase.analytics().logPostScore({ score: 123, }); }); }); describe('logPresentOffer()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logPresentOffer(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('errors when compound values are not set', async () => { try { await firebase.analytics().logPresentOffer({ item_id: 'foo', item_name: 'foo', item_category: 'foo', quantity: 1, value: 123, }); } catch (e) { e.message.should.containEql('parameter, you must also supply the'); } }); it('calls logPresentOffer', async () => { await firebase.analytics().logPresentOffer({ item_id: '123', item_name: '123', item_category: '123', quantity: 123, }); }); }); describe('logPurchaseRefund()', () => { it('errors when compound values are not set', async () => { try { await firebase.analytics().logPurchaseRefund({ value: 123, }); } catch (e) { e.message.should.containEql('parameter, you must also supply the'); } }); it('calls logPurchaseRefund with no params', async () => { await firebase.analytics().logPurchaseRefund(); }); it('calls logPurchaseRefund', async () => { await firebase.analytics().logPurchaseRefund({ transaction_id: '123', }); }); }); describe('logRemoveFromCart()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logRemoveFromCart(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('errors when compound values are not set', async () => { try { await firebase.analytics().logRemoveFromCart({ item_id: 'foo', item_name: 'foo', item_category: 'foo', value: 123, }); } catch (e) { e.message.should.containEql('parameter, you must also supply the'); } }); it('calls logRemoveFromCart', async () => { await firebase.analytics().logRemoveFromCart({ item_id: 'foo', item_name: 'foo', item_category: 'foo', }); }); }); describe('logSearch()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logSearch(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('calls logSearch', async () => { await firebase.analytics().logSearch({ search_term: 'foo', }); }); }); describe('logSelectContent()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logSelectContent(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('calls logSelectContent', async () => { await firebase.analytics().logSelectContent({ content_type: 'foo', item_id: 'foo', }); }); }); describe('logSetCheckoutOption()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logSetCheckoutOption(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('calls logSelectContent', async () => { await firebase.analytics().logSetCheckoutOption({ checkout_step: 123, checkout_option: 'foo', }); }); }); describe('logShare()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logShare(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('calls logShare', async () => { await firebase.analytics().logShare({ content_type: 'foo', item_id: 'foo', }); }); }); describe('logSignUp()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logSignUp(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('calls logSignUp', async () => { await firebase.analytics().logSignUp({ method: 'facebook.com', }); }); }); describe('logSpendVirtualCurrency()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logSpendVirtualCurrency(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('calls logSpendVirtualCurrency', async () => { await firebase.analytics().logSpendVirtualCurrency({ item_name: 'foo', virtual_currency_name: 'foo', value: 123, }); }); }); describe('logTutorialBegin()', () => { it('calls logTutorialBegin', async () => { await firebase.analytics().logTutorialBegin(); }); }); describe('logTutorialComplete()', () => { it('calls logTutorialComplete', async () => { await firebase.analytics().logTutorialComplete(); }); }); describe('logUnlockAchievement()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logUnlockAchievement(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('calls logUnlockAchievement', async () => { await firebase.analytics().logUnlockAchievement({ achievement_id: 'foo', }); }); }); describe('logViewItem()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logViewItem(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('errors when compound values are not set', async () => { try { await firebase.analytics().logViewItem({ item_id: 'foo', item_name: 'foo', item_category: 'foo', value: 123, }); } catch (e) { e.message.should.containEql('parameter, you must also supply the'); } }); it('calls logUnlockAchievement', async () => { await firebase.analytics().logViewItem({ item_id: 'foo', item_name: 'foo', item_category: 'foo', }); }); }); describe('logViewItemList()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logViewItemList(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('calls logViewItemList', async () => { await firebase.analytics().logViewItemList({ item_category: 'foo', }); }); }); describe('logViewSearchResults()', () => { it('errors when no parameters are set', async () => { try { await firebase.analytics().logViewSearchResults(); } catch (e) { e.message.should.containEql('The supplied arg must be an object of key/values'); } }); it('calls logViewSearchResults', async () => { await firebase.analytics().logViewSearchResults({ search_term: 'foo', }); }); }); });
2,523
https://github.com/bodasheera/ds-ui-appcenter/blob/master/src/app/dashboard/interactions/node-info/node-info.component.ts
Github Open Source
Open Source
Apache-2.0
null
ds-ui-appcenter
bodasheera
TypeScript
Code
847
2,593
import { Component, OnInit, Input } from '@angular/core'; import { FlowData, NodeData } from '../interactions.model'; import { AppService } from 'src/app/service/app.service'; @Component({ selector: 'odp-node-info', templateUrl: './node-info.component.html', styleUrls: ['./node-info.component.scss'] }) export class NodeInfoComponent implements OnInit { @Input() flowData: FlowData; @Input() interactionData: any; @Input() nodeList: Array<NodeData>; @Input() requestNodeList: Array<NodeData>; @Input() responseNodeList: Array<NodeData>; @Input() node: NodeData; @Input() index: number; @Input() logData: any; @Input() logList: Array<any>; passwordCopied: boolean; showError: boolean; constructor(private appService: AppService) { const self = this; self.flowData = {}; self.interactionData = {}; self.node = {}; self.logData = {}; self.nodeList = []; self.requestNodeList = []; self.responseNodeList = []; this.logList = []; } ngOnInit() { const self = this; if (!self.node.meta.flowType) { self.node.meta.flowType = 'request'; } if (self.logData) { self.node.hasLogs = true; } if (!self.node.hasLogs && self.interactionData.errorMessage) { self.node.hasError = true; } if (self.index > 0) { const prevNode = self.nodeList[self.index - 1]; if (prevNode.hasError) { self.node.hasErrorInPrev = true; } else { self.node.hasErrorInPrev = false; } } else if (self.node.meta.flowType === 'response') { const prevNode = self.requestNodeList[self.requestNodeList.length - 1]; if (prevNode.hasError) { self.node.hasErrorInPrev = true; } else { self.node.hasErrorInPrev = false; } } else if (self.node.meta.flowType === 'error') { let prevNode; if (self.responseNodeList.length > 0) { prevNode = self.responseNodeList[self.responseNodeList.length - 1]; } else { prevNode = self.requestNodeList[self.requestNodeList.length - 1]; } if (prevNode.hasError) { self.node.hasErrorInPrev = true; } else { self.node.hasErrorInPrev = false; } } if (!self.statusSuccess) { self.node.hasError = true; } } copyPassword() { const self = this; if (self.node.meta.blockType === 'INPUT') { self.appService.copyToClipboard(self.interactionData.inputPasswordDecoded); } else { self.appService.copyToClipboard(self.interactionData.outputPasswordDecoded); } self.passwordCopied = true; setTimeout(() => { self.passwordCopied = false; }, 3000); } get startNode() { const self = this; if ((self.node.meta && self.node.meta.flowType === 'request' && self.node.meta.blockType === 'INPUT')) { return true; } else { return false; } } get endpoint() { const self = this; if (self.logData) { if (self.node.meta && self.node.meta.blockType === 'INPUT' && self.node.meta.sourceType === 'REST') { return self.logData.endpoint; } else { return self.logData.url; } } } get statusSuccess() { const self = this; if (self.logData && self.logData.statusCode) { if (typeof self.logData.statusCode === 'string') { self.logData.statusCode = parseInt(self.logData.statusCode, 10); } if ((self.logData.statusCode - 200) < 100) { return true; } else { return false; } } return false; } get duration() { const self = this; const unit = ['ms', 'sec', 'min', 'hr']; let counter = 0; if (self.logData && self.logData.completedTimestamp && self.logData.createTimestamp) { const endTime = new Date(self.logData.completedTimestamp).getTime(); const startTime = new Date(self.logData.createTimestamp).getTime(); let duration = endTime - startTime; if (duration > 1000 && counter === 0) { counter++; duration = duration / 1000; } if (duration > 60 && counter === 1) { counter++; duration = duration / 60; } if (duration > 60 && counter === 2) { counter++; duration = duration / 60; } return `${duration.toFixed(2)} ${unit[counter]}`; } return null; } get agentFileHref() { const self = this; if (self.node.meta.blockType === 'INPUT') { return self.interactionData.inputFileHref; } else { return self.interactionData.outputFileHref; } } get agentFilePassword() { const self = this; if (self.node.meta.blockType === 'INPUT') { return self.interactionData.inputPasswordDecoded; } else { return self.interactionData.outputPasswordDecoded; } } get location() { const self = this; if (self.logData && self.logData.metadata && self.logData.metadata.directories) { if (Array.isArray(self.logData.metadata.directories)) { return self.logData.metadata.directories[0]; } else { return self.logData.metadata.directories; } } return null; } get showLogMissing() { const self = this; if (!self.node.hasLogs && !self.node.hasErrorInPrev && self.node.meta.flowType !== 'error' && !self.interactionData.errorMessage && !(self.interactionData.status === 'PENDING' || self.interactionData.status === 'UNKNOWN' || self.interactionData.status === 'QUEUED')) { return true; } return false; } get showLogPending() { const self = this; if (!self.node.hasLogs && (self.interactionData.status === 'PENDING' || self.interactionData.status === 'UNKNOWN' || self.interactionData.status === 'QUEUED')) { return true; } return false; } get showErrorMessage() { const self = this; if (!self.node.hasLogs && !self.node.hasErrorInPrev && self.interactionData.errorMessage) { return true; } if (!self.node.hasLogs && self.node.meta.flowType === 'error' && self.interactionData.errorMessage) { return true; } return false; } get showErrorInNode() { const self = this; let message: string; if (self.logData && self.logData.error) { if (typeof self.logData.error === 'object') { message = self.logData.error.message; } if (!message) { message = JSON.stringify(self.logData.error); } } else if (self.interactionData.errorMessage) { message = self.interactionData.errorMessage; } const temp = this.logList.find(e => e.error); if (temp && temp.sequenceNo !== this.index + 1) { message = null; } if (message && message.indexOf('dial tcp: lookup') > -1) { message = 'Unable to reach integration flow pod, Please contact adminstrator'; } if (message && message.indexOf('EOF') > -1) { message = 'Request to integration flow was sent, but it timed out'; } return message; } get showDidNotExecute() { const self = this; if (self.node.meta.flowType !== 'error' && self.node.hasErrorInPrev && self.interactionData.status === 'ERROR') { return true; } return false; } get showNoNeedToExecute() { const self = this; if (self.node.meta.flowType === 'error' && self.interactionData.status === 'SUCCESS') { return true; } return false; } get errorMessage() { const self = this; let message: string; if (self.logData && self.logData.error) { message = self.logData.error; } if (!self.interactionData.errorMessage && self.interactionData.errorStackTrace) { self.interactionData.errorMessage = self.interactionData.errorStackTrace; } if (!message) { try { message = JSON.parse(self.interactionData.errorMessage).message; if (!message) { message = self.interactionData.errorMessage; } } catch (e) { console.error('Error Message is not a valid JSON', e); message = self.interactionData.errorMessage; } } if (message && message.indexOf('ESOCKETTIMEDOUT') > -1) { message = 'Request Timed Out'; } return message; } }
33,801
https://github.com/tony2u/Medusa/blob/master/Medusa/Medusa/Node/Input/Gesture/StrokeGestureRecognizer.h
Github Open Source
Open Source
MIT
2,022
Medusa
tony2u
C
Code
102
377
// Copyright (c) 2015 fjz13. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. #pragma once #include "Node/Input/Gesture/IGestureRecognizer.h" #include "Node/Input/Gesture/Stroke/SingleStrokeTemplate.h" #include "Node/Input/Gesture/Stroke/SingleStrokeLibrary.h" MEDUSA_BEGIN; class StrokeGestureRecognizer :public IGestureRecognizer { public: StrokeGestureRecognizer(INode* node); virtual ~StrokeGestureRecognizer(void); virtual InputType GetInputType()const { return InputType::Stroke; } virtual void TouchesBegan(TouchEventArg& e); virtual void TouchesMoved(TouchEventArg& e); virtual void TouchesEnded(TouchEventArg& e); virtual void TouchesCancelled(TouchEventArg& e); virtual bool IsValid()const; virtual void Reset(); virtual bool HasHandler()const { return !OnStroke.IsEmpty(); } SingleStrokeLibrary& MutableLibrary() { return mLibrary; } public: StrokeEvent OnStroke; StrokeFailedEvent OnStrokeFailed; private: SingleStrokeLibrary mLibrary; SingleStrokeTemplate mStroke; }; MEDUSA_END;
501
https://github.com/darthjee/danica/blob/master/spec/support/models/operator/my_operator.rb
Github Open Source
Open Source
MIT
2,019
danica
darthjee
Ruby
Code
22
98
# frozen_string_literal: true class MyOperator < Danica::Operator variables :x def to_f (x**Danica::PI).to_f end def to_tex "#{x.to_tex}^{\\pi}" end def to_gnu "#{x.to_tex}**(pi)" end end
22,108
https://github.com/curiousTauseef/Weather-App-1/blob/master/backend/app/helpers/index.js
Github Open Source
Open Source
MIT
2,020
Weather-App-1
curiousTauseef
JavaScript
Code
22
52
const { sleep } = require('./sleep'); const { Ajax } = require('./Ajax'); const helpers = { sleep, Ajax }; module.exports.helpers = helpers;
26,422
https://github.com/serval-uni-lu/creos.simSG.website/blob/master/src/plugin/action/loadApprox/load-approx-msg.d.ts
Github Open Source
Open Source
Apache-2.0
2,020
creos.simSG.website
serval-uni-lu
TypeScript
Code
24
84
import {Message} from "@/ts/types/ws-message"; import {GridJson} from "@/ts/types/sg-json.types"; type ApproximationType = "naive" | "bs_rule"; interface LoadApproxMsg extends Message { grid: GridJson; approximationType?: ApproximationType; }
28,929
https://github.com/yoya/x.org/blob/master/X11R6/contrib/lib/auis-6.3/ams/msclients/vui/keycodes.h
Github Open Source
Open Source
BSD-3-Clause, LicenseRef-scancode-public-domain
2,023
x.org
yoya
C
Code
411
1,117
/* ********************************************************************** *\ * Copyright IBM Corporation 1988,1991 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* $Disclaimer: * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and that * both that copyright notice, this permission notice, and the following * disclaimer appear in supporting documentation, and that the names of * IBM, Carnegie Mellon University, and other copyright holders, not be * used in advertising or publicity pertaining to distribution of the software * without specific, written prior permission. * * IBM, CARNEGIE MELLON UNIVERSITY, AND THE OTHER COPYRIGHT HOLDERS * DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT * SHALL IBM, CARNEGIE MELLON UNIVERSITY, OR ANY OTHER COPYRIGHT HOLDER * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. * $ */ #ifdef IBMPC #define KEYCODE_LEFT (256*75) #define KEYCODE_RIGHT (256*77) #define KEYCODE_UP (256*72) #define KEYCODE_DOWN (256*80) #define KEYCODE_TAB (256*15)+9 #define KEYCODE_CTRL_TAB (256*116) #define KEYCODE_SHIFT_TAB (256*15) #define KEYCODE_CTRL_LEFT (256*115) #define KEYCODE_RETURN (256*28)+13 #define KEYCODE_FAKERETURN (256*28)+13 #define KEYCODE_INSERT (256*82) #define KEYCODE_DELETE (256*83) #define KEYCODE_HOME (256*71) #define KEYCODE_END (256*79) #define KEYCODE_BACKSPACE (256*14)+8 #define KEYCODE_DEL (256*14)+8 /* this matches BS and will be ignored */ #define KEYCODE_CTRL_END (256*117) #define KEYCODE_ESCAPE (256+27) #define KEYCODE_CTRL_HOME (256*119) #define KEYCODE_PAGE_DOWN (256*81) #define KEYCODE_PAGE_UP (256*73) #define KEYCODE_F1 (256*59) #define KEYCODE_F2 (256*60) #define KEYCODE_F3 (256*61) #define KEYCODE_ALT_F1 (256*104) #define KEYCODE_REDRAW (256*1)+1 /* mas V1.3 : this key value is fake! */ #else /* IBMPC */ #define KEYCODE_LEFT (2) #define KEYCODE_RIGHT (6) #define KEYCODE_UP (16) #define KEYCODE_DOWN (14) #define KEYCODE_TAB (9) #define KEYCODE_CTRL_TAB (256 + 9) #define KEYCODE_SHIFT_TAB (256 + 2) #define KEYCODE_CTRL_LEFT (256 + 2) #define KEYCODE_RETURN (13) #define KEYCODE_FAKERETURN (10) #define KEYCODE_INSERT (15) #define KEYCODE_DELETE (4) #define KEYCODE_HOME (1) #define KEYCODE_END (5) #define KEYCODE_BACKSPACE (8) #define KEYCODE_DEL (127) #define KEYCODE_CTRL_END (11) #define KEYCODE_ESCAPE (7) #define KEYCODE_CTRL_HOME (256 + '<') #define KEYCODE_PAGE_DOWN (22) #define KEYCODE_PAGE_UP (256 + 'v') #define KEYCODE_F1 (256 + '1') #define KEYCODE_F2 (256 + '2') #define KEYCODE_F3 (256 + '3') #define KEYCODE_ALT_F1 (256 + '!') #define KEYCODE_REDRAW (12) #endif /* IBMPC */
34,654
https://github.com/tails5555/Our_Title_Academy_2018_Web/blob/master/src/reducer/reducer_user.js
Github Open Source
Open Source
MIT
2,018
Our_Title_Academy_2018_Web
tails5555
JavaScript
Code
597
1,599
import { USER_FETCH_MY_SIGN_INFO, USER_FETCH_MY_SIGN_INFO_SUCCESS, USER_FETCH_MY_SIGN_INFO_FAILURE, RESET_USER_FETCH_MY_SIGN_INFO, USER_UPDATE_MY_SIGN_INFO, USER_UPDATE_MY_SIGN_INFO_SUCCESS, USER_UPDATE_MY_SIGN_INFO_FAILURE, RESET_USER_UPDATE_MY_SIGN_INFO } from "../action/type/type_user"; import { USER_LOGOUT_PROCESS, FETCH_USER_PRINCIPAL_FROM_SERVER_PROCESS, FETCH_USER_PRINCIPAL_FROM_SERVER_COMPLETE, FETCH_USER_PRINCIPAL_FROM_SERVER_EXCEPTION, RESET_FETCH_USER_PRINCIPAL_FROM_SERVER, ADMIN_LOAD_USER_LIST, ADMIN_LOAD_USER_LIST_SUCCESS, ADMIN_LOAD_USER_LIST_FAILURE, MANAGER_LOAD_USER_LIST, MANAGER_LOAD_USER_LIST_SUCCESS, MANAGER_LOAD_USER_LIST_FAILURE, RESET_COMMON_LOAD_USER_LIST, ADMIN_LOAD_USER_INFO, ADMIN_LOAD_USER_INFO_SUCCESS, ADMIN_LOAD_USER_INFO_FAILURE, MANAGER_LOAD_USER_INFO, MANAGER_LOAD_USER_INFO_SUCCESS, MANAGER_LOAD_USER_INFO_FAILURE, RESET_COMMON_LOAD_USER_INFO } from '../action/action_user'; const INITIAL_STATE = { form : { element : null, complete : null, loading : false, error : null }, signInfo : { signModel : null, loading : false, error : null }, cityElements : { cities : [], loading : false, error : null }, ageElements : { ages : [], loading : false, error : null }, passwordElement : { result : false, loading : false, error : null }, accessor : { principal : null, loading : false, error : null }, detailResult : { detail : null, loading : false, error : null }, principalList : { users : [], loading : false, error : null }, principalInfo : { detail : null, loading : false, error : null } } export default function(state = INITIAL_STATE, action){ let error; switch(action.type){ case USER_FETCH_MY_SIGN_INFO : return { ...state, form : { element : null, loading : true }}; case USER_FETCH_MY_SIGN_INFO_SUCCESS : return { ...state, form : { element : action.payload, loading : false }}; case USER_FETCH_MY_SIGN_INFO_FAILURE : return { ...state, form : { error : action.payload, loading : false }}; case RESET_USER_FETCH_MY_SIGN_INFO : return { ...state, form : { error : null, element : null }}; case USER_UPDATE_MY_SIGN_INFO : return { ...state, form : { complete : null, loading : true }}; case USER_UPDATE_MY_SIGN_INFO_SUCCESS : return { ...state, form : { complete : action.payload, loading : false }}; case USER_UPDATE_MY_SIGN_INFO_FAILURE : return { ...state, form : { error : action.payload, loading : false }}; case RESET_USER_UPDATE_MY_SIGN_INFO : return { ...state, form : { error : null, complete : null }}; case USER_LOGOUT_PROCESS : return { ...state, accessor : { principal : null, loading : false, error : null }}; case FETCH_USER_PRINCIPAL_FROM_SERVER_PROCESS : return { ...state, accessor : { principal : null, loading : true, error : null }}; case FETCH_USER_PRINCIPAL_FROM_SERVER_COMPLETE : return { ...state, accessor : { principal : action.payload, loading : false, error : null }}; case FETCH_USER_PRINCIPAL_FROM_SERVER_EXCEPTION : error = action.payload || { message : action.payload }; return { ...state, accessor : { principal : null, loading : false, error : error }}; case RESET_FETCH_USER_PRINCIPAL_FROM_SERVER : return { ...state, accessor : { principal : null, loading : false, error : null }}; case ADMIN_LOAD_USER_LIST : case MANAGER_LOAD_USER_LIST : return { ...state, principalList : { users : [], loading : true, error : null }}; case ADMIN_LOAD_USER_LIST_SUCCESS : case MANAGER_LOAD_USER_LIST_SUCCESS : return { ...state, principalList : { users : action.payload, loading : false, error : null }}; case ADMIN_LOAD_USER_LIST_FAILURE : case MANAGER_LOAD_USER_LIST_FAILURE : error = action.payload.data || { message : action.payload.data }; return { ...state, principalList : { users : [], loading : false, error : error }}; case RESET_COMMON_LOAD_USER_LIST : return { ...state, principalList : { users : [], loading : false, error : null }}; case ADMIN_LOAD_USER_INFO : case MANAGER_LOAD_USER_INFO : return { ...state, principalInfo : { detail : null, loading : true, error : null }}; case ADMIN_LOAD_USER_INFO_SUCCESS : case MANAGER_LOAD_USER_INFO_SUCCESS : return { ...state, principalInfo : { detail : action.payload, loading : false, error : null }}; case ADMIN_LOAD_USER_INFO_FAILURE : case MANAGER_LOAD_USER_INFO_FAILURE : error = action.payload || { message : action.payload }; return { ...state, principalInfo : { detail : null, loading : false, error : error }}; case RESET_COMMON_LOAD_USER_INFO : return { ...state, principalInfo : { detail : null, loading : false, error : null }}; default : return state; } }
39,390
https://github.com/JAN358/gatsby-test/blob/master/public/path----557518bd178906f8d58a.js
Github Open Source
Open Source
MIT
null
gatsby-test
JAN358
JavaScript
Code
3
59
webpackJsonp([60335399758886],{988:function(o,t){o.exports={layoutContext:{}}}}); //# sourceMappingURL=path----557518bd178906f8d58a.js.map
31,112
https://github.com/localparty/Inletclient/blob/master/Inletclient/Classes/brand profile 2018-12-19/SupportEmail.swift
Github Open Source
Open Source
MIT
null
Inletclient
localparty
Swift
Code
68
200
// // SupportEmail.swift // Model Generated using http://www.jsoncafe.com/ // Created on December 19, 2018 import Foundation struct SupportEmail : Codable { let supportEmailName : String? let supportEmailValue : String? enum CodingKeys: String, CodingKey { case supportEmailName = "supportEmailName" case supportEmailValue = "supportEmailValue" } init(from decoder: Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) supportEmailName = try values.decodeIfPresent(String.self, forKey: .supportEmailName) supportEmailValue = try values.decodeIfPresent(String.self, forKey: .supportEmailValue) } }
37,378
https://github.com/Mr-Leonerrr/Leonies/blob/master/commands/Fun/say.js
Github Open Source
Open Source
MIT
2,021
Leonies
Mr-Leonerrr
JavaScript
Code
54
170
const { Util, Message } = require("discord.js"); module.exports = { name: "say", description: "I will repeat what you say.", usage: "<your message>", group: "Fun", memberName: "Say", clientPerms: ["MANAGE_MESSAGES"], args: true, guildOnly: true, cooldown: 5, /** * @param {Message} message * @param {String[]} args */ callback: (message, args) => { message.channel.send(Util.removeMentions(args.join(" "))); message.delete(); }, };
8,118
https://github.com/curiousdannii/parchment/blob/master/.gitignore
Github Open Source
Open Source
MIT, GPL-2.0-only, BSD-2-Clause, Glulxe, GPL-3.0-only
2,023
parchment
curiousdannii
Ignore List
Code
8
39
dist node_modules package-lock.json tests/ifsitegen.py tests/Release /*.js /*.ulx /*.z5
13,862
https://github.com/xebialabs-community/xld-ucp-plugin/blob/master/settings.gradle
Github Open Source
Open Source
MIT, LicenseRef-scancode-unknown-license-reference
2,019
xld-ucp-plugin
xebialabs-community
Gradle
Code
3
15
rootProject.name = 'xld-ucp-plugin'
32,751
https://github.com/panchalneel/DisponioAPI/blob/master/libs/logger.js
Github Open Source
Open Source
MIT
null
DisponioAPI
panchalneel
JavaScript
Code
61
323
'use strict'; const LEVEL_TRACE='trace'; const LEVEL_DEBUG='debug'; const LEVEL_INFO='info'; const LEVEL_WARN='warn'; const LEVEL_ERROR='error'; module.exports= class Logger { log(message){ doLog(LEVEL_INFO,message); } trace(message){ doLog(LEVEL_TRACE,message); } debug(message){ doLog(LEVEL_DEBUG,message); } info(message){ doLog(LEVEL_INFO,message); } warn(message){ doLog(LEVEL_WARN,message); } error(message){ doLog(LEVEL_ERROR,message); } } function doLog(level,message){ switch (level){ case 'trace': console.trace(message); break; case 'debug': console.debug(message); break; case 'info': console.info(message); break; case 'warn': console.warn(message); break; case 'error': console.error(message); break; } }
34,729
https://github.com/ButteryCrumpet/reiterator/blob/master/tests/Iterators/MapTest.php
Github Open Source
Open Source
MIT
null
reiterator
ButteryCrumpet
PHP
Code
67
203
<?php /** * Created by PhpStorm. * User: apple * Date: 2019-02-08 * Time: 13:53 */ use ReIterator\Iterators\Map; use PHPUnit\Framework\TestCase; class MapTest extends TestCase { public function test__construct() { $this->assertInstanceOf( Map::class, new Map(new ArrayIterator(["hi"]), function($val){ return $val; }) ); } public function testCurrent() { $instance = new Map( new ArrayIterator([1, 2, 3]), function($val){ return $val * $val; } ); $this->assertEquals( [1, 4, 9], $instance->collect() ); } }
6,497
https://github.com/lixcoder/ExposeInventory/blob/master/app/models/Category.php
Github Open Source
Open Source
MIT
null
ExposeInventory
lixcoder
PHP
Code
25
72
<?php class Category extends Eloquent{ //Define database table to associate with model protected $table='categories'; /** *DEFINE RELATIONSHIPS * */ public function assets(){ $this->hasMany('asset'); } }
36,894
https://github.com/andreypopp/markstruct/blob/master/example/Makefile
Github Open Source
Open Source
MIT
2,013
markstruct
andreypopp
Makefile
Code
129
451
all: ./build ./build/index.html ./build/assets ./build/assets/bundle.compressed.js publish: clean all (cd ./build; git init; \ git add .; \ git commit -m 'init'; \ git push -f git@github.com:andreypopp/markstruct.git master:gh-pages) clean: rm -rf ./build ./build: mkdir -p build ./build/assets: mkdir -p build/assets ../node_modules/.bin/react-app \ --transform dgraph-stylus \ -o ./build/assets \ bundle ./index.jsx ./build/assets/bundle.compressed.js: ./build/assets/bundle.js uglifyjs $< > $@ ./build/index.html: echo '' > $@ echo '<html>' >> $@ echo ' <head>' >> $@ echo ' <link rel="stylesheet" href="assets/bundle.css" />' >> $@ echo ' <script src="assets/bundle.compressed.js"></script>' >> $@ echo ' <script>' >> $@ echo ' global = self;' >> $@ echo ' require("react-app/runtime/browser").injectAssets({"stylesheets":["assets/bundle.css"],"scripts":["assets/bundle.compressed.js"]});' >> $@ echo ' require("./index.jsx").start();' >> $@ echo ' </script>' >> $@ echo ' </head>' >> $@ echo ' <body>' >> $@ echo ' </body>' >> $@ echo '</html>' >> $@
26,530
https://github.com/korzhevdp/imp/blob/master/application/views/shared/shared_js_css.php
Github Open Source
Open Source
MIT
null
imp
korzhevdp
PHP
Code
48
370
<meta name='yandex-verification' content='74872298f6a53977'> <meta name="keywords" content="<?=$keywords;?>"> <!-- API 2.0 --> <script type="text/javascript" src="<?=$this->config->item('api');?>/jscript/jquery.js"></script> <script src="http://api-maps.yandex.ru/2.0/?coordorder=longlat&amp;load=package.full&amp;lang=<?=(($this->session->userdata("lang") === "ru") ? "ru-RU" :"en-US");?>" type="text/javascript"></script> <!-- <script type="text/javascript" src="<?=$this->config->item('api');?>/jscript/map_styles2.js"></script> --> <script type="text/javascript" src="<?=$this->config->item('api');?>/jscript/styles2.js"></script> <script type="text/javascript" src="<?=$this->config->item('api');?>/jqueryui/js/jqueryui.js"></script> <script type="text/javascript" src="<?=$this->config->item('api');?>/bootstrap/js/bootstrap.js"></script> <!-- EOT API 2.0 --> <link href="<?=$this->config->item('api');?>/bootstrap/css/bootstrap.css" rel="stylesheet"> <link href="<?=$this->config->item('api');?>/css/frontend.css" rel="stylesheet" media="screen" type="text/css">
5,640
https://github.com/facebook/hhvm/blob/master/hphp/hack/src/utils/signed_source.mli
Github Open Source
Open Source
MIT, PHP-3.01, Zend-2.0
2,023
hhvm
facebook
OCaml
Code
159
260
(* * Copyright (c) 2018-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) (** The signing token, which you must embed in the file you wish to sign. Generally, you should put this in a header comment. *) val signing_token : string exception Token_not_found (** Sign a source file into which you have previously embedded a signing token. Signing modifies only the signing token, so the semantics of the file will not change if the token is put in a comment. @raise {!Token_not_found} if no signing token is present. *) val sign_file : string -> string (** Determine if a file is signed or not. This does NOT verify the signature. *) val is_signed : string -> bool type sign_check_response = | Sign_ok | Sign_unsigned | Sign_invalid (** Verify a file's signature. *) val verify_signature : string -> sign_check_response
44,099
https://github.com/zhangylz/BugFree/blob/master/protected/service/TestOptionService.php
Github Open Source
Open Source
BSD-2-Clause
2,022
BugFree
zhangylz
PHP
Code
179
672
<?php /* * BugFree is free software under the terms of the FreeBSD License. * @link http://www.bugfree.org.cn * @package BugFree */ /** * Description of TestOptionService * * @author youzhao.zxw<swustnjtu@gmail.com> * @version 3.0 */ class TestOptionService { public static function editOption($params) { $resultInfo = array(); $actionType = BugfreeModel::ACTION_OPEN; $oldRecordAttributs = array(); if(empty($params['id'])) { $option = new TestOption(); } else { $option = TestOption::model()->findByPk((int) $params['id']); $oldRecordAttributs = $option->attributes; $actionType = BugfreeModel::ACTION_EDIT; if($option === null) { throw new CHttpException(404, 'The requested page does not exist.'); } } $option->attributes = $params; if(!$option->save()) { $resultInfo['status'] = CommonService::$ApiResult['FAIL']; $resultInfo['detail'] = $option->getErrors(); } else { $newRecord = TestOption::model()->findByPk((int) $params['id']); $addActionResult = AdminActionService::addActionNotes('test_option', $actionType, $newRecord, $oldRecordAttributs); $resultInfo['status'] = CommonService::$ApiResult['SUCCESS']; $resultInfo['detail'] = array('id' => $option->id); } return $resultInfo; } public static function getOptionOperation($optionId) { $optionModel = TestOption::model()->findByPk($optionId); if($optionModel != null && (TestOption::DB_VERSION != $optionModel['option_name'])) { return '<a class="with_underline" href="'.Yii::app()->createUrl('testOption/edit', array('id'=>$optionId)).'">' . Yii::t('Common', 'Edit') . '</a>'; } else { return ''; } } public static function getOptionValueByName($optionName) { $optionInfo = TestOption::model()->findByAttributes(array('option_name' => $optionName)); if($optionInfo !== null) { return $optionInfo['option_value']; } else { return ''; } } } ?>
21,646
https://github.com/yanghongkjxy/hazelcast/blob/master/hazelcast/src/main/java/com/hazelcast/map/QueryCache.java
Github Open Source
Open Source
Apache-2.0
2,019
hazelcast
yanghongkjxy
Java
Code
860
1,926
/* * Copyright (c) 2008-2019, Hazelcast, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.hazelcast.map; import com.hazelcast.core.IMap; import com.hazelcast.map.listener.MapListener; import com.hazelcast.query.Predicate; import java.util.Collection; import java.util.Map; import java.util.Set; /** * A concurrent, queryable data structure which is used to cache results of * a continuous query executed on an {@code IMap}. It can be also thought * of as an always up to date view or snapshot of the {@code IMap}. * * Typically, {@code QueryCache} is used for performance reasons. * * This {@code QueryCache} can be configured via {@link * com.hazelcast.config.QueryCacheConfig QueryCacheConfig}. * * It can be reached like this: * <pre> * <code> * * IMap map = hzInstance.getMap("mapName"); * Predicate predicate = TruePredicate.INSTANCE; * QueryCache cache = map.getQueryCache(cacheId, predicate, includeValue); * * </code> * </pre> * <p/> * This cache is evictable. The eviction can be configured with {@link * com.hazelcast.config.QueryCacheConfig#setEvictionConfig}. * Events caused by {@code IMap} eviction are not reflected to this cache. * But the events published after an explicit call to {@link * com.hazelcast.core.IMap#evict} are reflected to this cache. * <p/> * <b>GOTCHAS</b> * <ul> * <li> * This {@code QueryCache} implementation relies on the eventing system, if * a listener is attached to this {@code QueryCache} it may receive same * event more than once in case of a system failure. Check out {@link * QueryCache#tryRecover()} * </li> * <li> * All writes to this {@link QueryCache} is reflected to underlying {@code * IMap} and that write operation will eventually be reflected to this * {@code QueryCache} after receiving the event of that operation. * </li> * <li> * Currently, updates performed on the entries are reflected in the indexes * in a non-atomic way. Therefore, if there are indexes configured for the * query cache, their state may slightly lag behind the state of the * entries. Use map listeners if you need to observe the state when the * entry store and its indexes are consistent about the state of a * particular entry, see {@link IMap#addEntryListener(MapListener, boolean) * addEntryListener} for more details. * </li> * <li> * There are some gotchas same with underlying {@link * com.hazelcast.core.IMap IMap} implementation, one should take care of * them before using this {@code QueryCache}. Please check gotchas section * in {@link com.hazelcast.core.IMap IMap} class for them. * </li> * </ul> * <p/> * * @param <K> the type of key for this {@code QueryCache} * @param <V> the type of value for this {@code QueryCache} * @see com.hazelcast.config.QueryCacheConfig * @since 3.5 */ public interface QueryCache<K, V> { /** * @see com.hazelcast.core.IMap#get(Object) */ V get(Object key); /** * @see com.hazelcast.core.IMap#containsKey(Object) */ boolean containsKey(Object key); /** * @see com.hazelcast.core.IMap#containsValue(Object) */ boolean containsValue(Object value); /** * @see IMap#isEmpty() */ boolean isEmpty(); /** * @see IMap#size() */ int size(); /** * @see IMap#addIndex(String, boolean) */ void addIndex(String attribute, boolean ordered); /** * @see IMap#getAll(Set) */ Map<K, V> getAll(Set<K> keys); /** * @see IMap#keySet() */ Set<K> keySet(); /** * @see IMap#keySet(Predicate) */ Set<K> keySet(Predicate predicate); /** * @see IMap#entrySet() */ Set<Map.Entry<K, V>> entrySet(); /** * @see IMap#entrySet(Predicate) */ Set<Map.Entry<K, V>> entrySet(Predicate predicate); /** * @see IMap#values() */ Collection<V> values(); /** * @see IMap#values(Predicate) */ Collection<V> values(Predicate predicate); /** * @see IMap#addEntryListener(MapListener, boolean) */ String addEntryListener(MapListener listener, boolean includeValue); /** * @see IMap#addEntryListener(MapListener, Object, boolean) */ String addEntryListener(MapListener listener, K key, boolean includeValue); /** * @see IMap#addEntryListener(MapListener, Predicate, boolean) */ String addEntryListener(MapListener listener, Predicate<K, V> predicate, boolean includeValue); /** * @see IMap#addEntryListener(MapListener, Predicate, Object, boolean) */ String addEntryListener(MapListener listener, Predicate<K, V> predicate, K key, boolean includeValue); /** * @see IMap#removeEntryListener(String) */ boolean removeEntryListener(String id); /** * Returns the name of this {@code QueryCache}. The returned value will never be null. * * @return the name of this {@code QueryCache}. */ String getName(); /** * This method can be used to recover from a possible event loss situation. You can detect event loss * via {@link com.hazelcast.map.listener.EventLostListener} * <p/> * This method tries to make consistent the data in this {@code QueryCache} with the data in the underlying {@code IMap} * by replaying the events after last consistently received ones. As a result of this replaying logic, same event may * appear more than once to the {@code QueryCache} listeners. * <p/> * This method returns {@code false} if the event is not in the buffer of event publisher side. That means recovery is not * possible. * * @return {@code true} if the {@code QueryCache} content will be eventually consistent, otherwise {@code false}. * @see com.hazelcast.config.QueryCacheConfig#bufferSize */ boolean tryRecover(); /** * Destroys this cache. * Clears and releases all local and remote resources created for this cache. */ void destroy(); }
21,174
https://github.com/dave-read/vdc/blob/master/docs/extend/integration-testing.adoc
Github Open Source
Open Source
MIT
2,019
vdc
dave-read
AsciiDoc
Code
1,279
2,896
= Integration testing The toolkit includes an integration testing feature that allows you to test your deployments against simulated HTTP responses from the Azure platform. This enables you to quickly verify that your deployment templates and parameter files work as expected. This integration testing feature is built using the https://github.com/Azure/azure-sdk-for-python/wiki/Contributing-to-the-tests[Azure SDK for Python’s test functionality]. This functionality allows you to make a baseline recording of responses from the Azure platform using a known good version of your deployment. These recordings can then be played back during simulated deployments to quickly test your latest code. == Prerequisites Before using the toolkit’s integration testing functionality, you will need to make sure several types of files are in place and properly configured. === Toolkit setup Be sure that you have followed the link:../setup/readme.md[setup instructions] appropriate to your environment. === Test deployment parameters files Each of the sample deployments contains a top level `archetype.test.json` test file that is used during integration testing. This file contains placeholders for a number of important fields used during deployments such subscription IDs and user names. It is used as the basis for the actual `archetype.json` you will have created to use in your deployments. For integration testing to work, the existing test files should only be modified to include new parameter fields you may have added to the toolkit’s default archetype configuration that you may have modified. Test archetype configuration files are expected to be checked into your source control. They should _never contain sensitive information_ such as real subscriptions, tenant, or user accounts. Instead, they should continue to use placeholder values consistent with existing values. === Integration testing configuration files The integration testing functionality also depends on two files that are not included in the toolkit code repository: * `tools/devtools_testutils/testsettings_local.cfg` * `tools/devtools_testutils/vdc_settings_real.py` Both need to exist in the toolkit’s `tools/devtools_testutils` folder. These files are listed in the toolkit’s `.gitignore` file to prevent their inclusion in your repository by default, so you will need to create and configure these files before running any tests. ==== `testsettings_local.cfg` The `testsettings_local.cfg` file consists of a single `live-mode` parameter which tells the testing functionality if it should be running in playback mode (offline testing mode) or recording mode (where an actual deployment is used to record data for offline testing). If this file is absent this `live-mode` value will default to false. The content of this file should be a single line: [source,yaml] ---- live-mode: false ---- ==== `vdc_settings_real.py` The file `tools/devtools_testutils/fake_settings.py`, which is included in the toolkit, contains the placeholder values used by for tests running in playback mode. The `vdc_settings_real.py` file contains the actual subscription, AAD tenant, and credentials you will use when in recording mode. If you do not create this real file, you will only be able to run offline tests using pre-recorded data. To set up this file create a blank `vdc_settings_real.py` in the `devtools_testutils` folder, then copy the contents of `fake_settings.py` into it. Next you will need to update the real file by modifying the following variables: [cols=",,",options="header"] |=== | Variable name | Description | Placeholder value | `ONPREM_SUBSCRIPTION_ID` | Subscription ID of your simulated on-premises environment. | 00000000-0000-0000-0000-000000000000 | `SHARED_SERVICES_SUBSCRIPTION_ID` | Subscription ID of your shared services deployment. | 00000000-0000-0000-0000-000000000000 | `WORKLOAD_SUBSCRIPTION_ID` | Subscription ID of your workload deployment. | 00000000-0000-0000-0000-000000000000 | `AD_DOMAIN` | Domain used by for your AD tenant. | myaddomain.onmicrosoft.com | `TENANT_ID` | ID of your Azure AD Tenant. | 00000000-0000-0000-0000-000000000000 | `CLIENT_OID` | Object ID of the Azure AD user that will be assigned as the key vault service principle during your deployments. | 00000000-0000-0000-0000-000000000000 |=== In addition to these values you will need to update the real file’s `get_credentials` function to replace the fake basic authentication token using either the `ServicePrincipalCredentials` or `UserPassCredentials`. Both methods are included but commented out in the fake version of the file. For more information on how to set up these credentials see the https://github.com/Azure/azure-sdk-for-python/wiki/Contributing-to-the-tests#getting-azure-credentials[Getting Azure Credentials] section of the Azure SDK for Python documentation. == Sample tests Each test should have a sub-folder in the link:../../tests/integration_tests[`tests/integration_tests`] folder. Each of these test sub-folders contains a `test_all_resources.py` file which specifies what resources should be included as part of the test. Each test sub-folder also contain a `recordings` folder that contains the pre-recorded HTTP response data used for offline testing. The toolkit includes pre-configured tests and recorded data for each of the sample deployments: [cols="a,a",options="header"] |=== | Test folder | Sample deployment | link:../../tests/integration_tests/simulated_onprem[`tests/integration_tests/simulated_onprem`] | link:../archetypes/on-premises/overview.adoc[Simulated on-premises environment] | link:../../tests/integration_tests/shared_services[`tests/integration_tests/shared_services`] | link:../archetypes/shared-services/overview.adoc[Sample shared services and central IT infrastructure] | link:../../tests/integration_tests/paas_workload[`tests/integration_tests/paas_workload`] | link:../archetypes/paas/overview.adoc[ASE+SQL Database (PaaS) architecture] | link:../../tests/integration_tests/ntier_iaas_workload[`tests/integration_tests/ntier_iaas_workload`] | link:../archetypes/ntier-iaas/overview.adoc[IaaS N-tier architecture] | link:../../tests/integration_tests/cloudbreak-workload[`tests/integration_tests/cloudbreak-workload`] | link:../archetypes/cloudbreak/overview.adoc[Hadoop deployment] | link:../../tests/integration_tests/sap_workload[`tests/integration_tests/sap_workload`] | link:../archetypes/sap-hana/overview.adoc[SAP HANA deployment] |=== == Running tests in offline mode Before running offline (playback mode) tests, make sure your `testsettings_local.cfg` file has the `live-mode` parameter set to `false`. Integration tests use the https://docs.pytest.org/en/latest/[pytest] test runner Python module. Start a test by navigating to the toolkit root folder in a terminal or command-line interface and running the following command: .Docker [source,bash] python -m pytest tests/integration_tests/{deployment-test-folder}/{test-file-name}.py .Linux/OSX [source,bash] python3 -m pytest tests/integration_tests/{deployment-test-folder}/{test-file-name}.py .Windows [source,cmd] py -m pytest tests/integration_tests/{deployment-test-folder}/{test-file-name}.py An offline test should take less than 30 seconds to complete. == Recording test output Running a test in online (recording mode) will deploy all resources defined in the relevant `test_all_resources.py` file. This deployment process will use the subscription, tenant, and user information stored in your `vdc_settings_real.py`. Other settings will be pulled from the `archetype.test.json` file. The test will record all HTTP traffic to and from the Azure Resource Manager APIs during this deployment and update the data in `recordings` folder for later use in offline testing. Make sure your online deployment completely succeeds before checking in recording files to your code repository. To set the integration testing to online mode, update your `testsettings_local.cfg` file’s `live-mode` parameter to `false`. Then start the deployment by navigating to the toolkit root folder in a terminal or command-line interface and running the following command (same command used for offline mode): Docker [source,bash] python -m pytest tests/integration_tests/{deployment-test-folder}/{test-file-name}.py .Linux/OSX [source,bash] python3 -m pytest tests/integration_tests/{deployment-test-folder}/{test-file-name}.py .Windows [source,cmd] py -m pytest tests/integration_tests/{deployment-test-folder}/{test-file-name}.py Online mode will take a long time as it will provision all of the resources for a deployment. == Customizing integration tests Using the existing sample tests as a base you should be able to easily create your own custom tests for new archetypes. === Create a new test To create a test for a new deployment, create a new folder in `tests/integration_tests/`. Copy one of the existing `test_all_resources.py` files into this new folder. This file’s `setUp` function has a `_workload_configuration_path` variable (alternatively `_shared_services_configuration_path` or `_on_premises_configuration_path` depending on the link:../understand/environment-types.adoc[environment type]) that will need to point to the root folder of your archetype. This is the same path used when running the `vdc.py` script). You will also need to configure the `_environment_type` variables. [source,python] ---- def setUp(self): super(AllResourcesUsing, self).setUp() parameters_file = '' if self.is_live: parameters_file = 'archetype.json' else: parameters_file = 'archetype.test.json' self._workload_path = join( Path(__file__).parents[3], 'archetypes', '{new deployment folder name}', parameters_file) self._environment_type = 'workload' ---- === Adding a module to a test Inside the `test_all_resources.py` file, including a module in a test is done by adding a function that will in turn call the `_execute_deployment_test` function of the `VDCBaseTestCase` for the module when the test is executed. Each deployment test should always include these functions for the `ops`, `kv`, `nsg`, and `net` modules. Additional modules should be added using this standardized format: [source,python] ---- def test_x_workload_{module name}_creation(self): self.set_resource_to_deploy('{module name}', args) self.upload_scripts(args, False) self.create_vdc_storage(args, False) successful: bool = self.execute_deployment_test( args, self._workload_path, self._environment_type) self.assertEqual(successful, True) ---- == Next steps Be sure to reach out to us with feedback. Open an https://github.com/Azure/vdc/issues[issue on the GitHub] repository with any questions.
34,239
https://github.com/tomMoral/braindecode/blob/master/braindecode/training/__init__.py
Github Open Source
Open Source
BSD-3-Clause, BSD-2-Clause
2,021
braindecode
tomMoral
Python
Code
16
65
""" Functionality for skorch-based training. """ from .losses import CroppedLoss from .scoring import (CroppedTrialEpochScoring, PostEpochTrainScoring, trial_preds_from_window_preds,)
45,378
https://github.com/daniloaspk/biocharScience/blob/master/pages/projetos/home.py
Github Open Source
Open Source
MIT
null
biocharScience
daniloaspk
Python
Code
218
512
import streamlit as st import pages.projetos.projeto01 as PageProjetos01 import pages.projetos.projeto02 as PageProjetos02 import pages.projetos.papers as papers import pages.projetos.sprints as sprints def home(): text01 = "<h1 style='text-align: center; line-height: 1.15'> Potencial de uso de biocarvões como condicionadores " \ "de solo e produção de eucalipto</h1> " st.markdown(text01, unsafe_allow_html=True) text02 = "<h5 style='text-align: center; line-height: 1.15'>Edital Fapes/Cnpq Nº 11/2019 - Programa de " \ "desenvolvimento Científico e Tecnológico Regional – PDCTR 2019</h5> " st.markdown(text02, unsafe_allow_html=True) text03 = "<p style='text-align: justify; line-height: 1.15'>Os biocarvões têm chamado a atenção da Ciência do " \ "Solo para a compreensão dos seus efeitos sobre os atributos químicos, físicos e biologicos dos solos. O " \ "Estado do Espírito Santo " \ "possui, dentro das áreas de produção agricola, materiais que são gerados em grande volume e com " \ "potencial para serem " \ "utilizados para conversão energética e consequente produção de biocarvões para retornarem ao campo como " \ "condicionadores de solo. O presente estudo é uma continuação das pesquisas desenvolvidas dentro do " \ "laboratório de solos do Centro de Ciências Agrarias e Engenharias da Universidade Federal do Espírito " \ "Santo a fim de alcançar insights para eficácia de uso de resíduos orgânicos e apresentar soluções para o " \ "uso eficiente de fertilizantes em solos altamente intemperizados.</p> " st.markdown(text03, unsafe_allow_html=True)
3,651
https://github.com/chimerast/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/request/resource/AbstractResource.java
Github Open Source
Open Source
Apache-2.0
null
wicket
chimerast
Java
Code
2,104
5,747
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.wicket.request.resource; import java.io.IOException; import java.io.InputStream; import java.util.HashSet; import java.util.Set; import javax.servlet.http.HttpServletResponse; import org.apache.wicket.Application; import org.apache.wicket.WicketRuntimeException; import org.apache.wicket.request.HttpHeaderCollection; import org.apache.wicket.request.Response; import org.apache.wicket.request.http.WebRequest; import org.apache.wicket.request.http.WebResponse; import org.apache.wicket.request.resource.caching.IResourceCachingStrategy; import org.apache.wicket.request.resource.caching.IStaticCacheableResource; import org.apache.wicket.settings.IResourceSettings; import org.apache.wicket.util.io.Streams; import org.apache.wicket.util.lang.Args; import org.apache.wicket.util.lang.Classes; import org.apache.wicket.util.time.Duration; import org.apache.wicket.util.time.Time; /** * Convenience resource implementation. The subclass must implement * {@link #newResourceResponse(org.apache.wicket.request.resource.IResource.Attributes)} method. * * @author Matej Knopp */ public abstract class AbstractResource implements IResource { private static final long serialVersionUID = 1L; /** header values that are managed internally and must not be set directly */ public static final Set<String> INTERNAL_HEADERS; static { INTERNAL_HEADERS = new HashSet<String>(); INTERNAL_HEADERS.add("server"); INTERNAL_HEADERS.add("date"); INTERNAL_HEADERS.add("expires"); INTERNAL_HEADERS.add("last-modified"); INTERNAL_HEADERS.add("content-type"); INTERNAL_HEADERS.add("content-length"); INTERNAL_HEADERS.add("content-disposition"); INTERNAL_HEADERS.add("transfer-encoding"); INTERNAL_HEADERS.add("connection"); INTERNAL_HEADERS.add("content-disposition"); } /** * Construct. */ public AbstractResource() { } /** * Override this method to return a {@link ResourceResponse} for the request. * * @param attributes * request attributes * @return resource data instance */ protected abstract ResourceResponse newResourceResponse(Attributes attributes); /** * Represents data used to configure response and write resource data. * * @author Matej Knopp */ public static class ResourceResponse { private Integer errorCode; private Integer statusCode; private String errorMessage; private String fileName = null; private ContentDisposition contentDisposition = ContentDisposition.INLINE; private String contentType = null; private String textEncoding; private long contentLength = -1; private Time lastModified = null; private WriteCallback writeCallback; private Duration cacheDuration; private WebResponse.CacheScope cacheScope; private final HttpHeaderCollection headers; /** * Construct. */ public ResourceResponse() { // disallow caching for public caches. this behavior is similar to wicket 1.4: // setting it to [PUBLIC] seems to be sexy but could potentially cache confidential // data on public proxies for users migrating to 1.5 cacheScope = WebResponse.CacheScope.PRIVATE; // collection of directly set response headers headers = new HttpHeaderCollection(); } /** * Sets the error code for resource. If there is an error code set the data will not be * rendered and the code will be sent to client. * * @param errorCode * error code */ public void setError(Integer errorCode) { setError(errorCode, null); } /** * Sets the error code and message for resource. If there is an error code set the data will * not be rendered and the code and message will be sent to client. * * @param errorCode * error code * @param errorMessage * error message */ public void setError(Integer errorCode, String errorMessage) { this.errorCode = errorCode; this.errorMessage = errorMessage; } /** * @return error code or <code>null</code> */ public Integer getErrorCode() { return errorCode; } /** * Sets the status code for resource. * * @param statusCode * status code */ public void setStatusCode(Integer statusCode) { this.statusCode = statusCode; } /** * @return status code or <code>null</code> */ public Integer getStatusCode() { return statusCode; } /** * @return error message or <code>null</code> */ public String getErrorMessage() { return errorMessage; } /** * Sets the file name of the resource. * * @param fileName * file name */ public void setFileName(String fileName) { this.fileName = fileName; } /** * @return resource file name */ public String getFileName() { return fileName; } /** * Determines whether the resource will be inline or an attachment. * * @see ContentDisposition * * @param contentDisposition * content disposition (attachment or inline) */ public void setContentDisposition(ContentDisposition contentDisposition) { Args.notNull(contentDisposition, "contentDisposition"); this.contentDisposition = contentDisposition; } /** * @return whether the resource is inline or attachment */ public ContentDisposition getContentDisposition() { return contentDisposition; } /** * Sets the content type for the resource. If no content type is set it will be determined * by the extension. * * @param contentType * content type (also known as mime type) */ public void setContentType(String contentType) { this.contentType = contentType; } /** * @return resource content type */ public String getContentType() { if (contentType == null && fileName != null) { contentType = Application.get().getMimeType(fileName); } return contentType; } /** * Sets the text encoding for the resource. This setting must only used * if the resource response represents text. * * @param textEncoding * character encoding of text body */ public void setTextEncoding(String textEncoding) { this.textEncoding = textEncoding; } /** * @return text encoding for resource */ protected String getTextEncoding() { return textEncoding; } /** * Sets the content length (in bytes) of the data. Content length is optional but it's * recommended to set it so that the browser can show download progress. * * @param contentLength * length of response body */ public void setContentLength(long contentLength) { this.contentLength = contentLength; } /** * @return content length (in bytes) */ public long getContentLength() { return contentLength; } /** * Sets the last modified data of the resource. Even though this method is optional it is * recommended to set the date. If the date is set properly Wicket can check the * <code>If-Modified-Since</code> to determine if the actuall data really needs to be sent * to client. * * @param lastModified * last modification timestamp */ public void setLastModified(Time lastModified) { this.lastModified = lastModified; } /** * @return last modification timestamp */ public Time getLastModified() { return lastModified; } /** * Check to determine if the resource data needs to be written. This method checks the * <code>If-Modified-Since</code> request header and compares it to lastModified property. * In order for this method to work {@link #setLastModified(Time)} has to be called first. * * @param attributes * request attributes * @return <code>true</code> if the resource data does need to be written, * <code>false</code> otherwise. */ public boolean dataNeedsToBeWritten(Attributes attributes) { WebRequest request = (WebRequest)attributes.getRequest(); Time ifModifiedSince = request.getIfModifiedSinceHeader(); if (cacheDuration != Duration.NONE && ifModifiedSince != null && lastModified != null) { // [Last-Modified] headers have a maximum precision of one second // so we have to truncate the milliseconds part for a proper compare. // that's stupid, since changes within one second will not be reliably // detected by the client ... any hint or clarification to improve this // situation will be appreciated... Time roundedLastModified = Time.millis(lastModified.getMilliseconds() / 1000 * 1000); return ifModifiedSince.before(roundedLastModified); } else { return true; } } /** * disable caching */ public void disableCaching() { setCacheDuration(Duration.NONE); } /** * set caching to maximum available duration */ public void setCacheDurationToMaximum() { cacheDuration = WebResponse.MAX_CACHE_DURATION; } /** * Controls how long this response may be cached * * @param duration * caching duration in seconds */ public void setCacheDuration(Duration duration) { cacheDuration = Args.notNull(duration, "duration"); } /** * returns how long this resource may be cached * <p/> * The special value Duration.NONE means caching is disabled. * * @return duration for caching * * @see IResourceSettings#setDefaultCacheDuration(org.apache.wicket.util.time.Duration) * @see IResourceSettings#getDefaultCacheDuration() */ public Duration getCacheDuration() { Duration duration = cacheDuration; if (duration == null && Application.exists()) { duration = Application.get().getResourceSettings().getDefaultCacheDuration(); } return duration; } /** * returns what kind of caches are allowed to cache the resource response * <p/> * resources are only cached at all if caching is enabled by setting a cache duration. * * @return cache scope * * @see org.apache.wicket.request.resource.AbstractResource.ResourceResponse#getCacheDuration() * @see org.apache.wicket.request.resource.AbstractResource.ResourceResponse#setCacheDuration(org.apache.wicket.util.time.Duration) * @see org.apache.wicket.request.http.WebResponse.CacheScope */ public WebResponse.CacheScope getCacheScope() { return cacheScope; } /** * controls what kind of caches are allowed to cache the response * <p/> * resources are only cached at all if caching is enabled by setting a cache duration. * * @param scope * scope for caching * * @see org.apache.wicket.request.resource.AbstractResource.ResourceResponse#getCacheDuration() * @see org.apache.wicket.request.resource.AbstractResource.ResourceResponse#setCacheDuration(org.apache.wicket.util.time.Duration) * @see org.apache.wicket.request.http.WebResponse.CacheScope */ public void setCacheScope(WebResponse.CacheScope scope) { cacheScope = Args.notNull(scope, "scope"); } /** * Sets the {@link WriteCallback}. The callback is responsible for generating the response * data. * <p> * It is necessary to set the {@link WriteCallback} if * {@link #dataNeedsToBeWritten(org.apache.wicket.request.resource.IResource.Attributes)} * returns <code>true</code> and {@link #setError(Integer)} has not been called. * * @param writeCallback * write callback */ public void setWriteCallback(final WriteCallback writeCallback) { Args.notNull(writeCallback, "writeCallback"); this.writeCallback = writeCallback; } /** * @return write callback. */ public WriteCallback getWriteCallback() { return writeCallback; } /** * get custom headers * * @return collection of the response headers */ public HttpHeaderCollection getHeaders() { return headers; } } /** * Configure the web response header for client cache control. * * @param data * resource data * @param attributes * request attributes */ protected void configureCache(final ResourceResponse data, final Attributes attributes) { Response response = attributes.getResponse(); if (response instanceof WebResponse) { Duration duration = data.getCacheDuration(); WebResponse webResponse = (WebResponse)response; if (duration.compareTo(Duration.NONE) > 0) { webResponse.enableCaching(duration, data.getCacheScope()); } else { webResponse.disableCaching(); } } } protected IResourceCachingStrategy getCachingStrategy() { return Application.get().getResourceSettings().getCachingStrategy(); } /** * * @see org.apache.wicket.request.resource.IResource#respond(org.apache.wicket.request.resource.IResource.Attributes) */ @Override public void respond(final Attributes attributes) { // Get a "new" ResourceResponse to write a response ResourceResponse data = newResourceResponse(attributes); // is resource supposed to be cached? if (this instanceof IStaticCacheableResource) { final IStaticCacheableResource cacheable = (IStaticCacheableResource)this; // is caching enabled? if (cacheable.isCachingEnabled()) { // apply caching strategy to response getCachingStrategy().decorateResponse(data, cacheable); } } // set response header setResponseHeaders(data, attributes); if (!data.dataNeedsToBeWritten(attributes) || data.getErrorCode() != null || needsBody(data.getStatusCode()) == false) { return; } if (data.getWriteCallback() == null) { throw new IllegalStateException("ResourceResponse#setWriteCallback() must be set."); } try { data.getWriteCallback().writeData(attributes); } catch (IOException iox) { throw new WicketRuntimeException(iox); } } /** * Decides whether a response body should be written back to the client depending * on the set status code * * @param statusCode * the status code set by the application * @return {@code true} if the status code allows response body, {@code false} - otherwise */ private boolean needsBody(Integer statusCode) { return statusCode == null || (statusCode < 300 && statusCode != HttpServletResponse.SC_NO_CONTENT && statusCode != HttpServletResponse.SC_RESET_CONTENT); } /** * check if header is directly modifyable * * @param name * header name * * @throws IllegalArgumentException * if access is forbidden */ private void checkHeaderAccess(String name) { name = Args.notEmpty(name.trim().toLowerCase(), "name"); if (INTERNAL_HEADERS.contains(name)) { throw new IllegalArgumentException("you are not allowed to directly access header [" + name + "], " + "use one of the other specialized methods of " + Classes.simpleName(getClass()) + " to get or modify its value"); } } /** * @param data * @param attributes */ protected void setResponseHeaders(final ResourceResponse data, final Attributes attributes) { Response response = attributes.getResponse(); if (response instanceof WebResponse) { WebResponse webResponse = (WebResponse)response; // 1. Last Modified Time lastModified = data.getLastModified(); if (lastModified != null) { webResponse.setLastModifiedTime(lastModified); } // 2. Caching configureCache(data, attributes); if (!data.dataNeedsToBeWritten(attributes)) { webResponse.setStatus(HttpServletResponse.SC_NOT_MODIFIED); return; } if (data.getErrorCode() != null) { webResponse.sendError(data.getErrorCode(), data.getErrorMessage()); return; } if (data.getStatusCode() != null) { webResponse.setStatus(data.getStatusCode()); return; } String fileName = data.getFileName(); ContentDisposition disposition = data.getContentDisposition(); String mimeType = data.getContentType(); long contentLength = data.getContentLength(); // 3. Content Disposition if (ContentDisposition.ATTACHMENT == disposition) { webResponse.setAttachmentHeader(fileName); } else if (ContentDisposition.INLINE == disposition) { webResponse.setInlineHeader(fileName); } // 4. Mime Type (+ encoding) if (mimeType != null) { final String encoding = data.getTextEncoding(); if (encoding == null) { webResponse.setContentType(mimeType); } else { webResponse.setContentType(mimeType + "; charset=" + encoding); } } // 5. Content Length if (contentLength != -1) { webResponse.setContentLength(contentLength); } // add custom headers and values final HttpHeaderCollection headers = data.getHeaders(); for (String name : headers.getHeaderNames()) { checkHeaderAccess(name); for (String value : headers.getHeaderValues(name)) { webResponse.addHeader(name, value); } } // 6. Flush the response flushResponseAfterHeaders(webResponse); } } /** * Flushes the response after setting the headers. * This is necessary for Firefox if this resource is an image, * otherwise it messes up other images on page. * * @param response * the current web response */ protected void flushResponseAfterHeaders(final WebResponse response) { response.flush(); } /** * Callback invoked when resource data needs to be written to response. Subclass needs to * implement the {@link #writeData(org.apache.wicket.request.resource.IResource.Attributes)} * method. * * @author Matej Knopp */ public abstract static class WriteCallback { /** * Write the resource data to response. * * @param attributes * request attributes */ public abstract void writeData(Attributes attributes) throws IOException; /** * Convenience method to write an {@link InputStream} to response. * * @param attributes * request attributes * @param stream * input stream */ protected final void writeStream(Attributes attributes, InputStream stream) throws IOException { final Response response = attributes.getResponse(); Streams.copy(stream, response.getOutputStream()); } } }
17,444
https://github.com/ChilliCream/hotchocolate-examples/blob/master/workshop/src/Client/Blazor/Components/Auth/SignUpForm.razor
Github Open Source
Open Source
MIT
2,023
hotchocolate-examples
ChilliCream
HTML+Razor
Code
113
450
<div class="dialog"> <header> <h1>Sign Up</h1> <p>Please fill in this form to create an account!</p> </header> <EditForm Model="@_model" OnValidSubmit="OnValidSubmit"> <DataAnnotationsValidator /> <ValidationSummary /> <label> <InputText type="text" placeholder="Name" @bind-Value="@_model.Name" /> </label> <label> <InputText type="email" placeholder="Email" @bind-Value="@_model.Email" /> </label> <label> <InputText type="password" placeholder="Password" @bind-Value="@_model.Password" /> </label> <label> <InputCheckbox @bind-Value="@_model.Accept" /> I accept the Terms of Use and Privacy Policy. </label> <button type="submit">Sign Up</button> </EditForm> <footer> <p> Already have an account? Sign in <a href="javascript:void(0);" @onclick="ClickSignIn">here.</a> </p> </footer> </div> @code { private readonly SignUpModel _model = new SignUpModel(); [Parameter] public EventCallback ClickSignIn { get; set; } [Parameter] public EventCallback<SignUpModel> HandleSignUp { get; set; } private async Task OnValidSubmit() { if (HandleSignUp.HasDelegate) { await HandleSignUp.InvokeAsync(_model); } } }
3,600
https://github.com/luoyefeiwu/learn_springcloudalibab/blob/master/jerry-spring-cloud-alibaba-nacos-consumer-feign/src/main/java/com/jerry/service/EchoServiceFallback.java
Github Open Source
Open Source
Apache-2.0
null
learn_springcloudalibab
luoyefeiwu
Java
Code
22
67
package com.jerry.service; import org.springframework.stereotype.Component; @Component public class EchoServiceFallback implements EchoService { @Override public String echo(String message) { return "echo fallback"; } }
49,201
https://github.com/tetched/tetalert/blob/master/packages/client/src/pages/Settings/components/NotificationsSettings/components/Webhooks/Webhooks.tsx
Github Open Source
Open Source
Apache-2.0
2,022
tetalert
tetched
TypeScript
Code
153
490
import React from 'react' import SVG from 'react-inlinesvg' import _clone from 'lodash/clone' import { Divider, Input, Button } from 'ui' import * as S from './styled' type Props = { data: string[] onChange: (data: string[]) => void } const Webhooks = ({ data, onChange }: Props) => { const handleInputChange = (e, idx) => { const dataCopy = _clone(data) dataCopy[idx] = e.target.value onChange(dataCopy) } const handleRemoveInput = idx => { const dataCopy = _clone(data) dataCopy.splice(idx, 1) onChange(dataCopy) } return ( <S.Wrapper> <Divider padding="0 0 40px">Webhook notifications</Divider> {data.length ? ( data.map((item, idx) => ( <S.InputWrapper key={`webhooks-settings-input-${idx}`}> <Input fluid label="Webhook URL" value={item} onChange={e => handleInputChange(e, idx)} /> <SVG src="/icons/close.svg" onClick={() => handleRemoveInput(idx)}> <img src="/icons/close.svg" alt="Remove" /> </SVG> </S.InputWrapper> )) ) : ( <S.NoWebHooks> Add your first webhook by clicking the &quot;+ Add&quot; button below. </S.NoWebHooks> )} <Button text="+ Add" theme="outlineMini" onClick={() => onChange([...data, ''])} style={{ marginBottom: '24px' }} /> </S.Wrapper> ) } export default Webhooks
42,221
https://github.com/doldecomp/pikmin/blob/master/asm/plugPikiYamashita/TAImar.s
Github Open Source
Open Source
Unlicense
2,021
pikmin
doldecomp
GAS
Code
20,000
49,381
.include "macros.inc" .section .text, "ax" # 0x80005560 - 0x80221F60 .global __ct__16TAImarSoundTableFv __ct__16TAImarSoundTableFv: /* 801A5774 001A26D4 7C 08 02 A6 */ mflr r0 /* 801A5778 001A26D8 38 80 00 06 */ li r4, 6 /* 801A577C 001A26DC 90 01 00 04 */ stw r0, 4(r1) /* 801A5780 001A26E0 94 21 FF E0 */ stwu r1, -0x20(r1) /* 801A5784 001A26E4 93 E1 00 1C */ stw r31, 0x1c(r1) /* 801A5788 001A26E8 93 C1 00 18 */ stw r30, 0x18(r1) /* 801A578C 001A26EC 93 A1 00 14 */ stw r29, 0x14(r1) /* 801A5790 001A26F0 3B A3 00 00 */ addi r29, r3, 0 /* 801A5794 001A26F4 4B F7 98 E1 */ bl __ct__14PaniSoundTableFi /* 801A5798 001A26F8 3B C0 00 00 */ li r30, 0 /* 801A579C 001A26FC 3B E0 00 00 */ li r31, 0 /* 801A57A0 001A2700 48 00 00 2C */ b lbl_801A57CC lbl_801A57A4: /* 801A57A4 001A2704 38 60 00 04 */ li r3, 4 /* 801A57A8 001A2708 4B EA 18 5D */ bl alloc__6SystemFUl /* 801A57AC 001A270C 28 03 00 00 */ cmplwi r3, 0 /* 801A57B0 001A2710 41 82 00 0C */ beq lbl_801A57BC /* 801A57B4 001A2714 38 1E 00 80 */ addi r0, r30, 0x80 /* 801A57B8 001A2718 90 03 00 00 */ stw r0, 0(r3) lbl_801A57BC: /* 801A57BC 001A271C 80 9D 00 04 */ lwz r4, 4(r29) /* 801A57C0 001A2720 3B DE 00 01 */ addi r30, r30, 1 /* 801A57C4 001A2724 7C 64 F9 2E */ stwx r3, r4, r31 /* 801A57C8 001A2728 3B FF 00 04 */ addi r31, r31, 4 lbl_801A57CC: /* 801A57CC 001A272C 80 1D 00 00 */ lwz r0, 0(r29) /* 801A57D0 001A2730 7C 1E 00 00 */ cmpw r30, r0 /* 801A57D4 001A2734 41 80 FF D0 */ blt lbl_801A57A4 /* 801A57D8 001A2738 7F A3 EB 78 */ mr r3, r29 /* 801A57DC 001A273C 80 01 00 24 */ lwz r0, 0x24(r1) /* 801A57E0 001A2740 83 E1 00 1C */ lwz r31, 0x1c(r1) /* 801A57E4 001A2744 83 C1 00 18 */ lwz r30, 0x18(r1) /* 801A57E8 001A2748 83 A1 00 14 */ lwz r29, 0x14(r1) /* 801A57EC 001A274C 38 21 00 20 */ addi r1, r1, 0x20 /* 801A57F0 001A2750 7C 08 03 A6 */ mtlr r0 /* 801A57F4 001A2754 4E 80 00 20 */ blr .global __ct__16TAImarParametersFv __ct__16TAImarParametersFv: /* 801A57F8 001A2758 7C 08 02 A6 */ mflr r0 /* 801A57FC 001A275C 3C 80 80 2E */ lis r4, lbl_802DE4E0@ha /* 801A5800 001A2760 90 01 00 04 */ stw r0, 4(r1) /* 801A5804 001A2764 38 A0 00 39 */ li r5, 0x39 /* 801A5808 001A2768 94 21 FF 28 */ stwu r1, -0xd8(r1) /* 801A580C 001A276C 93 E1 00 D4 */ stw r31, 0xd4(r1) /* 801A5810 001A2770 3B E4 E4 E0 */ addi r31, r4, lbl_802DE4E0@l /* 801A5814 001A2774 38 80 00 17 */ li r4, 0x17 /* 801A5818 001A2778 93 C1 00 D0 */ stw r30, 0xd0(r1) /* 801A581C 001A277C 3B C3 00 00 */ addi r30, r3, 0 /* 801A5820 001A2780 4B FA 65 29 */ bl __ct__14TekiParametersFii /* 801A5824 001A2784 3C 60 80 2E */ lis r3, __vt__16TAImarParameters@ha /* 801A5828 001A2788 38 03 F0 68 */ addi r0, r3, __vt__16TAImarParameters@l /* 801A582C 001A278C 90 1E 00 00 */ stw r0, 0(r30) /* 801A5830 001A2790 38 00 00 14 */ li r0, 0x14 /* 801A5834 001A2794 39 00 00 15 */ li r8, 0x15 /* 801A5838 001A2798 80 BE 00 84 */ lwz r5, 0x84(r30) /* 801A583C 001A279C 38 E0 00 16 */ li r7, 0x16 /* 801A5840 001A27A0 38 C0 00 32 */ li r6, 0x32 /* 801A5844 001A27A4 81 45 00 00 */ lwz r10, 0(r5) /* 801A5848 001A27A8 38 60 00 33 */ li r3, 0x33 /* 801A584C 001A27AC 81 25 00 04 */ lwz r9, 4(r5) /* 801A5850 001A27B0 1C 80 00 0C */ mulli r4, r0, 0xc /* 801A5854 001A27B4 81 6A 00 08 */ lwz r11, 8(r10) /* 801A5858 001A27B8 80 09 00 08 */ lwz r0, 8(r9) /* 801A585C 001A27BC 7D 4B 22 14 */ add r10, r11, r4 /* 801A5860 001A27C0 38 9F 00 0C */ addi r4, r31, 0xc /* 801A5864 001A27C4 90 8A 00 00 */ stw r4, 0(r10) /* 801A5868 001A27C8 38 80 00 00 */ li r4, 0 /* 801A586C 001A27CC 1D 08 00 0C */ mulli r8, r8, 0xc /* 801A5870 001A27D0 90 8A 00 04 */ stw r4, 4(r10) /* 801A5874 001A27D4 39 20 00 64 */ li r9, 0x64 /* 801A5878 001A27D8 91 2A 00 08 */ stw r9, 8(r10) /* 801A587C 001A27DC 7D 4B 42 14 */ add r10, r11, r8 /* 801A5880 001A27E0 39 1F 00 28 */ addi r8, r31, 0x28 /* 801A5884 001A27E4 91 0A 00 00 */ stw r8, 0(r10) /* 801A5888 001A27E8 1C E7 00 0C */ mulli r7, r7, 0xc /* 801A588C 001A27EC 90 8A 00 04 */ stw r4, 4(r10) /* 801A5890 001A27F0 7D 6B 3A 14 */ add r11, r11, r7 /* 801A5894 001A27F4 91 2A 00 08 */ stw r9, 8(r10) /* 801A5898 001A27F8 39 1F 00 40 */ addi r8, r31, 0x40 /* 801A589C 001A27FC 1C E6 00 0C */ mulli r7, r6, 0xc /* 801A58A0 001A2800 91 0B 00 00 */ stw r8, 0(r11) /* 801A58A4 001A2804 90 8B 00 04 */ stw r4, 4(r11) /* 801A58A8 001A2808 1C C3 00 0C */ mulli r6, r3, 0xc /* 801A58AC 001A280C 91 2B 00 08 */ stw r9, 8(r11) /* 801A58B0 001A2810 7D 20 3A 14 */ add r9, r0, r7 /* 801A58B4 001A2814 38 7F 00 58 */ addi r3, r31, 0x58 /* 801A58B8 001A2818 90 69 00 00 */ stw r3, 0(r9) /* 801A58BC 001A281C 38 60 00 34 */ li r3, 0x34 /* 801A58C0 001A2820 1D 03 00 0C */ mulli r8, r3, 0xc /* 801A58C4 001A2824 C1 02 B4 E0 */ lfs f8, lbl_803EB6E0@sda21(r2) /* 801A58C8 001A2828 D1 09 00 04 */ stfs f8, 4(r9) /* 801A58CC 001A282C 38 60 00 35 */ li r3, 0x35 /* 801A58D0 001A2830 1C E3 00 0C */ mulli r7, r3, 0xc /* 801A58D4 001A2834 C0 E2 B4 E4 */ lfs f7, lbl_803EB6E4@sda21(r2) /* 801A58D8 001A2838 D0 E9 00 08 */ stfs f7, 8(r9) /* 801A58DC 001A283C 7D 20 32 14 */ add r9, r0, r6 /* 801A58E0 001A2840 38 7F 00 6C */ addi r3, r31, 0x6c /* 801A58E4 001A2844 90 69 00 00 */ stw r3, 0(r9) /* 801A58E8 001A2848 38 60 00 36 */ li r3, 0x36 /* 801A58EC 001A284C 1C C3 00 0C */ mulli r6, r3, 0xc /* 801A58F0 001A2850 D1 09 00 04 */ stfs f8, 4(r9) /* 801A58F4 001A2854 C0 02 B4 E8 */ lfs f0, lbl_803EB6E8@sda21(r2) /* 801A58F8 001A2858 7D 40 42 14 */ add r10, r0, r8 /* 801A58FC 001A285C 39 1F 00 84 */ addi r8, r31, 0x84 /* 801A5900 001A2860 D0 09 00 08 */ stfs f0, 8(r9) /* 801A5904 001A2864 38 60 00 37 */ li r3, 0x37 /* 801A5908 001A2868 1C 63 00 0C */ mulli r3, r3, 0xc /* 801A590C 001A286C 91 0A 00 00 */ stw r8, 0(r10) /* 801A5910 001A2870 D1 0A 00 04 */ stfs f8, 4(r10) /* 801A5914 001A2874 7D 00 3A 14 */ add r8, r0, r7 /* 801A5918 001A2878 38 FF 00 9C */ addi r7, r31, 0x9c /* 801A591C 001A287C D0 EA 00 08 */ stfs f7, 8(r10) /* 801A5920 001A2880 7D 20 32 14 */ add r9, r0, r6 /* 801A5924 001A2884 38 DF 00 BC */ addi r6, r31, 0xbc /* 801A5928 001A2888 90 E8 00 00 */ stw r7, 0(r8) /* 801A592C 001A288C 7C E0 1A 14 */ add r7, r0, r3 /* 801A5930 001A2890 38 7F 00 D4 */ addi r3, r31, 0xd4 /* 801A5934 001A2894 D1 08 00 04 */ stfs f8, 4(r8) /* 801A5938 001A2898 C0 C2 B4 EC */ lfs f6, lbl_803EB6EC@sda21(r2) /* 801A593C 001A289C D0 C8 00 08 */ stfs f6, 8(r8) /* 801A5940 001A28A0 90 C9 00 00 */ stw r6, 0(r9) /* 801A5944 001A28A4 D1 09 00 04 */ stfs f8, 4(r9) /* 801A5948 001A28A8 D0 C9 00 08 */ stfs f6, 8(r9) /* 801A594C 001A28AC 90 67 00 00 */ stw r3, 0(r7) /* 801A5950 001A28B0 D1 07 00 04 */ stfs f8, 4(r7) /* 801A5954 001A28B4 D0 C7 00 08 */ stfs f6, 8(r7) /* 801A5958 001A28B8 38 60 00 38 */ li r3, 0x38 /* 801A595C 001A28BC 1C 63 00 0C */ mulli r3, r3, 0xc /* 801A5960 001A28C0 7C C0 1A 14 */ add r6, r0, r3 /* 801A5964 001A28C4 38 1F 00 F0 */ addi r0, r31, 0xf0 /* 801A5968 001A28C8 90 06 00 00 */ stw r0, 0(r6) /* 801A596C 001A28CC 38 60 00 1E */ li r3, 0x1e /* 801A5970 001A28D0 38 00 00 0A */ li r0, 0xa /* 801A5974 001A28D4 D1 06 00 04 */ stfs f8, 4(r6) /* 801A5978 001A28D8 39 20 FF FF */ li r9, -1 /* 801A597C 001A28DC 39 00 00 05 */ li r8, 5 /* 801A5980 001A28E0 C0 A2 B4 F0 */ lfs f5, lbl_803EB6F0@sda21(r2) /* 801A5984 001A28E4 38 E0 00 14 */ li r7, 0x14 /* 801A5988 001A28E8 D0 A6 00 08 */ stfs f5, 8(r6) /* 801A598C 001A28EC 80 C5 00 00 */ lwz r6, 0(r5) /* 801A5990 001A28F0 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5994 001A28F4 90 66 00 50 */ stw r3, 0x50(r6) /* 801A5998 001A28F8 80 C5 00 00 */ lwz r6, 0(r5) /* 801A599C 001A28FC 80 C6 00 00 */ lwz r6, 0(r6) /* 801A59A0 001A2900 90 06 00 54 */ stw r0, 0x54(r6) /* 801A59A4 001A2904 80 C5 00 00 */ lwz r6, 0(r5) /* 801A59A8 001A2908 80 C6 00 00 */ lwz r6, 0(r6) /* 801A59AC 001A290C 90 06 00 58 */ stw r0, 0x58(r6) /* 801A59B0 001A2910 80 C5 00 04 */ lwz r6, 4(r5) /* 801A59B4 001A2914 C0 02 B4 F4 */ lfs f0, lbl_803EB6F4@sda21(r2) /* 801A59B8 001A2918 80 C6 00 00 */ lwz r6, 0(r6) /* 801A59BC 001A291C D0 06 00 C8 */ stfs f0, 0xc8(r6) /* 801A59C0 001A2920 80 C5 00 04 */ lwz r6, 4(r5) /* 801A59C4 001A2924 C0 02 B4 F8 */ lfs f0, lbl_803EB6F8@sda21(r2) /* 801A59C8 001A2928 80 C6 00 00 */ lwz r6, 0(r6) /* 801A59CC 001A292C D0 06 00 CC */ stfs f0, 0xcc(r6) /* 801A59D0 001A2930 80 C5 00 04 */ lwz r6, 4(r5) /* 801A59D4 001A2934 80 C6 00 00 */ lwz r6, 0(r6) /* 801A59D8 001A2938 D0 C6 00 D0 */ stfs f6, 0xd0(r6) /* 801A59DC 001A293C 80 C5 00 04 */ lwz r6, 4(r5) /* 801A59E0 001A2940 C0 02 B4 FC */ lfs f0, lbl_803EB6FC@sda21(r2) /* 801A59E4 001A2944 80 C6 00 00 */ lwz r6, 0(r6) /* 801A59E8 001A2948 D0 06 00 D4 */ stfs f0, 0xd4(r6) /* 801A59EC 001A294C 80 C5 00 04 */ lwz r6, 4(r5) /* 801A59F0 001A2950 C0 02 B5 00 */ lfs f0, lbl_803EB700@sda21(r2) /* 801A59F4 001A2954 80 C6 00 00 */ lwz r6, 0(r6) /* 801A59F8 001A2958 D0 06 00 D8 */ stfs f0, 0xd8(r6) /* 801A59FC 001A295C 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5A00 001A2960 C0 02 B5 04 */ lfs f0, lbl_803EB704@sda21(r2) /* 801A5A04 001A2964 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5A08 001A2968 D0 06 00 DC */ stfs f0, 0xdc(r6) /* 801A5A0C 001A296C 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5A10 001A2970 C0 82 B5 08 */ lfs f4, lbl_803EB708@sda21(r2) /* 801A5A14 001A2974 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5A18 001A2978 D0 86 00 E0 */ stfs f4, 0xe0(r6) /* 801A5A1C 001A297C 80 C5 00 00 */ lwz r6, 0(r5) /* 801A5A20 001A2980 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5A24 001A2984 91 26 00 0C */ stw r9, 0xc(r6) /* 801A5A28 001A2988 80 C5 00 00 */ lwz r6, 0(r5) /* 801A5A2C 001A298C 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5A30 001A2990 91 06 00 24 */ stw r8, 0x24(r6) /* 801A5A34 001A2994 80 C5 00 00 */ lwz r6, 0(r5) /* 801A5A38 001A2998 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5A3C 001A299C 90 06 00 28 */ stw r0, 0x28(r6) /* 801A5A40 001A29A0 80 C5 00 00 */ lwz r6, 0(r5) /* 801A5A44 001A29A4 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5A48 001A29A8 90 E6 00 2C */ stw r7, 0x2c(r6) /* 801A5A4C 001A29AC 80 C5 00 00 */ lwz r6, 0(r5) /* 801A5A50 001A29B0 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5A54 001A29B4 90 66 00 30 */ stw r3, 0x30(r6) /* 801A5A58 001A29B8 80 C5 00 00 */ lwz r6, 0(r5) /* 801A5A5C 001A29BC 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5A60 001A29C0 90 66 00 34 */ stw r3, 0x34(r6) /* 801A5A64 001A29C4 80 C5 00 00 */ lwz r6, 0(r5) /* 801A5A68 001A29C8 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5A6C 001A29CC 90 66 00 38 */ stw r3, 0x38(r6) /* 801A5A70 001A29D0 80 C5 00 00 */ lwz r6, 0(r5) /* 801A5A74 001A29D4 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5A78 001A29D8 90 66 00 3C */ stw r3, 0x3c(r6) /* 801A5A7C 001A29DC 80 C5 00 00 */ lwz r6, 0(r5) /* 801A5A80 001A29E0 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5A84 001A29E4 90 66 00 40 */ stw r3, 0x40(r6) /* 801A5A88 001A29E8 80 65 00 04 */ lwz r3, 4(r5) /* 801A5A8C 001A29EC 80 63 00 00 */ lwz r3, 0(r3) /* 801A5A90 001A29F0 D0 E3 00 08 */ stfs f7, 8(r3) /* 801A5A94 001A29F4 80 65 00 04 */ lwz r3, 4(r5) /* 801A5A98 001A29F8 C0 62 B5 0C */ lfs f3, lbl_803EB70C@sda21(r2) /* 801A5A9C 001A29FC 80 63 00 00 */ lwz r3, 0(r3) /* 801A5AA0 001A2A00 D0 63 00 04 */ stfs f3, 4(r3) /* 801A5AA4 001A2A04 80 65 00 04 */ lwz r3, 4(r5) /* 801A5AA8 001A2A08 C0 02 B5 10 */ lfs f0, lbl_803EB710@sda21(r2) /* 801A5AAC 001A2A0C 80 63 00 00 */ lwz r3, 0(r3) /* 801A5AB0 001A2A10 D0 03 00 00 */ stfs f0, 0(r3) /* 801A5AB4 001A2A14 80 65 00 04 */ lwz r3, 4(r5) /* 801A5AB8 001A2A18 C0 42 B5 14 */ lfs f2, lbl_803EB714@sda21(r2) /* 801A5ABC 001A2A1C 80 63 00 00 */ lwz r3, 0(r3) /* 801A5AC0 001A2A20 D0 43 00 0C */ stfs f2, 0xc(r3) /* 801A5AC4 001A2A24 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5AC8 001A2A28 7F C3 F3 78 */ mr r3, r30 /* 801A5ACC 001A2A2C 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5AD0 001A2A30 D0 A6 00 10 */ stfs f5, 0x10(r6) /* 801A5AD4 001A2A34 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5AD8 001A2A38 C0 02 B5 18 */ lfs f0, lbl_803EB718@sda21(r2) /* 801A5ADC 001A2A3C 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5AE0 001A2A40 D0 06 00 14 */ stfs f0, 0x14(r6) /* 801A5AE4 001A2A44 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5AE8 001A2A48 C0 02 B5 1C */ lfs f0, lbl_803EB71C@sda21(r2) /* 801A5AEC 001A2A4C 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5AF0 001A2A50 D0 06 00 18 */ stfs f0, 0x18(r6) /* 801A5AF4 001A2A54 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5AF8 001A2A58 C0 02 B5 20 */ lfs f0, lbl_803EB720@sda21(r2) /* 801A5AFC 001A2A5C 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5B00 001A2A60 D0 06 00 1C */ stfs f0, 0x1c(r6) /* 801A5B04 001A2A64 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5B08 001A2A68 C0 02 B5 24 */ lfs f0, lbl_803EB724@sda21(r2) /* 801A5B0C 001A2A6C 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5B10 001A2A70 D0 06 00 70 */ stfs f0, 0x70(r6) /* 801A5B14 001A2A74 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5B18 001A2A78 C0 22 B5 28 */ lfs f1, lbl_803EB728@sda21(r2) /* 801A5B1C 001A2A7C 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5B20 001A2A80 D0 26 00 20 */ stfs f1, 0x20(r6) /* 801A5B24 001A2A84 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5B28 001A2A88 C0 02 B5 2C */ lfs f0, lbl_803EB72C@sda21(r2) /* 801A5B2C 001A2A8C 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5B30 001A2A90 D0 06 00 24 */ stfs f0, 0x24(r6) /* 801A5B34 001A2A94 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5B38 001A2A98 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5B3C 001A2A9C D0 C6 00 28 */ stfs f6, 0x28(r6) /* 801A5B40 001A2AA0 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5B44 001A2AA4 C0 02 B5 30 */ lfs f0, lbl_803EB730@sda21(r2) /* 801A5B48 001A2AA8 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5B4C 001A2AAC D0 06 00 2C */ stfs f0, 0x2c(r6) /* 801A5B50 001A2AB0 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5B54 001A2AB4 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5B58 001A2AB8 D1 06 00 30 */ stfs f8, 0x30(r6) /* 801A5B5C 001A2ABC 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5B60 001A2AC0 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5B64 001A2AC4 D0 E6 00 3C */ stfs f7, 0x3c(r6) /* 801A5B68 001A2AC8 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5B6C 001A2ACC C0 02 B5 34 */ lfs f0, lbl_803EB734@sda21(r2) /* 801A5B70 001A2AD0 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5B74 001A2AD4 D0 06 00 40 */ stfs f0, 0x40(r6) /* 801A5B78 001A2AD8 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5B7C 001A2ADC 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5B80 001A2AE0 D0 86 00 44 */ stfs f4, 0x44(r6) /* 801A5B84 001A2AE4 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5B88 001A2AE8 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5B8C 001A2AEC D0 46 00 48 */ stfs f2, 0x48(r6) /* 801A5B90 001A2AF0 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5B94 001A2AF4 C0 02 B5 38 */ lfs f0, lbl_803EB738@sda21(r2) /* 801A5B98 001A2AF8 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5B9C 001A2AFC D0 06 00 78 */ stfs f0, 0x78(r6) /* 801A5BA0 001A2B00 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5BA4 001A2B04 C0 02 B5 3C */ lfs f0, lbl_803EB73C@sda21(r2) /* 801A5BA8 001A2B08 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5BAC 001A2B0C D0 06 00 7C */ stfs f0, 0x7c(r6) /* 801A5BB0 001A2B10 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5BB4 001A2B14 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5BB8 001A2B18 D0 66 00 80 */ stfs f3, 0x80(r6) /* 801A5BBC 001A2B1C 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5BC0 001A2B20 C0 02 B5 40 */ lfs f0, lbl_803EB740@sda21(r2) /* 801A5BC4 001A2B24 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5BC8 001A2B28 D0 06 00 84 */ stfs f0, 0x84(r6) /* 801A5BCC 001A2B2C 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5BD0 001A2B30 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5BD4 001A2B34 D0 A6 00 88 */ stfs f5, 0x88(r6) /* 801A5BD8 001A2B38 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5BDC 001A2B3C 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5BE0 001A2B40 D1 06 00 8C */ stfs f8, 0x8c(r6) /* 801A5BE4 001A2B44 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5BE8 001A2B48 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5BEC 001A2B4C D1 06 00 90 */ stfs f8, 0x90(r6) /* 801A5BF0 001A2B50 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5BF4 001A2B54 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5BF8 001A2B58 D0 26 00 94 */ stfs f1, 0x94(r6) /* 801A5BFC 001A2B5C 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5C00 001A2B60 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5C04 001A2B64 D0 46 00 98 */ stfs f2, 0x98(r6) /* 801A5C08 001A2B68 80 C5 00 04 */ lwz r6, 4(r5) /* 801A5C0C 001A2B6C 80 C6 00 00 */ lwz r6, 0(r6) /* 801A5C10 001A2B70 D0 46 00 74 */ stfs f2, 0x74(r6) /* 801A5C14 001A2B74 80 A5 00 00 */ lwz r5, 0(r5) /* 801A5C18 001A2B78 80 A5 00 00 */ lwz r5, 0(r5) /* 801A5C1C 001A2B7C 90 85 00 08 */ stw r4, 8(r5) /* 801A5C20 001A2B80 80 01 00 DC */ lwz r0, 0xdc(r1) /* 801A5C24 001A2B84 83 E1 00 D4 */ lwz r31, 0xd4(r1) /* 801A5C28 001A2B88 83 C1 00 D0 */ lwz r30, 0xd0(r1) /* 801A5C2C 001A2B8C 38 21 00 D8 */ addi r1, r1, 0xd8 /* 801A5C30 001A2B90 7C 08 03 A6 */ mtlr r0 /* 801A5C34 001A2B94 4E 80 00 20 */ blr .global __ct__14TAImarStrategyFv __ct__14TAImarStrategyFv: /* 801A5C38 001A2B98 7C 08 02 A6 */ mflr r0 /* 801A5C3C 001A2B9C 38 80 00 0F */ li r4, 0xf /* 801A5C40 001A2BA0 90 01 00 04 */ stw r0, 4(r1) /* 801A5C44 001A2BA4 38 A0 00 02 */ li r5, 2 /* 801A5C48 001A2BA8 94 21 FE F8 */ stwu r1, -0x108(r1) /* 801A5C4C 001A2BAC BD C1 00 C0 */ stmw r14, 0xc0(r1) /* 801A5C50 001A2BB0 3B E3 00 00 */ addi r31, r3, 0 /* 801A5C54 001A2BB4 48 04 3A 01 */ bl __ct__11YaiStrategyFii /* 801A5C58 001A2BB8 3C 60 80 2E */ lis r3, __vt__14TAImarStrategy@ha /* 801A5C5C 001A2BBC 38 03 E7 A0 */ addi r0, r3, __vt__14TAImarStrategy@l /* 801A5C60 001A2BC0 90 1F 00 00 */ stw r0, 0(r31) /* 801A5C64 001A2BC4 38 60 00 08 */ li r3, 8 /* 801A5C68 001A2BC8 4B EA 13 9D */ bl alloc__6SystemFUl /* 801A5C6C 001A2BCC 3A 83 00 00 */ addi r20, r3, 0 /* 801A5C70 001A2BD0 7E 80 A3 79 */ or. r0, r20, r20 /* 801A5C74 001A2BD4 41 82 00 24 */ beq lbl_801A5C98 /* 801A5C78 001A2BD8 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A5C7C 001A2BDC 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A5C80 001A2BE0 90 14 00 04 */ stw r0, 4(r20) /* 801A5C84 001A2BE4 38 00 00 00 */ li r0, 0 /* 801A5C88 001A2BE8 3C 60 80 2E */ lis r3, __vt__13TAIAdeadCheck@ha /* 801A5C8C 001A2BEC 90 14 00 00 */ stw r0, 0(r20) /* 801A5C90 001A2BF0 38 03 F3 4C */ addi r0, r3, __vt__13TAIAdeadCheck@l /* 801A5C94 001A2BF4 90 14 00 04 */ stw r0, 4(r20) lbl_801A5C98: /* 801A5C98 001A2BF8 38 60 00 08 */ li r3, 8 /* 801A5C9C 001A2BFC 4B EA 13 69 */ bl alloc__6SystemFUl /* 801A5CA0 001A2C00 90 61 00 BC */ stw r3, 0xbc(r1) /* 801A5CA4 001A2C04 80 01 00 BC */ lwz r0, 0xbc(r1) /* 801A5CA8 001A2C08 28 00 00 00 */ cmplwi r0, 0 /* 801A5CAC 001A2C0C 41 82 00 30 */ beq lbl_801A5CDC /* 801A5CB0 001A2C10 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A5CB4 001A2C14 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A5CB8 001A2C18 80 61 00 BC */ lwz r3, 0xbc(r1) /* 801A5CBC 001A2C1C 3C 80 80 2E */ lis r4, __vt__13TAIAdeadCheck@ha /* 801A5CC0 001A2C20 90 03 00 04 */ stw r0, 4(r3) /* 801A5CC4 001A2C24 38 00 00 01 */ li r0, 1 /* 801A5CC8 001A2C28 80 61 00 BC */ lwz r3, 0xbc(r1) /* 801A5CCC 001A2C2C 90 03 00 00 */ stw r0, 0(r3) /* 801A5CD0 001A2C30 38 04 F3 4C */ addi r0, r4, __vt__13TAIAdeadCheck@l /* 801A5CD4 001A2C34 80 61 00 BC */ lwz r3, 0xbc(r1) /* 801A5CD8 001A2C38 90 03 00 04 */ stw r0, 4(r3) lbl_801A5CDC: /* 801A5CDC 001A2C3C 38 60 00 0C */ li r3, 0xc /* 801A5CE0 001A2C40 4B EA 13 25 */ bl alloc__6SystemFUl /* 801A5CE4 001A2C44 90 61 00 B8 */ stw r3, 0xb8(r1) /* 801A5CE8 001A2C48 80 61 00 B8 */ lwz r3, 0xb8(r1) /* 801A5CEC 001A2C4C 28 03 00 00 */ cmplwi r3, 0 /* 801A5CF0 001A2C50 41 82 00 44 */ beq lbl_801A5D34 /* 801A5CF4 001A2C54 38 80 FF FF */ li r4, -1 /* 801A5CF8 001A2C58 38 A0 00 00 */ li r5, 0 /* 801A5CFC 001A2C5C 48 00 6F 59 */ bl __ct__10TAIAmotionFii /* 801A5D00 001A2C60 3C 60 80 2E */ lis r3, __vt__9TAIAdying@ha /* 801A5D04 001A2C64 38 03 F2 EC */ addi r0, r3, __vt__9TAIAdying@l /* 801A5D08 001A2C68 80 61 00 B8 */ lwz r3, 0xb8(r1) /* 801A5D0C 001A2C6C 3C 80 80 2E */ lis r4, __vt__12TAIAdyingMar@ha /* 801A5D10 001A2C70 90 03 00 04 */ stw r0, 4(r3) /* 801A5D14 001A2C74 38 04 EF A0 */ addi r0, r4, __vt__12TAIAdyingMar@l /* 801A5D18 001A2C78 80 61 00 B8 */ lwz r3, 0xb8(r1) /* 801A5D1C 001A2C7C 90 03 00 04 */ stw r0, 4(r3) /* 801A5D20 001A2C80 C0 22 B5 0C */ lfs f1, lbl_803EB70C@sda21(r2) /* 801A5D24 001A2C84 C0 02 B4 E0 */ lfs f0, lbl_803EB6E0@sda21(r2) /* 801A5D28 001A2C88 D0 2D 31 90 */ stfs f1, effectScale0__12TAIAdyingMar@sda21(r13) /* 801A5D2C 001A2C8C D0 0D 31 98 */ stfs f0, effectStartCounter__12TAIAdyingMar@sda21(r13) /* 801A5D30 001A2C90 D0 2D 31 94 */ stfs f1, effectScale1__12TAIAdyingMar@sda21(r13) lbl_801A5D34: /* 801A5D34 001A2C94 38 60 00 0C */ li r3, 0xc /* 801A5D38 001A2C98 4B EA 12 CD */ bl alloc__6SystemFUl /* 801A5D3C 001A2C9C 90 61 00 B4 */ stw r3, 0xb4(r1) /* 801A5D40 001A2CA0 80 61 00 B4 */ lwz r3, 0xb4(r1) /* 801A5D44 001A2CA4 28 03 00 00 */ cmplwi r3, 0 /* 801A5D48 001A2CA8 41 82 00 44 */ beq lbl_801A5D8C /* 801A5D4C 001A2CAC 38 80 FF FF */ li r4, -1 /* 801A5D50 001A2CB0 38 A0 00 0C */ li r5, 0xc /* 801A5D54 001A2CB4 48 00 6F 01 */ bl __ct__10TAIAmotionFii /* 801A5D58 001A2CB8 3C 60 80 2E */ lis r3, __vt__9TAIAdying@ha /* 801A5D5C 001A2CBC 38 03 F2 EC */ addi r0, r3, __vt__9TAIAdying@l /* 801A5D60 001A2CC0 80 61 00 B4 */ lwz r3, 0xb4(r1) /* 801A5D64 001A2CC4 3C 80 80 2E */ lis r4, __vt__12TAIAdyingMar@ha /* 801A5D68 001A2CC8 90 03 00 04 */ stw r0, 4(r3) /* 801A5D6C 001A2CCC 38 04 EF A0 */ addi r0, r4, __vt__12TAIAdyingMar@l /* 801A5D70 001A2CD0 80 61 00 B4 */ lwz r3, 0xb4(r1) /* 801A5D74 001A2CD4 90 03 00 04 */ stw r0, 4(r3) /* 801A5D78 001A2CD8 C0 22 B5 0C */ lfs f1, lbl_803EB70C@sda21(r2) /* 801A5D7C 001A2CDC C0 02 B4 E0 */ lfs f0, lbl_803EB6E0@sda21(r2) /* 801A5D80 001A2CE0 D0 2D 31 90 */ stfs f1, effectScale0__12TAIAdyingMar@sda21(r13) /* 801A5D84 001A2CE4 D0 0D 31 98 */ stfs f0, effectStartCounter__12TAIAdyingMar@sda21(r13) /* 801A5D88 001A2CE8 D0 2D 31 94 */ stfs f1, effectScale1__12TAIAdyingMar@sda21(r13) lbl_801A5D8C: /* 801A5D8C 001A2CEC 38 60 00 08 */ li r3, 8 /* 801A5D90 001A2CF0 4B EA 12 75 */ bl alloc__6SystemFUl /* 801A5D94 001A2CF4 90 61 00 B0 */ stw r3, 0xb0(r1) /* 801A5D98 001A2CF8 80 01 00 B0 */ lwz r0, 0xb0(r1) /* 801A5D9C 001A2CFC 28 00 00 00 */ cmplwi r0, 0 /* 801A5DA0 001A2D00 41 82 00 30 */ beq lbl_801A5DD0 /* 801A5DA4 001A2D04 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A5DA8 001A2D08 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A5DAC 001A2D0C 80 61 00 B0 */ lwz r3, 0xb0(r1) /* 801A5DB0 001A2D10 3C 80 80 2E */ lis r4, __vt__8TAIAstop@ha /* 801A5DB4 001A2D14 90 03 00 04 */ stw r0, 4(r3) /* 801A5DB8 001A2D18 38 00 FF FF */ li r0, -1 /* 801A5DBC 001A2D1C 80 61 00 B0 */ lwz r3, 0xb0(r1) /* 801A5DC0 001A2D20 90 03 00 00 */ stw r0, 0(r3) /* 801A5DC4 001A2D24 38 04 F9 14 */ addi r0, r4, __vt__8TAIAstop@l /* 801A5DC8 001A2D28 80 61 00 B0 */ lwz r3, 0xb0(r1) /* 801A5DCC 001A2D2C 90 03 00 04 */ stw r0, 4(r3) lbl_801A5DD0: /* 801A5DD0 001A2D30 38 60 00 0C */ li r3, 0xc /* 801A5DD4 001A2D34 4B EA 12 31 */ bl alloc__6SystemFUl /* 801A5DD8 001A2D38 3B C3 00 00 */ addi r30, r3, 0 /* 801A5DDC 001A2D3C 7F C0 F3 79 */ or. r0, r30, r30 /* 801A5DE0 001A2D40 41 82 00 2C */ beq lbl_801A5E0C /* 801A5DE4 001A2D44 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A5DE8 001A2D48 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A5DEC 001A2D4C 90 1E 00 04 */ stw r0, 4(r30) /* 801A5DF0 001A2D50 38 00 FF FF */ li r0, -1 /* 801A5DF4 001A2D54 3C 60 80 2E */ lis r3, __vt__10TAIAdamage@ha /* 801A5DF8 001A2D58 90 1E 00 00 */ stw r0, 0(r30) /* 801A5DFC 001A2D5C 38 63 F1 F0 */ addi r3, r3, __vt__10TAIAdamage@l /* 801A5E00 001A2D60 38 00 00 01 */ li r0, 1 /* 801A5E04 001A2D64 90 7E 00 04 */ stw r3, 4(r30) /* 801A5E08 001A2D68 98 1E 00 08 */ stb r0, 8(r30) lbl_801A5E0C: /* 801A5E0C 001A2D6C 38 60 00 0C */ li r3, 0xc /* 801A5E10 001A2D70 4B EA 11 F5 */ bl alloc__6SystemFUl /* 801A5E14 001A2D74 3B 23 00 00 */ addi r25, r3, 0 /* 801A5E18 001A2D78 7F 20 CB 79 */ or. r0, r25, r25 /* 801A5E1C 001A2D7C 41 82 00 2C */ beq lbl_801A5E48 /* 801A5E20 001A2D80 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A5E24 001A2D84 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A5E28 001A2D88 90 19 00 04 */ stw r0, 4(r25) /* 801A5E2C 001A2D8C 38 00 FF FF */ li r0, -1 /* 801A5E30 001A2D90 3C 60 80 2E */ lis r3, __vt__21TAIAflyingInTerritory@ha /* 801A5E34 001A2D94 90 19 00 00 */ stw r0, 0(r25) /* 801A5E38 001A2D98 38 03 F5 FC */ addi r0, r3, __vt__21TAIAflyingInTerritory@l /* 801A5E3C 001A2D9C 90 19 00 04 */ stw r0, 4(r25) /* 801A5E40 001A2DA0 C0 02 B5 44 */ lfs f0, lbl_803EB744@sda21(r2) /* 801A5E44 001A2DA4 D0 19 00 08 */ stfs f0, 8(r25) lbl_801A5E48: /* 801A5E48 001A2DA8 38 60 00 08 */ li r3, 8 /* 801A5E4C 001A2DAC 4B EA 11 B9 */ bl alloc__6SystemFUl /* 801A5E50 001A2DB0 3B 43 00 00 */ addi r26, r3, 0 /* 801A5E54 001A2DB4 7F 40 D3 79 */ or. r0, r26, r26 /* 801A5E58 001A2DB8 41 82 00 30 */ beq lbl_801A5E88 /* 801A5E5C 001A2DBC 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A5E60 001A2DC0 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A5E64 001A2DC4 90 1A 00 04 */ stw r0, 4(r26) /* 801A5E68 001A2DC8 38 00 FF FF */ li r0, -1 /* 801A5E6C 001A2DCC 3C 60 80 2E */ lis r3, __vt__14TAIAflyingBase@ha /* 801A5E70 001A2DD0 90 1A 00 00 */ stw r0, 0(r26) /* 801A5E74 001A2DD4 38 03 F6 34 */ addi r0, r3, __vt__14TAIAflyingBase@l /* 801A5E78 001A2DD8 3C 60 80 2E */ lis r3, __vt__17TAIAflyingBaseMar@ha /* 801A5E7C 001A2DDC 90 1A 00 04 */ stw r0, 4(r26) /* 801A5E80 001A2DE0 38 03 EF 34 */ addi r0, r3, __vt__17TAIAflyingBaseMar@l /* 801A5E84 001A2DE4 90 1A 00 04 */ stw r0, 4(r26) lbl_801A5E88: /* 801A5E88 001A2DE8 38 60 00 0C */ li r3, 0xc /* 801A5E8C 001A2DEC 4B EA 11 79 */ bl alloc__6SystemFUl /* 801A5E90 001A2DF0 90 61 00 AC */ stw r3, 0xac(r1) /* 801A5E94 001A2DF4 80 61 00 AC */ lwz r3, 0xac(r1) /* 801A5E98 001A2DF8 28 03 00 00 */ cmplwi r3, 0 /* 801A5E9C 001A2DFC 41 82 00 10 */ beq lbl_801A5EAC /* 801A5EA0 001A2E00 38 80 FF FF */ li r4, -1 /* 801A5EA4 001A2E04 38 A0 00 06 */ li r5, 6 /* 801A5EA8 001A2E08 48 00 6E 39 */ bl __ct__17TAIAreserveMotionFii lbl_801A5EAC: /* 801A5EAC 001A2E0C 38 60 00 08 */ li r3, 8 /* 801A5EB0 001A2E10 4B EA 11 55 */ bl alloc__6SystemFUl /* 801A5EB4 001A2E14 90 61 00 A8 */ stw r3, 0xa8(r1) /* 801A5EB8 001A2E18 80 01 00 A8 */ lwz r0, 0xa8(r1) /* 801A5EBC 001A2E1C 28 00 00 00 */ cmplwi r0, 0 /* 801A5EC0 001A2E20 41 82 00 30 */ beq lbl_801A5EF0 /* 801A5EC4 001A2E24 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A5EC8 001A2E28 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A5ECC 001A2E2C 80 61 00 A8 */ lwz r3, 0xa8(r1) /* 801A5ED0 001A2E30 3C 80 80 2E */ lis r4, __vt__22TAIAflickCheckTimerMar@ha /* 801A5ED4 001A2E34 90 03 00 04 */ stw r0, 4(r3) /* 801A5ED8 001A2E38 38 00 00 04 */ li r0, 4 /* 801A5EDC 001A2E3C 80 61 00 A8 */ lwz r3, 0xa8(r1) /* 801A5EE0 001A2E40 90 03 00 00 */ stw r0, 0(r3) /* 801A5EE4 001A2E44 38 04 EE 94 */ addi r0, r4, __vt__22TAIAflickCheckTimerMar@l /* 801A5EE8 001A2E48 80 61 00 A8 */ lwz r3, 0xa8(r1) /* 801A5EEC 001A2E4C 90 03 00 04 */ stw r0, 4(r3) lbl_801A5EF0: /* 801A5EF0 001A2E50 38 60 00 0C */ li r3, 0xc /* 801A5EF4 001A2E54 4B EA 11 11 */ bl alloc__6SystemFUl /* 801A5EF8 001A2E58 90 61 00 A4 */ stw r3, 0xa4(r1) /* 801A5EFC 001A2E5C 80 61 00 A4 */ lwz r3, 0xa4(r1) /* 801A5F00 001A2E60 28 03 00 00 */ cmplwi r3, 0 /* 801A5F04 001A2E64 41 82 00 30 */ beq lbl_801A5F34 /* 801A5F08 001A2E68 38 80 00 03 */ li r4, 3 /* 801A5F0C 001A2E6C 38 A0 00 01 */ li r5, 1 /* 801A5F10 001A2E70 48 00 6D 45 */ bl __ct__10TAIAmotionFii /* 801A5F14 001A2E74 3C 60 80 2E */ lis r3, __vt__12TAIAflicking@ha /* 801A5F18 001A2E78 38 03 03 4C */ addi r0, r3, __vt__12TAIAflicking@l /* 801A5F1C 001A2E7C 80 61 00 A4 */ lwz r3, 0xa4(r1) /* 801A5F20 001A2E80 3C 80 80 2E */ lis r4, __vt__15TAIAflickingMar@ha /* 801A5F24 001A2E84 90 03 00 04 */ stw r0, 4(r3) /* 801A5F28 001A2E88 38 04 EE 14 */ addi r0, r4, __vt__15TAIAflickingMar@l /* 801A5F2C 001A2E8C 80 61 00 A4 */ lwz r3, 0xa4(r1) /* 801A5F30 001A2E90 90 03 00 04 */ stw r0, 4(r3) lbl_801A5F34: /* 801A5F34 001A2E94 38 60 00 0C */ li r3, 0xc /* 801A5F38 001A2E98 4B EA 10 CD */ bl alloc__6SystemFUl /* 801A5F3C 001A2E9C 3A 03 00 00 */ addi r16, r3, 0 /* 801A5F40 001A2EA0 7E 00 83 79 */ or. r0, r16, r16 /* 801A5F44 001A2EA4 41 82 00 38 */ beq lbl_801A5F7C /* 801A5F48 001A2EA8 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A5F4C 001A2EAC 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A5F50 001A2EB0 90 10 00 04 */ stw r0, 4(r16) /* 801A5F54 001A2EB4 38 00 00 05 */ li r0, 5 /* 801A5F58 001A2EB8 3C 60 80 2E */ lis r3, __vt__16TAIAstickingPiki@ha /* 801A5F5C 001A2EBC 90 10 00 00 */ stw r0, 0(r16) /* 801A5F60 001A2EC0 38 03 FE 20 */ addi r0, r3, __vt__16TAIAstickingPiki@l /* 801A5F64 001A2EC4 3C 60 80 2E */ lis r3, __vt__22TAIAstickingPikiMarFly@ha /* 801A5F68 001A2EC8 90 10 00 04 */ stw r0, 4(r16) /* 801A5F6C 001A2ECC 38 80 00 00 */ li r4, 0 /* 801A5F70 001A2ED0 38 03 ED 8C */ addi r0, r3, __vt__22TAIAstickingPikiMarFly@l /* 801A5F74 001A2ED4 90 90 00 08 */ stw r4, 8(r16) /* 801A5F78 001A2ED8 90 10 00 04 */ stw r0, 4(r16) lbl_801A5F7C: /* 801A5F7C 001A2EDC 38 60 00 0C */ li r3, 0xc /* 801A5F80 001A2EE0 4B EA 10 85 */ bl alloc__6SystemFUl /* 801A5F84 001A2EE4 90 61 00 A0 */ stw r3, 0xa0(r1) /* 801A5F88 001A2EE8 80 61 00 A0 */ lwz r3, 0xa0(r1) /* 801A5F8C 001A2EEC 28 03 00 00 */ cmplwi r3, 0 /* 801A5F90 001A2EF0 41 82 00 20 */ beq lbl_801A5FB0 /* 801A5F94 001A2EF4 38 80 00 06 */ li r4, 6 /* 801A5F98 001A2EF8 38 A0 00 0B */ li r5, 0xb /* 801A5F9C 001A2EFC 48 00 6D 45 */ bl __ct__17TAIAreserveMotionFii /* 801A5FA0 001A2F00 3C 60 80 2E */ lis r3, __vt__11TAIAdescent@ha /* 801A5FA4 001A2F04 38 03 F4 90 */ addi r0, r3, __vt__11TAIAdescent@l /* 801A5FA8 001A2F08 80 61 00 A0 */ lwz r3, 0xa0(r1) /* 801A5FAC 001A2F0C 90 03 00 04 */ stw r0, 4(r3) lbl_801A5FB0: /* 801A5FB0 001A2F10 38 60 00 0C */ li r3, 0xc /* 801A5FB4 001A2F14 4B EA 10 51 */ bl alloc__6SystemFUl /* 801A5FB8 001A2F18 90 61 00 9C */ stw r3, 0x9c(r1) /* 801A5FBC 001A2F1C 80 61 00 9C */ lwz r3, 0x9c(r1) /* 801A5FC0 001A2F20 28 03 00 00 */ cmplwi r3, 0 /* 801A5FC4 001A2F24 41 82 00 30 */ beq lbl_801A5FF4 /* 801A5FC8 001A2F28 38 80 00 07 */ li r4, 7 /* 801A5FCC 001A2F2C 38 A0 00 07 */ li r5, 7 /* 801A5FD0 001A2F30 48 00 6D 11 */ bl __ct__17TAIAreserveMotionFii /* 801A5FD4 001A2F34 3C 60 80 2E */ lis r3, __vt__11TAIAlanding@ha /* 801A5FD8 001A2F38 38 03 F4 50 */ addi r0, r3, __vt__11TAIAlanding@l /* 801A5FDC 001A2F3C 80 61 00 9C */ lwz r3, 0x9c(r1) /* 801A5FE0 001A2F40 3C 80 80 2E */ lis r4, __vt__14TAIAlandingMar@ha /* 801A5FE4 001A2F44 90 03 00 04 */ stw r0, 4(r3) /* 801A5FE8 001A2F48 38 04 ED 40 */ addi r0, r4, __vt__14TAIAlandingMar@l /* 801A5FEC 001A2F4C 80 61 00 9C */ lwz r3, 0x9c(r1) /* 801A5FF0 001A2F50 90 03 00 04 */ stw r0, 4(r3) lbl_801A5FF4: /* 801A5FF4 001A2F54 38 60 00 0C */ li r3, 0xc /* 801A5FF8 001A2F58 4B EA 10 0D */ bl alloc__6SystemFUl /* 801A5FFC 001A2F5C 90 61 00 98 */ stw r3, 0x98(r1) /* 801A6000 001A2F60 80 61 00 98 */ lwz r3, 0x98(r1) /* 801A6004 001A2F64 28 03 00 00 */ cmplwi r3, 0 /* 801A6008 001A2F68 41 82 00 10 */ beq lbl_801A6018 /* 801A600C 001A2F6C 38 80 FF FF */ li r4, -1 /* 801A6010 001A2F70 38 A0 00 02 */ li r5, 2 /* 801A6014 001A2F74 48 00 6C CD */ bl __ct__17TAIAreserveMotionFii lbl_801A6018: /* 801A6018 001A2F78 38 60 00 0C */ li r3, 0xc /* 801A601C 001A2F7C 4B EA 0F E9 */ bl alloc__6SystemFUl /* 801A6020 001A2F80 3A 23 00 00 */ addi r17, r3, 0 /* 801A6024 001A2F84 7E 20 8B 79 */ or. r0, r17, r17 /* 801A6028 001A2F88 41 82 00 38 */ beq lbl_801A6060 /* 801A602C 001A2F8C 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A6030 001A2F90 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A6034 001A2F94 90 11 00 04 */ stw r0, 4(r17) /* 801A6038 001A2F98 38 00 00 08 */ li r0, 8 /* 801A603C 001A2F9C 3C 60 80 2E */ lis r3, __vt__14TAIAflickCheck@ha /* 801A6040 001A2FA0 90 11 00 00 */ stw r0, 0(r17) /* 801A6044 001A2FA4 38 03 03 CC */ addi r0, r3, __vt__14TAIAflickCheck@l /* 801A6048 001A2FA8 3C 60 80 2E */ lis r3, __vt__17TAIAflickCheckMar@ha /* 801A604C 001A2FAC 90 11 00 04 */ stw r0, 4(r17) /* 801A6050 001A2FB0 38 80 00 01 */ li r4, 1 /* 801A6054 001A2FB4 38 03 EC D4 */ addi r0, r3, __vt__17TAIAflickCheckMar@l /* 801A6058 001A2FB8 90 91 00 08 */ stw r4, 8(r17) /* 801A605C 001A2FBC 90 11 00 04 */ stw r0, 4(r17) lbl_801A6060: /* 801A6060 001A2FC0 38 60 00 0C */ li r3, 0xc /* 801A6064 001A2FC4 4B EA 0F A1 */ bl alloc__6SystemFUl /* 801A6068 001A2FC8 90 61 00 94 */ stw r3, 0x94(r1) /* 801A606C 001A2FCC 80 61 00 94 */ lwz r3, 0x94(r1) /* 801A6070 001A2FD0 28 03 00 00 */ cmplwi r3, 0 /* 801A6074 001A2FD4 41 82 00 30 */ beq lbl_801A60A4 /* 801A6078 001A2FD8 38 80 00 09 */ li r4, 9 /* 801A607C 001A2FDC 38 A0 00 09 */ li r5, 9 /* 801A6080 001A2FE0 48 00 6B D5 */ bl __ct__10TAIAmotionFii /* 801A6084 001A2FE4 3C 60 80 2E */ lis r3, __vt__12TAIAflicking@ha /* 801A6088 001A2FE8 38 03 03 4C */ addi r0, r3, __vt__12TAIAflicking@l /* 801A608C 001A2FEC 80 61 00 94 */ lwz r3, 0x94(r1) /* 801A6090 001A2FF0 3C 80 80 2E */ lis r4, __vt__15TAIAflickingMar@ha /* 801A6094 001A2FF4 90 03 00 04 */ stw r0, 4(r3) /* 801A6098 001A2FF8 38 04 EE 14 */ addi r0, r4, __vt__15TAIAflickingMar@l /* 801A609C 001A2FFC 80 61 00 94 */ lwz r3, 0x94(r1) /* 801A60A0 001A3000 90 03 00 04 */ stw r0, 4(r3) lbl_801A60A4: /* 801A60A4 001A3004 38 60 00 0C */ li r3, 0xc /* 801A60A8 001A3008 4B EA 0F 5D */ bl alloc__6SystemFUl /* 801A60AC 001A300C 39 E3 00 00 */ addi r15, r3, 0 /* 801A60B0 001A3010 7D E0 7B 79 */ or. r0, r15, r15 /* 801A60B4 001A3014 41 82 00 38 */ beq lbl_801A60EC /* 801A60B8 001A3018 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A60BC 001A301C 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A60C0 001A3020 90 0F 00 04 */ stw r0, 4(r15) /* 801A60C4 001A3024 38 00 00 07 */ li r0, 7 /* 801A60C8 001A3028 3C 60 80 2E */ lis r3, __vt__16TAIAstickingPiki@ha /* 801A60CC 001A302C 90 0F 00 00 */ stw r0, 0(r15) /* 801A60D0 001A3030 38 03 FE 20 */ addi r0, r3, __vt__16TAIAstickingPiki@l /* 801A60D4 001A3034 3C 60 80 2E */ lis r3, __vt__19TAIAstickingPikiMar@ha /* 801A60D8 001A3038 90 0F 00 04 */ stw r0, 4(r15) /* 801A60DC 001A303C 38 00 00 00 */ li r0, 0 /* 801A60E0 001A3040 38 63 EC 70 */ addi r3, r3, __vt__19TAIAstickingPikiMar@l /* 801A60E4 001A3044 90 0F 00 08 */ stw r0, 8(r15) /* 801A60E8 001A3048 90 6F 00 04 */ stw r3, 4(r15) lbl_801A60EC: /* 801A60EC 001A304C 38 60 00 08 */ li r3, 8 /* 801A60F0 001A3050 4B EA 0F 15 */ bl alloc__6SystemFUl /* 801A60F4 001A3054 90 61 00 90 */ stw r3, 0x90(r1) /* 801A60F8 001A3058 80 01 00 90 */ lwz r0, 0x90(r1) /* 801A60FC 001A305C 28 00 00 00 */ cmplwi r0, 0 /* 801A6100 001A3060 41 82 00 30 */ beq lbl_801A6130 /* 801A6104 001A3064 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A6108 001A3068 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A610C 001A306C 80 61 00 90 */ lwz r3, 0x90(r1) /* 801A6110 001A3070 3C 80 80 2E */ lis r4, __vt__14TAIAnoReaction@ha /* 801A6114 001A3074 90 03 00 04 */ stw r0, 4(r3) /* 801A6118 001A3078 38 00 00 0A */ li r0, 0xa /* 801A611C 001A307C 80 61 00 90 */ lwz r3, 0x90(r1) /* 801A6120 001A3080 90 03 00 00 */ stw r0, 0(r3) /* 801A6124 001A3084 38 04 DE E4 */ addi r0, r4, __vt__14TAIAnoReaction@l /* 801A6128 001A3088 80 61 00 90 */ lwz r3, 0x90(r1) /* 801A612C 001A308C 90 03 00 04 */ stw r0, 4(r3) lbl_801A6130: /* 801A6130 001A3090 38 60 00 0C */ li r3, 0xc /* 801A6134 001A3094 4B EA 0E D1 */ bl alloc__6SystemFUl /* 801A6138 001A3098 90 61 00 8C */ stw r3, 0x8c(r1) /* 801A613C 001A309C 80 61 00 8C */ lwz r3, 0x8c(r1) /* 801A6140 001A30A0 28 03 00 00 */ cmplwi r3, 0 /* 801A6144 001A30A4 41 82 00 30 */ beq lbl_801A6174 /* 801A6148 001A30A8 38 80 00 03 */ li r4, 3 /* 801A614C 001A30AC 38 A0 00 0A */ li r5, 0xa /* 801A6150 001A30B0 48 00 6B 91 */ bl __ct__17TAIAreserveMotionFii /* 801A6154 001A30B4 3C 60 80 2E */ lis r3, __vt__11TAIAtakeOff@ha /* 801A6158 001A30B8 38 03 F4 10 */ addi r0, r3, __vt__11TAIAtakeOff@l /* 801A615C 001A30BC 80 61 00 8C */ lwz r3, 0x8c(r1) /* 801A6160 001A30C0 3C 80 80 2E */ lis r4, __vt__14TAIAtakeOffMar@ha /* 801A6164 001A30C4 90 03 00 04 */ stw r0, 4(r3) /* 801A6168 001A30C8 38 04 EB D0 */ addi r0, r4, __vt__14TAIAtakeOffMar@l /* 801A616C 001A30CC 80 61 00 8C */ lwz r3, 0x8c(r1) /* 801A6170 001A30D0 90 03 00 04 */ stw r0, 4(r3) lbl_801A6174: /* 801A6174 001A30D4 38 60 00 0C */ li r3, 0xc /* 801A6178 001A30D8 4B EA 0E 8D */ bl alloc__6SystemFUl /* 801A617C 001A30DC 3A 43 00 00 */ addi r18, r3, 0 /* 801A6180 001A30E0 7E 40 93 79 */ or. r0, r18, r18 /* 801A6184 001A30E4 41 82 00 38 */ beq lbl_801A61BC /* 801A6188 001A30E8 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A618C 001A30EC 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A6190 001A30F0 90 12 00 04 */ stw r0, 4(r18) /* 801A6194 001A30F4 38 00 00 0A */ li r0, 0xa /* 801A6198 001A30F8 3C 60 80 2E */ lis r3, __vt__17TAIAtimerReaction@ha /* 801A619C 001A30FC 90 12 00 00 */ stw r0, 0(r18) /* 801A61A0 001A3100 38 03 EB 64 */ addi r0, r3, __vt__17TAIAtimerReaction@l /* 801A61A4 001A3104 3C 60 80 2E */ lis r3, __vt__19TAIAtimerTakeOffMar@ha /* 801A61A8 001A3108 90 12 00 04 */ stw r0, 4(r18) /* 801A61AC 001A310C 38 03 EB 44 */ addi r0, r3, __vt__19TAIAtimerTakeOffMar@l /* 801A61B0 001A3110 C0 02 B4 E0 */ lfs f0, lbl_803EB6E0@sda21(r2) /* 801A61B4 001A3114 D0 12 00 08 */ stfs f0, 8(r18) /* 801A61B8 001A3118 90 12 00 04 */ stw r0, 4(r18) lbl_801A61BC: /* 801A61BC 001A311C 38 60 00 08 */ li r3, 8 /* 801A61C0 001A3120 4B EA 0E 45 */ bl alloc__6SystemFUl /* 801A61C4 001A3124 3A 63 00 00 */ addi r19, r3, 0 /* 801A61C8 001A3128 7E 60 9B 79 */ or. r0, r19, r19 /* 801A61CC 001A312C 41 82 00 24 */ beq lbl_801A61F0 /* 801A61D0 001A3130 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A61D4 001A3134 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A61D8 001A3138 90 13 00 04 */ stw r0, 4(r19) /* 801A61DC 001A313C 38 00 00 0B */ li r0, 0xb /* 801A61E0 001A3140 3C 60 80 2E */ lis r3, __vt__15TAIAvisibleNavi@ha /* 801A61E4 001A3144 90 13 00 00 */ stw r0, 0(r19) /* 801A61E8 001A3148 38 03 FF 14 */ addi r0, r3, __vt__15TAIAvisibleNavi@l /* 801A61EC 001A314C 90 13 00 04 */ stw r0, 4(r19) lbl_801A61F0: /* 801A61F0 001A3150 38 60 00 08 */ li r3, 8 /* 801A61F4 001A3154 4B EA 0E 11 */ bl alloc__6SystemFUl /* 801A61F8 001A3158 3A A3 00 00 */ addi r21, r3, 0 /* 801A61FC 001A315C 7E A0 AB 79 */ or. r0, r21, r21 /* 801A6200 001A3160 41 82 00 24 */ beq lbl_801A6224 /* 801A6204 001A3164 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A6208 001A3168 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A620C 001A316C 90 15 00 04 */ stw r0, 4(r21) /* 801A6210 001A3170 38 00 00 0B */ li r0, 0xb /* 801A6214 001A3174 3C 60 80 2E */ lis r3, __vt__15TAIAvisiblePiki@ha /* 801A6218 001A3178 90 15 00 00 */ stw r0, 0(r21) /* 801A621C 001A317C 38 03 FE DC */ addi r0, r3, __vt__15TAIAvisiblePiki@l /* 801A6220 001A3180 90 15 00 04 */ stw r0, 4(r21) lbl_801A6224: /* 801A6224 001A3184 38 60 00 18 */ li r3, 0x18 /* 801A6228 001A3188 4B EA 0D DD */ bl alloc__6SystemFUl /* 801A622C 001A318C 3B A3 00 00 */ addi r29, r3, 0 /* 801A6230 001A3190 7F A0 EB 79 */ or. r0, r29, r29 /* 801A6234 001A3194 41 82 00 64 */ beq lbl_801A6298 /* 801A6238 001A3198 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A623C 001A319C 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A6240 001A31A0 90 1D 00 04 */ stw r0, 4(r29) /* 801A6244 001A31A4 38 00 00 0C */ li r0, 0xc /* 801A6248 001A31A8 3C 60 80 2E */ lis r3, __vt__14FlyingDistance@ha /* 801A624C 001A31AC 90 1D 00 00 */ stw r0, 0(r29) /* 801A6250 001A31B0 38 03 EA F0 */ addi r0, r3, __vt__14FlyingDistance@l /* 801A6254 001A31B4 3C 60 80 2E */ lis r3, __vt__18TAIAflyingDistance@ha /* 801A6258 001A31B8 90 1D 00 14 */ stw r0, 0x14(r29) /* 801A625C 001A31BC 38 63 F4 EC */ addi r3, r3, __vt__18TAIAflyingDistance@l /* 801A6260 001A31C0 3C 80 80 2E */ lis r4, __vt__21TAIAflyingDistanceMar@ha /* 801A6264 001A31C4 C0 02 B5 48 */ lfs f0, lbl_803EB748@sda21(r2) /* 801A6268 001A31C8 38 84 EA C0 */ addi r4, r4, __vt__21TAIAflyingDistanceMar@l /* 801A626C 001A31CC 38 A3 00 1C */ addi r5, r3, 0x1c /* 801A6270 001A31D0 D0 1D 00 08 */ stfs f0, 8(r29) /* 801A6274 001A31D4 38 04 00 1C */ addi r0, r4, 0x1c /* 801A6278 001A31D8 C0 02 B4 E0 */ lfs f0, lbl_803EB6E0@sda21(r2) /* 801A627C 001A31DC D0 1D 00 0C */ stfs f0, 0xc(r29) /* 801A6280 001A31E0 C0 02 B5 4C */ lfs f0, lbl_803EB74C@sda21(r2) /* 801A6284 001A31E4 D0 1D 00 10 */ stfs f0, 0x10(r29) /* 801A6288 001A31E8 90 7D 00 04 */ stw r3, 4(r29) /* 801A628C 001A31EC 90 BD 00 14 */ stw r5, 0x14(r29) /* 801A6290 001A31F0 90 9D 00 04 */ stw r4, 4(r29) /* 801A6294 001A31F4 90 1D 00 14 */ stw r0, 0x14(r29) lbl_801A6298: /* 801A6298 001A31F8 38 60 00 04 */ li r3, 4 /* 801A629C 001A31FC 4B EA 0D 69 */ bl alloc__6SystemFUl /* 801A62A0 001A3200 3B 63 00 00 */ addi r27, r3, 0 /* 801A62A4 001A3204 7F 60 DB 79 */ or. r0, r27, r27 /* 801A62A8 001A3208 41 82 00 1C */ beq lbl_801A62C4 /* 801A62AC 001A320C 3C 60 80 2E */ lis r3, "__vt__Q23zen17CallBack1<R4Teki>"@ha /* 801A62B0 001A3210 38 03 E0 DC */ addi r0, r3, "__vt__Q23zen17CallBack1<R4Teki>"@l /* 801A62B4 001A3214 3C 60 80 2E */ lis r3, __vt__12BreathEffect@ha /* 801A62B8 001A3218 90 1B 00 00 */ stw r0, 0(r27) /* 801A62BC 001A321C 38 03 EA 4C */ addi r0, r3, __vt__12BreathEffect@l /* 801A62C0 001A3220 90 1B 00 00 */ stw r0, 0(r27) lbl_801A62C4: /* 801A62C4 001A3224 38 60 00 10 */ li r3, 0x10 /* 801A62C8 001A3228 4B EA 0D 3D */ bl alloc__6SystemFUl /* 801A62CC 001A322C 90 61 00 88 */ stw r3, 0x88(r1) /* 801A62D0 001A3230 80 61 00 88 */ lwz r3, 0x88(r1) /* 801A62D4 001A3234 28 03 00 00 */ cmplwi r3, 0 /* 801A62D8 001A3238 41 82 00 38 */ beq lbl_801A6310 /* 801A62DC 001A323C 38 80 00 03 */ li r4, 3 /* 801A62E0 001A3240 38 A0 00 08 */ li r5, 8 /* 801A62E4 001A3244 48 00 69 FD */ bl __ct__17TAIAreserveMotionFii /* 801A62E8 001A3248 3C 60 80 2E */ lis r3, __vt__14TAIAfireBreath@ha /* 801A62EC 001A324C 38 03 04 10 */ addi r0, r3, __vt__14TAIAfireBreath@l /* 801A62F0 001A3250 80 61 00 88 */ lwz r3, 0x88(r1) /* 801A62F4 001A3254 90 03 00 04 */ stw r0, 4(r3) /* 801A62F8 001A3258 3C 60 80 2E */ lis r3, __vt__17TAIAfireBreathMar@ha /* 801A62FC 001A325C 38 03 E9 F4 */ addi r0, r3, __vt__17TAIAfireBreathMar@l /* 801A6300 001A3260 80 61 00 88 */ lwz r3, 0x88(r1) /* 801A6304 001A3264 93 63 00 0C */ stw r27, 0xc(r3) /* 801A6308 001A3268 80 61 00 88 */ lwz r3, 0x88(r1) /* 801A630C 001A326C 90 03 00 04 */ stw r0, 4(r3) lbl_801A6310: /* 801A6310 001A3270 38 60 00 08 */ li r3, 8 /* 801A6314 001A3274 4B EA 0C F1 */ bl alloc__6SystemFUl /* 801A6318 001A3278 39 C3 00 00 */ addi r14, r3, 0 /* 801A631C 001A327C 7D C0 73 79 */ or. r0, r14, r14 /* 801A6320 001A3280 41 82 00 24 */ beq lbl_801A6344 /* 801A6324 001A3284 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A6328 001A3288 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A632C 001A328C 90 0E 00 04 */ stw r0, 4(r14) /* 801A6330 001A3290 38 00 00 0D */ li r0, 0xd /* 801A6334 001A3294 3C 60 80 2E */ lis r3, __vt__20TAIAoutsideTerritory@ha /* 801A6338 001A3298 90 0E 00 00 */ stw r0, 0(r14) /* 801A633C 001A329C 38 03 DF 5C */ addi r0, r3, __vt__20TAIAoutsideTerritory@l /* 801A6340 001A32A0 90 0E 00 04 */ stw r0, 4(r14) lbl_801A6344: /* 801A6344 001A32A4 38 60 00 1C */ li r3, 0x1c /* 801A6348 001A32A8 4B EA 0C BD */ bl alloc__6SystemFUl /* 801A634C 001A32AC 3B 63 00 00 */ addi r27, r3, 0 /* 801A6350 001A32B0 7F 63 DB 79 */ or. r3, r27, r27 /* 801A6354 001A32B4 41 82 00 68 */ beq lbl_801A63BC /* 801A6358 001A32B8 38 80 00 03 */ li r4, 3 /* 801A635C 001A32BC 38 A0 00 06 */ li r5, 6 /* 801A6360 001A32C0 48 00 69 81 */ bl __ct__17TAIAreserveMotionFii /* 801A6364 001A32C4 3C 60 80 2E */ lis r3, __vt__16TAIAflyingToGoal@ha /* 801A6368 001A32C8 38 03 F5 B4 */ addi r0, r3, __vt__16TAIAflyingToGoal@l /* 801A636C 001A32CC 3C 60 80 2E */ lis r3, __vt__14FlyingDistance@ha /* 801A6370 001A32D0 90 1B 00 04 */ stw r0, 4(r27) /* 801A6374 001A32D4 38 03 EA F0 */ addi r0, r3, __vt__14FlyingDistance@l /* 801A6378 001A32D8 90 1B 00 18 */ stw r0, 0x18(r27) /* 801A637C 001A32DC 3C 60 80 2E */ lis r3, __vt__29TAIAflyingDistanceInTerritory@ha /* 801A6380 001A32E0 38 63 F5 84 */ addi r3, r3, __vt__29TAIAflyingDistanceInTerritory@l /* 801A6384 001A32E4 C0 02 B5 48 */ lfs f0, lbl_803EB748@sda21(r2) /* 801A6388 001A32E8 3C 80 80 2E */ lis r4, __vt__32TAIAflyingDistanceInTerritoryMar@ha /* 801A638C 001A32EC 38 84 E9 2C */ addi r4, r4, __vt__32TAIAflyingDistanceInTerritoryMar@l /* 801A6390 001A32F0 D0 1B 00 0C */ stfs f0, 0xc(r27) /* 801A6394 001A32F4 38 A3 00 24 */ addi r5, r3, 0x24 /* 801A6398 001A32F8 38 04 00 24 */ addi r0, r4, 0x24 /* 801A639C 001A32FC C0 02 B4 E0 */ lfs f0, lbl_803EB6E0@sda21(r2) /* 801A63A0 001A3300 D0 1B 00 10 */ stfs f0, 0x10(r27) /* 801A63A4 001A3304 C0 02 B5 50 */ lfs f0, lbl_803EB750@sda21(r2) /* 801A63A8 001A3308 D0 1B 00 14 */ stfs f0, 0x14(r27) /* 801A63AC 001A330C 90 7B 00 04 */ stw r3, 4(r27) /* 801A63B0 001A3310 90 BB 00 18 */ stw r5, 0x18(r27) /* 801A63B4 001A3314 90 9B 00 04 */ stw r4, 4(r27) /* 801A63B8 001A3318 90 1B 00 18 */ stw r0, 0x18(r27) lbl_801A63BC: /* 801A63BC 001A331C 38 60 00 0C */ li r3, 0xc /* 801A63C0 001A3320 4B EA 0C 45 */ bl alloc__6SystemFUl /* 801A63C4 001A3324 3A E3 00 00 */ addi r23, r3, 0 /* 801A63C8 001A3328 7E E0 BB 79 */ or. r0, r23, r23 /* 801A63CC 001A332C 41 82 00 2C */ beq lbl_801A63F8 /* 801A63D0 001A3330 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A63D4 001A3334 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A63D8 001A3338 90 17 00 04 */ stw r0, 4(r23) /* 801A63DC 001A333C 38 00 00 0E */ li r0, 0xe /* 801A63E0 001A3340 3C 60 80 2E */ lis r3, __vt__14TAIAflickCheck@ha /* 801A63E4 001A3344 90 17 00 00 */ stw r0, 0(r23) /* 801A63E8 001A3348 38 63 03 CC */ addi r3, r3, __vt__14TAIAflickCheck@l /* 801A63EC 001A334C 38 00 00 01 */ li r0, 1 /* 801A63F0 001A3350 90 77 00 04 */ stw r3, 4(r23) /* 801A63F4 001A3354 90 17 00 08 */ stw r0, 8(r23) lbl_801A63F8: /* 801A63F8 001A3358 38 60 00 08 */ li r3, 8 /* 801A63FC 001A335C 4B EA 0C 09 */ bl alloc__6SystemFUl /* 801A6400 001A3360 3A C3 00 00 */ addi r22, r3, 0 /* 801A6404 001A3364 7E C0 B3 79 */ or. r0, r22, r22 /* 801A6408 001A3368 41 82 00 24 */ beq lbl_801A642C /* 801A640C 001A336C 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A6410 001A3370 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A6414 001A3374 90 16 00 04 */ stw r0, 4(r22) /* 801A6418 001A3378 38 00 00 0B */ li r0, 0xb /* 801A641C 001A337C 3C 60 80 2E */ lis r3, __vt__13TAIAwatchNavi@ha /* 801A6420 001A3380 90 16 00 00 */ stw r0, 0(r22) /* 801A6424 001A3384 38 03 E8 24 */ addi r0, r3, __vt__13TAIAwatchNavi@l /* 801A6428 001A3388 90 16 00 04 */ stw r0, 4(r22) lbl_801A642C: /* 801A642C 001A338C 38 60 00 08 */ li r3, 8 /* 801A6430 001A3390 4B EA 0B D5 */ bl alloc__6SystemFUl /* 801A6434 001A3394 3B 83 00 00 */ addi r28, r3, 0 /* 801A6438 001A3398 7F 80 E3 79 */ or. r0, r28, r28 /* 801A643C 001A339C 41 82 00 24 */ beq lbl_801A6460 /* 801A6440 001A33A0 3C 60 80 2C */ lis r3, __vt__9TaiAction@ha /* 801A6444 001A33A4 38 03 66 20 */ addi r0, r3, __vt__9TaiAction@l /* 801A6448 001A33A8 90 1C 00 04 */ stw r0, 4(r28) /* 801A644C 001A33AC 38 00 00 03 */ li r0, 3 /* 801A6450 001A33B0 3C 60 80 2E */ lis r3, __vt__11TAIAinitMar@ha /* 801A6454 001A33B4 90 1C 00 00 */ stw r0, 0(r28) /* 801A6458 001A33B8 38 03 E7 EC */ addi r0, r3, __vt__11TAIAinitMar@l /* 801A645C 001A33BC 90 1C 00 04 */ stw r0, 4(r28) lbl_801A6460: /* 801A6460 001A33C0 38 60 00 0C */ li r3, 0xc /* 801A6464 001A33C4 4B EA 0B A1 */ bl alloc__6SystemFUl /* 801A6468 001A33C8 3B 03 00 00 */ addi r24, r3, 0 /* 801A646C 001A33CC 7F 03 C3 79 */ or. r3, r24, r24 /* 801A6470 001A33D0 41 82 00 0C */ beq lbl_801A647C /* 801A6474 001A33D4 38 80 00 02 */ li r4, 2 /* 801A6478 001A33D8 4B F8 0C 21 */ bl __ct__8TaiStateFi lbl_801A647C: /* 801A647C 001A33DC 38 00 00 00 */ li r0, 0 /* 801A6480 001A33E0 80 98 00 08 */ lwz r4, 8(r24) /* 801A6484 001A33E4 54 03 10 3A */ slwi r3, r0, 2 /* 801A6488 001A33E8 80 01 00 B8 */ lwz r0, 0xb8(r1) /* 801A648C 001A33EC 7C 04 19 2E */ stwx r0, r4, r3 /* 801A6490 001A33F0 38 00 00 01 */ li r0, 1 /* 801A6494 001A33F4 54 04 10 3A */ slwi r4, r0, 2 /* 801A6498 001A33F8 80 01 00 B0 */ lwz r0, 0xb0(r1) /* 801A649C 001A33FC 80 B8 00 08 */ lwz r5, 8(r24) /* 801A64A0 001A3400 38 60 00 0C */ li r3, 0xc /* 801A64A4 001A3404 7C 05 21 2E */ stwx r0, r5, r4 /* 801A64A8 001A3408 80 9F 00 08 */ lwz r4, 8(r31) /* 801A64AC 001A340C 93 04 00 00 */ stw r24, 0(r4) /* 801A64B0 001A3410 4B EA 0B 55 */ bl alloc__6SystemFUl /* 801A64B4 001A3414 3B 03 00 00 */ addi r24, r3, 0 /* 801A64B8 001A3418 7F 03 C3 79 */ or. r3, r24, r24 /* 801A64BC 001A341C 41 82 00 0C */ beq lbl_801A64C8 /* 801A64C0 001A3420 38 80 00 02 */ li r4, 2 /* 801A64C4 001A3424 4B F8 0B D5 */ bl __ct__8TaiStateFi lbl_801A64C8: /* 801A64C8 001A3428 38 00 00 00 */ li r0, 0 /* 801A64CC 001A342C 80 98 00 08 */ lwz r4, 8(r24) /* 801A64D0 001A3430 54 03 10 3A */ slwi r3, r0, 2 /* 801A64D4 001A3434 80 01 00 B4 */ lwz r0, 0xb4(r1) /* 801A64D8 001A3438 7C 04 19 2E */ stwx r0, r4, r3 /* 801A64DC 001A343C 38 00 00 01 */ li r0, 1 /* 801A64E0 001A3440 54 04 10 3A */ slwi r4, r0, 2 /* 801A64E4 001A3444 80 01 00 B0 */ lwz r0, 0xb0(r1) /* 801A64E8 001A3448 80 B8 00 08 */ lwz r5, 8(r24) /* 801A64EC 001A344C 38 60 00 0C */ li r3, 0xc /* 801A64F0 001A3450 7C 05 21 2E */ stwx r0, r5, r4 /* 801A64F4 001A3454 80 9F 00 08 */ lwz r4, 8(r31) /* 801A64F8 001A3458 93 04 00 04 */ stw r24, 4(r4) /* 801A64FC 001A345C 4B EA 0B 09 */ bl alloc__6SystemFUl /* 801A6500 001A3460 3B 03 00 00 */ addi r24, r3, 0 /* 801A6504 001A3464 7F 03 C3 79 */ or. r3, r24, r24 /* 801A6508 001A3468 41 82 00 0C */ beq lbl_801A6514 /* 801A650C 001A346C 38 80 00 01 */ li r4, 1 /* 801A6510 001A3470 4B F8 0B 89 */ bl __ct__8TaiStateFi lbl_801A6514: /* 801A6514 001A3474 38 00 00 00 */ li r0, 0 /* 801A6518 001A3478 80 78 00 08 */ lwz r3, 8(r24) /* 801A651C 001A347C 54 00 10 3A */ slwi r0, r0, 2 /* 801A6520 001A3480 7F 83 01 2E */ stwx r28, r3, r0 /* 801A6524 001A3484 38 60 00 0C */ li r3, 0xc /* 801A6528 001A3488 80 9F 00 08 */ lwz r4, 8(r31) /* 801A652C 001A348C 93 04 00 08 */ stw r24, 8(r4) /* 801A6530 001A3490 4B EA 0A D5 */ bl alloc__6SystemFUl /* 801A6534 001A3494 3B 83 00 00 */ addi r28, r3, 0 /* 801A6538 001A3498 7F 83 E3 79 */ or. r3, r28, r28 /* 801A653C 001A349C 41 82 00 0C */ beq lbl_801A6548 /* 801A6540 001A34A0 38 80 00 09 */ li r4, 9 /* 801A6544 001A34A4 4B F8 0B 55 */ bl __ct__8TaiStateFi lbl_801A6548: /* 801A6548 001A34A8 38 00 00 00 */ li r0, 0 /* 801A654C 001A34AC 80 7C 00 08 */ lwz r3, 8(r28) /* 801A6550 001A34B0 54 04 10 3A */ slwi r4, r0, 2 /* 801A6554 001A34B4 80 01 00 BC */ lwz r0, 0xbc(r1) /* 801A6558 001A34B8 38 A0 00 03 */ li r5, 3 /* 801A655C 001A34BC 7C 03 21 2E */ stwx r0, r3, r4 /* 801A6560 001A34C0 38 80 00 01 */ li r4, 1 /* 801A6564 001A34C4 38 00 00 02 */ li r0, 2 /* 801A6568 001A34C8 80 7C 00 08 */ lwz r3, 8(r28) /* 801A656C 001A34CC 54 84 10 3A */ slwi r4, r4, 2 /* 801A6570 001A34D0 39 00 00 04 */ li r8, 4 /* 801A6574 001A34D4 7F 43 21 2E */ stwx r26, r3, r4 /* 801A6578 001A34D8 38 C0 00 06 */ li r6, 6 /* 801A657C 001A34DC 54 00 10 3A */ slwi r0, r0, 2 /* 801A6580 001A34E0 80 7C 00 08 */ lwz r3, 8(r28) /* 801A6584 001A34E4 54 A5 10 3A */ slwi r5, r5, 2 /* 801A6588 001A34E8 55 08 10 3A */ slwi r8, r8, 2 /* 801A658C 001A34EC 7F 23 01 2E */ stwx r25, r3, r0 /* 801A6590 001A34F0 38 E0 00 05 */ li r7, 5 /* 801A6594 001A34F4 38 00 00 07 */ li r0, 7 /* 801A6598 001A34F8 80 7C 00 08 */ lwz r3, 8(r28) /* 801A659C 001A34FC 38 80 00 08 */ li r4, 8 /* 801A65A0 001A3500 54 C6 10 3A */ slwi r6, r6, 2 /* 801A65A4 001A3504 7E 03 29 2E */ stwx r16, r3, r5 /* 801A65A8 001A3508 54 E5 10 3A */ slwi r5, r7, 2 /* 801A65AC 001A350C 54 07 10 3A */ slwi r7, r0, 2 /* 801A65B0 001A3510 80 7C 00 08 */ lwz r3, 8(r28) /* 801A65B4 001A3514 54 80 10 3A */ slwi r0, r4, 2 /* 801A65B8 001A3518 7F C3 41 2E */ stwx r30, r3, r8 /* 801A65BC 001A351C 38 60 00 0C */ li r3, 0xc /* 801A65C0 001A3520 80 9C 00 08 */ lwz r4, 8(r28) /* 801A65C4 001A3524 7E A4 29 2E */ stwx r21, r4, r5 /* 801A65C8 001A3528 80 A1 00 AC */ lwz r5, 0xac(r1) /* 801A65CC 001A352C 80 9C 00 08 */ lwz r4, 8(r28) /* 801A65D0 001A3530 7E 64 31 2E */ stwx r19, r4, r6 /* 801A65D4 001A3534 80 9C 00 08 */ lwz r4, 8(r28) /* 801A65D8 001A3538 7E E4 39 2E */ stwx r23, r4, r7 /* 801A65DC 001A353C 80 9C 00 08 */ lwz r4, 8(r28) /* 801A65E0 001A3540 7C A4 01 2E */ stwx r5, r4, r0 /* 801A65E4 001A3544 80 9F 00 08 */ lwz r4, 8(r31) /* 801A65E8 001A3548 93 84 00 0C */ stw r28, 0xc(r4) /* 801A65EC 001A354C 4B EA 0A 19 */ bl alloc__6SystemFUl /* 801A65F0 001A3550 3B 03 00 00 */ addi r24, r3, 0 /* 801A65F4 001A3554 7F 03 C3 79 */ or. r3, r24, r24 /* 801A65F8 001A3558 41 82 00 0C */ beq lbl_801A6604 /* 801A65FC 001A355C 38 80 00 01 */ li r4, 1 /* 801A6600 001A3560 4B F8 0A 99 */ bl __ct__8TaiStateFi lbl_801A6604: /* 801A6604 001A3564 38 00 00 00 */ li r0, 0 /* 801A6608 001A3568 80 78 00 08 */ lwz r3, 8(r24) /* 801A660C 001A356C 54 00 10 3A */ slwi r0, r0, 2 /* 801A6610 001A3570 7E C3 01 2E */ stwx r22, r3, r0 /* 801A6614 001A3574 38 60 00 0C */ li r3, 0xc /* 801A6618 001A3578 80 9F 00 08 */ lwz r4, 8(r31) /* 801A661C 001A357C 93 04 00 38 */ stw r24, 0x38(r4) /* 801A6620 001A3580 4B EA 09 E5 */ bl alloc__6SystemFUl /* 801A6624 001A3584 3B 83 00 00 */ addi r28, r3, 0 /* 801A6628 001A3588 7F 83 E3 79 */ or. r3, r28, r28 /* 801A662C 001A358C 41 82 00 0C */ beq lbl_801A6638 /* 801A6630 001A3590 38 80 00 04 */ li r4, 4 /* 801A6634 001A3594 4B F8 0A 65 */ bl __ct__8TaiStateFi lbl_801A6638: /* 801A6638 001A3598 38 00 00 00 */ li r0, 0 /* 801A663C 001A359C 80 7C 00 08 */ lwz r3, 8(r28) /* 801A6640 001A35A0 54 04 10 3A */ slwi r4, r0, 2 /* 801A6644 001A35A4 80 01 00 BC */ lwz r0, 0xbc(r1) /* 801A6648 001A35A8 38 A0 00 02 */ li r5, 2 /* 801A664C 001A35AC 7C 03 21 2E */ stwx r0, r3, r4 /* 801A6650 001A35B0 38 00 00 01 */ li r0, 1 /* 801A6654 001A35B4 54 03 10 3A */ slwi r3, r0, 2 /* 801A6658 001A35B8 80 9C 00 08 */ lwz r4, 8(r28) /* 801A665C 001A35BC 38 00 00 03 */ li r0, 3 /* 801A6660 001A35C0 54 A5 10 3A */ slwi r5, r5, 2 /* 801A6664 001A35C4 7F C4 19 2E */ stwx r30, r4, r3 /* 801A6668 001A35C8 54 04 10 3A */ slwi r4, r0, 2 /* 801A666C 001A35CC 80 01 00 A4 */ lwz r0, 0xa4(r1) /* 801A6670 001A35D0 38 60 00 0C */ li r3, 0xc /* 801A6674 001A35D4 80 DC 00 08 */ lwz r6, 8(r28) /* 801A6678 001A35D8 7C 06 29 2E */ stwx r0, r6, r5 /* 801A667C 001A35DC 80 BC 00 08 */ lwz r5, 8(r28) /* 801A6680 001A35E0 7F 45 21 2E */ stwx r26, r5, r4 /* 801A6684 001A35E4 80 9F 00 08 */ lwz r4, 8(r31) /* 801A6688 001A35E8 93 84 00 10 */ stw r28, 0x10(r4) /* 801A668C 001A35EC 4B EA 09 79 */ bl alloc__6SystemFUl /* 801A6690 001A35F0 3B 23 00 00 */ addi r25, r3, 0 /* 801A6694 001A35F4 7F 23 CB 79 */ or. r3, r25, r25 /* 801A6698 001A35F8 41 82 00 0C */ beq lbl_801A66A4 /* 801A669C 001A35FC 38 80 00 03 */ li r4, 3 /* 801A66A0 001A3600 4B F8 09 F9 */ bl __ct__8TaiStateFi lbl_801A66A4: /* 801A66A4 001A3604 38 00 00 00 */ li r0, 0 /* 801A66A8 001A3608 80 79 00 08 */ lwz r3, 8(r25) /* 801A66AC 001A360C 54 04 10 3A */ slwi r4, r0, 2 /* 801A66B0 001A3610 80 01 00 BC */ lwz r0, 0xbc(r1) /* 801A66B4 001A3614 7C 03 21 2E */ stwx r0, r3, r4 /* 801A66B8 001A3618 38 80 00 01 */ li r4, 1 /* 801A66BC 001A361C 38 00 00 02 */ li r0, 2 /* 801A66C0 001A3620 54 85 10 3A */ slwi r5, r4, 2 /* 801A66C4 001A3624 80 79 00 08 */ lwz r3, 8(r25) /* 801A66C8 001A3628 54 04 10 3A */ slwi r4, r0, 2 /* 801A66CC 001A362C 80 01 00 A0 */ lwz r0, 0xa0(r1) /* 801A66D0 001A3630 7C 03 29 2E */ stwx r0, r3, r5 /* 801A66D4 001A3634 38 60 00 0C */ li r3, 0xc /* 801A66D8 001A3638 80 B9 00 08 */ lwz r5, 8(r25) /* 801A66DC 001A363C 7F C5 21 2E */ stwx r30, r5, r4 /* 801A66E0 001A3640 80 9F 00 08 */ lwz r4, 8(r31) /* 801A66E4 001A3644 93 24 00 14 */ stw r25, 0x14(r4) /* 801A66E8 001A3648 4B EA 09 1D */ bl alloc__6SystemFUl /* 801A66EC 001A364C 3B 03 00 00 */ addi r24, r3, 0 /* 801A66F0 001A3650 7F 03 C3 79 */ or. r3, r24, r24 /* 801A66F4 001A3654 41 82 00 0C */ beq lbl_801A6700 /* 801A66F8 001A3658 38 80 00 01 */ li r4, 1 /* 801A66FC 001A365C 4B F8 09 9D */ bl __ct__8TaiStateFi lbl_801A6700: /* 801A6700 001A3660 38 00 00 00 */ li r0, 0 /* 801A6704 001A3664 80 78 00 08 */ lwz r3, 8(r24) /* 801A6708 001A3668 54 04 10 3A */ slwi r4, r0, 2 /* 801A670C 001A366C 80 01 00 9C */ lwz r0, 0x9c(r1) /* 801A6710 001A3670 7C 03 21 2E */ stwx r0, r3, r4 /* 801A6714 001A3674 38 60 00 0C */ li r3, 0xc /* 801A6718 001A3678 80 9F 00 08 */ lwz r4, 8(r31) /* 801A671C 001A367C 93 04 00 18 */ stw r24, 0x18(r4) /* 801A6720 001A3680 4B EA 08 E5 */ bl alloc__6SystemFUl /* 801A6724 001A3684 3B 83 00 00 */ addi r28, r3, 0 /* 801A6728 001A3688 7F 83 E3 79 */ or. r3, r28, r28 /* 801A672C 001A368C 41 82 00 0C */ beq lbl_801A6738 /* 801A6730 001A3690 38 80 00 05 */ li r4, 5 /* 801A6734 001A3694 4B F8 09 65 */ bl __ct__8TaiStateFi lbl_801A6738: /* 801A6738 001A3698 38 00 00 00 */ li r0, 0 /* 801A673C 001A369C 80 7C 00 08 */ lwz r3, 8(r28) /* 801A6740 001A36A0 54 00 10 3A */ slwi r0, r0, 2 /* 801A6744 001A36A4 7E 83 01 2E */ stwx r20, r3, r0 /* 801A6748 001A36A8 38 00 00 01 */ li r0, 1 /* 801A674C 001A36AC 38 80 00 02 */ li r4, 2 /* 801A6750 001A36B0 80 7C 00 08 */ lwz r3, 8(r28) /* 801A6754 001A36B4 54 00 10 3A */ slwi r0, r0, 2 /* 801A6758 001A36B8 38 A0 00 03 */ li r5, 3 /* 801A675C 001A36BC 7F C3 01 2E */ stwx r30, r3, r0 /* 801A6760 001A36C0 38 00 00 04 */ li r0, 4 /* 801A6764 001A36C4 54 84 10 3A */ slwi r4, r4, 2 /* 801A6768 001A36C8 80 7C 00 08 */ lwz r3, 8(r28) /* 801A676C 001A36CC 54 A5 10 3A */ slwi r5, r5, 2 /* 801A6770 001A36D0 54 00 10 3A */ slwi r0, r0, 2 /* 801A6774 001A36D4 7E 43 21 2E */ stwx r18, r3, r4 /* 801A6778 001A36D8 38 60 00 0C */ li r3, 0xc /* 801A677C 001A36DC 80 9C 00 08 */ lwz r4, 8(r28) /* 801A6780 001A36E0 7E 24 29 2E */ stwx r17, r4, r5 /* 801A6784 001A36E4 80 A1 00 98 */ lwz r5, 0x98(r1) /* 801A6788 001A36E8 80 9C 00 08 */ lwz r4, 8(r28) /* 801A678C 001A36EC 7C A4 01 2E */ stwx r5, r4, r0 /* 801A6790 001A36F0 80 9F 00 08 */ lwz r4, 8(r31) /* 801A6794 001A36F4 93 84 00 1C */ stw r28, 0x1c(r4) /* 801A6798 001A36F8 4B EA 08 6D */ bl alloc__6SystemFUl /* 801A679C 001A36FC 3B 23 00 00 */ addi r25, r3, 0 /* 801A67A0 001A3700 7F 23 CB 79 */ or. r3, r25, r25 /* 801A67A4 001A3704 41 82 00 0C */ beq lbl_801A67B0 /* 801A67A8 001A3708 38 80 00 03 */ li r4, 3 /* 801A67AC 001A370C 4B F8 08 ED */ bl __ct__8TaiStateFi lbl_801A67B0: /* 801A67B0 001A3710 38 00 00 00 */ li r0, 0 /* 801A67B4 001A3714 80 79 00 08 */ lwz r3, 8(r25) /* 801A67B8 001A3718 54 00 10 3A */ slwi r0, r0, 2 /* 801A67BC 001A371C 7E 83 01 2E */ stwx r20, r3, r0 /* 801A67C0 001A3720 38 00 00 01 */ li r0, 1 /* 801A67C4 001A3724 38 80 00 02 */ li r4, 2 /* 801A67C8 001A3728 80 79 00 08 */ lwz r3, 8(r25) /* 801A67CC 001A372C 54 00 10 3A */ slwi r0, r0, 2 /* 801A67D0 001A3730 54 85 10 3A */ slwi r5, r4, 2 /* 801A67D4 001A3734 7F C3 01 2E */ stwx r30, r3, r0 /* 801A67D8 001A3738 38 60 00 0C */ li r3, 0xc /* 801A67DC 001A373C 80 01 00 94 */ lwz r0, 0x94(r1) /* 801A67E0 001A3740 80 99 00 08 */ lwz r4, 8(r25) /* 801A67E4 001A3744 7C 04 29 2E */ stwx r0, r4, r5 /* 801A67E8 001A3748 80 9F 00 08 */ lwz r4, 8(r31) /* 801A67EC 001A374C 93 24 00 20 */ stw r25, 0x20(r4) /* 801A67F0 001A3750 4B EA 08 15 */ bl alloc__6SystemFUl /* 801A67F4 001A3754 3B 23 00 00 */ addi r25, r3, 0 /* 801A67F8 001A3758 7F 23 CB 79 */ or. r3, r25, r25 /* 801A67FC 001A375C 41 82 00 0C */ beq lbl_801A6808 /* 801A6800 001A3760 38 80 00 02 */ li r4, 2 /* 801A6804 001A3764 4B F8 08 95 */ bl __ct__8TaiStateFi lbl_801A6808: /* 801A6808 001A3768 38 00 00 00 */ li r0, 0 /* 801A680C 001A376C 80 79 00 08 */ lwz r3, 8(r25) /* 801A6810 001A3770 54 00 10 3A */ slwi r0, r0, 2 /* 801A6814 001A3774 7D E3 01 2E */ stwx r15, r3, r0 /* 801A6818 001A3778 38 00 00 01 */ li r0, 1 /* 801A681C 001A377C 54 05 10 3A */ slwi r5, r0, 2 /* 801A6820 001A3780 80 01 00 90 */ lwz r0, 0x90(r1) /* 801A6824 001A3784 80 99 00 08 */ lwz r4, 8(r25) /* 801A6828 001A3788 38 60 00 0C */ li r3, 0xc /* 801A682C 001A378C 7C 04 29 2E */ stwx r0, r4, r5 /* 801A6830 001A3790 80 9F 00 08 */ lwz r4, 8(r31) /* 801A6834 001A3794 93 24 00 24 */ stw r25, 0x24(r4) /* 801A6838 001A3798 4B EA 07 CD */ bl alloc__6SystemFUl /* 801A683C 001A379C 3B 03 00 00 */ addi r24, r3, 0 /* 801A6840 001A37A0 7F 03 C3 79 */ or. r3, r24, r24 /* 801A6844 001A37A4 41 82 00 0C */ beq lbl_801A6850 /* 801A6848 001A37A8 38 80 00 01 */ li r4, 1 /* 801A684C 001A37AC 4B F8 08 4D */ bl __ct__8TaiStateFi lbl_801A6850: /* 801A6850 001A37B0 38 00 00 00 */ li r0, 0 /* 801A6854 001A37B4 80 78 00 08 */ lwz r3, 8(r24) /* 801A6858 001A37B8 54 04 10 3A */ slwi r4, r0, 2 /* 801A685C 001A37BC 80 01 00 8C */ lwz r0, 0x8c(r1) /* 801A6860 001A37C0 7C 03 21 2E */ stwx r0, r3, r4 /* 801A6864 001A37C4 38 60 00 0C */ li r3, 0xc /* 801A6868 001A37C8 80 9F 00 08 */ lwz r4, 8(r31) /* 801A686C 001A37CC 93 04 00 28 */ stw r24, 0x28(r4) /* 801A6870 001A37D0 4B EA 07 95 */ bl alloc__6SystemFUl /* 801A6874 001A37D4 3B 83 00 00 */ addi r28, r3, 0 /* 801A6878 001A37D8 7F 83 E3 79 */ or. r3, r28, r28 /* 801A687C 001A37DC 41 82 00 0C */ beq lbl_801A6888 /* 801A6880 001A37E0 38 80 00 07 */ li r4, 7 /* 801A6884 001A37E4 4B F8 08 15 */ bl __ct__8TaiStateFi lbl_801A6888: /* 801A6888 001A37E8 38 00 00 00 */ li r0, 0 /* 801A688C 001A37EC 80 7C 00 08 */ lwz r3, 8(r28) /* 801A6890 001A37F0 54 00 10 3A */ slwi r0, r0, 2 /* 801A6894 001A37F4 7E 83 01 2E */ stwx r20, r3, r0 /* 801A6898 001A37F8 38 80 00 01 */ li r4, 1 /* 801A689C 001A37FC 54 85 10 3A */ slwi r5, r4, 2 /* 801A68A0 001A3800 80 7C 00 08 */ lwz r3, 8(r28) /* 801A68A4 001A3804 38 00 00 02 */ li r0, 2 /* 801A68A8 001A3808 54 06 10 3A */ slwi r6, r0, 2 /* 801A68AC 001A380C 7F A3 29 2E */ stwx r29, r3, r5 /* 801A68B0 001A3810 38 80 00 03 */ li r4, 3 /* 801A68B4 001A3814 38 00 00 06 */ li r0, 6 /* 801A68B8 001A3818 80 7C 00 08 */ lwz r3, 8(r28) /* 801A68BC 001A381C 54 84 10 3A */ slwi r4, r4, 2 /* 801A68C0 001A3820 38 A0 00 04 */ li r5, 4 /* 801A68C4 001A3824 7F 43 31 2E */ stwx r26, r3, r6 /* 801A68C8 001A3828 54 A6 10 3A */ slwi r6, r5, 2 /* 801A68CC 001A382C 38 E0 00 05 */ li r7, 5 /* 801A68D0 001A3830 80 7C 00 08 */ lwz r3, 8(r28) /* 801A68D4 001A3834 54 E5 10 3A */ slwi r5, r7, 2 /* 801A68D8 001A3838 54 00 10 3A */ slwi r0, r0, 2 /* 801A68DC 001A383C 7E 03 21 2E */ stwx r16, r3, r4 /* 801A68E0 001A3840 38 60 00 0C */ li r3, 0xc /* 801A68E4 001A3844 80 9C 00 08 */ lwz r4, 8(r28) /* 801A68E8 001A3848 7F C4 31 2E */ stwx r30, r4, r6 /* 801A68EC 001A384C 80 C1 00 A8 */ lwz r6, 0xa8(r1) /* 801A68F0 001A3850 80 9C 00 08 */ lwz r4, 8(r28) /* 801A68F4 001A3854 7C C4 29 2E */ stwx r6, r4, r5 /* 801A68F8 001A3858 80 9C 00 08 */ lwz r4, 8(r28) /* 801A68FC 001A385C 7D C4 01 2E */ stwx r14, r4, r0 /* 801A6900 001A3860 80 9F 00 08 */ lwz r4, 8(r31) /* 801A6904 001A3864 93 84 00 2C */ stw r28, 0x2c(r4) /* 801A6908 001A3868 4B EA 06 FD */ bl alloc__6SystemFUl /* 801A690C 001A386C 3B 83 00 00 */ addi r28, r3, 0 /* 801A6910 001A3870 7F 83 E3 79 */ or. r3, r28, r28 /* 801A6914 001A3874 41 82 00 0C */ beq lbl_801A6920 /* 801A6918 001A3878 38 80 00 05 */ li r4, 5 /* 801A691C 001A387C 4B F8 07 7D */ bl __ct__8TaiStateFi lbl_801A6920: /* 801A6920 001A3880 38 00 00 00 */ li r0, 0 /* 801A6924 001A3884 80 7C 00 08 */ lwz r3, 8(r28) /* 801A6928 001A3888 54 00 10 3A */ slwi r0, r0, 2 /* 801A692C 001A388C 7E 83 01 2E */ stwx r20, r3, r0 /* 801A6930 001A3890 38 00 00 01 */ li r0, 1 /* 801A6934 001A3894 38 A0 00 02 */ li r5, 2 /* 801A6938 001A3898 80 7C 00 08 */ lwz r3, 8(r28) /* 801A693C 001A389C 54 00 10 3A */ slwi r0, r0, 2 /* 801A6940 001A38A0 54 A6 10 3A */ slwi r6, r5, 2 /* 801A6944 001A38A4 80 A1 00 B0 */ lwz r5, 0xb0(r1) /* 801A6948 001A38A8 7F C3 01 2E */ stwx r30, r3, r0 /* 801A694C 001A38AC 38 80 00 03 */ li r4, 3 /* 801A6950 001A38B0 80 7C 00 08 */ lwz r3, 8(r28) /* 801A6954 001A38B4 38 00 00 04 */ li r0, 4 /* 801A6958 001A38B8 54 84 10 3A */ slwi r4, r4, 2 /* 801A695C 001A38BC 7C A3 31 2E */ stwx r5, r3, r6 /* 801A6960 001A38C0 54 00 10 3A */ slwi r0, r0, 2 /* 801A6964 001A38C4 80 C1 00 88 */ lwz r6, 0x88(r1) /* 801A6968 001A38C8 38 60 00 0C */ li r3, 0xc /* 801A696C 001A38CC 80 BC 00 08 */ lwz r5, 8(r28) /* 801A6970 001A38D0 7C C5 21 2E */ stwx r6, r5, r4 /* 801A6974 001A38D4 80 9C 00 08 */ lwz r4, 8(r28) /* 801A6978 001A38D8 7F 44 01 2E */ stwx r26, r4, r0 /* 801A697C 001A38DC 80 9F 00 08 */ lwz r4, 8(r31) /* 801A6980 001A38E0 93 84 00 30 */ stw r28, 0x30(r4) /* 801A6984 001A38E4 4B EA 06 81 */ bl alloc__6SystemFUl /* 801A6988 001A38E8 3B 83 00 00 */ addi r28, r3, 0 /* 801A698C 001A38EC 7F 83 E3 79 */ or. r3, r28, r28 /* 801A6990 001A38F0 41 82 00 0C */ beq lbl_801A699C /* 801A6994 001A38F4 38 80 00 06 */ li r4, 6 /* 801A6998 001A38F8 4B F8 07 01 */ bl __ct__8TaiStateFi lbl_801A699C: /* 801A699C 001A38FC 38 00 00 00 */ li r0, 0 /* 801A69A0 001A3900 80 7C 00 08 */ lwz r3, 8(r28) /* 801A69A4 001A3904 54 00 10 3A */ slwi r0, r0, 2 /* 801A69A8 001A3908 7E 83 01 2E */ stwx r20, r3, r0 /* 801A69AC 001A390C 38 00 00 01 */ li r0, 1 /* 801A69B0 001A3910 54 04 10 3A */ slwi r4, r0, 2 /* 801A69B4 001A3914 80 7C 00 08 */ lwz r3, 8(r28) /* 801A69B8 001A3918 38 C0 00 02 */ li r6, 2 /* 801A69BC 001A391C 38 00 00 03 */ li r0, 3 /* 801A69C0 001A3920 7F 43 21 2E */ stwx r26, r3, r4 /* 801A69C4 001A3924 54 C6 10 3A */ slwi r6, r6, 2 /* 801A69C8 001A3928 38 80 00 04 */ li r4, 4 /* 801A69CC 001A392C 80 7C 00 08 */ lwz r3, 8(r28) /* 801A69D0 001A3930 38 A0 00 05 */ li r5, 5 /* 801A69D4 001A3934 54 00 10 3A */ slwi r0, r0, 2 /* 801A69D8 001A3938 7F 63 31 2E */ stwx r27, r3, r6 /* 801A69DC 001A393C 54 86 10 3A */ slwi r6, r4, 2 /* 801A69E0 001A3940 54 A4 10 3A */ slwi r4, r5, 2 /* 801A69E4 001A3944 80 BC 00 08 */ lwz r5, 8(r28) /* 801A69E8 001A3948 7F E3 FB 78 */ mr r3, r31 /* 801A69EC 001A394C 7E 05 01 2E */ stwx r16, r5, r0 /* 801A69F0 001A3950 80 01 00 A8 */ lwz r0, 0xa8(r1) /* 801A69F4 001A3954 80 BC 00 08 */ lwz r5, 8(r28) /* 801A69F8 001A3958 7F C5 31 2E */ stwx r30, r5, r6 /* 801A69FC 001A395C 80 BC 00 08 */ lwz r5, 8(r28) /* 801A6A00 001A3960 7C 05 21 2E */ stwx r0, r5, r4 /* 801A6A04 001A3964 80 9F 00 08 */ lwz r4, 8(r31) /* 801A6A08 001A3968 93 84 00 34 */ stw r28, 0x34(r4) /* 801A6A0C 001A396C B9 C1 00 C0 */ lmw r14, 0xc0(r1) /* 801A6A10 001A3970 80 01 01 0C */ lwz r0, 0x10c(r1) /* 801A6A14 001A3974 38 21 01 08 */ addi r1, r1, 0x108 /* 801A6A18 001A3978 7C 08 03 A6 */ mtlr r0 /* 801A6A1C 001A397C 4E 80 00 20 */ blr .global act__14TAImarStrategyFR4Teki act__14TAImarStrategyFR4Teki: /* 801A6A20 001A3980 7C 08 02 A6 */ mflr r0 /* 801A6A24 001A3984 90 01 00 04 */ stw r0, 4(r1) /* 801A6A28 001A3988 94 21 FF 58 */ stwu r1, -0xa8(r1) /* 801A6A2C 001A398C 93 E1 00 A4 */ stw r31, 0xa4(r1) /* 801A6A30 001A3990 93 C1 00 A0 */ stw r30, 0xa0(r1) /* 801A6A34 001A3994 7C 9E 23 78 */ mr r30, r4 /* 801A6A38 001A3998 48 04 2D 11 */ bl act__11YaiStrategyFR4Teki /* 801A6A3C 001A399C 3C 80 6B 75 */ lis r4, 0x6B757469@ha /* 801A6A40 001A39A0 80 7E 02 20 */ lwz r3, 0x220(r30) /* 801A6A44 001A39A4 38 84 74 69 */ addi r4, r4, 0x6B757469@l /* 801A6A48 001A39A8 4B EE 2C C9 */ bl getSphere__8CollInfoFUl /* 801A6A4C 001A39AC 7C 7F 1B 79 */ or. r31, r3, r3 /* 801A6A50 001A39B0 41 82 01 84 */ beq lbl_801A6BD4 /* 801A6A54 001A39B4 38 61 00 10 */ addi r3, r1, 0x10 /* 801A6A58 001A39B8 38 9F 00 00 */ addi r4, r31, 0 /* 801A6A5C 001A39BC 4B EE 14 BD */ bl getMatrix__8CollPartFv /* 801A6A60 001A39C0 80 61 00 10 */ lwz r3, 0x10(r1) /* 801A6A64 001A39C4 80 01 00 14 */ lwz r0, 0x14(r1) /* 801A6A68 001A39C8 90 61 00 5C */ stw r3, 0x5c(r1) /* 801A6A6C 001A39CC 80 61 00 18 */ lwz r3, 0x18(r1) /* 801A6A70 001A39D0 90 01 00 60 */ stw r0, 0x60(r1) /* 801A6A74 001A39D4 80 01 00 1C */ lwz r0, 0x1c(r1) /* 801A6A78 001A39D8 90 61 00 64 */ stw r3, 0x64(r1) /* 801A6A7C 001A39DC 80 61 00 20 */ lwz r3, 0x20(r1) /* 801A6A80 001A39E0 90 01 00 68 */ stw r0, 0x68(r1) /* 801A6A84 001A39E4 80 01 00 24 */ lwz r0, 0x24(r1) /* 801A6A88 001A39E8 90 61 00 6C */ stw r3, 0x6c(r1) /* 801A6A8C 001A39EC 80 61 00 28 */ lwz r3, 0x28(r1) /* 801A6A90 001A39F0 90 01 00 70 */ stw r0, 0x70(r1) /* 801A6A94 001A39F4 80 01 00 2C */ lwz r0, 0x2c(r1) /* 801A6A98 001A39F8 90 61 00 74 */ stw r3, 0x74(r1) /* 801A6A9C 001A39FC 80 61 00 30 */ lwz r3, 0x30(r1) /* 801A6AA0 001A3A00 90 01 00 78 */ stw r0, 0x78(r1) /* 801A6AA4 001A3A04 80 01 00 34 */ lwz r0, 0x34(r1) /* 801A6AA8 001A3A08 90 61 00 7C */ stw r3, 0x7c(r1) /* 801A6AAC 001A3A0C 80 61 00 38 */ lwz r3, 0x38(r1) /* 801A6AB0 001A3A10 90 01 00 80 */ stw r0, 0x80(r1) /* 801A6AB4 001A3A14 80 01 00 3C */ lwz r0, 0x3c(r1) /* 801A6AB8 001A3A18 90 61 00 84 */ stw r3, 0x84(r1) /* 801A6ABC 001A3A1C 80 61 00 40 */ lwz r3, 0x40(r1) /* 801A6AC0 001A3A20 90 01 00 88 */ stw r0, 0x88(r1) /* 801A6AC4 001A3A24 80 01 00 44 */ lwz r0, 0x44(r1) /* 801A6AC8 001A3A28 90 61 00 8C */ stw r3, 0x8c(r1) /* 801A6ACC 001A3A2C 80 61 00 48 */ lwz r3, 0x48(r1) /* 801A6AD0 001A3A30 90 01 00 90 */ stw r0, 0x90(r1) /* 801A6AD4 001A3A34 80 01 00 4C */ lwz r0, 0x4c(r1) /* 801A6AD8 001A3A38 90 61 00 94 */ stw r3, 0x94(r1) /* 801A6ADC 001A3A3C C0 02 B4 E0 */ lfs f0, lbl_803EB6E0@sda21(r2) /* 801A6AE0 001A3A40 90 01 00 98 */ stw r0, 0x98(r1) /* 801A6AE4 001A3A44 D0 01 00 58 */ stfs f0, 0x58(r1) /* 801A6AE8 001A3A48 D0 01 00 54 */ stfs f0, 0x54(r1) /* 801A6AEC 001A3A4C D0 01 00 50 */ stfs f0, 0x50(r1) /* 801A6AF0 001A3A50 C0 21 00 5C */ lfs f1, 0x5c(r1) /* 801A6AF4 001A3A54 C0 01 00 6C */ lfs f0, 0x6c(r1) /* 801A6AF8 001A3A58 D0 21 00 50 */ stfs f1, 0x50(r1) /* 801A6AFC 001A3A5C D0 01 00 54 */ stfs f0, 0x54(r1) /* 801A6B00 001A3A60 C0 01 00 7C */ lfs f0, 0x7c(r1) /* 801A6B04 001A3A64 D0 01 00 58 */ stfs f0, 0x58(r1) /* 801A6B08 001A3A68 80 9E 04 98 */ lwz r4, 0x498(r30) /* 801A6B0C 001A3A6C 28 04 00 00 */ cmplwi r4, 0 /* 801A6B10 001A3A70 41 82 00 4C */ beq lbl_801A6B5C /* 801A6B14 001A3A74 80 04 00 80 */ lwz r0, 0x80(r4) /* 801A6B18 001A3A78 54 00 07 BD */ rlwinm. r0, r0, 0, 0x1e, 0x1e /* 801A6B1C 001A3A7C 41 82 00 10 */ beq lbl_801A6B2C /* 801A6B20 001A3A80 38 00 00 00 */ li r0, 0 /* 801A6B24 001A3A84 90 1E 04 98 */ stw r0, 0x498(r30) /* 801A6B28 001A3A88 48 00 00 34 */ b lbl_801A6B5C lbl_801A6B2C: /* 801A6B2C 001A3A8C 80 7F 00 04 */ lwz r3, 4(r31) /* 801A6B30 001A3A90 80 1F 00 08 */ lwz r0, 8(r31) /* 801A6B34 001A3A94 90 64 00 0C */ stw r3, 0xc(r4) /* 801A6B38 001A3A98 90 04 00 10 */ stw r0, 0x10(r4) /* 801A6B3C 001A3A9C 80 1F 00 0C */ lwz r0, 0xc(r31) /* 801A6B40 001A3AA0 90 04 00 14 */ stw r0, 0x14(r4) /* 801A6B44 001A3AA4 80 61 00 50 */ lwz r3, 0x50(r1) /* 801A6B48 001A3AA8 80 01 00 54 */ lwz r0, 0x54(r1) /* 801A6B4C 001A3AAC 90 64 00 A0 */ stw r3, 0xa0(r4) /* 801A6B50 001A3AB0 90 04 00 A4 */ stw r0, 0xa4(r4) /* 801A6B54 001A3AB4 80 01 00 58 */ lwz r0, 0x58(r1) /* 801A6B58 001A3AB8 90 04 00 A8 */ stw r0, 0xa8(r4) lbl_801A6B5C: /* 801A6B5C 001A3ABC 80 9E 04 9C */ lwz r4, 0x49c(r30) /* 801A6B60 001A3AC0 28 04 00 00 */ cmplwi r4, 0 /* 801A6B64 001A3AC4 41 82 00 34 */ beq lbl_801A6B98 /* 801A6B68 001A3AC8 80 7F 00 04 */ lwz r3, 4(r31) /* 801A6B6C 001A3ACC 80 1F 00 08 */ lwz r0, 8(r31) /* 801A6B70 001A3AD0 90 64 00 0C */ stw r3, 0xc(r4) /* 801A6B74 001A3AD4 90 04 00 10 */ stw r0, 0x10(r4) /* 801A6B78 001A3AD8 80 1F 00 0C */ lwz r0, 0xc(r31) /* 801A6B7C 001A3ADC 90 04 00 14 */ stw r0, 0x14(r4) /* 801A6B80 001A3AE0 80 61 00 50 */ lwz r3, 0x50(r1) /* 801A6B84 001A3AE4 80 01 00 54 */ lwz r0, 0x54(r1) /* 801A6B88 001A3AE8 90 64 00 A0 */ stw r3, 0xa0(r4) /* 801A6B8C 001A3AEC 90 04 00 A4 */ stw r0, 0xa4(r4) /* 801A6B90 001A3AF0 80 01 00 58 */ lwz r0, 0x58(r1) /* 801A6B94 001A3AF4 90 04 00 A8 */ stw r0, 0xa8(r4) lbl_801A6B98: /* 801A6B98 001A3AF8 80 9E 04 A0 */ lwz r4, 0x4a0(r30) /* 801A6B9C 001A3AFC 28 04 00 00 */ cmplwi r4, 0 /* 801A6BA0 001A3B00 41 82 00 34 */ beq lbl_801A6BD4 /* 801A6BA4 001A3B04 80 7F 00 04 */ lwz r3, 4(r31) /* 801A6BA8 001A3B08 80 1F 00 08 */ lwz r0, 8(r31) /* 801A6BAC 001A3B0C 90 64 00 0C */ stw r3, 0xc(r4) /* 801A6BB0 001A3B10 90 04 00 10 */ stw r0, 0x10(r4) /* 801A6BB4 001A3B14 80 1F 00 0C */ lwz r0, 0xc(r31) /* 801A6BB8 001A3B18 90 04 00 14 */ stw r0, 0x14(r4) /* 801A6BBC 001A3B1C 80 61 00 50 */ lwz r3, 0x50(r1) /* 801A6BC0 001A3B20 80 01 00 54 */ lwz r0, 0x54(r1) /* 801A6BC4 001A3B24 90 64 00 A0 */ stw r3, 0xa0(r4) /* 801A6BC8 001A3B28 90 04 00 A4 */ stw r0, 0xa4(r4) /* 801A6BCC 001A3B2C 80 01 00 58 */ lwz r0, 0x58(r1) /* 801A6BD0 001A3B30 90 04 00 A8 */ stw r0, 0xa8(r4) lbl_801A6BD4: /* 801A6BD4 001A3B34 80 01 00 AC */ lwz r0, 0xac(r1) /* 801A6BD8 001A3B38 83 E1 00 A4 */ lwz r31, 0xa4(r1) /* 801A6BDC 001A3B3C 83 C1 00 A0 */ lwz r30, 0xa0(r1) /* 801A6BE0 001A3B40 38 21 00 A8 */ addi r1, r1, 0xa8 /* 801A6BE4 001A3B44 7C 08 03 A6 */ mtlr r0 /* 801A6BE8 001A3B48 4E 80 00 20 */ blr .global interact__14TAImarStrategyFR4TekiR18TekiInteractionKey interact__14TAImarStrategyFR4TekiR18TekiInteractionKey: /* 801A6BEC 001A3B4C 7C 08 02 A6 */ mflr r0 /* 801A6BF0 001A3B50 90 01 00 04 */ stw r0, 4(r1) /* 801A6BF4 001A3B54 94 21 FF D8 */ stwu r1, -0x28(r1) /* 801A6BF8 001A3B58 93 E1 00 24 */ stw r31, 0x24(r1) /* 801A6BFC 001A3B5C 93 C1 00 20 */ stw r30, 0x20(r1) /* 801A6C00 001A3B60 3B C4 00 00 */ addi r30, r4, 0 /* 801A6C04 001A3B64 80 05 00 00 */ lwz r0, 0(r5) /* 801A6C08 001A3B68 2C 00 00 00 */ cmpwi r0, 0 /* 801A6C0C 001A3B6C 41 82 00 08 */ beq lbl_801A6C14 /* 801A6C10 001A3B70 48 00 00 84 */ b lbl_801A6C94 lbl_801A6C14: /* 801A6C14 001A3B74 80 7E 04 10 */ lwz r3, 0x410(r30) /* 801A6C18 001A3B78 80 0D F6 4C */ lwz r0, TEKI_OPTION_INVINCIBLE__5BTeki@sda21(r13) /* 801A6C1C 001A3B7C 80 85 00 04 */ lwz r4, 4(r5) /* 801A6C20 001A3B80 7C 60 00 39 */ and. r0, r3, r0 /* 801A6C24 001A3B84 40 82 00 34 */ bne lbl_801A6C58 /* 801A6C28 001A3B88 C0 3E 03 3C */ lfs f1, 0x33c(r30) /* 801A6C2C 001A3B8C C0 04 00 08 */ lfs f0, 8(r4) /* 801A6C30 001A3B90 EC 01 00 2A */ fadds f0, f1, f0 /* 801A6C34 001A3B94 D0 1E 03 3C */ stfs f0, 0x33c(r30) /* 801A6C38 001A3B98 80 7E 04 10 */ lwz r3, 0x410(r30) /* 801A6C3C 001A3B9C 80 0D F6 5C */ lwz r0, TEKI_OPTION_DAMAGE_COUNTABLE__5BTeki@sda21(r13) /* 801A6C40 001A3BA0 7C 60 00 39 */ and. r0, r3, r0 /* 801A6C44 001A3BA4 41 82 00 14 */ beq lbl_801A6C58 /* 801A6C48 001A3BA8 C0 3E 03 40 */ lfs f1, 0x340(r30) /* 801A6C4C 001A3BAC C0 02 B5 0C */ lfs f0, lbl_803EB70C@sda21(r2) /* 801A6C50 001A3BB0 EC 01 00 2A */ fadds f0, f1, f0 /* 801A6C54 001A3BB4 D0 1E 03 40 */ stfs f0, 0x340(r30) lbl_801A6C58: /* 801A6C58 001A3BB8 80 7E 04 1C */ lwz r3, 0x41c(r30) /* 801A6C5C 001A3BBC 83 E4 00 04 */ lwz r31, 4(r4) /* 801A6C60 001A3BC0 28 03 00 00 */ cmplwi r3, 0 /* 801A6C64 001A3BC4 41 82 00 14 */ beq lbl_801A6C78 /* 801A6C68 001A3BC8 41 82 00 10 */ beq lbl_801A6C78 /* 801A6C6C 001A3BCC 4B F3 D7 01 */ bl subCnt__12RefCountableFv /* 801A6C70 001A3BD0 38 00 00 00 */ li r0, 0 /* 801A6C74 001A3BD4 90 1E 04 1C */ stw r0, 0x41c(r30) lbl_801A6C78: /* 801A6C78 001A3BD8 93 FE 04 1C */ stw r31, 0x41c(r30) /* 801A6C7C 001A3BDC 80 7E 04 1C */ lwz r3, 0x41c(r30) /* 801A6C80 001A3BE0 28 03 00 00 */ cmplwi r3, 0 /* 801A6C84 001A3BE4 41 82 00 08 */ beq lbl_801A6C8C /* 801A6C88 001A3BE8 4B F3 D6 D5 */ bl addCnt__12RefCountableFv lbl_801A6C8C: /* 801A6C8C 001A3BEC 38 60 00 01 */ li r3, 1 /* 801A6C90 001A3BF0 48 00 00 08 */ b lbl_801A6C98 lbl_801A6C94: /* 801A6C94 001A3BF4 38 60 00 01 */ li r3, 1 lbl_801A6C98: /* 801A6C98 001A3BF8 80 01 00 2C */ lwz r0, 0x2c(r1) /* 801A6C9C 001A3BFC 83 E1 00 24 */ lwz r31, 0x24(r1) /* 801A6CA0 001A3C00 83 C1 00 20 */ lwz r30, 0x20(r1) /* 801A6CA4 001A3C04 38 21 00 28 */ addi r1, r1, 0x28 /* 801A6CA8 001A3C08 7C 08 03 A6 */ mtlr r0 /* 801A6CAC 001A3C0C 4E 80 00 20 */ blr .global makeDefaultAnimations__15TAImarAnimationFv makeDefaultAnimations__15TAImarAnimationFv: /* 801A6CB0 001A3C10 7C 08 02 A6 */ mflr r0 /* 801A6CB4 001A3C14 90 01 00 04 */ stw r0, 4(r1) /* 801A6CB8 001A3C18 94 21 FF 88 */ stwu r1, -0x78(r1) /* 801A6CBC 001A3C1C 93 E1 00 74 */ stw r31, 0x74(r1) /* 801A6CC0 001A3C20 93 C1 00 70 */ stw r30, 0x70(r1) /* 801A6CC4 001A3C24 7C 7E 1B 78 */ mr r30, r3 /* 801A6CC8 001A3C28 80 03 00 04 */ lwz r0, 4(r3) /* 801A6CCC 001A3C2C 3C 60 80 2E */ lis r3, lbl_802DE4E0@ha /* 801A6CD0 001A3C30 3B E3 E4 E0 */ addi r31, r3, lbl_802DE4E0@l /* 801A6CD4 001A3C34 28 00 00 00 */ cmplwi r0, 0 /* 801A6CD8 001A3C38 41 82 02 EC */ beq lbl_801A6FC4 /* 801A6CDC 001A3C3C 80 CD 31 60 */ lwz r6, tekiMgr@sda21(r13) /* 801A6CE0 001A3C40 7F C3 F3 78 */ mr r3, r30 /* 801A6CE4 001A3C44 80 AD 2D EC */ lwz r5, gsys@sda21(r13) /* 801A6CE8 001A3C48 38 9F 01 00 */ addi r4, r31, 0x100 /* 801A6CEC 001A3C4C 80 C6 01 18 */ lwz r6, 0x118(r6) /* 801A6CF0 001A3C50 80 06 00 00 */ lwz r0, 0(r6) /* 801A6CF4 001A3C54 90 05 01 FC */ stw r0, 0x1fc(r5) /* 801A6CF8 001A3C58 4B FF C8 9D */ bl addAnimation__12TAIanimationFPc /* 801A6CFC 001A3C5C 38 7E 00 00 */ addi r3, r30, 0 /* 801A6D00 001A3C60 38 9F 01 1C */ addi r4, r31, 0x11c /* 801A6D04 001A3C64 4B FF C8 91 */ bl addAnimation__12TAIanimationFPc /* 801A6D08 001A3C68 38 7E 00 00 */ addi r3, r30, 0 /* 801A6D0C 001A3C6C 38 9F 01 38 */ addi r4, r31, 0x138 /* 801A6D10 001A3C70 4B FF C8 85 */ bl addAnimation__12TAIanimationFPc /* 801A6D14 001A3C74 38 60 00 10 */ li r3, 0x10 /* 801A6D18 001A3C78 4B EA 02 ED */ bl alloc__6SystemFUl /* 801A6D1C 001A3C7C 38 C3 00 00 */ addi r6, r3, 0 /* 801A6D20 001A3C80 7C C0 33 79 */ or. r0, r6, r6 /* 801A6D24 001A3C84 41 82 00 18 */ beq lbl_801A6D3C /* 801A6D28 001A3C88 38 00 00 00 */ li r0, 0 /* 801A6D2C 001A3C8C 90 06 00 00 */ stw r0, 0(r6) /* 801A6D30 001A3C90 98 06 00 06 */ stb r0, 6(r6) /* 801A6D34 001A3C94 90 06 00 08 */ stw r0, 8(r6) /* 801A6D38 001A3C98 90 06 00 0C */ stw r0, 0xc(r6) lbl_801A6D3C: /* 801A6D3C 001A3C9C 80 9E 00 08 */ lwz r4, 8(r30) /* 801A6D40 001A3CA0 38 60 00 10 */ li r3, 0x10 /* 801A6D44 001A3CA4 80 A4 00 60 */ lwz r5, 0x60(r4) /* 801A6D48 001A3CA8 80 05 00 0C */ lwz r0, 0xc(r5) /* 801A6D4C 001A3CAC 90 06 00 0C */ stw r0, 0xc(r6) /* 801A6D50 001A3CB0 90 A6 00 08 */ stw r5, 8(r6) /* 801A6D54 001A3CB4 80 85 00 0C */ lwz r4, 0xc(r5) /* 801A6D58 001A3CB8 90 C4 00 08 */ stw r6, 8(r4) /* 801A6D5C 001A3CBC 90 C5 00 0C */ stw r6, 0xc(r5) /* 801A6D60 001A3CC0 4B EA 02 A5 */ bl alloc__6SystemFUl /* 801A6D64 001A3CC4 38 E3 00 00 */ addi r7, r3, 0 /* 801A6D68 001A3CC8 7C E0 3B 79 */ or. r0, r7, r7 /* 801A6D6C 001A3CCC 41 82 00 1C */ beq lbl_801A6D88 /* 801A6D70 001A3CD0 38 60 00 01 */ li r3, 1 /* 801A6D74 001A3CD4 90 67 00 00 */ stw r3, 0(r7) /* 801A6D78 001A3CD8 38 00 00 00 */ li r0, 0 /* 801A6D7C 001A3CDC 98 67 00 06 */ stb r3, 6(r7) /* 801A6D80 001A3CE0 90 07 00 08 */ stw r0, 8(r7) /* 801A6D84 001A3CE4 90 07 00 0C */ stw r0, 0xc(r7) lbl_801A6D88: /* 801A6D88 001A3CE8 80 BE 00 08 */ lwz r5, 8(r30) /* 801A6D8C 001A3CEC 38 7E 00 00 */ addi r3, r30, 0 /* 801A6D90 001A3CF0 38 9F 01 54 */ addi r4, r31, 0x154 /* 801A6D94 001A3CF4 80 C5 00 60 */ lwz r6, 0x60(r5) /* 801A6D98 001A3CF8 80 06 00 0C */ lwz r0, 0xc(r6) /* 801A6D9C 001A3CFC 90 07 00 0C */ stw r0, 0xc(r7) /* 801A6DA0 001A3D00 90 C7 00 08 */ stw r6, 8(r7) /* 801A6DA4 001A3D04 80 A6 00 0C */ lwz r5, 0xc(r6) /* 801A6DA8 001A3D08 90 E5 00 08 */ stw r7, 8(r5) /* 801A6DAC 001A3D0C 90 E6 00 0C */ stw r7, 0xc(r6) /* 801A6DB0 001A3D10 4B FF C7 E5 */ bl addAnimation__12TAIanimationFPc /* 801A6DB4 001A3D14 38 60 00 10 */ li r3, 0x10 /* 801A6DB8 001A3D18 4B EA 02 4D */ bl alloc__6SystemFUl /* 801A6DBC 001A3D1C 38 C3 00 00 */ addi r6, r3, 0 /* 801A6DC0 001A3D20 7C C0 33 79 */ or. r0, r6, r6 /* 801A6DC4 001A3D24 41 82 00 18 */ beq lbl_801A6DDC /* 801A6DC8 001A3D28 38 00 00 00 */ li r0, 0 /* 801A6DCC 001A3D2C 90 06 00 00 */ stw r0, 0(r6) /* 801A6DD0 001A3D30 98 06 00 06 */ stb r0, 6(r6) /* 801A6DD4 001A3D34 90 06 00 08 */ stw r0, 8(r6) /* 801A6DD8 001A3D38 90 06 00 0C */ stw r0, 0xc(r6) lbl_801A6DDC: /* 801A6DDC 001A3D3C 80 9E 00 08 */ lwz r4, 8(r30) /* 801A6DE0 001A3D40 38 60 00 10 */ li r3, 0x10 /* 801A6DE4 001A3D44 80 A4 00 60 */ lwz r5, 0x60(r4) /* 801A6DE8 001A3D48 80 05 00 0C */ lwz r0, 0xc(r5) /* 801A6DEC 001A3D4C 90 06 00 0C */ stw r0, 0xc(r6) /* 801A6DF0 001A3D50 90 A6 00 08 */ stw r5, 8(r6) /* 801A6DF4 001A3D54 80 85 00 0C */ lwz r4, 0xc(r5) /* 801A6DF8 001A3D58 90 C4 00 08 */ stw r6, 8(r4) /* 801A6DFC 001A3D5C 90 C5 00 0C */ stw r6, 0xc(r5) /* 801A6E00 001A3D60 4B EA 02 05 */ bl alloc__6SystemFUl /* 801A6E04 001A3D64 38 E3 00 00 */ addi r7, r3, 0 /* 801A6E08 001A3D68 7C E0 3B 79 */ or. r0, r7, r7 /* 801A6E0C 001A3D6C 41 82 00 1C */ beq lbl_801A6E28 /* 801A6E10 001A3D70 38 60 00 01 */ li r3, 1 /* 801A6E14 001A3D74 90 67 00 00 */ stw r3, 0(r7) /* 801A6E18 001A3D78 38 00 00 00 */ li r0, 0 /* 801A6E1C 001A3D7C 98 67 00 06 */ stb r3, 6(r7) /* 801A6E20 001A3D80 90 07 00 08 */ stw r0, 8(r7) /* 801A6E24 001A3D84 90 07 00 0C */ stw r0, 0xc(r7) lbl_801A6E28: /* 801A6E28 001A3D88 80 BE 00 08 */ lwz r5, 8(r30) /* 801A6E2C 001A3D8C 38 7E 00 00 */ addi r3, r30, 0 /* 801A6E30 001A3D90 38 9F 01 70 */ addi r4, r31, 0x170 /* 801A6E34 001A3D94 80 C5 00 60 */ lwz r6, 0x60(r5) /* 801A6E38 001A3D98 80 06 00 0C */ lwz r0, 0xc(r6) /* 801A6E3C 001A3D9C 90 07 00 0C */ stw r0, 0xc(r7) /* 801A6E40 001A3DA0 90 C7 00 08 */ stw r6, 8(r7) /* 801A6E44 001A3DA4 80 A6 00 0C */ lwz r5, 0xc(r6) /* 801A6E48 001A3DA8 90 E5 00 08 */ stw r7, 8(r5) /* 801A6E4C 001A3DAC 90 E6 00 0C */ stw r7, 0xc(r6) /* 801A6E50 001A3DB0 4B FF C7 45 */ bl addAnimation__12TAIanimationFPc /* 801A6E54 001A3DB4 38 7E 00 00 */ addi r3, r30, 0 /* 801A6E58 001A3DB8 38 9F 01 90 */ addi r4, r31, 0x190 /* 801A6E5C 001A3DBC 4B FF C7 39 */ bl addAnimation__12TAIanimationFPc /* 801A6E60 001A3DC0 38 7E 00 00 */ addi r3, r30, 0 /* 801A6E64 001A3DC4 38 9F 01 B0 */ addi r4, r31, 0x1b0 /* 801A6E68 001A3DC8 4B FF C7 2D */ bl addAnimation__12TAIanimationFPc /* 801A6E6C 001A3DCC 38 60 00 10 */ li r3, 0x10 /* 801A6E70 001A3DD0 4B EA 01 95 */ bl alloc__6SystemFUl /* 801A6E74 001A3DD4 38 C3 00 00 */ addi r6, r3, 0 /* 801A6E78 001A3DD8 7C C0 33 79 */ or. r0, r6, r6 /* 801A6E7C 001A3DDC 41 82 00 18 */ beq lbl_801A6E94 /* 801A6E80 001A3DE0 38 00 00 00 */ li r0, 0 /* 801A6E84 001A3DE4 90 06 00 00 */ stw r0, 0(r6) /* 801A6E88 001A3DE8 98 06 00 06 */ stb r0, 6(r6) /* 801A6E8C 001A3DEC 90 06 00 08 */ stw r0, 8(r6) /* 801A6E90 001A3DF0 90 06 00 0C */ stw r0, 0xc(r6) lbl_801A6E94: /* 801A6E94 001A3DF4 80 9E 00 08 */ lwz r4, 8(r30) /* 801A6E98 001A3DF8 38 60 00 10 */ li r3, 0x10 /* 801A6E9C 001A3DFC 80 A4 00 60 */ lwz r5, 0x60(r4) /* 801A6EA0 001A3E00 80 05 00 0C */ lwz r0, 0xc(r5) /* 801A6EA4 001A3E04 90 06 00 0C */ stw r0, 0xc(r6) /* 801A6EA8 001A3E08 90 A6 00 08 */ stw r5, 8(r6) /* 801A6EAC 001A3E0C 80 85 00 0C */ lwz r4, 0xc(r5) /* 801A6EB0 001A3E10 90 C4 00 08 */ stw r6, 8(r4) /* 801A6EB4 001A3E14 90 C5 00 0C */ stw r6, 0xc(r5) /* 801A6EB8 001A3E18 4B EA 01 4D */ bl alloc__6SystemFUl /* 801A6EBC 001A3E1C 38 E3 00 00 */ addi r7, r3, 0 /* 801A6EC0 001A3E20 7C E0 3B 79 */ or. r0, r7, r7 /* 801A6EC4 001A3E24 41 82 00 1C */ beq lbl_801A6EE0 /* 801A6EC8 001A3E28 38 60 00 01 */ li r3, 1 /* 801A6ECC 001A3E2C 90 67 00 00 */ stw r3, 0(r7) /* 801A6ED0 001A3E30 38 00 00 00 */ li r0, 0 /* 801A6ED4 001A3E34 98 67 00 06 */ stb r3, 6(r7) /* 801A6ED8 001A3E38 90 07 00 08 */ stw r0, 8(r7) /* 801A6EDC 001A3E3C 90 07 00 0C */ stw r0, 0xc(r7) lbl_801A6EE0: /* 801A6EE0 001A3E40 80 BE 00 08 */ lwz r5, 8(r30) /* 801A6EE4 001A3E44 38 7E 00 00 */ addi r3, r30, 0 /* 801A6EE8 001A3E48 38 9F 01 CC */ addi r4, r31, 0x1cc /* 801A6EEC 001A3E4C 80 C5 00 60 */ lwz r6, 0x60(r5) /* 801A6EF0 001A3E50 80 06 00 0C */ lwz r0, 0xc(r6) /* 801A6EF4 001A3E54 90 07 00 0C */ stw r0, 0xc(r7) /* 801A6EF8 001A3E58 90 C7 00 08 */ stw r6, 8(r7) /* 801A6EFC 001A3E5C 80 A6 00 0C */ lwz r5, 0xc(r6) /* 801A6F00 001A3E60 90 E5 00 08 */ stw r7, 8(r5) /* 801A6F04 001A3E64 90 E6 00 0C */ stw r7, 0xc(r6) /* 801A6F08 001A3E68 4B FF C6 8D */ bl addAnimation__12TAIanimationFPc /* 801A6F0C 001A3E6C 38 60 00 10 */ li r3, 0x10 /* 801A6F10 001A3E70 4B EA 00 F5 */ bl alloc__6SystemFUl /* 801A6F14 001A3E74 38 C3 00 00 */ addi r6, r3, 0 /* 801A6F18 001A3E78 7C C0 33 79 */ or. r0, r6, r6 /* 801A6F1C 001A3E7C 41 82 00 18 */ beq lbl_801A6F34 /* 801A6F20 001A3E80 38 00 00 00 */ li r0, 0 /* 801A6F24 001A3E84 90 06 00 00 */ stw r0, 0(r6) /* 801A6F28 001A3E88 98 06 00 06 */ stb r0, 6(r6) /* 801A6F2C 001A3E8C 90 06 00 08 */ stw r0, 8(r6) /* 801A6F30 001A3E90 90 06 00 0C */ stw r0, 0xc(r6) lbl_801A6F34: /* 801A6F34 001A3E94 80 9E 00 08 */ lwz r4, 8(r30) /* 801A6F38 001A3E98 38 60 00 10 */ li r3, 0x10 /* 801A6F3C 001A3E9C 80 A4 00 60 */ lwz r5, 0x60(r4) /* 801A6F40 001A3EA0 80 05 00 0C */ lwz r0, 0xc(r5) /* 801A6F44 001A3EA4 90 06 00 0C */ stw r0, 0xc(r6) /* 801A6F48 001A3EA8 90 A6 00 08 */ stw r5, 8(r6) /* 801A6F4C 001A3EAC 80 85 00 0C */ lwz r4, 0xc(r5) /* 801A6F50 001A3EB0 90 C4 00 08 */ stw r6, 8(r4) /* 801A6F54 001A3EB4 90 C5 00 0C */ stw r6, 0xc(r5) /* 801A6F58 001A3EB8 4B EA 00 AD */ bl alloc__6SystemFUl /* 801A6F5C 001A3EBC 38 E3 00 00 */ addi r7, r3, 0 /* 801A6F60 001A3EC0 7C E0 3B 79 */ or. r0, r7, r7 /* 801A6F64 001A3EC4 41 82 00 1C */ beq lbl_801A6F80 /* 801A6F68 001A3EC8 38 60 00 01 */ li r3, 1 /* 801A6F6C 001A3ECC 90 67 00 00 */ stw r3, 0(r7) /* 801A6F70 001A3ED0 38 00 00 00 */ li r0, 0 /* 801A6F74 001A3ED4 98 67 00 06 */ stb r3, 6(r7) /* 801A6F78 001A3ED8 90 07 00 08 */ stw r0, 8(r7) /* 801A6F7C 001A3EDC 90 07 00 0C */ stw r0, 0xc(r7) lbl_801A6F80: /* 801A6F80 001A3EE0 80 BE 00 08 */ lwz r5, 8(r30) /* 801A6F84 001A3EE4 38 7E 00 00 */ addi r3, r30, 0 /* 801A6F88 001A3EE8 38 9F 01 E8 */ addi r4, r31, 0x1e8 /* 801A6F8C 001A3EEC 80 C5 00 60 */ lwz r6, 0x60(r5) /* 801A6F90 001A3EF0 80 06 00 0C */ lwz r0, 0xc(r6) /* 801A6F94 001A3EF4 90 07 00 0C */ stw r0, 0xc(r7) /* 801A6F98 001A3EF8 90 C7 00 08 */ stw r6, 8(r7) /* 801A6F9C 001A3EFC 80 A6 00 0C */ lwz r5, 0xc(r6) /* 801A6FA0 001A3F00 90 E5 00 08 */ stw r7, 8(r5) /* 801A6FA4 001A3F04 90 E6 00 0C */ stw r7, 0xc(r6) /* 801A6FA8 001A3F08 4B FF C5 ED */ bl addAnimation__12TAIanimationFPc /* 801A6FAC 001A3F0C 38 7E 00 00 */ addi r3, r30, 0 /* 801A6FB0 001A3F10 38 9F 02 04 */ addi r4, r31, 0x204 /* 801A6FB4 001A3F14 4B FF C5 E1 */ bl addAnimation__12TAIanimationFPc /* 801A6FB8 001A3F18 38 7E 00 00 */ addi r3, r30, 0 /* 801A6FBC 001A3F1C 38 9F 02 20 */ addi r4, r31, 0x220 /* 801A6FC0 001A3F20 4B FF C5 D5 */ bl addAnimation__12TAIanimationFPc lbl_801A6FC4: /* 801A6FC4 001A3F24 80 01 00 7C */ lwz r0, 0x7c(r1) /* 801A6FC8 001A3F28 83 E1 00 74 */ lwz r31, 0x74(r1) /* 801A6FCC 001A3F2C 83 C1 00 70 */ lwz r30, 0x70(r1) /* 801A6FD0 001A3F30 38 21 00 78 */ addi r1, r1, 0x78 /* 801A6FD4 001A3F34 7C 08 03 A6 */ mtlr r0 /* 801A6FD8 001A3F38 4E 80 00 20 */ blr .global start__11TAIAinitMarFR4Teki start__11TAIAinitMarFR4Teki: /* 801A6FDC 001A3F3C C0 02 B5 54 */ lfs f0, lbl_803EB754@sda21(r2) /* 801A6FE0 001A3F40 D0 04 02 70 */ stfs f0, 0x270(r4) /* 801A6FE4 001A3F44 4E 80 00 20 */ blr .global act__11TAIAinitMarFR4Teki act__11TAIAinitMarFR4Teki: /* 801A6FE8 001A3F48 38 60 00 01 */ li r3, 1 /* 801A6FEC 001A3F4C 4E 80 00 20 */ blr .global start__13TAIAwatchNaviFR4Teki start__13TAIAwatchNaviFR4Teki: /* 801A6FF0 001A3F50 7C 08 02 A6 */ mflr r0 /* 801A6FF4 001A3F54 90 01 00 04 */ stw r0, 4(r1) /* 801A6FF8 001A3F58 94 21 FF E8 */ stwu r1, -0x18(r1) /* 801A6FFC 001A3F5C 93 E1 00 14 */ stw r31, 0x14(r1) /* 801A7000 001A3F60 93 C1 00 10 */ stw r30, 0x10(r1) /* 801A7004 001A3F64 7C 9E 23 78 */ mr r30, r4 /* 801A7008 001A3F68 80 6D 31 20 */ lwz r3, naviMgr@sda21(r13) /* 801A700C 001A3F6C 4B F7 03 B9 */ bl getNavi__7NaviMgrFv /* 801A7010 001A3F70 80 1E 04 18 */ lwz r0, 0x418(r30) /* 801A7014 001A3F74 3B E3 00 00 */ addi r31, r3, 0 /* 801A7018 001A3F78 28 00 00 00 */ cmplwi r0, 0 /* 801A701C 001A3F7C 41 82 00 18 */ beq lbl_801A7034 /* 801A7020 001A3F80 41 82 00 14 */ beq lbl_801A7034 /* 801A7024 001A3F84 7C 03 03 78 */ mr r3, r0 /* 801A7028 001A3F88 4B F3 D3 45 */ bl subCnt__12RefCountableFv /* 801A702C 001A3F8C 38 00 00 00 */ li r0, 0 /* 801A7030 001A3F90 90 1E 04 18 */ stw r0, 0x418(r30) lbl_801A7034: /* 801A7034 001A3F94 93 FE 04 18 */ stw r31, 0x418(r30) /* 801A7038 001A3F98 80 7E 04 18 */ lwz r3, 0x418(r30) /* 801A703C 001A3F9C 28 03 00 00 */ cmplwi r3, 0 /* 801A7040 001A3FA0 41 82 00 08 */ beq lbl_801A7048 /* 801A7044 001A3FA4 4B F3 D3 19 */ bl addCnt__12RefCountableFv lbl_801A7048: /* 801A7048 001A3FA8 80 01 00 1C */ lwz r0, 0x1c(r1) /* 801A704C 001A3FAC 83 E1 00 14 */ lwz r31, 0x14(r1) /* 801A7050 001A3FB0 83 C1 00 10 */ lwz r30, 0x10(r1) /* 801A7054 001A3FB4 38 21 00 18 */ addi r1, r1, 0x18 /* 801A7058 001A3FB8 7C 08 03 A6 */ mtlr r0 /* 801A705C 001A3FBC 4E 80 00 20 */ blr .global act__13TAIAwatchNaviFR4Teki act__13TAIAwatchNaviFR4Teki: /* 801A7060 001A3FC0 38 60 00 01 */ li r3, 1 /* 801A7064 001A3FC4 4E 80 00 20 */ blr .global getVelocity__32TAIAflyingDistanceInTerritoryMarFR4Teki getVelocity__32TAIAflyingDistanceInTerritoryMarFR4Teki: /* 801A7068 001A3FC8 80 64 02 C4 */ lwz r3, 0x2c4(r4) /* 801A706C 001A3FCC 80 63 00 84 */ lwz r3, 0x84(r3) /* 801A7070 001A3FD0 80 63 00 04 */ lwz r3, 4(r3) /* 801A7074 001A3FD4 80 63 00 00 */ lwz r3, 0(r3) /* 801A7078 001A3FD8 C0 23 00 10 */ lfs f1, 0x10(r3) /* 801A707C 001A3FDC 4E 80 00 20 */ blr .global getOffset__32TAIAflyingDistanceInTerritoryMarFR4Teki getOffset__32TAIAflyingDistanceInTerritoryMarFR4Teki: /* 801A7080 001A3FE0 80 64 02 C4 */ lwz r3, 0x2c4(r4) /* 801A7084 001A3FE4 80 63 00 84 */ lwz r3, 0x84(r3) /* 801A7088 001A3FE8 80 63 00 04 */ lwz r3, 4(r3) /* 801A708C 001A3FEC 80 63 00 00 */ lwz r3, 0(r3) /* 801A7090 001A3FF0 C0 23 00 C8 */ lfs f1, 0xc8(r3) /* 801A7094 001A3FF4 4E 80 00 20 */ blr .global start__17TAIAfireBreathMarFR4Teki start__17TAIAfireBreathMarFR4Teki: /* 801A7098 001A3FF8 7C 08 02 A6 */ mflr r0 /* 801A709C 001A3FFC 90 01 00 04 */ stw r0, 4(r1) /* 801A70A0 001A4000 94 21 FF E8 */ stwu r1, -0x18(r1) /* 801A70A4 001A4004 93 E1 00 14 */ stw r31, 0x14(r1) /* 801A70A8 001A4008 7C 9F 23 78 */ mr r31, r4 /* 801A70AC 001A400C 48 00 7A 1D */ bl start__14TAIAfireBreathFR4Teki /* 801A70B0 001A4010 7F E3 FB 78 */ mr r3, r31 /* 801A70B4 001A4014 4B FF B9 95 */ bl isNaviWatch__5YTekiFv /* 801A70B8 001A4018 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 801A70BC 001A401C 41 82 00 14 */ beq lbl_801A70D0 /* 801A70C0 001A4020 80 6D 2F 6C */ lwz r3, playerState@sda21(r13) /* 801A70C4 001A4024 38 80 00 38 */ li r4, 0x38 /* 801A70C8 001A4028 38 63 00 70 */ addi r3, r3, 0x70 /* 801A70CC 001A402C 4B ED C9 35 */ bl setOn__11ResultFlagsFi lbl_801A70D0: /* 801A70D0 001A4030 80 01 00 1C */ lwz r0, 0x1c(r1) /* 801A70D4 001A4034 83 E1 00 14 */ lwz r31, 0x14(r1) /* 801A70D8 001A4038 38 21 00 18 */ addi r1, r1, 0x18 /* 801A70DC 001A403C 7C 08 03 A6 */ mtlr r0 /* 801A70E0 001A4040 4E 80 00 20 */ blr .global act__17TAIAfireBreathMarFR4Teki act__17TAIAfireBreathMarFR4Teki: /* 801A70E4 001A4044 7C 08 02 A6 */ mflr r0 /* 801A70E8 001A4048 90 01 00 04 */ stw r0, 4(r1) /* 801A70EC 001A404C 94 21 FF F8 */ stwu r1, -8(r1) /* 801A70F0 001A4050 48 00 7A 59 */ bl act__14TAIAfireBreathFR4Teki /* 801A70F4 001A4054 80 01 00 0C */ lwz r0, 0xc(r1) /* 801A70F8 001A4058 38 21 00 08 */ addi r1, r1, 8 /* 801A70FC 001A405C 7C 08 03 A6 */ mtlr r0 /* 801A7100 001A4060 4E 80 00 20 */ blr .global getPreviousAnimSpeed__17TAIAfireBreathMarFR4Teki getPreviousAnimSpeed__17TAIAfireBreathMarFR4Teki: /* 801A7104 001A4064 C0 22 B5 14 */ lfs f1, lbl_803EB714@sda21(r2) /* 801A7108 001A4068 4E 80 00 20 */ blr .global getAttackAnimSpeed__17TAIAfireBreathMarFR4Teki getAttackAnimSpeed__17TAIAfireBreathMarFR4Teki: /* 801A710C 001A406C 80 64 02 C4 */ lwz r3, 0x2c4(r4) /* 801A7110 001A4070 80 63 00 84 */ lwz r3, 0x84(r3) /* 801A7114 001A4074 80 63 00 04 */ lwz r3, 4(r3) /* 801A7118 001A4078 80 63 00 00 */ lwz r3, 0(r3) /* 801A711C 001A407C C0 23 00 D0 */ lfs f1, 0xd0(r3) /* 801A7120 001A4080 4E 80 00 20 */ blr .global invoke__12BreathEffectFR4Teki invoke__12BreathEffectFR4Teki: /* 801A7124 001A4084 7C 08 02 A6 */ mflr r0 /* 801A7128 001A4088 90 01 00 04 */ stw r0, 4(r1) /* 801A712C 001A408C 94 21 FF 00 */ stwu r1, -0x100(r1) /* 801A7130 001A4090 DB E1 00 F8 */ stfd f31, 0xf8(r1) /* 801A7134 001A4094 DB C1 00 F0 */ stfd f30, 0xf0(r1) /* 801A7138 001A4098 DB A1 00 E8 */ stfd f29, 0xe8(r1) /* 801A713C 001A409C DB 81 00 E0 */ stfd f28, 0xe0(r1) /* 801A7140 001A40A0 DB 61 00 D8 */ stfd f27, 0xd8(r1) /* 801A7144 001A40A4 93 E1 00 D4 */ stw r31, 0xd4(r1) /* 801A7148 001A40A8 7C 9F 23 78 */ mr r31, r4 /* 801A714C 001A40AC 93 C1 00 D0 */ stw r30, 0xd0(r1) /* 801A7150 001A40B0 80 04 03 A8 */ lwz r0, 0x3a8(r4) /* 801A7154 001A40B4 2C 00 00 01 */ cmpwi r0, 1 /* 801A7158 001A40B8 40 82 02 10 */ bne lbl_801A7368 /* 801A715C 001A40BC 3C 80 6B 75 */ lis r4, 0x6B757469@ha /* 801A7160 001A40C0 80 7F 02 20 */ lwz r3, 0x220(r31) /* 801A7164 001A40C4 38 84 74 69 */ addi r4, r4, 0x6B757469@l /* 801A7168 001A40C8 4B EE 25 A9 */ bl getSphere__8CollInfoFUl /* 801A716C 001A40CC 7C 7E 1B 78 */ mr r30, r3 /* 801A7170 001A40D0 C0 22 B5 58 */ lfs f1, lbl_803EB758@sda21(r2) /* 801A7174 001A40D4 48 07 49 E1 */ bl cosf /* 801A7178 001A40D8 C0 1F 00 A0 */ lfs f0, 0xa0(r31) /* 801A717C 001A40DC FF C0 08 90 */ fmr f30, f1 /* 801A7180 001A40E0 FC 20 00 90 */ fmr f1, f0 /* 801A7184 001A40E4 48 07 49 D1 */ bl cosf /* 801A7188 001A40E8 FF A0 08 90 */ fmr f29, f1 /* 801A718C 001A40EC C0 22 B5 58 */ lfs f1, lbl_803EB758@sda21(r2) /* 801A7190 001A40F0 48 07 4B 59 */ bl sinf /* 801A7194 001A40F4 C0 1F 00 A0 */ lfs f0, 0xa0(r31) /* 801A7198 001A40F8 FF 80 08 90 */ fmr f28, f1 /* 801A719C 001A40FC FC 20 00 90 */ fmr f1, f0 /* 801A71A0 001A4100 48 07 4B 49 */ bl sinf /* 801A71A4 001A4104 C0 82 B5 5C */ lfs f4, lbl_803EB75C@sda21(r2) /* 801A71A8 001A4108 EC 1E 00 72 */ fmuls f0, f30, f1 /* 801A71AC 001A410C C0 42 B5 60 */ lfs f2, lbl_803EB760@sda21(r2) /* 801A71B0 001A4110 EC 7E 07 72 */ fmuls f3, f30, f29 /* 801A71B4 001A4114 FC 20 20 50 */ fneg f1, f4 /* 801A71B8 001A4118 D0 01 00 C0 */ stfs f0, 0xc0(r1) /* 801A71BC 001A411C C0 02 B5 20 */ lfs f0, lbl_803EB720@sda21(r2) /* 801A71C0 001A4120 EC 22 00 72 */ fmuls f1, f2, f1 /* 801A71C4 001A4124 D3 81 00 C4 */ stfs f28, 0xc4(r1) /* 801A71C8 001A4128 D0 61 00 C8 */ stfs f3, 0xc8(r1) /* 801A71CC 001A412C EF 61 00 24 */ fdivs f27, f1, f0 /* 801A71D0 001A4130 FC 20 D8 90 */ fmr f1, f27 /* 801A71D4 001A4134 48 07 49 81 */ bl cosf /* 801A71D8 001A4138 C0 1F 00 A0 */ lfs f0, 0xa0(r31) /* 801A71DC 001A413C FF 80 08 90 */ fmr f28, f1 /* 801A71E0 001A4140 FC 20 00 90 */ fmr f1, f0 /* 801A71E4 001A4144 48 07 49 71 */ bl cosf /* 801A71E8 001A4148 FF A0 08 90 */ fmr f29, f1 /* 801A71EC 001A414C FC 20 D8 90 */ fmr f1, f27 /* 801A71F0 001A4150 48 07 4A F9 */ bl sinf /* 801A71F4 001A4154 C0 1F 00 A0 */ lfs f0, 0xa0(r31) /* 801A71F8 001A4158 FF C0 08 90 */ fmr f30, f1 /* 801A71FC 001A415C FC 20 00 90 */ fmr f1, f0 /* 801A7200 001A4160 48 07 4A E9 */ bl sinf /* 801A7204 001A4164 FF E0 08 90 */ fmr f31, f1 /* 801A7208 001A4168 38 7F 00 00 */ addi r3, r31, 0 /* 801A720C 001A416C 38 9F 00 00 */ addi r4, r31, 0 /* 801A7210 001A4170 38 A0 00 82 */ li r5, 0x82 /* 801A7214 001A4174 4B EE 33 A1 */ bl playEventSound__8CreatureFP8Creaturei /* 801A7218 001A4178 80 7F 02 C4 */ lwz r3, 0x2c4(r31) /* 801A721C 001A417C 38 80 00 0C */ li r4, 0xc /* 801A7220 001A4180 80 63 00 84 */ lwz r3, 0x84(r3) /* 801A7224 001A4184 80 63 00 04 */ lwz r3, 4(r3) /* 801A7228 001A4188 4B F7 B2 AD */ bl "get__17ParaParameters<f>Fi" /* 801A722C 001A418C 80 7F 02 C4 */ lwz r3, 0x2c4(r31) /* 801A7230 001A4190 FF 60 08 90 */ fmr f27, f1 /* 801A7234 001A4194 38 80 00 33 */ li r4, 0x33 /* 801A7238 001A4198 80 63 00 84 */ lwz r3, 0x84(r3) /* 801A723C 001A419C 80 63 00 04 */ lwz r3, 4(r3) /* 801A7240 001A41A0 4B F7 B2 95 */ bl "get__17ParaParameters<f>Fi" /* 801A7244 001A41A4 C0 02 B5 60 */ lfs f0, lbl_803EB760@sda21(r2) /* 801A7248 001A41A8 EC 5C 07 72 */ fmuls f2, f28, f29 /* 801A724C 001A41AC C0 62 B5 20 */ lfs f3, lbl_803EB720@sda21(r2) /* 801A7250 001A41B0 38 C1 00 60 */ addi r6, r1, 0x60 /* 801A7254 001A41B4 EC 80 00 72 */ fmuls f4, f0, f1 /* 801A7258 001A41B8 EC 1C 07 F2 */ fmuls f0, f28, f31 /* 801A725C 001A41BC C0 AD 13 70 */ lfs f5, lbl_803E6090@sda21(r13) /* 801A7260 001A41C0 38 A1 00 5C */ addi r5, r1, 0x5c /* 801A7264 001A41C4 EF 84 18 24 */ fdivs f28, f4, f3 /* 801A7268 001A41C8 38 81 00 58 */ addi r4, r1, 0x58 /* 801A726C 001A41CC 38 61 00 84 */ addi r3, r1, 0x84 /* 801A7270 001A41D0 EC 22 01 72 */ fmuls f1, f2, f5 /* 801A7274 001A41D4 EC 00 01 72 */ fmuls f0, f0, f5 /* 801A7278 001A41D8 D0 21 00 60 */ stfs f1, 0x60(r1) /* 801A727C 001A41DC EC 3E 01 72 */ fmuls f1, f30, f5 /* 801A7280 001A41E0 D0 01 00 58 */ stfs f0, 0x58(r1) /* 801A7284 001A41E4 D0 21 00 5C */ stfs f1, 0x5c(r1) /* 801A7288 001A41E8 4B E8 FE 95 */ bl __ct__8Vector3fFRCfRCfRCf /* 801A728C 001A41EC C0 01 00 84 */ lfs f0, 0x84(r1) /* 801A7290 001A41F0 FC 40 E0 90 */ fmr f2, f28 /* 801A7294 001A41F4 C0 21 00 88 */ lfs f1, 0x88(r1) /* 801A7298 001A41F8 FC 80 D8 90 */ fmr f4, f27 /* 801A729C 001A41FC D0 01 00 6C */ stfs f0, 0x6c(r1) /* 801A72A0 001A4200 C0 01 00 8C */ lfs f0, 0x8c(r1) /* 801A72A4 001A4204 D0 21 00 70 */ stfs f1, 0x70(r1) /* 801A72A8 001A4208 38 E1 00 6C */ addi r7, r1, 0x6c /* 801A72AC 001A420C C0 22 B5 0C */ lfs f1, lbl_803EB70C@sda21(r2) /* 801A72B0 001A4210 7F E5 FB 78 */ mr r5, r31 /* 801A72B4 001A4214 D0 01 00 74 */ stfs f0, 0x74(r1) /* 801A72B8 001A4218 C0 62 B4 E4 */ lfs f3, lbl_803EB6E4@sda21(r2) /* 801A72BC 001A421C 38 7F 05 1C */ addi r3, r31, 0x51c /* 801A72C0 001A4220 38 9F 04 CC */ addi r4, r31, 0x4cc /* 801A72C4 001A4224 38 DE 00 04 */ addi r6, r30, 4 /* 801A72C8 001A4228 39 0D 31 9C */ addi r8, r13, eventCallBack__12BreathEffect@sda21 /* 801A72CC 001A422C 48 01 DD CD */ bl init__16ConeTypeCallBackFP20TAIeffectAttackParamP4TekiR8Vector3f8Vector3fffffP28TAIeffectAttackEventCallBack /* 801A72D0 001A4230 80 6D 31 80 */ lwz r3, effectMgr@sda21(r13) /* 801A72D4 001A4234 38 DF 05 1C */ addi r6, r31, 0x51c /* 801A72D8 001A4238 38 BE 00 04 */ addi r5, r30, 4 /* 801A72DC 001A423C 38 80 00 B0 */ li r4, 0xb0 /* 801A72E0 001A4240 38 E0 00 00 */ li r7, 0 /* 801A72E4 001A4244 4B FF 58 55 */ bl "create__9EffectMgrFQ29EffectMgr12effTypeTableR8Vector3fPQ23zen37CallBack1<PQ23zen17particleGenerator>PQ23zen58CallBack2<PQ23zen17particleGenerator,PQ23zen11particleMdl>" /* 801A72E8 001A4248 28 03 00 00 */ cmplwi r3, 0 /* 801A72EC 001A424C 90 7F 04 98 */ stw r3, 0x498(r31) /* 801A72F0 001A4250 41 82 00 64 */ beq lbl_801A7354 /* 801A72F4 001A4254 80 9E 00 04 */ lwz r4, 4(r30) /* 801A72F8 001A4258 80 1E 00 08 */ lwz r0, 8(r30) /* 801A72FC 001A425C 90 83 00 0C */ stw r4, 0xc(r3) /* 801A7300 001A4260 90 03 00 10 */ stw r0, 0x10(r3) /* 801A7304 001A4264 80 1E 00 0C */ lwz r0, 0xc(r30) /* 801A7308 001A4268 90 03 00 14 */ stw r0, 0x14(r3) /* 801A730C 001A426C 80 81 00 C0 */ lwz r4, 0xc0(r1) /* 801A7310 001A4270 80 01 00 C4 */ lwz r0, 0xc4(r1) /* 801A7314 001A4274 90 83 00 A0 */ stw r4, 0xa0(r3) /* 801A7318 001A4278 90 03 00 A4 */ stw r0, 0xa4(r3) /* 801A731C 001A427C 80 01 00 C8 */ lwz r0, 0xc8(r1) /* 801A7320 001A4280 90 03 00 A8 */ stw r0, 0xa8(r3) /* 801A7324 001A4284 C0 0D 13 74 */ lfs f0, lbl_803E6094@sda21(r13) /* 801A7328 001A4288 C0 2D 13 78 */ lfs f1, lbl_803E6098@sda21(r13) /* 801A732C 001A428C D0 01 00 78 */ stfs f0, 0x78(r1) /* 801A7330 001A4290 C0 0D 13 7C */ lfs f0, lbl_803E609C@sda21(r13) /* 801A7334 001A4294 D0 21 00 7C */ stfs f1, 0x7c(r1) /* 801A7338 001A4298 D0 01 00 80 */ stfs f0, 0x80(r1) /* 801A733C 001A429C 80 81 00 78 */ lwz r4, 0x78(r1) /* 801A7340 001A42A0 80 01 00 7C */ lwz r0, 0x7c(r1) /* 801A7344 001A42A4 90 83 01 DC */ stw r4, 0x1dc(r3) /* 801A7348 001A42A8 90 03 01 E0 */ stw r0, 0x1e0(r3) /* 801A734C 001A42AC 80 01 00 80 */ lwz r0, 0x80(r1) /* 801A7350 001A42B0 90 03 01 E4 */ stw r0, 0x1e4(r3) lbl_801A7354: /* 801A7354 001A42B4 80 6D 31 78 */ lwz r3, rumbleMgr@sda21(r13) /* 801A7358 001A42B8 38 DF 00 94 */ addi r6, r31, 0x94 /* 801A735C 001A42BC 38 80 00 0B */ li r4, 0xb /* 801A7360 001A42C0 38 A0 00 00 */ li r5, 0 /* 801A7364 001A42C4 4B FD 5A 71 */ bl start__9RumbleMgrFiiR8Vector3f lbl_801A7368: /* 801A7368 001A42C8 80 01 01 04 */ lwz r0, 0x104(r1) /* 801A736C 001A42CC 38 60 00 01 */ li r3, 1 /* 801A7370 001A42D0 CB E1 00 F8 */ lfd f31, 0xf8(r1) /* 801A7374 001A42D4 CB C1 00 F0 */ lfd f30, 0xf0(r1) /* 801A7378 001A42D8 CB A1 00 E8 */ lfd f29, 0xe8(r1) /* 801A737C 001A42DC CB 81 00 E0 */ lfd f28, 0xe0(r1) /* 801A7380 001A42E0 CB 61 00 D8 */
4,648
https://github.com/geosmart/flinkx/blob/master/flinkx-connectors/flinkx-connector-sqlservercdc/src/main/java/com/dtstack/flinkx/connector/sqlservercdc/inputFormat/SqlServerCdcInputFormatBuilder.java
Github Open Source
Open Source
Apache-2.0
2,021
flinkx
geosmart
Java
Code
513
2,165
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.dtstack.flinkx.connector.sqlservercdc.inputFormat; import com.dtstack.flinkx.connector.sqlservercdc.conf.SqlServerCdcConf; import com.dtstack.flinkx.connector.sqlservercdc.entity.Lsn; import com.dtstack.flinkx.connector.sqlservercdc.util.SqlServerCdcUtil; import com.dtstack.flinkx.connector.sqlservercdc.entity.SqlServerCdcEnum; import com.dtstack.flinkx.constants.ConstantValue; import com.dtstack.flinkx.converter.AbstractCDCRowConverter; import com.dtstack.flinkx.inputformat.BaseRichInputFormatBuilder; import com.dtstack.flinkx.util.ClassUtil; import com.dtstack.flinkx.util.ExceptionUtil; import com.dtstack.flinkx.util.GsonUtil; import com.dtstack.flinkx.util.RetryUtil; import com.dtstack.flinkx.util.StringUtil; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import java.sql.Connection; import java.sql.SQLException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Set; import static com.dtstack.flinkx.connector.sqlservercdc.util.SqlServerCdcUtil.DRIVER; /** * Date: 2019/12/03 * Company: www.dtstack.com * * @author tudou */ public class SqlServerCdcInputFormatBuilder extends BaseRichInputFormatBuilder { protected SqlServerCdcInputFormat format; public SqlServerCdcInputFormatBuilder() { super.format = this.format = new SqlServerCdcInputFormat(); } public void setSqlServerCdcConf(SqlServerCdcConf sqlServerCdcConf) { super.setConfig(sqlServerCdcConf); this.format.setSqlServerCdcConf(sqlServerCdcConf); } public void setRowConverter(AbstractCDCRowConverter rowConverter) { this.format.setRowConverter(rowConverter); } @Override protected void checkFormat() { StringBuilder sb = new StringBuilder(256); if (StringUtils.isBlank(format.sqlserverCdcConf.getUsername())) { sb.append("No username supplied;\n"); } if (StringUtils.isBlank(format.sqlserverCdcConf.getPassword())) { sb.append("No password supplied;\n"); } if (StringUtils.isBlank(format.sqlserverCdcConf.getUrl())) { sb.append("No url supplied;\n"); } if (StringUtils.isBlank(format.sqlserverCdcConf.getDatabaseName())) { sb.append("No databaseName supplied;\n"); } if (StringUtils.isBlank(format.sqlserverCdcConf.getCat())) { sb.append("No cat supplied;\n"); } if (sb.length() > 0) { throw new IllegalArgumentException(sb.toString()); } //校验cat HashSet<String> set = Sets.newHashSet( SqlServerCdcEnum.DELETE.name, SqlServerCdcEnum.UPDATE.name, SqlServerCdcEnum.INSERT.name); ArrayList<String> cats = Lists.newArrayList(format.sqlserverCdcConf.getCat().split(ConstantValue.COMMA_SYMBOL)); cats.removeIf(s -> set.contains(s.toLowerCase(Locale.ENGLISH))); if (CollectionUtils.isNotEmpty(cats)) { sb.append("sqlServer cat not support-> ") .append(GsonUtil.GSON.toJson(cats)) .append(",just support->") .append(GsonUtil.GSON.toJson(set)) .append(";\n"); } ClassUtil.forName(DRIVER, getClass().getClassLoader()); try (Connection conn = RetryUtil.executeWithRetry( () -> SqlServerCdcUtil.getConnection(format.sqlserverCdcConf.getUrl(), format.sqlserverCdcConf.getUsername(), format.sqlserverCdcConf.getPassword()), SqlServerCdcUtil.RETRY_TIMES, SqlServerCdcUtil.SLEEP_TIME, false)) { //check database cdc is enable SqlServerCdcUtil.changeDatabase(conn, format.sqlserverCdcConf.getDatabaseName()); if (!SqlServerCdcUtil.checkEnabledCdcDatabase(conn, format.sqlserverCdcConf.getDatabaseName())) { sb.append(format.sqlserverCdcConf.getDatabaseName()).append(" is not enable sqlServer CDC;\n") .append("please execute sql for enable databaseCDC:\nUSE ").append(format.sqlserverCdcConf.getDatabaseName()).append("\nGO\nEXEC sys.sp_cdc_enable_db\nGO\n\n "); } if (sb.length() > 0) { throw new IllegalArgumentException(sb.toString()); } //check table cdc is enable Set<String> unEnabledCdcTables = SqlServerCdcUtil.checkUnEnabledCdcTables(conn, format.sqlserverCdcConf.getTableList()); if (CollectionUtils.isNotEmpty(unEnabledCdcTables)) { String tables = unEnabledCdcTables.toString(); sb.append(GsonUtil.GSON.toJson(tables)).append(" is not enable sqlServer CDC;\n") .append("please execute sql for enable tableCDC: "); String tableEnableCdcTemplate = "\n\n EXEC sys.sp_cdc_enable_table \n@source_schema = '%s',\n@source_name = '%s',\n@role_name = NULL,\n@supports_net_changes = 0;"; for (String table : unEnabledCdcTables) { List<String> strings = StringUtil.splitIgnoreQuota(table, ConstantValue.POINT_SYMBOL.charAt(0)); if (strings.size() == 2) { sb.append(String.format(tableEnableCdcTemplate, strings.get(0), strings.get(1))); } else if (strings.size() == 1) { sb.append(String.format(tableEnableCdcTemplate, "yourSchema", strings.get(0))); } } } //check lsn if over max lsn Lsn currentMaxLsn = SqlServerCdcUtil.getMaxLsn(conn); if (StringUtils.isNotBlank(format.sqlserverCdcConf.getLsn())) { if (currentMaxLsn.compareTo(Lsn.valueOf(format.sqlserverCdcConf.getLsn())) < 0) { sb.append("lsn: '").append(format.sqlserverCdcConf.getLsn()).append("' does not exist;\n"); } } if (sb.length() > 0) { throw new IllegalArgumentException(sb.toString()); } } catch (SQLException e) { StringBuilder detailsInfo = new StringBuilder(sb.length() + 128); if (sb.length() > 0) { detailsInfo.append("sqlserverCDC config not right,details is ").append(sb.toString()); } detailsInfo.append(" \n error to check sqlServerCDC config, e = ").append(ExceptionUtil.getErrorMessage(e)); throw new RuntimeException(detailsInfo.toString(), e); } } }
3,981
https://github.com/wellengineered-us/ninnel/blob/master/src/WellEngineered.Ninnel.Configuration/HostConfiguration.async.cs
Github Open Source
Open Source
MIT
null
ninnel
wellengineered-us
C#
Code
378
1,325
/* Copyright ©2020-2022 WellEngineered.us, all rights reserved. Distributed under the MIT license: http://www.opensource.org/licenses/mit-license.php */ #if ASYNC_ALL_THE_WAY_DOWN using System; using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; using WellEngineered.Ninnel.Primitives; using WellEngineered.Ninnel.Primitives.Configuration; using WellEngineered.Solder.Primitives; namespace WellEngineered.Ninnel.Configuration { public partial class HostConfiguration : NinnelConfiguration { #region Methods/Operators protected override async IAsyncEnumerable<IMessage> CoreValidateAsync(object context, [EnumeratorCancellation] CancellationToken cancellationToken = default) { Type ninnelHostType; //Type ninnelContextType; if ((object)MinimumConfigurationVersion == null || (object)CurrentConfigurationVersion == null) throw new NinnelException(string.Format("{0} ({1}) and/or {2} ({3}) is null.", nameof(MinimumConfigurationVersion), MinimumConfigurationVersion, nameof(CurrentConfigurationVersion), CurrentConfigurationVersion)); if (MinimumConfigurationVersion > CurrentConfigurationVersion) throw new NinnelException(string.Format("{0} ({1}) is greater than {2} ({3}).", nameof(MinimumConfigurationVersion), MinimumConfigurationVersion, nameof(CurrentConfigurationVersion), CurrentConfigurationVersion)); if (string.IsNullOrEmpty(this.ConfigurationVersion) || !Version.TryParse(this.ConfigurationVersion, out Version cv)) yield return new Message(string.Empty, string.Format("{0} configuration error: missing or invalid property {1}.", context, nameof(this.ConfigurationVersion)), Severity.Error); else if ((object)cv == null || cv < MinimumConfigurationVersion || cv > CurrentConfigurationVersion) yield return new Message(string.Empty, string.Format("{0} configuration error: value of property {1} ({2}) is out of range [{3} ({4}) , {5} ({6})].", context, nameof(this.ConfigurationVersion), this.ConfigurationVersion, nameof(MinimumConfigurationVersion), MinimumConfigurationVersion, nameof(CurrentConfigurationVersion), CurrentConfigurationVersion), Severity.Error); if (string.IsNullOrWhiteSpace(this.HostAssemblyQualifiedTypeName)) yield return new Message(string.Empty, string.Format("{0} assembly qualified type name is required.", context), Severity.Error); else { ninnelHostType = this.GetHostType(); if ((object)ninnelHostType == null) yield return new Message(string.Empty, string.Format("{0} assembly qualified type name failed to load.", context), Severity.Error); /*else if (!typeof(INinnelHost).IsAssignableFrom(ninnelHostType)) yield return new Message(string.Empty, string.Format("{0} assembly qualified type name loaded an unrecognized type.", context), Severity.Error); else { ninnelHost = ReflectionExtensions.CreateInstanceAssignableToTargetType<INinnelHost>(ninnelHostType); if ((object)ninnelHost == null) yield return new Message(string.Empty, string.Format("{0} assembly qualified type name failed to instantiate type.", context), Severity.Error); }*/ } /*if (string.IsNullOrWhiteSpace(this.ContextAssemblyQualifiedTypeName)) yield return new Message(string.Empty, string.Format("{0} context assembly qualified type name is required.", context), Severity.Error); else { ninnelContextType = this.GetContextType(); if ((object)ninnelContextType == null) yield return new Message(string.Empty, string.Format("{0} context assembly qualified type name failed to load.", context), Severity.Error); else if (!typeof(INinnelContext).IsAssignableFrom(ninnelContextType)) yield return new Message(string.Empty, string.Format("{0} context assembly qualified type name loaded an unrecognized type.", context), Severity.Error); else { // new-ing up via default public constructor should be low friction ninnelContext = ReflectionExtensions.CreateInstanceAssignableToTargetType<INinnelContext>(ninnelContextType); if ((object)ninnelContext == null) yield return new Message(string.Empty, string.Format("{0} context assembly qualified type name failed to instantiate type.", context), Severity.Error); } }*/ if ((object)this.PipelineConfigurations == null) yield return new Message(string.Empty, string.Format("Pipeline configurations are required."), Severity.Error); else { var childMessages = this.PipelineConfigurations.ValidateAsync("Pipeline", cancellationToken); await foreach (var childMessage in childMessages.WithCancellation(cancellationToken)) { yield return childMessage; } } } #endregion } } #endif
37,967
https://github.com/miguelwdmachado/docker/blob/master/app/Http/Requests/UpdateCreateCorredoresRequest.php
Github Open Source
Open Source
MIT
null
docker
miguelwdmachado
PHP
Code
101
274
<?php namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class UpdateCreateCorredoresRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ '_token' => 'required', 'nome' => 'required|min:3|max:255', 'cpf' => 'required', 'dt_nascimento' => 'required', ]; } public function messages() { return [ '_token.required' => '_token é obrigatório', 'nome.required' => 'nome é obrigatório', 'cpf.required' => 'cpf é obrigatório', 'dt_nascimento.required' => 'data de nascimento é obrigatório', ]; } }
11,233
https://github.com/xfreshx/coreroller/blob/master/backend/vendor/src/github.com/mgutz/minimist/tasks/Godofile.go
Github Open Source
Open Source
Apache-2.0
2,021
coreroller
xfreshx
Go
Code
30
89
package main import . "github.com/mgutz/godo/v1" // Tasks is the entry point for Godo. func Tasks(p *Project) { p.Task("test", W{"*.go"}, func() { Run("go test") }) } func main() { Godo(Tasks) }
50,874
https://github.com/Commantary/Conqueror-s-bot/blob/master/module/arriverdeparts.js
Github Open Source
Open Source
MIT
null
Conqueror-s-bot
Commantary
JavaScript
Code
133
385
/* * * @para {Client} client - The discord.js client. * */ const request = require('request') module.exports = function (client) { // LES VARIABLES // QUAND UN MEMBRE REJOINT LE SERVEUR client.on('guildMemberAdd', member => { var channelId = member.guild.channels.find("name", "nouveaux-seigneurs"); channelId.send({embed: { color: 65280, author: { name: 'Nouveaux seigneur !', icon_url: member.user.avatarURL }, thumbnail: { url: member.user.avatarURL }, description: "Bienvenue seigneur **" + member.user.username + "** !" }}) }) // FIN DU GUILDMEMBERADD // QUAND UN MEMBRE QUITTE LE SERVEUR client.on('guildMemberRemove', member => { var channelId = member.guild.channels.find("name", "nouveaux-seigneurs"); channelId.send({embed: { color: 14614785, author: { name: 'Un seigneur en moins !', icon_url: member.user.avatarURL }, thumbnail: { url: member.user.avatarURL }, description: "Au revoir seigneur **" + member.user.username + "** !" }}) }) // FIN DE L'EVENT QUILD MEMBER REMOVE } // FIN DU MODULE
17,988
https://github.com/biz2013/xwjy/blob/master/coinExchange/trading/views/models/userexternalwalletaddrinfo.py
Github Open Source
Open Source
Apache-2.0
2,019
xwjy
biz2013
Python
Code
24
71
class UserExternalWalletAddressInfo(object): def __init__(self, id, userId, alias, address, crypto): self.id = id self.userid = userId self.alias = alias self.address = address self.crypto = crypto
13,169
https://github.com/fm-reda/twitter-project-server/blob/master/app/Twitter.php
Github Open Source
Open Source
MIT
2,020
twitter-project-server
fm-reda
PHP
Code
29
93
<?php namespace App; use Illuminate\Database\Eloquent\Model; class Twitter extends Model { protected $table = 'twitters'; protected $fillable = ['twitterID', 'name', 'text', 'avatar']; public function user() { return $this->belongsTo('App\User'); } }
8,596
https://github.com/BlockChain-UROP/Analyzing-Smart-Contract-Interactions-and-Contract-Level-State-Consensus/blob/master/contracts/ICustodian.sol
Github Open Source
Open Source
MIT
2,021
Analyzing-Smart-Contract-Interactions-and-Contract-Level-State-Consensus
BlockChain-UROP
Solidity
Code
103
264
pragma solidity ^0.4.24; contract ICustodian { uint8 public THRESHOLD_OF_PARTICIPANTS; uint256 public numOfTotalVoterClients; bytes32 public newly_opened_seq; bytes32 public last_finalized_seq; mapping (bytes32 => uint256) public votesCountOnCamp; // Total number of votes mapping (bytes32 => uint8) public finalResultOnCamp; // Final result: 0 as not finalized, 1 as true, 2 as false mapping (bytes32 => int) public currVotesBalanceOnCamp; // Current vote balance mapping (address => bool) public clientIsKnown; // Client is known/or not, to calculate total number of clients mapping (address => mapping (bytes32 => bool)) clientHasVotedOnSeq; mapping (bytes32 => bool) public campHasFinished; function acceptVote(bytes32 _seq, bool _value) public; event VoteCampFinished( bytes32 seq, uint8 finalResult ); }
9,136
https://github.com/stwind/umbrella/blob/master/packages/bench/src/index.ts
Github Open Source
Open Source
Apache-2.0
null
umbrella
stwind
TypeScript
Code
275
510
export type TimingResult<T> = [T, number]; /** * Calls function `fn` without args, prints elapsed time and returns * fn's result. The optional `prefix` will be displayed with the output, * allowing to label different measurements. * * @param fn * @param prefix */ export const timed = <T>(fn: () => T, prefix = "") => { const t0 = Date.now(); const res = fn(); console.log(prefix + (Date.now() - t0) + "ms"); return res; }; /** * Similar to `timed()`, but produces no output and instead returns * tuple of `fn`'s result and the time measurement. * * @param fn */ export const timedResult = <T>(fn: () => T): TimingResult<T> => { const t0 = Date.now(); const res = fn(); return [res, Date.now() - t0]; }; /** * Executes given function `n` times, prints elapsed time to console and * returns last result from fn. The optional `prefix` will be displayed * with the output, allowing to label different measurements. * * @param fn * @param n */ export const bench = <T>(fn: () => T, n = 1e6, prefix = "") => { let res: T; return timed( () => { while (n-- > 0) { res = fn(); } return res; }, prefix ); }; /** * Similar to `bench()`, but produces no output and instead returns * tuple of `fn`'s last result and the grand total time measurement. * * @param fn * @param n */ export const benchResult = <T>(fn: () => T, n = 1e6): TimingResult<T> => { let res: T; return timedResult( () => { while (n-- > 0) { res = fn(); } return res; } ); };
22,407
https://github.com/PhilipPurwoko/PHP-GamePenjumlahan/blob/master/index.php
Github Open Source
Open Source
MIT
2,021
PHP-GamePenjumlahan
PhilipPurwoko
PHP
Code
162
891
<?php require_once('create.php'); if (isset($_POST['submit'])) { setcookie("name", $_POST['name'], time() + 3 * 30 * 24 * 3600, "/"); setcookie("email", $_POST['email'], time() + 3 * 30 * 24 * 3600, "/"); header("Location:index.php"); } ?> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous"></script> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous"> <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.min.js" integrity="sha384-+YQ4JLhjyBLPDQt//I+STsc9iw4uQqACwlvpslubQzn4u2UU2UFM80nGisd026JF" crossorigin="anonymous"></script> <nav class="navbar navbar-dark bg-dark"> <h2 class="navbar-brand">Game Penjumlahan</h2> </nav> <?php if (isset($_COOKIE['name'])) { echo '<div class="container"><div class="row"><div class="col">'; echo "<p>Halo " . $_COOKIE["name"] . ", selamat datang kembali di permainan ini !!</p> <a href='views/game.php' class='btn btn-primary mb-3'>Mulai Permainan</a> <form method='POST' action='reset.php'> <input class='btn btn-warning' type='submit' name='reset' value='Bukan Anda ?'> </form>"; echo '</div></div></div>'; } else { ?> <div class="container"> <div class="row"> <div class="col"> <form method="POST" action="index.php"> <div class="form-group"> <label for="name">Masukkan Nama Anda</label> <input class="form-control" type="text" name="name" placeholder="Nama"> </div> <div class="form-group"> <label for="name">Masukkan Email Anda</label> <input class="form-control" type="email" name="email" placeholder="Email"> </div> <input class="btn btn-primary btn-block" type="submit" name="submit"> </form> <p class="text text-muted">Copyright Philip Purwoko, A.P - NIM K3519066 - Kelas B</p> </div> </div> </div> <?php } ?>
3,218
https://github.com/madisonbikes/cyclists_of_msn/blob/master/src/main/kotlin/org/madisonbikes/cyclistsofmsn/common/CommonConfiguration.kt
Github Open Source
Open Source
Apache-2.0
2,020
cyclists_of_msn
madisonbikes
Kotlin
Code
54
102
/* * Copyright (c) 2020 Madison Bikes, Inc. */ package org.madisonbikes.cyclistsofmsn.common /** * Common configuration attributes that may be used by multiple tasks. */ interface CommonConfiguration { /** dry run mode should limit filesystem and network? calls */ val dryRun: Boolean /** prepend a random delay to the task */ val randomDelay: Long }
3,388
https://github.com/LiamBirt/dpc-app/blob/master/dpc-go/dpc-api/src/main.go
Github Open Source
Open Source
CC0-1.0
2,021
dpc-app
LiamBirt
Go
Code
91
459
package main import ( "context" "fmt" "net/http" "github.com/CMSgov/dpc/api/client" "github.com/CMSgov/dpc/api/conf" "github.com/CMSgov/dpc/api/logger" "github.com/CMSgov/dpc/api/router" v2 "github.com/CMSgov/dpc/api/v2" "go.uber.org/zap" ) func main() { conf.NewConfig() ctx := context.Background() defer func() { err := logger.SyncLogger() logger.WithContext(ctx).Fatal("Failed to start server", zap.Error(err)) }() attributionURL := conf.GetAsString("attribution-client.url") retries := conf.GetAsInt("attribution-client.retries", 3) attributionClient := client.NewAttributionClient(client.AttributionConfig{ URL: attributionURL, Retries: retries, }) orgCtlr := v2.NewOrganizationController(attributionClient) capabilitiesFile := conf.GetAsString("capabilities.base") m := v2.NewMetadataController(capabilitiesFile) groupCtlr := v2.NewGroupController(attributionClient) apiRouter := router.NewDPCAPIRouter(orgCtlr, m, groupCtlr) // authRouter := router.NewAuthRouter() port := conf.GetAsString("port", "3000") if err := http.ListenAndServe(fmt.Sprintf(":%s", port), apiRouter); err != nil { logger.WithContext(ctx).Fatal("Failed to start server", zap.Error(err)) } }
22,974
https://github.com/The-Compiler/pytest-bdd/blob/master/tests/feature/test_scenarios.py
Github Open Source
Open Source
MIT
2,016
pytest-bdd
The-Compiler
Python
Code
152
636
"""Test scenarios shortcut.""" import textwrap def test_scenarios(testdir): """Test scenarios shortcut.""" testdir.makeconftest(""" import pytest from pytest_bdd import given @given('I have a bar') def i_have_bar(): print('bar!') return 'bar' """) features = testdir.mkdir('features') features.join('test.feature').write_text(textwrap.dedent(u""" Scenario: Test scenario Given I have a bar """), 'utf-8', ensure=True) features.join('subfolder', 'test.feature').write_text(textwrap.dedent(u""" Scenario: Test subfolder scenario Given I have a bar Scenario: Test failing subfolder scenario Given I have a failing bar Scenario: Test already bound scenario Given I have a bar Scenario: Test scenario Given I have a bar """), 'utf-8', ensure=True) testdir.makepyfile(""" import pytest from pytest_bdd import scenarios, scenario @scenario('features/subfolder/test.feature', 'Test already bound scenario') def test_already_bound(): pass scenarios('features') """) result = testdir.runpytest('-v', '-s') result.stdout.fnmatch_lines(['*collected 5 items']) result.stdout.fnmatch_lines(['*test_test_subfolder_scenario *bar!', 'PASSED']) result.stdout.fnmatch_lines(['*test_test_scenario *bar!', 'PASSED']) result.stdout.fnmatch_lines(['*test_test_failing_subfolder_scenario *FAILED']) result.stdout.fnmatch_lines(['*test_already_bound *bar!', 'PASSED']) result.stdout.fnmatch_lines(['*test_test_scenario_1 *bar!', 'PASSED']) def test_scenarios_none_found(testdir): """Test scenarios shortcut when no scenarios found.""" testpath = testdir.makepyfile(""" import pytest from pytest_bdd import scenarios scenarios('.') """) reprec = testdir.inline_run(testpath) reprec.assertoutcome(failed=1) assert 'NoScenariosFound' in str(reprec.getreports()[1].longrepr)
3,967
https://github.com/FiveTimesTheFun/buildtools/blob/master/src/Microsoft.Cci.Extensions/Internal/DisposeAction.cs
Github Open Source
Open Source
MIT
2,020
buildtools
FiveTimesTheFun
C#
Code
70
143
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace System { // Helper that could be part of the BCL internal class DisposeAction : IDisposable { private Action _action; public DisposeAction(Action action) { _action = action; } public void Dispose() { if (_action != null) { _action(); _action = null; } } } }
32,052
https://github.com/YannickBochatay/react-toolbox/blob/master/lib/Clock/descript.js
Github Open Source
Open Source
MIT
2,017
react-toolbox
YannickBochatay
JavaScript
Code
108
323
"use strict"; var _react = require("react"); var _react2 = _interopRequireDefault(_react); var _ = require("./"); var _2 = _interopRequireDefault(_); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = { categ: "UI components", description: "Affichage de l'heure courante à différents fuseaux horaires", construct: _2.default, path: "react-toolbox/lib/Clock", states: { default: function _default() { return _react2.default.createElement(_2.default, null); }, paris: function paris() { return _react2.default.createElement(_2.default, { timezone: "Europe/Paris", style: { color: "red" } }); }, tokyo: function tokyo() { return _react2.default.createElement(_2.default, { timezone: "Asia/Tokyo" }); } } }; ; var _temp = function () { if (typeof __REACT_HOT_LOADER__ === 'undefined') { return; } }(); ;
33,478
https://github.com/linearregression/jwt-erl/blob/master/Makefile
Github Open Source
Open Source
MIT
2,014
jwt-erl
linearregression
Makefile
Code
8
20
PROJECT = jwt DEPS = jsx include erlang.mk
9,186
https://github.com/simonw/sqlite-utils/blob/master/tests/test_analyze.py
Github Open Source
Open Source
Apache-2.0
2,023
sqlite-utils
simonw
Python
Code
125
701
import pytest @pytest.fixture def db(fresh_db): fresh_db["one_index"].insert({"id": 1, "name": "Cleo"}, pk="id") fresh_db["one_index"].create_index(["name"]) fresh_db["two_indexes"].insert({"id": 1, "name": "Cleo", "species": "dog"}, pk="id") fresh_db["two_indexes"].create_index(["name"]) fresh_db["two_indexes"].create_index(["species"]) return fresh_db def test_analyze_whole_database(db): assert set(db.table_names()) == {"one_index", "two_indexes"} db.analyze() assert set(db.table_names()).issuperset( {"one_index", "two_indexes", "sqlite_stat1"} ) assert list(db["sqlite_stat1"].rows) == [ {"tbl": "two_indexes", "idx": "idx_two_indexes_species", "stat": "1 1"}, {"tbl": "two_indexes", "idx": "idx_two_indexes_name", "stat": "1 1"}, {"tbl": "one_index", "idx": "idx_one_index_name", "stat": "1 1"}, ] @pytest.mark.parametrize("method", ("db_method_with_name", "table_method")) def test_analyze_one_table(db, method): assert set(db.table_names()).issuperset({"one_index", "two_indexes"}) if method == "db_method_with_name": db.analyze("one_index") elif method == "table_method": db["one_index"].analyze() assert set(db.table_names()).issuperset( {"one_index", "two_indexes", "sqlite_stat1"} ) assert list(db["sqlite_stat1"].rows) == [ {"tbl": "one_index", "idx": "idx_one_index_name", "stat": "1 1"} ] def test_analyze_index_by_name(db): assert set(db.table_names()) == {"one_index", "two_indexes"} db.analyze("idx_two_indexes_species") assert set(db.table_names()).issuperset( {"one_index", "two_indexes", "sqlite_stat1"} ) assert list(db["sqlite_stat1"].rows) == [ {"tbl": "two_indexes", "idx": "idx_two_indexes_species", "stat": "1 1"}, ]
50,930
https://github.com/roboconf/roboconf-platform/blob/master/core/roboconf-core/src/test/java/net/roboconf/core/dsl/ParsingModelIoTest.java
Github Open Source
Open Source
Apache-2.0
2,022
roboconf-platform
roboconf
Java
Code
730
2,167
/** * Copyright 2014-2017 Linagora, Université Joseph Fourier, Floralis * * The present code is developed in the scope of the joint LINAGORA - * Université Joseph Fourier - Floralis research program and is designated * as a "Result" pursuant to the terms and conditions of the LINAGORA * - Université Joseph Fourier - Floralis research program. Each copyright * holder of Results enumerated here above fully & independently holds complete * ownership of the complete Intellectual Property rights applicable to the whole * of said Results, and may freely exploit it in any manner which does not infringe * the moral rights of the other copyright holders. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.roboconf.core.dsl; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.junit.Assert; import org.junit.Test; import net.roboconf.core.dsl.parsing.AbstractBlock; import net.roboconf.core.dsl.parsing.BlockInstanceOf; import net.roboconf.core.dsl.parsing.FileDefinition; import net.roboconf.core.errors.ErrorCode; import net.roboconf.core.internal.tests.TestUtils; import net.roboconf.core.utils.Utils; /** * @author Vincent Zurczak - Linagora */ public class ParsingModelIoTest { private static final String PATH = "/configurations/valid"; @Test public void testFileTypes() throws Exception { Map<String,Integer> fileNameToFileType = new LinkedHashMap<> (); fileNameToFileType.put( "commented-import-1.graph", FileDefinition.AGGREGATOR ); fileNameToFileType.put( "only-import-1.graph", FileDefinition.AGGREGATOR ); fileNameToFileType.put( "commented-import-3.graph", FileDefinition.AGGREGATOR ); fileNameToFileType.put( "only-component-3.graph", FileDefinition.GRAPH ); fileNameToFileType.put( "only-component-4.graph", FileDefinition.GRAPH ); fileNameToFileType.put( "real-lamp-all-in-one.graph", FileDefinition.GRAPH ); fileNameToFileType.put( "real-lamp-all-in-one-flex.graph", FileDefinition.GRAPH ); fileNameToFileType.put( "real-lamp-components.graph", FileDefinition.GRAPH ); fileNameToFileType.put( "commented-component-2.graph", FileDefinition.GRAPH ); fileNameToFileType.put( "instance-single.instances", FileDefinition.INSTANCE ); fileNameToFileType.put( "instance-multiple.instances", FileDefinition.INSTANCE ); fileNameToFileType.put( "instance-imbricated-3.instances", FileDefinition.INSTANCE ); for( Map.Entry<String,Integer> entry : fileNameToFileType.entrySet()) { File f = TestUtils.findTestFile( PATH + "/" + entry.getKey()); FileDefinition rel = ParsingModelIo.readConfigurationFile( f, false ); Assert.assertEquals( "Invalid file type for " + entry.getKey(), entry.getValue().intValue(), rel.getFileType()); Assert.assertEquals( entry.getKey(), 0, rel.getParsingErrors().size()); } } @Test public void testInvalidFileType() throws Exception { File f = TestUtils.findTestFile( "/configurations/invalid/mix.txt" ); FileDefinition def = ParsingModelIo.readConfigurationFile( f, true ); Assert.assertEquals( 1, def.getParsingErrors().size()); Assert.assertEquals( ErrorCode.P_INVALID_FILE_TYPE, def.getParsingErrors().iterator().next().getErrorCode()); } @Test public void testComplexInstances() throws Exception { File f = TestUtils.findTestFile( "/configurations/valid/complex-instances.instances" ); FileDefinition def = ParsingModelIo.readConfigurationFile( f, true ); Assert.assertEquals( 0, def.getParsingErrors().size()); List<AbstractBlock> toProcess = new ArrayList<> (); toProcess.addAll( def.getBlocks()); List<BlockInstanceOf> instances = new ArrayList<> (); while( ! toProcess.isEmpty()) { AbstractBlock currentBlock = toProcess.remove( 0 ); if( currentBlock.getInstructionType() == AbstractBlock.INSTANCEOF ) { BlockInstanceOf blockInstanceOf = (BlockInstanceOf) currentBlock; instances.add( blockInstanceOf ); toProcess.addAll( blockInstanceOf.getInnerBlocks()); } } // Keep a list instead of a count, so that we can read the // list content at debug time. Assert.assertEquals( 8, instances.size()); } @Test public void testLoadingAndWritingOfValidFile() throws Exception { List<File> validFiles = TestUtils.findTestFiles( PATH ); for( File f : validFiles ) { if( ! "instance-with-space-after.instances".equals( f.getName()) && ! "component-with-complex-variables-values.graph".equals( f.getName()) && ! "app-template-descriptor.properties".equals( f.getName())) testLoadingAndWritingOfValidFile( f ); } } @Test( expected = IOException.class ) public void saveRelatrionFileRequiresTargetFile() throws Exception { FileDefinition def = new FileDefinition((File) null ); ParsingModelIo.saveRelationsFile( def, true, "\n " ); } /** * @param f */ private static void testLoadingAndWritingOfValidFile( File f ) throws Exception { // Preserving comments FileDefinition rel = ParsingModelIo.readConfigurationFile( f, false ); Assert.assertTrue( f.getName() + ": parsing errors were found.", rel.getParsingErrors().isEmpty()); String fileContent = Utils.readFileContent( f ); fileContent = fileContent.replaceAll( "\r?\n", System.getProperty( "line.separator" )); String s = ParsingModelIo.writeConfigurationFile( rel, true, null ); Assert.assertEquals( f.getName() + ": serialized model is different from the source.", fileContent, s ); // The same, but without writing comments s = ParsingModelIo.writeConfigurationFile( rel, false, null ); Assert.assertFalse( f.getName() + ": serialized model should not contain a comment delimiter.", s.contains( ParsingConstants.COMMENT_DELIMITER )); // Ignore comments at parsing time rel = ParsingModelIo.readConfigurationFile( f, true ); Assert.assertTrue( f.getName() + ": parsing errors were found.", rel.getParsingErrors().isEmpty()); s = ParsingModelIo.writeConfigurationFile( rel, true, null ); Assert.assertFalse( f.getName() + ": serialized model should not contain a comment delimiter.", s.contains( ParsingConstants.COMMENT_DELIMITER )); s = ParsingModelIo.writeConfigurationFile( rel, false, null ); Assert.assertFalse( f.getName() + ": serialized model should not contain a comment delimiter.", s.contains( ParsingConstants.COMMENT_DELIMITER )); } /** * To use for debug. * @param args */ public static void main( String[] args ) { try { File f = TestUtils.findTestFile( PATH + "/commented-import-2.graph" ); testLoadingAndWritingOfValidFile( f ); } catch( Exception e ) { e.printStackTrace(); } } }
30,911
https://github.com/peyoo/iVersion/blob/master/Examples/iPhone Demo/Classes/iVersionViewController.m
Github Open Source
Open Source
Zlib
2,015
iVersion
peyoo
Objective-C
Code
34
110
// // iVersionViewController.m // iVersion // // Created by Nick Lockwood on 26/01/2011. // Copyright 2011 Charcoal Design. All rights reserved. // #import "iVersionViewController.h" @implementation iVersionViewController - (BOOL)shouldAutorotateToInterfaceOrientation:(__unused UIInterfaceOrientation)toInterfaceOrientation { return YES; } @end
8,235
https://github.com/universalvr/universalvr.org/blob/master/pages/guidelines/visual.js
Github Open Source
Open Source
Apache-2.0
null
universalvr.org
universalvr
JavaScript
Code
400
784
import BackTo from '../../components/back-to' import Container from '../../components/container' import GuidelinesList from '../../components/guideline-list' import H1 from '../../components/typography/h1' import Head from 'next/head' import Link from 'next/link' import P from '../../components/typography/p' import React from 'react' const items = [ { number: 'VIS 1.1', desc: 'Allow zooming in closer to and away from details.', }, { number: 'VIS 1.2', desc: 'Allow enlarging and reducing the size of intractable objects and text.', }, { number: 'VIS 1.3', desc: 'Add indicators in central vision for important objects in peripheral vision.', note: 'Users with loss of peripheral vision objects beyond their central field of vision may go unnoticed unless prompted to turn towards them, either through visual cues( arrows) or aural cues.', }, { number: 'VIS 1.4', desc: 'Allow for the customization of font, font size, font background, font color and the distance at which to display text.', note: 'Some fonts work better for low vision and others solve for dyslexia. Larger text size reduces eye strain. Contrast between font color and background color for font can make a difference for clarity of text. Text displayed at a distance can appear blurry to a user with low vision.', }, { number: 'VIS 1.5', desc: 'Allow for adjustment of contrast and brightness.', }, { number: 'VIS 1.6', desc: 'Allow edge enhancements and depth measurements.', }, { number: 'VIS 1.7', desc: 'Allow for filtering colors or add texture and symbols to highlight distinction between elements when necessary.', note: 'Users with color blindness cannot discern some or all colors. It is important to ensure no important information is conveyed only with color.', }, { number: 'VIS 1.8', desc: 'Add audio descriptions that can identify objects or elements audibly.', }, { number: 'VIS 1.9', desc: 'Use spatial audio and haptics to orient users towards the objects.', }, { number: 'VIS 1.10', desc: 'Add text to speech to describe written elements.', }, { number: 'VIS 1.11', desc: 'Allow muting of non-critical content.', }, ] export default function GuidelinesPage() { return ( <Container> <Head> <title>Universal VR Guidelines: Visual</title> <meta name="description" content="Visual Guidelines for making VR more accessible." /> </Head> <H1>Guidelines: Visual</H1> <P>The visual accessibility guidelines solve for: low vision, loss of peripheral vision, blindness, color blindness, eye strain, light sensitivity, loss of central vision, blurry vision, blindspots, lack of depth perception. Solutions to the guidelines include: haptic feedback, audio feedback, and visual enhancements.</P> <GuidelinesList items={items} /> <BackTo href="/guidelines" label="Guidelines" /> </Container> ) }
18,368
https://github.com/rbsheth/cppcodec/blob/master/test/benchmark_cppcodec.cpp
Github Open Source
Open Source
MIT
2,022
cppcodec
rbsheth
C++
Code
652
2,008
/** * Copyright (C) 2018 Jakob Petsovits * All rights reserved. * * 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. */ #include <cppcodec/hex_lower.hpp> #include <cppcodec/base32_rfc4648.hpp> #include <cppcodec/base64_rfc4648.hpp> #include <chrono> #include <iostream> #include <iomanip> #include <random> #include <stdint.h> #include <string> #include <vector> #define BENCHMARK_ENCODING_STR true #define BENCHMARK_DECODING_STR true #define BENCHMARK_DECODING_VEC_U8 true const size_t max_iterations = 1000000; // 1m iterations ought to be enough for anybody const size_t iteration_max_ms = 500; // half a second uint8_t random_uint8() { static std::random_device rd; static std::mt19937 pseudo_random(rd()); static std::uniform_int_distribution<int> dist(0, 255); return static_cast<uint8_t>(dist(pseudo_random)); } template <typename Codec> void benchmark(std::ostream& stream, const std::vector<size_t>& decoded_sizes) { using clock = std::chrono::high_resolution_clock; // Measure decoding into both uint8_t and string. std::vector<double> time_encoding_str(decoded_sizes.size()); std::vector<double> time_decoding_vec_u8(decoded_sizes.size()); std::vector<double> time_decoding_str(decoded_sizes.size()); std::vector<std::vector<uint8_t>> decoded_vec_u8(decoded_sizes.size()); std::vector<std::string> decoded_str(decoded_sizes.size()); std::vector<std::string> encoded_str(decoded_sizes.size()); for (size_t i = 0; i < decoded_sizes.size(); ++i) { decoded_vec_u8[i].resize(decoded_sizes[i]); for (size_t j = 0; j < decoded_sizes[i]; ++j) { decoded_vec_u8[i][j] = random_uint8(); } } auto flags = stream.flags(); auto precision = stream.precision(); stream << std::fixed << std::setprecision(4); #if BENCHMARK_ENCODING_STR stream << "Encoding:\n"; for (size_t i = 0; i < decoded_sizes.size(); ++i) { encoded_str[i] = Codec::encode(decoded_vec_u8[i]); clock::time_point start = clock::now(); clock::time_point end = start + std::chrono::milliseconds(iteration_max_ms); size_t j = 0; for (; j < max_iterations; ++j) { if (clock::now() > end) { break; } encoded_str[i] = Codec::encode(decoded_vec_u8[i]); } time_encoding_str[i] = std::chrono::duration_cast<std::chrono::microseconds>( clock::now() - start).count() / static_cast<double>(j); stream << (i == 0 ? "" : "\t") << decoded_sizes[i] << ": " << time_encoding_str[i] << std::flush; } stream << "\n"; #else // Even if we're not benchmarking encoding, we still need the encoded strings. for (size_t i = 0; i < decoded_sizes.size(); ++i) { encoded_str[i] = Codec::encode(decoded_vec_u8[i]); } #endif // BENCHMARK_ENCODING_STR #if BENCHMARK_DECODING_STR stream << "Decoding to string:\n"; for (size_t i = 0; i < decoded_sizes.size(); ++i) { decoded_str[i] = std::string(); clock::time_point start = clock::now(); clock::time_point end = start + std::chrono::milliseconds(iteration_max_ms); size_t j = 0; for (; j < max_iterations; ++j) { if (clock::now() > end) { break; } decoded_str[i] = Codec::template decode<std::string>(encoded_str[i]); } time_decoding_str[i] = std::chrono::duration_cast<std::chrono::microseconds>( clock::now() - start).count() / static_cast<double>(j); stream << (i == 0 ? "" : "\t") << decoded_sizes[i] << ": " << time_decoding_str[i] << std::flush; } stream << "\n"; #endif // BENCHMARK_DECODING_STR #if BENCHMARK_DECODING_VEC_U8 stream << "Decoding to vector<uint8_t>:\n"; for (size_t i = 0; i < decoded_sizes.size(); ++i) { decoded_vec_u8[i] = std::vector<uint8_t>(); clock::time_point start = clock::now(); clock::time_point end = start + std::chrono::milliseconds(iteration_max_ms); size_t j = 0; for (; j < max_iterations; ++j) { if (clock::now() > end) { break; } decoded_vec_u8[i] = Codec::decode(encoded_str[i]); } time_decoding_vec_u8[i] = std::chrono::duration_cast<std::chrono::microseconds>( clock::now() - start).count() / static_cast<double>(j); stream << (i == 0 ? "" : "\t") << decoded_sizes[i] << ": " << time_decoding_vec_u8[i] << std::flush; } stream << "\n"; #endif // BENCHMARK_DECODING_VEC_U8 stream << std::setprecision(precision) << "\n"; stream.flags(flags); } int main() { std::vector<size_t> decoded_sizes = { 1, 4, 8, 16, 32, 64, 128, 256, 2048, 4096, 32768 }; std::cout << "base64_rfc4648: [decoded size: microseconds]\n"; benchmark<cppcodec::base64_rfc4648>(std::cout, decoded_sizes); return 0; }
8,422
https://github.com/FlorianLudwig/home-assistant/blob/master/homeassistant/components/google_travel_time/sensor.py
Github Open Source
Open Source
Apache-2.0
2,017
home-assistant
FlorianLudwig
Python
Code
827
3,018
""" Support for Google travel time sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.google_travel_time/ """ import logging from datetime import datetime from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv import homeassistant.util.dt as dt_util from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_API_KEY, CONF_NAME, EVENT_HOMEASSISTANT_START, ATTR_LATITUDE, ATTR_LONGITUDE, CONF_MODE) from homeassistant.helpers import location from homeassistant.helpers.entity import Entity from homeassistant.util import Throttle REQUIREMENTS = ['googlemaps==2.5.1'] _LOGGER = logging.getLogger(__name__) CONF_DESTINATION = 'destination' CONF_OPTIONS = 'options' CONF_ORIGIN = 'origin' CONF_TRAVEL_MODE = 'travel_mode' DEFAULT_NAME = 'Google Travel Time' MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=5) ALL_LANGUAGES = ['ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en', 'es', 'eu', 'fa', 'fi', 'fr', 'gl', 'gu', 'hi', 'hr', 'hu', 'id', 'it', 'iw', 'ja', 'kn', 'ko', 'lt', 'lv', 'ml', 'mr', 'nl', 'no', 'pl', 'pt', 'pt-BR', 'pt-PT', 'ro', 'ru', 'sk', 'sl', 'sr', 'sv', 'ta', 'te', 'th', 'tl', 'tr', 'uk', 'vi', 'zh-CN', 'zh-TW'] AVOID = ['tolls', 'highways', 'ferries', 'indoor'] TRANSIT_PREFS = ['less_walking', 'fewer_transfers'] TRANSPORT_TYPE = ['bus', 'subway', 'train', 'tram', 'rail'] TRAVEL_MODE = ['driving', 'walking', 'bicycling', 'transit'] TRAVEL_MODEL = ['best_guess', 'pessimistic', 'optimistic'] UNITS = ['metric', 'imperial'] PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Required(CONF_API_KEY): cv.string, vol.Required(CONF_DESTINATION): cv.string, vol.Required(CONF_ORIGIN): cv.string, vol.Optional(CONF_NAME): cv.string, vol.Optional(CONF_TRAVEL_MODE): vol.In(TRAVEL_MODE), vol.Optional(CONF_OPTIONS, default={CONF_MODE: 'driving'}): vol.All( dict, vol.Schema({ vol.Optional(CONF_MODE, default='driving'): vol.In(TRAVEL_MODE), vol.Optional('language'): vol.In(ALL_LANGUAGES), vol.Optional('avoid'): vol.In(AVOID), vol.Optional('units'): vol.In(UNITS), vol.Exclusive('arrival_time', 'time'): cv.string, vol.Exclusive('departure_time', 'time'): cv.string, vol.Optional('traffic_model'): vol.In(TRAVEL_MODEL), vol.Optional('transit_mode'): vol.In(TRANSPORT_TYPE), vol.Optional('transit_routing_preference'): vol.In(TRANSIT_PREFS) })) }) TRACKABLE_DOMAINS = ['device_tracker', 'sensor', 'zone', 'person'] DATA_KEY = 'google_travel_time' def convert_time_to_utc(timestr): """Take a string like 08:00:00 and convert it to a unix timestamp.""" combined = datetime.combine( dt_util.start_of_local_day(), dt_util.parse_time(timestr)) if combined < datetime.now(): combined = combined + timedelta(days=1) return dt_util.as_timestamp(combined) def setup_platform(hass, config, add_entities_callback, discovery_info=None): """Set up the Google travel time platform.""" def run_setup(event): """ Delay the setup until Home Assistant is fully initialized. This allows any entities to be created already """ hass.data.setdefault(DATA_KEY, []) options = config.get(CONF_OPTIONS) if options.get('units') is None: options['units'] = hass.config.units.name travel_mode = config.get(CONF_TRAVEL_MODE) mode = options.get(CONF_MODE) if travel_mode is not None: wstr = ("Google Travel Time: travel_mode is deprecated, please " "add mode to the options dictionary instead!") _LOGGER.warning(wstr) if mode is None: options[CONF_MODE] = travel_mode titled_mode = options.get(CONF_MODE).title() formatted_name = "{} - {}".format(DEFAULT_NAME, titled_mode) name = config.get(CONF_NAME, formatted_name) api_key = config.get(CONF_API_KEY) origin = config.get(CONF_ORIGIN) destination = config.get(CONF_DESTINATION) sensor = GoogleTravelTimeSensor( hass, name, api_key, origin, destination, options) hass.data[DATA_KEY].append(sensor) if sensor.valid_api_connection: add_entities_callback([sensor]) # Wait until start event is sent to load this component. hass.bus.listen_once(EVENT_HOMEASSISTANT_START, run_setup) class GoogleTravelTimeSensor(Entity): """Representation of a Google travel time sensor.""" def __init__(self, hass, name, api_key, origin, destination, options): """Initialize the sensor.""" self._hass = hass self._name = name self._options = options self._unit_of_measurement = 'min' self._matrix = None self.valid_api_connection = True # Check if location is a trackable entity if origin.split('.', 1)[0] in TRACKABLE_DOMAINS: self._origin_entity_id = origin else: self._origin = origin if destination.split('.', 1)[0] in TRACKABLE_DOMAINS: self._destination_entity_id = destination else: self._destination = destination import googlemaps self._client = googlemaps.Client(api_key, timeout=10) try: self.update() except googlemaps.exceptions.ApiError as exp: _LOGGER .error(exp) self.valid_api_connection = False return @property def state(self): """Return the state of the sensor.""" if self._matrix is None: return None _data = self._matrix['rows'][0]['elements'][0] if 'duration_in_traffic' in _data: return round(_data['duration_in_traffic']['value']/60) if 'duration' in _data: return round(_data['duration']['value']/60) return None @property def name(self): """Get the name of the sensor.""" return self._name @property def device_state_attributes(self): """Return the state attributes.""" if self._matrix is None: return None res = self._matrix.copy() res.update(self._options) del res['rows'] _data = self._matrix['rows'][0]['elements'][0] if 'duration_in_traffic' in _data: res['duration_in_traffic'] = _data['duration_in_traffic']['text'] if 'duration' in _data: res['duration'] = _data['duration']['text'] if 'distance' in _data: res['distance'] = _data['distance']['text'] return res @property def unit_of_measurement(self): """Return the unit this state is expressed in.""" return self._unit_of_measurement @Throttle(MIN_TIME_BETWEEN_UPDATES) def update(self): """Get the latest data from Google.""" options_copy = self._options.copy() dtime = options_copy.get('departure_time') atime = options_copy.get('arrival_time') if dtime is not None and ':' in dtime: options_copy['departure_time'] = convert_time_to_utc(dtime) elif dtime is not None: options_copy['departure_time'] = dtime elif atime is None: options_copy['departure_time'] = 'now' if atime is not None and ':' in atime: options_copy['arrival_time'] = convert_time_to_utc(atime) elif atime is not None: options_copy['arrival_time'] = atime # Convert device_trackers to google friendly location if hasattr(self, '_origin_entity_id'): self._origin = self._get_location_from_entity( self._origin_entity_id ) if hasattr(self, '_destination_entity_id'): self._destination = self._get_location_from_entity( self._destination_entity_id ) self._destination = self._resolve_zone(self._destination) self._origin = self._resolve_zone(self._origin) if self._destination is not None and self._origin is not None: self._matrix = self._client.distance_matrix( self._origin, self._destination, **options_copy) def _get_location_from_entity(self, entity_id): """Get the location from the entity state or attributes.""" entity = self._hass.states.get(entity_id) if entity is None: _LOGGER.error("Unable to find entity %s", entity_id) self.valid_api_connection = False return None # Check if the entity has location attributes if location.has_location(entity): return self._get_location_from_attributes(entity) # Check if device is in a zone zone_entity = self._hass.states.get("zone.%s" % entity.state) if location.has_location(zone_entity): _LOGGER.debug( "%s is in %s, getting zone location", entity_id, zone_entity.entity_id ) return self._get_location_from_attributes(zone_entity) # If zone was not found in state then use the state as the location if entity_id.startswith("sensor."): return entity.state # When everything fails just return nothing return None @staticmethod def _get_location_from_attributes(entity): """Get the lat/long string from an entities attributes.""" attr = entity.attributes return "%s,%s" % (attr.get(ATTR_LATITUDE), attr.get(ATTR_LONGITUDE)) def _resolve_zone(self, friendly_name): entities = self._hass.states.all() for entity in entities: if entity.domain == 'zone' and entity.name == friendly_name: return self._get_location_from_attributes(entity) return friendly_name
23,626
https://github.com/VN-Jobs/pureview/blob/master/resources/assets/vue/components/upload-image.vue
Github Open Source
Open Source
MIT
null
pureview
VN-Jobs
Vue
Code
316
1,198
<template> <div id="dropzone" class="dropzone"></div> </template> <script> var axios = require('axios'); var Dropzone = require("dropzone"); Dropzone.autoDiscover = false; var route = window.router || window.laroute || window.laroute; axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; var token = document.head.querySelector('meta[name="csrf-token"]'); axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; export default { data: function () { return { dz: { on: function () {}, emit: function () {} } } }, props: { images: { type: Array, default: function () { return [] } }, url: { type: String, default: function () { return route.route('backend.home.store.collection'); } }, method: { type: String, default: function () { return 'POST'; } } }, methods: { initDz: function () { var self = this; this.$set(this, 'dz', new Dropzone("#dropzone", { url: self.url, paramName: 'image', acceptedFiles: 'image/*', addRemoveLinks: true, dictRemoveFile: window.lang.get('repositories.title.reset'), init: function () { this.on('sending', self.dzOnSending) this.on('error', self.dzOnError) this.on('complete', self.dzOnComplete) this.on('removedfile', self.dzOnFileRemoved) this.on('success', self.dzOnSuccess) } }) ); }, dzOnSending: function(file, xhr, formData) { var self = this; formData.append('_method', self.method); formData.append('_token', token.content); }, dzOnError: function(file, response, xhr) { if (xhr && xhr.status == 422) { return file.previewElement.querySelector("[data-dz-errormessage]").innerHTML = response.errors.image.toString(); } file.previewElement.classList.add("dz-error"); var _ref = file.previewElement.querySelector("[data-dz-errormessage]"); }, dzOnComplete: function(file) { if (file._removeLink) { if (file.data) { var id = file.data.id; file._removeLink.href = '#'+id } file._removeLink.textContent = this.dz.options.dictRemoveFile; } if (file.previewElement) { return file.previewElement.classList.add("dz-complete"); } }, dzOnFileRemoved: function (file) { if (_.has(file.data, 'id')) { axios.delete(route.route('backend.home.delete.collection', {'id': file.data.id})); } return; }, dzOnSuccess: function (file, data) { var input = document.createElement('input'); input.setAttribute('type', 'hidden'); input.setAttribute('name', 'image_ids[]'); input.setAttribute('value', data.id); file.data = data; file.previewElement.appendChild(input); }, dzMockImage: function (mockFile, data) { this.dz.emit("addedfile", mockFile); this.dz.emit('thumbnail', mockFile, mockFile.src); this.dz.emit("complete", mockFile); this.dz.emit("success", mockFile, data); data.file = mockFile; return data; }, dzMockImages: function () { var images = this.images; var self = this; var promises = []; images.forEach(function(image) { var promise = new Promise(function(resolve, reject) { var file = { name: image.image_src, size: image.size, src: image.pub_image }; file.data = image; resolve(self.dzMockImage(file, image)); }); promises.push(promise); }); return Promise.all(promises); }, }, mounted: function () { this.initDz(); this.dzMockImages(); } } </script>
5,732
https://github.com/HatTrickLabs/dbExpression/blob/master/src/HatTrick.DbEx.Sql/Converter/DelegateValueConverter{T}.cs
Github Open Source
Open Source
Apache-2.0
null
dbExpression
HatTrickLabs
C#
Code
202
490
#region license // Copyright (c) HatTrick Labs, LLC. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // The latest version of this file can be found at https://github.com/HatTrickLabs/db-ex #endregion using System; namespace HatTrick.DbEx.Sql.Converter { public class DelegateValueConverter<T> : IValueConverter { #region internals private readonly Func<object, object> convertToDatabase; private readonly Func<object, object> convertFromDatabase; #endregion #region constructors public DelegateValueConverter(Func<T, object> convertToDatabase, Func<object, T> convertFromDatabase) { if (convertToDatabase is null) throw new ArgumentNullException(nameof(convertToDatabase)); if (convertFromDatabase is null) throw new ArgumentNullException(nameof(convertFromDatabase)); this.convertToDatabase = o => convertToDatabase((T)o); this.convertFromDatabase = o => convertFromDatabase(o); } #endregion #region methods public (Type Type, object ConvertedValue) ConvertToDatabase(object value) => (typeof(T), convertToDatabase(value)); public object ConvertFromDatabase(object value) => convertFromDatabase(value); public U ConvertFromDatabase<U>(object value) => (U)convertFromDatabase(value); #endregion } }
20,400
https://github.com/Franklin89/OTA-Library/blob/master/src/OTA-Library/TravelerInfoSummaryTypePriceRequestInformationDiscountPricing.cs
Github Open Source
Open Source
MIT
2,018
OTA-Library
Franklin89
C#
Code
167
793
using System.Collections.Generic; namespace MLSoftware.OTA { [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "4.2.0.31")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.opentravel.org/OTA/2003/05")] public partial class TravelerInfoSummaryTypePriceRequestInformationDiscountPricing { private List<TravelerInfoSummaryTypePriceRequestInformationDiscountPricingFlightReference> _flightReference; private FareInfoTypeDiscountPricingPurpose _purpose; private FareInfoTypeDiscountPricingType _type; private FareInfoTypeDiscountPricingUsage _usage; private string _discount; private string _ticketDesignatorCode; private string _text; public TravelerInfoSummaryTypePriceRequestInformationDiscountPricing() { this._flightReference = new List<TravelerInfoSummaryTypePriceRequestInformationDiscountPricingFlightReference>(); } [System.Xml.Serialization.XmlElementAttribute("FlightReference")] public List<TravelerInfoSummaryTypePriceRequestInformationDiscountPricingFlightReference> FlightReference { get { return this._flightReference; } set { this._flightReference = value; } } [System.Xml.Serialization.XmlAttributeAttribute()] public FareInfoTypeDiscountPricingPurpose Purpose { get { return this._purpose; } set { this._purpose = value; } } [System.Xml.Serialization.XmlAttributeAttribute()] public FareInfoTypeDiscountPricingType Type { get { return this._type; } set { this._type = value; } } [System.Xml.Serialization.XmlAttributeAttribute()] public FareInfoTypeDiscountPricingUsage Usage { get { return this._usage; } set { this._usage = value; } } [System.Xml.Serialization.XmlAttributeAttribute()] public string Discount { get { return this._discount; } set { this._discount = value; } } [System.Xml.Serialization.XmlAttributeAttribute()] public string TicketDesignatorCode { get { return this._ticketDesignatorCode; } set { this._ticketDesignatorCode = value; } } [System.Xml.Serialization.XmlAttributeAttribute()] public string Text { get { return this._text; } set { this._text = value; } } } }
7,988
https://github.com/erikmuttersbach/ZeusJSON/blob/master/ZeusJSON/ZeusJSON.h
Github Open Source
Open Source
MIT
2,017
ZeusJSON
erikmuttersbach
C
Code
35
106
// // ZeusJSON.h // ZeusJSON // // Created by Erik Muttersbach on 14/03/14. // Copyright (c) 2014 Pablo Guide UG. All rights reserved. // #import <Foundation/Foundation.h> @interface ZeusJSON : NSObject + (NSObject*) deserializeJSONToObject:(NSData*)data withClass:(Class)klass; @end
16,789
https://github.com/Silver-IT/chipshop-contracts/blob/master/contracts/NSAG.sol
Github Open Source
Open Source
MIT
2,022
chipshop-contracts
Silver-IT
Solidity
Code
27
145
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; import "./utils/TokenWithdrawable.sol"; contract FaraCrystal is ERC20, ERC20Burnable, TokenWithdrawable { constructor() ERC20("Ninja SAGA", "NSAG") { _mint(msg.sender, 1e26); } }
2,234
https://github.com/fel88/AutoUI/blob/master/AutoUI/XmlParseAttribute.cs
Github Open Source
Open Source
MIT
null
AutoUI
fel88
C#
Code
20
44
using System; namespace AutoUI { public class XmlParseAttribute : Attribute { public string XmlKey { get; set; } } }
2,056
https://github.com/DevopsChina/conf/blob/master/out-tsc/src/redux/actions/subscribe.js
Github Open Source
Open Source
MIT
null
conf
DevopsChina
JavaScript
Code
124
379
import { SET_DIALOG_DATA, SUBSCRIBE } from '../constants'; import { db } from '../db'; import { store } from '../store'; import { helperActions } from './helper'; import { toastActions } from './toast'; export const subscribeActions = { subscribe: (data) => (dispatch) => { const id = data.email.replace(/[^\w\s]/gi, ''); db() .collection('subscribers') .doc(id) .set({ email: data.email, firstName: data.firstFieldValue || '', lastName: data.secondFieldValue || '', }) .then(() => { dispatch({ type: SUBSCRIBE, subscribed: true, }); toastActions.showToast({ message: '{$ subscribeBlock.toast $}' }); }) .catch((error) => { dispatch({ type: SET_DIALOG_DATA, dialog: { ['subscribe']: { isOpened: true, data: Object.assign(data, { errorOccurred: true }), }, }, }); dispatch({ type: SUBSCRIBE, subscribed: false, }); helperActions.trackError('subscribeActions', 'subscribe', error); }); }, resetSubscribed: () => { store.dispatch({ type: SUBSCRIBE, subscribed: false, }); }, }; //# sourceMappingURL=subscribe.js.map
28,489
https://github.com/parinisantiago/buffetInfo-CodeIgniter/blob/master/final/application/views/MainNavTemplate.twig
Github Open Source
Open Source
MIT
null
buffetInfo-CodeIgniter
parinisantiago
Twig
Code
52
241
<ul class="navbar" id="navbar"> <li class="loginNavbar"> <form class="login" id="login" method="post" action="/LoginController" name="login"> <label class="loginInputText" for="user">Nombre de usuario:</label> <input type="text" id="user" name="username" placeholder="nombre de usuario" pattern="^[a-zA-Z]+" maxlength="15" required> <label class="loginInputText" for="pass">Contraseña: </label> <input type="password" id="pass" name="pass" placeholder="contraseña" pattern="^[a-zA-Z0-9]+" maxlength="15" required> <label for="submit" hidden>Botón de envío</label> <input type="submit" id="submit" name="submit" class="boton" value="acceder"> </form> </li> </ul>
40,159
https://github.com/Joblyn/team-344-group-a/blob/master/work-cradle/src/Components/pages/Dashboard/My-bids.js
Github Open Source
Open Source
MIT
null
team-344-group-a
Joblyn
JavaScript
Code
410
1,758
import React, { Component } from 'react'; class MyBids extends Component { render() { return ( <> <div className="dashboard-headline"> <h3>My Active Bids</h3> {/* <!-- Breadcrumbs --> */} <nav id="breadcrumbs" className="dark"> <ul> <li><a href={"/#"}>Home</a></li> <li><a href={"/#"}>Dashboard</a></li> <li>My Active Bids</li> </ul> </nav> </div> {/* <!-- Row --> */} <div className="row"> {/* <!-- Dashboard Box --> */} <div className="col-xl-12"> <div className="dashboard-box margin-top-0"> {/* <!-- Headline --> */} <div className="headline"> <h3><i className="icon-material-outline-gavel"></i> Bids List</h3> </div> <div className="content"> <ul className="dashboard-box-list"> <li> {/* <!-- Job Listing --> */} <div className="job-listing width-adjustment"> {/* <!-- Job Listing Details --> */} <div className="job-listing-details"> {/* <!-- Details --> */} <div className="job-listing-description"> <h3 className="job-listing-title"><a href={"/#"}>WordPress Guru Needed</a></h3> </div> </div> </div> {/* <!-- Task Details --> */} <ul className="dashboard-task-info"> <li><strong>$40</strong><span>Hourly Rate</span></li> <li><strong>2 Days</strong><span>Delivery Time</span></li> </ul> {/* <!-- Buttons --> */} <div className="buttons-to-right always-visible"> <a href={"/#small-dialog"} className="popup-with-zoom-anim button dark ripple-effect ico" title="Edit Bid" data-tippy-placement="top"><i className="icon-feather-edit"></i></a> <a href={"/#"} className="button red ripple-effect ico" title="Cancel Bid" data-tippy-placement="top"><i className="icon-feather-trash-2"></i></a> </div> </li> <li> {/* <!-- Job Listing --> */} <div className="job-listing width-adjustment"> {/* <!-- Job Listing Details --> */} <div className="job-listing-details"> {/* <!-- Details --> */} <div className="job-listing-description"> <h3 className="job-listing-title"><a href={"/#"}>Build me a website in Angular JS</a></h3> </div> </div> </div> {/* <!-- Task Details --> */} <ul className="dashboard-task-info"> <li><strong>$2,550</strong><span>Fixed price</span></li> <li><strong>14 Days</strong><span>Delivery Time</span></li> </ul> {/* <!-- Buttons --> */} <div className="buttons-to-right always-visible"> <a href={"/#small-dialog"} className="popup-with-zoom-anim button dark ripple-effect ico" title="Edit Bid" data-tippy-placement="top"><i className="icon-feather-edit"></i></a> <a href={"/#"} className="button red ripple-effect ico" title="Cancel Bid" data-tippy-placement="top"><i className="icon-feather-trash-2"></i></a> </div> </li> <li> {/* <!-- Job Listing --> */} <div className="job-listing width-adjustment"> {/* <!-- Job Listing Details --> */} <div className="job-listing-details"> {/* <!-- Details --> */} <div className="job-listing-description"> <h3 className="job-listing-title"><a href={"/#"}>Android and iOS React Appe</a></h3> </div> </div> </div> {/* <!-- Task Details --> */} <ul className="dashboard-task-info"> <li><strong>$3,000</strong><span>Fixed Price</span></li> <li><strong>21 Days</strong><span>Delivery Time</span></li> </ul> {/* <!-- Buttons --> */} <div className="buttons-to-right always-visible"> <a href={"/#small-dialog"} className="popup-with-zoom-anim button dark ripple-effect ico" title="Edit Bid" data-tippy-placement="top"><i className="icon-feather-edit"></i></a> <a href={"/#"} className="button red ripple-effect ico" title="Cancel Bid" data-tippy-placement="top"><i className="icon-feather-trash-2"></i></a> </div> </li> <li> {/* <!-- Job Listing --> */} <div className="job-listing width-adjustment"> {/* <!-- Job Listing Details --> */} <div className="job-listing-details"> {/* <!-- Details --> */} <div className="job-listing-description"> <h3 className="job-listing-title"><a href={"/#"}>Write Simple Python Script</a></h3> </div> </div> </div> {/* <!-- Task Details --> */} <ul className="dashboard-task-info"> <li><strong>$30</strong><span>Hourly Rate</span></li> <li><strong>1 Day</strong><span>Delivery Time</span></li> </ul> {/* <!-- Buttons --> */} <div className="buttons-to-right always-visible"> <a href={"/#small-dialog"} className="popup-with-zoom-anim button dark ripple-effect ico" title="Edit Bid" data-tippy-placement="top"><i className="icon-feather-edit"></i></a> <a href={"/#"} className="button red ripple-effect ico" title="Cancel Bid" data-tippy-placement="top"><i className="icon-feather-trash-2"></i></a> </div> </li> </ul> </div> </div> </div> </div> </> ) } } export default MyBids;
42,508
https://github.com/cadmium-org/cadmium-cms/blob/master/www/engine/System/Languages/uk-UA/Phrases/Site.php
Github Open Source
Open Source
MIT
2,017
cadmium-cms
cadmium-org
PHP
Code
88
472
<?php /** * @package Cadmium\System\Languages\uk-UA * @author Dariia Romanova * @copyright Copyright (c) 2015-2017, Dariia Romanova * @link http://cadmium-cms.com */ return [ # Titles 'TITLE_PROFILE_AUTH_LOGIN' => 'Вхід', 'TITLE_PROFILE_AUTH_RESET' => 'Відновлення пароля', 'TITLE_PROFILE_AUTH_RECOVER' => 'Змінення пароля', 'TITLE_PROFILE_AUTH_REGISTER' => 'Реєстрація', 'TITLE_PROFILE' => 'Профіль', # Profile 'PROFILE_TAB_OVERVIEW' => 'Огляд', 'PROFILE_TAB_EDIT' => 'Змінити мої дані', 'PROFILE_OVERVIEW_EMAIL' => 'E-mail', 'PROFILE_OVERVIEW_RANK' => 'Ранг', 'PROFILE_OVERVIEW_TIME' => 'Зареєстрований', 'PROFILE_OVERVIEW_SEX' => 'Стать', 'PROFILE_OVERVIEW_FULL_NAME' => 'Повне ім\'я', 'PROFILE_OVERVIEW_CITY' => 'Місто', 'PROFILE_OVERVIEW_COUNTRY' => 'Країна', 'PROFILE_EDIT_GROUP_PERSONAL' => 'Персональна інформація', 'PROFILE_EDIT_GROUP_PASSWORD' => 'Зміна пароля', # Other 'POWERED_BY' => 'Працює на' ];
6,385
https://github.com/SankarNiit/aws-codepipeline-codebuild-with-postman/blob/master/node_modules/uvm/firmware/sandbox-base.js
Github Open Source
Open Source
MIT-0
2,022
aws-codepipeline-codebuild-with-postman
SankarNiit
JavaScript
Code
32
104
module.exports = ` (function (self) { var init = function (e) { self.removeEventListener('message', init); // eslint-disable-next-line no-eval (e && e.data && (typeof e.data.__init_uvm === 'string')) && eval(e.data.__init_uvm); }; self.addEventListener('message', init); }(self)); `;
22,454
https://github.com/cutesthypnotist/HakanaiShaderCommonsExamples/blob/master/Assets/Shaders/Magic Die V4/Magic Die V4.shader
Github Open Source
Open Source
MIT
null
HakanaiShaderCommonsExamples
cutesthypnotist
GLSL
Code
235
828
Shader "Hakanai/Magic Die V4" { Properties { _MainTex ("Albedo Map", 2D) = "white" {} [HDR] _Color ("Albedo Tint", Color) = (1.0, 1.0, 1.0, 1.0) [Space(20)] _NormalMap ("Normal Map", 2D) = "bump" {} [Space(20)] _MetallicTex ("Metallic/Smoothness Map", 2D) = "white" {} _Metallic ("Metallic", Range(0, 1)) = 0.0 _Smoothness ("Smoothness", Range(0, 1)) = 0.5 [Space(20)] _EmissionMap ("Emission Map", 2D) = "white" {} [HDR] _EmissionColor ("Emission Color", Color) = (0.2, 0.0, 0.2, 1.0) [Space(20)] _BallAlbedo ("Ball Albedo", Color) = (1.0, 0.0, 1.0, 1.0) [HDR] _BallEmission ("Ball Emission", Color) = (0.2, 0.0, 0.2, 1.0) _BallMetallic ("Ball Metallic", Range(0, 1)) = 0.0 _BallSmoothness ("Ball Smoothness", Range(0, 1)) = 0.5 } SubShader { Tags { "Queue" = "AlphaTest" "RenderType" = "TransparentCutout" "IgnoreProjector" = "True" "DisableBatching" = "True" } LOD 200 Cull Back Pass { Name "FORWARD" Tags { "LightMode" = "ForwardBase" } Blend SrcAlpha OneMinusSrcAlpha CGPROGRAM #pragma vertex Vertex #pragma fragment Fragment #pragma multi_compile_fwdbase #pragma multi_compile_fog #pragma target 4.0 #include "Magic Die V4.cginc" ENDCG } Pass { Name "FORWARDADD" Tags { "LightMode" = "ForwardAdd" } Blend SrcAlpha One ZWrite Off CGPROGRAM #pragma vertex Vertex #pragma fragment Fragment #pragma multi_compile_fwdadd_fullshadows #pragma multi_compile_fog #pragma target 4.0 #include "Magic Die V4.cginc" ENDCG } Pass { Name "SHADOWCASTER" Tags { "LightMode" = "ShadowCaster" } ZWrite On ZTest LEqual CGPROGRAM #pragma vertex Vertex #pragma fragment ShadowCasterFragment #pragma skip_variants FOG_LINEAR FOG_EXP FOG_EXP2 #pragma multi_compile_shadowcaster #pragma target 4.0 #include "Magic Die V4.cginc" ENDCG } } Fallback "None" }
47,187
https://github.com/unite-deals/Vedio-Depth-Estimation/blob/master/part_4_depth_video/pairwise_structure.m
Github Open Source
Open Source
MIT
2,020
Vedio-Depth-Estimation
unite-deals
MATLAB
Code
309
968
%% This file is to generate pairwise function pairwise = pairwise_structure(img1,Ws,epsilon) disp('------compute pairwise-------'); H = size(img1,1); % image width W = size(img1,2); % image Height N = W * H; % number of pixels pairwise_x = []; pairwise_y = []; lambda = []; % compute distance for row = 0:H-1 for col = 0:W-1 pixel = 1+ row*W + col; Ux_tmpt = []; %initialize lambda parameter Nx = 0;%number of neighbors % find location for sparse pairwise matrix if row+1 < H pairwise_x(end + 1) = pixel; pairwise_y(end + 1) = 1+col+(row+1)*W; d = dist(img1(row+1,col+1,:),img1(row+2,col+1,:)); Ux_tmpt(end+1) = 1 / (d + epsilon); Nx = Nx + 1; end if row-1 >= 0 pairwise_x(end + 1) = pixel; pairwise_y(end + 1) = 1+col+(row-1)*W; d = dist(img1(row+1,col+1,:),img1(row,col+1,:)); Ux_tmpt(end+1) = 1 / (d + epsilon); Nx = Nx + 1; end if col+1 < W pairwise_x(end + 1) = pixel; pairwise_y(end + 1) = 1+(col+1)+row*W; d = dist(img1(row+1,col+1,:),img1(row+1,col+2,:)); Ux_tmpt(end+1) = 1 / (d + epsilon); Nx = Nx + 1; end if col-1 >= 0 pairwise_x(end + 1) = pixel; pairwise_y(end + 1) = 1+(col-1)+row*W; d = dist(img1(row+1,col+1,:),img1(row+1,col,:)); Ux_tmpt(end+1) = 1 / (d + epsilon); Nx = Nx + 1; end Ux = Nx / sum(Ux_tmpt); % set lambda if row+1 < H d = dist(img1(row+1,col+1,:),img1(row+2,col+1,:)); lambda(end + 1) = Ws * Ux / (d + epsilon); end if row-1 >= 0 d = dist(img1(row+1,col+1,:),img1(row,col+1,:)); lambda(end + 1) = Ws * Ux / (d + epsilon); end if col+1 < W d = dist(img1(row+1,col+1,:),img1(row+1,col+2,:)); lambda(end + 1) = Ws * Ux / (d + epsilon); end if col-1 >= 0 d = dist(img1(row+1,col+1,:),img1(row+1,col,:)); lambda(end + 1) = Ws * Ux / (d + epsilon); end end end % update pairwise pairwise = sparse(pairwise_x,pairwise_y,lambda,N,N); end %% distance function of intensity for images function d = dist(pixel1, pixel2) d = (abs(pixel1(1)-pixel2(1))+abs(pixel1(2)-pixel2(2))+abs(pixel1(3)-pixel2(3))) / 3; end
9,356
https://github.com/FoxMinecraft/Paradox/blob/master/src/main/java/com/loohp/limbo/events/Event.java
Github Open Source
Open Source
Apache-2.0
2,022
Paradox
FoxMinecraft
Java
Code
8
24
package com.loohp.limbo.events; public abstract class Event { }
15,772
https://github.com/lajennylove/sessions/blob/master/app/Http/Controllers/PageController.php
Github Open Source
Open Source
MIT
2,019
sessions
lajennylove
PHP
Code
866
3,364
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use App\User; use App\Band; use App\Vote; use App\State; use App\Profile; class PageController extends Controller { public function login() { $states = State::all(); return view('login', compact('states')); } public function index() { return view('index'); } public function bandas() { $bands_last = Band::orderBy('id', 'desc')->take(3)->get(); $bands = Band::inRandomOrder()->paginate(32); $find = null; foreach($bands as $band) { $short = implode(' ', array_slice(explode(' ', $band->description), 0, 30)); $band['short'] = $short; } return view('bandas', compact('bands_last', 'bands', 'find')); } public function findBandas(Request $request) { $bands_last = Band::orderBy('id', 'desc')->take(3)->get(); $bands = Band::where('name', 'like', '%'.$request->find.'%')->orWhere('username', 'like', '%'.$request->find.'%')->paginate(32); $find = $request->find; foreach($bands as $band) { $short = implode(' ', array_slice(explode(' ', $band->description), 0, 30)); $band['short'] = $short; } return view('bandas', compact('bands_last', 'bands', 'find')); } public function generos($gender) { if($gender == "all") { $bands = Band::inRandomOrder()->paginate(32); } else { $bands = Band::where('gender', $gender)->inRandomOrder()->paginate(32); } foreach($bands as $band) { $short = implode(' ', array_slice(explode(' ', $band->description), 0, 30)); $band['short'] = $short; } return view('generos', compact('bands', 'gender')); } public function band($username) { $band = Band::where('username', $username)->first(); $array_youtube = explode('/', $band->youtube); $size_youtube = sizeof($array_youtube) -1; if(sizeof($array_youtube) <= 1) { $band['youtube'] = "https://www.youtube.com/user/".$array_youtube[$size_youtube]; $band['short'] = $array_youtube[$size_youtube]; } else { $band['short'] = $array_youtube[$size_youtube]; } // dd($band); $votes = Vote::where('band_id', $band->id)->count(); $bands_one = Band::whereNotIn('id', [$band->id])->inRandomOrder()->take(2)->get(); $bands_ids = array_map(function($item){return $item['id']; }, $bands_one->toArray()); $bands_two = Band::whereNotIn('id', [$band->id])->whereNotIn('id', $bands_ids)->inRandomOrder()->take(2)->get(); $user = \Auth::user(); if($user != null) { $vote = Vote::where('band_id', $band->id)->where('user_id', $user->id)->first(); if($vote != null) { $exist = "yes"; } else { $exist = "no"; } }else{ $exist = "no"; } return view('band', compact('band', 'votes', 'bands_one', 'user', 'bands_two', 'exist')); } public function profileBand() { $user_id = \Auth::id(); $user = User::where('id', $user_id)->first(); $band = Band::where('user_id', $user->id)->first(); $cont = Vote::where('band_id', $band->id)->count(); return view('profile_band', compact('user', 'band', 'cont')); } public function register(Request $request) { $messages = [ 'required'=>'Este campo es obligatorio', 'email'=>"Debe ser un correo valido", 'unique'=>"Lo sentimos este :attribute ya existe, intenta con otro", 'numeric'=>"El id de tu album debe ser un numero, checalo bien", 'url'=>"El link no es valido", 'profanity'=>"No puede contener groserias", "accepted" => "Debes aceptar este campo" ]; $this->validate($request, [ 'email' => 'required|string|email|max:255|unique:users', 'username' => 'required|string|max:255|unique:bands,username', 'cover'=>'required', 'password'=>'required', 'youtube_url'=>'required|url', 'name'=>'required', 'gender'=>'required', 'ciudad'=>'required', 'description'=>'required', 'facebook'=>'required', 'youtube'=>'required', 'bandcamp'=>'required|numeric', 'accept'=>'accepted', 'review'=>'accepted', ], $messages); // $array_link = explode("/embed/", $request->youtube_url); // if(sizeof($array_link) <= 1) // { // $messages = ["accepted" => "El link del video no es valido"]; // $this->validate($request, [ // 'youtube_url' => 'accepted', // ], $messages); // } $data_user = $request->only('email'); $password = bcrypt($request->password); $data_user['password'] = $password; $data_user['role'] = "band"; $user = User::create($data_user); $data = $request->except('email', 'password', 'cover', 'name', 'description', 'facebook', 'youtube_url'); $data['user_id'] = $user->id; $description = app('profanityFilter')->filter($request->description); $name = app('profanityFilter')->filter($request->name); $array_facebook = explode('/', $request->facebook); $size_facebook = sizeof($array_facebook) -1; $data['facebook'] = $array_facebook[$size_facebook]; $array_youtube_url = explode('/', $request->youtube_url); $position_youtube_url = sizeof($array_youtube_url) -1; $data['youtube_url'] = "https://www.youtube.com/embed/".$array_youtube_url[$position_youtube_url]; $data['name'] = $name; $data['description'] = $description; $band = Band::create($data); // $photo = $request->cover; // $photoName = "sessions_" . time() .".".$photo->guessExtension(); // $s3 = \Storage::disk('s3'); // $filePath = $photo->store('files_user'); // $s3->put($photoName, fopen($photo, 'r+')); // $s3->setVisibility($photoName, 'public'); $file = $request->file("cover"); $photoName = "sessions_".time() . "." . $request->file('cover')->guessExtension(); // $photoName = $file->getClientOriginalName(); $file->move('bandas/', $photoName); $band->cover_url = $photoName; $band->update(); \Auth::login($user); $redirect = url("/band/".$band->username); return redirect($redirect); } public function logout() { \Auth::logout(); return redirect('/'); } public function bases() { return view('bases'); } public function loginView() { return view('log'); } public function registerView() { return view('register_user'); } public function registerUser(Request $request) { $messages = [ 'required'=>'Este campo es obligatorio', 'email'=>"Debe ser un correo valido", 'unique'=>"Lo sentimos este :attribute ya existe, intenta con otro", 'numeric'=>"El id de tu album debe ser un numero, checalo bien", 'url'=>"Recuerda solo debes meter el link que te da Youtube en incorporar", "accepted" => "Debes aceptar los términos y condiciones" ]; $this->validate($request, [ 'email' => 'required|string|email|max:255|unique:users', 'password'=>'required', 'name'=>'required', ], $messages); $data_profile = $request->only('name'); $data_user = $request->only('email'); $password = bcrypt($request->password); $data_user['password'] = $password; $data_user['role'] = "user"; $user = User::create($data_user); $data_profile['user_id'] = $user->id; $profile = Profile::create($data_profile); \Auth::login($user); return redirect('/profile_user'); } public function profileView() { $user = User::where('role', 'band')->first(); $band = Band::where('user_id', $user->id)->first(); $cont = Vote::where('band_id', $band->id)->count(); return view('profile_band', compact('user', 'band', 'cont')); } public function profileUser() { $user_id = \Auth::id(); $user = User::where('id', $user_id)->first(); $profile = Profile::where('user_id', $user_id)->first(); return view('profile_user', compact('user', 'profile')); } public function profileuserexample() { $user= User::where('role', 'user')->first(); $profile = Profile::where('user_id', $user->id)->first(); return view('profile_user', compact('user', 'profile')); } public function loginPost(Request $request) { $messages = [ 'required' => 'Este campo :attribute es obligatorio', ]; $this->validate($request, [ 'email' => 'required', 'password' => 'required', ], $messages); $user = User::where('email', $request->email)->first(); if($user == null) { return back()->withErrors(['password', 'El usuario o la contraseña no coinciden']); } if (Hash::check($request->password, $user->password)) {} else { return back()->withErrors(['password', 'El usuario o la contraseña no coinciden']); } \Auth::login($user); if($user->role == "band") { $user_id = \Auth::id(); $user = User::where('id', $user_id)->first(); $band = Band::where('user_id', $user->id)->first(); $cont = Vote::where('band_id', $band->id)->count(); return view('profile_band', compact('user', 'band', 'cont')); } else if($user->role == "user") { $user_id = \Auth::id(); $user = User::where('id', $user_id)->first(); $profile = Profile::where('user_id', $user_id)->first(); return view('profile_user', compact('user', 'profile')); } else if($user->role == "admin"){ return redirect('admin'); } return redirect('bandas'); } public function comoparticipar() { return view('comoparticipar'); } public function edit($username) { $states = State::all(); $user_id = \Auth::id(); $band = Band::where('user_id', $user_id)->first(); return view('edit', compact('band', 'states')); } public function update(Request $request, $username) { $user_id = \Auth::id(); $band = Band::where('user_id', $user_id)->first(); $data= $request->except('name', 'description'); $description = app('profanityFilter')->filter($request->description); $name = app('profanityFilter')->filter($request->name); $data['name'] = $name; $data['description'] = $description; $band->update($data); return redirect('profile_band'); } }
31,188
https://github.com/younessaitali/Color_game/blob/master/Assets/level 3/Scripts/button.cs
Github Open Source
Open Source
MIT
2,021
Color_game
younessaitali
C#
Code
88
425
using System.Collections; using System.Collections.Generic; using UnityEngine; public class button : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { } public void clickCheck() { if (FindObjectOfType<manage>().currentTiles.Count != 0 && FindObjectOfType<manage>().isPlaying == false) { if (this.gameObject.name == FindObjectOfType<manage>().currentTiles[0].tileName) { Debug.Log("great"); manage._manage.sauce.clip = manage._manage.currentTiles[0].tileSound; manage._manage.sauce.Play(); StartCoroutine(manage._manage.praise("Great" ,Color.blue)); FindObjectOfType<manage>().currentTiles.RemoveAt(0); manage._manage.hasPlayed = true; } else { StartCoroutine(manage._manage.praise("Wrong",Color.red)); manage._manage.resetTiles(); manage._manage.startTiles(); } } if(manage._manage.currentTiles.Count ==0 && manage._manage.hasPlayed) { manage._manage.statetext.text = "Start"; StartCoroutine(manage._manage.praise("Good job",Color.magenta)); StartCoroutine(manage._manage.goodjob()); manage._manage.hasPlayed = false; } } }
21,673
https://github.com/DeVitoC/Labs25-Ecosoap-TeamA-IOS/blob/master/EcoSoapBankTests/ProfileTests.swift
Github Open Source
Open Source
MIT
2,021
Labs25-Ecosoap-TeamA-IOS
DeVitoC
Swift
Code
660
2,370
// // ProfileTests.swift // EcoSoapBankTests // // Created by Jon Bash on 2020-09-04. // Copyright © 2020 Spencer Curtis. All rights reserved. // // swiftlint:disable weak_delegate // ^^ Disabled because a strong reference is required to keep a reference to it import XCTest @testable import EcoSoapBank import KeychainAccess import Combine class ProfileTests: XCTestCase { var strongDelegate: MockProfileDelegate! var user: User! var dataProvider: MockUserDataProvider! var userController: UserController! var coordinator: ProfileCoordinator! var badUser: User! var viewModel: ProfileViewModel { coordinator.profileVM } var currentProfileInfo: EditableProfileInfo { EditableProfileInfo(user: viewModel.user) } var newProfileInfo: EditableProfileInfo { configure(EditableProfileInfo(user: user)) { $0.email = "new@email.net" $0.middleName = "Lasagna" $0.skype = "new-skype-handle" } } var bag = Set<AnyCancellable>() override func setUp() { super.setUp() self.strongDelegate = MockProfileDelegate() self.user = .placeholder() self.dataProvider = MockUserDataProvider(testing: true, waitTime: 0.1) self.userController = UserController(dataLoader: dataProvider) self.coordinator = ProfileCoordinator(user: user, userController: userController, delegate: strongDelegate) self.badUser = User( id: "", firstName: "", middleName: nil, lastName: "", title: nil, company: nil, email: "", phone: nil, skype: nil, properties: nil) self.bag = [] XCTAssertGreaterThanOrEqual(user.properties?.count ?? 0, 2) } // MARK: - Tests func testMainProfileVMSetup() throws { XCTAssertEqual(viewModel.properties, user.properties) XCTAssert(viewModel.propertyOptions.contains(.all)) let userProperties = try XCTUnwrap(user.properties) let userSelections = userProperties.map { PropertySelection.select($0) } XCTAssertEqual(viewModel.propertyOptions.dropFirst(), userSelections[...]) } func testUserControllerUpdateProfile() { logIn() let exp = expectation(description: "profile changed") let oldUser = viewModel.user let info = newProfileInfo var newUser: User? userController.updateUserProfile(info) { result in guard let user = try? result.get() else { return XCTFail("Update user failed with error: \(result.error!)") } newUser = user exp.fulfill() } wait(for: exp) XCTAssertNotEqual(newUser, oldUser) } func testProfileChanges() { logIn() let exp = expectation(description: "profile changed") exp.expectedFulfillmentCount = 2 let oldUser = viewModel.user let oldInfo = currentProfileInfo var newUser: User? XCTAssertFalse(viewModel.loading) viewModel.$user .dropFirst() .sink { user in newUser = user exp.fulfill() }.store(in: &bag) viewModel.commitProfileChanges(newProfileInfo) { exp.fulfill() } XCTAssertTrue(viewModel.loading) wait(for: exp) XCTAssertNotEqual(oldUser, newUser) XCTAssertEqual(currentProfileInfo, newProfileInfo) XCTAssertNotEqual(currentProfileInfo, oldInfo) XCTAssertNil(viewModel.error) } func testProfileChangesFail() { dataProvider.shouldFail = true let exp = expectation(description: "profile changed") let oldUser = viewModel.user let oldInfo = currentProfileInfo var caughtError: Error? XCTAssertFalse(viewModel.loading) viewModel.$error .compactMap { $0 } .sink { error in caughtError = error exp.fulfill() }.store(in: &bag) viewModel.commitProfileChanges(newProfileInfo) { // only runs with success XCTFail("Completion should not run") } XCTAssertTrue(viewModel.loading) wait(for: exp) XCTAssertNotNil(caughtError) XCTAssertNotEqual(currentProfileInfo, newProfileInfo) XCTAssertEqual(currentProfileInfo, oldInfo) XCTAssertEqual(viewModel.user, oldUser) } func testLogOut() { logIn() XCTAssertEqual(dataProvider.status, .loggedIn) viewModel.logOut() XCTAssertNil(userController.user) XCTAssertEqual(strongDelegate.status, .loggedOut) XCTAssertEqual(dataProvider.status, .loggedOut) XCTAssertNil(userController.user) } /// Ensure setting `useShippingAddressForBilling` does not change the address until commiting. func testEditPropertyUseShippingAddressForBilling() { logIn() var info = EditablePropertyInfo(user.properties?.first!) info.billingAddress = EditableAddressInfo() viewModel.useShippingAddressForBilling = true XCTAssertNotEqual(info.shippingAddress, info.billingAddress) let didSavePropertyChanges = expectation(description: "Saved property changes") viewModel.savePropertyChanges(info) { didSavePropertyChanges.fulfill() } let userWillChange = expectation(description: "User about to change") viewModel.$user .dropFirst() .sink { _ in userWillChange.fulfill() } .store(in: &bag) wait(for: [didSavePropertyChanges, userWillChange], timeout: 2) XCTAssertEqual(viewModel.user.properties?.first?.shippingAddress, viewModel.user.properties?.first?.billingAddress) } func testCommitProfileChangesSuccess() { logIn() var info = EditablePropertyInfo(user.properties?.first) info.phone = "999-555-8765" let oldProperty = user.properties?.first var newProperty: Property? let callsDidComplete = expectation(description: "calls completed") callsDidComplete.expectedFulfillmentCount = 2 viewModel.$error .compactMap { $0 } .sink(receiveValue: { XCTFail("Failed with error: \($0)") }) .store(in: &bag) viewModel.$user .dropFirst() .sink(receiveValue: { newUser in XCTAssertNotEqual(newProperty, newUser.properties?.first) newProperty = newUser.properties?.first callsDidComplete.fulfill() }).store(in: &bag) viewModel.savePropertyChanges(info) { callsDidComplete.fulfill() } wait(for: callsDidComplete) XCTAssertNotEqual(oldProperty, newProperty) XCTAssertEqual(EditablePropertyInfo(newProperty), info) } func testPropertyUpdateFailed() { userController = UserController( dataLoader: MockUserDataProvider( shouldFail: true, testing: true, waitTime: 0.1)) let propInfo = configure(EditablePropertyInfo(user.properties?.first)) { $0.name = "BLAHHHHHH" } // user controller failure let controllerCompletedPropertyUpdate = expectation(description: "Returned from closure") userController.updateProperty(with: propInfo) { result in if case .success = result { XCTFail("Should not be successful") } controllerCompletedPropertyUpdate.fulfill() } // view model failure let vm = ProfileViewModel(user: user, userController: userController, delegate: nil) let vmHasError = expectation(description: "View model has an error") vm.$error .compactMap { $0 } .sink { _ in vmHasError.fulfill() }.store(in: &bag) vm.savePropertyChanges(propInfo) { XCTFail("Call should not succeed") } wait(for: [ controllerCompletedPropertyUpdate, vmHasError ], timeout: 5) } } // MARK: - Helpers extension ProfileTests { func logIn() { let exp = expectation(description: "logging in") userController.logInWithBearer { _ in exp.fulfill() } wait(for: exp) } } class MockProfileDelegate { enum Status: Equatable { case started case loggedOut } var status: Status = .started } extension MockProfileDelegate: ProfileDelegate { func logOut() { status = .loggedOut } }
22,874
https://github.com/desiby/generator-jvm/blob/master/generators/app/templates/java-wildfly-swarm/src/main/java/daggerok/rest/MessageResource.java
Github Open Source
Open Source
MIT
2,021
generator-jvm
desiby
Java
Code
58
260
package daggerok.rest; import daggerok.events.DomainEvent; import daggerok.events.MessageCreated; import javax.ejb.Stateless; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import java.util.UUID; import static java.lang.String.format; import static javax.ws.rs.core.MediaType.APPLICATION_JSON; @Stateless @Path("/api/v1") @Produces(APPLICATION_JSON) public class MessageResource { @GET @Path("/hello") public DomainEvent hello() { return MessageCreated.of(UUID.randomUUID(), "Hello, Random!"); } @GET @Path("/hello/{uuid}") public DomainEvent hello(@PathParam("uuid") final UUID uuid) { return MessageCreated.of(uuid, format("Hello, %s", uuid)); } }
40,841
https://github.com/TwoSails/WeatherDashboard/blob/master/.gitignore
Github Open Source
Open Source
MIT
2,021
WeatherDashboard
TwoSails
Ignore List
Code
6
21
/weatherapp/util/config.yml # Project exclude paths /venv/
48,662
https://github.com/harshp8l/deep-learning-lang-detection/blob/master/data/train/python/5447939837efadfb14b4143d8edfc5abdc001ab4test_0530_repository_admin_feature.py
Github Open Source
Open Source
MIT
2,021
deep-learning-lang-detection
harshp8l
Python
Code
921
2,861
import logging from tool_shed.base.twilltestcase import common, ShedTwillTestCase log = logging.getLogger( __name__ ) repository_name = 'filtering_0530' repository_description = 'Filtering repository for test 0530' repository_long_description = 'This is the filtering repository for test 0530.' category_name = 'Test 0530 Repository Admin Role' category_description = 'Verify the functionality of the code that handles the repository admin role.' ''' 1. Create new repository as user user1. 2. Check to make sure a new role was created named <repo_name>_user1_admin. 3. Check to make sure a new repository_role_association record was created with appropriate repository id and role id. 4. Change the name of the repository created in step 1 - this can be done as long as the repository has not been installed or cloned. 5. Make sure the name of the role initially inspected in Step 2 has been changed to reflect the new repository name from Step 4. 6. Log into the Tool Shed as a user that is not the repository owner (e.g., user2) and make sure the repository name and description cannot be changed. 7. As user user1, add user user2 as a repository admin user. 8. Log into the Tool Shed as user user2 and make sure the repository name and description can now be changed. ''' class TestRepositoryAdminRole( ShedTwillTestCase ): '''Verify that the code correctly handles the repository admin role.''' def test_0000_initiate_users( self ): """Create necessary user accounts.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_1_email self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.test_user_2_email, username=common.test_user_2_name ) test_user_2 = self.test_db_util.get_user( common.test_user_2_email ) assert test_user_2 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_2_email self.test_db_util.get_private_role( test_user_2 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email self.test_db_util.get_private_role( admin_user ) def test_0005_create_filtering_repository( self ): """Create and populate the filtering_0530 repository.""" ''' This is step 1 - Create new repository as user user1. ''' category = self.create_category( name=category_name, description=category_description ) self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) repository = self.get_or_create_repository( name=repository_name, description=repository_description, long_description=repository_long_description, owner=common.test_user_1_name, category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, filename='filtering/filtering_1.1.0.tar', filepath=None, valid_tools_only=True, uncompress_file=True, remove_repo_files_not_in_tar=False, commit_message='Uploaded filtering 1.1.0 tarball.', strings_displayed=[], strings_not_displayed=[] ) def test_0010_verify_repository_admin_role_exists( self ): '''Verify that the role filtering_0530_user1_admin exists.''' ''' This is step 2 - Check to make sure a new role was created named filtering_0530_user1_admin. ''' test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) repository_admin_role = self.test_db_util.get_role( test_user_1, 'filtering_0530_user1_admin' ) assert repository_admin_role is not None, 'Admin role for filtering_0530 was not created.' def test_0015_verify_repository_role_association( self ): '''Verify that the filtering_0530_user1_admin role is associated with the filtering_0530 repository.''' ''' This is step 3 - Check to make sure a new repository_role_association record was created with appropriate repository id and role id. ''' repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) repository_admin_role = self.test_db_util.get_role( test_user_1, 'filtering_0530_user1_admin' ) repository_role_association = self.test_db_util.get_repository_role_association( repository.id, repository_admin_role.id ) assert repository_role_association is not None, 'Repository filtering_0530 is not associated with the filtering_0530_user1_admin role.' def test_0020_rename_repository( self ): '''Rename the repository to renamed_filtering_0530.''' ''' This is step 4 - Change the name of the repository created in step 1 - this can be done as long as the repository has not been installed or cloned. ''' repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.edit_repository_information( repository, revert=False, repo_name='renamed_filtering_0530' ) self.test_db_util.refresh( repository ) assert repository.name == 'renamed_filtering_0530', 'Repository was not renamed to renamed_filtering_0530.' def test_0025_check_admin_role_name( self ): return '''Check that a role renamed_filtering_0530_user1_admin now exists, and filtering_0530_user1_admin does not.''' ''' This is step 5 - Make sure the name of the role initially inspected in Step 2 has been changed to reflect the new repository name from Step 4. ''' test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) old_repository_admin_role = self.test_db_util.get_role( test_user_1, 'filtering_0530_%s_admin' % test_user_1.username ) assert old_repository_admin_role is None, 'Admin role filtering_0530_user1_admin incorrectly exists.' new_repository_admin_role = self.test_db_util.get_role( test_user_1, 'renamed_filtering_0530_%s_admin' % test_user_1.username ) assert new_repository_admin_role is not None, 'Admin role renamed_filtering_0530_user1_admin does not exist.' def test_0030_verify_access_denied( self ): '''Make sure a non-admin user can't modify the repository.''' ''' This is step 6 - Log into the Tool Shed as a user that is not the repository owner (e.g., user2) and make sure the repository name and description cannot be changed. ''' self.logout() self.login( email=common.test_user_2_email, username=common.test_user_2_name ) repository = self.test_db_util.get_repository_by_name_and_owner( 'renamed_filtering_0530', common.test_user_1_name ) strings_not_displayed = [ 'Manage repository' ] strings_displayed = [ 'View repository' ] self.display_manage_repository_page( repository, strings_not_displayed=strings_not_displayed ) self.submit_form( button='edit_repository_button', description='This description has been modified.' ) strings_displayed = [ 'You are not the owner of this repository, so you cannot administer it.' ] strings_not_displayed = [ 'The repository information has been updated.' ] self.check_for_strings( strings_displayed=strings_displayed, strings_not_displayed=strings_not_displayed ) def test_0035_grant_admin_role( self ): '''Grant the repository admin role to user2.''' ''' This is step 7 - As user user1, add user user2 as a repository admin user. ''' self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) test_user_2 = self.test_db_util.get_user( common.test_user_2_email ) repository = self.test_db_util.get_repository_by_name_and_owner( 'renamed_filtering_0530', common.test_user_1_name ) self.assign_admin_role( repository, test_user_2 ) def test_0040_rename_repository_as_repository_admin( self ): '''Rename the repository as user2.''' ''' This is step 8 - Log into the Tool Shed as user user2 and make sure the repository name and description can now be changed. ''' self.logout() self.login( email=common.test_user_2_email, username=common.test_user_2_name ) repository = self.test_db_util.get_repository_by_name_and_owner( 'renamed_filtering_0530', common.test_user_1_name ) self.edit_repository_information( repository, revert=False, repo_name='filtering_0530' ) self.test_db_util.refresh( repository ) assert repository.name == 'filtering_0530', 'User with admin role failed to rename repository.' test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) old_repository_admin_role = self.test_db_util.get_role( test_user_1, 'renamed_filtering_0530_user1_admin' ) assert old_repository_admin_role is None, 'Admin role renamed_filtering_0530_user1_admin incorrectly exists.' new_repository_admin_role = self.test_db_util.get_role( test_user_1, 'filtering_0530_user1_admin' ) assert new_repository_admin_role is not None, 'Admin role filtering_0530_user1_admin does not exist.'
45,048
https://github.com/fakufaku/timeseries-api/blob/master/clients/python_viewer/api_access.py
Github Open Source
Open Source
MIT
2,019
timeseries-api
fakufaku
Python
Code
270
827
import argparse import requests URL_API = 'https://data.robinscheibler.org/api' ''' TODO ---- API: Add endpoints: /series/<series_id>/fields -> return all fields /series/<series_id>/count -> return the count Update endpoint /series/<series_id> so that it deletes all the datapoints too Add some arguments to the get command to limit the entries returned (number of dates, start, end, etc) ''' def main_list(args): from dateutil.parser import parse as parse_date r = requests.get(URL_API + '/series') if not r.ok: raise ValueError('The request failed with code:', r.status_code) series = [] for ID, info in r.json().items(): date = parse_date(info['timestamp']) info['date'] = date.strftime('%Y-%m-%d %H:%M') info['id'] = ID series.append(info) # sort to get most recent at bottom for info in sorted(series, key=lambda x : x['date']): print('| {id:<20} | {desc:<40.40} | {date:16} | {count:5d} |'.format(**info)) def main_plot(args): import pandas as pd import matplotlib.pyplot as plt from dateutil.parser import parse as parse_date r = requests.get(URL_API + '/series/' + args.series_id) if not r.ok: raise ValueError('The request failed with code:', r.status_code) points = r.json() # get all the fields field_labels = set() for point in points: for field_name in point['fields'].keys(): field_labels.add(field_name) # Now reorganize in a structure that can be ingested in a dataframe dates = [] fields = {} for label in field_labels: fields[label] = [] for point in points: dates.append(parse_date(point['timestamp'])) for label in field_labels: if label in point['fields']: fields[label].append(point['fields'][label]) else: fields[label].append(None) # Create the dataframe and plot the time series df = pd.DataFrame(data=fields, index=dates) df.plot() plt.show() if __name__ == '__main__': parser = argparse.ArgumentParser() subparsers = parser.add_subparsers(help='sub-command help') parser_list = subparsers.add_parser('list', help='List all the series available') parser_list.set_defaults(func=main_list) parser_plot = subparsers.add_parser('plot', help='Plot a time series') parser_plot.add_argument('series_id', type=str, help='The ID of the time series.') parser_plot.set_defaults(func=main_plot) args = parser.parse_args() args.func(args)
1,077
https://github.com/ethanjli/octopi-driver-board/blob/master/ODSv1.0.0-BP-Jmp/IO Expander.sch
Github Open Source
Open Source
Apache-2.0
2,022
octopi-driver-board
ethanjli
Eagle
Code
5,680
14,615
EESchema Schematic File Version 4 EELAYER 30 0 EELAYER END $Descr USLetter 11000 8500 encoding utf-8 Sheet 9 9 Title "Breakout Plane for Jumper Wires" Date "2021-03-11" Rev "v0.2.0" Comp "Prakash Lab/Octopi Team" Comment1 "Designer: Ethan Li" Comment2 "License: SHL-2.1" Comment3 "" Comment4 "Octopi Driver Stack v1.0.0: Plane" $EndDescr Text HLabel 1000 1800 0 50 3State ~ 0 SPI0_CIPO $Comp L Device:C C? U 1 1 6021E777 P 1000 5150 AR Path="/60C51399/6199D8B6/6021E777" Ref="C?" Part="1" AR Path="/60C384EE/6021E777" Ref="C8" Part="1" F 0 "C8" H 1115 5196 50 0000 L CNN F 1 "0.1uF" H 1115 5105 50 0000 L CNN F 2 "Capacitor_SMD:C_0603_1608Metric" H 1038 5000 50 0001 C CNN F 3 "http://datasheets.avx.com/X7RDielectric.pdf" H 1000 5150 50 0001 C CNN F 4 "06033C104KAT4A" H 1000 5150 50 0001 C CNN "MPN" F 5 "AVX" H 1000 5150 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/avx-corporation/06033C104KAT4A/3247517" H 1000 5150 50 0001 C CNN "Ordering URL" F 7 "SMD" H 1000 5150 50 0001 C CNN "Type" F 8 "478-7018-1-ND" H 1000 5150 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 1000 5150 50 0001 C CNN "Config" 1 1000 5150 -1 0 0 -1 $EndComp $Comp L power:GND #PWR? U 1 1 6021E77D P 1000 5300 AR Path="/60C51399/6199D8B6/6021E77D" Ref="#PWR?" Part="1" AR Path="/60C384EE/6021E77D" Ref="#PWR054" Part="1" F 0 "#PWR054" H 1000 5050 50 0001 C CNN F 1 "GND" H 1005 5127 50 0000 C CNN F 2 "" H 1000 5300 50 0001 C CNN F 3 "" H 1000 5300 50 0001 C CNN 1 1000 5300 -1 0 0 -1 $EndComp Text HLabel 1000 5000 1 50 Input ~ 0 3.3V Wire Wire Line 4600 5900 4350 5900 $Comp L power:GND #PWR? U 1 1 6026C81A P 4600 5900 AR Path="/60C51399/6199D8B6/6026C81A" Ref="#PWR?" Part="1" AR Path="/60C384EE/6026C81A" Ref="#PWR053" Part="1" F 0 "#PWR053" H 4600 5650 50 0001 C CNN F 1 "GND" H 4605 5727 50 0000 C CNN F 2 "" H 4600 5900 50 0001 C CNN F 3 "" H 4600 5900 50 0001 C CNN 1 4600 5900 -1 0 0 -1 $EndComp Text Label 4350 5700 0 50 ~ 0 ADCCOM Text Label 4350 5600 0 50 ~ 0 ADCCOM Text Label 4350 5500 0 50 ~ 0 ADCCOM Text Label 4350 5400 0 50 ~ 0 ADCCOM Text Label 4350 5300 0 50 ~ 0 ADCCOM Text Label 4350 5200 0 50 ~ 0 ADCCOM Text Label 4350 5100 0 50 ~ 0 ADCCOM Text Label 4350 5000 0 50 ~ 0 ADCCOM Text Label 4350 5800 0 50 ~ 0 ADCCOM Text HLabel 2100 4800 1 50 Input ~ 0 3.3V Text Label 3850 5200 2 50 ~ 0 ADC2 Text Label 3850 5100 2 50 ~ 0 ADC1 Text Label 3850 5000 2 50 ~ 0 ADC0 Connection ~ 2750 4800 Wire Wire Line 2100 4800 2750 4800 Wire Wire Line 2750 4800 2950 4800 Wire Wire Line 3850 5200 3350 5200 Wire Wire Line 3850 5100 3350 5100 Wire Wire Line 3850 5000 3350 5000 $Comp L Connector_Generic:Conn_02x10_Odd_Even J? U 1 1 60C7F5E8 P 4150 5400 AR Path="/6085F6E2/60C7F5E8" Ref="J?" Part="1" AR Path="/60C384EE/60C7F5E8" Ref="J21" Part="1" F 0 "J21" H 4200 6050 50 0000 C CNN F 1 "Conn_02x10_Odd_Even" H 4200 5950 50 0000 C CNN F 2 "Connector_PinHeader_2.54mm:PinHeader_2x10_P2.54mm_Vertical_SMD" H 4150 5400 50 0001 C CNN F 3 "http://suddendocs.samtec.com/catalog_english/tsm.pdf" H 4150 5400 50 0001 C CNN F 4 "-NoExpansion, -NoIC" H 4150 5400 50 0001 C CNN "Config" F 5 "SAM8990-ND" H 4150 5400 50 0001 C CNN "Digikey ID" F 6 "TSM-110-01-T-DV" H 4150 5400 50 0001 C CNN "MPN" F 7 "Samtec" H 4150 5400 50 0001 C CNN "Manufacturer" F 8 "https://www.digikey.com/en/products/detail/samtec-inc/TSM-110-01-T-DV/1236604" H 4150 5400 50 0001 C CNN "Ordering URL" F 9 "SMD" H 4150 5400 50 0001 C CNN "Type" 1 4150 5400 -1 0 0 -1 $EndComp $Comp L Octopi:AD7689xCP U8 U 1 1 602154C4 P 2850 5500 F 0 "U8" H 2450 6150 50 0000 L CNN F 1 "AD7689xCP" H 3300 6050 50 0000 L CNN F 2 "Package_CSP:LFCSP-20-1EP_4x4mm_P0.5mm_EP2.5x2.5mm" H 2850 5500 50 0001 C CNN F 3 "https://www.analog.com/media/en/technical-documentation/data-sheets/AD7682_7689.pdf" H 2850 5500 50 0001 C CNN F 4 "-NoExpansion, -NoIC" H 2850 5500 50 0001 C CNN "Config" F 5 "AD7689BCPZRL7CT-ND" H 2850 5500 50 0001 C CNN "Digikey ID" F 6 "AD7689BCPZRL7" H 2850 5500 50 0001 C CNN "MPN" F 7 "Analog Devices" H 2850 5500 50 0001 C CNN "Manufacturer" F 8 "https://www.digikey.com/en/products/detail/analog-devices-inc/AD7689BCPZRL7/1873540" H 2850 5500 50 0001 C CNN "Ordering URL" F 9 "SMD" H 2850 5500 50 0001 C CNN "Type" 1 2850 5500 -1 0 0 -1 $EndComp Wire Wire Line 3850 5300 3350 5300 Wire Wire Line 3850 5400 3350 5400 Wire Wire Line 3850 5500 3350 5500 Wire Wire Line 3850 5600 3350 5600 Wire Wire Line 3850 5700 3350 5700 Text Label 3850 5300 2 50 ~ 0 ADC3 Text Label 3850 5400 2 50 ~ 0 ADC4 Text Label 3850 5500 2 50 ~ 0 ADC5 Text Label 3850 5600 2 50 ~ 0 ADC6 Text Label 3850 5700 2 50 ~ 0 ADC7 Wire Wire Line 2100 5500 2350 5500 Wire Wire Line 2100 5600 2350 5600 Wire Wire Line 2100 5700 2350 5700 Wire Wire Line 2100 5400 2350 5400 Text HLabel 2100 5500 0 50 3State ~ 0 SPI0_CIPO Text HLabel 2100 5600 0 50 Input ~ 0 SPI0_COPI Text HLabel 2100 5700 0 50 Input ~ 0 SPI0_SCK Text HLabel 2100 5400 0 50 Input ~ 0 ~DCS2~ Wire Wire Line 2100 6300 2750 6300 Connection ~ 2750 6300 Wire Wire Line 2750 6300 2950 6300 $Comp L power:GND #PWR? U 1 1 6024F9BC P 2100 6300 AR Path="/60C51399/6199D8B6/6024F9BC" Ref="#PWR?" Part="1" AR Path="/60C384EE/6024F9BC" Ref="#PWR052" Part="1" F 0 "#PWR052" H 2100 6050 50 0001 C CNN F 1 "GND" H 2105 6127 50 0000 C CNN F 2 "" H 2100 6300 50 0001 C CNN F 3 "" H 2100 6300 50 0001 C CNN 1 2100 6300 -1 0 0 -1 $EndComp Text Label 3350 5800 0 50 ~ 0 ADCCOM Text Label 3850 5800 2 50 ~ 0 REF Text Label 3350 6000 0 50 ~ 0 REF Text Label 3350 6100 0 50 ~ 0 REFIN $Comp L power:GND #PWR? U 1 1 60237E58 P 1500 6100 AR Path="/60C51399/6199D8B6/60237E58" Ref="#PWR?" Part="1" AR Path="/60C384EE/60237E58" Ref="#PWR055" Part="1" F 0 "#PWR055" H 1500 5850 50 0001 C CNN F 1 "GND" H 1505 5927 50 0000 C CNN F 2 "" H 1500 6100 50 0001 C CNN F 3 "" H 1500 6100 50 0001 C CNN 1 1500 6100 -1 0 0 -1 $EndComp $Comp L Device:C C? U 1 1 60237E52 P 1500 5950 AR Path="/60C51399/6199D8B6/60237E52" Ref="C?" Part="1" AR Path="/60C384EE/60237E52" Ref="C11" Part="1" F 0 "C11" H 1615 5996 50 0000 L CNN F 1 "10uF" H 1615 5905 50 0000 L CNN F 2 "Capacitor_SMD:C_0805_2012Metric" H 1538 5800 50 0001 C CNN F 3 "http://datasheets.avx.com/X7RDielectric.pdf" H 1500 5950 50 0001 C CNN F 4 "0805ZC106KAT2A" H 1500 5950 50 0001 C CNN "MPN" F 5 "AVX" H 1500 5950 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/avx-corporation/0805ZC106KAT2A/3081418" H 1500 5950 50 0001 C CNN "Ordering URL" F 7 "SMD" H 1500 5950 50 0001 C CNN "Type" F 8 "478-10578-1-ND" H 1500 5950 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 1500 5950 50 0001 C CNN "Config" 1 1500 5950 -1 0 0 -1 $EndComp $Comp L Device:C C? U 1 1 60290679 P 1500 5150 AR Path="/60C51399/6199D8B6/60290679" Ref="C?" Part="1" AR Path="/60C384EE/60290679" Ref="C10" Part="1" F 0 "C10" H 1615 5196 50 0000 L CNN F 1 "0.1uF" H 1615 5105 50 0000 L CNN F 2 "Capacitor_SMD:C_0603_1608Metric" H 1538 5000 50 0001 C CNN F 3 "http://datasheets.avx.com/X7RDielectric.pdf" H 1500 5150 50 0001 C CNN F 4 "06033C104KAT4A" H 1500 5150 50 0001 C CNN "MPN" F 5 "AVX" H 1500 5150 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/avx-corporation/06033C104KAT4A/3247517" H 1500 5150 50 0001 C CNN "Ordering URL" F 7 "SMD" H 1500 5150 50 0001 C CNN "Type" F 8 "478-7018-1-ND" H 1500 5150 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 1500 5150 50 0001 C CNN "Config" 1 1500 5150 -1 0 0 -1 $EndComp $Comp L power:GND #PWR? U 1 1 6029067F P 1500 5300 AR Path="/60C51399/6199D8B6/6029067F" Ref="#PWR?" Part="1" AR Path="/60C384EE/6029067F" Ref="#PWR0111" Part="1" F 0 "#PWR0111" H 1500 5050 50 0001 C CNN F 1 "GND" H 1505 5127 50 0000 C CNN F 2 "" H 1500 5300 50 0001 C CNN F 3 "" H 1500 5300 50 0001 C CNN 1 1500 5300 -1 0 0 -1 $EndComp Text Label 1500 5800 1 50 ~ 0 REF Text Label 3850 5900 2 50 ~ 0 REFIN Text Label 1500 5000 1 50 ~ 0 REFIN $Comp L Device:C C? U 1 1 602A3F4C P 1000 5950 AR Path="/60C51399/6199D8B6/602A3F4C" Ref="C?" Part="1" AR Path="/60C384EE/602A3F4C" Ref="C9" Part="1" F 0 "C9" H 1115 5996 50 0000 L CNN F 1 "0.1uF" H 1115 5905 50 0000 L CNN F 2 "Capacitor_SMD:C_0603_1608Metric" H 1038 5800 50 0001 C CNN F 3 "http://datasheets.avx.com/X7RDielectric.pdf" H 1000 5950 50 0001 C CNN F 4 "06033C104KAT4A" H 1000 5950 50 0001 C CNN "MPN" F 5 "AVX" H 1000 5950 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/avx-corporation/06033C104KAT4A/3247517" H 1000 5950 50 0001 C CNN "Ordering URL" F 7 "SMD" H 1000 5950 50 0001 C CNN "Type" F 8 "478-7018-1-ND" H 1000 5950 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 1000 5950 50 0001 C CNN "Config" 1 1000 5950 -1 0 0 -1 $EndComp $Comp L power:GND #PWR? U 1 1 602A3F52 P 1000 6100 AR Path="/60C51399/6199D8B6/602A3F52" Ref="#PWR?" Part="1" AR Path="/60C384EE/602A3F52" Ref="#PWR056" Part="1" F 0 "#PWR056" H 1000 5850 50 0001 C CNN F 1 "GND" H 1005 5927 50 0000 C CNN F 2 "" H 1000 6100 50 0001 C CNN F 3 "" H 1000 6100 50 0001 C CNN 1 1000 6100 -1 0 0 -1 $EndComp Text HLabel 1000 5800 1 50 Input ~ 0 3.3V Wire Wire Line 3450 2200 4000 2200 Wire Wire Line 3450 2100 4000 2100 Wire Wire Line 3450 2000 4000 2000 Wire Wire Line 3450 1900 4000 1900 Wire Wire Line 3450 1800 4000 1800 Wire Wire Line 3450 1700 4000 1700 Wire Wire Line 3450 1600 4000 1600 Wire Wire Line 3450 1500 4000 1500 Wire Wire Line 3450 1400 4000 1400 Wire Wire Line 3450 1300 4000 1300 Wire Wire Line 4500 3900 4500 4000 Connection ~ 4500 3900 Wire Wire Line 4500 3800 4500 3900 Connection ~ 4500 3800 Wire Wire Line 4500 3700 4500 3800 Connection ~ 4500 3700 Wire Wire Line 4500 3600 4500 3700 Connection ~ 4500 3600 Wire Wire Line 4500 3500 4500 3600 Connection ~ 4500 3500 Wire Wire Line 4500 3400 4500 3500 Connection ~ 4500 3400 Wire Wire Line 4500 3300 4500 3400 Connection ~ 4500 3300 Wire Wire Line 4500 3200 4500 3300 Connection ~ 4500 3200 Wire Wire Line 4500 3100 4500 3200 Connection ~ 4500 3100 Wire Wire Line 4500 2800 4500 3100 Text HLabel 4500 2800 1 50 Input ~ 0 3.3V Wire Wire Line 4500 4000 4300 4000 Wire Wire Line 4500 3900 4300 3900 Wire Wire Line 4500 3800 4300 3800 Wire Wire Line 4500 3700 4300 3700 Wire Wire Line 4500 3600 4300 3600 Wire Wire Line 4500 3500 4300 3500 Wire Wire Line 4500 3400 4300 3400 Wire Wire Line 4500 3300 4300 3300 Wire Wire Line 4500 3200 4300 3200 Wire Wire Line 4500 3100 4300 3100 Text HLabel 2750 1000 1 50 Input ~ 0 3.3V Text Label 3450 4000 0 50 ~ 0 EXPIO19 Text Label 3450 3900 0 50 ~ 0 EXPIO18 Text Label 3450 3800 0 50 ~ 0 EXPIO17 Text Label 3450 3700 0 50 ~ 0 EXPIO16 Text Label 3450 3600 0 50 ~ 0 EXPIO15 Text Label 3450 3500 0 50 ~ 0 EXPIO14 Text Label 3450 3400 0 50 ~ 0 EXPIO13 Text Label 3450 3300 0 50 ~ 0 EXPIO12 Text Label 3450 3200 0 50 ~ 0 EXPIO11 Text Label 3450 3100 0 50 ~ 0 EXPIO10 Wire Wire Line 4000 3100 3450 3100 Wire Wire Line 4000 3200 3450 3200 Wire Wire Line 4000 3300 3450 3300 Wire Wire Line 4000 3400 3450 3400 Wire Wire Line 4000 3500 3450 3500 Wire Wire Line 4000 3600 3450 3600 Wire Wire Line 4000 3700 3450 3700 Wire Wire Line 4000 3800 3450 3800 Wire Wire Line 4000 3900 3450 3900 Wire Wire Line 4000 4000 3450 4000 $Comp L power:GND #PWR? U 1 1 605006F7 P 2750 4300 AR Path="/60C51399/6199D8B6/605006F7" Ref="#PWR?" Part="1" AR Path="/60C384EE/605006F7" Ref="#PWR050" Part="1" F 0 "#PWR050" H 2750 4050 50 0001 C CNN F 1 "GND" H 2755 4127 50 0000 C CNN F 2 "" H 2750 4300 50 0001 C CNN F 3 "" H 2750 4300 50 0001 C CNN 1 2750 4300 1 0 0 -1 $EndComp Text HLabel 2050 3700 0 50 Input ~ 0 ~DCS1~ $Comp L Octopi:MAX7317 U? U 1 1 605006DD P 2750 3550 AR Path="/60C51399/6199D8B6/605006DD" Ref="U?" Part="1" AR Path="/60C384EE/605006DD" Ref="U6" Part="1" AR Path="/605006DD" Ref="U?" Part="1" F 0 "U6" H 2300 4150 50 0000 C CNN F 1 "MAX7317" H 2750 3550 50 0000 C CNN F 2 "Package_SO:QSOP-16_3.9x4.9mm_P0.635mm" H 2950 2900 50 0001 L CNN F 3 "https://datasheets.maximintegrated.com/en/ds/MAX7317.pdf" H 2950 2450 50 0001 L CNN F 4 "MAX7317AEE+T" H 2750 3550 50 0001 C CNN "MPN" F 5 "Maxim" H 2750 3550 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/maxim-integrated/MAX7317AEE-T/1781026" H 2750 3550 50 0001 C CNN "Ordering URL" F 7 "SMD" H 2750 3550 50 0001 C CNN "Type" F 8 "MAX7317AEE+TCT-ND" H 2750 3550 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 2750 3550 50 0001 C CNN "Config" 1 2750 3550 1 0 0 -1 $EndComp Text HLabel 2750 2800 2 50 Input ~ 0 3.3V Text HLabel 2050 3500 0 50 Input ~ 0 SPI0_COPI Text HLabel 2050 3400 0 50 Input ~ 0 SPI0_SCK Text Label 4750 2200 0 50 ~ 0 EXPIO10 Text Label 4750 2100 0 50 ~ 0 EXPIO11 Text Label 4750 2000 0 50 ~ 0 EXPIO12 Text Label 4750 1900 0 50 ~ 0 EXPIO13 Text Label 4750 1800 0 50 ~ 0 EXPIO14 Text Label 4750 1700 0 50 ~ 0 EXPIO15 Text Label 4750 1600 0 50 ~ 0 EXPIO16 Text Label 4750 1500 0 50 ~ 0 EXPIO17 Text Label 4750 1400 0 50 ~ 0 EXPIO18 Text Label 4750 1300 0 50 ~ 0 EXPIO19 Wire Wire Line 4500 2200 4750 2200 Wire Wire Line 4500 2100 4750 2100 Wire Wire Line 4500 2000 4750 2000 Wire Wire Line 4500 1900 4750 1900 Wire Wire Line 4500 1800 4750 1800 Wire Wire Line 4500 1700 4750 1700 Wire Wire Line 4500 1600 4750 1600 Wire Wire Line 4500 1500 4750 1500 Wire Wire Line 4500 1400 4750 1400 Wire Wire Line 4500 1300 4750 1300 Text Label 3450 2200 0 50 ~ 0 EXPIO9 Text Label 3450 2100 0 50 ~ 0 EXPIO8 Text Label 3450 2000 0 50 ~ 0 EXPIO7 Text Label 3450 1900 0 50 ~ 0 EXPIO6 Text Label 3450 1800 0 50 ~ 0 EXPIO5 Text Label 3450 1700 0 50 ~ 0 EXPIO4 Text Label 3450 1600 0 50 ~ 0 EXPIO3 Text Label 3450 1500 0 50 ~ 0 EXPIO2 Text Label 3450 1400 0 50 ~ 0 EXPIO1 Text Label 3450 1300 0 50 ~ 0 EXPIO0 $Comp L Connector_Generic:Conn_02x10_Odd_Even J? U 1 1 60C74B19 P 4300 1700 AR Path="/6085F6E2/60C74B19" Ref="J?" Part="1" AR Path="/60C384EE/60C74B19" Ref="J20" Part="1" F 0 "J20" H 4350 2350 50 0000 C CNN F 1 "Conn_02x10_Odd_Even" H 4350 2250 50 0000 C CNN F 2 "Connector_PinHeader_2.54mm:PinHeader_2x10_P2.54mm_Vertical_SMD" H 4300 1700 50 0001 C CNN F 3 "http://suddendocs.samtec.com/catalog_english/tsm.pdf" H 4300 1700 50 0001 C CNN F 4 "-NoExpansion, -NoIC" H 4300 1700 50 0001 C CNN "Config" F 5 "SAM8990-ND" H 4300 1700 50 0001 C CNN "Digikey ID" F 6 "TSM-110-01-T-DV" H 4300 1700 50 0001 C CNN "MPN" F 7 "Samtec" H 4300 1700 50 0001 C CNN "Manufacturer" F 8 "https://www.digikey.com/en/products/detail/samtec-inc/TSM-110-01-T-DV/1236604" H 4300 1700 50 0001 C CNN "Ordering URL" F 9 "SMD" H 4300 1700 50 0001 C CNN "Type" 1 4300 1700 -1 0 0 -1 $EndComp $Comp L power:GND #PWR? U 1 1 60C6A5EE P 2750 2500 AR Path="/60C51399/6199D8B6/60C6A5EE" Ref="#PWR?" Part="1" AR Path="/60C384EE/60C6A5EE" Ref="#PWR048" Part="1" F 0 "#PWR048" H 2750 2250 50 0001 C CNN F 1 "GND" H 2755 2327 50 0000 C CNN F 2 "" H 2750 2500 50 0001 C CNN F 3 "" H 2750 2500 50 0001 C CNN 1 2750 2500 1 0 0 -1 $EndComp Text HLabel 2050 1900 0 50 Input ~ 0 ~DCS0~ $Comp L Octopi:MAX7317 U? U 1 1 60C56060 P 2750 1750 AR Path="/60C51399/6199D8B6/60C56060" Ref="U?" Part="1" AR Path="/60C384EE/60C56060" Ref="U4" Part="1" AR Path="/60C56060" Ref="U3" Part="1" F 0 "U4" H 2300 2350 50 0000 C CNN F 1 "MAX7317" H 2750 1750 50 0000 C CNN F 2 "Package_SO:QSOP-16_3.9x4.9mm_P0.635mm" H 2950 1100 50 0001 L CNN F 3 "https://datasheets.maximintegrated.com/en/ds/MAX7317.pdf" H 2950 650 50 0001 L CNN F 4 "MAX7317AEE+T" H 2750 1750 50 0001 C CNN "MPN" F 5 "Maxim" H 2750 1750 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/maxim-integrated/MAX7317AEE-T/1781026" H 2750 1750 50 0001 C CNN "Ordering URL" F 7 "SMD" H 2750 1750 50 0001 C CNN "Type" F 8 "MAX7317AEE+TCT-ND" H 2750 1750 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 2750 1750 50 0001 C CNN "Config" 1 2750 1750 1 0 0 -1 $EndComp Text HLabel 2050 1700 0 50 Input ~ 0 SPI0_COPI Text HLabel 2050 1600 0 50 Input ~ 0 SPI0_SCK $Comp L Octopi:NC7SZ125 U5 U 1 1 605F593B P 1250 1800 F 0 "U5" H 1100 1600 50 0000 C CNN F 1 "NC7SZ125" H 1200 1450 50 0000 C CNN F 2 "Package_TO_SOT_SMD:SOT-353_SC-70-5" H 1250 1800 50 0001 C CNN F 3 "https://rocelec.widen.net/view/pdf/uyzzz6spvq/ONSM-S-A0003591114-1.pdf" H 1250 1800 50 0001 C CNN F 4 "-NoExpansion, -NoIC" H 1250 1800 50 0001 C CNN "Config" F 5 "NC7SZ125P5XCT-ND" H 1250 1800 50 0001 C CNN "Digikey ID" F 6 "NC7SZ125P5X" H 1250 1800 50 0001 C CNN "MPN" F 7 "ON Semiconductor" H 1250 1800 50 0001 C CNN "Manufacturer" F 8 "https://www.digikey.com/en/products/detail/on-semiconductor/NC7SZ125P5X/673366" H 1250 1800 50 0001 C CNN "Ordering URL" F 9 "SMD" H 1250 1800 50 0001 C CNN "Type" 1 1250 1800 -1 0 0 -1 $EndComp Wire Wire Line 2050 3600 1550 3600 Wire Wire Line 1550 1800 2050 1800 $Comp L power:GND #PWR? U 1 1 605FC11C P 1200 1850 AR Path="/60C51399/6199D8B6/605FC11C" Ref="#PWR?" Part="1" AR Path="/60C384EE/605FC11C" Ref="#PWR0108" Part="1" F 0 "#PWR0108" H 1200 1600 50 0001 C CNN F 1 "GND" H 1205 1677 50 0000 C CNN F 2 "" H 1200 1850 50 0001 C CNN F 3 "" H 1200 1850 50 0001 C CNN 1 1200 1850 1 0 0 -1 $EndComp Text HLabel 1200 1600 0 50 Input ~ 0 3.3V Wire Wire Line 1200 1600 1200 1750 Text HLabel 1250 1600 2 50 Input ~ 0 ~DCS0~ Text HLabel 1000 3600 0 50 3State ~ 0 SPI0_CIPO $Comp L Octopi:NC7SZ125 U7 U 1 1 60602B26 P 1250 3600 F 0 "U7" H 1100 3400 50 0000 C CNN F 1 "NC7SZ125" H 1200 3250 50 0000 C CNN F 2 "Package_TO_SOT_SMD:SOT-353_SC-70-5" H 1250 3600 50 0001 C CNN F 3 "https://rocelec.widen.net/view/pdf/uyzzz6spvq/ONSM-S-A0003591114-1.pdf" H 1250 3600 50 0001 C CNN F 4 "-NoExpansion, -NoIC" H 1250 3600 50 0001 C CNN "Config" F 5 "NC7SZ125P5XCT-ND" H 1250 3600 50 0001 C CNN "Digikey ID" F 6 "NC7SZ125P5X" H 1250 3600 50 0001 C CNN "MPN" F 7 "ON Semiconductor" H 1250 3600 50 0001 C CNN "Manufacturer" F 8 "https://www.digikey.com/en/products/detail/on-semiconductor/NC7SZ125P5X/673366" H 1250 3600 50 0001 C CNN "Ordering URL" F 9 "SMD" H 1250 3600 50 0001 C CNN "Type" 1 1250 3600 -1 0 0 -1 $EndComp $Comp L power:GND #PWR? U 1 1 60602B2C P 1200 3650 AR Path="/60C51399/6199D8B6/60602B2C" Ref="#PWR?" Part="1" AR Path="/60C384EE/60602B2C" Ref="#PWR0109" Part="1" F 0 "#PWR0109" H 1200 3400 50 0001 C CNN F 1 "GND" H 1205 3477 50 0000 C CNN F 2 "" H 1200 3650 50 0001 C CNN F 3 "" H 1200 3650 50 0001 C CNN 1 1200 3650 1 0 0 -1 $EndComp Text HLabel 1200 3400 0 50 Input ~ 0 3.3V Wire Wire Line 1200 3400 1200 3550 Text HLabel 1250 3400 2 50 Input ~ 0 ~DCS1~ $Comp L Device:R R? U 1 1 6071EF9F P 4150 3100 AR Path="/60C51399/6071EF9F" Ref="R?" Part="1" AR Path="/60C384EE/6071EF9F" Ref="R45" Part="1" F 0 "R45" V 4100 2950 50 0000 R CNN F 1 "2k" V 4150 3100 50 0000 C CNN F 2 "Resistor_SMD:R_0603_1608Metric" V 4080 3100 50 0001 C CNN F 3 "https://www.yageo.com/upload/media/product/productsearch/datasheet/rchip/PYu-RC_Group_51_RoHS_L_11.pdf" H 4150 3100 50 0001 C CNN F 4 "RC0603FR-0720KL" H 4150 3100 50 0001 C CNN "MPN" F 5 "Yageo" H 4150 3100 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/yageo/RC0603FR-0720KL/727040" H 4150 3100 50 0001 C CNN "Ordering URL" F 7 "SMD" H 4150 3100 50 0001 C CNN "Type" F 8 "311-20.0KHRCT-ND" H 4150 3100 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 4150 3100 50 0001 C CNN "Config" 1 4150 3100 0 -1 1 0 $EndComp $Comp L Device:R R? U 1 1 6071EFAB P 4150 3200 AR Path="/60C51399/6071EFAB" Ref="R?" Part="1" AR Path="/60C384EE/6071EFAB" Ref="R46" Part="1" F 0 "R46" V 4100 3050 50 0000 R CNN F 1 "2k" V 4150 3200 50 0000 C CNN F 2 "Resistor_SMD:R_0603_1608Metric" V 4080 3200 50 0001 C CNN F 3 "https://www.yageo.com/upload/media/product/productsearch/datasheet/rchip/PYu-RC_Group_51_RoHS_L_11.pdf" H 4150 3200 50 0001 C CNN F 4 "RC0603FR-0720KL" H 4150 3200 50 0001 C CNN "MPN" F 5 "Yageo" H 4150 3200 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/yageo/RC0603FR-0720KL/727040" H 4150 3200 50 0001 C CNN "Ordering URL" F 7 "SMD" H 4150 3200 50 0001 C CNN "Type" F 8 "311-20.0KHRCT-ND" H 4150 3200 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 4150 3200 50 0001 C CNN "Config" 1 4150 3200 0 -1 1 0 $EndComp $Comp L Device:R R? U 1 1 6071EFB7 P 4150 3300 AR Path="/60C51399/6071EFB7" Ref="R?" Part="1" AR Path="/60C384EE/6071EFB7" Ref="R47" Part="1" F 0 "R47" V 4100 3150 50 0000 R CNN F 1 "2k" V 4150 3300 50 0000 C CNN F 2 "Resistor_SMD:R_0603_1608Metric" V 4080 3300 50 0001 C CNN F 3 "https://www.yageo.com/upload/media/product/productsearch/datasheet/rchip/PYu-RC_Group_51_RoHS_L_11.pdf" H 4150 3300 50 0001 C CNN F 4 "RC0603FR-0720KL" H 4150 3300 50 0001 C CNN "MPN" F 5 "Yageo" H 4150 3300 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/yageo/RC0603FR-0720KL/727040" H 4150 3300 50 0001 C CNN "Ordering URL" F 7 "SMD" H 4150 3300 50 0001 C CNN "Type" F 8 "311-20.0KHRCT-ND" H 4150 3300 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 4150 3300 50 0001 C CNN "Config" 1 4150 3300 0 -1 1 0 $EndComp $Comp L Device:R R? U 1 1 6071EFC3 P 4150 3400 AR Path="/60C51399/6071EFC3" Ref="R?" Part="1" AR Path="/60C384EE/6071EFC3" Ref="R48" Part="1" F 0 "R48" V 4100 3250 50 0000 R CNN F 1 "2k" V 4150 3400 50 0000 C CNN F 2 "Resistor_SMD:R_0603_1608Metric" V 4080 3400 50 0001 C CNN F 3 "https://www.yageo.com/upload/media/product/productsearch/datasheet/rchip/PYu-RC_Group_51_RoHS_L_11.pdf" H 4150 3400 50 0001 C CNN F 4 "RC0603FR-0720KL" H 4150 3400 50 0001 C CNN "MPN" F 5 "Yageo" H 4150 3400 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/yageo/RC0603FR-0720KL/727040" H 4150 3400 50 0001 C CNN "Ordering URL" F 7 "SMD" H 4150 3400 50 0001 C CNN "Type" F 8 "311-20.0KHRCT-ND" H 4150 3400 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 4150 3400 50 0001 C CNN "Config" 1 4150 3400 0 -1 1 0 $EndComp $Comp L Device:R R? U 1 1 6071EFCF P 4150 3500 AR Path="/60C51399/6071EFCF" Ref="R?" Part="1" AR Path="/60C384EE/6071EFCF" Ref="R50" Part="1" F 0 "R50" V 4100 3350 50 0000 R CNN F 1 "2k" V 4150 3500 50 0000 C CNN F 2 "Resistor_SMD:R_0603_1608Metric" V 4080 3500 50 0001 C CNN F 3 "https://www.yageo.com/upload/media/product/productsearch/datasheet/rchip/PYu-RC_Group_51_RoHS_L_11.pdf" H 4150 3500 50 0001 C CNN F 4 "RC0603FR-0720KL" H 4150 3500 50 0001 C CNN "MPN" F 5 "Yageo" H 4150 3500 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/yageo/RC0603FR-0720KL/727040" H 4150 3500 50 0001 C CNN "Ordering URL" F 7 "SMD" H 4150 3500 50 0001 C CNN "Type" F 8 "311-20.0KHRCT-ND" H 4150 3500 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 4150 3500 50 0001 C CNN "Config" 1 4150 3500 0 -1 1 0 $EndComp $Comp L Device:R R? U 1 1 6071EFDB P 4150 3600 AR Path="/60C51399/6071EFDB" Ref="R?" Part="1" AR Path="/60C384EE/6071EFDB" Ref="R51" Part="1" F 0 "R51" V 4100 3450 50 0000 R CNN F 1 "2k" V 4150 3600 50 0000 C CNN F 2 "Resistor_SMD:R_0603_1608Metric" V 4080 3600 50 0001 C CNN F 3 "https://www.yageo.com/upload/media/product/productsearch/datasheet/rchip/PYu-RC_Group_51_RoHS_L_11.pdf" H 4150 3600 50 0001 C CNN F 4 "RC0603FR-0720KL" H 4150 3600 50 0001 C CNN "MPN" F 5 "Yageo" H 4150 3600 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/yageo/RC0603FR-0720KL/727040" H 4150 3600 50 0001 C CNN "Ordering URL" F 7 "SMD" H 4150 3600 50 0001 C CNN "Type" F 8 "311-20.0KHRCT-ND" H 4150 3600 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 4150 3600 50 0001 C CNN "Config" 1 4150 3600 0 -1 1 0 $EndComp $Comp L Device:R R? U 1 1 6071EFE7 P 4150 3700 AR Path="/60C51399/6071EFE7" Ref="R?" Part="1" AR Path="/60C384EE/6071EFE7" Ref="R52" Part="1" F 0 "R52" V 4100 3550 50 0000 R CNN F 1 "2k" V 4150 3700 50 0000 C CNN F 2 "Resistor_SMD:R_0603_1608Metric" V 4080 3700 50 0001 C CNN F 3 "https://www.yageo.com/upload/media/product/productsearch/datasheet/rchip/PYu-RC_Group_51_RoHS_L_11.pdf" H 4150 3700 50 0001 C CNN F 4 "RC0603FR-0720KL" H 4150 3700 50 0001 C CNN "MPN" F 5 "Yageo" H 4150 3700 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/yageo/RC0603FR-0720KL/727040" H 4150 3700 50 0001 C CNN "Ordering URL" F 7 "SMD" H 4150 3700 50 0001 C CNN "Type" F 8 "311-20.0KHRCT-ND" H 4150 3700 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 4150 3700 50 0001 C CNN "Config" 1 4150 3700 0 -1 1 0 $EndComp $Comp L Device:R R? U 1 1 6071EFF3 P 4150 3800 AR Path="/60C51399/6071EFF3" Ref="R?" Part="1" AR Path="/60C384EE/6071EFF3" Ref="R53" Part="1" F 0 "R53" V 4100 3650 50 0000 R CNN F 1 "2k" V 4150 3800 50 0000 C CNN F 2 "Resistor_SMD:R_0603_1608Metric" V 4080 3800 50 0001 C CNN F 3 "https://www.yageo.com/upload/media/product/productsearch/datasheet/rchip/PYu-RC_Group_51_RoHS_L_11.pdf" H 4150 3800 50 0001 C CNN F 4 "RC0603FR-0720KL" H 4150 3800 50 0001 C CNN "MPN" F 5 "Yageo" H 4150 3800 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/yageo/RC0603FR-0720KL/727040" H 4150 3800 50 0001 C CNN "Ordering URL" F 7 "SMD" H 4150 3800 50 0001 C CNN "Type" F 8 "311-20.0KHRCT-ND" H 4150 3800 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 4150 3800 50 0001 C CNN "Config" 1 4150 3800 0 -1 1 0 $EndComp $Comp L Device:R R? U 1 1 6071EFFF P 4150 3900 AR Path="/60C51399/6071EFFF" Ref="R?" Part="1" AR Path="/60C384EE/6071EFFF" Ref="R54" Part="1" F 0 "R54" V 4100 3750 50 0000 R CNN F 1 "2k" V 4150 3900 50 0000 C CNN F 2 "Resistor_SMD:R_0603_1608Metric" V 4080 3900 50 0001 C CNN F 3 "https://www.yageo.com/upload/media/product/productsearch/datasheet/rchip/PYu-RC_Group_51_RoHS_L_11.pdf" H 4150 3900 50 0001 C CNN F 4 "RC0603FR-0720KL" H 4150 3900 50 0001 C CNN "MPN" F 5 "Yageo" H 4150 3900 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/yageo/RC0603FR-0720KL/727040" H 4150 3900 50 0001 C CNN "Ordering URL" F 7 "SMD" H 4150 3900 50 0001 C CNN "Type" F 8 "311-20.0KHRCT-ND" H 4150 3900 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 4150 3900 50 0001 C CNN "Config" 1 4150 3900 0 -1 1 0 $EndComp $Comp L Device:R R? U 1 1 6071F00B P 4150 4000 AR Path="/60C51399/6071F00B" Ref="R?" Part="1" AR Path="/60C384EE/6071F00B" Ref="R55" Part="1" F 0 "R55" V 4100 3850 50 0000 R CNN F 1 "2k" V 4150 4000 50 0000 C CNN F 2 "Resistor_SMD:R_0603_1608Metric" V 4080 4000 50 0001 C CNN F 3 "https://www.yageo.com/upload/media/product/productsearch/datasheet/rchip/PYu-RC_Group_51_RoHS_L_11.pdf" H 4150 4000 50 0001 C CNN F 4 "RC0603FR-0720KL" H 4150 4000 50 0001 C CNN "MPN" F 5 "Yageo" H 4150 4000 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/yageo/RC0603FR-0720KL/727040" H 4150 4000 50 0001 C CNN "Ordering URL" F 7 "SMD" H 4150 4000 50 0001 C CNN "Type" F 8 "311-20.0KHRCT-ND" H 4150 4000 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 4150 4000 50 0001 C CNN "Config" 1 4150 4000 0 -1 1 0 $EndComp Text Label 2050 1800 2 50 ~ 0 EXP0_DOUT Text Label 2050 3600 2 50 ~ 0 EXP1_DOUT $Comp L Device:C C? U 1 1 6082633B P 1500 1150 AR Path="/60C51399/6199D8B6/6082633B" Ref="C?" Part="1" AR Path="/60C384EE/6082633B" Ref="C4" Part="1" F 0 "C4" H 1615 1196 50 0000 L CNN F 1 "0.047uF" H 1615 1105 50 0000 L CNN F 2 "Capacitor_SMD:C_0603_1608Metric" H 1538 1000 50 0001 C CNN F 3 "http://datasheets.avx.com/X7RDielectric.pdf" H 1500 1150 50 0001 C CNN F 4 "06033C473KAT2A" H 1500 1150 50 0001 C CNN "MPN" F 5 "AVX" H 1500 1150 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/avx-corporation/06033C473KAT2A/563345" H 1500 1150 50 0001 C CNN "Ordering URL" F 7 "SMD" H 1500 1150 50 0001 C CNN "Type" F 8 "478-1235-1-ND" H 1500 1150 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 1500 1150 50 0001 C CNN "Config" 1 1500 1150 1 0 0 -1 $EndComp $Comp L power:GND #PWR? U 1 1 60826341 P 1500 1300 AR Path="/60C51399/6199D8B6/60826341" Ref="#PWR?" Part="1" AR Path="/60C384EE/60826341" Ref="#PWR0117" Part="1" F 0 "#PWR0117" H 1500 1050 50 0001 C CNN F 1 "GND" H 1505 1127 50 0000 C CNN F 2 "" H 1500 1300 50 0001 C CNN F 3 "" H 1500 1300 50 0001 C CNN 1 1500 1300 1 0 0 -1 $EndComp Text HLabel 1500 1000 1 50 Input ~ 0 3.3V $Comp L Device:C C? U 1 1 60828103 P 1500 2950 AR Path="/60C51399/6199D8B6/60828103" Ref="C?" Part="1" AR Path="/60C384EE/60828103" Ref="C6" Part="1" F 0 "C6" H 1615 2996 50 0000 L CNN F 1 "0.047uF" H 1615 2905 50 0000 L CNN F 2 "Capacitor_SMD:C_0603_1608Metric" H 1538 2800 50 0001 C CNN F 3 "http://datasheets.avx.com/X7RDielectric.pdf" H 1500 2950 50 0001 C CNN F 4 "06033C473KAT2A" H 1500 2950 50 0001 C CNN "MPN" F 5 "AVX" H 1500 2950 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/avx-corporation/06033C473KAT2A/563345" H 1500 2950 50 0001 C CNN "Ordering URL" F 7 "SMD" H 1500 2950 50 0001 C CNN "Type" F 8 "478-1235-1-ND" H 1500 2950 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 1500 2950 50 0001 C CNN "Config" 1 1500 2950 1 0 0 -1 $EndComp $Comp L power:GND #PWR? U 1 1 60828109 P 1500 3100 AR Path="/60C51399/6199D8B6/60828109" Ref="#PWR?" Part="1" AR Path="/60C384EE/60828109" Ref="#PWR0118" Part="1" F 0 "#PWR0118" H 1500 2850 50 0001 C CNN F 1 "GND" H 1505 2927 50 0000 C CNN F 2 "" H 1500 3100 50 0001 C CNN F 3 "" H 1500 3100 50 0001 C CNN 1 1500 3100 1 0 0 -1 $EndComp Text HLabel 1500 2800 1 50 Input ~ 0 3.3V $Comp L Device:C C? U 1 1 6082EAF0 P 1000 1150 AR Path="/60C51399/6199D8B6/6082EAF0" Ref="C?" Part="1" AR Path="/60C384EE/6082EAF0" Ref="C5" Part="1" F 0 "C5" H 1115 1196 50 0000 L CNN F 1 "0.1uF" H 1115 1105 50 0000 L CNN F 2 "Capacitor_SMD:C_0603_1608Metric" H 1038 1000 50 0001 C CNN F 3 "http://datasheets.avx.com/X7RDielectric.pdf" H 1000 1150 50 0001 C CNN F 4 "06033C104KAT4A" H 1000 1150 50 0001 C CNN "MPN" F 5 "AVX" H 1000 1150 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/avx-corporation/06033C104KAT4A/3247517" H 1000 1150 50 0001 C CNN "Ordering URL" F 7 "SMD" H 1000 1150 50 0001 C CNN "Type" F 8 "478-7018-1-ND" H 1000 1150 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 1000 1150 50 0001 C CNN "Config" 1 1000 1150 -1 0 0 -1 $EndComp $Comp L power:GND #PWR? U 1 1 6082EAF6 P 1000 1300 AR Path="/60C51399/6199D8B6/6082EAF6" Ref="#PWR?" Part="1" AR Path="/60C384EE/6082EAF6" Ref="#PWR0119" Part="1" F 0 "#PWR0119" H 1000 1050 50 0001 C CNN F 1 "GND" H 1005 1127 50 0000 C CNN F 2 "" H 1000 1300 50 0001 C CNN F 3 "" H 1000 1300 50 0001 C CNN 1 1000 1300 -1 0 0 -1 $EndComp Text HLabel 1000 1000 1 50 Input ~ 0 3.3V $Comp L Device:C C? U 1 1 60830A48 P 1000 2950 AR Path="/60C51399/6199D8B6/60830A48" Ref="C?" Part="1" AR Path="/60C384EE/60830A48" Ref="C7" Part="1" F 0 "C7" H 1115 2996 50 0000 L CNN F 1 "0.1uF" H 1115 2905 50 0000 L CNN F 2 "Capacitor_SMD:C_0603_1608Metric" H 1038 2800 50 0001 C CNN F 3 "http://datasheets.avx.com/X7RDielectric.pdf" H 1000 2950 50 0001 C CNN F 4 "06033C104KAT4A" H 1000 2950 50 0001 C CNN "MPN" F 5 "AVX" H 1000 2950 50 0001 C CNN "Manufacturer" F 6 "https://www.digikey.com/en/products/detail/avx-corporation/06033C104KAT4A/3247517" H 1000 2950 50 0001 C CNN "Ordering URL" F 7 "SMD" H 1000 2950 50 0001 C CNN "Type" F 8 "478-7018-1-ND" H 1000 2950 50 0001 C CNN "Digikey ID" F 9 "-NoExpansion, -NoIC" H 1000 2950 50 0001 C CNN "Config" 1 1000 2950 -1 0 0 -1 $EndComp $Comp L power:GND #PWR? U 1 1 60830A4E P 1000 3100 AR Path="/60C51399/6199D8B6/60830A4E" Ref="#PWR?" Part="1" AR Path="/60C384EE/60830A4E" Ref="#PWR0120" Part="1" F 0 "#PWR0120" H 1000 2850 50 0001 C CNN F 1 "GND" H 1005 2927 50 0000 C CNN F 2 "" H 1000 3100 50 0001 C CNN F 3 "" H 1000 3100 50 0001 C CNN 1 1000 3100 -1 0 0 -1 $EndComp Text HLabel 1000 2800 1 50 Input ~ 0 3.3V $EndSCHEMATC
25,902
https://github.com/doorisopen/ga/blob/master/back/src/main/java/com/gagi/market/core/domain/dto/PageInfo.java
Github Open Source
Open Source
MIT
2,021
ga
doorisopen
Java
Code
103
312
package com.gagi.market.core.domain.dto; import lombok.Getter; import lombok.Setter; import org.springframework.data.domain.Page; import org.springframework.data.domain.Sort; import java.io.Serializable; @Getter @Setter public class PageInfo implements Serializable { private static final long serialVersionUID = 1L; private int offset; // 페이지 private int limit; // 페이지당 개수 private int total; // 전체 데이터 private boolean isLast; // 마지막 페이지 private Sort sort; public <T> PageInfo(Page<T> page) { super(); this.offset = page.getNumber(); this.limit = page.getSize(); this.total = page.getTotalPages(); this.isLast = page.isLast(); this.sort = page.getSort(); } public PageInfo(int offset, int limit, int total) { this.offset = offset; this.limit = limit; this.total = total; this.isLast = ((offset + 1) * limit) >= total; } }
23,930
https://github.com/ccbrantley/Formal-Logic-Aiding-Tutor/blob/master/src/main/java/com/flat/view/main/panes/center/children/algorithmvisualselection/children/buttons/truthtree/TruthTreeButton.java
Github Open Source
Open Source
MIT
2,021
Formal-Logic-Aiding-Tutor
ccbrantley
Java
Code
63
362
package com.flat.view.main.panes.center.children.algorithmvisualselection.children.buttons.truthtree; import com.flat.controller.Controller; import com.flat.models.data.miscellaneous.ButtonsLabels; import com.flat.view.main.panes.center.children.algorithmvisualselection.children.buttons.truthtree.events.TruthTreeButtonPressed; import javafx.scene.control.Button; /** * * @author Christopher Brantley <c_brantl@uncg.edu> */ public class TruthTreeButton extends Button { public TruthTreeButton () { this.initializeFx(); } private void initializeFx () { this.setThisFx(); this.setThisOnAction(); } private void setThisFx () { super.textProperty().bind(Controller.MAPPED_TEXT.getValue(ButtonsLabels.class, ButtonsLabels.Keys.TRUTH_TREE).textProperty()); super.fontProperty().bind(Controller.MAPPED_TEXT.getValue(ButtonsLabels.class, ButtonsLabels.Keys.TRUTH_TREE).fontProperty()); super.setDisable(true); super.setMinWidth(110); } private void setThisOnAction () { super.setOnAction(event -> { Controller.EVENT_BUS.throwEvent(new TruthTreeButtonPressed()); }); } }
38,595
https://github.com/VITObelgium/cpp-infra/blob/master/include/infra/size.h
Github Open Source
Open Source
MIT
2,022
cpp-infra
VITObelgium
C
Code
118
318
#pragma once #include <cinttypes> #include <fmt/core.h> #include <limits> namespace inf { struct Size { constexpr Size() = default; constexpr Size(int32_t width_, int32_t height_) noexcept : width(width_), height(height_) { } constexpr bool operator==(const Size& other) const { return width == other.width && height == other.height; } constexpr bool operator!=(const Size& other) const { return !(*this == other); } constexpr bool is_valid() const { return width >= 0 && height >= 0; } int32_t width = -1; int32_t height = -1; }; } namespace fmt { template <> struct formatter<inf::Size> { template <typename ParseContext> constexpr auto parse(ParseContext& ctx) { return ctx.begin(); } template <typename FormatContext> auto format(const inf::Size& s, FormatContext& ctx) { return format_to(ctx.out(), "({}x{})", s.width, s.height); } }; }
43,587
https://github.com/STEllAR-GROUP/hpx/blob/master/libs/core/datastructures/tests/unit/bitset_test.hpp
Github Open Source
Open Source
BSL-1.0, LicenseRef-scancode-free-unknown
2,023
hpx
STEllAR-GROUP
C++
Code
4,871
14,728
// Copyright (c) 2022 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 Distributed under the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // This code was adapted from boost dynamic_bitset // // Copyright (c) 2001 Jeremy Siek // Copyright (c) 2003-2006 Gennaro Prota // Copyright (c) 2014 Ahmed Charles // Copyright (c) 2014 Riccardo Marcangelo // Copyright (c) 2014 Glen Joseph Fernandes (glenjofe@gmail.com) // Copyright (c) 2018 Evgeny Shulgin #pragma once #include <hpx/config.hpp> #include <hpx/assert.hpp> #include <hpx/datastructures/detail/dynamic_bitset.hpp> #include <hpx/modules/testing.hpp> #include <algorithm> // for std::min #include <climits> #include <cstddef> #include <cstdio> #include <filesystem> #include <fstream> // used for operator<< #include <locale> #include <string> // for (basic_string and) getline() #include <utility> #include <vector> template <typename Block> inline bool nth_bit(Block num, std::size_t n) { int block_width = std::numeric_limits<Block>::digits; (void) block_width; HPX_ASSERT(n < (std::size_t) block_width); return (num >> n) & 1; } // A long, 'irregular', string useful for various tests std::string get_long_string() { char const* const p = // 6 5 4 3 2 1 // 3210987654321098765432109876543210987654321098765432109876543210 "1110011100011110000011110000011111110000000000000110101110000000" "1010101000011100011101010111110000101011111000001111100011100011" "0000000110000001000000111100000111100010101111111000000011100011" "1111111111111111111111111111111111111111111111111111111111111100" "1000001100000001111111111111110000000011111000111100001010100000" "101000111100011010101110011011000000010"; return std::string(p); } #if !defined(HPX_GCC_VERSION) class scoped_temp_file { public: scoped_temp_file() : path_(std::tmpnam(nullptr)) { } ~scoped_temp_file() { std::filesystem::remove(path_); } std::filesystem::path const& path() const { return path_; } private: std::filesystem::path path_; }; #endif template <typename Stream, typename Ch> bool is_one_or_zero(Stream const& s, Ch c) { typedef typename Stream::traits_type Tr; Ch const zero = s.widen('0'); Ch const one = s.widen('1'); return Tr::eq(c, one) || Tr::eq(c, zero); } template <typename Stream, typename Ch> bool is_white_space(Stream const& s, Ch c) { // NOTE: the using directive is to satisfy Borland 5.6.4 // with its own library (STLport), which doesn't // like std::isspace(c, loc) using namespace std; return isspace(c, s.getloc()); } template <typename Stream> bool has_flags(Stream const& s, std::ios::iostate flags) { return (s.rdstate() & flags) != std::ios::goodbit; } // constructors // default (can't do this generically) template <typename Bitset> struct bitset_test { typedef typename Bitset::block_type Block; static constexpr int bits_per_block = Bitset::bits_per_block; // from unsigned long // // Note: this is templatized so that we check that the do-the-right-thing // constructor dispatch is working correctly. // template <typename NumBits, typename Value> static void from_unsigned_long(NumBits num_bits, Value num) { // An object of size sz = num_bits is constructed: // - the first m bit positions are initialized to the corresponding // bit values in num (m being the smaller of sz and ulong_width) // // - any remaining bit positions are initialized to zero // Bitset b(static_cast<typename Bitset::size_type>(num_bits), static_cast<unsigned long>(num)); // OK, we can now cast to size_type typedef typename Bitset::size_type size_type; // NOLINTNEXTLINE(bugprone-signed-char-misuse) size_type const sz = static_cast<size_type>(num_bits); HPX_TEST(b.size() == sz); std::size_t const ulong_width = std::numeric_limits<unsigned long>::digits; size_type m = sz; if (ulong_width < sz) m = ulong_width; size_type i = 0; for (; i < m; ++i) HPX_TEST(b.test(i) == nth_bit(static_cast<unsigned long>(num), i)); for (; i < sz; ++i) HPX_TEST(b.test(i) == 0); } // from string // // Note: The corresponding function in dynamic_bitset (constructor // from a string) has several default arguments. Actually we don't // test the correct working of those defaults here (except for the // default of num_bits). i'm not sure what to do in this regard. // // Note2: the default argument expression for num_bits doesn't use // static_cast, to avoid a gcc 2.95.3 'sorry, not implemented' // template <typename Ch, typename Tr, typename Al> static void from_string(std::basic_string<Ch, Tr, Al> const& str, std::size_t pos, std::size_t max_char, std::size_t num_bits = (std::size_t)(-1)) { std::size_t rlen = (std::min)(max_char, str.size() - pos); // The resulting size N of the bitset is num_bits, if // that is different from the default arg, rlen otherwise. // Put M = the smaller of N and rlen, then character // position pos + M - 1 corresponds to bit position zero. // Subsequent decreasing character positions correspond to // increasing bit positions. bool const size_upon_string = num_bits == (std::size_t)(-1); Bitset b = size_upon_string ? Bitset(str, pos, max_char) : Bitset(str, pos, max_char, num_bits); std::size_t const actual_size = size_upon_string ? rlen : num_bits; HPX_TEST(b.size() == actual_size); std::size_t m = (std::min)(num_bits, rlen); std::size_t j; for (j = 0; j < m; ++j) HPX_TEST(bool(bool(b[j])) == (str[pos + m - 1 - j] == '1')); // If M < N, remaining bit positions are zero for (; j < actual_size; ++j) HPX_TEST(bool(bool(b[j])) == 0); } static void to_block_range(Bitset const& b /*, BlockOutputIterator result*/) { typedef typename Bitset::size_type size_type; Block sentinel = 0xF0; int s = 8; // number of sentinels (must be *even*) int offset = s / 2; std::vector<Block> v(b.num_blocks() + s, sentinel); hpx::detail::to_block_range(b, v.begin() + offset); HPX_ASSERT(v.size() >= (size_type) s && (s >= 2) && (s % 2 == 0)); // check sentinels at both ends for (int i = 0; i < s / 2; ++i) { HPX_TEST(v[i] == sentinel); HPX_TEST(v[v.size() - 1 - i] == sentinel); } typename std::vector<Block>::const_iterator p = v.begin() + offset; for (size_type n = 0; n < b.num_blocks(); ++n, ++p) { typename Bitset::block_width_type i = 0; for (; i < bits_per_block; ++i) { size_type bit = n * bits_per_block + i; HPX_TEST(nth_bit(*p, i) == (bit < b.size() ? b[bit] : 0)); } } } // TODO from_block_range (below) should be split // PRE: std::equal(first1, last1, first2) == true static void from_block_range(std::vector<Block> const& blocks) { { // test constructor from block range Bitset bset(blocks.begin(), blocks.end()); std::size_t n = blocks.size(); for (std::size_t b = 0; b < n; ++b) { typename Bitset::block_width_type i = 0; for (; i < bits_per_block; ++i) { std::size_t bit = b * bits_per_block + i; HPX_TEST(bool(bset[bit]) == nth_bit(blocks[b], i)); } } HPX_TEST(bset.size() == n * bits_per_block); } { // test hpx::detail::from_block_range typename Bitset::size_type const n = blocks.size(); Bitset bset(n * bits_per_block); hpx::detail::from_block_range(blocks.begin(), blocks.end(), bset); for (std::size_t b = 0; b < n; ++b) { typename Bitset::block_width_type i = 0; for (; i < bits_per_block; ++i) { std::size_t bit = b * bits_per_block + i; HPX_TEST(bool(bset[bit]) == nth_bit(blocks[b], i)); } } HPX_TEST(n <= bset.num_blocks()); } } // copy constructor (absent from std::bitset) static void copy_constructor(Bitset const& b) { Bitset copy(b); HPX_TEST(b == copy); // Changes to the copy do not affect the original if (b.size() > 0) { std::size_t pos = copy.size() / 2; copy.flip(pos); HPX_TEST(bool(copy[pos]) != bool(b[pos])); } } // copy assignment operator (absent from std::bitset) static void copy_assignment_operator(Bitset const& lhs, Bitset const& rhs) { Bitset b(lhs); b = rhs; // NOLINTNEXTLINE(clang-diagnostic-self-assign-overloaded) //b = b; // self assignment check HPX_TEST(b == rhs); // Changes to the copy do not affect the original if (b.size() > 0) { std::size_t pos = b.size() / 2; b.flip(pos); HPX_TEST(bool(b[pos]) != bool(rhs[pos])); } } static void max_size(Bitset const& b) { HPX_TEST(b.max_size() > 0); } // move constructor (absent from std::bitset) static void move_constructor(Bitset b) { HPX_TEST(b.check_invariants()); Bitset copy(std::move(b)); HPX_TEST(copy.check_invariants()); } // move assignment operator (absent from std::bitset) static void move_assignment_operator(Bitset const& lhs, Bitset const& rhs) { Bitset b(lhs); Bitset c(rhs); b = std::move(c); #if !defined(HPX_GCC_VERSION) || HPX_GCC_VERSION >= 130000 // NOLINTNEXTLINE(clang-diagnostic-self-assign-overloaded) b = std::move(b); // self assignment check #endif // NOLINTNEXTLINE(bugprone-use-after-move) HPX_TEST(b == rhs); } static void swap(Bitset const& lhs, Bitset const& rhs) { // bitsets must be swapped Bitset copy1(lhs); Bitset copy2(rhs); copy1.swap(copy2); HPX_TEST(copy1 == rhs); HPX_TEST(copy2 == lhs); // references must be stable under a swap for (typename Bitset::size_type i = 0; i < lhs.size(); ++i) { Bitset b1(lhs); Bitset b2(rhs); typename Bitset::reference ref = b1[i]; bool x = bool(ref); if (i < b2.size()) b2[i] = !x; // make sure b2[i] is different b1.swap(b2); HPX_TEST(bool(b2[i]) == x); // now it must be equal.. b2.flip(i); HPX_TEST(bool(ref) == bool(b2[i])); // .. and ref must be into b2 HPX_TEST(bool(ref) == !x); } } static void resize(Bitset const& lhs) { Bitset b(lhs); // Test no change in size b.resize(lhs.size()); HPX_TEST(b == lhs); // Test increase in size b.resize(lhs.size() * 2, true); std::size_t i; for (i = 0; i < lhs.size(); ++i) HPX_TEST(bool(b[i]) == bool(lhs[i])); for (; i < b.size(); ++i) HPX_TEST(bool(b[i]) == true); // Test decrease in size b.resize(lhs.size()); for (i = 0; i < lhs.size(); ++i) HPX_TEST(bool(b[i]) == bool(lhs[i])); } static void clear(Bitset const& lhs) { Bitset b(lhs); b.clear(); HPX_TEST(b.size() == 0); } static void pop_back(Bitset const& lhs) { Bitset b(lhs); b.pop_back(); HPX_TEST(b.size() == lhs.size() - 1); for (std::size_t i = 0; i < b.size(); ++i) HPX_TEST(bool(b[i]) == bool(lhs[i])); b.pop_back(); HPX_TEST(b.size() == lhs.size() - 2); for (std::size_t j = 0; j < b.size(); ++j) HPX_TEST(bool(b[j]) == bool(lhs[j])); } static void append_bit(Bitset const& lhs) { Bitset b(lhs); b.push_back(true); HPX_TEST(b.size() == lhs.size() + 1); HPX_TEST(bool(b[b.size() - 1]) == true); for (std::size_t i = 0; i < lhs.size(); ++i) HPX_TEST(bool(b[i]) == bool(lhs[i])); b.push_back(false); HPX_TEST(b.size() == lhs.size() + 2); HPX_TEST(bool(b[b.size() - 1]) == false); HPX_TEST(bool(b[b.size() - 2]) == true); for (std::size_t j = 0; j < lhs.size(); ++j) HPX_TEST(bool(b[j]) == bool(lhs[j])); } static void append_block(Bitset const& lhs) { Bitset b(lhs); Block value(128); b.append(value); HPX_TEST(b.size() == lhs.size() + bits_per_block); for (typename Bitset::block_width_type i = 0; i < bits_per_block; ++i) HPX_TEST(bool(b[lhs.size() + i]) == bool((value >> i) & 1)); } static void append_block_range( Bitset const& lhs, std::vector<Block> const& blocks) { Bitset b(lhs), c(lhs); b.append(blocks.begin(), blocks.end()); for (typename std::vector<Block>::const_iterator i = blocks.begin(); i != blocks.end(); ++i) c.append(*i); HPX_TEST(b == c); } // operator[] and reference members // PRE: bool(b[i]) == bit_vec[i] static void operator_bracket( Bitset const& lhs, std::vector<bool> const& bit_vec) { Bitset b(lhs); std::size_t i, j, k; // x = bool(b[i]) // x = ~bool(b[i]) for (i = 0; i < b.size(); ++i) { bool x = bool(b[i]); HPX_TEST(x == bit_vec[i]); x = ~b[i]; HPX_TEST(x == !bit_vec[i]); } Bitset prev(b); // bool(b[i]) = x for (j = 0; j < b.size(); ++j) { bool x = !prev[j]; b[j] = x; for (k = 0; k < b.size(); ++k) if (j == k) HPX_TEST(bool(b[k]) == x); else HPX_TEST(bool(b[k]) == bool(prev[k])); b[j] = prev[j]; } b.flip(); // bool(b[i]) = bool(b[j]) for (i = 0; i < b.size(); ++i) { b[i] = prev[i]; for (j = 0; j < b.size(); ++j) { if (i == j) HPX_TEST(bool(b[j]) == bool(prev[j])); else HPX_TEST(bool(b[j]) == !bool(prev[j])); } b[i] = !prev[i]; } // bool(b[i]).flip() for (i = 0; i < b.size(); ++i) { b[i].flip(); for (j = 0; j < b.size(); ++j) { if (i == j) HPX_TEST(bool(b[j]) == bool(prev[j])); else HPX_TEST(bool(b[j]) == !bool(prev[j])); } b[i].flip(); } } //=========================================================================== // bitwise operators // bitwise and assignment // PRE: b.size() == rhs.size() static void and_assignment(Bitset const& b, Bitset const& rhs) { Bitset lhs(b); Bitset prev(lhs); lhs &= rhs; // Clears each bit in lhs for which the corresponding bit in rhs is // clear, and leaves all other bits unchanged. for (std::size_t i = 0; i < lhs.size(); ++i) if (rhs[i] == 0) HPX_TEST(bool(lhs[i]) == 0); else HPX_TEST(bool(lhs[i]) == bool(bool(prev[i]))); } // PRE: b.size() == rhs.size() static void or_assignment(Bitset const& b, Bitset const& rhs) { Bitset lhs(b); Bitset prev(lhs); lhs |= rhs; // Sets each bit in lhs for which the corresponding bit in rhs is set, and // leaves all other bits unchanged. for (std::size_t i = 0; i < lhs.size(); ++i) if (rhs[i] == 1) HPX_TEST(bool(lhs[i]) == 1); else HPX_TEST(bool(lhs[i]) == bool(prev[i])); } // PRE: b.size() == rhs.size() static void xor_assignment(Bitset const& b, Bitset const& rhs) { Bitset lhs(b); Bitset prev(lhs); lhs ^= rhs; // Flips each bit in lhs for which the corresponding bit in rhs is set, // and leaves all other bits unchanged. for (std::size_t i = 0; i < lhs.size(); ++i) if (rhs[i] == 1) HPX_TEST(bool(lhs[i]) == !bool(prev[i])); else HPX_TEST(bool(lhs[i]) == bool(prev[i])); } // PRE: b.size() == rhs.size() static void sub_assignment(Bitset const& b, Bitset const& rhs) { Bitset lhs(b); Bitset prev(lhs); lhs -= rhs; // Resets each bit in lhs for which the corresponding bit in rhs is set, // and leaves all other bits unchanged. for (std::size_t i = 0; i < lhs.size(); ++i) if (rhs[i] == 1) HPX_TEST(bool(lhs[i]) == 0); else HPX_TEST(bool(lhs[i]) == bool(prev[i])); } static void shift_left_assignment(Bitset const& b, std::size_t pos) { Bitset lhs(b); Bitset prev(lhs); lhs <<= pos; // Replaces each bit at position i in lhs with the following value: // - If i < pos, the new value is zero // - If i >= pos, the new value is the previous value of the bit at // position i - pos for (std::size_t i = 0; i < lhs.size(); ++i) if (i < pos) HPX_TEST(bool(lhs[i]) == 0); else HPX_TEST(bool(lhs[i]) == bool(prev[i - pos])); } static void shift_right_assignment(Bitset const& b, std::size_t pos) { Bitset lhs(b); Bitset prev(lhs); lhs >>= pos; // Replaces each bit at position i in lhs with the following value: // - If pos >= N - i, the new value is zero // - If pos < N - i, the new value is the previous value of the bit at // position i + pos std::size_t N = lhs.size(); for (std::size_t i = 0; i < N; ++i) if (pos >= N - i) HPX_TEST(bool(lhs[i]) == 0); else HPX_TEST(bool(lhs[i]) == bool(prev[i + pos])); } static void set_all(Bitset const& b) { Bitset lhs(b); lhs.set(); for (std::size_t i = 0; i < lhs.size(); ++i) HPX_TEST(bool(lhs[i]) == 1); } static void set_one(Bitset const& b, std::size_t pos, bool value) { Bitset lhs(b); std::size_t N = lhs.size(); if (pos < N) { Bitset prev(lhs); // Stores a new value in the bit at position pos in lhs. lhs.set(pos, value); HPX_TEST(bool(lhs[pos]) == value); // All other values of lhs remain unchanged for (std::size_t i = 0; i < N; ++i) if (i != pos) HPX_TEST(bool(lhs[i]) == bool(prev[i])); } else { // Not in range, doesn't satisfy precondition. } } static void set_segment( Bitset const& b, std::size_t pos, std::size_t len, bool value) { Bitset lhs(b); std::size_t N = lhs.size(); Bitset prev(lhs); lhs.set(pos, len, value); for (std::size_t i = 0; i < N; ++i) { if (i < pos || i >= pos + len) HPX_TEST(bool(lhs[i]) == bool(prev[i])); else HPX_TEST(bool(lhs[i]) == value); } } static void reset_all(Bitset const& b) { Bitset lhs(b); // Resets all bits in lhs lhs.reset(); for (std::size_t i = 0; i < lhs.size(); ++i) HPX_TEST(bool(lhs[i]) == 0); } static void reset_one(Bitset const& b, std::size_t pos) { Bitset lhs(b); std::size_t N = lhs.size(); if (pos < N) { Bitset prev(lhs); lhs.reset(pos); // Resets the bit at position pos in lhs HPX_TEST(bool(lhs[pos]) == 0); // All other values of lhs remain unchanged for (std::size_t i = 0; i < N; ++i) if (i != pos) HPX_TEST(bool(lhs[i]) == bool(prev[i])); } else { // Not in range, doesn't satisfy precondition. } } static void reset_segment(Bitset const& b, std::size_t pos, std::size_t len) { Bitset lhs(b); std::size_t N = lhs.size(); Bitset prev(lhs); lhs.reset(pos, len); for (std::size_t i = 0; i < N; ++i) { if (i < pos || i >= pos + len) HPX_TEST(bool(lhs[i]) == bool(prev[i])); else HPX_TEST(!bool(lhs[i])); } } static void operator_flip(Bitset const& b) { Bitset lhs(b); Bitset x(lhs); HPX_TEST(~lhs == x.flip()); } static void flip_all(Bitset const& b) { Bitset lhs(b); std::size_t N = lhs.size(); Bitset prev(lhs); lhs.flip(); // Toggles all the bits in lhs for (std::size_t i = 0; i < N; ++i) HPX_TEST(bool(lhs[i]) == !bool(prev[i])); } static void flip_one(Bitset const& b, std::size_t pos) { Bitset lhs(b); std::size_t N = lhs.size(); if (pos < N) { Bitset prev(lhs); lhs.flip(pos); // Toggles the bit at position pos in lhs HPX_TEST(bool(lhs[pos]) == !bool(prev[pos])); // All other values of lhs remain unchanged for (std::size_t i = 0; i < N; ++i) if (i != pos) HPX_TEST(bool(lhs[i]) == bool(prev[i])); } else { // Not in range, doesn't satisfy precondition. } } static void flip_segment(Bitset const& b, std::size_t pos, std::size_t len) { Bitset lhs(b); std::size_t N = lhs.size(); Bitset prev(lhs); lhs.flip(pos, len); for (std::size_t i = 0; i < N; ++i) { if (i < pos || i >= pos + len) HPX_TEST(bool(lhs[i]) == bool(prev[i])); else HPX_TEST(bool(lhs[i]) != bool(prev[i])); } } // empty static void empty(Bitset const& b) { HPX_TEST(b.empty() == (b.size() == 0)); } // to_ulong() static void to_ulong(Bitset const& lhs) { typedef unsigned long result_type; std::size_t n = std::numeric_limits<result_type>::digits; std::size_t sz = lhs.size(); bool will_overflow = false; for (std::size_t i = n; i < sz; ++i) { if (lhs.test(i) != 0) { will_overflow = true; break; } } if (will_overflow) { try { (void) lhs.to_ulong(); HPX_TEST(false); // It should have thrown an exception } catch (hpx::exception& ex) { // Good! HPX_TEST(ex.get_error() == hpx::error::out_of_range); } catch (...) { HPX_TEST(false); // threw the wrong exception } } else { result_type num = lhs.to_ulong(); // Be sure the number is right if (sz == 0) HPX_TEST(num == 0); else { for (std::size_t i = 0; i < sz; ++i) HPX_TEST(bool(lhs[i]) == (i < n ? nth_bit(num, i) : 0)); } } } // to_string() static void to_string(Bitset const& b) { std::string str; hpx::detail::to_string(b, str); HPX_TEST(str.size() == b.size()); for (std::size_t i = 0; i < b.size(); ++i) HPX_TEST(str[b.size() - 1 - i] == (b.test(i) ? '1' : '0')); } static void count(Bitset const& b) { std::size_t c = b.count(); std::size_t actual = 0; for (std::size_t i = 0; i < b.size(); ++i) if (bool(b[i])) ++actual; HPX_TEST(c == actual); } static void size(Bitset const& b) { HPX_TEST(Bitset(b).set().count() == b.size()); } static void capacity_test_one(Bitset const& lhs) { //empty bitset Bitset b(lhs); HPX_TEST(b.capacity() == 0); } static void capacity_test_two(Bitset const& lhs) { //bitset constructed with size "100" Bitset b(lhs); HPX_TEST(b.capacity() >= 100); b.resize(200); HPX_TEST(b.capacity() >= 200); } static void reserve_test_one(Bitset const& lhs) { //empty bitset Bitset b(lhs); b.reserve(16); HPX_TEST(b.capacity() >= 16); } static void reserve_test_two(Bitset const& lhs) { //bitset constructed with size "100" Bitset b(lhs); HPX_TEST(b.capacity() >= 100); b.reserve(60); HPX_TEST(b.size() == 100); HPX_TEST(b.capacity() >= 100); b.reserve(160); HPX_TEST(b.size() == 100); HPX_TEST(b.capacity() >= 160); } static void shrink_to_fit_test_one(Bitset const& lhs) { //empty bitset Bitset b(lhs); b.shrink_to_fit(); HPX_TEST(b.size() == 0); HPX_TEST(b.capacity() == 0); } static void shrink_to_fit_test_two(Bitset const& lhs) { //bitset constructed with size "100" Bitset b(lhs); b.shrink_to_fit(); HPX_TEST(b.capacity() >= 100); HPX_TEST(b.size() == 100); b.reserve(200); HPX_TEST(b.capacity() >= 200); HPX_TEST(b.size() == 100); b.shrink_to_fit(); HPX_TEST(b.capacity() < 200); HPX_TEST(b.size() == 100); } static void all(Bitset const& b) { HPX_TEST(b.all() == (b.count() == b.size())); bool result = true; for (std::size_t i = 0; i < b.size(); ++i) if (!bool(b[i])) { result = false; break; } HPX_TEST(b.all() == result); } static void any(Bitset const& b) { HPX_TEST(b.any() == (b.count() != 0)); bool result = false; for (std::size_t i = 0; i < b.size(); ++i) if (bool(b[i])) { result = true; break; } HPX_TEST(b.any() == result); } static void none(Bitset const& b) { bool result = true; for (std::size_t i = 0; i < b.size(); ++i) { if (bool(b[i])) { result = false; break; } } HPX_TEST(b.none() == result); // sanity HPX_TEST(b.none() == !b.any()); HPX_TEST(b.none() == (b.count() == 0)); } static void subset(Bitset const& a, Bitset const& b) { HPX_TEST(a.size() == b.size()); // PRE bool is_subset = true; if (b.size()) { // could use b.any() but let's be safe for (std::size_t i = 0; i < a.size(); ++i) { if (a.test(i) && !b.test(i)) { is_subset = false; break; } } } else { // sanity HPX_TEST(a.count() == 0); HPX_TEST(a.any() == false); //is_subset = (a.any() == false); } HPX_TEST(a.is_subset_of(b) == is_subset); } static void proper_subset(Bitset const& a, Bitset const& b) { // PRE: a.size() == b.size() HPX_TEST(a.size() == b.size()); bool is_proper = false; if (b.size() != 0) { // check it's a subset subset(a, b); // is it proper? for (std::size_t i = 0; i < a.size(); ++i) { if (!a.test(i) && b.test(i)) { is_proper = true; // sanity HPX_TEST(a.count() < b.count()); HPX_TEST(b.any()); } } } HPX_TEST(a.is_proper_subset_of(b) == is_proper); if (is_proper) HPX_TEST(b.is_proper_subset_of(a) != is_proper); // antisymmetry } static void intersects(Bitset const& a, Bitset const& b) { bool have_intersection = false; typename Bitset::size_type m = a.size() < b.size() ? a.size() : b.size(); for (typename Bitset::size_type i = 0; i < m && !have_intersection; ++i) if (a[i] == true && bool(b[i]) == true) have_intersection = true; HPX_TEST(a.intersects(b) == have_intersection); // also check commutativity HPX_TEST(b.intersects(a) == have_intersection); } static void find_first(Bitset const& b) { // find first non-null bit, if any typename Bitset::size_type i = 0; while (i < b.size() && bool(b[i]) == 0) ++i; if (i == b.size()) HPX_TEST(b.find_first() == Bitset::npos); // not found; else { HPX_TEST(b.find_first() == i); HPX_TEST(b.test(i) == true); } } static void find_next(Bitset const& b, typename Bitset::size_type prev) { HPX_TEST(next_bit_on(b, prev) == b.find_next(prev)); } static void operator_equal(Bitset const& a, Bitset const& b) { if (a == b) { for (std::size_t i = 0; i < a.size(); ++i) HPX_TEST(a[i] == bool(b[i])); } else { if (a.size() == b.size()) { bool diff = false; for (std::size_t i = 0; i < a.size(); ++i) if (a[i] != bool(b[i])) { diff = true; break; } HPX_TEST(diff); } } } static void operator_not_equal(Bitset const& a, Bitset const& b) { if (a != b) { if (a.size() == b.size()) { bool diff = false; for (std::size_t i = 0; i < a.size(); ++i) if (a[i] != bool(b[i])) { diff = true; break; } HPX_TEST(diff); } } else { for (std::size_t i = 0; i < a.size(); ++i) HPX_TEST(a[i] == bool(b[i])); } } static bool less_than(Bitset const& a, Bitset const& b) { typedef typename Bitset::size_type size_type; size_type asize(a.size()); size_type bsize(b.size()); if (!bsize) { return false; } else if (!asize) { return true; } else { // Compare from most significant to least. size_type leqsize((std::min)(asize, bsize)); size_type i; for (i = 0; i < leqsize; ++i, --asize, --bsize) { size_type i = asize - 1; size_type j = bsize - 1; if (a[i] < bool(b[j])) return true; else if (a[i] > bool(b[j])) return false; // if (a[i] = bool(b[j])) skip to next } return (a.size() < b.size()); } } static typename Bitset::size_type next_bit_on( Bitset const& b, typename Bitset::size_type prev) { // helper function for find_next() // if (b.none() == true || prev == Bitset::npos) return Bitset::npos; ++prev; if (prev >= b.size()) return Bitset::npos; typename Bitset::size_type i = prev; while (i < b.size() && bool(b[i]) == 0) ++i; return i == b.size() ? Bitset::npos : i; } static void operator_less_than(Bitset const& a, Bitset const& b) { if (less_than(a, b)) HPX_TEST(a < b); else HPX_TEST(!(a < b)); } static void operator_greater_than(Bitset const& a, Bitset const& b) { if (less_than(a, b) || a == b) HPX_TEST(!(a > b)); else HPX_TEST(a > b); } static void operator_less_than_eq(Bitset const& a, Bitset const& b) { if (less_than(a, b) || a == b) HPX_TEST(a <= b); else HPX_TEST(!(a <= b)); } static void operator_greater_than_eq(Bitset const& a, Bitset const& b) { if (less_than(a, b)) HPX_TEST(!(a >= b)); else HPX_TEST(a >= b); } static void test_bit(Bitset const& b, std::size_t pos) { Bitset lhs(b); std::size_t N = lhs.size(); if (pos < N) { HPX_TEST(lhs.test(pos) == bool(lhs[pos])); } else { // Not in range, doesn't satisfy precondition. } } static void test_set_bit(Bitset const& b, std::size_t pos, bool value) { Bitset lhs(b); std::size_t N = lhs.size(); if (pos < N) { Bitset prev(lhs); // Stores a new value in the bit at position pos in lhs. HPX_TEST(lhs.test_set(pos, value) == bool(prev[pos])); HPX_TEST(bool(lhs[pos]) == value); // All other values of lhs remain unchanged for (std::size_t i = 0; i < N; ++i) if (i != pos) HPX_TEST(bool(lhs[i]) == bool(prev[i])); } else { // Not in range, doesn't satisfy precondition. } } static void operator_shift_left(Bitset const& lhs, std::size_t pos) { Bitset x(lhs); HPX_TEST((lhs << pos) == (x <<= pos)); } static void operator_shift_right(Bitset const& lhs, std::size_t pos) { Bitset x(lhs); HPX_TEST((lhs >> pos) == (x >>= pos)); } // operator| static void operator_or(Bitset const& lhs, Bitset const& rhs) { Bitset x(lhs); HPX_TEST((lhs | rhs) == (x |= rhs)); } // operator& static void operator_and(Bitset const& lhs, Bitset const& rhs) { Bitset x(lhs); HPX_TEST((lhs & rhs) == (x &= rhs)); } // operator^ static void operator_xor(Bitset const& lhs, Bitset const& rhs) { Bitset x(lhs); HPX_TEST((lhs ^ rhs) == (x ^= rhs)); } // operator- static void operator_sub(Bitset const& lhs, Bitset const& rhs) { Bitset x(lhs); HPX_TEST((lhs - rhs) == (x -= rhs)); } //------------------------------------------------------------------------------ // i/O TESTS // The following tests assume the results of extraction (i.e.: contents, // state and width of is, contents of b) only depend on input (the string // str). In other words, they don't consider "unexpected" errors such as // stream corruption or out of memory. The reason is simple: if e.g. the // stream buffer throws, the stream layer may eat the exception and // transform it into a badbit. But we can't trust the stream state here, // because one of the things that we want to test is exactly whether it // is set correctly. Similarly for insertion. // // To provide for these cases would require that the test functions know // in advance whether the stream buffer and/or allocations will fail, and // when; that is, we should write both a special allocator and a special // stream buffer capable of throwing "on demand" and pass them here. // Seems overkill for these kinds of unit tests. //------------------------------------------------------------------------- // operator<<( [basic_]ostream, template <typename Stream> static void stream_inserter( Bitset const& b, Stream& s, char const* file_name) { typedef typename Stream::char_type char_type; typedef std::basic_string<char_type> string_type; typedef std::basic_ifstream<char_type> corresponding_input_stream_type; std::ios::iostate except = s.exceptions(); typedef typename Bitset::size_type size_type; std::streamsize w = s.width(); char_type fill_char = s.fill(); std::ios::iostate oldstate = s.rdstate(); bool stream_was_good = s.good(); bool did_throw = false; try { s << b; } catch (std::ios_base::failure const&) { HPX_TEST((except & s.rdstate()) != 0); did_throw = true; } catch (...) { did_throw = true; } HPX_TEST(did_throw || !stream_was_good || (s.width() == 0)); if (!stream_was_good) { HPX_TEST(s.good() == false); // this should actually be oldstate == s.rdstate() // but some implementations add badbit in the // sentry constructor // HPX_TEST((oldstate & s.rdstate()) == oldstate); HPX_TEST(s.width() == w); } else { if (!did_throw) HPX_TEST(s.width() == 0); // This test require that os be an output _and_ input stream. // Of course dynamic_bitset's operator << doesn't require that. size_type total_len = w <= 0 || static_cast<size_type>(w) < b.size() ? b.size() : static_cast<size_type>(w); string_type const padding(total_len - b.size(), fill_char); string_type expected; hpx::detail::to_string(b, expected); if ((s.flags() & std::ios::adjustfield) != std::ios::left) expected = padding + expected; else expected = expected + padding; HPX_ASSERT(expected.length() == total_len); // close, and reopen the file stream to verify contents s.close(); corresponding_input_stream_type is(file_name); string_type contents; std::getline(is, contents, char_type()); HPX_TEST(contents == expected); } } // operator>>( [basic_]istream template <typename Stream, typename String> static void stream_extractor(Bitset& b, Stream& is, String& str) { // save necessary info then do extraction // std::streamsize const w = is.width(); Bitset a_copy(b); bool stream_was_good = is.good(); bool did_throw = false; std::ios::iostate const except = is.exceptions(); bool has_stream_exceptions = true; try { is >> b; } catch (std::ios::failure const&) { did_throw = true; } // postconditions HPX_TEST(except == is.exceptions()); // paranoid //------------------------------------------------------------------ // postconditions HPX_TEST(b.size() <= b.max_size()); if (w > 0) HPX_TEST(b.size() <= static_cast<typename Bitset::size_type>(w)); // throw if and only if required if (has_stream_exceptions) { bool const exceptional_state = has_flags(is, is.exceptions()); HPX_TEST(exceptional_state == did_throw); } typedef typename String::size_type size_type; typedef typename String::value_type Ch; size_type after_digits = 0; if (!stream_was_good) { HPX_TEST(has_flags(is, std::ios::failbit)); HPX_TEST(b == a_copy); HPX_TEST(is.width() == (did_throw ? w : 0)); } else { // stream was good(), parse the string; // it may contain three parts, all of which are optional // {spaces} {digits} {non-digits} // opt opt opt // // The values of b.max_size() and is.width() may lead to // ignore part of the digits, if any. size_type pos = 0; size_type len = str.length(); // {spaces} for (; pos < len && is_white_space(is, str[pos]); ++pos) { } size_type after_spaces = pos; // {digits} or part of them const typename Bitset::size_type max_digits = w > 0 && static_cast<typename Bitset::size_type>(w) < b.max_size() ? static_cast<typename Bitset::size_type>(w) : b.max_size(); for (; pos < len && (pos - after_spaces) < max_digits; ++pos) { if (!is_one_or_zero(is, str[pos])) break; } after_digits = pos; size_type num_digits = after_digits - after_spaces; // eofbit if ((after_digits == len && max_digits > num_digits)) HPX_TEST(has_flags(is, std::ios::eofbit)); else HPX_TEST(!has_flags(is, std::ios::eofbit)); // failbit <=> there are no digits, except for the library // issue explained below. // if (num_digits == 0) { if (after_digits == len && has_stream_exceptions && (is.exceptions() & std::ios::eofbit) != std::ios::goodbit) { // This is a special case related to library issue 195: // reaching eof when skipping whitespaces in the sentry ctor. // The resolution says the sentry constructor should set *both* // eofbit and failbit; but many implementations deliberately // set eofbit only. See for instance: // http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00086.html // HPX_TEST(did_throw); } else { HPX_TEST(has_flags(is, std::ios::failbit)); } } else HPX_TEST(!has_flags(is, std::ios::failbit)); if (num_digits == 0 && after_digits == len) { // The VC6 library has a bug/non-conformity in the sentry // constructor. It uses code like // // skip whitespaces... // int_type _C = rdbuf()->sgetc(); // while (!_Tr::eq_int_type(_Tr::eof(), _C) ... // // For an empty file the while statement is never "entered" // and the stream remains in good() state; thus the sentry // object gives "true" when converted to bool. This is worse // than the case above, because not only failbit is not set, // but no bit is set at all, end we end up clearing the // bitset though there's nothing in the file to be extracted. // Note that the dynamic_bitset docs say a sentry object is // constructed and then converted to bool, thus we rely on // what the underlying library does. // HPX_TEST(b == a_copy); } else { String sub = str.substr(after_spaces, num_digits); HPX_TEST(b == Bitset(sub)); } // check width HPX_TEST(is.width() == 0 || (after_digits == len && num_digits == 0 && did_throw)); } // clear the stream to allow further reading then // retrieve any remaining chars with a single getline() is.exceptions(std::ios::goodbit); is.clear(); String remainder; std::getline(is, remainder, Ch()); if (stream_was_good) HPX_TEST(remainder == str.substr(after_digits)); else HPX_TEST(remainder == str); } };
43,432
https://github.com/shreeca/BarcodeFoundry/blob/master/src/main/java/com/generator/RestController.java
Github Open Source
Open Source
MIT
2,020
BarcodeFoundry
shreeca
Java
Code
665
2,786
package com.generator; import com.google.gson.JsonObject; import com.google.zxing.BarcodeFormat; import com.google.zxing.EncodeHintType; import com.google.zxing.WriterException; import com.google.zxing.common.BitMatrix; import com.google.zxing.qrcode.QRCodeWriter; import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; import org.apache.tomcat.util.codec.binary.Base64; import org.krysalis.barcode4j.HumanReadablePlacement; import org.krysalis.barcode4j.impl.code128.Code128Bean; import org.krysalis.barcode4j.impl.code128.Code128Constants; import org.krysalis.barcode4j.output.bitmap.BitmapCanvasProvider; import org.krysalis.barcode4j.tools.UnitConv; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import javax.imageio.ImageIO; import javax.servlet.http.HttpSession; import java.awt.*; import java.awt.image.BufferedImage; import java.io.*; import java.security.SecureRandom; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.EnumMap; import java.util.Map; @org.springframework.web.bind.annotation.RestController @RequestMapping("/api") public class RestController { @Autowired private UserRepository userRepository; @Autowired private UsageRepository usageRepository; @RequestMapping("/generate") public String response(@RequestParam(defaultValue = "") String token, @RequestParam(defaultValue = "") String text, @RequestParam(defaultValue = "Barcode") String type) throws IOException { DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date d = new Date(); String now = df.format(d); JsonObject response = new JsonObject(); response.addProperty("status", "failed"); response.addProperty("status_code", "SC00"); response.addProperty("status_message", "Unknown error occurred"); if (token.equals("")) { response.addProperty("status", "failed"); response.addProperty("status_code", "SC01"); response.addProperty("status_message", "No token provided"); return response.toString(); } User user = userRepository.findByToken(token); Usage usage = new Usage(); usage.setDatetime(now); if (user != null) { Integer userId = user.getId(); usage.setUser_id(userId); if (text.equals("")) { response.addProperty("status", "failed"); response.addProperty("status_code", "SC03"); response.addProperty("status_message", "No text provided"); return response.toString(); } usage.setText(text); usage.setFormat("Base64"); if (type.equals("Barcode")) { usage.setType(type); Code128Bean barcode128Bean = new Code128Bean(); barcode128Bean.setCodeset(Code128Constants.CODESET_B); final int dpi = 100; barcode128Bean.setBarHeight(15.0); barcode128Bean.setFontSize(8); barcode128Bean.setQuietZone(5.0); barcode128Bean.doQuietZone(true); barcode128Bean.setModuleWidth(UnitConv.in2mm(3.2f / dpi)); barcode128Bean.setMsgPosition(HumanReadablePlacement.HRP_BOTTOM); File outputFile = new File("target/classes/static/" + "barcode.png"); outputFile.createNewFile(); OutputStream out = new FileOutputStream(outputFile); try { BitmapCanvasProvider canvasProvider = new BitmapCanvasProvider( out, "image/x-png", dpi, BufferedImage.TYPE_BYTE_BINARY, false, 0); barcode128Bean.generateBarcode(canvasProvider, text); canvasProvider.finish(); String encodeString = encodeFileToBase64Binary(outputFile); usage.setCode(encodeString); usageRepository.save(usage); response.addProperty("status", "success"); response.addProperty("status_code", "SC04"); response.addProperty("status_message", "Barcode successfully created"); response.addProperty("text", text); response.addProperty("code_type", type); response.addProperty("output_format", "Base64"); response.addProperty("code", encodeString); return response.toString(); } catch (FileNotFoundException e) { System.out.println("Exception: " + e.toString()); } catch (RuntimeException e) { System.out.println("Exception: " + e.toString()); } finally { out.close(); } }else if (type.equals("QRCode")) { usage.setType(type); String encodeString = this.qrCode(text); usage.setCode(encodeString); usageRepository.save(usage); response.addProperty("status", "success"); response.addProperty("status_code", "SC05"); response.addProperty("status_message", "QR Code successfully created"); response.addProperty("text", text); response.addProperty("code_type", type); response.addProperty("output_format", "Base64"); response.addProperty("code", encodeString); return response.toString(); }else { response.addProperty("status", "failed"); response.addProperty("status_code", "SC06"); response.addProperty("status_message", "Invalid type"); return response.toString(); } }else { response.addProperty("status", "failed"); response.addProperty("status_code", "SC02"); response.addProperty("status_message", "Invalid token"); return response.toString(); } response.addProperty("status", "failed"); response.addProperty("status_code", "SC07"); response.addProperty("status_message", "Unknown error occurred"); return response.toString(); } private String qrCode(String value) throws IOException { String myCodeText = value.trim(); int size = 250; File myFile = new File("target/classes/static/" + "qrcode.png"); myFile.createNewFile(); try { Map<EncodeHintType, Object> hintMap = new EnumMap<>(EncodeHintType.class); hintMap.put(EncodeHintType.CHARACTER_SET, "UTF-8"); hintMap.put(EncodeHintType.MARGIN, 2); /* default = 4 */ hintMap.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L); QRCodeWriter qrCodeWriter = new QRCodeWriter(); BitMatrix byteMatrix = qrCodeWriter.encode(myCodeText, BarcodeFormat.QR_CODE, size, size, hintMap); int width = byteMatrix.getWidth(); BufferedImage image = new BufferedImage(width, width, BufferedImage.TYPE_INT_RGB); image.createGraphics(); Graphics2D graphics = (Graphics2D) image.getGraphics(); graphics.setColor(Color.WHITE); graphics.fillRect(0, 0, width, width); graphics.setColor(Color.BLACK); for (int i = 0; i < width; i++) { for (int j = 0; j < width; j++) { if (byteMatrix.get(i, j)) { graphics.fillRect(i, j, 1, 1); } } } ImageIO.write(image, "png", myFile); String encodeString = encodeFileToBase64Binary(myFile); return encodeString; } catch (WriterException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (RuntimeException e) { System.out.println("Exception: " + e.toString()); } System.out.println("\n\nYou have successfully created QR Code."); return null; } private static String encodeFileToBase64Binary(File file){ String encodedfile = null; try { FileInputStream fileInputStreamReader = new FileInputStream(file); byte[] bytes = new byte[(int)file.length()]; fileInputStreamReader.read(bytes); encodedfile = new String(Base64.encodeBase64(bytes), "UTF-8"); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return encodedfile; } @RequestMapping("/analyse") public String apiAnalyzer( @RequestParam(defaultValue = "5") String testLimit, @RequestParam(defaultValue = "Barcode") String codeType, @RequestParam(defaultValue = "6") String textLength, HttpSession session) throws IOException { String email = (String) session.getAttribute("loggedInUser"); if (email != null && email.equals("ea")) { long startTime = System.currentTimeMillis(); for (int count = 1; count <= Integer.parseInt(testLimit); count++) { this.response("WMWZV81DK3LW1LNVEZSZMDYWHMCA9K", this.randomString(Integer.parseInt(textLength)), codeType); } long stopTime = System.currentTimeMillis(); long elapsedTime = stopTime - startTime; //System.out.println(elapsedTime); return "Time taken to generate "+testLimit+" barcode is "+elapsedTime+"ms!"; }else{ return "Please login using Efficiency Analyser(ea) account <a href='/login'>here!</a>"; } } static final String stringScope = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*(){}|[]:,.<>0123456789"; static SecureRandom rand = new SecureRandom(); public String randomString( int len ){ StringBuilder sb = new StringBuilder( len ); for( int i = 0; i < len; i++ ) sb.append( stringScope.charAt( rand.nextInt(stringScope.length()) ) ); return sb.toString(); } }
1,913
https://github.com/SeanMelody/BurgerEater/blob/master/config/connection.js
Github Open Source
Open Source
MIT
null
BurgerEater
SeanMelody
JavaScript
Code
72
189
// Const for MySQL! const mysql = require("mysql"); //JawsDB for Heroku var connection; if (process.env.JAWSDB_URL) { connection = mysql.createConnection(process.env.JAWSDB_URL); } else { // Connect to the Database! connection = mysql.createConnection({ host: 'localhost', // My port port: 3306, // my username user: 'root', // my super secret password password: 'password', // Use the burgers_db database database: 'burgers_db', }); } // Make the connection for heroku. connection.connect(); // Always gotta module.export module.exports = connection;
8,468
https://github.com/Ikziriv/jual/blob/master/database/seeds/UserTableSeeder.php
Github Open Source
Open Source
MIT
null
jual
Ikziriv
PHP
Code
59
209
<?php use Illuminate\Database\Seeder; use Illuminate\Database\Eloquent\Model; use App\Models\Role; use App\Models\User; class UserTableSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { User::create([ 'username' => 'GreatAdmin', 'email' => 'admin@gmail.com', 'password' => bcrypt('admin'), 'role_id' => 1 ]); User::create([ 'username' => 'Customer', 'email' => 'customer@gmail.com', 'password' => bcrypt('customer'), 'role_id' => 2 ]); } }
38,720
https://github.com/MaxStrange/ArtieInfant/blob/master/Artie/internals/som/som.py
Github Open Source
Open Source
MIT
2,018
ArtieInfant
MaxStrange
Python
Code
2,411
5,670
""" Self-Organizing Map This module contains code for creating and running a self-organizing map. """ import itertools import math import numpy as np import random class SelfOrganizingMap: """ The main class for this module. This is the interface to use for creating and using a Self Organizing Map. The SOM is a 3D volume of neurons connected to a 1D vector of output nodes in a dense fashion. The connections come with an algorithm for changing them over time. - The inputs are shaped m x n x o. - The outputs are shaped p. - The weight matrix (the connections between input and output) are shaped p x mno. The typical use of this class is to create an instance with a particular input shape and an initial weight matrix, and then to activate with lateral inhibition to get an output vector (where each item in the vector has some amount of activation from each node on the input). Then the reinforcement algorithm increases the weights of each node within some euclidean distance of the most activated node. The point of the SOM is twofold; after a reinforcement regimen: 1) Similar inputs should produce similar outputs 2) Outputs will be constrained to those values that were reinforced, regardless of inputs. """ def __init__(self, shape, weights): """ Constructor. Note that the way this SOM works is different from typical ones, which are used for dimensionality reduction. This SOM is used instead for shaping a map that can be used as a function that takes an input of shape `shape` and outputs a value of shape weights.shape[0]. The typical usage is to set up the SOM by giving it a map shape and an output weight shape, then iterating through trials like this: nn = SelfOrganizingMap(shape, weights) for e in range(epochs): inp = x # somehow generate an input output = nn.activate(x) # x has shape nn.shape nn.reinforce(m=some_function_of_output, radius=some_threshold, lr=some_learning_rate) # Update the weights Note that `weights` is of shape (whatever, n_nodes_in_som), so that if we have a SOM that looks like this: n0 n1 n2 n3 n4 n5 We might have a weights matrix that looks like this: w_n0_o0 w_n1_o0 w_n2_o0 w_n0_o1 w_n1_o1 w_n2_o1 w_n0_o2 w_n1_o2 w_n2_o2 w_n0_o3 w_n1_o3 w_n2_o3 (where w_nx_oy is the weight of the connection from node x to output y). The number of columns must equal the number of nodes in the SOM. :param shape: The shape of the Map. Must be exactly three dimensions, and each axis must be positive. :param weights: The initial weight matrix. The weight matrix represents the strength of the connection between each neuron in the SOM and whatever output you will be feeding the activations into. In Artie, this is at least the Praat synthesizer module, but I've written this class to allow for anything, as long as it is fully connected (though if you want some sparseness, you can just supply zeros in whatever slot you want). The shape must be (whatever, n_nodes_in_som). """ # Sanitize the input args if len(shape) != 3: raise ValueError("Need a 3D shape, got shape {}".format(shape)) elif len(np.where(np.array(shape) <= 0)[0]) > 0: raise ValueError("Need a 3D shape with axes greater than or equal to 1, but got shape {}".format(shape)) if len(weights.shape) != 2: raise ValueError("Need a 2D weights matrix, got matrix of shape {}".format(weights.shape)) elif weights.shape[1] != np.prod(shape): raise ValueError("Need a 2D weights matrix of shape (whatever, {}), but got shape {}".format(np.prod(shape), weights.shape)) self.weights = weights self.shape = shape self.latest_activation = None self.latest_nninput = None def activate(self, nninput): """ Takes a `nninput`, which is a matrix of the same shape as self.shape, and applies it to the weights in the SOM so that each node's input value is multiplied by each of its weights to produce the activation matrix. :param nninput: The input to the network. Must be of same shape as self.shape. :returns: The result of multiplying each node's value by its weights, then summing across the weights matrix's rows - so the result is a vector of shape p, given a nninput of shape m x n x o and a weight matrix of shape p x mno. Vector element p_i is equal to SUM((a*b)[i, :]) where 'a' is reshaped nninput and b is reshaped weights. """ if nninput.shape != self.shape: raise ValueError("Shape of nninput must be {} but got {}".format(self.shape, nninput.shape)) self.latest_nninput = np.copy(nninput) a = np.reshape(nninput, (1, int(np.prod(nninput.shape)), 1)) a = a / np.sum(a) # normalize the activations b = self.weights[:, :, np.newaxis] activation = np.reshape(a * b, self.weights.shape) # broadcast into correct shape by concatenating vertically self.latest_activation = np.copy(activation) result = np.sum(activation, axis=1) return np.reshape(result, (len(result), 1)) def activate_with_lateral_inhibition(self, nninput): """ Same as `activate()`, but zeros the inputs of all but the most activated neuron and its immediate (non-diagonal) neighbors in `nninput`. :param nninput: The input to the network. Must be of same shape as self.shape. :returns: The result of multiplying each node's value by its weights, but zeroed on all nodes except the most activated and its immediate orthogonal neighbors. """ nninput = np.copy(nninput) # Get the x, y, and z index of the single most activated node indices_max = np.unravel_index(np.argmax(nninput), nninput.shape) # Find all the nodes that tie this one for most activated x, y, z = indices_max maxval = nninput[x, y, z] tol = 1E-6 tiemask = (nninput == maxval) & (nninput <= (maxval + tol)) & (nninput >= (maxval - tol)) maxidxs = np.where(tiemask) maxxs = [x for x in maxidxs[0]] maxys = [y for y in maxidxs[1]] maxzs = [z for z in maxidxs[2]] # Get all the nodes that neighbor these nodes orthogonally neighbors_and_max = [] for x, y, z in zip(maxxs, maxys, maxzs): idxs = [ (x, y - 1), (x, y + 1), (x - 1, y), (x + 1, y), (x, y, z - 1), (x, y, z + 1) ] neighbors_and_max.append((x, y, z)) for xyz in idxs: oob = False for i, x_y_or_z in enumerate(xyz): if x_y_or_z < 0 or x_y_or_z >= nninput.shape[i]: oob = True if not oob: neighbors_and_max.append(xyz) # Zero other activations activations_to_save = [nninput[idxs] for idxs in neighbors_and_max] nninput = np.zeros_like(nninput) for i, act in zip(neighbors_and_max, activations_to_save): nninput[i] = act activation = self.activate(nninput) return activation def reinforce(self, m, radius, lr=0.8, nninput=None): """ Modifies the weights of the most activated neuron and its neighbors within the euclidean distance less than or equal to `radius`. Formally, W_p' = { W_p + lr(m - W_p) if sqrt( (X_p - X_q)^2 + (Y_p - Y_q)^2 + (Z_p - Z_q)^2 ) <= radius { W_p Algorithm is this: - Find which neuron is the most active in nninput. - Get all nodes which are within radius of that node in nninput. - Calculate which columns these nodes are in the weight matrix. - Increase the columns' values for each row by lr * m - previous value. :param m: A vector of same length as the output of this SOM. This parameter modulates the change in the weights of reinforced neurons. Specifically, if lr=1.0, a reinforcement event changes the weights of the most activated neurons to be equal to this value. :param radius: The radius around the most active neuron within which the reinforcement will take place. :param lr: Learning rate. Must be in interval (0, 1.0]. :param nninput: The SOM input to use to determine which node was the most active. If None, will use the latest one. :returns: None. Modifies the internal weights of the network. """ if nninput is None: nninput = self.latest_nninput if len(m) != self.weights.shape[0]: raise ValueError("m is length {} but should be of length {}".format(len(m), self.weights.shape[0])) if nninput is None: raise ValueError("nninput must be specified if the SOM does not have a latest_nninput") if nninput.shape != self.shape: raise ValueError("nninput is of shape {} but should be {}".format(nninput.shape, self.shape)) if lr <= 0.0: raise ValueError("lr is {}, but must be 0 < lr <= 1.0".format(lr)) if lr > 1.0: raise ValueError("lr is {}, but must be 0 < lr <= 1.0".format(lr)) m = np.array(m) # Get the x, y, and z index of the maximum value in the input x0, y0, z0 = np.unravel_index(np.argmax(nninput), nninput.shape) # Get the unrolled index - the index of the node's column in the weights matrix npercol = nninput.shape[0] nperrow = nninput.shape[1] nperlayer = nperrow * npercol nodeidx = (nperlayer * z0) + (nperrow * x0) + y0 ns = [] # Now collect each node that is within radius of the input # (this will also gather up the target node itself, since its dist to itself is 0) for x1 in range(nninput.shape[0]): for y1 in range(nninput.shape[1]): for z1 in range(nninput.shape[2]): dist = math.sqrt((x0 - x1)**2 + (y0 - y1)**2 + (z0 - z1)**2) if dist <= radius: idx = (nperlayer * z1) + (nperrow * x1) + y1 ns.append(idx) for n in ns: self.weights[:, n] += lr * (m - self.weights[:, n]) def _get_avg_output(nn, nactivations, inputdim, outputdim, nninput=None): outputs = np.zeros(shape=(nactivations, outputdim)) for i in range(nactivations): if nninput is None: nninput = np.random.sample(size=(inputdim, inputdim, inputdim)) outvect = nn.activate_with_lateral_inhibition(nninput) outvect = np.reshape(outvect, (outputdim,)) outputs[i, :] = outvect[:] avg = np.mean(outputs, axis=0) return avg def _reinforce(nn, tol, inputdim, target, radius, lr, nninput=None): nactivations_needed = 0 while True: nactivations_needed += 1 if nninput is None: nninput = np.random.sample(size=(inputdim, inputdim, inputdim)) outvect = nn.activate_with_lateral_inhibition(nninput) if np.allclose(outvect, target, rtol=0.0, atol=tol): nn.reinforce(target, radius, lr) return nactivations_needed if nactivations_needed > 50: return 50 def _plot_results(average_values, lengths, average_weights, target): import matplotlib.pyplot as plt plt.subplot(3, 1, 1) plt.title("Average Output Over Time") plt.ylabel("Average Output [0]") plt.plot(average_values) plt.plot([target[0] for _ in average_values], color='orange', linestyle='--') plt.subplot(3, 1, 2) plt.title("Number of Activations Needed to Get Result") plt.ylabel("Number of Activations Required") plt.plot(lengths) plt.plot([1.0 for _ in lengths], color='orange', linestyle='--') plt.subplot(3, 1, 3) plt.title("Average Value of Weights in SOM") plt.ylabel("Average Weight Value") plt.plot(average_weights) plt.show() def self_test(inputdim=10, outputdim=1, target=0.4, tolstart=0.5, tolend=0.1, nepochs=10, radius=1.0, lr=0.8): """ This method tests the functionality of the SOM. Specifically, it does the following: 1. Initialize a cube SOM of inputdim ** 3, outputdim=outputdim. 2. Activate the SOM with random uniform activations drawn from [0, 1) and average the output vector over 100 activations. 3. Plot this value. 4. Activate with random input until the output is within tolerance of target. 5. Reinforce. 6. Activate 100 times again and plot. 7. Keep doing this for nepochs. We then plot two graphs. The top one is the average value of output vector item 0 over time. This value should converge on target. The bottom plot is the number of activations needed to attain an output value that was within tolerance of target, over time. This value should start high and converge on 1 over time, meaning that the number of activations to get the target should eventually become just 1. `target` must be either a scalar, in which case the target will be a vector of that value repeated outputdim times, or a vector, in which case it must be of length outputdim. """ from tqdm import tqdm if inputdim <= 0: raise ValueError("inputdim is {} but must be greater than 0".format(inputdim)) if outputdim <= 0: raise ValueError("outputdim is {} but must be greater than 0".format(outputdim)) if tolstart <= 0: raise ValueError("negative and zero tolerances are meaningless") if tolend <= 0: raise ValueError("negative and zero tolerances are meaningless") if nepochs <= 0: raise ValueError("nepochs is {} but must be greater than 0".format(nepochs)) try: _ = target[0] target = np.array(target) assert target.shape[0] == outputdim, "target must be scalar or vector which is same shape as outputdim" except TypeError: target = target * np.ones(outputdim) tolerances = np.linspace(tolstart, tolend, num=nepochs) ws = np.random.sample(size=(outputdim, inputdim ** 3)) nn = SelfOrganizingMap(shape=(inputdim, inputdim, inputdim), weights=ws) nactivations = 100 # Get the initial average output average_weights = [] average_values = [] avg = _get_avg_output(nn, nactivations, inputdim, outputdim) average_values.append(avg) average_weights.append(np.copy(np.mean(nn.weights))) # Now reinforce the network, checking how long it takes to do so, # then get average output again, and repeat for nepochs lengths = [] for i in tqdm(range(nepochs)): tol = tolerances[i] nacts = _reinforce(nn, tol, inputdim, target, radius, lr) avg = _get_avg_output(nn, nactivations, inputdim, outputdim) average_weights.append(np.copy(np.mean(nn.weights))) average_values.append(avg) lengths.append(nacts) _plot_results(average_values, lengths, average_weights, target) def self_test_two(target_a=0.1, target_b=0.9): """ Inputs two different input masks, A + G and B + G, where G is a gaussian noise matrix; chooses which one randomly with 50/50 probability. Reinforces for A => target_a and B => target_b. """ import matplotlib.pyplot as plt from tqdm import tqdm nninshape = (10, 10, 1) outshape = 1 weights = np.random.sample(size=(outshape, np.prod(nninshape))) nn = SelfOrganizingMap(nninshape, weights) # template A - a big plus sign templatea = np.zeros(shape=nninshape) half_r, half_c = int(round(nninshape[0]/2.0)), int(round(nninshape[1]/2.0)) templatea[:, half_c, :] = 1.0 templatea[half_r, :, :] = 1.0 templateb = np.zeros(shape=nninshape) maxcol = 4 assert maxcol >= 2 assert nninshape[1] > maxcol templateb[:, maxcol - 2, :] = 0.5 templateb[:, maxcol - 1, :] = 0.4 templateb[:, maxcol, :] = 0.6 # For some number of trials, draw a random template (A or B), then mutate it slightly and activate. # If we get close to A's target for A or B's target for B, reinforce. Otherwise ignore. # Afterwards, get the average values for each input. # Do this for some number of epochs. nepochs = 100 ntrials = 500 templates = (templatea, templateb) targets = ([target_a], [target_b]) averagesa = [] averagesb = [] sigmas = [0.5, 0.5] mus = [1.0, 0.5] for e in tqdm(range(nepochs)): for t in range(ntrials): # Choose which template, then get its noise idx = random.choice((0, 1)) template = templates[idx] mu = mus[idx] gaussian_noise = np.random.normal(mu, sigmas[idx], size=nninshape) # Create the input - constrain the noisy input to [0, 1] nninput = template + gaussian_noise nninput[nninput > 1.0] = 1.0 nninput[nninput < 0.0] = 0.0 # Activate the network output = nn.activate_with_lateral_inhibition(nninput) # Check if the result is worth reinforcing target = targets[idx] if np.allclose(output, target, atol=0.4): nn.reinforce(target, radius=1.0, lr=0.8) # if we reinforce, anneal the standard deviations a bit sigmas[idx] *= 0.8 # Activate the network a bunch to retrieve averages and log them for plotting avga = _get_avg_output(nn, nactivations=5, inputdim=nninshape, outputdim=outshape, nninput=templatea) avgb = _get_avg_output(nn, nactivations=5, inputdim=nninshape, outputdim=outshape, nninput=templateb) averagesa.append(avga) averagesb.append(avgb) plt.subplot(2, 1, 1) plt.title("Average Output Over Time For Template A") plt.ylabel("Average Output [0]") plt.plot(averagesa) plt.plot([target_a for _ in averagesa], color='orange', linestyle='--') plt.subplot(2, 1, 2) plt.title("Average Output Over Time For Template B") plt.ylabel("Average Output [0]") plt.plot(averagesb) plt.plot([target_b for _ in averagesb], color='orange', linestyle='--') plt.show() if __name__ == "__main__": configdict = { 'inputdim': 10, 'outputdim': 1, 'target': 0.7, 'tolstart': 0.5, 'tolend': 0.02, 'nepochs': 500, 'radius': 1.0, 'lr': 0.8, } #print("Testing SOM with the following values:\n", configdict) #self_test(**configdict) self_test_two()
48,942
https://github.com/apache/hudi/blob/master/hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/table/action/rollback/TestMergeOnReadRollbackActionExecutor.java
Github Open Source
Open Source
CC0-1.0, MIT, JSON, Apache-2.0, LicenseRef-scancode-warranty-disclaimer
2,023
hudi
apache
Java
Code
1,183
6,045
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hudi.table.action.rollback; import org.apache.hudi.avro.model.HoodieRollbackPartitionMetadata; import org.apache.hudi.client.SparkRDDWriteClient; import org.apache.hudi.client.WriteStatus; import org.apache.hudi.common.fs.ConsistencyGuardConfig; import org.apache.hudi.common.model.FileSlice; import org.apache.hudi.common.model.HoodieCommitMetadata; import org.apache.hudi.common.model.HoodieFileGroup; import org.apache.hudi.common.model.HoodieLogFile; import org.apache.hudi.common.model.HoodieRecord; import org.apache.hudi.common.model.HoodieTableType; import org.apache.hudi.common.model.HoodieWriteStat; import org.apache.hudi.common.table.timeline.HoodieInstant; import org.apache.hudi.common.table.timeline.HoodieTimeline; import org.apache.hudi.common.table.timeline.versioning.TimelineLayoutVersion; import org.apache.hudi.common.table.view.FileSystemViewStorageConfig; import org.apache.hudi.common.table.view.FileSystemViewStorageType; import org.apache.hudi.common.table.view.SyncableFileSystemView; import org.apache.hudi.common.testutils.HoodieTestDataGenerator; import org.apache.hudi.common.util.StringUtils; import org.apache.hudi.config.HoodieCompactionConfig; import org.apache.hudi.config.HoodieIndexConfig; import org.apache.hudi.common.config.HoodieStorageConfig; import org.apache.hudi.config.HoodieWriteConfig; import org.apache.hudi.index.HoodieIndex; import org.apache.hudi.table.HoodieTable; import org.apache.hudi.table.marker.WriteMarkersFactory; import org.apache.hudi.testutils.Assertions; import org.apache.hudi.testutils.MetadataMergeWriteStatus; import org.apache.spark.api.java.JavaRDD; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; import static org.apache.hudi.common.testutils.HoodieTestDataGenerator.DEFAULT_FIRST_PARTITION_PATH; import static org.apache.hudi.common.testutils.HoodieTestDataGenerator.DEFAULT_SECOND_PARTITION_PATH; import static org.apache.hudi.common.testutils.HoodieTestDataGenerator.DEFAULT_THIRD_PARTITION_PATH; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; public class TestMergeOnReadRollbackActionExecutor extends HoodieClientRollbackTestBase { @Override protected HoodieTableType getTableType() { return HoodieTableType.MERGE_ON_READ; } @BeforeEach public void setUp() throws Exception { initPath(); initSparkContexts(); dataGen = new HoodieTestDataGenerator(new String[] {DEFAULT_FIRST_PARTITION_PATH, DEFAULT_SECOND_PARTITION_PATH}); initFileSystem(); initMetaClient(); } @AfterEach public void tearDown() throws Exception { cleanupResources(); } @ParameterizedTest @ValueSource(booleans = {false, true}) public void testMergeOnReadRollbackActionExecutor(boolean isUsingMarkers) throws IOException { //1. prepare data and assert data result List<FileSlice> firstPartitionCommit2FileSlices = new ArrayList<>(); List<FileSlice> secondPartitionCommit2FileSlices = new ArrayList<>(); HoodieWriteConfig cfg = getConfigBuilder().withRollbackUsingMarkers(isUsingMarkers).withAutoCommit(false).build(); twoUpsertCommitDataWithTwoPartitions(firstPartitionCommit2FileSlices, secondPartitionCommit2FileSlices, cfg, !isUsingMarkers); List<HoodieLogFile> firstPartitionCommit2LogFiles = new ArrayList<>(); List<HoodieLogFile> secondPartitionCommit2LogFiles = new ArrayList<>(); firstPartitionCommit2FileSlices.get(0).getLogFiles().collect(Collectors.toList()).forEach(logFile -> firstPartitionCommit2LogFiles.add(logFile)); assertEquals(1, firstPartitionCommit2LogFiles.size()); secondPartitionCommit2FileSlices.get(0).getLogFiles().collect(Collectors.toList()).forEach(logFile -> secondPartitionCommit2LogFiles.add(logFile)); assertEquals(1, secondPartitionCommit2LogFiles.size()); HoodieTable table = this.getHoodieTable(metaClient, cfg); //2. rollback HoodieInstant rollBackInstant = new HoodieInstant(isUsingMarkers, HoodieTimeline.DELTA_COMMIT_ACTION, "002"); BaseRollbackPlanActionExecutor mergeOnReadRollbackPlanActionExecutor = new BaseRollbackPlanActionExecutor(context, cfg, table, "003", rollBackInstant, false, cfg.shouldRollbackUsingMarkers(), false); mergeOnReadRollbackPlanActionExecutor.execute().get(); MergeOnReadRollbackActionExecutor mergeOnReadRollbackActionExecutor = new MergeOnReadRollbackActionExecutor( context, cfg, table, "003", rollBackInstant, true, false); //3. assert the rollback stat Map<String, HoodieRollbackPartitionMetadata> rollbackMetadata = mergeOnReadRollbackActionExecutor.execute().getPartitionMetadata(); assertEquals(2, rollbackMetadata.size()); for (Map.Entry<String, HoodieRollbackPartitionMetadata> entry : rollbackMetadata.entrySet()) { HoodieRollbackPartitionMetadata meta = entry.getValue(); assertEquals(0, meta.getFailedDeleteFiles().size()); assertEquals(0, meta.getSuccessDeleteFiles().size()); } //4. assert file group after rollback, and compare to the rollbackstat // assert the first partition data and log file size List<HoodieFileGroup> firstPartitionRollBack1FileGroups = table.getFileSystemView().getAllFileGroups(DEFAULT_FIRST_PARTITION_PATH).collect(Collectors.toList()); assertEquals(1, firstPartitionRollBack1FileGroups.size()); List<FileSlice> firstPartitionRollBack1FileSlices = firstPartitionRollBack1FileGroups.get(0).getAllFileSlices().collect(Collectors.toList()); assertEquals(1, firstPartitionRollBack1FileSlices.size()); FileSlice firstPartitionRollBack1FileSlice = firstPartitionRollBack1FileSlices.get(0); List<HoodieLogFile> firstPartitionRollBackLogFiles = firstPartitionRollBack1FileSlice.getLogFiles().collect(Collectors.toList()); assertEquals(2, firstPartitionRollBackLogFiles.size()); firstPartitionRollBackLogFiles.removeAll(firstPartitionCommit2LogFiles); assertEquals(1, firstPartitionRollBackLogFiles.size()); // assert the second partition data and log file size List<HoodieFileGroup> secondPartitionRollBack1FileGroups = table.getFileSystemView().getAllFileGroups(DEFAULT_SECOND_PARTITION_PATH).collect(Collectors.toList()); assertEquals(1, secondPartitionRollBack1FileGroups.size()); List<FileSlice> secondPartitionRollBack1FileSlices = secondPartitionRollBack1FileGroups.get(0).getAllFileSlices().collect(Collectors.toList()); assertEquals(1, secondPartitionRollBack1FileSlices.size()); FileSlice secondPartitionRollBack1FileSlice = secondPartitionRollBack1FileSlices.get(0); List<HoodieLogFile> secondPartitionRollBackLogFiles = secondPartitionRollBack1FileSlice.getLogFiles().collect(Collectors.toList()); assertEquals(2, secondPartitionRollBackLogFiles.size()); secondPartitionRollBackLogFiles.removeAll(secondPartitionCommit2LogFiles); assertEquals(1, secondPartitionRollBackLogFiles.size()); assertFalse(WriteMarkersFactory.get(cfg.getMarkersType(), table, "002").doesMarkerDirExist()); } @Test public void testMergeOnReadRestoreCompactionCommit() throws IOException { boolean isUsingMarkers = false; HoodieWriteConfig cfg = getConfigBuilder().withRollbackUsingMarkers(isUsingMarkers).withAutoCommit(false).build(); // 1. ingest data to partition 3. //just generate two partitions HoodieTestDataGenerator dataGenPartition3 = new HoodieTestDataGenerator(new String[]{DEFAULT_THIRD_PARTITION_PATH}); HoodieTestDataGenerator.writePartitionMetadataDeprecated(fs, new String[]{DEFAULT_THIRD_PARTITION_PATH}, basePath); SparkRDDWriteClient client = getHoodieWriteClient(cfg); /** * Write 1 (only inserts) */ String newCommitTime = "0000001"; client.startCommitWithTime(newCommitTime); List<HoodieRecord> records = dataGenPartition3.generateInsertsContainsAllPartitions(newCommitTime, 2); JavaRDD<HoodieRecord> writeRecords = jsc.parallelize(records, 1); JavaRDD<WriteStatus> statuses = client.upsert(writeRecords, newCommitTime); Assertions.assertNoWriteErrors(statuses.collect()); client.commit(newCommitTime, statuses); //2. Ingest inserts + upserts to partition 1 and 2. we will eventually rollback both these commits using restore flow. List<FileSlice> firstPartitionCommit2FileSlices = new ArrayList<>(); List<FileSlice> secondPartitionCommit2FileSlices = new ArrayList<>(); twoUpsertCommitDataWithTwoPartitions(firstPartitionCommit2FileSlices, secondPartitionCommit2FileSlices, cfg, !isUsingMarkers); List<HoodieLogFile> firstPartitionCommit2LogFiles = new ArrayList<>(); List<HoodieLogFile> secondPartitionCommit2LogFiles = new ArrayList<>(); firstPartitionCommit2FileSlices.get(0).getLogFiles().collect(Collectors.toList()).forEach(logFile -> firstPartitionCommit2LogFiles.add(logFile)); assertEquals(1, firstPartitionCommit2LogFiles.size()); secondPartitionCommit2FileSlices.get(0).getLogFiles().collect(Collectors.toList()).forEach(logFile -> secondPartitionCommit2LogFiles.add(logFile)); assertEquals(1, secondPartitionCommit2LogFiles.size()); HoodieTable table = this.getHoodieTable(metaClient, cfg); //3. rollback the update to partition1 and partition2 HoodieInstant rollBackInstant = new HoodieInstant(isUsingMarkers, HoodieTimeline.DELTA_COMMIT_ACTION, "002"); BaseRollbackPlanActionExecutor mergeOnReadRollbackPlanActionExecutor = new BaseRollbackPlanActionExecutor(context, cfg, table, "003", rollBackInstant, false, cfg.shouldRollbackUsingMarkers(), true); mergeOnReadRollbackPlanActionExecutor.execute().get(); MergeOnReadRollbackActionExecutor mergeOnReadRollbackActionExecutor = new MergeOnReadRollbackActionExecutor( context, cfg, table, "003", rollBackInstant, true, false); //3. assert the rollback stat Map<String, HoodieRollbackPartitionMetadata> rollbackMetadata = mergeOnReadRollbackActionExecutor.execute().getPartitionMetadata(); assertEquals(2, rollbackMetadata.size()); assertFalse(WriteMarkersFactory.get(cfg.getMarkersType(), table, "002").doesMarkerDirExist()); // rollback 001 as well. this time since its part of the restore, entire file slice should be deleted and not just log files (for partition1 and partition2) HoodieInstant rollBackInstant1 = new HoodieInstant(isUsingMarkers, HoodieTimeline.DELTA_COMMIT_ACTION, "001"); BaseRollbackPlanActionExecutor mergeOnReadRollbackPlanActionExecutor1 = new BaseRollbackPlanActionExecutor(context, cfg, table, "004", rollBackInstant1, false, cfg.shouldRollbackUsingMarkers(), true); mergeOnReadRollbackPlanActionExecutor1.execute().get(); MergeOnReadRollbackActionExecutor mergeOnReadRollbackActionExecutor1 = new MergeOnReadRollbackActionExecutor( context, cfg, table, "004", rollBackInstant1, true, false); mergeOnReadRollbackActionExecutor1.execute().getPartitionMetadata(); //assert there are no valid file groups in both partition1 and partition2 assertEquals(0, table.getFileSystemView().getAllFileGroups(DEFAULT_FIRST_PARTITION_PATH).count()); assertEquals(0, table.getFileSystemView().getAllFileGroups(DEFAULT_SECOND_PARTITION_PATH).count()); // and only 3rd partition should have valid file groups. assertTrue(table.getFileSystemView().getAllFileGroups(DEFAULT_THIRD_PARTITION_PATH).count() > 0); } @Test public void testRollbackForCanIndexLogFile() throws IOException { //1. prepare data and assert data result //just generate one partitions dataGen = new HoodieTestDataGenerator(new String[] {DEFAULT_FIRST_PARTITION_PATH}); HoodieWriteConfig cfg = HoodieWriteConfig.newBuilder().withPath(basePath).withSchema(HoodieTestDataGenerator.TRIP_EXAMPLE_SCHEMA) .withParallelism(2, 2).withBulkInsertParallelism(2).withFinalizeWriteParallelism(2).withDeleteParallelism(2) .withTimelineLayoutVersion(TimelineLayoutVersion.CURR_VERSION) .withWriteStatusClass(MetadataMergeWriteStatus.class) .withConsistencyGuardConfig(ConsistencyGuardConfig.newBuilder().withConsistencyCheckEnabled(true).build()) .withCompactionConfig(HoodieCompactionConfig.newBuilder().compactionSmallFileSize(1024 * 1024).build()) .withStorageConfig(HoodieStorageConfig.newBuilder().hfileMaxFileSize(1024 * 1024).parquetMaxFileSize(1024 * 1024).build()) .forTable("test-trip-table") .withIndexConfig(HoodieIndexConfig.newBuilder().withIndexType(HoodieIndex.IndexType.INMEMORY).build()) .withEmbeddedTimelineServerEnabled(true).withFileSystemViewConfig(FileSystemViewStorageConfig.newBuilder() .withEnableBackupForRemoteFileSystemView(false) // Fail test if problem connecting to timeline-server .withStorageType(FileSystemViewStorageType.EMBEDDED_KV_STORE).build()).withRollbackUsingMarkers(false).withAutoCommit(false).build(); //1. prepare data new HoodieTestDataGenerator().writePartitionMetadata(fs, new String[] {DEFAULT_FIRST_PARTITION_PATH}, basePath); SparkRDDWriteClient client = getHoodieWriteClient(cfg); // Write 1 (only inserts) String newCommitTime = "001"; client.startCommitWithTime(newCommitTime); List<HoodieRecord> records = dataGen.generateInsertsForPartition(newCommitTime, 2, DEFAULT_FIRST_PARTITION_PATH); JavaRDD<HoodieRecord> writeRecords = jsc.parallelize(records, 1); JavaRDD<WriteStatus> statuses = client.upsert(writeRecords, newCommitTime); org.apache.hudi.testutils.Assertions.assertNoWriteErrors(statuses.collect()); client.commit(newCommitTime, statuses); // check fileSlice HoodieTable table = this.getHoodieTable(metaClient, cfg); SyncableFileSystemView fsView = getFileSystemViewWithUnCommittedSlices(table.getMetaClient()); List<HoodieFileGroup> firstPartitionCommit2FileGroups = fsView.getAllFileGroups(DEFAULT_FIRST_PARTITION_PATH).collect(Collectors.toList()); assertEquals(1, firstPartitionCommit2FileGroups.size()); assertEquals(1, (int) firstPartitionCommit2FileGroups.get(0).getAllFileSlices().count()); assertFalse(firstPartitionCommit2FileGroups.get(0).getAllFileSlices().findFirst().get().getBaseFile().isPresent()); assertEquals(1, firstPartitionCommit2FileGroups.get(0).getAllFileSlices().findFirst().get().getLogFiles().count()); String generatedFileID = firstPartitionCommit2FileGroups.get(0).getFileGroupId().getFileId(); // check hoodieCommitMeta HoodieCommitMetadata commitMetadata = HoodieCommitMetadata.fromBytes( table.getMetaClient().getCommitTimeline() .getInstantDetails(new HoodieInstant(true, HoodieTimeline.DELTA_COMMIT_ACTION, "001")) .get(), HoodieCommitMetadata.class); List<HoodieWriteStat> firstPartitionWriteStat = commitMetadata.getPartitionToWriteStats().get(DEFAULT_FIRST_PARTITION_PATH); assertEquals(2, firstPartitionWriteStat.size()); // we have an empty writeStat for all partition assert firstPartitionWriteStat.stream().anyMatch(wStat -> StringUtils.isNullOrEmpty(wStat.getFileId())); // we have one non-empty writeStat which must contains update or insert assertEquals(1, firstPartitionWriteStat.stream().filter(wStat -> !StringUtils.isNullOrEmpty(wStat.getFileId())).count()); firstPartitionWriteStat.stream().filter(wStat -> !StringUtils.isNullOrEmpty(wStat.getFileId())).forEach(wStat -> { assert wStat.getNumInserts() > 0; }); // Write 2 (inserts) newCommitTime = "002"; client.startCommitWithTime(newCommitTime); List<HoodieRecord> updateRecords = Collections.singletonList(dataGen.generateUpdateRecord(records.get(0).getKey(), newCommitTime)); List<HoodieRecord> insertRecordsInSamePartition = dataGen.generateInsertsForPartition(newCommitTime, 2, DEFAULT_FIRST_PARTITION_PATH); List<HoodieRecord> insertRecordsInOtherPartition = dataGen.generateInsertsForPartition(newCommitTime, 2, DEFAULT_SECOND_PARTITION_PATH); List<HoodieRecord> recordsToBeWrite = Stream.concat(Stream.concat(updateRecords.stream(), insertRecordsInSamePartition.stream()), insertRecordsInOtherPartition.stream()) .collect(Collectors.toList()); writeRecords = jsc.parallelize(recordsToBeWrite, 1); statuses = client.upsert(writeRecords, newCommitTime); client.commit(newCommitTime, statuses); table = this.getHoodieTable(metaClient, cfg); commitMetadata = HoodieCommitMetadata.fromBytes( table.getMetaClient().getCommitTimeline() .getInstantDetails(new HoodieInstant(false, HoodieTimeline.DELTA_COMMIT_ACTION, newCommitTime)) .get(), HoodieCommitMetadata.class); assertTrue(commitMetadata.getPartitionToWriteStats().containsKey(DEFAULT_FIRST_PARTITION_PATH)); assertTrue(commitMetadata.getPartitionToWriteStats().containsKey(DEFAULT_SECOND_PARTITION_PATH)); List<HoodieWriteStat> hoodieWriteStatOptionList = commitMetadata.getPartitionToWriteStats().get(DEFAULT_FIRST_PARTITION_PATH); // Both update and insert record should enter same existing fileGroup due to small file handling assertEquals(1, hoodieWriteStatOptionList.size()); assertEquals(generatedFileID, hoodieWriteStatOptionList.get(0).getFileId()); // check insert and update numbers assertEquals(2, hoodieWriteStatOptionList.get(0).getNumInserts()); assertEquals(1, hoodieWriteStatOptionList.get(0).getNumUpdateWrites()); List<HoodieWriteStat> secondHoodieWriteStatOptionList = commitMetadata.getPartitionToWriteStats().get(DEFAULT_SECOND_PARTITION_PATH); // All insert should enter one fileGroup assertEquals(1, secondHoodieWriteStatOptionList.size()); String fileIdInPartitionTwo = secondHoodieWriteStatOptionList.get(0).getFileId(); assertEquals(2, hoodieWriteStatOptionList.get(0).getNumInserts()); // Rollback HoodieInstant rollBackInstant = new HoodieInstant(HoodieInstant.State.INFLIGHT, HoodieTimeline.DELTA_COMMIT_ACTION, "002"); BaseRollbackPlanActionExecutor mergeOnReadRollbackPlanActionExecutor = new BaseRollbackPlanActionExecutor(context, cfg, table, "003", rollBackInstant, false, cfg.shouldRollbackUsingMarkers(), false); mergeOnReadRollbackPlanActionExecutor.execute().get(); MergeOnReadRollbackActionExecutor mergeOnReadRollbackActionExecutor = new MergeOnReadRollbackActionExecutor( context, cfg, table, "003", rollBackInstant, true, false); //3. assert the rollback stat Map<String, HoodieRollbackPartitionMetadata> rollbackMetadata = mergeOnReadRollbackActionExecutor.execute().getPartitionMetadata(); assertEquals(2, rollbackMetadata.size()); //4. assert filegroup after rollback, and compare to the rollbackstat // assert the first partition data and log file size HoodieRollbackPartitionMetadata partitionMetadata = rollbackMetadata.get(DEFAULT_FIRST_PARTITION_PATH); assertTrue(partitionMetadata.getSuccessDeleteFiles().isEmpty()); assertTrue(partitionMetadata.getFailedDeleteFiles().isEmpty()); assertEquals(1, partitionMetadata.getRollbackLogFiles().size()); // assert the second partition data and log file size partitionMetadata = rollbackMetadata.get(DEFAULT_SECOND_PARTITION_PATH); assertEquals(1, partitionMetadata.getSuccessDeleteFiles().size()); assertTrue(partitionMetadata.getFailedDeleteFiles().isEmpty()); assertTrue(partitionMetadata.getRollbackLogFiles().isEmpty()); assertEquals(1, partitionMetadata.getSuccessDeleteFiles().size()); } /** * Test Cases for rolling back when there is no base file. */ @Test public void testRollbackWhenFirstCommitFail() { HoodieWriteConfig config = HoodieWriteConfig.newBuilder() .withRollbackUsingMarkers(false) .withPath(basePath).build(); try (SparkRDDWriteClient client = getHoodieWriteClient(config)) { client.startCommitWithTime("001"); client.insert(jsc.emptyRDD(), "001"); client.rollback("001"); } } }
5,873
https://github.com/naramski/ShareFile-Java/blob/master/ShareFileJavaSDK/src/com/citrix/sharefile/api/models/SFAddress.java
Github Open Source
Open Source
MIT
2,020
ShareFile-Java
naramski
Java
Code
215
714
// ------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // // Copyright (c) 2017 Citrix ShareFile. All rights reserved. // </auto-generated> // ------------------------------------------------------------------------------ package com.citrix.sharefile.api.models; import java.io.InputStream; import java.util.ArrayList; import java.net.URI; import java.util.Date; import java.util.Map; import java.util.HashMap; import com.google.gson.annotations.SerializedName; import com.citrix.sharefile.api.*; import com.citrix.sharefile.api.enumerations.*; import com.citrix.sharefile.api.models.*; public class SFAddress extends SFODataObject { @SerializedName("StreetAddress1") private String StreetAddress1; @SerializedName("StreetAddress2") private String StreetAddress2; @SerializedName("City") private String City; @SerializedName("StateOrProvince") private String StateOrProvince; @SerializedName("PostalCode") private String PostalCode; @SerializedName("Country") private String Country; @SerializedName("TaxAreaId") private String TaxAreaId; public String getStreetAddress1() { return this.StreetAddress1; } public void setStreetAddress1(String streetaddress1) { this.StreetAddress1 = streetaddress1; } public String getStreetAddress2() { return this.StreetAddress2; } public void setStreetAddress2(String streetaddress2) { this.StreetAddress2 = streetaddress2; } public String getCity() { return this.City; } public void setCity(String city) { this.City = city; } public String getStateOrProvince() { return this.StateOrProvince; } public void setStateOrProvince(String stateorprovince) { this.StateOrProvince = stateorprovince; } public String getPostalCode() { return this.PostalCode; } public void setPostalCode(String postalcode) { this.PostalCode = postalcode; } public String getCountry() { return this.Country; } public void setCountry(String country) { this.Country = country; } public String getTaxAreaId() { return this.TaxAreaId; } public void setTaxAreaId(String taxareaid) { this.TaxAreaId = taxareaid; } }
34,393
https://github.com/abikoraj/Company/blob/master/resources/views/front/page.blade.php
Github Open Source
Open Source
MIT
null
Company
abikoraj
PHP
Code
146
613
@extends('front.layout') @section('css') <style> .text-brand { color: #667EEA !important; } .otherheader { background: white; /* background: url('/img/cta.png'); */ background-position: center; background-size: auto 100%; } .nav-link { color: #667EEA !important; } .otherheader-center { background: rgba(0, 0, 0, 0.5); min-height: 200px; } .fa-bars { color: black !important; } </style> {!! $solution->css !!} @endsection @section('headerclass','otherheader') @section('header') {{-- header section --}} <div style="background: url('/img/cta.png');background-repeat: no-repeat;background-size: auto 100%;"> <div class="container p-5"> <div class="p-5 otherheader-center text-center"> <h1 class="pt-5 text-white font-weight-bold"> Solution / {{$solution->name}} </h1> </div> </div> </div> @endsection @section('content') <div class="pt-5 pb-5" style="background: rgba(26, 86, 125, 0.03);"> <div class="container"> <div class="row mt-5"> <div class="col-md-4"> <img src="/storage/{{$solution->image}}" class="w-100" /> </div> <div class="col-md-8"> <div class=""> <h1 class="font-weight-bold mt-0">{{$solution->name}}</h1> <p class="text-justify" style="font-weight: 600;"> {!! $solution->description !!} </p> <div class="mt-3 mb-3"> <button class="btn btn-primary pr-5 pl-5 quote" data-name="{{$solution->name}}"> Get a Quote </button> </div> {!! $solution->page !!} </div> </div> </div> </div> </div> @endsection @section('js') {!! $solution->js !!} @endsection
20,900
https://github.com/Xmader/ipfs-action/blob/master/node_modules/@pinata/sdk/src/commands/data/pinList/queryBuilder.js
Github Open Source
Open Source
MIT
2,021
ipfs-action
Xmader
JavaScript
Code
808
2,185
function validateAndReturnDate(dateToValidate) { let dateParsed = new Date(Date.parse(dateToValidate)); try { if (dateParsed.toISOString() === dateToValidate) { return dateToValidate; } throw new Error('dates must be in valid ISO_8601 format'); } catch (e) { throw new Error('dates must be in valid ISO_8601 format'); } } export default function queryBuilder(baseUrl, filters) { if (!baseUrl) { throw new Error('no baseUrl provided'); } // preset filter values let filterQuery = '?'; let metadataQuery = ''; if (filters) { // now we need to construct the actual URL based on the given filters provided if (filters.hashContains) { if (typeof filters.hashContains !== 'string') { throw new Error('hashContains value is not a string'); } filterQuery = filterQuery + `hashContains=${filters.hashContains}&`; } if (filters.pinStart) { filterQuery = filterQuery + `pinStart=${validateAndReturnDate(filters.pinStart)}&`; } if (filters.pinEnd) { filterQuery = filterQuery + `pinEnd=${validateAndReturnDate(filters.pinEnd)}&`; } if (filters.unpinStart) { filterQuery = filterQuery + `unpinStart=${validateAndReturnDate(filters.unpinStart)}&`; } if (filters.unpinEnd) { filterQuery = filterQuery + `unpinEnd=${validateAndReturnDate(filters.unpinEnd)}&`; } if (filters.pinSizeMin) { if (isNaN(filters.pinSizeMin) || filters.pinSizeMin < 0) { throw new Error('Please make sure the pinSizeMin is a valid positive integer'); } filterQuery = filterQuery + `pinSizeMin=${filters.pinSizeMin}&`; } if (filters.pinSizeMax) { if (isNaN(filters.pinSizeMax) || filters.pinSizeMax < 0) { throw new Error('Please make sure the pinSizeMax is a valid positive integer'); } filterQuery = filterQuery + `pinSizeMax=${filters.pinSizeMax}&`; } if (filters.status) { if (filters.status !== 'all' && filters.status !== 'pinned' && filters.status !== 'unpinned') { throw new Error('status value must be either: all, pinned, or unpinned'); } filterQuery = filterQuery + `status=${filters.status}&`; } if (filters.pageLimit) { if (isNaN(filters.pageLimit) || filters.pageLimit <= 0 || filters.pageLimit > 1000) { throw new Error('Please make sure the pageLimit is a valid integer between 1-1000'); } filterQuery = filterQuery + `pageLimit=${parseInt(filters.pageLimit)}&`; // we want to make sure that decimals get rounded to integers } if (filters.pageOffset) { if (isNaN(filters.pageOffset) || filters.pageOffset <= 0) { throw new Error('Please make sure the pageOffset is a positive integer'); } filterQuery = filterQuery + `pageOffset=${parseInt(filters.pageOffset)}&`; // we want to make sure that decimals get rounded to integers } if (filters.metadata) { if (typeof filters.metadata !== 'object') { throw new Error('metadata value must be an object'); } if (filters.metadata.name) { metadataQuery = `metadata[name]=${filters.metadata.name}&`; } if (filters.metadata.keyvalues) { if (typeof filters.metadata.keyvalues !== 'object') { throw new Error('metadata keyvalues must be an object'); } const prunedKeyValues = {}; // we want to make sure we're only grabbing the values we want for the query, and nothing extra Object.entries(filters.metadata.keyvalues).forEach((keyValue) => { const key = keyValue[0]; const value = keyValue[1]; if (typeof value !== 'object') { throw new Error(`keyValue: ${key} is not an object`); } if (!value || !value.value || !value.op) { throw new Error(`keyValue: ${key} must have both value and op attributes`); } if ((typeof value.value !== 'string') && (typeof value.value !== 'boolean') && (typeof value.value !== 'number')) { throw new Error('Metadata keyvalue values must be strings, booleans, or numbers'); } // Run checks to make sure all of the keyvalues are valid switch (value.op) { case 'gt': prunedKeyValues[key] = { value: value.value, op: value.op }; break; //greater than or equal case 'gte': prunedKeyValues[key] = { value: value.value, op: value.op }; break; // less than case 'lt': prunedKeyValues[key] = { value: value.value, op: value.op }; break; // less than or equal case 'lte': prunedKeyValues[key] = { value: value.value, op: value.op }; break; // not equal to case 'ne': prunedKeyValues[key] = { value: value.value, op: value.op }; break; // equal to case 'eq': prunedKeyValues[key] = { value: value.value, op: value.op }; break; // between case 'between': if (!value.secondValue) { throw new Error(`Because between op code was passed in, keyValue: ${keyValue[0]} must have both also include a secondValue`); } if ((typeof value.secondValue !== 'string') && (typeof value.secondValue !== 'boolean') && (typeof value.secondValue !== 'number')) { throw new Error('Metadata keyvalue secondValue must be a string, boolean, or number'); } prunedKeyValues[key] = { value: value.value, op: value.op, secondValue: value.secondValue }; break; // not between case 'notBetween': if (!value.secondValue) { throw new Error(`Because notBetween op code was passed in, keyValue: ${keyValue[0]} must have both also include a secondValue`); } if ((typeof value.secondValue !== 'string') && (typeof value.secondValue !== 'boolean') && (typeof value.secondValue !== 'number')) { throw new Error('Metadata keyvalue secondValue must be a string, boolean, or number'); } prunedKeyValues[key] = { value: value.value, op: value.op, secondValue: value.secondValue }; break; // like case 'like': prunedKeyValues[key] = { value: value.value, op: value.op }; break; // not like case 'notLike': prunedKeyValues[key] = { value: value.value, op: value.op }; break; // case insensitive like case 'iLike': prunedKeyValues[key] = { value: value.value, op: value.op }; break; // case insensitive not like case 'notILike': prunedKeyValues[key] = { value: value.value, op: value.op }; break; // regex case 'regexp': prunedKeyValues[key] = { value: value.value, op: value.op }; break; // case insensitive regex case 'iRegexp': prunedKeyValues[key] = { value: value.value, op: value.op }; break; default: throw new Error(`keyValue op: ${value.op} is not a valid op code`); } metadataQuery = metadataQuery + `metadata[keyvalues]=${JSON.stringify(prunedKeyValues)}`; }); } } } return `${baseUrl}${filterQuery}${metadataQuery}`; }
12,178