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
21d937e5a25bf0aa03d800c9caaa282360552499
4,275
html
HTML
index.html
rafaeltmbr/scratch-get-started
9daa803c200b8b15b9c1ac67dc21ac1cf76bfe93
[ "Apache-1.1" ]
null
null
null
index.html
rafaeltmbr/scratch-get-started
9daa803c200b8b15b9c1ac67dc21ac1cf76bfe93
[ "Apache-1.1" ]
null
null
null
index.html
rafaeltmbr/scratch-get-started
9daa803c200b8b15b9c1ac67dc21ac1cf76bfe93
[ "Apache-1.1" ]
null
null
null
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Scratch Get Started</title> <link rel="stylesheet" href="./index.css" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/styles/default.min.css" /> </head> <body> <div class="code-button-wrapper"> <pre><code class="code-container language-c"></code></pre> </div> <!-- Blockly root div --> <div id="blocklyDiv"></div> <!-- Tooblx --> <xml id="toolbox" style="display: none"> <category name="Motion" colour="210" secondaryColour="210"> <block type="motion_movesteps"> <value name="STEPS"> <shadow type="math_number"> <field name="NUM">10</field> </shadow> </value> </block> <block type="motion_turnright"> <value name="DEGREES"> <shadow type="math_number"> <field name="NUM">90</field> </shadow> </value> </block> <block type="motion_turnleft"> <value name="DEGREES"> <shadow type="math_number"> <field name="NUM">90</field> </shadow> </value> </block> </category> <category Name="Control" colour="30" secondaryColour="30"> <block type="control_if"> </block> <block type="control_if_else"> </block> <block type="control_repeat"> <value name="TIMES"> <shadow type="math_number"> <field name="NUM">4</field> </shadow> </value> </block> </category> <category name="Operators" colour="100" secondaryColour="100"> <block type="operator_gt"> <value name="OPERAND1"> <shadow type="text"> <field name="TEXT">7</field> </shadow> </value> <value name="OPERAND2"> <shadow type="text"> <field name="TEXT">5</field> </shadow> </value> </block> <block type="operator_and"></block> <block type="operator_or"></block> <block type="operator_not"></block> </category> </xml> <!-- Code that starts in the Blockly workspace area --> <xml xmlns="https://developers.google.com/blockly/xml" id="startBlocks" style="display: none" > <block type="motion_movesteps"> <value name="STEPS"> <shadow type="math_number"> <field name="NUM">10</field> </shadow> </value> </block> </xml> <script src="./blockly_compressed_vertical.js"></script> <script src="./msg/messages.js"></script> <script src="./msg/scratch_msgs.js"></script> <script src="./blocks_vertical/vertical_extensions.js"></script> <script src="./blocks_common/math.js"></script> <script src="./blocks_common/matrix.js"></script> <script src="./blocks_common/note.js"></script> <script src="./blocks_common/text.js"></script> <script src="./blocks_common/colour.js"></script> <script src="./blocks_vertical/control.js"></script> <script src="./blocks_vertical/event.js"></script> <script src="./blocks_vertical/motion.js"></script> <script src="./blocks_vertical/looks.js"></script> <script src="./blocks_vertical/procedures.js"></script> <script src="./blocks_vertical/operators.js"></script> <script src="./blocks_vertical/sound.js"></script> <script src="./blocks_vertical/sensing.js"></script> <script src="./blocks_vertical/data.js"></script> <script src="./blocks_vertical/extensions.js"></script> <script src="./blocks_vertical/default_toolbox.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/highlight.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/languages/c.min.js"></script> <script src="./parse_html_unknown_element.js"></script> <script src="./transpile_code.js"></script> <script src="./index.js"></script> </body> </html>
35.330579
105
0.576608
23a275e89b9a4a57f371a3d7e85e7633343a7289
559
kt
Kotlin
app/src/main/java/de/lukasneugebauer/nextcloudcookbook/feature_auth/data/remote/response/LoginResponse.kt
lneugebauer/nextcloud-cookbook
d4a0d3515484c733cba11dff875c1b52ddd38a39
[ "MIT" ]
null
null
null
app/src/main/java/de/lukasneugebauer/nextcloudcookbook/feature_auth/data/remote/response/LoginResponse.kt
lneugebauer/nextcloud-cookbook
d4a0d3515484c733cba11dff875c1b52ddd38a39
[ "MIT" ]
11
2021-08-19T19:19:29.000Z
2022-03-11T22:31:43.000Z
app/src/main/java/de/lukasneugebauer/nextcloudcookbook/feature_auth/data/remote/response/LoginResponse.kt
lneugebauer/nextcloud-cookbook
d4a0d3515484c733cba11dff875c1b52ddd38a39
[ "MIT" ]
null
null
null
package de.lukasneugebauer.nextcloudcookbook.feature_auth.data.remote.response import de.lukasneugebauer.nextcloudcookbook.core.domain.model.NcAccount import de.lukasneugebauer.nextcloudcookbook.feature_auth.domain.model.LoginResult data class LoginResponse( val server: String, val loginName: String, val appPassword: String ) { fun toLoginResult(): LoginResult = LoginResult( ncAccount = NcAccount( name = "", username = loginName, token = appPassword, url = server ) ) }
29.421053
81
0.690519
f7f8045075c3903a337cbd53444074ec4d87da99
676
asm
Assembly
programs/oeis/105/A105853.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/105/A105853.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/105/A105853.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A105853: a(n) = sigma(n) (mod 10), i.e., unit's digit of sigma(n). ; 1,3,4,7,6,2,8,5,3,8,2,8,4,4,4,1,8,9,0,2,2,6,4,0,1,2,0,6,0,2,2,3,8,4,8,1,8,0,6,0,2,6,4,4,8,2,8,4,7,3,2,8,4,0,2,0,0,0,0,8,2,6,4,7,4,4,8,6,6,4,2,5,4,4,4,0,6,8,0,6,1,6,4,4,8,2,0,0,0,4,2,8,8,4,0,2,8,1,6,7,2,6,4,0,2,2,8,0,0,6,2,8,4,0,4,0,2,0,4,0,3,6,8,4,6,2,8,5,6,2,2,6,0,4,0,0,8,8,0,6,2,6,8,3,0,2,8,6,0,2,2,0,4,8,2,2,8,0,6,8,2,3,4,4,8,2,8,0,3,4,0,8,4,0,8,2,0,0,0,6,2,6,8,0,8,4,6,6,0,0,2,8,4,4,6,9,8,8,0,5,2,6,0,4,2,2,2,4,0,6,2,8,8,4,4,0,6,0,6,4,2,6,4,4,3,2,8,0,0,2,4,0,4,6,8,0,0,2,0,4,2,9,4,4,2,4,0,0,6,8 cal $0,203 ; a(n) = sigma(n), the sum of the divisors of n. Also called sigma_1(n). mod $0,10 mov $1,$0
96.571429
501
0.526627
cbb9cc1c930c7c8b676910dd3e9312f231c90b42
2,328
go
Go
commands/mr_approvers.go
andhe/glab
7519be1dcfed204bb6ab020d6ae2b279294c8d34
[ "MIT" ]
null
null
null
commands/mr_approvers.go
andhe/glab
7519be1dcfed204bb6ab020d6ae2b279294c8d34
[ "MIT" ]
null
null
null
commands/mr_approvers.go
andhe/glab
7519be1dcfed204bb6ab020d6ae2b279294c8d34
[ "MIT" ]
null
null
null
package commands import ( "fmt" "strings" "github.com/profclems/glab/internal/git" "github.com/profclems/glab/internal/manip" "github.com/gookit/color" "github.com/gosuri/uitable" "github.com/spf13/cobra" "github.com/xanzy/go-gitlab" ) var mrApproversCmd = &cobra.Command{ Use: "approvers <id> [flags]", Short: `List merge requests eligible approvers`, Long: ``, Aliases: []string{}, Args: cobra.ExactArgs(1), RunE: listMergeRequestEligibleApprovers, } func listMergeRequestEligibleApprovers(cmd *cobra.Command, args []string) error { if len(args) > 0 { mergeID := strings.Trim(args[0], " ") fmt.Printf("\nListing Merge Request #%v eligible approvers\n", mergeID) gitlabClient, repo := git.InitGitlabClient() if r, _ := cmd.Flags().GetString("repo"); r != "" { repo = r } mrApprovals, _, err := gitlabClient.MergeRequestApprovals.GetApprovalState(repo, manip.StringToInt(mergeID)) if err != nil { return err } if mrApprovals.ApprovalRulesOverwritten { color.Yellow.Println("Approval rules overwritten") } for _, rule := range mrApprovals.Rules { table := uitable.New() table.MaxColWidth = 70 if rule.Approved { color.Green.Println(fmt.Sprintf("Rule %q sufficient approvals (%d/%d required):", rule.Name, len(rule.ApprovedBy), rule.ApprovalsRequired)) } else { color.Yellow.Println(fmt.Sprintf("Rule %q insufficient approvals (%d/%d required):", rule.Name, len(rule.ApprovedBy), rule.ApprovalsRequired)) } eligibleApprovers := rule.EligibleApprovers approvedBy := map[string]*gitlab.BasicUser{} for _, by := range rule.ApprovedBy { approvedBy[by.Username] = by } for _, eligibleApprover := range eligibleApprovers { approved := "-" source := "" if _, exists := approvedBy[eligibleApprover.Username]; exists { approved = "👍" } if rule.SourceRule != nil { source = rule.SourceRule.RuleType } table.AddRow(eligibleApprover.Name, eligibleApprover.Username, approved, source) delete(approvedBy, eligibleApprover.Username) } for _, approver := range approvedBy { approved := "👍" table.AddRow(approver.Name, approver.Username, approved, "") } fmt.Println(table) } } else { cmdErr(cmd, args) } return nil } func init() { mrCmd.AddCommand(mrApproversCmd) }
28.390244
146
0.685137
b2fd53048e194cb59b5b4420a7e50d932868c531
1,878
py
Python
glance/rpc/common.py
Quinton/glance
7674bc8963a3bec21f719c48f40e8a3fc0846e6f
[ "Apache-2.0" ]
5
2017-04-23T05:50:36.000Z
2019-03-12T09:45:20.000Z
glance/rpc/common.py
Quinton/glance
7674bc8963a3bec21f719c48f40e8a3fc0846e6f
[ "Apache-2.0" ]
null
null
null
glance/rpc/common.py
Quinton/glance
7674bc8963a3bec21f719c48f40e8a3fc0846e6f
[ "Apache-2.0" ]
2
2018-08-16T11:41:18.000Z
2018-10-21T06:56:50.000Z
#!/usr/bin/env python #encode=utf-8 #vim: tabstop=4 shiftwidth=4 softtabstop=4 #Created on 2013-8-17 #Copyright 2013 nuoqingyun xuqifeng import copy import logging import traceback class RPCException(Exception): message = "An Unknown RPC related exception occurred" def __init__(self, message = None, **kwargs): self.kwargs = kwargs if not message: try: message = self.message % kwargs except Exception as e: message = self.message super(RPCException, self).__init__(message) class RemoteError(RPCException): message = "Remote error: %(exc_type)s %(value)s\n%(traceback)s" def __init__(self, exc_type = None, value = None, traceback = None): self.exc_type = exc_type self.value = value self.traceback = traceback super(RemoteError, self).__init__(exc_type = exc_type, value = value, traceback = traceback) class Timeout(RPCException): """ """ message = "Timeout while waiting on RPC response" class InvalidRPCConnectionReuse(RPCException): message = "Invalid reuse of an RPC Connection" class Connection(object): def close(self): raise NotImplementedError() def create_consumer(self, topic, proxy, fanout = False): raise NotImplementedError() def create_worker(self, topic, proxy, pool_name): raise NotImplementedError() def consumer_in_thread(self): raise NotImplementedError() def _sage_log(log_func, mes, msg_data): """ """ pass def serialize_remote_exception(failure_info): """ """ pass def deserialize_remote_exception(conf, data): """ """ pass
22.357143
73
0.596912
74cb0d2ada503995e9a95be11314c9ee76909a71
267
js
JavaScript
src/server/routes/operations/index.js
fakeAssBrian/abecms
febc3db8c0faee5373322a1ccdb2f059972b6854
[ "MIT" ]
27
2016-05-19T09:59:24.000Z
2017-10-10T07:41:16.000Z
src/server/routes/operations/index.js
fakeAssBrian/abecms
febc3db8c0faee5373322a1ccdb2f059972b6854
[ "MIT" ]
115
2016-09-30T14:33:36.000Z
2017-01-24T14:33:35.000Z
src/server/routes/operations/index.js
fakeAssBrian/abecms
febc3db8c0faee5373322a1ccdb2f059972b6854
[ "MIT" ]
7
2016-11-23T01:58:12.000Z
2017-04-30T23:30:28.000Z
import getUnpublish from './get/unpublish' import getDelete from './get/delete' import postSubmit from './post/submit' import postEdit from './post/edit' import postReject from './post/reject' export { postSubmit ,postEdit ,postReject ,getUnpublish ,getDelete }
20.538462
42
0.7603
f113dbe8c608a432ca21b1a70a59edbfc97f46be
762
asm
Assembly
oeis/309/A309322.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/309/A309322.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/309/A309322.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A309322: Expansion of Sum_{k>=1} phi(k) * x^k/(1 - x^k)^3, where phi = Euler totient function (A000010). ; Submitted by Christian Krause ; 1,4,8,15,19,35,34,56,63,86,76,141,103,157,182,212,169,294,208,355,335,359,298,556,405,490,522,657,463,865,526,816,773,812,856,1239,739,1003,1058,1424,901,1610,988,1525,1617,1445,1174,2188,1435,1960,1760,2091,1483,2529,1994,2660,2177,2258,1828,3689,1951,2569,3024,3184,2737,3760,2344,3487,3143,4163,2626,5040,2773,3622,4260,4317,3739,5165,3238,5668,4509,4424,3568,6915,4571,4855,4922,6236,4093,7896,5140,6241,5603,5777,5662,8640,4849,7042,7098,8455 add $0,1 mov $2,$0 mov $4,$0 lpb $0 lpb $4 mov $3,$2 gcd $3,$0 sub $4,1 lpe sub $0,1 add $1,$3 pow $3,2 add $1,$3 add $4,3 lpe mov $0,$1 div $0,2
34.636364
449
0.685039
3ba4c8cd331637d82b35af577e3a36bb72ed495d
1,539
swift
Swift
TestGitHub/Sources/Common/DateFormat.swift
olgavorona/TestGitHub
a17c64569a279409d1be001007f53ba951fa42b5
[ "MIT" ]
null
null
null
TestGitHub/Sources/Common/DateFormat.swift
olgavorona/TestGitHub
a17c64569a279409d1be001007f53ba951fa42b5
[ "MIT" ]
null
null
null
TestGitHub/Sources/Common/DateFormat.swift
olgavorona/TestGitHub
a17c64569a279409d1be001007f53ba951fa42b5
[ "MIT" ]
null
null
null
// // DateFormat.swift // TestGitHub // // Created by Olga Vorona on 23.12.2020. // import Foundation @objc public enum DateFormat: Int, CaseIterable, CustomStringConvertible { case standard case serverFull var value: String { switch self { case .serverFull: return "yyyy-MM-dd'T'HH:mm:ssZ" case .standard: return "dd.MM.yyyy" } } public var description: String { return value } } class CachedDateFormatter { private static let dispatchQueue = DispatchQueue(label: String(describing: CachedDateFormatter.self)) private static var formatters: [String: DateFormatter] = [:] static func formatDate(_ date: Date, with format: DateFormat) -> String { return fetchFormatter(format).string(from: date) } static func date(from stringDate: String, of format: DateFormat) -> Date? { return fetchFormatter(format).date(from: stringDate) } static func fetchFormatter(_ format: DateFormat) -> DateFormatter { return dispatchQueue.sync { let key = format.description if let formatter = formatters[key] { return formatter } else { let formatter = DateFormatter() formatter.timeZone = .current formatter.locale = .current formatter.dateFormat = format.value formatters[key] = formatter return formatter } } } }
26.084746
105
0.594542
f06a56919cbaa9b5814f0dd5b244fec4364f26b3
423
py
Python
python/arachne/runtime/rpc/logger.py
fixstars/arachne
03c00fc5105991d0d706b935d77e6f9255bae9e7
[ "MIT" ]
3
2022-03-29T03:02:20.000Z
2022-03-29T03:48:38.000Z
python/arachne/runtime/rpc/logger.py
fixstars/arachne
03c00fc5105991d0d706b935d77e6f9255bae9e7
[ "MIT" ]
null
null
null
python/arachne/runtime/rpc/logger.py
fixstars/arachne
03c00fc5105991d0d706b935d77e6f9255bae9e7
[ "MIT" ]
1
2022-03-29T05:44:12.000Z
2022-03-29T05:44:12.000Z
import logging class Logger(object): stream_handler = logging.StreamHandler() formatter = logging.Formatter("[%(levelname)s %(pathname)s:%(lineno)d] %(message)s") stream_handler.setFormatter(formatter) stream_handler.setLevel(logging.INFO) my_logger = logging.Logger("arachne.runtime.rpc") my_logger.addHandler(stream_handler) @staticmethod def logger(): return Logger.my_logger
26.4375
88
0.72104
6bb1d174c5868c55e7ae3c1c67a1fe581be08f21
718
h
C
updated_qcbits_afr/qcbits.h
antoniocgj/Optimized-implementation-of-QC-MDPC-code-based-cryptography
fe998ece9518e90511eb886ef3672f82baef0604
[ "CC0-1.0" ]
1
2020-08-03T01:45:00.000Z
2020-08-03T01:45:00.000Z
updated_qcbits_afr/qcbits.h
antoniocgj/Optimized-implementation-of-QC-MDPC-code-based-cryptography
fe998ece9518e90511eb886ef3672f82baef0604
[ "CC0-1.0" ]
null
null
null
updated_qcbits_afr/qcbits.h
antoniocgj/Optimized-implementation-of-QC-MDPC-code-based-cryptography
fe998ece9518e90511eb886ef3672f82baef0604
[ "CC0-1.0" ]
null
null
null
#include <x86intrin.h> #include <stdint.h> #include <math.h> /* Security parameters */ #define R 32749 #define W 274 #define T 264 /* Implementation parameters */ #define word_t __m512i #define index_t uint16_t #define R_WORDS 64 #define HWPA 47 #define M_MAX 512 int generate_keys(word_t * public_key, index_t private_key_rel[2][W/2 + HWPA], index_t private_key_transposed[2][W/2]); void encrypt(word_t * public_key, word_t dense_symmetric_key[2][R_WORDS], word_t * ciphertext); int decrypt(index_t private_key_rel[2][W/2 + HWPA], index_t private_key_transposed[2][W/2], word_t * ciphertext, word_t * dense_symmetric_key); extern void generate_random_bytes(uint64_t, uint8_t *);
28.72
95
0.731198
7093cf8fe7253d948a35251d5de2adf279dc3f7d
186
go
Go
encoding/pb/pong.go
theredrad/udpsocket
a1387dc2887062416585d90045d73eb044001862
[ "MIT" ]
4
2021-08-28T03:44:33.000Z
2022-01-13T11:17:52.000Z
encoding/pb/pong.go
theredrad/udpsocket
a1387dc2887062416585d90045d73eb044001862
[ "MIT" ]
null
null
null
encoding/pb/pong.go
theredrad/udpsocket
a1387dc2887062416585d90045d73eb044001862
[ "MIT" ]
null
null
null
package pb func (p *Pong) SetPingSentAt(t int64) { p.PingSentAt = t } func (p *Pong) SetReceivedAt(t int64) { p.ReceivedAt = t } func (p *Pong) SetSentAt(t int64) { p.SentAt = t }
13.285714
39
0.650538
36c8ea0f1262928cc13e502ca206f68479896d92
3,970
asm
Assembly
defines.asm
StraDaMa/mmbn6-pikachu-boss-battle
0bc38a6a83c3971541bf20ed55583df3ab357a90
[ "MIT" ]
7
2021-04-04T13:38:05.000Z
2022-03-31T01:33:46.000Z
defines.asm
StraDaMa/mmbn6-pikachu-boss-battle
0bc38a6a83c3971541bf20ed55583df3ab357a90
[ "MIT" ]
null
null
null
defines.asm
StraDaMa/mmbn6-pikachu-boss-battle
0bc38a6a83c3971541bf20ed55583df3ab357a90
[ "MIT" ]
1
2021-10-02T23:15:01.000Z
2021-10-02T23:15:01.000Z
.vdefinelabel sfx_play, 0x080005CC, 0x080005CC .vdefinelabel memory_zero8, 0x080008B4, 0x080008B4 .vdefinelabel memory_copy8, 0x08000920, 0x08000920 .vdefinelabel list_shuffle_byte, 0x08000C72, 0x08000C72 .vdefinelabel math_get_thow_speeds, 0x08001330, 0x08001330 .vdefinelabel rng1_get_int, 0x08001532, 0x08001532 .vdefinelabel sprite_load_animation_data, 0x080026A4, 0x080026A4 .vdefinelabel sprite_load, 0x080026E4, 0x080026E4 .vdefinelabel sprite_decompress, 0x08002A64, 0x08002A64 .vdefinelabel sprite_set_animation, 0x08002DA4, 0x08002DA4 .vdefinelabel sprite_has_shadow, 0x08002E3C, 0x08002E3C .vdefinelabel sprite_set_color_shader, 0x08002ED0, 0x08002ED0 .vdefinelabel sprite_set_flip, 0x08002F5C, 0x08002F5C .vdefinelabel sprite_no_shadow, 0x08002F90, 0x08002F90 .vdefinelabel object_type1_allocate, 0x08003320, 0x08003320 .vdefinelabel ow_begin_battle, 0x08005BC8, 0x08005B98 .vdefinelabel screen_transition_begin, 0x08006270, 0x08006264 .vdefinelabel object_crack_panel, 0x0800C938, 0x0800CF54 .vdefinelabel object_highlight_panel, 0x0800CBD8, 0x0800D1F4 .vdefinelabel object_is_current_panel_valid, 0x0800CC66, 0x0800D282 .vdefinelabel object_check_panel_parameters, 0x0800CC86, 0x0800D2A2 .vdefinelabel object_is_current_panel_solid, 0x0800CCA6, 0x0800D2C2 .vdefinelabel object_is_panel_solid, 0x0800CCB2, 0x0800D2CE .vdefinelabel object_highlight_current_collision_panels, 0x0800CCBE, 0x0800D2DA .vdefinelabel object_highlight_panel_region, 0x0800CCD4, 0x0800D2F0 .vdefinelabel object_get_panels_except_current_filtered, 0x0800CE64, 0x0800D480 .vdefinelabel object_get_panels_filtered, 0x0800CEA0, 0x0800D4BC .vdefinelabel object_get_panels_in_row_filtered, 0x0800D012, 0x0800D62E .vdefinelabel object_get_panel_region, 0x0800D3FE, 0x0800DA1A .vdefinelabel object_get_coordinates_for_panels, 0x0800E276, 0x0800E892 .vdefinelabel object_set_coordinates_from_panels, 0x0800E29C, 0x0800E8B8 .vdefinelabel object_set_panels_from_coordinates, 0x0800E2AC, 0x0800E8C8 .vdefinelabel object_get_front_direction, 0x0800E2CA, 0x0800E8E6 .vdefinelabel object_get_flip_direction, 0x0800E2CE, 0x0800E8EA .vdefinelabel object_get_flip, 0x0800E456, 0x0800EA72 .vdefinelabel object_can_move, 0x0800E5E2, 0x0800EBFE .vdefinelabel object_set_counter_time, 0x0800E9DC, 0x0800EFF8 .vdefinelabel object_set_invulnerable_time, 0x0800EAFA, 0x0800F116 .vdefinelabel object_clear_invulnerable_time, 0x0800EB08, 0x0800F124 .vdefinelabel object_set_default_counter_time, 0x0800FDB6, 0x080103BE .vdefinelabel battle_find_player, 0x080103BC, 0x080109C4 .vdefinelabel object_setattack0, 0x08011680, 0x08011C90 .vdefinelabel object_exit_attack_state, 0x08011714, 0x08011D24 .vdefinelabel object_generic_destroy, 0x08016C8A, 0x0801721A .vdefinelabel object_update_collision_panels, 0x0801A04C, 0x0801A5CC .vdefinelabel object_clear_collision_region, 0x0801A074, 0x0801A5F4 .vdefinelabel object_set_collision_region, 0x0801A07C, 0x0801A5FC .vdefinelabel object_update_collision_data, 0x0801A082, 0x0801A602 .vdefinelabel object_set_flag, 0x0801A152, 0x0801A6D2 .vdefinelabel object_clear_flag, 0x0801A15C, 0x0801A6DC .vdefinelabel object_reserve_panel, 0x0801BB1C, 0x0801BF38 .vdefinelabel object_remove_panel_reserve, 0x0801BB46, 0x0801BF62 .vdefinelabel object_update_sprite_timestop, 0x0801BBF4, 0x0801C010 .vdefinelabel camera_shake, 0x080302A8, 0x08031264 .vdefinelabel temp_attack_object_spawn, 0x080B8E30, 0x080BAEC0 .vdefinelabel collision_region_spawn, 0x080C536A, 0x080C82BC .vdefinelabel collision_region_spawn_timefreeze, 0x080C53A6, 0x080C82FA .vdefinelabel thunderbolt_object_spawn, 0x080C7D50, 0x080CB650 .vdefinelabel thunderball_object_spawn, 0x080C954C, 0x080CCE4C .vdefinelabel diveman_wave_object_spawn, 0x080CB1E2, 0x080CEAD6 .vdefinelabel effect_object_spawn, 0x080E05F6, 0x080E3E5E .vdefinelabel illusion_object_spawn, 0x080E33FA, 0x080E7FD2 .vdefinelabel illusion_object_no_flicker, 0x080E3422, 0x080E7FFA .vdefinelabel judgeman_choose_panel, 0x080FCCBC, 0x08102678
61.076923
79
0.887154
f03ec3c4956c525ef5f08afb19c69e5ad237499d
1,134
js
JavaScript
gulp/core/utils/webpackLogStats.js
adamwoodnz/bikeparks-js-dev
5a6092d3c09b5dc0acbe0788e2150a122bcdc09b
[ "MIT" ]
392
2015-09-18T20:29:36.000Z
2022-03-30T04:17:19.000Z
gulp/core/utils/webpackLogStats.js
adamwoodnz/bikeparks-js-dev
5a6092d3c09b5dc0acbe0788e2150a122bcdc09b
[ "MIT" ]
48
2015-09-23T14:28:28.000Z
2019-07-01T04:08:42.000Z
gulp/core/utils/webpackLogStats.js
adamwoodnz/bikeparks-js-dev
5a6092d3c09b5dc0acbe0788e2150a122bcdc09b
[ "MIT" ]
103
2015-11-02T12:28:06.000Z
2021-12-18T11:11:19.000Z
var gutil = require('gulp-util'); var callingDone = false; var defaultStatsOptions = { colors: gutil.colors.supportsColor, hash: false, timings: false, chunks: false, chunkModules: false, modules: false, children: true, version: true, cached: false, cachedAssets: false, reasons: false, source: false, errorDetails: false, }; /** * Output stats to console for webpack * * @param err * @param stats * @param options */ module.exports = function (err, stats, options) { stats = stats || {}; options = options || {}; if (options.quiet || callingDone) { return; } // Debounce output a little for when in watch mode if (options.watch) { callingDone = true; setTimeout(function () { callingDone = false; }, 500); } if (options.verbose) { gutil.log(stats.toString({ colors: gutil.colors.supportsColor })); } else { var statsOptions = options && options.stats || {}; Object.keys(defaultStatsOptions).forEach(function (key) { if (typeof statsOptions[key] === 'undefined') { statsOptions[key] = defaultStatsOptions[key]; } }); gutil.log(stats.toString(statsOptions)); } };
19.551724
59
0.666667
477fce55d6dc90cd55ffb087c70eaceaeb43a7ee
1,102
html
HTML
Extracted/84.html
Augustpan/WHO_disease_outbreak_news
b26b4fd81e394fb2d3ee2e847b51989d97b99e5f
[ "MIT" ]
null
null
null
Extracted/84.html
Augustpan/WHO_disease_outbreak_news
b26b4fd81e394fb2d3ee2e847b51989d97b99e5f
[ "MIT" ]
null
null
null
Extracted/84.html
Augustpan/WHO_disease_outbreak_news
b26b4fd81e394fb2d3ee2e847b51989d97b99e5f
[ "MIT" ]
null
null
null
<div id="primary"> <h1 class="headline">1996 - Cerebrospinal meningitis in Africa (summary) - Update 2</h1> <p> <span><b>27 March 1996</b> <br/><br/><b>Disease Outbreak Reported</b></span></p> <p> <span>In a recent report from the WHO Office for the African Region the accumulated number of cases of meningitis had increased to 51 541 with 6 504 deaths (case fatality rate 12.6%). The increase was largely from the over 9 000 additional cases reported in Nigeria. More than 4 000 of them were new cases reported in the past week. Major increases were also reported in Burkina Faso, Mali, and Togo.</span></p> <p> <span>The following number of cases (deaths) have been reported in: </span></p> <p> <span>Benin: 424 (56); Burkina Faso: 11 866 (1 064); Cameroon: 5 (1); Central African Republic: 155 (22); Chad: 505 (53); Ghana: 18 (0); Mali: 1 404 (227); Niger: 6 518 (676); Nigeria: 30 212 (4 346); Tanzania: 99(8); Togo: 505 (53), Zaire: 69 (5). No cases have been reported in Burundi, Côte d'Ivoire, Eritrea, Mauritania, and Senegal.</span></p> <div class="clear"><!-- all clear --></div> </div>
58
95
0.699637
b159ab841a197350044f573b8bef7000f6df7217
4,710
h
C
Sources_Common/Calendar_Store/Clients/CCalendarClient.h
mulberry-mail/mulberry4-client
cdaae15c51dd759110b4fbdb2063d0e3d5202103
[ "ECL-2.0", "Apache-2.0" ]
5
2015-03-23T13:45:09.000Z
2021-11-06T08:37:42.000Z
Sources_Common/Calendar_Store/Clients/CCalendarClient.h
mulberry-mail/mulberry4-client
cdaae15c51dd759110b4fbdb2063d0e3d5202103
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
Sources_Common/Calendar_Store/Clients/CCalendarClient.h
mulberry-mail/mulberry4-client
cdaae15c51dd759110b4fbdb2063d0e3d5202103
[ "ECL-2.0", "Apache-2.0" ]
2
2021-03-27T09:10:59.000Z
2022-01-19T12:12:48.000Z
/* Copyright (c) 2007 Cyrus Daboo. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* CCalendarClient.h Author: Description: abstract base class for a calendar store 'driver' */ #ifndef CCalendarClient_H #define CCalendarClient_H #include "CINETClient.h" #include "CCalendarProtocol.h" #include "CITIPScheduleResults.h" #include "cdstring.h" namespace iCal { class CICalendar; } namespace calstore { class CCalendarStoreNode; class CCalendarClient : public CINETClient { public: CCalendarClient(CCalendarProtocol* owner) : CINETClient(owner) {} CCalendarClient(const CCalendarClient& copy, CCalendarProtocol* owner) : CINETClient(copy, owner) {} virtual ~CCalendarClient() {} virtual void _ListCalendars(CCalendarStoreNode* root) = 0; virtual void _CreateCalendar(const CCalendarStoreNode& node) = 0; virtual void _DeleteCalendar(const CCalendarStoreNode& node) = 0; virtual void _RenameCalendar(const CCalendarStoreNode& node, const cdstring& node_new) = 0; virtual bool _TestCalendar(const CCalendarStoreNode& node) = 0; virtual bool _TouchCalendar(const CCalendarStoreNode& node) = 0; virtual void _LockCalendar(const CCalendarStoreNode& node, iCal::CICalendar& cal) = 0; virtual void _UnlockCalendar(const CCalendarStoreNode& node, iCal::CICalendar& cal) = 0; virtual bool _CheckCalendar(const CCalendarStoreNode& node, iCal::CICalendar& cal) = 0; virtual bool _CalendarChanged(const CCalendarStoreNode& node, iCal::CICalendar& cal) = 0; virtual void _UpdateSyncToken(const CCalendarStoreNode& node, iCal::CICalendar& cal) = 0; virtual void _SizeCalendar(CCalendarStoreNode& node) = 0; virtual void _ReadFullCalendar(const CCalendarStoreNode& node, iCal::CICalendar& cal, bool if_changed=false) = 0; virtual void _WriteFullCalendar(const CCalendarStoreNode& node, iCal::CICalendar& cal) = 0; virtual bool _CanUseComponents() const = 0; virtual void _TestFastSync(const CCalendarStoreNode& node) = 0; virtual void _FastSync(const CCalendarStoreNode& node, iCal::CICalendar& cal, cdstrmap& changed, cdstrset& removed, cdstring& synctoken) = 0; virtual void _GetComponentInfo(const CCalendarStoreNode& node, iCal::CICalendar& cal, cdstrmap& comps) = 0; virtual void _AddComponent(const CCalendarStoreNode& node, iCal::CICalendar& cal, const iCal::CICalendarComponent& component) = 0; virtual void _ChangeComponent(const CCalendarStoreNode& node, iCal::CICalendar& cal, const iCal::CICalendarComponent& component) = 0; virtual void _RemoveComponent(const CCalendarStoreNode& node, iCal::CICalendar& cal, const iCal::CICalendarComponent& component) = 0; virtual void _RemoveComponent(const CCalendarStoreNode& node, iCal::CICalendar& cal, const cdstring& rurl) = 0; virtual void _ReadComponents(const CCalendarStoreNode& node, iCal::CICalendar& cal, const cdstrvect& rurls) = 0; virtual iCal::CICalendarComponent* _ReadComponent(const CCalendarStoreNode& node, iCal::CICalendar& cal, const cdstring& rurl) = 0; // ACL related virtual void _SetACL(CCalendarStoreNode& node, CACL* acl) = 0; // Set acl on server virtual void _DeleteACL(CCalendarStoreNode& node, CACL* acl) = 0; // Delete acl on server virtual void _GetACL(CCalendarStoreNode& node) = 0; // Get all acls for calendar from server virtual void _ListRights(CCalendarStoreNode& node, CACL* acl) = 0; // Get allowed rights for user virtual void _MyRights(CCalendarStoreNode& node) = 0; // Get current user's rights to calendar // Schedule related virtual void _GetScheduleInboxOutbox(const CCalendarStoreNode& node, cdstring& inboxURI, cdstring& outboxURI) = 0; virtual void _Schedule(const cdstring& outboxURI, const cdstring& originator, const cdstrvect& recipients, const iCal::CICalendar& cal, iCal::CITIPScheduleResultsList& results) = 0; virtual void _GetFreeBusyCalendars(cdstrvect& calendars) = 0; virtual void _SetFreeBusyCalendars(const cdstrvect& calendars) = 0; protected: CCalendarProtocol* GetCalendarProtocol() const // Return type-cast owner { return static_cast<CCalendarProtocol*>(mOwner); } }; } // namespace calstore #endif // CCalendarClient_H
44.857143
142
0.764331
55e6aef421b51593e12dde5155fa69866418dc70
1,078
swift
Swift
swift-leetcode/Array/81.swift
qyz777/swift-leetcode
d7b916ee12c396decb65cb5d9418274138fad8b3
[ "MIT" ]
15
2019-05-11T05:25:24.000Z
2021-08-01T03:50:05.000Z
swift-leetcode/Array/81.swift
qyz777/swift-leetcode
d7b916ee12c396decb65cb5d9418274138fad8b3
[ "MIT" ]
null
null
null
swift-leetcode/Array/81.swift
qyz777/swift-leetcode
d7b916ee12c396decb65cb5d9418274138fad8b3
[ "MIT" ]
3
2019-05-11T12:16:32.000Z
2019-11-28T12:57:42.000Z
// // 81.swift // swift-leetcode // // Created by Q YiZhong on 2019/7/23. // Copyright © 2019 YiZhong Qi. All rights reserved. // import Foundation /** 参考https://leetcode-cn.com/problems/search-in-rotated-sorted-array-ii/solution/er-fen-by-powcai/ */ func search_2(_ nums: [Int], _ target: Int) -> Bool { guard nums.count > 0 else { return false } var left = 0 var right = nums.count - 1 while left <= right { let mid = (left + right) / 2 if nums[mid] == target { return true } if nums[left] == nums[mid] && nums[mid] == nums[right] { left += 1 right -= 1 } else if nums[left] <= nums[mid] { if nums[left] <= target && target < nums[mid] { right = mid - 1 } else { left = mid + 1 } } else { if nums[mid] < target && target <= nums[right] { left = mid + 1 } else { right = mid - 1 } } } return false }
22.93617
96
0.467532
3c325bc69f7463703bb78065d89f111399189ba6
947
asm
Assembly
l3337 codes/x.asm/music.asm
pankace/SICP-robably
765f516f253e96ae2c8e433722ea7cefd31b2f04
[ "MIT" ]
null
null
null
l3337 codes/x.asm/music.asm
pankace/SICP-robably
765f516f253e96ae2c8e433722ea7cefd31b2f04
[ "MIT" ]
null
null
null
l3337 codes/x.asm/music.asm
pankace/SICP-robably
765f516f253e96ae2c8e433722ea7cefd31b2f04
[ "MIT" ]
null
null
null
beep_sound: mov al, 182 ; Prep speaker out 0x43, al ; note to play mov ax, cx ; Frec of note ; for midddle C. out 0x42, al ; Output low byte mov al, ah ; Output high byte out 0x42, al in al, 0x61 ; Turn on note ; Port 61h for speaker or al, 00000011b ; bits 0 to 1 out 0x61, al mov bx, 25 ; kill after note .pause1: mov cx, 65535 .pause2: dec cx jne .pause2 dec bx jne .pause1 in al, 0x61 ; kill note on port 61 and al, 11111100b ; kill bits 1 to 0 out 0x61, al ; Send value
33.821429
63
0.349525
d843f2dccc44721c0459c0063f0457fad16f0a76
2,795
lua
Lua
src/apiset/core_string_l1_1_0.lua
CoderAldrich/TINN
f4e2555fe49261285ff0db79fdd932bb708f530a
[ "MS-PL" ]
70
2015-02-02T02:32:42.000Z
2022-01-18T15:17:58.000Z
src/apiset/core_string_l1_1_0.lua
CoderAldrich/TINN
f4e2555fe49261285ff0db79fdd932bb708f530a
[ "MS-PL" ]
1
2019-06-04T13:46:20.000Z
2019-06-06T04:34:27.000Z
src/apiset/core_string_l1_1_0.lua
CoderAldrich/TINN
f4e2555fe49261285ff0db79fdd932bb708f530a
[ "MS-PL" ]
12
2015-05-22T05:23:17.000Z
2021-02-17T11:50:21.000Z
-- core_string_l1_1_0.lua -- api-ms-win-core-string-l1-1-0.dll local ffi = require("ffi"); local k32Lib = ffi.load("kernel32") local WTypes = require("WTypes"); ffi.cdef[[ static const int CP_ACP = 0; // default to ANSI code page static const int CP_OEMCP = 1; // default to OEM code page static const int CP_MACCP = 2; // default to MAC code page static const int CP_THREAD_ACP = 3; // current thread's ANSI code page static const int CP_SYMBOL = 42; // SYMBOL translations ]] ffi.cdef[[ int MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, LPWSTR lpWideCharStr, int cchWideChar); int WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar); ]] local function toUnicode(in_Src, nsrcBytes) if in_Src == nil then return nil; end nsrcBytes = nsrcBytes or #in_Src -- find out how many characters needed local charsneeded = k32Lib.MultiByteToWideChar(ffi.C.CP_ACP, 0, ffi.cast("const char *",in_Src), nsrcBytes, nil, 0); if charsneeded < 0 then return nil; end local buff = ffi.new("uint16_t[?]", charsneeded+1) local charswritten = k32Lib.MultiByteToWideChar(ffi.C.CP_ACP, 0, in_Src, nsrcBytes, buff, charsneeded) buff[charswritten] = 0 return buff, charswritten; end local function toAnsi(in_Src, nsrcBytes) if in_Src == nil then return nil; end local cchWideChar = nsrcBytes or -1; -- find out how many characters needed local bytesneeded = k32Lib.WideCharToMultiByte( ffi.C.CP_ACP, 0, ffi.cast("const uint16_t *", in_Src), cchWideChar, nil, 0, nil, nil); --print("BN: ", bytesneeded); if bytesneeded <= 0 then return nil; end -- create a buffer to stuff the converted string into local buff = ffi.new("uint8_t[?]", bytesneeded) -- do the actual string conversion local byteswritten = k32Lib.WideCharToMultiByte( ffi.C.CP_ACP, 0, ffi.cast("const uint16_t *", in_Src), cchWideChar, buff, bytesneeded, nil, nil); if cchWideChar == -1 then return ffi.string(buff, byteswritten-1); end return ffi.string(buff, byteswritten) end local TEXT = function (quote) if UNICODE then return toUnicode(quote); else return quote; end end return { Lib = k32Lib, toUnicode = toUnicode, toAnsi = toAnsi, --CompareStringEx = k32Lib.CompareStringEx, --CompareStringOrdinal = k32Lib.CompareStringOrdinal, --CompareStringW = k32Lib.CompareStringW, --FoldStringW = k32Lib.FoldStringW, --GetStringTypeExW = k32Lib.GetStringTypeExW, --GetStringTypeW = k32Lib.GetStringTypeW, MultiByteToWideChar = k32Lib.MultiByteToWideChar, WideCharToMultiByte = k32Lib.WideCharToMultiByte, }
22.18254
117
0.718784
9f3207e809cd7902d4ba75d6f15d5614fe8986e3
1,934
lua
Lua
priest/priest_buff.lua
palfibeni/KerAzsMB
94a2b526d49bfefab675a48ab681aadd93a4228c
[ "MIT" ]
5
2020-02-14T11:51:40.000Z
2021-01-20T06:26:38.000Z
priest/priest_buff.lua
palfibeni/KerAzsMB
94a2b526d49bfefab675a48ab681aadd93a4228c
[ "MIT" ]
null
null
null
priest/priest_buff.lua
palfibeni/KerAzsMB
94a2b526d49bfefab675a48ab681aadd93a4228c
[ "MIT" ]
null
null
null
function priestRaidBuff() holyFire() buffTargetList("Spell_Holy_PrayerofSpirit", "Prayer of Spirit") buffTargetList("Spell_Holy_PrayerOfFortitude", "Prayer of Fortitude") end function priestSmallBuff() holyFire() buffTargetList("Spell_Holy_WordFortitude", "Power Word: Fortitude") end function holyFire() cast_buff_player("Spell_Holy_InnerFire", "Inner Fire") end function fearWard(playerName) if GetSpellCooldownByName("Fear Ward") ~= 0 then return end playerName = playerName or UnitName("target") if not azs.targetList[playerName] then return end for target,info in pairs(azs.targetList[playerName]) do castBuff("Spell_Holy_Excorcism", "Fear Ward", target) end end function powerInfusion() if GetSpellCooldownByName("Power Infusion") ~= 0 then return end if not IsActionReady(powerInfusionActionSlot) then return end if UnitExists("targettarget") and UnitIsFriend("player","targettarget") then if isTargetHpOver(0.7) then return end if castPowerInfusionOnMageInList(azs.targetList.dps) then return true end if castPowerInfusionOnMageInList(azs.targetList.multidps) then return true end end return false end function castPowerInfusionOnMageInList(targetList) for target,info in pairs(targetList) do if info.class == "MAGE" then if castPowerInfusion(info.name) then return true end end end return false end function castPowerInfusion(playerName) playerName = playerName or UnitName("target") if not azs.targetList[playerName] then return end for target,info in pairs(azs.targetList[playerName]) do CastSpellByName("Power Infusion") if IsValidSpellTarget(target) then SpellStopTargeting() SendChatMessage("Power infusion on " .. playerName .. "!", "YELL") castBuff("Spell_Holy_PowerInfusion", "Power Infusion", target) return true end end SpellStopTargeting() return false end
31.193548
81
0.74819
c332ba9d7daaab40f2be935e2f7e0d9e0776c532
3,837
go
Go
internal/dynatrace/security_problems_client.go
philconst/dynatrace-service
f977314d5d2434837ea9e7f9b009bf827f3855d2
[ "Apache-2.0" ]
14
2019-12-19T21:27:00.000Z
2022-03-09T13:21:47.000Z
internal/dynatrace/security_problems_client.go
philconst/dynatrace-service
f977314d5d2434837ea9e7f9b009bf827f3855d2
[ "Apache-2.0" ]
554
2019-08-14T07:03:51.000Z
2022-03-31T14:07:15.000Z
internal/dynatrace/security_problems_client.go
philconst/dynatrace-service
f977314d5d2434837ea9e7f9b009bf827f3855d2
[ "Apache-2.0" ]
7
2019-09-19T20:00:54.000Z
2021-09-23T12:53:53.000Z
package dynatrace import ( "encoding/json" "fmt" "github.com/keptn-contrib/dynatrace-service/internal/common" "time" ) const securityProblemsPath = "/api/v2/securityProblems" // SecurityProblemQueryResult Result of/api/v2/securityProblems type SecurityProblemQueryResult struct { TotalCount int `json:"totalCount"` PageSize int `json:"pageSize"` NextPageKey string `json:"nextPageKey"` SecurityProblems []SecurityProblem `json:"securityProblems"` } // SecurityProblem Problem Detail returned by /api/v2/securityProblems type SecurityProblem struct { SecurityProblemID string `json:"securityProblemId"` DisplayID int `json:"displayId"` State string `json:"state"` VulnerabilityID string `json:"vulnerabilityId"` VulnerabilityType string `json:"vulnerabilityType"` FirstSeenTimestamp int `json:"firstSeenTimestamp"` LastUpdatedTimestamp int `json:"lastUpdatedTimestamp"` RiskAssessment struct { RiskCategory string `json:"riskCategory"` RiskScore struct { Value int `json:"value"` } `json:"riskScore"` Exposed bool `json:"exposed"` SensitiveDataAffected bool `json:"sensitiveDataAffected"` PublicExploitAvailable bool `json:"publicExploitAvailable"` } `json:"riskAssessment"` ManagementZones []string `json:"managementZones"` VulnerableComponents []struct { ID string `json:"id"` DisplayName string `json:"displayName"` FileName string `json:"fileName"` NumberOfVulnerableProcesses int `json:"numberOfVulnerableProcesses"` VulnerableProcesses []string `json:"vulnerableProcesses"` } `json:"vulnerableComponents"` VulnerableEntities []string `json:"vulnerableEntities"` ExposedEntities []string `json:"exposedEntities"` SensitiveDataAssets []string `json:"sensitiveDataAssets"` AffectedEntities struct { Applications []struct { ID string `json:"id"` NumberOfVulnerableProcesses int `json:"numberOfVulnerableProcesses"` VulnerableProcesses []string `json:"vulnerableProcesses"` } `json:"applications"` Services []struct { ID string `json:"id"` NumberOfVulnerableProcesses int `json:"numberOfVulnerableProcesses"` VulnerableProcesses []string `json:"vulnerableProcesses"` } `json:"services"` Hosts []struct { ID string `json:"id"` NumberOfVulnerableProcesses int `json:"numberOfVulnerableProcesses"` VulnerableProcesses []string `json:"vulnerableProcesses"` } `json:"hosts"` Databases []string `json:"databases"` } `json:"affectedEntities"` } // SecurityProblemsClient is a client for interacting with the Dynatrace security problems endpoints type SecurityProblemsClient struct { client ClientInterface } // NewSecurityProblemsClient creates a new SecurityProblemsClient func NewSecurityProblemsClient(client ClientInterface) *SecurityProblemsClient { return &SecurityProblemsClient{ client: client, } } // GetByQuery Calls the Dynatrace API to retrieve the list of security problems for that timeframe. // It returns a SecurityProblemQueryResult object on success, an error otherwise. func (sc *SecurityProblemsClient) GetByQuery(problemQuery string, startUnix time.Time, endUnix time.Time) (*SecurityProblemQueryResult, error) { body, err := sc.client.Get( fmt.Sprintf("%s?from=%s&to=%s&%s", securityProblemsPath, common.TimestampToString(startUnix), common.TimestampToString(endUnix), problemQuery)) if err != nil { return nil, err } var result SecurityProblemQueryResult err = json.Unmarshal(body, &result) if err != nil { return nil, err } return &result, nil }
37.617647
144
0.703154
18a59f6def6a0dde48fcab08a9337efffb003f1e
1,503
css
CSS
css/flexModal.css
paceaux/flex-modal
ce179f69923311c9f2728747c87431ac464a6dd4
[ "MIT" ]
1
2016-05-03T19:56:51.000Z
2016-05-03T19:56:51.000Z
css/flexModal.css
paceaux/flex-modal
ce179f69923311c9f2728747c87431ac464a6dd4
[ "MIT" ]
null
null
null
css/flexModal.css
paceaux/flex-modal
ce179f69923311c9f2728747c87431ac464a6dd4
[ "MIT" ]
null
null
null
.modal__overlay{ display:none; position:fixed; z-index:9998; top:0; left:0; height:100%; width:100%; background:#000 } #modal__container{ display: none } .modal__container{ display: none; color: #333; padding:15px; border:1px solid #1a3d6e; border-radius: 4px; margin: 0; background:#f9f9f9; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); } .modal__header{ font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; margin: 0; padding:0; } .modal__content{ max-height:500px; overflow-x:hidden; overflow-y:auto; } .modal__content--hasIframe{ overflow-y:visible; max-height:inherit } .modal__content__iframe{ width:98%; margin:.618em auto } .modal__content > { margin:.618em auto } #modal__close, .modal__close, #modal__close.modal__close{ display:block; float:right; position:relative; top:-24px; left:24px; text-decoration: none; text-align: center; color:#193d63; font-weight:bold; line-height: 1.8; padding:.25em; width:36px; height:36px; border-radius:50%; background:white !important; background-position:-265px -19px; background-repeat:no-repeat; overflow:hidden; } #modal__close.modal__close:hover, #modal__close.modal__close:focus, #modal__close.modal__close:active{ color:#193d63; text-decoration:none; background-color: none !important ; background-image:url('/img/fancybox_sprite.png') !important; background-position:-265px -59px; background-repeat:no-repeat; overflow:hidden } .modal__close:active{ box-shadow:none}
18.7875
68
0.734531
5836c7870fffeedaa3e7cad849c9ae1d553024bb
7,755
c
C
components/freertos_plus_io/src/secure_device.c
chinglee-iot/device-software-for-aws-connected-mobility-solution
6cd76196d25ad5a1abc1731d9b48f81cbde242d0
[ "MIT-0" ]
null
null
null
components/freertos_plus_io/src/secure_device.c
chinglee-iot/device-software-for-aws-connected-mobility-solution
6cd76196d25ad5a1abc1731d9b48f81cbde242d0
[ "MIT-0" ]
null
null
null
components/freertos_plus_io/src/secure_device.c
chinglee-iot/device-software-for-aws-connected-mobility-solution
6cd76196d25ad5a1abc1731d9b48f81cbde242d0
[ "MIT-0" ]
1
2022-01-18T09:57:57.000Z
2022-01-18T09:57:57.000Z
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: MIT-0 * * 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. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * @file secure_device.c * @brief Implementation of functions to access secure device io. */ #include <string.h> #include "FreeRTOS.h" #include "FreeRTOS_IO.h" #include "FreeRTOS_DriverInterface.h" #include "secure_device.h" #include "cJSON.h" /*-----------------------------------------------------------*/ #define OBD_VIN_MAX_LENGTH (32) #define DEMO_CONFIG_FILE_PATH CONFIG_FS_MOUNT_POINT "/cms_demo_config.json" /*-----------------------------------------------------------*/ extern const uint8_t root_cert_auth_pem_start[] asm("_binary_root_cert_auth_pem_start"); extern const uint8_t root_cert_auth_pem_end[] asm("_binary_root_cert_auth_pem_end"); extern const uint8_t client_cert_pem_start[] asm("_binary_client_crt_start"); extern const uint8_t client_cert_pem_end[] asm("_binary_client_crt_end"); extern const uint8_t client_key_pem_start[] asm("_binary_client_key_start"); extern const uint8_t client_key_pem_end[] asm("_binary_client_key_end"); /*-----------------------------------------------------------*/ static const char client_id[] = CONFIG_MQTT_CLIENT_IDENTIFIER; static const char broker_endpoint[] = CONFIG_MQTT_BROKER_ENDPOINT; static char cms_vin[OBD_VIN_MAX_LENGTH] = CONFIG_CMS_VIN; static Peripheral_Descriptor_t Secure_Open( const int8_t * pcPath, const uint32_t ulFlags ); static BaseType_t Secure_Ioctl( Peripheral_Descriptor_t const xPeripheral, uint32_t ulRequest, void * pvValue ); Peripheral_device_t gSecureDevice = { "/dev/secure", Secure_Open, NULL, /* Empty Write function. */ NULL, /* Empty Read function. */ Secure_Ioctl, NULL }; /*-----------------------------------------------------------*/ static bool prvReadVin( void ) { bool retKvsConfg = true; cJSON * pJson = NULL; cJSON * pSub = NULL; FILE * fp = NULL; size_t sz = 0, readSz = 0; char * pConfigBuffer = NULL; /* Check if file exist. */ fp = fopen( DEMO_CONFIG_FILE_PATH, "rb" ); if( fp == NULL ) { printf( "Open %s failed\n", DEMO_CONFIG_FILE_PATH ); retKvsConfg = false; } else { fseek( fp, 0L, SEEK_END ); sz = ftell( fp ); fseek( fp, 0L, SEEK_SET ); printf( "Open %s size %d\n", DEMO_CONFIG_FILE_PATH, sz ); pConfigBuffer = malloc( sz ); if( pConfigBuffer == NULL ) { printf( "Malloc buffer size %d failed\n", sz ); retKvsConfg = false; } else { readSz = fread( pConfigBuffer, 1, sz, fp ); if( readSz != sz ) { printf( "Read file failed\n" ); retKvsConfg = false; } } fclose( fp ); } /* Parse VIN. */ if( retKvsConfg == true ) { pJson = cJSON_Parse( pConfigBuffer ); if( pJson == NULL ) { printf( "cJSON_Parse failed\n" ); } else { pSub = cJSON_GetObjectItem( pJson, "VIN" ); if( pSub == NULL ) { printf( "cJSON_GetObjectItem VIN failed use config\n" ); } else { printf( "VIN : %s\n", pSub->valuestring ); strncpy( cms_vin, pSub->valuestring, OBD_VIN_MAX_LENGTH ); } } } if( pJson != NULL ) { cJSON_Delete( pJson ); } if( pConfigBuffer != NULL ) { free( pConfigBuffer ); } return retKvsConfg; } Peripheral_Descriptor_t Secure_Open( const int8_t * pcPath, const uint32_t ulFlags ) { // Initialize VIN #ifdef CONFIG_FILE_SYSTEM_ENABLE prvReadVin(); #endif Peripheral_Descriptor_t retDesc = NULL; retDesc = ( Peripheral_Descriptor_t ) &gSecureDevice; return retDesc; } /*-----------------------------------------------------------*/ BaseType_t Secure_Ioctl( Peripheral_Descriptor_t const pxPeripheral, uint32_t ulRequest, void * pvValue ) { Peripheral_device_t * pDevice = ( Peripheral_device_t * ) pxPeripheral; BaseType_t retValue = pdPASS; uint32_t root_cert_auth_pem_length = ( uint32_t ) ( root_cert_auth_pem_end - root_cert_auth_pem_start ); uint32_t client_cert_pem_length = ( uint32_t ) ( client_cert_pem_end - client_cert_pem_start ); uint32_t client_key_pem_length = ( uint32_t ) ( client_key_pem_end -client_key_pem_start ); /* configPRINTF(("%s:%d\r\n", __FUNCTION__, __LINE__)); */ if( pDevice == NULL ) { printf( "Secure_Ioctl bad param pxPeripheral\r\n" ); retValue = pdFAIL; } else { switch( ulRequest ) { case ioctlSECURE_ROOT_CA: if( pvValue != NULL ) { memcpy( pvValue, root_cert_auth_pem_start, root_cert_auth_pem_length ); } break; case ioctlSECURE_CLIENT_CERT: if( pvValue != NULL ) { memcpy( pvValue, client_cert_pem_start, client_cert_pem_length ); } break; case ioctlSECURE_CLIENT_KEY: if( pvValue != NULL ) { memcpy( pvValue, client_key_pem_start, client_key_pem_length ); } break; case ioctlSECURE_CLIENT_ID: if( pvValue != NULL ) { memcpy( pvValue, client_id, strlen( client_id ) ); } break; case ioctlSECURE_VIN: if( pvValue != NULL ) { memcpy( pvValue, cms_vin, strlen( cms_vin ) ); } break; case ioctlSECURE_BROKER_ENDPOINT: if( pvValue != NULL ) { memcpy( pvValue, broker_endpoint, strlen( broker_endpoint ) ); } break; case ioctlSECURE_BROKER_PORT: if( pvValue != NULL ) { *( ( uint32_t * ) pvValue ) = CONFIG_MQTT_BROKER_PORT; } break; default: break; } } return retValue; } /*-----------------------------------------------------------*/
32.721519
109
0.532173
5811643ffa2729c550c20fe0bc19c23ff9634c6f
38,782
h
C
4.27/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabClientModelDecoder.h
parnic-sks/UnrealMarketplacePlugin
87a9d392de53d2031a3ceafbc79ab86d86ca3a33
[ "Apache-2.0" ]
85
2018-11-21T00:01:28.000Z
2022-03-26T14:04:07.000Z
4.27/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabClientModelDecoder.h
parnic-sks/UnrealMarketplacePlugin
87a9d392de53d2031a3ceafbc79ab86d86ca3a33
[ "Apache-2.0" ]
17
2019-04-04T12:24:48.000Z
2021-10-12T08:06:47.000Z
4.27/PlayFabPlugin/PlayFab/Source/PlayFab/Classes/PlayFabClientModelDecoder.h
parnic-sks/UnrealMarketplacePlugin
87a9d392de53d2031a3ceafbc79ab86d86ca3a33
[ "Apache-2.0" ]
38
2018-11-17T09:53:27.000Z
2022-03-26T22:33:11.000Z
////////////////////////////////////////////////////// // Copyright (C) Microsoft. 2018. All rights reserved. ////////////////////////////////////////////////////// #pragma once ////////////////////////////////////////////////////////////////////////////////////////////// // Automatically generated model file for the UE4 PlayFab plugin. // This model file contains the request and response USTRUCTS // // API: Client ////////////////////////////////////////////////////////////////////////////////////////////// #include "CoreMinimal.h" #include "Kismet/BlueprintFunctionLibrary.h" #include "PlayFabEnums.h" #include "PlayFabClientModels.h" #include "PlayFabClientModelDecoder.generated.h" class UPlayFabJsonObject; UCLASS() class PLAYFAB_API UPlayFabClientModelDecoder : public UBlueprintFunctionLibrary { GENERATED_BODY() public: ////////////////////////////////////////////////////////////////////////// // Generated PlayFab Client API Functions ////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////// // Account Management ////////////////////////////////////////////////////// /** Decode the AddGenericIDResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientAddGenericIDResult decodeAddGenericIDResultResponse(UPlayFabJsonObject* response); /** Decode the AddOrUpdateContactEmailResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientAddOrUpdateContactEmailResult decodeAddOrUpdateContactEmailResultResponse(UPlayFabJsonObject* response); /** Decode the AddUsernamePasswordResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientAddUsernamePasswordResult decodeAddUsernamePasswordResultResponse(UPlayFabJsonObject* response); /** Decode the GetAccountInfoResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientGetAccountInfoResult decodeGetAccountInfoResultResponse(UPlayFabJsonObject* response); /** Decode the GetPlayerCombinedInfoResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientGetPlayerCombinedInfoResult decodeGetPlayerCombinedInfoResultResponse(UPlayFabJsonObject* response); /** Decode the GetPlayerProfileResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientGetPlayerProfileResult decodeGetPlayerProfileResultResponse(UPlayFabJsonObject* response); /** Decode the GetPlayFabIDsFromFacebookIDsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientGetPlayFabIDsFromFacebookIDsResult decodeGetPlayFabIDsFromFacebookIDsResultResponse(UPlayFabJsonObject* response); /** Decode the GetPlayFabIDsFromFacebookInstantGamesIdsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientGetPlayFabIDsFromFacebookInstantGamesIdsResult decodeGetPlayFabIDsFromFacebookInstantGamesIdsResultResponse(UPlayFabJsonObject* response); /** Decode the GetPlayFabIDsFromGameCenterIDsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientGetPlayFabIDsFromGameCenterIDsResult decodeGetPlayFabIDsFromGameCenterIDsResultResponse(UPlayFabJsonObject* response); /** Decode the GetPlayFabIDsFromGenericIDsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientGetPlayFabIDsFromGenericIDsResult decodeGetPlayFabIDsFromGenericIDsResultResponse(UPlayFabJsonObject* response); /** Decode the GetPlayFabIDsFromGoogleIDsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientGetPlayFabIDsFromGoogleIDsResult decodeGetPlayFabIDsFromGoogleIDsResultResponse(UPlayFabJsonObject* response); /** Decode the GetPlayFabIDsFromKongregateIDsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientGetPlayFabIDsFromKongregateIDsResult decodeGetPlayFabIDsFromKongregateIDsResultResponse(UPlayFabJsonObject* response); /** Decode the GetPlayFabIDsFromNintendoSwitchDeviceIdsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientGetPlayFabIDsFromNintendoSwitchDeviceIdsResult decodeGetPlayFabIDsFromNintendoSwitchDeviceIdsResultResponse(UPlayFabJsonObject* response); /** Decode the GetPlayFabIDsFromPSNAccountIDsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientGetPlayFabIDsFromPSNAccountIDsResult decodeGetPlayFabIDsFromPSNAccountIDsResultResponse(UPlayFabJsonObject* response); /** Decode the GetPlayFabIDsFromSteamIDsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientGetPlayFabIDsFromSteamIDsResult decodeGetPlayFabIDsFromSteamIDsResultResponse(UPlayFabJsonObject* response); /** Decode the GetPlayFabIDsFromTwitchIDsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientGetPlayFabIDsFromTwitchIDsResult decodeGetPlayFabIDsFromTwitchIDsResultResponse(UPlayFabJsonObject* response); /** Decode the GetPlayFabIDsFromXboxLiveIDsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientGetPlayFabIDsFromXboxLiveIDsResult decodeGetPlayFabIDsFromXboxLiveIDsResultResponse(UPlayFabJsonObject* response); /** Decode the LinkAndroidDeviceIDResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientLinkAndroidDeviceIDResult decodeLinkAndroidDeviceIDResultResponse(UPlayFabJsonObject* response); /** Decode the EmptyResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientEmptyResult decodeEmptyResultResponse(UPlayFabJsonObject* response); /** Decode the LinkCustomIDResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientLinkCustomIDResult decodeLinkCustomIDResultResponse(UPlayFabJsonObject* response); /** Decode the LinkFacebookAccountResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientLinkFacebookAccountResult decodeLinkFacebookAccountResultResponse(UPlayFabJsonObject* response); /** Decode the LinkFacebookInstantGamesIdResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientLinkFacebookInstantGamesIdResult decodeLinkFacebookInstantGamesIdResultResponse(UPlayFabJsonObject* response); /** Decode the LinkGameCenterAccountResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientLinkGameCenterAccountResult decodeLinkGameCenterAccountResultResponse(UPlayFabJsonObject* response); /** Decode the LinkGoogleAccountResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientLinkGoogleAccountResult decodeLinkGoogleAccountResultResponse(UPlayFabJsonObject* response); /** Decode the LinkIOSDeviceIDResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientLinkIOSDeviceIDResult decodeLinkIOSDeviceIDResultResponse(UPlayFabJsonObject* response); /** Decode the LinkKongregateAccountResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientLinkKongregateAccountResult decodeLinkKongregateAccountResultResponse(UPlayFabJsonObject* response); /** Decode the LinkNintendoSwitchDeviceIdResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientLinkNintendoSwitchDeviceIdResult decodeLinkNintendoSwitchDeviceIdResultResponse(UPlayFabJsonObject* response); /** Decode the LinkPSNAccountResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientLinkPSNAccountResult decodeLinkPSNAccountResultResponse(UPlayFabJsonObject* response); /** Decode the LinkSteamAccountResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientLinkSteamAccountResult decodeLinkSteamAccountResultResponse(UPlayFabJsonObject* response); /** Decode the LinkTwitchAccountResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientLinkTwitchAccountResult decodeLinkTwitchAccountResultResponse(UPlayFabJsonObject* response); /** Decode the LinkXboxAccountResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientLinkXboxAccountResult decodeLinkXboxAccountResultResponse(UPlayFabJsonObject* response); /** Decode the RemoveContactEmailResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientRemoveContactEmailResult decodeRemoveContactEmailResultResponse(UPlayFabJsonObject* response); /** Decode the RemoveGenericIDResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientRemoveGenericIDResult decodeRemoveGenericIDResultResponse(UPlayFabJsonObject* response); /** Decode the ReportPlayerClientResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientReportPlayerClientResult decodeReportPlayerClientResultResponse(UPlayFabJsonObject* response); /** Decode the SendAccountRecoveryEmailResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientSendAccountRecoveryEmailResult decodeSendAccountRecoveryEmailResultResponse(UPlayFabJsonObject* response); /** Decode the UnlinkAndroidDeviceIDResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientUnlinkAndroidDeviceIDResult decodeUnlinkAndroidDeviceIDResultResponse(UPlayFabJsonObject* response); /** Decode the EmptyResponse response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientEmptyResponse decodeEmptyResponseResponse(UPlayFabJsonObject* response); /** Decode the UnlinkCustomIDResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientUnlinkCustomIDResult decodeUnlinkCustomIDResultResponse(UPlayFabJsonObject* response); /** Decode the UnlinkFacebookAccountResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientUnlinkFacebookAccountResult decodeUnlinkFacebookAccountResultResponse(UPlayFabJsonObject* response); /** Decode the UnlinkFacebookInstantGamesIdResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientUnlinkFacebookInstantGamesIdResult decodeUnlinkFacebookInstantGamesIdResultResponse(UPlayFabJsonObject* response); /** Decode the UnlinkGameCenterAccountResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientUnlinkGameCenterAccountResult decodeUnlinkGameCenterAccountResultResponse(UPlayFabJsonObject* response); /** Decode the UnlinkGoogleAccountResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientUnlinkGoogleAccountResult decodeUnlinkGoogleAccountResultResponse(UPlayFabJsonObject* response); /** Decode the UnlinkIOSDeviceIDResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientUnlinkIOSDeviceIDResult decodeUnlinkIOSDeviceIDResultResponse(UPlayFabJsonObject* response); /** Decode the UnlinkKongregateAccountResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientUnlinkKongregateAccountResult decodeUnlinkKongregateAccountResultResponse(UPlayFabJsonObject* response); /** Decode the UnlinkNintendoSwitchDeviceIdResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientUnlinkNintendoSwitchDeviceIdResult decodeUnlinkNintendoSwitchDeviceIdResultResponse(UPlayFabJsonObject* response); /** Decode the UnlinkPSNAccountResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientUnlinkPSNAccountResult decodeUnlinkPSNAccountResultResponse(UPlayFabJsonObject* response); /** Decode the UnlinkSteamAccountResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientUnlinkSteamAccountResult decodeUnlinkSteamAccountResultResponse(UPlayFabJsonObject* response); /** Decode the UnlinkTwitchAccountResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientUnlinkTwitchAccountResult decodeUnlinkTwitchAccountResultResponse(UPlayFabJsonObject* response); /** Decode the UnlinkXboxAccountResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientUnlinkXboxAccountResult decodeUnlinkXboxAccountResultResponse(UPlayFabJsonObject* response); /** Decode the UpdateUserTitleDisplayNameResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Account Management Models") static FClientUpdateUserTitleDisplayNameResult decodeUpdateUserTitleDisplayNameResultResponse(UPlayFabJsonObject* response); /////////////////////////////////////////////////////// // Advertising ////////////////////////////////////////////////////// /** Decode the AttributeInstallResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Advertising Models") static FClientAttributeInstallResult decodeAttributeInstallResultResponse(UPlayFabJsonObject* response); /** Decode the GetAdPlacementsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Advertising Models") static FClientGetAdPlacementsResult decodeGetAdPlacementsResultResponse(UPlayFabJsonObject* response); /** Decode the ReportAdActivityResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Advertising Models") static FClientReportAdActivityResult decodeReportAdActivityResultResponse(UPlayFabJsonObject* response); /** Decode the RewardAdActivityResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Advertising Models") static FClientRewardAdActivityResult decodeRewardAdActivityResultResponse(UPlayFabJsonObject* response); /////////////////////////////////////////////////////// // Analytics ////////////////////////////////////////////////////// /** Decode the WriteEventResponse response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Analytics Models") static FClientWriteEventResponse decodeWriteEventResponseResponse(UPlayFabJsonObject* response); /////////////////////////////////////////////////////// // Authentication ////////////////////////////////////////////////////// /** Decode the GetPhotonAuthenticationTokenResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication Models") static FClientGetPhotonAuthenticationTokenResult decodeGetPhotonAuthenticationTokenResultResponse(UPlayFabJsonObject* response); /** Decode the GetTitlePublicKeyResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication Models") static FClientGetTitlePublicKeyResult decodeGetTitlePublicKeyResultResponse(UPlayFabJsonObject* response); /** Decode the LoginResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication Models") static FClientLoginResult decodeLoginResultResponse(UPlayFabJsonObject* response); /** Decode the RegisterPlayFabUserResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication Models") static FClientRegisterPlayFabUserResult decodeRegisterPlayFabUserResultResponse(UPlayFabJsonObject* response); /** Decode the SetPlayerSecretResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Authentication Models") static FClientSetPlayerSecretResult decodeSetPlayerSecretResultResponse(UPlayFabJsonObject* response); /////////////////////////////////////////////////////// // Character Data ////////////////////////////////////////////////////// /** Decode the GetCharacterDataResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data Models") static FClientGetCharacterDataResult decodeGetCharacterDataResultResponse(UPlayFabJsonObject* response); /** Decode the UpdateCharacterDataResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Character Data Models") static FClientUpdateCharacterDataResult decodeUpdateCharacterDataResultResponse(UPlayFabJsonObject* response); /////////////////////////////////////////////////////// // Characters ////////////////////////////////////////////////////// /** Decode the ListUsersCharactersResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") static FClientListUsersCharactersResult decodeListUsersCharactersResultResponse(UPlayFabJsonObject* response); /** Decode the GetCharacterLeaderboardResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") static FClientGetCharacterLeaderboardResult decodeGetCharacterLeaderboardResultResponse(UPlayFabJsonObject* response); /** Decode the GetCharacterStatisticsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") static FClientGetCharacterStatisticsResult decodeGetCharacterStatisticsResultResponse(UPlayFabJsonObject* response); /** Decode the GetLeaderboardAroundCharacterResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") static FClientGetLeaderboardAroundCharacterResult decodeGetLeaderboardAroundCharacterResultResponse(UPlayFabJsonObject* response); /** Decode the GetLeaderboardForUsersCharactersResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") static FClientGetLeaderboardForUsersCharactersResult decodeGetLeaderboardForUsersCharactersResultResponse(UPlayFabJsonObject* response); /** Decode the GrantCharacterToUserResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") static FClientGrantCharacterToUserResult decodeGrantCharacterToUserResultResponse(UPlayFabJsonObject* response); /** Decode the UpdateCharacterStatisticsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Characters Models") static FClientUpdateCharacterStatisticsResult decodeUpdateCharacterStatisticsResultResponse(UPlayFabJsonObject* response); /////////////////////////////////////////////////////// // Content ////////////////////////////////////////////////////// /** Decode the GetContentDownloadUrlResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Content Models") static FClientGetContentDownloadUrlResult decodeGetContentDownloadUrlResultResponse(UPlayFabJsonObject* response); /////////////////////////////////////////////////////// // Friend List Management ////////////////////////////////////////////////////// /** Decode the AddFriendResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management Models") static FClientAddFriendResult decodeAddFriendResultResponse(UPlayFabJsonObject* response); /** Decode the GetFriendsListResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management Models") static FClientGetFriendsListResult decodeGetFriendsListResultResponse(UPlayFabJsonObject* response); /** Decode the RemoveFriendResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management Models") static FClientRemoveFriendResult decodeRemoveFriendResultResponse(UPlayFabJsonObject* response); /** Decode the SetFriendTagsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Friend List Management Models") static FClientSetFriendTagsResult decodeSetFriendTagsResultResponse(UPlayFabJsonObject* response); /////////////////////////////////////////////////////// // Matchmaking ////////////////////////////////////////////////////// /** Decode the CurrentGamesResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking Models") static FClientCurrentGamesResult decodeCurrentGamesResultResponse(UPlayFabJsonObject* response); /** Decode the GameServerRegionsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking Models") static FClientGameServerRegionsResult decodeGameServerRegionsResultResponse(UPlayFabJsonObject* response); /** Decode the MatchmakeResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking Models") static FClientMatchmakeResult decodeMatchmakeResultResponse(UPlayFabJsonObject* response); /** Decode the StartGameResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Matchmaking Models") static FClientStartGameResult decodeStartGameResultResponse(UPlayFabJsonObject* response); /////////////////////////////////////////////////////// // Platform Specific Methods ////////////////////////////////////////////////////// /** Decode the AndroidDevicePushNotificationRegistrationResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") static FClientAndroidDevicePushNotificationRegistrationResult decodeAndroidDevicePushNotificationRegistrationResultResponse(UPlayFabJsonObject* response); /** Decode the ConsumeMicrosoftStoreEntitlementsResponse response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") static FClientConsumeMicrosoftStoreEntitlementsResponse decodeConsumeMicrosoftStoreEntitlementsResponseResponse(UPlayFabJsonObject* response); /** Decode the ConsumePS5EntitlementsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") static FClientConsumePS5EntitlementsResult decodeConsumePS5EntitlementsResultResponse(UPlayFabJsonObject* response); /** Decode the ConsumePSNEntitlementsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") static FClientConsumePSNEntitlementsResult decodeConsumePSNEntitlementsResultResponse(UPlayFabJsonObject* response); /** Decode the ConsumeXboxEntitlementsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") static FClientConsumeXboxEntitlementsResult decodeConsumeXboxEntitlementsResultResponse(UPlayFabJsonObject* response); /** Decode the RegisterForIOSPushNotificationResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") static FClientRegisterForIOSPushNotificationResult decodeRegisterForIOSPushNotificationResultResponse(UPlayFabJsonObject* response); /** Decode the RestoreIOSPurchasesResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") static FClientRestoreIOSPurchasesResult decodeRestoreIOSPurchasesResultResponse(UPlayFabJsonObject* response); /** Decode the ValidateAmazonReceiptResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") static FClientValidateAmazonReceiptResult decodeValidateAmazonReceiptResultResponse(UPlayFabJsonObject* response); /** Decode the ValidateGooglePlayPurchaseResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") static FClientValidateGooglePlayPurchaseResult decodeValidateGooglePlayPurchaseResultResponse(UPlayFabJsonObject* response); /** Decode the ValidateIOSReceiptResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") static FClientValidateIOSReceiptResult decodeValidateIOSReceiptResultResponse(UPlayFabJsonObject* response); /** Decode the ValidateWindowsReceiptResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Platform Specific Methods Models") static FClientValidateWindowsReceiptResult decodeValidateWindowsReceiptResultResponse(UPlayFabJsonObject* response); /////////////////////////////////////////////////////// // Player Data Management ////////////////////////////////////////////////////// /** Decode the GetLeaderboardResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") static FClientGetLeaderboardResult decodeGetLeaderboardResultResponse(UPlayFabJsonObject* response); /** Decode the GetFriendLeaderboardAroundPlayerResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") static FClientGetFriendLeaderboardAroundPlayerResult decodeGetFriendLeaderboardAroundPlayerResultResponse(UPlayFabJsonObject* response); /** Decode the GetLeaderboardAroundPlayerResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") static FClientGetLeaderboardAroundPlayerResult decodeGetLeaderboardAroundPlayerResultResponse(UPlayFabJsonObject* response); /** Decode the GetPlayerStatisticsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") static FClientGetPlayerStatisticsResult decodeGetPlayerStatisticsResultResponse(UPlayFabJsonObject* response); /** Decode the GetPlayerStatisticVersionsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") static FClientGetPlayerStatisticVersionsResult decodeGetPlayerStatisticVersionsResultResponse(UPlayFabJsonObject* response); /** Decode the GetUserDataResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") static FClientGetUserDataResult decodeGetUserDataResultResponse(UPlayFabJsonObject* response); /** Decode the UpdatePlayerStatisticsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") static FClientUpdatePlayerStatisticsResult decodeUpdatePlayerStatisticsResultResponse(UPlayFabJsonObject* response); /** Decode the UpdateUserDataResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Data Management Models") static FClientUpdateUserDataResult decodeUpdateUserDataResultResponse(UPlayFabJsonObject* response); /////////////////////////////////////////////////////// // Player Item Management ////////////////////////////////////////////////////// /** Decode the ModifyUserVirtualCurrencyResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") static FClientModifyUserVirtualCurrencyResult decodeModifyUserVirtualCurrencyResultResponse(UPlayFabJsonObject* response); /** Decode the ConfirmPurchaseResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") static FClientConfirmPurchaseResult decodeConfirmPurchaseResultResponse(UPlayFabJsonObject* response); /** Decode the ConsumeItemResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") static FClientConsumeItemResult decodeConsumeItemResultResponse(UPlayFabJsonObject* response); /** Decode the GetCharacterInventoryResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") static FClientGetCharacterInventoryResult decodeGetCharacterInventoryResultResponse(UPlayFabJsonObject* response); /** Decode the GetPaymentTokenResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") static FClientGetPaymentTokenResult decodeGetPaymentTokenResultResponse(UPlayFabJsonObject* response); /** Decode the GetPurchaseResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") static FClientGetPurchaseResult decodeGetPurchaseResultResponse(UPlayFabJsonObject* response); /** Decode the GetUserInventoryResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") static FClientGetUserInventoryResult decodeGetUserInventoryResultResponse(UPlayFabJsonObject* response); /** Decode the PayForPurchaseResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") static FClientPayForPurchaseResult decodePayForPurchaseResultResponse(UPlayFabJsonObject* response); /** Decode the PurchaseItemResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") static FClientPurchaseItemResult decodePurchaseItemResultResponse(UPlayFabJsonObject* response); /** Decode the RedeemCouponResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") static FClientRedeemCouponResult decodeRedeemCouponResultResponse(UPlayFabJsonObject* response); /** Decode the StartPurchaseResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") static FClientStartPurchaseResult decodeStartPurchaseResultResponse(UPlayFabJsonObject* response); /** Decode the UnlockContainerItemResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Player Item Management Models") static FClientUnlockContainerItemResult decodeUnlockContainerItemResultResponse(UPlayFabJsonObject* response); /////////////////////////////////////////////////////// // PlayStream ////////////////////////////////////////////////////// /** Decode the GetPlayerSegmentsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | PlayStream Models") static FClientGetPlayerSegmentsResult decodeGetPlayerSegmentsResultResponse(UPlayFabJsonObject* response); /** Decode the GetPlayerTagsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | PlayStream Models") static FClientGetPlayerTagsResult decodeGetPlayerTagsResultResponse(UPlayFabJsonObject* response); /////////////////////////////////////////////////////// // Server-Side Cloud Script ////////////////////////////////////////////////////// /** Decode the ExecuteCloudScriptResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Server-Side Cloud Script Models") static FClientExecuteCloudScriptResult decodeExecuteCloudScriptResultResponse(UPlayFabJsonObject* response); /////////////////////////////////////////////////////// // Shared Group Data ////////////////////////////////////////////////////// /** Decode the AddSharedGroupMembersResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data Models") static FClientAddSharedGroupMembersResult decodeAddSharedGroupMembersResultResponse(UPlayFabJsonObject* response); /** Decode the CreateSharedGroupResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data Models") static FClientCreateSharedGroupResult decodeCreateSharedGroupResultResponse(UPlayFabJsonObject* response); /** Decode the GetSharedGroupDataResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data Models") static FClientGetSharedGroupDataResult decodeGetSharedGroupDataResultResponse(UPlayFabJsonObject* response); /** Decode the RemoveSharedGroupMembersResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data Models") static FClientRemoveSharedGroupMembersResult decodeRemoveSharedGroupMembersResultResponse(UPlayFabJsonObject* response); /** Decode the UpdateSharedGroupDataResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Shared Group Data Models") static FClientUpdateSharedGroupDataResult decodeUpdateSharedGroupDataResultResponse(UPlayFabJsonObject* response); /////////////////////////////////////////////////////// // Title-Wide Data Management ////////////////////////////////////////////////////// /** Decode the GetCatalogItemsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") static FClientGetCatalogItemsResult decodeGetCatalogItemsResultResponse(UPlayFabJsonObject* response); /** Decode the GetPublisherDataResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") static FClientGetPublisherDataResult decodeGetPublisherDataResultResponse(UPlayFabJsonObject* response); /** Decode the GetStoreItemsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") static FClientGetStoreItemsResult decodeGetStoreItemsResultResponse(UPlayFabJsonObject* response); /** Decode the GetTimeResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") static FClientGetTimeResult decodeGetTimeResultResponse(UPlayFabJsonObject* response); /** Decode the GetTitleDataResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") static FClientGetTitleDataResult decodeGetTitleDataResultResponse(UPlayFabJsonObject* response); /** Decode the GetTitleNewsResult response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Title-Wide Data Management Models") static FClientGetTitleNewsResult decodeGetTitleNewsResultResponse(UPlayFabJsonObject* response); /////////////////////////////////////////////////////// // Trading ////////////////////////////////////////////////////// /** Decode the AcceptTradeResponse response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading Models") static FClientAcceptTradeResponse decodeAcceptTradeResponseResponse(UPlayFabJsonObject* response); /** Decode the CancelTradeResponse response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading Models") static FClientCancelTradeResponse decodeCancelTradeResponseResponse(UPlayFabJsonObject* response); /** Decode the GetPlayerTradesResponse response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading Models") static FClientGetPlayerTradesResponse decodeGetPlayerTradesResponseResponse(UPlayFabJsonObject* response); /** Decode the GetTradeStatusResponse response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading Models") static FClientGetTradeStatusResponse decodeGetTradeStatusResponseResponse(UPlayFabJsonObject* response); /** Decode the OpenTradeResponse response object*/ UFUNCTION(BlueprintCallable, Category = "PlayFab | Client | Trading Models") static FClientOpenTradeResponse decodeOpenTradeResponseResponse(UPlayFabJsonObject* response); };
59.664615
162
0.74844
85523858e821fcab9b3601ab70b77c773ebab7f5
712
rs
Rust
src/room.rs
patm1987/rust_d20_test
e64248570d31a1140bf240ba9d958d12c855ab88
[ "MIT" ]
null
null
null
src/room.rs
patm1987/rust_d20_test
e64248570d31a1140bf240ba9d958d12c855ab88
[ "MIT" ]
null
null
null
src/room.rs
patm1987/rust_d20_test
e64248570d31a1140bf240ba9d958d12c855ab88
[ "MIT" ]
null
null
null
use std::cell::Cell; pub struct Room { title: String, first_description: String, description: String, visited: Cell<bool>, } impl Room { pub fn new(title: &str, first_description: &str, description: &str) -> Room { Room { title: title.to_owned(), first_description: first_description.to_owned(), description: description.to_owned(), visited: Cell::new(false) } } pub fn get_title(&self) -> &String { &self.title } pub fn get_first_description(&self) -> &String { &self.first_description } pub fn get_description(&self) -> &String { &self.description } pub fn mark_visited(&self) { self.visited.set(true); } pub fn is_visited(&self) -> bool { self.visited.get() } }
18.25641
78
0.672753
99793b6867951fbd5ce645baa39d0cdfe12c73ef
5,055
h
C
DateTime/DateTime/Date.h
MJBrune/RandomProjects
c24d8aa78aa9d5a6df8ae186a92a82165a96c50c
[ "WTFPL" ]
null
null
null
DateTime/DateTime/Date.h
MJBrune/RandomProjects
c24d8aa78aa9d5a6df8ae186a92a82165a96c50c
[ "WTFPL" ]
null
null
null
DateTime/DateTime/Date.h
MJBrune/RandomProjects
c24d8aa78aa9d5a6df8ae186a92a82165a96c50c
[ "WTFPL" ]
null
null
null
#ifndef DATE_H #define DATE_H //----------------------------------------------------------------------------- // Class: Date // // File: Date.cpp // // Title: Date Class // // Description: This file contains the class definition for Date // // Programmer: Paul Bladek // // Date: 4/7/2008 // // Version: 1.0 // // Environment: Hardware: IBM Pentium // Software: WinXP or later or .NET for execution; // // Compiles under Microsoft C++ 2005 // // class Date: // // Properties: // short m_year; // full year, i.e., 2006 // short m_month; // 0 - 11 // short m_dayOfMonth; // 1 - days in that month // short m_dayOfYear; // 1 - 365 or 366 // short m_dayOfWeek; // 0 - 6 // // Methods: // Inline: // Static: // static bool isLeapYear(short year) // true if year is a leap year; false otherwise // static short daysInMonth(short month, short year) // returns the number of days in month for that year // static const char* monthName(int monthNum) // returns a string representation of monthNum // static const char* weekdayName(int weekdayNum) // returns a string representation of weekdayNum // Non-Static: // short getDayOfWeek()const // short getDayOfMonth()const // short getMonth()const // short getYear()const // short getDayOfYear()const // // Non-inline: // // virtual bool equals(const Comparable &other)const // virtual lessthan(const Comparable &other)const // virtual void input(istream& sin) // virtual void print(ostream& sout)const // // void setMonth(short monthIn) // void setYear(short yearIn) // void setCurrentDate(void) // void setDayOfYear(void) // void setDayOfWeek(void) // void setDayOfMonth(short dayOfMonth) // Date tomorrow()const // Date yesterday()const // short countLeaps(short year)const // void print(ostream& sout)const; // // History Log: // 4/7/08 PB completed version 1.0 // ---------------------------------------------------------------------------- #include <iostream> #include <cstdlib> #include <ctime> #include <exception> #include <string> #include "Comparable.h" using namespace std; namespace MB_DATETIME { const short LOWYEAR = 1760; const short DAYSINYEAR = 365; const short STARTDAYOFWEEK = 2; const short MONTHSINYEAR = 12; const short DAYSINWEEK = 7; const short MAXMONTH = 11; const short MINMONTH = 0; const short FEBRUARY = 2; const short LEAPYEARSTART = 1; const string NAMESOFDAYS[7] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; const string NAMESOFMONTHS[12] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; const short DAYSINMONTHS[13] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 29}; class Date : virtual public Comparable { public: Date(short day = -1, short month = -1, short year = -1); virtual ~Date(void) {} // pure virtuals that MUST be defined virtual bool operator==(const Comparable &other)const; virtual bool operator!=(const Comparable &other)const {return !((*this) == other);} virtual bool operator<(const Comparable &other)const; virtual bool operator>(const Comparable &other)const {return !((*this) < other) && !((*this) == other);} virtual bool operator<=(const Comparable &other)const {return !((*this) > other);} virtual bool operator>=(const Comparable &other)const {return !((*this) < other);} virtual void input(istream& sin); virtual void print(ostream& sout)const { sout << weekdayName(m_dayOfWeek) << ", " << m_dayOfMonth << " " << monthName(m_month) << ", " << m_year; } // mutators void setCurrentDate(void); void setDayOfYear(void); void setDayOfWeek(void); void setDayOfMonth(short dayOfMonth); void setMonth(short monthIn); void setYear(short yearIn); short countLeaps(short year)const; //accessors short getDayOfWeek()const {return m_dayOfWeek;} short getDayOfMonth()const {return m_dayOfMonth;} short getMonth()const {return m_month;} short getYear()const {return m_year;} short getDayOfYear()const {return m_dayOfYear;} Date tomorrow()const; Date yesterday()const; //statics static bool isLeapYear(short year); static short daysInMonth(short month, short year) {if (isLeapYear(year)){ if (month == FEBRUARY) return DAYSINMONTHS[12];} return DAYSINMONTHS[month];} static const char* monthName(int monthNum) {return NAMESOFMONTHS[monthNum].c_str();} static const char* weekdayName(int weekdayNum) {return NAMESOFDAYS[weekdayNum].c_str();} protected: short m_year; // full year, i.e., 2006 short m_month; // 0 - 11 short m_dayOfMonth; // 1 - days in that month short m_dayOfYear; // 1 - 365 or 366 short m_dayOfWeek; // 0 - 6 }; ostream& operator<<(ostream& sout, const Date& date); istream& operator>>(istream& sin, Date& date); } #endif
31.59375
110
0.636597
50c29a6ed4aa09cfb023ce2518165f1d8f9a4758
636
go
Go
service_packs/kubernetes/general/helpers.go
iantivey/probr
5acc3ce9c744746c31b45e7d734ac5098544165c
[ "Apache-2.0" ]
null
null
null
service_packs/kubernetes/general/helpers.go
iantivey/probr
5acc3ce9c744746c31b45e7d734ac5098544165c
[ "Apache-2.0" ]
null
null
null
service_packs/kubernetes/general/helpers.go
iantivey/probr
5acc3ce9c744746c31b45e7d734ac5098544165c
[ "Apache-2.0" ]
null
null
null
package general import ( "github.com/citihub/probr/audit" "github.com/citihub/probr/service_packs/coreengine" "github.com/citihub/probr/service_packs/kubernetes" "github.com/cucumber/godog" ) type scenarioState struct { name string audit *audit.ScenarioAudit probe *audit.Probe podState kubernetes.PodState wildcardRoles interface{} } func beforeScenario(s *scenarioState, probeName string, gs *godog.Scenario) { s.name = gs.Name s.probe = audit.State.GetProbeLog(probeName) s.audit = audit.State.GetProbeLog(probeName).InitializeAuditor(gs.Name, gs.Tags) coreengine.LogScenarioStart(gs) }
26.5
81
0.75
0c6dda27cc552afa41ad4eaef8453f2665bf8538
1,851
swift
Swift
benchmarks/scripts/Sources/Parser/Parser.swift
kateinoigakukun/mull-xctest
e7be5afa9afb64bef97dde29417c016af2a50dcc
[ "MIT" ]
43
2021-03-04T04:57:41.000Z
2022-03-03T17:16:54.000Z
benchmarks/scripts/Sources/Parser/Parser.swift
kateinoigakukun/mull-xctest
e7be5afa9afb64bef97dde29417c016af2a50dcc
[ "MIT" ]
2
2021-03-09T10:32:29.000Z
2021-10-19T12:01:25.000Z
benchmarks/scripts/Sources/Parser/Parser.swift
kateinoigakukun/mull-xctest
e7be5afa9afb64bef97dde29417c016af2a50dcc
[ "MIT" ]
1
2021-03-09T14:29:17.000Z
2021-03-09T14:29:17.000Z
import Foundation public func parseMuterBenchmark(contents: Data) throws -> [MuterMutationPoint] { let decoder = JSONDecoder() decoder.keyDecodingStrategy = .useDefaultKeys struct TopLevel: Decodable { struct FileReport: Decodable { struct AppliedOperator: Decodable { var mutationPoint: MuterMutationPoint } var appliedOperators: [AppliedOperator] } var fileReports: [FileReport] } let top = try decoder.decode(TopLevel.self, from: contents) return top.fileReports.flatMap(\.appliedOperators).map(\.mutationPoint) } public enum Error: Swift.Error, LocalizedError { case invalidUTF8 case invalidPrefix } public func parseMullBenchmark(contents: Data) throws -> [MullMutationPoint] { func parseSourceLocation<S: StringProtocol>(line: S) throws -> SourceLocation { let components = line.split(separator: ":") return SourceLocation( filePath: String(components[0]), line: UInt(components[1])!, column: UInt(components[2])! ) } func parseLine<S: StringProtocol>(line: S) throws -> MullMutationPoint { let prefix = "Mutation Point: " guard line.hasPrefix(prefix) else { throw Error.invalidPrefix } var line = line.dropFirst(prefix.count) let mutator = line.prefix(while: { !$0.isWhitespace }) line = line.dropFirst(mutator.count + 1) let location = try parseSourceLocation(line: line) return MullMutationPoint( mutator: String(mutator), location: location ) } guard let contents = String(data: contents, encoding: .utf8) else { throw Error.invalidUTF8 } let lines = contents.split(whereSeparator: \.isNewline) return try lines.map { try parseLine(line: $0) } }
36.294118
83
0.65208
f2599ce573665da4829e5f18c71362be6ae1acf9
463
sql
SQL
openGaussBase/testcase/KEYWORDS/number/Opengauss_Function_Keyword_Number_Case0027.sql
opengauss-mirror/Yat
aef107a8304b94e5d99b4f1f36eb46755eb8919e
[ "MulanPSL-1.0" ]
null
null
null
openGaussBase/testcase/KEYWORDS/number/Opengauss_Function_Keyword_Number_Case0027.sql
opengauss-mirror/Yat
aef107a8304b94e5d99b4f1f36eb46755eb8919e
[ "MulanPSL-1.0" ]
null
null
null
openGaussBase/testcase/KEYWORDS/number/Opengauss_Function_Keyword_Number_Case0027.sql
opengauss-mirror/Yat
aef107a8304b94e5d99b4f1f36eb46755eb8919e
[ "MulanPSL-1.0" ]
null
null
null
-- @testpoint:opengauss关键字number非保留),作为序列名 --关键字不带引号-成功 drop sequence if exists number; create sequence number start 100 cache 50; drop sequence number; --关键字带双引号-成功 drop sequence if exists "number"; create sequence "number" start 100 cache 50; drop sequence "number"; --关键字带单引号-合理报错 drop sequence if exists 'number'; create sequence 'number' start 100 cache 50; --关键字带反引号-合理报错 drop sequence if exists `number`; create sequence `number` start 100 cache 50;
22.047619
44
0.766739
4a1161432e95a7c0c2000d06c422edad0e7ee2c1
674
sql
SQL
_MAIN SQL SOLUTIONS/Oft Used Code/Oft Used Code/Oft Used Code/1 CONVEYANCING DOC PERMISSIONS FOR GLOBAL DOCS.sql
johnmull400/S-G_GIT_ROUTE
abc04f5305b5de2616dc26c0d0e285a06837e917
[ "MIT" ]
null
null
null
_MAIN SQL SOLUTIONS/Oft Used Code/Oft Used Code/Oft Used Code/1 CONVEYANCING DOC PERMISSIONS FOR GLOBAL DOCS.sql
johnmull400/S-G_GIT_ROUTE
abc04f5305b5de2616dc26c0d0e285a06837e917
[ "MIT" ]
null
null
null
_MAIN SQL SOLUTIONS/Oft Used Code/Oft Used Code/Oft Used Code/1 CONVEYANCING DOC PERMISSIONS FOR GLOBAL DOCS.sql
johnmull400/S-G_GIT_ROUTE
abc04f5305b5de2616dc26c0d0e285a06837e917
[ "MIT" ]
null
null
null
-- The doc permissions table has no record for a given documnts until you set the permissions in partner. -- What we will have to do is insert a record for each global document into the doc permissions table -- for every casetype EXCEPT conveayancing. USE [Partner] GO SELECT [doccode] ,[casetype] FROM [dbo].[DM_DocumentsPermissions] GO select dp.casetype,* from DM_documents d inner join dm_documentspermissions dp on dp.doccode = d.code where d.CaseTypeGroupRef = 0 select dp.casetype,* from dm_documentspermissions dp inner join dm_documents d on d.code = dp.doccode where d.CaseTypeGroupRef = 0 select * from DM_documents where CaseTypeGroupRef = 0
24.962963
105
0.771513
fa2875eb370191626b9bf75d3da59bf056e9ab65
5,925
swift
Swift
SwiftyBase/Classes/Control/PartiallyEditField.swift
mspvirajpatel/SwiftyBase
f6ddc8094512b11c7656fb61a02525e59fb1d6e1
[ "MIT" ]
31
2017-08-30T12:43:41.000Z
2022-02-08T14:37:31.000Z
SwiftyBase/Classes/Control/PartiallyEditField.swift
mspvirajpatel/SwiftyBase
f6ddc8094512b11c7656fb61a02525e59fb1d6e1
[ "MIT" ]
1
2017-09-07T04:16:01.000Z
2017-09-07T04:56:01.000Z
SwiftyBase/Classes/Control/PartiallyEditField.swift
mspvirajpatel/SwiftyBase
f6ddc8094512b11c7656fb61a02525e59fb1d6e1
[ "MIT" ]
21
2017-08-30T12:43:42.000Z
2021-04-02T06:42:54.000Z
// // PartiallyEditField.swift // SwiftyBase // // Created by Viraj Patel on 13/11/17. // import Foundation public enum PreTextSide: Int { case kNone case kLeft case kRight } /** * The PartiallyEditField will generate pretext for the textfield. */ open class PartiallyEditField: UITextField { open var prevText = "" open var prevTextRange: UITextRange? open var originalColor: UIColor? open var preTextFont: UIFont? open var preTextColor: UIColor? open var preText = "" open var atributedPlaceHolderString: NSMutableAttributedString? /** * The side that you want append for pretext. */ open var preTextSide: PreTextSide? open var placeHolderColor: UIColor? /** * This method will help to downlaod image with complete block. Block response will be an image. * * @param string The pre text that you wanted to append. */ // The converted code is limited to 4 KB. // Upgrade your plan to remove this limitation. open func setup(withPreText preText: String) { self.preText = preText prevText = text! originalColor = textColor if preTextSide == .kNone { preTextSide = .kRight } addTarget(self, action: #selector(self.textChanged), for: .editingChanged) createAtributedPlaceHolder() } /** * This method will help to downlaod image with complete block. Block response will be an image. * * @param string The pre text that you wanted to append. * @param color The text color for pretext that you wanted. */ open func setup(withPreText preText: String, color: UIColor) { preTextColor = color setup(withPreText: preText) } @objc open func textChanged(_ sender: PartiallyEditField) { if !(text == "") { if (text == preText) { text = "" prevText = "" return } if (prevText == "") { if preTextSide == .kLeft { text = "\(preText)\(String(describing: text!))" } else { text = "\(String(describing: text!))\(preText)" } prevText = text! } let range: NSRange? = (text! as NSString).range(of: preText) if preTextSide == .kLeft { if (text?.contains(preText))! && range?.location == 0 { prevText = text! } else { text = prevText } } else { if (self.text?.contains(self.preText))! { if (Int(range!.location) + Int((range?.length)!)) >= (text?.lengthOfString)! { prevText = text! } else { text = prevText } } else { text = prevText } } createAtributedText() changeRangeToBegin() } } open func changeRangeToBegin() { let range: NSRange? = (text! as NSString).range(of: preText) let idx: Int = offset(from: beginningOfDocument, to: prevTextRange!.start) if preTextSide == .kLeft { if idx > ((range?.location)! + (range?.length)!) { selectedTextRange = prevTextRange } else { let end: UITextPosition? = position(from: beginningOfDocument, offset: (range?.location)!) selectedTextRange = textRange(from: end ?? UITextPosition(), to: end ?? UITextPosition()) } } else { if idx >= ((range?.location)! + (range?.length)!) { let end: UITextPosition? = position(from: beginningOfDocument, offset: (range?.location)!) selectedTextRange = textRange(from: end ?? UITextPosition(), to: end ?? UITextPosition()) } else { selectedTextRange = prevTextRange } } } open func createAtributedPlaceHolder() { var placeHolderText = "\(String(describing: placeholder?.replacingOccurrences(of: preText, with: "")))\(preText)" if preTextSide == .kLeft { placeHolderText = "\(preText)\(String(describing: placeholder?.replacingOccurrences(of: preText, with: "")))" } attributedPlaceholder = atrributeText(fromText: placeHolderText, isText: false) } open func atrributeText(fromText str: String, isText: Bool) -> NSMutableAttributedString { let range: NSRange? = (str as NSString).range(of: preText) let string = NSMutableAttributedString(string: str) if isText { string.addAttribute(NSAttributedString.Key.foregroundColor, value: originalColor as Any, range: NSRange(location: 0, length: (str.count))) } else { if (placeHolderColor != nil) { string.addAttribute(NSAttributedString.Key.foregroundColor, value: placeHolderColor as Any, range: NSRange(location: 0, length: (str.count))) } } if (preTextColor != nil) { string.addAttribute(NSAttributedString.Key.foregroundColor, value: preTextColor as Any, range: range ?? NSRange()) } return string } open func createAtributedText() { prevTextRange = selectedTextRange attributedText = atrributeText(fromText: text!, isText: true) } open func setPreTextSide(_ preTextSide: PreTextSide) { self.preTextSide = preTextSide createAtributedPlaceHolder() } open func setPlaceHolderColor(_ placeHolderColor: UIColor) { self.placeHolderColor = placeHolderColor createAtributedPlaceHolder() } }
32.554945
157
0.561013
20d616cfac018c9ff666ca836992f374e4fa2104
889
sql
SQL
sharding-jdbc-transaction-example/src/main/resources/manual_schema.sql
root1005214/sharding-jdbc-example
b93e487b6f8c8f0bf01a597afb1e9dea1800003c
[ "Apache-2.0" ]
1
2018-07-31T09:43:57.000Z
2018-07-31T09:43:57.000Z
sharding-jdbc-example/transaction-example/src/main/resources/manual_schema.sql
beckhampu/sharding-sphere-example
0bee649d8f0e8943a3b7f4d93a40cc9b1f2bec56
[ "Apache-2.0" ]
null
null
null
sharding-jdbc-example/transaction-example/src/main/resources/manual_schema.sql
beckhampu/sharding-sphere-example
0bee649d8f0e8943a3b7f4d93a40cc9b1f2bec56
[ "Apache-2.0" ]
null
null
null
DROP SCHEMA IF EXISTS trans_log; DROP SCHEMA IF EXISTS ds_trans_0; DROP SCHEMA IF EXISTS ds_trans_1; DROP SCHEMA IF EXISTS ds_trans_2; DROP SCHEMA IF EXISTS ds_trans_3; DROP SCHEMA IF EXISTS ds_trans_4; DROP SCHEMA IF EXISTS ds_trans_5; DROP SCHEMA IF EXISTS ds_trans_6; DROP SCHEMA IF EXISTS ds_trans_7; DROP SCHEMA IF EXISTS ds_trans_8; DROP SCHEMA IF EXISTS ds_trans_9; DROP SCHEMA IF EXISTS ds_trans_10; CREATE SCHEMA IF NOT EXISTS trans_log; CREATE SCHEMA IF NOT EXISTS ds_trans_0; CREATE SCHEMA IF NOT EXISTS ds_trans_1; CREATE SCHEMA IF NOT EXISTS ds_trans_2; CREATE SCHEMA IF NOT EXISTS ds_trans_3; CREATE SCHEMA IF NOT EXISTS ds_trans_4; CREATE SCHEMA IF NOT EXISTS ds_trans_5; CREATE SCHEMA IF NOT EXISTS ds_trans_6; CREATE SCHEMA IF NOT EXISTS ds_trans_7; CREATE SCHEMA IF NOT EXISTS ds_trans_8; CREATE SCHEMA IF NOT EXISTS ds_trans_9; CREATE SCHEMA IF NOT EXISTS ds_trans_10;
34.192308
40
0.823397
e7719d948f6b8ce0a01631a7f907587a0e00315b
1,588
js
JavaScript
lib/event.js
gitrows/gitrows-utils
83a4041ad1e201eb75dbc749325fa60d9e92de34
[ "MIT" ]
null
null
null
lib/event.js
gitrows/gitrows-utils
83a4041ad1e201eb75dbc749325fa60d9e92de34
[ "MIT" ]
null
null
null
lib/event.js
gitrows/gitrows-utils
83a4041ad1e201eb75dbc749325fa60d9e92de34
[ "MIT" ]
null
null
null
const url = require('url'); const Event={ getData:async(event)=>{ let body=event.isBase64Encoded?Buffer.from(event.body, 'base64').toString('utf-8'):event.body; let data,urlParams; switch (event.headers['content-type']) { case 'application/x-www-form-urlencoded': urlParams=new url.URLSearchParams(body); data=Object.fromEntries(urlParams); break; default: try { data=JSON.parse(body); } catch (e) { data=body; } } return data; }, getQueryParams:(event)=>{ if (Event.hasMultiHeaders(event)) return Event._flatten(event.multiValueQueryStringParameters); return event.queryStringParameters; }, getHeaders:(event)=>{ if (Event.hasMultiHeaders(event)) return Event._flatten(event.multiValueHeaders); return event.headers; }, getAuth:(event)=>{ const headers=Event.getHeaders(event); if (Array.isArray(headers.authorization)) headers.authorization=headers.authorization.pop(); headers.authorization?headers.authorization.split(' '):false; }, getCookies:(event)=>{ const headers=Event.getHeaders(event); return headers.cookie?Object.fromEntries(headers.cookie.split('; ').map(x => x.split('='))):{}; }, hasMultiHeaders:(event)=>{ return !!(event.multiValueHeaders); }, _flatten:(data)=>{ Object.keys(data).forEach((key)=>{ if (Array.isArray(data[key])&&data[key].length<2) data[key]=data[key][0]; }); return data; }, _isCompressed:buf=>{ if (!buf || buf.length < 3) { return false; } return buf[0] === 0x1F && buf[1] === 0x8B && buf[2] === 0x08; }, } module.exports = Event;
23.352941
97
0.671285
125d228f6e984044c8f394c95e4f9e013aafe9bd
280
c
C
test.c
muhammadrefa/bno055_stm32
6d4e0d8428ea9ba1a70dcaab86119a8e1123570a
[ "MIT" ]
21
2019-08-24T10:07:41.000Z
2022-03-05T06:15:58.000Z
test.c
muhammadrefa/bno055_stm32
6d4e0d8428ea9ba1a70dcaab86119a8e1123570a
[ "MIT" ]
16
2019-04-15T09:47:11.000Z
2021-10-11T04:51:28.000Z
test.c
muhammadrefa/bno055_stm32
6d4e0d8428ea9ba1a70dcaab86119a8e1123570a
[ "MIT" ]
11
2019-08-22T20:57:30.000Z
2021-11-29T20:46:39.000Z
#include "bno055.h" #define I2C_HandleTypeDef int; // I2C_HandleTypeDef *_bno055_i2c_port; void bno055_delay(int time) { } void bno055_writeData(uint8_t reg, uint8_t data) { } void bno055_readData(uint8_t reg, uint8_t *data, uint8_t len) { } int main() { bno055_setup(); }
15.555556
63
0.735714
750c7405e4c5bc1643d25f9a8aa20b13e308fa50
231
h
C
Paleta.h
NightZpy/SDL-Pong
dfbe5b4caeead87d31579f8ad4114eb85cba32d3
[ "BSD-3-Clause" ]
null
null
null
Paleta.h
NightZpy/SDL-Pong
dfbe5b4caeead87d31579f8ad4114eb85cba32d3
[ "BSD-3-Clause" ]
null
null
null
Paleta.h
NightZpy/SDL-Pong
dfbe5b4caeead87d31579f8ad4114eb85cba32d3
[ "BSD-3-Clause" ]
null
null
null
#ifndef PALETA_H_INCLUDED #define PALETA_H_INCLUDED #endif // PALETA_H_INCLUDED class name { public: private: SDL_Surface *imagen = NULL; double x = 0; double y = 0; double velocidad = 0.0; };
11
30
0.623377
e162976ffed0b244e05a7c4c9c68aca450037417
745
sql
SQL
phase 8/challenges/korning/schema.sql
TimeBombx/launch_academy
4dfc47d576882aa3a60f1241324bea7101d60049
[ "MIT" ]
null
null
null
phase 8/challenges/korning/schema.sql
TimeBombx/launch_academy
4dfc47d576882aa3a60f1241324bea7101d60049
[ "MIT" ]
null
null
null
phase 8/challenges/korning/schema.sql
TimeBombx/launch_academy
4dfc47d576882aa3a60f1241324bea7101d60049
[ "MIT" ]
null
null
null
-- DEFINE YOUR DATABASE SCHEMA HERE DROP TABLE IF EXISTS employees; CREATE TABLE employees ( id serial PRIMARY KEY, first_name varchar(100), last_name varchar(100), email varchar(100) ); DROP TABLE IF EXISTS customers; CREATE TABLE customers ( id serial PRIMARY KEY, name varchar(100), account_number varchar(100) ); DROP TABLE IF EXISTS products; CREATE TABLE products ( id serial PRIMARY KEY, name varchar(100) ); DROP TABLE IF EXISTS sales; CREATE TABLE sales ( id serial PRIMARY KEY, employee int REFERENCES employees(id), customer int REFERENCES customers(id), product int REFERENCES products(id), sale_date date, sale_amount int, units_sold int, invoice_no int, invoice_frequency varchar(100) );
19.102564
40
0.743624
058fe639e0451bd8eb402c5a4b1f8778b550ef2e
81
rb
Ruby
lib/serialist.rb
bbenezech/serialist
9cbb18a1623f8d7074a7eed47a1a551607302321
[ "MIT" ]
1
2016-05-09T14:43:16.000Z
2016-05-09T14:43:16.000Z
lib/serialist.rb
bbenezech/serialist
9cbb18a1623f8d7074a7eed47a1a551607302321
[ "MIT" ]
null
null
null
lib/serialist.rb
bbenezech/serialist
9cbb18a1623f8d7074a7eed47a1a551607302321
[ "MIT" ]
null
null
null
require 'serialist/serialist_module' ActiveRecord::Base.send(:include, Serialist)
40.5
44
0.839506
93716c5c56edfb87347d5de01fa12ab34bfa9756
3,034
rs
Rust
zargo/src/command/download.rs
vikkkko/zincM
dd1fabf6d736ca2ac4884cca7a3929aadb9e7e28
[ "Apache-2.0" ]
291
2020-04-08T23:04:37.000Z
2022-03-27T06:53:46.000Z
zargo/src/command/download.rs
vikkkko/zincM
dd1fabf6d736ca2ac4884cca7a3929aadb9e7e28
[ "Apache-2.0" ]
14
2020-07-12T23:14:11.000Z
2021-10-04T15:51:06.000Z
zargo/src/command/download.rs
litezk/zinc
f28b41f172cfc14e6793ae5d6e37e59f1e406a7d
[ "Apache-2.0" ]
34
2020-04-30T02:15:55.000Z
2021-12-13T14:52:33.000Z
//! //! The Zargo package manager `download` subcommand. //! use std::path::PathBuf; use std::str::FromStr; use structopt::StructOpt; use crate::error::Error; use crate::http::downloader::Downloader; use crate::http::Client as HttpClient; use crate::network::Network; /// /// The Zargo package manager `download` subcommand. /// #[derive(Debug, StructOpt)] #[structopt(about = "Initializes a new project in the specified directory")] pub struct Command { /// Prints more logs, if passed several times. #[structopt(short = "v", long = "verbose", parse(from_occurrences))] pub verbosity: usize, /// Suppresses output, if set. #[structopt(short = "q", long = "quiet")] pub quiet: bool, /// If set, shows the list of uploaded projects and exits. #[structopt(long = "list")] pub list: bool, /// Sets the project name to download. #[structopt(long = "name")] pub name: Option<String>, /// Sets the project version to download. #[structopt(long = "version")] pub version: Option<semver::Version>, /// Sets the network name, where the project must be downloaded from. #[structopt(long = "network", default_value = "localhost")] pub network: String, /// The path to the project directory to initialize. #[structopt(parse(from_os_str))] pub path: Option<PathBuf>, } impl Command { /// /// A shortcut constructor. /// pub fn new( verbosity: usize, quiet: bool, list: bool, name: Option<String>, version: Option<semver::Version>, network: Option<String>, path: Option<PathBuf>, ) -> Self { Self { verbosity, quiet, list, name, version, network: network .unwrap_or_else(|| Network::from(zksync::Network::Localhost).to_string()), path, } } /// /// Executes the command. /// pub async fn execute(self) -> anyhow::Result<()> { let network = zksync::Network::from_str(self.network.as_str()) .map(Network::from) .map_err(Error::NetworkInvalid)?; let url = network .try_into_url() .map_err(Error::NetworkUnimplemented)?; let http_client = HttpClient::new(url); if self.list { for project in http_client.metadata().await?.projects.into_iter() { if !self.quiet { println!("{}-{}", project.name, project.version); } } return Ok(()); } let name = self.name.ok_or(Error::ProjectNameMissing)?; let version = self.version.ok_or(Error::ProjectVersionMissing)?; let project_path = match self.path { Some(path) => path, None => PathBuf::from(name.as_str()), }; let mut downloader = Downloader::new(&http_client, &project_path); downloader.download_project(name, version).await?; Ok(()) } }
27.581818
90
0.577456
63d4f36b6253ddf7306d3bdd57e182bbcbdae913
1,951
kt
Kotlin
src/main/java/com/sayzen/campfiresdk/models/cards/post_pages/CardPageImage.kt
ZeonXX/CampfireSDKKotlin
f35704dd1b362a631055fa64768decc0d612a46c
[ "Apache-2.0" ]
null
null
null
src/main/java/com/sayzen/campfiresdk/models/cards/post_pages/CardPageImage.kt
ZeonXX/CampfireSDKKotlin
f35704dd1b362a631055fa64768decc0d612a46c
[ "Apache-2.0" ]
null
null
null
src/main/java/com/sayzen/campfiresdk/models/cards/post_pages/CardPageImage.kt
ZeonXX/CampfireSDKKotlin
f35704dd1b362a631055fa64768decc0d612a46c
[ "Apache-2.0" ]
4
2019-10-27T09:31:52.000Z
2021-12-31T13:26:22.000Z
package com.sayzen.campfiresdk.models.cards.post_pages import android.view.View import android.widget.ImageView import com.dzen.campfire.api.API_TRANSLATE import com.dzen.campfire.api.models.publications.PagesContainer import com.dzen.campfire.api.models.publications.post.PageImage import com.sayzen.campfiresdk.R import com.sayzen.campfiresdk.controllers.ControllerPost import com.sayzen.campfiresdk.controllers.t import com.sup.dev.android.libs.screens.navigator.Navigator import com.sup.dev.android.libs.image_loader.ImageLoader import com.sup.dev.android.views.screens.SImageView class CardPageImage( pagesContainer: PagesContainer?, page: PageImage ) : CardPage(R.layout.card_page_image, pagesContainer, page) { override fun getChangeMenuItemText() = t(API_TRANSLATE.app_crop) override fun bindView(view: View) { super.bindView(view) val page = this.page as PageImage val vImage: ImageView = view.findViewById(R.id.vImage) val vGifProgressBar: View = view.findViewById(R.id.vGifProgressBar) vGifProgressBar.visibility = View.GONE if (clickable) vImage.setOnClickListener { onImageClicked() } else vImage.setOnClickListener(null) vImage.isFocusable = false vImage.isClickable = clickable vImage.isFocusableInTouchMode = false ImageLoader.loadGif(page.imageId, page.gifId, vImage, vGifProgressBar){ it.size(page.w, page.h) } } private fun onImageClicked() { if (pagesContainer != null) { val page = this.page as PageImage ControllerPost.toImagesScreen(pagesContainer, page.imageId) } else { Navigator.to(SImageView(ImageLoader.load((page as PageImage).getMainImageId()))) } } override fun notifyItem() { ImageLoader.load((page as PageImage).imageId).size((page as PageImage).w, (page as PageImage).h).intoCash() } }
34.839286
115
0.717068
ed338c6b27ea8c70f43c971079b9602aa6f075c5
50
sql
SQL
src/test/resources/com/foundationdb/sql/compiler/normalize/select-6i.sql
liangry/sqlparser
b995ed138c164f1156e3d7477a62de7619472429
[ "Apache-2.0" ]
617
2015-01-14T09:18:07.000Z
2021-08-05T06:39:29.000Z
oceanus-all/oceanus-exchange/oceanus-exchange-jdbc/src/test/resources/com/bj58/sql/compiler/normalize/select-6i.sql
diycp/Oceanus
62d8717f5f4f76a49d751fd8fbea9fe8250e3f5e
[ "Apache-2.0" ]
5
2015-01-28T05:49:22.000Z
2019-01-07T06:05:01.000Z
oceanus-all/oceanus-exchange/oceanus-exchange-jdbc/src/test/resources/com/bj58/sql/compiler/normalize/select-6i.sql
diycp/Oceanus
62d8717f5f4f76a49d751fd8fbea9fe8250e3f5e
[ "Apache-2.0" ]
348
2015-01-14T09:18:07.000Z
2021-06-17T09:17:48.000Z
SELECT * FROM t WHERE NOT (c IN (SELECT c FROM u))
50
50
0.68
a18118a6ca2fde0b3e43c9d426c35bb3e334ba52
1,617
go
Go
pkg/highlight/unicode.go
5paceToast/micro
9484e083244f6249df59b364f3584ce0e95cac79
[ "Apache-2.0", "MIT" ]
21,446
2016-03-23T19:56:03.000Z
2022-03-31T22:08:38.000Z
pkg/highlight/unicode.go
5paceToast/micro
9484e083244f6249df59b364f3584ce0e95cac79
[ "Apache-2.0", "MIT" ]
1,958
2016-04-17T21:51:01.000Z
2022-03-31T22:26:16.000Z
pkg/highlight/unicode.go
5paceToast/micro
9484e083244f6249df59b364f3584ce0e95cac79
[ "Apache-2.0", "MIT" ]
1,577
2016-04-18T02:33:59.000Z
2022-03-30T15:49:20.000Z
package highlight import ( "unicode" "unicode/utf8" ) var minMark = rune(unicode.Mark.R16[0].Lo) func isMark(r rune) bool { // Fast path if r < minMark { return false } return unicode.In(r, unicode.Mark) } // DecodeCharacter returns the next character from an array of bytes // A character is a rune along with any accompanying combining runes func DecodeCharacter(b []byte) (rune, []rune, int) { r, size := utf8.DecodeRune(b) b = b[size:] c, s := utf8.DecodeRune(b) var combc []rune for isMark(c) { combc = append(combc, c) size += s b = b[s:] c, s = utf8.DecodeRune(b) } return r, combc, size } // DecodeCharacterInString returns the next character from a string // A character is a rune along with any accompanying combining runes func DecodeCharacterInString(str string) (rune, []rune, int) { r, size := utf8.DecodeRuneInString(str) str = str[size:] c, s := utf8.DecodeRuneInString(str) var combc []rune for isMark(c) { combc = append(combc, c) size += s str = str[s:] c, s = utf8.DecodeRuneInString(str) } return r, combc, size } // CharacterCount returns the number of characters in a byte array // Similar to utf8.RuneCount but for unicode characters func CharacterCount(b []byte) int { s := 0 for len(b) > 0 { r, size := utf8.DecodeRune(b) if !isMark(r) { s++ } b = b[size:] } return s } // CharacterCount returns the number of characters in a string // Similar to utf8.RuneCountInString but for unicode characters func CharacterCountInString(str string) int { s := 0 for _, r := range str { if !isMark(r) { s++ } } return s }
18.802326
68
0.672233
9adfdd3108374aa82a791055426385ade39502d7
1,107
css
CSS
modulo-02/css/style-exercicios-022-css.css
marceloicampos/site-hello-world
4814ce2e049868941b8f3456f195943f205d6710
[ "MIT" ]
2
2021-06-08T16:50:16.000Z
2021-11-15T00:18:21.000Z
modulo-02/css/style-exercicios-022-css.css
marceloicampos/site-hello-world
4814ce2e049868941b8f3456f195943f205d6710
[ "MIT" ]
null
null
null
modulo-02/css/style-exercicios-022-css.css
marceloicampos/site-hello-world
4814ce2e049868941b8f3456f195943f205d6710
[ "MIT" ]
null
null
null
@charset "UTF-8"; /* em HTML é id = em CSS é # (só pode um elemento por id) em HTML é class = CSS é . (pode vários elementos por class) */ body { margin-bottom: 96px; background-color: #9cfccb; font-family: Arial, Helvetica, sans-serif; } h1 { color: #1e402f; } h1#principal { color: #fff; text-align: center; background-color: #3c805e; } h2 { color: #3c805e; } .basic { color: red; } .intermediate { color: blue; } .advanced { color: green; } .spotlight { background-color: yellow; } a, a:visited { color: #fff; font-weight: bolder; text-decoration: none; } a:hover { text-decoration: underline; } .foot { text-align: center; position: fixed; left: 0; bottom: 0; height: auto; width: 100%; background-color: #000000; text-align: center; } .foot p { color: #fff; text-align: center; font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: normal; } .foot a { color: #606060; text-decoration: none; } .foot a:hover { text-decoration: underline; }
13.5
59
0.597109
6e1d8054a947c1296432543a450d3f3911732d14
632
html
HTML
my_wallet/templates/registration/password_reset_confirm.html
Bounty1993/my-wallet
c14f8efaa1c3b90f9d5b0a6c5b5aabb26ed541fa
[ "MIT" ]
null
null
null
my_wallet/templates/registration/password_reset_confirm.html
Bounty1993/my-wallet
c14f8efaa1c3b90f9d5b0a6c5b5aabb26ed541fa
[ "MIT" ]
8
2020-06-05T19:52:06.000Z
2022-03-11T23:40:19.000Z
my_wallet/templates/registration/password_reset_confirm.html
Bounty1993/my-wallet
c14f8efaa1c3b90f9d5b0a6c5b5aabb26ed541fa
[ "MIT" ]
null
null
null
{% extends "base.html" %} {% load crispy_forms_tags %} {% block content %} <main> <div class="row"> <div class="col-sm-6 offset-sm-3"> <div class="main-panel login_panel shadowing card card-default mt-4"> <div class="card-heading"> <h2>Podaj nowe hasło</h2> <div class="card-body"> <form method="POST" action=""> {% csrf_token %} {{ form | crispy }} <button type="submit" class="btn btn-success w-100">Zmień hasło</button> </form> </div> </div> </div> </div> </div> </main> {% endblock content %}
28.727273
86
0.515823
c1ce13a49143e12b5f963e336148e6bc08da7f4b
5,243
lua
Lua
lua/gamemodes/survival/commands.lua
igor725/LuaClassic
5a1642e907cba6d26ad2ed7660bc1e22289cb019
[ "MIT" ]
9
2019-06-09T16:17:44.000Z
2021-11-23T02:46:38.000Z
lua/gamemodes/survival/commands.lua
codingwatching/LuaClassic
92beacaf8505fdff82fd25215bb15443601f8b68
[ "MIT" ]
1
2020-12-03T23:38:44.000Z
2021-08-08T04:52:30.000Z
lua/gamemodes/survival/commands.lua
codingwatching/LuaClassic
92beacaf8505fdff82fd25215bb15443601f8b68
[ "MIT" ]
4
2019-06-13T22:09:54.000Z
2022-03-04T14:20:20.000Z
--[[ Copyright (c) 2019 igor725, scaledteam released under The MIT license http://opensource.org/licenses/MIT ]] addCommand('give', function(isConsole, player, args) if #args < 1 then return false end local id, count, target if isConsole then if #args < 2 then return false end target = getPlayerByName(args[1]) id = args[2] count = args[3] else if #args == 2 then id = args[1] count = args[2] elseif #args > 2 then target = getPlayerByName(args[1]) id = args[2] count = args[3] elseif #args == 1 then id = args[1] count = SURV_STACK_SIZE end target = target or player end if not target then return MESG_PLAYERNF end if player and target ~= player and not player:checkPermission('commands.give-others')then return end id = tonumber(id)or 0 count = tonumber(count)or SURV_STACK_SIZE count = math.min(math.max(count, 1), SURV_STACK_SIZE) local given = survInvAddBlock(target, id, count) if given > 0 then target:holdThis(id) return (CMD_GIVE):format(given, survGetBlockName(id), target) end end) addCommand('heal', function(isConsole, player, args) if isConsole and #args < 1 then return false end local target = (#args > 0 and getPlayerByName(args[1]))or player if not target then return MESG_PLAYERNF end if player and target ~= player and not player:checkPermission('commands.heal-others')then return end if target.health ~= SURV_MAX_HEALTH then target.health = SURV_MAX_HEALTH survUpdateHealth(target) end if target.oxygen ~= SURV_MAX_OXYGEN then target.oxygen = SURV_MAX_OXYGEN survUpdateOxygen(target) end return (CMD_HEAL):format(target) end) addCommand('drop', function(isConsole, player, args) if isConsole then return CON_INGAMECMD end local bId = player:getHeldBlock() if bId < 1 then return end if #args > 1 then local target = getPlayerByName(args[1])or getPlayerByName(args[2]) local quantity = tonumber(args[2])or tonumber(args[1])or 1 local x, y, z = player:getPos() if not target then return MESG_PLAYERNF end if target == player then return false end if distance(x, y, z, target:getPos()) > 6 then return CMD_DROPTOOFAR end local inv1 = player.inventory local inv2 = target.inventory quantity = math.min(quantity, SURV_STACK_SIZE - inv2[bId]) if quantity < 1 then return false end local name = survGetBlockName(bId) if inv1[bId] >= quantity then inv1[bId] = inv1[bId] - quantity inv2[bId] = inv2[bId] + quantity survUpdateBlockInfo(player) survUpdateBlockInfo(target) survUpdateInventory(player, bId) survUpdateInventory(target, bId) target:sendMessage((MESG_DROP):format(quantity, name, player)) return (CMD_DROPSUCCP):format(quantity, name, target) else return (CMD_DROPNE):format(quantity, name) end end return false end) addCommand('kill', function(isConsole, player, args) if isConsole and #args < 1 then return false end local target = (#args > 0 and getPlayerByName(args[1]))or player if not target then return MESG_PLAYERNF end if player and target ~= player and not player:checkPermission('commands.kill-others')then return end if not survDamage(nil, target, SURV_MAX_HEALTH, 0)then return MESG_NODMG end end) addCommand('god', function(isConsole, player, args) if isConsole and #args < 1 then return false end local target = getPlayerByName(args[1])or player if not target then return MESG_PLAYERNF end if player and target ~= player and not player:checkPermission('commands.god-others')then return end target.isInGodmode = not target.isInGodmode local state = (target.isInGodmode and ST_ON)or ST_OFF local h = target.isInGodmode and 1 or 0 target:hackControl(h, h, h, 0, 1, -1) for i = 1, SURV_INV_SIZE do if isValidBlockID(i)then survUpdatePermission(target, i) end end if target.isInGodmode then survPauseTimers(target) target.inCraftMenu = false target.health = SURV_MAX_HEALTH target.oxygen = SURV_MAX_OXYGEN else survResumeTimers(target) end survUpdateHealth(target) survUpdateOxygen(target) survUpdateInventory(target) survUpdateBlockInfo(target) return (CMD_GOD):format(state, target) end) addCommand('home', function(isConsole, player, args) if isConsole then return CON_INGAMECMD end local hp = player.homepos local ha = player.homeang local hw = player.homeworld if hp and ha and hw then local wld = getWorld(hw) if not wld then return WORLD_NF end if player:isInWorld(wld)then player:teleportTo(hp.x, hp.y, hp.z, ha.yaw, ha.pitch) else player:changeWorld(wld, true, hp.x, hp.y, hp.z, ha.yaw, ha.pitch) end else return CMD_HOMENF end end) addCommand('sethome', function(isConsole, player, args) if isConsole then return CON_INGAMECMD end local hp = player.homepos local ha = player.homeang if hp and ha then hp.x, hp.y, hp.z = player:getPos() ha.yaw, ha.pitch = player:getEyePos() else hp = newVector(player:getPos()) ha = newAngle(player:getEyePos()) end player.homepos = hp player.homeang = ha player.homeworld = player.worldName return CMD_HOMESET end) addCommand('pvp', function(isConsole, player, args) player.pvpmode = not player.pvpmode return (CMD_PVP):format((player.pvpmode and ST_ON)or ST_OFF) end)
24.966667
90
0.730879
3cfeb1efc92bf5122a6c58c62f8d0f95646a3ff3
435
lua
Lua
src/main.lua
Zhorander/lit_fam_gaming
2d0a20ce0e6acf201a535dd8bc1a9b06678e8195
[ "MIT" ]
null
null
null
src/main.lua
Zhorander/lit_fam_gaming
2d0a20ce0e6acf201a535dd8bc1a9b06678e8195
[ "MIT" ]
null
null
null
src/main.lua
Zhorander/lit_fam_gaming
2d0a20ce0e6acf201a535dd8bc1a9b06678e8195
[ "MIT" ]
null
null
null
-- main.lua -- entry point of the game local Stack = require('util.stack') local Context = require('util.context') local menu = require('menu.menu') --Create global stack so any module can pop or push contexts contextStack = Stack:new() --Create contexts of all modules menuContext = Context:new(menu) --We'll start in the menu context contextStack:push(menuContext) local currentContext = contextStack:peek() currentContext:set()
24.166667
60
0.756322
952ee4cafd6df6f69d7c0ca98b4021bdbdb64ad9
13,794
css
CSS
wordpress/wp-content/themes/developry-lite/assets/css/developry-lite.css
al83/firefly
481cc0084b5ef8c725e5b823cfbcc45d88da5430
[ "MIT" ]
null
null
null
wordpress/wp-content/themes/developry-lite/assets/css/developry-lite.css
al83/firefly
481cc0084b5ef8c725e5b823cfbcc45d88da5430
[ "MIT" ]
null
null
null
wordpress/wp-content/themes/developry-lite/assets/css/developry-lite.css
al83/firefly
481cc0084b5ef8c725e5b823cfbcc45d88da5430
[ "MIT" ]
null
null
null
/** * Basic theme stylesheet that can be easily extended and customized. */ body { opacity: 0; } i, img, input, button, .icon { transition: all 0.3s ease-in-out; -o-transition: all 0.3s ease-in-out; -ms-transition: all 0.3s ease-in-out; -moz-transition: all 0.3s ease-in-out; -webkit-transition: all 0.3s ease-in-out; } a:focus, a:active, input:focus, button:focus, textarea:focus, select:focus, button:focus { outline: none; text-decoration: none; } a::-moz-focus-inner, input::-moz-focus-inner, button::-moz-focus-inner, textarea::-moz-focus-inner, select::-moz-focus-inner { border: 0; } ::selection { background: #f2f2f2; } ::-moz-selection { background: #f2f2f2; } input::placeholder { color: #f2f2f2; } input:-moz-placeholder { color: #f2f2f2; } input:-ms-input-placeholder { color: #f2f2f2; } input::-moz-placeholder { color: #f2f2f2; } input::-webkit-input-placeholder { color: #f2f2f2; } input:placeholder-shown { color: #f2f2f2; } a { font-weight: 700; } a:hover, a:active, a:focus { text-decoration: none; } p, li { line-height: 1.8; } pre { background-color: rgba(0, 0, 0, 0.04); padding: 1.5rem; margin: 1rem; border: 1px solid rgba(0, 0, 0, 0.08); font-family: monospace; font-size: 1.2rem; } address { font-style: italic; } code { font-family: monospace; font-size: 1.2rem; white-space: pre; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; } blockquote { border-left: 5px solid rgba(0, 0, 0, 0.08); margin-bottom: 2rem !important; padding: 2rem; } /** * MISC */ .wpcf7-form label { display: block; line-height: 3; font-weight: 700; text-transform: uppercase; font-size: 1rem; letter-spacing: 0.05em; } .wpcf7-submit { font-size: 1.4rem; display: block; width: 100%; } /** * UTILS */ .shadow { box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.10) !important; } .shadow-md { box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.08); } .shadow-lg { box-shadow: 0 15px 30px 0 rgba(0, 0, 0, 0.11), 0 5px 15px 0 rgba(0, 0, 0, 0.08); } .m\:screen { margin: 100vh 0px 0 0px; } .m\:180 { margin: 180px 45px 0 45px; } .m\:360 { margin: 360px 45px 0 45px; } @media (max-width: 992px) { .m\:screen { margin: 45px 0 0 0; } .m\:180, .m\:360 { margin: 15px 15px 0 15px; } } /** * HEADER */ .admin-bar .header { top: 32px; } .header { z-index: 70; position: fixed; top: 0; right: 0; left: 0; width: 100%; -o-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.10); -ms-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.10); -moz-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.10); -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.10); box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.10); } @media (max-width: 992px) { .header { z-index: 100; } } .header .navbar-collapse { flex-direction: row; align-items: center; justify-content: space-between; } @media (max-width: 992px) { .header .navbar-collapse { text-align: right; background-color: rgba(0, 0, 0, 0.1); padding: 15px; margin: 15px 0 10px 0; } } .header .widget, .header .widget label { margin-bottom: 0; } .header .navbar-collapse ul { list-style: none; margin: 0; padding: 0; } .header .navbar-collapse ul li { margin-right: 1rem; } .header .navbar-brand { overflow: hidden; text-overflow: ellipsis; max-width: 320px; font-weight: 100; font-size: 1.7rem; line-height: 1; text-transform: uppercase; letter-spacing: 0.3rem; } /** * MAIN NAV */ .main-nav-menu { } .main-nav-menu .sub-menu { position: relative; } .main-nav-menu .sub-menu .dropdown-menu { top: -9px; left: 107%; } .main-nav-menu .sub-menu.dropdown-menu .dropdown-toggle { position: relative; } .main-nav-menu .sub-menu.dropdown-menu .dropdown-toggle:after { position: absolute; right: 10px; top: 45%; transform: rotate(-90deg) } .menu-item a { font-weight: 400; } .current-menu-item > a { font-weight: 700; color: #c0c0c0 !important; } .sub-menu a { color: inherit !important; } .sub-menu a:hover, .sub-menu a:focus { color: #c0c0c0 !important; } /** * SEARCH FORM */ .search-form { position: relative; } .search-form label { display: block; } .search-form input[type=search] { width: 100%; padding-right: 80px; display: block; } .search-form input[type=submit] { position: absolute; top: 0; right: 0; } /** * COVER */ .blog .cover, .page .cover, .home.blog .cover, .single .cover { z-index: 20; background-size: cover; } .home .cover, .cover { position: absolute; /*position: fixed;*/ top: 0; left: 0; right: 0; overflow: hidden; z-index: 50; min-height: 100vh; width: 100%; background-size: cover; background-position: center center; } .cover-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 10; } .cover img { } .cover a.scrollbody { font-size: 1.2rem; position: absolute; bottom: 0; left: 0; width: 100%; text-align: center; background-color: rgba(0, 0, 0, 0.3); padding: 1rem 0 1rem 0; z-index: 40; } .cover-body { position: absolute; top: 0; left: 0; width: 50%; margin-left: 25%; height: 100%; text-align: center; display: flex; flex-direction: column; justify-content: center; z-index: 20; } .cover-body h1 { font-size: 6rem; line-height: 1; font-weight: 300; color: #f2f2f2; } .cover-body h4 { font-size: 2rem; font-weight: 400; color: #f2f2f2; } .cover-body h4 p { line-height: 1.4; } @media (max-width: 992px) { .home .cover, .cover { position: relative; min-height: 480px; } .cover img { width: 100%; } .cover-body { width: 90%; margin: 5%; position: relative; padding: 100px 0 100px 0; } .cover-body h1 { font-size: 3rem; } .cover-body h4 { font-size: 1.4rem; } } /** * WIDGETS */ .widget { margin-bottom: 1.5rem; } .widget h6, .widgettitle, .widget-title { text-transform: uppercase; font-size: 1rem; font-weight: 700; letter-spacing: 0.05rem; } .widget ul { margin: 0; padding: 0; } .widget ul > li { padding: 1rem 0 1rem 0; } .widget li { list-style-type: none; border-bottom: 1px solid rgba(0, 0, 0, 0.05); } .widget li:last-child { border-bottom: 0; } .widget li a { display: block; } .widget li li, .widget li li li { border-bottom: 0; padding: 0; } .widget li ul { background-color: #f2f2f2; } .widget ul ul { margin-top: 0.5rem; padding: 0 0.75rem 0 0.75rem; width: 100%; } .widget ul ul > li { line-height: 3; } .footer .widget ul ul { padding: 0; } .widget ul ul ul { padding-top: 0; padding-bottom: 0; } .widget_rss ul .rsswidget { font-size: 1rem; display: block; } .widget_rss ul .rss-date, .widget_rss ul cite { color: #6c757d; } .widget_calendar .table { margin-bottom: 0; } .widget_calendar .table caption { caption-side: top; text-align: center; text-transform: uppercase; background-color: rgba(0, 0, 0, 0.65); color: rgba(255, 255, 255, 0.5); } .widget_calendar .table tfoot { background-color: rgba(0, 0, 0, 0.15); } .widget_calendar .table #next { text-align: right; } /** * BODY */ .body { position: relative; z-index: 20; } /** * PAGE CONTENT */ .archive .page-content, .search .page-content { margin-top: 4rem; } .page-content { padding: 2rem; } @media (max-width: 768px) { .page-content { padding: 0; } } .page-content p { zoom: 1; } .page-content p:before, .page-content p:after { content: ""; display: table; } .page-content p:after { clear: both; } .content-title, .page-title, .comment-title, .comment-reply-title, .archive-title { font-weight: 100; margin-bottom: 1rem; margin-top: 0.75rem; -ms-word-wrap: break-word; word-wrap: break-word; } .content-title small { display: block; font-size: 1rem; text-transform: uppercase; margin-top: 1rem; font-weight: 700; } .content-header { margin-top: 0rem; text-align: center; border-bottom: 5px solid rgba(0, 0, 0, 0.1); margin-bottom: 1rem; } .content-header p { padding: 0.5rem; background-color: rgba(0, 0, 0, 0.05); } .content-header p a { overflow: hidden; display: block; } .content-header p:hover img { transform: scale(1.15); } .content-header i { padding: 3rem; border: 1px solid rgba(0, 0, 0, 0.1); width: 100%; font-size: 5rem; } .content-main { margin: 0 1.5rem 0 1.5rem; clear: both; overflow: hidden; } .content-main p:first-child { font-size: 1.2rem; font-weight: 300; } .content-main p:last-child { clear: both; overflow: hidden; display: table-block; content: ''; } .content-aside { background-color: rgba(0, 0, 0, 0.05); border: 0; padding: 0.75rem; margin-top: 1rem; margin-bottom: 3rem; font-size: 0.875rem; display: flex; align-items: center; position: relative; } .content-aside img { background-color: rgba(255, 255, 255, 0.95); border: 1px solid rgba(0, 0, 0, 0.1); padding: 0.25rem; border-radius: 80px; margin-right: 1rem; } .single .content-aside { margin-bottom: 1.5rem; } button.post-edit-link { position: absolute; bottom: 1rem; right: 1rem; color: #333333; } .comment-edit-link:after { content: '...'; } /** * PAGINATION */ .pagination { } .pagination a { -ms-word-wrap: break-word; word-wrap: break-word; overflow: hidden; position: relative; padding-left: 1.5rem; padding-right: 1.5rem; min-height: 75px; display: flex; align-items: center; width: 100%; justify-content: flex-end; background-color: rgb(0, 0, 0, 0.05); } .pagination a:hover, .pagination a:focus { background-color: rgb(0, 0, 0, 0.1); } .pagination a:first-child, .pagination a.previous-link, .pagination a.prev.page-numbers { padding-right: 0.75rem; justify-content: flex-start; border-right: 1px solid rgb(0, 0, 0, 0.1); position: relative; } .pagination a.previous-link i, .pagination a.prev.page-numbers i { position: absolute; top: 40%; left: 7px; } .pagination a:first-child:before { position: absolute; left: 7px; bottom: -7px; font-size: 5rem; line-height: 5rem; content: "Previous"; opacity: 0.05; } .pagination a.next-link, .pagination a.next.page-numbers { padding-left: 0.75rem; text-align: right; position: relative; } .pagination a:last-child:before { position: absolute; right: 7px; bottom: -7px; font-size: 5rem; line-height: 5rem; content: "Next"; opacity: 0.05; } .pagination a.next-link i, .pagination a.next.page-numbers i { position: absolute; top: 44%; right: 7px; } /** * COMMENTS */ /** * SIDEBAR */ .sidebar { padding: 1.5rem; } @media (max-width: 768px) { .sidebar { padding: 1rem; } } /** * FOOTER */ .footer { position: relative; z-index: 30; padding: 4rem 0 2rem 0; } .scrolltop { display: none; position: fixed; bottom: 6rem; right: 6rem; padding: 1rem; font-size: 1rem; line-height: 1; background: rgba(0, 0, 0, 0.1); z-index: 50; -o-border-radius: 4px; -ms-border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } @media (max-width: 992px) { .scrolltop { right: 0.5em; bottom: 0.5em; } } /** * SOCIAL NAV MENU */ .social-nav-menu ul, .social-nav-menu { margin: 0; padding: 0; } .social-nav-menu li { border-radius: 50px; width: 50px; height: 50px; margin: 0 15px 0 15px; background-color: rgba(0, 0, 0, 0.1); position: relative; list-style-type: none; display: inline-block; } .social-nav-menu li:before { font-size: 24px; text-align: center; display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; } .social-nav-menu li a, .menu-social-nav-container.navbar-nav li.icon a { text-indent: -9999px; font-size: 0; line-height: 0; width: 100%; min-width: 50px; height: 50px; display: inline-block; } .menu-social-nav-container.navbar-nav li.icon a:hover { background: transparent !important; } .icon { background-size: 25px 25px !important; -o-filter: grayscale(100%); -ms-filter: grayscale(100%); -moz-filter: grayscale(100%); -webkit-filter: grayscale(100%); filter: grayscale(100%); } .icon:hover { -o-transform: scale(1.25); -ms-transform: scale(1.25); -moz-transform: scale(1.25); -webkit-transform: scale(1.25); transform: scale(1.25); -o-filter: grayscale(0%); -ms-filter: grayscale(0%); -moz-filter: grayscale(0%); -webkit-filter: grayscale(0%); filter: grayscale(0%); } .icon-facebook { background: url(../img/icons/facebook.png) no-repeat center center; } .icon-twitter { background: url(../img/icons/twitter.png) no-repeat center center; } .icon-youtube { background: url(../img/icons/youtube.png) no-repeat center center; } .icon-instagram { background: url(../img/icons/instagram.png) no-repeat center center; } .icon-github { background: url(../img/icons/github.png) no-repeat center center; } .icon-linkedin { background: url(../img/icons/linkedin.png) no-repeat center center; } .icon-email { background: url(../img/icons/email.png) no-repeat center center; }
18.490617
82
0.608453
6698037bc1ccfc07cf632066a86578943629ec80
1,014
swift
Swift
Sources/Uppy/Sources/Services/UpdateService.swift
everli/uppy-ios-sdk
d2383ea74ec8697e8aa9bae4fa33395931464194
[ "Apache-2.0" ]
null
null
null
Sources/Uppy/Sources/Services/UpdateService.swift
everli/uppy-ios-sdk
d2383ea74ec8697e8aa9bae4fa33395931464194
[ "Apache-2.0" ]
null
null
null
Sources/Uppy/Sources/Services/UpdateService.swift
everli/uppy-ios-sdk
d2383ea74ec8697e8aa9bae4fa33395931464194
[ "Apache-2.0" ]
null
null
null
// // UpdateService.swift // Uppy // // Created by Arpit Williams on 02/07/20. // Copyright © 2020 Everli. All rights reserved. // import Foundation class UpdateService { func checkUpdates(for updateRequest: UpdateRequest, with completionHandler: @escaping (ObjectResponse<Update>?, ErrorResponse?) -> Void) { let updatesApi = "/api/v2/applications/\(GlobalConfig.shared.applicationID)/updates/iOS" Request(endpoint: updatesApi, method: .POST, bodyParams: updateRequest.dictionary).sendAsync { response in guard let data = response.data, response.isSuccess else { completionHandler(nil, try? ErrorFactory.decodeError(from: response)) logError(response.error) return } do { let updateObject = try JSONDecoder().decode(ObjectResponse<Update>.self, from: data) completionHandler(updateObject, nil) } catch { completionHandler(nil, try? ErrorFactory.decodeError(from: response)) } } } }
28.166667
110
0.675542
cb1ddee4421c1ed60eeb7619e09b58658ff507be
3,635
go
Go
vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_account_alias.go
karuppiah7890/terraformer
8a741f29b72fc6fe349ab84c89b5334895d2f016
[ "Apache-2.0" ]
409
2016-12-01T13:56:17.000Z
2022-02-28T01:32:59.000Z
vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_account_alias.go
OceanChen2012/terraform-provider
4a9a59e05c9703e16091e1980b56891ecd37c5f1
[ "Apache-2.0" ]
327
2016-12-27T10:52:38.000Z
2021-08-05T08:53:02.000Z
vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_account_alias.go
OceanChen2012/terraform-provider
4a9a59e05c9703e16091e1980b56891ecd37c5f1
[ "Apache-2.0" ]
149
2016-12-01T13:58:05.000Z
2022-03-14T06:15:13.000Z
package ram //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. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // GetAccountAlias invokes the ram.GetAccountAlias API synchronously // api document: https://help.aliyun.com/api/ram/getaccountalias.html func (client *Client) GetAccountAlias(request *GetAccountAliasRequest) (response *GetAccountAliasResponse, err error) { response = CreateGetAccountAliasResponse() err = client.DoAction(request, response) return } // GetAccountAliasWithChan invokes the ram.GetAccountAlias API asynchronously // api document: https://help.aliyun.com/api/ram/getaccountalias.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetAccountAliasWithChan(request *GetAccountAliasRequest) (<-chan *GetAccountAliasResponse, <-chan error) { responseChan := make(chan *GetAccountAliasResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.GetAccountAlias(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // GetAccountAliasWithCallback invokes the ram.GetAccountAlias API asynchronously // api document: https://help.aliyun.com/api/ram/getaccountalias.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetAccountAliasWithCallback(request *GetAccountAliasRequest, callback func(response *GetAccountAliasResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetAccountAliasResponse var err error defer close(result) response, err = client.GetAccountAlias(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // GetAccountAliasRequest is the request struct for api GetAccountAlias type GetAccountAliasRequest struct { *requests.RpcRequest } // GetAccountAliasResponse is the response struct for api GetAccountAlias type GetAccountAliasResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` AccountAlias string `json:"AccountAlias" xml:"AccountAlias"` } // CreateGetAccountAliasRequest creates a request to invoke GetAccountAlias API func CreateGetAccountAliasRequest() (request *GetAccountAliasRequest) { request = &GetAccountAliasRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "GetAccountAlias", "", "") return } // CreateGetAccountAliasResponse creates a response to parse from GetAccountAlias response func CreateGetAccountAliasResponse() (response *GetAccountAliasResponse) { response = &GetAccountAliasResponse{ BaseResponse: &responses.BaseResponse{}, } return }
34.951923
156
0.770564
7f0eb80d8aa6256c4e622a142b8edadd7657c4c8
10,592
rs
Rust
base/src/error.rs
Snarpix/gluon
25d949b8836d0cd28adc027f8d0e4e20a102aca1
[ "MIT" ]
2,261
2016-10-07T19:32:31.000Z
2022-03-31T18:35:43.000Z
base/src/error.rs
Snarpix/gluon
25d949b8836d0cd28adc027f8d0e4e20a102aca1
[ "MIT" ]
636
2016-10-08T01:43:31.000Z
2022-02-04T18:12:38.000Z
base/src/error.rs
Snarpix/gluon
25d949b8836d0cd28adc027f8d0e4e20a102aca1
[ "MIT" ]
156
2016-10-08T19:17:17.000Z
2022-02-16T07:53:21.000Z
//! Module containing a few common error wrappers which allows more information to be saved for //! later display to the user use std::any::Any; use std::error::Error as StdError; use std::fmt; use std::iter::{Extend, FromIterator}; use std::ops::{Index, IndexMut}; use std::slice; use std::str; use std::vec; use codespan_reporting::diagnostic::{Diagnostic, Label}; use crate::{ pos::{BytePos, Spanned}, source::FileId, }; /// An error type which can represent multiple errors. #[derive(Clone, Debug, Eq, PartialEq, Hash)] pub struct Errors<T> { errors: Vec<T>, } impl<T> Default for Errors<T> { fn default() -> Self { Errors::new() } } impl<T> Errors<T> { /// Creates a new, empty `Errors` instance. pub fn new() -> Errors<T> { Errors::from(Vec::new()) } /// Returns true if `self` contains any errors pub fn has_errors(&self) -> bool { !self.is_empty() } /// The number of errors in the error list pub fn len(&self) -> usize { self.errors.len() } pub fn is_empty(&self) -> bool { self.errors.is_empty() } /// Adds an error to `self` pub fn push(&mut self, t: T) { self.errors.push(t); } /// Pops and error off the error list pub fn pop(&mut self) -> Option<T> { self.errors.pop() } pub fn iter(&self) -> slice::Iter<T> { self.errors.iter() } pub fn drain( &mut self, range: impl std::ops::RangeBounds<usize>, ) -> impl Iterator<Item = T> + '_ { self.errors.drain(range) } } impl<T> Index<usize> for Errors<T> { type Output = T; fn index(&self, index: usize) -> &T { &self.errors[index] } } impl<T> IndexMut<usize> for Errors<T> { fn index_mut(&mut self, index: usize) -> &mut T { &mut self.errors[index] } } impl<T> Extend<T> for Errors<T> { fn extend<Iter: IntoIterator<Item = T>>(&mut self, iter: Iter) { self.errors.extend(iter); } } impl<T> From<Vec<T>> for Errors<T> { fn from(errors: Vec<T>) -> Errors<T> { Errors { errors } } } impl<T> FromIterator<T> for Errors<T> { fn from_iter<Iter: IntoIterator<Item = T>>(iter: Iter) -> Errors<T> { Errors { errors: iter.into_iter().collect(), } } } impl<T> Into<Vec<T>> for Errors<T> { fn into(self) -> Vec<T> { self.errors } } impl<T> IntoIterator for Errors<T> { type Item = T; type IntoIter = vec::IntoIter<T>; fn into_iter(self) -> vec::IntoIter<T> { self.errors.into_iter() } } impl<'a, T> IntoIterator for &'a Errors<T> { type Item = &'a T; type IntoIter = slice::Iter<'a, T>; fn into_iter(self) -> slice::Iter<'a, T> { self.errors.iter() } } impl<'a, T> IntoIterator for &'a mut Errors<T> { type Item = &'a mut T; type IntoIter = slice::IterMut<'a, T>; fn into_iter(self) -> slice::IterMut<'a, T> { self.errors.iter_mut() } } impl<T: fmt::Display> fmt::Display for Errors<T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { for (i, error) in self.errors.iter().enumerate() { write!(f, "{}", error)?; // Errors are assumed to not have a newline at the end so we add one to keep errors on // separate lines and one to space them out if i + 1 != self.errors.len() { writeln!(f)?; writeln!(f)?; } } Ok(()) } } impl<T: fmt::Display + fmt::Debug + Any> StdError for Errors<T> { fn description(&self) -> &str { "Errors" } } /// Error type which contains information of which file and where in the file the error occurred #[derive(Clone, Debug)] pub struct InFile<E> { source: crate::source::CodeMap, error: Errors<Spanned<E, BytePos>>, } impl<E> Eq for InFile<E> where E: Eq {} impl<E> PartialEq for InFile<E> where E: PartialEq, { fn eq(&self, other: &Self) -> bool { self.error == other.error } } impl<E> std::hash::Hash for InFile<E> where E: std::hash::Hash, { #[inline(always)] fn hash<H>(&self, state: &mut H) where H: std::hash::Hasher, { self.error.hash(state) } } impl<E: fmt::Display> InFile<E> { /// Creates a new `InFile` error which states that the error occurred in `file` using the file /// contents in `source` to provide a context to the span. pub fn new(source: crate::source::CodeMap, error: Errors<Spanned<E, BytePos>>) -> InFile<E> { let err = InFile { source, error }; // Verify that the source name can be accessed debug_assert!({ err.source_name(); true }); err } pub fn source_name(&self) -> &str { self.source .get(self.error[0].span.start()) .unwrap_or_else(|| { panic!( "Source file does not exist in associated code map. Error: {}", self.error ) }) .name() } pub fn source(&self) -> &crate::source::CodeMap { &self.source } pub fn errors(&self) -> &Errors<Spanned<E, BytePos>> { &self.error } pub fn into_errors(self) -> Errors<Spanned<E, BytePos>> { self.error } pub fn emit_string(&self) -> crate::source::Result<String> where E: AsDiagnostic, { let mut output = Vec::new(); self.emit(&mut ::codespan_reporting::term::termcolor::NoColor::new( &mut output, ))?; Ok(String::from_utf8(output).unwrap()) } pub fn emit( &self, writer: &mut dyn ::codespan_reporting::term::termcolor::WriteColor, ) -> crate::source::Result<()> where E: AsDiagnostic, { let iter = self .error .iter() .map(|error| error.as_diagnostic(&self.source)) .enumerate(); for (i, diagnostic) in iter { if i != 0 { writeln!(writer)?; } ::codespan_reporting::term::emit( &mut *writer, &Default::default(), &self.source, &diagnostic, )?; } Ok(()) } } impl<E: fmt::Display + AsDiagnostic> fmt::Display for InFile<E> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut buffer = Vec::new(); { let mut writer = ::codespan_reporting::term::termcolor::NoColor::new(&mut buffer); self.emit(&mut writer).map_err(|_| fmt::Error)?; } write!(f, "{}", str::from_utf8(&buffer).unwrap()) } } impl<E: fmt::Display + fmt::Debug + Any + AsDiagnostic> StdError for InFile<E> { fn description(&self) -> &str { "Error in file" } } #[derive(Debug, Eq, PartialEq, Hash, Clone)] pub struct Help<E, H> { pub error: E, pub help: Option<H>, } impl<E, H> fmt::Display for Help<E, H> where E: fmt::Display, H: fmt::Display, { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.error)?; if let Some(ref help) = self.help { writeln!(f)?; write!(f, "help: {}", help)?; } Ok(()) } } impl<E, H> From<E> for Help<E, H> { fn from(error: E) -> Help<E, H> { Help { error, help: None } } } pub trait AsDiagnostic { fn as_diagnostic(&self, map: &crate::source::CodeMap) -> Diagnostic<FileId>; } impl<E> AsDiagnostic for Spanned<E, BytePos> where E: AsDiagnostic, { fn as_diagnostic(&self, map: &crate::source::CodeMap) -> Diagnostic<FileId> { let mut diagnostic = self.value.as_diagnostic(map); for label in &mut diagnostic.labels { if label.file_id == FileId::default() { label.file_id = self.span.start(); } if label.range == (0..0) { if let Some(range) = self.span.to_range(map) { label.range = range; } } } if diagnostic.labels.is_empty() { if let Some(range) = self.span.to_range(map) { diagnostic .labels .push(Label::primary(self.span.start(), range)); } } diagnostic } } impl<E, H> AsDiagnostic for Help<E, H> where E: AsDiagnostic, H: fmt::Display, { fn as_diagnostic(&self, map: &crate::source::CodeMap) -> Diagnostic<FileId> { let mut diagnostic = self.error.as_diagnostic(map); if let Some(ref help) = self.help { diagnostic.labels.push( Label::secondary( diagnostic .labels .last() .map(|label| label.file_id) .unwrap_or_default(), 0..0, ) .with_message(help.to_string()), ); } diagnostic } } impl AsDiagnostic for Box<dyn ::std::error::Error + Send + Sync> { fn as_diagnostic(&self, _map: &crate::source::CodeMap) -> Diagnostic<FileId> { Diagnostic::error().with_message(self.to_string()) } } pub type SalvageResult<T, E> = std::result::Result<T, Salvage<T, E>>; #[derive(Clone, Debug, Eq, PartialEq)] pub struct Salvage<T, E> { pub value: Option<T>, pub error: E, } impl<T, E> fmt::Display for Salvage<T, E> where E: fmt::Display, { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.error) } } impl<T, E> Salvage<T, E> { pub fn map<U>(self, f: impl FnOnce(T) -> U) -> Salvage<U, E> { Salvage { value: self.value.map(f), error: self.error, } } pub fn map_err<U>(self, f: impl FnOnce(E) -> U) -> Salvage<T, U> { Salvage { value: self.value, error: f(self.error), } } pub fn get_value(self) -> std::result::Result<T, E> { self.value.ok_or(self.error) } pub fn err_into<F>(self) -> Salvage<T, F> where F: From<E>, { let Salvage { value, error } = self; Salvage { value, error: error.into(), } } } impl<T, E> From<E> for Salvage<T, E> { fn from(error: E) -> Self { Salvage { value: None, error } } } impl<T, E> From<Salvage<T, InFile<E>>> for InFile<E> { fn from(s: Salvage<T, InFile<E>>) -> Self { s.error } }
24.293578
98
0.525491
0c82f844757360c3545bf98aad68a6f84622e3da
711
py
Python
app/core/migrations/0009_auto_20210214_2113.py
Valentin-Golyonko/FlaskTestRPi
b9796a9acb2bb1c122301a3ef192f43c857eb27b
[ "Apache-2.0" ]
null
null
null
app/core/migrations/0009_auto_20210214_2113.py
Valentin-Golyonko/FlaskTestRPi
b9796a9acb2bb1c122301a3ef192f43c857eb27b
[ "Apache-2.0" ]
null
null
null
app/core/migrations/0009_auto_20210214_2113.py
Valentin-Golyonko/FlaskTestRPi
b9796a9acb2bb1c122301a3ef192f43c857eb27b
[ "Apache-2.0" ]
null
null
null
# Generated by Django 3.1.6 on 2021-02-14 18:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0008_auto_20210214_2039'), ] operations = [ migrations.AlterField( model_name='device', name='ip_address', field=models.GenericIPAddressField(blank=True, help_text='e.g. 192.168.0.17', null=True, verbose_name='IP address'), ), migrations.AlterField( model_name='device', name='mac_address', field=models.CharField(blank=True, help_text='e.g. A1:B2:C3:D4:5E:6F', max_length=100, null=True, verbose_name='MAC address'), ), ]
29.625
138
0.613221
ca1b73d66c63776ebac5d352e27457827dc6d1fe
2,093
swift
Swift
ShepardAppearanceConverter/ShepardAppearanceConverter/Views/Appearance/AppearanceME1Slider.swift
urdnot-ios/ShepardAppearanceConverter
68334fd43a72961705a71283ee31c5e95d22b755
[ "MIT" ]
null
null
null
ShepardAppearanceConverter/ShepardAppearanceConverter/Views/Appearance/AppearanceME1Slider.swift
urdnot-ios/ShepardAppearanceConverter
68334fd43a72961705a71283ee31c5e95d22b755
[ "MIT" ]
null
null
null
ShepardAppearanceConverter/ShepardAppearanceConverter/Views/Appearance/AppearanceME1Slider.swift
urdnot-ios/ShepardAppearanceConverter
68334fd43a72961705a71283ee31c5e95d22b755
[ "MIT" ]
null
null
null
// // AppearanceME1Slider.swift // ShepardAppearanceConverter // // Created by Emily Ivie on 7/23/15. // Copyright © 2015 urdnot. All rights reserved. // import UIKit public class AppearanceME1Slider: UIStackView { public lazy var headerStack: UIStackView! = { return self.arrangedSubviews.first as? UIStackView }() public lazy var valueStack: UIStackView! = { return self.headerStack.arrangedSubviews.last as? UIStackView }() public lazy var titleLabel: UILabel! = { if let wrapper = self.headerStack?.arrangedSubviews.first { return wrapper.subviews.first as? UILabel } return nil }() public lazy var valueLabel: UILabel! = { return self.valueStack?.arrangedSubviews.last as? UILabel }() public lazy var valueSlider: UISlider! = { return self.valueStack?.arrangedSubviews.first as? UISlider }() public lazy var noticeLabel: UILabel! = { for view in self.subviews where view is UILabel { return view as? UILabel } return nil }() public lazy var alertLabel: UILabel! = { var count = 0 for view in self.subviews where view is UILabel { if count++ < 1 { continue } return view as? UILabel } return nil }() // stack orientation by size classes still buggy in iOS 9. This hack corrects it. :( public override func layoutSubviews() { super.layoutSubviews() configureViewForSizeClass() } var lastHorizontalSizeClass: UIUserInterfaceSizeClass? private func configureViewForSizeClass() { if lastHorizontalSizeClass != .Regular && traitCollection.horizontalSizeClass == .Regular { headerStack.axis = .Horizontal lastHorizontalSizeClass = .Regular } else if lastHorizontalSizeClass != .Compact && traitCollection.horizontalSizeClass == .Compact { headerStack.axis = .Vertical lastHorizontalSizeClass = .Compact } } }
29.069444
106
0.62924
e75047b55c6171f5a6831285cdedd377d2412f17
1,273
js
JavaScript
src/hooks/useTouchAndMouse.js
drumnickydrum/sequencer64
4629ffc28a6d18262305e3a363cb94fe53180242
[ "MIT" ]
185
2021-03-26T21:47:16.000Z
2022-03-23T03:04:01.000Z
src/hooks/useTouchAndMouse.js
drumnickydrum/sequencer64
4629ffc28a6d18262305e3a363cb94fe53180242
[ "MIT" ]
null
null
null
src/hooks/useTouchAndMouse.js
drumnickydrum/sequencer64
4629ffc28a6d18262305e3a363cb94fe53180242
[ "MIT" ]
14
2021-05-11T21:43:28.000Z
2022-02-20T06:34:37.000Z
import { useRef, useState } from 'react'; // onTouchStart and onMouseDown are required on the target // onMouseMove and onMouseUp are handled by document listener // so out of bounds events are captured export const useTouchAndMouse = (startFunc, moveFunc, endFunc) => { const [touching, setTouching] = useState(false); const onTouchStart = (e) => { setTouching(true); if (startFunc) startFunc(e); }; const mouseDownRef = useRef(null); const onMouseDown = (e) => { if (touching) return; if (startFunc) startFunc(e); mouseDownRef.current = true; document.addEventListener('mouseup', onMouseUp); document.addEventListener('mousemove', onMouseMove); }; const onTouchMove = (e) => { if (moveFunc) moveFunc(e); }; const onMouseMove = (e) => { if (touching) return; if (moveFunc && mouseDownRef.current) moveFunc(e); }; const onTouchEnd = (e) => { if (endFunc) endFunc(e); }; const onMouseUp = (e) => { if (touching) return; if (endFunc) endFunc(e); mouseDownRef.current = false; document.removeEventListener('mouseup', onMouseUp); document.removeEventListener('mousemove', onMouseMove); }; return { onTouchStart, onMouseDown, onTouchMove, onTouchEnd, }; };
24.480769
67
0.659859
188a409abfaa998ac4ccee68ed135d61305bc359
2,277
css
CSS
public/frontEnd/css/rtl.css
guggie11/honeybee
185906c8cd90e9f175987a26de9e79caad4f7a2b
[ "MIT" ]
null
null
null
public/frontEnd/css/rtl.css
guggie11/honeybee
185906c8cd90e9f175987a26de9e79caad4f7a2b
[ "MIT" ]
null
null
null
public/frontEnd/css/rtl.css
guggie11/honeybee
185906c8cd90e9f175987a26de9e79caad4f7a2b
[ "MIT" ]
null
null
null
@import url('https://fonts.googleapis.com/css?family=Cairo'); body { font-family: 'tahoma', sans-serif; font-size: 14px; font-weight: 300; line-height: 1.6em; direction: rtl; } .navbar .nav > li > a ,h1,h2,h3,h4,.box-bottom a,.site-top a,.btn,.contacts strong,#inner-headline ul.breadcrumb li{ font-family: 'Cairo', sans-serif; } .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { float: right; } .navbar-nav > li { float: right; } .navbar-header { float: right; } header .navbar-collapse ul.navbar-nav { float: left; } .navbar .nav > li > a { margin-right: 25px; margin-left: 0px; font-size: 15px; } .pull-right { float: left !important; } .pull-left { float: right !important; } .copyright { text-align: right; } #sub-footer ul.social-network { float: left; } #inner-headline ul.breadcrumb { float: right; } ul.meta-post { float: right; } ul.meta-post li { float: right; border-left: 1px dotted #d1d1d1; border-right: 0px; margin: 0 0 0 10px; padding: 0 0 0 10px; } ul.meta-post li:last-child { border-left: 0px; } .dropdown-menu { position: absolute; top: 100%; right: 0; left: auto; float: right; } .flex-caption { right: auto; left: 45px; } footer ul.link-list li a:before { margin-left: 5px; margin-right: 0px; } .profile { float: right; margin-left: 20px; margin-right: 0px; } .pullquote-left { border-right: 5px solid #3494c8; border-left: 0px; margin-right: 65px; margin-left: 0px; padding-right: 20px; padding-left: 0px; } .text-right { text-align: left; } .text-left { text-align: right; } header ul.nav li ul li a { font-family: 'Cairo', sans-serif; } .navbar .nav > li > a i{ float: left; padding:10px 10px 0 10px; } @media (max-width: 767px){ header .navbar-collapse ul.navbar-nav { float: none !important; } header .navbar-nav > li { width: 100% !important; } .navbar-header { float: none!important; width: 100% !important; } } .navbar-toggle { float: left !important; margin-right: 0px; margin-left: 15px; }
19.134454
135
0.599473
8ac88f7873431cf53dfcb46d44cf51970fa164a5
6,279
kt
Kotlin
@old/korge-spriter/src/commonMain/kotlin/com/soywiz/korge/ext/spriter/com/brashmonkey/spriter/Calculator.kt
jfbilodeau/korge
fb2be4c25a32fa6a4a200badcf9b610f115f763c
[ "Apache-2.0" ]
1,212
2017-08-28T04:02:19.000Z
2022-03-30T04:32:23.000Z
@old/korge-spriter/src/commonMain/kotlin/com/soywiz/korge/ext/spriter/com/brashmonkey/spriter/Calculator.kt
jfbilodeau/korge
fb2be4c25a32fa6a4a200badcf9b610f115f763c
[ "Apache-2.0" ]
353
2017-10-26T10:39:30.000Z
2022-03-22T14:08:55.000Z
@old/korge-spriter/src/commonMain/kotlin/com/soywiz/korge/ext/spriter/com/brashmonkey/spriter/Calculator.kt
jfbilodeau/korge
fb2be4c25a32fa6a4a200badcf9b610f115f763c
[ "Apache-2.0" ]
77
2017-10-19T23:10:06.000Z
2022-02-22T22:42:40.000Z
package com.soywiz.korge.ext.spriter.com.brashmonkey.spriter import com.soywiz.korio.* import com.soywiz.korma.geom.* import kotlin.math.* /** * A utility class which provides methods to calculate Spriter specific issues, * like linear interpolation and rotation around a parent object. * Other interpolation types are coming with the next releases of Spriter. * @author Trixt0r */ object Calculator { const val PI = kotlin.math.PI.toFloat() const val NO_SOLUTION = -1f /** * Calculates the smallest difference between angle a and b. * @param a first angle (in degrees) * * * @param b second angle (in degrees) * * * @return Smallest difference between a and b (between 180� and -180�). */ fun angleDifference(a: Float, b: Float): Float { return ((a - b) % 360 + 540) % 360 - 180 } /** * @param x1 x coordinate of first point. * * * @param y1 y coordinate of first point. * * * @param x2 x coordinate of second point. * * * @param y2 y coordinate of second point. * * * @return Angle between the two given points. */ fun angleBetween(x1: Float, y1: Float, x2: Float, y2: Float): Float { return Angle.degreesToRadians(atan2((y2 - y1).toDouble(), (x2 - x1).toDouble())).toFloat() } /** * @param x1 x coordinate of first point. * * * @param y1 y coordinate of first point. * * * @param x2 x coordinate of second point. * * * @param y2 y coordinate of second point. * * * @return Distance between the two given points. */ fun distanceBetween(x1: Float, y1: Float, x2: Float, y2: Float): Float { val xDiff = x2 - x1 val yDiff = y2 - y1 return sqrt(xDiff * xDiff + yDiff * yDiff) } /** * Solves the equation a*x^3 + b*x^2 + c*x +d = 0. * @param a * * * @param b * * * @param c * * * @param d * * * @return the solution of the cubic function if it belongs [0, 1], [.NO_SOLUTION] otherwise. */ fun solveCubic(a: Float, b: Float, c: Float, d: Float): Float { var b = b var c = c var d = d if (a == 0f) return solveQuadratic(b, c, d) if (d == 0f) return 0f b /= a c /= a d /= a val squaredB = squared(b) var q = (3f * c - squaredB) / 9f val r = (-27f * d + b * (9f * c - 2f * squaredB)) / 54f val disc = cubed(q) + squared(r) val term1 = b / 3f if (disc > 0) { val sqrtDisc = sqrt(disc) var s = r + sqrtDisc s = if (s < 0) -cubicRoot(-s) else cubicRoot(s) var t = r - sqrtDisc t = if (t < 0) -cubicRoot(-t) else cubicRoot(t) val result = -term1 + s + t if (result in 0.0..1.0) return result } else if (disc == 0f) { val r13 = if (r < 0) -cubicRoot(-r) else cubicRoot(r) var result = -term1 + 2f * r13 if (result in 0.0..1.0) return result result = -(r13 + term1) if (result in 0.0..1.0) return result } else { q = -q var dum1 = q * q * q dum1 = acos(r / sqrt(dum1)) val r13 = 2f * sqrt(q) var result = -term1 + r13 * cos(dum1 / 3f) if (result in 0.0..1.0) return result result = -term1 + r13 * cos((dum1 + 2f * PI) / 3f) if (result in 0.0..1.0) return result result = -term1 + r13 * cos((dum1 + 4f * PI) / 3f) if (result in 0.0..1.0) return result } return NO_SOLUTION } /** * Solves the equation a*x^2 + b*x + c = 0 * @param a * * * @param b * * * @param c * * * @return the solution for the quadratic function if it belongs [0, 1], [.NO_SOLUTION] otherwise. */ fun solveQuadratic(a: Float, b: Float, c: Float): Float { val squaredB = squared(b) val twoA = 2 * a val fourAC = 4f * a * c val sqrt = sqrt(squaredB - fourAC) var result = (-b + sqrt) / twoA if (result >= 0 && result <= 1) return result result = (-b - sqrt) / twoA if (result >= 0 && result <= 1) return result return NO_SOLUTION } /** * Returns the square of the given value. * @param f the value * * * @return the square of the value */ fun squared(f: Float): Float { return f * f } /** * Returns the cubed value of the given one. * @param f the value * * * @return the cubed value */ fun cubed(f: Float): Float { return f * f * f } /** * Returns the cubic root of the given value. * @param f the value * * * @return the cubic root */ fun cubicRoot(f: Float): Float { return f.toDouble().pow((1f / 3f).toDouble()).toFloat() } /** * Returns the square root of the given value. * @param x the value * * * @return the square root */ fun sqrt(x: Float): Float { return kotlin.math.sqrt(x.toDouble()).toFloat() } /** * Returns the arc cosine at the given value. * @param x the value * * * @return the arc cosine */ fun acos(x: Float): Float { return kotlin.math.acos(x.toDouble()).toFloat() } private val SIN_BITS = 14 // 16KB. Adjust for accuracy. private val SIN_MASK = (-1 shl SIN_BITS).inv() private val SIN_COUNT = SIN_MASK + 1 private val radFull = PI * 2 private val degFull = 360f private val radToIndex = SIN_COUNT / radFull private val degToIndex = SIN_COUNT / degFull /** multiply by this to convert from radians to degrees */ val radiansToDegrees = 180f / PI val radDeg = radiansToDegrees /** multiply by this to convert from degrees to radians */ val degreesToRadians = PI / 180 val degRad = degreesToRadians private object Sin { internal val table = FloatArray(SIN_COUNT).apply { for (i in 0 until SIN_COUNT) this[i] = kotlin.math.sin(((i + 0.5f) / SIN_COUNT * radFull).toDouble()).toFloat() var i = 0 while (i < 360) { this[(i * degToIndex).toInt() and SIN_MASK] = kotlin.math.sin((i * degreesToRadians).toDouble()).toFloat() i += 90 } } } /** Returns the sine in radians from a lookup table. */ fun sin(radians: Float): Float { return Sin.table[(radians * radToIndex).toInt() and SIN_MASK] } /** Returns the cosine in radians from a lookup table. */ fun cos(radians: Float): Float { return Sin.table[((radians + PI / 2) * radToIndex).toInt() and SIN_MASK] } /** Returns the sine in radians from a lookup table. */ fun sinDeg(degrees: Float): Float { return Sin.table[(degrees * degToIndex).toInt() and SIN_MASK] } /** Returns the cosine in radians from a lookup table. */ fun cosDeg(degrees: Float): Float { return Sin.table[((degrees + 90) * degToIndex).toInt() and SIN_MASK] } }
24.916667
99
0.619525
41e52f436b12a3cd37fbfd994233b53f5e880204
564
sql
SQL
kata-files/lesson2/postgresql/expected/MYLARGESCHEMA/function/func741.sql
goldmansachs/obevo-kata
5596ff44ad560d89d183ac0941b727db1a2a7346
[ "Apache-2.0" ]
22
2017-09-28T21:35:04.000Z
2022-02-12T06:24:28.000Z
kata-files/lesson2/postgresql/expected/MYLARGESCHEMA/function/func741.sql
goldmansachs/obevo-kata
5596ff44ad560d89d183ac0941b727db1a2a7346
[ "Apache-2.0" ]
6
2017-07-01T13:52:34.000Z
2018-09-13T15:43:47.000Z
kata-files/lesson2/postgresql/expected/MYLARGESCHEMA/function/func741.sql
goldmansachs/obevo-kata
5596ff44ad560d89d183ac0941b727db1a2a7346
[ "Apache-2.0" ]
11
2017-04-30T18:39:09.000Z
2021-08-22T16:21:11.000Z
CREATE FUNCTION func741() RETURNS integer LANGUAGE plpgsql AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE172);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE193);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE282);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.VIEW16);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.VIEW89);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.VIEW66);CALL FUNC939(MYVAR);CALL FUNC663(MYVAR);CALL FUNC70(MYVAR);CALL FUNC899(MYVAR);END $$; GO
80.571429
495
0.77305
e0ccf24b6e7f58f48d1befa403f02482ef446a04
12,686
lua
Lua
ESX/server.lua
0resmon/0R-admin
25c6e0a1c0b9befdee372c50c7cb33cb28363ed1
[ "MIT" ]
8
2021-09-27T19:24:56.000Z
2022-03-19T00:10:46.000Z
ESX/server.lua
0resmon/0R-admin
25c6e0a1c0b9befdee372c50c7cb33cb28363ed1
[ "MIT" ]
1
2021-10-03T18:41:12.000Z
2021-10-03T18:41:12.000Z
ESX/server.lua
0resmon/0R-admin
25c6e0a1c0b9befdee372c50c7cb33cb28363ed1
[ "MIT" ]
9
2021-09-27T19:38:32.000Z
2022-03-13T19:38:54.000Z
ESX = nil TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) AddEventHandler('playerConnecting', function(name, setCallback, defer) defer.defer() local banned = false local src = source defer.update(L("CHECKING_BANLIST")) local bans = exports.ghmattimysql:executeSync("SELECT identifier,reason FROM `0r-bans` ", { }) if bans and bans[1] then for k, v in pairs(bans) do if GetPlayerIdentifier(src, 0) == v.identifier then banned = true defer.done(L('URE_BANNED')..v.reason..' ') return end end end if banned == false then defer.done() end end) ESX.RegisterServerCallback('0R-admin:cp', function(source, cb) if PermCheck(source, 'auth') then cb({ action = "auth", auth = "acsess", lang = Lang.Languages[Lang.Language] }) else cb(nil) end end) ESX.RegisterServerCallback('0R-admin:GET.PLAYERS', function(source, cb) if PermCheck(source, 'playerlist') then local Players = {} for k, v in pairs(ESX.GetPlayers()) do local xPlayer = ESX.GetPlayerFromId(v) Players[#Players+1] = { id = v, name = xPlayer.getName() } end cb(Players) end end) ESX.RegisterServerCallback('0R-admin:GET.BANS', function(source, cb) if PermCheck(source, 'bansshow') then local Players = {} local bans = exports.ghmattimysql:executeSync("SELECT id,identifier FROM `0r-bans` ", { }) if bans and bans[1] then for k, v in pairs(bans) do Players[#Players+1] = { identifier = v.identifier, id = v.id } end end cb(Players) end end) RegisterServerEvent('0R.ADMIN.DELETEBAN') AddEventHandler('0R.ADMIN.DELETEBAN', function(id) if PermCheck(source, 'bansdelete') then exports.ghmattimysql:executeSync("DELETE FROM `0r-bans` WHERE id='"..id.."' ", { }) end end) RegisterServerEvent('0R.ADMIN.REVIVE') AddEventHandler('0R.ADMIN.REVIVE', function(id) if PermCheck(source, 'revive') then if id == "self" then id = tonumber(source) end TriggerClientEvent('esx_ambulancejob:revive', id) TriggerClientEvent("0R.ADMIN.SENDNUI", source, { action = "notify", value = L('PROCESS') }) end end) RegisterServerEvent('0R.ADMIN.BRING') AddEventHandler('0R.ADMIN.BRING', function(id) if PermCheck(source, 'bring') then SetEntityCoords(GetPlayerPed(source), GetEntityCoords(GetPlayerPed(id))) end end) RegisterServerEvent('0R.ADMIN.GOTO') AddEventHandler('0R.ADMIN.GOTO', function(id) if PermCheck(source, 'goto') then SetEntityCoords(GetPlayerPed(id), GetEntityCoords(GetPlayerPed(source))) end end) RegisterServerEvent('0R.ADMIN.HEAL') AddEventHandler('0R.ADMIN.HEAL', function(id) if PermCheck(source, 'heal') then if id == "self" then id = tonumber(source) end TriggerClientEvent('0R.ADMIN.HEAL', id) TriggerClientEvent("0R.ADMIN.SENDNUI", source, { action = "notify", value = L('PROCESS') }) end end) RegisterServerEvent('0R.ADMIN.KILL') AddEventHandler('0R.ADMIN.KILL', function(id) if PermCheck(source, 'kill') then TriggerClientEvent('0R.CL.ADMIN.KILL', id) end end) RegisterServerEvent('0R.ADMIN.JUDGE') AddEventHandler('0R.ADMIN.JUDGE', function(id) if PermCheck(source, 'judge') then for k, v in pairs(ESX.GetPlayers()) do TriggerEvent('esx_communityservice:endCommunityServiceCommand', v) end end end) RegisterServerEvent('0R.ADMIN.KICK') AddEventHandler('0R.ADMIN.KICK', function(id, reason) if PermCheck(source, 'kick') then DropPlayer(id, "[0R-ADMIN] | "..L('KICKED_1').." "..GetPlayerName(source).." \n "..L('KICKED_2')..": "..reason); TriggerClientEvent("0R.ADMIN.SENDNUI", source, { action = "notify", value = L('PROCESS') }) end end) RegisterServerEvent('0R.ADMIN.BAN') AddEventHandler('0R.ADMIN.BAN', function(id, reason) if PermCheck(source, 'kick') then local xPlayer = ESX.GetPlayerFromId(id) DropPlayer(id, "[0R-ADMIN] | "..L('KICKED_1').." "..GetPlayerName(source).." \n "..L('KICKED_2')..": "..reason); exports.ghmattimysql:execute("INSERT INTO `0r-bans` (identifier, reason) VALUES ('"..xPlayer.identifier.."', '"..reason.."')", { }) TriggerClientEvent("0R.ADMIN.SENDNUI", source, { action = "notify", value = L('PROCESS') }) end end) local lastfreeze = false RegisterServerEvent('0R.ADMIN.FREEZE') AddEventHandler('0R.ADMIN.FREEZE', function(id) if PermCheck(source, 'freeze') then lastfreeze = not lastfreeze FreezeEntityPosition(GetPlayerPed(id),lastfreeze) local freeze = "unfreezed" if lastfreeze then freeze = "freezed" end TriggerClientEvent("0R.ADMIN.SENDNUI", source, { action = "notify", value = L('PLAYER').." "..freeze }) end end) RegisterServerEvent('0R.ADMIN.OPENINV') AddEventHandler('0R.ADMIN.OPENINV', function(id) if PermCheck(source, 'openinv') then if Config.InventoryType == "qb-inventory" then TriggerEvent("inventory:server:OpenInventory", "otherplayer", id) elseif Config.InventoryType == "m3_inventoryhud" then TriggerClientEvent("m3:inventoryhud:client:openPlayerInventory", source, id, 'admin') end end end) RegisterServerEvent('0R.ADMIN.GIVEITEM') AddEventHandler('0R.ADMIN.GIVEITEM', function(id, item, count) if PermCheck(source, 'giveitem') then local xPlayer = ESX.GetPlayerFromId(id) xPlayer.addInventoryItem(item, tonumber(count)) TriggerClientEvent("0R.ADMIN.SENDNUI", source, { action = "notify", value = L('PROCESS') }) end end) RegisterServerEvent('0R.ADMIN.SETJOB') AddEventHandler('0R.ADMIN.SETJOB', function(id, job, grade) if PermCheck(source, 'setjob') then local xPlayer = ESX.GetPlayerFromId(id) if ESX.DoesJobExist(job, tonumber(grade)) then xPlayer.setJob(job, tonumber(grade)) TriggerClientEvent("0R.ADMIN.SENDNUI", source, { action = "notify", value = L('JOB') }) end end end) RegisterServerEvent('0R.ADMIN.TAKESS') AddEventHandler('0R.ADMIN.TAKESS', function(id) if PermCheck(source, 'takess') then TriggerClientEvent("0R.ADMIN.REQUESTSS", id, source) end end) RegisterServerEvent('0R.ADMIN.OFFERSS') AddEventHandler('0R.ADMIN.OFFERSS', function(id, url) if PermCheck(source, 'takess') then TriggerClientEvent("0R.ADMIN.SENDNUI", id, { action = "request_conf", url = url }) end end) RegisterServerEvent('0R.ADMIN.CLEARINV') AddEventHandler('0R.ADMIN.CLEARINV', function(id) if PermCheck(source, 'clearinv') then local xPlayer = ESX.GetPlayerFromId(source) for k, v in pairs(xPlayer.inventory) do if (v.count > 0) then xPlayer.removeInventoryItem(v.name, v.count) end end end end) RegisterServerEvent('0R.ADMIN.GIVECAR') AddEventHandler('0R.ADMIN.GIVECAR', function(id, carmodel, own) if PermCheck(source, 'givecar') then local vehicle = CreateVehicle(carmodel, GetEntityCoords(GetPlayerPed(id)), GetEntityHeading(GetPlayerPed(id)), true, false) SetPedIntoVehicle(GetPlayerPed(id), vehicle, -1) if own then if PermCheck(source, 'giveownedcar') then Wait(1000) TriggerClientEvent('0R.CL.GET.VEHICLEPROPS', id, vehicle) end end end end) RegisterServerEvent('0R.SET.VEHICLEPROPS') AddEventHandler('0R.SET.VEHICLEPROPS', function(vehicle, props) if PermCheck(source, 'giveownedcar') then local xPlayer = ESX.GetPlayerFromId(source) TriggerClientEvent("0R.ADMIN.SENDNUI", source, { action = "notify", value = L('PROCESS') }) exports.ghmattimysql:execute("INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES ('"..xPlayer.identifier.."', '"..props.plate.."', '"..json.encode(props).."')", { }) end end) RegisterServerEvent('0R.ADMIN.WIPE') AddEventHandler('0R.ADMIN.WIPE', function(id) if PermCheck(source, 'wipe') then local xPlayer = ESX.GetPlayerFromId(id) local wipetables = { { table = "owned_vehicles", column = "owner"}, { table = "users", column = "identifier"}, { table = "datastore_data", column = "owner"}, { table = "user_licenses", column = "owner"}, } TriggerClientEvent("0R.ADMIN.SENDNUI", source, { action = "notify", value = L('WIPE1') }) for k, v in pairs(wipetables) do exports.ghmattimysql:executeSync("DELETE FROM "..v.table.." WHERE "..v.column.." like '%"..xPlayer.identifier.."%' ", { }) Wait(5000) if k == #wipetables then DropPlayer(id, "[0R-ADMIN] | "..L('WIPE2')); break; end end end end) RegisterServerEvent('0R.ADMIN.WIPEOFFLINE') AddEventHandler('0R.ADMIN.WIPEOFFLINE', function(identifier) if PermCheck(source, 'wipeoffline') then local xPlayer = ESX.GetPlayerFromId(id) local wipetables = { { table = "owned_vehicles", column = "owner"}, { table = "users", column = "identifier"}, { table = "datastore_data", column = "owner"}, { table = "user_licenses", column = "owner"}, } TriggerClientEvent("0R.ADMIN.SENDNUI", source, { action = "notify", value = L('WIPE1') }) for k, v in pairs(wipetables) do exports.ghmattimysql:executeSync("DELETE FROM "..v.table.." WHERE "..v.column.." like '%"..identifier.."%' ", { }) Wait(5000) if k == #wipetables then DropPlayer(id, "[0R-ADMIN] | "..L('WIPE2')); break; end end end end) RegisterServerEvent('0R.ADMIN.BANPLAYEROFFLINE') AddEventHandler('0R.ADMIN.BANPLAYEROFFLINE', function(identifier, reason) if PermCheck(source, 'banoffline') then exports.ghmattimysql:execute("INSERT INTO `0r-bans` (identifier, reason) VALUES ('"..identifier.."', '"..reason.."')", { }) end end) RegisterServerEvent('0R.ADMIN.SETTIME') AddEventHandler('0R.ADMIN.SETTIME', function(clock, min, type) if PermCheck(source, 'time') then if type == "set" then ExecuteCommand("time "..clock.." "..min) elseif type == "freeze" then ExecuteCommand("freezetime") end end end) RegisterServerEvent('0R.ADMIN.SETWEATHER') AddEventHandler('0R.ADMIN.SETWEATHER', function(weather, type) if PermCheck(source, 'weather') then if type == "set" then ExecuteCommand("weather "..weather) elseif type == "freeze" then ExecuteCommand("freezeweather") end end end) RegisterServerEvent('0R.ADMIN.PLAYERBLIPS') AddEventHandler('0R.ADMIN.PLAYERBLIPS', function(bool) if PermCheck(source, 'playerblips') then TriggerClientEvent("0R.ADMIN.SHOWBLIPS", source, ESX.GetPlayers()) end end) RegisterServerEvent('0R.ADMIN.ANNOUNCEMENT') AddEventHandler('0R.ADMIN.ANNOUNCEMENT', function(text) if PermCheck(source, 'announcement') then TriggerClientEvent("0R.ADMIN.SENDNUI", -1, { action = "Announcement", value = text, perm = PermCheck(source, 'announcement') }) end end) RegisterServerEvent('0R.ADMIN.REVIVEALL') AddEventHandler('0R.ADMIN.REVIVEALL', function() if PermCheck(source, 'reviveall') then for k, v in pairs(ESX.GetPlayers()) do TriggerClientEvent('esx_ambulancejob:revive', v) end end end) RegisterServerEvent('0R.ADMIN.BRINGALL') AddEventHandler('0R.ADMIN.BRINGALL', function() if PermCheck(source, 'bringall') then for k, v in pairs(ESX.GetPlayers()) do SetEntityCoords(GetPlayerPed(source), GetEntityCoords(GetPlayerPed(v))) end end end) RegisterServerEvent('0R.ADMIN.KICKALL') AddEventHandler('0R.ADMIN.KICKALL', function(reason) if PermCheck(source, 'kickall') then for k, v in pairs(ESX.GetPlayers()) do DropPlayer(v, "[0R-ADMIN] | "..L('KICKED_1').." "..GetPlayerName(source).." \n "..L('KICKED_2')..": "..reason); end end end) RegisterServerEvent('0R.ADMIN.DELETEALLCARS') AddEventHandler('0R.ADMIN.DELETEALLCARS', function() if PermCheck(source, 'deleteallcars') then TriggerClientEvent("0R.CL.ADMIN.DELETEALLCARS", -1) end end) ESX.RegisterServerCallback('0R.ADMIN.GETPLAYER', function(source, cb, id) if PermCheck(source, 'playerblips') then cb({ name = GetPlayerName(id), ped = GetPlayerPed(id), coords = GetEntityCoords(GetPlayerPed(id)) }) end end) ESX.RegisterServerCallback('0R.ADMIN.PERMCHECK', function(source, cb, perm) cb(PermCheck(source, perm)) end) function PermCheck(source, perm) local xPlayer = ESX.GetPlayerFromId(source) local auth = false local acsess = false for k, v in pairs(Config.Auth) do if v.identifier == xPlayer.identifier then auth = v.perm break; end end if auth then for k, v in pairs(Config.Perms[auth]) do acsess = false if v == perm then acsess = true break; end end else acsess = false end return acsess end
31.093137
178
0.674365
21efee6fa9f142125665c054f3a654cfc37808f9
4,765
kt
Kotlin
src/test/kotlin/com/nuecho/mutagen/cli/models/configuration/reference/CampaignGroupReferenceTest.kt
nuecho/mutagen
c508200bc6e1b2e4d16ec4426047c40ae44deb47
[ "Apache-2.0" ]
3
2018-11-08T18:21:47.000Z
2021-04-28T17:31:26.000Z
src/test/kotlin/com/nuecho/mutagen/cli/models/configuration/reference/CampaignGroupReferenceTest.kt
nuecho/mutagen
c508200bc6e1b2e4d16ec4426047c40ae44deb47
[ "Apache-2.0" ]
null
null
null
src/test/kotlin/com/nuecho/mutagen/cli/models/configuration/reference/CampaignGroupReferenceTest.kt
nuecho/mutagen
c508200bc6e1b2e4d16ec4426047c40ae44deb47
[ "Apache-2.0" ]
2
2020-02-29T16:22:32.000Z
2021-04-28T17:31:28.000Z
/* * Copyright (C) 2018 Nu Echo Inc * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.nuecho.mutagen.cli.models.configuration.reference import com.genesyslab.platform.applicationblocks.com.objects.CfgCampaign import com.nuecho.mutagen.cli.TestResources.loadJsonConfiguration import com.nuecho.mutagen.cli.models.configuration.ConfigurationAsserts.checkSerialization import com.nuecho.mutagen.cli.models.configuration.ConfigurationObjectMocks.DEFAULT_TENANT_REFERENCE import com.nuecho.mutagen.cli.services.ConfServiceExtensionMocks.mockRetrieveTenant import com.nuecho.mutagen.cli.services.ServiceMocks import io.mockk.every import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.contains import org.hamcrest.Matchers.equalTo import org.junit.jupiter.api.Test private const val CAMPAIGN = "campaign" private val CAMPAIGN_REFERENCE = CampaignGroupCampaignReference(CAMPAIGN, DEFAULT_TENANT_REFERENCE) private const val DBID = 102 private const val NAME = "campaignGroup" class CampaignGroupReferenceTest { private val campaignGroupReference = CampaignGroupReference( name = NAME, campaign = CAMPAIGN_REFERENCE ) @Test fun `CampaignGroupReference should be serialized as a JSON Object without tenant references`() { checkSerialization(campaignGroupReference, "reference/campaign_group_reference") } @Test fun `CampaignGroupReference should properly deserialize`() { val deserializedCampaignGroupReference = loadJsonConfiguration( "models/configuration/reference/campaign_group_reference.json", CampaignGroupReference::class.java ) val expectedCampaignGroupReference = CampaignGroupReference( CampaignGroupCampaignReference(CAMPAIGN, DEFAULT_TENANT_REFERENCE), NAME ) assertThat(deserializedCampaignGroupReference, equalTo(expectedCampaignGroupReference)) } @Test fun `CampaignGroupReference toQuery should create the proper query`() { val service = ServiceMocks.mockConfService() mockRetrieveTenant(service) every { service.getObjectDbid(CAMPAIGN_REFERENCE) } returns DBID every { service.retrieveObject(CAMPAIGN_REFERENCE.cfgObjectClass, any()) } answers { CfgCampaign(service).apply { dbid = DBID } } val query = campaignGroupReference.toQuery(service) assertThat(query.campaignDbid, equalTo(DBID)) assertThat(query.name, equalTo(NAME)) } @Test fun `CampaignGroupReference toString() should generate the proper String`() { assertThat("name: '$NAME', campaign: '$CAMPAIGN_REFERENCE'", equalTo(campaignGroupReference.toString())) } @Test fun `CampaignGroupReference should be sorted properly`() { val campaignGroupReference1 = CampaignGroupReference( campaign = CampaignGroupCampaignReference(NAME, TenantReference("aaaTenant")), name = "aaa" ) val campaignGroupReference2 = CampaignGroupReference( campaign = CampaignGroupCampaignReference(NAME, DEFAULT_TENANT_REFERENCE), name = "aaa" ) val campaignGroupReference3 = CampaignGroupReference( campaign = CampaignGroupCampaignReference("${NAME}aaa", DEFAULT_TENANT_REFERENCE), name = "aaa" ) val campaignGroupReference4 = CampaignGroupReference( campaign = CampaignGroupCampaignReference("${NAME}aaa", DEFAULT_TENANT_REFERENCE), name = "ccc" ) val campaignGroupReference5 = CampaignGroupReference( campaign = CampaignGroupCampaignReference("${NAME}bbb", DEFAULT_TENANT_REFERENCE), name = "ccc" ) val sortedList = listOf( campaignGroupReference5, campaignGroupReference4, campaignGroupReference3, campaignGroupReference2, campaignGroupReference1 ).sorted() assertThat( sortedList, contains( campaignGroupReference1, campaignGroupReference2, campaignGroupReference3, campaignGroupReference4, campaignGroupReference5 ) ) } }
39.380165
137
0.713116
d9d652dfc704ad7bbed80cebaf48204ca556360d
38,559
rs
Rust
vendor/syn-0.15.44/src/generics.rs
yilinhan/crates-io
eb259811db1316ec63d9dd01cda3d87e3b860ca0
[ "Apache-2.0" ]
5
2019-12-04T11:29:04.000Z
2021-11-18T14:23:55.000Z
vendor/syn-0.15.44/src/generics.rs
yilinhan/crates-io
eb259811db1316ec63d9dd01cda3d87e3b860ca0
[ "Apache-2.0" ]
1
2021-07-16T09:08:43.000Z
2021-07-16T09:08:43.000Z
vendor/syn-0.15.44/src/generics.rs
yilinhan/crates-io
eb259811db1316ec63d9dd01cda3d87e3b860ca0
[ "Apache-2.0" ]
18
2019-07-15T23:10:12.000Z
2021-07-26T02:28:55.000Z
use super::*; use punctuated::{Iter, IterMut, Punctuated}; ast_struct! { /// Lifetimes and type parameters attached to a declaration of a function, /// enum, trait, etc. /// /// *This type is available if Syn is built with the `"derive"` or `"full"` /// feature.* #[derive(Default)] pub struct Generics { pub lt_token: Option<Token![<]>, pub params: Punctuated<GenericParam, Token![,]>, pub gt_token: Option<Token![>]>, pub where_clause: Option<WhereClause>, } } ast_enum_of_structs! { /// A generic type parameter, lifetime, or const generic: `T: Into<String>`, /// `'a: 'b`, `const LEN: usize`. /// /// *This type is available if Syn is built with the `"derive"` or `"full"` /// feature.* /// /// # Syntax tree enum /// /// This type is a [syntax tree enum]. /// /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums // // TODO: change syntax-tree-enum link to an intra rustdoc link, currently // blocked on https://github.com/rust-lang/rust/issues/62833 pub enum GenericParam { /// A generic type parameter: `T: Into<String>`. /// /// *This type is available if Syn is built with the `"derive"` or /// `"full"` feature.* pub Type(TypeParam { pub attrs: Vec<Attribute>, pub ident: Ident, pub colon_token: Option<Token![:]>, pub bounds: Punctuated<TypeParamBound, Token![+]>, pub eq_token: Option<Token![=]>, pub default: Option<Type>, }), /// A lifetime definition: `'a: 'b + 'c + 'd`. /// /// *This type is available if Syn is built with the `"derive"` or /// `"full"` feature.* pub Lifetime(LifetimeDef { pub attrs: Vec<Attribute>, pub lifetime: Lifetime, pub colon_token: Option<Token![:]>, pub bounds: Punctuated<Lifetime, Token![+]>, }), /// A const generic parameter: `const LENGTH: usize`. /// /// *This type is available if Syn is built with the `"derive"` or /// `"full"` feature.* pub Const(ConstParam { pub attrs: Vec<Attribute>, pub const_token: Token![const], pub ident: Ident, pub colon_token: Token![:], pub ty: Type, pub eq_token: Option<Token![=]>, pub default: Option<Expr>, }), } } impl Generics { /// Returns an /// <code /// style="padding-right:0;">Iterator&lt;Item = &amp;</code><a /// href="struct.TypeParam.html"><code /// style="padding-left:0;padding-right:0;">TypeParam</code></a><code /// style="padding-left:0;">&gt;</code> /// over the type parameters in `self.params`. pub fn type_params(&self) -> TypeParams { TypeParams(self.params.iter()) } /// Returns an /// <code /// style="padding-right:0;">Iterator&lt;Item = &amp;mut </code><a /// href="struct.TypeParam.html"><code /// style="padding-left:0;padding-right:0;">TypeParam</code></a><code /// style="padding-left:0;">&gt;</code> /// over the type parameters in `self.params`. pub fn type_params_mut(&mut self) -> TypeParamsMut { TypeParamsMut(self.params.iter_mut()) } /// Returns an /// <code /// style="padding-right:0;">Iterator&lt;Item = &amp;</code><a /// href="struct.LifetimeDef.html"><code /// style="padding-left:0;padding-right:0;">LifetimeDef</code></a><code /// style="padding-left:0;">&gt;</code> /// over the lifetime parameters in `self.params`. pub fn lifetimes(&self) -> Lifetimes { Lifetimes(self.params.iter()) } /// Returns an /// <code /// style="padding-right:0;">Iterator&lt;Item = &amp;mut </code><a /// href="struct.LifetimeDef.html"><code /// style="padding-left:0;padding-right:0;">LifetimeDef</code></a><code /// style="padding-left:0;">&gt;</code> /// over the lifetime parameters in `self.params`. pub fn lifetimes_mut(&mut self) -> LifetimesMut { LifetimesMut(self.params.iter_mut()) } /// Returns an /// <code /// style="padding-right:0;">Iterator&lt;Item = &amp;</code><a /// href="struct.ConstParam.html"><code /// style="padding-left:0;padding-right:0;">ConstParam</code></a><code /// style="padding-left:0;">&gt;</code> /// over the constant parameters in `self.params`. pub fn const_params(&self) -> ConstParams { ConstParams(self.params.iter()) } /// Returns an /// <code /// style="padding-right:0;">Iterator&lt;Item = &amp;mut </code><a /// href="struct.ConstParam.html"><code /// style="padding-left:0;padding-right:0;">ConstParam</code></a><code /// style="padding-left:0;">&gt;</code> /// over the constant parameters in `self.params`. pub fn const_params_mut(&mut self) -> ConstParamsMut { ConstParamsMut(self.params.iter_mut()) } /// Initializes an empty `where`-clause if there is not one present already. pub fn make_where_clause(&mut self) -> &mut WhereClause { // This is Option::get_or_insert_with in Rust 1.20. if self.where_clause.is_none() { self.where_clause = Some(WhereClause { where_token: <Token![where]>::default(), predicates: Punctuated::new(), }); } match self.where_clause { Some(ref mut where_clause) => where_clause, None => unreachable!(), } } } pub struct TypeParams<'a>(Iter<'a, GenericParam>); impl<'a> Iterator for TypeParams<'a> { type Item = &'a TypeParam; fn next(&mut self) -> Option<Self::Item> { let next = match self.0.next() { Some(item) => item, None => return None, }; if let GenericParam::Type(ref type_param) = *next { Some(type_param) } else { self.next() } } } pub struct TypeParamsMut<'a>(IterMut<'a, GenericParam>); impl<'a> Iterator for TypeParamsMut<'a> { type Item = &'a mut TypeParam; fn next(&mut self) -> Option<Self::Item> { let next = match self.0.next() { Some(item) => item, None => return None, }; if let GenericParam::Type(ref mut type_param) = *next { Some(type_param) } else { self.next() } } } pub struct Lifetimes<'a>(Iter<'a, GenericParam>); impl<'a> Iterator for Lifetimes<'a> { type Item = &'a LifetimeDef; fn next(&mut self) -> Option<Self::Item> { let next = match self.0.next() { Some(item) => item, None => return None, }; if let GenericParam::Lifetime(ref lifetime) = *next { Some(lifetime) } else { self.next() } } } pub struct LifetimesMut<'a>(IterMut<'a, GenericParam>); impl<'a> Iterator for LifetimesMut<'a> { type Item = &'a mut LifetimeDef; fn next(&mut self) -> Option<Self::Item> { let next = match self.0.next() { Some(item) => item, None => return None, }; if let GenericParam::Lifetime(ref mut lifetime) = *next { Some(lifetime) } else { self.next() } } } pub struct ConstParams<'a>(Iter<'a, GenericParam>); impl<'a> Iterator for ConstParams<'a> { type Item = &'a ConstParam; fn next(&mut self) -> Option<Self::Item> { let next = match self.0.next() { Some(item) => item, None => return None, }; if let GenericParam::Const(ref const_param) = *next { Some(const_param) } else { self.next() } } } pub struct ConstParamsMut<'a>(IterMut<'a, GenericParam>); impl<'a> Iterator for ConstParamsMut<'a> { type Item = &'a mut ConstParam; fn next(&mut self) -> Option<Self::Item> { let next = match self.0.next() { Some(item) => item, None => return None, }; if let GenericParam::Const(ref mut const_param) = *next { Some(const_param) } else { self.next() } } } /// Returned by `Generics::split_for_impl`. /// /// *This type is available if Syn is built with the `"derive"` or `"full"` /// feature and the `"printing"` feature.* #[cfg(feature = "printing")] #[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))] #[cfg_attr(feature = "clone-impls", derive(Clone))] pub struct ImplGenerics<'a>(&'a Generics); /// Returned by `Generics::split_for_impl`. /// /// *This type is available if Syn is built with the `"derive"` or `"full"` /// feature and the `"printing"` feature.* #[cfg(feature = "printing")] #[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))] #[cfg_attr(feature = "clone-impls", derive(Clone))] pub struct TypeGenerics<'a>(&'a Generics); /// Returned by `TypeGenerics::as_turbofish`. /// /// *This type is available if Syn is built with the `"derive"` or `"full"` /// feature and the `"printing"` feature.* #[cfg(feature = "printing")] #[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))] #[cfg_attr(feature = "clone-impls", derive(Clone))] pub struct Turbofish<'a>(&'a Generics); #[cfg(feature = "printing")] impl Generics { /// Split a type's generics into the pieces required for impl'ing a trait /// for that type. /// /// ```edition2018 /// # use proc_macro2::{Span, Ident}; /// # use quote::quote; /// # /// # fn main() { /// # let generics: syn::Generics = Default::default(); /// # let name = Ident::new("MyType", Span::call_site()); /// # /// let (impl_generics, ty_generics, where_clause) = generics.split_for_impl(); /// quote! { /// impl #impl_generics MyTrait for #name #ty_generics #where_clause { /// // ... /// } /// } /// # ; /// # } /// ``` /// /// *This method is available if Syn is built with the `"derive"` or /// `"full"` feature and the `"printing"` feature.* pub fn split_for_impl(&self) -> (ImplGenerics, TypeGenerics, Option<&WhereClause>) { ( ImplGenerics(self), TypeGenerics(self), self.where_clause.as_ref(), ) } } #[cfg(feature = "printing")] impl<'a> TypeGenerics<'a> { /// Turn a type's generics like `<X, Y>` into a turbofish like `::<X, Y>`. /// /// *This method is available if Syn is built with the `"derive"` or /// `"full"` feature and the `"printing"` feature.* pub fn as_turbofish(&self) -> Turbofish { Turbofish(self.0) } } ast_struct! { /// A set of bound lifetimes: `for<'a, 'b, 'c>`. /// /// *This type is available if Syn is built with the `"derive"` or `"full"` /// feature.* #[derive(Default)] pub struct BoundLifetimes { pub for_token: Token![for], pub lt_token: Token![<], pub lifetimes: Punctuated<LifetimeDef, Token![,]>, pub gt_token: Token![>], } } impl LifetimeDef { pub fn new(lifetime: Lifetime) -> Self { LifetimeDef { attrs: Vec::new(), lifetime: lifetime, colon_token: None, bounds: Punctuated::new(), } } } impl From<Ident> for TypeParam { fn from(ident: Ident) -> Self { TypeParam { attrs: vec![], ident: ident, colon_token: None, bounds: Punctuated::new(), eq_token: None, default: None, } } } ast_enum_of_structs! { /// A trait or lifetime used as a bound on a type parameter. /// /// *This type is available if Syn is built with the `"derive"` or `"full"` /// feature.* pub enum TypeParamBound { pub Trait(TraitBound), pub Lifetime(Lifetime), } } ast_struct! { /// A trait used as a bound on a type parameter. /// /// *This type is available if Syn is built with the `"derive"` or `"full"` /// feature.* pub struct TraitBound { pub paren_token: Option<token::Paren>, pub modifier: TraitBoundModifier, /// The `for<'a>` in `for<'a> Foo<&'a T>` pub lifetimes: Option<BoundLifetimes>, /// The `Foo<&'a T>` in `for<'a> Foo<&'a T>` pub path: Path, } } ast_enum! { /// A modifier on a trait bound, currently only used for the `?` in /// `?Sized`. /// /// *This type is available if Syn is built with the `"derive"` or `"full"` /// feature.* #[cfg_attr(feature = "clone-impls", derive(Copy))] pub enum TraitBoundModifier { None, Maybe(Token![?]), } } ast_struct! { /// A `where` clause in a definition: `where T: Deserialize<'de>, D: /// 'static`. /// /// *This type is available if Syn is built with the `"derive"` or `"full"` /// feature.* pub struct WhereClause { pub where_token: Token![where], pub predicates: Punctuated<WherePredicate, Token![,]>, } } ast_enum_of_structs! { /// A single predicate in a `where` clause: `T: Deserialize<'de>`. /// /// *This type is available if Syn is built with the `"derive"` or `"full"` /// feature.* /// /// # Syntax tree enum /// /// This type is a [syntax tree enum]. /// /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums // // TODO: change syntax-tree-enum link to an intra rustdoc link, currently // blocked on https://github.com/rust-lang/rust/issues/62833 pub enum WherePredicate { /// A type predicate in a `where` clause: `for<'c> Foo<'c>: Trait<'c>`. /// /// *This type is available if Syn is built with the `"derive"` or /// `"full"` feature.* pub Type(PredicateType { /// Any lifetimes from a `for` binding pub lifetimes: Option<BoundLifetimes>, /// The type being bounded pub bounded_ty: Type, pub colon_token: Token![:], /// Trait and lifetime bounds (`Clone+Send+'static`) pub bounds: Punctuated<TypeParamBound, Token![+]>, }), /// A lifetime predicate in a `where` clause: `'a: 'b + 'c`. /// /// *This type is available if Syn is built with the `"derive"` or /// `"full"` feature.* pub Lifetime(PredicateLifetime { pub lifetime: Lifetime, pub colon_token: Token![:], pub bounds: Punctuated<Lifetime, Token![+]>, }), /// An equality predicate in a `where` clause (unsupported). /// /// *This type is available if Syn is built with the `"derive"` or /// `"full"` feature.* pub Eq(PredicateEq { pub lhs_ty: Type, pub eq_token: Token![=], pub rhs_ty: Type, }), } } #[cfg(feature = "parsing")] pub mod parsing { use super::*; use parse::{Parse, ParseStream, Result}; impl Parse for Generics { fn parse(input: ParseStream) -> Result<Self> { if !input.peek(Token![<]) { return Ok(Generics::default()); } let lt_token: Token![<] = input.parse()?; let mut params = Punctuated::new(); let mut allow_lifetime_param = true; let mut allow_type_param = true; loop { if input.peek(Token![>]) { break; } let attrs = input.call(Attribute::parse_outer)?; let lookahead = input.lookahead1(); if allow_lifetime_param && lookahead.peek(Lifetime) { params.push_value(GenericParam::Lifetime(LifetimeDef { attrs: attrs, ..input.parse()? })); } else if allow_type_param && lookahead.peek(Ident) { allow_lifetime_param = false; params.push_value(GenericParam::Type(TypeParam { attrs: attrs, ..input.parse()? })); } else if lookahead.peek(Token![const]) { allow_lifetime_param = false; allow_type_param = false; params.push_value(GenericParam::Const(ConstParam { attrs: attrs, ..input.parse()? })); } else { return Err(lookahead.error()); } if input.peek(Token![>]) { break; } let punct = input.parse()?; params.push_punct(punct); } let gt_token: Token![>] = input.parse()?; Ok(Generics { lt_token: Some(lt_token), params: params, gt_token: Some(gt_token), where_clause: None, }) } } impl Parse for GenericParam { fn parse(input: ParseStream) -> Result<Self> { let attrs = input.call(Attribute::parse_outer)?; let lookahead = input.lookahead1(); if lookahead.peek(Ident) { Ok(GenericParam::Type(TypeParam { attrs: attrs, ..input.parse()? })) } else if lookahead.peek(Lifetime) { Ok(GenericParam::Lifetime(LifetimeDef { attrs: attrs, ..input.parse()? })) } else if lookahead.peek(Token![const]) { Ok(GenericParam::Const(ConstParam { attrs: attrs, ..input.parse()? })) } else { Err(lookahead.error()) } } } impl Parse for LifetimeDef { fn parse(input: ParseStream) -> Result<Self> { let has_colon; Ok(LifetimeDef { attrs: input.call(Attribute::parse_outer)?, lifetime: input.parse()?, colon_token: { if input.peek(Token![:]) { has_colon = true; Some(input.parse()?) } else { has_colon = false; None } }, bounds: { let mut bounds = Punctuated::new(); if has_colon { loop { if input.peek(Token![,]) || input.peek(Token![>]) { break; } let value = input.parse()?; bounds.push_value(value); if !input.peek(Token![+]) { break; } let punct = input.parse()?; bounds.push_punct(punct); } } bounds }, }) } } impl Parse for BoundLifetimes { fn parse(input: ParseStream) -> Result<Self> { Ok(BoundLifetimes { for_token: input.parse()?, lt_token: input.parse()?, lifetimes: { let mut lifetimes = Punctuated::new(); while !input.peek(Token![>]) { lifetimes.push_value(input.parse()?); if input.peek(Token![>]) { break; } lifetimes.push_punct(input.parse()?); } lifetimes }, gt_token: input.parse()?, }) } } impl Parse for Option<BoundLifetimes> { fn parse(input: ParseStream) -> Result<Self> { if input.peek(Token![for]) { input.parse().map(Some) } else { Ok(None) } } } impl Parse for TypeParam { fn parse(input: ParseStream) -> Result<Self> { let has_colon; let has_default; Ok(TypeParam { attrs: input.call(Attribute::parse_outer)?, ident: input.parse()?, colon_token: { if input.peek(Token![:]) { has_colon = true; Some(input.parse()?) } else { has_colon = false; None } }, bounds: { let mut bounds = Punctuated::new(); if has_colon { loop { if input.peek(Token![,]) || input.peek(Token![>]) || input.peek(Token![=]) { break; } let value = input.parse()?; bounds.push_value(value); if !input.peek(Token![+]) { break; } let punct = input.parse()?; bounds.push_punct(punct); } } bounds }, eq_token: { if input.peek(Token![=]) { has_default = true; Some(input.parse()?) } else { has_default = false; None } }, default: { if has_default { Some(input.parse()?) } else { None } }, }) } } impl Parse for TypeParamBound { fn parse(input: ParseStream) -> Result<Self> { if input.peek(Lifetime) { return input.parse().map(TypeParamBound::Lifetime); } if input.peek(token::Paren) { let content; let paren_token = parenthesized!(content in input); let mut bound: TraitBound = content.parse()?; bound.paren_token = Some(paren_token); return Ok(TypeParamBound::Trait(bound)); } input.parse().map(TypeParamBound::Trait) } } impl Parse for TraitBound { fn parse(input: ParseStream) -> Result<Self> { let modifier: TraitBoundModifier = input.parse()?; let lifetimes: Option<BoundLifetimes> = input.parse()?; let mut path: Path = input.parse()?; if path.segments.last().unwrap().value().arguments.is_empty() && input.peek(token::Paren) { let parenthesized = PathArguments::Parenthesized(input.parse()?); path.segments.last_mut().unwrap().value_mut().arguments = parenthesized; } Ok(TraitBound { paren_token: None, modifier: modifier, lifetimes: lifetimes, path: path, }) } } impl Parse for TraitBoundModifier { fn parse(input: ParseStream) -> Result<Self> { if input.peek(Token![?]) { input.parse().map(TraitBoundModifier::Maybe) } else { Ok(TraitBoundModifier::None) } } } impl Parse for ConstParam { fn parse(input: ParseStream) -> Result<Self> { let mut default = None; Ok(ConstParam { attrs: input.call(Attribute::parse_outer)?, const_token: input.parse()?, ident: input.parse()?, colon_token: input.parse()?, ty: input.parse()?, eq_token: { if input.peek(Token![=]) { let eq_token = input.parse()?; default = Some(input.parse::<Expr>()?); Some(eq_token) } else { None } }, default: default, }) } } impl Parse for WhereClause { fn parse(input: ParseStream) -> Result<Self> { Ok(WhereClause { where_token: input.parse()?, predicates: { let mut predicates = Punctuated::new(); loop { if input.is_empty() || input.peek(token::Brace) || input.peek(Token![,]) || input.peek(Token![;]) || input.peek(Token![:]) && !input.peek(Token![::]) || input.peek(Token![=]) { break; } let value = input.parse()?; predicates.push_value(value); if !input.peek(Token![,]) { break; } let punct = input.parse()?; predicates.push_punct(punct); } predicates }, }) } } impl Parse for Option<WhereClause> { fn parse(input: ParseStream) -> Result<Self> { if input.peek(Token![where]) { input.parse().map(Some) } else { Ok(None) } } } impl Parse for WherePredicate { fn parse(input: ParseStream) -> Result<Self> { if input.peek(Lifetime) && input.peek2(Token![:]) { Ok(WherePredicate::Lifetime(PredicateLifetime { lifetime: input.parse()?, colon_token: input.parse()?, bounds: { let mut bounds = Punctuated::new(); loop { if input.is_empty() || input.peek(token::Brace) || input.peek(Token![,]) || input.peek(Token![;]) || input.peek(Token![:]) || input.peek(Token![=]) { break; } let value = input.parse()?; bounds.push_value(value); if !input.peek(Token![+]) { break; } let punct = input.parse()?; bounds.push_punct(punct); } bounds }, })) } else { Ok(WherePredicate::Type(PredicateType { lifetimes: input.parse()?, bounded_ty: input.parse()?, colon_token: input.parse()?, bounds: { let mut bounds = Punctuated::new(); loop { if input.is_empty() || input.peek(token::Brace) || input.peek(Token![,]) || input.peek(Token![;]) || input.peek(Token![:]) && !input.peek(Token![::]) || input.peek(Token![=]) { break; } let value = input.parse()?; bounds.push_value(value); if !input.peek(Token![+]) { break; } let punct = input.parse()?; bounds.push_punct(punct); } bounds }, })) } } } } #[cfg(feature = "printing")] mod printing { use super::*; use proc_macro2::TokenStream; use quote::{ToTokens, TokenStreamExt}; use attr::FilterAttrs; use print::TokensOrDefault; impl ToTokens for Generics { fn to_tokens(&self, tokens: &mut TokenStream) { if self.params.is_empty() { return; } TokensOrDefault(&self.lt_token).to_tokens(tokens); // Print lifetimes before types and consts, regardless of their // order in self.params. // // TODO: ordering rules for const parameters vs type parameters have // not been settled yet. https://github.com/rust-lang/rust/issues/44580 let mut trailing_or_empty = true; for param in self.params.pairs() { if let GenericParam::Lifetime(_) = **param.value() { param.to_tokens(tokens); trailing_or_empty = param.punct().is_some(); } } for param in self.params.pairs() { match **param.value() { GenericParam::Type(_) | GenericParam::Const(_) => { if !trailing_or_empty { <Token![,]>::default().to_tokens(tokens); trailing_or_empty = true; } param.to_tokens(tokens); } GenericParam::Lifetime(_) => {} } } TokensOrDefault(&self.gt_token).to_tokens(tokens); } } impl<'a> ToTokens for ImplGenerics<'a> { fn to_tokens(&self, tokens: &mut TokenStream) { if self.0.params.is_empty() { return; } TokensOrDefault(&self.0.lt_token).to_tokens(tokens); // Print lifetimes before types and consts, regardless of their // order in self.params. // // TODO: ordering rules for const parameters vs type parameters have // not been settled yet. https://github.com/rust-lang/rust/issues/44580 let mut trailing_or_empty = true; for param in self.0.params.pairs() { if let GenericParam::Lifetime(_) = **param.value() { param.to_tokens(tokens); trailing_or_empty = param.punct().is_some(); } } for param in self.0.params.pairs() { if let GenericParam::Lifetime(_) = **param.value() { continue; } if !trailing_or_empty { <Token![,]>::default().to_tokens(tokens); trailing_or_empty = true; } match **param.value() { GenericParam::Lifetime(_) => unreachable!(), GenericParam::Type(ref param) => { // Leave off the type parameter defaults tokens.append_all(param.attrs.outer()); param.ident.to_tokens(tokens); if !param.bounds.is_empty() { TokensOrDefault(&param.colon_token).to_tokens(tokens); param.bounds.to_tokens(tokens); } } GenericParam::Const(ref param) => { // Leave off the const parameter defaults tokens.append_all(param.attrs.outer()); param.const_token.to_tokens(tokens); param.ident.to_tokens(tokens); param.colon_token.to_tokens(tokens); param.ty.to_tokens(tokens); } } param.punct().to_tokens(tokens); } TokensOrDefault(&self.0.gt_token).to_tokens(tokens); } } impl<'a> ToTokens for TypeGenerics<'a> { fn to_tokens(&self, tokens: &mut TokenStream) { if self.0.params.is_empty() { return; } TokensOrDefault(&self.0.lt_token).to_tokens(tokens); // Print lifetimes before types and consts, regardless of their // order in self.params. // // TODO: ordering rules for const parameters vs type parameters have // not been settled yet. https://github.com/rust-lang/rust/issues/44580 let mut trailing_or_empty = true; for param in self.0.params.pairs() { if let GenericParam::Lifetime(ref def) = **param.value() { // Leave off the lifetime bounds and attributes def.lifetime.to_tokens(tokens); param.punct().to_tokens(tokens); trailing_or_empty = param.punct().is_some(); } } for param in self.0.params.pairs() { if let GenericParam::Lifetime(_) = **param.value() { continue; } if !trailing_or_empty { <Token![,]>::default().to_tokens(tokens); trailing_or_empty = true; } match **param.value() { GenericParam::Lifetime(_) => unreachable!(), GenericParam::Type(ref param) => { // Leave off the type parameter defaults param.ident.to_tokens(tokens); } GenericParam::Const(ref param) => { // Leave off the const parameter defaults param.ident.to_tokens(tokens); } } param.punct().to_tokens(tokens); } TokensOrDefault(&self.0.gt_token).to_tokens(tokens); } } impl<'a> ToTokens for Turbofish<'a> { fn to_tokens(&self, tokens: &mut TokenStream) { if !self.0.params.is_empty() { <Token![::]>::default().to_tokens(tokens); TypeGenerics(self.0).to_tokens(tokens); } } } impl ToTokens for BoundLifetimes { fn to_tokens(&self, tokens: &mut TokenStream) { self.for_token.to_tokens(tokens); self.lt_token.to_tokens(tokens); self.lifetimes.to_tokens(tokens); self.gt_token.to_tokens(tokens); } } impl ToTokens for LifetimeDef { fn to_tokens(&self, tokens: &mut TokenStream) { tokens.append_all(self.attrs.outer()); self.lifetime.to_tokens(tokens); if !self.bounds.is_empty() { TokensOrDefault(&self.colon_token).to_tokens(tokens); self.bounds.to_tokens(tokens); } } } impl ToTokens for TypeParam { fn to_tokens(&self, tokens: &mut TokenStream) { tokens.append_all(self.attrs.outer()); self.ident.to_tokens(tokens); if !self.bounds.is_empty() { TokensOrDefault(&self.colon_token).to_tokens(tokens); self.bounds.to_tokens(tokens); } if self.default.is_some() { TokensOrDefault(&self.eq_token).to_tokens(tokens); self.default.to_tokens(tokens); } } } impl ToTokens for TraitBound { fn to_tokens(&self, tokens: &mut TokenStream) { let to_tokens = |tokens: &mut TokenStream| { self.modifier.to_tokens(tokens); self.lifetimes.to_tokens(tokens); self.path.to_tokens(tokens); }; match self.paren_token { Some(ref paren) => paren.surround(tokens, to_tokens), None => to_tokens(tokens), } } } impl ToTokens for TraitBoundModifier { fn to_tokens(&self, tokens: &mut TokenStream) { match *self { TraitBoundModifier::None => {} TraitBoundModifier::Maybe(ref t) => t.to_tokens(tokens), } } } impl ToTokens for ConstParam { fn to_tokens(&self, tokens: &mut TokenStream) { tokens.append_all(self.attrs.outer()); self.const_token.to_tokens(tokens); self.ident.to_tokens(tokens); self.colon_token.to_tokens(tokens); self.ty.to_tokens(tokens); if self.default.is_some() { TokensOrDefault(&self.eq_token).to_tokens(tokens); self.default.to_tokens(tokens); } } } impl ToTokens for WhereClause { fn to_tokens(&self, tokens: &mut TokenStream) { if !self.predicates.is_empty() { self.where_token.to_tokens(tokens); self.predicates.to_tokens(tokens); } } } impl ToTokens for PredicateType { fn to_tokens(&self, tokens: &mut TokenStream) { self.lifetimes.to_tokens(tokens); self.bounded_ty.to_tokens(tokens); self.colon_token.to_tokens(tokens); self.bounds.to_tokens(tokens); } } impl ToTokens for PredicateLifetime { fn to_tokens(&self, tokens: &mut TokenStream) { self.lifetime.to_tokens(tokens); self.colon_token.to_tokens(tokens); self.bounds.to_tokens(tokens); } } impl ToTokens for PredicateEq { fn to_tokens(&self, tokens: &mut TokenStream) { self.lhs_ty.to_tokens(tokens); self.eq_token.to_tokens(tokens); self.rhs_ty.to_tokens(tokens); } } }
34.032657
88
0.47356
ccffe8b77e927a8a8f1a62cf12062db15ffb09c5
1,841
lua
Lua
3DDemo1/assets/scenes/menu.lua
hgy29/GIDEROS_LUAU_SAMPLES
abedadd4542967042b99b0383aa60e9e3d15907b
[ "MIT" ]
null
null
null
3DDemo1/assets/scenes/menu.lua
hgy29/GIDEROS_LUAU_SAMPLES
abedadd4542967042b99b0383aa60e9e3d15907b
[ "MIT" ]
null
null
null
3DDemo1/assets/scenes/menu.lua
hgy29/GIDEROS_LUAU_SAMPLES
abedadd4542967042b99b0383aa60e9e3d15907b
[ "MIT" ]
1
2022-03-11T07:54:57.000Z
2022-03-11T07:54:57.000Z
Menu = Core.class(Sprite) function Menu:init() -- BG application:setBackgroundColor(0x1234AA) -- a button local btn01 = ButtonMonster.new({ pixelcolorup=0x00ff00, pixelcolordown=0x0000ff, text="let's go!", textscalexup=6, }, 1) -- position btn01:setPosition(myappwidth/2, 3*myappheight/10) -- order self:addChild(btn01) -- btns listeners btn01:addEventListener("clicked", function() self:gotoScene("levelX") end) -- listeners self:addEventListener("enterBegin", self.onTransitionInBegin, self) self:addEventListener("enterEnd", self.onTransitionInEnd, self) self:addEventListener("exitBegin", self.onTransitionOutBegin, self) self:addEventListener("exitEnd", self.onTransitionOutEnd, self) end -- GAME LOOP function Menu:onEnterFrame(e) end -- EVENT LISTENERS function Menu:onTransitionInBegin() self:addEventListener(Event.ENTER_FRAME, self.onEnterFrame, self) end function Menu:onTransitionInEnd() self:myKeysPressed() end function Menu:onTransitionOutBegin() self:removeEventListener(Event.ENTER_FRAME, self.onEnterFrame, self) end function Menu:onTransitionOutEnd() end -- KEYS HANDLER function Menu:myKeysPressed() self:addEventListener(Event.KEY_DOWN, function(e) -- for mobiles and desktops if e.keyCode == KeyCode.BACK or e.keyCode == KeyCode.ESC then -- scenemanager:changeScene("menu", 1, transitions[2], easing.outBack) end -- fullscreen local modifier = application:getKeyboardModifiers() local alt = (modifier & KeyCode.MODIFIER_ALT) > 0 if alt and e.keyCode == KeyCode.ENTER then isfullscreen = not isfullscreen fullScreen(isfullscreen) end end) end -- change scene function Menu:gotoScene(xscene) scenemanager:changeScene( xscene, 1, transitions[math.random(1, #transitions)], easings[math.random(1, #easings)] ) end
32.875
110
0.745247
d8be23a730d792eaef3a196598d5691b80b0cb56
736
asm
Assembly
tests/vice-tests/CIA/tod/hammerfist0.asm
PhylumChordata/chips-test
4f80ede2da9952efeb25d3887c768654d2374167
[ "MIT" ]
330
2017-12-11T21:20:28.000Z
2022-03-26T08:56:51.000Z
tests/vice-tests/CIA/tod/hammerfist0.asm
PhylumChordata/chips-test
4f80ede2da9952efeb25d3887c768654d2374167
[ "MIT" ]
14
2019-01-07T23:50:35.000Z
2022-01-09T13:43:16.000Z
tests/vice-tests/CIA/tod/hammerfist0.asm
PhylumChordata/chips-test
4f80ede2da9952efeb25d3887c768654d2374167
[ "MIT" ]
31
2018-07-02T06:13:31.000Z
2022-02-18T16:50:56.000Z
PROCESSOR 6502 ORG $801 hex 0b 08 0a 00 9e 32 30 36 31 00 00 00 JSR set JSR reset LDA $dc0d LSR LSR LSR BCS fine LDY #$01 fine STY $400 ldy #10 lda $400 cmp #4 bne fail ldy #5 fail: sty $d020 lda $d020 and #$0f ldx #0 ; success cmp #5 beq nofail ldx #$ff ; failure nofail: stx $d7ff RTS vax hex 03 12 30 09 set LDY #$03 iniz LDA vax,Y STA $dc08,Y DEY BPL iniz rts reset LDY #$00 LDA #$00 cont STA $dc08,Y INY CPY #$04 BCC cont rts
14.153846
50
0.404891
907089410dcf6faafbb079270b62ebdd07f19f76
860
asm
Assembly
data/maps/objects/GameCorner.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
1
2022-02-15T00:19:44.000Z
2022-02-15T00:19:44.000Z
data/maps/objects/GameCorner.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
data/maps/objects/GameCorner.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
GameCorner_Object: db $f ; border block def_warps warp 15, 17, 7, LAST_MAP warp 16, 17, 7, LAST_MAP warp 17, 4, 1, ROCKET_HIDEOUT_B1F def_signs sign 9, 4, 12 ; CeladonGameCornerText12 def_objects object SPRITE_BEAUTY, 2, 6, STAY, DOWN, 1 ; person object SPRITE_CLERK, 5, 6, STAY, DOWN, 2 ; person object SPRITE_MIDDLE_AGED_MAN, 2, 10, STAY, LEFT, 3 ; person object SPRITE_BEAUTY, 2, 13, STAY, LEFT, 4 ; person object SPRITE_FISHING_GURU, 5, 11, STAY, RIGHT, 5 ; person object SPRITE_MIDDLE_AGED_WOMAN, 8, 11, STAY, LEFT, 6 ; person object SPRITE_GYM_GUIDE, 8, 14, STAY, LEFT, 7 ; person object SPRITE_GAMBLER, 11, 15, STAY, RIGHT, 8 ; person object SPRITE_CLERK, 14, 11, STAY, LEFT, 9 ; person object SPRITE_GENTLEMAN, 17, 13, STAY, RIGHT, 10 ; person object SPRITE_ROCKET, 9, 5, STAY, UP, 11, OPP_ROCKET, 7 def_warps_to GAME_CORNER
33.076923
63
0.72093
93bd2147c97b7efd813f77b7064135641bd6feca
1,317
html
HTML
login.html
Reactor11/Travelling-Site
b7992528eeb56ed3d61a4cae9abcf7cd7e743777
[ "MIT" ]
null
null
null
login.html
Reactor11/Travelling-Site
b7992528eeb56ed3d61a4cae9abcf7cd7e743777
[ "MIT" ]
null
null
null
login.html
Reactor11/Travelling-Site
b7992528eeb56ed3d61a4cae9abcf7cd7e743777
[ "MIT" ]
null
null
null
<!DOCTYPE> <html> <head> <title>Login | Park View Hotel</title> <link rel="stylesheet" type="text/css" href="login.css"/> <script type="text/javascript"> function clicked() { alert('Successfully submitted'); } $("#formname").resetForm(); </script> </head> <body> <div id="holder"><a href="https://www.co.in"><img src="images/22.jpg" width="200px" height="100px"/></a> <div id="header"> <ul> <li><a href="login.html">Login</a></li> <li><a href="overview.html">Overview</a></li> <li><a href="book.html">Booking</a></li> <li><a href="index.html">Home</a></li> </ul> </div><!--header --> <div id="login"> <br> <h1> Login</h1> <div id="p"><br><br><br> <form method="post"> <label for="number">Room Number:</label> <input id="" name="rnumber" placeholder="Number" required="" type="text"> <br><br> <label for="number">Room Id:</label> <input id="" name="rid" placeholder="Id" required="" type="text"> <br><br> Cancel: <input type="radio" name="cancel" value="yes">Yes <input type="radio" name="cancel" value="no">No <br><br> <input type="submit" name="submit" value="Ok"/> </form> </div><!--p--> </div><!--login--> </div><!--holder--> </body> </html>
28.021277
105
0.545178
9516490e03bbafd75dfda2282add19fe9aaf24ae
942
sql
SQL
src/main/java/server/custom/forum/forum_thread.sql
MXDTeam/zsrc
72fd6a3b780891e334b8513d02de87c689e2b3bc
[ "Apache-2.0" ]
1
2021-08-05T08:53:21.000Z
2021-08-05T08:53:21.000Z
src/main/java/server/custom/forum/forum_thread.sql
MXDTeam/zsrc
72fd6a3b780891e334b8513d02de87c689e2b3bc
[ "Apache-2.0" ]
null
null
null
src/main/java/server/custom/forum/forum_thread.sql
MXDTeam/zsrc
72fd6a3b780891e334b8513d02de87c689e2b3bc
[ "Apache-2.0" ]
null
null
null
/* Navicat MySQL Data Transfer Source Server : MXD Source Server Version : 50513 Source Host : localhost:3306 Source Database : mxd Target Server Type : MYSQL Target Server Version : 50513 File Encoding : 65001 Date: 2017-06-29 17:58:43 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `forum_thread` -- ---------------------------- DROP TABLE IF EXISTS `forum_thread`; CREATE TABLE `forum_thread` ( `tid` int(4) NOT NULL AUTO_INCREMENT, `sid` int(4) DEFAULT NULL, `tname` varchar(255) DEFAULT NULL, `cid` int(11) DEFAULT NULL, `cname` varchar(255) DEFAULT NULL, `time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `up` int(4) NOT NULL DEFAULT '0', `down` int(4) NOT NULL DEFAULT '0', PRIMARY KEY (`tid`) ) ENGINE=MyISAM AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of forum_thread -- ----------------------------
26.166667
55
0.602972
f021654f570c2c6d9ccce1b2af08fa8e81f95f25
427
js
JavaScript
src/service-double-creator.js
shairez/angular-test-doubles
a8f0173ade14cdde4fe0426f807750d9c89a5bed
[ "MIT" ]
null
null
null
src/service-double-creator.js
shairez/angular-test-doubles
a8f0173ade14cdde4fe0426f807750d9c89a5bed
[ "MIT" ]
null
null
null
src/service-double-creator.js
shairez/angular-test-doubles
a8f0173ade14cdde4fe0426f807750d9c89a5bed
[ "MIT" ]
null
null
null
(function (window, angular, jasmine) { window.doubles = window.doubles || {}; window.doubles.service = createServiceDouble; function createServiceDouble(serviceName, methodNames) { angular .module('mocks__' + serviceName) .factory(serviceName, srv); function srv() { var double = jasmine.createSpyObj(serviceName, methodNames); return double; } } })(window, angular, jasmine);
21.35
66
0.672131
2e4c829fa6c657780dce45008da5142e943be37b
1,358
lua
Lua
src/main/lua/art/storage/cluster/space.lua
art-community/art-tarantool
4a1a0ecdfbeff958ca231500126a8bae463e9dbd
[ "Apache-2.0" ]
null
null
null
src/main/lua/art/storage/cluster/space.lua
art-community/art-tarantool
4a1a0ecdfbeff958ca231500126a8bae463e9dbd
[ "Apache-2.0" ]
null
null
null
src/main/lua/art/storage/cluster/space.lua
art-community/art-tarantool
4a1a0ecdfbeff958ca231500126a8bae463e9dbd
[ "Apache-2.0" ]
null
null
null
local space = { cancellerFiber = nil, checkOperationAvailability = function(operation, args) art.box.space.waitForClusterOperation() art.box.space.activeClusterOperation = true art.cluster.space.cancellerFiber = art.core.fiber.create(art.cluster.space.autoCanceller) local result = {} box.begin() result[1], result[2] = pcall(art.box.space[operation], unpack(args)) box.rollback() return result end, autoCanceller = function() art.core.fiber.sleep(art.config.space.autoCancelTimeout) art.box.space.activeClusterOperation = false art.cluster.space.cancellerFiber = nil end, cancelOperation = function() art.box.space.activeClusterOperation = false art.cluster.space.cancellerFiber:cancel() art.cluster.space.cancellerFiber = nil end, executeOperation = function(operation, args) local result = {} box.begin() result[1], result[2] = pcall(art.box.space[operation], unpack(args)) if (result[1]) then box.commit() else box.rollback() end art.box.space.activeClusterOperation = false art.cluster.space.cancellerFiber:cancel() art.cluster.space.cancellerFiber = nil return result end, } return space
30.863636
97
0.635493
c889e721e355ec5734d88505af11393fd2bfe15a
3,597
rs
Rust
ataxia-portal/src/bin/portal.rs
xenith-studios/ataxia
6fd3c8d6be4483b09088c340724798b466c87618
[ "Apache-2.0", "MIT" ]
67
2015-01-01T02:57:52.000Z
2022-01-21T05:58:32.000Z
ataxia-portal/src/bin/portal.rs
xenith-studios/ataxia
6fd3c8d6be4483b09088c340724798b466c87618
[ "Apache-2.0", "MIT" ]
3
2018-01-30T19:36:13.000Z
2021-01-29T04:00:02.000Z
ataxia-portal/src/bin/portal.rs
xenith-studios/ataxia
6fd3c8d6be4483b09088c340724798b466c87618
[ "Apache-2.0", "MIT" ]
6
2018-02-06T01:59:00.000Z
2022-01-28T02:50:43.000Z
//! Binary source for the network portal //! There should be minimal functionality in this file. It exists mainly to set up the portal and //! call out to the library code. #![warn( trivial_casts, trivial_numeric_casts, unsafe_code, unused_import_braces, unused_qualifications, clippy::all, clippy::pedantic, clippy::perf, clippy::style )] #![forbid(unsafe_code)] // Include this file to get access to the timestamp of the compilation include!(concat!(env!("OUT_DIR"), "/version.rs")); use std::fs::File; use std::io::Write; use std::path::PathBuf; use std::process; use log::{error, info}; use simplelog::{ ColorChoice, CombinedLogger, Config, LevelFilter, TermLogger, TerminalMode, WriteLogger, }; #[allow(clippy::too_many_lines)] fn main() -> Result<(), anyhow::Error> { // Load settings from config file while allowing command-line overrides let config = ataxia_core::Config::new().unwrap_or_else(|err| { eprintln!("Unable to load the configuration file: {}", err); std::process::exit(1); }); // Initialize logging subsystem CombinedLogger::init(vec![ TermLogger::new( if config.debug() { LevelFilter::Debug } else if config.verbose() { LevelFilter::Info } else { LevelFilter::Warn }, Config::default(), TerminalMode::Mixed, ColorChoice::Auto, ), WriteLogger::new( if config.debug() { LevelFilter::Debug } else { LevelFilter::Info }, Config::default(), File::create(config.log_file())?, ), ])?; info!( "Loading Ataxia Network Portal, compiled on {}", ATAXIA_COMPILED ); // TODO: Set up signal handlers (SIGINT, SIGQUIT, SIGHUP) // Clean up from previous unclean shutdown if necessary // Write PID to file // TODO: Acquire lock on PID file as additional method of insuring only a single instance is running? let pid_file = PathBuf::from(config.pid_file()); // FIXME: Remove this block once we have a supervisor system in place to handle unclean shutdown if pid_file.exists() { std::fs::remove_file(&pid_file)?; } File::create(&pid_file)?.write_all(format!("{}", process::id()).as_ref())?; // Initialize support subsystems // Environment // Queues // Database // Initialize Tokio async runtime and spin up the worker threadpool let runtime = tokio::runtime::Runtime::new().expect("Unable to initialize the Tokio Runtime"); // Initialize portal and networking subsystems let server = runtime .block_on(ataxia_portal::Portal::new(config)) .unwrap_or_else(|err| { error!("Unable to initialize the portal: {}", err); std::process::exit(1); }); // Start main loop if let Err(e) = runtime.block_on(server.run()) { // If we enter this block, the system has crashed and we don't know why // TODO: Do some cleanup before exiting, but leave the PID file in place to signal an // unclean shutdown error!("Unresolved system error: {}", e); std::process::exit(1); } // If the loop exited without an error, we have a clean shutdown // TODO: Flush pending database writes and close database connection // Remove the PID file if pid_file.exists() { std::fs::remove_file(&pid_file)?; } info!("Clean shutdown"); Ok(()) }
31.278261
105
0.610787
0cb0b38792d89fd297ac4e2837ebcd95e10cf475
545
sql
SQL
subprojects/thingverse-api/src/main/resources/sql/data-derby.sql
gitter-badger/thingverse
c2ea432911da364d9c85e9efb97728be03de2b17
[ "Apache-2.0" ]
null
null
null
subprojects/thingverse-api/src/main/resources/sql/data-derby.sql
gitter-badger/thingverse
c2ea432911da364d9c85e9efb97728be03de2b17
[ "Apache-2.0" ]
null
null
null
subprojects/thingverse-api/src/main/resources/sql/data-derby.sql
gitter-badger/thingverse
c2ea432911da364d9c85e9efb97728be03de2b17
[ "Apache-2.0" ]
null
null
null
INSERT INTO user_table (user_name, password) VALUES ('dummy_user', '$2a$10$slYQmyNdGzTn7ZLBXBChFOC9f6kFjAqPhccnP6DxlWXx2lPk1C3G6'), ('thingverse', '$2a$10$NAUza3ggBMYYKOr5UB3QPe3WLGDcIrcJQ4arKxdLLB0f/VM.7HxVu'), ('bad_user', '$2a$10$slYQmyNdGzTn7ZLBXBChFOC9f6kFjAqPhccnP6DxlWXx2lPk1C3G6'); INSERT INTO role_table (role_name) VALUES ('ROLE_USER'), ('ROLE_ADMIN'); INSERT INTO authority_table (user_name, authority) VALUES ('dummy_user', 'ROLE_USER'), ('thingverse', 'ROLE_USER'), ('thingverse', 'ROLE_ADMIN');
41.923077
86
0.73578
e2c450f08b2de7c75b8add925102f1f5cb976967
2,288
lua
Lua
mock/sqscript/SQNodeIf.lua
tommo/mock
276f0b5acf1ee41e84d5a80a5e12bf81ebaf8815
[ "MIT" ]
8
2015-12-14T16:09:13.000Z
2019-12-12T17:22:56.000Z
mock/sqscript/SQNodeIf.lua
tommo/mock
276f0b5acf1ee41e84d5a80a5e12bf81ebaf8815
[ "MIT" ]
null
null
null
mock/sqscript/SQNodeIf.lua
tommo/mock
276f0b5acf1ee41e84d5a80a5e12bf81ebaf8815
[ "MIT" ]
5
2015-02-16T08:47:31.000Z
2019-12-12T17:22:59.000Z
module 'mock' -------------------------------------------------------------------- CLASS: SQNodeIf ( SQNodeGroup ) :MODEL{} function SQNodeIf:__init() self.expr = false end function SQNodeIf:load( data ) self.expr = data.args[ 1 ] local valueFunc, err = loadEvalScriptWithEnv( self.expr ) if not valueFunc then self:_warn( 'failed compiling condition expr:', err ) self.valueFunc = false else self.valueFunc = valueFunc end end local setfenv = setfenv function SQNodeIf:checkCondition( state, env ) local func = self.valueFunc if not func then return false end local ok, result = func( state:getEvalEnv() ) if ok then return result end return false end function SQNodeIf:enter( state, env ) local result = self:checkCondition( state, env ) env[ 'result' ] = result if not result then return false end end function SQNodeIf:getIcon() return 'sq_node_if' end -------------------------------------------------------------------- CLASS: SQNodeElseIf ( SQNodeIf ) function SQNodeElseIf:__init() self.parentIfNode = false end function SQNodeElseIf:build() local prev = self:getPrevSibling() if prev:isInstance( SQNodeElseIf ) then self.parentIfNode = prev.parentIfNode elseif prev:isInstance( SQNodeIf ) then self.parentIfNode = prev end end function SQNodeElseIf:enter( state, env ) local parentEnv = state:getNodeEnvTable( self.parentIfNode ) if parentEnv[ 'result' ] then return false end local result = self:checkCondition( state, env ) parentEnv[ 'result' ] = result if not result then return false end end -------------------------------------------------------------------- CLASS: SQNodeElse ( SQNodeGroup ) function SQNodeElse:__init() self.parentIfNode = false end function SQNodeElse:build() local prev = self:getPrevSibling() if prev:isInstance( SQNodeElseIf ) then self.parentIfNode = prev.parentIfNode elseif prev:isInstance( SQNodeIf ) then self.parentIfNode = prev end end function SQNodeElse:enter( state, env ) local parentEnv = state:getNodeEnvTable( self.parentIfNode ) if parentEnv[ 'result' ] then return false end end ------------------------------------------------------------------- registerSQNode( 'if', SQNodeIf ) registerSQNode( 'elseif', SQNodeElseIf ) registerSQNode( 'else', SQNodeElse )
23.346939
68
0.659091
81cddade584529050f46276cb5e42515d7a211fd
15,100
rs
Rust
src/key_blob.rs
emgre/win-crypto-ng
1bab685f9ba21d3fe6a5164c8c45b13ef4b6262b
[ "BSD-3-Clause" ]
6
2019-12-17T00:44:32.000Z
2022-01-06T19:11:17.000Z
src/key_blob.rs
emgre/win-crypto-ng
1bab685f9ba21d3fe6a5164c8c45b13ef4b6262b
[ "BSD-3-Clause" ]
22
2019-12-27T18:18:03.000Z
2021-09-24T15:05:28.000Z
src/key_blob.rs
emgre/win-crypto-ng
1bab685f9ba21d3fe6a5164c8c45b13ef4b6262b
[ "BSD-3-Clause" ]
4
2019-12-11T21:59:46.000Z
2020-11-07T07:39:23.000Z
//! Cryptographic key blobs use crate::blob; use crate::helpers::Pod; use crate::helpers::{Blob, BlobLayout}; use std::convert::TryFrom; use winapi::shared::bcrypt::*; use winapi::shared::ntdef::ULONG; /// Type of a key blob. pub enum BlobType { AesWrapKey, DhPrivate, DhPublic, DsaPublic, DsaPrivate, EccPrivate, EccPublic, KeyData, OpaqueKey, PublicKey, PrivateKey, RsaFullPrivate, RsaPrivate, RsaPublic, LegacyDhPrivate, LegacyDhPublic, LegacyDsaPrivate, LegacyDsaPublic, LegacyDsaV2Private, LegacyRsaPrivate, LegacyRsaPublic, } impl BlobType { pub fn as_value(&self) -> &'static str { match self { BlobType::AesWrapKey => BCRYPT_AES_WRAP_KEY_BLOB, BlobType::DhPrivate => BCRYPT_DH_PRIVATE_BLOB, BlobType::DhPublic => BCRYPT_DH_PUBLIC_BLOB, BlobType::DsaPublic => BCRYPT_DSA_PUBLIC_BLOB, BlobType::DsaPrivate => BCRYPT_DSA_PRIVATE_BLOB, BlobType::EccPrivate => BCRYPT_ECCPRIVATE_BLOB, BlobType::EccPublic => BCRYPT_ECCPUBLIC_BLOB, BlobType::KeyData => BCRYPT_KEY_DATA_BLOB, BlobType::OpaqueKey => BCRYPT_OPAQUE_KEY_BLOB, BlobType::PublicKey => BCRYPT_PUBLIC_KEY_BLOB, BlobType::PrivateKey => BCRYPT_PRIVATE_KEY_BLOB, BlobType::RsaFullPrivate => BCRYPT_RSAFULLPRIVATE_BLOB, BlobType::RsaPrivate => BCRYPT_RSAPRIVATE_BLOB, BlobType::RsaPublic => BCRYPT_RSAPUBLIC_BLOB, BlobType::LegacyDhPrivate => LEGACY_DH_PRIVATE_BLOB, BlobType::LegacyDhPublic => LEGACY_DH_PUBLIC_BLOB, BlobType::LegacyDsaPrivate => LEGACY_DSA_PRIVATE_BLOB, BlobType::LegacyDsaPublic => LEGACY_DSA_PUBLIC_BLOB, BlobType::LegacyDsaV2Private => LEGACY_DSA_V2_PRIVATE_BLOB, BlobType::LegacyRsaPrivate => LEGACY_RSAPRIVATE_BLOB, BlobType::LegacyRsaPublic => LEGACY_RSAPUBLIC_BLOB, } } } impl<'a> TryFrom<&'a str> for BlobType { type Error = &'a str; fn try_from(val: &'a str) -> Result<BlobType, Self::Error> { match val { BCRYPT_AES_WRAP_KEY_BLOB => Ok(BlobType::AesWrapKey), BCRYPT_DH_PRIVATE_BLOB => Ok(BlobType::DhPrivate), BCRYPT_DH_PUBLIC_BLOB => Ok(BlobType::DhPublic), BCRYPT_DSA_PUBLIC_BLOB => Ok(BlobType::DsaPublic), BCRYPT_DSA_PRIVATE_BLOB => Ok(BlobType::DsaPrivate), BCRYPT_ECCPRIVATE_BLOB => Ok(BlobType::EccPrivate), BCRYPT_ECCPUBLIC_BLOB => Ok(BlobType::EccPublic), BCRYPT_KEY_DATA_BLOB => Ok(BlobType::KeyData), BCRYPT_OPAQUE_KEY_BLOB => Ok(BlobType::OpaqueKey), BCRYPT_PUBLIC_KEY_BLOB => Ok(BlobType::PublicKey), BCRYPT_PRIVATE_KEY_BLOB => Ok(BlobType::PrivateKey), BCRYPT_RSAFULLPRIVATE_BLOB => Ok(BlobType::RsaFullPrivate), BCRYPT_RSAPRIVATE_BLOB => Ok(BlobType::RsaPrivate), BCRYPT_RSAPUBLIC_BLOB => Ok(BlobType::RsaPublic), LEGACY_DH_PRIVATE_BLOB => Ok(BlobType::LegacyDhPrivate), LEGACY_DH_PUBLIC_BLOB => Ok(BlobType::LegacyDhPublic), LEGACY_DSA_PRIVATE_BLOB => Ok(BlobType::LegacyDsaPrivate), LEGACY_DSA_PUBLIC_BLOB => Ok(BlobType::LegacyDsaPublic), LEGACY_DSA_V2_PRIVATE_BLOB => Ok(BlobType::LegacyDsaV2Private), LEGACY_RSAPRIVATE_BLOB => Ok(BlobType::LegacyRsaPrivate), LEGACY_RSAPUBLIC_BLOB => Ok(BlobType::LegacyRsaPublic), val => Err(val), } } } /// Marker trait for values containing CNG key blob types. pub unsafe trait KeyBlob: Sized { // TODO: Require : BlobLayout + Self::Header: AsRef<BCRYPT_KEY_BLOB> // This can be used to cheaply get the magic and to get rid of `unsafe` // trait and make the as_erased call actually safe const VALID_MAGIC: &'static [ULONG]; fn is_magic_valid(magic: ULONG) -> bool { let accepts_all = Self::VALID_MAGIC.is_empty(); accepts_all || Self::VALID_MAGIC.iter().any(|&x| x == magic) } } impl<T> AsRef<Blob<ErasedKeyBlob>> for Blob<T> where T: BlobLayout + KeyBlob, { fn as_ref(&self) -> &Blob<ErasedKeyBlob> { self.as_erased() } } impl<T> Blob<T> where T: BlobLayout + KeyBlob, { pub fn magic(&self) -> ULONG { self.as_erased().header().Magic } pub fn blob_type(&self) -> Option<BlobType> { magic_to_blob_type(self.magic()) } pub fn as_erased(&self) -> &Blob<ErasedKeyBlob> { // SAFETY: The `KeyBlob` trait is only implemented for types that also // implement BlobLayout and whose header extends the basic // BCRYPT_KEY_BLOB, which Blob<ErasedKeyBlob> wraps unsafe { self.ref_cast() } } // NOTE: TryInto can't be implemented due to blanket generic TryFrom impl, // i.e. U = T provides a blanket Into<T> for T impl. pub fn try_into<U>(self: Box<Self>) -> Result<Box<Blob<U>>, Box<Self>> where U: BlobLayout + KeyBlob, { if !U::is_magic_valid(self.magic()) { return Err(self); } Ok(Blob::<U>::from_boxed(self.into_bytes())) } } macro_rules! key_blobs { ($($name: ident, $blob: expr, magic: $([$($val: ident),*])?),*) => { fn magic_to_blob_type(magic: ULONG) -> Option<BlobType> { match magic { $( $($(| $val)* => Some($blob),)? )* _ => None } } $( unsafe impl KeyBlob for $name { const VALID_MAGIC: &'static [ULONG] = &[$($($val),*)?]; } )* }; } key_blobs! { ErasedKeyBlob, BlobType::PublicKey, magic:, DhKeyPublicBlob, BlobType::DhPublic, magic: [BCRYPT_DH_PUBLIC_MAGIC], DhKeyPrivateBlob, BlobType::DhPrivate, magic: [BCRYPT_DH_PRIVATE_MAGIC], DsaKeyPublicBlob, BlobType::DsaPublic, magic: [BCRYPT_DSA_PUBLIC_MAGIC], DsaKeyPrivateBlob, BlobType::DsaPrivate, magic: [BCRYPT_DSA_PRIVATE_MAGIC], DsaKeyPublicV2Blob, BlobType::DsaPublic, magic: [BCRYPT_DSA_PUBLIC_MAGIC_V2], DsaKeyPrivateV2Blob, BlobType::DsaPrivate, magic: [BCRYPT_DSA_PRIVATE_MAGIC_V2], EccKeyPublicBlob, BlobType::EccPublic, magic: [ BCRYPT_ECDH_PUBLIC_GENERIC_MAGIC, BCRYPT_ECDH_PUBLIC_P256_MAGIC, BCRYPT_ECDH_PUBLIC_P384_MAGIC, BCRYPT_ECDH_PUBLIC_P521_MAGIC, BCRYPT_ECDSA_PUBLIC_GENERIC_MAGIC, BCRYPT_ECDSA_PUBLIC_P256_MAGIC, BCRYPT_ECDSA_PUBLIC_P384_MAGIC, BCRYPT_ECDSA_PUBLIC_P521_MAGIC ], EccKeyPrivateBlob, BlobType::EccPrivate, magic: [ BCRYPT_ECDH_PRIVATE_GENERIC_MAGIC, BCRYPT_ECDH_PRIVATE_P256_MAGIC, BCRYPT_ECDH_PRIVATE_P384_MAGIC, BCRYPT_ECDH_PRIVATE_P521_MAGIC, BCRYPT_ECDSA_PRIVATE_GENERIC_MAGIC, BCRYPT_ECDSA_PRIVATE_P256_MAGIC, BCRYPT_ECDSA_PRIVATE_P384_MAGIC, BCRYPT_ECDSA_PRIVATE_P521_MAGIC ], RsaKeyPublicBlob, BlobType::RsaPublic, magic: [BCRYPT_RSAPUBLIC_MAGIC], RsaKeyPrivateBlob, BlobType::RsaPrivate, magic: [BCRYPT_RSAPRIVATE_MAGIC], RsaKeyFullPrivateBlob, BlobType::RsaFullPrivate, magic: [BCRYPT_RSAFULLPRIVATE_MAGIC] } blob! { /// Dynamic struct layout for dynamically determined key blob. enum ErasedKeyBlob {}, header: BCRYPT_KEY_BLOB, /// Phantom payload for dynamically determined key blob. view: struct ref ErasedKeyPayload { phantom[0], } } unsafe impl Pod for BCRYPT_KEY_BLOB {} blob! { /// Dynamic struct layout for [`BCRYPT_RSAPUBLIC_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_rsakey_blob). enum RsaKeyPublicBlob {}, header: BCRYPT_RSAKEY_BLOB, /// Trailing data for [`BCRYPT_RSAPUBLIC_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_rsakey_blob). /// /// All the fields are stored as a big-endian multiprecision integer. view: struct ref RsaKeyPublicPayload { pub_exp[cbPublicExp], modulus[cbModulus], } } unsafe impl Pod for BCRYPT_RSAKEY_BLOB {} blob! { /// Dynamic struct layout for [`BCRYPT_RSAPRIVATE_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_rsakey_blob). enum RsaKeyPrivateBlob {}, header: BCRYPT_RSAKEY_BLOB, /// Trailing data for [`BCRYPT_RSAPRIVATE_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_rsakey_blob). /// /// All the fields are stored as a big-endian multiprecision integer. view: struct ref RsaKeyPrivatePayload { pub_exp[cbPublicExp], modulus[cbModulus], prime1[cbPrime1], prime2[cbPrime2], } } blob! { /// Dynamic struct layout for [`BCRYPT_RSAFULLPRIVATE_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_rsakey_blob). enum RsaKeyFullPrivateBlob {}, header: BCRYPT_RSAKEY_BLOB, /// Trailing data for [`BCRYPT_RSAFULLPRIVATE_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_rsakey_blob). /// /// All the fields are stored as a big-endian multiprecision integer. view: struct ref RsaKeyFullPrivatePayload { pub_exp[cbPublicExp], modulus[cbModulus], prime1[cbPrime1], prime2[cbPrime2], exponent1[cbPrime1], exponent2[cbPrime2], coeff[cbPrime1], priv_exp[cbModulus], } } unsafe impl Pod for BCRYPT_DH_KEY_BLOB {} blob! { /// Dynamic struct layout for [`BCRYPT_DH_PUBLIC_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_dh_key_blob). enum DhKeyPublicBlob {}, header: BCRYPT_DH_KEY_BLOB, /// Trailing data for [`BCRYPT_DH_PUBLIC_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_dh_key_blob). /// /// All the fields are stored as a big-endian multiprecision integer. view: struct ref DhKeyPublicPayload { modulus[cbKey], generator[cbKey], public[cbKey], } } blob! { /// Dynamic struct layout for [`BCRYPT_DH_PRIVATE_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_dh_key_blob). enum DhKeyPrivateBlob {}, header: BCRYPT_DH_KEY_BLOB, /// Trailing data for [`BCRYPT_DH_PRIVATE_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_dh_key_blob). /// /// All the fields are stored as a big-endian multiprecision integer. view: struct ref DhKeyPrivatePayload { modulus[cbKey], generator[cbKey], public[cbKey], priv_exp[cbKey], } } unsafe impl Pod for BCRYPT_DSA_KEY_BLOB {} blob! { /// Dynamic struct layout for [`BCRYPT_DSA_PUBLIC_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_dsa_key_blob). enum DsaKeyPublicBlob {}, header: BCRYPT_DSA_KEY_BLOB, /// Trailing data for [`BCRYPT_DSA_PUBLIC_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_dsa_key_blob). /// /// All the fields are stored as a big-endian multiprecision integer. view: struct ref DsaKeyPublicPayload { modulus[cbKey], generator[cbKey], public[cbKey], } } blob! { /// Dynamic struct layout for [`BCRYPT_DSA_PRIVATE_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_dsa_key_blob). enum DsaKeyPrivateBlob {}, header: BCRYPT_DSA_KEY_BLOB, /// Trailing data for [`BCRYPT_DSA_PRIVATE_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_dsa_key_blob). /// /// All the fields are stored as a big-endian multiprecision integer. view: struct ref DsaKeyPrivatePayload { modulus[cbKey], generator[cbKey], public[cbKey], priv_exp[20], } } unsafe impl Pod for BCRYPT_DSA_KEY_BLOB_V2 {} blob! { /// Dynamic struct layout for /// [`BCRYPT_DSA_PUBLIC_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_dsa_key_blob_v2) /// (V2). enum DsaKeyPublicV2Blob {}, header: BCRYPT_DSA_KEY_BLOB_V2, /// Trailing data for /// [`BCRYPT_DSA_PUBLIC_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_dsa_key_blob_v2) /// for DSA keys that exceed 1024 bits in length but are less than or equal /// to 3072 bits. /// /// All the fields are stored as a big-endian multiprecision integer. view: struct ref DsaKeyPublicV2Payload { // docs.microsoft.com are incorrect and seems to have a copy/paste mistake. // Refer to layout this layout instead: // https://github.com/dotnet/runtime/blob/67d74fca70d4670ad503e23dba9d6bc8a1b5909e/src/libraries/Common/src/System/Security/Cryptography/DSACng.ImportExport.cs#L246-L254 seed[cbSeedLength], group[cbGroupSize], modulus[cbKey], generator[cbKey], public[cbKey], } } blob! { /// Dynamic struct layout for /// [`BCRYPT_DSA_PRIVATE_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_dsa_key_blob_v2) /// (V2). enum DsaKeyPrivateV2Blob {}, header: BCRYPT_DSA_KEY_BLOB_V2, /// Trailing data for /// [`BCRYPT_DSA_PRIVATE_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_dsa_key_blob_v2) /// for DSA keys that exceed 1024 bits in length but are less than or equal /// to 3072 bits. /// /// All the fields are stored as a big-endian multiprecision integer. view: struct ref DsaKeyPrivateV2Payload { // docs.microsoft.com are incorrect and seems to have a copy/paste mistake. // Refer to layout this layout instead: // https://github.com/dotnet/runtime/blob/67d74fca70d4670ad503e23dba9d6bc8a1b5909e/src/libraries/Common/src/System/Security/Cryptography/DSACng.ImportExport.cs#L246-L254 seed[cbSeedLength], group[cbGroupSize], modulus[cbKey], generator[cbKey], public[cbKey], priv_exp[cbGroupSize], } } unsafe impl Pod for BCRYPT_ECCKEY_BLOB {} blob! { /// Dynamic struct layout for [`BCRYPT_ECCPUBLIC_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_ecc_key_blob). enum EccKeyPublicBlob {}, header: BCRYPT_ECCKEY_BLOB, /// Trailing data for [`BCRYPT_ECCPUBLIC_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_ecc_key_blob). /// /// All the fields are stored as a big-endian multiprecision integer. view: struct ref EccKeyPublicPayload { x[cbKey], y[cbKey], } } blob! { /// Dynamic struct layout for [`BCRYPT_ECCPRIVATE_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_ecckey_blob). enum EccKeyPrivateBlob {}, header: BCRYPT_ECCKEY_BLOB, /// Trailing data for [`BCRYPT_ECCPRIVATE_BLOB`](https://docs.microsoft.com/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_ecckey_blob). /// /// All the fields are stored as a big-endian multiprecision integer. view: struct ref EccKeyPrivatePayload { x[cbKey], y[cbKey], d[cbKey], } }
38.717949
177
0.677152
69dafeb6e24691a8a57a6df19961628692612884
970
kt
Kotlin
core/src/main/java/com/pierfrancescosoffritti/androidyoutubeplayer/core/player/PlayerConstants.kt
binplus-android/android-youtube-player
f0cc03e87d3d363de0d423ce2e3efc713ada2ae5
[ "MIT" ]
209
2017-10-11T12:18:21.000Z
2018-06-29T12:40:28.000Z
core/src/main/java/com/pierfrancescosoffritti/androidyoutubeplayer/core/player/PlayerConstants.kt
binplus-android/android-youtube-player
f0cc03e87d3d363de0d423ce2e3efc713ada2ae5
[ "MIT" ]
121
2017-10-09T19:50:53.000Z
2018-06-30T07:44:00.000Z
core/src/main/java/com/pierfrancescosoffritti/androidyoutubeplayer/core/player/PlayerConstants.kt
binplus-android/android-youtube-player
f0cc03e87d3d363de0d423ce2e3efc713ada2ae5
[ "MIT" ]
63
2017-10-11T22:25:28.000Z
2018-06-29T19:19:50.000Z
package com.pierfrancescosoffritti.androidyoutubeplayer.core.player class PlayerConstants { enum class PlayerState { UNKNOWN, UNSTARTED, ENDED, PLAYING, PAUSED, BUFFERING, VIDEO_CUED } enum class PlaybackQuality { UNKNOWN, SMALL, MEDIUM, LARGE, HD720, HD1080, HIGH_RES, DEFAULT } enum class PlayerError { UNKNOWN, INVALID_PARAMETER_IN_REQUEST, HTML_5_PLAYER, VIDEO_NOT_FOUND, VIDEO_NOT_PLAYABLE_IN_EMBEDDED_PLAYER } enum class PlaybackRate { UNKNOWN, RATE_0_25, RATE_0_5, RATE_1, RATE_1_5, RATE_2 } } fun PlayerConstants.PlaybackRate.toFloat(): Float { return when (this) { PlayerConstants.PlaybackRate.UNKNOWN -> 1f PlayerConstants.PlaybackRate.RATE_0_25 -> 0.25f PlayerConstants.PlaybackRate.RATE_0_5 -> 0.5f PlayerConstants.PlaybackRate.RATE_1 -> 1f PlayerConstants.PlaybackRate.RATE_1_5 -> 1.5f PlayerConstants.PlaybackRate.RATE_2 -> 2f } }
31.290323
116
0.712371
5e3812d06aefb8593a230eb67a6c7991962a7894
2,290
swift
Swift
Source/Core/Injector.swift
VladimirRopotan/DInjector
8c84cb0832bb2a524ec8f35775b94cf46da970b2
[ "MIT" ]
null
null
null
Source/Core/Injector.swift
VladimirRopotan/DInjector
8c84cb0832bb2a524ec8f35775b94cf46da970b2
[ "MIT" ]
null
null
null
Source/Core/Injector.swift
VladimirRopotan/DInjector
8c84cb0832bb2a524ec8f35775b94cf46da970b2
[ "MIT" ]
null
null
null
// // Injector.swift // DInjector // // Created by Vladimir on 10.12.2020. // Copyright © 2020 RVladimir. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/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. public final class Injector { public static func setup(modules: InjectorModule...) -> Injector { return Injector(modules: modules) } private let modules: [InjectorModule] private init(modules: [InjectorModule]) { self.modules = modules } public func get<Class>(name: String = "") -> Class { var optionalDependency: Class? modules.forEach { module in Mirror(reflecting: module).children.forEach { child in guard let provide = child.value as? Provide<Class>, provide.name == name else { return } if optionalDependency != nil { fatalError("Found two or more provides for '\(Class.self)' with name \(name)") } optionalDependency = provide.getValue(form: self) } } guard let dependency = optionalDependency else { fatalError("Provide for '\(Class.self)' with name \(name) is no found") } return dependency } }
40.175439
130
0.660262
bcb20f020ff5d1b4e28299ca6a0c49d7dcf0df63
259
js
JavaScript
data/js/14/ae/85/20/00/00.28.js
hdm/mac-tracker
69f0c4efaa3d60111001d40f7a33886cc507e742
[ "CC-BY-4.0", "MIT" ]
20
2018-12-26T17:06:05.000Z
2021-08-05T07:47:31.000Z
data/js/14/ae/85/20/00/00.28.js
hdm/mac-tracker
69f0c4efaa3d60111001d40f7a33886cc507e742
[ "CC-BY-4.0", "MIT" ]
1
2021-06-03T12:20:55.000Z
2021-06-03T16:36:26.000Z
data/js/14/ae/85/20/00/00.28.js
hdm/mac-tracker
69f0c4efaa3d60111001d40f7a33886cc507e742
[ "CC-BY-4.0", "MIT" ]
8
2018-12-27T05:07:48.000Z
2021-01-26T00:41:17.000Z
macDetailCallback("14ae85200000/28",[{"d":"2019-12-12","t":"add","s":"ieee-mam.csv","a":"UnitA3-A4,Level8,Block A ,International Innovation Park,No.1Keyuanwei Rd.,Laoshan District Qingdao CN 266100","c":"CN","o":"Qingdao iTechene Technologies Co., Ltd."}]);
129.5
258
0.706564
b14d3262a54a8a0dbe965c24d5a7a90600966352
1,651
c
C
chapter_01/1-22.c
ryo-utsunomiya/answers_to_c_programming_language
b5a4ee2e2ef4c8273af3a2276a3a5f7a66012331
[ "MIT" ]
null
null
null
chapter_01/1-22.c
ryo-utsunomiya/answers_to_c_programming_language
b5a4ee2e2ef4c8273af3a2276a3a5f7a66012331
[ "MIT" ]
null
null
null
chapter_01/1-22.c
ryo-utsunomiya/answers_to_c_programming_language
b5a4ee2e2ef4c8273af3a2276a3a5f7a66012331
[ "MIT" ]
null
null
null
/** * Exercise 1-22 * * Write a program to “fold” long input lines into two or more shorter lines after the last non-blank character that * occurs before the n-th column of input. Make sure your program does something intelligent with very long lines, and * if there are no blanks or tabs before the specified column. */ #include <stdio.h> #define TAB_WIDTH 4 #define LINE_LENGTH 40 int main(void) { int pos = 0, last = 0, c, i, col = 0; char line[LINE_LENGTH]; while ((c = getchar()) != EOF) { line[pos] = c; if (c == '\t' && col <= LINE_LENGTH - TAB_WIDTH) { for (i = col % TAB_WIDTH; i < TAB_WIDTH; ++i) { line[pos] = ' '; ++pos; } col += (TAB_WIDTH - col % TAB_WIDTH); } if (c != '\t') { ++pos; ++col; } if (c == ' ' || c == '\t') { last = pos - 1; } if (c == '\n') { line[pos] = '\0'; printf("%s", line); pos = last = 0; col = 0; } if (pos == LINE_LENGTH) { for (i = 0; i < last; ++i) { printf("%c", line[i]); } putchar('\n'); for (i = 0; i < LINE_LENGTH - last; ++i) { if (line[last + i + 1] != ' ' || line[last + i + 1] != '\t') { line[i] = line[last + i + 1]; } } pos = LINE_LENGTH - last - 1; col = pos; } } for (i = 0; i < pos; ++i) { printf("%c", line[i]); } putchar('\n'); return 0; }
22.930556
118
0.411266
899a8dce7f0915f43e7eb6b2d63875ebcfa07a86
446
asm
Assembly
BackwardCompat/BackwardCompat/Main.asm
ryancollins-dev/Assembly
399341d6af62be17fffe281a921d92beff84424d
[ "MIT" ]
null
null
null
BackwardCompat/BackwardCompat/Main.asm
ryancollins-dev/Assembly
399341d6af62be17fffe281a921d92beff84424d
[ "MIT" ]
null
null
null
BackwardCompat/BackwardCompat/Main.asm
ryancollins-dev/Assembly
399341d6af62be17fffe281a921d92beff84424d
[ "MIT" ]
null
null
null
;----------x86-64bit---------- ;.code ;main proc ;mov rax,2 ;mov rbx,3 ;mov rcx,4 ;ret ;main endp ;end ;----------x86-32bit---------- ;.386 ;.model flat ;.code ;main proc ;mov eax,2 ;mov ebx,3 ;mov ecx,4 ;ret ;main endp ;end ;----------16bit---------- .386 .model flat .code main proc mov ax,2 mov bx,3 mov cx,4 ret main endp end
13.117647
30
0.410314
34bd534f0173004cf5e851aeb0caa845ff064838
470
kt
Kotlin
src/main/kotlin/org/web25/felix/jpm/CLIStarter.kt
FelixResch/jpm
ff36ab84d40ea475fc3ef60593b6c10980115fda
[ "MIT" ]
null
null
null
src/main/kotlin/org/web25/felix/jpm/CLIStarter.kt
FelixResch/jpm
ff36ab84d40ea475fc3ef60593b6c10980115fda
[ "MIT" ]
null
null
null
src/main/kotlin/org/web25/felix/jpm/CLIStarter.kt
FelixResch/jpm
ff36ab84d40ea475fc3ef60593b6c10980115fda
[ "MIT" ]
null
null
null
package org.web25.felix.jpm object CLIStarter { private val logger = Start.logger fun main(args: Array<String>) { logger.debug("Parsing command line options") val operationName = args[0] logger.debug("Starting operation $operationName") val operation = OperationFactory.build(operationName, args.copyOfRange(1, args.size)) logger.debug("Operation of type ${operation.name} generated") operation.run() } }
26.111111
93
0.67234
1a49c5cb28ca9d9857a1986fb168438538e0ea25
947
lua
Lua
tests/debounce.lua
LuaDist-testing/fr
52088a623a703c7b43f1a4c9905ff49c02473f0a
[ "MIT" ]
9
2016-05-18T19:08:21.000Z
2018-10-31T08:01:28.000Z
tests/debounce.lua
LuaDist-testing/fr
52088a623a703c7b43f1a4c9905ff49c02473f0a
[ "MIT" ]
null
null
null
tests/debounce.lua
LuaDist-testing/fr
52088a623a703c7b43f1a4c9905ff49c02473f0a
[ "MIT" ]
2
2018-04-08T11:53:58.000Z
2018-07-07T01:04:49.000Z
package.path = "./?.lua;"..package.path local userTime = {} local luvTime = require"fr.time.luv" userTime.setInterval = luvTime.setInterval userTime.setTimeout = luvTime.setTimeout local posixTime = require"fr.time.posix" userTime.getTime = posixTime.getTime package.loaded["fr.time.user"] = userTime local time = require"fr.time" local fr = require"fr" local xlua = require"xlua" local source = fr.fromTable{ {0, 1}, {5, 2}, {6, 3}, {7, 4}, {10, 5}, {17, 6}, {20, 7}, {100, 8}}:flatMap(function(args) return fr.defer(args[1], args[2]) end ) --[[ local source = fr.defer(5, 1):merge( fr.defer(6, 2)):merge( fr.defer(7, 3)):merge( fr.defer(10, 4)):merge( fr.defer(16, 5)):merge( fr.defer(20, 6)) ]] source:each(print, "source") source:each(io.flush) source:debounce(5):each(print, "debounce") source:debounceImmediate(5):each(print, "debounceImmediate") --time.setInterval(50, io.flush) require"luv".run()
21.522727
60
0.663147
42934c0d2884daf9162e7c60101f618db7d9f7eb
1,044
asm
Assembly
programs/oeis/047/A047519.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/047/A047519.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/047/A047519.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A047519: Numbers that are congruent to {1, 2, 3, 4, 6, 7} mod 8. ; 1,2,3,4,6,7,9,10,11,12,14,15,17,18,19,20,22,23,25,26,27,28,30,31,33,34,35,36,38,39,41,42,43,44,46,47,49,50,51,52,54,55,57,58,59,60,62,63,65,66,67,68,70,71,73,74,75,76,78,79,81,82,83,84,86,87,89,90,91,92,94,95,97,98,99,100,102,103,105,106,107,108,110,111,113,114,115,116,118,119,121,122,123,124,126,127,129,130,131,132,134,135,137,138,139,140,142,143,145,146,147,148,150,151,153,154,155,156,158,159,161,162,163,164,166,167,169,170,171,172,174,175,177,178,179,180,182,183,185,186,187,188,190,191,193,194,195,196,198,199,201,202,203,204,206,207,209,210,211,212,214,215,217,218,219,220,222,223,225,226,227,228,230,231,233,234,235,236,238,239,241,242,243,244,246,247,249,250,251,252,254,255,257,258,259,260,262,263,265,266,267,268,270,271,273,274,275,276,278,279,281,282,283,284,286,287,289,290,291,292,294,295,297,298,299,300,302,303,305,306,307,308,310,311,313,314,315,316,318,319,321,322,323,324,326,327,329,330,331,332 mov $1,$0 div $0,2 mul $0,2 div $0,3 add $1,$0 add $1,1
104.4
919
0.708812
c397758db1185cb822ddeaebf8e1f469437b3078
5,959
go
Go
pkg/controller/tupwas/tupwas_controller_ide_report.go
tmax-cloud/l2c-operator
22ffb4ee85cc7b36837a939d4731da2040e28e22
[ "Apache-2.0" ]
null
null
null
pkg/controller/tupwas/tupwas_controller_ide_report.go
tmax-cloud/l2c-operator
22ffb4ee85cc7b36837a939d4731da2040e28e22
[ "Apache-2.0" ]
1
2020-08-18T04:29:35.000Z
2020-08-18T04:29:35.000Z
pkg/controller/tupwas/tupwas_controller_ide_report.go
tmax-cloud/l2c-operator
22ffb4ee85cc7b36837a939d4731da2040e28e22
[ "Apache-2.0" ]
null
null
null
package tupwas import ( "context" "fmt" "github.com/tmax-cloud/l2c-operator/internal/utils" tmaxv1 "github.com/tmax-cloud/l2c-operator/pkg/apis/tmax/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" ) const ( IdePrefix = "ide" ReportPrefix = "report" ConfigPrefix = "config" ) func (r *ReconcileTupWAS) deployIdeReport(instance *tmaxv1.TupWAS) error { // Generate VSCode - Secret/Service/Ingress/Deployment idePassword := []byte("") ideUrl := "" reportUrl := "" // Generate Secret ideSecret := ideSecret(instance) if err := r.createAndUpdateStatus(ideSecret, instance, "error getting/creating pipeline"); err != nil { return err } // Check IDE Password err := r.client.Get(context.TODO(), types.NamespacedName{Name: ideSecret.Name, Namespace: ideSecret.Namespace}, ideSecret) if err != nil && !errors.IsNotFound(err) { if err := r.updateErrorStatus(instance, tmaxv1.WasConditionKeyProjectReady, corev1.ConditionFalse, "error getting/creating secret", err.Error()); err != nil { return err } return err } if err == nil { idePassword = ideSecret.Data["password"] } // Generate Service ideService, err := ideReportService(instance) if err != nil { if err := r.updateErrorStatus(instance, tmaxv1.WasConditionKeyProjectReady, corev1.ConditionFalse, "error getting/creating service", err.Error()); err != nil { return err } return err } if err := r.createAndUpdateStatus(ideService, instance, "error getting/creating pipeline"); err != nil { return err } // Generate Ingress ideIngress, err := ideReportIngress(instance) if err != nil { if err := r.updateErrorStatus(instance, tmaxv1.WasConditionKeyProjectReady, corev1.ConditionFalse, "error getting/creating ingress", err.Error()); err != nil { return err } return err } if err := r.createAndUpdateStatus(ideIngress, instance, "error getting/creating pipeline"); err != nil { return err } // Check ingress status first before deploy err = r.client.Get(context.TODO(), types.NamespacedName{Name: ideIngress.Name, Namespace: ideIngress.Namespace}, ideIngress) if err != nil && !errors.IsNotFound(err) { if err := r.updateErrorStatus(instance, tmaxv1.WasConditionKeyProjectReady, corev1.ConditionFalse, "error getting/creating ingress", err.Error()); err != nil { return err } return err } else if err != nil && errors.IsNotFound(err) { if err := r.setCondition(instance, tmaxv1.WasConditionKeyProjectReady, corev1.ConditionFalse, "ingress for ide is not ready", err.Error()); err != nil { return err } } else if err == nil { if len(ideIngress.Status.LoadBalancer.Ingress) == 0 { if err := r.setCondition(instance, tmaxv1.WasConditionKeyProjectReady, corev1.ConditionFalse, "ingress for ide is not ready", "ingress didn't get external ip yet"); err != nil { return err } } else if len(ideIngress.Status.LoadBalancer.Ingress) != 0 && len(ideIngress.Spec.Rules) == 3 && (ideIngress.Spec.Rules[0].Host == IngressDefaultHost || ideIngress.Spec.Rules[1].Host == IngressDefaultHost || ideIngress.Spec.Rules[2].Host == IngressDefaultHost) { // If Loadbalancer is given to the ingress, but host is not set, set host! ideIngress.Spec.Rules[0].Host = fmt.Sprintf("%s.%s.%s.%s.nip.io", IdePrefix, instance.Name, instance.Namespace, ideIngress.Status.LoadBalancer.Ingress[0].IP) ideIngress.Spec.Rules[1].Host = fmt.Sprintf("%s.%s.%s.%s.nip.io", ReportPrefix, instance.Name, instance.Namespace, ideIngress.Status.LoadBalancer.Ingress[0].IP) ideIngress.Spec.Rules[2].Host = fmt.Sprintf("%s.%s.%s.%s.nip.io", ConfigPrefix, instance.Name, instance.Namespace, ideIngress.Status.LoadBalancer.Ingress[0].IP) if err := r.client.Update(context.TODO(), ideIngress); err != nil { return err } } else if len(ideIngress.Spec.Rules) == 3 && ideIngress.Spec.Rules[0].Host != IngressDefaultHost && ideIngress.Spec.Rules[1].Host != IngressDefaultHost && ideIngress.Spec.Rules[2].Host != IngressDefaultHost { // Update ingress url to a status field ideUrl = fmt.Sprintf("http://%s", ideIngress.Spec.Rules[0].Host) reportUrl = fmt.Sprintf("http://%s", ideIngress.Spec.Rules[1].Host) } // Generate Deployment only if ingress is ready if len(ideIngress.Spec.Rules) == 3 && ideIngress.Spec.Rules[0].Host != IngressDefaultHost && ideIngress.Spec.Rules[1].Host != IngressDefaultHost && ideIngress.Spec.Rules[2].Host != IngressDefaultHost { ideDeploy, err := ideReportDeployment(instance, ideIngress.Spec.Rules[2].Host, ideIngress.Spec.Rules[1].Host) if err != nil { return err } if err := utils.CheckAndCreateObject(ideDeploy, instance, r.client, r.scheme, false); err != nil { return err } // Not ready if Deployment has non-ready container err = r.client.Get(context.TODO(), types.NamespacedName{Name: ideDeploy.Name, Namespace: ideDeploy.Namespace}, ideDeploy) if err != nil && !errors.IsNotFound(err) { if err := r.updateErrorStatus(instance, tmaxv1.WasConditionKeyProjectReady, corev1.ConditionFalse, "error getting/creating deployment", err.Error()); err != nil { return err } return err } else if (err != nil && errors.IsNotFound(err)) || (err == nil && (ideDeploy.Status.Replicas == 0 || ideDeploy.Status.Replicas != ideDeploy.Status.ReadyReplicas)) { msg := "some replicas are not ready yet" if err != nil { msg = err.Error() } if err := r.setCondition(instance, tmaxv1.WasConditionKeyProjectReady, corev1.ConditionFalse, "deployment for ide is not ready", msg); err != nil { return err } } } } // Save it to status - only if analyze is complete if instance.Status.LastAnalyzeCompletionTime != nil { if instance.Status.Editor == nil { instance.Status.Editor = &tmaxv1.EditorStatus{} } instance.Status.Editor.Password = string(idePassword) instance.Status.Editor.Url = ideUrl instance.Status.ReportUrl = reportUrl } return nil }
43.49635
264
0.711025
541549fafebdb3f419d6bd64a43c49c6a5db9784
837
go
Go
io/v6/v6_file_system_store.go
AboAuther/learn-go-with-tests
404ef66e2b0824305837d190e063fb5a02395d40
[ "MIT" ]
null
null
null
io/v6/v6_file_system_store.go
AboAuther/learn-go-with-tests
404ef66e2b0824305837d190e063fb5a02395d40
[ "MIT" ]
null
null
null
io/v6/v6_file_system_store.go
AboAuther/learn-go-with-tests
404ef66e2b0824305837d190e063fb5a02395d40
[ "MIT" ]
null
null
null
package main import ( "encoding/json" "io" ) type FileSystemPlayerStore struct { database io.ReadWriteSeeker league League } func NewFileSystemPlayerStore(database io.ReadWriteSeeker) *FileSystemPlayerStore { database.Seek(0, 0) league, _ := NewLeague(database) return &FileSystemPlayerStore{ database: database, league: league, } } func (f *FileSystemPlayerStore) GetLeague() League { return f.league } func (f *FileSystemPlayerStore) GetPlayerScore(name string) int { player := f.GetLeague().Find(name) if player != nil { return player.Wins } return 0 } func (f *FileSystemPlayerStore) RecordWin(name string) { player := f.league.Find(name) if player != nil { player.Wins++ } else { f.league = append(f.league, Player{name, 1}) } f.database.Seek(0, 0) json.NewEncoder(f.database).Encode(f.league) }
20.414634
83
0.721625
616642e41bcbc17b65671dc3f7d89d9afc0ef5c2
1,674
css
CSS
src/style.css
BinaryLeo/JS_IMC_PAGE
dfc04db4de5950f3f333470d03555a0c93d1beab
[ "MIT" ]
null
null
null
src/style.css
BinaryLeo/JS_IMC_PAGE
dfc04db4de5950f3f333470d03555a0c93d1beab
[ "MIT" ]
null
null
null
src/style.css
BinaryLeo/JS_IMC_PAGE
dfc04db4de5950f3f333470d03555a0c93d1beab
[ "MIT" ]
null
null
null
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;1,700&display=swap'); :root{/* global */ --primary-color: rgb(17, 86, 102); --primary-color-darker: rgb(9, 48, 56); }; *{ box-sizing: border-box; outline:0; } body{ margin:0; padding:0; background: var(--primary-color); background-image: url(images/healthly.jpg); background-repeat: no-repeat; background-position: center; background-size: cover; font-family: 'Open sans',sans-serif; } .container { max-width: 640px; margin: 50px auto; background: #fff; padding: 20px; border-radius: 10px; } form label, form button { display: block; width: 100%; margin-bottom: 10px; } form input{ display: block; width: 90%; margin-bottom: 10px; } form input { font-size: 12px; height: 20px; padding: 20px; } form input:focus { outline: 1px solid var(--primary-color); } form button { border: none; background: var(--primary-color); color: #fff; font-size: 18px; font-weight: 700; height: 50px; cursor: pointer; margin-top: 30px; } form button:hover { background: var(--primary-color-darker); } .paragrafo-resultado, .bad { background: rgb(109, 255, 182); padding: 10px 20px; } .bad { background: rgb(255, 150, 150); } .boxes{ display: table-row; clear: both; } .divleft{ display: table-cell; float:left; } .divright{ display: table-cell; float:right; margin-left: 300px; }
19.694118
102
0.566308
74ae322df52bc4dcbc8db6706ce0fd81f26c5433
1,219
js
JavaScript
src/pages/studio.js
kalush81/Garvin-Showcase
2773ab946c1feb0f4733c4387d9ec5f95f3a0b39
[ "RSA-MD" ]
null
null
null
src/pages/studio.js
kalush81/Garvin-Showcase
2773ab946c1feb0f4733c4387d9ec5f95f3a0b39
[ "RSA-MD" ]
null
null
null
src/pages/studio.js
kalush81/Garvin-Showcase
2773ab946c1feb0f4733c4387d9ec5f95f3a0b39
[ "RSA-MD" ]
null
null
null
import React from "react" import Layout from "../components/Layout" import Typography from '@material-ui/core/Typography' export default function Studio() { return ( <Layout> <div> <div>placeholder for a image for now, but in future youtube video</div> <br /> <Typography variant='h2'>Kunstwerk</Typography> <br /><br /> <Typography> De levendige collectie van de getalenteerde kunstenaar Garwin Gaari bestaat uit portretten van een wijde verscheidenheid aan bekende hedendaagse en klassieke beroemdheden. Van hiphopartiesten (Lauryn Hill) en actrices (Audrey Hepburn) tot karakteristieke artiesten (Frida Kahlo, Salvador Dali,…). Pop-art op zijn best waarin zijn stijl van schilderen samen met het gebruik van felle kleuren opvallende portretten creëert binnen een onmisbare gelijkenis. De schilderijen zouden elke ruimte verlichten en hebben een zeer dynamische energie. De afbeeldingen zijn geschilderd met acrylverf op canvas en zijn ook zeer geschikt om als hoogwaardige prints te worden belicht/gedrukt?P </Typography> </div> </Layout> ) }
42.034483
80
0.684988
8688af2d119bbeb956d3989cf4bfe400516e7e0c
1,993
rs
Rust
examples/receive.rs
gitter-badger/coremidi
60d5bf18ecf3e4abb66f4830e6ece94558129fc1
[ "MIT" ]
null
null
null
examples/receive.rs
gitter-badger/coremidi
60d5bf18ecf3e4abb66f4830e6ece94558129fc1
[ "MIT" ]
null
null
null
examples/receive.rs
gitter-badger/coremidi
60d5bf18ecf3e4abb66f4830e6ece94558129fc1
[ "MIT" ]
null
null
null
extern crate coremidi; use std::env; fn main() { let source_index = get_source_index(); println!("Source index: {}", source_index); let source = coremidi::Source::from_index(source_index); println!("Source display name: {}", source.display_name().unwrap()); let client = coremidi::Client::new("example-client").unwrap(); let callback = |packet_list: coremidi::PacketList| { println!("{}", packet_list); }; let input_port = client.input_port("example-port", callback).unwrap(); input_port.connect_source(&source).unwrap(); let mut input_line = String::new(); println!("Press [Intro] to finish ..."); std::io::stdin().read_line(&mut input_line).ok().expect("Failed to read line"); input_port.disconnect_source(&source).unwrap(); } fn get_source_index() -> usize { let mut args_iter = env::args(); let tool_name = args_iter.next() .and_then(|path| path.split(std::path::MAIN_SEPARATOR).last().map(|v| v.to_string())) .unwrap_or("receive".to_string()); match args_iter.next() { Some(arg) => match arg.parse::<usize>() { Ok(index) => { if index >= coremidi::Sources::count() { println!("Source index out of range: {}", index); std::process::exit(-1); } index }, Err(_) => { println!("Wrong source index: {}", arg); std::process::exit(-1); } }, None => { println!("Usage: {} <source-index>", tool_name); println!(""); println!("Available Sources:"); print_sources(); std::process::exit(-1); } } } fn print_sources() { for (i, source) in coremidi::Sources.into_iter().enumerate() { match source.display_name() { Some(display_name) => println!("[{}] {}", i, display_name), None => () } } }
30.19697
93
0.538384
d4da4511b7d7a97d494cce68974850c235770652
1,683
rs
Rust
src/main.rs
jddf/jddf-codegen
5320efebbc407f76793129d008a3ab218c6fa57c
[ "MIT" ]
null
null
null
src/main.rs
jddf/jddf-codegen
5320efebbc407f76793129d008a3ab218c6fa57c
[ "MIT" ]
null
null
null
src/main.rs
jddf/jddf-codegen
5320efebbc407f76793129d008a3ab218c6fa57c
[ "MIT" ]
null
null
null
mod target; mod targets; use clap::{App, AppSettings, Arg}; use failure::Error; use jddf::{Schema, SerdeSchema}; use std::fs::File; use target::Target; fn main() -> Result<(), Error> { let app = App::new("jddf-codegen") .version("0.1") .about("Generates data structures from JDDF schemas") .setting(AppSettings::ColoredHelp) .arg( Arg::with_name("INPUT") .help("Input JDDF schema file") .last(true) .required(true), ); let app = targets::typescript::Target::args(app); let app = targets::golang::Target::args(app); let matches = app.get_matches(); let target_ts = targets::typescript::Target::from_args(&matches)?; let target_go = targets::golang::Target::from_args(&matches)?; // Parse out the input schema, and ensure it is valid. let input = matches.value_of("INPUT").unwrap(); let file = File::open(input)?; let serde_schema: SerdeSchema = serde_json::from_reader(file)?; let schema = Schema::from_serde(serde_schema)?; // Run each of the target transformation routines. If any fail, do not // generate code. let ast_ts = if let Some(ref t) = target_ts { Some(t.transform(&schema)?) } else { None }; let ast_go = if let Some(ref t) = target_go { Some(t.transform(&schema)?) } else { None }; // Serialize each of the ASTs. At this point, only IO errors can cause // issues. if let Some(ref t) = target_ts { t.serialize(&ast_ts.unwrap())?; } if let Some(ref t) = target_go { t.serialize(&ast_go.unwrap())?; } Ok(()) }
27.145161
74
0.592989
578976ef8904d93b7e7296dbf41e0f29ea899662
709
kt
Kotlin
app/src/main/kotlin/com/dleibovich/todokotlin/list/TodoDiffUtilsCallback.kt
ariedov/TODOKotlin
81515dc36145175b91562a63cd04eaf640c8dedb
[ "Apache-2.0" ]
null
null
null
app/src/main/kotlin/com/dleibovich/todokotlin/list/TodoDiffUtilsCallback.kt
ariedov/TODOKotlin
81515dc36145175b91562a63cd04eaf640c8dedb
[ "Apache-2.0" ]
null
null
null
app/src/main/kotlin/com/dleibovich/todokotlin/list/TodoDiffUtilsCallback.kt
ariedov/TODOKotlin
81515dc36145175b91562a63cd04eaf640c8dedb
[ "Apache-2.0" ]
null
null
null
package com.dleibovich.todokotlin.list import android.support.v7.util.DiffUtil import com.dleibovich.todokotlin.db.TodoItem class TodoDiffUtilsCallback(private val items: List<TodoItem>, private val newItems: List<TodoItem>) : DiffUtil.Callback() { override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean = items[oldItemPosition].id == newItems[newItemPosition].id override fun getOldListSize(): Int = items.size override fun getNewListSize(): Int = newItems.size override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean = items[oldItemPosition] == newItems[newItemPosition] }
35.45
88
0.724965
38dea42ccfb12b9abd9dd47cd51487cbf73a6bc4
998
h
C
System/Library/Frameworks/WatchConnectivity.framework/WCActiveDeviceSwitchTask.h
lechium/iPhoneOS_12.1.1_Headers
aac688b174273dfcbade13bab104461f463db772
[ "MIT" ]
12
2019-06-02T02:42:41.000Z
2021-04-13T07:22:20.000Z
System/Library/Frameworks/WatchConnectivity.framework/WCActiveDeviceSwitchTask.h
lechium/iPhoneOS_12.1.1_Headers
aac688b174273dfcbade13bab104461f463db772
[ "MIT" ]
null
null
null
System/Library/Frameworks/WatchConnectivity.framework/WCActiveDeviceSwitchTask.h
lechium/iPhoneOS_12.1.1_Headers
aac688b174273dfcbade13bab104461f463db772
[ "MIT" ]
3
2019-06-11T02:46:10.000Z
2019-12-21T14:58:16.000Z
/* * This header is generated by classdump-dyld 1.0 * on Saturday, June 1, 2019 at 6:50:28 PM Mountain Standard Time * Operating System: Version 12.1.1 (Build 16C5050a) * Image Source: /System/Library/Frameworks/WatchConnectivity.framework/WatchConnectivity * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. */ @interface WCActiveDeviceSwitchTask : NSObject { BOOL _clientReadyForSessionState; unsigned long long _taskState; } @property (assign) BOOL clientReadyForSessionState; //@synthesize clientReadyForSessionState=_clientReadyForSessionState - In the implementation block @property (assign) unsigned long long taskState; //@synthesize taskState=_taskState - In the implementation block +(id)taskStateToString:(unsigned long long)arg1 ; -(BOOL)clientReadyForSessionState; -(void)setClientReadyForSessionState:(BOOL)arg1 ; -(unsigned long long)taskState; -(void)setTaskState:(unsigned long long)arg1 ; -(id)description; @end
36.962963
163
0.775551
74e09d6003e1c5037158d0f7dc8938b167bcfd8f
5,044
js
JavaScript
documentation/www.nushell.sh/assets/js/144.0b2e00ea.js
extratone/extratone
a18e3ac94527626f27dd5447257c9785b7f5d167
[ "MIT" ]
2
2021-06-09T20:03:11.000Z
2021-09-18T21:34:18.000Z
documentation/www.nushell.sh/assets/js/144.0b2e00ea.js
extratone/extratone
a18e3ac94527626f27dd5447257c9785b7f5d167
[ "MIT" ]
497
2020-11-23T12:22:45.000Z
2022-01-17T02:03:22.000Z
documentation/www.nushell.sh/assets/js/144.0b2e00ea.js
extratone/extratone
a18e3ac94527626f27dd5447257c9785b7f5d167
[ "MIT" ]
null
null
null
(window.webpackJsonp=window.webpackJsonp||[]).push([[144],{549:function(s,a,t){"use strict";t.r(a);var e=t(44),r=Object(e.a)({},(function(){var s=this,a=s.$createElement,t=s._self._c||a;return t("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[t("p",[s._v("Convert value to string")]),s._v(" "),t("h2",{attrs:{id:"usage"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#usage"}},[s._v("#")]),s._v(" Usage")]),s._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),s._v(" into string "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("..")]),s._v(".args "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("flags"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" \n")])])]),t("h2",{attrs:{id:"parameters"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#parameters"}},[s._v("#")]),s._v(" Parameters")]),s._v(" "),t("ul",[t("li",[s._v("...args: column paths to convert to string (for table input)")])]),s._v(" "),t("h2",{attrs:{id:"flags"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#flags"}},[s._v("#")]),s._v(" Flags")]),s._v(" "),t("ul",[t("li",[s._v("-h, --help: Display this help message")]),s._v(" "),t("li",[s._v("-d, --decimals "),t("integer",[s._v(": decimal digits to which to round")])],1)]),s._v(" "),t("h2",{attrs:{id:"examples"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[s._v("#")]),s._v(" Examples")]),s._v(" "),t("p",[s._v("convert decimal to string and round to nearest integer")]),s._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[s._v("echo")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[s._v("1.7")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("|")]),s._v(" into string -d "),t("span",{pre:!0,attrs:{class:"token number"}},[s._v("0")]),s._v("\n")])])]),t("p",[s._v("convert decimal to string")]),s._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[s._v("echo")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[s._v("4.3")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("|")]),s._v(" into string\n")])])]),t("p",[s._v("convert string to string")]),s._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[s._v("echo")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token string"}},[s._v("'1234'")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("|")]),s._v(" into string\n")])])]),t("p",[s._v("convert boolean to string")]),s._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[s._v("echo")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token variable"}},[s._v("$true")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("|")]),s._v(" into string\n")])])]),t("p",[s._v("convert date to string")]),s._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("date")]),s._v(" now "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("|")]),s._v(" into string\n")])])]),t("p",[s._v("convert filepath to string")]),s._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("ls")]),s._v(" Cargo.toml "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("|")]),s._v(" get name "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("|")]),s._v(" into string\n")])])]),t("p",[s._v("convert filesize to string")]),s._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[s._v("ls")]),s._v(" Cargo.toml "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("|")]),s._v(" get size "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("|")]),s._v(" into string\n")])])])])}),[],!1,null,null,null);a.default=r.exports}}]);
5,044
5,044
0.581086
07f0719fc2ded15e57ebbd4c6742b48661780319
2,356
h
C
netbsd/sys/arch/news68k/dev/msvar.h
MarginC/kame
2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30
[ "BSD-3-Clause" ]
91
2015-01-05T15:18:31.000Z
2022-03-11T16:43:28.000Z
netbsd/sys/arch/news68k/dev/msvar.h
MarginC/kame
2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30
[ "BSD-3-Clause" ]
1
2016-02-25T15:57:55.000Z
2016-02-25T16:01:02.000Z
netbsd/sys/arch/news68k/dev/msvar.h
MarginC/kame
2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30
[ "BSD-3-Clause" ]
21
2015-02-07T08:23:07.000Z
2021-12-14T06:01:49.000Z
/* $NetBSD: msvar.h,v 1.1 2001/01/25 14:33:30 tsutsui Exp $ */ /*- * Copyright (c) 2001 Tsubai Masanari. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define MS_S_BYTE 0 /* start byte */ #define MS_X_BYTE 1 /* second byte */ #define MS_Y_BYTE 2 /* third byte */ #define MS_DB_SIZE 3 #define MS_S_MARK 0x80 /* start mark (first byte)*/ #define MS_S_XSIGN 0x08 /* MSB(sign bit) of X */ #define MS_S_YSIGN 0x10 /* MSB(sign bit) of Y */ #define MS_S_SW1 0x01 /* left button is pressed */ #define MS_S_SW2 0x02 /* right button is pressed */ #define MS_S_SW3 0x04 /* middle button is pressed */ #define MS_X_DATA 0x7f /* data bits of X (second byte) */ #define MS_Y_DATA 0x7f /* data bits of Y (third byte) */ struct ms_softc { struct device sc_dev; bus_space_tag_t sc_bt; bus_space_handle_t sc_bh; struct device *sc_wsmousedev; bus_size_t sc_offset; /* ms data port offset */ int sc_ndata; u_char sc_buf[MS_DB_SIZE]; }; void ms_intr(struct ms_softc *);
42.836364
76
0.741511
ebba17527a3b26dc119432db6fdce779c0d1bc78
3,914
lua
Lua
CommunityContent/NPC AI Kit/Scripts/NPCWaypoint.lua
evilotaku/MGD-Core-Tutorial
6ca2f592c55f42f9bc0194152acfdc0c7b0ff669
[ "MIT" ]
3
2021-03-27T00:20:13.000Z
2021-08-17T08:53:59.000Z
Data/Subfolders/NPC AI Kit/Scripts/NPCWaypoint.lua
Core-Team-META/CC-Quest-System
477ce5ad6e297642f9bae95596cf6569c604c8bb
[ "Apache-2.0" ]
null
null
null
Data/Subfolders/NPC AI Kit/Scripts/NPCWaypoint.lua
Core-Team-META/CC-Quest-System
477ce5ad6e297642f9bae95596cf6569c604c8bb
[ "Apache-2.0" ]
1
2021-06-15T03:59:23.000Z
2021-06-15T03:59:23.000Z
--[[ NPC Waypoint by: standardcombo v1.0.0 The waypoint detects NPCs entering its trigger and directs them to move to the next objective. Can be used for patrolling behaviors, random folks in town, traffic lanes, etc. See the "Waypoint Example" template that is part of this package. Any object that enters the waypoint is evaluated as a possible NPC. It works if the object conforms to these rules: 1. The object is part of a template. 2. The template contains a script. 3. The script has a function called SetObjective(Vector3). 4a. Both the template and the waypoint's trigger are on the same team 4b. or, one of the two has team = 0 (neutral). Waypoint setups can be as simple as two pointing at each other, or a complex network of travel points. To setup a network of waypoints: 1. Add waypoints to the map and resize their triggers to fit the level design. (Don't move the triggers around. Keep them at local position 0,0,0. Move the whole waypoint instead) 2. Deinstance the waypoints 3. In the hierarchy, select a waypoint that is supposed to send NPCs to the next one 4. Drag another waypoint from the hierarchy onto the Properties, to create a destination custom property. 5. You can add multiple custom property destinations to have it select one at random. 6. Any Core Objects can be used as destinations, not just other waypoints. 7. If you don't add any destinations in this way the waypoint will behave as a "dead end". 8. A waypoint can have itself as a custom property. NPCs will patrol the internal space of the waypoint. --]] local ROOT = script.parent local TRIGGER = ROOT:FindChildByType("Trigger") local TRIGGER_SCALE = TRIGGER:GetWorldScale() destinationRadius = math.min(TRIGGER_SCALE.x, TRIGGER_SCALE.y) * 50 function FindAiScript(obj) if not obj.FindTemplateRoot then return end local templateRoot = obj:FindTemplateRoot() if (templateRoot == nil) then templateRoot = obj.parent end if templateRoot then -- Team mismatch exit condition local team = templateRoot:GetCustomProperty("Team") or 0 if (team ~= 0 and TRIGGER.team ~= 0 and team ~= TRIGGER.team) then return nil end -- Search for AI script local scripts = templateRoot:FindDescendantsByType("Script") for _,s in ipairs(scripts) do if s.context.SetObjective then return s end end end return nil end function GetDestination() local key,value = GetRandomCustomProperty(ROOT) if value and value:IsA("CoreObjectReference") then local obj = value:GetObject() local targetPos = obj:GetWorldPosition() local radius = destinationRadius local scripts = obj:FindDescendantsByType("Script") for _,s in ipairs(scripts) do if s.context.destinationRadius then radius = s.context.destinationRadius break end end local rngAngle = math.random() * 2 * math.pi local rngRadius = radius * math.sqrt(math.random()) targetPos.x = targetPos.x + rngRadius * math.cos(rngAngle) targetPos.y = targetPos.y + rngRadius * math.sin(rngAngle) return targetPos else UI.PrintToScreen("ERROR: NPCWaypoint has no destinations. Add CoreObject references as custom properties.") end return nil end function GetRandomCustomProperty(obj) local allProperties = obj:GetCustomProperties() local propertyCount = 0 for _,_ in pairs(allProperties) do propertyCount = propertyCount + 1 end if (propertyCount > 0) then local selectedIndex = math.random(1, propertyCount) local i = 0 for key,value in pairs(allProperties) do i = i + 1 if selectedIndex == i then return key,value end end end return nil,nil end function OnBeginOverlap(theTrigger, obj) --print("OnBeginOverlap obj = " .. tostring(obj)) local aiScript = FindAiScript(obj) if aiScript then local destination = GetDestination() if destination then aiScript.context.SetObjective(destination) end end end TRIGGER.beginOverlapEvent:Connect(OnBeginOverlap)
30.818898
109
0.753449
3898f955af3a5acd435e0f11b31891370dde722a
632
c
C
struct06-10-2020/q_1.c
suehtamCruz/FUP_2020
450d2cd8f5c5f0fc2715c504a699403180f3a7b1
[ "MIT" ]
null
null
null
struct06-10-2020/q_1.c
suehtamCruz/FUP_2020
450d2cd8f5c5f0fc2715c504a699403180f3a7b1
[ "MIT" ]
null
null
null
struct06-10-2020/q_1.c
suehtamCruz/FUP_2020
450d2cd8f5c5f0fc2715c504a699403180f3a7b1
[ "MIT" ]
null
null
null
#include<stdio.h> struct resultados{ float soma; float sub; float divi; float multi; }; void operacoes(float n1, float n2){ struct resultados res_operacoes; res_operacoes.soma = n1 + n2; res_operacoes.sub = n1 - n2; res_operacoes.divi = n1 / n2; res_operacoes.multi = n1 * n2; printf("soma : %0.2f\n",res_operacoes.soma); printf("sub.: %0.2f\n",res_operacoes.sub); printf("divi.: %0.3f\n",res_operacoes.divi); printf("mult.: %0.2f\n",res_operacoes.multi); } int main(void){ float num1,num2; scanf("%f%f",&num1,&num2); operacoes(num1,num2); return 0; }
19.151515
49
0.618671
fc707566f5283269ed9ac5d360e79fd27aa4d3fa
562
css
CSS
src/index.css
tomek-i/visual-sorting
d17246cc3ddc29b91c76423d5e9774b7fa2eaedd
[ "MIT" ]
null
null
null
src/index.css
tomek-i/visual-sorting
d17246cc3ddc29b91c76423d5e9774b7fa2eaedd
[ "MIT" ]
null
null
null
src/index.css
tomek-i/visual-sorting
d17246cc3ddc29b91c76423d5e9774b7fa2eaedd
[ "MIT" ]
null
null
null
:root { --backdrop-color: rgba(207, 207, 207, 0.42); --bar-color: rgb(109, 177, 253); --bar-color-hover: rgba(109, 177, 253, 0.6); --backdrop-width: 60%; } body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-size: 1em; } code { font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace; }
25.545455
81
0.642349
2555fb7d564c9d19106271424c0a3c306fee581a
219
kt
Kotlin
samples/kotysa-spring-jdbc/src/main/kotlin/com/sample/Routes.kt
ufoss-org/kotysa
37cef513b47a7b163427c77396b2c6bf098e7949
[ "Unlicense" ]
46
2020-06-16T01:05:42.000Z
2022-03-30T22:26:21.000Z
samples/kotysa-spring-jdbc/src/main/kotlin/com/sample/Routes.kt
ufoss-org/kotysa
37cef513b47a7b163427c77396b2c6bf098e7949
[ "Unlicense" ]
53
2020-05-31T13:40:19.000Z
2022-03-20T08:56:36.000Z
samples/kotysa-spring-jdbc/src/main/kotlin/com/sample/Routes.kt
ufoss-org/kotysa
37cef513b47a7b163427c77396b2c6bf098e7949
[ "Unlicense" ]
1
2021-11-13T10:21:08.000Z
2021-11-13T10:21:08.000Z
package com.sample import org.springframework.web.servlet.function.router fun routes(userHandler: UserHandler) = router { GET("/api/users", userHandler::listApi) GET("/api/users/{id}", userHandler::userApi) }
24.333333
54
0.73516
8a812ae299d4178855b3c676e7943ff26aa0d7b6
826
rs
Rust
language/move-stdlib/src/tests.rs
lasthyphen/dijets
35fc1295628bd3316f2923e677e062770949698b
[ "Apache-2.0" ]
null
null
null
language/move-stdlib/src/tests.rs
lasthyphen/dijets
35fc1295628bd3316f2923e677e062770949698b
[ "Apache-2.0" ]
123
2021-08-31T19:16:05.000Z
2022-03-31T19:35:09.000Z
language/move-stdlib/src/tests.rs
lasthyphen/dijets
35fc1295628bd3316f2923e677e062770949698b
[ "Apache-2.0" ]
null
null
null
// Copyright (c) The Dijets Core Contributors // SPDX-License-Identifier: Apache-2.0 use tempfile::tempdir; #[test] fn check_that_docs_are_updated() { let temp_dir = tempdir().unwrap(); crate::build_stdlib_doc(&temp_dir.path().to_string_lossy()); assert!( !dir_diff::is_different(&temp_dir, &crate::move_stdlib_docs_full_path()).unwrap(), "Generated docs differ from the ones checked in" ) } #[test] fn check_that_the_errmap_is_updated() { let temp_file = tempfile::NamedTempFile::new().unwrap(); crate::build_error_code_map(&temp_file.path().to_string_lossy()); assert!( file_diff::diff( &temp_file.path().to_string_lossy(), &crate::move_stdlib_errmap_full_path() ), "Generated errmap differ from the one checked in" ); }
25.8125
90
0.66586
efb7a6c2089d4ecc1b1947737290313d332ec7bb
1,148
kt
Kotlin
app/src/main/kotlin/com/vsouhrada/kotlin/android/anko/fibo/core/session/ISession.kt
Squibblet/206CDE_Attendance_System
8c72986ebecb845d71fb0bacdcfd5a05c53fff9b
[ "Apache-2.0" ]
null
null
null
app/src/main/kotlin/com/vsouhrada/kotlin/android/anko/fibo/core/session/ISession.kt
Squibblet/206CDE_Attendance_System
8c72986ebecb845d71fb0bacdcfd5a05c53fff9b
[ "Apache-2.0" ]
null
null
null
app/src/main/kotlin/com/vsouhrada/kotlin/android/anko/fibo/core/session/ISession.kt
Squibblet/206CDE_Attendance_System
8c72986ebecb845d71fb0bacdcfd5a05c53fff9b
[ "Apache-2.0" ]
null
null
null
package com.vsouhrada.kotlin.android.anko.fibo.core.session /** * @author vsouhrada * @since 0.1.0 */ interface ISession { /** * Method is call when session should be open and in case of that method *refresh* was called on [ISessionManager] * @since 0.1.0 */ fun openSession() /** * Called when session should be close. * @since 0.1.0 */ fun closeSession() /** * Method is call when validation of the session is required. * @return true in case of that session is valid, otherwise false is returned * @since 1.0.0 */ fun isValid(): Boolean /** * Returned Object stored in session under the value *key*. * @param key the key value * @return data contained under the *key* value * @since 0.1.0 */ fun getData(key: Int): Any /** * Store Object in session under the value *key*. * @param key the key value * @param value the Object which you want to store * @since 0.1.0 */ fun putData(key: Int, value: Any) /** * Delete the Object stored in session under the value *key*. * @param key the key value * @since 0.1.0 */ fun removeData(key: Int) }
22.076923
116
0.63676
2a188234bc9109ca9d03ba870e6f5ea8b8fc24af
2,956
swift
Swift
JKB_EquipmentManage/JKB_EquipmentManage/Tool/FC_CreateView.swift
wateringFc/FC_EquipmentManage
143b720ed254f81d2c34250ffc17a0b48a900c9d
[ "MIT" ]
1
2020-04-04T11:46:46.000Z
2020-04-04T11:46:46.000Z
JKB_EquipmentManage/JKB_EquipmentManage/Tool/FC_CreateView.swift
wateringFc/FC_EquipmentManage
143b720ed254f81d2c34250ffc17a0b48a900c9d
[ "MIT" ]
null
null
null
JKB_EquipmentManage/JKB_EquipmentManage/Tool/FC_CreateView.swift
wateringFc/FC_EquipmentManage
143b720ed254f81d2c34250ffc17a0b48a900c9d
[ "MIT" ]
1
2020-04-04T11:46:47.000Z
2020-04-04T11:46:47.000Z
// // FC_CreateView.swift // JKB_EquipmentManage // // Created by 方存 on 2019/5/16. // Copyright © 2019年 JKB. All rights reserved. // import UIKit class FC_CreateView: NSObject { /// 控件默认尺寸 class func getDefaultFrame() -> CGRect { let defaultFrame = CGRect(x:0, y:0, width:100, height:30) return defaultFrame } /// 创建按钮 class func createButton(rect:CGRect = FC_CreateView.getDefaultFrame(), title: String, textColor: UIColor = UIColor.black, backgroundColor:UIColor = UIColor.white, font: UIFont = UIFont.systemFont(ofSize: 15), action: Selector, sender: UIViewController) -> UIButton { let button = UIButton(frame:rect) button.backgroundColor = backgroundColor button.setTitle(title, for: .normal) button.setTitleColor(textColor, for: .normal) button.titleLabel!.font = font button.addTarget(sender, action:action, for:.touchUpInside) return button } /// 创建文本输入框控件 class func createTextField(rect:CGRect = FC_CreateView.getDefaultFrame(), placeHolder: String, sender: UITextFieldDelegate) -> UITextField { let textField = UITextField(frame:rect) textField.backgroundColor = UIColor.clear textField.textColor = UIColor.black textField.placeholder = placeHolder textField.borderStyle = UITextBorderStyle.roundedRect // textField.adjustsFontSizeToFitWidth = true textField.delegate = sender return textField } /// 创建分段单选控件 class func createSegment(items: [String], action:Selector, sender:UIViewController) ->UISegmentedControl { let segment = UISegmentedControl(items:items) segment.frame = FC_CreateView.getDefaultFrame() //segment.segmentedControlStyle = UISegmentedControlStyle.Bordered segment.isMomentary = false segment.addTarget(sender, action:action, for:.valueChanged) return segment } /// 创建文本标签控件 class func createLabel(rect:CGRect = FC_CreateView.getDefaultFrame(),title:String, textColor:UIColor = UIColor.black, bgColor:UIColor = UIColor.white, font:UIFont = UIFont.systemFont(ofSize: 15), alignment:NSTextAlignment = .left) -> UILabel { let label = UILabel.init(frame: rect) label.backgroundColor = bgColor label.textColor = textColor label.text = title; label.font = font label.textAlignment = alignment return label } /// 创建图片控件 class func createImgView(rect:CGRect = FC_CreateView.getDefaultFrame(),imgName:String,contentMode:UIViewContentMode = .scaleToFill) -> UIImageView { let imgView:UIImageView = UIImageView.init(frame: CGRect.zero) imgView.contentMode = contentMode if let image = UIImage.init(named: imgName) { imgView.image = image } return imgView } }
36.493827
256
0.662382
9c2021d74d1e4fb87db71f5303dea79d7ec6f378
373
js
JavaScript
__mocks__/newsStoreMock.js
iakhator/news-feed-application
cc59de80b10de7f6825da8f07e7b6c9b758f9228
[ "MIT", "Unlicense" ]
null
null
null
__mocks__/newsStoreMock.js
iakhator/news-feed-application
cc59de80b10de7f6825da8f07e7b6c9b758f9228
[ "MIT", "Unlicense" ]
18
2017-06-11T02:21:57.000Z
2022-02-26T10:50:02.000Z
__mocks__/newsStoreMock.js
iakhator/news-feed-application
cc59de80b10de7f6825da8f07e7b6c9b758f9228
[ "MIT", "Unlicense" ]
1
2017-09-17T11:42:32.000Z
2017-09-17T11:42:32.000Z
const sourcesAction = { type: 'RECIEVE_SOURCES', sources: [ { id: 'al-jazeera-english', name: 'Al Jazeera English', description: 'News, analysis from the Middle East and worldwide.' }, { id: 'ars-technica', name: 'Ars Technica', description: "The PC enthusiast's resource.", } ] }; export default sourcesAction;
18.65
71
0.597855
f08aaf0c21a149f091e46816f64fec592e15a465
631
js
JavaScript
public/script.js
adnanansari2k/express
6fe690ea526c5adf87ff6db37e3374a8c503762e
[ "MIT" ]
1
2020-10-07T18:41:18.000Z
2020-10-07T18:41:18.000Z
public/script.js
adnanansari2k/express
6fe690ea526c5adf87ff6db37e3374a8c503762e
[ "MIT" ]
null
null
null
public/script.js
adnanansari2k/express
6fe690ea526c5adf87ff6db37e3374a8c503762e
[ "MIT" ]
null
null
null
if('geolocation' in navigator) { console.log("hi") navigator.geolocation.getCurrentPosition( async position => { var lat = position.coords.latitude var lon = position.coords.longitude document.getElementById("lat").textContent = lat; document.getElementById("lon").textContent = lon; const data ={lat, lon} const options={ headers: { 'Content-Type': 'application/json' }, method: 'POST', body: JSON.stringify(data) } const response =await fetch("/api", options); const json=await response.json(); console.log(json) }); } else { /* geolocation IS NOT available */ }
25.24
65
0.657686
f000259412224e1de269649b857a4c3b51a9f98c
1,409
py
Python
lang/langs/deutsch.py
SuRoryz/surbot-osu
2b27697417d2a69f40937b4c463530f2a6b98166
[ "MIT" ]
null
null
null
lang/langs/deutsch.py
SuRoryz/surbot-osu
2b27697417d2a69f40937b4c463530f2a6b98166
[ "MIT" ]
1
2020-05-01T17:56:27.000Z
2020-05-01T17:56:27.000Z
lang/langs/deutsch.py
SuRoryz/surbot-osu
2b27697417d2a69f40937b4c463530f2a6b98166
[ "MIT" ]
null
null
null
class Samples: def __init__(self): #COMMANDS self.PP = ('Für [https://osu.ppy.sh/b/{} {} [{}]{}] (OD {}, AR {}, ' 'CS {}, {}★, {}:{}) wirst du {} {}') self.PP_FOR = ('| {}pp bekommen für {}% ') self.PP_PRED = ('Für [https://osu.ppy.sh/b/{} {} [{}]{}] (OD {}, AR {}, ' 'CS {}, {}★, {}:{}) wirst du {} {} # {}') self.PP_PRED_IMPOSSIBLE = ('Unmöglich zu FC für dich') self.PP_PRED_FUTURE = ('Es erwarten dich: {}pp') self.INFO = ('Sie kannst Quelle und Information ' '[https://suroryz.github.io/surbot-osu/ hier] finden') self.LANG_CHANGED = ('Sprache erfolgreich geändert. ' 'Localizer: some HiNative guy') #ERRORS self.ERROR_SYNTAX = ('Sie hast etwas falsches eingegeben. ' 'Kontrollieren Sie die Hilfeseite -> .info') self.ERROR_NP_NEED = ('Sie müssen /np vorher verwenden') self.ERROR_NO_LANGUAGE = ('Entschuldigung, aber ich kann deine/Ihre Sprache nicht in meiner Datenbank finden. ' 'Versuchen Sie den ISO 639-1 Sprachen-Code zu nutzen. ' 'Wenn Ihre dort nicht vorzufinden ist, können Sie das ' '[https://suroryz.github.io/surbot-osu/lang/langs hier] melden')
44.03125
119
0.499645
98d3f45659b056c832c94ec1e8d1b32c1de9bc3f
107
sql
SQL
src/test/resources/sql/select/ef7f263c.sql
Shuttl-Tech/antlr_psql
fcf83192300abe723f3fd3709aff5b0c8118ad12
[ "MIT" ]
66
2018-06-15T11:34:03.000Z
2022-03-16T09:24:49.000Z
src/test/resources/sql/select/ef7f263c.sql
Shuttl-Tech/antlr_psql
fcf83192300abe723f3fd3709aff5b0c8118ad12
[ "MIT" ]
13
2019-03-19T11:56:28.000Z
2020-08-05T04:20:50.000Z
src/test/resources/sql/select/ef7f263c.sql
Shuttl-Tech/antlr_psql
fcf83192300abe723f3fd3709aff5b0c8118ad12
[ "MIT" ]
28
2019-01-05T19:59:02.000Z
2022-03-24T11:55:50.000Z
-- file:geometry.sql ln:121 expect:true SELECT '' AS four, polygon(f1) FROM PATH_TBL WHERE isclosed(f1)
26.75
39
0.728972
28e58ce153824cd84809f9ae1761799b6c5793a8
1,179
rb
Ruby
backend/app/controllers/api/attendances_controller.rb
yogeshjain999/absentee
89c13963571dd129ac274f563e75ab16ed90c53f
[ "MIT" ]
null
null
null
backend/app/controllers/api/attendances_controller.rb
yogeshjain999/absentee
89c13963571dd129ac274f563e75ab16ed90c53f
[ "MIT" ]
null
null
null
backend/app/controllers/api/attendances_controller.rb
yogeshjain999/absentee
89c13963571dd129ac274f563e75ab16ed90c53f
[ "MIT" ]
null
null
null
class Api::AttendancesController < BaseController def create if params[:roll_nos] && params[:standard_id] && params[:date] create_attendance(params[:roll_nos], params[:standard_id], params[:date]) render_success(data: {}, message: I18n.t('attendance.created'), status: :created) else render_error(message: I18n.t('attendance.failed'), status: :unprocessable_entity) end end def sms_callback if params[:sender] == Figaro.env.AUTHORISED_SENDER # ["Date:", "27.04.2019", "Std:", "5", "Section:", "C", "Roll_no:", "1", "2", "3"] data = params[:comments].split(/[',', ' ']/).map{|k| k.gsub("\n", "")} date = Date.parse(data[1]) standard = data[3].to_i section = data[5] absent_roll_nos = data.split('Roll_no:')[1] standard_id = Standard.find_by(standard: standard, section: section).id create_attendance(absent_roll_nos, standard_id, date) else render_error(message: I18n.t('error.not_trusted_sender'), status: :unprocessable_entity) end end private def create_attendance(roll_nos, standard_id, date) Attendance::Create.new(roll_nos, standard_id, date).call end end
35.727273
94
0.661578
0c85c0c3fc3e88d3d1512b447e6a7c16569279b2
1,376
py
Python
nginx_rtmp_wizard/models.py
Gerhut/nginx-rtmp-wizard
c821c3bb262503ee26408b8b3bf4a252b49a29d6
[ "Unlicense" ]
null
null
null
nginx_rtmp_wizard/models.py
Gerhut/nginx-rtmp-wizard
c821c3bb262503ee26408b8b3bf4a252b49a29d6
[ "Unlicense" ]
1
2021-06-10T20:32:59.000Z
2021-06-10T20:32:59.000Z
nginx_rtmp_wizard/models.py
Gerhut/nginx-rtmp-wizard
c821c3bb262503ee26408b8b3bf4a252b49a29d6
[ "Unlicense" ]
null
null
null
from django.conf import settings from django.core import validators from django.db import models DEFAULT_RTMP_PORT = 1935 class Server(models.Model): listen = models.PositiveIntegerField( default=DEFAULT_RTMP_PORT, unique=True, validators=[ validators.MinValueValidator(1024), validators.MaxValueValidator(65535) ]) def __str__(self): if self.listen == DEFAULT_RTMP_PORT: return 'rtmp://{}'.format(settings.RTMP_HOSTNAME) else: return 'rtmp://{}:{}'.format(settings.RTMP_HOSTNAME, self.listen) class Application(models.Model): server = models.ForeignKey(Server, on_delete=models.CASCADE) name = models.SlugField(default='live') live = models.BooleanField(default=False) def __str__(self): return '{}/{}'.format(self.server, self.name) class Meta: constraints = [ models.UniqueConstraint( fields=['server', 'name'], name='unique_server_application_name')] class Push(models.Model): application = models.ForeignKey(Application, on_delete=models.CASCADE) url = models.CharField( max_length=255, unique=True, validators=[ validators.URLValidator(schemes=['rtmp']) ]) def __str__(self): return 'push {};'.format(self.url)
27.52
77
0.634448
4a4b9d29e326b0e4de355a1daba7d274045a9245
2,576
js
JavaScript
src/components/Home/WhoWeAre.js
michalgrudzien/dpz-website
bcb78abb855caf5f7c732bb506c1e3597304ea19
[ "MIT" ]
null
null
null
src/components/Home/WhoWeAre.js
michalgrudzien/dpz-website
bcb78abb855caf5f7c732bb506c1e3597304ea19
[ "MIT" ]
null
null
null
src/components/Home/WhoWeAre.js
michalgrudzien/dpz-website
bcb78abb855caf5f7c732bb506c1e3597304ea19
[ "MIT" ]
null
null
null
import React from "react"; import styled from "styled-components"; import { Container, Row, Col, media } from "styled-bootstrap-grid"; import { graphql, useStaticQuery } from "gatsby"; import Img from "gatsby-image"; import Card, { CardSidePadding } from "components/shared/Card"; import BlockContent from "components/BlockContent"; import colors from "utils/colors"; import { getSingleNode } from "helpers/nodeExtractors"; import logoImg from "assets/images/logo_text.svg"; const StyledSection = styled.section` padding: 3em 0 3em; text-align: justify; ${media.md` padding: 5em 0 3em; `} `; const Heading = styled.h1` color: ${colors.primary}; `; const LogoImg = styled.img` display: block; max-width: 140px; margin: 0 auto 2em 0; `; const GalleryWrapper = styled.div` display: grid; grid-gap: 1em; margin-top: -1em; grid-template-columns: auto auto; ${media.md` padding: 0 1em 0 0; grid-template-columns: 33% 33%; `} `; const GalleryImg = styled(Img)` width: 100%; border-radius: 1em; `; const WhoWeAre = () => { const response = useStaticQuery(graphql` query WhoWeAreQuery { allSanityHomepage { nodes { content { _rawAboutUsBody aboutUs_title aboutUs_images { asset { fluid(maxWidth: 920) { ...GatsbySanityImageFluid } } } } } } } `); const data = getSingleNode(response, "homepage"); return ( <StyledSection id="kim-jestesmy"> <Container> <Row> <Col> <CardSidePadding> <Heading>{data.aboutUs_title}</Heading> </CardSidePadding> <Card> <Row> <Col md="8"> <BlockContent blocks={data._rawAboutUsBody} /> </Col> <Col md="3" mdOffset="1" hiddenXsDown> <LogoImg src={logoImg} /> </Col> </Row> </Card> </Col> </Row> <Row> <Col> <CardSidePadding> <GalleryWrapper> {data.aboutUs_images.map((image) => ( <GalleryImg fluid={image.asset.fluid} alt="DPŻ - Dobra Praktyka Żeglarska" /> ))} </GalleryWrapper> </CardSidePadding> </Col> </Row> </Container> </StyledSection> ); }; export default WhoWeAre;
22.596491
67
0.528339