hexsha
stringlengths
40
40
size
int64
5
1.05M
ext
stringclasses
98 values
lang
stringclasses
21 values
max_stars_repo_path
stringlengths
3
945
max_stars_repo_name
stringlengths
4
118
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
368k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
945
max_issues_repo_name
stringlengths
4
118
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
134k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
945
max_forks_repo_name
stringlengths
4
135
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
5
1.05M
avg_line_length
float64
1
1.03M
max_line_length
int64
2
1.03M
alphanum_fraction
float64
0
1
0bb3f0f811c74ffb9c0be24cd9bd7180c5abe4ce
262
js
JavaScript
src/component/Index.js
raimukul/MajorProject
414969f0e438c4375a591a9af88e39187d991098
[ "MIT" ]
null
null
null
src/component/Index.js
raimukul/MajorProject
414969f0e438c4375a591a9af88e39187d991098
[ "MIT" ]
null
null
null
src/component/Index.js
raimukul/MajorProject
414969f0e438c4375a591a9af88e39187d991098
[ "MIT" ]
null
null
null
import React from "react"; import Header from './Header/MainHeader' import Footer from './Footer' import Body from './Body' const FormPage = () => { return ( <div> <Header/> <Body/> <Footer/> </div> ); }; export default FormPage;
15.411765
40
0.587786
75b8b01bec46ff578195a64a5413285518e0b817
156
cs
C#
keypay-dotnetcore/DomainModels/V2/TimeAndAttendance/ShiftConditionSelectModel.cs
ianbrown78/keypay-dotnetcore
191ebd4210a5082988550e95207865161384a685
[ "MIT" ]
null
null
null
keypay-dotnetcore/DomainModels/V2/TimeAndAttendance/ShiftConditionSelectModel.cs
ianbrown78/keypay-dotnetcore
191ebd4210a5082988550e95207865161384a685
[ "MIT" ]
null
null
null
keypay-dotnetcore/DomainModels/V2/TimeAndAttendance/ShiftConditionSelectModel.cs
ianbrown78/keypay-dotnetcore
191ebd4210a5082988550e95207865161384a685
[ "MIT" ]
null
null
null
namespace KeyPay.DomainModels.V2.TimeAndAttendance { public class ShiftConditionSelectModel { public string ShortCode { get; set; } } }
22.285714
51
0.698718
0ab3ef8ea13592baa57efc1e59f68d9f45ef2225
1,673
go
Go
step_transform_build_json.go
bored-im/worker
6f03d6577cb14062c231011f4fd3090a32243f0c
[ "MIT" ]
null
null
null
step_transform_build_json.go
bored-im/worker
6f03d6577cb14062c231011f4fd3090a32243f0c
[ "MIT" ]
null
null
null
step_transform_build_json.go
bored-im/worker
6f03d6577cb14062c231011f4fd3090a32243f0c
[ "MIT" ]
null
null
null
package worker import ( "bytes" "fmt" "os/exec" "strings" "github.com/mitchellh/multistep" "github.com/travis-ci/worker/context" gocontext "golang.org/x/net/context" ) type stepTransformBuildJSON struct { payloadFilterExecutable string } type EnvVar struct { Name string Public bool Value string } func (s *stepTransformBuildJSON) Run(state multistep.StateBag) multistep.StepAction { buildJob := state.Get("buildJob").(Job) ctx := state.Get("ctx").(gocontext.Context) if s.payloadFilterExecutable == "" { context.LoggerFromContext(ctx).Info("skipping json transformation, no filter executable defined") return multistep.ActionContinue } context.LoggerFromContext(ctx).Info(fmt.Sprintf("calling filter executable: %s", s.payloadFilterExecutable)) payload := buildJob.RawPayload() cmd := exec.Command(s.payloadFilterExecutable) rawJson, err := payload.MarshalJSON() if err != nil { context.LoggerFromContext(ctx).Info(fmt.Sprintf("failed to marshal json: %v", err)) return multistep.ActionContinue } cmd.Stdin = strings.NewReader(string(rawJson)) var out bytes.Buffer cmd.Stdout = &out err = cmd.Run() if err != nil { context.LoggerFromContext(ctx).Info(fmt.Sprintf("failed to run filter executable: %v", err)) return multistep.ActionContinue } err = payload.UnmarshalJSON(out.Bytes()) if err != nil { context.LoggerFromContext(ctx).Info(fmt.Sprintf("failed to unmarshal json: %v", err)) return multistep.ActionContinue } context.LoggerFromContext(ctx).Info("replaced the build json") return multistep.ActionContinue } func (s *stepTransformBuildJSON) Cleanup(multistep.StateBag) { // Nothing to clean up }
24.246377
109
0.744172
ed58917039ee899b08a6a315cad4b1860dd390c8
937
sql
SQL
backend/de.metas.procurement.base/src/main/sql/postgresql/system/50-de.metas.procurement/5442310_sys_09628_pmm_purchasecandidate_pl_not_mandatory.sql
dram/metasfresh
a1b881a5b7df8b108d4c4ac03082b72c323873eb
[ "RSA-MD" ]
1,144
2016-02-14T10:29:35.000Z
2022-03-30T09:50:41.000Z
backend/de.metas.procurement.base/src/main/sql/postgresql/system/50-de.metas.procurement/5442310_sys_09628_pmm_purchasecandidate_pl_not_mandatory.sql
vestigegroup/metasfresh
4b2d48c091fb2a73e6f186260a06c715f5e2fe96
[ "RSA-MD" ]
8,283
2016-04-28T17:41:34.000Z
2022-03-30T13:30:12.000Z
backend/de.metas.procurement.base/src/main/sql/postgresql/system/50-de.metas.procurement/5442310_sys_09628_pmm_purchasecandidate_pl_not_mandatory.sql
vestigegroup/metasfresh
4b2d48c091fb2a73e6f186260a06c715f5e2fe96
[ "RSA-MD" ]
441
2016-04-29T08:06:07.000Z
2022-03-28T06:09:56.000Z
-- 11.03.2016 15:27 -- URL zum Konzept UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2016-03-11 15:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=554154 ; -- 11.03.2016 15:29 -- URL zum Konzept UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2016-03-11 15:29:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=554149 ; COMMIT; -- 11.03.2016 15:29 -- URL zum Konzept INSERT INTO t_alter_column values('pmm_qtyreport_event','M_PriceList_ID','NUMERIC(10)',null,'NULL') ; -- 11.03.2016 15:29 -- URL zum Konzept INSERT INTO t_alter_column values('pmm_qtyreport_event','M_PriceList_ID',null,'NULL',null) ; -- 11.03.2016 15:28 -- URL zum Konzept INSERT INTO t_alter_column values('pmm_purchasecandidate','M_PriceList_ID','NUMERIC(10)',null,'NULL') ; -- 11.03.2016 15:28 -- URL zum Konzept INSERT INTO t_alter_column values('pmm_purchasecandidate','M_PriceList_ID',null,'NULL',null) ;
28.393939
144
0.744931
f9b41e60d7a210df02f17ef29359c7de570d4dfa
6,239
go
Go
cmd/task.go
Hyperpilotio/node-agent
a1d7b1bdd3a2b7f582c038cb101da996a66ffc0a
[ "Apache-2.0" ]
1
2018-03-11T21:35:06.000Z
2018-03-11T21:35:06.000Z
cmd/task.go
Hyperpilotio/node-agent
a1d7b1bdd3a2b7f582c038cb101da996a66ffc0a
[ "Apache-2.0" ]
null
null
null
cmd/task.go
Hyperpilotio/node-agent
a1d7b1bdd3a2b7f582c038cb101da996a66ffc0a
[ "Apache-2.0" ]
null
null
null
package main import ( "errors" "fmt" "strings" "time" "github.com/gobwas/glob" "github.com/hyperpilotio/node-agent/pkg/analyzer" "github.com/hyperpilotio/node-agent/pkg/collector" "github.com/hyperpilotio/node-agent/pkg/common" "github.com/hyperpilotio/node-agent/pkg/processor" "github.com/hyperpilotio/node-agent/pkg/snap" log "github.com/sirupsen/logrus" ) type PublishConfig struct { Publisher []*HyperpilotPublisher AnalyzerPublisher []*HyperpilotPublisher } type HyperpilotTask struct { Task *common.NodeTask Id string Collector collector.Collector Processor processor.Processor Analyzer analyzer.Analyzer PublishConfig *PublishConfig CollectMetrics []snap.Metric FailureCount int64 Agent *NodeAgent } func NewHyperpilotTask( task *common.NodeTask, id string, allMetricTypes []snap.Metric, collector collector.Collector, processor processor.Processor, analyzer analyzer.Analyzer, agent *NodeAgent) (*HyperpilotTask, error) { var pubs []*HyperpilotPublisher for _, pubId := range *task.Publish { p, ok := agent.Publishers[pubId] if ok { log.Infof("Publisher {%s} is loaded for Task {%s}", pubId, task.Id) pubs = append(pubs, p) } else { log.Warnf("Publisher {%s} is not loaded, skip", pubId) } } var analyzerPubs []*HyperpilotPublisher if task.Analyze != nil { for _, pubId := range *task.Analyze.Publish { p, ok := agent.Publishers[pubId] if ok { log.Infof("Publisher {%s} is loaded for Task {%s}", pubId, task.Id) analyzerPubs = append(analyzerPubs, p) } else { log.Warnf("Publisher {%s} is not loaded, skip", pubId) } } } metricPatterns := []glob.Glob{} for name := range task.Collect.Metrics { pattern, err := glob.Compile(name) if err != nil { return nil, errors.New(fmt.Sprintf("Unable to compile collect namespace {%s}: ", name, err.Error())) } metricPatterns = append(metricPatterns, pattern) } cmts := getCollectMetricTypes(metricPatterns, allMetricTypes, task.Collect) if len(cmts) == 0 { errMsg := fmt.Sprintf("No metric match namespace for %s, no metrics are needed to collect", task.Id) log.Warnf(errMsg) return nil, errors.New(errMsg) } return &HyperpilotTask{ Task: task, Id: id, Collector: collector, Processor: processor, Analyzer: analyzer, PublishConfig: &PublishConfig{ Publisher: pubs, AnalyzerPublisher: analyzerPubs, }, CollectMetrics: cmts, Agent: agent, }, nil } func (task *HyperpilotTask) Run() { waitTime, err := time.ParseDuration(task.Task.Schedule.Interval) if err != nil { log.Warnf("Parse schedule interval {%s} fail, use default interval 5 seconds", task.Task.Schedule.Interval, err.Error()) waitTime = 5 * time.Second } tick := time.Tick(waitTime) go func() { for { select { case <-tick: metrics, err := task.collect() if err != nil { task.FailureCount++ log.Warnf("collect metric fail for %s, skip this time: %s", task.Task.Id, err.Error()) task.reportError(err) continue } if task.Processor != nil { metrics, err = task.process(metrics, task.Task.Process.Config) if err != nil { task.FailureCount++ task.reportError(err) log.Warnf("process metric fail for %s, skip this time: %s", task.Task.Id, err.Error()) continue } } for _, publish := range task.PublishConfig.Publisher { publish.Put(metrics) } // Because analyze will be written to another database, // so the code as publish below, to avoid analyze error, // snap or snapaverage did not successfully write data if task.Analyzer != nil { derivedMetrics, err := task.analyze(metrics, task.Task.Analyze.Config) if err != nil { task.FailureCount++ task.reportError(err) log.Warnf("analyze metric fail for %s, skip this time: %s", task.Task.Id, err.Error()) continue } for _, publish := range task.PublishConfig.AnalyzerPublisher { if len(derivedMetrics) > 0 { publish.Put(derivedMetrics) } } } } } }() } func getCollectMetricTypes( metricPatterns []glob.Glob, allMetricTypes []snap.Metric, collect *common.Collect) []snap.Metric { collectMetricTypes := []snap.Metric{} for _, mt := range allMetricTypes { mt.Config = collect.Config namespace := mt.Namespace.String() matchNamespace := false for _, pattern := range metricPatterns { if pattern.Match(namespace) { collectMetricTypes = append(collectMetricTypes, mt) matchNamespace = true break } } if !matchNamespace { for name, _ := range collect.Metrics { if strings.HasPrefix(name, namespace) { collectMetricTypes = append(collectMetricTypes, mt) break } } } } return collectMetricTypes } func addTags(tags map[string]map[string]string, mts []snap.Metric) []snap.Metric { if len(tags) == 0 { return mts } newMts := []snap.Metric{} for _, mt := range mts { if mt.Tags == nil { mt.Tags = map[string]string{} } namespace := "/" + strings.Join(mt.Namespace.Strings(), "/") for prefix, entries := range tags { if strings.HasPrefix(namespace, prefix) { for k, v := range entries { mt.Tags[k] = v } } } newMts = append(newMts, mt) } return newMts } func (task *HyperpilotTask) collect() ([]snap.Metric, error) { collectMetrics, err := task.Collector.CollectMetrics(task.CollectMetrics) if err != nil { return nil, fmt.Errorf("Unable to collect metrics for %s: %s", task.Id, err.Error()) } return addTags(task.Task.Collect.Tags, collectMetrics), nil } func (task *HyperpilotTask) process(mts []snap.Metric, cfg snap.Config) ([]snap.Metric, error) { return task.Processor.Process(mts, cfg) } func (task *HyperpilotTask) analyze(mts []snap.Metric, cfg snap.Config) ([]snap.Metric, error) { return task.Analyzer.Analyze(mts, cfg) } func (task *HyperpilotTask) reportError(err error) { report := common.TaskReport{ Id: task.Id, Plugin: task.Task.Process.PluginName, LastErrorMsg: err.Error(), LastErrorTime: time.Now().UnixNano() / 1000000, FailureCount: task.FailureCount, } task.Agent.UpdateTaskReport(report) }
26.662393
103
0.668857
ae6a593069946245d8efdbdf3fa5154d73f64672
2,366
swift
Swift
Demo/Pods/ModelMapper/Sources/Transform+Dictionary.swift
teameh/Moya-ModelMapper
df501170080dd7c2298245ac492189b39637af58
[ "MIT" ]
1,261
2015-12-01T18:20:07.000Z
2022-02-03T21:47:41.000Z
Demo/Pods/ModelMapper/Sources/Transform+Dictionary.swift
teameh/Moya-ModelMapper
df501170080dd7c2298245ac492189b39637af58
[ "MIT" ]
121
2015-12-02T02:23:49.000Z
2022-03-28T10:28:39.000Z
Demo/Pods/ModelMapper/Sources/Transform+Dictionary.swift
teameh/Moya-ModelMapper
df501170080dd7c2298245ac492189b39637af58
[ "MIT" ]
128
2015-12-01T19:41:06.000Z
2022-03-30T20:23:25.000Z
import Foundation extension Transform { /// A provided transformation function (see Transform and Mapper for uses) in order to create a dictionary /// from an array of values. The idea for this is to create a dictionary based on an array of values, /// using a custom function to extract the key used in the dictionary /// /// Example: /// /// // An enum with all possible HintIDs /// enum HintID: String { /// ... /// } /// /// // A hint struct, which consists of an id and some text /// struct Hint: Mappable { /// let id: HintID /// let text: String /// /// init(map: Mapper) throws { /// try id = map.from("id") /// try text = map.from("text") /// } /// } /// /// // An object that manages all the hints /// struct HintCoordinator: Mappable { /// private let hints: [HintID: Hint] /// /// ... /// /// init(map: Mapper) throws { /// // Use the `toDictionary` transformation to create a map of `Hint`s by their `HintID`s /// try hints = map.from("hints", transformation: Transform.toDictionary { $0.id }) /// } /// } /// /// - parameter key: A function to extract the key U from an instance of the Mappable object T /// - parameter object: The object to attempt to produce the objects and dictionary from, this is /// Any? to allow uses with transformations (see Mapper) /// /// - throws: MapperError.convertibleError if the given object is not an array of NSDictionarys /// /// - returns: A dictionary of [U: T] where the keys U are produced from the passed `key` function and the /// values T are the objects public static func toDictionary<T, U>(key getKey: @escaping (T) -> U) -> (_ object: Any) throws -> [U: T] where T: Mappable { return { object in guard let objects = object as? [NSDictionary] else { throw MapperError.convertibleError(value: object, type: [NSDictionary].self) } var dictionary: [U: T] = [:] for object in objects { let model = try T(map: Mapper(JSON: object)) dictionary[getKey(model)] = model } return dictionary } } }
36.96875
110
0.559172
81a6cadb40eb293df929be98ddb1aa091264fe52
2,033
dart
Dart
lib/ui/pages/floor_map/map.dart
HackRU/OneAppFlutter
38c9d19914bca457e01a615c0b27f279fc868aae
[ "MIT" ]
25
2019-03-05T12:59:26.000Z
2022-02-15T11:11:17.000Z
lib/ui/pages/floor_map/map.dart
HackRU/OneAppFlutter
38c9d19914bca457e01a615c0b27f279fc868aae
[ "MIT" ]
47
2019-02-20T06:51:10.000Z
2022-03-17T02:19:50.000Z
lib/ui/pages/floor_map/map.dart
HackRU/OneAppFlutter
38c9d19914bca457e01a615c0b27f279fc868aae
[ "MIT" ]
15
2019-01-31T20:00:10.000Z
2021-08-17T00:35:59.000Z
// import 'package:HackRU/styles.dart'; // import 'package:HackRU/defaults.dart'; // import 'package:HackRU/ui/widgets/loading_indicator.dart'; // import 'package:HackRU/ui/widgets/transparent_image.dart'; // import 'package:flutter/material.dart'; // import 'package:pinch_zoom_image_updated/pinch_zoom_image_updated.dart'; // class HackRUMap extends StatefulWidget { // @override // _HackRUMapState createState() => _HackRUMapState(); // } // class _HackRUMapState extends State<HackRUMap> { // @override // Widget build(BuildContext context) { // var currentOrientation = MediaQuery.of(context).orientation; // return Scaffold( // backgroundColor: Theme.of(context).scaffoldBackgroundColor, // body: Container( // color: MediaQuery.of(context).platformBrightness == Brightness.light // ? white // : charcoal, // alignment: Alignment(0, 0), // child: PinchZoomImage( // image: currentOrientation == Orientation.portrait // ? Stack( // children: <Widget>[ // Center(child: FancyLoadingIndicator()), // Center( // child: FadeInImage.memoryNetwork( // placeholder: kTransparentImage, // image: FLOOR_MAP_VER, // ), // ), // ], // ) // : Stack( // children: <Widget>[ // Center(child: FancyLoadingIndicator()), // Center( // child: FadeInImage.memoryNetwork( // placeholder: kTransparentImage, // image: FLOOR_MAP_HOR, // ), // ), // ], // ), // zoomedBackgroundColor: Color.fromRGBO(255, 255, 255, 1.0), // hideStatusBarWhileZooming: false, // ), // ), // ); // } // }
36.303571
79
0.510576
af4773ccb42bce1e5e47e43fb778c167e9a4049f
2,484
rb
Ruby
spec/dynamodb/http_handler_spec.rb
groupme/dynamodb
e0da90599b58929300576f97f501ff9dde80a63b
[ "Unlicense" ]
3
2015-02-07T05:10:54.000Z
2021-03-30T17:38:47.000Z
spec/dynamodb/http_handler_spec.rb
groupme/dynamodb
e0da90599b58929300576f97f501ff9dde80a63b
[ "Unlicense" ]
null
null
null
spec/dynamodb/http_handler_spec.rb
groupme/dynamodb
e0da90599b58929300576f97f501ff9dde80a63b
[ "Unlicense" ]
null
null
null
require "spec_helper" describe DynamoDB::HttpHandler do describe "#handle" do let(:http_handler) { DynamoDB::HttpHandler.new } let(:request) { stub(DynamoDB::Request, uri: URI("https://dynamo.local/"), headers: {}, body: "{}" ) } it "performs an HTTP request given a DynamoDB::Request" do http_request = stub_request(:post, "https://dynamo.local/").to_return(status: 200) http_handler.handle(request) http_request.should have_been_requested end it "returns a DynamoDB::SuccessResponse for successes" do stub_request(:post, "https://dynamo.local/").to_return(status: 200) response = http_handler.handle(request) response.should be_an_instance_of(DynamoDB::SuccessResponse) response.should be_success end it "returns a DynamoDB::Response for failures" do stub_request(:post, "https://dynamo.local/").to_return(status: 500, body: "Server errors") response = http_handler.handle(request) response.should be_an_instance_of(DynamoDB::FailureResponse) response.should_not be_success end it "returns a DynamoDB::Response for network errors" do error = Errno::ECONNRESET.new stub_request(:post, "https://dynamo.local/").to_raise(error) response = http_handler.handle(request) response.should be_an_instance_of(DynamoDB::FailureResponse) response.should_not be_success response.error.should == error response.body.should be_nil end it "respects a custom timeout option (set on initialize)" do stub_request(:post, "https://dynamo.local/").to_return(status: 200) connection = Net::HTTP::ConnectionPool::Connection.any_instance connection.should_receive(:read_timeout=).with(5) http_handler.handle(request) end end describe "#build_http_request" do it "converts a DynamoDB::Request into a Net::HTTP::Post" do request = stub(DynamoDB::Request, uri: URI("https://dynamo.local/"), headers: {"content-type" => "application/json"}, body: "POST body" ) http_handler = DynamoDB::HttpHandler.new http_request = http_handler.build_http_request(request) http_request.should be_an_instance_of(Net::HTTP::Post) http_request.path.should == "https://dynamo.local/" http_request["content-type"].should == "application/json" http_request.body.should == "POST body" end end end
34.5
96
0.677939
dbc8179d66af237924de5945c94b2d45c527d0a7
118
dart
Dart
another_authenticator/lib/state/state.dart
KadriyeMacit/Flutter-My-works
ea493f63814b78dd7466a90703c98ecd44c6c181
[ "MIT" ]
27
2019-02-11T12:40:42.000Z
2022-03-23T17:21:04.000Z
another_authenticator/lib/state/state.dart
KadriyeMacit/Flutter-My-works
ea493f63814b78dd7466a90703c98ecd44c6c181
[ "MIT" ]
8
2019-03-09T12:14:32.000Z
2021-09-30T10:37:32.000Z
another_authenticator/lib/state/state.dart
KadriyeMacit/Flutter-My-works
ea493f63814b78dd7466a90703c98ecd44c6c181
[ "MIT" ]
12
2019-03-09T11:44:59.000Z
2021-12-16T10:18:12.000Z
export './repository.dart'; export './repository_base.dart'; export './app_state.dart'; export './file_storage.dart';
23.6
32
0.728814
d9bf1cff22b92b40fa52b14e8bcd33419f079968
2,659
rs
Rust
mayastor/tests/nexus_child_location.rs
dyasny/Mayastor
94579aaa164ed144ffd7851e599cb24c693a649f
[ "Apache-2.0" ]
null
null
null
mayastor/tests/nexus_child_location.rs
dyasny/Mayastor
94579aaa164ed144ffd7851e599cb24c693a649f
[ "Apache-2.0" ]
null
null
null
mayastor/tests/nexus_child_location.rs
dyasny/Mayastor
94579aaa164ed144ffd7851e599cb24c693a649f
[ "Apache-2.0" ]
null
null
null
use mayastor::{ bdev::{nexus_create, nexus_lookup}, core::MayastorCliArgs, }; use rpc::mayastor::{BdevShareRequest, BdevUri, Null}; pub mod common; use common::{compose::Builder, MayastorTest}; static NEXUS_NAME: &str = "child_location_nexus"; #[tokio::test] async fn child_location() { // create a new composeTest let test = Builder::new() .name("child_location_test") .network("10.1.0.0/16") .add_container("ms1") .with_clean(true) .build() .await .unwrap(); // Use GRPC handles to invoke methods on containers let mut hdls = test.grpc_handles().await.unwrap(); // Create and share a bdev over nvmf hdls[0].bdev.list(Null {}).await.unwrap(); hdls[0] .bdev .create(BdevUri { uri: "malloc:///disk0?size_mb=100".into(), }) .await .unwrap(); hdls[0] .bdev .share(BdevShareRequest { name: "disk0".into(), proto: "nvmf".into(), }) .await .unwrap(); // Create and share a bdev over iscsi hdls[0] .bdev .create(BdevUri { uri: "malloc:///disk1?size_mb=100".into(), }) .await .unwrap(); hdls[0] .bdev .share(BdevShareRequest { name: "disk1".into(), proto: "iscsi".into(), }) .await .unwrap(); let mayastor = MayastorTest::new(MayastorCliArgs::default()); mayastor .spawn(async move { // Create a nexus with a local child, and two remote children (one // exported over nvmf and the other over iscsi). nexus_create( NEXUS_NAME, 1024 * 1024 * 50, None, &[ "malloc:///malloc0?blk_size=512&size_mb=100".into(), format!( "nvmf://{}:8420/nqn.2019-05.io.openebs:disk0", hdls[0].endpoint.ip() ), format!( "iscsi://{}:3260/iqn.2019-05.io.openebs:disk1/0", hdls[0].endpoint.ip() ), ], ) .await .unwrap(); let nexus = nexus_lookup(NEXUS_NAME).expect("Failed to find nexus"); let children = &nexus.children; assert_eq!(children.len(), 3); assert!(children[0].is_local().unwrap()); assert!(!children[1].is_local().unwrap()); assert!(!children[2].is_local().unwrap()); }) .await; }
27.989474
80
0.485521
25590c64a31cb43b500e128f886e4933802a5d2e
2,701
html
HTML
quirks/table-cell-nowrap-minimum-width-calculation.html
meyerweb/wpt
f04261533819893c71289614c03434c06856c13e
[ "BSD-3-Clause" ]
14,668
2015-01-01T01:57:10.000Z
2022-03-31T23:33:32.000Z
quirks/table-cell-nowrap-minimum-width-calculation.html
meyerweb/wpt
f04261533819893c71289614c03434c06856c13e
[ "BSD-3-Clause" ]
7,642
2018-05-28T09:38:03.000Z
2022-03-31T20:55:48.000Z
quirks/table-cell-nowrap-minimum-width-calculation.html
meyerweb/wpt
f04261533819893c71289614c03434c06856c13e
[ "BSD-3-Clause" ]
5,941
2015-01-02T11:32:21.000Z
2022-03-31T16:35:46.000Z
<!doctype html> <html> <head> <title>The table cell nowrap minimum width calculation quirk</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <style> iframe { width:200px; height:20px; } </style> </head> <body> <div id=log></div> <iframe id=quirks></iframe> <iframe id=almost></iframe> <iframe id=standards></iframe> <script> setup({explicit_done:true}); var png = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg=="; var preload = new Image(); preload.src = png; onload = function() { var html = "<style id=style></style>"; var a_doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'; var s_doctype = '<!DOCTYPE HTML>'; var q = document.getElementById('quirks').contentWindow; var a = document.getElementById('almost').contentWindow; var s = document.getElementById('standards').contentWindow; q.document.open(); q.document.write(html); q.document.close(); a.document.open(); a.document.write(a_doctype + html); a.document.close(); s.document.open(); s.document.write(s_doctype + html); s.document.close(); [q, a, s].forEach(function(win) { ['style', 'test', 'ref', 's_ref'].forEach(function(id) { Object.getPrototypeOf(win).__defineGetter__(id, function() { return win.document.getElementById(id); }); }); }); q.title = 'quirks mode'; a.title = 'almost standards mode'; s.title = 'standards mode'; var tests = [ {desc:"basic", style:'table { width:8px } #test { width:10px }', body:'<table><tr><td id=test nowrap></table>'+ '<table><tr><td id=ref><img src="{png}" width=10></table>'+ '<table><tr><td id=s_ref></table>'}, ]; tests.forEach(function(t) { test(function() { var style = t.style.replace(/\{png\}/g, png); var body = t.body.replace(/\{png\}/g, png); [q, a, s].forEach(function(win) { win.style.textContent = style; win.document.body.innerHTML = body; assert_equals(win.getComputedStyle(win.test).width, win.getComputedStyle(win == q ? win.ref : win.s_ref).width, win.title); }); }, document.title+', '+t.desc); }); done(); } </script> </body> </html>
37
131
0.55609
e95f6eb112e4c8ea7a35c116a43dde40ec61762e
5,749
rs
Rust
src/core/src/components/edit/mod.rs
jgarte/git-interactive-rebase-tool
ec70cf284743ebdbe69c659bfd31915d155aaacc
[ "DOC" ]
null
null
null
src/core/src/components/edit/mod.rs
jgarte/git-interactive-rebase-tool
ec70cf284743ebdbe69c659bfd31915d155aaacc
[ "DOC" ]
null
null
null
src/core/src/components/edit/mod.rs
jgarte/git-interactive-rebase-tool
ec70cf284743ebdbe69c659bfd31915d155aaacc
[ "DOC" ]
null
null
null
#[cfg(test)] mod tests; use display::DisplayColor; use input::{Event, EventHandler, InputOptions, KeyCode, KeyEvent, KeyModifiers}; use lazy_static::lazy_static; use unicode_segmentation::UnicodeSegmentation; use view::{LineSegment, ViewData, ViewLine}; lazy_static! { static ref INPUT_OPTIONS: InputOptions = InputOptions::new(); } pub(crate) struct Edit { content: String, cursor_position: usize, description: Option<String>, finished: bool, label: Option<String>, view_data: ViewData, } impl Edit { pub(crate) fn new() -> Self { let view_data = ViewData::new(|updater| { updater.set_show_title(true); }); Self { content: String::from(""), cursor_position: 0, description: None, finished: false, label: None, view_data, } } pub(crate) fn get_view_data(&mut self) -> &ViewData { let line = self.content.as_str(); let pointer = self.cursor_position; let graphemes = UnicodeSegmentation::graphemes(line, true); let start = graphemes.clone().take(pointer).collect::<String>(); let indicator = graphemes.clone().skip(pointer).take(1).collect::<String>(); let end = graphemes.skip(pointer + 1).collect::<String>(); let mut segments = vec![]; if let Some(label) = self.label.as_ref() { segments.push(LineSegment::new_with_color_and_style( label.as_str(), DisplayColor::Normal, true, false, false, )); } if !start.is_empty() { segments.push(LineSegment::new(start.as_str())); } segments.push( if indicator.is_empty() { LineSegment::new_with_color_and_style(" ", DisplayColor::Normal, false, true, false) } else { LineSegment::new_with_color_and_style(indicator.as_str(), DisplayColor::Normal, false, true, false) }, ); if !end.is_empty() { segments.push(LineSegment::new(end.as_str())); } let description = self.description.as_ref(); self.view_data.update_view_data(|updater| { updater.clear(); if let Some(desc) = description { updater.push_leading_line(ViewLine::from(vec![LineSegment::new_with_color( desc.as_str(), DisplayColor::IndicatorColor, )])); updater.push_leading_line(ViewLine::new_empty_line()); } updater.push_line(ViewLine::from(segments)); updater.push_trailing_line(ViewLine::new_pinned(vec![LineSegment::new_with_color( "Enter to finish", DisplayColor::IndicatorColor, )])); updater.ensure_column_visible(pointer); updater.ensure_line_visible(0); }); &self.view_data } pub(crate) fn handle_event(&mut self, event_handler: &EventHandler) -> Event { let event = event_handler.read_event(&INPUT_OPTIONS, |event, _| event); match event { Event::Key(KeyEvent { code: KeyCode::Backspace, modifiers: KeyModifiers::NONE, }) => { if self.cursor_position != 0 { let start = UnicodeSegmentation::graphemes(self.content.as_str(), true) .take(self.cursor_position - 1) .collect::<String>(); let end = UnicodeSegmentation::graphemes(self.content.as_str(), true) .skip(self.cursor_position) .collect::<String>(); self.content = format!("{}{}", start, end); self.cursor_position -= 1; } }, Event::Key(KeyEvent { code: KeyCode::Delete, modifiers: KeyModifiers::NONE, }) => { let length = UnicodeSegmentation::graphemes(self.content.as_str(), true).count(); if self.cursor_position != length { let start = UnicodeSegmentation::graphemes(self.content.as_str(), true) .take(self.cursor_position) .collect::<String>(); let end = UnicodeSegmentation::graphemes(self.content.as_str(), true) .skip(self.cursor_position + 1) .collect::<String>(); self.content = format!("{}{}", start, end); } }, Event::Key(KeyEvent { code: KeyCode::Home, modifiers: KeyModifiers::NONE, }) => self.cursor_position = 0, Event::Key(KeyEvent { code: KeyCode::End, modifiers: KeyModifiers::NONE, }) => self.cursor_position = UnicodeSegmentation::graphemes(self.content.as_str(), true).count(), Event::Key(KeyEvent { code: KeyCode::Right, modifiers: KeyModifiers::NONE, }) => { let length = UnicodeSegmentation::graphemes(self.content.as_str(), true).count(); if self.cursor_position < length { self.cursor_position += 1; } }, Event::Key(KeyEvent { code: KeyCode::Left, modifiers: KeyModifiers::NONE, }) => { if self.cursor_position != 0 { self.cursor_position -= 1; } }, Event::Key(KeyEvent { code: KeyCode::Enter, modifiers: KeyModifiers::NONE, }) => self.finished = true, Event::Key(KeyEvent { code: KeyCode::Char(c), modifiers: KeyModifiers::NONE | KeyModifiers::SHIFT, }) => { let start = UnicodeSegmentation::graphemes(self.content.as_str(), true) .take(self.cursor_position) .collect::<String>(); let end = UnicodeSegmentation::graphemes(self.content.as_str(), true) .skip(self.cursor_position) .collect::<String>(); self.content = format!("{}{}{}", start, c, end); self.cursor_position += 1; }, _ => {}, } event } pub(crate) fn set_description(&mut self, description: &str) { self.description = Some(String::from(description)); } pub(crate) fn set_label(&mut self, label: &str) { self.label = Some(String::from(label)); } pub(crate) fn set_content(&mut self, content: &str) { self.content = String::from(content); self.cursor_position = UnicodeSegmentation::graphemes(content, true).count(); } pub(crate) fn clear(&mut self) { self.content.clear(); self.cursor_position = 0; self.finished = false; } pub(crate) const fn is_finished(&self) -> bool { self.finished } pub(crate) fn get_content(&self) -> String { self.content.clone() } }
28.460396
103
0.662898
24a3a952be00f5e0e624f5c57f0c1fa1702270c2
416
asm
Assembly
programs/oeis/093/A093379.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/093/A093379.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/093/A093379.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A093379: Expansion of x(1-2x-2x^2)/((1+x)(1-2x)(1-3x)). ; 0,1,2,5,12,31,82,225,632,1811,5262,15445,45652,135591,404042,1206665,3609072,10805371,32372422,97029885,290914892,872395151,2616486402,7848061105,23541387112,70618568931,211844521982,635511196325 seq $0,254365 ; a(n) = 2^(n+2) + 3^n + 10. div $0,2 add $0,3 mov $2,1 seq $2,74929 ; a(n)>0 such that p(n)*p(n+1)-a(n) is a maximal square. div $0,$2 sub $0,1
37.818182
197
0.692308
b5d8ee8b585f41931285e1c90c1080893314b177
2,584
sql
SQL
references/nepworld_nepworld_user.sql
NaresGC/Nepworld
5acf3a5ef4c36949cff4ed9c70e8ace9aba31d19
[ "BSD-3-Clause" ]
1
2018-06-08T13:17:27.000Z
2018-06-08T13:17:27.000Z
references/nepworld_nepworld_user.sql
Anil-Adhikari/nepworld
0901d788aa61d6953c400018d7b148321c7f50d1
[ "BSD-3-Clause" ]
null
null
null
references/nepworld_nepworld_user.sql
Anil-Adhikari/nepworld
0901d788aa61d6953c400018d7b148321c7f50d1
[ "BSD-3-Clause" ]
null
null
null
CREATE DATABASE IF NOT EXISTS `nepworld` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `nepworld`; -- MySQL dump 10.13 Distrib 5.5.59, for debian-linux-gnu (x86_64) -- -- Host: 127.0.0.1 Database: nepworld -- ------------------------------------------------------ -- Server version 5.5.59-0ubuntu0.14.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `nepworld_user` -- DROP TABLE IF EXISTS `nepworld_user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `nepworld_user` ( `userId` int(11) NOT NULL AUTO_INCREMENT, `npw_user_firstname` varchar(100) NOT NULL, `npw_user_lastname` varchar(100) NOT NULL, `npw_user_address` varchar(250) NOT NULL, `npw_user_email` varchar(255) NOT NULL, `npw_user_username` varchar(100) NOT NULL, `npw_user_authkey` varchar(32) NOT NULL, `npw_user_password` varchar(255) NOT NULL, `npw_user_password_hash` varchar(255) DEFAULT NULL, `npw_user_password_reset_token` varchar(255) DEFAULT NULL, `npw_user_status` smallint(6) NOT NULL, `npw_user_created_at` datetime NOT NULL, `npw_user_updated_at` datetime NOT NULL, `npw_user_geolocation` varchar(45) DEFAULT NULL, PRIMARY KEY (`userId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `nepworld_user` -- LOCK TABLES `nepworld_user` WRITE; /*!40000 ALTER TABLE `nepworld_user` DISABLE KEYS */; /*!40000 ALTER TABLE `nepworld_user` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2018-01-31 14:19:12
39.753846
83
0.727941
f1c41104d974c1152b1bc1e17036ae6c9b9927d0
502
asm
Assembly
addressing.asm
tor4z/nasm_training
0d7be19c9ff66ca7972e6270388a385c85829814
[ "Unlicense" ]
null
null
null
addressing.asm
tor4z/nasm_training
0d7be19c9ff66ca7972e6270388a385c85829814
[ "Unlicense" ]
null
null
null
addressing.asm
tor4z/nasm_training
0d7be19c9ff66ca7972e6270388a385c85829814
[ "Unlicense" ]
null
null
null
global _start section .data name db 'Zara Ali', 0xa nameLen equ $-name section .text _start: ; Output name mov eax, 4 mov ebx, 1 mov ecx, name mov edx, nameLen int 0x80 ; Change the name value mov [name], dword 'Nuha' ; Output the new name mov eax, 4 mov ebx, 1 mov ecx, name mov edx, nameLen int 0x80 ; Exit mov eax, 1 mov ebx, 0 int 0x80 ; Type Specifier Bytes addressed ; BYTE 1 ; WORD 2 ; DWORD 4 ; QWORD 8 ; TBYTE 10
14.764706
32
0.595618
bf056ae7d6f7c5e0d98e8461ac54d8fb016ba57b
45
sql
SQL
test/fixtures/parser/mysql/force_key.sql
NathanHowell/sqlfluff
9eb30226d77727cd613947e144a0abe483151f18
[ "MIT" ]
3,024
2020-10-01T11:03:51.000Z
2022-03-31T16:42:00.000Z
test/fixtures/parser/mysql/force_key.sql
NathanHowell/sqlfluff
9eb30226d77727cd613947e144a0abe483151f18
[ "MIT" ]
2,395
2020-09-30T12:59:21.000Z
2022-03-31T22:05:29.000Z
test/fixtures/parser/mysql/force_key.sql
NathanHowell/sqlfluff
9eb30226d77727cd613947e144a0abe483151f18
[ "MIT" ]
246
2020-10-02T17:08:03.000Z
2022-03-30T17:43:51.000Z
SELECT * FROM onetable FORCE KEY (idx_index);
45
45
0.777778
e40f3b6312fb335db599ba7df525e07e308e585f
917
go
Go
webserver_test.go
juan-medina/self-deploy
ff79718679bcfe3403482a0adca84c6c3fe8653c
[ "Apache-2.0" ]
4
2020-01-06T13:09:28.000Z
2020-01-08T12:12:44.000Z
webserver_test.go
juan-medina/self-deploy
ff79718679bcfe3403482a0adca84c6c3fe8653c
[ "Apache-2.0" ]
null
null
null
webserver_test.go
juan-medina/self-deploy
ff79718679bcfe3403482a0adca84c6c3fe8653c
[ "Apache-2.0" ]
null
null
null
package main import ( "net/http" "net/http/httptest" "strconv" "testing" ) func TestRandom(t *testing.T) { server := NewServer() response := httptest.NewRecorder() request, _ := http.NewRequest(http.MethodGet, "/random", nil) server.ServeHTTP(response, request) got := response.Code want := http.StatusOK if got != want { t.Errorf("did not get correct status, got %d, want %d", got, want) } body := response.Body.String() _, err := strconv.ParseInt(body, 10, 64) if err != nil { t.Errorf("we didn't get a number, got '%s', error was %s", body, err) } } func TestNotFound(t *testing.T) { server := NewServer() response := httptest.NewRecorder() request, _ := http.NewRequest(http.MethodGet, "/not/found", nil) server.ServeHTTP(response, request) got := response.Code want := http.StatusNotFound if got != want { t.Errorf("did not get correct status, got %d, want %d", got, want) } }
22.925
71
0.667394
ee73b21478154d171d48f784eec8c419fa096bad
768
kt
Kotlin
src/main/kotlin/com/qd/portal/edi/database/model/Attachment.kt
XPlay1990/QD-Software-Backend
87e4a9581d9a8173b3f7ef1fa6cd7b7f36b0a4b9
[ "MIT" ]
null
null
null
src/main/kotlin/com/qd/portal/edi/database/model/Attachment.kt
XPlay1990/QD-Software-Backend
87e4a9581d9a8173b3f7ef1fa6cd7b7f36b0a4b9
[ "MIT" ]
null
null
null
src/main/kotlin/com/qd/portal/edi/database/model/Attachment.kt
XPlay1990/QD-Software-Backend
87e4a9581d9a8173b3f7ef1fa6cd7b7f36b0a4b9
[ "MIT" ]
null
null
null
package com.qd.portal.edi.database.model import com.fasterxml.jackson.annotation.JsonIgnore import javax.persistence.Entity import javax.persistence.GeneratedValue import javax.persistence.GenerationType import javax.persistence.Id /** * Copyright (C) 2019-2019 Jan Adamczyk <j_adamczyk@hotmail.com> * * Created: 21.06.19 * This file is part of ediportal * * This Code can not be copied and/or distributed without the express * permission of Jan Adamczyk */ @Entity data class Attachment( var fileName: String, var fileType: String, var fileSize: Long // @JsonIgnore // @Lob // var Attachment: ByteArray ) { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @JsonIgnore val id: Long = 0 }
22.588235
69
0.707031
4b00893039624336f9814b17a85500769aa90b6c
4,701
go
Go
meta/meta.go
ionous/sashimi
9034458fa291bd56a3860c5b157acd33a409acb0
[ "MIT" ]
3
2017-01-25T04:07:16.000Z
2019-01-05T15:11:08.000Z
meta/meta.go
ionous/sashimi
9034458fa291bd56a3860c5b157acd33a409acb0
[ "MIT" ]
1
2015-05-22T20:20:38.000Z
2015-05-22T20:20:38.000Z
meta/meta.go
ionous/sashimi
9034458fa291bd56a3860c5b157acd33a409acb0
[ "MIT" ]
null
null
null
package meta import "github.com/ionous/sashimi/util/ident" type Instance Prototype type Class Prototype type Model interface { NumAction() int ActionNum(int) Action GetAction(ident.Id) (Action, bool) NumEvent() int EventNum(int) Event GetEvent(ident.Id) (Event, bool) NumClass() int ClassNum(int) Class GetClass(ident.Id) (Class, bool) NumInstance() int InstanceNum(int) Instance GetInstance(ident.Id) (Instance, bool) NumRelation() int RelationNum(int) Relation GetRelation(ident.Id) (Relation, bool) NumParserAction() int ParserActionNum(int) ParserAction Pluralize(string) string AreCompatible(child, parent ident.Id) bool MatchNounName(string, func(ident.Id) bool) (tries int, err bool) } type Action interface { GetId() ident.Id // GetActionName returns the original name given by the scripter. GetActionName() string // GetEvent: raised by this action when the action occurs. GetEvent() Event // GetNouns: the classes for required by the action. GetNouns() Nouns // GetCallbacks() (Callbacks, bool) } type Callbacks interface { NumCallback() int CallbackNum(int) ident.Id } type Event interface { GetId() ident.Id // GetEventName returns the original name given by the scripter. GetEventName() string // GetListeners returns the capture or bubbling callbacks associated with this event // if GetListeners returns false, Listeners should be set to NoListeners. GetListeners(capture bool) (Listeners, bool) } type Listeners interface { NumListener() int ListenerNum(int) Listener } type NoListeners [0]Listener func (no NoListeners) NumListener() int { return len(no) } func (no NoListeners) ListenerNum(i int) Listener { return no[i] // panics } type Listener interface { // GetInstance can return Empty() GetInstance() ident.Id // GetClass always returns a valid class id. GetClass() ident.Id // GetCallback() returns a valid callback id. GetCallback() ident.Id // GetOptions() CallbackOptions } type CallbackOptions int const ( UseTargetOnly CallbackOptions = 1 << iota UseAfterQueue ) func (opt CallbackOptions) UseTargetOnly() bool { return opt&UseTargetOnly != 0 } func (opt CallbackOptions) UseAfterQueue() bool { return opt&UseAfterQueue != 0 } // Prototype holds properties; it supports both instance and class type things. type Prototype interface { GetId() ident.Id //?GetType() -> class or instance // GetParentClass returns empty id for classes if no parent; // panics if no class can be found for an instance. GetParentClass() ident.Id GetOriginalName() string NumProperty() int PropertyNum(int) Property // FindProperty by its user given name. FindProperty(string) (Property, bool) // GetProperty by the property unique id. GetProperty(ident.Id) (Property, bool) // GetPropertyByChoice evalutes all properties to find an enumeration which can store the passed choice GetPropertyByChoice(ident.Id) (Property, bool) } type Relation interface { GetId() ident.Id } type PropertyType int const ( InvalidProperty PropertyType = iota NumProperty // float64 TextProperty // string StateProperty // string.Id ObjectProperty // string.Id ArrayProperty = 1 << 16 ) type Property interface { GetId() ident.Id GetName() string GetType() PropertyType //GetObjectType()? // or maybe IsCompatible(inst) bool GetValue() Value GetValues() Values // GetRelative returns false if there is no relation, for example: a pure array or object value. GetRelative() (Relative, bool) } type Relative struct { Relation ident.Id // Relation Relates ident.Id // Relates class From ident.Id // From property } // get and set panic if the value is not of the requested type; set can return error when the value, when of the correct type, violates a property constraint type Value interface { GetNum() float64 SetNum(float64) error GetText() string SetText(string) error GetState() ident.Id SetState(ident.Id) error GetObject() ident.Id SetObject(ident.Id) error SetRelation(ident.Id) error } type Values interface { NumValue() int ValueNum(int) Value ClearValues() error AppendNum(float64) error AppendText(string) error AppendObject(ident.Id) error // RemoveValue(int)? // Slice? } // NOTE: ParserActions aren't id'd, so they are represented as structs. type ParserAction struct { Action ident.Id Commands []string } type NounType int const ( SourceNoun NounType = iota TargetNoun ContextNoun ) // a list of nouns type Nouns []ident.Id func (n Nouns) GetNounCount() int { return len(n) } func (n Nouns) Get(t NounType) (ret ident.Id) { if int(t) < len(n) { ret = n[t] } return ret }
21.763889
157
0.731972
8ebf2208d7e5c96103d66c46c815fdb7468134bd
337
asm
Assembly
programs/oeis/013/A013753.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/013/A013753.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/013/A013753.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A013753: a(n) = 13^(3*n + 2). ; 169,371293,815730721,1792160394037,3937376385699289,8650415919381337933,19004963774880799438801,41753905413413116367045797,91733330193268616658399616009,201538126434611150798503956371773,442779263776840698304313192148785281 mov $1,2197 pow $1,$0 mul $1,2 div $1,4392 mul $1,371124 add $1,169 mov $0,$1
30.636364
225
0.816024
8d98185395c376cbdc3735181605392293535736
4,410
lua
Lua
game/Thlib/background/starlight/starlight.lua
BAKAOLC/LuaSTG-LuaData
6434004ea9cb6ff1105a31e93ed40c26b7665537
[ "MIT" ]
null
null
null
game/Thlib/background/starlight/starlight.lua
BAKAOLC/LuaSTG-LuaData
6434004ea9cb6ff1105a31e93ed40c26b7665537
[ "MIT" ]
null
null
null
game/Thlib/background/starlight/starlight.lua
BAKAOLC/LuaSTG-LuaData
6434004ea9cb6ff1105a31e93ed40c26b7665537
[ "MIT" ]
null
null
null
starlight_background=Class(object) function starlight_background:init() -- background.init(self,false) --resource LoadTexture('starlight_ground','THlib\\background\\starlight\\ground.png') LoadImage('starlight_ground','starlight_ground',0,0,256,256,0,0) LoadTexture('starlight','THlib\\background\\starlight\\starlight.png') LoadImage('noir','starlight',488,0,22,512,0,0) SetImageCenter('noir',12,512) LoadImage('star1','starlight',0,0,256,256,0,0) LoadImage('star2','starlight',0,256,320,256,0,0) LoadImageFromFile('stair','THlib\\background\\starlight\\stair.png') LoadImageFromFile('window','THlib\\background\\starlight\\windows.png') SetImageState('noir','mul+add') SetImageState('star1','mul+add') SetImageState('star2','mul+add') SetImageState('stair','mul+alpha',Color(255,255,255,255)) --set 3d camera and fog Set3D('eye',-1.9,-3.3,-8.6) Set3D('at',-0.4,0.9,2.5) Set3D('up',1.24,1.1,0.1) Set3D('z',2.1,1000) Set3D('fovy',0.7) Set3D('fog',7,1000,Color(200,10,10,27)) -- self.list={} self.liststart=1 self.listend=0 self.imgs={'noir','star1','star2','stair'} self.speed=0.1 self.interval=0.5 self.acc=self.interval self.angle=0 self.z=0 for i=1,1000 do starlight_background.frame(self) end for j=1,500 do local z=-3+0.04*self.angle self.listend=self.listend+1 self.list[self.listend]={4,self.angle,0,0,0,z} self.angle=self.angle+10 end end rnd=math.random function starlight_background:frame() self.z=self.z+self.speed/2 ---Set3D('eye',3.35*cos(self.timer/4),3.35*sin(self.timer/4),-8.6) ---Set3D('up',2*sin(self.timer/20),1.1,0.1) self.acc=self.acc+self.speed if self.acc>=self.interval then self.acc=self.acc-self.interval self.acc=self.acc-self.interval local a=0 local R=rnd(1.4,60) for _=1,3 do a=rnd(0,360) x=R*cos(a) y=2+R*sin(a) self.listend=self.listend+1 self.list[self.listend]={rnd(2,3), x,y,rnd()*0.6-0.3,-0.7-0.3*rnd(),rnd(-1,100)} end ---if self.timer%2==0 then local z=-3+0.04*self.angle self.listend=self.listend+1 self.list[self.listend]={4,self.angle,0,0,0,z} self.angle=self.angle+10 ---end end for i=self.liststart,self.listend do if self.list[i][1]~=4 then self.list[i][6]=self.list[i][6]-self.speed else self.list[i][6]=self.list[i][6]-self.speed/4 end end while true do if self.list[self.liststart][6]<-6 then self.list[self.liststart]=nil self.liststart=self.liststart+1 else break end if self.list[self.liststart][1]==4 then if self.list[self.liststart][6]>4 then self.list[self.liststart]=nil self.liststart=self.liststart+1 else break end end end end function starlight_background:render() SetViewMode'3d' local showboss = IsValid(_boss) if showboss then PostEffectCapture() end RenderClear(lstg.view3d.fog[3]) for j=0,20 do local dz=j*40-math.mod(self.z,40) -- starlight_background.draw_windows(0,0,-5+dz,35+dz) end for i=self.listend,self.liststart,-1 do local p=self.list[i] if p[1]~=4 then -- Render(self.imgs[p[1]],p[2]+rnd(-0.1,0.1),p[3]+rnd(-0.1,0.1),p[4]*57,p[5]/2,abs(p[5]/2),p[6]) Render(self.imgs[p[1]],p[2],p[3],p[4]*57,p[5]/2,abs(p[5]/2),p[6]) else -- Render_4_point(p[2],6,10,2,'stair',p[6]) end end if showboss then local x,y = WorldToScreen(_boss.x,_boss.y) local x1 = x * screen.scale local y1 = (screen.height - y) * screen.scale local fxr = _boss.fxr or 163 local fxg = _boss.fxg or 73 local fxb = _boss.fxb or 164 PostEffectApply("boss_distortion", "", { centerX = x1, centerY = y1, size = _boss.aura_alpha*200*lstg.scale_3d, color = Color(125,fxr,fxg,fxb), colorsize = _boss.aura_alpha*200*lstg.scale_3d, arg=1500*_boss.aura_alpha/128*lstg.scale_3d, timer = self.timer }) end SetViewMode'world' end function Render_4_point(angle,r,angle_offset,r_,imagename,z) local A_1 = angle+angle_offset local R_1 = r-r_ local x1,x2,x3,x4,y1,y2,y3,y4 x1=(r)*cos(A_1) y1=(r)*sin(A_1) x2=(r)*cos(angle) y2=(r)*sin(angle) x3=(R_1)*cos(angle) y3=(R_1)*sin(angle) x4=(R_1)*cos(A_1) y4=(R_1)*sin(A_1) Render4V(imagename,x1,y1,z,x2,y2,z,x3,y3,z,x4,y4,z) end function starlight_background.draw_windows(x,y,z1,z2) local r=45 local a=0 for _=1,12 do Render4V('window', x+r*cos(a-15),y+r*sin(a-15),z1, x+r*cos(a+15),y+r*sin(a+15),z1, x+r*cos(a+15),y+r*sin(a+15),z2, x+r*cos(a-15),y+r*sin(a-15),z2) a=a+30 end end
25.789474
98
0.675057
7503ee0555cbea8fd95e953803d2160d9fb0b0e4
5,820
cs
C#
src/M5x.Consul/Client/GetRequest.cs
rgfaber/m5x-sdk
271a94b9f00d1f7fc6c448caf700cb54185a7a93
[ "MIT" ]
2
2021-11-25T09:54:22.000Z
2021-12-02T16:28:42.000Z
src/M5x.Consul/Client/GetRequest.cs
rgfaber/m5x-sdk
271a94b9f00d1f7fc6c448caf700cb54185a7a93
[ "MIT" ]
1
2022-01-11T15:58:27.000Z
2022-01-14T14:16:10.000Z
src/M5x.Consul/Client/GetRequest.cs
rgfaber/m5x-sdk
271a94b9f00d1f7fc6c448caf700cb54185a7a93
[ "MIT" ]
null
null
null
using System; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Threading; using System.Threading.Tasks; using M5x.Consul.Utilities; namespace M5x.Consul.Client; public class GetRequest<TOut> : ConsulRequest { public GetRequest(ConsulClient.ConsulClient client, string url, QueryOptions options = null) : base(client, url, HttpMethod.Get) { if (string.IsNullOrEmpty(url)) throw new ArgumentException(nameof(url)); Options = options ?? QueryOptions.Default; } public QueryOptions Options { get; set; } public async Task<QueryResult<TOut>> Execute(CancellationToken ct) { Client.CheckDisposed(); Timer.Start(); var result = new QueryResult<TOut>(); var message = new HttpRequestMessage(HttpMethod.Get, BuildConsulUri(Endpoint, Params)); ApplyHeaders(message, Client.Config); var response = await Client.HttpClient.SendAsync(message, ct).ConfigureAwait(false); ParseQueryHeaders(response, result); result.StatusCode = response.StatusCode; ResponseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); if (response.StatusCode != HttpStatusCode.NotFound && !response.IsSuccessStatusCode) { if (ResponseStream == null) throw new ConsulRequestException($"Unexpected response, status code {response.StatusCode}", response.StatusCode); using (var sr = new StreamReader(ResponseStream)) { throw new ConsulRequestException( $"Unexpected response, status code {response.StatusCode}: {sr.ReadToEnd()}", response.StatusCode); } } if (response.IsSuccessStatusCode) result.Response = Deserialize<TOut>(ResponseStream); result.RequestTime = Timer.Elapsed; Timer.Stop(); return result; } public async Task<QueryResult<Stream>> ExecuteStreaming(CancellationToken ct) { Client.CheckDisposed(); Timer.Start(); var result = new QueryResult<Stream>(); var message = new HttpRequestMessage(HttpMethod.Get, BuildConsulUri(Endpoint, Params)); ApplyHeaders(message, Client.Config); var response = await Client.HttpClient.SendAsync(message, HttpCompletionOption.ResponseHeadersRead, ct) .ConfigureAwait(false); ParseQueryHeaders(response, result as QueryResult<TOut>); result.StatusCode = response.StatusCode; ResponseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); result.Response = ResponseStream; if (response.StatusCode != HttpStatusCode.NotFound && !response.IsSuccessStatusCode) throw new ConsulRequestException($"Unexpected response, status code {response.StatusCode}", response.StatusCode); result.RequestTime = Timer.Elapsed; Timer.Stop(); return result; } protected override void ApplyOptions(ConsulClientConfiguration clientConfig) { if (Options == QueryOptions.Default) return; if (!string.IsNullOrEmpty(Options.Datacenter)) Params["dc"] = Options.Datacenter; switch (Options.Consistency) { case ConsistencyMode.Consistent: Params["consistent"] = string.Empty; break; case ConsistencyMode.Stale: Params["stale"] = string.Empty; break; case ConsistencyMode.Default: break; } if (Options.WaitIndex != 0) Params["index"] = Options.WaitIndex.ToString(); if (Options.WaitTime.HasValue) Params["wait"] = Options.WaitTime.Value.ToGoDuration(); if (!string.IsNullOrEmpty(Options.Near)) Params["near"] = Options.Near; } protected void ParseQueryHeaders(HttpResponseMessage res, QueryResult<TOut> meta) { var headers = res.Headers; if (headers.Contains("X-Consul-Index")) try { meta.LastIndex = ulong.Parse(headers.GetValues("X-Consul-Index").First()); } catch (Exception ex) { throw new ConsulRequestException("Failed to parse X-Consul-Index", res.StatusCode, ex); } if (headers.Contains("X-Consul-LastContact")) try { meta.LastContact = TimeSpan.FromMilliseconds(ulong.Parse(headers.GetValues("X-Consul-LastContact").First())); } catch (Exception ex) { throw new ConsulRequestException("Failed to parse X-Consul-LastContact", res.StatusCode, ex); } if (headers.Contains("X-Consul-KnownLeader")) try { meta.KnownLeader = bool.Parse(headers.GetValues("X-Consul-KnownLeader").First()); } catch (Exception ex) { throw new ConsulRequestException("Failed to parse X-Consul-KnownLeader", res.StatusCode, ex); } if (headers.Contains("X-Consul-Translate-Addresses")) try { meta.AddressTranslationEnabled = bool.Parse(headers.GetValues("X-Consul-Translate-Addresses").First()); } catch (Exception ex) { throw new ConsulRequestException("Failed to parse X-Consul-Translate-Addresses", res.StatusCode, ex); } } protected override void ApplyHeaders(HttpRequestMessage message, ConsulClientConfiguration clientConfig) { if (!string.IsNullOrEmpty(Options.Token)) message.Headers.Add("X-Consul-Token", Options.Token); } }
36.603774
116
0.619416
91edc897518d398a980b077108de278b7d224b84
136
asm
Assembly
test/chars.asm
AndreLaranjeira/AssemblyTranslator
376dbbb8ad6b7daff216ae633d10725ac2771fa6
[ "MIT" ]
null
null
null
test/chars.asm
AndreLaranjeira/AssemblyTranslator
376dbbb8ad6b7daff216ae633d10725ac2771fa6
[ "MIT" ]
4
2018-11-16T13:22:23.000Z
2018-11-27T00:49:09.000Z
test/chars.asm
AndreLaranjeira/AssemblyTranslator
376dbbb8ad6b7daff216ae633d10725ac2771fa6
[ "MIT" ]
null
null
null
SECTION TEXT C_INPUT LETRA LOAD CONT LOOP: C_OUTPUT LETRA SUB UM JMPP LOOP STOP SECTION DATA CONT: CONST 10 UM: CONST 1 LETRA: CONST 61h
12.363636
20
0.794118
fb7852d4268db71cbd97592fa093dc77ecb2ed79
11,029
java
Java
src/com/vaadin/addon/pagination/Pagination.java
wangyingchu/AdminCenter_InfoDiscover
a2d34bc8fc44394b1a25d442ef19d649772ab9cf
[ "Apache-2.0" ]
null
null
null
src/com/vaadin/addon/pagination/Pagination.java
wangyingchu/AdminCenter_InfoDiscover
a2d34bc8fc44394b1a25d442ef19d649772ab9cf
[ "Apache-2.0" ]
null
null
null
src/com/vaadin/addon/pagination/Pagination.java
wangyingchu/AdminCenter_InfoDiscover
a2d34bc8fc44394b1a25d442ef19d649772ab9cf
[ "Apache-2.0" ]
null
null
null
package com.vaadin.addon.pagination; import java.util.ArrayList; import java.util.List; import com.vaadin.data.Property; import com.vaadin.data.validator.IntegerRangeValidator; import com.vaadin.event.ShortcutAction; import com.vaadin.event.ShortcutListener; import com.vaadin.server.FontAwesome; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.ComboBox; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.TextField; import com.vaadin.ui.themes.ValoTheme; /** * Created by basakpie on 2016-10-10. */ @SuppressWarnings("unused") public class Pagination extends HorizontalLayout { private static final long serialVersionUID = 1L; final List<PaginationChangeListener> listeners = new ArrayList<>(); private PaginationResource paginationResource; HorizontalLayout itemsPerPage; HorizontalLayout pageControls; final ComboBox itemsPerPageSelect = new ComboBox(); TextField currentPageTextField = new TextField(); final Label totalPageLabel = new Label(); final Button firstButton = new Button(FontAwesome.ARROW_CIRCLE_LEFT); final Button previousButton = new Button(FontAwesome.ARROW_CIRCLE_O_LEFT); final Button nextButton = new Button(FontAwesome.ARROW_CIRCLE_O_RIGHT); final Button lastButton = new Button(FontAwesome.ARROW_CIRCLE_RIGHT); public Pagination() { } public Pagination(PaginationResource paginationResource) { setWidth("100%"); setSpacing(true); init(paginationResource); } protected void init(PaginationResource resource) { if(getComponentCount()>0) { removeAllComponents(); } paginationResource = resource; itemsPerPage = createItemsPerPage(); pageControls = createPageControlFields(); addComponents(itemsPerPage, pageControls); setComponentAlignment(pageControls, Alignment.MIDDLE_RIGHT); setExpandRatio(pageControls, 1); buttonsEnabled(); } public void setItemsPerPage(int... perPage) { if(itemsPerPageSelect.size()>0) { itemsPerPageSelect.removeAllItems(); } for(int i=0; i < perPage.length; i++) { itemsPerPageSelect.addItem(perPage[i]); } itemsPerPageSelect.select(this.paginationResource.limit()); if(!itemsPerPageSelect.isSelected(this.paginationResource.limit())) { throw new IllegalArgumentException("itemsPerPageSelect.isSelected(paginationResource.size()) not found!"); } } public void setTotalCount(long total) { paginationResource.setTotal(total); totalPageLabel.setValue(String.valueOf(paginationResource.totalPage())); } public void setItemsPerPageEnabled(boolean enabled) { itemsPerPage.setEnabled(enabled); } public void setItemsPerPageVisible(boolean enabled) { itemsPerPage.setVisible(enabled); setPageControlsAlignment(Alignment.MIDDLE_CENTER); } public void addPageChangeListener(PaginationChangeListener listener) { listeners.add(listener); } public void removePageChangeListener(PaginationChangeListener listener) { listeners.remove(listener); } public void removeAllPageChangeListener() { listeners.clear(); } public void setCurrentPage(int page) { currentPageTextField.setValue(String.valueOf(page)); } public int getCurrentPage(){ return Integer.parseInt(currentPageTextField.getValue()); } public void firstClick() { firstButton.click(); } public void previousClick() { previousButton.click(); } public void nextClick() { nextButton.click(); } public void lastClick() { lastButton.click(); } private void setItemsPerPageAlignment(Alignment alignment) { setComponentAlignment(itemsPerPage, alignment); } private void setPageControlsAlignment(Alignment alignment) { setComponentAlignment(pageControls, alignment); } private HorizontalLayout createItemsPerPage() { final Label itemsPerPageLabel = new Label("&nbsp;Items per page", ContentMode.HTML); itemsPerPageSelect.setTextInputAllowed(false); itemsPerPageSelect.setImmediate(true); itemsPerPageSelect.setNullSelectionAllowed(false); itemsPerPageSelect.setWidth("80px"); itemsPerPageSelect.setStyleName(ValoTheme.COMBOBOX_SMALL); itemsPerPageSelect.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { int pageSize = (Integer)event.getProperty().getValue(); if(pageSize== paginationResource.limit()) return; paginationResource.setLimit((Integer)event.getProperty().getValue()); paginationResource.setPage(1); firePagedChangedEvent(); } }); final HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); layout.addComponents(itemsPerPageLabel, itemsPerPageSelect); return layout; } @SuppressWarnings("serial") private HorizontalLayout createPageControlFields() { firstButton.setStyleName(ValoTheme.BUTTON_LINK); previousButton.setStyleName(ValoTheme.BUTTON_LINK); nextButton.setStyleName(ValoTheme.BUTTON_LINK); lastButton.setStyleName(ValoTheme.BUTTON_LINK); firstButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent clickEvent) { PaginationResource first = paginationResource.first(); buttonClickEvent(first); } }); previousButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent clickEvent) { PaginationResource previous = paginationResource.previous(); buttonClickEvent(previous); } }); nextButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent clickEvent) { PaginationResource next = paginationResource.next(); buttonClickEvent(next); } }); lastButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent clickEvent) { PaginationResource last = paginationResource.last(); buttonClickEvent(last); } }); HorizontalLayout pageFields = createPageFields(); final HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); layout.addComponents(firstButton, previousButton, pageFields, nextButton, lastButton); return layout; } @SuppressWarnings("serial") private HorizontalLayout createPageFields() { currentPageTextField.setValue(String.valueOf(paginationResource.page())); currentPageTextField.setConverter(Integer.class); final IntegerRangeValidator validator = new IntegerRangeValidator("Wrong page number", 0, paginationResource.totalPage()); currentPageTextField.addValidator(validator); currentPageTextField.setStyleName(ValoTheme.TEXTFIELD_SMALL); currentPageTextField.setImmediate(true); currentPageTextField.addShortcutListener(new ShortcutListener("Enter", ShortcutAction.KeyCode.ENTER, null) { @Override public void handleAction(Object sender, Object target) { currentPageChangedEvent(); } }); currentPageTextField.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { currentPageChangedEvent(); } }); currentPageTextField.setWidth("50px"); currentPageTextField.setStyleName(ValoTheme.TEXTFIELD_SMALL); final Label pageLabel = new Label("Page&nbsp;", ContentMode.HTML); final Label sepLabel = new Label("&nbsp;/&nbsp;", ContentMode.HTML); totalPageLabel.setValue(String.valueOf(this.paginationResource.totalPage())); final HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); layout.addComponents(pageLabel, currentPageTextField, sepLabel, totalPageLabel); layout.setComponentAlignment(pageLabel, Alignment.MIDDLE_LEFT); layout.setComponentAlignment(currentPageTextField, Alignment.MIDDLE_LEFT); layout.setComponentAlignment(sepLabel, Alignment.MIDDLE_LEFT); layout.setComponentAlignment(totalPageLabel, Alignment.MIDDLE_LEFT); return layout; } protected void currentPageChangedEvent() { String currentPageStringValue=currentPageTextField.getValue(); currentPageStringValue=currentPageStringValue.replaceAll(",",""); int currentPage = Integer.valueOf(String.valueOf(currentPageStringValue)); int pageNumber = paginationResource.page(); if (!currentPageTextField.isValid()) return; if (currentPage==pageNumber) return; paginationResource.setPage(currentPage); firePagedChangedEvent(); } protected void buttonClickEvent(PaginationResource change) { paginationResource.setTotal(change.total()); paginationResource.setPage(change.page()); paginationResource.setLimit(change.limit()); paginationResource.setInitIndex(change.initIndex()); firePagedChangedEvent(); } protected void firePagedChangedEvent() { buttonsEnabled(); currentPageTextField.setValue(String.valueOf(paginationResource.page())); totalPageLabel.setValue(String.valueOf(paginationResource.totalPage())); if (listeners != null) { for(int i =0; i < listeners.size(); i++) { PaginationChangeListener listener = listeners.get(i); listener.changed(paginationResource); } } } protected void buttonsEnabled() { firstButton.setEnabled(!this.paginationResource.isFirst()); previousButton.setEnabled(this.paginationResource.hasPrevious()); nextButton.setEnabled(this.paginationResource.hasNext()); lastButton.setEnabled(!this.paginationResource.isLast()); } protected Button getFirstButton() { return this.firstButton; } protected Button getPreButton() { return this.previousButton; } protected Button getNextButton() { return this.nextButton; } protected Button getLastButton() { return this.lastButton; } protected PaginationResource getPaginationResource() { return this.paginationResource; } }
35.925081
130
0.684196
d2bdd296e5c33a6153a199e78e84dfd1f8e1eac0
3,592
php
PHP
model/classFuncionario.php
gulgis/route-78
3bed34c946f8718f155942972a0a72737005b779
[ "MIT" ]
null
null
null
model/classFuncionario.php
gulgis/route-78
3bed34c946f8718f155942972a0a72737005b779
[ "MIT" ]
null
null
null
model/classFuncionario.php
gulgis/route-78
3bed34c946f8718f155942972a0a72737005b779
[ "MIT" ]
null
null
null
<?php include '../DAO/DaoFuncionario.php'; class Funcionario { //private $codFuncionario; private $nome; private $sexo; private $cpf; private $registroGeral; private $telefone; private $email; private $login; private $senha; private $situacao; private $tipoFuncionario; public function __construct($nome, $sexo, $cpf, $registroGeral, $telefone, $email, $login, $senha, $situacao, $tipoFuncionario) { $this -> setNome($nome); $this -> setSexo($sexo); $this -> setCpf($cpf); $this -> setRegistroGeral($registroGeral); $this -> setTelefone($telefone); $this -> setEmail($email); $this -> setLogin($login); $this -> setSenha($senha); $this -> setSituacao($situacao); $this -> setTipoFuncionario($tipoFuncionario); } /** * @return mixed */ public function getCodFuncionario() { return $this->codFuncionario; } /** * @param mixed $codFuncionario */ public function setCodFuncionario($codFuncionario) { $this->codFuncionario = $codFuncionario; } /** * @return mixed */ public function getTipoFuncionario() { return $this->tipoFuncionario; } /** * @param mixed $tipoFuncionario */ public function setTipoFuncionario($tipoFuncionario) { $this->tipoFuncionario = $tipoFuncionario; } /** * @return string */ public function getNome() { return $this->nome; } public function setNome($nome){ $this->nome = $nome; } /** * @return string */ public function getSexo() { return $this->sexo; } /** * @param string $sexo */ public function setSexo($sexo) { $this->sexo = $sexo; } /** * @return mixed */ public function getCpf() { return $this->cpf; } /** * @param mixed $cpf */ public function setCpf($cpf) { $this->cpf = $cpf; } /** * @return mixed */ public function getRegistroGeral() { return $this->registroGeral; } /** * @param mixed $registroGeral */ public function setRegistroGeral($registroGeral) { $this->registroGeral = $registroGeral; } /** * @return mixed */ public function getTelefone() { return $this->telefone; } /** * @param mixed $telefone */ public function setTelefone($telefone) { $this->telefone = $telefone; } /** * @return mixed */ public function getEmail() { return $this->email; } /** * @param mixed $email */ public function setEmail($email) { $this->email = $email; } /** * @return mixed */ public function getLogin() { return $this->login; } /** * @param mixed $login */ public function setLogin($login) { $this->login = $login; } /** * @return mixed */ public function getSenha() { return $this->senha; } /** * @param mixed $senha */ public function setSenha($senha) { $this->senha = $senha; } /** * @return mixed */ public function getSituacao() { return $this->situacao; } /** * @param mixed $situacao */ public function setSituacao($situacao) { $this->situacao = $situacao; } }
17.023697
131
0.514477
52211e84437701727ef95bf16bad004b35131f37
5,177
go
Go
thc.go
oliwer/thc
487a65ba734ac249c6e152fdfc7f3ad7c10745ba
[ "MIT" ]
3
2018-03-23T15:02:16.000Z
2019-08-09T05:29:18.000Z
thc.go
oliwer/thc
487a65ba734ac249c6e152fdfc7f3ad7c10745ba
[ "MIT" ]
null
null
null
thc.go
oliwer/thc
487a65ba734ac249c6e152fdfc7f3ad7c10745ba
[ "MIT" ]
null
null
null
/* Package thc is a thin wrapper around Go's http.Client package which provides: Metrics THC exports metrics of your requests using expvar. You can observe average times for DNS lookups, TLS handshakes, TCP sessions and more. Circuit breaker After a defined number of consecutive failures, THC will switch to an *out of service* state. In this state, the client will stop sending HTTP requests and instead will return the error ErrOutOfService. It is up to the application to decide what to do in that case. After a predefined amount of time, the service will be restored and THC will resume to work normally. */ package thc import ( "errors" "expvar" "io" "net/http" "net/url" "strings" "sync/atomic" "time" "github.com/paulbellamy/ratecounter" ) // ErrOutOfService is returned by the client when the maximum number // of consecutive errors (MaxErrors) has been attained, and no HTTP // request has been performed. var ErrOutOfService = errors.New("HTTP client out of service") const defaultHealingTime = 10 * time.Second // THC - Timed HTTP Client. Implements the same interface as Go's http.Client. type THC struct { // The HTTP client to use. Defaults to Go's HTTP client. Client *http.Client // Name is the prefix used for publishing expvars. Default: "thc". Name string // Number of errors after which the client becomes out of service. // Zero means never. Default: 0. MaxErrors int32 // Lifespan of the out of service state. No HTTP requests are performed // in this state. Default: 10s. HealingTime time.Duration errorCounter int32 metrics Metrics } // Do sends an HTTP request and returns an HTTP response, following policy // (such as redirects, cookies, auth) as configured on the client. func (c *THC) Do(req *http.Request) (*http.Response, error) { if c.MaxErrors > 0 && atomic.LoadInt32(&c.errorCounter) >= c.MaxErrors { return nil, ErrOutOfService } // Set defaults. if c.Client == nil { c.Client = http.DefaultClient } if c.HealingTime == 0 { c.HealingTime = defaultHealingTime } if c.metrics.DNSLookup == nil { // User forgot to call PublishExpvar() c.PublishExpvar() } ctx := withTracing(req.Context(), &c.metrics) req = req.WithContext(ctx) res, err := c.Client.Do(req) if c.MaxErrors > 0 { if err != nil || res.StatusCode >= 500 { // Become out of service if we have reached MaxErrors if atomic.AddInt32(&c.errorCounter, 1) == c.MaxErrors { c.metrics.OutOfService.Incr(1) // Restore the service after some time. go func() { time.Sleep(c.HealingTime) atomic.StoreInt32(&c.errorCounter, 0) }() } } else { // No error. Reset the counter to zero. atomic.StoreInt32(&c.errorCounter, 0) } } return res, err } // Get issues a GET to the specified URL. func (c *THC) Get(url string) (resp *http.Response, err error) { req, err := http.NewRequest(http.MethodGet, url, nil) if err != nil { return nil, err } return c.Do(req) } // Head issues a HEAD to the specified URL. func (c *THC) Head(url string) (resp *http.Response, err error) { req, err := http.NewRequest(http.MethodHead, url, nil) if err != nil { return nil, err } return c.Do(req) } // Post issues a POST to the specified URL. func (c *THC) Post(url string, contentType string, body io.Reader) (resp *http.Response, err error) { req, err := http.NewRequest(http.MethodPost, url, body) if err != nil { return nil, err } req.Header.Set("Content-Type", contentType) return c.Do(req) } // PostForm issues a POST to the specified URL, // with data's keys and values URL-encoded as the request body. func (c *THC) PostForm(url string, data url.Values) (resp *http.Response, err error) { return c.Post(url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) } // PublishExpvar will publish all the metrics for a THC instance. // This method should be called from the `init` function in your program.` // The metrics' names are prefixed with the Name specified in the THC object. // Exported metrics: // <name>-dns-lookup // <name>-tcp-connection // <name>-tls-handshake // <name>-get-connection // <name>-write-request // <name>-get-response // <name>-outofservice func (c *THC) PublishExpvar() { const rate = 1 * time.Minute n := c.Name if n == "" { n = "thc" } c.metrics.DNSLookup = ratecounter.NewAvgRateCounter(rate) expvar.Publish(n+"-dns-lookup", c.metrics.DNSLookup) c.metrics.TCPConnection = ratecounter.NewAvgRateCounter(rate) expvar.Publish(n+"-tcp-connection", c.metrics.TCPConnection) c.metrics.TLSHandshake = ratecounter.NewAvgRateCounter(rate) expvar.Publish(n+"-tls-handshake", c.metrics.TLSHandshake) c.metrics.GetConnection = ratecounter.NewAvgRateCounter(rate) expvar.Publish(n+"-get-connection", c.metrics.GetConnection) c.metrics.WriteRequest = ratecounter.NewAvgRateCounter(rate) expvar.Publish(n+"-write-request", c.metrics.WriteRequest) c.metrics.GetResponse = ratecounter.NewAvgRateCounter(rate) expvar.Publish(n+"-get-response", c.metrics.GetResponse) c.metrics.OutOfService = ratecounter.NewRateCounter(1 * time.Hour) expvar.Publish(n+"-outofservice", c.metrics.OutOfService) }
29.248588
101
0.717211
6b24ba67d948a8e52d4223b0c948596cffb35f71
3,002
html
HTML
tmp/cache/wiktionary/klein_en_wikitext.html
MarkRosemaker/academy
f4c88a49403eff0627b3ce517670ab7f990ec9ba
[ "MIT" ]
null
null
null
tmp/cache/wiktionary/klein_en_wikitext.html
MarkRosemaker/academy
f4c88a49403eff0627b3ce517670ab7f990ec9ba
[ "MIT" ]
null
null
null
tmp/cache/wiktionary/klein_en_wikitext.html
MarkRosemaker/academy
f4c88a49403eff0627b3ce517670ab7f990ec9ba
[ "MIT" ]
null
null
null
{{also|Klein}} ==Afrikaans== ===Etymology=== From {{der|af|nl|klein}}. ===Adjective=== {{af-adj}} # [[small]], [[little]] ---- ==Dutch== ===Etymology=== From {{inh|nl|dum|cleine}}, from {{inh|nl|odt|cleini}}, from {{inh|nl|gem-pro|*klainiz}}. ===Pronunciation=== * {{IPA|nl|/klɛi̯n/}} * {{audio|nl|Nl-klein.ogg|audio}} * {{rhymes|nl|ɛi̯n}} ===Adjective=== {{nl-adj}} # [[small]], [[little]] #: {{ant|nl|groot}} # [[almost]] #: {{ux|li|Een '''klein''' uur.|'''Almost''' an hour.|inline=y}} ====Inflection==== {{nl-decl-adj}} ====Derived terms==== * {{l|nl|kleineren}} * {{l|nl|kleinkind}} * {{l|nl|kleinkunst}} * {{l|nl|verkleinen}} ===Anagrams=== * {{l|nl|kniel}} * {{l|nl|linke}} [[Category:Dutch autological terms]] ---- ==German== ===Etymology=== From {{inh|de|gmh|[[klein]], [[kleine]]}}, from {{der|de|goh|kleini}}, from {{der|de|gem-pro|*klainiz||shining, fine, splendid, tender}}, from {{der|de|ine-pro|*g(e)lēi-||gleaming}}, from {{der|de|ine-pro|*gel-||to gleam}}. Cognate with {{cog|nl|klein}} and {{cog|en|clean}}. ===Pronunciation=== * {{IPA|de|/klaɪ̯n/}} * {{audio|de|De-klein.ogg|audio (Germany)}} * {{audio|de|De-at-klein.ogg|audio (Austria)}} * {{rhymes|de|aɪ̯n}} ===Adjective=== {{de-adj|er|sten}} # [[small]], [[little]], [[tiny]] #* ''Hänschen klein'': #*: Hänschen '''klein''' / ging allein / in die weite Welt hinein. [nominative neuter] #* L. Uhland, ''Klein Roland'': #*: Frau Berta saß in der Felsenkluft, / Sie klagt ihr bitt'res Loos; '''Klein''' Roland spielt' in freier Luft; / Deß Klage war nicht groß. [nominative masculine] #* '''1781''', J. H. Campe (editor), ''Kleine Kinderbibliothek'', 6th small volume, Hamburg, p. 43 (substantival use): #*: Mutter. &nbsp; O '''Kleine''', darnach frage mich nicht, die werden nie den lieben Gott sehen. #* '''1882''', ''Neuer deutscher Parnaß. Silberblicke aus der Lyrik unserer Tage'', edited by Max Moltke, Leipzig, page 282, poem ''Am Ufer'' by Pauline Schanz: #*: Laß beide uns fliehn zu dem Englein hin, / Damit du nicht werdest, was ich jetzt bin: // Eine arme Mutter, verlassen, allein, / Verstoßen, verhöhnt, mit dem Kindchen '''klein'''! [dative neuter] # [[insignificant]] ====Declension==== {{de-decl-adj|klein|kleiner|kleinst}} ====Antonyms==== * {{l|de|groß}} ====Derived terms==== {{der-top}} * {{l|de|kleiner}} * {{l|de|Kleinigkeit}} * {{l|de|kleinkrämerisch}} * {{l|de|kleinst}} {{der-mid}} * {{l|de|kleinlich}} * {{l|de|kleinmaschig}} * {{l|de|kleinschrittig}} * {{l|de|kleinwüchsig}} * {{l|de|verkleinern}} {{der-bottom}} ====Related terms==== {{rel3|de |Kleinasien |Kleinbuchstabe |kleinbürgerlich |kleindeutsch |Kleingarten |Kleingeld |kleinkariert |Kleinkind |kleinlaut |Kleinrussland |Kleinstaat |Kleinstadt |Kleintier |Kleinvieh |Kleinwagen }} ===Further reading=== * {{R:Duden}} ---- ==Limburgish== ===Etymology=== From {{inh|li|dum|cleine}}, from {{inh|li|odt|cleini}}, from {{inh|li|gem-pro|*klainiz}}. ===Adjective=== {{li-adj}} # [[small]] ====Inflection==== {{li-decl-adj}}
23.271318
275
0.623917
1f18a2397da40e698fe1a79ed9b5c19260a2a9c3
4,829
sql
SQL
CS/CSC343/A2/data/q5.sql
jerrysun103/uoft
6264583d27c7db94596d29c73804e6d9155de191
[ "MIT" ]
null
null
null
CS/CSC343/A2/data/q5.sql
jerrysun103/uoft
6264583d27c7db94596d29c73804e6d9155de191
[ "MIT" ]
null
null
null
CS/CSC343/A2/data/q5.sql
jerrysun103/uoft
6264583d27c7db94596d29c73804e6d9155de191
[ "MIT" ]
null
null
null
SET SEARCH_PATH TO parlgov; drop table if exists q5 cascade; -- You must not change this table definition. CREATE TABLE q5( electionId INT, countryName VARCHAR(50), winningParty VARCHAR(100), closeRunnerUp VARCHAR(100) ); -- You may find it convenient to do this for each of the views -- that define your intermediate steps. (But give them better names!) DROP VIEW IF EXISTS intermediate_step CASCADE; -- Define views for your intermediate steps here. create view duplicate_election_winners as select election.id as election_id, cabinet_party.party_id, cabinet.country_id from election join cabinet on election.id = cabinet.election_id join cabinet_party on cabinet.id = cabinet_party.cabinet_id where cabinet_party.pm = true and election.e_type = 'Parliamentary election'; -- unique election winners (#181) create view election_winners as (select * from duplicate_election_winners) union (select * from duplicate_election_winners); --(171) --Find the partial winners with alliances info (why # of lines in all winners < # of line in election winners?) create view all_winners as select election_winners.election_id, election_result.id, election_winners.party_id, election_result.alliance_id, election_winners.country_id from election_winners join election_result on election_winners.election_id = election_result.election_id and election_winners.party_id = election_result.party_id; --Null winners create view null_winners as select election_id, id, party_id, id as alliance_id, country_id from all_winners where alliance_id is NULL; create view other_winners as select * from all_winners where alliance_id IS NOT NULL; --From election result extract other winners who have the same alliance id as null winners id. This includes null winners themselves. #44 create view winner_part1 as select e.election_id, e.id, e.party_id, e.alliance_id, n.country_id from election_result e, null_winners n where e.alliance_id = n.id; --Find all other players who share the same winner id (from alliance_id) in the same election. #183 create view winner_part2 as select w2.election_id, w2.id, w2.party_id, w1.alliance_id, w1.country_id from other_winners w1, election_result w2 where (w1.election_id = w2.election_id) and (w1.alliance_id = w2.alliance_id or w1.alliance_id = w2.id); -- #320 create view total_winners as (select * from null_winners) union (select * from winner_part1) union (select * from winner_part2); -- votes count for each winner party create view winner_count as select election_id, total_winners.id, party_id, alliance_id, total_winners.country_id, votes_valid from total_winners join election on total_winners.election_id = election.id and total_winners.country_id = election.country_id; -- total votes for each winner party or alliance. create view total_winner_count1 as select alliance_id, sum(votes_valid) as count from winner_count group by alliance_id; -- more info for winners create view total_winner_count as select * from total_winners natural join total_winner_count1; -- part1 election PE(null alliance_id) players. Create view p1 as select election_id, election_result.id, party_id, election_result.id as alliance_id, country_id from election_result join election on election.id = election_result.election_id where alliance_id IS NULL and election.e_type = 'Parliamentary election'; -- part2 election PE(not null alliance_id) players. Create view p2 as select election_id, election_result.id, party_id, alliance_id, country_id from election_result join election on election.id = election_result.election_id where alliance_id IS NOT NULL and election.e_type = 'Parliamentary election'; -- All election PE players. Create view a1 as (select * from p1) union (select * from p2); -- Election PE players except winner parties. Create view normal_p as (select * from a1) except (select * from total_winners); -- votes count for each normal party create view normal_count as select election_id, normal_p.id, party_id, alliance_id, normal_p.country_id, votes_valid from normal_p join election on normal_p.election_id = election.id and normal_p.country_id = election.country_id; -- total votes for each normal party or alliance. create view total_normal_count1 as select alliance_id, sum(votes_valid) as count from normal_count group by alliance_id; -- More info on normal party create view total_normal_count as select * from total_normal_count1 natural join normal_p; -- Normal players with votes within 10% less than the winner party. CHECKCHECK INEQUALITY create view max_vote as select election_id, max(count) as count from total_normal_count n group by election_id; -- Check for close runner_up create view close_runner as select w.id from total_winner_count w natural join max_vote m where m.count < w.count and m.count >= w.count*0.9; -- the answer to the query insert into q5
35.77037
140
0.806585
401f89f89ec1dc1799cf6e9e48f72a8a4dba435e
3,441
py
Python
examples/mnist/keras/mnist_inference.py
tornado12345/TensorFlowOnSpark
299cfecc310cee089f35b837df826c80efd91a15
[ "Apache-2.0" ]
4,363
2017-02-13T17:10:33.000Z
2022-03-28T03:14:25.000Z
examples/mnist/keras/mnist_inference.py
tornado12345/TensorFlowOnSpark
299cfecc310cee089f35b837df826c80efd91a15
[ "Apache-2.0" ]
442
2017-02-13T17:01:29.000Z
2022-03-31T12:44:28.000Z
examples/mnist/keras/mnist_inference.py
tornado12345/TensorFlowOnSpark
299cfecc310cee089f35b837df826c80efd91a15
[ "Apache-2.0" ]
1,081
2017-02-13T17:11:54.000Z
2022-03-28T03:08:49.000Z
# Copyright 2018 Yahoo Inc. # Licensed under the terms of the Apache 2.0 license. # Please see LICENSE file in the project root for terms. # This example demonstrates how to leverage Spark for parallel inferencing from a SavedModel. # # Normally, you can use TensorFlowOnSpark to just form a TensorFlow cluster for training and inferencing. # However, in some situations, you may have a SavedModel without the original code for defining the inferencing # graph. In these situations, we can use Spark to instantiate a single-node TensorFlow instance on each executor, # where each executor can independently load the model and inference on input data. # # Note: this particular example demonstrates use of `tf.data.Dataset` to read the input data for inferencing, # but it could also be adapted to just use an RDD of TFRecords from Spark. from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import numpy as np import tensorflow as tf def inference(args, ctx): # load saved_model saved_model = tf.saved_model.load(args.export_dir, tags='serve') predict = saved_model.signatures['serving_default'] # parse function for TFRecords def parse_tfr(example_proto): feature_def = {"label": tf.io.FixedLenFeature(1, tf.int64), "image": tf.io.FixedLenFeature(784, tf.int64)} features = tf.io.parse_single_example(serialized=example_proto, features=feature_def) image = tf.cast(features['image'], dtype=tf.float32) / 255.0 image = tf.reshape(image, [28, 28, 1]) label = tf.cast(features['label'], dtype=tf.float32) return (image, label) # define a new tf.data.Dataset (for inferencing) ds = tf.data.Dataset.list_files("{}/part-*".format(args.images_labels), shuffle=False) ds = ds.shard(ctx.num_workers, ctx.worker_num) ds = ds.interleave(tf.data.TFRecordDataset) ds = ds.map(parse_tfr) ds = ds.batch(10) # create an output file per spark worker for the predictions tf.io.gfile.makedirs(args.output) output_file = tf.io.gfile.GFile("{}/part-{:05d}".format(args.output, ctx.worker_num), mode='w') for batch in ds: predictions = predict(conv2d_input=batch[0]) labels = np.reshape(batch[1], -1).astype(np.int) preds = np.argmax(predictions['dense_1'], axis=1) for x in zip(labels, preds): output_file.write("{} {}\n".format(x[0], x[1])) output_file.close() if __name__ == '__main__': from pyspark.context import SparkContext from pyspark.conf import SparkConf from tensorflowonspark import TFParallel sc = SparkContext(conf=SparkConf().setAppName("mnist_inference")) executors = sc._conf.get("spark.executor.instances") num_executors = int(executors) if executors is not None else 1 parser = argparse.ArgumentParser() parser.add_argument("--cluster_size", help="number of nodes in the cluster (for S with labelspark Standalone)", type=int, default=num_executors) parser.add_argument('--images_labels', type=str, help='Directory for input images with labels') parser.add_argument("--export_dir", help="HDFS path to export model", type=str, default="mnist_export") parser.add_argument("--output", help="HDFS path to save predictions", type=str, default="predictions") args, _ = parser.parse_known_args() print("args: {}".format(args)) # Running single-node TF instances on each executor TFParallel.run(sc, inference, args, args.cluster_size)
43.0125
146
0.741354
96ad95006453051205ec48adf9063b017afcb73f
1,241
lua
Lua
UserPlugins/ultraschall_api/Scripts_Examples/US_Api_Examples_Working_with_FXStateChunks_and_MediaItems.lua
nethad/ultraschall-portable
5977dda184593ed630aaef2b45294584c4ffe113
[ "MIT" ]
46
2018-02-25T07:14:24.000Z
2022-03-13T14:19:12.000Z
UserPlugins/ultraschall_api/Scripts_Examples/US_Api_Examples_Working_with_FXStateChunks_and_MediaItems.lua
tomtjes/ultraschall-portable
2be96969f56aeaeabaa804d2840ed6763634e5c1
[ "MIT" ]
296
2018-02-25T00:01:27.000Z
2022-02-24T19:39:23.000Z
UserPlugins/ultraschall_api/Scripts_Examples/US_Api_Examples_Working_with_FXStateChunks_and_MediaItems.lua
tomtjes/ultraschall-portable
2be96969f56aeaeabaa804d2840ed6763634e5c1
[ "MIT" ]
6
2018-03-03T20:19:26.000Z
2021-07-07T21:35:52.000Z
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua") -- Examplecode on how to toggle bypass with FXStateChunks in TakeFX by Meo Mespotine 23rd of January 2020 bypasstoggle=1 -- set it to 1 to bypass, set it to 0 to unbypass FX of Takes -- the following order is essential. If you leave out one of them or mix them up...you're out of luck -- first, you need get the StateChunk MediaItem = reaper.GetMediaItem(0, 0) B0, ItemStateChunk = reaper.GetItemStateChunk(MediaItem, "", false) -- get the FXStateChunk. Before that, you cannot do anything with the FXStateChunks! FXStateChunk = ultraschall.GetFXStateChunk(ItemStateChunk, 1) -- let's manipulate it to make all FX bypassed FXStateChunk = string.gsub(FXStateChunk, "BYPASS.-\n", "BYPASS "..bypasstoggle.." 0 0\n") -- after the FXStateChunk is manipulated, you can set it back into the ItemStateChunk C, ItemStateChunk = ultraschall.SetFXStateChunk(ItemStateChunk, FXStateChunk, 1) -- now you can set the statechunk into the MediaItem again Result = reaper.SetItemStateChunk(MediaItem, ItemStateChunk, false) -- update Arrangeview, so any changes in MediaItem-takes are shown reaper.UpdateArrange()
45.962963
105
0.734891
c154712439b342908a77f74689aaaf1c1e3383bb
3,939
swift
Swift
DrivingDemo/UIViewControllers/ImagePicker.swift
Skywids/SwiftUI_Vehicle
e8707788516da5d7a344cf877ea5cf914d53060d
[ "Apache-2.0" ]
null
null
null
DrivingDemo/UIViewControllers/ImagePicker.swift
Skywids/SwiftUI_Vehicle
e8707788516da5d7a344cf877ea5cf914d53060d
[ "Apache-2.0" ]
null
null
null
DrivingDemo/UIViewControllers/ImagePicker.swift
Skywids/SwiftUI_Vehicle
e8707788516da5d7a344cf877ea5cf914d53060d
[ "Apache-2.0" ]
null
null
null
// // ImagePicker.swift // DrivingDemo // // Created by Vishal on 10/05/21. // import Foundation import SwiftUI //struct ImagePicker: UIViewControllerRepresentable { // // @Binding var isShown: Bool // @Binding var uiImage: UIImage? // // class Coordinator: NSObject, UINavigationControllerDelegate, UIImagePickerControllerDelegate { // // @Binding var isShown: Bool // @Binding var uiImage: UIImage? // // init(isShown: Binding<Bool>, uiImage: Binding<UIImage?>) { // _isShown = isShown // _uiImage = uiImage // } // // func imagePickerController(_ picker: UIImagePickerController, // didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { // let imagePicked = info[UIImagePickerController.InfoKey.originalImage] as! UIImage // uiImage = imagePicked // isShown = false // } // // func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { // isShown = false // } // // } // // func makeCoordinator() -> Coordinator { // return Coordinator(isShown: $isShown, uiImage: $uiImage) // } // // func makeUIViewController(context: UIViewControllerRepresentableContext<ImagePicker>) -> UIImagePickerController { // let picker = UIImagePickerController() // picker.delegate = context.coordinator // return picker // } // // func updateUIViewController(_ uiViewController: UIImagePickerController, // context: UIViewControllerRepresentableContext<ImagePicker>) { // // } // //} struct ImagePicker: UIViewControllerRepresentable { @Environment(\.presentationMode) private var presentationMode let sourceType: UIImagePickerController.SourceType // let onImagePicked: (UIImage) -> Void @Binding var uiImage: UIImage? final class Coordinator: NSObject, UINavigationControllerDelegate, UIImagePickerControllerDelegate { @Binding private var presentationMode: PresentationMode private let sourceType: UIImagePickerController.SourceType // private let onImagePicked: (UIImage) -> Void @Binding var uiImage: UIImage? init(presentationMode: Binding<PresentationMode>, sourceType: UIImagePickerController.SourceType, // onImagePicked: @escaping (UIImage) -> Void, uiImage: Binding<UIImage?>) { _presentationMode = presentationMode self.sourceType = sourceType // self.onImagePicked = onImagePicked _uiImage = uiImage } func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { let uiImage1 = info[UIImagePickerController.InfoKey.originalImage] as! UIImage // onImagePicked(uiImage1) uiImage = uiImage1 presentationMode.dismiss() } func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { presentationMode.dismiss() } } func makeCoordinator() -> Coordinator { return Coordinator(presentationMode: presentationMode, sourceType: sourceType, // onImagePicked: onImagePicked, uiImage: $uiImage) } func makeUIViewController(context: UIViewControllerRepresentableContext<ImagePicker>) -> UIImagePickerController { let picker = UIImagePickerController() picker.sourceType = sourceType picker.delegate = context.coordinator return picker } func updateUIViewController(_ uiViewController: UIImagePickerController, context: UIViewControllerRepresentableContext<ImagePicker>) { } }
32.286885
120
0.641026
17df51729d7dfc43eca908f8117a02b83d2e8837
4,384
dart
Dart
lib/model/built_sign_in.g.dart
teambeca/beca-app
4a837c0d2344316a295201b5f555bf0e016c6acc
[ "MIT" ]
2
2020-07-29T02:56:15.000Z
2020-07-29T15:42:43.000Z
lib/model/built_sign_in.g.dart
teambeca/beca-app
4a837c0d2344316a295201b5f555bf0e016c6acc
[ "MIT" ]
null
null
null
lib/model/built_sign_in.g.dart
teambeca/beca-app
4a837c0d2344316a295201b5f555bf0e016c6acc
[ "MIT" ]
null
null
null
// GENERATED CODE - DO NOT MODIFY BY HAND part of 'built_sign_in.dart'; // ************************************************************************** // BuiltValueGenerator // ************************************************************************** Serializer<BuiltSignIn> _$builtSignInSerializer = new _$BuiltSignInSerializer(); class _$BuiltSignInSerializer implements StructuredSerializer<BuiltSignIn> { @override final Iterable<Type> types = const [BuiltSignIn, _$BuiltSignIn]; @override final String wireName = 'BuiltSignIn'; @override Iterable<Object> serialize(Serializers serializers, BuiltSignIn object, {FullType specifiedType = FullType.unspecified}) { final result = <Object>[ 'username', serializers.serialize(object.username, specifiedType: const FullType(String)), 'password', serializers.serialize(object.password, specifiedType: const FullType(String)), ]; return result; } @override BuiltSignIn deserialize(Serializers serializers, Iterable<Object> serialized, {FullType specifiedType = FullType.unspecified}) { final result = new BuiltSignInBuilder(); final iterator = serialized.iterator; while (iterator.moveNext()) { final key = iterator.current as String; iterator.moveNext(); final dynamic value = iterator.current; switch (key) { case 'username': result.username = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; case 'password': result.password = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; } } return result.build(); } } class _$BuiltSignIn extends BuiltSignIn { @override final String username; @override final String password; factory _$BuiltSignIn([void Function(BuiltSignInBuilder) updates]) => (new BuiltSignInBuilder()..update(updates)).build(); _$BuiltSignIn._({this.username, this.password}) : super._() { if (username == null) { throw new BuiltValueNullFieldError('BuiltSignIn', 'username'); } if (password == null) { throw new BuiltValueNullFieldError('BuiltSignIn', 'password'); } } @override BuiltSignIn rebuild(void Function(BuiltSignInBuilder) updates) => (toBuilder()..update(updates)).build(); @override BuiltSignInBuilder toBuilder() => new BuiltSignInBuilder()..replace(this); @override bool operator ==(Object other) { if (identical(other, this)) return true; return other is BuiltSignIn && username == other.username && password == other.password; } @override int get hashCode { return $jf($jc($jc(0, username.hashCode), password.hashCode)); } @override String toString() { return (newBuiltValueToStringHelper('BuiltSignIn') ..add('username', username) ..add('password', password)) .toString(); } } class BuiltSignInBuilder implements Builder<BuiltSignIn, BuiltSignInBuilder> { _$BuiltSignIn _$v; String _username; String get username => _$this._username; set username(String username) => _$this._username = username; String _password; String get password => _$this._password; set password(String password) => _$this._password = password; BuiltSignInBuilder(); BuiltSignInBuilder get _$this { if (_$v != null) { _username = _$v.username; _password = _$v.password; _$v = null; } return this; } @override void replace(BuiltSignIn other) { if (other == null) { throw new ArgumentError.notNull('other'); } _$v = other as _$BuiltSignIn; } @override void update(void Function(BuiltSignInBuilder) updates) { if (updates != null) updates(this); } @override _$BuiltSignIn build() { final _$result = _$v ?? new _$BuiltSignIn._(username: username, password: password); replace(_$result); return _$result; } } // ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new
29.226667
354
0.665146
83e60e91e000e9a1d29e9c4271e56b7b5eda47c0
155
java
Java
src/test/java/com/vaadin/guice/testClasses/ASecondImplementation.java
aditosoftware/vaadinguice
51da8c5a75ee30ae112e28d8da4c1c338830d777
[ "Apache-2.0" ]
13
2016-02-24T22:28:34.000Z
2022-01-06T21:17:17.000Z
src/test/java/com/vaadin/guice/testClasses/ASecondImplementation.java
aditosoftware/vaadinguice
51da8c5a75ee30ae112e28d8da4c1c338830d777
[ "Apache-2.0" ]
12
2016-04-06T11:26:16.000Z
2022-01-07T13:35:26.000Z
src/test/java/com/vaadin/guice/testClasses/ASecondImplementation.java
aditosoftware/vaadinguice
51da8c5a75ee30ae112e28d8da4c1c338830d777
[ "Apache-2.0" ]
9
2016-04-04T01:08:24.000Z
2021-09-30T09:19:50.000Z
package com.vaadin.guice.testClasses; public class ASecondImplementation implements AnInterface { @Override public void foo() { ; } }
17.222222
59
0.683871
6dfecb66dc6267d3855601a1e3e6f8da7250a044
6,054
kt
Kotlin
app/src/main/java/com/thedefiapp/ui/common/PullToRefresh.kt
saulmaos/thedefiapp
59d02b33bd3da6be0b23c00c5beed75c54f745be
[ "MIT" ]
null
null
null
app/src/main/java/com/thedefiapp/ui/common/PullToRefresh.kt
saulmaos/thedefiapp
59d02b33bd3da6be0b23c00c5beed75c54f745be
[ "MIT" ]
null
null
null
app/src/main/java/com/thedefiapp/ui/common/PullToRefresh.kt
saulmaos/thedefiapp
59d02b33bd3da6be0b23c00c5beed75c54f745be
[ "MIT" ]
null
null
null
package com.thedefiapp.ui.common import androidx.compose.animation.core.Animatable import androidx.compose.animation.core.tween import androidx.compose.foundation.Canvas import androidx.compose.foundation.MutatePriority import androidx.compose.foundation.MutatorMutex import androidx.compose.foundation.layout.* import androidx.compose.material.MaterialTheme import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.geometry.Offset import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.graphics.ImageBitmap import androidx.compose.ui.graphics.drawscope.clipRect import androidx.compose.ui.input.nestedscroll.NestedScrollConnection import androidx.compose.ui.input.nestedscroll.NestedScrollSource import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.res.dimensionResource import androidx.compose.ui.res.imageResource import androidx.compose.ui.unit.* import com.thedefiapp.R import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch import kotlin.math.absoluteValue import kotlin.math.roundToInt @Composable fun PullToRefresh( isRefreshing: Boolean = false, height: Dp = dimensionResource(id = R.dimen.default_pull_to_refresh_height), onRefresh: () -> Unit, scrollableContent: @Composable () -> Unit ) { val scope = rememberCoroutineScope() val state = rememberComposePullToRefreshState(isRefreshing = isRefreshing, height = height) state.isRefreshing.value = isRefreshing LaunchedEffect( !state.isRefreshing.value, state.isSwiping.value, state.maxOffset ) { if (!state.isSwiping.value) { state.animateBackToRest() } } val connection = remember(state, scope) { ComposePullToRefreshNestedScrollCompletion(state, scope) { onRefresh() } }.apply { this.enabled = !state.isRefreshing.value } Column( modifier = Modifier .nestedScroll(connection) .fillMaxSize() ) { val y = (state.indicatorOffset * 0.2f).coerceIn(0f, height.value).roundToInt() Loader(y = y, state.isRefreshing.value, state.isSwiping.value, height) scrollableContent() } } class ComposePullToRefreshNestedScrollCompletion( private val state: ComposePullToRefreshState, private val scope: CoroutineScope, private val onRefresh: () -> Unit ) : NestedScrollConnection { var enabled: Boolean = false override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset = when { !enabled -> Offset.Zero source == NestedScrollSource.Drag && available.y < 0 -> { onScroll(available) } else -> Offset.Zero } override fun onPostScroll( consumed: Offset, available: Offset, source: NestedScrollSource ): Offset = when { !enabled -> Offset.Zero source == NestedScrollSource.Drag && available.y > 0 -> { onScroll(available) } else -> Offset.Zero } private fun onScroll(available: Offset): Offset { state.isSwiping.value = true val delta = available.y val newOffset = (state.indicatorOffset + delta).coerceAtLeast(0f) return if (newOffset.absoluteValue >= 0.5f) { scope.launch { state.updateIndicator(delta) } Offset(x = 0f, y = delta) } else { Offset.Zero } } override suspend fun onPreFling(available: Velocity): Velocity = when { state.isSwiping.value && state.indicatorOffset >= state.maxOffset -> { onRefresh() Velocity.Zero } else -> { Velocity.Zero } }.also { state.isSwiping.value = false } } @Composable private fun Loader(y: Int, isRefreshing: Boolean, isSwiping: Boolean, layoutSize: Dp) { val image = ImageBitmap.imageResource(id = R.drawable.eth_logo) val color = MaterialTheme.colors.primary Box( modifier = Modifier.fillMaxWidth(), contentAlignment = Alignment.TopCenter ) { if (isRefreshing) CryptoLoading(height = layoutSize) else if (isSwiping || (!isRefreshing && y > 0)) Canvas( modifier = Modifier .width(layoutSize) .height(y.dp) ) { val height = layoutSize.toPx() val rate = height / image.height val newWidth = image.width * rate val xStart = ((size.width / 2) - (newWidth / 2)).toInt() clipRect(bottom = y.dp.toPx()) { drawImage( image = image, colorFilter = ColorFilter.tint(color), dstOffset = IntOffset(xStart, 0), dstSize = IntSize(newWidth.toInt(), height.toInt()) ) } } } } @Composable fun rememberComposePullToRefreshState( isRefreshing: Boolean, height: Dp ): ComposePullToRefreshState { return remember { ComposePullToRefreshState(isRefreshing, height = height) } } class ComposePullToRefreshState(isRefreshing: Boolean, height: Dp) { private val _indicatorOffset = Animatable(0f) private val mutatorMutex = MutatorMutex() val isRefreshing = mutableStateOf(isRefreshing) val isSwiping = mutableStateOf(false) val indicatorOffset: Float get() = _indicatorOffset.value.coerceAtMost(maxOffset * 2) val maxOffset = height.value * 5 internal suspend fun updateIndicator(delta: Float) { mutatorMutex.mutate(MutatePriority.UserInput) { _indicatorOffset.snapTo(_indicatorOffset.value + delta) } } internal suspend fun animateBackToRest() { mutatorMutex.mutate { _indicatorOffset.animateTo( if (isRefreshing.value) maxOffset else 0f, animationSpec = tween(durationMillis = 500) ) } } }
32.202128
95
0.653948
051fff2f53364bc156c8f1cb8264d194534af313
17,574
html
HTML
dijit/analysis/help/ca/AnalysisEnvironments.html
pbuwembo-mygit/arcgis-js-api
0cab54d6865be867d63fa029e37058595655b7eb
[ "Apache-2.0", "CC0-1.0" ]
1
2021-09-18T08:22:32.000Z
2021-09-18T08:22:32.000Z
dijit/analysis/help/ca/AnalysisEnvironments.html
agmghazi/arcgis-js-api
6a24695f16b7fffadfcede3a17da0fa224aff0b0
[ "Apache-2.0", "CC0-1.0" ]
null
null
null
dijit/analysis/help/ca/AnalysisEnvironments.html
agmghazi/arcgis-js-api
6a24695f16b7fffadfcede3a17da0fa224aff0b0
[ "Apache-2.0", "CC0-1.0" ]
null
null
null
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title></title> <link rel="Stylesheet" href="../css/analysis.css" /> <script type="text/javascript"> function init() { if (window.location.hash) { var parentDiv, nodes, i, helpInfo, helpId, helpInfoArr, helpEnvFilter, envContent, hideEnvClass, hideNodes; helpInfo = window.location.hash.substring(1); if(helpInfo.indexOf("-")) { helpInfoArr = helpInfo.split("-"); helpId = helpInfoArr[0]; helpEnvFilter = helpInfoArr[1]; } else { helpId = helpInfo; } parentDiv = document.getElementById("topics"); nodes = parentDiv.children; hideEnvClass = (helpEnvFilter === "OnlineOnly"? "PortalOnly": "OnlineOnly"); if(document.getElementsByClassName) { hideNodes = document.getElementsByClassName(hideEnvClass); } else { hideNodes = document.querySelectorAll(hideEnvClass); } for(i=0; i < nodes.length; i++) { if(nodes[i].id !== helpId) { nodes[i].style.display ="none"; } } for(i=0; i < hideNodes.length; i++) { hideNodes[i].style.display ="none"; } } } </script> </head> <body onload="init()"> <div id="topics"> <div id="toolDescription" class="smallsize"> <h2>Configuració de l'entorn d'anàlisi del Portal</h2><p/> <h2></h2> <hr/> <p> Configuraci&oacute; de l'entorn per a l'an&agrave;lisi al Portal for ArcGIS i a l'ArcGIS Online. </p> </div> <!--Parameter divs for each param--> <div id="overwriteResult"> <div><h2>Sobreescriu la capa de resultats</h2></div> <hr/> <div> <p>Especifica si s'han de sobreescriure les capes existents. Quan est&agrave; activada, si ja existeix una capa amb el mateix nom als vostres continguts, se sobreescriur&agrave;. </p> <p> <ul> <li>Activada: si ja existeix una capa amb el mateix nom als vostres continguts, se sobreescriur&agrave;. La sortida tindr&agrave; el mateix sistema de coordenades que l'entrada. </li> <li>Desactivada: si el nom de la capa de resultats que es proporciona ja existeix, es produir&agrave; un error i caldr&agrave; canviar el nom de la capa de resultats per poder executar l'eina. Aquesta &eacute;s l'opci&oacute; per defecte. </li> </ul> </p> </div> </div> <div id="closeAnalysisWidget"> <div><h2>Tanca el widget d'anàlisi després d'executar l'anàlisi</h2></div> <hr/> <div> <p>Especifica si s'ha de mantenir el quadre de di&agrave;leg d'an&agrave;lisi obert i habilitat mentre l'eina fa el processament. Aquesta opci&oacute; us permet modificar els par&agrave;metres de l'an&agrave;lisi mentre la tasca d'an&agrave;lisi anterior se segueix executant. L'an&agrave;lisi &eacute;s un proc&eacute;s iteratiu i, si manteniu el quadre de di&agrave;leg de l'eina obert, podeu canviar els par&agrave;metres i tornar a executar l'an&agrave;lisi. </p> <p> <ul> <li>Activada: el quadre de di&agrave;leg de l'eina d'an&agrave;lisi es tancar&agrave; i el focus es retornar&agrave; a la taula de continguts. Aquesta &eacute;s l'opci&oacute; per defecte. </li> <li>Desactivada: el quadre de di&agrave;leg de l'eina d'an&agrave;lisi romandr&agrave; obert i habilitat. </li> </ul> </p> </div> </div> <div id="storeAnalysisResults"> <div><h2>Desa els resultats de l'anàlisi com a capes d'entitats allotjades</h2></div> <hr/> <div> <p>Especifica si la capa de resultats que s'ha creat a partir de l'an&agrave;lisi ser&agrave; una col&middot;lecci&oacute; d'entitats o una capa d'entitats allotjades. </p> <p> <ul> <li>Activada: els resultats de l'an&agrave;lisi crearan una capa d'entitats allotjades i es crear&agrave; un element als vostres continguts. Aquesta &eacute;s l'opci&oacute; per defecte. </li> <li>Desactivada: els resultats de l'an&agrave;lisi crearan una col&middot;lecci&oacute; d'entitats. </li> </ul> </p> </div> </div> <div id="outputCoordinateSystem"> <div><h2>Sistema de coordenades de sortida</h2></div> <hr/> <div> <p>Especifica el sistema de coordenades de la capa de resultats de l'an&agrave;lisi de r&agrave;ster. </p> <p> <ul> <li> <b>Igual que l'entrada</b>: el resultat de l'an&agrave;lisi tindr&agrave; el mateix sistema de coordenades que l'entrada. Aquesta &eacute;s l'opci&oacute; per defecte. </li> <li> <b>Segons s'especifiqui</b>: el resultat de l'an&agrave;lisi tindr&agrave; el mateix sistema de coordenades que trieu. Si aquesta opci&oacute; est&agrave; seleccionada, feu clic al bot&oacute; del globus i trieu un valor d'una llista de sistemes de coordenades coneguts, o b&eacute; afegiu el WKID de la refer&egrave;ncia espacial al quadre corresponent. </li> <li> <b>Capa &lt;name&gt;</b>: el resultat de l'an&agrave;lisi tindr&agrave; el mateix sistema de coordenades que una capa existent que trieu al mapa web. </li> </ul> </p> </div> </div> <div id="processingCoordinateSystem"> <div><h2>Sistema de coordenades de processament</h2></div> <hr/> <div> <p>Especifica el sistema de coordenades que l'an&agrave;lisi far&agrave; servir durant l'execuci&oacute; de l'an&agrave;lisi del GeoAnalytics. </p> <p>Per al GeoAnalytics, en algunes an&agrave;lisis &eacute;s necessari que el processament s'executi en un sistema de coordenades projectades. Per a qualsevol eina que hagi implementat la col&middot;locaci&oacute; de bins d'unitats de dades o lineals &eacute;s necessari un sistema de coordenades projectades. </p> <p> <ul> <li> <b>Igual que l'entrada</b>: l'an&agrave;lisi es processar&agrave; amb el mateix sistema de coordenades que l'entrada. Aquesta &eacute;s l'opci&oacute; per defecte. </li> <li> <b>Segons s'especifiqui</b>: l'an&agrave;lisi tindr&agrave; el mateix sistema de coordenades que trieu. Si aquesta opci&oacute; est&agrave; seleccionada, feu clic al bot&oacute; del globus i trieu un valor d'una llista de sistemes de coordenades projectades coneguts, o b&eacute; afegiu el WKID de la refer&egrave;ncia espacial al quadre corresponent. </li> <li> <b>Capa &lt;name&gt;</b>: l'an&agrave;lisi tindr&agrave; el mateix sistema de coordenades que una capa existent que trieu al mapa web. </li> </ul> </p> </div> </div> <div id="processingExtent"> <div><h2>Extensió</h2></div> <hr/> <div> <p>Especifica l'extensi&oacute; o el l&iacute;mit que es far&agrave; servir durant l'execuci&oacute; de l'an&agrave;lisi. Totes les entitats d'entrada que estiguin completament dins de l'extensi&oacute; especificada o que s'hi intersequin es faran servir a l'an&agrave;lisi. </p> <p> <ul> <li> <b>Per defecte</b>: extensi&oacute; que proporciona l'eina. </li> <li> <b>Segons s'especifiqui</b>: l'extensi&oacute; es defineix mitjan&ccedil;ant les coordenades que proporcioneu. </li> <li> <b>Capa &lt;name&gt;</b>: l'extensi&oacute; utilitzada per processar l'an&agrave;lisi ser&agrave; la mateixa que l'extensi&oacute; espacial d'una capa existent que trieu al mapa web. </li> </ul> </p> </div> </div> <div id="snapRaster"> <div><h2>Alinea el ràster</h2></div> <hr/> <div> <p>Ajusta l'extensi&oacute; de la capa de r&agrave;ster de sortida perqu&egrave; coincideixi amb l'alineaci&oacute; de cel&middot;les de la capa <b>Alinea el r&agrave;ster</b> especificada a l'an&agrave;lisi de r&agrave;ster. </p> </div> </div> <div id="cellSize"> <div><h2>Mida de la cel·la</h2></div> <hr/> <div> <p>Especifica la mida o la resoluci&oacute; de cel&middot;la que s'utilitzar&agrave; per crear la capa de r&agrave;ster de sortida a l'an&agrave;lisi de r&agrave;ster. La resoluci&oacute; de sortida per defecte es determina segons la mida de cel&middot;la m&eacute;s gran de la capa de r&agrave;ster d'entrada. </p> <p> <ul> <li> <b>Quantitat m&iacute;nima d'entrades</b>: utilitzeu la mida de cel&middot;la m&eacute;s petita de totes les capes d'entrada. </li> <li> <b>Quantitat m&agrave;xima d'entrades</b>: utilitzeu la mida de cel&middot;la m&eacute;s gran de totes les capes d'entrada. Aquesta &eacute;s l'opci&oacute; per defecte. </li> <li> <b>Segons s'especifiqui</b>: especifiqueu un valor num&egrave;ric per definir la mida de cel&middot;la. Si se selecciona aquesta opci&oacute;, el valor per defecte &eacute;s 1. </li> <li> <b>Capa &lt;name&gt;</b>: definiu la mida de cel&middot;la segons la capa de r&agrave;ster que s'hagi triat. </li> </ul> </p> </div> </div> <div id="mask"> <div><h2>Màscara</h2></div> <hr/> <div> <p>Especifica la capa que s'utilitzar&agrave; per definir l'&agrave;rea d'inter&egrave;s a l'an&agrave;lisi de r&agrave;ster. Nom&eacute;s s'inclouran a l'operaci&oacute; d'an&agrave;lisi aquelles cel&middot;les que quedin dins de la m&agrave;scara d'an&agrave;lisi. </p> <ul> <li>La m&agrave;scara pot ser un r&agrave;ster o una capa d'entitats. </li> <li>Si la m&agrave;scara d'an&agrave;lisi &eacute;s un r&agrave;ster, totes les cel&middot;les que tinguin un valor es tindran en compte per definir la m&agrave;scara. Les cel&middot;les d'un r&agrave;ster de m&agrave;scara que siguin NoData es consideraran fora de la m&agrave;scara i seran NoData a la capa de resultats de l'an&agrave;lisi. </li> <li>Si la m&agrave;scara d'an&agrave;lisi &eacute;s una capa d'entitats, es convertir&agrave; internament en un r&agrave;ster quan es faci l'execuci&oacute;. Per aquest motiu, assegureu-vos que els valors de <b>Mida de la cel&middot;la</b> i <b>Alinea el r&agrave;ster</b> estiguin definits correctament per a l'an&agrave;lisi. </li> </ul> </div> </div> <div id="dataStore"> <div><h2>Magatzem de dades</h2></div> <hr/> <div> <p>Els resultats del GeoAnalytics es poden emmagatzemar en un ArcGIS Data Store i exposar-se com una capa d'entitats al Portal for ArcGIS, o b&eacute; en un recurs compartit de fitxers de dades massives configurat. </p> <p>Si emmagatzemeu un resultat a l' ArcGIS Data Store, els resultats s'han d'emmagatzemar, en la majoria dels casos, al magatzem de dades espaciotemporal. Aquesta &eacute;s l'opci&oacute; per defecte. A continuaci&oacute; teniu alguns motius pels quals &eacute;s bona idea desar els resultats en un magatzem de dades relacional: <ul> <li>Per utilitzar els resultats a la col&middot;laboraci&oacute; de portal a portal </li> <li>Per habilitar les funcions de sincronitzaci&oacute; amb els vostres resultats </li> </ul> </p> <p>No &eacute;s recomanable fer servir un magatzem de dades relacionals si espereu que els resultats del GeoAnalytics augmentin i voleu aprofitar les funcions del magatzem de dades massives espaciotemporals per gestionar grans quantitats de dades. </p> </div> </div> <div id="parallelProcessingFactor"> <div><h2>Factor de processament en paral·lel</h2></div> <hr/> <div> <p>Distribueix l'an&agrave;lisi a diverses inst&agrave;ncies del servei de processament de r&agrave;ster. </p> <p>Les eines que respecten l'entorn <b>Factor de processament en paral&middot;lel</b> us permeten controlar el nombre d'inst&agrave;ncies del servei de processament de r&agrave;ster que podeu utilitzar per processar les dades. </p> <p>Si l'eina no respecta el valor de <b>Tipus de processador</b> o si l'entorn <b>Tipus de processador</b> est&agrave; definit en <b>CPU</b>, l'entorn <b>Factor de processament en paral&middot;lel</b> controla les inst&agrave;ncies del servei de processament de r&agrave;ster (CPU). Si <b>Tipus de processador</b> est&agrave; definit en <b>GPU</b>, l'entorn <b>Factor de processament en paral&middot;lel</b> controla el nombre d'inst&agrave;ncies de GPU de processament de r&agrave;ster. </p> <p>En definir <b>Factor de processament en paral&middot;lel</b>, podeu sol&middot;licitar el nombre de treballadors paral&middot;lels que el servidor d'imatges d'an&agrave;lisi de r&agrave;ster utilitza per processar una tasca d'an&agrave;lisi de r&agrave;ster. Aix&ograve; no obstant, si el nombre total de processos paral&middot;lels supera el nombre m&agrave;xim d'inst&agrave;ncies del servei de processament de r&agrave;ster (CPU o GPU), els processos paral&middot;lels addicionals es posaran en cua. </p> <p>Si el valor de <b>Factor de processament en paral&middot;lel</b> no s'especifica, que &eacute;s l'opci&oacute; per defecte, l'eina utilitzar&agrave; el 80&nbsp;% del nombre m&agrave;xim d'inst&agrave;ncies del servei de processament de r&agrave;ster. Es pot especificar un enter o un percentatge com a factor de processament en paral&middot;lel. </p> </div> </div> <div id="retryOnFailures"> <div><h2>Nombre de reintents després d'errors</h2></div> <hr/> <div> <p>Defineix quants reintents far&agrave; el mateix proc&eacute;s de treballador quan es produeixi un error en processar una tasca concreta. El valor per defecte &eacute;s 0. </p> </div> </div> <div id="recycleProcessingWorkers"> <div><h2>Interval de reciclatge dels treballadors en processament</h2></div> <hr/> <div> <p>Definiu quantes seccions d'imatges es processaran abans de reiniciar processos de treballadors, per tal d'evitar possibles errors en processos de llarga durada. El valor per defecte &eacute;s 0. </p> </div> </div> <div id="processorType"> <div><h2>Tipus de processador</h2></div> <hr/> <div> <p>Les eines que respecten l'entorn <b>Tipus de processador</b> us permeten triar on i com voleu processar les dades. Podeu processar les dades mitjan&ccedil;ant la CPU o la CPU del servidor. Si l'entorn <b>Tipus de processador</b> &eacute;s buit, l'eina utilitza la CPU per processar les dades. Aquesta &eacute;s l'opci&oacute; per defecte. </p> <p>El processament de la CPU es pot definir en paral&middot;lel en diversos nuclis i inst&agrave;ncies, com a l'entorn <b>Factor de processament en paral&middot;lel</b>. </p> <p>Les GPU s&oacute;n efectives per al processament de gr&agrave;fics i imatges, on l'estructura altament paral&middot;lela permet que processin de manera eficient grans blocs de dades de manera repetitiva. Les eines d'an&agrave;lisi de r&agrave;ster que respecten aquest entorn poden distribuir la seva feina a les inst&agrave;ncies de GPU en diversos servidors d'an&agrave;lisi de r&agrave;ster, com a l'entorn <b>Factor de processament en paral&middot;lel</b>. </p> <p> <ul> <li> <b>GPU</b>: les dades es processaran mitjan&ccedil;ant la unitat de processament de gr&agrave;fics. </li> <li> <b>CPU</b>: les dades es processaran mitjan&ccedil;ant la unitat de processament central de l'ordinador. </li> </ul> </p> </div> </div> </div> </html>
61.233449
518
0.592352
cca28d19d65532bc4ebc60d92f294b1e28691ee3
1,525
sql
SQL
openGaussBase/testcase/AI/AI_MODEL/Opengauss_Function_Model_Case0101.sql
opengauss-mirror/Yat
aef107a8304b94e5d99b4f1f36eb46755eb8919e
[ "MulanPSL-1.0" ]
null
null
null
openGaussBase/testcase/AI/AI_MODEL/Opengauss_Function_Model_Case0101.sql
opengauss-mirror/Yat
aef107a8304b94e5d99b4f1f36eb46755eb8919e
[ "MulanPSL-1.0" ]
null
null
null
openGaussBase/testcase/AI/AI_MODEL/Opengauss_Function_Model_Case0101.sql
opengauss-mirror/Yat
aef107a8304b94e5d99b4f1f36eb46755eb8919e
[ "MulanPSL-1.0" ]
null
null
null
-- @testpoint: linear_regression创建mode,带超参batch_size最小值,超参batch_size小于最小值,部分测试点合理报错 --step1: 建表并插入数据;expect: 建表并插入数据成功 drop table if exists t_model_tab_0101; create table t_model_tab_0101(id int,tax int,bedroom int,bath float,price int,size int,lot int,mark text); insert into t_model_tab_0101 values (1,590,2,1,50000,70,22100,'a+'),(2,1050,3,2,85000,1410,12000,'a+'),(3,20,3,1,22500,1060,3500,'a-'),(4,870,2,2,90000,1300,17500,'a+'),(5,1320,3,2,133000,150,30000,'a+'),(6,1350,2,1,90500,820,25700,'a-'), (7,2790,3,2.5 ,260000,2130,25000,'a'),(8,680,2 ,1,142500,170,22000,'a-'),(9,1840,3,2 ,60000,1500,19000,'a+'),(10,3680,4,2,240000,2790,20000,'a-'),(11,1660,3,1,87000,1030,17500,'a+'); --step2: linear_regression创建mode带超参batch_size最小值;expect: 创建成功 create model m_model_min_batch_size_0101 using linear_regression features 1,tax,bath,size target price from t_model_tab_0101 with batch_size=1; --step3: 查找系统表的hyperparametersvalues值;expect: 返回内容含batch_size的值 select hyperparametersvalues from gs_model_warehouse where modelname = 'm_model_min_batch_size_0101'; --step4: 查找系统表;expect: 返回创建model的modelname值m_model_min_batch_size_0101 select modelname from gs_model_warehouse order by modelname; --step5: linear_regression创建mode带超参batch_size小于最小值;expect: 创建失败,报错提示超参batch_size值错误 create model m_model_min_batch_size1_0101 using linear_regression features 1,tax,bath,size target price from t_model_tab_0101 with batch_size=0; --step6: 清理环境;expext: 清理成功 drop table t_model_tab_0101; drop model m_model_min_batch_size_0101;
69.318182
421
0.796066
bf459f94cf0c3bf4225afdab0685b47ad3073dcd
679
sql
SQL
docs/retail/dynamic_pricing/process.sql
rmoff/ksqldb-recipes
c30eaf2f5653fe855589f426b5cc6ddae241f0a6
[ "Apache-2.0" ]
null
null
null
docs/retail/dynamic_pricing/process.sql
rmoff/ksqldb-recipes
c30eaf2f5653fe855589f426b5cc6ddae241f0a6
[ "Apache-2.0" ]
null
null
null
docs/retail/dynamic_pricing/process.sql
rmoff/ksqldb-recipes
c30eaf2f5653fe855589f426b5cc6ddae241f0a6
[ "Apache-2.0" ]
null
null
null
-- Create stream of sales CREATE STREAM sales ( item_id INT key, seller_id STRING, price DOUBLE ) WITH ( VALUE_FORMAT='json', KAFKA_TOPIC='sales', PARTITIONS = 6); -- Create table of items CREATE TABLE items ( item_id INT PRIMARY key, item_name STRING ) WITH ( VALUE_FORMAT='json', KAFKA_TOPIC='items', PARTITIONS = 6); -- Calculate minimum, maximum, and average price, per item, and join with item name CREATE TABLE sales_stats AS SELECT S.item_id, I.item_name, MIN(price) AS price_min, MAX(price) AS price_max, AVG(price) AS price_avg FROM sales S INNER JOIN items I ON S.item_id = I.item_id GROUP BY S.item_id EMIT CHANGES;
21.903226
83
0.701031
811828bcc4bbd2bd982584999d9e8920eb4b4957
685
lua
Lua
volume/data/actions/scripts/quests/bigfoot burden/stone.lua
patsadow2/Tibia
b3aebbc5aea78cc2a238584c767c5c7315bab4dd
[ "MIT" ]
2
2021-07-16T00:21:26.000Z
2022-01-28T02:08:22.000Z
volume/data/actions/scripts/quests/bigfoot burden/stone.lua
patsadow2/Tibia
b3aebbc5aea78cc2a238584c767c5c7315bab4dd
[ "MIT" ]
1
2019-04-05T18:53:52.000Z
2019-04-10T10:53:04.000Z
volume/data/actions/scripts/quests/bigfoot burden/stone.lua
patsadow2/Tibia
b3aebbc5aea78cc2a238584c767c5c7315bab4dd
[ "MIT" ]
2
2019-12-11T04:13:15.000Z
2020-02-15T14:42:13.000Z
function onUse(player, item, fromPosition, target, toPosition, isHotkey) if player:getStorageValue(Storage.BigfootBurden.GrindstoneStatus) == 1 or player:getStorageValue(Storage.BigfootBurden.MissionGrindstoneHunt) ~= 1 then return false end toPosition:sendMagicEffect(CONST_ME_HITBYFIRE) item:transform(18335) if math.random(15) ~= 15 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You had no luck this time.') return true end player:setStorageValue(Storage.BigfootBurden.GrindstoneStatus, 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Your skill allowed you to grab a whetstone before the stone sinks into lava.') player:addItem(18337, 1) return true end
36.052632
152
0.805839
9ca2eef13edd90de6e9043b78dea762808601ecb
29,223
cpp
C++
CMSIS/DSP/Testing/Source/Tests/StatsTestsF16.cpp
shosakam/CMSIS_5
18205c6c2b68e7e96f40dc941c47efdbdd9f7d01
[ "Apache-2.0" ]
2
2021-12-14T02:15:35.000Z
2021-12-14T02:16:12.000Z
CMSIS/DSP/Testing/Source/Tests/StatsTestsF16.cpp
shosakam/CMSIS_5
18205c6c2b68e7e96f40dc941c47efdbdd9f7d01
[ "Apache-2.0" ]
null
null
null
CMSIS/DSP/Testing/Source/Tests/StatsTestsF16.cpp
shosakam/CMSIS_5
18205c6c2b68e7e96f40dc941c47efdbdd9f7d01
[ "Apache-2.0" ]
null
null
null
#include "StatsTestsF16.h" #include <stdio.h> #include "Error.h" #include "Test.h" #define SNR_THRESHOLD 48 #define SNR_KULLBACK_THRESHOLD 40 /* Reference patterns are generated with a double precision computation. */ #define REL_ERROR (6.0e-3) #define REL_KULLBACK_ERROR (5.0e-3) #define ABS_KULLBACK_ERROR (5.0e-3) void StatsTestsF16::test_max_f16() { const float16_t *inp = inputA.ptr(); float16_t result; uint32_t indexval; float16_t *refp = ref.ptr(); int16_t *refind = maxIndexes.ptr(); float16_t *outp = output.ptr(); int16_t *ind = index.ptr(); arm_max_f16(inp, inputA.nbSamples(), &result, &indexval); outp[0] = result; ind[0] = indexval; ASSERT_EQ(result,refp[this->refOffset]); ASSERT_EQ((int16_t)indexval,refind[this->refOffset]); } void StatsTestsF16::test_absmax_f16() { const float16_t *inp = inputA.ptr(); float16_t result; uint32_t indexval; float16_t *refp = ref.ptr(); int16_t *refind = maxIndexes.ptr(); float16_t *outp = output.ptr(); int16_t *ind = index.ptr(); arm_absmax_f16(inp, inputA.nbSamples(), &result, &indexval); outp[0] = result; ind[0] = indexval; ASSERT_EQ(result,refp[this->refOffset]); ASSERT_EQ((int16_t)indexval,refind[this->refOffset]); } void StatsTestsF16::test_max_no_idx_f16() { const float16_t *inp = inputA.ptr(); float16_t result; float16_t *refp = ref.ptr(); float16_t *outp = output.ptr(); arm_max_no_idx_f16(inp, inputA.nbSamples(), &result); outp[0] = result; ASSERT_EQ(result,refp[this->refOffset]); } void StatsTestsF16::test_absmax_no_idx_f16() { const float16_t *inp = inputA.ptr(); float16_t result; float16_t *refp = ref.ptr(); float16_t *outp = output.ptr(); arm_absmax_no_idx_f16(inp, inputA.nbSamples(), &result); outp[0] = result; ASSERT_EQ(result,refp[this->refOffset]); } void StatsTestsF16::test_min_no_idx_f16() { const float16_t *inp = inputA.ptr(); float16_t result; float16_t *refp = ref.ptr(); float16_t *outp = output.ptr(); arm_min_no_idx_f16(inp, inputA.nbSamples(), &result); outp[0] = result; ASSERT_EQ(result,refp[this->refOffset]); } void StatsTestsF16::test_absmin_no_idx_f16() { const float16_t *inp = inputA.ptr(); float16_t result; float16_t *refp = ref.ptr(); float16_t *outp = output.ptr(); arm_absmin_no_idx_f16(inp, inputA.nbSamples(), &result); outp[0] = result; ASSERT_EQ(result,refp[this->refOffset]); } void StatsTestsF16::test_min_f16() { const float16_t *inp = inputA.ptr(); float16_t result; uint32_t indexval; float16_t *refp = ref.ptr(); int16_t *refind = minIndexes.ptr(); float16_t *outp = output.ptr(); int16_t *ind = index.ptr(); arm_min_f16(inp, inputA.nbSamples(), &result, &indexval); outp[0] = result; ind[0] = indexval; ASSERT_EQ(result,refp[this->refOffset]); ASSERT_EQ((int16_t)indexval,refind[this->refOffset]); } void StatsTestsF16::test_absmin_f16() { const float16_t *inp = inputA.ptr(); float16_t result; uint32_t indexval; float16_t *refp = ref.ptr(); int16_t *refind = minIndexes.ptr(); float16_t *outp = output.ptr(); int16_t *ind = index.ptr(); arm_absmin_f16(inp, inputA.nbSamples(), &result, &indexval); outp[0] = result; ind[0] = indexval; ASSERT_EQ(result,refp[this->refOffset]); ASSERT_EQ((int16_t)indexval,refind[this->refOffset]); } void StatsTestsF16::test_mean_f16() { const float16_t *inp = inputA.ptr(); float16_t result; float16_t *refp = ref.ptr(); float16_t *outp = output.ptr(); arm_mean_f16(inp, inputA.nbSamples(), &result); outp[0] = result; ASSERT_SNR(result,refp[this->refOffset],(float16_t)SNR_THRESHOLD); ASSERT_REL_ERROR(result,refp[this->refOffset],REL_ERROR); } void StatsTestsF16::test_power_f16() { const float16_t *inp = inputA.ptr(); float16_t result; float16_t *refp = ref.ptr(); float16_t *outp = output.ptr(); arm_power_f16(inp, inputA.nbSamples(), &result); outp[0] = result; ASSERT_SNR(result,refp[this->refOffset],(float16_t)SNR_THRESHOLD); ASSERT_REL_ERROR(result,refp[this->refOffset],REL_ERROR); } void StatsTestsF16::test_rms_f16() { const float16_t *inp = inputA.ptr(); float16_t result; float16_t *refp = ref.ptr(); float16_t *outp = output.ptr(); arm_rms_f16(inp, inputA.nbSamples(), &result); outp[0] = result; ASSERT_SNR(result,refp[this->refOffset],(float16_t)SNR_THRESHOLD); ASSERT_REL_ERROR(result,refp[this->refOffset],REL_ERROR); } void StatsTestsF16::test_std_f16() { const float16_t *inp = inputA.ptr(); float16_t result; float16_t *refp = ref.ptr(); float16_t *outp = output.ptr(); arm_std_f16(inp, inputA.nbSamples(), &result); outp[0] = result; ASSERT_SNR(result,refp[this->refOffset],(float16_t)SNR_THRESHOLD); ASSERT_REL_ERROR(result,refp[this->refOffset],REL_ERROR); } void StatsTestsF16::test_var_f16() { const float16_t *inp = inputA.ptr(); float16_t result; float16_t *refp = ref.ptr(); float16_t *outp = output.ptr(); arm_var_f16(inp, inputA.nbSamples(), &result); outp[0] = result; ASSERT_SNR(result,refp[this->refOffset],(float16_t)SNR_THRESHOLD); ASSERT_REL_ERROR(result,refp[this->refOffset],REL_ERROR); } void StatsTestsF16::test_std_stability_f16() { /* With the textbook algorithm, those values will produce a negative value for the variance. The CMSIS-DSP variance algorithm is the two pass one so will work with those values. So, it should be possible to compute the square root for the standard deviation. */ float16_t in[4]={4.0f, 7.0f, 13.0f, 16.0f}; float16_t result; int i; /* Add bigger offset so that average is much bigger than standard deviation. */ for(i=0 ; i < 4; i++) { in[i] += 3.0e3f; } arm_std_f16(in,4,&result); /* If variance is giving a negative value, the square root should return zero. We check it is not happening here. */ ASSERT_TRUE(fabs(5.47723f - result) < 0.32f); } void StatsTestsF16::test_entropy_f16() { const float16_t *inp = inputA.ptr(); const int16_t *dimsp = dims.ptr(); float16_t *outp = output.ptr(); for(int i=0;i < this->nbPatterns; i++) { *outp = arm_entropy_f16(inp,dimsp[i+1]); outp++; inp += dimsp[i+1]; } ASSERT_SNR(ref,output,(float16_t)SNR_THRESHOLD); ASSERT_REL_ERROR(ref,output,REL_ERROR); } void StatsTestsF16::test_logsumexp_f16() { const float16_t *inp = inputA.ptr(); const int16_t *dimsp = dims.ptr(); float16_t *outp = output.ptr(); for(int i=0;i < this->nbPatterns; i++) { *outp = arm_logsumexp_f16(inp,dimsp[i+1]); outp++; inp += dimsp[i+1]; } ASSERT_SNR(ref,output,(float16_t)SNR_THRESHOLD); ASSERT_REL_ERROR(ref,output,REL_ERROR); } void StatsTestsF16::test_kullback_leibler_f16() { const float16_t *inpA = inputA.ptr(); const float16_t *inpB = inputB.ptr(); const int16_t *dimsp = dims.ptr(); float16_t *outp = output.ptr(); for(int i=0;i < this->nbPatterns; i++) { *outp = arm_kullback_leibler_f16(inpA,inpB,dimsp[i+1]); outp++; inpA += dimsp[i+1]; inpB += dimsp[i+1]; } ASSERT_SNR(ref,output,(float16_t)SNR_KULLBACK_THRESHOLD); ASSERT_CLOSE_ERROR(ref,output,ABS_KULLBACK_ERROR,REL_KULLBACK_ERROR); } void StatsTestsF16::test_logsumexp_dot_prod_f16() { const float16_t *inpA = inputA.ptr(); const float16_t *inpB = inputB.ptr(); const int16_t *dimsp = dims.ptr(); float16_t *outp = output.ptr(); float16_t *tmpp = tmp.ptr(); for(int i=0;i < this->nbPatterns; i++) { *outp = arm_logsumexp_dot_prod_f16(inpA,inpB,dimsp[i+1],tmpp); outp++; inpA += dimsp[i+1]; inpB += dimsp[i+1]; } ASSERT_SNR(ref,output,(float16_t)SNR_THRESHOLD); ASSERT_REL_ERROR(ref,output,REL_ERROR); } void StatsTestsF16::setUp(Testing::testID_t id,std::vector<Testing::param_t>& paramsArgs,Client::PatternMgr *mgr) { (void)paramsArgs; switch(id) { case StatsTestsF16::TEST_MAX_F16_1: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,7); maxIndexes.reload(StatsTestsF16::MAXINDEXES_S16_ID,mgr); ref.reload(StatsTestsF16::MAXVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); index.create(1,StatsTestsF16::OUT_S16_ID,mgr); refOffset = 0; } break; case StatsTestsF16::TEST_MAX_F16_2: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,16); maxIndexes.reload(StatsTestsF16::MAXINDEXES_S16_ID,mgr); ref.reload(StatsTestsF16::MAXVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); index.create(1,StatsTestsF16::OUT_S16_ID,mgr); refOffset = 1; } break; case StatsTestsF16::TEST_MAX_F16_3: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,23); maxIndexes.reload(StatsTestsF16::MAXINDEXES_S16_ID,mgr); ref.reload(StatsTestsF16::MAXVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); index.create(1,StatsTestsF16::OUT_S16_ID,mgr); refOffset = 2; } break; case StatsTestsF16::TEST_MEAN_F16_4: { inputA.reload(StatsTestsF16::INPUT2_F16_ID,mgr,7); ref.reload(StatsTestsF16::MEANVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 0; } break; case StatsTestsF16::TEST_MEAN_F16_5: { inputA.reload(StatsTestsF16::INPUT2_F16_ID,mgr,16); ref.reload(StatsTestsF16::MEANVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 1; } break; case StatsTestsF16::TEST_MEAN_F16_6: { inputA.reload(StatsTestsF16::INPUT2_F16_ID,mgr,23); ref.reload(StatsTestsF16::MEANVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 2; } break; case StatsTestsF16::TEST_MIN_F16_7: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,7); minIndexes.reload(StatsTestsF16::MININDEXES_S16_ID,mgr); ref.reload(StatsTestsF16::MINVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); index.create(1,StatsTestsF16::OUT_S16_ID,mgr); refOffset = 0; } break; case StatsTestsF16::TEST_MIN_F16_8: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,16); minIndexes.reload(StatsTestsF16::MININDEXES_S16_ID,mgr); ref.reload(StatsTestsF16::MINVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); index.create(1,StatsTestsF16::OUT_S16_ID,mgr); refOffset = 1; } break; case StatsTestsF16::TEST_MIN_F16_9: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,23); minIndexes.reload(StatsTestsF16::MININDEXES_S16_ID,mgr); ref.reload(StatsTestsF16::MINVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); index.create(1,StatsTestsF16::OUT_S16_ID,mgr); refOffset = 2; } break; case StatsTestsF16::TEST_POWER_F16_10: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,7); ref.reload(StatsTestsF16::POWERVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 0; } break; case StatsTestsF16::TEST_POWER_F16_11: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,16); ref.reload(StatsTestsF16::POWERVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 1; } break; case StatsTestsF16::TEST_POWER_F16_12: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,23); ref.reload(StatsTestsF16::POWERVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 2; } break; case StatsTestsF16::TEST_RMS_F16_13: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,7); ref.reload(StatsTestsF16::RMSVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 0; } break; case StatsTestsF16::TEST_RMS_F16_14: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,16); ref.reload(StatsTestsF16::RMSVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 1; } break; case StatsTestsF16::TEST_RMS_F16_15: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,23); ref.reload(StatsTestsF16::RMSVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 2; } break; case StatsTestsF16::TEST_STD_F16_16: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,7); ref.reload(StatsTestsF16::STDVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 0; } break; case StatsTestsF16::TEST_STD_F16_17: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,16); ref.reload(StatsTestsF16::STDVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 1; } break; case StatsTestsF16::TEST_STD_F16_18: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,23); ref.reload(StatsTestsF16::STDVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 2; } break; case StatsTestsF16::TEST_VAR_F16_19: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,7); ref.reload(StatsTestsF16::VARVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 0; } break; case StatsTestsF16::TEST_VAR_F16_20: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,16); ref.reload(StatsTestsF16::VARVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 1; } break; case StatsTestsF16::TEST_VAR_F16_21: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,23); ref.reload(StatsTestsF16::VARVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 2; } break; case StatsTestsF16::TEST_ENTROPY_F16_22: { inputA.reload(StatsTestsF16::INPUT22_F16_ID,mgr); dims.reload(StatsTestsF16::DIM22_S16_ID,mgr); ref.reload(StatsTestsF16::REF22_ENTROPY_F16_ID,mgr); output.create(ref.nbSamples(),StatsTestsF16::OUT_F16_ID,mgr); const int16_t *dimsp = dims.ptr(); this->nbPatterns=dimsp[0]; } break; case StatsTestsF16::TEST_LOGSUMEXP_F16_23: { inputA.reload(StatsTestsF16::INPUT23_F16_ID,mgr); dims.reload(StatsTestsF16::DIM23_S16_ID,mgr); ref.reload(StatsTestsF16::REF23_LOGSUMEXP_F16_ID,mgr); output.create(ref.nbSamples(),StatsTestsF16::OUT_F16_ID,mgr); const int16_t *dimsp = dims.ptr(); this->nbPatterns=dimsp[0]; } break; case StatsTestsF16::TEST_KULLBACK_LEIBLER_F16_24: { inputA.reload(StatsTestsF16::INPUTA24_F16_ID,mgr); inputB.reload(StatsTestsF16::INPUTB24_F16_ID,mgr); dims.reload(StatsTestsF16::DIM24_S16_ID,mgr); ref.reload(StatsTestsF16::REF24_KL_F16_ID,mgr); output.create(ref.nbSamples(),StatsTestsF16::OUT_F16_ID,mgr); const int16_t *dimsp = dims.ptr(); this->nbPatterns=dimsp[0]; } break; case StatsTestsF16::TEST_LOGSUMEXP_DOT_PROD_F16_25: { inputA.reload(StatsTestsF16::INPUTA25_F16_ID,mgr); inputB.reload(StatsTestsF16::INPUTB25_F16_ID,mgr); dims.reload(StatsTestsF16::DIM25_S16_ID,mgr); ref.reload(StatsTestsF16::REF25_LOGSUMEXP_DOT_F16_ID,mgr); output.create(ref.nbSamples(),StatsTestsF16::OUT_F16_ID,mgr); const int16_t *dimsp = dims.ptr(); this->nbPatterns=dimsp[0]; /* 12 is max vecDim as defined in Python script generating the data */ tmp.create(12,StatsTestsF16::TMP_F16_ID,mgr); } break; case StatsTestsF16::TEST_MAX_NO_IDX_F16_26: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,7); ref.reload(StatsTestsF16::MAXVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 0; } break; case StatsTestsF16::TEST_MAX_NO_IDX_F16_27: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,8); ref.reload(StatsTestsF16::MAXVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 1; } break; case StatsTestsF16::TEST_MAX_NO_IDX_F16_28: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,11); ref.reload(StatsTestsF16::MAXVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 2; } break; case TEST_MEAN_F16_29: inputA.reload(StatsTestsF16::INPUT2_F16_ID,mgr,100); ref.reload(StatsTestsF16::MEANVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 3; break; case TEST_RMS_F16_30: inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,100); ref.reload(StatsTestsF16::RMSVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 3; break; case TEST_STD_F16_31: inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,100); ref.reload(StatsTestsF16::STDVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 3; break; case TEST_VAR_F16_32: inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,100); ref.reload(StatsTestsF16::VARVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 3; break; case StatsTestsF16::TEST_ABSMAX_F16_34: { inputA.reload(StatsTestsF16::INPUTNEW1_F16_ID,mgr,7); maxIndexes.reload(StatsTestsF16::ABSMAXINDEXES_S16_ID,mgr); ref.reload(StatsTestsF16::ABSMAXVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); index.create(1,StatsTestsF16::OUT_S16_ID,mgr); refOffset = 0; } break; case StatsTestsF16::TEST_ABSMAX_F16_35: { inputA.reload(StatsTestsF16::INPUTNEW1_F16_ID,mgr,16); maxIndexes.reload(StatsTestsF16::ABSMAXINDEXES_S16_ID,mgr); ref.reload(StatsTestsF16::ABSMAXVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); index.create(1,StatsTestsF16::OUT_S16_ID,mgr); refOffset = 1; } break; case StatsTestsF16::TEST_ABSMAX_F16_36: { inputA.reload(StatsTestsF16::INPUTNEW1_F16_ID,mgr,23); maxIndexes.reload(StatsTestsF16::ABSMAXINDEXES_S16_ID,mgr); ref.reload(StatsTestsF16::ABSMAXVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); index.create(1,StatsTestsF16::OUT_S16_ID,mgr); refOffset = 2; } break; case StatsTestsF16::TEST_ABSMIN_F16_37: { inputA.reload(StatsTestsF16::INPUTNEW1_F16_ID,mgr,7); minIndexes.reload(StatsTestsF16::ABSMININDEXES_S16_ID,mgr); ref.reload(StatsTestsF16::ABSMINVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); index.create(1,StatsTestsF16::OUT_S16_ID,mgr); refOffset = 0; } break; case StatsTestsF16::TEST_ABSMIN_F16_38: { inputA.reload(StatsTestsF16::INPUTNEW1_F16_ID,mgr,16); minIndexes.reload(StatsTestsF16::ABSMININDEXES_S16_ID,mgr); ref.reload(StatsTestsF16::ABSMINVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); index.create(1,StatsTestsF16::OUT_S16_ID,mgr); refOffset = 1; } break; case StatsTestsF16::TEST_ABSMIN_F16_39: { inputA.reload(StatsTestsF16::INPUTNEW1_F16_ID,mgr,23); minIndexes.reload(StatsTestsF16::ABSMININDEXES_S16_ID,mgr); ref.reload(StatsTestsF16::ABSMINVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); index.create(1,StatsTestsF16::OUT_S16_ID,mgr); refOffset = 2; } break; case StatsTestsF16::TEST_MIN_NO_IDX_F16_40: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,7); ref.reload(StatsTestsF16::MINVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 0; } break; case StatsTestsF16::TEST_MIN_NO_IDX_F16_41: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,16); ref.reload(StatsTestsF16::MINVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 1; } break; case StatsTestsF16::TEST_MIN_NO_IDX_F16_42: { inputA.reload(StatsTestsF16::INPUT1_F16_ID,mgr,23); ref.reload(StatsTestsF16::MINVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 2; } break; case StatsTestsF16::TEST_ABSMAX_NO_IDX_F16_43: { inputA.reload(StatsTestsF16::INPUTNEW1_F16_ID,mgr,7); ref.reload(StatsTestsF16::ABSMAXVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 0; } break; case StatsTestsF16::TEST_ABSMAX_NO_IDX_F16_44: { inputA.reload(StatsTestsF16::INPUTNEW1_F16_ID,mgr,16); ref.reload(StatsTestsF16::ABSMAXVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 1; } break; case StatsTestsF16::TEST_ABSMAX_NO_IDX_F16_45: { inputA.reload(StatsTestsF16::INPUTNEW1_F16_ID,mgr,23); ref.reload(StatsTestsF16::ABSMAXVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 2; } break; case StatsTestsF16::TEST_ABSMIN_NO_IDX_F16_46: { inputA.reload(StatsTestsF16::INPUTNEW1_F16_ID,mgr,7); ref.reload(StatsTestsF16::ABSMINVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 0; } break; case StatsTestsF16::TEST_ABSMIN_NO_IDX_F16_47: { inputA.reload(StatsTestsF16::INPUTNEW1_F16_ID,mgr,16); ref.reload(StatsTestsF16::ABSMINVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 1; } break; case StatsTestsF16::TEST_ABSMIN_NO_IDX_F16_48: { inputA.reload(StatsTestsF16::INPUTNEW1_F16_ID,mgr,23); ref.reload(StatsTestsF16::ABSMINVALS_F16_ID,mgr); output.create(1,StatsTestsF16::OUT_F16_ID,mgr); refOffset = 2; } break; } } void StatsTestsF16::tearDown(Testing::testID_t id,Client::PatternMgr *mgr) { (void)id; switch(id) { case StatsTestsF16::TEST_MAX_F16_1: case StatsTestsF16::TEST_MAX_F16_2: case StatsTestsF16::TEST_MAX_F16_3: case StatsTestsF16::TEST_MIN_F16_7: case StatsTestsF16::TEST_MIN_F16_8: case StatsTestsF16::TEST_MIN_F16_9: index.dump(mgr); output.dump(mgr); break; default: output.dump(mgr); } }
27.620983
117
0.527667
20e99b7aa20b1edd0956be52df74eb502733967a
1,746
hpp
C++
Include/Editor/EditorSubsystem.hpp
amitukind/WebGL-Game-Engine
c78973803938c1cfba703d9bb437ec46a4c48045
[ "Unlicense" ]
null
null
null
Include/Editor/EditorSubsystem.hpp
amitukind/WebGL-Game-Engine
c78973803938c1cfba703d9bb437ec46a4c48045
[ "Unlicense" ]
null
null
null
Include/Editor/EditorSubsystem.hpp
amitukind/WebGL-Game-Engine
c78973803938c1cfba703d9bb437ec46a4c48045
[ "Unlicense" ]
null
null
null
/* Copyright (c) 2018-2021 Piotr Doan. All rights reserved. Software distributed under the permissive MIT License. */ #pragma once #include <Core/SystemInterface.hpp> #include <Core/EngineSystem.hpp> namespace System::InputEvents { struct KeyboardKey; } /* Editor Subsystem Base class for editor subsystems to be used with system storage. */ namespace Editor { class EditorSubsystem : public Core::SystemInterface<EditorSubsystem> { REFLECTION_ENABLE(EditorSubsystem) public: virtual ~EditorSubsystem() = default; virtual void OnBeginInterface(float timeDelta) {} virtual void OnEndInterface() {} virtual bool OnKeyboardKey(const System::InputEvents::KeyboardKey& event) { // Return false if we do not intend on capturing input event. return false; } protected: EditorSubsystem() = default; }; using EditorSubsystemStorage = Core::SystemStorage<EditorSubsystem>; } REFLECTION_TYPE(Editor::EditorSubsystem) /* Editor Subsystem Context Utility for retrieving engine system storage from editor subsystems. */ namespace Editor { class EditorSubsystemContext : public EditorSubsystem { REFLECTION_ENABLE(EditorSubsystemContext, EditorSubsystem) public: EditorSubsystemContext(const Core::EngineSystemStorage& engineSystems) : m_engineSystems(engineSystems) { } const Core::EngineSystemStorage& GetEngineSystems() const { return m_engineSystems; } private: const Core::EngineSystemStorage& m_engineSystems; }; } REFLECTION_TYPE(Editor::EditorSubsystemContext, Editor::EditorSubsystem)
22.384615
81
0.687285
762bf800f3e44327d43ef072f138ee33b3b1a385
112
go
Go
while.go
satyamuralidhar/golang
695754377693ff59178f6523c9af02ec9c028a4b
[ "MIT" ]
1
2020-01-07T07:39:17.000Z
2020-01-07T07:39:17.000Z
while.go
satyamuralidhar/golang
695754377693ff59178f6523c9af02ec9c028a4b
[ "MIT" ]
null
null
null
while.go
satyamuralidhar/golang
695754377693ff59178f6523c9af02ec9c028a4b
[ "MIT" ]
1
2020-04-27T14:43:41.000Z
2020-04-27T14:43:41.000Z
package main import "fmt" func main() { i := 1 max := 20 for i < max { fmt.Println(i) i += 1 } }
8.615385
17
0.491071
e9569dbc062429a857f26504bcd6bf600bd74118
5,594
lua
Lua
database.lua
michaelnpsp/KiwiHUD
bcba606fd2dd50321378142cbd3c543c39e59e5f
[ "MIT" ]
null
null
null
database.lua
michaelnpsp/KiwiHUD
bcba606fd2dd50321378142cbd3c543c39e59e5f
[ "MIT" ]
null
null
null
database.lua
michaelnpsp/KiwiHUD
bcba606fd2dd50321378142cbd3c543c39e59e5f
[ "MIT" ]
null
null
null
---------------------------------------------------------------- -- KiwiHUD: Manage SavedVariables Database ---------------------------------------------------------------- local addon = KiwiHUD local rootDB = { global = {}, profiles = {}, profileChars = {} } local GetNumSpecializations = not addon.isClassic and GetNumSpecializations or function() return 1 end local GetSpecialization = not addon.isClassic and GetSpecialization or function() return 1 end local GetSpecializationInfo = not addon.isClassic and GetSpecializationInfo or function() return 1, "Default" end ---------------------------------------------------------------- -- Initialize Database ---------------------------------------------------------------- function addon:InitializeDB() local key = addon.addonName ..'DB' local db = _G[key] if not db then db = rootDB _G[key] = db end local charKey = UnitName("player") .. " - " .. GetRealmName() if not db.profiles['default'] then db.profiles['default'] = CopyTable(addon.defaults) end local profileChar = db.profileChars[charKey] if not profileChar then profileChar = {} for i=1,GetNumSpecializations() or 1 do profileChar[i] = 'default' end db.profileChars[charKey] = profileChar if not db.profiles[charKey] then db.profiles[charKey] = CopyTable(addon.defaults) end end addon.__profileChar = profileChar addon.__db = db addon:PLAYER_TALENT_UPDATE() if not addon.isClassic then addon:RegisterEvent("PLAYER_TALENT_UPDATE") end end ---------------------------------------------------------------- -- Talent change management ---------------------------------------------------------------- function addon:PLAYER_TALENT_UPDATE() local profileKey = self.__profileChar[ GetSpecialization() or 1 ] or 'default' if profileKey ~= self.__profileKey then local old_db = self.db local new_db = self.__db.profiles[profileKey] or self.__db.profiles.default self.__profileKey = profileKey self.db = new_db if old_db then self:OnProfileChanged() end end end ---------------------------------------------------------------- -- Profile management options ---------------------------------------------------------------- local values, undeletable = {}, {} local function GetProfiles() wipe(values) for key in pairs(addon.__db.profiles) do values[key] = key end return values end local function GetSpecName(i) if i<=GetNumSpecializations() then local name = select(2,GetSpecializationInfo(i)) if i==GetSpecialization() then name = name .. ' (active)' end return name else return '' end end local function GetSpecProfile(specIndex) return addon.__profileChar[specIndex] or 'default' end local function SetSpecProfile(specIndex, key) addon.__profileChar[specIndex] = key if GetSpecialization() or specIndex == 1 then addon:PLAYER_TALENT_UPDATE() end end -- profile selection per specialization local options = addon:SetupOptions( 'Profiles', 'Profiles', {} ) for i=1,6 do options['spec'..i] = { type = 'select', order = i, name = function() return GetSpecName(i) end, get = function() return GetSpecProfile(i) end, set = function(_, key) SetSpecProfile(i,key) end, hidden = function() return i>GetNumSpecializations() end, values = GetProfiles, } end -- profile database maintenance operations addon:SetupOptions( 'Profiles', 'Operations', { newDesc = { type = 'description', order = 0.5, name = "\nYou can create a new profile by entering a name in the editbox.", }, newProfile = { type = 'input', name = 'New Profile Name', order = 1, get = function() end, set = function(info,name) name = strtrim(name) addon.__db.profiles[name] = CopyTable( addon.defaults ) SetSpecProfile( GetSpecialization() or 1, name) end, validate = function(info,name) name = strtrim(name) return strlen(name)>2 and not addon.__db.profiles[name] end, }, copyDesc = { type = 'description', order = 1.5, name = "\nCopy the settings from one existing profile into the currently active profile.", }, copyProfile = { type = 'select', order = 2, name = 'Copy From', desc = "Copy the settings from one existing profile into the currently active profile.", get = function() end, set = function(_, key) local profiles = addon.__db.profiles profiles[addon.__profileKey] = CopyTable( profiles[key] ) addon.__profileKey = nil addon:PLAYER_TALENT_UPDATE() end, confirm = function() return "Selected profile will be copied into the current profile and current profile settings will be lost. Are you sure ?" end, values = function() wipe(values) for key in pairs(addon.__db.profiles) do if key ~= addon.__profileKey then values[key] = key end end return values end, }, deleteDesc = { type = 'description', order = 2.5, name = "\nYou can delete unused profiles from the database to save space.", }, deleteProfile = { type = 'select', order = 3, name = 'Delete Profile', get = function() end, set = function(_, key) addon.__db.profiles[key] = nil addon:Update() end, confirm = function() return "Are you sure you want to delete the selected profile?" end, values = function() wipe(values) wipe(undeletable) for _,keys in pairs(addon.__db.profileChars) do for _,key in pairs(keys) do undeletable[key] = true end end for key in pairs(addon.__db.profiles) do if not undeletable[key] then values[key] = key end end return values end, }, footer = { type = "description", order = 100, name = " " }, } )
28.252525
151
0.633536
5d36cf5a394119c502466082d04aae0ffc179fad
1,536
asm
Assembly
programs/oeis/113/A113531.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/113/A113531.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/113/A113531.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A113531: a(n) = 1 + 2*n + 3*n^2 + 4*n^3 + 5*n^4 + 6*n^5. ; 1,21,321,2005,7737,22461,54121,114381,219345,390277,654321,1045221,1604041,2379885,3430617,4823581,6636321,8957301,11886625,15536757,20033241,25515421,32137161,40067565,49491697,60611301,73645521,88831621,106425705,126703437,149960761,176514621,206703681,240889045,279454977,322809621,371385721,425641341,486060585,553154317,627460881,709546821,800007601,899468325,1008584457,1128042541,1258560921,1400890461,1555815265,1724153397,1906757601,2104516021,2318352921,2549229405,2798144137,3066134061,3354275121,3663682981,3995513745,4350964677,4731274921,5137726221,5571643641,6034396285,6527398017,7052108181,7610032321,8202722901,8831780025,9498852157,10205636841,10953881421,11745383761,12581992965,13465610097,14398188901,15381736521,16418314221,17510038105,18659079837,19867667361,21138085621,22472677281,23873843445,25344044377,26885800221,28501691721,30194360941,31966511985,33820911717,35760390481,37787842821,39906228201,42118571725,44427964857,46837566141,49350601921,51970367061,54700225665,57543611797 mov $1,$0 mul $0,2 add $0,1 mov $3,$1 mov $4,$1 mov $6,$1 lpb $3 sub $3,1 add $5,$6 lpe mov $2,3 mov $6,$5 lpb $2 add $0,$6 sub $2,1 lpe mov $3,$4 mov $5,0 lpb $3 sub $3,1 add $5,$6 lpe mov $2,4 mov $6,$5 lpb $2 add $0,$6 sub $2,1 lpe mov $3,$4 mov $5,0 lpb $3 sub $3,1 add $5,$6 lpe mov $2,5 mov $6,$5 lpb $2 add $0,$6 sub $2,1 lpe mov $3,$4 mov $5,0 lpb $3 sub $3,1 add $5,$6 lpe mov $2,6 mov $6,$5 lpb $2 add $0,$6 sub $2,1 lpe
27.428571
1,012
0.76237
595b7ec53ca2ffae31f62fa4a09b4426ab8a9aa6
3,147
kt
Kotlin
27_WorkManager/PhotoGallery/app/src/main/java/com/bignerdranch/android/photogallery/FlickrFetchr.kt
sby5388/AndroidBianChengQuanWeiZhiNanV4-kotlin
3530e5ee2b2ea96a4e678a332c849c5bb11d9b19
[ "Apache-2.0" ]
3
2021-07-03T10:31:54.000Z
2022-01-26T07:58:51.000Z
27_WorkManager/PhotoGallery/app/src/main/java/com/bignerdranch/android/photogallery/FlickrFetchr.kt
sby5388/AndroidBianChengQuanWeiZhiNanV4-kotlin
3530e5ee2b2ea96a4e678a332c849c5bb11d9b19
[ "Apache-2.0" ]
null
null
null
27_WorkManager/PhotoGallery/app/src/main/java/com/bignerdranch/android/photogallery/FlickrFetchr.kt
sby5388/AndroidBianChengQuanWeiZhiNanV4-kotlin
3530e5ee2b2ea96a4e678a332c849c5bb11d9b19
[ "Apache-2.0" ]
1
2021-08-31T07:51:11.000Z
2021-08-31T07:51:11.000Z
package com.bignerdranch.android.photogallery import android.graphics.Bitmap import android.graphics.BitmapFactory import android.util.Log import androidx.annotation.WorkerThread import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import com.bignerdranch.android.photogallery.api.FlickrApi import com.bignerdranch.android.photogallery.api.FlickrResponse import com.bignerdranch.android.photogallery.api.PhotoInterceptor import com.bignerdranch.android.photogallery.api.PhotoResponse import okhttp3.OkHttpClient import okhttp3.ResponseBody import retrofit2.Call import retrofit2.Callback import retrofit2.Response import retrofit2.Retrofit import retrofit2.converter.gson.GsonConverterFactory private const val TAG = "FlickrFetchr" class FlickrFetchr { private val flickrApi: FlickrApi init { val client = OkHttpClient.Builder() .addInterceptor(PhotoInterceptor()) .build() val retrofit: Retrofit = Retrofit.Builder() .baseUrl("https://api.flickr.com/") .addConverterFactory(GsonConverterFactory.create()) .client(client) .build() flickrApi = retrofit.create(FlickrApi::class.java) } fun fetchPhotosRequest(): Call<FlickrResponse> { return flickrApi.fetchPhotos() } fun fetchPhotos(): LiveData<List<GalleryItem>> { return fetchPhotoMetdadata(fetchPhotosRequest()) } fun searchPhotosRequest(query: String): Call<FlickrResponse> { return flickrApi.searchPhotos(query) } fun searchPhotos(query: String): LiveData<List<GalleryItem>> { return fetchPhotoMetdadata(searchPhotosRequest(query)) } private fun fetchPhotoMetdadata(flickrRequest: Call<FlickrResponse>) : LiveData<List<GalleryItem>> { val responseLiveData: MutableLiveData<List<GalleryItem>> = MutableLiveData() flickrRequest.enqueue(object : Callback<FlickrResponse> { override fun onFailure(call: Call<FlickrResponse>, t: Throwable) { Log.e(TAG, "Failed to fetch photos", t) } override fun onResponse( call: Call<FlickrResponse>, response: Response<FlickrResponse> ) { Log.d(TAG, "Response received") val flickrResponse: FlickrResponse? = response.body() val photoResponse: PhotoResponse? = flickrResponse?.photos var galleryItems: List<GalleryItem> = photoResponse?.galleryItems ?: mutableListOf() galleryItems = galleryItems.filterNot { it.url.isNullOrBlank() } responseLiveData.value = galleryItems } }) return responseLiveData } @WorkerThread fun fetchPhoto(url: String): Bitmap? { val response: Response<ResponseBody> = flickrApi.fetchUrlBytes(url).execute() val bitmap = response.body()?.byteStream()?.use(BitmapFactory::decodeStream) Log.i(TAG, "Decoded bitmap=$bitmap from Response=$response") return bitmap } }
32.78125
85
0.674293
6e0960d3f5cb78f116cb3e3a10674b925d2faac9
52,117
html
HTML
.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/org.eclipse.osgi/bundles/154/1/.cp/javadoc/org/eclipse/emf/cdo/common/protocol/class-use/CDODataOutput.html
virckof/code-nuggets-16
61609fd224b12b203ece2ef78f8148b46d38761f
[ "MIT" ]
1
2020-05-24T19:22:03.000Z
2020-05-24T19:22:03.000Z
.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/org.eclipse.osgi/bundles/154/1/.cp/javadoc/org/eclipse/emf/cdo/common/protocol/class-use/CDODataOutput.html
virckof/code-nuggets-16
61609fd224b12b203ece2ef78f8148b46d38761f
[ "MIT" ]
null
null
null
.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/org.eclipse.osgi/bundles/154/1/.cp/javadoc/org/eclipse/emf/cdo/common/protocol/class-use/CDODataOutput.html
virckof/code-nuggets-16
61609fd224b12b203ece2ef78f8148b46d38761f
[ "MIT" ]
null
null
null
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <TITLE> Uses of Interface org.eclipse.emf.cdo.common.protocol.CDODataOutput (CDO Model Repository Documentation) </TITLE> <META NAME="date" CONTENT=""> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../html/book.css" TITLE="Style"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.eclipse.emf.cdo.common.protocol.CDODataOutput (CDO Model Repository Documentation)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../index.html?org/eclipse/emf/cdo/common/protocol/\class-useCDODataOutput.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="CDODataOutput.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Interface<br>org.eclipse.emf.cdo.common.protocol.CDODataOutput</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.eclipse.emf.cdo.common.id"><B>org.eclipse.emf.cdo.common.id</B></A></TD> <TD>Common concepts for dealing with object and revision IDs.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.eclipse.emf.cdo.common.model"><B>org.eclipse.emf.cdo.common.model</B></A></TD> <TD>Common concepts for dealing with models and types.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.eclipse.emf.cdo.common.util"><B>org.eclipse.emf.cdo.common.util</B></A></TD> <TD>Common utility classes, some common interfaces and exceptions.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.eclipse.emf.cdo.server"><B>org.eclipse.emf.cdo.server</B></A></TD> <TD>Server concepts for dealing with repositories and stores.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.eclipse.emf.cdo.server.db"><B>org.eclipse.emf.cdo.server.db</B></A></TD> <TD>Server concepts for dealing with DB stores and accessors.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.eclipse.emf.cdo.server.db.mapping"><B>org.eclipse.emf.cdo.server.db.mapping</B></A></TD> <TD>Server concepts for dealing with mapping strategies and mappings for classes, lists and types.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.eclipse.emf.cdo.spi.common.branch"><B>org.eclipse.emf.cdo.spi.common.branch</B></A></TD> <TD>Common service provider interfaces and useful base implementations for dealing with branches.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.eclipse.emf.cdo.spi.common.id"><B>org.eclipse.emf.cdo.spi.common.id</B></A></TD> <TD>Common service provider interfaces and useful base implementations for dealing with object and revision IDs.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.eclipse.emf.cdo.spi.common.model"><B>org.eclipse.emf.cdo.spi.common.model</B></A></TD> <TD>Common service provider interfaces and useful base implementations for dealing with models and types&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.eclipse.emf.cdo.spi.common.protocol"><B>org.eclipse.emf.cdo.spi.common.protocol</B></A></TD> <TD>Common base implementations for dealing with I/O of CDO data structures.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.eclipse.emf.cdo.spi.common.revision"><B>org.eclipse.emf.cdo.spi.common.revision</B></A></TD> <TD>Common service provider interfaces and useful base implementations for dealing with revisions and deltas.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.eclipse.emf.cdo.spi.server"><B>org.eclipse.emf.cdo.spi.server</B></A></TD> <TD>Server service provider interfaces and useful base implementations.&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.eclipse.emf.cdo.common.id"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A> in <A HREF="../../../../../../../org/eclipse/emf/cdo/common/id/package-summary.html">org.eclipse.emf.cdo.common.id</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../../org/eclipse/emf/cdo/common/id/package-summary.html">org.eclipse.emf.cdo.common.id</A> with parameters of type <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>CDOIDReference.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/common/id/CDOIDReference.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;void</CODE></FONT></TD> <TD><CODE><B>CDOIDUtil.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/common/id/CDOIDUtil.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput, org.eclipse.emf.cdo.common.id.CDOID)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, <A HREF="../../../../../../../org/eclipse/emf/cdo/common/id/CDOID.html" title="interface in org.eclipse.emf.cdo.common.id">CDOID</A>&nbsp;id)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.eclipse.emf.cdo.common.model"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A> in <A HREF="../../../../../../../org/eclipse/emf/cdo/common/model/package-summary.html">org.eclipse.emf.cdo.common.model</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../../org/eclipse/emf/cdo/common/model/package-summary.html">org.eclipse.emf.cdo.common.model</A> with parameters of type <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>CDOClassifierRef.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/common/model/CDOClassifierRef.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>CDOType.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/common/model/CDOType.html#writeValue(org.eclipse.emf.cdo.common.protocol.CDODataOutput, java.lang.Object)">writeValue</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;value)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.eclipse.emf.cdo.common.util"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A> in <A HREF="../../../../../../../org/eclipse/emf/cdo/common/util/package-summary.html">org.eclipse.emf.cdo.common.util</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../../org/eclipse/emf/cdo/common/util/package-summary.html">org.eclipse.emf.cdo.common.util</A> that return <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A></CODE></FONT></TD> <TD><CODE><B>CDOCommonUtil.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/common/util/CDOCommonUtil.html#createCDODataOutput(org.eclipse.net4j.util.io.ExtendedDataOutput, org.eclipse.emf.cdo.common.model.CDOPackageRegistry, org.eclipse.emf.cdo.common.id.CDOIDProvider)">createCDODataOutput</A></B>(<A HREF="../../../../../../../../../org.eclipse.net4j.util.doc/javadoc/org/eclipse/net4j/util/io/ExtendedDataOutput.html?is-external=true" title="class or interface in org.eclipse.net4j.util.io">ExtendedDataOutput</A>&nbsp;extendedDataOutputStream, <A HREF="../../../../../../../org/eclipse/emf/cdo/common/model/CDOPackageRegistry.html" title="interface in org.eclipse.emf.cdo.common.model">CDOPackageRegistry</A>&nbsp;packageRegistry, <A HREF="../../../../../../../org/eclipse/emf/cdo/common/id/CDOIDProvider.html" title="interface in org.eclipse.emf.cdo.common.id">CDOIDProvider</A>&nbsp;idProvider)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../../org/eclipse/emf/cdo/common/util/package-summary.html">org.eclipse.emf.cdo.common.util</A> with parameters of type <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>CDOFetchRule.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/common/util/CDOFetchRule.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.eclipse.emf.cdo.server"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A> in <A HREF="../../../../../../../org/eclipse/emf/cdo/server/package-summary.html">org.eclipse.emf.cdo.server</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../../org/eclipse/emf/cdo/server/package-summary.html">org.eclipse.emf.cdo.server</A> with parameters of type <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>IStoreAccessor.Raw.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/server/IStoreAccessor.Raw.html#rawExport(org.eclipse.emf.cdo.common.protocol.CDODataOutput, int, int, long, long)">rawExport</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, int&nbsp;fromBranchID, int&nbsp;toBranchID, long&nbsp;fromCommitTime, long&nbsp;toCommitTime)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Serializes all backend data within the given ranges such that it can be deserialized by the <A HREF="../../../../../../../org/eclipse/emf/cdo/server/IStoreAccessor.Raw.html#rawImport(org.eclipse.emf.cdo.common.protocol.CDODataInput, int, int, long, long, org.eclipse.net4j.util.om.monitor.OMMonitor)"><CODE>rawImport()</CODE></A> method of a different instance of the same implementation of <A HREF="../../../../../../../org/eclipse/emf/cdo/server/IStoreAccessor.Raw.html" title="interface in org.eclipse.emf.cdo.server"><CODE>raw store accessor</CODE></A>.</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.eclipse.emf.cdo.server.db"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A> in <A HREF="../../../../../../../org/eclipse/emf/cdo/server/db/package-summary.html">org.eclipse.emf.cdo.server.db</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../../org/eclipse/emf/cdo/server/db/package-summary.html">org.eclipse.emf.cdo.server.db</A> with parameters of type <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>IIDHandler.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/server/db/IIDHandler.html#rawExport(java.sql.Connection, org.eclipse.emf.cdo.common.protocol.CDODataOutput, long, long)">rawExport</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/sql/Connection.html?is-external=true" title="class or interface in java.sql">Connection</A>&nbsp;connection, <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, long&nbsp;fromCommitTime, long&nbsp;toCommitTime)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>IMetaDataManager.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/server/db/IMetaDataManager.html#rawExport(java.sql.Connection, org.eclipse.emf.cdo.common.protocol.CDODataOutput, long, long)">rawExport</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/sql/Connection.html?is-external=true" title="class or interface in java.sql">Connection</A>&nbsp;connection, <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, long&nbsp;fromCommitTime, long&nbsp;toCommitTime)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.eclipse.emf.cdo.server.db.mapping"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A> in <A HREF="../../../../../../../org/eclipse/emf/cdo/server/db/mapping/package-summary.html">org.eclipse.emf.cdo.server.db.mapping</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../../org/eclipse/emf/cdo/server/db/mapping/package-summary.html">org.eclipse.emf.cdo.server.db.mapping</A> with parameters of type <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>IMappingStrategy.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/server/db/mapping/IMappingStrategy.html#rawExport(org.eclipse.emf.cdo.server.db.IDBStoreAccessor, org.eclipse.emf.cdo.common.protocol.CDODataOutput, int, int, long, long)">rawExport</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/server/db/IDBStoreAccessor.html" title="interface in org.eclipse.emf.cdo.server.db">IDBStoreAccessor</A>&nbsp;accessor, <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, int&nbsp;lastReplicatedBranchID, int&nbsp;lastBranchID, long&nbsp;lastReplicatedCommitTime, long&nbsp;lastCommitTime)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.eclipse.emf.cdo.spi.common.branch"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A> in <A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/branch/package-summary.html">org.eclipse.emf.cdo.spi.common.branch</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/branch/package-summary.html">org.eclipse.emf.cdo.spi.common.branch</A> with parameters of type <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>InternalCDOBranchManager.BranchLoader.BranchInfo.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranchManager.BranchLoader.BranchInfo.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>InternalCDOBranchManager.BranchLoader.SubBranchInfo.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranchManager.BranchLoader.SubBranchInfo.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.eclipse.emf.cdo.spi.common.id"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A> in <A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/id/package-summary.html">org.eclipse.emf.cdo.spi.common.id</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/id/package-summary.html">org.eclipse.emf.cdo.spi.common.id</A> with parameters of type <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>abstract &nbsp;void</CODE></FONT></TD> <TD><CODE><B>AbstractCDOID.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/id/AbstractCDOID.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.eclipse.emf.cdo.spi.common.model"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A> in <A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/model/package-summary.html">org.eclipse.emf.cdo.spi.common.model</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/model/package-summary.html">org.eclipse.emf.cdo.spi.common.model</A> with parameters of type <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>InternalCDOPackageInfo.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/model/InternalCDOPackageInfo.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>InternalCDOPackageUnit.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/model/InternalCDOPackageUnit.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput, boolean)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, boolean&nbsp;withPackages)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.eclipse.emf.cdo.spi.common.protocol"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A> in <A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/protocol/package-summary.html">org.eclipse.emf.cdo.spi.common.protocol</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Classes in <A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/protocol/package-summary.html">org.eclipse.emf.cdo.spi.common.protocol</A> that implement <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/protocol/CDODataOutputImpl.html" title="class in org.eclipse.emf.cdo.spi.common.protocol">CDODataOutputImpl</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If the meaning of this type isn't clear, there really should be more of a description here...</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.eclipse.emf.cdo.spi.common.revision"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A> in <A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/package-summary.html">org.eclipse.emf.cdo.spi.common.revision</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/package-summary.html">org.eclipse.emf.cdo.spi.common.revision</A> with parameters of type <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;void</CODE></FONT></TD> <TD><CODE><B>RevisionInfo.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.html#doWriteResult(org.eclipse.emf.cdo.common.protocol.CDODataOutput, org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision, int)">doWriteResult</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, <A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/InternalCDORevision.html" title="interface in org.eclipse.emf.cdo.spi.common.revision">InternalCDORevision</A>&nbsp;revision, int&nbsp;referenceChunk)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>Not called anymore by the framework</I></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>RevisionInfo.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>RevisionInfo.Available.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.Available.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>RevisionInfo.Available.Pointer.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.Available.Pointer.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>BaseCDORevision.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/BaseCDORevision.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput, int)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, int&nbsp;referenceChunk)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>DelegatingCDORevision.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/DelegatingCDORevision.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput, int)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, int&nbsp;referenceChunk)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>InternalCDORevision.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/InternalCDORevision.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput, int)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, int&nbsp;referenceChunk)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>StubCDORevision.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/StubCDORevision.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput, int)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, int&nbsp;referenceChunk)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>BaseCDORevision.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/BaseCDORevision.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput, int, org.eclipse.emf.cdo.common.branch.CDOBranchPoint)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, int&nbsp;referenceChunk, <A HREF="../../../../../../../org/eclipse/emf/cdo/common/branch/CDOBranchPoint.html" title="interface in org.eclipse.emf.cdo.common.branch">CDOBranchPoint</A>&nbsp;securityContext)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>DelegatingCDORevision.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/DelegatingCDORevision.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput, int, org.eclipse.emf.cdo.common.branch.CDOBranchPoint)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, int&nbsp;referenceChunk, <A HREF="../../../../../../../org/eclipse/emf/cdo/common/branch/CDOBranchPoint.html" title="interface in org.eclipse.emf.cdo.common.branch">CDOBranchPoint</A>&nbsp;securityContext)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>InternalCDORevision.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/InternalCDORevision.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput, int, org.eclipse.emf.cdo.common.branch.CDOBranchPoint)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, int&nbsp;referenceChunk, <A HREF="../../../../../../../org/eclipse/emf/cdo/common/branch/CDOBranchPoint.html" title="interface in org.eclipse.emf.cdo.common.branch">CDOBranchPoint</A>&nbsp;securityContext)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>StubCDORevision.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/StubCDORevision.html#write(org.eclipse.emf.cdo.common.protocol.CDODataOutput, int, org.eclipse.emf.cdo.common.branch.CDOBranchPoint)">write</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, int&nbsp;referenceChunk, <A HREF="../../../../../../../org/eclipse/emf/cdo/common/branch/CDOBranchPoint.html" title="interface in org.eclipse.emf.cdo.common.branch">CDOBranchPoint</A>&nbsp;securityContext)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>RevisionInfo.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.html#writeResult(org.eclipse.emf.cdo.common.protocol.CDODataOutput, int)">writeResult</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, int&nbsp;referenceChunk)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>Not called anymore by the framework</I></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B>RevisionInfo.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.html#writeResult(org.eclipse.emf.cdo.common.protocol.CDODataOutput, int, org.eclipse.emf.cdo.common.branch.CDOBranchPoint)">writeResult</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, int&nbsp;referenceChunk, <A HREF="../../../../../../../org/eclipse/emf/cdo/common/branch/CDOBranchPoint.html" title="interface in org.eclipse.emf.cdo.common.branch">CDOBranchPoint</A>&nbsp;securityContext)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;void</CODE></FONT></TD> <TD><CODE><B>RevisionInfo.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.html#writeResult(org.eclipse.emf.cdo.common.protocol.CDODataOutput, org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision, int)">writeResult</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, <A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/InternalCDORevision.html" title="interface in org.eclipse.emf.cdo.spi.common.revision">InternalCDORevision</A>&nbsp;revision, int&nbsp;referenceChunk)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>Call <A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.html#writeResult(org.eclipse.emf.cdo.common.protocol.CDODataOutput, org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision, int, org.eclipse.emf.cdo.common.branch.CDOBranchPoint)"><CODE>RevisionInfo.writeResult(CDODataOutput, InternalCDORevision, int, CDOBranchPoint)</CODE></A></I></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;void</CODE></FONT></TD> <TD><CODE><B>RevisionInfo.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.html#writeResult(org.eclipse.emf.cdo.common.protocol.CDODataOutput, org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision, int, org.eclipse.emf.cdo.common.branch.CDOBranchPoint)">writeResult</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, <A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/InternalCDORevision.html" title="interface in org.eclipse.emf.cdo.spi.common.revision">InternalCDORevision</A>&nbsp;revision, int&nbsp;referenceChunk, <A HREF="../../../../../../../org/eclipse/emf/cdo/common/branch/CDOBranchPoint.html" title="interface in org.eclipse.emf.cdo.common.branch">CDOBranchPoint</A>&nbsp;securityContext)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;void</CODE></FONT></TD> <TD><CODE><B>RevisionInfo.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.html#writeRevision(org.eclipse.emf.cdo.common.protocol.CDODataOutput, int)">writeRevision</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, int&nbsp;referenceChunk)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>Not called anymore by the framework</I></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;void</CODE></FONT></TD> <TD><CODE><B>RevisionInfo.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.html#writeRevision(org.eclipse.emf.cdo.common.protocol.CDODataOutput, int, org.eclipse.emf.cdo.common.branch.CDOBranchPoint)">writeRevision</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, int&nbsp;referenceChunk, <A HREF="../../../../../../../org/eclipse/emf/cdo/common/branch/CDOBranchPoint.html" title="interface in org.eclipse.emf.cdo.common.branch">CDOBranchPoint</A>&nbsp;securityContext)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;void</CODE></FONT></TD> <TD><CODE><B>RevisionInfo.Available.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/RevisionInfo.Available.html#writeRevision(org.eclipse.emf.cdo.common.protocol.CDODataOutput, int, org.eclipse.emf.cdo.common.branch.CDOBranchPoint)">writeRevision</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, int&nbsp;referenceChunk, <A HREF="../../../../../../../org/eclipse/emf/cdo/common/branch/CDOBranchPoint.html" title="interface in org.eclipse.emf.cdo.common.branch">CDOBranchPoint</A>&nbsp;securityContext)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;void</CODE></FONT></TD> <TD><CODE><B>BaseCDORevision.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/revision/BaseCDORevision.html#writeSystemValues(org.eclipse.emf.cdo.common.protocol.CDODataOutput)">writeSystemValues</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.eclipse.emf.cdo.spi.server"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A> in <A HREF="../../../../../../../org/eclipse/emf/cdo/spi/server/package-summary.html">org.eclipse.emf.cdo.spi.server</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../../org/eclipse/emf/cdo/spi/server/package-summary.html">org.eclipse.emf.cdo.spi.server</A> with parameters of type <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../../org/eclipse/emf/cdo/spi/common/CDOReplicationInfo.html" title="interface in org.eclipse.emf.cdo.spi.common">CDOReplicationInfo</A></CODE></FONT></TD> <TD><CODE><B>InternalRepository.</B><B><A HREF="../../../../../../../org/eclipse/emf/cdo/spi/server/InternalRepository.html#replicateRaw(org.eclipse.emf.cdo.common.protocol.CDODataOutput, int, long)">replicateRaw</A></B>(<A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol">CDODataOutput</A>&nbsp;out, int&nbsp;lastReplicatedBranchID, long&nbsp;lastReplicatedCommitTime)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../org/eclipse/emf/cdo/common/protocol/CDODataOutput.html" title="interface in org.eclipse.emf.cdo.common.protocol"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../index.html?org/eclipse/emf/cdo/common/protocol/\class-useCDODataOutput.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="CDODataOutput.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <i>Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others.</i> </BODY> </HTML>
68.755937
556
0.669148
08d105cdd1c1d7778a630afe0ad7764b928b1a74
1,455
swift
Swift
Day04.playground/Sources/String Extension.swift
ankitbharti1994/PuzzleDay04
284b4c44ddfac2dfbff8a295d6959db53d208475
[ "Apache-2.0" ]
null
null
null
Day04.playground/Sources/String Extension.swift
ankitbharti1994/PuzzleDay04
284b4c44ddfac2dfbff8a295d6959db53d208475
[ "Apache-2.0" ]
null
null
null
Day04.playground/Sources/String Extension.swift
ankitbharti1994/PuzzleDay04
284b4c44ddfac2dfbff8a295d6959db53d208475
[ "Apache-2.0" ]
null
null
null
// // Extension.swift // Lister // // Created by Ankit Kumar Bharti on 27/07/18. // Copyright © 2018 Exilant. All rights reserved. // import Foundation public extension String { public var isValidPassphrase: Bool { let originalTextCollection = self.components(separatedBy: " ") guard originalTextCollection.count > 1 else { return false } let uniqueTextCollection = Set(originalTextCollection) return originalTextCollection.count == uniqueTextCollection.count } public var canRearrange: Bool { let textCollection = self.components(separatedBy: " ") guard textCollection.count > 1 else { return false } // TODO:- Remove this line guard textCollection.count == 2 else { for index0 in 0..<textCollection.count { for index1 in (index0 + 1)..<textCollection.count { if textCollection[index0].characterSet.sorted() == textCollection[index1].characterSet.sorted() { return true } } } return false } return textCollection.first!.characterSet == textCollection.last!.characterSet } public var characterSet: [Character] { var char = [Character]() for character in self { char.append(character) } return char } }
30.3125
117
0.578694
7294d3509c2c23b84e1c7785a23395f37c8f2e42
5,069
dart
Dart
lib/src/handle.dart
Nikasa1889/implicitly_animated_reorderable_list
fa5118bfc761e36cfa25ae5dd2d8672ee2c34ca2
[ "MIT" ]
null
null
null
lib/src/handle.dart
Nikasa1889/implicitly_animated_reorderable_list
fa5118bfc761e36cfa25ae5dd2d8672ee2c34ca2
[ "MIT" ]
null
null
null
lib/src/handle.dart
Nikasa1889/implicitly_animated_reorderable_list
fa5118bfc761e36cfa25ae5dd2d8672ee2c34ca2
[ "MIT" ]
null
null
null
import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'src.dart'; /// A Handle is used to initiate a drag/reorder of an item inside an /// [ImplicitlyAnimatedReorderableList]. /// /// A Handle must have a [Reorderable] and an [ImplicitlyAnimatedReorderableList] /// as its ancestor. class Handle extends StatefulWidget { /// The child of this Handle that can initiate a reorder. /// /// This might for instance be an [Icon] or a [ListTile]. final Widget child; /// The delay between when a pointer touched the [child] and /// when the drag is initiated. /// /// If the Handle wraps the whole item, the delay should be greater /// than `Duration.zero` as otherwise the list might become unscrollable. /// /// When the [ImplicitlyAnimatedReorderableList] was scrolled in the mean time, /// the reorder will be canceled. /// If the [ImplicitlyAnimatedReorderableList] uses a `NeverScrollableScrollPhysics` /// the Handle will instead use a parent `Scrollable` if there is one. final Duration delay; /// Whether to vibrate when a drag has been initiated. final bool vibrate; /// Creates a widget that can initiate a drag/reorder of an item inside an /// [ImplicitlyAnimatedReorderableList]. /// /// A Handle must have a [Reorderable] and an [ImplicitlyAnimatedReorderableList] /// as its ancestor. const Handle({ Key key, @required this.child, this.delay = Duration.zero, this.vibrate = true, }) : assert(delay != null), assert(child != null), assert(vibrate != null), super(key: key); @override _HandleState createState() => _HandleState(); } class _HandleState extends State<Handle> { ScrollableState _scrollable; // A custom handler used to cancel the pending onDragStart callbacks. Handler _handler; // The parent Reorderable item. ReorderableState _reorderable; // The parent list. ImplicitlyAnimatedReorderableListState _list; // Whether the ImplicitlyAnimatedReorderableList has a // scrollDirection of Axis.vertical. bool get _isVertical => _list?.isVertical ?? true; bool _inDrag = false; double _initialOffset; double _currentOffset; double get _delta => (_currentOffset ?? 0) - (_initialOffset ?? 0); void _onDragStarted(Offset pointer) { _removeScrollListener(); // If the list is already in drag we dont want to // initiate a new reorder. if (_list.inDrag) return; _inDrag = true; _initialOffset = _isVertical ? pointer.dy : pointer.dx; _list?.onDragStarted(_reorderable?.key); _reorderable.rebuild(); _vibrate(); } void _onDragUpdated(Offset pointer, bool upward) { _currentOffset = _isVertical ? pointer.dy : pointer.dx; _list?.onDragUpdated(_delta, isUpward: upward); } void _onDragEnded() { _inDrag = false; _handler?.cancel(); _list?.onDragEnded(); } void _vibrate() { if (widget.vibrate) HapticFeedback.mediumImpact(); } // A Handle should only initiate a reorder when the list didn't change it scroll // position in the meantime. bool get _useParentScrollable { final hasParent = _scrollable != null; final physics = _list?.widget?.physics; return hasParent && physics != null && physics is NeverScrollableScrollPhysics; } void _addScrollListener() { if (widget.delay > Duration.zero) { if (_useParentScrollable) { _scrollable.position.addListener(_cancelReorder); } else { _list?.scrollController?.addListener(_cancelReorder); } } } void _removeScrollListener() { if (widget.delay > Duration.zero) { if (_useParentScrollable) { _scrollable.position.removeListener(_cancelReorder); } else { _list?.scrollController?.removeListener(_cancelReorder); } } } void _cancelReorder() { _handler?.cancel(); _removeScrollListener(); if (_inDrag) _onDragEnded(); } @override Widget build(BuildContext context) { _list ??= ImplicitlyAnimatedReorderableList.of(context); assert(_list != null, 'No ancestor ImplicitlyAnimatedReorderableList was found in the hierarchy!'); _reorderable ??= Reorderable.of(context); assert(_reorderable != null, 'No ancestor Reorderable was found in the hierarchy!'); _scrollable = Scrollable.of(_list.context); return Listener( behavior: HitTestBehavior.translucent, onPointerDown: (event) { final pointer = event.localPosition; if (!_inDrag) { _cancelReorder(); _addScrollListener(); _handler = postDuration( widget.delay, () => _onDragStarted(pointer), ); } }, onPointerMove: (event) { final pointer = event.localPosition; final delta = _isVertical ? event.delta.dy : event.delta.dx; if (_inDrag) _onDragUpdated(pointer, delta.isNegative); }, onPointerUp: (_) => _cancelReorder(), onPointerCancel: (_) => _cancelReorder(), child: widget.child, ); } }
29.300578
103
0.677451
3db19e9cde8f069c97dde9ab4f03adc46ea568d5
274
rs
Rust
src/test/ui/consts/min_const_fn/address_of_const.rs
Eric-Arellano/rust
0f6f2d681b39c5f95459cd09cb936b6ceb27cd82
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
66,762
2015-01-01T08:32:03.000Z
2022-03-31T23:26:40.000Z
src/test/ui/consts/min_const_fn/address_of_const.rs
Eric-Arellano/rust
0f6f2d681b39c5f95459cd09cb936b6ceb27cd82
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
76,993
2015-01-01T00:06:33.000Z
2022-03-31T23:59:15.000Z
src/test/ui/consts/min_const_fn/address_of_const.rs
Eric-Arellano/rust
0f6f2d681b39c5f95459cd09cb936b6ceb27cd82
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
11,787
2015-01-01T00:01:19.000Z
2022-03-31T19:03:42.000Z
// check-pass #![feature(raw_ref_op)] const fn const_address_of_in_const() { let mut a = 0; let b = &raw const a; } struct X; impl X { const fn inherent_const_address_of_in_const() { let mut a = 0; let b = &raw const a; } } fn main() {}
13.7
51
0.580292
3514a0e63a8c32d507450f640339990d49c4c963
2,364
asm
Assembly
src/my_soft/spectrum/sped/sped54en/sped54en_paging.asm
chipsi007/zesarux
baddd4b27f5216343177d0a007977ad03ceea5fe
[ "BSD-3-Clause", "MIT" ]
null
null
null
src/my_soft/spectrum/sped/sped54en/sped54en_paging.asm
chipsi007/zesarux
baddd4b27f5216343177d0a007977ad03ceea5fe
[ "BSD-3-Clause", "MIT" ]
null
null
null
src/my_soft/spectrum/sped/sped54en/sped54en_paging.asm
chipsi007/zesarux
baddd4b27f5216343177d0a007977ad03ceea5fe
[ "BSD-3-Clause", "MIT" ]
null
null
null
; SPED - SPectrum Ensamblador Desensamblador / SuPer Ensamblador Desensamblador ; Copyright (C) 1995 Cesar Hernandez Bano ; ; This file is part of ZEsarUX. ; ; SPED is free software: you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation, either version 3 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program. If not, see <http://www.gnu.org/licenses/>. ;Paging routines that go to address 23296 ; LST+ RUTPAG ORG 23296 RAMNOR PUSH AF PUSH BC PAGNOR LD A,17 RAMNO2 LD BC,32765 OUT (C),A POP BC POP AF RET RAMEXT PUSH AF PUSH BC NUMPAG LD A,16 JR RAMNO2 ILDIR CALL RAMEXT LDIR JR RAMNOR ILDDR CALL RAMEXT LDDR JR RAMNOR LOAD0 CALL RAMEXT INC D EX AF,AF' DEC D DI CALL 1378 JR RAMNOR SAVE CALL RAMEXT CALL 1222 JR RAMNOR ILDAHL CALL RAMEXT ILDAH2 LD A,(HL) JR RAMNOR ILDHLA CALL RAMEXT ILDHL2 LD (HL),A JR RAMNOR CDIL0 CALL RAMEXT CDIL1 LD A,B CP D JR NZ,CDIL2 LD A,C CP E JR NZ,CDIL2 CALL RAMNOR JP CADIL5 CDIL2 LD A,HX CP H JR NZ,CDIL3 LD A,LX CP L JR NZ,CDIL3 SCF JR RAMNOR CDIL3 INC BC CDIL4 LD A,(HL) INC HL CP 13 JR NZ,CDIL4 JR CDIL1 RAMETI PUSH AF PUSH BC LD A,19 JR RAMNO2 ELDAHL CALL RAMETI JR ILDAH2 ELDHLA CALL RAMETI JR ILDHL2 RAMOBJ PUSH AF PUSH BC LD A,20 JR RAMNO2 OLDAHL CALL RAMOBJ JR ILDAH2 OLDHLA CALL RAMOBJ JR ILDHL2 DRST8 SET 4,(IY-17) DVUELV LD (DREGSP),SP LD SP,23552 CALL RAMNOR JP DVUEL1 DPOPR1 CALL RAMOBJ LD SP,(DREGSP) RET DBYSAL DEFS 7 DREGSP DEFW 0 DERR8 DEFW DRST8
21.888889
82
0.590525
abf5df7048a17489777308c82b76b33e476002ac
23,267
hpp
C++
source/timemory/variadic/types.hpp
dalg24/timemory
8cbbf89a25d8d460382664baeec0b13d5d4e2d38
[ "MIT" ]
null
null
null
source/timemory/variadic/types.hpp
dalg24/timemory
8cbbf89a25d8d460382664baeec0b13d5d4e2d38
[ "MIT" ]
null
null
null
source/timemory/variadic/types.hpp
dalg24/timemory
8cbbf89a25d8d460382664baeec0b13d5d4e2d38
[ "MIT" ]
null
null
null
// MIT License // // Copyright (c) 2020, The Regents of the University of California, // through Lawrence Berkeley National Laboratory (subject to receipt of any // required approvals from the U.S. Dept. of Energy). All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and // 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. /** \file timemory/variadic/types.hpp * \headerfile timemory/variadic/types.hpp "timemory/variadic/types.hpp" * * This is a declaration of all the variadic wrappers. * Care should be taken to make sure that this includes a minimal * number of additional headers. Also provides concat of types * */ #pragma once #include <cstdint> #include <iostream> #include <string> #include <type_traits> #include "timemory/mpl/concepts.hpp" #include "timemory/mpl/types.hpp" #include "timemory/utility/macros.hpp" /// /// \macro TSTAG /// \brief for tuple_size overloads, clang uses 'class tuple_size' while GCC uses /// 'struct tuple_size'... which results in a lot of mismatches-tag warnings /// #if !defined(TSTAG) # if defined(_TIMEMORY_CLANG) # define TSTAG(X) class # else # define TSTAG(X) X # endif #endif //======================================================================================// // namespace tim { //--------------------------------------------------------------------------------------// // // Forward declaration of variadic wrapper types // //--------------------------------------------------------------------------------------// template <typename... Types> class lightweight_tuple; template <typename... Types> class component_bundle; // actual definition: template <typename ApiT, typename... Types> class component_bundle<ApiT, Types...>; template <typename... Types> class component_tuple; template <typename... Types> class component_list; template <typename TupleT, typename ListT> class component_hybrid; template <typename... Types> class auto_bundle; // actual definition: template <typename ApiT, typename... Types> class auto_bundle<ApiT, Types...>; template <typename... Types> class auto_tuple; template <typename... Types> class auto_list; template <typename TupleT, typename ListT> class auto_hybrid; } // namespace tim //--------------------------------------------------------------------------------------// // // IS VARIADIC / IS WRAPPER // //--------------------------------------------------------------------------------------// // these are variadic types used to bundle components together TIMEMORY_DEFINE_VARIADIC_CONCEPT(is_variadic, std::tuple, true_type, typename) TIMEMORY_DEFINE_VARIADIC_CONCEPT(is_variadic, type_list, true_type, typename) // there are timemory-specific variadic wrappers TIMEMORY_DEFINE_VARIADIC_CONCEPT(is_wrapper, auto_hybrid, true_type, typename) TIMEMORY_DEFINE_VARIADIC_CONCEPT(is_wrapper, component_hybrid, true_type, typename) // {auto,component}_bundle are empty if one template is supplied TIMEMORY_DEFINE_TEMPLATE_CONCEPT(is_empty, auto_bundle, true_type, typename) TIMEMORY_DEFINE_TEMPLATE_CONCEPT(is_empty, component_bundle, true_type, typename) //======================================================================================// TIMEMORY_DEFINE_VARIADIC_CONCEPT_TYPE(tuple_type, std::tuple, typename, std::tuple<T...>) TIMEMORY_DEFINE_VARIADIC_CONCEPT_TYPE(auto_type, std::tuple, typename, auto_bundle<T...>) TIMEMORY_DEFINE_VARIADIC_CONCEPT_TYPE(component_type, std::tuple, typename, component_bundle<T...>) TIMEMORY_DEFINE_VARIADIC_CONCEPT_TYPE(tuple_type, type_list, typename, std::tuple<T...>) TIMEMORY_DEFINE_VARIADIC_CONCEPT_TYPE(auto_type, type_list, typename, auto_bundle<T...>) TIMEMORY_DEFINE_VARIADIC_CONCEPT_TYPE(component_type, type_list, typename, component_bundle<T...>) //======================================================================================// namespace tim { namespace concepts { template <typename T, typename... Types> struct tuple_type<component_bundle<T, Types...>> { using type = std::tuple<Types...>; }; // //--------------------------------------------------------------------------------------// // template <typename T, typename... Types> struct tuple_type<auto_bundle<T, Types...>> { using type = std::tuple<Types...>; }; } // namespace concepts } // namespace tim //======================================================================================// namespace tim { //--------------------------------------------------------------------------------------// // // convert all variadic wrappers into type lists // //--------------------------------------------------------------------------------------// // // Final result // //--------------------------------------------------------------------------------------// // template <typename... Types> struct type_list_only { using type = type_list<Types...>; }; // //--------------------------------------------------------------------------------------// // // Second to last result // //--------------------------------------------------------------------------------------// // template <typename... Lhs, typename... Rhs> struct type_list_only<type_list<Lhs...>, type_list<Rhs...>> { using type = typename type_list_only<Lhs..., Rhs...>::type; }; // //--------------------------------------------------------------------------------------// // // Encountered variadic while reducing but tail still exists // //--------------------------------------------------------------------------------------// // template <typename... Lhs, typename... Types, typename... Rhs> struct type_list_only<type_list<Lhs...>, std::tuple<Types...>, Rhs...> { using type = typename type_list_only<typename type_list_only<Lhs..., Types...>::type, typename type_list_only<Rhs...>::type>::type; }; template <typename... Lhs, typename... Types, typename... Rhs> struct type_list_only<type_list<Lhs...>, component_tuple<Types...>, Rhs...> { using type = typename type_list_only<typename type_list_only<Lhs..., Types...>::type, typename type_list_only<Rhs...>::type>::type; }; template <typename... Lhs, typename... Types, typename... Rhs> struct type_list_only<type_list<Lhs...>, component_list<Types...>, Rhs...> { using type = typename type_list_only<typename type_list_only<Lhs..., Types...>::type, typename type_list_only<Rhs...>::type>::type; }; template <typename Tup, typename Lst, typename... Lhs, typename... Rhs> struct type_list_only<type_list<Lhs...>, component_hybrid<Tup, Lst>, Rhs...> { using type = typename type_list_only<typename type_list_only<Lhs..., Tup, Lst>::type, typename type_list_only<Rhs...>::type>::type; }; template <typename... Lhs, typename... Types, typename... Rhs> struct type_list_only<type_list<Lhs...>, auto_tuple<Types...>, Rhs...> { using type = typename type_list_only<typename type_list_only<Lhs..., Types...>::type, typename type_list_only<Rhs...>::type>::type; }; template <typename... Lhs, typename... Types, typename... Rhs> struct type_list_only<type_list<Lhs...>, auto_list<Types...>, Rhs...> { using type = typename type_list_only<typename type_list_only<Lhs..., Types...>::type, typename type_list_only<Rhs...>::type>::type; }; template <typename Tup, typename Lst, typename... Lhs, typename... Rhs> struct type_list_only<type_list<Lhs...>, auto_hybrid<Tup, Lst>, Rhs...> { using type = typename type_list_only<typename type_list_only<Lhs..., Tup, Lst>::type, typename type_list_only<Rhs...>::type>::type; }; // //--------------------------------------------------------------------------------------// // // Listed first // //--------------------------------------------------------------------------------------// // template <typename... Lhs, typename... Rhs> struct type_list_only<type_list<Lhs...>, Rhs...> { using type = typename type_list_only<typename type_list_only<Lhs...>::type, typename type_list_only<Rhs...>::type>::type; }; template <typename... Types, typename... Rhs> struct type_list_only<std::tuple<Types...>, Rhs...> { using type = typename type_list_only<typename type_list_only<Types...>::type, typename type_list_only<Rhs...>::type>::type; }; template <typename... Types, typename... Rhs> struct type_list_only<component_tuple<Types...>, Rhs...> { using type = typename type_list_only<typename type_list_only<Types...>::type, typename type_list_only<Rhs...>::type>::type; }; template <typename... Types, typename... Rhs> struct type_list_only<component_list<Types...>, Rhs...> { using type = typename type_list_only<typename type_list_only<Types...>::type, typename type_list_only<Rhs...>::type>::type; }; template <typename... Types, typename... Rhs> struct type_list_only<auto_tuple<Types...>, Rhs...> { using type = typename type_list_only<typename type_list_only<Types...>::type, typename type_list_only<Rhs...>::type>::type; }; template <typename... Types, typename... Rhs> struct type_list_only<auto_list<Types...>, Rhs...> { using type = typename type_list_only<typename type_list_only<Types...>::type, typename type_list_only<Rhs...>::type>::type; }; template <typename Tup, typename Lst, typename... Rhs> struct type_list_only<component_hybrid<Tup, Lst>, Rhs...> { using tup_types = typename type_list_only<Tup>::type; using lst_types = typename type_list_only<Lst>::type; using type = component_hybrid<convert_t<tup_types, component_tuple<>>, convert_t<lst_types, component_list<>>>; }; template <typename Tup, typename Lst, typename... Rhs> struct type_list_only<auto_hybrid<Tup, Lst>, Rhs...> { using tup_types = typename type_list_only<Tup>::type; using lst_types = typename type_list_only<Lst>::type; using type = auto_hybrid<convert_t<tup_types, component_tuple<>>, convert_t<lst_types, component_list<>>>; }; // //--------------------------------------------------------------------------------------// // // Concatenation of variadic wrappers // //--------------------------------------------------------------------------------------// // namespace impl { template <typename... Types> struct concat { using type = std::tuple<Types...>; }; template <typename... Types> struct concat<type_list<Types...>> { using type = std::tuple<Types...>; }; template <typename... Types> struct concat<std::tuple<Types...>> { using type = std::tuple<Types...>; }; template <typename... Types> struct concat<component_tuple<Types...>> { using type = typename concat<Types...>::type; }; template <typename... Types> struct concat<component_list<Types...>> { using type = typename concat<Types...>::type; }; template <typename... Types> struct concat<component_list<Types*...>> : concat<component_list<Types...>> {}; template <typename... Types> struct concat<auto_tuple<Types...>> { using type = typename concat<Types...>::type; }; template <typename... Types> struct concat<auto_list<Types...>> { using type = typename concat<Types...>::type; }; template <typename... Types> struct concat<auto_list<Types*...>> : concat<auto_list<Types...>> {}; template <typename... Lhs, typename... Rhs> struct concat<std::tuple<Lhs...>, std::tuple<Rhs...>> { using type = typename concat<Lhs..., Rhs...>::type; }; //--------------------------------------------------------------------------------------// // component_hybrid //--------------------------------------------------------------------------------------// template <typename... TupTypes, typename... LstTypes> struct concat<component_hybrid<std::tuple<TupTypes...>, std::tuple<LstTypes...>>> { using tuple_type = component_tuple<TupTypes...>; using list_type = component_list<LstTypes...>; using type = component_hybrid<tuple_type, list_type>; }; template <typename... TupTypes, typename... LstTypes> struct concat<component_hybrid<component_tuple<TupTypes...>, std::tuple<LstTypes...>>> { using tuple_type = component_tuple<TupTypes...>; using list_type = component_list<LstTypes...>; using type = component_hybrid<tuple_type, list_type>; }; template <typename... TupTypes, typename... LstTypes> struct concat<component_hybrid<std::tuple<TupTypes...>, component_list<LstTypes...>>> { using tuple_type = component_tuple<TupTypes...>; using list_type = component_list<LstTypes...>; using type = component_hybrid<tuple_type, list_type>; }; template <typename... TupTypes, typename... LstTypes> struct concat<component_hybrid<type_list<TupTypes...>, type_list<LstTypes...>>> { using tuple_type = component_tuple<TupTypes...>; using list_type = component_list<LstTypes...>; using type = component_hybrid<tuple_type, list_type>; }; template <typename... TupTypes, typename... LstTypes> struct concat<component_hybrid<component_tuple<TupTypes...>, type_list<LstTypes...>>> { using tuple_type = component_tuple<TupTypes...>; using list_type = component_list<LstTypes...>; using type = component_hybrid<tuple_type, list_type>; }; template <typename... TupTypes, typename... LstTypes> struct concat<component_hybrid<type_list<TupTypes...>, component_list<LstTypes...>>> { using tuple_type = component_tuple<TupTypes...>; using list_type = component_list<LstTypes...>; using type = component_hybrid<tuple_type, list_type>; }; //--------------------------------------------------------------------------------------// // auto_hybrid //--------------------------------------------------------------------------------------// template <typename... TupTypes, typename... LstTypes> struct concat<auto_hybrid<std::tuple<TupTypes...>, std::tuple<LstTypes...>>> { using tuple_type = component_tuple<TupTypes...>; using list_type = component_list<LstTypes...>; using type = auto_hybrid<tuple_type, list_type>; }; template <typename... TupTypes, typename... LstTypes> struct concat<auto_hybrid<component_tuple<TupTypes...>, std::tuple<LstTypes...>>> { using tuple_type = component_tuple<TupTypes...>; using list_type = component_list<LstTypes...>; using type = auto_hybrid<tuple_type, list_type>; }; template <typename... TupTypes, typename... LstTypes> struct concat<auto_hybrid<std::tuple<TupTypes...>, component_list<LstTypes...>>> { using tuple_type = component_tuple<TupTypes...>; using list_type = component_list<LstTypes...>; using type = auto_hybrid<tuple_type, list_type>; }; template <typename... TupTypes, typename... LstTypes> struct concat<auto_hybrid<type_list<TupTypes...>, type_list<LstTypes...>>> { using tuple_type = component_tuple<TupTypes...>; using list_type = component_list<LstTypes...>; using type = auto_hybrid<tuple_type, list_type>; }; template <typename... TupTypes, typename... LstTypes> struct concat<auto_hybrid<component_tuple<TupTypes...>, type_list<LstTypes...>>> { using tuple_type = component_tuple<TupTypes...>; using list_type = component_list<LstTypes...>; using type = auto_hybrid<tuple_type, list_type>; }; template <typename... TupTypes, typename... LstTypes> struct concat<auto_hybrid<type_list<TupTypes...>, component_list<LstTypes...>>> { using tuple_type = component_tuple<TupTypes...>; using list_type = component_list<LstTypes...>; using type = auto_hybrid<tuple_type, list_type>; }; //--------------------------------------------------------------------------------------// // // Combine // //--------------------------------------------------------------------------------------// template <typename... Lhs, typename... Rhs> struct concat<std::tuple<Lhs...>, Rhs...> { using type = typename concat<typename concat<Lhs...>::type, typename concat<Rhs...>::type>::type; }; //--------------------------------------------------------------------------------------// // component_tuple //--------------------------------------------------------------------------------------// template <typename... Lhs, typename... Rhs> struct concat<component_tuple<Lhs...>, Rhs...> { using type = typename concat<typename concat<Lhs...>::type, typename concat<Rhs...>::type>::type; }; //--------------------------------------------------------------------------------------// // component_list //--------------------------------------------------------------------------------------// template <typename... Lhs, typename... Rhs> struct concat<component_list<Lhs...>, Rhs...> { using type = typename concat<typename concat<Lhs...>::type, typename concat<Rhs...>::type>::type; }; template <typename... Lhs, typename... Rhs> struct concat<component_list<Lhs...>*, Rhs*...> : public concat<component_list<Lhs...>, Rhs...> {}; template <typename... Lhs, typename... Rhs> struct concat<component_list<Lhs...>*, Rhs...> : public concat<component_list<Lhs...>, Rhs...> {}; //--------------------------------------------------------------------------------------// // auto_tuple //--------------------------------------------------------------------------------------// template <typename... Lhs, typename... Rhs> struct concat<auto_tuple<Lhs...>, Rhs...> { using type = typename concat<typename concat<Lhs...>::type, typename concat<Rhs...>::type>::type; }; //--------------------------------------------------------------------------------------// // auto_list //--------------------------------------------------------------------------------------// template <typename... Lhs, typename... Rhs> struct concat<auto_list<Lhs...>, Rhs...> { using type = typename concat<typename concat<Lhs...>::type, typename concat<Rhs...>::type>::type; }; template <typename... Lhs, typename... Rhs> struct concat<auto_list<Lhs...>*, Rhs*...> : public concat<auto_list<Lhs...>, Rhs...> {}; template <typename... Lhs, typename... Rhs> struct concat<auto_list<Lhs...>*, Rhs...> : public concat<auto_list<Lhs...>, Rhs...> {}; //--------------------------------------------------------------------------------------// // component_hybrid //--------------------------------------------------------------------------------------// template <typename Tup, typename Lst, typename... Rhs, typename... Tail> struct concat<component_hybrid<Tup, Lst>, component_tuple<Rhs...>, Tail...> { using type = typename concat<component_hybrid<typename concat<Tup, Rhs...>::type, Lst>, Tail...>::type; using tuple_type = typename type::tuple_t; using list_type = typename type::list_t; }; template <typename Tup, typename Lst, typename... Rhs, typename... Tail> struct concat<component_hybrid<Tup, Lst>, component_list<Rhs...>, Tail...> { using type = typename concat<component_hybrid<Tup, typename concat<Lst, Rhs...>::type>, Tail...>::type; using tuple_type = typename type::tuple_t; using list_type = typename type::list_t; }; //--------------------------------------------------------------------------------------// // auto_hybrid //--------------------------------------------------------------------------------------// template <typename Tup, typename Lst, typename... Rhs, typename... Tail> struct concat<auto_hybrid<Tup, Lst>, component_tuple<Rhs...>, Tail...> { using type = typename concat<auto_hybrid<typename concat<Tup, Rhs...>::type, Lst>, Tail...>::type; using tuple_type = typename type::tuple_t; using list_type = typename type::list_t; }; template <typename Tup, typename Lst, typename... Rhs, typename... Tail> struct concat<auto_hybrid<Tup, Lst>, component_list<Rhs...>, Tail...> { using type = typename concat<auto_hybrid<Tup, typename concat<Lst, Rhs...>::type>, Tail...>::type; using tuple_type = typename type::tuple_t; using list_type = typename type::list_t; }; } // namespace impl template <typename... Types> using concat = typename impl::concat<Types...>::type; // template <typename... Types> // using concat = typename type_list_only<Types...>::type; } // namespace tim //======================================================================================// namespace std { // //--------------------------------------------------------------------------------------// // // Forward declare intent to define these once all the type-traits have been set // after including "timemory/components/types.hpp" // //--------------------------------------------------------------------------------------// // template <typename... Types> TSTAG(struct) tuple_size<tim::lightweight_tuple<Types...>>; template <typename Tag, typename... Types> TSTAG(struct) tuple_size<tim::component_bundle<Tag, Types...>>; template <typename... Types> TSTAG(struct) tuple_size<tim::component_tuple<Types...>>; template <typename... Types> TSTAG(struct) tuple_size<tim::component_list<Types...>>; template <typename TupleT, typename ListT> TSTAG(struct) tuple_size<tim::component_hybrid<TupleT, ListT>>; template <typename TupleT, typename ListT> TSTAG(struct) tuple_size<tim::auto_hybrid<TupleT, ListT>>; template <typename... Types> TSTAG(struct) tuple_size<tim::auto_tuple<Types...>>; template <typename... Types> TSTAG(struct) tuple_size<tim::auto_list<Types...>>; // //--------------------------------------------------------------------------------------// // } // namespace std
35.576453
90
0.558989
0aa2abd7390e631b0f3b636d3a041b577b833405
10,146
go
Go
internal/dag/gatewayapi_processor.go
mattatcha/contour
c55d96a6419238a6b3574cd130caf29b9b7d0fff
[ "Apache-2.0" ]
null
null
null
internal/dag/gatewayapi_processor.go
mattatcha/contour
c55d96a6419238a6b3574cd130caf29b9b7d0fff
[ "Apache-2.0" ]
null
null
null
internal/dag/gatewayapi_processor.go
mattatcha/contour
c55d96a6419238a6b3574cd130caf29b9b7d0fff
[ "Apache-2.0" ]
null
null
null
// Copyright Project Contour 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 dag import ( "fmt" "net" "strings" "github.com/projectcontour/contour/internal/status" "github.com/sirupsen/logrus" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/validation" gatewayapi_v1alpha1 "sigs.k8s.io/gateway-api/apis/v1alpha1" ) const ( KindHTTPRoute = "HTTPRoute" ) // GatewayAPIProcessor translates Gateway API types into DAG // objects and adds them to the DAG. type GatewayAPIProcessor struct { logrus.FieldLogger dag *DAG source *KubernetesCache } // Run translates Service APIs into DAG objects and // adds them to the DAG. func (p *GatewayAPIProcessor) Run(dag *DAG, source *KubernetesCache) { p.dag = dag p.source = source // reset the processor when we're done defer func() { p.dag = nil p.source = nil }() // Gateway must be defined for resources to be processed. if p.source.gateway == nil { p.Error("Gateway is not defined!") return } for _, listener := range p.source.gateway.Spec.Listeners { var matchingRoutes []*gatewayapi_v1alpha1.HTTPRoute // Validate the Group on the selector is a supported type. if listener.Routes.Group != "" && listener.Routes.Group != gatewayapi_v1alpha1.GroupName { p.Errorf("Listener.Routes.Group %q is not supported.", listener.Routes.Group) continue } // Validate the Kind on the selector is a supported type. if listener.Routes.Kind != KindHTTPRoute { p.Errorf("Listener.Routes.Kind %q is not supported.", listener.Routes.Kind) continue } for _, route := range p.source.httproutes { // Filter the HTTPRoutes that match the gateway which Contour is configured to watch. // RouteBindingSelector defines a schema for associating routes with the Gateway. // If Namespaces and Selector are defined, only routes matching both selectors are associated with the Gateway. // ## RouteBindingSelector ## // // Selector specifies a set of route labels used for selecting routes to associate // with the Gateway. If this Selector is defined, only routes matching the Selector // are associated with the Gateway. An empty Selector matches all routes. nsMatches, err := p.namespaceMatches(listener.Routes.Namespaces, route) if err != nil { p.Errorf("error validating namespaces against Listener.Routes.Namespaces: %s", err) } selMatches, err := selectorMatches(listener.Routes.Selector, route.Labels) if err != nil { p.Errorf("error validating routes against Listener.Routes.Selector: %s", err) } if selMatches && nsMatches { // Empty Selector matches all routes. matchingRoutes = append(matchingRoutes, route) break } } // Process all the routes that match this Gateway. for _, matchingRoute := range matchingRoutes { p.computeHTTPRoute(matchingRoute) } } } // namespaceMatches returns true if the namespaces selector matches // the HTTPRoute that is being processed. func (p *GatewayAPIProcessor) namespaceMatches(namespaces gatewayapi_v1alpha1.RouteNamespaces, route *gatewayapi_v1alpha1.HTTPRoute) (bool, error) { // From indicates where Routes will be selected for this Gateway. // Possible values are: // * All: Routes in all namespaces may be used by this Gateway. // * Selector: Routes in namespaces selected by the selector may be used by // this Gateway. // * Same: Only Routes in the same namespace may be used by this Gateway. switch namespaces.From { case gatewayapi_v1alpha1.RouteSelectAll: return true, nil case gatewayapi_v1alpha1.RouteSelectSame: return p.source.ConfiguredGateway.Namespace == route.Namespace, nil case gatewayapi_v1alpha1.RouteSelectSelector: if len(namespaces.Selector.MatchLabels) == 0 || len(namespaces.Selector.MatchExpressions) == 0 { return false, fmt.Errorf("RouteNamespaces selector must be specified when `RouteSelectType=Selector`") } // Look up the HTTPRoute's namespace in the list of cached namespaces. if ns := p.source.namespaces[route.Namespace]; ns != nil { // Check that the route's namespace is included in the Gateway's // namespace selector/expression. l, err := metav1.LabelSelectorAsSelector(&namespaces.Selector) if err != nil { return false, err } // Look for matching labels on Selector. return l.Matches(labels.Set(ns.Labels)), nil } } return true, nil } // selectorMatches returns true if the selector matches the labels on the object or is not defined. func selectorMatches(selector metav1.LabelSelector, objLabels map[string]string) (bool, error) { // If a selector is defined then check that it matches the labels on the object. if len(selector.MatchLabels) > 0 || len(selector.MatchExpressions) > 0 { l, err := metav1.LabelSelectorAsSelector(&selector) if err != nil { return false, err } // Look for matching labels on Selector. return l.Matches(labels.Set(objLabels)), nil } // If no selector is defined then it matches by default. return true, nil } func (p *GatewayAPIProcessor) computeHTTPRoute(route *gatewayapi_v1alpha1.HTTPRoute) { routeAccessor, commit := p.dag.StatusCache.HTTPRouteAccessor(route) defer commit() // Validate TLS Configuration if route.Spec.TLS != nil { routeAccessor.AddCondition(status.ConditionNotImplemented, metav1.ConditionTrue, status.ReasonNotImplemented, "HTTPRoute.Spec.TLS: Not yet implemented.") } // Determine the hosts on the route, if no hosts // are defined, then set to "*". var hosts []string if len(route.Spec.Hostnames) == 0 { hosts = append(hosts, "*") } else { for _, host := range route.Spec.Hostnames { hostname := string(host) if isIP := net.ParseIP(hostname) != nil; isIP { p.Errorf("hostname %q must be a DNS name, not an IP address", hostname) continue } if strings.Contains(hostname, "*") { if errs := validation.IsWildcardDNS1123Subdomain(hostname); errs != nil { p.Errorf("invalid hostname %q: %v", hostname, errs) continue } } else { if errs := validation.IsDNS1123Subdomain(hostname); errs != nil { p.Errorf("invalid listener hostname %q", hostname, errs) continue } } hosts = append(hosts, string(host)) } } for _, rule := range route.Spec.Rules { var pathPrefixes []string var services []*Service for _, match := range rule.Matches { switch match.Path.Type { case gatewayapi_v1alpha1.PathMatchPrefix: pathPrefixes = append(pathPrefixes, stringOrDefault(match.Path.Value, "/")) default: routeAccessor.AddCondition(status.ConditionNotImplemented, metav1.ConditionTrue, status.ReasonPathMatchType, "HTTPRoute.Spec.Rules.PathMatch: Only Prefix match type is supported.") } } if len(rule.ForwardTo) == 0 { routeAccessor.AddCondition(status.ConditionResolvedRefs, metav1.ConditionFalse, status.ReasonDegraded, "At least one Spec.Rules.ForwardTo must be specified.") continue } // Validate the ForwardTos. for _, forward := range rule.ForwardTo { // Verify the service is valid if forward.ServiceName == nil { routeAccessor.AddCondition(status.ConditionResolvedRefs, metav1.ConditionFalse, status.ReasonDegraded, "Spec.Rules.ForwardTo.ServiceName must be specified.") continue } // TODO: Do not require port to be present (#3352). if forward.Port == nil { routeAccessor.AddCondition(status.ConditionResolvedRefs, metav1.ConditionFalse, status.ReasonDegraded, "Spec.Rules.ForwardTo.ServicePort must be specified.") continue } meta := types.NamespacedName{Name: *forward.ServiceName, Namespace: route.Namespace} // TODO: Refactor EnsureService to take an int32 so conversion to intstr is not needed. service, err := p.dag.EnsureService(meta, intstr.FromInt(int(*forward.Port)), p.source) if err != nil { routeAccessor.AddCondition(status.ConditionResolvedRefs, metav1.ConditionFalse, status.ReasonDegraded, fmt.Sprintf("Service %q does not exist in namespace %q", meta.Name, meta.Namespace)) continue } services = append(services, service) } if len(services) == 0 { routeAccessor.AddCondition(status.ConditionResolvedRefs, metav1.ConditionFalse, status.ReasonDegraded, "All Spec.Rules.ForwardTos are invalid.") continue } routes := p.routes(pathPrefixes, services) for _, vhost := range hosts { vhost := p.dag.EnsureVirtualHost(ListenerName{Name: vhost, ListenerName: "ingress_http"}) for _, route := range routes { vhost.addRoute(route) } } } // Determine if any errors exist in conditions and set the "Admitted" // condition accordingly. switch len(routeAccessor.Conditions) { case 0: routeAccessor.AddCondition(gatewayapi_v1alpha1.ConditionRouteAdmitted, metav1.ConditionTrue, status.ReasonValid, "Valid HTTPRoute") default: routeAccessor.AddCondition(gatewayapi_v1alpha1.ConditionRouteAdmitted, metav1.ConditionFalse, status.ReasonErrorsExist, "Errors found, check other Conditions for details.") } } // routes builds a []*dag.Route for the supplied set of pathPrefixes & services. func (p *GatewayAPIProcessor) routes(pathPrefixes []string, services []*Service) []*Route { var clusters []*Cluster var routes []*Route for _, service := range services { clusters = append(clusters, &Cluster{ Upstream: service, Protocol: service.Protocol, }) } for _, prefix := range pathPrefixes { r := &Route{ Clusters: clusters, } r.PathMatchCondition = &PrefixMatchCondition{Prefix: prefix} routes = append(routes, r) } return routes }
34.277027
191
0.73014
046f57adc52fe3a7002cccee56bac6bb5d133bcf
1,264
java
Java
exam2/AsociativeArrays/exercise/Orders.java
mvw21/problems3e
23cf072ef7d0acfe474eb3e55e0354ae49d8d448
[ "MIT" ]
null
null
null
exam2/AsociativeArrays/exercise/Orders.java
mvw21/problems3e
23cf072ef7d0acfe474eb3e55e0354ae49d8d448
[ "MIT" ]
null
null
null
exam2/AsociativeArrays/exercise/Orders.java
mvw21/problems3e
23cf072ef7d0acfe474eb3e55e0354ae49d8d448
[ "MIT" ]
null
null
null
package AsociativeArrays.exercise; import java.util.*; public class Orders { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); LinkedHashMap<String, List<Double>> products = new LinkedHashMap<>(); String command = scanner.nextLine(); while (!"buy".equals(command)) { String[] data = command.split("\\s+"); String product = data[0]; double price = Double.parseDouble(data[1]); double quantity = Integer.parseInt(data[2]); if (!products.containsKey(product)) { products.put(product, new ArrayList<>(Arrays.asList(price, quantity))); } else { List<Double> newPrice = new ArrayList<>(); newPrice.add(price); double oldQuantity = products.get(product).get(1); newPrice.add(oldQuantity + quantity); products.put(product, newPrice); } command = scanner.nextLine(); } products.forEach((key, value) -> { double multiply = value.get(0) * value.get(1); System.out.printf("%s -> %.2f%n", key, multiply); }); } }
34.162162
88
0.529272
05bfb78567d7497191b1a9447613c0a0ba6664fa
729
html
HTML
test.html
lampjian/front_endjs
c1798d1051b6c5a6fa533c36fc774a6b2833a744
[ "MIT" ]
null
null
null
test.html
lampjian/front_endjs
c1798d1051b6c5a6fa533c36fc774a6b2833a744
[ "MIT" ]
null
null
null
test.html
lampjian/front_endjs
c1798d1051b6c5a6fa533c36fc774a6b2833a744
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html> <head> <title>test-show date</title> <meta charset="utf-8"> </head> <body> <p> <em>Time: <script language="javascript"> var date = new Date(); var weekday = date.getDay(); var month = date.getMonth()+1; var day = date.getDate(); var cur_year = date.getFullYear(); var year = (cur_year>200)?cur_year:1900+cur_year; if(weekday == 0) weekday="Sunday"; else if(weekday==1) weekday="Monday"; else if(weekday == 2) weekday="Tuesday"; else if(weekday==3) weekday="Wednesday"; else if(weekday == 4) weekday="Tuesday"; else if(weekday==5) weekday="Friday"; else if(weekday==6) weekday="Saturday"; document.write(year+'-'+month+'-'+day+'-'+weeekday); </script></em> </p> </body> </html>
19.702703
52
0.648834
80b7599f873ea5c5f8a1dbf3e1be97bc19a58d11
10,252
java
Java
sarf-web-service/src/main/java/sarfwebservice/sarf/bridges/quad/QuadUnaugmentedBridgeImpl.java
alsaydi/sarf
b3ad7c9f9f7f90e9d97d7dc51611420626ca42de
[ "MIT" ]
14
2021-10-15T22:29:32.000Z
2022-03-13T20:54:53.000Z
sarf-web-service/src/main/java/sarfwebservice/sarf/bridges/quad/QuadUnaugmentedBridgeImpl.java
alsaydi/sarf
b3ad7c9f9f7f90e9d97d7dc51611420626ca42de
[ "MIT" ]
21
2021-09-01T23:35:30.000Z
2022-03-02T05:47:59.000Z
sarf-web-service/src/main/java/sarfwebservice/sarf/bridges/quad/QuadUnaugmentedBridgeImpl.java
alsaydi/sarf
b3ad7c9f9f7f90e9d97d7dc51611420626ca42de
[ "MIT" ]
2
2019-08-26T10:22:17.000Z
2021-04-01T20:41:24.000Z
package sarfwebservice.sarf.bridges.quad; /* * * MIT License * * Copyright (c) 2021 Abdalaziz Alsaydi * * 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. */ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import sarf.*; import sarf.gerund.modifier.quadrilateral.QuadrilateralStandardModifier; import sarf.gerund.quadrilateral.unaugmented.QuadrilateralUnaugmentedGerundConjugator; import sarf.gerund.quadrilateral.unaugmented.QuadrilateralUnaugmentedNomenGerundConjugator; import sarf.kov.KovRulesManager; import sarf.noun.quadriliteral.modifier.activeparticiple.ActiveParticipleModifier; import sarf.noun.quadriliteral.modifier.passiveparticiple.PassiveParticipleModifier; import sarf.noun.quadriliteral.unaugmented.UnaugmentedQuadrilateralActiveParticipleConjugator; import sarf.noun.quadriliteral.unaugmented.UnaugmentedQuadrilateralPassiveParticipleConjugator; import sarf.verb.quadriliteral.modifier.QuadrilateralModifier; import sarf.verb.quadriliteral.unaugmented.QuadUnaugmentedImperativeConjugator; import sarf.verb.quadriliteral.unaugmented.UnaugmentedQuadrilateralRoot; import sarf.verb.quadriliteral.unaugmented.active.QuadActivePresentConjugator; import sarf.verb.quadriliteral.unaugmented.active.QuadriActivePastConjugator; import sarf.verb.quadriliteral.unaugmented.passive.QuadPassivePresentConjugator; import sarf.verb.quadriliteral.unaugmented.passive.QuadriUnaugmentedPassivePastConjugator; import java.util.List; @Service public class QuadUnaugmentedBridgeImpl implements QuadUnaugmentedBridge { private final SarfDictionary sarfDictionary; private final KovRulesManager kovRulesManager; private final QuadriActivePastConjugator quadriActivePastConjugator; private final QuadriUnaugmentedPassivePastConjugator quadriPassivePastConjugator; private final UnaugmentedQuadrilateralActiveParticipleConjugator activeParticipleConjugator; private final sarf.noun.quadriliteral.modifier.activeparticiple.ActiveParticipleModifier activeParticipleModifier; private final QuadActivePresentConjugator quadActivePresentConjugator; private final QuadrilateralModifier quadrilateralModifier; private final UnaugmentedQuadrilateralPassiveParticipleConjugator passiveParticipleConjugator; private final sarf.noun.quadriliteral.modifier.passiveparticiple.PassiveParticipleModifier passiveParticipleModifier; private final QuadrilateralUnaugmentedGerundConjugator gerundConjugator; private final QuadrilateralStandardModifier standardModifier; private final QuadrilateralUnaugmentedNomenGerundConjugator nomenGerundConjugator; private final QuadUnaugmentedImperativeConjugator quadUnaugmentedImperativeConjugator; private final QuadPassivePresentConjugator quadPassivePresentConjugator; @Autowired public QuadUnaugmentedBridgeImpl(SarfDictionary sarfDictionary, KovRulesManager kovRulesManager , QuadriActivePastConjugator quadriActivePastConjugator , QuadriUnaugmentedPassivePastConjugator quadriPassivePastConjugator , UnaugmentedQuadrilateralActiveParticipleConjugator activeParticipleConjugator , ActiveParticipleModifier activeParticipleModifier , QuadActivePresentConjugator quadActivePresentConjugator , QuadrilateralModifier quadrilateralModifier , UnaugmentedQuadrilateralPassiveParticipleConjugator passiveParticipleConjugator , PassiveParticipleModifier passiveParticipleModifier , QuadrilateralUnaugmentedGerundConjugator gerundConjugator , QuadrilateralStandardModifier standardModifier , QuadrilateralUnaugmentedNomenGerundConjugator nomenGerundConjugator , QuadUnaugmentedImperativeConjugator quadUnaugmentedImperativeConjugator , QuadPassivePresentConjugator quadPassivePresentConjugator) { this.sarfDictionary = sarfDictionary; this.kovRulesManager = kovRulesManager; this.quadriActivePastConjugator = quadriActivePastConjugator; this.quadriPassivePastConjugator = quadriPassivePastConjugator; this.activeParticipleConjugator = activeParticipleConjugator; this.activeParticipleModifier = activeParticipleModifier; this.quadActivePresentConjugator = quadActivePresentConjugator; this.quadrilateralModifier = quadrilateralModifier; this.passiveParticipleConjugator = passiveParticipleConjugator; this.passiveParticipleModifier = passiveParticipleModifier; this.gerundConjugator = gerundConjugator; this.standardModifier = standardModifier; this.nomenGerundConjugator = nomenGerundConjugator; this.quadUnaugmentedImperativeConjugator = quadUnaugmentedImperativeConjugator; this.quadPassivePresentConjugator = quadPassivePresentConjugator; } @Override public List<WordPresenter> retrievePastConjugations(UnaugmentedQuadrilateralRoot root, KindOfVerb kov, boolean active){ var kovRule = kovRulesManager.getQuadrilateralKovRule(root.getC1(), root.getC2(), root.getC3(), root.getC4()); var verbs = active ? quadriActivePastConjugator.createVerbList(root) : quadriPassivePastConjugator.createVerbList(root); var conjugationResult = quadrilateralModifier.build(root, 0, kovRule.getKov(), verbs, SystemConstants.PAST_TENSE, active, true) .getFinalResult(); return conjugationResult; } @Override public List<WordPresenter> retrieveNominativePresent(UnaugmentedQuadrilateralRoot root, KindOfVerb kov, boolean active) { var kovRule = kovRulesManager.getQuadrilateralKovRule(root.getC1(), root.getC2(), root.getC3(), root.getC4()); var verbs = active ? quadActivePresentConjugator.createNominativeVerbList(root) : quadPassivePresentConjugator.createNominativeVerbList(root); var conjugationResult = quadrilateralModifier.build(root, 0, kovRule.getKov(), verbs, SystemConstants.PRESENT_TENSE, active, true) .getFinalResult(); return conjugationResult; } @Override public List<WordPresenter> retrieveAccusativePresent(UnaugmentedQuadrilateralRoot root, KindOfVerb kov, boolean active) { var kovRule = kovRulesManager.getQuadrilateralKovRule(root.getC1(), root.getC2(), root.getC3(), root.getC4()); var verbs = active ? quadActivePresentConjugator.createAccusativeVerbList(root) : quadPassivePresentConjugator.createAccusativeVerbList(root); var conjugationResult = quadrilateralModifier.build(root, 0, kovRule.getKov(), verbs, SystemConstants.PRESENT_TENSE, active, true) .getFinalResult(); return conjugationResult; } @Override public List<WordPresenter> retrieveJussivePresent(UnaugmentedQuadrilateralRoot root, KindOfVerb kov, boolean active) { var kovRule = kovRulesManager.getQuadrilateralKovRule(root.getC1(), root.getC2(), root.getC3(), root.getC4()); var verbs = active ? quadActivePresentConjugator.createJussiveVerbList(root) : quadPassivePresentConjugator.createJussiveVerbList(root); var conjugationResult = quadrilateralModifier.build(root, 0, kovRule.getKov(), verbs, SystemConstants.PRESENT_TENSE, active, true) .getFinalResult(); return conjugationResult; } @Override public List<WordPresenter> retrieveEmphasizedPresent(UnaugmentedQuadrilateralRoot root, KindOfVerb kov, boolean active) { var kovRule = kovRulesManager.getQuadrilateralKovRule(root.getC1(), root.getC2(), root.getC3(), root.getC4()); var verbs = active ? quadActivePresentConjugator.createEmphasizedVerbList(root) : quadPassivePresentConjugator.createEmphasizedVerbList(root); var conjugationResult = quadrilateralModifier.build(root, 0, kovRule.getKov(), verbs, SystemConstants.PRESENT_TENSE, active, true) .getFinalResult(); return conjugationResult; } @Override public List<WordPresenter> retrieveImperative(UnaugmentedQuadrilateralRoot root, KindOfVerb kov) { var kovRule = kovRulesManager.getQuadrilateralKovRule(root.getC1(), root.getC2(), root.getC3(), root.getC4()); var verbs = quadUnaugmentedImperativeConjugator.createVerbList(root); var conjugationResult = quadrilateralModifier.build(root, 0, kovRule.getKov(), verbs, SystemConstants.NOT_EMPHASIZED_IMPERATIVE_TENSE, true) .getFinalResult().stream().map(wp -> wp.isEmpty() ? WordPresenter.fromText("-") : wp).toList(); return conjugationResult; } @Override public List<WordPresenter> retrieveEmphasizedImperative(UnaugmentedQuadrilateralRoot root, KindOfVerb kov) { var kovRule = kovRulesManager.getQuadrilateralKovRule(root.getC1(), root.getC2(), root.getC3(), root.getC4()); var verbs = quadUnaugmentedImperativeConjugator.createEmphasizedVerbList(root); var conjugationResult = quadrilateralModifier.build(root, 0, kovRule.getKov(), verbs, SystemConstants.EMPHASIZED_IMPERATIVE_TENSE, true) .getFinalResult().stream().map(wp -> wp.isEmpty() ? WordPresenter.fromText("-") : wp).toList(); return conjugationResult; } }
60.305882
150
0.788432
2f39c8834c6fdde3b0f856136b374995efa1f929
2,310
java
Java
src/main/java/seedu/address/model/expense/Budget.java
jltham/tp
e759bbd1b12e3567879f90b72328572deea33e28
[ "MIT" ]
null
null
null
src/main/java/seedu/address/model/expense/Budget.java
jltham/tp
e759bbd1b12e3567879f90b72328572deea33e28
[ "MIT" ]
null
null
null
src/main/java/seedu/address/model/expense/Budget.java
jltham/tp
e759bbd1b12e3567879f90b72328572deea33e28
[ "MIT" ]
null
null
null
package seedu.address.model.expense; import static seedu.address.commons.util.CollectionUtil.requireAllNonNull; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.Objects; /** * Represents the Budget in the Expense Expert. */ public class Budget { /** * Attribute fields */ private static DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); private final Amount budgetAmount; private final Date budgetDate; /** * Constructs a (@code Budget). * Every field must be present and not null. * * @param budgetAmount is valid non-null amount * @param budgetDate is valid non-null date */ public Budget(Amount budgetAmount, Date budgetDate) { requireAllNonNull(budgetAmount, budgetDate); this.budgetAmount = budgetAmount; this.budgetDate = budgetDate; } /** * Constructs a (@code Budget). * Every field must be present and not null. * * @param budgetAmount is valid non-null amount */ public Budget(Amount budgetAmount) { requireAllNonNull(budgetAmount); this.budgetAmount = budgetAmount; this.budgetDate = new Date(LocalDate.now().format(dtf)); } public Amount getBudgetAmount() { return this.budgetAmount; } public Date getBudgetDate() { return this.budgetDate; } @Override public String toString() { final StringBuilder builder = new StringBuilder(); builder.append("Budget amount: ") .append(getBudgetAmount()) .append("; Budget set on: ") .append(getBudgetDate()); return builder.toString(); } @Override public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof Budget)) { return false; } Budget otherBudget = (Budget) other; return otherBudget.getBudgetAmount().equals(getBudgetAmount()) && otherBudget.getBudgetDate().equals(getBudgetDate()); } @Override public int hashCode() { // use this method for custom fields hashing instead of implementing your own return Objects.hash(budgetAmount, budgetDate); } }
27.176471
85
0.630736
afdd26fcb3b3c14971922a9946634d4ee20043a6
3,404
html
HTML
examples/for-exmobi/agile_lite/server/jsp/www/assets/third/seedsui/components/progressbar.html
skyydq/agile-lite
36dc1ce92489f9794f7932543608aae0f73a6025
[ "MIT" ]
16
2017-02-07T03:16:20.000Z
2018-02-09T02:24:58.000Z
examples/for-exmobi/agile_lite/server/jsp/www/assets/third/seedsui/components/progressbar.html
skyydq/agile-lite
36dc1ce92489f9794f7932543608aae0f73a6025
[ "MIT" ]
1
2017-05-31T08:01:27.000Z
2017-06-01T05:25:33.000Z
examples/for-exmobi/agile_lite/server/jsp/www/assets/third/seedsui/components/progressbar.html
skyydq/agile-lite
36dc1ce92489f9794f7932543608aae0f73a6025
[ "MIT" ]
6
2017-02-07T03:16:35.000Z
2021-05-17T07:34:35.000Z
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"><meta name="format-detection" content="telephone=no"> <title>progressbar</title> <link rel="stylesheet" href="../plugin/seedsui/seedsui.min.css"> </head> <body> <!--头部--> <header> <div class="titlebar"> <a href="javascript:back()"> <i class="icon icon-arrowleft"></i> </a> <h1>ProgressBar</h1> </div> </header> <!--主体--> <article> <div class="title">Progress Bar</div> <div class="progress-bar radius8"> <span class="progress" style="width: 35%"></span> <span class="text left"> <span class="timer" data-duration="1000" data-to="35">0</span> <span>%</span> </span> </div> <br> <div class="progress-bar radiusround"> <span class="progress" style="width: 45%"></span> <span class="text right"> <span class="timer" data-duration="1000" data-to="16">0</span> <span>/36</span> </span> </div> <br> <div class="progress-bar"> <span class="progress" style="width: 25%"></span> </div> <br> <div class="progress-bar radius8"> <span class="progress" style="width: 35%"></span> </div> <br> <div class="progress-bar radiusround"> <span class="progress" style="width: 45%"></span> </div> <br> <div class="title">Progress 3D</div> <div class="progress-bar threed"> <span class="progress" style="width: 25%"></span> </div> <br> <div class="progress-bar threed radius8"> <span class="progress" style="width: 35%"></span> </div> <br> <div class="progress-bar threed radiusround"> <span class="progress" style="width: 45%"></span> </div> <br> <div class="title">Progress Striped (can animate stripe example 2)</div> <div class="progress-bar striped"> <span class="progress" style="width: 25%"></span> </div> <br> <div class="progress-bar striped radius8"> <span class="progress animated" style="width: 35%"></span> </div> <br> <div class="progress-bar striped radiusround"> <span class="progress" style="width: 45%"></span> </div> <br> <div class="title">Progress Bar with Text</div> <div class="progress-bar"> <span class="progress" style="width: 25%"></span> <span class="text center"> <span class="timer" data-duration="1000" data-to="25">0</span> <span>%</span> </span> </div> <br> </article> <script src="../plugin/jquery/jquery.min.js"></script> <script src="../plugin/seedsui/seedsui.min.js"></script> <!--Exmobi能力--> <script src="../plugin/exmobi/exmobi.js"></script> <!--禁止ios弹性--> <script src="../plugin/inobounce/inobounce.min.js"></script> <script> //定义exmobi返回 function back(){history.go(-1);} Animate.counter(); </script> </body> </html>
32.419048
182
0.516451
263f94bbe07b1f222bdf3e5d058fc5233ff4343e
3,420
java
Java
pmd-core/src/test/java/net/sourceforge/pmd/util/treeexport/TreeRenderersTest.java
zhangxinngang/pmd
6efd1774db59d9842ef41cde02bc44b7d6e2e404
[ "Apache-2.0" ]
null
null
null
pmd-core/src/test/java/net/sourceforge/pmd/util/treeexport/TreeRenderersTest.java
zhangxinngang/pmd
6efd1774db59d9842ef41cde02bc44b7d6e2e404
[ "Apache-2.0" ]
null
null
null
pmd-core/src/test/java/net/sourceforge/pmd/util/treeexport/TreeRenderersTest.java
zhangxinngang/pmd
6efd1774db59d9842ef41cde02bc44b7d6e2e404
[ "Apache-2.0" ]
1
2020-04-27T11:52:43.000Z
2020-04-27T11:52:43.000Z
/* * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ package net.sourceforge.pmd.util.treeexport; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.hamcrest.Matchers; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import net.sourceforge.pmd.lang.ast.DummyNode; import net.sourceforge.pmd.lang.ast.xpath.Attribute; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertySource; /** * */ public class TreeRenderersTest { @Rule public ExpectedException expect = ExpectedException.none(); @Test public void testStandardRenderersAreRegistered() { Assert.assertEquals(TreeRenderers.XML, TreeRenderers.findById(TreeRenderers.XML.id())); } @Test public void testXmlPropertiesAvailable() { PropertySource properties = TreeRenderers.XML.newPropertyBundle(); Assert.assertThat(properties.getPropertyDescriptors(), Matchers.<PropertyDescriptor<?>>containsInAnyOrder(TreeRenderers.XML_LINE_SEPARATOR, TreeRenderers.XML_RENDER_COMMON_ATTRIBUTES, TreeRenderers.XML_RENDER_PROLOG, TreeRenderers.XML_USE_SINGLE_QUOTES)); } @Test public void testXmlDescriptorDump() throws IOException { PropertySource bundle = TreeRenderers.XML.newPropertyBundle(); bundle.setProperty(TreeRenderers.XML_RENDER_PROLOG, false); bundle.setProperty(TreeRenderers.XML_USE_SINGLE_QUOTES, false); bundle.setProperty(TreeRenderers.XML_LINE_SEPARATOR, "\n"); TreeRenderer renderer = TreeRenderers.XML.produceRenderer(bundle); StringBuilder out = new StringBuilder(); renderer.renderSubtree(dummyTree1(), out); Assert.assertEquals("<dummyNode foo=\"bar\" ohio=\"4\">\n" + " <dummyNode o=\"ha\" />\n" + " <dummyNode />\n" + "</dummyNode>\n", out.toString()); } public MyDummyNode dummyTree1() { MyDummyNode dummy = new MyDummyNode(); dummy.setXPathAttribute("foo", "bar"); dummy.setXPathAttribute("ohio", "4"); MyDummyNode dummy1 = new MyDummyNode(); dummy1.setXPathAttribute("o", "ha"); MyDummyNode dummy2 = new MyDummyNode(); dummy.jjtAddChild(dummy1, 0); dummy.jjtAddChild(dummy2, 1); return dummy; } private static class MyDummyNode extends DummyNode { private final Map<String, String> attributes = new HashMap<>(); public void setXPathAttribute(String name, String value) { attributes.put(name, value); } @Override public Iterator<Attribute> getXPathAttributesIterator() { List<Attribute> attrs = new ArrayList<>(); for (String name : attributes.keySet()) { attrs.add(new Attribute(this, name, attributes.get(name))); } return attrs.iterator(); } } }
28.983051
120
0.618713
8af55ccceb8eef830d9142a2952658dc31eb0e38
2,149
swift
Swift
Sources/OTCore/Extensions/CoreGraphics/CGPoint.swift
orchetect/OTCore
b2d03c622dfbc10d5231a1dc3fd831f2a3b76d93
[ "MIT" ]
3
2020-12-13T06:36:33.000Z
2022-02-23T20:43:41.000Z
Sources/OTCore/Extensions/CoreGraphics/CGPoint.swift
orchetect/OTCore
b2d03c622dfbc10d5231a1dc3fd831f2a3b76d93
[ "MIT" ]
1
2021-01-17T09:45:38.000Z
2021-01-21T06:52:44.000Z
Sources/OTCore/Extensions/CoreGraphics/CGPoint.swift
orchetect/OTCore
b2d03c622dfbc10d5231a1dc3fd831f2a3b76d93
[ "MIT" ]
2
2021-01-25T16:08:03.000Z
2022-02-23T20:43:45.000Z
// // CGPoint.swift // OTCore • https://github.com/orchetect/OTCore // #if canImport(CoreGraphics) import CoreGraphics extension CGPoint { /// **OTCore:** /// Returns the point with the X value inverted. @inlinable public var xInverted: CGPoint { var newX = x newX.negate() return .init(x: newX, y: y) } /// **OTCore:** /// Returns the point with the Y value inverted. @inlinable public var yInverted: CGPoint { var newY = y newY.negate() return .init(x: x, y: newY) } /// **OTCore:** /// Returns the point with the X and Y value inverted. @inlinable public var xyInverted: CGPoint { var newX = x newX.negate() var newY = y newY.negate() return .init(x: newX, y: newY) } } extension CGPoint { /// **OTCore:** /// Returns the distance between two coordinate points. @inlinable public func distance(to other: CGPoint) -> CGFloat { hypot(other.x - self.x, other.y - self.y) } /// **OTCore:** /// Returns the angle in degrees (0.0...360.0) between two `CGPoint`s. /// The origin (0°/360°) is on the positive X axis. /// Degrees ascend counterclockwise. /// /// To calculate the where cardinal North is the origin (0°), use `cardinalAngle(to:)` instead. @inlinable public func angle(to other: CGPoint) -> CGFloat { let calc = atan2(other.y - self.y, other.x - self.x).radiansToDegrees if calc < 0 { return calc + 360.0 } return calc } /// **OTCore:** /// Returns the angle in degrees (0.0...360.0) between two `CGPoint`s. /// The origin (0°/360°) is on the positive Y axis (cardinal North). /// Degrees ascend clockwise. @inlinable public func cardinalAngle(to other: CGPoint) -> CGFloat { (360.0 - angle(to: other) + 90.0) .wrapped(around: 0.0..<360.0) } } #endif
23.358696
99
0.527222
cfb892141fdffadcb4e2c9909a437639fa7cd771
1,044
swift
Swift
Constrictor/ConstrictorTests/Unit Tests/Modifiers/LayoutStateUnitTests.swift
pedrommcarrasco/Constrictor
ffba6ada06d45866700c47e7ebe315cbfdb2917b
[ "MIT" ]
54
2018-05-24T17:08:36.000Z
2021-12-01T03:32:18.000Z
Constrictor/ConstrictorTests/Unit Tests/Modifiers/LayoutStateUnitTests.swift
pedrommcarrasco/Constrictor
ffba6ada06d45866700c47e7ebe315cbfdb2917b
[ "MIT" ]
21
2018-05-25T10:38:14.000Z
2019-04-06T13:22:16.000Z
Constrictor/ConstrictorTests/Unit Tests/Modifiers/LayoutStateUnitTests.swift
pedrommcarrasco/Constrictor
ffba6ada06d45866700c47e7ebe315cbfdb2917b
[ "MIT" ]
5
2018-06-08T16:31:25.000Z
2020-02-16T15:47:20.000Z
// // LayoutStateUnitTests.swift // ConstrictorTests // // Created by Pedro Carrasco on 15/01/2019. // Copyright © 2019 Pedro Carrasco. All rights reserved. // import XCTest @testable import Constrictor // MARK: - LayoutStateUnitTests class LayoutStateUnitTests: XCTestCase { // MARK: Properties private var view: UIView! private var constraint: NSLayoutConstraint! // MARK: Lifecycle override func setUp() { super.setUp() view = UIView() constraint = view.widthAnchor.constraint(equalTo: view.heightAnchor) } override func tearDown() { view = nil constraint = nil super.tearDown() } } // MARK: - Tests extension LayoutStateUnitTests { // MARK: NSLayoutConstraint's Sugar func testConstraintEnable() { constraint.enable() XCTAssertEqual(constraint.isActive, true) } func testConstraintDisable() { constraint.isActive = true constraint.disable() XCTAssertEqual(constraint.isActive, false) } }
21.75
76
0.659004
a334fdc271cf181bb16483fa26a94efea93f8c0c
4,279
swift
Swift
Tek3/Java/Java_epicture_2017/IOS_Epicture/Epicture/SignupViewController.swift
Estayparadox/Epitech-Bundle
e4395961bb86bf494e3c84ab44c27b5a9afc6c6c
[ "MIT" ]
30
2018-10-26T12:54:11.000Z
2022-02-04T18:18:57.000Z
Tek3/Java/Java_epicture_2017/IOS_Epicture/Epicture/SignupViewController.swift
Estayparadox/Epitech-Bundle
e4395961bb86bf494e3c84ab44c27b5a9afc6c6c
[ "MIT" ]
null
null
null
Tek3/Java/Java_epicture_2017/IOS_Epicture/Epicture/SignupViewController.swift
Estayparadox/Epitech-Bundle
e4395961bb86bf494e3c84ab44c27b5a9afc6c6c
[ "MIT" ]
26
2018-11-20T18:11:39.000Z
2022-01-28T21:05:30.000Z
// // SignupViewController.swift // Epicture // // Created by Joseph Pereniguez on 06/02/2018. // Copyright © 2018 Joseph Pereniguez. All rights reserved. // import UIKit import Firebase class SignupViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { @IBOutlet weak var nameField: UITextField! @IBOutlet weak var emailField: UITextField! @IBOutlet weak var password: UITextField! @IBOutlet weak var comPwField: UITextField! @IBOutlet weak var imageView: UIImageView! @IBOutlet weak var nextBtn: UIButton! let picker = UIImagePickerController() var userStorage: FIRStorageReference! var ref: FIRDatabaseReference! override func viewDidLoad() { super.viewDidLoad() picker.delegate = self let storage = FIRStorage.storage().reference(forURL: "gs://epicture-461ba.appspot.com") ref = FIRDatabase.database().reference() userStorage = storage.child("users") } @IBAction func selectImagePressed(_ sender: Any) { picker.allowsEditing = true picker.sourceType = .photoLibrary present(picker, animated: true, completion: nil) } @objc func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { if let image = info[UIImagePickerControllerEditedImage] as? UIImage { self.imageView.image = image nextBtn.isHidden = false } self.dismiss(animated: true, completion: nil) } @IBAction func nextPressed(_ sender: Any) { guard nameField.text != "", emailField.text != "", password.text != "", comPwField.text != "" else { return } if password.text == comPwField.text { FIRAuth.auth()?.createUser(withEmail: emailField.text!, password: password.text!, completion: { (user, error) in if let error = error { print(error.localizedDescription) } if let user = user { let changeRequest = FIRAuth.auth()!.currentUser!.profileChangeRequest() changeRequest.displayName = self.nameField.text! changeRequest.commitChanges(completion: nil) let imageRef = self.userStorage.child("\(user.uid).jpg") let data = UIImageJPEGRepresentation(self.imageView.image!, 0.5) let uploadTask = imageRef.put(data!, metadata: nil, completion: { (metadata, err) in if err != nil { print(err!.localizedDescription) } imageRef.downloadURL(completion: { (url, er) in if er != nil { print(er!.localizedDescription) } if let url = url { let userInfo: [String : Any] = ["uid" : user.uid, "full name" : self.nameField.text!, "ulrToImage" : url.absoluteString] self.ref.child("users").child(user.uid).setValue(userInfo) let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "usersVC") self.present(vc, animated: true, completion: nil) } }) }) uploadTask.resume() } }) } else { print("Error: Password does not match") } } }
38.205357
133
0.482356
ff3624a1a2cf330bad4f5e64b1e656110cfb732d
522
swift
Swift
SOVA/SOVA/Extensions/Array.swift
sovaai/sova-ma-ios
c53f1c981b3d2c565fd7dc2e156a4d59e575fcf7
[ "Apache-2.0" ]
1
2020-11-18T20:54:28.000Z
2020-11-18T20:54:28.000Z
SOVA/SOVA/Extensions/Array.swift
sovaai/sova-ma-ios
c53f1c981b3d2c565fd7dc2e156a4d59e575fcf7
[ "Apache-2.0" ]
null
null
null
SOVA/SOVA/Extensions/Array.swift
sovaai/sova-ma-ios
c53f1c981b3d2c565fd7dc2e156a4d59e575fcf7
[ "Apache-2.0" ]
1
2021-01-18T00:19:21.000Z
2021-01-18T00:19:21.000Z
// // Array.swift // SOVA // // Created by Мурат Камалов on 09.10.2020. // import Foundation extension Array where Element: Hashable { func difference(from other: [Element]) -> [Element] { let thisSet = Set(self) let otherSet = Set(other) return Array(thisSet.symmetricDifference(otherSet)) } } extension Dictionary{ var jsonData: Data? { do { return try JSONSerialization.data(withJSONObject: self ) } catch { return nil } } }
19.333333
68
0.595785
2896d133fbd695ec22f98442e1ee265098691836
38,874
cc
C++
libclingo/src/astv2_parse.cc
ingambe/clingo
e5e7db405319fd0beeeb3d013e15e23b0b0d4636
[ "MIT" ]
1
2020-09-11T08:21:48.000Z
2020-09-11T08:21:48.000Z
libclingo/src/astv2_parse.cc
CaptainUnbrauchbar/clingo
58cb702db83c23aedea28b26a617102fae9b557a
[ "MIT" ]
null
null
null
libclingo/src/astv2_parse.cc
CaptainUnbrauchbar/clingo
58cb702db83c23aedea28b26a617102fae9b557a
[ "MIT" ]
null
null
null
// {{{ MIT License // Copyright 2017 Roland Kaminski // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. // }}} #include <clingo/astv2.hh> namespace Gringo { namespace Input { namespace { template <class T> T &get(AST &ast, clingo_ast_attribute name) { return mpark::get<T>(ast.value(name)); } template <class T> T const &get(AST const &ast, clingo_ast_attribute name) { return mpark::get<T>(ast.value(name)); } AST *getOpt(AST const &ast, clingo_ast_attribute name) { if (!ast.hasValue(name)) { return nullptr; } return mpark::get<OAST>(ast.value(name)).ast.get(); } struct ASTParser { public: ASTParser(Logger &log, INongroundProgramBuilder &prg) : log_(log), prg_(prg) { } // {{{1 statement void parseStatement(AST const &ast) { switch (ast.type()) { case clingo_ast_type_rule: { return prg_.rule(get<Location>(ast, clingo_ast_attribute_location), parseHeadLiteral(*get<SAST>(ast, clingo_ast_attribute_head)), parseBodyLiteralVec(get<AST::ASTVec>(ast, clingo_ast_attribute_body))); } case clingo_ast_type_definition: { return prg_.define(get<Location>(ast, clingo_ast_attribute_location), get<String>(ast, clingo_ast_attribute_name), parseTerm(*get<SAST>(ast, clingo_ast_attribute_value)), get<int>(ast, clingo_ast_attribute_is_default) != 0, log_); } case clingo_ast_type_show_signature: { return prg_.showsig(get<Location>(ast, clingo_ast_attribute_location), Sig(get<String>(ast, clingo_ast_attribute_name), get<int>(ast, clingo_ast_attribute_arity), get<int>(ast, clingo_ast_attribute_positive) == 0), ast.hasValue(clingo_ast_attribute_csp) && get<int>(ast, clingo_ast_attribute_csp) != 0); } case clingo_ast_type_show_term: { return prg_.show(get<Location>(ast, clingo_ast_attribute_location), parseTerm(*get<SAST>(ast, clingo_ast_attribute_term)), parseBodyLiteralVec(get<AST::ASTVec>(ast, clingo_ast_attribute_body)), ast.hasValue(clingo_ast_attribute_csp) && get<int>(ast, clingo_ast_attribute_csp) != 0); } case clingo_ast_type_minimize: { return prg_.optimize(get<Location>(ast, clingo_ast_attribute_location), parseTerm(*get<SAST>(ast, clingo_ast_attribute_weight)), parseTerm(*get<SAST>(ast, clingo_ast_attribute_priority)), parseTermVec(get<AST::ASTVec>(ast, clingo_ast_attribute_terms)), parseBodyLiteralVec(get<AST::ASTVec>(ast, clingo_ast_attribute_body))); } case clingo_ast_type_script: { switch (get<int>(ast, clingo_ast_attribute_script_type)) { case clingo_ast_script_type_python: { return prg_.python(get<Location>(ast, clingo_ast_attribute_location), get<String>(ast, clingo_ast_attribute_code)); } case clingo_ast_script_type_lua: { return prg_.lua(get<Location>(ast, clingo_ast_attribute_location), get<String>(ast, clingo_ast_attribute_code)); } } break; } case clingo_ast_type_program: { return prg_.block(get<Location>(ast, clingo_ast_attribute_location), get<String>(ast, clingo_ast_attribute_name), parseIdVec(get<AST::ASTVec>(ast, clingo_ast_attribute_parameters))); } case clingo_ast_type_external: { return prg_.external(get<Location>(ast, clingo_ast_attribute_location), parseAtom(*get<SAST>(ast, clingo_ast_attribute_atom)), parseBodyLiteralVec(get<AST::ASTVec>(ast, clingo_ast_attribute_body)), parseTerm(*get<SAST>(ast, clingo_ast_attribute_external_type))); } case clingo_ast_type_edge: { return prg_.edge(get<Location>(ast, clingo_ast_attribute_location), prg_.termvecvec(prg_.termvecvec(), prg_.termvec(prg_.termvec(prg_.termvec(), parseTerm(*get<SAST>(ast, clingo_ast_attribute_node_u))), parseTerm(*get<SAST>(ast, clingo_ast_attribute_node_v)))), parseBodyLiteralVec(get<AST::ASTVec>(ast, clingo_ast_attribute_body))); } case clingo_ast_type_heuristic: { return prg_.heuristic(get<Location>(ast, clingo_ast_attribute_location), parseAtom(*get<SAST>(ast, clingo_ast_attribute_atom)), parseBodyLiteralVec(get<AST::ASTVec>(ast, clingo_ast_attribute_body)), parseTerm(*get<SAST>(ast, clingo_ast_attribute_bias)), parseTerm(*get<SAST>(ast, clingo_ast_attribute_priority)), parseTerm(*get<SAST>(ast, clingo_ast_attribute_modifier))); } case clingo_ast_type_project_atom: { return prg_.project(get<Location>(ast, clingo_ast_attribute_location), parseAtom(*get<SAST>(ast, clingo_ast_attribute_atom)), parseBodyLiteralVec(get<AST::ASTVec>(ast, clingo_ast_attribute_body))); } case clingo_ast_type_project_signature: { return prg_.project(get<Location>(ast, clingo_ast_attribute_location), Sig(get<String>(ast, clingo_ast_attribute_name), get<int>(ast, clingo_ast_attribute_arity), get<int>(ast, clingo_ast_attribute_positive) == 0)); } case clingo_ast_type_defined: { return prg_.defined(get<Location>(ast, clingo_ast_attribute_location), Sig(get<String>(ast, clingo_ast_attribute_name), get<int>(ast, clingo_ast_attribute_arity), get<int>(ast, clingo_ast_attribute_positive) == 0)); } case clingo_ast_type_theory_definition: { return prg_.theorydef(get<Location>(ast, clingo_ast_attribute_location), get<String>(ast, clingo_ast_attribute_name), parseTheoryAtomDefinitionVec(parseTheoryTermDefinitionVec(get<AST::ASTVec>(ast, clingo_ast_attribute_terms)), get<AST::ASTVec>(ast, clingo_ast_attribute_atoms)), log_); } default: { throw std::runtime_error("invalid ast: statement expected"); } } } private: template <class T> T fail_(char const *message) { throw std::runtime_error(message); } bool require_(bool cond, char const *message) { if (!cond) { fail_<void>(message); } return false; } // {{{1 terms IdVecUid parseIdVec(AST::ASTVec const &asts) { auto uid = prg_.idvec(); for (auto const &ast : asts) { require_(ast->type() == clingo_ast_type_id, "invalid ast: id required"); prg_.idvec(uid, get<Location>(*ast, clingo_ast_attribute_location), get<String>(*ast, clingo_ast_attribute_name)); } return uid; } static UnOp parseUnOp(int num) { switch (num) { case clingo_ast_unary_operator_minus: { return UnOp::NEG; } case clingo_ast_unary_operator_negation: { return UnOp::NOT; } case clingo_ast_unary_operator_absolute: { return UnOp::ABS; } default: { throw std::runtime_error("invalid ast: invalid unary operator"); } } } static BinOp parseBinOp(int num) { switch (num) { case clingo_ast_binary_operator_xor: { return BinOp::XOR; } case clingo_ast_binary_operator_or: { return BinOp::OR; } case clingo_ast_binary_operator_and: { return BinOp::AND; } case clingo_ast_binary_operator_plus: { return BinOp::ADD; } case clingo_ast_binary_operator_minus: { return BinOp::SUB; } case clingo_ast_binary_operator_multiplication: { return BinOp::MUL; } case clingo_ast_binary_operator_division: { return BinOp::DIV; } case clingo_ast_binary_operator_modulo: { return BinOp::MOD; } case clingo_ast_binary_operator_power: { return BinOp::POW; } default: { throw std::runtime_error("invalid ast: invalid binary operator"); } } } TermUid parseTerm(AST const &ast) { switch (ast.type()) { case clingo_ast_type_variable: { return prg_.term(get<Location>(ast, clingo_ast_attribute_location), get<String>(ast, clingo_ast_attribute_name)); } case clingo_ast_type_symbolic_term: { return prg_.term(get<Location>(ast, clingo_ast_attribute_location), get<Symbol>(ast, clingo_ast_attribute_symbol)); } case clingo_ast_type_unary_operation: { return prg_.term(get<Location>(ast, clingo_ast_attribute_location), parseUnOp(get<int>(ast, clingo_ast_attribute_operator_type)), parseTerm(*get<SAST>(ast, clingo_ast_attribute_argument))); } case clingo_ast_type_binary_operation: { return prg_.term(get<Location>(ast, clingo_ast_attribute_location), parseBinOp(get<int>(ast, clingo_ast_attribute_operator_type)), parseTerm(*get<SAST>(ast, clingo_ast_attribute_left)), parseTerm(*get<SAST>(ast, clingo_ast_attribute_right))); } case clingo_ast_type_interval: { return prg_.term(get<Location>(ast, clingo_ast_attribute_location), parseTerm(*get<SAST>(ast, clingo_ast_attribute_left)), parseTerm(*get<SAST>(ast, clingo_ast_attribute_right))); } case clingo_ast_type_function: { auto external = ast.hasValue(clingo_ast_attribute_external) && get<int>(ast, clingo_ast_attribute_external) != 0; auto name = get<String>(ast, clingo_ast_attribute_name); require_(!name.empty() || !external, "invalid ast: external functions must have a name"); return !name.empty() ? prg_.term(get<Location>(ast, clingo_ast_attribute_location), name, prg_.termvecvec(prg_.termvecvec(), parseTermVec(get<AST::ASTVec>(ast, clingo_ast_attribute_arguments))), external) : prg_.term(get<Location>(ast, clingo_ast_attribute_location), parseTermVec(get<AST::ASTVec>(ast, clingo_ast_attribute_arguments)), true); } case clingo_ast_type_pool: { return prg_.pool(get<Location>(ast, clingo_ast_attribute_location), parseTermVec(get<AST::ASTVec>(ast, clingo_ast_attribute_arguments))); } default: { throw std::runtime_error("invalid ast: term expected"); } } } TermVecUid parseTermVec(AST::ASTVec const &asts) { TermVecUid uid = prg_.termvec(); for (auto const &ast : asts) { prg_.termvec(uid, parseTerm(*ast)); } return uid; } CSPMulTermUid parseCSPMulTerm(AST const &ast) { require_(ast.type() == clingo_ast_type_csp_product, "invalid ast: csp product required"); auto const *variable = getOpt(ast, clingo_ast_attribute_variable); return variable != nullptr ? prg_.cspmulterm(get<Location>(ast, clingo_ast_attribute_location), parseTerm(*get<SAST>(ast, clingo_ast_attribute_coefficient)), parseTerm(*variable)) : prg_.cspmulterm(get<Location>(ast, clingo_ast_attribute_location), parseTerm(*get<SAST>(ast, clingo_ast_attribute_coefficient))); } CSPAddTermUid parseCSPAddTerm(AST const &ast) { require_(ast.type() == clingo_ast_type_csp_sum, "invalid ast: csp sum required"); auto const &terms = get<AST::ASTVec>(ast, clingo_ast_attribute_terms); require_(!terms.empty(), "invalid ast: csp sums terms must not be empty"); auto it = terms.begin(); auto ie = terms.end(); auto uid = prg_.cspaddterm(get<Location>(**it, clingo_ast_attribute_location), parseCSPMulTerm(**it)); for (++it; it != ie; ++it) { uid = prg_.cspaddterm(get<Location>(**it, clingo_ast_attribute_location), uid, parseCSPMulTerm(**it), true); } return uid; } TheoryTermUid parseTheoryTerm(AST const &ast) { switch (ast.type()) { case clingo_ast_type_symbolic_term : { return prg_.theorytermvalue(get<Location>(ast, clingo_ast_attribute_location), get<Symbol>(ast, clingo_ast_attribute_symbol)); } case clingo_ast_type_variable: { return prg_.theorytermvar(get<Location>(ast, clingo_ast_attribute_location), get<String>(ast, clingo_ast_attribute_name)); } case clingo_ast_type_theory_sequence: { switch (get<int>(ast, clingo_ast_attribute_sequence_type)) { case clingo_ast_theory_sequence_type_tuple: { return prg_.theorytermtuple(get<Location>(ast, clingo_ast_attribute_location), parseTheoryOptermVec(get<AST::ASTVec>(ast, clingo_ast_attribute_terms))); } case clingo_ast_theory_sequence_type_list: { return prg_.theoryoptermlist(get<Location>(ast, clingo_ast_attribute_location), parseTheoryOptermVec(get<AST::ASTVec>(ast, clingo_ast_attribute_terms))); } case clingo_ast_theory_sequence_type_set: { return prg_.theorytermset(get<Location>(ast, clingo_ast_attribute_location), parseTheoryOptermVec(get<AST::ASTVec>(ast, clingo_ast_attribute_terms))); } default: { throw std::runtime_error("invalid ast: invalid theory sequence type"); } } } case clingo_ast_type_theory_function: { return prg_.theorytermfun(get<Location>(ast, clingo_ast_attribute_location), get<String>(ast, clingo_ast_attribute_name), parseTheoryOptermVec(get<AST::ASTVec>(ast, clingo_ast_attribute_arguments))); } case clingo_ast_type_theory_unparsed_term: { return prg_.theorytermopterm(get<Location>(ast, clingo_ast_attribute_location), parseTheoryUnparsedTermElements(get<AST::ASTVec>(ast, clingo_ast_attribute_elements))); } default: { throw std::runtime_error("invalid ast: theory term expected"); } } } TheoryOptermVecUid parseTheoryOptermVec(AST::ASTVec const &asts) { auto uid = prg_.theoryopterms(); for (auto const &ast : asts) { uid = prg_.theoryopterms(uid, get<Location>(*ast, clingo_ast_attribute_location), parseTheoryOpterm(*ast)); } return uid; } TheoryOpVecUid parseTheoryOpVec(AST::StrVec const &strs) { auto uid = prg_.theoryops(); for (auto const &str : strs) { uid = prg_.theoryops(uid, str); } return uid; } TheoryOptermUid parseTheoryOpterm(AST const &ast) { if (ast.type() == clingo_ast_type_theory_unparsed_term) { return parseTheoryUnparsedTermElements(get<AST::ASTVec>(ast, clingo_ast_attribute_elements)); } return prg_.theoryopterm(prg_.theoryops(), parseTheoryTerm(ast)); } TheoryOptermUid parseTheoryUnparsedTermElements(AST::ASTVec const &asts) { require_(!asts.empty(), "invalid ast: unparsed term list must not be empty"); auto it = asts.begin(); auto ie = asts.end(); auto uid = prg_.theoryopterm(parseTheoryOpVec(get<AST::StrVec>(**it, clingo_ast_attribute_operators)), parseTheoryTerm(*get<SAST>(**it, clingo_ast_attribute_term))); for (++it; it != ie; ++it) { auto const &operators = get<AST::StrVec>(**it, clingo_ast_attribute_operators); require_(!operators.empty(), "invalid ast: at least one operator necessary on right-hand-side of unparsed theory term"); uid = prg_.theoryopterm(uid, parseTheoryOpVec(operators), parseTheoryTerm(*get<SAST>(**it, clingo_ast_attribute_term))); } return uid; } // {{{1 literals TermUid parseAtom(AST &ast) { require_(ast.type() == clingo_ast_type_symbolic_atom, "invalid ast: symbolic atom expected"); return parseTerm(*get<SAST>(ast, clingo_ast_attribute_symbol)); } static NAF parseSign(int sign) { switch (sign) { case clingo_ast_sign_none: { return NAF::POS; } case clingo_ast_sign_negation: { return NAF::NOT; } case clingo_ast_sign_double_negation: { return NAF::NOTNOT; } default: { throw std::runtime_error("invalid ast: invalid sign"); } } } static Relation parseRelation(int relation) { switch (relation) { case clingo_ast_comparison_operator_less_equal: { return Relation::LEQ; } case clingo_ast_comparison_operator_less_than: { return Relation::LT; } case clingo_ast_comparison_operator_greater_equal: { return Relation::GEQ; } case clingo_ast_comparison_operator_greater_than: { return Relation::GT; } case clingo_ast_comparison_operator_equal: { return Relation::EQ; } case clingo_ast_comparison_operator_not_equal: { return Relation::NEQ; } default: { throw std::runtime_error("invalid ast: invalid sign"); } } } LitUid parseLiteral(AST const &ast) { switch (ast.type()) { case clingo_ast_type_literal: { auto sign = parseSign(get<int>(ast, clingo_ast_attribute_sign)); auto const &atom = *get<SAST>(ast, clingo_ast_attribute_atom); switch (atom.type()) { case clingo_ast_type_boolean_constant: { return prg_.boollit(get<Location>(ast, clingo_ast_attribute_location), get<int>(atom, clingo_ast_attribute_value) != 0); } case clingo_ast_type_symbolic_atom: { return prg_.predlit(get<Location>(ast, clingo_ast_attribute_location), parseSign(get<int>(ast, clingo_ast_attribute_sign)), parseAtom(*get<SAST>(ast, clingo_ast_attribute_atom))); } case clingo_ast_type_comparison: { auto rel = parseRelation(get<int>(atom, clingo_ast_attribute_comparison)); return prg_.rellit(get<Location>(ast, clingo_ast_attribute_location), sign != NAF::NOT ? rel : neg(rel), parseTerm(*get<SAST>(atom, clingo_ast_attribute_left)), parseTerm(*get<SAST>(atom, clingo_ast_attribute_right))); } default: { throw std::runtime_error("invalid ast: atom expected"); } } } case clingo_ast_type_csp_literal: { auto const &guards = get<AST::ASTVec>(ast, clingo_ast_attribute_guards); require_(!guards.empty(), "invalid ast: csp literals need at least one guard"); auto it = guards.begin(); auto ie = guards.end(); auto uid = prg_.csplit(get<Location>(ast, clingo_ast_attribute_location), parseCSPAddTerm(*get<SAST>(ast, clingo_ast_attribute_term)), parseRelation(get<int>(**it, clingo_ast_attribute_comparison)), parseCSPAddTerm(*get<SAST>(**it, clingo_ast_attribute_term))); for (++it; it != ie; ++it) { uid = prg_.csplit(get<Location>(ast, clingo_ast_attribute_location), uid, parseRelation(get<int>(**it, clingo_ast_attribute_comparison)), parseCSPAddTerm(*get<SAST>(**it, clingo_ast_attribute_term))); } return prg_.csplit(uid); } default: { throw std::runtime_error("invalid ast: (CSP) literal expected"); } } } LitVecUid parseLiteralVec(AST::ASTVec const &asts) { auto uid = prg_.litvec(); for (auto const &ast : asts) { uid = prg_.litvec(uid, parseLiteral(*ast)); } return uid; } // {{{1 aggregates static AggregateFunction parseAggregateFunction(int fun) { switch (fun) { case clingo_ast_aggregate_function_count: { return AggregateFunction::COUNT; } case clingo_ast_aggregate_function_sum: { return AggregateFunction::SUM; } case clingo_ast_aggregate_function_sump: { return AggregateFunction::SUMP; } case clingo_ast_aggregate_function_min: { return AggregateFunction::MIN; } case clingo_ast_aggregate_function_max: { return AggregateFunction::MAX; } default: { throw std::runtime_error("invalid ast: invalid aggregate function"); } }; } BoundVecUid parseBounds(AST const &ast) { auto ret = prg_.boundvec(); auto const *right = getOpt(ast, clingo_ast_attribute_right_guard); if (right != nullptr) { ret = prg_.boundvec(ret, parseRelation(get<int>(*right, clingo_ast_attribute_comparison)), parseTerm(*get<SAST>(*right, clingo_ast_attribute_term))); } auto const *left = getOpt(ast, clingo_ast_attribute_left_guard); if (left != nullptr) { ret = prg_.boundvec(ret, inv(parseRelation(get<int>(*left, clingo_ast_attribute_comparison))), parseTerm(*get<SAST>(*left, clingo_ast_attribute_term))); } return ret; } CondLitVecUid parseCondLitVec(AST::ASTVec const &asts) { auto uid = prg_.condlitvec(); for (auto const &ast : asts) { uid = prg_.condlitvec(uid, parseLiteral(*get<SAST>(*ast, clingo_ast_attribute_literal)), parseLiteralVec(get<AST::ASTVec>(*ast, clingo_ast_attribute_condition))); } return uid; } HdAggrElemVecUid parseHdAggrElemVec(AST::ASTVec const &asts) { auto uid = prg_.headaggrelemvec(); for (auto const &ast : asts) { require_(ast->type() == clingo_ast_type_head_aggregate_element, "invalid ast: head aggregate element expected"); auto const &clit = get<SAST>(*ast, clingo_ast_attribute_condition); require_(clit->type() == clingo_ast_type_conditional_literal, "invalid ast: conditional literal expected"); uid = prg_.headaggrelemvec(uid, parseTermVec(get<AST::ASTVec>(*ast, clingo_ast_attribute_terms)), parseLiteral(*get<SAST>(*clit, clingo_ast_attribute_literal)), parseLiteralVec(get<AST::ASTVec>(*clit, clingo_ast_attribute_condition))); } return uid; } BdAggrElemVecUid parseBdAggrElemVec(AST::ASTVec const &asts) { auto uid = prg_.bodyaggrelemvec(); for (auto const &ast : asts) { require_(ast->type() == clingo_ast_type_body_aggregate_element, "invalid ast: body aggregate element expected"); uid = prg_.bodyaggrelemvec(uid, parseTermVec(get<AST::ASTVec>(*ast, clingo_ast_attribute_terms)), parseLiteralVec(get<AST::ASTVec>(*ast, clingo_ast_attribute_condition))); } return uid; } TheoryElemVecUid parseTheoryElemVec(AST::ASTVec const &asts) { auto uid = prg_.theoryelems(); for (auto const &ast : asts) { uid = prg_.theoryelems(uid, parseTheoryOptermVec(get<AST::ASTVec>(*ast, clingo_ast_attribute_terms)), parseLiteralVec(get<AST::ASTVec>(*ast, clingo_ast_attribute_condition))); } return uid; } CSPElemVecUid parseCSPElemVec(AST::ASTVec const &asts) { auto ret = prg_.cspelemvec(); for (auto const &ast : asts) { require_(ast->type() == clingo_ast_type_disjoint_element, "invalid ast: disjoint element expected"); ret = prg_.cspelemvec(ret, get<Location>(*ast, clingo_ast_attribute_location), parseTermVec(get<AST::ASTVec>(*ast, clingo_ast_attribute_terms)), parseCSPAddTerm(*get<SAST>(*ast, clingo_ast_attribute_term)), parseLiteralVec(get<AST::ASTVec>(*ast, clingo_ast_attribute_condition))); } return ret; } TheoryAtomUid parseTheoryAtom(AST const &ast) { require_(ast.type() == clingo_ast_type_theory_atom, "invalid ast: theory atom expected"); auto const &loc = get<Location>(ast, clingo_ast_attribute_location); auto const *guard = getOpt(ast, clingo_ast_attribute_guard); auto term = parseTerm(*get<SAST>(ast, clingo_ast_attribute_term)); auto elements = parseTheoryElemVec(get<AST::ASTVec>(ast, clingo_ast_attribute_elements)); return guard != nullptr ? prg_.theoryatom(term, elements, get<String>(*guard, clingo_ast_attribute_operator_name), loc, parseTheoryOpterm(*get<SAST>(*guard, clingo_ast_attribute_term))) : prg_.theoryatom(term, elements); } // {{{1 heads HdLitUid parseHeadLiteral(AST const &ast) { switch (ast.type()) { case clingo_ast_type_literal: case clingo_ast_type_csp_literal: { return prg_.headlit(parseLiteral(ast)); } case clingo_ast_type_disjunction: { return prg_.disjunction(get<Location>(ast, clingo_ast_attribute_location), parseCondLitVec(get<AST::ASTVec>(ast, clingo_ast_attribute_elements))); } case clingo_ast_type_aggregate: { return prg_.headaggr(get<Location>(ast, clingo_ast_attribute_location), AggregateFunction::COUNT, parseBounds(ast), parseCondLitVec(get<AST::ASTVec>(ast, clingo_ast_attribute_elements))); } case clingo_ast_type_head_aggregate: { return prg_.headaggr(get<Location>(ast, clingo_ast_attribute_location), parseAggregateFunction(get<int>(ast, clingo_ast_attribute_function)), parseBounds(ast), parseHdAggrElemVec(get<AST::ASTVec>(ast, clingo_ast_attribute_elements))); } case clingo_ast_type_theory_atom: { auto const &loc = get<Location>(ast, clingo_ast_attribute_location); return prg_.headaggr(loc, parseTheoryAtom(ast)); } default: { throw std::runtime_error("invalid ast: head literal expected"); } } } // {{{1 bodies BdLitVecUid parseBodyLiteralVec(AST::ASTVec const &asts) { auto uid = prg_.body(); for (auto const &lit : asts) { switch (lit->type()) { case clingo_ast_type_literal: { auto const &loc = get<Location>(*lit, clingo_ast_attribute_location); auto sign = parseSign(get<int>(*lit, clingo_ast_attribute_sign)); auto const &atom = *get<SAST>(*lit, clingo_ast_attribute_atom); switch (atom.type()) { case clingo_ast_type_aggregate: { uid = prg_.bodyaggr(uid, loc, sign, AggregateFunction::COUNT, parseBounds(atom), parseCondLitVec(get<AST::ASTVec>(atom, clingo_ast_attribute_elements))); break; } case clingo_ast_type_body_aggregate: { uid = prg_.bodyaggr(uid, loc, sign, parseAggregateFunction(get<int>(atom, clingo_ast_attribute_function)), parseBounds(atom), parseBdAggrElemVec(get<AST::ASTVec>(atom, clingo_ast_attribute_elements))); break; } case clingo_ast_type_theory_atom: { uid = prg_.bodyaggr(uid, loc, sign, parseTheoryAtom(atom)); break; } case clingo_ast_type_disjoint: { uid = prg_.disjoint(uid, loc, sign, parseCSPElemVec(get<AST::ASTVec>(atom, clingo_ast_attribute_elements))); break; } default: { uid = prg_.bodylit(uid, parseLiteral(*lit)); break; } } break; } case clingo_ast_type_conditional_literal: { uid = prg_.conjunction(uid, get<Location>(*lit, clingo_ast_attribute_location), parseLiteral(*get<SAST>(*lit, clingo_ast_attribute_literal)), parseLiteralVec(get<AST::ASTVec>(*lit, clingo_ast_attribute_condition))); break; } default: { throw std::runtime_error("invalid ast: body literal expected"); } } } return uid; } // {{{1 theory definitions static TheoryOperatorType parseTheoryOperatorType(int num) { switch (num) { case clingo_ast_theory_operator_type_unary: { return TheoryOperatorType::Unary; } case clingo_ast_theory_operator_type_binary_left: { return TheoryOperatorType::BinaryLeft; } case clingo_ast_theory_operator_type_binary_right: { return TheoryOperatorType::BinaryRight; } default: { throw std::runtime_error("invalid ast: invalid theory operator type"); } } } TheoryOpDefUid parseTheoryOpDef(AST const &ast) { require_(ast.type() == clingo_ast_type_theory_operator_definition, "invalid ast: theory operator definition expected"); return prg_.theoryopdef(get<Location>(ast, clingo_ast_attribute_location), get<String>(ast, clingo_ast_attribute_name), get<int>(ast, clingo_ast_attribute_priority), parseTheoryOperatorType(get<int>(ast, clingo_ast_attribute_operator_type))); } TheoryOpDefVecUid parseTheoryOpDefVec(AST::ASTVec const &asts) { auto uid = prg_.theoryopdefs(); for (auto const &ast : asts) { prg_.theoryopdefs(uid, parseTheoryOpDef(*ast)); } return uid; } static TheoryAtomType parseTheoryAtomType(int num) { switch (num) { case clingo_ast_theory_atom_definition_type_head: { return TheoryAtomType::Head; } case clingo_ast_theory_atom_definition_type_body: { return TheoryAtomType::Body; } case clingo_ast_theory_atom_definition_type_any: { return TheoryAtomType::Any; } case clingo_ast_theory_atom_definition_type_directive: { return TheoryAtomType::Directive; } default: { throw std::runtime_error("invalid ast: invalid theory atom type"); } }; } TheoryAtomDefUid parseTheoryAtomDefinition(AST const &ast) { require_(ast.type() == clingo_ast_type_theory_atom_definition, "invalid ast: theory atom definition expected"); auto const *guard = getOpt(ast, clingo_ast_attribute_guard); auto const &loc = get<Location>(ast, clingo_ast_attribute_location); auto name = get<String>(ast, clingo_ast_attribute_name); auto arity = get<int>(ast, clingo_ast_attribute_arity); auto term = get<String>(ast, clingo_ast_attribute_term); auto type = parseTheoryAtomType(get<int>(ast, clingo_ast_attribute_atom_type)); return guard != nullptr ? prg_.theoryatomdef(loc, name, arity, term, type, parseTheoryOpVec(get<AST::StrVec>(*guard, clingo_ast_attribute_operators)), get<String>(*guard, clingo_ast_attribute_term)) : prg_.theoryatomdef(loc, name, arity, term, type); } TheoryDefVecUid parseTheoryAtomDefinitionVec(TheoryDefVecUid uid, AST::ASTVec const &asts) { for (auto const &ast : asts) { prg_.theorydefs(uid, parseTheoryAtomDefinition(*ast)); } return uid; } TheoryTermDefUid parseTheoryTermDefinition(AST const &ast) { return prg_.theorytermdef(get<Location>(ast, clingo_ast_attribute_location), get<String>(ast, clingo_ast_attribute_name), parseTheoryOpDefVec(get<AST::ASTVec>(ast, clingo_ast_attribute_operators)), log_); } TheoryDefVecUid parseTheoryTermDefinitionVec(AST::ASTVec const &asts) { auto uid = prg_.theorydefs(); for (auto const &ast : asts) { prg_.theorydefs(uid, parseTheoryTermDefinition(*ast)); } return uid; } // 1}}} Logger &log_; INongroundProgramBuilder &prg_; }; } // namespace void parse(INongroundProgramBuilder &prg, Logger &log, AST const &ast) { ASTParser{log, prg}.parseStatement(ast); } } } // namespace Input Gringo
47.756757
147
0.547924
24205a92faaf78701c568a34869b6a3ebf9dd0ee
2,264
ps1
PowerShell
scripts/Set-AzureAppSettings.ps1
croquet-australia/croquet-australia.com.au
2cdb39a0766bea91e6ef496052535726dccaba88
[ "MIT" ]
null
null
null
scripts/Set-AzureAppSettings.ps1
croquet-australia/croquet-australia.com.au
2cdb39a0766bea91e6ef496052535726dccaba88
[ "MIT" ]
33
2015-04-17T23:56:49.000Z
2015-06-15T00:55:59.000Z
scripts/Set-AzureAppSettings.ps1
croquet-australia/website-application
2cdb39a0766bea91e6ef496052535726dccaba88
[ "MIT" ]
1
2016-03-04T18:25:18.000Z
2016-03-04T18:25:18.000Z
# Adds application settings to Azure. # # This script needs to be run before first publishing of the website to Azure or # if any of the settings change. param( [CmdletBinding(SupportsShouldProcess=$true)] [Parameter(Mandatory = $true)] [string] $ContentRepositoryUserName, [Parameter(Mandatory = $true)] [string] $ContentRepositoryPassword, [Parameter(Mandatory = $true)] [string] $OAuthGoogleClientID, [Parameter(Mandatory = $true)] [string] $OAuthGoogleClientSecret, [Parameter(Mandatory = $true)] [string] $WebSiteName = "croquet-australia", [Parameter(Mandatory = $false)] [string] $ContentRepositoryUrl = "https://github.com/croquet-australia/website-content.git", [Parameter(Mandatory = $false)] [string] $ContentRepositoryFullDirectoryPath = "~/App_Data/Content/Git", [Parameter(Mandatory = $false)] [string] $ContentPublishedRepositoryFullDirectoryPath = "~/App_Data/Content/Published", [Parameter(Mandatory = $false)] [string] $ContentBlogDirectoryName = "news", [Parameter(Mandatory = $false)] [string] $ElmahErrorLogType = "MemoryErrorLog", # todo: add logging [Parameter(Mandatory = $false)] [string] $SupportEmail = "tim@26tp.com", [Parameter(Mandatory = $false)] [string] $SupportName = "Tim Murphy", [Parameter(Mandatory = $false)] [string] $WebApiBaseUri = "https://croquet-australia-api.azurewebsites.net/" ) $appSettings = @{ ` "Content:BlogDirectoryName" = $ContentBlogDirectoryName; ` "Content:Repository:Url" = $ContentRepositoryUrl; ` "Content:Repository:FullDirectoryPath" = $ContentRepositoryFullDirectoryPath; ` "Content:Repository:UserName" = $ContentRepositoryUserName; ` "Content:Repository:Password" = $ContentRepositoryPassword; ` "Content:PublishedRepository:FullDirectoryPath" = $ContentPublishedRepositoryFullDirectoryPath; ` "Elmah:ErrorLogType" = $ElmahErrorLogType; ` "OAuth:Google:ClientId" = $OAuthGoogleClientId; ` "OAuth:Google:ClientSecret" = $OAuthGoogleClientSecret; ` "Support:Email" = $SupportEmail; ` "Support:Name" = $SupportName; ` "WebApi:BaseUri" = $WebApiBaseUri; } Set-AzureWebsite -Name "$WebSiteName" -AppSettings $appSettings
43.538462
101
0.707155
5aa26503ecdf889d4d239c8b6eaf9a7e40058cf3
12,165
html
HTML
equipo-04/index.html
scamachp/proyecto-final-2da-intro
fe95d3605051cc5ce972109b3682504d31aaa11b
[ "MIT" ]
null
null
null
equipo-04/index.html
scamachp/proyecto-final-2da-intro
fe95d3605051cc5ce972109b3682504d31aaa11b
[ "MIT" ]
null
null
null
equipo-04/index.html
scamachp/proyecto-final-2da-intro
fe95d3605051cc5ce972109b3682504d31aaa11b
[ "MIT" ]
null
null
null
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors"> <meta name="generator" content="Hugo 0.55.4"> <title>Carousel Template · Bootstrap</title> <link rel="canonical" href="https://getbootstrap.comdocs/4.3/examples/carousel/"> <!-- Bootstrap core CSS --> <link href="docs/4.3/dist/css/bootstrap.css" rel="stylesheet"> <!-- Favicons --> <link rel="apple-touch-icon" href="docs/4.3/assets/img/favicons/apple-touch-icon.png" sizes="180x180"> <link rel="icon" href="docs/4.3/assets/img/favicons/favicon-32x32.png" sizes="32x32" type="image/png"> <link rel="icon" href="docs/4.3/assets/img/favicons/favicon-16x16.png" sizes="16x16" type="image/png"> <link rel="manifest" href="docs/4.3/assets/img/favicons/manifest.json"> <link rel="mask-icon" href="docs/4.3/assets/img/favicons/safari-pinned-tab.svg" color="#563d7c"> <link rel="icon" href="docs/4.3/assets/img/favicons/favicon.ico"> <meta name="msapplication-config" content="docs/4.3/assets/img/favicons/browserconfig.xml"> <meta name="theme-color" content="#563d7c"> <style> .bd-placeholder-img { font-size: 1.125rem; text-anchor: middle; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } @media (min-width: 768px) { .bd-placeholder-img-lg { font-size: 3.5rem; } } </style> <!-- Custom styles for this template --> <link href="carousel.css" rel="stylesheet"> </head> <body> <header> <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark"> <a class="navbar-brand" href="#">Patrones Hermosos, equipo 4- BE THE CHANGE</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarCollapse"> <ul class="navbar-nav mr-auto"> <li class="nav-item active"> </li> <li class="nav-item"> </li> <li class="nav-item"> </li> </ul> <form class="form-inline mt-2 mt-md-0"> </form> </div> </nav> </header> <main role="main"> <div id="myCarousel" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#myCarousel" data-slide-to="0" class="active"></li> <li data-target="#myCarousel" data-slide-to="1"></li> <li data-target="#myCarousel" data-slide-to="2"></li> </ol> <div class="carousel-inner"> <div class="carousel-item active"> <img src="01.jpg" alt="..."> <div class="container"> <div class="carousel-caption text-left"> <h1>-EL CAMBIO CLIMATICO-</h1> <p>ESTA EN TUS MANOS</p> </div> </div> </div> <div class="carousel-item"> <img src="02.jpg" alt="..."> <div class="container"> <div class="carousel-caption"> <h1></h1> </div> </div> </div> <div class="carousel-item"> <img src="03.jpg" alt="..."> <div class="container"> <div class="carousel-caption text-right"> <h1>El cambio climatico es un problema del que no hay vuelta atrás y es de los más urgentes para nuestro futuro y entre más tiempo esperemos más difícil será de resolverlo.</h1> <p></p> </div> </div> </div> </div> <a class="carousel-control-prev" href="#myCarousel" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="carousel-control-next" href="#myCarousel" role="button" data-slide="next"> <span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> <!-- Marketing messaging and featurettes ================================================== --> <!-- Wrap the rest of the page in another container to center all the content. --> <div class="container marketing"> <!-- three columns of text below the carousel --> <div class="row"> <div class="col-lg-4"> <h2>Que es?</h2> <p>De acuerdo con la Convención Marco de las Naciones Unidas sobre Cambio Climático (CMNUCC), éste se entiende como un cambio de clima atribuido directa o indirectamente a la actividad humana que altera la composición de la atmósfera mundial y que se suma a la variabilidad natural del clima observada durante períodos de tiempo comparables.</p> </div><!-- /.col-lg-4 --> <div class="col-lg-4"> <h2>Causas</h2> <p> • Deforestación: la industria maderera, la agricultura, la minería y la ganadería son las principales actividades económicas dedicadas a la tala de árboles. El aumento desproporcionado de gases de efecto invernadero: provocado por el uso de fertilizantes, la actividad química para el tratamiento de aguas residuales, la quema de combustibles fósiles, el transporte, la calefacción y el urbanismo.Y el crecimiento acelerado de la población ya que el aumento de la cantidad de habitantes influye en la producción de gases que exacerban el efecto invernadero. </p> </div><!-- /.col-lg-4 --> <div class="col-lg-4"> <h2>Consecuencias</h2> <p>La acidificación y contaminación del agua gracias a la concentración de dióxido de carbono en el aire, los devastadores fenómenos meteorológicos como los huracanes, ciclones, lluvias, sequías extremas o inundaciones, la muerte, migración y extinción de diferentes especies de animales, la presencia de plásticos y otros contaminantes en el mar, la pesca excesiva y otras prácticas de pesca destructivas contribuyen a su desaparición, la alteración del ciclo del agua. El aumento del nivel del mar y de la temperatura global a causa del deshielo. La aparición de enfermedades como el dengue y la malaria. Y por ultimo el agotamiento de recursos naturales necesarios para la vida humana</p> </div><!-- /.col-lg-4 --> </div><!-- /.row --> <!-- START THE FEATURETTES --> <hr class="featurette-divider"> <div class="row featurette"> <div class="col-md-7"> <h2 class="featurette-heading">Acciones <span class="text-muted">para mitigar el cambio climatico</span></h2> <p class="lead">El cambio climatico es un problema que se puede solucionar si todos ponemos nuestro granito de arena.</p> </div> <div class="col-md-5"> <img src="04.jpg" class="rounded float-left" alt="..." width= "500" height= "500"\9;> <text x="100%" y="100%"></text> </svg> </div> </div> <hr class="featurette-divider"> <div class="row featurette"> <div class="col-md-7 order-md-2"> <h2 class="featurette-heading">Pon en práctica las 3 ‘R’ de la sostenibilidad <p class="lead"> Reduce: Consume menos, de manera más eficiente. Reutiliza: Aprovecha los mercados de segunda mano para dar otra oportunidad a aquello que ya no usas o hacerte con algo que necesitas y que otra persona no. Ahorrarás dinero y conseguirás reducir el consumo. Practica también el intercambio. Recicla envases, residuos electrónicos, etc. ¿Sabes que puedes ahorrar más de 730 kilos de CO2 al año solo con reciclar la mitad de la basura que se genera en el hogar? </p> </div> <div class="col-md-5 order-md-1"> <img src="05.jpg" class="rounded float-right" alt="..." width= "500" height= "500"\9;> <text x="50%" y="50%"></text> </div> </div> <hr class="featurette-divider"> <div class="row featurette"> <div class="col-md-7"> <h2 class="featurette-heading">Traslado verde. <p class="lead">En la medida posible, debemos optar por transportarnos en bicicleta, transporte público y, sobre todo, reducir los viajes en donde solo una persona esté en el auto. También, si es posible, deberíamos compartir nuestro automóvil con alguien más y verificarlo cuando sea el momento, así nos aseguramos de no estar contaminando. </div> <div class="col-md-5"> <img src="06.jpg" class="rounded float-left" alt="..." width= "500" height= "500"\9;> <text x="100%" y="100%"></text> </svg> </div> </div> <hr class="featurette-divider"> <div class="row featurette"> <div class="col-md-7 order-md-2"> <h2 class="featurette-heading">Trata de consumir menos carne <p class="lead">La producción de carne roja lleva a un número significativamente mayor de emisiones de gases de efecto invernadero que la de pollo, frutas, verduras y cereales. </p> </div> <div class="col-md-5 order-md-1"> <img src="07.jpg" class="rounded float-right" alt="..." width= "500" height= "500"\9;> <text x="50%" y="50%" > </div> </div> <hr class="featurette-divider"> <div class="row featurette"> <div class="col-md-7"> <h2 class="featurette-heading">Actúa contra la pérdida de bosques <p class="lead">Evita realizar prácticas que puedan suponer un riesgo de incendio. Si tienes que comprar madera, apuesta por aquella con certificación o sello que asegure su origen sostenible. Planta un árbol. Cada árbol puede absorber hasta una tonelada de CO2, y así estarás contribuyendo a luchar contra el cambio climático. </div> <div class="col-md-5"> <img src="08.jpg" class="rounded float-left" alt="..." width= "500" height= "500"\9;> <text x="100%" y="100%"></text> </svg> </div> </div> <hr class="featurette-divider"> <div class="row featurette"> <div class="col-md-7 order-md-2"> <h2 class="featurette-heading">Hacer uso de nuestros propios envases. <p class="lead"> Cuando vamos al supermercado, evitemos utilizar bolsas y envases de plástico. Lo mismo sucede para cuando compramos comida en algún lugar. Evitar usar desechables es una gran acción contra el acumulo de basura y con ello las emisiones de gases dañinos. La compra a granel también es una alternativa muy eficiente. </p> </div> <div class="col-md-5 order-md-1"> <img src="09.jpg" class="rounded float-right" alt="..." width= "500" height= "500"\9;> <text x="50%" y="50%" > </div> </div> <hr class="featurette-divider"> <div class="row featurette"> <div class="col-md-7"> <h2 class="featurette-heading"> Informar y educar a los demás <p class="lead">Entre todos podemos logarlo: reunirnos con nuestros vecinos para compartir alternativas y educarnos mutuamente en cómo establecer una vida comunitaria sostenible es también un paso importante. </div> <div class="col-md-5"> <img src="10.jpg" class="rounded float-left" alt="..." width= "500" height= "500"\9;> <text x="100%" y="100%"></text> </svg> </div> </div> <hr class="featurette-divider"> <!-- /END THE FEATURETTES --> </div><!-- /.container --> <!-- FOOTER --> <footer class="container"> <p class="float-right"><a href="#">Back to top</a></p> </footer> </main> <script src="docs/4.3/dist/js/bootstrap.bundle.js"></script> </body> </html>
37.088415
349
0.610933
217302d79c99f1e346db6b73419674025370bfb1
3,180
swift
Swift
Pods/BasicService/BasicService/BasicService/Classes/Define/Const.swift
YariZhang/DxwStockDetail
cbde6a7d4e56843c2f512cfc9a01c800344b1a86
[ "MIT" ]
1
2019-03-07T09:01:01.000Z
2019-03-07T09:01:01.000Z
Pods/BasicService/BasicService/BasicService/Classes/Define/Const.swift
YariZhang/DxwStockDetail
cbde6a7d4e56843c2f512cfc9a01c800344b1a86
[ "MIT" ]
null
null
null
Pods/BasicService/BasicService/BasicService/Classes/Define/Const.swift
YariZhang/DxwStockDetail
cbde6a7d4e56843c2f512cfc9a01c800344b1a86
[ "MIT" ]
null
null
null
// // Const.swift // MVVMFramework // // Created by zhangyr on 2018/3/9. // Copyright © 2018年 zhangyr. All rights reserved. // import UIKit import QCGURLRouter import Toast public typealias DxwDic = Dictionary<String, Any> ///是否是iPhoneX public let CURRENT_SIZE = UIScreen.main.currentMode?.size public let IS_IPHONE_10 = CURRENT_SIZE == CGSize(width: 1125, height: 2436) public let IS_IPHONE_XR = CURRENT_SIZE == CGSize(width:750,height:1624) public let IS_IPHONE_XSM = CURRENT_SIZE == CGSize(width:1242,height:2688) public let IS_IPHONE_X = IS_IPHONE_10 || IS_IPHONE_XR || IS_IPHONE_XSM ///小屏幕手机(4) public let IS_SMALL_SCREEN = UIScreen.main.bounds.width < 375 ///navi顶部的高度 public let TOP_AREA_HEIGHT: CGFloat = IS_IPHONE_X ? 88 : 64 public let SCALE_WIDTH_6 = UIScreen.main.bounds.width / 375 public let SCALE_HEIGHT_6 = UIScreen.main.bounds.height / 667 //当前屏幕宽 public let SCREEN_WIDTH = UIScreen.main.bounds.width //当前屏幕高 public let SCREEN_HEIGHT = UIScreen.main.bounds.height public func < <T : Comparable>(lhs: T?, rhs: T?) -> Bool { switch (lhs, rhs) { case let (l?, r?): return l < r case (nil, _?): return true default: return false } } public func > <T : Comparable>(lhs: T?, rhs: T?) -> Bool { switch (lhs, rhs) { case let (l?, r?): return l > r default: return rhs < lhs } } //Any转String public func +(left : Any?, right : String) -> String { return left == nil ? "" : "\(left!)" + right } //log打印 public func logPrint<T>(_ message: T, file: String = #file, method: String = #function, line: Int = #line) { #if !RELEASE print("\((file as NSString).lastPathComponent)[\(line)], \(method): \(message)") #endif } @discardableResult public func jumpPageNative(param: DxwDic, callBack: (() -> Void)? = nil) -> Bool { let url = param["url"] + "" let para = param["param"] as? Dictionary<String, Any> if let uri = URL(string: url), !QCGURLRouter.shareInstance.route(withUrl: uri, param: para) { UIApplication.appTopViewController()?.view.makeToast("无效跳转", duration: 3, position: CSToastPositionBottom) return false }else{ callBack?() return true } } public func jumpPage(info : Dictionary<String , Any>, isPush : Bool = false) { let action = info["action"] as! Dictionary<String , Any> let url = action["url"] + "" let para = action["para"] as? Dictionary<String, Any> let backUrl = action["back_url"] as? String let backPara = action["back_para"] as? Dictionary<String, Any> if isPush { let id = action["id"] + "" if !id.isEmpty { //通知服务器推送被阅读 DispatchQueue.global().asyncAfter(deadline: .now() + 0.5, execute: { //EventService.pushReadBy(id: id) }) } } if backUrl != nil && backUrl!.count > 0 { if jumpPageNative(param: ["url": backUrl!, "param": backPara as Any]) { jumpPageNative(param: ["url": url, "param": para as Any]) } }else{ jumpPageNative(param: ["url": url, "param": para as Any]) } }
30.873786
114
0.618553
6d22080299db02580ced3908d62d34e1c02ffe42
348
asm
Assembly
programs/oeis/091/A091904.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/091/A091904.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/091/A091904.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A091904: Expansion of x/((1+4x)(1-8x)). ; 0,1,4,48,320,2816,21504,176128,1392640,11206656,89391104,716177408,5725224960,45818576896,366481506304,2932120485888,23455890145280,187651416129536,1501194149167104,12009621912813568 add $0,1 mov $4,2 lpb $0 sub $0,1 mov $3,$1 mov $1,$2 mul $1,8 add $4,$3 mul $4,4 mov $2,$4 lpe div $1,64
21.75
184
0.706897
573b7d158d221142997de00917bdc0874eff55b4
6,992
sql
SQL
public/SQL - Tabelas.sql
filipevalentin/KalangoGit
626d2b594ee3c2e15170535a81a2cde9ac9def24
[ "MIT" ]
1
2015-03-15T17:08:22.000Z
2015-03-15T17:08:22.000Z
public/SQL - Tabelas.sql
filipevalentin/KalangoGit
626d2b594ee3c2e15170535a81a2cde9ac9def24
[ "MIT" ]
161
2015-03-16T00:46:22.000Z
2015-05-28T03:32:22.000Z
public/SQL - Tabelas.sql
filipevalentin/KalangoGit
626d2b594ee3c2e15170535a81a2cde9ac9def24
[ "MIT" ]
null
null
null
create table usuarios( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, nome varchar(255), sobrenome varchar(255), login varchar(255), password varchar(255), email varchar(255), urlImagem varchar(500), confirmed int(1) COMMENT 'Indica se o usuario confirmou o registro atraves do email enviado', confirmation_code varchar(255) COMMENT 'Codigo enviado por email ao se cadastrar um novo usuario', remember_token varchar(255) COMMENT 'Funcao "manter conectado"', tipo int(11) COMMENT '1:Aluno 2:Professor 3:Admin' ); create table alunos( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, matricula int(11), sobreMim varchar(1000), dataNascimento date, dataVencimentoBoleto varchar(10) ); create table administradores( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, codRegistro int(11) ); create table professores( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, codRegistro int(11), sobreMim varchar(1000), formacaoAcademica varchar(255) ); create table idiomas( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, nome varchar(255) ); create table cursos( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, nome varchar(255), idIdioma int(1) ); create table modulos( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, nome varchar(255), idCurso int(11), CONSTRAINT FOREIGN KEY(idCurso) REFERENCES cursos(id) ); create table turmas( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, nome varchar(255), status int(1) COMMENT '0:Turma fechada/modulo concluido 1: Turma ativa/Alunos com aula', idModulo int(11), CONSTRAINT FOREIGN KEY(idModulo) REFERENCES modulos(id), idProfessor int(11), CONSTRAINT FOREIGN KEY(idProfessor) REFERENCES professores(id) ); create table categorias( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, nome varchar(255) COMMENT 'Categoria serve para separar as Atividades Extras em grupos, como Atividades de: Reforço, Halloween, Past Perfect, etc...' ); create table aulas( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, titulo varchar(255), idModulo int(11), CONSTRAINT FOREIGN KEY(idModulo) REFERENCES modulos(id) ); create table atividades( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, nome varchar(255), tipo int(1) COMMENT '1: Conteudo de aula, 2: ativ. extra', status int(1) COMMENT '0: inativo, 1:ativo -> Serve para evitar que a atividade apareça para o aluno e ele responda enquanto a mesma esta sendo alterada', idAula int(11) COMMENT 'Só haverá valor nesse atributo caso a atividade seja do tipo 1 - Conteudo de aula, do contrário será null', CONSTRAINT FOREIGN KEY(idAula) REFERENCES aulas(id), idCategoria int(11), CONSTRAINT FOREIGN KEY(idCategoria) REFERENCES categorias(id), idModulo int(11) COMMENT 'Só haverá valor nesse atributo caso a atividade seja do tipo 2 - ativ extra, do contrário será null', CONSTRAINT FOREIGN KEY(idModulo) REFERENCES modulos(id), idUsuario int(11) COMMENT 'Professor (apenas atividades extras) ou admin que criou a atividade', CONSTRAINT FOREIGN KEY(idUsuario) REFERENCES usuarios(id) ); create table materialapoio( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, nome varchar(255), url varchar(255), idAula int(11) COMMENT 'por enquanto um material só pertence a uma aula, aplicar as alterações mecessárias para que um material esteja em mais de uma aula', CONSTRAINT FOREIGN KEY(idAula) REFERENCES aulas(id) ); create table topicos( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, nome varchar(255), idUsuario int(11) COMMENT 'usuário admin que criou o tópico', FOREIGN KEY (idUsuario) REFERENCES usuarios(id) ); create table questoes( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, enunciado varchar(255), urlMidia varchar(255), numero int(10) COMMENT 'indica a posicao/ordem da questao dentro de uma atividade', tipo int(1) COMMENT '1-Multipla Escolha, 2-Dissertativa', categoria int(2) COMMENT '1:texto, 2:imagem, 3:audio - 2 digitos (pergunta/resposta: 12 = texto/imagem) Dissertativa: 3 = reconhecimento de voz', alternativaA varchar(255), alternativaB varchar(255), alternativaC varchar(255), alternativaD varchar(255), respostaCerta varchar(255), pontos int(10), idAtividade int(11), CONSTRAINT FOREIGN KEY(idAtividade) REFERENCES atividades(id), idTopico int(11), CONSTRAINT FOREIGN KEY(idTopico) REFERENCES topicos(id) ); create table mensagens( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, titulo varchar(255), conteudo varchar(1500), lida int(1), data date, idUsuarioOrigem int(11), FOREIGN KEY (idUsuarioOrigem) REFERENCES usuarios(id), idUsuarioDestino int(11), FOREIGN KEY (idUsuarioDestino) REFERENCES usuarios(id), idRE int(11) COMMENT 'Indica o id da mensagem em resposta, caso exista', FOREIGN KEY (idRE) REFERENCES mensagens(id) ); create table avisos( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, titulo varchar(100), descricao varchar(500), urlImagem varchar(255), dataExpiracao date, idUsuario int(11), idCurso int(11) COMMENT 'Aqui mudou, como o professor sugeriu, um aviso poderá ser enviado a uma TURMA específica, caso aqui seja null, será enviado a todos os alunos', FOREIGN KEY (idUsuario) REFERENCES usuarios(id), FOREIGN KEY (idCurso) REFERENCES cursos(id) ); create table propagandas( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, titulo varchar(100), urlImagem varchar(255), link varchar(350), idUsuario int(11), FOREIGN KEY (idUsuario) REFERENCES usuarios(id) ); /* Relacionamentos N-N */ create table acessosatividades( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, status int(1) COMMENT '0: Iniciado, 1: Concluído', idAluno int(11), CONSTRAINT FOREIGN KEY(idAluno) REFERENCES alunos(id), idQuestao int(11) COMMENT 'Indica qual questao o aluno parou, não é FK, pois ela indica o número da posição da questao', idAtividade int(11), CONSTRAINT FOREIGN KEY (idAtividade) REFERENCES atividades(id) ); create table turmasalunos( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, pontuacao int(10) COMMENT 'contabiliza os pontos adquiridos pelo aluno numa turma, é necessário para fazer o ranking do dashboard, e evitar que seja calculado o total de pontos toda vez que alguem acessar o dashboard, melhorando o desempenho', idTurma int(11), CONSTRAINT FOREIGN KEY(idTurma) REFERENCES turmas(id), idAluno int(11), CONSTRAINT FOREIGN KEY(idAluno) REFERENCES alunos(id) ); create table respostas( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, respostaAluno varchar(100), correcao int(1) COMMENT '0: errou, 1: acertou', idAluno int(11), CONSTRAINT FOREIGN KEY(idAluno) REFERENCES alunos(id), idQuestao int(11), CONSTRAINT FOREIGN KEY(idQuestao) REFERENCES questoes(id) ); -- Laravel -- Tabela que faz controle dos tokens e envios de emails para recuperar a senha definindo uma nova create table password_reminders( email varchar(255) NOT NULL, token varchar(255) NOT NULL, created_at timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', KEY password_reminders_email_index (`email`), KEY password_reminders_token_index (`token`) );
33.777778
244
0.765732
46d2fde2104472a80d627818605781d24a7d3b08
629
html
HTML
src/app/components/profile-posts/profile-posts.component.html
carloso2103/Gamerspot_Frontend
7b694624a1ab530685feabb8ec89d04cbd903265
[ "MIT" ]
1
2021-02-17T15:37:04.000Z
2021-02-17T15:37:04.000Z
src/app/components/profile-posts/profile-posts.component.html
carloso2103/P4T4P_Frontend
7b694624a1ab530685feabb8ec89d04cbd903265
[ "MIT" ]
null
null
null
src/app/components/profile-posts/profile-posts.component.html
carloso2103/P4T4P_Frontend
7b694624a1ab530685feabb8ec89d04cbd903265
[ "MIT" ]
null
null
null
<div class="page-inner-container"> <div *ngIf="!posts" class="default-text text-center"> <h4>Loading...</h4> <i class="fas fa-spinner loading"></i> </div> <div *ngIf="posts && posts.length > 0"> <div class="profile-posts__feed-get" *ngFor="let post of posts; let idx = index"> <app-post-get [post]="post" [modalIndex]="idx" (deletePostEmitter)="deletePost($event)"> </app-post-get> </div> </div> <div *ngIf="posts && posts.length === 0" class="default-text"> <h4>No posts published yet</h4> </div> </div>
33.105263
89
0.532591
e71d31c23c81338f9b0223e0b568ca8848676b91
334
js
JavaScript
js/gallery.js
ttalgihon/ttalgihon.github.io
7680e6eb07a68c00982d40bd422cb9eb994da3d1
[ "MIT" ]
null
null
null
js/gallery.js
ttalgihon/ttalgihon.github.io
7680e6eb07a68c00982d40bd422cb9eb994da3d1
[ "MIT" ]
null
null
null
js/gallery.js
ttalgihon/ttalgihon.github.io
7680e6eb07a68c00982d40bd422cb9eb994da3d1
[ "MIT" ]
null
null
null
// With jQuery $(document).on({ "contextmenu": function(e) { // Stop the context menu e.preventDefault(); }, "mousedown": function(e) { }, "mouseup": function(e) { } }); $(document).keydown(function(e){ if(e.which === 123){ // Disable F12 button return false; } });
15.904762
33
0.505988
ac38eda2f36f31f758330a7b5f2590e41293d2ec
1,108
asm
Assembly
UPC Microcontroladores 2021-1/Semana 02/20211_el53_simplex1.X/maincode.asm
tocache/picomones
d9fd1e75fbbd964c5f628940a8e1161c5b6791fd
[ "CC0-1.0" ]
5
2019-08-16T14:48:49.000Z
2022-01-11T12:22:02.000Z
UPC Microcontroladores 2021-1/Semana 02/20211_el53_simplex1.X/maincode.asm
tocache/picomones
d9fd1e75fbbd964c5f628940a8e1161c5b6791fd
[ "CC0-1.0" ]
null
null
null
UPC Microcontroladores 2021-1/Semana 02/20211_el53_simplex1.X/maincode.asm
tocache/picomones
d9fd1e75fbbd964c5f628940a8e1161c5b6791fd
[ "CC0-1.0" ]
8
2018-10-30T01:17:19.000Z
2022-01-11T14:35:50.000Z
;este es un comentario list p=18f4550 ;modelo de procesador #include<p18f4550.inc> ;libreria de nombre de registros ;Bits de configuracion del microcontrolador CONFIG FOSC = XT_XT ; Oscillator Selection bits (XT oscillator (XT)) CONFIG PWRT = ON ; Power-up Timer Enable bit (PWRT enabled) CONFIG BOR = OFF ; Brown-out Reset Enable bits (Brown-out Reset disabled in hardware and software) CONFIG WDT = OFF ; Watchdog Timer Enable bit (WDT disabled (control is placed on the SWDTEN bit)) CONFIG PBADEN = OFF ; PORTB A/D Enable bit (PORTB<4:0> pins are configured as digital I/O on Reset) CONFIG LVP = OFF ; Single-Supply ICSP Enable bit (Single-Supply ICSP disabled) org 0x0000 goto init_conf org 0x0020 init_conf: clrf TRISD ;RD como salida clrf TRISB ;RB como salida inicio: movlw 0x5A ;cargamos a W 0x5A movwf LATD ;movemos contenido de Wreg a RD movlw 0xA5 ;cargamos a W 0xA5 movwf LATB ;movemos contenido de Wreg a RB end ;fin del programa
48.173913
115
0.659747
3b1214f0748054a805649cc26de96353501ad2bd
1,016
h
C
OrionUO/GUI/GUIBulletinBoardObject.h
BryanNoller/OrionUO
5985315969c5f3c7c7552392d9d40d4b24b718e2
[ "MIT" ]
169
2016-09-16T22:24:34.000Z
2022-03-27T09:58:20.000Z
OrionUO/GUI/GUIBulletinBoardObject.h
BryanNoller/OrionUO
5985315969c5f3c7c7552392d9d40d4b24b718e2
[ "MIT" ]
104
2016-10-26T23:02:52.000Z
2021-10-02T17:36:04.000Z
OrionUO/GUI/GUIBulletinBoardObject.h
BryanNoller/OrionUO
5985315969c5f3c7c7552392d9d40d4b24b718e2
[ "MIT" ]
111
2016-09-16T22:25:30.000Z
2022-03-28T07:01:40.000Z
/*********************************************************************************** ** ** GUIBulletinBoardObject.h ** ** Copyright (C) August 2016 Hotride ** ************************************************************************************ */ //---------------------------------------------------------------------------------- #ifndef GUIBULLETINBOARDOBJECT_H #define GUIBULLETINBOARDOBJECT_H //---------------------------------------------------------------------------------- class CGUIBulletinBoardObject : public CBaseGUI { wstring Text = L""; private: CGLTextTexture m_Texture; public: CGUIBulletinBoardObject(int serial, int x, int y, const wstring &text); virtual ~CGUIBulletinBoardObject(); virtual void PrepareTextures(); virtual void Draw(bool checktrans = false); virtual bool Select(); }; //---------------------------------------------------------------------------------- #endif //----------------------------------------------------------------------------------
31.75
85
0.362205
f511dd41be2c7d91fcf90b3d38bec6d9454f2e74
246
cpp
C++
Codeforces/Gym102433D.cpp
HeRaNO/OI-ICPC-Codes
4a4639cd3e347b472520065ca6ab8caadde6906d
[ "MIT" ]
18
2019-01-01T13:16:59.000Z
2022-02-28T04:51:50.000Z
Codeforces/Gym102433D.cpp
HeRaNO/OI-ICPC-Codes
4a4639cd3e347b472520065ca6ab8caadde6906d
[ "MIT" ]
null
null
null
Codeforces/Gym102433D.cpp
HeRaNO/OI-ICPC-Codes
4a4639cd3e347b472520065ca6ab8caadde6906d
[ "MIT" ]
5
2019-09-13T08:48:17.000Z
2022-02-19T06:59:03.000Z
#include <bits/stdc++.h> using namespace std; inline int dfs(int a,int b) { if (a<=b) return b-a; if (a&1) return dfs(a+1,b)+1; else return dfs(a>>1,b)+1; } int main() { int a,b; scanf("%d %d",&a,&b); printf("%d\n",dfs(a,b)); return 0; }
14.470588
30
0.569106
a3c234c17629808de92d20b5827e60865e0e14c0
599
asm
Assembly
programs/oeis/272/A272007.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/272/A272007.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/272/A272007.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A272007: Number of active (ON,black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 413", based on the 5-celled von Neumann neighborhood. ; 1,8,5,48,5,120,5,224,5,360,5,528,5,728,5,960,5,1224,5,1520,5,1848,5,2208,5,2600,5,3024,5,3480,5,3968,5,4488,5,5040,5,5624,5,6240,5,6888,5,7568,5,8280,5,9024,5,9800,5,10608,5,11448,5,12320,5,13224,5 mov $1,$0 mov $2,$0 sub $0,1 mod $0,2 add $1,$2 mov $3,2 mov $4,2 mul $4,$1 lpb $0 sub $0,1 mov $1,4 mov $2,1 mov $3,1 sub $4,$4 lpe mov $0,$4 add $0,1 pow $1,$3 trn $2,$4 add $1,$2 add $1,$0 trn $1,2 add $1,1
22.185185
199
0.651085
b5e149893e03e5b3dc265356a66d70599bc47462
265
asm
Assembly
Assembly/Exemplos-de-Codigos/incremento.asm
carlosvilela/Testes-C-
b6be1d94569027d0b5d6e8aa227e279a7cb16937
[ "MIT" ]
null
null
null
Assembly/Exemplos-de-Codigos/incremento.asm
carlosvilela/Testes-C-
b6be1d94569027d0b5d6e8aa227e279a7cb16937
[ "MIT" ]
null
null
null
Assembly/Exemplos-de-Codigos/incremento.asm
carlosvilela/Testes-C-
b6be1d94569027d0b5d6e8aa227e279a7cb16937
[ "MIT" ]
null
null
null
.486 .model tiny .code main proc mov eax, 0h ; move 0h para o registrador eax inc eax ; incrementa uma unidade ao registrador eax inc eax ; incrementa uma unidade ao registrador eax inc eax ; incrementa uma unidade ao registrador eax main endp end main
16.5625
53
0.74717
fb418f5e4496254e913b497a614deb933a0921b5
3,065
java
Java
src/main/java/edu/ou/cs/cg/application/interaction/KeyHandler.java
AustinBoydston/ComputerGraphics-bubble-progarm
c35d73e1fc7882956bbb579027f25c6ab1d01595
[ "BSD-4-Clause-UC" ]
null
null
null
src/main/java/edu/ou/cs/cg/application/interaction/KeyHandler.java
AustinBoydston/ComputerGraphics-bubble-progarm
c35d73e1fc7882956bbb579027f25c6ab1d01595
[ "BSD-4-Clause-UC" ]
null
null
null
src/main/java/edu/ou/cs/cg/application/interaction/KeyHandler.java
AustinBoydston/ComputerGraphics-bubble-progarm
c35d73e1fc7882956bbb579027f25c6ab1d01595
[ "BSD-4-Clause-UC" ]
null
null
null
//****************************************************************************** // Copyright (C) 2016-2019 University of Oklahoma Board of Trustees. //****************************************************************************** // Last modified: Wed Feb 27 17:33:00 2019 by Chris Weaver //****************************************************************************** // Major Modification History: // // 20160225 [weaver]: Original file. // 20190227 [weaver]: Updated to use model and asynchronous event handling. // //****************************************************************************** // Notes: // //****************************************************************************** package edu.ou.cs.cg.application.interaction; //import java.lang.*; import java.awt.Component; import java.awt.event.*; import java.awt.geom.Point2D; import edu.ou.cs.cg.utilities.Utilities; //****************************************************************************** /** * The <CODE>KeyHandler</CODE> class.<P> * * @author Chris Weaver * @version %I%, %G% */ public final class KeyHandler extends KeyAdapter { //********************************************************************** // Private Members //********************************************************************** // State (internal) variables private final View view; private final Model model; //********************************************************************** // Constructors and Finalizer //********************************************************************** public KeyHandler(View view, Model model) { this.view = view; this.model = model; Component component = view.getCanvas(); component.addKeyListener(this); } //********************************************************************** // Override Methods (KeyListener) //********************************************************************** public void keyPressed(KeyEvent e) { Point2D.Double p = model.getOrigin(); double a = (Utilities.isShiftDown(e) ? 0.01 : 0.1); switch (e.getKeyCode()) { case KeyEvent.VK_NUMPAD5: p.x = 0.0; p.y = 0.0; break; case KeyEvent.VK_NUMPAD4: case KeyEvent.VK_LEFT: p.x -= a; p.y += 0.0; break; case KeyEvent.VK_NUMPAD6: case KeyEvent.VK_RIGHT: p.x += a; p.y += 0.0; break; case KeyEvent.VK_NUMPAD2: case KeyEvent.VK_DOWN: p.x += 0.0; p.y -= a; break; case KeyEvent.VK_NUMPAD8: case KeyEvent.VK_UP: p.x += 0.0; p.y += a; break; case KeyEvent.VK_NUMPAD1: p.x -= a; p.y -= a; break; case KeyEvent.VK_NUMPAD7: p.x -= a; p.y += a; break; case KeyEvent.VK_NUMPAD3: p.x += a; p.y -= a; break; case KeyEvent.VK_NUMPAD9: p.x += a; p.y += a; break; case KeyEvent.VK_C: model.toggleColorful(); return; case KeyEvent.VK_CLEAR: case KeyEvent.VK_D: case KeyEvent.VK_DELETE: model.clearPolyline(); return; } model.setOriginInSceneCoordinates(p); } } //******************************************************************************
26.885965
80
0.43752
dd40dc8318ae53e2720015df81a151b75359d2c1
661
dart
Dart
lib/data/repository/movie_repo/top_rated_repo.dart
rehamrafaat202/movie_app
b5ffbe91a14dd0a3c2942374602cf34e762715e4
[ "Apache-2.0" ]
null
null
null
lib/data/repository/movie_repo/top_rated_repo.dart
rehamrafaat202/movie_app
b5ffbe91a14dd0a3c2942374602cf34e762715e4
[ "Apache-2.0" ]
null
null
null
lib/data/repository/movie_repo/top_rated_repo.dart
rehamrafaat202/movie_app
b5ffbe91a14dd0a3c2942374602cf34e762715e4
[ "Apache-2.0" ]
null
null
null
import 'package:movie/constants.dart'; import 'package:movie/data/models/coming_soon2_model.dart'; import 'package:movie/data/models/now_playing_model.dart'; import 'package:movie/data/models/top_rated_model.dart'; class TopRatedRepo { TopRatedRepo(); Future<List<TopRatedResults>> getTopRated( {dio, TopRatedModel? topRatedModel, result}) async { await dio .get( "movie/top_rated", ) .then((value) { topRatedModel = TopRatedModel.fromJson(value.data); result = topRatedModel!.results; print(result![0]); return result; }).catchError((e) { print(e); }); return result!; } }
24.481481
59
0.662632
8dc13a401d074c483a884dbf7f08fead91ebaaa6
392
kt
Kotlin
utility/src/main/java/org/oppia/android/util/locale/LocaleProdModule.kt
bhaktideshmukh/oppia-android
94626909570ddbbd06d2cd691b49f357b986db0f
[ "Apache-2.0" ]
192
2018-09-10T14:35:23.000Z
2022-03-19T04:53:54.000Z
utility/src/main/java/org/oppia/android/util/locale/LocaleProdModule.kt
bhaktideshmukh/oppia-android
94626909570ddbbd06d2cd691b49f357b986db0f
[ "Apache-2.0" ]
3,761
2019-07-12T01:59:03.000Z
2022-03-31T22:45:21.000Z
utility/src/main/java/org/oppia/android/util/locale/LocaleProdModule.kt
bhaktideshmukh/oppia-android
94626909570ddbbd06d2cd691b49f357b986db0f
[ "Apache-2.0" ]
502
2019-07-11T18:44:23.000Z
2022-03-30T09:48:14.000Z
package org.oppia.android.util.locale import dagger.Binds import dagger.Module /** Module for providing production implementations of locale utilities. */ @Module interface LocaleProdModule { @Binds fun bindMachineLocale(impl: MachineLocaleImpl): OppiaLocale.MachineLocale @Binds fun bindBidiFormatterFactory(impl: OppiaBidiFormatterImpl.FactoryImpl): OppiaBidiFormatter.Factory }
26.133333
100
0.821429
a8c48cd266a3bd11ac6d8cb1d0f0b3561241efb7
448
lua
Lua
lib/features/leaderboards/lua/cacheOkFriends.lua
red-machine-games/goblin-base-server
8d9025c6ce0b6b86a61e38557e050f0fc2249a65
[ "MIT" ]
6
2019-10-27T16:23:30.000Z
2021-04-17T18:32:35.000Z
lib/features/leaderboards/lua/cacheOkFriends.lua
red-machine-games/goblin-base-server
8d9025c6ce0b6b86a61e38557e050f0fc2249a65
[ "MIT" ]
null
null
null
lib/features/leaderboards/lua/cacheOkFriends.lua
red-machine-games/goblin-base-server
8d9025c6ce0b6b86a61e38557e050f0fc2249a65
[ "MIT" ]
null
null
null
local OK_ID = table.remove(KEYS, 1) local OK_FRIENDS_HASH = table.remove(KEYS, 1) local STORE_TIME_MS = table.remove(KEYS, 1) local ok_friends_hash = redis.call('get', 'okfr_hsh:' .. OK_ID) if ok_friends_hash ~= OK_FRIENDS_HASH then redis.call('del', 'okfr:' .. OK_ID) for i = 1, #KEYS do redis.call('sadd', 'okfr:' .. OK_ID, KEYS[i]) end redis.call('set', 'okfr_hsh:' .. OK_ID, OK_FRIENDS_HASH, 'PX', STORE_TIME_MS) end
29.866667
81
0.662946
38533fb0702cd4f3daabe751903110a46a2986bd
169
tab
SQL
examples/hydro_simple/inputs/gen_build_predetermined.tab
ashutosh-pande/switch3
769d25a42c8323f24740567aa15c980f905a03e2
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
examples/hydro_simple/inputs/gen_build_predetermined.tab
ashutosh-pande/switch3
769d25a42c8323f24740567aa15c980f905a03e2
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
examples/hydro_simple/inputs/gen_build_predetermined.tab
ashutosh-pande/switch3
769d25a42c8323f24740567aa15c980f905a03e2
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
GENERATION_PROJECT build_year gen_predetermined_cap S-NG_CC 2000.0 5.0 S-Central_PV-1 2000.0 1.0 S-Geothermal 1998.0 1.0 Hydro 2000 1 . . Hydro_RoR 2000 1 . .
24.142857
51
0.727811
b0cea501de88f83b5becc6b6e74481f2a7b8429a
17
rs
Rust
sb_file_lib/src/lib.rs
TheV360/sb_file_toolkit
317f9bdeec4f952aaee47a7f0973151f845d9303
[ "MIT" ]
null
null
null
sb_file_lib/src/lib.rs
TheV360/sb_file_toolkit
317f9bdeec4f952aaee47a7f0973151f845d9303
[ "MIT" ]
null
null
null
sb_file_lib/src/lib.rs
TheV360/sb_file_toolkit
317f9bdeec4f952aaee47a7f0973151f845d9303
[ "MIT" ]
null
null
null
pub mod sb_file;
8.5
16
0.764706
5d94bfe724c71a86fa4ea34c8281139391907587
7,581
go
Go
cli/manpage.go
caltechlibrary/dataset
4eb979d7b3d5c2535587a7b3931d62c4a556dec3
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
23
2017-08-03T17:06:05.000Z
2021-02-11T12:12:45.000Z
cli/manpage.go
caltechlibrary/dataset
4eb979d7b3d5c2535587a7b3931d62c4a556dec3
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
112
2017-05-16T18:42:47.000Z
2021-10-14T18:01:32.000Z
manpage.go
caltechlibrary/cli
6dfaf7b7d4df09e6ba6e2bfe62239285536d222f
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
3
2017-12-19T08:35:24.000Z
2020-07-12T12:47:28.000Z
// // manpage.go - adds man page output formatting suitable for running through // `nroff -man` and rendering a man page. It is a part of the cli page. // // Author: R. S. Doiel, <rsdoiel@library.caltech.edu> // // Copyright (c) 2021, Caltech // All rights not granted herein are expressly reserved by Caltech. // // 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 copyright holder 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 cli import ( "fmt" "io" "regexp" "sort" "strings" "time" ) var ( midUnderscoreRE = regexp.MustCompile(`([[:alpha:]0-9]_[[:alpha:]0-9]|\\_)`) ) // hasMidUnderscore sees if we have an embedded, mid word underscore // base on re in a slice of letters. func hasMidUnderscore(s string, cur int) bool { start := cur - 1 end := cur + 2 if start < 0 || end >= len(s) { return false } return midUnderscoreRE.MatchString(s[start:end]) } // inlineMarkdown2man scans a line and converts any inline formatting // (e.g. *word*, _word_ to \fBword\fP, \fIword\fP). func inlineMarkdown2man(s string) string { letters := strings.Split(s, "") inAster := false inUnderscore := false i := 0 for { // Exit loop early if i >= len(letters) { break } // Skip any escape characters if letters[i] == "\\" { i++ continue } if letters[i] == "*" { // If inAster is true then close the markup with \fP and set inAster to false // Else if inAster == false open the markup with \fB and set inAster to true if inAster { letters[i] = "\\fP" inAster = false } else { letters[i] = "\\fB" inAster = true } } else if letters[i] == "_" && hasMidUnderscore(s, i) == false { // If startUnderscore is true then close the markdup with \fP and set startUnderscore to false // Else if startUnderscore is false open markup with \fI and set startUnderscore to true if inUnderscore { letters[i] = "\\fP" inUnderscore = false } else { letters[i] = "\\fI" inUnderscore = true } } i++ } return strings.Join(letters, "") } // md2man will try to do a crude conversion of Markdown // to nroff man macros. func md2man(src []byte) []byte { codeBlock := false lines := strings.Split(string(src), "\n") for i := 0; i < len(lines); i++ { line := lines[i] if codeBlock == false { // Scan line for formatting conversions lines[i] = inlineMarkdown2man(line) } else { if strings.HasSuffix(line, " \\") { lines[i] = line + "\\" } } // Scan line for code block handling if strings.HasPrefix(line, "```") { if codeBlock { lines[i] = ".EP\n" codeBlock = false } else { lines[i] = "\n.EX\n" codeBlock = true } } } return []byte(strings.Join(lines, "\n")) } // GenerateManPage writes a manual page suitable for running through // `nroff --man`. May need some human clean up depending on content and // internal formatting (e.g markdown style, spacing, etc.) func (c *Cli) GenerateManPage(w io.Writer) { var parts []string // .TH {appName} {section_no} {version} {date} fmt.Fprintf(w, ".TH %s %d %q %q\n", c.appName, c.SectionNo, time.Now().Format("2006 Jan 02"), strings.TrimSpace(c.Version())) parts = append(parts, fmt.Sprintf(".TP\n\\fB%s\\fP", c.appName)) if len(c.options) > 0 { parts = append(parts, "[OPTIONS]") } // NOTE: if we've explicitly defined the parameters them here, otherwise // extrapoliate from verbs and actions. if len(c.params) > 0 { parts = append(parts, c.params...) } if len(c.verbs) > 0 && len(c.params) == 0 { if c.VerbsRequired { parts = append(parts, "VERB") } else { parts = append(parts, "[VERB]") } // Check for verb options... for _, verb := range c.verbs { if len(verb.options) > 0 { parts = append(parts, "[VERB OPTIONS]") break } } // Check for verb params for _, verb := range c.verbs { if len(verb.params) > 0 { parts = append(parts, "[VERB PARAMETERS...]") break } } } // .SH USAGE fmt.Fprintf(w, ".SH USAGE\n%s\n", strings.Join(parts, " ")) // .SH SYNOPSIS if section, ok := c.Documentation["synopsis"]; ok == true { fmt.Fprintf(w, ".SH SYNOPSIS\n%s\n", md2man(section)) } // .SH DESCRIPTION if section, ok := c.Documentation["description"]; ok == true { fmt.Fprintf(w, ".SH DESCRIPTION\n%s\n", md2man(section)) } if len(c.options) > 0 { fmt.Fprintf(w, ".SH OPTIONS\n") parts := []string{} if len(c.env) > 0 { parts = append(parts, ".TP\nOptions will override any corresponding environment settings.\n") } if len(parts) > 0 { fmt.Fprintf(w, "%s", strings.Join(parts, "\n")) } fmt.Fprintf(w, ".TP\nThe following options are supported.\n") keys := []string{} for k, _ := range c.options { keys = append(keys, k) } // Sort the keys alphabetically and display output sort.Strings(keys) for _, k := range keys { fmt.Fprintf(w, ".TP\n\\fB%s\\fP\n%s\n", k, c.options[k]) } } if len(c.env) > 0 { fmt.Fprintf(w, "\n.SS ENVIRONMENT\n") if len(c.options) > 0 { fmt.Fprintf(w, "Environment variables can be overridden by corresponding options\n") } keys := []string{} for k, _ := range c.env { keys = append(keys, k) } // Sort the keys alphabetically and display output sort.Strings(keys) for _, k := range keys { fmt.Fprintf(w, ".TP\n\\fB%s\\fP\n%s\n", k, c.env[k].Usage) } } // .SH EXAMPLES if section, ok := c.Documentation["examples"]; ok == true { //FIXME: Need to convert Markdown of examples into nroff with // with man macros. fmt.Fprintf(w, ".SH EXAMPLES\n") fmt.Fprintf(w, "\n%s\n", md2man(section)) } /* // .SH SEE ALSO fmt.Fprintf(w, ".SH SEE ALSO\n") if len(c.Documentation) > 0 { keys := []string{} for k, _ := range c.verbs { if k != "description" && k != "examples" && k != "index" { keys = append(keys, k) } } if len(keys) > 0 { // Sort the keys alphabetically and display output sort.Strings(keys) links := []string{} for _, key := range keys { links = append(links, "%s", key) } fmt.Fprintf(w, ".SH SEE ALSO\n%s\n", strings.Join(links, ", ")) } } // .BUGS fmt.Fprintf(w, ".SH BUGS\n") // AUTHORS fmt.Fprintf(w, ".SH AUTHORS\n") // COPYRIGHT fmt.Fprintf(w, ".SH COPYRIGHT\n") */ }
31.069672
758
0.64965
ffe6a6c4fbba9ab8c33cdb93378becfb366daacd
43
dart
Dart
lib/asset/string_assets.dart
Nikhil1999/flutter-translations
7ae7a13b5ed9097b22df117a588ca79e7d4ca365
[ "MIT" ]
null
null
null
lib/asset/string_assets.dart
Nikhil1999/flutter-translations
7ae7a13b5ed9097b22df117a588ca79e7d4ca365
[ "MIT" ]
null
null
null
lib/asset/string_assets.dart
Nikhil1999/flutter-translations
7ae7a13b5ed9097b22df117a588ca79e7d4ca365
[ "MIT" ]
null
null
null
class StringAssets { StringAssets._(); }
10.75
20
0.697674
135812f59a30872a1a4215735f24278318deee3f
1,684
h
C
YYText/YYText.h
oneofai/YYText
19d23f0f139a574f688a9534defd3afd701f88ff
[ "MIT" ]
null
null
null
YYText/YYText.h
oneofai/YYText
19d23f0f139a574f688a9534defd3afd701f88ff
[ "MIT" ]
null
null
null
YYText/YYText.h
oneofai/YYText
19d23f0f139a574f688a9534defd3afd701f88ff
[ "MIT" ]
null
null
null
// // YYText.h // YYText <https://github.com/ibireme/YYText> // // Created by ibireme on 15/2/25. // Copyright (c) 2015 ibireme. // // This source code is licensed under the MIT-style license found in the // LICENSE file in the root directory of this source tree. // #import <UIKit/UIKit.h> #if __has_include(<YYText_FixWarnings/YYText.h>) FOUNDATION_EXPORT double YYTextVersionNumber; FOUNDATION_EXPORT const unsigned char YYTextVersionString[]; #import <YYText_FixWarnings/YYLabel.h> #import <YYText_FixWarnings/YYTextView.h> #import <YYText_FixWarnings/YYTextAttribute.h> #import <YYText_FixWarnings/YYTextArchiver.h> #import <YYText_FixWarnings/YYTextParser.h> #import <YYText_FixWarnings/YYTextRunDelegate.h> #import <YYText_FixWarnings/YYTextRubyAnnotation.h> #import <YYText_FixWarnings/YYTextLayout.h> #import <YYText_FixWarnings/YYTextLine.h> #import <YYText_FixWarnings/YYTextInput.h> #import <YYText_FixWarnings/YYTextDebugOption.h> #import <YYText_FixWarnings/YYTextKeyboardManager.h> #import <YYText_FixWarnings/YYTextUtilities.h> #import <YYText_FixWarnings/NSAttributedString+YYText.h> #import <YYText_FixWarnings/NSParagraphStyle+YYText.h> #import <YYText_FixWarnings/UIPasteboard+YYText.h> #else #import "YYLabel.h" #import "YYTextView.h" #import "YYTextAttribute.h" #import "YYTextArchiver.h" #import "YYTextParser.h" #import "YYTextRunDelegate.h" #import "YYTextRubyAnnotation.h" #import "YYTextLayout.h" #import "YYTextLine.h" #import "YYTextInput.h" #import "YYTextDebugOption.h" #import "YYTextKeyboardManager.h" #import "YYTextUtilities.h" #import "NSAttributedString+YYText.h" #import "NSParagraphStyle+YYText.h" #import "UIPasteboard+YYText.h" #endif
33.019608
73
0.801069
89fcc53d28dbc5717f2b32d59e982f0e6058999a
1,808
pkb
SQL
Packages/DZ_TESTDATA_TEST.pkb
pauldzy/DZ_TESTDATA
047804536c194fb0f31a786ba4a58f6d100979e3
[ "CC0-1.0" ]
3
2016-07-11T16:15:32.000Z
2021-05-01T11:12:14.000Z
Packages/DZ_TESTDATA_TEST.pkb
pauldzy/DZ_TESTDATA
047804536c194fb0f31a786ba4a58f6d100979e3
[ "CC0-1.0" ]
null
null
null
Packages/DZ_TESTDATA_TEST.pkb
pauldzy/DZ_TESTDATA
047804536c194fb0f31a786ba4a58f6d100979e3
[ "CC0-1.0" ]
1
2019-11-27T00:43:56.000Z
2019-11-27T00:43:56.000Z
CREATE OR REPLACE PACKAGE BODY dz_testdata_test AS ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- FUNCTION prerequisites RETURN NUMBER AS num_check NUMBER; BEGIN FOR i IN 1 .. C_PREREQUISITES.COUNT LOOP SELECT COUNT(*) INTO num_check FROM user_objects a WHERE a.object_name = C_PREREQUISITES(i) || '_TEST' AND a.object_type = 'PACKAGE'; IF num_check <> 1 THEN RETURN 1; END IF; END LOOP; RETURN 0; END prerequisites; ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- FUNCTION version RETURN VARCHAR2 AS BEGIN RETURN '{' || ' "GITRELEASE":"' || C_GITRELEASE || '"' || ',"GITCOMMIT":"' || C_GITCOMMIT || '"' || ',"GITCOMMITDATE":"' || C_GITCOMMITDATE || '"' || ',"GITCOMMITAUTH":"' || C_GITCOMMITAUTH || '"' || '}'; END version; ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- FUNCTION inmemory_test RETURN NUMBER AS BEGIN RETURN 0; END inmemory_test; ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- FUNCTION scratch_test RETURN NUMBER AS BEGIN RETURN 0; END scratch_test; END dz_testdata_test; /
24.432432
80
0.321903
4cadde26e3e2a2d672c469183bb5b7a6502b7f2a
3,016
sql
SQL
transform/snowflake-dbt/models/sources/gitlab_dotcom/gitlab_dotcom_merge_requests.sql
danieldiamond/gitlab-analytics
f99e02c95c3a964b01cb14617a43cd5f64ecd88d
[ "MIT" ]
3
2021-07-22T06:44:31.000Z
2022-01-29T05:35:12.000Z
transform/snowflake-dbt/models/sources/gitlab_dotcom/gitlab_dotcom_merge_requests.sql
danieldiamond/gitlab-analytics
f99e02c95c3a964b01cb14617a43cd5f64ecd88d
[ "MIT" ]
null
null
null
transform/snowflake-dbt/models/sources/gitlab_dotcom/gitlab_dotcom_merge_requests.sql
danieldiamond/gitlab-analytics
f99e02c95c3a964b01cb14617a43cd5f64ecd88d
[ "MIT" ]
null
null
null
{{ config({ "materialized": "incremental", "unique_key": "merge_request_id", "schema": "sensitive" }) }} WITH source AS ( SELECT * FROM {{ source('gitlab_dotcom', 'merge_requests') }} {% if is_incremental() %} WHERE updated_at >= (SELECT MAX(updated_at) FROM {{this}}) {% endif %} QUALIFY ROW_NUMBER() OVER (PARTITION BY id ORDER BY updated_at DESC) = 1 ), renamed AS ( SELECT id::NUMBER AS merge_request_id, iid::NUMBER AS merge_request_iid, title::VARCHAR AS merge_request_title, IFF(lower(target_branch) = 'master', TRUE, FALSE) AS is_merge_to_master, IFF(lower(merge_error) = 'nan', NULL, merge_error) AS merge_error, assignee_id::NUMBER AS assignee_id, updated_by_id::NUMBER AS updated_by_id, merge_user_id::NUMBER AS merge_user_id, last_edited_by_id::NUMBER AS last_edited_by_id, milestone_id::NUMBER AS milestone_id, head_pipeline_id::NUMBER AS head_pipeline_id, latest_merge_request_diff_id::NUMBER AS latest_merge_request_diff_id, approvals_before_merge::NUMBER AS approvals_before_merge, lock_version::NUMBER AS lock_version, time_estimate::NUMBER AS time_estimate, source_project_id::NUMBER AS project_id, target_project_id::NUMBER AS target_project_id, author_id::NUMBER AS author_id, state_id::NUMBER AS merge_request_state_id, -- Override state by mapping state_id. See issue #3556. {{ map_state_id('state_id') }} AS merge_request_state, merge_status AS merge_request_status, merge_when_pipeline_succeeds::BOOLEAN AS does_merge_when_pipeline_succeeds, squash::BOOLEAN AS does_squash, discussion_locked::BOOLEAN AS is_discussion_locked, allow_maintainer_to_push::BOOLEAN AS does_allow_maintainer_to_push, created_at::TIMESTAMP AS created_at, updated_at::TIMESTAMP AS updated_at, last_edited_at::TIMESTAMP AS merge_request_last_edited_at --merge_params // hidden for privacy FROM source ) SELECT * FROM renamed ORDER BY updated_at
46.4
102
0.49569
2964a060617e3fa2e517ff15db2846792eabfa34
781
go
Go
pkg/tar/walker.go
vignesh-goutham/eks-anywhere
0ab1911e931f24028740d3e302d086de8c4ff64c
[ "Apache-2.0" ]
null
null
null
pkg/tar/walker.go
vignesh-goutham/eks-anywhere
0ab1911e931f24028740d3e302d086de8c4ff64c
[ "Apache-2.0" ]
1
2022-02-22T12:28:01.000Z
2022-02-22T12:28:01.000Z
pkg/tar/walker.go
a-cool-train/eks-anywhere
2d89d9a0e04527e30afdc20ce9f335451e65a458
[ "Apache-2.0" ]
null
null
null
package tar import ( "archive/tar" "fmt" "os" "path/filepath" "strings" ) func NewFolderWalker(folder string) FolderWalker { return FolderWalker{ folder: folder, folderPrefix: fmt.Sprintf("%s/", folder), } } type FolderWalker struct { folder, folderPrefix string } func (f FolderWalker) Walk(fn TarFunc) error { return filepath.Walk(f.folder, f.trimFolder(fn)) } func (f FolderWalker) trimFolder(fn TarFunc) filepath.WalkFunc { return func(file string, info os.FileInfo, err error) error { if err != nil { return err } if file == f.folder { return nil } header, err := tar.FileInfoHeader(info, info.Name()) if err != nil { return err } header.Name = strings.TrimPrefix(file, f.folderPrefix) return fn(file, info, header) } }
17.355556
64
0.678617
402a209fdf1e77d7990396dc044e4f1c698d34cf
1,031
sql
SQL
spring-boot-jfinal-activerecord/src/main/resources/blog.sql
zheng-zy/spring-boot2-examples
a4f90626dd5b4dc6006274ce3d680acc50784227
[ "Apache-2.0" ]
6
2019-05-06T05:43:05.000Z
2021-04-28T09:13:45.000Z
spring-boot-jfinal-activerecord/src/main/resources/blog.sql
zheng-zy/spring-boot2-examples
a4f90626dd5b4dc6006274ce3d680acc50784227
[ "Apache-2.0" ]
null
null
null
spring-boot-jfinal-activerecord/src/main/resources/blog.sql
zheng-zy/spring-boot2-examples
a4f90626dd5b4dc6006274ce3d680acc50784227
[ "Apache-2.0" ]
14
2019-04-17T10:45:57.000Z
2021-11-10T12:17:22.000Z
/* Navicat MySQL Data Transfer Source Server : 39.108.132.207 Source Server Version : 50647 Source Host : 39.108.132.207:3306 Source Database : test Target Server Type : MYSQL Target Server Version : 50647 File Encoding : 65001 Date: 2020-04-10 17:41:09 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for blog -- ---------------------------- DROP TABLE IF EXISTS `blog`; CREATE TABLE `blog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(200) NOT NULL, `content` mediumtext NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of blog -- ---------------------------- INSERT INTO `blog` VALUES ('1', 'JFinal Demo Title here', 'JFinal Demo Content here'); INSERT INTO `blog` VALUES ('2', 'test 1', 'test 1'); INSERT INTO `blog` VALUES ('3', 'test 2', 'test 2'); INSERT INTO `blog` VALUES ('4', 'test 3', 'test 3'); INSERT INTO `blog` VALUES ('5', 'test 4', 'test 4');
27.864865
86
0.583899
9c0fa1d3aa751db834ec7b47d3fdf582e1b7c740
1,447
js
JavaScript
public/js/socketClient.js
dani5447/node-ios-chat-prototype
dc8566033029cd084ccb1d5de6b92e456bdb0e3e
[ "MIT" ]
null
null
null
public/js/socketClient.js
dani5447/node-ios-chat-prototype
dc8566033029cd084ccb1d5de6b92e456bdb0e3e
[ "MIT" ]
4
2015-10-26T01:37:00.000Z
2015-10-26T01:37:55.000Z
public/js/socketClient.js
dani5447/node-ios-chat-prototype
dc8566033029cd084ccb1d5de6b92e456bdb0e3e
[ "MIT" ]
null
null
null
var ChatClient = function(options) { var self = this; self.vent = options.vent; //TODO change this http/https when switching from secure/unsecure servers self.hostname = 'http://' + window.location.host; self.connect = function() { self.socket = io.connect(self.hostname); self.setResponseListeners(self.socket); } self.login = function(name) { self.socket.emit("login", name); } self.chat = function(chat) { self.socket.emit("chat", chat); } self.setResponseListeners = function(socket) { socket.on('welcome', function(data) { // request server info socket.emit("onlineUsers"); self.vent.trigger("loginDone", data); }); socket.on('loginNameExists', function(data) { self.vent.trigger("loginNameExists", data); }); socket.on('loginNameBad', function(data) { self.vent.trigger("loginNameBad", data); }); socket.on('onlineUsers', function(data) { console.log(data); self.vent.trigger("usersInfo", data); }); socket.on('userJoined', function(data) { self.vent.trigger("userJoined", data); }); socket.on('userLeft', function(data) { self.vent.trigger("userLeft", data); }); socket.on('chat', function(data) { self.vent.trigger("chatReceived", data); }); } }
26.309091
77
0.572218
6cb795e2f230db0fea341c9cbb4776e2d64cb925
48,594
sql
SQL
src/org.xtuml.bp.io.mdl.test/models/sql/enum1.sql
rmulvey/bptest
27a01bf313f7ef3746b6eb9da24ed8c79168323d
[ "Apache-2.0" ]
1
2017-03-22T13:25:12.000Z
2017-03-22T13:25:12.000Z
src/com.mentor.nucleus.bp.io.mdl.test/models/sql/enum1.sql
NDGuthrie/bposs
2c47abf74a3e6fadb174b08e57aa66a209400606
[ "Apache-2.0" ]
5
2017-03-09T20:43:52.000Z
2017-10-10T19:01:08.000Z
src/com.mentor.nucleus.bp.io.mdl.test/models/sql/enum1.sql
NDGuthrie/bposs
2c47abf74a3e6fadb174b08e57aa66a209400606
[ "Apache-2.0" ]
30
2017-01-03T21:13:44.000Z
2022-03-25T03:17:20.000Z
-- BP 6.1D content: domain syschar: 3 INSERT INTO S_DOM VALUES (52144, 'enum1', 'This test deals with "Old Style" enumerations by using them in both an assigner and instance statechart in the following ways: - object attribute - event supp data item - bridge operation argument ( wired to enum2 domain ) - bridge return value - transformer argument ( realized ) - transform return value - comparison ==, != - assignment to local variable ** Note: This domain cannot be run in Verifier as it relies on the transfer of data between two OOA domains by way of FBO.', 1, 1); INSERT INTO S_CDT VALUES (524289, 0); INSERT INTO S_DT VALUES (524289, 52144, 'void', ''); INSERT INTO S_CDT VALUES (524290, 1); INSERT INTO S_DT VALUES (524290, 52144, 'boolean', ''); INSERT INTO S_CDT VALUES (524291, 2); INSERT INTO S_DT VALUES (524291, 52144, 'integer', ''); INSERT INTO S_CDT VALUES (524292, 3); INSERT INTO S_DT VALUES (524292, 52144, 'real', ''); INSERT INTO S_CDT VALUES (524293, 4); INSERT INTO S_DT VALUES (524293, 52144, 'string', ''); INSERT INTO S_CDT VALUES (524294, 5); INSERT INTO S_DT VALUES (524294, 52144, 'unique_id', ''); INSERT INTO S_CDT VALUES (524295, 6); INSERT INTO S_DT VALUES (524295, 52144, 'state<State_Model>', ''); INSERT INTO S_CDT VALUES (524296, 7); INSERT INTO S_DT VALUES (524296, 52144, 'same_as<Base_Attribute>', ''); INSERT INTO S_CDT VALUES (524297, 8); INSERT INTO S_DT VALUES (524297, 52144, 'inst_ref<Object>', ''); INSERT INTO S_CDT VALUES (524298, 9); INSERT INTO S_DT VALUES (524298, 52144, 'inst_ref_set<Object>', ''); INSERT INTO S_CDT VALUES (524299, 10); INSERT INTO S_DT VALUES (524299, 52144, 'inst<Event>', ''); INSERT INTO S_CDT VALUES (524300, 11); INSERT INTO S_DT VALUES (524300, 52144, 'inst<Mapping>', ''); INSERT INTO S_CDT VALUES (524301, 12); INSERT INTO S_DT VALUES (524301, 52144, 'inst_ref<Mapping>', ''); INSERT INTO S_UDT VALUES (524302, 524300, 1); INSERT INTO S_DT VALUES (524302, 52144, 'date', ''); INSERT INTO S_UDT VALUES (524303, 524300, 2); INSERT INTO S_DT VALUES (524303, 52144, 'timestamp', ''); INSERT INTO S_UDT VALUES (524304, 524301, 3); INSERT INTO S_DT VALUES (524304, 52144, 'inst_ref<Timer>', ''); INSERT INTO S_UDT VALUES (524305, 524293, 0); INSERT INTO S_DT VALUES (524305, 52144, 'colorsA', 'Define the enumeration for colorsA ENUMERATION: TRUE This is a comment ENUMERATOR0: Red=2 ENUMERATOR1: Blue=3 ENUMERATOR2: White=4 ENUMERATOR3: Teal ENUMERATOR4: Magenta ENUMERATOR5: Pink ENUMERATOR7: a7 comment ENUMERATOR8: foocolor ENUMERATOR9: a9 ENUMERATOR10: a10 ENUMERATOR11: a11 ENUMERATOR12: a12 ENUMERATOR13: a13 ENUMERATOR14: a14 ENUMERATOR15: a15 ENUMERATOR16: a16 ENUMERATOR17: a17 ENUMERATOR18: a18 ENUMERATOR19: a19 ENUMERATOR20: a20 ENUMERATOR21: a21 ENUMERATOR22: a22 comment ENUMERATOR23: a23 ENUMERATOR24: a24 ENUMERATOR25: a25 ENUMERATOR26: a26 ENUMERATOR27: a27 ENUMERATOR28: a28 ENUMERATOR29: a29 ENUMERATOR30: a30 comment ENUMERATOR31: a31 ENUMERATOR32: a32 ENUMERATOR33: a33 ENUMERATOR34: a34 ENUMERATOR35: a35 ENUMERATOR36: a36 ENUMERATOR37: a37 ENUMERATOR38: a38 ENUMERATOR39: a39 ENUMERATOR40: a40 ENUMERATOR41: a41 ENUMERATOR42: a42 ENUMERATOR43: a43 ENUMERATOR44: a44 ENUMERATOR45: a45 ENUMERATOR46: a46 ENUMERATOR47: a47 ENUMERATOR48: a48=1000 ENUMERATOR49: a49 comment at end of enumeration colorsA.'); INSERT INTO S_UDT VALUES (524306, 524293, 0); INSERT INTO S_DT VALUES (524306, 52144, 'colorsB', 'ENUMERATION:TRUE OWNER:enum2'); INSERT INTO S_EE VALUES (524295, 'Logging ', '', 'LOG', 52144); INSERT INTO S_BRG VALUES (524326, 524295, 'LogSuccess', '', 0, 524289, '', 1); INSERT INTO S_BPARM VALUES (524341, 524326, 'message', 524293, 0); INSERT INTO S_BRG VALUES (524327, 524295, 'LogFailure', '', 0, 524289, '', 1); INSERT INTO S_BPARM VALUES (524342, 524327, 'message', 524293, 0); INSERT INTO S_BRG VALUES (524328, 524295, 'LogInfo', '', 0, 524289, '', 1); INSERT INTO S_BPARM VALUES (524343, 524328, 'message', 524293, 0); INSERT INTO S_EE VALUES (524296, 'Time', '', 'TIM', 52144); INSERT INTO S_BRG VALUES (524329, 524296, 'current_date', '', 1, 524302, '', 0); INSERT INTO S_BRG VALUES (524330, 524296, 'create_date', '', 1, 524302, '', 0); INSERT INTO S_BPARM VALUES (524344, 524330, 'second', 524291, 0); INSERT INTO S_BPARM VALUES (524345, 524330, 'minute', 524291, 0); INSERT INTO S_BPARM VALUES (524346, 524330, 'hour', 524291, 0); INSERT INTO S_BPARM VALUES (524347, 524330, 'day', 524291, 0); INSERT INTO S_BPARM VALUES (524348, 524330, 'month', 524291, 0); INSERT INTO S_BPARM VALUES (524349, 524330, 'year', 524291, 0); INSERT INTO S_BRG VALUES (524331, 524296, 'get_second', '', 1, 524291, '', 0); INSERT INTO S_BPARM VALUES (524350, 524331, 'date', 524302, 0); INSERT INTO S_BRG VALUES (524332, 524296, 'get_minute', '', 1, 524291, '', 0); INSERT INTO S_BPARM VALUES (524351, 524332, 'date', 524302, 0); INSERT INTO S_BRG VALUES (524333, 524296, 'get_hour', '', 1, 524291, '', 0); INSERT INTO S_BPARM VALUES (524352, 524333, 'date', 524302, 0); INSERT INTO S_BRG VALUES (524334, 524296, 'get_day', '', 1, 524291, '', 0); INSERT INTO S_BPARM VALUES (524353, 524334, 'date', 524302, 0); INSERT INTO S_BRG VALUES (524335, 524296, 'get_month', '', 1, 524291, '', 0); INSERT INTO S_BPARM VALUES (524354, 524335, 'date', 524302, 0); INSERT INTO S_BRG VALUES (524336, 524296, 'get_year', '', 1, 524291, '', 0); INSERT INTO S_BPARM VALUES (524355, 524336, 'date', 524302, 0); INSERT INTO S_BRG VALUES (524337, 524296, 'current_clock', '', 1, 524303, '', 0); INSERT INTO S_BRG VALUES (524338, 524296, 'timer_start', '', 1, 524304, '', 0); INSERT INTO S_BPARM VALUES (524356, 524338, 'microseconds', 524291, 0); INSERT INTO S_BPARM VALUES (524357, 524338, 'event_inst', 524299, 0); INSERT INTO S_BRG VALUES (524339, 524296, 'timer_start_recurring', '', 1, 524304, '', 0); INSERT INTO S_BPARM VALUES (524358, 524339, 'microseconds', 524291, 0); INSERT INTO S_BPARM VALUES (524359, 524339, 'event_inst', 524299, 0); INSERT INTO S_BRG VALUES (524340, 524296, 'timer_remaining_time', '', 1, 524291, '', 0); INSERT INTO S_BPARM VALUES (524360, 524340, 'timer_inst_ref', 524304, 0); INSERT INTO S_BRG VALUES (524341, 524296, 'timer_reset_time', '', 1, 524290, '', 0); INSERT INTO S_BPARM VALUES (524361, 524341, 'timer_inst_ref', 524304, 0); INSERT INTO S_BPARM VALUES (524362, 524341, 'microseconds', 524291, 0); INSERT INTO S_BRG VALUES (524342, 524296, 'timer_add_time', '', 1, 524290, '', 0); INSERT INTO S_BPARM VALUES (524363, 524342, 'timer_inst_ref', 524304, 0); INSERT INTO S_BPARM VALUES (524364, 524342, 'microseconds', 524291, 0); INSERT INTO S_BRG VALUES (524343, 524296, 'timer_cancel', '', 1, 524290, '', 0); INSERT INTO S_BPARM VALUES (524365, 524343, 'timer_inst_ref', 524304, 0); INSERT INTO S_EE VALUES (524297, 'Architecture', '', 'ARCH', 52144); INSERT INTO S_BRG VALUES (524344, 524297, 'shutdown', '', 0, 524289, 'control stop;', 1); INSERT INTO S_EE VALUES (524298, 'Enum Two', '', 'ENUMTWO', 52144); INSERT INTO S_BRG VALUES (524345, 524298, 'send_colorsA_ret_colorsA', '', 0, 524305, 'return param.colorA;', 1); INSERT INTO S_BPARM VALUES (524366, 524345, 'colorA', 524305, 0); INSERT INTO S_BRG VALUES (524346, 524298, 'send_colorsB_ret_colorsB', '', 0, 524306, 'return param.colorB;', 1); INSERT INTO S_BPARM VALUES (524367, 524346, 'colorB', 524306, 0); INSERT INTO S_EE VALUES (524299, 'Driver', '', 'DR', 52144); INSERT INTO S_BRG VALUES (524347, 524299, 'checkin', '', 0, 524289, 'control stop; ', 1); INSERT INTO S_BPARM VALUES (524368, 524347, 'id', 524291, 0); INSERT INTO GD_MD VALUES (524289, 1, 52144, 1, 1, 0, 1, 1, 0, 12, 1511, 4125, 1.000000, 0); INSERT INTO GD_GE VALUES (524348, 524289, 6815757, 11); INSERT INTO GD_SHP VALUES (524348, 1712, 1312, 1904, 1424); INSERT INTO GD_GE VALUES (524349, 524289, 524295, 12); INSERT INTO GD_SHP VALUES (524349, 1712, 1696, 1904, 1808); INSERT INTO GD_GE VALUES (524350, 524289, 524296, 12); INSERT INTO GD_SHP VALUES (524350, 1712, 1568, 1904, 1680); INSERT INTO GD_GE VALUES (524351, 524289, 524297, 12); INSERT INTO GD_SHP VALUES (524351, 1920, 1568, 2112, 1680); INSERT INTO GD_GE VALUES (524352, 524289, 7340046, 11); INSERT INTO GD_SHP VALUES (524352, 1920, 1312, 2112, 1424); INSERT INTO GD_GE VALUES (524353, 524289, 524298, 12); INSERT INTO GD_SHP VALUES (524353, 1712, 1440, 1904, 1552); INSERT INTO GD_GE VALUES (524354, 524289, 524299, 12); INSERT INTO GD_SHP VALUES (524354, 1920, 1440, 2112, 1552); INSERT INTO GD_MD VALUES (524290, 2, 52144, 1, 1, 0, 1, 1, 0, 12, 1600, 4200, 1.000000, 0); INSERT INTO GD_GE VALUES (524355, 524290, 6815757, 11); INSERT INTO GD_SHP VALUES (524355, 1920, 1344, 2080, 1440); INSERT INTO GD_GE VALUES (524356, 524290, 7340046, 11); INSERT INTO GD_SHP VALUES (524356, 2160, 1408, 2320, 1504); INSERT INTO GD_MD VALUES (524291, 3, 52144, 1, 1, 0, 1, 1, 0, 12, 1600, 4200, 1.000000, 0); INSERT INTO GD_GE VALUES (524357, 524291, 6815757, 11); INSERT INTO GD_SHP VALUES (524357, 1920, 1344, 2080, 1440); INSERT INTO GD_GE VALUES (524358, 524291, 7340046, 11); INSERT INTO GD_SHP VALUES (524358, 1856, 1344, 2016, 1440); INSERT INTO GD_MD VALUES (524292, 4, 52144, 1, 1, 0, 1, 1, 0, 12, 1600, 4200, 1.000000, 0); INSERT INTO GD_GE VALUES (524359, 524292, 6815757, 11); INSERT INTO GD_SHP VALUES (524359, 1920, 1344, 2080, 1440); INSERT INTO GD_GE VALUES (524360, 524292, 7340046, 11); INSERT INTO GD_SHP VALUES (524360, 2192, 1392, 2352, 1488); INSERT INTO S_SS VALUES (6815757, 'enum1', '', '', 1, 52144, 6815757); INSERT INTO O_OBJ VALUES (6815748, 'enum init', 1, 'INIT', '', 6815757); INSERT INTO O_NBATTR VALUES (6815755, 6815748); INSERT INTO O_BATTR VALUES (6815755, 6815748); INSERT INTO O_ATTR VALUES (6815755, 6815748, 0, 'id', '', '', 'id', 0, 524294); INSERT INTO O_NBATTR VALUES (6815756, 6815748); INSERT INTO O_BATTR VALUES (6815756, 6815748); INSERT INTO O_ATTR VALUES (6815756, 6815748, 6815755, 'current_state', '', '', 'current_state', 0, 524295); INSERT INTO O_ID VALUES (0, 6815748); INSERT INTO O_OIDA VALUES (6815755, 6815748, 0); INSERT INTO SM_ISM VALUES (3145734, 6815748); INSERT INTO SM_SM VALUES (3145734, '', 6); INSERT INTO SM_MOORE VALUES (3145734); INSERT INTO SM_SUPDT VALUES (3145729, 3145734, 0); INSERT INTO SM_STATE VALUES (3145729, 3145734, 3145729, 'init', 1, 0); INSERT INTO SM_LEVT VALUES (3145729, 3145734, 3145729); INSERT INTO SM_SEVT VALUES (3145729, 3145734, 3145729); INSERT INTO SM_EVT VALUES (3145729, 3145734, 3145729, 1, 'Init', 0, '', 'INIT1', ''); INSERT INTO SM_SEME VALUES (3145729, 3145729, 3145734, 3145729); INSERT INTO SM_NSTXN VALUES (3145729, 3145734, 3145729, 3145729, 3145729); INSERT INTO SM_TXN VALUES (3145729, 3145734, 3145729, 3145729); INSERT INTO SM_MOAH VALUES (3145729, 3145734, 3145729); INSERT INTO SM_AH VALUES (3145729, 3145734); INSERT INTO SM_ACT VALUES (3145729, 3145734, 1, 'create object instance of TE; DR::checkin(id:1); ', ''); INSERT INTO GD_MD VALUES (3145729, 8, 3145734, 40, 1, 0, 1, 1, 0, 12, 1600, 4199, 1.000000, 0); INSERT INTO GD_GE VALUES (3145730, 3145729, 3145729, 41); INSERT INTO GD_SHP VALUES (3145730, 1648, 1264, 1936, 1440); INSERT INTO GD_GE VALUES (3145731, 3145729, 3145729, 42); INSERT INTO GD_CON VALUES (3145731, 3145730, 3145730, 0); INSERT INTO GD_CTXT VALUES (3145731, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (3145732, 3145731, 1680, 1264, 1680, 1232, 0); INSERT INTO GD_LS VALUES (3145733, 3145731, 1680, 1232, 1904, 1232, 3145732); INSERT INTO GD_LS VALUES (3145734, 3145731, 1904, 1232, 1904, 1264, 3145733); INSERT INTO O_OBJ VALUES (6815749, 'Enum Bridge Object', 2, 'B', '', 6815757); INSERT INTO O_NBATTR VALUES (6815757, 6815749); INSERT INTO O_BATTR VALUES (6815757, 6815749); INSERT INTO O_ATTR VALUES (6815757, 6815749, 0, 'id', '', '', 'id', 0, 524294); INSERT INTO O_NBATTR VALUES (6815758, 6815749); INSERT INTO O_BATTR VALUES (6815758, 6815749); INSERT INTO O_ATTR VALUES (6815758, 6815749, 6815757, 'ra_send_colorsA_ret_colorsA', '', '', 'ra_send_colorsA_ret_colorsA', 0, 524305); INSERT INTO O_NBATTR VALUES (6815759, 6815749); INSERT INTO O_BATTR VALUES (6815759, 6815749); INSERT INTO O_ATTR VALUES (6815759, 6815749, 6815758, 'ra_send_colorsB_ret_colorsB', '', '', 'ra_send_colorsB_ret_colorsB', 0, 524306); INSERT INTO O_NBATTR VALUES (6815760, 6815749); INSERT INTO O_BATTR VALUES (6815760, 6815749); INSERT INTO O_ATTR VALUES (6815760, 6815749, 6815759, 'current_state', '', '', 'current_state', 0, 524295); INSERT INTO O_ID VALUES (0, 6815749); INSERT INTO O_OIDA VALUES (6815757, 6815749, 0); INSERT INTO SM_ISM VALUES (3670023, 6815749); INSERT INTO SM_SM VALUES (3670023, '', 7); INSERT INTO SM_MOORE VALUES (3670023); INSERT INTO SM_EVTDI VALUES (3670017, 3670023, 'colorA', '', 524305); INSERT INTO SM_EVTDI VALUES (3670018, 3670023, 'colorB', '', 524306); INSERT INTO SM_SUPDT VALUES (3670017, 3670023, 0); INSERT INTO SM_SDI VALUES (3670017, 3670017, 3670023); INSERT INTO SM_SDI VALUES (3670018, 3670017, 3670023); INSERT INTO SM_SUPDT VALUES (3670018, 3670023, 0); INSERT INTO SM_SUPDT VALUES (3670019, 3670023, 0); INSERT INTO SM_SDI VALUES (3670017, 3670019, 3670023); INSERT INTO SM_SUPDT VALUES (3670020, 3670023, 0); INSERT INTO SM_SDI VALUES (3670018, 3670020, 3670023); INSERT INTO SM_STATE VALUES (3670017, 3670023, 3670017, 'start instance', 1, 0); INSERT INTO SM_LEVT VALUES (3670017, 3670023, 3670017); INSERT INTO SM_SEVT VALUES (3670017, 3670023, 3670017); INSERT INTO SM_EVT VALUES (3670017, 3670023, 3670017, 1, 'start instance', 0, '', 'B1', ''); INSERT INTO SM_SEME VALUES (3670017, 3670017, 3670023, 3670017); INSERT INTO SM_LEVT VALUES (3670018, 3670023, 3670018); INSERT INTO SM_SEVT VALUES (3670018, 3670023, 3670018); INSERT INTO SM_EVT VALUES (3670018, 3670023, 3670018, 2, 'shutdown instance', 0, '', 'B2', ''); INSERT INTO SM_CH VALUES (3670017, 3670018, 3670023, 3670018, ''); INSERT INTO SM_SEME VALUES (3670017, 3670018, 3670023, 3670018); INSERT INTO SM_LEVT VALUES (3670019, 3670023, 3670017); INSERT INTO SM_SEVT VALUES (3670019, 3670023, 3670017); INSERT INTO SM_EVT VALUES (3670019, 3670023, 3670017, 3, 'start assigner', 0, '', 'B3', ''); INSERT INTO SM_CH VALUES (3670017, 3670019, 3670023, 3670017, ''); INSERT INTO SM_SEME VALUES (3670017, 3670019, 3670023, 3670017); INSERT INTO SM_LEVT VALUES (3670020, 3670023, 3670018); INSERT INTO SM_SEVT VALUES (3670020, 3670023, 3670018); INSERT INTO SM_EVT VALUES (3670020, 3670023, 3670018, 4, 'shutdown assigner', 0, '', 'B4', ''); INSERT INTO SM_CH VALUES (3670017, 3670020, 3670023, 3670018, ''); INSERT INTO SM_SEME VALUES (3670017, 3670020, 3670023, 3670018); INSERT INTO SM_LEVT VALUES (3670021, 3670023, 3670019); INSERT INTO SM_SEVT VALUES (3670021, 3670023, 3670019); INSERT INTO SM_EVT VALUES (3670021, 3670023, 3670019, 5, 'send_colorsA_ret_colorsA', 0, '', 'B5', ''); INSERT INTO SM_CH VALUES (3670017, 3670021, 3670023, 3670019, ''); INSERT INTO SM_SEME VALUES (3670017, 3670021, 3670023, 3670019); INSERT INTO SM_LEVT VALUES (3670022, 3670023, 3670020); INSERT INTO SM_SEVT VALUES (3670022, 3670023, 3670020); INSERT INTO SM_EVT VALUES (3670022, 3670023, 3670020, 6, 'send_colorsB_ret_colorsB', 0, '', 'B6', ''); INSERT INTO SM_CH VALUES (3670017, 3670022, 3670023, 3670020, ''); INSERT INTO SM_SEME VALUES (3670017, 3670022, 3670023, 3670020); INSERT INTO SM_STATE VALUES (3670018, 3670023, 3670018, 'shutdown instance', 2, 0); INSERT INTO SM_CH VALUES (3670018, 3670017, 3670023, 3670017, ''); INSERT INTO SM_SEME VALUES (3670018, 3670017, 3670023, 3670017); INSERT INTO SM_SEME VALUES (3670018, 3670018, 3670023, 3670018); INSERT INTO SM_CH VALUES (3670018, 3670019, 3670023, 3670017, ''); INSERT INTO SM_SEME VALUES (3670018, 3670019, 3670023, 3670017); INSERT INTO SM_CH VALUES (3670018, 3670020, 3670023, 3670018, ''); INSERT INTO SM_SEME VALUES (3670018, 3670020, 3670023, 3670018); INSERT INTO SM_CH VALUES (3670018, 3670021, 3670023, 3670019, ''); INSERT INTO SM_SEME VALUES (3670018, 3670021, 3670023, 3670019); INSERT INTO SM_CH VALUES (3670018, 3670022, 3670023, 3670020, ''); INSERT INTO SM_SEME VALUES (3670018, 3670022, 3670023, 3670020); INSERT INTO SM_STATE VALUES (3670019, 3670023, 3670017, 'start assigner', 3, 0); INSERT INTO SM_CH VALUES (3670019, 3670017, 3670023, 3670017, ''); INSERT INTO SM_SEME VALUES (3670019, 3670017, 3670023, 3670017); INSERT INTO SM_CH VALUES (3670019, 3670018, 3670023, 3670018, ''); INSERT INTO SM_SEME VALUES (3670019, 3670018, 3670023, 3670018); INSERT INTO SM_SEME VALUES (3670019, 3670019, 3670023, 3670017); INSERT INTO SM_CH VALUES (3670019, 3670020, 3670023, 3670018, ''); INSERT INTO SM_SEME VALUES (3670019, 3670020, 3670023, 3670018); INSERT INTO SM_CH VALUES (3670019, 3670021, 3670023, 3670019, ''); INSERT INTO SM_SEME VALUES (3670019, 3670021, 3670023, 3670019); INSERT INTO SM_CH VALUES (3670019, 3670022, 3670023, 3670020, ''); INSERT INTO SM_SEME VALUES (3670019, 3670022, 3670023, 3670020); INSERT INTO SM_STATE VALUES (3670020, 3670023, 3670018, 'shutdown assigner', 4, 0); INSERT INTO SM_CH VALUES (3670020, 3670017, 3670023, 3670017, ''); INSERT INTO SM_SEME VALUES (3670020, 3670017, 3670023, 3670017); INSERT INTO SM_CH VALUES (3670020, 3670018, 3670023, 3670018, ''); INSERT INTO SM_SEME VALUES (3670020, 3670018, 3670023, 3670018); INSERT INTO SM_CH VALUES (3670020, 3670019, 3670023, 3670017, ''); INSERT INTO SM_SEME VALUES (3670020, 3670019, 3670023, 3670017); INSERT INTO SM_SEME VALUES (3670020, 3670020, 3670023, 3670018); INSERT INTO SM_CH VALUES (3670020, 3670021, 3670023, 3670019, ''); INSERT INTO SM_SEME VALUES (3670020, 3670021, 3670023, 3670019); INSERT INTO SM_CH VALUES (3670020, 3670022, 3670023, 3670020, ''); INSERT INTO SM_SEME VALUES (3670020, 3670022, 3670023, 3670020); INSERT INTO SM_STATE VALUES (3670021, 3670023, 3670019, 'send_colorsA_ret_colorsA', 5, 0); INSERT INTO SM_CH VALUES (3670021, 3670017, 3670023, 3670017, ''); INSERT INTO SM_SEME VALUES (3670021, 3670017, 3670023, 3670017); INSERT INTO SM_CH VALUES (3670021, 3670018, 3670023, 3670018, ''); INSERT INTO SM_SEME VALUES (3670021, 3670018, 3670023, 3670018); INSERT INTO SM_CH VALUES (3670021, 3670019, 3670023, 3670017, ''); INSERT INTO SM_SEME VALUES (3670021, 3670019, 3670023, 3670017); INSERT INTO SM_CH VALUES (3670021, 3670020, 3670023, 3670018, ''); INSERT INTO SM_SEME VALUES (3670021, 3670020, 3670023, 3670018); INSERT INTO SM_SEME VALUES (3670021, 3670021, 3670023, 3670019); INSERT INTO SM_CH VALUES (3670021, 3670022, 3670023, 3670020, ''); INSERT INTO SM_SEME VALUES (3670021, 3670022, 3670023, 3670020); INSERT INTO SM_STATE VALUES (3670022, 3670023, 3670020, 'send_colorsB_ret_colorsB', 6, 0); INSERT INTO SM_CH VALUES (3670022, 3670017, 3670023, 3670017, ''); INSERT INTO SM_SEME VALUES (3670022, 3670017, 3670023, 3670017); INSERT INTO SM_CH VALUES (3670022, 3670018, 3670023, 3670018, ''); INSERT INTO SM_SEME VALUES (3670022, 3670018, 3670023, 3670018); INSERT INTO SM_CH VALUES (3670022, 3670019, 3670023, 3670017, ''); INSERT INTO SM_SEME VALUES (3670022, 3670019, 3670023, 3670017); INSERT INTO SM_CH VALUES (3670022, 3670020, 3670023, 3670018, ''); INSERT INTO SM_SEME VALUES (3670022, 3670020, 3670023, 3670018); INSERT INTO SM_CH VALUES (3670022, 3670021, 3670023, 3670019, ''); INSERT INTO SM_SEME VALUES (3670022, 3670021, 3670023, 3670019); INSERT INTO SM_SEME VALUES (3670022, 3670022, 3670023, 3670020); INSERT INTO SM_NSTXN VALUES (3670017, 3670023, 3670017, 3670017, 3670017); INSERT INTO SM_TXN VALUES (3670017, 3670023, 3670017, 3670017); INSERT INTO SM_NSTXN VALUES (3670018, 3670023, 3670018, 3670018, 3670018); INSERT INTO SM_TXN VALUES (3670018, 3670023, 3670018, 3670018); INSERT INTO SM_NSTXN VALUES (3670019, 3670023, 3670019, 3670019, 3670017); INSERT INTO SM_TXN VALUES (3670019, 3670023, 3670019, 3670017); INSERT INTO SM_NSTXN VALUES (3670020, 3670023, 3670020, 3670020, 3670018); INSERT INTO SM_TXN VALUES (3670020, 3670023, 3670020, 3670018); INSERT INTO SM_NSTXN VALUES (3670021, 3670023, 3670021, 3670021, 3670019); INSERT INTO SM_TXN VALUES (3670021, 3670023, 3670021, 3670019); INSERT INTO SM_NSTXN VALUES (3670022, 3670023, 3670022, 3670022, 3670020); INSERT INTO SM_TXN VALUES (3670022, 3670023, 3670022, 3670020); INSERT INTO SM_MOAH VALUES (3670017, 3670023, 3670017); INSERT INTO SM_AH VALUES (3670017, 3670023); INSERT INTO SM_ACT VALUES (3670017, 3670023, 1, 'select any te from instances of TE; generate TE1:''start''(colorA:rcvd_evt.colorA,colorB:rcvd_evt.colorB) to te;', ''); INSERT INTO SM_MOAH VALUES (3670018, 3670023, 3670018); INSERT INTO SM_AH VALUES (3670018, 3670023); INSERT INTO SM_ACT VALUES (3670018, 3670023, 1, 'select any te from instances of TE; generate TE3:''shutdown''() to te;', ''); INSERT INTO SM_MOAH VALUES (3670019, 3670023, 3670019); INSERT INTO SM_AH VALUES (3670019, 3670023); INSERT INTO SM_ACT VALUES (3670019, 3670023, 1, 'generate TE_A1:''start''(colorA:rcvd_evt.colorA,colorB:rcvd_evt.colorB) to TE Assigner;', ''); INSERT INTO SM_MOAH VALUES (3670020, 3670023, 3670020); INSERT INTO SM_AH VALUES (3670020, 3670023); INSERT INTO SM_ACT VALUES (3670020, 3670023, 1, 'generate TE_A2:''finish''() to TE Assigner;', ''); INSERT INTO SM_MOAH VALUES (3670021, 3670023, 3670021); INSERT INTO SM_AH VALUES (3670021, 3670023); INSERT INTO SM_ACT VALUES (3670021, 3670023, 1, 'self.ra_send_colorsA_ret_colorsA=rcvd_evt.colorA;', ''); INSERT INTO SM_MOAH VALUES (3670022, 3670023, 3670022); INSERT INTO SM_AH VALUES (3670022, 3670023); INSERT INTO SM_ACT VALUES (3670022, 3670023, 1, 'self.ra_send_colorsB_ret_colorsB=rcvd_evt.colorB;', ''); INSERT INTO GD_MD VALUES (3670017, 8, 3670023, 40, 1, 0, 1, 1, 0, 12, 1473, 4208, 0.750000, 0); INSERT INTO GD_GE VALUES (3670018, 3670017, 3670017, 41); INSERT INTO GD_SHP VALUES (3670018, 1648, 1104, 1936, 1248); INSERT INTO GD_GE VALUES (3670019, 3670017, 3670018, 41); INSERT INTO GD_SHP VALUES (3670019, 1648, 1328, 1936, 1472); INSERT INTO GD_GE VALUES (3670020, 3670017, 3670019, 41); INSERT INTO GD_SHP VALUES (3670020, 2000, 1104, 2288, 1248); INSERT INTO GD_GE VALUES (3670021, 3670017, 3670020, 41); INSERT INTO GD_SHP VALUES (3670021, 2000, 1328, 2288, 1472); INSERT INTO GD_GE VALUES (3670022, 3670017, 3670021, 41); INSERT INTO GD_SHP VALUES (3670022, 1648, 1568, 1936, 1712); INSERT INTO GD_GE VALUES (3670023, 3670017, 3670022, 41); INSERT INTO GD_SHP VALUES (3670023, 2000, 1568, 2288, 1712); INSERT INTO GD_GE VALUES (3670024, 3670017, 3670017, 42); INSERT INTO GD_CON VALUES (3670024, 3670018, 3670018, 0); INSERT INTO GD_CTXT VALUES (3670024, 0, 0, 0, 0, 0, 0, 1676, 1038, 1910, 1060, -1, -6, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (3670159, 3670024, 1680, 1104, 1680, 1072, 0); INSERT INTO GD_LS VALUES (3670160, 3670024, 1680, 1072, 1904, 1072, 3670159); INSERT INTO GD_LS VALUES (3670161, 3670024, 1904, 1072, 1904, 1104, 3670160); INSERT INTO GD_GE VALUES (3670028, 3670017, 3670018, 42); INSERT INTO GD_CON VALUES (3670028, 3670019, 3670019, 0); INSERT INTO GD_CTXT VALUES (3670028, 0, 0, 0, 0, 0, 0, 1711, 1267, 1866, 1289, -6, -1, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (3670192, 3670028, 1680, 1328, 1680, 1296, 0); INSERT INTO GD_LS VALUES (3670193, 3670028, 1680, 1296, 1904, 1296, 3670192); INSERT INTO GD_LS VALUES (3670194, 3670028, 1904, 1296, 1904, 1328, 3670193); INSERT INTO GD_GE VALUES (3670032, 3670017, 3670019, 42); INSERT INTO GD_CON VALUES (3670032, 3670020, 3670020, 0); INSERT INTO GD_CTXT VALUES (3670032, 0, 0, 0, 0, 0, 0, 2023, 1036, 2259, 1058, -5, -8, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (3670141, 3670032, 2016, 1104, 2016, 1072, 0); INSERT INTO GD_LS VALUES (3670142, 3670032, 2016, 1072, 2272, 1072, 3670141); INSERT INTO GD_LS VALUES (3670143, 3670032, 2272, 1072, 2272, 1104, 3670142); INSERT INTO GD_GE VALUES (3670036, 3670017, 3670020, 42); INSERT INTO GD_CON VALUES (3670036, 3670021, 3670021, 0); INSERT INTO GD_CTXT VALUES (3670036, 0, 0, 0, 0, 0, 0, 2059, 1265, 2216, 1287, -9, -3, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (3670240, 3670036, 2032, 1328, 2032, 1296, 0); INSERT INTO GD_LS VALUES (3670241, 3670036, 2032, 1296, 2256, 1296, 3670240); INSERT INTO GD_LS VALUES (3670242, 3670036, 2256, 1296, 2256, 1328, 3670241); INSERT INTO GD_GE VALUES (3670040, 3670017, 3670021, 42); INSERT INTO GD_CON VALUES (3670040, 3670022, 3670022, 0); INSERT INTO GD_CTXT VALUES (3670040, 0, 0, 0, 0, 0, 0, 1674, 1491, 1948, 1513, 17, -17, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (3670300, 3670040, 1680, 1568, 1680, 1536, 0); INSERT INTO GD_LS VALUES (3670301, 3670040, 1680, 1536, 1904, 1536, 3670300); INSERT INTO GD_LS VALUES (3670302, 3670040, 1904, 1536, 1904, 1568, 3670301); INSERT INTO GD_GE VALUES (3670044, 3670017, 3670022, 42); INSERT INTO GD_CON VALUES (3670044, 3670023, 3670023, 0); INSERT INTO GD_CTXT VALUES (3670044, 0, 0, 0, 0, 0, 0, 2019, 1501, 2293, 1523, 10, -7, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (3670366, 3670044, 2032, 1568, 2032, 1536, 0); INSERT INTO GD_LS VALUES (3670367, 3670044, 2032, 1536, 2256, 1536, 3670366); INSERT INTO GD_LS VALUES (3670368, 3670044, 2256, 1536, 2256, 1568, 3670367); INSERT INTO CA_COMM VALUES (3670017, 6815757); INSERT INTO CA_SMSMC VALUES (3670017, 3670023, 4194312, 0); INSERT INTO CA_SMSME VALUES (3670017, 4194312, 4194307); INSERT INTO CA_SMSME VALUES (3670017, 4194312, 4194305); INSERT INTO CA_COMM VALUES (3670018, 6815757); INSERT INTO CA_SMSMC VALUES (3670018, 3670023, 4718601, 0); INSERT INTO CA_SMSME VALUES (3670018, 4718601, 4718594); INSERT INTO CA_SMSME VALUES (3670018, 4718601, 4718593); INSERT INTO CA_ACC VALUES (3670017, 6815757, 3670023, 0); INSERT INTO CA_SMOA VALUES (3670017, 6815749, 0); INSERT INTO CA_SMOAA VALUES (3670017, 6815758, 6815749); INSERT INTO CA_SMOAA VALUES (3670017, 6815759, 6815749); INSERT INTO GD_MD VALUES (6815787, 5, 6815757, 11, 1, 0, 1, 1, 0, 12, 1487, 4357, 1.000000, 0); INSERT INTO GD_GE VALUES (6815790, 6815787, 6815748, 21); INSERT INTO GD_SHP VALUES (6815790, 1712, 1344, 2064, 1504); INSERT INTO GD_GE VALUES (6815791, 6815787, 6815749, 21); INSERT INTO GD_SHP VALUES (6815791, 1712, 1152, 2064, 1312); INSERT INTO GD_MD VALUES (6815788, 6, 6815757, 11, 1, 0, 1, 1, 0, 12, 1600, 4200, 1.000000, 0); INSERT INTO GD_GE VALUES (6815792, 6815788, 6815748, 21); INSERT INTO GD_SHP VALUES (6815792, 1712, 1280, 1904, 1344); INSERT INTO GD_GE VALUES (6815793, 6815788, 6815749, 21); INSERT INTO GD_SHP VALUES (6815793, 1712, 1152, 1904, 1216); INSERT INTO GD_MD VALUES (6815789, 7, 6815757, 11, 1, 0, 1, 1, 0, 12, 1600, 4200, 1.000000, 0); INSERT INTO GD_GE VALUES (6815794, 6815789, 6815748, 21); INSERT INTO GD_SHP VALUES (6815794, 1712, 1280, 1904, 1344); INSERT INTO GD_GE VALUES (6815795, 6815789, 6815749, 21); INSERT INTO GD_SHP VALUES (6815795, 1712, 1152, 1904, 1216); INSERT INTO S_SS VALUES (7340046, 'Test Enums', '', '', 300, 52144, 7340046); INSERT INTO O_OBJ VALUES (7340038, 'Test Enums', 300, 'TE', '', 7340046); INSERT INTO O_TFR VALUES (7340035, 7340038, 'send_colorsA_ret_colorsA', '', 524305, 0, '// ACTION_SPECIFICATION: TRUE return param.colorA;', 1); INSERT INTO O_TPARM VALUES (7340113, 7340035, 'colorA', 524305, 0); INSERT INTO O_TFR VALUES (7340036, 7340038, 'send_colorsB_ret_colorsB', '', 524306, 0, 'LOG::LogFailure(message:"TE::send_colorsB_ret_colorsB operation should not have been translated."); return param.colorB;', 1); INSERT INTO O_TPARM VALUES (7340114, 7340036, 'colorB', 524306, 0); INSERT INTO O_NBATTR VALUES (7340049, 7340038); INSERT INTO O_BATTR VALUES (7340049, 7340038); INSERT INTO O_ATTR VALUES (7340049, 7340038, 0, 'id', '', '', 'id', 0, 524294); INSERT INTO O_NBATTR VALUES (7340050, 7340038); INSERT INTO O_BATTR VALUES (7340050, 7340038); INSERT INTO O_ATTR VALUES (7340050, 7340038, 7340049, 'current_state', '', '', 'current_state', 0, 524295); INSERT INTO O_NBATTR VALUES (7340051, 7340038); INSERT INTO O_BATTR VALUES (7340051, 7340038); INSERT INTO O_ATTR VALUES (7340051, 7340038, 7340050, 'colorA', '', '', 'colorA', 0, 524305); INSERT INTO O_NBATTR VALUES (7340052, 7340038); INSERT INTO O_BATTR VALUES (7340052, 7340038); INSERT INTO O_ATTR VALUES (7340052, 7340038, 7340051, 'colorB', '', '', 'colorB', 0, 524306); INSERT INTO O_ID VALUES (0, 7340038); INSERT INTO O_OIDA VALUES (7340049, 7340038, 0); INSERT INTO SM_ISM VALUES (4194312, 7340038); INSERT INTO SM_SM VALUES (4194312, '', 8); INSERT INTO SM_MOORE VALUES (4194312); INSERT INTO SM_EVTDI VALUES (4194305, 4194312, 'colorA', '', 524305); INSERT INTO SM_EVTDI VALUES (4194306, 4194312, 'colorB', '', 524306); INSERT INTO SM_SUPDT VALUES (4194305, 4194312, 0); INSERT INTO SM_SDI VALUES (4194305, 4194305, 4194312); INSERT INTO SM_SDI VALUES (4194306, 4194305, 4194312); INSERT INTO SM_SUPDT VALUES (4194306, 4194312, 0); INSERT INTO SM_STATE VALUES (4194305, 4194312, 4194305, 'start', 1, 0); INSERT INTO SM_LEVT VALUES (4194305, 4194312, 4194305); INSERT INTO SM_SEVT VALUES (4194305, 4194312, 4194305); INSERT INTO SM_EVT VALUES (4194305, 4194312, 4194305, 1, 'start', 0, '', 'TE1', ''); INSERT INTO SM_SEME VALUES (4194305, 4194305, 4194312, 4194305); INSERT INTO SM_LEVT VALUES (4194306, 4194312, 4194305); INSERT INTO SM_SEVT VALUES (4194306, 4194312, 4194305); INSERT INTO SM_EVT VALUES (4194306, 4194312, 4194305, 2, 'finish', 0, '', 'TE2', ''); INSERT INTO SM_SEME VALUES (4194305, 4194306, 4194312, 4194305); INSERT INTO SM_LEVT VALUES (4194307, 4194312, 4194306); INSERT INTO SM_SEVT VALUES (4194307, 4194312, 4194306); INSERT INTO SM_EVT VALUES (4194307, 4194312, 4194306, 3, 'shutdown', 0, '', 'TE3', ''); INSERT INTO SM_CH VALUES (4194305, 4194307, 4194312, 4194306, ''); INSERT INTO SM_SEME VALUES (4194305, 4194307, 4194312, 4194306); INSERT INTO SM_STATE VALUES (4194306, 4194312, 4194305, 'finish', 2, 0); INSERT INTO SM_EIGN VALUES (4194306, 4194305, 4194312, 4194305, ''); INSERT INTO SM_SEME VALUES (4194306, 4194305, 4194312, 4194305); INSERT INTO SM_EIGN VALUES (4194306, 4194306, 4194312, 4194305, ''); INSERT INTO SM_SEME VALUES (4194306, 4194306, 4194312, 4194305); INSERT INTO SM_SEME VALUES (4194306, 4194307, 4194312, 4194306); INSERT INTO SM_STATE VALUES (4194307, 4194312, 4194306, 'done', 3, 0); INSERT INTO SM_CH VALUES (4194307, 4194305, 4194312, 4194305, ''); INSERT INTO SM_SEME VALUES (4194307, 4194305, 4194312, 4194305); INSERT INTO SM_CH VALUES (4194307, 4194306, 4194312, 4194305, ''); INSERT INTO SM_SEME VALUES (4194307, 4194306, 4194312, 4194305); INSERT INTO SM_CH VALUES (4194307, 4194307, 4194312, 4194306, ''); INSERT INTO SM_SEME VALUES (4194307, 4194307, 4194312, 4194306); INSERT INTO SM_NSTXN VALUES (4194305, 4194312, 4194305, 4194306, 4194305); INSERT INTO SM_TXN VALUES (4194305, 4194312, 4194306, 4194305); INSERT INTO SM_NSTXN VALUES (4194306, 4194312, 4194306, 4194307, 4194306); INSERT INTO SM_TXN VALUES (4194306, 4194312, 4194307, 4194306); INSERT INTO SM_NSTXN VALUES (4194307, 4194312, 4194305, 4194305, 4194305); INSERT INTO SM_TXN VALUES (4194307, 4194312, 4194305, 4194305); INSERT INTO SM_MOAH VALUES (4194305, 4194312, 4194305); INSERT INTO SM_AH VALUES (4194305, 4194312); INSERT INTO SM_ACT VALUES (4194305, 4194312, 1, '// The following exercise all valid uses of enums in the AL // object attribute // event supp data item // bridge operation argument // bridge return value // transformer argument // transform return value // comparison ==, != // assignment to local variable assign self.colorA = "a49"; assign self.colorB = "redder"; // test in attribute and event data if (self.colorA == rcvd_evt.colorA) LOG::LogSuccess(message:"ENUM1: self.enumA == rcvd_evt.enumA") ; else LOG::LogFailure(message:"ENUM1: self.enumA == rcvd_evt.enumA") ; end if; if (self.colorB == rcvd_evt.colorB) LOG::LogSuccess(message:"ENUM1: self.enumB == rcvd_evt.enum") ; else LOG::LogFailure(message:"ENUM1: self.enumB == rcvd_evt.enum") ; end if; // test local variable assign local_colorA = self.colorA; assign local_colorB = self.colorB; if (local_colorA == rcvd_evt.colorA) LOG::LogSuccess(message:"ENUM1: local_colorA == rcvd_evt.enumA") ; else LOG::LogFailure(message:"ENUM1: local_colorA == rcvd_evt.enumA") ; end if; if (local_colorB == rcvd_evt.colorB) LOG::LogSuccess(message:"ENUM1: local_colorB == rcvd_evt.enumB") ; else LOG::LogFailure(message:"ENUM1: local_colorB == rcvd_evt.enumB") ; end if; // check inequality if (local_colorA != "foocolor") LOG::LogSuccess(message:"ENUM1: local_colorA != operator") ; else LOG::LogFailure(message:"ENUM1: local_colorA != operator") ; end if; // Test transforms with enums transform ret_colorA = TE::send_colorsA_ret_colorsA(colorA:rcvd_evt.colorA); transform ret_colorB = TE::send_colorsB_ret_colorsB(colorB:rcvd_evt.colorB); if (ret_colorA == "a49") LOG::LogSuccess(message:"ENUM1: xform_ret_color == a49") ; else LOG::LogFailure(message:"ENUM1: xform_ret_color == a49") ; end if; if (ret_colorB == "redder") LOG::LogSuccess(message:"ENUM1: xform_ret_color == redder") ; else LOG::LogFailure(message:"ENUM1: xform_ret_color == redder") ; end if; // Test Bridges ca=ENUMTWO::send_colorsA_ret_colorsA(colorA:self.colorA); cb=ENUMTWO::send_colorsB_ret_colorsB(colorB:self.colorB); if (ca == "a49") LOG::LogSuccess(message:"ENUMTWO::send_colorsA_ret_colorsA(colorA:self.colorA") ; else LOG::LogFailure(message:"ENUMTWO::send_colorsA_ret_colorsA(colorA:self.colorA") ; end if; if (cb == "redder") LOG::LogSuccess(message:"ENUMTWO::send_colorsB_ret_colorsB(colorB:self.colorB") ; else LOG::LogFailure(message:"ENUMTWO::send_colorsB_ret_colorsB(colorB:self.colorB") ; end if; generate TE2:''finish''(colorA:"a49",colorB:"redder") to self; ', ''); INSERT INTO SM_MOAH VALUES (4194306, 4194312, 4194306); INSERT INTO SM_AH VALUES (4194306, 4194312); INSERT INTO SM_ACT VALUES (4194306, 4194312, 1, 'DR::checkin(id:10); ', ''); INSERT INTO SM_MOAH VALUES (4194307, 4194312, 4194307); INSERT INTO SM_AH VALUES (4194307, 4194312); INSERT INTO SM_ACT VALUES (4194307, 4194312, 1, 'ARCH::shutdown();', ''); INSERT INTO GD_MD VALUES (4194305, 8, 4194312, 40, 1, 0, 1, 1, 0, 12, 1600, 4200, 1.000000, 0); INSERT INTO GD_GE VALUES (4194306, 4194305, 4194305, 41); INSERT INTO GD_SHP VALUES (4194306, 1760, 1312, 2144, 1424); INSERT INTO GD_GE VALUES (4194307, 4194305, 4194306, 41); INSERT INTO GD_SHP VALUES (4194307, 1760, 1504, 2144, 1584); INSERT INTO GD_GE VALUES (4194308, 4194305, 4194307, 41); INSERT INTO GD_SHP VALUES (4194308, 1760, 1664, 2144, 1744); INSERT INTO GD_GE VALUES (4194309, 4194305, 4194305, 42); INSERT INTO GD_CON VALUES (4194309, 4194306, 4194307, 0); INSERT INTO GD_CTXT VALUES (4194309, 0, 0, 0, 0, 0, 0, 1904, 1446, 2158, 1478, 0, -3, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (4194310, 4194309, 1920, 1424, 1920, 1504, 0); INSERT INTO GD_GE VALUES (4194311, 4194305, 4194306, 42); INSERT INTO GD_CON VALUES (4194311, 4194307, 4194308, 0); INSERT INTO GD_CTXT VALUES (4194311, 0, 0, 0, 0, 0, 0, 1959, 1604, 2127, 1648, 39, -5, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (4194312, 4194311, 1936, 1584, 1936, 1664, 0); INSERT INTO GD_GE VALUES (4194313, 4194305, 4194307, 42); INSERT INTO GD_CON VALUES (4194313, 4194306, 4194306, 0); INSERT INTO GD_CTXT VALUES (4194313, 0, 0, 0, 0, 0, 0, 1904, 1217, 2166, 1262, -7, -22, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (4194314, 4194313, 1808, 1312, 1808, 1264, 0); INSERT INTO GD_LS VALUES (4194315, 4194313, 1808, 1264, 2064, 1264, 4194314); INSERT INTO GD_LS VALUES (4194316, 4194313, 2064, 1264, 2064, 1312, 4194315); INSERT INTO SM_ASM VALUES (4718601, 7340038); INSERT INTO SM_SM VALUES (4718601, '', 9); INSERT INTO SM_MOORE VALUES (4718601); INSERT INTO SM_EVTDI VALUES (4718593, 4718601, 'colorA', '', 524305); INSERT INTO SM_EVTDI VALUES (4718594, 4718601, 'colorB', '', 524306); INSERT INTO SM_SUPDT VALUES (4718593, 4718601, 0); INSERT INTO SM_SDI VALUES (4718594, 4718593, 4718601); INSERT INTO SM_SDI VALUES (4718593, 4718593, 4718601); INSERT INTO SM_SUPDT VALUES (4718594, 4718601, 0); INSERT INTO SM_STATE VALUES (4718593, 4718601, 4718593, 'start', 1, 0); INSERT INTO SM_LEVT VALUES (4718593, 4718601, 4718593); INSERT INTO SM_SEVT VALUES (4718593, 4718601, 4718593); INSERT INTO SM_EVT VALUES (4718593, 4718601, 4718593, 1, 'start', 0, '', 'TE_A1', ''); INSERT INTO SM_SEME VALUES (4718593, 4718593, 4718601, 4718593); INSERT INTO SM_LEVT VALUES (4718594, 4718601, 4718594); INSERT INTO SM_SEVT VALUES (4718594, 4718601, 4718594); INSERT INTO SM_EVT VALUES (4718594, 4718601, 4718594, 2, 'finish', 0, '', 'TE_A2', ''); INSERT INTO SM_SEME VALUES (4718593, 4718594, 4718601, 4718594); INSERT INTO SM_STATE VALUES (4718594, 4718601, 4718594, 'finish', 2, 0); INSERT INTO SM_CH VALUES (4718594, 4718593, 4718601, 4718593, ''); INSERT INTO SM_SEME VALUES (4718594, 4718593, 4718601, 4718593); INSERT INTO SM_CH VALUES (4718594, 4718594, 4718601, 4718594, ''); INSERT INTO SM_SEME VALUES (4718594, 4718594, 4718601, 4718594); INSERT INTO SM_NSTXN VALUES (4718593, 4718601, 4718593, 4718593, 4718593); INSERT INTO SM_TXN VALUES (4718593, 4718601, 4718593, 4718593); INSERT INTO SM_NSTXN VALUES (4718594, 4718601, 4718593, 4718594, 4718594); INSERT INTO SM_TXN VALUES (4718594, 4718601, 4718594, 4718594); INSERT INTO SM_MOAH VALUES (4718593, 4718601, 4718593); INSERT INTO SM_AH VALUES (4718593, 4718601); INSERT INTO SM_ACT VALUES (4718593, 4718601, 1, '// The following exercise all valid uses of enums in the AL // object attribute // event supp data item // bridge operation argument // bridge return value // transformer argument // transform return value // comparison ==, != // assignment to local variable select any te from instances of TE; assign te.colorA = "a49"; assign te.colorB = "redder"; // test in attribute and event data if (te.colorA == rcvd_evt.colorA) LOG::LogSuccess(message:"ENUM1: te.enumA == rcvd_evt.enumA") ; else LOG::LogFailure(message:"ENUM1: te.enumA == rcvd_evt.enumA") ; end if; if (te.colorB == rcvd_evt.colorB) LOG::LogSuccess(message:"ENUM1: te.enumB == rcvd_evt.enum") ; else LOG::LogFailure(message:"ENUM1: te.enumB == rcvd_evt.enum") ; end if; // test local variable assign local_colorA = te.colorA; assign local_colorB = te.colorB; if (local_colorA == rcvd_evt.colorA) LOG::LogSuccess(message:"ENUM1: local_colorA == rcvd_evt.enumA") ; else LOG::LogFailure(message:"ENUM1: local_colorA == rcvd_evt.enumA") ; end if; if (local_colorB == rcvd_evt.colorB) LOG::LogSuccess(message:"ENUM1: local_colorB == rcvd_evt.enumB") ; else LOG::LogFailure(message:"ENUM1: local_colorB == rcvd_evt.enumB") ; end if; // check inequality if (local_colorA != "foocolor") LOG::LogSuccess(message:"ENUM1: local_colorA != operator") ; else LOG::LogFailure(message:"ENUM1: local_colorA != operator") ; end if; // Test transforms with enums transform ret_colorA = TE::send_colorsA_ret_colorsA(colorA:rcvd_evt.colorA); transform ret_colorB = TE::send_colorsB_ret_colorsB(colorB:rcvd_evt.colorB); if (ret_colorA == "a49") LOG::LogSuccess(message:"ENUM1: xform_ret_color == a49") ; else LOG::LogFailure(message:"ENUM1: xform_ret_color == a49") ; end if; if (ret_colorB == "redder") LOG::LogSuccess(message:"ENUM1: xform_ret_color == redder") ; else LOG::LogFailure(message:"ENUM1: xform_ret_color == redder") ; end if; // Test Bridges ca=ENUMTWO::send_colorsA_ret_colorsA(colorA:te.colorA); cb=ENUMTWO::send_colorsB_ret_colorsB(colorB:te.colorB); if (ca == "a49") LOG::LogSuccess(message:"ENUMTWO::send_colorsA_ret_colorsA(colorA:te.colorA") ; else LOG::LogFailure(message:"ENUMTWO::send_colorsA_ret_colorsA(colorA:te.colorA") ; end if; if (cb == "redder") LOG::LogSuccess(message:"ENUMTWO::send_colorsB_ret_colorsB(colorB:te.colorB") ; else LOG::LogFailure(message:"ENUMTWO::send_colorsB_ret_colorsB(colorB:te.colorB") ; end if; DR::checkin(id:10); ', ''); INSERT INTO SM_MOAH VALUES (4718594, 4718601, 4718594); INSERT INTO SM_AH VALUES (4718594, 4718601); INSERT INTO SM_ACT VALUES (4718594, 4718601, 1, '//idle', ''); INSERT INTO GD_MD VALUES (4718593, 10, 4718601, 40, 1, 0, 1, 1, 0, 12, 1600, 4200, 1.000000, 0); INSERT INTO GD_GE VALUES (4718594, 4718593, 4718593, 41); INSERT INTO GD_SHP VALUES (4718594, 1700, 1270, 2084, 1494); INSERT INTO GD_GE VALUES (4718595, 4718593, 4718594, 41); INSERT INTO GD_SHP VALUES (4718595, 1700, 1558, 2084, 1638); INSERT INTO GD_GE VALUES (4718596, 4718593, 4718594, 42); INSERT INTO GD_CON VALUES (4718596, 4718594, 4718595, 0); INSERT INTO GD_CTXT VALUES (4718596, 0, 0, 0, 0, 0, 0, 1875, 1509, 2129, 1541, 31, -2, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (4718597, 4718596, 1860, 1494, 1860, 1558, 0); INSERT INTO GD_GE VALUES (4718598, 4718593, 4718593, 42); INSERT INTO GD_CON VALUES (4718598, 4718594, 4718594, 0); INSERT INTO GD_CTXT VALUES (4718598, 0, 0, 0, 0, 0, 0, 1842, 1159, 2125, 1204, -5, -16, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (4718599, 4718598, 1744, 1270, 1744, 1200, 0); INSERT INTO GD_LS VALUES (4718600, 4718598, 1744, 1200, 2000, 1200, 4718599); INSERT INTO GD_LS VALUES (4718601, 4718598, 2000, 1200, 2000, 1270, 4718600); INSERT INTO CA_ACC VALUES (4194306, 7340046, 4194312, 0); INSERT INTO CA_SMOA VALUES (4194306, 7340038, 0); INSERT INTO CA_SMOAA VALUES (4194306, 7340051, 7340038); INSERT INTO CA_SMOAA VALUES (4194306, 7340052, 7340038); INSERT INTO CA_ACC VALUES (4718594, 7340046, 4718601, 0); INSERT INTO CA_SMOA VALUES (4718594, 7340038, 0); INSERT INTO CA_SMOAA VALUES (4718594, 7340052, 7340038); INSERT INTO CA_SMOAA VALUES (4718594, 7340051, 7340038); INSERT INTO GD_MD VALUES (7340084, 5, 7340046, 11, 1, 0, 1, 1, 0, 12, 1658, 4573, 1.750668, 0); INSERT INTO GD_GE VALUES (7340087, 7340084, 7340038, 21); INSERT INTO GD_SHP VALUES (7340087, 1680, 1136, 2096, 1360); INSERT INTO GD_MD VALUES (7340085, 6, 7340046, 11, 1, 0, 1, 1, 0, 12, 1600, 4200, 1.000000, 0); INSERT INTO GD_GE VALUES (7340088, 7340085, 7340038, 21); INSERT INTO GD_SHP VALUES (7340088, 1744, 1296, 1936, 1360); INSERT INTO GD_GE VALUES (7340089, 7340085, 4718601, 40); INSERT INTO GD_SHP VALUES (7340089, 1904, 1324, 2096, 1388); INSERT INTO GD_MD VALUES (7340086, 7, 7340046, 11, 1, 0, 1, 1, 0, 12, 1600, 4200, 1.000000, 0); INSERT INTO GD_GE VALUES (7340090, 7340086, 7340038, 21); INSERT INTO GD_SHP VALUES (7340090, 1744, 1296, 1936, 1360); INSERT INTO GD_GE VALUES (7340091, 7340086, 4718601, 40); INSERT INTO GD_SHP VALUES (7340091, 1904, 1324, 2096, 1388);
13.692308
129
0.637589
e9c1658df6b9554ffebf7a9a8e0772054656ca1c
2,770
dart
Dart
LibTest/html/IFrameElement/querySelector_A01_t01.dart
athomas/co19
b1eff14f2c555cf87e6ff47dc62ec4081b9f69e5
[ "BSD-Source-Code" ]
null
null
null
LibTest/html/IFrameElement/querySelector_A01_t01.dart
athomas/co19
b1eff14f2c555cf87e6ff47dc62ec4081b9f69e5
[ "BSD-Source-Code" ]
null
null
null
LibTest/html/IFrameElement/querySelector_A01_t01.dart
athomas/co19
b1eff14f2c555cf87e6ff47dc62ec4081b9f69e5
[ "BSD-Source-Code" ]
null
null
null
/* * Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file * for details. All rights reserved. Use of this source code is governed by a * BSD-style license that can be found in the LICENSE file. */ /** * @assertion Element querySelector(String selectors) * Finds the first descendant element of this element that matches the * specified group of selectors. * * selectors should be a string using CSS selector syntax. * @description Checks that for IframeElement all queries return null * @issue #17456: all queries return null */ // OtherResources=iframe.html import "dart:html"; import "../../../Utils/expect.dart"; import "../testcommon.dart"; main() { IFrameElement e = Element.html( '<iframe src="iframe.html"></iframe>', treeSanitizer: new NullTreeSanitizer()) as IFrameElement; document.body?.append(e); Expect.isNull(e.querySelector('*'), 'Universal selector'); Expect.isNull(e.querySelector('pre'), 'Type selector'); Expect.isNull(e.querySelector('table'), 'Type selector, negative'); Expect.isNull(e.querySelector('span pre'), 'Descendant selector, direct'); Expect.isNull(e.querySelector('div pre'), 'Descendant selector, indirect'); Expect.isNull(e.querySelector('* pre'), 'Descendant selector, any'); Expect.isNull(e.querySelector('span > pre'), 'Child selector'); Expect.isNull(e.querySelector('div > pre'), 'Child selector, negative'); Expect.isNull( e.querySelector('pre:first-child'), 'The :first-child pseudo-class'); Expect.isNull(e.querySelector('pre:lang(en)'), 'The :lang() pseudo-class'); Expect.isNull(e.querySelector('pre:lang(fr)'), 'The :lang() pseudo-class'); Expect.isNull(e.querySelector('hr + pre'), 'Adjacent selector'); Expect.isNull(e.querySelector('div + pre'), 'Adjacent selector, negative'); Expect.isNull(e.querySelector('pre[id]'), 'Attribute selector 1'); Expect.isNull(e.querySelector('pre[foo]'), 'Attribute selector 1, negative'); Expect.isNull(e.querySelector('pre[id="myid"]'), 'Attribute selector 2'); Expect.isNull( e.querySelector('pre[id="myid2"]'), 'Attribute selector 2, negative'); Expect.isNull(e.querySelector('pre[class~="bar"]'), 'Attribute selector 3'); Expect.isNull( e.querySelector('pre[class~="baz"]'), 'Attribute selector 3, negative'); Expect.isNull(e.querySelector('pre[lang|="en"]'), 'Attribute selector 4'); Expect.isNull( e.querySelector('pre[lang|="fr"]'), 'Attribute selector 4, negative'); Expect.isNull(e.querySelector('pre.foo'), 'Class selector'); Expect.isNull(e.querySelector('pre.baz'), 'Class selector, negative'); Expect.isNull(e.querySelector('pre#myid'), 'Id selector'); Expect.isNull(e.querySelector('pre#baz'), 'Id selector, negative'); }
34.197531
79
0.699278
afe2c81b672d96f55eda296808b9cdb4fa0065ab
787
html
HTML
src/pages/about/about.html
xchopin/augmented-reality-ionic
7f4004f0aa8c67204d777c28d948729f226401b4
[ "MIT" ]
5
2017-05-08T04:54:43.000Z
2021-09-06T08:52:38.000Z
src/pages/about/about.html
xchopin/augmented-reality-ionic
7f4004f0aa8c67204d777c28d948729f226401b4
[ "MIT" ]
1
2017-12-05T08:34:13.000Z
2017-12-05T08:34:31.000Z
src/pages/about/about.html
xchopin/augmented-reality-ionic
7f4004f0aa8c67204d777c28d948729f226401b4
[ "MIT" ]
3
2017-04-06T22:27:01.000Z
2017-12-05T08:05:41.000Z
<ion-header> <ion-navbar> <ion-title> About </ion-title> </ion-navbar> </ion-header> <ion-content> <ion-list> <ion-list-header>Xavier CHOPIN</ion-list-header> <ion-item> <ion-icon name="mail" item-left></ion-icon> <a href="mailto:bonjour@xavierchop.in">bonjour@xavierchop.in</a> </ion-item> <ion-item> <ion-icon name="ionic" item-left></ion-icon> <a href="https://xavierchop.in">xavierchop.in</a> </ion-item> <ion-item> <ion-icon name="git-branch" item-left></ion-icon> <a href="https://github.com/xchopin">github.com/xchopin</a> </ion-item> </ion-list> <div padding> This Ionic application was developed for the final year of a Bachelor's Degree in Computer Science. </div> </ion-content>
25.387097
103
0.622618
dda2e0d5feaeae33091d286a782bbf84458256cb
3,124
php
PHP
pages/companies/overview/CDividends.php
chainrepublik/web
d87f20585ae24d1468e2c72d44aaea02c1d42333
[ "MIT" ]
null
null
null
pages/companies/overview/CDividends.php
chainrepublik/web
d87f20585ae24d1468e2c72d44aaea02c1d42333
[ "MIT" ]
1
2018-04-12T10:40:18.000Z
2018-04-12T10:40:18.000Z
pages/companies/overview/CDividends.php
chainrepublik/web
d87f20585ae24d1468e2c72d44aaea02c1d42333
[ "MIT" ]
2
2018-10-23T10:54:20.000Z
2020-07-21T08:28:00.000Z
<?php class CDividends { function CDividends($db, $template) { $this->kern=$db; $this->template=$template; } function showShareHolders() { // Load company data $row=$this->kern->getRows("SELECT * FROM companies WHERE comID=?", "i", $_REQUEST['ID']); // Symbol $sym=$row['symbol']; // Load shareholders $result=$this->kern->getResult("SELECT * FROM assets_owners AS ao JOIN adr ON adr.adr=ao.owner JOIN countries AS cou ON cou.code=adr.cou WHERE ao.symbol=? ORDER BY ao.qty DESC LIMIT 0,25", "s", $sym); // Has data ? if (mysqli_num_rows($result)==0) { print "<br><span class='font_14'>No results found</span>"; return false; } // Show bar $this->template->showTopBar("Owner", "40%", "Qty", "15%", "Percent", "15%"); ?> <table width="550px"> <?php while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { ?> <tr> <td width="9%"> <img src=" <?php if ($row['pic']=="") print "../../template/GIF/empty_pic.png"; else print $this->kern->crop($row['pic']); ?> " width="41" height="41" class="img-circle" /> </td> <td width="37%" class="font_14" align="left"><?php print $row['name']."<br><span class='font_10'>Country : ".$this->kern->formatCou($row['country'])."</span>"; ?></td> <td width="16%" class="font_14" align="center"><?php print $row['qty']; ?></td> <td width="19%" class="font_14" align="center"><?php print round($row['qty']*100/10000, 2)."%"; ?></td> </tr> <tr><td colspan="4"><br></td></tr> <?php } ?> </table> <?php } function showDividends() { // Top bar $this->template->showTopBar("Date", "80%", "Amount", "20%"); // Query $query="SELECT * FROM dividends WHERE comID=? ORDER BY ID DESC LIMIT 0,25"; // Result $result=$this->kern->execute($query, "i", $_REQUEST['ID']); ?> <table width="540" border="0" cellspacing="0" cellpadding="0"> <tbody> <?php while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { ?> <tr> <td class="font_14" width="80%"><?php print $this->kern->timeFromBlock($row['block'])." ago<br><span class='font_10'>Block ".$row['block']."</span>"; ?></td> <td class="font_14" style="color: #009900" width="20%" align="center"><?php print round($row['amount'], 4)." CRC"; ?></td> </tr> <tr> <td colspan="2"><hr></td> </tr> <?php } ?> </tbody> </table> <?php } } ?>
24.40625
175
0.441421
83fc0c06e67eb8b544c99e1649b870e332202116
1,812
java
Java
src/org/javaturk/oopj/ch03/references/car/CarReferences.java
javaturk/OOPJ
3e7129a58fd79e1d9a826b86518547dae2999b9e
[ "MIT" ]
50
2021-01-27T12:36:11.000Z
2022-03-30T08:59:04.000Z
src/org/javaturk/oopj/ch03/references/car/CarReferences.java
Seymanur-evn/OOPJ
3e7129a58fd79e1d9a826b86518547dae2999b9e
[ "MIT" ]
null
null
null
src/org/javaturk/oopj/ch03/references/car/CarReferences.java
Seymanur-evn/OOPJ
3e7129a58fd79e1d9a826b86518547dae2999b9e
[ "MIT" ]
26
2021-02-04T16:47:25.000Z
2022-03-26T20:27:03.000Z
package org.javaturk.oopj.ch03.references.car; /** * @author <a href="mailto:akin@javaturk.org">Akin Kaldiroglu</a> * <p> * Daha cok bilgi icin lutfen aşağıdaki linkleri ziyaret edin. * @see <a href="http://www.javaturk.org">http://www.javaturk.org</a> * @see <a href="http://www.selsoft.com.tr">http://www.selsoft.com.tr</a> * </p> */ public class CarReferences { public static void main(String[] args) { Car car1 = new Car(); car1.make = "Mercedes"; car1.model = "C200"; car1.year = "2015"; car1.distance = 0; car1.speed = 0; System.out.println("car1: " + car1.getInfo()); Car car2 = new Car(); car2.make = "BMW"; car2.model = "i8"; car2.year = "2016"; car2.distance = 10_000; car2.speed = 160; System.out.println("car2: " + car2.getInfo()); Car tmpCar = car1; car1 = car2; car2 = tmpCar; System.out.println("\ncar1: " + car1.getInfo()); System.out.println("car2: " + car2.getInfo()); System.out.println("tmpCar: " + tmpCar.getInfo()); car2.accelerate(180); car2.go(25); System.out.println("\ncar2: " + car2.getInfo()); System.out.println("tmpCar: " + tmpCar.getInfo()); tmpCar.go(50); tmpCar.stop(); System.out.println("\ncar2: " + car2.getInfo()); System.out.println("tmpCar: " + tmpCar.getInfo()); car1 = null; // car1.accelerate(150); // car1.go(50); // if(car1 != null) // System.out.println("\ncar1: " + car1.getInfo()); // else // System.out.println("It is a null reference!"); tmpCar.accelerate(150); tmpCar.go(50); car1 = null; // car1.accelerate(150); // car1.go(50); System.out.println("tmpCar: " + tmpCar.getInfo()); tmpCar = new Car(); tmpCar.go(100); tmpCar.accelerate(80); System.out.println("tmpCar: " + tmpCar.getInfo()); } }
24.486486
73
0.603753
bb9e98d7bfb5275ec99328b6096c10219a1f06eb
329
lua
Lua
helper/except_spec.lua
eisfeuer/modutram
4aaedb2fbb2d1d519c7a9a0f34e29a3f58cebfeb
[ "MIT" ]
null
null
null
helper/except_spec.lua
eisfeuer/modutram
4aaedb2fbb2d1d519c7a9a0f34e29a3f58cebfeb
[ "MIT" ]
null
null
null
helper/except_spec.lua
eisfeuer/modutram
4aaedb2fbb2d1d519c7a9a0f34e29a3f58cebfeb
[ "MIT" ]
null
null
null
local except = require('modutram.helper.except') describe('except', function () it ('excludes given values from array', function () local array = {1, 2, 3, 4, 5} local result = except(array, {2, 5}) assert.are.same({1, 3, 4}, result) assert.are_not.equal(array, result) end) end)
32.9
56
0.589666
f03601bf8a196e78db8410bbcc96a4e6ea54db46
76
js
JavaScript
src/components/about/index.js
jaggerwang/zqc-app-demo
b00393f5005496cbbae92769d88bbfb146e8e7dc
[ "MIT" ]
230
2016-10-31T12:04:51.000Z
2020-09-17T02:34:49.000Z
src/components/about/index.js
jaggerwang/zqc-app-demo
b00393f5005496cbbae92769d88bbfb146e8e7dc
[ "MIT" ]
20
2016-11-27T03:17:57.000Z
2018-11-02T09:09:04.000Z
src/components/about/index.js
jaggerwang/zqc-app-demo
b00393f5005496cbbae92769d88bbfb146e8e7dc
[ "MIT" ]
78
2016-10-31T12:04:55.000Z
2021-08-05T21:08:30.000Z
/** * 在球场 * zaiqiuchang.com */ export {default as About} from './About'
10.857143
40
0.605263
8750cb819391e3d0d6ecdfe7ba1e7ad14c0fc696
1,069
html
HTML
manuscript/page-635/body.html
marvindanig/handwork-in-wood
990a17065344a28c5dbd0042ffddd75475102599
[ "BlueOak-1.0.0", "CC-BY-4.0", "Unlicense" ]
null
null
null
manuscript/page-635/body.html
marvindanig/handwork-in-wood
990a17065344a28c5dbd0042ffddd75475102599
[ "BlueOak-1.0.0", "CC-BY-4.0", "Unlicense" ]
null
null
null
manuscript/page-635/body.html
marvindanig/handwork-in-wood
990a17065344a28c5dbd0042ffddd75475102599
[ "BlueOak-1.0.0", "CC-BY-4.0", "Unlicense" ]
null
null
null
<div class="leaf flex"><div class="inner justify"><p class="no-indent ">said to be practically inexhaustible.</p><p class=" stretch-last-line ">As to the manufacture of the Copal varnishes: first of all, a high grade oil is boiled at a high temperature, with different materials to oxidize it; for instance, red lead or oxide of manganese. The heat throws off the oxygen from the red lead or manganese. The oxygen is absorbed by the linseed oil, which is then put away to settle and age. When a batch of varnish is made, the gums are melted in a large kettle and then the requisite amount of oil is added and these carefully boiled together. This is removed from the fire and cooled down to a point, where turpentine can be added without volatilizing. These are thoroly mixed and then filtered under pressure and tanked and aged. The different grades of varnish depend upon the treatment of the oil, the proportion of oil and turpentine, the qualities of the gums, the aging, etc. Some by rubbing give a very high polish, some give a dull waxy finish,</p></div> </div>
1,069
1,069
0.779233
6b4b34530bf7ee43ebce1ebce88cfa91efa892ac
1,390
sql
SQL
sql/oci360_1e_images.sql
aexposit/oci360
6058b2d372656a37d07779a2ceb6bfde3e9ea216
[ "Apache-2.0", "MIT" ]
1
2020-08-29T06:10:16.000Z
2020-08-29T06:10:16.000Z
sql/oci360_1e_images.sql
maxsad1/oci360
5266df4aa4ace235c59da5b6afe7137bfc4f5bf4
[ "Apache-2.0", "MIT" ]
null
null
null
sql/oci360_1e_images.sql
maxsad1/oci360
5266df4aa4ace235c59da5b6afe7137bfc4f5bf4
[ "Apache-2.0", "MIT" ]
null
null
null
----------------------------------------- -- Tables Used in this Section ----------------------------------------- @@&&fc_json_loader. 'OCI360_IMAGES' @@&&fc_json_loader. 'OCI360_INSTANCES' ----------------------------------------- DEF title = 'Images' DEF main_table = 'OCI360_IMAGES' BEGIN :sql_text := q'{ SELECT ID, LAUNCH_MODE, SIZE_IN_MBS, DISPLAY_NAME, TIME_CREATED, BASE_IMAGE_ID, AGENT_FEATURES, COMPARTMENT_ID, LAUNCH_OPTIONS$FIRMWARE, LAUNCH_OPTIONS$NETWORK_TYPE, LAUNCH_OPTIONS$BOOT_VOLUME_TYPE, LAUNCH_OPTIONS$REMOTE_DATA_VOLUME_TYPE, LAUNCH_OPTIONS$IS_CONSISTENT_VOLUME_NAMING_ENABLED, LAUNCH_OPTIONS$IS_PV_ENCRYPTION_IN_TRANSIT_ENABLED, LIFECYCLE_STATE, OPERATING_SYSTEM, CREATE_IMAGE_ALLOWED, OPERATING_SYSTEM_VERSION FROM OCI360_IMAGES }'; END; / @@&&9a_pre_one. ----------------------------------------- DEF title = 'Compute Instances per Image' DEF main_table = 'OCI360_IMAGES' BEGIN :sql_text := q'{ WITH t1 as (select /*+ materialize */ * from OCI360_INSTANCES), t2 as (select /*+ materialize */ * from OCI360_IMAGES) SELECT t2.id, t2.display_name, count(*) total FROM t1, t2 WHERE t1.image_id=t2.id GROUP BY t2.id, t2.display_name ORDER BY 3 DESC }'; END; / @@&&9a_pre_one. -----------------------------------------
23.965517
63
0.584892
80f28515f00f0aeb660a64ccc0d8bd4ae007555d
26
sql
SQL
scripts/db/mysql/migrations/000002_poll_option_table.down.sql
sharmarajdaksh/yorpoll-api
07d50f260a645b0a477989576312a3367f787382
[ "MIT" ]
null
null
null
scripts/db/mysql/migrations/000002_poll_option_table.down.sql
sharmarajdaksh/yorpoll-api
07d50f260a645b0a477989576312a3367f787382
[ "MIT" ]
null
null
null
scripts/db/mysql/migrations/000002_poll_option_table.down.sql
sharmarajdaksh/yorpoll-api
07d50f260a645b0a477989576312a3367f787382
[ "MIT" ]
null
null
null
DROP TABLE `poll_option`;
13
25
0.769231
8813d90b56bab481f72bf0d19c61816d3f939210
4,399
cpp
C++
mainwindow.cpp
tonymadkins/Voronoi
c6de82ebea85f5f160eeb87c9ddb502f8c33f07b
[ "BSD-3-Clause" ]
1
2019-02-06T04:04:20.000Z
2019-02-06T04:04:20.000Z
mainwindow.cpp
tonymadkins/Voronoi
c6de82ebea85f5f160eeb87c9ddb502f8c33f07b
[ "BSD-3-Clause" ]
null
null
null
mainwindow.cpp
tonymadkins/Voronoi
c6de82ebea85f5f160eeb87c9ddb502f8c33f07b
[ "BSD-3-Clause" ]
null
null
null
#include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); ui->tesselationOneSlider->setValue(30); ui->tesselationTwoSlider->setValue(30); ui->splitDepthLabel->setText(QString::number(ui->splitDepthSlider->value())); exitDestruct(); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_destructButton_clicked() { ui->openGLWidget->destructObj(ui->splitDepthSlider->value()); enterDestruct(); } void MainWindow::on_resetButton_clicked() { ui->openGLWidget->reset(); exitDestruct(); } void MainWindow::on_advanceSplitButton_clicked() { ui->openGLWidget->advanceSplitIncr(); } void MainWindow::keyPressEvent(QKeyEvent *e) { if (e->key() == Qt::Key_E) { ui->openGLWidget->zoom(1); } else if (e->key() == Qt::Key_Q) { ui->openGLWidget->zoom(-1); } else if (e->key() == Qt::Key_D) { ui->openGLWidget->pan(-1,0); } else if (e->key() == Qt::Key_A) { ui->openGLWidget->pan(1,0); } else if (e->key() == Qt::Key_W) { ui->openGLWidget->pan(0,-1); } else if (e->key() == Qt::Key_S) { ui->openGLWidget->pan(0,1); } } void MainWindow::on_unpauseSplitButton_clicked() { m_splitPaused = !m_splitPaused; if (m_splitPaused) { ui->unpauseSplitButton->setText("Resume Split"); } else { ui->unpauseSplitButton->setText("Pause Split"); } ui->unpauseJoinButton->setText("Resume Join"); m_joinPaused = true; ui->openGLWidget->pauseResumeJoin(m_joinPaused); ui->openGLWidget->pauseResumeSplit(m_splitPaused); } void MainWindow::on_advanceJoinButton_clicked() { ui->openGLWidget->advanceJoinIncr(); } void MainWindow::on_unpauseJoinButton_clicked() { m_joinPaused = !m_joinPaused; if (m_joinPaused) { ui->unpauseJoinButton->setText("Resume Join"); } else { ui->unpauseJoinButton->setText("Pause Join"); } ui->unpauseSplitButton->setText("Resume Split"); m_splitPaused = true; ui->openGLWidget->pauseResumeSplit(m_splitPaused); ui->openGLWidget->pauseResumeJoin(m_joinPaused); } void MainWindow::on_tesselationTwoSlider_valueChanged(int val) { ui->openGLWidget->sliderChanged(false, val); exitDestruct(); } void MainWindow::on_splitDepthSlider_valueChanged(int val) { ui->splitDepthLabel->setText(QString::number(ui->splitDepthSlider->value())); } void MainWindow::on_renderLinesButton_clicked() { m_linesRender = !m_linesRender; ui->openGLWidget->triggerRenderLines(m_linesRender); if (m_linesRender) { ui->renderLinesButton->setText("Turn Lines Off"); } else { ui->renderLinesButton->setText("Turn Lines On"); } } void MainWindow::enterDestruct() { ui->destructButton->setEnabled(false); ui->advanceSplitButton->setEnabled(true); ui->unpauseSplitButton->setEnabled(true); ui->splitDepthSlider->setEnabled(false); ui->unpauseJoinButton->setEnabled(true); ui->advanceJoinButton->setEnabled(true); } void MainWindow::exitDestruct() { ui->destructButton->setEnabled(true); ui->advanceSplitButton->setEnabled(false); ui->unpauseSplitButton->setEnabled(false); ui->splitDepthSlider->setEnabled(true); ui->unpauseJoinButton->setEnabled(false); ui->advanceJoinButton->setEnabled(false); m_joinPaused = true; m_splitPaused = true; ui->unpauseJoinButton->setText("Resume Join"); ui->unpauseSplitButton->setText("Resume Split"); ui->openGLWidget->pauseResumeSplit(m_splitPaused); ui->openGLWidget->pauseResumeJoin(m_joinPaused); } void MainWindow::on_tesselationOneSlider_valueChanged(int val) { ui->openGLWidget->sliderChanged(true, val); exitDestruct(); } void MainWindow::on_cylinderSelect_clicked() { ui->openGLWidget->changeShapeType(MainWidget::ShapeType::CylinderType); exitDestruct(); } void MainWindow::on_cubeSelect_clicked() { ui->openGLWidget->changeShapeType(MainWidget::ShapeType::CubeType); exitDestruct(); } void MainWindow::on_sphereSelect_clicked() { ui->openGLWidget->changeShapeType(MainWidget::ShapeType::SphereType); exitDestruct(); } void MainWindow::on_coneSelect_clicked() { ui->openGLWidget->changeShapeType(MainWidget::ShapeType::ConeType); exitDestruct(); }
28.019108
81
0.687884
296f925ada73e2c86c8036481228bf59e944e9e6
6,814
go
Go
pkg/controller/controller_test.go
peizhouyu/external-attacher
c51ab62931cbba88b10d181de6cce95d007962b8
[ "Apache-2.0" ]
105
2017-10-24T17:03:25.000Z
2022-03-23T09:57:27.000Z
pkg/controller/controller_test.go
peizhouyu/external-attacher
c51ab62931cbba88b10d181de6cce95d007962b8
[ "Apache-2.0" ]
315
2017-12-12T20:03:27.000Z
2022-03-16T10:59:12.000Z
pkg/controller/controller_test.go
peizhouyu/external-attacher
c51ab62931cbba88b10d181de6cce95d007962b8
[ "Apache-2.0" ]
134
2017-10-26T13:05:16.000Z
2022-03-31T09:08:27.000Z
/* Copyright 2018 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 controller import ( "testing" v1 "k8s.io/api/core/v1" storage "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" csitrans "k8s.io/csi-translation-lib" ) func TestShouldEnqueueVAChange(t *testing.T) { va1 := &storage.VolumeAttachment{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", ResourceVersion: "1", }, Spec: storage.VolumeAttachmentSpec{ Attacher: "1", }, Status: storage.VolumeAttachmentStatus{ Attached: false, }, } va1WithAttachError := va1.DeepCopy() va1.Status.AttachError = &storage.VolumeError{ Message: "mock error1", Time: metav1.Time{}, } va1WithDetachError := va1.DeepCopy() va1.Status.DetachError = &storage.VolumeError{ Message: "mock error1", Time: metav1.Time{}, } va2ChangedSpec := va1.DeepCopy() va2ChangedSpec.ResourceVersion = "2" va2ChangedSpec.Spec.Attacher = "2" va2ChangedMetadata := va1.DeepCopy() va2ChangedMetadata.ResourceVersion = "2" va2ChangedMetadata.Annotations = map[string]string{"foo": "bar"} va2ChangedAttachError := va1.DeepCopy() va2ChangedAttachError.ResourceVersion = "2" va2ChangedAttachError.Status.AttachError = &storage.VolumeError{ Message: "mock error2", Time: metav1.Time{}, } va2ChangedDetachError := va1.DeepCopy() va2ChangedDetachError.ResourceVersion = "2" va2ChangedDetachError.Status.DetachError = &storage.VolumeError{ Message: "mock error2", Time: metav1.Time{}, } va2AppendManagedFields := va1.DeepCopy() va2AppendManagedFields.ResourceVersion = "2" va2AppendManagedFields.ManagedFields = append(va2AppendManagedFields.ManagedFields, metav1.ManagedFieldsEntry{ APIVersion: "storage.k8s.io/v1beta1", Manager: "csi-attacher", Operation: "Update", FieldsType: "FieldsV1", FieldsV1: &metav1.FieldsV1{ Raw: []byte(`{"f:metadata":{"f:annotations":{".":{},"f:csi.alpha.kubernetes.io/node-id":{}},"f:finalizers":{".":{},"v:\\\"external-attacher/csi-cdsplugin\\\"":{}}},"f:status":{"f:attached":{},"f:attachmentMetadata":{".":{},"f:devName":{},"f:serial":{}}}}`), }, }) tests := []struct { name string oldVA, newVA *storage.VolumeAttachment expectedResult bool }{ { name: "periodic sync", oldVA: va1, newVA: va1, expectedResult: true, }, { name: "changed spec", oldVA: va1, newVA: va2ChangedSpec, expectedResult: true, }, { name: "changed metadata", oldVA: va1, newVA: va2ChangedMetadata, expectedResult: true, }, { name: "added attachError", oldVA: va1, newVA: va2ChangedAttachError, expectedResult: false, }, { name: "added detachError", oldVA: va1, newVA: va2ChangedDetachError, expectedResult: false, }, { name: "changed attachError", oldVA: va1WithAttachError, newVA: va2ChangedAttachError, expectedResult: false, }, { name: "changed detachError", oldVA: va1WithDetachError, newVA: va2ChangedDetachError, expectedResult: false, }, { name: "appended managedFields", oldVA: va1, newVA: va2AppendManagedFields, expectedResult: false, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { result := shouldEnqueueVAChange(test.oldVA, test.newVA) if result != test.expectedResult { t.Errorf("Error: expected result %t, got %t", test.expectedResult, result) } }) } } func TestProcessFinalizers(t *testing.T) { type testcase struct { name string pv *v1.PersistentVolume expectedResult bool } c := &CSIAttachController{} c.translator = csitrans.New() c.attacherName = "pd.csi.storage.gke.io" time := metav1.Now() testcases := []testcase{ { name: "nothing interesting in the PV", pv: &v1.PersistentVolume{}, expectedResult: false, }, { name: "no deletion timestamp, has finalizer", pv: &v1.PersistentVolume{ ObjectMeta: metav1.ObjectMeta{ Finalizers: []string{"external-attacher/pd-csi-storage-gke-io"}, }, }, expectedResult: false, }, { name: "Has deletion timestamp, has finalizer", pv: &v1.PersistentVolume{ ObjectMeta: metav1.ObjectMeta{ DeletionTimestamp: &time, Finalizers: []string{"external-attacher/pd-csi-storage-gke-io"}, }, }, expectedResult: true, }, { name: "no deletion timestamp, has finalizer, migrated PV, no migrated-to annotation", pv: &v1.PersistentVolume{ ObjectMeta: metav1.ObjectMeta{ Finalizers: []string{"external-attacher/pd-csi-storage-gke-io"}, }, Spec: v1.PersistentVolumeSpec{ PersistentVolumeSource: v1.PersistentVolumeSource{ GCEPersistentDisk: &v1.GCEPersistentDiskVolumeSource{}, }, }, }, expectedResult: true, }, { name: "no deletion timestamp, has finalizer, migrated PV, no migrated-to annotation with random anno", pv: &v1.PersistentVolume{ ObjectMeta: metav1.ObjectMeta{ Finalizers: []string{"external-attacher/pd-csi-storage-gke-io"}, Annotations: map[string]string{"random": "random"}, }, Spec: v1.PersistentVolumeSpec{ PersistentVolumeSource: v1.PersistentVolumeSource{ GCEPersistentDisk: &v1.GCEPersistentDiskVolumeSource{}, }, }, }, expectedResult: true, }, { name: "no deletion timestamp, has finalizer, migrated PV, has migrated-to annotation", pv: &v1.PersistentVolume{ ObjectMeta: metav1.ObjectMeta{ Finalizers: []string{"external-attacher/pd-csi-storage-gke-io"}, Annotations: map[string]string{ "pv.kubernetes.io/migrated-to": "pd.csi.storage.gke.io", }, }, Spec: v1.PersistentVolumeSpec{ PersistentVolumeSource: v1.PersistentVolumeSource{ GCEPersistentDisk: &v1.GCEPersistentDiskVolumeSource{}, }, }, }, expectedResult: false, }, } for _, tc := range testcases { result := c.processFinalizers(tc.pv) if result != tc.expectedResult { t.Errorf("Error executing test %v: expected result %v, got %v", tc.name, tc.expectedResult, result) } } }
27.699187
261
0.65835