text
stringlengths
2
99k
meta
dict
/* * /MathJax/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/Main.js * * Copyright (c) 2009-2018 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.MathJax_AMS={directory:"AMS/Regular",family:"MathJax_AMS",testString:"MATHJAX AMS \u02C6",Ranges:[[0,127,"BBBold"],[128,255,"Latin1Supplement"],[256,383,"LatinExtendedA"],[688,767,"SpacingModLetters"],[768,879,"CombDiacritMarks"],[880,1023,"GreekAndCoptic"],[8192,8303,"GeneralPunctuation"],[8448,8527,"LetterlikeSymbols"],[8592,8703,"Arrows"],[8704,8959,"MathOperators"],[8960,9215,"MiscTechnical"],[9312,9471,"EnclosedAlphanum"],[9472,9599,"BoxDrawing"],[9632,9727,"GeometricShapes"],[9728,9983,"MiscSymbols"],[9984,10175,"Dingbats"],[10624,10751,"MiscMathSymbolsB"],[10752,11007,"SuppMathOperators"],[57344,63743,"PUA"]]};MathJax.Callback.Queue(["initFont",MathJax.OutputJax["HTML-CSS"],"MathJax_AMS"],["loadComplete",MathJax.Ajax,MathJax.OutputJax["HTML-CSS"].fontDir+"/AMS/Regular/Main.js"]);
{ "pile_set_name": "Github" }
namespace Wexflow.Server.Contracts { public class Auth { public string Username { get; set; } public string Password { get; set; } } }
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.netbeans.modules.javafx2.editor.completion.impl; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import javax.swing.ImageIcon; import org.netbeans.api.editor.mimelookup.MimeRegistration; import org.netbeans.modules.javafx2.editor.JavaFXEditorUtils; import org.netbeans.modules.javafx2.editor.completion.beans.FxBean; import org.netbeans.modules.javafx2.editor.completion.beans.FxEvent; import org.netbeans.modules.javafx2.editor.completion.model.FxInstance; import org.netbeans.modules.javafx2.editor.completion.model.FxNode; import org.netbeans.spi.editor.completion.CompletionItem; import org.netbeans.spi.editor.completion.CompletionProvider; /** * * @author sdedic */ @MimeRegistration(mimeType=JavaFXEditorUtils.FXML_MIME_TYPE, service=Completer.Factory.class) public class EventCompleter implements Completer, Completer.Factory { private CompletionContext ctx; private FxInstance instance; private FxBean fxBean; private boolean moreItems; EventCompleter(CompletionContext ctx, FxInstance inst) { this.ctx = ctx; this.instance = inst; this.fxBean = inst.getDefinition(); } public EventCompleter() { } private EventCompletionItem createItem(FxEvent e, boolean noInherit) { String cn = e.getEventClassName(); int dot = cn.lastIndexOf('.'); cn = cn.substring(dot + 1); EventCompletionItem item = new EventCompletionItem( cn, ctx.isAttribute(), ctx, e.getSymbol()); item.setInherited(noInherit || fxBean.getDeclareadInfo().getEvent(e.getName()) != null); return item; } private void completeShallow(List<CompletionItem> result) { String prefix = ctx.getPrefix(); Set<String> eventNames = new HashSet<String>(); if (prefix.contains("on")) { eventNames.addAll(fxBean.getEventNames()); if (fxBean.usesBuilder()) { eventNames.addAll(fxBean.getBuilder().getEventNames()); } } else { eventNames.addAll(fxBean.getDeclareadInfo().getEventNames()); if (fxBean.usesBuilder()) { eventNames.addAll(fxBean.getBuilder().getDeclareadInfo().getEventNames()); } moreItems = true; } for (String s : eventNames) { FxEvent e = fxBean.getEvent(s); if (e == null && fxBean.usesBuilder()) { e = fxBean.getBuilder().getEvent(s); } if (e.isPropertyChange()) { moreItems = true; continue; } result.add(createItem(e, true)); } } private void completeAllEvents(List<CompletionItem> result) { for (String s : fxBean.getEventNames()) { FxEvent e = fxBean.getEvent(s); result.add(createItem(e, true)); } if (fxBean.usesBuilder()) { for (String s : fxBean.getBuilder().getEventNames()) { if (fxBean.getEventNames().contains(s)) { continue; } FxEvent e = fxBean.getBuilder().getEvent(s); result.add(createItem(e, true)); } } } @Override public List<? extends CompletionItem> complete() { List<CompletionItem> result = new ArrayList<CompletionItem>(); if (ctx.getCompletionType() == CompletionProvider.COMPLETION_QUERY_TYPE) { completeShallow(result); } else { completeAllEvents(result); } return result; } @Override public boolean hasMoreItems() { return moreItems; } @Override public Completer createCompleter(CompletionContext ctx) { switch (ctx.getType()) { case CHILD_ELEMENT: case PROPERTY: case PROPERTY_ELEMENT: break; default: return null; } FxNode n = ctx.getElementParent(); if (n == null || n.getKind() != FxNode.Kind.Instance) { return null; } FxInstance inst = (FxInstance)n; if (inst.getDefinition() == null) { return null; } return new EventCompleter(ctx, inst); } }
{ "pile_set_name": "Github" }
Additional IP Rights Grant (Patents) "This implementation" means the copyrightable works distributed by Google as part of the Go project. Google hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, transfer and otherwise run, modify and propagate the contents of this implementation of Go, where such license applies only to those patent claims, both currently owned or controlled by Google and acquired in the future, licensable by Google that are necessarily infringed by this implementation of Go. This grant does not include claims that would be infringed only as a consequence of further modification of this implementation. If you or your agent or exclusive licensee institute or order or agree to the institution of patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that this implementation of Go or any code incorporated within this implementation of Go constitutes direct or contributory patent infringement, or inducement of patent infringement, then any patent rights granted to you under this License for this implementation of Go shall terminate as of the date such litigation is filed.
{ "pile_set_name": "Github" }
inputs = { name = "World" } terraform { source = "../hello-world" }
{ "pile_set_name": "Github" }
// // CustodyWithdrawalSetupInteractor.swift // Blockchain // // Created by AlexM on 2/13/20. // Copyright © 2020 Blockchain Luxembourg S.A. All rights reserved. // import PlatformKit import PlatformUIKit import RxRelay import RxSwift final class CustodyWithdrawalSetupInteractor { typealias InteractionState = LoadingState<Value> // MARK: - InteractionState Model struct Value { /// The users available balance let totalBalance: CryptoValue /// The users available balance let withdrawableBalance: CryptoValue /// The users noncustodial address let destination: String } // MARK: - Public Properties var state: Observable<InteractionState> { stateRelay.asObservable() .observeOn(MainScheduler.instance) } private let stateRelay = BehaviorRelay<InteractionState>(value: .loading) // MARK: - Private Properties private let disposeBag = DisposeBag() // MARK: - Setup init(currency: CryptoCurrency, tradingBalanceService: TradingBalanceServiceAPI, accountRepository: AssetAccountRepositoryAPI) { let accountAddress: Single<String> = accountRepository .defaultAccount(for: currency) .map { $0.address.publicKey } .catchError { error -> Single<String> in fatalError("No \(currency.code) address, error: \(error)") } Single .zip( tradingBalanceService.balance(for: currency.currency), accountAddress ) .map(weak: self) { (self, payload) -> InteractionState in let balance = payload.0 let destination = payload.1 switch balance { case .absent: return .loading case .present(let balance): return InteractionState.loaded( next: Value( totalBalance: balance.available.cryptoValue!, withdrawableBalance: balance.withdrawable.cryptoValue!, destination: destination ) ) } } .asObservable() .startWith(.loading) .bindAndCatch(to: stateRelay) .disposed(by: disposeBag) } }
{ "pile_set_name": "Github" }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of Logtalk <https://logtalk.org/> % Copyright 1998-2020 Paulo Moura <pmoura@logtalk.org> % % Licensed under the Apache License, Version 2.0 (the "License"); % you may not use this file except in compliance with the License. % You may obtain a copy of the License at % % http://www.apache.org/licenses/LICENSE-2.0 % % Unless required by applicable law or agreed to in writing, software % distributed under the License is distributed on an "AS IS" BASIS, % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. % See the License for the specific language governing permissions and % limitations under the License. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% :- protocol(relationp). :- info([ version is 1:0:0, author is 'Paulo Moura', date is 2000-7-24, comment is 'Relations between objects protocol.' ]). :- private(tuple_/1). :- dynamic(tuple_/1). :- mode(tuple_(?list), zero_or_more). :- info(tuple_/1, [ comment is 'Stores the relation tuples.', argnames is ['Tuple'] ]). :- public(tuple/1). :- mode(tuple(?list), zero_or_more). :- info(tuple/1, [ comment is 'Returns a relation tuple.', argnames is ['Tuple'] ]). :- public(tuples/1). :- mode(tuples(-list), one). :- info(tuples/1, [ comment is 'Returns a list of all relation tuples.', argnames is ['Tuples'] ]). :- public(add_tuple/1). :- mode(add_tuple(+list), zero_or_one). :- info(add_tuple/1, [ comment is 'Adds a new relation tuple.', argnames is ['Tuple'] ]). :- public(remove_tuple/1). :- mode(remove_tuple(?list), zero_or_more). :- info(remove_tuple/1, [ comment is 'Removes a matching relation tuple.', argnames is ['Tuple'] ]). :- public(remove_all_tuples/0). :- mode(remove_all_tuples, one). :- info(remove_all_tuples/0, [ comment is 'Removes all relation tuples.' ]). :- public(number_of_tuples/1). :- mode(number_of_tuples(-integer), one). :- info(number_of_tuples/1, [ comment is 'Returns the current number of relation tuples.', argnames is ['Number'] ]). :- public(plays_role_in_tuple/3). :- mode(plays_role_in_tuple(?object, ?atom, ?list), zero_or_more). :- info(plays_role_in_tuple/3, [ comment is 'List of tuples where an object plays a role.', argnames is ['Object', 'Role', 'Tuples'] ]). :- public(plays_roles/2). :- mode(plays_roles(?object, -list), zero_or_more). :- info(plays_roles/2, [ comment is 'Returns a list of all roles played by an object in the relation tuples.', argnames is ['Object', 'Roles'] ]). :- public(plays_role_n_times/3). :- mode(plays_role_n_times(?object, ?atom, -integer), zero_or_more). :- info(plays_role_n_times/3, [ comment is 'Number of times that an object plays a role in the relation tuples.', argnames is ['Object', 'Role', 'Times'] ]). :- private(domain_/2). :- dynamic(domain_/2). :- mode(domain_(?atom, ?object), zero_or_more). :- info(domain_/2, [ comment is 'Table of role domains.', argnames is ['Role', 'Domain'] ]). :- public(domains/1). :- mode(domains(-list), zero_or_one). :- info(domains/1, [ comment is 'List of domains for all roles.', argnames is ['Domains'] ]). :- public(domain/2). :- mode(domain(?atom, ?object), zero_or_more). :- info(domain/2, [ comment is 'Role domain.', argnames is ['Role', 'Domain'] ]). :- public(set_domains/1). :- mode(set_domains(+list), zero_or_one). :- info(set_domains/1, [ comment is 'Set the domains for all roles.', argnames is ['Domains'] ]). :- private(descriptor_/1). :- dynamic(descriptor_/1). :- mode(descriptor_(?list), zero_or_one). :- info(descriptor_/1, [ comment is 'Stores the relation tuple descriptor.', argnames is ['Descriptor'] ]). :- public(descriptor/1). :- mode(descriptor(?list), zero_or_one). :- info(descriptor/1, [ comment is 'Returns the relation tuple descriptor.', argnames is ['Descriptor'] ]). :- public(degree/1). :- mode(degree(?integer), zero_or_one). :- info(degree/1, [ comment is 'Descriptor length.', argnames is ['Degree'] ]). :- public(set_descriptor/1). :- mode(set_descriptor(+list), zero_or_one). :- info(set_descriptor/1, [ comment is 'Sets the relation tuple descriptor.', argnames is ['Descriptor'] ]). :- private(key_/1). :- dynamic(key_/1). :- mode(key_(?list), zero_or_more). :- info(key_/1, [ comment is 'Stores the relation keys.', argnames is ['Key'] ]). :- public(key/1). :- mode(key(?list), zero_or_more). :- info(key/1, [ comment is 'Returns a relation key.', argnames is ['Key'] ]). :- public(keys/1). :- mode(keys(-list), one). :- info(keys/1, [ comment is 'Returns a list of all relation keys.', argnames is ['Keys'] ]). :- public(set_keys/1). :- mode(set_keys(+list), zero_or_one). :- info(set_keys/1, [ comment is 'Sets the relation keys.', argnames is ['Keys'] ]). :- private(delete_option_/2). :- dynamic(delete_option_/2). :- mode(delete_option_(?atom, ?atom), zero_or_more). :- info(delete_option_/2, [ comment is 'Stores role delete options.', argnames is ['Role', 'Option'] ]). :- public(delete_options/1). :- mode(delete_options(-list), zero_or_one). :- info(delete_options/1, [ comment is 'Returns a list of all role - delete option pairs.', argnames is ['Options'] ]). :- public(delete_option/2). :- mode(delete_option(?atom, ?atom), zero_or_more). :- info(delete_option/2, [ comment is 'Returns role delete options.', argnames is ['Role', 'Option'] ]). :- public(set_delete_options/1). :- mode(set_delete_options(+list), zero_or_one). :- info(set_delete_options/1, [ comment is 'Sets the roles delete options.', argnames is ['Options'] ]). :- private(cardinality_/3). :- dynamic(cardinality_/3). :- mode(cardinality_(?atom, ?nonvar, ?nonvar), zero_or_more). :- info(cardinality_/3, [ comment is 'Table of roles minimum and maximum cardinalities.', argnames is ['Role', 'Min', 'Max'] ]). :- public(cardinalities/1). :- mode(cardinalities(-list), zero_or_one). :- info(cardinalities/1, [ comment is 'List of minimum and maximum cardinalities of all roles.', argnames is ['Cardinalities'] ]). :- public(cardinality/3). :- mode(cardinality(?atom, ?nonvar, ?nonvar), zero_or_more). :- info(cardinality/3, [ comment is 'Role minimum and maximum cardinalities.', argnames is ['Role', 'Min', 'Max'] ]). :- public(set_cardinalities/1). :- mode(set_cardinalities(+list), zero_or_one). :- info(cardinalities/1, [ comment is 'Sets the minimum and maximum cardinalities of all roles.', argnames is ['Cardinalities'] ]). :- protected(set_monitors/1). :- mode(set_monitors(+list), one). :- protected(del_all_monitors/0). :- mode(del_all_monitors, one). :- protected(del_monitors/1). :- mode(del_monitors(+list), one). :- protected(restore_monitors/0). :- mode(restore_monitors, zero_or_one). :- end_protocol. :- object(relation, implements((relationp, monitoring)), instantiates(class), specializes(object)). :- info([ version is 1:32:0, date is 2017-06-29, author is 'Esteban Zimanyi, Paulo Moura', comment is 'Enables the representation of relations between independent objects.' ]). :- uses(list, [length/2, member/2, memberchk/2, nth1/3, same_length/2]). tuple(Tuple) :- ::tuple_(Tuple). tuples(Tuples) :- findall(Tuple, ::tuple_(Tuple), Tuples). add_tuple(_Tuple) :- \+ ::descriptor(_), context(Context), throw(error(descriptor_not_defined, Context)). add_tuple(Tuple) :- ::descriptor(Descriptor), \+ same_length(Tuple, Descriptor), context(Context), throw(error(invalid_length, Context)). add_tuple(Tuple) :- ::descriptor(Descriptor), ::key(Key), make_tuple_template(Tuple, Descriptor, Key, Template), ::tuple(Template), context(Context), throw(error(breaks_key(Key), Context)). add_tuple(Tuple) :- ::descriptor(Descriptor), nth1(Position, Tuple, Object), nth1(Position, Descriptor, Role), ::cardinality(Role, _, Maximum), ::plays_role_n_times(Object, Role, Number), Maximum = Number, context(Context), throw(error(breaks_max_cardinality(Object, Role, Maximum), Context)). add_tuple(Tuple) :- ::descriptor(Descriptor), nth1(Position, Tuple, Object), nth1(Position, Descriptor, Role), ::domain(Role, Domain), ( Domain::strict_instance -> \+ Domain::valid(Object) ; \+ Object::ancestor(Domain) ), context(Context), throw(error(breaks_domain(Object, Role, Domain), Context)). add_tuple(Tuple) :- ::assertz(tuple_(Tuple)), ::set_monitors(Tuple). make_tuple_template([], [], _, []). make_tuple_template([Object| Objects], [Role| Roles], Key, [Var| Rest]) :- ( member(Role, Key) -> Var = Object ; true ), make_tuple_template(Objects, Roles, Key, Rest). remove_tuple(_Tuple) :- \+ ::descriptor(_), context(Context), throw(error(descriptor_not_defined, Context)). remove_tuple(Tuple) :- ::descriptor(Descriptor), nth1(Position, Tuple, Object), nth1(Position, Descriptor, Role), ::cardinality(Role, Minimum, _), ::plays_role_n_times(Object, Role, Number), Minimum = Number, context(Context), throw(error(breaks_min_cardinality(Object, Role, Minimum), Context)). remove_tuple(Tuple) :- ::retract(tuple_(Tuple)), ::del_monitors(Tuple). remove_all_tuples :- ::retractall(tuple_(_)), ::del_all_monitors. number_of_tuples(Number) :- findall(1, ::tuple_(_), List), length(List, Number). plays_roles(Object, Roles) :- ::descriptor(Descriptor), setof( Role, Tuple^Position^ (::tuple(Tuple), member(Object, Tuple), nth1(Position, Tuple, Object), once(nth1(Position, Descriptor, Role))), Roles ). plays_role_in_tuple(Object, Role, Tuple) :- ::descriptor(Descriptor), ::tuple(Tuple), nth1(Position, Tuple, Object), nth1(Position, Descriptor, Role). plays_role_n_times(Object, Role, Number) :- ::descriptor(Descriptor), nth1(Position, Descriptor, Role), setof(Tuple, (::tuple(Tuple), nth1(Position, Tuple, Object)), Tuples), length(Tuples, Number). domains(Domains) :- ::descriptor(Descriptor), domains(Descriptor, Domains). domains([], []). domains([Role| Roles], [Domain| Domains]) :- ::domain_(Role, Domain), domains(Roles, Domains). domain(Role, Domain) :- ::domain_(Role, Domain). set_domains(_Domains) :- \+ ::descriptor(_), context(Context), throw(error(descriptor_not_defined, Context)). set_domains(_Domains) :- ::tuple(_), context(Context), throw(error(non_empty_relation, Context)). set_domains(Domains) :- ::descriptor(Descriptor), set_domains(Domains, Descriptor). set_domains([], []). set_domains([Role| Roles], [Domain| Domains]) :- ::retractall(domain_(Role, _)), ::assertz(domain_(Role, Domain)), set_domains(Roles, Domains). descriptor(Descriptor) :- ::descriptor_(Descriptor). degree(Degree) :- ::descriptor_(Descriptor), length(Descriptor, Degree). set_descriptor(Descriptor) :- \+ ::tuple(_), ::assertz(descriptor_(Descriptor)), ::set_keys([Descriptor]), set_role_defaults(Descriptor). set_role_defaults([]). set_role_defaults([Role| Roles]) :- ::set_domain(Role, object), ::set_cardinality(Role, 0, n), ::set_delete_option(Role, cascade), set_role_defaults(Roles). key(Key) :- ::key_(Key). keys(Keys) :- findall(Key, ::key_(Key), Keys). set_keys(_Keys) :- \+ ::descriptor(_), context(Context), throw(error(descriptor_not_defined, Context)). set_keys(_Keys) :- ::tuple(_), context(Context), throw(error(non_empty_relation, Context)). set_keys(Keys) :- \+ valid_keys(Keys), context(Context), throw(error(invalid_key, Context)). set_keys(Keys) :- ::retractall(key_(_)), set_keys2(Keys). set_keys2([]). set_keys2([Key| Keys]) :- ::assertz(key_(Key)), set_keys2(Keys). valid_keys(Keys) :- ::descriptor(Descriptor), valid_keys(Keys, Descriptor). valid_keys([], _). valid_keys([Key| Keys], Descriptor) :- forall( member(Role, Key), memberchk(Role, Descriptor)), valid_keys(Keys, Descriptor). delete_options(Options) :- ::descriptor(Descriptor), delete_options(Descriptor, Options). delete_options([], []). delete_options([Role| Roles], [Option| Options]) :- ::delete_option_(Role, Option), delete_options(Roles, Options). delete_option(Role, Option) :- ::delete_option_(Role, Option). set_delete_options(_Options) :- \+ ::descriptor(_), context(Context), throw(error(descriptor_not_defined, Context)). set_delete_options(_Options) :- ::tuple(_), context(Context), throw(error(non_empty_relation, Context)). set_delete_options(Options) :- ::descriptor(Descriptor), \+ same_length(Options, Descriptor), context(Context), throw(error(invalid_length, Context)). set_delete_options(Options) :- \+ valid_delete_options(Options), context(Context), throw(error(invalid_delete_option, Context)). set_delete_options(Options) :- ::descriptor(Descriptor), set_delete_options(Descriptor, Options). set_delete_options([], []). set_delete_options([Role| Roles], [Option| Options]) :- ::retractall(delete_option_(Role, _)), ::assertz(delete_option_(Role, Option)), set_delete_options(Roles, Options). valid_delete_options([]). valid_delete_options([Option| Options]) :- once((Option = restrict; Option = cascade)), valid_delete_options(Options). cardinalities(Cardinalities) :- ::descriptor(Descriptor), cardinalities(Descriptor, Cardinalities). cardinalities([], []). cardinalities([Role| Roles], [(Min, Max)| Cardinalities]) :- ::cardinality_(Role, Min, Max), cardinalities(Roles, Cardinalities). cardinality(Role, Min, Max) :- ::cardinality_(Role, Min, Max). set_cardinalities(_Cardinalities) :- \+ ::descriptor(_), context(Context), throw(error(descriptor_not_defined, Context)). set_cardinalities(_Cardinalities) :- ::tuple(_), context(Context), throw(error(non_empty_relation, Context)). set_cardinalities(Cardinalities) :- \+ valid_cardinalities(Cardinalities), context(Context), throw(error(invalid_cardinality, Context)). set_cardinalities(Cardinalities) :- ::descriptor(Descriptor), set_cardinalities(Cardinalities, Descriptor). set_cardinalities([], []). set_cardinalities([(Min, Max)| Cardinalities], [Role| Roles]) :- ::retractall(cardinality_(Role, _, _)), ::assertz(cardinality_(Role, Min, Max)), set_cardinalities(Cardinalities, Roles). valid_cardinalities([]). valid_cardinalities([Cardinality| Cardinalities]) :- nonvar(Cardinality), Cardinality = (Min, Max), lower_cardinality(Min, Max), valid_cardinalities(Cardinalities). lower_cardinality(I, n) :- integer(I), !. lower_cardinality(I, J) :- integer(I), integer(J), I < J. free(Options) :- ::remove_all_tuples, ^^free(Options). set_monitors([]). set_monitors([Object| Objects]) :- ( instantiates_class(Object, Class) -> self(Self), before_event_registry::set_monitor(Class, delete(Object, _), _, Self) ; true ), set_monitors(Objects). del_monitors([]). del_monitors([Object| Objects]) :- ( (instantiates_class(Object, Class), \+ (::tuple(Other), member(Object, Other))) -> self(Self), before_event_registry::del_monitors(Class, delete(Object, _), _, Self) ; true ), del_monitors(Objects). del_all_monitors :- self(Self), before_event_registry::del_monitors(_, _, _, Self), after_event_registry::del_monitors(_, _, _, Self). before(_, delete(Object, Options), _) :- !, ( (::delete_option(Role, restrict), ::plays_role_in_tuple(Object, Role, Tuple)) -> self(Self), sender(Sender), throw(error(can_not_be_deleted(Tuple, Object, Role), Self::delete(Object, Options), Sender)) ; forall( ::plays_role_in_tuple(Object, Role, Tuple), ::remove_tuple(Tuple)) ). before(_, _, _). after(_, _, _). restore_monitors :- self(Self), before_event_registry::del_monitors(_, _, _, Self), after_event_registry::del_monitors(_, _, _, Self), forall(::tuple(Tuple), ::set_monitors(Tuple)). print :- ::descriptor(Descriptor), write('descriptor:'), nl, write(' '), writeq(Descriptor), nl, ::domains(Domains), write('domains:'), nl, write(' '), writeq(Domains), nl, ::cardinalities(Cardinalities), write('cardinalities:'), nl, write(' '), writeq(Cardinalities), nl, ::delete_options(Options), write('delete options:'), nl, write(' '), writeq(Options), nl, write('keys:'), nl, forall(::key(Key), (write(' '), writeq(Key), nl)), write('tuples:'), nl, forall(::tuple(Tuple), (write(' '), writeq(Tuple), nl)). :- end_object. :- object(constrained_relation, implements(monitoring), instantiates(class), specializes(relation)). :- info([ version is 3:3:0, date is 2006-12-16, author is 'Paulo Moura', comment is 'Enables the representation of relations with constraints on the state of participating objects.' ]). :- uses(list, [member/2, memberchk/2, subtract/3]). :- private(activ_points_/3). :- dynamic(activ_points_/3). :- mode(activ_points_(?atom, ?event, -list), zero_or_more). :- public(activ_point/3). :- mode(activ_point(?atom, ?event, ?callable), zero_or_more). :- public(activ_points/3). :- mode(activ_points(?atom, ?event, -list), zero_or_more). :- public(set_activ_points/3). :- mode(set_activ_points(+atom, +event, +list), one). :- protected(unique_messages/4). :- mode(unique_messages(+list, +atom, +event, -list), one). :- protected(propagate/5). :- mode(propagate(+atom, +callable, +object, +atom, +list), zero_or_one). before(Object, Message, Sender) :- self(Self), ( Self \= Sender -> forall( (::activ_point(Role, before, Message), ::plays_role_in_tuple(Object, Role, Tuple)), ::propagate(before, Message, Object, Role, Tuple)) ; true ), ^^before(Object, Message, Sender). after(Object, Message, Sender) :- self(Self), ( Self \= Sender -> forall( (::activ_point(Role, after, Message), ::plays_role_in_tuple(Object, Role, Tuple)), ::propagate(after, Message, Object, Role, Tuple)) ; true ), ^^after(Object, Message, Sender). set_monitors(Tuple) :- ^^set_monitors(Tuple), ::descriptor(Descriptor), set_monitors(Tuple, Descriptor). set_monitors([], []). set_monitors([Object| Objects], [Role| Roles]) :- once(::activ_points(Role, before, Messages1)), % avoid spurious backtracking set_object_before_monitors(Messages1, Object), once(::activ_points(Role, after, Messages2)), % avoid spurious backtracking set_object_after_monitors(Messages2, Object), set_monitors(Objects, Roles). set_object_before_monitors([], _). set_object_before_monitors([Message| Messages], Object) :- self(Self), before_event_registry::set_monitor(Object, Message, _, Self), set_object_before_monitors(Messages, Object). set_object_after_monitors([], _). set_object_after_monitors([Message| Messages], Object) :- self(Self), after_event_registry::set_monitor(Object, Message, _, Self), set_object_after_monitors(Messages, Object). del_monitors(Tuple) :- ^^del_monitors(Tuple), ::descriptor(Descriptor), del_monitors(Tuple, Descriptor). del_monitors([], []). del_monitors([Object| Objects], [Role| Roles]) :- del_object_monitors(Object, Role), del_monitors(Objects, Roles). del_object_monitors(Object, Role) :- ( ::plays_roles(Object, Roles) -> ( member(Role, Roles) -> true ; del_object_monitors(Object, Role, Roles) ) ; del_object_monitors(Object, Role, []) ). del_object_monitors(Object, Role, Roles) :- ::unique_messages(Roles, Role, before, Messages1), del_object_before_monitors(Messages1, Object), ::unique_messages(Roles, Role, after, Messages2), del_object_after_monitors(Messages2, Object). del_object_before_monitors([], _). del_object_before_monitors([Message| Messages], Object) :- self(Self), before_event_registry::del_monitors(Object, Message, _, Self), del_object_before_monitors(Messages, Object). del_object_after_monitors([], _). del_object_after_monitors([Message| Messages], Object) :- self(Self), after_event_registry::del_monitors(Object, Message, _, Self), del_object_after_monitors(Messages, Object). propagate(_Event, _Message, _Object, _Role, _Tuple) :- context(Context), throw(error(desc_responsibility, Context)). activ_point(Role, Event, Message) :- ::activ_points_(Role, Event, Messages), member(Message, Messages). activ_points(Role, Event, List) :- ::activ_points_(Role, Event, List). set_activ_points(_Role, _Event, _List) :- \+ ::descriptor(_), context(Context), throw(error(descriptor_not_defined, Context)). set_activ_points(Role, Event, List) :- ::descriptor(Descriptor), memberchk(Role, Descriptor), ::retractall(activ_points_(Role, Event, _)), ::assertz(activ_points_(Role, Event, List)). unique_messages(Roles, Role, Event, Messages) :- ::activ_points_(Role, Event, Original), filter_messages(Roles, Original, Event, Messages). filter_messages([], Messages, _, Messages). filter_messages([Role| Roles], Original, Event, Messages) :- ::activ_points_(Role, Event, Excluded), subtract(Original, Excluded, Rest), filter_messages(Roles, Rest, Event, Messages). set_descriptor(Descriptor) :- ^^set_descriptor(Descriptor), set_default_activ_points(Descriptor). set_default_activ_points([]). set_default_activ_points([Role| Roles]) :- ::set_activ_points(Role, before, []), ::set_activ_points(Role, after, []), set_default_activ_points(Roles). print :- ^^print, ::descriptor(Descriptor), write('call activation points:'), nl, findall( Messages, (member(Role, Descriptor), ::activ_points(Role, before, Messages)), CallList ), write(' '), writeq(CallList), nl, write('exit activation points:'), nl, findall( Messages, (member(Role, Descriptor), ::activ_points(Role, after, Messages)), ExitList ), write(' '), writeq(ExitList), nl. :- end_object.
{ "pile_set_name": "Github" }
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "bytes" "errors" "fmt" "io" "net" "strings" ) // The Permissions type holds fine-grained permissions that are // specific to a user or a specific authentication method for a user. // The Permissions value for a successful authentication attempt is // available in ServerConn, so it can be used to pass information from // the user-authentication phase to the application layer. type Permissions struct { // CriticalOptions indicate restrictions to the default // permissions, and are typically used in conjunction with // user certificates. The standard for SSH certificates // defines "force-command" (only allow the given command to // execute) and "source-address" (only allow connections from // the given address). The SSH package currently only enforces // the "source-address" critical option. It is up to server // implementations to enforce other critical options, such as // "force-command", by checking them after the SSH handshake // is successful. In general, SSH servers should reject // connections that specify critical options that are unknown // or not supported. CriticalOptions map[string]string // Extensions are extra functionality that the server may // offer on authenticated connections. Lack of support for an // extension does not preclude authenticating a user. Common // extensions are "permit-agent-forwarding", // "permit-X11-forwarding". The Go SSH library currently does // not act on any extension, and it is up to server // implementations to honor them. Extensions can be used to // pass data from the authentication callbacks to the server // application layer. Extensions map[string]string } // ServerConfig holds server specific configuration data. type ServerConfig struct { // Config contains configuration shared between client and server. Config hostKeys []Signer // NoClientAuth is true if clients are allowed to connect without // authenticating. NoClientAuth bool // MaxAuthTries specifies the maximum number of authentication attempts // permitted per connection. If set to a negative number, the number of // attempts are unlimited. If set to zero, the number of attempts are limited // to 6. MaxAuthTries int // PasswordCallback, if non-nil, is called when a user // attempts to authenticate using a password. PasswordCallback func(conn ConnMetadata, password []byte) (*Permissions, error) // PublicKeyCallback, if non-nil, is called when a client // offers a public key for authentication. It must return true // if the given public key can be used to authenticate the // given user. For example, see CertChecker.Authenticate. A // call to this function does not guarantee that the key // offered is in fact used to authenticate. To record any data // depending on the public key, store it inside a // Permissions.Extensions entry. PublicKeyCallback func(conn ConnMetadata, key PublicKey) (*Permissions, error) // KeyboardInteractiveCallback, if non-nil, is called when // keyboard-interactive authentication is selected (RFC // 4256). The client object's Challenge function should be // used to query the user. The callback may offer multiple // Challenge rounds. To avoid information leaks, the client // should be presented a challenge even if the user is // unknown. KeyboardInteractiveCallback func(conn ConnMetadata, client KeyboardInteractiveChallenge) (*Permissions, error) // AuthLogCallback, if non-nil, is called to log all authentication // attempts. AuthLogCallback func(conn ConnMetadata, method string, err error) // ServerVersion is the version identification string to announce in // the public handshake. // If empty, a reasonable default is used. // Note that RFC 4253 section 4.2 requires that this string start with // "SSH-2.0-". ServerVersion string } // AddHostKey adds a private key as a host key. If an existing host // key exists with the same algorithm, it is overwritten. Each server // config must have at least one host key. func (s *ServerConfig) AddHostKey(key Signer) { for i, k := range s.hostKeys { if k.PublicKey().Type() == key.PublicKey().Type() { s.hostKeys[i] = key return } } s.hostKeys = append(s.hostKeys, key) } // cachedPubKey contains the results of querying whether a public key is // acceptable for a user. type cachedPubKey struct { user string pubKeyData []byte result error perms *Permissions } const maxCachedPubKeys = 16 // pubKeyCache caches tests for public keys. Since SSH clients // will query whether a public key is acceptable before attempting to // authenticate with it, we end up with duplicate queries for public // key validity. The cache only applies to a single ServerConn. type pubKeyCache struct { keys []cachedPubKey } // get returns the result for a given user/algo/key tuple. func (c *pubKeyCache) get(user string, pubKeyData []byte) (cachedPubKey, bool) { for _, k := range c.keys { if k.user == user && bytes.Equal(k.pubKeyData, pubKeyData) { return k, true } } return cachedPubKey{}, false } // add adds the given tuple to the cache. func (c *pubKeyCache) add(candidate cachedPubKey) { if len(c.keys) < maxCachedPubKeys { c.keys = append(c.keys, candidate) } } // ServerConn is an authenticated SSH connection, as seen from the // server type ServerConn struct { Conn // If the succeeding authentication callback returned a // non-nil Permissions pointer, it is stored here. Permissions *Permissions } // NewServerConn starts a new SSH server with c as the underlying // transport. It starts with a handshake and, if the handshake is // unsuccessful, it closes the connection and returns an error. The // Request and NewChannel channels must be serviced, or the connection // will hang. func NewServerConn(c net.Conn, config *ServerConfig) (*ServerConn, <-chan NewChannel, <-chan *Request, error) { fullConf := *config fullConf.SetDefaults() if fullConf.MaxAuthTries == 0 { fullConf.MaxAuthTries = 6 } s := &connection{ sshConn: sshConn{conn: c}, } perms, err := s.serverHandshake(&fullConf) if err != nil { c.Close() return nil, nil, nil, err } return &ServerConn{s, perms}, s.mux.incomingChannels, s.mux.incomingRequests, nil } // signAndMarshal signs the data with the appropriate algorithm, // and serializes the result in SSH wire format. func signAndMarshal(k Signer, rand io.Reader, data []byte) ([]byte, error) { sig, err := k.Sign(rand, data) if err != nil { return nil, err } return Marshal(sig), nil } // handshake performs key exchange and user authentication. func (s *connection) serverHandshake(config *ServerConfig) (*Permissions, error) { if len(config.hostKeys) == 0 { return nil, errors.New("ssh: server has no host keys") } if !config.NoClientAuth && config.PasswordCallback == nil && config.PublicKeyCallback == nil && config.KeyboardInteractiveCallback == nil { return nil, errors.New("ssh: no authentication methods configured but NoClientAuth is also false") } if config.ServerVersion != "" { s.serverVersion = []byte(config.ServerVersion) } else { s.serverVersion = []byte(packageVersion) } var err error s.clientVersion, err = exchangeVersions(s.sshConn.conn, s.serverVersion) if err != nil { return nil, err } tr := newTransport(s.sshConn.conn, config.Rand, false /* not client */) s.transport = newServerTransport(tr, s.clientVersion, s.serverVersion, config) if err := s.transport.waitSession(); err != nil { return nil, err } // We just did the key change, so the session ID is established. s.sessionID = s.transport.getSessionID() var packet []byte if packet, err = s.transport.readPacket(); err != nil { return nil, err } var serviceRequest serviceRequestMsg if err = Unmarshal(packet, &serviceRequest); err != nil { return nil, err } if serviceRequest.Service != serviceUserAuth { return nil, errors.New("ssh: requested service '" + serviceRequest.Service + "' before authenticating") } serviceAccept := serviceAcceptMsg{ Service: serviceUserAuth, } if err := s.transport.writePacket(Marshal(&serviceAccept)); err != nil { return nil, err } perms, err := s.serverAuthenticate(config) if err != nil { return nil, err } s.mux = newMux(s.transport) return perms, err } func isAcceptableAlgo(algo string) bool { switch algo { case KeyAlgoRSA, KeyAlgoDSA, KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521, KeyAlgoED25519, CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01: return true } return false } func checkSourceAddress(addr net.Addr, sourceAddrs string) error { if addr == nil { return errors.New("ssh: no address known for client, but source-address match required") } tcpAddr, ok := addr.(*net.TCPAddr) if !ok { return fmt.Errorf("ssh: remote address %v is not an TCP address when checking source-address match", addr) } for _, sourceAddr := range strings.Split(sourceAddrs, ",") { if allowedIP := net.ParseIP(sourceAddr); allowedIP != nil { if allowedIP.Equal(tcpAddr.IP) { return nil } } else { _, ipNet, err := net.ParseCIDR(sourceAddr) if err != nil { return fmt.Errorf("ssh: error parsing source-address restriction %q: %v", sourceAddr, err) } if ipNet.Contains(tcpAddr.IP) { return nil } } } return fmt.Errorf("ssh: remote address %v is not allowed because of source-address restriction", addr) } func (s *connection) serverAuthenticate(config *ServerConfig) (*Permissions, error) { sessionID := s.transport.getSessionID() var cache pubKeyCache var perms *Permissions authFailures := 0 userAuthLoop: for { if authFailures >= config.MaxAuthTries && config.MaxAuthTries > 0 { discMsg := &disconnectMsg{ Reason: 2, Message: "too many authentication failures", } if err := s.transport.writePacket(Marshal(discMsg)); err != nil { return nil, err } return nil, discMsg } var userAuthReq userAuthRequestMsg if packet, err := s.transport.readPacket(); err != nil { return nil, err } else if err = Unmarshal(packet, &userAuthReq); err != nil { return nil, err } if userAuthReq.Service != serviceSSH { return nil, errors.New("ssh: client attempted to negotiate for unknown service: " + userAuthReq.Service) } s.user = userAuthReq.User perms = nil authErr := errors.New("no auth passed yet") switch userAuthReq.Method { case "none": if config.NoClientAuth { authErr = nil } // allow initial attempt of 'none' without penalty if authFailures == 0 { authFailures-- } case "password": if config.PasswordCallback == nil { authErr = errors.New("ssh: password auth not configured") break } payload := userAuthReq.Payload if len(payload) < 1 || payload[0] != 0 { return nil, parseError(msgUserAuthRequest) } payload = payload[1:] password, payload, ok := parseString(payload) if !ok || len(payload) > 0 { return nil, parseError(msgUserAuthRequest) } perms, authErr = config.PasswordCallback(s, password) case "keyboard-interactive": if config.KeyboardInteractiveCallback == nil { authErr = errors.New("ssh: keyboard-interactive auth not configubred") break } prompter := &sshClientKeyboardInteractive{s} perms, authErr = config.KeyboardInteractiveCallback(s, prompter.Challenge) case "publickey": if config.PublicKeyCallback == nil { authErr = errors.New("ssh: publickey auth not configured") break } payload := userAuthReq.Payload if len(payload) < 1 { return nil, parseError(msgUserAuthRequest) } isQuery := payload[0] == 0 payload = payload[1:] algoBytes, payload, ok := parseString(payload) if !ok { return nil, parseError(msgUserAuthRequest) } algo := string(algoBytes) if !isAcceptableAlgo(algo) { authErr = fmt.Errorf("ssh: algorithm %q not accepted", algo) break } pubKeyData, payload, ok := parseString(payload) if !ok { return nil, parseError(msgUserAuthRequest) } pubKey, err := ParsePublicKey(pubKeyData) if err != nil { return nil, err } candidate, ok := cache.get(s.user, pubKeyData) if !ok { candidate.user = s.user candidate.pubKeyData = pubKeyData candidate.perms, candidate.result = config.PublicKeyCallback(s, pubKey) if candidate.result == nil && candidate.perms != nil && candidate.perms.CriticalOptions != nil && candidate.perms.CriticalOptions[sourceAddressCriticalOption] != "" { candidate.result = checkSourceAddress( s.RemoteAddr(), candidate.perms.CriticalOptions[sourceAddressCriticalOption]) } cache.add(candidate) } if isQuery { // The client can query if the given public key // would be okay. if len(payload) > 0 { return nil, parseError(msgUserAuthRequest) } if candidate.result == nil { okMsg := userAuthPubKeyOkMsg{ Algo: algo, PubKey: pubKeyData, } if err = s.transport.writePacket(Marshal(&okMsg)); err != nil { return nil, err } continue userAuthLoop } authErr = candidate.result } else { sig, payload, ok := parseSignature(payload) if !ok || len(payload) > 0 { return nil, parseError(msgUserAuthRequest) } // Ensure the public key algo and signature algo // are supported. Compare the private key // algorithm name that corresponds to algo with // sig.Format. This is usually the same, but // for certs, the names differ. if !isAcceptableAlgo(sig.Format) { break } signedData := buildDataSignedForAuth(sessionID, userAuthReq, algoBytes, pubKeyData) if err := pubKey.Verify(signedData, sig); err != nil { return nil, err } authErr = candidate.result perms = candidate.perms } default: authErr = fmt.Errorf("ssh: unknown method %q", userAuthReq.Method) } if config.AuthLogCallback != nil { config.AuthLogCallback(s, userAuthReq.Method, authErr) } if authErr == nil { break userAuthLoop } authFailures++ var failureMsg userAuthFailureMsg if config.PasswordCallback != nil { failureMsg.Methods = append(failureMsg.Methods, "password") } if config.PublicKeyCallback != nil { failureMsg.Methods = append(failureMsg.Methods, "publickey") } if config.KeyboardInteractiveCallback != nil { failureMsg.Methods = append(failureMsg.Methods, "keyboard-interactive") } if len(failureMsg.Methods) == 0 { return nil, errors.New("ssh: no authentication methods configured but NoClientAuth is also false") } if err := s.transport.writePacket(Marshal(&failureMsg)); err != nil { return nil, err } } if err := s.transport.writePacket([]byte{msgUserAuthSuccess}); err != nil { return nil, err } return perms, nil } // sshClientKeyboardInteractive implements a ClientKeyboardInteractive by // asking the client on the other side of a ServerConn. type sshClientKeyboardInteractive struct { *connection } func (c *sshClientKeyboardInteractive) Challenge(user, instruction string, questions []string, echos []bool) (answers []string, err error) { if len(questions) != len(echos) { return nil, errors.New("ssh: echos and questions must have equal length") } var prompts []byte for i := range questions { prompts = appendString(prompts, questions[i]) prompts = appendBool(prompts, echos[i]) } if err := c.transport.writePacket(Marshal(&userAuthInfoRequestMsg{ Instruction: instruction, NumPrompts: uint32(len(questions)), Prompts: prompts, })); err != nil { return nil, err } packet, err := c.transport.readPacket() if err != nil { return nil, err } if packet[0] != msgUserAuthInfoResponse { return nil, unexpectedMessageError(msgUserAuthInfoResponse, packet[0]) } packet = packet[1:] n, packet, ok := parseUint32(packet) if !ok || int(n) != len(questions) { return nil, parseError(msgUserAuthInfoResponse) } for i := uint32(0); i < n; i++ { ans, rest, ok := parseString(packet) if !ok { return nil, parseError(msgUserAuthInfoResponse) } answers = append(answers, string(ans)) packet = rest } if len(packet) != 0 { return nil, errors.New("ssh: junk at end of message") } return answers, nil }
{ "pile_set_name": "Github" }
package jetbrains.mps.lang.editor.menus.substitute.testExtendingLanguage.constraints; /*Generated by MPS */ import jetbrains.mps.smodel.runtime.BaseConstraintsAspectDescriptor; import jetbrains.mps.smodel.runtime.ConstraintsDescriptor; import org.jetbrains.mps.openapi.language.SAbstractConcept; import jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor; public class ConstraintsAspectDescriptor extends BaseConstraintsAspectDescriptor { public ConstraintsAspectDescriptor() { } @Override public ConstraintsDescriptor getConstraints(SAbstractConcept concept) { SAbstractConcept cncpt = concept; return new BaseConstraintsDescriptor(concept); } }
{ "pile_set_name": "Github" }
table ncRna "non-protein-coding genes" ( shorT bin; "bin for browser speed up" string chrom; "Reference sequence chromosome or scaffold" uint chromStart; "genomic start position" uint chromEnd; "gnomic end position" string name; "Name of gene" int score; "unused" char[1] strand; "+ or - for strand" uint thickStart; "unused" uint thickEnd; "unused" string type; "type of gene" string extGeneId; "external gene ID" )
{ "pile_set_name": "Github" }
angular.module('app').run([ 'keypressService', 'navUtils', function(keypressService, navUtils) { keypressService.registerCommandHandler('connection-manager:new-connection', function() { navUtils.showConnections(); }); } ]);
{ "pile_set_name": "Github" }
#import "GPUImageEmbossFilter.h" @implementation GPUImageEmbossFilter @synthesize intensity = _intensity; - (id)init; { if (!(self = [super init])) { return nil; } self.intensity = 1.0; return self; } #pragma mark - #pragma mark Accessors - (void)setIntensity:(CGFloat)newValue; { // [(GPUImage3x3ConvolutionFilter *)filter setConvolutionMatrix:(GPUMatrix3x3){ // {-2.0f, -1.0f, 0.0f}, // {-1.0f, 1.0f, 1.0f}, // { 0.0f, 1.0f, 2.0f} // }]; _intensity = newValue; GPUMatrix3x3 newConvolutionMatrix; newConvolutionMatrix.one.one = _intensity * (-2.0); newConvolutionMatrix.one.two = -_intensity; newConvolutionMatrix.one.three = 0.0f; newConvolutionMatrix.two.one = -_intensity; newConvolutionMatrix.two.two = 1.0; newConvolutionMatrix.two.three = _intensity; newConvolutionMatrix.three.one = 0.0f; newConvolutionMatrix.three.two = _intensity; newConvolutionMatrix.three.three = _intensity * 2.0; self.convolutionKernel = newConvolutionMatrix; } @end
{ "pile_set_name": "Github" }
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE_AFL.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magento.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magento.com for more information. * * @category design * @package base_default * @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <span class="widget widget-category-link-inline"><a <?php echo $this->getLinkAttributes() ?>><span><?php echo $this->escapeHtml($this->getAnchorText()) ?></span></a></span>
{ "pile_set_name": "Github" }
#include "FuseTruncateTest.h" void FuseTruncateTest::TruncateFile(const char *filename, fspp::num_bytes_t size) { int error = TruncateFileReturnError(filename, size); EXPECT_EQ(0, error); } int FuseTruncateTest::TruncateFileReturnError(const char *filename, fspp::num_bytes_t size) { auto fs = TestFS(); auto realpath = fs->mountDir() / filename; int retval = ::truncate(realpath.string().c_str(), size.value()); if (retval == 0) { return 0; } else { return errno; } }
{ "pile_set_name": "Github" }
/////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// //----------------------------------------------------------------------------- // // class InputFile // //----------------------------------------------------------------------------- #include <ImfInputFile.h> #include <ImfChannelList.h> #include <ImfMisc.h> #include <ImfIO.h> #include <ImfCompressor.h> #include <ImathBox.h> #include <ImathFun.h> #include <ImfXdr.h> #include <ImfArray.h> #include <ImfConvert.h> #include <Iex.h> #include <string> #include <vector> #include <fstream> #include <assert.h> #if defined PLATFORM_WIN32 && _MSC_VER < 1300 namespace { template<class T> inline T min (const T &a, const T &b) { return (a <= b) ? a : b; } template<class T> inline T max (const T &a, const T &b) { return (a >= b) ? a : b; } } #endif namespace Imf { using Imath::Box2i; using Imath::divp; using Imath::modp; using std::string; using std::vector; using std::ifstream; namespace { struct InSliceInfo { PixelType typeInFrameBuffer; PixelType typeInFile; char * base; size_t xStride; size_t yStride; int xSampling; int ySampling; bool fill; bool skip; double fillValue; InSliceInfo (PixelType typeInFrameBuffer = HALF, PixelType typeInFile = HALF, char *base = 0, size_t xStride = 0, size_t yStride = 0, int xSampling = 1, int ySampling = 1, bool fill = false, bool skip = false, double fillValue = 0.0); }; InSliceInfo::InSliceInfo (PixelType tifb, PixelType tifl, char *b, size_t xs, size_t ys, int xsm, int ysm, bool f, bool s, double fv) : typeInFrameBuffer (tifb), typeInFile (tifl), base (b), xStride (xs), yStride (ys), xSampling (xsm), ySampling (ysm), fill (f), skip (s), fillValue (fv) { // empty } } // namespace struct InputFile::Data { public: string fileName; Header header; int version; FrameBuffer frameBuffer; LineOrder lineOrder; int minX; int maxX; int minY; int maxY; vector<long> lineOffsets; int linesInBuffer; int lineBufferMinY; int lineBufferMaxY; int nextLineBufferMinY; size_t lineBufferSize; Array<char> lineBuffer; const char * uncompressedData; vector<size_t> bytesPerLine; vector<size_t> offsetInLineBuffer; Compressor * compressor; Compressor::Format format; vector<InSliceInfo> slices; ifstream is; Data (): compressor (0) {} ~Data () {delete compressor;} }; namespace { void reconstructLineOffsets (ifstream &is, vector<long> &lineOffsets) { long position = is.tellg(); try { for (unsigned int i = 0; i < lineOffsets.size(); i++) { if (!is) break; long lineOffset = is.tellg(); int y; Xdr::read <StreamIO> (is, y); if (!is) break; int dataSize; Xdr::read <StreamIO> (is, dataSize); if (!is) break; Xdr::skip <StreamIO> (is, dataSize); lineOffsets[i] = lineOffset; } } catch (...) { // // Suppress all exceptions. This functions is // called only to reconstruct the line offset // table for incomplete files, and exceptions // are likely. // } is.clear(); is.seekg (position); } void readLineOffsets (ifstream &is, vector<long> &lineOffsets) { for (unsigned int i = 0; i < lineOffsets.size(); i++) { Xdr::read <StreamIO> (is, lineOffsets[i]); } for (unsigned int i = 0; i < lineOffsets.size(); i++) { if (lineOffsets[i] <= 0) { // // Invalid data in the line offset table mean that // the file is probably incomplete (the table is // the last thing written to the file). Either // some process is still busy writing the file, // or writing the file was aborted. // // We should still be able to read the existing // parts of the file. In order to do this, we // have to make a sequential scan over the scan // line data to reconstruct the line offset table. // reconstructLineOffsets (is, lineOffsets); break; } } } void readPixelData (InputFile::Data *ifd, int y, int &minY, int &maxY, int &dataSize) { long lineOffset = ifd->lineOffsets[(y - ifd->minY) / ifd->linesInBuffer]; if (lineOffset == 0) THROW (Iex::InputExc, "Scan line " << y << " is missing."); // // Seek to the start of the scan line in the file, // if necessary. // minY = lineBufferMinY (y, ifd->minY, ifd->linesInBuffer); maxY = lineBufferMaxY (y, ifd->minY, ifd->linesInBuffer); if (ifd->nextLineBufferMinY != minY) { ifd->is.seekg (lineOffset); checkError (ifd->is); } #ifdef DEBUG assert (long (ifd->is.tellg()) == lineOffset); #endif // // Read the data block's header. // int yInFile; Xdr::read <StreamIO> (ifd->is, yInFile); Xdr::read <StreamIO> (ifd->is, dataSize); if (yInFile != minY) throw Iex::InputExc ("Unexpected data block y coordinate."); if (dataSize > (int) ifd->lineBufferSize) throw Iex::InputExc ("Unexpected data block length."); // // Read the pixel data. // ifd->is.read (ifd->lineBuffer, dataSize); checkError (ifd->is); // // Keep track of which scan line is the next one in // the file, so that we can avoid redundant seekg() // operations (seekg() can be fairly expensive). // if (ifd->lineOrder == INCREASING_Y) ifd->nextLineBufferMinY = minY + ifd->linesInBuffer; else ifd->nextLineBufferMinY = minY - ifd->linesInBuffer; } } // namespace InputFile::InputFile (const char fileName[]): _data (new Data) { try { _data->fileName = fileName; #ifndef HAVE_IOS_BASE _data->is.open (fileName, std::ios::binary|std::ios::in); #else _data->is.open (fileName, std::ios_base::binary); #endif if (!_data->is) Iex::throwErrnoExc(); _data->header.readFrom (_data->is, _data->version); _data->header.sanityCheck(); _data->lineOrder = _data->header.lineOrder(); const Box2i &dataWindow = _data->header.dataWindow(); _data->minX = dataWindow.min.x; _data->maxX = dataWindow.max.x; _data->minY = dataWindow.min.y; _data->maxY = dataWindow.max.y; _data->lineOffsets.resize (dataWindow.max.y - dataWindow.min.y + 1); int maxBytesPerLine = bytesPerLineTable (_data->header, _data->bytesPerLine); _data->compressor = newCompressor (_data->header.compression(), maxBytesPerLine, _data->header); _data->linesInBuffer = _data->compressor? _data->compressor->numScanLines(): 1; _data->format = _data->compressor? _data->compressor->format(): Compressor::XDR; _data->lineBufferSize = maxBytesPerLine * _data->linesInBuffer; _data->lineBuffer.resizeErase (_data->lineBufferSize); _data->lineBufferMinY = _data->minY - 1; _data->lineBufferMaxY = _data->minY - 1; _data->nextLineBufferMinY = _data->minY - 1; _data->uncompressedData = 0; offsetInLineBufferTable (_data->bytesPerLine, _data->linesInBuffer, _data->offsetInLineBuffer); int lineOffsetSize = (dataWindow.max.y - dataWindow.min.y + _data->linesInBuffer) / _data->linesInBuffer; _data->lineOffsets.resize (lineOffsetSize); readLineOffsets (_data->is, _data->lineOffsets); } catch (Iex::BaseExc &e) { delete _data; REPLACE_EXC (e, "Cannot read image file \"" << fileName << "\". " << e); throw; } } InputFile::~InputFile () { delete _data; } const char * InputFile::fileName () const { return _data->fileName.c_str(); } const Header & InputFile::header () const { return _data->header; } int InputFile::version () const { return _data->version; } void InputFile::setFrameBuffer (const FrameBuffer &frameBuffer) { // // Check if the new frame buffer descriptor is // compatible with the image file header. // const ChannelList &channels = _data->header.channels(); for (FrameBuffer::ConstIterator j = frameBuffer.begin(); j != frameBuffer.end(); ++j) { ChannelList::ConstIterator i = channels.find (j.name()); if (i == channels.end()) continue; if (i.channel().xSampling != j.slice().xSampling || i.channel().ySampling != j.slice().ySampling) { THROW (Iex::ArgExc, "X and/or y subsampling factors " "of \"" << i.name() << "\" channel " "of input file \"" << fileName() << "\" are " "not compatible with the frame buffer's " "subsampling factors."); } } // // Initialize the slice table for readPixels(). // vector<InSliceInfo> slices; ChannelList::ConstIterator i = channels.begin(); for (FrameBuffer::ConstIterator j = frameBuffer.begin(); j != frameBuffer.end(); ++j) { while (i != channels.end() && strcmp (i.name(), j.name()) < 0) { // // Channel i is present in the file but not // in the frame buffer; data for channel i // will be skipped during readPixels(). // slices.push_back (InSliceInfo (i.channel().type, i.channel().type, 0, // base 0, // xStride 0, // yStride i.channel().xSampling, i.channel().ySampling, false, // fill true, // skip 0.0)); // fillValue ++i; } bool fill = false; if (i == channels.end() || strcmp (i.name(), j.name()) > 0) { // // Channel i is present in the frame buffer, but not in the file. // In the frame buffer, slice j will be filled with a default value. // fill = true; } slices.push_back (InSliceInfo (j.slice().type, fill ? j.slice().type: i.channel().type, j.slice().base, j.slice().xStride, j.slice().yStride, j.slice().xSampling, j.slice().ySampling, fill, false, // skip j.slice().fillValue)); if (i != channels.end() && !fill) ++i; } // // Store the new frame buffer. // _data->frameBuffer = frameBuffer; _data->slices = slices; } const FrameBuffer & InputFile::frameBuffer () const { return _data->frameBuffer; } void InputFile::readPixels (int scanLine1, int scanLine2) { try { if (_data->slices.size() == 0) throw Iex::ArgExc ("No frame buffer specified " "as pixel data source."); // // Try to read the scan lines in the same order as in // the file to reduce the overhead of seek operations. // #if defined PLATFORM_WIN32 && _MSC_VER < 1300 int minY = min (scanLine1, scanLine2); int maxY = max (scanLine1, scanLine2); #else int minY = std::min (scanLine1, scanLine2); int maxY = std::max (scanLine1, scanLine2); #endif if (minY < _data->minY || maxY > _data->maxY) { throw Iex::ArgExc ("Tried to read scan line outside " "the image file's data window."); } int numScanLines = maxY - minY + 1; int y; int dy; if (_data->lineOrder == INCREASING_Y) { y = minY; dy = 1; } else { y = maxY; dy = -1; } bool forceXdr = false; // Used to force the lineBuffer to be // interpreted as Xdr. This is needed // if the compressor output pixel data // in the machine's native format, but // lineBuffer contains uncompressed // data in Xdr format. (In a compressed // image file, pixel data that cannot // be compressed because they are too // random, are stored in uncompressed // form.) while (numScanLines) { // // If necessary, read the data block, that // contains line y, from the output file. // if (y < _data->lineBufferMinY || y > _data->lineBufferMaxY) { int minY, maxY, dataSize; readPixelData (_data, y, minY, maxY, dataSize); forceXdr = false; // // Uncompress the data, if necessary // int uncompressedSize = 0; int max = std::min (maxY, _data->maxY); for (int i = minY - _data->minY; i <= max - _data->minY; ++i) uncompressedSize += (int) _data->bytesPerLine[i]; if (_data->compressor && dataSize < uncompressedSize) { dataSize = _data->compressor->uncompress (_data->lineBuffer, dataSize, minY, _data->uncompressedData); } else { // // If the line is uncompressed, but the compressor // says that it's in native format, don't believe it. // if (_data->format != Compressor::XDR) forceXdr = true; _data->uncompressedData = _data->lineBuffer; } _data->lineBufferMinY = minY; _data->lineBufferMaxY = maxY; } // // Convert one scan line's worth of pixel data back // from the machine-independent representation, and // store the result in the frame buffer. // const char *readPtr = _data->uncompressedData + _data->offsetInLineBuffer[y - _data->minY]; // // Iterate over all image channels. // for (unsigned int i = 0; i < _data->slices.size(); ++i) { // // Test if scan line y of this channel is // contains any data (the scan line contains // data only if y % ySampling == 0). // const InSliceInfo &slice = _data->slices[i]; if (modp (y, slice.ySampling) != 0) continue; // // Find the x coordinates of the leftmost and rightmost // sampled pixels (i.e. pixels within the data window // for which x % xSampling == 0). // int dMinX = divp (_data->minX, slice.xSampling); int dMaxX = divp (_data->maxX, slice.xSampling); // // Iterate over the sampled pixels. // if (slice.skip) { // // The file contains data for this channel, but // the frame buffer contains no slice for this channel. // switch (slice.typeInFile) { case UINT: Xdr::skip <CharPtrIO> (readPtr, Xdr::size <unsigned int> () * (dMaxX - dMinX + 1)); break; case HALF: Xdr::skip <CharPtrIO> (readPtr, Xdr::size <half> () * (dMaxX - dMinX + 1)); break; case FLOAT: Xdr::skip <CharPtrIO> (readPtr, Xdr::size <float> () * (dMaxX - dMinX + 1)); break; default: throw Iex::ArgExc ("Unknown pixel data type."); } } else { // // The frame buffer contains a slice for this channel. // char *linePtr = slice.base + divp (y, slice.ySampling) * slice.yStride; char *pixelPtr = linePtr + dMinX * slice.xStride; char *endPtr = linePtr + dMaxX * slice.xStride; if (slice.fill) { // // The file contains no data for this channel. // Store a default value in the frame buffer. // switch (slice.typeInFrameBuffer) { case UINT: { unsigned int fillValue = (unsigned int) (slice.fillValue); while (pixelPtr <= endPtr) { *(unsigned int *) pixelPtr = fillValue; pixelPtr += slice.xStride; } } break; case HALF: { half fillValue = half (slice.fillValue); while (pixelPtr <= endPtr) { *(half *) pixelPtr = fillValue; pixelPtr += slice.xStride; } } break; case FLOAT: { float fillValue = float (slice.fillValue); while (pixelPtr <= endPtr) { *(float *) pixelPtr = fillValue; pixelPtr += slice.xStride; } } break; default: throw Iex::ArgExc ("Unknown pixel data type."); } } else if (_data->format == Compressor::XDR || forceXdr) { // // The compressor produced data for this // channel in Xdr format. // // Convert the pixels from the file's machine- // independent representation, and store the // results in the frame buffer. // switch (slice.typeInFrameBuffer) { case UINT: switch (slice.typeInFile) { case UINT: while (pixelPtr <= endPtr) { Xdr::read <CharPtrIO> (readPtr, *(unsigned int *) pixelPtr); pixelPtr += slice.xStride; } break; case HALF: while (pixelPtr <= endPtr) { half h; Xdr::read <CharPtrIO> (readPtr, h); *(unsigned int *) pixelPtr = halfToUint (h); pixelPtr += slice.xStride; } break; case FLOAT: while (pixelPtr <= endPtr) { float f; Xdr::read <CharPtrIO> (readPtr, f); *(unsigned int *)pixelPtr = floatToUint (f); pixelPtr += slice.xStride; } break; } break; case HALF: switch (slice.typeInFile) { case UINT: while (pixelPtr <= endPtr) { unsigned int ui; Xdr::read <CharPtrIO> (readPtr, ui); *(half *) pixelPtr = uintToHalf (ui); pixelPtr += slice.xStride; } break; case HALF: while (pixelPtr <= endPtr) { Xdr::read <CharPtrIO> (readPtr, *(half *) pixelPtr); pixelPtr += slice.xStride; } break; case FLOAT: while (pixelPtr <= endPtr) { float f; Xdr::read <CharPtrIO> (readPtr, f); *(half *) pixelPtr = floatToHalf (f); pixelPtr += slice.xStride; } break; } break; case FLOAT: switch (slice.typeInFile) { case UINT: while (pixelPtr <= endPtr) { unsigned int ui; Xdr::read <CharPtrIO> (readPtr, ui); *(float *) pixelPtr = float (ui); pixelPtr += slice.xStride; } break; case HALF: while (pixelPtr <= endPtr) { half h; Xdr::read <CharPtrIO> (readPtr, h); *(float *) pixelPtr = float (h); pixelPtr += slice.xStride; } break; case FLOAT: while (pixelPtr <= endPtr) { Xdr::read <CharPtrIO> (readPtr, *(float *) pixelPtr); pixelPtr += slice.xStride; } break; } break; default: throw Iex::ArgExc ("Unknown pixel data type."); } } else { // // The compressor produced data for this // channel in the machine's native format. // Copy the results into the frame buffer. // switch (slice.typeInFrameBuffer) { case UINT: switch (slice.typeInFile) { case UINT: while (pixelPtr <= endPtr) { for (size_t i = 0; i < sizeof (unsigned int); ++i) { pixelPtr[i] = readPtr[i]; } readPtr += sizeof (unsigned int); pixelPtr += slice.xStride; } break; case HALF: while (pixelPtr <= endPtr) { half h = *(half *) readPtr; *(unsigned int *) pixelPtr = halfToUint (h); readPtr += sizeof (half); pixelPtr += slice.xStride; } break; case FLOAT: while (pixelPtr <= endPtr) { float f; for (size_t i = 0; i < sizeof (float); ++i) { ((char *)&f)[i] = readPtr[i]; } *(unsigned int *)pixelPtr = floatToUint (f); readPtr += sizeof (float); pixelPtr += slice.xStride; } break; } break; case HALF: switch (slice.typeInFile) { case UINT: while (pixelPtr <= endPtr) { unsigned int ui; for (size_t i = 0; i < sizeof (unsigned int); ++i) { ((char *)&ui)[i] = readPtr[i]; } *(half *) pixelPtr = uintToHalf (ui); readPtr += sizeof (unsigned int); pixelPtr += slice.xStride; } break; case HALF: while (pixelPtr <= endPtr) { *(half *) pixelPtr = *(half *)readPtr; readPtr += sizeof (half); pixelPtr += slice.xStride; } break; case FLOAT: while (pixelPtr <= endPtr) { float f; for (size_t i = 0; i < sizeof (float); ++i) { ((char *)&f)[i] = readPtr[i]; } *(half *) pixelPtr = floatToHalf (f); readPtr += sizeof (float); pixelPtr += slice.xStride; } break; } break; case FLOAT: switch (slice.typeInFile) { case UINT: while (pixelPtr <= endPtr) { unsigned int ui; for (size_t i = 0; i < sizeof (unsigned int); ++i) { ((char *)&ui)[i] = readPtr[i]; } *(float *) pixelPtr = float (ui); readPtr += sizeof (unsigned int); pixelPtr += slice.xStride; } break; case HALF: while (pixelPtr <= endPtr) { half h = *(half *) readPtr; *(float *) pixelPtr = float (h); readPtr += sizeof (half); pixelPtr += slice.xStride; } break; case FLOAT: while (pixelPtr <= endPtr) { for (size_t i = 0; i < sizeof (float); ++i) pixelPtr[i] = readPtr[i]; readPtr += sizeof (float); pixelPtr += slice.xStride; } break; } break; default: throw Iex::ArgExc ("Unknown pixel data type."); } } } } // // Advance to the next scan line. // numScanLines -= 1; y += dy; } } catch (Iex::BaseExc &e) { REPLACE_EXC (e, "Error reading pixel data from image " "file \"" << fileName() << "\". " << e); throw; } } void InputFile::readPixels (int scanLine) { readPixels (scanLine, scanLine); } void InputFile::rawPixelData (int firstScanLine, const char *&pixelData, int &pixelDataSize) { try { if (firstScanLine < _data->minY || firstScanLine > _data->maxY) { throw Iex::ArgExc ("Tried to read scan line outside " "the image file's data window."); } int dummy1, dummy2; readPixelData (_data, firstScanLine, dummy1, dummy2, pixelDataSize); pixelData = _data->lineBuffer; } catch (Iex::BaseExc &e) { REPLACE_EXC (e, "Error reading pixel data from image " "file \"" << fileName() << "\". " << e); throw; } } } // namespace Imf
{ "pile_set_name": "Github" }
/** Used for built-in method references. */ var funcProto = Function.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } module.exports = toSource;
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="ISO-8859-1"?> <dialog> <label rect='40,150' text="Player Controls" color="#3377FF"/> <label rect='163,170' text="Player 1" color="#AACCFF"/> <label rect='268,170' text="Player 2" color="#AACCFF"/> <label rect="380,150" text='General Controls' color="#3377FF"/> <label rect='40,190' text="Up" color="#ffffff"/> <inputbox rect='165,190,50,17' name="Up" var="GameOptions.Ply1Controls.Up"/> <inputbox rect='270,190,50,17' name="Up" var="GameOptions.Ply2Controls.Up"/> <label rect='40,215' text="Down" color="#ffffff"/> <inputbox rect='165,215,50,17' name="Down" var="GameOptions.Ply1Controls.Down"/> <inputbox rect='270,215,50,17' name="Down" var="GameOptions.Ply2Controls.Down"/> <label rect='40,240' text="Left" color="#ffffff"/> <inputbox rect='165,240,50,17' name="Left" var="GameOptions.Ply1Controls.Left"/> <inputbox rect='270,240,50,17' name="Left" var="GameOptions.Ply2Controls.Left"/> <label rect='40,265' text="Right" color="#ffffff"/> <inputbox rect='165,265,50,17' name="Right" var="GameOptions.Ply1Controls.Right"/> <inputbox rect='270,265,50,17' name="Right" var="GameOptions.Ply2Controls.Right"/> <label rect='40,290' text="Shoot" color="#ffffff"/> <inputbox rect='165,290,50,17' name="Shoot" var="GameOptions.Ply1Controls.Shoot"/> <inputbox rect='270,290,50,17' name="Shoot" var="GameOptions.Ply2Controls.Shoot"/> <label rect='40,315' text="Jump" color="#ffffff"/> <inputbox rect='165,315,50,17' name="Jump" var="GameOptions.Ply1Controls.Jump"/> <inputbox rect='270,315,50,17' name="Jump" var="GameOptions.Ply2Controls.Jump"/> <label rect='40,340' text="Select Weapon" color="#ffffff"/> <inputbox rect='165,340,50,17' name="Select Weapon" var="GameOptions.Ply1Controls.SelectWeapon"/> <inputbox rect='270,340,50,17' name="Select Weapon" var="GameOptions.Ply2Controls.SelectWeapon"/> <label rect='40,365' text="Ninja Rope" color="#ffffff"/> <inputbox rect='165,365,50,17' name="Ninja Rope" var="GameOptions.Ply1Controls.Rope"/> <inputbox rect='270,365,50,17' name="Ninja Rope" var="GameOptions.Ply2Controls.Rope"/> <label rect='40,390' text="Strafe" color="#ffffff"/> <inputbox rect='165,390,50,17' name="Strafe" var="GameOptions.Ply1Controls.Strafe"/> <inputbox rect='270,390,50,17' name="Strafe" var="GameOptions.Ply2Controls.Strafe"/> <label rect='380,190' text="Chat" color="#ffffff"/> <inputbox rect='515,190,50,17' name="Chat" var="GameOptions.GeneralControls.Chat"/> <label rect='380,215' text="Show Score" color="#ffffff"/> <inputbox rect='515,215,50,17' name="Show Score" var="GameOptions.GeneralControls.ShowScore"/> <label rect='380,240' text="Show Health" color="#ffffff"/> <inputbox rect='515,240,50,17' name="Show Health" var="GameOptions.GeneralControls.ShowHealth"/> <label rect='380,265' text="Show Settings" color="#ffffff"/> <inputbox rect='515,265,50,17' name="Show Settings" var="GameOptions.GeneralControls.ShowSettings"/> <label rect='380,290' text="Take Screenshot" color="#ffffff"/> <inputbox rect='515,290,50,17' name="Take Screenshot" var="GameOptions.GeneralControls.TakeScreenshot"/> <label rect='380,315' text="Viewport Manager" color="#ffffff"/> <inputbox rect='515,315,50,17' name="Viewport Manager" var="GameOptions.GeneralControls.ViewportManager"/> <label rect='380,340' text="Switch Video Mode" color="#ffffff"/> <inputbox rect='515,340,50,17' name="Switch Video Mode" var="GameOptions.GeneralControls.SwitchMode"/> <label rect='380,365' text="Toggle Top Bar" color="#ffffff"/> <inputbox rect='515,365,50,17' name="Toggle Top Bar" var="GameOptions.GeneralControls.ToggleTopBar"/> <label rect='380,390' text="Team Chat" color="#ffffff"/> <inputbox rect='515,390,50,17' name="Team Chat" var="GameOptions.GeneralControls.TeamChat"/> <label rect='380,415' text="Toggle Media Player" color="#ffffff"/> <inputbox rect='515,415,50,17' name="Toggle Media Player" var="GameOptions.GeneralControls.MediaPlayer"/> </dialog>
{ "pile_set_name": "Github" }
// Boost.Bimap // // Copyright (c) 2006-2007 Matias Capeletto // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) /// \file container_adaptor/detail/non_unique_container_helper.hpp /// \brief Details for non unique containers #ifndef BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_NON_UNIQUE_CONTAINER_HELPER_HPP #define BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_NON_UNIQUE_CONTAINER_HELPER_HPP #if defined(_MSC_VER) #pragma once #endif #include <boost/config.hpp> /*****************************************************************************/ #define BOOST_BIMAP_NON_UNIQUE_CONTAINER_ADAPTOR_INSERT_FUNCTIONS \ \ template <class InputIterator> \ void insert(InputIterator iterBegin, InputIterator iterEnd) \ { \ for( ; iterBegin != iterEnd ; ++iterBegin ) \ { \ this->base().insert( \ this->template functor< \ BOOST_DEDUCED_TYPENAME base_::value_to_base>()( \ BOOST_DEDUCED_TYPENAME base_::value_type(*iterBegin)) ); \ } \ } \ \ BOOST_DEDUCED_TYPENAME base_::iterator insert( \ BOOST_DEDUCED_TYPENAME ::boost::call_traits< \ BOOST_DEDUCED_TYPENAME base_::value_type >::param_type x) \ { \ return this->base().insert( this->template functor< \ BOOST_DEDUCED_TYPENAME base_:: \ value_to_base>()(x) ); \ } \ \ BOOST_DEDUCED_TYPENAME base_::iterator \ insert(BOOST_DEDUCED_TYPENAME base_::iterator pos, \ BOOST_DEDUCED_TYPENAME ::boost::call_traits< \ BOOST_DEDUCED_TYPENAME base_::value_type >::param_type x) \ { \ return this->template functor< \ BOOST_DEDUCED_TYPENAME base_::iterator_from_base>()( \ this->base().insert(this->template functor< \ BOOST_DEDUCED_TYPENAME base_::iterator_to_base>()(pos), \ this->template functor< \ BOOST_DEDUCED_TYPENAME base_::value_to_base>()(x)) \ ); \ } /*****************************************************************************/ #endif // BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_NON_UNIQUE_CONTAINER_HELPER_HPP
{ "pile_set_name": "Github" }
// // Comment.cs // // Author: // Matej Miklečić <matej.miklecic@gmail.com> // // Copyright (c) 2013 Matej Miklečić (matej.miklecic@gmail.com) // namespace Comments { /// <summary> /// This is a test file for all types of comments. /// </summary> class Comments { /// <summary> /// Comment method. /// </summary> /// <param name="id"> /// Id. /// </param> void Comment(int id, // id string text) // text { int i; // i for (i = 0; i < 42 /* 42; */; i++) /* * Multi-line */ { // break break; } // for /////////* while (true) // comments don't affect continuation ; /********/ if (false) lock (this) // /* ; { /*/*/ } } /*/ still in comment } */ } }
{ "pile_set_name": "Github" }
/* * Copyright (C) 2013-2018 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #if ENABLE(VIDEO) #include <wtf/Ref.h> #include <wtf/RefCounted.h> namespace WebCore { struct VideoPlaybackQualityMetrics; class VideoPlaybackQuality : public RefCounted<VideoPlaybackQuality> { WTF_MAKE_NONCOPYABLE(VideoPlaybackQuality) public: static Ref<VideoPlaybackQuality> create(double creationTime, const VideoPlaybackQualityMetrics&); double creationTime() const { return m_creationTime; } unsigned totalVideoFrames() const { return m_totalVideoFrames; } unsigned droppedVideoFrames() const { return m_droppedVideoFrames; } unsigned corruptedVideoFrames() const { return m_corruptedVideoFrames; } unsigned displayCompositedVideoFrames() const { return m_displayCompositedVideoFrames; } double totalFrameDelay() const { return m_totalFrameDelay; } private: VideoPlaybackQuality(double creationTime, const VideoPlaybackQualityMetrics&); double m_creationTime; uint32_t m_totalVideoFrames; uint32_t m_droppedVideoFrames; uint32_t m_corruptedVideoFrames; uint32_t m_displayCompositedVideoFrames; double m_totalFrameDelay; }; } // namespace WebCore #endif // ENABLE(VIDEO)
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <ZopeData> <record id="1" aka="AAAAAAAAAAE="> <pickle> <global name="File" module="OFS.Image"/> </pickle> <pickle> <dictionary> <item> <key> <string>_Cacheable__manager_id</string> </key> <value> <string>http_cache</string> </value> </item> <item> <key> <string>__name__</string> </key> <value> <string>mobileTouchManager.js</string> </value> </item> <item> <key> <string>content_type</string> </key> <value> <string>text/javascript</string> </value> </item> <item> <key> <string>precondition</string> </key> <value> <string></string> </value> </item> <item> <key> <string>title</string> </key> <value> <string></string> </value> </item> </dictionary> </pickle> </record> </ZopeData>
{ "pile_set_name": "Github" }
Feature: BoxPacker In order to make logistics easier As a developer I need to be able to find out how a set of items can fit into a set of boxes Scenario: Fitting small items into a small box only Given there is a box "Small", which has external dimensions 300mm w × 300mm l × 10mm d × 10g and internal dimensions 296mm w × 296mm l × 8mm d and has a max weight of 1000g And there is a box "Large", which has external dimensions 3000mm w × 3000mm l × 100mm d × 100g and internal dimensions 2960mm w × 2960mm l × 80mm d and has a max weight of 10000g When I add 3 x keep flat "Small Item" with dimensions 250mm w × 250mm l × 2mm d × 200g And I do a packing Then I should have 1 boxes of type "Small" And I should have 0 boxes of type "Large" Scenario: Fitting large items into a large box only Given there is a box "Small", which has external dimensions 300mm w × 300mm l × 10mm d × 10g and internal dimensions 296mm w × 296mm l × 8mm d and has a max weight of 1000g And there is a box "Large", which has external dimensions 3000mm w × 3000mm l × 100mm d × 100g and internal dimensions 2960mm w × 2960mm l × 80mm d and has a max weight of 10000g When I add 3 x keep flat "Large Item" with dimensions 2500mm w × 2500mm l × 20mm d × 2000g And I do a packing Then I should have 0 boxes of type "Small" And I should have 1 boxes of type "Large" Scenario: Fitting mixed size items into a mix of box sizes Given there is a box "Small", which has external dimensions 600mm w × 600mm l × 10mm d × 10g and internal dimensions 596mm w × 596mm l × 8mm d and has a max weight of 1000g And there is a box "Large", which has external dimensions 3000mm w × 3000mm l × 50mm d × 100g and internal dimensions 2960mm w × 2960mm l × 40mm d and has a max weight of 10000g When I add 1 x keep flat "Small Item" with dimensions 550mm w × 550mm l × 2mm d × 500g When I add 4 x keep flat "Large Item" with dimensions 2500mm w × 2500mm l × 20mm d × 500g And I do a packing Then I should have 1 boxes of type "Small" And I should have 2 boxes of type "Large" Scenario: Simple stacking Given there is a box "Small", which has external dimensions 292mm w × 336mm l × 60mm d × 10g and internal dimensions 292mm w × 336mm l × 60mm d and has a max weight of 9000g And there is a box "Large", which has external dimensions 421mm w × 548mm l × 335mm d × 100g and internal dimensions 421mm w × 548mm l × 335mm d and has a max weight of 10000g When I add 1 x keep flat "Small Item" with dimensions 226mm w × 200mm l × 40mm d × 440g When I add 1 x keep flat "Large Item" with dimensions 200mm w × 200mm l × 155mm d × 1660g And I do a packing Then I should have 0 boxes of type "Small" And I should have 1 boxes of type "Large" Scenario: Making sure whatever bug caused issue #3 doesn't come back Given there is a box "Box A", which has external dimensions 51mm w × 33mm l × 33mm d × 1g and internal dimensions 51mm w × 33mm l × 33mm d and has a max weight of 1g And there is a box "Box B", which has external dimensions 50mm w × 40mm l × 40mm d × 1g and internal dimensions 50mm w × 40mm l × 40mm d and has a max weight of 1g When I add 6 x keep flat "Item" with dimensions 28mm w × 19mm l × 9mm d × 0g And I do a packing Then I should have 1 boxes of type "Box A" And I should have 0 boxes of type "Box B"
{ "pile_set_name": "Github" }
// Copyright (c) 2014 Readium Foundation and/or its licensees. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // 1. Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation and/or // other materials provided with the distribution. // 3. Neither the name of the organization nor the names of its contributors may be // used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED // OF THE POSSIBILITY OF SUCH DAMAGE. package org.readium.sdk.android; public interface SdkErrorHandler { boolean handleSdkError(String message, boolean isSevereEpubError); }
{ "pile_set_name": "Github" }
<?php /** * This file is part of the Carbon package. * * (c) Brian Nesbitt <brian@nesbot.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], 'weekdays_short' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], 'weekdays_min' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], 'months' => ['luukao kemã', 'ɓandaɓu', 'vɔɔ', 'fulu', 'goo', '6', '7', 'kɔnde', 'saah', 'galo', 'kenpkato ɓololɔ', 'luukao lɔma'], 'months_short' => ['luukao kemã', 'ɓandaɓu', 'vɔɔ', 'fulu', 'goo', '6', '7', 'kɔnde', 'saah', 'galo', 'kenpkato ɓololɔ', 'luukao lɔma'], 'first_day_of_week' => 1, 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', 'L' => 'DD/MM/YYYY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY h:mm a', 'LLLL' => 'dddd, D MMMM YYYY h:mm a', ], ]);
{ "pile_set_name": "Github" }
/* cache .c - a LRU cache * * Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de> * * This file is part of pysqlite. * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. */ #include "cache.h" #include <limits.h> #define PyDict_GET_SIZE(mp) (assert(PyDict_Check(mp)),Py_SIZE(mp)) // PLASTICITY /* only used internally */ pysqlite_Node* pysqlite_new_node(PyObject* key, PyObject* data) { pysqlite_Node* node; node = (pysqlite_Node*) (pysqlite_NodeType.tp_alloc(&pysqlite_NodeType, 0)); if (!node) { return NULL; } Py_INCREF(key); node->key = key; Py_INCREF(data); node->data = data; node->prev = NULL; node->next = NULL; return node; } void pysqlite_node_dealloc(pysqlite_Node* self) { Py_DECREF(self->key); Py_DECREF(self->data); Py_TYPE(self)->tp_free((PyObject*)self); } int pysqlite_cache_init(pysqlite_Cache* self, PyObject* args, PyObject* kwargs) { PyObject* factory; int size = 10; self->factory = NULL; if (!PyArg_ParseTuple(args, "O|i", &factory, &size)) { return -1; } /* minimum cache size is 5 entries */ if (size < 5) { size = 5; } self->size = size; self->first = NULL; self->last = NULL; self->mapping = PyDict_New(); if (!self->mapping) { return -1; } Py_INCREF(factory); self->factory = factory; self->decref_factory = 1; return 0; } void pysqlite_cache_dealloc(pysqlite_Cache* self) { pysqlite_Node* node; pysqlite_Node* delete_node; if (!self->factory) { /* constructor failed, just get out of here */ return; } /* iterate over all nodes and deallocate them */ node = self->first; while (node) { delete_node = node; node = node->next; Py_DECREF(delete_node); } if (self->decref_factory) { Py_DECREF(self->factory); } Py_DECREF(self->mapping); Py_TYPE(self)->tp_free((PyObject*)self); } PyObject* pysqlite_cache_get(pysqlite_Cache* self, PyObject* args) { PyObject* key = args; pysqlite_Node* node; pysqlite_Node* ptr; PyObject* data; node = (pysqlite_Node*)PyDict_GetItem(self->mapping, key); if (node) { /* an entry for this key already exists in the cache */ /* increase usage counter of the node found */ if (node->count < LONG_MAX) { node->count++; } /* if necessary, reorder entries in the cache by swapping positions */ if (node->prev && node->count > node->prev->count) { ptr = node->prev; while (ptr->prev && node->count > ptr->prev->count) { ptr = ptr->prev; } if (node->next) { node->next->prev = node->prev; } else { self->last = node->prev; } if (node->prev) { node->prev->next = node->next; } if (ptr->prev) { ptr->prev->next = node; } else { self->first = node; } node->next = ptr; node->prev = ptr->prev; if (!node->prev) { self->first = node; } ptr->prev = node; } } else { /* There is no entry for this key in the cache, yet. We'll insert a new * entry in the cache, and make space if necessary by throwing the * least used item out of the cache. */ if (PyDict_GET_SIZE(self->mapping) == self->size) { if (self->last) { node = self->last; if (PyDict_DelItem(self->mapping, self->last->key) != 0) { return NULL; } if (node->prev) { node->prev->next = NULL; } self->last = node->prev; node->prev = NULL; Py_DECREF(node); } } data = PyObject_CallFunction(self->factory, "O", key); if (!data) { return NULL; } node = pysqlite_new_node(key, data); if (!node) { return NULL; } node->prev = self->last; Py_DECREF(data); if (PyDict_SetItem(self->mapping, key, (PyObject*)node) != 0) { Py_DECREF(node); return NULL; } if (self->last) { self->last->next = node; } else { self->first = node; } self->last = node; } Py_INCREF(node->data); return node->data; } PyObject* pysqlite_cache_display(pysqlite_Cache* self, PyObject* args) { pysqlite_Node* ptr; PyObject* prevkey; PyObject* nextkey; PyObject* display_str; ptr = self->first; while (ptr) { if (ptr->prev) { prevkey = ptr->prev->key; } else { prevkey = Py_None; } if (ptr->next) { nextkey = ptr->next->key; } else { nextkey = Py_None; } display_str = PyUnicode_FromFormat("%S <- %S -> %S\n", prevkey, ptr->key, nextkey); if (!display_str) { return NULL; } PyObject_Print(display_str, stdout, Py_PRINT_RAW); Py_DECREF(display_str); ptr = ptr->next; } Py_RETURN_NONE; } static PyMethodDef cache_methods[] = { {"get", (PyCFunction)pysqlite_cache_get, METH_O, PyDoc_STR("Gets an entry from the cache or calls the factory function to produce one.")}, {"display", (PyCFunction)pysqlite_cache_display, METH_NOARGS, PyDoc_STR("For debugging only.")}, {NULL, NULL} }; PyTypeObject pysqlite_NodeType = { PyVarObject_HEAD_INIT(NULL, 0) MODULE_NAME "Node", /* tp_name */ sizeof(pysqlite_Node), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)pysqlite_node_dealloc, /* tp_dealloc */ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ 0, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ (initproc)0, /* tp_init */ 0, /* tp_alloc */ 0, /* tp_new */ 0 /* tp_free */ }; PyTypeObject pysqlite_CacheType = { PyVarObject_HEAD_INIT(NULL, 0) MODULE_NAME ".Cache", /* tp_name */ sizeof(pysqlite_Cache), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)pysqlite_cache_dealloc, /* tp_dealloc */ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ 0, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ cache_methods, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ (initproc)pysqlite_cache_init, /* tp_init */ 0, /* tp_alloc */ 0, /* tp_new */ 0 /* tp_free */ }; extern int pysqlite_cache_setup_types(void) { int rc; pysqlite_NodeType.tp_new = PyType_GenericNew; pysqlite_CacheType.tp_new = PyType_GenericNew; rc = PyType_Ready(&pysqlite_NodeType); if (rc < 0) { return rc; } rc = PyType_Ready(&pysqlite_CacheType); return rc; }
{ "pile_set_name": "Github" }
vc.project.guid = BBDBC9A3-15CD-495B-9B16-D03CFBFB8D2D vc.project.name = SevenZip vc.project.target = Poco${vc.project.name} vc.project.type = library vc.project.pocobase = .. vc.project.outdir = ${vc.project.pocobase} vc.project.platforms = Win32 vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md vc.project.prototype = ${vc.project.name}_vs90.vcproj vc.project.compiler.include = ..\\Foundation\\include vc.project.compiler.defines = vc.project.compiler.defines.shared = ${vc.project.name}_EXPORTS vc.project.compiler.defines.debug_shared = ${vc.project.compiler.defines.shared} vc.project.compiler.defines.release_shared = ${vc.project.compiler.defines.shared} vc.project.compiler.disableWarnings = 4244;4267 vc.solution.create = true
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.11"/> <title>CUTLASS: cutlass::layout::LayoutTranspose&lt; Layout &gt; Struct Template Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectlogo"><img alt="Logo" src="cutlass-logo-small.png"/></td> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">CUTLASS </div> <div id="projectbrief">CUDA Templates for Linear Algebra Subroutines and Solvers</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.11 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacecutlass.html">cutlass</a></li><li class="navelem"><a class="el" href="namespacecutlass_1_1layout.html">layout</a></li><li class="navelem"><a class="el" href="structcutlass_1_1layout_1_1LayoutTranspose.html">LayoutTranspose</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">cutlass::layout::LayoutTranspose&lt; Layout &gt; Struct Template Reference</div> </div> </div><!--header--> <div class="contents"> <p>Defines transposes of matrix layouts. </p> <p><code>#include &lt;<a class="el" href="layout_2matrix_8h_source.html">matrix.h</a>&gt;</code></p> <hr/>The documentation for this struct was generated from the following file:<ul> <li><a class="el" href="layout_2matrix_8h_source.html">layout/matrix.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.11 </small></address> </body> </html>
{ "pile_set_name": "Github" }
/********************************************************************** * File: tessbox.cpp (Formerly tessbox.c) * Description: Black boxed Tess for developing a resaljet. * Author: Ray Smith * Created: Thu Apr 23 11:03:36 BST 1992 * * (C) Copyright 1992, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** http://www.apache.org/licenses/LICENSE-2.0 ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. * **********************************************************************/ #ifdef _MSC_VER #pragma warning(disable:4244) // Conversion warnings #endif #include "mfoutline.h" #include "tessbox.h" #include "tesseractclass.h" #define EXTERN /** * @name tess_segment_pass_n * * Segment a word using the pass_n conditions of the tess segmenter. * @param pass_n pass number * @param word word to do */ namespace tesseract { void Tesseract::tess_segment_pass_n(int pass_n, WERD_RES *word) { int saved_enable_assoc = 0; int saved_chop_enable = 0; if (word->word->flag(W_DONT_CHOP)) { saved_enable_assoc = wordrec_enable_assoc; saved_chop_enable = chop_enable; wordrec_enable_assoc.set_value(0); chop_enable.set_value(0); } if (pass_n == 1) set_pass1(); else set_pass2(); recog_word(word); if (word->best_choice == NULL) word->SetupFake(*word->uch_set); if (word->word->flag(W_DONT_CHOP)) { wordrec_enable_assoc.set_value(saved_enable_assoc); chop_enable.set_value(saved_chop_enable); } } /** * @name tess_acceptable_word * * @return true if the word is regarded as "good enough". * @param word_choice after context * @param raw_choice before context */ bool Tesseract::tess_acceptable_word(WERD_RES* word) { return getDict().AcceptableResult(word); } /** * @name tess_add_doc_word * * Add the given word to the document dictionary */ void Tesseract::tess_add_doc_word(WERD_CHOICE *word_choice) { getDict().add_document_word(*word_choice); } } // namespace tesseract
{ "pile_set_name": "Github" }
package com.linbit; public class ValueOutOfRangeException extends Exception { public enum ViolationType { GENERIC, TOO_LOW, TOO_HIGH } private final ViolationType violation; public ValueOutOfRangeException(ViolationType violationSpec) { violation = violationSpec; } public ValueOutOfRangeException(String message, ViolationType violationSpec) { super(message); violation = violationSpec; } public ViolationType getViolationType() { return violation; } }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html lang="en"> <head> {% block head %} <title>{{title}}</title> <link rel="stylesheet" type="text/css" href="/static/admin/css/H-ui.min.css" /> <link rel="stylesheet" type="text/css" href="/static/admin/css/H-ui.admin.css" /> <link rel="stylesheet" type="text/css" href="/static/admin/lib/Hui-iconfont/1.0.7/iconfont.css" /> <link rel="stylesheet" type="text/css" href="/static/admin/css/admin/common/common.css" /> <script src="/static/admin/js/jquery/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="/static/admin/js/H-ui.js"></script> <script type="text/javascript" src="/static/admin/js/H-ui.admin.js"></script> {% endblock %} <script> var G_csrf = "{{csrf}}"; </script> </head> <body> <div class="main-content"> <nav class="breadcrumb"> <i class="Hui-iconfont">&#xe67f;</i> <a href="/admin/index/welcome">首页</a> <span class="c-gray en">&gt;</span> {{title}} <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"> <i class="Hui-iconfont">&#xe68f;</i> </a> </nav> <article class="page-container"> {% block content %}{% endblock %} </article> </div> {% block footer_other %}{% endblock %} </body> </html>
{ "pile_set_name": "Github" }
{ "Commands:": "Choose yer command:", "Options:": "Options for me hearties!", "Examples:": "Ex. marks the spot:", "required": "requi-yar-ed", "Missing required argument: %s": { "one": "Ye be havin' to set the followin' argument land lubber: %s", "other": "Ye be havin' to set the followin' arguments land lubber: %s" }, "Show help": "Parlay this here code of conduct", "Show version number": "'Tis the version ye be askin' fer", "Arguments %s and %s are mutually exclusive" : "Yon scurvy dogs %s and %s be as bad as rum and a prudish wench" }
{ "pile_set_name": "Github" }
// Package v1p20 provides specific API types for the API version 1, patch 20. package v1p20 import ( "github.com/docker/engine-api/types" "github.com/docker/engine-api/types/container" "github.com/docker/go-connections/nat" ) // ContainerJSON is a backcompatibility struct for the API 1.20 type ContainerJSON struct { *types.ContainerJSONBase Mounts []types.MountPoint Config *ContainerConfig NetworkSettings *NetworkSettings } // ContainerConfig is a backcompatibility struct used in ContainerJSON for the API 1.20 type ContainerConfig struct { *container.Config MacAddress string NetworkDisabled bool ExposedPorts map[nat.Port]struct{} // backward compatibility, they now live in HostConfig VolumeDriver string } // StatsJSON is a backcompatibility struct used in Stats for API prior to 1.21 type StatsJSON struct { types.Stats Network types.NetworkStats `json:"network,omitempty"` } // NetworkSettings is a backward compatible struct for APIs prior to 1.21 type NetworkSettings struct { types.NetworkSettingsBase types.DefaultNetworkSettings }
{ "pile_set_name": "Github" }
/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-8.js * @description String.prototype.trim works for a primitive string (value is ' abc') */ function testcase() { var strObj = String(" abc"); return "abc" === strObj.trim() && strObj.toString() === " abc"; } runTestCase(testcase);
{ "pile_set_name": "Github" }
# deprecated
{ "pile_set_name": "Github" }
// -*- C++ -*- //============================================================================= /** * @file os_assert.h * * verify program assertion * * $Id: os_assert.h 80826 2008-03-04 14:51:23Z wotte $ * * @author Don Hinton <dhinton@dresystems.com> * @author This code was originally in various places including ace/OS.h. */ //============================================================================= #ifndef ACE_OS_INCLUDE_OS_ASSERT_H #define ACE_OS_INCLUDE_OS_ASSERT_H #include /**/ "ace/pre.h" #include /**/ "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #if !defined (ACE_LACKS_ASSERT_H) # include /**/ <assert.h> #endif /* !ACE_LACKS_ASSERT_H */ // Place all additions (especially function declarations) within extern "C" {} #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #if defined (ACE_LACKS_ASSERT_MACRO) # define assert(expr) #endif #ifdef __cplusplus } #endif /* __cplusplus */ #include /**/ "ace/post.h" #endif /* ACE_OS_INCLUDE_OS_ASSERT_H */
{ "pile_set_name": "Github" }
<?php namespace oasis\names\specification\ubl\schema\xsd\CommonBasicComponents_2; /** * @xmlNamespace urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 * @xmlType MinimumOrderQuantityType * @xmlName MinimumOrderQuantity * @var oasis\names\specification\ubl\schema\xsd\CommonBasicComponents_2\MinimumOrderQuantity */ class MinimumOrderQuantity extends MinimumOrderQuantityType { } // end class MinimumOrderQuantity
{ "pile_set_name": "Github" }
/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package apiextensions import ( "fmt" "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) var swaggerMetadataDescriptions = metav1.ObjectMeta{}.SwaggerDoc() // SetCRDCondition sets the status condition. It either overwrites the existing one or creates a new one. func SetCRDCondition(crd *CustomResourceDefinition, newCondition CustomResourceDefinitionCondition) { existingCondition := FindCRDCondition(crd, newCondition.Type) if existingCondition == nil { newCondition.LastTransitionTime = metav1.NewTime(time.Now()) crd.Status.Conditions = append(crd.Status.Conditions, newCondition) return } if existingCondition.Status != newCondition.Status { existingCondition.Status = newCondition.Status existingCondition.LastTransitionTime = newCondition.LastTransitionTime } existingCondition.Reason = newCondition.Reason existingCondition.Message = newCondition.Message } // RemoveCRDCondition removes the status condition. func RemoveCRDCondition(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) { newConditions := []CustomResourceDefinitionCondition{} for _, condition := range crd.Status.Conditions { if condition.Type != conditionType { newConditions = append(newConditions, condition) } } crd.Status.Conditions = newConditions } // FindCRDCondition returns the condition you're looking for or nil. func FindCRDCondition(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) *CustomResourceDefinitionCondition { for i := range crd.Status.Conditions { if crd.Status.Conditions[i].Type == conditionType { return &crd.Status.Conditions[i] } } return nil } // IsCRDConditionTrue indicates if the condition is present and strictly true. func IsCRDConditionTrue(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) bool { return IsCRDConditionPresentAndEqual(crd, conditionType, ConditionTrue) } // IsCRDConditionFalse indicates if the condition is present and false. func IsCRDConditionFalse(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType) bool { return IsCRDConditionPresentAndEqual(crd, conditionType, ConditionFalse) } // IsCRDConditionPresentAndEqual indicates if the condition is present and equal to the given status. func IsCRDConditionPresentAndEqual(crd *CustomResourceDefinition, conditionType CustomResourceDefinitionConditionType, status ConditionStatus) bool { for _, condition := range crd.Status.Conditions { if condition.Type == conditionType { return condition.Status == status } } return false } // IsCRDConditionEquivalent returns true if the lhs and rhs are equivalent except for times. func IsCRDConditionEquivalent(lhs, rhs *CustomResourceDefinitionCondition) bool { if lhs == nil && rhs == nil { return true } if lhs == nil || rhs == nil { return false } return lhs.Message == rhs.Message && lhs.Reason == rhs.Reason && lhs.Status == rhs.Status && lhs.Type == rhs.Type } // CRDHasFinalizer returns true if the finalizer is in the list. func CRDHasFinalizer(crd *CustomResourceDefinition, needle string) bool { for _, finalizer := range crd.Finalizers { if finalizer == needle { return true } } return false } // CRDRemoveFinalizer removes the finalizer if present. func CRDRemoveFinalizer(crd *CustomResourceDefinition, needle string) { newFinalizers := []string{} for _, finalizer := range crd.Finalizers { if finalizer != needle { newFinalizers = append(newFinalizers, finalizer) } } crd.Finalizers = newFinalizers } // HasServedCRDVersion returns true if the given version is in the list of CRD's versions and the Served flag is set. func HasServedCRDVersion(crd *CustomResourceDefinition, version string) bool { for _, v := range crd.Spec.Versions { if v.Name == version { return v.Served } } return false } // GetCRDStorageVersion returns the storage version for given CRD. func GetCRDStorageVersion(crd *CustomResourceDefinition) (string, error) { for _, v := range crd.Spec.Versions { if v.Storage { return v.Name, nil } } // This should not happened if crd is valid return "", fmt.Errorf("invalid CustomResourceDefinition, no storage version") } // IsStoredVersion returns whether the given version is the storage version of the CRD. func IsStoredVersion(crd *CustomResourceDefinition, version string) bool { for _, v := range crd.Status.StoredVersions { if version == v { return true } } return false } // GetSchemaForVersion returns the validation schema for the given version or nil. func GetSchemaForVersion(crd *CustomResourceDefinition, version string) (*CustomResourceValidation, error) { if !HasPerVersionSchema(crd.Spec.Versions) { return crd.Spec.Validation, nil } if crd.Spec.Validation != nil { return nil, fmt.Errorf("malformed CustomResourceDefinition %s version %s: top-level and per-version schemas must be mutual exclusive", crd.Name, version) } for _, v := range crd.Spec.Versions { if version == v.Name { return v.Schema, nil } } return nil, fmt.Errorf("version %s not found in CustomResourceDefinition: %v", version, crd.Name) } // GetSubresourcesForVersion returns the subresources for given version or nil. func GetSubresourcesForVersion(crd *CustomResourceDefinition, version string) (*CustomResourceSubresources, error) { if !HasPerVersionSubresources(crd.Spec.Versions) { return crd.Spec.Subresources, nil } if crd.Spec.Subresources != nil { return nil, fmt.Errorf("malformed CustomResourceDefinition %s version %s: top-level and per-version subresources must be mutual exclusive", crd.Name, version) } for _, v := range crd.Spec.Versions { if version == v.Name { return v.Subresources, nil } } return nil, fmt.Errorf("version %s not found in CustomResourceDefinition: %v", version, crd.Name) } // GetColumnsForVersion returns the columns for given version or nil. // NOTE: the newly logically-defaulted columns is not pointing to the original CRD object. // One cannot mutate the original CRD columns using the logically-defaulted columns. Please iterate through // the original CRD object instead. func GetColumnsForVersion(crd *CustomResourceDefinition, version string) ([]CustomResourceColumnDefinition, error) { if !HasPerVersionColumns(crd.Spec.Versions) { return serveDefaultColumnsIfEmpty(crd.Spec.AdditionalPrinterColumns), nil } if len(crd.Spec.AdditionalPrinterColumns) > 0 { return nil, fmt.Errorf("malformed CustomResourceDefinition %s version %s: top-level and per-version additionalPrinterColumns must be mutual exclusive", crd.Name, version) } for _, v := range crd.Spec.Versions { if version == v.Name { return serveDefaultColumnsIfEmpty(v.AdditionalPrinterColumns), nil } } return nil, fmt.Errorf("version %s not found in CustomResourceDefinition: %v", version, crd.Name) } // HasPerVersionSchema returns true if a CRD uses per-version schema. func HasPerVersionSchema(versions []CustomResourceDefinitionVersion) bool { for _, v := range versions { if v.Schema != nil { return true } } return false } // HasPerVersionSubresources returns true if a CRD uses per-version subresources. func HasPerVersionSubresources(versions []CustomResourceDefinitionVersion) bool { for _, v := range versions { if v.Subresources != nil { return true } } return false } // HasPerVersionColumns returns true if a CRD uses per-version columns. func HasPerVersionColumns(versions []CustomResourceDefinitionVersion) bool { for _, v := range versions { if len(v.AdditionalPrinterColumns) > 0 { return true } } return false } // serveDefaultColumnsIfEmpty applies logically defaulting to columns, if the input columns is empty. // NOTE: in this way, the newly logically-defaulted columns is not pointing to the original CRD object. // One cannot mutate the original CRD columns using the logically-defaulted columns. Please iterate through // the original CRD object instead. func serveDefaultColumnsIfEmpty(columns []CustomResourceColumnDefinition) []CustomResourceColumnDefinition { if len(columns) > 0 { return columns } return []CustomResourceColumnDefinition{ {Name: "Age", Type: "date", Description: swaggerMetadataDescriptions["creationTimestamp"], JSONPath: ".metadata.creationTimestamp"}, } } // HasVersionServed returns true if given CRD has given version served. func HasVersionServed(crd *CustomResourceDefinition, version string) bool { for _, v := range crd.Spec.Versions { if !v.Served || v.Name != version { continue } return true } return false }
{ "pile_set_name": "Github" }
<http://www.w3.org/2013/TurtleTests/a1> <http://www.w3.org/2013/TurtleTests/b1> <http://www.w3.org/2013/TurtleTests/c1> . <http://example.org/ns/a2> <http://example.org/ns/b2> <http://example.org/ns/c2> . <http://example.org/ns/foo/a3> <http://example.org/ns/foo/b3> <http://example.org/ns/foo/c3> . <http://example.org/ns/foo/bar#a4> <http://example.org/ns/foo/bar#b4> <http://example.org/ns/foo/bar#c4> . <http://example.org/ns2#a5> <http://example.org/ns2#b5> <http://example.org/ns2#c5> .
{ "pile_set_name": "Github" }
Prism.languages.aspnet = Prism.languages.extend('markup', { 'page-directive': { pattern: /<%\s*@.*%>/i, alias: 'tag', inside: { 'page-directive': { pattern: /<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i, alias: 'tag' }, rest: Prism.languages.markup.tag.inside } }, 'directive': { pattern: /<%.*%>/i, alias: 'tag', inside: { 'directive': { pattern: /<%\s*?[$=%#:]{0,2}|%>/i, alias: 'tag' }, rest: Prism.languages.csharp } } }); // Regexp copied from prism-markup, with a negative look-ahead added Prism.languages.aspnet.tag.pattern = /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i; // match directives of attribute value foo="<% Bar %>" Prism.languages.insertBefore('inside', 'punctuation', { 'directive': Prism.languages.aspnet['directive'] }, Prism.languages.aspnet.tag.inside["attr-value"]); Prism.languages.insertBefore('aspnet', 'comment', { 'asp-comment': { pattern: /<%--[\s\S]*?--%>/, alias: ['asp', 'comment'] } }); // script runat="server" contains csharp, not javascript Prism.languages.insertBefore('aspnet', Prism.languages.javascript ? 'script' : 'tag', { 'asp-script': { pattern: /(<script(?=.*runat=['"]?server['"]?)[\s\S]*?>)[\s\S]*?(?=<\/script>)/i, lookbehind: true, alias: ['asp', 'script'], inside: Prism.languages.csharp || {} } });
{ "pile_set_name": "Github" }
################################################################################ # BSD LICENSE # # Copyright(c) 2020 Intel Corporation. All rights reserved. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with the # distribution. # * Neither the name of Intel Corporation nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ################################################################################ --- # tasks file for AppQoS deployment - import_tasks: install_libpqos.yml tags: libpqos - import_tasks: install_venv.yml tags: appqos - import_tasks: generate_ssl_key_certs.yml tags: appqos - import_tasks: start_appqos.yml tags: appqos
{ "pile_set_name": "Github" }
// Copyright (C) 2017 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. cc_binary { name: "uncrypt", srcs: [ "uncrypt.cpp", ], cflags: [ "-Wall", "-Werror", ], static_libs: [ "libbootloader_message", "libotautil", "libfs_mgr", "libbase", "libcutils", "liblog", ], init_rc: [ "uncrypt.rc", ], }
{ "pile_set_name": "Github" }
// RUN: %clang_cc1 %s -triple=renderscript32-none-linux-gnueabi -emit-llvm -o - -Werror | FileCheck %s -check-prefix=CHECK-RS32 // RUN: %clang_cc1 %s -triple=renderscript64-none-linux-android -emit-llvm -o - -Werror | FileCheck %s -check-prefix=CHECK-RS64 // RUN: %clang_cc1 %s -triple=armv7-none-linux-gnueabi -emit-llvm -o - -Werror | FileCheck %s -check-prefix=CHECK-ARM // Ensure that the bitcode has the correct triple // CHECK-RS32: target triple = "armv7-none-linux-gnueabi" // CHECK-RS64: target triple = "aarch64-none-linux-android" // CHECK-ARM: target triple = "armv7-none-linux-gnueabi" // Ensure that long data type has 8-byte size and alignment in RenderScript #ifdef __RENDERSCRIPT__ #define LONG_WIDTH_AND_ALIGN 8 #else #define LONG_WIDTH_AND_ALIGN 4 #endif _Static_assert(sizeof(long) == LONG_WIDTH_AND_ALIGN, "sizeof long is wrong"); _Static_assert(_Alignof(long) == LONG_WIDTH_AND_ALIGN, "sizeof long is wrong"); // CHECK-RS32: i64 @test_long(i64 %v) // CHECK-RS64: i64 @test_long(i64 %v) // CHECK-ARM: i32 @test_long(i32 %v) long test_long(long v) { return v + 1; } // ============================================================================= // Test coercion of aggregate argument or return value into integer arrays // ============================================================================= // ============================================================================= // aggregate parameter <= 4 bytes: coerced to [a x iNN] for both 32-bit and // 64-bit RenderScript // ============================================================================== typedef struct {char c1, c2, c3; } sChar3; typedef struct {short s; char c;} sShortChar; // CHECK-RS32: void @argChar3([3 x i8] %s.coerce) // CHECK-RS64: void @argChar3([3 x i8] %s.coerce) void argChar3(sChar3 s) {} // CHECK-RS32: void @argShortChar([2 x i16] %s.coerce) // CHECK-RS64: void @argShortChar([2 x i16] %s.coerce) void argShortChar(sShortChar s) {} // ============================================================================= // aggregate return value <= 4 bytes: coerced to [a x iNN] for both 32-bit and // 64-bit RenderScript // ============================================================================= // CHECK-RS32: [3 x i8] @retChar3() // CHECK-RS64: [3 x i8] @retChar3() sChar3 retChar3() { sChar3 r; return r; } // CHECK-RS32: [2 x i16] @retShortChar() // CHECK-RS64: [2 x i16] @retShortChar() sShortChar retShortChar() { sShortChar r; return r; } // ============================================================================= // aggregate parameter <= 16 bytes: coerced to [a x iNN] for both 32-bit and // 64-bit RenderScript // ============================================================================= typedef struct {short s1; char c; short s2; } sShortCharShort; typedef struct {int i; short s; char c; } sIntShortChar; typedef struct {long l; int i; } sLongInt; // CHECK-RS32: void @argShortCharShort([3 x i16] %s.coerce) // CHECK-RS64: void @argShortCharShort([3 x i16] %s.coerce) void argShortCharShort(sShortCharShort s) {} // CHECK-RS32: void @argIntShortChar([2 x i32] %s.coerce) // CHECK-RS64: void @argIntShortChar([2 x i32] %s.coerce) void argIntShortChar(sIntShortChar s) {} // CHECK-RS32: void @argLongInt([2 x i64] %s.coerce) // CHECK-RS64: void @argLongInt([2 x i64] %s.coerce) void argLongInt(sLongInt s) {} // ============================================================================= // aggregate return value <= 16 bytes: returned on stack for 32-bit RenderScript // and coerced to [a x iNN] for 64-bit RenderScript // ============================================================================= // CHECK-RS32: void @retShortCharShort(%struct.sShortCharShort* noalias sret %agg.result) // CHECK-RS64: [3 x i16] @retShortCharShort() sShortCharShort retShortCharShort() { sShortCharShort r; return r; } // CHECK-RS32: void @retIntShortChar(%struct.sIntShortChar* noalias sret %agg.result) // CHECK-RS64: [2 x i32] @retIntShortChar() sIntShortChar retIntShortChar() { sIntShortChar r; return r; } // CHECK-RS32: void @retLongInt(%struct.sLongInt* noalias sret %agg.result) // CHECK-RS64: [2 x i64] @retLongInt() sLongInt retLongInt() { sLongInt r; return r; } // ============================================================================= // aggregate parameter <= 64 bytes: coerced to [a x iNN] for 32-bit RenderScript // and passed on the stack for 64-bit RenderScript // ============================================================================= typedef struct {int i1, i2, i3, i4, i5; } sInt5; typedef struct {long l1, l2; char c; } sLong2Char; // CHECK-RS32: void @argInt5([5 x i32] %s.coerce) // CHECK-RS64: void @argInt5(%struct.sInt5* %s) void argInt5(sInt5 s) {} // CHECK-RS32: void @argLong2Char([3 x i64] %s.coerce) // CHECK-RS64: void @argLong2Char(%struct.sLong2Char* %s) void argLong2Char(sLong2Char s) {} // ============================================================================= // aggregate return value <= 64 bytes: returned on stack for both 32-bit and // 64-bit RenderScript // ============================================================================= // CHECK-RS32: void @retInt5(%struct.sInt5* noalias sret %agg.result) // CHECK-RS64: void @retInt5(%struct.sInt5* noalias sret %agg.result) sInt5 retInt5() { sInt5 r; return r;} // CHECK-RS32: void @retLong2Char(%struct.sLong2Char* noalias sret %agg.result) // CHECK-RS64: void @retLong2Char(%struct.sLong2Char* noalias sret %agg.result) sLong2Char retLong2Char() { sLong2Char r; return r;} // ============================================================================= // aggregate parameters and return values > 64 bytes: passed and returned on the // stack for both 32-bit and 64-bit RenderScript // ============================================================================= typedef struct {long l1, l2, l3, l4, l5, l6, l7, l8, l9; } sLong9; // CHECK-RS32: void @argLong9(%struct.sLong9* byval align 8 %s) // CHECK-RS64: void @argLong9(%struct.sLong9* %s) void argLong9(sLong9 s) {} // CHECK-RS32: void @retLong9(%struct.sLong9* noalias sret %agg.result) // CHECK-RS64: void @retLong9(%struct.sLong9* noalias sret %agg.result) sLong9 retLong9() { sLong9 r; return r; }
{ "pile_set_name": "Github" }
## 1.6.0 (2013-03-27) * Update to `hogan.js` as of this [commit](https://github.com/twitter/hogan.js/commit/9a9eb1ab8fbbfedc9de73aeac4f9c1798d190a21) ## 1.5.1 (2013-2-26) * hamstache\_extensions and slimstache\_extensions options - @AlexRiedler * pass scope and locals to `haml` and `slim` - @AlexRiedler ## 1.5.0 (2013-2-06) * YAML configuration support - @apai4 ## 1.4.0 (2013-1-02) * **slimstache** support, use `HoganAssets::Config.slim_options` to set options for `slim` - @sars * Silence tilt require warning ## 1.3.4 (2012-11-09) * Use `HoganAssets::Config.haml_options` to set options for `haml` - @lautis ## 1.3.3 (2012-09-10) * Use `HoganAssets::Config.template_namespace` to use a custom namespace for your templates - @adamstrickland ## 1.3.2 (2012-08-04) * Use `HoganAssets::Config.path_prefix` to strip a common path prefix from your template names ## 1.3.1 (2012-06-21) * #11 - Fix **hamstache** support, broken in 1.3.0 ## 1.3.0 (2012-06-18) * #9 - Support lambda construct in **mustache**, set via `config.lambda_support = true`
{ "pile_set_name": "Github" }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/common/swapped_out_messages.h" #include "content/common/accessibility_messages.h" #include "content/common/frame_messages.h" #include "content/common/input_messages.h" #include "content/common/view_messages.h" #include "content/public/common/content_client.h" namespace content { bool SwappedOutMessages::CanSendWhileSwappedOut(const IPC::Message* msg) { // We filter out most IPC messages when swapped out. However, some are // important (e.g., ACKs) for keeping the browser and renderer state // consistent in case we later return to the same renderer. switch (msg->type()) { // Handled by RenderWidgetHost. case InputHostMsg_HandleInputEvent_ACK::ID: case ViewHostMsg_UpdateRect::ID: // Allow targeted navigations while swapped out. case ViewHostMsg_OpenURL::ID: case ViewHostMsg_Focus::ID: // Handled by RenderViewHost. case ViewHostMsg_RenderProcessGone::ID: case ViewHostMsg_ShouldClose_ACK::ID: case ViewHostMsg_SwapOut_ACK::ID: case ViewHostMsg_ClosePage_ACK::ID: case ViewHostMsg_DomOperationResponse::ID: case ViewHostMsg_SwapCompositorFrame::ID: case ViewHostMsg_UpdateIsDelayed::ID: case ViewHostMsg_DidActivateAcceleratedCompositing::ID: // Allow cross-process JavaScript calls. case ViewHostMsg_RouteCloseEvent::ID: case ViewHostMsg_RouteMessageEvent::ID: // Handled by RenderFrameHost. case FrameHostMsg_SwapOut_ACK::ID: // Frame detach must occur after the RenderView has swapped out. case FrameHostMsg_Detach::ID: case FrameHostMsg_CompositorFrameSwappedACK::ID: case FrameHostMsg_BuffersSwappedACK::ID: case FrameHostMsg_ReclaimCompositorResources::ID: // Input events propagate from parent to child. case FrameHostMsg_ForwardInputEvent::ID: case FrameHostMsg_InitializeChildFrame::ID: return true; default: break; } // Check with the embedder as well. ContentClient* client = GetContentClient(); return client->CanSendWhileSwappedOut(msg); } bool SwappedOutMessages::CanHandleWhileSwappedOut( const IPC::Message& msg) { // Any message the renderer is allowed to send while swapped out should // be handled by the browser. if (CanSendWhileSwappedOut(&msg)) return true; // We drop most other messages that arrive from a swapped out renderer. // However, some are important (e.g., ACKs) for keeping the browser and // renderer state consistent in case we later return to the renderer. // Note that synchronous messages that are not handled will receive an // error reply instead, to avoid leaving the renderer in a stuck state. switch (msg.type()) { // Sends an ACK. case ViewHostMsg_ShowView::ID: // Sends an ACK. case ViewHostMsg_ShowWidget::ID: // Sends an ACK. case ViewHostMsg_ShowFullscreenWidget::ID: // Updates browser state. case ViewHostMsg_RenderViewReady::ID: // Updates the previous navigation entry. case ViewHostMsg_UpdateState::ID: // Sends an ACK. case ViewHostMsg_UpdateTargetURL::ID: // We allow closing even if we are in the process of swapping out. case ViewHostMsg_Close::ID: // Sends an ACK. case ViewHostMsg_RequestMove::ID: // Sends an ACK. case AccessibilityHostMsg_Events::ID: #if defined(USE_X11) // Synchronous message when leaving a page with plugin. In this case, // we want to destroy the plugin rather than return an error message. case ViewHostMsg_DestroyPluginContainer::ID: #endif return true; default: break; } // Check with the embedder as well. ContentClient* client = GetContentClient(); return client->CanHandleWhileSwappedOut(msg); } } // namespace content
{ "pile_set_name": "Github" }
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>plugins</groupId> <artifactId>plugin-parent</artifactId> <version>1.0</version> </parent> <artifactId>PluginCreationTest</artifactId> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <addMavenDescriptor>false</addMavenDescriptor> <manifestEntries> <Vehicle-Brand>SICS</Vehicle-Brand> <Vehicle-Name>MOPED</Vehicle-Name> <Ecu>2</Ecu> </manifestEntries> </archive> </configuration> </plugin> </plugins> </build> </project>
{ "pile_set_name": "Github" }
/******************************************************************************* * Copyright (c) 2014 Bruno Medeiros and other Contributors. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Bruno Medeiros - initial API and implementation *******************************************************************************/ package melnorme.util.swt.components.fields; import melnorme.lang.ide.ui.utils.ControlUtils; import melnorme.utilbox.concurrency.OperationCancellation; public class FileTextField extends ButtonTextField { public static final String DEFAULT_BUTTON_LABEL = "B&rowse..."; public FileTextField(String label) { super(label, FileTextField.DEFAULT_BUTTON_LABEL); } public FileTextField(String label, String buttonlabel) { super(label, buttonlabel); } @Override protected String getNewValueFromButtonSelection() throws OperationCancellation { return ControlUtils.openFileDialog(getFieldValue(), button.getShell()); } }
{ "pile_set_name": "Github" }
{% extends 'LadbCoreBundle:Knowledge:_form-fieldset-value.part.html.twig' %} {% block dataFormGroup %} {{ form_errors(form.data) }} {{ form_widget(form.data, { 'attr':{ 'class':'form-control input-lg ladb-autosize', 'rows':5, 'placeholder':fieldLabel } }) }} {% endblock %}
{ "pile_set_name": "Github" }
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- def network_client_factory(cli_ctx, aux_subscriptions=None, **_): from azure.cli.core.commands.client_factory import get_mgmt_service_client from .profiles import CUSTOM_ER_CC return get_mgmt_service_client(cli_ctx, CUSTOM_ER_CC, aux_subscriptions=aux_subscriptions) def cf_express_route_cross_connection_peerings(cli_ctx, _): return network_client_factory(cli_ctx).express_route_cross_connection_peerings def cf_express_route_cross_connections(cli_ctx, _): return network_client_factory(cli_ctx).express_route_cross_connections
{ "pile_set_name": "Github" }
package org.docear.plugin.core.actions; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import org.docear.plugin.core.ui.NotificationBar; import org.freeplane.core.ui.AFreeplaneAction; public class DocearShowNotificationBar extends AFreeplaneAction { /** * */ private static final long serialVersionUID = 1L; public static final String key = "blabla"; public DocearShowNotificationBar() { super(key); // TODO Auto-generated constructor stub } public void actionPerformed(ActionEvent e) { NotificationBar.showNotificationBar("Und noch ein Test....", "Update now", new ActionListener() { public void actionPerformed(ActionEvent e) { System.out.println("Ok ich update jetzt....."); } }); NotificationBar.showNotificationBar("Zweite Message gaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaanz langes bla bla....", "Convert", new ActionListener() { public void actionPerformed(ActionEvent e) { System.out.println("Ich tu was anderes....."); } }); } }
{ "pile_set_name": "Github" }
From d68db9f2cee975aad5e07b44485615f3d842ab45 Mon Sep 17 00:00:00 2001 From: Darik Horn <dajhorn@vanadac.com> Date: Fri, 11 Jul 2014 16:17:18 -0400 Subject: [PATCH] Change GetExeDir to GetStateDir in Cedar and Mayaqua. Resolve this AppArmor error by ensuring that certificate files files are written into /var/lib/softether instead of the current working directory: Profile: /usr/sbin/softetherd Operation: mkdir Name: /usr/sbin/chain_certs Denied: c Logfile: /var/log/kern.log type=1400 audit: apparmor="DENIED" operation="mkdir" profile="/usr/sbin/softetherd" name="/usr/sbin/chain_certs/" pid=36448 comm="softetherd" requested_mask="c" denied_mask="c" fsuid=0 ouid=0 Taken from Github https://github.com/dajhorn/SoftEtherVPN/commit/d68db9f2cee975aad5e07b44485615f3d842ab45. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> --- src/Cedar/Protocol.c | 12 ++++++------ src/Mayaqua/Network.c | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) Index: b/src/Cedar/Protocol.c =================================================================== --- a/src/Cedar/Protocol.c +++ b/src/Cedar/Protocol.c @@ -161,10 +161,10 @@ UINT i; DIRLIST *dir; wchar_t dirname[MAX_SIZE]; - wchar_t exedir[MAX_SIZE]; + wchar_t statedir[MAX_SIZE]; - GetExeDirW(exedir, sizeof(exedir)); - CombinePathW(dirname, sizeof(dirname), exedir, L"chain_certs"); + GetStateDirW(statedir, sizeof(statedir)); + CombinePathW(dirname, sizeof(dirname), statedir, L"chain_certs"); MakeDirExW(dirname); if (auto_save) @@ -461,7 +461,7 @@ void AddAllChainCertsToCertList(LIST *o) { wchar_t dirname[MAX_SIZE]; - wchar_t exedir[MAX_SIZE]; + wchar_t statedir[MAX_SIZE]; DIRLIST *dir; // Validate arguments if (o == NULL) @@ -469,9 +469,9 @@ return; } - GetExeDirW(exedir, sizeof(exedir)); + GetStateDirW(statedir, sizeof(statedir)); - CombinePathW(dirname, sizeof(dirname), exedir, L"chain_certs"); + CombinePathW(dirname, sizeof(dirname), statedir, L"chain_certs"); MakeDirExW(dirname); Index: b/src/Mayaqua/Network.c =================================================================== --- a/src/Mayaqua/Network.c +++ b/src/Mayaqua/Network.c @@ -12588,7 +12588,7 @@ void AddChainSslCertOnDirectory(struct ssl_ctx_st *ctx) { wchar_t dirname[MAX_SIZE]; - wchar_t exedir[MAX_SIZE]; + wchar_t statedir[MAX_SIZE]; wchar_t txtname[MAX_SIZE]; DIRLIST *dir; LIST *o; @@ -12602,9 +12602,9 @@ o = NewListFast(NULL); - GetExeDirW(exedir, sizeof(exedir)); + GetStateDirW(statedir, sizeof(statedir)); - CombinePathW(dirname, sizeof(dirname), exedir, L"chain_certs"); + CombinePathW(dirname, sizeof(dirname), statedir, L"chain_certs"); MakeDirExW(dirname);
{ "pile_set_name": "Github" }
from __future__ import absolute_import import datetime import flask from apscheduler.job import Job from .utils import job_to_dict import json # noqa loads = json.loads def dumps(obj, indent=None): return json.dumps(obj, indent=indent, cls=JSONEncoder) def jsonify(data, status=None): indent = None if flask.current_app.config['JSONIFY_PRETTYPRINT_REGULAR'] and not flask.request.is_xhr: indent = 2 return flask.current_app.response_class(dumps(data, indent=indent), status=status, mimetype='application/json') class JSONEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, datetime.datetime): return obj.isoformat() if isinstance(obj, Job): return job_to_dict(obj) return super(JSONEncoder, self).default(obj)
{ "pile_set_name": "Github" }
PROVIDE ( Cache_Read_Disable = 0x400047f0 ); PROVIDE ( Cache_Read_Enable = 0x40004678 ); PROVIDE ( FilePacketSendReqMsgProc = 0x400035a0 ); PROVIDE ( FlashDwnLdParamCfgMsgProc = 0x4000368c ); PROVIDE ( FlashDwnLdStartMsgProc = 0x40003538 ); PROVIDE ( FlashDwnLdStopReqMsgProc = 0x40003658 ); PROVIDE ( GetUartDevice = 0x40003f4c ); PROVIDE ( MD5Final = 0x40009900 ); PROVIDE ( MD5Init = 0x40009818 ); PROVIDE ( MD5Update = 0x40009834 ); PROVIDE ( MemDwnLdStartMsgProc = 0x400036c4 ); PROVIDE ( MemDwnLdStopReqMsgProc = 0x4000377c ); PROVIDE ( MemPacketSendReqMsgProc = 0x400036f0 ); PROVIDE ( RcvMsg = 0x40003eac ); PROVIDE ( SHA1Final = 0x4000b648 ); PROVIDE ( SHA1Init = 0x4000b584 ); PROVIDE ( SHA1Transform = 0x4000a364 ); PROVIDE ( SHA1Update = 0x4000b5a8 ); PROVIDE ( SPI_read_status = 0x400043c8 ); PROVIDE ( SPI_write_status = 0x40004400 ); PROVIDE ( SPI_write_enable = 0x4000443c ); PROVIDE ( Wait_SPI_Idle = 0x4000448c ); PROVIDE ( Enable_QMode = 0x400044c0 ); PROVIDE ( SPIEraseArea = 0x40004b44 ); PROVIDE ( SPIEraseBlock = 0x400049b4 ); PROVIDE ( SPIEraseChip = 0x40004984 ); PROVIDE ( SPIEraseSector = 0x40004a00 ); PROVIDE ( SPILock = 0x400048a8 ); PROVIDE ( SPIParamCfg = 0x40004c2c ); PROVIDE ( SPIRead = 0x40004b1c ); PROVIDE ( SPIReadModeCnfig = 0x400048ec ); PROVIDE ( SPIUnlock = 0x40004878 ); PROVIDE ( SPIWrite = 0x40004a4c ); PROVIDE ( SelectSpiFunction = 0x40003f58 ); PROVIDE ( SendMsg = 0x40003cf4 ); PROVIDE ( UartConnCheck = 0x40003230 ); PROVIDE ( UartConnectProc = 0x400037a0 ); PROVIDE ( UartDwnLdProc = 0x40003368 ); PROVIDE ( UartGetCmdLn = 0x40003ef4 ); PROVIDE ( UartRegReadProc = 0x4000381c ); PROVIDE ( UartRegWriteProc = 0x400037ac ); PROVIDE ( UartRxString = 0x40003c30 ); PROVIDE ( Uart_Init = 0x40003a14 ); PROVIDE ( _ResetHandler = 0x400000a4 ); PROVIDE ( _ResetVector = 0x40000080 ); PROVIDE ( __adddf3 = 0x4000c538 ); PROVIDE ( __addsf3 = 0x4000c180 ); PROVIDE ( __divdf3 = 0x4000cb94 ); PROVIDE ( __divdi3 = 0x4000ce60 ); PROVIDE ( __divsi3 = 0x4000dc88 ); PROVIDE ( __extendsfdf2 = 0x4000cdfc ); PROVIDE ( __fixdfsi = 0x4000ccb8 ); PROVIDE ( __fixunsdfsi = 0x4000cd00 ); PROVIDE ( __fixunssfsi = 0x4000c4c4 ); PROVIDE ( __floatsidf = 0x4000e2f0 ); PROVIDE ( __floatsisf = 0x4000e2ac ); PROVIDE ( __floatunsidf = 0x4000e2e8 ); PROVIDE ( __floatunsisf = 0x4000e2a4 ); PROVIDE ( __muldf3 = 0x4000c8f0 ); PROVIDE ( __muldi3 = 0x40000650 ); PROVIDE ( __mulsf3 = 0x4000c3dc ); PROVIDE ( __subdf3 = 0x4000c688 ); PROVIDE ( __subsf3 = 0x4000c268 ); PROVIDE ( __truncdfsf2 = 0x4000cd5c ); PROVIDE ( __udivdi3 = 0x4000d310 ); PROVIDE ( __udivsi3 = 0x4000e21c ); PROVIDE ( __umoddi3 = 0x4000d770 ); PROVIDE ( __umodsi3 = 0x4000e268 ); PROVIDE ( __umulsidi3 = 0x4000dcf0 ); PROVIDE ( _rom_store = 0x4000e388 ); PROVIDE ( _rom_store_table = 0x4000e328 ); PROVIDE ( _start = 0x4000042c ); PROVIDE ( _xtos_alloca_handler = 0x4000dbe0 ); PROVIDE ( _xtos_c_wrapper_handler = 0x40000598 ); PROVIDE ( _xtos_cause3_handler = 0x40000590 ); PROVIDE ( _xtos_ints_off = 0x4000bda4 ); PROVIDE ( _xtos_ints_on = 0x4000bd84 ); PROVIDE ( _xtos_l1int_handler = 0x4000048c ); PROVIDE ( _xtos_p_none = 0x4000dbf8 ); PROVIDE ( _xtos_restore_intlevel = 0x4000056c ); PROVIDE ( _xtos_return_from_exc = 0x4000dc54 ); PROVIDE ( _xtos_set_exception_handler = 0x40000454 ); PROVIDE ( _xtos_set_interrupt_handler = 0x4000bd70 ); PROVIDE ( _xtos_set_interrupt_handler_arg = 0x4000bd28 ); PROVIDE ( _xtos_set_intlevel = 0x4000dbfc ); PROVIDE ( _xtos_set_min_intlevel = 0x4000dc18 ); PROVIDE ( _xtos_set_vpri = 0x40000574 ); PROVIDE ( _xtos_syscall_handler = 0x4000dbe4 ); PROVIDE ( _xtos_unhandled_exception = 0x4000dc44 ); PROVIDE ( _xtos_unhandled_interrupt = 0x4000dc3c ); PROVIDE ( aes_decrypt = 0x400092d4 ); PROVIDE ( aes_decrypt_deinit = 0x400092e4 ); PROVIDE ( aes_decrypt_init = 0x40008ea4 ); PROVIDE ( aes_unwrap = 0x40009410 ); PROVIDE ( base64_decode = 0x40009648 ); PROVIDE ( base64_encode = 0x400094fc ); PROVIDE ( bzero = 0x4000de84 ); PROVIDE ( cmd_parse = 0x40000814 ); PROVIDE ( conv_str_decimal = 0x40000b24 ); PROVIDE ( conv_str_hex = 0x40000cb8 ); PROVIDE ( convert_para_str = 0x40000a60 ); PROVIDE ( dtm_get_intr_mask = 0x400026d0 ); PROVIDE ( dtm_params_init = 0x4000269c ); PROVIDE ( dtm_set_intr_mask = 0x400026c8 ); PROVIDE ( dtm_set_params = 0x400026dc ); PROVIDE ( eprintf = 0x40001d14 ); PROVIDE ( eprintf_init_buf = 0x40001cb8 ); PROVIDE ( eprintf_to_host = 0x40001d48 ); PROVIDE ( est_get_printf_buf_remain_len = 0x40002494 ); PROVIDE ( est_reset_printf_buf_len = 0x4000249c ); PROVIDE ( ets_bzero = 0x40002ae8 ); PROVIDE ( ets_char2xdigit = 0x40002b74 ); PROVIDE ( ets_delay_us = 0x40002ecc ); PROVIDE ( ets_enter_sleep = 0x400027b8 ); PROVIDE ( ets_external_printf = 0x40002578 ); PROVIDE ( ets_get_cpu_frequency = 0x40002f0c ); PROVIDE ( ets_getc = 0x40002bcc ); PROVIDE ( ets_install_external_printf = 0x40002450 ); PROVIDE ( ets_install_putc1 = 0x4000242c ); PROVIDE ( ets_install_putc2 = 0x4000248c ); PROVIDE ( ets_install_uart_printf = 0x40002438 ); /* Undocumented function to print character to UART */ PROVIDE ( ets_uart_putc1 = 0x40001dcc ); /* permanently hide reimplemented ets_intr_*lock(), see #6484 PROVIDE ( ets_intr_lock = 0x40000f74 ); PROVIDE ( ets_intr_unlock = 0x40000f80 ); */ PROVIDE ( ets_isr_attach = 0x40000f88 ); PROVIDE ( ets_isr_mask = 0x40000f98 ); PROVIDE ( ets_isr_unmask = 0x40000fa8 ); PROVIDE ( ets_memcmp = 0x400018d4 ); PROVIDE ( ets_memcpy = 0x400018b4 ); PROVIDE ( ets_memmove = 0x400018c4 ); PROVIDE ( ets_memset = 0x400018a4 ); /* renamed to ets_post_rom(), see #6484 PROVIDE ( ets_post = 0x40000e24 ); */ PROVIDE ( ets_post_rom = 0x40000e24 ); PROVIDE ( ets_printf = 0x400024cc ); PROVIDE ( ets_putc = 0x40002be8 ); PROVIDE ( ets_rtc_int_register = 0x40002a40 ); PROVIDE ( ets_run = 0x40000e04 ); PROVIDE ( ets_set_idle_cb = 0x40000dc0 ); PROVIDE ( ets_set_user_start = 0x40000fbc ); PROVIDE ( ets_str2macaddr = 0x40002af8 ); PROVIDE ( ets_strcmp = 0x40002aa8 ); PROVIDE ( ets_strcpy = 0x40002a88 ); PROVIDE ( ets_strlen = 0x40002ac8 ); PROVIDE ( ets_strncmp = 0x40002ab8 ); PROVIDE ( ets_strncpy = 0x40002a98 ); PROVIDE ( ets_strstr = 0x40002ad8 ); PROVIDE ( ets_task = 0x40000dd0 ); PROVIDE ( ets_timer_arm = 0x40002cc4 ); PROVIDE ( ets_timer_disarm = 0x40002d40 ); PROVIDE ( ets_timer_done = 0x40002d80 ); PROVIDE ( ets_timer_handler_isr = 0x40002da8 ); PROVIDE ( ets_timer_init = 0x40002e68 ); PROVIDE ( ets_timer_setfn = 0x40002c48 ); PROVIDE ( ets_uart_printf = 0x40002544 ); PROVIDE ( ets_update_cpu_frequency = 0x40002f04 ); PROVIDE ( ets_vprintf = 0x40001f00 ); PROVIDE ( ets_wdt_disable = 0x400030f0 ); PROVIDE ( ets_wdt_enable = 0x40002fa0 ); PROVIDE ( ets_wdt_get_mode = 0x40002f34 ); PROVIDE ( ets_wdt_init = 0x40003170 ); PROVIDE ( ets_wdt_restore = 0x40003158 ); PROVIDE ( ets_write_char = 0x40001da0 ); PROVIDE ( get_first_seg = 0x4000091c ); PROVIDE ( gpio_init = 0x40004c50 ); PROVIDE ( gpio_input_get = 0x40004cf0 ); PROVIDE ( gpio_intr_ack = 0x40004dcc ); PROVIDE ( gpio_intr_handler_register = 0x40004e28 ); PROVIDE ( gpio_intr_pending = 0x40004d88 ); PROVIDE ( gpio_intr_test = 0x40004efc ); PROVIDE ( gpio_output_set = 0x40004cd0 ); PROVIDE ( gpio_pin_intr_state_set = 0x40004d90 ); PROVIDE ( gpio_pin_wakeup_disable = 0x40004ed4 ); PROVIDE ( gpio_pin_wakeup_enable = 0x40004e90 ); PROVIDE ( gpio_register_get = 0x40004d5c ); PROVIDE ( gpio_register_set = 0x40004d04 ); PROVIDE ( hmac_md5 = 0x4000a2cc ); PROVIDE ( hmac_md5_vector = 0x4000a160 ); PROVIDE ( hmac_sha1 = 0x4000ba28 ); PROVIDE ( hmac_sha1_vector = 0x4000b8b4 ); PROVIDE ( lldesc_build_chain = 0x40004f40 ); PROVIDE ( lldesc_num2link = 0x40005050 ); PROVIDE ( lldesc_set_owner = 0x4000507c ); PROVIDE ( main = 0x40000fec ); PROVIDE ( md5_vector = 0x400097ac ); PROVIDE ( mem_calloc = 0x40001c2c ); PROVIDE ( mem_free = 0x400019e0 ); PROVIDE ( mem_init = 0x40001998 ); PROVIDE ( mem_malloc = 0x40001b40 ); PROVIDE ( mem_realloc = 0x40001c6c ); PROVIDE ( mem_trim = 0x40001a14 ); PROVIDE ( mem_zalloc = 0x40001c58 ); PROVIDE ( memcmp = 0x4000dea8 ); PROVIDE ( memcpy = 0x4000df48 ); PROVIDE ( memmove = 0x4000e04c ); PROVIDE ( memset = 0x4000e190 ); PROVIDE ( multofup = 0x400031c0 ); PROVIDE ( pbkdf2_sha1 = 0x4000b840 ); PROVIDE ( phy_get_romfuncs = 0x40006b08 ); PROVIDE ( rand = 0x40000600 ); PROVIDE ( rc4_skip = 0x4000dd68 ); PROVIDE ( recv_packet = 0x40003d08 ); PROVIDE ( remove_head_space = 0x40000a04 ); PROVIDE ( rijndaelKeySetupDec = 0x40008dd0 ); PROVIDE ( rijndaelKeySetupEnc = 0x40009300 ); PROVIDE ( rom_abs_temp = 0x400060c0 ); PROVIDE ( rom_ana_inf_gating_en = 0x40006b10 ); PROVIDE ( rom_cal_tos_v50 = 0x40007a28 ); PROVIDE ( rom_chip_50_set_channel = 0x40006f84 ); PROVIDE ( rom_chip_v5_disable_cca = 0x400060d0 ); PROVIDE ( rom_chip_v5_enable_cca = 0x400060ec ); PROVIDE ( rom_chip_v5_rx_init = 0x4000711c ); PROVIDE ( rom_chip_v5_sense_backoff = 0x4000610c ); PROVIDE ( rom_chip_v5_tx_init = 0x4000718c ); PROVIDE ( rom_dc_iq_est = 0x4000615c ); PROVIDE ( rom_en_pwdet = 0x400061b8 ); PROVIDE ( rom_get_bb_atten = 0x40006238 ); PROVIDE ( rom_get_corr_power = 0x40006260 ); PROVIDE ( rom_get_fm_sar_dout = 0x400062dc ); PROVIDE ( rom_get_noisefloor = 0x40006394 ); PROVIDE ( rom_get_power_db = 0x400063b0 ); PROVIDE ( rom_i2c_readReg = 0x40007268 ); PROVIDE ( rom_i2c_readReg_Mask = 0x4000729c ); PROVIDE ( rom_i2c_writeReg = 0x400072d8 ); PROVIDE ( rom_i2c_writeReg_Mask = 0x4000730c ); PROVIDE ( rom_iq_est_disable = 0x40006400 ); PROVIDE ( rom_iq_est_enable = 0x40006430 ); PROVIDE ( rom_linear_to_db = 0x40006484 ); PROVIDE ( rom_mhz2ieee = 0x400065a4 ); PROVIDE ( rom_pbus_dco___SA2 = 0x40007bf0 ); PROVIDE ( rom_pbus_debugmode = 0x4000737c ); PROVIDE ( rom_pbus_enter_debugmode = 0x40007410 ); PROVIDE ( rom_pbus_exit_debugmode = 0x40007448 ); PROVIDE ( rom_pbus_force_test = 0x4000747c ); PROVIDE ( rom_pbus_rd = 0x400074d8 ); PROVIDE ( rom_pbus_set_rxgain = 0x4000754c ); PROVIDE ( rom_pbus_set_txgain = 0x40007610 ); PROVIDE ( rom_pbus_workmode = 0x40007648 ); PROVIDE ( rom_pbus_xpd_rx_off = 0x40007688 ); PROVIDE ( rom_pbus_xpd_rx_on = 0x400076cc ); PROVIDE ( rom_pbus_xpd_tx_off = 0x400076fc ); PROVIDE ( rom_pbus_xpd_tx_on = 0x40007740 ); PROVIDE ( rom_pbus_xpd_tx_on__low_gain = 0x400077a0 ); PROVIDE ( rom_phy_reset_req = 0x40007804 ); PROVIDE ( rom_restart_cal = 0x4000781c ); PROVIDE ( rom_rfcal_pwrctrl = 0x40007eb4 ); PROVIDE ( rom_rfcal_rxiq = 0x4000804c ); PROVIDE ( rom_rfcal_rxiq_set_reg = 0x40008264 ); PROVIDE ( rom_rfcal_txcap = 0x40008388 ); PROVIDE ( rom_rfcal_txiq = 0x40008610 ); PROVIDE ( rom_rfcal_txiq_cover = 0x400088b8 ); PROVIDE ( rom_rfcal_txiq_set_reg = 0x40008a70 ); PROVIDE ( rom_rfpll_reset = 0x40007868 ); PROVIDE ( rom_rfpll_set_freq = 0x40007968 ); PROVIDE ( rom_rxiq_cover_mg_mp = 0x40008b6c ); PROVIDE ( rom_rxiq_get_mis = 0x40006628 ); PROVIDE ( rom_sar_init = 0x40006738 ); PROVIDE ( rom_set_ana_inf_tx_scale = 0x4000678c ); PROVIDE ( rom_set_channel_freq = 0x40006c50 ); PROVIDE ( rom_set_loopback_gain = 0x400067c8 ); PROVIDE ( rom_set_noise_floor = 0x40006830 ); PROVIDE ( rom_set_rxclk_en = 0x40006550 ); PROVIDE ( rom_set_txbb_atten = 0x40008c6c ); PROVIDE ( rom_set_txclk_en = 0x4000650c ); PROVIDE ( rom_set_txiq_cal = 0x40008d34 ); PROVIDE ( rom_start_noisefloor = 0x40006874 ); PROVIDE ( rom_start_tx_tone = 0x400068b4 ); PROVIDE ( rom_stop_tx_tone = 0x4000698c ); PROVIDE ( rom_tx_mac_disable = 0x40006a98 ); PROVIDE ( rom_tx_mac_enable = 0x40006ad4 ); PROVIDE ( rom_txtone_linear_pwr = 0x40006a1c ); PROVIDE ( rom_write_rfpll_sdm = 0x400078dc ); PROVIDE ( roundup2 = 0x400031b4 ); PROVIDE ( rtc_enter_sleep = 0x40002870 ); PROVIDE ( rtc_get_reset_reason = 0x400025e0 ); PROVIDE ( rtc_intr_handler = 0x400029ec ); PROVIDE ( rtc_set_sleep_mode = 0x40002668 ); PROVIDE ( save_rxbcn_mactime = 0x400027a4 ); PROVIDE ( save_tsf_us = 0x400027ac ); PROVIDE ( send_packet = 0x40003c80 ); PROVIDE ( sha1_prf = 0x4000ba48 ); PROVIDE ( sha1_vector = 0x4000a2ec ); PROVIDE ( sip_alloc_to_host_evt = 0x40005180 ); PROVIDE ( sip_get_ptr = 0x400058a8 ); PROVIDE ( sip_get_state = 0x40005668 ); PROVIDE ( sip_init_attach = 0x4000567c ); PROVIDE ( sip_install_rx_ctrl_cb = 0x4000544c ); PROVIDE ( sip_install_rx_data_cb = 0x4000545c ); PROVIDE ( sip_post = 0x400050fc ); PROVIDE ( sip_post_init = 0x400056c4 ); PROVIDE ( sip_reclaim_from_host_cmd = 0x4000534c ); PROVIDE ( sip_reclaim_tx_data_pkt = 0x400052c0 ); PROVIDE ( sip_send = 0x40005808 ); PROVIDE ( sip_to_host_chain_append = 0x40005864 ); PROVIDE ( sip_to_host_evt_send_done = 0x40005234 ); PROVIDE ( slc_add_credits = 0x400060ac ); PROVIDE ( slc_enable = 0x40005d90 ); PROVIDE ( slc_from_host_chain_fetch = 0x40005f24 ); PROVIDE ( slc_from_host_chain_recycle = 0x40005e94 ); PROVIDE ( slc_init_attach = 0x40005c50 ); PROVIDE ( slc_init_credit = 0x4000608c ); PROVIDE ( slc_pause_from_host = 0x40006014 ); PROVIDE ( slc_reattach = 0x40005c1c ); PROVIDE ( slc_resume_from_host = 0x4000603c ); PROVIDE ( slc_select_tohost_gpio = 0x40005dc0 ); PROVIDE ( slc_select_tohost_gpio_mode = 0x40005db8 ); PROVIDE ( slc_send_to_host_chain = 0x40005de4 ); PROVIDE ( slc_set_host_io_max_window = 0x40006068 ); PROVIDE ( slc_to_host_chain_recycle = 0x40005f10 ); PROVIDE ( software_reset = 0x4000264c ); PROVIDE ( spi_flash_attach = 0x40004644 ); PROVIDE ( srand = 0x400005f0 ); PROVIDE ( strcmp = 0x4000bdc8 ); PROVIDE ( strcpy = 0x4000bec8 ); PROVIDE ( strlen = 0x4000bf4c ); PROVIDE ( strncmp = 0x4000bfa8 ); PROVIDE ( strncpy = 0x4000c0a0 ); PROVIDE ( strstr = 0x4000e1e0 ); PROVIDE ( timer_insert = 0x40002c64 ); PROVIDE ( uartAttach = 0x4000383c ); PROVIDE ( uart_baudrate_detect = 0x40003924 ); PROVIDE ( uart_buff_switch = 0x400038a4 ); PROVIDE ( uart_rx_intr_handler = 0x40003bbc ); PROVIDE ( uart_rx_one_char = 0x40003b8c ); PROVIDE ( uart_rx_one_char_block = 0x40003b64 ); PROVIDE ( uart_rx_readbuff = 0x40003ec8 ); PROVIDE ( uart_tx_one_char = 0x40003b30 ); PROVIDE ( wepkey_128 = 0x4000bc40 ); PROVIDE ( wepkey_64 = 0x4000bb3c ); PROVIDE ( xthal_bcopy = 0x40000688 ); PROVIDE ( xthal_copy123 = 0x4000074c ); PROVIDE ( xthal_get_ccompare = 0x4000dd4c ); PROVIDE ( xthal_get_ccount = 0x4000dd38 ); PROVIDE ( xthal_get_interrupt = 0x4000dd58 ); PROVIDE ( xthal_get_intread = 0x4000dd58 ); PROVIDE ( xthal_memcpy = 0x400006c4 ); PROVIDE ( xthal_set_ccompare = 0x4000dd40 ); PROVIDE ( xthal_set_intclear = 0x4000dd60 ); PROVIDE ( xthal_spill_registers_into_stack_nw = 0x4000e320 ); PROVIDE ( xthal_window_spill = 0x4000e324 ); PROVIDE ( xthal_window_spill_nw = 0x4000e320 ); PROVIDE ( Te0 = 0x3fffccf0 ); PROVIDE ( Td0 = 0x3fffd100 ); PROVIDE ( Td4s = 0x3fffd500); PROVIDE ( rcons = 0x3fffd0f0); PROVIDE ( UartDev = 0x3fffde10 ); PROVIDE ( flashchip = 0x3fffc714);
{ "pile_set_name": "Github" }
import React, { Component } from 'react'; import { Chart, Tooltip, Geom, Coord } from 'bizcharts'; import { DataView } from '@antv/data-set'; import { Divider } from 'antd'; import classNames from 'classnames'; import ReactFitText from 'react-fittext'; import Debounce from 'lodash-decorators/debounce'; import Bind from 'lodash-decorators/bind'; import ResizeObserver from 'resize-observer-polyfill'; import styles from './index.less'; /* eslint react/no-danger:0 */ class Pie extends Component { state = { height: 0, legendData: [], legendBlock: false, }; componentDidMount() { window.addEventListener( 'resize', () => { this.requestRef = requestAnimationFrame(() => this.resize()); }, { passive: true } ); this.resizeObserver(); } componentDidUpdate(preProps) { const { data } = this.props; if (data !== preProps.data) { // because of charts data create when rendered // so there is a trick for get rendered time this.getLegendData(); } } componentWillUnmount() { window.cancelAnimationFrame(this.requestRef); window.removeEventListener('resize', this.resize); this.resize.cancel(); } getG2Instance = chart => { this.chart = chart; requestAnimationFrame(() => { this.getLegendData(); this.resize(); }); }; // for custom lengend view getLegendData = () => { if (!this.chart) return; const geom = this.chart.getAllGeoms()[0]; // 获取所有的图形 if (!geom) return; const items = geom.get('dataArray') || []; // 获取图形对应的 const legendData = items.map(item => { /* eslint no-underscore-dangle:0 */ const origin = item[0]._origin; origin.color = item[0].color; origin.checked = true; return origin; }); this.setState({ legendData, }); }; handleRoot = n => { this.root = n; }; handleLegendClick = (item, i) => { const newItem = item; newItem.checked = !newItem.checked; const { legendData } = this.state; legendData[i] = newItem; const filteredLegendData = legendData.filter(l => l.checked).map(l => l.x); if (this.chart) { this.chart.filter('x', val => filteredLegendData.indexOf(val) > -1); } this.setState({ legendData, }); }; resizeObserver() { const ro = new ResizeObserver(entries => { const { height } = entries[0].contentRect; this.setState(preState => { if (preState.height !== height) { return { height, }; } return null; }); }); if (this.chartDom) { ro.observe(this.chartDom); } } // for window resize auto responsive legend @Bind() @Debounce(300) resize() { const { hasLegend } = this.props; const { legendBlock } = this.state; if (!hasLegend || !this.root) { window.removeEventListener('resize', this.resize); return; } if (this.root.parentNode.clientWidth <= 380) { if (!legendBlock) { this.setState({ legendBlock: true, }); } } else if (legendBlock) { this.setState({ legendBlock: false, }); } } render() { const { valueFormat, subTitle, total, hasLegend = false, className, style, height, percent, color, inner = 0.75, animate = true, colors, lineWidth = 1, } = this.props; const { legendData, height: stateHeight, legendBlock } = this.state; const pieClassName = classNames(styles.pie, className, { [styles.hasLegend]: !!hasLegend, [styles.legendBlock]: legendBlock, }); const { data: propsData, selected: propsSelected = true, tooltip: propsTooltip = true, } = this.props; let data = propsData || []; let selected = propsSelected; let tooltip = propsTooltip; const defaultColors = colors; selected = selected || true; tooltip = tooltip || true; let formatColor; const scale = { x: { type: 'cat', range: [0, 1], }, y: { min: 0, }, }; if (percent || percent === 0) { selected = false; tooltip = false; formatColor = value => { if (value === '占比') { return color || 'rgba(24, 144, 255, 0.85)'; } return '#F0F2F5'; }; data = [ { x: '占比', y: parseFloat(percent), }, { x: '反比', y: 100 - parseFloat(percent), }, ]; } const tooltipFormat = [ 'x*percent', (x, p) => ({ name: x, value: `${(p * 100).toFixed(2)}%`, }), ]; const padding = [12, 0, 12, 0]; const dv = new DataView(); dv.source(data).transform({ type: 'percent', field: 'y', dimension: 'x', as: 'percent', }); return ( <div ref={this.handleRoot} className={pieClassName} style={style}> <div ref={ref => { this.chartDom = ref; }} > <ReactFitText maxFontSize={25}> <div className={styles.chart}> <Chart scale={scale} height={height || stateHeight} data={dv} padding={padding} animate={animate} onGetG2Instance={this.getG2Instance} > {!!tooltip && <Tooltip showTitle={false} />} <Coord type="theta" innerRadius={inner} /> <Geom style={{ lineWidth, stroke: '#fff' }} tooltip={tooltip && tooltipFormat} type="intervalStack" position="percent" color={['x', percent || percent === 0 ? formatColor : defaultColors]} selected={selected} /> </Chart> {(subTitle || total) && ( <div className={styles.total}> {subTitle && <h4 className="pie-sub-title">{subTitle}</h4>} {/* eslint-disable-next-line */} {total && ( <div className="pie-stat">{typeof total === 'function' ? total() : total}</div> )} </div> )} </div> </ReactFitText> </div> {hasLegend && ( <ul className={styles.legend}> {legendData.map((item, i) => ( <li key={item.x} onClick={() => this.handleLegendClick(item, i)}> <span className={styles.dot} style={{ backgroundColor: !item.checked ? '#aaa' : item.color, }} /> <span className={styles.legendTitle}>{item.x}</span> <Divider type="vertical" /> <span className={styles.percent}> {`${(Number.isNaN(item.percent) ? 0 : item.percent * 100).toFixed(2)}%`} </span> <span className={styles.value}>{valueFormat ? valueFormat(item.y) : item.y}</span> </li> ))} </ul> )} </div> ); } } export default Pie;
{ "pile_set_name": "Github" }
## version: 1.34 ## method: get ## path: /info ## code: 200 registry_config <- list( allow_nondistributable_artifacts_cidrs = c("::1/128", "127.0.0.0/8"), allow_nondistributable_artifacts_hostnames = c( "registry.internal.corp.example.com:3000", "[2001:db8:a0b:12f0::1]:443"), insecure_registry_cidrs = c("::1/128", "127.0.0.0/8"), index_configs = list( "127.0.0.1:5000" = list( name = "127.0.0.1:5000", mirrors = character(0), secure = FALSE, official = FALSE), "[2001:db8:a0b:12f0::1]:80" = list( name = "[2001:db8:a0b:12f0::1]:80", mirrors = character(0), secure = FALSE, official = FALSE), "docker.io" = list( name = "docker.io", mirrors = "https://hub-mirror.corp.example.com:5000/", secure = TRUE, official = TRUE), "registry.internal.corp.example.com:3000" = list( name = "registry.internal.corp.example.com:3000", mirrors = character(0), secure = FALSE, official = FALSE)), mirrors= c( "https://hub-mirror.corp.example.com:5000/", "https://[2001:db8:a0b:12f0::1]/")) system_status <- list( c("Role", "primary"), c("State", "Healthy"), c("Strategy", "spread"), c("Filters", "health, port, containerslots, dependency, affinity, constraint, whitelist"), c("Nodes", "2"), c(" swarm-agent-00", "192.168.99.102:2376"), c(" └ ID", "5CT6:FBGO:RVGO:CZL4:PB2K:WCYN:2JSV:KSHH:GGFW:QOPG:6J5Q:IOZ2|192.168.99.102:2376"), c(" └ Status", "Healthy"), c(" └ Containers", "1 (1 Running, 0 Paused, 0 Stopped)"), c(" └ Reserved CPUs", "0 / 1"), c(" └ Reserved Memory", "0 B / 1.021 GiB"), c(" └ Labels", "kernelversion=4.4.74-boot2docker, operatingsystem=Boot2Docker 17.06.0-ce (TCL 7.2); HEAD : 0672754 - Thu Jun 29 00:06:31 UTC 2017, ostype=linux, provider=virtualbox, storagedriver=aufs"), c(" └ UpdatedAt", "2017-08-09T10:03:46Z"), c(" └ ServerVersion", "17.06.0-ce"), c(" swarm-manager", "192.168.99.101:2376"), c(" └ ID", "TAMD:7LL3:SEF7:LW2W:4Q2X:WVFH:RTXX:JSYS:XY2P:JEHL:ZMJK:JGIW|192.168.99.101:2376"), c(" └ Status", "Healthy"), c(" └ Containers", "2 (2 Running, 0 Paused, 0 Stopped)"), c(" └ Reserved CPUs", "0 / 1"), c(" └ Reserved Memory", "0 B / 1.021 GiB"), c(" └ Labels", "kernelversion=4.4.74-boot2docker, operatingsystem=Boot2Docker 17.06.0-ce (TCL 7.2); HEAD : 0672754 - Thu Jun 29 00:06:31 UTC 2017, ostype=linux, provider=virtualbox, storagedriver=aufs"), c(" └ UpdatedAt", "2017-08-09T10:04:11Z"), c(" └ ServerVersion", "17.06.0-ce")) tls_info <- list( trust_root = "-----BEGIN CERTIFICATE-----\nMIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0\nMzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf\n3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO\nPQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz\npxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H\n-----END CERTIFICATE-----\n", cert_issuer_subject = "MBMxETAPBgNVBAMTCHN3YXJtLWNh", cert_issuer_public_key = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A==") swarm_cluster <- list( id = "abajmipo7b4xz5ip2nrla6b11", version = list(index = 373531L), created_at = "2016-08-18T10:44:24.496525531Z", updated_at = "2017-08-09T07:09:37.632105588Z", spec = list( name = "default", labels = c(com.example.corp.type = "production", com.example.corp.department = "engineering"), orchestration = list(task_history_retention_limit = 10L), raft = list( snapshot_interval = 10000L, keep_old_snapshots = 0L, log_entries_for_slow_followers = 500L, election_tick = 3L, heartbeat_tick = 1L), dispatcher = list(heartbeat_period = 5e+09), ca_config = list( node_cert_expiry = 7.776e+15, external_cas = data_frame( protocol = "cfssl", url = "string", options = I(list(c( property1 = "string", property2 = "string"))), ca_cert = "string"), signing_cacert = "string", signing_cakey = "string", force_rotate = 0L), encryption_config = list(auto_lock_managers = FALSE), task_defaults = list( log_driver = list( name = "json-file", options = c("max-file" = "10", "max-size" = "100m")))), tls_info = tls_info, root_rotation_in_progress = FALSE) swarm <- list( node_id = "k67qz4598weg5unwwffg6z1m1", node_addr = "10.0.0.46", local_node_state = "active", control_available = TRUE, error = "", remote_managers = data_frame( node_id = c("71izy0goik036k48jg985xnds", "79y6h1o4gv8n120drcprv5nmc", "k67qz4598weg5unwwffg6z1m1"), addr = c("10.0.0.158:2377", "10.0.0.159:2377", "10.0.0.46:2377")), nodes = 4L, managers = 3L, cluster = swarm_cluster) generic_resources <- assigned_generic_resources <- data_frame( named_resource_spec = I(list( list(kind = NA_character_, value = NA_character_), list(kind = "GPU", value = "UUID1"), list(kind = "GPU", value = "UUID2"))), discrete_resource_spec = I(list( list(kind = "SSD", value = 3L), list(kind = NA_character_, value = NA_integer_), list(kind = NA_character_, value = NA_integer_)))) list( id = "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS", containers = 14L, containers_running = 3L, containers_paused = 1L, containers_stopped = 10L, images = 508L, driver = "overlay2", driver_status = list(c("Backing Filesystem", "extfs"), c("Supports d_type", "true"), c("Native Overlay Diff", "true")), docker_root_dir = "/var/lib/docker", system_status = system_status, plugins = list( volume = "local", network = c("bridge", "host", "ipvlan", "macvlan", "null", "overlay"), authorization = c("img-authz-plugin", "hbm"), log = c("awslogs", "fluentd", "gcplogs", "gelf", "journald", "json-file", "logentries", "splunk", "syslog")), memory_limit = TRUE, swap_limit = TRUE, kernel_memory = TRUE, cpu_cfs_period = TRUE, cpu_cfs_quota = TRUE, cpu_shares = TRUE, cpu_set = TRUE, oom_kill_disable = TRUE, ipv4_forwarding = TRUE, bridge_nf_iptables = TRUE, bridge_nf_ip6tables = TRUE, debug = TRUE, n_fd = 64L, n_goroutines = 174L, system_time = "2017-08-08T20:28:29.06202363Z", logging_driver = "string", cgroup_driver = "cgroupfs", n_events_listener = 30L, kernel_version = "4.9.38-moby", operating_system = "Alpine Linux v3.5", os_type = "linux", architecture = "x86_64", n_cpu = 4L, mem_total = 2095882240, index_server_address = "https://index.docker.io/v1/", registry_config = registry_config, generic_resources = generic_resources, http_proxy = "http://user:pass@proxy.corp.example.com:8080", https_proxy = "https://user:pass@proxy.corp.example.com:4443", no_proxy = "*.local, 169.254/16", name = "node5.corp.example.com", labels = c("storage=ssd", "production"), experimental_build = TRUE, server_version = "17.06.0-ce", cluster_store = "consul://consul.corp.example.com:8600/some/path", cluster_advertise = "node5.corp.example.com:8000", runtimes = list( runc = list(path = "docker-runc", runtime_args = character()), "runc-master" = list(path = "/go/bin/runc", runtime_args = character()), custom = list(path = "/usr/local/bin/my-oci-runtime", runtime_args = c("--debug", "--systemd-cgroup=false"))), default_runtime = "runc", swarm = swarm, live_restore_enabled = FALSE, isolation = "default", init_binary = "docker-init", containerd_commit = list( id = "cfb82a876ecc11b5ca0977d1733adbe58599088a", expected = "2d41c047c83e09a6d61d464906feb2a2f3c52aa4"), runc_commit = list( id = "cfb82a876ecc11b5ca0977d1733adbe58599088a", expected = "2d41c047c83e09a6d61d464906feb2a2f3c52aa4"), init_commit = list( id = "cfb82a876ecc11b5ca0977d1733adbe58599088a", expected = "2d41c047c83e09a6d61d464906feb2a2f3c52aa4"), security_options = c( "name=apparmor", "name=seccomp,profile=default", "name=selinux", "name=userns"))
{ "pile_set_name": "Github" }
# Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ''' >>> from data_members_ext import * ---- Test static data members --- >>> v = Var('slim shady') >>> Var.ro2a.x 0 >>> Var.ro2b.x 0 >>> Var.rw2a.x 0 >>> Var.rw2b.x 0 >>> v.ro2a.x 0 >>> v.ro2b.x 0 >>> v.rw2a.x 0 >>> v.rw2b.x 0 >>> Var.rw2a.x = 777 >>> Var.ro2a.x 777 >>> Var.ro2b.x 777 >>> Var.rw2a.x 777 >>> Var.rw2b.x 777 >>> v.ro2a.x 777 >>> v.ro2b.x 777 >>> v.rw2a.x 777 >>> v.rw2b.x 777 >>> Var.rw2b = Y(888) >>> y = Y(99) >>> y.q = True >>> y.q True >>> y.q = False >>> y.q False >>> Var.ro2a.x 888 >>> Var.ro2b.x 888 >>> Var.rw2a.x 888 >>> Var.rw2b.x 888 >>> v.ro2a.x 888 >>> v.ro2b.x 888 >>> v.rw2a.x 888 >>> v.rw2b.x 888 >>> v.rw2b.x = 999 >>> Var.ro2a.x 999 >>> Var.ro2b.x 999 >>> Var.rw2a.x 999 >>> Var.rw2b.x 999 >>> v.ro2a.x 999 >>> v.ro2b.x 999 >>> v.rw2a.x 999 >>> v.rw2b.x 999 >>> Var.ro1a 0 >>> Var.ro1b 0 >>> Var.rw1a 0 >>> Var.rw1b 0 >>> v.ro1a 0 >>> v.ro1b 0 >>> v.rw1a 0 >>> v.rw1b 0 >>> Var.rw1a = 777 >>> Var.ro1a 777 >>> Var.ro1b 777 >>> Var.rw1a 777 >>> Var.rw1b 777 >>> v.ro1a 777 >>> v.ro1b 777 >>> v.rw1a 777 >>> v.rw1b 777 >>> Var.rw1b = 888 >>> Var.ro1a 888 >>> Var.ro1b 888 >>> Var.rw1a 888 >>> Var.rw1b 888 >>> v.ro1a 888 >>> v.ro1b 888 >>> v.rw1a 888 >>> v.rw1b 888 >>> v.rw1b = 999 >>> Var.ro1a 999 >>> Var.ro1b 999 >>> Var.rw1a 999 >>> Var.rw1b 999 >>> v.ro1a 999 >>> v.ro1b 999 >>> v.rw1a 999 >>> v.rw1b 999 ----------------- >>> x = X(42) >>> x.x 42 >>> try: x.x = 77 ... except AttributeError: pass ... else: print('no error') >>> x.fair_value 42.0 >>> y = Y(69) >>> y.x 69 >>> y.x = 77 >>> y.x 77 >>> v = Var("pi") >>> v.value = 3.14 >>> v.name 'pi' >>> v.name2 'pi' >>> v.get_name1() 'pi' >>> v.get_name2() 'pi' >>> v.y.x 6 >>> v.y.x = -7 >>> v.y.x -7 >>> v.name3 'pi' ''' def run(args = None): import sys import doctest if args is not None: sys.argv = args return doctest.testmod(sys.modules.get(__name__)) if __name__ == '__main__': print("running...") import sys status = run()[0] if (status == 0): print("Done.") sys.exit(status)
{ "pile_set_name": "Github" }
""" Template tags for easy WTForms access in Django templates. """ from __future__ import unicode_literals import re from django import template from django.conf import settings from django.template import Variable from ....compat import iteritems register = template.Library() class FormFieldNode(template.Node): def __init__(self, field_var, html_attrs): self.field_var = field_var self.html_attrs = html_attrs def render(self, context): try: if '.' in self.field_var: base, field_name = self.field_var.rsplit('.', 1) field = getattr(Variable(base).resolve(context), field_name) else: field = context[self.field_var] except (template.VariableDoesNotExist, KeyError, AttributeError): return settings.TEMPLATE_STRING_IF_INVALID h_attrs = {} for k, v in iteritems(self.html_attrs): try: h_attrs[k] = v.resolve(context) except template.VariableDoesNotExist: h_attrs[k] = settings.TEMPLATE_STRING_IF_INVALID return field(**h_attrs) @register.tag(name='form_field') def do_form_field(parser, token): """ Render a WTForms form field allowing optional HTML attributes. Invocation looks like this: {% form_field form.username class="big_text" onclick="alert('hello')" %} where form.username is the path to the field value we want. Any number of key="value" arguments are supported. Unquoted values are resolved as template variables. """ parts = token.contents.split(' ', 2) if len(parts) < 2: error_text = '%r tag must have the form field name as the first value, followed by optional key="value" attributes.' raise template.TemplateSyntaxError(error_text % parts[0]) html_attrs = {} if len(parts) == 3: raw_args = list(args_split(parts[2])) if (len(raw_args) % 2) != 0: raise template.TemplateSyntaxError('%r tag received the incorrect number of key=value arguments.' % parts[0]) for x in range(0, len(raw_args), 2): html_attrs[str(raw_args[x])] = Variable(raw_args[x + 1]) return FormFieldNode(parts[1], html_attrs) args_split_re = re.compile(r'''("(?:[^"\\]*(?:\\.[^"\\]*)*)"|'(?:[^'\\]*(?:\\.[^'\\]*)*)'|[^\s=]+)''') def args_split(text): """ Split space-separated key=value arguments. Keeps quoted strings intact. """ for bit in args_split_re.finditer(text): bit = bit.group(0) if bit[0] == '"' and bit[-1] == '"': yield '"' + bit[1:-1].replace('\\"', '"').replace('\\\\', '\\') + '"' elif bit[0] == "'" and bit[-1] == "'": yield "'" + bit[1:-1].replace("\\'", "'").replace("\\\\", "\\") + "'" else: yield bit
{ "pile_set_name": "Github" }
/// @ref core /// @file glm/detail/func_integer_simd.inl #include "../simd/integer.h" #if GLM_ARCH & GLM_ARCH_SSE2_BIT namespace glm{ namespace detail { template<glm::precision P> struct compute_bitfieldReverseStep<4, uint32, P, vec, true, true> { GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const& v, uint32 Mask, uint32 Shift) { __m128i const set0 = v.data; __m128i const set1 = _mm_set1_epi32(static_cast<int>(Mask)); __m128i const and1 = _mm_and_si128(set0, set1); __m128i const sft1 = _mm_slli_epi32(and1, Shift); __m128i const set2 = _mm_andnot_si128(set0, _mm_set1_epi32(-1)); __m128i const and2 = _mm_and_si128(set0, set2); __m128i const sft2 = _mm_srai_epi32(and2, Shift); __m128i const or0 = _mm_or_si128(sft1, sft2); return or0; } }; template<glm::precision P> struct compute_bitfieldBitCountStep<4, uint32, P, vec, true, true> { GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const& v, uint32 Mask, uint32 Shift) { __m128i const set0 = v.data; __m128i const set1 = _mm_set1_epi32(static_cast<int>(Mask)); __m128i const and0 = _mm_and_si128(set0, set1); __m128i const sft0 = _mm_slli_epi32(set0, Shift); __m128i const and1 = _mm_and_si128(sft0, set1); __m128i const add0 = _mm_add_epi32(and0, and1); return add0; } }; }//namespace detail # if GLM_ARCH & GLM_ARCH_AVX_BIT template<> GLM_FUNC_QUALIFIER int bitCount(uint32 x) { return _mm_popcnt_u32(x); } # if(GLM_MODEL == GLM_MODEL_64) template<> GLM_FUNC_QUALIFIER int bitCount(uint64 x) { return static_cast<int>(_mm_popcnt_u64(x)); } # endif//GLM_MODEL # endif//GLM_ARCH }//namespace glm #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
{ "pile_set_name": "Github" }
package mikera.vectorz; import mikera.transformz.ATransform; /** * Interface for a scalar operator that transforms a double value to another double value * * @author Mike * */ public interface IOperator { /** * Applies this operator to a single value, returning the result * @param x * @return */ public double apply(double x); /** * Applies this operator to a mutable vector. * @param x * @return */ public void applyTo(AVector v); /** * Applies this operator to the specified range within a mutable vector. * @param x * @return */ public void applyTo(AVector v, int start, int length); /** * Applies this operator to the specified range within a double[] array. * @param x * @return */ public void applyTo(double[] data, int start, int length); /** * Applies this operator to the specified strided range within a double[] array. * @param x * @return */ void applyTo(double[] data, int start, int stride, int length); /** * Converts an operator into a corresponding transform that applies the operator to all elements of its input * @param dims * @return */ public ATransform getTransform(int dims); /** * Gets the inverse of this operator. * * Returns null if no inverse exists. * * @return */ public Op getInverse(); }
{ "pile_set_name": "Github" }
# Automatically generated, do not edit. # cython: cdivision=True, language_level=3 # distutils: language=c++ <%def name="indent(text, level=0)" buffered="True"> % for l in text.splitlines(): ${' '*4*level}${l} % endfor </%def> <%def name="do_group(helper, group, level=0)" buffered="True"> ####################################################################### ## Call any `pre` functions ####################################################################### % if group.pre: ${indent(helper.get_pre_call(group), 0)} % endif ####################################################################### ## Iterate over destinations in this group. ####################################################################### % for dest, (eqs_with_no_source, sources, all_eqs) in group.data.items(): # --------------------------------------------------------------------- # Destination ${dest}.\ ####################################################################### ## Setup destination array pointers. ####################################################################### dst = self.${dest} ${indent(helper.get_dest_array_setup(dest, eqs_with_no_source, sources, group), 0)} dst_array_index = dst.index ####################################################################### ## Call py_initialize for all equations for this destination. ####################################################################### ${indent(all_eqs.get_py_initialize_code(), 0)} ####################################################################### ## Initialize all equations for this destination. ####################################################################### % if all_eqs.has_initialize(): # Initialization for destination ${dest}. for d_idx in ${helper.get_parallel_range(group)}: ${indent(all_eqs.get_initialize_code(helper.object.kernel), 1)} % endif ####################################################################### ## Handle all the equations that do not have a source. ####################################################################### % if len(eqs_with_no_source.equations) > 0: % if eqs_with_no_source.has_loop(): # SPH Equations with no sources. for d_idx in ${helper.get_parallel_range(group)}: ${indent(eqs_with_no_source.get_loop_code(helper.object.kernel), 1)} % endif % endif ####################################################################### ## Iterate over sources. ####################################################################### % for source, eq_group in sources.items(): # -------------------------------------- # Source ${source}.\ ####################################################################### ## Setup source array pointers. ####################################################################### src = self.${source} ${indent(helper.get_src_array_setup(source, eq_group), 0)} src_array_index = src.index % if eq_group.has_initialize_pair(): for d_idx in ${helper.get_parallel_range(group)}: ${indent(eq_group.get_initialize_pair_code(helper.object.kernel), 1)} % endif % if eq_group.has_loop() or eq_group.has_loop_all(): ####################################################################### ## Iterate over destination particles. ####################################################################### nnps.set_context(src_array_index, dst_array_index) ${helper.get_parallel_block()} thread_id = threadid() ${indent(eq_group.get_variable_array_setup(), 1)} for d_idx in ${helper.get_parallel_range(group, nogil=False)}: ############################################################### ## Find and iterate over neighbors. ############################################################### nnps.get_nearest_neighbors(d_idx, <UIntArray>self.nbrs[thread_id]) NBRS = (<UIntArray>self.nbrs[thread_id]).data N_NBRS = (<UIntArray>self.nbrs[thread_id]).length % if eq_group.has_loop_all(): ${indent(eq_group.get_loop_all_code(helper.object.kernel), 2)} % endif % if eq_group.has_loop(): for nbr_idx in range(N_NBRS): s_idx = <long>(NBRS[nbr_idx]) ########################################################### ## Iterate over the equations for the same set of neighbors. ########################################################### ${indent(eq_group.get_loop_code(helper.object.kernel), 3)} % endif ## if has_loop % endif ## if eq_group.has_loop() or has_loop_all(): # Source ${source} done. # -------------------------------------- % endfor ################################################################### ## Do any post_loop assignments for the destination. ################################################################### % if all_eqs.has_post_loop(): # Post loop for destination ${dest}. for d_idx in ${helper.get_parallel_range(group)}: ${indent(all_eqs.get_post_loop_code(helper.object.kernel), 1)} % endif ################################################################### ## Do any reductions for the destination. ################################################################### % if all_eqs.has_reduce(): ${indent(all_eqs.get_reduce_code(), 0)} % endif # Destination ${dest} done. # --------------------------------------------------------------------- ####################################################################### ## Update NNPS locally if needed ####################################################################### % if group.update_nnps: # Updating NNPS. nnps.update_domain() nnps.update() % endif % endfor ####################################################################### ## Call any `post` functions ####################################################################### % if group.post: ${indent(helper.get_post_call(group), 0)} % endif </%def> from libc.stdio cimport printf from libc.math cimport * from libc.math cimport fabs as abs cimport numpy import numpy from cython import address % if not helper.config.use_openmp: from cython.parallel import threadid prange = range % else: from cython.parallel import parallel, prange, threadid % endif from pysph.base.particle_array cimport ParticleArray from pysph.base.nnps_base cimport NNPS from pysph.base.reduce_array import serial_reduce_array % if helper.object.mode == 'serial': from pysph.base.reduce_array import dummy_reduce_array as parallel_reduce_array % elif helper.object.mode == 'mpi': from pysph.base.reduce_array import mpi_reduce_array as parallel_reduce_array % endif from pysph.base.nnps import get_number_of_threads from cyarray.carray cimport (DoubleArray, FloatArray, IntArray, LongArray, UIntArray, aligned, aligned_free, aligned_malloc) ${helper.get_header()} # ############################################################################# cdef class ParticleArrayWrapper: cdef public int index cdef public ParticleArray array ${indent(helper.get_array_decl_for_wrapper(), 1)} cdef public str name def __init__(self, pa, index): self.index = index self.set_array(pa) cpdef set_array(self, pa): self.array = pa props = set(pa.properties.keys()) props = props.union(['tag', 'pid', 'gid']) for prop in props: setattr(self, prop, pa.get_carray(prop)) for prop in pa.constants.keys(): setattr(self, prop, pa.get_carray(prop)) self.name = pa.name cpdef long size(self, bint real=False): return self.array.get_number_of_particles(real) # ############################################################################# cdef class AccelerationEval: cdef public tuple particle_arrays cdef public ParticleArrayWrapper ${helper.get_particle_array_names()} cdef public NNPS nnps cdef public int n_threads cdef public list _nbr_refs cdef void **nbrs # CFL time step conditions cdef public double dt_cfl, dt_force, dt_viscous cdef object groups cdef object all_equations ${indent(helper.get_kernel_defs(), 1)} ${indent(helper.get_equation_defs(), 1)} def __init__(self, kernel, equations, particle_arrays, groups): self.particle_arrays = tuple(particle_arrays) self.groups = groups self.n_threads = get_number_of_threads() cdef int i for i, pa in enumerate(particle_arrays): name = pa.name setattr(self, name, ParticleArrayWrapper(pa, i)) self.nbrs = <void**>aligned_malloc(sizeof(void*)*self.n_threads) cdef UIntArray _arr self._nbr_refs = [] for i in range(self.n_threads): _arr = UIntArray() _arr.reserve(1024) self.nbrs[i] = <void*>_arr self._nbr_refs.append(_arr) ${indent(helper.get_kernel_init(), 2)} ${indent(helper.get_equation_init(), 2)} all_equations = {} for equation in equations: all_equations[equation.var_name] = equation self.all_equations = all_equations def __dealloc__(self): aligned_free(self.nbrs) def set_nnps(self, NNPS nnps): self.nnps = nnps def update_particle_arrays(self, particle_arrays): for pa in particle_arrays: name = pa.name getattr(self, name).set_array(pa) cpdef compute(self, double t, double dt): cdef long nbr_idx, NP_SRC, NP_DEST, D_START_IDX cdef long s_idx, d_idx cdef int thread_id, N_NBRS cdef unsigned int* NBRS cdef NNPS nnps = self.nnps cdef ParticleArrayWrapper src, dst cdef int max_iterations, min_iterations, _iteration_count ####################################################################### ## Declare all the arrays. ####################################################################### # Arrays.\ ${indent(helper.get_array_declarations(), 2)} ####################################################################### ## Declare any variables. ####################################################################### # Variables.\ cdef int src_array_index, dst_array_index ${indent(helper.get_variable_declarations(), 2)} ####################################################################### ## Iterate over groups: ## Groups are organized as {destination: (eqs_with_no_source, sources, all_eqs)} ## eqs_with_no_source: Group([equations]) all SPH Equations with no source. ## sources are {source: Group([equations...])} ## all_eqs is a Group of all equations having this destination. ####################################################################### % for g_idx, group in enumerate(helper.object.mega_groups): % if len(group.data) > 0: # No equations in this group. # --------------------------------------------------------------------- # Group ${g_idx}. % if group.condition is not None: if ${helper.get_condition_call(group)}: <% indent_lvl = 3 %> % else: <% indent_lvl = 2 %> % endif % if group.iterate: ${indent(helper.get_iteration_init(group), indent_lvl)} <% indent_lvl += 1 %> % endif ## --------------------- ## ---- Subgroups start % if group.has_subgroups: % for sg_idx, sub_group in enumerate(group.data): ${indent("# Doing subgroup " + str(sg_idx), indent_lvl)} % if sub_group.condition is not None: if ${helper.get_condition_call(sub_group)}: <% indent_lvl += 1 %> % endif ${indent(do_group(helper, sub_group, indent_lvl), indent_lvl)} % if sub_group.condition is not None: <% indent_lvl -= 1 %> % endif % endfor # (for sg_idx, sub_group in enumerate(group.data)) ## ---- Subgroups done ## --------------------- % else: # No subgroups ${indent(do_group(helper, group, indent_lvl), indent_lvl)} % endif # (if group.has_subgroups) ## Check the iteration conditions % if group.iterate: ${indent(helper.get_iteration_check(group), indent_lvl)} % endif # Group ${g_idx} done. # --------------------------------------------------------------------- % endif # (if len(group.data) > 0) % endfor
{ "pile_set_name": "Github" }
-- Patch to add abuse_filter_history table (Postgres version) BEGIN; CREATE SEQUENCE abuse_filter_history_afh_id_seq; CREATE TABLE abuse_filter_history ( afh_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('abuse_filter_history_afh_id_seq'), afh_filter INTEGER NOT NULL, afh_user INTEGER NOT NULL, afh_user_text TEXT NOT NULL, afh_timestamp TIMESTAMPTZ NOT NULL, afh_pattern TEXT NOT NULL, afh_comments TEXT NOT NULL, afh_flags TEXT NOT NULL, afh_public_comments TEXT NOT NULL, afh_actions TEXT NOT NULL, afh_deleted SMALLINT NOT NULL DEFAULT 0, afh_changed_fields TEXT NOT NULL DEFAULT '' ); CREATE INDEX abuse_filter_history_filter ON abuse_filter_history(afh_filter); CREATE INDEX abuse_filter_history_user ON abuse_filter_history(afh_user); CREATE INDEX abuse_filter_history_user_text ON abuse_filter_history(afh_user_text); CREATE INDEX abuse_filter_history_timestamp ON abuse_filter_history(afh_timestamp); COMMIT;
{ "pile_set_name": "Github" }
package com.xiaochao.lcrapiddeveloplibrary.animation; import android.animation.Animator; import android.animation.ObjectAnimator; import android.view.View; /** * https://github.com/CymChad/BaseRecyclerViewAdapterHelper */ public class ScaleInAnimation implements BaseAnimation { private static final float DEFAULT_SCALE_FROM = .5f; private final float mFrom; public ScaleInAnimation() { this(DEFAULT_SCALE_FROM); } public ScaleInAnimation(float from) { mFrom = from; } @Override public Animator[] getAnimators(View view) { ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", mFrom, 1f); ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", mFrom, 1f); return new ObjectAnimator[] { scaleX, scaleY }; } }
{ "pile_set_name": "Github" }
/* Copyright 2008 Intel Corporation Use, modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). */ #ifndef BOOST_POLYGON_ITERATOR_GEOMETRY_TO_SET_HPP #define BOOST_POLYGON_ITERATOR_GEOMETRY_TO_SET_HPP namespace boost { namespace polygon{ template <typename concept_type, typename geometry_type> class iterator_geometry_to_set {}; template <typename rectangle_type> class iterator_geometry_to_set<rectangle_concept, rectangle_type> { public: typedef typename rectangle_traits<rectangle_type>::coordinate_type coordinate_type; typedef std::forward_iterator_tag iterator_category; typedef std::pair<coordinate_type, std::pair<coordinate_type, int> > value_type; typedef std::ptrdiff_t difference_type; typedef const value_type* pointer; //immutable typedef const value_type& reference; //immutable private: rectangle_data<coordinate_type> rectangle_; mutable value_type vertex_; unsigned int corner_; orientation_2d orient_; bool is_hole_; public: iterator_geometry_to_set() : rectangle_(), vertex_(), corner_(4), orient_(), is_hole_() {} iterator_geometry_to_set(const rectangle_type& rectangle, direction_1d dir, orientation_2d orient = HORIZONTAL, bool is_hole = false, bool = false, direction_1d = CLOCKWISE) : rectangle_(), vertex_(), corner_(0), orient_(orient), is_hole_(is_hole) { assign(rectangle_, rectangle); if(dir == HIGH) corner_ = 4; } inline iterator_geometry_to_set& operator++() { ++corner_; return *this; } inline const iterator_geometry_to_set operator++(int) { iterator_geometry_to_set tmp(*this); ++(*this); return tmp; } inline bool operator==(const iterator_geometry_to_set& that) const { return corner_ == that.corner_; } inline bool operator!=(const iterator_geometry_to_set& that) const { return !(*this == that); } inline reference operator*() const { if(corner_ == 0) { vertex_.first = get(get(rectangle_, orient_.get_perpendicular()), LOW); vertex_.second.first = get(get(rectangle_, orient_), LOW); vertex_.second.second = 1; if(is_hole_) vertex_.second.second *= -1; } else if(corner_ == 1) { vertex_.second.first = get(get(rectangle_, orient_), HIGH); vertex_.second.second = -1; if(is_hole_) vertex_.second.second *= -1; } else if(corner_ == 2) { vertex_.first = get(get(rectangle_, orient_.get_perpendicular()), HIGH); vertex_.second.first = get(get(rectangle_, orient_), LOW); } else { vertex_.second.first = get(get(rectangle_, orient_), HIGH); vertex_.second.second = 1; if(is_hole_) vertex_.second.second *= -1; } return vertex_; } }; template <typename polygon_type> class iterator_geometry_to_set<polygon_90_concept, polygon_type> { public: typedef typename polygon_traits<polygon_type>::coordinate_type coordinate_type; typedef std::forward_iterator_tag iterator_category; typedef std::pair<coordinate_type, std::pair<coordinate_type, int> > value_type; typedef std::ptrdiff_t difference_type; typedef const value_type* pointer; //immutable typedef const value_type& reference; //immutable typedef typename polygon_traits<polygon_type>::iterator_type coord_iterator_type; private: value_type vertex_; typename polygon_traits<polygon_type>::iterator_type itrb, itre; bool last_vertex_; bool is_hole_; int multiplier_; point_data<coordinate_type> first_pt, second_pt, pts[3]; bool use_wrap; orientation_2d orient_; int polygon_index; public: iterator_geometry_to_set() : vertex_(), itrb(), itre(), last_vertex_(), is_hole_(), multiplier_(), first_pt(), second_pt(), pts(), use_wrap(), orient_(), polygon_index(-1) {} iterator_geometry_to_set(const polygon_type& polygon, direction_1d dir, orientation_2d orient = HORIZONTAL, bool is_hole = false, bool winding_override = false, direction_1d w = CLOCKWISE) : vertex_(), itrb(), itre(), last_vertex_(), is_hole_(is_hole), multiplier_(), first_pt(), second_pt(), pts(), use_wrap(), orient_(orient), polygon_index(0) { itrb = begin_points(polygon); itre = end_points(polygon); use_wrap = false; if(itrb == itre || dir == HIGH || size(polygon) < 4) { polygon_index = -1; } else { direction_1d wdir = w; if(!winding_override) wdir = winding(polygon); multiplier_ = wdir == LOW ? -1 : 1; if(is_hole_) multiplier_ *= -1; first_pt = pts[0] = *itrb; ++itrb; second_pt = pts[1] = *itrb; ++itrb; pts[2] = *itrb; evaluate_(); } } iterator_geometry_to_set(const iterator_geometry_to_set& that) : vertex_(), itrb(), itre(), last_vertex_(), is_hole_(), multiplier_(), first_pt(), second_pt(), pts(), use_wrap(), orient_(), polygon_index(-1) { vertex_ = that.vertex_; itrb = that.itrb; itre = that.itre; last_vertex_ = that.last_vertex_; is_hole_ = that.is_hole_; multiplier_ = that.multiplier_; first_pt = that.first_pt; second_pt = that.second_pt; pts[0] = that.pts[0]; pts[1] = that.pts[1]; pts[2] = that.pts[2]; use_wrap = that.use_wrap; orient_ = that.orient_; polygon_index = that.polygon_index; } inline iterator_geometry_to_set& operator++() { ++polygon_index; if(itrb == itre) { if(first_pt == pts[1]) polygon_index = -1; else { pts[0] = pts[1]; pts[1] = pts[2]; if(first_pt == pts[2]) { pts[2] = second_pt; } else { pts[2] = first_pt; } } } else { ++itrb; pts[0] = pts[1]; pts[1] = pts[2]; if(itrb == itre) { if(first_pt == pts[2]) { pts[2] = second_pt; } else { pts[2] = first_pt; } } else { pts[2] = *itrb; } } evaluate_(); return *this; } inline const iterator_geometry_to_set operator++(int) { iterator_geometry_to_set tmp(*this); ++(*this); return tmp; } inline bool operator==(const iterator_geometry_to_set& that) const { return polygon_index == that.polygon_index; } inline bool operator!=(const iterator_geometry_to_set& that) const { return !(*this == that); } inline reference operator*() const { return vertex_; } inline void evaluate_() { vertex_.first = pts[1].get(orient_.get_perpendicular()); vertex_.second.first =pts[1].get(orient_); if(pts[1] == pts[2]) { vertex_.second.second = 0; } else if(pts[0].get(HORIZONTAL) != pts[1].get(HORIZONTAL)) { vertex_.second.second = -1; } else if(pts[0].get(VERTICAL) != pts[1].get(VERTICAL)) { vertex_.second.second = 1; } else { vertex_.second.second = 0; } vertex_.second.second *= multiplier_; } }; template <typename polygon_with_holes_type> class iterator_geometry_to_set<polygon_90_with_holes_concept, polygon_with_holes_type> { public: typedef typename polygon_90_traits<polygon_with_holes_type>::coordinate_type coordinate_type; typedef std::forward_iterator_tag iterator_category; typedef std::pair<coordinate_type, std::pair<coordinate_type, int> > value_type; typedef std::ptrdiff_t difference_type; typedef const value_type* pointer; //immutable typedef const value_type& reference; //immutable private: iterator_geometry_to_set<polygon_90_concept, polygon_with_holes_type> itrb, itre; iterator_geometry_to_set<polygon_90_concept, typename polygon_with_holes_traits<polygon_with_holes_type>::hole_type> itrhib, itrhie; typename polygon_with_holes_traits<polygon_with_holes_type>::iterator_holes_type itrhb, itrhe; orientation_2d orient_; bool is_hole_; bool started_holes; public: iterator_geometry_to_set() : itrb(), itre(), itrhib(), itrhie(), itrhb(), itrhe(), orient_(), is_hole_(), started_holes() {} iterator_geometry_to_set(const polygon_with_holes_type& polygon, direction_1d dir, orientation_2d orient = HORIZONTAL, bool is_hole = false, bool = false, direction_1d = CLOCKWISE) : itrb(), itre(), itrhib(), itrhie(), itrhb(), itrhe(), orient_(orient), is_hole_(is_hole), started_holes() { itre = iterator_geometry_to_set<polygon_90_concept, polygon_with_holes_type>(polygon, HIGH, orient, is_hole_); itrhe = end_holes(polygon); if(dir == HIGH) { itrb = itre; itrhb = itrhe; started_holes = true; } else { itrb = iterator_geometry_to_set<polygon_90_concept, polygon_with_holes_type>(polygon, LOW, orient, is_hole_); itrhb = begin_holes(polygon); started_holes = false; } } iterator_geometry_to_set(const iterator_geometry_to_set& that) : itrb(), itre(), itrhib(), itrhie(), itrhb(), itrhe(), orient_(), is_hole_(), started_holes() { itrb = that.itrb; itre = that.itre; if(that.itrhib != that.itrhie) { itrhib = that.itrhib; itrhie = that.itrhie; } itrhb = that.itrhb; itrhe = that.itrhe; orient_ = that.orient_; is_hole_ = that.is_hole_; started_holes = that.started_holes; } inline iterator_geometry_to_set& operator++() { //this code can be folded with flow control factoring if(itrb == itre) { if(itrhib == itrhie) { if(itrhb != itrhe) { itrhib = iterator_geometry_to_set<polygon_90_concept, typename polygon_with_holes_traits<polygon_with_holes_type>::hole_type>(*itrhb, LOW, orient_, !is_hole_); itrhie = iterator_geometry_to_set<polygon_90_concept, typename polygon_with_holes_traits<polygon_with_holes_type>::hole_type>(*itrhb, HIGH, orient_, !is_hole_); ++itrhb; } else { //in this case we have no holes so we just need the iterhib == itrhie, which //is always true if they were default initialized in the initial case or //both point to end of the previous hole processed //no need to explicitly reset them, and it causes an stl debug assertion to use //the default constructed iterator this way //itrhib = itrhie = iterator_geometry_to_set<polygon_90_concept, // typename polygon_with_holes_traits<polygon_with_holes_type>::hole_type>(); } } else { ++itrhib; if(itrhib == itrhie) { if(itrhb != itrhe) { itrhib = iterator_geometry_to_set<polygon_90_concept, typename polygon_with_holes_traits<polygon_with_holes_type>::hole_type>(*itrhb, LOW, orient_, !is_hole_); itrhie = iterator_geometry_to_set<polygon_90_concept, typename polygon_with_holes_traits<polygon_with_holes_type>::hole_type>(*itrhb, HIGH, orient_, !is_hole_); ++itrhb; } else { //this is the same case as above //itrhib = itrhie = iterator_geometry_to_set<polygon_90_concept, // typename polygon_with_holes_traits<polygon_with_holes_type>::hole_type>(); } } } } else { ++itrb; if(itrb == itre) { if(itrhb != itrhe) { itrhib = iterator_geometry_to_set<polygon_90_concept, typename polygon_with_holes_traits<polygon_with_holes_type>::hole_type>(*itrhb, LOW, orient_, !is_hole_); itrhie = iterator_geometry_to_set<polygon_90_concept, typename polygon_with_holes_traits<polygon_with_holes_type>::hole_type>(*itrhb, HIGH, orient_, !is_hole_); ++itrhb; } } } return *this; } inline const iterator_geometry_to_set operator++(int) { iterator_geometry_to_set tmp(*this); ++(*this); return tmp; } inline bool operator==(const iterator_geometry_to_set& that) const { return itrb == that.itrb && itrhb == that.itrhb && itrhib == that.itrhib; } inline bool operator!=(const iterator_geometry_to_set& that) const { return !(*this == that); } inline reference operator*() const { if(itrb != itre) return *itrb; return *itrhib; } }; } } #endif
{ "pile_set_name": "Github" }
#ifndef MPLAYER_REGISTRY_H #define MPLAYER_REGISTRY_H /******************************************************** * * Declaration of registry access functions * Copyright 2000 Eugene Kuznetsov (divx@euro.ru) * ********************************************************/ /* * Modified for use with MPlayer, detailed changelog at * http://svn.mplayerhq.hu/mplayer/trunk/ */ #include "wine/winbase.h" void free_registry(void); long __stdcall RegOpenKeyExA(long key, const char* subkey, long reserved, long access, int* newkey); long __stdcall RegCloseKey(long key); long __stdcall RegQueryValueExA(long key, const char* value, int* reserved, int* type, int* data, int* count); long __stdcall RegCreateKeyExA(long key, const char* name, long reserved, void* classs, long options, long security, void* sec_attr, int* newkey, int* status); long __stdcall RegSetValueExA(long key, const char* name, long v1, long v2, const void* data, long size); #ifdef MPLAYER_WINERROR_H long __stdcall RegEnumKeyExA(HKEY hKey, DWORD dwIndex, LPSTR lpName, LPDWORD lpcbName, LPDWORD lpReserved, LPSTR lpClass, LPDWORD lpcbClass, LPFILETIME lpftLastWriteTime); long __stdcall RegEnumValueA(HKEY hkey, DWORD index, LPSTR value, LPDWORD val_count, LPDWORD reserved, LPDWORD type, LPBYTE data, LPDWORD count); #endif #endif /* MPLAYER_REGISTRY_H */
{ "pile_set_name": "Github" }
"Filed out from Dolphin Smalltalk 7"! MessageSequenceAbstract subclass: #EventMessageSequence instanceVariableNames: 'receivers messages tally' classVariableNames: '' poolDictionaries: '' classInstanceVariableNames: ''! EventMessageSequence guid: (GUID fromString: '{87b4c664-026e-11d3-9fd7-00a0cc3e4a32}')! EventMessageSequence comment: ''! !EventMessageSequence categoriesForClass!System-Support! ! !EventMessageSequence methodsFor! add: aMessageSend "Adds a <MessageSend> to this sequence. Normally this would be an EventMessageSend, a special kind of message send that maintains only a weak reference to its receiver, and which merges trigger and registration arguments in a particular way. However, the argument can be any valuable that implements the #value[:] message appropriate for the number of arguments triggered with the event, and it must also implement #receiver. So, for example, blocks and normal MessageSends can be used. Note that we take an additional weak reference to the receiver for the sole purpose of being notified when the receiver has been garbage collected so that the message sequence can be updated." | receiver index | tally := tally + 1. receiver := aMessageSend receiver. index := receivers addAnsweringIndex: receiver. index > messages basicSize ifTrue: [messages resize: receivers basicSize]. messages basicAt: index put: aMessageSend. ^aMessageSend! elementsExpired: count of: aWeakArray "Private - Handle the loss of <integer> count values from the receiver's receiver <Array> ( which is also the argument, aWeakArray). We nil the message corresponding to each corpse (although we don't bother nilling the dead receivers to speed up the search for an empty slot)." tally := tally - count. receivers corpsesDo: [:deathAt | messages at: deathAt put: nil]! initialize "Private - Initialize the receiver. Implementation Note: The majority of instances only ever contain one message for the event against the receiver, so we use 1 as the initial capacity." receivers := (MourningWeakArray with: DeadObject current) pathologist: self; yourself. messages := Array new: 1. tally := 0! messagesDo: operation "Private - Evaluates the <monadicValuable>, operation, for all non-dead elements of the receiver. An event message registration is considered dead if the target (receiver) of the message has been garbage collected." | corpse | corpse := DeadObject current. 1 to: receivers basicSize do: [:index | "Assign the receiver into a temp to prevent it being GC'd before the message can be sent." | receiver | receiver := receivers at: index. receiver == corpse ifFalse: [(messages at: index) ifNotNil: [:msg | operation value: msg]]]! removeMessagesFor: anObject "Removes all the messages in this sequence that are destined for anObject. Answers the receiver." | corpse | corpse := DeadObject current. 1 to: receivers basicSize do: [:index | (receivers at: index) == anObject ifTrue: [tally := tally - 1. receivers at: index put: corpse. "corpse marks empty slots" messages at: index put: nil]]! size "Answers the number of messages in the receiver" ^tally! ! !EventMessageSequence categoriesFor: #add:!adding!public! ! !EventMessageSequence categoriesFor: #elementsExpired:of:!finalizing!private! ! !EventMessageSequence categoriesFor: #initialize!initializing!private! ! !EventMessageSequence categoriesFor: #messagesDo:!debugger-step through!enumerating!private! ! !EventMessageSequence categoriesFor: #removeMessagesFor:!public!removing! ! !EventMessageSequence categoriesFor: #size!accessing!public! !
{ "pile_set_name": "Github" }
--- title: Getting Started with Scala and sbt on the Command Line redirect_to: - https://docs.scala-lang.org/getting-started-sbt-track/getting-started-with-scala-and-sbt-on-the-command-line.html ---
{ "pile_set_name": "Github" }
// -*- C++ -*- //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___TUPLE #define _LIBCPP___TUPLE #include <__config> #include <cstddef> #include <type_traits> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif _LIBCPP_BEGIN_NAMESPACE_STD template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size; #if !defined(_LIBCPP_CXX03_LANG) template <class _Tp, class...> using __enable_if_tuple_size_imp = _Tp; template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp< const _Tp, typename enable_if<!is_volatile<_Tp>::value>::type, integral_constant<size_t, sizeof(tuple_size<_Tp>)>>> : public integral_constant<size_t, tuple_size<_Tp>::value> {}; template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp< volatile _Tp, typename enable_if<!is_const<_Tp>::value>::type, integral_constant<size_t, sizeof(tuple_size<_Tp>)>>> : public integral_constant<size_t, tuple_size<_Tp>::value> {}; template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp< const volatile _Tp, integral_constant<size_t, sizeof(tuple_size<_Tp>)>>> : public integral_constant<size_t, tuple_size<_Tp>::value> {}; #else template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<const _Tp> : public tuple_size<_Tp> {}; template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<volatile _Tp> : public tuple_size<_Tp> {}; template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<const volatile _Tp> : public tuple_size<_Tp> {}; #endif template <size_t _Ip, class _Tp> class _LIBCPP_TEMPLATE_VIS tuple_element; template <size_t _Ip, class _Tp> class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const _Tp> { public: typedef typename add_const<typename tuple_element<_Ip, _Tp>::type>::type type; }; template <size_t _Ip, class _Tp> class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, volatile _Tp> { public: typedef typename add_volatile<typename tuple_element<_Ip, _Tp>::type>::type type; }; template <size_t _Ip, class _Tp> class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const volatile _Tp> { public: typedef typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type; }; template <class _Tp> struct __tuple_like : false_type {}; template <class _Tp> struct __tuple_like<const _Tp> : public __tuple_like<_Tp> {}; template <class _Tp> struct __tuple_like<volatile _Tp> : public __tuple_like<_Tp> {}; template <class _Tp> struct __tuple_like<const volatile _Tp> : public __tuple_like<_Tp> {}; // tuple specializations #ifndef _LIBCPP_CXX03_LANG template <size_t...> struct __tuple_indices {}; template <class _IdxType, _IdxType... _Values> struct __integer_sequence { template <template <class _OIdxType, _OIdxType...> class _ToIndexSeq, class _ToIndexType> using __convert = _ToIndexSeq<_ToIndexType, _Values...>; template <size_t _Sp> using __to_tuple_indices = __tuple_indices<(_Values + _Sp)...>; }; #if !__has_builtin(__make_integer_seq) || defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE) namespace __detail { template<typename _Tp, size_t ..._Extra> struct __repeat; template<typename _Tp, _Tp ..._Np, size_t ..._Extra> struct __repeat<__integer_sequence<_Tp, _Np...>, _Extra...> { typedef __integer_sequence<_Tp, _Np..., sizeof...(_Np) + _Np..., 2 * sizeof...(_Np) + _Np..., 3 * sizeof...(_Np) + _Np..., 4 * sizeof...(_Np) + _Np..., 5 * sizeof...(_Np) + _Np..., 6 * sizeof...(_Np) + _Np..., 7 * sizeof...(_Np) + _Np..., _Extra...> type; }; template<size_t _Np> struct __parity; template<size_t _Np> struct __make : __parity<_Np % 8>::template __pmake<_Np> {}; template<> struct __make<0> { typedef __integer_sequence<size_t> type; }; template<> struct __make<1> { typedef __integer_sequence<size_t, 0> type; }; template<> struct __make<2> { typedef __integer_sequence<size_t, 0, 1> type; }; template<> struct __make<3> { typedef __integer_sequence<size_t, 0, 1, 2> type; }; template<> struct __make<4> { typedef __integer_sequence<size_t, 0, 1, 2, 3> type; }; template<> struct __make<5> { typedef __integer_sequence<size_t, 0, 1, 2, 3, 4> type; }; template<> struct __make<6> { typedef __integer_sequence<size_t, 0, 1, 2, 3, 4, 5> type; }; template<> struct __make<7> { typedef __integer_sequence<size_t, 0, 1, 2, 3, 4, 5, 6> type; }; template<> struct __parity<0> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type> {}; }; template<> struct __parity<1> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 1> {}; }; template<> struct __parity<2> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 2, _Np - 1> {}; }; template<> struct __parity<3> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 3, _Np - 2, _Np - 1> {}; }; template<> struct __parity<4> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; }; template<> struct __parity<5> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; }; template<> struct __parity<6> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 6, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; }; template<> struct __parity<7> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 7, _Np - 6, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; }; } // namespace detail #endif // !__has_builtin(__make_integer_seq) || defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE) #if __has_builtin(__make_integer_seq) template <size_t _Ep, size_t _Sp> using __make_indices_imp = typename __make_integer_seq<__integer_sequence, size_t, _Ep - _Sp>::template __to_tuple_indices<_Sp>; #else template <size_t _Ep, size_t _Sp> using __make_indices_imp = typename __detail::__make<_Ep - _Sp>::type::template __to_tuple_indices<_Sp>; #endif template <size_t _Ep, size_t _Sp = 0> struct __make_tuple_indices { static_assert(_Sp <= _Ep, "__make_tuple_indices input error"); typedef __make_indices_imp<_Ep, _Sp> type; }; template <class ..._Tp> class _LIBCPP_TEMPLATE_VIS tuple; template <class... _Tp> struct __tuple_like<tuple<_Tp...> > : true_type {}; template <class ..._Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<tuple<_Tp...> > : public integral_constant<size_t, sizeof...(_Tp)> { }; template <size_t _Ip, class ..._Tp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 typename tuple_element<_Ip, tuple<_Tp...> >::type& get(tuple<_Tp...>&) _NOEXCEPT; template <size_t _Ip, class ..._Tp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const typename tuple_element<_Ip, tuple<_Tp...> >::type& get(const tuple<_Tp...>&) _NOEXCEPT; template <size_t _Ip, class ..._Tp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 typename tuple_element<_Ip, tuple<_Tp...> >::type&& get(tuple<_Tp...>&&) _NOEXCEPT; template <size_t _Ip, class ..._Tp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const typename tuple_element<_Ip, tuple<_Tp...> >::type&& get(const tuple<_Tp...>&&) _NOEXCEPT; #endif // !defined(_LIBCPP_CXX03_LANG) // pair specializations template <class _T1, class _T2> struct __tuple_like<pair<_T1, _T2> > : true_type {}; template <size_t _Ip, class _T1, class _T2> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 typename tuple_element<_Ip, pair<_T1, _T2> >::type& get(pair<_T1, _T2>&) _NOEXCEPT; template <size_t _Ip, class _T1, class _T2> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const typename tuple_element<_Ip, pair<_T1, _T2> >::type& get(const pair<_T1, _T2>&) _NOEXCEPT; #ifndef _LIBCPP_CXX03_LANG template <size_t _Ip, class _T1, class _T2> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 typename tuple_element<_Ip, pair<_T1, _T2> >::type&& get(pair<_T1, _T2>&&) _NOEXCEPT; template <size_t _Ip, class _T1, class _T2> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&& get(const pair<_T1, _T2>&&) _NOEXCEPT; #endif // array specializations template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array; template <class _Tp, size_t _Size> struct __tuple_like<array<_Tp, _Size> > : true_type {}; template <size_t _Ip, class _Tp, size_t _Size> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _Tp& get(array<_Tp, _Size>&) _NOEXCEPT; template <size_t _Ip, class _Tp, size_t _Size> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const _Tp& get(const array<_Tp, _Size>&) _NOEXCEPT; #ifndef _LIBCPP_CXX03_LANG template <size_t _Ip, class _Tp, size_t _Size> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _Tp&& get(array<_Tp, _Size>&&) _NOEXCEPT; template <size_t _Ip, class _Tp, size_t _Size> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const _Tp&& get(const array<_Tp, _Size>&&) _NOEXCEPT; #endif #ifndef _LIBCPP_CXX03_LANG // __tuple_types template <class ..._Tp> struct __tuple_types {}; #if !__has_builtin(__type_pack_element) namespace __indexer_detail { template <size_t _Idx, class _Tp> struct __indexed { using type = _Tp; }; template <class _Types, class _Indexes> struct __indexer; template <class ..._Types, size_t ..._Idx> struct __indexer<__tuple_types<_Types...>, __tuple_indices<_Idx...>> : __indexed<_Idx, _Types>... {}; template <size_t _Idx, class _Tp> __indexed<_Idx, _Tp> __at_index(__indexed<_Idx, _Tp> const&); } // namespace __indexer_detail template <size_t _Idx, class ..._Types> using __type_pack_element = typename decltype( __indexer_detail::__at_index<_Idx>( __indexer_detail::__indexer< __tuple_types<_Types...>, typename __make_tuple_indices<sizeof...(_Types)>::type >{}) )::type; #endif template <size_t _Ip, class ..._Types> class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, __tuple_types<_Types...>> { public: static_assert(_Ip < sizeof...(_Types), "tuple_element index out of range"); typedef __type_pack_element<_Ip, _Types...> type; }; template <class ..._Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<__tuple_types<_Tp...> > : public integral_constant<size_t, sizeof...(_Tp)> { }; template <class... _Tp> struct __tuple_like<__tuple_types<_Tp...> > : true_type {}; template <bool _ApplyLV, bool _ApplyConst, bool _ApplyVolatile> struct __apply_cv_mf; template <> struct __apply_cv_mf<false, false, false> { template <class _Tp> using __apply = _Tp; }; template <> struct __apply_cv_mf<false, true, false> { template <class _Tp> using __apply = const _Tp; }; template <> struct __apply_cv_mf<false, false, true> { template <class _Tp> using __apply = volatile _Tp; }; template <> struct __apply_cv_mf<false, true, true> { template <class _Tp> using __apply = const volatile _Tp; }; template <> struct __apply_cv_mf<true, false, false> { template <class _Tp> using __apply = _Tp&; }; template <> struct __apply_cv_mf<true, true, false> { template <class _Tp> using __apply = const _Tp&; }; template <> struct __apply_cv_mf<true, false, true> { template <class _Tp> using __apply = volatile _Tp&; }; template <> struct __apply_cv_mf<true, true, true> { template <class _Tp> using __apply = const volatile _Tp&; }; template <class _Tp, class _RawTp = typename remove_reference<_Tp>::type> using __apply_cv_t = __apply_cv_mf< is_lvalue_reference<_Tp>::value, is_const<_RawTp>::value, is_volatile<_RawTp>::value>; // __make_tuple_types // __make_tuple_types<_Tuple<_Types...>, _Ep, _Sp>::type is a // __tuple_types<_Types...> using only those _Types in the range [_Sp, _Ep). // _Sp defaults to 0 and _Ep defaults to tuple_size<_Tuple>. If _Tuple is a // lvalue_reference type, then __tuple_types<_Types&...> is the result. template <class _TupleTypes, class _TupleIndices> struct __make_tuple_types_flat; template <template <class...> class _Tuple, class ..._Types, size_t ..._Idx> struct __make_tuple_types_flat<_Tuple<_Types...>, __tuple_indices<_Idx...>> { // Specialization for pair, tuple, and __tuple_types template <class _Tp, class _ApplyFn = __apply_cv_t<_Tp>> using __apply_quals = __tuple_types< typename _ApplyFn::template __apply<__type_pack_element<_Idx, _Types...>>... >; }; template <class _Vt, size_t _Np, size_t ..._Idx> struct __make_tuple_types_flat<array<_Vt, _Np>, __tuple_indices<_Idx...>> { template <size_t> using __value_type = _Vt; template <class _Tp, class _ApplyFn = __apply_cv_t<_Tp>> using __apply_quals = __tuple_types< typename _ApplyFn::template __apply<__value_type<_Idx>>... >; }; template <class _Tp, size_t _Ep = tuple_size<typename remove_reference<_Tp>::type>::value, size_t _Sp = 0, bool _SameSize = (_Ep == tuple_size<typename remove_reference<_Tp>::type>::value)> struct __make_tuple_types { static_assert(_Sp <= _Ep, "__make_tuple_types input error"); using _RawTp = typename remove_cv<typename remove_reference<_Tp>::type>::type; using _Maker = __make_tuple_types_flat<_RawTp, typename __make_tuple_indices<_Ep, _Sp>::type>; using type = typename _Maker::template __apply_quals<_Tp>; }; template <class ..._Types, size_t _Ep> struct __make_tuple_types<tuple<_Types...>, _Ep, 0, true> { typedef __tuple_types<_Types...> type; }; template <class ..._Types, size_t _Ep> struct __make_tuple_types<__tuple_types<_Types...>, _Ep, 0, true> { typedef __tuple_types<_Types...> type; }; template <bool ..._Preds> struct __all_dummy; template <bool ..._Pred> using __all = is_same<__all_dummy<_Pred...>, __all_dummy<((void)_Pred, true)...>>; struct __tuple_sfinae_base { template <template <class, class...> class _Trait, class ..._LArgs, class ..._RArgs> static auto __do_test(__tuple_types<_LArgs...>, __tuple_types<_RArgs...>) -> __all<typename enable_if<_Trait<_LArgs, _RArgs>::value, bool>::type{true}...>; template <template <class...> class> static auto __do_test(...) -> false_type; template <class _FromArgs, class _ToArgs> using __constructible = decltype(__do_test<is_constructible>(_ToArgs{}, _FromArgs{})); template <class _FromArgs, class _ToArgs> using __convertible = decltype(__do_test<is_convertible>(_FromArgs{}, _ToArgs{})); template <class _FromArgs, class _ToArgs> using __assignable = decltype(__do_test<is_assignable>(_ToArgs{}, _FromArgs{})); }; // __tuple_convertible template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value, bool = __tuple_like<_Up>::value> struct __tuple_convertible : public false_type {}; template <class _Tp, class _Up> struct __tuple_convertible<_Tp, _Up, true, true> : public __tuple_sfinae_base::__convertible< typename __make_tuple_types<_Tp>::type , typename __make_tuple_types<_Up>::type > {}; // __tuple_constructible template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value, bool = __tuple_like<_Up>::value> struct __tuple_constructible : public false_type {}; template <class _Tp, class _Up> struct __tuple_constructible<_Tp, _Up, true, true> : public __tuple_sfinae_base::__constructible< typename __make_tuple_types<_Tp>::type , typename __make_tuple_types<_Up>::type > {}; // __tuple_assignable template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value, bool = __tuple_like<_Up>::value> struct __tuple_assignable : public false_type {}; template <class _Tp, class _Up> struct __tuple_assignable<_Tp, _Up, true, true> : public __tuple_sfinae_base::__assignable< typename __make_tuple_types<_Tp>::type , typename __make_tuple_types<_Up&>::type > {}; template <size_t _Ip, class ..._Tp> class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, tuple<_Tp...> > { public: typedef typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type; }; #if _LIBCPP_STD_VER > 11 template <size_t _Ip, class ..._Tp> using tuple_element_t = typename tuple_element <_Ip, _Tp...>::type; #endif template <bool _IsTuple, class _SizeTrait, size_t _Expected> struct __tuple_like_with_size_imp : false_type {}; template <class _SizeTrait, size_t _Expected> struct __tuple_like_with_size_imp<true, _SizeTrait, _Expected> : integral_constant<bool, _SizeTrait::value == _Expected> {}; template <class _Tuple, size_t _ExpectedSize, class _RawTuple = typename __uncvref<_Tuple>::type> using __tuple_like_with_size = __tuple_like_with_size_imp< __tuple_like<_RawTuple>::value, tuple_size<_RawTuple>, _ExpectedSize >; struct _LIBCPP_TYPE_VIS __check_tuple_constructor_fail { template <class ...> static constexpr bool __enable_default() { return false; } template <class ...> static constexpr bool __enable_explicit() { return false; } template <class ...> static constexpr bool __enable_implicit() { return false; } template <class ...> static constexpr bool __enable_assign() { return false; } }; #endif // !defined(_LIBCPP_CXX03_LANG) #if _LIBCPP_STD_VER > 14 template <bool _CanCopy, bool _CanMove> struct __sfinae_ctor_base {}; template <> struct __sfinae_ctor_base<false, false> { __sfinae_ctor_base() = default; __sfinae_ctor_base(__sfinae_ctor_base const&) = delete; __sfinae_ctor_base(__sfinae_ctor_base &&) = delete; __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default; __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default; }; template <> struct __sfinae_ctor_base<true, false> { __sfinae_ctor_base() = default; __sfinae_ctor_base(__sfinae_ctor_base const&) = default; __sfinae_ctor_base(__sfinae_ctor_base &&) = delete; __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default; __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default; }; template <> struct __sfinae_ctor_base<false, true> { __sfinae_ctor_base() = default; __sfinae_ctor_base(__sfinae_ctor_base const&) = delete; __sfinae_ctor_base(__sfinae_ctor_base &&) = default; __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default; __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default; }; template <bool _CanCopy, bool _CanMove> struct __sfinae_assign_base {}; template <> struct __sfinae_assign_base<false, false> { __sfinae_assign_base() = default; __sfinae_assign_base(__sfinae_assign_base const&) = default; __sfinae_assign_base(__sfinae_assign_base &&) = default; __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete; __sfinae_assign_base& operator=(__sfinae_assign_base&&) = delete; }; template <> struct __sfinae_assign_base<true, false> { __sfinae_assign_base() = default; __sfinae_assign_base(__sfinae_assign_base const&) = default; __sfinae_assign_base(__sfinae_assign_base &&) = default; __sfinae_assign_base& operator=(__sfinae_assign_base const&) = default; __sfinae_assign_base& operator=(__sfinae_assign_base&&) = delete; }; template <> struct __sfinae_assign_base<false, true> { __sfinae_assign_base() = default; __sfinae_assign_base(__sfinae_assign_base const&) = default; __sfinae_assign_base(__sfinae_assign_base &&) = default; __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete; __sfinae_assign_base& operator=(__sfinae_assign_base&&) = default; }; #endif // _LIBCPP_STD_VER > 14 _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TUPLE
{ "pile_set_name": "Github" }
/* * Copyright 2019 LinkedIn Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package azkaban.sla; /** * SLA type -- if SLA is for a flow or job that has succeeded or finished. */ public enum SlaType { FLOW_FINISH("FlowFinish", ComponentType.FLOW, StatusType.FINISH), FLOW_SUCCEED("FlowSucceed", ComponentType.FLOW, StatusType.SUCCEED), JOB_FINISH("JobFinish", ComponentType.JOB, StatusType.FINISH), JOB_SUCCEED("JobSucceed", ComponentType.JOB, StatusType.SUCCEED); /** * The component the SLA is for: a flow or job. */ public enum ComponentType { FLOW, JOB } /** * The status the SLA is for: finish or succeed. */ public enum StatusType { FINISH, SUCCEED } final private String name; final private ComponentType component; final private StatusType status; /** * Constructor. * * @param name the SLA type name. * @param component The component the SLA is for, either flow or job. * @param status the status the SLA is for, either succeed or finish. */ SlaType(String name, ComponentType component, StatusType status) { this.name = name; this.component = component; this.status = status; } public String getName() { return name; } public ComponentType getComponent() { return component; } public StatusType getStatus() { return status; } }
{ "pile_set_name": "Github" }
/* minigzip.c -- simulate gzip using the zlib compression library * Copyright (C) 1995-2002 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ /* * minigzip is a minimal implementation of the gzip utility. This is * only an example of using zlib and isn't meant to replace the * full-featured gzip. No attempt is made to deal with file systems * limiting names to 14 or 8+3 characters, etc... Error checking is * very limited. So use minigzip only for testing; use gzip for the * real thing. On MSDOS, use only on file names without extension * or in pipe mode. */ /* @(#) $Id: minigzip.c,v 1.1.1.1 2005/04/24 21:39:42 giles Exp $ */ #include <stdio.h> #include "zlib.h" #ifdef STDC # include <string.h> # include <stdlib.h> #else extern void exit OF((int)); #endif #ifdef USE_MMAP # include <sys/types.h> # include <sys/mman.h> # include <sys/stat.h> #endif #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) # include <fcntl.h> # include <io.h> # define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) #else # define SET_BINARY_MODE(file) #endif #ifdef VMS # define unlink delete # define GZ_SUFFIX "-gz" #endif #ifdef RISCOS # define unlink remove # define GZ_SUFFIX "-gz" # define fileno(file) file->__file #endif #if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os # include <unix.h> /* for fileno */ #endif #ifndef WIN32 /* unlink already in stdio.h for WIN32 */ extern int unlink OF((const char *)); #endif #ifndef GZ_SUFFIX # define GZ_SUFFIX ".gz" #endif #define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1) #define BUFLEN 16384 #define MAX_NAME_LEN 1024 #ifdef MAXSEG_64K # define local static /* Needed for systems with limitation on stack size. */ #else # define local #endif char *prog; void error OF((const char *msg)); void gz_compress OF((FILE *in, gzFile out)); #ifdef USE_MMAP int gz_compress_mmap OF((FILE *in, gzFile out)); #endif void gz_uncompress OF((gzFile in, FILE *out)); void file_compress OF((char *file, char *mode)); void file_uncompress OF((char *file)); int main OF((int argc, char *argv[])); /* =========================================================================== * Display error message and exit */ void error(msg) const char *msg; { fprintf(stderr, "%s: %s\n", prog, msg); exit(1); } /* =========================================================================== * Compress input to output then close both files. */ void gz_compress(in, out) FILE *in; gzFile out; { local char buf[BUFLEN]; int len; int err; #ifdef USE_MMAP /* Try first compressing with mmap. If mmap fails (minigzip used in a * pipe), use the normal fread loop. */ if (gz_compress_mmap(in, out) == Z_OK) return; #endif for (;;) { len = (int)fread(buf, 1, sizeof(buf), in); if (ferror(in)) { perror("fread"); exit(1); } if (len == 0) break; if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err)); } fclose(in); if (gzclose(out) != Z_OK) error("failed gzclose"); } #ifdef USE_MMAP /* MMAP version, Miguel Albrecht <malbrech@eso.org> */ /* Try compressing the input file at once using mmap. Return Z_OK if * if success, Z_ERRNO otherwise. */ int gz_compress_mmap(in, out) FILE *in; gzFile out; { int len; int err; int ifd = fileno(in); caddr_t buf; /* mmap'ed buffer for the entire input file */ off_t buf_len; /* length of the input file */ struct stat sb; /* Determine the size of the file, needed for mmap: */ if (fstat(ifd, &sb) < 0) return Z_ERRNO; buf_len = sb.st_size; if (buf_len <= 0) return Z_ERRNO; /* Now do the actual mmap: */ buf = mmap((caddr_t) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0); if (buf == (caddr_t)(-1)) return Z_ERRNO; /* Compress the whole file at once: */ len = gzwrite(out, (char *)buf, (unsigned)buf_len); if (len != (int)buf_len) error(gzerror(out, &err)); munmap(buf, buf_len); fclose(in); if (gzclose(out) != Z_OK) error("failed gzclose"); return Z_OK; } #endif /* USE_MMAP */ /* =========================================================================== * Uncompress input to output then close both files. */ void gz_uncompress(in, out) gzFile in; FILE *out; { local char buf[BUFLEN]; int len; int err; for (;;) { len = gzread(in, buf, sizeof(buf)); if (len < 0) error (gzerror(in, &err)); if (len == 0) break; if ((int)fwrite(buf, 1, (unsigned)len, out) != len) { error("failed fwrite"); } } if (fclose(out)) error("failed fclose"); if (gzclose(in) != Z_OK) error("failed gzclose"); } /* =========================================================================== * Compress the given file: create a corresponding .gz file and remove the * original. */ void file_compress(file, mode) char *file; char *mode; { local char outfile[MAX_NAME_LEN]; FILE *in; gzFile out; strcpy(outfile, file); strcat(outfile, GZ_SUFFIX); in = fopen(file, "rb"); if (in == NULL) { perror(file); exit(1); } out = gzopen(outfile, mode); if (out == NULL) { fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile); exit(1); } gz_compress(in, out); unlink(file); } /* =========================================================================== * Uncompress the given file and remove the original. */ void file_uncompress(file) char *file; { local char buf[MAX_NAME_LEN]; char *infile, *outfile; FILE *out; gzFile in; uInt len = (uInt)strlen(file); strcpy(buf, file); if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) { infile = file; outfile = buf; outfile[len-3] = '\0'; } else { outfile = file; infile = buf; strcat(infile, GZ_SUFFIX); } in = gzopen(infile, "rb"); if (in == NULL) { fprintf(stderr, "%s: can't gzopen %s\n", prog, infile); exit(1); } out = fopen(outfile, "wb"); if (out == NULL) { perror(file); exit(1); } gz_uncompress(in, out); unlink(infile); } /* =========================================================================== * Usage: minigzip [-d] [-f] [-h] [-r] [-1 to -9] [files...] * -d : decompress * -f : compress with Z_FILTERED * -h : compress with Z_HUFFMAN_ONLY * -r : compress with Z_RLE * -1 to -9 : compression level */ int main(argc, argv) int argc; char *argv[]; { int uncompr = 0; gzFile file; char outmode[20]; strcpy(outmode, "wb6 "); prog = argv[0]; argc--, argv++; while (argc > 0) { if (strcmp(*argv, "-d") == 0) uncompr = 1; else if (strcmp(*argv, "-f") == 0) outmode[3] = 'f'; else if (strcmp(*argv, "-h") == 0) outmode[3] = 'h'; else if (strcmp(*argv, "-r") == 0) outmode[3] = 'R'; else if ((*argv)[0] == '-' && (*argv)[1] >= '1' && (*argv)[1] <= '9' && (*argv)[2] == 0) outmode[2] = (*argv)[1]; else break; argc--, argv++; } if (argc == 0) { SET_BINARY_MODE(stdin); SET_BINARY_MODE(stdout); if (uncompr) { file = gzdopen(fileno(stdin), "rb"); if (file == NULL) error("can't gzdopen stdin"); gz_uncompress(file, stdout); } else { file = gzdopen(fileno(stdout), outmode); if (file == NULL) error("can't gzdopen stdout"); gz_compress(stdin, file); } } else { do { if (uncompr) { file_uncompress(*argv); } else { file_compress(*argv, outmode); } } while (argv++, --argc); } return 0; }
{ "pile_set_name": "Github" }
/* Copyright (c) 2009-2016, Jack Poulson All rights reserved. This file is part of Elemental and is under the BSD 2-Clause License, which can be found in the LICENSE file in the root directory, or at http://opensource.org/licenses/BSD-2-Clause */ #include <El.hpp> using namespace El; template<typename Field> void TestCorrectness ( UpperOrLower uplo, const Matrix<Field>& T, Base<Field> alpha, const Matrix<Field>& V, const Matrix<Field>& A, Int numRHS=100 ) { typedef Base<Field> Real; const Int n = V.Height(); const Real eps = limits::Epsilon<Real>(); Matrix<Field> B( A ); Herk( uplo, NORMAL, alpha, V, Real(1), B ); // Test correctness by multiplying a random set of vectors by // A + alpha V V^H, then using the Cholesky factorization to solve. Matrix<Field> X, Y; Uniform( X, n, numRHS ); Zeros( Y, n, numRHS ); Hemm( LEFT, uplo, Field(1), B, X, Field(0), Y ); const Real oneNormY = OneNorm( Y ); cholesky::SolveAfter( uplo, NORMAL, T, Y ); X -= Y; const Real infNormE = InfinityNorm( X ); const Real relError = infNormE / (eps*n*oneNormY); Output("|| X - B \\ Y ||_oo / (n eps || Y ||_1) = ",relError); // TODO(poulson): Use a more refined failure condition if( relError > Real(10) ) LogicError("Relative error was unacceptably large"); } template<typename Field> void TestCorrectness ( UpperOrLower uplo, const DistMatrix<Field>& T, Base<Field> alpha, const DistMatrix<Field>& V, const DistMatrix<Field>& A, Int numRHS=100 ) { typedef Base<Field> Real; const Int n = V.Height(); const Real eps = limits::Epsilon<Real>(); const Grid& grid = T.Grid(); DistMatrix<Field> B( A ); Herk( uplo, NORMAL, alpha, V, Real(1), B ); // Test correctness by multiplying a random set of vectors by // A + alpha V V^H, then using the Cholesky factorization to solve. DistMatrix<Field> X(grid), Y(grid); Uniform( X, n, numRHS ); Zeros( Y, n, numRHS ); Hemm( LEFT, uplo, Field(1), B, X, Field(0), Y ); const Real oneNormY = OneNorm( Y ); cholesky::SolveAfter( uplo, NORMAL, T, Y ); X -= Y; const Real infNormE = InfinityNorm( X ); const Real relError = infNormE / (eps*n*oneNormY); OutputFromRoot (grid.Comm(),"|| X - B \\ Y ||_oo / (n eps || Y ||_1) = ",relError); // TODO(poulson): Use a more refined failure condition if( relError > Real(10) ) LogicError("Relative error was unacceptably large"); } template<typename Field> void TestCholeskyMod ( UpperOrLower uplo, Int m, Int n, Base<Field> alpha, bool correctness, bool print ) { Output("Testing with ",TypeName<Field>()); PushIndent(); Matrix<Field> T, A; HermitianUniformSpectrum( T, m, 1e-9, 10 ); if( correctness ) A = T; if( print ) Print( T, "A" ); Output("Starting Cholesky..."); Timer timer; timer.Start(); Cholesky( uplo, T ); double runTime = timer.Stop(); double realGFlops = 1./3.*Pow(double(m),3.)/(1.e9*runTime); double gFlops = ( IsComplex<Field>::value ? 4*realGFlops : realGFlops ); Output(runTime," seconds (",gFlops," GFlop/s)"); MakeTrapezoidal( uplo, T ); if( print ) Print( T, "Cholesky factor" ); Matrix<Field> V, VMod; Uniform( V, m, n ); V *= Field(1)/Sqrt(Field(m)*Field(n)); VMod = V; if( print ) Print( V, "V" ); Output("Starting Cholesky mod..."); timer.Start(); CholeskyMod( uplo, T, alpha, VMod ); runTime = timer.Stop(); Output(runTime," seconds"); if( print ) Print( T, "Modified Cholesky factor" ); if( correctness ) TestCorrectness( uplo, T, alpha, V, A ); PopIndent(); } template<typename Field> void TestCholeskyMod ( const Grid& grid, UpperOrLower uplo, Int m, Int n, Base<Field> alpha, bool correctness, bool print ) { OutputFromRoot(grid.Comm(),"Testing with ",TypeName<Field>()); PushIndent(); DistMatrix<Field> T(grid), A(grid); HermitianUniformSpectrum( T, m, 1e-9, 10 ); if( correctness ) A = T; if( print ) Print( T, "A" ); OutputFromRoot(grid.Comm(),"Starting Cholesky..."); Timer timer; timer.Start(); Cholesky( uplo, T ); double runTime = timer.Stop(); double realGFlops = 1./3.*Pow(double(m),3.)/(1.e9*runTime); double gFlops = ( IsComplex<Field>::value ? 4*realGFlops : realGFlops ); OutputFromRoot(grid.Comm(),runTime," seconds (",gFlops," GFlop/s)"); MakeTrapezoidal( uplo, T ); if( print ) Print( T, "Cholesky factor" ); DistMatrix<Field> V(grid), VMod(grid); Uniform( V, m, n ); V *= Field(1)/Sqrt(Field(m)*Field(n)); VMod = V; if( print ) Print( V, "V" ); OutputFromRoot(grid.Comm(),"Starting Cholesky mod..."); timer.Start(); CholeskyMod( uplo, T, alpha, VMod ); runTime = timer.Stop(); OutputFromRoot(grid.Comm(),runTime," seconds"); if( print ) Print( T, "Modified Cholesky factor" ); if( correctness ) TestCorrectness( uplo, T, alpha, V, A ); PopIndent(); } int main( int argc, char* argv[] ) { Environment env( argc, argv ); mpi::Comm comm = mpi::COMM_WORLD; try { Int gridHeight = Input("--gridHeight","process grid height",0); const bool colMajor = Input("--colMajor","column-major ordering?",true); const char uploChar = Input("--uplo","upper or lower storage: L/U",'L'); const Int m = Input("--m","height of matrix",100); const Int n = Input("--n","rank of update",5); const Int nb = Input("--nb","algorithmic blocksize",96); const double alpha = Input("--alpha","update scaling",3.); const bool sequential = Input("--sequential","test sequential?",true); const bool correctness = Input("--correctness","test correctness?",true); const bool print = Input("--print","print matrices?",false); #ifdef EL_HAVE_MPC const mpfr_prec_t prec = Input("--prec","MPFR precision",256); #endif ProcessInput(); PrintInputReport(); #ifdef EL_HAVE_MPC mpfr::SetPrecision( prec ); #endif if( gridHeight == 0 ) gridHeight = Grid::DefaultHeight( mpi::Size(comm) ); const GridOrder order = ( colMajor ? COLUMN_MAJOR : ROW_MAJOR ); const Grid g( comm, gridHeight, order ); const UpperOrLower uplo = CharToUpperOrLower( uploChar ); SetBlocksize( nb ); ComplainIfDebug(); if( sequential && mpi::Rank() == 0 ) { TestCholeskyMod<float> ( uplo, m, n, alpha, correctness, print ); TestCholeskyMod<Complex<float>> ( uplo, m, n, alpha, correctness, print ); TestCholeskyMod<double> ( uplo, m, n, alpha, correctness, print ); TestCholeskyMod<Complex<double>> ( uplo, m, n, alpha, correctness, print ); #ifdef EL_HAVE_QD TestCholeskyMod<DoubleDouble> ( uplo, m, n, alpha, correctness, print ); TestCholeskyMod<QuadDouble> ( uplo, m, n, alpha, correctness, print ); TestCholeskyMod<Complex<DoubleDouble>> ( uplo, m, n, alpha, correctness, print ); TestCholeskyMod<Complex<QuadDouble>> ( uplo, m, n, alpha, correctness, print ); #endif #ifdef EL_HAVE_QUAD TestCholeskyMod<Quad> ( uplo, m, n, alpha, correctness, print ); TestCholeskyMod<Complex<Quad>> ( uplo, m, n, alpha, correctness, print ); #endif #ifdef EL_HAVE_MPC TestCholeskyMod<BigFloat> ( uplo, m, n, alpha, correctness, print ); TestCholeskyMod<Complex<BigFloat>> ( uplo, m, n, alpha, correctness, print ); #endif } TestCholeskyMod<float> ( g, uplo, m, n, alpha, correctness, print ); TestCholeskyMod<Complex<float>> ( g, uplo, m, n, alpha, correctness, print ); TestCholeskyMod<double> ( g, uplo, m, n, alpha, correctness, print ); TestCholeskyMod<Complex<double>> ( g, uplo, m, n, alpha, correctness, print ); #ifdef EL_HAVE_QD TestCholeskyMod<DoubleDouble> ( g, uplo, m, n, alpha, correctness, print ); TestCholeskyMod<QuadDouble> ( g, uplo, m, n, alpha, correctness, print ); TestCholeskyMod<Complex<DoubleDouble>> ( g, uplo, m, n, alpha, correctness, print ); TestCholeskyMod<Complex<QuadDouble>> ( g, uplo, m, n, alpha, correctness, print ); #endif #ifdef EL_HAVE_QUAD TestCholeskyMod<Quad> ( g, uplo, m, n, alpha, correctness, print ); TestCholeskyMod<Complex<Quad>> ( g, uplo, m, n, alpha, correctness, print ); #endif #ifdef EL_HAVE_MPC TestCholeskyMod<BigFloat> ( g, uplo, m, n, alpha, correctness, print ); TestCholeskyMod<Complex<BigFloat>> ( g, uplo, m, n, alpha, correctness, print ); #endif } catch( exception& e ) { ReportException(e); } return 0; }
{ "pile_set_name": "Github" }
<html> <head> <title>NVIDIA(R) PhysX(R) SDK 3.4 API Reference: Member List</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <LINK HREF="NVIDIA.css" REL="stylesheet" TYPE="text/css"> </head> <body bgcolor="#FFFFFF"> <div id="header"> <hr class="first"> <img alt="" src="images/PhysXlogo.png" align="middle"> <br> <center> <a class="qindex" href="main.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </center> <hr class="second"> </div> <!-- Generated by Doxygen 1.5.8 --> <div class="contents"> <h1>PxVec3 Member List</h1>This is the complete list of members for <a class="el" href="classPxVec3.html">PxVec3</a>, including all inherited members.<p><table> <tr class="memlist"><td><a class="el" href="classPxVec3.html#4454d8535cfbf9d723f771c0b9adeb6d">abs</a>() const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#f14a984e579fb0fa49b5d30c2d008691">cross</a>(const PxVec3 &amp;v) const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#f29c27e8aae481d97570e7990388bdf5">dot</a>(const PxVec3 &amp;v) const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#91d643f074916c986cf36081a1f67bca">getNormalized</a>() const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#65b6f42ac7654a7d79590a2f1d00e160">isFinite</a>() const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#2921910607fd21a4aaf24114a705daf7">isNormalized</a>() const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#744d8602ff3568f0eefb1a2be0295ec1">isZero</a>() const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#484f52dfb6f012cd492f8321bc1b4d42">magnitude</a>() const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#257aac3cfb20ef11768209f61b4fc9eb">magnitudeSquared</a>() const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#6f31dfee4f75a05884c6e4f511e21142">maxElement</a>() const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#c0788c2bb97bfaa65106fea23cf55a83">maximum</a>(const PxVec3 &amp;v) const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#cb26d5ad522e925245a3b16f76df4b51">minElement</a>() const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#0fe31e31784b03510dd5eb94b4322e29">minimum</a>(const PxVec3 &amp;v) const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#9cc40866bdd9940ef8a3cc8d2a75a593">multiply</a>(const PxVec3 &amp;a) const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#b67c4b05db03b0ceeddc74b1f6f77af5">normalize</a>()</td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#be30659678fa294743b2eaabe69a8689">normalizeFast</a>()</td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#69edea41dcd58f35d35036026bf75dcc">normalizeSafe</a>()</td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#34f703b843288209243dd5c6f9f714d6">operator!=</a>(const PxVec3 &amp;v) const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#4399c60f4d75e2dd12dd62d67f1e4fd6">operator*</a>(float f) const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#1b8491d9bd8784f27573b31927b730b2">operator*=</a>(float f)</td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#e1e60e73149c6292d7d440c75978fbd0">operator+</a>(const PxVec3 &amp;v) const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#98bd7279c4e208de0ba2c072e7cde6bb">operator+=</a>(const PxVec3 &amp;v)</td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#52f34539398f2f80d9c7d635cee65646">operator-</a>() const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#023d08679d83fc24db4e3a7b4033f720">operator-</a>(const PxVec3 &amp;v) const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#0e2b732fce0676fd6f7133d80dcb9979">operator-=</a>(const PxVec3 &amp;v)</td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#6c4f1d1a455628f6bf4594b9ce62d26c">operator/</a>(float f) const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#edae1ad379d93f8713b7f8c09db8b8fa">operator/=</a>(float f)</td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#86f607c621d110d976c8e71772c25158">operator=</a>(const PxVec3 &amp;p)</td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#81950e1461513bdae58fc5e80443455c">operator==</a>(const PxVec3 &amp;v) const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#faae1b939e5c7ae27aba81612dd5fc01">operator[]</a>(unsigned int index)</td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#a0224a065fc915ebd610887d6d156343">operator[]</a>(unsigned int index) const </td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#672e12542fc6f752d21368493578af4e">PxVec3</a>()</td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#639685f39203ac441edd2158ef1a1549">PxVec3</a>(PxZERO r)</td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#864f52fe3c9c9f72f5796a7cb64b2628">PxVec3</a>(float a)</td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline, explicit]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#bd382848d9b79dbcec4d86ee0e98836b">PxVec3</a>(float nx, float ny, float nz)</td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#b8853e036ac988fb3c58d1acd9f466d5">PxVec3</a>(const PxVec3 &amp;v)</td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#391194bca8291161c06254f4ac2b6ada">x</a></td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#29958700f50da2204edc519b47706a05">y</a></td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="classPxVec3.html#50d67b162b99b904c3f362ad0415dbca">z</a></td><td><a class="el" href="classPxVec3.html">PxVec3</a></td><td></td></tr> </table></div> <hr style="width: 100%; height: 2px;"><br> Copyright &copy; 2008-2018 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. <a href="http://www.nvidia.com ">www.nvidia.com</a> </body> </html>
{ "pile_set_name": "Github" }
(;CA[UTF-8]AP[YuanYu]GM[1]FF[4] SZ[19] GN[] DT[2018-05-18] PB[金毛测试]BR[9段] PW[tiger]WR[9段] KM[750]HA[0]RU[Japanese]RE[B+R]TM[1200]TC[7]TT[30] ;B[pd];W[dp];B[pq];W[dd];B[pn];W[fq];B[fc];W[cf];B[nc];W[hc];B[gp] ;W[kp];B[mq];W[kc];B[gq];W[fp];B[go];W[kn];B[hl];W[kl];B[dc];W[cc] ;B[cb];W[ec];B[db];W[ed];B[cd];W[bc];B[bd];W[bb];B[ba];W[eb];B[ab] ;W[ql];B[qj];W[qp];B[pp];W[qn];B[qo];W[ro];B[po];W[rm];B[rp];W[sp] ;B[rq];W[pm];B[qg];W[dm];B[ck];W[fm];B[co];W[bm];B[cp];W[fo];B[cr] ;W[hm];B[kr];W[ci];B[dg];W[cg];B[el];W[dl];B[dk];W[ek];B[en];W[fn] ;B[em];W[bk];B[dn])
{ "pile_set_name": "Github" }
# This file is part of the myhdl library, a Python package for using # Python as a Hardware Description Language. # # Copyright (C) 2003-2008 Jan Decaluwe # # The myhdl library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ Run cosimulation unit tests. """ import sys sys.path.append("../../test") import test_bin2gray import test_inc import test_dff modules = (test_bin2gray, test_inc, test_dff) import unittest tl = unittest.defaultTestLoader def suite(): alltests = unittest.TestSuite() for m in modules: alltests.addTest(tl.loadTestsFromModule(m)) return alltests def main(): unittest.main(defaultTest='suite', testRunner=unittest.TextTestRunner(verbosity=2)) if __name__ == '__main__': main()
{ "pile_set_name": "Github" }
{ "images" : [ { "idiom" : "universal", "filename" : "costom_setting.png", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
// Common/MyGuidDef.h #ifndef GUID_DEFINED #define GUID_DEFINED #include "MyTypes.h" typedef struct { UInt32 Data1; UInt16 Data2; UInt16 Data3; unsigned char Data4[8]; } GUID; #ifdef __cplusplus #define REFGUID const GUID & #else #define REFGUID const GUID * #endif #define REFCLSID REFGUID #define REFIID REFGUID #ifdef __cplusplus inline int operator==(REFGUID g1, REFGUID g2) { for (int i = 0; i < (int)sizeof(g1); i++) if (((unsigned char *)&g1)[i] != ((unsigned char *)&g2)[i]) return 0; return 1; } inline int operator!=(REFGUID g1, REFGUID g2) { return !(g1 == g2); } #endif #ifdef __cplusplus #define MY_EXTERN_C extern "C" #else #define MY_EXTERN_C extern #endif #endif #ifdef DEFINE_GUID #undef DEFINE_GUID #endif #ifdef INITGUID #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ MY_EXTERN_C const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } #else #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ MY_EXTERN_C const GUID name #endif
{ "pile_set_name": "Github" }
/**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008 Apple Inc. All Rights Reserved. http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ /* * Support for RGBA_4_4_4_4 and RGBA_5_5_5_1 was copied from: * https://devforums.apple.com/message/37855#37855 by a1studmuffin */ #include "CCTexture2D.h" #include "ccConfig.h" #include "ccMacros.h" #include "CCConfiguration.h" #include "platform/platform.h" #include "platform/CCImage.h" #include "CCGL.h" #include "support/ccUtils.h" #include "platform/CCPlatformMacros.h" #include "textures/CCTexturePVR.h" #include "CCDirector.h" #include "shaders/CCGLProgram.h" #include "shaders/ccGLStateCache.h" #include "shaders/CCShaderCache.h" #if CC_ENABLE_CACHE_TEXTURE_DATA #include "CCTextureCache.h" #endif NS_CC_BEGIN //CLASS IMPLEMENTATIONS: // If the image has alpha, you can create RGBA8 (32-bit) or RGBA4 (16-bit) or RGB5A1 (16-bit) // Default is: RGBA8888 (32-bit textures) static CCTexture2DPixelFormat g_defaultAlphaPixelFormat = kCCTexture2DPixelFormat_Default; // By default PVR images are treated as if they don't have the alpha channel premultiplied static bool PVRHaveAlphaPremultiplied_ = false; CCTexture2D::CCTexture2D() : m_uPixelsWide(0) , m_uPixelsHigh(0) , m_uName(0) , m_fMaxS(0.0) , m_fMaxT(0.0) , m_bHasPremultipliedAlpha(false) , m_bHasMipmaps(false) , m_bPVRHaveAlphaPremultiplied(true) , m_pShaderProgram(NULL) { } CCTexture2D::~CCTexture2D() { #if CC_ENABLE_CACHE_TEXTURE_DATA VolatileTexture::removeTexture(this); #endif CCLOGINFO("cocos2d: deallocing CCTexture2D %u.", m_uName); CC_SAFE_RELEASE(m_pShaderProgram); if(m_uName) { ccGLDeleteTexture(m_uName); } } CCTexture2DPixelFormat CCTexture2D::getPixelFormat() { return m_ePixelFormat; } unsigned int CCTexture2D::getPixelsWide() { return m_uPixelsWide; } unsigned int CCTexture2D::getPixelsHigh() { return m_uPixelsHigh; } GLuint CCTexture2D::getName() { return m_uName; } CCSize CCTexture2D::getContentSize() { CCSize ret; ret.width = m_tContentSize.width / CC_CONTENT_SCALE_FACTOR(); ret.height = m_tContentSize.height / CC_CONTENT_SCALE_FACTOR(); return ret; } const CCSize& CCTexture2D::getContentSizeInPixels() { return m_tContentSize; } GLfloat CCTexture2D::getMaxS() { return m_fMaxS; } void CCTexture2D::setMaxS(GLfloat maxS) { m_fMaxS = maxS; } GLfloat CCTexture2D::getMaxT() { return m_fMaxT; } void CCTexture2D::setMaxT(GLfloat maxT) { m_fMaxT = maxT; } CCGLProgram* CCTexture2D::getShaderProgram(void) { return m_pShaderProgram; } void CCTexture2D::setShaderProgram(CCGLProgram* pShaderProgram) { CC_SAFE_RETAIN(pShaderProgram); CC_SAFE_RELEASE(m_pShaderProgram); m_pShaderProgram = pShaderProgram; } void CCTexture2D::releaseData(void *data) { free(data); } void* CCTexture2D::keepData(void *data, unsigned int length) { CC_UNUSED_PARAM(length); //The texture data mustn't be saved because it isn't a mutable texture. return data; } bool CCTexture2D::hasPremultipliedAlpha() { return m_bHasPremultipliedAlpha; } bool CCTexture2D::initWithData(const void *data, CCTexture2DPixelFormat pixelFormat, unsigned int pixelsWide, unsigned int pixelsHigh, const CCSize& contentSize) { // XXX: 32 bits or POT textures uses UNPACK of 4 (is this correct ??? ) if( pixelFormat == kCCTexture2DPixelFormat_RGBA8888 || ( ccNextPOT(pixelsWide)==pixelsWide && ccNextPOT(pixelsHigh)==pixelsHigh) ) { glPixelStorei(GL_UNPACK_ALIGNMENT,4); } else { glPixelStorei(GL_UNPACK_ALIGNMENT,1); } glGenTextures(1, &m_uName); ccGLBindTexture2D(m_uName); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); // Specify OpenGL texture image switch(pixelFormat) { case kCCTexture2DPixelFormat_RGBA8888: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (GLsizei)pixelsWide, (GLsizei)pixelsHigh, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); break; case kCCTexture2DPixelFormat_RGB888: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, (GLsizei)pixelsWide, (GLsizei)pixelsHigh, 0, GL_RGB, GL_UNSIGNED_BYTE, data); break; case kCCTexture2DPixelFormat_RGBA4444: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (GLsizei)pixelsWide, (GLsizei)pixelsHigh, 0, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, data); break; case kCCTexture2DPixelFormat_RGB5A1: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (GLsizei)pixelsWide, (GLsizei)pixelsHigh, 0, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, data); break; case kCCTexture2DPixelFormat_RGB565: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, (GLsizei)pixelsWide, (GLsizei)pixelsHigh, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, data); break; case kCCTexture2DPixelFormat_AI88: glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, (GLsizei)pixelsWide, (GLsizei)pixelsHigh, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, data); break; case kCCTexture2DPixelFormat_A8: glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, (GLsizei)pixelsWide, (GLsizei)pixelsHigh, 0, GL_ALPHA, GL_UNSIGNED_BYTE, data); break; case kCCTexture2DPixelFormat_I8: glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, (GLsizei)pixelsWide, (GLsizei)pixelsHigh, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, data); break; default: CCAssert(0, "NSInternalInconsistencyException"); } m_tContentSize = contentSize; m_uPixelsWide = pixelsWide; m_uPixelsHigh = pixelsHigh; m_ePixelFormat = pixelFormat; m_fMaxS = contentSize.width / (float)(pixelsWide); m_fMaxT = contentSize.height / (float)(pixelsHigh); m_bHasPremultipliedAlpha = false; m_bHasMipmaps = false; setShaderProgram(CCShaderCache::sharedShaderCache()->programForKey(kCCShader_PositionTexture)); return true; } const char* CCTexture2D::description(void) { return CCString::createWithFormat("<CCTexture2D | Name = %u | Dimensions = %u x %u | Coordinates = (%.2f, %.2f)>", m_uName, m_uPixelsWide, m_uPixelsHigh, m_fMaxS, m_fMaxT)->getCString(); } // implementation CCTexture2D (Image) bool CCTexture2D::initWithImage(CCImage *uiImage) { if (uiImage == NULL) { CCLOG("cocos2d: CCTexture2D. Can't create Texture. UIImage is nil"); this->release(); return false; } unsigned int imageWidth = uiImage->getWidth(); unsigned int imageHeight = uiImage->getHeight(); CCConfiguration *conf = CCConfiguration::sharedConfiguration(); unsigned maxTextureSize = conf->getMaxTextureSize(); if (imageWidth > maxTextureSize || imageHeight > maxTextureSize) { CCLOG("cocos2d: WARNING: Image (%u x %u) is bigger than the supported %u x %u", imageWidth, imageHeight, maxTextureSize, maxTextureSize); this->release(); return NULL; } // always load premultiplied images return initPremultipliedATextureWithImage(uiImage, imageWidth, imageHeight); } bool CCTexture2D::initPremultipliedATextureWithImage(CCImage *image, unsigned int width, unsigned int height) { unsigned char* tempData = image->getData(); unsigned int* inPixel32 = NULL; unsigned char* inPixel8 = NULL; unsigned short* outPixel16 = NULL; bool hasAlpha = image->hasAlpha(); CCSize imageSize = CCSizeMake((float)(image->getWidth()), (float)(image->getHeight())); CCTexture2DPixelFormat pixelFormat; size_t bpp = image->getBitsPerComponent(); // compute pixel format if(hasAlpha) { pixelFormat = g_defaultAlphaPixelFormat; } else { if (bpp >= 8) { pixelFormat = kCCTexture2DPixelFormat_RGB888; } else { pixelFormat = kCCTexture2DPixelFormat_RGB565; } } // Repack the pixel data into the right format unsigned int length = width * height; if (pixelFormat == kCCTexture2DPixelFormat_RGB565) { if (hasAlpha) { // Convert "RRRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA" to "RRRRRGGGGGGBBBBB" tempData = new unsigned char[width * height * 2]; outPixel16 = (unsigned short*)tempData; inPixel32 = (unsigned int*)image->getData(); for(unsigned int i = 0; i < length; ++i, ++inPixel32) { *outPixel16++ = ((((*inPixel32 >> 0) & 0xFF) >> 3) << 11) | // R ((((*inPixel32 >> 8) & 0xFF) >> 2) << 5) | // G ((((*inPixel32 >> 16) & 0xFF) >> 3) << 0); // B } } else { // Convert "RRRRRRRRRGGGGGGGGBBBBBBBB" to "RRRRRGGGGGGBBBBB" tempData = new unsigned char[width * height * 2]; outPixel16 = (unsigned short*)tempData; inPixel8 = (unsigned char*)image->getData(); for(unsigned int i = 0; i < length; ++i) { *outPixel16++ = (((*inPixel8++ & 0xFF) >> 3) << 11) | // R (((*inPixel8++ & 0xFF) >> 2) << 5) | // G (((*inPixel8++ & 0xFF) >> 3) << 0); // B } } } else if (pixelFormat == kCCTexture2DPixelFormat_RGBA4444) { // Convert "RRRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA" to "RRRRGGGGBBBBAAAA" inPixel32 = (unsigned int*)image->getData(); tempData = new unsigned char[width * height * 2]; outPixel16 = (unsigned short*)tempData; for(unsigned int i = 0; i < length; ++i, ++inPixel32) { *outPixel16++ = ((((*inPixel32 >> 0) & 0xFF) >> 4) << 12) | // R ((((*inPixel32 >> 8) & 0xFF) >> 4) << 8) | // G ((((*inPixel32 >> 16) & 0xFF) >> 4) << 4) | // B ((((*inPixel32 >> 24) & 0xFF) >> 4) << 0); // A } } else if (pixelFormat == kCCTexture2DPixelFormat_RGB5A1) { // Convert "RRRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA" to "RRRRRGGGGGBBBBBA" inPixel32 = (unsigned int*)image->getData(); tempData = new unsigned char[width * height * 2]; outPixel16 = (unsigned short*)tempData; for(unsigned int i = 0; i < length; ++i, ++inPixel32) { *outPixel16++ = ((((*inPixel32 >> 0) & 0xFF) >> 3) << 11) | // R ((((*inPixel32 >> 8) & 0xFF) >> 3) << 6) | // G ((((*inPixel32 >> 16) & 0xFF) >> 3) << 1) | // B ((((*inPixel32 >> 24) & 0xFF) >> 7) << 0); // A } } else if (pixelFormat == kCCTexture2DPixelFormat_A8) { // Convert "RRRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA" to "AAAAAAAA" inPixel32 = (unsigned int*)image->getData(); tempData = new unsigned char[width * height]; unsigned char *outPixel8 = tempData; for(unsigned int i = 0; i < length; ++i, ++inPixel32) { *outPixel8++ = (*inPixel32 >> 24) & 0xFF; // A } } if (hasAlpha && pixelFormat == kCCTexture2DPixelFormat_RGB888) { // Convert "RRRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA" to "RRRRRRRRGGGGGGGGBBBBBBBB" inPixel32 = (unsigned int*)image->getData(); tempData = new unsigned char[width * height * 3]; unsigned char *outPixel8 = tempData; for(unsigned int i = 0; i < length; ++i, ++inPixel32) { *outPixel8++ = (*inPixel32 >> 0) & 0xFF; // R *outPixel8++ = (*inPixel32 >> 8) & 0xFF; // G *outPixel8++ = (*inPixel32 >> 16) & 0xFF; // B } } initWithData(tempData, pixelFormat, width, height, imageSize); if (tempData != image->getData()) { delete [] tempData; } m_bHasPremultipliedAlpha = image->isPremultipliedAlpha(); return true; } // implementation CCTexture2D (Text) bool CCTexture2D::initWithString(const char *text, const char *fontName, float fontSize) { return initWithString(text, CCSizeMake(0,0), kCCTextAlignmentCenter, kCCVerticalTextAlignmentTop, fontName, fontSize); } bool CCTexture2D::initWithString(const char *text, const CCSize& dimensions, CCTextAlignment hAlignment, CCVerticalTextAlignment vAlignment, const char *fontName, float fontSize) { #if CC_ENABLE_CACHE_TEXTURE_DATA // cache the texture data VolatileTexture::addStringTexture(this, text, dimensions, hAlignment, vAlignment, fontName, fontSize); #endif CCImage image; CCImage::ETextAlign eAlign; if (kCCVerticalTextAlignmentTop == vAlignment) { eAlign = (kCCTextAlignmentCenter == hAlignment) ? CCImage::kAlignTop : (kCCTextAlignmentLeft == hAlignment) ? CCImage::kAlignTopLeft : CCImage::kAlignTopRight; } else if (kCCVerticalTextAlignmentCenter == vAlignment) { eAlign = (kCCTextAlignmentCenter == hAlignment) ? CCImage::kAlignCenter : (kCCTextAlignmentLeft == hAlignment) ? CCImage::kAlignLeft : CCImage::kAlignRight; } else if (kCCVerticalTextAlignmentBottom == vAlignment) { eAlign = (kCCTextAlignmentCenter == hAlignment) ? CCImage::kAlignBottom : (kCCTextAlignmentLeft == hAlignment) ? CCImage::kAlignBottomLeft : CCImage::kAlignBottomRight; } else { CCAssert(false, "Not supported alignment format!"); } if (!image.initWithString(text, (int)dimensions.width, (int)dimensions.height, eAlign, fontName, (int)fontSize)) { return false; } return initWithImage(&image); } // implementation CCTexture2D (Drawing) void CCTexture2D::drawAtPoint(const CCPoint& point) { GLfloat coordinates[] = { 0.0f, m_fMaxT, m_fMaxS,m_fMaxT, 0.0f, 0.0f, m_fMaxS,0.0f }; GLfloat width = (GLfloat)m_uPixelsWide * m_fMaxS, height = (GLfloat)m_uPixelsHigh * m_fMaxT; GLfloat vertices[] = { point.x, point.y, width + point.x, point.y, point.x, height + point.y, width + point.x, height + point.y }; ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position | kCCVertexAttribFlag_TexCoords ); m_pShaderProgram->use(); m_pShaderProgram->setUniformForModelViewProjectionMatrix(); ccGLBindTexture2D( m_uName ); glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices); glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, coordinates); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); } void CCTexture2D::drawInRect(const CCRect& rect) { GLfloat coordinates[] = { 0.0f, m_fMaxT, m_fMaxS,m_fMaxT, 0.0f, 0.0f, m_fMaxS,0.0f }; GLfloat vertices[] = { rect.origin.x, rect.origin.y, /*0.0f,*/ rect.origin.x + rect.size.width, rect.origin.y, /*0.0f,*/ rect.origin.x, rect.origin.y + rect.size.height, /*0.0f,*/ rect.origin.x + rect.size.width, rect.origin.y + rect.size.height, /*0.0f*/ }; ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position | kCCVertexAttribFlag_TexCoords ); m_pShaderProgram->use(); m_pShaderProgram->setUniformForModelViewProjectionMatrix(); ccGLBindTexture2D( m_uName ); glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices); glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, coordinates); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); } #ifdef CC_SUPPORT_PVRTC // implementation CCTexture2D (PVRTC); bool CCTexture2D::initWithPVRTCData(const void *data, int level, int bpp, bool hasAlpha, int length, CCTexture2DPixelFormat pixelFormat) { if( !(CCConfiguration::sharedConfiguration()->supportsPVRTC()) ) { CCLOG("cocos2d: WARNING: PVRTC images is not supported."); this->release(); return false; } glGenTextures(1, &m_uName); glBindTexture(GL_TEXTURE_2D, m_uName); this->setAntiAliasTexParameters(); GLenum format; GLsizei size = length * length * bpp / 8; if(hasAlpha) { format = (bpp == 4) ? GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG : GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; } else { format = (bpp == 4) ? GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG : GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; } if(size < 32) { size = 32; } glCompressedTexImage2D(GL_TEXTURE_2D, level, format, length, length, 0, size, data); m_tContentSize = CCSizeMake((float)(length), (float)(length)); m_uPixelsWide = length; m_uPixelsHigh = length; m_fMaxS = 1.0f; m_fMaxT = 1.0f; m_bHasPremultipliedAlpha = PVRHaveAlphaPremultiplied_; m_ePixelFormat = pixelFormat; return true; } #endif // CC_SUPPORT_PVRTC bool CCTexture2D::initWithPVRFile(const char* file) { bool bRet = false; // nothing to do with CCObject::init CCTexturePVR *pvr = new CCTexturePVR; bRet = pvr->initWithContentsOfFile(file); if (bRet) { pvr->setRetainName(true); // don't dealloc texture on release m_uName = pvr->getName(); m_fMaxS = 1.0f; m_fMaxT = 1.0f; m_uPixelsWide = pvr->getWidth(); m_uPixelsHigh = pvr->getHeight(); m_tContentSize = CCSizeMake((float)m_uPixelsWide, (float)m_uPixelsHigh); m_bHasPremultipliedAlpha = PVRHaveAlphaPremultiplied_; m_ePixelFormat = pvr->getFormat(); m_bHasMipmaps = pvr->getNumberOfMipmaps() > 1; pvr->release(); } else { CCLOG("cocos2d: Couldn't load PVR image %s", file); } return bRet; } void CCTexture2D::PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied) { PVRHaveAlphaPremultiplied_ = haveAlphaPremultiplied; } // // Use to apply MIN/MAG filter // // implementation CCTexture2D (GLFilter) void CCTexture2D::generateMipmap() { CCAssert( m_uPixelsWide == ccNextPOT(m_uPixelsWide) && m_uPixelsHigh == ccNextPOT(m_uPixelsHigh), "Mipmap texture only works in POT textures"); ccGLBindTexture2D( m_uName ); glGenerateMipmap(GL_TEXTURE_2D); m_bHasMipmaps = true; } bool CCTexture2D::hasMipmaps() { return m_bHasMipmaps; } void CCTexture2D::setTexParameters(ccTexParams *texParams) { CCAssert( (m_uPixelsWide == ccNextPOT(m_uPixelsWide) || texParams->wrapS == GL_CLAMP_TO_EDGE) && (m_uPixelsHigh == ccNextPOT(m_uPixelsHigh) || texParams->wrapT == GL_CLAMP_TO_EDGE), "GL_CLAMP_TO_EDGE should be used in NPOT dimensions"); ccGLBindTexture2D( m_uName ); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, texParams->minFilter ); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, texParams->magFilter ); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, texParams->wrapS ); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, texParams->wrapT ); #if CC_ENABLE_CACHE_TEXTURE_DATA VolatileTexture::setTexParameters(this, texParams); #endif } void CCTexture2D::setAliasTexParameters() { ccGLBindTexture2D( m_uName ); if( ! m_bHasMipmaps ) { glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); } else { glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST ); } glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); #if CC_ENABLE_CACHE_TEXTURE_DATA ccTexParams texParams = {m_bHasMipmaps?GL_NEAREST_MIPMAP_NEAREST:GL_NEAREST,GL_NEAREST,GL_NONE,GL_NONE}; VolatileTexture::setTexParameters(this, &texParams); #endif } void CCTexture2D::setAntiAliasTexParameters() { ccGLBindTexture2D( m_uName ); if( ! m_bHasMipmaps ) { glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); } else { glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST ); } glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); #if CC_ENABLE_CACHE_TEXTURE_DATA ccTexParams texParams = {m_bHasMipmaps?GL_LINEAR_MIPMAP_NEAREST:GL_LINEAR,GL_LINEAR,GL_NONE,GL_NONE}; VolatileTexture::setTexParameters(this, &texParams); #endif } const char* CCTexture2D::stringForFormat() { switch (m_ePixelFormat) { case kCCTexture2DPixelFormat_RGBA8888: return "RGBA8888"; case kCCTexture2DPixelFormat_RGB888: return "RGB888"; case kCCTexture2DPixelFormat_RGB565: return "RGB565"; case kCCTexture2DPixelFormat_RGBA4444: return "RGBA4444"; case kCCTexture2DPixelFormat_RGB5A1: return "RGB5A1"; case kCCTexture2DPixelFormat_AI88: return "AI88"; case kCCTexture2DPixelFormat_A8: return "A8"; case kCCTexture2DPixelFormat_I8: return "I8"; case kCCTexture2DPixelFormat_PVRTC4: return "PVRTC4"; case kCCTexture2DPixelFormat_PVRTC2: return "PVRTC2"; default: CCAssert(false , "unrecognized pixel format"); CCLOG("stringForFormat: %ld, cannot give useful result", (long)m_ePixelFormat); break; } return NULL; } // // Texture options for images that contains alpha // // implementation CCTexture2D (PixelFormat) void CCTexture2D::setDefaultAlphaPixelFormat(CCTexture2DPixelFormat format) { g_defaultAlphaPixelFormat = format; } CCTexture2DPixelFormat CCTexture2D::defaultAlphaPixelFormat() { return g_defaultAlphaPixelFormat; } unsigned int CCTexture2D::bitsPerPixelForFormat(CCTexture2DPixelFormat format) { unsigned int ret=0; switch (format) { case kCCTexture2DPixelFormat_RGBA8888: ret = 32; break; case kCCTexture2DPixelFormat_RGB888: // It is 32 and not 24, since its internal representation uses 32 bits. ret = 32; break; case kCCTexture2DPixelFormat_RGB565: ret = 16; break; case kCCTexture2DPixelFormat_RGBA4444: ret = 16; break; case kCCTexture2DPixelFormat_RGB5A1: ret = 16; break; case kCCTexture2DPixelFormat_AI88: ret = 16; break; case kCCTexture2DPixelFormat_A8: ret = 8; break; case kCCTexture2DPixelFormat_I8: ret = 8; break; case kCCTexture2DPixelFormat_PVRTC4: ret = 4; break; case kCCTexture2DPixelFormat_PVRTC2: ret = 2; break; default: ret = -1; CCAssert(false , "unrecognized pixel format"); CCLOG("bitsPerPixelForFormat: %ld, cannot give useful result", (long)format); break; } return ret; } unsigned int CCTexture2D::bitsPerPixelForFormat() { return this->bitsPerPixelForFormat(m_ePixelFormat); } NS_CC_END
{ "pile_set_name": "Github" }
"*": "atom-ternjs": useSnippets: true "autocomplete-modules": vendors: [ "node_modules" "src" ] build: saveOnBuild: true core: disabledPackages: [ "linter-flow-plus" "autocomplete-flow" "linter-flow" "atom-ternjs" "linter-checkstyle" ] packagesWithKeymapsDisabled: [ "git-blame" ] projectHome: "/Users/colbywilliams/projects" telemetryConsent: "limited" themes: [ "one-light-ui" "solarized-light-syntax" ] editor: invisibles: {} preferredLineLength: 100 scrollPastEnd: true "exception-reporting": userId: "a58af052-dcc6-4331-81cb-59b673e99ccc" fonts: {} gist: tokenFile: "~/.atom/gist-it.token" "gist-it": openAfterCreate: true "git-blame": columnWidth: 556 showOnlyLastNames: false "git-diff": {} "language-babel": {} linter: {} "linter-eslint": disableEslintIgnore: true fixOnSave: true globalNodePath: "/usr/local" "linter-ui-default": panelHeight: 143 tooltipFollows: "Keyboard" "merge-conflicts": gitPath: "/usr/local/bin/git" "one-dark-ui": {} "one-light-ui": {} pigments: autocompleteScopes: [ ".source.scss" ] extendAutocompleteToColorValue: true extendAutocompleteToVariables: true ignoreVcsIgnoredPaths: false ignoredNames: [ "src/node_modules/*" "node_modules/*" "public/*" "src/pre-atlas/**/*" ] sourceNames: [ "**/*.scss" ] "sync-settings": _analyticsUserId: "971b17cd-cd84-406f-aa72-4dd819000ce2" "tree-view": squashDirectoryNames: true "vim-mode": useSmartcaseForSearch: true "vim-mode-plus": {} "vim-surround": {} welcome: showOnStartup: false ".attribute-values.js.jsx.source": editor: preferredLineLength: 100 ".babel.regexp.source": editor: preferredLineLength: 100 ".dustjs.html.text": editor: preferredLineLength: 100 ".ini.source": editor: scrollPastEnd: true showIndentGuide: true showInvisibles: true ".js.jsx.react.source": editor: preferredLineLength: 100 ".js.jsx.source": editor: preferredLineLength: 100 ".js.source.subtlegradient": editor: preferredLineLength: 100
{ "pile_set_name": "Github" }
// check-pass trait Mirror { type It; } impl<T> Mirror for T { type It = Self; } fn main() { let c: <u32 as Mirror>::It = 5; const CCCC: <u32 as Mirror>::It = 5; }
{ "pile_set_name": "Github" }
/* Copyright 2006 by Sean Luke and George Mason University Licensed under the Academic Free License version 3.0 See the file "LICENSE" for more information */ package sim.util.media.chart; import sim.util.IntBag; /** * * This is meant to accomodate an on-line algorithm for keeping a constant number of data points * from an on-going time series. * * It only looks at the X values of the time series data points. * * Implementations can assume the X values come in in increasing order. * * * <p>Now if a series holds the data points in a Bag, removing data points * screws with the order, so the next time a data point needs to be * removed, its index will be compromized. * * The way this works is ... I get a bunch of X values and I return the indices of values that should be dropped. * It's then your job to delete the correct items and recompact the remaining data. * * * <p>Changing the API to include the actual data item, not just its x value * could be useful if one wants to choose based on similarity of Y values, not * just closeness of x values. Another example would be an implementation that averages data * (e.g. average 2 consecutive data points)! * * * <p>If a chart has multiple time series, does one cull each data series * separatelly? I.e. is this a chart global property or each series * has its own? * * I kinda expect that when multiple series reside in * the same chart, they're "synchronized" in the sense that they have * data points at the same moments in time. In this case, the cullers of * those series do the same work, so one should be enough. * * <br>The user is expected to add the series at the same time. I make no attempt to * detect if series in the same chart have the same set of x values. * * <br>The current implementation in TimeSeriesChartGenerator and the corresponding property inspector * uses a single DacaCuller for all series. In the future I guess I could give each series a clone of the * data culling algorithm, if it turns out that stateful algoriths are needed. * * * <p>In order to improve the amortized time complexity, more than 1 data point * should be culled at a time. E.g. as soon as you get 200 points, drop 100. * * After each such operation there's a linear time * data shifting, so it pays off to delete multiple points at a time. * It also helps with the stuff during the operation, since one does not have to * scan starting from the beginning for each data point to be deleted. * * Heaps might be helpful while deciding which points to drop. The recompacting is still linear, * but it should be very fast. * * @author Gabriel Balan */ public interface DataCuller { public boolean tooManyPoints(int currentPointCount); public IntBag cull(double[] xValues, boolean sortOutput); }
{ "pile_set_name": "Github" }
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ var gTestfile = 'regress-365869.js'; //----------------------------------------------------------------------------- var BUGNUMBER = 365869; var summary = 'strict warning for object literal with duplicate propery names'; var actual = ''; var expect = ''; //----------------------------------------------------------------------------- test(); //----------------------------------------------------------------------------- function test() { enterFunc ('test'); printBugNumber(BUGNUMBER); printStatus (summary); if (!options().match(/strict/)) { options('strict'); } if (!options().match(/werror/)) { options('werror'); } try { expect = 'TypeError: redeclaration of property a'; var o = {a:4, a:5}; // syntax warning, need to eval to catch actual = 'No warning'; } catch(ex) { actual = ex + ''; print(ex); } reportCompare(expect, actual, summary); print('test crash from bug 371292 Comment 3'); try { expect = 'TypeError: redeclaration of property 1'; var o1 = {1:1, 1:2}; // syntax warning, need to eval to catch actual = 'No warning'; } catch(ex) { actual = ex + ''; print(ex); } reportCompare(expect, actual, summary); print('test crash from bug 371292 Comment 9'); try { expect = 'TypeError: redeclaration of const 5'; "012345".__defineSetter__(5, function(){}); } catch(ex) { actual = ex + ''; print(ex); } reportCompare(expect, actual, summary); exitFunc ('test'); }
{ "pile_set_name": "Github" }
/* * eXist-db Open Source Native XML Database * Copyright (C) 2001 The eXist-db Authors * * info@exist-db.org * http://www.exist-db.org * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package org.exist.source; import java.io.IOException; import java.io.Reader; import java.io.InputStream; import java.nio.charset.Charset; import org.exist.dom.QName; import org.exist.security.PermissionDeniedException; import org.exist.security.Subject; import org.exist.storage.DBBroker; import javax.annotation.Nullable; /** * A general interface for access to external or internal sources. * This is mainly used as an abstraction for loading XQuery scripts * and modules, but can also be applied to other use cases. * * @author wolf */ public interface Source { enum Validity { VALID, INVALID, UNKNOWN } String path(); String type(); /** * Returns a unique key to identify the source, usually * an URI. * @return unique key to identify the source, usually an URI */ Object getKey(); /** * Is this source object still valid? * * Returns {@link Validity#UNKNOWN} if the validity of * the source cannot be determined. * * The {@link DBBroker} parameter is required by * some implementations as they have to read * resources from the database. * * @param broker eXist-db broker * @return Validity of the source object */ Validity isValid(DBBroker broker); /** * Checks if the source object is still valid * by comparing it to another version of the * same source. It depends on the concrete * implementation how the sources are compared. * * Use this method if {@link #isValid(DBBroker)} * return {@link Validity#UNKNOWN}. * * @param other source * @return Validity of the other source object */ Validity isValid(Source other); /** * Returns a {@link Reader} to read the contents * of the source. * @return Reader to read the contents of the source * @throws IOException in case of an I/O error */ Reader getReader() throws IOException; InputStream getInputStream() throws IOException; String getContent() throws IOException; /** * Returns the character encoding of the underlying source or null if unknown. * * @return the character encoding * @throws IOException in case of an I/O error */ @Nullable Charset getEncoding() throws IOException; /** * Set a timestamp for this source. This is used * by {@link org.exist.storage.XQueryPool} to * check if a source has timed out. * * @param timestamp for the source */ void setCacheTimestamp(long timestamp); long getCacheTimestamp(); /** * Check: has subject requested permissions for this resource? * * @param subject The subject * @param perm The requested permissions * @throws PermissionDeniedException if user has not sufficient rights */ void validate(Subject subject, int perm) throws PermissionDeniedException; QName isModule() throws IOException; }
{ "pile_set_name": "Github" }
/**** Base stylesheet used for printing, to which height, with and label parameters had to be added as CutyCapt does not allow to use @import directive *******/ /* ------ Hide non printable elements ------ */ body div.scheduling-graphics { height: 0 !important; display: none !important; } body .perspectives-column { display: none !important; } body .mainmenu, body .user-area, body .help-link { display: none !important; } body .footer { display: none !important; } body .footer-print { display: inline !important; } /* ------ Remove scrolls ------ */ .leftpanelcontainer { overflow: hidden !important; } .rightpanel-layout .z-center-body { overflow: hidden !important; } #ganttpanel_scroller_x, #ganttpanel_scroller_y { overflow: hidden !important; } .main-area, .orderslayout-area, .orderelements-tab, #timetrackedtable, .plannerlayout .taskspanel-gap #timetracker, .leftpanelcontainer { overflow: hidden !important; } /* ------ Reposition main-area ------ */ body .main-area { margin-left: 0; margin-top: -31px; } /* ------ Hide possible Javascript execution exceptions ------ */ #zk_err_1 { display: none; } td.migas_linea { padding-top:25px; } .border-container .taskgroup_start, .border-container .taskgroup_end { repeat-y: none; } #listtasks .milestone_end { repeat-y: none; } .main-area .taskdetailsContainer, .leftpanelgap .z-tree-body { overflow-x: hidden !important; } .z-south-colpsd { display:none; } .z-center > div, .taskpanel > div { overflow: hidden !important; } .logo-area { height: 70px; } .listdetails input.task_title { width: 100% !important; } .migas_linea span.scheduling-state { display: none; } /* ------ Calculated body width and height added via CutyPrint CSS generator ------ */
{ "pile_set_name": "Github" }
### Algorithm 1. Create a class variable called `int[] sum`. 1. Let `sum[i]` represent the sum from `num[0]` to `num[i]` inclusive. 1. To calculate `sumRange(int i, int j)`, just return `sum[j] - sum[i - 1]` - if `i == 0`, treat that as a special case ### Solution ```java class NumArray { private int[] sum; public NumArray(int[] nums) { if (nums == null || nums.length == 0) { return; } sum = new int[nums.length]; sum[0] = nums[0]; for (int i = 1; i < nums.length; i++) { sum[i] = sum[i - 1] + nums[i]; } } public int sumRange(int i, int j) { // assumes 0 <= i <= j, and 'int[] sum' is not empty if (i == 0) { return sum[j]; } else { return sum[j] - sum[i - 1]; } } } ``` ### Time/Space Complexity - Time Complexity: O(n) to pre-compute. O(1) for `sumRange()` calls after precomputation. - Space Complexity: O(n) ### Links - [github.com/RodneyShag](https://github.com/RodneyShag)
{ "pile_set_name": "Github" }
/** * @author zz85 / http://www.lab4games.net/zz85/blog * * Two pass Gaussian blur filter (horizontal and vertical blur shaders) * - described in http://www.gamerendering.com/2008/10/11/gaussian-blur-filter-shader/ * and used in http://www.cake23.de/traveling-wavefronts-lit-up.html * * - 9 samples per pass * - standard deviation 2.7 * - "h" and "v" parameters should be set to "1 / width" and "1 / height" */ THREE.VerticalBlurShader = { uniforms: { "tDiffuse": { value: null }, "v": { value: 1.0 / 512.0 } }, vertexShader: [ "varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}" ].join( "\n" ), fragmentShader: [ "uniform sampler2D tDiffuse;", "uniform float v;", "varying vec2 vUv;", "void main() {", "vec4 sum = vec4( 0.0 );", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;", "gl_FragColor = sum;", "}" ].join( "\n" ) };
{ "pile_set_name": "Github" }
$('<%= "##{dom_id(@membership)}_leader_true" %>').toggle(<%= (!@membership.leader?).inspect %>) $('<%= "##{dom_id(@membership)}_leader_false" %>').toggle(<%= @membership.leader?.inspect %>)
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 75e8d5b58df182c45aea4f16014e1601 ShaderImporter: externalObjects: {} defaultTextures: [] nonModifiableTextures: [] userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
//===- DynamicCastInfo.h - Runtime cast information -------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_DYNAMICCASTINFO_H #define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_DYNAMICCASTINFO_H #include "clang/AST/Type.h" namespace clang { namespace ento { class DynamicCastInfo { public: enum CastResult { Success, Failure }; DynamicCastInfo(QualType from, QualType to, CastResult resultKind) : From(from), To(to), ResultKind(resultKind) {} QualType from() const { return From; } QualType to() const { return To; } bool equals(QualType from, QualType to) const { return From == from && To == to; } bool succeeds() const { return ResultKind == CastResult::Success; } bool fails() const { return ResultKind == CastResult::Failure; } bool operator==(const DynamicCastInfo &RHS) const { return From == RHS.From && To == RHS.To; } bool operator<(const DynamicCastInfo &RHS) const { return From < RHS.From && To < RHS.To; } void Profile(llvm::FoldingSetNodeID &ID) const { ID.Add(From); ID.Add(To); ID.AddInteger(ResultKind); } private: QualType From, To; CastResult ResultKind; }; } // namespace ento } // namespace clang #endif // LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_DYNAMICCASTINFO_H
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="common_google_play_services_notification_ticker" msgid="1852570676146674985">"Google Play Services-ის შეცდომა"</string> <string name="common_google_play_services_notification_needs_update_title" msgid="1388129345631079938">"აპლიკაცია საჭიროებს Google Play Services-ის განახლებას."</string> <string name="common_android_wear_notification_needs_update_text" msgid="6428604800157361567">"<xliff:g id="APP_NAME">%1$s</xliff:g> საჭიროებს Android Wear აპის განახლებას."</string> <string name="common_google_play_services_needs_enabling_title" msgid="2583358409598976717">"აპლიკაცია საჭიროებს გააქტიურებულ Google Play Services."</string> <string name="common_google_play_services_error_notification_requested_by_msg" msgid="2443362625939284971">"მომთხოვნი: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play სერვისების მიღება"</string> <string name="common_google_play_services_install_text_phone" msgid="8836325110837822534">"<xliff:g id="APP_NAME">%1$s</xliff:g> ვერ გაეშვება Google Play სერვისების გარეშე, რაც თქვენს ტელეფონზე ვერ იძებნება."</string> <string name="common_google_play_services_install_text_tablet" msgid="542176290824754127">"<xliff:g id="APP_NAME">%1$s</xliff:g> ვერ გაეშვება Google Play სერვისების გარეშე, რაც თქვენს ტაბლეტზე ვერ იძებნება."</string> <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Google Play სერვისების მიღება"</string> <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play სერვისების გააქტიურება"</string> <string name="common_google_play_services_enable_text" msgid="4896236883690196080">"<xliff:g id="APP_NAME">%1$s</xliff:g> არ იმუშავებს, თუ არ გაააქტიურებთ Google Play სერვისებს."</string> <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Google Play სერვისების გააქტიურება"</string> <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play სერვისების განახლება"</string> <string name="common_android_wear_update_title" msgid="1366439133145190222">"Android Wear-ის განახლება"</string> <string name="common_google_play_services_update_text" msgid="5709479369299147668">"<xliff:g id="APP_NAME">%1$s</xliff:g> ვერ გაეშვება, თუ Google Play სერვისებს არ განაახლებთ."</string> <string name="common_android_wear_update_text" msgid="2453027084525739603">"<xliff:g id="APP_NAME">%1$s</xliff:g> ვერ გაეშვება, ვიდრე Android Wear აპს არ განაახლებთ."</string> <string name="common_google_play_services_updating_title" msgid="815008177440683245">"ხდება Google Play სერვისების განახლება."</string> <string name="common_google_play_services_updating_text" msgid="2201289642219771610">"<xliff:g id="APP_NAME">%1$s</xliff:g> ვერ გაეშვება Google Play სერვისების გარეშე, რომელთა განახლებაც ახლა მიმდინარეობს."</string> <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"ქსელის შეცდომა"</string> <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Google Play Services-თან დასაკავშირებლად მონაცემთა გადაცემა აუცილებელია."</string> <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"ანგარიში არასწორია"</string> <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"მითითებული ანგარიში ამ მოწყობილობაზე არ არსებობს. გთხოვთ, აირჩიოთ სხვა ანგარიში."</string> <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play სერვისებთან დაკავშირებით უცნობი შეფერხება წარმოიშვა."</string> <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play სერვისები"</string> <string name="common_google_play_services_unsupported_text" msgid="7682982632307307938">"<xliff:g id="APP_NAME">%1$s</xliff:g> ეყრდნობა Google Play სერვისებს, რომლებიც თქვენს მოწყობილობაზე მხარდაჭერილი არ არის. გთხოვთ, დაუკავშირდეთ მწარმოებელს დახმარებისათვის."</string> <string name="common_google_play_services_update_button" msgid="8932944190611227642">"განახლება"</string> <string name="common_signin_button_text" msgid="9071884888741449141">"შესვლა"</string> <string name="common_signin_button_text_long" msgid="2429381841831957106">"Google-ით შესვლა"</string> <string name="common_open_on_phone" msgid="411506735369601515">"ტელეფონზე გახსნა"</string> <string name="common_google_play_services_api_unavailable_text" msgid="6534628256897874213">"<xliff:g id="APP_NAME">%1$s</xliff:g> ითხოვს ერთ ან მეტ Google Play სერვისს, რომელიც ამჟამად არ არის ხელმისაწვდომი. გთხოვთ, დახმარებისთვის დაუკავშირდეთ დეველოპერს."</string> <string name="common_google_play_services_sign_in_failed_title" msgid="8164948898147532159">"შესვლის შეცდომა"</string> <string name="common_google_play_services_sign_in_failed_text" msgid="5194079840165204725">"მითითებულ ანგარიშზე შესვლის შეცდომა. გთხოვთ აირჩიოთ სხვა ანგარიში."</string> </resources>
{ "pile_set_name": "Github" }
/* xxHash - Fast Hash algorithm Header File Copyright (C) 2012-2014, Yann Collet. BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. You can contact the author at : - xxHash source repository : http://code.google.com/p/xxhash/ */ /* Notice extracted from xxHash homepage : xxHash is an extremely fast Hash algorithm, running at RAM speed limits. It also successfully passes all tests from the SMHasher suite. Comparison (single thread, Windows Seven 32 bits, using SMHasher on a Core 2 Duo @3GHz) Name Speed Q.Score Author xxHash 5.4 GB/s 10 CrapWow 3.2 GB/s 2 Andrew MumurHash 3a 2.7 GB/s 10 Austin Appleby SpookyHash 2.0 GB/s 10 Bob Jenkins SBox 1.4 GB/s 9 Bret Mulvey Lookup3 1.2 GB/s 9 Bob Jenkins SuperFastHash 1.2 GB/s 1 Paul Hsieh CityHash64 1.05 GB/s 10 Pike & Alakuijala FNV 0.55 GB/s 5 Fowler, Noll, Vo CRC32 0.43 GB/s 9 MD5-32 0.33 GB/s 10 Ronald L. Rivest SHA1-32 0.28 GB/s 10 Q.Score is a measure of quality of the hash function. It depends on successfully passing SMHasher test set. 10 is a perfect score. */ #pragma once #if defined (__cplusplus) namespace rocksdb { #endif //**************************** // Type //**************************** typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode; //**************************** // Simple Hash Functions //**************************** unsigned int XXH32 (const void* input, int len, unsigned int seed); /* XXH32() : Calculate the 32-bits hash of sequence of length "len" stored at memory address "input". The memory between input & input+len must be valid (allocated and read-accessible). "seed" can be used to alter the result predictably. This function successfully passes all SMHasher tests. Speed on Core 2 Duo @ 3 GHz (single thread, SMHasher benchmark) : 5.4 GB/s Note that "len" is type "int", which means it is limited to 2^31-1. If your data is larger, use the advanced functions below. */ //**************************** // Advanced Hash Functions //**************************** void* XXH32_init (unsigned int seed); XXH_errorcode XXH32_update (void* state, const void* input, int len); unsigned int XXH32_digest (void* state); /* These functions calculate the xxhash of an input provided in several small packets, as opposed to an input provided as a single block. It must be started with : void* XXH32_init() The function returns a pointer which holds the state of calculation. This pointer must be provided as "void* state" parameter for XXH32_update(). XXH32_update() can be called as many times as necessary. The user must provide a valid (allocated) input. The function returns an error code, with 0 meaning OK, and any other value meaning there is an error. Note that "len" is type "int", which means it is limited to 2^31-1. If your data is larger, it is recommended to chunk your data into blocks of size for example 2^30 (1GB) to avoid any "int" overflow issue. Finally, you can end the calculation anytime, by using XXH32_digest(). This function returns the final 32-bits hash. You must provide the same "void* state" parameter created by XXH32_init(). Memory will be freed by XXH32_digest(). */ int XXH32_sizeofState(); XXH_errorcode XXH32_resetState(void* state, unsigned int seed); #define XXH32_SIZEOFSTATE 48 typedef struct { long long ll[(XXH32_SIZEOFSTATE+(sizeof(long long)-1))/sizeof(long long)]; } XXH32_stateSpace_t; /* These functions allow user application to make its own allocation for state. XXH32_sizeofState() is used to know how much space must be allocated for the xxHash 32-bits state. Note that the state must be aligned to access 'long long' fields. Memory must be allocated and referenced by a pointer. This pointer must then be provided as 'state' into XXH32_resetState(), which initializes the state. For static allocation purposes (such as allocation on stack, or freestanding systems without malloc()), use the structure XXH32_stateSpace_t, which will ensure that memory space is large enough and correctly aligned to access 'long long' fields. */ unsigned int XXH32_intermediateDigest (void* state); /* This function does the same as XXH32_digest(), generating a 32-bit hash, but preserve memory context. This way, it becomes possible to generate intermediate hashes, and then continue feeding data with XXH32_update(). To free memory context, use XXH32_digest(), or free(). */ //**************************** // Deprecated function names //**************************** // The following translations are provided to ease code transition // You are encouraged to no longer this function names #define XXH32_feed XXH32_update #define XXH32_result XXH32_digest #define XXH32_getIntermediateResult XXH32_intermediateDigest #if defined (__cplusplus) } // namespace rocksdb #endif
{ "pile_set_name": "Github" }
pre.idle .InheritedClass { } pre.idle .TypeName { color: #21439C; } pre.idle .Number { } pre.idle .LibraryVariable { color: #A535AE; } pre.idle .Storage { color: #FF5600; } pre.idle .line-numbers { background-color: #BAD6FD; color: #000000; } pre.idle { background-color: #FFFFFF; color: #000000; } pre.idle .StringInterpolation { color: #990000; } pre.idle .TagName { } pre.idle .LibraryConstant { color: #A535AE; } pre.idle .FunctionArgument { } pre.idle .BuiltInConstant { color: #A535AE; } pre.idle .Invalid { background-color: #990000; color: #FFFFFF; } pre.idle .LibraryClassType { color: #A535AE; } pre.idle .LibraryFunction { color: #A535AE; } pre.idle .TagAttribute { } pre.idle .Keyword { color: #FF5600; } pre.idle .UserDefinedConstant { } pre.idle .String { color: #00A33F; } pre.idle .FunctionName { color: #21439C; } pre.idle .Variable { } pre.idle .Comment { color: #919191; }
{ "pile_set_name": "Github" }
package com.tencent.mm.plugin.gallery.ui; import android.app.ProgressDialog; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; import android.content.Intent; import android.content.ServiceConnection; import android.content.SharedPreferences; import android.net.Uri; import android.os.Bundle; import android.os.IBinder; import android.os.Process; import android.os.RemoteException; import android.view.KeyEvent; import android.view.MenuItem; import android.view.MenuItem.OnMenuItemClickListener; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import android.view.animation.AnimationUtils; import android.widget.AbsListView; import android.widget.AbsListView.OnScrollListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.GridView; import android.widget.ImageButton; import android.widget.TextView; import android.widget.Toast; import com.tencent.map.geolocation.TencentLocationUtils; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.R; import com.tencent.mm.api.s; import com.tencent.mm.bp.d; import com.tencent.mm.compatible.e.q; import com.tencent.mm.hardcoder.WXHardCoderJNI; import com.tencent.mm.plugin.gallery.model.GalleryItem.AlbumItem; import com.tencent.mm.plugin.gallery.model.GalleryItem.MediaItem; import com.tencent.mm.plugin.gallery.model.GalleryItem.VideoMediaItem; import com.tencent.mm.plugin.gallery.model.e; import com.tencent.mm.plugin.gallery.model.i.b; import com.tencent.mm.plugin.gallery.model.i.c; import com.tencent.mm.plugin.gallery.model.l; import com.tencent.mm.plugin.gallery.stub.GalleryStubService; import com.tencent.mm.plugin.mmsight.SightCaptureResult; import com.tencent.mm.plugin.mmsight.SightParams; import com.tencent.mm.plugin.sight.base.SightVideoJNI; import com.tencent.mm.plugin.webview.ui.tools.widget.o; import com.tencent.mm.pluginsdk.ui.tools.n; import com.tencent.mm.sdk.platformtools.ab; import com.tencent.mm.sdk.platformtools.bo; import com.tencent.mm.sdk.platformtools.r; import com.tencent.mm.ui.MMActivity; import com.tencent.mm.ui.base.DrawedCallBackFrameLayout; import com.tencent.mm.ui.base.h; import com.tencent.ttpic.baseutils.FileUtils; import com.tencent.ttpic.thread.FaceGestureDetGLThread; import java.io.File; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import org.json.JSONObject; @com.tencent.mm.ui.base.a(19) public class AlbumPreviewUI extends MMActivity implements c { static long start = 0; private String cEV; private ProgressDialog ehJ; private int ehv; private int gLP; private ServiceConnection ktl = new ServiceConnection() { public final void onServiceConnected(ComponentName componentName, IBinder iBinder) { AppMethodBeat.i(21386); ab.i("MicroMsg.AlbumPreviewUI", "onServiceConnected"); AlbumPreviewUI.this.mOG = com.tencent.mm.plugin.gallery.stub.a.a.B(iBinder); if (AlbumPreviewUI.this.mPj != null) { AlbumPreviewUI.this.mPj.mOG = AlbumPreviewUI.this.mOG; } AppMethodBeat.o(21386); } public final void onServiceDisconnected(ComponentName componentName) { AppMethodBeat.i(21387); ab.i("MicroMsg.AlbumPreviewUI", "onServiceDisconnected"); AlbumPreviewUI.this.mOG = null; AppMethodBeat.o(21387); } }; private boolean kvs = false; private double latitude; private double longitude; private com.tencent.mm.plugin.gallery.stub.a mOG = null; private String mOL; private int mPA; private int mPB; boolean mPC = false; private int mPD = 0; private int mPE = 0; private long mPF = 0; private long mPG; private int mPH = -1; private String mPI; private b mPJ; private long mPK = -1; private com.tencent.mm.plugin.gallery.ui.a.a mPL = new com.tencent.mm.plugin.gallery.ui.a.a() { private OnClickListener mjE = new OnClickListener() { private void bCD() { AppMethodBeat.i(21400); String stringExtra = AlbumPreviewUI.this.getIntent().getStringExtra("to_user"); String stringExtra2 = AlbumPreviewUI.this.getIntent().getStringExtra("file_name"); String stringExtra3 = AlbumPreviewUI.this.getIntent().getStringExtra("video_path"); String stringExtra4 = AlbumPreviewUI.this.getIntent().getStringExtra("video_full_path"); String stringExtra5 = AlbumPreviewUI.this.getIntent().getStringExtra("video_thumb_path"); try { Intent intent = new Intent(); intent.setClassName(AlbumPreviewUI.this.mController.ylL.getPackageName(), "com.tencent.mm.plugin.sysvideo.ui.video.VideoRecorderUI"); intent.putExtra("VideoRecorder_ToUser", stringExtra); intent.putExtra("VideoRecorder_FileName", stringExtra2); intent.putExtra("VideoRecorder_VideoPath", stringExtra3); intent.putExtra("VideoRecorder_VideoFullPath", stringExtra4); intent.putExtra("VideoRecorder_VideoThumbPath", stringExtra5); ab.d("MicroMsg.AlbumPreviewUI", "try to record video, dump intent:\n%s", intent); AlbumPreviewUI.this.startActivityForResult(intent, 4371); AppMethodBeat.o(21400); } catch (Exception e) { ab.w("MicroMsg.AlbumPreviewUI", e.toString()); if (!(com.tencent.mm.r.a.bI(AlbumPreviewUI.this.mController.ylL) || com.tencent.mm.r.a.bH(AlbumPreviewUI.this.mController.ylL))) { com.tencent.mm.compatible.j.b.s(AlbumPreviewUI.this.mController.ylL); } AppMethodBeat.o(21400); } } public final void onClick(View view) { AppMethodBeat.i(21401); ab.d("MicroMsg.AlbumPreviewUI", "on click open camera, valid click times[%d]", Integer.valueOf(AlbumPreviewUI.this.mPD)); if (AlbumPreviewUI.this.mPz) { ab.w("MicroMsg.AlbumPreviewUI", "click open camera, but camera is opening"); AppMethodBeat.o(21401); return; } AlbumPreviewUI.K(AlbumPreviewUI.this); AlbumPreviewUI.this.mPz = true; if (e.bBZ().mOu != 2 && e.bBZ().hOZ != 13) { if (e.bBZ().mOu == 1 || e.bBZ().mOu == 3) { File file = new File(com.tencent.mm.compatible.util.e.euR); if (file.exists() || file.mkdir()) { ab.i("MicroMsg.AlbumPreviewUI", "summerper checkPermission checkCamera[%b], stack[%s], activity[%s]", Boolean.valueOf(com.tencent.mm.pluginsdk.permission.b.a(AlbumPreviewUI.this.mController.ylL, "android.permission.CAMERA", 16, "", "")), bo.dpG(), AlbumPreviewUI.this.mController.ylL); if (com.tencent.mm.pluginsdk.permission.b.a(AlbumPreviewUI.this.mController.ylL, "android.permission.CAMERA", 16, "", "")) { AlbumPreviewUI.M(AlbumPreviewUI.this); } else { AppMethodBeat.o(21401); return; } } Toast.makeText(AlbumPreviewUI.this.mController.ylL, AlbumPreviewUI.this.getString(R.string.aor), 1).show(); AppMethodBeat.o(21401); return; } AppMethodBeat.o(21401); } else if (AlbumPreviewUI.this.getIntent().getBooleanExtra("record_video_force_sys_camera", false)) { int intExtra = AlbumPreviewUI.this.getIntent().getIntExtra("record_video_quality", 0); int intExtra2 = AlbumPreviewUI.this.getIntent().getIntExtra("record_video_time_limit", 0); n.a(AlbumPreviewUI.this.mController.ylL, AlbumPreviewUI.this.getIntent().getStringExtra("video_full_path"), 4372, intExtra2, intExtra, false); AppMethodBeat.o(21401); } else if (AlbumPreviewUI.this.getIntent().getBooleanExtra("record_video_is_sight_capture", false)) { if (((SightParams) AlbumPreviewUI.this.getIntent().getParcelableExtra("KEY_SIGHT_PARAMS")) == null) { ab.e("MicroMsg.AlbumPreviewUI", "takeMMSight, sightParams == null"); } if (e.bBZ().hOZ != 13) { n.a(AlbumPreviewUI.this.mController.ylL, 4375, AlbumPreviewUI.this.getIntent(), 3, 1); AppMethodBeat.o(21401); return; } n.a(AlbumPreviewUI.this.mController.ylL, 4375, AlbumPreviewUI.this.getIntent(), 4, 1); AppMethodBeat.o(21401); } else if (q.etn.erY == 2) { bCD(); AppMethodBeat.o(21401); } else if (q.etn.erY != 1 || com.tencent.mm.r.a.bI(AlbumPreviewUI.this.mController.ylL) || com.tencent.mm.r.a.bH(AlbumPreviewUI.this.mController.ylL)) { bCD(); AppMethodBeat.o(21401); } else { com.tencent.mm.compatible.j.b.s(AlbumPreviewUI.this.mController.ylL); AppMethodBeat.o(21401); } } }; { AppMethodBeat.i(21402); AppMethodBeat.o(21402); } public final View getView() { AppMethodBeat.i(21403); View inflate = View.inflate(AlbumPreviewUI.this.mController.ylL, R.layout.ks, null); inflate.setOnClickListener(this.mjE); TextView textView = (TextView) inflate.findViewById(R.id.akx); if (e.bBZ().mOu == 2 || e.bBZ().hOZ == 13) { textView.setText(R.string.c4c); } else if (e.bBZ().mOu == 1) { textView.setText(R.string.c4b); } inflate.setLayerType(1, null); AppMethodBeat.o(21403); return inflate; } }; private boolean mPM = false; private HashMap<String, Integer> mPN = new HashMap(); private GridView mPe; private TextView mPf; private boolean mPg; private boolean mPh; private TextView mPi; private a mPj; private TextView mPk; private TextView mPl; private TextView mPm; private ImageFolderMgrView mPn; private TextView mPo; private ImageButton mPp; private String mPq; private String mPr; private int mPs; private String mPt; private boolean mPu = false; private boolean mPv = false; private boolean mPw = false; private boolean mPx = false; private boolean mPy = false; private boolean mPz = false; private String toUser; static class a implements Runnable { public WeakReference<a> mPW; public WeakReference<ProgressDialog> mPX; public WeakReference<TextView> mPY; public WeakReference<GridView> mPZ; public LinkedList<MediaItem> mQa; public WeakReference<String> mQb; private a() { } /* synthetic */ a(byte b) { this(); } public final void run() { AppMethodBeat.i(21415); String str = "MicroMsg.AlbumPreviewUI"; String str2 = "on NotifyMediaItemsChanged, size %d"; Object[] objArr = new Object[1]; objArr[0] = Integer.valueOf(this.mQa == null ? -1 : this.mQa.size()); ab.d(str, str2, objArr); if (this.mPW == null) { ab.w("MicroMsg.AlbumPreviewUI", "null == adapterRef"); AppMethodBeat.o(21415); return; } a aVar = (a) this.mPW.get(); if (aVar == null) { ab.w("MicroMsg.AlbumPreviewUI", "null == adapter"); AppMethodBeat.o(21415); return; } AlbumPreviewUI.W(this.mQa); LinkedList linkedList = this.mQa; if (aVar.mOO) { aVar.mOO = false; aVar.mOH.clear(); } aVar.mOH.addAll(linkedList); aVar.notifyDataSetChanged(); if (this.mPX == null) { AppMethodBeat.o(21415); return; } ProgressDialog progressDialog = (ProgressDialog) this.mPX.get(); if (progressDialog != null && progressDialog.isShowing()) { progressDialog.dismiss(); ab.i("MicroMsg.AlbumPreviewUI", "[NotifyMediaItemsChanged] cost:%s", Long.valueOf(System.currentTimeMillis() - AlbumPreviewUI.start)); } if (this.mPY == null || this.mPZ == null || this.mQb == null) { AppMethodBeat.o(21415); return; } final TextView textView = (TextView) this.mPY.get(); GridView gridView = (GridView) this.mPZ.get(); String str3 = (String) this.mQb.get(); if (!(textView == null || gridView == null || str3 == null)) { String wt = aVar.wt(gridView.getFirstVisiblePosition()); if (!bo.isNullOrNil(wt) && wt.equals("album_business_bubble_media_by_coordinate")) { textView.setVisibility(0); textView.setText(str3 + "附近的照片和视频"); textView.postDelayed(new Runnable() { public final void run() { AppMethodBeat.i(21414); if (8 == textView.getVisibility()) { AppMethodBeat.o(21414); return; } AlphaAnimation alphaAnimation = new AlphaAnimation(1.0f, 0.0f); alphaAnimation.setDuration(300); textView.clearAnimation(); textView.startAnimation(alphaAnimation); textView.setVisibility(8); AppMethodBeat.o(21414); } }, FaceGestureDetGLThread.BRIGHTNESS_DURATION); } } AppMethodBeat.o(21415); } public final String toString() { AppMethodBeat.i(21416); String str = super.toString() + "|notifyRunnable"; AppMethodBeat.o(21416); return str; } } public void onWindowFocusChanged(boolean z) { super.onWindowFocusChanged(z); AppMethodBeat.at(this, z); } public AlbumPreviewUI() { AppMethodBeat.i(21417); AppMethodBeat.o(21417); } static /* synthetic */ int K(AlbumPreviewUI albumPreviewUI) { int i = albumPreviewUI.mPD + 1; albumPreviewUI.mPD = i; return i; } static /* synthetic */ void M(AlbumPreviewUI albumPreviewUI) { AppMethodBeat.i(21445); albumPreviewUI.bCz(); AppMethodBeat.o(21445); } static /* synthetic */ int x(AlbumPreviewUI albumPreviewUI) { int i = albumPreviewUI.mPE + 1; albumPreviewUI.mPE = i; return i; } public void onCreate(Bundle bundle) { AppMethodBeat.i(21418); super.onCreate(bundle); this.mPG = System.currentTimeMillis(); ab.i("MicroMsg.AlbumPreviewUI", "onCreate"); if (bundle != null) { ab.i("MicroMsg.AlbumPreviewUI", "savedInstanceState not null"); this.mPB = bundle.getInt("constants_key"); e.bBZ().hOZ = this.mPB; } Nb(this.mController.ylL.getResources().getColor(R.color.l8)); getString(R.string.tz); this.ehJ = h.b((Context) this, getString(R.string.un), true, new OnCancelListener() { public final void onCancel(DialogInterface dialogInterface) { } }); start = System.currentTimeMillis(); int intExtra = getIntent().getIntExtra("query_source_type", 3); int intExtra2 = getIntent().getIntExtra("query_media_type", 1); ab.i("MicroMsg.AlbumPreviewUI", "query souce: " + intExtra + ", queryType: " + intExtra2); e.bBZ().wq(intExtra2); e.bBZ().hOZ = intExtra; initView(); e.bBZ().mOr.add(this); this.mPK = System.currentTimeMillis(); l bBZ = e.bBZ(); bBZ.g(this.mPr, bBZ.mOu, this.mPK); bindService(new Intent(this.mController.ylL, GalleryStubService.class), this.ktl, 1); o.JV(1); AppMethodBeat.o(21418); } public void onPause() { AppMethodBeat.i(21419); super.onPause(); ab.i("MicroMsg.AlbumPreviewUI", "on resume"); this.mPz = true; ab.d("MicroMsg.AlbumPreviewUI", "shouldSaveLastChoosePath: " + this.mPv); if (this.mPv) { bCA(); } if (this.mPn.aej) { ImageFolderMgrView imageFolderMgrView = this.mPn; if (!imageFolderMgrView.aej) { ab.w("MicroMsg.ImageFolderMgrView", "want to close, but it was closed"); } else if (imageFolderMgrView.mQE) { ab.d("MicroMsg.ImageFolderMgrView", "want to close, but it is in animation"); } else { imageFolderMgrView.mQA.setVisibility(8); imageFolderMgrView.aej = false; } } WXHardCoderJNI.stopPerformance(WXHardCoderJNI.hcAlbumScrollEnable, this.ehv); this.ehv = 0; AppMethodBeat.o(21419); } public void onResume() { AppMethodBeat.i(21420); super.onResume(); ab.i("MicroMsg.AlbumPreviewUI", "on resume"); this.mPz = false; AppMethodBeat.o(21420); } public void onDestroy() { AppMethodBeat.i(21421); super.onDestroy(); ab.i("MicroMsg.AlbumPreviewUI", "onDestroy"); e.bBZ().b(this.mPn); e.bCa().bCp(); e.bCa().bCo().removeCallbacksAndMessages(null); e.bBZ().mOr.remove(this); l bBZ = e.bBZ(); b bVar = this.mPJ; if (bVar != null) { bBZ.mOs.remove(bVar); } if (this.mPD > 0 || this.mPE > 0) { ab.d("MicroMsg.AlbumPreviewUI", "report click camera count[%d], click folder count[%d]", Integer.valueOf(this.mPD), Integer.valueOf(this.mPE)); try { this.mOG.aK(11187, this.mPD + "," + this.mPE); } catch (Exception e) { ab.e("MicroMsg.AlbumPreviewUI", "report error, %s", e.getMessage()); ab.printErrStackTrace("MicroMsg.AlbumPreviewUI", e, "", new Object[0]); } } else { ab.w("MicroMsg.AlbumPreviewUI", "do not click camera or folder!"); } try { boolean z; if (this.mPF > 0 || this.mPh) { e.a(this.mOG, this.mPt, D(this.mPj.mOI), this.kvs, this.mPg); } com.tencent.mm.plugin.gallery.stub.a aVar = this.mOG; int size = this.mPj.mOI.size(); boolean z2 = this.kvs; if (this.mPF > 0 || this.mPh) { z = true; } else { z = false; } e.a(aVar, size, z2, z); } catch (RemoteException e2) { ab.printErrStackTrace("MicroMsg.AlbumPreviewUI", e2, "", new Object[0]); } s.ccQ.Ae().Ad(); e.bCc().clear(); e.bCd().clear(); e.bCe().clear(); try { unbindService(this.ktl); } catch (Throwable th) { ab.printErrStackTrace("MicroMsg.AlbumPreviewUI", th, "Failed to unbindService when Activity.onDestroy is invoked.", new Object[0]); } o.JV(2); e.bBY().b(null); AppMethodBeat.o(21421); } public void onSaveInstanceState(Bundle bundle) { AppMethodBeat.i(21422); this.mPB = e.bBZ().hOZ; bundle.putInt("constants_key", this.mPB); AppMethodBeat.o(21422); } public final int getLayoutId() { return R.layout.apm; } private void updateTitle() { AppMethodBeat.i(21423); if (e.bBZ().mOu == 3) { setMMTitle((int) R.string.c34); this.mPi.setText(R.string.c34); AppMethodBeat.o(21423); } else if (e.bBZ().mOu == 1) { setMMTitle((int) R.string.c48); this.mPi.setText(R.string.c33); AppMethodBeat.o(21423); } else { setMMTitle((int) R.string.c35); this.mPi.setText(R.string.c35); AppMethodBeat.o(21423); } } private static int[] D(ArrayList<MediaItem> arrayList) { AppMethodBeat.i(21424); int[] iArr = new int[4]; iArr[0] = arrayList.size(); Iterator it = arrayList.iterator(); while (it.hasNext()) { MediaItem mediaItem = (MediaItem) it.next(); if (mediaItem != null) { if (!bo.isNullOrNil(mediaItem.mMimeType) && mediaItem.mMimeType.equalsIgnoreCase("image/gif")) { iArr[2] = iArr[2] + 1; } else if (mediaItem.getType() == 2) { iArr[3] = iArr[3] + 1; } else if (mediaItem.getType() == 1) { iArr[1] = iArr[1] + 1; } } } AppMethodBeat.o(21424); return iArr; } private void a(AlbumItem albumItem) { AppMethodBeat.i(21425); if (albumItem == null) { AppMethodBeat.o(21425); } else if (bo.bc(this.mPr, "").equals(albumItem.mOh)) { ab.w("MicroMsg.AlbumPreviewUI", "want to reset folder, same folder, return"); AppMethodBeat.o(21425); } else { e.bCe().addAll(this.mPj.mOI); ab.d("MicroMsg.AlbumPreviewUI", "reset folder[%s], path[%s]", albumItem.mOh, albumItem.Wy()); this.mPq = albumItem.Wy(); this.mPr = albumItem.mOh; if (albumItem.oqq != null) { this.mPs = albumItem.oqq.getType(); } if (bo.isNullOrNil(this.mPq)) { ab.w("MicroMsg.AlbumPreviewUI", "reset folder path failed"); this.mPq = this.mPr; } if (bo.isNullOrNil(this.mPr)) { if (getIntent().getBooleanExtra("show_header_view", true)) { this.mPj.a(this.mPL); } updateTitle(); this.mPs = e.bBZ().mOu; } else { a aVar = this.mPj; com.tencent.mm.plugin.gallery.ui.a.a aVar2 = this.mPL; if (aVar2 == null) { ab.w("MicroMsg.AlbumAdapter", "removeHeader error, header is null"); } else { aVar.mOM.remove(aVar2); } this.mPi.setText(this.mPr); } this.mPj.mOH.clear(); wu(this.mPj.mOI.size()); this.mPj.notifyDataSetChanged(); if (this.ehJ != null) { this.ehJ.dismiss(); } getString(R.string.tz); this.ehJ = h.b((Context) this, getString(R.string.un), true, new OnCancelListener() { public final void onCancel(DialogInterface dialogInterface) { } }); start = System.currentTimeMillis(); String str = this.mPr; if (albumItem.oqq == null) { AppMethodBeat.o(21425); return; } int type = albumItem.oqq.getType(); ab.i("MicroMsg.AlbumPreviewUI", "folder type[%d] queryType[%d]", Integer.valueOf(type), Integer.valueOf(e.bBZ().mOu)); if (e.bBZ().mOu != 2 && albumItem.oqq.getType() == 2) { str = ""; } if (bo.isNullOrNil(albumItem.mOh)) { type = 3; } this.mPK = System.currentTimeMillis(); e.bBZ().g(str, type, this.mPK); AppMethodBeat.o(21425); } } public final void V(int i, boolean z) { boolean z2 = true; AppMethodBeat.i(21426); switch (e.bBZ().mOu) { case 3: if (!(bo.isNullOrNil(this.cEV) || "medianote".equals(this.toUser))) { if (bo.yz() - this.mPF >= 1000) { ab.i("MicroMsg.AlbumPreviewUI", "switch to SendImgProxyUI"); MediaItem mediaItem = (MediaItem) this.mPj.mOH.get(i); if (mediaItem.getType() != 2) { try { com.tencent.mm.plugin.gallery.stub.a aVar = this.mOG; String str = mediaItem.fPT; String str2 = this.toUser; if (!this.mPu) { if (this.kvs) { z2 = false; } } aVar.a(str, str2, z2, 0, z); AppMethodBeat.o(21426); return; } catch (Exception e) { break; } } } ab.w("MicroMsg.AlbumPreviewUI", "sendimg btn event frequence limit"); AppMethodBeat.o(21426); return; } break; } AppMethodBeat.o(21426); } public final void initView() { boolean z; AppMethodBeat.i(21427); Bundle extras = getIntent().getExtras(); if (extras != null) { for (String str : extras.keySet()) { ab.d("MicroMsg.AlbumPreviewUI", "key=%s | value=%s", str, extras.get(str)); } } else { ab.e("MicroMsg.AlbumPreviewUI", "initView, oops! no extras data!"); } this.mOL = getIntent().getStringExtra("album_business_tag"); this.gLP = getIntent().getIntExtra("album_video_max_duration", 10); this.cEV = getIntent().getStringExtra("GalleryUI_FromUser"); this.toUser = getIntent().getStringExtra("GalleryUI_ToUser"); this.mPA = getIntent().getIntExtra("max_select_count", 9); this.mPu = e.bBZ().hOZ == 4; if (e.bBZ().hOZ == 5) { z = true; } else { z = false; } this.mPw = z; if (e.bBZ().hOZ == 9) { z = true; } else { z = false; } this.mPx = z; this.mPq = getIntent().getStringExtra("folder_path"); this.mPr = getIntent().getStringExtra("folder_name"); if (bo.isNullOrNil(this.mPq)) { ab.e("MicroMsg.AlbumPreviewUI", "get folder path failed"); this.mPq = this.mPr; } this.kvs = getIntent().getBooleanExtra("key_send_raw_image", false); this.mPy = getIntent().getBooleanExtra("key_can_select_video_and_pic", false); this.mPo = (TextView) findViewById(R.id.avs); this.mPp = (ImageButton) findViewById(R.id.avr); this.mPo.setOnClickListener(new OnClickListener() { public final void onClick(View view) { AppMethodBeat.i(21408); AlbumPreviewUI.this.mPp.performClick(); AppMethodBeat.o(21408); } }); if (e.bBZ().hOZ == 3) { this.mPp.setVisibility(0); this.mPo.setVisibility(0); } else { this.mPp.setVisibility(8); this.mPo.setVisibility(8); } if (this.kvs) { this.mPp.setImageResource(R.raw.radio_on); } else { this.mPp.setImageResource(R.raw.radio_off); } this.mPp.setOnClickListener(new OnClickListener() { public final void onClick(View view) { AppMethodBeat.i(21409); AlbumPreviewUI.this.kvs = !AlbumPreviewUI.this.kvs; AlbumPreviewUI.e(AlbumPreviewUI.this); AlbumPreviewUI.this.mPo.setText(AlbumPreviewUI.this.mController.ylL.getString(R.string.c3i) + ""); if (AlbumPreviewUI.this.kvs) { AlbumPreviewUI.this.mPp.setImageResource(R.raw.radio_on); } else { AlbumPreviewUI.this.mPp.setImageResource(R.raw.radio_off); } AlbumPreviewUI.g(AlbumPreviewUI.this); AppMethodBeat.o(21409); } }); this.mPk = (TextView) findViewById(R.id.bqy); this.mPl = (TextView) findViewById(R.id.e5q); this.mPm = (TextView) findViewById(R.id.e5r); this.mPf = (TextView) findViewById(R.id.e5w); if (e.bBZ().hOZ == 0 || e.bBZ().hOZ == 5 || e.bBZ().hOZ == 10 || e.bBZ().hOZ == 11 || e.bBZ().hOZ == 14) { findViewById(R.id.e5v).setVisibility(8); this.mPf.setVisibility(8); } else { this.mPf.setVisibility(0); this.mPf.setOnClickListener(new OnClickListener() { public final void onClick(View view) { AppMethodBeat.i(21410); AlbumPreviewUI.this.mPg = true; Intent intent = new Intent(AlbumPreviewUI.this, ImagePreviewUI.class); e.B(AlbumPreviewUI.this.mPj.mOH); intent.putStringArrayListExtra("preview_image_list", AlbumPreviewUI.this.mPj.bCw()); intent.putExtra("max_select_count", AlbumPreviewUI.this.mPA); intent.putExtra("send_raw_img", AlbumPreviewUI.this.kvs); intent.putExtra("GalleryUI_FromUser", AlbumPreviewUI.this.cEV); intent.putExtra("GalleryUI_ToUser", AlbumPreviewUI.this.toUser); AlbumPreviewUI.this.startActivityForResult(intent, 0); AppMethodBeat.o(21410); } }); if ((e.bBZ().mOu == 1 || e.bBZ().mOu == 2 || e.bBZ().mOu == 3) && this.mPA > 0) { AnonymousClass16 anonymousClass16 = new OnMenuItemClickListener() { public final boolean onMenuItemClick(MenuItem menuItem) { boolean z = false; AppMethodBeat.i(21411); ab.d("MicroMsg.AlbumPreviewUI", "send image, previewImageCount:%d, chooseForTimeline:%b", Integer.valueOf(e.bCg()), Boolean.valueOf(AlbumPreviewUI.this.mPu)); try { AlbumPreviewUI.this.mOG.aK(11610, (AlbumPreviewUI.this.mPu ? 3 : 2) + "," + e.bCg()); } catch (Exception e) { ab.e("MicroMsg.AlbumPreviewUI", "report error, %s", e.getMessage()); ab.printErrStackTrace("MicroMsg.AlbumPreviewUI", e, "", new Object[0]); } if (AlbumPreviewUI.this.mPH < 0) { try { AlbumPreviewUI.this.mPH = AlbumPreviewUI.this.mOG.Nd(); } catch (Exception e2) { AlbumPreviewUI.this.mPH = 26214400; ab.e("MicroMsg.AlbumPreviewUI", "getMaxSendVideoSize error, %s", e2.getMessage()); ab.printErrStackTrace("MicroMsg.AlbumPreviewUI", e2, "", new Object[0]); } } e.bCf(); if (AlbumPreviewUI.this.mPj.bCw().size() == 0) { ab.i("MicroMsg.AlbumPreviewUI", "onMenuItemClick"); AlbumPreviewUI.this.setResult(-2); AlbumPreviewUI.this.finish(); AppMethodBeat.o(21411); } else { Intent intent = new Intent(); int i = e.bBZ().mOu; if (AlbumPreviewUI.this.mPu) { i = 1; } if (AlbumPreviewUI.this.mPy) { i = 1; } ArrayList arrayList; MediaItem mediaItem; ArrayList arrayList2; ArrayList arrayList3; Iterator it; if (i == 1) { String str = "CropImage_Compress_Img"; boolean z2 = AlbumPreviewUI.this.mPu ? true : !AlbumPreviewUI.this.kvs; intent.putExtra(str, z2); arrayList = AlbumPreviewUI.this.mPj.mOI; ArrayList arrayList4 = new ArrayList(); Iterator it2 = arrayList.iterator(); while (it2.hasNext()) { mediaItem = (MediaItem) it2.next(); if (!mediaItem.mMimeType.equals("edit") || bo.isNullOrNil(mediaItem.mOj)) { arrayList4.add(mediaItem.fPT); } else { arrayList4.add(mediaItem.mOj); } } intent.putStringArrayListExtra("CropImage_OutputPath_List", arrayList4); intent.putExtra("KSelectImgUseTime", System.currentTimeMillis() - AlbumPreviewUI.this.mPG); AlbumPreviewUI.this.mPG = 0; AlbumPreviewUI.this.setResult(-1, intent); AlbumPreviewUI.this.mPv = true; if (bo.isNullOrNil(AlbumPreviewUI.this.cEV) || "medianote".equals(AlbumPreviewUI.this.toUser)) { AlbumPreviewUI.this.finish(); } else if (bo.yz() - AlbumPreviewUI.this.mPF < 1000) { ab.w("MicroMsg.AlbumPreviewUI", "sendimg btn event frequence limit"); AppMethodBeat.o(21411); } else { ab.i("MicroMsg.AlbumPreviewUI", "switch to SendImgProxyUI"); AlbumPreviewUI.this.mPF = bo.yz(); intent.setClassName(AlbumPreviewUI.this, "com.tencent.mm.ui.chatting.SendImgProxyUI"); intent.putExtra("GalleryUI_FromUser", AlbumPreviewUI.this.cEV); intent.putExtra("GalleryUI_ToUser", AlbumPreviewUI.this.toUser); AlbumPreviewUI.this.startActivityForResult(intent, 4373); } } else if (i == 2) { ab.i("MicroMsg.AlbumPreviewUI", "onMenuItemClick video"); if (AlbumPreviewUI.this.getIntent().getBooleanExtra("GalleryUI_SkipVideoSizeLimit", false)) { i = 0; } else { com.tencent.mm.pluginsdk.ui.c.a ajK = com.tencent.mm.pluginsdk.ui.c.a.ajK((String) AlbumPreviewUI.this.mPj.bCw().get(0)); ajK.mSize = AlbumPreviewUI.this.mPH; i = ajK.aAa(); } if (i == 0) { intent.setData(Uri.fromFile(new File((String) AlbumPreviewUI.this.mPj.bCw().get(0)))); intent.putStringArrayListExtra("key_select_video_list", AlbumPreviewUI.this.mPj.bCw()); AlbumPreviewUI.this.setResult(-1, intent); AlbumPreviewUI.this.mPv = true; AlbumPreviewUI.this.finish(); } else if (i == 2) { AlbumPreviewUI.s(AlbumPreviewUI.this); AppMethodBeat.o(21411); } else { AlbumPreviewUI.t(AlbumPreviewUI.this); AppMethodBeat.o(21411); } } else if (i != 3) { ab.i("MicroMsg.AlbumPreviewUI", "onMenuItemClick default"); AlbumPreviewUI.this.setResult(-2); AlbumPreviewUI.this.finish(); } else if (!bo.isNullOrNil(AlbumPreviewUI.this.mOL) && AlbumPreviewUI.this.mOL.equals("album_business_bubble_media_by_coordinate")) { arrayList = AlbumPreviewUI.this.mPj.mOI; arrayList2 = new ArrayList(); arrayList3 = new ArrayList(); it = arrayList.iterator(); while (it.hasNext()) { mediaItem = (MediaItem) it.next(); if (mediaItem.getType() == 1) { if (!mediaItem.mMimeType.equals("edit") || bo.isNullOrNil(mediaItem.mOj)) { arrayList3.add(mediaItem.fPT); } else { arrayList3.add(mediaItem.mOj); } } else if (mediaItem.getType() == 2) { arrayList2.add(mediaItem.fPT); } } intent.putExtra("CropImage_Compress_Img", false); intent.putStringArrayListExtra("CropImage_OutputPath_List", arrayList3); intent.putStringArrayListExtra("key_select_video_list", arrayList2); intent.putExtra("KSelectImgUseTime", System.currentTimeMillis() - AlbumPreviewUI.this.mPG); intent.putExtra("longitude", AlbumPreviewUI.this.longitude); intent.putExtra("latitude", AlbumPreviewUI.this.latitude); AlbumPreviewUI.this.mPG = 0; AlbumPreviewUI.this.setResult(-1, intent); AlbumPreviewUI.this.finish(); AppMethodBeat.o(21411); } else if (bo.yz() - AlbumPreviewUI.this.mPF < 1000) { ab.w("MicroMsg.AlbumPreviewUI", "sendimg btn event frequence limit"); AppMethodBeat.o(21411); } else { AlbumPreviewUI.this.mPF = bo.yz(); arrayList = AlbumPreviewUI.this.mPj.mOI; arrayList2 = new ArrayList(); arrayList3 = new ArrayList(); it = arrayList.iterator(); while (it.hasNext()) { mediaItem = (MediaItem) it.next(); if (mediaItem.getType() == 1) { if (!mediaItem.mMimeType.equals("edit") || bo.isNullOrNil(mediaItem.mOj)) { arrayList3.add(mediaItem.fPT); } else { arrayList3.add(mediaItem.mOj); } } else if (mediaItem.getType() == 2) { arrayList2.add(mediaItem.fPT); } } String str2 = "CropImage_Compress_Img"; if (AlbumPreviewUI.this.mPu) { z = true; } else if (!AlbumPreviewUI.this.kvs) { z = true; } intent.putExtra(str2, z); intent.putStringArrayListExtra("key_select_video_list", arrayList2); intent.putExtra("KSelectImgUseTime", System.currentTimeMillis() - AlbumPreviewUI.this.mPG); AlbumPreviewUI.this.mPG = 0; if (arrayList3.size() > 0) { intent.setClassName(AlbumPreviewUI.this, "com.tencent.mm.ui.chatting.SendImgProxyUI"); intent.putStringArrayListExtra("CropImage_OutputPath_List", arrayList3); intent.putExtra("GalleryUI_FromUser", AlbumPreviewUI.this.cEV); intent.putExtra("GalleryUI_ToUser", AlbumPreviewUI.this.toUser); intent.putExtra("CropImage_limit_Img_Size", 26214400); ab.i("MicroMsg.AlbumPreviewUI", "switch to SendImgProxyUI"); AlbumPreviewUI.this.startActivityForResult(intent, 4373); } else { ab.i("MicroMsg.AlbumPreviewUI", "QueryTypeImageAndVideo"); AlbumPreviewUI.this.setResult(-1, intent); AlbumPreviewUI.this.finish(); } } AppMethodBeat.o(21411); } return true; } }; if (!bo.isNullOrNil(this.mPt)) { addTextOptionMenu(0, this.mPt, anonymousClass16); } else if (e.bBZ().hOZ != 14) { a(0, wv(0), (OnMenuItemClickListener) anonymousClass16, com.tencent.mm.ui.q.b.GREEN); } } } this.mPn = (ImageFolderMgrView) findViewById(R.id.e5x); ImageFolderMgrView imageFolderMgrView = this.mPn; e.bBZ().b(imageFolderMgrView); e.bBZ().a(imageFolderMgrView); e.bBZ().bCu(); this.mPn.setListener(new com.tencent.mm.plugin.gallery.ui.ImageFolderMgrView.a() { public final void b(AlbumItem albumItem) { AppMethodBeat.i(21412); AlbumPreviewUI.a(AlbumPreviewUI.this, albumItem); AppMethodBeat.o(21412); } }); this.mPt = getIntent().getStringExtra("send_btn_string"); findViewById(R.id.e5t).setOnClickListener(new OnClickListener() { public final void onClick(View view) { AppMethodBeat.i(21413); AlbumPreviewUI.x(AlbumPreviewUI.this); AlbumPreviewUI.this.mPn.bCE(); ab.d("MicroMsg.AlbumPreviewUI", "click folder times[%d]", Integer.valueOf(AlbumPreviewUI.this.mPE)); AppMethodBeat.o(21413); } }); this.mPi = (TextView) findViewById(R.id.e5u); if (this.mPw) { showOptionMenu(false); } enableOptionMenu(false); this.mPe = (GridView) findViewById(R.id.e5p); this.mPe.setOnItemClickListener(new OnItemClickListener() { public final void onItemClick(AdapterView<?> adapterView, View view, final int i, long j) { AppMethodBeat.i(21389); final MediaItem ws = AlbumPreviewUI.this.mPj.ws(i); String str; Intent intent; Intent intent2; ArrayList wr; AlbumPreviewUI albumPreviewUI; if (ws == null || bo.isNullOrNil(ws.fPT)) { str = "MicroMsg.AlbumPreviewUI"; String str2 = "item is null %s, item original path is null"; Object[] objArr = new Object[1]; objArr[0] = Boolean.valueOf(ws == null); ab.w(str, str2, objArr); AppMethodBeat.o(21389); } else if (e.bBZ().hOZ == 0 || e.bBZ().hOZ == 5 || e.bBZ().hOZ == 10 || e.bBZ().hOZ == 11) { if (e.bBZ().mOu == 2) { h.a(AlbumPreviewUI.this, true, AlbumPreviewUI.this.getString(R.string.c4a), "", AlbumPreviewUI.this.getString(R.string.tf), AlbumPreviewUI.this.getString(R.string.or), new DialogInterface.OnClickListener() { public final void onClick(DialogInterface dialogInterface, int i) { AppMethodBeat.i(21388); if (ws == null) { ab.w("MicroMsg.AlbumPreviewUI", "get item for video error, null, position %d", Integer.valueOf(i)); AlbumPreviewUI.this.setResult(0); } else { ab.i("MicroMsg.AlbumPreviewUI", "ShowAlert"); Intent intent = new Intent(); intent.setData(Uri.parse("file://" + Uri.encode(ws.fPT))); AlbumPreviewUI.this.setResult(-1, intent); } AlbumPreviewUI.this.finish(); AppMethodBeat.o(21388); } }, null); AppMethodBeat.o(21389); return; } if (ws == null) { ab.w("MicroMsg.AlbumPreviewUI", "get item error, null, position %d", Integer.valueOf(i)); AlbumPreviewUI.this.setResult(0); } else { intent = new Intent(); if (ws.getType() == 2) { intent.putExtra("is_video", true); intent.putExtra("video_full_path", ws.fPT); } if (e.bBZ().hOZ == 10) { intent.putExtra("CropImage_OutputPath", ws.fPT); } intent.setData(Uri.parse(Uri.encode(ws.fPT))); ab.i("MicroMsg.AlbumPreviewUI", "getItem ok"); AlbumPreviewUI.this.setResult(-1, intent); } AlbumPreviewUI.this.finish(); AppMethodBeat.o(21389); } else if (e.bBZ().hOZ != 4) { if (e.bBZ().hOZ == 14) { if (i < AlbumPreviewUI.this.mPj.mOM.size()) { ab.w("MicroMsg.AlbumPreviewUI", "POSITION ERROR!!!"); AppMethodBeat.o(21389); return; } else if (ws == null) { ab.w("MicroMsg.AlbumPreviewUI", "POSITION ERROR!!! MediaItem == null."); AppMethodBeat.o(21389); return; } else if (ws.getType() == 2 && AlbumPreviewUI.this.mPj.mOI.size() != 0) { h.bQ(AlbumPreviewUI.this.mController.ylL, com.tencent.mm.bz.a.an(AlbumPreviewUI.this.mController.ylL, R.string.c3b)); AppMethodBeat.o(21389); return; } else if (ws instanceof VideoMediaItem) { VideoMediaItem videoMediaItem = (VideoMediaItem) ws; int i2 = videoMediaItem.eXL; if (i2 == 0 || i2 == 180) { if (videoMediaItem.videoWidth >= videoMediaItem.videoHeight) { ab.i("MicroMsg.AlbumPreviewUI", "select story video, video ratio error, width:%s, height:%s, rotate:%s", Integer.valueOf(videoMediaItem.videoWidth), Integer.valueOf(videoMediaItem.videoHeight), Integer.valueOf(i2)); com.tencent.mm.plugin.report.service.h.pYm.k(1005, 52, 1); h.bQ(AlbumPreviewUI.this.mController.ylL, com.tencent.mm.bz.a.an(AlbumPreviewUI.this.mController.ylL, R.string.c3o)); AppMethodBeat.o(21389); return; } } else if ((i2 == 270 || i2 == 90) && videoMediaItem.videoHeight >= videoMediaItem.videoWidth) { ab.i("MicroMsg.AlbumPreviewUI", "select story video, video ratio error, width:%s, height:%s, rotate:%s", Integer.valueOf(videoMediaItem.videoWidth), Integer.valueOf(videoMediaItem.videoHeight), Integer.valueOf(i2)); com.tencent.mm.plugin.report.service.h.pYm.k(1005, 52, 1); h.bQ(AlbumPreviewUI.this.mController.ylL, com.tencent.mm.bz.a.an(AlbumPreviewUI.this.mController.ylL, R.string.c3o)); AppMethodBeat.o(21389); return; } if (videoMediaItem.fPW <= 2000) { ab.i("MicroMsg.AlbumPreviewUI", "select story video, duration too long, duration:%s", Integer.valueOf(videoMediaItem.fPW)); com.tencent.mm.plugin.report.service.h.pYm.k(1005, 53, 1); h.bQ(AlbumPreviewUI.this.mController.ylL, com.tencent.mm.bz.a.an(AlbumPreviewUI.this.mController.ylL, R.string.c3u)); AppMethodBeat.o(21389); return; } if (videoMediaItem.videoFrameRate <= 1 && videoMediaItem.videoFrameRate >= 0) { ab.i("MicroMsg.AlbumPreviewUI", "select story video, videoFrameRate too small:%s, videoPath:%s", Integer.valueOf(videoMediaItem.videoFrameRate), videoMediaItem.fPT); if (videoMediaItem.videoFrameRate == 1) { try { str = SightVideoJNI.getSimpleMp4Info(videoMediaItem.fPT); if (!bo.isNullOrNil(str)) { double optDouble = new JSONObject(str).optDouble("videoFPS"); ab.i("MicroMsg.AlbumPreviewUI", "update from getSimpleMp4Info videoFPS:%s", Double.valueOf(optDouble)); if (optDouble > 0.0d) { videoMediaItem.videoFrameRate = (int) optDouble; } } } catch (Exception e) { } } if (videoMediaItem.videoFrameRate <= 0) { ab.i("MicroMsg.AlbumPreviewUI", "final videoFrameRate:%s, too small, videoPath:%s", Integer.valueOf(videoMediaItem.videoFrameRate), videoMediaItem.fPT); com.tencent.mm.plugin.report.service.h.pYm.k(1005, 54, 1); h.bQ(AlbumPreviewUI.this.mController.ylL, com.tencent.mm.bz.a.an(AlbumPreviewUI.this.mController.ylL, R.string.c3m)); AppMethodBeat.o(21389); return; } } if (videoMediaItem.fPW >= 10500) { intent2 = new Intent(); intent2.putExtra("key_video_path", videoMediaItem.fPT); intent2.putExtra("key_need_clip_video_first", true); intent2.putExtra("key_need_remux_video", false); intent2.putExtra("key_text_color", AlbumPreviewUI.this.getIntent().getStringExtra("key_edit_text_color")); intent2.putExtra("key_max_duration_seconds", AlbumPreviewUI.this.getIntent().getIntExtra("key_edit_video_max_time_length", 10)); d.b(AlbumPreviewUI.this.mController.ylL, "mmsight", ".segment.MMSightEditUI", intent2, 4374); AppMethodBeat.o(21389); return; } intent2 = new Intent(); intent2.putExtra("K_SEGMENTVIDEOPATH", videoMediaItem.fPT); intent2.putExtra("KSEGMENTVIDEOTHUMBPATH", videoMediaItem.lZg); AlbumPreviewUI.this.setResult(-1, intent2); AlbumPreviewUI.this.finish(); AppMethodBeat.o(21389); return; } } else if (AlbumPreviewUI.this.mPy) { if (i < AlbumPreviewUI.this.mPj.mOM.size()) { ab.w("MicroMsg.AlbumPreviewUI", "POSITION ERROR!!!"); AppMethodBeat.o(21389); return; } else if (ws == null) { ab.w("MicroMsg.AlbumPreviewUI", "POSITION ERROR!!! MediaItem == null."); AppMethodBeat.o(21389); return; } else if (ws.getType() != 2 || AlbumPreviewUI.this.mPj.mOI.size() == 0) { wr = AlbumPreviewUI.this.mPj.wr(ws.getType()); e.B(wr); intent2 = new Intent(AlbumPreviewUI.this, ImagePreviewUI.class); intent2.putStringArrayListExtra("preview_image_list", AlbumPreviewUI.this.mPj.bCw()); intent2.putExtra("preview_all", true); intent2.putExtra("preview_position", wr.indexOf(ws)); albumPreviewUI = AlbumPreviewUI.this; albumPreviewUI.V(i - albumPreviewUI.mPj.mOM.size(), true); intent2.putExtra("send_raw_img", AlbumPreviewUI.this.kvs); intent2.putExtra("max_select_count", ws.getType() == 2 ? 1 : AlbumPreviewUI.this.mPA); intent2.putExtra("GalleryUI_FromUser", AlbumPreviewUI.this.cEV); intent2.putExtra("GalleryUI_ToUser", AlbumPreviewUI.this.toUser); AlbumPreviewUI.this.startActivityForResult(intent2, 0); AppMethodBeat.o(21389); return; } else { h.bQ(AlbumPreviewUI.this.mController.ylL, com.tencent.mm.bz.a.an(AlbumPreviewUI.this.mController.ylL, R.string.c3b)); AppMethodBeat.o(21389); return; } } else if (i < AlbumPreviewUI.this.mPj.mOM.size()) { ab.w("MicroMsg.AlbumPreviewUI", "POSITION ERROR!!!"); AppMethodBeat.o(21389); return; } else { e.B(AlbumPreviewUI.this.mPj.mOH); intent = new Intent(AlbumPreviewUI.this, ImagePreviewUI.class); intent.putStringArrayListExtra("preview_image_list", AlbumPreviewUI.this.mPj.bCw()); intent.putExtra("preview_all", true); intent.putExtra("preview_position", i - AlbumPreviewUI.this.mPj.mOM.size()); AlbumPreviewUI albumPreviewUI2 = AlbumPreviewUI.this; albumPreviewUI2.V(i - albumPreviewUI2.mPj.mOM.size(), true); intent.putExtra("send_raw_img", AlbumPreviewUI.this.kvs); intent.putExtra("max_select_count", AlbumPreviewUI.this.mPA); intent.putExtra("GalleryUI_FromUser", AlbumPreviewUI.this.cEV); intent.putExtra("GalleryUI_ToUser", AlbumPreviewUI.this.toUser); intent.putExtra("album_business_tag", AlbumPreviewUI.this.mOL); intent.putExtra("album_video_max_duration", AlbumPreviewUI.this.gLP); AlbumPreviewUI.this.startActivityForResult(intent, 0); } AppMethodBeat.o(21389); } else if (i < AlbumPreviewUI.this.mPj.mOM.size()) { ab.w("MicroMsg.AlbumPreviewUI", "POSITION ERROR!!!"); AppMethodBeat.o(21389); } else if (ws == null) { ab.w("MicroMsg.AlbumPreviewUI", "POSITION ERROR!!! MediaItem == null."); AppMethodBeat.o(21389); } else if (ws.getType() != 2 || AlbumPreviewUI.this.mPj.mOI.size() == 0) { wr = AlbumPreviewUI.this.mPj.wr(ws.getType()); e.B(wr); intent2 = new Intent(AlbumPreviewUI.this, ImagePreviewUI.class); intent2.putExtra("key_edit_video_max_time_length", AlbumPreviewUI.this.getIntent().getIntExtra("key_edit_video_max_time_length", 10)); intent2.putExtra("key_edit_text_color", AlbumPreviewUI.this.getIntent().getStringExtra("key_edit_text_color")); intent2.putStringArrayListExtra("preview_image_list", AlbumPreviewUI.this.mPj.bCw()); intent2.putExtra("preview_all", true); intent2.putExtra("preview_position", wr.indexOf(ws)); albumPreviewUI = AlbumPreviewUI.this; albumPreviewUI.V(i - albumPreviewUI.mPj.mOM.size(), true); intent2.putExtra("send_raw_img", AlbumPreviewUI.this.kvs); intent2.putExtra("max_select_count", AlbumPreviewUI.this.mPA); intent2.putExtra("GalleryUI_FromUser", AlbumPreviewUI.this.cEV); intent2.putExtra("GalleryUI_ToUser", AlbumPreviewUI.this.toUser); AlbumPreviewUI.this.startActivityForResult(intent2, 0); AppMethodBeat.o(21389); } else { h.bQ(AlbumPreviewUI.this.mController.ylL, com.tencent.mm.bz.a.an(AlbumPreviewUI.this.mController.ylL, R.string.c3b)); AppMethodBeat.o(21389); } } }); this.mPj = new a(this, new a.b() { public final void W(int i, int i2, int i3) { AppMethodBeat.i(21390); MediaItem ws = AlbumPreviewUI.this.mPj.ws(AlbumPreviewUI.this.mPj.mOM.size() + i2); if (i3 != 0) { AlbumPreviewUI.b(AlbumPreviewUI.this, i); AlbumPreviewUI.this.V(i2, false); } else if (ws != null && ws.getType() == 1) { AlbumPreviewUI.a(AlbumPreviewUI.this, ws); AlbumPreviewUI.b(AlbumPreviewUI.this, i); AlbumPreviewUI.this.V(i2, true); } else if (ws == null || ws.getType() != 2) { AlbumPreviewUI.b(AlbumPreviewUI.this, i); AlbumPreviewUI.this.V(i2, true); } else if (AlbumPreviewUI.b(AlbumPreviewUI.this, ws)) { AlbumPreviewUI.b(AlbumPreviewUI.this, i); AlbumPreviewUI.this.V(i2, true); } else { AlbumPreviewUI.this.mPj.mOI.remove(ws); AlbumPreviewUI.this.mPj.notifyDataSetChanged(); } Iterator it = AlbumPreviewUI.this.mPj.bCw().iterator(); while (it.hasNext()) { if (!r.amo((String) it.next())) { AppMethodBeat.o(21390); return; } } AlbumPreviewUI.this.kvs = true; AppMethodBeat.o(21390); } }); if (!bo.isNullOrNil(this.mOL)) { ab.d("MicroMsg.AlbumPreviewUI", "businessTag=%s", this.mOL); this.mPj.mOL = this.mOL; this.mPj.gLP = this.gLP; if (this.mOL.equals("album_business_bubble_media_by_coordinate")) { e.bBZ().mOt.bBV(); this.mPI = getIntent().getStringExtra("album_business_bubble_media_by_coordinate_posname"); final double doubleExtra = getIntent().getDoubleExtra("album_business_bubble_media_by_coordinate_distance", -1.0d); this.longitude = getIntent().getDoubleExtra("album_business_bubble_media_by_coordinate_longitude", 91.0d); this.latitude = getIntent().getDoubleExtra("album_business_bubble_media_by_coordinate_latitude", 181.0d); if (doubleExtra > 0.0d && com.tencent.mm.modelgeo.a.q(this.longitude) && com.tencent.mm.modelgeo.a.r(this.latitude)) { this.mPJ = new b() { public final void b(LinkedList<MediaItem> linkedList, long j) { AppMethodBeat.i(21391); ab.d("MicroMsg.AlbumPreviewUI", "onQueryMediaBusinessDoing"); if (j != AlbumPreviewUI.this.mPK) { ab.w("MicroMsg.AlbumPreviewUI", "%s %s, not my query, ignore.", Long.valueOf(j), Long.valueOf(AlbumPreviewUI.this.mPK)); ab.w("MicroMsg.AlbumPreviewUI", "If you saw too mush this log, maybe user had too many photos. This can be optimized."); AppMethodBeat.o(21391); } else if (linkedList == null || !linkedList.isEmpty()) { ArrayList arrayList = new ArrayList(); Iterator it = linkedList.iterator(); while (it.hasNext()) { MediaItem mediaItem = (MediaItem) it.next(); if (TencentLocationUtils.distanceBetween(AlbumPreviewUI.this.latitude, AlbumPreviewUI.this.longitude, mediaItem.bDG, mediaItem.bDH) <= doubleExtra) { mediaItem.mOn = "album_business_bubble_media_by_coordinate"; arrayList.add(mediaItem); } } linkedList.removeAll(arrayList); ab.d("MicroMsg.AlbumPreviewUI", "target media size=%d", Integer.valueOf(arrayList.size())); Iterator it2 = arrayList.iterator(); while (it2.hasNext()) { ab.d("MicroMsg.AlbumPreviewUI", "target media item=%s", ((MediaItem) it2.next()).toString()); } if (!(linkedList.isEmpty() || arrayList.isEmpty())) { linkedList.addAll(0, arrayList); } AppMethodBeat.o(21391); } else { ab.d("MicroMsg.AlbumPreviewUI", "mediaItems is empty."); AppMethodBeat.o(21391); } } }; l bBZ = e.bBZ(); b bVar = this.mPJ; if (bVar != null) { bBZ.mOs.add(bVar); } this.mPj.mON = false; } } } if (this.mPu) { this.mPj.mON = true; } if (this.mPy) { this.mPj.mON = true; } this.mPe.setNumColumns(4); this.mPe.setOnScrollListener(new OnScrollListener() { private Runnable kvR = new Runnable() { public final void run() { AppMethodBeat.i(21392); AlbumPreviewUI.this.mPk.startAnimation(AnimationUtils.loadAnimation(AlbumPreviewUI.this.mController.ylL, R.anim.b6)); AlbumPreviewUI.this.mPk.setVisibility(8); AppMethodBeat.o(21392); } }; { AppMethodBeat.i(21393); AppMethodBeat.o(21393); } private String bCC() { AppMethodBeat.i(21394); String wt = AlbumPreviewUI.this.mPj.wt(AlbumPreviewUI.this.mPe.getFirstVisiblePosition()); if (bo.isNullOrNil(wt) || !wt.equals("album_business_bubble_media_by_coordinate")) { AppMethodBeat.o(21394); return wt; } wt = AlbumPreviewUI.this.mPI + "附近的照片和视频"; AppMethodBeat.o(21394); return wt; } private void hD(boolean z) { AppMethodBeat.i(21395); if (z) { AlbumPreviewUI.this.mPk.removeCallbacks(this.kvR); if (AlbumPreviewUI.this.mPk.getVisibility() != 0) { AlbumPreviewUI.this.mPe.getFirstVisiblePosition(); AlbumPreviewUI.this.mPk.setText(bCC()); AlbumPreviewUI.this.mPk.clearAnimation(); Animation loadAnimation = AnimationUtils.loadAnimation(AlbumPreviewUI.this.mController.ylL, R.anim.b5); AlbumPreviewUI.this.mPk.setVisibility(0); AlbumPreviewUI.this.mPk.startAnimation(loadAnimation); AppMethodBeat.o(21395); return; } } AlbumPreviewUI.this.mPk.removeCallbacks(this.kvR); AlbumPreviewUI.this.mPk.postDelayed(this.kvR, 256); AppMethodBeat.o(21395); } public final void onScrollStateChanged(AbsListView absListView, int i) { int i2 = 0; AppMethodBeat.i(21396); ab.d("MicroMsg.AlbumPreviewUI", "scroll state[%d]", Integer.valueOf(i)); if (1 == i) { hD(true); AlbumPreviewUI.this.mPl.setVisibility(8); } else if (i == 0) { hD(false); } if (2 == i) { WXHardCoderJNI.stopPerformance(WXHardCoderJNI.hcAlbumScrollEnable, AlbumPreviewUI.this.ehv); AlbumPreviewUI albumPreviewUI = AlbumPreviewUI.this; boolean z = WXHardCoderJNI.hcAlbumScrollEnable; int i3 = WXHardCoderJNI.hcAlbumScrollDelay; int i4 = WXHardCoderJNI.hcAlbumScrollCPU; int i5 = WXHardCoderJNI.hcAlbumScrollIO; if (WXHardCoderJNI.hcAlbumScrollThr) { i2 = Process.myTid(); } albumPreviewUI.ehv = WXHardCoderJNI.startPerformance(z, i3, i4, i5, i2, WXHardCoderJNI.hcAlbumScrollTimeout, 702, WXHardCoderJNI.hcAlbumScrollAction, "MicroMsg.AlbumPreviewUI"); } AppMethodBeat.o(21396); } public final void onScroll(AbsListView absListView, int i, int i2, int i3) { AppMethodBeat.i(21397); AlbumPreviewUI.this.mPk.setText(bCC()); AppMethodBeat.o(21397); } }); if (getIntent().getBooleanExtra("show_header_view", true)) { this.mPj.a(this.mPL); } this.mPj.mOK = e.bBZ().mOu; this.mPj.mOF = this.mPA; ab.i("MicroMsg.AlbumPreviewUI", "limit count = " + getIntent().getIntExtra("max_select_count", 9)); this.mPe.setAdapter(this.mPj); updateTitle(); setBackBtn(new OnMenuItemClickListener() { public final boolean onMenuItemClick(MenuItem menuItem) { AppMethodBeat.i(21398); ab.i("MicroMsg.AlbumPreviewUI", "backBtn"); AlbumPreviewUI.this.setResult(-2); if (AlbumPreviewUI.this.mPn.aej) { AlbumPreviewUI.this.mPn.bCE(); AppMethodBeat.o(21398); } else { AlbumPreviewUI.this.finish(); AppMethodBeat.o(21398); } return true; } }); ViewGroup viewGroup = (ViewGroup) findViewById(R.id.l_); if (viewGroup instanceof DrawedCallBackFrameLayout) { ((DrawedCallBackFrameLayout) viewGroup).setListener(new com.tencent.mm.ui.base.DrawedCallBackFrameLayout.a() { public final void bCv() { AppMethodBeat.i(21399); try { AlbumPreviewUI.this.mOG.bCv(); } catch (Exception e) { ab.printErrStackTrace("MicroMsg.AlbumPreviewUI", e, "", new Object[0]); } if (AlbumPreviewUI.this.mPC) { try { AlbumPreviewUI.this.unbindService(AlbumPreviewUI.this.ktl); } catch (Throwable th) { ab.printErrStackTrace("MicroMsg.AlbumPreviewUI", th, "Failed to unbindService when onViewDrawed is invoked.", new Object[0]); } AlbumPreviewUI.this.mPC = false; } AppMethodBeat.o(21399); } }); } AppMethodBeat.o(21427); } public boolean onKeyDown(int i, KeyEvent keyEvent) { AppMethodBeat.i(21429); if (i == 4 && keyEvent.getRepeatCount() == 0) { ab.i("MicroMsg.AlbumPreviewUI", "onKeyDown"); setResult(-2); if (this.mPn.aej) { this.mPn.bCE(); AppMethodBeat.o(21429); return true; } finish(); AppMethodBeat.o(21429); return true; } else if (i == 82) { this.mPE++; this.mPn.bCE(); AppMethodBeat.o(21429); return true; } else { boolean onKeyDown = super.onKeyDown(i, keyEvent); AppMethodBeat.o(21429); return onKeyDown; } } public final int getForceOrientation() { return 1; } public void onActivityResult(int i, int i2, Intent intent) { AppMethodBeat.i(21430); ab.i("MicroMsg.AlbumPreviewUI", "on activity result, requestCode[%d] resultCode[%d]", Integer.valueOf(i), Integer.valueOf(i2)); ArrayList arrayList; if (4369 != i) { ArrayList stringArrayListExtra; if (4370 != i) { if (4371 != i) { if (4372 != i) { if (4373 != i) { if (4375 != i) { if (4376 != i) { switch (i2) { case -2: ab.e("MicroMsg.AlbumPreviewUI", "WTF!!!"); finish(); break; case -1: if (intent == null) { intent = new Intent(); intent.putExtra("CropImage_Compress_Img", true); intent.putStringArrayListExtra("CropImage_OutputPath_List", this.mPj.bCw()); } ab.i("MicroMsg.AlbumPreviewUI", "onActivity Result ok"); this.mPh = true; setResult(-1, intent); bCA(); finish(); break; case 0: if (intent != null) { boolean z; stringArrayListExtra = intent.getStringArrayListExtra("preview_image_list"); if (stringArrayListExtra != null) { this.mPj.C(stringArrayListExtra); this.mPj.notifyDataSetChanged(); wu(stringArrayListExtra.size()); } if (intent.getBooleanExtra("CropImage_Compress_Img", true)) { z = false; } else { z = true; } this.kvs = z; if (!this.kvs) { this.mPp.setImageResource(R.raw.radio_off); break; } else { this.mPp.setImageResource(R.raw.radio_on); break; } } break; } } else if (-1 != i2) { ab.i("MicroMsg.AlbumPreviewUI", "REQUEST_SELECT_FOLDER goBack!"); finish(); } else if (intent != null) { AlbumItem albumItem = (AlbumItem) intent.getParcelableExtra("select_folder_name"); a(albumItem); setMMTitle(bo.bc(albumItem.mOh, getString(R.string.c34))); } } else if (-1 != i2) { AppMethodBeat.o(21430); return; } else { if (intent == null) { intent = new Intent(); } ab.i("MicroMsg.AlbumPreviewUI", "sight capture record video, result[%s]", intent); SightCaptureResult sightCaptureResult = (SightCaptureResult) intent.getParcelableExtra("key_req_result"); if (sightCaptureResult == null) { ab.e("MicroMsg.AlbumPreviewUI", "sight capture result is null!"); setResult(1); finish(); AppMethodBeat.o(21430); return; } arrayList = new ArrayList(); String str = sightCaptureResult.osC; if (!bo.isNullOrNil(str)) { arrayList.add(str); intent.putExtra("key_select_video_list", arrayList); } if (sightCaptureResult.osA && !bo.isNullOrNil(sightCaptureResult.osI)) { arrayList = new ArrayList(); arrayList.add(sightCaptureResult.osI); intent.putStringArrayListExtra("CropImage_OutputPath_List", arrayList); } setResult(-1, intent); finish(); } } else { if (intent != null) { intent.putExtra("GalleryUI_IsSendImgBackground", true); ab.e("MicroMsg.AlbumPreviewUI", "send img background, data is null!!"); } ab.i("MicroMsg.AlbumPreviewUI", "Request code sendimg proxy"); setResult(-1, intent); this.mPC = true; finish(); } } else if (-1 != i2) { AppMethodBeat.o(21430); return; } else { if (intent == null) { intent = new Intent(); } ab.i("MicroMsg.AlbumPreviewUI", "system record video, result[%s]", intent); stringArrayListExtra = new ArrayList(); String stringExtra = getIntent().getStringExtra("video_full_path"); if (!bo.isNullOrNil(stringExtra)) { stringArrayListExtra.add(stringExtra); intent.putExtra("key_select_video_list", stringArrayListExtra); intent.putExtra("key_selected_video_is_from_sys_camera", true); } setResult(-1, intent); finish(); } } else if (-1 != i2) { AppMethodBeat.o(21430); return; } else { if (intent != null) { intent.putExtra("from_record", true); } ab.i("MicroMsg.AlbumPreviewUI", "custom record video, result[%s]", intent); setResult(-1, intent); finish(); } } else if (-1 != i2) { AppMethodBeat.o(21430); return; } else if (intent.getBooleanExtra("GalleryUI_IsSendImgBackground", false)) { ab.i("MicroMsg.AlbumPreviewUI", "test onActivityResult"); setResult(-1, intent); finish(); AppMethodBeat.o(21430); return; } else { stringArrayListExtra = intent.getStringArrayListExtra("CropImage_OutputPath_List"); if (stringArrayListExtra == null || stringArrayListExtra.isEmpty()) { ab.w("MicroMsg.AlbumPreviewUI", "send filepath is null or nil"); AppMethodBeat.o(21430); return; } ab.i("MicroMsg.AlbumPreviewUI", "gallery photo:%s", stringArrayListExtra); setResult(-1, intent); finish(); } } else if (-1 != i2) { AppMethodBeat.o(21430); return; } else { String h = n.h(this.mController.ylL.getApplicationContext(), intent, com.tencent.mm.compatible.util.e.euR); if (bo.isNullOrNil(h)) { ab.w("MicroMsg.AlbumPreviewUI", "take photo, but result is null"); AppMethodBeat.o(21430); return; } ab.i("MicroMsg.AlbumPreviewUI", "take photo, result[%s]", h); if (e.bBZ().hOZ == 0 || e.bBZ().hOZ == 5 || e.bBZ().hOZ == 11) { Intent intent2 = new Intent(); intent2.setData(Uri.parse("file://" + Uri.encode(h))); ab.i("MicroMsg.AlbumPreviewUI", "take photo finish"); setResult(-1, intent2); finish(); } else { arrayList = new ArrayList(1); arrayList.add(h); Intent intent3 = new Intent(this, ImagePreviewUI.class); intent3.putExtra("isTakePhoto", true); intent3.putExtra("max_select_count", 1); intent3.putExtra("send_raw_img", this.kvs); intent3.putStringArrayListExtra("preview_image_list", arrayList); intent3.putExtra("GalleryUI_FromUser", this.cEV); intent3.putExtra("GalleryUI_ToUser", this.toUser); startActivityForResult(intent3, 4370); } } if (intent != null && intent.getBooleanExtra("show_photo_edit_tip", false)) { SharedPreferences sharedPreferences = getSharedPreferences("photo_edit_pref", 0); if (!sharedPreferences.getBoolean("has_show_tip", false)) { this.mPm.setVisibility(0); this.mPm.setText(getString(R.string.dci)); Animation loadAnimation = AnimationUtils.loadAnimation(this.mController.ylL, R.anim.b5); this.mPm.startAnimation(loadAnimation); loadAnimation.setAnimationListener(new AnimationListener() { private Runnable mPU = new Runnable() { public final void run() { AppMethodBeat.i(21404); AlbumPreviewUI.this.mPm.startAnimation(AnimationUtils.loadAnimation(AlbumPreviewUI.this.mController.ylL, R.anim.b6)); AlbumPreviewUI.this.mPm.setVisibility(8); AppMethodBeat.o(21404); } }; { AppMethodBeat.i(21405); AppMethodBeat.o(21405); } public final void onAnimationStart(Animation animation) { } public final void onAnimationEnd(Animation animation) { AppMethodBeat.i(21406); AlbumPreviewUI.this.mPm.setVisibility(0); AlbumPreviewUI.this.mPm.postDelayed(this.mPU, 4000); AppMethodBeat.o(21406); } public final void onAnimationRepeat(Animation animation) { } }); sharedPreferences.edit().putBoolean("has_show_tip", true).commit(); } } AppMethodBeat.o(21430); } private void wu(int i) { AppMethodBeat.i(21431); if (i == 0) { this.mPf.setEnabled(false); enableOptionMenu(false); } else { this.mPf.setEnabled(true); enableOptionMenu(true); } if (i == 0) { this.mPf.setText(R.string.c3j); } else { this.mPf.setText(getString(R.string.c3j) + "(" + i + ")"); } updateOptionMenuText(0, wv(i)); AppMethodBeat.o(21431); } private String wv(int i) { AppMethodBeat.i(21432); String string; switch (e.bBZ().hOZ) { case 4: case 8: case 13: if (i == 0 || this.mPA <= 1) { string = getString(R.string.c3k); AppMethodBeat.o(21432); return string; } string = getString(R.string.c3k) + "(" + i + "/" + this.mPA + ")"; AppMethodBeat.o(21432); return string; case 7: if (bo.isNullOrNil(this.mOL) || !this.mOL.equals("album_business_bubble_media_by_coordinate")) { if (i == 0 || this.mPA <= 1) { string = getString(R.string.c3k); AppMethodBeat.o(21432); return string; } string = getString(R.string.c3k) + "(" + i + "/" + this.mPA + ")"; AppMethodBeat.o(21432); return string; } else if (i == 0 || this.mPA <= 1) { string = getString(R.string.s1); AppMethodBeat.o(21432); return string; } else { string = getString(R.string.s1) + "(" + i + "/" + this.mPA + ")"; AppMethodBeat.o(21432); return string; } default: if (i == 0 || this.mPA <= 1) { string = getString(R.string.tf); AppMethodBeat.o(21432); return string; } string = getString(R.string.c3c, new Object[]{Integer.valueOf(i), Integer.valueOf(this.mPA)}); AppMethodBeat.o(21432); return string; } } public final void c(LinkedList<MediaItem> linkedList, long j) { boolean z = true; AppMethodBeat.i(21433); if (j != this.mPK) { ab.w("MicroMsg.AlbumPreviewUI", "%s %s, not my query, ignore.", Long.valueOf(j), Long.valueOf(this.mPK)); ab.w("MicroMsg.AlbumPreviewUI", "If you saw too mush this log, maybe user had too many photos. This can be optimized."); AppMethodBeat.o(21433); return; } LinkedList linkedList2 = new LinkedList(); if (linkedList != null) { linkedList2.addAll(linkedList); } String str = "MicroMsg.AlbumPreviewUI"; String str2 = "[onQueryMediaFinished] adapter is null?:%s"; Object[] objArr = new Object[1]; if (this.mPj != null) { z = false; } objArr[0] = Boolean.valueOf(z); ab.i(str, str2, objArr); if (this.mPj != null) { a aVar = new a(); aVar.mPW = new WeakReference(this.mPj); aVar.mPX = new WeakReference(this.ehJ); aVar.mPY = new WeakReference(this.mPl); aVar.mPZ = new WeakReference(this.mPe); aVar.mQa = linkedList2; aVar.mQb = new WeakReference(this.mPI); e.bCa().d(aVar); } AppMethodBeat.o(21433); } private void bCA() { AppMethodBeat.i(21434); if (this.mPM) { SharedPreferences sharedPreferences = getSharedPreferences("gallery_last_choose_album", 0); ab.i("MicroMsg.AlbumPreviewUI", "last selected folderName and path: " + this.mPr + ", " + this.mPq); sharedPreferences.edit().putString(e.bBZ().mOu, this.mPr + "|" + this.mPq + "|" + this.mPs).commit(); AppMethodBeat.o(21434); return; } AppMethodBeat.o(21434); } public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) { AppMethodBeat.i(21435); if (iArr == null || iArr.length <= 0) { ab.i("MicroMsg.AlbumPreviewUI", "onRequestPermissionsResult grantResults length 0. requestCode[%d], tid[%d]", Integer.valueOf(i), Long.valueOf(Thread.currentThread().getId())); AppMethodBeat.o(21435); return; } ab.i("MicroMsg.AlbumPreviewUI", "onRequestPermissionsResult requestCode[%d],grantResults[%d] tid[%d]", Integer.valueOf(i), Integer.valueOf(iArr[0]), Long.valueOf(Thread.currentThread().getId())); switch (i) { case 16: if (iArr[0] != 0) { h.a((Context) this, getString(R.string.dbs), getString(R.string.dc8), getString(R.string.ckr), getString(R.string.abx), false, new DialogInterface.OnClickListener() { public final void onClick(DialogInterface dialogInterface, int i) { AppMethodBeat.i(21407); AlbumPreviewUI.this.startActivity(new Intent("android.settings.MANAGE_APPLICATIONS_SETTINGS")); AppMethodBeat.o(21407); } }, null); break; } bCz(); AppMethodBeat.o(21435); return; } AppMethodBeat.o(21435); } private boolean a(MediaItem mediaItem) { AppMethodBeat.i(21436); if (mediaItem == null) { ab.e("MicroMsg.AlbumPreviewUI", "[checkSelectedVideo] item is null!"); AppMethodBeat.o(21436); return false; } else if (this.mOG == null) { ab.e("MicroMsg.AlbumPreviewUI", "[checkSelectedVideo] invoker is null!"); AppMethodBeat.o(21436); return false; } else if (e.bBZ().hOZ != 3) { AppMethodBeat.o(21436); return true; } else if (new File(mediaItem.fPT).exists()) { try { if (this.mOG.ND(mediaItem.fPT) > 300) { h.bP(this, getString(R.string.c43)); AppMethodBeat.o(21436); return false; } } catch (RemoteException e) { ab.printErrStackTrace("MicroMsg.AlbumPreviewUI", e, "", new Object[0]); } AppMethodBeat.o(21436); return true; } else { h.bP(this, getString(R.string.c41)); AppMethodBeat.o(21436); return false; } } private void bCz() { AppMethodBeat.i(21428); if (n.c(this.mController.ylL, com.tencent.mm.compatible.util.e.euR, "microMsg." + System.currentTimeMillis() + FileUtils.PIC_POSTFIX_JPEG, 4369)) { e.bCa().wp(0); System.gc(); AppMethodBeat.o(21428); return; } Toast.makeText(this.mController.ylL, getString(R.string.e29), 1).show(); AppMethodBeat.o(21428); } static /* synthetic */ void e(AlbumPreviewUI albumPreviewUI) { AppMethodBeat.i(21437); if (albumPreviewUI.kvs) { Iterator it = albumPreviewUI.mPj.mOI.iterator(); int i = 0; int i2 = 0; while (it.hasNext()) { MediaItem mediaItem = (MediaItem) it.next(); if (mediaItem != null && mediaItem.getType() == 1) { if (26214400 < com.tencent.mm.a.e.cs(mediaItem.fPT)) { ab.w("MicroMsg.AlbumPreviewUI", "[onClick] item:%s file size:%s", mediaItem, Integer.valueOf(com.tencent.mm.a.e.cs(mediaItem.fPT))); i2++; } i++; } i = i; } if (i2 > 0) { if (i == i2) { h.bP(albumPreviewUI, albumPreviewUI.getString(R.string.c40)); AppMethodBeat.o(21437); return; } h.bP(albumPreviewUI, albumPreviewUI.getString(R.string.c3x)); } } AppMethodBeat.o(21437); } static /* synthetic */ void g(AlbumPreviewUI albumPreviewUI) { AppMethodBeat.i(21438); if (albumPreviewUI.mPj.mOI.size() > 0) { albumPreviewUI.enableOptionMenu(true); AppMethodBeat.o(21438); return; } albumPreviewUI.enableOptionMenu(false); AppMethodBeat.o(21438); } static /* synthetic */ void s(AlbumPreviewUI albumPreviewUI) { AppMethodBeat.i(21439); h.g(albumPreviewUI, R.string.f15, R.string.c4_); ab.w("MicroMsg.AlbumPreviewUI", "video is import error"); AppMethodBeat.o(21439); } static /* synthetic */ void t(AlbumPreviewUI albumPreviewUI) { AppMethodBeat.i(21440); h.g(albumPreviewUI, R.string.c49, R.string.c4_); ab.w("MicroMsg.AlbumPreviewUI", "video is over size"); AppMethodBeat.o(21440); } static /* synthetic */ void W(LinkedList linkedList) { AppMethodBeat.i(21446); if (linkedList == null) { ab.e("MicroMsg.AlbumPreviewUI", "[filterEditMediaItem] mMediaItems is null!"); AppMethodBeat.o(21446); return; } long currentTimeMillis = System.currentTimeMillis(); ab.i("MicroMsg.AlbumPreviewUI", "[filterEditMediaItem] size:%s", Integer.valueOf(linkedList.size())); ArrayList arrayList = new ArrayList(); Iterator it = linkedList.iterator(); int i = 0; while (it.hasNext()) { MediaItem mediaItem = (MediaItem) it.next(); Iterator it2 = e.bCc().iterator(); while (it2.hasNext()) { MediaItem mediaItem2 = (MediaItem) it2.next(); if (mediaItem2.mOi.equals(mediaItem.fPT)) { ab.d("MicroMsg.AlbumPreviewUI", "item:%s replace editItem:%s", mediaItem, mediaItem2); linkedList.set(i, mediaItem2); } if (mediaItem2.fPT.equals(mediaItem.fPT)) { ab.d("MicroMsg.AlbumPreviewUI", "remove editItem:%s", mediaItem2); arrayList.add(Integer.valueOf(i)); } } i++; } Iterator it3 = arrayList.iterator(); while (it3.hasNext()) { linkedList.remove(((Integer) it3.next()).intValue()); } ab.d("MicroMsg.AlbumPreviewUI", "[filterEditMediaItem] cost%s", Long.valueOf(System.currentTimeMillis() - currentTimeMillis)); AppMethodBeat.o(21446); } }
{ "pile_set_name": "Github" }
--- title: "Command - devspace status" sidebar_label: devspace status --- Show the current status ## Synopsis ``` ####################################################### ################## devspace status #################### ####################################################### ``` ## Flags ``` -h, --help help for status ``` ## Global & Inherited Flags ``` --config string The devspace config file to use --debug Prints the stack trace if an error occurs --kube-context string The kubernetes context to use -n, --namespace string The kubernetes namespace to use --no-warn If true does not show any warning when deploying into a different namespace or kube-context than before -p, --profile string The devspace profile to use (if there is any) --silent Run in silent mode and prevents any devspace log output except panics & fatals -s, --switch-context Switches and uses the last kube context and namespace that was used to deploy the DevSpace project --var strings Variables to override during execution (e.g. --var=MYVAR=MYVALUE) ```
{ "pile_set_name": "Github" }
source 'https://rubygems.org' gemspec :path => '../'
{ "pile_set_name": "Github" }
// Copyright 2013 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. (function(global, utils) { "use strict"; %CheckIsBootstrapping(); // ------------------------------------------------------------------- // Imports var GeneratorFunctionPrototype = utils.ImportNow("GeneratorFunctionPrototype"); var GeneratorFunction = utils.ImportNow("GeneratorFunction"); var GlobalFunction = global.Function; var MakeTypeError; var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); utils.Import(function(from) { MakeTypeError = from.MakeTypeError; }); // ---------------------------------------------------------------------------- // Generator functions and objects are specified by ES6, sections 15.19.3 and // 15.19.4. function GeneratorObjectNext(value) { if (!IS_GENERATOR(this)) { throw MakeTypeError(kIncompatibleMethodReceiver, '[Generator].prototype.next', this); } var continuation = %GeneratorGetContinuation(this); if (continuation > 0) { // Generator is suspended. DEBUG_PREPARE_STEP_IN_IF_STEPPING(this); return %_GeneratorNext(this, value); } else if (continuation == 0) { // Generator is already closed. return %_CreateIterResultObject(UNDEFINED, true); } else { // Generator is running. throw MakeTypeError(kGeneratorRunning); } } function GeneratorObjectReturn(value) { if (!IS_GENERATOR(this)) { throw MakeTypeError(kIncompatibleMethodReceiver, '[Generator].prototype.return', this); } var continuation = %GeneratorGetContinuation(this); if (continuation > 0) { // Generator is suspended. DEBUG_PREPARE_STEP_IN_IF_STEPPING(this); return %_GeneratorReturn(this, value); } else if (continuation == 0) { // Generator is already closed. return %_CreateIterResultObject(value, true); } else { // Generator is running. throw MakeTypeError(kGeneratorRunning); } } function GeneratorObjectThrow(exn) { if (!IS_GENERATOR(this)) { throw MakeTypeError(kIncompatibleMethodReceiver, '[Generator].prototype.throw', this); } var continuation = %GeneratorGetContinuation(this); if (continuation > 0) { // Generator is suspended. DEBUG_PREPARE_STEP_IN_IF_STEPPING(this); return %_GeneratorThrow(this, exn); } else if (continuation == 0) { // Generator is already closed. throw exn; } else { // Generator is running. throw MakeTypeError(kGeneratorRunning); } } // ---------------------------------------------------------------------------- // None of the three resume operations (Runtime_GeneratorNext, // Runtime_GeneratorReturn, Runtime_GeneratorThrow) is supported by // Crankshaft or TurboFan. Disable optimization of wrappers here. %NeverOptimizeFunction(GeneratorObjectNext); %NeverOptimizeFunction(GeneratorObjectReturn); %NeverOptimizeFunction(GeneratorObjectThrow); // Set up non-enumerable functions on the generator prototype object. var GeneratorObjectPrototype = GeneratorFunctionPrototype.prototype; utils.InstallFunctions(GeneratorObjectPrototype, DONT_ENUM, ["next", GeneratorObjectNext, "return", GeneratorObjectReturn, "throw", GeneratorObjectThrow]); %AddNamedProperty(GeneratorObjectPrototype, "constructor", GeneratorFunctionPrototype, DONT_ENUM | READ_ONLY); %AddNamedProperty(GeneratorObjectPrototype, toStringTagSymbol, "Generator", DONT_ENUM | READ_ONLY); %InternalSetPrototype(GeneratorFunctionPrototype, GlobalFunction.prototype); %AddNamedProperty(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction", DONT_ENUM | READ_ONLY); %AddNamedProperty(GeneratorFunctionPrototype, "constructor", GeneratorFunction, DONT_ENUM | READ_ONLY); %InternalSetPrototype(GeneratorFunction, GlobalFunction); })
{ "pile_set_name": "Github" }
/** * * WARNING! This file was autogenerated by: * _ _ _ _ __ __ * | | | | | | |\ \ / / * | | | | |_| | \ V / * | | | | _ | / \ * | |_| | | | |/ /^\ \ * \___/\_| |_/\/ \/ * * This file was autogenerated by UnrealHxGenerator using UHT definitions. * It only includes UPROPERTYs and UFUNCTIONs. Do not modify it! * In order to add more definitions, create or edit a type with the same name/package, but with an `_Extra` suffix **/ package unreal; @:glueCppIncludes("CoreUObject.h") @:uextern @:uclass extern class USoftClassProperty extends unreal.USoftObjectProperty { }
{ "pile_set_name": "Github" }
StartChar: uni1FAF Encoding: 8111 8111 2409 Width: 870 VWidth: 0 Flags: HM LayerCount: 2 Fore Refer: 2098 834 N 1 0 0 1 -46 100 2 Refer: 2365 -1 N 1 0 0 1 12 100 2 Refer: 2371 837 N 1 0 0 1 465 -65 2 Refer: 1133 937 N 1 0 0 1 100 0 2 Validated: 5 MultipleSubs2: "CCMP_Precomp subtable" uni03A9 uni0345.cap uni0314.grkstack uni0342 EndChar
{ "pile_set_name": "Github" }
module T14373 where data BigFam = A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P deriving (Enum, Show)
{ "pile_set_name": "Github" }
<div class="songList_item_container_artwork" ng-class="{ active: hover }" ng-mouseover="hover = true" ng-mouseleave="hover = false"> <span class="songList_item_song_button" id="{{ data.id }}" song data-song-url="{{ data.stream_url }}" data-song-thumbnail="{{ data.artwork_url }}" data-song-title="{{ data.title }}" data-song-user="{{ data.user.username }}" data-song-user-id="{{ data.user.id }}" data-song-id="{{ data.id }}"> <i class="fa fa-play"></i> <i class="fa fa-pause"></i> </span> <img ng-controller="AppCtrl" ng-src="{{ showBigArtwork (data.artwork_url) }}" onerror="if (this.src != 'public/img/logo-short.png') this.src = 'public/img/logo-short.png';" alt="{{ data.title }}" class="songList_item_artwork"> <div class="songList_item_song_social_details"> <span class="songList_comment_count"> <i class="fa fa-comments"></i>{{data.comment_count | round}} </span> <span class="songList_likes_count"> <i class="fa fa-heart"></i>{{data.likes_count || data.favoritings_count | round}} </span> <span class="songList_reposts_count" ng-if="data.reposts_count"> <i class="fa fa-retweet"></i>{{data.reposts_count | round}} </span> </div> </div> <section class="songList_item_inner"> <h2 class="songList_item_song_tit selectable-text" title="{{ data.title }}" ui-sref="track({id: {{data.id}}})">{{ data.title }}</h2> <h3 class="songList_item_song_info clearfix"> <div class="songList_item_song_user selectable-text"> <a class="pointer" ui-sref="profile({id: {{data.user.id}}})"> {{ data.user.username }} </a> <span class="songList_item_repost" ng-if="type === 'track-repost'"> <i class="fa fa-retweet"></i> <a class="pointer" ui-sref="profile({ id: {{ user.id }} })" title="Reposted by {{ user.username }}"> {{ user.username }} </a> </span> </div> <div ng-controller="AppCtrl" class="songList_item_song_length"> {{ formatSongDuration (data.duration) }} </div> </h3> <div class="songList_item_song_details"> <div class="songList_item_actions"> <a favorite-song data-song-id="{{ data.id }}" favorite="data.user_favorite" count="data.favoritings_count" ng-class="{liked: data.user_favorite}" title="{{data.user_favorite ? 'Unlike' : 'Like'}}"> <i class="fa fa-heart"></i> </a> <a reposted-song data-song-id="{{ data.id }}" reposted="data.user_reposted" ng-class="{ reposted: data.user_reposted }" title="{{data.user_reposted ? 'Unpost' : 'Repost'}}" ng-if="data.user.id !== $root.userId"> <i class="fa fa-retweet"></i> </a> <a data-song-id="{{ data.id }}" data-song-name="{{ data.title }}" playlist title="Add to playlist"> <i class="fa fa-bookmark"></i></a> <a href="{{ data.permalink_url }}" open-external target="_blank" title="Permalink"> <i class="fa fa-external-link"></i></a> <a copy-directive data-copy="{{ data.permalink_url }}" title="Copy"> <i class="fa fa-clipboard"></i></a> </div> <div class="songList_item_additional_details"> <span class="songList_item_genre" ui-sref="tag({name: data.genre})">#{{ data.genre }}</span> <span class="songList_item_license">{{ data.license }}</span> </div> </div> </section>
{ "pile_set_name": "Github" }
module.exports = require('./overSome');
{ "pile_set_name": "Github" }
<h1>Besin trafik ışıkları</h1> <p id="description">Trafik ışıkları sistemi (kırmızı, turuncu, yeşil), bir bakışta gıda ürünlerinde bulunan yağ, doymuş yağlar, şekerler ve tuz miktarını tanımlamayı olanaklı yapar.</p> <p>Bu trafik ışığı sistemi, Birleşik Krallık Gıda Standartları Ajansı (FSA) tarafından kurulmuştur. Bazı üreticiler tarafından gönüllü olarak Büyük Britanya'da kullanılmaktadır ancak 2010 yılında Avrupa Komisyonu tarafından reddedilmiştir.</p> <p>Open Food Facts'da besin değerleri bilindiğinde, trafik ışıkları ürün sayfalarında görüntülenir.</p> <p>Işıkların renklerini tanımlayan hesaplama formülü, <a href="https://www.foodwatch.org/fr/s-informer/topics/un-feu-tricolore-sur-les-etiquettes/en-savoir-plus/feu-tricolore-mode-d-emploi/">üç renkli trafik ışıkları sayfasında - Foodwatch birliğinin yönergelerinde (Fransızca)</a> açıklanmaktadır.</p> <table> <tr> <th>100 gr için</th> <th><img src="/images/misc/low_30.png" width="30" height="30" alt="az miktarda" style="vertical-align:middle;margin-right:15px;margin-bottom:4px">Az miktarda</th> <th><img src="/images/misc/moderate_30.png" width="30" height="30" alt="orta miktarda" style="vertical-align:middle;margin-right:15px;margin-bottom:4px">Orta miktarda</th> <th><img src="/images/misc/high_30.png" width="30" height="30" alt="yüksek miktarda" style="vertical-align:middle;margin-right:15px;margin-bottom:4px">Yüksek miktarda</th> </tr> <tr> <td>Lipitler</td> <td><a href="https://world.openfoodfacts.org/nutrient-level/fat-in-low-quantity">3 gr'a kadar</a></td> <td><a href="https://world.openfoodfacts.org/nutrient-level/fat-in-moderate-quantity">3 gr'dan 20 gr'a kadar</a></td> <td><a href="https://world.openfoodfacts.org/nutrient-level/fat-in-high-quantity">20 gr'dan daha çok</a></td> </tr> <tr> <td>Doymuş yağ asitleri</td> <td><a href="https://world.openfoodfacts.org/nutrient-level/saturated-fat-in-low-quantity">1.5 gr'a kadar</a></td> <td><a href="https://world.openfoodfacts.org/nutrient-level/saturated-fat-in-moderate-quantity">1.5 gr'dan 5 gr'a kadar</a></td> <td><a href="https://world.openfoodfacts.org/nutrient-level/saturated-fat-in-high-quantity">5 gr'dan daha çok</a></td> </tr> <tr> <td>Şeker</td> <td><a href="https://world.openfoodfacts.org/nutrient-level/sugars-in-low-quantity">5 gr'a kadar</a></td> <td><a href="https://world.openfoodfacts.org/nutrient-level/sugars-in-moderate-quantity">5 gr'dan 12.5 gr'a kadar</a></td> <td><a href="https://world.openfoodfacts.org/nutrient-level/sugars-in-high-quantity">12,5 gr'dan daha çok</a></td> </tr> <tr> <td>Tuz</td> <td><a href="https://world.openfoodfacts.org/nutrient-level/salt-in-low-quantity">0.3 gr'a kadar</a></td> <td><a href="https://world.openfoodfacts.org/nutrient-level/salt-in-moderate-quantity">0.3 gr'dan 1.5 gr'a kadar</a></td> <td><a href="https://world.openfoodfacts.org/nutrient-level/salt-in-high-quantity">1,5 gr'dan daha çok</a></td> </tr> </table> <p>İçecekler için tüm değerler 2'ye bölünür.</p> <br> <p>Gıda endüstrisi ya da tüketici dernekleri tarafından önerilen değişik beslenme ölçütlerinin yararları ve zararları ile ilgili daha çok bilgi edinmek için: <br> → <a href="https://www.diw.de/sixcms/media.php/73/diw_wr_2010-19.pdf">Beslenme Bilgileri: Trafik Işığı Etiketlemesi Tüketicilere Ulaşmanın En İyi Yolu</a> - Alman Ekonomik Araştırma Enstitüsü - 16 Haziran 2010 → <a href="https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/566251/FoP_Nutrition_labelling_UK_guidance.pdf">FSA web sitesinde detaylı açıklamalar</a> </p>
{ "pile_set_name": "Github" }
/*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, install, // copy or use the software. // // // License Agreement // For Open Source Computer Vision Library // // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. // Third party copyrights are property of their respective owners. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // * Redistribution's of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // * Redistribution's in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // // * The name of the copyright holders may not be used to endorse or promote products // derived from this software without specific prior written permission. // // This software is provided by the copyright holders and contributors "as is" and // any express or implied warranties, including, but not limited to, the implied // warranties of merchantability and fitness for a particular purpose are disclaimed. // In no event shall the Intel Corporation or contributors be liable for any direct, // indirect, incidental, special, exemplary, or consequential damages // (including, but not limited to, procurement of substitute goods or services; // loss of use, data, or profits; or business interruption) however caused // and on any theory of liability, whether in contract, strict liability, // or tort (including negligence or otherwise) arising in any way out of // the use of this software, even if advised of the possibility of such damage. // //M*/ #ifndef __OPENCV_VIDEOSTAB_OPTICAL_FLOW_HPP__ #define __OPENCV_VIDEOSTAB_OPTICAL_FLOW_HPP__ #include "opencv2/core.hpp" #include "opencv2/opencv_modules.hpp" #ifdef HAVE_OPENCV_CUDAOPTFLOW #include "opencv2/cudaoptflow.hpp" #endif namespace cv { namespace videostab { //! @addtogroup videostab //! @{ class CV_EXPORTS ISparseOptFlowEstimator { public: virtual ~ISparseOptFlowEstimator() {} virtual void run( InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1, OutputArray status, OutputArray errors) = 0; }; class CV_EXPORTS IDenseOptFlowEstimator { public: virtual ~IDenseOptFlowEstimator() {} virtual void run( InputArray frame0, InputArray frame1, InputOutputArray flowX, InputOutputArray flowY, OutputArray errors) = 0; }; class CV_EXPORTS PyrLkOptFlowEstimatorBase { public: PyrLkOptFlowEstimatorBase() { setWinSize(Size(21, 21)); setMaxLevel(3); } virtual void setWinSize(Size val) { winSize_ = val; } virtual Size winSize() const { return winSize_; } virtual void setMaxLevel(int val) { maxLevel_ = val; } virtual int maxLevel() const { return maxLevel_; } virtual ~PyrLkOptFlowEstimatorBase() {} protected: Size winSize_; int maxLevel_; }; class CV_EXPORTS SparsePyrLkOptFlowEstimator : public PyrLkOptFlowEstimatorBase, public ISparseOptFlowEstimator { public: virtual void run( InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1, OutputArray status, OutputArray errors); }; #ifdef HAVE_OPENCV_CUDAOPTFLOW class CV_EXPORTS SparsePyrLkOptFlowEstimatorGpu : public PyrLkOptFlowEstimatorBase, public ISparseOptFlowEstimator { public: SparsePyrLkOptFlowEstimatorGpu(); virtual void run( InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1, OutputArray status, OutputArray errors); void run(const cuda::GpuMat &frame0, const cuda::GpuMat &frame1, const cuda::GpuMat &points0, cuda::GpuMat &points1, cuda::GpuMat &status, cuda::GpuMat &errors); void run(const cuda::GpuMat &frame0, const cuda::GpuMat &frame1, const cuda::GpuMat &points0, cuda::GpuMat &points1, cuda::GpuMat &status); private: Ptr<cuda::SparsePyrLKOpticalFlow> optFlowEstimator_; cuda::GpuMat frame0_, frame1_, points0_, points1_, status_, errors_; }; class CV_EXPORTS DensePyrLkOptFlowEstimatorGpu : public PyrLkOptFlowEstimatorBase, public IDenseOptFlowEstimator { public: DensePyrLkOptFlowEstimatorGpu(); virtual void run( InputArray frame0, InputArray frame1, InputOutputArray flowX, InputOutputArray flowY, OutputArray errors); private: Ptr<cuda::DensePyrLKOpticalFlow> optFlowEstimator_; cuda::GpuMat frame0_, frame1_, flowX_, flowY_, errors_; }; #endif //! @} } // namespace videostab } // namespace cv #endif
{ "pile_set_name": "Github" }