text:
//  NetDefines.h
//  Connect
//
//  Created by MoHuilin on 16/5/16.
//  Copyright © 2016年 Connect.  All rights reserved.
//

//=========== server config ==============
#define RequestTimeout 10
#define successCode 2000

#define APIVersion @"v1"
#define SOCKET_HOST @"sandbox.connect.im"
#define baseServer  @"https://sandbox.connect.im"
#define ServerPublickey @"02c2c7398274aef3b94366369f51c6a75470f3636981c2e75e6fd7b39caede1ca9"
#define SOCKET_PORT 19090
#define DefaultHeadUrl @"https://short.connect.im/avatar/v1/b040e0a970bc6d80b675586c5a55f9e9109168ba.png"

#define nationalAppDownloadUrl @"https://connect.im/guide"
#define appstoreAppDownloadUrl @"https://itunes.apple.com/app/connect-p2p-encrypted-instant/id1181365735"
#define appOpensourceUrl       @"https://www.connect.im/mobile/developer"
#define AppCrashUrl            @"https://collector.bughd.com/kscrash?key=21bc82c6e76df952ccb0c45ca358e87a"
//=========== server config ==============
//↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ server api config ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

#define FeedBackUrl [NSString stringWithFormat:@"https://www.connect.im/mobile/feedback/%@",[LKUserCenter shareCenter].currentLoginUser.address]

//============= socket protocol version =============
#define socketProtocolVersion 1
//============= socket protocol version =============

#define SOCKET_TIME_OUT 20
#define SOCKET_READ_TIME_OUT 60

// fedback address
#define FeedBackUrl [NSString stringWithFormat:@"https://www.connect.im/mobile/feedback/%@",[LKUserCenter shareCenter].currentLoginUser.address]

#define txDetailBaseUrl @"http://blockchain.info/tx/"

// h5 address
#define H5ShareServerUrl @"https://me.connect.im/share/" APIVersion "/contact/"
#define H5PayServerUrl @"https://transfer.connect.im/share/" APIVersion "/pay"
#define FAQUrl @"https://www.connect.im/mobile/faqs"

//message file upload url
#define UPLOAD_FILE_SERVER_URL baseServer "/fs/" APIVersion "/up"

// Server load
#define availableServersUrl baseServer "/connect/" APIVersion "/availableServers"

// Dynamic update startup launch image
#define lanuchImagesUrl baseServer "/launch_images/" APIVersion "/%@/images"

#define updateVersionUrl baseServer "/connect/" APIVersion "/version"

// get http request salt
#define getRandomSaltUrl baseServer "/connect/" APIVersion "/users/salt"

// check http request salt
#define checkSaltExpiredUrl baseServer "/connect/" APIVersion "/users/expire/salt"

/**
  * No kb fee
 */
#define estimetfeeUrl baseServer @"/connect/" APIVersion "/estimatefee"

#pragma mark - login & regist
/**
 Log in to the interface documentation

 UIRL: /connect/" APIVersion "/private/user_existed
 Method: POST
 Data Format: Protobuf
 Params:
 Protobuf 文件: MobileVerify
 */
#define PrivkeySignupUrl baseServer "/connect/" APIVersion "/private/sign_in"

/**
 Log in to the interface documentation

   UIRL: / connect / " APIVersion " / private / user_existed
   Method: POST
   Data Format: Protobuf
   Params:
   Protobuf file: MobileVerify
 */
#define PrivkeyLoginExistedUrl baseServer "/connect/" APIVersion "/private/user_existed"

/**
 Log in to the interface documentation

   UIRL: / connect / " APIVersion " / sign_in
   Method: POST
   Data Format: Protobuf
   Params:
   Protobuf file: MobileVerify
 */
#define LoginSignInUrl baseServer "/connect/" APIVersion "/sign_in"

/**
 Register interface
   UIRL: / connect / " APIVersion " / sign_up
   Method: POST
   Data Format: Protobuf
   Params:
   Protobuf file: IMRequest

 */
#define LoginSignUpUrl baseServer "/connect/" APIVersion "/sign_up"

#pragma mark - SMS verification code related

/**

 send SMS
 UIRL: /connect/" APIVersion "/sms/send
 Method: POST
 Data Format: Protobuf
 Params:
 Protobuf file: SendMobileCode
 */
#define PhoneGetPhoneCode baseServer "/connect/" APIVersion "/sms/send"

#define SignInUrl baseServer "/api/sign_in"

#define UploadAvatarUrl baseServer "/api/upload_avatar"

#define signUpUrl baseServer "/api/sign_up"

/**
 Interface description
   PATH: / api / v1 / tag
   METHOD: POST
   Data Format JSON
 */
#define AddTagUrl baseServer "/api/" APIVersion "/tag"

#pragma mark - chat group

/*
 *  invitate token: /connect/" APIVersion "/group/invite/token
 */
#define GroupInviteTokenUrl baseServer "/connect/" APIVersion "/group/invite/token"

#define GroupInviteApplyUrl baseServer "/connect/" APIVersion "/group/invite"

/**
 PATH:/connect/" APIVersion "/group/info/token
 METHOD: POST
 Data Format: Protobuf
 */
#define GroupInfoTokenUrl baseServer "/connect/" APIVersion "/group/info/token"
/**
 The group generates a hash of the two-dimensional code
   Interface description
   PATH: / connect / v1 / group / hash
   METHOD: POST
   Data Format: Protobuf
   Request parameter
   Protobuf file: IMRequest
 */
#define GroupCreatQRUrl baseServer "/connect/" APIVersion "/group/hash"
/**
 Refresh the group to generate a qr code hash
   Interface description
   PATH: / connect / v1 / group / hash
   METHOD: POST
   Data Format: Protobuf
   Request parameter
   Protobuf file: IMRequest
 */
#define RefreshGroupCreatQRUrl baseServer "/connect/" APIVersion "/group/refresh/hash"
/**
 Share the group's qr code
   Interface description
   PATH: / connect / v1 / group / hash
   METHOD: POST
   Data Format: Protobuf
   Request parameter
   Protobuf file: IMRequest
 */
#define GroupShareUrl baseServer "/connect/" APIVersion "/group/share"
/**
 Upload session key interface
   Interface description

   PATH: / connect / v1 / group / upload_key
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define GroupUploadGroupKeyUrl baseServer "/connect/" APIVersion "/group/upload_key"

/**
 Download the session key interface
   Interface description

   PATH: / connect / v1 / group / download_key
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define GroupDownloadGroupKeyUrl baseServer "/connect/" APIVersion "/group/download_key"

/**
 PATH: /connect/" APIVersion "/group
 METHOD: POST
 Data Format: Protobuf

 */
#define GroupCreateGroupUrl baseServer "/connect/" APIVersion "/group"

/**
 Interface description

   PATH: / connect / v1 / group / setting
   METHOD: POST
   Data Format: Protobuf

 */
#define GroupSettingUrl baseServer "/connect/" APIVersion "/group/setting"

/**
 Group basic information synchronization

   Interface description

   PATH: / connect / v1 / group / setting_info
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define GroupSyncSettingInfoUrl baseServer "/connect/" APIVersion "/group/setting_info"

/**
 Group public information

   Interface description

   PATH: / connect / v1 / group / public_info
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define GroupPublicInfoUrl baseServer "/connect/" APIVersion "/group/public_info"
/**
 Sweep plus group
   Interface description

   PATH: / connect / v1 / group / scan
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define ScanQRJoinGroupUrl baseServer "/connect/" APIVersion "/group/scan"

/**
 PATH: /connect/" APIVersion "/group/info
 METHOD: POST
 Data Format: Protobuf

 */
#define GroupGetGroupInfoUrl baseServer "/connect/" APIVersion "/group/info"

/**
 PATH: /connect/" APIVersion "/group/update
 METHOD: POST
 Data Format: Protobuf
 */

#define GroupUpdateGroupInfoUrl baseServer "/connect/" APIVersion "/group/update"

/**
 Delete group members

   Interface description

   PATH: / connect / v1 / group / deluser
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */
#define GroupGroupDeleteUserUrl baseServer "/connect/" APIVersion "/group/deluser"

/**
 groupAamin exchange

 Interface description

   PATH: / connect / v1 / group / attorn
   METHOD: POST
   Data Format: Protobuf
 */
#define GroupAttornUrl baseServer "/connect/" APIVersion "/group/attorn"

/**
 Group join application

   Interface description

   PATH: / connect / v1 / group / apply
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define GroupApplyToGroupUrl baseServer "/connect/" APIVersion "/group/apply"

/**
 Group review

   Interface description

   PATH: / connect / v1 / group / reviewed
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define GroupReviewewUrl baseServer "/connect/" APIVersion "/group/reviewed"

/**
 Group owners review rejected

   Interface description

   PATH: / connect / v1 / group / reject
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */
#define GroupRejectUrl baseServer "/connect/" APIVersion "/group/reject"

#define GroupUploadGroupAvatarUrl baseServer "/connect/" APIVersion "/group/avatar"

/**
 Group join application

   Interface description

   PATH: / connect / " APIVersion " / group / invite
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define GroupInvateToGroupUrl baseServer "/connect/" APIVersion "/group/invite"

/**
 Leave the group

   Interface description

   PATH: / connect / v1 / group / quit
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */
#define GroupQuitGroupUrl baseServer "/connect/" APIVersion "/group/quit"

/**
 Interface Description Set nickname disables

   PATH: / connect / v1 / group / member_update
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */

#define GroupMemberUpdateUrl baseServer "/connect/" APIVersion "/group/member_update"

/**
 Interface Description Sets the group to quarantine

   PATH: / connect / v1 / group / mute
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */

#define GroupSetMuteUrl baseServer "/connect/" APIVersion "/group/mute"

/**
 Save  common used groups

   Interface description

   PATH: / connect / v1 / group / set_common
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */

#define GroupSetCommonUrl baseServer "/connect/" APIVersion "/group/set_common"

/**
 Cancel common groups

   Interface description

   PATH: / connect / v1 / group / remove_common
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */
#define GroupRemoveCommonUrl baseServer "/connect/" APIVersion "/group/remove_common"

#pragma mark - External red envelopes

/**
 Get hashid and payment address

   Interface description

   PATH: / wallet / v1 / billing / external / pending
   METHOD: POST
   Data Format: Protobuf
 */
#define ExternalPendingUrl baseServer "/wallet/" APIVersion "/billing/external/pending"

/**
 Pay
   Interface description

   PATH: / wallet / v1 / billing / external / send
   METHOD: POST
   Data Format: Protobuf
 */
#define ExternalSendUrl baseServer "/wallet/" APIVersion "/billing/external/send"

/**
 External transfer history
   Interface description

   PATH: / wallet / v1 / billing / external / history
   METHOD: POST
   Data Format: Protobuf
 */
#define ExternalTransferHistoryUrl baseServer "/wallet/" APIVersion "/billing/external/history"

/**
 External red envelopes history
   Interface description

   PATH: / wallet / v1 / red_package / history
   METHOD: POST
   Data Format: Protobuf
 */
#define ExternalRedPackageHistoryUrl baseServer "/wallet/" APIVersion "/red_package/history"

/**
 Transfer canceled
   Interface description

   PATH: / wallet / v1 / billing / external / cancel
   METHOD: POST
   Data Format: Protobuf
 */
#define ExternalBillCancelUrl baseServer "/wallet/" APIVersion "/billing/external/cancel"

/**
 External transfer details
   Interface description

   PATH: / wallet / v1 / billing / external / info
   METHOD: POST
   Data Format: Protobuf
 */
#define ExternalBillInfoUrl baseServer "/wallet/" APIVersion "/billing/external/info"

#pragma mark - redpack

/**
 Receive system red envelopes

   Interface description

   PATH: / wallet / v1 / red_package / grabSystem
   METHOD: POST
   data
 */
#define RedBagGrabSystemUrl baseServer "/wallet/" APIVersion "/red_package/grabSystem"

/**
 Get red envelope details

   Interface description

   PATH: / wallet / v1 / red_package / system / info
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define RedBagSystemInfoUrl baseServer "/wallet/" APIVersion "/red_package/system/info"

/**
 Red envelopes

   Interface description

   PATH: / wallet / v1 / red_package / send
   METHOD: POST
   Data Format: Protobuf
 */
#define RedBagSendUrl baseServer "/wallet/" APIVersion "/red_package/send"
/**
 Get red envelopes based on information

   Interface description

   PATH: / wallet / v1 / red_package / pending
   METHOD: POST
   Data Format: Protobuf
 */
#define RedBagPendingUrl baseServer "/wallet/" APIVersion "/red_package/pending"
/**
 Get red envelope details

   Interface description

   PATH: / wallet / v1 / red_package / info
   METHOD: POST
   Data Format: Protobuf
 */
#define RedBagInfoUrl baseServer "/wallet/" APIVersion "/red_package/info"

/**
 Grab red packets red envelopes

   Interface description

   PATH: / wallet / v1 / red_package / grab
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define RedBagGrabInfoUrl baseServer "/wallet/" APIVersion "/red_package/grab"

#pragma mark - wallet

/*
 * blance
 */

#define WalletUnspentQueryV2Url(address)  [NSString stringWithFormat:@"%@/blockchain/" APIVersion "/unspent/%@/info",baseServer,(address)]

#define QueryRedpackgeWithToken(token)  [NSString stringWithFormat:@"%@/wallet/" APIVersion "/red_package/info/%@",baseServer,(token)]

/**
 Interface description

   PATH: / unspent /: id / order
   METHOD: POST
   Data Format: protobuf
   Request protobuf FriendRecords
 */
#define WalletUsefulUnspentQueryUrl baseServer "/blockchain/" APIVersion "/unspent/%@/order"

/**
 Interface description

   PATH: / connect / v1 / users / friends / records
   METHOD: POST
   Data Format: protobuf
   Request protobuf FriendRecords
 */
#define WallteFriendRecordsUrl baseServer "/connect/" APIVersion "/users/friends/records"

/**
 Interface description
 PATH: /wallet/" APIVersion "/crowdfuning/launch
 METHOD: POST
 Data Format: Protobuf
 */
#define WallteBillCrowdfuningUrl baseServer "/wallet/" APIVersion "/crowdfuning/launch"

/**
 Interface description

 PATH: /wallet/" APIVersion "/crowdfuning/pay
 METHOD: POST
 Data Format: Protobuf
 */
#define WalltePayCrowdfuningUrl baseServer "/wallet/" APIVersion "/crowdfuning/pay"

/**
 Interface description

 PATH: /wallet/" APIVersion "/crowdfuning/info
 METHOD: POST
 Data Forma: Protobuf
 */
#define WallteCrowdfuningInfoUrl baseServer "/wallet/" APIVersion "/crowdfuning/info"

/**
 Interface description

 PATH: /wallet/" APIVersion "/crowdfuning/records/users
 METHOD: POST
 Data Format: Protobuf
 */
#define WallteCrowdfuningUserRecordsUrl baseServer "/wallet/" APIVersion "/crowdfuning/records/users"

/**
 Transfer to multiple people interface

   Interface description

   PATH: / wallet / v1 / billing / muilt_send
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define WallteBillingMuiltSendUrl baseServer "/wallet/" APIVersion "/billing/muilt_send"

/**
 Query a deal
   Interface description

   PATH: / wallet / v1 / billing / info
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define WallteQueryBillInfoUrl baseServer "/wallet/" APIVersion "/billing/info"

/**
 Broadcasting

   Interface description

   PATH: / wallet / v1 / billing / publish / tx
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define WallteBillPublishUrl baseServer "/wallet/" APIVersion "/billing/publish/tx"

/**
 Transfer to the individual
   PATH: / wallet / v1 / billing / send
   METHOD: POST
   Data Format: Protobuf
 */
#define WallteBillingSendUrl baseServer "/wallet/" APIVersion "/billing/send"

/**
 Receipt to personal interface

   Interface description

   PATH: / wallet / v1 / billing / recive
   METHOD: POST
   Data format: Protobuf
 */
#define WallteBillingReciveUrl baseServer "/wallet/" APIVersion "/billing/recive"

/**
 Address transaction record

   Interface description

   PATH: / blockchain / v1 / address /: id / tx
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: QueryAddressTx
 */
#define WalletAddressTransRecodsUrl baseServer "/blockchain/" APIVersion "/address/%@/tx?page=%ld&pagesize=%ld"

/**
 address book

 Interface description

 PATH: /wallet/" APIVersion "/address_book/list
 METHOD: POST
 Data Format: Protobuf
 */
#define Walletaddress_bookListUrl baseServer "/wallet/" APIVersion "/address_book/list"

/**
 Add address
   Interface description

   PATH: / wallet / v1 / address_book / add
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define Walletaddress_bookAddUrl baseServer "/wallet/" APIVersion "/address_book/add"

/**
 Delete address

   Interface description

   PATH: / wallet / v1 / address_book / remove
   METHOD: POST
   Data Format: Protobuf
 */
#define Walletaddress_bookRemoveUrl baseServer "/wallet/" APIVersion "/address_book/remove"

/**
 Address setting tag

   PATH: / wallet / v1 / address_book / tag
   METHOD: POST
   Data Format: Protobuf
 */
#define Walletaddress_bookTagUrl baseServer "/wallet/" APIVersion "/address_book/tag"

#pragma mark - contacts
/**
 Interface description

   PATH: / connect / v1 / users / phonebook
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: RequestNotEncrypt

 */
#define ContactPhoneBookUrl baseServer "/connect/" APIVersion "/users/phonebook"

/**
 Friends search

   Interface description

   PATH: / connect / v1 / users / search
   METHOD: POST
   Data Format: JSON
   Request parameter

 */
#define ContactUserSearchUrl baseServer "/connect/" APIVersion "/users/search"

/**
 Add a blacklist

   Interface description

   PATH: / connect / v1 / blacklist
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */

#define ContactBlackListAddUrl baseServer "/connect/" APIVersion "/blacklist"

/**
 Interface description

   PATH: / connect / v1 / blacklist / remove
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */
#define ContactBlackListRemoveUrl baseServer "/connect/" APIVersion "/blacklist/remove"

/**
 Blacklist interface

   Interface description

   PATH: / connect / v1 / blacklist / list
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */
#define ContactBlackListUrl baseServer "/connect/" APIVersion "/blacklist/list"

/**
 Set privacy

   Interface description

   PATH: / connect / v1 / setting / privacy
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */

#define ContactSetPrivacyUrl baseServer "/connect/" APIVersion "/setting/privacy"
/**
 Set whether to allow me to find me from the practitioner

   Interface description

   PATH: / connect / v1 / setting / privacy
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */

#define RecommendFindMe baseServer "/connect/" APIVersion "/setting/recommend"
/**

 Get set privacy

   Interface description

   PATH: / connect / v1 / setting / privacy / info
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
*/
#define ContactSyncPrivacyUrl baseServer "/connect/" APIVersion "/setting/privacy/info"

/**
 Update user avatar

   Interface description

   PATH: / connect / v1 / setting / avatar
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define ContactSetAvatar baseServer "/connect/" APIVersion "/setting/avatar"

#pragma mark -contact tag

/**
 Tag interface

   Interface description

   PATH: / connect / v1 / tag
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */
#define ContactAddTagUrl baseServer "/connect/" APIVersion "/tag"

/**
 Tag interface

   Interface description

   PATH: / connect / v1 / tag / list
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define ContactTagListUrl baseServer "/connect/" APIVersion "/tag/list"

/**
 Remove the label interface

   Interface description

   PATH: / connect / v1 / tag / remove
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */

#define ContactTagRemoveUrl baseServer "/connect/" APIVersion "/tag/remove"

/**
 Set friend interface

   Interface description

   PATH: / connect / v1 / tag / adduser
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

   Add the member Protobuf file: SetingUserToTag

 */
#define ContactTagSetUserTagUrl baseServer "/connect/" APIVersion "/tag/adduser"

/**
 Set friend interface

   Interface description

   PATH: / connect / v1 / tag / remove / user
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */
#define ContactTagRemoveUserTagUrl baseServer "/connect/" APIVersion "/tag/remove/user"
/**
 Set friend interface

   Interface description

   PATH: / connect / v1 / tag / remove / user
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */
#define ContactTagRemoveUserHaveTagUrl baseServer "/connect/" APIVersion "/tag/remove"

/**
 Tag friends list

   Interface description

   PATH: / connect / v1 / tag / users
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */
#define ContactTagTagUsersUrl baseServer "/connect/" APIVersion "/tag/users"
/**
 Friends under the tags

   Interface description

   PATH: / connect / v1 / tag / users
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */
#define UserTagsUrl baseServer "/connect/" APIVersion "/tag/friendTags"

#pragma mark - user
/**
 Interface description

   PATH: / avatar / v1 / up
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: RequestNotEncrypt

 */
#define UserSetOrUpdataAvatar baseServer "/avatar/" APIVersion "/up"

/**
 Interface description

   PATH: / connect / v1 / setting / userinfo
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define SetUpdataUserInfo baseServer "/connect/" APIVersion "/setting/userinfo"

// ===========================exchange rate=================================//
/**
 *  Conversion of RMB and Bitcoin
 */
#define RMBExchangeBitRateUrl baseServer "/apis/cny"

/**
 *  Bit currency quot; apis / bitstamp
 */
#define BitsampUrl baseServer "/apis/bitstamp"

/**
 Bitcoin and dollar conversion / apis / usd
 */
#define DollarExchangeBitRateUrl baseServer "/apis/usd"

/**
 *  Conversion of rubles and bitcoats / apis / rub
 */
#define  RubleExchangeBitRateUrl baseServer "/apis/rub"

#pragma mark - blockchain Query interface
/**
 Unused transaction
 /blockchain/api/" APIVersion "/unspent/:id
 */
//#define BlockChainUnspentUrl baseServer "/blockchain/" APIVersion "/unspent/"
#define BlockChainUnspentUrlWithAddress(address)  [NSString stringWithFormat:@"%@/blockchain/" APIVersion "/unspent/%@",baseServer,(address)]

/**
 Interface description

   PATH: / blockchain / v1 / tx / compose
   METHOD: post
 Data Format: Protobuf

 */

//#define BlockChaincomposeUrl @"http://192.168.4.179:3000" "/blockchain/" APIVersion "/tx/compose"
#define BlockChaincomposeUrl baseServer "/blockchain/" APIVersion "/tx/compose"

#pragma mark - set
/**
 Unbind

   Interface description

   PATH: / connect / v1 / setting / unbind / mobile
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */

#define SetUnBindPhoneUrl baseServer "/connect/" APIVersion "/setting/unbind/mobile"

/**
 Bind the phone number

   Interface description

   PATH: / connect / v1 / setting / bind / mobile
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

*/

#define SetBindPhoneUrl baseServer "/connect/" APIVersion "/setting/bind/mobile"

/**
 Change the login password

   Interface description

   PATH: / connect / v1 / setting / backup / key
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */
#define SetChangeLoginPass baseServer "/connect/" APIVersion "/setting/backup/key"

/**
 Payment settings

   Interface description

   PATH: / connect / v1 / setting / pay / setting
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */
#define SetPaySetUrl baseServer "/connect/" APIVersion "/setting/pay/setting"

#define PinSetingUrl baseServer "/connect/" APIVersion "/setting/pay/pin/setting"
#define PaypinversionUrl  baseServer "/connect/" APIVersion "/setting/pay/pin/version"

/**
 Payment settings

   Interface description

   PATH: / connect / v1 / setting / pay / setting / sync
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest

 */
#define SetSyncPaySetUrl baseServer "/connect/" APIVersion "/setting/pay/setting/sync"

#pragma mark - userinfo message

#pragma mark - FAQ
#define FAQWikisUrl baseServer "/faq/" APIVersion "/wikis"

#define ShareAppUrl baseServer "/share/" APIVersion "/app"

#pragma mark -Synchronous address book

/**
 Synchronous address book

   Interface description

   PATH: / connect / v1 / setting / phonebook / sync
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define SetPhonebookSync baseServer "/connect/" APIVersion "/setting/phonebook/sync"

#pragma mark - synchroize
/**
 Get backup information
   PATH: / connect / v1 / group / backup
   METHOD: POST
   Data Format: Protobuf
   Request parameter

   Protobuf file: IMRequest
 */
#define BackupDownCreateGroupInfoUrl baseServer "/connect/" APIVersion "/group/backup"
/**
 Modify user id

   UIRL: / connect / v1 / setting / connectId
   Method: POST
   Data Format: Protobuf
   Params:
   Protobuf file: SendMobileCode
 */
#define UpdateUserID baseServer "/connect/" APIVersion "/setting/connectId"
/**
 recommand man

 UIRL: /connect/" APIVersion "/users/recommend
 Method: POST
 Data Format: Protobuf
 Params:
 Protobuf file: SendMobileCode
 */
#define GetRecommandFriendUrl baseServer "/connect/" APIVersion "/users/recommend"


text:
package org.mtransit.android.commons;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.provider.Settings;

import androidx.annotation.NonNull;

public final class DeviceUtils {

	private DeviceUtils() {
	}

	public static void showAppDetailsSettings(@NonNull Context context, @NonNull String pkg) {
		LinkUtils.open(context,
				new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
						Uri.parse("package:" + pkg)),
				null);
	}

	public static void showLocaleSettings(@NonNull Context context) {
		LinkUtils.open(context,
				new Intent(Settings.ACTION_LOCALE_SETTINGS),
				null);
	}

	public static void showDateSettings(@NonNull Context context) {
		LinkUtils.open(context,
				new Intent(Settings.ACTION_DATE_SETTINGS),
				null);
	}

	public static void showLocationSourceSettings(@NonNull Context context) {
		LinkUtils.open(context,
				new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS),
				null);
	}

	public static void showIgnoreBatteryOptimizationSettings(@NonNull Context context) {
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
			LinkUtils.open(context,
					new Intent(Settings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS),
					null);
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?php

echo '
dmesg ...
';

?>

<form action="<?php postToMe() ?>" method="post">

<input type="submit" name="submit" value="Done">
</form>


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true"
          android:drawable="@color/primary_light"/>

    <item android:drawable="@color/white" />
</selector>


text:
<!-- PhotoSwipe -->
<link rel="stylesheet" href="styles/photoswipe.css">
<link rel="stylesheet" href="styles/photoswipe-default-skin/default-skin.css">
<script src="scripts/photoswipe.min.js"></script>
<script src="scripts/photoswipe-ui-default.min.js"></script>


text:
layout: default
title: 404 - Tidd Financial
permalink: /404.html
---

404

Sorry, that page is not available.

Maybe try looking at home?


text:
require "#{Rails.root}/lib/wiki_edits"

#= Controller for user functionality
class UsersController < ApplicationController
  respond_to :html, :json
  before_action :require_participating_user,
                only: [:save, :enroll]

  def signout
    if current_user.nil?
      redirect_to '/'
    else
      current_user.update_attributes(wiki_token: nil, wiki_secret: nil)
      redirect_to true_destroy_user_session_path
    end
  end

  def save_assignments
    require "#{Rails.root}/lib/assignments_manager"
    @course = Course.find_by_slug(params[:course_id])
    AssignmentsManager.update_assignments(@course, user_params, current_user)
    render 'users', formats: :json
  end

  #########################
  # Enrollment management #
  #########################
  def enroll
    if request.post?
      add
    elsif request.delete?
      remove
    end
  end

  def enroll_params
    params.require(:user).permit(:user_id, :wiki_id, :role)
  end

  def fetch_enroll_records
    require "#{Rails.root}/lib/importers/user_importer"

    @course = Course.find_by_slug(params[:id])
    if enroll_params.key? :user_id
      @user = User.find(enroll_params[:user_id])
    elsif enroll_params.key? :wiki_id
      wiki_id = enroll_params[:wiki_id]
      @user = User.find_by(wiki_id: wiki_id)
      @user = UserImporter.new_from_wiki_id(wiki_id) if @user.nil?
    else
      return
    end
  end

  def add
    fetch_enroll_records
    if !@user.nil?
      # Instructors and others with non-student roles may not enroll as students
      if @user.can_edit?(@course) && enroll_params[:role].to_i == CoursesUsers::Roles::STUDENT_ROLE
        render json: { message: 'Instructors and volunteers cannot enroll as students.' },
               status: 404
        return
      end

      CoursesUsers.create(
        user: @user,
        course_id: @course.id,
        role: enroll_params[:role]
      )

      WikiEdits.update_course(@course, current_user)
      render 'users', formats: :json
    else
      username = enroll_params[:user_id] || enroll_params[:wiki_id]
      render json: { message: I18n.t('courses.error.user_exists',
                                     username: username) },
             status: 404
    end
  end

  def remove
    fetch_enroll_records
    return if @user.nil?

    course_user = CoursesUsers.find_by(
      user_id: @user.id,
      course_id: @course.id,
      role: enroll_params[:role]
    )
    return if course_user.nil? # This will happen if the user was already removed.
    assignments = course_user.assignments
    assignments.each { |assignment| WikiEdits.remove_assignment(current_user, assignment) }

    course_user.destroy # destroying the course_user also destroys associated Assignments.
    render 'users', formats: :json
    WikiEdits.update_course(@course, current_user)
  end

  private

  def user_params
    params.permit(
      users: [:id, :wiki_id, :deleted, :email],
      assignments: [:id, :user_id, :article_title, :role, :course_id, :deleted]
    )
  end
end


text:
$(function(){
	$('.login.modal').modal('attach events', '.item.login', 'show');
	$('.login.modal').modal('attach events', '.login-button', 'show');
	$('.login-form').form();

	// Nar Bar
	$('.right.menu.open').on("click",function(e){
		e.preventDefault();
		$('.ui.vertical.menu').toggle();
	});

	$('.ui.dropdown').dropdown();
});
$(function(){
	$('.notifications-popup-button').popup({
		popup: '.notifications-popup',
		on: 'click',
		position: 'top center'
	});
});


text:
<resources>
    <string name="app_name">Mabeee AllAboard!</string>
    <string name="action_settings">Mabeeeと接続</string>
    <string name="action_emergency">緊急停車</string>
</resources>


text:
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)

_sym_db = _symbol_database.Default()

DESCRIPTOR = _descriptor.FileDescriptor(
  name='POGOProtos/Networking/Requests/Messages/FortDeployPokemonMessage.proto',
  package='POGOProtos.Networking.Requests.Messages',
  syntax='proto3',
  serialized_pb=_b('\nFPOGOProtos/Networking/Requests/Messages/FortDeployPokemonMessage.proto\x12\'POGOProtos.Networking.Requests.Messages\"r\n\x18\x46ortDeployPokemonMessage\x12\x0f\n\x07\x66ort_id\x18\x01 \x01(\t\x12\x12\n\npokemon_id\x18\x02 \x01(\x06\x12\x17\n\x0fplayer_latitude\x18\x03 \x01(\x01\x12\x18\n\x10player_longitude\x18\x04 \x01(\x01\x62\x06proto3')
)
_sym_db.RegisterFileDescriptor(DESCRIPTOR)

_FORTDEPLOYPOKEMONMESSAGE = _descriptor.Descriptor(
  name='FortDeployPokemonMessage',
  full_name='POGOProtos.Networking.Requests.Messages.FortDeployPokemonMessage',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    _descriptor.FieldDescriptor(
      name='fort_id', full_name='POGOProtos.Networking.Requests.Messages.FortDeployPokemonMessage.fort_id', index=0,
      number=1, type=9, cpp_type=9, label=1,
      has_default_value=False, default_value=_b("").decode('utf-8'),
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
    _descriptor.FieldDescriptor(
      name='pokemon_id', full_name='POGOProtos.Networking.Requests.Messages.FortDeployPokemonMessage.pokemon_id', index=1,
      number=2, type=6, cpp_type=4, label=1,
      has_default_value=False, default_value=0,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
    _descriptor.FieldDescriptor(
      name='player_latitude', full_name='POGOProtos.Networking.Requests.Messages.FortDeployPokemonMessage.player_latitude', index=2,
      number=3, type=1, cpp_type=5, label=1,
      has_default_value=False, default_value=float(0),
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
    _descriptor.FieldDescriptor(
      name='player_longitude', full_name='POGOProtos.Networking.Requests.Messages.FortDeployPokemonMessage.player_longitude', index=3,
      number=4, type=1, cpp_type=5, label=1,
      has_default_value=False, default_value=float(0),
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  syntax='proto3',
  extension_ranges=[],
  oneofs=[
  ],
  serialized_start=115,
  serialized_end=229,
)

DESCRIPTOR.message_types_by_name['FortDeployPokemonMessage'] = _FORTDEPLOYPOKEMONMESSAGE

FortDeployPokemonMessage = _reflection.GeneratedProtocolMessageType('FortDeployPokemonMessage', (_message.Message,), dict(
  DESCRIPTOR = _FORTDEPLOYPOKEMONMESSAGE,
  __module__ = 'POGOProtos.Networking.Requests.Messages.FortDeployPokemonMessage_pb2'
  # @@protoc_insertion_point(class_scope:POGOProtos.Networking.Requests.Messages.FortDeployPokemonMessage)
  ))
_sym_db.RegisterMessage(FortDeployPokemonMessage)

# @@protoc_insertion_point(module_scope)


text:
static int XErrorHandlerImpl(Display *display, XErrorEvent *event)
{
    return 0;
}

static int XIOErrorHandlerImpl(Display *display)
{
    return 0;
}

static void TerminationSignalHandler(int signatl)
{

}

#endif

namespace Atomic
{

class WebBrowserHostPrivate
{
    friend class WebBrowserHost;

public:

    WebBrowserHostPrivate(WebBrowserHost* host)
    {

        host_ = host;
        app_ = new WebAppBrowser();
    }

    virtual ~WebBrowserHostPrivate()
    {
        host_ = 0;
    }

private:

    WeakPtr<WebBrowserHost> host_;
    CefRefPtr<CefApp> app_;

};

WebBrowserHost::WebBrowserHost(Context* context) : Object (context)
{

    const Vector<String>& arguments = GetArguments();

#ifdef ATOMIC_PLATFORM_LINUX
    XSetErrorHandler(XErrorHandlerImpl);
    XSetIOErrorHandler(XIOErrorHandlerImpl);

    // Install a signal handler so we clean up after ourselves.
    signal(SIGINT, TerminationSignalHandler);
    signal(SIGTERM, TerminationSignalHandler);

#endif

    // IMPORTANT: Cef::App contains virtual void OnBeforeCommandLineProcessing(), which should make it possible
    // to setup args on Windows

#ifdef ATOMIC_PLATFORM_OSX
    const char* _argv[3] = { "", "--enable-media-stream", "--enable-usermedia-screen-capturing" };
    CefMainArgs args(3, (char**) &_argv);
#elif ATOMIC_PLATFORM_LINUX
    static const char* _argv[3] = { "AtomicWebView", "--disable-setuid-sandbox", "--off-screen-rendering-enabled" };
    CefMainArgs args(3, (char**) &_argv);
#else
    CefMainArgs args;
#endif

    CefSettings settings;
    settings.windowless_rendering_enabled = true;

    d_ = new WebBrowserHostPrivate(this);

    // If losing OSX system menu, it means we're calling this
    // before initializing graphics subsystem
    if (!CefInitialize(args, settings, d_->app_, nullptr))
    {
        LOGERROR("CefInitialize - Error");
    }

    RegisterWebSchemeHandlers(this);

    SubscribeToEvent(E_BEGINFRAME, HANDLER(WebBrowserHost, HandleBeginFrame));

}

WebBrowserHost::~WebBrowserHost()
{
    CefClearSchemeHandlerFactories();
    CefShutdown();
}

void WebBrowserHost::HandleBeginFrame(StringHash eventType, VariantMap& eventData)
{
    CefDoMessageLoopWork();
}

}


text:
package io.github.aosn.mosaic.domain.service.poll;

import io.github.aosn.mosaic.domain.model.poll.Group;
import io.github.aosn.mosaic.domain.model.poll.Poll;
import io.github.aosn.mosaic.domain.model.poll.Vote;
import io.github.aosn.mosaic.domain.repository.poll.GroupRepository;
import io.github.aosn.mosaic.domain.repository.poll.PollRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.transaction.Transactional;
import java.time.LocalDate;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Stream;

/**
 * Provides {@link Poll} entity operations.
 *
 * @author mikan
 * @since 0.1
 */
@Service
@Slf4j
public class PollService {

    private static final Lock LOCK = new ReentrantLock();
    private final PollRepository pollRepository;
    private final GroupRepository groupRepository;

    @Value("${mosaic.issue.organization}")
    private String defaultOrganization;

    @Value("${mosaic.issue.repository}")
    private String defaultRepository;

    @Value("${mosaic.issue.filter}")
    private String defaultLabelFilter;

    @Value("${mosaic.slack.webhook}")
    private String webhook;

    @Value("${mosaic.slack.channel}")
    private String channel;

    @Value("${mosaic.slack.username}")
    private String username;

    @Value("${mosaic.slack.template.begin}")
    private String beginTemplate;

    @Value("${mosaic.slack.template.end}")
    private String endTemplate;

    public PollService(PollRepository pollRepository, GroupRepository groupRepository) {
        this.pollRepository = pollRepository;
        this.groupRepository = groupRepository;
    }

    @PostConstruct
    private void init() {
        // insert default record at first time
        var allInDataSource = groupRepository.findAll();
        var slack = Group.SlackParam.builder()
                .webhook(webhook).channel(channel).username(username)
                .beginTemplate(beginTemplate).endTemplate(endTemplate).build();
        var group = new Group(defaultOrganization, defaultRepository, defaultLabelFilter, null, slack);
        if (allInDataSource.isEmpty()) {
            log.info("Inserting default group: " + group);
            groupRepository.saveAndFlush(group);
            pollRepository.findAll().stream().filter(p -> p.getGroup() == null).forEach(p -> {
                p.setGroup(group);
                pollRepository.save(p);
            });
            pollRepository.flush();
            return;
        }
        // check default value modification
        var defaultGroup = allInDataSource.stream()
                .filter(g -> g.getOwner() == null) // null for default
                .findFirst().orElseThrow(IllegalStateException::new);
        if (!group.equals(defaultGroup)) {
            // update record
            log.info("Updating default group:\ncreate\t" + defaultGroup + "\nto\t" + group);
            defaultGroup.replace(group);
            groupRepository.saveAndFlush(defaultGroup);
        }
    }

    /**
     * Get all entities.
     *
     * @return {@link Stream} of entities
     * @throws DataAccessException if the database error occurred
     */
    public Stream<Poll> getAll() {
        return pollRepository.findAll().stream();
    }

    /**
     * Get a poll entity.
     *
     * @param pollId poll id
     * @return entity
     * @throws NoSuchElementException if requested poll is not found
     * @throws DataAccessException    if the database error occurred
     */
    public Poll get(Long pollId) {
        var poll = pollRepository.findOne(pollId);
        if (poll == null) {
            throw new NoSuchElementException("Poll not found: " + pollId);
        }
        return poll;
    }

    /**
     * Submit votes.
     *
     * @param poll  poll
     * @param votes {@link List} of {@link Vote}s
     * @throws DataAccessException if the database error occurred
     */
    @Transactional
    public void submit(Poll poll, List<Vote> votes) {
        log.info("BEGIN submit: " + votes);
        LOCK.lock();
        try {
            var allVotes = poll.getVotes();
            allVotes.addAll(votes);
            poll.setVotes(allVotes);
            pollRepository.saveAndFlush(poll);
        } finally {
            LOCK.unlock();
        }
        log.info("END submit: " + votes);
    }

    /**
     * Create a poll.
     *
     * @param poll entity
     * @throws DataAccessException if the database error occurred
     */
    @Transactional
    public void create(Poll poll) {
        log.info("BEGIN create: " + poll);
        pollRepository.saveAndFlush(poll);
        log.info("END create: " + poll);
    }

    /**
     * Close a poll.
     *
     * @param poll poll
     * @throws DataAccessException if the database error occurred
     */
    @Transactional
    public void close(Poll poll) {
        log.info("BEGIN close: " + poll);
        poll.setState(Poll.PollState.CLOSED);
        poll.setEnd(LocalDate.now());
        poll.setWinBook(poll.judgeWinner());
        pollRepository.saveAndFlush(poll);
        log.info("END close: " + poll);
    }

    /**
     * Get all groups or singleton list that contains default group.
     *
     * @return list of group
     * @throws DataAccessException   if the database error occurred
     * @throws IllegalStateException if default entry is missing
     */
    public List<Group> getAllGroup() {
        var groups = groupRepository.findAll();
        if (groups.isEmpty()) {
            throw new IllegalStateException("Missing default entry");
        }
        return groups;
    }

    /**
     * Get default group.
     *
     * @return default group
     * @throws DataAccessException   if the database error occurred
     * @throws IllegalStateException if default entry is missing
     */
    public Group getDefaultGroup() {
        var group = groupRepository.findOne(new Group.GroupKey(defaultOrganization, defaultRepository));
        if (group == null) {
            throw new IllegalStateException("Missing default entry");
        }
        return group;
    }

    public void addGroup(Group group) {
        if (groupRepository.findAll().stream().anyMatch(g -> g.equals(group))) {
            throw new IllegalArgumentException("Group already registered");
        }
        groupRepository.saveAndFlush(group);
        log.info("Group added: " + group);
    }

    /**
     * Count number of polls registered.
     *
     * @return number of polls
     * @since 0.3
     */
    public long countPolls() {
        return pollRepository.count();
    }

    /**
     * Count number of groups registered.
     *
     * @return number of groups
     * @since 0.3
     */
    public long countGroups() {
        return groupRepository.count();
    }
}


text:
require 'acmesmith/utils/finder'

module Acmesmith
  module PostIssuingHooks
    def self.find(name)
      Utils::Finder.find(self, 'acmesmith/post_issuing_hooks', name)
    end
  end
end


text:
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
  set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")

# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
  if(BUILD_TYPE)
    string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
  else()
    set(CMAKE_INSTALL_CONFIG_NAME "Release")
  endif()
  message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()

# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
  if(COMPONENT)
    message(STATUS "Install component: \"${COMPONENT}\"")
    set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
  else()
    set(CMAKE_INSTALL_COMPONENT)
  endif()
endif()

if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "headers" OR NOT CMAKE_INSTALL_COMPONENT)
  file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include/dart/collision" TYPE FILE FILES
    "/Users/Dong/Documents/Grad2b/dart/dart/collision/CollisionDetector.hpp"
    "/Users/Dong/Documents/Grad2b/dart/dart/collision/CollisionFilter.hpp"
    "/Users/Dong/Documents/Grad2b/dart/dart/collision/CollisionGroup.hpp"
    "/Users/Dong/Documents/Grad2b/dart/dart/collision/CollisionObject.hpp"
    "/Users/Dong/Documents/Grad2b/dart/dart/collision/CollisionOption.hpp"
    "/Users/Dong/Documents/Grad2b/dart/dart/collision/CollisionResult.hpp"
    "/Users/Dong/Documents/Grad2b/dart/dart/collision/Contact.hpp"
    "/Users/Dong/Documents/Grad2b/dart/dart/collision/DistanceFilter.hpp"
    "/Users/Dong/Documents/Grad2b/dart/dart/collision/DistanceOption.hpp"
    "/Users/Dong/Documents/Grad2b/dart/dart/collision/DistanceResult.hpp"
    "/Users/Dong/Documents/Grad2b/dart/dart/collision/Option.hpp"
    "/Users/Dong/Documents/Grad2b/dart/dart/collision/Result.hpp"
    "/Users/Dong/Documents/Grad2b/dart/dart/collision/SmartPointer.hpp"
    "/Users/Dong/Documents/Grad2b/dart/Xcode/dart/collision/collision.hpp"
    )
endif()

if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "headers" OR NOT CMAKE_INSTALL_COMPONENT)
  file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include/dart/collision/detail" TYPE FILE FILES
    "/Users/Dong/Documents/Grad2b/dart/dart/collision/detail/CollisionDetector.hpp"
    "/Users/Dong/Documents/Grad2b/dart/dart/collision/detail/CollisionGroup.hpp"
    )
endif()

if(NOT CMAKE_INSTALL_LOCAL_ONLY)
  # Include the install script for each subdirectory.
  include("/Users/Dong/Documents/Grad2b/dart/Xcode/dart/collision/dart/cmake_install.cmake")
  include("/Users/Dong/Documents/Grad2b/dart/Xcode/dart/collision/fcl/cmake_install.cmake")
  include("/Users/Dong/Documents/Grad2b/dart/Xcode/dart/collision/bullet/cmake_install.cmake")

endif()


text:
package org.hibernate.exception;

import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.ObjectOutputStream;
import java.io.IOException;

import antlr.RecognitionException;

/**
 * The base class of all runtime exceptions which can contain other
 * exceptions.
 *
 * @author Rafal Krzewski
 * @author Daniel Rall
 * @author Kasper Nielsen
 * @author Steven Caswell
 * @version $Id: NestableRuntimeException.java 8137 2005-09-09 15:21:10Z epbernard $
 * @see org.apache.commons.lang.exception.NestableException
 * @since 1.0
 */
public class NestableRuntimeException extends RuntimeException implements Nestable {

	/**
	 * The helper instance which contains much of the code which we
	 * delegate to.
	 */
	protected NestableDelegate delegate = new NestableDelegate( this );

	/**
	 * Holds the reference to the exception or error that caused
	 * this exception to be thrown.
	 */
	private Throwable cause = null;

	/**
	 * Constructs a new NestableRuntimeException without specified
	 * detail message.
	 */
	public NestableRuntimeException() {
		super();
	}

	/**
	 * Constructs a new NestableRuntimeException with specified
	 * detail message.
	 *
	 * @param msg the error message
	 */
	public NestableRuntimeException(String msg) {
		super( msg );
	}

	/**
	 * Constructs a new NestableRuntimeException with specified
	 * nested Throwable.
	 *
	 * @param cause the exception or error that caused this exception to be
	 *              thrown
	 */
	public NestableRuntimeException(Throwable cause) {
		super();
		this.cause = cause;
	}

	/**
	 * Constructs a new NestableRuntimeException with specified
	 * detail message and nested Throwable.
	 *
	 * @param msg   the error message
	 * @param cause the exception or error that caused this exception to be
	 *              thrown
	 */
	public NestableRuntimeException(String msg, Throwable cause) {
		super( msg );
		this.cause = cause;
	}

	public Throwable getCause() {
		return cause;
	}

	/**
	 * Returns the detail message string of this throwable. If it was
	 * created with a null message, returns the following:
	 * ( cause==null ? null : cause.toString( ).
	 */
	public String getMessage() {
		if ( super.getMessage() != null ) {
			return super.getMessage();
		}
		else if ( cause != null ) {
			return cause.toString();
		}
		else {
			return null;
		}
	}

	public String getMessage(int index) {
		if ( index == 0 ) {
			return super.getMessage();
		}
		else {
			return delegate.getMessage( index );
		}
	}

	public String[] getMessages() {
		return delegate.getMessages();
	}

	public Throwable getThrowable(int index) {
		return delegate.getThrowable( index );
	}

	public int getThrowableCount() {
		return delegate.getThrowableCount();
	}

	public Throwable[] getThrowables() {
		return delegate.getThrowables();
	}

	public int indexOfThrowable(Class type) {
		return delegate.indexOfThrowable( type, 0 );
	}

	public int indexOfThrowable(Class type, int fromIndex) {
		return delegate.indexOfThrowable( type, fromIndex );
	}

	public void printStackTrace() {
		delegate.printStackTrace();
	}

	public void printStackTrace(PrintStream out) {
		delegate.printStackTrace( out );
	}

	public void printStackTrace(PrintWriter out) {
		delegate.printStackTrace( out );
	}

	public final void printPartialStackTrace(PrintWriter out) {
		super.printStackTrace( out );
	}

	private void writeObject(ObjectOutputStream oos) throws IOException {
		Throwable tempCause = cause;
		//don't propagate RecognitionException, might be not serializable
		if ( cause instanceof RecognitionException ) {
			cause = null;
		}
		oos.defaultWriteObject();
		cause = tempCause;
	}

}


text:
namespace PJanssen.Outliner.Controls.Options
{
   partial class ContextMenuModelEditor
   {
      /// <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 Component 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.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
         this.itemsComboBox = new System.Windows.Forms.ComboBox();
         this.addBtn = new System.Windows.Forms.Button();
         this.itemTree = new Outliner.Controls.Tree.TreeView();
         this.itemPropertyGrid = new System.Windows.Forms.PropertyGrid();
         this.moveUpBtn = new System.Windows.Forms.Button();
         this.moveDownBtn = new System.Windows.Forms.Button();
         this.deleteBtn = new System.Windows.Forms.Button();
         this.outlinerGroupBox1 = new Outliner.Controls.OutlinerGroupBox();
         this.tableLayoutPanel2.SuspendLayout();
         this.outlinerGroupBox1.SuspendLayout();
         this.SuspendLayout();
         //
         // tableLayoutPanel2
         //
         this.tableLayoutPanel2.ColumnCount = 2;
         this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
         this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 60F));
         this.tableLayoutPanel2.Controls.Add(this.itemsComboBox, 0, 0);
         this.tableLayoutPanel2.Controls.Add(this.addBtn, 1, 0);
         this.tableLayoutPanel2.Controls.Add(this.itemTree, 0, 1);
         this.tableLayoutPanel2.Controls.Add(this.itemPropertyGrid, 0, 4);
         this.tableLayoutPanel2.Controls.Add(this.moveUpBtn, 1, 2);
         this.tableLayoutPanel2.Controls.Add(this.moveDownBtn, 1, 3);
         this.tableLayoutPanel2.Controls.Add(this.deleteBtn, 1, 1);
         this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
         this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 16);
         this.tableLayoutPanel2.Name = "tableLayoutPanel2";
         this.tableLayoutPanel2.RowCount = 5;
         this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F));
         this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F));
         this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F));
         this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
         this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
         this.tableLayoutPanel2.Size = new System.Drawing.Size(448, 380);
         this.tableLayoutPanel2.TabIndex = 0;
         //
         // itemsComboBox
         //
         this.itemsComboBox.Dock = System.Windows.Forms.DockStyle.Fill;
         this.itemsComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
         this.itemsComboBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
         this.itemsComboBox.FormattingEnabled = true;
         this.itemsComboBox.Location = new System.Drawing.Point(3, 3);
         this.itemsComboBox.Name = "itemsComboBox";
         this.itemsComboBox.Size = new System.Drawing.Size(382, 21);
         this.itemsComboBox.TabIndex = 0;
         //
         // addBtn
         //
         this.addBtn.Dock = System.Windows.Forms.DockStyle.Fill;
         this.addBtn.FlatStyle = System.Windows.Forms.FlatStyle.System;
         this.addBtn.Font = new System.Drawing.Font("Tahoma", 8F);
         this.addBtn.Location = new System.Drawing.Point(391, 2);
         this.addBtn.Margin = new System.Windows.Forms.Padding(3, 2, 3, 3);
         this.addBtn.Name = "addBtn";
         this.addBtn.Size = new System.Drawing.Size(54, 23);
         this.addBtn.TabIndex = 1;
         this.addBtn.Text = "Add";
         this.addBtn.UseVisualStyleBackColor = true;
         this.addBtn.Click += new System.EventHandler(this.addBtn_Click);
         //
         // itemTree
         //
         this.itemTree.AllowDrop = true;
         this.itemTree.AutoScroll = true;
         this.itemTree.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
         this.itemTree.Dock = System.Windows.Forms.DockStyle.Fill;
         this.itemTree.Location = new System.Drawing.Point(3, 31);
         this.itemTree.Name = "itemTree";
         this.tableLayoutPanel2.SetRowSpan(this.itemTree, 3);
         this.itemTree.Size = new System.Drawing.Size(382, 198);
         this.itemTree.TabIndex = 2;
         this.itemTree.SelectionChanged += new System.EventHandler<Outliner.Controls.Tree.SelectionChangedEventArgs>(this.itemTree_SelectionChanged);
         //
         // itemPropertyGrid
         //
         this.itemPropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill;
         this.itemPropertyGrid.HelpVisible = false;
         this.itemPropertyGrid.Location = new System.Drawing.Point(3, 235);
         this.itemPropertyGrid.Name = "itemPropertyGrid";
         this.itemPropertyGrid.Size = new System.Drawing.Size(382, 142);
         this.itemPropertyGrid.TabIndex = 3;
         this.itemPropertyGrid.ToolbarVisible = false;
         this.itemPropertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.itemPropertyGrid_PropertyValueChanged);
         //
         // moveUpBtn
         //
         this.moveUpBtn.Dock = System.Windows.Forms.DockStyle.Fill;
         this.moveUpBtn.FlatStyle = System.Windows.Forms.FlatStyle.System;
         this.moveUpBtn.Font = new System.Drawing.Font("Tahoma", 8F);
         this.moveUpBtn.Location = new System.Drawing.Point(391, 59);
         this.moveUpBtn.Name = "moveUpBtn";
         this.moveUpBtn.Size = new System.Drawing.Size(54, 22);
         this.moveUpBtn.TabIndex = 4;
         this.moveUpBtn.Text = "Up";
         this.moveUpBtn.UseVisualStyleBackColor = true;
         this.moveUpBtn.Click += new System.EventHandler(this.moveUpBtn_Click);
         //
         // moveDownBtn
         //
         this.moveDownBtn.Dock = System.Windows.Forms.DockStyle.Top;
         this.moveDownBtn.FlatStyle = System.Windows.Forms.FlatStyle.System;
         this.moveDownBtn.Font = new System.Drawing.Font("Tahoma", 8F);
         this.moveDownBtn.Location = new System.Drawing.Point(391, 87);
         this.moveDownBtn.Name = "moveDownBtn";
         this.moveDownBtn.Size = new System.Drawing.Size(54, 22);
         this.moveDownBtn.TabIndex = 5;
         this.moveDownBtn.Text = "Down";
         this.moveDownBtn.UseVisualStyleBackColor = true;
         this.moveDownBtn.Click += new System.EventHandler(this.moveDownBtn_Click);
         //
         // deleteBtn
         //
         this.deleteBtn.Dock = System.Windows.Forms.DockStyle.Top;
         this.deleteBtn.FlatStyle = System.Windows.Forms.FlatStyle.System;
         this.deleteBtn.Font = new System.Drawing.Font("Tahoma", 8F);
         this.deleteBtn.Location = new System.Drawing.Point(391, 31);
         this.deleteBtn.Name = "deleteBtn";
         this.deleteBtn.Size = new System.Drawing.Size(54, 22);
         this.deleteBtn.TabIndex = 6;
         this.deleteBtn.Text = "Delete";
         this.deleteBtn.UseVisualStyleBackColor = true;
         this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click);
         //
         // outlinerGroupBox1
         //
         this.outlinerGroupBox1.BorderColor = System.Drawing.Color.Black;
         this.outlinerGroupBox1.Controls.Add(this.tableLayoutPanel2);
         this.outlinerGroupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
         this.outlinerGroupBox1.Location = new System.Drawing.Point(0, 0);
         this.outlinerGroupBox1.Name = "outlinerGroupBox1";
         this.outlinerGroupBox1.Size = new System.Drawing.Size(454, 399);
         this.outlinerGroupBox1.TabIndex = 7;
         this.outlinerGroupBox1.TabStop = false;
         this.outlinerGroupBox1.Text = "Context-Menu";
         //
         // ContextMenuModelEditor
         //
         this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
         this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
         this.Controls.Add(this.outlinerGroupBox1);
         this.Name = "ContextMenuModelEditor";
         this.Size = new System.Drawing.Size(454, 399);
         this.tableLayoutPanel2.ResumeLayout(false);
         this.outlinerGroupBox1.ResumeLayout(false);
         this.ResumeLayout(false);

      }

      #endregion

      private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
      private System.Windows.Forms.ComboBox itemsComboBox;
      private System.Windows.Forms.Button addBtn;
      private Tree.TreeView itemTree;
      private System.Windows.Forms.PropertyGrid itemPropertyGrid;
      private System.Windows.Forms.Button moveUpBtn;
      private System.Windows.Forms.Button moveDownBtn;
      private System.Windows.Forms.Button deleteBtn;
      private OutlinerGroupBox outlinerGroupBox1;
   }
}


text:
<link rel="import" href="../vendor/polymer/polymer.html">
<link rel="import" href="../vendor/font-roboto/roboto.html">
<link rel="import" href="../vendor/core-toolbar/core-toolbar.html">
<link rel="import" href="../vendor/core-menu/core-menu.html">
<link rel="import" href="../vendor/core-item/core-item.html">
<link rel="import" href="../vendor/core-header-panel/core-header-panel.html">
<link rel="import" href="../vendor/core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../vendor/core-scaffold/core-scaffold.html">

<polymer-element name="app-main">
  <template>
    <link rel="stylesheet" href="app-main.css">
    <core-scaffold>
      <core-header-panel navigation flex>
        <core-toolbar id="navheader">
          Menu
        </core-toolbar>
        <core-menu>
          <core-item label="One"></core-item>
          <core-item label="Two"></core-item>
        </core-menu>
      </core-header-panel>

      Title

Hello WebApplate

    </core-scaffold>
  </template>

</polymer-element>


text:
using testing::_;
using testing::InvokeWithoutArgs;

namespace video_capture {

static const size_t kArbitraryDummyBufferSize = 8u;
static const int kArbitraryBufferId = 123;
static const int kArbitraryFrameFeedbackId = 456;

class BroadcastingReceiverTest : public ::testing::Test {
 public:
  void SetUp() override {
    mojo::PendingRemote<mojom::VideoFrameHandler> video_frame_handler_1;
    mojo::PendingRemote<mojom::VideoFrameHandler> video_frame_handler_2;
    mock_video_frame_handler_1_ = std::make_unique<MockVideoFrameHandler>(
        video_frame_handler_1.InitWithNewPipeAndPassReceiver());
    mock_video_frame_handler_2_ = std::make_unique<MockVideoFrameHandler>(
        video_frame_handler_2.InitWithNewPipeAndPassReceiver());
    client_id_1_ =
        broadcaster_.AddClient(std::move(video_frame_handler_1),
                               media::VideoCaptureBufferType::kSharedMemory);
    client_id_2_ =
        broadcaster_.AddClient(std::move(video_frame_handler_2),
                               media::VideoCaptureBufferType::kSharedMemory);

    shm_region_ =
        base::UnsafeSharedMemoryRegion::Create(kArbitraryDummyBufferSize);
    ASSERT_TRUE(shm_region_.IsValid());
    media::mojom::VideoBufferHandlePtr buffer_handle =
        media::mojom::VideoBufferHandle::NewUnsafeShmemRegion(
            std::move(shm_region_));
    broadcaster_.OnNewBuffer(kArbitraryBufferId, std::move(buffer_handle));
  }

  FakeVideoFrameAccessHandler* CreateAndSendFakeVideoFrameAccessHandler() {
    mojo::PendingRemote<mojom::VideoFrameAccessHandler> pending_remote;
    auto frame_access_handler =
        mojo::MakeSelfOwnedReceiver<mojom::VideoFrameAccessHandler>(
            std::make_unique<FakeVideoFrameAccessHandler>(),
            pending_remote.InitWithNewPipeAndPassReceiver());
    broadcaster_.OnFrameAccessHandlerReady(std::move(pending_remote));
    return static_cast<FakeVideoFrameAccessHandler*>(
        frame_access_handler->impl());
  }

 protected:
  BroadcastingReceiver broadcaster_;
  std::unique_ptr<MockVideoFrameHandler> mock_video_frame_handler_1_;
  std::unique_ptr<MockVideoFrameHandler> mock_video_frame_handler_2_;
  int32_t client_id_1_;
  int32_t client_id_2_;
  base::UnsafeSharedMemoryRegion shm_region_;
  base::test::TaskEnvironment task_environment_;
};

TEST_F(
    BroadcastingReceiverTest,
    HoldsOnToAccessPermissionForRetiredBufferUntilLastClientFinishedConsuming) {
  FakeVideoFrameAccessHandler* frame_access_handler =
      CreateAndSendFakeVideoFrameAccessHandler();

  base::RunLoop frame_arrived_at_video_frame_handler_1;
  base::RunLoop frame_arrived_at_video_frame_handler_2;
  EXPECT_CALL(*mock_video_frame_handler_1_, DoOnFrameReadyInBuffer(_, _, _))
      .WillOnce(InvokeWithoutArgs([&frame_arrived_at_video_frame_handler_1]() {
        frame_arrived_at_video_frame_handler_1.Quit();
      }));
  EXPECT_CALL(*mock_video_frame_handler_2_, DoOnFrameReadyInBuffer(_, _, _))
      .WillOnce(InvokeWithoutArgs([&frame_arrived_at_video_frame_handler_2]() {
        frame_arrived_at_video_frame_handler_2.Quit();
      }));
  mock_video_frame_handler_1_->HoldAccessPermissions();
  mock_video_frame_handler_2_->HoldAccessPermissions();

  media::mojom::VideoFrameInfoPtr frame_info =
      media::mojom::VideoFrameInfo::New();
  broadcaster_.OnFrameReadyInBuffer(
      mojom::ReadyFrameInBuffer::New(
          kArbitraryBufferId, kArbitraryFrameFeedbackId, std::move(frame_info)),
      {});

  // mock_video_frame_handler_1_ finishes consuming immediately.
  // mock_video_frame_handler_2_ continues consuming.
  frame_arrived_at_video_frame_handler_1.Run();
  frame_arrived_at_video_frame_handler_2.Run();

  base::RunLoop buffer_retired_arrived_at_video_frame_handler_1;
  base::RunLoop buffer_retired_arrived_at_video_frame_handler_2;
  EXPECT_CALL(*mock_video_frame_handler_1_, DoOnBufferRetired(_))
      .WillOnce(InvokeWithoutArgs(
          [&buffer_retired_arrived_at_video_frame_handler_1]() {
            buffer_retired_arrived_at_video_frame_handler_1.Quit();
          }));
  EXPECT_CALL(*mock_video_frame_handler_2_, DoOnBufferRetired(_))
      .WillOnce(InvokeWithoutArgs(
          [&buffer_retired_arrived_at_video_frame_handler_2]() {
            buffer_retired_arrived_at_video_frame_handler_2.Quit();
          }));

  // Retiring the buffer results in both receivers getting the retired event.
  broadcaster_.OnBufferRetired(kArbitraryBufferId);
  buffer_retired_arrived_at_video_frame_handler_1.Run();
  buffer_retired_arrived_at_video_frame_handler_2.Run();
  base::RunLoop().RunUntilIdle();

  // Despite retiring, the access to the buffer is not released because it is
  // still in use by both handlers.
  EXPECT_TRUE(frame_access_handler->released_buffer_ids().empty());

  // mock_video_frame_handler_2_ finishes consuming. Access is still not
  // released because of mock_video_frame_handler_1_.
  mock_video_frame_handler_2_->ReleaseAccessedFrames();
  base::RunLoop().RunUntilIdle();
  EXPECT_TRUE(frame_access_handler->released_buffer_ids().empty());

  // mock_video_frame_handler_1_ finishes consuming. Now the buffer is finally
  // released.
  mock_video_frame_handler_1_->ReleaseAccessedFrames();
  base::RunLoop().RunUntilIdle();
  EXPECT_FALSE(frame_access_handler->released_buffer_ids().empty());
}

TEST_F(BroadcastingReceiverTest,
       DoesNotHoldOnToAccessPermissionWhenAllClientsAreSuspended) {
  FakeVideoFrameAccessHandler* frame_access_handler =
      CreateAndSendFakeVideoFrameAccessHandler();

  EXPECT_CALL(*mock_video_frame_handler_1_, DoOnFrameReadyInBuffer(_, _, _))
      .Times(0);
  EXPECT_CALL(*mock_video_frame_handler_2_, DoOnFrameReadyInBuffer(_, _, _))
      .Times(0);
  mock_video_frame_handler_1_->HoldAccessPermissions();
  mock_video_frame_handler_2_->HoldAccessPermissions();

  broadcaster_.SuspendClient(client_id_1_);
  broadcaster_.SuspendClient(client_id_2_);

  broadcaster_.OnFrameReadyInBuffer(
      mojom::ReadyFrameInBuffer::New(kArbitraryBufferId,
                                     kArbitraryFrameFeedbackId,
                                     media::mojom::VideoFrameInfo::New()),
      {});

  // Because the clients are suspended, frames are automatically released.
  base::RunLoop().RunUntilIdle();
  EXPECT_FALSE(frame_access_handler->released_buffer_ids().empty());
  frame_access_handler->ClearReleasedBufferIds();

  // Resume one of the clients and pass another frame.
  broadcaster_.ResumeClient(client_id_2_);
  EXPECT_CALL(*mock_video_frame_handler_2_, DoOnFrameReadyInBuffer(_, _, _))
      .Times(1);
  broadcaster_.OnFrameReadyInBuffer(
      mojom::ReadyFrameInBuffer::New(kArbitraryBufferId,
                                     kArbitraryFrameFeedbackId,
                                     media::mojom::VideoFrameInfo::New()),
      {});

  // This time the buffer is not released automatically.
  base::RunLoop().RunUntilIdle();
  EXPECT_TRUE(frame_access_handler->released_buffer_ids().empty());

  // Releasing mock_video_frame_handler_2_'s frame is sufficient for the buffer
  // to be released since the frame was never delivered to
  // mock_video_frame_handler_1_.
  mock_video_frame_handler_2_->ReleaseAccessedFrames();
  base::RunLoop().RunUntilIdle();
  EXPECT_FALSE(frame_access_handler->released_buffer_ids().empty());
}

TEST_F(BroadcastingReceiverTest, ForwardsScaledFrames) {
  const int kBufferId = 10;
  const int kScaledBufferId = 11;

  FakeVideoFrameAccessHandler* frame_access_handler =
      CreateAndSendFakeVideoFrameAccessHandler();
  mock_video_frame_handler_1_->HoldAccessPermissions();

  media::mojom::VideoBufferHandlePtr buffer_handle =
      media::mojom::VideoBufferHandle::NewUnsafeShmemRegion(
          base::UnsafeSharedMemoryRegion::Create(kArbitraryDummyBufferSize));
  broadcaster_.OnNewBuffer(kBufferId, std::move(buffer_handle));

  media::mojom::VideoBufferHandlePtr scaled_buffer_handle =
      media::mojom::VideoBufferHandle::NewUnsafeShmemRegion(
          base::UnsafeSharedMemoryRegion::Create(kArbitraryDummyBufferSize));
  broadcaster_.OnNewBuffer(kScaledBufferId, std::move(scaled_buffer_handle));

  // Suspend the second client so that the first client alone controls buffer
  // access.
  broadcaster_.SuspendClient(client_id_2_);

  base::RunLoop on_buffer_ready;
  EXPECT_CALL(*mock_video_frame_handler_1_, DoOnFrameReadyInBuffer(_, _, _))
      .WillOnce(
          InvokeWithoutArgs([&on_buffer_ready]() { on_buffer_ready.Quit(); }));

  mojom::ReadyFrameInBufferPtr ready_buffer =
      mojom::ReadyFrameInBuffer::New(kBufferId, kArbitraryFrameFeedbackId,
                                     media::mojom::VideoFrameInfo::New());

  std::vector<mojom::ReadyFrameInBufferPtr> scaled_ready_buffers;
  scaled_ready_buffers.push_back(
      mojom::ReadyFrameInBuffer::New(kScaledBufferId, kArbitraryFrameFeedbackId,
                                     media::mojom::VideoFrameInfo::New()));

  broadcaster_.OnFrameReadyInBuffer(std::move(ready_buffer),
                                    std::move(scaled_ready_buffers));
  on_buffer_ready.Run();
  EXPECT_TRUE(frame_access_handler->released_buffer_ids().empty());

  // Releasing the handler's buffers releases both frame and scaled frame.
  mock_video_frame_handler_1_->ReleaseAccessedFrames();
  base::RunLoop().RunUntilIdle();
  EXPECT_EQ(frame_access_handler->released_buffer_ids().size(), 2u);

  // Scaled buffers also get retired.
  base::RunLoop on_both_buffers_retired;
  size_t num_buffers_retired = 0u;
  EXPECT_CALL(*mock_video_frame_handler_1_, DoOnBufferRetired(_))
      .WillRepeatedly(
          InvokeWithoutArgs([&on_both_buffers_retired, &num_buffers_retired]() {
            ++num_buffers_retired;
            if (num_buffers_retired == 2u)
              on_both_buffers_retired.Quit();
          }));
  broadcaster_.OnBufferRetired(kBufferId);
  broadcaster_.OnBufferRetired(kScaledBufferId);
  on_both_buffers_retired.Run();
}

TEST_F(BroadcastingReceiverTest, AccessPermissionsSurviveStop) {
  // For simplicitly, we only care about the first client in this test.
  broadcaster_.SuspendClient(client_id_2_);
  broadcaster_.OnStarted();

  // In this test, two frame handlers are used. In order to inspect all frame
  // IDs that have released after the first handler is destroyed, released
  // buffer IDs are stored in |released_buffer_ids|.
  std::vector<int32_t> released_buffer_ids;
  base::RepeatingCallback<void(int32_t)> buffer_released_callback =
      base::BindRepeating(
          [](std::vector<int32_t>* released_buffer_ids, int32_t buffer_id) {
            released_buffer_ids->push_back(buffer_id);
          },
          base::Unretained(&released_buffer_ids));
  mock_video_frame_handler_1_->HoldAccessPermissions();

  {
    mojo::PendingRemote<mojom::VideoFrameAccessHandler>
        frame_access_handler_proxy;
    auto frame_access_handler =
        mojo::MakeSelfOwnedReceiver<mojom::VideoFrameAccessHandler>(
            std::make_unique<FakeVideoFrameAccessHandler>(
                buffer_released_callback),
            frame_access_handler_proxy.InitWithNewPipeAndPassReceiver());
    broadcaster_.OnFrameAccessHandlerReady(
        std::move(frame_access_handler_proxy));
  }

  EXPECT_CALL(*mock_video_frame_handler_1_, DoOnFrameReadyInBuffer(_, _, _))
      .Times(1);
  broadcaster_.OnFrameReadyInBuffer(
      mojom::ReadyFrameInBuffer::New(kArbitraryBufferId,
                                     kArbitraryFrameFeedbackId,
                                     media::mojom::VideoFrameInfo::New()),
      {});
  base::RunLoop().RunUntilIdle();

  // The first frame has not been released yet.
  EXPECT_TRUE(released_buffer_ids.empty());

  // Simulate a device restart.
  broadcaster_.OnStopped();
  broadcaster_.OnStarted();
  FakeVideoFrameAccessHandler* second_device_frame_access_handler;
  {
    mojo::PendingRemote<mojom::VideoFrameAccessHandler>
        frame_access_handler_proxy;
    auto frame_access_handler =
        mojo::MakeSelfOwnedReceiver<mojom::VideoFrameAccessHandler>(
            std::make_unique<FakeVideoFrameAccessHandler>(
                buffer_released_callback),
            frame_access_handler_proxy.InitWithNewPipeAndPassReceiver());
    broadcaster_.OnFrameAccessHandlerReady(
        std::move(frame_access_handler_proxy));
    second_device_frame_access_handler =
        static_cast<FakeVideoFrameAccessHandler*>(frame_access_handler->impl());
  }
  base::RunLoop().RunUntilIdle();

  // The first frame has still not been released yet.
  EXPECT_TRUE(released_buffer_ids.empty());

  // Receive another frame after device restart.
  base::UnsafeSharedMemoryRegion shm_region2 =
      base::UnsafeSharedMemoryRegion::Create(kArbitraryDummyBufferSize);
  ASSERT_TRUE(shm_region2.IsValid());
  media::mojom::VideoBufferHandlePtr buffer_handle2 =
      media::mojom::VideoBufferHandle::NewUnsafeShmemRegion(
          std::move(shm_region2));
  broadcaster_.OnNewBuffer(kArbitraryBufferId + 1, std::move(buffer_handle2));
  EXPECT_CALL(*mock_video_frame_handler_1_, DoOnFrameReadyInBuffer(_, _, _))
      .Times(1);
  broadcaster_.OnFrameReadyInBuffer(
      mojom::ReadyFrameInBuffer::New(kArbitraryBufferId + 1,
                                     kArbitraryFrameFeedbackId + 1,
                                     media::mojom::VideoFrameInfo::New()),
      {});
  base::RunLoop().RunUntilIdle();

  // Neither frame has been released.
  EXPECT_TRUE(released_buffer_ids.empty());

  // Release all frames. This should inform both the old and the new handler.
  mock_video_frame_handler_1_->ReleaseAccessedFrames();
  base::RunLoop().RunUntilIdle();

  // Both buffers should now be released.
  EXPECT_EQ(released_buffer_ids.size(), 2u);
  // The first buffer was released by the first handler, which now no longer
  // exist. The second buffer was released by the second handler so we can
  // EXPECT it to only have observed a single frame release event.
  EXPECT_EQ(second_device_frame_access_handler->released_buffer_ids().size(),
            1u);
}

}  // namespace video_capture


text:
package guru.nidi.tools;

import com.jcraft.jsch.Session;
import org.apache.tools.ant.*;
import org.apache.tools.ant.taskdefs.optional.ssh.SSHBase;

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

/**
 * Creates an SSH tunnel that nested tasks can utilize to perform tasks on remote hosts.
 *
 * @author Mike Elmsly mike.elmsly@ihug.co.nz
 * @version $Revision: 1.0 $
 * @since Ant 1.6.1
 */
public class SSHTunnel extends SSHBase implements TaskContainer {
    private String rhost, lport, rport;
    private long maxwait = 0;
    private final List<Task> nestedTasks = new ArrayList<>();

    public void execute() throws BuildException {
        validateArguments();

        Session session = null;
        try {
            session = startSession();
            executeNestedTasks();
        } finally {
            closeSession(session);
        }
    }

    private void validateArguments() {
        if (getHost() == null) {
            throw new BuildException("Host is required.");
        }
        if (getUserInfo().getName() == null) {
            throw new BuildException("Username is required.");
        }
        if (getUserInfo().getKeyfile() == null && getUserInfo().getPassword() == null) {
            throw new BuildException("Password or Keyfile is required.");
        }
        if (getRhost() == null || getLport() == null || getRport() == null) {
            throw new BuildException("Tunnel information is required. \n Either rhost, lport or rport is not set.");
        }
    }

    private Session startSession() {
        try {
            Session session = openSession();
            session.setTimeout((int) maxwait);
            session.setPortForwardingL(Integer.parseInt(lport), rhost, Integer.parseInt(rport));
            log("SSHTunnel : Connection created successfully.", Project.MSG_INFO);
            return session;
        } catch (Exception e) {
            log("SSHTunnel : Connect Failed", Project.MSG_ERR);
            throw new BuildException("SSHTunnel Task Failed: Unable to create tunnel", e);
        }
    }

    private void executeNestedTasks() throws BuildException {
        try {
            for (Task task : nestedTasks) {
                unwrap(task).perform();
            }
        } catch (Exception e) {
            throw new BuildException(e);
        }
    }

    private Task unwrap(Task task) {
        if (task instanceof UnknownElement) {
            task.maybeConfigure();
            task = ((UnknownElement) task).getTask();
        }
        return task != null
                ? task
                : new Task() {
        };
    }

    private void closeSession(Session session) {
        try {
            log("Attempting Disconnect", Project.MSG_ERR);
            if (session != null) {
                session.disconnect();
            } else {
                log("Session is null", Project.MSG_ERR);
            }
        } catch (Exception e) {
            log("SSHTunnel Disconnect Failed", Project.MSG_ERR);
        }
    }

    public void addTask(Task task) throws BuildException {
        this.nestedTasks.add(task);
    }

    public String getRhost() {
        return rhost;
    }

    public void setRhost(String rhost) {
        this.rhost = rhost;
    }

    public String getLport() {
        return lport;
    }

    public void setLport(String lport) {
        this.lport = lport;
    }

    public String getRport() {
        return rport;
    }

    public void setRport(String rport) {
        this.rport = rport;
    }

    public long getMaxwait() {
        return maxwait;
    }

    public void setMaxwait(long maxwait) {
        this.maxwait = maxwait;
    }
}


text:
from verta._swagger.base_type import BaseType

class ModeldbGetAllDatasetsResponse(BaseType):
  def __init__(self, datasets=None, total_records=None):
    required = {
      "datasets": False,
      "total_records": False,
    }
    self.datasets = datasets
    self.total_records = total_records

    for k, v in required.items():
      if self[k] is None and v:
        raise ValueError('attribute {} is required'.format(k))

  @staticmethod
  def from_json(d):
    from .ModeldbDataset import ModeldbDataset

    tmp = d.get('datasets', None)
    if tmp is not None:
      d['datasets'] = [ModeldbDataset.from_json(tmp) for tmp in tmp]
    tmp = d.get('total_records', None)
    if tmp is not None:
      d['total_records'] = tmp

    return ModeldbGetAllDatasetsResponse(**d)


text:
package hamt64

//POPCNT Implementation
// copied from https://github.com/jddixon/xlUtil_go/blob/master/popCount.go
//  was MIT License

const (
	hexiFives  = uint64(0x5555555555555555)
	hexiThrees = uint64(0x3333333333333333)
	hexiOnes   = uint64(0x0101010101010101)
	hexiFs     = uint64(0x0f0f0f0f0f0f0f0f)
)

// The bitCount64() function is a software based implementation of the POPCNT
// instruction. It returns the number of bits set in a uint64 word.
//
// This is copied from https://github.com/jddixon/xlUtil_go/blob/master/popCount.go
func bitCount64(n uint64) uint {
	n = n - ((n >> 1) & hexiFives)
	n = (n & hexiThrees) + ((n >> 2) & hexiThrees)
	return uint((((n + (n >> 4)) & hexiFs) * hexiOnes) >> 56)
}


text:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.aidanvii.androidcollectionwrapper">

    <application android:allowBackup="true"
                 android:label="@string/app_name"
                 android:supportsRtl="true"
    >

    </application>

</manifest>


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string-array name="charsetsArray">
        <item>@string/array_default</item>
        <item>ISO_8859_1</item>
        <item>US_ASCII</item>
    </string-array>
    <string-array name="charsetsValues">
        <item>1</item>
        <item>2</item>
        <item>3</item>
    </string-array>
</resources>


text:
特定の問題で立ち往生していますか? よくある質問でこれらのよくある問題のいくつかを最初に確認してください。

If you still can't find what you're looking for, you can ask the community in [Spectrum](https://spectrum.chat/material-ui). 使い方の質問やその他重要ではない問題は、Github issuesではなく[StackOverflow](https://stackoverflow.com/questions/tagged/material-ui)を使ってください。 `material-ui`というStackOverflowタグがあります。 質問にはそのタグをつけてください。

## productionビルドでコンポーネントが正しくレンダリングされないのはなぜですか?

これは、コードがproduction bundleに入った後にクラス名が競合するために発生する可能性があるn°1の問題です。 Material-UIが機能するためには、`className`ページ上のすべてのコンポーネントの値は、[クラス名ジェネレータ](/styles/advanced/#class-names)の単一インスタンスによって生成される必要があります。

この問題を解決するには、ページ上のすべてのコンポーネントを初期化して、それらの間の**クラス名ジェネレータが1つだけ**存在するようにする必要があります。

さまざまなシナリオで、誤って2つのクラス名ジェネレータを使用することになる事例

- 誤ってMaterial-UIの2つのバージョンを**bundle**してしまっている場合、 依存関係がMaterial-UIを対の依存関係として正しく設定されていない可能性があります
- Reactツリーの**サブセット**に`StylesProvider`を使用している場合
- You are using a bundler and it is splitting code in a way that causes multiple class name generator instances to be created.

> If you are using webpack with the [SplitChunksPlugin](https://webpack.js.org/plugins/split-chunks-plugin/), try configuring the [`runtimeChunk` setting under `optimizations`](https://webpack.js.org/configuration/optimization/#optimization-runtimechunk).

全体として、各Material-UIアプリケーションをコンポーネントツリーの最上部にある[`StylesProvider`](/styles/api/#stylesprovider)コンポーネントでWrapし、**コンポーネントツリー間で共有される単一のクラス名ジェネレータを使用することで**、この問題を簡単に解決できます。

## モーダルを開くと、fixed positionされたDOMが移動するのはなぜですか?

モーダルが開かれるとすぐにスクロールをブロックします。 モーダルが唯一のインタラクティブなコンテンツであるべき場合、backgroundとの連動を防ぎます。しかし、スクロールバーを取り除くことで**fixed positionされたDOM**を動かすことができます。 この場合、Material-UIにこれらのDOMを処理するように伝えるために、グローバルな `.mui-fixed`クラス名を適用することができます。

## 波紋アニメーションをグローバルに無効にする方法は?

波紋アニメーションは、BaseButtonコンポーネントからのみ発生しています。 テーマに次のように指定することで、波紋アニメーションをグローバルに無効にすることができます。

```js
import { createMuiTheme } from '@material-ui/core';

const theme = createMuiTheme({
  props: {
    // Name of the component ⚛
    MuiButtonBase: {
      // The properties to apply
      disableRipple: true, // No more ripple, on the whole application
    },
  },
});
```

## How can I disable transitions globally?

You can disable transitions globally by providing the following in your theme:

```js
import { createMuiTheme } from '@material-ui/core';

const theme = createMuiTheme({
  transitions: {
    // So we have `transition: none;` everywhere
    create: () => 'none',
  },
});
```

テスト中やローエンドデバイスなどで、条件付きでこの動作を有効にしたい場合があります。この場合は、テーマの値を動的に変更できます。

You can go one step further by disabling all the transitions, animations and the ripple effect:

```js
import { createMuiTheme } from '@material-ui/core';

const theme = createMuiTheme({
  transitions: {
    // So we have `transition: none;` everywhere
    create: () => 'none',
  },
  overrides: {
    // Name of the component ⚛
    CssBasline: {
      // Name of the rule
      '@global': {
        '*, *::before, *::after': {
          transition: 'none !important',
          animation: 'none !important',
        },
      },
    },
  },
  props: {
    // Name of the component ⚛
    MuiButtonBase: {
      // The properties to apply
      disableRipple: true, // No more ripple, on the whole application!
    },
  },
});
```

## アプリのスタイルを設定するにはJSSを使用する必要がありますか?

It's recommended:

- ビルトインのため、追加のbundleサイズのオーバーヘッドはありません
- 速い & メモリ効率が良い
- 明瞭で一貫性のあるAPI
- ネイティブでもプラグインでも、多くの高度な機能をサポートします。

しかし、おそらくすでに別のスタイルライブラリを使用してアプリケーションにいくつかのMaterial-UIコンポーネントを追加している、 またはすでに別のAPIを使用している場合には、新しいものを学びたくはないでしょう? その場合は、[スタイルライブラリの相互運用](/guides/interoperability/)セクションで、Material-UIコンポーネントを別のスタイルのライブラリでスタイル変更することがいかに簡単であるかを示します。

## When should I use inline-style vs CSS?

経験則として、動的styleプロパティにはinline-styleのみを使用してください。 CSSの代替手段は、次のようなより多くの利点を提供します。

- auto-prefixing
- デバックのしやすさ
- メディアクエリ
- keyframes

## react-routerの使い方は?

私達は[サードパーティ製ルーティングライブラリ](/components/buttons/#third-party-routing-library)で`ButtonBase`コンポーネントの使い方をドキュメント化しました。 A lot of our interactive components use it internally: `Link`, `Button`, `MenuItem`, `<ListItem button />`, `Tab`, etc. それらの例を参考にしてください。

## どうやってDOM要素にアクセスできますか?

All Material-UI components that should render something in the DOM forward their ref to the underlying DOM component. This means that you can get DOM elements by reading the ref attached to Material-UI components:

```jsx
// or a ref setter function
const ref = React.createRef();
// render
<Button ref={ref} />;
// usage
const element = ref.current;
```

If you're not sure if the Material-UI component in question forwards its ref you can check the API documentation under "Props" e.g. the [/api/button/#props](Button API) includes

> The ref is forwarded to the root element.

indicating that you can access the DOM element with a ref.

## I have several instances of styles on the page

If you are seeing a warning message in the console like the one below, you probably have several instances of `@material-ui/styles` initialized on the page.

> It looks like there are several instances of `@material-ui/styles` initialized in this application. This may cause theme propagation issues, broken class names and makes your application bigger without a good reason.

### Possible reasons

There are several common reasons for this to happen:

- You have another `@material-ui/styles` library somewhere in your dependencies.
- You have a monorepo structure for your project (e.g, lerna, yarn workspaces) and `@material-ui/styles` module is a dependency in more than one package (this one is more or less the same as the previous one).
- You have several applications that are using `@material-ui/styles` running on the same page (e.g., several entry points in webpack are loaded on the same page).

### Duplicated module in node_modules

If you think that the issue is in duplicated @material-ui/styles module somewhere in your dependencies, there are several ways to check this. You can use `npm ls @material-ui/styles`, `yarn list @material-ui/styles` or `find -L ./node_modules | grep /@material-ui/styles/package.json` commands in your application folder.

If none of these commands identified the duplication, try analyzing your bundle for multiple instances of @material-ui/styles. You can just check your bundle source, or use a tool like [source-map-explorer](https://github.com/danvk/source-map-explorer) or [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer).

If you identified that duplication is the issue that you are encountering there are several things you can try to solve it:

If you are using npm you can try running `npm dedupe`. This command searches the local dependencies and tries to simplify the structure by moving common dependencies further up the tree.

If you are using webpack, you can change the way it will [resolve](https://webpack.js.org/configuration/resolve/#resolve-modules) the @material-ui/styles module. You can overwrite the default order in which webpack will look for your dependencies and make your application node_modules more prioritized than default node module resolution order:

```diff
  resolve: {
+   alias: {
+     "@material-ui/styles": path.resolve(appFolder, "node_modules", "@material-ui/styles"),
+   }
  }
```

### Usage with Lerna

One possible fix to get @material-ui/styles to run in a Lerna monorepo across packages, is to [hoist](https://github.com/lerna/lerna/blob/master/doc/hoist.md) shared dependencies to the root of your monorepo file. Try running the bootstrap option with the --hoist flag.

```sh
lerna bootstrap --hoist
```

Alternatively, you can remove @material-ui/styles from your package.json file and hoist it manually to your top-level package.json file.

Example of a package.json file in a Lerna root folder

```json
{
  "name": "my-monorepo",
  "devDependencies": {
    "lerna": "latest"
  },
  "dependencies": {
    "@material-ui/styles": "^4.0.0"
  },
  "scripts": {
    "bootstrap": "lerna bootstrap",
    "clean": "lerna clean",
    "start": "lerna run start",
    "build": "lerna run build"
  }
}
```

### Running multiple applications on one page

If you have several applications running on one page, consider using one @material-ui/styles module for all of them. If you are using webpack, you can use [CommonsChunkPlugin](https://webpack.js.org/plugins/commons-chunk-plugin/) to create an explicit [vendor chunk](https://webpack.js.org/plugins/commons-chunk-plugin/#explicit-vendor-chunk), that will contain the @material-ui/styles module:

```diff
  module.exports = {
    entry: {
+     vendor: ["@material-ui/styles"],
      app1: "./src/app.1.js",
      app2: "./src/app.2.js",
    },
    plugins: [
+     new webpack.optimize.CommonsChunkPlugin({
+       name: "vendor",
+       minChunks: Infinity,
+     }),
    ]
  }
```

## My App doesn't render correctly on the server

If it doesn't work, in 99% of cases it's a configuration issue. A missing property, a wrong call order, or a missing component. We are very strict about configuration, and the best way to find out what's wrong is to compare your project to an already working setup, check out our [reference implementations](/guides/server-rendering/#reference-implementations), bit by bit.

### CSS works only on first load then is missing

The CSS is only generated on the first load of the page. Then, the CSS is missing on the server for consecutive requests.

#### Action to Take

We rely on a cache, the sheets manager, to only inject the CSS once per component type (if you use two buttons, you only need the CSS of the button one time). You need to create **a new `sheets` instance for each request**.

*example of fix:*

```diff
-// Create a sheets instance.
-const sheets = new ServerStyleSheets();

function handleRender(req, res) {

+ // Create a sheets instance.
+ const sheets = new ServerStyleSheets();

  //…

  // Render the component to a string.
  const html = ReactDOMServer.renderToString(
```

### React class name hydration mismatch

There is a class name mismatch between the client and the server. It might work for the first request. Another symptom is that the styling changes between initial page load and the downloading of the client scripts.

#### Action to Take

The class names value relies on the concept of [class name generator](/styles/advanced/#class-names). The whole page needs to be rendered with **a single generator**. This generator needs to behave identically on the server and on the client. For instance:

- You need to provide a new class name generator for each request. But you shouldn't share a `createGenerateClassName()` between different requests:

*example of fix:*

```diff
-// Create a new class name generator.
-const generateClassName = createGenerateClassName();

function handleRender(req, res) {

+ // Create a new class name generator.
+ const generateClassName = createGenerateClassName();

  //…

  // Render the component to a string.
  const html = ReactDOMServer.renderToString(
```

- You need to verify that your client and server are running the **exactly the same version** of Material-UI. It is possible that a mismatch of even minor versions can cause styling problems. To check version numbers, run `npm list @material-ui/core` in the environment where you build your application and also in your deployment environment.

    You can also ensure the same version in different environments by specifying a specific MUI version in the dependencies of your package.json.

*example of fix (package.json):*

```diff
  "dependencies": {
    ...

-   "@material-ui/core": "^4.0.0",
+   "@material-ui/core": "4.0.0",
    ...
  },
```

- You need to make sure that the server and the client share the same `process.env.NODE_ENV` value.

## 私が見ている色とこのサイトで見ている色が違うのはなぜですか?

ドキュメントサイトはカスタムテーマを使用しています。 したがって、カラーパレットがあるMaterial-UIが提供しているデフォルトのテーマは異なります。 テーマのカスタマイズについて学ぶには、この[ページ](/customization/themes/)を参照してください。

## Material-UIは最高です。 プロジェクトを支援するにはどのようにできますか?

Material-UIをサポートする方法はたくさんあります。

- [ドキュメント](https://github.com/mui-org/material-ui/tree/master/docs)を改善する
- 他の人が始めるのを手伝う
- [ライブラリを布教する](https://twitter.com/MaterialUI)
- [StackOverflow](https://stackoverflow.com/questions/tagged/material-ui)や[Spectrum](https://spectrum.chat/material-ui)で質問に答える

商用プロジェクトでMaterial-UIを使用していて、スポンサーになることによってその継続的な開発を支援したい場合は、 あるいはサブや趣味のプロジェクトで**スポンサー**になりたい場合は、[OpenCollective](https://opencollective.com/material-ui)を使って行うことができます。

集められた資金はすべて透過的に管理され、スポンサーはREADMEとMaterial-UIのホームページで表彰されます。

## Why does component X require a DOM node in a prop instead of a ref object?

Components like the [Portal](/api/portal/#props) or [Popper](/api/popper/#props) require a DOM node in the `container` or `anchorEl` prop respectively. It seems convenient to simply pass a ref object in those props and let Material-UI access the current value. This works in a simple scenario:

```jsx
function App() {
  const container = React.useRef(null);

  return (
    <div className="App">
      <Portal container={container}>
        <span>portaled children</span>
      </Portal>
      <div ref={container} />
    </div>
  );
}
```

where `Portal` would only mount the children into the container when `container.current` is available. Here is a naive implementation of Portal:

```jsx
function Portal({ children, container }) {
  const [node, setNode] = React.useState(null);

  React.useEffect(() => {
    setNode(container.current);
  }, [container]);

  if (node === null) {
    return null;
  }
  return ReactDOM.createPortal(children, node);
}
```

With this simple heuristic `Portal` might re-render after it mounts because refs are up-to-date before any effects run. However, just because a ref is up-to-date doesn't mean it points to a defined instance. If the ref is attached to a ref forwarding component it is not clear when the DOM node will be available. In the above example the `Portal` would run run an effect once but might not re-render because `ref.current` is still `null`. This is especially apparent for React.lazy components in Suspense. The above implementation could also not account for a change in the DOM node.

This is why we require a prop with the actual DOM node so that React can take care of determining when the `Portal` should re-render:

```jsx
function App() {
  const [container, setContainer] = React.useState(null);
  const handleRef = React.useCallback(instance => setContainer(instance), [setContainer])

  return (
    <div className="App">
      <Portal container={container}>
        <span>Portaled</span>
      </Portal>
      <div ref={handleRef} />
    </div>
  );
}
```


text:
package fr.polytech.myrpg.characters;

import fr.polytech.myrpg.characters.exceptions.InvalidConstraintsException;
import fr.polytech.myrpg.characters.exceptions.TooHighCharacteristicsValueException;
import fr.polytech.myrpg.characters.exceptions.TooFewSpecialMovesException;
import fr.polytech.myrpg.characters.items.edible.Effect;
import fr.polytech.myrpg.characters.specialmove.SpecialMove;
import fr.polytech.myrpg.characters.specialmove.SpecialMoveType;

/**
 * This class represents a warrior.
 *
 * @author DELORME Loïc
 * @since 1.0.0
 */
public class Warrior extends Character
{
	/**
	 * Create a warrior.
	 *
	 * @param name
	 *            The name of the warrior.
	 * @throws TooHighCharacteristicsValueException
	 *             If the characteristics value is higher than expected : {@value #MAXIMAL_CHARACTERISTICS_VALUE}.
	 * @throws TooFewSpecialMovesException
	 *             If there is less than {@value #NB_SPECIAL_MOVES_REQUIRED} special moves.
	 * @throws InvalidConstraintsException
	 *             If constraints are invalid.
	 */
	public Warrior(String name) throws TooHighCharacteristicsValueException, TooFewSpecialMovesException, InvalidConstraintsException
	{
		super(name);
	}

	/**
	 * @see fr.polytech.myrpg.characters.Character#initializeCharacteristics()
	 */
	@Override
	public void initializeCharacteristics()
	{
		this.characteristics.put(Characteristic.STRENGTH, 40);
		this.characteristics.put(Characteristic.DEXTERITY, 20);
		this.characteristics.put(Characteristic.DEFENSE, 10);
	}

	/**
	 * @see fr.polytech.myrpg.characters.Character#initializeSpecialMoves()
	 */
	@Override
	public void initializeSpecialMoves()
	{
		this.specialMoves.add(new SpecialMove(0.25, SpecialMoveType.PARRY, null));
		this.specialMoves.add(new SpecialMove(0.08, SpecialMoveType.HEAL, new Effect(Characteristic.HEALTH, 75)));
		this.specialMoves.add(new SpecialMove(0.005, SpecialMoveType.HEAL, new Effect(Characteristic.HEALTH, 160)));
	}

	/**
	 * @see fr.polytech.myrpg.characters.Character#checkConstraints()
	 */
	@Override
	public void checkConstraints() throws InvalidConstraintsException
	{
		final int strengthValue = this.characteristics.get(Characteristic.STRENGTH);
		final int dexterityValue = this.characteristics.get(Characteristic.DEXTERITY);
		final int defenseValue = this.characteristics.get(Characteristic.DEFENSE);

		if (!((strengthValue >= (dexterityValue + 10)) && ((dexterityValue + 10) >= defenseValue)))
		{
			throw new InvalidConstraintsException("");
		}
	}
}


text: <dtml-var "picture.tag(border='5', align='left')">