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
3816423a6b8fb486dec15533bcf6b14aa2b28ce8
3,243
kt
Kotlin
plugin-dotnet-agent/src/test/kotlin/jetbrains/buildServer/dotnet/test/dotnet/DotnetSdksProviderTest.kt
dtretyakov/teamcity-dnx-plugin
f543ce692515f6d810059aa79b51f122c5e9a500
[ "Apache-2.0" ]
2
2016-02-23T06:20:52.000Z
2016-02-27T08:55:41.000Z
plugin-dotnet-agent/src/test/kotlin/jetbrains/buildServer/dotnet/test/dotnet/DotnetSdksProviderTest.kt
dtretyakov/teamcity-dnx-plugin
f543ce692515f6d810059aa79b51f122c5e9a500
[ "Apache-2.0" ]
1
2016-03-01T16:30:49.000Z
2016-03-03T11:10:46.000Z
plugin-dotnet-agent/src/test/kotlin/jetbrains/buildServer/dotnet/test/dotnet/DotnetSdksProviderTest.kt
JetBrains/teamcity-dnx-plugin
d1f75978de78f1acd09405dec11694a592197398
[ "Apache-2.0" ]
null
null
null
/* * Copyright 2000-2022 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package jetbrains.buildServer.dotnet.test.dotnet import jetbrains.buildServer.agent.FileSystemService import jetbrains.buildServer.agent.Version import jetbrains.buildServer.dotnet.DotnetSdk import jetbrains.buildServer.dotnet.DotnetSdksProviderImpl import jetbrains.buildServer.dotnet.test.agent.VirtualFileSystemService import org.testng.Assert import org.testng.annotations.DataProvider import org.testng.annotations.Test import java.io.File class DotnetSdksProviderTest { @DataProvider fun testData(): Array<Array<Any>> { return arrayOf( arrayOf( VirtualFileSystemService() .addDirectory(File(File("dotnet", "sdk"), "1.2.3")) .addDirectory(File(File("dotnet", "sdk"), "1.2.3-rc")) .addFile(File(File("dotnet", "sdk"), "1.2.4")) .addDirectory(File(File("dotnet", "sdk"), "nuget")) .addDirectory(File(File("dotnet", "sdk"), "1.2.5")), listOf( DotnetSdk(File(File("dotnet", "sdk"), "1.2.3"), Version(1, 2, 3)), DotnetSdk(File(File("dotnet", "sdk"), "1.2.3-rc"), Version.parse("1.2.3-rc")), DotnetSdk(File(File("dotnet", "sdk"), "1.2.5"), Version(1, 2, 5)) ) ), arrayOf( VirtualFileSystemService() .addDirectory(File(File("dotnet", "sdk"), "1.2.3")) .addFile(File(File("dotnet", "sdk"), "1.2.4")), listOf(DotnetSdk(File(File("dotnet", "sdk"), "1.2.3"), Version(1, 2, 3))) ), arrayOf( VirtualFileSystemService().addFile(File("dotnet", "sdk")), emptyList<DotnetSdk>() ) ) } @Test(dataProvider = "testData") fun shouldProvideSdks(fileSystemService: FileSystemService, expectedSdks: List<DotnetSdk>) { // Given val toolPath = File("dotnet", "dotnet.exe") val provider = createInstance(fileSystemService) // When val actualSdks = provider.getSdks(toolPath).toList() // Then Assert.assertEquals(actualSdks, expectedSdks) } private fun createInstance(fileSystemService: FileSystemService) = DotnetSdksProviderImpl(fileSystemService) companion object { private val sdksPath = File(File(File("Program Files"), "dotnet"), "sdk") } }
41.576923
110
0.57786
c79a9b3c38a03ce9613b5dad59ea01a29bedd220
288
kt
Kotlin
src/main/kotlin/com/github/tomasmilata/intelliroutes/psi/RoutesElementType.kt
edmocosta/intelliroutes
932c9379d5054f8947bd3449ea911a0319ae0657
[ "MIT" ]
20
2018-02-05T12:33:16.000Z
2022-01-21T14:32:27.000Z
src/main/kotlin/com/github/tomasmilata/intelliroutes/psi/RoutesElementType.kt
edmocosta/intelliroutes
932c9379d5054f8947bd3449ea911a0319ae0657
[ "MIT" ]
17
2017-10-29T14:29:38.000Z
2021-09-15T20:59:01.000Z
src/main/kotlin/com/github/tomasmilata/intelliroutes/psi/RoutesElementType.kt
edmocosta/intelliroutes
932c9379d5054f8947bd3449ea911a0319ae0657
[ "MIT" ]
4
2018-12-11T11:35:12.000Z
2020-04-20T13:39:04.000Z
package com.github.tomasmilata.intelliroutes.psi import com.intellij.psi.tree.IElementType import com.github.tomasmilata.intelliroutes.RoutesLanguage import org.jetbrains.annotations.* class RoutesElementType(@NonNls debugName: String) : IElementType(debugName, RoutesLanguage.INSTANCE)
41.142857
101
0.857639
a63e26e3966405d715ae0300388d9e5899e49efd
4,175
kt
Kotlin
app/app/src/main/java/com/shashov/words/features/words/presentation/CategoriesViewModel.kt
envoy93/Words
0d7e71882a400218125943e3a6ab310c5e3ecd6f
[ "MIT" ]
null
null
null
app/app/src/main/java/com/shashov/words/features/words/presentation/CategoriesViewModel.kt
envoy93/Words
0d7e71882a400218125943e3a6ab310c5e3ecd6f
[ "MIT" ]
null
null
null
app/app/src/main/java/com/shashov/words/features/words/presentation/CategoriesViewModel.kt
envoy93/Words
0d7e71882a400218125943e3a6ab310c5e3ecd6f
[ "MIT" ]
null
null
null
package com.shashov.words.features.words.presentation import android.app.Application import android.arch.lifecycle.AndroidViewModel import android.arch.lifecycle.LiveData import android.arch.lifecycle.MutableLiveData import android.util.Log import com.shashov.words.app.WordsApp import com.shashov.words.features.words.data.local.Category import com.shashov.words.features.words.usecases.GetWordsUseCase import dagger.Lazy import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.subscribers.DisposableSubscriber import javax.inject.Inject class CategoriesViewModel(application: Application) : AndroidViewModel(application) { private var topCategories: MutableLiveData<ArrayList<Category>> private var categories: MutableLiveData<ArrayList<Category>> private var topCategory: Category? private var isLoading: MutableLiveData<Boolean> @Inject lateinit var getWordsUseCase: Lazy<GetWordsUseCase> init { (application as WordsApp).wordsComponent!!.inject(this) categories = MutableLiveData() topCategories = MutableLiveData() isLoading = MutableLiveData() categories.value = ArrayList() isLoading.value = false topCategory = getWordsUseCase.get().getCategory(0) //TODO var list = ArrayList<Category>() list.addAll(getWordsUseCase.get().getTopCategories()!!) topCategories.value = list } internal fun getCategories(): LiveData<ArrayList<Category>> { return categories; } internal fun getTopCategories(): LiveData<ArrayList<Category>> { return topCategories; } internal fun loadCategories(category: Category) { isLoading.value = true topCategory = category getWordsUseCase.get().getCategories( GetWordsUseCase.Input(category.id, AndroidSchedulers.mainThread()), CategoriesUseCaseSubscriber()) } internal fun getLoading(): LiveData<Boolean> { return isLoading } override fun onCleared() { super.onCleared() // remove subscriptions if any getWordsUseCase.get().cancel() Log.d(CategoriesViewModel.TAG, "onCleared") } inner class TopCategoriesUseCaseSubscriber : DisposableSubscriber<List<Category>>() { override fun onNext(drugs: List<Category>) { Log.d(TAG, "Received response for search items") this@CategoriesViewModel.topCategories.value!!.clear(); this@CategoriesViewModel.topCategories.value!!.addAll(drugs) this@CategoriesViewModel.topCategories.postValue(this@CategoriesViewModel.topCategories.value) } override fun onError(e: Throwable) { Log.d(TAG, "Received error: " + e.toString()) this@CategoriesViewModel.topCategories.value = ArrayList() } override fun onComplete() { Log.d(TAG, "onComplete called") } } inner class CategoriesUseCaseSubscriber : DisposableSubscriber<List<Category>>() { override fun onNext(drugs: List<Category>) { Log.d(TAG, "Received response for search items") this@CategoriesViewModel.categories.value!!.clear(); this@CategoriesViewModel.categories.value!!.addAll(drugs) this@CategoriesViewModel.categories.postValue(this@CategoriesViewModel.categories.value) isLoading.value = false } override fun onError(e: Throwable) { Log.d(TAG, "Received error: " + e.toString()) this@CategoriesViewModel.categories.value = ArrayList() isLoading.value = false } override fun onComplete() { Log.d(TAG, "onComplete called") } } companion object { private val TAG = CategoriesViewModel::class.java.simpleName } fun getTopCategoryPosition(): Int { if (topCategory == null) { return 0; } var i = 0 for (c in topCategories.value!!.iterator()) { if (c.id.equals(topCategory!!.id)) { return i } i++ } return 0 } }
31.390977
106
0.661317
0e56cbc4deac48208619b381c0bb7c558d0c51bc
1,098
kt
Kotlin
komapper-processor/src/main/kotlin/org/komapper/ksp/utils.kt
nakamura-to/komapper
606d3fac5eb5738a7d8a6f013503549221d19928
[ "Apache-2.0" ]
23
2019-06-03T12:53:28.000Z
2022-03-12T02:29:27.000Z
komapper-processor/src/main/kotlin/org/komapper/ksp/utils.kt
nakamura-to/koma
606d3fac5eb5738a7d8a6f013503549221d19928
[ "Apache-2.0" ]
2
2019-07-22T00:45:13.000Z
2021-03-20T15:28:20.000Z
komapper-processor/src/main/kotlin/org/komapper/ksp/utils.kt
nakamura-to/koma
606d3fac5eb5738a7d8a6f013503549221d19928
[ "Apache-2.0" ]
null
null
null
package org.komapper.ksp import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSNode import com.google.devtools.ksp.visitor.KSEmptyVisitor internal class Exit(message: String, val node: KSNode?) : Exception(message) { override val message: String get() = super.message!! } internal fun report(message: String, node: KSNode? = null): Nothing { throw Exit(message, node) } internal fun <T> Sequence<T>.anyDuplicates(predicate: (T) -> Boolean): Boolean { return this.filter(predicate).take(2).count() == 2 } internal fun KSClassDeclaration.hasCompanionObject(): Boolean { return declarations.any { it.accept(CompanionObjectVisitor(), Unit) } } private class CompanionObjectVisitor : KSEmptyVisitor<Unit, Boolean>() { override fun defaultHandler(node: KSNode, data: Unit): Boolean { return false } override fun visitClassDeclaration(classDeclaration: KSClassDeclaration, data: Unit): Boolean { return classDeclaration.isCompanionObject && classDeclaration.simpleName.asString() == "Companion" } }
33.272727
106
0.738616
294df1e7ac85fd2f349d4d097231da0597226df9
563
swift
Swift
MortyUI/MortyUIApp.swift
bitrise-io/MortyUI
9c2aa9b088ff63aaa56ab594764353de38ccd491
[ "Apache-2.0" ]
14
2021-02-04T08:48:51.000Z
2021-12-14T09:42:50.000Z
MortyUI/MortyUIApp.swift
bitrise-io/MortyUI
9c2aa9b088ff63aaa56ab594764353de38ccd491
[ "Apache-2.0" ]
null
null
null
MortyUI/MortyUIApp.swift
bitrise-io/MortyUI
9c2aa9b088ff63aaa56ab594764353de38ccd491
[ "Apache-2.0" ]
5
2021-02-04T03:38:39.000Z
2022-03-16T11:46:13.000Z
// // MortyUIApp.swift // MortyUI // // Created by Thomas Ricouard on 18/12/2020. // import SwiftUI import UIKit @main struct MortyUIApp: App { // MARK: - Property let applicationSupport: String = { let root = NSSearchPathForDirectoriesInDomains( .applicationSupportDirectory, .userDomainMask, true )[0] print(root) return root }() // MARK: - Scene var body: some Scene { return WindowGroup { TabbarView() } } }
16.085714
55
0.53286
b2fa232a245de5b9da5a3e07a8eb834b4df0cb1b
1,406
py
Python
ocdskingfisherprocess/maindatabase/migrations/versions/8e3f80979dc9_change_unique_constraint_on_collection.py
matiasSanabria/kingfisher-process
88cb768aaa562714c8bd53e05717639faf041501
[ "BSD-3-Clause" ]
1
2019-04-11T10:17:32.000Z
2019-04-11T10:17:32.000Z
ocdskingfisherprocess/maindatabase/migrations/versions/8e3f80979dc9_change_unique_constraint_on_collection.py
matiasSanabria/kingfisher-process
88cb768aaa562714c8bd53e05717639faf041501
[ "BSD-3-Clause" ]
282
2018-12-20T16:49:22.000Z
2022-02-01T00:48:10.000Z
ocdskingfisherprocess/maindatabase/migrations/versions/8e3f80979dc9_change_unique_constraint_on_collection.py
matiasSanabria/kingfisher-process
88cb768aaa562714c8bd53e05717639faf041501
[ "BSD-3-Clause" ]
7
2019-04-15T13:36:18.000Z
2021-03-02T16:25:41.000Z
"""Change unique constraint on collection Revision ID: 8e3f80979dc9 Revises: 3d5fae27a215 Create Date: 2019-12-18 13:14:56.466907 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = '8e3f80979dc9' down_revision = '3d5fae27a215' branch_labels = None depends_on = None def upgrade(): """ SELECT source_id, data_version, sample, COUNT(*) FROM collection WHERE transform_type IS NULL or transform_type = '' GROUP BY source_id, data_version, sample HAVING COUNT(*) > 1; """ # 0 rows op.drop_constraint('unique_collection_identifiers', 'collection') op.create_index('unique_collection_identifiers', 'collection', ['source_id', 'data_version', 'sample'], unique=True, postgresql_where=sa.text("transform_type = ''")) op.execute("UPDATE collection SET transform_type = '' WHERE transform_type IS NULL") op.alter_column('collection', 'transform_type', nullable=False) def downgrade(): op.drop_index('unique_collection_identifiers', 'collection') op.create_unique_constraint('unique_collection_identifiers', 'collection', [ 'source_id', 'data_version', 'sample', 'transform_from_collection_id', 'transform_type', ]) op.alter_column('collection', 'transform_type', nullable=True) op.execute("UPDATE collection SET transform_type = NULL WHERE transform_type = ''")
32.697674
107
0.72404
856ce1c3c2a2dcde8a5682cbfe0aa954e45042d7
3,256
js
JavaScript
crawler/fetchStandards.js
gnehs/ntut-course-crawler-node
2084e374e6930135ffcfaaa22604b357c47b43ec
[ "MIT" ]
2
2021-02-26T08:37:37.000Z
2021-02-28T18:43:10.000Z
crawler/fetchStandards.js
gnehs/ntut-course-crawler-node
2084e374e6930135ffcfaaa22604b357c47b43ec
[ "MIT" ]
null
null
null
crawler/fetchStandards.js
gnehs/ntut-course-crawler-node
2084e374e6930135ffcfaaa22604b357c47b43ec
[ "MIT" ]
null
null
null
const { fetchSinglePage } = require('./fetchSinglePage') const jsonfile = require('jsonfile'); const fs = require('fs'); const pangu = require('./tools/pangu').spacing; async function main() { let $ = await fetchSinglePage('https://aps.ntut.edu.tw/course/tw/Cprog.jsp?format=-1') let years = [] for (let yr of $('a')) { years.push($(yr).attr('href').match(/\&year=(.+)$/)[1]) } // 儲存各年份課程標準 for (let yr of years) { await parseYear(yr) } jsonfile.writeFileSync(`./dist/standards.json`, years, { spaces: 2, EOL: '\r\n' }) } async function parseYear(year) { fs.mkdirSync(`./dist/${year}/`, { recursive: true }); let $ = await fetchSinglePage(`https://aps.ntut.edu.tw/course/tw/Cprog.jsp?format=-2&year=${year}`) let martics = $('a') let result = {} for (let martic of martics) { let title = $(martic).text() let url = $(martic).attr('href').replace('.', '') url = `https://aps.ntut.edu.tw/course/tw/${url}` console.log('[fetch]', year, title) result[title] = await parseSystem(url) } jsonfile.writeFileSync(`./dist/${year}/standard.json`, result, { spaces: 2, EOL: '\r\n' }) } function getChildText($, tr, i) { return $($(tr).children('td')[i]).text().replace(/\n| /g, '') } async function parseSystem(url = 'https://aps.ntut.edu.tw/course/tw/Cprog.jsp?format=-3&year=109&matric=7') { let $ = await fetchSinglePage(url) let result = {} //parse table title let tableTitle = [] for (let th of $('table tr th')) { tableTitle.push($(th).text().replace(/\n| /g, '')) } $('tr:first-child').remove() //parse table body let trs = $('table tr') for (let tr of trs) { //parseCredit let credits = {} for (let i = 1; i < 9; i++) { credits[tableTitle[i]] = getChildText($, tr, i) } // data // body > table > tbody > tr:nth-child(2) > td:nth-child(1) > p > a let departmentUrl = $(tr).find('a').attr('href').replace('.', '') departmentUrl = `https://aps.ntut.edu.tw/course/tw${departmentUrl}` let departmentTitle = getChildText($, tr, 0) result[departmentTitle] = { credits, ...(await parseDeaprtment(departmentUrl)) } } return result } async function parseDeaprtment(url = 'https://aps.ntut.edu.tw/course/tw/Cprog.jsp?format=-4&year=109&matric=7&division=340') { let $ = await fetchSinglePage(url) let result = { courses: [], rules: [] } $('body > table:nth-child(5) tr:first-child').remove() let trs = $('body > table:nth-child(5) tr') for (let tr of trs) { result.courses.push({ year: getChildText($, tr, 0), sem: getChildText($, tr, 1), type: getChildText($, tr, 2), name: getChildText($, tr, 4), credit: getChildText($, tr, 5), hours: getChildText($, tr, 6), stage: getChildText($, tr, 7), }) } result.rules = pangu($('body > table:nth-child(9) > tbody > tr > td > font').html()) result.rules = result.rules ? result.rules.split('<br>').map(x => x.replace(/(.+)\.|\n/g, '')) : null return result } module.exports = main;
38.305882
126
0.558354
c6112b61d9d0fc833728534317dbfa40fe7c7391
1,223
rb
Ruby
test/functional/nutrients_controller_test.rb
omxhealth/metaboflo
dcf67583f7af7a46ce41a840a57124c5d26b5bd7
[ "MIT" ]
null
null
null
test/functional/nutrients_controller_test.rb
omxhealth/metaboflo
dcf67583f7af7a46ce41a840a57124c5d26b5bd7
[ "MIT" ]
null
null
null
test/functional/nutrients_controller_test.rb
omxhealth/metaboflo
dcf67583f7af7a46ce41a840a57124c5d26b5bd7
[ "MIT" ]
null
null
null
require 'test_helper' class NutrientsControllerTest < ActionController::TestCase test "should get index" do login_as :admin get :index assert_response :success assert_not_nil assigns(:nutrients) end test "should get new" do login_as :admin get :new assert_response :success end test "should create nutrient" do login_as :admin assert_difference('Nutrient.count') do post :create, :nutrient => { :name => 'new nutrient' } end assert_redirected_to nutrient_path(assigns(:nutrient)) end test "should show nutrient" do login_as :admin get :show, :id => nutrients(:one).to_param assert_response :success end test "should get edit" do login_as :admin get :edit, :id => nutrients(:one).to_param assert_response :success end test "should update nutrient" do login_as :admin put :update, :id => nutrients(:one).to_param, :nutrient => { } assert_redirected_to nutrient_path(assigns(:nutrient)) end test "should destroy nutrient" do login_as :admin assert_difference('Nutrient.count', -1) do delete :destroy, :id => nutrients(:one).to_param end assert_redirected_to nutrients_path end end
23.075472
66
0.689289
ad9a8be7397a595e8a941843ddfa9d7622b31bec
2,779
rs
Rust
src/errors.rs
Aaron1011/crater
585999d4057f9d04d8d017eda37d8c22437b7659
[ "Apache-2.0", "MIT" ]
null
null
null
src/errors.rs
Aaron1011/crater
585999d4057f9d04d8d017eda37d8c22437b7659
[ "Apache-2.0", "MIT" ]
null
null
null
src/errors.rs
Aaron1011/crater
585999d4057f9d04d8d017eda37d8c22437b7659
[ "Apache-2.0", "MIT" ]
null
null
null
error_chain! { foreign_links { IoError(::std::io::Error); UrlParseError(::url::ParseError); SerdeJson(::serde_json::Error); ReqwestError(::reqwest::Error); TomlDe(::toml::de::Error); Hyper(::hyper::Error); ParseInt(::std::num::ParseIntError); Parse(::std::string::ParseError); Rusqlite(::rusqlite::Error); RusotoTls(::rusoto_core::request::TlsError); RusotoParseRegion(::rusoto_core::region::ParseRegionError); R2D2(::r2d2::Error); Base64Decode(::base64::DecodeError); Tera(::tera::Error); Utf8(::std::string::FromUtf8Error); CratesIndex(::crates_index::Error); Csv(::csv::Error); } errors { Error404 { description("not found") } Timeout(what: &'static str, when: u64) { description("the operation timed out") display("process killed after {} {}s", what, when) } Download{} BadS3Uri { description("the S3 URI could not be parsed.") } ServerUnavailable { description("the server is not available at the moment") } EmptyToolchainName { description("empty toolchain name") } InvalidToolchainSourceName(name: String) { description("invalid toolchain source name") display("invalid toolchain source name: {}", name) } InvalidToolchainFlag(name: String) { description("invalid toolchain flag") display("invalid toolchain flag: {}", name) } ExperimentNotFound(name: String) { description("experiment not found") display("experiment '{}' not found", name) } ExperimentAlreadyExists(name: String) { description("experiment already exists") display("experiment '{}' already exists", name) } DuplicateToolchains { description("duplicate toolchains provided") } CanEditOnlyQueuedExperiments { description("it's only possible to edit queued experiments") } EmptyAssignee { description("the assignee is empty") } InvalidAssigneeKind(name: String) { description("invalid assignee kind") display("invalid assignee kind: {}", name) } UnexpectedAssigneePayload { description("unexpected assignee payload") } KillProcessFailed(reason: String) { description("killing a process failed") display("killing a process failed: {}", reason) } BadConfig { description("the config file contains errors") } } }
32.313953
72
0.563512
858b7a19454ad0acb3d116a9127c0bde705a8062
1,991
js
JavaScript
test.js
RichardLitt/cuss
db7f415e9be4c62e167eb9fac2356dc13221dde9
[ "MIT" ]
1
2022-01-09T03:28:31.000Z
2022-01-09T03:28:31.000Z
test.js
RichardLitt/cuss
db7f415e9be4c62e167eb9fac2356dc13221dde9
[ "MIT" ]
null
null
null
test.js
RichardLitt/cuss
db7f415e9be4c62e167eb9fac2356dc13221dde9
[ "MIT" ]
null
null
null
'use strict' /* eslint-disable max-nested-callbacks */ var assert = require('assert') var test = require('tape') var fck = require('f-ck') var cusses = { arLatn: require('./ar-latn'), en: require('.'), es: require('./es'), fr: require('./fr'), ptBr: require('./pt-br') } var profanities = { arLatn: require('profanities/ar-latn'), en: require('profanities'), es: require('profanities/es'), fr: require('profanities/fr'), ptBr: require('profanities/pt-br') } var counts = { arLatn: 247, en: 1772, es: 593, fr: 737, ptBr: 148 } test('cuss', function(t) { t.equal(typeof cusses.en, 'object', 'should be an object #1') t.ok('asshat' in cusses.en, 'should contain words #1') t.ok('addict' in cusses.en, 'should contain words #2') t.ok('beaver' in cusses.en, 'should contain words #3') t.equal(cusses.en.asshat, 2, 'should map to a rating #1') t.equal(cusses.en.addict, 1, 'should map to a rating #2') t.equal(cusses.en.beaver, 0, 'should map to a rating #3') t.end() }) test('profanities', function(t) { Object.keys(cusses).forEach(function(lang) { t.test(lang, function(st) { var missing = [] profanities[lang].forEach(function(profanity) { st.doesNotThrow(function() { if (!(profanity in cusses[lang])) { missing.push(profanity) } assert.ok(profanity in cusses[lang], 'should exist') assert.strictEqual( typeof cusses[lang][profanity], 'number', 'should be a number' ) assert.ok(cusses[lang][profanity] >= 0, 'should be gte 0') assert.ok(cusses[lang][profanity] <= 2, 'should be lte 2') }, fck(profanity)) }) st.deepEqual(missing, [], 'should not miss profanities in `' + lang + '`') st.equal( Object.keys(cusses[lang]).length, counts[lang], 'should have a propper count for `' + lang + '`' ) st.end() }) }) t.end() })
24.280488
80
0.582622
1e42ea2deb67ec282bdca0b60a66ee53ccd30f42
3,828
lua
Lua
Start.lua
Venika/LuaPrograms
4c0cb662b0fd171192d0f661ce3b074de470764f
[ "MIT" ]
null
null
null
Start.lua
Venika/LuaPrograms
4c0cb662b0fd171192d0f661ce3b074de470764f
[ "MIT" ]
1
2018-01-29T07:53:29.000Z
2018-01-29T08:42:22.000Z
Start.lua
Venika/LuaRockPaperScissors
4c0cb662b0fd171192d0f661ce3b074de470764f
[ "MIT" ]
null
null
null
local composer = require( "composer" ) local scene = composer.newScene() local options ={ effect = "fade", time=200 } --------------------------------------------------------------------------------- -- All code outside of the listener functions will only be executed ONCE -- unless "composer.removeScene()" is called. --------------------------------------------------------------------------------- -- local forward references should go here --------------------------------------------------------------------------------- -- "scene:create()" function scene:create( event ) local sceneGroup = self.view -- Initialize the scene here. -- Example: add display objects to "sceneGroup", add touch listeners, etc. -- Create the widget ----------------------------background-------------------------------- local bg=display.newImage("tittle.png") bg.x= display.contentWidth/2 bg.y= display.contentHeight/2 bg:scale(.50,.60) local myText = display.newText("Rock-Paper-Scissor", display.contentCenterX, display.contentCenterY-200, native.systemFont, 25) myText:setFillColor(1,1,0) local myText1 = display.newText("Venika Gaur", display.contentCenterX, display.contentCenterY-150, native.systemFont, 25) myText:setFillColor(1,1,0) local startBtn= display.newImage("Startbutton.png") startBtn.x=display.contentCenterX-70 startBtn.y=display.contentCenterY+150 startBtn:scale(.15,.15) local function button1(event) -- composer.removeScene( "Start" ) audio.pause(startsound); composer.gotoScene( "Enemy1" , options ) end startBtn:addEventListener("tap", button1 ) local setBtn= display.newImage("Setbutton.png") setBtn.x=display.contentCenterX+62 setBtn.y=display.contentCenterY+150 setBtn:scale(.14,.13) local function button2(event) composer.gotoScene( "Settings" , options ) end setBtn:addEventListener("tap", button2 ) sceneGroup:insert(bg) sceneGroup:insert(myText1) sceneGroup:insert(myText) sceneGroup:insert(startBtn) sceneGroup:insert(setBtn) end -- "scene:show()" function scene:show( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then -- Called when the scene is still off screen (but is about to come on screen). elseif ( phase == "did" ) then -- Called when the scene is now on screen. -- Insert code here to make the scene come alive. -- Example: start timers, begin animation, play audio, etc. local startsound = audio.loadSound("Startmusic.mp3") audio.play(startsound); end end -- "scene:hide()" function scene:hide( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then -- Called when the scene is on screen (but is about to go off screen). -- Insert code here to "pause" the scene. -- Example: stop timers, stop animation, stop audio, etc. elseif ( phase == "did" ) then -- Called immediately after scene goes off screen. end end -- "scene:destroy()" function scene:destroy( event ) local sceneGroup = self.view -- Called prior to the removal of scene's view ("sceneGroup"). -- Insert code here to clean up the scene. -- Example: remove display objects, save state, etc. end --------------------------------------------------------------------------------- -- Listener setup scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) --------------------------------------------------------------------------------- return scene
28.355556
131
0.581766
482be608d7ef77c8ddd26147e598dc2b6acbbd70
6,509
swift
Swift
Sources/base85/Z85DataExtension.swift
batonPiotr/base85
da02ff72944e049895bd09922158cfd89206bf5d
[ "MIT" ]
null
null
null
Sources/base85/Z85DataExtension.swift
batonPiotr/base85
da02ff72944e049895bd09922158cfd89206bf5d
[ "MIT" ]
null
null
null
Sources/base85/Z85DataExtension.swift
batonPiotr/base85
da02ff72944e049895bd09922158cfd89206bf5d
[ "MIT" ]
null
null
null
// // Z85DataExtension.swift // // Copyright (c) 2021 Paweł Sulik // import Foundation let encodeZSetString = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&<>()[]{}@%$#" let encodeZSet = encodeZSetString.data(using: .utf8)!._bytes let decodeZSet: [UInt8] = [0x00, 0x44, 0x00, 0x54, 0x53, 0x52, 0x48, 0x00, //0-7 0x4B, 0x4C, 0x46, 0x41, 0x00, 0x3F, 0x3E, 0x45, //8-15 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, //16-23 0x08, 0x09, 0x40, 0x00, 0x49, 0x42, 0x4A, 0x47, //24-31 0x51, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, //32-39 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, //40-47 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, //48-63 0x3B, 0x3C, 0x3D, 0x4D, 0x00, 0x4E, 0x43, 0x00, //64-71 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, //72-79 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, //80-87 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, //88-95 0x21, 0x22, 0x23, 0x4F, 0x00, 0x50, 0x00, 0x00] //96-103 extension Data { private func pow85(_ num: Int) -> UInt32 { return UInt32(pow(Double(85), Double(num))) } public var z85Encoded: String { let pow85_1 = pow85(1) let pow85_2 = pow85(2) let pow85_3 = pow85(3) let pow85_4 = pow85(4) let inputData = self var buffer = inputData var encodedData = Data() while(buffer.count > 0) { var bytes = Data(buffer.prefix(4)) buffer.removeFirst(bytes.count) let bytesCountBeforeAppend = bytes.count while bytes.count < 4 { bytes.append(UInt8(0)) } let x = bytesToInt32(bytes: bytes._bytes) let N0 = UInt8((x/pow85_4) % 85) let N1 = UInt8((x/pow85_3) % 85) let N2 = UInt8((x/pow85_2) % 85) let N3 = UInt8((x/pow85_1) % 85) let N4 = UInt8(x % 85) let C0 = encodeZSet[Int(N0)] let C1 = encodeZSet[Int(N1)] let C2 = encodeZSet[Int(N2)] let C3 = encodeZSet[Int(N3)] let C4 = encodeZSet[Int(N4)] switch bytesCountBeforeAppend { case 1: encodedData.append(Data([C0, C1])) case 2: encodedData.append(Data([C0, C1, C2])) case 3: encodedData.append(Data([C0, C1, C2, C3])) default: encodedData.append(Data([C0, C1, C2, C3, C4])) } } return String(data: encodedData, encoding: .utf8)! } private func bytesToInt32(bytes: [UInt8]) -> UInt32 { let bigEndianValue = bytes.withUnsafeBufferPointer { ($0.baseAddress!.withMemoryRebound(to: UInt32.self, capacity: 1) { $0 }) }.pointee let value = UInt32(bigEndian: bigEndianValue) return value } public init?(z85EncodedString: String) { self.init() let pow85_1 = UInt64(pow85(1)) let pow85_2 = UInt64(pow85(2)) let pow85_3 = UInt64(pow85(3)) let pow85_4 = UInt64(pow85(4)) var buffer = z85EncodedString.data(using: .utf8)! var decodedData = Data() while buffer.count > 0 { var bytes = Array(buffer.prefix(5)._bytes) let bytesUnpaddedSize = bytes.count buffer.removeFirst(bytesUnpaddedSize) //Padding while bytes.count < 5 { // bytes.append(UInt8(68 + (5 - bytes.count - 1))) bytes.append(32) } var int: UInt64 = 0 int += UInt64(decodeZSet[Int(bytes[0] - 32)]) * pow85_4 if bytes.count > 1 { int += UInt64(decodeZSet[Int(bytes[1] - 32)]) * pow85_3 } if bytes.count > 2 { int += UInt64(decodeZSet[Int(bytes[2] - 32)]) * pow85_2 } if bytes.count > 3 { int += UInt64(decodeZSet[Int(bytes[3] - 32)]) * pow85_1 } if bytes.count > 4 { int += UInt64(decodeZSet[Int(bytes[4] - 32)]) } let intBytes = Swift.withUnsafeBytes(of: int) { (pointer) in Array<UInt8>(Data(pointer).reversed()) } let extractedIntBytes = intBytes.suffix(4) var selectedData: Data //Check overflow if !intBytes.prefix(4).allSatisfy({ $0 == 0}) { print("Overflow! \(intBytes._toHexString())") } if bytesUnpaddedSize == 1 { selectedData = Data(extractedIntBytes).prefix(0) } else if bytesUnpaddedSize == 2 { selectedData = Data(extractedIntBytes).prefix(1) } else if bytesUnpaddedSize == 3 { selectedData = Data(extractedIntBytes).prefix(2) } else if bytesUnpaddedSize == 4 { selectedData = Data(extractedIntBytes).prefix(3) } else { selectedData = Data(extractedIntBytes).prefix(4) } if bytesUnpaddedSize != 5 { //If the previous byte was larger than 170, increase the last byte of the selected data if Array(extractedIntBytes)[selectedData._bytes.count] > 170 { selectedData.increaseLastByte() } } decodedData.append(selectedData) } self.append(decodedData) } private func charLookUp(charASCIIValue: UInt8) -> UInt8 { let charString = String(data: Data([charASCIIValue]), encoding: .utf8)! let char = Character(charString) if let index = encodeZSetString.firstIndex(of: char) { let distance = Int(encodeZSetString.distance(from: encodeZSetString.startIndex, to: index)) return decodeZSet[distance] } return 0 } } private extension Data { mutating func increaseLastByte() { if let lastByte = self.last { _ = self.popLast() if lastByte == 255 { increaseLastByte() self.append(0x00) } else { self.append(lastByte + 1) } } } }
36.567416
110
0.514211
ae5568f97858db34d551a260f52a507d47adafe3
964
rs
Rust
src/utils.rs
EngineOrion/container
03bdd229cdf4ac25238314c4b60586d28c33c38e
[ "MIT" ]
null
null
null
src/utils.rs
EngineOrion/container
03bdd229cdf4ac25238314c4b60586d28c33c38e
[ "MIT" ]
null
null
null
src/utils.rs
EngineOrion/container
03bdd229cdf4ac25238314c4b60586d28c33c38e
[ "MIT" ]
null
null
null
pub fn print_startup() { println!( " +-------------+ | Container | | v{} | +-------------+ ", env!("CARGO_PKG_VERSION") ); } pub fn print_help() { println!( r#"Usage: ./container [options] start start the application help print this help text repl start the REPL to configure the application"# ); } pub fn print_repl_help() { println!( r#" REPL HELP: start Start the main application. get [option] Get status of something printed. Supported is: config '-> Get status of config printed. fetch [option] Import a file. Supported is: config '-> Import the config. inform [variable] Get information about a variable from the config. eval (defun) [code] Eval a function with defun parameter. Else eval a built in expression. exit Exit the application. "# ); }
25.368421
72
0.54668
0ee7bbe208de0572d68d8446c71af88c59892168
2,202
h
C
caffe2/operators/rnn/recurrent_network_executor_incl.h
Hacky-DH/pytorch
80dc4be615854570aa39a7e36495897d8a040ecc
[ "Intel" ]
60,067
2017-01-18T17:21:31.000Z
2022-03-31T21:37:45.000Z
caffe2/operators/rnn/recurrent_network_executor_incl.h
Hacky-DH/pytorch
80dc4be615854570aa39a7e36495897d8a040ecc
[ "Intel" ]
66,955
2017-01-18T17:21:38.000Z
2022-03-31T23:56:11.000Z
caffe2/operators/rnn/recurrent_network_executor_incl.h
Hacky-DH/pytorch
80dc4be615854570aa39a7e36495897d8a040ecc
[ "Intel" ]
19,210
2017-01-18T17:45:04.000Z
2022-03-31T23:51:56.000Z
#ifndef CAFFE2_OPERATORS_RECURRENT_NETWORK_EXECUTOR_INCL_H_ #define CAFFE2_OPERATORS_RECURRENT_NETWORK_EXECUTOR_INCL_H_ #include <vector> #include "caffe2/core/operator.h" namespace caffe2 { /** * Struct for operator in a timestep and its dependencies. */ struct RNNNetOperator { int order; // Position in the step net (i.e nth operator) std::shared_ptr<OperatorBase> op = nullptr; bool link_op; // Special flag for link op, see RNNApplyLinkOp. // Bookkeeping, used by ThreadedRecurrentNetworkExecutor int num_dynamic_inputs = 0; int num_recurrent_inputs = 0; std::atomic<int> proc_inputs; // Dependencies to other ops. If dependency index < order, it is // a recurrent dependency (i.e to the next timestep) std::vector<int> dependencies; std::vector<int> parents; bool frontier = true; // For ops that are launched first bool has_timestep_blob = false; explicit RNNNetOperator(const OperatorDef& def, int order) : order(order) { proc_inputs = 0; link_op = def.type() == "rnn_internal_apply_link"; } RNNNetOperator(const RNNNetOperator& x) { order = x.order; op = x.op; link_op = x.link_op; num_dynamic_inputs = x.num_dynamic_inputs; num_recurrent_inputs = x.num_recurrent_inputs; proc_inputs = 0; dependencies = x.dependencies; parents = x.parents; frontier = x.frontier; } }; /** * Data structure for a scheduled task in the task queue. */ struct OpTask { int timestep; int op_idx; // matches RNNNetOperator.order int T; // number of timesteps in this execution int direction; // +1 for forward, -1 for backward pass int stream_id = -1; // only used by gpu version // NOLINTNEXTLINE(clang-analyzer-optin.cplusplus.UninitializedObject) OpTask() {} OpTask(int _timestep, int _op_idx, int _T, int _direction) : timestep(_timestep), op_idx(_op_idx), T(_T), direction(_direction) { CAFFE_ENFORCE(direction == 1 || direction == -1); CAFFE_ENFORCE(timestep >= 0 && timestep < _T); } inline bool backward() { return direction == -1; } inline bool forward() { return direction == 1; } }; } // namespace caffe2 #endif // CAFFE2_OPERATORS_RECURRENT_NETWORK_EXECUTOR_H_
28.973684
77
0.710718
0ede532d334b047caf44b4d337da2bae55e1efc4
9,310
h
C
libs/lua54/lauxlib.h
antisvin/er-301
54d1e553651b5b653afa318189d813f0b7e12a96
[ "MIT" ]
102
2021-03-01T10:39:56.000Z
2022-03-31T00:28:15.000Z
libs/lua54/lauxlib.h
antisvin/er-301
54d1e553651b5b653afa318189d813f0b7e12a96
[ "MIT" ]
62
2021-03-01T19:38:54.000Z
2022-03-21T00:51:24.000Z
libs/lua54/lauxlib.h
antisvin/er-301
54d1e553651b5b653afa318189d813f0b7e12a96
[ "MIT" ]
19
2021-03-01T19:52:10.000Z
2021-07-29T03:25:19.000Z
/* ** $Id: lauxlib.h $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ #ifndef lauxlib_h #define lauxlib_h #include <stddef.h> #include <stdio.h> #include "lua.h" /* global table */ #define LUA_GNAME "_G" typedef struct luaL_Buffer luaL_Buffer; /* extra error code for 'luaL_loadfilex' */ #define LUA_ERRFILE (LUA_ERRERR + 1) /* key, in the registry, for table of loaded modules */ #define LUA_LOADED_TABLE "_LOADED" /* key, in the registry, for table of preloaded loaders */ #define LUA_PRELOAD_TABLE "_PRELOAD" typedef struct luaL_Reg { const char *name; lua_CFunction func; } luaL_Reg; #define LUAL_NUMSIZES (sizeof(lua_Integer) * 16 + sizeof(lua_Number)) LUALIB_API void(luaL_checkversion_)(lua_State *L, lua_Number ver, size_t sz); #define luaL_checkversion(L) \ luaL_checkversion_(L, LUA_VERSION_NUM, LUAL_NUMSIZES) LUALIB_API int(luaL_getmetafield)(lua_State *L, int obj, const char *e); LUALIB_API int(luaL_callmeta)(lua_State *L, int obj, const char *e); LUALIB_API const char *(luaL_tolstring)(lua_State *L, int idx, size_t *len); LUALIB_API int(luaL_argerror)(lua_State *L, int arg, const char *extramsg); LUALIB_API int(luaL_typeerror)(lua_State *L, int arg, const char *tname); LUALIB_API const char *(luaL_checklstring)(lua_State *L, int arg, size_t *l); LUALIB_API const char *(luaL_optlstring)(lua_State *L, int arg, const char *def, size_t *l); LUALIB_API lua_Number(luaL_checknumber)(lua_State *L, int arg); LUALIB_API lua_Number(luaL_optnumber)(lua_State *L, int arg, lua_Number def); LUALIB_API lua_Integer(luaL_checkinteger)(lua_State *L, int arg); LUALIB_API lua_Integer(luaL_optinteger)(lua_State *L, int arg, lua_Integer def); LUALIB_API void(luaL_checkstack)(lua_State *L, int sz, const char *msg); LUALIB_API void(luaL_checktype)(lua_State *L, int arg, int t); LUALIB_API void(luaL_checkany)(lua_State *L, int arg); LUALIB_API int(luaL_newmetatable)(lua_State *L, const char *tname); LUALIB_API void(luaL_setmetatable)(lua_State *L, const char *tname); LUALIB_API void *(luaL_testudata)(lua_State *L, int ud, const char *tname); LUALIB_API void *(luaL_checkudata)(lua_State *L, int ud, const char *tname); LUALIB_API void(luaL_where)(lua_State *L, int lvl); LUALIB_API int(luaL_error)(lua_State *L, const char *fmt, ...); LUALIB_API int(luaL_checkoption)(lua_State *L, int arg, const char *def, const char *const lst[]); LUALIB_API int(luaL_fileresult)(lua_State *L, int stat, const char *fname); LUALIB_API int(luaL_execresult)(lua_State *L, int stat); /* predefined references */ #define LUA_NOREF (-2) #define LUA_REFNIL (-1) LUALIB_API int(luaL_ref)(lua_State *L, int t); LUALIB_API void(luaL_unref)(lua_State *L, int t, int ref); LUALIB_API int(luaL_loadfilex)(lua_State *L, const char *filename, const char *mode); #define luaL_loadfile(L, f) luaL_loadfilex(L, f, NULL) LUALIB_API int(luaL_loadbufferx)(lua_State *L, const char *buff, size_t sz, const char *name, const char *mode); LUALIB_API int(luaL_loadstring)(lua_State *L, const char *s); LUALIB_API lua_State *(luaL_newstate)(void); LUALIB_API lua_Integer(luaL_len)(lua_State *L, int idx); LUALIB_API void luaL_addgsub(luaL_Buffer *b, const char *s, const char *p, const char *r); LUALIB_API const char *(luaL_gsub)(lua_State *L, const char *s, const char *p, const char *r); LUALIB_API void(luaL_setfuncs)(lua_State *L, const luaL_Reg *l, int nup); LUALIB_API int(luaL_getsubtable)(lua_State *L, int idx, const char *fname); LUALIB_API void(luaL_traceback)(lua_State *L, lua_State *L1, const char *msg, int level); LUALIB_API void(luaL_requiref)(lua_State *L, const char *modname, lua_CFunction openf, int glb); /* ** =============================================================== ** some useful macros ** =============================================================== */ #define luaL_newlibtable(L, l) \ lua_createtable(L, 0, sizeof(l) / sizeof((l)[0]) - 1) #define luaL_newlib(L, l) \ (luaL_checkversion(L), luaL_newlibtable(L, l), luaL_setfuncs(L, l, 0)) #define luaL_argcheck(L, cond, arg, extramsg) \ ((void)((cond) || luaL_argerror(L, (arg), (extramsg)))) #define luaL_argexpected(L, cond, arg, tname) \ ((void)((cond) || luaL_typeerror(L, (arg), (tname)))) #define luaL_checkstring(L, n) (luaL_checklstring(L, (n), NULL)) #define luaL_optstring(L, n, d) (luaL_optlstring(L, (n), (d), NULL)) #define luaL_typename(L, i) lua_typename(L, lua_type(L, (i))) #define luaL_dofile(L, fn) \ (luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0)) #define luaL_dostring(L, s) \ (luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0)) #define luaL_getmetatable(L, n) (lua_getfield(L, LUA_REGISTRYINDEX, (n))) #define luaL_opt(L, f, n, d) (lua_isnoneornil(L, (n)) ? (d) : f(L, (n))) #define luaL_loadbuffer(L, s, sz, n) luaL_loadbufferx(L, s, sz, n, NULL) /* push the value used to represent failure/error */ #define luaL_pushfail(L) lua_pushnil(L) /* ** {====================================================== ** Generic Buffer manipulation ** ======================================================= */ struct luaL_Buffer { char *b; /* buffer address */ size_t size; /* buffer size */ size_t n; /* number of characters in buffer */ lua_State *L; union { LUAI_MAXALIGN; /* ensure maximum alignment for buffer */ char b[LUAL_BUFFERSIZE]; /* initial buffer */ } init; }; #define luaL_bufflen(bf) ((bf)->n) #define luaL_buffaddr(bf) ((bf)->b) #define luaL_addchar(B, c) \ ((void)((B)->n < (B)->size || luaL_prepbuffsize((B), 1)), \ ((B)->b[(B)->n++] = (c))) #define luaL_addsize(B, s) ((B)->n += (s)) #define luaL_buffsub(B, s) ((B)->n -= (s)) LUALIB_API void(luaL_buffinit)(lua_State *L, luaL_Buffer *B); LUALIB_API char *(luaL_prepbuffsize)(luaL_Buffer *B, size_t sz); LUALIB_API void(luaL_addlstring)(luaL_Buffer *B, const char *s, size_t l); LUALIB_API void(luaL_addstring)(luaL_Buffer *B, const char *s); LUALIB_API void(luaL_addvalue)(luaL_Buffer *B); LUALIB_API void(luaL_pushresult)(luaL_Buffer *B); LUALIB_API void(luaL_pushresultsize)(luaL_Buffer *B, size_t sz); LUALIB_API char *(luaL_buffinitsize)(lua_State *L, luaL_Buffer *B, size_t sz); #define luaL_prepbuffer(B) luaL_prepbuffsize(B, LUAL_BUFFERSIZE) /* }====================================================== */ /* ** {====================================================== ** File handles for IO library ** ======================================================= */ /* ** A file handle is a userdata with metatable 'LUA_FILEHANDLE' and ** initial structure 'luaL_Stream' (it may contain other fields ** after that initial structure). */ #define LUA_FILEHANDLE "FILE*" typedef struct luaL_Stream { FILE *f; /* stream (NULL for incompletely created streams) */ lua_CFunction closef; /* to close stream (NULL for closed streams) */ } luaL_Stream; /* }====================================================== */ /* ** {================================================================== ** "Abstraction Layer" for basic report of messages and errors ** =================================================================== */ typedef void (*writestring_t)(const char *buffer, size_t sz); LUALIB_API void luaL_set_writestring_function(writestring_t f); LUALIB_API void luaL_writestring(const char *buffer, size_t sz); typedef void (*writestringerror_t)(const char *s1, const char *s2); LUALIB_API void luaL_set_writestringerror_function(writestringerror_t f); LUALIB_API void luaL_writestringerror(const char *s1, const char *s2); /* print a string */ #if !defined(lua_writestring) /* #define lua_writestring(s,l) fwrite((s), sizeof(char), (l), stdout) */ #define lua_writestring(s, l) luaL_writestring(s, l) #endif /* print a newline and flush the output */ #if !defined(lua_writeline) #define lua_writeline() (lua_writestring("\n", 1), fflush(stdout)) #endif /* print an error message */ #if !defined(lua_writestringerror) /* #define lua_writestringerror(s,p) \ (fprintf(stderr, (s), (p)), fflush(stderr)) */ #define lua_writestringerror(s, p) luaL_writestringerror(s, p) #endif /* }================================================================== */ /* ** {============================================================ ** Compatibility with deprecated conversions ** ============================================================= */ #if defined(LUA_COMPAT_APIINTCASTS) #define luaL_checkunsigned(L, a) ((lua_Unsigned)luaL_checkinteger(L, a)) #define luaL_optunsigned(L, a, d) \ ((lua_Unsigned)luaL_optinteger(L, a, (lua_Integer)(d))) #define luaL_checkint(L, n) ((int)luaL_checkinteger(L, (n))) #define luaL_optint(L, n, d) ((int)luaL_optinteger(L, (n), (d))) #define luaL_checklong(L, n) ((long)luaL_checkinteger(L, (n))) #define luaL_optlong(L, n, d) ((long)luaL_optinteger(L, (n), (d))) #endif /* }============================================================ */ #endif
34.227941
78
0.623308
78060e37417c3c363bf6675c221a8768171bb744
648
asm
Assembly
oeis/315/A315259.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/315/A315259.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/315/A315259.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A315259: Coordination sequence Gal.4.54.3 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; Submitted by Christian Krause ; 1,6,10,15,20,25,30,34,40,46,50,55,60,65,70,74,80,86,90,95,100,105,110,114,120,126,130,135,140,145,150,154,160,166,170,175,180,185,190,194,200,206,210,215,220,225,230,234,240,246 mov $1,$0 seq $1,310458 ; Coordination sequence Gal.4.78.1 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. mov $2,$0 mul $0,7 sub $0,1 mod $0,$1 mul $2,3 add $0,$2 add $0,1
46.285714
181
0.733025
a1a3163dc52d3c00b246c4a34699719ff21b90ea
927
go
Go
server/mq2db/dbmiddleware.go
yr-github/gin-vue-admin-test
02e0c26d9c5551ffed1fabc02910f0fee73a8b5f
[ "MIT" ]
null
null
null
server/mq2db/dbmiddleware.go
yr-github/gin-vue-admin-test
02e0c26d9c5551ffed1fabc02910f0fee73a8b5f
[ "MIT" ]
null
null
null
server/mq2db/dbmiddleware.go
yr-github/gin-vue-admin-test
02e0c26d9c5551ffed1fabc02910f0fee73a8b5f
[ "MIT" ]
null
null
null
package mq2db import ( "gin-vue-admin/global" "gin-vue-admin/service" "reflect" ) func resetstr(str string) (string, string) { return str, "CreateMyTaskFromMq" } // MqToDbMiddleware //从mq读取数据,根据数据获取执行函数名,利用反射执行该函数 //并且可以执行多个协程来处理 MQTODB func MqToDbMiddleware() { go func() { for data := range global.MQTODB { value, method := resetstr(data) t := reflect.ValueOf(service.MytaskReflect{}) m := t.MethodByName(method) args := []reflect.Value{reflect.ValueOf(value)} go m.Call(args) //if err[0].IsNil() { // //不应该在这里塞入,应该在db操作塞入 // //global.DBTOREDIS<-value // global.GVA_LOG.Info(method+" 执行成功") //}else { // //TODO error 此处当传入错误参数到数据库后,此处只能触发一次 // //猜测是因为使用range此channel,那么在这里就不能重新给channel传值 // //而且好像global.MQTODB <- data导致了channel异常错误,此处只能在数据库那里做插入异常处理了 // //println(len(global.MQTODB)) // global.GVA_LOG.Error("") // //以下错误代码 // //global.MQTODB <- data } }() }
23.769231
66
0.668824
421f4b30b5a39fa6bffdc3f1f47c204c83751e9d
2,756
sql
SQL
package/iceip.sql
iceroot/iceip
fdd1e42de3a01a41b2867d52440875e780c86404
[ "Apache-2.0" ]
null
null
null
package/iceip.sql
iceroot/iceip
fdd1e42de3a01a41b2867d52440875e780c86404
[ "Apache-2.0" ]
null
null
null
package/iceip.sql
iceroot/iceip
fdd1e42de3a01a41b2867d52440875e780c86404
[ "Apache-2.0" ]
null
null
null
# Host: 127.0.0.1 (Version: 5.5.53) # Date: 2018-02-05 16:48:13 # Generator: MySQL-Front 5.3 (Build 4.234) /*!40101 SET NAMES utf8 */; # # Structure for table "iceip" # DROP TABLE IF EXISTS `iceip`; CREATE TABLE `iceip` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `hostname` varchar(50) DEFAULT NULL COMMENT 'hostname', `ip` varchar(50) DEFAULT NULL COMMENT 'ip', `groupx` int(11) DEFAULT NULL COMMENT '分组', `client_time` varchar(50) DEFAULT NULL COMMENT '客户端时间', `server_time` varchar(50) DEFAULT NULL COMMENT '服务端时间', `username` varchar(50) DEFAULT NULL COMMENT '用户名', `password` varchar(64) DEFAULT NULL COMMENT '密码', `client_ip` varchar(50) DEFAULT NULL COMMENT '客户端ip', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=1018 DEFAULT CHARSET=utf8; # # Data for table "iceip" # /*!40000 ALTER TABLE `iceip` DISABLE KEYS */; INSERT INTO `iceip` VALUES (1001,'localhost','127.0.0.1',0,NULL,NULL,NULL,NULL,NULL),(1002,'localhost','127.0.0.1',0,NULL,NULL,NULL,NULL,NULL),(1003,'localhost','127.0.0.1',0,'2010-12-23 13:46:57','2018-02-03 20:18:45',NULL,NULL,NULL),(1004,'localhost','127.0.0.1',0,'2010-12-23 13:46:57','2018-02-03 20:20:50','username','password','clientIp'),(1005,'hostname','192.168.123.122',1,'2018-02-03 20:43:09','2018-02-03 20:44:32','username','password','127.0.0.1'),(1006,'hostname','192.168.123.123',1,'2018-02-03 20:43:09','2018-02-03 20:46:36','username','password','127.0.0.1'),(1008,'hostname','192.168.111.111',-1,'2018-02-03 20:43:09','2018-02-03 20:52:35',NULL,NULL,'127.0.0.1'),(1009,'node1','192.168.1.101',1,'2018-02-04 20:39:23','2018-02-04 20:39:23','zs','testpwd','127.0.0.1'),(1010,'node2','192.168.2.102',1,'2018-02-04 20:38:13','2018-02-04 20:38:13','zs','testpwd','127.0.0.1'),(1011,'node3','192.168.1.103',1,'2018-02-04 20:35:39','2018-02-04 20:35:39','zs','testpwd','127.0.0.1'),(1012,'node4','192.168.1.104',1,'2018-02-04 20:41:29','2018-02-04 20:41:29','zs','testpwd','127.0.0.1'),(1013,'node5','192.168.1.105',1,'2018-02-04 21:00:56','2018-02-04 21:00:56','zs','testpwd','127.0.0.1'),(1014,'node6','192.168.1.106',1,'2018-02-04 21:02:13','2018-02-04 21:02:13','zs','testpwd','127.0.0.1'),(1015,'node7','192.168.1.107',1,'2018-02-04 21:04:20','2018-02-04 21:04:21','zs','testpwd','127.0.0.1'),(1016,'node8','192.168.1.108',1,'2018-02-04 21:09:16','2018-02-04 21:09:17','zs','testpwd','127.0.0.1'),(1017,'node1','192.168.3.102',1,'2018-02-04 21:23:01','2018-02-04 21:23:02','zs','testpwd','127.0.0.1'),(1018,'node1','192.168.5.102',1,'2018-02-05 16:36:19','2018-02-05 16:36:19','zs','testpwd','127.0.0.1'),(1019,'node1','192.168.1.102',1,'2018-02-05 16:37:11','2018-02-05 16:37:11','zs','testpwd','127.0.0.1'); /*!40000 ALTER TABLE `iceip` ENABLE KEYS */;
86.125
1,827
0.642598
390fd99b604368cc27ab9b61c1ea7c8865c3803d
13,917
swift
Swift
ios-template/App/App/Common/TouchableView.swift
lambdacollective/capacitor
b57dd1d73138248c3d69999942fdc96a1a503d5c
[ "MIT" ]
null
null
null
ios-template/App/App/Common/TouchableView.swift
lambdacollective/capacitor
b57dd1d73138248c3d69999942fdc96a1a503d5c
[ "MIT" ]
null
null
null
ios-template/App/App/Common/TouchableView.swift
lambdacollective/capacitor
b57dd1d73138248c3d69999942fdc96a1a503d5c
[ "MIT" ]
null
null
null
// // TouchableView.swift // tesseract_prototype // // Created by Jun Ho Hong on 7/11/19. // Copyright © 2019 Tesseract. All rights reserved. // import Foundation import UIKit protocol TouchableView { var tapGesture: UITapGestureRecognizer? { get set } var selectBlock: (() -> Void)? { get set } } class TouchableNonOpacityView: UIView, TouchableView { var tapGesture: UITapGestureRecognizer? var selectBlock: (() -> Void)? { didSet { guard self.tapGesture == nil else { return } let tapGesture = UITapGestureRecognizer(target: self, action: #selector(pressed)) self.addGestureRecognizer(tapGesture) self.tapGesture = tapGesture } } @objc func pressed() { self.selectBlock?() } } class TouchableOpacityView: UIView, TouchableView { var tapGesture: UITapGestureRecognizer? var selectBlock: (() -> Void)? { didSet { guard self.tapGesture == nil else { return } let tapGesture = UITapGestureRecognizer(target: self, action: #selector(pressed)) self.addGestureRecognizer(tapGesture) self.tapGesture = tapGesture } } @objc func pressed() { self.selectBlock?() } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesBegan(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 0.5 }, completion: nil) } override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesEnded(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 1 }, completion: nil) } override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesCancelled(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 1 }, completion: nil) } } class TouchableBounceView: UIView, TouchableView { var tapGesture: UITapGestureRecognizer? var selectBlock: (() -> Void)? { didSet { guard self.tapGesture == nil else { return } let tapGesture = UITapGestureRecognizer(target: self, action: #selector(pressed)) self.addGestureRecognizer(tapGesture) self.tapGesture = tapGesture } } @objc func pressed() { self.selectBlock?() } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesBegan(touches, with: event) UIView.animate(withDuration: 0.22, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 0.9 self.transform = CGAffineTransform(scaleX: 0.95, y: 0.95) }, completion: nil) } override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesEnded(touches, with: event) UIView.animate(withDuration: 0.22, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 1 self.transform = CGAffineTransform.identity }, completion: nil) } override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesCancelled(touches, with: event) UIView.animate(withDuration: 0.22, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 1 self.transform = CGAffineTransform.identity }, completion: nil) } } class TouchableOpacityImageView: UIImageView, TouchableView { var tapGesture: UITapGestureRecognizer? var selectBlock: (() -> Void)? { didSet { guard self.tapGesture == nil else { return } let tapGesture = UITapGestureRecognizer(target: self, action: #selector(pressed)) self.addGestureRecognizer(tapGesture) self.tapGesture = tapGesture } } @objc func pressed() { self.selectBlock?() } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesBegan(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 0.5 }, completion: nil) } override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesEnded(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 1 }, completion: nil) } override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesCancelled(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 1 }, completion: nil) } } class TouchableNonOpacityImageView: UIImageView, TouchableView { var tapGesture: UITapGestureRecognizer? var selectBlock: (() -> Void)? { didSet { guard self.tapGesture == nil else { return } let tapGesture = UITapGestureRecognizer(target: self, action: #selector(pressed)) self.addGestureRecognizer(tapGesture) self.tapGesture = tapGesture } } @objc func pressed() { self.selectBlock?() } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesBegan(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 0.5 }, completion: nil) } override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesEnded(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 1 }, completion: nil) } override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesCancelled(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 1 }, completion: nil) } } class TouchableBounceImageView: UIImageView, TouchableView { var tapGesture: UITapGestureRecognizer? var selectBlock: (() -> Void)? { didSet { guard self.tapGesture == nil else { return } let tapGesture = UITapGestureRecognizer(target: self, action: #selector(pressed)) self.addGestureRecognizer(tapGesture) self.tapGesture = tapGesture } } @objc func pressed() { self.selectBlock?() } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesBegan(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 0.8 self.transform = CGAffineTransform(scaleX: 0.95, y: 0.95) }, completion: nil) } override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesEnded(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 1 self.transform = CGAffineTransform.identity }, completion: nil) } override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesCancelled(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 1 self.transform = CGAffineTransform.identity }, completion: nil) } } class TouchableOpacityCollectionViewCell: UICollectionViewCell, TouchableView { var tapGesture: UITapGestureRecognizer? var selectBlock: (() -> Void)? { didSet { guard self.tapGesture == nil else { return } let tapGesture = UITapGestureRecognizer(target: self, action: #selector(pressed)) self.addGestureRecognizer(tapGesture) self.tapGesture = tapGesture } } @objc func pressed() { self.selectBlock?() } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesBegan(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 0.5 }, completion: nil) } override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesEnded(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 1 }, completion: nil) } override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesCancelled(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 1 }, completion: nil) } } class TouchableOpacityTableViewCell: UITableViewCell, TouchableView { var tapGesture: UITapGestureRecognizer? var selectBlock: (() -> Void)? { didSet { guard self.tapGesture == nil else { return } let tapGesture = UITapGestureRecognizer(target: self, action: #selector(pressed)) self.addGestureRecognizer(tapGesture) self.tapGesture = tapGesture } } @objc func pressed() { self.selectBlock?() } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesBegan(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 0.5 }, completion: nil) } override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesEnded(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 1 }, completion: nil) } override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesCancelled(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 1 }, completion: nil) } } class TouchableBounceCollectionViewCell: UICollectionViewCell, TouchableView { var tapGesture: UITapGestureRecognizer? var bounceView: UIView? var selectBlock: (() -> Void)? { didSet { guard self.tapGesture == nil else { return } let tapGesture = UITapGestureRecognizer(target: self, action: #selector(pressed)) self.addGestureRecognizer(tapGesture) self.tapGesture = tapGesture } } @objc func pressed() { self.selectBlock?() } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesBegan(touches, with: event) UIView.animate(withDuration: 0.22, delay: 0, options: [.allowUserInteraction], animations: { self.bounceView?.alpha = 0.9 self.bounceView?.transform = CGAffineTransform(scaleX: 0.95, y: 0.95) }, completion: nil) } override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesEnded(touches, with: event) UIView.animate(withDuration: 0.22, delay: 0, options: [.allowUserInteraction], animations: { self.bounceView?.alpha = 1 self.bounceView?.transform = CGAffineTransform.identity }, completion: nil) } override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesCancelled(touches, with: event) UIView.animate(withDuration: 0.22, delay: 0, options: [.allowUserInteraction], animations: { self.bounceView?.alpha = 1 self.bounceView?.transform = CGAffineTransform.identity }, completion: nil) } } class TouchableOpacityLabel: UILabel, TouchableView { var tapGesture: UITapGestureRecognizer? var selectBlock: (() -> Void)? { didSet { guard self.tapGesture == nil else { return } let tapGesture = UITapGestureRecognizer(target: self, action: #selector(pressed)) self.addGestureRecognizer(tapGesture) self.tapGesture = tapGesture } } @objc func pressed() { self.selectBlock?() } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesBegan(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 0.5 }, completion: nil) } override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesEnded(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 1 }, completion: nil) } override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesCancelled(touches, with: event) UIView.animate(withDuration: 0.15, delay: 0, options: [.allowUserInteraction], animations: { self.alpha = 1 }, completion: nil) } }
37.310992
100
0.626931
81e5c2b5ee14583991d5ca3d546353396d552925
15,146
rs
Rust
src/command/test.rs
DebugSteven/wasm-pack
4cd77901c3e29087e22c22392d9d2cea26d00628
[ "Apache-2.0", "MIT" ]
null
null
null
src/command/test.rs
DebugSteven/wasm-pack
4cd77901c3e29087e22c22392d9d2cea26d00628
[ "Apache-2.0", "MIT" ]
null
null
null
src/command/test.rs
DebugSteven/wasm-pack
4cd77901c3e29087e22c22392d9d2cea26d00628
[ "Apache-2.0", "MIT" ]
null
null
null
//! Implementation of the `wasm-pack test` command. use super::build::BuildMode; use bindgen; use build; use command::utils::set_crate_path; use console::style; use emoji; use failure::Error; use indicatif::HumanDuration; use lockfile::Lockfile; use manifest; use progressbar::Step; use slog::Logger; use std::path::PathBuf; use std::time::Instant; use test::{self, webdriver}; use wasm_pack_binary_install::Cache; use PBAR; #[derive(Debug, Default, StructOpt)] /// Everything required to configure the `wasm-pack test` command. pub struct TestOptions { #[structopt(parse(from_os_str))] /// The path to the Rust crate. pub path: Option<PathBuf>, #[structopt(long = "node")] /// Run the tests in Node.js. pub node: bool, #[structopt(long = "firefox")] /// Run the tests in Firefox. This machine must have a Firefox installation. /// If the `geckodriver` WebDriver client is not on the `$PATH`, and not /// specified with `--geckodriver`, then `wasm-pack` will download a local /// copy. pub firefox: bool, #[structopt(long = "geckodriver", parse(from_os_str))] /// The path to the `geckodriver` WebDriver client for testing in /// Firefox. Implies `--firefox`. pub geckodriver: Option<PathBuf>, #[structopt(long = "chrome")] /// Run the tests in Chrome. This machine must have a Chrome installation. /// If the `chromedriver` WebDriver client is not on the `$PATH`, and not /// specified with `--chromedriver`, then `wasm-pack` will download a local /// copy. pub chrome: bool, #[structopt(long = "chromedriver", parse(from_os_str))] /// The path to the `chromedriver` WebDriver client for testing in /// Chrome. Implies `--chrome`. pub chromedriver: Option<PathBuf>, #[structopt(long = "safari")] /// Run the tests in Safari. This machine must have a Safari installation, /// and the `safaridriver` WebDriver client must either be on the `$PATH` or /// specified explicitly with the `--safaridriver` flag. `wasm-pack` cannot /// download the `safaridriver` WebDriver client for you. pub safari: bool, #[structopt(long = "safaridriver", parse(from_os_str))] /// The path to the `safaridriver` WebDriver client for testing in /// Safari. Implies `--safari`. pub safaridriver: Option<PathBuf>, #[structopt(long = "headless")] /// When running browser tests, run the browser in headless mode without any /// UI or windows. pub headless: bool, #[structopt(long = "mode", short = "m", default_value = "normal")] /// Sets steps to be run. [possible values: no-install, normal] pub mode: BuildMode, #[structopt(long = "release", short = "r")] /// Build with the release profile. pub release: bool, } /// A configured `wasm-pack test` command. pub struct Test { crate_path: PathBuf, crate_data: manifest::CrateData, cache: Cache, node: bool, mode: BuildMode, firefox: bool, geckodriver: Option<PathBuf>, chrome: bool, chromedriver: Option<PathBuf>, safari: bool, safaridriver: Option<PathBuf>, headless: bool, release: bool, test_runner_path: Option<PathBuf>, } type TestStep = fn(&mut Test, &Step, &Logger) -> Result<(), Error>; impl Test { /// Construct a test command from the given options. pub fn try_from_opts(test_opts: TestOptions) -> Result<Self, Error> { let TestOptions { path, node, mode, headless, release, chrome, chromedriver, firefox, geckodriver, safari, safaridriver, } = test_opts; let crate_path = set_crate_path(path)?; let crate_data = manifest::CrateData::new(&crate_path)?; let any_browser = chrome || firefox || safari; if !node && !any_browser { bail!("Must specify at least one of `--node`, `--chrome`, `--firefox`, or `--safari`") } if headless && !any_browser { bail!( "The `--headless` flag only applies to browser tests. Node does not provide a UI, \ so it doesn't make sense to talk about a headless version of Node tests." ) } Ok(Test { cache: Cache::new()?, crate_path, crate_data, node, mode, chrome, chromedriver, firefox, geckodriver, safari, safaridriver, headless, release, test_runner_path: None, }) } /// Configures the cache that this test command uses pub fn set_cache(&mut self, cache: Cache) { self.cache = cache; } /// Execute this test command. pub fn run(mut self, log: &Logger) -> Result<(), Error> { let process_steps = self.get_process_steps(); let mut step_counter = Step::new(process_steps.len()); let started = Instant::now(); for (_, process_step) in process_steps { process_step(&mut self, &step_counter, log)?; step_counter.inc(); } let duration = HumanDuration(started.elapsed()); info!(&log, "Done in {}.", &duration); Ok(()) } fn get_process_steps(&self) -> Vec<(&'static str, TestStep)> { macro_rules! steps { ($($name:ident $(if $e:expr)* ),+) => { { let mut steps: Vec<(&'static str, TestStep)> = Vec::new(); $( $(if $e)* { steps.push((stringify!($name), Test::$name)); } )* steps } }; ($($name:ident $(if $e:expr)* ,)*) => (steps![$($name $(if $e)* ),*]) } match self.mode { BuildMode::Normal => steps![ step_check_rustc_version, step_add_wasm_target, step_build_tests, step_install_wasm_bindgen, step_test_node if self.node, step_get_chromedriver if self.chrome && self.chromedriver.is_none(), step_test_chrome if self.chrome, step_get_geckodriver if self.firefox && self.geckodriver.is_none(), step_test_firefox if self.firefox, step_get_safaridriver if self.safari && self.safaridriver.is_none(), step_test_safari if self.safari, ], BuildMode::Force => steps![ step_add_wasm_target, step_build_tests, step_install_wasm_bindgen, step_test_node if self.node, step_get_chromedriver if self.chrome && self.chromedriver.is_none(), step_test_chrome if self.chrome, step_get_geckodriver if self.firefox && self.geckodriver.is_none(), step_test_firefox if self.firefox, step_get_safaridriver if self.safari && self.safaridriver.is_none(), step_test_safari if self.safari, ], BuildMode::Noinstall => steps![ step_build_tests, step_install_wasm_bindgen, step_test_node if self.node, step_get_chromedriver if self.chrome && self.chromedriver.is_none(), step_test_chrome if self.chrome, step_get_geckodriver if self.firefox && self.geckodriver.is_none(), step_test_firefox if self.firefox, step_get_safaridriver if self.safari && self.safaridriver.is_none(), step_test_safari if self.safari, ], } } fn step_check_rustc_version(&mut self, step: &Step, log: &Logger) -> Result<(), Error> { info!(log, "Checking rustc version..."); let _ = build::check_rustc_version(step)?; info!(log, "Rustc version is correct."); Ok(()) } fn step_add_wasm_target(&mut self, step: &Step, log: &Logger) -> Result<(), Error> { info!(&log, "Adding wasm-target..."); build::rustup_add_wasm_target(log, step)?; info!(&log, "Adding wasm-target was successful."); Ok(()) } fn step_build_tests(&mut self, step: &Step, log: &Logger) -> Result<(), Error> { info!(log, "Compiling tests to wasm..."); let msg = format!("{}Compiling tests to WASM...", emoji::CYCLONE); PBAR.step(step, &msg); build::cargo_build_wasm_tests(log, &self.crate_path, !self.release)?; info!(log, "Finished compiling tests to wasm."); Ok(()) } fn step_install_wasm_bindgen(&mut self, step: &Step, log: &Logger) -> Result<(), Error> { info!(&log, "Identifying wasm-bindgen dependency..."); let lockfile = Lockfile::new(&self.crate_data)?; let bindgen_version = lockfile.require_wasm_bindgen()?; // Unlike `wasm-bindgen` and `wasm-bindgen-cli`, `wasm-bindgen-test` // will work with any semver compatible `wasm-bindgen-cli`, so just make // sure that it is depended upon, so we can run tests on // `wasm32-unkown-unknown`. Don't enforce that it is the same version as // `wasm-bindgen`. if lockfile.wasm_bindgen_test_version().is_none() { bail!( "Ensure that you have \"{}\" as a dependency in your Cargo.toml file:\n\ [dev-dependencies]\n\ wasm-bindgen-test = \"0.2\"", style("wasm-bindgen-test").bold().dim(), ) } let install_permitted = match self.mode { BuildMode::Normal => { info!(&log, "Ensuring wasm-bindgen-cli is installed..."); true } BuildMode::Force => { info!(&log, "Ensuring wasm-bindgen-cli is installed..."); true } BuildMode::Noinstall => { info!(&log, "Searching for existing wasm-bindgen-cli install..."); false } }; let dl = bindgen::install_wasm_bindgen( &self.cache, &bindgen_version, install_permitted, step, log, )?; self.test_runner_path = Some(dl.binary("wasm-bindgen-test-runner")); info!(&log, "Getting wasm-bindgen-cli was successful."); Ok(()) } fn step_test_node(&mut self, step: &Step, log: &Logger) -> Result<(), Error> { assert!(self.node); info!(log, "Running tests in node..."); PBAR.step(step, "Running tests in node..."); test::cargo_test_wasm( &self.crate_path, self.release, log, Some(( "CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER", &self.test_runner_path.as_ref().unwrap(), )), )?; info!(log, "Finished running tests in node."); Ok(()) } fn step_get_chromedriver(&mut self, step: &Step, _log: &Logger) -> Result<(), Error> { PBAR.step(step, "Getting chromedriver..."); assert!(self.chrome && self.chromedriver.is_none()); self.chromedriver = Some(webdriver::get_or_install_chromedriver( &self.cache, self.mode, )?); Ok(()) } fn step_test_chrome(&mut self, step: &Step, log: &Logger) -> Result<(), Error> { PBAR.step(step, "Running tests in Chrome..."); let chromedriver = self.chromedriver.as_ref().unwrap().display().to_string(); let chromedriver = chromedriver.as_str(); info!( log, "Running tests in Chrome with chromedriver at {}", chromedriver ); let test_runner = self .test_runner_path .as_ref() .unwrap() .display() .to_string(); let test_runner = test_runner.as_str(); info!(log, "Using wasm-bindgen test runner at {}", test_runner); let mut envs = vec![ ("CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER", test_runner), ("CHROMEDRIVER", chromedriver), ]; if !self.headless { envs.push(("NO_HEADLESS", "1")); } test::cargo_test_wasm(&self.crate_path, self.release, log, envs)?; Ok(()) } fn step_get_geckodriver(&mut self, step: &Step, _log: &Logger) -> Result<(), Error> { PBAR.step(step, "Getting geckodriver..."); assert!(self.firefox && self.geckodriver.is_none()); self.geckodriver = Some(webdriver::get_or_install_geckodriver( &self.cache, self.mode, )?); Ok(()) } fn step_test_firefox(&mut self, step: &Step, log: &Logger) -> Result<(), Error> { PBAR.step(step, "Running tests in Firefox..."); let geckodriver = self.geckodriver.as_ref().unwrap().display().to_string(); let geckodriver = geckodriver.as_str(); info!( log, "Running tests in Firefox with geckodriver at {}", geckodriver ); let test_runner = self .test_runner_path .as_ref() .unwrap() .display() .to_string(); let test_runner = test_runner.as_str(); info!(log, "Using wasm-bindgen test runner at {}", test_runner); let mut envs = vec![ ("CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER", test_runner), ("GECKODRIVER", geckodriver), ]; if !self.headless { envs.push(("NO_HEADLESS", "1")); } test::cargo_test_wasm(&self.crate_path, self.release, log, envs)?; Ok(()) } fn step_get_safaridriver(&mut self, step: &Step, _log: &Logger) -> Result<(), Error> { PBAR.step(step, "Getting safaridriver..."); assert!(self.safari && self.safaridriver.is_none()); self.safaridriver = Some(webdriver::get_safaridriver()?); Ok(()) } fn step_test_safari(&mut self, step: &Step, log: &Logger) -> Result<(), Error> { PBAR.step(step, "Running tests in Safari..."); let safaridriver = self.safaridriver.as_ref().unwrap().display().to_string(); let safaridriver = safaridriver.as_str(); info!( log, "Running tests in Safari with safaridriver at {}", safaridriver ); let test_runner = self .test_runner_path .as_ref() .unwrap() .display() .to_string(); let test_runner = test_runner.as_str(); info!(log, "Using wasm-bindgen test runner at {}", test_runner); let mut envs = vec![ ("CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER", test_runner), ("SAFARIDRIVER", safaridriver), ]; if !self.headless { envs.push(("NO_HEADLESS", "1")); } test::cargo_test_wasm(&self.crate_path, self.release, log, envs)?; Ok(()) } }
34.266968
99
0.560412
04c57dc62116ab23370f1bfbc82767bfe65a064c
3,811
sql
SQL
surat.sql
rioriantana/suratijin
dfac710a422ba4f25825c1e6e915bd2689ed0fde
[ "MIT" ]
null
null
null
surat.sql
rioriantana/suratijin
dfac710a422ba4f25825c1e6e915bd2689ed0fde
[ "MIT" ]
null
null
null
surat.sql
rioriantana/suratijin
dfac710a422ba4f25825c1e6e915bd2689ed0fde
[ "MIT" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: 04 Mar 2018 pada 17.31 -- Versi Server: 10.1.16-MariaDB -- PHP Version: 5.6.24 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `surat` -- -- -------------------------------------------------------- -- -- Struktur dari tabel `detail_ijin_magang` -- CREATE TABLE `detail_ijin_magang` ( `id` int(11) NOT NULL, `id_magang` int(11) NOT NULL, `nama` varchar(50) NOT NULL, `nim` varchar(20) NOT NULL, `topik` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Struktur dari tabel `ijin_magang` -- CREATE TABLE `ijin_magang` ( `id` int(11) NOT NULL, `kepada` varchar(100) NOT NULL, `alamat_kepada` longtext NOT NULL, `tempat_penelitian` varchar(255) NOT NULL, `tanggal_mulai` date NOT NULL, `tanggal_selesai` date NOT NULL, `nama_instansi` varchar(255) NOT NULL, `nama_pembimbing` varchar(100) NOT NULL, `nip_pembimbing` varchar(30) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Struktur dari tabel `ijin_penelitian` -- CREATE TABLE `ijin_penelitian` ( `id` int(11) NOT NULL, `kepada` varchar(200) NOT NULL, `alamat_kepada` longtext NOT NULL, `nama` varchar(50) NOT NULL, `nim` varchar(20) NOT NULL, `topik` longtext NOT NULL, `tempat_penelitian` varchar(100) NOT NULL, `tanggal_mulai` date NOT NULL, `tanggal_selesai` date NOT NULL, `nama_pembimbing` varchar(50) NOT NULL, `nip_pembimbing` varchar(30) NOT NULL, `nama_instansi` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Struktur dari tabel `ijin_pinjam_alat` -- CREATE TABLE `ijin_pinjam_alat` ( `id` int(11) NOT NULL, `kepada` varchar(100) NOT NULL, `alamat_kepada` longtext NOT NULL, `nama` varchar(50) NOT NULL, `nim` varchar(20) NOT NULL, `topik` longtext NOT NULL, `nama_alat` varchar(255) NOT NULL, `tanggal_mulai` date NOT NULL, `tanggal_selesai` date NOT NULL, `nama_pembimbing` varchar(100) NOT NULL, `nip_pembimbing` varchar(30) NOT NULL, `nama_instansi` varchar(255) NOT NULL, `tempat_instansi` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `detail_ijin_magang` -- ALTER TABLE `detail_ijin_magang` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ijin_magang` -- ALTER TABLE `ijin_magang` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ijin_penelitian` -- ALTER TABLE `ijin_penelitian` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ijin_pinjam_alat` -- ALTER TABLE `ijin_pinjam_alat` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `detail_ijin_magang` -- ALTER TABLE `detail_ijin_magang` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `ijin_magang` -- ALTER TABLE `ijin_magang` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `ijin_penelitian` -- ALTER TABLE `ijin_penelitian` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `ijin_pinjam_alat` -- ALTER TABLE `ijin_pinjam_alat` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
24.908497
67
0.670953
f045469d6e49cb930d7d7eb9dbcef7e3f9f888cd
3,544
js
JavaScript
build/translations/nb.js
frmendez/ckeditor5-build-bptemplates
30e3ca3f7fe5a73c8c55f0a3320cb36230582d61
[ "MIT" ]
null
null
null
build/translations/nb.js
frmendez/ckeditor5-build-bptemplates
30e3ca3f7fe5a73c8c55f0a3320cb36230582d61
[ "MIT" ]
null
null
null
build/translations/nb.js
frmendez/ckeditor5-build-bptemplates
30e3ca3f7fe5a73c8c55f0a3320cb36230582d61
[ "MIT" ]
null
null
null
(function(d){d['nb']=Object.assign(d['nb']||{},{a:"Kan ikke laste opp fil:",b:"Image toolbar",c:"Table toolbar",d:"Venstrejuster",e:"Høyrejuster",f:"Midstill",g:"Blokkjuster",h:"Tekstjustering",i:"Text alignment toolbar",j:"Skriftstørrelse",k:"Standard",l:"Veldig liten",m:"Liten",n:"Stor",o:"Veldig stor",p:"Font Color",q:"Skrifttype",r:"Font Background Color",s:"Gul uthevingsfarge",t:"Grønn uthevingsfarge",u:"Rosa uthevingsfarge",v:"Blå uthevingsfarge",w:"Rød penn",x:"Grønn penn",y:"Fjern uthevingsfarge",z:"Utheving",aa:"Text highlight toolbar",ab:"Fet",ac:"Kursiv",ad:"Gjennomstreking",ae:"Kode",af:"Understreking",ag:"Subscript",ah:"Superscript",ai:"Blokksitat",aj:"Insert image or file",ak:"Bilde-widget",al:"media widget",am:"Remove Format",an:"Page break",ao:"Opplasting pågår",ap:"Cell properties",aq:"Table properties",ar:"Widget toolbar",as:"Could not obtain resized image URL.",at:"Selecting resized image failed",au:"Could not insert image at the current position.",av:"Inserting image failed",aw:"Endre tekstalternativ for bilde",ax:"Remove color",ay:"Document colors",az:"Dropdown toolbar",ba:"Editor toolbar",bb:"Show more items",bc:"%0 of %1",bd:"Previous",be:"Next",bf:"Open in a new tab",bg:"Downloadable",bh:"Black",bi:"Dim grey",bj:"Grey",bk:"Light grey",bl:"White",bm:"Red",bn:"Orange",bo:"Yellow",bp:"Light green",bq:"Green",br:"Aquamarine",bs:"Turquoise",bt:"Light blue",bu:"Blue",bv:"Purple",bw:"Lagre",bx:"Avbryt",by:"Tekstalternativ for bilde",bz:"None",ca:"Solid",cb:"Dotted",cc:"Dashed",cd:"Double",ce:"Groove",cf:"Ridge",cg:"Inset",ch:"Outset",ci:"The color is invalid. Try \"#FF0000\" or \"rgb(255,0,0)\" or \"red\".",cj:"The value is invalid. Try \"10px\" or \"2em\" or simply \"2\".",ck:"Border",cl:"Style",cm:"Width",cn:"Color",co:"Background",cp:"Dimensions",cq:"Height",cr:"Alignment",cs:"Table alignment toolbar",ct:"Align table to the left",cu:"Center table",cv:"Align table to the right",cw:"Padding",cx:"Table cell text alignment",cy:"Horizontal text alignment toolbar",cz:"Vertical text alignment toolbar",da:"Align cell text to the left",db:"Align cell text to the center",dc:"Align cell text to the right",dd:"Justify cell text",de:"Align cell text to the top",df:"Align cell text to the middle",dg:"Align cell text to the bottom",dh:"Angre",di:"Gjør om",dj:"Rikteksteditor, %0",dk:"Sett inn tabell",dl:"Overskriftkolonne",dm:"Insert column left",dn:"Insert column right",do:"Slett kolonne",dp:"Kolonne",dq:"Overskriftrad",dr:"Sett inn rad under",ds:"Sett inn rad over",dt:"Slett rad",du:"Rad",dv:"Slå sammen celle opp",dw:"Slå sammen celle til høyre",dx:"Slå sammen celle ned",dy:"Slå sammen celle til venstre",dz:"Del celle vertikalt",ea:"Del celle horisontalt",eb:"Slå sammen celler",ec:"Insert media",ed:"The URL must not be empty.",ee:"This media URL is not supported.",ef:"Nummerert liste",eg:"Punktmerket liste",eh:"Lenke",ei:"Increase indent",ej:"Decrease indent",ek:"Velg overskrift",el:"Overskrift",em:"Opplasting feilet",en:"Sett inn bilde",eo:"Skriv inn bildetekst",ep:"Bilde i full størrelse",eq:"Sidebilde",er:"Venstrejustert bilde",es:"Midtstilt bilde",et:"Høyrejustert bilde",eu:"Paste the media URL in the input.",ev:"Tip: Paste the URL into the content to embed faster.",ew:"Media URL",ex:"Avsnitt",ey:"Overskrift 1",ez:"Overskrift 2",fa:"Overskrift 3",fb:"Heading 4",fc:"Heading 5",fd:"Heading 6",fe:"Fjern lenke",ff:"Rediger lenke",fg:"Åpne lenke i ny fane",fh:"Denne lenken har ingen URL",fi:"URL for lenke"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
3,544
3,544
0.723476
0b79b4d5c6a8d784f65fd0a7a5fea7c278a40020
435
kt
Kotlin
ktfx-listeners/src/ktfx/listeners/_PopupWindow.kt
hendraanggrian/javafx-ktx
617cf825630561838a68a7ce14fa8b8546c12a4a
[ "Apache-2.0" ]
13
2018-03-29T09:15:01.000Z
2022-02-18T16:22:07.000Z
ktfx-listeners/src/ktfx/listeners/_PopupWindow.kt
hendraanggrian/kotfx
617cf825630561838a68a7ce14fa8b8546c12a4a
[ "Apache-2.0" ]
10
2018-08-02T13:42:04.000Z
2018-08-13T19:36:05.000Z
ktfx-listeners/src/ktfx/listeners/_PopupWindow.kt
hendraanggrian/kotfx
617cf825630561838a68a7ce14fa8b8546c12a4a
[ "Apache-2.0" ]
2
2018-08-02T13:43:10.000Z
2018-08-03T10:47:45.000Z
@file:JvmMultifileClass @file:JvmName("KtfxListenersKt") @file:Suppress("NOTHING_TO_INLINE") package ktfx.listeners import javafx.event.Event import javafx.stage.PopupWindow import kotlin.Suppress import kotlin.Unit import kotlin.jvm.JvmMultifileClass import kotlin.jvm.JvmName /** * @see PopupWindow.setOnAutoHide */ public inline fun PopupWindow.onAutoHide(noinline action: (Event) -> Unit) { return setOnAutoHide(action) }
21.75
76
0.797701
1a4d73fd9d3cf74d6c5b8e1fe15f4f001059ea83
959
asm
Assembly
s2/sfx-original/C9 - Hidden Bonus (Unused).asm
Cancer52/flamedriver
9ee6cf02c137dcd63e85a559907284283421e7ba
[ "0BSD" ]
9
2017-10-09T20:28:45.000Z
2021-06-29T21:19:20.000Z
s2/sfx-original/C9 - Hidden Bonus (Unused).asm
Cancer52/flamedriver
9ee6cf02c137dcd63e85a559907284283421e7ba
[ "0BSD" ]
12
2018-08-01T13:52:20.000Z
2022-02-21T02:19:37.000Z
s2/sfx-original/C9 - Hidden Bonus (Unused).asm
Cancer52/flamedriver
9ee6cf02c137dcd63e85a559907284283421e7ba
[ "0BSD" ]
2
2018-02-17T19:50:36.000Z
2019-10-30T19:28:06.000Z
Sound49_Bonus_Header: smpsHeaderStartSong 2 smpsHeaderVoice Sound49_Bonus_Voices smpsHeaderTempoSFX $01 smpsHeaderChanSFX $01 smpsHeaderSFXChannel cFM5, Sound49_Bonus_FM5, $0E, $00 ; FM5 Data Sound49_Bonus_FM5: smpsSetvoice $00 smpsModSet $01, $01, $33, $18 dc.b nAb4, $1A smpsStop Sound49_Bonus_Voices: ; Voice $00 ; $3B ; $0A, $31, $05, $02, $5F, $5F, $5F, $5F, $04, $14, $16, $0C ; $00, $04, $00, $00, $1F, $6F, $D8, $FF, $03, $25, $00, $80 smpsVcAlgorithm $03 smpsVcFeedback $07 smpsVcUnusedBits $00 smpsVcDetune $00, $00, $03, $00 smpsVcCoarseFreq $02, $05, $01, $0A smpsVcRateScale $01, $01, $01, $01 smpsVcAttackRate $1F, $1F, $1F, $1F smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $0C, $16, $14, $04 smpsVcDecayRate2 $00, $00, $04, $00 smpsVcDecayLevel $0F, $0D, $06, $01 smpsVcReleaseRate $0F, $08, $0F, $0F smpsVcTotalLevel $00, $00, $25, $03
27.4
62
0.61731
5a57e3d8388a6958f90769b5d1687ec9dc7f5c6e
683
asm
Assembly
oeis/032/A032343.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/032/A032343.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/032/A032343.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A032343: a(n) = 10*a(n-1)+n^2, a(0)=0. ; Submitted by Jamie Morken(s3) ; 0,1,14,149,1506,15085,150886,1508909,15089154,150891621,1508916310,15089163221,150891632354,1508916323709,15089163237286,150891632373085,1508916323731106,15089163237311349,150891632373113814,1508916323731138501,15089163237311385410,150891632373113854541,1508916323731138545894,15089163237311385459469,150891632373113854595266,1508916323731138545953285,15089163237311385459533526,150891632373113854595335989,1508916323731138545953360674,15089163237311385459533607581,150891632373113854595336076710 lpb $0 mov $2,$0 sub $0,1 trn $0,$3 seq $2,52262 ; Partial sums of A014824. add $3,$2 lpe mov $0,$3
52.538462
498
0.834553
4c9147e4b94c987c89cc00075bf420933d637454
2,969
swift
Swift
Tests/Rocc/AsyncWhileTests.swift
gswirski/rocc
57f7934c096c27efc12981b691a81e85359bcfb9
[ "MIT" ]
71
2019-02-26T20:11:59.000Z
2022-03-29T18:12:56.000Z
Tests/Rocc/AsyncWhileTests.swift
simonmitchell/rocc
b8b29207e808c1a2e5b397f4d4c0950149e8b76d
[ "MIT" ]
40
2019-04-24T08:03:17.000Z
2021-08-10T07:48:59.000Z
Tests/Rocc/AsyncWhileTests.swift
gswirski/rocc
57f7934c096c27efc12981b691a81e85359bcfb9
[ "MIT" ]
6
2019-08-11T12:44:45.000Z
2022-02-04T00:38:09.000Z
// // AsyncWhileTests.swift // RoccTests // // Created by Simon Mitchell on 19/11/2019. // Copyright © 2019 Simon Mitchell. All rights reserved. // import XCTest @testable import Rocc class AsyncWhileTests: XCTestCase { func testTimeoutCalledBeforeBreakingTwice() { var continueCalls: Int = 0 let expectation = XCTestExpectation(description: "timeout called") DispatchQueue.global().asyncWhile({ (continueClosure) in DispatchQueue.global().asyncAfter(deadline: .now() + 1.2) { continueCalls += 1 continueClosure(true) } }, timeout: 1.0) { expectation.fulfill() } wait(for: [expectation], timeout: 2.0) XCTAssertEqual(continueCalls, 1) } func testWhileClosureCalledAppropriateNumberOfTimes() { let expectation = XCTestExpectation(description: "timeout called") var calls: Int = 0 DispatchQueue.global().asyncWhile({ (continueClosure) in DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { calls += 1 continueClosure(false) } }, timeout: 2.1) { expectation.fulfill() } wait(for: [expectation], timeout: 3.0) XCTAssertEqual(calls, 11) } func testCallingContinueWithTrueBreaksWhile() { let expectation = XCTestExpectation(description: "timeout called") var calls: Int = 0 DispatchQueue.global().asyncWhile({ (continueClosure) in DispatchQueue.global().asyncAfter(deadline: .now() + 0.2) { calls += 1 continueClosure(true) } }, timeout: 2.1) { expectation.fulfill() } wait(for: [expectation], timeout: 3.0) XCTAssertEqual(calls, 1) } func testWhileClosureCalledOnMainThread() { let expectation = XCTestExpectation(description: "timeout called") DispatchQueue.global().asyncWhile({ (continueClosure) in XCTAssertEqual(Thread.current.isMainThread, true) expectation.fulfill() }, timeout: 0.2) { } wait(for: [expectation], timeout: 0.3) } func testDoneClosureCalledOnMainThread() { let expectation = XCTestExpectation(description: "timeout called") DispatchQueue.global().asyncWhile({ (continueClosure) in continueClosure(true) }, timeout: 0.2) { XCTAssertEqual(Thread.current.isMainThread, true) expectation.fulfill() } wait(for: [expectation], timeout: 0.3) } }
26.990909
74
0.529471
21d66f6b722bd11464bfd6abfda22fbac55694cb
1,169
html
HTML
mediana.html
MJSam-Dev/curso-practico-js
16550fc3355db0d7cc193067c5c9875a16356e3f
[ "MIT" ]
null
null
null
mediana.html
MJSam-Dev/curso-practico-js
16550fc3355db0d7cc193067c5c9875a16356e3f
[ "MIT" ]
null
null
null
mediana.html
MJSam-Dev/curso-practico-js
16550fc3355db0d7cc193067c5c9875a16356e3f
[ "MIT" ]
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>Mediana</title> </head> <body> <style> body { background-color: rgb(51, 51, 51); font-family: monospace; color: rgba(47, 255, 75, 0.801); } </style> <header> <h1>Mediana</h1> <form> <label for="dato1">Dato 1:</label> <input id="dato1" type="number" /> <label for="dato2">Dato 2:</label> <input id="dato2" type="number" /> <label for="dato3">Dato 3:</label> <input id="dato3" type="number" /> <label for="dato4">Dato 4:</label> <input id="dato4" type="number" /> <label for="dato5">Dato 5:</label> <input id="dato5" type="number" /> <button type="button" onclick="onClickButtonCalcularMediana()">Calcular Mediana</button> <h3 id="resultado"></h3> </form> </header> <script src="./mediana.js"></script> </body> </html>
30.763158
100
0.520958
aa399c395abefc3d9c3392f73f7d02f39152cc1e
526
swift
Swift
ProductViewer/ProductViewer/Detail/ProductDetailRouter.swift
sudiptasahoo/TargetCaseStudy
cec71d4dd0dc0fbf52be9ef0e2f544d8755c972f
[ "MIT" ]
null
null
null
ProductViewer/ProductViewer/Detail/ProductDetailRouter.swift
sudiptasahoo/TargetCaseStudy
cec71d4dd0dc0fbf52be9ef0e2f544d8755c972f
[ "MIT" ]
null
null
null
ProductViewer/ProductViewer/Detail/ProductDetailRouter.swift
sudiptasahoo/TargetCaseStudy
cec71d4dd0dc0fbf52be9ef0e2f544d8755c972f
[ "MIT" ]
null
null
null
// // ProductDetailRouter.swift // ProductViewer // // Created by Sudipta Sahoo on 02/08/21. // Copyright © 2021 Target. All rights reserved. // import Foundation import UIKit final class ProductDetailRouter: ProductDetailRouterInput { //MARK: Properties private weak var viewController: ProductDetailViewController? //MARK: Initialiser init(viewController: ProductDetailViewController) { self.viewController = viewController } //MARK: ProductDetailRouterInput methods }
20.230769
65
0.718631
7d106522459288749c1ed5893f9a3eafaaecb898
4,902
swift
Swift
Sources/Model/User.swift
shawnthroop/Peanut
21eb254cda51438193bbd775cfdbb6152f8b7bbb
[ "MIT" ]
2
2018-05-21T20:25:55.000Z
2018-06-05T01:01:30.000Z
Sources/Model/User.swift
shawnthroop/Peanut
21eb254cda51438193bbd775cfdbb6152f8b7bbb
[ "MIT" ]
5
2018-05-21T23:57:01.000Z
2019-01-12T11:54:14.000Z
Sources/Model/User.swift
shawnthroop/Peanut
21eb254cda51438193bbd775cfdbb6152f8b7bbb
[ "MIT" ]
null
null
null
// // User.swift // Peanut // // Created by Shawn Throop on 21.05.18. // public struct User: Hashable { public var id: Identifier<User> public var username: String public var name: String? public var cover: Image public var avatar: Image public var content: Content? public var kind: User.Kind public var counts: User.Counts? public var createdAt: Date public let badge: User.Badge? public let verification: User.Verification? init(id: Identifier<User>, username: String, name: String?, cover: Image, avatar: Image, content: Content?, kind: Kind, counts: User.Counts?, createdAt: Date, badge: User.Badge? = nil, verification: User.Verification? = nil) { self.id = id self.username = username self.name = name self.cover = cover self.avatar = avatar self.content = content self.kind = kind self.counts = counts self.createdAt = createdAt self.badge = badge self.verification = verification } } extension APIParameterKey { public static let includeUserHTML = APIParameterKey("include_user_html") public static let includeUser = APIParameterKey("include_user") public static let includePresence = APIParameterKey("include_presence") public static let includeUserRaw = APIParameterKey("include_user_raw") } extension User: UniquelyIdentifiable { public typealias IdentifierValue = UniqueIdentifier } extension User: APIDefaultParametersProvider { public static let defaultParameters: APIParameters = makeDefaultParameters() } extension User: Codable { public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) id = try container.decode(Identifier<User>.self, forKey: .id) username = try container.decode(String.self, forKey: .username) if decoder.context?.source == .remote { name = try container.decodeIfPresent(String.self, forKey: .name).flatMap { rawName in let trimmedName = rawName.trimmingCharacters(in: .whitespacesAndNewlines) return trimmedName.isEmpty ? nil : rawName } } else { name = try container.decodeIfPresent(String.self, forKey: .name) } let contentContainer = try container.nestedContainer(keyedBy: ContentCodingKeys.self, forKey: .content) cover = try contentContainer.decode(Image.self, forKey: .cover) avatar = try contentContainer.decode(Image.self, forKey: .avatar) content = contentContainer.contains(.text) ? try container.decode(Content.self, forKey: .content) : nil kind = try container.decode(Kind.self, forKey: .kind) counts = try container.decodeIfPresent(Counts.self, forKey: .counts) createdAt = try container.decode(Date.self, forKey: .createdAt) badge = try container.decodeIfPresent(Badge.self, forKey: .badge) verification = try container.decodeIfPresent(Verification.self, forKey: .verification) } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(id, forKey: .id) try container.encode(username, forKey: .username) try container.encodeIfPresent(name, forKey: .name) var contentContainer = container.nestedContainer(keyedBy: ContentCodingKeys.self, forKey: .content) try contentContainer.encode(cover, forKey: .cover) try contentContainer.encode(avatar, forKey: .avatar) try container.encodeIfPresent(content, forKey: .content) try container.encode(kind, forKey: .kind) try container.encodeIfPresent(counts, forKey: .counts) try container.encode(createdAt, forKey: .createdAt) try container.encodeIfPresent(badge, forKey: .badge) try container.encodeIfPresent(verification, forKey: .verification) } } private extension User { static func makeDefaultParameters() -> APIParameters { var result = APIParameters() result[.includeHTML] = true result[.includeUserHTML] = true result[.includeCounts] = true result[.includeUser] = true result[.includePresence] = false result[.includeRaw] = false result[.includeUserRaw] = false return result } enum CodingKeys: String, CodingKey { case id case username case name case content case kind = "type" case counts case createdAt = "created_at" case badge case verification = "verified" } enum ContentCodingKeys: String, CodingKey { case avatar = "avatar_image" case cover = "cover_image" case text } }
35.781022
230
0.657283
e6dad4b2df45a34505fe92f54a218b11bdb7879a
2,115
sql
SQL
test/sql/V9999__testdata.sql
oicr-gsi/guanyin
376b967eb5f55051678c4c4c5bffa732d0757eb7
[ "MIT" ]
1
2020-06-02T16:45:30.000Z
2020-06-02T16:45:30.000Z
test/sql/V9999__testdata.sql
oicr-gsi/guanyin
376b967eb5f55051678c4c4c5bffa732d0757eb7
[ "MIT" ]
3
2019-02-28T15:15:18.000Z
2021-05-06T19:49:17.000Z
test/sql/V9999__testdata.sql
oicr-gsi/guanyin
376b967eb5f55051678c4c4c5bffa732d0757eb7
[ "MIT" ]
null
null
null
Insert INTO report (name, version, category, permitted_parameters) VALUES ('jsonReport', '1.0', 'report', '{"instrument":{"type":"s", "required":false}, "runName":{"type":"s", "required":true}}'); Insert INTO report_record (report_id, files_in, report_path, notification_targets, notification_message, parameters) VALUES (1, '{"p1"}', '/oicr/data/archive/r1', '{"email":["xluo@oicr.on.ca","seqprobio@oicr.on.ca"]}', 'here is the run report', '{"runName":"170623_D00331_0244_BCB1LMANXX", "instrument":"HiSeq"}'); Insert INTO report (name, version, category, permitted_parameters, lims_entity) VALUES ('jsonReport', '1.1', 'report', '{"instrument":{"type":"s", "required":false}, "runName":{"type":"s", "required":true}}', 'Run'); Insert INTO report_record (report_id, files_in, report_path, notification_targets, notification_message, parameters) VALUES (2, '{"p1", "p2"}' ,'/oicr/data/archive/r2','{"email":["xluo@oicr.on.ca","seqprobio@oicr.on.ca"]}', 'here is the run report', '{"runName":"161017_M00146_0050_000000000-AW48L", "instrument":"MiSeq"}'); Insert INTO report (name, version, category, permitted_parameters) VALUES ('coveragereport', '1.0', 'report', '{"project":{"type":"s", "required":true}, "instrument":{"type":"s", "required":false}}'); Insert INTO report_record (report_id, files_in, report_path, notification_targets, notification_message, parameters) VALUES (3, '{"p1", "p2", "p3"}', '/oicr/data/archive/r3','{"email":["xluo@oicr.on.ca","seqprobio@oicr.on.ca"]}', 'here is the coverage report for PCSI', '{"project":"PCSI", "instrument":"HiSeq"}'); Insert INTO report (name, version, category, permitted_parameters) VALUES ('coveragereport', '1.1', 'report', '{"project":{"type":"s", "required":true}, "instrument":{"type":"o2name$sversion$i", "required":false}}'); Insert INTO report_record (report_id, files_in, report_path, notification_targets, notification_message, parameters) VALUES (4, '{"p1", "p2", "p3", "p4"}', '/oicr/data/archive/r4','{"email":["xluo@oicr.on.ca","seqprobio@oicr.on.ca"]}', 'Here is the coverage report for HALT', '{"project":"HALT", "instrument":"MiSeq"}');
88.125
207
0.695035
6bb645d547d03fae9e840bb6c45db7f45eca7406
2,132
h
C
System/Library/PrivateFrameworks/HealthDaemon.framework/_HDHealthServiceDiscoveryInfo.h
lechium/iPhoneOS_12.1.1_Headers
aac688b174273dfcbade13bab104461f463db772
[ "MIT" ]
12
2019-06-02T02:42:41.000Z
2021-04-13T07:22:20.000Z
System/Library/PrivateFrameworks/HealthDaemon.framework/_HDHealthServiceDiscoveryInfo.h
lechium/iPhoneOS_12.1.1_Headers
aac688b174273dfcbade13bab104461f463db772
[ "MIT" ]
null
null
null
System/Library/PrivateFrameworks/HealthDaemon.framework/_HDHealthServiceDiscoveryInfo.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:49:37 PM Mountain Standard Time * Operating System: Version 12.1.1 (Build 16C5050a) * Image Source: /System/Library/PrivateFrameworks/HealthDaemon.framework/HealthDaemon * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. */ @protocol OS_dispatch_source; @class NSMutableSet, CBUUID, NSObject; @interface _HDHealthServiceDiscoveryInfo : NSObject { NSMutableSet* _peripheralsUUIDs; BOOL _alwaysNotify; BOOL _requiresActiveScan; unsigned long long _discoveryIdentifier; /*^block*/id _discoveryHandler; CBUUID* _serviceUUID; NSObject*<OS_dispatch_source> _timeoutTimer; } @property (assign,nonatomic) unsigned long long discoveryIdentifier; //@synthesize discoveryIdentifier=_discoveryIdentifier - In the implementation block @property (nonatomic,readonly) id discoveryHandler; //@synthesize discoveryHandler=_discoveryHandler - In the implementation block @property (nonatomic,readonly) CBUUID * serviceUUID; //@synthesize serviceUUID=_serviceUUID - In the implementation block @property (nonatomic,readonly) BOOL alwaysNotify; //@synthesize alwaysNotify=_alwaysNotify - In the implementation block @property (nonatomic,readonly) BOOL requiresActiveScan; //@synthesize requiresActiveScan=_requiresActiveScan - In the implementation block @property (nonatomic,retain) NSObject*<OS_dispatch_source> timeoutTimer; //@synthesize timeoutTimer=_timeoutTimer - In the implementation block -(CBUUID *)serviceUUID; -(id)initWithHandler:(/*^block*/id)arg1 serviceUUID:(id)arg2 alwaysNotify:(BOOL)arg3 requiresActiveScan:(BOOL)arg4 ; -(void)setDiscoveryIdentifier:(unsigned long long)arg1 ; -(void)setTimeoutTimer:(NSObject*<OS_dispatch_source>)arg1 ; -(id)discoveryHandler; -(NSObject*<OS_dispatch_source>)timeoutTimer; -(unsigned long long)discoveryIdentifier; -(BOOL)requiresActiveScan; -(BOOL)_addPeripheralUUID:(id)arg1 ; -(BOOL)alwaysNotify; @end
49.581395
170
0.747186
994759c55fb07840e41c3ef75f080bb8863f095e
748
h
C
include/argparse/argument.h
knutzk/argparse
332da3dbcc91ed537c1ce3e92da33dcd185dc898
[ "MIT" ]
null
null
null
include/argparse/argument.h
knutzk/argparse
332da3dbcc91ed537c1ce3e92da33dcd185dc898
[ "MIT" ]
null
null
null
include/argparse/argument.h
knutzk/argparse
332da3dbcc91ed537c1ce3e92da33dcd185dc898
[ "MIT" ]
null
null
null
#ifndef ARGPARSE_ARGUMENT_H_ #define ARGPARSE_ARGUMENT_H_ #include <string> namespace Argparse { class Argument { public: Argument(const std::string& name, const std::string& help); inline auto getDefaultValue() const { return def_value_; } inline auto getName() const { return name_; } inline auto getHelpMessage() const { return help_; } inline auto getValue() const { return value_; } inline void setDefaultValue(const std::string& value) { def_value_ = value; } inline void setValue(const std::string& value) { value_ = value; } protected: const std::string name_; const std::string help_; std::string value_{""}; std::string def_value_{""}; }; } // namespace Argparse #endif // ARGPARSE_ARGUMENT_H_
24.933333
79
0.707219
89756b860aa6ee57e05bab32eefb2498f1929e92
1,270
sql
SQL
medium/_02_xtests/cases/test_rpad_QA.sql
zionyun/cubrid-testcases
ed8a07b096d721b9b42eb843fab326c63d143d77
[ "BSD-3-Clause" ]
9
2016-03-24T09:51:52.000Z
2022-03-23T10:49:47.000Z
medium/_02_xtests/cases/test_rpad_QA.sql
zionyun/cubrid-testcases
ed8a07b096d721b9b42eb843fab326c63d143d77
[ "BSD-3-Clause" ]
173
2016-04-13T01:16:54.000Z
2022-03-16T07:50:58.000Z
medium/_02_xtests/cases/test_rpad_QA.sql
zionyun/cubrid-testcases
ed8a07b096d721b9b42eb843fab326c63d143d77
[ "BSD-3-Clause" ]
38
2016-03-24T17:10:31.000Z
2021-10-30T22:55:45.000Z
autocommit off; set names utf8; create table tb ( dummy varchar(1) ); insert into tb values ('X'); create table test_rpad ( type_char char(10) charset utf8, type_varchar varchar(10) charset utf8, type_nchar nchar(10) charset utf8, type_nchar_varying nchar varying(10) charset utf8 ); insert into test_rpad (type_char) values ('choi'); SELECT type_char, type_varchar,RPAD(type_char, 6, type_varchar) FROM test_rpad; SELECT type_char, type_varchar,RPAD(type_char, 6, NULL) FROM test_rpad; SELECT RPAD(NULL, 6, NULL) FROM tb; SELECT RPAD('a', 6, NULL) FROM tb; SELECT RPAD(NULL, 6, 'a') FROM tb; SELECT RPAD('Chun', 5, '최') FROM tb; /* Normal */ SELECT RPAD('최공훈', 4, ' ') FROM tb; SELECT RPAD('최공훈', 6, ' ') FROM tb; SELECT RPAD('최공훈', 8, ' ') FROM tb; SELECT RPAD('Choikonghun', 10,'choi') FROM tb; SELECT RPAD('Choikonghun', 11,'choi') FROM tb; SELECT RPAD('Choikonghun', 12,'choi') FROM tb; SELECT RPAD('Choikonghun', 13,'choi') FROM tb; SELECT RPAD('Choikonghun', 14,'choi') FROM tb; SELECT RPAD('Choikonghun', 15,'choi') FROM tb; SELECT RPAD('Choikonghun', 16,'choi') FROM tb; SELECT RPAD('Choikonghun', 17,'choi') FROM tb; select rpad(NULL,NULL) from tb; select rpad(NULL,NULL,NULL) from tb; drop table tb; drop table test_rpad; set names iso88591; rollback;
33.421053
79
0.714173
8589ca50caf9d27b3c45c597e7419738f7d16d2f
1,828
js
JavaScript
frontend/server/mocks/output-observers.js
uboot/stromx-web
48229f648dea8d00636248d79a21eabfa92b31a6
[ "Apache-2.0" ]
1
2015-02-06T12:51:33.000Z
2015-02-06T12:51:33.000Z
frontend/server/mocks/output-observers.js
uboot/stromx-web
48229f648dea8d00636248d79a21eabfa92b31a6
[ "Apache-2.0" ]
null
null
null
frontend/server/mocks/output-observers.js
uboot/stromx-web
48229f648dea8d00636248d79a21eabfa92b31a6
[ "Apache-2.0" ]
4
2015-05-10T03:00:46.000Z
2022-01-20T07:11:07.000Z
module.exports = function(app) { var express = require('express'); var outputObserversRouter = express.Router(); outputObserversRouter.get('/', function(req, res) { res.send({"output-observers": [ { id: 3, zvalue: 3, visualization: 'value', visualizations: ['value'], properties: { color: '#ff0000' }, output: 4, value: 2, view: 1 }, { id: 4, zvalue: 4, visualization: 'polygon', visualizations: ['polygon', 'value'], properties: { color: '#00ff00' }, output: 5, value: 3, view: 1 }, { id: 5, zvalue: 4, visualization: 'rectangle', visualizations: ['rectangle', 'value'], properties: { color: '#00ffff' }, output: 5, value: 5, view: 2 }, { id: 6, zvalue: 5, visualization: 'polyline', visualizations: ['polyline', 'value'], properties: { color: '#ff0000' }, output: 5, value: 6, view: 2 }, { id: 7, zvalue: 6, visualization: 'value', visualizations: ['value'], properties: { color: '#ff0000' }, output: 5, value: 7, view: 2 } ]}); }); outputObserversRouter.post('/', function(req, res) { res.send({ "output-observer": { id: 8 } }); }); outputObserversRouter.put('/', function(req, res) { res.send('null'); }); outputObserversRouter.delete('/', function(req, res) { res.send('null'); }); app.use('/api/outputObservers', outputObserversRouter); app.use('/api/outputObservers/*', outputObserversRouter); };
22.292683
59
0.471554
85bf0fed252edb69e5181ccd21ee2a61d4d1f97d
1,453
rs
Rust
backend/src/types/ws.rs
jay3332/KeyMaster
927b453c70d240bdfdc4c82c92de4ffc1756f966
[ "MIT" ]
2
2021-12-27T01:28:23.000Z
2021-12-28T00:46:34.000Z
backend/src/types/ws.rs
jay3332/KeyMaster
927b453c70d240bdfdc4c82c92de4ffc1756f966
[ "MIT" ]
null
null
null
backend/src/types/ws.rs
jay3332/KeyMaster
927b453c70d240bdfdc4c82c92de4ffc1756f966
[ "MIT" ]
null
null
null
use crate::types::Quote; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(tag = "op", content = "data")] pub enum WebSocketInboundEvent { /// Sends information about who is connecting to the websocket and for what intent. /// This operation is required before any other events can be received. Identify { /// The session token which is to be used to identify who is connecting to the socket. token: String, /// What this connection will be used for. intent: WebSocketIntent, }, /// Start the quote after the countdown and start timing. /// This signals the server to start receiving `KeyPress` events. Start, /// Gracefully quit this typing session. Quit, /// Signify that a key was pressed. KeyPress { /// The key which was pressed. key: String, }, } #[derive(Serialize, Deserialize, Clone, Copy, Debug)] pub enum WebSocketIntent { /// Typing practice with quotes. PracticeQuote = 0, } #[derive(Serialize, Deserialize, Clone, Debug)] #[serde(tag = "op", content = "data")] pub enum WebSocketOutboundEvent { /// Send quote data to the client. PracticeQuoteReady { quote: Quote }, /// The user has finished typing the quote - give statistics. PracticeQuoteFinish { wpm: f32, wpm_raw: f32, accuracy: f32, replay: String, errors: u16, }, }
27.942308
94
0.645561
b2b1ff5ef4ba336018262956f57a372c5c93879b
4,312
py
Python
FederatedSDNSecurity/main.py
Beaconproj/CrossCloudVNFSimulation
97023e05b57e54503259ae866608de6189b8c9a9
[ "MIT" ]
1
2021-09-25T04:17:55.000Z
2021-09-25T04:17:55.000Z
FederatedSDNSecurity/main.py
Beaconproj/CrossCloudVNFSimulation
97023e05b57e54503259ae866608de6189b8c9a9
[ "MIT" ]
null
null
null
FederatedSDNSecurity/main.py
Beaconproj/CrossCloudVNFSimulation
97023e05b57e54503259ae866608de6189b8c9a9
[ "MIT" ]
null
null
null
''' Created on 12 janv. 2016 @author: phm ''' import FederatedSDN import FederatedSDNSecurity import FederatedSecurityAgent import VNFManager import CloudManager import ssl, socket inputMessage="Press enter to continue" federationCloudManagers=[] cloudFederationMembers=[ ["cloud_man_1","vnf_manager_1", "network_segment_1", [["" ]],[""]], ["cloud_man_2","vnf_manager_2", "network_segment_2", [[""]],[""]], ["cloud_man_3","vnf_manager_3", "network_segment_3", [[""]],[""]] ] print "-----------Initial setup of Cloud_1, cloud_2 and cloud_3 -----------" cloudMember="" for cloudMember in cloudFederationMembers: # create a cloud manager cloud_manager=CloudManager.CloudManager(cloudMember[0]) print "Cloud manager", cloud_manager.getName(), "in federation" federationCloudManagers.append(cloud_manager) # set the network segments cloud_manager.setNetworkSegments(cloudMember[2]) # create a VNF manager vnfManager=VNFManager.VNFManager(cloudMember[1]) cloud_manager.setVNFManager(vnfManager) print "------------ start Federated SDN ---------------" # create a federated SDN fedSDN=FederatedSDN.FederatedSDN("fedSDN_1") print "FederatedSDN", fedSDN.getIdentifier(), "created" # create a Federated SDN security fedSDNSecurity=FederatedSDNSecurity.FederatedSDNSecurity("fedSDNSec_1") print "FederatedSDNSecurity", fedSDNSecurity.getName(), "created" print "------------- Create a Federated Cloud Network --------------------" # get the network segments to be federated network_segments=["network_segment_1","network_segment_2"] #cloud_member="" #for cloud_member in cloudFederationMembers: # network_segments.append(cloud_member[2]) #print "network segments:", network_segments fedSDN.createNetworkFederation("FedCloudNetwork_1", network_segments) print "Federated network", fedSDN.getNetworkFederationSegments("FedCloudNetwork_1"), "created" # Associate a FederatedSecurityAgent with each network segment" cloudManager="" for cloudManager in federationCloudManagers: network_segment=cloudManager.getNetworkSegments() fedSecAg=FederatedSecurityAgent.FederatedSecurityAgent("fedSecAg_"+network_segment[0]) #print "SecAgent", fedSecAg.getName(), "created" fedSecAg.setVNFManager(cloudManager.getVNFManager()) fedSecAg.setNetworkSegment(cloudManager.getNetworkSegments()) fedSDNSecurity.addSecurityAgent(fedSecAg) #print "----------- Analyse existing security VNF of federation network segments ----------" #print "------------- Adapt VNF to respect global security policy: start new VNF and re-configure existing VNF --------" print "------------- Deploy, configure and start VNF to respect global security policy --------" wait = raw_input(inputMessage) fedSDNSecurity.readYAMLfile("YAML1.txt") #fedSDNSecurity.readYAMLfileV2("Cloud1-2-Heat.yaml") print "-------- Verify that global security policy is correctly implemented in each federation cloud network ----------" wait = raw_input(inputMessage) fedSDNSecurity.verifySecurityPolicy(fedSDN) print "------------- Run the network federation --------------" wait = raw_input(inputMessage) print "VM_1: send packet to VM_2 with protocol HTTP" print "VM_2: received packet from VM_1" print " " print "VM_1: send packet to VM_2 with protocol SKYPE" print "DPI_1: unauthorized protocol detected: SKYPE" print "FW_1: reconfiguring firewall on network network_segment_1 to block SKYPE protocol" print "------------- now add a new network_segment_3 to the federation and extend the security policy--------------" wait = raw_input(inputMessage) # add network segment to federation fedSDN.addNetworkSegment("network_segment_3") print "Federated network", fedSDN.getNetworkFederationSegments("FedCloudNetwork_1"), "extended" fedSDNSecurity.readYAMLfile("YAML2.txt") print "-------- Verify that global security policy is implemented VNF per network Segment ----------" wait = raw_input(inputMessage) fedSDNSecurity.verifySecurityPolicy(fedSDN) print "------------- Run the network federation --------------" wait = raw_input(inputMessage) print "VM_1: send packet to VM_3 with protocol X " print "ENCRYPT_1: VM_3 is in untrusted cloud: encrypt packet" print "DECRYPT_3: packet for VM_3 from VM_1 is encrypted: decrypt packet using key XXX "
30.8
120
0.73539
4a6353bd7fca4de677fc7fbe6710d3c5229029a1
573
js
JavaScript
resources/assets/js/components/icons/svg/Bullhorn.js
poovarasanvasudevan/atlas
209b9b94b92e731f001ce8d1b7ec133d964ac890
[ "MIT" ]
null
null
null
resources/assets/js/components/icons/svg/Bullhorn.js
poovarasanvasudevan/atlas
209b9b94b92e731f001ce8d1b7ec133d964ac890
[ "MIT" ]
null
null
null
resources/assets/js/components/icons/svg/Bullhorn.js
poovarasanvasudevan/atlas
209b9b94b92e731f001ce8d1b7ec133d964ac890
[ "MIT" ]
null
null
null
import React from "react"; const Bullhorn = props => ( <svg width="1em" height="1em" viewBox="0 0 1792 1792" {...props}> <path d="M1664 640q53 0 90.5 37.5T1792 768t-37.5 90.5T1664 896v384q0 52-38 90t-90 38q-417-347-812-380-58 19-91 66t-31 100.5 40 92.5q-20 33-23 65.5t6 58 33.5 55 48 50T768 1566q-29 58-111.5 83T488 1660.5 356 1605q-7-23-29.5-87.5t-32-94.5-23-89-15-101 3.5-98.5 22-110.5H160q-66 0-113-47T0 864V672q0-66 47-113t113-47h480q435 0 896-384 52 0 90 38t38 90v384zm-128 604V290q-394 302-768 343v270q377 42 768 341z" /> </svg> ); export default Bullhorn;
57.3
410
0.705061
d046c8abff12656cf27b8eda68e6ba3fc7f90a42
10,488
css
CSS
data/usercss/118194.user.css
33kk/uso-archive
2c4962d1d507ff0eaec6dcca555efc531b37a9b4
[ "MIT" ]
118
2020-08-28T19:59:28.000Z
2022-03-26T16:28:40.000Z
data/usercss/118194.user.css
33kk/uso-archive
2c4962d1d507ff0eaec6dcca555efc531b37a9b4
[ "MIT" ]
38
2020-09-02T01:08:45.000Z
2022-01-23T02:47:24.000Z
data/usercss/118194.user.css
33kk/uso-archive
2c4962d1d507ff0eaec6dcca555efc531b37a9b4
[ "MIT" ]
21
2020-08-19T01:12:43.000Z
2022-03-15T21:55:17.000Z
/* ==UserStyle== @name PW Vanilla RU alfа @namespace USO Archive @author Navalimba @description `Я рукожопорук и вообще плохо представляю, что такое css. Взял "PW Vanilla Readability Upgrade" и просто натыкал еще, как попало. Просто потому, что могу. Всё очень сыро и не доделано, но, по крайней мере, мои глаза не кровоточат, при чтении постов.Upd: нормальный стиль другого автора https://userstyles.org/styles/118275/arc-vanilla-neverwiterСкачивайте его.` @version 20150830.20.37 @license NO-REDISTRIBUTION @preprocessor uso ==/UserStyle== */ @-moz-document domain("arcgames.com") { /* apply new main font color (grey) */ body, p, textarea { font-family: sans-serif !important; font-size: 15px !important; /* background: #0b0605; */ background: #000000; background-position: bottom; background-image: url("http://ricardo.ishibashi.com.br/neverwinter/img/main-background-footer.jpg") !important; background-repeat: no-repeat; } #Head { background: #0b0605; background-image: url("http://ricardo.ishibashi.com.br/neverwinter/img/main-background.jpg") !important; background-position: 0% 35%; text-align:center; /* height:150px !important; */ } /* background colors */ div * { background-color: transparent !important; } .Announcement { background-color: #1d110E !important; } .ButtonBar, .cleditorToolbar, .cleditorMain { background-color: #ff0000 !important; } .Breadcrumbs, .UserQuote, .UserSpoiler, .HasNew, pre { background-color: #14110F !important; } .Row, .ItemDiscussion, .TextBox, .InputBox, .PopList, .Dropdown, .Flyout, .tipsy { background-color: #1C110E !important; } /* adjust post tags */ .QnA-Tag-Answered, .QnA-Tag-Accepted, .QnA-Accepted { background: #56AB56 none repeat scroll 0% 0%; color: #00FF2A; } .Tag-Closed { background: #9D2E2E none repeat scroll 0% 0%; color: #D35429; font-size: 10pt !important; } .QnA-Tag-Question { background: #fba000 none repeat scroll 0% 0%; color: #ffa200; } .Tag-Announcement { background: #4e7edb none repeat scroll 0% 0%; color: #ffa200; } .NewCommentCount { background: #1C110E none repeat scroll 0% 0%; color: #ffa200; font-size: 10pt !important; } div.Message:hover, div.Item-Body:hover { background: #1C110E; } div.Message, div.Item-Body { background: #1C110E; } div.Comment { background: #1C110E; } .ItemDiscussion, .Comment, .Activities > .Activity, .MessageList > li, .Item-Search { background: #1C110E; padding: 5px; } /* Changes to pretty the avatar area */ .AuthorWrap > .Author .ProfilePhotoMedium { width:auto !important; height:auto; max-width: 125px !important; max-height:150px !important; border:0px solid #000; } .CommentHeader .AuthorWrap, .CommentHeader .AuthorWrap > .Author { text-align:center; } .Comment .CommentInfo { display:block; background-color:rgba(255,255,255,0.05); padding:3px 3px 2px 3px; border-radius:5px; text-align:center; } body { /* цвет шрифта сообщений */ color: #c0c0bc; } .Button { color: #C3C3C3; } .NavButton { color: #A7A7A7; text-shadow: none; } .HomepageTitle { color: #A7A7A7; } #Head { color: #A7A7A7; } .ChildCategoryList .ItemContent { padding: 0; } /* new warning message */ .WarningMessage { background: #bbb; border: none; } /* make quotes separate from other text */ blockquote.UserQuote { /* цвет фона цитаты, */ background: rgba(20, 17, 15, 1); /* цвет полосы слева от цитаты и ширина в пикселах */ border-left: 2px solid rgba(80, 80, 80, 1); border-right: 2px solid rgba(80, 80, 80, 0.5); border-top: 2px solid rgba(80, 80, 80, 1); border-bottom: 2px solid rgba(80, 80, 80, 0.5); border-radius:5px; } blockquote.Quote:hover { box-shadow:0 0 8px 2px rgba(255,255,255,0.4); } /* add borders to improve visibility */ .UserSignature { border-top: 1px solid rgba(80, 80, 80, 1); } .Separator { background: rgba(80, 80, 80, 1); } .BoxTop { border: 1px solid rgba(80, 80, 80, 1); } .DataList .Item { border: 1px solid rgba(80, 80, 80, 1); } .ItemDiscussion { border: 1px solid rgba(80, 80, 80, 1); } .FormWrapper { border: 1px solid rgba(80, 80, 80, 1); } .Box { border: 1px solid rgba(80, 80, 80, 1); } .DataTableWrap { border: 1px solid rgba(80, 80, 80, 1); } /* Fixes codebox colors */ pre { background-color:rgba(255,255,255,0.025); border-radius:5px; border: 1px solid rgba(80, 80, 80, 1); } pre:hover { box-shadow:0 0 8px 2px rgba(255,255,255,0.4); } div.SpoilerTitle input { color: #000; } .SpoilerText > pre { background-color:rgba(80,80,80,0.5); } div.UserSpoiler { background-color: rgba(55, 55, 55, 0.5); } .UserSpoiler:hover { box-shadow:0 0 8px 2px rgba(255,255,255,0.4); } /* Stop overly large image displays */ .Signature.UserSignature img { width:auto; height:auto; max-width:500px; max-height:150px; } /* Adds page listing to bottom of page */ #PagerAfter { display:block !important; } /* Fixes "Post Edited" message color (less intense) */ div.PostEdited { color: rgba(255,128,128,0.5); } /* show icons properly (they used FFFFFF instead of ffffff - credit to dblazen1 for finding this one */ .ReactSprite { background-image: url("http://perfectworld.vanillaforums.com/applications/dashboard/design/images/sprites-14-ffffff.png") !important; } /* Fixes bookmarked threads */ .Bookmarked::before { display:none; } a.Bookmarked::before { display:inline-block; font-family:"vanillicon"; font-variant:normal; font-weight:normal; font-style:normal; color:#FFF; min-width:1em; text-align:center; text-decoration:inherit; text-transform:none; line-height:1; -webkit-font-smoothing:antialiased; content: "\f199"; } /* new link colors and link related */ a { color: #6C89C1; } a:hover { text-decoration: underline; color: #6C89C1; } #Head a { color: #6C89C1; font-weight: normal; } .MiniPager a { text-decoration: underline; color: #6C89C1; } .MiniPager span { color: #6C89C1; } a.Bookmark { text-decoration: none; } .BlockTitle { font-size: 13px; font-weight: normal; } .UserLink { color: #A7A7A7; } .SiteMenu a { font-size: 13px; } /* other unspecific changes (or can't remember what they do...) */ .ProfilePhoto { border: 0px solid #000; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px; } /* smoother profile pic */ .CategoryTable .ChildCategories { font-size: 13px; } mark { background: rgba(88, 88, 88, 1); } .Preview { background: rgba(0, 0, 0, 0.03); color: #fff; } .DataList > li { margin-bottom: 5px !important; } #Form_Search { background-color: rgba(80, 80, 80, 1); } #Form_Go { margin-top: 2px; } .Button:hover { text-decoration: none; } .NavButton:hover { text-decoration: none; color: #fff; } .Profile > .DataListWrap > .FormWrapper { margin-bottom: 5px; } ul.Conversation > li > .ConversationMessage > .Message { margin-top: 25px; /* places pm message under profile pic */ } .ProfilePhotoSmall { display: none; /* do not display profile pics on last posts on categories */ } .UserBox .Username, .MeBox .Username { font-size: 20px; /* adjusts font size to the profile pic */ } tbody td.BigCount { font-size: 14px; /* bring count size in line */ } .DiscussionHeader .DiscussionMeta { margin-bottom: 20px; border-bottom: 1px solid rgba(80, 80, 80, 1); padding-bottom: 40px; } /* adjust profile post area */ .CommentHeader .ProfilePhotoMedium, .DiscussionHeader .ProfilePhotoMedium { height: 75px; width: 75px; } .CommentHeader .PhotoWrap.Online .ProfilePhoto, .DiscussionHeader .PhotoWrap.Online .ProfilePhoto { border-bottom: 3px solid #6C89C1; } .CommentHeader .PhotoWrap.Offline .ProfilePhoto, .DiscussionHeader .PhotoWrap.Offline .ProfilePhoto { border-bottom: 3px solid #6C89C1; } .CommentHeader .AuthorTitle { display: block; } .AuthorTitle { /* color: #fba000; */ color: #e58b00; } .MItem.Category { display: block; } .MItem { margin-left: 0px; } /* Fixes awful look of subforum categories subforums of thread lists */ .ChildCategoryList { padding:20px 0; } .ChildCategoryList .Item { box-sizing:border-box; width:24%; height:160px; margin:0 3px; overflow:hidden; box-shadow:0 0 4px 0px #000; } .ChildCategoryList .Item:nth-child(odd) { clear:none; } .ChildCategoryList .Item h3.CategoryName { height:40px; display:block; margin-bottom:8px; padding-top:4px; padding-bottom:6px; text-align:center; border-bottom:1px solid #222224; background-color:#222224; } .ChildCategoryList .Item div.CategoryDescription { font-size:0.8em; line-height:1.3em; padding:0 10px; } .ChildCategoryList .ItemContent { padding:0; vertical-align:top; } .DataList.ChildCategoryList > li.Item { margin-bottom:6px !important; border-radius:10px 4px 10px 4px; position:relative; } .ChildCategoryList .Item .Meta.Hidden { display:block; overflow:hidden; /*padding-top:10px;*/ position:absolute; width:95%; padding:0 10px; bottom:0; } .ChildCategoryList .Item .Meta.Hidden .MItem { display:inline-block; width:45%; overflow:visible; position:relative; } .ChildCategoryList .Item .Meta.Hidden .MItem.CommentCount { text-align:right; } }
16.361934
377
0.605549
dd3440e38443e09d0fb3b780c7ca83f8d906bb67
8,579
go
Go
x/auction/keeper/grpc_query_test.go
fission-suite/ethermint
dbaaef07c7505e6ad20da6e7bf57259fd57d2a98
[ "Apache-2.0" ]
null
null
null
x/auction/keeper/grpc_query_test.go
fission-suite/ethermint
dbaaef07c7505e6ad20da6e7bf57259fd57d2a98
[ "Apache-2.0" ]
null
null
null
x/auction/keeper/grpc_query_test.go
fission-suite/ethermint
dbaaef07c7505e6ad20da6e7bf57259fd57d2a98
[ "Apache-2.0" ]
1
2022-01-05T04:51:21.000Z
2022-01-05T04:51:21.000Z
package keeper_test import ( "context" "fmt" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/tharsis/ethermint/app" "github.com/tharsis/ethermint/x/auction/types" ) const testCommitHash = "71D8CF34026E32A3A34C2C2D4ADF25ABC8D7943A4619761BE27F196603D91B9D" func (suite *KeeperTestSuite) TestGrpcGetAllAuctions() { client, ctx, k := suite.queryClient, suite.ctx, suite.app.AuctionKeeper testCases := []struct { msg string req *types.AuctionsRequest createAuctions bool auctionCount int }{ { "fetch auctions when no auctions exist", &types.AuctionsRequest{}, false, 0, }, { "fetch auctions with one auction created", &types.AuctionsRequest{}, true, 1, }, } for _, test := range testCases { suite.Run(fmt.Sprintf("Case %s", test.msg), func() { if test.createAuctions { account := app.CreateRandomAccounts(1)[0] err := simapp.FundAccount(suite.app.BankKeeper, ctx, account, sdk.NewCoins( sdk.Coin{Amount: sdk.NewInt(100), Denom: sdk.DefaultBondDenom}, )) _, err = k.CreateAuction(ctx, types.NewMsgCreateAuction(k.GetParams(ctx), account)) suite.Require().NoError(err) } resp, _ := client.Auctions(context.Background(), test.req) suite.Require().Equal(test.auctionCount, len(resp.GetAuctions().Auctions)) }) } } func (suite *KeeperTestSuite) TestGrpcQueryParams() { testCases := []struct { msg string req *types.QueryParamsRequest }{ { "fetch params", &types.QueryParamsRequest{}, }, } for _, test := range testCases { suite.Run(fmt.Sprintf("Case %s", test.msg), func() { resp, err := suite.queryClient.QueryParams(context.Background(), test.req) suite.Require().Nil(err) suite.Require().Equal(*(resp.Params), types.DefaultParams()) }) } } func (suite *KeeperTestSuite) TestGrpcGetAuction() { testCases := []struct { msg string req *types.AuctionRequest createAuction bool }{ { "fetch auction with empty auction ID", &types.AuctionRequest{}, false, }, { "fetch auction with valid auction ID", &types.AuctionRequest{}, true, }, } for _, test := range testCases { suite.Run(fmt.Sprintf("Case %s", test.msg), func() { if test.createAuction { auction, _, err := suite.createAuctionAndCommitBid(false) suite.Require().NoError(err) test.req.Id = auction.Id } resp, err := suite.queryClient.GetAuction(context.Background(), test.req) if test.createAuction { suite.Require().Nil(err) suite.Require().NotNil(resp.GetAuction()) suite.Require().Equal(test.req.Id, resp.GetAuction().Id) } else { suite.Require().NotNil(err) suite.Require().Error(err) } }) } } func (suite *KeeperTestSuite) TestGrpcGetBids() { testCases := []struct { msg string req *types.BidsRequest createAuction bool commitBid bool bidCount int }{ { "fetch all bids when no auction exists", &types.BidsRequest{}, false, false, 0, }, { "fetch all bids for valid auction but no added bids", &types.BidsRequest{}, true, false, 0, }, { "fetch all bids for valid auction and valid bid", &types.BidsRequest{}, true, true, 1, }, } for _, test := range testCases { suite.Run(fmt.Sprintf("Case %s", test.msg), func() { if test.createAuction { auction, _, err := suite.createAuctionAndCommitBid(test.commitBid) suite.Require().NoError(err) test.req.AuctionId = auction.Id } resp, err := suite.queryClient.GetBids(context.Background(), test.req) if test.createAuction { suite.Require().Nil(err) suite.Require().Equal(test.bidCount, len(resp.GetBids())) } else { suite.Require().NotNil(err) suite.Require().Error(err) } }) } } func (suite *KeeperTestSuite) TestGrpcGetBid() { testCases := []struct { msg string req *types.BidRequest createAuctionAndBid bool }{ { "fetch bid when bid does not exist", &types.BidRequest{}, false, }, { "fetch bid when valid bid exists", &types.BidRequest{}, true, }, } for _, test := range testCases { suite.Run(fmt.Sprintf("Case %s", test.msg), func() { if test.createAuctionAndBid { auction, bid, err := suite.createAuctionAndCommitBid(test.createAuctionAndBid) suite.Require().NoError(err) test.req.AuctionId = auction.Id test.req.Bidder = bid.BidderAddress } resp, err := suite.queryClient.GetBid(context.Background(), test.req) if test.createAuctionAndBid { suite.Require().NoError(err) suite.Require().NotNil(resp.Bid) suite.Require().Equal(test.req.Bidder, resp.Bid.BidderAddress) } else { suite.Require().NotNil(err) suite.Require().Error(err) } }) } } func (suite *KeeperTestSuite) TestGrpcGetAuctionsByBidder() { testCases := []struct { msg string req *types.AuctionsByBidderRequest createAuctionAndCommitBid bool auctionCount int }{ { "get auctions by bidder with invalid bidder address", &types.AuctionsByBidderRequest{}, false, 0, }, { "get auctions by bidder with valid auction and bid", &types.AuctionsByBidderRequest{}, true, 1, }, } for _, test := range testCases { suite.Run(fmt.Sprintf("Case %s", test.msg), func() { if test.createAuctionAndCommitBid { _, bid, err := suite.createAuctionAndCommitBid(test.createAuctionAndCommitBid) suite.Require().NoError(err) test.req.BidderAddress = bid.BidderAddress } resp, err := suite.queryClient.AuctionsByBidder(context.Background(), test.req) if test.createAuctionAndCommitBid { suite.Require().NoError(err) suite.Require().NotNil(resp.Auctions) suite.Require().Equal(test.auctionCount, len(resp.Auctions.Auctions)) } else { suite.Require().NotNil(err) suite.Require().Error(err) } }) } } func (suite *KeeperTestSuite) TestGrpcGetAuctionsByOwner() { testCases := []struct { msg string req *types.AuctionsByOwnerRequest createAuction bool auctionCount int }{ { "get auctions by owner with invalid owner address", &types.AuctionsByOwnerRequest{}, false, 0, }, { "get auctions by owner with valid auction", &types.AuctionsByOwnerRequest{}, true, 1, }, } for _, test := range testCases { suite.Run(fmt.Sprintf("Case %s", test.msg), func() { if test.createAuction { auction, _, err := suite.createAuctionAndCommitBid(false) suite.Require().NoError(err) test.req.OwnerAddress = auction.OwnerAddress } resp, err := suite.queryClient.AuctionsByOwner(context.Background(), test.req) if test.createAuction { suite.Require().NoError(err) suite.Require().NotNil(resp.Auctions) suite.Require().Equal(test.auctionCount, len(resp.Auctions.Auctions)) } else { suite.Require().NotNil(err) suite.Require().Error(err) } }) } } func (suite KeeperTestSuite) TestGrpcQueryBalance() { testCases := []struct { msg string req *types.BalanceRequest createAuction bool auctionCount int }{ { "get balance with no auctions created", &types.BalanceRequest{}, false, 0, }, { "get balance with single auction created", &types.BalanceRequest{}, true, 1, }, } for _, test := range testCases { if test.createAuction { _, _, err := suite.createAuctionAndCommitBid(true) suite.Require().NoError(err) } resp, err := suite.queryClient.Balance(context.Background(), test.req) suite.Require().NoError(err) suite.Require().Equal(test.auctionCount, len(resp.GetBalance())) } } func (suite *KeeperTestSuite) createAuctionAndCommitBid(commitBid bool) (*types.Auction, *types.Bid, error) { ctx, k := suite.ctx, suite.app.AuctionKeeper accCount := 1 if commitBid { accCount++ } accounts := app.CreateRandomAccounts(accCount) for _, account := range accounts { err := simapp.FundAccount(suite.app.BankKeeper, ctx, account, sdk.NewCoins( sdk.Coin{Amount: sdk.NewInt(100), Denom: sdk.DefaultBondDenom}, )) if err != nil { return nil, nil, err } } auction, err := k.CreateAuction(ctx, types.NewMsgCreateAuction(k.GetParams(ctx), accounts[0])) if err != nil { return nil, nil, err } if commitBid { bid, err := k.CommitBid(ctx, types.NewMsgCommitBid(auction.Id, testCommitHash, accounts[1])) if err != nil { return nil, nil, err } return auction, bid, nil } return auction, nil, nil }
24.098315
109
0.65707
fec4cbfcb5cc24cb438611ee936ec1a9ae873d22
4,769
html
HTML
changelogs/README.html
rockyroadshub/event-planner
837e98784e7cf3afebe727baff70769f8da2949b
[ "Apache-2.0" ]
null
null
null
changelogs/README.html
rockyroadshub/event-planner
837e98784e7cf3afebe727baff70769f8da2949b
[ "Apache-2.0" ]
null
null
null
changelogs/README.html
rockyroadshub/event-planner
837e98784e7cf3afebe727baff70769f8da2949b
[ "Apache-2.0" ]
null
null
null
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>README</title> <style type="text/css">/*...*/</style> </head> <body> <h1>Event Planner 0.2.2</h1> <hr> <p>Copyright 2016 Arnell Christoper D. Dalid</p> <p>Event Planner is a simple and comprehensive application that saves data into a database. This application is purely written in Java and uses <a href="https://db.apache.org/derby/">Apache Derby Database</a> as a database backend. </p> <p> Event Planner is licensed under the <strong>Apache License, Version 2.0</strong>. For usage, distribution and reproduction of this software, please see <a href="http://www.apache.org/licenses/LICENSE-2.0">LICENSE</a> </p> <h2>Changelogs</h2> <h3>[0.2.2] September 21, 2016</h3> <p><strong>Fixes:</strong></p> <ul> <li>New set of icons (from <a href="http://www.aha-soft.com/">Aha-Soft</a>)</li> <li>Improved Events Display</li> <li>Can now detect if a newly created event overlaps an existing event</li> </ul> <p>---------------- End of Log ----------------</p> <h3>[0.2.1] September 16, 2016</h3> <p><strong>Fixes:</strong></p> <ul> <li>Set GUI's Look and Feel by the system's default look and feel (varies depending on OS)</li> </ul> <p>---------------- End of Log ----------------</p> <h3>[0.2.0] September 13, 2016</h3> <p><strong>New Features:</strong> </p> <ul> <li>Added a splash screen (For systematic monitoring and loading files)</li> <li>User can now see the date (and time) in real-time. (Still depends on user's computer)</li> <li>Added Changelog Pane</li> </ul> <p><strong>Modifications</strong> </p> <ul> <li>Properties Panel can now change the color of the default day, weekday, text foreground, and set of icons (set as <em>default</em>) to be loaded (in the calendar)</li> <li>Systematic loading of files and memories for database</li> <li>Set the date panel GUI from <em>MigLayout</em> to <em>GridLayout(7 by 7)</em></li> </ul> <p><strong>To do's:</strong></p> <ul> <li>Plugin support</li> <li>Smart notifications</li> <li>Real time alarm (for registered schedules/events)</li> <li>Improve GUI (Look and Feel support)</li> <li>System tray (Windows)</li> <li>Error Handling</li> <li>Update Java docs</li> <li>Holiday memory database</li> <li>Contacts memory database</li> </ul> <p>---------------- End of Log ----------------</p> <h3>[0.1.1] August 30, 2016</h3> <p><strong>Fixes:</strong> </p> <ul> <li>Added JOptionPane when saving properties</li> <li>Can now revert properties to default</li> </ul> <p>---------------- End of Log ----------------</p> <h3>[0.1.0] August 29, 2016</h3> <p><strong>New Features:</strong> </p> <ul> <li>New panel: Properties (can now change the color of the current day (foreground) and the color of the day with a registered event (background) and save it in the <em>planner.properties</em>)</li> <li>Creates the properties file <em>planner.properties</em> if it doesn't exist</li> <li>Can now delete events in a month and date (e.g. delete all events in August 2016)</li> <li>Separated button icon source files outside jar file for easier customization</li> <li>Separated <em>database libraries</em> for accessing (preparation for plugin support)</li> <li>Added border per panel (for easier identification)</li> </ul> <p><strong>Modifications</strong> </p> <ul> <li>Implemented Data Mapper Pattern to database system</li> <li>Updated java docs from database libraries</li> <li>Improved systematic loading of GUI panels</li> </ul> <p><strong>To do's:</strong> </p> <ul> <li>Plugin support</li> <li>Smart notifications</li> <li>Real time alarm (for registered schedules/events)</li> <li>Improve GUI (Look and Feel support)</li> <li>Improve loading of source files (e.g. icons,background images, etc..)</li> <li>System tray (Windows)</li> <li>Error Handling</li> <li>Update Java docs</li> <li>Holiday memory database</li> <li>Contacts memory database</li> </ul> <p>---------------- End of Log ----------------</p> <h3>[0.0.0] August 20, 2016</h3> <p><strong>To do's:</strong> </p> <ul> <li>Plugin support</li> <li>Smart notifications</li> <li>Alarm</li> <li>Settings for easier customization</li> <li>Improve GUI (Look and Feel support)</li> <li>Systematic loading of source files</li> <li>Overview panel</li> <li>System tray (Windows)</li> <li>Error handling</li> <li>Java Docs</li> </ul> <p>---------------- End of Log ----------------</p> <p><a href="https://rockyroadshub.wordpress.com">Please visit Rocky Roads Hub!</a></p> <p> <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=GC2JCL8FAZJQN"> <img src="src/paypal.gif" alt="Donate" border="0"/></a> </p> </body> </html>
38.459677
200
0.659887
9bee59299379d44a0e2f8cab0d98f9fa234ffb16
398
js
JavaScript
widgets/Splash/nls/tr/strings.js
ljlopez/ljlopez.github.io
164073aab23549e3c818e79ed9e066eb46cdb492
[ "Apache-2.0" ]
1
2022-01-26T22:44:11.000Z
2022-01-26T22:44:11.000Z
widgets/Splash/nls/tr/strings.js
ljlopez/ljlopez.github.io
164073aab23549e3c818e79ed9e066eb46cdb492
[ "Apache-2.0" ]
null
null
null
widgets/Splash/nls/tr/strings.js
ljlopez/ljlopez.github.io
164073aab23549e3c818e79ed9e066eb46cdb492
[ "Apache-2.0" ]
1
2022-02-11T21:09:24.000Z
2022-02-11T21:09:24.000Z
define({ "_widgetLabel": "Sıçratma", "welcomeMessage": "ArcGIS Web Uygulamasına Hoş Geldiniz!", "licenceAgree": "Şunu kabul ediyorum", "licenceTerm": "ArcGIS Web Uygulaması Koşulları", "labelContinue": "Devam", "errorString": "* Devam edebilmek için lisansı kabul etmelisiniz.", "notShowAgain": "Bu giriş ekranını yeniden gösterme.", "ok": "TAMAM", "cancel": "İptal" });
36.181818
70
0.678392
38a3eab2fa5350ec007a20bbec39bce90d2bf854
3,474
h
C
ActionManager/ActionInterval/RepeatAction.h
Furkanzmc/ofxCocos
4fa67a8e8ef59b67358561eb12f0de7dd746e2f9
[ "Unlicense" ]
null
null
null
ActionManager/ActionInterval/RepeatAction.h
Furkanzmc/ofxCocos
4fa67a8e8ef59b67358561eb12f0de7dd746e2f9
[ "Unlicense" ]
null
null
null
ActionManager/ActionInterval/RepeatAction.h
Furkanzmc/ofxCocos
4fa67a8e8ef59b67358561eb12f0de7dd746e2f9
[ "Unlicense" ]
1
2020-04-17T22:25:16.000Z
2020-04-17T22:25:16.000Z
#ifndef REPEATACTION_H #define REPEATACTION_H #include "../ActionInterval.h" OFXCOCOS_NS_BEGIN ACTIONS_NS_BEGIN /** @class Repeat * @brief Repeats an action a number of times. * To repeat an action forever use the RepeatForever action. */ class Repeat : public ActionInterval { public: /** Creates a Repeat action. Times is an unsigned integer between 1 and pow(2,30). * * @param action The action needs to repeat. * @param times The repeat times. * @return An autoreleased Repeat object. */ static Repeat *create(FiniteTimeAction *action, unsigned int times); /** Sets the inner action. * * @param action The inner action. */ inline void setInnerAction(FiniteTimeAction *action) { if (m_InnerAction != action) { SAFE_RELEASE(m_InnerAction); m_InnerAction = action; } } /** Gets the inner action. * * @return The inner action. */ inline FiniteTimeAction *getInnerAction() { return m_InnerAction; } // // Overrides // virtual Repeat *clone() const override; virtual Repeat *reverse() const override; virtual void startWithTarget(Node *target) override; virtual void stop(void) override; /** * @param dt In seconds. */ virtual void update(float dt) override; virtual bool isDone(void) const override; public: Repeat() {} virtual ~Repeat(); /** initializes a Repeat action. Times is an unsigned integer between 1 and pow(2,30) */ bool initWithAction(FiniteTimeAction *pAction, unsigned int times); protected: unsigned int m_Times; unsigned int m_Total; float m_NextDt; bool m_ActionInstant; /** Inner action */ FiniteTimeAction *m_InnerAction; private: DISALLOW_COPY_AND_ASSIGN(Repeat); }; /** @class RepeatForever * @brief Repeats an action for ever. To repeat the an action for a limited number of times use the Repeat action. * @warning This action can't be Sequenceable because it is not an IntervalAction. */ class RepeatForever : public ActionInterval { public: /** Creates the action. * * @param action The action need to repeat forever. * @return An autoreleased RepeatForever object. */ static RepeatForever *create(ActionInterval *action); /** Sets the inner action. * * @param action The inner action. */ inline void setInnerAction(ActionInterval *action) { if (m_InnerAction != action) { SAFE_RELEASE(m_InnerAction); m_InnerAction = action; } } /** Gets the inner action. * * @return The inner action. */ inline ActionInterval *getInnerAction() { return m_InnerAction; } // // Overrides // virtual RepeatForever *clone() const override; virtual RepeatForever *reverse(void) const override; virtual void startWithTarget(Node *target) override; /** * @param dt In seconds. */ virtual void step(float dt) override; virtual bool isDone(void) const override; public: RepeatForever() : m_InnerAction(nullptr) {} virtual ~RepeatForever(); /** initializes the action */ bool initWithAction(ActionInterval *action); protected: /** Inner action */ ActionInterval *m_InnerAction; private: DISALLOW_COPY_AND_ASSIGN(RepeatForever); }; ACTIONS_NS_END OFXCOCOS_NS_END #endif // REPEATACTION_H
23.958621
92
0.654289
cb10b62a1989e0b289c0d7cdd9a014bc4e43fe26
2,550
go
Go
gwc_test.go
mandalorian-one/geoserver
8c0a12ee084685297a3fe988f94dc59b60df15e9
[ "MIT" ]
null
null
null
gwc_test.go
mandalorian-one/geoserver
8c0a12ee084685297a3fe988f94dc59b60df15e9
[ "MIT" ]
null
null
null
gwc_test.go
mandalorian-one/geoserver
8c0a12ee084685297a3fe988f94dc59b60df15e9
[ "MIT" ]
null
null
null
package geoserver import ( "github.com/stretchr/testify/assert" "strings" "testing" ) const ( gwcTestStoreName = "sfdem_test" ) func gwcTestPrecondition(t *testing.T) { ws := testConfig.Geoserver.Workspace _, err := gsCatalog.CreateWorkspace(ws) if err != nil && !strings.Contains(err.Error(), "already exists") { assert.Fail(t, "can't create workspace as a precondition for FeatureTypes test") } //creating coverageStore if doesn't exist coverageStore := CoverageStore{ Name: gwcTestStoreName, Description: gwcTestStoreName, Type: "GeoTIFF", URL: "file:" + testConfig.TestData.GeoTiff, Workspace: &Resource{ Name: ws, }, Enabled: true, } _, err = gsCatalog.CreateCoverageStore(ws, coverageStore) if err != nil && !strings.Contains(err.Error(), "exists") { assert.Fail(t, "can't create coverage store", err.Error()) } _, err = gsCatalog.PublishCoverage(ws, gwcTestStoreName, testConfig.TestData.CoverageName, "") assert.Nil(t, err) } func gwcTestPostcondition() { _, _ = gsCatalog.DeleteWorkspace(testWorkspace, true) } func TestParseRespData(t *testing.T) { testData := []byte("{\"long-array-array\":[[3296,6624,124,57,2],[3296,6624,1,58,2],[-1,-1,-2,59,2],[3264,6624,180,60,2],[3328,6624,-1,61,2],[-1,-1,-2,62,2]]}") tasks, err := GeoServer{}.parseRespData(testData) if err != nil { t.Fatalf("parseError: %v", err.Error()) } if len(tasks) != 6 { t.Fatalf("got array of %v instdead %v", len(tasks), 6) } task1 := GwcTask{ Id: 57, Status: GwcTaskDone, TilesProcessed: 3296, TilesTotal: 6624, TilesRemaining: 124, } if tasks[0] != task1 { t.Fatalf("wrong parsed data") } } func TestGwcTasks(t *testing.T) { test_before(t) //precondition gwcTestPrecondition(t) defer func() { gwcTestPostcondition() }() tasks, err := gsCatalog.GwcTasks(testConfig.Geoserver.Workspace, testConfig.TestData.CoverageName) assert.Nil(t, err) assert.True(t, len(tasks) == 0) } func TestGwcSeed(t *testing.T) { test_before(t) //precondition gwcTestPrecondition(t) defer func() { gwcTestPostcondition() }() seedRq := GwcSeedRequest{ GridsetId: "EPSG:900913", Format: "image/jpeg", Type: "seed", ZoomStart: 0, ZoomStop: 10, } err := gsCatalog.GwcSeedRequest(testConfig.Geoserver.Workspace, testConfig.TestData.CoverageName, seedRq) assert.Nil(t, err) tasks, err := gsCatalog.GwcTasks(testConfig.Geoserver.Workspace, testConfig.TestData.CoverageName) assert.Nil(t, err) assert.True(t, len(tasks) != 0) }
23.394495
160
0.678824
c494365aaa02a3852e8c65bb4a185b94ebda2758
4,125
h
C
src/LickportArrayController/Constants.h
peterpolidoro/LickportArrayController
e4bc44b6a39ce5f843c7b969c2b39bc6e43a43b6
[ "BSD-3-Clause" ]
null
null
null
src/LickportArrayController/Constants.h
peterpolidoro/LickportArrayController
e4bc44b6a39ce5f843c7b969c2b39bc6e43a43b6
[ "BSD-3-Clause" ]
null
null
null
src/LickportArrayController/Constants.h
peterpolidoro/LickportArrayController
e4bc44b6a39ce5f843c7b969c2b39bc6e43a43b6
[ "BSD-3-Clause" ]
1
2021-04-23T15:15:35.000Z
2021-04-23T15:15:35.000Z
// ---------------------------------------------------------------------------- // Constants.h // // // Authors: // Peter Polidoro peter@polidoro.io // ---------------------------------------------------------------------------- #ifndef LICKPORT_ARRAY_CONTROLLER_CONSTANTS_H #define LICKPORT_ARRAY_CONTROLLER_CONSTANTS_H #include <ConstantVariable.h> #include <DigitalController.h> namespace lickport_array_controller { namespace constants { //MAX values must be >= 1, >= created/copied count, < RAM limit enum{PROPERTY_COUNT_MAX=7}; enum{PARAMETER_COUNT_MAX=4}; enum{FUNCTION_COUNT_MAX=12}; enum{CALLBACK_COUNT_MAX=4}; extern ConstantString device_name; extern ConstantString firmware_name; extern const modular_server::FirmwareInfo firmware_info; extern ConstantString hardware_name; extern const modular_server::HardwareInfo hardware_info; extern const double dispense_power; extern const long lickport_count; extern const long channel_count; extern const size_t sync_channel; extern const size_t sync_delay; extern const size_t sync_count; enum{LICK_DATUM_COUNT_MAX=100}; extern ConstantString lick_datum_time; extern ConstantString lick_datum_millis; extern ConstantString lick_datum_lickports_licked; extern ConstantString lick_datum_lickports_activated; extern const long duration_min; extern const long duration_max; // Pins extern ConstantString change_pin_name; extern const size_t change_pin_number; extern ConstantString lick_detected_pin_name; extern const size_t lick_detected_pin_number; extern const size_t lick_detected_pulse_duration; // Units // Properties // Property values must be long, double, bool, long[], double[], bool[], char[], ConstantString *, (ConstantString *)[] extern ConstantString sync_period_min_property_name; extern const long sync_period_min_default; extern ConstantString sync_period_max_property_name; extern const long sync_period_max_default; extern ConstantString sync_on_duration_property_name; extern const long sync_on_duration_default; extern ConstantString dispense_delays_property_name; extern const long dispense_delay_min; extern const long dispense_delay_max; extern const long dispense_delay_default; extern ConstantString dispense_periods_property_name; extern const long dispense_period_min; extern const long dispense_period_max; extern const long dispense_period_default; extern ConstantString dispense_counts_property_name; extern const long dispense_count_min; extern const long dispense_count_max; extern const long dispense_count_default; extern ConstantString activated_dispense_durations_property_name; extern const long activated_dispense_duration_default; // Parameters extern ConstantString lickport_parameter_name; extern const long lickport_min; extern ConstantString lickports_parameter_name; extern const long lickports_array_length_min; extern ConstantString dispense_duration_parameter_name; extern ConstantString dispense_durations_parameter_name; extern const long dispense_durations_array_length_min; // Functions extern ConstantString dispense_lickport_for_duration_function_name; extern ConstantString dispense_lickports_for_duration_function_name; extern ConstantString dispense_lickports_for_durations_function_name; extern ConstantString dispense_all_lickports_for_duration_function_name; extern ConstantString get_activated_lickports_function_name; extern ConstantString activate_only_lickport_function_name; extern ConstantString activate_only_lickports_function_name; extern ConstantString activate_lickport_function_name; extern ConstantString activate_lickports_function_name; extern ConstantString deactivate_lickport_function_name; extern ConstantString deactivate_lickports_function_name; extern ConstantString get_and_clear_lick_data_function_name; // Callbacks extern ConstantString calibrate_lick_sensor_callback_name; extern ConstantString manage_lick_status_change_callback_name; extern ConstantString activate_all_lickports_callback_name; extern ConstantString deactivate_all_lickports_callback_name; // Errors } } #include "TEENSY40.h" #include "TEENSY41.h" #include "5x3.h" #include "3x2.h" #endif
31.730769
119
0.836121
31f1e638594b126919fb5b25385de1d366ea1adc
5,932
lua
Lua
tank.lua
71460-4-F/Tank_WTISC_UFC
0b88988b1774c3441a8478c037a93c722423816a
[ "MIT" ]
null
null
null
tank.lua
71460-4-F/Tank_WTISC_UFC
0b88988b1774c3441a8478c037a93c722423816a
[ "MIT" ]
1
2019-02-05T00:04:02.000Z
2019-02-05T00:04:02.000Z
tank.lua
71460-4-F/Tank_WTISC_UFC
0b88988b1774c3441a8478c037a93c722423816a
[ "MIT" ]
null
null
null
bullet = class:new() bullet.x = 0 bullet.y = 0 bullet.speed = 1000 bullet.angle = 0 bullet.raio = 10 function bullet:draw() love.graphics.setColor(0, 0, 0) love.graphics.circle('fill', self.x, self.y, self.raio) end function bullet:update(dt) self.x = self.x + dt*self.speed*math.cos(self.angle) self.y = self.y + dt*self.speed*math.sin(self.angle) end tank = {} tank.x = width/2 tank.y = height/2 tank.vx = 0 tank.vy = 0 tank.speed = 300 tank.raio = 40 tank.color = {0, 0, 255} tank.angle = 0 tank.size = 60 tank.bullets = {} tank.health = 100 tank.pontuacao = 0 function tank:draw() love.graphics.setColor(self.color) --love.graphics.circle("fill", self.x, self.y, self.raio) love.graphics.draw(ufo, self.x, self.y, self.angle*2, self.raio*2/32, self.raio*2/32, 16, 16) local x_cano = self.x + self.size*math.cos(self.angle) local y_cano = self.y + self.size*math.sin(self.angle) love.graphics.setLineWidth(5) love.graphics.setColor(0, 0, 0) love.graphics.line(self.x, self.y, x_cano, y_cano) for i = 1, #self.bullets do self.bullets[i]:draw() end love.graphics.setColor(0, 0, 0) local pont = string.format("%d", self.pontuacao) love.graphics.print(pont, width - 0.5*myfont:getWidth(pont), 0, 0, 0.5, 0.5) if self.health >= 0 then if self.health > 50 then love.graphics.setColor(0, 200, 0) elseif self.health > 20 then love.graphics.setColor(200, 200, 0) else love.graphics.setColor(255, 0, 0) end love.graphics.rectangle("fill", 0, 0, 2*self.health, 20, 10) end love.graphics.setColor(0, 0, 0) love.graphics.rectangle("line", 0, 0, 200, 20, 10) end function tank:update(dt) if self.health <= 0 then game_over = true go_song:play() musica:stop() end self.x = self.x + self.speed*self.vx*dt self.y = self.y + self.speed*self.vy*dt self.angle = math.atan2(love.mouse.getY() - self.y, love.mouse.getX() - self.x) if self.x < self.raio then self.x = self.raio end if self.x > width - self.raio then self.x = width - self.raio end if self.y < self.raio then self.y = self.raio end if self.y > height - self.raio then self.y = height - self.raio end for i = 1, #self.bullets do self.bullets[i]:update(dt) end for i = 1, #self.bullets do if fora_da_tela(self.bullets[i].x, self.bullets[i].y) then table.remove(self.bullets, i) break end end for i = 1, #controle_meteoro.bullets do local xm = controle_meteoro.bullets[i].x local ym = controle_meteoro.bullets[i].y local rm = controle_meteoro.bullets[i].raio local sm = controle_meteoro.bullets[i].speed if distance(tank.x, tank.y, xm, ym) <= self.raio + rm then local explosion = exp:clone() explosion:play() self.health = self.health - rm/10 controle_meteoro.bullets[i].death = true end for j = 1, #self.bullets do if distance(self.bullets[j].x, self.bullets[j].y, xm, ym) <= self.bullets[j].raio + rm then self.pontuacao = self.pontuacao + 1 controle_meteoro.bullets[i].death = true controle_meteoro:explodir(i) table.remove(self.bullets, j) break end end end end function tank:shot() local p = pew:clone() p:play() table.insert(self.bullets, bullet:new({x = self.x, y = self.y, angle = self.angle})) end function fora_da_tela(x, y) if x < 0 or x > width or y < 0 or y > height then return true end end meteoro = class:new() meteoro.x = 0 meteoro.y = 0 meteoro.speed = 1000 meteoro.angle = 0 meteoro.raio = 20 meteoro.death = false meteoro.color = {107,66,38} function meteoro:draw() love.graphics.setColor(self.color) love.graphics.circle('fill', self.x, self.y, self.raio) end function meteoro:update(dt) self.x = self.x + dt*self.speed*math.cos(self.angle) self.y = self.y + dt*self.speed*math.sin(self.angle) end controle_meteoro = {} controle_meteoro.bullets = {} controle_meteoro.freq = 0.3 controle_meteoro.temp = 0 controle_meteoro.last_m = 0 function controle_meteoro:draw() for i = 1, #self.bullets do self.bullets[i]:draw() end end function controle_meteoro:explodir(i, max) local explosion = exp:clone() explosion:play() if not max then max = 7 end local xm = self.bullets[i].x local ym = self.bullets[i].y local rm = self.bullets[i].raio local limit = love.math.random(1+max) local d_angle = math.pi/limit for k = 3, limit do table.insert(controle_meteoro.bullets, meteoro:new({x = xm + rm*math.cos(k*d_angle), y = ym + rm*math.sin(k*d_angle), speed = 300 + k*50, angle = k*d_angle, raio = rm/2})) end end function controle_meteoro:update(dt) for i = 1, #self.bullets do self.bullets[i]:update(dt) end for i = 1, #self.bullets do if self.bullets[i].death then table.remove(self.bullets, i) break end end self.temp = self.temp + dt if self.temp - self.last_m >= self.freq then self:shot() self.last_m = self.temp end end function controle_meteoro:shot() local x_rand = love.math.random(width) local speed_rand = 400 + love.math.random(300) local angle_rand = math.atan2(tank.y + 20, tank.x - x_rand) angle_rand = angle_rand + love.math.random() - 0.5 table.insert(self.bullets, meteoro:new({x = x_rand, y = -20, speed = speed_rand, angle = angle_rand})) end function distance(x1, y1, x2, y2) return math.sqrt((x1 - x2)^2 + (y1 - y2)^2) end
28.382775
144
0.603675
7b9d29c795845fd2cb0637c3bcbe0bde540d3e28
160
rb
Ruby
db/migrate/003_add_telegram_id_to_issues.rb
centosadmin/redmine_chat_telegram
13ce19f3b8b0966fadad72bb2f30a87f483f613d
[ "MIT" ]
60
2016-04-07T12:14:24.000Z
2019-06-26T08:01:08.000Z
db/migrate/003_add_telegram_id_to_issues.rb
southbridgeio/redmine_chat_telegram
13ce19f3b8b0966fadad72bb2f30a87f483f613d
[ "MIT" ]
40
2016-05-09T02:47:44.000Z
2018-11-19T14:53:25.000Z
db/migrate/003_add_telegram_id_to_issues.rb
centosadmin/redmine_chat_telegram
13ce19f3b8b0966fadad72bb2f30a87f483f613d
[ "MIT" ]
13
2016-03-31T09:56:09.000Z
2018-07-09T12:59:08.000Z
class AddTelegramIdToIssues < ActiveRecord::Migration def change add_column :issues, :telegram_id, :integer add_index :issues, :telegram_id end end
22.857143
53
0.7625
bf92143eea000373ca066b6c7c0e925110205046
1,805
rs
Rust
src/check/builtin.rs
andrewhickman/small-lang
47997ebae4956f7234ef6fde75add004beca481d
[ "MIT" ]
4
2019-05-16T20:37:21.000Z
2021-09-02T11:19:47.000Z
src/check/builtin.rs
andrewhickman/small-lang
47997ebae4956f7234ef6fde75add004beca481d
[ "MIT" ]
17
2019-11-06T15:29:03.000Z
2019-12-21T15:55:53.000Z
src/check/builtin.rs
andrewhickman/small-lang
47997ebae4956f7234ef6fde75add004beca481d
[ "MIT" ]
1
2019-11-08T10:21:14.000Z
2019-11-08T10:21:14.000Z
use mlsub::auto::StateId; use mlsub::Polarity; use crate::check::vars::VarId; use crate::check::{Context, Scheme}; use crate::syntax::Symbol; impl<T, F> Context<T, F> { pub(in crate::check) fn set_builtins(&mut self) { let eq = self.build_eq(); self.push_var(VarId::BUILTIN_EQ, Symbol::new("__builtin_eq"), None, &eq); let add = self.build_capability_getter(Symbol::new("add")); self.push_var( VarId::BUILTIN_GET_ADD, Symbol::new("__builtin_get_add"), None, &add, ); let sub = self.build_capability_getter(Symbol::new("sub")); self.push_var( VarId::BUILTIN_GET_SUB, Symbol::new("__builtin_get_sub"), None, &sub, ); assert_eq!(self.vars.len(), VarId::NUM_BUILTINS); } fn build_eq(&mut self) -> Scheme { let arg0 = self.auto.build_empty(Polarity::Neg); let arg1 = self.auto.build_empty(Polarity::Neg); let ret = self.build_bool(Polarity::Pos, None); self.build_binary_func(arg0, arg1, ret) } fn build_binary_func(&mut self, lhs: StateId, rhs: StateId, ret: StateId) -> Scheme { let arg = self.build_record( Polarity::Neg, None, [(Symbol::new("l"), lhs), (Symbol::new("r"), rhs)] .iter() .copied(), ); Scheme::empty(self.build_func(Polarity::Pos, None, arg, ret)) } fn build_capability_getter(&mut self, name: Symbol) -> Scheme { let capability_pair = self.auto.build_var(); let capability = self.build_capability(Polarity::Neg, None, name, capability_pair.neg); Scheme::empty(self.build_func(Polarity::Pos, None, capability, capability_pair.pos)) } }
32.232143
95
0.580609
e76cd0c09d1eacaf4c522846b98d75b3df0529ac
650
js
JavaScript
mod04/wwwroot/app/main.js
mauricedb/mwd-2016-09-26
099783071b43ddcb55c059b8a11ea80e7056781d
[ "MIT" ]
null
null
null
mod04/wwwroot/app/main.js
mauricedb/mwd-2016-09-26
099783071b43ddcb55c059b8a11ea80e7056781d
[ "MIT" ]
1
2019-02-26T21:59:25.000Z
2019-02-26T21:59:25.000Z
mod04/wwwroot/app/main.js
mauricedb/mwd-2016-09-26
099783071b43ddcb55c059b8a11ea80e7056781d
[ "MIT" ]
null
null
null
(function(){ angular.module('myApp', []) .service('CatsService', function() { return { getData: function(){ return { name: 'Diego' }; } } }) .controller('DemoController', ['$scope', 'CatsService', function(a, b) { console.log('In the controller'); a.cat = b.getData(); a.cats = [ a.cat, { name: 'Zorro' }, ] }]) }());
25
80
0.296923
f0564055ed89c46066f0b8daddd79d4be0476d39
150
js
JavaScript
packages/action-group/sp-action-group.js
malikfaizanhaider/apocalypto
f09ff523e28230d707bae421c767c2af54f481e6
[ "Apache-2.0" ]
null
null
null
packages/action-group/sp-action-group.js
malikfaizanhaider/apocalypto
f09ff523e28230d707bae421c767c2af54f481e6
[ "Apache-2.0" ]
null
null
null
packages/action-group/sp-action-group.js
malikfaizanhaider/apocalypto
f09ff523e28230d707bae421c767c2af54f481e6
[ "Apache-2.0" ]
null
null
null
import { ActionGroup } from './src/ActionGroup.js'; customElements.define('cm-action-group', ActionGroup); //# sourceMappingURL=sp-action-group.js.map
50
54
0.766667
9dd1fdefbcef0adb3fc1b1f7c2a9346d8a9bcf6e
542
asm
Assembly
base/runtime/trunc.asm
zbyti/Mad-Pascal
546cae9724828f93047080109488be7d0d07d47e
[ "MIT" ]
7
2020-05-02T15:37:57.000Z
2021-02-17T01:59:41.000Z
base/runtime/trunc.asm
michalkolodziejski/Mad-Pascal
0a7a1e2f379e50b0a23878b0d881ff3407269ed6
[ "MIT" ]
14
2020-05-03T02:02:35.000Z
2020-08-10T08:41:19.000Z
base/runtime/trunc.asm
michalkolodziejski/Mad-Pascal
0a7a1e2f379e50b0a23878b0d881ff3407269ed6
[ "MIT" ]
5
2020-06-02T18:34:14.000Z
2020-07-09T18:13:44.000Z
/* @TRUNC @TRUNC_SHORT */ .proc @TRUNC ldy :STACKORIGIN+STACKWIDTH*3,x spl jsr negCARD mva :STACKORIGIN+STACKWIDTH,x :STACKORIGIN,x mva :STACKORIGIN+STACKWIDTH*2,x :STACKORIGIN+STACKWIDTH,x mva :STACKORIGIN+STACKWIDTH*3,x :STACKORIGIN+STACKWIDTH*2,x mva #$00 :STACKORIGIN+STACKWIDTH*3,x tya spl jsr negCARD rts .endp .proc @TRUNC_SHORT ldy :STACKORIGIN+STACKWIDTH,x spl jsr negSHORT sta :STACKORIGIN,x mva #$00 :STACKORIGIN+STACKWIDTH,x tya spl jsr negSHORT rts .endp
13.219512
61
0.680812
8f63a73a76e9ee8090e45a306f4d2d824e7a2427
234
sql
SQL
src/main/resources/db/migration/V2__create_product_table.sql
marioandre01/product_api_spring_boot
aea8e701dafd11a15113bd95ec95ede2874038e0
[ "MIT" ]
null
null
null
src/main/resources/db/migration/V2__create_product_table.sql
marioandre01/product_api_spring_boot
aea8e701dafd11a15113bd95ec95ede2874038e0
[ "MIT" ]
null
null
null
src/main/resources/db/migration/V2__create_product_table.sql
marioandre01/product_api_spring_boot
aea8e701dafd11a15113bd95ec95ede2874038e0
[ "MIT" ]
null
null
null
create table products.product ( id bigserial primary key, product_identifier varchar not null, nome varchar(100) not null, descricao varchar not null, preco float not null, category_id bigint REFERENCES products.category(id) );
26
52
0.790598
26f9f1f7faa3acf9f5b09c49ae314969d1d28920
16,770
sql
SQL
siva.sql
shamgarphp/php
c1b09fa4e16f7d9c057e176d22eeab35f3740391
[ "MIT" ]
null
null
null
siva.sql
shamgarphp/php
c1b09fa4e16f7d9c057e176d22eeab35f3740391
[ "MIT" ]
2
2021-06-07T16:45:35.000Z
2022-03-02T05:41:18.000Z
siva.sql
shamgarphp/php
c1b09fa4e16f7d9c057e176d22eeab35f3740391
[ "MIT" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 4.8.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jan 07, 2019 at 09:50 PM -- Server version: 10.1.37-MariaDB -- PHP Version: 7.1.25 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `goodlife` -- -- -------------------------------------------------------- -- -- Table structure for table `activities` -- CREATE TABLE `activities` ( `activity_id` int(11) NOT NULL, `activity_name` varchar(250) NOT NULL, `image` text NOT NULL, `status` int(11) NOT NULL COMMENT '1=active , 0=inactive', `created_on` datetime NOT NULL, `updated_on` datetime NOT NULL, `title_id` int(11) NOT NULL, `dept_no` int(11) NOT NULL, `subject_aim` text NOT NULL, `implemented_by` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `admin` -- CREATE TABLE `admin` ( `admin_id` int(11) NOT NULL, `name` varchar(250) NOT NULL, `email` varchar(250) NOT NULL, `password` varchar(250) NOT NULL, `created_on` datetime NOT NULL, `updated_on` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `admin` -- INSERT INTO `admin` (`admin_id`, `name`, `email`, `password`, `created_on`, `updated_on`) VALUES (1, 'Admin', 'admin@gmail.com', 'MTIzNDU2', '2018-12-19 09:44:45', '0000-00-00 00:00:00'); -- -------------------------------------------------------- -- -- Table structure for table `departments` -- CREATE TABLE `departments` ( `dept_id` int(11) NOT NULL, `dept_name` varchar(20) NOT NULL, `created_on` datetime NOT NULL, `updated_on` datetime NOT NULL, `status` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `departments` -- INSERT INTO `departments` (`dept_id`, `dept_name`, `created_on`, `updated_on`, `status`) VALUES (1, 'Administration', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0), (2, 'Children', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0), (3, 'Education', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0), (4, 'Church', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0), (5, 'SEA', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0), (6, 'Youth', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0), (7, 'Releif', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0), (8, 'DCF', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0); -- -------------------------------------------------------- -- -- Table structure for table `dept_emp` -- CREATE TABLE `dept_emp` ( `emp_no` int(11) NOT NULL, `dept_no` char(4) NOT NULL, `from_date` date NOT NULL, `to_date` date NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `employees` -- CREATE TABLE `employees` ( `emp_no` int(11) NOT NULL, `birth_date` date NOT NULL, `first_name` varchar(14) NOT NULL, `last_name` varchar(16) NOT NULL, `email` varchar(50) NOT NULL, `password` varchar(50) NOT NULL, `gender` enum('M','F') NOT NULL, `hire_date` date NOT NULL, `father_name` varchar(100) NOT NULL, `aadhar` int(12) NOT NULL, `pan_number` varchar(20) NOT NULL, `account_name` varchar(100) NOT NULL, `account_number` varchar(40) NOT NULL, `ifsc_Code` varchar(15) NOT NULL, `bank_Name` varchar(100) NOT NULL, `highest_qualification` varchar(45) NOT NULL, `job_description` varchar(400) NOT NULL, `place_appointment` varchar(100) NOT NULL, `reporting_to` varchar(100) NOT NULL, `dev_qualification` varchar(250) NOT NULL, `disc_profile` varchar(300) NOT NULL, `role_id` int(11) NOT NULL, `status` int(11) NOT NULL, `created_on` datetime NOT NULL, `Job_title` varchar(100) NOT NULL, `department` int(11) NOT NULL, `account_type` varchar(100) NOT NULL, `resume` varchar(200) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `employees` -- INSERT INTO `employees` (`emp_no`, `birth_date`, `first_name`, `last_name`, `email`, `password`, `gender`, `hire_date`, `father_name`, `aadhar`, `pan_number`, `account_name`, `account_number`, `ifsc_Code`, `bank_Name`, `highest_qualification`, `job_description`, `place_appointment`, `reporting_to`, `dev_qualification`, `disc_profile`, `role_id`, `status`, `created_on`, `Job_title`, `department`, `account_type`, `resume`) VALUES (1, '0000-00-00', 'shankar', 'rao', '', '', 'M', '0000-00-00', '', 0, '', '', '', '', '', '', '', '', '', '', '', 1, 1, '2019-01-03 18:32:50', '', 0, '', ''), (2, '0000-00-00', 'sai', 'kumar', '', '', 'M', '0000-00-00', '', 0, '', '', '', '', '', '', '', '', '', '', '', 2, 1, '2019-01-03 18:34:29', '', 0, '', ''), (3, '0000-00-00', 'ravi', 'kumar', '', '', 'M', '0000-00-00', '', 0, '', '', '', '', '', '', '', '', '', '', '', 3, 1, '2019-01-03 18:35:00', '', 0, '', ''), (4, '0000-00-00', 'siva', 'kumar', '', '', 'M', '0000-00-00', '', 0, '', '', '', '', '', '', '', '', '', '', '', 4, 1, '2019-01-03 18:35:08', '', 0, '', ''), (5, '0000-00-00', 'anil', 'kumar', '', '', 'M', '0000-00-00', '', 0, '', '', '', '', '', '', '', '', '', '', '', 5, 1, '2019-01-03 18:35:21', '', 0, '', ''), (6, '1970-01-01', 'teset', '', '', '', 'M', '0000-00-00', '', 0, '', '', '', '', '', '', '', '', '', '', '', 0, 1, '2019-01-05 13:33:47', '', 0, '', ''), (7, '2019-01-16', 'shankar', 'kumar', 'd@gmail.com', '12345', 'M', '0000-00-00', 'simhachalam', 2147483647, '65345', 'sureshkumar', '63456456454', '4345dfd', 'statebank', 'BTECH', 'tfdgsfgsdfds', 'visakhapatnam', 'persong', 'extra qulification', '', 0, 1, '2019-01-05 13:39:10', '', 0, '', ''), (8, '1970-01-01', 'dfsad', '', '', '', 'M', '0000-00-00', '', 0, '', '', '', '', '', '', '', '', '', '', '', 0, 1, '2019-01-05 15:22:22', '', 0, '', ''), (9, '2019-01-23', 'rakesh', 'kumar', 'rakes@gmail.com', '12345', 'M', '0000-00-00', 'simhachalam', 2147483647, '65345', 'sureshkumar', '63456456454', '4345dfd', 'statebank', 'be', 'high_qualhigh_qualhigh_qual', 'visakhapatnam', 'persong', 'extra qulification', '', 0, 1, '2019-01-05 15:25:26', 'job-title', 3, 'accounttype', ''), (10, '1970-01-01', 'fasd', '', '', '', 'M', '0000-00-00', '', 0, '', '', '', '', '', '', '', '', '', '', '', 2, 1, '2019-01-05 15:26:49', '', 0, '', ''), (11, '1970-01-01', 'ravi', '', '', '', 'M', '0000-00-00', '', 0, '', '', '', '', '', '', '', '', '', '', '', 2, 1, '2019-01-05 15:57:01', '', 0, '', ''), (12, '1970-01-01', 'shankar', '', '', '', 'M', '0000-00-00', '', 0, '', '', '', '', '', '', '', '', '', '', '1a1cdbb734b3a37e96e1ba7ff5d28385.jpg', 2, 1, '2019-01-05 16:06:24', '', 0, '', 'b4c49bea3a7b83ba910814e313e64c02.txt'), (13, '2019-01-09', 'raju', 'kumar', 'suresh@gmail.com', '6666666', 'M', '0000-00-00', 'simhachalam', 2147483647, 'dfasdfas', 'sureshkumar', '63456456454', '4345dfd', 'statebank', 'be', 'fdsadfsd', 'visakhapatnam', 'persong', 'extra qulification', '9a09c1b92a5ae47f82525a1631af623a.jpg', 3, 1, '2019-01-05 16:28:22', 'job-title', 2, 'accounttype', '37af2a10410c7a211310c29f0284332b.txt'); -- -------------------------------------------------------- -- -- Table structure for table `keys` -- CREATE TABLE `keys` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `key` varchar(40) NOT NULL, `level` int(2) NOT NULL, `ignore_limits` tinyint(1) NOT NULL DEFAULT '0', `is_private_key` tinyint(1) NOT NULL DEFAULT '0', `ip_addresses` text, `date_created` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `keys` -- INSERT INTO `keys` (`id`, `user_id`, `key`, `level`, `ignore_limits`, `is_private_key`, `ip_addresses`, `date_created`) VALUES (1, 0, 'SHANKAR@111', 0, 0, 0, NULL, '2017-10-12 13:34:33'); -- -------------------------------------------------------- -- -- Table structure for table `locations` -- CREATE TABLE `locations` ( `location_id` int(11) NOT NULL, `location` varchar(250) NOT NULL, `area` varchar(100) NOT NULL, `status` int(11) NOT NULL, `created_on` datetime NOT NULL, `updated_on` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `locations` -- INSERT INTO `locations` (`location_id`, `location`, `area`, `status`, `created_on`, `updated_on`) VALUES (8, '', 'Iejaa', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (9, '', 'Tanagala', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (10, '', 'Kottapalli', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (11, '', '\r\nBalgera', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (12, '', 'santhinagar', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (13, '', 'Rajoli', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (14, '', 'Itikala', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (15, '', 'Mudumala', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (16, '', 'Alumpur', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (17, '', 'Yarravalli', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (18, '', 'Panchalingalaa', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (19, '', 'Gadwal', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (20, '', 'Tharur', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (21, '', 'Amaravaee', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (22, '', 'Namdeenni', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (23, '', 'Nettampadu', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (24, '', 'Aathama kuru', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (25, '', 'Kottakota', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'); -- -------------------------------------------------------- -- -- Table structure for table `participants` -- CREATE TABLE `participants` ( `participant_id` int(11) NOT NULL, `participant_type` int(11) NOT NULL, `men` int(11) NOT NULL, `women` int(11) NOT NULL, `child` int(11) NOT NULL, `fromdate` date NOT NULL, `todate` date NOT NULL, `from_time` varchar(5) NOT NULL, `to_time` varchar(5) NOT NULL, `activity_id` int(11) NOT NULL, `name` varchar(250) NOT NULL, `phone` int(11) NOT NULL, `desccription` varchar(250) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `program_staff` -- CREATE TABLE `program_staff` ( `program_staff_id` int(11) NOT NULL, `location_id` int(11) NOT NULL, `program_admin` int(11) NOT NULL, `finance_admin` int(11) NOT NULL, `report_staff1` int(11) NOT NULL, `report_staff2` int(11) NOT NULL, `photography` int(11) NOT NULL, `created_by` int(11) NOT NULL, `created_on` datetime NOT NULL, `updated_on` datetime NOT NULL, `status` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `resource_staff` -- CREATE TABLE `resource_staff` ( `resource_staff_id` int(11) NOT NULL, `resource` varchar(255) NOT NULL, `program_staff_id` int(11) NOT NULL, `created_on` datetime NOT NULL, `updated_on` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `roles` -- CREATE TABLE `roles` ( `role_id` int(11) NOT NULL, `name` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `roles` -- INSERT INTO `roles` (`role_id`, `name`) VALUES (1, 'ceo'), (2, 'admin'), (3, 'accounts_head'), (4, 'dept_head'), (5, 'employee'), (6, 'volunteer'); -- -------------------------------------------------------- -- -- Table structure for table `salaries` -- CREATE TABLE `salaries` ( `emp_no` int(11) NOT NULL, `salary` int(11) NOT NULL, `from_date` date NOT NULL, `to_date` date NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `teaching_staff` -- CREATE TABLE `teaching_staff` ( `teaching_id` int(11) NOT NULL, `program_staff_id` int(11) NOT NULL, `teaching` varchar(255) NOT NULL, `created_on` int(11) NOT NULL, `updated_on` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `titles` -- CREATE TABLE `titles` ( `title_id` int(11) NOT NULL, `title` varchar(250) NOT NULL, `created_on` datetime NOT NULL, `updated_on` datetime NOT NULL, `dept_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `titles` -- INSERT INTO `titles` (`title_id`, `title`, `created_on`, `updated_on`, `dept_id`) VALUES (1, 'Agriculture.', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 3), (2, 'Biological and Biomedical Sciences', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 3), (3, 'children_program 1', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 2), (4, 'children_program 2', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 2); -- -- Indexes for dumped tables -- -- -- Indexes for table `activities` -- ALTER TABLE `activities` ADD PRIMARY KEY (`activity_id`); -- -- Indexes for table `admin` -- ALTER TABLE `admin` ADD PRIMARY KEY (`admin_id`); -- -- Indexes for table `departments` -- ALTER TABLE `departments` ADD PRIMARY KEY (`dept_id`); -- -- Indexes for table `dept_emp` -- ALTER TABLE `dept_emp` ADD PRIMARY KEY (`emp_no`,`dept_no`), ADD KEY `emp_no` (`emp_no`), ADD KEY `dept_no` (`dept_no`); -- -- Indexes for table `employees` -- ALTER TABLE `employees` ADD PRIMARY KEY (`emp_no`); -- -- Indexes for table `keys` -- ALTER TABLE `keys` ADD PRIMARY KEY (`id`); -- -- Indexes for table `locations` -- ALTER TABLE `locations` ADD PRIMARY KEY (`location_id`); -- -- Indexes for table `participants` -- ALTER TABLE `participants` ADD PRIMARY KEY (`participant_id`), ADD KEY `activity_id` (`activity_id`); -- -- Indexes for table `program_staff` -- ALTER TABLE `program_staff` ADD PRIMARY KEY (`program_staff_id`); -- -- Indexes for table `resource_staff` -- ALTER TABLE `resource_staff` ADD PRIMARY KEY (`resource_staff_id`); -- -- Indexes for table `roles` -- ALTER TABLE `roles` ADD PRIMARY KEY (`role_id`); -- -- Indexes for table `salaries` -- ALTER TABLE `salaries` ADD PRIMARY KEY (`emp_no`,`from_date`), ADD KEY `emp_no` (`emp_no`); -- -- Indexes for table `teaching_staff` -- ALTER TABLE `teaching_staff` ADD PRIMARY KEY (`teaching_id`), ADD KEY `program_staff_id` (`program_staff_id`); -- -- Indexes for table `titles` -- ALTER TABLE `titles` ADD PRIMARY KEY (`title_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `activities` -- ALTER TABLE `activities` MODIFY `activity_id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `admin` -- ALTER TABLE `admin` MODIFY `admin_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `departments` -- ALTER TABLE `departments` MODIFY `dept_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `employees` -- ALTER TABLE `employees` MODIFY `emp_no` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `program_staff` -- ALTER TABLE `program_staff` MODIFY `program_staff_id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `resource_staff` -- ALTER TABLE `resource_staff` MODIFY `resource_staff_id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `teaching_staff` -- ALTER TABLE `teaching_staff` MODIFY `teaching_id` int(11) NOT NULL AUTO_INCREMENT; -- -- Constraints for dumped tables -- -- -- Constraints for table `teaching_staff` -- ALTER TABLE `teaching_staff` ADD CONSTRAINT `teaching_staff_ibfk_1` FOREIGN KEY (`program_staff_id`) REFERENCES `program_staff` (`program_staff_id`) ON DELETE CASCADE; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
32.946955
432
0.582409
2e385863006e738bd4bbbf70789b8cb275c6ab30
1,366
swift
Swift
CoreDataSelfReferencingTable/StatesProvincesTableViewController.swift
wesleysadler/CoreDataSelfReferencingTable
f408269b9d03a74d2bb7437b65ba62feec1c78c8
[ "MIT" ]
null
null
null
CoreDataSelfReferencingTable/StatesProvincesTableViewController.swift
wesleysadler/CoreDataSelfReferencingTable
f408269b9d03a74d2bb7437b65ba62feec1c78c8
[ "MIT" ]
null
null
null
CoreDataSelfReferencingTable/StatesProvincesTableViewController.swift
wesleysadler/CoreDataSelfReferencingTable
f408269b9d03a74d2bb7437b65ba62feec1c78c8
[ "MIT" ]
null
null
null
// // StatesProvincesTableViewController.swift // CoreDataSelfReferencingTable // // Created by Wesley Sadler on 5/22/15. // Copyright (c) 2015 Digital Sadler. All rights reserved. // import UIKit class StatesProvincesTableViewController: UITableViewController { // MARK: Properties var statesProvindes: NSOrderedSet? = nil // MARK: - Table View override func numberOfSectionsInTableView(tableView: UITableView) -> Int { return 1 } override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if let myCount = self.statesProvindes?.count { return myCount } return 0 } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("StatesProvincesCell", forIndexPath: indexPath) as! UITableViewCell self.configureCell(cell, atIndexPath: indexPath) return cell } func configureCell(cell: UITableViewCell, atIndexPath indexPath: NSIndexPath) { let location = self.statesProvindes![indexPath.row] as! Location cell.textLabel?.adjustsFontSizeToFitWidth = true cell.textLabel?.text = location.name + " (" + location.code + ")" } }
29.695652
130
0.677892
215a79f0ffd89e5529c885a4095e93263d586ae1
2,731
swift
Swift
Tests/AppTests/S3DocArchivesTests.swift
swiftpackageindex/SwiftPackageIndex-Server
c74fe0e4963a5b31bd6782c2e4b568eb2dc8fa4e
[ "Apache-2.0" ]
null
null
null
Tests/AppTests/S3DocArchivesTests.swift
swiftpackageindex/SwiftPackageIndex-Server
c74fe0e4963a5b31bd6782c2e4b568eb2dc8fa4e
[ "Apache-2.0" ]
null
null
null
Tests/AppTests/S3DocArchivesTests.swift
swiftpackageindex/SwiftPackageIndex-Server
c74fe0e4963a5b31bd6782c2e4b568eb2dc8fa4e
[ "Apache-2.0" ]
null
null
null
// Copyright 2020-2021 Dave Verwer, Sven A. Schmidt, and other contributors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. import XCTest @testable import S3DocArchives class S3DocArchivesTests: XCTestCase { func test_parse() throws { let docs = keys.compactMap { try? DocArchive.path.parse($0) } XCTAssertEqual(docs, [ .init(owner: "apple", repository: "swift-docc", ref: "main", product: "docc"), .init(owner: "apple", repository: "swift-docc", ref: "main", product: "swiftdocc"), ]) } func test_productsGroupedByRef() { let mainP1 = DocArchive.mock("foo", "bar", "main", "p1", "P1") let v123P1 = DocArchive.mock("foo", "bar", "1.2.3", "p1", "P1") let v123P2 = DocArchive.mock("foo", "bar", "1.2.3", "p2", "P2") let archives: [DocArchive] = [mainP1, v123P1, v123P2] XCTAssertEqual(archives.archivesGroupedByRef(), [ "main": [mainP1], "1.2.3": [v123P1, v123P2] ]) } } private let keys = [ "apple/swift-docc/main/css/documentation-topic.de084985.css", "apple/swift-docc/main/css/documentation-topic~topic~tutorials-overview.67b822e0.css", "apple/swift-docc/main/css/index.47bc740e.css", "apple/swift-docc/main/css/topic.2eb01958.css", "apple/swift-docc/main/css/tutorials-overview.8754eb09.css", "apple/swift-docc/main/documentation/docc/adding-structure-to-your-documentation-pages/index.html", "apple/swift-docc/main/documentation/docc/adding-supplemental-content-to-a-documentation-catalog/index.html", "apple/swift-docc/main/documentation/docc/index.html", "apple/swift-docc/main/documentation/docc/intro/index.html", "apple/swift-docc/main/documentation/docc/justification/index.html", "apple/swift-docc/main/documentation/swiftdocc/implementationsgroup/references/index.html", "apple/swift-docc/main/documentation/swiftdocc/index.html", "apple/swift-docc/main/documentation/swiftdocc/indexable/index.html", "apple/swift-docc/main/documentation/swiftdocc/indexable/indexingrecords(onpage:)/index.html", "apple/swift-docc/main/documentation/swiftdocc/indexingerror/describederror-implementations/index.html", ]
44.770492
113
0.703039
9a4345b916cb35b30c921355fb98544dadef99d6
569
css
CSS
assets/css/demo_less_compiler.css
myCodebox/less_compiler
5beeb227ffa8bcdb92ab5f8c869ed417edcbc14c
[ "Beerware" ]
5
2016-09-02T12:36:36.000Z
2018-01-06T21:39:15.000Z
assets/css/demo_less_compiler.css
myCodebox/less_compiler
5beeb227ffa8bcdb92ab5f8c869ed417edcbc14c
[ "Beerware" ]
null
null
null
assets/css/demo_less_compiler.css
myCodebox/less_compiler
5beeb227ffa8bcdb92ab5f8c869ed417edcbc14c
[ "Beerware" ]
null
null
null
/* Start: DEMO ---------------------------------------------------------------------------------- */ #less_compiler_demo { position: fixed; bottom: 1em; right: 1em; padding: 1.000em; background-color: #333; color: #e34; color: #78C936; font-weight: bold; text-align: center; z-index:1000; border: 1px solid #78C936; } #less_compiler_demo pre { padding: 5px; margin: 5px 0 0 0; display: block; font-size: 11px; font-weight: normal; text-align: left; } /* Ende: DEMO ----------------------------------------------------------------------------------- */
23.708333
100
0.474517
843edc81d8a79244047e7af82854d818ed989384
1,650
swift
Swift
Sources/Keystore/EncryptedMessage.swift
ooozws/token-core-ios
a0b6868439b1a05ec18dde8befcbab4b8e912d3b
[ "Apache-2.0" ]
null
null
null
Sources/Keystore/EncryptedMessage.swift
ooozws/token-core-ios
a0b6868439b1a05ec18dde8befcbab4b8e912d3b
[ "Apache-2.0" ]
null
null
null
Sources/Keystore/EncryptedMessage.swift
ooozws/token-core-ios
a0b6868439b1a05ec18dde8befcbab4b8e912d3b
[ "Apache-2.0" ]
null
null
null
// // EncryptedMessage.swfit // token // // Created by Kai Chen on 20/11/2017. // Copyright © 2017 ConsenLabs. All rights reserved. // import Foundation // Store anything like { encStr: "secertMessage", nonce: "randomBytes" } public struct EncryptedMessage { public let encStr: String public let nonce: String public init(encStr: String, nonce: String) { self.encStr = encStr self.nonce = nonce } public init?(json: JSONObject) { guard let encStr = json["encStr"] as? String, let nonce = json["nonce"] as? String else { return nil } self.init(encStr: encStr, nonce: nonce) } public static func create(crypto: Crypto, password: String, message: String, nonce: String? = nil) -> EncryptedMessage { return create(crypto: crypto, derivedKey: crypto.derivedKey(with: password), message: message, nonce: nonce) } public static func create(crypto: Crypto, derivedKey: String, message: String, nonce: String? = nil) -> EncryptedMessage { let nonceWithFallback = nonce ?? RandomIV().value let encryptor = crypto.encryptor(from: derivedKey.tk_substring(to: 32), nonce: nonceWithFallback) return EncryptedMessage(encStr: encryptor.encrypt(hex: message), nonce: nonceWithFallback) } // use kdf with password to decrypt secert message public func decrypt(crypto: Crypto, password: String) -> String { let dk = crypto.derivedKey(with: password) let encryptor = crypto.encryptor(from: dk.tk_substring(to: 32), nonce: nonce) return encryptor.decrypt(hex: encStr) } public func toJSON() -> JSONObject { return [ "encStr": encStr, "nonce": nonce ] } }
31.730769
124
0.693939
b2f00de04b4a4965219cd8965a1067b02342ac09
1,571
bzl
Python
rules/starlark_configurations/cc_test/defs.bzl
CyberFlameGO/examples
87a4812cb23f7e7969d74cc073579fb82540c0f6
[ "Apache-2.0" ]
572
2015-09-02T20:26:41.000Z
2022-03-30T07:43:22.000Z
rules/starlark_configurations/cc_test/defs.bzl
CyberFlameGO/examples
87a4812cb23f7e7969d74cc073579fb82540c0f6
[ "Apache-2.0" ]
158
2015-08-31T20:21:50.000Z
2022-03-20T20:13:14.000Z
rules/starlark_configurations/cc_test/defs.bzl
CyberFlameGO/examples
87a4812cb23f7e7969d74cc073579fb82540c0f6
[ "Apache-2.0" ]
408
2015-08-31T20:05:14.000Z
2022-03-28T02:36:44.000Z
# We can transition on native options using this # //command_line_option:<option-name> syntax _BUILD_SETTING = "//command_line_option:test_arg" def _test_arg_transition_impl(settings, attr): _ignore = (settings, attr) return {_BUILD_SETTING: ["new arg"]} _test_arg_transition = transition( implementation = _test_arg_transition_impl, inputs = [], outputs = [_BUILD_SETTING], ) def _test_transition_rule_impl(ctx): # We need to copy the executable because starlark doesn't allow # providing an executable not created by the rule executable_src = ctx.executable.actual_test executable_dst = ctx.actions.declare_file(ctx.label.name) ctx.actions.run_shell( tools = [executable_src], outputs = [executable_dst], command = "cp %s %s" % (executable_src.path, executable_dst.path), ) runfiles = ctx.attr.actual_test[0][DefaultInfo].default_runfiles return [DefaultInfo(runfiles = runfiles, executable = executable_dst)] transition_rule_test = rule( implementation = _test_transition_rule_impl, attrs = { "actual_test": attr.label(cfg = _test_arg_transition, executable = True), "_allowlist_function_transition": attr.label( default = "@bazel_tools//tools/allowlists/function_transition_allowlist", ), }, test = True, ) def test_arg_cc_test(name, **kwargs): cc_test_name = name + "_native_test" transition_rule_test( name = name, actual_test = ":%s" % cc_test_name, ) native.cc_test(name = cc_test_name, **kwargs)
33.425532
85
0.700827
b1adb2038826c3bbb2e336447af3e386ea6904b6
6,617
h
C
resources/home/dnanexus/root/include/RooCmdConfig.h
edawson/parliament2
2632aa3484ef64c9539c4885026b705b737f6d1e
[ "Apache-2.0" ]
null
null
null
resources/home/dnanexus/root/include/RooCmdConfig.h
edawson/parliament2
2632aa3484ef64c9539c4885026b705b737f6d1e
[ "Apache-2.0" ]
null
null
null
resources/home/dnanexus/root/include/RooCmdConfig.h
edawson/parliament2
2632aa3484ef64c9539c4885026b705b737f6d1e
[ "Apache-2.0" ]
1
2020-05-28T23:01:44.000Z
2020-05-28T23:01:44.000Z
/***************************************************************************** * Project: RooFit * * Package: RooFitCore * * File: $Id: RooCmdConfig.h,v 1.12 2007/05/11 09:11:30 verkerke Exp $ * Authors: * * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu * * DK, David Kirkby, UC Irvine, dkirkby@uci.edu * * * * Copyright (c) 2000-2005, Regents of the University of California * * and Stanford University. All rights reserved. * * * * Redistribution and use in source and binary forms, * * with or without modification, are permitted according to the terms * * listed in LICENSE (http://roofit.sourceforge.net/license.txt) * *****************************************************************************/ #ifndef ROO_CMD_CONFIG #define ROO_CMD_CONFIG #include "TObject.h" #include "TString.h" #include "TList.h" #include "RooCmdArg.h" #include "RooArgSet.h" class RooCmdConfig : public TObject { public: RooCmdConfig(const char* methodName); RooCmdConfig(const RooCmdConfig& other) ; ~RooCmdConfig(); void setVerbose(Bool_t flag) { // If flag is true verbose messaging is activated _verbose = flag ; } void allowUndefined(Bool_t flag=kTRUE) { // If flag is true the processing of unrecognized RooCmdArgs // is not considered an error _allowUndefined = flag ; } void defineDependency(const char* refArgName, const char* neededArgName) ; void defineMutex(const char* argName1, const char* argName2) ; void defineMutex(const char* argName1, const char* argName2, const char* argName3) ; void defineMutex(const char* argName1, const char* argName2, const char* argName3, const char* argName4) ; void defineMutex(const char* argName1, const char* argName2, const char* argName3, const char* argName4, const char* argName5) ; void defineRequiredArgs(const char* argName1, const char* argName2=0, const char* argName3=0, const char* argName4=0, const char* argName5=0, const char* argName6=0, const char* argName7=0, const char* argName8=0) ; Bool_t defineInt(const char* name, const char* argName, Int_t intNum, Int_t defValue=0) ; Bool_t defineDouble(const char* name, const char* argName, Int_t doubleNum, Double_t defValue=0.) ; Bool_t defineString(const char* name, const char* argName, Int_t stringNum, const char* defValue="",Bool_t appendMode=kFALSE) ; Bool_t defineObject(const char* name, const char* argName, Int_t setNum, const TObject* obj=0, Bool_t isArray=kFALSE) ; Bool_t defineSet(const char* name, const char* argName, Int_t setNum, const RooArgSet* set=0) ; Bool_t process(const RooCmdArg& arg) ; Bool_t process(const RooCmdArg& arg1, const RooCmdArg& arg2, const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(), const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(), const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) ; Bool_t process(const RooLinkedList& argList) ; Int_t getInt(const char* name, Int_t defaultValue=0) ; Double_t getDouble(const char* name, Double_t defaultValue=0) ; const char* getString(const char* name, const char* defaultValue="",Bool_t convEmptyToNull=kFALSE) ; TObject* getObject(const char* name, TObject* obj=0) ; RooArgSet* getSet(const char* name, RooArgSet* set=0) ; const RooLinkedList& getObjectList(const char* name) ; Bool_t ok(Bool_t verbose) const ; const char* missingArgs() const ; RooLinkedList filterCmdList(RooLinkedList& cmdInList, const char* cmdNameList, Bool_t removeFromInList=kTRUE) ; void stripCmdList(RooLinkedList& cmdList, const char* cmdsToPurge) ; Bool_t hasProcessed(const char* cmdName) const ; void print() ; static Int_t decodeIntOnTheFly(const char* callerID, const char* cmdArgName, Int_t intIdx, Int_t defVal, const RooCmdArg& arg1, const RooCmdArg& arg2=RooCmdArg(), const RooCmdArg& arg3=RooCmdArg(), const RooCmdArg& arg4=RooCmdArg(), const RooCmdArg& arg5=RooCmdArg(), const RooCmdArg& arg6=RooCmdArg(), const RooCmdArg& arg7=RooCmdArg(), const RooCmdArg& arg8=RooCmdArg(), const RooCmdArg& arg9=RooCmdArg()) ; static const char* decodeStringOnTheFly(const char* callerID, const char* cmdArgName, Int_t intIdx, const char* defVal, const RooCmdArg& arg1, const RooCmdArg& arg2=RooCmdArg(), const RooCmdArg& arg3=RooCmdArg(), const RooCmdArg& arg4=RooCmdArg(), const RooCmdArg& arg5=RooCmdArg(), const RooCmdArg& arg6=RooCmdArg(), const RooCmdArg& arg7=RooCmdArg(), const RooCmdArg& arg8=RooCmdArg(), const RooCmdArg& arg9=RooCmdArg()) ; static TObject* decodeObjOnTheFly(const char* callerID, const char* cmdArgName, Int_t objIdx, TObject* defVal, const RooCmdArg& arg1, const RooCmdArg& arg2=RooCmdArg(), const RooCmdArg& arg3=RooCmdArg(), const RooCmdArg& arg4=RooCmdArg(), const RooCmdArg& arg5=RooCmdArg(), const RooCmdArg& arg6=RooCmdArg(), const RooCmdArg& arg7=RooCmdArg(), const RooCmdArg& arg8=RooCmdArg(), const RooCmdArg& arg9=RooCmdArg()) ; protected: TString _name ; Bool_t _verbose ; Bool_t _error ; Bool_t _allowUndefined ; TList _iList ; // Integer list TList _dList ; // Double list TList _sList ; // String list TList _oList ; // Object list TList _cList ; // RooArgSet list TList _rList ; // Required cmd list TList _fList ; // Forbidden cmd list TList _mList ; // Mutex cmd list TList _yList ; // Dependency cmd list TList _pList ; // Processed cmd list TIterator* _iIter ; // Iterator over integer list TIterator* _dIter ; // Iterator over double list TIterator* _sIter ; // Iterator over string list TIterator* _oIter ; // Iterator over object list TIterator* _cIter ; // Iterator over RooArgSet list TIterator* _rIter ; // Iterator over required cmd list TIterator* _fIter ; // Iterator over forbidden cmd list TIterator* _mIter ; // Iterator over mutex list TIterator* _yIter ; // Iterator over dependency list TIterator* _pIter ; // Iterator over processed cmd list ClassDef(RooCmdConfig,0) // Configurable parse of RooCmdArg objects }; #endif
48.29927
145
0.659211
ba60eba9bbc28f7342670e5efe0996c98c5582cc
1,084
kt
Kotlin
samples/src/main/java/literefresh/sample/LiteRefreshSampleApp.kt
jastrelax/LiteRefresh
df631849f2574dad0a434b029f392710c5b6ce4c
[ "Apache-2.0" ]
26
2018-09-16T04:44:04.000Z
2021-02-09T02:59:56.000Z
samples/src/main/java/literefresh/sample/LiteRefreshSampleApp.kt
epicmars/LiteRefresh
df631849f2574dad0a434b029f392710c5b6ce4c
[ "Apache-2.0" ]
null
null
null
samples/src/main/java/literefresh/sample/LiteRefreshSampleApp.kt
epicmars/LiteRefresh
df631849f2574dad0a434b029f392710c5b6ce4c
[ "Apache-2.0" ]
3
2021-04-25T05:45:50.000Z
2022-03-22T00:53:51.000Z
/* * Copyright 2018 yinpinjiu@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package literefresh.sample import androidx.multidex.MultiDexApplication import literefresh.sample.common.log.LogHelper.init import tv.danmaku.ijk.media.player.IjkMediaPlayer class LiteRefreshSampleApp : MultiDexApplication() { companion object { init { IjkMediaPlayer.loadLibrariesOnce(null); IjkMediaPlayer.native_profileBegin("libijkplayer.so"); } } override fun onCreate() { super.onCreate() init() } }
30.971429
75
0.719557
fdfe94972d8d7efb53943d52fd14014d5a96defa
177
sql
SQL
Task 22 (Shared Buffers)/SharedBuffersQuery.sql
artemgur/AdvancedPostgreSQL
ac1e48743f06f5f7e73c6ebc4e90f7673e535e4e
[ "MIT" ]
null
null
null
Task 22 (Shared Buffers)/SharedBuffersQuery.sql
artemgur/AdvancedPostgreSQL
ac1e48743f06f5f7e73c6ebc4e90f7673e535e4e
[ "MIT" ]
null
null
null
Task 22 (Shared Buffers)/SharedBuffersQuery.sql
artemgur/AdvancedPostgreSQL
ac1e48743f06f5f7e73c6ebc4e90f7673e535e4e
[ "MIT" ]
null
null
null
SELECT relname, datname, pg_size_pretty(buffered) AS buffered, buffer_percent, percent_of_relation, percent_of_table FROM buffer_view WHERE relname LIKE 'sb_1000%'
35.4
60
0.785311
584baa75f023df3c6bd0fa4f8206cbac617d965f
2,910
kt
Kotlin
app/src/main/java/com/tardivon/quentin/hackoeur/Event.kt
quentin-tardivon/hackoeur-android
eb71cfece8dd9144a669f9b4cb84ab60752e3970
[ "MIT" ]
null
null
null
app/src/main/java/com/tardivon/quentin/hackoeur/Event.kt
quentin-tardivon/hackoeur-android
eb71cfece8dd9144a669f9b4cb84ab60752e3970
[ "MIT" ]
5
2018-01-20T14:51:52.000Z
2018-01-20T14:51:52.000Z
app/src/main/java/com/tardivon/quentin/hackoeur/Event.kt
quentin-tardivon/hackoeur-android
eb71cfece8dd9144a669f9b4cb84ab60752e3970
[ "MIT" ]
null
null
null
package com.tardivon.quentin.hackoeur import android.os.Parcel import android.os.Parcelable /** * Created by quentin on 11/13/17. */ class Event() : Parcelable { var name: String? =null internal set var description: String?=null internal set var location: String? =null internal set var date: String? = null internal set var time: String? = null internal set var locationGPS: LatLng? = null internal set var registeredUsers: MutableList<String>? =null internal set var imgId: String? =null internal set constructor(parcel: Parcel) : this() { name = parcel.readString() description = parcel.readString() location = parcel.readString() date = parcel.readString() time = parcel.readString() imgId = parcel.readString() } constructor(name: String, description: String, location: String, date: String, time: String) : this() { this.name = name this.description = description this.location = location this.date = date this.time = time } constructor(name: String, description: String, location: String, date: String, time: String, locationGPS: LatLng) : this() { this.name = name this.description = description this.location = location this.date = date this.time = time this.locationGPS = locationGPS } constructor(name: String, description: String, location: String, date: String, time: String, locationGPS: LatLng, UsersId: MutableList<String> ) : this() { this.name = name this.description = description this.location = location this.date = date this.time = time this.locationGPS = locationGPS this.registeredUsers = UsersId } constructor(name: String, description: String, location: String, date: String, time: String, locationGPS: LatLng, UsersId: MutableList<String>, imgId: String) : this() { this.name = name this.description = description this.location = location this.date = date this.time = time this.locationGPS = locationGPS this.registeredUsers = UsersId this.imgId = imgId } override fun writeToParcel(parcel: Parcel, flags: Int) { parcel.writeString(name) parcel.writeString(description) parcel.writeString(location) parcel.writeString(date) parcel.writeString(time) parcel.writeString(imgId) } override fun describeContents(): Int { return 0 } companion object CREATOR : Parcelable.Creator<Event> { override fun createFromParcel(parcel: Parcel): Event { return Event(parcel) } override fun newArray(size: Int): Array<Event?> { return arrayOfNulls(size) } } }
30
173
0.623711
8b0a83aba14fb007114135d836b55b5c583a2599
943
sql
SQL
config/schema.sql
mathiasnovas/witi
053e99ab422cd483bd627f223db94e03f6225207
[ "MIT" ]
null
null
null
config/schema.sql
mathiasnovas/witi
053e99ab422cd483bd627f223db94e03f6225207
[ "MIT" ]
2
2015-02-02T11:25:17.000Z
2015-06-22T13:07:36.000Z
config/schema.sql
mathiasnovas/witi
053e99ab422cd483bd627f223db94e03f6225207
[ "MIT" ]
null
null
null
-- -- Database Setup -- -- CREATE DATABASE IF NOT EXISTS `witi`; -- USE `witi`; -- DROP TABLE IF EXISTS `people`; -- DROP TABLE IF EXISTS `gadgets`; -- DROP TABLE IF EXISTS `report`; -- -- People -- CREATE TABLE IF NOT EXISTS `people` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `image` VARCHAR(255) NULL, `score` INT UNSIGNED NOT NULL DEFAULT 0, `created` TIMESTAMP NULL DEFAULT NOW(), PRIMARY KEY(`id`) ); -- -- Gadgets -- CREATE TABLE IF NOT EXISTS `gadgets` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `image` VARCHAR(255) NULL, `personId` INT UNSIGNED NULL, `created` TIMESTAMP NULL DEFAULT NOW(), PRIMARY KEY(`id`) ); -- -- Reports -- CREATE TABLE IF NOT EXISTS `report` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `personId` INT UNSIGNED NOT NULL, `comment` TEXT NOT NULL, `date` TIMESTAMP NULL DEFAULT NOW(), PRIMARY KEY(`id`) );
19.645833
46
0.664899
b7197765f83447df87de9671e0d83b600483e63e
2,568
kt
Kotlin
core/src/main/java/com/mobilejazz/harmony/kotlin/core/repository/datasource/file/FileStreamValueDataStorage.kt
mobilejazz/harmony-kotlin
364b610d9ed818ff102cfe779a7ee23f4d5595d5
[ "Apache-2.0" ]
10
2020-07-22T06:51:51.000Z
2022-03-29T17:05:18.000Z
core/src/main/java/com/mobilejazz/harmony/kotlin/core/repository/datasource/file/FileStreamValueDataStorage.kt
mobilejazz/harmony-kotlin
364b610d9ed818ff102cfe779a7ee23f4d5595d5
[ "Apache-2.0" ]
37
2019-07-23T09:41:09.000Z
2022-03-31T09:01:53.000Z
core/src/main/java/com/mobilejazz/harmony/kotlin/core/repository/datasource/file/FileStreamValueDataStorage.kt
mobilejazz/harmony-kotlin
364b610d9ed818ff102cfe779a7ee23f4d5595d5
[ "Apache-2.0" ]
null
null
null
package com.mobilejazz.harmony.kotlin.core.repository.datasource.file import com.mobilejazz.harmony.kotlin.core.repository.datasource.DeleteDataSource import com.mobilejazz.harmony.kotlin.core.repository.datasource.GetDataSource import com.mobilejazz.harmony.kotlin.core.repository.datasource.PutDataSource import com.mobilejazz.harmony.kotlin.core.repository.query.Query import com.mobilejazz.harmony.kotlin.core.threading.extensions.Future import java.io.EOFException import java.io.File import java.io.ObjectInputStream import java.io.ObjectOutputStream class FileStreamValueDataStorage<T>(val file: File) : GetDataSource<T>, PutDataSource<T>, DeleteDataSource { override fun get(query: Query): Future<T> { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } override fun getAll(query: Query): Future<List<T>> { return Future { val values = mutableListOf<T>() val fin = file.inputStream() var ois: ObjectInputStream? = null try { ois = ObjectInputStream(fin) while (true) { val value = ois.readObject() as T values.add(value) } } catch (e: EOFException) { ois?.close() fin.close() } return@Future values } } override fun put(query: Query, value: T?): Future<T> { return Future { return@Future value?.let { putAll(query, listOf(value)).get()[0] } ?: throw IllegalArgumentException("FileStreamValueDataStorage: value must be not null") } } override fun putAll(query: Query, value: List<T>?): Future<List<T>> { return Future { value?.let { val allCurrentValues = getAll(query).get() val fos = file.outputStream() val oos = ObjectOutputStream(fos) val allValues = value.toMutableList() allValues.addAll(allCurrentValues) for (obj in allValues) { oos.writeObject(obj) } oos.flush() oos.close() fos.close() return@Future value ?: notSupportedQuery() } ?: throw IllegalArgumentException("FileStreamValueDataStorage: value must be not null") } } override fun delete(query: Query): Future<Unit> { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } override fun deleteAll(query: Query): Future<Unit> { return Future { val outputStream = file.outputStream() val objectOutputStream = ObjectOutputStream(outputStream) objectOutputStream.reset() } } }
31.703704
108
0.67796
1fd1337e1df04ef90417e2d4114ace78d5acc334
500
sql
SQL
scripts/mysql.sql
thinkerytim/joomla-docker
50cffec68cab05b6b0af870997875487f82eda7f
[ "MIT" ]
1
2021-09-04T21:57:39.000Z
2021-09-04T21:57:39.000Z
scripts/mysql.sql
thinkerytim/joomla-docker
50cffec68cab05b6b0af870997875487f82eda7f
[ "MIT" ]
null
null
null
scripts/mysql.sql
thinkerytim/joomla-docker
50cffec68cab05b6b0af870997875487f82eda7f
[ "MIT" ]
null
null
null
-- add the user table record INSERT INTO exampleDB.j_users (name, username, email, password, block, sendEmail, registerDate, lastvisitDate, activation, params, lastResetTime, resetCount, otpKey, otep, requireReset) VALUES('Super User', 'admin', 'test@example.com', MD5('password'), 0, 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '0000-00-00 00:00:00', 0, '', '', 0); -- add to the usergroup so we're superadmins INSERT INTO exampleDB.j_user_usergroup_map (user_id,group_id) VALUES (1,8);
62.5
164
0.718
eac9924a5b66aad4d1ef528bf17c9aae7df018eb
1,211
swift
Swift
ProjectSwiftDemo/Pods/CocoaChainKit/CocoaChainKit/Classes/NotificationCenter+Chain.swift
ZSMHup/ProjectSwiftDemo
1df8c733ee016eb325dad4e8fa4311f4bba1e804
[ "Apache-2.0" ]
19
2018-05-27T06:35:33.000Z
2021-09-11T02:20:29.000Z
SwiftTool/Pods/CocoaChainKit/CocoaChainKit/Classes/NotificationCenter+Chain.swift
ZSMHup/SwiftTool
c13251bfd9a0a54c479cb0c13ed3f0634a86cb53
[ "Apache-2.0" ]
null
null
null
SwiftTool/Pods/CocoaChainKit/CocoaChainKit/Classes/NotificationCenter+Chain.swift
ZSMHup/SwiftTool
c13251bfd9a0a54c479cb0c13ed3f0634a86cb53
[ "Apache-2.0" ]
2
2018-11-13T08:50:36.000Z
2019-11-19T13:24:05.000Z
// // NotificationCenter+Chain.swift // CocoaChainKit // // Created by GorXion on 2018/5/9. // public extension Chain where Base: NotificationCenter { @discardableResult func addObserver(_ observer: Any, selector aSelector: Selector, name aName: NSNotification.Name?, object anObject: Any? = nil) -> Chain { base.addObserver(observer, selector: aSelector, name: aName, object: anObject) return self } @discardableResult func post(_ notification: Notification) -> Chain { base.post(notification) return self } @discardableResult func post(name aName: NSNotification.Name, object anObject: Any? = nil, userInfo aUserInfo: [AnyHashable : Any]? = nil) -> Chain { base.post(name: aName, object: anObject, userInfo: aUserInfo) return self } @discardableResult func removeObserver(_ observer: Any, name aName: NSNotification.Name?, object anObject: Any?) -> Chain { base.removeObserver(observer, name: aName, object: anObject) return self } }
29.536585
86
0.590421
7c4a9bbfce298d4c669e8adf4f175a5f97bea88c
4,874
rs
Rust
src/cluster/model/mod.rs
webbrandon/cluster-cost
2e0ec09df01f3f01eadcfe11ec18998715df010c
[ "MIT" ]
null
null
null
src/cluster/model/mod.rs
webbrandon/cluster-cost
2e0ec09df01f3f01eadcfe11ec18998715df010c
[ "MIT" ]
null
null
null
src/cluster/model/mod.rs
webbrandon/cluster-cost
2e0ec09df01f3f01eadcfe11ec18998715df010c
[ "MIT" ]
null
null
null
use std::collections::BTreeMap; #[derive(Serialize, Deserialize, Debug, Default, Clone)] pub struct ClusterDetail { pub name: String, pub reserved_cpu_total: f64, pub reserved_memory_total: f64, pub node_type_field: String, pub node_type_value: String, pub namespace: String, pub replicas: i32, } impl ClusterDetail { pub fn new() -> ClusterDetail { Default::default() } pub fn from_deployment(&mut self, deploy: KubeDeployment) { if !deploy.spec.template.spec.containers.is_empty() { self.get_cpu_mem(deploy.spec.template.spec.containers); } self.set_replicas(deploy.status); self.set_metadata(deploy.metadata); self.set_node_type(deploy.spec.template.spec.nodeselector); } pub fn convert_unit(&mut self, unit: String, measure: String) -> f64 { let mut converted_unit: f64 = 0.0; if measure == "m" { let conversion: f64 = 1.0/1000.0; let u: f64 = unit.parse().unwrap(); converted_unit = conversion * u; } else if measure == "mi" { let conversion: f64 = 1.048576/1000.0; let u: f64 = unit.parse().unwrap(); converted_unit = conversion * u; } else if measure == "gi" { converted_unit = unit.parse().unwrap(); } converted_unit } pub fn get_cpu_mem(&mut self, containers: Vec<KubeContainer>) { let mut cpu: f64 = 0.0; let mut mem: f64 = 0.0; for container in containers { if let Some(resources) = container.resources.requests { let tmp_cpu_str = if resources.cpu.is_some() { resources.cpu.unwrap() } else { "0".to_string() }; let cpu_measure = tmp_cpu_str.clone().replace(&['0','1','2','3','4','5','6','7','8','9'][..], ""); cpu += self.convert_unit(tmp_cpu_str.replace(&['g', 'G', 'I', 'i', 'M', 'm'][..], ""), cpu_measure.clone()); let tmp_mem_str = if resources.memory.is_some() { resources.memory.unwrap() } else { "0".to_string() }; let mem_measure = tmp_mem_str.clone().replace(&['0','1','2','3','4','5','6','7','8','9'][..], ""); mem += self.convert_unit(tmp_mem_str.clone().replace(&['g', 'G', 'I', 'i', 'M', 'm'][..], ""), mem_measure.clone()); } } self.reserved_cpu_total = cpu; self.reserved_memory_total = mem; } pub fn set_replicas(&mut self, status: KubeStatus) { self.replicas = if status.replicas.is_some() {status.replicas.unwrap()} else {0}; } pub fn set_node_type(&mut self, node_type: BTreeMap<String, String>) { for (field, value) in &node_type { self.node_type_field = field.to_string(); self.node_type_value = if !value.is_empty() {value.to_string()} else {"default".to_string()}; } } pub fn set_metadata(&mut self, meta: KubeMetadata) { self.name = meta.name; self.namespace = meta.namespace; } } #[derive(Serialize, Deserialize, Debug, Default, Clone)] pub struct KubeDeployments { pub apiversion: Option<String>, pub items: Option<Vec<KubeDeployment>>, pub kind: Option<String>, } #[derive(Serialize, Deserialize, Debug, Default, Clone)] pub struct KubeDeployment { pub metadata: KubeMetadata, pub spec: KubeDeploymentSpec, pub status: KubeStatus, } #[derive(Serialize, Deserialize, Debug, Default, Clone)] pub struct KubeMetadata { pub name: String, pub namespace: String, } #[derive(Serialize, Deserialize, Debug, Default, Clone)] pub struct KubeDeploymentSpec { pub selector: KubeMatchLabels, pub template: KubePod, } #[derive(Serialize, Deserialize, Debug, Default, Clone)] pub struct KubeStatus { pub availablereplicas: Option<i32>, pub readyreplicas: Option<i32>, pub replicas: Option<i32>, pub updatedreplicas: Option<i32>, } #[derive(Serialize, Deserialize, Debug, Default, Clone)] pub struct KubeMatchLabels { #[serde(default)] pub matchlabels: BTreeMap<String, String>, } #[derive(Serialize, Deserialize, Debug, Default, Clone)] pub struct KubePod { pub spec: KubePodSpec, } #[derive(Serialize, Deserialize, Debug, Default, Clone)] pub struct KubePodSpec { pub containers: Vec<KubeContainer>, #[serde(default)] pub nodeselector: BTreeMap<String, String>, } #[derive(Serialize, Deserialize, Debug, Default, Clone)] pub struct KubeContainer { pub name: String, pub resources: KubeContainerResource, } #[derive(Serialize, Deserialize, Debug, Default, Clone)] pub struct KubeContainerResource { pub limits: Option<KubeCpuMemory>, pub requests: Option<KubeCpuMemory>, } #[derive(Serialize, Deserialize, Debug, Default, Clone)] pub struct KubeCpuMemory { pub cpu: Option<String>, pub memory: Option<String>, }
31.856209
132
0.630283
755271cfbc65f0a93a903dda0fd9ad3641b68aba
5,194
h
C
test/00-definitions.h
ElectronicRU/re2jitter
d32c30bf94ee2b5de3b7f76f4e334658fafa34ea
[ "MIT" ]
2
2016-05-16T04:25:43.000Z
2021-06-06T05:14:00.000Z
test/00-definitions.h
ElectronicRU/re2jitter
d32c30bf94ee2b5de3b7f76f4e334658fafa34ea
[ "MIT" ]
null
null
null
test/00-definitions.h
ElectronicRU/re2jitter
d32c30bf94ee2b5de3b7f76f4e334658fafa34ea
[ "MIT" ]
1
2018-03-25T08:42:48.000Z
2018-03-25T08:42:48.000Z
#include <algorithm> #include <ctime> #include <re2/re2.h> #include <re2jit/it.h> #define FORMAT_NAME(regex, anchor, input) \ FG GREEN #regex FG RESET " on " FG CYAN #input FG RESET " (" #anchor ")" template <typename T> bool match(const T &regexp, const re2::StringPiece& text, RE2::Anchor anchor, re2::StringPiece* groups, int ngroups); template <> bool match<RE2>(const RE2 &regexp, const re2::StringPiece& text, RE2::Anchor anchor, re2::StringPiece* groups, int ngroups) { return regexp.Match(text, 0, text.size(), anchor, groups, ngroups); } template <> bool match<re2jit::it>(const re2jit::it &regexp, const re2::StringPiece& text, RE2::Anchor anchor, re2::StringPiece* groups, int ngroups) { return regexp.match(text, anchor, groups, ngroups); } Result compare(bool am, bool bm, re2::StringPiece *a, re2::StringPiece *b, ssize_t n) { if (am != bm) return Result::Fail("invalid answer %d", am); if (am) for (ssize_t i = 0; i < n; i++, a++, b++) if (*a != *b) return Result::Fail( "group %zu incorrect\n" " expected [%d @ %p] '%.*s'\n" " matched [%d @ %p] '%.*s'", i, b->size(), b->data(), std::min(b->size(), 50), b->data(), a->size(), a->data(), std::min(a->size(), 50), a->data()); return Result::Pass("= %d", am); } #if __APPLE__ template <typename F> double measure(int, const F&&) { return 0; } #else template <typename F> double measure(int k, const F&& fn) { struct timespec start; struct timespec end; clock_gettime(CLOCK_MONOTONIC, &start); while (k--) fn(); clock_gettime(CLOCK_MONOTONIC, &end); auto s = end.tv_sec - start.tv_sec; auto n = end.tv_nsec - start.tv_nsec; return n * 1e-9 + s; } #endif #define GENERIC_TEST(name, regex, anchor, _input, ngroups, __fn, answer, ...) \ test_case(name) { \ re2::StringPiece input = _input; \ re2::StringPiece rgroups[ngroups]; \ re2::StringPiece egroups[ngroups] = { __VA_ARGS__ }; \ re2jit::it _r(regex); \ auto fn = __fn; \ return fn(match(_r, input, RE2::anchor, rgroups, ngroups), \ answer, rgroups, egroups, ngroups); \ } #define FIXED_TEST(regex, anchor, input, answer, ...) \ GENERIC_TEST(FORMAT_NAME(regex, anchor, input), regex, anchor, input, \ (sizeof((const char*[]){__VA_ARGS__})/sizeof(char*)), compare, answer, __VA_ARGS__) #define MATCH_TEST_NAMED(name, regex, anchor, _input, ngroups, __fn) \ GENERIC_TEST(name, regex, anchor, _input, ngroups, __fn, \ match(RE2(regex), input, RE2::anchor, egroups, ngroups)) #define MATCH_TEST(regex, anchor, input, n) \ MATCH_TEST_NAMED( \ FORMAT_NAME(regex, anchor, input), \ regex, anchor, input, n, compare) #if RE2JIT_DO_PERF_TESTS #define GENERIC_PERF_TEST(name, __n, setup, body, teardown) \ test_case(name) { \ setup \ double __t = measure(__n, [&]() { body }); \ teardown \ return Result::Pass("=> %f s", __t); \ } #else #define GENERIC_PERF_TEST(name, __n, setup, body, teardown) #endif #define PERF_TEST_NAMED(name, n, regex, anchor, _input, ngroups) \ GENERIC_PERF_TEST(name " [re2]", n \ , RE2 r(regex); \ re2::StringPiece m[ngroups]; \ re2::StringPiece i(_input, sizeof(_input) - 1); \ , match(r, i, RE2::anchor, m, ngroups); \ , {}); \ \ GENERIC_PERF_TEST(name " [jit]", n \ , re2jit::it r(regex); \ re2::StringPiece m[ngroups]; \ re2::StringPiece i(_input, sizeof(_input) - 1); \ , match(r, i, RE2::anchor, m, ngroups); \ , {}) #define MATCH_PERF_TEST_NAMED(name, n, regex, anchor, input, ngroups) \ MATCH_TEST_NAMED(name, regex, anchor, input, ngroups, compare); \ PERF_TEST_NAMED(name, n, regex, anchor, input, ngroups) #define MATCH_PERF_TEST(n, regex, anchor, input, ngroups) \ MATCH_PERF_TEST_NAMED( \ FORMAT_NAME(regex, anchor, input), \ n, regex, anchor, input, ngroups)
36.069444
98
0.475934
9197d5fba5ecb622d2763a9584b567b5fb67e764
591
lua
Lua
SampleMods/Better Explorer Icons/BuiltInPlugins/ServiceNameCorrection.lua
ZoniFIlm/Roblox-Studio-Mod-Manager
030f8ce7231c3f4cda8d3910e8f067188946fd32
[ "MIT" ]
1
2020-07-11T14:29:30.000Z
2020-07-11T14:29:30.000Z
SampleMods/Better Explorer Icons/BuiltInPlugins/ServiceNameCorrection.lua
ZoniFIlm/Roblox-Studio-Mod-Manager
030f8ce7231c3f4cda8d3910e8f067188946fd32
[ "MIT" ]
null
null
null
SampleMods/Better Explorer Icons/BuiltInPlugins/ServiceNameCorrection.lua
ZoniFIlm/Roblox-Studio-Mod-Manager
030f8ce7231c3f4cda8d3910e8f067188946fd32
[ "MIT" ]
1
2021-12-11T13:04:15.000Z
2021-12-11T13:04:15.000Z
-- @CloneTrooper1019, 2015 -- The purpose of this plugin is to fix some naming issues with the game services. -- Its not actually a plugin, I'm just using plugins since they are guarenteed to run when a place is opened. -- This plugin is obsolete if you don't have any ReflectionMetadata mod. function markService(service) pcall(function () -- In a pcall because this doesn't always work. if service.ClassName ~= "" then service.Name = service.ClassName end end) end for _,service in pairs(game:GetChildren()) do markService(service) end game.ServiceAdded:Connect(markService)
31.105263
109
0.756345
161e98a1877bc642ae1423270856144525095f82
715
h
C
src/header/shader/StochasticRayTraceShader.h
Gregjksmith/Global-Illumination
c8a2c98f3f9b810df18c49956e723a2df9b27a40
[ "MIT" ]
null
null
null
src/header/shader/StochasticRayTraceShader.h
Gregjksmith/Global-Illumination
c8a2c98f3f9b810df18c49956e723a2df9b27a40
[ "MIT" ]
null
null
null
src/header/shader/StochasticRayTraceShader.h
Gregjksmith/Global-Illumination
c8a2c98f3f9b810df18c49956e723a2df9b27a40
[ "MIT" ]
null
null
null
#pragma once #include "CollectiveShader.h" #include "../openGL/Renderbuffer.h" #include "../Controller.h" #include <time.h> #define STOCHASTIC_RAY_TRACE_ITERATIONS 1 #define SHADER_SOURCE_STOCHASTIC_RAY_TRACE_VERT "../bin/shaders/StochasticRayTrace/stochasticRayTraceVert.vs" #define SHADER_SOURCE_STOCHASTIC_RAY_TRACE_GEOM "../bin/shaders/StochasticRayTrace/stochasticRayTraceGeom.gs" #define SHADER_SOURCE_STOCHASTIC_RAY_TRACE_FRAG "../bin/shaders/StochasticRayTrace/stochasticRayTraceFrag.fs" class StochasticRayTraceShader : public CollectiveShader { public: StochasticRayTraceShader(); ~StochasticRayTraceShader(); virtual void render(); //Renderbuffer* rbo; Renderbuffer* rb; };
32.5
110
0.797203
cf60fc8fab00863e1e24775286071171b6d4fa52
105
sql
SQL
CapsData/Create Scripts/Tables/Constraints/CHK_Image_NoEmptyStrings.chkconst.sql
DzonnyDZ/Caps
48df49ad175e72f84f616845a30d3a053c596759
[ "MS-PL" ]
null
null
null
CapsData/Create Scripts/Tables/Constraints/CHK_Image_NoEmptyStrings.chkconst.sql
DzonnyDZ/Caps
48df49ad175e72f84f616845a30d3a053c596759
[ "MS-PL" ]
null
null
null
CapsData/Create Scripts/Tables/Constraints/CHK_Image_NoEmptyStrings.chkconst.sql
DzonnyDZ/Caps
48df49ad175e72f84f616845a30d3a053c596759
[ "MS-PL" ]
null
null
null
ALTER TABLE [dbo].[Image] ADD CONSTRAINT [CHK_Image_NoEmptyStrings] CHECK ([RelativePath]<>'');
26.25
74
0.685714
a0b227df059faa72a3693846cb700f61e43418da
22,413
swift
Swift
Cosmostation/ProtoBuff/kava_swap_v1beta1_tx.pb.swift
AlphaMale1st/cosmostation-ios
8ae7d4a00fdf77f525b2e5d8644b0cde02211b00
[ "MIT" ]
15
2021-11-06T17:06:36.000Z
2022-03-29T05:38:20.000Z
Cosmostation/ProtoBuff/kava_swap_v1beta1_tx.pb.swift
AlphaMale1st/cosmostation-ios
8ae7d4a00fdf77f525b2e5d8644b0cde02211b00
[ "MIT" ]
2
2021-11-15T18:41:54.000Z
2022-02-10T05:33:33.000Z
Cosmostation/ProtoBuff/kava_swap_v1beta1_tx.pb.swift
AlphaMale1st/cosmostation-ios
8ae7d4a00fdf77f525b2e5d8644b0cde02211b00
[ "MIT" ]
9
2021-11-07T07:35:39.000Z
2022-03-30T11:11:49.000Z
// DO NOT EDIT. // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: kava/swap/v1beta1/tx.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ import Foundation import SwiftProtobuf // If the compiler emits an error on this type, it is because this file // was generated by a version of the `protoc` Swift plug-in that is // incompatible with the version of SwiftProtobuf to which you are linking. // Please ensure that you are building against the same version of the API // that was used to generate this file. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } /// MsgDeposit represents a message for depositing liquidity into a pool struct Kava_Swap_V1beta1_MsgDeposit { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. /// depositor represents the address to deposit funds from var depositor: String = String() /// token_a represents one token of deposit pair var tokenA: Cosmos_Base_V1beta1_Coin { get {return _tokenA ?? Cosmos_Base_V1beta1_Coin()} set {_tokenA = newValue} } /// Returns true if `tokenA` has been explicitly set. var hasTokenA: Bool {return self._tokenA != nil} /// Clears the value of `tokenA`. Subsequent reads from it will return its default value. mutating func clearTokenA() {self._tokenA = nil} /// token_b represents one token of deposit pair var tokenB: Cosmos_Base_V1beta1_Coin { get {return _tokenB ?? Cosmos_Base_V1beta1_Coin()} set {_tokenB = newValue} } /// Returns true if `tokenB` has been explicitly set. var hasTokenB: Bool {return self._tokenB != nil} /// Clears the value of `tokenB`. Subsequent reads from it will return its default value. mutating func clearTokenB() {self._tokenB = nil} /// slippage represents the max decimal percentage price change var slippage: String = String() /// deadline represents the unix timestamp to complete the deposit by var deadline: Int64 = 0 var unknownFields = SwiftProtobuf.UnknownStorage() init() {} fileprivate var _tokenA: Cosmos_Base_V1beta1_Coin? = nil fileprivate var _tokenB: Cosmos_Base_V1beta1_Coin? = nil } /// MsgDepositResponse defines the Msg/Deposit response type. struct Kava_Swap_V1beta1_MsgDepositResponse { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } /// MsgWithdraw represents a message for withdrawing liquidity from a pool struct Kava_Swap_V1beta1_MsgWithdraw { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. /// from represents the address we are withdrawing for var from: String = String() /// shares represents the amount of shares to withdraw var shares: String = String() /// min_token_a represents the minimum a token to withdraw var minTokenA: Cosmos_Base_V1beta1_Coin { get {return _minTokenA ?? Cosmos_Base_V1beta1_Coin()} set {_minTokenA = newValue} } /// Returns true if `minTokenA` has been explicitly set. var hasMinTokenA: Bool {return self._minTokenA != nil} /// Clears the value of `minTokenA`. Subsequent reads from it will return its default value. mutating func clearMinTokenA() {self._minTokenA = nil} /// min_token_a represents the minimum a token to withdraw var minTokenB: Cosmos_Base_V1beta1_Coin { get {return _minTokenB ?? Cosmos_Base_V1beta1_Coin()} set {_minTokenB = newValue} } /// Returns true if `minTokenB` has been explicitly set. var hasMinTokenB: Bool {return self._minTokenB != nil} /// Clears the value of `minTokenB`. Subsequent reads from it will return its default value. mutating func clearMinTokenB() {self._minTokenB = nil} /// deadline represents the unix timestamp to complete the withdraw by var deadline: Int64 = 0 var unknownFields = SwiftProtobuf.UnknownStorage() init() {} fileprivate var _minTokenA: Cosmos_Base_V1beta1_Coin? = nil fileprivate var _minTokenB: Cosmos_Base_V1beta1_Coin? = nil } /// MsgWithdrawResponse defines the Msg/Withdraw response type. struct Kava_Swap_V1beta1_MsgWithdrawResponse { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } /// MsgSwapExactForTokens represents a message for trading exact coinA for coinB struct Kava_Swap_V1beta1_MsgSwapExactForTokens { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. /// represents the address swaping the tokens var requester: String = String() /// exact_token_a represents the exact amount to swap for token_b var exactTokenA: Cosmos_Base_V1beta1_Coin { get {return _exactTokenA ?? Cosmos_Base_V1beta1_Coin()} set {_exactTokenA = newValue} } /// Returns true if `exactTokenA` has been explicitly set. var hasExactTokenA: Bool {return self._exactTokenA != nil} /// Clears the value of `exactTokenA`. Subsequent reads from it will return its default value. mutating func clearExactTokenA() {self._exactTokenA = nil} /// token_b represents the desired token_b to swap for var tokenB: Cosmos_Base_V1beta1_Coin { get {return _tokenB ?? Cosmos_Base_V1beta1_Coin()} set {_tokenB = newValue} } /// Returns true if `tokenB` has been explicitly set. var hasTokenB: Bool {return self._tokenB != nil} /// Clears the value of `tokenB`. Subsequent reads from it will return its default value. mutating func clearTokenB() {self._tokenB = nil} /// slippage represents the maximum change in token_b allowed var slippage: String = String() /// deadline represents the unix timestamp to complete the swap by var deadline: Int64 = 0 var unknownFields = SwiftProtobuf.UnknownStorage() init() {} fileprivate var _exactTokenA: Cosmos_Base_V1beta1_Coin? = nil fileprivate var _tokenB: Cosmos_Base_V1beta1_Coin? = nil } /// MsgSwapExactForTokensResponse defines the Msg/SwapExactForTokens response /// type. struct Kava_Swap_V1beta1_MsgSwapExactForTokensResponse { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } /// MsgSwapForExactTokens represents a message for trading coinA for an exact /// coinB struct Kava_Swap_V1beta1_MsgSwapForExactTokens { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. /// represents the address swaping the tokens var requester: String = String() /// token_a represents the desired token_a to swap for var tokenA: Cosmos_Base_V1beta1_Coin { get {return _tokenA ?? Cosmos_Base_V1beta1_Coin()} set {_tokenA = newValue} } /// Returns true if `tokenA` has been explicitly set. var hasTokenA: Bool {return self._tokenA != nil} /// Clears the value of `tokenA`. Subsequent reads from it will return its default value. mutating func clearTokenA() {self._tokenA = nil} /// exact_token_b represents the exact token b amount to swap for token a var exactTokenB: Cosmos_Base_V1beta1_Coin { get {return _exactTokenB ?? Cosmos_Base_V1beta1_Coin()} set {_exactTokenB = newValue} } /// Returns true if `exactTokenB` has been explicitly set. var hasExactTokenB: Bool {return self._exactTokenB != nil} /// Clears the value of `exactTokenB`. Subsequent reads from it will return its default value. mutating func clearExactTokenB() {self._exactTokenB = nil} /// slippage represents the maximum change in token_a allowed var slippage: String = String() /// deadline represents the unix timestamp to complete the swap by var deadline: Int64 = 0 var unknownFields = SwiftProtobuf.UnknownStorage() init() {} fileprivate var _tokenA: Cosmos_Base_V1beta1_Coin? = nil fileprivate var _exactTokenB: Cosmos_Base_V1beta1_Coin? = nil } /// MsgSwapForExactTokensResponse defines the Msg/SwapForExactTokensResponse /// response type. struct Kava_Swap_V1beta1_MsgSwapForExactTokensResponse { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } // MARK: - Code below here is support for the SwiftProtobuf runtime. fileprivate let _protobuf_package = "kava.swap.v1beta1" extension Kava_Swap_V1beta1_MsgDeposit: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".MsgDeposit" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "depositor"), 2: .standard(proto: "token_a"), 3: .standard(proto: "token_b"), 4: .same(proto: "slippage"), 5: .same(proto: "deadline"), ] mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { // The use of inline closures is to circumvent an issue where the compiler // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { case 1: try { try decoder.decodeSingularStringField(value: &self.depositor) }() case 2: try { try decoder.decodeSingularMessageField(value: &self._tokenA) }() case 3: try { try decoder.decodeSingularMessageField(value: &self._tokenB) }() case 4: try { try decoder.decodeSingularStringField(value: &self.slippage) }() case 5: try { try decoder.decodeSingularInt64Field(value: &self.deadline) }() default: break } } } func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { if !self.depositor.isEmpty { try visitor.visitSingularStringField(value: self.depositor, fieldNumber: 1) } if let v = self._tokenA { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) } if let v = self._tokenB { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) } if !self.slippage.isEmpty { try visitor.visitSingularStringField(value: self.slippage, fieldNumber: 4) } if self.deadline != 0 { try visitor.visitSingularInt64Field(value: self.deadline, fieldNumber: 5) } try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Kava_Swap_V1beta1_MsgDeposit, rhs: Kava_Swap_V1beta1_MsgDeposit) -> Bool { if lhs.depositor != rhs.depositor {return false} if lhs._tokenA != rhs._tokenA {return false} if lhs._tokenB != rhs._tokenB {return false} if lhs.slippage != rhs.slippage {return false} if lhs.deadline != rhs.deadline {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Kava_Swap_V1beta1_MsgDepositResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".MsgDepositResponse" static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { while let _ = try decoder.nextFieldNumber() { } } func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Kava_Swap_V1beta1_MsgDepositResponse, rhs: Kava_Swap_V1beta1_MsgDepositResponse) -> Bool { if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Kava_Swap_V1beta1_MsgWithdraw: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".MsgWithdraw" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "from"), 2: .same(proto: "shares"), 3: .standard(proto: "min_token_a"), 4: .standard(proto: "min_token_b"), 5: .same(proto: "deadline"), ] mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { // The use of inline closures is to circumvent an issue where the compiler // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { case 1: try { try decoder.decodeSingularStringField(value: &self.from) }() case 2: try { try decoder.decodeSingularStringField(value: &self.shares) }() case 3: try { try decoder.decodeSingularMessageField(value: &self._minTokenA) }() case 4: try { try decoder.decodeSingularMessageField(value: &self._minTokenB) }() case 5: try { try decoder.decodeSingularInt64Field(value: &self.deadline) }() default: break } } } func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { if !self.from.isEmpty { try visitor.visitSingularStringField(value: self.from, fieldNumber: 1) } if !self.shares.isEmpty { try visitor.visitSingularStringField(value: self.shares, fieldNumber: 2) } if let v = self._minTokenA { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) } if let v = self._minTokenB { try visitor.visitSingularMessageField(value: v, fieldNumber: 4) } if self.deadline != 0 { try visitor.visitSingularInt64Field(value: self.deadline, fieldNumber: 5) } try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Kava_Swap_V1beta1_MsgWithdraw, rhs: Kava_Swap_V1beta1_MsgWithdraw) -> Bool { if lhs.from != rhs.from {return false} if lhs.shares != rhs.shares {return false} if lhs._minTokenA != rhs._minTokenA {return false} if lhs._minTokenB != rhs._minTokenB {return false} if lhs.deadline != rhs.deadline {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Kava_Swap_V1beta1_MsgWithdrawResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".MsgWithdrawResponse" static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { while let _ = try decoder.nextFieldNumber() { } } func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Kava_Swap_V1beta1_MsgWithdrawResponse, rhs: Kava_Swap_V1beta1_MsgWithdrawResponse) -> Bool { if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Kava_Swap_V1beta1_MsgSwapExactForTokens: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".MsgSwapExactForTokens" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "requester"), 2: .standard(proto: "exact_token_a"), 3: .standard(proto: "token_b"), 4: .same(proto: "slippage"), 5: .same(proto: "deadline"), ] mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { // The use of inline closures is to circumvent an issue where the compiler // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { case 1: try { try decoder.decodeSingularStringField(value: &self.requester) }() case 2: try { try decoder.decodeSingularMessageField(value: &self._exactTokenA) }() case 3: try { try decoder.decodeSingularMessageField(value: &self._tokenB) }() case 4: try { try decoder.decodeSingularStringField(value: &self.slippage) }() case 5: try { try decoder.decodeSingularInt64Field(value: &self.deadline) }() default: break } } } func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { if !self.requester.isEmpty { try visitor.visitSingularStringField(value: self.requester, fieldNumber: 1) } if let v = self._exactTokenA { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) } if let v = self._tokenB { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) } if !self.slippage.isEmpty { try visitor.visitSingularStringField(value: self.slippage, fieldNumber: 4) } if self.deadline != 0 { try visitor.visitSingularInt64Field(value: self.deadline, fieldNumber: 5) } try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Kava_Swap_V1beta1_MsgSwapExactForTokens, rhs: Kava_Swap_V1beta1_MsgSwapExactForTokens) -> Bool { if lhs.requester != rhs.requester {return false} if lhs._exactTokenA != rhs._exactTokenA {return false} if lhs._tokenB != rhs._tokenB {return false} if lhs.slippage != rhs.slippage {return false} if lhs.deadline != rhs.deadline {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Kava_Swap_V1beta1_MsgSwapExactForTokensResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".MsgSwapExactForTokensResponse" static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { while let _ = try decoder.nextFieldNumber() { } } func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Kava_Swap_V1beta1_MsgSwapExactForTokensResponse, rhs: Kava_Swap_V1beta1_MsgSwapExactForTokensResponse) -> Bool { if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Kava_Swap_V1beta1_MsgSwapForExactTokens: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".MsgSwapForExactTokens" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "requester"), 2: .standard(proto: "token_a"), 3: .standard(proto: "exact_token_b"), 4: .same(proto: "slippage"), 5: .same(proto: "deadline"), ] mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { // The use of inline closures is to circumvent an issue where the compiler // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { case 1: try { try decoder.decodeSingularStringField(value: &self.requester) }() case 2: try { try decoder.decodeSingularMessageField(value: &self._tokenA) }() case 3: try { try decoder.decodeSingularMessageField(value: &self._exactTokenB) }() case 4: try { try decoder.decodeSingularStringField(value: &self.slippage) }() case 5: try { try decoder.decodeSingularInt64Field(value: &self.deadline) }() default: break } } } func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { if !self.requester.isEmpty { try visitor.visitSingularStringField(value: self.requester, fieldNumber: 1) } if let v = self._tokenA { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) } if let v = self._exactTokenB { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) } if !self.slippage.isEmpty { try visitor.visitSingularStringField(value: self.slippage, fieldNumber: 4) } if self.deadline != 0 { try visitor.visitSingularInt64Field(value: self.deadline, fieldNumber: 5) } try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Kava_Swap_V1beta1_MsgSwapForExactTokens, rhs: Kava_Swap_V1beta1_MsgSwapForExactTokens) -> Bool { if lhs.requester != rhs.requester {return false} if lhs._tokenA != rhs._tokenA {return false} if lhs._exactTokenB != rhs._exactTokenB {return false} if lhs.slippage != rhs.slippage {return false} if lhs.deadline != rhs.deadline {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Kava_Swap_V1beta1_MsgSwapForExactTokensResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".MsgSwapForExactTokensResponse" static let _protobuf_nameMap = SwiftProtobuf._NameMap() mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { while let _ = try decoder.nextFieldNumber() { } } func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Kava_Swap_V1beta1_MsgSwapForExactTokensResponse, rhs: Kava_Swap_V1beta1_MsgSwapForExactTokensResponse) -> Bool { if lhs.unknownFields != rhs.unknownFields {return false} return true } }
41.124771
159
0.736983
2213c2f28f13c6bb36d9e47812ef485900022316
2,189
kt
Kotlin
rxpm/src/test/kotlin/me/dmdev/rxpm/widget/CheckControlTest.kt
dmdevgo/RxPM
a7c5890553cf96b13e14055697b83d196c4f4100
[ "MIT" ]
197
2017-07-22T06:51:21.000Z
2021-12-06T13:11:31.000Z
rxpm/src/test/kotlin/me/dmdev/rxpm/widget/CheckControlTest.kt
dmdevgo/RxPM
a7c5890553cf96b13e14055697b83d196c4f4100
[ "MIT" ]
39
2017-07-26T23:04:09.000Z
2021-11-12T12:17:41.000Z
rxpm/src/test/kotlin/me/dmdev/rxpm/widget/CheckControlTest.kt
dmdevgo/RxPM
a7c5890553cf96b13e14055697b83d196c4f4100
[ "MIT" ]
21
2017-07-25T20:02:59.000Z
2021-04-14T18:41:20.000Z
/* * The MIT License (MIT) * * Copyright (c) 2017-2021 Dmitriy Gorbunov (dmitriy.goto@gmail.com) * and Vasili Chyrvon (vasili.chyrvon@gmail.com) * * 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. */ package me.dmdev.rxpm.widget import me.dmdev.rxpm.PresentationModel import me.dmdev.rxpm.PresentationModel.Lifecycle.CREATED import me.dmdev.rxpm.test.PmTestHelper import org.junit.Test class CheckControlTest { @Test fun filterIfValueNotChanged() { val pm = object : PresentationModel() {} val pmTestHelper = PmTestHelper(pm) val checkbox = pm.checkControl() pmTestHelper.setLifecycleTo(CREATED) val testObserver = checkbox.checked.observable.test() checkbox.checkedChanges.consumer.run { accept(true) accept(true) accept(false) accept(false) accept(true) accept(false) } testObserver .assertValues( false, // initial value true, false, true, false ) .assertNoErrors() } }
34.203125
81
0.671083
469bc797746fb675a843b9b232eca947d06de9e0
1,419
css
CSS
notice/assets/fonts/Open_Sans_Hebrew/fonts.css
ccmksy/WRASA
b08972d7a259fd4e53fdbccb6acb13d616e7df5b
[ "MIT" ]
1
2017-06-19T16:32:35.000Z
2017-06-19T16:32:35.000Z
notice/assets/fonts/Open_Sans_Hebrew/fonts.css
ccmksy/WRASA---Security-Alarm
b08972d7a259fd4e53fdbccb6acb13d616e7df5b
[ "MIT" ]
null
null
null
notice/assets/fonts/Open_Sans_Hebrew/fonts.css
ccmksy/WRASA---Security-Alarm
b08972d7a259fd4e53fdbccb6acb13d616e7df5b
[ "MIT" ]
null
null
null
@font-face { font-family: 'Open Sans Hebrew'; font-style: normal; font-weight: 800; src: url(Opensanshebrew-extrabold-webfont.eot); src: url(opensanshebrew-extrabold-webfont.eot?#iefix) format('embedded-opentype'), url(opensanshebrew-extrabold-webfont.woff) format('woff'), url(opensanshebrew-extrabold-webfont.ttf) format('truetype'); } @font-face { font-family: 'Open Sans Hebrew'; font-style: normal; font-weight: 700; src: url(Opensanshebrew-bold-webfont.eot); src: url(opensanshebrew-bold-webfont.eot?#iefix) format('embedded-opentype'), url(opensanshebrew-bold-webfont.woff) format('woff'), url(opensanshebrew-bold-webfont.ttf) format('truetype'); } @font-face { font-family: 'Open Sans Hebrew'; font-style: normal; font-weight: 400; src: url(Opensanshebrew-regular-webfont.eot); src: url(opensanshebrew-regular-webfont.eot?#iefix) format('embedded-opentype'), url(opensanshebrew-regular-webfont.woff) format('woff'), url(opensanshebrew-regular-webfont.ttf) format('truetype'); } @font-face { font-family: 'Open Sans Hebrew'; font-style: normal; font-weight: 300; src: url(Opensanshebrew-light-webfont.eot); src: url(opensanshebrew-light-webfont.eot?#iefix) format('embedded-opentype'), url(opensanshebrew-light-webfont.woff) format('woff'), url(opensanshebrew-light-webfont.ttf) format('truetype'); }
39.416667
86
0.707541
c336cf85b315ca3b58cbb69abfec4d35ced3dbee
159
go
Go
internal/helper/hash.go
chyroc/grss
b06a6b5ddbe3369ac35cba96a5bd322b139f0c41
[ "Apache-2.0" ]
null
null
null
internal/helper/hash.go
chyroc/grss
b06a6b5ddbe3369ac35cba96a5bd322b139f0c41
[ "Apache-2.0" ]
1
2021-09-29T09:58:21.000Z
2021-09-29T09:58:21.000Z
internal/helper/hash.go
chyroc/grss
b06a6b5ddbe3369ac35cba96a5bd322b139f0c41
[ "Apache-2.0" ]
null
null
null
package helper import ( "crypto/md5" "fmt" ) func Md5(s string) string { ins := md5.New() ins.Write([]byte(s)) return fmt.Sprintf("%x", ins.Sum(nil)) }
12.230769
39
0.622642
6a57e477da99236e4a60f0231765d7df329a8863
4,927
swift
Swift
Sources/SFUserFriendlySymbols/SFSymbols/SFSymbols+CategorySymbols/SFSymbols+commerceSymbols.swift
littleossa/SFUserFriendlySymbols
9d003e1c818de1dbe34a36b197ce11d9524a54d9
[ "MIT" ]
25
2022-01-26T23:54:22.000Z
2022-03-24T03:42:50.000Z
Sources/SFUserFriendlySymbols/SFSymbols/SFSymbols+CategorySymbols/SFSymbols+commerceSymbols.swift
littleossa/SFUserFriendlySymbols
9d003e1c818de1dbe34a36b197ce11d9524a54d9
[ "MIT" ]
2
2022-01-27T06:48:14.000Z
2022-01-29T21:56:24.000Z
Sources/SFUserFriendlySymbols/SFSymbols/SFSymbols+CategorySymbols/SFSymbols+commerceSymbols.swift
littleossa/SFUserFriendlySymbols
9d003e1c818de1dbe34a36b197ce11d9524a54d9
[ "MIT" ]
1
2022-01-27T04:11:58.000Z
2022-01-27T04:11:58.000Z
// // SFSymbols+commerceSymbols.swift // // Created by littleossa // // enjoy! import Foundation extension SFSymbols { public static var commerceSymbols: [SFSymbols] { var commerceSymbols = [SFSymbols]() if #available(iOS 13.0, macOS 11.0, macCatalyst 13.0, tvOS 13.0, watchOS 6.0, *) { commerceSymbols += SFSymbols.availableCommerceSymbolsFromSFSymbols1 } if #available(iOS 14.0, macOS 11.0, macCatalyst 14.0, tvOS 14.0, watchOS 7.0, *) { commerceSymbols += SFSymbols.availableCommerceSymbolsFromSFSymbols2 } if #available(iOS 14.2, macOS 11.0, macCatalyst 14.2, tvOS 14.2, watchOS 7.1, *) { commerceSymbols += SFSymbols.availableCommerceSymbolsFromSFSymbols2_1 } if #available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) { commerceSymbols += SFSymbols.availableCommerceSymbolsFromSFSymbols3 } return commerceSymbols } @available(iOS 13.0, macOS 11.0, macCatalyst 13.0, tvOS 13.0, watchOS 6.0, *) private static var availableCommerceSymbolsFromSFSymbols1: [SFSymbols] { [.signature, .bag, .bagFill, .bagBadgePlus, .bagFillBadgePlus, .bagBadgeMinus, .bagFillBadgeMinus, .cart, .cartFill, .cartBadgePlus, .cartFillBadgePlus, .cartBadgeMinus, .cartFillBadgeMinus, .creditcard, .creditcardFill, .dollarsignCircle, .dollarsignCircleFill, .dollarsignSquare, .dollarsignSquareFill, .centsignCircle, .centsignCircleFill, .centsignSquare, .centsignSquareFill, .yensignCircle, .yensignCircleFill, .yensignSquare, .yensignSquareFill, .sterlingsignCircle, .sterlingsignCircleFill, .sterlingsignSquare, .sterlingsignSquareFill, .francsignCircle, .francsignCircleFill, .francsignSquare, .francsignSquareFill, .florinsignCircle, .florinsignCircleFill, .florinsignSquare, .florinsignSquareFill, .turkishlirasignCircle, .turkishlirasignCircleFill, .turkishlirasignSquare, .turkishlirasignSquareFill, .rublesignCircle, .rublesignCircleFill, .rublesignSquare, .rublesignSquareFill, .eurosignCircle, .eurosignCircleFill, .eurosignSquare, .eurosignSquareFill, .dongsignCircle, .dongsignCircleFill, .dongsignSquare, .dongsignSquareFill, .indianrupeesignCircle, .indianrupeesignCircleFill, .indianrupeesignSquare, .indianrupeesignSquareFill, .tengesignCircle, .tengesignCircleFill, .tengesignSquare, .tengesignSquareFill, .pesetasignCircle, .pesetasignCircleFill, .pesetasignSquare, .pesetasignSquareFill, .pesosignCircle, .pesosignCircleFill, .pesosignSquare, .pesosignSquareFill, .kipsignCircle, .kipsignCircleFill, .kipsignSquare, .kipsignSquareFill, .wonsignCircle, .wonsignCircleFill, .wonsignSquare, .wonsignSquareFill, .lirasignCircle, .lirasignCircleFill, .lirasignSquare, .lirasignSquareFill, .australsignCircle, .australsignCircleFill, .australsignSquare, .australsignSquareFill, .hryvniasignCircle, .hryvniasignCircleFill, .hryvniasignSquare, .hryvniasignSquareFill, .nairasignCircle, .nairasignCircleFill, .nairasignSquare, .nairasignSquareFill, .guaranisignCircle, .guaranisignCircleFill, .guaranisignSquare, .guaranisignSquareFill, .coloncurrencysignCircle, .coloncurrencysignCircleFill, .coloncurrencysignSquare, .coloncurrencysignSquareFill, .cedisignCircle, .cedisignCircleFill, .cedisignSquare, .cedisignSquareFill, .cruzeirosignCircle, .cruzeirosignCircleFill, .cruzeirosignSquare, .cruzeirosignSquareFill, .tugriksignCircle, .tugriksignCircleFill, .tugriksignSquare, .tugriksignSquareFill, .millsignCircle, .millsignCircleFill, .millsignSquare, .millsignSquareFill, .manatsignCircle, .manatsignCircleFill, .manatsignSquare, .manatsignSquareFill, .rupeesignCircle, .rupeesignCircleFill, .rupeesignSquare, .rupeesignSquareFill, .bahtsignCircle, .bahtsignCircleFill, .bahtsignSquare, .bahtsignSquareFill, .larisignCircle, .larisignCircleFill, .larisignSquare, .larisignSquareFill, .bitcoinsignCircle, .bitcoinsignCircleFill, .bitcoinsignSquare, .bitcoinsignSquareFill] } @available(iOS 14.0, macOS 11.0, macCatalyst 14.0, tvOS 14.0, watchOS 7.0, *) private static var availableCommerceSymbolsFromSFSymbols2: [SFSymbols] { [.bagCircle, .bagCircleFill, .creditcardCircle, .creditcardCircleFill, .giftcard, .giftcardFill, .banknote, .banknoteFill, .shekelsignCircle, .shekelsignCircleFill, .shekelsignSquare, .shekelsignSquareFill] } @available(iOS 14.2, macOS 11.0, macCatalyst 14.2, tvOS 14.2, watchOS 7.1, *) private static var availableCommerceSymbolsFromSFSymbols2_1: [SFSymbols] { [.cartCircle, .cartCircleFill, .brazilianrealsignCircle, .brazilianrealsignCircleFill, .brazilianrealsignSquare, .brazilianrealsignSquareFill] } @available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) private static var availableCommerceSymbolsFromSFSymbols3: [SFSymbols] { [.creditcardAnd123, .creditcardTrianglebadgeExclamationmark] } }
96.607843
2,800
0.777958
7031536ebbf2f942017380f8a3e37a8c3d47775d
5,329
asm
Assembly
data/cries.asm
AmateurPanda92/pokemon-rby-dx
f7ba1cc50b22d93ed176571e074a52d73360da93
[ "MIT" ]
9
2020-07-12T19:44:21.000Z
2022-03-03T23:32:40.000Z
data/cries.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
7
2020-07-16T10:48:52.000Z
2021-01-28T18:32:02.000Z
data/cries.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
2
2021-03-28T18:33:43.000Z
2021-05-06T13:12:09.000Z
CryData: ;$BaseCry, $Pitch, $Length db $11, $00, $80; Rhydon db $03, $00, $80; Kangaskhan db $00, $00, $80; Nidoran♂ db $19, $CC, $01; Clefairy db $10, $00, $80; Spearow db $06, $ED, $80; Voltorb db $09, $00, $80; Nidoking db $1F, $00, $80; Slowbro db $0F, $20, $80; Ivysaur db $0D, $00, $80; Exeggutor db $0C, $00, $80; Lickitung db $0B, $00, $80; Exeggcute db $05, $00, $80; Grimer db $07, $00, $FF; Gengar db $01, $00, $80; Nidoran♀ db $0A, $00, $80; Nidoqueen db $19, $00, $80; Cubone db $04, $00, $80; Rhyhorn db $1B, $00, $80; Lapras db $15, $00, $80; Arcanine db $1E, $EE, $FF; Mew db $17, $00, $80; Gyarados db $18, $00, $80; Shellder db $1A, $00, $80; Tentacool db $1C, $00, $80; Gastly db $16, $00, $80; Scyther db $1E, $02, $20; Staryu db $13, $00, $80; Blastoise db $14, $00, $80; Pinsir db $12, $00, $80; Tangela db $00, $00, $00; MissingNo. db $00, $00, $00; MissingNo. db $1F, $20, $40; Growlithe db $17, $FF, $C0; Onix db $18, $40, $A0; Fearow db $0E, $DF, $04; Pidgey db $02, $00, $80; Slowpoke db $1C, $A8, $C0; Kadabra db $24, $00, $80; Graveler db $14, $0A, $C0; Chansey db $1F, $48, $60; Machoke db $20, $08, $40; Mr.Mime db $12, $80, $C0; Hitmonlee db $0C, $EE, $C0; Hitmonchan db $17, $E0, $10; Arbok db $1E, $42, $FF; Parasect db $21, $20, $60; Psyduck db $0D, $88, $20; Drowzee db $12, $E0, $40; Golem db $00, $00, $00; MissingNo. db $04, $FF, $30; Magmar db $00, $00, $00; MissingNo. db $06, $8F, $FF; Electabuzz db $1C, $20, $C0; Magneton db $12, $E6, $DD; Koffing db $00, $00, $00; MissingNo. db $0A, $DD, $60; Mankey db $0C, $88, $C0; Seel db $0B, $AA, $01; Diglett db $1D, $11, $40; Tauros db $00, $00, $00; MissingNo. db $00, $00, $00; MissingNo. db $00, $00, $00; MissingNo. db $10, $DD, $01; Farfetch'd db $1A, $44, $40; Venonat db $0F, $3C, $C0; Dragonite db $00, $80, $10; MissingNo. db $00, $00, $00; MissingNo. db $1D, $E0, $80; MissingNo. db $0B, $BB, $01; Doduo db $0E, $FF, $FF; Poliwag db $0D, $FF, $FF; Jynx db $09, $F8, $40; Moltres db $09, $80, $40; Articuno db $18, $FF, $80; Zapdos db $0E, $FF, $FF; Ditto db $19, $77, $10; Meowth db $20, $20, $E0; Krabby db $22, $FF, $40; MissingNo. db $00, $00, $00; MissingNo. db $0E, $E0, $60; MissingNo. db $24, $4F, $10; Vulpix db $24, $88, $60; Ninetales db $0F, $EE, $01; Pikachu db $09, $EE, $08; Raichu db $00, $00, $00; MissingNo. db $00, $00, $00; MissingNo. db $0F, $60, $40; Dratini db $0F, $40, $80; Dragonair db $16, $BB, $40; Kabuto db $18, $EE, $01; Kabutops db $19, $99, $10; Horsea db $19, $3C, $01; Seadra db $0F, $40, $C0; MissingNo. db $0F, $20, $C0; MissingNo. db $00, $20, $40; Sandshrew db $00, $FF, $FF; Sandslash db $1F, $F0, $01; Omanyte db $1F, $FF, $40; Omastar db $0E, $FF, $35; Jigglypuff db $0E, $68, $60; Wigglytuff db $1A, $88, $60; Eevee db $1A, $10, $20; Flareon db $1A, $3D, $80; Jolteon db $1A, $AA, $FF; Vaporeon db $1F, $EE, $01; Machop db $1D, $E0, $80; Zubat db $17, $12, $40; Ekans db $1E, $20, $E0; Paras db $0E, $77, $60; Poliwhirl db $0E, $00, $FF; Poliwrath db $15, $EE, $01; Weedle db $13, $FF, $01; Kakuna db $13, $60, $80; Beedrill db $00, $00, $00; MissingNo. db $0B, $99, $20; Dodrio db $0A, $AF, $40; Primeape db $0B, $2A, $10; Dugtrio db $1A, $29, $80; Venomoth db $0C, $23, $FF; Dewgong db $00, $00, $00; MissingNo. db $00, $00, $00; MissingNo. db $16, $80, $20; Caterpie db $1C, $CC, $01; Metapod db $16, $77, $40; Butterfree db $1F, $08, $C0; Machamp db $11, $20, $10; MissingNo. db $21, $FF, $40; Golduck db $0D, $EE, $40; Hypno db $1D, $FA, $80; Golbat db $1E, $99, $FF; Mewtwo db $05, $55, $01; Snorlax db $17, $80, $00; Magikarp db $00, $00, $00; MissingNo. db $00, $00, $00; MissingNo. db $07, $EF, $FF; Muk db $0F, $40, $80; MissingNo. db $20, $EE, $E0; Kingler db $18, $6F, $E0; Cloyster db $00, $00, $00; MissingNo. db $06, $A8, $90; Electrode db $19, $AA, $20; Clefable db $12, $FF, $FF; Weezing db $19, $99, $FF; Persian db $08, $4F, $60; Marowak db $00, $00, $00; MissingNo. db $1C, $30, $40; Haunter db $1C, $C0, $01; Abra db $1C, $98, $FF; Alakazam db $14, $28, $C0; Pidgeotto db $14, $11, $FF; Pidgeot db $1E, $00, $80; Starmie db $0F, $80, $01; Bulbasaur db $0F, $00, $C0; Venusaur db $1A, $EE, $FF; Tentacruel db $00, $00, $00; MissingNo. db $16, $80, $40; Goldeen db $16, $10, $FF; Seaking db $00, $00, $00; MissingNo. db $00, $00, $00; MissingNo. db $00, $00, $00; MissingNo. db $00, $00, $00; MissingNo. db $25, $00, $80; Ponyta db $25, $20, $C0; Rapidash db $22, $00, $80; Rattata db $22, $20, $FF; Raticate db $00, $2C, $C0; Nidorino db $01, $2C, $E0; Nidorina db $24, $F0, $10; Geodude db $25, $AA, $FF; Porygon db $23, $20, $F0; Aerodactyl db $00, $00, $00; MissingNo. db $1C, $80, $60; Magnemite db $00, $00, $00; MissingNo. db $00, $00, $00; MissingNo. db $04, $60, $40; Charmander db $1D, $60, $40; Squirtle db $04, $20, $40; Charmeleon db $1D, $20, $40; Wartortle db $04, $00, $80; Charizard db $1D, $00, $80; MissingNo. db $00, $00, $00; MissingNo. db $00, $00, $00; MissingNo. db $00, $00, $00; MissingNo. db $08, $DD, $01; Oddish db $08, $AA, $40; Gloom db $23, $22, $FF; Vileplume db $21, $55, $01; Bellsprout db $25, $44, $20; Weepinbell db $25, $66, $CC; Victreebel
27.611399
29
0.561831
9c7379b6ce1dc83dad9aa23483520f1a98300b5b
4,421
js
JavaScript
lib/bible-tools/bibles/it/nr2006/books/65.js
saiba-mais/bible-lessons
6c352c1060c48b80f74f8bf0c1cbff5450de2fe6
[ "MIT" ]
null
null
null
lib/bible-tools/bibles/it/nr2006/books/65.js
saiba-mais/bible-lessons
6c352c1060c48b80f74f8bf0c1cbff5450de2fe6
[ "MIT" ]
null
null
null
lib/bible-tools/bibles/it/nr2006/books/65.js
saiba-mais/bible-lessons
6c352c1060c48b80f74f8bf0c1cbff5450de2fe6
[ "MIT" ]
null
null
null
var book = { "name": "Giuda", "numChapters": 1, "chapters": { "1": { "1": "<sup>1</sup> Indirizzo e saluti\nGiuda, servo di Gesù Cristo e fratello di Giacomo, ai chiamati che sono amati in Dio Padre e custoditi da Gesù Cristo:", "2": "<sup>2</sup> misericordia, pace e amore vi siano moltiplicati.", "3": "<sup>3</sup> Contro gli empi e i falsi dottori\nCarissimi, avendo un gran desiderio di scrivervi della nostra comune salvezza, mi sono trovato costretto a farlo per esortarvi a combattere strenuamente per la fede, che è stata trasmessa ai santi una volta per sempre.", "4": "<sup>4</sup> Perché si sono infiltrati fra di voi certi uomini (per i quali già da tempo è scritta questa condanna); empi che volgono in dissolutezza la grazia del nostro Dio e negano il nostro unico Padrone e Signore Gesù Cristo.", "5": "<sup>5</sup> Ora voglio ricordare a voi che avete da tempo conosciuto tutto questo, che il Signore, dopo aver tratto in salvo il popolo dal paese d’Egitto, fece in seguito perire quelli che non credettero.", "6": "<sup>6</sup> Egli ha pure custodito nelle tenebre e in catene eterne, per il gran giorno del giudizio, gli angeli che non conservarono la loro dignità e abbandonarono la loro dimora.", "7": "<sup>7</sup> Allo stesso modo Sodoma e Gomorra e le città vicine, che si abbandonarono, come loro, alla fornicazione e ai vizi contro natura, sono date come esempio, portando la pena di un fuoco eterno.", "8": "<sup>8</sup> Ciò nonostante, anche questi visionari contaminano la carne nello stesso modo, disprezzano l’autorità e parlano male delle dignità.", "9": "<sup>9</sup> Invece, l’arcangelo Michele, quando contendeva con il diavolo disputando per il corpo di Mosè, non osò pronunciare contro di lui un giudizio ingiurioso, ma disse: «Ti sgridi il Signore!»", "10": "<sup>10</sup> Questi, invece, parlano in maniera oltraggiosa di quello che ignorano, e si corrompono in tutto ciò che sanno per istinto, come bestie prive di ragione.", "11": "<sup>11</sup> Guai a loro! Perché si sono incamminati per la via di Caino, e per amor di lucro si sono gettati nei traviamenti di Balaam, e sono periti per la ribellione di Core.", "12": "<sup>12</sup> Essi sono delle macchie nelle vostre agapi quando banchettano con voi senza ritegno, pascendo se stessi; nuvole senza acqua, portate qua e là dai venti; alberi d’autunno senza frutti, due volte morti, sradicati;", "13": "<sup>13</sup> onde furiose del mare, schiumanti la loro bruttura; stelle erranti, a cui è riservata l’oscurità delle tenebre in eterno.", "14": "<sup>14</sup> Anche per costoro profetizzò Enoc, settimo dopo Adamo, dicendo: «Ecco, il Signore è venuto con le sue sante miriadi", "15": "<sup>15</sup> per giudicare tutti; per convincere tutti gli empi in mezzo a loro di tutte le loro opere di empietà che hanno empiamente commesse e di tutti gli insulti che gli empi peccatori hanno pronunciati contro di lui».", "16": "<sup>16</sup> Sono dei mormoratori, degli scontenti; camminano secondo le loro passioni; la loro bocca proferisce cose incredibilmente gonfie, e circondano d’ammirazione le persone per interesse.", "17": "<sup>17</sup> Ma voi, carissimi, ricordatevi di ciò che gli apostoli del Signore nostro Gesù Cristo hanno predetto,", "18": "<sup>18</sup> quando vi dicevano: «Negli ultimi tempi vi saranno schernitori che vivranno secondo le loro empie passioni».", "19": "<sup>19</sup> Essi sono quelli che provocano le divisioni, gente sensuale, che non ha lo Spirito.", "20": "<sup>20</sup> Esortazioni ai cristiani\nMa voi, carissimi, edificando voi stessi nella vostra santissima fede, pregando mediante lo Spirito Santo,", "21": "<sup>21</sup> conservatevi nell’amore di Dio, aspettando la misericordia del nostro Signore Gesù Cristo, a vita eterna.", "22": "<sup>22</sup> Abbiate pietà di quelli che sono nel dubbio;", "23": "<sup>23</sup> altri salvateli, strappandoli dal fuoco; e di altri abbiate pietà mista a timore, odiando perfino la veste contaminata dalla carne.", "24": "<sup>24</sup> A colui che può preservarvi da ogni caduta e farvi comparire irreprensibili e con gioia davanti alla sua gloria,", "25": "<sup>25</sup> al Dio unico, nostro Salvatore per mezzo di Gesù Cristo nostro Signore, siano gloria, maestà, forza e potere prima di tutti i tempi, ora e per tutti i secoli. Amen ." } } }; module.exports = book;
130.029412
277
0.737842
bf0bc2b801727b422a44c18dc68786ee1f56f415
4,249
kt
Kotlin
app/src/main/java/com/dwanz/jetpack_practice/data/entity/PokemonEntity.kt
DwanZ/jetpack_compose_practice
f42ed4ecd1ceabb169fbff9e16e8c2cd6d47456b
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/dwanz/jetpack_practice/data/entity/PokemonEntity.kt
DwanZ/jetpack_compose_practice
f42ed4ecd1ceabb169fbff9e16e8c2cd6d47456b
[ "Apache-2.0" ]
null
null
null
app/src/main/java/com/dwanz/jetpack_practice/data/entity/PokemonEntity.kt
DwanZ/jetpack_compose_practice
f42ed4ecd1ceabb169fbff9e16e8c2cd6d47456b
[ "Apache-2.0" ]
null
null
null
package com.dwanz.jetpack_practice.data.entity import com.google.gson.annotations.SerializedName data class PokemonEntity( val abilities: List<Ability>?, @SerializedName("base_experience") val baseExperience: Int?, val forms: List<Form>?, @SerializedName("game_indices") val gameIndices: List<GameIndice>?, val height: Int?, @SerializedName("held_items") val heldItems: List<HeldItem>?, val id: Int?, @SerializedName("is_default") val isDefault: Boolean?, @SerializedName("location_area_encounters") val locationAreaEncounters: String?, val moves: List<Move>?, val name: String?, val order: Int?, val species: Species?, val sprites: Sprites?, val stats: List<Stat>?, val types: List<Type>?, val weight: Int? ) { data class Ability( val ability: Ability?, @SerializedName("is_hidden") val isHidden: Boolean?, val slot: Int ) { data class Ability( val name: String?, val url: String? ) } data class Form( val name: String?, val url: String? ) data class GameIndice( @SerializedName("game_index") val gameIndex: Int?, val version: Version? ) { data class Version( val name: String?, val url: String? ) } data class HeldItem( val item: Item?, @SerializedName("version_details") val versionDetails: List<VersionDetail> ) { data class Item( val name: String?, val url: String? ) data class VersionDetail( val rarity: Int?, val version: Version? ) { data class Version( val name: String?, val url: String? ) } } data class Move( val move: Move?, @SerializedName("version_group_details") val versionGroupDetails: List<VersionGroupDetail>? ) { data class Move( val name: String?, val url: String? ) data class VersionGroupDetail( @SerializedName("level_learned_at") val levelLearned_at: Int?, @SerializedName("move_learn_method") val moveLearnMethod: MoveLearnMethod?, @SerializedName("version_group") val versionGroup: VersionGroup? ) { data class MoveLearnMethod( val name: String?, val url: String? ) data class VersionGroup( val name: String?, val url: String? ) } } data class Species( val name: String?, val url: String? ) data class Sprites( @SerializedName("back_default") val backDefault: String?, @SerializedName("back_female") val backFemale: Any?, @SerializedName("back_shiny") val backShiny: String?, @SerializedName("back_shiny_female") val backShinyFemale: Any?, @SerializedName("front_default") val frontDefault: String?, @SerializedName("front_female") val frontFemale: Any?, @SerializedName("front_shiny") val frontShiny: String?, @SerializedName("front_shiny_female") val frontShinyFemale: Any?, val other: Other? ) { data class Other( @SerializedName("dream_world") val dreamWorld: DreamWorld?, @SerializedName("official-artwork") val officialArtwork: OfficialArtwork? ) { data class DreamWorld( @SerializedName("front_default") val frontDefault: String?, @SerializedName("front_female") val frontFemale: Any? ) data class OfficialArtwork( @SerializedName("front_default") val frontDefault: String? ) } } data class Stat( @SerializedName("base_stat") val baseStat: Int?, val effort: Int?, val stat: Stat? ) { data class Stat( val name: String?, val url: String? ) } data class Type( val slot: Int?, val type: Type? ) { data class Type( val name: String?, val url: String? ) } }
28.516779
99
0.566722
de9bf10781608cc332e58d91b799e26a6f9d34a5
1,067
kt
Kotlin
App/app/src/test/java/at/tugraz/vaccinationpassport/UserTest.kt
sw21-tug/Team_20
04a904fada50a3a710e3163634ce38cf4b83d4c7
[ "MIT" ]
null
null
null
App/app/src/test/java/at/tugraz/vaccinationpassport/UserTest.kt
sw21-tug/Team_20
04a904fada50a3a710e3163634ce38cf4b83d4c7
[ "MIT" ]
33
2021-04-28T08:55:47.000Z
2021-06-10T20:03:58.000Z
App/app/src/test/java/at/tugraz/vaccinationpassport/UserTest.kt
sw21-tug/Team_20
04a904fada50a3a710e3163634ce38cf4b83d4c7
[ "MIT" ]
9
2021-04-28T09:02:41.000Z
2021-06-10T17:37:28.000Z
package at.tugraz.vaccinationpassport import org.junit.Test import org.junit.Assert.* class UserTest { @Test fun addVaccinesTest() { val user = User("John Doe", 27) user.addVaccination(Vaccination("Covid", "12-02-2018")) assertEquals(1, user.vaccines.size) assertEquals("Covid", user.vaccines[0].name) assertEquals("12-02-2018", user.vaccines[0].date) var vaccines = mutableListOf<Vaccination>() vaccines.add(Vaccination("Malaria", "12-02-2018")) vaccines.add(Vaccination("Hepatitis A", "12-02-2018")) vaccines.add(Vaccination("Hepatitis B", "12-02-2018")) user.addVaccination(vaccines) var matches = 0 for(vaccine in vaccines) { for(user_vaccine in user.vaccines) { if(user_vaccine.name == vaccine.name && user_vaccine.date == vaccine.date) { matches += 1 } } } assertEquals(vaccines.size, matches) } }
27.358974
63
0.564199
d9b837bc9d139e57875e2d2b6b030be81e8a6e4d
314
swift
Swift
Flash Chat/User.swift
shazly333/Flash-Chat
11225f0246423f535d936b793c92afb930137d02
[ "MIT" ]
null
null
null
Flash Chat/User.swift
shazly333/Flash-Chat
11225f0246423f535d936b793c92afb930137d02
[ "MIT" ]
null
null
null
Flash Chat/User.swift
shazly333/Flash-Chat
11225f0246423f535d936b793c92afb930137d02
[ "MIT" ]
null
null
null
// // User.swift // Flash Chat // // Created by El-Shazly on 7/16/18. // Copyright © 2018 London App Brewery. All rights reserved. // import Foundation class User{ var email:String var groupsChat: [GroupChat] = [] init(email:String) { self.email = email } }
13.083333
61
0.566879
0cfc5802ff58618fd079fd5185d9edd8be7eda97
13,342
py
Python
source/rttov_test/profile-datasets-py/div83/027.py
bucricket/projectMAScorrection
89489026c8e247ec7c364e537798e766331fe569
[ "BSD-3-Clause" ]
null
null
null
source/rttov_test/profile-datasets-py/div83/027.py
bucricket/projectMAScorrection
89489026c8e247ec7c364e537798e766331fe569
[ "BSD-3-Clause" ]
1
2022-03-12T12:19:59.000Z
2022-03-12T12:19:59.000Z
source/rttov_test/profile-datasets-py/div83/027.py
bucricket/projectMAScorrection
89489026c8e247ec7c364e537798e766331fe569
[ "BSD-3-Clause" ]
null
null
null
""" Profile ../profile-datasets-py/div83/027.py file automaticaly created by prof_gen.py script """ self["ID"] = "../profile-datasets-py/div83/027.py" self["Q"] = numpy.array([ 1.51831800e+00, 2.02599600e+00, 2.94787100e+00, 3.99669400e+00, 4.71653800e+00, 4.89106600e+00, 5.14399400e+00, 5.67274800e+00, 6.02338400e+00, 6.09836300e+00, 6.08376300e+00, 6.01126400e+00, 5.91866500e+00, 5.77584700e+00, 5.59481900e+00, 5.41637100e+00, 5.26750200e+00, 5.10689400e+00, 4.98576500e+00, 4.90039600e+00, 4.80689700e+00, 4.63989800e+00, 4.46443000e+00, 4.30135100e+00, 4.16606300e+00, 4.06766300e+00, 4.01361400e+00, 3.95640400e+00, 3.87825500e+00, 3.79394600e+00, 3.73623600e+00, 3.72919600e+00, 3.74067600e+00, 3.78187600e+00, 3.81900500e+00, 3.85233500e+00, 3.88512500e+00, 3.91148500e+00, 3.92466500e+00, 3.92849500e+00, 3.93905400e+00, 3.97355400e+00, 4.02951400e+00, 4.05710400e+00, 4.04558400e+00, 4.02228400e+00, 4.01040400e+00, 4.00572400e+00, 4.00641400e+00, 4.08608300e+00, 4.44130000e+00, 5.00126500e+00, 5.73600700e+00, 6.83860300e+00, 8.34002000e+00, 9.95999100e+00, 1.13537700e+01, 1.24435500e+01, 1.36048100e+01, 1.55239600e+01, 1.77784800e+01, 1.93991200e+01, 2.00516000e+01, 1.97941100e+01, 1.89638400e+01, 1.84148600e+01, 1.82331700e+01, 1.84861600e+01, 2.02668900e+01, 3.24805400e+01, 6.31028200e+01, 1.09865900e+02, 1.71694500e+02, 2.41407700e+02, 3.05073900e+02, 3.60772800e+02, 4.04902000e+02, 4.16543400e+02, 4.04623200e+02, 3.59892400e+02, 3.06567000e+02, 3.03443900e+02, 4.25764600e+02, 8.75110500e+02, 1.60701300e+03, 2.52645100e+03, 3.50894400e+03, 4.39830900e+03, 5.05090900e+03, 5.40195000e+03, 5.54486300e+03, 5.86218200e+03, 6.10752900e+03, 6.83105600e+03, 6.63557500e+03, 6.44820100e+03, 6.26853800e+03, 6.09616900e+03, 5.93072700e+03, 5.77187200e+03, 5.61926500e+03]) self["P"] = numpy.array([ 5.00000000e-03, 1.61000000e-02, 3.84000000e-02, 7.69000000e-02, 1.37000000e-01, 2.24400000e-01, 3.45400000e-01, 5.06400000e-01, 7.14000000e-01, 9.75300000e-01, 1.29720000e+00, 1.68720000e+00, 2.15260000e+00, 2.70090000e+00, 3.33980000e+00, 4.07700000e+00, 4.92040000e+00, 5.87760000e+00, 6.95670000e+00, 8.16550000e+00, 9.51190000e+00, 1.10038000e+01, 1.26492000e+01, 1.44559000e+01, 1.64318000e+01, 1.85847000e+01, 2.09224000e+01, 2.34526000e+01, 2.61829000e+01, 2.91210000e+01, 3.22744000e+01, 3.56505000e+01, 3.92566000e+01, 4.31001000e+01, 4.71882000e+01, 5.15278000e+01, 5.61260000e+01, 6.09895000e+01, 6.61253000e+01, 7.15398000e+01, 7.72396000e+01, 8.32310000e+01, 8.95204000e+01, 9.61138000e+01, 1.03017000e+02, 1.10237000e+02, 1.17778000e+02, 1.25646000e+02, 1.33846000e+02, 1.42385000e+02, 1.51266000e+02, 1.60496000e+02, 1.70078000e+02, 1.80018000e+02, 1.90320000e+02, 2.00989000e+02, 2.12028000e+02, 2.23442000e+02, 2.35234000e+02, 2.47408000e+02, 2.59969000e+02, 2.72919000e+02, 2.86262000e+02, 3.00000000e+02, 3.14137000e+02, 3.28675000e+02, 3.43618000e+02, 3.58966000e+02, 3.74724000e+02, 3.90893000e+02, 4.07474000e+02, 4.24470000e+02, 4.41882000e+02, 4.59712000e+02, 4.77961000e+02, 4.96630000e+02, 5.15720000e+02, 5.35232000e+02, 5.55167000e+02, 5.75525000e+02, 5.96306000e+02, 6.17511000e+02, 6.39140000e+02, 6.61192000e+02, 6.83667000e+02, 7.06565000e+02, 7.29886000e+02, 7.53628000e+02, 7.77790000e+02, 8.02371000e+02, 8.27371000e+02, 8.52788000e+02, 8.78620000e+02, 9.04866000e+02, 9.31524000e+02, 9.58591000e+02, 9.86067000e+02, 1.01395000e+03, 1.04223000e+03, 1.07092000e+03, 1.10000000e+03]) self["CO2"] = numpy.array([ 375.9234, 375.9232, 375.9219, 375.9195, 375.9172, 375.9142, 375.9041, 375.8819, 375.8607, 375.8617, 375.8997, 375.9717, 376.0398, 376.0858, 376.1489, 376.212 , 376.224 , 376.2321, 376.2481, 376.2772, 376.3252, 376.3663, 376.4023, 376.4224, 376.4504, 376.4865, 376.5545, 376.6335, 376.7605, 376.8966, 377.0446, 377.2036, 377.3766, 377.5606, 377.7106, 377.8485, 378.0765, 378.4945, 378.9365, 379.6475, 380.4225, 381.0245, 381.4085, 381.8025, 381.8315, 381.8625, 381.8985, 381.9405, 381.9845, 382.0364, 382.0903, 382.5651, 383.1618, 383.8894, 384.7668, 385.5962, 386.1156, 386.6532, 386.7607, 386.854 , 386.8701, 386.8645, 386.8732, 386.8913, 386.9157, 386.9449, 386.9669, 386.9788, 386.9602, 386.9034, 386.8186, 386.7075, 386.6086, 386.5187, 386.4681, 386.4315, 386.4595, 386.5189, 386.6375, 386.8447, 387.1073, 387.3124, 387.433 , 387.3937, 387.2297, 386.9659, 386.6525, 386.3522, 386.1188, 385.9826, 385.9361, 385.8209, 385.7317, 385.4548, 385.5337, 385.6074, 385.6771, 385.744 , 385.8082, 385.8699, 385.9291]) self["CO"] = numpy.array([ 0.2205447 , 0.2185316 , 0.2145434 , 0.2078282 , 0.1977631 , 0.1839901 , 0.1511932 , 0.09891954, 0.0827345 , 0.05454007, 0.02926452, 0.01534331, 0.01021024, 0.00922827, 0.00895567, 0.00841368, 0.00791632, 0.0076217 , 0.00749041, 0.00745301, 0.00740799, 0.00741502, 0.00746624, 0.00760092, 0.00775626, 0.00793258, 0.0081303 , 0.00834271, 0.00844155, 0.00854593, 0.00861921, 0.00869836, 0.00895125, 0.009236 , 0.00956421, 0.00993273, 0.01050776, 0.01155325, 0.01277055, 0.01483604, 0.01745463, 0.02009092, 0.02248201, 0.0252159 , 0.0250677 , 0.0249136 , 0.0248554 , 0.0248671 , 0.0248747 , 0.0248604 , 0.02484549, 0.02830606, 0.03349511, 0.03954063, 0.04649641, 0.05393566, 0.05777834, 0.06203953, 0.06291754, 0.06367061, 0.06376177, 0.06365417, 0.06355173, 0.06345124, 0.063449 , 0.06353453, 0.06376724, 0.06416551, 0.06445159, 0.0646028 , 0.06451203, 0.06417925, 0.06369376, 0.06310236, 0.06261609, 0.06216137, 0.06196 , 0.06180874, 0.06178709, 0.06208905, 0.06263239, 0.06350083, 0.06423774, 0.06476787, 0.06481747, 0.06471838, 0.06458966, 0.06447546, 0.06438733, 0.06432344, 0.06428367, 0.06423741, 0.0641983 , 0.06589368, 0.07015209, 0.07475692, 0.0797395 , 0.08513432, 0.09097941, 0.09731644, 0.1041912 ]) self["T"] = numpy.array([ 189.265, 197.336, 211.688, 227.871, 242.446, 252.765, 259.432, 262.908, 263.411, 262.202, 261.422, 259.368, 255.095, 250.075, 244.792, 239.205, 235.817, 231.46 , 227.966, 225.935, 225.115, 222.382, 219.723, 218.152, 217.875, 218.211, 218.288, 218.294, 217.949, 217.202, 216.158, 214.964, 215.259, 215.053, 215.409, 216.081, 216.441, 216.152, 215.427, 215.082, 216.198, 217.247, 217.006, 216.373, 216.342, 217.088, 218.419, 219.839, 220.797, 220.946, 221.423, 222.504, 223.822, 225.134, 226.221, 226.93 , 227.275, 227.405, 227.434, 227.346, 227.212, 227.246, 227.566, 228.2 , 229.083, 230.094, 231.117, 232.121, 233.086, 234.01 , 235.064, 236.351, 237.928, 239.892, 242.039, 244.306, 246.651, 249.025, 251.415, 253.802, 256.16 , 258.448, 260.591, 262.445, 264.071, 265.349, 266.233, 266.969, 267.78 , 268.72 , 269.42 , 270.502, 271.421, 273.317, 273.317, 273.317, 273.317, 273.317, 273.317, 273.317, 273.317]) self["N2O"] = numpy.array([ 0.00161 , 0.00187 , 0.00205999, 0.00220999, 0.00233999, 0.00235999, 0.00157999, 0.00186999, 0.00519997, 0.00870995, 0.00838995, 0.00955994, 0.01208993, 0.01432992, 0.0171399 , 0.02172988, 0.02788985, 0.03756981, 0.04630977, 0.05168975, 0.05680973, 0.05922973, 0.06028973, 0.06131974, 0.07010971, 0.07957968, 0.08867964, 0.09929961, 0.1101496 , 0.1206295 , 0.1301795 , 0.1371795 , 0.1439595 , 0.1505294 , 0.1651494 , 0.1848693 , 0.2034792 , 0.2285391 , 0.252299 , 0.2748389 , 0.2840589 , 0.2926288 , 0.3004188 , 0.3072488 , 0.3129187 , 0.3172487 , 0.3200187 , 0.3209987 , 0.3209987 , 0.3209987 , 0.3209986 , 0.3209984 , 0.3209982 , 0.3209978 , 0.3209973 , 0.3209968 , 0.3209964 , 0.320996 , 0.3209956 , 0.320995 , 0.3209943 , 0.3209938 , 0.3209936 , 0.3209936 , 0.3209939 , 0.3209941 , 0.3209941 , 0.3209941 , 0.3209935 , 0.3209896 , 0.3209797 , 0.3209647 , 0.3209449 , 0.3209225 , 0.3209021 , 0.3208842 , 0.32087 , 0.3208663 , 0.3208701 , 0.3208845 , 0.3209016 , 0.3209026 , 0.3208633 , 0.3207191 , 0.3204841 , 0.320189 , 0.3198736 , 0.3195881 , 0.3193787 , 0.319266 , 0.3192201 , 0.3191182 , 0.3190395 , 0.3188072 , 0.31887 , 0.3189301 , 0.3189878 , 0.3190431 , 0.3190962 , 0.3191472 , 0.3191962 ]) self["O3"] = numpy.array([ 0.1903137 , 0.2192386 , 0.3077081 , 0.5440408 , 0.8590299 , 1.170854 , 1.499102 , 1.864289 , 2.273556 , 2.805293 , 3.409769 , 4.028786 , 4.806182 , 5.619898 , 6.411164 , 7.147361 , 7.51202 , 7.648961 , 7.644362 , 7.556123 , 7.446574 , 7.281136 , 6.952659 , 6.604492 , 6.296854 , 6.008776 , 5.751387 , 5.520268 , 5.311749 , 5.111921 , 4.890092 , 4.593293 , 4.298724 , 3.882905 , 3.380027 , 2.799559 , 2.288161 , 2.031152 , 2.018272 , 2.047542 , 1.969722 , 1.685453 , 1.220825 , 0.9176053 , 0.8929574 , 0.9542592 , 1.004996 , 1.034796 , 1.031726 , 1.019046 , 0.8797071 , 0.6484178 , 0.4105526 , 0.2529783 , 0.1943934 , 0.201197 , 0.2459162 , 0.322179 , 0.3977806 , 0.4292413 , 0.4255834 , 0.3930204 , 0.3461121 , 0.2989281 , 0.2606191 , 0.2321107 , 0.2069452 , 0.1838146 , 0.1618567 , 0.1410414 , 0.1225313 , 0.1061913 , 0.09214328, 0.08133816, 0.07293074, 0.06636085, 0.06143102, 0.05859298, 0.05740586, 0.05732126, 0.05783027, 0.05809797, 0.05651443, 0.05019414, 0.0404447 , 0.03280082, 0.02944741, 0.02902179, 0.02945348, 0.02918976, 0.02836743, 0.02750451, 0.02608958, 0.02225294, 0.02225732, 0.02226152, 0.02226555, 0.02226941, 0.02227312, 0.02227668, 0.02228009]) self["CH4"] = numpy.array([ 0.1059488, 0.1201298, 0.1306706, 0.1417254, 0.1691352, 0.209023 , 0.2345078, 0.2578465, 0.2845033, 0.328699 , 0.3987896, 0.4800421, 0.5668716, 0.6510682, 0.7280449, 0.7954147, 0.8518465, 0.8903115, 0.9281374, 0.9731752, 1.016085 , 1.071595 , 1.131985 , 1.189835 , 1.247015 , 1.302185 , 1.355285 , 1.400504 , 1.442154 , 1.464494 , 1.488464 , 1.514124 , 1.541544 , 1.560774 , 1.579304 , 1.596804 , 1.612894 , 1.627174 , 1.638294 , 1.650024 , 1.662373 , 1.675353 , 1.688973 , 1.722213 , 1.729283 , 1.736683 , 1.741733 , 1.745103 , 1.749093 , 1.755483 , 1.762122 , 1.770021 , 1.77847 , 1.785498 , 1.790785 , 1.795642 , 1.79793 , 1.800308 , 1.800506 , 1.800632 , 1.800498 , 1.800295 , 1.800414 , 1.800704 , 1.800856 , 1.800867 , 1.800517 , 1.799787 , 1.798434 , 1.796372 , 1.794017 , 1.791393 , 1.789133 , 1.787118 , 1.785875 , 1.784886 , 1.784827 , 1.785476 , 1.788046 , 1.791395 , 1.795229 , 1.798224 , 1.800263 , 1.801052 , 1.800931 , 1.80036 , 1.799234 , 1.797877 , 1.796739 , 1.796035 , 1.795827 , 1.795294 , 1.79488 , 1.793604 , 1.793966 , 1.794315 , 1.794639 , 1.794951 , 1.795249 , 1.795536 , 1.795812 ]) self["CTP"] = 500.0 self["CFRACTION"] = 0.0 self["IDG"] = 0 self["ISH"] = 0 self["ELEVATION"] = 0.0 self["S2M"]["T"] = 273.317 self["S2M"]["Q"] = 5619.26541873 self["S2M"]["O"] = 0.022280094739 self["S2M"]["P"] = 905.85559 self["S2M"]["U"] = 0.0 self["S2M"]["V"] = 0.0 self["S2M"]["WFETC"] = 100000.0 self["SKIN"]["SURFTYPE"] = 0 self["SKIN"]["WATERTYPE"] = 1 self["SKIN"]["T"] = 273.317 self["SKIN"]["SALINITY"] = 35.0 self["SKIN"]["FOAM_FRACTION"] = 0.0 self["SKIN"]["FASTEM"] = numpy.array([ 3. , 5. , 15. , 0.1, 0.3]) self["ZENANGLE"] = 0.0 self["AZANGLE"] = 0.0 self["SUNZENANGLE"] = 0.0 self["SUNAZANGLE"] = 0.0 self["LATITUDE"] = 45.309 self["GAS_UNITS"] = 2 self["BE"] = 0.0 self["COSBK"] = 0.0 self["DATE"] = numpy.array([2007, 4, 1]) self["TIME"] = numpy.array([0, 0, 0])
57.508621
92
0.570979
0158342bcc964d89ebbde35aa0dd674e2fa17e0e
9,648
kt
Kotlin
feature-staking-impl/src/main/java/io/novafoundation/nova/feature_staking_impl/presentation/mappers/Validator.kt
nova-wallet/nova-android-app
5bf5edaf809a016f0fc1cf24787100ef78b97d28
[ "Apache-2.0" ]
8
2021-11-02T08:58:41.000Z
2022-03-24T17:59:17.000Z
feature-staking-impl/src/main/java/io/novafoundation/nova/feature_staking_impl/presentation/mappers/Validator.kt
nova-wallet/nova-android-app
5bf5edaf809a016f0fc1cf24787100ef78b97d28
[ "Apache-2.0" ]
null
null
null
feature-staking-impl/src/main/java/io/novafoundation/nova/feature_staking_impl/presentation/mappers/Validator.kt
nova-wallet/nova-android-app
5bf5edaf809a016f0fc1cf24787100ef78b97d28
[ "Apache-2.0" ]
1
2022-01-17T03:18:30.000Z
2022-01-17T03:18:30.000Z
package io.novafoundation.nova.feature_staking_impl.presentation.mappers import io.novafoundation.nova.common.address.AddressIconGenerator import io.novafoundation.nova.common.address.AddressModel import io.novafoundation.nova.common.address.createAddressModel import io.novafoundation.nova.common.resources.ResourceManager import io.novafoundation.nova.common.utils.format import io.novafoundation.nova.common.utils.formatAsCurrency import io.novafoundation.nova.common.utils.formatAsPercentage import io.novafoundation.nova.common.utils.fractionToPercentage import io.novafoundation.nova.feature_account_api.presenatation.account.icon.createAccountAddressModel import io.novafoundation.nova.feature_staking_api.domain.model.NominatedValidator import io.novafoundation.nova.feature_staking_api.domain.model.Validator import io.novafoundation.nova.feature_staking_impl.R import io.novafoundation.nova.feature_staking_impl.domain.recommendations.settings.RecommendationSorting import io.novafoundation.nova.feature_staking_impl.domain.recommendations.settings.sortings.APYSorting import io.novafoundation.nova.feature_staking_impl.domain.recommendations.settings.sortings.TotalStakeSorting import io.novafoundation.nova.feature_staking_impl.domain.recommendations.settings.sortings.ValidatorOwnStakeSorting import io.novafoundation.nova.feature_staking_impl.presentation.validators.change.ValidatorModel import io.novafoundation.nova.feature_staking_impl.presentation.validators.details.model.ValidatorAlert import io.novafoundation.nova.feature_staking_impl.presentation.validators.details.model.ValidatorDetailsModel import io.novafoundation.nova.feature_staking_impl.presentation.validators.details.model.ValidatorStakeModel import io.novafoundation.nova.feature_staking_impl.presentation.validators.details.model.ValidatorStakeModel.ActiveStakeModel import io.novafoundation.nova.feature_staking_impl.presentation.validators.parcel.ValidatorDetailsParcelModel import io.novafoundation.nova.feature_staking_impl.presentation.validators.parcel.ValidatorStakeParcelModel import io.novafoundation.nova.feature_staking_impl.presentation.validators.parcel.ValidatorStakeParcelModel.Active.NominatorInfo import io.novafoundation.nova.feature_wallet_api.domain.model.Asset import io.novafoundation.nova.feature_wallet_api.domain.model.Token import io.novafoundation.nova.feature_wallet_api.domain.model.amountFromPlanks import io.novafoundation.nova.feature_wallet_api.presentation.formatters.formatTokenAmount import io.novafoundation.nova.feature_wallet_api.presentation.model.mapAmountToAmountModel import io.novafoundation.nova.runtime.ext.addressOf import io.novafoundation.nova.runtime.multiNetwork.chain.model.Chain import jp.co.soramitsu.fearless_utils.extensions.fromHex import java.math.BigInteger private const val ICON_SIZE_DP = 24 suspend fun mapValidatorToValidatorModel( chain: Chain, validator: Validator, iconGenerator: AddressIconGenerator, token: Token, isChecked: Boolean? = null, sorting: RecommendationSorting = APYSorting, ) = mapValidatorToValidatorModel( chain = chain, validator = validator, createIcon = { iconGenerator.createAddressModel(it, ICON_SIZE_DP, validator.identity?.display, AddressIconGenerator.BACKGROUND_TRANSPARENT) }, token = token, isChecked = isChecked, sorting = sorting ) suspend fun mapValidatorToValidatorModel( chain: Chain, validator: Validator, createIcon: suspend (address: String) -> AddressModel, token: Token, isChecked: Boolean? = null, sorting: RecommendationSorting = APYSorting, ): ValidatorModel { val address = chain.addressOf(validator.accountIdHex.fromHex()) val addressModel = createIcon(address) return with(validator) { val scoring = when (sorting) { APYSorting -> formatValidatorApy(validator)?.let(ValidatorModel.Scoring::OneField) TotalStakeSorting -> stakeToScoring(electedInfo?.totalStake, token) ValidatorOwnStakeSorting -> stakeToScoring(electedInfo?.ownStake, token) else -> throw NotImplementedError("Unsupported sorting: $sorting") } ValidatorModel( accountIdHex = accountIdHex, slashed = slashed, image = addressModel.image, address = addressModel.address, scoring = scoring, title = addressModel.nameOrAddress, isChecked = isChecked, validator = validator ) } } private fun stakeToScoring(stakeInPlanks: BigInteger?, token: Token): ValidatorModel.Scoring.TwoFields? { if (stakeInPlanks == null) return null val stake = token.amountFromPlanks(stakeInPlanks) return ValidatorModel.Scoring.TwoFields( primary = stake.formatTokenAmount(token.configuration), secondary = token.fiatAmount(stake).formatAsCurrency() ) } fun mapValidatorToValidatorDetailsParcelModel( validator: Validator, ): ValidatorDetailsParcelModel { return mapValidatorToValidatorDetailsParcelModel(validator, nominationStatus = null) } fun mapValidatorToValidatorDetailsWithStakeFlagParcelModel( nominatedValidator: NominatedValidator, ): ValidatorDetailsParcelModel = mapValidatorToValidatorDetailsParcelModel(nominatedValidator.validator, nominatedValidator.status) private fun mapValidatorToValidatorDetailsParcelModel( validator: Validator, nominationStatus: NominatedValidator.Status?, ): ValidatorDetailsParcelModel { return with(validator) { val identityModel = identity?.let(::mapIdentityToIdentityParcelModel) val stakeModel = electedInfo?.let { val nominators = it.nominatorStakes.map(::mapNominatorToNominatorParcelModel) val nominatorInfo = (nominationStatus as? NominatedValidator.Status.Active)?.let { activeStatus -> NominatorInfo(willBeRewarded = activeStatus.willUserBeRewarded) } ValidatorStakeParcelModel.Active( totalStake = it.totalStake, ownStake = it.ownStake, nominators = nominators, apy = it.apy, isOversubscribed = it.isOversubscribed, nominatorInfo = nominatorInfo ) } ?: ValidatorStakeParcelModel.Inactive ValidatorDetailsParcelModel( accountIdHex = accountIdHex, isSlashed = validator.slashed, stake = stakeModel, identity = identityModel ) } } @OptIn(ExperimentalStdlibApi::class) fun mapValidatorDetailsToErrors( validator: ValidatorDetailsParcelModel, ): List<ValidatorAlert> { return buildList { if (validator.isSlashed) { add(ValidatorAlert.Slashed) } if (validator.stake is ValidatorStakeParcelModel.Active && validator.stake.isOversubscribed) { val nominatorInfo = validator.stake.nominatorInfo if (nominatorInfo == null || nominatorInfo.willBeRewarded) { add(ValidatorAlert.Oversubscribed.UserNotInvolved) } else { add(ValidatorAlert.Oversubscribed.UserMissedReward) } } } } suspend fun mapValidatorDetailsParcelToValidatorDetailsModel( chain: Chain, validator: ValidatorDetailsParcelModel, asset: Asset, maxNominators: Int, iconGenerator: AddressIconGenerator, resourceManager: ResourceManager, ): ValidatorDetailsModel { return with(validator) { val address = chain.addressOf(validator.accountIdHex.fromHex()) val addressModel = iconGenerator.createAccountAddressModel(chain, address, validator.identity?.display) val identity = identity?.let(::mapIdentityParcelModelToIdentityModel) val stake = when (val stake = validator.stake) { ValidatorStakeParcelModel.Inactive -> ValidatorStakeModel( status = ValidatorStakeModel.Status( text = resourceManager.getString(R.string.staking_nominator_status_inactive), icon = R.drawable.ic_time_16, iconTint = R.color.white_48 ), activeStakeModel = null ) is ValidatorStakeParcelModel.Active -> { val totalStakeModel = mapAmountToAmountModel(stake.totalStake, asset) val nominatorsCount = stake.nominators.size val apyPercentageFormatted = stake.apy.fractionToPercentage().formatAsPercentage() val apyWithLabel = resourceManager.getString(R.string.staking_apy, apyPercentageFormatted) ValidatorStakeModel( status = ValidatorStakeModel.Status( text = resourceManager.getString(R.string.staking_nominator_status_active), icon = R.drawable.ic_checkmark_circle_16, iconTint = R.color.green ), activeStakeModel = ActiveStakeModel( totalStake = totalStakeModel, nominatorsCount = nominatorsCount.format(), maxNominations = resourceManager.getString(R.string.staking_nominations_rewarded_format, maxNominators.format()), apy = apyWithLabel ) ) } } ValidatorDetailsModel( stake = stake, addressModel = addressModel, identity = identity ) } } fun formatValidatorApy(validator: Validator) = validator.electedInfo?.apy?.fractionToPercentage()?.formatAsPercentage()
43.264574
146
0.729167
df06a802f7d5ae37304f78e07aff51cd024537fc
286
kt
Kotlin
src/test/kotlin/db/MongoDBVMRegistryTest.kt
iBims1JFK/steep
c0109396d59b12264fbc0757bc620795d999b09c
[ "Apache-2.0" ]
18
2020-02-03T08:30:47.000Z
2022-03-28T03:05:01.000Z
src/test/kotlin/db/MongoDBVMRegistryTest.kt
iBims1JFK/steep
c0109396d59b12264fbc0757bc620795d999b09c
[ "Apache-2.0" ]
199
2020-05-21T07:34:10.000Z
2022-03-31T05:37:47.000Z
src/test/kotlin/db/MongoDBVMRegistryTest.kt
iBims1JFK/steep
c0109396d59b12264fbc0757bc620795d999b09c
[ "Apache-2.0" ]
4
2020-06-17T05:18:40.000Z
2021-08-03T14:47:22.000Z
package db import io.vertx.core.Vertx /** * Tests for [MongoDBVMRegistry] * @author Michel Kraemer */ class MongoDBVMRegistryTest : MongoDBTest, VMRegistryTest() { override fun createRegistry(vertx: Vertx) = MongoDBVMRegistry(vertx, MongoDBTest.CONNECTION_STRING, false) }
22
70
0.755245
6b4a61a1d056fdd9675b2e40df6df748ad7e6040
3,319
rs
Rust
bee-ledger/src/workers/snapshot/worker.rs
sergiupopescu199/bee
8f34481942720eb819110048b02d148989d0c233
[ "Apache-2.0" ]
null
null
null
bee-ledger/src/workers/snapshot/worker.rs
sergiupopescu199/bee
8f34481942720eb819110048b02d148989d0c233
[ "Apache-2.0" ]
null
null
null
bee-ledger/src/workers/snapshot/worker.rs
sergiupopescu199/bee
8f34481942720eb819110048b02d148989d0c233
[ "Apache-2.0" ]
null
null
null
// Copyright 2020-2021 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 use crate::workers::{ error::Error, snapshot::{config::SnapshotConfig, error::Error as SnapshotError, import::import_snapshots}, storage::{self, StorageBackend}, }; use bee_message::milestone::MilestoneIndex; use bee_runtime::{node::Node, worker::Worker}; use bee_storage::{access::AsStream, backend::StorageBackend as _, health::StorageHealth}; use bee_tangle::{solid_entry_point::SolidEntryPoint, MsTangle, TangleWorker}; use async_trait::async_trait; use chrono::{offset::TimeZone, Utc}; use futures::stream::StreamExt; use log::info; use std::any::TypeId; pub struct SnapshotWorker {} #[async_trait] impl<N: Node> Worker<N> for SnapshotWorker where N::Backend: StorageBackend, { type Config = (u64, SnapshotConfig); type Error = Error; fn dependencies() -> &'static [TypeId] { vec![TypeId::of::<TangleWorker>()].leak() } async fn start(node: &mut N, config: Self::Config) -> Result<Self, Self::Error> { let (network_id, snapshot_config) = config; let tangle = node.resource::<MsTangle<N::Backend>>(); let storage = node.storage(); match storage::fetch_snapshot_info(&*storage).await? { None => { if let Err(e) = import_snapshots(&*storage, network_id, &snapshot_config).await { (*storage) .set_health(StorageHealth::Corrupted) .await .map_err(|e| Error::Storage(Box::new(e)))?; return Err(e.into()); } } Some(info) => { if info.network_id() != network_id { return Err(Error::Snapshot(SnapshotError::NetworkIdMismatch( info.network_id(), network_id, ))); } info!( "Loaded snapshot from {} with snapshot index {}, entry point index {} and pruning index {}.", Utc.timestamp(info.timestamp() as i64, 0).format("%d-%m-%Y %H:%M:%S"), *info.snapshot_index(), *info.entry_point_index(), *info.pruning_index(), ); } } let mut solid_entry_points = AsStream::<SolidEntryPoint, MilestoneIndex>::stream(&*storage) .await .map_err(|e| Error::Storage(Box::new(e)))?; while let Some((sep, index)) = solid_entry_points.next().await { tangle.add_solid_entry_point(sep, index).await; } // Unwrap is fine because we just inserted the ledger index. // TODO unwrap let ledger_index = storage::fetch_ledger_index(&*storage).await.unwrap().unwrap(); let snapshot_info = storage::fetch_snapshot_info(&*storage).await?.unwrap(); tangle.update_snapshot_index(snapshot_info.snapshot_index()); tangle.update_pruning_index(snapshot_info.pruning_index()); tangle.update_solid_milestone_index(MilestoneIndex(*ledger_index)); tangle.update_confirmed_milestone_index(MilestoneIndex(*ledger_index)); tangle.update_latest_milestone_index(MilestoneIndex(*ledger_index)); Ok(Self {}) } }
35.688172
113
0.593251
752f65014d6430e1df358d143f6c85148527c3bb
1,776
c
C
base/crts/crtw32/exec/getproc.c
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
base/crts/crtw32/exec/getproc.c
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
base/crts/crtw32/exec/getproc.c
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
/*** *getproc.c - Get the address of a procedure in a DLL. * * Copyright (c) 1991-2001, Microsoft Corporation. All rights reserved. * *Purpose: * defines _getdllprocadd() - gets a procedure address by name or * ordinal * *Revision History: * 08-21-91 BWM Wrote module. * 09-30-93 GJF Resurrected for compatiblity with NT SDK. * 02-06-98 GJF Changes for Win64: changed return type to intptr_t. * 02-10-98 GJF Changes for Win64: changed 3rd arg type intptr_t. * *******************************************************************************/ #include <cruntime.h> #include <oscalls.h> #include <process.h> /*** *int (*)() _getdllprocaddr(handle, name, ordinal) - Get the address of a * DLL procedure specified by name or ordinal * *Purpose: * *Entry: * int handle - a DLL handle from _loaddll * char * name - Name of the procedure, or NULL to get by ordinal * int ordinal - Ordinal of the procedure, or -1 to get by name * * *Exit: * returns a pointer to the procedure if found * returns NULL if not found * *Exceptions: * *******************************************************************************/ int (__cdecl * __cdecl _getdllprocaddr( intptr_t hMod, char * szProcName, intptr_t iOrdinal))() { typedef int (__cdecl * PFN)(); if (szProcName == NULL) { if (iOrdinal <= 65535) { return ((PFN)GetProcAddress((HANDLE)hMod, (LPSTR)iOrdinal)); } } else { if (iOrdinal == (intptr_t)(-1)) { return ((PFN)GetProcAddress((HANDLE)hMod, szProcName)); } } return (NULL); }
28.190476
81
0.519144
7b91259e087d9055d6640b14a6bfdf17af5524a1
254
rb
Ruby
db/migrate/20160830233154_add_port_ranges_to_load_balancer_listener.rb
lpichler/manageiq-schema
0fcd1e7c500dc7cee0727c53c9cdf1b68ec14b6f
[ "Apache-2.0" ]
null
null
null
db/migrate/20160830233154_add_port_ranges_to_load_balancer_listener.rb
lpichler/manageiq-schema
0fcd1e7c500dc7cee0727c53c9cdf1b68ec14b6f
[ "Apache-2.0" ]
1
2020-05-01T15:56:22.000Z
2020-05-01T15:56:22.000Z
db/migrate/20160830233154_add_port_ranges_to_load_balancer_listener.rb
jrafanie/manageiq-schema
b30c00b7a290b055be1f49edb294ff465c1affcd
[ "Apache-2.0" ]
1
2019-09-02T12:46:07.000Z
2019-09-02T12:46:07.000Z
class AddPortRangesToLoadBalancerListener < ActiveRecord::Migration[5.0] def change change_table :load_balancer_listeners do |t| t.column :load_balancer_port_range, :int4range t.column :instance_port_range, :int4range end end end
28.222222
72
0.76378
98b061dcb62a738e6cb7941dcb7c025c5a6b5a65
827
html
HTML
public/components/frame/addFileView/addFileView.html
Crush-s/vueHC
258d45e316a9b90a2eb1038c92b58056a0f06f43
[ "Apache-2.0" ]
20
2021-02-24T07:33:46.000Z
2022-02-28T07:02:38.000Z
public/components/frame/addFileView/addFileView.html
Crush-s/vueHC
258d45e316a9b90a2eb1038c92b58056a0f06f43
[ "Apache-2.0" ]
null
null
null
public/components/frame/addFileView/addFileView.html
Crush-s/vueHC
258d45e316a9b90a2eb1038c92b58056a0f06f43
[ "Apache-2.0" ]
19
2021-04-08T03:16:41.000Z
2022-03-30T00:50:34.000Z
<div class="row"> <div class="col-lg-12"> <div class="ibox"> <div class="ibox-title"> <h5>上传附件</h5> <div class="ibox-tools" style="top:10px;"></div> </div> <div class="ibox-content"> <div class="form-group row"> <label class="col-sm-2 col-form-label">附件</label> <div class="content-img col-sm-10"> <vc:create path="frame/uploadImage" callBackListener="addAdvert" callBackFunction="notifyUploadVedio" namespace="addAdvert" ></vc:create> </div> </div> </div> </div> </div> </div>
35.956522
71
0.395405
8e5941e36379ce5ccb4a9cf07bd6e1ad8e42ef2d
1,520
rb
Ruby
test/controllers/ournaropa_calendar/events_controller_test.rb
code4naropa/ournaropa-calendar
bef642cfd8b45d2fe1c2e5bb19e3450f42feab67
[ "MIT" ]
null
null
null
test/controllers/ournaropa_calendar/events_controller_test.rb
code4naropa/ournaropa-calendar
bef642cfd8b45d2fe1c2e5bb19e3450f42feab67
[ "MIT" ]
null
null
null
test/controllers/ournaropa_calendar/events_controller_test.rb
code4naropa/ournaropa-calendar
bef642cfd8b45d2fe1c2e5bb19e3450f42feab67
[ "MIT" ]
null
null
null
require 'test_helper' module OurnaropaCalendar class EventsControllerTest < ActionController::TestCase setup do @event = ournaropa_calendar_events(:one) @routes = Engine.routes end test "should get index" do get :index assert_response :success assert_not_nil assigns(:events) end test "should get new" do get :new assert_response :success end test "should create event" do assert_difference('Event.count') do post :create, event: { description: @event.description, end: @event.end, location: @event.location, organizer_email: @event.organizer_email, organizer_name: @event.organizer_name, start: @event.start, title: @event.title } end assert_redirected_to event_path(assigns(:event)) end test "should show event" do get :show, id: @event assert_response :success end test "should get edit" do get :edit, id: @event assert_response :success end test "should update event" do patch :update, id: @event, event: { description: @event.description, end: @event.end, location: @event.location, organizer_email: @event.organizer_email, organizer_name: @event.organizer_name, start: @event.start, title: @event.title } assert_redirected_to event_path(assigns(:event)) end test "should destroy event" do assert_difference('Event.count', -1) do delete :destroy, id: @event end assert_redirected_to events_path end end end
28.679245
241
0.680921
2a244db2ef096365458b9ee563fa2cf537affda1
16,708
html
HTML
src/main/webapp/index.html
jparrpearson/java-xslt-servlet
565787e60517f63722bfed2b666e692a49febdf1
[ "MIT" ]
1
2018-07-22T22:10:46.000Z
2018-07-22T22:10:46.000Z
src/main/webapp/index.html
jparrpearson/java-xslt-servlet
565787e60517f63722bfed2b666e692a49febdf1
[ "MIT" ]
null
null
null
src/main/webapp/index.html
jparrpearson/java-xslt-servlet
565787e60517f63722bfed2b666e692a49febdf1
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>XSLT Tester</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> <style> .xml { font-family: monospace; } .inline-element { margin: 0px 15px; } .name, .value { width: 300px !important; } </style> </head> <body> <div class="container-fluid"> <div class="panel panel-default"> <div class="panel-heading"> <h3>XSLT Tester</h3> </div> <div class="panel-body"> <form id="xslt-form" method="POST" encType="multipart/form-data" action="execute"> <div class="row"> <div class="form-group col-sm-6"> <div class="form-inline"> <label for="source" class="control-label">Source Document</label> <div class="form-group form-group-sm"> <select id="source-format" class="form-control inline-element"> <option value="text" selected>Text</option> <option value="file">File</option> </select> </div> </div> </div> <div class="form-group col-sm-6"> <div class="form-inline"> <label for="stylesheet" class="control-label">Stylesheet</label> <div class="form-group form-group-sm"> <select id="stylesheet-format" class="form-control inline-element"> <option value="text" selected>Text</option> <option value="file">File</option> </select> </div> </div> </div> </div> <div class="row"> <div id="source-container" class="form-group col-sm-6"></div> <div id="stylesheet-container" class="form-group col-sm-6"></div> </div> <div class="row"> <div class="form-group col-sm-12"> <div class="form-inline"> <label for="result-format" class="control-label">Result Output</label> <div class="form-group form-group-sm"> <select id="result-format" class="form-control inline-element"> <option value="text" selected>Text</option> <option value="browser">Browser</option> </select> </div> </div> </div> </div> <div class="row"> <div class="form-group col-sm-12"> <div class="form-group"> <button type="button" id="add-parameter" class="btn btn-sm btn-default"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add Parameter</button> </div> <div class="col-sm-offset-1"> <div id="parameters"></div> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <button type="submit" class="btn btn-primary">Execute</button> <button type="reset" class="btn btn-default">Reset</button> </div> </div> </form> <hr> <form> <div class="row"> <div class="form-group col-sm-12"> <label for="result" class="control-label">Result Document</label> </div> </div> <div class="row"> <div class="form-group col-sm-12"> <textarea class="form-control xml" id="result" rows="20"></textarea> </div> </div> </form> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> <script type="text/template" id="source-text"> <textarea class="form-control xml" id="source" name="source" rows="20"></textarea> </script> <script type="text/template" id="source-file"> <input type="file" class="form-control" id="source" name="source"> </script> <script type="text/template" id="stylesheet-text"> <textarea class="form-control xml" id="stylesheet" name="stylesheet" rows="20" required></textarea> </script> <script type="text/template" id="stylesheet-file"> <input type="file" class="form-control" id="stylesheet" name="stylesheet" required> </script> <script type="text/template" id="parameter-group"> <div class="form-group parameter"> <div class="form-inline"> <div class="form-group"> <label>Name</label> <input type="text" class="form-control inline-element name"> </div> <div class="form-group"> <label>Value</label> <input type="text" class="form-control inline-element value"> </div> <button type="button" class="btn btn-sm btn-default remove-parameter"><span class="glyphicon glyphicon-minus" aria-hidden="true"></span> Remove</button> </div> </div> </script> <script type="text/template" id="source-example"> <catalog> <country code="CA"> <name>Canada</name> <capital>Ottawa</capital> </country> <country code="GL"> <name>Greenland</name> <capital>Nuuk</capital> </country> <country code="MX"> <name>Mexico</name> <capital>Mexico City</capital> </country> <country code="US"> <name>United States</name> <capital>Washington</capital> </country> </catalog> </script> <script type="text/template" id="stylesheet-example"> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsd="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xsl xsd"> <xsl:output method="html" indent="yes" /> <xsl:param name="note" /> <xsl:template match="/"> <html> <body> <h1>Countries</h1> <table style="border: 1px solid black; border-collapse: collapse; text-align: left;" cellpadding="10px"> <thead> <tr style="color: white; background-color: green;"> <th>Name</th> <th>Capital</th> <th>Code</th> </tr> </thead> <tbody> <xsl:apply-templates /> </tbody> </table> <xsl:if test="$note"> <p>Note: <xsl:value-of select="$note" /></p> </xsl:if> </body> </html> </xsl:template> <xsl:template match="country"> <tr> <td><xsl:value-of select="name" /></td> <td><xsl:value-of select="capital" /></td> <td><xsl:value-of select="@code" /></td> </tr> </xsl:template> </xsl:stylesheet> </script> <script> $(function() { // Load inputs and outputs from local storage if (localStorage.getItem("source-format")) { $("#source-format").val(localStorage.getItem("source-format")); } if (localStorage.getItem("stylesheet-format")) { $("#stylesheet-format").val(localStorage.getItem("stylesheet-format")); } if (localStorage.getItem("result-format")) { $("#result-format").val(localStorage.getItem("result-format")); } // Handle inputs $("#source-format").on("change", changeSourceFormat).change(); $("#source-container").on("change", "#source", changeSource); $("#stylesheet-format").on("change", changeStylesheetFormat).change(); $("#stylesheet-container").on("change", "#stylesheet", changeStylesheet); $("#result-format").on("change", changeResultFormat); // Handle parameters $("#add-parameter").on("click", addParameter); $("#parameters").on("click", ".remove-parameter", removeParameter); $("#parameters").on("change", ".name", updateParameterName); $("#parameters").on("change", ".value", updateParameterValue); // Load parameters from local storage if (localStorage.getItem("xslt-parameters")) { var parameters = JSON.parse(localStorage.getItem("xslt-parameters")); $.each(parameters, function(name, value) { $("#add-parameter").click(); var parameter = $("#parameters .parameter:last"); $(parameter).find(".value").val(value); $(parameter).find(".name").val(name).change(); }); } // Handle form submit/reset $("#xslt-form").on("submit", submitXsltForm); $("#xslt-form").on("reset", resetXsltForm); }); function changeSourceFormat() { var selected = $(this).val(); // Save input format to local storage localStorage.setItem("source-format", selected); if (selected === "file") { $("#source-container").empty().append($("#source-file").html()); } else { $("#source-container").empty().append($("#source-text").html()); // Load input text from local storage if (localStorage.getItem("source-text")) { $("#source").val(localStorage.getItem("source-text")); } else { $("#source").val($("#source-example").text().trim()); } } } function changeStylesheetFormat() { var selected = $(this).val(); // Save input format to local storage localStorage.setItem("stylesheet-format", selected); if (selected === "file") { $("#stylesheet-container").empty().append($("#stylesheet-file").html()); } else { $("#stylesheet-container").empty().append($("#stylesheet-text").html()); // Load input text from local storage if (localStorage.getItem("stylesheet-text")) { $("#stylesheet").val(localStorage.getItem("stylesheet-text")); } else { $("#stylesheet").val($("#stylesheet-example").text().trim()); } } } function changeSource() { // Save input text to local storage if ($(this).prop("type") !== "file") { localStorage.setItem("source-text", $(this).val()); } } function changeStylesheet() { // Save input text to local storage if ($(this).prop("type") !== "file") { localStorage.setItem("stylesheet-text", $(this).val()); } } function changeResultFormat() { var selected = $(this).val(); // Save result format to local storage localStorage.setItem("result-format", selected); } function addParameter() { $("#parameters").append($("#parameter-group").html()); } function removeParameter() { // Remove parameter from local storage var nameElem = $(this).closest(".parameter").find(".name"); var name = $(nameElem).val(); if (localStorage.getItem("xslt-parameters")) { var parameters = JSON.parse(localStorage.getItem("xslt-parameters")); $.each(parameters, function(n, v) { if (n === name) { delete parameters[n]; return false; } }); localStorage.setItem("xslt-parameters", JSON.stringify(parameters)); } $(this).closest(".parameter").remove(); } function updateParameterName() { var name = $(this).val(); var valueElem = $(this).closest(".parameter").find(".value"); $(valueElem).attr("name", name); var value = $(valueElem).val(); updateParameter(name, value); } function updateParameterValue() { var value = $(this).val(); var nameElem = $(this).closest(".parameter").find(".name"); var name = $(nameElem).val(); updateParameter(name, value); } function updateParameter(name, value) { if (!name) { return; } // Save parameter to local storage if (localStorage.getItem("xslt-parameters")) { var parameters = JSON.parse(localStorage.getItem("xslt-parameters")); var update = false; $.each(parameters, function(n, v) { if (n === name) { parameters[n] = value; update = true; return false; } }); if (!update) { parameters[name] = value; } localStorage.setItem("xslt-parameters", JSON.stringify(parameters)); } else { var parameters = {}; parameters[name] = value; localStorage.setItem("xslt-parameters", JSON.stringify(parameters)); } } function submitXsltForm(evt) { if ($("#result-format").val() === "text") { evt.preventDefault(); $.when($.ajax({ url: "execute", method: "POST", contentType: false, data: new FormData($("#xslt-form")[0]), processData: false, })).done(function(data) { $("#result").val(data); }); return false; } } function resetXsltForm(evt) { evt.preventDefault(); localStorage.removeItem("xslt-parameters"); localStorage.removeItem("source-format"); localStorage.removeItem("source-text"); localStorage.removeItem("stylesheet-format"); localStorage.removeItem("stylesheet-text"); $("#source-format").val("text").change(); $("#stylesheet-format").val("text").change(); $("#parameters").empty(); } </script> </body> </html>
43.73822
196
0.437455
dedef6f66c5decdf2a036615dd479ab1c9b6e034
6,741
rs
Rust
src/commands/dev/socket.rs
jashandeep-sohi/wrangler
e98bb95f000a7751297181577a7e62647309397b
[ "Apache-2.0", "MIT" ]
null
null
null
src/commands/dev/socket.rs
jashandeep-sohi/wrangler
e98bb95f000a7751297181577a7e62647309397b
[ "Apache-2.0", "MIT" ]
61
2021-07-19T14:40:18.000Z
2022-03-08T00:25:58.000Z
src/commands/dev/socket.rs
jashandeep-sohi/wrangler
e98bb95f000a7751297181577a7e62647309397b
[ "Apache-2.0", "MIT" ]
null
null
null
use std::time::Duration; use chrome_devtools as protocol; use futures_util::future::TryFutureExt; use futures_util::sink::SinkExt; use futures_util::stream::{SplitStream, StreamExt}; use tokio_stream::wrappers::UnboundedReceiverStream; use crate::terminal::colored_json_string; use crate::terminal::message::{Message, StdErr, StdOut}; use protocol::domain::runtime::event::Event::ExceptionThrown; use tokio::net::TcpStream; use tokio::sync::mpsc; use tokio::time::sleep; use tokio_tungstenite::{connect_async, tungstenite, MaybeTlsStream, WebSocketStream}; use anyhow::{anyhow, Result}; use url::Url; const KEEP_ALIVE_INTERVAL: u64 = 10; /// connect to a Workers runtime WebSocket emitting the Chrome Devtools Protocol /// parse all console messages, and print them to stdout pub async fn listen(socket_url: Url) -> Result<()> { // we loop here so we can issue a reconnect when something // goes wrong with the websocket connection loop { let ws_stream = connect_retry(&socket_url).await; let (mut write, read) = ws_stream.split(); // console.log messages are in the Runtime domain // we must signal that we want to receive messages from the Runtime domain // before they will be sent let enable_runtime = protocol::runtime::SendMethod::Enable(1.into()); let enable_runtime = serde_json::to_string(&enable_runtime)?; let enable_runtime = tungstenite::protocol::Message::Text(enable_runtime); write.send(enable_runtime).await?; // if left unattended, the preview service will kill the socket // that emits console messages // send a keep alive message every so often in the background let (keep_alive_tx, keep_alive_rx) = mpsc::unbounded_channel(); // every 10 seconds, send a keep alive message on the channel let heartbeat = keep_alive(keep_alive_tx); // when the keep alive channel receives a message from the // heartbeat future, write it to the websocket let keep_alive_to_ws = UnboundedReceiverStream::new(keep_alive_rx) .map(Ok) .forward(write) .map_err(Into::into); // parse all incoming messages and print them to stdout let printer = print_ws_messages(read); // run the heartbeat and message printer in parallel if tokio::try_join!(heartbeat, keep_alive_to_ws, printer).is_ok() { break Ok(()); } else { } } } // Endlessly retry connecting to the chrome devtools instance with exponential backoff. // The backoff maxes out at 60 seconds. async fn connect_retry(socket_url: &Url) -> WebSocketStream<MaybeTlsStream<TcpStream>> { let mut wait_seconds = 2; let maximum_wait_seconds = 60; let mut failed = false; loop { match connect_async(socket_url).await { Ok((ws_stream, _)) => { if failed { // only report success if there was a failure, otherwise be quiet about it StdErr::success("Connected!"); } return ws_stream; } Err(e) => { failed = true; StdErr::warn(&format!("Failed to connect to devtools instance: {}", e)); StdErr::warn(&format!( "Will retry connection in {} seconds", wait_seconds )); sleep(Duration::from_secs(wait_seconds)).await; wait_seconds = wait_seconds.pow(2); if wait_seconds > maximum_wait_seconds { // max out at 60 seconds wait_seconds = maximum_wait_seconds; } StdErr::working("Retrying..."); } } } } fn print_json(value: Result<serde_json::Value, serde_json::Error>, fallback: String) { if let Ok(json) = value { if let Ok(json_str) = colored_json_string(&json) { println!("{}", json_str); } else { StdOut::message(fallback.as_str()); } } else { println!("{}", fallback); } } async fn print_ws_messages( mut read: SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>, ) -> Result<()> { while let Some(message) = read.next().await { let message = message?; let message_text = message.into_text().unwrap(); log::info!("{}", &message_text); let parsed_message: Result<protocol::Runtime> = serde_json::from_str(&message_text) .map_err(|e| anyhow!("Failed to parse event:\n{}", e)); match parsed_message { Ok(protocol::Runtime::Event(ExceptionThrown(params))) => { let default_description = "N/A".to_string(); let description = params .exception_details .exception .description .as_ref() .unwrap_or(&default_description); StdOut::message(&format!( "{} at line {:?}, col {:?}", description, params.exception_details.line_number, params.exception_details.column_number, )); let json_parse = serde_json::to_value(params.clone()); print_json(json_parse, format!("{:?}", params)); } Ok(protocol::Runtime::Event(event)) => { // Try to parse json to pretty print, otherwise just print string let json_parse: Result<serde_json::Value, serde_json::Error> = serde_json::from_str(&*event.to_string()); print_json(json_parse, event.to_string()); } Ok(protocol::Runtime::Method(_)) => {} Err(err) => log::debug!("{}", err), } } Ok(()) } async fn keep_alive(tx: mpsc::UnboundedSender<tungstenite::protocol::Message>) -> Result<()> { let duration = Duration::from_millis(1000 * KEEP_ALIVE_INTERVAL); let mut delay = sleep(duration); // this is set to 2 because we have already sent an id of 1 to enable the runtime // eventually this logic should be moved to the chrome-devtools-rs library let mut id = 2; loop { delay.await; let keep_alive_message = protocol::runtime::SendMethod::GetIsolateId(id.into()); let keep_alive_message = serde_json::to_string(&keep_alive_message) .expect("Could not convert keep alive message to JSON"); let keep_alive_message = tungstenite::protocol::Message::Text(keep_alive_message); tx.send(keep_alive_message).unwrap(); id += 1; delay = sleep(duration); } }
38.084746
94
0.601246
f51d365f1b95f2327637b8a979fb5e7376700619
1,897
swift
Swift
UILib/UIKitRenderer/TableView/TableViewRenderer.swift
Ben-G/UILib
927acff9261e353493a88e7f0d9639f0d45dc9ae
[ "MIT" ]
58
2016-05-27T13:44:36.000Z
2021-06-23T19:56:08.000Z
UILib/UIKitRenderer/TableView/TableViewRenderer.swift
Ben-G/UILib
927acff9261e353493a88e7f0d9639f0d45dc9ae
[ "MIT" ]
1
2017-07-05T20:43:44.000Z
2017-07-05T20:43:44.000Z
UILib/UIKitRenderer/TableView/TableViewRenderer.swift
Ben-G/UILib
927acff9261e353493a88e7f0d9639f0d45dc9ae
[ "MIT" ]
3
2017-07-03T18:24:13.000Z
2019-08-30T05:05:17.000Z
// // UserListComponent.swift // UILib // // Created by Benji Encz on 5/14/16. // Copyright © 2016 Benjamin Encz. All rights reserved. // import UIKit extension TableViewModel: UIKitRenderable { func renderUIKit() -> UIKitRenderTree { let tableViewRenderer = TableViewRenderer( cellTypes: self.cellTypeDefinitions ) tableViewRenderer.tableViewModel = self return .leaf(self, tableViewRenderer) } func updateUIKit(_ view: UIView, change: Changes, newComponent: UIKitRenderable, renderTree: UIKitRenderTree) -> UIKitRenderTree { guard let view = view as? TableViewRenderer else { fatalError() } guard let newComponent = newComponent as? TableViewModel else { fatalError() } // Update view model view.tableViewModel = newComponent if case let .root(changes) = change { // need to check which sections / rows are affected for (sectionIndex, change) in changes.enumerated() { if case let .root(changes) = change { for (_, change) in changes.enumerated() { switch change { case let .remove(row): view.tableView.deleteRows( at: [IndexPath(row: row, section: sectionIndex)], with: .automatic ) case let .insert(row, _): view.tableView.insertRows( at: [IndexPath(row: row, section: sectionIndex)], with: .automatic ) default: break } } } } } return .leaf(newComponent, view) } }
32.152542
134
0.504481
f89b49dc47586d04735cc85059e9abf3c8b20098
737
swift
Swift
Tests/RxSwiftTests/TestImplementations/Mocks/TestConnectableObservable.swift
JacksonJang/RxSwift
ba2ee6cec4844d989adac56f3c0b828a64f8b738
[ "MIT" ]
23,526
2015-08-06T19:09:28.000Z
2022-03-31T15:54:19.000Z
Tests/RxSwiftTests/TestImplementations/Mocks/TestConnectableObservable.swift
JacksonJang/RxSwift
ba2ee6cec4844d989adac56f3c0b828a64f8b738
[ "MIT" ]
2,023
2015-08-06T19:04:34.000Z
2022-03-30T08:23:53.000Z
Tests/RxSwiftTests/TestImplementations/Mocks/TestConnectableObservable.swift
JacksonJang/RxSwift
ba2ee6cec4844d989adac56f3c0b828a64f8b738
[ "MIT" ]
5,287
2015-08-06T21:30:50.000Z
2022-03-31T08:01:22.000Z
// // TestConnectableObservable.swift // Tests // // Created by Krunoslav Zaher on 4/19/15. // Copyright © 2015 Krunoslav Zaher. All rights reserved. // import RxSwift final class TestConnectableObservable<Subject: SubjectType> : ConnectableObservableType where Subject.Element == Subject.Observer.Element { typealias Element = Subject.Element let o: ConnectableObservable<Subject.Element> init(o: Observable<Subject.Element>, s: Subject) { self.o = o.multicast(s) } func connect() -> Disposable { self.o.connect() } func subscribe<Observer: ObserverType>(_ observer: Observer) -> Disposable where Observer.Element == Element { self.o.subscribe(observer) } }
26.321429
139
0.68521
0bace2b046ca22fa3e2673291af750ce09c8648c
831
js
JavaScript
src/main.js
xuuhf/taoMall
fd55bcd59a122e4ca925458a0b4060f772462ca0
[ "MIT" ]
null
null
null
src/main.js
xuuhf/taoMall
fd55bcd59a122e4ca925458a0b4060f772462ca0
[ "MIT" ]
4
2020-07-18T20:39:24.000Z
2022-02-26T20:22:39.000Z
src/main.js
xuuhf/taoMall
fd55bcd59a122e4ca925458a0b4060f772462ca0
[ "MIT" ]
null
null
null
import Vue from 'vue'; import App from './app'; import router from './router'; // import fastclick from 'fastclick' import VueLazyload from 'vue-lazyload' import 'swiper/dist/css/swiper.css' import echarts from "echarts"; import './assets/scss/global.scss'; import './assets/scss/base.scss' import './assets/scss/iconfont.scss' import './assets/scss/_list.scss' import './assets/js/mock' Vue.prototype.$echarts = echarts; // fastclick.attach(document.body) Vue.config.productionTip = false Vue.use(VueLazyload, { error: require('./assets/images/error.png'), loading: require('./assets/images/loading.gif') }) Vue.directive('focus', { inserted: function(el) { el.focus() } }) new Vue({ el: '#app', components: { App }, router, render: (createElement) => createElement(App) });
23.083333
51
0.672684
c5977f769fda44da8ad86eb894e4a5811bb7f97f
433
swift
Swift
Home/Framework/HomeFrameworkTests/AuthorsMapperPlainShould.swift
petros-efthymiou/Mobile-iOS-Microservices-Architecture
0897521651a49fecd104bea8cad010e074fd5e24
[ "Apache-2.0" ]
3
2022-02-23T09:08:28.000Z
2022-03-19T14:03:37.000Z
Home/Framework/HomeFrameworkTests/AuthorsMapperPlainShould.swift
petros-efthymiou/Mobile-iOS-Microservices-Architecture
0897521651a49fecd104bea8cad010e074fd5e24
[ "Apache-2.0" ]
null
null
null
Home/Framework/HomeFrameworkTests/AuthorsMapperPlainShould.swift
petros-efthymiou/Mobile-iOS-Microservices-Architecture
0897521651a49fecd104bea8cad010e074fd5e24
[ "Apache-2.0" ]
null
null
null
// // AuthorsMapperPlainShould.swift // HomeFrameworkTests // // Created by Petros Efthymiou on 16/02/2022. // import Foundation import XCTest @testable import Home class AuthorsMapperPlainShould: XCTestCase { var sut = AuthorsMapperPlain() func testMapAuthorsLocalToPlain() throws { let result = sut.mapToPlain(authorsLocal: authorsLocal) XCTAssertEqual(authorsPlain, result) } }
19.681818
63
0.702079
cfa038a63c710e709322c7a71528223302c31a93
572
swift
Swift
QRCode/Sources/Protected/QRData/QR8BitByte.swift
vitali-kurlovich/QRCode
35df3a68be5232a923dee232b0c1d72dae301f93
[ "MIT" ]
1
2021-02-02T12:19:11.000Z
2021-02-02T12:19:11.000Z
QRCode/Sources/Protected/QRData/QR8BitByte.swift
vitali-kurlovich/QRCode
35df3a68be5232a923dee232b0c1d72dae301f93
[ "MIT" ]
null
null
null
QRCode/Sources/Protected/QRData/QR8BitByte.swift
vitali-kurlovich/QRCode
35df3a68be5232a923dee232b0c1d72dae301f93
[ "MIT" ]
1
2019-09-04T01:53:54.000Z
2019-09-04T01:53:54.000Z
// // QR8BitByte.swift // QRCode Generator // // Created by Vitali Kurlovich on 11/9/17. // import Foundation final class QR8BitByte: QRData { private let bdata:Data init(_ data:String) { bdata = data.data(using: .shiftJIS, allowLossyConversion: true)! super .init(QRMode.MODE_8BIT_BYTE, data) } init(_ data:Data) { bdata = data super .init(QRMode.MODE_8BIT_BYTE, "") } override var lenght: Int { get { return bdata.count; } } override func write(_ buffer: inout QRBitBuffer ) { for d in bdata { buffer.put(Int(d), 8); } } }
15.459459
66
0.655594
652a2bec3a1bbb15dcd3f0465f2e3a5760856d24
182
py
Python
z2z_metadata/__init__.py
Mitchellpkt/z2z-metadata
261a694225efc21d65a9f3be69a9017bbc29864e
[ "MIT" ]
null
null
null
z2z_metadata/__init__.py
Mitchellpkt/z2z-metadata
261a694225efc21d65a9f3be69a9017bbc29864e
[ "MIT" ]
null
null
null
z2z_metadata/__init__.py
Mitchellpkt/z2z-metadata
261a694225efc21d65a9f3be69a9017bbc29864e
[ "MIT" ]
null
null
null
"""Top-level package for z2z Metadata analysis.""" __author__ = """Isthmus // Mitchell P. Krawiec-Thayer""" __email__ = 'project_z2z_metadata@mitchellpkt.com' __version__ = '0.0.1'
30.333333
56
0.730769
e723fe09002afde8669f2fded845c15bb92f219e
8,141
js
JavaScript
resources/public/js/compiled/devcards_out/sablono/interpreter.js
staypufd/DataTables_from_ClojureScript_in_DevCards_PlayGround
1ba17c99eb6d27e0ca150aaf18e61f3cb60ae72f
[ "MIT" ]
null
null
null
resources/public/js/compiled/devcards_out/sablono/interpreter.js
staypufd/DataTables_from_ClojureScript_in_DevCards_PlayGround
1ba17c99eb6d27e0ca150aaf18e61f3cb60ae72f
[ "MIT" ]
null
null
null
resources/public/js/compiled/devcards_out/sablono/interpreter.js
staypufd/DataTables_from_ClojureScript_in_DevCards_PlayGround
1ba17c99eb6d27e0ca150aaf18e61f3cb60ae72f
[ "MIT" ]
null
null
null
// Compiled by ClojureScript 1.7.170 {} goog.provide('sablono.interpreter'); goog.require('cljs.core'); goog.require('clojure.string'); goog.require('sablono.util'); goog.require('goog.object'); goog.require('cljsjs.react'); /** * @interface */ sablono.interpreter.IInterpreter = function(){}; /** * Interpret a Clojure data structure as a React fn call. */ sablono.interpreter.interpret = (function sablono$interpreter$interpret(this$){ if((!((this$ == null))) && (!((this$.sablono$interpreter$IInterpreter$interpret$arity$1 == null)))){ return this$.sablono$interpreter$IInterpreter$interpret$arity$1(this$); } else { var x__17481__auto__ = (((this$ == null))?null:this$); var m__17482__auto__ = (sablono.interpreter.interpret[goog.typeOf(x__17481__auto__)]); if(!((m__17482__auto__ == null))){ return m__17482__auto__.call(null,this$); } else { var m__17482__auto____$1 = (sablono.interpreter.interpret["_"]); if(!((m__17482__auto____$1 == null))){ return m__17482__auto____$1.call(null,this$); } else { throw cljs.core.missing_protocol.call(null,"IInterpreter.interpret",this$); } } } }); sablono.interpreter.wrap_form_element = (function sablono$interpreter$wrap_form_element(ctor,display_name){ return React.createFactory(React.createClass({"getDisplayName": (function (){ return cljs.core.name.call(null,display_name); }), "getInitialState": (function (){ var this$ = this; return {"value": (this$.props["value"])}; }), "onChange": (function (e){ var this$ = this; var handler = (this$.props["onChange"]); if((handler == null)){ return null; } else { handler.call(null,e); return this$.setState({"value": e.target.value}); } }), "componentWillReceiveProps": (function (new_props){ var this$ = this; return this$.setState({"value": (new_props["value"])}); }), "render": (function (){ var this$ = this; var props = {}; goog.object.extend(props,this$.props,{"value": (this$.state["value"]), "onChange": (this$["onChange"]), "children": (this$.props["children"])}); return ctor.call(null,props); })})); }); sablono.interpreter.input = sablono.interpreter.wrap_form_element.call(null,React.DOM.input,"input"); sablono.interpreter.option = sablono.interpreter.wrap_form_element.call(null,React.DOM.option,"option"); sablono.interpreter.textarea = sablono.interpreter.wrap_form_element.call(null,React.DOM.textarea,"textarea"); sablono.interpreter.create_element = (function sablono$interpreter$create_element(var_args){ var args__17891__auto__ = []; var len__17884__auto___21772 = arguments.length; var i__17885__auto___21773 = (0); while(true){ if((i__17885__auto___21773 < len__17884__auto___21772)){ args__17891__auto__.push((arguments[i__17885__auto___21773])); var G__21774 = (i__17885__auto___21773 + (1)); i__17885__auto___21773 = G__21774; continue; } else { } break; } var argseq__17892__auto__ = ((((2) < args__17891__auto__.length))?(new cljs.core.IndexedSeq(args__17891__auto__.slice((2)),(0))):null); return sablono.interpreter.create_element.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__17892__auto__); }); sablono.interpreter.create_element.cljs$core$IFn$_invoke$arity$variadic = (function (type,props,children){ return (cljs.core.truth_(sablono.util.wrapped_type_QMARK_.call(null,type))?cljs.core.get.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"input","input",556931961),sablono.interpreter.input,new cljs.core.Keyword(null,"option","option",65132272),sablono.interpreter.option,new cljs.core.Keyword(null,"textarea","textarea",-650375824),sablono.interpreter.textarea], null),cljs.core.keyword.call(null,type)):cljs.core.partial.call(null,React.createElement,cljs.core.name.call(null,type))).call(null,props,(((cljs.core.sequential_QMARK_.call(null,children)) && (cljs.core._EQ_.call(null,(1),cljs.core.count.call(null,children))))?cljs.core.first.call(null,children):children)); }); sablono.interpreter.create_element.cljs$lang$maxFixedArity = (2); sablono.interpreter.create_element.cljs$lang$applyTo = (function (seq21769){ var G__21770 = cljs.core.first.call(null,seq21769); var seq21769__$1 = cljs.core.next.call(null,seq21769); var G__21771 = cljs.core.first.call(null,seq21769__$1); var seq21769__$2 = cljs.core.next.call(null,seq21769__$1); return sablono.interpreter.create_element.cljs$core$IFn$_invoke$arity$variadic(G__21770,G__21771,seq21769__$2); }); sablono.interpreter.attributes = (function sablono$interpreter$attributes(attrs){ var attrs__$1 = cljs.core.clj__GT_js.call(null,sablono.util.html_to_dom_attrs.call(null,attrs)); var class$ = attrs__$1.className; var class$__$1 = ((cljs.core.array_QMARK_.call(null,class$))?clojure.string.join.call(null," ",class$):class$); if(clojure.string.blank_QMARK_.call(null,class$__$1)){ delete attrs__$1["className"]; } else { attrs__$1.className = class$__$1; } return attrs__$1; }); /** * Render an element vector as a HTML element. */ sablono.interpreter.element = (function sablono$interpreter$element(element__$1){ var vec__21776 = sablono.util.normalize_element.call(null,element__$1); var type = cljs.core.nth.call(null,vec__21776,(0),null); var attrs = cljs.core.nth.call(null,vec__21776,(1),null); var content = cljs.core.nth.call(null,vec__21776,(2),null); var js_attrs = sablono.interpreter.attributes.call(null,attrs); if((cljs.core.sequential_QMARK_.call(null,content)) && (cljs.core._EQ_.call(null,(1),cljs.core.count.call(null,content)))){ return sablono.interpreter.create_element.call(null,type,js_attrs,sablono.interpreter.interpret.call(null,cljs.core.first.call(null,content))); } else { if(cljs.core.truth_(content)){ return sablono.interpreter.create_element.call(null,type,js_attrs,sablono.interpreter.interpret.call(null,content)); } else { return sablono.interpreter.create_element.call(null,type,js_attrs,null); } } }); sablono.interpreter.interpret_seq = (function sablono$interpreter$interpret_seq(s){ return cljs.core.into_array.call(null,cljs.core.map.call(null,sablono.interpreter.interpret,s)); }); cljs.core.Cons.prototype.sablono$interpreter$IInterpreter$ = true; cljs.core.Cons.prototype.sablono$interpreter$IInterpreter$interpret$arity$1 = (function (this$){ var this$__$1 = this; return sablono.interpreter.interpret_seq.call(null,this$__$1); }); cljs.core.ChunkedSeq.prototype.sablono$interpreter$IInterpreter$ = true; cljs.core.ChunkedSeq.prototype.sablono$interpreter$IInterpreter$interpret$arity$1 = (function (this$){ var this$__$1 = this; return sablono.interpreter.interpret_seq.call(null,this$__$1); }); cljs.core.LazySeq.prototype.sablono$interpreter$IInterpreter$ = true; cljs.core.LazySeq.prototype.sablono$interpreter$IInterpreter$interpret$arity$1 = (function (this$){ var this$__$1 = this; return sablono.interpreter.interpret_seq.call(null,this$__$1); }); cljs.core.List.prototype.sablono$interpreter$IInterpreter$ = true; cljs.core.List.prototype.sablono$interpreter$IInterpreter$interpret$arity$1 = (function (this$){ var this$__$1 = this; return sablono.interpreter.interpret_seq.call(null,this$__$1); }); cljs.core.IndexedSeq.prototype.sablono$interpreter$IInterpreter$ = true; cljs.core.IndexedSeq.prototype.sablono$interpreter$IInterpreter$interpret$arity$1 = (function (this$){ var this$__$1 = this; return sablono.interpreter.interpret_seq.call(null,this$__$1); }); cljs.core.Subvec.prototype.sablono$interpreter$IInterpreter$ = true; cljs.core.Subvec.prototype.sablono$interpreter$IInterpreter$interpret$arity$1 = (function (this$){ var this$__$1 = this; return sablono.interpreter.element.call(null,this$__$1); }); cljs.core.PersistentVector.prototype.sablono$interpreter$IInterpreter$ = true; cljs.core.PersistentVector.prototype.sablono$interpreter$IInterpreter$interpret$arity$1 = (function (this$){ var this$__$1 = this; return sablono.interpreter.element.call(null,this$__$1); }); (sablono.interpreter.IInterpreter["_"] = true); (sablono.interpreter.interpret["_"] = (function (this$){ return this$; })); (sablono.interpreter.IInterpreter["null"] = true); (sablono.interpreter.interpret["null"] = (function (this$){ return null; })); //# sourceMappingURL=interpreter.js.map?rel=1454026300746
41.748718
705
0.7617
3d36b3df50f77dfe10379a76fe5fe2587955a6c3
883
go
Go
515de9ae9dcfc28eb6000001_test.go
Tsuki/codewar
b698fb6d8e6dd4e8d127953f856af7c3d8ffeadd
[ "MIT" ]
null
null
null
515de9ae9dcfc28eb6000001_test.go
Tsuki/codewar
b698fb6d8e6dd4e8d127953f856af7c3d8ffeadd
[ "MIT" ]
null
null
null
515de9ae9dcfc28eb6000001_test.go
Tsuki/codewar
b698fb6d8e6dd4e8d127953f856af7c3d8ffeadd
[ "MIT" ]
null
null
null
package kata_test import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("Test Example", func() { It("should return true", func() { Expect(Solution("abcdef")).To(Equal([]string{"ab", "cd", "ef"})) }) It("should return false", func() { Expect(Solution("abc")).To(Equal([]string{"ab", "c_"})) }) }) //func Solution(str string) []string { // result := make([]string, 0) // arr := strings.Split(str, "") // for i := 0; i+1 <= len(str); i += 2 { // if i+2 <= len(str) { // result = append(result, strings.Join(arr[i:i+2], "")) // } else { // result = append(result, strings.Join(append(arr[i:i+1], "_"), "")) // } // } // return result //} func Solution(str string) []string { result := make([]string, 0) if len(str)%2 != 0 { str += "_" } for i := 0; i+1 <= len(str); i += 2 { result = append(result, str[i:i+2]) } return result }
22.641026
71
0.559456
3dd388b09d13df63a0bf3d6e45c5a42afa850bd7
7,173
rs
Rust
account/service/src/service.rs
fengzeyan/starcoin
6518ed5f16cf3c6111e0c2523a7f774f88658061
[ "Apache-2.0" ]
null
null
null
account/service/src/service.rs
fengzeyan/starcoin
6518ed5f16cf3c6111e0c2523a7f774f88658061
[ "Apache-2.0" ]
null
null
null
account/service/src/service.rs
fengzeyan/starcoin
6518ed5f16cf3c6111e0c2523a7f774f88658061
[ "Apache-2.0" ]
null
null
null
// Copyright (c) The Starcoin Core Contributors // SPDX-License-Identifier: Apache-2.0 use anyhow::Result; use starcoin_account_api::message::{AccountRequest, AccountResponse}; use starcoin_account_lib::{account_storage::AccountStorage, AccountManager}; use starcoin_config::NodeConfig; use starcoin_crypto::ValidCryptoMaterial; use starcoin_logger::prelude::*; use starcoin_service_registry::mocker::MockHandler; use starcoin_service_registry::{ActorService, ServiceContext, ServiceFactory, ServiceHandler}; use starcoin_types::account_config::{association_address, STC_TOKEN_CODE}; use std::any::Any; use std::sync::Arc; pub const DEFAULT_ACCOUNT_PASSWORD: &str = ""; pub struct AccountService { manager: AccountManager, } impl AccountService { pub fn mock() -> Result<Self> { let manager = AccountManager::new(AccountStorage::mock())?; //auto create default account. manager.create_account("")?; Ok(Self { manager }) } } impl MockHandler<AccountService> for AccountService { fn handle( &mut self, r: Box<dyn Any>, ctx: &mut ServiceContext<AccountService>, ) -> Box<dyn Any> { let request = r .downcast::<AccountRequest>() .expect("Downcast to AccountRequest fail."); let result = ServiceHandler::<AccountService, AccountRequest>::handle(self, *request, ctx); Box::new(result) } } impl ActorService for AccountService { fn started(&mut self, ctx: &mut ServiceContext<Self>) -> Result<()> { let account = self.manager.default_account_info()?; if account.is_none() { self.manager.create_account(DEFAULT_ACCOUNT_PASSWORD)?; } let config = ctx .get_shared::<Arc<NodeConfig>>() .expect("Get NodeConfig should success."); //Only test/dev network association_key_pair contains private_key. if let (Some(association_private_key), _) = &config.net().genesis_config().association_key_pair { let association_account = self.manager.account_info(association_address())?; if association_account.is_none() { if let Err(e) = self.manager.import_account( association_address(), association_private_key.to_bytes().to_vec(), "", ) { error!("Import association account error:{:?}", e) } else { info!("Import association account to wallet."); } } } Ok(()) } } impl ServiceFactory<AccountService> for AccountService { fn create(ctx: &mut ServiceContext<AccountService>) -> Result<AccountService> { let account_storage = ctx.get_shared::<AccountStorage>()?; let manager = AccountManager::new(account_storage)?; Ok(Self { manager }) } } impl ServiceHandler<AccountService, AccountRequest> for AccountService { fn handle( &mut self, msg: AccountRequest, _ctx: &mut ServiceContext<Self>, ) -> Result<AccountResponse> { let response = match msg { AccountRequest::CreateAccount(password) => AccountResponse::AccountInfo(Box::new( self.manager.create_account(password.as_str())?.info(), )), AccountRequest::GetDefaultAccount() => { AccountResponse::AccountInfoOption(Box::new(self.manager.default_account_info()?)) } AccountRequest::SetDefaultAccount(address) => { let account_info = self.manager.account_info(address)?; // only set default if this address exists if account_info.is_some() { self.manager.set_default_account(address)?; } AccountResponse::AccountInfoOption(Box::new(account_info)) } AccountRequest::GetAccounts() => { AccountResponse::AccountList(self.manager.list_account_infos()?) } AccountRequest::GetAccount(address) => { AccountResponse::AccountInfoOption(Box::new(self.manager.account_info(address)?)) } AccountRequest::SignTxn { txn: raw_txn, signer, } => AccountResponse::SignedTxn(Box::new(self.manager.sign_txn(signer, *raw_txn)?)), AccountRequest::SignMessage { message, signer } => AccountResponse::MessageSignature( Box::new(self.manager.sign_message(signer, message)?), ), AccountRequest::UnlockAccount(address, password, duration) => { self.manager .unlock_account(address, password.as_str(), duration)?; AccountResponse::UnlockAccountResponse } AccountRequest::LockAccount(address) => { self.manager.lock_account(address)?; AccountResponse::None } AccountRequest::ExportAccount { address, password } => { let data = self.manager.export_account(address, password.as_str())?; AccountResponse::ExportAccountResponse(data) } AccountRequest::ImportAccount { address, password, private_key, } => { let wallet = self.manager .import_account(address, private_key, password.as_str())?; AccountResponse::AccountInfo(Box::new(wallet.info())) } AccountRequest::AccountAcceptedTokens { address } => { let mut tokens = self.manager.accepted_tokens(address)?; //auto add STC to accepted tokens. if !tokens.contains(&STC_TOKEN_CODE) { tokens.push(STC_TOKEN_CODE.clone()) } AccountResponse::AcceptedTokens(tokens) } AccountRequest::ChangePassword { address, new_password, } => { self.manager.change_password(address, new_password)?; AccountResponse::None } }; Ok(response) } } #[cfg(test)] mod tests { use super::*; use starcoin_account_api::AccountAsyncService; use starcoin_config::NodeConfig; use starcoin_service_registry::{RegistryAsyncService, RegistryService}; #[stest::test] async fn test_actor_launch() -> Result<()> { let config = Arc::new(NodeConfig::random_for_test()); let registry = RegistryService::launch(); let vault_config = &config.vault; let account_storage = AccountStorage::create_from_path(vault_config.dir(), config.storage.rocksdb_config())?; registry.put_shared(config).await?; registry.put_shared(account_storage).await?; let service_ref = registry.register::<AccountService>().await?; let account = service_ref.get_default_account().await?; //default account will auto create assert!(account.is_some()); Ok(()) } }
38.358289
99
0.595567
6e25d16ddcf7b8aee1d729dab21e9772cd64d156
585
html
HTML
WinPy32/win32inet__InternetGoOnline_meth.html
zjhczl/myWork
aecc89aa11ed06db3115ab937bae2e1e3fdf8387
[ "Apache-2.0" ]
null
null
null
WinPy32/win32inet__InternetGoOnline_meth.html
zjhczl/myWork
aecc89aa11ed06db3115ab937bae2e1e3fdf8387
[ "Apache-2.0" ]
null
null
null
WinPy32/win32inet__InternetGoOnline_meth.html
zjhczl/myWork
aecc89aa11ed06db3115ab937bae2e1e3fdf8387
[ "Apache-2.0" ]
null
null
null
<HTML> <HEAD> <TITLE>win32inet.InternetGoOnline</TITLE> <META NAME="GENERATOR" CONTENT="Autoduck, by erica@microsoft.com"> <H1><A HREF="win32inet.html">win32inet</A>.InternetGoOnline</H1><P> <B>InternetGoOnline(<I>Url</I><I>, Parent</I><I>, Flags</I></B>)<P>Prompts the user for permission to initiate connection to a URL.<P> <H3>Parameters</H3><P><DT><I>Url</I> : string<P> <DD>Web site to connect to<P><DT><I>Parent=None</I> : int<P> <DD>Handle to parent window<P> <DT><I>Flags=0</I> : int<P> <DD>INTERNET_GOONLINE_REFRESH is only available flag<P> </body> </html>
18.28125
134
0.676923