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
89e54e28f82f5a84de729ca634c71667c4122cf1
179
kt
Kotlin
kotlin-typescript/src/main/generated/typescript/UnparsedSourceText.kt
Recognized/kotlin-wrappers
f4af784cd6e65c2304d9d8e49e7f30a6383a755c
[ "Apache-2.0" ]
4
2022-01-16T13:30:56.000Z
2022-03-25T23:29:38.000Z
typescript-kotlin/src/main/kotlin/typescript/UnparsedSourceText.kt
karakum-team/react-types-kotlin
940a93bb5b3093184916c9c39fbd530eb444be15
[ "Apache-2.0" ]
null
null
null
typescript-kotlin/src/main/kotlin/typescript/UnparsedSourceText.kt
karakum-team/react-types-kotlin
940a93bb5b3093184916c9c39fbd530eb444be15
[ "Apache-2.0" ]
2
2022-01-25T23:46:40.000Z
2022-03-25T09:11:51.000Z
// Automatically generated - do not modify! package typescript sealed external interface UnparsedSourceText : Union.UnparsedSourceText_ /* UnparsedPrepend | UnparsedTextLike */
29.833333
113
0.815642
c249394473090ba857fb54b9a293188b08b694aa
2,981
go
Go
gateways/server/resource/validate.go
jannfis/argo-events
099404392d9019b7efbae4ff8e15b37acd65d1d1
[ "Apache-2.0" ]
1
2020-11-23T05:37:43.000Z
2020-11-23T05:37:43.000Z
gateways/server/resource/validate.go
jannfis/argo-events
099404392d9019b7efbae4ff8e15b37acd65d1d1
[ "Apache-2.0" ]
8
2020-09-23T06:18:33.000Z
2020-09-28T11:49:34.000Z
gateways/server/resource/validate.go
valery-zhurbenko/argo-events
7c8e19b3c36943f64f71b8bbbf1b3e41eaa20412
[ "Apache-2.0" ]
1
2020-11-23T05:38:15.000Z
2020-11-23T05:38:15.000Z
/* Copyright 2018 BlackRock, Inc. 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 resource import ( "context" "fmt" "github.com/argoproj/argo-events/common" "github.com/argoproj/argo-events/gateways" apicommon "github.com/argoproj/argo-events/pkg/apis/common" "github.com/argoproj/argo-events/pkg/apis/eventsources/v1alpha1" "github.com/ghodss/yaml" "k8s.io/apimachinery/pkg/selection" ) // ValidateEventSource validates a resource event source func (listener *EventListener) ValidateEventSource(ctx context.Context, eventSource *gateways.EventSource) (*gateways.ValidEventSource, error) { if apicommon.EventSourceType(eventSource.Type) != apicommon.ResourceEvent { return &gateways.ValidEventSource{ IsValid: false, Reason: common.ErrEventSourceTypeMismatch(string(apicommon.ResourceEvent)), }, nil } var resourceEventSource *v1alpha1.ResourceEventSource if err := yaml.Unmarshal(eventSource.Value, &resourceEventSource); err != nil { listener.Logger.WithError(err).Errorln("failed to parse the event source") return &gateways.ValidEventSource{ IsValid: false, Reason: err.Error(), }, err } if err := validate(resourceEventSource); err != nil { listener.Logger.WithError(err).Errorln("failed to validate the event source") return &gateways.ValidEventSource{ IsValid: false, Reason: err.Error(), }, err } return &gateways.ValidEventSource{ IsValid: true, }, nil } func validate(eventSource *v1alpha1.ResourceEventSource) error { if eventSource == nil { return common.ErrNilEventSource } if eventSource.Version == "" { return fmt.Errorf("version must be specified") } if eventSource.Resource == "" { return fmt.Errorf("resource must be specified") } if eventSource.EventTypes == nil { return fmt.Errorf("event types must be specified") } if eventSource.Filter != nil { if eventSource.Filter.Labels != nil { if err := validateSelectors(eventSource.Filter.Labels); err != nil { return err } } if eventSource.Filter.Fields != nil { if err := validateSelectors(eventSource.Filter.Fields); err != nil { return err } } } return nil } func validateSelectors(selectors []v1alpha1.Selector) error { for _, sel := range selectors { if sel.Key == "" { return fmt.Errorf("key can't be empty for selector") } if sel.Operation == "" { continue } if selection.Operator(sel.Operation) == "" { return fmt.Errorf("unknown selection operation %s", sel.Operation) } } return nil }
28.663462
144
0.733982
c30e70b757fd75dd5a86df30744e7653ed206364
2,391
swift
Swift
Twitter/User.swift
kate2753/CodePathTwitter
124483caa07817ad2249e60c77b8e7f45dc6b18a
[ "Apache-2.0" ]
null
null
null
Twitter/User.swift
kate2753/CodePathTwitter
124483caa07817ad2249e60c77b8e7f45dc6b18a
[ "Apache-2.0" ]
null
null
null
Twitter/User.swift
kate2753/CodePathTwitter
124483caa07817ad2249e60c77b8e7f45dc6b18a
[ "Apache-2.0" ]
null
null
null
// // User.swift // Twitter // // Created by kate_odnous on 8/15/16. // Copyright © 2016 Kate Odnous. All rights reserved. // import UIKit class User: NSObject { static let currentUserStorageKey = "currentUserData" static let userDidLogoutNotification = "UserDidLogout" var name: String? var screenName: String? var profilePhotoUrl: NSURL? var profileBannerUrl : NSURL? var tagline: String? var statusesCount: Int = 0 var followersCount: Int = 0 var followingCount: Int = 0 var dictionary: NSDictionary? init(dictionary: NSDictionary) { self.dictionary = dictionary // print(dictionary) name = dictionary["name"] as? String screenName = dictionary["screen_name"] as? String let profileURLString = dictionary["profile_image_url_https"] as? String if let profileURLString = profileURLString { profilePhotoUrl = NSURL(string: profileURLString) } if let profileBannerUrl = dictionary["profile_banner_url"] as? String { self.profileBannerUrl = NSURL(string: profileBannerUrl) } if let statusesCount = dictionary["statuses_count"] as? Int { self.statusesCount = statusesCount } if let followersCount = dictionary["followers_count"] as? Int { self.followersCount = followersCount } if let followingCount = dictionary["friends_count"] as? Int { self.followingCount = followingCount } tagline = dictionary["description"] as? String } static var _currentUser: User? class var currentUser: User? { get { if _currentUser == nil { let userDefaults = NSUserDefaults.standardUserDefaults() let userData = userDefaults.objectForKey(User.currentUserStorageKey) as? NSData if let userData = userData { let dictionary = try! NSJSONSerialization.JSONObjectWithData(userData, options: []) as! NSDictionary _currentUser = User(dictionary: dictionary) } } return _currentUser } set(user) { let userDefaults = NSUserDefaults.standardUserDefaults() if let user = user { let data = try! NSJSONSerialization.dataWithJSONObject(user.dictionary!, options: []) userDefaults.setObject(data, forKey: User.currentUserStorageKey) } else { userDefaults.setObject(nil, forKey: User.currentUserStorageKey) } userDefaults.synchronize() } } }
30.265823
110
0.689251
7b64ff191aa93d501fadd9cdddc132415d4dc5ec
4,545
css
CSS
webroot/css/widgets/tag.css
unimatrix/backend
712bae4281c7e258997c9b0fe810d986444b75d6
[ "MIT" ]
1
2018-06-05T17:26:42.000Z
2018-06-05T17:26:42.000Z
webroot/css/widgets/tag.css
unimatrix/backend
712bae4281c7e258997c9b0fe810d986444b75d6
[ "MIT" ]
null
null
null
webroot/css/widgets/tag.css
unimatrix/backend
712bae4281c7e258997c9b0fe810d986444b75d6
[ "MIT" ]
null
null
null
/** * Tag widget * * @author Flavius * @version 1.0 */ div.tag-widget { position: relative; } /** Tag list **/ div.tag-widget > div.list { margin: 0 0 1rem; font-size: .875rem; } div.tag-widget > div.list.hidden { display: none; } div.tag-widget > div.list > label { font-style: italic; } div.tag-widget > div.list > tag { display: inline-block; margin: 0px 5px 5px 0px; vertical-align: top; position: relative; cursor: pointer; background: #e8e8e8; -webkit-animation: none; animation: none; } div.tag-widget > div.list > tag.hidden { width: 0 !important; padding-left: 0; padding-right: 0; margin-left: 0; margin-right: 0; opacity: 0; -webkit-transform: scale(0); -ms-transform: scale(0); transform: scale(0); -webkit-transition: .3s; transition: .3s; pointer-events: none; } div.tag-widget > div.list > tag > div { vertical-align: top; position: relative; box-sizing: border-box; max-width: 100%; padding: 0.3em 0.5em; color: black; } div.tag-widget > div.list > tag > div > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: top; width: 100%; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } /** Tagify overwrites **/ div.tag-widget > tags { padding: 0; box-sizing: border-box; width: 100%; border-color: #cacaca; margin: 0 0 1rem; font-family: inherit; font-size: .875rem; line-height: 1.4; color: #0a0a0a; background-color: #fefefe; box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1); transition: box-shadow 0.5s, border-color 0.15s ease-in-out; -webkit-appearance: none; -moz-appearance: none; } div.tag-widget > tags.active { border-color: #8a8a8a; box-shadow: 0 0 5px #cacaca; outline: none; } div.tag-widget > tags > div { padding: .5rem; margin: 0px; } div.tag-widget > tags > div > input { padding: 0px 4px; height: 21px; } div.tag-widget > tags > div > span { line-height: 1.5; padding: .5rem 0px; } div.tag-widget > tags > tag { background: #e8e8e8; -webkit-animation: none; animation: none; } div.tag-widget > tags > tag > x { line-height: 15px; margin-top: 1px; right: calc(0.6em - 3px); } div.tag-widget > tags > tag > x:hover { background: #e0115f; } div.tag-widget > tags > tag x:hover + div > span { opacity: 1; } div.tag-widget > tags > tag > div { padding-right: 1.7em; } div.tag-widget > tags > tag > div::before { content: none; } div.tag-widget > tags > tag > div > span { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } div.tag-widget > tags > tag.tagify--mark > div { animation: .4s tagify--pulse 3 ease-out; } div.tag-widget > tags > tag.tagify--notAllowed > div { box-shadow: 0 0 0 20px #e0115f inset; } div.tag-widget > tags > tag.tagify--notAllowed > div > span { opacity: 1; color: #fff; } @-webkit-keyframes tagify--pulse { 50% { box-shadow: 0 0 0 2px #e0115f inset; } } @keyframes tagify--pulse { 50% { box-shadow: 0 0 0 2px #e0115f inset; } }
26.578947
77
0.438504
cf89c002bae2bc61bcf690ea9cecdacb1f84fb3c
1,135
asm
Assembly
programs/oeis/226/A226903.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/226/A226903.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/226/A226903.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A226903: Shiraishi numbers: a parametrized family of solutions c to the Diophantine equation a^3 + b^3 + c^3 = d^3 with d = c+1. ; 5,18,53,102,197,306,491,684,989,1290,1745,2178,2813,3402,4247,5016,6101,7074,8429,9630,11285,12738,14723,16452,18797,20826,23561,25914,29069,31770,35375,38448,42533,46002,50597,54486,59621,63954,69659,74460,80765,86058 mov $2,$0 add $2,1 mov $5,$0 lpb $2,1 mov $0,$5 sub $2,1 sub $0,$2 mov $13,$0 mov $15,2 lpb $15,1 mov $0,$13 sub $15,1 add $0,$15 sub $0,1 mov $9,$0 mov $11,2 lpb $11,1 mov $0,$9 sub $11,1 add $0,$11 add $0,1 mov $6,1 mov $7,9 mul $7,$0 mul $6,$7 mul $6,$0 div $6,6 mov $3,$6 pow $3,2 sub $3,$0 mov $4,$3 mov $12,$11 lpb $12,1 mov $10,$4 sub $12,1 lpe lpe lpb $9,1 mov $9,0 sub $10,$4 lpe mov $4,$10 mov $8,$15 lpb $8,1 sub $8,1 mov $14,$4 lpe lpe lpb $13,1 mov $13,0 sub $14,$4 lpe mov $4,$14 sub $4,34 div $4,16 mul $4,2 add $4,5 add $1,$4 lpe
18.015873
220
0.507489
86737288c89fdd316651fcd3393e768cd78c5477
1,848
rs
Rust
src/lib.rs
mathstuf/rust-bus-gen
b16fe5b3e2e5c1115708adffb2cafa198a483a64
[ "BSD-3-Clause" ]
null
null
null
src/lib.rs
mathstuf/rust-bus-gen
b16fe5b3e2e5c1115708adffb2cafa198a483a64
[ "BSD-3-Clause" ]
1
2019-01-17T16:31:36.000Z
2019-01-17T16:31:36.000Z
src/lib.rs
mathstuf/rust-bus-gen
b16fe5b3e2e5c1115708adffb2cafa198a483a64
[ "BSD-3-Clause" ]
null
null
null
// Copyright (c) 2016, Ben Boeckel // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // * Neither the name of this project nor the names of its contributors // may be used to endorse or promote products derived from this software // without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #![warn(missing_docs)] //! D-Bus interface code generator //! //! This executable is meant to generate the skeleton code for a D-Bus interface using the `bus` //! crate. It reads in XML files describing the interface in the D-Bus introspection format. mod types;
52.8
96
0.755411
c82b819f69b2e20b1eaf9aa91635d509f4791417
2,591
rs
Rust
src/lib.rs
studentofkyoto/all-lap-python
40bf11839734a6a05298a192971ada8a4b5e1272
[ "MIT" ]
null
null
null
src/lib.rs
studentofkyoto/all-lap-python
40bf11839734a6a05298a192971ada8a4b5e1272
[ "MIT" ]
null
null
null
src/lib.rs
studentofkyoto/all-lap-python
40bf11839734a6a05298a192971ada8a4b5e1272
[ "MIT" ]
null
null
null
use all_lap_rust::bipartite as bp; use all_lap_rust::contains::Contains; use pyo3::prelude::*; use pyo3::PyIterProtocol; #[pyclass] #[derive(Clone)] struct BipartiteGraph { inner: bp::BipartiteGraph, } #[pymethods] impl BipartiteGraph { #[new] pub fn __new__(adj: Vec<Vec<usize>>) -> Self { let inner = bp::BipartiteGraph::from_adj(adj); Self { inner } } pub fn iter_matchings( &self, allowed_start_nodes: NodeSet, ) -> PyResult<MaximumMatchingIterator> { Ok(MaximumMatchingIterator::__new__( self.clone(), allowed_start_nodes, )) } } #[pyclass] #[derive(Clone)] struct Node { inner: bp::Node, } #[pymethods] impl Node { #[new] pub fn __new__(lr: bool, index: usize) -> Self { let nodegroup = match lr { false => bp::NodeGroup::Left, true => bp::NodeGroup::Right, }; let inner = bp::Node::new(nodegroup, index); Self { inner } } } #[pyclass] #[derive(Clone)] struct NodeSet { inner: bp::NodeSet, } #[pymethods] impl NodeSet { #[new] pub fn __new__(nodes: Vec<Node>, lsize: usize) -> Self { let hashset = nodes.into_iter().map(|x| x.inner).collect(); Self { inner: bp::NodeSet::new(hashset, lsize), } } } impl Contains<bp::Node> for NodeSet { fn contains_node(&self, item: &bp::Node) -> bool { self.inner.contains_node(item) } } impl Contains<usize> for NodeSet { fn contains_node(&self, item: &usize) -> bool { self.inner.contains_node(item) } } #[pyclass] struct MaximumMatchingIterator { inner: bp::MaximumMatchingsIterator<NodeSet>, } #[pymethods] impl MaximumMatchingIterator { #[new] pub fn __new__(graph: BipartiteGraph, allowed_start_nodes: NodeSet) -> Self { let inner = bp::MaximumMatchingsIterator::from_graph(graph.inner, allowed_start_nodes); Self { inner } } } #[pyproto] impl<'p> PyIterProtocol for MaximumMatchingIterator { fn __iter__(slf: PyRef<'p, Self>) -> PyRef<Self> { slf } fn __next__(mut slf: PyRefMut<'p, Self>) -> Option<Vec<Option<usize>>> { let m = slf.inner.next()?; if m.l2r.iter().all(|x| x.is_none()) { return None; } Some(m.l2r) } } #[pymodule] fn rust_ext(_py: Python<'_>, m: &PyModule) -> PyResult<()> { // wrapper of `Iter` m.add_class::<BipartiteGraph>()?; m.add_class::<NodeSet>()?; m.add_class::<Node>()?; m.add_class::<MaximumMatchingIterator>()?; Ok(()) }
22.145299
95
0.592435
ff9e0def309e20efc55909b8c3dddc1fe1da8762
478
sql
SQL
migrations/000003_create_peer_properties_table.up.sql
coryschwartz/nebula-crawler
34ebe1109a5117949b4f285891a065adcc0bae08
[ "Apache-2.0" ]
66
2021-07-05T21:55:27.000Z
2022-03-20T20:44:38.000Z
migrations/000003_create_peer_properties_table.up.sql
coryschwartz/nebula-crawler
34ebe1109a5117949b4f285891a065adcc0bae08
[ "Apache-2.0" ]
8
2021-07-18T09:00:12.000Z
2022-03-15T17:44:11.000Z
migrations/000003_create_peer_properties_table.up.sql
coryschwartz/nebula-crawler
34ebe1109a5117949b4f285891a065adcc0bae08
[ "Apache-2.0" ]
6
2021-07-11T12:25:05.000Z
2022-01-04T21:14:50.000Z
CREATE TABLE IF NOT EXISTS peer_properties ( id SERIAL PRIMARY KEY, property VARCHAR(255) NOT NULL, value VARCHAR(255) NOT NULL, count INT NOT NULL, crawl_id SERIAL NOT NULL, created_at TIMESTAMPTZ NOT NULL, updated_at TIMESTAMPTZ NOT NULL ); ALTER TABLE peer_properties ADD CONSTRAINT fk_peer_property_crawl FOREIGN KEY (crawl_id) REFERENCES crawls (id) ON DELETE CASCADE;
28.117647
42
0.638075
26b347e0ad86adeb8647cd23591a04c252740813
3,984
java
Java
app/src/main/java/com/havrylyuk/dou/ui/main/SalariesAdapter.java
graviton57/DOUSalaries
b7381719f8602c31028d6fa1f988299f1f9d3882
[ "Apache-2.0" ]
3
2017-10-07T09:21:07.000Z
2018-05-04T19:35:21.000Z
app/src/main/java/com/havrylyuk/dou/ui/main/SalariesAdapter.java
graviton57/DOUSalaries
b7381719f8602c31028d6fa1f988299f1f9d3882
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/havrylyuk/dou/ui/main/SalariesAdapter.java
graviton57/DOUSalaries
b7381719f8602c31028d6fa1f988299f1f9d3882
[ "Apache-2.0" ]
3
2017-10-07T09:22:53.000Z
2020-12-28T12:02:36.000Z
package com.havrylyuk.dou.ui.main; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.havrylyuk.dou.R; import com.havrylyuk.dou.utils.chart.listviewitems.ChartItem; import com.havrylyuk.dou.utils.chart.listviewitems.GroupBarChartItem; import com.havrylyuk.dou.utils.chart.listviewitems.HorizontalBarChartItem; import com.havrylyuk.dou.utils.chart.listviewitems.LineChartItem; import com.havrylyuk.dou.utils.chart.listviewitems.PieChartItem; import com.havrylyuk.dou.utils.chart.listviewitems.VerticalBarChartItem; import java.util.ArrayList; import java.util.List; import javax.inject.Inject; /** * Created by Igor Havrylyuk on 21.09.2017. */ public class SalariesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private Context context; private List<ChartItem> chartItems; @Inject public SalariesAdapter(Context context) { this.context = context; this.chartItems = new ArrayList<>(); } public void addChartItems(List<ChartItem> list){ if (this.chartItems != null && list != null) { this.chartItems.addAll(list); notifyDataSetChanged(); } } public void addChartItem(ChartItem chartItem) { if (this.chartItems != null && chartItem != null) { this.chartItems.add(chartItem); notifyDataSetChanged(); } } public void clear(){ if (chartItems != null) { chartItems.clear(); notifyDataSetChanged(); } } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if (parent instanceof RecyclerView) { if (viewType == ChartItem.TYPE_GRP_BAR_CHART) { View view = LayoutInflater.from(context) .inflate(R.layout.list_item_ver_barchart, parent, false); return new GroupBarChartItem.BarChartHolder(view); } else if (viewType == ChartItem.TYPE_VER_BAR_CHART) { View view = LayoutInflater.from(context) .inflate(R.layout.list_item_ver_barchart, parent, false); return new VerticalBarChartItem.VerticalBarChartHolder(view); } else if (viewType == ChartItem.TYPE_HOR_BAR_CHART) { View view = LayoutInflater.from(context) .inflate(R.layout.list_item_hor_barchart, parent, false); return new HorizontalBarChartItem.HorizontalBarChartHolder(view); } else if (viewType == ChartItem.TYPE_LINE_CHART){ View view = LayoutInflater.from(context) .inflate(R.layout.list_item_linechart, parent, false); return new LineChartItem.LineChartHolder(view); } else { View view = LayoutInflater.from(context) .inflate(R.layout.list_item_piechart, parent, false); return new PieChartItem.PieChartHolder(view); } } else { throw new RuntimeException("Not bound to RecyclerView"); } } @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { switch (getItemViewType(position)){ case ChartItem.TYPE_PIE_CHART: case ChartItem.TYPE_LINE_CHART: case ChartItem.TYPE_GRP_BAR_CHART: case ChartItem.TYPE_HOR_BAR_CHART: case ChartItem.TYPE_VER_BAR_CHART: ChartItem chartItem = chartItems.get(position); chartItem.onBindViewHolder(holder); break; } } @Override public int getItemViewType(int position) { return chartItems.get(position).getItemType(); } @Override public int getItemCount() { return chartItems != null ? chartItems.size() : 0; } }
35.571429
87
0.646837
9075913c57da3bde86f3690c408c332989174bff
496
py
Python
faker/providers/company/ro_RO/__init__.py
jeffwright13/faker
9192d5143d5f1b832cc0f44b3f7ee89ca28c975a
[ "MIT" ]
3
2019-03-06T03:02:25.000Z
2021-11-26T07:30:43.000Z
faker/providers/company/ro_RO/__init__.py
Haytam222/faker
9929afc9c9fd4bd75f2ad4b7eb9c132e67e66ce8
[ "MIT" ]
2
2021-05-12T06:25:57.000Z
2022-03-01T04:16:03.000Z
faker/providers/company/ro_RO/__init__.py
Haytam222/faker
9929afc9c9fd4bd75f2ad4b7eb9c132e67e66ce8
[ "MIT" ]
2
2021-09-22T12:47:59.000Z
2021-12-10T08:18:23.000Z
from .. import Provider as CompanyProvider class Provider(CompanyProvider): formats = ( '{{last_name}} {{company_suffix}}', '{{last_name}} {{last_name}} {{company_suffix}}', '{{last_name}}', ) company_suffixes = ( 'SRL', 'SA', 'SCA', 'SNC', 'SCS', 'AFJ', 'ASF', 'CON', 'CRL', 'INC', 'LOC', 'OC1', 'OC2', 'OC3', 'PFA', 'RA', 'SCS', 'SPI', 'URL', ) def company_suffix(self): return self.random_element(self.company_suffixes)
26.105263
76
0.544355
ef548831c04fdad7450f4bb2754bdb6a3c4aea3c
8,977
kt
Kotlin
src/lesson2/task1/IfElse.kt
AnadolStudio/KotlinAsFirst
e8541500b9d20a291dff8a206a8beca406700d00
[ "CC0-1.0" ]
null
null
null
src/lesson2/task1/IfElse.kt
AnadolStudio/KotlinAsFirst
e8541500b9d20a291dff8a206a8beca406700d00
[ "CC0-1.0" ]
null
null
null
src/lesson2/task1/IfElse.kt
AnadolStudio/KotlinAsFirst
e8541500b9d20a291dff8a206a8beca406700d00
[ "CC0-1.0" ]
null
null
null
@file:Suppress("UNUSED_PARAMETER") package lesson2.task1 import lesson1.task1.discriminant import kotlin.math.max import kotlin.math.min import kotlin.math.pow import kotlin.math.sqrt // Урок 2: ветвления (здесь), логический тип (см. 2.2). // Максимальное количество баллов = 6 // Рекомендуемое количество баллов = 5 // Вместе с предыдущими уроками = 9/12 /** * Пример * * Найти число корней квадратного уравнения ax^2 + bx + c = 0 */ fun quadraticRootNumber(a: Double, b: Double, c: Double): Int { val discriminant = discriminant(a, b, c) return when { discriminant > 0.0 -> 2 discriminant == 0.0 -> 1 else -> 0 } } /** * Пример * * Получить строковую нотацию для оценки по пятибалльной системе */ fun gradeNotation(grade: Int): String = when (grade) { 5 -> "отлично" 4 -> "хорошо" 3 -> "удовлетворительно" 2 -> "неудовлетворительно" else -> "несуществующая оценка $grade" } /** * Пример * * Найти наименьший корень биквадратного уравнения ax^4 + bx^2 + c = 0 */ fun minBiRoot(a: Double, b: Double, c: Double): Double { // 1: в главной ветке if выполняется НЕСКОЛЬКО операторов if (a == 0.0) { if (b == 0.0) return Double.NaN // ... и ничего больше не делать val bc = -c / b if (bc < 0.0) return Double.NaN // ... и ничего больше не делать return -sqrt(bc) // Дальше функция при a == 0.0 не идёт } val d = discriminant(a, b, c) // 2 if (d < 0.0) return Double.NaN // 3 // 4 val y1 = (-b + sqrt(d)) / (2 * a) val y2 = (-b - sqrt(d)) / (2 * a) val y3 = max(y1, y2) // 5 if (y3 < 0.0) return Double.NaN // 6 return -sqrt(y3) // 7 } /** * Простая (2 балла) * * Мой возраст. Для заданного 0 < n < 200, рассматриваемого как возраст человека, * вернуть строку вида: «21 год», «32 года», «12 лет». */ fun ageDescription(age: Int): String { val remainder = age % 10 val year: String = when { age % 100 in 10..20 -> "лет" remainder == 1 -> "год" remainder in 1..4 -> "года" else -> "лет" } return "$age $year" } /** * Простая (2 балла) * * Путник двигался t1 часов со скоростью v1 км/час, затем t2 часов — со скоростью v2 км/час * и t3 часов — со скоростью v3 км/час. * Определить, за какое время он одолел первую половину пути? */ fun timeForHalfWay( t1: Double, v1: Double, t2: Double, v2: Double, t3: Double, v3: Double ): Double { val s1 = t1 * v1 val s2 = t2 * v2 val s3 = t3 * v3 val halfS = (s1 + s2 + s3) / 2 val delta: Double return when { s1 > halfS -> { delta = (s1) - halfS (s1 - delta) / v1 } s1 + s2 > halfS -> { delta = (s1 + s2) - halfS t1 + (s2 - delta) / v2 } else -> { delta = (s1 + s2 + s3) - halfS t1 + t2 + (s3 - delta) / v3 } } } /** * Простая (2 балла) * * Нa шахматной доске стоят черный король и две белые ладьи (ладья бьет по горизонтали и вертикали). * Определить, не находится ли король под боем, а если есть угроза, то от кого именно. * Вернуть 0, если угрозы нет, 1, если угроза только от первой ладьи, 2, если только от второй ладьи, * и 3, если угроза от обеих ладей. * Считать, что ладьи не могут загораживать друг друга */ fun whichRookThreatens( kingX: Int, kingY: Int, rookX1: Int, rookY1: Int, rookX2: Int, rookY2: Int ): Int { // 1) Значит, теоретически я должен определить поля подконтрольные каждой фигуре (тут двум ладьям) // 2) Как это сделать? // 3) Хммм, а можно использовать массивы, списки? // 4) Какое самое универсальное и в тоже время самое простое решение? // Пусть у меня будет метод (inControlCells()), который на вход принимает 3 аргумента: тип фигуры, x, y. // 1. Тогда вернуть этот метод должен массив клеток которые находятся под контролем фигуры, // после этого можно проверить находится ли третья фигура в этой зоне (хотя на пути может встретится другая фигура, но тут это не учитывается) // Но так как мы не изучали еще списки (да и не факт, что это эффеткивано), то будет еще 2 ургумента: x, y сторонней фигуры, и метод будет возвращать true // если клетка будет найдена в процессе работы inControlCells val inControlRook1 = inControlCells(TypeFigure.ROOK, rookX1, rookY1, kingX, kingY) val inControlRook2 = inControlCells(TypeFigure.ROOK, rookX2, rookY2, kingX, kingY) return when { inControlRook1 && inControlRook2 -> 3 inControlRook2 -> 2 inControlRook1 -> 1 else -> 0 } } enum class TypeFigure { // Я понимаю, что это малость я ухожу вперед и можно было ограничиться только String, но это решение мне показалось более удобным BISHOP, ROOK, QUEEN } fun inControlCells( currentFigureType: TypeFigure, currentFigureX: Int, currentFigureY: Int, otherFigureX: Int, otherFigureY: Int ): Boolean { // Нужно сделать эффективной по памяти и времени O(n)... return when (currentFigureType) { TypeFigure.BISHOP -> { // Если диагональ слева на право, то сумма x и y увел. на 2, иначе == тому же знач. // Чтобы опр. диагональ достаточно найти 1 из крайних клеток этой диагонали, // а затем определить, такая же крайняя клетка ли у диагонали otherFigure inBishopControlCells(currentFigureX, currentFigureY, otherFigureX, otherFigureY) } TypeFigure.ROOK -> { inRookControlCells(currentFigureX, currentFigureY, otherFigureX, otherFigureY) } TypeFigure.QUEEN -> { inRookControlCells(currentFigureX, currentFigureY, otherFigureX, otherFigureY) || inBishopControlCells(currentFigureX, currentFigureY, otherFigureX, otherFigureY) } // Может по приколу сделать для ферзя, короля, коня и пешки? // Ферзь, очевидно, объединяет логику слона и ладьи, потому по-хорошему вынести бы их логику в отдельные методы // у короля модуль разности для x'ов и y'ов не должен превышать 1 // пешка - слон на миниалках, y += 1(или -= 1 для черного цвета, т.е необходим еще аргумент цвета фигуры), а x +=1 и x-=1. А так же проверка на выход за пределы доски // конь - в процессе, но напоминает пешку } } private fun inRookControlCells( currentFigureX: Int, currentFigureY: Int, otherFigureX: Int, otherFigureY: Int ) = currentFigureX == otherFigureX || currentFigureY == otherFigureY private fun inBishopControlCells( currentFigureX: Int, currentFigureY: Int, otherFigureX: Int, otherFigureY: Int ): Boolean { return (currentFigureX + currentFigureY) == (otherFigureX + otherFigureY) // Косая диагональ || (currentFigureX - currentFigureY) == (otherFigureX - otherFigureY) // Простая диагональ } /** * Простая (2 балла) * * На шахматной доске стоят черный король и белые ладья и слон * (ладья бьет по горизонтали и вертикали, слон — по диагоналям). * Проверить, есть ли угроза королю и если есть, то от кого именно. * Вернуть 0, если угрозы нет, 1, если угроза только от ладьи, 2, если только от слона, * и 3, если угроза есть и от ладьи и от слона. * Считать, что ладья и слон не могут загораживать друг друга. */ fun rookOrBishopThreatens( kingX: Int, kingY: Int, rookX: Int, rookY: Int, bishopX: Int, bishopY: Int ): Int { val inControlRook = inControlCells(TypeFigure.ROOK, rookX, rookY, kingX, kingY) val inControlBishop = inControlCells(TypeFigure.BISHOP, bishopX, bishopY, kingX, kingY) return when { inControlRook && inControlBishop -> 3 inControlBishop -> 2 inControlRook -> 1 else -> 0 } } /** * Простая (2 балла) * * Треугольник задан длинами своих сторон a, b, c. * Проверить, является ли данный треугольник остроугольным (вернуть 0), * прямоугольным (вернуть 1) или тупоугольным (вернуть 2). * Если такой треугольник не существует, вернуть -1. */ fun triangleKind(a: Double, b: Double, c: Double): Int { val side1 = min(a, b) // Первая наименьшая сторона - "катет" val side2 = min(c, max(a, b)) // Вторая наименьшая сторона - "катет" val side3 = max(c, max(a, b)) // Наибольшая сторона - "гипотенуза" val sum = side1.pow(2) + side2.pow(2) return when { side1 + side2 < side3 -> -1 sum > side3.pow(2) -> 0 sum == side3.pow(2) -> 1 else -> 2 } } /** * Средняя (3 балла) * * Даны четыре точки на одной прямой: A, B, C и D. * Координаты точек a, b, c, d соответственно, b >= a, d >= c. * Найти длину пересечения отрезков AB и CD. * Если пересечения нет, вернуть -1. */ fun segmentLength(a: Int, b: Int, c: Int, d: Int): Int { val endFirst = min(b, d) val startOther = max(a, c) // Конец первого меньше начала второго return if (endFirst >= startOther) { endFirst - startOther } else { -1 } }
32.291367
174
0.635402
36d34ad83ced607256f26a6583395f48317eecb5
507
dart
Dart
lib/ui/home/home_binding.dart
kimhau/Flutter-Bitbuckets
3a8e448c0af0ac5474703be7d168dcd96c17c330
[ "Apache-2.0" ]
null
null
null
lib/ui/home/home_binding.dart
kimhau/Flutter-Bitbuckets
3a8e448c0af0ac5474703be7d168dcd96c17c330
[ "Apache-2.0" ]
null
null
null
lib/ui/home/home_binding.dart
kimhau/Flutter-Bitbuckets
3a8e448c0af0ac5474703be7d168dcd96c17c330
[ "Apache-2.0" ]
null
null
null
import 'package:flutter_bitbuckets/network/bitbucket_client.dart'; import 'package:flutter_bitbuckets/repositories/bitbucket_repository.dart'; import 'package:get/get.dart'; import 'home_logic.dart'; class HomeBinding extends Bindings { @override void dependencies() { Get.lazyPut<BitbucketApiClient>(() => BitbucketApiClient()); Get.lazyPut<IBitbucketRepository>(() => BitbucketRepository(apiClient: Get.find())); Get.lazyPut(() => HomeController(bitbucketRepository: Get.find())); } }
33.8
88
0.757396
e63ccb1b19334bd81a321efca48dc485870f512f
3,698
go
Go
mock/batch.write.go
kadekutama/dynamodb
e6e8fe57b6ad1ce58f45f42a1f0109b8fa333e91
[ "MIT" ]
null
null
null
mock/batch.write.go
kadekutama/dynamodb
e6e8fe57b6ad1ce58f45f42a1f0109b8fa333e91
[ "MIT" ]
null
null
null
mock/batch.write.go
kadekutama/dynamodb
e6e8fe57b6ad1ce58f45f42a1f0109b8fa333e91
[ "MIT" ]
null
null
null
// Code generated by MockGen. DO NOT EDIT. // Source: batch.write.go // Package mock is a generated GoMock package. package mock import ( aws "github.com/aws/aws-sdk-go/aws" gomock "github.com/golang/mock/gomock" dynamo "github.com/guregu/dynamo" dynamodb "github.com/kadekutama/dynamodb" reflect "reflect" ) // MockBatchWrite is a mock of BatchWrite interface type MockBatchWrite struct { ctrl *gomock.Controller recorder *MockBatchWriteMockRecorder } // MockBatchWriteMockRecorder is the mock recorder for MockBatchWrite type MockBatchWriteMockRecorder struct { mock *MockBatchWrite } // NewMockBatchWrite creates a new mock instance func NewMockBatchWrite(ctrl *gomock.Controller) *MockBatchWrite { mock := &MockBatchWrite{ctrl: ctrl} mock.recorder = &MockBatchWriteMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use func (m *MockBatchWrite) EXPECT() *MockBatchWriteMockRecorder { return m.recorder } // Put mocks base method func (m *MockBatchWrite) Put(items ...interface{}) dynamodb.BatchWrite { m.ctrl.T.Helper() varargs := []interface{}{} for _, a := range items { varargs = append(varargs, a) } ret := m.ctrl.Call(m, "Put", varargs...) ret0, _ := ret[0].(dynamodb.BatchWrite) return ret0 } // Put indicates an expected call of Put func (mr *MockBatchWriteMockRecorder) Put(items ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Put", reflect.TypeOf((*MockBatchWrite)(nil).Put), items...) } // Delete mocks base method func (m *MockBatchWrite) Delete(keys ...dynamo.Keyed) dynamodb.BatchWrite { m.ctrl.T.Helper() varargs := []interface{}{} for _, a := range keys { varargs = append(varargs, a) } ret := m.ctrl.Call(m, "Delete", varargs...) ret0, _ := ret[0].(dynamodb.BatchWrite) return ret0 } // Delete indicates an expected call of Delete func (mr *MockBatchWriteMockRecorder) Delete(keys ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockBatchWrite)(nil).Delete), keys...) } // ConsumedCapacity mocks base method func (m *MockBatchWrite) ConsumedCapacity(cc *dynamo.ConsumedCapacity) dynamodb.BatchWrite { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ConsumedCapacity", cc) ret0, _ := ret[0].(dynamodb.BatchWrite) return ret0 } // ConsumedCapacity indicates an expected call of ConsumedCapacity func (mr *MockBatchWriteMockRecorder) ConsumedCapacity(cc interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsumedCapacity", reflect.TypeOf((*MockBatchWrite)(nil).ConsumedCapacity), cc) } // Run mocks base method func (m *MockBatchWrite) Run() (int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Run") ret0, _ := ret[0].(int) ret1, _ := ret[1].(error) return ret0, ret1 } // Run indicates an expected call of Run func (mr *MockBatchWriteMockRecorder) Run() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Run", reflect.TypeOf((*MockBatchWrite)(nil).Run)) } // RunWithContext mocks base method func (m *MockBatchWrite) RunWithContext(ctx aws.Context) (int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RunWithContext", ctx) ret0, _ := ret[0].(int) ret1, _ := ret[1].(error) return ret0, ret1 } // RunWithContext indicates an expected call of RunWithContext func (mr *MockBatchWriteMockRecorder) RunWithContext(ctx interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunWithContext", reflect.TypeOf((*MockBatchWrite)(nil).RunWithContext), ctx) }
31.606838
135
0.73364
230937e715606dbee9b853744762a1633e885f99
815
kt
Kotlin
src/main/kotlin/com/casper/sdk/getauction/GetAuctionInfoResult.kt
tqhuy2018/Casper-Kotlin-sdk
3d834547366f05c51c5ff0782856e1f39c462935
[ "MIT" ]
2
2022-03-10T04:21:02.000Z
2022-03-28T07:14:49.000Z
src/main/kotlin/com/casper/sdk/getauction/GetAuctionInfoResult.kt
tqhuy2018/Casper-Kotlin-sdk
3d834547366f05c51c5ff0782856e1f39c462935
[ "MIT" ]
null
null
null
src/main/kotlin/com/casper/sdk/getauction/GetAuctionInfoResult.kt
tqhuy2018/Casper-Kotlin-sdk
3d834547366f05c51c5ff0782856e1f39c462935
[ "MIT" ]
null
null
null
package com.casper.sdk.getauction import net.jemzart.jsonkraken.values.JsonObject /** Class built for storing GetAuctionInfoResult information, taken from state_get_auction_info RPC method */ class GetAuctionInfoResult { var apiVersion: String = "" var auctionState: AuctionState = AuctionState() companion object { /** This function parse the JsonObject (taken from server RPC method call) to GetAuctionInfoResult object */ fun fromJsonObjectToGetAuctionInfoResult(from: JsonObject): GetAuctionInfoResult { var ret: GetAuctionInfoResult = GetAuctionInfoResult() ret.apiVersion = from["api_version"].toString() ret.auctionState = AuctionState.fromJsonObjectToAuctionState(from["auction_state"] as JsonObject) return ret } } }
47.941176
116
0.728834
3e0b545a58e19744d9b3f5651a920fb650daf162
1,722
sql
SQL
modules/web-base/src/main/java/META-INF/org/nlh4j/web/system/function/domain/dao/SystemFunctionDao/findFunctions.sql
hainguyen81/nlh4j
f70377fc4c04ea091594784317ad343c217c0b3c
[ "Apache-2.0" ]
1
2020-07-25T21:48:43.000Z
2020-07-25T21:48:43.000Z
modules/web-base/src/main/java/META-INF/org/nlh4j/web/system/function/domain/dao/SystemFunctionDao/findFunctions.sql
hainguyen81/nlh4j
f70377fc4c04ea091594784317ad343c217c0b3c
[ "Apache-2.0" ]
null
null
null
modules/web-base/src/main/java/META-INF/org/nlh4j/web/system/function/domain/dao/SystemFunctionDao/findFunctions.sql
hainguyen81/nlh4j
f70377fc4c04ea091594784317ad343c217c0b3c
[ "Apache-2.0" ]
1
2019-09-06T16:35:04.000Z
2019-09-06T16:35:04.000Z
SELECT f.id , f.code , f.name , f.lang_key , f.func_order , f.enabled FROM "function" f WHERE true /*%if conditions == null*/ AND false /*%end*/ /*%if conditions != null*/ AND ( -- system administrator fn_iv_is_system_admin( /* conditions.getUsername() */'abc' ) -- specified user has been assigned into company OR ( COALESCE( ( SELECT COUNT( 1 ) FROM "user" u WHERE u.user_name = /* conditions.getUsername() */'abc' AND u.enabled = true AND ( u.expired_at IS NULL OR DATE_TRUNC( 'second', u.expired_at ) > DATE_TRUNC( 'second', CURRENT_TIMESTAMP ) ) ), 0 ) > 0 ) ) /*%end*/ /*%if conditions != null && @isNotEmpty(conditions.keyword) && conditions.isPrefix()*/ AND ( LOWER( f.code ) LIKE LOWER( /* @prefix(conditions.keyword) */'abc' ) escape '$' AND LOWER( f.name ) LIKE LOWER( /* @prefix(conditions.keyword) */'abc' ) escape '$' ) /*%end*/ /*%if conditions != null && @isNotEmpty(conditions.keyword) && conditions.isSuffix()*/ AND ( LOWER( f.code ) LIKE LOWER( /* @suffix(conditions.keyword) */'abc' ) escape '$' OR LOWER( f.name ) LIKE LOWER( /* @suffix(conditions.keyword) */'abc' ) escape '$' ) /*%end*/ /*%if conditions != null && @isNotEmpty(conditions.keyword) && conditions.isContain()*/ AND ( LOWER( f.code ) LIKE LOWER( /* @contain(conditions.keyword) */'abc' ) escape '$' OR LOWER( f.name ) LIKE LOWER( /* @contain(conditions.keyword) */'abc' ) escape '$' ) /*%end*/ /*%if conditions != null && conditions.enabled != null */ AND f.enabled = /* conditions.enabled */true /*%end*/ /*# orderBy */
27.774194
93
0.57259
b59128f4789eac25618525b48b9d4be834c767de
2,150
kt
Kotlin
src/test/kotlin/parsix/core/lazy/ParseMapKtTest.kt
parsix/parsix
3c17d2de0c94b671dd5cac54ca10e3b0e1f7875c
[ "Apache-2.0" ]
199
2021-05-15T16:09:05.000Z
2022-03-28T11:58:53.000Z
src/test/kotlin/parsix/core/lazy/ParseMapKtTest.kt
parsix/parsix
3c17d2de0c94b671dd5cac54ca10e3b0e1f7875c
[ "Apache-2.0" ]
4
2021-05-17T21:33:15.000Z
2022-03-30T14:52:56.000Z
src/test/kotlin/parsix/core/lazy/ParseMapKtTest.kt
parsix/parsix
3c17d2de0c94b671dd5cac54ca10e3b0e1f7875c
[ "Apache-2.0" ]
1
2021-05-16T22:02:55.000Z
2021-05-16T22:02:55.000Z
package parsix.core.lazy import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import parsix.core.KeyError import parsix.core.RequiredError import parsix.core.curry import parsix.core.parseInt import parsix.core.parseInto import parsix.core.parseString import parsix.core.succeed import parsix.result.Failure import parsix.result.Ok import parsix.test.TestError import parsix.test.neverCalled internal class ParseMapKtTest { data class TestData(val a: String, val b: Int?) @Test fun `it successfully parses the input`() { assertEquals( Ok(TestData("Hello", null)), parseInto(::TestData.curry()) .lazyRequired("1st", ::parseString) .lazyOptional("snd", ::parseInt) .invoke( mapOf( "1st" to "Hello", "snd" to null ) ) ) } @Test fun `required fields must be present in the input map`() { assertEquals( Failure(KeyError("1st", RequiredError)), parseInto(::TestData.curry()) .lazyRequired("1st", neverCalled()) .lazyOptional("snd", succeed(10)) .invoke(mapOf("snd" to "present")) ) } @Test fun `optional fields can be omitted`() { assertEquals( Ok(TestData("ok", null)), parseInto(::TestData.curry()) .lazyRequired("1st", succeed("ok")) .lazyOptional("snd", neverCalled()) .invoke(mapOf("1st" to "present")) ) } @Test fun `it short-circuits on first error`() { assertEquals( Failure(KeyError("snd", TestError("fail fast"))), parseInto(::TestData.curry()) .lazyRequired("1st", neverCalled()) .lazyOptional("snd", TestError.lift("fail fast")) .invoke( mapOf( "1st" to "broken", "snd" to "broken", ) ) ) } }
29.452055
65
0.526512
db60f0bbeadfc7e9010c66d1e817c589722e1dc8
68
sql
SQL
gpMgmt/test/behave/mgmt_utils/steps/data/gptransfer_setup/role.sql
rodel-talampas/gpdb
9c955e350334abbd922102f289f782697eb52069
[ "PostgreSQL", "Apache-2.0" ]
9
2018-04-20T03:31:01.000Z
2020-05-13T14:10:53.000Z
gpMgmt/test/behave/mgmt_utils/steps/data/gptransfer_setup/role.sql
rodel-talampas/gpdb
9c955e350334abbd922102f289f782697eb52069
[ "PostgreSQL", "Apache-2.0" ]
36
2017-09-21T09:12:27.000Z
2020-06-17T16:40:48.000Z
gpMgmt/test/behave/mgmt_utils/steps/data/gptransfer_setup/role.sql
rodel-talampas/gpdb
9c955e350334abbd922102f289f782697eb52069
[ "PostgreSQL", "Apache-2.0" ]
32
2017-08-31T12:50:52.000Z
2022-03-01T07:34:53.000Z
--Create Roles create role "geography" login password 'geography';
17
51
0.764706
8092164628f06285cb4d7b466e4e1808a918d1df
1,030
sql
SQL
src/main/resources/schema.sql
pinguedwinde/dolo-cloud
9f3d2ad87c42a7e2e62ef1d34625a81ad8b973e0
[ "MIT" ]
null
null
null
src/main/resources/schema.sql
pinguedwinde/dolo-cloud
9f3d2ad87c42a7e2e62ef1d34625a81ad8b973e0
[ "MIT" ]
null
null
null
src/main/resources/schema.sql
pinguedwinde/dolo-cloud
9f3d2ad87c42a7e2e62ef1d34625a81ad8b973e0
[ "MIT" ]
null
null
null
CREATE TABLE IF NOT EXISTS dolo_orders ( id IDENTITY, delivery_name VARCHAR(50) NOT NULL, delivery_street VARCHAR(50) NOT NULL, delivery_city VARCHAR(50) NOT NULL, delivery_state VARCHAR(30) NOT NULL, delivery_zip VARCHAR(10) NOT NULL, cc_number VARCHAR(16) NOT NULL, cc_expiration VARCHAR(5) NOT NULL, cc_cvv VARCHAR(3) NOT NULL, placed_at TIMESTAMP NOT NULL ); CREATE TABLE IF NOT EXISTS dolos ( id IDENTITY, name VARCHAR(50) NOT NULL, dolo_order BIGINT NOT NULL, dolo_order_key BIGINT NOT NULL, created_at TIMESTAMP NOT NULL ); CREATE TABLE IF NOT EXISTS ingredient_refs ( ingredient VARCHAR(4) NOT NULL, dolo BIGINT NOT NULL, dolo_key BIGINT NOT NULL ); CREATE TABLE IF NOT EXISTS ingredients ( id VARCHAR(4) NOT NULL, name VARCHAR(25) NOT NULL, type VARCHAR(25) NOT NULL ); alter TABLE dolos add foreign key (dolo_order) references dolo_orders(id); alter TABLE ingredient_refs add foreign key (ingredient) references ingredients(id);
31.212121
60
0.72233
a6da5868860cfaf7a8708f62b72e8c650d1df212
8,796
sql
SQL
sql/Country/CreateTable.sql
rtanyildizi/Library-Management-System
22f4d93f9c99829ee748cd37a8128cb8e16ce217
[ "MIT" ]
null
null
null
sql/Country/CreateTable.sql
rtanyildizi/Library-Management-System
22f4d93f9c99829ee748cd37a8128cb8e16ce217
[ "MIT" ]
null
null
null
sql/Country/CreateTable.sql
rtanyildizi/Library-Management-System
22f4d93f9c99829ee748cd37a8128cb8e16ce217
[ "MIT" ]
2
2021-02-07T10:15:53.000Z
2021-02-07T10:46:12.000Z
--! This table references: --! Author -- Create a new table called 'Country' in schema 'dbo' -- Drop the table if it already exists IF OBJECT_ID('dbo.Country', 'U') IS NOT NULL DROP TABLE dbo.Country GO -- Create the table in the specified schema CREATE TABLE dbo.Country ( -- primary key column [countryId] INT NOT NULL PRIMARY KEY IDENTITY(1, 1), [countryName] VARCHAR(50) NOT NULL, [twoCharCountryCode] CHAR(2) NOT NULL, [threeCharCountryCode] CHAR(3) NOT NULL, ); GO INSERT INTO dbo.[Country] VALUES ('Afghanistan', 'AF', 'AFG'), ('Aland Islands', 'AX', 'ALA'), ('Albania', 'AL', 'ALB'), ('Algeria', 'DZ', 'DZA'), ('American Samoa', 'AS', 'ASM'), ('Andorra', 'AD', 'AND'), ('Angola', 'AO', 'AGO'), ('Anguilla', 'AI', 'AIA'), ('Antarctica', 'AQ', 'ATA'), ('Antigua and Barbuda', 'AG', 'ATG'), ('Argentina', 'AR', 'ARG'), ('Armenia', 'AM', 'ARM'), ('Aruba', 'AW', 'ABW'), ('Australia', 'AU', 'AUS'), ('Austria', 'AT', 'AUT'), ('Azerbaijan', 'AZ', 'AZE'), ('Bahamas', 'BS', 'BHS'), ('Bahrain', 'BH', 'BHR'), ('Bangladesh', 'BD', 'BGD'), ('Barbados', 'BB', 'BRB'), ('Belarus', 'BY', 'BLR'), ('Belgium', 'BE', 'BEL'), ('Belize', 'BZ', 'BLZ'), ('Benin', 'BJ', 'BEN'), ('Bermuda', 'BM', 'BMU'), ('Bhutan', 'BT', 'BTN'), ('Bolivia', 'BO', 'BOL'), ('Bonaire, Sint Eustatius and Saba', 'BQ', 'BES'), ('Bosnia and Herzegovina', 'BA', 'BIH'), ('Botswana', 'BW', 'BWA'), ('Bouvet Island', 'BV', 'BVT'), ('Brazil', 'BR', 'BRA'), ('British Indian Ocean Territory', 'IO', 'IOT'), ('Brunei', 'BN', 'BRN'), ('Bulgaria', 'BG', 'BGR'), ('Burkina Faso', 'BF', 'BFA'), ('Burundi', 'BI', 'BDI'), ('Cambodia', 'KH', 'KHM'), ('Cameroon', 'CM', 'CMR'), ('Canada', 'CA', 'CAN'), ('Cape Verde', 'CV', 'CPV'), ('Cayman Islands', 'KY', 'CYM'), ('Central African Republic', 'CF', 'CAF'), ('Chad', 'TD', 'TCD'), ('Chile', 'CL', 'CHL'), ('China', 'CN', 'CHN'), ('Christmas Island', 'CX', 'CXR'), ('Cocos (Keeling) Islands', 'CC', 'CCK'), ('Colombia', 'CO', 'COL'), ('Comoros', 'KM', 'COM'), ('Congo', 'CG', 'COG'), ('Cook Islands', 'CK', 'COK'), ('Costa Rica', 'CR', 'CRI'), ('Ivory Coast', 'CI', 'CIV'), ('Croatia', 'HR', 'HRV'), ('Cuba', 'CU', 'CUB'), ('Curacao', 'CW', 'CUW'), ('Cyprus', 'CY', 'CYP'), ('Czech Republic', 'CZ', 'CZE'), ('Democratic Republic of the Congo', 'CD', 'COD'), ('Denmark', 'DK', 'DNK'), ('Djibouti', 'DJ', 'DJI'), ('Dominica', 'DM', 'DMA'), ('Dominican Republic', 'DO', 'DOM'), ('Ecuador', 'EC', 'ECU'), ('Egypt', 'EG', 'EGY'), ('El Salvador', 'SV', 'SLV'), ('Equatorial Guinea', 'GQ', 'GNQ'), ('Eritrea', 'ER', 'ERI'), ('Estonia', 'EE', 'EST'), ('Ethiopia', 'ET', 'ETH'), ('Falkland Islands (Malvinas)', 'FK', 'FLK'), ('Faroe Islands', 'FO', 'FRO'), ('Fiji', 'FJ', 'FJI'), ('Finland', 'FI', 'FIN'), ('France', 'FR', 'FRA'), ('French Guiana', 'GF', 'GUF'), ('French Polynesia', 'PF', 'PYF'), ('French Southern Territories', 'TF', 'ATF'), ('Gabon', 'GA', 'GAB'), ('Gambia', 'GM', 'GMB'), ('Georgia', 'GE', 'GEO'), ('Germany', 'DE', 'DEU'), ('Ghana', 'GH', 'GHA'), ('Gibraltar', 'GI', 'GIB'), ('Greece', 'GR', 'GRC'), ('Greenland', 'GL', 'GRL'), ('Grenada', 'GD', 'GRD'), ('Guadaloupe', 'GP', 'GLP'), ('Guam', 'GU', 'GUM'), ('Guatemala', 'GT', 'GTM'), ('Guernsey', 'GG', 'GGY'), ('Guinea', 'GN', 'GIN'), ('Guinea-Bissau', 'GW', 'GNB'), ('Guyana', 'GY', 'GUY'), ('Haiti', 'HT', 'HTI'), ('Heard Island and McDonald Islands', 'HM', 'HMD'), ('Honduras', 'HN', 'HND'), ('Hong Kong', 'HK', 'HKG'), ('Hungary', 'HU', 'HUN'), ('Iceland', 'IS', 'ISL'), ('India', 'IN', 'IND'), ('Indonesia', 'ID', 'IDN'), ('Iran', 'IR', 'IRN'), ('Iraq', 'IQ', 'IRQ'), ('Ireland', 'IE', 'IRL'), ('Isle of Man', 'IM', 'IMN'), ('Israel', 'IL', 'ISR'), ('Italy', 'IT', 'ITA'), ('Jamaica', 'JM', 'JAM'), ('Japan', 'JP', 'JPN'), ('Jersey', 'JE', 'JEY'), ('Jordan', 'JO', 'JOR'), ('Kazakhstan', 'KZ', 'KAZ'), ('Kenya', 'KE', 'KEN'), ('Kiribati', 'KI', 'KIR'), ('Kosovo', 'XK', '---'), ('Kuwait', 'KW', 'KWT'), ('Kyrgyzstan', 'KG', 'KGZ'), ('Laos', 'LA', 'LAO'), ('Latvia', 'LV', 'LVA'), ('Lebanon', 'LB', 'LBN'), ('Lesotho', 'LS', 'LSO'), ('Liberia', 'LR', 'LBR'), ('Libya', 'LY', 'LBY'), ('Liechtenstein', 'LI', 'LIE'), ('Lithuania', 'LT', 'LTU'), ('Luxembourg', 'LU', 'LUX'), ('Macao', 'MO', 'MAC'), ('Macedonia', 'MK', 'MKD'), ('Madagascar', 'MG', 'MDG'), ('Malawi', 'MW', 'MWI'), ('Malaysia', 'MY', 'MYS'), ('Maldives', 'MV', 'MDV'), ('Mali', 'ML', 'MLI'), ('Malta', 'MT', 'MLT'), ('Marshall Islands', 'MH', 'MHL'), ('Martinique', 'MQ', 'MTQ'), ('Mauritania', 'MR', 'MRT'), ('Mauritius', 'MU', 'MUS'), ('Mayotte', 'YT', 'MYT'), ('Mexico', 'MX', 'MEX'), ('Micronesia', 'FM', 'FSM'), ('Moldava', 'MD', 'MDA'), ('Monaco', 'MC', 'MCO'), ('Mongolia', 'MN', 'MNG'), ('Montenegro', 'ME', 'MNE'), ('Montserrat', 'MS', 'MSR'), ('Morocco', 'MA', 'MAR'), ('Mozambique', 'MZ', 'MOZ'), ('Myanmar (Burma)', 'MM', 'MMR'), ('Namibia', 'NA', 'NAM'), ('Nauru', 'NR', 'NRU'), ('Nepal', 'NP', 'NPL'), ('Netherlands', 'NL', 'NLD'), ('New Caledonia', 'NC', 'NCL'), ('New Zealand', 'NZ', 'NZL'), ('Nicaragua', 'NI', 'NIC'), ('Niger', 'NE', 'NER'), ('Nigeria', 'NG', 'NGA'), ('Niue', 'NU', 'NIU'), ('Norfolk Island', 'NF', 'NFK'), ('North Korea', 'KP', 'PRK'), ('Northern Mariana Islands', 'MP', 'MNP'), ('Norway', 'NO', 'NOR'), ('Oman', 'OM', 'OMN'), ('Pakistan', 'PK', 'PAK'), ('Palau', 'PW', 'PLW'), ('Palestine', 'PS', 'PSE'), ('Panama', 'PA', 'PAN'), ('Papua New Guinea', 'PG', 'PNG'), ('Paraguay', 'PY', 'PRY'), ('Peru', 'PE', 'PER'), ('Phillipines', 'PH', 'PHL'), ('Pitcairn', 'PN', 'PCN'), ('Poland', 'PL', 'POL'), ('Portugal', 'PT', 'PRT'), ('Puerto Rico', 'PR', 'PRI'), ('Qatar', 'QA', 'QAT'), ('Reunion', 'RE', 'REU'), ('Romania', 'RO', 'ROU'), ('Russia', 'RU', 'RUS'), ('Rwanda', 'RW', 'RWA'), ('Saint Barthelemy', 'BL', 'BLM'), ('Saint Helena', 'SH', 'SHN'), ('Saint Kitts and Nevis', 'KN', 'KNA'), ('Saint Lucia', 'LC', 'LCA'), ('Saint Martin', 'MF', 'MAF'), ('Saint Pierre and Miquelon', 'PM', 'SPM'), ('Saint Vincent and the Grenadines', 'VC', 'VCT'), ('Samoa', 'WS', 'WSM'), ('San Marino', 'SM', 'SMR'), ('Sao Tome and Principe', 'ST', 'STP'), ('Saudi Arabia', 'SA', 'SAU'), ('Senegal', 'SN', 'SEN'), ('Serbia', 'RS', 'SRB'), ('Seychelles', 'SC', 'SYC'), ('Sierra Leone', 'SL', 'SLE'), ('Singapore', 'SG', 'SGP'), ('Sint Maarten', 'SX', 'SXM'), ('Slovakia', 'SK', 'SVK'), ('Slovenia', 'SI', 'SVN'), ('Solomon Islands', 'SB', 'SLB'), ('Somalia', 'SO', 'SOM'), ('South Africa', 'ZA', 'ZAF'), ('South Georgia and the South Sandwich Islands', 'GS', 'SGS'), ('South Korea', 'KR', 'KOR'), ('South Sudan', 'SS', 'SSD'), ('Spain', 'ES', 'ESP'), ('Sri Lanka', 'LK', 'LKA'), ('Sudan', 'SD', 'SDN'), ('Suriname', 'SR', 'SUR'), ('Svalbard and Jan Mayen', 'SJ', 'SJM'), ('Swaziland', 'SZ', 'SWZ'), ('Sweden', 'SE', 'SWE'), ('Switzerland', 'CH', 'CHE'), ('Syria', 'SY', 'SYR'), ('Taiwan', 'TW', 'TWN'), ('Tajikistan', 'TJ', 'TJK'), ('Tanzania', 'TZ', 'TZA'), ('Thailand', 'TH', 'THA'), ('Timor-Leste (East Timor)', 'TL', 'TLS'), ('Togo', 'TG', 'TGO'), ('Tokelau', 'TK', 'TKL'), ('Tonga', 'TO', 'TON'), ('Trinidad and Tobago', 'TT', 'TTO'), ('Tunisia', 'TN', 'TUN'), ('Turkey', 'TR', 'TUR'), ('Turkmenistan', 'TM', 'TKM'), ('Turks and Caicos Islands', 'TC', 'TCA'), ('Tuvalu', 'TV', 'TUV'), ('Uganda', 'UG', 'UGA'), ('Ukraine', 'UA', 'UKR'), ('United Arab Emirates', 'AE', 'ARE'), ('United Kingdom', 'GB', 'GBR'), ('United States', 'US', 'USA'), ('United States Minor Outlying Islands', 'UM', 'UMI'), ('Uruguay', 'UY', 'URY'), ('Uzbekistan', 'UZ', 'UZB'), ('Vanuatu', 'VU', 'VUT'), ('Vatican City', 'VA', 'VAT'), ('Venezuela', 'VE', 'VEN'), ('Vietnam', 'VN', 'VNM'), ('Virgin Islands, British', 'VG', 'VGB'), ('Virgin Islands, US', 'VI', 'VIR'), ('Wallis and Futuna', 'WF', 'WLF'), ('Western Sahara', 'EH', 'ESH'), ('Yemen', 'YE', 'YEM'), ('Zambia', 'ZM', 'ZMB'), ('Zimbabwe', 'ZW', 'ZWE') GO SELECT * FROM dbo.[Country] GO
31.869565
66
0.454411
3ca140b00232e2ecdd1425e9f2b65a8d798e23d6
1,818
rs
Rust
iota-streams-core-mss/src/signature/mss/troika.rs
JakeSCahill/streams
ef7fcacf8aec5ab88610f0c9951e09fdee9d549b
[ "MIT", "Apache-2.0", "MIT-0" ]
null
null
null
iota-streams-core-mss/src/signature/mss/troika.rs
JakeSCahill/streams
ef7fcacf8aec5ab88610f0c9951e09fdee9d549b
[ "MIT", "Apache-2.0", "MIT-0" ]
null
null
null
iota-streams-core-mss/src/signature/mss/troika.rs
JakeSCahill/streams
ef7fcacf8aec5ab88610f0c9951e09fdee9d549b
[ "MIT", "Apache-2.0", "MIT-0" ]
3
2020-10-26T20:22:54.000Z
2021-10-03T04:46:02.000Z
use crate::signature::wots; use iota_streams_core::{ sponge::prp, tbits::{ trinary::TritWord, word::{ IntTbitWord, SpongosTbitWord, }, Tbits, }, }; use iota_streams_core_merkletree::merkle_tree; pub struct ParametersMtTraversal<TW>(std::marker::PhantomData<TW>); impl<TW> super::Parameters<TW> for ParametersMtTraversal<TW> where TW: IntTbitWord + SpongosTbitWord + TritWord, { type PrngG = prp::troika::Troika; type WotsParameters = wots::troika::Parameters<TW>; /// Tbits needed to encode tree height part of SKN. const SKN_TREE_HEIGHT_SIZE: usize = 4; /// Tbits needed to encode key number part of SKN. const SKN_KEY_NUMBER_SIZE: usize = 14; type MerkleTree = merkle_tree::traversal::MT<Tbits<TW>>; /// Max Merkle tree height. const MAX_D: usize = 20; } /* */ pub struct ParametersMtComplete<TW>(std::marker::PhantomData<TW>); impl<TW> super::Parameters<TW> for ParametersMtComplete<TW> where TW: IntTbitWord + SpongosTbitWord + TritWord, { type PrngG = prp::troika::Troika; type WotsParameters = wots::troika::Parameters<TW>; /// Tbits needed to encode tree height part of SKN. const SKN_TREE_HEIGHT_SIZE: usize = 4; /// Tbits needed to encode key number part of SKN. const SKN_KEY_NUMBER_SIZE: usize = 14; type MerkleTree = merkle_tree::complete::MT<Tbits<TW>>; /// Max Merkle tree height. const MAX_D: usize = 20; } #[test] fn sign_verify_d2_mtcomplete() { use iota_streams_core::tbits::trinary::Trit; super::tests::sign_verify::<Trit, ParametersMtComplete<Trit>>(); } #[test] fn sign_verify_d2_mttraversal() { use iota_streams_core::tbits::trinary::Trit; super::tests::sign_verify::<Trit, ParametersMtTraversal<Trit>>(); } /* */
24.567568
69
0.674367
c623f90d5fa92105120202a08de353521350f4a7
259
rb
Ruby
app/models/message.rb
snowylily/tomatocan
1639424f96f96808105da253f3960feba1e918e5
[ "Ruby", "Unlicense" ]
null
null
null
app/models/message.rb
snowylily/tomatocan
1639424f96f96808105da253f3960feba1e918e5
[ "Ruby", "Unlicense" ]
5
2020-04-13T16:34:28.000Z
2021-09-28T01:23:52.000Z
app/models/message.rb
snowylily/tomatocan
1639424f96f96808105da253f3960feba1e918e5
[ "Ruby", "Unlicense" ]
null
null
null
class Message < ApplicationRecord validates :fullname, presence: true validates_format_of :email, with: Devise.email_regexp, allow_blank: true validates :email, presence: true validates :subject, presence: true validates :message, presence: true end
28.777778
75
0.787645
2a744cc9502e14d00f4d69f5f81aa0118c2be8e0
814
java
Java
src/com/twu/biblioteca/Book.java
MuchContact/twu-biblioteca-hjliu
7b80af482a04ef3cb89dda54360d6a9ef5e1b5eb
[ "Apache-2.0" ]
null
null
null
src/com/twu/biblioteca/Book.java
MuchContact/twu-biblioteca-hjliu
7b80af482a04ef3cb89dda54360d6a9ef5e1b5eb
[ "Apache-2.0" ]
null
null
null
src/com/twu/biblioteca/Book.java
MuchContact/twu-biblioteca-hjliu
7b80af482a04ef3cb89dda54360d6a9ef5e1b5eb
[ "Apache-2.0" ]
null
null
null
package com.twu.biblioteca; /** * Created by dan on 15-7-28. */ public class Book extends Item{ private final String title; private final String author; private final int publishedYear; public Book(String title, String author, int publishedYear) { this.title = title; this.author = author; this.publishedYear = publishedYear; } public String getTitle() { return title; } public String getAuthor() { return author; } public int getPublishedYear() { return publishedYear; } @Override public String toString() { return "Book{" + "title='" + title + '\'' + ", author='" + author + '\'' + ", publishedYear=" + publishedYear + '}'; } }
21.421053
65
0.547912
93dc5907cc6dead44a1840c6f73a87926dd43eee
1,280
lua
Lua
spec/configuration_loader/data_url_spec.lua
ssethu24/apicast
63d0c23918e67b817147682520cd35955453f1ea
[ "Apache-2.0" ]
1
2020-11-14T20:38:14.000Z
2020-11-14T20:38:14.000Z
spec/configuration_loader/data_url_spec.lua
ssethu24/apicast
63d0c23918e67b817147682520cd35955453f1ea
[ "Apache-2.0" ]
2
2019-12-20T06:22:20.000Z
2020-07-18T14:20:17.000Z
spec/configuration_loader/data_url_spec.lua
ssethu24/apicast
63d0c23918e67b817147682520cd35955453f1ea
[ "Apache-2.0" ]
1
2018-04-09T08:45:39.000Z
2018-04-09T08:45:39.000Z
local loader = require 'apicast.configuration_loader.data_url' local cjson = require('cjson') describe('Configuration Data URL loader', function() describe('.call', function() it('ignores empty url', function() assert.same({nil, 'not valid data-url'}, { loader.call() }) assert.same({nil, 'not valid data-url'}, { loader.call('') }) end) local config = cjson.encode{ services = { { id = 21 }, { id = 42 }, } } it('decodes urlencoded data url', function() local url = ([[data:application/json,%s]]):format(ngx.escape_uri(config)) assert.same(config, loader.call(url)) end) it('ignores charset in the data url', function() local url = ([[data:application/json;charset=iso8601,%s]]):format(ngx.escape_uri(config)) assert.same(config, loader.call(url)) end) it('decodes base64 encoded data url', function() local url = ([[data:application/json;base64,%s]]):format(ngx.encode_base64(config)) assert.same(config, loader.call(url)) end) it('requires application/json media type', function() local url = ([[data:text/json,%s]]):format(ngx.escape_uri(config)) assert.same({nil, 'unsupported mediatype'}, { loader.call(url) }) end) end) end)
31.219512
95
0.630469
e3b17f35eb25918c8bca47b180f92d3d8e105e86
834
sql
SQL
sql/_31_cherry/issue_22054_on_update/cases/timezone_001.sql
zionyun/cubrid-testcases
ed8a07b096d721b9b42eb843fab326c63d143d77
[ "BSD-3-Clause" ]
9
2016-03-24T09:51:52.000Z
2022-03-23T10:49:47.000Z
sql/_31_cherry/issue_22054_on_update/cases/timezone_001.sql
zionyun/cubrid-testcases
ed8a07b096d721b9b42eb843fab326c63d143d77
[ "BSD-3-Clause" ]
173
2016-04-13T01:16:54.000Z
2022-03-16T07:50:58.000Z
sql/_31_cherry/issue_22054_on_update/cases/timezone_001.sql
zionyun/cubrid-testcases
ed8a07b096d721b9b42eb843fab326c63d143d77
[ "BSD-3-Clause" ]
38
2016-03-24T17:10:31.000Z
2021-10-30T22:55:45.000Z
drop if exists t; create table t( a int, time1 timestampltz on update current_timestamp, time2 timestamptz on update current_timestamp ); insert into t(a) values(1); set timezone 'Asia/Shanghai'; update t set a=2; select if(to_timestamp_tz(current_timestamp)-time1>=0 and to_timestamp_tz(current_timestamp)-time1<10,'ok','nok') from t where a=2; select if(to_timestamp_tz(current_timestamp)-time2>=0 and to_timestamp_tz(current_timestamp)-time2<10,'ok','nok') from t where a=2; set timezone 'America/New_York'; select sleep(3); update t set a=3; select if(to_timestamp_tz(current_timestamp)-time1>=0 and to_timestamp_tz(current_timestamp)-time1<10,'ok','nok') from t where a=3; select if(to_timestamp_tz(current_timestamp)-time2>=0 and to_timestamp_tz(current_timestamp)-time2<10,'ok','nok') from t where a=3; drop if exists t;
39.714286
132
0.778177
86c838883c3a7a38033b4396388283fac39e79f1
1,982
go
Go
astro/cli/astro/cmd/flags_test.go
mbarbon/astro
ec39948001c6378e16583aa772d79ad58d484e2e
[ "Apache-2.0" ]
null
null
null
astro/cli/astro/cmd/flags_test.go
mbarbon/astro
ec39948001c6378e16583aa772d79ad58d484e2e
[ "Apache-2.0" ]
null
null
null
astro/cli/astro/cmd/flags_test.go
mbarbon/astro
ec39948001c6378e16583aa772d79ad58d484e2e
[ "Apache-2.0" ]
null
null
null
/* * Copyright (c) 2018 Uber Technologies, Inc. * * 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 cmd import ( "testing" "github.com/uber/astro/astro" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestNoVariables(t *testing.T) { c, err := astro.NewConfigFromFile("fixtures/flags/no_variables.yaml") require.NoError(t, err) flags, err := commandLineFlags(c) require.NoError(t, err) assert.Equal(t, []*Flag{}, flags) } func TestSimpleVariables(t *testing.T) { c, err := astro.NewConfigFromFile("fixtures/flags/simple_variables.yaml") require.NoError(t, err) flags, err := commandLineFlags(c) require.NoError(t, err) assert.Equal(t, []*Flag{ &Flag{ Variable: "no_flag", Flag: "no_flag", IsRequired: true, }, &Flag{ Variable: "with_flag", Flag: "flag_name", IsRequired: true, }, &Flag{ Variable: "with_values", Flag: "with_values", IsFilter: true, AllowedValues: []string{ "dev", "prod", "staging", }, }, }, flags) } func TestMergeValues(t *testing.T) { c, err := astro.NewConfigFromFile("fixtures/flags/merge_values.yaml") require.NoError(t, err) flags, err := commandLineFlags(c) require.NoError(t, err) assert.Equal(t, []*Flag{ &Flag{ Variable: "environment", Flag: "environment", IsFilter: true, AllowedValues: []string{ "dev", "mgmt", "prod", "staging", }, }, }, flags) }
22.269663
75
0.666498
9ff25aa0fd10c8ceec9ac448a5f960a1209fde7c
995
ps1
PowerShell
login_with_httpie.ps1
phucnguyen81/django-locallibrary-tutorial
dd263b9c673ca963c89525517ab71f1f28e71fdd
[ "CC0-1.0" ]
null
null
null
login_with_httpie.ps1
phucnguyen81/django-locallibrary-tutorial
dd263b9c673ca963c89525517ab71f1f28e71fdd
[ "CC0-1.0" ]
7
2019-09-26T17:06:04.000Z
2019-09-27T13:58:09.000Z
login_with_httpie.ps1
phucnguyen81/django-locallibrary-tutorial
dd263b9c673ca963c89525517ab71f1f28e71fdd
[ "CC0-1.0" ]
null
null
null
# Login and request my books using httpie command foreach ($cmd in Get-Command @('http', 'jq')) { if (-not (Get-Command $cmd)) { return } } $login_url = 'localhost:8000/accounts/login/' $secured_url = 'localhost:8000/catalog/mybooks/' $username = 'phuc' $password = 'phuc' $curdir = Get-Location if ($PSScriptRoot) { $curdir = $PSScriptRoot } $session_file = '' if (Test-Path -LiteralPath $curdir) { $session_file = Join-Path $curdir ` -ChildPath 'http_session.json' } # Initial request for csrf token http $login_url --session $session_file --headers # Parse response with jq to get the csrf token $json_query = '..|.csrftoken?|select(.!=null)|.value' $csrf_token = $(jq --raw-output $json_query $session_file) # Login with the response CRRFToken http --form POST $login_url username=$username password=$password ` X-CSRFToken:$csrf_token ` --session=$session_file --follow --headers # Request secure data http $secured_url --session=$session_file --headers
26.891892
67
0.701508
7199ae371a66ec49d0d9c7c7395a5dcd8853ffd8
729
ts
TypeScript
server/src/common.ts
HackGT/timber
9002dce6ce41a5cb5837cc9df3b4ff420e722e31
[ "MIT" ]
6
2021-09-13T23:29:03.000Z
2022-02-27T22:53:22.000Z
server/src/common.ts
HackGT/timber
9002dce6ce41a5cb5837cc9df3b4ff420e722e31
[ "MIT" ]
64
2021-04-02T17:16:29.000Z
2022-03-30T14:31:42.000Z
server/src/common.ts
HackGT/timber
9002dce6ce41a5cb5837cc9df3b4ff420e722e31
[ "MIT" ]
null
null
null
/* eslint-disable @typescript-eslint/no-namespace, @typescript-eslint/no-empty-interface */ import { PrismaClient, User as PrismaUser } from "@prisma/client"; import path from "path"; import fs from "fs"; // eslint-disable-next-line import/no-mutable-exports export let prizeConfig: any; try { prizeConfig = JSON.parse( fs.readFileSync(path.resolve(__dirname, "./config/prizeConfig.json"), "utf8") ); } catch (err: any) { if (err.code !== "ENOENT") { throw err; } } export const prisma = new PrismaClient({ errorFormat: "pretty", }); declare global { namespace Express { interface User extends PrismaUser {} } } declare module "express-session" { interface Session { returnTo?: string; } }
21.441176
91
0.687243
b63e22a05e471f12a426d77d308bdba4d516df49
303
sql
SQL
src/main/resources/db/migration/V1.0.1__Legger_til_aktiv_i_brukernotifikasjon-view-et.sql
navikt/dittnav-event-aggregator
e34c344ae01499b08c4346137577045ef298ff8b
[ "MIT" ]
1
2020-02-11T05:21:23.000Z
2020-02-11T05:21:23.000Z
src/main/resources/db/migration/V1.0.1__Legger_til_aktiv_i_brukernotifikasjon-view-et.sql
navikt/dittnav-event-aggregator
e34c344ae01499b08c4346137577045ef298ff8b
[ "MIT" ]
13
2019-09-18T12:28:45.000Z
2021-12-03T14:31:32.000Z
src/main/resources/db/migration/V1.0.1__Legger_til_aktiv_i_brukernotifikasjon-view-et.sql
navikt/dittnav-event-aggregator
e34c344ae01499b08c4346137577045ef298ff8b
[ "MIT" ]
null
null
null
CREATE OR REPLACE VIEW brukernotifikasjon_view AS SELECT eventId, produsent, 'beskjed' as type, fodselsnummer, aktiv FROM BESKJED UNION SELECT eventId, produsent, 'oppgave' as type, fodselsnummer, aktiv FROM OPPGAVE UNION SELECT eventId, produsent, 'innboks' as type, fodselsnummer, aktiv FROM INNBOKS;
43.285714
80
0.811881
7ef19b2b6d03a4340b4c2b9c03143da819ff9cf8
5,532
swift
Swift
MagicalChineseChessBattle/ViewController/MultiPeerVC/View/MultiPeerMenuView.swift
Mosquito1123/MagicalChineseChessBattle
826a550023e6d3037f8c4663fe5e3a88dfb3e99c
[ "BSD-2-Clause" ]
1
2020-08-19T06:23:44.000Z
2020-08-19T06:23:44.000Z
MagicalChineseChessBattle/ViewController/MultiPeerVC/View/MultiPeerMenuView.swift
Mosquito1123/MagicalChineseChessBattle
826a550023e6d3037f8c4663fe5e3a88dfb3e99c
[ "BSD-2-Clause" ]
null
null
null
MagicalChineseChessBattle/ViewController/MultiPeerVC/View/MultiPeerMenuView.swift
Mosquito1123/MagicalChineseChessBattle
826a550023e6d3037f8c4663fe5e3a88dfb3e99c
[ "BSD-2-Clause" ]
null
null
null
// // MultiPeerMenuView.swift // ChineseChess // // Created by 李夙璃 on 2018/1/24. // Copyright © 2018年 StarLab. All rights reserved. // import UIKit public protocol MultiPeerMenuViewDelegate: NSObjectProtocol { func multiPeerMenuView(_ menuView: NavigationView, didSelectAt index: Int) } class MultiPeerMenuView: NavigationView { private weak var delegate: MultiPeerMenuViewDelegate? = nil private lazy var tableview: UITableView = { [weak self] in let view = UITableView(frame: CGRect.zero, style: .grouped) view.backgroundColor = UIColor.clear view.delegate = self view.dataSource = self view.allowsMultipleSelection = false view.register(Cell.self, forCellReuseIdentifier: Cell.identifier) view.isScrollEnabled = false view.separatorInset = UIEdgeInsets.zero view.separatorStyle = .singleLine return view }() private let dataSource: [String] = [ "创 建 对 局", "加 入 对 局", "修 改 昵 称" ] init(delegate: MultiPeerMenuViewDelegate) { super.init(frame: .zero) self.delegate = delegate self.bar.title = "对 弈 大 厅" if let gestureRecognizers = self.bar.leftBarButtonItem?.gestureRecognizers { for gesture in gestureRecognizers { self.bar.leftBarButtonItem?.removeGestureRecognizer(gesture) } } self.bar.leftBarButtonItem?.addTapTarget(self, action: #selector(self.back(sender:))) self.bar.rightBarButtonItem?.image = ResourcesProvider.shared.image(named: "tips") self.bar.addTapTarget(self, action: #selector(self.showTips(sender:))) self.contentView.addSubview(self.tableview) self.tableview.snp.makeConstraints { $0.top.equalTo(self.contentView).offset(Cell.height / 2.0) $0.left.equalTo(self.contentView).offset(Cell.edge) $0.bottom.equalTo(self.contentView).offset(-Cell.height / 2.0) $0.right.equalTo(self.contentView).offset(-Cell.edge) $0.width.equalTo(Cell.width) $0.height.equalTo(Cell.estimatedHeight(rows: self.dataSource.count)) } } required public init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } } // MARK: - UITableViewDelegate extension MultiPeerMenuView: UITableViewDelegate, UITableViewDataSource { func numberOfSections(in tableView: UITableView) -> Int { return 1 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return self.dataSource.count } func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { return 1.0 } func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { return 1.0 } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return Cell.height } func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { let view = UIView() view.backgroundColor = UIColor.clear return view } func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { let view = UIView() view.backgroundColor = UIColor.clear return view } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: Cell.identifier, for: indexPath) as! Cell cell.label.text = self.dataSource[indexPath.row] return cell } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: true) self.delegate?.multiPeerMenuView(self, didSelectAt: indexPath.row) WavHandler.playButtonWav() } } // MARK: - Cell & Action. extension MultiPeerMenuView { @objc private func showTips(sender: UIGestureRecognizer?) { sender?.isEnabled = false defer { sender?.isEnabled = true } guard let data = ResourcesProvider.shared.bundle(named: "AppInformation", type: "txt") else { return } guard let text = String(data: data, encoding: .utf8) else { return } WavHandler.playButtonWav() TextAlertView.show(in: self.superview, text: text) } @objc private func back(sender: UIGestureRecognizer?) { sender?.isEnabled = false defer { sender?.isEnabled = true } self.dismiss(withVoice: nil) self.delegate?.multiPeerMenuView(self, didSelectAt: -1) } private class Cell: UITableViewCell { public static let identifier: String = { return "Cell" }() public static let edge: CGFloat = { return LayoutPartner.ChessBoard().boardmargin }() public static let height: CGFloat = { return LayoutPartner.ChessBoard().chessSize + 4.0 }() public static let width: CGFloat = { return LayoutPartner.safeArea.size.width - (LayoutPartner.ChessBoard().boardmargin + Cell.edge) * 2.0 }() public class func estimatedHeight(rows: Int) -> CGFloat { return Cell.height * CGFloat(rows) + 2.0 } public lazy var label: UILabel = { let label = UILabel() label.textColor = UIColor.china label.font = UIFont.kaitiFont(ofSize: LayoutPartner.NavigationView().subTitleFontSize) label.textAlignment = .center return label }() override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) self.backgroundColor = UIColor.clear self.contentView.backgroundColor = UIColor.clear self.contentView.addSubview(self.label) self.label.snp.makeConstraints { $0.center.equalTo(self.contentView) } } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } } }
29.425532
104
0.729031
84f3f1172ad33853dd0a1ec81a1077d912590a0a
1,943
swift
Swift
0673. Number of Longest Increasing Subsequence.swift
sergeyleschev/leetcode-swift
b73b8fa61a14849e48fb38e27e51ea6c12817d64
[ "MIT" ]
10
2021-05-16T07:19:41.000Z
2021-08-02T19:02:00.000Z
0673. Number of Longest Increasing Subsequence.swift
sergeyleschev/leetcode-swift
b73b8fa61a14849e48fb38e27e51ea6c12817d64
[ "MIT" ]
null
null
null
0673. Number of Longest Increasing Subsequence.swift
sergeyleschev/leetcode-swift
b73b8fa61a14849e48fb38e27e51ea6c12817d64
[ "MIT" ]
1
2021-08-18T05:33:00.000Z
2021-08-18T05:33:00.000Z
class Solution { // Solution @ Sergey Leschev, Belarusian State University // 673. Number of Longest Increasing Subsequence // Given an integer array nums, return the number of longest increasing subsequences. // Notice that the sequence has to be strictly increasing. // Finds the number of longest increasing subsequences. // - Parameter nums: An integer array. // - Returns: The number of longest increasing subsequences. // Example 1: // Input: nums = [1,3,5,4,7] // Output: 2 // Explanation: The two longest increasing subsequences are [1, 3, 4, 7] and [1, 3, 5, 7]. // Example 2: // Input: nums = [2,2,2,2,2] // Output: 5 // Explanation: The length of longest continuous increasing subsequence is 1, and there are 5 subsequences' length is 1, so output 5. // Constraints: // 1 <= nums.length <= 2000 // -10^6 <= nums[i] <= 10^6 // - Complexity: // - time: O(n^2), where n is the length of nums. // - space: O(n), where n is the length of nums. func findNumberOfLIS(_ nums: [Int]) -> Int { guard nums.count > 1 else { return nums.count } var lengths = [Int](repeating: 0, count: nums.count) var counts = [Int](repeating: 1, count: nums.count) var ans = 0 var maxLen = 0 for i in 0..<nums.count { for j in 0..<i { guard nums[i] > nums[j] else { continue } if lengths[j] >= lengths[i] { lengths[i] = lengths[j] + 1 counts[i] = counts[j] } else if lengths[j] + 1 == lengths[i] { counts[i] += counts[j] } } } for length in lengths { maxLen = max(maxLen, length) } for i in 0..<nums.count { guard lengths[i] == maxLen else { continue } ans += counts[i] } return ans } }
31.852459
137
0.544519
4fd2998f00100a13eeb1844b03af793214a086d5
438
ps1
PowerShell
mysettings-ntfs/tools/chocolateyInstall.ps1
dcjulian29/choco-packages
63c3563d86cc0796380b28c5089dc03586df3c00
[ "Apache-2.0" ]
6
2015-02-12T09:38:07.000Z
2020-10-14T19:55:36.000Z
mysettings-ntfs/tools/chocolateyInstall.ps1
dcjulian29/choco-packages
63c3563d86cc0796380b28c5089dc03586df3c00
[ "Apache-2.0" ]
2
2015-02-09T19:24:31.000Z
2022-01-22T23:38:36.000Z
mysettings-ntfs/tools/chocolateyInstall.ps1
dcjulian29/choco-packages
63c3563d86cc0796380b28c5089dc03586df3c00
[ "Apache-2.0" ]
3
2015-05-23T05:09:11.000Z
2016-01-07T11:39:03.000Z
$packageName = "mysettings-ntfs" $toolDir = "$(Split-Path -parent $MyInvocation.MyCommand.Path)" if ($psISE) { Import-Module -name "$env:ChocolateyInstall\chocolateyinstall\helpers\chocolateyInstaller.psm1" } $cmd = ". $toolDir\postInstall.ps1" if (Test-ProcessAdminRights) { Invoke-Expression $cmd } else { Start-ChocolateyProcessAsAdmin $cmd } Write-Output "You need to reboot to complete the action..."
25.764706
100
0.707763
724978b971ef3c22c8bd85bf3364a51dd196fc91
5,975
kt
Kotlin
app/src/main/java/org/simple/clinic/home/overdue/OverdueListAdapter.kt
rakshakhegde/simple-android
3250ca834078344841d32347fec7810707f50cf8
[ "MIT" ]
null
null
null
app/src/main/java/org/simple/clinic/home/overdue/OverdueListAdapter.kt
rakshakhegde/simple-android
3250ca834078344841d32347fec7810707f50cf8
[ "MIT" ]
null
null
null
app/src/main/java/org/simple/clinic/home/overdue/OverdueListAdapter.kt
rakshakhegde/simple-android
3250ca834078344841d32347fec7810707f50cf8
[ "MIT" ]
1
2020-10-14T07:09:45.000Z
2020-10-14T07:09:45.000Z
package org.simple.clinic.home.overdue import android.support.v7.recyclerview.extensions.ListAdapter import android.support.v7.util.DiffUtil import android.support.v7.widget.RecyclerView import android.view.LayoutInflater import android.view.View import android.view.View.GONE import android.view.View.VISIBLE import android.view.ViewGroup import android.widget.ImageButton import android.widget.LinearLayout import android.widget.TextView import io.reactivex.subjects.PublishSubject import kotterknife.bindView import org.simple.clinic.R import org.simple.clinic.patient.Gender import org.simple.clinic.widgets.UiEvent import org.simple.clinic.widgets.locationRectOnScreen import org.simple.clinic.widgets.marginLayoutParams import org.simple.clinic.widgets.setCompoundDrawableStart import java.util.UUID import javax.inject.Inject class OverdueListAdapter @Inject constructor() : ListAdapter<OverdueListItem, OverdueListViewHolder>(OverdueListDiffer()) { private lateinit var recyclerView: RecyclerView val itemClicks = PublishSubject.create<UiEvent>()!! override fun onAttachedToRecyclerView(rv: RecyclerView) { super.onAttachedToRecyclerView(rv) recyclerView = rv } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): OverdueListViewHolder { val layout = LayoutInflater.from(parent.context).inflate(R.layout.item_overdue_list, parent, false) val holder = OverdueListViewHolder(layout, itemClicks) layout.setOnClickListener { holder.toggleBottomLayoutVisibility() holder.togglePhoneNumberViewVisibility() holder.itemView.post { val itemLocation = holder.itemView.locationRectOnScreen() val itemBottomWithMargin = itemLocation.bottom + holder.itemView.marginLayoutParams.bottomMargin val rvLocation = recyclerView.locationRectOnScreen() val differenceInBottoms = itemBottomWithMargin - rvLocation.bottom if (differenceInBottoms > 0) { (holder.itemView.parent as RecyclerView).smoothScrollBy(0, differenceInBottoms) } } } return holder } override fun onBindViewHolder(holder: OverdueListViewHolder, position: Int) { holder.appointment = getItem(position) holder.render() } } data class OverdueListItem( val appointmentUuid: UUID, val patientUuid: UUID, val name: String, val gender: Gender, val age: Int, val phoneNumber: String? = null, val bpSystolic: Int, val bpDiastolic: Int, val bpDaysAgo: Int, val overdueDays: Int, val isAtHighRisk: Boolean ) class OverdueListViewHolder( itemView: View, private val eventStream: PublishSubject<UiEvent> ) : RecyclerView.ViewHolder(itemView) { private val patientNameTextView by bindView<TextView>(R.id.overdue_patient_name_age) private val patientBPTextView by bindView<TextView>(R.id.overdue_patient_bp) private val overdueDaysTextView by bindView<TextView>(R.id.overdue_days) private val isAtHighRiskTextView by bindView<TextView>(R.id.overdue_high_risk_label) private val callButton by bindView<ImageButton>(R.id.overdue_patient_call) private val actionsContainer by bindView<LinearLayout>(R.id.overdue_actions_container) private val phoneNumberTextView by bindView<TextView>(R.id.overdue_patient_phone_number) private val agreedToVisitTextView by bindView<TextView>(R.id.overdue_agreed_to_visit) private val remindLaterTextView by bindView<TextView>(R.id.overdue_reminder_later) private val removeFromListTextView by bindView<TextView>(R.id.overdue_remove_from_list) lateinit var appointment: OverdueListItem init { callButton.setOnClickListener { eventStream.onNext(CallPatientClicked(appointment.phoneNumber!!)) } agreedToVisitTextView.setOnClickListener { eventStream.onNext(AgreedToVisitClicked(appointment.appointmentUuid)) } remindLaterTextView.setOnClickListener { eventStream.onNext(RemindToCallLaterClicked(appointment.appointmentUuid)) } removeFromListTextView.setOnClickListener { eventStream.onNext(RemoveFromListClicked(appointment.appointmentUuid, appointment.patientUuid)) } } fun toggleBottomLayoutVisibility() { val isVisible = actionsContainer.visibility == VISIBLE actionsContainer.visibility = if (isVisible) { GONE } else { eventStream.onNext(AppointmentExpanded(appointment.patientUuid)) VISIBLE } } fun togglePhoneNumberViewVisibility() { val isVisible = phoneNumberTextView.visibility == VISIBLE if (!isVisible && appointment.phoneNumber != null) { phoneNumberTextView.visibility = VISIBLE } else { phoneNumberTextView.visibility = GONE } } fun render() { val context = itemView.context patientNameTextView.text = context.getString(R.string.overdue_list_item_name_age, appointment.name, appointment.age) patientNameTextView.setCompoundDrawableStart(appointment.gender.displayIconRes) patientBPTextView.text = context.resources.getQuantityString( R.plurals.overdue_list_item_patient_bp, appointment.bpDaysAgo, appointment.bpSystolic, appointment.bpDiastolic, appointment.bpDaysAgo ) callButton.visibility = if (appointment.phoneNumber == null) GONE else VISIBLE phoneNumberTextView.text = appointment.phoneNumber isAtHighRiskTextView.visibility = if (appointment.isAtHighRisk) VISIBLE else GONE overdueDaysTextView.text = context.resources.getQuantityString( R.plurals.overdue_list_item_overdue_days, appointment.overdueDays, appointment.overdueDays ) } } class OverdueListDiffer : DiffUtil.ItemCallback<OverdueListItem>() { override fun areItemsTheSame(oldItem: OverdueListItem, newItem: OverdueListItem): Boolean = oldItem.appointmentUuid == newItem.appointmentUuid override fun areContentsTheSame(oldItem: OverdueListItem, newItem: OverdueListItem): Boolean = oldItem == newItem }
35.993976
144
0.772218
2dc53118fe360517514cb602c72f42b14d45f9ec
26,284
html
HTML
components.html
linxfather/html_template_KnowledgeBase
ae4de8e16576cd255990593faaa670521a1dbe23
[ "MIT" ]
null
null
null
components.html
linxfather/html_template_KnowledgeBase
ae4de8e16576cd255990593faaa670521a1dbe23
[ "MIT" ]
null
null
null
components.html
linxfather/html_template_KnowledgeBase
ae4de8e16576cd255990593faaa670521a1dbe23
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html lang="en-gb" dir="ltr"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Components - Knowledge Base HTML Template</title> <!-- BEGIN HEAD --> <link rel="icon" href="assets/img/favicon.png" type="image/x-icon"> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600" rel="stylesheet"> <script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.1/js/uikit.min.js" integrity="sha512-whGw5WyVGTL2hCfAsWtHgNEhuozRh8zBM4z2vH8TLpzkdWwGVCooZXl+pSdpTan7ivLpji9EAkpV8V9siSuL5w==" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.1/js/uikit-icons.min.js" integrity="sha512-z+dL8lLzE/3/A69RNyWsmShCTLuI1OxCI0hmi1il7hP01lDF1PCy7LCm5YU95zwF+iYAuBeeVM+bQf24My2+Bw==" crossorigin="anonymous"></script> <link rel="stylesheet" href="assets/css/main.css" /> <!-- END HEAD --> </head> <body> <nav class="uk-navbar-container uk-margin uk-navbar-transparent uk-background-primary uk-light uk-margin-remove-bottom"> <div class="uk-container"> <div uk-navbar> <div class="uk-navbar-left"> <a class="uk-navbar-item uk-logo uk-text-uppercase" href="index.html"><span class="uk-margin-small-right" uk-icon="icon: lifesaver"></span> Knowledge</a> </div> <div class="uk-navbar-right"> <ul class="uk-navbar-nav uk-text-uppercase uk-visible@m uk-margin-medium-left"> <li><a href="index.html">Home</a></li> <li> <a href="article.html">Article</a> <div class="uk-navbar-dropdown"> <ul class="uk-nav uk-navbar-dropdown-nav"> <li><a href="article.html">Scrollspy</a></li> <li><a href="article-narrow.html">Narrow</a></li> </ul> </div> </li> <li><a href="faq.html">Faq</a></li> <li><a href="contact.html">Contact</a></li> <li><a href="components.html">Components</a></li> </ul> <a class="uk-navbar-toggle uk-hidden@m" href="#offcanvas" uk-navbar-toggle-icon uk-toggle></a> </div> </div> </div> </nav> <div class="uk-section section-sub-nav uk-padding-remove"> <div class="uk-container"> <div uk-grid> <div class="uk-width-2-3@m"> <ul class="uk-breadcrumb uk-visible@m"> <li><a href="index.html">Home</a></li> <li><a href="category.html">Administration</a></li> <li><span href="">How to setup payment gateways</span></li> </ul> </div> <div class="uk-width-1-3@m"> <div class="uk-margin"> <form class="uk-search uk-search-default"> <a href="" class="uk-search-icon-flip" uk-search-icon></a> <input id="autocomplete" class="uk-search-input" type="search" autocomplete="off" placeholder="Search"> </form> </div> </div> </div> <div class="border-top"></div> </div> </div> <div class="uk-section uk-section-small uk-padding-remove-bottom section-content"> <div class="uk-container container-xs"> <article class="uk-article"> <header> <h1 class="uk-article-title uk-margin-bottom">Components</h1> </header> <div class="entry-content uk-margin-medium-top"> <h2 class="uk-margin-medium-bottom"> Alerts </h2> <div uk-alert> <a class="uk-alert-close" uk-close></a> <h3>Notice</h3> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </div> <div class="uk-alert-primary" uk-alert> <a class="uk-alert-close" uk-close></a> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.</p> </div> <div class="uk-alert-success" uk-alert> <a class="uk-alert-close" uk-close></a> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.</p> </div> <div class="uk-alert-warning" uk-alert> <a class="uk-alert-close" uk-close></a> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.</p> </div> <div class="uk-alert-danger" uk-alert> <a class="uk-alert-close" uk-close></a> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.</p> </div> <h2 class="uk-margin-medium-bottom"> Label </h2> <span class="uk-label">Default</span> <span class="uk-label uk-label-success">Success</span> <span class="uk-label uk-label-warning">Warning</span> <span class="uk-label uk-label-danger">Danger</span> <h2 class="uk-margin-medium-bottom"> Badge </h2> <span class="uk-badge">1</span> <span class="uk-badge">100</span> <span class="uk-badge">Lorem</span> <h2 class="uk-margin-medium-bottom"> Table </h2> <table class="uk-table uk-table-hover"> <thead> <tr> <th>Table Heading</th> <th>Table Heading</th> <th>Table Heading</th> </tr> </thead> <tbody> <tr> <td>Table Data</td> <td>Table Data</td> <td>Table Data</td> </tr> <tr> <td>Table Data</td> <td>Table Data</td> <td>Table Data</td> </tr> <tr> <td>Table Data</td> <td>Table Data</td> <td>Table Data</td> </tr> </tbody> </table> <table class="uk-table uk-table-striped"> <thead> <tr> <th>Table Heading</th> <th>Table Heading</th> <th>Table Heading</th> </tr> </thead> <tbody> <tr> <td>Table Data</td> <td>Table Data</td> <td>Table Data</td> </tr> <tr> <td>Table Data</td> <td>Table Data</td> <td>Table Data</td> </tr> <tr> <td>Table Data</td> <td>Table Data</td> <td>Table Data</td> </tr> </tbody> </table> <h2 class="uk-margin-medium-bottom"> Tabset </h2> <ul uk-tab> <li class="uk-active"><a href="#">Left</a></li> <li><a href="#">Item</a></li> <li><a href="#">Item</a></li> </ul> <h2 class="uk-margin-medium-bottom"> Tooltip </h2> <p uk-margin> <button class="uk-button uk-button-default" title="Hello World" uk-tooltip>Top</button> <button class="uk-button uk-button-default" title="Hello World" uk-tooltip="pos: top-left">Top Left</button> <button class="uk-button uk-button-default" title="Hello World" uk-tooltip="pos: top-right">Top Right</button> <button class="uk-button uk-button-default" title="Hello World" uk-tooltip="pos: bottom">Bottom</button> <button class="uk-button uk-button-default" title="Hello World" uk-tooltip="pos: bottom-left">Bottom Left</button> <button class="uk-button uk-button-default" title="Hello World" uk-tooltip="pos: bottom-right">Bottom Right</button> <button class="uk-button uk-button-default" title="Hello World" uk-tooltip="pos: left">Left</button> <button class="uk-button uk-button-default" title="Hello World" uk-tooltip="pos: right">Right</button> </p> <h2 class="uk-margin-medium-bottom"> Button </h2> <p uk-margin> <button class="uk-button uk-button-small uk-button-default">Default</button> <button class="uk-button uk-button-small uk-button-primary">Primary</button> <button class="uk-button uk-button-small uk-button-secondary">Secondary</button> <button class="uk-button uk-button-small uk-button-danger">Danger</button> </p> <p uk-margin> <button class="uk-button uk-button-default">Default</button> <button class="uk-button uk-button-primary">Primary</button> <button class="uk-button uk-button-secondary">Secondary</button> <button class="uk-button uk-button-danger">Danger</button> </p> <p uk-margin> <button class="uk-button uk-button-large uk-button-default">Default</button> <button class="uk-button uk-button-large uk-button-primary">Primary</button> <button class="uk-button uk-button-large uk-button-secondary">Secondary</button> <button class="uk-button uk-button-large uk-button-danger">Danger</button> </p> <h2 class="uk-margin-medium-bottom"> Accordion </h2> <ul uk-accordion> <li class="uk-open"> <h3 class="uk-accordion-title">Item 1</h3> <div class="uk-accordion-content"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </div> </li> <li> <h3 class="uk-accordion-title">Item 2</h3> <div class="uk-accordion-content"> <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor reprehenderit.</p> </div> </li> <li> <h3 class="uk-accordion-title">Item 3</h3> <div class="uk-accordion-content"> <p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat proident.</p> </div> </li> </ul> <h2 class="uk-margin-medium-bottom"> Icon </h2> <ul class="uk-grid-small uk-flex-middle" uk-grid> <!-- App --> <li><span uk-icon="icon: home"></span></li> <li><span uk-icon="icon: sign-out"></span></li> <li><span uk-icon="icon: sign-in"></span></li> <li><span uk-icon="icon: user"></span></li> <li><span uk-icon="icon: users"></span></li> <li><span uk-icon="icon: lock"></span></li> <li><span uk-icon="icon: unlock"></span></li> <li><span uk-icon="icon: settings"></span></li> <li><span uk-icon="icon: cog"></span></li> <li><span uk-icon="icon: nut"></span></li> <li><span uk-icon="icon: comment"></span></li> <li><span uk-icon="icon: commenting"></span></li> <li><span uk-icon="icon: comments"></span></li> <li><span uk-icon="icon: hashtag"></span></li> <li><span uk-icon="icon: tag"></span></li> <li><span uk-icon="icon: cart"></span></li> <li><span uk-icon="icon: credit-card"></span></li> <li><span uk-icon="icon: mail"></span></li> <li><span uk-icon="icon: search"></span></li> <li><span uk-icon="icon: location"></span></li> <li><span uk-icon="icon: bookmark"></span></li> <li><span uk-icon="icon: code"></span></li> <li><span uk-icon="icon: paint-bucket"></span></li> <li><span uk-icon="icon: camera"></span></li> <li><span uk-icon="icon: bell"></span></li> <li><span uk-icon="icon: bolt"></span></li> <li><span uk-icon="icon: star"></span></li> <li><span uk-icon="icon: heart"></span></li> <li><span uk-icon="icon: happy"></span></li> <li><span uk-icon="icon: lifesaver"></span></li> <li><span uk-icon="icon: rss"></span></li> <li><span uk-icon="icon: social"></span></li> <li><span uk-icon="icon: git-branch"></span></li> <li><span uk-icon="icon: git-fork"></span></li> <li><span uk-icon="icon: world"></span></li> <li><span uk-icon="icon: calendar"></span></li> <li><span uk-icon="icon: clock"></span></li> <li><span uk-icon="icon: history"></span></li> <li><span uk-icon="icon: future"></span></li> <li><span uk-icon="icon: pencil"></span></li> <li><span uk-icon="icon: link"></span></li> <li><span uk-icon="icon: trash"></span></li> <li><span uk-icon="icon: move"></span></li> <li><span uk-icon="icon: question"></span></li> <li><span uk-icon="icon: info"></span></li> <li><span uk-icon="icon: warning"></span></li> <li><span uk-icon="icon: image"></span></li> <li><span uk-icon="icon: thumbnails"></span></li> <li><span uk-icon="icon: table"></span></li> <li><span uk-icon="icon: list"></span></li> <li><span uk-icon="icon: menu"></span></li> <li><span uk-icon="icon: grid"></span></li> <li><span uk-icon="icon: more"></span></li> <li><span uk-icon="icon: more-vertical"></span></li> <li><span uk-icon="icon: plus"></span></li> <li><span uk-icon="icon: plus-circle"></span></li> <li><span uk-icon="icon: minus"></span></li> <li><span uk-icon="icon: minus-circle"></span></li> <li><span uk-icon="icon: close"></span></li> <li><span uk-icon="icon: check"></span></li> <li><span uk-icon="icon: ban"></span></li> <li><span uk-icon="icon: refresh"></span></li> <li><span uk-icon="icon: play"></span></li> <li><span uk-icon="icon: play-circle"></span></li> <!-- Devices --> <li><span uk-icon="icon: tv"></span></li> <li><span uk-icon="icon: desktop"></span></li> <li><span uk-icon="icon: laptop"></span></li> <li><span uk-icon="icon: tablet"></span></li> <li><span uk-icon="icon: phone"></span></li> <li><span uk-icon="icon: tablet-landscape"></span></li> <li><span uk-icon="icon: phone-landscape"></span></li> <!-- Storage --> <li><span uk-icon="icon: file"></span></li> <li><span uk-icon="icon: copy"></span></li> <li><span uk-icon="icon: file-edit"></span></li> <li><span uk-icon="icon: folder"></span></li> <li><span uk-icon="icon: album"></span></li> <li><span uk-icon="icon: push"></span></li> <li><span uk-icon="icon: pull"></span></li> <li><span uk-icon="icon: server"></span></li> <li><span uk-icon="icon: database"></span></li> <li><span uk-icon="icon: cloud-upload"></span></li> <li><span uk-icon="icon: cloud-download"></span></li> <li><span uk-icon="icon: download"></span></li> <li><span uk-icon="icon: upload"></span></li> <!-- Direction --> <li><span uk-icon="icon: reply"></span></li> <li><span uk-icon="icon: forward"></span></li> <li><span uk-icon="icon: expand"></span></li> <li><span uk-icon="icon: shrink"></span></li> <li><span uk-icon="icon: arrow-up"></span></li> <li><span uk-icon="icon: arrow-down"></span></li> <li><span uk-icon="icon: arrow-left"></span></li> <li><span uk-icon="icon: arrow-right"></span></li> <li><span uk-icon="icon: chevron-up"></span></li> <li><span uk-icon="icon: chevron-down"></span></li> <li><span uk-icon="icon: chevron-left"></span></li> <li><span uk-icon="icon: chevron-right"></span></li> <li><span uk-icon="icon: triangle-up"></span></li> <li><span uk-icon="icon: triangle-down"></span></li> <li><span uk-icon="icon: triangle-left"></span></li> <li><span uk-icon="icon: triangle-right"></span></li> <!-- Editor --> <li><span uk-icon="icon: bold"></span></li> <li><span uk-icon="icon: italic"></span></li> <li><span uk-icon="icon: strikethrough"></span></li> <li><span uk-icon="icon: video-camera"></span></li> <li><span uk-icon="icon: quote-right"></span></li> <!-- Brands --> <li><span uk-icon="icon: behance"></span></li> <li><span uk-icon="icon: dribbble"></span></li> <li><span uk-icon="icon: facebook"></span></li> <li><span uk-icon="icon: github-alt"></span></li> <li><span uk-icon="icon: github"></span></li> <li><span uk-icon="icon: foursquare"></span></li> <li><span uk-icon="icon: tumblr"></span></li> <li><span uk-icon="icon: whatsapp"></span></li> <li><span uk-icon="icon: soundcloud"></span></li> <li><span uk-icon="icon: flickr"></span></li> <li><span uk-icon="icon: google-plus"></span></li> <li><span uk-icon="icon: google"></span></li> <li><span uk-icon="icon: linkedin"></span></li> <li><span uk-icon="icon: vimeo"></span></li> <li><span uk-icon="icon: instagram"></span></li> <li><span uk-icon="icon: joomla"></span></li> <li><span uk-icon="icon: pagekit"></span></li> <li><span uk-icon="icon: pinterest"></span></li> <li><span uk-icon="icon: twitter"></span></li> <li><span uk-icon="icon: uikit"></span></li> <li><span uk-icon="icon: wordpress"></span></li> <li><span uk-icon="icon: xing"></span></li> <li><span uk-icon="icon: youtube"></span></li> </ul> <h2 class="uk-margin-medium-bottom">Typography</h2> <p class="uk-text-lead">This is a lead text. Aute irure dolor in reprehenderit occaecat cupidatat.</p> <h1> This Is An H1 Tag </h1> <h2> This Is An H2 Tag </h2> <h3> This Is An H3 Tag </h3> <h4> This Is An H4 Tag </h4> <h5> This Is An H5 Tag </h5> </div> </article> </div> </div> <footer id="footer" class="uk-section uk-margin-large-top uk-section-xsmall uk-text-small uk-text-muted border-top"> <div class="uk-container"> <div class="uk-child-width-1-2@m uk-text-center" uk-grid> <div class="uk-text-right@m"> <a href="#" class="uk-icon-link uk-margin-small-right" uk-icon="icon: facebook"></a> <a href="#" class="uk-icon-link uk-margin-small-right" uk-icon="icon: google"></a> <a href="#" class="uk-icon-link uk-margin-small-right" uk-icon="icon: vimeo"></a> <a href="#" class="uk-icon-link uk-margin-small-right" uk-icon="icon: instagram"></a> <a href="#" class="uk-icon-link uk-margin-small-right" uk-icon="icon: twitter"></a> <a href="#" class="uk-icon-link uk-margin-small-right" uk-icon="icon: youtube"></a> </div> <div class="uk-flex-first@m uk-text-left@m"> <p class="uk-text-small">Copyright 2017 Powered by Code Love</p> </div> </div> </div> </footer> <div id="offcanvas" uk-offcanvas="flip: true; overlay: true"> <div class="uk-offcanvas-bar"> <a class="uk-margin-small-bottom uk-logo uk-text-uppercase" href="index.html"><span class="uk-margin-small-right" uk-icon="icon: lifesaver"></span> Knowledge</a> <ul class="uk-nav uk-nav-default uk-text-uppercase"> <li><a href="index.html">Home</a></li> <li class="uk-parent"> <a href="article.html">Article</a> <ul class="uk-nav-sub"> <li><a href="article.html">Scrollspy</a></li> <li><a href="article-narrow.html">Narrow</a></li> </ul> </li> <li><a href="faq.html">Faq</a></li> <li><a href="contact.html">Contact</a></li> <li><a href="components.html">Components</a></li> </ul> <a href="contact.html" class="uk-button uk-button-small uk-button-default uk-width-1-1 uk-margin">Support</a> <div class="uk-width-auto uk-text-center"> <a href="#" class="uk-icon-link uk-margin-small-right" uk-icon="icon: facebook"></a> <a href="#" class="uk-icon-link uk-margin-small-right" uk-icon="icon: google"></a> <a href="#" class="uk-icon-link uk-margin-small-right" uk-icon="icon: twitter"></a> </div> </div> </div> </body> </html>
58.150442
186
0.421169
81c4b6052d9666529e8be19d752a8339632e54eb
6,165
go
Go
pkg/config/proxy_config.go
elastisys/kubeaware-cloudpool-proxy
a43efa357a6ae26015896883630e31276fdd0b65
[ "Apache-2.0" ]
7
2017-10-25T13:42:41.000Z
2019-02-26T07:37:03.000Z
pkg/config/proxy_config.go
elastisys/kubeaware-cloudpool-proxy
a43efa357a6ae26015896883630e31276fdd0b65
[ "Apache-2.0" ]
null
null
null
pkg/config/proxy_config.go
elastisys/kubeaware-cloudpool-proxy
a43efa357a6ae26015896883630e31276fdd0b65
[ "Apache-2.0" ]
null
null
null
package config import ( "encoding/json" "fmt" "net/url" "time" ) const ( // DefaultServerTimeout is the default client request timeout used by the proxy server. DefaultServerTimeout = 60 * time.Second // DefaultBackendTimeout is the default timeout to use when connecting to the backend cloudpool. // Uses a rather conservative timeout since some cloudprovider operations may be quite // time-consuming (e.g. terminating a machine in Azure). DefaultBackendTimeout = 300 * time.Second // DefaultAPIServerTimeout is the default client timeout used when connecting to // Kubernetes' API server. DefaultAPIServerTimeout = 60 * time.Second ) // Config describes the overall configuration of the proxy. type ProxyConfig struct { APIServer APIServerConfig `json:"apiServer"` Backend BackendConfig `json:"backend"` Server ServerConfig `json:"server"` } // Validate validates the presence of all mandatory fields of a Config. func (config *ProxyConfig) Validate() error { if err := config.APIServer.Validate(); err != nil { return fmt.Errorf("proxy config: %s", err) } if err := config.Backend.Validate(); err != nil { return fmt.Errorf("proxy config: backend: %s", err) } if err := config.Server.Validate(); err != nil { return fmt.Errorf("proxy config: server: %s", err) } return nil } func (config *ProxyConfig) String() string { bytes, _ := json.MarshalIndent(config, "", " ") return string(bytes) } // APIServerConfig describes which Kubernetes API server to connect to and which credentials to use. type APIServerConfig struct { // URL is the base address used to contact the API server. For example, https://master:6443 URL string `json:"url"` Auth APIServerAuthConfig `json:"auth"` // Timeout is the connection timeout to use when contacting the backend. Timeout Duration `json:"timeout"` } // APIServerAuthConfig represents credentials used to authenticate against the Kubernetes API server. type APIServerAuthConfig struct { // KubeConfigPath is a file system path to a kubeconfig file, the type of // configuration file that is used by `kubectl`. When specified, any other // auth fields are ignored (as they are all included in the kubeconfig). // The kubeconfig must contain cluster credentials for a cluster with the // specified API server URL. KubeConfigPath string `json:"kubeConfigPath"` // ClientCertPath is a file system path to a pem-encoded API server client/admin cert. // Ignored if KubeConfigPath is specified. ClientCertPath string `json:"clientCertPath"` // ClientKeyPath is a file system path to a pem-encoded API server client/admin key. // Ignored if KubeConfigPath is specified. ClientKeyPath string `json:"clientKeyPath"` // CACertPath is a file system path to a pem-encoded CA cert for the API server. // Ignored if KubeConfigPath is specified. CACertPath string `json:"caCertPath"` } // BackendConfig represents the backend cloudpool that the proxy sits in front of. type BackendConfig struct { // URL is the base URL where the cloudpool REST API can be reached. For example, http://pool:9010. URL string `json:"url"` // Timeout is the connection timeout to use when contacting the backend. Timeout Duration `json:"timeout"` } // ServerConfig carries configuration for the proxy server itself. type ServerConfig struct { // timeout is the client request timeout used by the proxy server. It defines the // maximum duration for reading an entire client request, including the body. Timeout Duration `json:"timeout"` } // NewFromJSON creates and validates a ProxyConfig from raw JSON format. func NewFromJSON(rawJSON []byte) (*ProxyConfig, error) { var config ProxyConfig err := json.Unmarshal(rawJSON, &config) if err != nil { return nil, fmt.Errorf("failed to parse proxy config: %s", err) } if err = config.Validate(); err != nil { return nil, fmt.Errorf("invalid proxy configuration: %s", err) } // populate defaults if config.Server.Timeout.Duration == 0*time.Second { config.Server.Timeout = Duration{DefaultServerTimeout} } if config.APIServer.Timeout.Duration == 0*time.Second { config.APIServer.Timeout = Duration{DefaultAPIServerTimeout} } if config.Backend.Timeout.Duration == 0*time.Second { config.Backend.Timeout = Duration{DefaultBackendTimeout} } return &config, nil } // Validate validates the presence of mandatory values in an APIServerConfig func (config *APIServerConfig) Validate() error { if config.URL == "" { return fmt.Errorf("apiServer: missing field: url") } if _, err := url.Parse(config.URL); err != nil { return fmt.Errorf("apiServer: url: %s", err) } if err := config.Auth.Validate(); err != nil { return fmt.Errorf("apiServer: auth: %s", err) } return nil } // Validate validates the presence of mandatory values in an APIServerAuthConfig func (config *APIServerAuthConfig) Validate() error { if config.KubeConfigPath != "" { return nil } if config.ClientCertPath == "" { return fmt.Errorf("missing value: clientCertPath") } if config.ClientKeyPath == "" { return fmt.Errorf("missing value: clientKeyPath") } if config.CACertPath == "" { return fmt.Errorf("missing value: caCertPath") } return nil } // Validate validates the presence of mandatory values in an BackendConfig func (config *BackendConfig) Validate() error { if config.URL == "" { return fmt.Errorf("backend: missing field: url") } if _, err := url.Parse(config.URL); err != nil { return fmt.Errorf("backend: url: %s", err) } return nil } // Validate validates the presence of mandatory values in a ServerConfig func (c *ServerConfig) Validate() error { return nil } // Duration is a wrapper type for JSON (un)marshalling of time.Duration type Duration struct { time.Duration } // UnmarshalJSON implements the json.Unmarshaler interface for Duration. func (d *Duration) UnmarshalJSON(b []byte) (err error) { sd := string(b[1 : len(b)-1]) d.Duration, err = time.ParseDuration(sd) return } // MarshalJSON implements the json.Marshaler interface for Duration. func (d Duration) MarshalJSON() (b []byte, err error) { return []byte(fmt.Sprintf(`"%s"`, d.String())), nil }
33.145161
101
0.732685
93facec8e714e4962bcd335da876ed7bde0a1827
177
sql
SQL
DMD/HW4/4.sql
abcdw/inno
91cfa1b2dac74f2015d69ed8df425ab8f2e5c4f2
[ "MIT" ]
4
2015-10-03T10:15:40.000Z
2015-10-10T14:36:11.000Z
DMD/HW4/4.sql
abcdw/inno
91cfa1b2dac74f2015d69ed8df425ab8f2e5c4f2
[ "MIT" ]
null
null
null
DMD/HW4/4.sql
abcdw/inno
91cfa1b2dac74f2015d69ed8df425ab8f2e5c4f2
[ "MIT" ]
2
2015-09-06T12:20:53.000Z
2018-03-05T03:28:49.000Z
SELECT COUNT(*), s.SupplierName FROM Inventory AS i JOIN MovieSupplier AS ms ON ms.movieid = i.movieid JOIN Suppliers AS s ON ms.supplierid = s.supplierid GROUP BY s.supplierid
35.4
51
0.785311
f3292380acc442aca7c9f0f78f5a22847929296b
479
ps1
PowerShell
Build/Tasks/Publish.tasks.ps1
joshwright10/PSc.CloudDNS
558c27b8cc4db43ef7efb0f5b5a0f245c6f4d583
[ "MIT" ]
null
null
null
Build/Tasks/Publish.tasks.ps1
joshwright10/PSc.CloudDNS
558c27b8cc4db43ef7efb0f5b5a0f245c6f4d583
[ "MIT" ]
null
null
null
Build/Tasks/Publish.tasks.ps1
joshwright10/PSc.CloudDNS
558c27b8cc4db43ef7efb0f5b5a0f245c6f4d583
[ "MIT" ]
null
null
null
<# Publish module to PowerShell Gallery #> task Publish -If (${env:BUILDRELEASE} -eq "Release") { try { $params = @{ Path = "$env:BHProjectPath\$Env:BHProjectName" NuGetApiKey = ${env:PSGALLERYKEY} ErrorAction = 'Stop' } Publish-Module @params Write-Output -InputObject "$($env:BHProjectName) PowerShell Module version published to the PowerShell Gallery!" } catch { throw $_ } }
26.611111
120
0.578288
1437aa35e153e452851db595ba975cf22320defb
1,026
css
CSS
public/css/admin.css
louispocheron/test_test
94aa4122c80cde3462a25e8caea0a771ca2e3e72
[ "Apache-2.0" ]
null
null
null
public/css/admin.css
louispocheron/test_test
94aa4122c80cde3462a25e8caea0a771ca2e3e72
[ "Apache-2.0" ]
null
null
null
public/css/admin.css
louispocheron/test_test
94aa4122c80cde3462a25e8caea0a771ca2e3e72
[ "Apache-2.0" ]
null
null
null
main{ width: 100%; height: 100%; } .assoc-pres{ margin-top: 1rem; } .assoc-name{ font-size: 1.5rem; } .table{ width: 100%; border-collapse: collapse; display: flex; flex-direction: row; justify-content: center; padding: 1rem; } .assoc-container{ display: flex; justify-content: center; align-items: center; flex-direction: column; } .assoc-logo{ width: 5rem; } .table td, .table th{ border: 1px solid #ddd; padding: 8px; } .table tr:nth-child(even){ background-color: #f2f2f2; } .table th{ padding-top: 12px; padding-bottom: 12px; text-align: left; background-color: #152149; color: white; font-size: 15px; font-weight: 400; } .table tr:hover{ background-color: #ddd; cursor: pointer; } .table td:last-child{ text-align: center; } .table td a{ color: red !important; } .table td a:hover{ color: #152149 !important; } h3{ text-align: center; }
17.1
31
0.577973
94a6d5c0301d8fbfa779c1f8bd0f7ddd4d60b1e9
1,547
sql
SQL
core/db_estructura/simple_seguridad.sql
josuemora/simple
dbee4ed8408f0d60708ff7a2f9740903a1e15eec
[ "MIT" ]
null
null
null
core/db_estructura/simple_seguridad.sql
josuemora/simple
dbee4ed8408f0d60708ff7a2f9740903a1e15eec
[ "MIT" ]
null
null
null
core/db_estructura/simple_seguridad.sql
josuemora/simple
dbee4ed8408f0d60708ff7a2f9740903a1e15eec
[ "MIT" ]
null
null
null
create database if not exists simple_seguridad; use simple_seguridad; create table if not exists perfiles ( id int not null AUTO_INCREMENT, nombre varchar(50) not null, PRIMARY KEY (id), UNIQUE KEY nombre (nombre) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE if not exists usuarios ( id int NOT NULL AUTO_INCREMENT, nombre varchar(50) NOT NULL, clave varchar(50) NOT NULL, tema varchar(50) NOT NULL, perfiles_id int not null, PRIMARY KEY (id), UNIQUE KEY nombre (nombre), CONSTRAINT usuarios_ibfk_1 FOREIGN KEY (perfiles_id) REFERENCES perfiles(id) ON DELETE NO ACTION ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE if not exists accesos ( id int NOT NULL AUTO_INCREMENT, perfiles_id int not null, permisos varchar(1000) NOT NULL, PRIMARY KEY (id), UNIQUE KEY idx_accesos_1 (perfiles_id), CONSTRAINT accesos_ibfk_1 FOREIGN KEY (perfiles_id) REFERENCES perfiles(id) ON DELETE NO ACTION ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; insert into perfiles (nombre) values ('Administrador'); insert into usuarios (nombre,clave,perfiles_id) values ('Administrador',md5('simple'),1); /* create table if not exists accesos ( id int not null AUTO_INCREMENT, appid varchar(50) not null, perfiles_id int not null, permiso varchar(200) not null default '', PRIMARY KEY (id), UNIQUE KEY idx_accesos_1 (appid,perfiles_id,permiso) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; */
29.75
115
0.7117
d81199e1c97a964eb3ea42e9616b94094eaa5df8
1,955
sql
SQL
src/main/resources/db/migration/V0.7__document.sql
ppudgy/vertex-backend
275fd03b3ba82ba26cd5322c4a19a77d33b93706
[ "Apache-2.0" ]
null
null
null
src/main/resources/db/migration/V0.7__document.sql
ppudgy/vertex-backend
275fd03b3ba82ba26cd5322c4a19a77d33b93706
[ "Apache-2.0" ]
null
null
null
src/main/resources/db/migration/V0.7__document.sql
ppudgy/vertex-backend
275fd03b3ba82ba26cd5322c4a19a77d33b93706
[ "Apache-2.0" ]
null
null
null
-- Файл создания базы данных проекта "apex" -- project: apex -- file: document.psql.sql -- user: pudgy -- time: 4.04.2015 create table document( id uuid not null, -- 32 - длина строки UUID в hex представлении origin timestamp not null default current_timestamp, schemata uuid not null, name varchar(1024) not null, date timestamp not null, purpose uuid not null, location varchar(1024), text varchar(32000), mime varchar(256), treated boolean, file bytea, --blob, constraint document_pk primary key (id), constraint document_unique unique (schemata, name, date), constraint document_schema_fk foreign key (schemata) references schemata (id), constraint autotodo_purpose_fk foreign key (purpose) references purpose (id) ); create table fragment( id uuid not null, origin timestamp not null default current_timestamp, schemata uuid not null, name varchar(1024) not null, document uuid not null, text varchar(32000), posstart integer, posend integer, constraint FRAGMENT_PK primary key (id), constraint fragment_unique unique (schemata, name, document), constraint FRAGMENT_DOCUMENT foreign key (document) references document(id) ); create table fragmenttopic( fragment uuid not null, topic uuid not null, constraint fragmenttopic_pk primary key (fragment, topic), constraint fragmenttopic_fragment_fk foreign key (fragment) references fragment (id), constraint fragmenttopic_topic_fk foreign key (topic) references topic (id) ); create table fragmentperson( fragment uuid not null, person uuid not null, constraint fragmentperson_pk primary key (fragment, person), constraint fragmentperson_fragment_fk foreign key (fragment) references fragment (id), constraint fragmentperson_person_fk foreign key (person) references person (id) );
34.298246
90
0.711509
dc18aa903f1fb0fb973223a365058d9c3399bbb8
20,170
lua
Lua
garrysmod/addons/anti-family-sharing/garrysmod/lua/autorun/familysharing.lua
BucketSanders/necessary-addons-gmod
a5949604bd5598d25a637afd7712925b4647c9e8
[ "MIT" ]
8
2018-11-20T18:18:07.000Z
2021-04-30T15:36:26.000Z
garrysmod/addons/anti-family-sharing/garrysmod/lua/autorun/familysharing.lua
BucketSanders/necessary-addons-gmod
a5949604bd5598d25a637afd7712925b4647c9e8
[ "MIT" ]
2
2019-01-11T03:15:42.000Z
2019-01-16T17:45:48.000Z
garrysmod/addons/anti-family-sharing/garrysmod/lua/autorun/familysharing.lua
BucketSanders/necessary-addons-gmod
a5949604bd5598d25a637afd7712925b4647c9e8
[ "MIT" ]
5
2018-10-20T17:50:17.000Z
2021-10-09T06:38:31.000Z
if SERVER then --If SERVER statement to ensure the following code stays server side. --[[ Credits : C0nw0nk Github : https://github.com/C0nw0nk/Garrys-Mod-Family-Sharing Info : This script will make it very hard for users who you ban from your server to return or bypass their current/existing bans. When you ban a user it will also ban the account that owns Garry's Mod / has family shared them the game. Because of the way this script works you can guarantee when you ban someone they have to buy a new Garry's Mod to be able to return. (Keep wasting your money. I am sure Garry does not mind you making him richer.) Depending on the settings you assign you may also ban users by IP too what will make it harder for the banned user to return. ]] --APIKey required to deal with those family sharing. --You may obtain your Steam API Key from here | http://steamcommunity.com/dev/apikey APIKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" --The message displayed to those who connect by a family shared account that has been banned. kickmessage = "The account that lent you Garry's Mod is banned on this server" --Ban those who try to bypass a current ban by returning on a family shared account. --Set true to enable | false to disable. --If this is set to false it will only kick those bypassing bans. banbypass = true --The length to ban those who are trying to bypass a current / existing ban. --This will also increase/change the ban length on the account that owns Garry's Mod. (They shouldn't attempt to bypass a current ban.) --time is in minutes. --0 is permanent. banlength = 0 --The reason the player has been banned automaticly for connecting from a family shared account that already has a ban. banreason = "attempting to bypass a current/existing ban." --Enable banning users by IP address too. --Makes it even harder for continuous offenders to return to the server. --Set true to enable | false to disable. banip = true --Enable blocking anyone joining on a family shared account regardless if they are banned or not. --Enabling this will allow only accounts that have bought and own Garry's Mod to join. --Set true to enable | false to disable. blockfamilysharing = false --The message to display to those who have been blocked by "blockfamilysharing". blockfamilysharingmessage = "Please connect to the server by a account that own's Garry's Mod." --Extra Ban Checks will ban users IP addresses who connect to the server if their SteamID is in the ban list --and their IP is not already banned. --Set true to enable | false to disable. extra_ban_checks = true --Makes the default ULX banned message more informative and pretty. --Set true to enable | false to disable. informative_ban_message = true --The custom banned message to display to those who are banned. --\n is for a new line. custom_ban_message = "You're banned! \n\n Visit www.your-site.com to appeal it." --Configuration for the ban tracker. --Set file name path and file type to track players who get banned. --(This will help us prevent banned players buying new Garry's Mod(s) in order to come back.) --I recommend having this different to what is set in this script so your server is unique and uses its own path. --The folder we will create and put the file into to make it inconspicuous. --If this is empty = "" then no file path will be set and it will just create in a root folder. storage_path = "models/" --Always keep a forward slash if you set a directory or folder. --The file types you can choose are ".txt", ".jpg", ".png", ".dat" or ".vtf" according to what the GMOD Wiki tells us : https://wiki.garrysmod.com/page/file/Write file_type = ".jpg" --File name can be what ever you want it to be for example "DarkRP" or "License" something inconspicuous. file_name = "player" --End if server statement. end --[[This is a shared setting that both client and server need to read. Because of that this setting is in the shared location not in client code tags and not in server code tags. Both client and server may now read and use this. ]] --Enable or Disable the ban tracker, This is how we track and prevent players who get banned buying a new GMod in order to connect. --Set true to enable | false to disable. local ban_tracker = true --Specify Custom Network string names here so we can control and change them at any time easily. --String name for Server to talk to Client via. local NetworkServerToClient = "ServerToClient" --String name for Client to talk to Server via. local NetworkClientToServer = "ClientToServer" --[[End shared setting]] if SERVER then --If SERVER statement to ensure the following code stays server side. --[[ DO NOT TOUCH ANYTHING BELOW THIS POINT UNLESS YOU KNOW WHAT YOU ARE DOING. ^^^^^ YOU WILL MOST LIKELY BREAK THE SCRIPT SO TO CONFIGURE THE FEATURES YOU WANT JUST USE WHAT I GAVE YOU ABOVE. ^^^^^ THIS BLOCK IS ENTIRELY WRITTEN IN CAPS LOCK TO SHOW YOU HOW SERIOUS I AM. ]] --Function to handle those who connect via family shared steam accounts. local function HandleSharedPlayer(ply, lenderSteamID) --Log to server console who has been detected family sharing. print(string.format("FamilySharing: %s | %s has been lent Garry's Mod by %s", ply:Nick(), ply:SteamID(), lenderSteamID )) --Prevent anyone joining on a family shared account regardless if they are banned or not. if blockfamilysharing == true then ply:Kick(blockfamilysharingmessage) end --End preventing anyone joining on a family shared account regardless if they are banned or not. --Check if ULX is installed. if not (ULib and ULib.bans) then return end --If the lenderSteamID is in the ULX ban list then kick/ban the SteamID they are sharing Garry's Mod with. if ULib.bans[lenderSteamID] then --If banbypass is enabled. if banbypass == true then --Ban the shared account that has connected. RunConsoleCommand("ulx", "banid", ply:SteamID(), banlength, banreason) --Ban the lenderSteamID (The account that owns Garry's mod what is originally banned) or increase their ban. RunConsoleCommand("ulx", "banid", lenderSteamID, banlength, banreason) --else ban bypass is disabled so kick the person bypassing a ban instead. else --Kick the player. ply:Kick(kickmessage) end end end --Function to check players who connect if they are on a family shared account or not. --If they are family sharing they will be passed to the "HandleSharedPlayer" function to decide their fate. local function CheckFamilySharing(ply) --Send request to the SteamDEV API with the SteamID64 of the player who has just connected. http.Fetch( string.format("http://api.steampowered.com/IPlayerService/IsPlayingSharedGame/v0001/?key=%s&format=json&steamid=%s&appid_playing=4000", APIKey, ply:SteamID64() ), function(body) --Put the http response into a table. local body = util.JSONToTable(body) --If the response does not contain the following table items. if not body or not body.response or not body.response.lender_steamid then error(string.format("FamilySharing: Invalid Steam API response for %s | %s\n", ply:Nick(), ply:SteamID())) end --Set the lender to be the lender in our body response table. local lender = body.response.lender_steamid --If the lender is not 0 (Would contain SteamID64). Lender will only ever == 0 if the account owns the game. if lender ~= "0" then --Handle the player that is on a family shared account to decide their fate. HandleSharedPlayer(ply, util.SteamIDFrom64(lender)) end end, function(code) error(string.format("FamilySharing: Failed API call for %s | %s (Error: %s)\n", ply:Nick(), ply:SteamID(), code)) end ) end hook.Add("PlayerAuthed", "CheckFamilySharing", CheckFamilySharing) --Start hooking the ulx ban commands. --This is mandatory because when you ban a player you need to check if they are already on a family shared account or not. --So lets check if the person we are banning is already connected by a family shared account, --that way we can ban both their shared account and the account that owns Garry's Mod. (That will teach them!, You can't outsmart me with your lies.) local function banHook(ply, commandName, translated_args) --If the admin is banning a player. "!ban" in chat or "ulx ban" via console. (Works for !menu bans too.) if string.lower(commandName) == "ulx ban" then --Split up the command into sections. --local admin = translated_args[1] local target = translated_args[2] local time = translated_args[3] local offence = translated_args[4] --If banip is enabled. if banip == true then --Ban the players IP who is trying to bypass a existing ban. RunConsoleCommand("addip", time, target:IPAddress():Split(":")[1]) RunConsoleCommand("writeip") end --Send request to the SteamDEV API with the SteamID64 of the player we are banning. http.Fetch( string.format("http://api.steampowered.com/IPlayerService/IsPlayingSharedGame/v0001/?key=%s&format=json&steamid=%s&appid_playing=4000", APIKey, target:SteamID64() ), function(body) --Put the http response into a table. local body = util.JSONToTable(body) --If the response does not contain the following table items. if not body or not body.response or not body.response.lender_steamid then error(string.format("FamilySharing: Invalid Steam API response for %s | %s\n", target:Nick(), target:SteamID())) end --Set the lender to be the lender in our body response table. local lender = body.response.lender_steamid --If the lender is not 0 (Would contain SteamID64). Lender will only ever == 0 if the account owns the game. if lender ~= "0" then --Lets ban the owners account too. local lenderSteamID = util.SteamIDFrom64(lender) RunConsoleCommand("ulx", "banid", lenderSteamID, time, offence) end end, function(code) error(string.format("FamilySharing: Failed API call for %s | %s (Error: %s)\n", target:Nick(), target:SteamID(), code)) end ) end --If the admin is banning a player. "!banid" in chat or "ulx banid" via console. (Works for !menu bans too.) if string.lower(commandName) == "ulx banid" then --Split up the command into sections. --local admin = translated_args[1] local target = translated_args[2] local time = translated_args[3] local offence = translated_args[4] --If banip is enabled. if banip == true then --Lets check if the SteamID that is getting banned is currently playing on the server. --If they are playing on the server lets ban their IP too. --Get all players currently playing. local plys = player.GetAll() for i=1, #plys do --If a player on the servers SteamID matches with the one getting banned grab their IP too. if plys[i]:SteamID() == target then --Ban the players IP who is trying to bypass a existing ban. RunConsoleCommand("addip", time, plys[i]:IPAddress():Split(":")[1]) RunConsoleCommand("writeip") --break out of the for each. (pointless to go through the rest when we found what we want.) break end end end --Send request to the SteamDEV API with the SteamID64 of the player we are banning. http.Fetch( string.format("http://api.steampowered.com/IPlayerService/IsPlayingSharedGame/v0001/?key=%s&format=json&steamid=%s&appid_playing=4000", APIKey, util.SteamIDTo64(target) ), function(body) --Put the http response into a table. local body = util.JSONToTable(body) --If the response does not contain the following table items. if not body or not body.response or not body.response.lender_steamid then error(string.format("FamilySharing: Invalid Steam API response for %s | %s\n", util.SteamIDTo64(target), target)) end --Set the lender to be the lender in our body response table. local lender = body.response.lender_steamid --If the lender is not 0 (Would contain SteamID64). Lender will only ever == 0 if the account owns the game. if lender ~= "0" then --Lets ban the owners account too. local lenderSteamID = util.SteamIDFrom64(lender) RunConsoleCommand("ulx", "banid", lenderSteamID, time, offence) end end, function(code) error(string.format("FamilySharing: Failed API call for %s | %s (Error: %s)\n", util.SteamIDTo64(target), target, code)) end ) end end hook.Add("ULibPostTranslatedCommand", "BanHook", banHook) --End hooking ulx ban commands. --If informative_ban_message is enabled or extra ban checks are enabled. if informative_ban_message == true or extra_ban_checks == true then --Start IP banned or Steam ID banned check. (Extra checks to prevent players bypassing bans.) hook.Add("CheckPassword", "Extra-BanChecks", function(steamID64, ipAddress) --Check if their SteamID is in the ban list. if ULib.bans[util.SteamIDFrom64(steamID64)] then --Log to server console who has been detected attempting to bypass a existing ban. print(string.format("The following players SteamID: %s | matched with a SteamID in the ban list we are now going to ban their new IP too (Stop trying to bypass bans): %s", util.SteamIDFrom64(steamID64), ipAddress:Split(":")[1] )) --If ban time remaining is less than or equal to 0 then. if tonumber(ULib.bans[util.SteamIDFrom64(steamID64)].unban) <= 0 then --Make the ban length 0 for permanent. banip_length = 0 else --If the ban time remaining is not 0 then make it the time remaining on the users ban. banip_length = math.Round((ULib.bans[util.SteamIDFrom64(steamID64)].unban - os.time())/60) end --If banip is enabled and extra ban checks are enabled. if banip == true and extra_ban_checks == true then --Ban their IP address if it is not already banned. RunConsoleCommand("addip", banip_length, ipAddress:Split(":")[1]) RunConsoleCommand("writeip") end --Show custom you are banned message. --Put the date of our ban into a readable format. local date_of_ban = os.date("%b %d, %Y - %I:%M:%S %p", tonumber(ULib.bans[util.SteamIDFrom64(steamID64)].time)) --Put the date of unbanning the player into a readable format. local date_of_unban = os.date("%b %d, %Y - %I:%M:%S %p", tonumber(ULib.bans[util.SteamIDFrom64(steamID64)].unban)) --Put the time remaining into a format that the player can read. local ban_time_left = math.Round((ULib.bans[util.SteamIDFrom64(steamID64)].unban - os.time())/60) --If ban time remaining is less than or equal to 0 then. if tonumber(ULib.bans[util.SteamIDFrom64(steamID64)].unban) <= 0 then --Set the displayed information for the player to read. date_of_unban = "Never." ban_time_left = "None, You are banned permanently." end --If informative_ban_message is enabled. if informative_ban_message == true then --Show our nicely detailed you are banned informative message. return false, ""..custom_ban_message.."\n\nDate of Ban : "..date_of_ban.."\n\nDate of Unban : "..date_of_unban.."\n\nTime left minute(s) : "..ban_time_left.."" else --Show the default you are banned message. return false, "You have been banned from this server." end end --If extra ban checks are enabled. if extra_ban_checks == true then --Check if their IP address is in the ban list. if file.Exists("cfg/banned_ip.cfg", "GAME") then --Read the banned ip file. local input = file.Read("cfg/banned_ip.cfg", "GAME") --Put all banned ip's into a table separate each by a new line. local data = string.Explode("\n", input) --For each ip check if it matches with the ip connecting to the server. for i=1, #data do --If the ip in the banned_ip list matches with the ip connecting to the server then. if data[i]:Split(" ")[3] == ipAddress:Split(":")[1] then --Log to server console who has been detected attempting to bypass a existing ban. print(string.format("The following players IP: %s | matched with %s in the IP ban list we are banning their new SteamID too (Stop trying to bypass bans): %s", ipAddress:Split(":")[1], data[i]:Split(" ")[3], util.SteamIDFrom64(steamID64) )) --Ban the SteamID of the account connecting too. length of ban depends on what the IP ban length is set to. (data[i]:Split(" ")[2]) RunConsoleCommand("ulx", "banid", util.SteamIDFrom64(steamID64), data[i]:Split(" ")[2], banreason) --Show the default you are banned message. return false, "You have been banned from this server." end end end end end) --End extra ban checks. end --End If server statement end --Ban tracker. --If ban tracker config is enabled then run the following code. if ban_tracker == true then --Lets stop those players from rejoining when banned regardless if they buy a new Garry's Mod or not with a secret weapon. --(I can be a sneaky devil.) if SERVER then --Create our Network String to communicate with the player over. util.AddNetworkString(NetworkServerToClient) --Create our Network String to communicate with the server over. util.AddNetworkString(NetworkClientToServer) --Receive our message from the client. net.Receive(NetworkClientToServer, function(length, player) --If the account in the net.ReadString() that the client just sent us is banned. --Convert the string to a SteamID util.SteamIDFrom64(net.ReadString()) local clientsteamidfromfile = net.ReadString() --Ignore admins and check if the steamid is in the banlist. if !player:IsAdmin() and ULib.bans[util.SteamIDFrom64(clientsteamidfromfile)] then --Log to server console who has been detected attempting to bypass a existing ban. print(string.format("The following SteamID: %s | matched with a SteamID in the ban list we are now going to ban their new account too (Stop trying to bypass bans): %s", util.SteamIDFrom64(clientsteamidfromfile), player:SteamID() )) --Ban the player who just sent the message. RunConsoleCommand("ulx", "banid", player:SteamID(), banlength, banreason) --Increase the ban on their original steam account. RunConsoleCommand("ulx", "banid", util.SteamIDFrom64(clientsteamidfromfile), banlength, banreason) end end) --When the player connects and is authenticated Send a message from the server to them. hook.Add("PlayerAuthed", "PlayerAuthed-NetSend", function(player) --Begin communications with CLIENT. net.Start(NetworkServerToClient) --Send SteamID. net.WriteString(player:SteamID64()) --Send file_name. net.WriteString(file_name) --Send file_type. net.WriteString(file_type) --Send storage_path. net.WriteString(storage_path) --Send to player that we just authenticated. net.Send(player) end) --Else if CLIENT this is the code the client gets access to. else --Receive the message from the server's "PlayerAuthed" hook. net.Receive(NetworkServerToClient, function() --The SteamID is what the server tells us our SteamID is. local steamid = net.ReadString() --Name the file with what the server tells us the name is. local server_ip = net.ReadString() --Set the file type / format as what the server tells us the format is. local file_format = net.ReadString() --Set directory/file path. local file_path = net.ReadString() --If the Client has this file already. if file.Exists(""..file_path..""..server_ip..""..file_format.."", "DATA") then --Read our file. local lol = file.Read(""..file_path..""..server_ip..""..file_format.."", "DATA") --Put our file data into a table. local data = string.Explode("\n", lol) --If the Table does not already contain this ID. if !table.HasValue(data, steamid) then --Add the new ID to the file. file.Append(""..file_path..""..server_ip..""..file_format.."", "\n"..steamid.."") end --For each ID in our table. for i=1, #data do --Send the data to the server. net.Start(NetworkClientToServer) net.WriteString(data[i]) net.SendToServer() end else --If the file path has a directory. if file_path != "" then --Create the folder(s) to store the file. file.CreateDir(""..file_path.."") end --Client did not have the file already so create it and add our SteamID. file.Write(""..file_path..""..server_ip..""..file_format.."", ""..steamid.."") end end) end --End If CLIENT end --End if ban_tracker enabled.
43.943355
212
0.730094
54281b767087ded979ab6e2db8db189189f824c1
352
go
Go
pkg/libs/serializer/non_fallable_serializer_test.go
ShaneLee/gowaves
98ddb6370582510eb7d6086451de72be2def00eb
[ "MIT" ]
72
2018-10-01T14:14:53.000Z
2022-03-25T21:06:56.000Z
pkg/libs/serializer/non_fallable_serializer_test.go
ShaneLee/gowaves
98ddb6370582510eb7d6086451de72be2def00eb
[ "MIT" ]
110
2018-10-19T15:09:03.000Z
2022-03-24T09:56:56.000Z
pkg/libs/serializer/non_fallable_serializer_test.go
ShaneLee/gowaves
98ddb6370582510eb7d6086451de72be2def00eb
[ "MIT" ]
31
2018-10-30T15:07:03.000Z
2022-03-29T23:57:11.000Z
package serializer import ( "bytes" "testing" "github.com/stretchr/testify/require" ) func TestNonFallableSerializer_Write(t *testing.T) { buf := &bytes.Buffer{} o := bytes.NewBuffer([]byte{1, 2, 3, 4, 5}) s := NewNonFallable(buf) _, _ = o.WriteTo(s) require.EqualValues(t, 5, s.N()) require.Equal(t, []byte{1, 2, 3, 4, 5}, buf.Bytes()) }
18.526316
53
0.650568
ec20f5b12d5eccda91e8cb2ebd6d5fa17605f22f
6,595
swift
Swift
FMPhotoPicker/FMPhotoPicker/source/Interaction Animator/FMPhotoInteractionAnimator.swift
htxs/FMPhotoPicker
26b87033ab2bb3ef8292fc45fb8c0279508f2677
[ "MIT" ]
407
2020-02-15T02:22:58.000Z
2022-03-31T08:41:13.000Z
FMPhotoPicker/FMPhotoPicker/source/Interaction Animator/FMPhotoInteractionAnimator.swift
htxs/FMPhotoPicker
26b87033ab2bb3ef8292fc45fb8c0279508f2677
[ "MIT" ]
34
2020-02-18T11:23:04.000Z
2022-02-21T12:22:24.000Z
FMPhotoPicker/FMPhotoPicker/source/Interaction Animator/FMPhotoInteractionAnimator.swift
htxs/FMPhotoPicker
26b87033ab2bb3ef8292fc45fb8c0279508f2677
[ "MIT" ]
65
2020-03-03T08:32:25.000Z
2022-03-09T03:39:29.000Z
// // FMPhotoInteractionAnimator.swift // FMPhotoPicker // // Created by c-nguyen on 2018/02/06. // Copyright © 2018 Tribal Media House. All rights reserved. // import UIKit class FMPhotoInteractionAnimator: NSObject, UIViewControllerInteractiveTransitioning { var interactionInProgress = false private var shouldCompleteTransition = false private weak var viewController: FMPhotoPresenterViewController! lazy private var panGestureRecognizer: UIPanGestureRecognizer = { let pan = UIPanGestureRecognizer(target: self, action: #selector(handleGesture(_:))) // So important to prevent unexpected behavior when mixing GestrureRecognizer and touchesBegan // especially when a touch event occur near edge of the screen where the system menu recognizer is also handing. pan.cancelsTouchesInView = false return pan }() private var transitionContext: UIViewControllerContextTransitioning? var animator: UIViewControllerAnimatedTransitioning? init(viewController: FMPhotoPresenterViewController) { super.init() self.viewController = viewController self.viewController.view.addGestureRecognizer(self.panGestureRecognizer) } func startInteractiveTransition(_ transitionContext: UIViewControllerContextTransitioning) { self.transitionContext = transitionContext } public func enable() { self.panGestureRecognizer.isEnabled = true } public func disable() { self.panGestureRecognizer.isEnabled = false } @objc func handleGesture(_ gestureRecognizer: UIPanGestureRecognizer) { let translation = gestureRecognizer.translation(in: gestureRecognizer.view!.superview!) var progress = (translation.x / 200) progress = CGFloat(fminf(fmaxf(Float(progress), 0.0), 1.0)) if gestureRecognizer.state == .began { interactionInProgress = true viewController.dismiss(animated: true, completion: nil) } else { self.handlePanWithPanGestureRecognizer(gestureRecognizer, viewToPan: self.viewController.pageViewController.view, anchorPoint: CGPoint(x: self.viewController.view.bounds.midX, y: self.viewController.view.bounds.midY)) } } func handlePanWithPanGestureRecognizer(_ gestureRecognizer: UIPanGestureRecognizer, viewToPan: UIView, anchorPoint: CGPoint) { guard let fromView = transitionContext?.view(forKey: UITransitionContextViewKey.from) else { return } let translatedPanGesturePoint = gestureRecognizer.translation(in: fromView) let newCenterPoint = CGPoint(x: anchorPoint.x + translatedPanGesturePoint.x, y: anchorPoint.y + translatedPanGesturePoint.y) viewToPan.center = newCenterPoint let verticalDelta = newCenterPoint.y - anchorPoint.y let backgroundAlpha = backgroundAlphaForPanningWithVerticalDelta(verticalDelta) fromView.backgroundColor = fromView.backgroundColor?.withAlphaComponent(backgroundAlpha) // self.viewController.view.alpha = CGFloat(backgroundAlpha) if gestureRecognizer.state == .ended { interactionInProgress = false finishPanWithPanGestureRecognizer(gestureRecognizer, verticalDelta: verticalDelta,viewToPan: viewToPan, anchorPoint: anchorPoint) } } func finishPanWithPanGestureRecognizer(_ gestureRecognizer: UIPanGestureRecognizer, verticalDelta: CGFloat, viewToPan: UIView, anchorPoint: CGPoint) { guard let fromView = transitionContext?.view(forKey: UITransitionContextViewKey.from) else { return } let returnToCenterVelocityAnimationRatio = 0.00007 let panDismissDistanceRatio = 50.0 / 667.0 // distance over iPhone 6 height let panDismissMaximumDuration = 0.45 let velocityY = gestureRecognizer.velocity(in: gestureRecognizer.view).y var animationDuration = (Double(abs(velocityY)) * returnToCenterVelocityAnimationRatio) + 0.2 var animationCurve: UIView.AnimationOptions = .curveEaseOut var finalPageViewCenterPoint = anchorPoint var finalBackgroundAlpha = 1.0 let dismissDistance = panDismissDistanceRatio * Double(fromView.bounds.height) let isDismissing = Double(abs(verticalDelta)) > dismissDistance var didAnimateUsingAnimator = false if isDismissing { if let animator = self.animator, let transitionContext = transitionContext { animator.animateTransition(using: transitionContext) didAnimateUsingAnimator = true } else { let isPositiveDelta = verticalDelta >= 0 let modifier: CGFloat = isPositiveDelta ? 1 : -1 let finalCenterY = fromView.bounds.midY + modifier * fromView.bounds.height finalPageViewCenterPoint = CGPoint(x: fromView.center.x, y: finalCenterY) animationDuration = Double(abs(finalPageViewCenterPoint.y - viewToPan.center.y) / abs(velocityY)) animationDuration = min(animationDuration, panDismissMaximumDuration) animationCurve = .curveEaseOut finalBackgroundAlpha = 0.0 } } if didAnimateUsingAnimator { self.transitionContext = nil } else { UIView.animate(withDuration: animationDuration, delay: 0, options: animationCurve, animations: { () -> Void in viewToPan.center = finalPageViewCenterPoint fromView.backgroundColor = fromView.backgroundColor?.withAlphaComponent(CGFloat(finalBackgroundAlpha)) }, completion: { finished in if isDismissing { self.transitionContext?.finishInteractiveTransition() } else { self.transitionContext?.cancelInteractiveTransition() } self.transitionContext?.completeTransition(isDismissing && !(self.transitionContext?.transitionWasCancelled ?? false)) self.transitionContext = nil }) } } private func backgroundAlphaForPanningWithVerticalDelta(_ delta: CGFloat) -> CGFloat { return 1 - min(abs(delta) / 400, 1.0) } }
46.118881
154
0.660652
9306cc976c5fabbf6540eb1a6429ac988ce85fc6
393
asm
Assembly
p5/p5(3).asm
Anan1225/assembly-language
054a33a4c278fc3cc8e849bb24df004079434a82
[ "MIT" ]
null
null
null
p5/p5(3).asm
Anan1225/assembly-language
054a33a4c278fc3cc8e849bb24df004079434a82
[ "MIT" ]
null
null
null
p5/p5(3).asm
Anan1225/assembly-language
054a33a4c278fc3cc8e849bb24df004079434a82
[ "MIT" ]
null
null
null
ASSUME CS:CODES,DS:DATAS,SS:STACKS CODES SEGMENT START: MOV AX,STACKS MOV SS,AX MOV SP,16 MOV AX,DATAS MOV DS,AX push ds:[0] push ds:[2] pop ds:[2] pop ds:[0] MOV AH,4CH INT 21H CODES ENDS END DATAS SEGMENT DW 0123H,0456H DATAS ENDS STACKS SEGMENT DW 0,0 STACKS ENDS
11.558824
35
0.506361
76442892b2291ca518fe0e40b639543ade5f6bad
1,383
go
Go
modern/minimal/status_clientbound_proto.go
sysr-q/kyubu
78158b1795e36a71fe10c7dbeacea6e8c8a93c75
[ "MIT" ]
2
2015-03-12T08:11:39.000Z
2015-04-07T17:40:54.000Z
modern/minimal/status_clientbound_proto.go
sysr-q/kyubu
78158b1795e36a71fe10c7dbeacea6e8c8a93c75
[ "MIT" ]
1
2015-05-17T00:26:58.000Z
2015-05-17T00:26:58.000Z
modern/minimal/status_clientbound_proto.go
sysr-q/kyubu
78158b1795e36a71fe10c7dbeacea6e8c8a93c75
[ "MIT" ]
null
null
null
// Generated by protocol_generator; DO NOT EDIT // protocol_generator -file=status_clientbound.go -direction=serverbound -state=status -package=modern package modern import ( "encoding/binary" "encoding/json" "github.com/kurafuto/kyubu/packets" "io" ) func init() { packets.Register(packets.Status, packets.ServerBound, 0x00, func() packets.Packet { return &StatusResponse{} }) packets.Register(packets.Status, packets.ServerBound, 0x01, func() packets.Packet { return &StatusPong{} }) } func (t *StatusResponse) Id() byte { return 0x00 // 0 } func (t *StatusResponse) Encode(ww io.Writer) (err error) { var tmp0 []byte if tmp0, err = json.Marshal(&t.Status); err != nil { return err } if err = packets.WriteString(ww, string(tmp0)); err != nil { return err } return } func (t *StatusResponse) Decode(rr io.Reader) (err error) { var tmp0 string if tmp0, err = packets.ReadString(rr); err != nil { return err } if err = json.Unmarshal([]byte(tmp0), &t.Status); err != nil { return err } return } func (t *StatusPong) Id() byte { return 0x01 // 1 } func (t *StatusPong) Encode(ww io.Writer) (err error) { if err = binary.Write(ww, binary.BigEndian, t.Time); err != nil { return err } return } func (t *StatusPong) Decode(rr io.Reader) (err error) { if err = binary.Read(rr, binary.BigEndian, t.Time); err != nil { return err } return }
21.952381
112
0.68402
f0791e37af8f0e6bb45c78c7fc37667ac15c9e8a
627
py
Python
test/scripts/functions.py
JetBrains-Research/jpt-nb-corpus
d93ac84ff885b30ef736cd82f5ce8b09c28ef3d1
[ "MIT" ]
3
2022-03-25T10:17:22.000Z
2022-03-27T14:13:03.000Z
test/scripts/functions.py
JetBrains-Research/Matroskin
053ed3d7e9dffb0aee4012bc49a194e0c60217c7
[ "MIT" ]
null
null
null
test/scripts/functions.py
JetBrains-Research/Matroskin
053ed3d7e9dffb0aee4012bc49a194e0c60217c7
[ "MIT" ]
1
2021-07-06T16:22:11.000Z
2021-07-06T16:22:11.000Z
# Explicit API functions from api_functions import api_function1, api_function2 from package3 import api_function3 # API Packages import package1, package2 import package3 from package4 import api_class1 # Defined functions def defined_function_1(d_f_arg1, d_f_arg2): a = api_function1(d_f_arg1) b = (api_function2(d_f_arg2, d_f_arg1), api_function3()) def defined_function_2(d_f_arg1, d_f_arg2, d_f_arg3): api_function1() package1.p1_function1(d_f_arg1, d_f_arg2, d_f_arg3) a, b = api_class1.cl1_function1(1, 2, '3') def defined_function_3(): package1.p1_function1() package3.p3_function1()
24.115385
60
0.77193
12250d6e6ab661172cf4675dbeeafb98dcbd69a5
90
h
C
LocalAI/Move.h
hunterrees/challengeChessAI
0a85a8d3c8b43778af902b7274569c867db5cf75
[ "Apache-2.0" ]
null
null
null
LocalAI/Move.h
hunterrees/challengeChessAI
0a85a8d3c8b43778af902b7274569c867db5cf75
[ "Apache-2.0" ]
null
null
null
LocalAI/Move.h
hunterrees/challengeChessAI
0a85a8d3c8b43778af902b7274569c867db5cf75
[ "Apache-2.0" ]
null
null
null
#pragma once #include <iostream> using namespace std; class Move { public: private: };
8.181818
20
0.711111
7506ebcd59e8d7c961d4646a27194bddd8b6dbb0
2,099
h
C
Headers/Frameworks/FxPlug/FxParameterCreationAPI-Protocol.h
CommandPost/FinalCutProFrameworks
d98b00ff0c84af80942d71514e9238d624aca50a
[ "MIT" ]
3
2020-11-19T10:04:02.000Z
2021-10-02T17:25:21.000Z
Headers/Frameworks/ProAppsFxSupport/FxParameterCreationAPI-Protocol.h
CommandPost/FinalCutProFrameworks
d98b00ff0c84af80942d71514e9238d624aca50a
[ "MIT" ]
null
null
null
Headers/Frameworks/ProAppsFxSupport/FxParameterCreationAPI-Protocol.h
CommandPost/FinalCutProFrameworks
d98b00ff0c84af80942d71514e9238d624aca50a
[ "MIT" ]
null
null
null
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Mar 11 2021 20:53:35). // // Copyright (C) 1997-2019 Steve Nygard. // @class NSArray, NSString; @protocol NSCoding; @protocol FxParameterCreationAPI - (BOOL)endParameterSubGroup; - (BOOL)startParameterSubGroup:(NSString *)arg1 parmId:(unsigned int)arg2 parmFlags:(unsigned int)arg3; - (BOOL)addCustomParameterWithName:(NSString *)arg1 parmId:(unsigned int)arg2 defaultValue:(id <NSCoding>)arg3 parmFlags:(unsigned int)arg4; - (BOOL)addImageReferenceWithName:(NSString *)arg1 parmId:(unsigned int)arg2 parmFlags:(unsigned int)arg3; - (BOOL)addPopupMenuWithName:(NSString *)arg1 parmId:(unsigned int)arg2 defaultValue:(unsigned int)arg3 menuEntries:(NSArray *)arg4 parmFlags:(unsigned int)arg5; - (BOOL)addPointParameterWithName:(NSString *)arg1 parmId:(unsigned int)arg2 defaultX:(double)arg3 defaultY:(double)arg4 parmFlags:(unsigned int)arg5; - (BOOL)addColorParameterWithName:(NSString *)arg1 parmId:(unsigned int)arg2 defaultRed:(double)arg3 defaultGreen:(double)arg4 defaultBlue:(double)arg5 defaultAlpha:(double)arg6 parmFlags:(unsigned int)arg7; - (BOOL)addColorParameterWithName:(NSString *)arg1 parmId:(unsigned int)arg2 defaultRed:(double)arg3 defaultGreen:(double)arg4 defaultBlue:(double)arg5 parmFlags:(unsigned int)arg6; - (BOOL)addAngleSliderWithName:(NSString *)arg1 parmId:(unsigned int)arg2 defaultValue:(double)arg3 parameterMin:(double)arg4 parameterMax:(double)arg5 parmFlags:(unsigned int)arg6; - (BOOL)addToggleButtonWithName:(NSString *)arg1 parmId:(unsigned int)arg2 defaultValue:(BOOL)arg3 parmFlags:(unsigned int)arg4; - (BOOL)addIntSliderWithName:(NSString *)arg1 parmId:(unsigned int)arg2 defaultValue:(int)arg3 parameterMin:(int)arg4 parameterMax:(int)arg5 sliderMin:(int)arg6 sliderMax:(int)arg7 delta:(int)arg8 parmFlags:(unsigned int)arg9; - (BOOL)addFloatSliderWithName:(NSString *)arg1 parmId:(unsigned int)arg2 defaultValue:(double)arg3 parameterMin:(double)arg4 parameterMax:(double)arg5 sliderMin:(double)arg6 sliderMax:(double)arg7 delta:(double)arg8 parmFlags:(unsigned int)arg9; @end
83.96
246
0.797999
0326395f7fab33fa29a64f393b477cc74232b3be
1,347
sql
SQL
server-dao/src/main/resources/xurui3.sql
xurui0898/server-boilerplate
8c58d0693cf735a4a39040f102270c94b793b027
[ "MIT" ]
null
null
null
server-dao/src/main/resources/xurui3.sql
xurui0898/server-boilerplate
8c58d0693cf735a4a39040f102270c94b793b027
[ "MIT" ]
null
null
null
server-dao/src/main/resources/xurui3.sql
xurui0898/server-boilerplate
8c58d0693cf735a4a39040f102270c94b793b027
[ "MIT" ]
null
null
null
/* Navicat Premium Data Transfer Source Server : docker本机 Source Server Type : MySQL Source Server Version : 50625 Source Host : localhost Source Database : xurui3 Target Server Type : MySQL Target Server Version : 50625 File Encoding : utf-8 Date: 08/13/2020 11:04:22 AM */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for `account` -- ---------------------------- DROP TABLE IF EXISTS `account`; CREATE TABLE `account` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增主键', `name` varchar(20) NOT NULL DEFAULT '' COMMENT '用户名', `nick_name` varchar(20) NOT NULL DEFAULT '' COMMENT '用户昵称', `sex` tinyint(4) NOT NULL DEFAULT '0' COMMENT '性别', `mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '手机号', PRIMARY KEY (`id`), UNIQUE KEY `idx_name` (`name`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='账号主体表'; -- ---------------------------- -- Table structure for `test` -- ---------------------------- DROP TABLE IF EXISTS `test`; CREATE TABLE `test` ( `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '自增主键', `value` varchar(20) NOT NULL DEFAULT '' COMMENT '无意义字符串', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='test测试表'; SET FOREIGN_KEY_CHECKS = 1;
29.933333
75
0.628062
1e4d1d1ebd7fe5313026c56cb544768a678ac7c5
3,653
css
CSS
src/components/Prompt/Prompt.css
7274-dev/AdventnaVyzva-React
acb03c7804bdfa80b65ad7ab817359c85696951f
[ "MIT" ]
1
2021-04-13T07:24:06.000Z
2021-04-13T07:24:06.000Z
src/components/Prompt/Prompt.css
7274-dev/AdventnaVyzva-React
acb03c7804bdfa80b65ad7ab817359c85696951f
[ "MIT" ]
12
2021-06-06T11:03:14.000Z
2022-03-04T23:23:02.000Z
src/components/Prompt/Prompt.css
7274-dev/AdventnaVyzva-React
acb03c7804bdfa80b65ad7ab817359c85696951f
[ "MIT" ]
null
null
null
.prompt { opacity: 0; visibility: hidden; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 5; transition-duration: 400ms; transition-property: all; } @supports (backdrop-filter: blur(20px)) { .prompt { backdrop-filter: blur(20px); } } @supports not (backdrop-filter: blur(20px)) { .prompt { background-color: #eaeaea; } } .prompt .form { display: flex; align-items: center; justify-content: center; flex-direction: column; position: fixed; top: 50vh; left: 50vw; transition-duration: 400ms; transition-property: all; transform: translate(-50%, -80%) scale(1.3); filter: blur(2px); z-index: 6; border-radius: 0.5rem; } @media only screen and (min-width: 200px) { .prompt .form { width: 90%; } } @media only screen and (min-width: 1000px) { .prompt .form { width: 50%; } } @media only screen and (min-width: 1400px) { .prompt .form { width: 30%; } } .prompt .form label { font-size: 2rem; margin: 0; color: #252525; } @media only screen and (min-width: 200px) { .prompt .form label { font-size: 2rem; text-align: center; } } @media only screen and (min-width: 1000px) { .prompt .form label { font-size: 2.5rem; } } .prompt .form .password-container { display: flex; align-items: center; justify-content: center; width: 100%; } .prompt .form .password-container input { border-radius: 0.5rem; font-size: 1.5rem; margin: 1rem; padding: 0.5rem; width: 100%; } .prompt .form .password-container button { height: fit-content; border-radius: 0.5rem; padding: 0.45rem; font-size: 1.5rem !important; cursor: pointer; background-color: #d0d0d0; } .prompt .form .toggle-password-visibility { display: flex; align-items: flex-start; justify-content: flex-start; margin: 0.3rem 0 0.5rem 0; } @media only screen and (min-width: 200px) { .prompt .form .toggle-password-visibility { margin-left: 2rem; } } @media only screen and (min-width: 1000px) { .prompt .form .toggle-password-visibility { margin-left: 1rem; } } .prompt .form .toggle-password-visibility p { display: inline-block; height: 100%; font-size: 1.2rem; margin: 0 0 0 0.2rem; vertical-align: middle; } .prompt .form .button-container { display: flex; flex-direction: row-reverse; justify-content: center; width: 100%; } .prompt .form .button-container button { font-size: 1.6rem !important; margin: 0 0.2rem; padding: 0.45rem; border-radius: 0.5rem; cursor: pointer; background-color: #d0d0d0; } .prompt.active { opacity: 1; visibility: visible; } .prompt.active .form { transform: translate(-50%, -75%) scale(1); filter: blur(0px); } .prompt.has-md-editor .form { transform: translate(-50%, -70%) scale(1.3); filter: blur(2px); } @media only screen and (min-width: 200px) { .prompt.has-md-editor .form { width: 100%; height: 80%; } } @media only screen and (min-width: 1000px) { .prompt.has-md-editor .form { width: 80%; height: 70%; } } @media only screen and (min-width: 1400px) { .prompt.has-md-editor .form { width: 60%; height: 60%; } } .prompt.has-md-editor.active { opacity: 1; visibility: visible; } .prompt.has-md-editor.active .form { transform: translate(-50%, -65%) scale(1); filter: blur(0px); } @supports not (backdrop-filter: blur(20px)) { .prompt-dark { background-color: #2c2c2c !important; } } .prompt-dark .form-dark label { color: #eeeeee !important; } .prompt-dark .form-dark button { color: #e0e0e0 !important; background-color: #373737 !important; } /*# sourceMappingURL=Prompt.css.map */
20.294444
46
0.649329
269799d07624ef5cb406431dc9c2075cd3c7b541
5,499
java
Java
java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsImpl.java
liveqmock/platform-tools-idea
1c4b76108add6110898a7e3f8f70b970e352d3d4
[ "Apache-2.0" ]
2
2015-05-08T15:07:10.000Z
2022-03-09T05:47:53.000Z
java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsImpl.java
lshain-android-source/tools-idea
b37108d841684bcc2af45a2539b75dd62c4e283c
[ "Apache-2.0" ]
null
null
null
java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsImpl.java
lshain-android-source/tools-idea
b37108d841684bcc2af45a2539b75dd62c4e283c
[ "Apache-2.0" ]
2
2017-04-24T15:48:40.000Z
2022-03-09T05:48:05.000Z
/* * Copyright 2000-2009 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.intellij.debugger.impl; import com.intellij.debugger.actions.DebuggerAction; import com.intellij.debugger.apiAdapters.TransportServiceWrapper; import com.intellij.debugger.engine.DebugProcessImpl; import com.intellij.debugger.engine.StackFrameContext; import com.intellij.debugger.engine.evaluation.*; import com.intellij.debugger.engine.evaluation.expression.EvaluatorBuilder; import com.intellij.debugger.engine.evaluation.expression.EvaluatorBuilderImpl; import com.intellij.debugger.ui.CompletionEditor; import com.intellij.debugger.ui.DebuggerExpressionComboBox; import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeExpression; import com.intellij.debugger.ui.tree.DebuggerTreeNode; import com.intellij.execution.ExecutionException; import com.intellij.ide.util.TreeClassChooser; import com.intellij.ide.util.TreeClassChooserFactory; import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.JDOMExternalizerUtil; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiExpression; import com.intellij.util.net.NetUtils; import com.sun.jdi.Value; import org.jdom.Element; import java.io.IOException; public class DebuggerUtilsImpl extends DebuggerUtilsEx{ private static final Logger LOG = Logger.getInstance("#com.intellij.debugger.impl.DebuggerUtilsImpl"); public PsiExpression substituteThis(PsiExpression expressionWithThis, PsiExpression howToEvaluateThis, Value howToEvaluateThisValue, StackFrameContext context) throws EvaluateException { return DebuggerTreeNodeExpression.substituteThis(expressionWithThis, howToEvaluateThis, howToEvaluateThisValue); } public EvaluatorBuilder getEvaluatorBuilder() { return EvaluatorBuilderImpl.getInstance(); } public DebuggerTreeNode getSelectedNode(DataContext context) { return DebuggerAction.getSelectedNode(context); } public DebuggerContextImpl getDebuggerContext(DataContext context) { return DebuggerAction.getDebuggerContext(context); } @SuppressWarnings({"HardCodedStringLiteral"}) public Element writeTextWithImports(TextWithImports text) { Element element = new Element("TextWithImports"); element.setAttribute("text", text.toExternalForm()); element.setAttribute("type", text.getKind() == CodeFragmentKind.EXPRESSION ? "expression" : "code fragment"); return element; } @SuppressWarnings({"HardCodedStringLiteral"}) public TextWithImports readTextWithImports(Element element) { LOG.assertTrue("TextWithImports".equals(element.getName())); String text = element.getAttributeValue("text"); if ("expression".equals(element.getAttributeValue("type"))) { return new TextWithImportsImpl(CodeFragmentKind.EXPRESSION, text); } else { return new TextWithImportsImpl(CodeFragmentKind.CODE_BLOCK, text); } } public void writeTextWithImports(Element root, String name, TextWithImports value) { LOG.assertTrue(value.getKind() == CodeFragmentKind.EXPRESSION); JDOMExternalizerUtil.writeField(root, name, value.toExternalForm()); } public TextWithImports readTextWithImports(Element root, String name) { String s = JDOMExternalizerUtil.readField(root, name); if(s == null) return null; return new TextWithImportsImpl(CodeFragmentKind.EXPRESSION, s); } public TextWithImports createExpressionWithImports(String expression) { return new TextWithImportsImpl(CodeFragmentKind.EXPRESSION, expression); } public PsiElement getContextElement(StackFrameContext context) { return PositionUtil.getContextElement(context); } public PsiClass chooseClassDialog(String title, Project project) { TreeClassChooser dialog = TreeClassChooserFactory.getInstance(project).createAllProjectScopeChooser(title); dialog.showDialog(); return dialog.getSelected(); } public CompletionEditor createEditor(Project project, PsiElement context, String recentsId) { return new DebuggerExpressionComboBox(project, context, recentsId, DefaultCodeFragmentFactory.getInstance()); } public String findAvailableDebugAddress(final boolean useSockets) throws ExecutionException { final TransportServiceWrapper transportService = TransportServiceWrapper.getTransportService(useSockets); if(useSockets) { final int freePort; try { freePort = NetUtils.findAvailableSocketPort(); } catch (IOException e) { throw new ExecutionException(DebugProcessImpl.processError(e)); } return Integer.toString(freePort); } try { String address = transportService.startListening(); transportService.stopListening(address); return address; } catch (IOException e) { throw new ExecutionException(DebugProcessImpl.processError(e)); } } }
39.561151
161
0.783779
6c6608dc8f0bf69bc42c53dc15b10936974ea22d
58
ps1
PowerShell
docker-cli/test.ps1
danijeljw/dockerfiles-windows
25448db774927bb7a23e625c1afd9ec970697dc1
[ "MIT" ]
1,033
2015-08-21T20:29:53.000Z
2022-03-17T07:41:04.000Z
docker-cli/test.ps1
danijeljw/dockerfiles-windows
25448db774927bb7a23e625c1afd9ec970697dc1
[ "MIT" ]
155
2016-02-18T00:07:56.000Z
2021-12-20T19:51:23.000Z
docker-cli/test.ps1
danijeljw/dockerfiles-windows
25448db774927bb7a23e625c1afd9ec970697dc1
[ "MIT" ]
449
2015-10-29T06:54:28.000Z
2022-03-17T09:08:45.000Z
docker run --isolation=hyperv docker-cli docker --version
29
57
0.793103
3ddbc5ca39c257755a1c93aa1a48a748a6579aa3
397
asm
Assembly
programs/oeis/137/A137495.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/137/A137495.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/137/A137495.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A137495: A098601(2n)+A098601(2n+1) ; 2,3,4,7,13,23,40,70,123,216,379,665,1167,2048,3594,6307,11068,19423,34085,59815,104968,184206,323259,567280,995507,1746993,3065759,5380032,9441298,16568323,29075380,51023735,89540413,157132471,275748264,483904470,849193147,1490230088 mov $1,$0 lpb $1 add $2,$0 add $3,$2 sub $2,$1 sub $1,1 sub $3,$0 add $0,$3 sub $2,$3 lpe add $0,2 add $0,$3
24.8125
235
0.702771
e31070623fcef63659f03ff4bb52e2b0d884abcd
2,653
swift
Swift
RayWenToe/Controllers/GameManager/States/PlayerInputState.swift
Armandocarrillo/RayWenToe
e53f71f9aecff0ef7d55c54979444e5de2e8d698
[ "MIT" ]
null
null
null
RayWenToe/Controllers/GameManager/States/PlayerInputState.swift
Armandocarrillo/RayWenToe
e53f71f9aecff0ef7d55c54979444e5de2e8d698
[ "MIT" ]
null
null
null
RayWenToe/Controllers/GameManager/States/PlayerInputState.swift
Armandocarrillo/RayWenToe
e53f71f9aecff0ef7d55c54979444e5de2e8d698
[ "MIT" ]
null
null
null
public class PlayerInputState: GameState { // MARK: - Instance Properties public let actionTitle: String public let player: Player // MARK: - Object Lifecycle public init(gameMode: GameManager, player: Player, actionTitle: String) { self.actionTitle = actionTitle self.player = player super.init(gameManager: gameMode) } // MARK: - Actions public override func begin() { gameplayView.actionButton.setTitle(actionTitle, for: .normal) gameplayView.gameboardView.clear() updatePlayerLabel() updateMoveCountLabel() } public override func addMove(at position: GameboardPosition) { let moveCount = movesForPlayer[player]!.count guard moveCount < turnsPerPlayer else { return } displayMarkView(at: position, turnNumber: moveCount + 1) //both require to use MoveCommand enqueueMoveCommand(at: position) updateMoveCountLabel() } private func enqueueMoveCommand(at position: GameboardPosition) { let newMove = MoveCommand(gameboard: gameboard, gameboardView: gameboardView, player: player, position: position) movesForPlayer[player]!.append(newMove) } private func displayMarkView(at position: GameboardPosition, turnNumber: Int) { guard let markView = gameplayView.gameboardView.markViewForPosition[position] else { let markView = player.markViewPrototype.copy() as MarkView markView.turnNumbers = [turnNumber] gameplayView.gameboardView.placeMarkView(markView, at: position, animated: false) return } markView.turnNumbers.append(turnNumber) } private func updatePlayerLabel() { gameplayView.playerLabel.text = player.turnMessage } private func updateMoveCountLabel() { let turnRemaining = turnsPerPlayer - movesForPlayer[player]!.count gameplayView.moveCountLabel.text = "\(turnRemaining) Moves Left" } public override func handleActionPressed() { //check if the player has made all of her selections guard movesForPlayer[player]!.count == turnsPerPlayer else { return } gameManager.transitionToNextState() } public override func handleUndoPressed() { var moves = movesForPlayer[player]! guard let position = moves.popLast()?.position else { return } movesForPlayer[player] = moves updateMoveCountLabel() let markView = gameboardView.markViewForPosition[position]! //uses turnNumbers in order to display the order that it was selected _ = markView.turnNumbers.popLast() guard markView.turnNumbers.count == 0 else { return } gameboardView.removeMarkView(at: position, animated: false) } }
30.494253
117
0.720317
8156e7882045616122109eaa5cc1d0702c8a5000
8,923
rs
Rust
src/terminfo/fields.rs
IanS5/tty-rs
dfeeae9000a701fea44148b91cab827cabdd6b33
[ "MIT" ]
2
2019-07-01T12:52:18.000Z
2019-07-01T13:55:10.000Z
src/terminfo/fields.rs
IanS5/tty-rs
dfeeae9000a701fea44148b91cab827cabdd6b33
[ "MIT" ]
null
null
null
src/terminfo/fields.rs
IanS5/tty-rs
dfeeae9000a701fea44148b91cab827cabdd6b33
[ "MIT" ]
null
null
null
//! This file was generated by "./scripts/generate-terminfo-structs.sh" on Tue Jul 24 20:26:48 EDT 2018. //! Please do not modify it. /// Number of booleans expected to be present in the file pub const PREDEFINED_BOOLEANS_COUNT: usize = 44; /// Number of numbers expected to be present in the file pub const PREDEFINED_NUMERICS_COUNT: usize = 39; /// Number of strings expected to be present in the file pub const PREDEFINED_STRINGS_COUNT: usize = 414; #[repr(usize)] #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum BooleanField { AutoLeftMargin, AutoRightMargin, NoEscCtlc, CeolStandoutGlitch, EatNewlineGlitch, EraseOverstrike, GenericType, HardCopy, HasMetaKey, HasStatusLine, InsertNullGlitch, MemoryAbove, MemoryBelow, MoveInsertMode, MoveStandoutMode, OverStrike, StatusLineEscOk, DestTabsMagicSmso, TildeGlitch, TransparentUnderline, XonXoff, NeedsXonXoff, PrtrSilent, HardCursor, NonRevRmcup, NoPadChar, NonDestScrollRegion, CanChange, BackColorErase, HueLightnessSaturation, ColAddrGlitch, CrCancelsMicroMode, HasPrintWheel, RowAddrGlitch, SemiAutoRightMargin, CpiChangesRes, LpiChangesRes, BackspacesWithBs, CrtNoScrolling, NoCorrectlyWorkingCr, GnuHasMetaKey, LinefeedIsNewline, HasHardwareTabs, ReturnDoesClrEol, } #[repr(usize)] #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum NumericField { Columns, InitTabs, Lines, LinesOfMemory, MagicCookieGlitch, PaddingBaudRate, VirtualTerminal, WidthStatusLine, NumLabels, LabelHeight, LabelWidth, MaxAttributes, MaximumWindows, MaxColors, MaxPairs, NoColorVideo, BufferCapacity, DotVertSpacing, DotHorzSpacing, MaxMicroAddress, MaxMicroJump, MicroColSize, MicroLineSize, NumberOfPins, OutputResChar, OutputResLine, OutputResHorzInch, OutputResVertInch, PrintRate, WideCharSize, Buttons, BitImageEntwining, BitImageType, MagicCookieGlitchUl, CarriageReturnDelay, NewLineDelay, BackspaceDelay, HorizontalTabDelay, NumberOfFunctionKeys, } #[repr(usize)] #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum StringField { BackTab, Bell, CarriageReturn, ChangeScrollRegion, ClearAllTabs, ClearScreen, ClrEol, ClrEos, ColumnAddress, CommandCharacter, CursorAddress, CursorDown, CursorHome, CursorInvisible, CursorLeft, CursorMemAddress, CursorNormal, CursorRight, CursorToLl, CursorUp, CursorVisible, DeleteCharacter, DeleteLine, DisStatusLine, DownHalfLine, EnterAltCharsetMode, EnterBlinkMode, EnterBoldMode, EnterCaMode, EnterDeleteMode, EnterDimMode, EnterInsertMode, EnterSecureMode, EnterProtectedMode, EnterReverseMode, EnterStandoutMode, EnterUnderlineMode, EraseChars, ExitAltCharsetMode, ExitAttributeMode, ExitCaMode, ExitDeleteMode, ExitInsertMode, ExitStandoutMode, ExitUnderlineMode, FlashScreen, FormFeed, FromStatusLine, Init1string, Init2string, Init3string, InitFile, InsertCharacter, InsertLine, InsertPadding, KeyBackspace, KeyCatab, KeyClear, KeyCtab, KeyDc, KeyDl, KeyDown, KeyEic, KeyEol, KeyEos, KeyF0, KeyF1, KeyF10, KeyF2, KeyF3, KeyF4, KeyF5, KeyF6, KeyF7, KeyF8, KeyF9, KeyHome, KeyIc, KeyIl, KeyLeft, KeyLl, KeyNpage, KeyPpage, KeyRight, KeySf, KeySr, KeyStab, KeyUp, KeypadLocal, KeypadXmit, LabF0, LabF1, LabF10, LabF2, LabF3, LabF4, LabF5, LabF6, LabF7, LabF8, LabF9, MetaOff, MetaOn, Newline, PadChar, ParmDch, ParmDeleteLine, ParmDownCursor, ParmIch, ParmIndex, ParmInsertLine, ParmLeftCursor, ParmRightCursor, ParmRindex, ParmUpCursor, PkeyKey, PkeyLocal, PkeyXmit, PrintScreen, PrtrOff, PrtrOn, RepeatChar, Reset1string, Reset2string, Reset3string, ResetFile, RestoreCursor, RowAddress, SaveCursor, ScrollForward, ScrollReverse, SetAttributes, SetTab, SetWindow, Tab, ToStatusLine, UnderlineChar, UpHalfLine, InitProg, KeyA1, KeyA3, KeyB2, KeyC1, KeyC3, PrtrNon, CharPadding, AcsChars, PlabNorm, KeyBtab, EnterXonMode, ExitXonMode, EnterAmMode, ExitAmMode, XonCharacter, XoffCharacter, EnaAcs, LabelOn, LabelOff, KeyBeg, KeyCancel, KeyClose, KeyCommand, KeyCopy, KeyCreate, KeyEnd, KeyEnter, KeyExit, KeyFind, KeyHelp, KeyMark, KeyMessage, KeyMove, KeyNext, KeyOpen, KeyOptions, KeyPrevious, KeyPrint, KeyRedo, KeyReference, KeyRefresh, KeyReplace, KeyRestart, KeyResume, KeySave, KeySuspend, KeyUndo, KeySbeg, KeyScancel, KeyScommand, KeyScopy, KeyScreate, KeySdc, KeySdl, KeySelect, KeySend, KeySeol, KeySexit, KeySfind, KeyShelp, KeyShome, KeySic, KeySleft, KeySmessage, KeySmove, KeySnext, KeySoptions, KeySprevious, KeySprint, KeySredo, KeySreplace, KeySright, KeySrsume, KeySsave, KeySsuspend, KeySundo, ReqForInput, KeyF11, KeyF12, KeyF13, KeyF14, KeyF15, KeyF16, KeyF17, KeyF18, KeyF19, KeyF20, KeyF21, KeyF22, KeyF23, KeyF24, KeyF25, KeyF26, KeyF27, KeyF28, KeyF29, KeyF30, KeyF31, KeyF32, KeyF33, KeyF34, KeyF35, KeyF36, KeyF37, KeyF38, KeyF39, KeyF40, KeyF41, KeyF42, KeyF43, KeyF44, KeyF45, KeyF46, KeyF47, KeyF48, KeyF49, KeyF50, KeyF51, KeyF52, KeyF53, KeyF54, KeyF55, KeyF56, KeyF57, KeyF58, KeyF59, KeyF60, KeyF61, KeyF62, KeyF63, ClrBol, ClearMargins, SetLeftMargin, SetRightMargin, LabelFormat, SetClock, DisplayClock, RemoveClock, CreateWindow, GotoWindow, Hangup, DialPhone, QuickDial, Tone, Pulse, FlashHook, FixedPause, WaitTone, User0, User1, User2, User3, User4, User5, User6, User7, User8, User9, OrigPair, OrigColors, InitializeColor, InitializePair, SetColorPair, SetForeground, SetBackground, ChangeCharPitch, ChangeLinePitch, ChangeResHorz, ChangeResVert, DefineChar, EnterDoublewideMode, EnterDraftQuality, EnterItalicsMode, EnterLeftwardMode, EnterMicroMode, EnterNearLetterQuality, EnterNormalQuality, EnterShadowMode, EnterSubscriptMode, EnterSuperscriptMode, EnterUpwardMode, ExitDoublewideMode, ExitItalicsMode, ExitLeftwardMode, ExitMicroMode, ExitShadowMode, ExitSubscriptMode, ExitSuperscriptMode, ExitUpwardMode, MicroColumnAddress, MicroDown, MicroLeft, MicroRight, MicroRowAddress, MicroUp, OrderOfPins, ParmDownMicro, ParmLeftMicro, ParmRightMicro, ParmUpMicro, SelectCharSet, SetBottomMargin, SetBottomMarginParm, SetLeftMarginParm, SetRightMarginParm, SetTopMargin, SetTopMarginParm, StartBitImage, StartCharSetDef, StopBitImage, StopCharSetDef, SubscriptCharacters, SuperscriptCharacters, TheseCauseCr, ZeroMotion, CharSetNames, KeyMouse, MouseInfo, ReqMousePos, GetMouse, SetAForeground, SetABackground, PkeyPlab, DeviceType, CodeSetInit, Set0DesSeq, Set1DesSeq, Set2DesSeq, Set3DesSeq, SetLrMargin, SetTbMargin, BitImageRepeat, BitImageNewline, BitImageCarriageReturn, ColorNames, DefineBitImageRegion, EndBitImageRegion, SetColorBand, SetPageLength, DisplayPcChar, EnterPcCharsetMode, ExitPcCharsetMode, EnterScancodeMode, ExitScancodeMode, PcTermOptions, ScancodeEscape, AltScancodeEsc, EnterHorizontalHlMode, EnterLeftHlMode, EnterLowHlMode, EnterRightHlMode, EnterTopHlMode, EnterVerticalHlMode, SetAAttributes, SetPglenInch, TermcapInit2, TermcapReset, LinefeedIfNotLf, BackspaceIfNotBs, OtherNonFunctionKeys, ArrowKeyMap, AcsUlcorner, AcsLlcorner, AcsUrcorner, AcsLrcorner, AcsLtee, AcsRtee, AcsBtee, AcsTtee, AcsHline, AcsVline, AcsPlus, MemoryLock, MemoryUnlock, BoxChars1, }
17.028626
104
0.644066
c88d99046f9845323be67964b6f499d4fd48605c
364
lua
Lua
test/tests/paragraph alias.lua
Reuh/anselme
10af596a582f9b1d69495385469d092c1b7c95b9
[ "0BSD" ]
null
null
null
test/tests/paragraph alias.lua
Reuh/anselme
10af596a582f9b1d69495385469d092c1b7c95b9
[ "0BSD" ]
null
null
null
test/tests/paragraph alias.lua
Reuh/anselme
10af596a582f9b1d69495385469d092c1b7c95b9
[ "0BSD" ]
null
null
null
local _={} _[7]={} _[6]={tags=_[7],text="ok"} _[5]={tags=_[7],text=" = "} _[4]={tags=_[7],text="ok"} _[3]={_[4],_[5],_[6]} _[2]={"return"} _[1]={"text",_[3]} return {_[1],_[2]} --[[ { "text", { { tags = <1>{}, text = "ok" }, { tags = <table 1>, text = " = " }, { tags = <table 1>, text = "ok" } } } { "return" } ]]--
16.545455
27
0.365385
26041960ccf98c2cfdbdd034ec445b5a89822dd8
1,215
java
Java
ZimbraServer/src/java/com/zimbra/cs/session/WaitSetError.java
fciubotaru/z-pec
82335600341c6fb1bb8a471fd751243a90bc4d57
[ "MIT" ]
5
2019-03-26T07:51:56.000Z
2021-08-30T07:26:05.000Z
ZimbraServer/src/java/com/zimbra/cs/session/WaitSetError.java
fciubotaru/z-pec
82335600341c6fb1bb8a471fd751243a90bc4d57
[ "MIT" ]
1
2015-08-18T19:03:32.000Z
2015-08-18T19:03:32.000Z
ZimbraServer/src/java/com/zimbra/cs/session/WaitSetError.java
fciubotaru/z-pec
82335600341c6fb1bb8a471fd751243a90bc4d57
[ "MIT" ]
13
2015-03-11T00:26:35.000Z
2020-07-26T16:25:18.000Z
/* * ***** BEGIN LICENSE BLOCK ***** * Zimbra Collaboration Suite Server * Copyright (C) 2007, 2008, 2009, 2010 Zimbra, Inc. * * The contents of this file are subject to the Zimbra Public License * Version 1.3 ("License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.zimbra.com/license. * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. * ***** END LICENSE BLOCK ***** */ package com.zimbra.cs.session; /** * Simple struct used to communicate error codes for individual accounts during a wait */ public class WaitSetError { public static enum Type { ALREADY_IN_SET_DURING_ADD, ERROR_LOADING_MAILBOX, MAINTENANCE_MODE, NO_SUCH_ACCOUNT, WRONG_HOST_FOR_ACCOUNT, NOT_IN_SET_DURING_REMOVE, NOT_IN_SET_DURING_UPDATE, MAILBOX_DELETED, ; } public WaitSetError(String accountId, WaitSetError.Type error) { this.accountId = accountId; this.error = error; } public final String accountId; public final WaitSetError.Type error; }
30.375
87
0.682305
7d4670ab478085148f79aba45730735e45f35425
57
sql
SQL
build/upgrade/3.17.6/last-seen.sqlite.sql
jemmy00/jsbin
b6635207200326febf0af99c7fe1b189b8278395
[ "MIT" ]
2,724
2015-01-01T23:00:14.000Z
2022-03-24T14:55:20.000Z
build/upgrade/3.17.6/last-seen.sqlite.sql
jemmy00/jsbin
b6635207200326febf0af99c7fe1b189b8278395
[ "MIT" ]
1,553
2015-01-03T17:56:51.000Z
2022-03-27T08:15:06.000Z
build/upgrade/3.17.6/last-seen.sqlite.sql
jemmy00/jsbin
b6635207200326febf0af99c7fe1b189b8278395
[ "MIT" ]
1,029
2015-01-01T05:35:05.000Z
2022-03-27T05:12:14.000Z
ALTER TABLE `ownership` ADD COLUMN `last_seen` datetime;
28.5
56
0.789474
cef0035d1ad967694deb228d12be6ee75825b88a
468
asm
Assembly
oeis/206/A206158.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/206/A206158.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/206/A206158.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A206158: a(n) = Sum_{k=0..n} binomial(n,k)^(2*k+1). ; Submitted by Jamie Morken(w2) ; 1,2,10,272,24226,12053252,40086916024,429254371605824,23527609330364490754,10714627376371224032350052,16964729291782419425708732425300,109783535843179466164398767001178968704,6782057095273243388704415924996348722446049600 mov $4,$0 lpb $0 sub $0,1 mov $2,$4 bin $2,$1 pow $2,$1 mov $3,$4 bin $3,$1 add $1,1 pow $2,2 mul $3,$2 add $5,$3 lpe mov $0,$5 add $0,1
23.4
223
0.713675
e33c7e802d10e88f8f61f3248f8330f67bfcc35a
59
sql
SQL
src/main/resources/db/migration/V2.13__meeting_agenda_order.sql
ituk-ttu/ITUK-API
f9b029a8b0fd0a82cebdeab3a69143d3bd368456
[ "Apache-2.0" ]
null
null
null
src/main/resources/db/migration/V2.13__meeting_agenda_order.sql
ituk-ttu/ITUK-API
f9b029a8b0fd0a82cebdeab3a69143d3bd368456
[ "Apache-2.0" ]
3
2019-12-01T13:53:47.000Z
2021-08-22T18:46:43.000Z
src/main/resources/db/migration/V2.13__meeting_agenda_order.sql
ituk-ttu/ituk-api
f9b029a8b0fd0a82cebdeab3a69143d3bd368456
[ "Apache-2.0" ]
null
null
null
ALTER TABLE meeting_agenda_item ADD COLUMN "order" VARCHAR;
59
59
0.847458
45cee54499ebc8c7d95640f284780c2c44ed1ae8
1,139
swift
Swift
Symbals/View Controllers/SettingsTableViewController.swift
aaronpearce/SF-Viwe
0636db39cb2bb127db8f698c7d5a3871494159bf
[ "MIT" ]
31
2020-01-01T01:12:10.000Z
2022-02-08T15:58:21.000Z
Symbals/View Controllers/SettingsTableViewController.swift
aaronpearce/SF-Viwe
0636db39cb2bb127db8f698c7d5a3871494159bf
[ "MIT" ]
1
2020-01-02T22:37:18.000Z
2020-01-02T23:03:48.000Z
Symbals/View Controllers/SettingsTableViewController.swift
aaronpearce/SF-Viwe
0636db39cb2bb127db8f698c7d5a3871494159bf
[ "MIT" ]
4
2020-01-02T17:01:03.000Z
2021-06-11T08:37:49.000Z
// // SettingsTableViewController.swift // Symbals // // Created by Aaron Pearce on 17/10/19. // Copyright © 2019 Sunya. All rights reserved. // import UIKit import SafariServices class SettingsTableViewController: UITableViewController { let appIdentifier = "" override func viewDidLoad() { super.viewDidLoad() // Uncomment the following line to preserve selection between presentations self.clearsSelectionOnViewWillAppear = false } @IBAction func close() { dismiss(animated: true) } override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { switch (indexPath.section, indexPath.row) { case (0, 0): showAttribution() default: break } tableView.deselectRow(at: indexPath, animated: true) } func showAttribution() { guard let url = URL(string: "https://github.com/davedelong/sfsymbols") else { return } let safariViewController = SFSafariViewController(url: url) self.present(safariViewController, animated: true) } }
27.119048
94
0.650571
5b12a4c2802e2e19f82cc5d62cf52251eeb1a74e
238
h
C
Pod/Classes/CGIndicator.h
guoshencheng/CGRefresh
8d45990eb598cf774754228d23c4b05e72a94594
[ "MIT" ]
null
null
null
Pod/Classes/CGIndicator.h
guoshencheng/CGRefresh
8d45990eb598cf774754228d23c4b05e72a94594
[ "MIT" ]
null
null
null
Pod/Classes/CGIndicator.h
guoshencheng/CGRefresh
8d45990eb598cf774754228d23c4b05e72a94594
[ "MIT" ]
null
null
null
// // CGIndicator.h // renyan // // Created by guoshencheng on 3/8/16. // Copyright © 2016 zixin. All rights reserved. // #import <UIKit/UIKit.h> @interface CGIndicator : UIView - (void)startAnimating; - (void)stopAnimating; @end
14
48
0.676471
c82b699eb1c48d9094eb65a56da4ebe160178cc5
486
swift
Swift
Flickr/Sources/Extension/UIViewController.swift
seongwonbang/Flickr
1e7ffc122565b7177a05be485d62c2d4297cb4e9
[ "MIT" ]
1
2018-10-08T02:02:18.000Z
2018-10-08T02:02:18.000Z
Flickr/Sources/Extension/UIViewController.swift
seongwonbang/Flickr
1e7ffc122565b7177a05be485d62c2d4297cb4e9
[ "MIT" ]
null
null
null
Flickr/Sources/Extension/UIViewController.swift
seongwonbang/Flickr
1e7ffc122565b7177a05be485d62c2d4297cb4e9
[ "MIT" ]
1
2018-10-08T02:02:20.000Z
2018-10-08T02:02:20.000Z
// // ViewController.swift // Flickr // // Created by 방성원 on 2018. 5. 8.. // Copyright © 2018년 makesource. All rights reserved. // import UIKit extension UIViewController { public static var defaultNib: String { return self.description().components(separatedBy: ".").dropFirst().joined(separator: ".") } public static var storyboardIdentifier: String { return self.description().components(separatedBy: ".").dropFirst().joined(separator: ".") } }
24.3
97
0.670782
73faacf060fae0177676799f6d33392caf7ff243
271
ps1
PowerShell
Private/Find-ModelFile.ps1
fvanroie/opnsense_MakeDocs
4328fa50e767ca27f45e2e19ea1b6511f87cc01c
[ "MIT" ]
null
null
null
Private/Find-ModelFile.ps1
fvanroie/opnsense_MakeDocs
4328fa50e767ca27f45e2e19ea1b6511f87cc01c
[ "MIT" ]
null
null
null
Private/Find-ModelFile.ps1
fvanroie/opnsense_MakeDocs
4328fa50e767ca27f45e2e19ea1b6511f87cc01c
[ "MIT" ]
null
null
null
Function Find-ModelFile { param ( [String[]]$BaseFolder = 'C:\opnsense' ) foreach ($folder in $Basefolder) { Get-ChildItem -Recurse -Path "$folder/*.xml" -Exclude Menu.xml, ACL.xml, forms, tests | Select-Object -ExpandProperty fullname } }
33.875
134
0.634686
9a3150ba1af8ebc4c680d7f6174402a3b947fa10
2,293
css
CSS
src/components/Preloader/Bars/preloaderBar.css
jonniebigodes/fcc-datavis
9ac8ace60fcea8555585e1a5b71e9cafdd25f337
[ "MIT" ]
null
null
null
src/components/Preloader/Bars/preloaderBar.css
jonniebigodes/fcc-datavis
9ac8ace60fcea8555585e1a5b71e9cafdd25f337
[ "MIT" ]
null
null
null
src/components/Preloader/Bars/preloaderBar.css
jonniebigodes/fcc-datavis
9ac8ace60fcea8555585e1a5b71e9cafdd25f337
[ "MIT" ]
null
null
null
.containerBars { display: flex; flex-wrap: wrap; margin: 0 auto; } .itemBars-0, .itemBars-1, .itemBars-2, .itemBars-3, .itemBars-4, .itemBars-5, .itemBars-6, .itemBars-7, .itemBars-8, .itemBars-9, .itemBars-10 { min-height: 45px; max-height: 50px; flex: calc(100%/7); border: 3px solid white; background: transparent; -webkit-transition: all 1s linear; -moz-transition: all 1s linear; -o-transition: all 1s linear; transition: all 1s linear; } .itemBars-0:nth-of-type(n) { background: #373737; } .itemBars-1:nth-of-type(n+22) { background: #373737; } .itemBars-2:nth-of-type(15) { background: #373737; } .itemBars-2:nth-of-type(22) { background: #373737; } .itemBars-2:nth-of-type(29) { background: #373737; } .itemBars-2:nth-of-type(36) { background: #373737; } .itemBars-2:nth-of-type(n+23) { background: #373737; } .itemBars-2:nth-of-type(43) { background: transparent; } .itemBars-3:nth-child(n+22) { background: #373737; } .itemBars-3:nth-child(16) { background: #373737; } .itemBars-3:nth-child(44) { background: transparent; } .itemBars-4:nth-of-type(n+22) { background: #373737; } .itemBars-4:nth-of-type(17) { background: #373737; } .itemBars-4:nth-of-type(45) { background: transparent; } .itemBars-5:nth-of-type(n+22) { background: #373737; } .itemBars-5:nth-of-type(18) { background: #373737; } .itemBars-5:nth-of-type(46) { background: transparent; } .itemBars-6:nth-of-type(n+22) { background: #373737; } .itemBars-6:nth-of-type(19) { background: #373737; } .itemBars-6:nth-of-type(47) { background: transparent; } .itemBars-7:nth-of-type(n+22) { background: #373737; } .itemBars-7:nth-of-type(20) { background: #373737; } .itemBars-7:nth-of-type(48) { background: transparent; } .itemBars-8:nth-of-type(n+22) { background: #373737; } .itemBars-8:nth-of-type(21) { background: #373737; } .itemBars-8:nth-of-type(49) { background: transparent; } .itemBars-9:nth-of-type(n+22) { background: #373737; } .itemBars-10:nth-of-type(n) { background: #373737; }
19.432203
38
0.596162
5703afb096077722b0d69438f00f31dd3eb3788a
489
kt
Kotlin
conductor-extra-screen/src/main/java/nolambda/screen/Screen.kt
esafirm/conductor-extra
304262c284ab117808afd7c68e45360d7c606b4f
[ "MIT" ]
1
2019-08-18T18:08:52.000Z
2019-08-18T18:08:52.000Z
conductor-extra-screen/src/main/java/nolambda/screen/Screen.kt
esafirm/conductor-extra
304262c284ab117808afd7c68e45360d7c606b4f
[ "MIT" ]
6
2017-09-23T07:05:40.000Z
2018-10-16T13:00:46.000Z
conductor-extra-screen/src/main/java/nolambda/screen/Screen.kt
esafirm/conductor-extra
304262c284ab117808afd7c68e45360d7c606b4f
[ "MIT" ]
null
null
null
package nolambda.screen import android.os.Bundle import com.esafirm.conductorextra.common.onEvent abstract class Screen : BaseScreen { constructor() : super() constructor(args: Bundle?) : super(args) init { onEvent( onPostAttach = { render() }, onPostCreateView = { initView() } ) } /** This function called after [onCreateView] **/ protected fun initView() { // NO-OP } abstract fun render() }
19.56
53
0.591002
a1817aff70c27f782893634555fc4b1e58878352
2,676
sql
SQL
sql/functions.sql
pdehaan/postflux
7a9ff16a622f085f957b564b64487ab24c5b7f6a
[ "MIT" ]
3
2015-08-12T21:45:05.000Z
2015-10-23T02:30:58.000Z
sql/functions.sql
pdehaan/postflux
7a9ff16a622f085f957b564b64487ab24c5b7f6a
[ "MIT" ]
1
2015-05-24T00:51:40.000Z
2015-05-24T00:51:40.000Z
sql/functions.sql
pdehaan/postflux
7a9ff16a622f085f957b564b64487ab24c5b7f6a
[ "MIT" ]
1
2015-05-24T00:48:13.000Z
2015-05-24T00:48:13.000Z
CREATE OR REPLACE FUNCTION influx_post(input JSON) RETURNS INTEGER as $$ DECLARE col TEXT; table_cols TEXT[]; data_cols TEXT[]; querybits TEXT[]; valuerow JSON; textrows TEXT[]; arrayrow TEXT[]; value TEXT; data JSON; total INTEGER = 0; qrytxt TEXT; BEGIN FOR data IN SELECT json_array_elements(input) LOOP querybits = ARRAY[]::TEXT[]; textrows = ARRAY[]::TEXT[]; SELECT INTO data_cols array_agg(cols) FROM (SELECT json_array_elements_text(data->'columns') cols) data; IF NOT EXISTS (SELECT * FROM pg_tables WHERE schemaname='public' AND tablename=data->>'name') THEN --create table FOREACH col IN ARRAY data_cols LOOP IF (SELECT NOT(col = ANY('{time,sequence_number}'::TEXT[]))) THEN SELECT array_append(querybits, format('%I TEXT', col)) INTO querybits; END IF; END LOOP; EXECUTE format('CREATE TABLE %I (time BIGINT NOT NULL DEFAULT (EXTRACT(EPOCH FROM now()) * 1000 + EXTRACT(MICROSECONDS FROM now())), sequence_number SERIAL, ', data->>'name') || array_to_string(querybits, ', ') || ')'; ELSE SELECT INTO table_cols array_agg(column_name::text) AS col FROM information_schema.columns WHERE table_schema='public' AND table_name=data->>'name'; IF NOT (table_cols @> data_cols) THEN --alter table FOREACH col IN ARRAY data_cols LOOP IF (SELECT NOT(col = ANY(table_cols))) THEN SELECT array_append(querybits, format('ADD COLUMN %I TEXT', col)) INTO querybits; END IF; END LOOP; EXECUTE format('ALTER TABLE %I', data->>'name') || array_to_string(querybits, ', '); END IF; END IF; --insert FOR valuerow IN SELECT json_array_elements(data->'points') LOOP querybits = ARRAY[]::TEXT[]; SELECT INTO arrayrow array_agg(vals) FROM (SELECT json_array_elements_text(valuerow) vals) ars; FOREACH value IN ARRAY arrayrow LOOP SELECT array_append(querybits, format('%L', value)) INTO querybits; END LOOP; SELECT array_append(textrows, '(' || array_to_string(querybits, ', ') || ')') INTO textrows; END LOOP; qrytxt = format('INSERT INTO %I ', data->>'name') || '(' || array_to_string(data_cols, ', ') || ') VALUES ' || array_to_string(textrows, ', '); EXECUTE qrytxt; total = total + cardinality(textrows); END LOOP; RETURN total; END; $$ language 'plpgsql';
46.137931
230
0.589312
ac692c189197ec5cf4c81d335c7b625824ba6749
517
kt
Kotlin
app/src/main/java/com/cleteci/redsolidaria/ui/fragments/advancedsearch/AdvancedSearchContract.kt
JusticeInternational/RedSol-android
766168e2c5655f36e0e1898542f8ccb831d7da75
[ "MIT" ]
1
2020-04-04T00:08:58.000Z
2020-04-04T00:08:58.000Z
app/src/main/java/com/cleteci/redsolidaria/ui/fragments/advancedsearch/AdvancedSearchContract.kt
JusticeInternational/RedSol-android
766168e2c5655f36e0e1898542f8ccb831d7da75
[ "MIT" ]
4
2020-05-25T15:45:28.000Z
2021-06-21T18:08:09.000Z
app/src/main/java/com/cleteci/redsolidaria/ui/fragments/advancedsearch/AdvancedSearchContract.kt
JusticeInternational/RedSol-android
766168e2c5655f36e0e1898542f8ccb831d7da75
[ "MIT" ]
1
2020-04-04T00:09:08.000Z
2020-04-04T00:09:08.000Z
package com.cleteci.redsolidaria.ui.fragments.advancedsearch import com.cleteci.redsolidaria.models.Category import com.cleteci.redsolidaria.ui.base.BaseContract /** * Created by ogulcan on 07/02/2018. */ class AdvancedSearchContract { interface View: BaseContract.View { fun init() fun loadDataSuccess(list: List<Category>) } interface Presenter: BaseContract.Presenter<AdvancedSearchContract.View> { //fun onDrawerOptionAboutClick() fun search(data: String) } }
25.85
78
0.727273
5dfbd608de6c177c624ad4b5ed3d6817e7ba4bc5
1,021
go
Go
helper/basic/str/cast.go
ehwjh2010/cobra
04420d97fadaf651d0363e66d102dd57c32a3afd
[ "Apache-2.0" ]
null
null
null
helper/basic/str/cast.go
ehwjh2010/cobra
04420d97fadaf651d0363e66d102dd57c32a3afd
[ "Apache-2.0" ]
null
null
null
helper/basic/str/cast.go
ehwjh2010/cobra
04420d97fadaf651d0363e66d102dd57c32a3afd
[ "Apache-2.0" ]
null
null
null
package str import ( "github.com/ehwjh2010/viper/verror" "go.uber.org/zap/buffer" ) //=================str与interface转化================== func Str2Any(v string) interface{} { return v } func Any2String(v interface{}) (string, error) { if dst, ok := v.(string); !ok { return "", verror.CastStringError(v) } else { return dst, nil } } func MustAny2String(v interface{}) string { dst, _ := Any2String(v) return dst } func SliceStr2Any(vs []string) []interface{} { if vs == nil { return nil } rs := make([]interface{}, len(vs)) for i, v := range vs { rs[i] = v } return rs } func SliceAny2Str(vs []interface{}) ([]string, error) { if vs == nil { return nil, nil } rs := make([]string, len(vs)) for i, v := range vs { value, err := Any2String(v) if err != nil { return nil, err } rs[i] = value } return rs, nil } //=================str与bytes转化================== func Str2Bytes(v string) []byte { var buff buffer.Buffer _, _ = buff.WriteString(v) return buff.Bytes() }
15.469697
55
0.576885
cf353fd347c001a0ee82fef17052806739dabd32
1,897
css
CSS
data/usercss/145365.user.css
33kk/uso-archive
2c4962d1d507ff0eaec6dcca555efc531b37a9b4
[ "MIT" ]
118
2020-08-28T19:59:28.000Z
2022-03-26T16:28:40.000Z
data/usercss/145365.user.css
33kk/uso-archive
2c4962d1d507ff0eaec6dcca555efc531b37a9b4
[ "MIT" ]
38
2020-09-02T01:08:45.000Z
2022-01-23T02:47:24.000Z
data/usercss/145365.user.css
33kk/uso-archive
2c4962d1d507ff0eaec6dcca555efc531b37a9b4
[ "MIT" ]
21
2020-08-19T01:12:43.000Z
2022-03-15T21:55:17.000Z
/* ==UserStyle== @name SAMIE ROSA @namespace USO Archive @author Ahlai Flores @description `Es el samie rosa, solo para los conocedores` @version 20171108.20.58 @license CC0-1.0 @preprocessor uso ==/UserStyle== */ @-moz-document url("http://samie.prepaenlinea.sep.gob.mx/principal.php") { body { /*Coloca la imagen de fondo*/ background-image: url("https://s-media-cache-ak0.pinimg.com/736x/0b/bf/ec/0bbfec448c56df9bc204147e7cc023cf--pattern-background-background-paper.jpg"); background-repeat:repeat; color:black; } #menu { /*Coloca el color del menu*/ /* http://www.colorzilla.com/gradient-editor/ */ background: #cb60b3; /* Old browsers */ background: -moz-linear-gradient(top, #cb60b3 0%, #ad1283 50%, #de47ac 100%); /* FF3.6-15 */ background: -webkit-linear-gradient(top, #cb60b3 0%,#ad1283 50%,#de47ac 100%); /* Chrome10-25,Safari5.1-6 */ background: linear-gradient(to bottom, #cb60b3 0%,#ad1283 50%,#de47ac 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ } #menu { font-family: Arial; font-size: 15px; text-shadow: 1px 1px 20px #fff; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)!important; border: none !important; } table.dataTable.stripe tbody tr.odd, table.dataTable.display tbody tr.odd { background-color: #eaeaea; opacity: 0.9; filter: alpha(opacity=50) } table.dataTable tbody tr { background-color: white; opacity: 0.9; filter: alpha(opacity=50) } table.dataTable thead th, table.dataTable thead td { border: 0px !important; } #lista { box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); border-radius: 30px 30px 0 0; } }
25.986301
155
0.603057
b1ac1f48ac6448212ace1a5032b7f87b18f8707d
2,704
ps1
PowerShell
setup-eventsubscription.ps1
ayuina/azure-function-cicd
e8d972cb80a5ac621b47078dbc1e2f0442e1311c
[ "MIT" ]
null
null
null
setup-eventsubscription.ps1
ayuina/azure-function-cicd
e8d972cb80a5ac621b47078dbc1e2f0442e1311c
[ "MIT" ]
null
null
null
setup-eventsubscription.ps1
ayuina/azure-function-cicd
e8d972cb80a5ac621b47078dbc1e2f0442e1311c
[ "MIT" ]
null
null
null
[CmdletBinding] $rgname = "$env:prefix-rg" $funcappname = "$env:prefix-func" $funcname = "thumbnail" $strname = "{0}str" -f $env:prefix.Replace('-', '') $container = "images" ### https://ronaldwildenberg.com/azure/2018/03/08/simple-way-to-get-arm-access-token-powershell.html write-host "retrieving access token " $tokens = (Get-AzContext).TokenCache().ReadItems() ` | Where-Object {$_.TenantId -eq $env:AAD_SP_TENANT } ` | Sort-Object -Property ExpiresOn -Descending $accessToken = $tokens[0].AccessToken ### write-host "retrieving function keys " $manageurl = "https://management.azure.com{0}/host/default/listKeys?api-version=2018-02-01" -f $targetFunc.id Invoke-RestMethod -Method Post -Uri $manageurl -Headers @{ "Authorization" = "Bearer " + $accessToken } ` | ConvertFrom-Json | Set-Variable funckeys $funcKeys ### write-host "eventGrid" $endpoint = ("https://{0}.azurewebsites.net/runtime/webhooks/EventGrid?functionName={1}&code={2}" ` -f $funcappname, $funcname, $funcKeys.systemKeys.eventgrid_extension ) $filter = "/blobServices/default/containers/$container/blobs/" $strid = (Get-AzStorageAccount -ResourceGroupName $rgname -Name $strname).Id New-AzEventGridSubscription -ResourceGroupName $rgname -EventSubscriptionName "blob-crfeated" ` -ResourceId $strid -Endpoint $endpoint -SubjectBeginsWith $filter -IncludedEventType "Microsoft.Storage.BlobCreated" # az login --service-principal -t $env:AAD_SP_TENANT -u $env:AAD_SP_APP -p $env:AAD_SP_KEY # az account list -o table # $rgname = "$env:prefix-rg" # $funcappname = "$env:prefix-func" # $funcname = "thumbnail" # $strname = "{0}str" -f $env:prefix.Replace('-', '') # $container = "images" # ### # write-host "retrieving target function app : $funcappname" # az functionapp show -g $rgname -n $funcappname | ConvertFrom-Json | Set-Variable targetFunc # ### # write-host "retrieving function keys " # $manageurl = "{0}/host/default/listKeys?api-version=2018-02-01" -f $targetFunc.id # az rest --method post --uri $manageurl | ConvertFrom-Json | Set-Variable funcKeys # ### # $endpoint = ("https://{0}.azurewebsites.net/runtime/webhooks/EventGrid?functionName={1}&code={2}" ` # -f $funcappname, $funcname, $funcKeys.systemKeys.eventgrid_extension ) # write-host "event grid subscription : $endpoint" # az eventgrid resource event-subscription create -g $rgname ` # --provider-namespace Microsoft.Storage --resource-type storageAccounts ` # --resource-name $strname --name "image-subscription" ` # --included-event-types Microsoft.Storage.BlobCreated ` # --subject-begins-with "/blobServices/default/containers/$container/blobs/" ` # --endpoint $endpoint
41.6
121
0.713018
ea0b6867bedf4c1d52e1c7faf4b8f7d180cf0c90
8,645
dart
Dart
lib/layouts/widgets/message_widget/message_content/message_attachment.dart
Morpheus636/bluebubbles-app-workflow-testing
af5c16fa863234d7a93339616490d97e7ea3f229
[ "Apache-2.0" ]
null
null
null
lib/layouts/widgets/message_widget/message_content/message_attachment.dart
Morpheus636/bluebubbles-app-workflow-testing
af5c16fa863234d7a93339616490d97e7ea3f229
[ "Apache-2.0" ]
null
null
null
lib/layouts/widgets/message_widget/message_content/message_attachment.dart
Morpheus636/bluebubbles-app-workflow-testing
af5c16fa863234d7a93339616490d97e7ea3f229
[ "Apache-2.0" ]
null
null
null
import 'package:bluebubbles/helpers/attachment_downloader.dart'; import 'package:bluebubbles/helpers/attachment_helper.dart'; import 'package:bluebubbles/helpers/navigator.dart'; import 'package:bluebubbles/helpers/ui_helpers.dart'; import 'package:bluebubbles/helpers/utils.dart'; import 'package:bluebubbles/layouts/widgets/circle_progress_bar.dart'; import 'package:bluebubbles/layouts/widgets/message_widget/message_content/attachment_downloader_widget.dart'; import 'package:bluebubbles/layouts/widgets/message_widget/message_content/media_file.dart'; import 'package:bluebubbles/layouts/widgets/message_widget/message_content/media_players/audio_player_widget.dart'; import 'package:bluebubbles/layouts/widgets/message_widget/message_content/media_players/contact_widget.dart'; import 'package:bluebubbles/layouts/widgets/message_widget/message_content/media_players/image_widget.dart'; import 'package:bluebubbles/layouts/widgets/message_widget/message_content/media_players/location_widget.dart'; import 'package:bluebubbles/layouts/widgets/message_widget/message_content/media_players/regular_file_opener.dart'; import 'package:bluebubbles/layouts/widgets/message_widget/message_content/media_players/video_widget.dart'; import 'package:bluebubbles/repository/models/models.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; class MessageAttachment extends StatefulWidget { MessageAttachment({ Key? key, required this.attachment, required this.updateAttachment, required this.isFromMe, }) : super(key: key); final Attachment attachment; final Function() updateAttachment; final bool isFromMe; @override MessageAttachmentState createState() => MessageAttachmentState(); } class MessageAttachmentState extends State<MessageAttachment> with AutomaticKeepAliveClientMixin { Widget? attachmentWidget; dynamic content; @override void initState() { super.initState(); updateContent(); ever(Get.find<AttachmentDownloadService>().downloaders, (List<String> downloaders) { if (downloaders.contains(widget.attachment.guid)) { if (mounted) setState(() {}); } }); } void updateContent() async { // Ge the current attachment content (status) content = AttachmentHelper.getContent(widget.attachment, path: widget.attachment.guid == "redacted-mode-demo-attachment" || widget.attachment.guid!.contains("theme-selector") ? widget.attachment.transferName : null); // If we can download it, do so if (await AttachmentHelper.canAutoDownload() && content is Attachment) { if (mounted) { setState(() { content = Get.put(AttachmentDownloadController(attachment: content), tag: content.guid); }); } } } @override Widget build(BuildContext context) { super.build(context); updateContent(); return ClipRRect( borderRadius: BorderRadius.circular(20), child: Container( constraints: BoxConstraints( maxWidth: CustomNavigator.width(context) * 0.5, maxHeight: context.height * 0.6, ), child: _buildAttachmentWidget(), ), ); } Widget _buildAttachmentWidget() { // If it's a file, it's already been downlaoded, so just display it if (content is PlatformFile) { String? mimeType = widget.attachment.mimeType; if (mimeType != null) mimeType = mimeType.substring(0, mimeType.indexOf("/")); if (mimeType == "image") { return MediaFile( attachment: widget.attachment, child: ImageWidget( file: content, attachment: widget.attachment, ), ); } else if (mimeType == "video") { if (kIsDesktop) { return MediaFile( attachment: widget.attachment, child: RegularFileOpener( file: content, attachment: widget.attachment, ), ); } return MediaFile( attachment: widget.attachment, child: VideoWidget( attachment: widget.attachment, file: content, ), ); } else if (mimeType == "audio" && !widget.attachment.mimeType!.contains("caf")) { return MediaFile( attachment: widget.attachment, child: AudioPlayerWidget(file: content, context: context, width: kIsDesktop ? null : 250, isFromMe: widget.isFromMe), ); } else if (widget.attachment.mimeType == "text/x-vlocation" || widget.attachment.uti == 'public.vlocation') { return MediaFile( attachment: widget.attachment, child: LocationWidget( file: content, attachment: widget.attachment, ), ); } else if (widget.attachment.mimeType == "text/vcard") { return MediaFile( attachment: widget.attachment, child: ContactWidget( file: content, attachment: widget.attachment, ), ); } else if (widget.attachment.mimeType == null) { return Container(); } else { return MediaFile( attachment: widget.attachment, child: RegularFileOpener( file: content, attachment: widget.attachment, ), ); } // If it's an attachment, then it needs to be manually downloaded } else if (content is Attachment) { return AttachmentDownloaderWidget( onPressed: () { content = Get.put(AttachmentDownloadController(attachment: content), tag: content.guid); if (mounted) setState(() {}); }, attachment: content, placeHolder: buildPlaceHolder(widget), ); // If it's an AttachmentDownloader, it is currently being downloaded } else if (content is AttachmentDownloadController) { if (widget.attachment.mimeType == null) return Container(); return Obx(() { // If there is an error, return an error text if (content.error.value) { content = widget.attachment; return AttachmentDownloaderWidget( onPressed: () { content = Get.put(AttachmentDownloadController(attachment: content), tag: content.guid); if (mounted) setState(() {}); }, attachment: content, placeHolder: buildPlaceHolder(widget), ); } // If the snapshot data is a file, we have finished downloading if (content.file.value != null) { content = content.file.value; return _buildAttachmentWidget(); } return Stack( alignment: Alignment.center, children: <Widget>[ buildPlaceHolder(widget), Row( mainAxisSize: MainAxisSize.min, children: <Widget>[ Column( mainAxisSize: MainAxisSize.min, children: <Widget>[ Center( child: Container( height: 40, width: 40, child: CircleProgressBar( value: content.progress.value?.toDouble() ?? 0, backgroundColor: Colors.grey, foregroundColor: Colors.white, ), ), ), ((content as AttachmentDownloadController).attachment.mimeType != null) ? Container(height: 5.0) : Container(), (content.attachment.mimeType != null) ? Container( height: 50, alignment: Alignment.center, child: Text( content.attachment.mimeType, style: Theme.of(context).textTheme.bodyText1, maxLines: 2, overflow: TextOverflow.ellipsis, ), ) : Container() ], ), ], ), ], ); }); } else { return Text( "Error loading", style: Theme.of(context).textTheme.bodyText1, ); // return Container(); } } Widget buildPlaceHolder(MessageAttachment parent) { return buildImagePlaceholder(context, widget.attachment, Container()); } @override bool get wantKeepAlive => true; }
35.871369
127
0.595489
d93dfde36d56cbfb4bcb07cce5ace61a56237e9a
284
asm
Assembly
src/mods/tiberium4_blocks_infantry.asm
mvdhout1992/ts-patches
a426970abeb6993eea6703d1a756fd74489ffed2
[ "MIT" ]
33
2016-07-30T14:17:28.000Z
2021-12-19T15:45:19.000Z
src/mods/tiberium4_blocks_infantry.asm
A-Productions/ts-patches
326db731f7226d9e803feab475777c730688634e
[ "MIT" ]
73
2018-08-17T00:25:19.000Z
2021-05-10T08:31:15.000Z
src/mods/tiberium4_blocks_infantry.asm
A-Productions/ts-patches
326db731f7226d9e803feab475777c730688634e
[ "MIT" ]
18
2017-05-16T11:28:06.000Z
2022-03-20T20:41:03.000Z
; Infantry Cannot Walk Over Tiberium 4 ; OverlayTypes indexes 27 to 38 (fourth Tiberium images) are hardcoded to be ; impassable by infantry. This hack removes this. ; Author: AlexB ; Date: 2016-11-24 %include "macros/patch.inc" @SJMP 0x004D54E7, 0x004D5507; jmp short loc_4D5507
23.666667
76
0.764085
41a42ee6fbe8feddba9907975f66761d6906644f
114,728
h
C
sdk/sdk/driver/openvg/iteHardware.h
doyaGu/C0501Q_HWJL01
07a71328bd9038453cbb1cf9c276a3dd1e416d63
[ "MIT" ]
1
2021-10-09T08:05:50.000Z
2021-10-09T08:05:50.000Z
sdk/sdk/driver/openvg/iteHardware.h
doyaGu/C0501Q_HWJL01
07a71328bd9038453cbb1cf9c276a3dd1e416d63
[ "MIT" ]
null
null
null
sdk/sdk/driver/openvg/iteHardware.h
doyaGu/C0501Q_HWJL01
07a71328bd9038453cbb1cf9c276a3dd1e416d63
[ "MIT" ]
null
null
null
/* */ #ifndef __ITEHARDWARE_H #define __ITEHARDWARE_H #include "openvg.h" #include "iteDefs.h" #include "iteVectors.h" #include "itePath.h" /* ======================================== */ /* ITE Register */ /* ======================================== */ //====================================== // Base address //====================================== #define ITE_VG_AHB_REG_BASE 0xD0600000 #define ITE_VG_HOST_REG_BASE 0x6C00 //====================================== //Tessellation Control Register //====================================== #define ITE_VG_REG_TCR_BASE 0x000 // // D[31:12] Minter limit length (12.8) // #define ITE_VG_CMDSHIFT_MITERLIMIT 12 #define ITE_VG_CMDMASK_MITERLIMIT 0xFFFFF000 // // D[15:14] Join Type // 00: Miter // 01: Round // 10: Bevel // #define ITE_VG_CMD_JOINTYPE_MITER 0x00000000 #define ITE_VG_CMD_JOINTYPE_ROUND 0x00004000 #define ITE_VG_CMD_JOINTYPE_BEVEL 0x00008000 #define ITE_VG_CMDSHIFT_JOINTYPE 14 #define ITE_VG_CMDMASK_JOINTYPE 0x0000C000 // // D[13:12] Cap Type // 00: Square // 01: Round // 10: BUTT // #define ITE_VG_CMD_CAPTYPE_SQUARE 0x00000000 #define ITE_VG_CMD_CAPTYPE_ROUND 0x00001000 #define ITE_VG_CMD_CAPTYPE_BUTT 0x00002000 #define ITE_VG_CMDSHIFT_CAPTYPE 12 #define ITE_VG_CMDMASK_CAPTYPE 0x00003000 // // D[11] Enable Perspective transform // #define ITE_VG_CMD_PERSPECTIVE_EN 0x00000800 // // D[10] Enable Transform // #define ITE_VG_CMD_TRANSFORM_EN 0x00000400 // // D[9] Stroked line dash phase reset // #define ITE_VG_CMD_DASHPHASERESET 0x00000200 // // D[8] Enable Stroked path // #define ITE_VG_CMD_STROKEPATH 0x00000100 // // D[3] Tessellation Debug bit // 0: Disable // 1: Enable // #define ITE_VG_CMD_TELDEBUGEN 0x00000008 // // D[2] Caculate boundary bit // 0: Disable // 1: Enable // #define ITE_VG_CMD_CALBOUNDARY 0x00000004 // // D[1] Read memory bit // Data of tesselation from memory or not // 0: Disable // 1: Enable // #define ITE_VG_CMD_READMEM 0x00000002 // // D[1] Tesseleation engine enable bit // 0: Disable // 1: Enable // #define ITE_VG_CMD_TELWORK 0x00000001 //====================================== //Tessellation Control Register End //====================================== //====================================== //Line Width Register //====================================== #define ITE_VG_REG_LWR_BASE 0x004 // // D[24:0] The Width of Stroked line (S12.12) // #define ITE_VG_CMDSHIFT_LINEWIDTH 0 #define ITE_VG_CMDMASK_LINEWIDTH 0x01FFFFFF //====================================== //Line Width Register End //====================================== //====================================== //Stroke Round Number Register //====================================== #define ITE_VG_REG_SRNR_BASE 0x008 // // D[20:16] Total Dash line pattern count // #define ITE_VG_CMDSHIFT_DASHCOUNT 24 #define ITE_VG_CMDMASK_DASHCOUNT 0x1F000000 // // D[11:0] Divide the stroke round to the number // #define ITE_VG_CMDSHIFT_STROKEROUNDNUM 0 #define ITE_VG_CMDMASK_STROKEROUNDNUM 0x00000FFF // // D[6] Shift rounding: Enable rounding with right shift in TL shift ALU. // #define ITE_VG_CMD_SHIFTROUNDING 0x00000040 // // D[4] Join Round 0: Bevel join in Bezier and arc curves // 1: Round join in Bezier and arc curves #define ITE_VG_CMD_JOINROUND 0x00000030 //====================================== //Stroke Round Number Register End //====================================== //====================================== //Frame Number Register //====================================== #define ITE_VG_REG_FNR_BASE 0x00C // // D[31] // #define ITE_VG_CMD_PROBE_NOT 0x80000000 // // D[29:24] // #define ITE_VG_CMDSHIFT_PROBEMUX 24 #define ITE_VG_CMDMASK_PROBEMUX 0x3F000000 // // D[21:20] // #define ITE_VG_CMDSHIFT_DEBUGBDY 20 #define ITE_VG_CMDMASK_DEBUGBDY 0x00300000 // // D[18] // #define ITE_VG_CMD_FRAM_END 0x00040000 // // D[17] // #define ITE_VG_CMD_FRAM_START 0x00020000 // // D[16] // #define ITE_VG_CMD_FRAM_EN 0x00010000 // // D[15:0] OpenVG state is busy at least of No. of HCLK. // #define ITE_VG_CMDSHIFT_FRAMENUM 0 #define ITE_VG_CMDMASK_FRAMENUM 0x0000FFFF //====================================== //Frame Number Register End //====================================== //====================================== //Path Length Register //====================================== #define ITE_VG_REG_PLR_BASE 0x010 // // D[31:0] Path Length in Byte. (32 bits alignment) // #define ITE_VG_CMDSHIFT_PATHLENGTH 0 #define ITE_VG_CMDMASK_PATHLENGTH 0xFFFFFFFF //====================================== //Path Length Register End //====================================== //====================================== //Path Base Register //====================================== #define ITE_VG_REG_PBR_BASE 0x014 // // D[31:0] Path Base Address. (32 bits alignment) // #define ITE_VG_CMDSHIFT_PATHBASE 0 #define ITE_VG_CMDMASK_PATHBASE 0xFFFFFFFF //====================================== //Path Base Register End //====================================== //====================================== //Tessellation Length Register //====================================== #define ITE_VG_REG_TLR_BASE 0x018 // // D[31:0] Tessellation Length in Byte. (32 bits alignment) // #define ITE_VG_CMDSHIFT_TELLENGTH 0 #define ITE_VG_CMDMASK_TELLENGTH 0xFFFFFFFF //====================================== //Tessellation Length Register End //====================================== //====================================== //Tessellation Base Register //====================================== #define ITE_VG_REG_TBR_BASE 0x01C // // D[31:0] Tessellation Base Address. (32 bits alignment) // #define ITE_VG_CMDSHIFT_TELBASE 0 #define ITE_VG_CMDMASK_TELBASE 0xFFFFFFFF //====================================== //Tessellation Base Register End //====================================== //====================================== //User Transform 00 Register //====================================== #define ITE_VG_REG_UTR00_BASE 0x020 // // D[28:0] User Transform Parameter 00(s12.16) // #define ITE_VG_CMDSHIFT_USRXFMS00 0 #define ITE_VG_CMDMASK_USRXFMS00 0x1FFFFFFF //====================================== //User Transform 00 Register End //====================================== //====================================== //User Transform 01 Register //====================================== #define ITE_VG_REG_UTR01_BASE 0x024 // // D[28:0] User Transform Parameter 01(s12.16) // #define ITE_VG_CMDSHIFT_USRXFMS01 0 #define ITE_VG_CMDMASK_USRXFMS01 0x1FFFFFFF //====================================== //User Transform 01 Register End //====================================== //====================================== //User Transform 02 Register //====================================== #define ITE_VG_REG_UTR02_BASE 0x028 // // D[28:0] User Transform Parameter 02(s12.16) // #define ITE_VG_CMDSHIFT_USRXFMS02 0 #define ITE_VG_CMDMASK_USRXFMS02 0x1FFFFFFF //====================================== //User Transform 02 Register End //====================================== //====================================== //User Transform 10 Register //====================================== #define ITE_VG_REG_UTR10_BASE 0x02C // // D[28:0] User Transform Parameter 10(s12.16) // #define ITE_VG_CMDSHIFT_USRXFMS10 0 #define ITE_VG_CMDMASK_USRXFMS10 0x1FFFFFFF //====================================== //User Transform 10 Register End //====================================== //====================================== //User Transform 11 Register //====================================== #define ITE_VG_REG_UTR11_BASE 0x030 // // D[28:0] User Transform Parameter 11(s12.16) // #define ITE_VG_CMDSHIFT_USRXFMS11 0 #define ITE_VG_CMDMASK_USRXFMS11 0x1FFFFFFF //====================================== //User Transform 11 Register End //====================================== //====================================== //User Transform 12 Register //====================================== #define ITE_VG_REG_UTR12_BASE 0x034 // // D[28:0] User Transform Parameter 12(s12.16) // #define ITE_VG_CMDSHIFT_USRXFMS12 0 #define ITE_VG_CMDMASK_USRXFMS12 0x1FFFFFFF //====================================== //User Transform 12 Register End //====================================== //====================================== //User Transform 20 Register //====================================== #define ITE_VG_REG_UTR20_BASE 0x038 // // D[28:0] User Transform Parameter 20(s12.16) // #define ITE_VG_CMDSHIFT_USRXFMS20 0 #define ITE_VG_CMDMASK_USRXFMS20 0x1FFFFFFF //====================================== //User Transform 20 Register End //====================================== //====================================== //User Transform 21 Register //====================================== #define ITE_VG_REG_UTR21_BASE 0x03C // // D[28:0] User Transform Parameter 21(s12.16) // #define ITE_VG_CMDSHIFT_USRXFMS21 0 #define ITE_VG_CMDMASK_USRXFMS21 0x1FFFFFFF //====================================== //User Transform 21 Register End //====================================== //====================================== //User Transform 22 Register //====================================== #define ITE_VG_REG_UTR22_BASE 0x040 // // D[28:0] User Transform Parameter 22(s12.16) // #define ITE_VG_CMDSHIFT_USRXFMS22 0 #define ITE_VG_CMDMASK_USRXFMS22 0x1FFFFFFF //====================================== //User Transform 22 Register End //====================================== //====================================== //Dash Pattern 00 Register //====================================== #define ITE_VG_REG_DPR00_BASE 0x044 // // D[23:0] Dash Line Pattern 00 (MSB: Enable bit, s12.11) // #define ITE_VG_CMDSHIFT_DASHPAT00 0 #define ITE_VG_CMDMASK_DASHPAT00 0x00FFFFFF //====================================== //Dash Pattern 00 Register End //====================================== //====================================== //Dash Pattern 01 Register //====================================== #define ITE_VG_REG_DPR01_BASE 0x048 // // D[23:0] Dash Line Pattern 01 (MSB: Enable bit, s12.11) // #define ITE_VG_CMDSHIFT_DASHPAT01 0 #define ITE_VG_CMDMASK_DASHPAT01 0x00FFFFFF //====================================== //Dash Pattern 01 Register End //====================================== //====================================== //Dash Pattern 02 Register //====================================== #define ITE_VG_REG_DPR02_BASE 0x04C // // D[23:0] Dash Line Pattern 02 (MSB: Enable bit, s12.11) // #define ITE_VG_CMDSHIFT_DASHPAT02 0 #define ITE_VG_CMDMASK_DASHPAT02 0x00FFFFFF //====================================== //Dash Pattern 02 Register End //====================================== //====================================== //Dash Pattern 03 Register //====================================== #define ITE_VG_REG_DPR03_BASE 0x050 // // D[23:0] Dash Line Pattern 03 (MSB: Enable bit, s12.11) // #define ITE_VG_CMDSHIFT_DASHPAT03 0 #define ITE_VG_CMDMASK_DASHPAT03 0x00FFFFFF //====================================== //Dash Pattern 03 Register End //====================================== //====================================== //Dash Pattern 04 Register //====================================== #define ITE_VG_REG_DPR04_BASE 0x054 // // D[23:0] Dash Line Pattern 04 (MSB: Enable bit, s12.11) // #define ITE_VG_CMDSHIFT_DASHPAT04 0 #define ITE_VG_CMDMASK_DASHPAT04 0x00FFFFFF //====================================== //Dash Pattern 04 Register End //====================================== //====================================== //Dash Pattern 05 Register //====================================== #define ITE_VG_REG_DPR05_BASE 0x058 // // D[23:0] Dash Line Pattern 05 (MSB: Enable bit, s12.11) // #define ITE_VG_CMDSHIFT_DASHPAT05 0 #define ITE_VG_CMDMASK_DASHPAT05 0x00FFFFFF //====================================== //Dash Pattern 05 Register End //====================================== //====================================== //Dash Pattern 06 Register //====================================== #define ITE_VG_REG_DPR06_BASE 0x05C // // D[23:0] Dash Line Pattern 06 (MSB: Enable bit, s12.11) // #define ITE_VG_CMDSHIFT_DASHPAT06 0 #define ITE_VG_CMDMASK_DASHPAT06 0x00FFFFFF //====================================== //Dash Pattern 06 Register End //====================================== //====================================== //Dash Pattern 07 Register //====================================== #define ITE_VG_REG_DPR07_BASE 0x060 // // D[23:0] Dash Line Pattern 07 (MSB: Enable bit, s12.11) // #define ITE_VG_CMDSHIFT_DASHPAT07 0 #define ITE_VG_CMDMASK_DASHPAT07 0x00FFFFFF //====================================== //Dash Pattern 07 Register End //====================================== //====================================== //Dash Pattern 08 Register //====================================== #define ITE_VG_REG_DPR08_BASE 0x064 // // D[23:0] Dash Line Pattern 08 (MSB: Enable bit, s12.11) // #define ITE_VG_CMDSHIFT_DASHPAT08 0 #define ITE_VG_CMDMASK_DASHPAT08 0x00FFFFFF //====================================== //Dash Pattern 08 Register End //====================================== //====================================== //Dash Pattern 09 Register //====================================== #define ITE_VG_REG_DPR09_BASE 0x068 // // D[23:0] Dash Line Pattern 09 (MSB: Enable bit, s12.11) // #define ITE_VG_CMDSHIFT_DASHPAT09 0 #define ITE_VG_CMDMASK_DASHPAT09 0x00FFFFFF //====================================== //Dash Pattern 09 Register End //====================================== //====================================== //Dash Pattern 10 Register //====================================== #define ITE_VG_REG_DPR10_BASE 0x06C // // D[23:0] Dash Line Pattern 10 (MSB: Enable bit, s12.11) // #define ITE_VG_CMDSHIFT_DASHPAT10 0 #define ITE_VG_CMDMASK_DASHPAT10 0x00FFFFFF //====================================== //Dash Pattern 10 Register End //====================================== //====================================== //Dash Pattern 11 Register //====================================== #define ITE_VG_REG_DPR11_BASE 0x070 // // D[23:0] Dash Line Pattern 11 (MSB: Enable bit, s12.11) // #define ITE_VG_CMDSHIFT_DASHPAT11 0 #define ITE_VG_CMDMASK_DASHPAT11 0x00FFFFFF //====================================== //Dash Pattern 11 Register End //====================================== //====================================== //Dash Pattern 12 Register //====================================== #define ITE_VG_REG_DPR12_BASE 0x074 // // D[23:0] Dash Line Pattern 12 (MSB: Enable bit, s12.11) // #define ITE_VG_CMDSHIFT_DASHPAT12 0 #define ITE_VG_CMDMASK_DASHPAT12 0x00FFFFFF //====================================== //Dash Pattern 12 Register End //====================================== //====================================== //Dash Pattern 13 Register //====================================== #define ITE_VG_REG_DPR13_BASE 0x078 // // D[23:0] Dash Line Pattern 13 (MSB: Enable bit, s12.11) // #define ITE_VG_CMDSHIFT_DASHPAT13 0 #define ITE_VG_CMDMASK_DASHPAT13 0x00FFFFFF //====================================== //Dash Pattern 13 Register End //====================================== //====================================== //Dash Pattern 14 Register //====================================== #define ITE_VG_REG_DPR14_BASE 0x07C // // D[23:0] Dash Line Pattern 14 (MSB: Enable bit, s12.11) // #define ITE_VG_CMDSHIFT_DASHPAT14 0 #define ITE_VG_CMDMASK_DASHPAT14 0x00FFFFFF //====================================== //Dash Pattern 14 Register End //====================================== //====================================== //Dash Pattern 15 Register //====================================== #define ITE_VG_REG_DPR15_BASE 0x080 // // D[23:0] Dash Line Pattern 15 (MSB: Enable bit, s12.11) // #define ITE_VG_CMDSHIFT_DASHPAT15 0 #define ITE_VG_CMDMASK_DASHPAT15 0x00FFFFFF //====================================== //Dash Pattern 15 Register End //====================================== //====================================== //Dash Pattern 16 Register //====================================== #define ITE_VG_REG_DPR16_BASE 0x084 // // D[23:0] Dash Line Pattern 16 (MSB: Enable bit, s12.11) // #define ITE_VG_CMDSHIFT_DASHPAT16 0 #define ITE_VG_CMDMASK_DASHPAT16 0x00FFFFFF //====================================== //Dash Pattern 16 Register End //====================================== //Reserved Register 0x088 //Reserved Register 0x08C //====================================== //Coverage Control Register //====================================== #define ITE_VG_REG_CCR_BASE 0x090 // // D[31] // #define ITE_VG_CMD_CLIPFLIP_EN 0x80000000 // // D[30] // #define ITE_VG_CMD_DSTFLIP_EN 0x40000000 // // D[29] // #define ITE_VG_CMD_SRCFLIP_EN 0x20000000 // // D[28] // #define ITE_VG_CMD_SCREENFLIP_EN 0x10000000 // // D[7] // #define ITE_VG_CMD_TIMERDY_EN 0x00000080 // // D[6] // #define ITE_VG_CMD_FULLRDY_EN 0x00000040 // // D[5] No clear valid plane // #define ITE_VG_CMD_NOCLRVALID 0x00000020 // // D[4] Enable plan clipping // #define ITE_VG_CMD_CLIPPING 0x00000010 // // D[3:2] Render quality selection // 00: Non-anti aliasing (Nearest) // 01: Faster (4xAA) // 10: Better (16xAA) // Note: When the quality is better, the coverage plane data format MUST be two bytes (s11.4). // #define ITE_VG_CMD_RENDERQ_NONAA 0x00000000 #define ITE_VG_CMD_RENDERQ_FASTER 0x00000004 #define ITE_VG_CMD_RENDERQ_BETTER 0x00000008 #define ITE_VG_CMDSHIFT_RENDERQ 2 #define ITE_VG_CMDMASK_RENDERQ 0x0000000C // // D[0] Coverage plane data format // 0: one byte (s5.2) // 1: two bytes (s11.4) // #define ITE_VG_CMD_PLANFORMAT_ONEBYTE 0x00000000 #define ITE_VG_CMD_PLANFORMAT_TWOBYTES 0x00000001 //====================================== //Coverage Control Register End //====================================== //====================================== //Coverage Plan Base Register //====================================== #define ITE_VG_REG_CPBR_BASE 0x094 // // D[31:0] Coverage Plane Base Address. (64 bits alignment) // #define ITE_VG_CMDSHIFT_PLANBASE 0 #define ITE_VG_CMDMASK_PLANBASE 0xFFFFFFFF //====================================== //Coverage Plan Base Register End //====================================== //====================================== //Coverage/Valid Plan Pitch Register //====================================== #define ITE_VG_REG_CVPPR_BASE 0x098 // // D[24:16] Valid Plane Pitch in bytes. (64 bits alignment) // #define ITE_VG_CMDSHIFT_VALIDPITCH 16 #define ITE_VG_CMDMASK_VALIDPITCH 0x01FF0000 // // D[13:0] Coverage Plane Pitch in bytes. (64 bits alignment) // #define ITE_VG_CMDSHIFT_PLANPITCH 0 #define ITE_VG_CMDMASK_PLANPITCH 0x00003FFF //====================================== //Coverage/Valid Plan Pitch Register End //====================================== //====================================== //Valid Plan Base Register //====================================== #define ITE_VG_REG_VPBR_BASE 0x09C // // D[31:0] Valid Plane Base Address. (64 bits alignment) // #define ITE_VG_CMDSHIFT_VALIDBASE 0 #define ITE_VG_CMDMASK_VALIDBASE 0xFFFFFFFF //====================================== //Valid Plan Base Register End //====================================== //====================================== //Plan X Clipping Register //====================================== #define ITE_VG_REG_PXCR_BASE 0x0A0 // // D[28:16] Clipping x direction after XEND (s12) // #define ITE_VG_CMDSHIFT_PXCR_CLIPXEND 16 #define ITE_VG_CMDMASK_PXCR_CLIPXEND 0x1FFF0000 // // D[12:0] Clipping x direction before XSTART (s12) // #define ITE_VG_CMDSHIFT_PXCR_CLIPXSTART 0 #define ITE_VG_CMDMASK_PXCR_CLIPXSTART 0x00001FFF //====================================== //Plan X Clipping Register End //====================================== //====================================== //Plan Y Clipping Register //====================================== #define ITE_VG_REG_PYCR_BASE 0x0A4 // // D[28:16] Clipping y direction after YEND (s12) // #define ITE_VG_CMDSHIFT_PYCR_CLIPXEND 16 #define ITE_VG_CMDMASK_PYCR_CLIPXEND 0x1FFF0000 // // D[12:0] Clipping y direction before YSTART (s12) // #define ITE_VG_CMDSHIFT_PYCR_CLIPXSTART 0 #define ITE_VG_CMDMASK_PYCR_CLIPXSTART 0x00001FFF //====================================== //Plan Y Clipping Register End //====================================== #define ITE_VG_REG_SFR_BASE 0x0A8 // // D[28:16] // #define ITE_VG_CMDSHIFT_DSTFLIP_H 16 #define ITE_VG_CMDMASK_DSTFLIP_H 0x1FFF0000 // // D[12:0] // #define ITE_VG_CMDSHIFT_SRCFLIP_H 0 #define ITE_VG_CMDMASK_SRCFLIP_H 0x1FFF //====================================== //Arbiter Control Register //====================================== #define ITE_VG_REG_ACR_BASE 0x0AC // // D[24] Enable Last between Rd and Wr Rq to Memory // #define ITE_VG_CMD_RDWRLAST 0x01000000 // // D[23:22] Read priority 3 of arbiter. // 00: FrontEnd NO cache reads. // 01: FrontEnd cache reads. // 10: BackEnd NO cache reads. // 11: BackEnd cache reads. // #define ITE_VG_CMD_RDPRIORITY3_FE_NOCACHE 0x00000000 #define ITE_VG_CMD_RDPRIORITY3_FE_CACHE 0x00400000 #define ITE_VG_CMD_RDPRIORITY3_BE_NOCACHE 0x00800000 #define ITE_VG_CMD_RDPRIORITY3_BE_CACHE 0x00C00000 #define ITE_VG_CMDSHIFT_RDPRIORITY3 22 #define ITE_VG_CMDMASK_RDPRIORITY3 0x00C00000 // // D[21:20] Write priority 2 of arbiter. // 00: FrontEnd NO cache writes. // 01: FrontEnd cache writes. // 10: BackEnd NO cache writes. // 11: BackEnd cache reads. // #define ITE_VG_CMD_WRPRIORITY2_FE_NOCACHE 0x00000000 #define ITE_VG_CMD_WRPRIORITY2_FE_CACHE 0x00100000 #define ITE_VG_CMD_WRPRIORITY2_BE_NOCACHE 0x00200000 #define ITE_VG_CMD_WRPRIORITY2_BE_CACHE 0x00300000 #define ITE_VG_CMDSHIFT_WRPRIORITY2 20 #define ITE_VG_CMDMASK_WRPRIORITY2 0x00300000 // // D[19:18] Write priority 1 of arbiter. // 00: FrontEnd NO cache writes. // 01: FrontEnd cache writes. // 10: BackEnd NO cache writes. // 11: BackEnd cache reads. // #define ITE_VG_CMD_WRPRIORITY1_FE_NOCACHE 0x00000000 #define ITE_VG_CMD_WRPRIORITY1_FE_CACHE 0x00040000 #define ITE_VG_CMD_WRPRIORITY1_BE_NOCACHE 0x00080000 #define ITE_VG_CMD_WRPRIORITY1_BE_CACHE 0x000C0000 #define ITE_VG_CMDSHIFT_WRPRIORITY1 18 #define ITE_VG_CMDMASK_WRPRIORITY1 0x000C0000 // // D[17:16] Write priority 0 of arbiter. // 00: FrontEnd NO cache writes. // 01: FrontEnd cache writes. // 10: BackEnd NO cache writes. // 11: BackEnd cache reads. // #define ITE_VG_CMD_WRPRIORITY0_FE_NOCACHE 0x00000000 #define ITE_VG_CMD_WRPRIORITY0_FE_CACHE 0x00010000 #define ITE_VG_CMD_WRPRIORITY0_BE_NOCACHE 0x00020000 #define ITE_VG_CMD_WRPRIORITY0_BE_CACHE 0x00030000 #define ITE_VG_CMDSHIFT_WRPRIORITY0 16 #define ITE_VG_CMDMASK_WRPRIORITY0 0x00030000 // // D[15:12] Control Max buffer size (For debug) // #define ITE_VG_CMDSHIFT_BUFBOUNDARY 12 #define ITE_VG_CMDMASK_BUFBOUNDARY 0x0000F000 // // D[8] Enable buffer boundary // #define ITE_VG_CMD_ENBUFBOUND 0x00000100 // // D[3] Enable clear render cache at first // #define ITE_VG_CMD_CLRRDRCACHE 0x00000008 // // D[2] Enable clear coverage cache at first // #define ITE_VG_CMD_CLRCOVCACHE 0x00000004 // // D[1] Enable render cache // #define ITE_VG_CMD_RDRCACHE_EN 0x00000002 // // D[0] Enable coverage cache // #define ITE_VG_CMD_COVCACHE_EN 0x00000001 //====================================== //Arbiter Control Register End //====================================== //====================================== //Render Control Register //====================================== #define ITE_VG_REG_RCR_BASE 0x0B0 // // D[31] Enable pre-multiplied for Destination Image // #define ITE_VG_CMD_DST_PRE_EN 0x80000000 // // D[30] Enable Nonpre-multiplied before Color Transform // #define ITE_VG_CMD_SRC_NONPRE_EN 0x40000000 // // D[29] Enable pre-multiplied before Blending // #define ITE_VG_CMD_SRC_PRE_EN 0x20000000 // // D[28] Enable pre-multiplied for Texture Image // #define ITE_VG_CMD_TEX_PRE_EN 0x10000000 // // D[27] Enable nonpre-multipled for writing image // #define ITE_VG_CMD_WR_NONPRE_EN 0x08000000 // // D[26] Enable Lookup Table. (Image filter) (Only work at RENDMODE=11) // #define ITE_VG_CMD_LOOKUP_EN 0x04000000 // // D[25] Enable Color combination. (Image filter) // #define ITE_VG_CMD_COLCOMBIN_EN 0x02000000 // // D[24] Enable dither. (For output is not RGBA8888) // #define ITE_VG_CMD_DITHER_EN 0x01000000 // // D[23] Paint color for valid pixels in Transparent BitBlt // #define ITE_VG_CMD_TBITBLT_PAINT 0x00800000 // // D[22] Enable Transparent BitBlt. Only work at Blend disable // #define ITE_VG_CMD_TBITBLT_EN 0x00400000 // // D[21] Enable ROP3. Only work at Blend disable // #define ITE_VG_CMD_ROP3_EN 0x00200000 // // D[20] Enable blend. (Only work at destination enable) // #define ITE_VG_CMD_BLEND_EN 0x00100000 // // D[19] Enable gamma or inverse gamma // #define ITE_VG_CMD_GAMMA_EN 0x00080000 // // D[18] Enable color transform // #define ITE_VG_CMD_COLORCLIP_EN 0x00040000 // // D[17] Enable clipping value to 8 bits per channel in color transform. // If disable, you need to determine which 16 bits of 25 bits // are chosen at COLLSBSHIFT. // #define ITE_VG_CMD_COLORXFM_EN 0x00020000 // // D[16] Enable mask read // #define ITE_VG_CMD_MASK_EN 0x00010000 // // D[15] Enable destination paint color. Only work at Destination read enable. // #define ITE_VG_CMD_DSTCOLOR_EN 0x00008000 // // D[14] Enable destination read // #define ITE_VG_CMD_DESTINATION_EN 0x00004000 // // D[13] Enable texture cache // #define ITE_VG_CMD_TEXCACHE_EN 0x00002000 // // D[12] Enable texture read // #define ITE_VG_CMD_TEXTURE_EN 0x00001000 // // D[11] Enable separate input data for texture & paint, // only at 16 bits per channel // #define ITE_VG_CMD_TEXPATIN_EN 0x00000800 // // D[10] Enable Enable merge texture and paint to destination, // only at 16 bits per channel and blend disable. // #define ITE_VG_CMD_BLDMERGE_EN 0x00000400 // // D[9] Enable scissor read // #define ITE_VG_CMD_SCISSOR_EN 0x00000200 // // D[8] Enable coverage read // #define ITE_VG_CMD_COVERAGE_EN 0x00000100 // // D[7:6] Texture image quality selection: // 00: Non-anti aliasing (Nearest) // 01: Faster (bilinear) // 10: Better (like-trilinear) // #define ITE_VG_CMD_IMAGEQ_NONAA 0x00000000 #define ITE_VG_CMD_IMAGEQ_FASTER 0x00000040 #define ITE_VG_CMD_IMAGEQ_BETTER 0x00000080 #define ITE_VG_CMDSHIFT_IMAGEQ 6 #define ITE_VG_CMDMASK_IMAGEQ 0x000000C0 // // D[4] Render fill rule selection: // 0: odd-even // 1: non-zero // #define ITE_VG_CMD_FILLRULE_ODDEVEN 0x00000000 #define ITE_VG_CMD_FILLRULE_NONZERO 0x00000010 // // D[3:2] Render Mode Selection: // 00: vgDrawPath vgDrawImage (Paint Pattern, 3pass-Step1) // 01: vgDrawImage (Except: Paint Pattern) // vgDrawImage (Paint Pattern, 2pass-Step2) // vgDrawImage (Paint Pattern, 3pass-Step3) // 10: vgDrawImage (Paint Pattern, 2pass-Step1) // 11: vgDrawImage (Paint Pattern, 3pass-Step2) // #define ITE_VG_CMD_RENDERMODE_0 0x00000000 #define ITE_VG_CMD_RENDERMODE_1 0x00000004 #define ITE_VG_CMD_RENDERMODE_2 0x00000008 #define ITE_VG_CMD_RENDERMODE_3 0x0000000C #define ITE_VG_CMDSHIFT_RENDERMODE 2 #define ITE_VG_CMDMASK_RENDERMODE 0x0000000C // // D[1] Enable Coordinate operation at valid. // #define ITE_VG_CMD_RDPLN_VLD_EN 0x00000002 // // D[0] Enable Fast Source Copy. (Byte alignment) // #define ITE_VG_CMD_SRCCOPY_EN 0x00000001 //====================================== //Render Control Register End //====================================== //====================================== //Render Mode Register //====================================== #define ITE_VG_REG_RMR_BASE 0x0B4 // // D[31] Enable clipping premultiple at [0, a] // #define ITE_VG_CMD_CLIPPRE_EN 0x80000000 // // D[30] Enable scan reversed X direction // #define ITE_VG_CMD_SCANREXDIR_EN 0x40000000 // // D[29] Enable scan reversed Y direction // #define ITE_VG_CMD_SCANREYDIR_EN 0x20000000 // // D[28] Enable auto to detect the direction of scan // #define ITE_VG_CMD_AUTOSCAN_EN 0x10000000 // // D[27:24] Color transformation LSB shift selection. // Note: Only work at COLORXFM enable and COLORCLIP disable. // #define ITE_VG_CMDSHIFT_COLLSBSHIFT 24 #define ITE_VG_CMDMASK_COLLSBSHIFT 0x0F000000 // // D[22:20] texture transformation LSB shift selection. // Note: Only work at COLORXFM enable and COLORCLIP disable. // #define ITE_VG_CMDSHIFT_TEXLSBSHIFT 20 #define ITE_VG_CMDMASK_TEXLSBSHIFT 0x00700000 // // D[17:16] Lookup Mode (Color Combination Mode) // 00: R channel // 01: G channel // 10: B channel // 11: A channel // #define ITE_VG_CMD_LOOKUPMODE_R 0x00000000 #define ITE_VG_CMD_LOOKUPMODE_G 0x00010000 #define ITE_VG_CMD_LOOKUPMODE_B 0x00020000 #define ITE_VG_CMD_LOOKUPMODE_A 0x00030000 #define ITE_VG_CMDSHIFT_LOOKUPMODE 16 #define ITE_VG_CMDMASK_LOOKUPMODE 0x00030000 // // D[15:14] Masking Mode // 00: Union // 01: Intersect (Normal) // 10: Subtract // 11: Intersect (Normal) // #define ITE_VG_CMD_MASKMODE_UNION 0x00000000 #define ITE_VG_CMD_MASKMODE_INTERSECT 0x00004000 #define ITE_VG_CMD_MASKMODE_SUBTRACT 0x00008000 #define ITE_VG_CMD_MASKMODE_INTERSECT2 0x0000C000 #define ITE_VG_CMDSHIFT_MASKMODE 14 #define ITE_VG_CMDMASK_MASKMODE 0x0000C000 // // D[13] Gamma Mode // 0: gamma // 1: inverse gamma // #define ITE_VG_CMD_GAMMAMODE_GAMMA 0x00000000 #define ITE_VG_CMD_GAMMAMODE_INVERSE 0x00002000 // // D[12:8] Blending Mode. // 0x00: Src // 0x01: Src over Dst // 0x02: Dst over Src // 0x03: Src in Dst // 0x04: Dst in Src // 0x05: Multiply // 0x06: Screen // 0x07: Darken // 0x08: Lighten // 0x09: Additive // 0x0A: Constant Alpha // 0x10: Union // 0x11: Intersect // 0x12: Subtract // #define ITE_VG_CMD_BLENDMODE_SRC 0x00000000 #define ITE_VG_CMD_BLENDMODE_SRC_OVER_DST 0x00000100 #define ITE_VG_CMD_BLENDMODE_DST_OVER_SRC 0x00000200 #define ITE_VG_CMD_BLENDMODE_SRC_IN_DST 0x00000300 #define ITE_VG_CMD_BLENDMODE_DST_IN_SRC 0x00000400 #define ITE_VG_CMD_BLENDMODE_MULTIPLY 0x00000500 #define ITE_VG_CMD_BLENDMODE_SCREEN 0x00000600 #define ITE_VG_CMD_BLENDMODE_DARKEN 0x00000700 #define ITE_VG_CMD_BLENDMODE_LIGHTEN 0x00000800 #define ITE_VG_CMD_BLENDMODE_ADDITIVE 0x00000900 #define ITE_VG_CMD_BLENDMODE_CONSTANT_ALPHA 0x00000A00 #define ITE_VG_CMD_BLENDMODE_UNION 0x00001000 #define ITE_VG_CMD_BLENDMODE_INTERSECT 0x00001100 #define ITE_VG_CMD_BLENDMODE_SUBTRACT 0x00001200 #define ITE_VG_CMDSHIFT_BLENDMODE 8 #define ITE_VG_CMDMASK_BLENDMODE 0x00001F00 // // D[7:6] Pattern Paint Tile Mode // 00: Fill // 01: Pad // 10: Repeat // 11: Reflect // #define ITE_VG_CMD_TILEMODE_FILL 0x00000000 #define ITE_VG_CMD_TILEMODE_PAD 0x00000040 #define ITE_VG_CMD_TILEMODE_REPEAT 0x00000080 #define ITE_VG_CMD_TILEMODE_REFLECT 0x000000C0 #define ITE_VG_CMDSHIFT_TILEMODE 6 #define ITE_VG_CMDMASK_TILEMODE 0x000000C0 // // D[5:4] Gradient Ramp Mode // 00: Pad // 01: Repeat // 10: Reflect // #define ITE_VG_CMD_RAMPMODE_PAD 0x00000000 #define ITE_VG_CMD_RAMPMODE_REPEAT 0x00000010 #define ITE_VG_CMD_RAMPMODE_REFLECT 0x00000020 #define ITE_VG_CMDSHIFT_RAMPMODE 4 #define ITE_VG_CMDMASK_RAMPMODE 0x00000030 // // D[3:2] Paint Type // 00: Color // 01: Linear gradient // 10: Radial gradient // 11: Pattern // #define ITE_VG_CMD_PAINTTYPE_COLOR 0x00000000 #define ITE_VG_CMD_PAINTTYPE_LINEAR 0x00000004 #define ITE_VG_CMD_PAINTTYPE_RADIAL 0x00000008 #define ITE_VG_CMD_PAINTTYPE_PATTERN 0x0000000C #define ITE_VG_CMDSHIFT_PAINTTYPE 2 #define ITE_VG_CMDMASK_PAINTTYPE 0x0000000C // // D[1:0] Image Mode // 00: Normal // 01: Multiply // 10: Stencil // #define ITE_VG_CMD_IMAGEMODE_NORMAL 0x00000000 #define ITE_VG_CMD_IMAGEMODE_MULTIPLY 0x00000001 #define ITE_VG_CMD_IMAGEMODE_STENCIL 0x00000002 #define ITE_VG_CMDSHIFT_IMAGEMODE 0 #define ITE_VG_CMDMASK_IMAGEMODE 0x00000003 //====================================== //Render Mode Register End //====================================== //====================================== //Render Format Register //====================================== #define ITE_VG_REG_RFR_BASE 0x0B8 // // D[26] Enable Mask extend bits. // 0: extend 0. // 1: Let MSB be extended bits. // Note: As read destination extend at lookup table. // #define ITE_VG_CMD_MASKEXTEND_EN 0x04000000 // // D[25] Enable Destination extend bits. // 0: extend 0. // 1: Let MSB be extended bits. // #define ITE_VG_CMD_DSTEXTEND_EN 0x02000000 // // D[24] Enable Source (Texture) extend bits. // 0: extend 0. // 1: Let MSB be extended bits. // #define ITE_VG_CMD_SRCEXTEND_EN 0x01000000 // // D[23:16] Mask data format /* RGB{A,X} channel ordering */ // HW_sRGBX_8888 = 0, // HW_sRGBA_8888 = 1, // HW_sRGBA_8888_PRE = 2, // HW_sRGB_565 = 3, // HW_sRGBA_5551 = 4, // HW_sRGBA_4444 = 5, // HW_sL_8 = 6, // HW_lRGBX_8888 = 7, // HW_lRGBA_8888 = 8, // HW_lRGBA_8888_PRE = 9, // HW_lL_8 = 10, // HW_A_8 = 11, // HW_BW_1 = 12, // HW_A_1 = 13, // HW_A_4 = 14, // HW_RGBA_16 = 15, // /* {A,X}RGB channel ordering */ // HW_sXRGB_8888 = 0 | (1 << 6), // HW_sARGB_8888 = 1 | (1 << 6), // HW_sARGB_8888_PRE = 2 | (1 << 6), // HW_sARGB_1555 = 4 | (1 << 6), // HW_sARGB_4444 = 5 | (1 << 6), // HW_lXRGB_8888 = 7 | (1 << 6), // HW_lARGB_8888 = 8 | (1 << 6), // HW_lARGB_8888_PRE = 9 | (1 << 6), // /* BGR{A,X} channel ordering */ // HW_sBGRX_8888 = 0 | (1 << 7), // HW_sBGRA_8888 = 1 | (1 << 7), // HW_sBGRA_8888_PRE = 2 | (1 << 7), // HW_sBGR_565 = 3 | (1 << 7), // HW_sBGRA_5551 = 4 | (1 << 7), // HW_sBGRA_4444 = 5 | (1 << 7), // HW_lBGRX_8888 = 7 | (1 << 7), // HW_lBGRA_8888 = 8 | (1 << 7), // HW_lBGRA_8888_PRE = 9 | (1 << 7), // /* {A,X}BGR channel ordering */ // HW_sXBGR_8888 = 0 | (1 << 6) | (1 << 7), // HW_sABGR_8888 = 1 | (1 << 6) | (1 << 7), // HW_sABGR_8888_PRE = 2 | (1 << 6) | (1 << 7), // HW_sABGR_1555 = 4 | (1 << 6) | (1 << 7), // HW_sABGR_4444 = 5 | (1 << 6) | (1 << 7), // HW_lXBGR_8888 = 7 | (1 << 6) | (1 << 7), // HW_lABGR_8888 = 8 | (1 << 6) | (1 << 7), // HW_lABGR_8888_PRE = 9 | (1 << 6) | (1 << 7), // #define ITE_VG_CMD_MASKFORMAT_sRGBX_8888 0x00000000 #define ITE_VG_CMD_MASKFORMAT_sRGBA_8888 1 << 16 #define ITE_VG_CMD_MASKFORMAT_sRGBA_8888_PRE 2 << 16 #define ITE_VG_CMD_MASKFORMAT_sRGB_565 3 << 16 #define ITE_VG_CMD_MASKFORMAT_sRGBA_5551 4 << 16 #define ITE_VG_CMD_MASKFORMAT_sRGBA_4444 5 << 16 #define ITE_VG_CMD_MASKFORMAT_sL_8 6 << 16 #define ITE_VG_CMD_MASKFORMAT_lRGBX_8888 7 << 16 #define ITE_VG_CMD_MASKFORMAT_lRGBA_8888 8 << 16 #define ITE_VG_CMD_MASKFORMAT_lRGBA_8888_PRE 9 << 16 #define ITE_VG_CMD_MASKFORMAT_lL_8 10 << 16 #define ITE_VG_CMD_MASKFORMAT_A_8 11 << 16 #define ITE_VG_CMD_MASKFORMAT_BW_1 12 << 16 #define ITE_VG_CMD_MASKFORMAT_A_1 13 << 16 #define ITE_VG_CMD_MASKFORMAT_A_4 14 << 16 #define ITE_VG_CMD_MASKFORMAT_RGBA_16 15 << 16 #define ITE_VG_CMD_MASKFORMAT_sXRGB_8888 (0 | (1 << 6)) << 16 #define ITE_VG_CMD_MASKFORMAT_sARGB_8888 (1 | (1 << 6)) << 16 #define ITE_VG_CMD_MASKFORMAT_sARGB_8888_PRE (2 | (1 << 6)) << 16 #define ITE_VG_CMD_MASKFORMAT_sARGB_1555 (4 | (1 << 6)) << 16 #define ITE_VG_CMD_MASKFORMAT_sARGB_4444 (5 | (1 << 6)) << 16 #define ITE_VG_CMD_MASKFORMAT_lXRGB_8888 (7 | (1 << 6)) << 16 #define ITE_VG_CMD_MASKFORMAT_lARGB_8888 (8 | (1 << 6)) << 16 #define ITE_VG_CMD_MASKFORMAT_lARGB_8888_PRE (9 | (1 << 6)) << 16 #define ITE_VG_CMD_MASKFORMAT_sBGRX_8888 (0 | (1 << 7)) << 16 #define ITE_VG_CMD_MASKFORMAT_sBGRA_8888 (1 | (1 << 7)) << 16 #define ITE_VG_CMD_MASKFORMAT_sBGRA_8888_PRE (2 | (1 << 7)) << 16 #define ITE_VG_CMD_MASKFORMAT_sBGR_565 (4 | (1 << 7)) << 16 #define ITE_VG_CMD_MASKFORMAT_sBGRA_5551 (5 | (1 << 7)) << 16 #define ITE_VG_CMD_MASKFORMAT_lBGRX_8888 (7 | (1 << 7)) << 16 #define ITE_VG_CMD_MASKFORMAT_lBGRA_8888 (8 | (1 << 7)) << 16 #define ITE_VG_CMD_MASKFORMAT_lBGRA_8888_PRE (9 | (1 << 7)) << 16 #define ITE_VG_CMD_MASKFORMAT_sXBGR_8888 (0 | (1 << 6) | (1 << 7)) << 16 #define ITE_VG_CMD_MASKFORMAT_sABGR_8888 (1 | (1 << 6) | (1 << 7)) << 16 #define ITE_VG_CMD_MASKFORMAT_sABGR_8888_PRE (2 | (1 << 6) | (1 << 7)) << 16 #define ITE_VG_CMD_MASKFORMAT_sABGR_1555 (4 | (1 << 6) | (1 << 7)) << 16 #define ITE_VG_CMD_MASKFORMAT_sABGR_4444 (5 | (1 << 6) | (1 << 7)) << 16 #define ITE_VG_CMD_MASKFORMAT_lXBGR_8888 (7 | (1 << 6) | (1 << 7)) << 16 #define ITE_VG_CMD_MASKFORMAT_lABGR_8888 (8 | (1 << 6) | (1 << 7)) << 16 #define ITE_VG_CMD_MASKFORMAT_lABGR_8888_PRE (9 | (1 << 6) | (1 << 7)) << 16 #define ITE_VG_CMDSHIFT_MASKFORMAT 16 #define ITE_VG_CMDMASK_MASKFORMAT 0x00FF0000 // // D[15:8] Dst data format /* RGB{A,X} channel ordering */ // HW_sRGBX_8888 = 0, // HW_sRGBA_8888 = 1, // HW_sRGBA_8888_PRE = 2, // HW_sRGB_565 = 3, // HW_sRGBA_5551 = 4, // HW_sRGBA_4444 = 5, // HW_sL_8 = 6, // HW_lRGBX_8888 = 7, // HW_lRGBA_8888 = 8, // HW_lRGBA_8888_PRE = 9, // HW_lL_8 = 10, // HW_A_8 = 11, // HW_BW_1 = 12, // HW_A_1 = 13, // HW_A_4 = 14, // HW_RGBA_16 = 15, // /* {A,X}RGB channel ordering */ // HW_sXRGB_8888 = 0 | (1 << 6), // HW_sARGB_8888 = 1 | (1 << 6), // HW_sARGB_8888_PRE = 2 | (1 << 6), // HW_sARGB_1555 = 4 | (1 << 6), // HW_sARGB_4444 = 5 | (1 << 6), // HW_lXRGB_8888 = 7 | (1 << 6), // HW_lARGB_8888 = 8 | (1 << 6), // HW_lARGB_8888_PRE = 9 | (1 << 6), // /* BGR{A,X} channel ordering */ // HW_sBGRX_8888 = 0 | (1 << 7), // HW_sBGRA_8888 = 1 | (1 << 7), // HW_sBGRA_8888_PRE = 2 | (1 << 7), // HW_sBGR_565 = 3 | (1 << 7), // HW_sBGRA_5551 = 4 | (1 << 7), // HW_sBGRA_4444 = 5 | (1 << 7), // HW_lBGRX_8888 = 7 | (1 << 7), // HW_lBGRA_8888 = 8 | (1 << 7), // HW_lBGRA_8888_PRE = 9 | (1 << 7), // /* {A,X}BGR channel ordering */ // HW_sXBGR_8888 = 0 | (1 << 6) | (1 << 7), // HW_sABGR_8888 = 1 | (1 << 6) | (1 << 7), // HW_sABGR_8888_PRE = 2 | (1 << 6) | (1 << 7), // HW_sABGR_1555 = 4 | (1 << 6) | (1 << 7), // HW_sABGR_4444 = 5 | (1 << 6) | (1 << 7), // HW_lXBGR_8888 = 7 | (1 << 6) | (1 << 7), // HW_lABGR_8888 = 8 | (1 << 6) | (1 << 7), // HW_lABGR_8888_PRE = 9 | (1 << 6) | (1 << 7), // #define ITE_VG_CMD_DSTFORMAT_sRGBX_8888 0x00000000 #define ITE_VG_CMD_DSTFORMAT_sRGBA_8888 1 << 8 #define ITE_VG_CMD_DSTFORMAT_sRGBA_8888_PRE 2 << 8 #define ITE_VG_CMD_DSTFORMAT_sRGB_565 3 << 8 #define ITE_VG_CMD_DSTFORMAT_sRGBA_5551 4 << 8 #define ITE_VG_CMD_DSTFORMAT_sRGBA_4444 5 << 8 #define ITE_VG_CMD_DSTFORMAT_sL_8 6 << 8 #define ITE_VG_CMD_DSTFORMAT_lRGBX_8888 7 << 8 #define ITE_VG_CMD_DSTFORMAT_lRGBA_8888 8 << 8 #define ITE_VG_CMD_DSTFORMAT_lRGBA_8888_PRE 9 << 8 #define ITE_VG_CMD_DSTFORMAT_lL_8 10 << 8 #define ITE_VG_CMD_DSTFORMAT_A_8 11 << 8 #define ITE_VG_CMD_DSTFORMAT_BW_1 12 << 8 #define ITE_VG_CMD_DSTFORMAT_A_1 13 << 8 #define ITE_VG_CMD_DSTFORMAT_A_4 14 << 8 #define ITE_VG_CMD_DSTFORMAT_RGBA_16 15 << 8 #define ITE_VG_CMD_DSTFORMAT_sXRGB_8888 (0 | (1 << 6)) << 8 #define ITE_VG_CMD_DSTFORMAT_sARGB_8888 (1 | (1 << 6)) << 8 #define ITE_VG_CMD_DSTFORMAT_sARGB_8888_PRE (2 | (1 << 6)) << 8 #define ITE_VG_CMD_DSTFORMAT_sARGB_1555 (4 | (1 << 6)) << 8 #define ITE_VG_CMD_DSTFORMAT_sARGB_4444 (5 | (1 << 6)) << 8 #define ITE_VG_CMD_DSTFORMAT_lXRGB_8888 (7 | (1 << 6)) << 8 #define ITE_VG_CMD_DSTFORMAT_lARGB_8888 (8 | (1 << 6)) << 8 #define ITE_VG_CMD_DSTFORMAT_lARGB_8888_PRE (9 | (1 << 6)) << 8 #define ITE_VG_CMD_DSTFORMAT_sBGRX_8888 (0 | (1 << 7)) << 8 #define ITE_VG_CMD_DSTFORMAT_sBGRA_8888 (1 | (1 << 7)) << 8 #define ITE_VG_CMD_DSTFORMAT_sBGRA_8888_PRE (2 | (1 << 7)) << 8 #define ITE_VG_CMD_DSTFORMAT_sBGR_565 (4 | (1 << 7)) << 8 #define ITE_VG_CMD_DSTFORMAT_sBGRA_5551 (5 | (1 << 7)) << 8 #define ITE_VG_CMD_DSTFORMAT_lBGRX_8888 (7 | (1 << 7)) << 8 #define ITE_VG_CMD_DSTFORMAT_lBGRA_8888 (8 | (1 << 7)) << 8 #define ITE_VG_CMD_DSTFORMAT_lBGRA_8888_PRE (9 | (1 << 7)) << 8 #define ITE_VG_CMD_DSTFORMAT_sXBGR_8888 (0 | (1 << 6) | (1 << 7)) << 8 #define ITE_VG_CMD_DSTFORMAT_sABGR_8888 (1 | (1 << 6) | (1 << 7)) << 8 #define ITE_VG_CMD_DSTFORMAT_sABGR_8888_PRE (2 | (1 << 6) | (1 << 7)) << 8 #define ITE_VG_CMD_DSTFORMAT_sABGR_1555 (4 | (1 << 6) | (1 << 7)) << 8 #define ITE_VG_CMD_DSTFORMAT_sABGR_4444 (5 | (1 << 6) | (1 << 7)) << 8 #define ITE_VG_CMD_DSTFORMAT_lXBGR_8888 (7 | (1 << 6) | (1 << 7)) << 8 #define ITE_VG_CMD_DSTFORMAT_lABGR_8888 (8 | (1 << 6) | (1 << 7)) << 8 #define ITE_VG_CMD_DSTFORMAT_lABGR_8888_PRE (9 | (1 << 6) | (1 << 7)) << 8 #define ITE_VG_CMDSHIFT_DSTFORMAT 8 #define ITE_VG_CMDMASK_DSTFORMAT 0x0000FF00 // // D[7:0] Src data format /* RGB{A,X} channel ordering */ // HW_sRGBX_8888 = 0, // HW_sRGBA_8888 = 1, // HW_sRGBA_8888_PRE = 2, // HW_sRGB_565 = 3, // HW_sRGBA_5551 = 4, // HW_sRGBA_4444 = 5, // HW_sL_8 = 6, // HW_lRGBX_8888 = 7, // HW_lRGBA_8888 = 8, // HW_lRGBA_8888_PRE = 9, // HW_lL_8 = 10, // HW_A_8 = 11, // HW_BW_1 = 12, // HW_A_1 = 13, // HW_A_4 = 14, // HW_RGBA_16 = 15, // /* {A,X}RGB channel ordering */ // HW_sXRGB_8888 = 0 | (1 << 6), // HW_sARGB_8888 = 1 | (1 << 6), // HW_sARGB_8888_PRE = 2 | (1 << 6), // HW_sARGB_1555 = 4 | (1 << 6), // HW_sARGB_4444 = 5 | (1 << 6), // HW_lXRGB_8888 = 7 | (1 << 6), // HW_lARGB_8888 = 8 | (1 << 6), // HW_lARGB_8888_PRE = 9 | (1 << 6), // /* BGR{A,X} channel ordering */ // HW_sBGRX_8888 = 0 | (1 << 7), // HW_sBGRA_8888 = 1 | (1 << 7), // HW_sBGRA_8888_PRE = 2 | (1 << 7), // HW_sBGR_565 = 3 | (1 << 7), // HW_sBGRA_5551 = 4 | (1 << 7), // HW_sBGRA_4444 = 5 | (1 << 7), // HW_lBGRX_8888 = 7 | (1 << 7), // HW_lBGRA_8888 = 8 | (1 << 7), // HW_lBGRA_8888_PRE = 9 | (1 << 7), // /* {A,X}BGR channel ordering */ // HW_sXBGR_8888 = 0 | (1 << 6) | (1 << 7), // HW_sABGR_8888 = 1 | (1 << 6) | (1 << 7), // HW_sABGR_8888_PRE = 2 | (1 << 6) | (1 << 7), // HW_sABGR_1555 = 4 | (1 << 6) | (1 << 7), // HW_sABGR_4444 = 5 | (1 << 6) | (1 << 7), // HW_lXBGR_8888 = 7 | (1 << 6) | (1 << 7), // HW_lABGR_8888 = 8 | (1 << 6) | (1 << 7), // HW_lABGR_8888_PRE = 9 | (1 << 6) | (1 << 7), // #define ITE_VG_CMD_SRCFORMAT_sRGBX_8888 0x00000000 #define ITE_VG_CMD_SRCFORMAT_sRGBA_8888 1 #define ITE_VG_CMD_SRCFORMAT_sRGBA_8888_PRE 2 #define ITE_VG_CMD_SRCFORMAT_sRGB_565 3 #define ITE_VG_CMD_SRCFORMAT_sRGBA_5551 4 #define ITE_VG_CMD_SRCFORMAT_sRGBA_4444 5 #define ITE_VG_CMD_SRCFORMAT_sL_8 6 #define ITE_VG_CMD_SRCFORMAT_lRGBX_8888 7 #define ITE_VG_CMD_SRCFORMAT_lRGBA_8888 8 #define ITE_VG_CMD_SRCFORMAT_lRGBA_8888_PRE 9 #define ITE_VG_CMD_SRCFORMAT_lL_8 10 #define ITE_VG_CMD_SRCFORMAT_A_8 11 #define ITE_VG_CMD_SRCFORMAT_BW_1 12 #define ITE_VG_CMD_SRCFORMAT_A_1 13 #define ITE_VG_CMD_SRCFORMAT_A_4 14 #define ITE_VG_CMD_SRCFORMAT_RGBA_16 15 #define ITE_VG_CMD_SRCFORMAT_sXRGB_8888 (0 | (1 << 6)) #define ITE_VG_CMD_SRCFORMAT_sARGB_8888 (1 | (1 << 6)) #define ITE_VG_CMD_SRCFORMAT_sARGB_8888_PRE (2 | (1 << 6)) #define ITE_VG_CMD_SRCFORMAT_sARGB_1555 (4 | (1 << 6)) #define ITE_VG_CMD_SRCFORMAT_sARGB_4444 (5 | (1 << 6)) #define ITE_VG_CMD_SRCFORMAT_lXRGB_8888 (7 | (1 << 6)) #define ITE_VG_CMD_SRCFORMAT_lARGB_8888 (8 | (1 << 6)) #define ITE_VG_CMD_SRCFORMAT_lARGB_8888_PRE (9 | (1 << 6)) #define ITE_VG_CMD_SRCFORMAT_sBGRX_8888 (0 | (1 << 7)) #define ITE_VG_CMD_SRCFORMAT_sBGRA_8888 (1 | (1 << 7)) #define ITE_VG_CMD_SRCFORMAT_sBGRA_8888_PRE (2 | (1 << 7)) #define ITE_VG_CMD_SRCFORMAT_sBGR_565 (4 | (1 << 7)) #define ITE_VG_CMD_SRCFORMAT_sBGRA_5551 (5 | (1 << 7)) #define ITE_VG_CMD_SRCFORMAT_lBGRX_8888 (7 | (1 << 7)) #define ITE_VG_CMD_SRCFORMAT_lBGRA_8888 (8 | (1 << 7)) #define ITE_VG_CMD_SRCFORMAT_lBGRA_8888_PRE (9 | (1 << 7)) #define ITE_VG_CMD_SRCFORMAT_sXBGR_8888 (0 | (1 << 6) | (1 << 7)) #define ITE_VG_CMD_SRCFORMAT_sABGR_8888 (1 | (1 << 6) | (1 << 7)) #define ITE_VG_CMD_SRCFORMAT_sABGR_8888_PRE (2 | (1 << 6) | (1 << 7)) #define ITE_VG_CMD_SRCFORMAT_sABGR_1555 (4 | (1 << 6) | (1 << 7)) #define ITE_VG_CMD_SRCFORMAT_sABGR_4444 (5 | (1 << 6) | (1 << 7)) #define ITE_VG_CMD_SRCFORMAT_lXBGR_8888 (7 | (1 << 6) | (1 << 7)) #define ITE_VG_CMD_SRCFORMAT_lABGR_8888 (8 | (1 << 6) | (1 << 7)) #define ITE_VG_CMD_SRCFORMAT_lABGR_8888_PRE (9 | (1 << 6) | (1 << 7)) #define ITE_VG_CMDSHIFT_SRCFORMAT 0 #define ITE_VG_CMDMASK_SRCFORMAT 0x000000FF //====================================== //Render Format Register End //====================================== //====================================== //Ramp Stop Register 01 //====================================== #define ITE_VG_REG_RSR01_BASE 0x0BC // // D[31] Enable stop 1 valid // #define ITE_VG_CMD_RAMPSTOP1VLD 0x80000000 // // D[28:16] Ramp stop g value 1 (1.12) // #define ITE_VG_CMDSHIFT_RAMPSTOP1 16 #define ITE_VG_CMDMASK_RAMPSTOP1 0x1FFF0000 // // D[15] Enable stop 0 valid // #define ITE_VG_CMD_RAMPSTOP0VLD 0x00008000 // // D[14] Enable gradient valid when g = stop 0 // #define ITE_VG_CMD_RAMPSTOP0EQ 0x00004000 // // D[12:0] Ramp stop g value 0 (1.12) // #define ITE_VG_CMDSHIFT_RAMPSTOP0 0 #define ITE_VG_CMDMASK_RAMPSTOP0 0x00001FFF //====================================== //Ramp Stop Register 01 End //====================================== //====================================== //Ramp Stop Register 23 //====================================== #define ITE_VG_REG_RSR23_BASE 0x0C0 // // D[31] Enable stop 3 valid // #define ITE_VG_CMD_RAMPSTOP3VLD 0x80000000 // // D[28:16] Ramp stop g value 3 (1.12) // #define ITE_VG_CMDSHIFT_RAMPSTOP3 16 #define ITE_VG_CMDMASK_RAMPSTOP3 0x1FFF0000 // // D[15] Enable stop 2 valid // #define ITE_VG_CMD_RAMPSTOP2VLD 0x00008000 // // D[12:0] Ramp stop g value 2 (1.12) // #define ITE_VG_CMDSHIFT_RAMPSTOP2 0 #define ITE_VG_CMDMASK_RAMPSTOP2 0x00001FFF //====================================== //Ramp Stop Register 23 End //====================================== //====================================== //Ramp Stop Register 45 //====================================== #define ITE_VG_REG_RSR45_BASE 0x0C4 // // D[31] Enable stop 5 valid // #define ITE_VG_CMD_RAMPSTOP5VLD 0x80000000 // // D[28:16] Ramp stop g value 5 (1.12) // #define ITE_VG_CMDSHIFT_RAMPSTOP5 16 #define ITE_VG_CMDMASK_RAMPSTOP5 0x1FFF0000 // // D[15] Enable stop 4 valid // #define ITE_VG_CMD_RAMPSTOP4VLD 0x00008000 // // D[12:0] Ramp stop g value 4 (1.12) // #define ITE_VG_CMDSHIFT_RAMPSTOP4 0 #define ITE_VG_CMDMASK_RAMPSTOP4 0x00001FFF //====================================== //Ramp Stop Register 45 End //====================================== //====================================== //Ramp Stop Register 67 //====================================== #define ITE_VG_REG_RSR67_BASE 0x0C8 // // D[31] Enable stop 7 valid // #define ITE_VG_CMD_RAMPSTOP7VLD 0x80000000 // // D[28:16] Ramp stop g value 7 (1.12) // #define ITE_VG_CMDSHIFT_RAMPSTOP7 16 #define ITE_VG_CMDMASK_RAMPSTOP7 0x1FFF0000 // // D[15] Enable stop 6 valid // #define ITE_VG_CMD_RAMPSTOP6VLD 0x00008000 // // D[12:0] Ramp stop g value 6 (1.12) // #define ITE_VG_CMDSHIFT_RAMPSTOP6 0 #define ITE_VG_CMDMASK_RAMPSTOP6 0x00001FFF //====================================== //Ramp Stop Register 67 End //====================================== //====================================== //Ramp Color Register 00 //====================================== #define ITE_VG_REG_RCR00_BASE 0x0CC // // D[27:16] Ramp stop color 0 B (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR0B 16 #define ITE_VG_CMDMASK_RAMPCOLOR0B 0x0FFF0000 // // D[7:0] Ramp stop color 0 A (8) // #define ITE_VG_CMDSHIFT_RAMPCOLOR0A 0 #define ITE_VG_CMDMASK_RAMPCOLOR0A 0x000000FF //====================================== //Ramp Color Register 00 End //====================================== //====================================== //Ramp Color Register 01 //====================================== #define ITE_VG_REG_RCR01_BASE 0x0D0 // // D[27:16] Ramp stop color 0 R (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR0R 16 #define ITE_VG_CMDMASK_RAMPCOLOR0R 0x0FFF0000 // // D[11:0] Ramp stop color 0 G (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR0G 0 #define ITE_VG_CMDMASK_RAMPCOLOR0G 0x00000FFF //====================================== //Ramp Color Register 01 End //====================================== //====================================== //Ramp Color Register 10 //====================================== #define ITE_VG_REG_RCR10_BASE 0x0D4 // // D[27:16] Ramp stop color 1 B (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR1B 16 #define ITE_VG_CMDMASK_RAMPCOLOR1B 0x0FFF0000 // // D[7:0] Ramp stop color 1 A (8) // #define ITE_VG_CMDSHIFT_RAMPCOLOR1A 0 #define ITE_VG_CMDMASK_RAMPCOLOR1A 0x000000FF //====================================== //Ramp Color Register 10 End //====================================== //====================================== //Ramp Color Register 11 //====================================== #define ITE_VG_REG_RCR11_BASE 0x0D8 // // D[27:16] Ramp stop color 1 R (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR1R 16 #define ITE_VG_CMDMASK_RAMPCOLOR1R 0x0FFF0000 // // D[11:0] Ramp stop color 1 G (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR1G 0 #define ITE_VG_CMDMASK_RAMPCOLOR1G 0x00000FFF //====================================== //Ramp Color Register 11 End //====================================== //====================================== //Ramp Color Register 20 //====================================== #define ITE_VG_REG_RCR20_BASE 0x0DC // // D[27:16] Ramp stop color 2 B (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR2B 16 #define ITE_VG_CMDMASK_RAMPCOLOR2B 0x0FFF0000 // // D[7:0] Ramp stop color 2 A (8) // #define ITE_VG_CMDSHIFT_RAMPCOLOR2A 0 #define ITE_VG_CMDMASK_RAMPCOLOR2A 0x000000FF //====================================== //Ramp Color Register 20 End //====================================== //====================================== //Ramp Color Register 21 //====================================== #define ITE_VG_REG_RCR21_BASE 0x0E0 // // D[27:16] Ramp stop color 2 R (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR2R 16 #define ITE_VG_CMDMASK_RAMPCOLOR2R 0x0FFF0000 // // D[11:0] Ramp stop color 2 G (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR2G 0 #define ITE_VG_CMDMASK_RAMPCOLOR2G 0x00000FFF //====================================== //Ramp Color Register 21 End //====================================== //====================================== //Ramp Color Register 30 //====================================== #define ITE_VG_REG_RCR30_BASE 0x0E4 // // D[27:16] Ramp stop color 3 B (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR3B 16 #define ITE_VG_CMDMASK_RAMPCOLOR3B 0x0FFF0000 // // D[7:0] Ramp stop color 3 A (8) // #define ITE_VG_CMDSHIFT_RAMPCOLOR3A 0 #define ITE_VG_CMDMASK_RAMPCOLOR3A 0x000000FF //====================================== //Ramp Color Register 30 End //====================================== //====================================== //Ramp Color Register 31 //====================================== #define ITE_VG_REG_RCR31_BASE 0x0E8 // // D[27:16] Ramp stop color 3 R (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR3R 16 #define ITE_VG_CMDMASK_RAMPCOLOR3R 0x0FFF0000 // // D[11:0] Ramp stop color 3 G (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR3G 0 #define ITE_VG_CMDMASK_RAMPCOLOR3G 0x00000FFF //====================================== //Ramp Color Register 31 End //====================================== //====================================== //Ramp Color Register 40 //====================================== #define ITE_VG_REG_RCR40_BASE 0x0EC // // D[27:16] Ramp stop color 4 B (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR4B 16 #define ITE_VG_CMDMASK_RAMPCOLOR4B 0x0FFF0000 // // D[7:0] Ramp stop color 4 A (8) // #define ITE_VG_CMDSHIFT_RAMPCOLOR4A 0 #define ITE_VG_CMDMASK_RAMPCOLOR4A 0x000000FF //====================================== //Ramp Color Register 40 End //====================================== //====================================== //Ramp Color Register 41 //====================================== #define ITE_VG_REG_RCR41_BASE 0x0F0 // // D[27:16] Ramp stop color 4 R (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR4R 16 #define ITE_VG_CMDMASK_RAMPCOLOR4R 0x0FFF0000 // // D[11:0] Ramp stop color 4 G (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR4G 0 #define ITE_VG_CMDMASK_RAMPCOLOR4G 0x00000FFF //====================================== //Ramp Color Register 41 End //====================================== //====================================== //Ramp Color Register 50 //====================================== #define ITE_VG_REG_RCR50_BASE 0x0F4 // // D[27:16] Ramp stop color 5 B (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR5B 16 #define ITE_VG_CMDMASK_RAMPCOLOR5B 0x0FFF0000 // // D[7:0] Ramp stop color 5 A (8) // #define ITE_VG_CMDSHIFT_RAMPCOLOR5A 0 #define ITE_VG_CMDMASK_RAMPCOLOR5A 0x000000FF //====================================== //Ramp Color Register 50 End //====================================== //====================================== //Ramp Color Register 51 //====================================== #define ITE_VG_REG_RCR51_BASE 0x0F8 // // D[27:16] Ramp stop color 5 R (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR5R 16 #define ITE_VG_CMDMASK_RAMPCOLOR5R 0x0FFF0000 // // D[11:0] Ramp stop color 5 G (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR5G 0 #define ITE_VG_CMDMASK_RAMPCOLOR5G 0x00000FFF //====================================== //Ramp Color Register 51 End //====================================== //====================================== //Ramp Color Register 60 //====================================== #define ITE_VG_REG_RCR60_BASE 0x0FC // // D[27:16] Ramp stop color 6 B (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR6B 16 #define ITE_VG_CMDMASK_RAMPCOLOR6B 0x0FFF0000 // // D[7:0] Ramp stop color 6 A (8) // #define ITE_VG_CMDSHIFT_RAMPCOLOR6A 0 #define ITE_VG_CMDMASK_RAMPCOLOR6A 0x000000FF //====================================== //Ramp Color Register 60 End //====================================== //====================================== //Ramp Color Register 61 //====================================== #define ITE_VG_REG_RCR61_BASE 0x100 // // D[27:16] Ramp stop color 6 R (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR6R 16 #define ITE_VG_CMDMASK_RAMPCOLOR6R 0x0FFF0000 // // D[11:0] Ramp stop color 6 G (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR6G 0 #define ITE_VG_CMDMASK_RAMPCOLOR6G 0x00000FFF //====================================== //Ramp Color Register 61 End //====================================== //====================================== //Ramp Color Register 70 //====================================== #define ITE_VG_REG_RCR70_BASE 0x104 // // D[27:16] Ramp stop color 7 B (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR7B 16 #define ITE_VG_CMDMASK_RAMPCOLOR7B 0x0FFF0000 // // D[7:0] Ramp stop color 7 A (8) // #define ITE_VG_CMDSHIFT_RAMPCOLOR7A 0 #define ITE_VG_CMDMASK_RAMPCOLOR7A 0x000000FF //====================================== //Ramp Color Register 70 End //====================================== //====================================== //Ramp Color Register 71 //====================================== #define ITE_VG_REG_RCR71_BASE 0x108 // // D[27:16] Ramp stop color 7 R (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR7R 16 #define ITE_VG_CMDMASK_RAMPCOLOR7R 0x0FFF0000 // // D[11:0] Ramp stop color 7 G (8.4 pre-multiplied) // #define ITE_VG_CMDSHIFT_RAMPCOLOR7G 0 #define ITE_VG_CMDMASK_RAMPCOLOR7G 0x00000FFF //====================================== //Ramp Color Register 71 End //====================================== //====================================== //Ramp Divider Register 01 //====================================== #define ITE_VG_REG_RDR01_BASE 0x10C // // D[24:0] 2^24(1.24) / distant between Stop0 and Stop1 (1.12) // Result: (13.12) // #define ITE_VG_CMDSHIFT_RAMPDIVIDER01 0 #define ITE_VG_CMDMASK_RAMPDIVIDER01 0x01FFFFFF //====================================== //Ramp Divider Register 01 End //====================================== //====================================== //Ramp Divider Register 12 //====================================== #define ITE_VG_REG_RCR12_BASE 0x110 // // D[24:0] 2^24(1.24) / distant between Stop1 and Stop2 (1.12) // Result: (13.12) // #define ITE_VG_CMDSHIFT_RAMPDIVIDER12 0 #define ITE_VG_CMDMASK_RAMPDIVIDER12 0x01FFFFFF //====================================== //Ramp Divider Register 12 End //====================================== //====================================== //Ramp Divider Register 23 //====================================== #define ITE_VG_REG_RDR23_BASE 0x114 // // D[24:0] 2^24(1.24) / distant between Stop2 and Stop3 (1.12) // Result: (13.12) // #define ITE_VG_CMDSHIFT_RAMPDIVIDER23 0 #define ITE_VG_CMDMASK_RAMPDIVIDER23 0x01FFFFFF //====================================== //Ramp Divider Register 23 End //====================================== //====================================== //Ramp Divider Register 34 //====================================== #define ITE_VG_REG_RCR34_BASE 0x118 // // D[24:0] 2^24(1.24) / distant between Stop3 and Stop4 (1.12) // Result: (13.12) // #define ITE_VG_CMDSHIFT_RAMPDIVIDER34 0 #define ITE_VG_CMDMASK_RAMPDIVIDER34 0x01FFFFFF //====================================== //Ramp Divider Register 34 End //====================================== //====================================== //Ramp Divider Register 45 //====================================== #define ITE_VG_REG_RDR45_BASE 0x11C // // D[24:0] 2^24(1.24) / distant between Stop4 and Stop5 (1.12) // Result: (13.12) // #define ITE_VG_CMDSHIFT_RAMPDIVIDER45 0 #define ITE_VG_CMDMASK_RAMPDIVIDER45 0x01FFFFFF //====================================== //Ramp Divider Register 45 End //====================================== //====================================== //Ramp Divider Register 56 //====================================== #define ITE_VG_REG_RCR56_BASE 0x120 // // D[24:0] 2^24(1.24) / distant between Stop5 and Stop6 (1.12) // Result: (13.12) // #define ITE_VG_CMDSHIFT_RAMPDIVIDER56 0 #define ITE_VG_CMDMASK_RAMPDIVIDER56 0x01FFFFFF //====================================== //Ramp Divider Register 56 End //====================================== //====================================== //Ramp Divider Register 67 //====================================== #define ITE_VG_REG_RDR67_BASE 0x124 // // D[24:0] 2^24(1.24) / distant between Stop6 and Stop7 (1.12) // Result: (13.12) // #define ITE_VG_CMDSHIFT_RAMPDIVIDER67 0 #define ITE_VG_CMDMASK_RAMPDIVIDER67 0x01FFFFFF //====================================== //Ramp Divider Register 67 End //====================================== //====================================== //Gradient Parameter Register A //====================================== #define ITE_VG_REG_GPRA_BASE 0x128 // // D[23:0]Linear & Radial gradient parameter A (s7.16) // #define ITE_VG_CMDSHIFT_GRADIENT0 0 #define ITE_VG_CMDMASK_GRADIENT0 0x00FFFFFF //====================================== //Gradient Parameter Register A End //====================================== //====================================== //Gradient Parameter Register B //====================================== #define ITE_VG_REG_GPRB_BASE 0x12C // // D[23:0]Linear & Radial gradient parameter B (s7.16) // #define ITE_VG_CMDSHIFT_GRADIENT1 0 #define ITE_VG_CMDMASK_GRADIENT1 0x00FFFFFF //====================================== //Gradient Parameter Register B End //====================================== //====================================== //Gradient Parameter Register C //====================================== #define ITE_VG_REG_GPRC_BASE 0x130 // // D[23:0]Linear & Radial gradient parameter C (s7.16) // #define ITE_VG_CMDSHIFT_GRADIENT2 0 #define ITE_VG_CMDMASK_GRADIENT2 0x00FFFFFF //====================================== //Gradient Parameter Register C End //====================================== //====================================== //Gradient Parameter Register D0 //====================================== #define ITE_VG_REG_GPRD0_BASE 0x134 // // D[13:0]Radial gradient parameter D, sign bit & integer part. (s13) // #define ITE_VG_CMDSHIFT_GRADIENT3A 0 #define ITE_VG_CMDMASK_GRADIENT3A 0x00003FFF //====================================== //Gradient Parameter Register D0 End //====================================== //====================================== //Gradient Parameter Register D1 //====================================== #define ITE_VG_REG_GPRD1_BASE 0x138 // // D[23:0]Radial gradient parameter D, fix point part. (.24) // #define ITE_VG_CMDSHIFT_GRADIENT3B 0 #define ITE_VG_CMDMASK_GRADIENT3B 0x00FFFFFF //====================================== //Gradient Parameter Register D1 End //====================================== //====================================== //Gradient Parameter Register E0 //====================================== #define ITE_VG_REG_GPRE0_BASE 0x13C // // D[13:0]Radial gradient parameter E, sign bit & integer part. (s13) // #define ITE_VG_CMDSHIFT_GRADIENT4A 0 #define ITE_VG_CMDMASK_GRADIENT4A 0x00003FFF //====================================== //Gradient Parameter Register E0 End //====================================== //====================================== //Gradient Parameter Register E1 //====================================== #define ITE_VG_REG_GPRE1_BASE 0x140 // // D[23:0]Radial gradient parameter E, fix point part. (.24) // #define ITE_VG_CMDSHIFT_GRADIENT4B 0 #define ITE_VG_CMDMASK_GRADIENT4B 0x00FFFFFF //====================================== //Gradient Parameter Register E1 End //====================================== //====================================== //Gradient Parameter Register F0 //====================================== #define ITE_VG_REG_GPRF0_BASE 0x144 // // D[13:0]Radial gradient parameter F, sign bit & integer part. (s13) // #define ITE_VG_CMDSHIFT_GRADIENT5A 0 #define ITE_VG_CMDMASK_GRADIENT5A 0x00003FFF //====================================== //Gradient Parameter Register F0 End //====================================== //====================================== //Gradient Parameter Register F1 //====================================== #define ITE_VG_REG_GPRF1_BASE 0x148 // // D[23:0]Radial gradient parameter F, fix point part. (.24) // #define ITE_VG_CMDSHIFT_GRADIENT5B 0 #define ITE_VG_CMDMASK_GRADIENT5B 0x00FFFFFF //====================================== //Gradient Parameter Register F1 End //====================================== //====================================== //Gradient Parameter Register G0 //====================================== #define ITE_VG_REG_GPRG0_BASE 0x14C // // D[13:0]Radial gradient parameter G, sign bit & integer part. (s13) // #define ITE_VG_CMDSHIFT_GRADIENT6A 0 #define ITE_VG_CMDMASK_GRADIENT6A 0x00003FFF //====================================== //Gradient Parameter Register G0 End //====================================== //====================================== //Gradient Parameter Register G1 //====================================== #define ITE_VG_REG_GPRG1_BASE 0x150 // // D[23:0]Radial gradient parameter G, fix point part. (.24) // #define ITE_VG_CMDSHIFT_GRADIENT6B 0 #define ITE_VG_CMDMASK_GRADIENT6B 0x00FFFFFF //====================================== //Gradient Parameter Register G1 End //====================================== //====================================== //Gradient Parameter Register H0 //====================================== #define ITE_VG_REG_GPRH0_BASE 0x154 // // D[13:0]Radial gradient parameter H, sign bit & integer part. (s13) // #define ITE_VG_CMDSHIFT_GRADIENT7A 0 #define ITE_VG_CMDMASK_GRADIENT7A 0x00003FFF //====================================== //Gradient Parameter Register H0 End //====================================== //====================================== //Gradient Parameter Register H1 //====================================== #define ITE_VG_REG_GPRH1_BASE 0x158 // // D[23:0]Radial gradient parameter H, fix point part. (.24) // #define ITE_VG_CMDSHIFT_GRADIENT7B 0 #define ITE_VG_CMDMASK_GRADIENT7B 0x00FFFFFF //====================================== //Gradient Parameter Register H1 End //====================================== //====================================== //Gradient Parameter Register I0 //====================================== #define ITE_VG_REG_GPRI0_BASE 0x15C // // D[13:0]Radial gradient parameter I, sign bit & integer part. (s13) // #define ITE_VG_CMDSHIFT_GRADIENT8A 0 #define ITE_VG_CMDMASK_GRADIENT8A 0x00003FFF //====================================== //Gradient Parameter Register I0 End //====================================== //====================================== //Gradient Parameter Register I1 //====================================== #define ITE_VG_REG_GPRI1_BASE 0x160 // // D[23:0]Radial gradient parameter I, fix point part. (.24) // #define ITE_VG_CMDSHIFT_GRADIENT8B 0 #define ITE_VG_CMDMASK_GRADIENT8B 0x00FFFFFF //====================================== //Gradient Parameter Register I1 End //====================================== //====================================== //Color Transform Register 0 //====================================== #define ITE_VG_REG_CTBR0_BASE 0x164 // // D[23:0]Color transform parameter Br (s15.8) // #define ITE_VG_CMDSHIFT_COLXFM00 0 #define ITE_VG_CMDMASK_COLXFM00 0x00FFFFFF //====================================== //Color Transform Register 0 End //====================================== //====================================== //Color Transform Register 1 //====================================== #define ITE_VG_REG_CTBR1_BASE 0x168 // // D[23:0]Color transform parameter Bg (s15.8) // #define ITE_VG_CMDSHIFT_COLXFM10 0 #define ITE_VG_CMDMASK_COLXFM10 0x00FFFFFF //====================================== //Color Transform Register 1 End //====================================== //====================================== //Color Transform Register 2 //====================================== #define ITE_VG_REG_CTBR2_BASE 0x16C // // D[23:0]Color transform parameter Bb (s15.8) // #define ITE_VG_CMDSHIFT_COLXFM20 0 #define ITE_VG_CMDMASK_COLXFM20 0x00FFFFFF //====================================== //Color Transform Register 2 End //====================================== //====================================== //Color Transform Register 3 //====================================== #define ITE_VG_REG_CTBR3_BASE 0x170 // // D[23:0]Color transform parameter Ba (s15.8) // #define ITE_VG_CMDSHIFT_COLXFM30 0 #define ITE_VG_CMDMASK_COLXFM30 0x00FFFFFF //====================================== //Color Transform Register 3 End //====================================== //====================================== //Destination Coordinate Register //====================================== #define ITE_VG_REG_DCR_BASE 0x174 // // D[28:16]Destination Y Coordinate (s12) // #define ITE_VG_CMDSHIFT_DSTY 16 #define ITE_VG_CMDMASK_DSTY 0x1FFF0000 // // D[12:0]Destination Y Coordinate (s12) // #define ITE_VG_CMDSHIFT_DSTX 0 #define ITE_VG_CMDMASK_DSTX 0x00001FFF //====================================== //Destination Coordinate Register End //====================================== //====================================== //Destination Height/Width Register //====================================== #define ITE_VG_REG_DHWR_BASE 0x178 // // D[29:16]Destination Height (Max: 8192) // #define ITE_VG_CMDSHIFT_DSTHEIGHT 16 #define ITE_VG_CMDMASK_DSTHEIGHT 0x3FFF0000 // // D[13:0]Destination Width (Max: 8192) // #define ITE_VG_CMDSHIFT_DSTWIDTH 0 #define ITE_VG_CMDMASK_DSTWIDTH 0x00003FFF //====================================== //Destination Height/Width Register End //====================================== //====================================== //Destination Base Register //====================================== #define ITE_VG_REG_DBR_BASE 0x17C // // D[31:0]Destination Base Address // #define ITE_VG_CMDSHIFT_DSTBASE 0 #define ITE_VG_CMDMASK_DSTBASE 0xFFFFFFFF //====================================== //Destination Base Register End //====================================== //====================================== //Src/Dst Pitch Register //====================================== #define ITE_VG_REG_SDPR_BASE 0x180 // // D[30:16]Source Pitch Width in Byte // #define ITE_VG_CMDSHIFT_SRCPITCH0 16 #define ITE_VG_CMDMASK_SRCPITCH0 0x7FFF0000 // // D[14:0]Destination Pitch Width in Byte // #define ITE_VG_CMDSHIFT_DSTPITCH 0 #define ITE_VG_CMDMASK_DSTPITCH 0x00007FFF //====================================== //Src/Dst Pitch Register End //====================================== //====================================== //Source Coordinate Register //====================================== #define ITE_VG_REG_SCR_BASE 0x184 // // D[28:16]Source Y Coordinate (s12) // #define ITE_VG_CMDSHIFT_SRCY 16 #define ITE_VG_CMDMASK_SRCY 0x1FFF0000 // // D[12:0]Source Y Coordinate (s12) // #define ITE_VG_CMDSHIFT_SRCX 0 #define ITE_VG_CMDMASK_SRCX 0x00001FFF //====================================== //Source Coordinate Register End //====================================== //====================================== //Source Height/Width Register //====================================== #define ITE_VG_REG_SHWR_BASE 0x188 // // D[29:16]Source Height (Max: 8192) // #define ITE_VG_CMDSHIFT_SRCHEIGHT 16 #define ITE_VG_CMDMASK_SRCHEIGHT 0x3FFF0000 // // D[13:0]Source Width (Max: 8192) // #define ITE_VG_CMDSHIFT_SRCWIDTH 0 #define ITE_VG_CMDMASK_SRCWIDTH 0x00003FFF //====================================== //Source Height/Width Register End //====================================== //====================================== //Source Base Register //====================================== #define ITE_VG_REG_SBR_BASE 0x18C // // D[31:0]Source Base Address // #define ITE_VG_CMDSHIFT_SRCBASE 0 #define ITE_VG_CMDMASK_SRCBASE 0xFFFFFFFF //====================================== //Source Base Register End //====================================== //====================================== //Source 1/2 Pitch Register //====================================== #define ITE_VG_REG_SPR12_BASE 0x190 // // D[30:16]Source 2 Pitch for better quality. (4x Source Image) // #define ITE_VG_CMDSHIFT_SRCPITCH2 16 #define ITE_VG_CMDMASK_SRCPITCH2 0x7FFF0000 // // D[14:0]Source 1 Pitch for better quality. (1/4x Source Image) // Note: As read destination pitch at lookup table. // #define ITE_VG_CMDSHIFT_SRCPITCH1 0 #define ITE_VG_CMDMASK_SRCPITCH1 0x00007FFF // // D[24] Enable Src1 extend bits. // #define ITE_VG_SRC1EXTEND_EN 0x01000000 // // D[23:16] Src1 data format. Please see OpenVG 1.1 Spec. Page 136 // #define ITE_VG_SRC1FORMAT 0x00FF0000 #define ITE_VG_SRC1FORMAT_SHIFT 16 //====================================== //Source 1/2 Pitch Register End //====================================== //====================================== //Source 1 Base Register //====================================== #define ITE_VG_REG_SBR1_BASE 0x194 // // D[31:0]Source 1 Base Address for better quality. // (1/4x Source Image) // Note: As read destination base address at lookup table. // #define ITE_VG_CMDSHIFT_SRCBASE1 0 #define ITE_VG_CMDMASK_SRCBASE1 0xFFFFFFFF //====================================== //Source 1 Base Register End //====================================== //====================================== //Source 2 Base Register //====================================== #define ITE_VG_REG_SBR2_BASE 0x198 // // D[31:0]Source 2 Base Address for better quality. // (1/4x Source Image) // Note: As read destination base address at lookup table. // #define ITE_VG_CMDSHIFT_SRCBASE2 0 #define ITE_VG_CMDMASK_SRCBASE2 0xFFFFFFFF // // D[28:16] Source1 Y Coordinate (s12) at RENDERMODE=2 b10 // #define ITE_VG_CMDSHIFT_SRCY1 16 // // D[12:0] Source1 X Coordinate (s12) at RENDERMODE=2 b10 // #define ITE_VG_CMDSHIFT_SRCX1 0 //====================================== //Source 2 Base Register End //====================================== //====================================== //Mask Base Register //====================================== #define ITE_VG_REG_MBR_BASE 0x19C // // D[31:0]Mask Base Address // #define ITE_VG_CMDSHIFT_MASKBASE 0 #define ITE_VG_CMDMASK_MASKBASE 0xFFFFFFFF //====================================== //Mask Base Register End //====================================== //====================================== //Scissor/Mask Pitch Register //====================================== #define ITE_VG_REG_SMPR_BASE 0x1A0 // // D[25:16]Scissoring Pitch (64 bits alignment) // #define ITE_VG_CMDSHIFT_SCISPITCH 16 #define ITE_VG_CMDMASK_SCISPITCH 0x03FF0000 // // D[12:0]Masking Pitch // #define ITE_VG_CMDSHIFT_MASKPITCH 0 #define ITE_VG_CMDMASK_MASKPITCH 0x00000FFF //====================================== //Scissor/Mask Pitch Register End //====================================== //====================================== //Scissor Base Register //====================================== #define ITE_VG_REG_SCBR_BASE 0x1A4 // // D[31:0]Scissoring Base Address (64 bits alignment) // #define ITE_VG_CMDSHIFT_SCISBASE 0 #define ITE_VG_CMDMASK_SCISBASE 0xFFFFFFFF //====================================== //Scissor Base Register End //====================================== //====================================== //User Inverse Transform Register 00 //====================================== #define ITE_VG_REG_UITR00_BASE 0x1A8 // // D[28:0]User Inverse Transform Parameter (0,0) (s12.16) // #define ITE_VG_CMDSHIFT_USRINV00 0 #define ITE_VG_CMDMASK_USRINV00 0x1FFFFFFF //====================================== //User Inverse Transform Register 00 End //====================================== //====================================== //User Inverse Transform Register 01 //====================================== #define ITE_VG_REG_UITR01_BASE 0x1AC // // D[28:0]User Inverse Transform Parameter (0,1) (s12.16) // #define ITE_VG_CMDSHIFT_USRINV01 0 #define ITE_VG_CMDMASK_USRINV01 0x1FFFFFFF //====================================== //User Inverse Transform Register 01 End //====================================== //====================================== //User Inverse Transform Register 02 //====================================== #define ITE_VG_REG_UITR02_BASE 0x1B0 // // D[28:0]User Inverse Transform Parameter (0,2) (s12.16) // #define ITE_VG_CMDSHIFT_USRINV02 0 #define ITE_VG_CMDMASK_USRINV02 0x1FFFFFFF //====================================== //User Inverse Transform Register 02 End //====================================== //====================================== //User Inverse Transform Register 10 //====================================== #define ITE_VG_REG_UITR10_BASE 0x1B4 // // D[28:0]User Inverse Transform Parameter (1,0) (s12.16) // #define ITE_VG_CMDSHIFT_USRINV10 0 #define ITE_VG_CMDMASK_USRINV10 0x1FFFFFFF //====================================== //User Inverse Transform Register 10 End //====================================== //====================================== //User Inverse Transform Register 11 //====================================== #define ITE_VG_REG_UITR11_BASE 0x1B8 // // D[28:0]User Inverse Transform Parameter (1,1) (s12.16) // #define ITE_VG_CMDSHIFT_USRINV11 0 #define ITE_VG_CMDMASK_USRINV11 0x1FFFFFFF //====================================== //User Inverse Transform Register 11 End //====================================== //====================================== //User Inverse Transform Register 12 //====================================== #define ITE_VG_REG_UITR12_BASE 0x1BC // // D[28:0]User Inverse Transform Parameter (1,2) (s12.16) // #define ITE_VG_CMDSHIFT_USRINV12 0 #define ITE_VG_CMDMASK_USRINV12 0x1FFFFFFF //====================================== //User Inverse Transform Register 12 End //====================================== //====================================== //User Inverse Transform Register 20 //====================================== #define ITE_VG_REG_UITR20_BASE 0x1C0 // // D[28:0]User Inverse Transform Parameter (2,0) (s12.16) // #define ITE_VG_CMDSHIFT_USRINV20 0 #define ITE_VG_CMDMASK_USRINV20 0x1FFFFFFF //====================================== //User Inverse Transform Register 20 End //====================================== //====================================== //User Inverse Transform Register 21 //====================================== #define ITE_VG_REG_UITR21_BASE 0x1C4 // // D[28:0]User Inverse Transform Parameter (2,1) (s12.16) // #define ITE_VG_CMDSHIFT_USRINV21 0 #define ITE_VG_CMDMASK_USRINV21 0x1FFFFFFF //====================================== //User Inverse Transform Register 21 End //====================================== //====================================== //User Inverse Transform Register 22 //====================================== #define ITE_VG_REG_UITR22_BASE 0x1C8 // // D[28:0]User Inverse Transform Parameter (2,2) (s12.16) // #define ITE_VG_CMDSHIFT_USRINV22 0 #define ITE_VG_CMDMASK_USRINV22 0x1FFFFFFF //====================================== //User Inverse Transform Register 22 End //====================================== //====================================== //Paint Inverse Transform Register 00 //====================================== #define ITE_VG_REG_PITR00_BASE 0x1CC // // D[28:0]Paint Inverse Transform Parameter (0,0) (s12.16) // #define ITE_VG_CMDSHIFT_PATINV00 0 #define ITE_VG_CMDMASK_PATINV00 0x1FFFFFFF //====================================== //Paint Inverse Transform Register 00 End //====================================== //====================================== //Paint Inverse Transform Register 01 //====================================== #define ITE_VG_REG_PITR01_BASE 0x1D0 // // D[28:0]Paint Inverse Transform Parameter (0,1) (s12.16) // #define ITE_VG_CMDSHIFT_PATINV01 0 #define ITE_VG_CMDMASK_PATINV01 0x1FFFFFFF //====================================== //Paint Inverse Transform Register 01 End //====================================== //====================================== //Paint Inverse Transform Register 02 //====================================== #define ITE_VG_REG_PITR02_BASE 0x1D4 // // D[28:0]Paint Inverse Transform Parameter (0,2) (s12.16) // #define ITE_VG_CMDSHIFT_PATINV02 0 #define ITE_VG_CMDMASK_PATINV02 0x1FFFFFFF //====================================== //Paint Inverse Transform Register 02 End //====================================== //====================================== //Paint Inverse Transform Register 10 //====================================== #define ITE_VG_REG_PITR10_BASE 0x1D8 // // D[28:0]Paint Inverse Transform Parameter (1,0) (s12.16) // #define ITE_VG_CMDSHIFT_PATINV10 0 #define ITE_VG_CMDMASK_PATINV10 0x1FFFFFFF //====================================== //Paint Inverse Transform Register 10 End //====================================== //====================================== //Paint Inverse Transform Register 11 //====================================== #define ITE_VG_REG_PITR11_BASE 0x1DC // // D[28:0]Paint Inverse Transform Parameter (1,1) (s12.16) // #define ITE_VG_CMDSHIFT_PATINV11 0 #define ITE_VG_CMDMASK_PATINV11 0x1FFFFFFF //====================================== //Paint Inverse Transform Register 11 End //====================================== //====================================== //Paint Inverse Transform Register 12 //====================================== #define ITE_VG_REG_PITR12_BASE 0x1E0 // // D[28:0]Paint Inverse Transform Parameter (1,2) (s12.16) // #define ITE_VG_CMDSHIFT_PATINV12 0 #define ITE_VG_CMDMASK_PATINV12 0x1FFFFFFF //====================================== //Paint Inverse Transform Register 12 End //====================================== //====================================== //Color Transform Scale Register 0 //====================================== #define ITE_VG_REG_CTSR0_BASE 0x1E4 // // D[31:16]Color transform parameter Sg (s7.8) // #define ITE_VG_CMDSHIFT_SCOLXFM10 16 #define ITE_VG_CMDMASK_SCOLXFM10 0xFFFF0000 // // D[15:0]Color transform parameter Sr (s7.8) // #define ITE_VG_CMDSHIFT_SCOLXFM00 0 #define ITE_VG_CMDMASK_SCOLXFM00 0x0000FFFF //====================================== //Color Transform Scale Register 0 End //====================================== //====================================== //Color Transform Scale Register 1 //====================================== #define ITE_VG_REG_CTSR1_BASE 0x1E8 // // D[31:16]Color transform parameter Sa (s7.8) // #define ITE_VG_CMDSHIFT_SCOLXFM30 16 #define ITE_VG_CMDMASK_SCOLXFM30 0xFFFF0000 // // D[15:0]Color transform parameter Sb (s7.8) // #define ITE_VG_CMDSHIFT_SCOLXFM20 0 #define ITE_VG_CMDMASK_SCOLXFM20 0x0000FFFF //====================================== //Color Transform Scale Register 1 End //====================================== //====================================== //Texture Quality Scalar Register //====================================== #define ITE_VG_REG_TQSR_BASE 0x1EC // // D[23:0]Texture quality scalar ratio. (12.12) // #define ITE_VG_CMDSHIFT_TexScalar 0 #define ITE_VG_CMDMASK_TexScalar 0x00FFFFFF // // D[28:16] Source1 Height (Max: 8192) at RENDERMODE=2 b10 // #define ITE_VG_CMDMASK_SRC1HEIGHT 0x1FFF0000 #define ITE_VG_CMDSHIFT_SRC1HEIGHT 16 // // D[12:0] Source1 Height (Max: 8192) at RENDERMODE=2 b10 // #define ITE_VG_CMDMASK_SRC1WIDTH 0x00001FFF //====================================== //Texture Quality Scalar Register End //====================================== //====================================== //Constant Alpha Register //====================================== #define ITE_VG_REG_CAR_BASE 0x1F0 // // D[31:24]Constant Alpha of Red (8) // #define ITE_VG_CMDSHIFT_CONSTALPHA_R 24 #define ITE_VG_CMDMASK_CONSTALPHA_R 0xFF000000 // // D[23:16]Constant Alpha of Green (8) // #define ITE_VG_CMDSHIFT_CONSTALPHA_G 16 #define ITE_VG_CMDMASK_CONSTALPHA_G 0x00FF0000 // // D[15:8]Constant Alpha of Blue (8) // #define ITE_VG_CMDSHIFT_CONSTALPHA_B 8 #define ITE_VG_CMDMASK_CONSTALPHA_B 0x0000FF00 // // D[7:0]Constant Alpha of Alpha (8) // #define ITE_VG_CMDSHIFT_CONSTALPHA_A 0 #define ITE_VG_CMDMASK_CONSTALPHA_A 0x000000FF //====================================== //Constant Alpha Register End //====================================== //====================================== //Destination Paint Color Register 0 //====================================== #define ITE_VG_REG_DPCR0_BASE 0x1F4 // // D[23:16]Destination paint color Blue, tBitBlt High color key // #define ITE_VG_CMDSHIFT_DSTCOLOR_B 16 #define ITE_VG_CMDMASK_DSTCOLOR_B 0x00FF0000 // // D[7:0]Destination paint color Alpha, tBitBlt High color key // #define ITE_VG_CMDSHIFT_DSTCOLOR_A 0 #define ITE_VG_CMDMASK_DSTCOLOR_A 0x000000FF //====================================== //Destination Paint Color Register 0 End //====================================== //====================================== //Destination Paint Color Register 1 //====================================== #define ITE_VG_REG_DPCR1_BASE 0x1F8 // // D[23:16]Destination paint color Blue, tBitBlt High color key // #define ITE_VG_CMDSHIFT_DSTCOLOR_R 16 #define ITE_VG_CMDMASK_DSTCOLOR_R 0x00FF0000 // // D[11:0]Destination paint color Alpha, tBitBlt High color key // #define ITE_VG_CMDSHIFT_DSTCOLOR_G 0 #define ITE_VG_CMDMASK_DSTCOLOR_G 0x00000FFF //====================================== //Destination Paint Color Register 1 End //====================================== //====================================== //Pattern Paint Color Register 0 //====================================== #define ITE_VG_REG_PPCR0_BASE 0x1FC // // D[23:16] ROP3 pattern paint color Blue, tBitBlt High color key // #define ITE_VG_CMDSHIFT_PATCOLOR_B 16 #define ITE_VG_CMDMASK_PATCOLOR_B 0x00FF0000 // // D[7:0] ROP3 pattern paint color Blue, tBitBlt High color key // #define ITE_VG_CMDSHIFT_PATCOLOR_A 0 #define ITE_VG_CMDMASK_PATCOLOR_A 0x000000FF //====================================== //Pattern Paint Color Register 0 end //====================================== //====================================== //Pattern Paint Color Register 1 //====================================== #define ITE_VG_REG_PPCR1_BASE 0x200 // // D[23:16]ROP3 pattern paint color Red, tBitBlt High color key // #define ITE_VG_CMDSHIFT_DSTCOLOR_R 16 #define ITE_VG_CMDMASK_DSTCOLOR_R 0x00FF0000 // // D[11:0]ROP3 pattern paint color Red, tBitBlt High color key // #define ITE_VG_CMDSHIFT_DSTCOLOR_G 0 #define ITE_VG_CMDMASK_DSTCOLOR_G 0x00000FFF //====================================== //Pattern Paint Color Register 1 End //====================================== //====================================== //BIST State Register //====================================== #define ITE_VG_REG_BISTR_BASE 0x20C // // D[11:8]R // #define ITE_VG_CMDSHIFT_BIST_DONE 8 #define ITE_VG_CMDMASK_BIST_DONE 0x00000F00 // // D[3:0]R // #define ITE_VG_CMDSHIFT_BIST_FAULT 0 #define ITE_VG_CMDMASK_BIST_FAULT 0x0000000F //====================================== //BIST State Register End //====================================== //====================================== //Command Register //====================================== #define ITE_VG_REG_CMDR_BASE 0x210 // // D[0]ALL Engine busy enable. // 0: HVGBusy = Only Front Engine busy. // 1: HVGBusy = All Engine busy. // #define ITE_VG_CMD_HVGBUSY 0x00000001 //====================================== //Command Register //====================================== #define ITE_VG_REG_ESR1_BASE 0x214 #define ITE_VG_REG_ESR2_BASE 0x218 #define ITE_VG_REG_ESR3_BASE 0x21C //====================================== // Interrupt Control Register //====================================== #define ITE_VG_REG_ICR_BASE 0x224 #define ITE_VG_CMDSHIFT_BID6INT 13 #define ITE_VG_CMDMASK_BID6INT 0x00002000 #define ITE_VG_CMDSHIFT_BID5INT 12 #define ITE_VG_CMDMASK_BID5INT 0x00001000 #define ITE_VG_CMDSHIFT_BID4INT 11 #define ITE_VG_CMDMASK_BID4INT 0x00000800 #define ITE_VG_CMDSHIFT_BID3INT 10 #define ITE_VG_CMDMASK_BID3INT 0x00000400 #define ITE_VG_CMDSHIFT_BID2INT 9 #define ITE_VG_CMDMASK_BID2INT 0x00000200 #define ITE_VG_CMDSHIFT_BID1INT 8 #define ITE_VG_CMDMASK_BID1INT 0x00000100 #define ITE_VG_CMDSHIFT_BID6INT_EN 5 #define ITE_VG_CMDMASK_BID6INT_EN 0x00000020 #define ITE_VG_CMDSHIFT_BID5INT_EN 4 #define ITE_VG_CMDMASK_BID5INT_EN 0x00000010 #define ITE_VG_CMDSHIFT_BID4INT_EN 3 #define ITE_VG_CMDMASK_BID4INT_EN 0x00000008 #define ITE_VG_CMDSHIFT_BID3INT_EN 2 #define ITE_VG_CMDMASK_BID3INT_EN 0x00000004 #define ITE_VG_CMDSHIFT_BID2INT_EN 1 #define ITE_VG_CMDMASK_BID2INT_EN 0x00000002 #define ITE_VG_CMDSHIFT_BID1INT_EN 0 #define ITE_VG_CMDMASK_BID1INT_EN 0x00000001 //====================================== // BitBlt ID 1 Register //====================================== #define ITE_VG_REG_BID1_BASE 0x228 //====================================== // BitBlt ID 2 Register //====================================== #define ITE_VG_REG_BID2_BASE 0x22C //====================================== // BitBlt ID 3 Register //====================================== #define ITE_VG_REG_BID3_BASE 0x230 //====================================== // BitBlt ID 4 Register //====================================== #define ITE_VG_REG_BID4_BASE 0x234 //====================================== // BitBlt ID 5 Register //====================================== #define ITE_VG_REG_BID5_BASE 0x238 //====================================== // BitBlt ID 6 Register //====================================== #define ITE_VG_REG_BID6_BASE 0x23C //====================================== //Revision Register //====================================== #define ITE_VG_REG_REV_BASE 0x240 // // D[23:16]Major revision number // #define ITE_VG_CMDSHIFT_MAJOR_REV 16 #define ITE_VG_CMDMASK_MAJOR_REV 0x00FF0000 // // D[15:8]Minor revision number // #define ITE_VG_CMDSHIFT_MINOR_REV 8 #define ITE_VG_CMDMASK_MINOR_REV 0x0000FF00 // // D[7:0]Release number // #define ITE_VG_CMDSHIFT_REL_REV 0 #define ITE_VG_CMDMASK_REL_REV 0x000000FF //====================================== //Revision Register End //====================================== /* ======================================== */ /* ITE Register End */ /* ======================================== */ #define POINTPREC 11 #define CACHE 0 #define COVERAGEDRAW 0 #define RENDERDRAW 0 #define ADDRESSBIT 12 #define CACHESIZE 4096 // 2^8 = 256 #define CACHESET 1 #define DUMPDATA 1 #define DUMPWIDTH 73 #define DUMPHEIGHT 65 #define DUMPFORMAT 1 #define DEBUGLENGTH 1 typedef enum { HW_FALSE = 0, HW_TRUE = 1 } HWboolean; typedef enum { HW_EVEN_ODD = 0, HW_NON_ZERO = 1 } HWFillRule; typedef enum { HW_IMAGE_QUALITY_NONANTIALIASED = 0, HW_IMAGE_QUALITY_FASTER = 1, HW_IMAGE_QUALITY_BETTER = 2 } HWImageQuality; typedef enum { HW_RENDERING_QUALITY_NONANTIALIASED = 0, HW_RENDERING_QUALITY_FASTER = 1, HW_RENDERING_QUALITY_BETTER = 2 /* Default */ } HWRenderingQuality; typedef enum { HW_BLEND_SRC = 0x0, HW_BLEND_SRC_OVER = 0x1, HW_BLEND_DST_OVER = 0x2, HW_BLEND_SRC_IN = 0x3, HW_BLEND_DST_IN = 0x4, HW_BLEND_MULTIPLY = 0x5, HW_BLEND_SCREEN = 0x6, HW_BLEND_DARKEN = 0x7, HW_BLEND_LIGHTEN = 0x8, HW_BLEND_ADDITIVE = 0x9, HW_UNION_MASK = 0x10, HW_INTERSECT_MASK = 0x11, HW_SUBTRACT_MASK = 0x12 } HWBlendMode; typedef enum { HW_UNION_RENDERMASK = 0x0, HW_INTERSECT_RENDERMASK = 0x1, HW_SUBTRACT_RENDERMASK = 0x2 } HWMaskMode; typedef enum { HW_DRAW_IMAGE_NORMAL = 0x0, HW_DRAW_IMAGE_MULTIPLY = 0x1, HW_DRAW_IMAGE_STENCIL = 0x2 } HWImageMode; typedef enum { HW_FILL_PATH = 0, HW_STROKE_PATH = 1 } HWPaintMode; typedef enum { HW_CAP_BUTT = 0x0, HW_CAP_ROUND = 0x1, HW_CAP_SQUARE = 0x2 } HWCapStyle; typedef enum { HW_JOIN_MITER = 0x0, HW_JOIN_ROUND = 0x1, HW_JOIN_BEVEL = 0x2 } HWJoinStyle; typedef enum { HW_COLOR_RAMP_SPREAD_PAD = 0, HW_COLOR_RAMP_SPREAD_REPEAT = 1, HW_COLOR_RAMP_SPREAD_REFLECT = 2 } HWColorRampSpreadMode; typedef enum { HW_PAINT_TYPE_COLOR = 0, HW_PAINT_TYPE_LINEAR_GRADIENT = 1, HW_PAINT_TYPE_RADIAL_GRADIENT = 2, HW_PAINT_TYPE_PATTERN = 3 } HWPaintType; typedef enum { HW_TILE_FILL = 0, HW_TILE_PAD = 1, HW_TILE_REPEAT = 2, HW_TILE_REFLECT = 3 } HWTilingMode; typedef enum { /* RGB{A,X} channel ordering */ HW_sRGBX_8888 = 0, HW_sRGBA_8888 = 1, HW_sRGBA_8888_PRE = 2, HW_sRGB_565 = 3, HW_sRGBA_5551 = 4, HW_sRGBA_4444 = 5, HW_sL_8 = 6, HW_lRGBX_8888 = 7, HW_lRGBA_8888 = 8, HW_lRGBA_8888_PRE = 9, HW_lL_8 = 10, HW_A_8 = 11, HW_BW_1 = 12, HW_A_1 = 13, HW_A_4 = 14, HW_RGBA_16 = 15, /* {A,X}RGB channel ordering */ HW_sXRGB_8888 = 0 | (1 << 6), HW_sARGB_8888 = 1 | (1 << 6), HW_sARGB_8888_PRE = 2 | (1 << 6), HW_sARGB_1555 = 4 | (1 << 6), HW_sARGB_4444 = 5 | (1 << 6), HW_lXRGB_8888 = 7 | (1 << 6), HW_lARGB_8888 = 8 | (1 << 6), HW_lARGB_8888_PRE = 9 | (1 << 6), /* BGR{A,X} channel ordering */ HW_sBGRX_8888 = 0 | (1 << 7), HW_sBGRA_8888 = 1 | (1 << 7), HW_sBGRA_8888_PRE = 2 | (1 << 7), HW_sBGR_565 = 3 | (1 << 7), HW_sBGRA_5551 = 4 | (1 << 7), HW_sBGRA_4444 = 5 | (1 << 7), HW_lBGRX_8888 = 7 | (1 << 7), HW_lBGRA_8888 = 8 | (1 << 7), HW_lBGRA_8888_PRE = 9 | (1 << 7), /* {A,X}BGR channel ordering */ HW_sXBGR_8888 = 0 | (1 << 6) | (1 << 7), HW_sABGR_8888 = 1 | (1 << 6) | (1 << 7), HW_sABGR_8888_PRE = 2 | (1 << 6) | (1 << 7), HW_sABGR_1555 = 4 | (1 << 6) | (1 << 7), HW_sABGR_4444 = 5 | (1 << 6) | (1 << 7), HW_lXBGR_8888 = 7 | (1 << 6) | (1 << 7), HW_lABGR_8888 = 8 | (1 << 6) | (1 << 7), HW_lABGR_8888_PRE = 9 | (1 << 6) | (1 << 7), } HWImageFormat; typedef struct { ITEs12p3 x,y; //s12.3 } HWVector2; typedef struct { ITEs15p16 x,y; //s15.16 } HWTXVector2; typedef struct { ITEs15p16 x; //s15.16 ITEs12p3 y; //s12.3 } HWPXVector2; typedef struct { ITEs12p3 x,y,z; //s12.3 } HWVector3; typedef struct { ITEs15p16 x,y,z; //s15.16 } HWTXVector3; typedef struct { ITEs15p16 m[3][3]; //s15.16 } HWMatrix3x3; // (v, mat, vout) = (s12.3, s15.16, s12.16) #define HW0TRANSFORM3TO(v, mat, vout) { \ vout.x = (ITEint32)(((ITEint)v.x*mat.m[0][0] + (ITEint)v.y*mat.m[0][1] + (ITEint)v.z*mat.m[0][2] + (1<<2) )>>3); \ vout.y = (ITEint32)(((ITEint)v.x*mat.m[1][0] + (ITEint)v.y*mat.m[1][1] + (ITEint)v.z*mat.m[1][2] + (1<<2) )>>3); \ vout.z = (ITEint32)(((ITEint)v.x*mat.m[2][0] + (ITEint)v.y*mat.m[2][1] + (ITEint)v.z*mat.m[2][2] + (1<<2) )>>3); } // (v, mat, vout) = (s12.3, s15.16, s12.3) #define HW1TRANSFORM3TO(v, mat, vout) { \ vout.x = (ITEint16)(((ITEint)v.x*mat.m[0][0] + (ITEint)v.y*mat.m[0][1] + (ITEint)v.z*mat.m[0][2] + (1<<15) )>>16); \ vout.y = (ITEint16)(((ITEint)v.x*mat.m[1][0] + (ITEint)v.y*mat.m[1][1] + (ITEint)v.z*mat.m[1][2] + (1<<15) )>>16); \ vout.z = (ITEint16)(((ITEint)v.x*mat.m[2][0] + (ITEint)v.y*mat.m[2][1] + (ITEint)v.z*mat.m[2][2] + (1<<15) )>>16); } // (v, mat, vout) = (s12.3, s15.16, s15.16) #define HW0TRANSFORM2TO(v, mat, vout) { \ vout.x = (ITEint32)(((ITEint)v.x*mat.m[0][0] + (ITEint)v.y*mat.m[0][1] + 8*mat.m[0][2] + (1<<2) )>>3); \ vout.y = (ITEint32)(((ITEint)v.x*mat.m[1][0] + (ITEint)v.y*mat.m[1][1] + 8*mat.m[1][2] + (1<<2) )>>3); } // (v, mat, vout) = (s15.16, s15.16, s12.3) #define HW1TRANSFORM2TO(v, mat, vout) { \ vout.x = (ITEint16)(((ITEint64)v.x*mat.m[0][0] + (ITEint64)v.y*mat.m[0][1] + (ITEint64)0x10000*mat.m[0][2] + (1<<28) )>>29); \ vout.y = (ITEint16)(((ITEint64)v.x*mat.m[1][0] + (ITEint64)v.y*mat.m[1][1] + (ITEint64)0x10000*mat.m[1][2] + (1<<28) )>>29); } // (v, mat, vout) = (s12.11, s15.16, s12.3) #define HWAFFINETRANSFORM2TO(v, mat, vout) { \ vout.x = (ITEint32)(((ITEint64)v.x*mat.m[0][0] + (ITEint64)v.y*mat.m[0][1] + (ITEint64)(1<<POINTPREC)*mat.m[0][2] + (1<<((POINTPREC+16-3)-1)) )>>(POINTPREC+16-3)); \ vout.y = (ITEint32)(((ITEint64)v.x*mat.m[1][0] + (ITEint64)v.y*mat.m[1][1] + (ITEint64)(1<<POINTPREC)*mat.m[1][2] + (1<<((POINTPREC+16-3)-1)) )>>(POINTPREC+16-3)); } // (v, mat, vout) = (s12.11, s15.16, s12.3 = s12.19 / s12.16) #define HWPERSPECTIVETRANSFORM3TO(v, mat, vout) { \ vout.x = (ITEint32)( (((ITEint64)v.x*mat.m[0][0] + (ITEint64)v.y*mat.m[0][1] + (ITEint64)(1<<POINTPREC)*mat.m[0][2] + (1<<(POINTPREC+16-19-1)) )>>(POINTPREC+16-19)) / \ (((ITEint64)v.x*mat.m[2][0] + (ITEint64)v.y*mat.m[2][1] + (ITEint64)(1<<POINTPREC)*mat.m[2][2] + (1<<(POINTPREC+16-19-1)) )>>(POINTPREC+16-16)) ); \ vout.y = (ITEint32)( (((ITEint64)v.x*mat.m[1][0] + (ITEint64)v.y*mat.m[1][1] + (ITEint64)(1<<POINTPREC)*mat.m[1][2] + (1<<(POINTPREC+16-19-1)) )>>(POINTPREC+16-19)) / \ (((ITEint64)v.x*mat.m[2][0] + (ITEint64)v.y*mat.m[2][1] + (ITEint64)(1<<POINTPREC)*mat.m[2][2] + (1<<(POINTPREC+16-19-1)) )>>(POINTPREC+16-16)) ); } // (v, mat, vout) = (s15.16, s15.16, s12.3) #define HW1TRANSFORM2DIR(v, mat, vout) { \ vout.x = (ITEint16)(((ITEint64)v.x*mat.m[0][0] + (ITEint64)v.y*mat.m[0][1] + (1<<28) )>>29); \ vout.y = (ITEint16)(((ITEint64)v.x*mat.m[1][0] + (ITEint64)v.y*mat.m[1][1] + (1<<28) )>>29); } #define HW_MOD(a,b) ( a%(b)>=0 ? a%(b) : (a%(b))+(b) ) #define HW_FLOOR(x) ((x>>3)<<3) #define HW_CEIL(x) (((x+7)>>3)<<3) #define HW_SQRT(x) ( (ITEuint32)(sqrt((float)(x)/0x10000)*0x10000) ) #define TESSELLATION_CMD_LENGTH (65536) #define INVALID_OBJECT_ID 0xFFFFFFFF #define INVALID_FRAME_ID 0xFFFFFFFF typedef struct _ITEHardwareRegister { ITEuint32 REG_TCR_BASE; // 0x000 ITEuint32 REG_LWR_BASE; // 0x004 ITEuint32 REG_SRNR_BASE; // 0x008 ITEuint32 REG_FNR_BASE; // 0x00C ITEuint32 REG_PBR_BASE; // 0x010 ITEuint32 REG_PLR_BASE; // 0x014 ITEuint32 REG_TLR_BASE; // 0x018 ITEuint32 REG_TBR_BASE; // 0x01C ITEuint32 REG_UTR00_BASE; // 0x020 ITEuint32 REG_UTR01_BASE; // 0x024 ITEuint32 REG_UTR02_BASE; // 0x028 ITEuint32 REG_UTR10_BASE; // 0x02C ITEuint32 REG_UTR11_BASE; // 0x030 ITEuint32 REG_UTR12_BASE; // 0x034 ITEuint32 REG_UTR20_BASE; // 0x038 ITEuint32 REG_UTR21_BASE; // 0x03C ITEuint32 REG_UTR22_BASE; // 0x040 ITEuint32 REG_DPR00_BASE; // 0x044 ITEuint32 REG_DPR01_BASE; // 0x048 ITEuint32 REG_DPR02_BASE; // 0x04C ITEuint32 REG_DPR03_BASE; // 0x050 ITEuint32 REG_DPR04_BASE; // 0x054 ITEuint32 REG_DPR05_BASE; // 0x058 ITEuint32 REG_DPR06_BASE; // 0x05C ITEuint32 REG_DPR07_BASE; // 0x060 ITEuint32 REG_DPR08_BASE; // 0x064 ITEuint32 REG_DPR09_BASE; // 0x068 ITEuint32 REG_DPR10_BASE; // 0x06C ITEuint32 REG_DPR11_BASE; // 0x070 ITEuint32 REG_DPR12_BASE; // 0x074 ITEuint32 REG_DPR13_BASE; // 0x078 ITEuint32 REG_DPR14_BASE; // 0x07C ITEuint32 REG_DPR15_BASE; // 0x080 ITEuint32 REG_DPR16_BASE; // 0x084 ITEuint32 REG_88_BASE; // 0x088 ITEuint32 REG_8C_BASE; // 0x08C ITEuint32 REG_CCR_BASE; // 0x090 ITEuint32 REG_CPBR_BASE; // 0x094 ITEuint32 REG_CVPPR_BASE; // 0x098 ITEuint32 REG_VPBR_BASE; // 0x09C ITEuint32 REG_PXCR_BASE; // 0x0A0 ITEuint32 REG_PYCR_BASE; // 0x0A4 ITEuint32 REG_SFR_BASE; // 0x0A8 ITEuint32 REG_ACR_BASE; // 0x0AC ITEuint32 REG_RCR_BASE; // 0x0B0 ITEuint32 REG_RMR_BASE; // 0x0B4 ITEuint32 REG_RFR_BASE; // 0x0B8 ITEuint32 REG_RSR01_BASE; // 0x0BC ITEuint32 REG_RSR23_BASE; // 0x0C0 ITEuint32 REG_RSR45_BASE; // 0x0C4 ITEuint32 REG_RSR67_BASE; // 0x0C8 ITEuint32 REG_RCR00_BASE; // 0x0CC ITEuint32 REG_RCR01_BASE; // 0x0D0 ITEuint32 REG_RCR10_BASE; // 0x0D4 ITEuint32 REG_RCR11_BASE; // 0x0D8 ITEuint32 REG_RCR20_BASE; // 0x0DC ITEuint32 REG_RCR21_BASE; // 0x0E0 ITEuint32 REG_RCR30_BASE; // 0x0E4 ITEuint32 REG_RCR31_BASE; // 0x0E8 ITEuint32 REG_RCR40_BASE; // 0x0EC ITEuint32 REG_RCR41_BASE; // 0x0F0 ITEuint32 REG_RCR50_BASE; // 0x0F4 ITEuint32 REG_RCR51_BASE; // 0x0F8 ITEuint32 REG_RCR60_BASE; // 0x0FC ITEuint32 REG_RCR61_BASE; // 0x100 ITEuint32 REG_RCR70_BASE; // 0x104 ITEuint32 REG_RCR71_BASE; // 0x108 ITEuint32 REG_RDR01_BASE; // 0x10C ITEuint32 REG_RCR12_BASE; // 0x110 ITEuint32 REG_RDR23_BASE; // 0x114 ITEuint32 REG_RCR34_BASE; // 0x118 ITEuint32 REG_RDR45_BASE; // 0x11C ITEuint32 REG_RCR56_BASE; // 0x120 ITEuint32 REG_RDR67_BASE; // 0x124 ITEuint32 REG_GPRA_BASE; // 0x128 ITEuint32 REG_GPRB_BASE; // 0x12C ITEuint32 REG_GPRC_BASE; // 0x130 ITEuint32 REG_GPRD0_BASE; // 0x134 ITEuint32 REG_GPRD1_BASE; // 0x138 ITEuint32 REG_GPRE0_BASE; // 0x13C ITEuint32 REG_GPRE1_BASE; // 0x140 ITEuint32 REG_GPRF0_BASE; // 0x144 ITEuint32 REG_GPRF1_BASE; // 0x148 ITEuint32 REG_GPRG0_BASE; // 0x14C ITEuint32 REG_GPRG1_BASE; // 0x150 ITEuint32 REG_GPRH0_BASE; // 0x154 ITEuint32 REG_GPRH1_BASE; // 0x158 ITEuint32 REG_GPRI0_BASE; // 0x15C ITEuint32 REG_GPRI1_BASE; // 0x160 ITEuint32 REG_CTBR0_BASE; // 0x164 ITEuint32 REG_CTBR1_BASE; // 0x168 ITEuint32 REG_CTBR2_BASE; // 0x16C ITEuint32 REG_CTBR3_BASE; // 0x170 ITEuint32 REG_DCR_BASE; // 0x174 ITEuint32 REG_DHWR_BASE; // 0x178 ITEuint32 REG_DBR_BASE; // 0x17C ITEuint32 REG_SDPR_BASE; // 0x180 ITEuint32 REG_SCR_BASE; // 0x184 ITEuint32 REG_SHWR_BASE; // 0x188 ITEuint32 REG_SBR_BASE; // 0x18C ITEuint32 REG_SPR12_BASE; // 0x190 ITEuint32 REG_SBR1_BASE; // 0x194 ITEuint32 REG_SBR2_BASE; // 0x198 ITEuint32 REG_MBR_BASE; // 0x19C ITEuint32 REG_SMPR_BASE; // 0x1A0 ITEuint32 REG_SCBR_BASE; // 0x1A4 ITEuint32 REG_UITR00_BASE; // 0x1A8 ITEuint32 REG_UITR01_BASE; // 0x1AC ITEuint32 REG_UITR02_BASE; // 0x1B0 ITEuint32 REG_UITR10_BASE; // 0x1B4 ITEuint32 REG_UITR11_BASE; // 0x1B8 ITEuint32 REG_UITR12_BASE; // 0x1BC ITEuint32 REG_UITR20_BASE; // 0x1C0 ITEuint32 REG_UITR21_BASE; // 0x1C4 ITEuint32 REG_UITR22_BASE; // 0x1C8 ITEuint32 REG_PITR00_BASE; // 0x1CC ITEuint32 REG_PITR01_BASE; // 0x1D0 ITEuint32 REG_PITR02_BASE; // 0x1D4 ITEuint32 REG_PITR10_BASE; // 0x1D8 ITEuint32 REG_PITR11_BASE; // 0x1DC ITEuint32 REG_PITR12_BASE; // 0x1E0 ITEuint32 REG_CTSR0_BASE; // 0x1E4 ITEuint32 REG_CTSR1_BASE; // 0x1E8 ITEuint32 REG_TQSR_BASE; // 0x1EC ITEuint32 REG_CAR_BASE; // 0x1F0 ITEuint32 REG_DPCR0_BASE; // 0x1F4 ITEuint32 REG_DPCR1_BASE; // 0x1F8 ITEuint32 REG_PPCR0_BASE; // 0x1FC ITEuint32 REG_PPCR1_BASE; // 0x200 ITEuint32 REG_204_BASE; // 0x204 ITEuint32 REG_208_BASE; // 0x208 ITEuint32 REG_BISTR_BASE; // 0x20C ITEuint32 REG_CMDR_BASE; // 0x210 ITEuint32 REG_ESR1_BASE; // 0x214 ITEuint32 REG_ESR2_BASE; // 0x218 ITEuint32 REG_ESR3_BASE; // 0x21C ITEuint32 REG_ESR4_BASE; // 0x220 ITEuint32 REG_ICR_BASE; // 0x224 ITEuint32 REG_BID1_BASE; // 0x228 ITEuint32 REG_BID2_BASE; // 0x22C ITEuint32 REG_BID3_BASE; // 0x230 ITEuint32 REG_BID4_BASE; // 0x234 ITEuint32 REG_BID5_BASE; // 0x238 ITEuint32 REG_BID6_BASE; // 0x23C ITEuint32 REG_REV_BASE; // 0x240 //ITEuint32 tessellateCmd[TESSELLATION_CMD_LENGTH]; //ITEuint32 cmdLength; // Used command number }ITEHardwareRegister; typedef struct { ITEuint tessellateCmd[1<<14]; // tessellate Command buffer ITEuint cmdData[1<<16]; // command buffer /* Tessellation Engine */ HWPaintMode paintMode; ITEs15p16 lineWidth; HWVector2 min; HWVector2 max; HWMatrix3x3 pathTransform; //s15.16 HWCapStyle strokeCapStyle; HWJoinStyle strokeJoinStyle; ITEs12p3 strokeMiterLimit; HWboolean enDashLine; HWboolean dashPhaseReset; ITEint dashMaxCount; ITEs15p16 dashPattern[17]; // s12.11 ITEs15p16 dashRLength; ITEuint8 dashCount; /* Mode settings */ HWFillRule fillRule; HWImageQuality imageQuality; HWRenderingQuality renderingQuality; HWBlendMode blendMode; HWMaskMode maskMode; HWImageMode imageMode; /* enabling */ HWboolean enCoverage; // enable coverage HWboolean enScissor; HWboolean enMask; HWboolean enTexture; HWboolean enColorTransform; HWboolean enLookup; HWboolean enBlend; HWboolean enSrcMultiply; HWboolean enSrcUnMultiply; HWboolean enDstMultiply; HWboolean enPerspective; /* color */ ITEColor tileFillColor; //Edge fill color for vgConvolve and pattern paint ITEColor clearColor; // vgClear /* Matrices */ HWMatrix3x3 fillTransform; //s15.16 HWMatrix3x3 strokeTransform; //s15.16 HWMatrix3x3 imageTransform; //s15.16 /* Paint */ HWColorRampSpreadMode spreadMode; HWPaintType paintType; ITEColor paintColor; HWTilingMode tilingMode; ITEuint8 *gradientData; ITEuint8 gradientLen; ITEs15p16 linearGradientA; //s15.16 ITEs15p16 linearGradientB; //s15.16 ITEs15p16 linearGradientC; //s15.16 ITEs15p16 radialGradientA; //s15.16 ITEs15p16 radialGradientB; //s15.16 ITEs15p16 radialGradientC; //s15.16 ITEs15p16 radialGradientD; //s15.16 ITEs15p16 radialGradientE; //s15.16 ITEs15p16 radialGradientF; //s15.16 ITEs15p16 radialGradientG; //s15.16 ITEs15p16 radialGradientH; //s15.16 ITEs15p16 radialGradientI; //s15.16 /* Image */ ITEs12p3 coverageX; // S12.3 ITEs12p3 coverageY; // S12.3 ITEint16 coverageWidth; // 12 ITEint16 coverageHeight; // 12 ITEint16 *coverageData; // S10.5 ITEint16 coveragevalidpitch; // 6 byte aligment ITEuint8 *coverageValid; // 8 valid bits ITEuint8 *textureData; ITEuint16 texturePitch; // 14 ITEint16 textureWidth; ITEint16 textureHeight; ITEuint8 textureFormat; ITEuint8 *patternData; ITEuint16 patternPitch; ITEint16 patternWidth; ITEint16 patternHeight; ITEuint8 patternFormat; ITEuint8 *maskData; ITEs12p3 maskX; ITEs12p3 maskY; ITEuint16 maskPitch; ITEint16 maskWidth; ITEint16 maskHeight; ITEuint8 maskFormat; ITEuint8 *surfaceData; ITEuint16 surfacePitch; ITEint16 surfaceWidth; ITEint16 surfaceHeight; ITEuint8 surfaceFormat; ITEs12p3 dstX; ITEs12p3 dstY; ITEint16 dstWidth; ITEint16 dstHeight; /* four point of the stroke path to do cap and join */ // recm0 |-----------------------| recm1 // | | // |---------------------->| // | UnitV | // recm3 |-----------------------| recm2 ITEuint16 strokeRoundLines; HWTXVector2 strokeRoundC; // s12.11 ITEint8 LastisMove; HWTXVector2 strokestartrecm0; // s12.11 HWTXVector2 strokestartrecm3; // s12.11 HWTXVector2 strokestartUnitV0; // s1.22 HWTXVector2 strokestartVec0; // s12.11 HWboolean strokestartdash0; HWTXVector2 strokelastrecm1; // s12.11 HWTXVector2 strokelastrecm2; // s12.11 HWTXVector2 strokelastVec1; // s12.11 HWTXVector2 strokelastUnitV1; // s1.22 HWboolean strokelastdash1; HWTXVector2 strokerecm0; // s12.11 HWTXVector2 strokerecm1; // s12.11 HWTXVector2 strokerecm2; // s12.11 HWTXVector2 strokerecm3; // s12.11 HWTXVector2 strokeVec0; // s12.11 HWTXVector2 strokeVec1; // s12.11 HWTXVector2 strokeUnitV0; // s1.22 HWTXVector2 strokeUnitV1; // s1.22 HWboolean strokedash0; HWboolean strokedash1; /* color transform */ ITEs7p8 colorTransform[4][4]; // s7.8 ITEint16 colorBias[4]; // s8 /* Look up table */ ITEuint8 lookupTable[4][256]; // use SRAM } ITEHardware; typedef struct { HWboolean valid[CACHESET]; ITEuint32 tag[CACHESET]; ITEint16 word[CACHESET]; ITEint8 replaceMark; } ITECache16; typedef struct { HWboolean valid[CACHESET]; ITEuint32 tag[CACHESET]; ITEint8 word[CACHESET]; ITEint8 replaceMark; } ITECache8; void ITEHardware_dtor(ITEHardwareRegister* hw); void ITEHardware_ctor(ITEHardwareRegister* hw); //void iteHardwareRender(); void iteHardwareFire(ITEHardwareRegister* hwReg); void iteHardwareNullFire(ITEuint32 frameID); //ITEHardware* iteCreateHardware(); void iteCreateHardware(ITEHardwareRegister* hwReg); void iteDestroyHardware(); void iteStoreColor(ITEColor *c, ITEHColor *hc, void *data, VGImageFormat vg, ITEuint8 bit); void iteLoadColor(ITEColor *c, ITEHColor *hc, const void *data, VGImageFormat vg, ITEuint8 bit); void iteTessllationEngine(); void iteCoverageEngine(); void iteRenderEngine(); ITEuint32 iteHardwareGenFrameID(); ITEuint32 iteHardwareGenObjectID(); ITEuint32 iteHardwareGetCurrentFrameID(); ITEuint32 iteHardwareGetCurrentObjectID(); ITEuint32 iteHardwareGetNextFrameID(); ITEuint32 iteHardwareGetNextObjectID(); void iteHardwareWaitObjID(ITEuint32 objID); void iteHardwareWaitFrameID(ITEuint32 frameID); #endif /* __ITEHARDWARE_H */
30.651349
168
0.540627
9dbf3158796313c801058fe68f2ab643bf1d4801
906
lua
Lua
tkx_test/tkx_cluster2.lua
tangkx/skynet
56405030e788a949cbfbd46d8a18573cc582ee51
[ "MIT" ]
null
null
null
tkx_test/tkx_cluster2.lua
tangkx/skynet
56405030e788a949cbfbd46d8a18573cc582ee51
[ "MIT" ]
null
null
null
tkx_test/tkx_cluster2.lua
tangkx/skynet
56405030e788a949cbfbd46d8a18573cc582ee51
[ "MIT" ]
null
null
null
local skynet = require "skynet" local cluster = require "cluster" skynet.start(function () -- body --cluster.open "db1" local sdb = cluster.query("db","sdb") local mysqldb = cluster.query("db1","mysqldb") print("......sdb= ",sdb) print("......mysqldb",mysqldb) local proxy = cluster.proxy("db",sdb) local mysqlproxy = cluster.proxy("db", mysqldb) --local res = skynet.call(mysqlproxy, "lua", "query") local res = cluster.call("db",mysqlproxy,"query") for k,v in pairs(res) do for i,j in pairs(v) do print(i,j) end end print(skynet.call(proxy,"lua","GET","a")) print(skynet.call(proxy,"lua","GET","b")) print('proxy...cluster...'..cluster.call("db",proxy,"GET","a")) print('proxy...cluster...'..cluster.call("db",proxy,"GET","b")) --print(cluster.call("db",sdb,"GET","a")) --local tkx = cluster.snax("db","tkxserver") --print('.....'..tkx.req.hello "hello cluster") end)
25.166667
64
0.633554
f4bb6e86a63fa8821fcc3acfdbc573b81bc77fd5
2,016
go
Go
repository/postgres/auth_token.go
partyzanex/go-admin-lte
811e56a792fc40d712d382dc1a1356c01211b85d
[ "MIT" ]
3
2020-06-30T08:34:48.000Z
2021-02-16T07:38:08.000Z
repository/postgres/auth_token.go
partyzanex/go-admin-bootstrap
811e56a792fc40d712d382dc1a1356c01211b85d
[ "MIT" ]
null
null
null
repository/postgres/auth_token.go
partyzanex/go-admin-bootstrap
811e56a792fc40d712d382dc1a1356c01211b85d
[ "MIT" ]
null
null
null
package postgres import ( "context" "database/sql" "github.com/partyzanex/go-admin-bootstrap/db/models/postgres" "github.com/partyzanex/layer" "github.com/pkg/errors" "github.com/volatiletech/sqlboiler/v4/boil" "github.com/volatiletech/sqlboiler/v4/queries/qm" goadmin "github.com/partyzanex/go-admin-bootstrap" ) type authTokenRepository struct { ex layer.BoilExecutor } func (repo *authTokenRepository) Search(ctx context.Context, token string) (*goadmin.Token, error) { c, ex := layer.GetExecutor(ctx, repo.ex) model, err := postgres.AuthTokens(qm.Where("token = ?", token)).One(c, ex) if errors.Is(err, sql.ErrNoRows) { return nil, goadmin.ErrTokenNotFound } if err != nil { return nil, errors.Wrap(err, "search token failed") } return modelToToken(model), nil } func (repo *authTokenRepository) Create(ctx context.Context, token *goadmin.Token) (result *goadmin.Token, err error) { c, tr := layer.GetTransactor(ctx) if tr == nil { tr, err = repo.ex.BeginTx(ctx, nil) if err != nil { return nil, errors.Wrap(err, layer.ErrCreateTransaction.Error()) } defer layer.ExecuteTransaction(tr, &err) } model := tokenToModel(token) err = model.Insert(c, tr, boil.Infer()) if err != nil { return nil, errors.Wrap(err, "inserting token failed") } return modelToToken(model), nil } func tokenToModel(token *goadmin.Token) *postgres.AuthToken { model := &postgres.AuthToken{ UserID: token.UserID, Token: token.Token, Type: string(token.Type), DTExpired: token.DTExpired, DTCreated: token.DTCreated, } return model } func modelToToken(model *postgres.AuthToken) *goadmin.Token { token := &goadmin.Token{ UserID: model.UserID, Token: model.Token, Type: goadmin.TokenType(model.Type), DTExpired: model.DTExpired, DTCreated: model.DTCreated, User: &goadmin.User{ ID: model.UserID, }, } return token } func NewTokenRepository(ex layer.BoilExecutor) goadmin.TokenRepository { return &authTokenRepository{ex: ex} }
23.44186
119
0.71131
2a86a98adc20b37cf7d7e898a5e307a433b7ec3a
5,068
java
Java
source-kafka/src/main/java/org/apache/kylin/source/kafka/util/KafkaSampleProducer.java
aixuebo/lin1.5.4
33341bb2c23a5c860891650b0470e8dc47a316de
[ "Apache-2.0" ]
null
null
null
source-kafka/src/main/java/org/apache/kylin/source/kafka/util/KafkaSampleProducer.java
aixuebo/lin1.5.4
33341bb2c23a5c860891650b0470e8dc47a316de
[ "Apache-2.0" ]
10
2019-12-26T18:23:30.000Z
2022-01-21T23:12:07.000Z
source-kafka/src/main/java/org/apache/kylin/source/kafka/util/KafkaSampleProducer.java
Qstar/kylin
b02363adf6f5c1c85e2b24474de9f1b14996bf25
[ "Apache-2.0" ]
null
null
null
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.kylin.source.kafka.util; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Random; import org.apache.commons.cli.Option; import org.apache.commons.cli.OptionBuilder; import org.apache.commons.cli.Options; import org.apache.kylin.common.util.OptionsHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.fasterxml.jackson.databind.ObjectMapper; import kafka.javaapi.producer.Producer; import kafka.producer.KeyedMessage; import kafka.producer.ProducerConfig; /** * A sample producer which will create sample data to kafka topic */ public class KafkaSampleProducer { private static final Logger logger = LoggerFactory.getLogger(KafkaSampleProducer.class); @SuppressWarnings("static-access") private static final Option OPTION_TOPIC = OptionBuilder.withArgName("topic").hasArg().isRequired(true).withDescription("Kafka topic").create("topic"); private static final Option OPTION_BROKER = OptionBuilder.withArgName("broker").hasArg().isRequired(true).withDescription("Kafka broker").create("broker"); private static final Option OPTION_DELAY = OptionBuilder.withArgName("delay").hasArg().isRequired(false).withDescription("Simulated message delay").create("delay"); private static final ObjectMapper mapper = new ObjectMapper(); public static void main(String[] args) throws Exception { logger.info("args: " + Arrays.toString(args)); OptionsHelper optionsHelper = new OptionsHelper(); Options options = new Options(); String topic, broker; options.addOption(OPTION_TOPIC); options.addOption(OPTION_BROKER); options.addOption(OPTION_DELAY); optionsHelper.parseOptions(options, args); logger.info("options: '" + optionsHelper.getOptionsAsString() + "'"); topic = optionsHelper.getOptionValue(OPTION_TOPIC); broker = optionsHelper.getOptionValue(OPTION_BROKER); long delay = 0; String delayString = optionsHelper.getOptionValue(OPTION_DELAY); if (delayString != null) { delay = Long.parseLong(optionsHelper.getOptionValue(OPTION_DELAY)); } List<String> countries = new ArrayList(); countries.add("AUSTRALIA"); countries.add("CANADA"); countries.add("CHINA"); countries.add("INDIA"); countries.add("JAPAN"); countries.add("KOREA"); countries.add("US"); countries.add("Other"); List<String> category = new ArrayList(); category.add("BOOK"); category.add("TOY"); category.add("CLOTH"); category.add("ELECTRONIC"); category.add("Other"); List<String> devices = new ArrayList(); devices.add("iOS"); devices.add("Windows"); devices.add("Andriod"); devices.add("Other"); Properties props = new Properties(); props.put("metadata.broker.list", broker); props.put("serializer.class", "kafka.serializer.StringEncoder"); props.put("request.required.acks", "1"); ProducerConfig config = new ProducerConfig(props); Producer<String, String> producer = new Producer<String, String>(config); boolean alive = true; Random rnd = new Random(); Map<String, Object> record = new HashMap(); while (alive == true) { record.put("order_time", (new Date().getTime() - delay)); record.put("country", countries.get(rnd.nextInt(countries.size()))); record.put("category", category.get(rnd.nextInt(category.size()))); record.put("device", devices.get(rnd.nextInt(devices.size()))); record.put("qty", rnd.nextInt(10)); record.put("currency", "USD"); record.put("amount", rnd.nextDouble() * 100); KeyedMessage<String, String> data = new KeyedMessage<String, String>(topic, System.currentTimeMillis() + "", mapper.writeValueAsString(record)); System.out.println("Sending 1 message"); producer.send(data); Thread.sleep(2000); } producer.close(); } }
40.222222
168
0.680742
91562b834aa4f3356749e38496dcad31fb2b4d48
1,907
html
HTML
public/index.html
stories2/KangnamShuttle
c0b5bd98ba640638e8a6039464ebb53921f16343
[ "MIT" ]
null
null
null
public/index.html
stories2/KangnamShuttle
c0b5bd98ba640638e8a6039464ebb53921f16343
[ "MIT" ]
6
2018-04-25T00:38:49.000Z
2018-12-13T04:53:18.000Z
public/index.html
stories2/KangnamShuttle
c0b5bd98ba640638e8a6039464ebb53921f16343
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>강남대학교 달구지봇 구버전</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> .container { text-align: center; display: table-cell; vertical-align: middle; } .circle { margin-left: auto; margin-right: auto; position: relative; height: 350px; width: 350px; border-radius: 50%; display: inline-flex; vertical-align: top; justify-content: center; align-items: center; overflow: hidden; text-decoration: none; border: 0; margin: 10px; } .circle .image { position: absolute; z-index: -1; top: 0; left: 0; height: 100%; width: 100%; background-position:center; background-size:cover; background-repeat:no-repeat; opacity: .25; transition: .25s; } .circle:hover .image { opacity: 0.8; color: transparent; } body { display: table; position: absolute; top: 0; left: 0; height: 100%; width: 100%; margin: 0px; padding: 0px; } </style> </head> <body> <div class="container"> <a class="circle" href="https://kangnamshuttle3.firebaseapp.com"> <span class="image" style="background-image: url(./images/profile-alexstrasza.png)"></span> <div class="ccont" style="font-weight: bold; text-decoration:none !important;">본 페이지는 새로운 달구지봇이 개발되었기 때문에 폐쇄되었습니다.<br>새로운 달구지봇 홈페이지로 접속하려면 여기를 클릭하세요.</div> </a> </div> </body> </html>
27.242857
167
0.486104
d5ca1447cf19d30854a04d783921c3f3bcc5846c
522
sql
SQL
1000genomes/sql/reproducing-vcfstats/sample-indel-counts-brca1.sql
googlegenomics/bigquery-examples
df7429b718cd3c2cbc305daa70a1e49166028179
[ "Apache-2.0" ]
72
2015-01-27T07:36:46.000Z
2022-01-15T20:03:51.000Z
1000genomes/sql/reproducing-vcfstats/sample-indel-counts-brca1.sql
deflaux/bigquery-examples
1780090e0dc0ae1fbb6c9e231569d2887d956468
[ "Apache-2.0" ]
17
2015-01-10T01:39:10.000Z
2017-03-02T18:19:23.000Z
1000genomes/sql/reproducing-vcfstats/sample-indel-counts-brca1.sql
deflaux/bigquery-examples
1780090e0dc0ae1fbb6c9e231569d2887d956468
[ "Apache-2.0" ]
23
2015-02-14T00:24:27.000Z
2020-12-11T12:15:22.000Z
# Sample INDEL counts for BRCA1. SELECT COUNT(sample_id) AS variant_count, sample_id, FROM ( SELECT call.call_set_name AS sample_id, NTH(1, call.genotype) WITHIN call AS first_allele, NTH(2, call.genotype) WITHIN call AS second_allele, FROM [genomics-public-data:1000_genomes.variants] WHERE reference_name = '17' AND start BETWEEN 41196311 AND 41277499 AND vt ='INDEL' HAVING 0 < first_allele OR 0 < second_allele) GROUP BY sample_id ORDER BY sample_id
20.076923
50
0.693487
e9c9a68c9024fad2c2ea14e6225c5f05b41a0a73
767
go
Go
interfacegroup/InterfaceGroup.go
Aman2708/management-sdk-go
b22604114000c789c050ecd5ac4ecc001746803c
[ "Apache-2.0" ]
1
2020-10-14T13:32:56.000Z
2020-10-14T13:32:56.000Z
interfacegroup/InterfaceGroup.go
Aman2708/management-sdk-go
b22604114000c789c050ecd5ac4ecc001746803c
[ "Apache-2.0" ]
null
null
null
interfacegroup/InterfaceGroup.go
Aman2708/management-sdk-go
b22604114000c789c050ecd5ac4ecc001746803c
[ "Apache-2.0" ]
4
2019-04-11T21:52:59.000Z
2021-10-01T06:43:05.000Z
package interfacegroup import "github.com/cohesity/management-sdk-go/models" import "github.com/cohesity/management-sdk-go/configuration" /* * Interface for the INTERFACEGROUP_IMPL */ type INTERFACEGROUP interface { GetInterfaceGroups () ([]*models.InterfaceGroup, error) DeleteInterfaceGroup (string) (error) CreateInterfaceGroup (*models.InterfaceGroup) (*models.InterfaceGroup, error) UpdateInterfaceGroup (*models.InterfaceGroup) (*models.InterfaceGroup, error) } /* * Factory for the INTERFACEGROUP interaface returning INTERFACEGROUP_IMPL */ func NewINTERFACEGROUP(config configuration.CONFIGURATION) *INTERFACEGROUP_IMPL { client := new(INTERFACEGROUP_IMPL) client.config = config return client }
28.407407
82
0.750978
a6cac03b5d503ca491afbee4d97bba32adb018f4
1,675
dart
Dart
lib/src/pages/book-store/detail-book/widgets/information.dart
Goner01/flutter-samples
fb0544ae7867e2a4269a05492aaca2719333c004
[ "MIT" ]
null
null
null
lib/src/pages/book-store/detail-book/widgets/information.dart
Goner01/flutter-samples
fb0544ae7867e2a4269a05492aaca2719333c004
[ "MIT" ]
null
null
null
lib/src/pages/book-store/detail-book/widgets/information.dart
Goner01/flutter-samples
fb0544ae7867e2a4269a05492aaca2719333c004
[ "MIT" ]
null
null
null
part of 'widgets.dart'; class Information extends StatelessWidget { const Information({ required this.size, required this.price, required this.autor, required this.title, }); final Size size; final String price; final String autor; final String title; @override Widget build(BuildContext context) { final List<Widget> stars = List.generate( 6, (i) => (i != 5) ? Icon( Icons.star, color: Colors.orange, ) : Padding( padding: const EdgeInsets.only(left: 6), child: Text('5.0', style: TextStyle(color: kColor, fontSize: 18)), )); return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ SizedBox( width: size.width * 0.7, child: Text(title, overflow: TextOverflow.ellipsis, style: TextStyle( color: kColor, fontSize: 26, fontWeight: FontWeight.bold, ))), Spacer(), Text( '\$$price', style: TextStyle( color: kColor, fontSize: 24, fontWeight: FontWeight.bold), ) ], ), const SizedBox( height: 6, ), Text( autor, style: TextStyle(color: Colors.grey, fontWeight: FontWeight.w600), ), const SizedBox( height: 8, ), Row(children: stars) ], ); } }
25
79
0.463284
1049c85c3f563ed9dfb7ffbbf7930bfb5f5a1085
279
dart
Dart
lib/utils/radii.dart
thindek/thindek_ui
70b7f9703ed58ae4830786ebf285beffa69b5c07
[ "BSD-3-Clause" ]
1
2021-03-28T15:49:01.000Z
2021-03-28T15:49:01.000Z
lib/utils/radii.dart
thindek/thindek_ui
70b7f9703ed58ae4830786ebf285beffa69b5c07
[ "BSD-3-Clause" ]
null
null
null
lib/utils/radii.dart
thindek/thindek_ui
70b7f9703ed58ae4830786ebf285beffa69b5c07
[ "BSD-3-Clause" ]
null
null
null
part of thindek_ui; class TDKRadii { static const BorderRadiusGeometry r6 = BorderRadius.all(Radius.circular(6)); static const BorderRadiusGeometry r10 = BorderRadius.all(Radius.circular(10)); static const BorderRadiusGeometry r0 = BorderRadius.all(Radius.circular(0)); }
34.875
80
0.78853
fb97ac3a209768b3b5b8307a36c9c72e53ecb127
9,009
java
Java
cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ProxyReceivingTicketValidationFilter.java
serac/java-cas-client
7345e03a6f4b430bd9bbc83603b2ab0fd43aec05
[ "Apache-2.0" ]
null
null
null
cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ProxyReceivingTicketValidationFilter.java
serac/java-cas-client
7345e03a6f4b430bd9bbc83603b2ab0fd43aec05
[ "Apache-2.0" ]
null
null
null
cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ProxyReceivingTicketValidationFilter.java
serac/java-cas-client
7345e03a6f4b430bd9bbc83603b2ab0fd43aec05
[ "Apache-2.0" ]
null
null
null
/** * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a * copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.jasig.cas.client.validation; import java.io.IOException; import java.util.*; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.jasig.cas.client.proxy.*; import org.jasig.cas.client.util.CommonUtils; import org.jasig.cas.client.util.ReflectUtils; /** * Creates either a CAS20ProxyTicketValidator or a CAS20ServiceTicketValidator depending on whether any of the * proxy parameters are set. * <p> * This filter can also pass additional parameters to the ticket validator. Any init parameter not included in the * reserved list {@link org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter#RESERVED_INIT_PARAMS}. * * @author Scott Battaglia * @author Brad Cupit (brad [at] lsu {dot} edu) * @version $Revision$ $Date$ * @since 3.1 * */ public class Cas20ProxyReceivingTicketValidationFilter extends AbstractTicketValidationFilter { private static final String[] RESERVED_INIT_PARAMS = new String[] {"proxyGrantingTicketStorageClass", "proxyReceptorUrl", "acceptAnyProxy", "allowedProxyChains", "casServerUrlPrefix", "proxyCallbackUrl", "renew", "exceptionOnValidationFailure", "redirectAfterValidation", "useSession", "serverName", "service", "artifactParameterName", "serviceParameterName", "encodeServiceUrl", "millisBetweenCleanUps", "hostnameVerifier", "encoding", "config"}; private static final int DEFAULT_MILLIS_BETWEEN_CLEANUPS = 60 * 1000; /** * The URL to send to the CAS server as the URL that will process proxying requests on the CAS client. */ private String proxyReceptorUrl; private Timer timer; private TimerTask timerTask; private int millisBetweenCleanUps; /** * Storage location of ProxyGrantingTickets and Proxy Ticket IOUs. */ private ProxyGrantingTicketStorage proxyGrantingTicketStorage = new ProxyGrantingTicketStorageImpl(); protected void initInternal(final FilterConfig filterConfig) throws ServletException { setProxyReceptorUrl(getPropertyFromInitParams(filterConfig, "proxyReceptorUrl", null)); final String proxyGrantingTicketStorageClass = getPropertyFromInitParams(filterConfig, "proxyGrantingTicketStorageClass", null); if (proxyGrantingTicketStorageClass != null) { this.proxyGrantingTicketStorage = ReflectUtils.newInstance(proxyGrantingTicketStorageClass); if (this.proxyGrantingTicketStorage instanceof AbstractEncryptedProxyGrantingTicketStorageImpl) { final AbstractEncryptedProxyGrantingTicketStorageImpl p = (AbstractEncryptedProxyGrantingTicketStorageImpl) this.proxyGrantingTicketStorage; final String cipherAlgorithm = getPropertyFromInitParams(filterConfig, "cipherAlgorithm", AbstractEncryptedProxyGrantingTicketStorageImpl.DEFAULT_ENCRYPTION_ALGORITHM); final String secretKey = getPropertyFromInitParams(filterConfig, "secretKey", null); p.setCipherAlgorithm(cipherAlgorithm); try { if (secretKey != null) { p.setSecretKey(secretKey); } } catch (final Exception e) { throw new RuntimeException(e); } } } log.trace("Setting proxyReceptorUrl parameter: " + this.proxyReceptorUrl); this.millisBetweenCleanUps = Integer.parseInt(getPropertyFromInitParams(filterConfig, "millisBetweenCleanUps", Integer.toString(DEFAULT_MILLIS_BETWEEN_CLEANUPS))); super.initInternal(filterConfig); } public void init() { super.init(); CommonUtils.assertNotNull(this.proxyGrantingTicketStorage, "proxyGrantingTicketStorage cannot be null."); if (this.timer == null) { this.timer = new Timer(true); } if (this.timerTask == null) { this.timerTask = new CleanUpTimerTask(this.proxyGrantingTicketStorage); } this.timer.schedule(this.timerTask, this.millisBetweenCleanUps, this.millisBetweenCleanUps); } /** * Constructs a Cas20ServiceTicketValidator or a Cas20ProxyTicketValidator based on supplied parameters. * * @param filterConfig the Filter Configuration object. * @return a fully constructed TicketValidator. */ protected final TicketValidator getTicketValidator(final FilterConfig filterConfig) { final String allowAnyProxy = getPropertyFromInitParams(filterConfig, "acceptAnyProxy", null); final String allowedProxyChains = getPropertyFromInitParams(filterConfig, "allowedProxyChains", null); final String casServerUrlPrefix = getPropertyFromInitParams(filterConfig, "casServerUrlPrefix", null); final Cas20ServiceTicketValidator validator; if (CommonUtils.isNotBlank(allowAnyProxy) || CommonUtils.isNotBlank(allowedProxyChains)) { final Cas20ProxyTicketValidator v = new Cas20ProxyTicketValidator(casServerUrlPrefix); v.setAcceptAnyProxy(parseBoolean(allowAnyProxy)); v.setAllowedProxyChains(CommonUtils.createProxyList(allowedProxyChains)); validator = v; } else { validator = new Cas20ServiceTicketValidator(casServerUrlPrefix); } validator.setProxyCallbackUrl(getPropertyFromInitParams(filterConfig, "proxyCallbackUrl", null)); validator.setProxyGrantingTicketStorage(this.proxyGrantingTicketStorage); validator.setProxyRetriever(new Cas20ProxyRetriever(casServerUrlPrefix, getPropertyFromInitParams(filterConfig, "encoding", null))); validator.setRenew(parseBoolean(getPropertyFromInitParams(filterConfig, "renew", "false"))); validator.setEncoding(getPropertyFromInitParams(filterConfig, "encoding", null)); final Map<String,String> additionalParameters = new HashMap<String,String>(); final List<String> params = Arrays.asList(RESERVED_INIT_PARAMS); for (final Enumeration<?> e = filterConfig.getInitParameterNames(); e.hasMoreElements();) { final String s = (String) e.nextElement(); if (!params.contains(s)) { additionalParameters.put(s, filterConfig.getInitParameter(s)); } } validator.setCustomParameters(additionalParameters); validator.setHostnameVerifier(getHostnameVerifier(filterConfig)); return validator; } public void destroy() { super.destroy(); this.timer.cancel(); } /** * This processes the ProxyReceptor request before the ticket validation code executes. */ protected final boolean preFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException { final HttpServletRequest request = (HttpServletRequest) servletRequest; final HttpServletResponse response = (HttpServletResponse) servletResponse; final String requestUri = request.getRequestURI(); if (CommonUtils.isEmpty(this.proxyReceptorUrl) || !requestUri.endsWith(this.proxyReceptorUrl)) { return true; } try { CommonUtils.readAndRespondToProxyReceptorRequest(request, response, this.proxyGrantingTicketStorage); } catch (final RuntimeException e) { log.error(e.getMessage(), e); throw e; } return false; } public final void setProxyReceptorUrl(final String proxyReceptorUrl) { this.proxyReceptorUrl = proxyReceptorUrl; } public void setProxyGrantingTicketStorage(final ProxyGrantingTicketStorage storage) { this.proxyGrantingTicketStorage = storage; } public void setTimer(final Timer timer) { this.timer = timer; } public void setTimerTask(final TimerTask timerTask) { this.timerTask = timerTask; } public void setMillisBetweenCleanUps(final int millisBetweenCleanUps) { this.millisBetweenCleanUps = millisBetweenCleanUps; } }
43.73301
451
0.725164
682e6803945eebfa9ae46f2b5bc8a14eeee9ee5a
8,303
dart
Dart
packages/aws_signature_v4/test/s3/testdata/single_chunk_testdata.dart
Bitacora-io/amplify-flutter
8c5b9a051b1552617afdf943a27054c5144bb44c
[ "Apache-2.0" ]
null
null
null
packages/aws_signature_v4/test/s3/testdata/single_chunk_testdata.dart
Bitacora-io/amplify-flutter
8c5b9a051b1552617afdf943a27054c5144bb44c
[ "Apache-2.0" ]
null
null
null
packages/aws_signature_v4/test/s3/testdata/single_chunk_testdata.dart
Bitacora-io/amplify-flutter
8c5b9a051b1552617afdf943a27054c5144bb44c
[ "Apache-2.0" ]
null
null
null
// Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. import 'package:aws_common/aws_common.dart'; import 'package:aws_signature_v4/aws_signature_v4.dart'; import 'package:aws_signature_v4/src/configuration/services/s3.dart'; import '../../c_test_suite/test_data.dart'; import 'util.dart'; final serviceConfiguration = S3ServiceConfiguration( signPayload: true, chunked: false, ); final testCases = <SignerTest>[ getObjectTest, putObjectTest, getBucketLifecycleTest, getBucketListObjectsTest, ]; final getObjectTestData = SignerTestMethodData( method: SignerTestMethod.header, canonicalRequest: ''' GET /test.txt host:examplebucket.s3.amazonaws.com range:bytes=0-9 x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 x-amz-date:20130524T000000Z host;range;x-amz-content-sha256;x-amz-date e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855''', stringToSign: ''' AWS4-HMAC-SHA256 20130524T000000Z 20130524/us-east-1/s3/aws4_request 7344ae5b7ee6c3e7e6b0fe0640412a37625d1fbfff95c48bbb2dc43964946972''', signature: 'f0e8bdb87c964420e857bd35b5d6ed310bd44f0170aba48dd91039c6036bdb41', signedRequest: AWSHttpRequest( method: AWSHttpMethod.get, uri: Uri.https( 'examplebucket.s3.amazonaws.com', '/test.txt', ), headers: const { 'Host': 'examplebucket.s3.amazonaws.com', 'x-amz-date': '20130524T000000Z', 'Range': 'bytes=0-9', 'x-amz-content-sha256': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'Authorization': 'AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20130524/us-east-1/s3/aws4_request, SignedHeaders=host;range;x-amz-content-sha256;x-amz-date, Signature=f0e8bdb87c964420e857bd35b5d6ed310bd44f0170aba48dd91039c6036bdb41', }, ), ); final getObjectTest = SignerTest( name: 'GET Object', context: buildContext(), request: AWSHttpRequest( method: AWSHttpMethod.get, uri: Uri.https( 'examplebucket.s3.amazonaws.com', '/test.txt', ), headers: const { 'Range': 'bytes=0-9', }, ), headerTestData: getObjectTestData, serviceConfiguration: serviceConfiguration, ); final putObjectTestData = SignerTestMethodData( method: SignerTestMethod.header, canonicalRequest: ''' PUT /test%24file.text date:Fri, 24 May 2013 00:00:00 GMT host:examplebucket.s3.amazonaws.com x-amz-content-sha256:44ce7dd67c959e0d3524ffac1771dfbba87d2b6b4b4e99e42034a8b803f8b072 x-amz-date:20130524T000000Z x-amz-storage-class:REDUCED_REDUNDANCY date;host;x-amz-content-sha256;x-amz-date;x-amz-storage-class 44ce7dd67c959e0d3524ffac1771dfbba87d2b6b4b4e99e42034a8b803f8b072''', stringToSign: ''' AWS4-HMAC-SHA256 20130524T000000Z 20130524/us-east-1/s3/aws4_request 9e0e90d9c76de8fa5b200d8c849cd5b8dc7a3be3951ddb7f6a76b4158342019d''', signature: '98ad721746da40c64f1a55b78f14c238d841ea1380cd77a1b5971af0ece108bd', signedRequest: AWSHttpRequest( method: AWSHttpMethod.put, uri: Uri.https( 'examplebucket.s3.amazonaws.com', r'test$file.text', ), headers: const { 'x-amz-storage-class': 'REDUCED_REDUNDANCY', 'Host': 'examplebucket.s3.amazonaws.com', 'x-amz-date': '20130524T000000Z', 'Authorization': 'AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20130524/us-east-1/s3/aws4_request, SignedHeaders=date;host;x-amz-content-sha256;x-amz-date;x-amz-storage-class, Signature=98ad721746da40c64f1a55b78f14c238d841ea1380cd77a1b5971af0ece108bd', 'Date': 'Fri, 24 May 2013 00:00:00 GMT', 'x-amz-content-sha256': '44ce7dd67c959e0d3524ffac1771dfbba87d2b6b4b4e99e42034a8b803f8b072', }, body: 'Welcome to Amazon S3.'.codeUnits, ), ); final putObjectTest = SignerTest( name: 'PUT Object', context: buildContext(), request: AWSHttpRequest( method: AWSHttpMethod.put, uri: Uri.https( 'examplebucket.s3.amazonaws.com', r'test$file.text', ), headers: const { 'Date': 'Fri, 24 May 2013 00:00:00 GMT', 'x-amz-storage-class': 'REDUCED_REDUNDANCY', }, body: 'Welcome to Amazon S3.'.codeUnits, ), headerTestData: putObjectTestData, serviceConfiguration: serviceConfiguration, ); final getBucketLifecycleTestData = SignerTestMethodData( method: SignerTestMethod.header, canonicalRequest: ''' GET / lifecycle= host:examplebucket.s3.amazonaws.com x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 x-amz-date:20130524T000000Z host;x-amz-content-sha256;x-amz-date e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855''', stringToSign: ''' AWS4-HMAC-SHA256 20130524T000000Z 20130524/us-east-1/s3/aws4_request 9766c798316ff2757b517bc739a67f6213b4ab36dd5da2f94eaebf79c77395ca''', signature: 'fea454ca298b7da1c68078a5d1bdbfbbe0d65c699e0f91ac7a200a0136783543', signedRequest: AWSHttpRequest( method: AWSHttpMethod.get, uri: Uri.https( 'examplebucket.s3.amazonaws.com', '/', const <String, String>{ 'lifecycle': '', }, ), headers: const { 'Host': 'examplebucket.s3.amazonaws.com', 'Authorization': 'AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20130524/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=fea454ca298b7da1c68078a5d1bdbfbbe0d65c699e0f91ac7a200a0136783543', 'x-amz-date': '20130524T000000Z', 'x-amz-content-sha256': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', }, ), ); final getBucketLifecycleTest = SignerTest( name: 'GET Bucket Lifecycle', context: buildContext(), request: AWSHttpRequest( method: AWSHttpMethod.get, uri: Uri.https( 'examplebucket.s3.amazonaws.com', '/', const <String, String>{ 'lifecycle': '', }, ), ), headerTestData: getBucketLifecycleTestData, serviceConfiguration: serviceConfiguration, ); final getBucketListObjectsTestData = SignerTestMethodData( method: SignerTestMethod.header, canonicalRequest: ''' GET / max-keys=2&prefix=J host:examplebucket.s3.amazonaws.com x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 x-amz-date:20130524T000000Z host;x-amz-content-sha256;x-amz-date e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855''', stringToSign: ''' AWS4-HMAC-SHA256 20130524T000000Z 20130524/us-east-1/s3/aws4_request df57d21db20da04d7fa30298dd4488ba3a2b47ca3a489c74750e0f1e7df1b9b7''', signature: '34b48302e7b5fa45bde8084f4b7868a86f0a534bc59db6670ed5711ef69dc6f7', signedRequest: AWSHttpRequest( method: AWSHttpMethod.get, uri: Uri.https( 'examplebucket.s3.amazonaws.com', '/', const <String, String>{ 'max-keys': '2', 'prefix': 'J', }, ), headers: const { 'Host': 'examplebucket.s3.amazonaws.com', 'Authorization': 'AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20130524/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=34b48302e7b5fa45bde8084f4b7868a86f0a534bc59db6670ed5711ef69dc6f7', 'x-amz-date': '20130524T000000Z', 'x-amz-content-sha256': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', }, ), ); final getBucketListObjectsTest = SignerTest( name: 'GET Bucket (List Objects)', context: buildContext(), request: AWSHttpRequest( method: AWSHttpMethod.get, uri: Uri.https( 'examplebucket.s3.amazonaws.com', '/', const <String, String>{ 'max-keys': '2', 'prefix': 'J', }, ), ), headerTestData: getBucketListObjectsTestData, serviceConfiguration: serviceConfiguration, );
32.057915
249
0.741539
67489442c9b81915cb229031fdfae014b7266816
1,635
sql
SQL
db_siswa.sql
1005200/report-file-excel
ddc920ce1b96109aedd6e1328fa2073bf7dcd0ae
[ "MIT" ]
null
null
null
db_siswa.sql
1005200/report-file-excel
ddc920ce1b96109aedd6e1328fa2073bf7dcd0ae
[ "MIT" ]
null
null
null
db_siswa.sql
1005200/report-file-excel
ddc920ce1b96109aedd6e1328fa2073bf7dcd0ae
[ "MIT" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Mar 29, 2021 at 09:59 AM -- Server version: 10.4.18-MariaDB -- PHP Version: 8.0.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!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 utf8mb4 */; -- -- Database: `db_siswa` -- -- -------------------------------------------------------- -- -- Table structure for table `siswa` -- CREATE TABLE `siswa` ( `kd_siswa` int(11) NOT NULL, `nama` varchar(100) NOT NULL, `kelas` varchar(100) NOT NULL, `jenis_kelamin` varchar(100) NOT NULL, `alamat` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `siswa` -- INSERT INTO `siswa` (`kd_siswa`, `nama`, `kelas`, `jenis_kelamin`, `alamat`) VALUES (1, 'Budi Hermawan', '3MM1', 'PRIA', 'Wonocolo, Surabaya'), (2, 'Cika Larasati', '3MM1', 'WANITA', 'Sedati, Sidoarjo'); -- -- Indexes for dumped tables -- -- -- Indexes for table `siswa` -- ALTER TABLE `siswa` ADD PRIMARY KEY (`kd_siswa`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `siswa` -- ALTER TABLE `siswa` MODIFY `kd_siswa` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; COMMIT; /*!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 */;
23.357143
83
0.672783
aa550ab6dd28ac31a4141b78a96326d97d5e444c
2,344
swift
Swift
LifeCycle/VC/SwiftXibVC.swift
coolboy-ccp/LifeCycle
51804406cc45124759b3082ee3f8ebcdf6d61c7c
[ "MIT" ]
null
null
null
LifeCycle/VC/SwiftXibVC.swift
coolboy-ccp/LifeCycle
51804406cc45124759b3082ee3f8ebcdf6d61c7c
[ "MIT" ]
null
null
null
LifeCycle/VC/SwiftXibVC.swift
coolboy-ccp/LifeCycle
51804406cc45124759b3082ee3f8ebcdf6d61c7c
[ "MIT" ]
null
null
null
// // SwiftXibVC.swift // LifeCycle // // Created by clobotics_ccp on 2019/9/4. // Copyright © 2019 cool-ccp. All rights reserved. // import UIKit class SwiftXibVC: UIViewController { override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) print(#file, #function) } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) print(#file, #function) } //从xib加载视图时调用 override func awakeFromNib() { super.awakeFromNib() print(#file, #function) } override func loadView() { super.loadView() print(#file, #function) } override func viewDidLoad() { super.viewDidLoad() print(#file, #function) } override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews() print(#file, #function) } override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() print(#file, #function) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() print(#file, #function) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) print(#file, #function) } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) print(#file, #function) } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) print(#file, #function) } override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) print(#file, #function) } deinit { print(#file, #function) } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { guard let touch = touches.first else { return } let pt = touch.location(in: self.view) if pt.x > UIScreen.main.bounds.width / 2 { let vc = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "StoryBoardVC") self.present(vc, animated: true, completion: nil) } else { self.dismiss(animated: true, completion: nil) } } }
25.758242
123
0.606229
0a2c233d0fc9303a7f9d330d364bb72b04bae660
1,825
ts
TypeScript
src/controllers/task.ts
Luifr/DomesticTasksBot
9e951586acbdc935920f9e28569515b13b29bac4
[ "MIT" ]
null
null
null
src/controllers/task.ts
Luifr/DomesticTasksBot
9e951586acbdc935920f9e28569515b13b29bac4
[ "MIT" ]
null
null
null
src/controllers/task.ts
Luifr/DomesticTasksBot
9e951586acbdc935920f9e28569515b13b29bac4
[ "MIT" ]
null
null
null
import { ITask, ITaskToCreate } from '../models/task'; import * as uuid from 'uuid'; import { parseDate } from '../helpers/date'; export class TaskController { constructor(private infoDoc: FirebaseFirestore.DocumentReference) { } getAll = async (): Promise<ITask[]> => { const data = (await this.infoDoc.get()).data(); return data?.tasks as ITask[] || []; } getById = async (id: string): Promise<ITask | undefined> => { const tasks = await (await this.infoDoc.get()).data()?.tasks as ITask[] || []; const task = tasks.find(_task => _task.id === id); return task; } getByName = async (name: string): Promise<ITask | undefined> => { const tasks = await (await this.infoDoc.get()).data()?.tasks as ITask[] || []; const task = tasks.find(_task => _task.name === name); return task; } create = async (newTask: ITaskToCreate) => { const tasks = await this.getAll(); const taskIndex = tasks.findIndex(task => task.name === newTask.name); if (taskIndex > -1) { console.error('Task already exists'); return; } const yesterday = new Date(); yesterday.setDate(yesterday.getDate() -1); const dbTask: ITask = { ...newTask, id: newTask.id ?? uuid.v4(), lastRemindDay: parseDate(yesterday) }; tasks.push(dbTask); return this.infoDoc.set( { tasks }, { merge: true } ); } edit = async (name: string, task: Partial<ITask>) => { const tasks = await this.getAll(); const taskIndex = tasks.findIndex(task => task.name === name); if (taskIndex === -1) { console.error('Task does not exist'); return; } tasks[taskIndex] = { ...tasks[taskIndex], ...task }; return this.infoDoc.set( { tasks, }, { merge: true } ); } }
26.449275
82
0.584658
b60c6cd6c1c8bb659fe5f816e8fbc769efda793b
2,648
swift
Swift
Pods/SwiftGRPC/Sources/SwiftGRPC/Runtime/ServerSessionServerStreaming.swift
Eskyee/zap-iOS
dbf40a53131b7f4f4cdfa269020e559df90a0140
[ "MIT" ]
1,699
2017-05-06T02:22:00.000Z
2022-03-30T07:51:03.000Z
Pods/SwiftGRPC/Sources/SwiftGRPC/Runtime/ServerSessionServerStreaming.swift
guruantree/MacAssistant
21c4537fbedaab1a3be28daef578ad8d91cf8604
[ "MIT" ]
330
2018-07-24T18:41:20.000Z
2022-03-19T07:46:32.000Z
Pods/SwiftGRPC/Sources/SwiftGRPC/Runtime/ServerSessionServerStreaming.swift
guruantree/MacAssistant
21c4537fbedaab1a3be28daef578ad8d91cf8604
[ "MIT" ]
180
2017-05-18T22:28:37.000Z
2022-03-28T12:28:04.000Z
/* * Copyright 2018, gRPC Authors All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import Dispatch import Foundation import SwiftProtobuf public protocol ServerSessionServerStreaming: ServerSession { func waitForSendOperationsToFinish() } open class ServerSessionServerStreamingBase<InputType: Message, OutputType: Message>: ServerSessionBase, ServerSessionServerStreaming, StreamSending { public typealias SentType = OutputType public typealias ProviderBlock = (InputType, ServerSessionServerStreamingBase) throws -> ServerStatus? private var providerBlock: ProviderBlock public init(handler: Handler, providerBlock: @escaping ProviderBlock) { self.providerBlock = providerBlock super.init(handler: handler) } public func run() throws -> ServerStatus? { let requestData = try receiveRequestAndWait() let requestMessage = try InputType(serializedData: requestData) do { return try self.providerBlock(requestMessage, self) } catch { // Errors thrown by `providerBlock` should be logged in that method; // we return the error as a status code to avoid `ServiceServer` logging this as a "really unexpected" error. return (error as? ServerStatus) ?? .processingError } } } /// Simple fake implementation of ServerSessionServerStreaming that returns a previously-defined set of results /// and stores sent values for later verification. open class ServerSessionServerStreamingTestStub<OutputType: Message>: ServerSessionTestStub, ServerSessionServerStreaming { open var lock = Mutex() open var outputs: [OutputType] = [] open var status: ServerStatus? open func send(_ message: OutputType, completion _: @escaping (Error?) -> Void) throws { lock.synchronize { outputs.append(message) } } open func _send(_ message: OutputType, timeout: DispatchTime) throws { lock.synchronize { outputs.append(message) } } open func close(withStatus status: ServerStatus, completion: (() -> Void)?) throws { lock.synchronize { self.status = status } completion?() } open func waitForSendOperationsToFinish() {} }
36.777778
150
0.748867
4f5e7be92ae3319b1960e9f36f0848b2055eb3d4
2,387
asm
Assembly
projects/08/FunctionCalls/FibonacciElement/FibonacciElement.asm
WuShaoa/Nand2Tetris
1e650b3442aa5c9302837596651cbc66edc629ec
[ "MIT" ]
null
null
null
projects/08/FunctionCalls/FibonacciElement/FibonacciElement.asm
WuShaoa/Nand2Tetris
1e650b3442aa5c9302837596651cbc66edc629ec
[ "MIT" ]
null
null
null
projects/08/FunctionCalls/FibonacciElement/FibonacciElement.asm
WuShaoa/Nand2Tetris
1e650b3442aa5c9302837596651cbc66edc629ec
[ "MIT" ]
null
null
null
@256 D=A @SP M=D @__Sys.init$return1__ D=A @SP A=M M=D @SP M=M+1 @LCL D=M @SP A=M M=D @SP M=M+1 @ARG D=M @SP A=M M=D @SP M=M+1 @THIS D=M @SP A=M M=D @SP M=M+1 @THAT D=M @SP A=M M=D @SP M=M+1 @SP D=M @0 D=D-A @5 D=D-A @ARG M=D @SP D=M @LCL M=D @Sys.init 0;JMP (__Sys.init$return1__) (Main.fibonacci) @ARG D=M @0 A=D+A D=M @SP A=M M=D @SP M=M+1 @2 D=A @SP A=M M=D @SP M=M+1 @SP M=M-1 A=M D=M @SP M=M-1 A=M D=M-D @lt_true_1 D;JLT D=0 @lt_end_1 0;JMP (lt_true_1) D=-1 (lt_end_1) @SP A=M M=D @SP M=M+1 @SP M=M-1 A=M D=M @Main.fibonacci$IF_TRUE D;JNE @Main.fibonacci$IF_FALSE 0;JMP (Main.fibonacci$IF_TRUE) @ARG D=M @0 A=D+A D=M @SP A=M M=D @SP M=M+1 @LCL D=M @R14 M=D @5 A=D-A D=M @R15 M=D @SP M=M-1 A=M D=M @ARG A=M M=D @ARG D=M+1 @SP M=D @R14 D=M @1 A=D-A D=M @THAT M=D @R14 D=M @2 A=D-A D=M @THIS M=D @R14 D=M @3 A=D-A D=M @ARG M=D @R14 D=M @4 A=D-A D=M @LCL M=D @R15 A=M 0;JMP (Main.fibonacci$IF_FALSE) @ARG D=M @0 A=D+A D=M @SP A=M M=D @SP M=M+1 @2 D=A @SP A=M M=D @SP M=M+1 @SP M=M-1 A=M D=M @SP M=M-1 A=M D=M-D @SP A=M M=D @SP M=M+1 @__Main.fibonacci$return2__ D=A @SP A=M M=D @SP M=M+1 @LCL D=M @SP A=M M=D @SP M=M+1 @ARG D=M @SP A=M M=D @SP M=M+1 @THIS D=M @SP A=M M=D @SP M=M+1 @THAT D=M @SP A=M M=D @SP M=M+1 @SP D=M @1 D=D-A @5 D=D-A @ARG M=D @SP D=M @LCL M=D @Main.fibonacci 0;JMP (__Main.fibonacci$return2__) @ARG D=M @0 A=D+A D=M @SP A=M M=D @SP M=M+1 @1 D=A @SP A=M M=D @SP M=M+1 @SP M=M-1 A=M D=M @SP M=M-1 A=M D=M-D @SP A=M M=D @SP M=M+1 @__Main.fibonacci$return3__ D=A @SP A=M M=D @SP M=M+1 @LCL D=M @SP A=M M=D @SP M=M+1 @ARG D=M @SP A=M M=D @SP M=M+1 @THIS D=M @SP A=M M=D @SP M=M+1 @THAT D=M @SP A=M M=D @SP M=M+1 @SP D=M @1 D=D-A @5 D=D-A @ARG M=D @SP D=M @LCL M=D @Main.fibonacci 0;JMP (__Main.fibonacci$return3__) @SP M=M-1 A=M D=M @SP M=M-1 A=M D=D+M @SP A=M M=D @SP M=M+1 @LCL D=M @R14 M=D @5 A=D-A D=M @R15 M=D @SP M=M-1 A=M D=M @ARG A=M M=D @ARG D=M+1 @SP M=D @R14 D=M @1 A=D-A D=M @THAT M=D @R14 D=M @2 A=D-A D=M @THIS M=D @R14 D=M @3 A=D-A D=M @ARG M=D @R14 D=M @4 A=D-A D=M @LCL M=D @R15 A=M 0;JMP (Sys.init) @4 D=A @SP A=M M=D @SP M=M+1 @__Main.fibonacci$return4__ D=A @SP A=M M=D @SP M=M+1 @LCL D=M @SP A=M M=D @SP M=M+1 @ARG D=M @SP A=M M=D @SP M=M+1 @THIS D=M @SP A=M M=D @SP M=M+1 @THAT D=M @SP A=M M=D @SP M=M+1 @SP D=M @1 D=D-A @5 D=D-A @ARG M=D @SP D=M @LCL M=D @Main.fibonacci 0;JMP (__Main.fibonacci$return4__) (Sys.init$WHILE) @Sys.init$WHILE 0;JMP
5.304444
28
0.57478
2a23569137079e9c9f40b9e9057fcc2a190fe152
1,701
java
Java
vibes-core/src/main/java/be/vibes/ts/io/xml/UsageModelPrinter.java
xdevroey/vibes
6afcf98708354dc96af2914bb717c002c84a1079
[ "Apache-2.0" ]
1
2017-11-30T19:07:11.000Z
2017-11-30T19:07:11.000Z
vibes-core/src/main/java/be/vibes/ts/io/xml/UsageModelPrinter.java
xdevroey/vibes
6afcf98708354dc96af2914bb717c002c84a1079
[ "Apache-2.0" ]
13
2018-02-06T10:48:06.000Z
2018-11-08T12:11:52.000Z
vibes-core/src/main/java/be/vibes/ts/io/xml/UsageModelPrinter.java
xdevroey/vibes
6afcf98708354dc96af2914bb717c002c84a1079
[ "Apache-2.0" ]
3
2017-11-30T19:07:32.000Z
2019-07-25T18:58:27.000Z
package be.vibes.ts.io.xml; /*- * #%L * VIBeS: core * %% * Copyright (C) 2014 - 2018 University of Namur * %% * 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. * #L% */ import be.vibes.ts.Transition; import be.vibes.ts.UsageModel; import static be.vibes.ts.io.xml.UsageModelHandler.*; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class UsageModelPrinter extends TransitionSystemPrinter { private static final Logger LOG = LoggerFactory.getLogger(UsageModelPrinter.class); @Override public void printElement(XMLStreamWriter xtw, Transition transition) throws XMLStreamException { LOG.trace("Printing transition element"); xtw.writeStartElement(TRANSITION_TAG); xtw.writeAttribute(TARGET_ATTR, transition.getTarget().getName()); xtw.writeAttribute(ACTION_ATTR, transition.getAction().getName()); xtw.writeAttribute(PROBA_ATTR, Double.toString(getUsageModel().getProbability(transition))); xtw.writeEndElement(); } private UsageModel getUsageModel(){ return (UsageModel) ts; } }
31.5
100
0.726631
8cebe6c571efb1f4cc3f07393ebc39f24e830a45
1,799
lua
Lua
accounts.lua
dustinengle/coin
ee9d8abeed26ada154e7c32f632014cf300e3269
[ "MIT" ]
6
2016-10-29T00:23:40.000Z
2019-06-23T03:18:16.000Z
accounts.lua
dustinengle/coin
ee9d8abeed26ada154e7c32f632014cf300e3269
[ "MIT" ]
null
null
null
accounts.lua
dustinengle/coin
ee9d8abeed26ada154e7c32f632014cf300e3269
[ "MIT" ]
null
null
null
--- Accounts accounts = {} --- The list of players with accounts. accounts.players = {} --- Return the current balance for a player. function accounts:balance(uuid) self:check(uuid) return self.players[uuid] or 0.00 end --- Check if an account is in the system -- if not then create it. Will be saved on exit. function accounts:check(uuid) if not self.players[uuid] then self.players[uuid] = 0.0 end end --- Credit a user with provided amount. function accounts:credit(uuid, amount) if amount > 0.0 then self:check(uuid) self.players[uuid] = self.players[uuid] + amount end end --- Debit a player's account for amount provided. function accounts:debit(uuid, amount) if amount > 0.0 then self:check(uuid) self.players[uuid] = self.players[uuid] - amount end end --- Check that the player has amount provided. function accounts:has(uuid, amount) self:check(uuid) return self.players[uuid] >= amount end --- Load the ini file into memory. function accounts:load() local file = cIniFile() -- Try to read settings.ini file. if file:ReadFile(f:path() .. 'accounts.ini') then -- Loop over uuid keys. for k = 0, (file:GetNumKeys() - 1) do -- Get the name of the uuid of player. local uuid = file:GetKeyName(k) self.players[uuid] = file:GetValueSetI(uuid, "Balance") end return true end return false end --- Save player accounts to the ini file. function accounts:save() local file = cIniFile() for uuid, balance in pairs(self.players) do file:AddKeyName(uuid) file:SetValueF(uuid, "Balance", balance, true) end if file:WriteFile(f:path() .. 'accounts.ini') then f:log("accounts.ini file saved.") else f:log("unable to save accounts.ini file.") end end return accounts
22.772152
61
0.67871
f060f41b082dd8ad8916be9f066a2d7f5a4d15bb
266
js
JavaScript
crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es5.1.normal.js
g-plane/swc
fc9622f779c60d9006ed54710b13b127674c6574
[ "Apache-2.0" ]
2
2022-01-27T13:37:46.000Z
2022-03-05T02:38:25.000Z
crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es5.1.normal.js
g-plane/swc
fc9622f779c60d9006ed54710b13b127674c6574
[ "Apache-2.0" ]
null
null
null
crates/swc/tests/tsc-references/jsDeclarationsFunctionKeywordProp_es5.1.normal.js
g-plane/swc
fc9622f779c60d9006ed54710b13b127674c6574
[ "Apache-2.0" ]
null
null
null
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: source.js function foo() { } foo.null = true; function bar() { } bar.async = true; bar.normal = false; function baz() { } baz.class = true; baz.normal = false;
14.777778
23
0.62782
0f3be2f3bb62b65c4f81e2a650836809cb471403
8,215
lua
Lua
nvim/lua/modules/plugins/packer.lua
jarmex/myconfig
54fd4173ccf8f72637e65c9efa0de32910e61116
[ "MIT" ]
null
null
null
nvim/lua/modules/plugins/packer.lua
jarmex/myconfig
54fd4173ccf8f72637e65c9efa0de32910e61116
[ "MIT" ]
null
null
null
nvim/lua/modules/plugins/packer.lua
jarmex/myconfig
54fd4173ccf8f72637e65c9efa0de32910e61116
[ "MIT" ]
null
null
null
-- adopted from https://github.com/n3wborn/nvim/blob/main/lua/modules/plugins/packer.lua -- local cmd = vim.api.nvim_command local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" local fn = vim.fn -- install packer if needed if fn.empty(fn.glob(install_path)) > 0 then packer_bootstrap = fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path, }) end -- Autocommand that reloads neovim whenever you save the plugins.lua file vim.cmd([[ augroup packer_user_config autocmd! autocmd BufWritePost packer.lua source <afile> | PackerSync augroup end ]]) local status_ok, packer = pcall(require, "packer") if not status_ok then return end packer.init({ compile_path = vim.fn.stdpath("config") .. "/lua/packer_compiled.lua", display = { working_sym = "🛠️ ", -- The symbol for a plugin being installed/updated error_sym = "🧨", -- The symbol for a plugin with an error in installation/updating done_sym = "🎉", -- The symbol for a plugin which has completed installation/updating removed_sym = "🔥", -- The symbol for an unused plugin which was removed moved_sym = "🚀", -- The symbol for a plugin which was moved (e.g. from opt to start) open_fn = function() return require("packer.util").float({ border = "rounded" }) end, }, }) return packer.startup(function(use) -- Plugin manager use("wbthomason/packer.nvim") -- Libs lua use({ "nvim-lua/plenary.nvim", "nvim-lua/popup.nvim", }) --- impatient use("lewis6991/impatient.nvim") --- Lsp use({ "neovim/nvim-lspconfig", requires = { "williamboman/nvim-lsp-installer", "ray-x/lsp_signature.nvim", "jose-elias-alvarez/nvim-lsp-ts-utils", "jose-elias-alvarez/null-ls.nvim", }, config = function() require("modules.lsp") end, }) use({ "b0o/SchemaStore.nvim" }) use({ "filipdutescu/renamer.nvim", config = function() require("modules.plugins.renamer") end, }) use({ "SmiteshP/nvim-gps", requires = "nvim-treesitter/nvim-treesitter", wants = "nvim-treesitter", module = "nvim-gps", config = function() require("nvim-gps").setup({ separator = " " }) end, }) -- Completion use({ "hrsh7th/nvim-cmp", config = function() require("modules.plugins.cmp") end, requires = { "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", "hrsh7th/cmp-nvim-lua", "onsails/lspkind-nvim", "rafamadriz/friendly-snippets", "hrsh7th/cmp-calc", { "tzachar/cmp-tabnine", run = "./install.sh", requires = "hrsh7th/nvim-cmp", config = function() require("modules.plugins.tabnine") end, }, }, }) -- snippets use("L3MON4D3/LuaSnip") --snippet engine use({ "saadparwaiz1/cmp_luasnip" }) use("rafamadriz/friendly-snippets") -- a bunch of snippets to use -- auto pairs use({ "windwp/nvim-autopairs", config = function() require("modules.plugins.autopairs") end, }) -- Close Buffer use({ "kazhala/close-buffers.nvim", cmd = "BDelete", config = function() require("modules.plugins.closebuffer") end, }) --- Telescope use({ "nvim-telescope/telescope.nvim", requires = { "nvim-lua/plenary.nvim", "nvim-lua/popup.nvim", "nvim-telescope/telescope-project.nvim", "nvim-telescope/telescope-ui-select.nvim", "nvim-telescope/telescope-file-browser.nvim", { "nvim-telescope/telescope-fzf-native.nvim", run = "make" }, }, config = function() require("modules.plugins.telescope.init") end, }) --- Treesitter use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate", config = function() require("modules.plugins.treesitter") end, }) use("nvim-treesitter/nvim-treesitter-textobjects") use("nvim-treesitter/nvim-tree-docs") -- use({ "p00f/nvim-ts-rainbow" }) use("windwp/nvim-ts-autotag") use("romgrk/nvim-treesitter-context") -- File explorer use({ "kyazdani42/nvim-tree.lua", requires = "kyazdani42/nvim-web-devicons", config = function() require("modules.plugins.nvimtree") end, }) -- Dev div tools use({ "numToStr/Comment.nvim", config = function() require("Comment").setup() end, }) -- use({ --'editorconfig/editorconfig-vim', -- "b3nj5m1n/kommentary", --'junegunn/vim-easy-align', -- 'tpope/vim-surround', -- }) -- TS Context comment string -- use({ "JoosepAlviste/nvim-ts-context-commentstring", module = "ts_context_commentstring" }) use({ "folke/trouble.nvim", requires = "kyazdani42/nvim-web-devicons", config = function() require("modules.plugins.trouble") end, }) --[[ use({ 'kkoomen/vim-doge', run = ':call doge#install()', config = function() require('modules.plugins.doge') end }) ]] -- Git use("tpope/vim-fugitive") use({ "lewis6991/gitsigns.nvim", requires = { "nvim-lua/plenary.nvim", }, config = function() require("modules.plugins.gitsigns") end, }) use({ "kdheepak/lazygit.nvim", config = function() require("modules.plugins.lazygit") end, }) -- Colors and nice stuff -- Theme: icons use({ "kyazdani42/nvim-web-devicons", module = "nvim-web-devicons", config = function() require("modules.plugins.webdevicons") end, }) -- use 'navarasu/onedark.nvim' -- use 'folke/tokyonight.nvim' use({ "catppuccin/nvim", as = "catppuccin", config = function() require("modules.plugins.theme") end, }) use({ "rafamadriz/neon", requires = { "ryanoasis/vim-devicons", }, config = function() -- require("modules.plugins.neontheme") end, }) use({ "norcalli/nvim-colorizer.lua", config = function() require("modules.plugins.colorizer") end, }) -- Tabs use({ "akinsho/nvim-bufferline.lua", --event = "BufReadPre", wants = "nvim-web-devicons", config = function() require("modules.plugins.bufferline") end, }) -- Statusline use({ "nvim-lualine/lualine.nvim", requires = { "kyazdani42/nvim-web-devicons" }, config = function() require("modules.plugins.lualine") end, }) use({ "lukas-reineke/indent-blankline.nvim", config = function() require("modules.plugins.blankline") end, }) use({ "folke/todo-comments.nvim", cmd = { "TodoTrouble", "TodoTelescope" }, -- event = "BufReadPost", opt = true, config = function() require("modules.plugins.todo") end, }) use({ "simrat39/symbols-outline.nvim", cmd = { "SymbolsOutline" }, config = function() require("modules.plugins.symbol-outline") end, }) -- Start Screen use({ "mhinz/vim-startify" }) --[[ use("tpope/vim-dadbod") use("kristijanhusak/vim-dadbod-completion") use("kristijanhusak/vim-dadbod-ui") ]] use({ "mfussenegger/nvim-dap", requires = { "nvim-telescope/telescope-dap.nvim", }, config = function() require("modules.plugins.dap") end, }) use("theHamsta/nvim-dap-virtual-text") use("rcarriga/nvim-dap-ui") use("Pocco81/DAPInstall.nvim") use({ "nathom/filetype.nvim", config = function() vim.g.did_load_filetypes = 1 end, }) use({ "simrat39/rust-tools.nvim", requires = { "mfussenegger/nvim-dap", }, }) -- figet use({ "j-hui/fidget.nvim", config = function() require("fidget").setup({}) end, }) -- refactoring use({ "ThePrimeagen/refactoring.nvim", requires = { { "nvim-lua/plenary.nvim" }, { "nvim-treesitter/nvim-treesitter" }, }, config = function() require("modules.plugins.refactoring") end, }) -- adding JAVA plugins use({ "mfussenegger/nvim-jdtls", }) use({ "nacro90/numb.nvim", config = function() require("modules.plugins.numb") end, }) use({ "antoinemadec/FixCursorHold.nvim", -- This is needed to fix lsp doc highlight }) use({ "rcarriga/nvim-notify", config = function() require("modules.plugins.notify") end, }) use({ "RRethy/vim-illuminate", config = function() vim.g.Illuminate_highlightUnderCursor = 0 end, }) use({ "akinsho/toggleterm.nvim", config = function() require("modules.plugins.terminal") end, }) use({ "michaelb/sniprun", run = "bash ./install.sh", config = function() require("modules.plugins.sniprun") end, }) if packer_bootstrap then require("packer").sync() end end)
20.184275
95
0.649178
d2c9c55e54223ade9ac115e2bce006e8050564d5
156
php
PHP
tests/Passes/MinifyVarsTest.php
s9e/SourceOptimizer
71d47fe169b04bdb33c28e745b41f1de223a2f1c
[ "MIT" ]
1
2015-01-15T11:08:15.000Z
2015-01-15T11:08:15.000Z
tests/Passes/MinifyVarsTest.php
s9e/SourceOptimizer
71d47fe169b04bdb33c28e745b41f1de223a2f1c
[ "MIT" ]
null
null
null
tests/Passes/MinifyVarsTest.php
s9e/SourceOptimizer
71d47fe169b04bdb33c28e745b41f1de223a2f1c
[ "MIT" ]
null
null
null
<?php namespace s9e\SourceOptimizer\Tests\Passes; /** * @covers s9e\SourceOptimizer\Passes\MinifyVars */ class MinifyVarsTest extends AbstractPassTest { }
15.6
47
0.788462
2a69726fee70d0ae76786cccc604fe9b5bfe5391
4,388
sql
SQL
timesheet.sql
Apranta/timesheet
17a05ca58fb9e6d97917504b7e707836ee5b9e9f
[ "MIT" ]
1
2020-05-07T15:10:11.000Z
2020-05-07T15:10:11.000Z
timesheet.sql
Apranta/timesheet
17a05ca58fb9e6d97917504b7e707836ee5b9e9f
[ "MIT" ]
null
null
null
timesheet.sql
Apranta/timesheet
17a05ca58fb9e6d97917504b7e707836ee5b9e9f
[ "MIT" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 5.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Waktu pembuatan: 19 Apr 2020 pada 16.57 -- Versi server: 10.4.11-MariaDB -- Versi PHP: 7.3.14 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!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 utf8mb4 */; -- -- Database: `timesheet` -- -- -------------------------------------------------------- -- -- Struktur dari tabel `aktivitas` -- CREATE TABLE `aktivitas` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `judul` varchar(255) NOT NULL, `delegasi` int(11) DEFAULT NULL, `mulai` datetime NOT NULL, `akhir` datetime NOT NULL, `deskripsi` text NOT NULL, `output` text NOT NULL, `lokasi` varchar(255) NOT NULL, `created_at` date NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Struktur dari tabel `reporting` -- CREATE TABLE `reporting` ( `id` int(11) NOT NULL, `aktivitas_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `approve` int(11) NOT NULL, `status` tinyint(1) NOT NULL, `alasan` text DEFAULT NULL, `approve_at` datetime NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Struktur dari tabel `roles` -- CREATE TABLE `roles` ( `id` int(11) NOT NULL, `nama` varchar(100) NOT NULL, `deskripsi` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data untuk tabel `roles` -- INSERT INTO `roles` (`id`, `nama`, `deskripsi`) VALUES (1, 'User', 'user'), (2, 'Approver 1', ''), (3, 'Approver 2', 'user'), (4, 'Approver 3', ''), (5, 'Approver 4', 'user'), (6, 'PM', ''), (7, 'Super Admin', 'user'); -- -------------------------------------------------------- -- -- Struktur dari tabel `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `username` varchar(100) NOT NULL, `password` varchar(35) NOT NULL, `role` int(11) NOT NULL, `nama_lengkap` varchar(100) NOT NULL, `nama_panggilan` varchar(100) NOT NULL, `jenis_kelamin` enum('L','P') NOT NULL, `ttl` varchar(255) NOT NULL, `penugasan_tim` varchar(100) NOT NULL, `penugasan_tempat` enum('pusat','gdmri','gdmrii','gmdriii','gtm') NOT NULL, `jabatan` varchar(100) NOT NULL, `telepon` varchar(15) NOT NULL, `email` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data untuk tabel `users` -- INSERT INTO `users` (`id`, `username`, `password`, `role`, `nama_lengkap`, `nama_panggilan`, `jenis_kelamin`, `ttl`, `penugasan_tim`, `penugasan_tempat`, `jabatan`, `telepon`, `email`) VALUES (4, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 7, 'Admin Sheila', 'Admin', 'L', 'Jakarta , 01 April 1990', 'Team', 'pusat', 'Admin', '', ''); -- -- Indexes for dumped tables -- -- -- Indeks untuk tabel `aktivitas` -- ALTER TABLE `aktivitas` ADD PRIMARY KEY (`id`), ADD KEY `user_id` (`user_id`), ADD KEY `delegasi` (`delegasi`); -- -- Indeks untuk tabel `reporting` -- ALTER TABLE `reporting` ADD PRIMARY KEY (`id`), ADD KEY `aktivitas_id` (`aktivitas_id`), ADD KEY `user_id` (`user_id`); -- -- Indeks untuk tabel `roles` -- ALTER TABLE `roles` ADD PRIMARY KEY (`id`); -- -- Indeks untuk tabel `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD KEY `role` (`role`), ADD KEY `penugasan_tempat` (`penugasan_tempat`); -- -- AUTO_INCREMENT untuk tabel yang dibuang -- -- -- AUTO_INCREMENT untuk tabel `aktivitas` -- ALTER TABLE `aktivitas` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT untuk tabel `reporting` -- ALTER TABLE `reporting` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT untuk tabel `roles` -- ALTER TABLE `roles` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT untuk tabel `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; COMMIT; /*!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 */;
24.377778
191
0.639699
510fe38cee791939ab3c516b15051241ca9f8044
1,077
h
C
src/mlib/utils.imp.h
michaelo/pros
c3e30fcf825a2661a76afd083a85814604b65bf1
[ "MIT" ]
1
2021-01-13T09:31:57.000Z
2021-01-13T09:31:57.000Z
src/mlib/utils.imp.h
michaelo/prosit
c3e30fcf825a2661a76afd083a85814604b65bf1
[ "MIT" ]
null
null
null
src/mlib/utils.imp.h
michaelo/prosit
c3e30fcf825a2661a76afd083a85814604b65bf1
[ "MIT" ]
null
null
null
#pragma once #include <cstdio> #include <cstring> #include <cassert> #include "defer.imp.h" #ifdef _WIN32 inline char* strtok_r(char* str, const char* sep, char** save) { return strtok_s(str, sep, save); } #endif inline char *file_to_buf(const char *path, size_t *size_out = nullptr) { // TODO: Consider rb vs r and rather handle size by reading byte-by-byte. FILE *fp = fopen(path, "rb"); if (fp == nullptr) { return nullptr; } defer(fclose(fp)); fseek(fp, 0L, SEEK_END); long raw_size = ftell(fp); rewind(fp); char *filebuf = new char[raw_size+1]; fread(filebuf, raw_size, 1, fp); filebuf[raw_size] = '\0'; if (size_out != nullptr) *size_out = raw_size; return filebuf; // must free } template <typename Functor> void buf_pr_token(char *buf, const char *sep, Functor callback) { char *save; char *token = strtok_r(buf, sep, &save); while (token != NULL) { // TBD: Don't pass empty chunks? callback(token); token = strtok_r(NULL, sep, &save); } }
20.711538
77
0.613742
b89f358b7ed1bf4e1c6a187be2339d5a9665d671
2,216
html
HTML
layouts/index.html
PaleBlueYk/hugo-theme-white
f9788b92a1b88da87271752a175205a344db6bfe
[ "MIT" ]
1
2020-08-12T01:33:58.000Z
2020-08-12T01:33:58.000Z
layouts/index.html
PaleBlueYk/hugo-theme-white
f9788b92a1b88da87271752a175205a344db6bfe
[ "MIT" ]
null
null
null
layouts/index.html
PaleBlueYk/hugo-theme-white
f9788b92a1b88da87271752a175205a344db6bfe
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html lang="zh-Hans"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>{{ .Site.Title }}</title> <link rel="shortcut icon" href="{{"img/favicon.png" |absURL}}" type="image/x-icon"> <link rel="stylesheet" href="{{ "css/index.css" |absURL }}"> <link rel="stylesheet" href="{{ "css/font-awesome.min.css" |absURL }}"> <link rel="stylesheet" href="{{ "css/main.css" |absURL }}"> <meta name="description" content="{{ .Site.Params.description }}"> <meta name="keywords" content="{{ .Site.Params.keywords }}"> <meta name="baidu-site-verification" content="{{ .Site.Params.seo.baidu }}" /> <meta name="google-site-verification" content="{{ .Site.Params.seo.googleSiteVerification }}" /> <script src="{{ "/js/baidu.js" |absURL }}"></script> </head> <body> <div class="mainBox"> <h1 class="title"> {{ if .Site.Params.Title }} {{.Site.Params.Title}} {{ else }} Welcome to My Blog {{ end }} </h1> <h4 class="subTitle"> {{ if .Site.Params.SubTitle }} {{.Site.Params.SubTitle}} {{ else }} 芝灵生于幽谷,不以无人而不芳 {{ end }} </h4> <div class="socials"> {{ range $key,$value := .Site.Social }} {{ if ne $value "" }} <a href="{{ $value }}" title="{{ $key }}" target="_blank"><i class="fa fa-{{ $key }}" aria-hidden="true"></i></a> {{ end }} {{ end }} </div> <div class="btn"> <a class="toHome" href="/posts/">{{ i18n "enter" }}</a> </div> </div> <footer> <div class="indexFooter"> {{ if .Site.Params.record }} <span><a href="http://www.beian.miit.gov.cn/" target="_blank">{{ .Site.Params.record }}</a></span><br /> {{ end }} {{ if (and .Site.Params.policeRecordNumber .Site.Params.policeRecordProvince)}} <span> <a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode={{.Site.Params.policeRecordNumber}}" target="_blank"> <img class="beian" src="{{"/img/beian.png"|absURL}}" alt="">{{.Site.Params.policeRecordProvince}}公网安备 {{.Site.Params.policeRecordNumber}}号 </a> </span> {{ end }} </div> </footer> </body> </html>
35.741935
148
0.570848
dfe2eb07482405f7584fe230f41b6bacf67fd697
13,616
ts
TypeScript
src/core/utils/easing.ts
boomfun/BFDanmaku
2670d03766dc378d68a55a292de90371b29e645b
[ "MIT" ]
13
2020-05-11T12:56:26.000Z
2021-01-24T06:30:08.000Z
src/core/utils/easing.ts
boomfun/BFDanmaku
2670d03766dc378d68a55a292de90371b29e645b
[ "MIT" ]
null
null
null
src/core/utils/easing.ts
boomfun/BFDanmaku
2670d03766dc378d68a55a292de90371b29e645b
[ "MIT" ]
2
2020-06-15T13:48:50.000Z
2021-01-19T08:06:19.000Z
import { TransitionType } from "../static/static"; import { Log } from "./log"; /** * 缓动函数类 * * @export * @class Easing */ // const S = 1.70158; export class Easing { public static getEasingFunc(type: TransitionType) { switch (type) { case TransitionType.none: return Easing.none; case TransitionType.linear: return Easing.linear; case TransitionType.easeOutBack: return Easing.easeOutBack; case TransitionType.easeInBack: return Easing.easeInBack; case TransitionType.easeInOutBack: return Easing.easeInOutBack; case TransitionType.easeOutBounce: return Easing.easeOutBounce; case TransitionType.easeInBounce: return Easing.easeInBack; case TransitionType.easeInOutBounce: return Easing.easeInOutBounce; case TransitionType.easeInQuad: return Easing.easeInQuad; case TransitionType.easeOutQuad: return Easing.easeOutQuad; case TransitionType.easeInOutQuad: return Easing.easeInOutQuad; case TransitionType.easeOutCubic: return Easing.easeOutCubic; case TransitionType.easeInCubic: return Easing.easeInCubic; case TransitionType.easeInOutCubic: return Easing.easeInOutCubic; case TransitionType.easeOutQuart: return Easing.easeOutQuart; case TransitionType.easeInQuart: return Easing.easeInQuart; case TransitionType.easeInOutQuart: return Easing.easeInOutQuart; case TransitionType.easeOutQuint: return Easing.easeOutQuint; case TransitionType.easeInQuint: return Easing.easeInQuint; case TransitionType.easeInOutQuint: return Easing.easeInOutQuint; case TransitionType.easeOutExpo: return Easing.easeOutExpo; case TransitionType.easeInExpo: return Easing.easeInExpo; case TransitionType.easeInOutExpo: return Easing.easeInOutExpo; case TransitionType.easeOutCirc: return Easing.easeOutCirc; case TransitionType.easeInCirc: return Easing.easeInCirc; case TransitionType.easeInOutCirc: return Easing.easeInOutCirc; case TransitionType.easeOutElastic: return Easing.easeOutElastic; case TransitionType.easeInElastic: return Easing.easeInElastic; case TransitionType.easeInOutElastic: return Easing.easeInOutElastic; default: Log.warn("Unexpected easing function type:" + type); return Easing.linear; } } public static none(currentTime: number, value: number, duration: number) { return value; } public static linear(currentTime: number, value: number, duration: number) { return Tween.Linear(currentTime, 0, value, duration); } public static easeInBack(currentTime: number, value: number, duration: number) { return Tween.Back.easeIn(currentTime, 0, value, duration, undefined); } public static easeOutBack(currentTime: number, value: number, duration: number) { return Tween.Back.easeOut(currentTime, 0, value, duration, undefined); } public static easeInOutBack(currentTime: number, value: number, duration: number) { return Tween.Back.easeInOut(currentTime, 0, value, duration, undefined); } public static easeInBounce(currentTime: number, value: number, duration: number) { return Tween.Bounce.easeIn(currentTime, 0, value, duration); } public static easeOutBounce(currentTime: number, value: number, duration: number) { return Tween.Bounce.easeOut(currentTime, 0, value, duration); } public static easeInOutBounce(currentTime: number, value: number, duration: number) { return Tween.Bounce.easeInOut(currentTime, 0, value, duration); } public static easeInQuad(currentTime: number, value: number, duration: number) { return Tween.Quad.easeIn(currentTime, 0, value, duration); } public static easeOutQuad(currentTime: number, value: number, duration: number) { return Tween.Quad.easeOut(currentTime, 0, value, duration); } public static easeInOutQuad(currentTime: number, value: number, duration: number) { return Tween.Quad.easeInOut(currentTime, 0, value, duration); } public static easeInCubic(currentTime: number, value: number, duration: number) { return Tween.Cubic.easeIn(currentTime, 0, value, duration); } public static easeOutCubic(currentTime: number, value: number, duration: number) { return Tween.Cubic.easeOut(currentTime, 0, value, duration); } public static easeInOutCubic(currentTime: number, value: number, duration: number) { return Tween.Cubic.easeInOut(currentTime, 0, value, duration); } public static easeInQuart(currentTime: number, value: number, duration: number) { return Tween.Quart.easeIn(currentTime, 0, value, duration); } public static easeOutQuart(currentTime: number, value: number, duration: number) { return Tween.Quart.easeOut(currentTime, 0, value, duration); } public static easeInOutQuart(currentTime: number, value: number, duration: number) { return Tween.Quart.easeInOut(currentTime, 0, value, duration); } public static easeInQuint(currentTime: number, value: number, duration: number) { return Tween.Quint.easeIn(currentTime, 0, value, duration); } public static easeOutQuint(currentTime: number, value: number, duration: number) { return Tween.Quint.easeOut(currentTime, 0, value, duration); } public static easeInOutQuint(currentTime: number, value: number, duration: number) { return Tween.Quint.easeInOut(currentTime, 0, value, duration); } public static easeInExpo(currentTime: number, value: number, duration: number) { return Tween.Expo.easeIn(currentTime, 0, value, duration); } public static easeOutExpo(currentTime: number, value: number, duration: number) { return Tween.Expo.easeOut(currentTime, 0, value, duration); } public static easeInOutExpo(currentTime: number, value: number, duration: number) { return Tween.Expo.easeInOut(currentTime, 0, value, duration); } public static easeInCirc(currentTime: number, value: number, duration: number) { return Tween.Circ.easeIn(currentTime, 0, value, duration); } public static easeOutCirc(currentTime: number, value: number, duration: number) { return Tween.Circ.easeOut(currentTime, 0, value, duration); } public static easeInOutCirc(currentTime: number, value: number, duration: number) { return Tween.Circ.easeInOut(currentTime, 0, value, duration); } public static easeInElastic(currentTime: number, value: number, duration: number) { return Tween.Elastic.easeIn(currentTime, 0, value, duration, undefined, undefined); } public static easeOutElastic(currentTime: number, value: number, duration: number) { return Tween.Elastic.easeOut(currentTime, 0, value, duration, undefined, undefined); } public static easeInOutElastic(currentTime: number, value: number, duration: number) { return Tween.Elastic.easeInOut(currentTime, 0, value, duration, undefined, undefined); } } /* * Tween.js * t: current time(当前时间) * b: beginning value(初始值) * c: change in value(变化量) * d: duration(持续时间) */ const Tween = { Linear: function (t:number, b:number, c:number, d:number) { return (c * t) / d + b; }, Quad: { easeIn: function (t:number, b:number, c:number, d:number) { return c * (t /= d) * t + b; }, easeOut: function (t:number, b:number, c:number, d:number) { return -c * (t /= d) * (t - 2) + b; }, easeInOut: function (t:number, b:number, c:number, d:number) { if ((t /= d / 2) < 1) return (c / 2) * t * t + b; return (-c / 2) * (--t * (t - 2) - 1) + b; }, }, Cubic: { easeIn: function (t:number, b:number, c:number, d:number) { return c * (t /= d) * t * t + b; }, easeOut: function (t:number, b:number, c:number, d:number) { return c * ((t = t / d - 1) * t * t + 1) + b; }, easeInOut: function (t:number, b:number, c:number, d:number) { if ((t /= d / 2) < 1) return (c / 2) * t * t * t + b; return (c / 2) * ((t -= 2) * t * t + 2) + b; }, }, Quart: { easeIn: function (t:number, b:number, c:number, d:number) { return c * (t /= d) * t * t * t + b; }, easeOut: function (t:number, b:number, c:number, d:number) { return -c * ((t = t / d - 1) * t * t * t - 1) + b; }, easeInOut: function (t:number, b:number, c:number, d:number) { if ((t /= d / 2) < 1) return (c / 2) * t * t * t * t + b; return (-c / 2) * ((t -= 2) * t * t * t - 2) + b; }, }, Quint: { easeIn: function (t:number, b:number, c:number, d:number) { return c * (t /= d) * t * t * t * t + b; }, easeOut: function (t:number, b:number, c:number, d:number) { return c * ((t = t / d - 1) * t * t * t * t + 1) + b; }, easeInOut: function (t:number, b:number, c:number, d:number) { if ((t /= d / 2) < 1) return (c / 2) * t * t * t * t * t + b; return (c / 2) * ((t -= 2) * t * t * t * t + 2) + b; }, }, Sine: { easeIn: function (t:number, b:number, c:number, d:number) { return -c * Math.cos((t / d) * (Math.PI / 2)) + c + b; }, easeOut: function (t:number, b:number, c:number, d:number) { return c * Math.sin((t / d) * (Math.PI / 2)) + b; }, easeInOut: function (t:number, b:number, c:number, d:number) { return (-c / 2) * (Math.cos((Math.PI * t) / d) - 1) + b; }, }, Expo: { easeIn: function (t:number, b:number, c:number, d:number) { return t == 0 ? b : c * Math.pow(2, 10 * (t / d - 1)) + b; }, easeOut: function (t:number, b:number, c:number, d:number) { return t == d ? b + c : c * (-Math.pow(2, (-10 * t) / d) + 1) + b; }, easeInOut: function (t:number, b:number, c:number, d:number) { if (t == 0) return b; if (t == d) return b + c; if ((t /= d / 2) < 1) return (c / 2) * Math.pow(2, 10 * (t - 1)) + b; return (c / 2) * (-Math.pow(2, -10 * --t) + 2) + b; }, }, Circ: { easeIn: function (t:number, b:number, c:number, d:number) { return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b; }, easeOut: function (t:number, b:number, c:number, d:number) { return c * Math.sqrt(1 - (t = t / d - 1) * t) + b; }, easeInOut: function (t:number, b:number, c:number, d:number) { if ((t /= d / 2) < 1) return (-c / 2) * (Math.sqrt(1 - t * t) - 1) + b; return (c / 2) * (Math.sqrt(1 - (t -= 2) * t) + 1) + b; }, }, Elastic: { easeIn: function (t:number, b:number, c:number, d:number, a:number, p:number) { var s; if (t == 0) return b; if ((t /= d) == 1) return b + c; if (typeof p == "undefined") p = d * 0.3; if (!a || a < Math.abs(c)) { s = p / 4; a = c; } else { s = (p / (2 * Math.PI)) * Math.asin(c / a); } return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin(((t * d - s) * (2 * Math.PI)) / p)) + b; }, easeOut: function (t:number, b:number, c:number, d:number, a:number, p:number) { var s; if (t == 0) return b; if ((t /= d) == 1) return b + c; if (typeof p == "undefined") p = d * 0.3; if (!a || a < Math.abs(c)) { a = c; s = p / 4; } else { s = (p / (2 * Math.PI)) * Math.asin(c / a); } return a * Math.pow(2, -10 * t) * Math.sin(((t * d - s) * (2 * Math.PI)) / p) + c + b; }, easeInOut: function (t:number, b:number, c:number, d:number, a:number, p:number) { var s; if (t == 0) return b; if ((t /= d / 2) == 2) return b + c; if (typeof p == "undefined") p = d * (0.3 * 1.5); if (!a || a < Math.abs(c)) { a = c; s = p / 4; } else { s = (p / (2 * Math.PI)) * Math.asin(c / a); } if (t < 1) return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin(((t * d - s) * (2 * Math.PI)) / p)) + b; return a * Math.pow(2, -10 * (t -= 1)) * Math.sin(((t * d - s) * (2 * Math.PI)) / p) * 0.5 + c + b; }, }, Back: { easeIn: function (t:number, b:number, c:number, d:number, s:number) { if (typeof s == "undefined") s = 1.70158; return c * (t /= d) * t * ((s + 1) * t - s) + b; }, easeOut: function (t:number, b:number, c:number, d:number, s:number) { if (typeof s == "undefined") s = 1.70158; return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; }, easeInOut: function (t:number, b:number, c:number, d:number, s:number) { if (typeof s == "undefined") s = 1.70158; if ((t /= d / 2) < 1) return (c / 2) * (t * t * (((s *= 1.525) + 1) * t - s)) + b; return (c / 2) * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + b; }, }, Bounce: { easeIn: function (t:number, b:number, c:number, d:number) { return c - Tween.Bounce.easeOut(d - t, 0, c, d) + b; }, easeOut: function (t:number, b:number, c:number, d:number) { if ((t /= d) < 1 / 2.75) { return c * (7.5625 * t * t) + b; } else if (t < 2 / 2.75) { return c * (7.5625 * (t -= 1.5 / 2.75) * t + 0.75) + b; } else if (t < 2.5 / 2.75) { return c * (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375) + b; } else { return c * (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375) + b; } }, easeInOut: function (t:number, b:number, c:number, d:number) { if (t < d / 2) { return Tween.Bounce.easeIn(t * 2, 0, c, d) * 0.5 + b; } else { return Tween.Bounce.easeOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b; } }, }, };
37.927577
114
0.587911
a737a67d061c62507818cd23924da483b56c3c40
7,930
sql
SQL
src/taskforce_schema.sql
M2rk13/PHP-Complex-web-services-architecture-Yii2
1471fea33d51cc4c5094ed29b6dbed81eaf21178
[ "BSD-3-Clause" ]
null
null
null
src/taskforce_schema.sql
M2rk13/PHP-Complex-web-services-architecture-Yii2
1471fea33d51cc4c5094ed29b6dbed81eaf21178
[ "BSD-3-Clause" ]
1
2021-07-16T05:24:11.000Z
2021-07-16T05:24:11.000Z
src/taskforce_schema.sql
M2rk13/PHP-Complex-web-services-architecture-Yii2
1471fea33d51cc4c5094ed29b6dbed81eaf21178
[ "BSD-3-Clause" ]
1
2021-06-14T10:22:18.000Z
2021-06-14T10:22:18.000Z
DROP SCHEMA IF EXISTS taskforce; CREATE SCHEMA taskforce DEFAULT CHARACTER SET UTF8MB4 DEFAULT COLLATE utf8mb4_general_ci; USE taskforce; SET default_storage_engine=InnoDB; CREATE TABLE category ( id int NOT NULL AUTO_INCREMENT PRIMARY KEY, name varchar(64) NOT NULL, icon varchar(128) ) COMMENT 'Список категорий'; CREATE TABLE city ( id int NOT NULL AUTO_INCREMENT PRIMARY KEY, name varchar(64) NOT NULL, lat decimal(8, 6) NOT NULL, `long` decimal(9, 6) NOT NULL ) COMMENT 'Список городов'; CREATE TABLE notification_type ( id int NOT NULL AUTO_INCREMENT PRIMARY KEY, name varchar(128) NOT NULL ); CREATE TABLE status ( id int NOT NULL AUTO_INCREMENT PRIMARY KEY, name varchar(64) NOT NULL ) COMMENT 'Статусы заданий'; CREATE TABLE `user` ( id int NOT NULL AUTO_INCREMENT PRIMARY KEY, email varchar(128) NOT NULL, name varchar(128) NOT NULL, password char(64) NOT NULL, date_add datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, date_activity datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Время последней активности на сайте', is_visible boolean NOT NULL DEFAULT true COMMENT 'Показывает/скрывает профиль пользователя.\nЕсли пользователь заказчик - скрыть контакты со страницы пользователя.\nЕсли пользователь исполнитель - скрыть показ карточки со страницы исполнителей.', city_id int COMMENT 'Идентификатор города из таблицы городов', address varchar(255) COMMENT 'Адрес пользователя', birthday date, phone varchar(11), skype varchar(64), telegram varchar(64), avatar varchar(128), about text, is_deleted boolean NOT NULL DEFAULT false, CONSTRAINT fk_users_cities FOREIGN KEY (city_id) REFERENCES city (id) ON DELETE SET NULL ON UPDATE NO ACTION ); CREATE TABLE user_notification ( user_id int NOT NULL COMMENT 'Таблица настроек уведомлений пользователя.\nЕсли запись существует - уведомление активно.', notification_id int NOT NULL COMMENT 'Идентификатор типа уведомления', CONSTRAINT fk_user_notification_users FOREIGN KEY (user_id) REFERENCES `user` (id) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_user_notification FOREIGN KEY (notification_id) REFERENCES notification_type (id) ON DELETE NO ACTION ON UPDATE NO ACTION ); CREATE TABLE favorite ( customer_id int NOT NULL, executor_id int NOT NULL, CONSTRAINT fk_favorites_customer FOREIGN KEY (customer_id) REFERENCES `user` (id) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_favorites_executor FOREIGN KEY (executor_id) REFERENCES `user` (id) ON DELETE NO ACTION ON UPDATE NO ACTION ) COMMENT 'Избранные исполнители'; CREATE TABLE portfolio ( id int NOT NULL AUTO_INCREMENT PRIMARY KEY, user_id int NOT NULL, filepath varchar(255) NOT NULL, CONSTRAINT fk_images_of_work_users FOREIGN KEY (user_id) REFERENCES `user` (id) ON DELETE NO ACTION ON UPDATE NO ACTION ) COMMENT 'Портфолио исполнителей'; CREATE TABLE specialisation ( executor_id int NOT NULL, category_id int NOT NULL, CONSTRAINT fk_specialisations_users FOREIGN KEY (executor_id) REFERENCES `user` (id) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_specialisations_categories FOREIGN KEY (category_id) REFERENCES category (id) ON DELETE NO ACTION ON UPDATE NO ACTION ) COMMENT 'Специализации исполнителей.\nЕсли специализаций у пользователя нет - он заказчик.'; CREATE TABLE task ( id int NOT NULL AUTO_INCREMENT PRIMARY KEY, name varchar(128) NOT NULL COMMENT 'Заголовок задания', description text NOT NULL COMMENT 'Текст задания', category_id int NOT NULL COMMENT 'Идентификатор категории из таблицы типов категорий', status_id int NOT NULL COMMENT 'Идентификатор статуса из таблицы статусов заданий', price numeric(6, 2) NOT NULL COMMENT 'Цена заказчика', customer_id int NOT NULL COMMENT 'Идентификатор заказчика из таблицы пользователей', date_add datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, executor_id int COMMENT 'Идентификатор исполнителя из таблицы пользователей', address varchar(255), city_id int COMMENT 'Идентификатор города из таблицы городов', expire date COMMENT 'Срок исполнения задания', CONSTRAINT fk_tasks_categories FOREIGN KEY (category_id) REFERENCES category (id) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_tasks_statuses FOREIGN KEY (status_id) REFERENCES status (id) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_tasks_customer FOREIGN KEY (customer_id) REFERENCES `user` (id) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_tasks_executor FOREIGN KEY (executor_id) REFERENCES `user` (id) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_tasks_cities FOREIGN KEY (city_id) REFERENCES city (id) ON DELETE SET NULL ON UPDATE NO ACTION ); CREATE TABLE task_file ( id int NOT NULL AUTO_INCREMENT PRIMARY KEY, task_id int NOT NULL, filepath varchar(128) NOT NULL, CONSTRAINT fk_task_files_tasks FOREIGN KEY (task_id) REFERENCES task (id) ON DELETE NO ACTION ON UPDATE NO ACTION ) COMMENT 'Файлы, прикрепленные к заданиям'; CREATE TABLE feedback ( id int NOT NULL AUTO_INCREMENT PRIMARY KEY, task_id int NOT NULL COMMENT 'Идентификатор задания', executor_id int NOT NULL, rate int NOT NULL, created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, description text, CONSTRAINT fk_feedbacks_tasks FOREIGN KEY (task_id) REFERENCES task (id) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_feedbacks_users FOREIGN KEY (executor_id) REFERENCES `user` (id) ON DELETE NO ACTION ON UPDATE NO ACTION ) COMMENT 'Отзывы пользователей о заданиях'; CREATE TABLE message ( id int NOT NULL AUTO_INCREMENT PRIMARY KEY, sender_id int NOT NULL, receiver_id int NOT NULL, task_id int NOT NULL, message text NOT NULL, created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, CONSTRAINT fk_messages_sender FOREIGN KEY (sender_id) REFERENCES `user` (id) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_messages_receiver FOREIGN KEY (receiver_id) REFERENCES `user` (id) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_messages_tasks FOREIGN KEY (task_id) REFERENCES task (id) ON DELETE NO ACTION ON UPDATE NO ACTION ); CREATE TABLE responce ( id int NOT NULL AUTO_INCREMENT PRIMARY KEY, task_id int NOT NULL COMMENT 'Идентификатор задания', executor_id int NOT NULL COMMENT 'Идентификатор исполнителя из таблицы пользователей', created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, price numeric(6, 2) COMMENT 'Цена исполнителя', comment text, CONSTRAINT fk_responces_tasks FOREIGN KEY (task_id) REFERENCES task (id) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_responces_users FOREIGN KEY (executor_id) REFERENCES `user` (id) ON DELETE NO ACTION ON UPDATE NO ACTION ) COMMENT 'История откликов исполнителей'; CREATE TABLE opinion ( id int NOT NULL AUTO_INCREMENT PRIMARY KEY, executor_id int NOT NULL, customer_id int NOT NULL, rate int NOT NULL, created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, description text, CONSTRAINT fk_opinions_executors FOREIGN KEY (executor_id) REFERENCES `user` (id) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_opinions_customers FOREIGN KEY (customer_id) REFERENCES `user` (id) ON DELETE NO ACTION ON UPDATE NO ACTION ) COMMENT 'Отзывы пользователей об исполнителях';
48.353659
258
0.721059
f6ddfd13e043e5dd98ce84336c769981c2e0c751
6,301
swift
Swift
TweetTweet/DetailViewController.swift
JenniferShola/TweetTweet
92142a3b51526dd7d339334e1960e74031f93f86
[ "Apache-2.0" ]
1
2017-11-29T02:31:08.000Z
2017-11-29T02:31:08.000Z
TweetTweet/DetailViewController.swift
JenniferShola/TweetTweet
92142a3b51526dd7d339334e1960e74031f93f86
[ "Apache-2.0" ]
null
null
null
TweetTweet/DetailViewController.swift
JenniferShola/TweetTweet
92142a3b51526dd7d339334e1960e74031f93f86
[ "Apache-2.0" ]
null
null
null
// // DetailViewController.swift // TweetTweet // // Created by Shola Oyedele on 10/28/16. // Copyright © 2016 Jennifer Shola. All rights reserved. // import UIKit class DetailViewController: UIViewController { @IBOutlet weak var profileImageView: UIImageView! @IBOutlet weak var userNameLabel: UILabel! @IBOutlet weak var userHandleLabel: UILabel! @IBOutlet weak var tweetLabel: UILabel! @IBOutlet weak var createdAtString: UILabel! @IBOutlet weak var headerView: UIView! @IBOutlet weak var retweetHandleLabel: UILabel! @IBOutlet weak var retweetAction: UIImageView! @IBOutlet weak var retweetCountLabel: UILabel! @IBOutlet weak var likeCountLabel: UILabel! @IBOutlet weak var mediaView: UIView! @IBOutlet weak var mediaImage: UIImageView! @IBOutlet weak var favoriteButton: UIButton! @IBOutlet weak var retweetButton: UIButton! @IBOutlet weak var replyButton: UIButton! let alertController = UIAlertController(title: "Title", message: "Message", preferredStyle: .alert) let paragraphStyle = NSMutableParagraphStyle() var tweet: Tweet? override func viewDidLoad() { super.viewDidLoad() paragraphStyle.lineSpacing = 3 if tweet != nil { let url = URL(string: "\(tweet!.user!.profileImageUrl!)") profileImageView.setImageWith(url!) userNameLabel.text = tweet!.user!.name userHandleLabel.text = tweet!.user!.screenname createdAtString.text = tweet!.getCreation() if tweet?.retweetedByHandleString != nil { retweetHandleLabel.text = tweet!.retweetHandle() retweetAction.image = UIImage(named: "retweetActionOn") headerView.isHidden = false } else { headerView.isHidden = true } if (tweet?.media_included)! { mediaImage.setImageWith(tweet!.mediaImageUrl!) mediaView.isHidden = false } else { mediaView.isHidden = true } tweet!.attributeText?.addAttribute(NSParagraphStyleAttributeName, value:paragraphStyle, range:NSMakeRange(0, tweet!.attributeText!.length)) tweetLabel.attributedText = tweet!.attributeText! retweetCountLabel.text = tweet!.retweetCountString(short: false)! likeCountLabel.text = tweet!.favoriteCountString(short: false)! Helper.sharedInstance.setFavoriteActionButton(favorited: tweet!.favorited, button: favoriteButton) Helper.sharedInstance.setRetweetActionButton(retweeted: tweet!.retweeted, button: retweetButton) } else { // TODO: This shouldn't happen but just in case, dismiss modal or something. } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } @IBAction func onFavorite(_ sender: AnyObject) { if tweet!.favorited == false { favoriteButton.setBackgroundImage(UIImage(named: "favoriteActionOn"), for: UIControlState.normal) likeCountLabel.text = "\(tweet!.favoriteCount!+1)" tweet!.favorite(completion: { (newTweet, error) in if error != nil { self.favoriteButton.setBackgroundImage(UIImage(named: "favoriteAction"), for: UIControlState.normal) self.likeCountLabel.text = "\(self.tweet!.favoriteCount!)" } else { self.tweet!.favorited = true let c = self.tweet!.favoriteCount! self.tweet!.favoriteCount = c+1 } }) } else { favoriteButton.setBackgroundImage(UIImage(named: "favoriteAction"), for: UIControlState.normal) likeCountLabel.text = "\(self.tweet!.favoriteCount!-1)" tweet!.unfavorite(completion: { (newTweet, error) in if error != nil { self.favoriteButton.setBackgroundImage(UIImage(named: "favoriteActionOn"), for: UIControlState.normal) self.likeCountLabel.text = "\(self.tweet!.favoriteCount!)" } else { self.tweet!.favorited = false let c = self.tweet!.favoriteCount! self.tweet!.favoriteCount = c-1 } }) } } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { let navigationViewController = segue.destination as! UINavigationController let composeViewController = navigationViewController.topViewController as!ComposeViewController composeViewController.reply = true composeViewController.tweets = [tweet] } @IBAction func onRetweet(_ sender: AnyObject) { if tweet!.retweeted == false { retweetButton.setBackgroundImage(UIImage(named: "retweetActionOn"), for: UIControlState.normal) retweetCountLabel.text = "\(self.tweet!.retweetCount!+1)" tweet!.retweet(completion: { (tweet, error) in if error != nil { self.retweetButton.setBackgroundImage(UIImage(named: "retweetAction"), for: UIControlState.normal) } else { self.tweet!.retweeted = true let c = self.tweet!.retweetCount! self.tweet!.retweetCount = c+1 } }) } else { retweetButton.setBackgroundImage(UIImage(named: "retweetAction"), for: UIControlState.normal) retweetCountLabel.text = "\(self.tweet!.retweetCount!-1)" tweet!.unretweet(completion: { (tweet, error) in if error != nil { self.retweetButton.setBackgroundImage(UIImage(named: "retweetActionOn"), for: UIControlState.normal) } else { self.tweet!.retweeted = false let c = self.tweet!.retweetCount! self.tweet!.retweetCount = c-1 } }) } } }
40.391026
151
0.589906
ddf18360643067003095004ba0dd277d2d5e5592
759
php
PHP
src/ATPViz/DataSource/DatabaseQuery.php
DaemonAlchemist/atp-viz
abcf278cdee708aa52cd5ca59f32b186cebd9f2c
[ "MIT" ]
null
null
null
src/ATPViz/DataSource/DatabaseQuery.php
DaemonAlchemist/atp-viz
abcf278cdee708aa52cd5ca59f32b186cebd9f2c
[ "MIT" ]
null
null
null
src/ATPViz/DataSource/DatabaseQuery.php
DaemonAlchemist/atp-viz
abcf278cdee708aa52cd5ca59f32b186cebd9f2c
[ "MIT" ]
null
null
null
<?php namespace ATPViz\DataSource; class DatabaseQuery extends AbstractDataSource { public function getData() { $options = $this->getOptions(); $db = $this->get($options['adapter']); $results = $db->query($options['query'])->execute(); $indVar = isset($options['indVar']) ? $options['indVar'] : null; $rows = array(); foreach($results as $row) { if(is_null($indVar)) { $rows[] = $row; } else { $var = $row[$indVar]; unset($row[$indVar]); $rows[$var] = $row; } } if(!isset($options['columns'])) { throw new \Exception("Chart column definitions not set"); } return array( 'columns' => $options['columns'], 'data' => $rows ); } }
17.651163
67
0.534914