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
90e535e82968074c3698847d2d8437d5f4921c4b
5,990
py
Python
repo_health/check_django_dependencies_compatibility.py
openedx/edx-repo-health
c27f906fdb0ddb3a7b91b2eba999219989ff8442
[ "Apache-2.0" ]
2
2020-09-02T06:27:41.000Z
2021-11-26T06:05:20.000Z
repo_health/check_django_dependencies_compatibility.py
edx/edx-repo-health
071ebb402333e558e0f4c19de6ca083187499e6d
[ "Apache-2.0" ]
83
2020-04-28T18:14:07.000Z
2021-12-31T00:10:32.000Z
repo_health/check_django_dependencies_compatibility.py
openedx/edx-repo-health
c27f906fdb0ddb3a7b91b2eba999219989ff8442
[ "Apache-2.0" ]
5
2020-04-08T21:22:52.000Z
2021-12-17T10:11:09.000Z
""" contains check that reads/parses dependencies of a repo """ import csv import json import logging import os import re import tempfile from pathlib import Path from packaging.version import parse import pytest import requests from pytest_repo_health import health_metadata from repo_health import get_file_lines, DJANGO_DEPS_SHEET_URL, GITHUB_URL_PATTERN, PYPI_PACKAGE_PATTERN logger = logging.getLogger(__name__) MODULE_DICT_KEY = "django_packages" @pytest.fixture(scope='session') # pragma: no cover def csv_filepath(): tmpdir = tempfile.mkdtemp() return os.path.join(tmpdir, "django_dependencies_sheet.csv") @pytest.fixture(name='django_deps_sheet', scope="session") # pragma: no cover def django_dependency_sheet_fixture(csv_filepath): # pylint: disable=redefined-outer-name """ Returns the path for csv file which contains django dependencies status. Also, makes a request for latest sheet & dumps response into the csv file if request was successful. """ res = requests.get(DJANGO_DEPS_SHEET_URL) if res.status_code == 200: with open(csv_filepath, 'w', encoding="utf8") as fp: fp.write(res.text) return csv_filepath class DjangoDependencyReader: """ Django dependency reader class """ def __init__(self, repo_path): self.repo_path = repo_path self.dependencies = {} def _is_python_repo(self) -> bool: return os.path.exists(os.path.join(self.repo_path, "requirements")) def _read_dependencies(self): """ Method processing python requirements files """ requirement_files = [str(file) for file in Path(os.path.join(self.repo_path, "requirements")).rglob('*.txt') if 'constraints' not in str(file)] for file_path in requirement_files: lines = get_file_lines(file_path) for line in lines: stripped_line = self.strip_requirement(line) if not stripped_line: continue if 'git+http' in stripped_line: name, version = self.extract_from_github_link(stripped_line) else: name, version = self.extract_from_pypi_package(stripped_line) self.dependencies[name] = version @staticmethod def strip_requirement(line): """ Finds if the requirement line is actually a requirement & not a reference to other files """ if line and not re.search('^[#-]', line): return re.sub(r' +[;#].*', "", line).replace('-e ', "") return None @staticmethod def extract_from_github_link(github_dep) -> tuple: """ Extracts the package name from Github URL """ match = re.search(GITHUB_URL_PATTERN, github_dep) if match: return match.group("package"), '' return '', '' @staticmethod def extract_from_pypi_package(pypi_dependency) -> tuple: """ Sanitizes the package name from any version constraint and extra spaces """ pypi_dependency = "".join(pypi_dependency.split()) match = re.match(PYPI_PACKAGE_PATTERN, pypi_dependency) if match: return match.group('package_name'), match.group('version') return '', '' def read(self) -> dict: """ Entry method for reading data """ if not self._is_python_repo(): return {} self._read_dependencies() return self.dependencies def get_upgraded_dependencies_count(repo_path, django_dependency_sheet) -> tuple: """ Entry point to read, parse and calculate django dependencies @param repo_path: path for repo which we are calculating django deps @param django_dependency_sheet: csv which contains latest status of django deps @return: count for all + upgraded django deps in repo """ reader_instance = DjangoDependencyReader(repo_path) deps = reader_instance.read() django_deps = [] deps_support_django32 = [] upgraded_in_repo = [] csv_path = django_dependency_sheet with open(csv_path, encoding="utf8") as csv_file: csv_reader = csv.DictReader(csv_file, delimiter=',', quotechar='"') for line in csv_reader: package_name = line["Django Package Name"] if package_name in deps.keys(): # pylint: disable=consider-iterating-dictionary django_deps.append(package_name) if line["Django 3.2"] and line["Django 3.2"] != '-': deps_support_django32.append(package_name) if parse(deps[package_name]) >= parse(line["Django 3.2"]): upgraded_in_repo.append(package_name) django_deps = list(set(django_deps)) deps_support_django32 = list(set(deps_support_django32)) upgraded_in_repo = list(set(upgraded_in_repo)) return django_deps, deps_support_django32, upgraded_in_repo @health_metadata( [MODULE_DICT_KEY], { "total": "Dependencies that depend on Django", "django_32": "Dependencies that support Django 3.2", "upgraded": "Dependencies that are upgraded to support Django 3.2" }, ) def check_django_dependencies_status(repo_path, all_results, django_deps_sheet): """ Test to find the django dependencies compatibility """ django_deps, support_django32_deps, upgraded_in_repo = get_upgraded_dependencies_count( repo_path, django_deps_sheet) all_results[MODULE_DICT_KEY] = { 'total': { 'count': len(django_deps), 'list': json.dumps(django_deps), }, 'django_32': { 'count': len(support_django32_deps), 'list': json.dumps(support_django32_deps) }, 'upgraded': { 'count': len(upgraded_in_repo), 'list': json.dumps(upgraded_in_repo) } }
31.861702
104
0.641903
eff812c204545a35e951c8cb7ff6be0ad074fcd0
338
sql
SQL
migrations/0002_tweaks_up.sql
alrs/acyl
fd176e80faa855621085f008acb3bd8e0938be38
[ "MIT" ]
138
2019-02-26T21:36:59.000Z
2022-03-29T09:15:01.000Z
migrations/0002_tweaks_up.sql
alrs/acyl
fd176e80faa855621085f008acb3bd8e0938be38
[ "MIT" ]
78
2019-03-04T22:45:56.000Z
2022-02-09T20:04:35.000Z
migrations/0002_tweaks_up.sql
alrs/acyl
fd176e80faa855621085f008acb3bd8e0938be38
[ "MIT" ]
12
2019-02-22T23:30:55.000Z
2021-12-23T22:20:54.000Z
ALTER TABLE environments DROP CONSTRAINT environments_name_key; ALTER TABLE environments ADD COLUMN active BOOLEAN; ALTER TABLE environments ADD CONSTRAINT unique_active UNIQUE (name, active); ALTER TABLE environments ALTER COLUMN kube_namespace DROP NOT NULL; ALTER TABLE env_created_events DROP CONSTRAINT env_created_events_name_key;
48.285714
76
0.863905
e619d5ba98bd3c88a037e2ab37d1aee9487199bb
155
go
Go
count.go
brydavis/grid_other
fdb84992377d743bf84eabf47d5d3d40bbbac29e
[ "MIT" ]
3
2015-12-28T17:04:12.000Z
2021-03-04T22:02:38.000Z
count.go
brydavis/grid_other
fdb84992377d743bf84eabf47d5d3d40bbbac29e
[ "MIT" ]
null
null
null
count.go
brydavis/grid_other
fdb84992377d743bf84eabf47d5d3d40bbbac29e
[ "MIT" ]
1
2017-08-31T02:35:55.000Z
2017-08-31T02:35:55.000Z
package main func (p Panel) Count(col string) float64 { return Count(p, col) } func Count(p Panel, col string) float64 { return float64(len(p[col])) }
15.5
42
0.696774
bcaf83bac70e7e1aebe25e64201ec768dc5cb59f
694
dart
Dart
lib/repositories/question_repository.dart
concise-ee/superagile_app
05279f0c487cbec3c1dd01818dbb857a9a452829
[ "MIT" ]
null
null
null
lib/repositories/question_repository.dart
concise-ee/superagile_app
05279f0c487cbec3c1dd01818dbb857a9a452829
[ "MIT" ]
154
2020-09-23T09:42:24.000Z
2021-06-14T12:46:59.000Z
lib/repositories/question_repository.dart
concise-ee/superagile_app
05279f0c487cbec3c1dd01818dbb857a9a452829
[ "MIT" ]
1
2021-01-21T13:45:59.000Z
2021-01-21T13:45:59.000Z
import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:superagile_app/entities/question_template.dart'; const QUESTIONS_COLLECTION = 'questions'; class QuestionRepository { final CollectionReference _repository = FirebaseFirestore.instance.collection(QUESTIONS_COLLECTION); Future<QuestionTemplate> findQuestionByNumber(questionNr) async { var snapshot = await _repository.doc(questionNr.toString()).get(); return QuestionTemplate.fromSnapshot(snapshot); } Future<List<QuestionTemplate>> getAllQuestionTemplates() async { var snapshot = await _repository.get(); return snapshot.docs.map((snap) => QuestionTemplate.fromSnapshot(snap)).toList(); } }
36.526316
102
0.788184
5c2f2692b5ac1ce4b9c579dda6305440ebea06d2
628
swift
Swift
Courier/Models/CourierResult.swift
thoughtbot/courier-ios
5994d9cc571c6e59b313cb524f24501052fd2141
[ "MIT" ]
6
2016-05-05T20:33:36.000Z
2017-01-02T17:04:51.000Z
Courier/Models/CourierResult.swift
thoughtbot/courier-ios
5994d9cc571c6e59b313cb524f24501052fd2141
[ "MIT" ]
9
2016-05-02T09:40:59.000Z
2016-10-24T14:23:18.000Z
Courier/Models/CourierResult.swift
thoughtbot/courier-ios
5994d9cc571c6e59b313cb524f24501052fd2141
[ "MIT" ]
3
2016-09-28T23:13:22.000Z
2021-01-07T11:18:54.000Z
import Foundation /** Represents the Result of communicating with the Courier API. */ public enum CourierResult { /** Communication with the Courier API was successful. */ case Success /** There was an error communicating with the Courier API. - parameter error: The error that occurred. */ case Error(CourierError) } /** */ public func == (lresult: CourierResult, rresult: CourierResult) -> Bool { switch (lresult, rresult) { case (.Success, .Success): return true case let (.Error(lhs), .Error(rhs)): return lhs == rhs case (_, _): return false } } extension CourierResult: Equatable {}
20.933333
73
0.683121
5d7dee5ed83b4f41fefa3668ba04b115b7df24d7
4,303
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_648.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_648.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_648.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r12 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_normal_ht+0x5ebd, %rsi and %r12, %r12 mov (%rsi), %rbp mfence lea addresses_D_ht+0x61bd, %rsi lea addresses_normal_ht+0x14b3d, %rdi add $38079, %rbx mov $52, %rcx rep movsw nop sub %r12, %r12 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r12 ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %r15 push %rax push %rdx push %rsi // Faulty Load lea addresses_UC+0x14ebd, %rdx nop nop nop nop xor $62673, %r11 mov (%rdx), %r14d lea oracles, %r11 and $0xff, %r14 shlq $12, %r14 mov (%r11,%r14,1), %r14 pop %rsi pop %rdx pop %rax pop %r15 pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 16, 'NT': True, 'type': 'addresses_UC', 'same': False, 'AVXalign': False, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'size': 8, 'NT': True, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 9}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 7}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 7}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
62.362319
2,999
0.663491
ccbf54f216f90c1af230185bc61dee0f4edbe6fe
1,134
asm
Assembly
dev/smartdrv/messages/usa/sdvxdtxt.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
dev/smartdrv/messages/usa/sdvxdtxt.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
dev/smartdrv/messages/usa/sdvxdtxt.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
PAGE 58,132 ;****************************************************************************** TITLE SDTEXT.ASM -- Text messages for SmartDrv VxD ;****************************************************************************** ; ; (C) Copyright MICROSOFT Corp., 1991 ; ; Title: SDTEXT.ASM -- Text messages for SmartDrv VxD ; ; Version: 1.00 ; ; Date: 22-Nov-1991 ; ; Author: RAL ; ;------------------------------------------------------------------------------ ; ; Change log: ; ; DATE REV DESCRIPTION ; ----------- --- ----------------------------------------------------------- ; 22-Nov-1991 RAL Text messages for SmartDrv VxD ; ;============================================================================== .386p .XLIST INCLUDE VMM.INC .LIST PUBLIC SDVxD_Error_Title_Msg PUBLIC SDVxD_Write_Error_Msg PUBLIC SDVxD_Write_Drive_Letter VxD_DATA_SEG SDVxD_Error_Title_Msg db "SERIOUS DISK ERROR", 0 SDVxD_Write_Error_Msg LABEL BYTE db 'A serious disk error has occurred while writing to drive ' SDVxD_Write_Drive_Letter db "?" db '. Continue will retry the operation.', 0 VxD_DATA_ENDS END
22.68
79
0.465608
ddbced4ce9e1ec1293430d4a4ad6408d94fed9a3
4,105
php
PHP
resources/views/page/scholarship/index.blade.php
xuanhanhnguyen/yBox
0a51bedece19ff70d0b36363aa4a66dca204ef5a
[ "MIT" ]
1
2020-01-05T04:56:01.000Z
2020-01-05T04:56:01.000Z
resources/views/page/scholarship/index.blade.php
xuanhanhnguyen/yBox
0a51bedece19ff70d0b36363aa4a66dca204ef5a
[ "MIT" ]
null
null
null
resources/views/page/scholarship/index.blade.php
xuanhanhnguyen/yBox
0a51bedece19ff70d0b36363aa4a66dca204ef5a
[ "MIT" ]
null
null
null
@extends('page.layout.content') @section('title','Học bổng') @section('style') <style> li.page-item.active span { height: 91% !important; } li.page-item.disabled span { height: 91% !important; } </style> @endSection @section('content') <main> <div class="main-section"> <div class="container"> <div class="main-section-data"> <div class="row"> <div class="col-lg-9"> <div class="main-ws-sec"> <div class="posts-section"> @if($posts->isEmpty()) <div class="alert warning">Không có kết quả nào</div> @endif @foreach($posts as $post) <div class="post-bar d-flex"> <div class="thubnail"> <a href="{{route('scholarship.detail',$post->id)}}"><img style="width: 310px; padding:5px 10px" src="{{asset('upload/scholarship/'.$post->image)}}" alt=""></a> </div> <div class="caption py-3 px-2"> <h2 style="margin-bottom: 10px;"><a style="font-size: 22px; color:black" href="{{route('scholarship.detail',$post->id)}}">{{$post->title}}</a></h2> <p style="font-size: 15px;margin-top:5px; margin-bottom: 15px;">{{$post->description}}</p> <img style="width:40px; height:40px; border-radius:50%;margin-right: 13px;" src="{{asset('upload/avatar/'.$post->user->avatar)}}" alt=""> <ul class="like-com"> <li>{{$post->user->full_name}}</li> <li> <a style="position:relative; top:-6px" href="javascript:void(0)"><i class="la la-heart"></i> {{$post->total_like}} </a> </li> <li><a href="javascript:void(0)" title="" class="com"><img src="images/com.png" alt="">{{$post->total_coment}} bình luận</a></li> <li><a href="javascript:void(0)" title="" class="com"><i class="fa fa-share-alt"></i> {{$post->total_share}} Chia sẻ</a></li> </ul> <div class="time float-right"><span style="color: #b2b2b2;font-size: 14px;">{{date('d/m/Y',strtotime($post->created_at))}}</span></div> </div> </div> <!--post-bar end--> @endforeach {{$posts->links()}} <!--process-comm end--> </div> <!--posts-section end--> </div> <!--main-ws-sec end--> </div> <div class="col-lg-3"> <div class="right-sidebar"> <div class="widget widget-about"> <img src="images/wd-logo.png" alt=""> <h3>Ybox.com.vn</h3> <span>Nơi tuyển dụng tốt nhất</span> <div class="sign_link"> <h3><a href="javascript:void(0)" title="">We are Pro</a></h3> </div> </div> <!--widget-about end--> <div class="widget widget-jobs"> <div class="jobs-list"> <div class="sd-title"> <h3>TOP BÀI ĐĂNG</h3> <i class="la la-ellipsis-v"></i> </div> @foreach($postTop as $post ) <div class="jobs-list"> <div class="job-info"> <div class="job-details"> <h3>{{$post->title}}</h3> <p>{!!$post->content!!}</p> </div> <div class="hr-rate"> <span>{{$post->user->full_name}}</span> </div> </div> <!--job-info end--> </div> @endforeach <!--job-info end--> </div> <!--jobs-list end--> </div> <!--widget-jobs end--> <!--widget-jobs end--> </div> <!--right-sidebar end--> </div> </div> </div><!-- main-section-data end--> </div> </div> </main> @endSection
38.364486
179
0.440926
6525b9fa24410fbd6e88a3ac0d7c4387bef24c34
1,354
py
Python
pretix_googlepaypasses/views.py
pc-coholic/pretix-googlepaypasses
1591ebf2b53294989ffca6ffcb185842196e034d
[ "Apache-2.0" ]
2
2018-11-02T11:32:21.000Z
2018-12-07T07:18:06.000Z
pretix_googlepaypasses/views.py
pc-coholic/pretix-googlepaypasses
1591ebf2b53294989ffca6ffcb185842196e034d
[ "Apache-2.0" ]
5
2018-10-30T19:49:56.000Z
2018-11-26T21:11:42.000Z
pretix_googlepaypasses/views.py
pc-coholic/pretix-googlepaypasses
1591ebf2b53294989ffca6ffcb185842196e034d
[ "Apache-2.0" ]
null
null
null
import json import logging from json import JSONDecodeError from django.http import ( HttpResponse, HttpResponseBadRequest, HttpResponseForbidden, ) from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST from pretix.base.models import Organizer from . import tasks logger = logging.getLogger(__name__) @csrf_exempt @require_POST def webhook(request, *args, **kwargs): # Google is not actually sending their documented UA m( # if request.META['HTTP_USER_AGENT'] != 'Google-Valuables': if request.META['HTTP_USER_AGENT'] != "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)": return HttpResponseForbidden() if request.META.get('CONTENT_TYPE') != 'application/json': return HttpResponseBadRequest() try: webhook_json = json.loads(request.body.decode('utf-8')) except JSONDecodeError: return False if all(k in webhook_json for k in ('signature', 'intermediateSigningKey', 'protocolVersion', 'signedMessage')): organizer = Organizer.objects.filter( slug=request.resolver_match.kwargs['organizer'], ).first() tasks.process_webhook.apply_async( args=(request.body.decode('utf-8'), organizer.settings.googlepaypasses_issuer_id) ) return HttpResponse()
31.488372
117
0.716396
777135a4e62e09bb38ac3800bc6edc11205b0614
97,353
html
HTML
trope_list/tropes/TheCartel.html
jwzimmer/tv-tropes
44442b66286eaf2738fc5d863d175d4577da97f4
[ "MIT" ]
1
2021-01-02T00:19:20.000Z
2021-01-02T00:19:20.000Z
trope_list/tropes/TheCartel.html
jwzimmer/tv-tropes
44442b66286eaf2738fc5d863d175d4577da97f4
[ "MIT" ]
6
2020-11-17T00:44:19.000Z
2021-01-22T18:56:28.000Z
trope_list/tropes/TheCartel.html
jwzimmer/tv-tropes
44442b66286eaf2738fc5d863d175d4577da97f4
[ "MIT" ]
5
2021-01-02T00:19:15.000Z
2021-08-05T16:02:08.000Z
<!DOCTYPE html> <html> <head lang="en"> <meta content="IE=edge" http-equiv="X-UA-Compatible"/> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> <title>The Cartel - TV Tropes</title> <meta content="The Mafia...BUT HISPANIC! In the underworld, there are several factions, usually based on location and ethnicity. The cartel is an umbrella term for many …" name="description"/> <link href="https://tvtropes.org/pmwiki/pmwiki.php/Main/TheCartel" rel="canonical"/> <link href="/img/icons/favicon.ico" rel="shortcut icon" type="image/x-icon"/> <meta content="summary_large_image" name="twitter:card"/> <meta content="@tvtropes" name="twitter:site"/> <meta content="@tvtropes" name="twitter:owner"/> <meta content="The Cartel - TV Tropes" name="twitter:title"/> <meta content="The Mafia...BUT HISPANIC! In the underworld, there are several factions, usually based on location and ethnicity. The cartel is an umbrella term for many …" name="twitter:description"/> <meta content="https://static.tvtropes.org/pmwiki/pub/images/cali_cartel_800x450.png" name="twitter:image:src"/> <meta content="TV Tropes" property="og:site_name"/> <meta content="en_US" property="og:locale"/> <meta content="https://www.facebook.com/tvtropes" property="article:publisher"/> <meta content="The Cartel - TV Tropes" property="og:title"/> <meta content="website" property="og:type"/> <meta content="https://tvtropes.org/pmwiki/pmwiki.php/Main/TheCartel" property="og:url"/> <meta content="https://static.tvtropes.org/pmwiki/pub/images/cali_cartel_800x450.png" property="og:image"/> <meta content="The Mafia...BUT HISPANIC! In the underworld, there are several factions, usually based on location and ethnicity. The cartel is an umbrella term for many mafia-like groups based in Latin America. In real life, these cartels are behind trafficking …" property="og:description"/> <link href="/img/icons/apple-icon-57x57.png" rel="apple-touch-icon" sizes="57x57" type="image/png"/> <link href="/img/icons/apple-icon-60x60.png" rel="apple-touch-icon" sizes="60x60" type="image/png"/> <link href="/img/icons/apple-icon-72x72.png" rel="apple-touch-icon" sizes="72x72" type="image/png"/> <link href="/img/icons/apple-icon-76x76.png" rel="apple-touch-icon" sizes="76x76" type="image/png"/> <link href="/img/icons/apple-icon-114x114.png" rel="apple-touch-icon" sizes="114x114" type="image/png"/> <link href="/img/icons/apple-icon-120x120.png" rel="apple-touch-icon" sizes="120x120" type="image/png"/> <link href="/img/icons/apple-icon-144x144.png" rel="apple-touch-icon" sizes="144x144" type="image/png"/> <link href="/img/icons/apple-icon-152x152.png" rel="apple-touch-icon" sizes="152x152" type="image/png"/> <link href="/img/icons/apple-icon-180x180.png" rel="apple-touch-icon" sizes="180x180" type="image/png"/> <link href="/img/icons/favicon-16x16.png" rel="icon" sizes="16x16" type="image/png"/> <link href="/img/icons/favicon-32x32.png" rel="icon" sizes="32x32" type="image/png"/> <link href="/img/icons/favicon-96x96.png" rel="icon" sizes="96x96" type="image/png"/> <link href="/img/icons/favicon-192x192.png" rel="icon" sizes="192x192" type="image/png"/> <meta content="width=device-width, initial-scale=1" id="viewport" name="viewport"/> <script> var propertag = {}; propertag.cmd = []; </script> <link href="/design/assets/bundle.css?rev=c58d8df02f09262390bbd03db7921fc35c6af306" rel="stylesheet"/> <script> function object(objectId) { if (document.getElementById && document.getElementById(objectId)) { return document.getElementById(objectId); } else if (document.all && document.all(objectId)) { return document.all(objectId); } else if (document.layers && document.layers[objectId]) { return document.layers[objectId]; } else { return false; } } // JAVASCRIPT COOKIES CODE: for getting and setting user viewing preferences var cookies = { create: function (name, value, days2expire, path) { var date = new Date(); date.setTime(date.getTime() + (days2expire * 24 * 60 * 60 * 1000)); var expires = date.toUTCString(); document.cookie = name + '=' + value + ';' + 'expires=' + expires + ';' + 'path=' + path + ';'; }, createWithExpire: function(name, value, expires, path) { document.cookie = name + '=' + value + ';' + 'expires=' + expires + ';' + 'path=' + path + ';'; }, read: function (name) { var cookie_value = "", current_cookie = "", name_expr = name + "=", all_cookies = document.cookie.split(';'), n = all_cookies.length; for (var i = 0; i < n; i++) { current_cookie = all_cookies[i].trim(); if (current_cookie.indexOf(name_expr) === 0) { cookie_value = current_cookie.substring(name_expr.length, current_cookie.length); break; } } return cookie_value; }, update: function (name, val) { this.create(name, val, 300, "/"); }, remove: function (name) { document.cookie = name + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"; } }; function updateUserPrefs() { //GENERAL: detect and set browser, if not cookied (will be treated like a user-preference and added to the #user-pref element) if( !cookies.read('user-browser') ){ var broswer = ''; if(navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) ){ browser = 'iOS'; } else if (/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent)) { browser = 'opera'; } else if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { browser = 'MSIE'; } else if (/Navigator[\/\s](\d+\.\d+)/.test(navigator.userAgent)) { browser = 'netscape'; } else if (/Chrome[\/\s](\d+\.\d+)/.test(navigator.userAgent)) { browser = 'chrome'; } else if (/Safari[\/\s](\d+\.\d+)/.test(navigator.userAgent)) { browser = 'safari'; /Version[\/\s](\d+\.\d+)/.test(navigator.userAgent); browserVersion = new Number(RegExp.$1); } else if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) { browser = 'firefox'; } else { browser = 'internet_explorer'; } cookies.create('user-browser',browser,1,'/'); document.getElementById('user-prefs').classList.add('browser-' + browser); } else { document.getElementById('user-prefs').classList.add('browser-' + cookies.read('user-browser')); } //update user preference settings if (cookies.read('wide-load') !== '') document.getElementById('user-prefs').classList.add('wide-load'); if (cookies.read('night-vision') !== '') document.getElementById('user-prefs').classList.add('night-vision'); if (cookies.read('sticky-header') !== '') document.getElementById('user-prefs').classList.add('sticky-header'); if (cookies.read('show-spoilers') !== '') document.getElementById('user-prefs').classList.add('show-spoilers'); if (cookies.read('folders-open') !== '') document.getElementById('user-prefs').classList.add('folders-open'); if (cookies.read('lefthand-sidebar') !== '') document.getElementById('user-prefs').classList.add('lefthand-sidebar'); if (cookies.read('highlight-links') !== '') document.getElementById('user-prefs').classList.add('highlight-links'); if (cookies.read('forum-gingerbread') !== '') document.getElementById('user-prefs').classList.add('forum-gingerbread'); if (cookies.read('shared-avatars') !== '') document.getElementById('user-prefs').classList.add('shared-avatars'); if (cookies.read('new-search') !== '') document.getElementById('user-prefs').classList.add('new-search'); if (cookies.read('stop-auto-play-video') !== '') document.getElementById('user-prefs').classList.add('stop-auto-play-video'); //desktop view on mobile if (cookies.read('desktop-on-mobile') !== ''){ document.getElementById('user-prefs').classList.add('desktop-on-mobile'); var viewport = document.querySelector("meta[name=viewport]"); viewport.setAttribute('content', 'width=1000'); } } function updateDesktopPrefs() { if (cookies.read('wide-load') !== '') document.getElementById('sidebar-toggle-wideload').classList.add('active'); if (cookies.read('night-vision') !== '') document.getElementById('sidebar-toggle-nightvision').classList.add('active'); if (cookies.read('sticky-header') !== '') document.getElementById('sidebar-toggle-stickyheader').classList.add('active'); if (cookies.read('show-spoilers') !== '') document.getElementById('sidebar-toggle-showspoilers').classList.add('active'); } function updateMobilePrefs() { if (cookies.read('show-spoilers') !== '') document.getElementById('mobile-toggle-showspoilers').classList.add('active'); if (cookies.read('night-vision') !== '') document.getElementById('mobile-toggle-nightvision').classList.add('active'); if (cookies.read('sticky-header') !== '') document.getElementById('mobile-toggle-stickyheader').classList.add('active'); if (cookies.read('highlight-links') !== '') document.getElementById('mobile-toggle-highlightlinks').classList.add('active'); } if (document.cookie.indexOf("scroll0=") < 0) { // do nothing } else { console.log('ads removed by scroll.com'); var adsRemovedWith = 'scroll'; var style = document.createElement('style'); style.innerHTML = '#header-ad, .proper-ad-unit, .square_ad, .sb-ad-unit { display: none !important; } '; document.head.appendChild(style); } </script> <script type="text/javascript"> var tvtropes_config = { astri_stream_enabled : "", is_logged_in : "", handle : "", get_astri_stream : "", revnum : "c58d8df02f09262390bbd03db7921fc35c6af306", img_domain : "https://static.tvtropes.org", adblock : "1", adblock_url : "propermessage.io", pause_editing : "0", pause_editing_msg : "", pause_site_changes : "" }; </script> <script type="text/javascript"> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-3821842-1', 'auto'); ga('send', 'pageview'); </script> </head> <body class=""> <i id="user-prefs"></i> <script>updateUserPrefs();</script> <div id="fb-root"></div> <div id="modal-box"></div> <header class="headroom-element" id="main-header-bar"> <div id="main-header-bar-inner"> <span class="header-spacer" id="header-spacer-left"></span> <a class="mobile-menu-toggle-button tablet-on" href="#mobile-menu" id="main-mobile-toggle"><span></span><span></span><span></span></a> <a class="no-dev" href="/" id="main-header-logoButton"></a> <span class="header-spacer" id="header-spacer-right"></span> <nav class="tablet-off" id="main-header-nav"> <a href="/pmwiki/pmwiki.php/Main/Tropes">Tropes</a> <a href="/pmwiki/pmwiki.php/Main/Media">Media</a> <a class="nav-browse" href="/pmwiki/browse.php">Browse</a> <a href="/pmwiki/index_report.php">Indexes</a> <a href="/pmwiki/topics.php">Forums</a> <a class="nav-browse" href="/pmwiki/recent_videos.php">Videos</a> </nav> <div id="main-header-bar-right"> <div class="font-xs mobile-off" id="signup-login-box"> <a class="hover-underline bold" data-modal-target="signup" href="/pmwiki/login.php">Join</a> <a class="hover-underline bold" data-modal-target="login" href="/pmwiki/login.php">Login</a> </div> <div class="mobile-on inline" id="signup-login-mobileToggle"> <a data-modal-target="login" href="/pmwiki/login.php"><i class="fa fa-user"></i></a> </div> <div id="search-box"> <form action="/pmwiki/search_result.php" class="search"> <input class="search-box" name="q" placeholder="Search" required="" type="text" value=""/> <input class="submit-button" type="submit" value=""/> <input name="search_type" type="hidden" value="article"/> <input name="page_type" type="hidden" value="all"/> <input name="cx" type="hidden" value="partner-pub-6610802604051523:amzitfn8e7v"/> <input name="cof" type="hidden" value="FORID:10"/> <input name="ie" type="hidden" value="ISO-8859-1"/> <input name="siteurl" type="hidden" value=""/> <input name="ref" type="hidden" value=""/> <input name="ss" type="hidden" value=""/> </form> <a class="mobile-on mobile-search-toggle close-x" href="#close-search"><i class="fa fa-close"></i></a> </div> <div id="random-box"> <a class="button-random-trope" href="/pmwiki/pmwiki.php/Main/InterruptedIntimacy" onclick="ga('send', 'event', 'button', 'click', 'random trope');" rel="nofollow"></a> <a class="button-random-media" href="/pmwiki/pmwiki.php/Film/TheGreatestShowOnEarth" onclick="ga('send', 'event', 'button', 'click', 'random media');" rel="nofollow"></a> </div> </div> </div> <div class="tablet-on" id="mobile-menu"><div class="mobile-menu-options"> <div class="nav-wrapper"> <a class="xl" href="/pmwiki/pmwiki.php/Main/Tropes">Tropes</a> <a class="xl" href="/pmwiki/pmwiki.php/Main/Media">Media</a> <a class="xl" href="/pmwiki/browse.php">Browse</a> <a class="xl" href="/pmwiki/index_report.php">Indexes</a> <a class="xl" href="/pmwiki/topics.php">Forums</a> <a class="xl" href="/pmwiki/recent_videos.php">Videos</a> <a href="/pmwiki/query.php?type=att">Ask The Tropers</a> <a href="/pmwiki/query.php?type=tf">Trope Finder</a> <a href="/pmwiki/query.php?type=ykts">You Know That Show...</a> <a href="/pmwiki/tlp_activity.php">Trope Launch Pad</a> <a data-click-toggle="active" href="#tools">Tools <i class="fa fa-chevron-down"></i></a> <div class="tools-dropdown mobile-dropdown-linkList"> <a href="/pmwiki/cutlist.php">Cut List</a> <a href="/pmwiki/changes.php">New Edits</a> <a href="/pmwiki/recent_edit_reasons.php">Edit Reasons</a> <a href="/pmwiki/launches.php">Launches</a> <a href="/pmwiki/img_list.php">Images List</a> <a href="/pmwiki/crown_activity.php">Crowner Activity</a> <a href="/pmwiki/no_types.php">Un-typed Pages</a> <a href="/pmwiki/page_type_audit.php">Recent Page Type Changes</a> </div> <a data-click-toggle="active" href="#hq">Tropes HQ <i class="fa fa-chevron-down"></i></a> <div class="tools-dropdown mobile-dropdown-linkList"> <a href="/pmwiki/about.php">About Us</a> <a href="/pmwiki/contact.php">Contact Us</a> <a href="mailto:advertising@proper.io">Advertise</a> <a href="/pmwiki/dmca.php">DMCA Notice</a> <a href="/pmwiki/privacypolicy.php">Privacy Policy</a> </div> <a href="/pmwiki/ad-free-subscribe.php">Go Ad-Free</a> <div class="toggle-switches"> <ul class="mobile-menu display-toggles"> <li>Show Spoilers <div class="display-toggle show-spoilers" id="mobile-toggle-showspoilers"></div></li> <li>Night Vision <div class="display-toggle night-vision" id="mobile-toggle-nightvision"></div></li> <li>Sticky Header <div class="display-toggle sticky-header" id="mobile-toggle-stickyheader"></div></li> <li>Highlight Links <div class="display-toggle highlight-links" id="mobile-toggle-highlightlinks"></div></li> </ul> <script>updateMobilePrefs();</script> </div> </div> </div> </div> </header> <div class="mobile-on" id="homepage-introBox-mobile"> <a href="/"><img class="logo-small" src="/images/logo-white-big.png"/></a> <form action="/pmwiki/search_result.php" class="search" style="margin:10px -5px -6px -5px;"> <input class="search-box" name="q" placeholder="Search" required="" type="text" value=""/> <input class="submit-button" type="submit" value=""/> <input name="search_type" type="hidden" value="article"/> <input name="page_type" type="hidden" value="all"/> <input name="cx" type="hidden" value="partner-pub-6610802604051523:amzitfn8e7v"/> <input name="cof" type="hidden" value="FORID:10"/> <input name="ie" type="hidden" value="ISO-8859-1"/> <input name="siteurl" type="hidden" value=""/> <input name="ref" type="hidden" value=""/> <input name="ss" type="hidden" value=""/> </form> </div> <div class="ad" id="header-ad-wrapper"> <div id="header-ad"> <div class="ad-size-970x90 atf_banner"> <div class="proper-ad-unit"> <div id="proper-ad-tvtropes_ad_1"> <script>propertag.cmd.push(function() { proper_display('tvtropes_ad_1'); });</script> </div> </div> </div> </div> </div> <div id="main-container"> <div class="action-bar mobile-off" id="action-bar-top"> <div class="action-bar-right"> <p>Follow TV Tropes</p> <a class="button-fb" href="https://www.facebook.com/TVTropes"> <i class="fa fa-facebook"></i></a> <a class="button-tw" href="https://www.twitter.com/TVTropes"> <i class="fa fa-twitter"></i></a> <a class="button-re" href="https://www.reddit.com/r/TVTropes"> <i class="fa fa-reddit-alien"></i></a> </div> <nav class="actions-wrapper" itemscope="" itemtype="http://schema.org/SiteNavigationElement"> <ul class="page-actions" id="top_main_list"> <li class="link-edit"> <a class="article-edit-button" data-modal-target="login" href="/pmwiki/pmwiki.php/Main/TheCartel?action=edit" rel="nofollow"> <i class="fa fa-pencil"></i> Edit Page</a></li><li class="link-related"><a href="/pmwiki/relatedsearch.php?term=Main/TheCartel"> <i class="fa fa-share-alt"></i> Related</a></li><li class="link-history"><a href="/pmwiki/article_history.php?article=Main.TheCartel"> <i class="fa fa-history"></i> History</a></li><li class="link-discussion"><a href="/pmwiki/remarks.php?trope=Main.TheCartel"> <i class="fa fa-comment"></i> Discussion</a></li> </ul> <button class="nav__dropdown-toggle" id="top_more_button" onclick="toggle_more_menu('top');" type="button">More</button> <ul class="more_menu hidden_more_list" id="top_more_list"> <li class="link-todo tuck-always more_list_item"><a data-modal-target="login" href="#todo"><i class="fa fa-check-circle"></i> To Do</a></li><li class="link-pageSource tuck-always more_list_item"><a data-modal-target="login" href="/pmwiki/pmwiki.php/Main/TheCartel?action=source" rel="nofollow" target="_blank"><i class="fa fa-code"></i> Page Source</a></li> </ul> </nav> <div class="WikiWordModalStub"></div> <div class="ImgUploadModalStub" data-page-type="Article"></div> <div class="login-alert" style="display: none;"> You need to <a href="/pmwiki/login.php" style="color:#21A0E8">login</a> to do this. <a href="/pmwiki/login.php?tab=register_account" style="color:#21A0E8">Get Known</a> if you don't have an account </div> </div> <div class="page-Article" id="main-content"> <article class="with-sidebar" id="main-entry"> <input id="groupname-hidden" type="hidden" value="Main"/> <input id="title-hidden" type="hidden" value="TheCartel"/> <input id="article_id" type="hidden" value="27111"/> <input id="logged_in" type="hidden" value="false"/> <p class="hidden" id="current_url">http://tvtropes.org/pmwiki/pmwiki.php/Main/TheCartel</p> <meta content="" itemprop="datePublished"/> <meta content="" itemprop="articleSection"/> <meta content="" itemprop="image"/> <a class="watch-button" data-modal-target="login" href="#watch">Follow<span>ing</span></a> <h1 class="entry-title" itemprop="headline"> The Cartel </h1> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [{ "@type": "ListItem", "position": 1, "name": "tvtropes.org", "item": "https://tvtropes.org" },{ "@type": "ListItem", "position": 2, "name": "Tropes", "item": "https://tvtropes.org/pmwiki/pmwiki.php/Main/Tropes" },{ "@type": "ListItem", "position": 3, "name": "The Cartel" }] } </script> <a class="mobile-actionbar-toggle mobile-on" data-click-toggle="active" href="#mobile-actions-toggle" id="mobile-actionbar-toggle"> <p class="tiny-off">Go To</p><span></span><span></span><span></span><i class="fa fa-pencil"></i></a> <nav class="mobile-actions-wrapper mobile-on" id="mobile-actions-bar"></nav> <div class="modal fade hidden-until-active" id="editLockModal"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button aria-label="Close" class="close" data-dismiss="modal" type="button"> <span aria-hidden="true">×</span></button> <h4 class="modal-title">Edit Locked</h4> </div> <div class="modal-body"> <div class="row"> <div class="body"> <div class="danger troper_locked_message"></div> </div> </div> </div> </div> </div> </div> <nav class="body-options" itemscope="" itemtype="http://schema.org/SiteNavigationElement"> <ul class="subpage-links"> <li> <a class="subpage-link curr-subpage" href="/pmwiki/pmwiki.php/Main/TheCartel" title="The Main page"> <span class="wrapper"><span class="spi main-page"></span>Main</span></a> </li> <li> <a class="subpage-link" href="/pmwiki/pmwiki.php/Laconic/TheCartel" title="The Laconic page"> <span class="wrapper"><span class="spi laconic-icon"></span>Laconic</span></a> </li> <li> <a class="subpage-link" href="/pmwiki/pmwiki.php/Literature/TheCartel" title="The Literature page"> <span class="wrapper"><span class="spi literature"></span>Literature</span></a> </li> <li class="create-subpage dropdown"> <a aria-expanded="false" class="dropdown-toggle" data-toggle="dropdown" href="javascript:void(0);" role="button"> <span class="wrapper">Create New <i class="fa fa-plus-circle"></i></span> </a> <select onchange="this.options[this.selectedIndex].value &amp;&amp; (window.location = this.options[this.selectedIndex].value);"> <option value="">- Create New -</option> <option value="/pmwiki/pmwiki.php/Analysis/TheCartel?action=edit">Analysis</option> <option value="/pmwiki/pmwiki.php/Characters/TheCartel?action=edit">Characters</option> <option value="/pmwiki/pmwiki.php/FanficRecs/TheCartel?action=edit">FanficRecs</option> <option value="/pmwiki/pmwiki.php/FanWorks/TheCartel?action=edit">FanWorks</option> <option value="/pmwiki/pmwiki.php/Fridge/TheCartel?action=edit">Fridge</option> <option value="/pmwiki/pmwiki.php/Haiku/TheCartel?action=edit">Haiku</option> <option value="/pmwiki/pmwiki.php/Headscratchers/TheCartel?action=edit">Headscratchers</option> <option value="/pmwiki/pmwiki.php/ImageLinks/TheCartel?action=edit">ImageLinks</option> <option value="/pmwiki/pmwiki.php/PlayingWith/TheCartel?action=edit">PlayingWith</option> <option value="/pmwiki/pmwiki.php/Quotes/TheCartel?action=edit">Quotes</option> <option value="/pmwiki/pmwiki.php/Recap/TheCartel?action=edit">Recap</option> <option value="/pmwiki/pmwiki.php/ReferencedBy/TheCartel?action=edit">ReferencedBy</option> <option value="/pmwiki/pmwiki.php/Synopsis/TheCartel?action=edit">Synopsis</option> <option value="/pmwiki/pmwiki.php/Timeline/TheCartel?action=edit">Timeline</option> <option value="/pmwiki/pmwiki.php/Trivia/TheCartel?action=edit">Trivia</option> <option value="/pmwiki/pmwiki.php/WMG/TheCartel?action=edit">WMG</option> <option value="/pmwiki/pmwiki.php/YMMV/TheCartel?action=edit">YMMV</option> </select> </li> </ul> </nav> <div class="article-content retro-folders" id="main-article"> <p> </p><div class="quoteright" style="width:350px;"><a class="twikilink" href="/pmwiki/pmwiki.php/Series/Narcos" title="/pmwiki/pmwiki.php/Series/Narcos"><div class="lazy_load_img_box" style="padding-top:79.37%"><img alt="https://static.tvtropes.org/pmwiki/pub/images/cali_cartel_800x450.png" border="0" class="embeddedimage" height="277" src="https://static.tvtropes.org/pmwiki/pub/images/cali_cartel_800x450.png" width="349"/></div></a></div> <div class="acaptionright" style="width:350px;">The Gentlemen of Cali.</div> <p></p><div class="indent"><em>"I only tell you this one time. Don't fuck me, Tony. Don't you</em> ever <em>try to fuck me."</em> <div class="indent">— <strong>Alejandro Sosa</strong>, <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/Scarface1983" title="/pmwiki/pmwiki.php/Film/Scarface1983">Scarface</a></em> </div></div><div class="proper-ad-unit mobile-ad square_ad"><h6 class="ad-caption">Advertisement:</h6><div id="proper-ad-tvtropes_mobile_ad_1"><script>propertag.cmd.push(function() { proper_display('tvtropes_mobile_ad_1'); })</script></div></div><p>The Mafia...<a class="twikilink" href="/pmwiki/pmwiki.php/Main/RecycledInSpace" title="/pmwiki/pmwiki.php/Main/RecycledInSpace">BUT HISPANIC!</a> In the underworld, there are several factions, <a class="twikilink" href="/pmwiki/pmwiki.php/Main/MetroSpecificUnderworld" title="/pmwiki/pmwiki.php/Main/MetroSpecificUnderworld">usually based on location and ethnicity</a>. The cartel is an umbrella term for many mafia-like groups based in Latin America. In real life, these cartels are behind trafficking cocaine, and occasionally arming and supporting various armed groups, <a class="twikilink" href="/pmwiki/pmwiki.php/Main/WarForFunAndProfit" title="/pmwiki/pmwiki.php/Main/WarForFunAndProfit">both</a> <a class="twikilink" href="/pmwiki/pmwiki.php/Main/LaResistance" title="/pmwiki/pmwiki.php/Main/LaResistance">revolutionaries</a> and <a class="twikilink" href="/pmwiki/pmwiki.php/Main/BlackShirt" title="/pmwiki/pmwiki.php/Main/BlackShirt">counter-revolutionaries</a>. Cocaine supplied to the US is refined to Crack and sold by <a class="twikilink" href="/pmwiki/pmwiki.php/Main/GangBangers" title="/pmwiki/pmwiki.php/Main/GangBangers">Gang Bangers</a>. </p><p>One of the most infamous cartels was the Medellin cartel, and its leader <a class="urllink" href="https://static.tvtropes.org/pmwiki/pub/images/the_cartel2_884.jpg">Pablo Escobar,<img height="12" src="https://static.tvtropes.org/pmwiki/pub/external_link.gif" style="border:none;" width="12"/></a><small>◊</small> who ran most of the cocaine trade in the Americas during the 80's and 90's, until he was taken down by the Colombian Search Bloc with the assistance of the United States. Escobar's power and reach was so big during his heyday that he was (and still is) referred to as the "world's greatest outlaw." Additionally, the financial magazine <em>Forbes</em> described him as the <a class="urllink" href="https://www.forbes.com/sites/halahtouryalai/2015/09/15/watching-netflixs-narcos-heres-pablo-escobar-in-forbes-first-ever-billionaire-issue-in-1987/#1ea33a5b4369">"world's richest criminal."<img height="12" src="https://static.tvtropes.org/pmwiki/pub/external_link.gif" style="border:none;" width="12"/></a> Even today, when most people think of Colombia, they think "Cocaine Land" (or should we say, ''País de la Cocaína?" Because "cocaína" is a really common word when discussing these people). </p><div class="proper-ad-unit mobile-ad square_ad"><h6 class="ad-caption">Advertisement:</h6><div id="proper-ad-tvtropes_mobile_ad_2"><script>propertag.cmd.push(function() { proper_display('tvtropes_mobile_ad_2'); })</script></div></div><p>The cartel was a popular villain in fiction during the 80's and the 90's, when the drug trade made the headlines big time. With all the recent news about the Mexican cartels' graphic executions (mostly the Zetas), expect to see these guys as popular antagonists in the near future. </p><p>For their adversaries and affiliates, see <a class="twikilink" href="/pmwiki/pmwiki.php/Main/TheMafia" title="/pmwiki/pmwiki.php/Main/TheMafia">The Mafia</a>, <a class="twikilink" href="/pmwiki/pmwiki.php/Main/TheMafiya" title="/pmwiki/pmwiki.php/Main/TheMafiya">The Mafiya</a>, <a class="twikilink" href="/pmwiki/pmwiki.php/Main/KosherNostra" title="/pmwiki/pmwiki.php/Main/KosherNostra">Kosher Nostra</a>, <a class="twikilink" href="/pmwiki/pmwiki.php/Main/Yakuza" title="/pmwiki/pmwiki.php/Main/Yakuza">Yakuza</a>, <a class="twikilink" href="/pmwiki/pmwiki.php/Main/TheTriadsAndTheTongs" title="/pmwiki/pmwiki.php/Main/TheTriadsAndTheTongs">The Triads and the Tongs</a>, and <a class="twikilink" href="/pmwiki/pmwiki.php/Main/GangBangers" title="/pmwiki/pmwiki.php/Main/GangBangers">Gang Bangers</a>. See also <a class="twikilink" href="/pmwiki/pmwiki.php/Main/TheSyndicate" title="/pmwiki/pmwiki.php/Main/TheSyndicate">The Syndicate</a>. Usually the <a class="twikilink" href="/pmwiki/pmwiki.php/Main/RuthlessForeignGangsters" title="/pmwiki/pmwiki.php/Main/RuthlessForeignGangsters">Ruthless Foreign Gangsters</a> in works set during the 80's, and occasionally engaged in a <a class="twikilink" href="/pmwiki/pmwiki.php/Main/MobWar" title="/pmwiki/pmwiki.php/Main/MobWar">Mob War</a> with another organized crime group. </p><p>Not to be confused with literal cartels in the sense of small groups of <a class="twikilink" href="/pmwiki/pmwiki.php/Main/MegaCorp" title="/pmwiki/pmwiki.php/Main/MegaCorp">large companies</a> <a class="twikilink" href="/pmwiki/pmwiki.php/Main/CorruptCorporateExecutive" title="/pmwiki/pmwiki.php/Main/CorruptCorporateExecutive">conspiring to manipulate the market</a>, though that's the source for their name, since each group tries to corner the drug market by violence. </p><div class="proper-ad-unit mobile-ad square_ad"><h6 class="ad-caption">Advertisement:</h6><div id="proper-ad-tvtropes_mobile_ad_3"><script>propertag.cmd.push(function() { proper_display('tvtropes_mobile_ad_3'); })</script></div></div><p></p><hr/><h2>Examples:</h2> <div class="folderlabel" onclick="toggleAllFolders();">    open/close all folders  </div> <p></p><div class="folderlabel" onclick="togglefolder('folder0');">    Anime and Manga </div><div class="folder" id="folder0" isfolder="true" style="display:block;"> <ul><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Manga/BlackLagoon" title="/pmwiki/pmwiki.php/Manga/BlackLagoon">Black Lagoon</a></em> has a Colombian drug cartel as one of the <a class="twikilink" href="/pmwiki/pmwiki.php/Main/FourIsDeath" title="/pmwiki/pmwiki.php/Main/FourIsDeath">four</a> criminal organisations in Roanapur, who were the focus of one <a class="twikilink" href="/pmwiki/pmwiki.php/Main/StoryArc" title="/pmwiki/pmwiki.php/Main/StoryArc">Story Arc</a>. Just to give you an idea of how insanely dangerous <a class="twikilink" href="/pmwiki/pmwiki.php/Main/WretchedHive" title="/pmwiki/pmwiki.php/Main/WretchedHive">Roanapur</a> is, they are depicted as the <em>least threatening</em> faction (even the Italians are more ruthless). <ul><li> Although it has to be noted that the most dangerous individual in this universe also works for a Cartel - but this Cartel is benign compared to everyone else, <a class="twikilink" href="/pmwiki/pmwiki.php/Main/BerserkButton" title="/pmwiki/pmwiki.php/Main/BerserkButton">as long as you do not threaten its heir</a>. </li></ul></li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Manga/Teekyuu" title="/pmwiki/pmwiki.php/Manga/Teekyuu">Teekyuu</a></em> has a festival hosted by the "Mexican mafia". Said "mafia" ends up having a shootout with the local <em><a class="twikilink" href="/pmwiki/pmwiki.php/Main/Yakuza" title="/pmwiki/pmwiki.php/Main/Yakuza">yakuza</a></em> after a fireworks show. </li></ul></div> <p></p><div class="folderlabel" onclick="togglefolder('folder1');">    Comicbooks </div><div class="folder" id="folder1" isfolder="true" style="display:block;"> <ul><li> While <a class="twikilink" href="/pmwiki/pmwiki.php/Comicbook/ThePunisher" title="/pmwiki/pmwiki.php/Comicbook/ThePunisher">The Punisher</a> was taking a <a class="twikilink" href="/pmwiki/pmwiki.php/Main/BusmansHoliday" title="/pmwiki/pmwiki.php/Main/BusmansHoliday">vacation</a> in the pages of <em>The Punisher War Journal</em>, he ran afoul of a Peruvian crime lord who became his prime target after an terror attack on a judge that left several innocent bystanders dead. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/ComicBook/TheKiller" title="/pmwiki/pmwiki.php/ComicBook/TheKiller">The Killer</a></em>: The protagonist's employers in several albums are members of a Colombian narco-cartel, who thinks he still owes them a favor after botching a previous hit in Paris (he did kill the intended target, but only after gunning down several other people). </li></ul></div> <p></p><div class="folderlabel" onclick="togglefolder('folder2');">    Fan Fiction </div><div class="folder" id="folder2" isfolder="true" style="display:block;"> <ul><li> In <em><a class="twikilink" href="/pmwiki/pmwiki.php/FanFic/WorldwarWarOfEquals" title="/pmwiki/pmwiki.php/FanFic/WorldwarWarOfEquals">Worldwar: War of Equals</a></em>, when The Race's Mexican invasion force reaches the city of Ciudad Juarez, every drug cartel in the city, including the infamous Juarez cartel, fight <em><a class="twikilink" href="/pmwiki/pmwiki.php/Main/EnemyMine" title="/pmwiki/pmwiki.php/Main/EnemyMine">alongside</a></em> the Mexican garrison in the city to combat the Race. </li><li> <em><a class="urllink" href="https://archiveofourown.org/works/14997911/chapters/34760702">The Horsewomen Of Las Vegas<img height="12" src="https://static.tvtropes.org/pmwiki/pub/external_link.gif" style="border:none;" width="12"/></a></em> has La Eme, led by <a class="createlink" href="/pmwiki/pmwiki.php/Wrestling/MilMascaras" title="/pmwiki/pmwiki.php/Wrestling/MilMascaras">Mil Mascaras</a>, and a smaller <a class="twikilink" href="/pmwiki/pmwiki.php/Main/GangBangers" title="/pmwiki/pmwiki.php/Main/GangBangers">Gang Bangers</a> group, the Latin American Exchange. </li></ul></div> <p></p><div class="folderlabel" onclick="togglefolder('folder3');">    Films </div><div class="folder" id="folder3" isfolder="true" style="display:block;"> <ul><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/Scarface1983" title="/pmwiki/pmwiki.php/Film/Scarface1983">Scarface (1983)</a></em> involves Cuban-born Miami drug lord Tony Montana participating in a cocaine trafficking operation run by the Bolivian mobster Alejandro Sosa. Eventually though Tony runs afoul of Sosa, which leads to Sosa sending out dozens of his henchmen to attack Tony's mansion in the film's ending. </li><li> The plot of <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/NoCountryForOldMen" title="/pmwiki/pmwiki.php/Film/NoCountryForOldMen">No Country for Old Men</a></em> is kicked off when Llelwyn Moss finds a bag of money next to several dead or dying cartel members in an apparent drug deal gone wrong. It's later revealed that they worked for real life drug kingpin Pablo Acosta's Juarez Cartel; Acosta then hires <a class="twikilink" href="/pmwiki/pmwiki.php/Main/ImplacableMan" title="/pmwiki/pmwiki.php/Main/ImplacableMan">Anton Chigurh</a> to kill Moss and get the money back. Chigurh kills his handler and later three other cartel members to take the prize himself, and it becomes a three-way hunt for the money. <span class="spoiler" title="you can set spoilers visible by default on your profile">Ultimately, cartel hitmen end up killing Moss off-screen (at the cost of two of their own dying in the process) while Chigurh escapes with most of the cash (though, given his injuries and the ongoing manhunt, he's probably not going to get far). While no one in this story gets a happy ending at all, the cartel gets particularly screwed over, having lost over a dozen members and millions of dollars during the events of the film.</span> </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/Blow" title="/pmwiki/pmwiki.php/Film/Blow">Blow</a></em> is about a white American dealer who deals with the cartels, including Pablo Escobar. </li><li> <a class="twikilink" href="/pmwiki/pmwiki.php/Creator/RobertRodriguez" title="/pmwiki/pmwiki.php/Creator/RobertRodriguez">Robert Rodriguez's</a> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/ElMariachi" title="/pmwiki/pmwiki.php/Film/ElMariachi">Mariachi</a></em> <a class="twikilink" href="/pmwiki/pmwiki.php/Film/Desperado" title="/pmwiki/pmwiki.php/Film/Desperado">tri</a><a class="twikilink" href="/pmwiki/pmwiki.php/Film/OnceUponATimeInMexico" title="/pmwiki/pmwiki.php/Film/OnceUponATimeInMexico">logy</a> pits the protagonist against the Cartels. </li><li> <a class="twikilink" href="/pmwiki/pmwiki.php/Film/TheProfessional" title="/pmwiki/pmwiki.php/Film/TheProfessional">The Professional's</a> first major job is taking out a cartel leader. </li><li> Franz Sanchez' cocaine business in <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/LicenceToKill" title="/pmwiki/pmwiki.php/Film/LicenceToKill">Licence to Kill</a></em> is described as an "invisible empire from Chile to Alaska". </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/XXx" title="/pmwiki/pmwiki.php/Film/XXx">xXx</a></em>: Xander and two other potential recruits for the CIA are flown to Colombia and dropped off in narco territory as a test to see which of them would be badass enough to survive. Just as they're about to become victims to a <a class="twikilink" href="/pmwiki/pmwiki.php/Main/TortureTechnician" title="/pmwiki/pmwiki.php/Main/TortureTechnician">Torture Technician</a>, the Colombian army swoops in to dismantle the farm. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/Traffic" title="/pmwiki/pmwiki.php/Film/Traffic">Traffic</a></em> features a Mexican cartel as the antagonist. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/ClearAndPresentDanger" title="/pmwiki/pmwiki.php/Film/ClearAndPresentDanger">Clear and Present Danger</a></em>, with Ernesto Escobedo. </li><li> In <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/ActOfValor" title="/pmwiki/pmwiki.php/Film/ActOfValor">Act of Valor</a></em>, the terrorist <a class="twikilink" href="/pmwiki/pmwiki.php/Main/BigBad" title="/pmwiki/pmwiki.php/Main/BigBad">Big Bad</a> is being aided by a Ukrainian crime lord who controls a drug-running cartel stretching from Central America to Mexico. The SEAL team first has to rescue a CIA agent being tortured by the cartel in Central America before tracking their operations across the globe and raiding the Ukranian leader's boat. The final battle is between the combined US Navy SEAL/Mexican SOF team and the cartel soldiers and terrorists, the former of whom are trying to smuggle the latter's suicide bombers into the United States. </li><li> In the 2000 remake <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/Bedazzled2000" title="/pmwiki/pmwiki.php/Film/Bedazzled2000">Bedazzled</a></em>, Elliot wishes to be "very very rich and very very powerful and married to Alison" (his crush). How does the Devil grant his wish? By making him a rich Colombian drug lord (a clear <a class="twikilink" href="/pmwiki/pmwiki.php/Main/Expy" title="/pmwiki/pmwiki.php/Main/Expy">Expy</a> of Escobar). Oh, and his wife is not only having an affair, she hates his guts. <a class="twikilink" href="/pmwiki/pmwiki.php/Main/LiteralGenie" title="/pmwiki/pmwiki.php/Main/LiteralGenie">Well, he never said she had to love him</a>. </li><li> Mexican drug cartels are among the antagonists in <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/Machete" title="/pmwiki/pmwiki.php/Film/Machete">Machete</a></em>. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/CodeOfSilence" title="/pmwiki/pmwiki.php/Film/CodeOfSilence">Code of Silence</a></em>: The Comachos are a Colombian drug syndicate involved in a <a class="twikilink" href="/pmwiki/pmwiki.php/Main/MobWar" title="/pmwiki/pmwiki.php/Main/MobWar">Mob War</a> with <a class="twikilink" href="/pmwiki/pmwiki.php/Main/TheMafia" title="/pmwiki/pmwiki.php/Main/TheMafia">The Mafia</a>. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/Sicario" title="/pmwiki/pmwiki.php/Film/Sicario">Sicario</a></em> is about an <a class="twikilink" href="/pmwiki/pmwiki.php/Main/FBIAgent" title="/pmwiki/pmwiki.php/Main/FBIAgent">FBI Agent</a> tagging along on a CIA operation to dismantle a Mexican cartel. She later discovers that <span class="spoiler" title="you can set spoilers visible by default on your profile">the mysterious Alejandro is actually working for the new Medellin cartel, which is backed by the US to stabilize the drug trade</span>. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/TripleFrontier" title="/pmwiki/pmwiki.php/Film/TripleFrontier">Triple Frontier</a></em>: Five friends, all US military veterans, gather to rob a Colombian cartel from several hundreds of millions of dollars worth of cash in the Amazon rainforest. </li><li> The 2004 film <em>Maria, Full of Grace</em> features an unspecified Colombian cartel, which provides the title character with money and papers to travel to New York—provided that she <a class="twikilink" href="/pmwiki/pmwiki.php/Main/TreasureChestCavity" title="/pmwiki/pmwiki.php/Main/TreasureChestCavity">takes a little something</a> with her on the flight. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/SalvationBoulevard" title="/pmwiki/pmwiki.php/Film/SalvationBoulevard">Salvation Boulevard</a></em>: Guzman is portrayed as a religious version of this, claiming that they're in Mexico, with the guards in his house walking around with automatic weapons and speaking Spanish. <span class="spoiler" title="you can set spoilers visible by default on your profile"> In actuality, they're in a quiet suburban neighborhood and Guzman is in construction.</span> </li><li> The Bisante Cartel in <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/FireBirds" title="/pmwiki/pmwiki.php/Film/FireBirds">Fire Birds</a></em> are a very militant drug cartel, complete with a pair of fighter jets and a mercenary pilot in an attack chopper. </li><li> These are the main antagonists of <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/CrocodileDundee" title="/pmwiki/pmwiki.php/Film/CrocodileDundee">Crocodile Dundee II</a></em>. </li><li> In <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/IronEagle" title="/pmwiki/pmwiki.php/Film/IronEagle">Aces: Iron Eagle III</a></em>, <a class="twikilink" href="/pmwiki/pmwiki.php/Main/ThoseWackyNazis" title="/pmwiki/pmwiki.php/Main/ThoseWackyNazis">Kleiss</a> runs a drug cartel in Peru. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/RamboLastBlood" title="/pmwiki/pmwiki.php/Film/RamboLastBlood">Rambo: Last Blood</a></em> has a powerful cartel led by a man named Don Miguel, whose stock in trade is not drugs but rather <a class="twikilink" href="/pmwiki/pmwiki.php/Main/HumanTrafficking" title="/pmwiki/pmwiki.php/Main/HumanTrafficking">Human Trafficking</a>, particularly selling off young women as <a class="twikilink" href="/pmwiki/pmwiki.php/Main/SexSlave" title="/pmwiki/pmwiki.php/Main/SexSlave">sex slaves</a>. </li></ul></div> <p></p><div class="folderlabel" onclick="togglefolder('folder4');">    Literature </div><div class="folder" id="folder4" isfolder="true" style="display:block;"> <ul><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Literature/TheBlackIce" title="/pmwiki/pmwiki.php/Literature/TheBlackIce">The Black Ice</a></em>: Humberto Zorillo is head of a Mexican drug-smuggling operation sending black ice into the United States. Bosch eventually discovers that both the Jimmy Kapps drug mule murder and the murder of the Mexican in the alleyway tie in to Zorillo's operation and Cal Moore's death. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Literature/ClearAndPresentDanger" title="/pmwiki/pmwiki.php/Literature/ClearAndPresentDanger">Clear and Present Danger</a></em> by <a class="twikilink" href="/pmwiki/pmwiki.php/Creator/TomClancy" title="/pmwiki/pmwiki.php/Creator/TomClancy">Tom Clancy</a> features the Medellin Cartel as the primary antagonists of the novel, in a conflict that escalates into something of an unofficial war between them and the United States. </li><li> <a class="twikilink" href="/pmwiki/pmwiki.php/Creator/RichardMorgan" title="/pmwiki/pmwiki.php/Creator/RichardMorgan">Richard Morgan's</a> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Literature/BlackMan" title="/pmwiki/pmwiki.php/Literature/BlackMan">Black Man</a></em> prominently features a cartel comprised of Quechua-speaking indigenous Andeans. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Literature/PavlovsDogs" title="/pmwiki/pmwiki.php/Literature/PavlovsDogs">Pavlov's Dogs</a></em> has one of these as one of the few bastions of civilization left <a class="twikilink" href="/pmwiki/pmwiki.php/Main/AfterTheEnd" title="/pmwiki/pmwiki.php/Main/AfterTheEnd">After the End</a>. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Literature/Victoria" title="/pmwiki/pmwiki.php/Literature/Victoria">Victoria</a></em> has a particularly horrible version, where the most extreme gangsters take over as warlords in post-apocalyptic Mexico and set up a cannibalistic <a class="twikilink" href="/pmwiki/pmwiki.php/Main/ReligionOfEvil" title="/pmwiki/pmwiki.php/Main/ReligionOfEvil">Religion of Evil</a> dedicated to the Aztec gods. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Literature/TheCartel" title="/pmwiki/pmwiki.php/Literature/TheCartel">The Cartel</a></em> focuses on the war against the cartels in Mexico. The main ones are: the Sinaloa Cartel, Los Zetas, La Familia Michoacana and the Juarez Cartel. </li><li> <em>The Power of The Dog</em> and its sequel <em>The Cartel</em>, both written by <a class="createlink" href="/pmwiki/pmwiki.php/Creator/DonWinslow" title="/pmwiki/pmwiki.php/Creator/DonWinslow">Don Winslow</a>, chart the growth of the Mexican drug trade from its infancy in the Sixties to the unbelievable carnage of the early-2000s. True crime fans will immediately notice that while all names and groups are fictional, almost all of them are either based on or inspired by actual criminals, cops, cartels, terrorist organizations, and events. Chief among the characters are <a class="twikilink" href="/pmwiki/pmwiki.php/Main/CowboyCop" title="/pmwiki/pmwiki.php/Main/CowboyCop">DEA Agent Arturo "Art" Keller</a> and his lifelong nemesis <a class="twikilink" href="/pmwiki/pmwiki.php/Main/TheDon" title="/pmwiki/pmwiki.php/Main/TheDon">Adan Barrera</a>. <ul><li> Winslow spent <a class="twikilink" href="/pmwiki/pmwiki.php/Main/ShownTheirWork" title="/pmwiki/pmwiki.php/Main/ShownTheirWork">six years</a> researching the Mexican underworld, on both sides of the border, to make the first novel as realistic as possible. </li></ul></li></ul></div> <p></p><div class="folderlabel" onclick="togglefolder('folder5');">    Live-Action TV </div><div class="folder" id="folder5" isfolder="true" style="display:block;"> <ul><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/BreakingBad" title="/pmwiki/pmwiki.php/Series/BreakingBad">Breaking Bad</a></em> and <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/BetterCallSaul" title="/pmwiki/pmwiki.php/Series/BetterCallSaul">Better Call Saul</a></em> features a fictionalized version of the Juarez cartel from Mexico, who act as the main antagonists for the first three seasons of the former show (and also play a significant role in the latter show). The New Mexico branch is initially headed by Tuco Salamanca; his cousins Leonel and Marco are <a class="twikilink" href="/pmwiki/pmwiki.php/Main/ProfessionalKillers" title="/pmwiki/pmwiki.php/Main/ProfessionalKillers">highly lethal enforcers</a> for the main operation; all three were raised by their uncle, Hector, <a class="twikilink" href="/pmwiki/pmwiki.php/Main/TheDragon" title="/pmwiki/pmwiki.php/Main/TheDragon">the longtime right-hand man</a> (until <a class="twikilink" href="/pmwiki/pmwiki.php/Main/RetiredMonster" title="/pmwiki/pmwiki.php/Main/RetiredMonster">a stroke rendered him mute and paralyzed</a>) of the head of the cartel, <a class="twikilink" href="/pmwiki/pmwiki.php/Main/GreaterScopeVillain" title="/pmwiki/pmwiki.php/Main/GreaterScopeVillain">Don</a> <a class="twikilink" href="/pmwiki/pmwiki.php/Main/FauxAffablyEvil" title="/pmwiki/pmwiki.php/Main/FauxAffablyEvil">Eladio</a>. Unlike most other fictional drug cartels, their primary business is crystal meth (at least in the series context; it's mentioned they deal in cocaine and heroin offscreen as well). Their relationship with Gus Fring (and therefore Walter White) is... complicated. In <em>Breaking Bad</em>, they aren't as prominent in the plot as other antagonists, especially later on, but it's repeatedly noted that they have by far the most resources of any criminal group featured in the show. While they're still around in Season 4 of the show, <span class="spoiler" title="you can set spoilers visible by default on your profile">Gus ends up supplanting them as a threat by fatally poisoning most of their leadership, which combined with a successful DEA crackdown, cripples their operations in New Mexico</span>. <em>Better Call Saul</em> gives them much more focus, with the other half of the show's plotline and tritagonist Ignacio "Nacho" Vargas allowing the audience to view more of the organization's inner workings. </li><li> The Cartel (usually either Colombian or Mexican) has made many appearances in various shows in the <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/LawAndOrder" title="/pmwiki/pmwiki.php/Series/LawAndOrder">Law &amp; Order</a></em> franchise, usually portrayed as being untouchable due to their ruthless and violent nature. Any episode showcasing the cartel has a high probability of ending with all witnesses either dead or too scared to testify (which is <a class="twikilink" href="/pmwiki/pmwiki.php/Main/TruthInTelevision" title="/pmwiki/pmwiki.php/Main/TruthInTelevision">Truth in Television</a>, as most papers in Mexico are too scared to publish any stories speaking negatively towards the Zetas; hence why Reporters Without Borders <a class="urllink" href="http://en.rsf.org/press-freedom-index-2013,1054.html">don't consider their press truly free, even though they legally have the right to print what they want<img height="12" src="https://static.tvtropes.org/pmwiki/pub/external_link.gif" style="border:none;" width="12"/></a>), thus allowing the <a class="twikilink" href="/pmwiki/pmwiki.php/Main/SmugSnake" title="/pmwiki/pmwiki.php/Main/SmugSnake">Smug Snake</a> defendant to walk free. In one instance, on the <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/LawAndOrderSpecialVictimsUnit" title="/pmwiki/pmwiki.php/Series/LawAndOrderSpecialVictimsUnit">Law &amp; Order: Special Victims Unit</a></em> episode "Loss", this resulted in the show's ADA being forced to fake her own death and <a class="twikilink" href="/pmwiki/pmwiki.php/Main/PutOnABus" title="/pmwiki/pmwiki.php/Main/PutOnABus">enter witness protection</a> to avoid a contract on her life. <ul><li> The second season finale of <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/LawAndOrder" title="/pmwiki/pmwiki.php/Series/LawAndOrder">Law &amp; Order</a></em> featured Colombian cartels on the rampage. Aside from the large number of people directly killed by the gangsters in order to silence them, Det. Cereta was shot by a scuzzy witness, ending his career on the beat. </li></ul></li><li> On <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/Caprica" title="/pmwiki/pmwiki.php/Series/Caprica">Caprica</a></em>, the Ha'la'tha is a bizarre merging of this with the more Italian-oriented <a class="twikilink" href="/pmwiki/pmwiki.php/Main/TheMafia" title="/pmwiki/pmwiki.php/Main/TheMafia">Mafia</a> as well as, of all things, <a class="twikilink" href="/pmwiki/pmwiki.php/Main/MundaneMadeAwesome" title="/pmwiki/pmwiki.php/Main/MundaneMadeAwesome">Ancient Greek culture</a>. </li><li> The characters in <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/Entourage" title="/pmwiki/pmwiki.php/Series/Entourage">Entourage</a></em> at one point work on a biopic of Pablo Escobar titled "Medellin". </li><li> Season 3 of <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/TwentyFour" title="/pmwiki/pmwiki.php/Series/TwentyFour">24</a></em> prominently featured one run by Ramon and Hector Salazar, <a class="twikilink" href="/pmwiki/pmwiki.php/Main/DiscOneFinalBoss" title="/pmwiki/pmwiki.php/Main/DiscOneFinalBoss">the main antagonists of the season's first half</a>. As well as the usual drug smuggling, they're trying to diversify by planning to obtain a deadly virus.. </li><li> The Cartel—of various ethnic flavors—shows up fairly frequently on <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/BurnNotice" title="/pmwiki/pmwiki.php/Series/BurnNotice">Burn Notice</a></em>, in various roles: sometimes as the enemy, sometimes as the <a class="twikilink" href="/pmwiki/pmwiki.php/Main/ManBehindTheMan" title="/pmwiki/pmwiki.php/Main/ManBehindTheMan">Man Behind the Man</a>, and sometimes as an unwitting ally. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/JAG" title="/pmwiki/pmwiki.php/Series/JAG">JAG</a></em>: In the second season episode "The Game of Go", a US Marine is captured by a drug baron in Colombia while on joint operation with the Colombian authorities. </li><li> The Cartel was regularly in the background in <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/MiamiVice" title="/pmwiki/pmwiki.php/Series/MiamiVice">Miami Vice</a></em>. </li><li> One of the subplots of <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/TheBridgeUS" title="/pmwiki/pmwiki.php/Series/TheBridgeUS">The Bridge (US)</a></em> involves a cartel operating out of Juarez and using a tunnel on the property of a recently-widowed woman to move their products into the United States. The second season reveals that <span class="spoiler" title="you can set spoilers visible by default on your profile"> the cartel is managed by the CIA to a certain extent, in order to control it</span> </li><li> The Cartel is involved in one of the major subplots of <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/KillerWomen" title="/pmwiki/pmwiki.php/Series/KillerWomen">Killer Women</a></em>. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/GangRelated" title="/pmwiki/pmwiki.php/Series/GangRelated">Gang Related</a></em> is about a cop who's actually <a class="twikilink" href="/pmwiki/pmwiki.php/Main/TheMole" title="/pmwiki/pmwiki.php/Main/TheMole">The Mole</a> for a Mexican mob. <a class="twikilink" href="/pmwiki/pmwiki.php/Main/GoodFeelsGood" title="/pmwiki/pmwiki.php/Main/GoodFeelsGood">He starts to enjoy being the good guy</a>, which causes problems when the police start investigating his gang. </li><li> A couple of episodes of <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/TheWestWing" title="/pmwiki/pmwiki.php/Series/TheWestWing">The West Wing</a></em> revolve around an international crisis triggered when a group of undercover D.E.A agents are exposed and held hostage by a cartel in Colombia who demand the release of their imprisoned leader (a thinly-veiled version of Pablo Escobar) as a ransom. President Bartlet instead orders a daring covert military operation to rescue them. <span class="spoiler" title="you can set spoilers visible by default on your profile"> Unfortunately the rescuers are led into a trap, several are killed, and the hostages moved to a location so remote and well-defended that the only military option would be to essentially launch a Vietnam-like war to defeat the cartels, leaving Bartlet no option but to negotiate the cartel leader's release via back channels.</span> </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/Narcos" title="/pmwiki/pmwiki.php/Series/Narcos">Narcos</a></em>: THE Cartel, in fact. The whole series is about the DEA's hunt for Pablo Escobar in <a class="twikilink" href="/pmwiki/pmwiki.php/UsefulNotes/TheEighties" title="/pmwiki/pmwiki.php/UsefulNotes/TheEighties">the '80s</a>, as well as his rise to power and eventual fall. And while Pablo and his Medellín Cartel take center stage, the rival Cali Cartel also shows up towards the end of the first season. After Escobar's ultimate demise, the Cali godfathers take center stage in season three. The show also provides a contrast between the two, with the Medellin cartel being run by rural gangsters and using terrorist tactics against the government and its drug rivals, while the Cali cartel rubs shoulders with the Colombian elites and prefers to keep its activities under wraps to prevent scrutiny from law enforcement agencies. </li><li> One of the recurring villains in <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/RoboCopTheSeries" title="/pmwiki/pmwiki.php/Series/RoboCopTheSeries">RoboCop: The Series</a></em> is South American crime boss Reggie Braga. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/SonsOfAnarchy" title="/pmwiki/pmwiki.php/Series/SonsOfAnarchy">Sons of Anarchy</a></em>: In season 4, Clay makes a deal with the Mexican Gallindo Cartel, ostensibly to sell them military-grade weaponry from their Northern Irish contacts, but a secret part of the agreement means that SAMCRO will transport their cocaine into northern California while the Mayans will distribute it. This causes an intra-club conflict since the Sons has traditionally been hard on drugs, but Jax chooses to support Clay for his own reasons. They also get involved in a major gang war when the rival Sonora Cartel shows up in the area. Additionally, the end of the season reveals that <span class="spoiler" title="you can set spoilers visible by default on your profile">the Gallindo Cartel is supported by the CIA to stabilize the drug trade</span>. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/TheGifted2017" title="/pmwiki/pmwiki.php/Series/TheGifted2017">The Gifted</a></em>: Marcos used his powers as a cartel enforcer for a time, before leaving to join the Mutant Underground. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/VeronicaMars" title="/pmwiki/pmwiki.php/Series/VeronicaMars">Veronica Mars</a></em>: A Mexican cartel plays a role in the plot of season 4, when a nephew-by-marriage of the boss is killed in an explosion in Neptune, California. At the behest of his nagging ex-wife, he sends two sicarios into Neptune to track down and kill the bomber. It's also shown that Weevil's gang and the PCH'ers have ties to this cartel. </li><li> The second season of <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/SEALTeam" title="/pmwiki/pmwiki.php/Series/SEALTeam">SEAL Team</a></em> features a 5-episode long story arc to hunt down a drug lord named Andreas Doza in Mexico, who runs one of the most powerful cartels in the country. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/Arachnicide" title="/pmwiki/pmwiki.php/Film/Arachnicide">Arachnicide</a></em>: The secondary antagonists are a worldwide drug ring using genetic engineering to maximize crops. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/Series/ZeroZeroZero" title="/pmwiki/pmwiki.php/Series/ZeroZeroZero">Zero Zero Zero</a></em>: One of the three storylines follows the Leyra brothers' cartel, obviously based on the Gulf Cartel, as they sell a $64 million shipment of cocaine to an Italian 'Ndrangheta clan. In the process of the deal, the Leyras are forced to recruit a group of corrupt Mexican Army commandos after the commandos' cover is blown. The commandos, eventually called Los Vampiros, are obviously based on Los Zetas. </li></ul></div> <p></p><div class="folderlabel" onclick="togglefolder('folder6');">    Music </div><div class="folder" id="folder6" isfolder="true" style="display:block;"> <ul><li> Rapper <a class="twikilink" href="/pmwiki/pmwiki.php/Music/Nas" title="/pmwiki/pmwiki.php/Music/Nas">Nas</a> once adopted the stage name "Nas Escobar" as a reference to the aforementioned Pablo. </li></ul></div> <p></p><div class="folderlabel" onclick="togglefolder('folder7');">     Tabletop Games </div><div class="folder" id="folder7" isfolder="true" style="display:block;"> <ul><li> In <em><a class="twikilink" href="/pmwiki/pmwiki.php/TabletopGame/Shadowrun" title="/pmwiki/pmwiki.php/TabletopGame/Shadowrun">Shadowrun</a></em>, the Latin-American ORO Corporation was at first a money laundering front for several cartels. However, after getting a few mining contracts that turned out to be way more valuable than anyone thought, the company outgrew its origins, reimagening itself as the <a class="twikilink" href="/pmwiki/pmwiki.php/Main/MegaCorp" title="/pmwiki/pmwiki.php/Main/MegaCorp">Mega-Corp</a> Aztechnology. </li></ul></div> <p></p><div class="folderlabel" onclick="togglefolder('folder8');">    Video Games </div><div class="folder" id="folder8" isfolder="true" style="display:block;"> <ul><li> One of the enemy factions in <em><a class="twikilink" href="/pmwiki/pmwiki.php/VideoGame/BatmanArkhamOrigins" title="/pmwiki/pmwiki.php/VideoGame/BatmanArkhamOrigins">Batman: Arkham Origins</a></em> are a criminal gang from <a class="twikilink" href="/pmwiki/pmwiki.php/Main/BananaRepublic" title="/pmwiki/pmwiki.php/Main/BananaRepublic">Santa Prisca</a>, led by the supervillain mob boss <a class="twikilink" href="/pmwiki/pmwiki.php/ComicBook/Bane" title="/pmwiki/pmwiki.php/ComicBook/Bane">Bane</a>. Most of Bane's henchmen are fellow escapees from the infamous Santa Priscan prison <a class="twikilink" href="/pmwiki/pmwiki.php/Main/HellholePrison" title="/pmwiki/pmwiki.php/Main/HellholePrison">Peña Duro</a>, and they are all <a class="twikilink" href="/pmwiki/pmwiki.php/Main/UndyingLoyalty" title="/pmwiki/pmwiki.php/Main/UndyingLoyalty">fanatically loyal</a> to their boss beyond what's normally expected of other gangsters. There's also Copperhead, a female <a class="twikilink" href="/pmwiki/pmwiki.php/Main/ProfessionalKiller" title="/pmwiki/pmwiki.php/Main/ProfessionalKiller">assassin</a> from an unspecified Central American country, though she has no affiliation or connection to Bane beyond both of them being hired by Gotham City kingpin Black Mask <span class="spoiler" title="you can set spoilers visible by default on your profile">(actually <a class="twikilink" href="/pmwiki/pmwiki.php/ComicBook/TheJoker" title="/pmwiki/pmwiki.php/ComicBook/TheJoker">The Joker</a> in disguise)</span> to fight and kill <a class="twikilink" href="/pmwiki/pmwiki.php/Franchise/Batman" title="/pmwiki/pmwiki.php/Franchise/Batman">Batman</a>. </li><li> One of the traditional factions in the <em><a class="twikilink" href="/pmwiki/pmwiki.php/VideoGame/GrandTheftAuto" title="/pmwiki/pmwiki.php/VideoGame/GrandTheftAuto">Grand Theft Auto</a></em> series since <em><a class="twikilink" href="/pmwiki/pmwiki.php/VideoGame/GrandTheftAutoIII" title="/pmwiki/pmwiki.php/VideoGame/GrandTheftAutoIII">Grand Theft Auto III</a></em>. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/VideoGame/CallOfJuarezTheCartel" title="/pmwiki/pmwiki.php/VideoGame/CallOfJuarezTheCartel">Call of Juarez: The Cartel</a></em>. Guess what it's about. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/VideoGame/Hitman" title="/pmwiki/pmwiki.php/VideoGame/Hitman">Hitman</a></em> features these as enemies at different points. One mission in <em><a class="twikilink" href="/pmwiki/pmwiki.php/VideoGame/HitmanCodename47" title="/pmwiki/pmwiki.php/VideoGame/HitmanCodename47">Hitman: Codename 47</a></em> is a <a class="twikilink" href="/pmwiki/pmwiki.php/Main/ShoutOut" title="/pmwiki/pmwiki.php/Main/ShoutOut">Shout-Out</a> to <em><a class="twikilink" href="/pmwiki/pmwiki.php/Film/Scarface1983" title="/pmwiki/pmwiki.php/Film/Scarface1983">Scarface (1983)</a></em>. <ul><li> The Delgado Cartel is a cocaine dealer based in Chile, responsible for various acts of terrorism. 47 is contracted to kill their leaders in <em><a class="twikilink" href="/pmwiki/pmwiki.php/VideoGame/HitmanBloodMoney" title="/pmwiki/pmwiki.php/VideoGame/HitmanBloodMoney">Hitman: Blood Money</a></em> and again in <em><a class="twikilink" href="/pmwiki/pmwiki.php/VideoGame/Hitman2" title="/pmwiki/pmwiki.php/VideoGame/Hitman2">HITMAN 2</a></em>. </li></ul></li><li> In <em><a class="twikilink" href="/pmwiki/pmwiki.php/VideoGame/ScarfaceTheWorldIsYours" title="/pmwiki/pmwiki.php/VideoGame/ScarfaceTheWorldIsYours">Scarface: The World Is Yours</a></em>, Tony breaks the cartel's hold on Miami and takes Sosa down. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/VideoGame/Freelancer" title="/pmwiki/pmwiki.php/VideoGame/Freelancer">Freelancer</a></em>: The Outcasts are this trope '<a class="twikilink" href="/pmwiki/pmwiki.php/Main/RecycledInSpace" title="/pmwiki/pmwiki.php/Main/RecycledInSpace">IN SPACE</a>'. </li><li> Raul Menendez, the <a class="twikilink" href="/pmwiki/pmwiki.php/Main/BigBad" title="/pmwiki/pmwiki.php/Main/BigBad">Big Bad</a> of <em><a class="twikilink" href="/pmwiki/pmwiki.php/VideoGame/CallOfDutyBlackOpsII" title="/pmwiki/pmwiki.php/VideoGame/CallOfDutyBlackOpsII">Call of Duty: Black Ops II</a></em>, started off as a drug runner who controlled a very powerful cartel in Nicaragua in the 1980's. He used the money he gained from that operation to finance other operations around the world, up until the CIA tried to kill him, and in the process killed his blind, crippled sister. That led him to use the money invested in his cartel to set up the <em>Cordis Die</em> network, which became a full-on <a class="twikilink" href="/pmwiki/pmwiki.php/Main/NGOSuperpower" title="/pmwiki/pmwiki.php/Main/NGOSuperpower">N.G.O. Superpower</a> capable of threatening the entire First World. </li><li> <em><a class="twikilink" href="/pmwiki/pmwiki.php/VideoGame/ArmyOfTwo" title="/pmwiki/pmwiki.php/VideoGame/ArmyOfTwo">Army of Two</a>: The Devil's Cartel</em> has you fighting one such Mexican cartel. </li><li> <a class="twikilink" href="/pmwiki/pmwiki.php/VideoGame/SaintsRow1" title="/pmwiki/pmwiki.php/VideoGame/SaintsRow1">Saints Row</a> featured a Colombian cartel supporting the Carnales gang. <span class="spoiler" title="you can set spoilers visible by default on your profile"> They eventually switch allegiance to the Saints.</span> </li><li> Surprisingly they don't make many if any appearances in the <em><a class="twikilink" href="/pmwiki/pmwiki.php/Videogame/Tropico" title="/pmwiki/pmwiki.php/Videogame/Tropico">Tropico</a></em> games, although they are mentioned several times (such as when your main "general" complains the Tropico army is smaller than most Colombian drug barons). </li><li> South American drug cartels are a source of Crime.net contracts in <em><a class="twikilink" href="/pmwiki/pmwiki.php/VideoGame/PAYDAY2" title="/pmwiki/pmwiki.php/VideoGame/PAYDAY2">PAYDAY 2</a></em>; Hector, specifically, offers several involving the rival Mendoza group. <em>Watchdogs</em> involves protecting and moving a batch of Hector's cocaine out of the city, stopping the FBI and DEA from intervening. <em>Firestarter</em> sees you stealing or destroying weapons meant to arm the Mendoza's soldiers, then destroying their money so the Mendoza operations grind to a halt. <em>Rats</em> finishes the Mendoza presence in D.C., with the eradication of a bus-load of Mendoza lieutenants as they attempt to flee the city under FBI protection. </li><li> In <em><a class="twikilink" href="/pmwiki/pmwiki.php/VideoGame/GhostReconWildlands" title="/pmwiki/pmwiki.php/VideoGame/GhostReconWildlands">Ghost Recon Wildlands</a></em> the player controls a team of United States special forces soldiers sent into Bolivia to combat the Santa Blanca Drug Cartel; an organization so powerful and violent that it has destabilized the entire region. </li><li> In <em><a class="twikilink" href="/pmwiki/pmwiki.php/VideoGame/Uncharted4AThiefsEnd" title="/pmwiki/pmwiki.php/VideoGame/Uncharted4AThiefsEnd">Uncharted 4: A Thief's End</a></em>, Nate's long-lost brother Sam claims that he was broken out of a Panamanian prison by the drug lord Hector Alcazar and his private army, who then forced Sam to help find a lost pirate treasure so that Alcazar could take a huge cut from it. <span class="spoiler" title="you can set spoilers visible by default on your profile">But it's later revealed that Sam never actually met Alcazar (who has been <a class="twikilink" href="/pmwiki/pmwiki.php/Main/DeadAllAlong" title="/pmwiki/pmwiki.php/Main/DeadAllAlong">dead for a long time</a>), and Sam made up this whole story to hide the fact that he was really just bribed out of jail by Rafe Adler, the true <a class="twikilink" href="/pmwiki/pmwiki.php/Main/BigBad" title="/pmwiki/pmwiki.php/Main/BigBad">villain of the game</a>.</span> </li><li> A Columbian gang appears in <em><a class="twikilink" href="/pmwiki/pmwiki.php/VideoGame/HotlineMiami2WrongNumber" title="/pmwiki/pmwiki.php/VideoGame/HotlineMiami2WrongNumber">Hotline Miami 2: Wrong Number</a></em> as the rivals to <a class="twikilink" href="/pmwiki/pmwiki.php/Main/TheMafiya" title="/pmwiki/pmwiki.php/Main/TheMafiya">The Mafiya</a>, having taken over some of their area as the latter is looking to reclaim it. </li></ul></div> <p></p><div class="folderlabel" onclick="togglefolder('folder9');">    Web Original </div><div class="folder" id="folder9" isfolder="true" style="display:block;"> <ul><li> In <em><a class="twikilink" href="/pmwiki/pmwiki.php/Roleplay/TheGamersAlliance" title="/pmwiki/pmwiki.php/Roleplay/TheGamersAlliance">The Gamer's Alliance</a></em>, Araña de la Noche is an influential drug cartel which operates in the city of Paraiso in Aison. </li></ul></div> <p></p><div class="folderlabel" onclick="togglefolder('folder10');">    Western Animation </div><div class="folder" id="folder10" isfolder="true" style="display:block;"> <ul><li> In <em><a class="twikilink" href="/pmwiki/pmwiki.php/WesternAnimation/TheBoondocks" title="/pmwiki/pmwiki.php/WesternAnimation/TheBoondocks">The Boondocks</a></em> episode "The Lovely Ebony Brown", one of Granddad's many crazy ex-girlfriends happened to be a Dominican drug boss, who brought one of her armed henchmen to the dinner table. </li></ul></div> <p></p><div class="folderlabel" onclick="togglefolder('folder11');">    Real Life </div><div class="folder" id="folder11" isfolder="true" style="display:block;"> <ul><li> Mexico has many, but perhaps the most infamous cartel is <em>Los Zetas</em>. Their founders were <a class="twikilink" href="/pmwiki/pmwiki.php/Main/FromCamouflageToCriminal" title="/pmwiki/pmwiki.php/Main/FromCamouflageToCriminal">Mexican special forces who went rogue and started doing work for the Gulf Cartel</a>. Nowadays, they are an autonomous cartel as well as enemies of the Gulf Cartel, and many of their founding members are either arrested or dead, meaning they aren't as deadly as they used to be, but they are still known for their brutality. Just how feared are these guys? Well, one day, they threatened to kill the inhabitants of the small city Ciudad Mier. All 4,000 inhabitants left the town, leaving it completely abandoned. <ul><li> Usually Mexican Cartels are business-like and exude a <a class="twikilink" href="/pmwiki/pmwiki.php/Main/PragmaticVillainy" title="/pmwiki/pmwiki.php/Main/PragmaticVillainy">Pragmatic Villainy</a> aura: they usually look for profit and if you don't mess with them, they don't mess with you.<span class="notelabel" onclick="togglenote('note0joq5');"><sup>note </sup></span><span class="inlinefolder" id="note0joq5" isnote="true" onclick="togglenote('note0joq5');" style="cursor:pointer;font-size:smaller;display:none;">A common adage among criminals is that you only beat the debtor half to death; if he's still in the hospital he can still make the next payment.</span> Los Zetas took this to the opposite extreme: running protection rackets against anyone regardless of economic level or profit, attacking and killing civilians for little to no reason, killing the entire family of an enemy instead of only the enemy, kidnapping and horribly killing victims even when the ransom is paid, among other atrocities to a nationwide extent. And we have yet to get to the nasty parts; folks who have pissed off Mexican Cartels particularly badly usually have demises of the sort you can only see on LiveLeak and <a class="twikilink" href="/pmwiki/pmwiki.php/Main/BrainBleach" title="/pmwiki/pmwiki.php/Main/BrainBleach">never leave your mind again even if just described</a>. <ul><li> To summarize this, while most Mexican Cartels can be considered Italian-styled, the Zetas can be considered <a class="twikilink" href="/pmwiki/pmwiki.php/Main/TheMafiya" title="/pmwiki/pmwiki.php/Main/TheMafiya">The Mafiya</a> - that is, Russian-styled. </li></ul></li></ul></li><li> The infamous Cali and Medellin cartels during the 1980s and 1990s, which controlled every link in the drug supply chain except street pushing. They flew in coca base from Peru and Bolivia, refined it into cocaine in the Colombian jungle, and flew it on to secret airstrips in the Southern United States. At one point, the Medellin Cartel, under the infamous Pablo Escobar, supplied 80% of the United States' cocaine, and Escobar had a net worth of $30 billion. Their rivals, the Cali Cartel, would put them out of business after Escobar's death, and go on to control 90% of the <em>world</em>'s market, as well as introduce cocaine to Europe. American DEA agents tasked with bringing them down called them: 'The Cali KGB'. While this empire split apart heavily after his death, the remaining coke empires (going from simply huge cartels to actual terrorist groups) were still some of the biggest drug-running organizations one could find until Mexican cartels arrived on the scene. </li><li> Far more common in Venezuela than Mexico. To the point where some have argued the recent <a class="twikilink" href="/pmwiki/pmwiki.php/Main/RidiculousFutureInflation" title="/pmwiki/pmwiki.php/Main/RidiculousFutureInflation">hyper inflation</a> may have actually been a net <em>benefit</em> (for everyday people, that is), since worthless currency means kidnapping and drug sales are a barter market at <em>best</em>, but most likely some form of "not viable"; some criminals caught in neighboring/nearby countries have confessed they migrated because there was <em>nothing to steal</em> back home. Being next door to Colombia had a lot to do with it. The Chavez and Maduro regimes being self serving and accepting bribes to compensate for falling oil prices had a lot more to do with it. </li></ul></div> <p></p><hr/> </div> <div class="square_ad footer-article-ad main_2" data-isolated="0"></div> <div class="section-links" itemscope="" itemtype="http://schema.org/SiteNavigationElement"> <div class="titles"> <div><h3 class="text-center text-uppercase">Previous</h3></div> <div><h3 class="text-center text-uppercase">Index</h3></div> <div><h3 class="text-center text-uppercase">Next</h3></div> </div> <div class="links"> <ul> <li> <a href="/pmwiki/pmwiki.php/Main/BlackMarket">Black Market</a> </li> <li> <a href="/pmwiki/pmwiki.php/Main/OrganizedCrimeTropes">Organized Crime Tropes</a> </li> <li> <a href="/pmwiki/pmwiki.php/Main/CementShoes">Cement Shoes</a> </li> </ul> <ul> <li> <a href="/pmwiki/pmwiki.php/Main/CannibalClan">Cannibal Clan</a> </li> <li> <a href="/pmwiki/pmwiki.php/Main/Criminals">Criminals</a> </li> <li> <a href="/pmwiki/pmwiki.php/Main/ClandestineChemist">Clandestine Chemist</a> </li> </ul> <ul> <li> <a href="/pmwiki/pmwiki.php/Main/BrotherhoodOfFunnyHats">Brotherhood of Funny Hats</a> </li> <li> <a href="/pmwiki/pmwiki.php/Main/OrganizationIndex">Organization Index</a> </li> <li> <a href="/pmwiki/pmwiki.php/Main/CelestialBureaucracy">Celestial Bureaucracy</a> </li> </ul> <ul> <li> <a href="/pmwiki/pmwiki.php/Main/BolivianArmyCliffhanger">Bolivian Army Cliffhanger</a> </li> <li> <a href="/pmwiki/pmwiki.php/UsefulNotes/SouthAmerica">UsefulNotes/South America</a> </li> <li> <a href="/pmwiki/pmwiki.php/UsefulNotes/TheChinchaIslandsWar">The Chincha Islands War</a> </li> </ul> <ul> <li> <a href="/pmwiki/pmwiki.php/Main/BarbarianTribe">Barbarian Tribe</a> </li> <li> <a href="/pmwiki/pmwiki.php/Main/EvilRaceTropes">Evil Race Tropes</a> </li> <li> <a href="/pmwiki/pmwiki.php/Main/DragonLady">Dragon Lady</a> </li> </ul> <ul> <li> <a href="/pmwiki/pmwiki.php/Main/Calacas">Calacas</a> </li> <li> <a href="/pmwiki/pmwiki.php/Main/HispanicAndLatinoIndex">Hispanic and Latino Index</a> </li> <li> <a href="/pmwiki/pmwiki.php/Main/TheCapitalOfBrazilIsBuenosAires">The Capital of Brazil Is Buenos Aires</a> </li> </ul> <ul> <li> <a href="/pmwiki/pmwiki.php/Main/Brownface">Brownface</a> </li> <li> <a href="/pmwiki/pmwiki.php/Main/NationalStereotypes">National Stereotypes</a> </li> <li> <a href="/pmwiki/pmwiki.php/Main/DashingHispanic">Dashing Hispanic</a> </li> </ul> <ul> <li> <a href="/pmwiki/pmwiki.php/Main/CarnivalOfKillers">Carnival of Killers</a> </li> <li> <a href="/pmwiki/pmwiki.php/Main/Villains">Villains</a> </li> <li> <a href="/pmwiki/pmwiki.php/Main/CartoonishSupervillainy">Cartoonish Supervillainy</a> </li> </ul> <ul> <li> <a href="/pmwiki/pmwiki.php/Main/CanadianEqualsHockeyFan">Canadian = Hockey Fan</a> </li> <li> <a href="/pmwiki/pmwiki.php/UsefulNotes/NorthAmerica">UsefulNotes/North America</a> </li> <li> <a href="/pmwiki/pmwiki.php/UsefulNotes/CuisinesInAmerica">Cuisines in America</a> </li> </ul> <ul> <li> <a href="/pmwiki/pmwiki.php/Series/Narcos">Narcos</a> </li> <li> <a href="/pmwiki/pmwiki.php/ImageSource/LiveActionTV">ImageSource/Live-Action TV</a> </li> <li> <a href="/pmwiki/pmwiki.php/Series/NCIS">NCIS</a> </li> </ul> </div> </div> <div class="outer_ads_by_salon_wrapper" id="exco_player_insert_div"> </div> </article> <div id="main-content-sidebar"><div class="sidebar-item display-options"> <ul class="sidebar display-toggles"> <li>Show Spoilers <div class="display-toggle show-spoilers" id="sidebar-toggle-showspoilers"></div></li> <li>Night Vision <div class="display-toggle night-vision" id="sidebar-toggle-nightvision"></div></li> <li>Sticky Header <div class="display-toggle sticky-header" id="sidebar-toggle-stickyheader"></div></li> <li>Wide Load <div class="display-toggle wide-load" id="sidebar-toggle-wideload"></div></li> </ul> <script>updateDesktopPrefs();</script> </div> <div class="sidebar-item ad sb-ad-unit"> <div class="proper-ad-unit"> <div id="proper-ad-tvtropes_ad_2"> <script>propertag.cmd.push(function() { proper_display('tvtropes_ad_2'); });</script> </div> </div></div> <div class="sidebar-item quick-links" itemtype="http://schema.org/SiteNavigationElement"> <p class="sidebar-item-title" data-title="Important Links">Important Links</p> <div class="padded"> <a href="/pmwiki/query.php?type=att">Ask The Tropers</a> <a href="/pmwiki/query.php?type=tf">Trope Finder</a> <a href="/pmwiki/query.php?type=ykts">You Know That Show...</a> <a href="/pmwiki/tlp_activity.php">Trope Launch Pad</a> <a href="/pmwiki/review_activity.php">Reviews</a> <a data-modal-target="login" href="/pmwiki/lbs.php">Live Blogs</a> <a href="/pmwiki/ad-free-subscribe.php">Go Ad Free!</a> </div> </div> <div class="sidebar-item sb-ad-unit"> <div class="sidebar-section"> <div class="square_ad ad-size-300x600 ad-section text-center"> <div class="proper-ad-unit"> <div id="proper-ad-tvtropes_ad_3"> <script>propertag.cmd.push(function() { proper_display('tvtropes_ad_3'); });</script> </div> </div> </div> </div> </div> <div class="sidebar-item"> <p class="sidebar-item-title" data-title="Crucial Browsing">Crucial Browsing</p> <ul class="padded font-s" itemscope="" itemtype="http://schema.org/SiteNavigationElement"> <li><a data-click-toggle="active" href="javascript:void(0);">Genre</a> <ul> <li><a href="/pmwiki/pmwiki.php/Main/ActionAdventureTropes" title="Main/ActionAdventureTropes">Action Adventure</a></li> <li><a href="/pmwiki/pmwiki.php/Main/ComedyTropes" title="Main/ComedyTropes">Comedy</a></li> <li><a href="/pmwiki/pmwiki.php/Main/CommercialsTropes" title="Main/CommercialsTropes">Commercials</a></li> <li><a href="/pmwiki/pmwiki.php/Main/CrimeAndPunishmentTropes" title="Main/CrimeAndPunishmentTropes">Crime &amp; Punishment</a></li> <li><a href="/pmwiki/pmwiki.php/Main/DramaTropes" title="Main/DramaTropes">Drama</a></li> <li><a href="/pmwiki/pmwiki.php/Main/HorrorTropes" title="Main/HorrorTropes">Horror</a></li> <li><a href="/pmwiki/pmwiki.php/Main/LoveTropes" title="Main/LoveTropes">Love</a></li> <li><a href="/pmwiki/pmwiki.php/Main/NewsTropes" title="Main/NewsTropes">News</a></li> <li><a href="/pmwiki/pmwiki.php/Main/ProfessionalWrestling" title="Main/ProfessionalWrestling">Professional Wrestling</a></li> <li><a href="/pmwiki/pmwiki.php/Main/SpeculativeFictionTropes" title="Main/SpeculativeFictionTropes">Speculative Fiction</a></li> <li><a href="/pmwiki/pmwiki.php/Main/SportsStoryTropes" title="Main/SportsStoryTropes">Sports Story</a></li> <li><a href="/pmwiki/pmwiki.php/Main/WarTropes" title="Main/WarTropes">War</a></li> </ul> </li> <li><a data-click-toggle="active" href="javascript:void(0);">Media</a> <ul> <li><a href="/pmwiki/pmwiki.php/Main/Media" title="Main/Media">All Media</a></li> <li><a href="/pmwiki/pmwiki.php/Main/AnimationTropes" title="Main/AnimationTropes">Animation (Western)</a></li> <li><a href="/pmwiki/pmwiki.php/Main/Anime" title="Main/Anime">Anime</a></li> <li><a href="/pmwiki/pmwiki.php/Main/ComicBookTropes" title="Main/ComicBookTropes">Comic Book</a></li> <li><a href="/pmwiki/pmwiki.php/Main/FanFic" title="FanFic/FanFics">Fan Fics</a></li> <li><a href="/pmwiki/pmwiki.php/Main/Film" title="Main/Film">Film</a></li> <li><a href="/pmwiki/pmwiki.php/Main/GameTropes" title="Main/GameTropes">Game</a></li> <li><a href="/pmwiki/pmwiki.php/Main/Literature" title="Main/Literature">Literature</a></li> <li><a href="/pmwiki/pmwiki.php/Main/MusicAndSoundEffects" title="Main/MusicAndSoundEffects">Music And Sound Effects</a></li> <li><a href="/pmwiki/pmwiki.php/Main/NewMediaTropes" title="Main/NewMediaTropes">New Media</a></li> <li><a href="/pmwiki/pmwiki.php/Main/PrintMediaTropes" title="Main/PrintMediaTropes">Print Media</a></li> <li><a href="/pmwiki/pmwiki.php/Main/Radio" title="Main/Radio">Radio</a></li> <li><a href="/pmwiki/pmwiki.php/Main/SequentialArt" title="Main/SequentialArt">Sequential Art</a></li> <li><a href="/pmwiki/pmwiki.php/Main/TabletopGames" title="Main/TabletopGames">Tabletop Games</a></li> <li><a href="/pmwiki/pmwiki.php/UsefulNotes/Television" title="Main/Television">Television</a></li> <li><a href="/pmwiki/pmwiki.php/Main/Theater" title="Main/Theater">Theater</a></li> <li><a href="/pmwiki/pmwiki.php/Main/VideogameTropes" title="Main/VideogameTropes">Videogame</a></li> <li><a href="/pmwiki/pmwiki.php/Main/Webcomics" title="Main/Webcomics">Webcomics</a></li> </ul> </li> <li><a data-click-toggle="active" href="javascript:void(0);">Narrative</a> <ul> <li><a href="/pmwiki/pmwiki.php/Main/UniversalTropes" title="Main/UniversalTropes">Universal</a></li> <li><a href="/pmwiki/pmwiki.php/Main/AppliedPhlebotinum" title="Main/AppliedPhlebotinum">Applied Phlebotinum</a></li> <li><a href="/pmwiki/pmwiki.php/Main/CharacterizationTropes" title="Main/CharacterizationTropes">Characterization</a></li> <li><a href="/pmwiki/pmwiki.php/Main/Characters" title="Main/Characters">Characters</a></li> <li><a href="/pmwiki/pmwiki.php/Main/CharactersAsDevice" title="Main/CharactersAsDevice">Characters As Device</a></li> <li><a href="/pmwiki/pmwiki.php/Main/Dialogue" title="Main/Dialogue">Dialogue</a></li> <li><a href="/pmwiki/pmwiki.php/Main/Motifs" title="Main/Motifs">Motifs</a></li> <li><a href="/pmwiki/pmwiki.php/Main/NarrativeDevices" title="Main/NarrativeDevices">Narrative Devices</a></li> <li><a href="/pmwiki/pmwiki.php/Main/Paratext" title="Main/Paratext">Paratext</a></li> <li><a href="/pmwiki/pmwiki.php/Main/Plots" title="Main/Plots">Plots</a></li> <li><a href="/pmwiki/pmwiki.php/Main/Settings" title="Main/Settings">Settings</a></li> <li><a href="/pmwiki/pmwiki.php/Main/Spectacle" title="Main/Spectacle">Spectacle</a></li> </ul> </li> <li><a data-click-toggle="active" href="javascript:void(0);">Other Categories</a> <ul> <li><a href="/pmwiki/pmwiki.php/Main/BritishTellyTropes" title="Main/BritishTellyTropes">British Telly</a></li> <li><a href="/pmwiki/pmwiki.php/Main/TheContributors" title="Main/TheContributors">The Contributors</a></li> <li><a href="/pmwiki/pmwiki.php/Main/CreatorSpeak" title="Main/CreatorSpeak">Creator Speak</a></li> <li><a href="/pmwiki/pmwiki.php/Main/Creators" title="Main/Creators">Creators</a></li> <li><a href="/pmwiki/pmwiki.php/Main/DerivativeWorks" title="Main/DerivativeWorks">Derivative Works</a></li> <li><a href="/pmwiki/pmwiki.php/Main/LanguageTropes" title="Main/LanguageTropes">Language</a></li> <li><a href="/pmwiki/pmwiki.php/Main/LawsAndFormulas" title="Main/LawsAndFormulas">Laws And Formulas</a></li> <li><a href="/pmwiki/pmwiki.php/Main/ShowBusiness" title="Main/ShowBusiness">Show Business</a></li> <li><a href="/pmwiki/pmwiki.php/Main/SplitPersonalityTropes" title="Main/SplitPersonalityTropes">Split Personality</a></li> <li><a href="/pmwiki/pmwiki.php/Main/StockRoom" title="Main/StockRoom">Stock Room</a></li> <li><a href="/pmwiki/pmwiki.php/Main/TropeTropes" title="Main/TropeTropes">Trope</a></li> <li><a href="/pmwiki/pmwiki.php/Main/Tropes" title="Main/Tropes">Tropes</a></li> <li><a href="/pmwiki/pmwiki.php/Main/TruthAndLies" title="Main/TruthAndLies">Truth And Lies</a></li> <li><a href="/pmwiki/pmwiki.php/Main/TruthInTelevision" title="Main/TruthInTelevision">Truth In Television</a></li> </ul> </li> <li><a data-click-toggle="active" href="javascript:void(0);">Topical Tropes</a> <ul> <li><a href="/pmwiki/pmwiki.php/Main/BetrayalTropes" title="Main/BetrayalTropes">Betrayal</a></li> <li><a href="/pmwiki/pmwiki.php/Main/CensorshipTropes" title="Main/CensorshipTropes">Censorship</a></li> <li><a href="/pmwiki/pmwiki.php/Main/CombatTropes" title="Main/CombatTropes">Combat</a></li> <li><a href="/pmwiki/pmwiki.php/Main/DeathTropes" title="Main/DeathTropes">Death</a></li> <li><a href="/pmwiki/pmwiki.php/Main/FamilyTropes" title="Main/FamilyTropes">Family</a></li> <li><a href="/pmwiki/pmwiki.php/Main/FateAndProphecyTropes" title="Main/FateAndProphecyTropes">Fate And Prophecy</a></li> <li><a href="/pmwiki/pmwiki.php/Main/FoodTropes" title="Main/FoodTropes">Food</a></li> <li><a href="/pmwiki/pmwiki.php/Main/HolidayTropes" title="Main/HolidayTropes">Holiday</a></li> <li><a href="/pmwiki/pmwiki.php/Main/MemoryTropes" title="Main/MemoryTropes">Memory</a></li> <li><a href="/pmwiki/pmwiki.php/Main/MoneyTropes" title="Main/MoneyTropes">Money</a></li> <li><a href="/pmwiki/pmwiki.php/Main/MoralityTropes" title="Main/MoralityTropes">Morality</a></li> <li><a href="/pmwiki/pmwiki.php/Main/PoliticsTropes" title="Main/PoliticsTropes">Politics</a></li> <li><a href="/pmwiki/pmwiki.php/Main/ReligionTropes" title="Main/ReligionTropes">Religion</a></li> <li><a href="/pmwiki/pmwiki.php/Main/SchoolTropes" title="Main/SchoolTropes">School</a></li> </ul> </li> </ul> </div> <div class="sidebar-item showcase"> <p class="sidebar-item-title" data-title="Community Showcase">Community Showcase <a class="bubble float-right hover-blue" href="/pmwiki/showcase.php">More</a></p> <p class="community-showcase"> <a href="https://sharetv.com/shows/echo_chamber" onclick="trackOutboundLink('https://sharetv.com/shows/echo_chamber');" target="_blank"> <img alt="" class="lazy-image" data-src="/images/communityShowcase-echochamber.jpg"/></a> <a href="/pmwiki/pmwiki.php/Webcomic/TwistedTropes"> <img alt="" class="lazy-image" data-src="/img/howlandsc-side.jpg"/></a> </p> </div> <div class="sidebar-item sb-ad-unit" id="stick-cont"> <div class="sidebar-section" id="stick-bar"> <div class="square_ad ad-size-300x600 ad-section text-center"> <div class="proper-ad-unit"> <div id="proper-ad-tvtropes_ad_4"> <script>propertag.cmd.push(function() { proper_display('tvtropes_ad_4'); });</script> </div> </div> </div> </div> </div> </div> </div> <div class="action-bar tablet-off" id="action-bar-bottom"> <a class="scroll-to-top dead-button" href="#top-of-page" onclick="$('html, body').animate({scrollTop : 0},500);">Top</a> </div> </div> <div class="proper-ad-unit ad-sticky"> <div id="proper-ad-tvtropes_sticky_ad"> <script>propertag.cmd.push(function() { proper_display('tvtropes_sticky_ad'); });</script> </div> </div> <footer id="main-footer"> <div id="main-footer-inner"> <div class="footer-left"> <a class="img-link" href="/"><img alt="TV Tropes" class="lazy-image" data-src="/img/tvtropes-footer-logo.png" title="TV Tropes"/></a> <form action="index.html" class="navbar-form newsletter-signup validate modal-replies" data-ajax-get="/ajax/subscribe_email.php" id="cse-search-box-mobile" name="" role=""> <button class="btn-submit newsletter-signup-submit-button" id="subscribe-btn" type="submit"><i class="fa fa-paper-plane"></i></button> <input class="form-control" id="subscription-email" name="q" placeholder="Subscribe" size="31" type="text" validate-type="email" value=""/> </form> <ul class="social-buttons"> <li><a class="btn fb" href="https://www.facebook.com/tvtropes" onclick="_gaq.push(['_trackEvent', 'btn-social-icon', 'click', 'btn-facebook']);" target="_blank"><i class="fa fa-facebook"></i></a></li> <li><a class="btn tw" href="https://www.twitter.com/tvtropes" onclick="_gaq.push(['_trackEvent', 'btn-social-icon', 'click', 'btn-twitter']);" target="_blank"><i class="fa fa-twitter"></i></a> </li> <li><a class="btn rd" href="https://www.reddit.com/r/tvtropes" onclick="_gaq.push(['_trackEvent', 'btn-social-icon', 'click', 'btn-reddit']);" target="_blank"><i class="fa fa-reddit-alien"></i></a></li> </ul> </div> <hr/> <ul class="footer-menu" itemscope="" itemtype="http://schema.org/SiteNavigationElement"> <li><h4 class="footer-menu-header">TVTropes</h4></li> <li><a href="/pmwiki/pmwiki.php/Main/Administrivia">About TVTropes</a></li> <li><a href="/pmwiki/pmwiki.php/Administrivia/TheGoalsOfTVTropes">TVTropes Goals</a></li> <li><a href="/pmwiki/pmwiki.php/Administrivia/TheTropingCode">Troping Code</a></li> <li><a href="/pmwiki/pmwiki.php/Administrivia/TVTropesCustoms">TVTropes Customs</a></li> <li><a href="/pmwiki/pmwiki.php/JustForFun/TropesOfLegend">Tropes of Legend</a></li> <li><a href="/pmwiki/ad-free-subscribe.php">Go Ad-Free</a></li> </ul> <hr/> <ul class="footer-menu" itemscope="" itemtype="http://schema.org/SiteNavigationElement"> <li><h4 class="footer-menu-header">Community</h4></li> <li><a href="/pmwiki/query.php?type=att">Ask The Tropers</a></li> <li><a href="/pmwiki/tlp_activity.php">Trope Launch Pad</a></li> <li><a href="/pmwiki/query.php?type=tf">Trope Finder</a></li> <li><a href="/pmwiki/query.php?type=ykts">You Know That Show</a></li> <li><a data-modal-target="login" href="/pmwiki/lbs.php">Live Blogs</a></li> <li><a href="/pmwiki/review_activity.php">Reviews</a></li> <li><a href="/pmwiki/topics.php">Forum</a></li> </ul> <hr/> <ul class="footer-menu" itemscope="" itemtype="http://schema.org/SiteNavigationElement"> <li><h4 class="footer-menu-header">Tropes HQ</h4></li> <li><a href="/pmwiki/about.php">About Us</a></li> <li><a href="/pmwiki/contact.php">Contact Us</a></li> <li><a href="/pmwiki/dmca.php">DMCA Notice</a></li> <li><a href="/pmwiki/privacypolicy.php">Privacy Policy</a></li> </ul> </div> <div class="text-center gutter-top gutter-bottom tablet-on" id="desktop-on-mobile-toggle"> <a href="/pmwiki/switchDeviceCss.php?mobileVersion=1" rel="nofollow">Switch to <span class="txt-desktop">Desktop</span><span class="txt-mobile">Mobile</span> Version</a> </div> <div class="legal"> <p>TVTropes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. <br/>Permissions beyond the scope of this license may be available from <a href="mailto:thestaff@tvtropes.org" rel="cc:morePermissions" xmlns:cc="http://creativecommons.org/ns#"> thestaff@tvtropes.org</a>.</p> <br/> <div class="privacy_wrapper"> </div> </div> </footer> <style> div.fc-ccpa-root { position: absolute !important; bottom: 93px !important; margin: auto !important; width: 100% !important; z-index: 9999 !important; } .fc-ccpa-root .fc-dns-dialog .fc-dns-link p{ outline: none !important; text-decoration: underline !important; font-size: .7em !important; font-family: sans-serif !important; } .fc-ccpa-root .fc-dns-dialog .fc-dns-link .fc-button-background { background: none !important; } </style> <div class="full-screen" id="_pm_videoViewer"> <a class="close" href="#close" id="_pm_videoViewer-close"></a> <div class="_pmvv-body"> <div class="_pmvv-vidbox"> <video class="video-js vjs-default-skin vjs-16-9" data-video-id="" id="overlay-video-player-box"> </video> <div class="_pmvv-vidbox-desc"> <h1 id="overlay-title"></h1> <p class="_pmvv-vidbox-descTxt" id="overlay-descrip"> </p> <div class="rating-row" data-video-id=""> <input name="is_logged_in" type="hidden" value="0"/> <p>How well does it match the trope?</p> <div id="star-rating-group"> <div class="trope-rate"> <input id="lamp5" name="rate" type="radio" value="5"/> <label for="lamp5" title="Absolutely"></label> <input id="lamp4" name="rate" type="radio" value="4"/> <label for="lamp4" title="Yes"></label> <input id="lamp3" name="rate" type="radio" value="3"/> <label for="lamp3" title="Kind of"></label> <input id="lamp2" name="rate" type="radio" value="2"/> <label for="lamp2" title="Not really"></label> <input id="lamp1" name="rate" type="radio" value="1"/> <label for="lamp1" title="No"></label> </div> <div id="star-rating-total"> </div> </div> </div> <div class="example-media-row"> <div class="example-overlay"> <p>Example of:</p> <div id="overlay-trope"> / </div> </div> <div class="media-sources-overlay example-overlay"> <p>Media sources:</p> <div id="overlay-media"> / </div> </div> </div> <p class="_pmvv-vidbox-stats text-right font-s" style="padding-top:8px; border-top: solid 1px rgba(255,255,255,0.2)"> <a class="float-right" data-modal-target="login" href="#video-feedback">Report</a> </p> </div> </div> </div> </div> <script type="text/javascript"> window.special_ops = { member : 'no', isolated : 0, tags : ['unknown'] }; </script> <script type="text/javascript"> var cleanCreativeEnabled = ""; var donation = ""; var live_ads = "1"; var img_domain = "https://static.tvtropes.org"; var snoozed = cookies.read('snoozedabm'); var snoozable = ""; if (adsRemovedWith) { live_ads = 0; } var elem = document.createElement('script'); elem.async = true; elem.src = '/design/assets/bundle.js?rev=c58d8df02f09262390bbd03db7921fc35c6af306'; elem.onload = function() { } document.getElementsByTagName('head')[0].appendChild(elem); </script> <script type="text/javascript"> function send_analytics_event(user_type, donation){ // if(user_type == 'uncached' || user_type == 'cached'){ // ga('send', 'event', 'caching', 'load', user_type, {'nonInteraction': 1}); // return; // } var event_name = user_type; if(donation == 'true'){ event_name += "_donation" }else if(typeof(valid_user) == 'undefined'){ event_name += "_blocked" }else if(valid_user == true){ event_name += "_unblocked"; }else{ event_name = "_unknown" } ga('send', 'event', 'ads', 'load', event_name, {'nonInteraction': 1}); } send_analytics_event("guest", "false"); </script> </body> </html>
96.580357
2,416
0.714975
f4fae1e31fcdea15a4a592b55eeab35305ad3b88
5,522
ps1
PowerShell
PowerShellSummitNA_2015/part1/07_active_directory.ps1
rohnedwards/Presentations
c1b24904bf20090f5f1da45596c8db5c4b0b14bd
[ "MIT" ]
3
2018-01-31T02:48:46.000Z
2020-05-11T13:01:19.000Z
PowerShellSummitNA_2015/part1/07_active_directory.ps1
rohnedwards/Presentations
c1b24904bf20090f5f1da45596c8db5c4b0b14bd
[ "MIT" ]
null
null
null
PowerShellSummitNA_2015/part1/07_active_directory.ps1
rohnedwards/Presentations
c1b24904bf20090f5f1da45596c8db5c4b0b14bd
[ "MIT" ]
null
null
null
# PAC module can work well with AD objects, too. Compare this native PS: Import-Module ActiveDirectory Get-Acl -Path "AD:\$((Get-ADUser $env:USERNAME).DistinguishedName)" | select -exp Access # With this PAC module output Get-ADUser $env:USERNAME | Get-AccessControlEntry # Notice that GUIDs aren't shown; the actual friendly names for the properties, property sets, # extended rights, validated rights, and class objects are shown (there is a speed sacrifice, # though) # Get-AccessControlEntry allows some very useful filtering: Get-ADUser $env:USERNAME | Get-AccessControlEntry -ObjectAceType *Number, *Information -InheritedObjectAceType user # Those results should include a lot of ACEs. If you look closely, each ACE applies to a user object (either because it # only applies to a user object, or because there is no limiting InheritedObjectAceType, so the ACE applies to all objects) # and the permission granted gives permission to something that ends in 'Number' or 'Information' (there are properties and # property sets that fit that description). If there is an ACE that grants read or write 'All Properties' or 'All PropertySets', # then that ACE meets the requirement. # We can slightly change that last filter to not include the 'All Properties' and/or 'All PropertySets' and/or all object types # by using the -Specific switch Get-ADUser $env:USERNAME | Get-AccessControlEntry -ObjectAceType *Number, *Information -InheritedObjectAceType user -Specific # We can create new ACEs, and the new ACEs will work with Get-Acl SD objects: # Read all properties: New-AccessControlEntry -Principal $env:USERNAME -ActiveDirectoryRights ReadProperty # Perform all extended rights: New-AccessControlEntry -Principal $env:USERNAME -ActiveDirectoryRights ExtendedRight # Reset password extended right for user objects: New-AccessControlEntry -Principal $env:USERNAME -ActiveDirectoryRights ExtendedRight -ObjectAceType (Get-ADObjectAceGuid -ExtendedRight Reset-Password) -InheritedObjectAceType (Get-ADObjectAceGuid -ClassObject user) # This does the same thing as the previous example, but it doesn't use the Get-ADObjectAceGuid helper function. Also, the # -ActiveDirectoryRights parameter isn't necessary (if you're creating an ACE for a property or class object, it's recommended # to still supply the permissions since there are two possible permissions for those types of objects) New-AccessControlEntry -Principal $env:USERNAME -ObjectAceType Reset-Password -InheritedObjectAceType user # One last example on this. This almost does what the previous command does, except it will not uniquely identify an ObjectAceType # and InheritedObjectAceType, so you'll be prompted to choose one: New-AccessControlEntry -Principal $env:USERNAME -ObjectAceType *pass* -InheritedObjectAceType *user* #region Create the same ACE with native PowerShell New-Object System.DirectoryServices.ActiveDirectoryAccessRule ( [System.Security.Principal.NTAccount] $env:USERNAME, [System.DirectoryServices.ActiveDirectoryRights]::ExtendedRight, [System.Security.AccessControl.AccessControlType]::Allow, "00299570-246d-11d0-a768-00aa006e0529", [System.DirectoryServices.ActiveDirectorySecurityInheritance]::All, "bf967aba-0de6-11d0-a285-00aa003049e2" ) #endregion # Being able to easily create new ACEs like this means that delegation from PS becomes very easy. If you know what ACEs # are needed, just use Add-AccessControlEntry with the New-Ace params shown above. If you're not sure what rights are needed # to do the desired task, you can take a before and after snapshot of an object and use the 'Delegation of Control Wizard' # to see the rights that are added: $OuPath = 'OU=TestOU,DC=testdomain,DC=local' $UserName = "LimitedUser" $Before = Get-ADObject $OuPath | Get-AccessControlEntry # Run the 'Delegation of Control Wizard' and delegate some control to $UserName $After = Get-ADObject $OuPath | Get-AccessControlEntry # ObjectAceType, InheritedObjectAceType are also useful, but knowing the full name and type of each is enought # to uniquely identify them. Compare-Object $Before $After -Property Principal, AccessMaskDisplay, AppliesTo, InheritedObjectAceTypeDisplayName | ft # Clean up: $OuPath | Get-AccessControlEntry -Principal $UserName | Remove-AccessControlEntry -Specific # Finally, let's look at Get-EffectiveAccess # This example looks very similar to Get-EffectiveAccess for non-AD objects: Get-ADObject $OuPath | Get-EffectiveAccess -Principal $UserName Get-ADObject $OuPath | Get-EffectiveAccess -Principal $UserName -ListAllRights # The real difference comes in with the -ObjectAceTypes parameter. This will show any effective access on any # properties, property sets, validated writes, extended rights, and class objects that match any of the listed # partial names. If there is no access, the ObjectAceType isn't listed: Get-ADObject $OuPath | Get-EffectiveAccess -Principal $UserName -ObjectAceTypes *Information, *Number, *pass* # When -ListAllRights is used, every single matching ObjectAceType gets listed: Get-ADObject $OuPath | Get-EffectiveAccess -Principal $UserName -ObjectAceTypes *Information, *Number, *pass* -ListAllRights # That was a lot. Lets say you're interested in whether or not a user has the Reset-Password right: Get-ADUser $UserName | Get-EffectiveAccess -Principal $UserName -ObjectAceTypes Reset-Password -ListAllRights Get-ADUser $UserName | Get-EffectiveAccess -Principal $UserName -ObjectAceTypes Change-Password -ListAllRights
57.520833
215
0.798624
bc4180177afd6f386b3fe2778052f95aa44de1d5
6,499
lua
Lua
source/functions.lua
Philbywhizz/MarsLander
4566e1a847191d691b1affb73f89daceec938436
[ "MIT" ]
6
2021-10-16T06:50:00.000Z
2022-03-11T10:30:39.000Z
source/functions.lua
Philbywhizz/MarsLander
4566e1a847191d691b1affb73f89daceec938436
[ "MIT" ]
160
2021-10-14T02:42:50.000Z
2021-11-22T08:49:53.000Z
source/functions.lua
Philbywhizz/MarsLander
4566e1a847191d691b1affb73f89daceec938436
[ "MIT" ]
null
null
null
local functions = {} function functions.quitGame() -- cleans up before quiting the game if ENET_IS_CONNECTED then -- test if pressing ESC on main screen (i.e. quiting) if #CURRENT_SCREEN == 1 then if IS_A_CLIENT then EnetHandler.disconnectClient(LANDERS[1].connectionID) elseif IS_A_HOST then EnetHandler.disconnectHost() else error("Error 10 occured while player disconnected.") end end end love.event.quit() end function functions.AddScreen(strNewScreen) table.insert(CURRENT_SCREEN, strNewScreen) end function functions.RemoveScreen() if #CURRENT_SCREEN == 1 then functions.quitGame() end table.remove(CURRENT_SCREEN) end function functions.CurrentScreenName() -- returns the current active screen return CURRENT_SCREEN[#CURRENT_SCREEN] end function functions.SwapScreen(newscreen) -- swaps screens so that the old screen is removed from the stack -- this adds the new screen then removes the 2nd last screen. Fun.AddScreen(newscreen) table.remove(CURRENT_SCREEN, #CURRENT_SCREEN - 1) end function functions.SaveGameSettings() -- save game settings so they can be autoloaded next session local savefile local serialisedString local success, message local savedir = love.filesystem.getSource() savefile = savedir .. "/" .. "settings.dat" serialisedString = Bitser.dumps(GAME_SETTINGS) success, message = Nativefs.write(savefile, serialisedString ) end function functions.LoadGameSettings() local savedir = love.filesystem.getSource() love.filesystem.setIdentity( savedir ) local savefile, contents savefile = savedir .. "/" .. "settings.dat" contents, _ = Nativefs.read(savefile) local success success, GAME_SETTINGS = pcall(Bitser.loads, contents) --! should do pcall on all the "load" functions if success == false then GAME_SETTINGS = {} end --[[ FIXME: -- This is horrible bugfix and needs refactoring. If a player doesn't have -- a settings.dat already then all the values in GAME_SETTINGS table are -- nil. This sets some reasonable defaults to stop nil value crashes. ]]-- if GAME_SETTINGS.PlayerName == nil then GAME_SETTINGS.PlayerName = DEFAULT_PLAYER_NAME end if GAME_SETTINGS.hostIP == nil then GAME_SETTINGS.hostIP = HOST_IP_ADDRESS end if GAME_SETTINGS.hostPort == nil then GAME_SETTINGS.hostPort = "22122" end if GAME_SETTINGS.FullScreen == nil then GAME_SETTINGS.FullScreen = false end if GAME_SETTINGS.HighScore == nil then GAME_SETTINGS.HighScore = 0 end -- Set the gloal player name to the new value CURRENT_PLAYER_NAME = GAME_SETTINGS.PlayerName end function functions.SaveGame() -- uses the globals because too hard to pass params --! for some reason bitser throws runtime error when serialising true / false values. local savefile local contents local success, message local savedir = love.filesystem.getSource() savefile = savedir .. "/" .. "landers.dat" serialisedString = Bitser.dumps(LANDERS) success, message = Nativefs.write(savefile, serialisedString ) savefile = savedir .. "/" .. "ground.dat" serialisedString = Bitser.dumps(GROUND) success, message = Nativefs.write(savefile, serialisedString ) savefile = savedir .. "/" .. "objects.dat" serialisedString = Bitser.dumps(OBJECTS) success, message = Nativefs.write(savefile, serialisedString ) LovelyToasts.show("Game saved",3, "middle") end function functions.LoadGame() local savedir = love.filesystem.getSource() love.filesystem.setIdentity( savedir ) local savefile local contents local size local error = false savefile = savedir .. "/" .. "ground.dat" if Nativefs.getInfo(savefile) then contents, size = Nativefs.read(savefile) GROUND = bitser.loads(contents) else error = true end savefile = savedir .. "/" .. "objects.dat" if Nativefs.getInfo(savefile) then contents, size = Nativefs.read(savefile) OBJECTS = bitser.loads(contents) else error = true end savefile = savedir .. "/" .. "landers.dat" if Nativefs.getInfo(savefile) then contents, size = Nativefs.read(savefile) LANDERS = bitser.loads(contents) else error = true end if error then -- a file is missing, so display a popup on a new game Fun.ResetGame() LovelyToasts.show("ERROR: Unable to load game!", 3, "middle") end end function functions.CalculateScore() local score = LANDERS[1].x - ORIGIN_X if score > GAME_SETTINGS.HighScore then GAME_SETTINGS.HighScore = score Fun.SaveGameSettings() -- this needs to be refactored somehow, not save every change end return score end function functions.GetDistanceToClosestBase(xvalue, intBaseType) -- returns two values: the distance to the closest base, and the object/table item for that base -- if there are no bases (impossible) then the distance value returned will be -1 -- note: if distance is a negative value then the Lander has not yet passed the base local closestdistance = -1 local closestbase = {} local absdist local dist local realdist for k,v in pairs(OBJECTS) do if v.objecttype == intBaseType then -- the + bit is an offset to calculate the landing pad and not the image absdist = math.abs(xvalue - (v.x + 85)) -- same but without the math.abs) dist = (xvalue - (v.x + 85)) if closestdistance == -1 or absdist <= closestdistance then closestdistance = absdist closestbase = v end end end -- now we have the closest base, work out the distance to the landing pad for that base if closestbase then -- the + bit is an offset to calculate the landing pad and not the image realdist = xvalue - (closestbase.x + 85) end return realdist, closestbase end function functions.ResetGame() -- this resets the game for all landers - including multiplayer landers GROUND = {} OBJECTS = {} -- TODO: don't reset whole table but instead reset status, fuel amounts etc. Smoke.destroy() -- ensure Terrain.init appears before Lander.create Terrain.init() -- TODO: mplayer needs to reset without wiping LANDERS -- or to wipe LANDERS and recreate each client if not ENET_IS_CONNECTED then LANDERS = {} table.insert(LANDERS, Lander.create()) end end return functions
25.687747
108
0.699031
9c01ccc2ab92340744adfed9d7b0e12ee27e2524
7,932
ts
TypeScript
src/services/redis/RedisMeshService.ts
GostarehNegar/tomcat
814de831f5a8202249b9d11f0771bdba2ae14fec
[ "MIT" ]
null
null
null
src/services/redis/RedisMeshService.ts
GostarehNegar/tomcat
814de831f5a8202249b9d11f0771bdba2ae14fec
[ "MIT" ]
1
2021-09-18T09:07:38.000Z
2021-09-18T09:07:38.000Z
src/services/redis/RedisMeshService.ts
GostarehNegar/tomcat
814de831f5a8202249b9d11f0771bdba2ae14fec
[ "MIT" ]
null
null
null
import utils from '../../common/Domain.Utils'; import { IRedisServiceInformationParameters, queryRedisOptionsPayload, redisServiceDefinition } from '../../contracts'; import { baseUtils, ILogger } from '../../infrastructure/base'; import { IMessageContext } from '../../infrastructure/bus'; import { IMeshService, IMeshServiceContext, matchService, ServiceCategories, ServiceDefinition, ServiceInformation, ServiceStatus } from '../../infrastructure/mesh'; import { MeshServiceContext } from '../../infrastructure/mesh/MeshServiceContext'; import { RedisClientOptions, RedisUtils } from '../../infrastructure/services'; import { IProcess, IProcessManager } from '../../infrastructure/services/processManager/IProcessManager'; export type redisInfo = { dataDrirectory: string, portNumber: string, containerID: string, } /** * Provides redis as a mesh service. This is used * by redis nodes to provide redis services. */ export class RedisMeshService implements IMeshService { public process: IProcess; public isReady: boolean; public status: ServiceStatus = 'unknown'; public Id: string = baseUtils.UUID(); public logger: ILogger; private static _instances: RedisMeshService[] = []; public definition: redisServiceDefinition; private info: IRedisServiceInformationParameters = { schema: '' }; constructor(public def: ServiceDefinition) { this.definition = def as redisServiceDefinition; this.logger = baseUtils.getLogger("RedisService"); } async startWithRedisServer(manager: IProcessManager, name: string, port: number, dir: string): Promise<IProcess> { //var dir = await utils.getRedisDataDirectory(name); const redis_server = await RedisUtils.InstallRedis(); this.process = manager.create(name) .spawn(redis_server, ['--port', port.toString(), '--dir', dir]); return this.process; } async startWithDocker(manager: IProcessManager, name: string, port: number, dir: string): Promise<IProcess> { //var dir = await utils.getRedisDataDirectory(name); this.process = manager.create(name) .spawn("docker", ["run", "-d", "-p", `${port}:6379`, "-v", `${dir}:/data`, "--name", name, "redis"]); return this.process; } async start(ctx?: IMeshServiceContext): Promise<unknown> { (ctx) if (this.status !== 'start') { try { this.logger.info( `Trying to provision redis service. Params:${this.definition.parameters}` ) const in_docker = await utils.isInDocker(); const exclusive = this.definition.parameters.server_name; if (exclusive && exclusive != "") { // We should spin up a new instance of // redis. this.info.port = (await utils.findPort(6300, 6400)); this.info.schema = this.definition.parameters.schema; this.info.dataPath = await utils.getRedisDataDirectory(this.definition.parameters.server_name); this.info.server_name = this.definition.parameters.server_name; } else { // We do not need a new instance of redis if there // exists one. this.info.port = 6379; this.info.dataPath = await utils.getRedisDataDirectory('redis'); this.info.schema = this.definition.parameters.schema || 'default-perfix'; this.info.server_name = "redis-default-server" } /// /// At this point we know that we need redis /// localhost:port /// if we have this redis instance we do not need /// a new one. var redis_factory = ctx.ServiceProvider.getRedisFactory(); const process_name = this.info.server_name; const processManager = ctx.ServiceProvider.getProcessManager(); this.process = processManager.getChilds().firstOrDefault(x => x.name == process_name); if (!this.process) { if (in_docker) { // We are in docker. let redis_info = await redis_factory.getRedisInfo('redis', this.info.port); if (!redis_info) { redis_info = await redis_factory.getRedisInfo('localhost', this.info.port); if (!redis_info) { this.process = await this .startWithRedisServer(processManager, process_name, this.info.port, this.info.dataPath); } this.info.host = utils.ipAddress(); } else { /// We are in a docker environment /// where redis is exposed as a service. this.info.host = 'redis'; } } else { this.process = await this.startWithDocker(processManager, process_name, this.info.port, this.info.dataPath); } } this.status = 'start'; this.logger.info( `redis service successfully provisioned. Info:${this.getInformation()}` ) } catch (err) { this.logger.error( `An error occured while trying to spawn a new redis instance. Err:${err}`) } } return this.getInformation(); } getInformation(): ServiceInformation { return { category: "redis" as ServiceCategories, parameters: this.info, status: this.status }; } /** * Gets or Creates a 'RedisMeshService' based on the required service definition. * It creates a new redis if the rquiremens cannnot be fullfilled with the existing * connections. * @param definition */ public static GetOrCreate(definition: redisServiceDefinition): RedisMeshService { (definition); (this._instances); let service: RedisMeshService = null; for (let idx = 0; idx < this._instances.length; idx++) { const _service = this._instances[idx]; const matches = matchService(_service.getInformation(), definition); if (matches) { service = _service; break; } } if (!service) { service = new RedisMeshService(definition); this._instances.push(service); } return service; } /** * Handles a queryRedisOptions request and provides * @param request */ public static async handle(ctx: IMessageContext) { var request = ctx.message.cast<queryRedisOptionsPayload>(); if (!request || !request.schema || request.schema === '') { throw utils.toException('invalid request.') } // let service: RedisMeshService = null; var service = this.GetOrCreate({ category: 'redis', parameters: { schema: request.schema, server_name: request.server_name } }) if (!service) { throw utils.toException("Unexpcted Error: Failed to add the required redis-service'"); } await service.start(new MeshServiceContext(ctx.serviceProvider, null, service)) var options: RedisClientOptions = { host: service.info.host, port: service.info.port, keyPrefix: service.info.schema + ':' }; return options; } }
42.875676
165
0.56291
aa24443bb749dfacd907166b6e4b16002dace754
2,019
sql
SQL
tx-lcn/sql/tx-manager.sql
bijialin/spring-boot
912021c718a163919fefe83650f67ad0b2743351
[ "MIT" ]
3
2019-05-15T02:19:28.000Z
2019-08-22T07:15:30.000Z
tx-lcn/sql/tx-manager.sql
bijialin/spring-boot
912021c718a163919fefe83650f67ad0b2743351
[ "MIT" ]
null
null
null
tx-lcn/sql/tx-manager.sql
bijialin/spring-boot
912021c718a163919fefe83650f67ad0b2743351
[ "MIT" ]
22
2019-04-01T09:47:42.000Z
2020-05-26T01:32:49.000Z
/* Navicat Premium Data Transfer Source Server : localhost_mysql5.7.25_3306 Source Server Type : MySQL Source Server Version : 50725 Source Host : localhost:3306 Source Schema : tx-manager Target Server Type : MySQL Target Server Version : 50725 File Encoding : 65001 Date: 11/10/2019 18:26:00 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for t_logger -- ---------------------------- DROP TABLE IF EXISTS `t_logger`; CREATE TABLE `t_logger` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `group_id` varchar(64) NOT NULL, `unit_id` varchar(32) NOT NULL, `tag` varchar(50) NOT NULL, `content` varchar(1024) NOT NULL, `create_time` varchar(30) NOT NULL, `app_name` varchar(128) NOT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- ---------------------------- -- Table structure for t_tx_exception -- ---------------------------- DROP TABLE IF EXISTS `t_tx_exception`; CREATE TABLE `t_tx_exception` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `group_id` varchar(64) DEFAULT NULL, `unit_id` varchar(32) DEFAULT NULL, `mod_id` varchar(128) DEFAULT NULL, `transaction_state` tinyint(4) DEFAULT NULL, `registrar` tinyint(4) DEFAULT NULL, `remark` varchar(4096) DEFAULT NULL, `ex_state` tinyint(4) DEFAULT NULL COMMENT '0 未解决 1已解决', `create_time` datetime DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- ---------------------------- -- Table structure for t_user -- ---------------------------- DROP TABLE IF EXISTS `t_user`; CREATE TABLE `t_user` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL COMMENT '名称', `phone` varchar(11) DEFAULT NULL COMMENT '手机号', `create_time` datetime DEFAULT NULL COMMENT '创建时间', `update_time` datetime DEFAULT NULL COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; SET FOREIGN_KEY_CHECKS = 1;
30.590909
59
0.650817
9bc61862f218492d770215545d346d54d38d2a2d
560
js
JavaScript
client/src/components/SideBar/SideBar.js
clerick44/recipe-box
37305fb8ad14a426e2a19e3b51335d3c5c9e1647
[ "MIT" ]
null
null
null
client/src/components/SideBar/SideBar.js
clerick44/recipe-box
37305fb8ad14a426e2a19e3b51335d3c5c9e1647
[ "MIT" ]
1
2021-12-07T07:29:08.000Z
2021-12-07T07:29:08.000Z
client/src/components/SideBar/SideBar.js
clerick44/recipe-box
37305fb8ad14a426e2a19e3b51335d3c5c9e1647
[ "MIT" ]
null
null
null
import React from "react"; const SideBar = (props) => { const { recipes, setCurrentRecipe } = props; console.log(recipes.allRecipes); if (!recipes.allRecipes.length) { return <h3>No Recipes Yet</h3>; } return ( <> <h3>My Recipes</h3> <ul id="recipeList"> {recipes.allRecipes.map((recipe, index) => { return ( <li onClick={() => setCurrentRecipe(recipe)} key={index}> {recipe.recipeName} </li> ); })} </ul> </> ); }; export default SideBar;
20
69
0.523214
2346ade9d684554a7e35942f57f662edf93f6e73
5,187
sql
SQL
BAZA/stomatolog.sql
geralt1992/stomatolog
4302cbaede00243fe56d0ddf00c39f37279c3e9a
[ "MIT" ]
null
null
null
BAZA/stomatolog.sql
geralt1992/stomatolog
4302cbaede00243fe56d0ddf00c39f37279c3e9a
[ "MIT" ]
null
null
null
BAZA/stomatolog.sql
geralt1992/stomatolog
4302cbaede00243fe56d0ddf00c39f37279c3e9a
[ "MIT" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Feb 19, 2021 at 07:17 PM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `stomatolog` -- -- -------------------------------------------------------- -- -- Table structure for table `failed_jobs` -- CREATE TABLE `failed_jobs` ( `id` bigint(20) UNSIGNED NOT NULL, `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `failed_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `infos` -- CREATE TABLE `infos` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `subject` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `infos` -- INSERT INTO `infos` (`id`, `name`, `email`, `avatar`, `type`, `subject`, `created_at`, `updated_at`) VALUES (16, 'marin', 'marin.sabljo@gmail.com', NULL, 'upit', 'Genijalno!', '2020-04-05 16:31:08', '2020-04-05 16:31:08'), (17, 'Marin', 'crazy.mad.man@hotmail.com', 'marin.jpg', 'pohvala', 'Super ste', '2020-04-05 16:35:44', '2020-04-05 16:35:44'), (18, 'Nina', 'nina.boro96@gmail.com', 'nina.jpg', 'kritika', 'Najbolji ste!', '2020-04-05 16:41:26', '2020-04-05 16:41:26'), (20, 'karlo', 'karlo@gmail.com', 'avatar2.jpg', 'pohvala', 'Odličan site!', '2020-04-06 13:39:08', '2020-04-06 13:39:08'), (21, 'Rohana', 'rohana@gmail.com', 'avatar2.jpg', 'kritika', 'Nice!', '2020-04-06 13:41:17', '2020-04-06 13:41:17'), (22, 'mirko', 'mirko@gmail.com', 'avatar2.jpg', 'pohvala', 'Tko Vam je radio tu divnu stranicu!', '2020-04-06 13:43:37', '2020-04-06 13:43:37'), (23, 'MARIN SABLJO', 'marin.sabljo@gmail.com', 'avatar2.jpg', 'upit', 'Koliko koštate?', '2021-02-19 17:16:54', '2021-02-19 17:16:54'); -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1, '2014_10_12_000000_create_users_table', 1), (2, '2019_08_19_000000_create_failed_jobs_table', 1), (3, '2020_03_27_140218_create_infos_table', 1); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Indexes for dumped tables -- -- -- Indexes for table `failed_jobs` -- ALTER TABLE `failed_jobs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `infos` -- ALTER TABLE `infos` ADD PRIMARY KEY (`id`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `failed_jobs` -- ALTER TABLE `failed_jobs` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `infos` -- ALTER TABLE `infos` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; 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 */;
30.875
144
0.68209
94825baaeecb5f40524aa74a56f81bb192a4d26b
1,171
lua
Lua
Framework/EsoUi/pregame/characterselect/gamepad/characterselect_eventtile_gamepad.lua
martin-repo/eso-addon-framework
5a0873e624abee2b560b47cdd8571bb24b526663
[ "MIT" ]
3
2021-09-19T00:31:05.000Z
2021-12-22T07:30:15.000Z
Framework/EsoUi/pregame/characterselect/gamepad/characterselect_eventtile_gamepad.lua
martin-repo/eso-addon-framework
5a0873e624abee2b560b47cdd8571bb24b526663
[ "MIT" ]
null
null
null
Framework/EsoUi/pregame/characterselect/gamepad/characterselect_eventtile_gamepad.lua
martin-repo/eso-addon-framework
5a0873e624abee2b560b47cdd8571bb24b526663
[ "MIT" ]
null
null
null
--[[ This file was extracted by 'EsoLuaGenerator' at '2021-09-04 16:42:29' using the latest game version. NOTE: This file should only be used as IDE support; it should NOT be distributed with addons! **************************************************************************** CONTENTS OF THIS FILE IS COPYRIGHT ZENIMAX MEDIA INC. **************************************************************************** ]] ---- -- ZO_CharacterSelect_EventTile_Gamepad ---- -- Primary logic class must be subclassed after the platform class so that platform specific functions will have priority over the logic class functionality ZO_CharacterSelect_EventTile_Gamepad = ZO_Object.MultiSubclass(ZO_Tile_Gamepad, ZO_CharacterSelect_EventTile_Shared) function ZO_CharacterSelect_EventTile_Gamepad:New(...) return ZO_CharacterSelect_EventTile_Shared.New(self, ...) end function ZO_CharacterSelect_EventTile_Gamepad:Initialize(...) return ZO_CharacterSelect_EventTile_Shared.Initialize(self, ...) end ----- -- Global XML Functions ----- function ZO_CharacterSelect_EventTile_Gamepad_OnInitialized(control) ZO_CharacterSelect_EventTile_Gamepad:New(control) end
37.774194
156
0.694278
d80bafc67003c5fb5a6bfacefe1a8b8fb06f54da
5,009
swift
Swift
Tests/SwaggerStencilTests.swift
AphelionApps/SwaggerStencil
8104f5c27c85a9bbb65e8d1aac2000221a99d171
[ "MIT" ]
1
2020-02-02T09:49:12.000Z
2020-02-02T09:49:12.000Z
Tests/SwaggerStencilTests.swift
AttilaTheFun/SwaggerStencil
8104f5c27c85a9bbb65e8d1aac2000221a99d171
[ "MIT" ]
null
null
null
Tests/SwaggerStencilTests.swift
AttilaTheFun/SwaggerStencil
8104f5c27c85a9bbb65e8d1aac2000221a99d171
[ "MIT" ]
null
null
null
import XCTest import SwaggerParser import Yaml import PathKit import Stencil import StencilSwiftKit @testable import SwaggerStencil class SwaggerStencilTests: XCTestCase { var stencilExtension: Extension! var templateFolderPath: PathKit.Path! var mergedSwaggerPath: PathKit.Path! var golangSourceRoot: PathKit.Path! var golangRelativePath: PathKit.Path! var golangFullPath: PathKit.Path! var swiftProjectPath: PathKit.Path! override func setUp() { // Load extension: stencilExtension = Extension() stencilExtension.registerStencilSwiftExtensions() stencilExtension.registerCustomFilters() let fileURL = URL(fileURLWithPath: #file).deletingLastPathComponent() let projectRoot = fileURL.deletingLastPathComponent() templateFolderPath = Path(projectRoot.path) + "Templates" golangSourceRoot = "/Users/logan/src/go/src" golangRelativePath = "github.com/aphelionapps/grpc-snag/services" golangFullPath = golangSourceRoot + golangRelativePath swiftProjectPath = "/Users/Logan/src/ios/Snag/Snag" // swiftProjectPath = "/Users/Logan/src/ios/TreasureHunt/TreasureHunt" // mergedSwaggerPath = golangSourceRoot + "github.com/aphelionapps/snag/aphelionapps" // mergedSwaggerPath = "/Users/logan/src/ruby/treasurehunt-server" } func testGolang() throws { let packageName = "api" let fullPath = golangFullPath + packageName let relativePath = golangRelativePath + packageName let swagger = try self.loadSwagger(swaggerPath: fullPath, isYAML: false, fileName: "merged") // let swagger = try self.loadSwagger(swaggerPath: fullPath, isYAML: true, fileName: "swagger") let context = ["swagger": swagger, "path": relativePath] as [String : Any] let templatePath = templateFolderPath + "Go" try self.renderTemplates(templatePath: templatePath, outputPath: fullPath, fileExtension: ".go", context: context) } // func testSwift() throws { // let swagger = try self.loadSwagger(swaggerPath: mergedSwaggerPath, isYAML: false, fileName: "merged") // let swagger = try self.loadSwagger(swaggerPath: mergedSwaggerPath, isYAML: true, fileName: "swagger") // let context = ["swagger": swagger] as [String : Any] // let templatePath = templateFolderPath + "Swift" // self.renderTemplates(templatePath: templatePath, outputPath: swiftProjectPath, fileExtension: ".swift", // context: context) // } private func loadSwagger(swaggerPath: PathKit.Path, isYAML: Bool = true, fileName: String = "swagger") throws -> Swagger { let fileName = fileName + (isYAML ? ".yaml" : ".json") let swaggerFilePath = swaggerPath + fileName let swaggerString = try swaggerFilePath.read(.utf8) let jsonString: String if isYAML { let yaml = try Yaml.load(swaggerString) let dictionary = try yaml.toDictionary() let jsonData = try JSONSerialization.data(withJSONObject: dictionary, options: []) jsonString = String(data: jsonData, encoding: .utf8)! } else { jsonString = swaggerString } return try Swagger(from: jsonString) } private func renderTemplates( templatePath: PathKit.Path, outputPath: PathKit.Path, fileExtension: String, context: [String : Any]) throws { let importsPath = templatePath + "Imports" let includesPath = templatePath + "Includes" let packagesPath = templatePath + "Packages" let paths = [ importsPath, includesPath, packagesPath ] // Load environment: let loader = FileSystemLoader(paths: paths) let environment = Environment(loader: loader, extensions: [self.stencilExtension], templateClass: Template.self) // Generate the code: for packagePath in try packagesPath.children() where packagePath.isDirectory { let packageName = packagePath.lastComponent let generatedPackagePath = outputPath + packageName try generatedPackagePath.mkpath() let children = try packagePath.children() for filePath in children where filePath.lastComponent.hasSuffix(fileExtension) { let fileName = filePath.lastComponent let generatedFileName = generatedPackagePath + fileName let templateName = String(describing: Path(packageName) + fileName) let renderedTemplate = try environment.renderTemplate(name: templateName, context: context) print(renderedTemplate) try generatedFileName.write(renderedTemplate) } } } }
41.741667
113
0.643043
f01b631ccb3c9745b14e78ab1229248e5192b22d
613
js
JavaScript
lib/Deck.spec.js
enikolas/yet-another-cards
afe48ede91beeed4fbc7744f96188d1f05263133
[ "MIT" ]
1
2020-07-29T00:35:03.000Z
2020-07-29T00:35:03.000Z
lib/Deck.spec.js
enikolas/yet-another-cards
afe48ede91beeed4fbc7744f96188d1f05263133
[ "MIT" ]
9
2017-12-18T12:38:12.000Z
2020-05-11T17:14:39.000Z
lib/Deck.spec.js
enikolas/yet-another-cards
afe48ede91beeed4fbc7744f96188d1f05263133
[ "MIT" ]
null
null
null
'use strict' const Deck = require('./Deck') describe('Deck', () => { it('should create a deck', () => { const deck = new Deck() expect(deck).toMatchSnapshot() }) it('should shuffle the deck', () => { const deck = new Deck() deck.shuffle() expect(deck).not.toEqual(new Deck()) }) it('should draw a card from the deck', () => { const deck = new Deck() expect(deck.draw()).toMatchSnapshot() expect(deck).toMatchSnapshot() }) it('should return readable string of a deck', () => { const deck = new Deck() expect(deck.toString()).toMatchSnapshot() }) })
19.15625
55
0.585644
73b80dde7bc6148d329130e2a6ef980cff6b0524
8,728
rs
Rust
tests/test_iterator.rs
arthurprs/rust-rocksdb
ee4c6ebb162d67fb56c74476eb369a6bdbc3957b
[ "Apache-2.0" ]
null
null
null
tests/test_iterator.rs
arthurprs/rust-rocksdb
ee4c6ebb162d67fb56c74476eb369a6bdbc3957b
[ "Apache-2.0" ]
null
null
null
tests/test_iterator.rs
arthurprs/rust-rocksdb
ee4c6ebb162d67fb56c74476eb369a6bdbc3957b
[ "Apache-2.0" ]
null
null
null
// Copyright 2017 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // See the License for the specific language governing permissions and // limitations under the License. use rocksdb::*; use tempdir::TempDir; struct FixedSuffixTransform { pub suffix_len: usize, } impl SliceTransform for FixedSuffixTransform { fn transform<'a>(&mut self, key: &'a [u8]) -> &'a [u8] { &key[..self.suffix_len] } fn in_domain(&mut self, key: &[u8]) -> bool { key.len() >= self.suffix_len } } fn prev_collect<'a>(iter: &mut DBIterator<'a>) -> Vec<Kv> { let mut buf = vec![]; while iter.valid() { buf.push(iter.kv().unwrap()); iter.prev(); } buf } #[test] pub fn test_iterator() { let path = TempDir::new("_rust_rocksdb_iteratortest").expect(""); let k1 = b"k1"; let k2 = b"k2"; let k3 = b"k3"; let k4 = b"k4"; let v1 = b"v1111"; let v2 = b"v2222"; let v3 = b"v3333"; let v4 = b"v4444"; let db = DB::open_default(path.path().to_str().unwrap()).unwrap(); let p = db.put(k1, v1); assert!(p.is_ok()); let p = db.put(k2, v2); assert!(p.is_ok()); let p = db.put(k3, v3); assert!(p.is_ok()); let expected = vec![(k1.to_vec(), v1.to_vec()), (k2.to_vec(), v2.to_vec()), (k3.to_vec(), v3.to_vec())]; let mut iter = db.iter(); iter.seek(SeekKey::Start); assert_eq!(iter.collect::<Vec<_>>(), expected); // Test that it's idempotent iter.seek(SeekKey::Start); assert_eq!(iter.collect::<Vec<_>>(), expected); // Test it in reverse a few times iter.seek(SeekKey::End); let mut tmp_vec = prev_collect(&mut iter); tmp_vec.reverse(); assert_eq!(tmp_vec, expected); iter.seek(SeekKey::End); let mut tmp_vec = prev_collect(&mut iter); tmp_vec.reverse(); assert_eq!(tmp_vec, expected); // Try it forward again iter.seek(SeekKey::Start); assert_eq!(iter.collect::<Vec<_>>(), expected); iter.seek(SeekKey::Start); assert_eq!(iter.collect::<Vec<_>>(), expected); let mut old_iterator = db.iter(); old_iterator.seek(SeekKey::Start); let p = db.put(&*k4, &*v4); assert!(p.is_ok()); let expected2 = vec![(k1.to_vec(), v1.to_vec()), (k2.to_vec(), v2.to_vec()), (k3.to_vec(), v3.to_vec()), (k4.to_vec(), v4.to_vec())]; assert_eq!(old_iterator.collect::<Vec<_>>(), expected); iter = db.iter(); iter.seek(SeekKey::Start); assert_eq!(iter.collect::<Vec<_>>(), expected2); iter.seek(SeekKey::Key(k2)); let expected = vec![(k2.to_vec(), v2.to_vec()), (k3.to_vec(), v3.to_vec()), (k4.to_vec(), v4.to_vec())]; assert_eq!(iter.collect::<Vec<_>>(), expected); iter.seek(SeekKey::Key(k2)); let expected = vec![(k2.to_vec(), v2.to_vec()), (k1.to_vec(), v1.to_vec())]; assert_eq!(prev_collect(&mut iter), expected); iter.seek(SeekKey::Key(b"k0")); assert!(iter.valid()); iter.seek(SeekKey::Key(b"k1")); assert!(iter.valid()); iter.seek(SeekKey::Key(b"k11")); assert!(iter.valid()); iter.seek(SeekKey::Key(b"k5")); assert!(!iter.valid()); iter.seek(SeekKey::Key(b"k0")); assert!(iter.valid()); iter.seek(SeekKey::Key(b"k1")); assert!(iter.valid()); iter.seek(SeekKey::Key(b"k11")); assert!(iter.valid()); iter.seek(SeekKey::Key(b"k5")); assert!(!iter.valid()); iter.seek(SeekKey::Key(b"k4")); assert!(iter.valid()); iter.prev(); assert!(iter.valid()); iter.next(); assert!(iter.valid()); iter.next(); assert!(!iter.valid()); // Once iterator is invalid, it can't be reverted. iter.prev(); assert!(!iter.valid()); } #[test] fn test_seek_for_prev() { let path = TempDir::new("_rust_rocksdb_seek_for_prev").expect(""); let mut opts = Options::new(); opts.create_if_missing(true); { let db = DB::open(opts, path.path().to_str().unwrap()).unwrap(); let writeopts = WriteOptions::new(); db.put_opt(b"k1-0", b"a", &writeopts).unwrap(); db.put_opt(b"k1-1", b"b", &writeopts).unwrap(); db.put_opt(b"k1-3", b"d", &writeopts).unwrap(); let mut iter = db.iter(); iter.seek_for_prev(SeekKey::Key(b"k1-2")); assert!(iter.valid()); assert_eq!(iter.key(), b"k1-1"); assert_eq!(iter.value(), b"b"); let mut iter = db.iter(); iter.seek_for_prev(SeekKey::Key(b"k1-3")); assert!(iter.valid()); assert_eq!(iter.key(), b"k1-3"); assert_eq!(iter.value(), b"d"); let mut iter = db.iter(); iter.seek_for_prev(SeekKey::Start); assert!(iter.valid()); assert_eq!(iter.key(), b"k1-0"); assert_eq!(iter.value(), b"a"); let mut iter = db.iter(); iter.seek_for_prev(SeekKey::End); assert!(iter.valid()); assert_eq!(iter.key(), b"k1-3"); assert_eq!(iter.value(), b"d"); let mut iter = db.iter(); iter.seek_for_prev(SeekKey::Key(b"k0-0")); assert!(!iter.valid()); let mut iter = db.iter(); iter.seek_for_prev(SeekKey::Key(b"k2-0")); assert!(iter.valid()); assert_eq!(iter.key(), b"k1-3"); assert_eq!(iter.value(), b"d"); } } #[test] fn read_with_upper_bound() { let path = TempDir::new("_rust_rocksdb_read_with_upper_bound_test").expect(""); let mut opts = Options::new(); opts.create_if_missing(true); { let db = DB::open(opts, path.path().to_str().unwrap()).unwrap(); let writeopts = WriteOptions::new(); db.put_opt(b"k1-0", b"a", &writeopts).unwrap(); db.put_opt(b"k1-1", b"b", &writeopts).unwrap(); db.put_opt(b"k2-0", b"c", &writeopts).unwrap(); let mut readopts = ReadOptions::new(); readopts.set_iterate_upper_bound(b"k2"); let mut iter = db.iter_opt(readopts); iter.seek(SeekKey::Start); let mut count = 0; while iter.valid() { count += 1; if !iter.next() { break; } } assert_eq!(count, 2); } } #[test] fn test_total_order_seek() { let path = TempDir::new("_rust_rocksdb_total_order_seek").expect(""); let mut bbto = BlockBasedOptions::new(); bbto.set_bloom_filter(10, false); bbto.set_whole_key_filtering(false); let mut opts = Options::new(); opts.create_if_missing(true); opts.set_block_based_table_factory(&bbto); opts.set_prefix_extractor("FixedSuffixTransform", Box::new(FixedSuffixTransform { suffix_len: 2 })) .unwrap(); // also create prefix bloom for memtable opts.set_memtable_prefix_bloom_size_ratio(0.1 as f64); let keys = vec![b"k1-0", b"k1-1", b"k1-2", b"k2-0", b"k2-1", b"k2-2", b"k3-0", b"k3-1", b"k3-2"]; let db = DB::open(opts, path.path().to_str().unwrap()).unwrap(); let wopts = WriteOptions::new(); // sst1 db.put_opt(b"k1-0", b"a", &wopts).unwrap(); db.put_opt(b"k1-1", b"b", &wopts).unwrap(); db.put_opt(b"k1-2", b"c", &wopts).unwrap(); db.flush(true /* sync */).unwrap(); // flush memtable to sst file. // sst2 db.put_opt(b"k2-0", b"a", &wopts).unwrap(); db.put_opt(b"k2-1", b"b", &wopts).unwrap(); db.put_opt(b"k2-2", b"c", &wopts).unwrap(); db.flush(true /* sync */).unwrap(); // flush memtable to sst file. // memtable db.put_opt(b"k3-0", b"a", &wopts).unwrap(); db.put_opt(b"k3-1", b"b", &wopts).unwrap(); db.put_opt(b"k3-2", b"c", &wopts).unwrap(); let mut iter = db.iter(); iter.seek(SeekKey::Key(b"k1-0")); let mut key_count = 0; while iter.valid() { // only iterator sst files and memtable that contain keys has the same prefix with b"k1-0". assert_eq!(keys[key_count], iter.key()); key_count = key_count + 1; iter.next(); } assert!(key_count == 3); let mut ropts = ReadOptions::new(); ropts.set_total_order_seek(true); let mut iter = db.iter_opt(ropts); iter.seek(SeekKey::Key(b"k1-0")); let mut key_count = 0; while iter.valid() { // iterator all sst files and memtables assert_eq!(keys[key_count], iter.key()); key_count = key_count + 1; iter.next(); } assert!(key_count == 9); }
31.395683
99
0.574358
0a1ef735deeec04333c2ee7c8d4a04158a1b6421
24,607
c
C
player/source/mod_channel.c
AntonioND/umod-player
9200027a3b6cb70f4efef38012dbd916fa3606fa
[ "MIT" ]
7
2021-02-16T00:09:03.000Z
2021-07-15T06:46:03.000Z
player/source/mod_channel.c
AntonioND/umod-player
9200027a3b6cb70f4efef38012dbd916fa3606fa
[ "MIT" ]
null
null
null
player/source/mod_channel.c
AntonioND/umod-player
9200027a3b6cb70f4efef38012dbd916fa3606fa
[ "MIT" ]
1
2022-02-02T18:49:13.000Z
2022-02-02T18:49:13.000Z
// SPDX-License-Identifier: MIT // // Copyright (c) 2021 Antonio Niño Díaz #include <assert.h> #include <stdint.h> #include <string.h> #include <umod/umod.h> #include <umod/umodpack.h> #include "definitions.h" #include "mixer_channel.h" #include "mod_channel.h" typedef struct { int note; int32_t amiga_period; int volume; umodpack_instrument *instrument_pointer; int panning; // 0...255 = left...right int effect; int effect_params; int arpeggio_tick; int vibrato_tick; int vibrato_args; int tremolo_tick; int tremolo_args; int retrig_tick; int32_t porta_to_note_target_amiga_period; int porta_to_note_speed; const int16_t *vibrato_wave_table; int vibrato_retrigger; const int16_t *tremolo_wave_table; int tremolo_retrigger; int delayed_note; int delayed_volume; umodpack_instrument *delayed_instrument; uint32_t sample_offset; // Used for "Set Offset" effect mixer_channel_info *ch; } mod_channel_info; static mod_channel_info mod_channel[UMOD_SONG_CHANNELS]; // Taken from FMODDOC.TXT static const int16_t vibrato_tremolo_wave_sine[64] = { 0, 24, 49, 74, 97, 120, 141, 161, 180, 197, 212, 224, 235, 244, 250, 253, 255, 253, 250, 244, 235, 224, 212, 197, 180, 161, 141, 120, 97, 74, 49, 24, 0, -24, -49, -74, -97, -120, -141, -161, -180, -197, -212, -224, -235, -244, -250, -253, -255, -253, -250, -244, -235, -224, -212, -197, -180, -161, -141, -120, -97, -74, -49, -24 }; // for (int i = 0; i < 64; i++) // printf("%d, ", 256 - (i + 1) * 8); static const int16_t vibrato_tremolo_wave_ramp[64] = { 248, 240, 232, 224, 216, 208, 200, 192, 184, 176, 168, 160, 152, 144, 136, 128, 120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0, -8, -16, -24, -32, -40, -48, -56, -64, -72, -80, -88, -96, -104, -112, -120, -128, -136, -144, -152, -160, -168, -176, -184, -192, -200, -208, -216, -224, -232, -240, -248, -256 }; // for (int i = 0; i < 64; i++) // printf("%d, ", i < 32 ? 255 : -255); static const int16_t vibrato_tremolo_wave_square[64] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255, -255 }; // for (int i = 0; i < 64; i++) // printf("%d, ", (rand() & 511) - 256); static const int16_t vibrato_tremolo_wave_random[64] = { 103, 198, -151, -141, -175, -1, -182, -20, 41, -51, -70, 171, 242, -5, 227, 70, -132, -62, -172, 248, 27, 232, 231, 141, 118, 90, 46, -157, -205, 159, -55, 154, 102, 50, -243, 183, -207, -168, -93, 90, 37, 93, 5, 23, -168, -23, -162, -44, 171, -78, -51, -58, -101, -76, -172, -239, -242, 130, -140, -191, 33, 61, 220, -121 }; void ModChannelReset(int channel) { assert(channel < UMOD_SONG_CHANNELS); mod_channel_info *mod_ch = &mod_channel[channel]; mod_ch->note = -1; mod_ch->volume = -1; mod_ch->instrument_pointer = NULL; mod_ch->effect = EFFECT_NONE; mod_ch->effect_params = -1; mod_ch->panning = 128; // Middle mod_ch->ch = MixerChannelGetFromIndex(channel); assert(mod_ch->ch != NULL); MixerChannelStop(mod_ch->ch); } void ModChannelResetAll(void) { for (int i = 0; i < UMOD_SONG_CHANNELS; i++) ModChannelReset(i); } void UMOD_Song_SetMasterVolume(int volume) { if (volume > 256) volume = 256; else if (volume < 0) volume = 0; // Refresh volume of all channels for (int i = 0; i < UMOD_SONG_CHANNELS; i++) { mod_channel_info *mod_ch = &mod_channel[i]; mixer_channel_info *mixer_ch = mod_ch->ch; MixerChannelSetMasterVolume(mixer_ch, volume); } } // Table taken from: // // https://github.com/OpenMPT/openmpt/blob/818b2c101d2256a430291ddcbcb47edd7e762308/soundlib/Tables.cpp#L272-L290 // static const uint16_t finetuned_period_table[16][12] = { // Values for octave 0. Divide by 2 to get octave 1, by 4 to get octave 2... // C C# D D# E F F# G G# A A# B { 1712, 1616, 1524, 1440, 1356, 1280, 1208, 1140, 1076, 1016, 960, 907 }, { 1700, 1604, 1514, 1430, 1348, 1274, 1202, 1134, 1070, 1010, 954, 900 }, { 1688, 1592, 1504, 1418, 1340, 1264, 1194, 1126, 1064, 1004, 948, 894 }, { 1676, 1582, 1492, 1408, 1330, 1256, 1184, 1118, 1056, 996, 940, 888 }, { 1664, 1570, 1482, 1398, 1320, 1246, 1176, 1110, 1048, 990, 934, 882 }, { 1652, 1558, 1472, 1388, 1310, 1238, 1168, 1102, 1040, 982, 926, 874 }, { 1640, 1548, 1460, 1378, 1302, 1228, 1160, 1094, 1032, 974, 920, 868 }, { 1628, 1536, 1450, 1368, 1292, 1220, 1150, 1086, 1026, 968, 914, 862 }, { 1814, 1712, 1616, 1524, 1440, 1356, 1280, 1208, 1140, 1076, 1016, 960 }, { 1800, 1700, 1604, 1514, 1430, 1350, 1272, 1202, 1134, 1070, 1010, 954 }, { 1788, 1688, 1592, 1504, 1418, 1340, 1264, 1194, 1126, 1064, 1004, 948 }, { 1774, 1676, 1582, 1492, 1408, 1330, 1256, 1184, 1118, 1056, 996, 940 }, { 1762, 1664, 1570, 1482, 1398, 1320, 1246, 1176, 1110, 1048, 988, 934 }, { 1750, 1652, 1558, 1472, 1388, 1310, 1238, 1168, 1102, 1040, 982, 926 }, { 1736, 1640, 1548, 1460, 1378, 1302, 1228, 1160, 1094, 1032, 974, 920 }, { 1724, 1628, 1536, 1450, 1368, 1292, 1220, 1150, 1086, 1026, 968, 914 } }; static uint32_t ModNoteToAmigaPeriod(int note_index, int finetune) { int octave = note_index / 12; int note = note_index % 12; uint32_t amiga_period = finetuned_period_table[finetune][note] >> octave; return amiga_period; } static uint64_t convert_constant; void ModSetSampleRateConvertConstant(uint32_t sample_rate) { convert_constant = ((uint64_t)sample_rate << 34) / 14318181; } // Returns the number of ticks needed to increase the sample read pointer in an // instrument. For example, if it returns 4.5, the pointer in the instrument // must be increased after every 4.5 samples that the global mixer generates. // // It returns a fixed point number in 32.32 format. // // This function is in ARM because ARM has support for long multiplies, unlike // Thumb, so it is faster. ARM_CODE static uint64_t ModGetSampleTickPeriod(int note_index, int finetune) { int octave = note_index / 12; int note = note_index % 12; uint32_t amiga_period = finetuned_period_table[finetune][note]; // To convert from this to Hz, do: // // Frequency (Hz) [PAL Value] = 7093789.2 / (Amiga Period * 2) // Frequency (Hz) [NTSC Value] = 7159090.5 / (Amiga Period * 2) // // It looks like the NTSC value is the most popular one to use. // // Then, to convert to sample tick period: // // Period (Samples) = Sample Rate / Frequency // // Result: // // Period (Samples) = (Sample Rate * Amiga Period * 2) / 7159090.5 // // Period (Samples) = Amiga Period * ((Sample Rate * 2) / 7159090.5) // // On the other hand, to calculate the period of an arbitrary octave from // the values of octave 0 it is needed to divide by 2: // // C1 = C0 / 2 ; C2 = C0 / 4 ; etc // Sample Rate * 2 // Period (Sample) = (Amiga Period [Octave 0] * ---------------) >> octave // 7159090.5 // // Sample Rate * 4 // Period (Sample) = (Amiga Period [Octave 0] * ---------------) >> octave // 14318181 // // As the returned value needs to be 32.32 fixed point: // // Period (Sample) [Fixed Point] = Period (Sample) << 32 // // Sample Rate << 34 // Period (Sample) = (Amiga Period [Octave 0] * -----------------) >> octave // 14318181 uint64_t sample_tick_period = (amiga_period * convert_constant) >> octave; return sample_tick_period; } ARM_CODE static uint64_t ModGetSampleTickPeriodFromAmigaPeriod(uint32_t amiga_period) { uint64_t sample_tick_period = amiga_period * convert_constant; return sample_tick_period; } void ModChannelSetNote(int channel, int note) { assert(channel < UMOD_SONG_CHANNELS); mod_channel_info *mod_ch = &mod_channel[channel]; assert(mod_ch->ch != NULL); mod_ch->note = note; mod_ch->vibrato_tick = 0; int finetune = 0; if (mod_ch->instrument_pointer != NULL) finetune = mod_ch->instrument_pointer->finetune; // TODO: Finetune from effect uint64_t period = ModGetSampleTickPeriod(note, finetune); MixerChannelSetNotePeriod(mod_ch->ch, period); uint32_t amiga_period = ModNoteToAmigaPeriod(note, 0); mod_ch->amiga_period = amiga_period; } void ModChannelSetVolume(int channel, int volume) { assert(channel < UMOD_SONG_CHANNELS); mod_channel_info *mod_ch = &mod_channel[channel]; assert(mod_ch->ch != NULL); mod_ch->volume = volume; MixerChannelSetVolume(mod_ch->ch, mod_ch->volume); } void ModChannelSetInstrument(int channel, umodpack_instrument *instrument_pointer) { assert(channel < UMOD_SONG_CHANNELS); mod_channel_info *mod_ch = &mod_channel[channel]; assert(mod_ch->ch != NULL); mod_ch->instrument_pointer = instrument_pointer; MixerChannelSetInstrument(mod_ch->ch, mod_ch->instrument_pointer); } void ModChannelSetEffectDelayNote(int channel, int effect_params, int note, int volume, umodpack_instrument *instrument) { assert(channel < UMOD_SONG_CHANNELS); mod_channel_info *mod_ch = &mod_channel[channel]; mod_ch->effect = EFFECT_DELAY_NOTE; mod_ch->effect_params = effect_params; mod_ch->delayed_note = note; mod_ch->delayed_volume = volume; mod_ch->delayed_instrument = instrument; } void ModChannelSetEffect(int channel, int effect, int effect_params, int note) { assert(channel < UMOD_SONG_CHANNELS); mod_channel_info *mod_ch = &mod_channel[channel]; assert(mod_ch->ch != NULL); if ((mod_ch->effect == EFFECT_ARPEGGIO) && (effect != EFFECT_ARPEGGIO)) { // Make sure that after an arpeggio effect, if there is no new arpeggio // effect, the note always goes back to the base frequency. This happens // only if no new note has been specified. if (note < 0) { int finetune = 0; if (mod_ch->instrument_pointer != NULL) finetune = mod_ch->instrument_pointer->finetune; // TODO: Finetune from effect uint64_t period = ModGetSampleTickPeriod(mod_ch->note, finetune); MixerChannelSetNotePeriod(mod_ch->ch, period); uint32_t amiga_period = ModNoteToAmigaPeriod(mod_ch->note, 0); mod_ch->amiga_period = amiga_period; } } mod_ch->effect = effect; mod_ch->effect_params = effect_params; if (effect == EFFECT_NONE) { return; } else if (effect == EFFECT_SET_PANNING) { mod_ch->panning = effect_params; MixerChannelSetPanning(mod_ch->ch, mod_ch->panning); } else if (effect == EFFECT_ARPEGGIO) { mod_ch->arpeggio_tick = 0; } else if (effect == EFFECT_PORTA_TO_NOTE) { if (effect_params != 0) { uint32_t amiga_period = ModNoteToAmigaPeriod(note, 0); mod_ch->porta_to_note_target_amiga_period = amiga_period; mod_ch->porta_to_note_speed = effect_params; } } else if ((effect == EFFECT_VIBRATO) || (effect == EFFECT_VIBRATO_VOL_SLIDE)) { if ((note >= 0) && (mod_ch->vibrato_retrigger != 0)) mod_ch->vibrato_tick = 0; if (effect == EFFECT_VIBRATO) { if (effect_params != 0) mod_ch->vibrato_args = effect_params; } } else if (effect == EFFECT_TREMOLO) { if ((note >= 0) && (mod_ch->tremolo_retrigger != 0)) mod_ch->tremolo_tick = 0; if (effect_params != 0) mod_ch->tremolo_args = effect_params; } else if (effect == EFFECT_RETRIG_NOTE) { mod_ch->retrig_tick = 0; } else if (effect == EFFECT_VIBRATO_WAVEFORM) { mod_ch->vibrato_retrigger = 1; if (effect_params & (1 << 2)) mod_ch->vibrato_retrigger = 0; effect_params &= 3; if (effect_params == 0) mod_ch->vibrato_wave_table = &vibrato_tremolo_wave_sine[0]; else if (effect_params == 1) mod_ch->vibrato_wave_table = &vibrato_tremolo_wave_ramp[0]; else if (effect_params == 2) mod_ch->vibrato_wave_table = &vibrato_tremolo_wave_square[0]; else if (effect_params == 3) mod_ch->vibrato_wave_table = &vibrato_tremolo_wave_random[0]; } else if (effect == EFFECT_TREMOLO_WAVEFORM) { mod_ch->tremolo_retrigger = 1; if (effect_params & (1 << 2)) mod_ch->tremolo_retrigger = 0; effect_params &= 3; if (effect_params == 0) mod_ch->tremolo_wave_table = &vibrato_tremolo_wave_sine[0]; else if (effect_params == 1) mod_ch->tremolo_wave_table = &vibrato_tremolo_wave_ramp[0]; else if (effect_params == 2) mod_ch->tremolo_wave_table = &vibrato_tremolo_wave_square[0]; else if (effect_params == 3) mod_ch->tremolo_wave_table = &vibrato_tremolo_wave_random[0]; } // TODO } // Update effects for Ticks == 0 void ModChannelUpdateAllTick_T0(void) { for (size_t c = 0; c < UMOD_SONG_CHANNELS; c++) { mod_channel_info *mod_ch = &mod_channel[c]; assert(mod_ch->ch != NULL); if (mod_ch->effect == EFFECT_CUT_NOTE) { if (mod_ch->effect_params == 0) { mod_ch->effect = EFFECT_NONE; MixerChannelSetVolume(mod_ch->ch, 0); } continue; } else if (mod_ch->effect == EFFECT_ARPEGGIO) { int note = mod_ch->note; if (mod_ch->arpeggio_tick == 0) { mod_ch->arpeggio_tick++; } else if (mod_ch->arpeggio_tick == 1) { note += mod_ch->effect_params >> 4; mod_ch->arpeggio_tick++; } else if (mod_ch->arpeggio_tick == 2) { note += mod_ch->effect_params & 0xF; mod_ch->arpeggio_tick = 0; } int finetune = 0; if (mod_ch->instrument_pointer != NULL) finetune = mod_ch->instrument_pointer->finetune; // TODO: Finetune from effect uint64_t period = ModGetSampleTickPeriod(note, finetune); MixerChannelSetNotePeriod(mod_ch->ch, period); uint32_t amiga_period = ModNoteToAmigaPeriod(note, 0); mod_ch->amiga_period = amiga_period; continue; } else if (mod_ch->effect == EFFECT_FINE_VOLUME_SLIDE) { int volume = mod_ch->volume + (int8_t)mod_ch->effect_params; if (volume > 255) volume = 255; if (volume < 0) volume = 0; if (volume != mod_ch->volume) { mod_ch->volume = volume; MixerChannelSetVolume(mod_ch->ch, volume); } continue; } else if (mod_ch->effect == EFFECT_FINE_PORTA_UP) { mod_ch->amiga_period -= (uint8_t)mod_ch->effect_params; if (mod_ch->amiga_period < 1) mod_ch->amiga_period = 1; uint64_t period; period = ModGetSampleTickPeriodFromAmigaPeriod(mod_ch->amiga_period); MixerChannelSetNotePeriod(mod_ch->ch, period); continue; } else if (mod_ch->effect == EFFECT_FINE_PORTA_DOWN) { mod_ch->amiga_period += (uint8_t)mod_ch->effect_params; uint64_t period; period = ModGetSampleTickPeriodFromAmigaPeriod(mod_ch->amiga_period); MixerChannelSetNotePeriod(mod_ch->ch, period); continue; } else if (mod_ch->effect == EFFECT_SAMPLE_OFFSET) { uint32_t offset = mod_ch->effect_params << 8; if (offset == 0) { // Reload the last value used. If this effect was used // before, there will be an offset. If not, it will be 0. offset = mod_ch->sample_offset; } else { mod_ch->sample_offset = offset; } MixerChannelSetSampleOffset(mod_ch->ch, offset); continue; } else if (mod_ch->effect == EFFECT_RETRIG_NOTE) { if (mod_ch->retrig_tick >= mod_ch->effect_params) { mod_ch->retrig_tick = 0; MixerChannelSetSampleOffset(mod_ch->ch, 0); } mod_ch->retrig_tick++; continue; } else if (mod_ch->effect == EFFECT_DELAY_NOTE) { if (mod_ch->effect_params == 0) { if (mod_ch->delayed_instrument != NULL) ModChannelSetInstrument(c, mod_ch->delayed_instrument); if (mod_ch->delayed_note != -1) ModChannelSetNote(c, mod_ch->delayed_note); if (mod_ch->delayed_volume != -1) ModChannelSetVolume(c, mod_ch->delayed_volume); mod_ch->effect = EFFECT_NONE; } continue; } } } // Update effects for Ticks > 0 void ModChannelUpdateAllTick_TN(int tick_number) { for (size_t c = 0; c < UMOD_SONG_CHANNELS; c++) { mod_channel_info *mod_ch = &mod_channel[c]; assert(mod_ch->ch != NULL); if (mod_ch->effect == EFFECT_CUT_NOTE) { if (mod_ch->effect_params == tick_number) { mod_ch->effect = EFFECT_NONE; MixerChannelSetVolume(mod_ch->ch, 0); } continue; } else if (mod_ch->effect == EFFECT_ARPEGGIO) { int note = mod_ch->note; if (mod_ch->arpeggio_tick == 0) { mod_ch->arpeggio_tick++; } else if (mod_ch->arpeggio_tick == 1) { note += mod_ch->effect_params >> 4; mod_ch->arpeggio_tick++; } else if (mod_ch->arpeggio_tick == 2) { note += mod_ch->effect_params & 0xF; mod_ch->arpeggio_tick = 0; } int finetune = 0; if (mod_ch->instrument_pointer != NULL) finetune = mod_ch->instrument_pointer->finetune; // TODO: Finetune from effect uint64_t period = ModGetSampleTickPeriod(note, finetune); MixerChannelSetNotePeriod(mod_ch->ch, period); uint32_t amiga_period = ModNoteToAmigaPeriod(note, 0); mod_ch->amiga_period = amiga_period; continue; } else if (mod_ch->effect == EFFECT_PORTA_UP) { mod_ch->amiga_period -= (uint8_t)mod_ch->effect_params; if (mod_ch->amiga_period < 1) mod_ch->amiga_period = 1; uint64_t period; period = ModGetSampleTickPeriodFromAmigaPeriod(mod_ch->amiga_period); MixerChannelSetNotePeriodPorta(mod_ch->ch, period); continue; } else if (mod_ch->effect == EFFECT_PORTA_DOWN) { mod_ch->amiga_period += (uint8_t)mod_ch->effect_params; uint64_t period; period = ModGetSampleTickPeriodFromAmigaPeriod(mod_ch->amiga_period); MixerChannelSetNotePeriodPorta(mod_ch->ch, period); continue; } else if (mod_ch->effect == EFFECT_TREMOLO) { int speed = mod_ch->tremolo_args >> 4; int depth = mod_ch->tremolo_args & 0xF; mod_ch->tremolo_tick = (mod_ch->tremolo_tick + speed) & 63; int sine = mod_ch->tremolo_wave_table[mod_ch->tremolo_tick]; // Divide by 64, but multiply by 4 (Volume goes from 0 to 255, // but it goes from 0 to 64 in the MOD format). int value = (sine * depth) >> (6 - 2); int volume = mod_ch->volume + value; if (volume < 0) volume = 0; else if (volume > 255) volume = 255; MixerChannelSetVolume(mod_ch->ch, volume); continue; } else if (mod_ch->effect == EFFECT_RETRIG_NOTE) { if (mod_ch->retrig_tick >= mod_ch->effect_params) { mod_ch->retrig_tick = 0; MixerChannelSetSampleOffset(mod_ch->ch, 0); } mod_ch->retrig_tick++; continue; } else if (mod_ch->effect == EFFECT_DELAY_NOTE) { if (mod_ch->effect_params == tick_number) { if (mod_ch->delayed_instrument != NULL) ModChannelSetInstrument(c, mod_ch->delayed_instrument); if (mod_ch->delayed_note != -1) ModChannelSetNote(c, mod_ch->delayed_note); if (mod_ch->delayed_volume != -1) ModChannelSetVolume(c, mod_ch->delayed_volume); mod_ch->effect = EFFECT_NONE; } continue; } if ((mod_ch->effect == EFFECT_VIBRATO) || (mod_ch->effect == EFFECT_VIBRATO_VOL_SLIDE)) { int speed = mod_ch->vibrato_args >> 4; int depth = mod_ch->vibrato_args & 0xF; mod_ch->vibrato_tick = (mod_ch->vibrato_tick + speed) & 63; int sine = mod_ch->vibrato_wave_table[mod_ch->vibrato_tick]; int value = (sine * depth) >> 7; // Divide by 128 uint64_t period = ModGetSampleTickPeriodFromAmigaPeriod(mod_ch->amiga_period + value); MixerChannelSetNotePeriodPorta(mod_ch->ch, period); } if ((mod_ch->effect == EFFECT_VOLUME_SLIDE) || (mod_ch->effect == EFFECT_PORTA_VOL_SLIDE) || (mod_ch->effect == EFFECT_VIBRATO_VOL_SLIDE)) { int volume = mod_ch->volume + (int8_t)mod_ch->effect_params; if (volume > 255) volume = 255; if (volume < 0) volume = 0; if (volume != mod_ch->volume) { mod_ch->volume = volume; MixerChannelSetVolume(mod_ch->ch, volume); } } if ((mod_ch->effect == EFFECT_PORTA_TO_NOTE) || (mod_ch->effect == EFFECT_PORTA_VOL_SLIDE)) { int32_t target = mod_ch->porta_to_note_target_amiga_period; if (target > mod_ch->amiga_period) { mod_ch->amiga_period += mod_ch->porta_to_note_speed; if (target < mod_ch->amiga_period) mod_ch->amiga_period = target; uint64_t period = ModGetSampleTickPeriodFromAmigaPeriod(mod_ch->amiga_period); MixerChannelSetNotePeriodPorta(mod_ch->ch, period); } else if (target < mod_ch->amiga_period) { mod_ch->amiga_period -= mod_ch->porta_to_note_speed; if (target > mod_ch->amiga_period) mod_ch->amiga_period = target; uint64_t period = ModGetSampleTickPeriodFromAmigaPeriod(mod_ch->amiga_period); MixerChannelSetNotePeriodPorta(mod_ch->ch, period); } } } }
31.874352
115
0.557646
0cf5bcb94a0ecfb4c23581af54d98f2f7ec3270a
10,129
sql
SQL
shop92.sql
Dmitriy-1986/TWO-HomeWorkLaravel
10c97cfd367d71930e9891654ec61e33c453fc21
[ "MIT" ]
null
null
null
shop92.sql
Dmitriy-1986/TWO-HomeWorkLaravel
10c97cfd367d71930e9891654ec61e33c453fc21
[ "MIT" ]
null
null
null
shop92.sql
Dmitriy-1986/TWO-HomeWorkLaravel
10c97cfd367d71930e9891654ec61e33c453fc21
[ "MIT" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Хост: 127.0.0.1:3306 -- Время создания: Сен 12 2020 г., 14:33 -- Версия сервера: 5.7.25 -- Версия PHP: 7.3.2 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 */; -- -- База данных: `shop92` -- -- -------------------------------------------------------- -- -- Структура таблицы `categories` -- CREATE TABLE `categories` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL, `img` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Дамп данных таблицы `categories` -- INSERT INTO `categories` (`id`, `name`, `slug`, `img`, `created_at`, `updated_at`) VALUES (3, 'repellat nihil', 'repellat-nihil', '/uploads/Тфегку mountains.jfif', '2020-07-04 05:17:22', '2020-07-25 08:27:36'), (4, 'dolor eos qui', 'dolor-eos-qui', NULL, '2020-07-04 05:17:22', '2020-07-04 05:17:22'), (5, 'asperiores id enim', 'asperiores-id-enim', NULL, '2020-07-04 05:17:22', '2020-07-04 05:17:22'), (6, 'alias dignissimos cupiditate', 'alias-dignissimos-cupiditate', 'https://loremflickr.com/320/240', '2020-07-04 05:17:22', '2020-07-04 05:17:22'), (7, 'nobis aliquam modi', 'nobis-aliquam-modi', NULL, '2020-07-04 05:17:22', '2020-07-04 05:17:22'), (8, 'expedita occaecati quo', 'expedita-occaecati-quod', '/uploads/nature sea.jfif', '2020-07-04 05:17:22', '2020-07-25 08:27:18'), (9, 'voluptas veritatis at', 'voluptas-veritatis-at', 'https://loremflickr.com/320/240', '2020-07-04 05:17:22', '2020-07-04 05:17:22'), (10, 'saepe voluptate aut', 'saepe-voluptate-aut', NULL, '2020-07-04 05:17:22', '2020-07-04 05:17:22'), (29, 'Nature sea', 'nature-sea', '/uploads/nature sea.jfif', '2020-07-25 06:49:11', '2020-07-25 06:49:11'), (30, 'Nature river', 'nature-river', '/uploads/nature.jfif', '2020-07-25 06:49:31', '2020-07-25 06:49:31'), (31, 'Nature forest', 'nature-forest', '/uploads/nature forest.jfif', '2020-07-25 06:53:46', '2020-07-25 06:53:46'), (32, 'Nature mountai', 'nature-mountain', '/uploads/Тфегку mountains.jfif', '2020-07-25 06:54:55', '2020-07-25 07:55:51'), (34, 'Test Name 111', 'test-name-111', NULL, '2020-07-25 09:45:42', '2020-07-25 09:45:42'), (35, 'Test Name123', 'test-name123', NULL, '2020-07-25 09:58:10', '2020-07-25 09:58:10'); -- -------------------------------------------------------- -- -- Структура таблицы `failed_jobs` -- CREATE TABLE `failed_jobs` ( `id` bigint(20) UNSIGNED NOT NULL, `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Структура таблицы `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Дамп данных таблицы `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (13, '2014_10_12_000000_create_users_table', 1), (14, '2019_08_19_000000_create_failed_jobs_table', 1), (15, '2020_07_04_062335_create_categories_table', 1), (16, '2020_07_04_083038_create_products_table', 2), (17, '2014_10_12_100000_create_password_resets_table', 3), (18, '2020_07_18_062209_add_role_users', 4); -- -------------------------------------------------------- -- -- Структура таблицы `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Структура таблицы `products` -- CREATE TABLE `products` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL, `img` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `price` double(8,2) NOT NULL, `recomended` tinyint(1) NOT NULL DEFAULT '0', `category_id` bigint(20) UNSIGNED DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `description` text COLLATE utf8mb4_unicode_ci ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Дамп данных таблицы `products` -- INSERT INTO `products` (`id`, `name`, `slug`, `img`, `price`, `recomended`, `category_id`, `created_at`, `updated_at`, `description`) VALUES (1, 'est iste blanditiis', 'est-iste-blanditiis', 'https://loremflickr.com/320/240', 7315.00, 0, 4, '2020-07-04 06:05:49', '2020-07-04 06:05:49', NULL), (2, 'nostrum enim voluptatum', 'nostrum-enim-voluptatum', NULL, 805.29, 0, NULL, '2020-07-04 06:05:49', '2020-07-04 06:05:49', NULL), (3, 'aut nemo vitae', 'aut-nemo-vitae', NULL, 2069.68, 1, 10, '2020-07-04 06:05:49', '2020-07-04 06:05:49', NULL), (4, 'sed consequuntur maiores', 'sed-consequuntur-maiores', 'https://loremflickr.com/320/240', 9779.63, 1, 6, '2020-07-04 06:05:49', '2020-07-04 06:05:49', NULL), (5, 'aut et suscipit', 'aut-et-suscipit', 'https://loremflickr.com/320/240', 7608.50, 1, 6, '2020-07-04 06:05:49', '2020-07-04 06:05:49', NULL), (6, 'et perspiciatis rem', 'et-perspiciatis-rem', NULL, 5542.57, 1, 9, '2020-07-04 06:05:49', '2020-07-04 06:05:49', NULL), (7, 'minima nihil adipisci', 'minima-nihil-adipisci', 'https://loremflickr.com/320/240', 9420.21, 1, 7, '2020-07-04 06:05:49', '2020-07-04 06:05:49', NULL), (8, 'et maxime odit', 'et-maxime-odit', 'https://loremflickr.com/320/240', 1265.21, 0, NULL, '2020-07-04 06:05:49', '2020-07-04 06:05:49', NULL), (9, 'cumque quo corrupti', 'cumque-quo-corrupti', 'https://loremflickr.com/320/240', 3538.49, 0, 7, '2020-07-04 06:05:49', '2020-07-04 06:05:49', NULL), (10, 'ipsam perspiciatis dolores', 'ipsam-perspiciatis-dolores', 'https://loremflickr.com/320/240', 7275.14, 1, 5, '2020-07-04 06:05:49', '2020-07-04 06:05:49', NULL); -- -------------------------------------------------------- -- -- Структура таблицы `users` -- CREATE TABLE `users` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `role` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Дамп данных таблицы `users` -- INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`, `role`) VALUES (1, 'Dima', 'dovgal.dima.86@gmail.com', NULL, '$2y$10$L6jiOJB9jD/RDB9MQVCQ0ulhhDyfhm5CxDez9bfRYNQSRSSUZX/4S', 'oNcupWTNxzu4vxmQKOigFD1Vwin8MBTSLLziFFRp3gUebIEN9NXOql6FekR3', '2020-07-11 05:06:37', '2020-07-11 05:06:37', 'admin'), (2, 'Test', 'test@mail.com', NULL, '$2y$10$vU7wHOtEy7NWHHEAiJ60Y.pJEouUzqLyuhQG5E5FARAbdBsNRd1sG', NULL, '2020-07-11 05:37:54', '2020-07-11 05:37:54', NULL), (3, 'Dima', 'ddd@gmail.com', NULL, '$2y$10$Soq5yhNObruM50mvlJ9J6ONLOq7EzGZiNBqF0Hzpdsgr73P4mpYTW', NULL, '2020-07-18 03:29:08', '2020-07-18 03:29:08', NULL); -- -- Индексы сохранённых таблиц -- -- -- Индексы таблицы `categories` -- ALTER TABLE `categories` ADD PRIMARY KEY (`id`); -- -- Индексы таблицы `failed_jobs` -- ALTER TABLE `failed_jobs` ADD PRIMARY KEY (`id`); -- -- Индексы таблицы `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Индексы таблицы `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Индексы таблицы `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `products_slug_unique` (`slug`), ADD KEY `products_category_id_foreign` (`category_id`); -- -- Индексы таблицы `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- AUTO_INCREMENT для сохранённых таблиц -- -- -- AUTO_INCREMENT для таблицы `categories` -- ALTER TABLE `categories` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=36; -- -- AUTO_INCREMENT для таблицы `failed_jobs` -- ALTER TABLE `failed_jobs` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT для таблицы `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19; -- -- AUTO_INCREMENT для таблицы `products` -- ALTER TABLE `products` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT для таблицы `users` -- ALTER TABLE `users` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- Ограничения внешнего ключа сохраненных таблиц -- -- -- Ограничения внешнего ключа таблицы `products` -- ALTER TABLE `products` ADD CONSTRAINT `products_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE SET NULL; 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 */;
38.367424
229
0.687136
62878ce95cf6d01f672c0ade34eaae5c4aa12f4b
377
asm
Assembly
programs/oeis/176/A176405.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/176/A176405.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/176/A176405.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A176405: Fixed point of morphism 0->0100110, 1->0110110 ; 0,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,0,0,1,1,0,0,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,1,0,0,1,1,0,0,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,1,0,0,1,1,0,0,1 mul $0,3 seq $0,277545 ; a(n) = n/7^m mod 7, where 7^m is the greatest power of 7 that divides n. sub $0,1 mod $0,2
47.125
201
0.575597
3ace5c52bba6b91d3694785e3f86576a6957ad58
2,444
lua
Lua
node.lua
n00dl3st/CargoCult
8172b6c751bda306043fb2f63a8ce95d925ecb8b
[ "BSD-3-Clause" ]
null
null
null
node.lua
n00dl3st/CargoCult
8172b6c751bda306043fb2f63a8ce95d925ecb8b
[ "BSD-3-Clause" ]
null
null
null
node.lua
n00dl3st/CargoCult
8172b6c751bda306043fb2f63a8ce95d925ecb8b
[ "BSD-3-Clause" ]
null
null
null
env.info( "------------------------------------------------" ) env.info(" Loading Node") env.info( "------------------------------------------------" ) NODE = { ClassName = "NODE", NodePrefix = "NODE #", NodeName = "", NodeZone = {}, Index = 0, Links = {}, DisplayName = "", Warehouse = {}, BluforWarehouse = SPAWNSTATIC:NewFromStatic("Supply_Zone_Warehouse", country.id.USA), } -- Create Node instance function NODE:New() local self = BASE:Inherit(self, BASE:New()) return self end --- Create node from CORE_ZONE object function NODE:CreateNode(node) local new_node = NODE:New() new_node.NodeName = node:GetName() new_node.NodeZone = node new_node:ParseZoneLabel() new_node:AddWarehouse() return new_node end --- Parse node name function NODE:ParseZoneLabel() -- tonumber important here otherwise our table indexes will be strings! -- code should to be agnostic but whatever, this is also some fugly code. self.Index = tonumber(string.sub(self.NodeName, 7,7)) for link in string.gmatch(self.NodeName, '([^,]+)') do if CORE.IsNumeric(link) then self.Links[#self.Links+1] = link CORE.Debug("Found Link: " .. link) elseif not string.match(link, self.NodePrefix) then CORE.Debug("self display name: " .. link) self.DisplayName = link end end return self end -- Spawn warehouse function NODE:AddWarehouse() -- Spawn warehouse object local temp_warehouse = self.BluforWarehouse:SpawnFromZone(self.NodeZone, 0, self.DisplayName) -- Initiate warehouse object self.Warehouse = WAREHOUSE:New(temp_warehouse, self.DisplayName) self.Warehouse:SetStatusUpdate(120):Start() -- BUG: Not sure how this is working.... self:AddStock() return self end -- Add stock to warehouse function NODE:AddStock() -- Populate with test units local truck = GROUP:FindByName("Blufor Truck") self.Warehouse:AddAsset(truck, 5) if self.Warehouse.airbase then local plane = GROUP:FindByName("Blufor Transport") self.Warehouse:AddAsset(plane, 5) end return self end function NODE:FindSupplier() return self.Links end function NODE:AssetCount() -- find number of item end function NODE.SpawnResupplyTransport() CORE.Info("Called resupply") local Transport = SPAWN:New("Blufor Daily Transport"):Spawn() end
26.857143
97
0.640753
85e66ffb045f79f29b217c15378732d5f138b4aa
115
h
C
RevenueMonster/Library/AlipaySDK/Alipay.h
Oskang09/rm-ios-sdk
f52bc2519b83b558c8ac2fb1323aa423fee341fb
[ "BSD-3-Clause" ]
1
2020-04-04T17:52:52.000Z
2020-04-04T17:52:52.000Z
RevenueMonster/Library/AlipaySDK/Alipay.h
Oskang09/rm-ios-sdk
f52bc2519b83b558c8ac2fb1323aa423fee341fb
[ "BSD-3-Clause" ]
2
2020-10-08T09:38:54.000Z
2021-06-14T07:38:35.000Z
RevenueMonster/Library/AlipaySDK/Alipay.h
Oskang09/rm-ios-sdk
f52bc2519b83b558c8ac2fb1323aa423fee341fb
[ "BSD-3-Clause" ]
1
2021-03-18T05:05:44.000Z
2021-03-18T05:05:44.000Z
#ifndef AlipaySDK_h #define AlipaySDK_h #import <AlipaySDK/AlipaySDK.h> #import <AlipaySDK/APayAuthInfo.h> #endif
16.428571
34
0.8
5bf86e97bbb470b82450c49b5a038f125ac6d0f4
453
h
C
Pods/Target Support Files/WMPlayer/WMPlayer-umbrella.h
winfredzen/YCDownloadSession
e0ff7a7c7dee8e1a4ed5fade459c63193c7cfc72
[ "MIT" ]
null
null
null
Pods/Target Support Files/WMPlayer/WMPlayer-umbrella.h
winfredzen/YCDownloadSession
e0ff7a7c7dee8e1a4ed5fade459c63193c7cfc72
[ "MIT" ]
null
null
null
Pods/Target Support Files/WMPlayer/WMPlayer-umbrella.h
winfredzen/YCDownloadSession
e0ff7a7c7dee8e1a4ed5fade459c63193c7cfc72
[ "MIT" ]
null
null
null
#ifdef __OBJC__ #import <UIKit/UIKit.h> #else #ifndef FOUNDATION_EXPORT #if defined(__cplusplus) #define FOUNDATION_EXPORT extern "C" #else #define FOUNDATION_EXPORT extern #endif #endif #endif #import "UIViewController+ShouldAutorotate.h" #import "FastForwardView.h" #import "WMLightView.h" #import "WMPlayer.h" #import "WMPlayerModel.h" FOUNDATION_EXPORT double WMPlayerVersionNumber; FOUNDATION_EXPORT const unsigned char WMPlayerVersionString[];
20.590909
62
0.812362
709e652ebd0d63ed4c0ccb8d0196e8fba96251a7
3,303
h
C
src/GameEngineLib/include/sdlgui/slider.h
hugetto/2DGame
833c6596df8c2f9daf14cb9ebfffa36b77f96218
[ "Apache-2.0" ]
null
null
null
src/GameEngineLib/include/sdlgui/slider.h
hugetto/2DGame
833c6596df8c2f9daf14cb9ebfffa36b77f96218
[ "Apache-2.0" ]
null
null
null
src/GameEngineLib/include/sdlgui/slider.h
hugetto/2DGame
833c6596df8c2f9daf14cb9ebfffa36b77f96218
[ "Apache-2.0" ]
null
null
null
/* sdl_gui/slider.h -- Fractional slider widget with mouse control Based on NanoGUI by Wenzel Jakob <wenzel@inf.ethz.ch>. Adaptation for SDL by Dalerank <dalerankn8@gmail.com> All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE.txt file. */ /** \file */ #pragma once #include <sdlgui/widget.h> #include <memory> NAMESPACE_BEGIN(sdlgui) /** * \class Slider slider.h sdl_gui/slider.h * * \brief Fractional slider widget with mouse control. */ class Slider : public Widget { public: Slider(Widget *parent, float value = 0.f); Slider(Widget *parent, float value, const std::function<void(Slider*, float)>& objcallback) : Slider(parent, value) { setObjCallback(objcallback); } Slider(Widget *parent, float value, const std::function<void(Slider*, float)>& objcallback, const std::function<void(float)> &fcallback) : Slider(parent, value) { setObjCallback(objcallback); setFinalCallback(fcallback); } float value() const { return mValue; } void setValue(float value) { mValue = value; } const Color &highlightColor() const { return mHighlightColor; } void setHighlightColor(const Color &highlightColor) { mHighlightColor = highlightColor; } std::pair<float, float> highlightedRange() const { return mHighlightedRange; } void setHighlightedRange(std::pair<float, float> highlightedRange) { mHighlightedRange = highlightedRange; } std::pair<float, float> range() const { return mRange; } void setRange(std::pair<float, float> range) { mRange = range; } std::function<void(float)> callback() const { return mCallback; } void setCallback(const std::function<void(float)> &callback) { mCallback = callback; } std::function<void(Slider*,float)> objcallback() const { return mObjCallback; } void setObjCallback(const std::function<void(Slider*,float)> &callback) { mObjCallback = callback; } std::function<void(float)> finalCallback() const { return mFinalCallback; } void setFinalCallback(const std::function<void(float)> &callback) { mFinalCallback = callback; } Vector2i preferredSize(SDL_Renderer *ctx) const override; bool mouseDragEvent(const Vector2i &p, const Vector2i &rel, int button, int modifiers) override; bool mouseButtonEvent(const Vector2i &p, int button, bool down, int modifiers) override; void draw(SDL_Renderer* renderer) override; virtual void drawBody(SDL_Renderer* renderer); virtual void drawKnob(SDL_Renderer* renderer); void setKnobOutterRadiusKoeff(float koeff) { mKnobRadKoeff.outter = koeff; } void setKnobInnerRadiusKoeff(float koeff) { mKnobRadKoeff.inner = koeff; } protected: float mValue; bool _lastEnabledState = false; struct { float outter=1.f; float inner=0.5f; } mKnobRadKoeff; std::function<void(float)> mCallback; std::function<void(Slider*,float)> mObjCallback; std::function<void(float)> mFinalCallback; std::pair<float, float> mRange; std::pair<float, float> mHighlightedRange; Color mHighlightColor; struct AsyncTexture; typedef std::shared_ptr<AsyncTexture> AsyncTexturePtr; AsyncTexturePtr _body; AsyncTexturePtr _knob; }; NAMESPACE_END(sdlgui)
35.138298
112
0.710566
52477c72020ed7509bdddc34b9c8f76ccaeabd9a
3,980
kt
Kotlin
app/src/main/java/com/allen/migo/network/core/NetworkHandle.kt
allen-hsu/migo
b22f0afa1afd4d76717e48c9cd0d515f34df20bc
[ "MIT" ]
null
null
null
app/src/main/java/com/allen/migo/network/core/NetworkHandle.kt
allen-hsu/migo
b22f0afa1afd4d76717e48c9cd0d515f34df20bc
[ "MIT" ]
null
null
null
app/src/main/java/com/allen/migo/network/core/NetworkHandle.kt
allen-hsu/migo
b22f0afa1afd4d76717e48c9cd0d515f34df20bc
[ "MIT" ]
null
null
null
package com.allen.migo.network.core import android.content.Context import android.net.ConnectivityManager import android.net.Network import android.net.NetworkCapabilities import android.net.NetworkCapabilities.TRANSPORT_CELLULAR import android.net.NetworkCapabilities.TRANSPORT_WIFI import android.net.NetworkRequest import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData class NetworkHandleProvider(private val context: Context): NetworkHandle { private var connectivityManager: ConnectivityManager? = null private var networkCallback: ConnectivityManager.NetworkCallback private val _networkAvailable = MutableLiveData<Boolean>(false) private val _networkMode = MutableLiveData<NetworkMode>( NetworkMode.NONE ) private val _apiEnv = MutableLiveData<ApiEnv>( ApiEnv.PUBLIC ) init { connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager? networkCallback = object : ConnectivityManager.NetworkCallback() { override fun onAvailable(network: Network) { super.onAvailable(network) _networkAvailable.postValue(true) } override fun onLosing(network: Network, maxMsToLive: Int) { super.onLosing(network, maxMsToLive) _networkAvailable.postValue(false) } override fun onLost(network: Network) { super.onLost(network) _networkAvailable.postValue(false) } override fun onUnavailable() { super.onUnavailable() _networkAvailable.postValue(false) } override fun onCapabilitiesChanged( network: Network, networkCapabilities: NetworkCapabilities ) { super.onCapabilitiesChanged(network, networkCapabilities) when { networkCapabilities.hasTransport(TRANSPORT_WIFI) -> _networkMode.postValue( NetworkMode.WIFI ) networkCapabilities.hasTransport(TRANSPORT_CELLULAR) -> _networkMode.postValue( NetworkMode.CELLULAR ) else -> { _networkMode.postValue(NetworkMode.OTHER) } } var isConnectWifi = false var isConnectCellular = false connectivityManager?.run { for (networkInfo in this.allNetworks) { val capabilities = this.getNetworkCapabilities(networkInfo) capabilities?.run { if (this.hasTransport(TRANSPORT_WIFI)) { isConnectWifi = true } if (this.hasTransport(TRANSPORT_CELLULAR)) { isConnectCellular = true } } } } if(isConnectWifi) { _apiEnv.postValue(ApiEnv.PRIVATE) } else { _apiEnv.postValue(ApiEnv.PUBLIC) } } } registerNetworkCallback() } private fun registerNetworkCallback() { connectivityManager?.requestNetwork( NetworkRequest.Builder().build(), networkCallback ) } override fun networkAvailable(): LiveData<Boolean> { return _networkAvailable } override fun networkMode(): LiveData<NetworkMode> { return _networkMode } override fun apiEnv(): LiveData<ApiEnv> { return _apiEnv } } interface NetworkHandle { fun networkAvailable(): LiveData<Boolean> fun networkMode(): LiveData<NetworkMode> fun apiEnv(): LiveData<ApiEnv> }
33.166667
99
0.578141
d000e1dcf658b5cf94346ab2c44d9fb26a730226
101,814
lua
Lua
effects/charlize.lua
techannihilation/TA
2b70333fd2617d0372cc0c9795f5f3b9c158205b
[ "CC-BY-4.0" ]
38
2017-01-20T08:12:28.000Z
2022-03-05T16:50:40.000Z
effects/charlize.lua
techannihilation/TA
2b70333fd2617d0372cc0c9795f5f3b9c158205b
[ "CC-BY-4.0" ]
1,067
2016-12-09T20:14:49.000Z
2022-02-20T12:57:29.000Z
effects/charlize.lua
techannihilation/TA
2b70333fd2617d0372cc0c9795f5f3b9c158205b
[ "CC-BY-4.0" ]
68
2016-12-10T09:20:25.000Z
2021-09-07T10:44:52.000Z
-- charlize_16 -- charlize_14 -- minicharlize_25 -- charlize_17 -- charlize_6 -- bigcharlize_20 -- minicharlize_7 -- bigcharlize_12 -- charlize_10 -- charlize_11 -- charlize_12 -- minicharlize_14 -- charlize_8 -- charlize_ani -- bigcharlize_15 -- charlize_23 -- minicharlize_3 -- charlize_25 -- minicharlize_1 -- charlize_3 -- charlize_9 -- charlize_15 -- minicharlize_9 -- minicharlize_24 -- bigcharlize_7 -- minicharlize_12 -- charlize_21 -- charlize_24 -- charlize_18 -- bigcharlize_16 -- bigcharlize_21 -- charlize_13 -- minicharlize_22 -- charlize_7 -- minicharlize_17 -- bigcharlize_3 -- bigcharlize_19 -- bigcharlize_1 -- bigcharlize_22 -- charlize_22 -- bigcharlize_23 -- bigcharlize_18 -- bigcharlize_17 -- bigcharlize_24 -- minicharlize_19 -- minicharlize_21 -- charlize_19 -- minicharlize_2 -- bigcharlize_8 -- bigcharlize_14 -- charlize_5 -- bigcharlize_11 -- bigcharlize_13 -- bigcharlize_10 -- bigcharlize_ani -- minicharlize_10 -- bigcharlize_6 -- minicharlize_20 -- bigcharlize_9 -- charlize_20 -- minicharlize_18 -- minicharlize_16 -- charlize_1 -- minicharlize_6 -- minicharlize_8 -- charlize_4 -- bigcharlize_2 -- bigcharlize_4 -- bigcharlize_25 -- minicharlize_11 -- minicharlize_13 -- minicharlize_15 -- charlize_2 -- minicharlize_5 -- minicharlize_4 -- bigcharlize_5 -- minicharlize_ani -- minicharlize_23 return { ["charlize_16"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball16]], }, }, }, ["charlize_14"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball14]], }, }, }, ["minicharlize_25"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 .3 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball25]], }, }, }, ["charlize_17"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball17]], }, }, }, ["charlize_6"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball06]], }, }, }, ["bigcharlize_20"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball20]], }, }, }, ["minicharlize_7"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball07]], }, }, }, ["bigcharlize_12"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball12]], }, }, }, ["charlize_10"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball10]], }, }, }, ["charlize_11"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball11]], }, }, }, ["charlize_12"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball12]], }, }, }, ["minicharlize_14"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball14]], }, }, }, ["charlize_8"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball08]], }, }, }, ["charlize_ani"] = { frame1 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 0, explosiongenerator = [[custom:CHARLIZE_1]], pos = [[0, 0, 0]], }, }, frame10 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 10, explosiongenerator = [[custom:CHARLIZE_10]], pos = [[0, 0, 0]], }, }, frame11 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 11, explosiongenerator = [[custom:CHARLIZE_11]], pos = [[0, 0, 0]], }, }, frame12 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 12, explosiongenerator = [[custom:CHARLIZE_12]], pos = [[0, 0, 0]], }, }, frame13 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 13, explosiongenerator = [[custom:CHARLIZE_13]], pos = [[0, 0, 0]], }, }, frame14 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 14, explosiongenerator = [[custom:CHARLIZE_14]], pos = [[0, 0, 0]], }, }, frame15 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 15, explosiongenerator = [[custom:CHARLIZE_15]], pos = [[0, 0, 0]], }, }, frame16 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 16, explosiongenerator = [[custom:CHARLIZE_16]], pos = [[0, 0, 0]], }, }, frame17 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 17, explosiongenerator = [[custom:CHARLIZE_17]], pos = [[0, 0, 0]], }, }, frame18 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 18, explosiongenerator = [[custom:CHARLIZE_18]], pos = [[0, 0, 0]], }, }, frame19 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 19, explosiongenerator = [[custom:CHARLIZE_19]], pos = [[0, 0, 0]], }, }, frame2 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 2, explosiongenerator = [[custom:CHARLIZE_2]], pos = [[0, 0, 0]], }, }, frame20 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 20, explosiongenerator = [[custom:CHARLIZE_20]], pos = [[0, 0, 0]], }, }, frame21 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 21, explosiongenerator = [[custom:CHARLIZE_21]], pos = [[0, 0, 0]], }, }, frame22 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 22, explosiongenerator = [[custom:CHARLIZE_22]], pos = [[0, 0, 0]], }, }, frame23 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 23, explosiongenerator = [[custom:CHARLIZE_23]], pos = [[0, 0, 0]], }, }, frame24 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 24, explosiongenerator = [[custom:CHARLIZE_24]], pos = [[0, 0, 0]], }, }, frame25 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 25, explosiongenerator = [[custom:CHARLIZE_25]], pos = [[0, 0, 0]], }, }, frame3 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 3, explosiongenerator = [[custom:CHARLIZE_3]], pos = [[0, 0, 0]], }, }, frame4 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 4, explosiongenerator = [[custom:CHARLIZE_4]], pos = [[0, 0, 0]], }, }, frame5 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 5, explosiongenerator = [[custom:CHARLIZE_5]], pos = [[0, 0, 0]], }, }, frame6 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 6, explosiongenerator = [[custom:CHARLIZE_6]], pos = [[0, 0, 0]], }, }, frame7 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 7, explosiongenerator = [[custom:CHARLIZE_7]], pos = [[0, 0, 0]], }, }, frame8 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 8, explosiongenerator = [[custom:CHARLIZE_8]], pos = [[0, 0, 0]], }, }, frame9 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 9, explosiongenerator = [[custom:CHARLIZE_9]], pos = [[0, 0, 0]], }, }, }, ["bigcharlize_15"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball15]], }, }, }, ["charlize_23"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 .5 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball23]], }, }, }, ["minicharlize_3"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball03]], }, }, }, ["charlize_25"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 .3 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball25]], }, }, }, ["minicharlize_1"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball01]], }, }, }, ["charlize_3"] = { groundflash = { circlealpha = 1, circlegrowth = 0, flashalpha = 0.9, flashsize = 100, ttl = 10, color = { [1] = 1, [2] = 1, [3] = 0, }, }, wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball03]], }, }, }, ["charlize_9"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball09]], }, }, }, ["charlize_15"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball15]], }, }, }, ["minicharlize_9"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball09]], }, }, }, ["minicharlize_24"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 .4 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball24]], }, }, }, ["bigcharlize_7"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball07]], }, }, }, ["minicharlize_12"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball12]], }, }, }, ["charlize_21"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 .9 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball21]], }, }, }, ["charlize_24"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 .4 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball24]], }, }, }, ["charlize_18"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball18]], }, }, }, ["bigcharlize_16"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball16]], }, }, }, ["bigcharlize_21"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 .9 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball21]], }, }, }, ["charlize_13"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball13]], }, }, }, ["minicharlize_22"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 .7 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball22]], }, }, }, ["charlize_7"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball07]], }, }, }, ["minicharlize_17"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball17]], }, }, }, ["bigcharlize_3"] = { groundflash = { circlealpha = 1, circlegrowth = 0, flashalpha = 0.9, flashsize = 100, ttl = 10, color = { [1] = 1, [2] = 1, [3] = 0, }, }, wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball03]], }, }, }, ["bigcharlize_19"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball19]], }, }, }, ["bigcharlize_1"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball01]], }, }, }, ["bigcharlize_22"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 .7 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball22]], }, }, }, ["charlize_22"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 .7 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball22]], }, }, }, ["bigcharlize_23"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 .5 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball23]], }, }, }, ["bigcharlize_18"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball18]], }, }, }, ["bigcharlize_17"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball17]], }, }, }, ["bigcharlize_24"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 .4 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball24]], }, }, }, ["minicharlize_19"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball19]], }, }, }, ["minicharlize_21"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 .9 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball21]], }, }, }, ["charlize_19"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball19]], }, }, }, ["minicharlize_2"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball02]], }, }, }, ["bigcharlize_8"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball08]], }, }, }, ["bigcharlize_14"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball14]], }, }, }, ["charlize_5"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball05]], }, }, }, ["bigcharlize_11"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball11]], }, }, }, ["bigcharlize_13"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball13]], }, }, }, ["bigcharlize_10"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball10]], }, }, }, ["bigcharlize_ani"] = { frame1 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 0, explosiongenerator = [[custom:BIGCHARLIZE_1]], pos = [[0, 0, 0]], }, }, frame10 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 10, explosiongenerator = [[custom:BIGCHARLIZE_10]], pos = [[0, 0, 0]], }, }, frame11 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 11, explosiongenerator = [[custom:BIGCHARLIZE_11]], pos = [[0, 0, 0]], }, }, frame12 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 12, explosiongenerator = [[custom:BIGCHARLIZE_12]], pos = [[0, 0, 0]], }, }, frame13 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 13, explosiongenerator = [[custom:BIGCHARLIZE_13]], pos = [[0, 0, 0]], }, }, frame14 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 14, explosiongenerator = [[custom:BIGCHARLIZE_14]], pos = [[0, 0, 0]], }, }, frame15 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 15, explosiongenerator = [[custom:BIGCHARLIZE_15]], pos = [[0, 0, 0]], }, }, frame16 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 16, explosiongenerator = [[custom:BIGCHARLIZE_16]], pos = [[0, 0, 0]], }, }, frame17 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 17, explosiongenerator = [[custom:BIGCHARLIZE_17]], pos = [[0, 0, 0]], }, }, frame18 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 18, explosiongenerator = [[custom:BIGCHARLIZE_18]], pos = [[0, 0, 0]], }, }, frame19 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 19, explosiongenerator = [[custom:BIGCHARLIZE_19]], pos = [[0, 0, 0]], }, }, frame2 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 2, explosiongenerator = [[custom:BIGCHARLIZE_2]], pos = [[0, 0, 0]], }, }, frame20 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 20, explosiongenerator = [[custom:BIGCHARLIZE_20]], pos = [[0, 0, 0]], }, }, frame21 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 21, explosiongenerator = [[custom:BIGCHARLIZE_21]], pos = [[0, 0, 0]], }, }, frame22 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 22, explosiongenerator = [[custom:BIGCHARLIZE_22]], pos = [[0, 0, 0]], }, }, frame23 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 23, explosiongenerator = [[custom:BIGCHARLIZE_23]], pos = [[0, 0, 0]], }, }, frame24 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 24, explosiongenerator = [[custom:BIGCHARLIZE_24]], pos = [[0, 0, 0]], }, }, frame25 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 25, explosiongenerator = [[custom:BIGCHARLIZE_25]], pos = [[0, 0, 0]], }, }, frame3 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 3, explosiongenerator = [[custom:BIGCHARLIZE_3]], pos = [[0, 0, 0]], }, }, frame4 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 4, explosiongenerator = [[custom:BIGCHARLIZE_4]], pos = [[0, 0, 0]], }, }, frame5 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 5, explosiongenerator = [[custom:BIGCHARLIZE_5]], pos = [[0, 0, 0]], }, }, frame6 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 6, explosiongenerator = [[custom:BIGCHARLIZE_6]], pos = [[0, 0, 0]], }, }, frame7 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 7, explosiongenerator = [[custom:BIGCHARLIZE_7]], pos = [[0, 0, 0]], }, }, frame8 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 8, explosiongenerator = [[custom:BIGCHARLIZE_8]], pos = [[0, 0, 0]], }, }, frame9 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 9, explosiongenerator = [[custom:BIGCHARLIZE_9]], pos = [[0, 0, 0]], }, }, }, ["minicharlize_10"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball10]], }, }, }, ["bigcharlize_6"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball06]], }, }, }, ["minicharlize_20"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball20]], }, }, }, ["bigcharlize_9"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball09]], }, }, }, ["charlize_20"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball20]], }, }, }, ["minicharlize_18"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball18]], }, }, }, ["minicharlize_16"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball16]], }, }, }, ["charlize_1"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball01]], }, }, }, ["minicharlize_6"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball06]], }, }, }, ["minicharlize_8"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball08]], }, }, }, ["charlize_4"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball04]], }, }, }, ["bigcharlize_2"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball02]], }, }, }, ["bigcharlize_4"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball04]], }, }, }, ["bigcharlize_25"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 .3 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball25]], }, }, }, ["minicharlize_11"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball11]], }, }, }, ["minicharlize_13"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball13]], }, }, }, ["minicharlize_15"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball15]], }, }, }, ["charlize_2"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 45, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball02]], }, }, }, ["minicharlize_5"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball05]], }, }, }, ["minicharlize_4"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball04]], }, }, }, ["bigcharlize_5"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 1 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 70, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball05]], }, }, }, ["minicharlize_ani"] = { frame1 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 0, explosiongenerator = [[custom:MINICHARLIZE_1]], pos = [[0, 0, 0]], }, }, frame10 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 10, explosiongenerator = [[custom:MINICHARLIZE_10]], pos = [[0, 0, 0]], }, }, frame11 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 11, explosiongenerator = [[custom:MINICHARLIZE_11]], pos = [[0, 0, 0]], }, }, frame12 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 12, explosiongenerator = [[custom:MINICHARLIZE_12]], pos = [[0, 0, 0]], }, }, frame13 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 13, explosiongenerator = [[custom:MINICHARLIZE_13]], pos = [[0, 0, 0]], }, }, frame14 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 14, explosiongenerator = [[custom:MINICHARLIZE_14]], pos = [[0, 0, 0]], }, }, frame15 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 15, explosiongenerator = [[custom:MINICHARLIZE_15]], pos = [[0, 0, 0]], }, }, frame16 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 16, explosiongenerator = [[custom:MINICHARLIZE_16]], pos = [[0, 0, 0]], }, }, frame17 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 17, explosiongenerator = [[custom:MINICHARLIZE_17]], pos = [[0, 0, 0]], }, }, frame18 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 18, explosiongenerator = [[custom:MINICHARLIZE_18]], pos = [[0, 0, 0]], }, }, frame19 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 19, explosiongenerator = [[custom:MINICHARLIZE_19]], pos = [[0, 0, 0]], }, }, frame2 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 2, explosiongenerator = [[custom:MINICHARLIZE_2]], pos = [[0, 0, 0]], }, }, frame20 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 20, explosiongenerator = [[custom:MINICHARLIZE_20]], pos = [[0, 0, 0]], }, }, frame21 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 21, explosiongenerator = [[custom:MINICHARLIZE_21]], pos = [[0, 0, 0]], }, }, frame22 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 22, explosiongenerator = [[custom:MINICHARLIZE_22]], pos = [[0, 0, 0]], }, }, frame23 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 23, explosiongenerator = [[custom:MINICHARLIZE_23]], pos = [[0, 0, 0]], }, }, frame24 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 24, explosiongenerator = [[custom:MINICHARLIZE_24]], pos = [[0, 0, 0]], }, }, frame25 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 25, explosiongenerator = [[custom:MINICHARLIZE_25]], pos = [[0, 0, 0]], }, }, frame3 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 3, explosiongenerator = [[custom:MINICHARLIZE_3]], pos = [[0, 0, 0]], }, }, frame4 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 4, explosiongenerator = [[custom:MINICHARLIZE_4]], pos = [[0, 0, 0]], }, }, frame5 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 5, explosiongenerator = [[custom:MINICHARLIZE_5]], pos = [[0, 0, 0]], }, }, frame6 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 6, explosiongenerator = [[custom:MINICHARLIZE_6]], pos = [[0, 0, 0]], }, }, frame7 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 7, explosiongenerator = [[custom:MINICHARLIZE_7]], pos = [[0, 0, 0]], }, }, frame8 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 8, explosiongenerator = [[custom:MINICHARLIZE_8]], pos = [[0, 0, 0]], }, }, frame9 = { air = true, class = [[CExpGenSpawner]], count = 1, ground = true, water = true, properties = { delay = 9, explosiongenerator = [[custom:MINICHARLIZE_9]], pos = [[0, 0, 0]], }, }, }, ["minicharlize_23"] = { wezels = { air = true, class = [[CSimpleParticleSystem]], count = 1, ground = true, water = true, properties = { airdrag = 1, alwaysvisible = true, colormap = [[0 0 0 0.01 1 1 1 .5 0 0 0 0.01]], directional = false, emitrot = 0, emitrotspread = 1, emitvector = [[0, 1, 0]], gravity = [[0, 0, 0]], numparticles = 1, particlelife = 2, particlelifespread = 0, particlesize = 30, particlesizespread = 0, particlespeed = 0, particlespeedspread = 0, pos = [[0, 15, 0]], sizegrowth = 0, sizemod = 1.0, texture = [[plasmaball23]], }, }, }, }
30.47411
75
0.359813
b2f2d2e4410ddaee7c1cbfbc592626d44000b73b
177
swift
Swift
test/multifile/requirement-signature.swift
lwhsu/swift
e1e7a3fe75b4762d5e3d4d241f40b56946a03fdb
[ "Apache-2.0" ]
72,551
2015-12-03T16:45:13.000Z
2022-03-31T18:57:59.000Z
test/multifile/requirement-signature.swift
lwhsu/swift
e1e7a3fe75b4762d5e3d4d241f40b56946a03fdb
[ "Apache-2.0" ]
39,352
2015-12-03T16:55:06.000Z
2022-03-31T23:43:41.000Z
test/multifile/requirement-signature.swift
lwhsu/swift
e1e7a3fe75b4762d5e3d4d241f40b56946a03fdb
[ "Apache-2.0" ]
13,845
2015-12-03T16:45:13.000Z
2022-03-31T11:32:29.000Z
// RUN: %target-swift-frontend -typecheck -primary-file %s %S/Inputs/requirement-signature.swift func run<CO: ConnectableObservableType, O>(co: CO, o: O) { co.subscribe(o) }
29.5
96
0.723164
9eb5729d26d9d55f778e5c7306f97ffbf184a7a7
5,615
rs
Rust
sources/metricdog/src/main_test.rs
likewu/bottlerocket
3a93dd301b7b09ddfaf9acc827543e27f84d804f
[ "Apache-2.0", "MIT" ]
6,422
2020-03-10T19:06:18.000Z
2022-03-31T18:47:38.000Z
sources/metricdog/src/main_test.rs
likewu/bottlerocket
3a93dd301b7b09ddfaf9acc827543e27f84d804f
[ "Apache-2.0", "MIT" ]
851
2020-03-11T01:51:00.000Z
2022-03-31T23:26:56.000Z
sources/metricdog/src/main_test.rs
likewu/bottlerocket
3a93dd301b7b09ddfaf9acc827543e27f84d804f
[ "Apache-2.0", "MIT" ]
350
2020-03-10T18:54:33.000Z
2022-03-30T18:21:23.000Z
use crate::args::{Arguments, Command}; use crate::error::Result; use crate::main_inner; use crate::service_check::{ServiceCheck, ServiceHealth}; use httptest::responders::status_code; use httptest::{matchers::*, Expectation, Server}; use log::LevelFilter; use std::fs::write; use std::path::PathBuf; use tempfile::TempDir; const OS_RELEASE: &str = r#"PRETTY_NAME=Bottlerocket VARIANT_ID=myvariant VERSION_ID=1.2.3 BUILD_ID=abcdef0 "#; struct MockCheck {} impl ServiceCheck for MockCheck { fn check(&self, service_name: &str) -> Result<ServiceHealth> { if service_name.ends_with("failed") { Ok(ServiceHealth { is_healthy: false, exit_code: Some(1), }) } else { Ok(ServiceHealth { is_healthy: true, exit_code: None, }) } } } // dynamically create a config file where we can set server address, list of services, and send_metrics fn create_config_file_contents(metrics_url: &str, services: &[&str], send_metrics: bool) -> String { let svcs = services .iter() .map(|&s| format!("\"{}\"", s)) .collect::<Vec<String>>() .join(", "); format!( r#" metrics_url = "{}" send_metrics = {} service_checks = [{}] region = "us-west-2" seed = 1234 version_lock = "v0.1.2" ignore_waves = false "#, metrics_url, send_metrics, svcs ) } // create the config and os-release files in a tempdir and return the tempdir fn create_test_files(metrics_url: &str, services: &[&str], send_metrics: bool) -> TempDir { let t = TempDir::new().unwrap(); write( config_path(&t), create_config_file_contents(metrics_url, services, send_metrics), ) .unwrap(); write(os_release_path(&t), OS_RELEASE).unwrap(); t } // create the path to the config in the tempdir fn config_path(tempdir: &TempDir) -> PathBuf { tempdir .path() .join("metricdog.toml") .to_str() .unwrap() .into() } // create the path to os-release in the tempdir fn os_release_path(tempdir: &TempDir) -> PathBuf { tempdir.path().join("os-release").to_str().unwrap().into() } #[test] fn send_boot_success() { let server = Server::run(); server.expect( Expectation::matching(request::method_path("GET", "/metrics")) .respond_with(status_code(200)), ); let metrics_url = server.url_str("/metrics"); let tempdir = create_test_files(&metrics_url, &["a", "b"], true); let args = Arguments { config: Some(config_path(&tempdir)), log_level: LevelFilter::Off, os_release: Some(os_release_path(&tempdir)), command: Command::SendBootSuccess, }; main_inner(args, Box::new(MockCheck {})).unwrap(); } #[test] /// assert that a request is NOT sent to the server when the user sets `send_metrics` to false fn opt_out() { let server = Server::run(); // expect the get request zero times server.expect( Expectation::matching(request::method_path("GET", "/metrics")) .times(0) .respond_with(status_code(200)), ); let metrics_url = server.url_str("/metrics"); let tempdir = create_test_files(&metrics_url, &[], false); let args = Arguments { config: Some(config_path(&tempdir)), log_level: LevelFilter::Off, os_release: Some(os_release_path(&tempdir)), command: Command::SendBootSuccess, }; main_inner(args, Box::new(MockCheck {})).unwrap(); } #[test] /// assert that send-boot-success exits without error even when there is no HTTP server fn send_boot_success_no_server() { let metrics_url = "http://localhost:0/metrics"; let tempdir = create_test_files(metrics_url, &[], true); let args = Arguments { config: Some(config_path(&tempdir)), log_level: LevelFilter::Off, os_release: Some(os_release_path(&tempdir)), command: Command::SendBootSuccess, }; main_inner(args, Box::new(MockCheck {})).unwrap(); } #[test] /// assert that send-boot-success exits without error even if the server sends a 404 fn send_boot_success_404() { let server = Server::run(); server.expect( Expectation::matching(request::method_path("GET", "/metrics")) .respond_with(status_code(404)), ); let metrics_url = server.url_str("/metrics"); let tempdir = create_test_files(&metrics_url, &[], true); let args = Arguments { config: Some(config_path(&tempdir)), log_level: LevelFilter::Off, os_release: Some(os_release_path(&tempdir)), command: Command::SendBootSuccess, }; main_inner(args, Box::new(MockCheck {})).unwrap(); } #[test] /// assert that send-health-ping works as expected using a mock `ServiceCheck` fn send_health_ping() { let server = Server::run(); let matcher = all_of![ request::method_path("GET", "/metrics"), request::query(url_decoded(contains(("is_healthy", "false")))), request::query(url_decoded(contains(("failed_services", "afailed:1")))), ]; server.expect(Expectation::matching(matcher).respond_with(status_code(200))); let metrics_url = server.url_str("/metrics"); let tempdir = create_test_files(&metrics_url, &["afailed", "b"], true); let args = Arguments { config: Some(config_path(&tempdir)), log_level: LevelFilter::Off, os_release: Some(os_release_path(&tempdir)), command: Command::SendHealthPing, }; main_inner(args, Box::new(MockCheck {})).unwrap(); }
31.903409
103
0.632235
40e44999fb7f51f18370225d6ced72af64168aea
2,109
py
Python
cards/upgrade_rounds.py
MrCoft/EngiMod
65c90bd9231ac388d8af7849a1835914f1eefc78
[ "MIT" ]
null
null
null
cards/upgrade_rounds.py
MrCoft/EngiMod
65c90bd9231ac388d8af7849a1835914f1eefc78
[ "MIT" ]
null
null
null
cards/upgrade_rounds.py
MrCoft/EngiMod
65c90bd9231ac388d8af7849a1835914f1eefc78
[ "MIT" ]
null
null
null
from engi_mod import * Card( name = "Upgrade Rounds", type = "skill", target = "self", rarity = "rare", cost = 1, flags = dict( exhaust = "true", ), desc = 'Upgrade ALL of your Attack cards containing "Round" for the rest of combat. NL Exhaust.', upgrade_desc = 'Upgrade ALL of your Attack cards containing "Round" for the rest of combat.', code = """ AbstractDungeon.actionManager.addToBottom(new UpgradeRoundsAction()); """, upgrade_code = """ upgradeName(); exhaust = false; rawDescription = UPGRADE_DESCRIPTION; initializeDescription(); """, ) Action( id = "UpgradeRoundsAction", flags = dict( duration = "Settings.ACTION_DUR_MED", actionType = "ActionType.WAIT", ), code_FULL = r""" ArrayList<AbstractCard> upgraded; @Override public void update() { if (duration == Settings.ACTION_DUR_MED) { upgraded = new ArrayList<AbstractCard>(); final AbstractPlayer p = AbstractDungeon.player; upgradeAllCardsInGroup(p.hand); upgradeAllCardsInGroup(p.drawPile); upgradeAllCardsInGroup(p.discardPile); upgradeAllCardsInGroup(p.exhaustPile); isDone = true; if (!upgraded.isEmpty()) { AbstractDungeon.effectsQueue.add(new UpgradeShineEffect(Settings.WIDTH / 2.0f, Settings.HEIGHT / 2.0f)); SpireUtils.showCards(upgraded); } } } private void upgradeAllCardsInGroup(final CardGroup cardGroup) { for (final AbstractCard card : cardGroup.group) { if (RoundUtils.isRound(card) && card.canUpgrade()) { if (cardGroup.type == CardGroup.CardGroupType.HAND) { card.superFlash(); } card.upgrade(); card.applyPowers(); upgraded.add(card); } } } """, )
31.954545
124
0.541015
39b332868a21f824175731558b4c4b6fbf039554
102
sql
SQL
banach/tsquery4.sql
pleak-tools/pleak-sql-analysis
92cc6f97f3345aff5a138472f857e9cae9017b9c
[ "Unlicense" ]
1
2017-12-29T10:00:04.000Z
2017-12-29T10:00:04.000Z
banach/tsquery4.sql
pleak-tools/pleak-sql-analysis
92cc6f97f3345aff5a138472f857e9cae9017b9c
[ "Unlicense" ]
null
null
null
banach/tsquery4.sql
pleak-tools/pleak-sql-analysis
92cc6f97f3345aff5a138472f857e9cae9017b9c
[ "Unlicense" ]
null
null
null
SELECT SUM(ta.c2*tb.c2+ts3.c2) FROM ts2 as ta, ts2 as tb, ts3 where ta.c1 = ts3.c1 and ta.c1 = tb.c1;
51
101
0.666667
fe3c1259b8d2296e86f2f320a940a3554e36d6bf
731
swift
Swift
Sources/PolymorphSwiftGen/Models/Classes/Builders/ObjectMapper/Properties/Transformers/MultilingualStringObjectMapperTransformerMethodInfoBuilder.swift
Digipolitan/polymorph-swiftgen-swift
43112aa4d3d609ee7a1a9b8ad8fb41cdcce0c144
[ "BSD-3-Clause" ]
null
null
null
Sources/PolymorphSwiftGen/Models/Classes/Builders/ObjectMapper/Properties/Transformers/MultilingualStringObjectMapperTransformerMethodInfoBuilder.swift
Digipolitan/polymorph-swiftgen-swift
43112aa4d3d609ee7a1a9b8ad8fb41cdcce0c144
[ "BSD-3-Clause" ]
null
null
null
Sources/PolymorphSwiftGen/Models/Classes/Builders/ObjectMapper/Properties/Transformers/MultilingualStringObjectMapperTransformerMethodInfoBuilder.swift
Digipolitan/polymorph-swiftgen-swift
43112aa4d3d609ee7a1a9b8ad8fb41cdcce0c144
[ "BSD-3-Clause" ]
null
null
null
// // MultilingualStringObjectMapperTransformerMethodInfoBuilder.swift // PolymorphSwiftGen // // Created by Benoit BRIATTE on 14/11/2017. // import Foundation import PolymorphCore import CodeWriter import SwiftCodeWriter class MultilingualStringObjectMapperTransformerMethodInfoBuilder: ObjectMapperTransformerMethodInfoBuilder { func build(property: Property) throws -> ObjectMapperTransformerMethodInfo { return ObjectMapperTransformerMethodInfo(type: "MultilingualStringTransform", code: CodeBuilder.from(code: "return MultilingualStringTransform.shared"), modules: ["LocalizationToolkitObjectMapper"]) } }
34.809524
123
0.712722
51c2ce343209e4b1883b72d74c2203dc9cb4b4d8
16,684
swift
Swift
Sources/TextToSpeechV1/TextToSpeechDecoder.swift
turlodales/swift-sdk
4b5d42870e99b2086d0a702548ffe052c76b36c0
[ "Apache-2.0" ]
528
2017-01-18T23:28:11.000Z
2022-02-16T07:49:54.000Z
Sources/TextToSpeechV1/TextToSpeechDecoder.swift
turlodales/swift-sdk
4b5d42870e99b2086d0a702548ffe052c76b36c0
[ "Apache-2.0" ]
379
2017-01-18T04:00:52.000Z
2022-03-28T00:06:01.000Z
Sources/TextToSpeechV1/TextToSpeechDecoder.swift
turlodales/swift-sdk
4b5d42870e99b2086d0a702548ffe052c76b36c0
[ "Apache-2.0" ]
204
2017-01-18T18:44:37.000Z
2021-03-17T00:26:19.000Z
/** * (C) Copyright IBM Corp. 2016, 2021. * * 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 Foundation #if canImport(Clibogg) import Clibogg #endif #if canImport(Clibopus) import Clibopus #endif #if canImport(Copustools) import Copustools #endif internal class TextToSpeechDecoder { var pcmDataWithHeaders = Data() // object containing the decoded pcm data with wav headers // swiftlint:disable:next type_name private typealias opus_decoder = OpaquePointer // swiftlint:disable:next identifier_name private let MAX_FRAME_SIZE = Int32(960 * 6) private var streamState: ogg_stream_state // state of ogg stream private var page: ogg_page // encapsulates the data for an Ogg page private var syncState: ogg_sync_state // tracks the status of data during decoding private var packet: ogg_packet // packet within a stream passing information private var header: OpusHeader // header of the Opus file to decode private var decoder: opus_decoder // decoder to convert opus to pcm private var packetCount: Int64 = 0 // number of packets read during decoding private var beginStream = true // if decoding of stream has begun private var pageGranulePosition: Int64 = 0 // position of the packet data at page private var hasOpusStream = false // whether or not the opus stream has been created private var hasTagsPacket = false // whether or not the tags packet has been read private var opusSerialNumber: Int = 0 // the assigned serial number of the opus stream private var linkOut: Int32 = 0 // total number of bytes written from opus stream to pcmData private var totalLinks: Int = 0 // a count of the number of opus streams private var numChannels: Int32 = 1 // number of channels private var pcmDataBuffer = UnsafeMutablePointer<Float>.allocate(capacity: 0) private var sampleRate: Int32 = 48000 // sample rate for decoding. default value by Opus is 48000 private var preSkip: Int32 = 0 // number of samples to be skipped at beginning of stream private var granOffset: Int32 = 0 // where to begin reading the data from Opus private var frameSize: Int32 = 0 // number of samples decoded private var pcmData = Data() // decoded pcm data init(audioData: Data) throws { // set properties streamState = ogg_stream_state() page = ogg_page() syncState = ogg_sync_state() packet = ogg_packet() header = OpusHeader() // status to catch errors when creating decoder var status = Int32(0) decoder = opus_decoder_create(sampleRate, numChannels, &status) // initialize ogg sync state ogg_sync_init(&syncState) var processedByteCount = 0 while processedByteCount < audioData.count { // determine the size of the buffer to ask for var bufferSize: Int if audioData.count - processedByteCount > 200 { bufferSize = 200 } else { bufferSize = audioData.count - processedByteCount } // obtain a buffer from the syncState var bufferData: UnsafeMutablePointer<Int8> bufferData = ogg_sync_buffer(&syncState, bufferSize) // write data from the service into the syncState buffer bufferData.withMemoryRebound(to: UInt8.self, capacity: bufferSize) { bufferDataUInt8 in audioData.copyBytes(to: bufferDataUInt8, from: processedByteCount..<processedByteCount + bufferSize) } processedByteCount += bufferSize // notify syncState of number of bytes we actually wrote ogg_sync_wrote(&syncState, bufferSize) // attempt to get a page from the data that we wrote while ogg_sync_pageout(&syncState, &page) == 1 { if beginStream { // assign stream's number with the page. ogg_stream_init(&streamState, ogg_page_serialno(&page)) beginStream = false } if ogg_page_serialno(&page) != Int32(streamState.serialno) { ogg_stream_reset_serialno(&streamState, ogg_page_serialno(&page)) } // add page to the ogg stream ogg_stream_pagein(&streamState, &page) // save position of the current decoding process pageGranulePosition = ogg_page_granulepos(&page) // extract packets from the ogg stream until no packets are left try extractPacket(&streamState, &packet) } } if totalLinks == 0 { NSLog("Does not look like an opus file.") throw OpusError.invalidState } // add wav header addWAVHeader() // perform cleanup opus_multistream_decoder_destroy(decoder) if !beginStream { ogg_stream_clear(&streamState) } ogg_sync_clear(&syncState) } // Extract a packet from the ogg stream and store the extracted data within the packet object. private func extractPacket(_ streamState: inout ogg_stream_state, _ packet: inout ogg_packet) throws { // attempt to extract a packet from the ogg stream while ogg_stream_packetout(&streamState, &packet) == 1 { // execute if initial stream header if packet.b_o_s != 0 && packet.bytes >= 8 && memcmp(packet.packet, "OpusHead", 8) == 0 { // check if there's another opus head to see if stream is chained without EOS if hasOpusStream && hasTagsPacket { hasOpusStream = false opus_multistream_decoder_destroy(decoder) } // set properties if we are in a new opus stream if !hasOpusStream { if packetCount > 0 && opusSerialNumber == streamState.serialno { NSLog("Apparent chaining without changing serial number. Something bad happened.") throw OpusError.internalError } opusSerialNumber = streamState.serialno hasOpusStream = true hasTagsPacket = false linkOut = 0 packetCount = 0 totalLinks += 1 } else { NSLog("Warning: ignoring opus stream.") } } if !hasOpusStream || streamState.serialno != opusSerialNumber { break } // if first packet in logical stream, process header if packetCount == 0 { // create decoder from information in Opus header decoder = try processHeader(&packet, &numChannels, &preSkip) // Check that there are no more packets in the first page. let lastElementIndex = page.header_len - 1 let lacingValue = page.header[lastElementIndex] // A lacing value of 255 would suggest that the packet continues on the next page. if ogg_stream_packetout(&streamState, &packet) != 0 || lacingValue == 255 { throw OpusError.invalidPacket } granOffset = preSkip pcmDataBuffer = UnsafeMutablePointer<Float>.allocate(capacity: MemoryLayout<Float>.stride * Int(MAX_FRAME_SIZE) * Int(numChannels)) // deallocate pcmDataBuffer when the function ends, regardless if the function ended normally or with an error. defer { pcmDataBuffer.deallocate() } } else if packetCount == 1 { hasTagsPacket = true let lastElementIndex = page.header_len - 1 let lacingValue = page.header[lastElementIndex] if ogg_stream_packetout(&streamState, &packet) != 0 || lacingValue == 255 { NSLog("Extra packets on initial tags page. Invalid stream.") throw OpusError.invalidPacket } } else { var numberOfSamplesDecoded: Int32 var maxOut: Int64 var outSample: Int64 // Decode opus packet. numberOfSamplesDecoded = opus_multistream_decode_float(decoder, packet.packet, Int32(packet.bytes), pcmDataBuffer, MAX_FRAME_SIZE, 0) if numberOfSamplesDecoded < 0 { NSLog("Decoding error: \(String(describing: opus_strerror(numberOfSamplesDecoded)))") throw OpusError.internalError } frameSize = numberOfSamplesDecoded // Make sure the output duration follows the final end-trim // Output sample count should not be ahead of granpos value. maxOut = ((pageGranulePosition - Int64(granOffset)) * Int64(sampleRate) / 48000) - Int64(linkOut) outSample = try audioWrite(&pcmDataBuffer, numChannels, frameSize, &preSkip, &maxOut) linkOut += Int32(outSample) } packetCount += 1 } } // Process the Opus header and create a decoder with these values private func processHeader(_ packet: inout ogg_packet, _ channels: inout Int32, _ preskip: inout Int32) throws -> opus_decoder { // create status to capture errors var status = Int32(0) if opus_header_parse(packet.packet, Int32(packet.bytes), &header) == 0 { throw OpusError.invalidPacket } channels = header.channels preskip = header.preskip // update the sample rate if a reasonable one is specified in the header let rate = Int32(header.input_sample_rate) if rate >= 8000 && rate <= 192000 { sampleRate = rate } decoder = opus_multistream_decoder_create(sampleRate, channels, header.nb_streams, header.nb_coupled, &header.stream_map.0, &status) if status != OpusError.okay.rawValue { throw OpusError.badArgument } return decoder } // Write the decoded Opus data (now PCM) to the pcmData object private func audioWrite(_ pcmDataBuffer: inout UnsafeMutablePointer<Float>, _ channels: Int32, _ frameSize: Int32, _ skip: inout Int32, _ maxOut: inout Int64) throws -> Int64 { var sampOut: Int64 = 0 var tmpSkip: Int32 var outLength: UInt var shortOutput: UnsafeMutablePointer<CShort> var floatOutput: UnsafeMutablePointer<Float> shortOutput = UnsafeMutablePointer<CShort>.allocate(capacity: MemoryLayout<CShort>.stride * Int(MAX_FRAME_SIZE) * Int(channels)) if maxOut < 0 { maxOut = 0 } if skip != 0 { if skip > frameSize { tmpSkip = frameSize } else { tmpSkip = skip } skip -= tmpSkip } else { tmpSkip = 0 } floatOutput = pcmDataBuffer.advanced(by: Int(channels) * Int(tmpSkip)) outLength = UInt(frameSize) - UInt(tmpSkip) let maxLoop = Int(outLength) * Int(channels) for count in 0..<maxLoop { let maxMin = max(-32768, min(floatOutput.advanced(by: count).pointee * Float(32768), 32767)) let float2int = CShort((floor(0.5 + maxMin))) shortOutput.advanced(by: count).initialize(to: float2int) } shortOutput.withMemoryRebound(to: UInt8.self, capacity: Int(outLength) * Int(channels)) { shortOutputUint8 in if maxOut > 0 { pcmData.append(shortOutputUint8, count: Int(outLength) * 2) sampOut += Int64(outLength) } } return sampOut } // Add WAV headers to the decoded PCM data. // Refer to the documentation here for details: http://soundfile.sapp.org/doc/WaveFormat/ private func addWAVHeader() { var header = Data() let headerSize = 44 let pcmDataLength = pcmData.count let bitsPerSample = Int32(16) // RIFF chunk descriptor let chunkID = [UInt8]("RIFF".utf8) header.append(chunkID, count: 4) var chunkSize = Int32(pcmDataLength + headerSize - 4).littleEndian let chunkSizePointer = UnsafeBufferPointer(start: &chunkSize, count: 1) header.append(chunkSizePointer) let format = [UInt8]("WAVE".utf8) header.append(format, count: 4) // "fmt" sub-chunk let subchunk1ID = [UInt8]("fmt ".utf8) header.append(subchunk1ID, count: 4) var subchunk1Size = Int32(16).littleEndian let subchunk1SizePointer = UnsafeBufferPointer(start: &subchunk1Size, count: 1) header.append(subchunk1SizePointer) var audioFormat = Int16(1).littleEndian let audioFormatPointer = UnsafeBufferPointer(start: &audioFormat, count: 1) header.append(audioFormatPointer) var headerNumChannels = Int16(numChannels).littleEndian let headerNumChannelsPointer = UnsafeBufferPointer(start: &headerNumChannels, count: 1) header.append(headerNumChannelsPointer) var headerSampleRate = Int32(sampleRate).littleEndian let headerSampleRatePointer = UnsafeBufferPointer(start: &headerSampleRate, count: 1) header.append(headerSampleRatePointer) var byteRate = Int32(sampleRate * numChannels * bitsPerSample / 8).littleEndian let byteRatePointer = UnsafeBufferPointer(start: &byteRate, count: 1) header.append(byteRatePointer) var blockAlign = Int16(numChannels * bitsPerSample / 8).littleEndian let blockAlignPointer = UnsafeBufferPointer(start: &blockAlign, count: 1) header.append(blockAlignPointer) var headerBitsPerSample = Int16(bitsPerSample).littleEndian let headerBitsPerSamplePointer = UnsafeBufferPointer(start: &headerBitsPerSample, count: 1) header.append(headerBitsPerSamplePointer) // "data" sub-chunk let subchunk2ID = [UInt8]("data".utf8) header.append(subchunk2ID, count: 4) var subchunk2Size = Int32(pcmDataLength).littleEndian let subchunk2SizePointer = UnsafeBufferPointer(start: &subchunk2Size, count: 1) header.append(subchunk2SizePointer) pcmDataWithHeaders.append(header) pcmDataWithHeaders.append(pcmData) } } // MARK: - OpusError internal enum OpusError: Error { case okay case badArgument case bufferTooSmall case internalError case invalidPacket case unimplemented case invalidState case allocationFailure var rawValue: Int32 { switch self { case .okay: return OPUS_OK case .badArgument: return OPUS_BAD_ARG case .bufferTooSmall: return OPUS_BUFFER_TOO_SMALL case .internalError: return OPUS_INTERNAL_ERROR case .invalidPacket: return OPUS_INVALID_PACKET case .unimplemented: return OPUS_UNIMPLEMENTED case .invalidState: return OPUS_INVALID_STATE case .allocationFailure: return OPUS_ALLOC_FAIL } } init?(rawValue: Int32) { switch rawValue { case OPUS_OK: self = .okay case OPUS_BAD_ARG: self = .badArgument case OPUS_BUFFER_TOO_SMALL: self = .bufferTooSmall case OPUS_INTERNAL_ERROR: self = .internalError case OPUS_INVALID_PACKET: self = .invalidPacket case OPUS_UNIMPLEMENTED: self = .unimplemented case OPUS_INVALID_STATE: self = .invalidState case OPUS_ALLOC_FAIL: self = .allocationFailure default: return nil } } } // MARK: - OggError internal enum OggError: Error { case outOfSync case internalError }
40.992629
149
0.619696
3594d3a55332bc95daae42776512f94d7d949cb8
2,282
ps1
PowerShell
docker/docker-assets/scripts/test/test.ps1
philasmar/aws-sdk-net
64a49f18246bf903fdd1f01c5b5af36ab0fd6f94
[ "Apache-2.0" ]
1
2021-09-17T15:33:32.000Z
2021-09-17T15:33:32.000Z
docker/docker-assets/scripts/test/test.ps1
philasmar/aws-sdk-net
64a49f18246bf903fdd1f01c5b5af36ab0fd6f94
[ "Apache-2.0" ]
null
null
null
docker/docker-assets/scripts/test/test.ps1
philasmar/aws-sdk-net
64a49f18246bf903fdd1f01c5b5af36ab0fd6f94
[ "Apache-2.0" ]
1
2022-01-22T02:39:11.000Z
2022-01-22T02:39:11.000Z
$ErrorActionPreference = "Stop" Import-Module AWS.Tools.Common Import-Module $PSScriptRoot/../common/msbuild_tasks.psm1 Import-Module $PSScriptRoot/../common/utility.psm1 function Invoke-DotnetTest() { $testProjects = if ($env:TEST_LIST) { $env:TEST_LIST -split "," } else { $searchPath = if ($env:WORKING_DIRECTORY_FILTER) { if ($env:WORKING_DIRECTORY_FILTER -eq "NONE") { Get-Location } else { $env:WORKING_DIRECTORY_FILTER } } else { "test/unit" } Get-ChildItem -Path $searchPath -Recurse -Include "*.csproj", "*.fsproj", "*.vbproj" } if ($testProjects -ne "NONE") { $testProjects | ForEach-Object { dotnet test --verbosity normal $_ --configuration Release } } } if ($env:WORKING_DIRECTORY_PATH) { Set-Location $env:WORKING_DIRECTORY_PATH } Write-Host "Starting Tests..." if (![string]::IsNullOrEmpty($env:TESTING_ROLE_ARN)) { Write-Host "Writing [default] profile to ~/.aws/credentials to assume role $env:TESTING_ROLE_ARN during testing." # Build the CredentialProfile in memory $assumeRoleProfileOptions = New-Object Amazon.Runtime.CredentialManagement.CredentialProfileOptions $assumeRoleProfileOptions.RoleArn = $env:TESTING_ROLE_ARN $assumeRoleProfileOptions.CredentialSource = "EcsContainer" $assumeRoleProfile = New-Object Amazon.Runtime.CredentialManagement.CredentialProfile -ArgumentList "default",$assumeRoleProfileOptions # Save the [default] profile to ~/.aws/credentials so the SDK will pick it up during the test runs $sharedCredsFile = New-Object -TypeName Amazon.Runtime.CredentialManagement.SharedCredentialsFile $sharedCredsFile.RegisterProfile($assumeRoleProfile) } Set-NugetPackageSources -NugetPackageSources $env:PACKAGE_SOURCES if ($env:RUNNER_TYPE -eq "MSBUILD") { Write-Host "Using MSBuild to test." Invoke-MSBuild -Project $env:MSBUILD_PROJECT -Tasks $( $env:MSBUILD_TASK_LIST -split "," ) } elseif ($env:RUNNER_TYPE -eq "DOTNET") { Write-Host "Using the dotnet CLI to test." Invoke-DotnetTest } else { throw "Runner type $env:RUNNER_TYPE is unknown." }
28.886076
139
0.679229
469f9a9f3451939564a5109013f33f96157c722b
50
css
CSS
resources/assets/css/card.css
afernandez8781/messenger
6cc759f2ea4eb4ec806a57bd89a60836589d25e9
[ "MIT" ]
null
null
null
resources/assets/css/card.css
afernandez8781/messenger
6cc759f2ea4eb4ec806a57bd89a60836589d25e9
[ "MIT" ]
null
null
null
resources/assets/css/card.css
afernandez8781/messenger
6cc759f2ea4eb4ec806a57bd89a60836589d25e9
[ "MIT" ]
null
null
null
card{ box-shadow: 0px 0px 10px rgba(0,0,0,0.3); }
16.666667
42
0.64
39d61d5008cf308939a3bd24c0c294cc5c902c79
3,029
java
Java
server/src/java/nitobi-jsf-project/nitobi-jsf/src/main/java/com/nitobi/jsf/component/spotlight/UIFormHelperStep.java
stevengill/completeui
ea54e9f48075692be5dad313d78ef2bbe16531dd
[ "MIT" ]
1
2016-07-28T01:25:43.000Z
2016-07-28T01:25:43.000Z
server/src/java/nitobi-jsf-project/nitobi-jsf/src/main/java/com/nitobi/jsf/component/spotlight/UIFormHelperStep.java
stevengill/completeui
ea54e9f48075692be5dad313d78ef2bbe16531dd
[ "MIT" ]
null
null
null
server/src/java/nitobi-jsf-project/nitobi-jsf/src/main/java/com/nitobi/jsf/component/spotlight/UIFormHelperStep.java
stevengill/completeui
ea54e9f48075692be5dad313d78ef2bbe16531dd
[ "MIT" ]
null
null
null
/** * User: Eric Buitenhuis * Date: May 23, 2008 * Time: 10:03:32 PM */ package com.nitobi.jsf.component.spotlight; import com.nitobi.beans.JavascriptArgument; import com.nitobi.jsf.component.UIJavascriptMethodCallComponent; import com.nitobi.jsf.taglib.spotlight.FormHelperStepTag; import javax.faces.component.UIComponent; import javax.faces.component.UIViewRoot; import javax.faces.context.FacesContext; import java.util.Map; /** * UIFormHelperStep * * @author Eric Buitenhuis * @version 1.0 */ public class UIFormHelperStep extends UIJavascriptMethodCallComponent { public static final String DEFAULT_COMPONENT_TYPE = "UIFormHelperStep"; public static final String METHOD_NAME = "createFormHelperStep"; public static final String DEFAULT_FAMILY = "FormHelperStepFamily"; @Override public String getFamily() { return DEFAULT_FAMILY; } /** * The name of the method to call from the object variable. * * @param facesContext The current facesContext * @return The <code>String</code> representation of the method name. */ protected String getMethodName(FacesContext facesContext) { return METHOD_NAME; } /** * Creates the arguments to pass to the method. The JavascriptArgument object * handles the type of argument it is, whether it's a plain string, boolean, object, * function, etc. Each JavascriptArgument must be set individually by the component * to ensure it is output accordingly. * * @param attributes A Map of the component's set attributes. * @return An array of Strings in the order in which they will be presented as args. */ protected JavascriptArgument[] createArguments(Map<String, Object> attributes) { String formId = (String)attributes.get(FormHelperStepTag.FORMID); String fieldId = (String)attributes.get(FormHelperStepTag.FIELDID); FacesContext context = FacesContext.getCurrentInstance(); UIViewRoot viewRoot = context.getViewRoot(); UIComponent comp = viewRoot.findComponent(formId); if(comp != null) { fieldId = comp.getClientId(context) + ":" + fieldId; } StringBuffer sb = new StringBuffer("document.forms['"); sb.append(formId); sb.append("']['"); sb.append(fieldId); sb.append("']"); return new JavascriptArgument[] { new JavascriptArgument(sb.toString(), JavascriptArgument.ArgumentType.OBJECT), new JavascriptArgument(attributes.get(FormHelperStepTag.ACTION), JavascriptArgument.ArgumentType.STRING), new JavascriptArgument(attributes.get(FormHelperStepTag.DELAYAFTER), JavascriptArgument.ArgumentType.NUMBER), new JavascriptArgument(attributes.get(FormHelperStepTag.TEXT), JavascriptArgument.ArgumentType.STRING), new JavascriptArgument(attributes.get(FormHelperStepTag.FOCUS), JavascriptArgument.ArgumentType.OBJECT), }; } }
37.8625
125
0.700891
876271a51cceeba978b49d9c13ce80999ab29bb0
655
rs
Rust
src/dirs.rs
dan-t/clang-typecheck
66d0ccd3243511427df7112628a4b5f7ba31a32b
[ "BSD-3-Clause" ]
2
2016-08-26T10:24:43.000Z
2021-03-09T12:30:18.000Z
src/dirs.rs
dan-t/cpp-typecheck
66d0ccd3243511427df7112628a4b5f7ba31a32b
[ "BSD-3-Clause" ]
null
null
null
src/dirs.rs
dan-t/cpp-typecheck
66d0ccd3243511427df7112628a4b5f7ba31a32b
[ "BSD-3-Clause" ]
null
null
null
use std::fs; use std::path::{Path, PathBuf}; use ct_result::CtResult; use extern_dirs; lazy_static! { static ref CMD_CACHE_DIR: CtResult<PathBuf> = { extern_dirs::home_dir() .ok_or("Couldn't read home directory!".into()) .map(|d| d.join(".cpp_typecheck") .join("cache") .join("cmds")) }; } pub fn cmd_cache_dir() -> CtResult<&'static Path> { match *CMD_CACHE_DIR { Ok(ref dir) => { if ! dir.is_dir() { fs::create_dir_all(&dir)?; } Ok(dir) }, Err(ref err) => { Err(err.clone()) } } }
22.586207
58
0.487023
6b3b25291cccc4543a333e215744984352a38622
347
h
C
src/util/include/util/helpers.h
anish0x2a/tvp
baf87d6c927804e8779048dc897d65ea328a1e8a
[ "MIT" ]
1
2019-11-10T14:51:16.000Z
2019-11-10T14:51:16.000Z
src/util/include/util/helpers.h
anish0x2a/tvp
baf87d6c927804e8779048dc897d65ea328a1e8a
[ "MIT" ]
null
null
null
src/util/include/util/helpers.h
anish0x2a/tvp
baf87d6c927804e8779048dc897d65ea328a1e8a
[ "MIT" ]
null
null
null
/** * @file helpers.h * Declares some nifty helper functions */ #include <string> #include <unordered_map> #pragma once /** * Returns hexadecimal string representation for a bunch of integer types */ template <typename T> std::string num_to_hex(T i); std::string get_mnemonic(uint8_t opcode); std::string get_cb_mnemonic(uint8_t opcode);
19.277778
73
0.740634
a17ef6499971075aed9e229cb25696eac1d24911
1,006
h
C
share/solid_sim.h
pphilippos/Neverball-for-micro-bit
64e67e2dcc073548e805136995a0e2601285f5cd
[ "RSA-MD" ]
null
null
null
share/solid_sim.h
pphilippos/Neverball-for-micro-bit
64e67e2dcc073548e805136995a0e2601285f5cd
[ "RSA-MD" ]
null
null
null
share/solid_sim.h
pphilippos/Neverball-for-micro-bit
64e67e2dcc073548e805136995a0e2601285f5cd
[ "RSA-MD" ]
1
2016-08-16T14:25:01.000Z
2016-08-16T14:25:01.000Z
/* * Copyright (C) 2003 Robert Kooima * * NEVERBALL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published * by the Free Software Foundation; either version 2 of the License, * or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. */ #ifndef SOLID_SIM_H #define SOLID_SIM_H #include "solid_vary.h" #include "solid_all.h" /*---------------------------------------------------------------------------*/ void sol_init_sim(struct s_vary *); void sol_quit_sim(void); void sol_move(struct s_vary *, cmd_fn, float); float sol_step(struct s_vary *, cmd_fn, const float *, float, int, int *); /*---------------------------------------------------------------------------*/ #endif
31.4375
79
0.612326
df623ee48d8b78a9f6a31a33747c56cc3e29b8e0
958
dart
Dart
lib/bloc/item_bloc.dart
shawnlauzon/insert-bloc
37436e8c75fa56cac60a539967dab82eda63781a
[ "MIT" ]
null
null
null
lib/bloc/item_bloc.dart
shawnlauzon/insert-bloc
37436e8c75fa56cac60a539967dab82eda63781a
[ "MIT" ]
null
null
null
lib/bloc/item_bloc.dart
shawnlauzon/insert-bloc
37436e8c75fa56cac60a539967dab82eda63781a
[ "MIT" ]
1
2021-10-17T14:50:07.000Z
2021-10-17T14:50:07.000Z
import 'package:bloc/bloc.dart'; import 'package:insert_bloc/item_repository.dart'; import 'package:meta/meta.dart'; import '../model/item.dart'; part 'item_event.dart'; part 'item_state.dart'; class ItemBloc extends Bloc<ItemEvent, ItemState> { ItemBloc({required this.repository, required this.name}) : super(ItemState.initial) { on<LoadItem>((event, emit) { emit(ItemState( item: repository.getItem(name)!, loadingStatus: LoadingStatus.success)); }); on<ItemLoaded>((event, emit) { emit(ItemState(item: event.item, loadingStatus: LoadingStatus.success)); }); on<AddChild>((event, emit) { emit( ItemState( item: state.item!.copyWith( children: [event.name, ...state.item!.children], ), loadingStatus: LoadingStatus.success, ), ); }); add(LoadItem()); } final ItemRepository repository; final String name; }
25.210526
78
0.628392
7095ba28cff9be1ac264f2fd6ea57f0309bccf72
1,828
c
C
src/core/file.c
creikey/camengine
36b4557e82a64380cf2433bb9a7c98f01c82b022
[ "MIT" ]
null
null
null
src/core/file.c
creikey/camengine
36b4557e82a64380cf2433bb9a7c98f01c82b022
[ "MIT" ]
null
null
null
src/core/file.c
creikey/camengine
36b4557e82a64380cf2433bb9a7c98f01c82b022
[ "MIT" ]
2
2017-10-28T05:46:10.000Z
2017-11-05T03:41:02.000Z
#include <stdio.h> #include <string.h> #include <stdbool.h> #include <operomnia1/error.h> #include <operomnia1/memory.h> #include <operomnia1/file.h> int char_to_numb( char in_char ) { return in_char - '0'; } int get_strchar_index( char * in_str, char to_find, bool backwards ) { size_t str_size = strlen( in_str ) + 1; if( backwards ) { int i = str_size-1; for(; i > 0; i-- ) { if( in_str[i] == to_find ) { break; } } if( in_str[i] != to_find ) { return -1; } return i; } else { size_t i; for( i = 0; i < str_size-1; i++ ) { if( in_str[i] == to_find ) { break; } } if( in_str[i] != to_find ) { return -1; } return i; } } bool ends_with(const char *str, const char *suffix) { //if (!str || !suffix) // return 0; //check_if_null( str, "in ends with function, str" ); //check_if_null( suffix, "in ends with function, suffix" ); if( str == NULL ) { error( "variable str is null", CLOSE ); } if( suffix == NULL ) { error( "suffix is null", CLOSE ); } size_t lenstr = strlen(str); size_t lensuffix = strlen(suffix); if (lensuffix > lenstr) return 0; return strncmp(str + lenstr - lensuffix, suffix, lensuffix) == 0; } char * fix_directory( const char * in_str ) { if( in_str[strlen(in_str)-1] == '/' ) { //char to_prepend[strlen(in_str)]; size_t str_size = strlen( in_str ) + 1; char * to_prepend = op_malloc( str_size ); memcpy( to_prepend, in_str, str_size ); return to_prepend; } else { size_t str_size = strlen( in_str ) + 1; char * to_prepend = op_malloc( str_size+1 ); memcpy( to_prepend, in_str, str_size ); to_prepend[str_size-1] = '/'; to_prepend[str_size] = '\0'; return to_prepend; } }
25.041096
70
0.573304
2060e89b8b1d720b22be4e0784f53f8e4600c957
590
css
CSS
public/main.css
mbaghel/shortn
714ea0a4c1aedccc962901ec7db98ccc3d294e4a
[ "MIT" ]
1
2020-08-07T16:19:35.000Z
2020-08-07T16:19:35.000Z
public/main.css
mbaghel/shortn
714ea0a4c1aedccc962901ec7db98ccc3d294e4a
[ "MIT" ]
1
2021-05-10T13:34:33.000Z
2021-05-10T13:34:33.000Z
public/main.css
mbaghel/shortn
714ea0a4c1aedccc962901ec7db98ccc3d294e4a
[ "MIT" ]
null
null
null
i { vertical-align: top; } #url-input { font-size: 1em; padding: 12px 20px; display: inline-block; border: 2px inset #ccc; border-radius: 4px 0 0 4px; box-sizing: border-box; margin: 2px; } button { background-color: #2196f3; vertical-align: bottom; color: white; padding: 11px 20px; border: none; border-radius: 4px; cursor: pointer; margin: 2px; } button:hover { background-color: #1e88e5; } .hidden { display: none; } #target { line-height: 46px; } #copy-input { position: absolute; left: -10000px; } #url-form { margin-bottom: 2rem; }
12.826087
29
0.642373
56d1e1de3ca4279418f0af976705360ad7fbfa12
110
ts
TypeScript
packages/Molecules/types/Molecules/BottomNavigation/index.d.ts
SyedUmerHasan/design-system
8bc365dc062b836a26e1ba93eeebdbd18414732c
[ "MIT" ]
null
null
null
packages/Molecules/types/Molecules/BottomNavigation/index.d.ts
SyedUmerHasan/design-system
8bc365dc062b836a26e1ba93eeebdbd18414732c
[ "MIT" ]
8
2021-11-01T21:50:39.000Z
2022-03-28T13:46:36.000Z
packages/Molecules/types/Molecules/BottomNavigation/index.d.ts
SyedUmerHasan/design-system
8bc365dc062b836a26e1ba93eeebdbd18414732c
[ "MIT" ]
null
null
null
export * from './src/BottomNavigation'; export { default as BottomNavigation } from './src/BottomNavigation';
36.666667
69
0.754545
fb3a1d722a9e4367d42eacec130cd9790e19b06f
4,066
java
Java
Variant Programs/1-2/4/production/Fabricator.java
hjc851/Dataset2-HowToDetectAdvancedSourceCodePlagiarism
a42ced1d5a92963207e3565860cac0946312e1b3
[ "MIT" ]
null
null
null
Variant Programs/1-2/4/production/Fabricator.java
hjc851/Dataset2-HowToDetectAdvancedSourceCodePlagiarism
a42ced1d5a92963207e3565860cac0946312e1b3
[ "MIT" ]
null
null
null
Variant Programs/1-2/4/production/Fabricator.java
hjc851/Dataset2-HowToDetectAdvancedSourceCodePlagiarism
a42ced1d5a92963207e3565860cac0946312e1b3
[ "MIT" ]
null
null
null
package production; import java.util.Random; import lapse.DaysHandler; import producesJewels.ExtractableObjective; import repository.*; import read.*; public abstract class Fabricator { protected static final Random stochasticProduction = new Random(); private static int farmUndercut = 0; protected ManufacturersCantons governmental; private double cultivationHateful; private double processingOrbit; protected double correctDeliveryThing; protected double realisticJammedChance; protected double effectiveThirstedPeriods; protected ExtractableObjective circulatingSubject; protected Storeroom aheadWarehousing, pastDepot; private int observatoryPeg = farmUndercut++; protected void synchronising( double intend, double ramble, Storeroom ahead, Storeroom predecessor) { this.cultivationHateful = intend; this.processingOrbit = ramble; this.aheadWarehousing = ahead; this.pastDepot = predecessor; this.correctDeliveryThing = 0; this.effectiveThirstedPeriods = 0; this.realisticJammedChance = 0; } public void systemAgainTotem() { if (this.circulatingSubject != null) { try { this.impressFlowObjetMouStowage(); } catch (WarehousingHighLimitation cma) { this.governmental = ManufacturersCantons.intercepting; this.realisticJammedChance -= DaysHandler.ongoingMeter(); return; } } try { this.welcomeSucceedingArtifact(); } catch (StoredVacuousExemption ej) { this.governmental = ManufacturersCantons.emaciated; this.effectiveThirstedPeriods -= DaysHandler.ongoingMeter(); return; } double postscript = cultivationHateful + processingOrbit * (stochasticProduction.nextDouble() - 0.5); this.correctDeliveryThing += postscript; CelebrationBacklog.circulatingConvoy() .incorporatedRally( new VintnerGathering( DaysHandler.ongoingMeter() + postscript, VintnerGathering.ExpectedTerminusCavil, this)); } protected abstract void welcomeSucceedingArtifact() throws StoredVacuousExemption; protected abstract void impressFlowObjetMouStowage() throws WarehousingHighLimitation; public void unlatch() { try { this.impressFlowObjetMouStowage(); this.realisticJammedChance += DaysHandler.ongoingMeter(); this.governmental = ManufacturersCantons.collaborate; CelebrationBacklog.circulatingConvoy() .incorporatedRally( new VintnerGathering( DaysHandler.ongoingMeter(), VintnerGathering.DerriereBegins, this)); } catch (WarehousingHighLimitation ye) { this.governmental = ManufacturersCantons.intercepting; return; } } public void unstarve() { this.governmental = ManufacturersCantons.collaborate; this.effectiveThirstedPeriods += DaysHandler.ongoingMeter(); CelebrationBacklog.circulatingConvoy() .incorporatedRally( new VintnerGathering( DaysHandler.ongoingMeter(), VintnerGathering.DerriereBegins, this)); } public ManufacturersCantons presentlyForeign() { return this.governmental; } public String toString() { return "Producer" + observatoryPeg; } public String estimates() { if (governmental == ManufacturersCantons.emaciated) { this.effectiveThirstedPeriods += DaysHandler.ongoingMeter(); this.governmental = ManufacturersCantons.slumbering; } else if (this.governmental == ManufacturersCantons.intercepting) { this.realisticJammedChance += DaysHandler.ongoingMeter(); this.governmental = ManufacturersCantons.slumbering; } else { this.governmental = ManufacturersCantons.slumbering; } return String.format( "| %-14s | %-12.10s | %-8.8s | %-8.8s |", this, this.correctDeliveryThing / DaysHandler.ongoingMeter() * 100.0, this.effectiveThirstedPeriods / DaysHandler.ongoingMeter() * 100.0, this.realisticJammedChance / DaysHandler.ongoingMeter() * 100.0); } }
33.883333
89
0.714461
90ae2991b7e1dfdacad4a9f32bdb34e0c302d1d2
733
py
Python
src/updateDisplay.py
paulhorstmann/qrcode-e-link-display
ff625215e18528e46093641570d968c88af839c4
[ "MIT" ]
null
null
null
src/updateDisplay.py
paulhorstmann/qrcode-e-link-display
ff625215e18528e46093641570d968c88af839c4
[ "MIT" ]
null
null
null
src/updateDisplay.py
paulhorstmann/qrcode-e-link-display
ff625215e18528e46093641570d968c88af839c4
[ "MIT" ]
null
null
null
#!/usr/bin/python # -*- coding:utf-8 -*- from PIL import Image import time import sys import os from waveshare_epd import epd5in83bc picdir = os.path.join(os.path.dirname( os.path.dirname(os.path.realpath(__file__))), 'src/assets/img') try: epd = epd5in83bc.EPD() # print("init and Clear") epd.init() # epd.Clear() # time.sleep(1) HBlackimage = Image.open(os.path.join(picdir, sys.argv[1] + '.site.bmp')) HRYimage = Image.open(os.path.join(picdir, 'blank.bmp')) epd.display(epd.getbuffer(HBlackimage), epd.getbuffer(HRYimage)) epd.sleep() except IOError as e: print(e) except KeyboardInterrupt: print("ctrl + c:") epd5in83bc.epdconfig.module_exit() exit() print('done')
21.558824
77
0.665757
7d4a250e9193f97f4dccba2791dfec390dc1ea7e
1,000
asm
Assembly
programs/oeis/101/A101362.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/101/A101362.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/101/A101362.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A101362: a(n) = (n+1)*n^4. ; 0,2,48,324,1280,3750,9072,19208,36864,65610,110000,175692,269568,399854,576240,810000,1114112,1503378,1994544,2606420,3360000,4278582,5387888,6716184,8294400,10156250,12338352,14880348,17825024,21218430,25110000,29552672,34603008,40321314,46771760,54022500,62145792,71218118,81320304,92537640,104960000,118681962,133802928,150427244,168664320,188628750,210440432,234224688,260112384,288240050,318750000,351790452,387515648,426085974,467668080,512435000,560566272,612248058,667673264,727041660,790560000,858442142,930909168,1008189504,1090519040,1178141250,1271307312,1370276228,1475314944,1586698470,1704710000,1829641032,1961791488,2101469834,2248993200,2404687500,2568887552,2741937198,2924189424,3116006480,3317760000,3529831122,3752610608,3986498964,4231906560,4489253750,4758970992,5041498968,5337288704,5646801690,5970510000,6308896412,6662454528,7031688894,7417115120,7819260000,8238661632,8675869538,9131444784,9605960100 mov $1,$0 pow $0,5 pow $1,4 add $0,$1
125
931
0.863
4d6a469241d23c6bf5c916fc7f04354f7fae8d01
13,805
ps1
PowerShell
src/common_functions.ps1
dongaba/tverrec
f76dffcfb9c613fc1f06cd501d032778a00290d4
[ "Apache-2.0" ]
4
2021-04-27T23:34:39.000Z
2022-01-10T17:24:42.000Z
src/common_functions.ps1
dongaba/tverrec
f76dffcfb9c613fc1f06cd501d032778a00290d4
[ "Apache-2.0" ]
null
null
null
src/common_functions.ps1
dongaba/tverrec
f76dffcfb9c613fc1f06cd501d032778a00290d4
[ "Apache-2.0" ]
null
null
null
################################################################################### # tverrec : TVerビデオダウンローダ # # 共通関数スクリプト # # Copyright (c) 2021 dongaba # # 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. # ################################################################################### #---------------------------------------------------------------------- #GEO IPの確認 #---------------------------------------------------------------------- function checkGeoIP () { if ((Invoke-RestMethod -Uri 'http://ip-api.com/json/').countryCode -ne 'JP') { Invoke-RestMethod -Uri ('http://ip-api.com/json/' + (Invoke-WebRequest -Uri 'http://ifconfig.me/ip').Content) Write-Host '日本のIPアドレスからしか接続できません。VPN接続してください。' -ForegroundColor Red exit } } #---------------------------------------------------------------------- #設定で指定したファイル・フォルダの存在チェック #---------------------------------------------------------------------- function checkRequiredFile { if (Test-Path $chromeUserDataPath -PathType Container) {} else { Write-Error 'ChromeのUserDataフォルダが存在しません。終了します。' ; exit } if (Test-Path $downloadBasePath -PathType Container) {} else { Write-Error 'ビデオ保存先フォルダが存在しません。終了します。' ; exit } if (Test-Path $ffmpegPath -PathType Leaf) {} else { Write-Error 'ffmpeg.exeが存在しません。終了します。' ; exit } if (Test-Path $crxPath -PathType Leaf) {} else { Write-Error 'tver.crxが存在しません。終了します。' ; exit } if (Test-Path $webDriverPath -PathType Leaf) {} else { Write-Error 'WebDriver.dllが存在しません。終了します。' ; exit } if (Test-Path $webDriverSupportPath -PathType Leaf) {} else { Write-Error 'WebDriver.Support.dllが存在しません。終了します。' ; exit } if (Test-Path $seleniumPath -PathType Leaf) {} else { Write-Error 'Selenium.WebDriverBackedSelenium.dllが存在しません。終了します。' ; exit } if (Test-Path $iniFile -PathType Leaf) {} else { Write-Error 'ユーザ設定ファイルが存在しません。終了します。' ; exit } if (Test-Path $keywordFile -PathType Leaf) {} else { Write-Error 'ダウンロード対象ジャンリリストが存在しません。終了します。' ; exit } if (Test-Path $ignoreFile -PathType Leaf) {} else { Write-Error 'ダウンロード対象外ビデオリストが存在しません。終了します。' ; exit } if (Test-Path $listFile -PathType Leaf) {} else { Write-Error 'ダウンロードリストが存在しません。終了します。' ; exit } } #---------------------------------------------------------------------- #タイムスタンプ更新 #---------------------------------------------------------------------- function getTimeStamp { $timeStamp = Get-Date -UFormat '%Y-%m-%d %H:%M:%S' return $timeStamp } #---------------------------------------------------------------------- #ffmpegプロセスの確認と待機 #---------------------------------------------------------------------- function getFfmpegProcessList ($parallelDownloadNum) { #ffmpegのプロセスが設定値を超えたら一時待機 try { $ffmpegCount = (Get-Process -ErrorAction Ignore -Name ffmpeg).Count } catch { $ffmpegCount = 0 } Write-Verbose "現在のダウンロードプロセス一覧 ( $ffmpegCount 個 )" while ($ffmpegCount -ge $parallelDownloadNum) { Write-Host "ダウンロードが $parallelDownloadNum 多重に達したので一時待機します。 ( $(getTimeStamp) )" -ForegroundColor DarkGray Start-Sleep -Seconds 60 #1分待機 $ffmpegCount = (Get-Process -ErrorAction Ignore -Name ffmpeg).Count } } #---------------------------------------------------------------------- #ffmpegプロセスの起動 #---------------------------------------------------------------------- function startFfmpeg ($videoName, $videoPath , $videoURL, $genre, $title, $subtitle, $description, $media, $videoPage, $ffmpegPath) { $ffmpegArgument = ' -y -i ' + $videoURL ` + ' -vcodec copy -acodec copy' ` + ' -movflags faststart ' ` + ' -metadata genre="' + $genre.Replace('"', '”') + '"' ` + ' -metadata title="' + $title.Replace('"', '”') + '"' ` + ' -metadata show="' + $title.Replace('"', '”') + '"' ` + ' -metadata subtitle="' + $subtitle.Replace('"', '”') + '"' ` + ' -metadata description="' + $description.Replace('"', '”') + '"' ` + ' -metadata copyright="' + $media.Replace('"', '”') + '"' ` + ' -metadata network="' + $media.Replace('"', '”') + '"' ` + ' -metadata producer="' + $media.Replace('"', '”') + '"' ` + ' -metadata URL="' + $videoPage.Replace('"', '”') + '"' ` + ' -metadata year="' + $(Get-Date -UFormat '%Y') + '"' ` + ' -metadata creation_time="' + $(getTimeStamp) + '"' $ffmpegArgument = $ffmpegArgument + ' "' + $videoPath + '"' Write-Debug "ffmpeg起動コマンド:$ffmpegPath $ffmpegArgument" $null = Start-Process -FilePath ($ffmpegPath) -ArgumentList $ffmpegArgument -PassThru -WindowStyle Hidden #Minimize or Hidden } #---------------------------------------------------------------------- #ファイル名・フォルダ名に禁止文字の削除 #---------------------------------------------------------------------- Function removeInvalidFileNameChars { param( [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [String]$Name ) $invalidChars = [IO.Path]::GetInvalidFileNameChars() -join '' $re = '[{0}]' -f [RegEx]::Escape($invalidChars) return ($Name -replace $re) } #---------------------------------------------------------------------- #全角→半角(英数のみ) #---------------------------------------------------------------------- function conv2Narrow { Param([string]$Text) #変換元テキストを引数に指定 # 正規表現のパターン $regexAlphaNumeric = '[0-9A-Za-z#$%&-_/[]{}()<> ]+' # MatchEvaluatorデリゲート $matchEvaluator = { param([Match]$match) [strings]::StrConv($match, [VbStrConv]::Narrow, 0x0411) } # regexクラスのReplaceメソッドを使用。第2引数にMatchEvaluatorデリゲートを指定 $result = [regex]::Replace($Text, $regexAlphaNumeric, $matchEvaluator) return $result } #---------------------------------------------------------------------- #CSVファイル読み込み # useage : $val = getValue $filePath $keyName #---------------------------------------------------------------------- function getValue($filePath, $keyName) { $hash = @{} # ファイルの存在を確認する if ((Test-Path $filePath) -eq $false) { Write-Error('CSV file not found : ' + $filePath) return '' } # CSVファイルを読み込んで、ハッシュに変換する Import-Csv $filePath -Encoding UTF8 | ForEach-Object { $hash.Add($_.name, $_) } # キーが存在しているか確認する if ($hash.ContainsKey($keyName) -ne $true) { Write-Error('Key not found : ' + $keyName) return '' } # value項目を返す return $hash[$keyName].value } #---------------------------------------------------------------------- #録画リストの情報の追加 #---------------------------------------------------------------------- function insertVideoDB { #録画リストに行追加 Write-Verbose '録画済みリストに行を追加します。' $newVideo = [pscustomobject]@{ videoID = $videoID ; videoPage = $videoPage ; genre = $genre ; title = $title ; subtitle = $subtitle ; media = $media ; broadcastDate = $broadcastDate ; downloadDate = $timeStamp videoName = $videoName ; videoPath = $videoPath ; } #$newVideo Write-Debug 'リストに以下を追加' $newVideo $newVideo | Format-Table Write-Debug 'CSVファイルを上書き出力します' $newList = @() $newList += $videoLists $newList += $newVideo $newList | Export-Csv $listFile -NoTypeInformation -Encoding UTF8 return $newList } #---------------------------------------------------------------------- #録画リストの情報を検索 #---------------------------------------------------------------------- function updatetVideoDB { # #存在しない検索 # $videoLists = Import-Csv $dbPath -Encoding UTF8 | Where-Object { $_.videoID -eq '/feature/f0072557' } # if ($videoLists -eq $null) { Write-Debug '該当なし' } # # #存在する検索 # $videoLists = Import-Csv $dbPath -Encoding UTF8 | Where-Object { $_.videoID -eq '/feature/f0072556' } # if ($videoLists -ne $null) { Write-Debug '外灯あり' } # # Write-Verbose '録画済みリストの既存レコードを更新します。' # $videoLists | Export-Csv 'db/tverlist.csv' -NoTypeInformation -Encoding UTF8 } #---------------------------------------------------------------------- #録画リストの情報を削除 #---------------------------------------------------------------------- function deletetVideoDB { } #---------------------------------------------------------------------- #録画リストの情報を削除 #---------------------------------------------------------------------- function cleanupVideoDB { # # CSVファイルからvideoIDとvideoNameの組み合わせでの重複を削除 # Write-Verbose '録画済みリストの重複レコードを削除します。' # $newVideoLists = $videoLists | Sort-Object -Property videoID,videoName -Unique # foreach ($newVideoList in $newVideoLists) # { # #$videoList.videoID # } # # return $videoLists } #---------------------------------------------------------------------- #Chrome起動パラメータ設定 #---------------------------------------------------------------------- function setChromeAttributes($chromeUserDataPath, [ref]$chromeOptions, $crxPath) { $chromeOptions.value = New-Object OpenQA.Selenium.Chrome.ChromeOptions $chromeOptions.value.AddArgument("--user-data-dir=$chromeUserDataPath") #ユーザプロファイル指定 $chromeOptions.value.AddArgument('--lang=ja-JP') #日本語(ヘッドレスにすると英語になってしまうらしい) $chromeOptions.value.AddArgument('--window-size=1440,900') #画面サイズ指定 $chromeOptions.value.AddArgument('--disable-sync') #データ同期機能を無効 $chromeOptions.value.AddArgument('--disable-geolocation') #Geolocation APIを無効 $chromeOptions.value.AddArgument('--disable-infobars') #通知バー無効化 $chromeOptions.value.AddArgument('--disable-java') #Javaを無効 #$chromeOptions.value.AddArgument('--headless') #Chrome をヘッドレスモードで実行する (拡張機能がある場合は使用できない) #$chromeOptions.value.AddArgument('--disable-gpu') #ヘッドレスの際に暫定的に必要なフラグ #$chromeOptions.value.AddArgument('--remote-debugging-port=9222') #ヘッドレスの際に。使い方わからないけど。。。 $chromeOptions.value.AddArgument('--dns-prefetch-disable') #DNSプリフェッチを無効 $chromeOptions.value.AddArgument('--disable-custom-jumplist') #Windows 7においてカスタムジャンプリストを無効 $chromeOptions.value.AddArgument('--disable-desktop-notifications') #デスクトップ通知を無効 $chromeOptions.value.AddArgument('--disable-application-cache') #HTML5のApplication Cacheを無効 $chromeOptions.value.AddArgument('--disable-remote-fonts') #リモートWebフォントのサポートを無効 $chromeOptions.value.AddArgument('--disable-content-prefetch') #Link prefetchingを無効 $chromeOptions.value.AddArgument('--disable-logging') #ログ出力を無効にする $chromeOptions.value.AddArgument('--disable-metrics') # $chromeOptions.value.AddArgument('--disable-metrics-reporting') # $chromeOptions.value.AddArgument('--disable-hang-monitor') #「ページ応答無し」のダイアログの表示を抑制 $chromeOptions.value.AddArgument('--no-default-browser-check') #デフォルトブラウザチェックをしない $chromeOptions.value.AddArgument('--enable-easy-off-store-extension-install') #公式以外からの拡張機能のインストールを有効化 $chromeOptions.value.AddExtensions("$crxPath") #ビデオURLをクリップボードにコピーする拡張機能 $chromeOptions.value.AddUserProfilePreference('credentials_enable_service', $false) $chromeOptions.value.AddUserProfilePreference('profile.password_manager_enabled', $false) } #---------------------------------------------------------------------- #URLをChromeにわたす #---------------------------------------------------------------------- function openVideo ([ref]$chromeDriver, $videoPage) { for ($i = 0; $i -lt 30; $i++) { try { $chromeDriver.value.url = $videoPage #ChromeにURLを渡す break } catch { Write-Verbose 'ChromeにURLを渡せませんでした。再試行します。' } Start-Sleep -Milliseconds 1000 } } #---------------------------------------------------------------------- #ページ読み込み待ち、再生ボタンクリック、クリップボードにビデオURLを入れる #---------------------------------------------------------------------- function playVideo([ref]$chromeDriver) { $videoURL = '' #----------------------------------- #ページ読み込み待ちループここから for ($i = 0; $i -lt 30; $i++) { try { $element = $chromeDriver.value.FindElementByXpath('/html/body') break } catch { Write-Verbose '読み込み完了していないため再生ボタン押せませんでした。再試行します。' } Start-Sleep -Milliseconds 1000 } $element.Click() # ; $element.SendKeys($chromeDriver.value.keys.Enter) Write-Verbose 'ビデオページを読み込みました。ビデオURLを解析中です。' for ($i = 0; $i -lt 30; $i++) { #クリップボードにURLがが入ったら抜ける $videoURL = Get-Clipboard -Raw $regexURL = '([a-zA-Z]{3,})://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)*?' #正規表現URLパターン if ($videoURL -notmatch $regexURL) { } else { Write-Verbose 'ビデオURLを取得しました。' break #ループを抜ける } Start-Sleep -Milliseconds 1000 } $chromeDriver.value.PageSource > $(Join-Path $debugDir 'last_video.html') return $videoURL #ページ読み込み待ちループここまで #----------------------------------- } #---------------------------------------------------------------------- #Chrome終了 #---------------------------------------------------------------------- function stopChrome ([ref]$chromeDriver) { Write-Verbose 'Chromeを終了します。' $ErrorActionPreference = 'silentlycontinue' $chromeDriver.value.Dispose() Stop-Process -Name chromedriver $ErrorActionPreference = 'continue' Write-Verbose 'Chromeを終了しました。' } #---------------------------------------------------------------------- #保存ファイル名を設定 #---------------------------------------------------------------------- function setVideoName ($title, $subtitle, $broadcastDate) { Write-Verbose 'ビデオファイル名を整形します。' if ($subtitle -eq '') { if ($broadcastDate -eq '') { $videoName = $title } else { $videoName = $title + ' ' + $broadcastDate } } else { $videoName = $title + ' ' + $broadcastDate + ' ' + $subtitle } if ($videoName.length -gt 120) { $videoName = $videoName.Substring(0, 120) + '……' } $videoName = $videoName + '.mp4' $videoName = removeInvalidFileNameChars (conv2Narrow $videoName) #windowsでファイル名にできない文字列を除去 return $videoName }
38.030303
133
0.560739
3fbf80280c24bd9eefd38698ac49be72bb33a734
322
asm
Assembly
libsrc/math/cpcmath/cos.asm
andydansby/z88dk-mk2
51c15f1387293809c496f5eaf7b196f8a0e9b66b
[ "ClArtistic" ]
1
2020-09-15T08:35:49.000Z
2020-09-15T08:35:49.000Z
libsrc/math/cpcmath/cos.asm
andydansby/z88dk-MK2
51c15f1387293809c496f5eaf7b196f8a0e9b66b
[ "ClArtistic" ]
null
null
null
libsrc/math/cpcmath/cos.asm
andydansby/z88dk-MK2
51c15f1387293809c496f5eaf7b196f8a0e9b66b
[ "ClArtistic" ]
null
null
null
; ; CPC Maths Routines ; ; August 2003 **_|warp6|_** <kbaccam /at/ free.fr> ; ; $Id: cos.asm,v 1.2 2009/06/22 21:44:17 dom Exp $ ; INCLUDE "cpcfirm.def" INCLUDE "cpcfp.def" XLIB cos XDEF cosc LIB get_para .cos call get_para call firmware .cosc defw CPCFP_FLO_COS ret
14.636364
50
0.583851
db2b048a96b04d44335e45130b8d97e29590564d
693
dart
Dart
lib/components/collection_horizon_collection.dart
Project-XPolaris/YouComic-Mobile-Suit
87a9659d2101f38b2d907b0b27da8d03ae5abe6e
[ "MIT" ]
4
2020-04-25T03:33:49.000Z
2021-04-23T04:36:20.000Z
lib/components/collection_horizon_collection.dart
Project-XPolaris/YouComic-Mobile-Suit
87a9659d2101f38b2d907b0b27da8d03ae5abe6e
[ "MIT" ]
null
null
null
lib/components/collection_horizon_collection.dart
Project-XPolaris/YouComic-Mobile-Suit
87a9659d2101f38b2d907b0b27da8d03ae5abe6e
[ "MIT" ]
null
null
null
import 'package:flutter/material.dart'; import 'package:youcomic/api/model/collection.dart'; import 'package:youcomic/components/collection_card.dart'; import 'horizon_card_collection.dart'; class CollectionHorizonCollection extends StatelessWidget { List<CollectionEntity> collections; CollectionHorizonCollection({required this.collections}); @override Widget build(BuildContext context) { return HorizonCardCollection( title: "收藏夹", height: 120, child: ListView( scrollDirection: Axis.horizontal, children: <Widget>[ ...collections.map((collection) => CollectionCard(collectionEntity: collection,)) ], ), ); } }
28.875
91
0.714286
2f6e4b7f2596740dbea1bd59063e472b09751932
379
php
PHP
FTn50/connect.php
ashishzingh/mediafox
dd6ad21ef3cf3ad8b0024d0bb4d48f9b3fe1433a
[ "MIT" ]
null
null
null
FTn50/connect.php
ashishzingh/mediafox
dd6ad21ef3cf3ad8b0024d0bb4d48f9b3fe1433a
[ "MIT" ]
null
null
null
FTn50/connect.php
ashishzingh/mediafox
dd6ad21ef3cf3ad8b0024d0bb4d48f9b3fe1433a
[ "MIT" ]
null
null
null
<?php $hostname="localhost"; //local server name default localhost $username="root"; //mysql username default is root. $password=""; //blank if no password is set for mysql. $database="ftusers"; //database name which you created $con=mysql_connect($hostname,$username,$password); if(! $con) { die('Connection Failed'.mysql_error()); } mysql_select_db($database,$con); ?>
29.153846
60
0.712401
6b0b42723cc2b99bd684f717bd36d87e800de1fd
259
dart
Dart
test/f_test.dart
chaeMil/dfunc
29fcbd33057b8a2922ccf76ebf59a3dc0a64857b
[ "BSD-2-Clause" ]
12
2020-02-18T02:55:28.000Z
2021-09-26T18:31:53.000Z
test/f_test.dart
chaeMil/dfunc
29fcbd33057b8a2922ccf76ebf59a3dc0a64857b
[ "BSD-2-Clause" ]
7
2019-12-06T21:49:20.000Z
2022-01-09T22:00:34.000Z
test/f_test.dart
chaeMil/dfunc
29fcbd33057b8a2922ccf76ebf59a3dc0a64857b
[ "BSD-2-Clause" ]
2
2020-02-18T02:24:32.000Z
2020-10-05T08:39:39.000Z
import 'package:dfunc/dfunc.dart'; import 'package:test/test.dart'; void main() { test('returns false if called without argument', () { expect(F(), false); }); test('returns false if called with argument', () { expect(F(true), false); }); }
19.923077
55
0.629344
fb52ed52bf8887df681053a10e2259be29abd3b6
142
java
Java
src/main/java/es/bsc/dataclay/exceptions/logicmodule/sessionmgr/package-info.java
Abhisheknishant/javaclay
64bd06d90823bd8a6ebb210e78e32885d8db3a22
[ "BSD-3-Clause" ]
4
2019-11-19T10:18:01.000Z
2020-01-29T17:23:56.000Z
src/main/java/es/bsc/dataclay/exceptions/logicmodule/sessionmgr/package-info.java
Abhisheknishant/javaclay
64bd06d90823bd8a6ebb210e78e32885d8db3a22
[ "BSD-3-Clause" ]
19
2019-10-29T13:47:21.000Z
2022-01-04T16:36:15.000Z
src/main/java/es/bsc/dataclay/exceptions/logicmodule/sessionmgr/package-info.java
Abhisheknishant/javaclay
64bd06d90823bd8a6ebb210e78e32885d8db3a22
[ "BSD-3-Clause" ]
1
2020-06-04T11:32:20.000Z
2020-06-04T11:32:20.000Z
/** * Module intended to management of Exceptions in Session Manager module. */ package es.bsc.dataclay.exceptions.logicmodule.sessionmgr;
23.666667
73
0.78169
fe358280cf9168ddb0aaf998e5f73b9ef59301c2
668
c
C
workloads/examples/slurm/mpi-hello/mpi-hello.c
kuangllbnu/deepops
d73c05a8f352de5cf0578d944c3107c1e7171a7b
[ "BSD-3-Clause" ]
748
2018-06-27T18:52:04.000Z
2022-03-30T18:50:01.000Z
workloads/examples/slurm/mpi-hello/mpi-hello.c
kuangllbnu/deepops
d73c05a8f352de5cf0578d944c3107c1e7171a7b
[ "BSD-3-Clause" ]
615
2018-06-27T20:51:53.000Z
2022-03-31T19:58:47.000Z
workloads/examples/slurm/mpi-hello/mpi-hello.c
kuangllbnu/deepops
d73c05a8f352de5cf0578d944c3107c1e7171a7b
[ "BSD-3-Clause" ]
273
2018-07-01T10:01:07.000Z
2022-03-29T02:19:29.000Z
#include <mpi.h> #include <unistd.h> #include <stdio.h> int main(int argc, char **argv) { // Initialize MPI MPI_Init(&argc, &argv); // Get the number of processes in the global communicator int count; MPI_Comm_size(MPI_COMM_WORLD, &count); // Get the rank of the current process int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank); // Get the current hostname char hostname[1024]; gethostname(hostname, sizeof(hostname)); // Print a hello world message for this rank printf("Hello from process %d of %d on host %s\n", rank, count, hostname); // Finalize the MPI environment before exiting MPI_Finalize(); }
24.740741
78
0.669162
2ec8d36588c81c34b07857b913f9b58a0711afe2
798
dart
Dart
LayoutTests/fast/css/recalc-optgroup-inherit_t01.dart
tvolkert/co19
435727789062a45da3d20da09024651fdeb8cafe
[ "BSD-3-Clause" ]
null
null
null
LayoutTests/fast/css/recalc-optgroup-inherit_t01.dart
tvolkert/co19
435727789062a45da3d20da09024651fdeb8cafe
[ "BSD-3-Clause" ]
null
null
null
LayoutTests/fast/css/recalc-optgroup-inherit_t01.dart
tvolkert/co19
435727789062a45da3d20da09024651fdeb8cafe
[ "BSD-3-Clause" ]
null
null
null
/* * Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file * for details. All rights reserved. Use of this source code is governed by a * BSD-style license that can be found in the LICENSE file. */ /** * @description Check that OPTION inherits the modified OPTGROUP color. */ import "dart:html"; import "../../testcommon.dart"; main() { document.body.setInnerHtml(''' <select id="s"> <optgroup id="g" style="color:red"> <option id="o">Green</option> </optgroup> </select> ''', treeSanitizer: new NullTreeSanitizer()); document.body.offsetTop; // force style recalc. document.getElementById("g").style.color = "green"; shouldBe(getComputedStyle(document.getElementById('o'), null).color, 'rgb(0, 128, 0)'); }
31.92
89
0.652882
048de00f7975479ab7f5680c27f24da31b9dbe8f
553
kt
Kotlin
XClipper.Android/buildSrc/src/main/java/ModuleDependency.kt
awesome-github-repo/XClipper
aec6ad70a3ed7cbb704274dd02cf5f9d2fc11e36
[ "Apache-2.0" ]
null
null
null
XClipper.Android/buildSrc/src/main/java/ModuleDependency.kt
awesome-github-repo/XClipper
aec6ad70a3ed7cbb704274dd02cf5f9d2fc11e36
[ "Apache-2.0" ]
null
null
null
XClipper.Android/buildSrc/src/main/java/ModuleDependency.kt
awesome-github-repo/XClipper
aec6ad70a3ed7cbb704274dd02cf5f9d2fc11e36
[ "Apache-2.0" ]
null
null
null
import kotlin.reflect.full.memberProperties @Suppress("unused") object ModuleDependency { const val APP = ":app" const val LIBRARY_UTILS = ":app:library_utils" const val PRICING_CARDS = ":app:pricing" const val LINK_PREVIEW = ":app:link-preview" const val COMMON = ":app:common" const val UPDATE = ":app:update" const val PIN_LOCK = ":app:pin-lock" fun getAllModules(): Set<String> = ModuleDependency::class.memberProperties .filter { it.isConst } .map { it.getter.call().toString() } .toSet() }
32.529412
79
0.665461
281379bea84bc142b477b03e053cbdb64fea0b6e
4,367
go
Go
kv/mutcask/mutcask.go
filedag-project/filedag-storage
eafa521922e03d4d0eaa16a5a74a92ca06b576c5
[ "MIT" ]
2
2022-02-22T09:50:27.000Z
2022-02-28T02:00:40.000Z
kv/mutcask/mutcask.go
filedag-project/filedag-storage
eafa521922e03d4d0eaa16a5a74a92ca06b576c5
[ "MIT" ]
null
null
null
kv/mutcask/mutcask.go
filedag-project/filedag-storage
eafa521922e03d4d0eaa16a5a74a92ca06b576c5
[ "MIT" ]
1
2022-02-10T06:35:25.000Z
2022-02-10T06:35:25.000Z
package mutcask import ( "context" "fmt" "hash/crc32" "os" "path/filepath" "sync" "github.com/filedag-project/filedag-storage/kv" fslock "github.com/ipfs/go-fs-lock" "golang.org/x/xerrors" ) const lockFileName = "repo.lock" var _ kv.KVDB = (*mutcask)(nil) type mutcask struct { sync.Mutex cfg *Config caskMap *CaskMap createCaskChan chan *createCaskRequst close func() closeChan chan struct{} } func NewMutcask(opts ...Option) (*mutcask, error) { m := &mutcask{ cfg: defaultConfig(), createCaskChan: make(chan *createCaskRequst), closeChan: make(chan struct{}), } for _, opt := range opts { opt(m.cfg) } repoPath := m.cfg.Path if repoPath == "" { return nil, ErrPathUndefined } repo, err := os.Stat(repoPath) if err == nil && !repo.IsDir() { return nil, ErrPath } if err != nil { if !os.IsNotExist(err) { return nil, err } if err := os.Mkdir(repoPath, 0755); err != nil { return nil, err } } // try to get the repo lock locked, err := fslock.Locked(repoPath, lockFileName) if err != nil { return nil, xerrors.Errorf("could not check lock status: %w", err) } if locked { return nil, ErrRepoLocked } unlockRepo, err := fslock.Lock(repoPath, lockFileName) if err != nil { return nil, xerrors.Errorf("could not lock the repo: %w", err) } m.caskMap, err = buildCaskMap(m.cfg) if err != nil { return nil, err } var once sync.Once m.close = func() { once.Do(func() { close(m.closeChan) unlockRepo.Close() }) } m.handleCreateCask() return m, nil } func (m *mutcask) handleCreateCask() { go func(m *mutcask) { ids := []uint32{} for { select { case <-m.closeChan: return case req := <-m.createCaskChan: func() { // fmt.Printf("received cask create request, id = %d\n", req.id) if hasId(ids, req.id) { req.done <- ErrNone return } cask := NewCask(req.id) var err error // create vlog file cask.vLog, err = os.OpenFile(filepath.Join(m.cfg.Path, m.vLogName(req.id)), os.O_RDWR|os.O_CREATE, 0644) if err != nil { req.done <- err return } // create hintlog file cask.hintLog, err = os.OpenFile(filepath.Join(m.cfg.Path, m.hintLogName(req.id)), os.O_RDWR|os.O_CREATE, 0644) if err != nil { req.done <- err return } m.caskMap.Add(req.id, cask) ids = append(ids, req.id) req.done <- ErrNone }() } } }(m) } func (m *mutcask) vLogName(id uint32) string { return fmt.Sprintf("%08d%s", id, vLogSuffix) } func (m *mutcask) hintLogName(id uint32) string { return fmt.Sprintf("%08d%s", id, hintLogSuffix) } func (m *mutcask) Put(key string, value []byte) (err error) { id := m.fileID(key) var cask *Cask var has bool cask, has = m.caskMap.Get(id) if !has { done := make(chan error) m.createCaskChan <- &createCaskRequst{ id: id, done: done, } if err := <-done; err != ErrNone { return err } cask, _ = m.caskMap.Get(id) } return cask.Put(key, value) } func (m *mutcask) Delete(key string) error { id := m.fileID(key) cask, has := m.caskMap.Get(id) if !has { return nil } return cask.Delete(key) } func (m *mutcask) Get(key string) ([]byte, error) { id := m.fileID(key) cask, has := m.caskMap.Get(id) if !has { fmt.Println("********") return nil, kv.ErrNotFound } return cask.Read(key) } func (m *mutcask) Size(key string) (int, error) { id := m.fileID(key) cask, has := m.caskMap.Get(id) if !has { return -1, kv.ErrNotFound } return cask.Size(key) } func (m *mutcask) Close() error { m.caskMap.CloseAll() m.close() return nil } func (m *mutcask) AllKeysChan(ctx context.Context) (chan string, error) { kc := make(chan string) go func(ctx context.Context, m *mutcask) { defer close(kc) for _, cask := range m.caskMap.m { for key, h := range cask.keyMap.m { if h.Deleted { continue } select { case <-ctx.Done(): return default: kc <- key } } } }(ctx, m) return kc, nil } func (m *mutcask) fileID(key string) uint32 { crc := crc32.ChecksumIEEE([]byte(key)) return crc % m.cfg.CaskNum } type createCaskRequst struct { id uint32 done chan error } func hasId(ids []uint32, id uint32) bool { for _, item := range ids { if item == id { return true } } return false }
19.760181
115
0.613007
9aa66e63274df7082812f2739f5de8df368a9d7a
878
swift
Swift
WorldWeather/Workers/RawModels/RawWeatherInfo.swift
BasselEzzeddine/WorldWeather-iOS
78e1d6c98ac40f40af8e6f2e228915e79ccca283
[ "MIT" ]
1
2018-10-14T12:54:08.000Z
2018-10-14T12:54:08.000Z
WorldWeather/Workers/RawModels/RawWeatherInfo.swift
BasselEzzeddine/WorldWeather-iOS
78e1d6c98ac40f40af8e6f2e228915e79ccca283
[ "MIT" ]
null
null
null
WorldWeather/Workers/RawModels/RawWeatherInfo.swift
BasselEzzeddine/WorldWeather-iOS
78e1d6c98ac40f40af8e6f2e228915e79ccca283
[ "MIT" ]
null
null
null
// // RawWeatherInfo.swift // WorldWeather // // Created by Bassel Ezzeddine on 15/09/2018. // Copyright © 2018 Bassel Ezzeddine. All rights reserved. // import Foundation struct RawWeatherInfo: Decodable { let dayWeatherList: [DayWeather] struct DayWeather: Decodable { let id: Int let weather_state_name: String let weather_state_abbr: String let wind_direction_compass: String let created: String let applicable_date: Date let min_temp: Float let max_temp: Float let the_temp: Float let wind_speed: Float let wind_direction: Float let air_pressure: Float let humidity: Float let visibility: Float let predictability: Float } enum CodingKeys: String, CodingKey { case dayWeatherList = "consolidated_weather" } }
24.388889
59
0.648064
bdec1183d634936e81c67718eb4278755a1bbac9
5,801
ps1
PowerShell
functions/Restore-DbaDbCertificate.ps1
NReilingh/dbatools
df8cb1f8451cebffa9c0d5a3d3e635a678637bf1
[ "MIT" ]
null
null
null
functions/Restore-DbaDbCertificate.ps1
NReilingh/dbatools
df8cb1f8451cebffa9c0d5a3d3e635a678637bf1
[ "MIT" ]
null
null
null
functions/Restore-DbaDbCertificate.ps1
NReilingh/dbatools
df8cb1f8451cebffa9c0d5a3d3e635a678637bf1
[ "MIT" ]
null
null
null
#ValidationTags#Messaging,FlowControl,Pipeline,CodeStyle# function Restore-DbaDbCertificate { <# .SYNOPSIS Imports certificates from .cer files using SMO. .DESCRIPTION Imports certificates from.cer files using SMO. .PARAMETER SqlInstance The target SQL Server instance or instances. .PARAMETER SqlCredential Login to the target instance using alternative credentials. Windows and SQL Authentication supported. Accepts credential objects (Get-Credential) .PARAMETER Path The Path the contains the certificate and private key files. The path can be a directory or a specific certificate. .PARAMETER Password Secure string used to decrypt the private key. .PARAMETER EncryptionPassword If specified this will be used to encrypt the private key. .PARAMETER Database The database where the certificate imports into. Defaults to master. .PARAMETER WhatIf Shows what would happen if the command were to run. No actions are actually performed. .PARAMETER Confirm Prompts you for confirmation before executing any changing operations within the command. .PARAMETER EnableException By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message. This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting. Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch. .NOTES Tags: Migration, Certificate Author: Jess Pomfret (@jpomfret), jesspomfret.com Website: https://dbatools.io Copyright: (c) 2018 by dbatools, licensed under MIT License: MIT https://opensource.org/licenses/MIT .LINK https://dbatools.io/Restore-DbaDbCertificate .EXAMPLE PS C:\> Restore-DbaDbCertificate -SqlInstance Server1 -Path \\Server1\Certificates -Password (ConvertTo-SecureString -Force -AsPlainText GoodPass1234!!) Restores all the certificates in the specified path, password is used to both decrypt and encrypt the private key. .EXAMPLE PS C:\> Restore-DbaDbCertificate -SqlInstance Server1 -Path \\Server1\Certificates\DatabaseTDE.cer -Password (ConvertTo-SecureString -force -AsPlainText GoodPass1234!!) Restores the DatabaseTDE certificate to Server1 and uses the MasterKey to encrypt the private key. #> [CmdletBinding(DefaultParameterSetName = "Default", SupportsShouldProcess, ConfirmImpact = "High")] param ( [Parameter(Mandatory)] [DbaInstanceParameter]$SqlInstance, [PSCredential]$SqlCredential, [parameter(Mandatory, ValueFromPipeline)] [Alias("FullName")] [object[]]$Path, [Security.SecureString]$EncryptionPassword, [string]$Database = "master", [Security.SecureString]$Password = (Read-Host "Password" -AsSecureString), [switch]$EnableException ) process { try { $server = Connect-SqlInstance -SqlInstance $SqlInstance -SqlCredential $sqlcredential } catch { Stop-Function -Message "Failed to connect to: $SqlInstance" -Target $SqlInstance -ErrorRecord $_ return } foreach ($fullname in $Path) { if (-not $SqlInstance.IsLocalHost -and -not $fullname.StartsWith('\')) { Stop-Function -Message "Path ($fullname) must be a UNC share when SQL instance is not local." -Continue -Target $fullname } if (-not (Test-DbaPath -SqlInstance $server -Path $fullname)) { Stop-Function -Message "$SqlInstance cannot access $fullname" -Continue -Target $fullname } $directory = Split-Path $fullname $filename = Split-Path $fullname -Leaf $certname = [io.path]::GetFileNameWithoutExtension($filename) if ($Pscmdlet.ShouldProcess("$certname on $SqlInstance", "Importing Certificate")) { $smocert = New-Object Microsoft.SqlServer.Management.Smo.Certificate $smocert.Name = $certname $smocert.Parent = $server.Databases[$Database] Write-Message -Level Verbose -Message "Creating Certificate: $certname" try { $fullcertname = "$directory\$certname.cer" $privatekey = "$directory\$certname.pvk" Write-Message -Level Verbose -Message "Full certificate path: $fullcertname" Write-Message -Level Verbose -Message "Private key: $privatekey" $fromfile = $true if ($EncryptionPassword) { $smocert.Create($fullcertname, $fromfile, $privatekey, [System.Runtime.InteropServices.marshal]::PtrToStringAuto([System.Runtime.InteropServices.marshal]::SecureStringToBSTR($password)), [System.Runtime.InteropServices.marshal]::PtrToStringAuto([System.Runtime.InteropServices.marshal]::SecureStringToBSTR($password))) } else { $smocert.Create($fullcertname, $fromfile, $privatekey, [System.Runtime.InteropServices.marshal]::PtrToStringAuto([System.Runtime.InteropServices.marshal]::SecureStringToBSTR($password))) } $cert = $smocert } catch { Write-Message -Level Warning -Message $_ -ErrorRecord $_ -Target $instance } } Get-DbaDbCertificate -SqlInstance $server -Database $Database -Certificate $cert.Name } } end { Test-DbaDeprecation -DeprecatedOn "1.0.0" -Alias Retore-DbaDatabaseCertificate } }
46.039683
342
0.6623
6d26b421dde38264c52dda28f44d87361a11a2b8
550
ps1
PowerShell
configuration/configuration-scripts/Install-WSL.ps1
chadduffey/DARKSURGEON
b6ca1aee91b3183133aca61f518628fba515ca2b
[ "MIT" ]
417
2018-05-14T01:14:53.000Z
2022-02-20T08:06:12.000Z
configuration/configuration-scripts/Install-WSL.ps1
chadduffey/DARKSURGEON
b6ca1aee91b3183133aca61f518628fba515ca2b
[ "MIT" ]
8
2018-05-16T08:12:31.000Z
2020-04-21T06:40:39.000Z
configuration/configuration-scripts/Install-WSL.ps1
chadduffey/DARKSURGEON
b6ca1aee91b3183133aca61f518628fba515ca2b
[ "MIT" ]
73
2018-05-14T12:33:47.000Z
2022-03-30T19:12:33.000Z
<# .SYNOPSIS Installs Windows Subsystem for Linux (WSL). .DESCRIPTION Author: Dane Stuckey (@cryps1s) License: MIT Install the Windows Subsystem for Linux (WSL) binaries from Microsoft. .NOTES #> Set-StrictMode -Version Latest Try { # Install the WSL package, preserve restart Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart | Out-Null } Catch { Write-Error "Could not install WSL package. Exiting." Write-Host $_.Exception | format-list -force Exit 1 }
21.153846
108
0.712727
3a14a5ac2bbd7c7eee4cead6896b8d44e332e39e
676
sql
SQL
webmail/SQL/mssql/2019092900.sql
oliveiralexandre/l2brclub
cca49203d359c0d51a835a8f16dfe7f8980f66f3
[ "MIT" ]
1
2021-09-23T11:12:58.000Z
2021-09-23T11:12:58.000Z
sub/mail/SQL/mssql/2019092900.sql
diditsadidnsm/mamakriau.com
a4c4bc50034fe6d4ece70f35cf37c707c8de21e0
[ "MIT" ]
null
null
null
sub/mail/SQL/mssql/2019092900.sql
diditsadidnsm/mamakriau.com
a4c4bc50034fe6d4ece70f35cf37c707c8de21e0
[ "MIT" ]
null
null
null
ALTER TABLE [dbo].[cache] ALTER COLUMN [cache_key] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL GO ALTER TABLE [dbo].[cache_shared] ALTER COLUMN [cache_key] [varchar] (255) COLLATE Latin1_General_CS_AS NOT NULL GO ALTER TABLE [dbo].[cache_index] ALTER COLUMN [mailbox] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL GO ALTER TABLE [dbo].[cache_messages] ALTER COLUMN [mailbox] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL GO ALTER TABLE [dbo].[cache_thread] ALTER COLUMN [mailbox] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL GO ALTER TABLE [dbo].[users] ALTER COLUMN [username] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL GO
35.578947
66
0.778107
e2797d0a0ff9a792543967fb44f5d4327bf7d718
261
sql
SQL
Subqueries-and-JOINs/Addresses with Towns.sql
vasetousa/SQL-Server
4ef525e1cf1924a6a29454b587dc7117c7239592
[ "MIT" ]
null
null
null
Subqueries-and-JOINs/Addresses with Towns.sql
vasetousa/SQL-Server
4ef525e1cf1924a6a29454b587dc7117c7239592
[ "MIT" ]
null
null
null
Subqueries-and-JOINs/Addresses with Towns.sql
vasetousa/SQL-Server
4ef525e1cf1924a6a29454b587dc7117c7239592
[ "MIT" ]
null
null
null
USE [SoftUni] GO SELECT TOP 50 e.[FirstName], e.[LastName], t.[Name] AS [Town], a.[AddressText] FROM [Employees] AS e JOIN [Addresses] AS a ON e.[AddressID] = a.[AddressID] JOIN [Towns] AS t ON a.[TownID] = t.[TownID] ORDER BY e.[FirstName], e.[LastName]
17.4
54
0.662835
c13b005896e60881dc2031e1c7eaacd42c0d9950
5,109
kt
Kotlin
js/js.tests/test/org/jetbrains/kotlin/js/test/AbstractJsBlackBoxCodegenTestBase.kt
kartikpatodi/kotlin
7e633cf217b032c9b3b385a1af7a8e9229ca6185
[ "ECL-2.0", "Apache-2.0" ]
1
2019-09-30T04:14:40.000Z
2019-09-30T04:14:40.000Z
js/js.tests/test/org/jetbrains/kotlin/js/test/AbstractJsBlackBoxCodegenTestBase.kt
kartikpatodi/kotlin
7e633cf217b032c9b3b385a1af7a8e9229ca6185
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
js/js.tests/test/org/jetbrains/kotlin/js/test/AbstractJsBlackBoxCodegenTestBase.kt
kartikpatodi/kotlin
7e633cf217b032c9b3b385a1af7a8e9229ca6185
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
/* * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.js.test import org.jetbrains.kotlin.js.test.handlers.* import org.jetbrains.kotlin.platform.js.JsPlatforms import org.jetbrains.kotlin.test.Constructor import org.jetbrains.kotlin.test.TargetBackend import org.jetbrains.kotlin.test.backend.BlackBoxCodegenSuppressor import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder import org.jetbrains.kotlin.test.builders.classicFrontendHandlersStep import org.jetbrains.kotlin.test.builders.irHandlersStep import org.jetbrains.kotlin.test.builders.jsArtifactsHandlersStep import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives.DIAGNOSTICS import org.jetbrains.kotlin.test.directives.JsEnvironmentConfigurationDirectives import org.jetbrains.kotlin.test.frontend.classic.handlers.ClassicDiagnosticsHandler import org.jetbrains.kotlin.test.model.* import org.jetbrains.kotlin.test.runners.AbstractKotlinCompilerWithTargetBackendTest import org.jetbrains.kotlin.test.runners.codegen.commonClassicFrontendHandlersForCodegenTest import org.jetbrains.kotlin.test.services.JsLibraryProvider import org.jetbrains.kotlin.test.services.configuration.CommonEnvironmentConfigurator import org.jetbrains.kotlin.test.services.configuration.JsEnvironmentConfigurator import org.jetbrains.kotlin.test.services.sourceProviders.CoroutineHelpersSourceFilesProvider import java.lang.Boolean.getBoolean abstract class AbstractJsBlackBoxCodegenTestBase<R : ResultingArtifact.FrontendOutput<R>, I : ResultingArtifact.BackendInput<I>, A : ResultingArtifact.Binary<A>>( val targetFrontend: FrontendKind<R>, targetBackend: TargetBackend, private val pathToTestDir: String, private val testGroupOutputDirPrefix: String, private val skipMinification: Boolean = getBoolean("kotlin.js.skipMinificationTest"), ) : AbstractKotlinCompilerWithTargetBackendTest(targetBackend) { abstract val frontendFacade: Constructor<FrontendFacade<R>> abstract val frontendToBackendConverter: Constructor<Frontend2BackendConverter<R, I>> abstract val backendFacade: Constructor<BackendFacade<I, A>> abstract val afterBackendFacade: Constructor<AbstractTestFacade<A, BinaryArtifacts.Js>>? abstract val recompileFacade: Constructor<AbstractTestFacade<BinaryArtifacts.Js, BinaryArtifacts.Js>> override fun TestConfigurationBuilder.configuration() { globalDefaults { frontend = targetFrontend targetPlatform = JsPlatforms.defaultJsPlatform dependencyKind = DependencyKind.Binary } val pathToRootOutputDir = System.getProperty("kotlin.js.test.root.out.dir") ?: error("'kotlin.js.test.root.out.dir' is not set") defaultDirectives { +DiagnosticsDirectives.REPORT_ONLY_EXPLICITLY_DEFINED_DEBUG_INFO JsEnvironmentConfigurationDirectives.PATH_TO_ROOT_OUTPUT_DIR with pathToRootOutputDir JsEnvironmentConfigurationDirectives.PATH_TO_TEST_DIR with pathToTestDir JsEnvironmentConfigurationDirectives.TEST_GROUP_OUTPUT_DIR_PREFIX with testGroupOutputDirPrefix +JsEnvironmentConfigurationDirectives.TYPED_ARRAYS +JsEnvironmentConfigurationDirectives.GENERATE_NODE_JS_RUNNER if (skipMinification) +JsEnvironmentConfigurationDirectives.SKIP_MINIFICATION if (getBoolean("kotlin.js.ir.skipRegularMode")) +JsEnvironmentConfigurationDirectives.SKIP_REGULAR_MODE } forTestsNotMatching("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/*") { defaultDirectives { DIAGNOSTICS with "-warnings" } } forTestsNotMatching("compiler/testData/codegen/boxError/*") { enableMetaInfoHandler() } useConfigurators( ::CommonEnvironmentConfigurator, ::JsEnvironmentConfigurator, ) useAdditionalSourceProviders( ::JsAdditionalSourceProvider, ::CoroutineHelpersSourceFilesProvider, ) useAdditionalService(::JsLibraryProvider) useAfterAnalysisCheckers( ::JsFailingTestSuppressor, ::BlackBoxCodegenSuppressor, ) facadeStep(frontendFacade) classicFrontendHandlersStep { commonClassicFrontendHandlersForCodegenTest() useHandlers(::ClassicDiagnosticsHandler) } facadeStep(frontendToBackendConverter) irHandlersStep() facadeStep(backendFacade) afterBackendFacade?.let { facadeStep(it) } facadeStep(recompileFacade) jsArtifactsHandlersStep { useHandlers( ::JsBoxRunner, ::NodeJsGeneratorHandler, ::JsMinifierRunner, ::JsArtifactsDumpHandler, ::JsAstHandler ) } } }
45.616071
162
0.753572
d5c5b5fee34c982d9dae80634e21036c1ec5abbf
647
h
C
Example/JWTDesktop/JWTDesktop/SignatureValidationDescription.h
zoho/JWT
7400ecb76f15a86cf99b827fc2168d3a8e052a72
[ "MIT" ]
317
2015-01-15T10:23:18.000Z
2022-03-20T12:19:32.000Z
Example/JWTDesktop/JWTDesktop/SignatureValidationDescription.h
zoho/JWT
7400ecb76f15a86cf99b827fc2168d3a8e052a72
[ "MIT" ]
139
2015-05-18T21:34:00.000Z
2022-01-12T09:09:07.000Z
Example/JWTDesktop/JWTDesktop/SignatureValidationDescription.h
zoho/JWT
7400ecb76f15a86cf99b827fc2168d3a8e052a72
[ "MIT" ]
106
2015-02-02T20:39:50.000Z
2022-01-20T18:05:35.000Z
// // SignatureValidationDescription.h // JWTDesktop // // Created by Lobanov Dmitry on 30.10.2017. // Copyright © 2017 JWT. All rights reserved. // #import <Foundation/Foundation.h> #import <Cocoa/Cocoa.h> typedef NS_ENUM(NSInteger, SignatureValidationType) { SignatureValidationTypeUnknown, SignatureValidationTypeValid, SignatureValidationTypeInvalid }; @interface SignatureValidationDescription : NSObject @property (assign, nonatomic, readwrite) SignatureValidationType signatureValidation; @property (assign, nonatomic, readonly) NSColor* currentColor; @property (assign, nonatomic, readonly) NSString* currentTitle; @end
28.130435
85
0.786708
3c1f233576c313a4b14172486fa9ef1b1fa32247
1,898
rs
Rust
workspace/ietf-bcp-47-language-tag/src/parser/macros/match_subtag_length.rs
raphaelcohn/olympus-xmp
9ba7e9c6cc17e56beb8821c8bfe6f9df96c3c4af
[ "MIT" ]
null
null
null
workspace/ietf-bcp-47-language-tag/src/parser/macros/match_subtag_length.rs
raphaelcohn/olympus-xmp
9ba7e9c6cc17e56beb8821c8bfe6f9df96c3c4af
[ "MIT" ]
null
null
null
workspace/ietf-bcp-47-language-tag/src/parser/macros/match_subtag_length.rs
raphaelcohn/olympus-xmp
9ba7e9c6cc17e56beb8821c8bfe6f9df96c3c4af
[ "MIT" ]
null
null
null
// This file is part of olympus-xmp. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/raphaelcohn/olympus-xmp/master/COPYRIGHT. No part of olympus-xmp, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file. // Copyright © 2022 The developers of olympus-xmp. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/raphaelcohn/olympus-xmp/master/COPYRIGHT. macro_rules! match_subtag_length { ($subtag: ident, $parse_1: expr, $parse_2: expr, $parse_3: expr, $parse_4: expr, $parse_5: expr, $parse_6: expr, $parse_7: expr, $parse_8: expr) => { match $subtag.len() { 0 => return_error!(InvalidSubtagLength(InvalidSubtagLengthError::IsZero)), 1 => $parse_1, 2 => $parse_2, 3 => $parse_3, 4 => $parse_4, 5 => $parse_5, 6 => $parse_6, 7 => $parse_7, 8 => $parse_8, length @ _ => return_error!(InvalidSubtagLength(InvalidSubtagLengthError::IsGreaterThanEight { length })), } }; ($subtag: ident, $validated_extension_code: ident, $parse_from_private_use: expr, $parse_from_extension: stmt, $parse_2: expr, $parse_3: expr, $parse_4: expr, $parse_5: expr, $parse_6: expr, $parse_7: expr, $parse_8: expr) => { match_subtag_length! { $subtag, match $subtag.byte_0() { X | x => return $parse_from_private_use, $validated_extension_code @ (_0 ..= _9 | A ..= W | Y ..= Z | a ..= w | y ..= z) => { $parse_from_extension }, invalid_extension_code @ _ => return_error!(InvalidExtensionSingleton(invalid_extension_code)) }, $parse_2, $parse_3, $parse_4, $parse_5, $parse_6, $parse_7, $parse_8 } } }
29.2
390
0.66491
b5e1104ff15408b577e36b714fa781b6feedbbb5
1,774
rs
Rust
service/install_service.rs
edin-m/rs-google-photos-sync
02fa4b7b4efbddafba8c2acd92738b3e344601ec
[ "MIT" ]
null
null
null
service/install_service.rs
edin-m/rs-google-photos-sync
02fa4b7b4efbddafba8c2acd92738b3e344601ec
[ "MIT" ]
null
null
null
service/install_service.rs
edin-m/rs-google-photos-sync
02fa4b7b4efbddafba8c2acd92738b3e344601ec
[ "MIT" ]
null
null
null
mod show_msg; #[cfg(windows)] fn main() { if let Err(e) = install_service() { println!("{}", e); show_msg::show_msg(format!("{}. Service exists or try as admin.", e).as_str()); } else { show_msg::show_msg("Service installed successfully"); } } #[cfg(not(windows))] fn main() { panic!("Only windows supported!"); } #[cfg(windows)] fn install_service() -> Result<(), String> { use std::ffi::OsString; use windows_service::{ service::{ServiceAccess, ServiceErrorControl, ServiceInfo, ServiceStartType, ServiceType}, service_manager::{ServiceManager, ServiceManagerAccess}, }; let manager_access = ServiceManagerAccess::CONNECT | ServiceManagerAccess::CREATE_SERVICE; let service_manager = ServiceManager::local_computer( None::<&str>, manager_access ).map_err(|e| { format!("Error accessing service manager ({})", e) })?; let service_binary_path = ::std::env::current_exe() .unwrap() .with_file_name("rs_google_photos_sync.exe"); let service_info = ServiceInfo { name: OsString::from("rs_google_photos_sync"), display_name: OsString::from("Sync-down Google Photos service"), service_type: ServiceType::OWN_PROCESS, start_type: ServiceStartType::AutoStart, error_control: ServiceErrorControl::Normal, executable_path: service_binary_path, launch_arguments: vec![OsString::from("--winservice")], dependencies: vec![], account_name: None, // run as System account_password: None, }; let _ = service_manager.create_service( service_info, ServiceAccess::empty() ).map_err(|e| { format!("Error creating service ({})", e) })?; Ok(()) }
30.586207
98
0.639233
da5b64f43f216b89383bc10064e40ee5da440ef4
1,459
ps1
PowerShell
Get-NTFSPermission.ps1
CailleauThierry/PowerShellDotCom
4512c4a16c8960506cdcf47ebec6e66cf67544be
[ "MIT" ]
null
null
null
Get-NTFSPermission.ps1
CailleauThierry/PowerShellDotCom
4512c4a16c8960506cdcf47ebec6e66cf67544be
[ "MIT" ]
null
null
null
Get-NTFSPermission.ps1
CailleauThierry/PowerShellDotCom
4512c4a16c8960506cdcf47ebec6e66cf67544be
[ "MIT" ]
null
null
null
<# .NOTES =========================================================================== Posted by : Powershell.com <yourpowertip@powershell.com> Created on: 7/21/2016 4:25 PM Created by: CailleauThierry Organization: Private Filename: =========================================================================== .DESCRIPTION A description of the file. #> #requires -Version 2 #Reading NTFS Permissions #PowerShell 2+ # #NTFS permissions are represented by complex object hierarchies that are hard to read. A much simpler way is to output the structure in an SDDL (Security Descriptor Definition Language) format: $sd = Get-Acl -Path c:\windows $sd.GetSecurityDescriptorSddlForm('All') #The result looks similar to this: # #O:S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464G:S-1-5-80-9560 #08885 - 3418522649 - 1831038044 - 1853292631-2271478464D:PAI(A; OICIIO; GA;;; CO)(A; OICI # IO; GA;;; SY)(A;; 0x1301bf;;; SY)(A; OICIIO; GA;;; BA)(A;; 0x1301bf;;; BA)(A; OICIIO; GXGR # ;;; BU)(A;; 0x1200a9;;; BU)(A; CIIO; GA;;; S-1-5-80-956008885-3418522649-1831038044-1 # 853292631 - 2271478464)(A;; FA;;; S-1-5-80-956008885-3418522649-1831038044-18532926 # 31 - 2271478464)(A;; 0x1200a9;;; AC)(A; OICIIO; GXGR;;; AC) # #Admitted, this does not look very friendly, either. But now you can analyze the security settings with pure text methods, for example using regular expressions. # #me: tested with PS v2 and v5 (64-bits)
44.212121
193
0.642221
450e6e260b7931f580cb882d40d181bf7f325e0a
1,075
ps1
PowerShell
src/GitHub/Public/Get-GitHubWorkflowUsage.ps1
MariusStorhaug/GitHub
4807699ed2f63ff0bdf0a4f8b82f823f46cb3d1a
[ "MIT" ]
2
2022-01-25T01:29:55.000Z
2022-02-05T23:03:52.000Z
src/GitHub/Public/Get-GitHubWorkflowUsage.ps1
MariusStorhaug/GitHub
4807699ed2f63ff0bdf0a4f8b82f823f46cb3d1a
[ "MIT" ]
1
2022-01-25T10:02:41.000Z
2022-02-05T02:22:24.000Z
src/GitHub/Public/Get-GitHubWorkflowUsage.ps1
MariusStorhaug/GitHub
4807699ed2f63ff0bdf0a4f8b82f823f46cb3d1a
[ "MIT" ]
null
null
null
Function Get-GitHubWorkflowUsage { [CmdletBinding( DefaultParameterSetName = 'ByName' )] param ( $Owner = $script:Owner, $Repo = $script:Repo, $Token = $script:Token , [Parameter( Mandatory, ValueFromPipelineByPropertyName )] [string[]] $ID ) begin {} process { # API Reference # https://docs.github.com/en/rest/reference/actions#get-workflow-usage $APICall = @{ Uri = "$APIBaseURI/repos/$Owner/$Repo/actions/workflows/$ID/timing" Headers = @{ Authorization = "token $Token" 'Content-Type' = 'application/json' } Method = 'GET' Body = @{} | ConvertTo-Json -Depth 100 } try { if ($PSBoundParameters.ContainsKey('Verbose')) { $APICall } $Response = Invoke-RestMethod @APICall } catch { throw $_ } return $Response.billable } end {} }
26.219512
83
0.485581
5d19ef1a58a97421436c3b5d39cf08733d79e79f
6,471
kt
Kotlin
verik-compiler/src/main/kotlin/io/verik/compiler/core/common/CoreDeclarationMap.kt
frwang96/verik
f2fdef9d9e364781ecf8814dac9e8676776792a0
[ "Apache-2.0" ]
23
2021-09-01T21:23:32.000Z
2022-03-29T18:17:34.000Z
verik-compiler/src/main/kotlin/io/verik/compiler/core/common/CoreDeclarationMap.kt
frwang96/verik
f2fdef9d9e364781ecf8814dac9e8676776792a0
[ "Apache-2.0" ]
null
null
null
verik-compiler/src/main/kotlin/io/verik/compiler/core/common/CoreDeclarationMap.kt
frwang96/verik
f2fdef9d9e364781ecf8814dac9e8676776792a0
[ "Apache-2.0" ]
1
2022-01-05T21:03:31.000Z
2022-01-05T21:03:31.000Z
/* * Copyright (c) 2021 Francis Wang * * 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 * * https://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 io.verik.compiler.core.common import io.verik.compiler.ast.interfaces.Declaration import io.verik.compiler.cast.CastContext import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor import org.jetbrains.kotlin.descriptors.DeclarationDescriptor import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor import org.jetbrains.kotlin.descriptors.impl.AbstractTypeAliasDescriptor import org.jetbrains.kotlin.psi.KtElement import org.jetbrains.kotlin.resolve.calls.components.isVararg import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameOrNull import kotlin.reflect.KClass import kotlin.reflect.KProperty1 import kotlin.reflect.full.createType import kotlin.reflect.full.isSubtypeOf import kotlin.reflect.full.memberProperties object CoreDeclarationMap { private val constructorMap = HashMap<CoreClassDeclaration, CoreConstructorDeclaration>() private val functionMap = HashMap<String, ArrayList<CoreKtAbstractFunctionDeclaration>>() private val declarationMap = HashMap<String, CoreDeclaration>() init { addCoreDeclarations(Core::class) } operator fun get( castContext: CastContext, declarationDescriptor: DeclarationDescriptor, element: KtElement ): Declaration? { return when (declarationDescriptor) { is ClassConstructorDescriptor -> getConstructor(castContext, declarationDescriptor, element) is SimpleFunctionDescriptor -> getFunction(castContext, declarationDescriptor, element) else -> getDeclaration(declarationDescriptor) } } private fun addCoreDeclarations(kClass: KClass<*>) { val kClassInstance = kClass.objectInstance if (kClassInstance is CoreScope) { kClass.memberProperties.forEach { if (it.returnType.isSubtypeOf(CoreDeclaration::class.createType())) { @Suppress("UNCHECKED_CAST") val property = (it as KProperty1<Any, *>).get(kClassInstance) as CoreDeclaration val expectedQualifiedName = "${kClassInstance.parent}.${property.name}" if (property.qualifiedName != expectedQualifiedName && property.qualifiedName != "<init>") { val expectedString = "Expected $expectedQualifiedName actual ${property.qualifiedName}" throw IllegalArgumentException("Qualified name does not match scope parent: $expectedString") } when (property) { is CoreConstructorDeclaration -> constructorMap[property.classDeclaration] = property is CoreKtAbstractFunctionDeclaration -> { if (property.qualifiedName !in functionMap) functionMap[property.qualifiedName] = ArrayList() functionMap[property.qualifiedName]!!.add(property) } is CoreAbstractFunctionDeclaration -> {} else -> declarationMap[property.qualifiedName] = property } } } } kClass.nestedClasses.forEach { addCoreDeclarations(it) } } private fun getConstructor( castContext: CastContext, descriptor: ClassConstructorDescriptor, element: KtElement ): CoreConstructorDeclaration? { val type = castContext.castType(descriptor.returnType, element) return constructorMap[type.reference] } private fun getFunction( castContext: CastContext, descriptor: SimpleFunctionDescriptor, element: KtElement ): CoreKtAbstractFunctionDeclaration? { val qualifiedName = descriptor.fqNameOrNull()?.asString() ?: return null val functions = functionMap[qualifiedName] ?: return null functions.forEach { if (matchFunction(castContext, descriptor, element, it)) return it } return null } private fun matchFunction( castContext: CastContext, descriptor: SimpleFunctionDescriptor, element: KtElement, function: CoreKtAbstractFunctionDeclaration ): Boolean { val valueParameters = descriptor.valueParameters val parameterClassNames = function.parameterClassNames if (valueParameters.size != parameterClassNames.size) return false valueParameters.zip(parameterClassNames).forEach { (valueParameter, parameterClassName) -> val type = if (valueParameter.isVararg) { castContext.castType(valueParameter.varargElementType!!, element) } else { castContext.castType(valueParameter.type, element) } if (type.reference !is CoreClassDeclaration) return false if (type.reference.name != parameterClassName) return false } return true } private fun getDeclaration(descriptor: DeclarationDescriptor): CoreDeclaration? { val qualifiedName = descriptor.fqNameOrNull()?.asString() ?: return null val declaration = declarationMap[qualifiedName] return when { declaration != null -> declaration descriptor is AbstractTypeAliasDescriptor -> { val name = descriptor.name.asString() if (name == "*") { CoreCardinalUnresolvedDeclaration } else { val cardinal = name.toIntOrNull() if (cardinal != null) Core.Vk.cardinalOf(cardinal) else null } } else -> null } } }
41.216561
117
0.63885
04a710b3c6ece7bd50e6156b927ffc951ad552d0
3,817
java
Java
src/main/java/com/groupcontroldroid/server/jetty/JettyServer.java
GroupControlDroid/GroupControlDroidClient
0d5347cd127c2e3b365894d79e03d6a56e8ea3cf
[ "Apache-2.0" ]
6
2017-04-17T12:24:10.000Z
2018-10-23T01:07:43.000Z
src/main/java/com/groupcontroldroid/server/jetty/JettyServer.java
GroupControlDroid/GroupControlDroidClient
0d5347cd127c2e3b365894d79e03d6a56e8ea3cf
[ "Apache-2.0" ]
null
null
null
src/main/java/com/groupcontroldroid/server/jetty/JettyServer.java
GroupControlDroid/GroupControlDroidClient
0d5347cd127c2e3b365894d79e03d6a56e8ea3cf
[ "Apache-2.0" ]
3
2018-08-31T01:29:27.000Z
2020-06-23T15:45:11.000Z
package com.groupcontroldroid.server.jetty; import java.util.EnumSet; import javax.servlet.DispatcherType; import javax.servlet.MultipartConfigElement; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.groupcontroldroid.config.JettyConfig; import com.groupcontroldroid.server.jetty.filter.CommonFilter; import com.groupcontroldroid.server.jetty.servlet.ChangePassword; import com.groupcontroldroid.server.jetty.servlet.EditGroupServlet; import com.groupcontroldroid.server.jetty.servlet.FileBrowseServlet; import com.groupcontroldroid.server.jetty.servlet.LoginServlet; import com.groupcontroldroid.server.jetty.servlet.UploadServlet; import com.groupcontroldroid.server.jetty.servlet.UserinfoServlet; import com.groupcontroldroid.server.jetty.servlet.device.AddDeviceToGroupServlet; import com.groupcontroldroid.server.jetty.servlet.device.AddGroupServlet; import com.groupcontroldroid.server.jetty.servlet.device.DeleteDeviceFromGroupServlet; import com.groupcontroldroid.server.jetty.servlet.device.DeteleGroupServlet; import com.groupcontroldroid.server.jetty.servlet.device.GetAllGroupsServlet; import com.groupcontroldroid.server.jetty.servlet.device.GetGroupsServlet; /** * Created by hugeterry * Date: 16/7/18 08:57 */ public class JettyServer extends Thread { final static Logger logger = LoggerFactory.getLogger(JettyServer.class); private static Server server = null; static{ if (server==null) { server=new Server(JettyConfig.port); } } public JettyServer(String name){ super(name); } public static Server getServer() { return server; } public void run() { ServletContextHandler servletContextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS); servletContextHandler.setContextPath("/"); servletContextHandler.setResourceBase("./res"); servletContextHandler.addFilter(CommonFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));//增加过滤器 servletContextHandler.addServlet(LoginServlet.class, "/login.cgi"); servletContextHandler.addServlet(UserinfoServlet.class, "/userinfo.cgi"); servletContextHandler.addServlet(FileBrowseServlet.class, "/file_browse.cgi"); servletContextHandler.addServlet(DefaultServlet.class, "/"); servletContextHandler.addServlet(ChangePassword.class, "/changepassword.cgi"); servletContextHandler.addServlet(AddDeviceToGroupServlet.class, "/device/add_device_to_group.cgi"); servletContextHandler.addServlet(AddGroupServlet.class, "/group/add_group.cgi"); servletContextHandler.addServlet(GetGroupsServlet.class , "/group/get_groups.cgi"); servletContextHandler.addServlet(EditGroupServlet.class, "/group/edit_group.cgi"); servletContextHandler.addServlet(GetAllGroupsServlet.class, "/group/get_all_groups.cgi"); servletContextHandler.addServlet(DeteleGroupServlet.class, "/group/delete_group.cgi"); servletContextHandler.addServlet(AddDeviceToGroupServlet.class, "/group/add_device_to_group.cgi"); servletContextHandler.addServlet(DeleteDeviceFromGroupServlet.class,"/group/delete_device_from_group.cgi"); ServletHolder fileUploadServletHolder = new ServletHolder(new UploadServlet()); fileUploadServletHolder.getRegistration().setMultipartConfig(new MultipartConfigElement(System.getProperty("user.dir") +JettyConfig.UPLOAD_TMP_PATH)); servletContextHandler.addServlet(fileUploadServletHolder, "/upload.cgi"); servletContextHandler.setClassLoader(Thread.currentThread().getContextClassLoader()); server.setHandler(servletContextHandler); try { server.start(); server.join(); } catch (Exception e) { logger.error("",e); } } }
43.873563
152
0.814514
c8dcbc0bf4a205861e79ef2092d5cd735a1d5f4a
973
dart
Dart
lib/Widgets/buttons/radio_button.dart
zakariaBoukernafa/Marv
3ba9c2c59a113387e352b5ef47b8bdf0c713c7e8
[ "MIT" ]
3
2021-06-05T22:51:01.000Z
2021-08-13T09:41:25.000Z
lib/Widgets/buttons/radio_button.dart
zakariaBoukernafa/Marv
3ba9c2c59a113387e352b5ef47b8bdf0c713c7e8
[ "MIT" ]
null
null
null
lib/Widgets/buttons/radio_button.dart
zakariaBoukernafa/Marv
3ba9c2c59a113387e352b5ef47b8bdf0c713c7e8
[ "MIT" ]
null
null
null
import 'package:ecommerce/theme/colors.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; class RadioItem extends StatelessWidget { final RadioModel _item; const RadioItem(this._item); @override Widget build(BuildContext context) { return AnimatedContainer( duration: const Duration(milliseconds: 300), height: _item.isSelected ? Get.height * 0.06 : Get.height * 0.04, width: Get.width * 0.25, curve: Curves.fastOutSlowIn, decoration: BoxDecoration( color: _item.isSelected ? green : white, borderRadius: BorderRadius.circular(10.0), ), child: Center( child: Text( _item.text, style: TextStyle(color: _item.isSelected ? white : black), ), )); } } class RadioModel { bool isSelected; final String text; // ignore: avoid_positional_boolean_parameters RadioModel(this.isSelected, this.text); }
26.297297
73
0.64851
286048c1b561b81a43741262682939aef4795088
4,163
lua
Lua
lua/entities/npc_mutant_controller_swamp/init.lua
kristofferth/cotz
7d76c0214fbe8bbda6a8996697154d0feaf50f44
[ "MIT" ]
3
2021-12-15T12:49:33.000Z
2022-01-15T16:15:40.000Z
lua/entities/npc_mutant_controller_swamp/init.lua
kristofferth/cotz
7d76c0214fbe8bbda6a8996697154d0feaf50f44
[ "MIT" ]
1
2022-02-10T19:12:08.000Z
2022-02-10T19:36:02.000Z
lua/entities/npc_mutant_controller_swamp/init.lua
kristofferth/cotz
7d76c0214fbe8bbda6a8996697154d0feaf50f44
[ "MIT" ]
3
2021-12-07T00:34:43.000Z
2021-12-23T15:37:44.000Z
AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" ) include('shared.lua') include("STALKERNPCBaseVars.lua") ENT.PainSoundEnabled = true ENT.PainSound.name = "Stalker.Controller.Pain" ENT.PainSound.min = 1 ENT.PainSound.max = 6 ENT.DieSoundEnabled = true ENT.DieSound.name = "Stalker.Controller.Die" ENT.DieSound.min = 1 ENT.DieSound.max = 2 ENT.hp = 1500 ENT.hpvar = 100 ENT.flatbulletresistance = 2 ENT.percentbulletresistance = 5 ENT.CanSpecial = true ENT.SNPCClass="C_MONSTER_PLAYERFOCUS" ENT.CanSpecialTimer = 0 ENT.SpecialAttack = 0 ENT.special1 = 0 ENT.special2 = 0 ENT.MinRangeDist = 900 ENT.MaxRangeDist = 1500 ENT.VisibleSchedule = SCHED_RUN_FROM_ENEMY_FALLBACK ENT.RangeSchedule = SCHED_RUN_RANDOM function ENT:Initialize() self.Model = "models/monsters/tibet.mdl" self:STALKERNPCInit(Vector(-16,-16,70),MOVETYPE_STEP) self:SetBloodColor(BLOOD_COLOR_RED) self:DropToFloor() local TEMP_MeleeHitTable = { "Stalker.Claw.Hit" } local TEMP_MeleeMissTable = { "Stalker.Claw.Miss" } local TEMP_MeleeTable = self:STALKERNPCCreateMeleeTable() TEMP_MeleeTable.damage[1] = 19 TEMP_MeleeTable.damagetype[1] = bit.bor(DMG_SLASH, DMG_CLUB) TEMP_MeleeTable.distance[1] = 21 TEMP_MeleeTable.radius[1] = 60 TEMP_MeleeTable.time[1] = 0.8 TEMP_MeleeTable.bone[1] = "bip01_r_hand" TEMP_MeleeTable.damage[2] = 19 TEMP_MeleeTable.damagetype[2] = bit.bor(DMG_SLASH, DMG_CLUB) TEMP_MeleeTable.distance[2] = 21 TEMP_MeleeTable.radius[2] = 60 TEMP_MeleeTable.time[2] = 1.2 TEMP_MeleeTable.bone[2] = "bip01_l_hand" self:STALKERNPCSetMeleeParams(1,"S_Melee2",2, TEMP_MeleeTable,TEMP_MeleeHitTable,TEMP_MeleeMissTable) self:SetHealth(self.hp + math.random(-self.hpvar, self.hpvar)) self.MaxVictims = 0 self.GoingToSpawnThem = false self.NextSpawn = 0 self:SetMaxHealth(self:Health()) self.Victims = {} end function ENT:STALKERNPCThinkEnemyValid() end function ENT:STALKERNPCThink() if(self.CanSpecialTimer < CurTime()) then self.CanSpecial = true end if (self.special1 < CurTime() and self.SpecialAttack == 1) then self:EmitSound("Stalker.Controller.Control.3") if (IsValid(self:GetEnemy())&&self:GetEnemy()!=nil&&self:GetEnemy()!=nil) then local TEMP_POORGUY = self:GetEnemy() if(TEMP_POORGUY:Visible(self)) then local TEMP_ShootPoint = TEMP_POORGUY:GetPos()+TEMP_POORGUY:OBBCenter() local TEMP_ShootPos = self:GetPos()+Vector(0,0,50)+(self:GetForward()*15) local TEMP_Grav = ents.Create("ent_swampcontroller_ball") TEMP_Grav:SetPos(TEMP_ShootPos) TEMP_Grav:SetAngles((TEMP_ShootPoint-TEMP_ShootPos):Angle()) TEMP_Grav:Spawn() TEMP_Grav:SetOwner(self) TEMP_Grav:GetPhysicsObject():SetVelocity((TEMP_ShootPoint-TEMP_ShootPos):GetNormalized()*2500) self:STALKERNPCClearAnimation() end self.SpecialAttack = 2 end end if (self.special2 < CurTime() and self.SpecialAttack == 2) then self:STALKERNPCClearAnimation() self.SpecialAttack = 0 end end function ENT:STALKERNPCDistanceForMeleeTooBig() if(self.CanSpecial==true) then local TEMP_ShootPoint = self:GetPos()+(self:GetForward()*1000) if(self:GetEnemy()) then TEMP_ShootPoint = self:GetEnemy():GetPos()+self:GetEnemy():OBBCenter() end local TEMP_ShootPos = self:GetPos()+Vector(0,0,50)+(self:GetForward()*15) local _, yaw, _ = (TEMP_ShootPoint-TEMP_ShootPos):GetNormalized():Angle():Unpack() local pitch, _, roll = self:GetAngles():Unpack() self:SetAngles(Angle(pitch,yaw,roll)) self:STALKERNPCPlayAnimation("psy_attack_0") self:STALKERNPCPlaySoundRandom(100,"Stalker.Controller.SpecialAttack",1,1) self.special1 = CurTime() + 2 self.special2 = CurTime() + 2.1 self.SpecialAttack = 1 self.CanSpecial = false self.CanSpecialTimer = CurTime()+9 end end function ENT:STALKERNPCDamageTake(dmginfo,mul) if(dmginfo:GetDamageType() == DMG_BULLET) then dmginfo:SetDamage(dmginfo:GetDamage()*(1 - (self.percentbulletresistance/100))) dmginfo:SubtractDamage(self.flatbulletresistance) dmginfo:SetDamage(math.max(0,dmginfo:GetDamage())) --So he can't heal from our attacks end end function ENT:STALKERNPCRemove() end
26.515924
102
0.747298
98f7e8a78b8a37ded937530e397d6c48efa44cae
591
asm
Assembly
oeis/142/A142471.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/142/A142471.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/142/A142471.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A142471: a(0) = a(1) = 0; thereafter a(n) = a(n-1)*a(n-2) + 2. ; Submitted by Jon Maiga ; 0,0,2,2,6,14,86,1206,103718,125083910,12973452977382,1622770224612082123622,21052933202100473722674133293917606,34164073141115747076263787631563122725393126176374288934,719253949751584734557107590240637420950793871703709034551586253602703175485808985433572006,24572644546349531193843021109676007818470753782093163278232584173645807069886561716155081211955058500863191187549298620283374592024982249937981606 lpb $0 sub $0,1 mul $3,$1 add $2,$3 mov $3,$1 mov $1,$2 mov $2,2 lpe mov $0,$1
42.214286
408
0.817259
cb52fcc3b9f32ceddfbd9781d1e881072e07bd44
1,540
c
C
src/GRACEL1C/editsca.c
kun-shang/GRACE-Gravity-Inversion
744221c6c9eff61f35b9fb59171e6f83caafb6a3
[ "MIT" ]
null
null
null
src/GRACEL1C/editsca.c
kun-shang/GRACE-Gravity-Inversion
744221c6c9eff61f35b9fb59171e6f83caafb6a3
[ "MIT" ]
null
null
null
src/GRACEL1C/editsca.c
kun-shang/GRACE-Gravity-Inversion
744221c6c9eff61f35b9fb59171e6f83caafb6a3
[ "MIT" ]
3
2017-02-05T06:19:59.000Z
2021-11-12T09:05:39.000Z
#include <stdio.h> #include <stdlib.h> #include <math.h> int main (int argc, char *argv[]) { FILE *fpin, *fpout; int n, i, gps2, gps1; double sca0[4] = {0}, sca2[4]={0}, sca1[4]={0}, diff, diffnew; char line[400]; /*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+--*/ if ( (fpin = fopen (argv[1],"r")) == NULL) { printf ("Cannot open acc file!\n"); exit (0); } if ( (fpout = fopen (argv[2],"w")) == NULL) { printf ("Cannot open acc file!\n"); exit (0); } gps1=0;gps2=0; i = 0; while (1) { if (fgets(line,400, fpin) ==NULL) break; sscanf (line, "%d%*s%*d%lf%lf%lf%lf", &gps2, &sca0[0], &sca0[1], &sca0[2], &sca0[3]); diff = fabs((sca0[0] - sca1[0])/(double)(gps2-gps1)); if (diff > 0.001) { for (n = 0; n < 4; n++) sca2[n] = - sca0[n]; // printf ("diff = %f\n", diff); } else { for (n = 0; n < 4; n++) sca2[n] = sca0[n]; } diffnew = fabs((sca2[0] - sca1[0])/(double)(gps2-gps1)); fprintf (fpout, "%10d %20.15lf %20.15lf %20.15lf %20.15lf %f %20.15lf %20.15lf %20.15lf %20.15lf %f\n", gps2, sca2[0], sca2[1], sca2[2], sca2[3], diffnew, sca0[0], sca0[1], sca0[2], sca0[3], diff); gps1 = gps2; for (n = 0; n < 4; n++) sca1[n] = sca2[n]; i++; } fclose(fpin); fclose(fpout); return 0; }
23.692308
111
0.415584
1686bdc958ad1a2f01f9501ff6815b4653d317d9
114
ts
TypeScript
scopes/ui-foundation/react-router/ui/link-anchor/index.ts
TheRakeshPurohit/bit
f2eabfde302638711df73554466778d103049434
[ "Apache-2.0" ]
15,458
2017-01-22T14:56:10.000Z
2022-03-31T19:36:22.000Z
scopes/ui-foundation/react-router/ui/link-anchor/index.ts
Gellish/bit
b53153dd1a7b9254da00893a9672aab7525bf6c7
[ "Apache-2.0" ]
2,737
2017-03-07T08:41:51.000Z
2022-03-31T22:30:58.000Z
scopes/ui-foundation/react-router/ui/link-anchor/index.ts
Gellish/bit
b53153dd1a7b9254da00893a9672aab7525bf6c7
[ "Apache-2.0" ]
910
2017-01-26T20:22:27.000Z
2022-03-19T13:33:14.000Z
export { LinkAnchor } from './link-anchor'; export { LinkContextProvider, useLinkContext } from './link-context';
38
69
0.736842
ba62c86446c9648b5a01b4e97c5dc426bded6da9
229
sql
SQL
dingo-test/src/test/resources/io/dingodb/test/agg/table-datetest-create.sql
kevinguo1989/dingo
5a749bf7d51e0b2ffd94b419d7498e8d92ed1815
[ "Apache-2.0" ]
86
2021-10-20T06:52:51.000Z
2022-03-30T02:38:50.000Z
dingo-test/src/test/resources/io/dingodb/test/agg/table-datetest-create.sql
kevinguo1989/dingo
5a749bf7d51e0b2ffd94b419d7498e8d92ed1815
[ "Apache-2.0" ]
29
2021-11-01T04:56:58.000Z
2022-03-30T08:50:21.000Z
dingo-test/src/test/resources/io/dingodb/test/agg/table-datetest-create.sql
kevinguo1989/dingo
5a749bf7d51e0b2ffd94b419d7498e8d92ed1815
[ "Apache-2.0" ]
28
2021-10-20T07:02:58.000Z
2022-03-30T08:50:25.000Z
create table datetest( id int, name varchar(20), age int, amount double, address varchar(255), birthday date, create_time time, update_time timestamp, is_delete boolean, primary key (id) )
17.615385
26
0.641921
4797bfa16bfe05026ae00e282ab1c81e3f40d0d9
5,514
lua
Lua
TrinketAlerter.lua
BannZay/TrinketAlerter
5bdbe98a2042158cb3ac10c71e41c1e887c36957
[ "MIT" ]
5
2021-12-20T08:50:26.000Z
2022-02-07T01:52:25.000Z
TrinketAlerter.lua
BannZay/TrinketAlerter
5bdbe98a2042158cb3ac10c71e41c1e887c36957
[ "MIT" ]
null
null
null
TrinketAlerter.lua
BannZay/TrinketAlerter
5bdbe98a2042158cb3ac10c71e41c1e887c36957
[ "MIT" ]
null
null
null
local BannZayLib = LibStub:GetLibrary("BannZayLib-1.0") local Array = BannZayLib.Array; local KVP = BannZayLib.KVP; local Logger = BannZayLib.Logger; local Utils = BannZayLib.Utils; local Namespace = BannZayLib.Namespace; local db; local logger = Logger:New("TrinketAlerter", 3); local TrinketAlerter = LibStub("AceAddon-3.0"):NewAddon("TrinketAlerter"); TrinketAlerter.Event = {} Namespace:Register("BannZay.TrinketAlerter", TrinketAlerter); TrinketAlerter.Settings = { AnimationTime = "animationTime", Scale = "scale", AnimationSpeed = "animationSpeed" } function TrinketAlerter:GetDefaultDbSettings() return { profile = { x = 0, y = 0, [TrinketAlerter.Settings.AnimationTime] = 1.8, [TrinketAlerter.Settings.AnimationSpeed] = .1, [TrinketAlerter.Settings.Scale] = 3, classesTexture = "Interface\\TargetingFrame\\UI-Classes-Circles", lockedTexture = "Interface\\Icons\\INV_Jewelry_TrinketPVP_01", } }; end function TrinketAlerter:ApplyDbSettings() self.framesPool:ForEach(function(f) f:SetScale(db.scale); end ); self.leadFrame:ClearAllPoints() if (db.x==0 and db.y==0) then self.leadFrame:SetPoint("Right", UIParent, "Center", 0, -self.leadFrame:GetHeight()/2) else local scale = self.leadFrame:GetEffectiveScale() self.leadFrame:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", db.x/scale, db.y/scale) end end function TrinketAlerter:OnProfileChanged(event, database, newProfileKey) db = self.db.profile self.db = db; end function TrinketAlerter:OnInitialize() self.db = LibStub("AceDB-3.0"):New("TrinketAlerterDB", self:GetDefaultDbSettings()); self.db.RegisterCallback(self, "OnProfileChanged", "OnProfileChanged"); self:OnProfileChanged(); local framesPool = Array:New(); local frame1 = self:CreateNotificationFrame(nil); local frame2 = self:CreateNotificationFrame(frame1); local frame3 = self:CreateNotificationFrame(frame2); local frame4 = self:CreateNotificationFrame(frame3); local frame5 = self:CreateNotificationFrame(frame4); framesPool:Add(frame1, frame2, frame3, frame4, frame5); self.leadFrame = frame1; self.framesPool = framesPool; local taCommanManager = BannZayLib.SlashCommandManager:New("TrinketAlerter", "ta"); taCommanManager:AddCommand("lock", function() self:Lock(); end); Utils:SetMouseMove(self.leadFrame, false, nil, function() local scale = self.leadFrame:GetEffectiveScale(); db.x = self.leadFrame:GetLeft() * scale; db.y = self.leadFrame:GetTop() * scale end); self.locked = false; self.eventNotificatioDelay = 3; self:ApplyDbSettings(); end function TrinketAlerter:Lock(value) if value == nil then value = not self.locked; end if self.locked == value then return; end self.locked = value; self.framesPool:ForEach(function(f) UIFrameFlashStop(f); self:SetFrameLocked(f, self.locked); end); self.leadFrame.texture:SetAlpha(1); Utils:SetMouseMove(self.leadFrame, self.locked); if self.locked then self.framesPool:ForEach(function(f) f.borrowedTill = 0; end); -- release all frames end end function TrinketAlerter:SetFrameLocked(frame, value) if value then frame.texture:SetTexture(db.lockedTexture); frame.texture:SetTexCoord(0,1,0,1); frame:Show(); frame.texture:SetAlpha(0.1); else frame.texture:SetTexture(db.classesTexture); frame:Hide(); frame.texture:SetAlpha(1); end end function TrinketAlerter:OnEnable() self.EventHandler = CreateFrame("Frame"); self.EventHandler:SetScript("OnEvent", function(evHandler, event, ...) self.Event[event](evHandler, ...); end); for k,v in pairs(self.Event) do self.EventHandler:RegisterEvent(k) end end function TrinketAlerter:CreateNotificationFrame(neighbor, name) local frame = CreateFrame("Frame", name); frame:Hide(); frame.borrowedTill = 0; frame:SetHeight(50); frame:SetWidth(50); if neighbor ~= nil then frame:SetPoint("Left", neighbor, "Right"); else frame:SetPoint("Center", "UIParent", "Center"); end local texture = frame:CreateTexture(nil,BORDER); frame.texture = texture; texture:SetTexture(db.classesTexture); texture:SetAllPoints(); return frame; end function TrinketAlerter:BorrowFrame(borrowTime) local freeFrame = self.framesPool:Find(function(x) return GetTime() > x.borrowedTill end); if freeFrame ~= nil then freeFrame.borrowedTill = GetTime() + borrowTime; end return freeFrame; end function TrinketAlerter:Notify(unit) local unitName = UnitName(unit) if (self.lastNotification ~= nil and self.lastNotification:Item1() == unitName and GetTime() - self.lastNotification:Item2() < self.eventNotificatioDelay) then return nil -- do not notify about the same events end local unitClass, classId = UnitClass(unit); self:FlashFreeFrame(classId) self.lastNotification = KVP:New(unitName, GetTime()) end function TrinketAlerter:FlashFreeFrame(classId) local frame = self:BorrowFrame(db.animationTime); if frame == nil then logger:Log(0, "No free notification frames found"); return; end frame.texture:SetTexCoord(unpack(CLASS_ICON_TCOORDS[classId])); UIFrameFlash(frame, db.animationSpeed, db.animationSpeed, db.animationTime, false); end function TrinketAlerter.Event:UNIT_SPELLCAST_SUCCEEDED(unit, spell, rank) local self = TrinketAlerter; if self.locked then return; end if UnitIsFriend("player", unit) then return end -- pvp trinket if (spell == GetSpellInfo(59752) or spell == GetSpellInfo(42292)) then self:Notify(unit); end -- wotf if ( spell == GetSpellInfo(7744)) then self:Notify(unit); end end
27.162562
194
0.746826
d91eddd67d28a5f8f4c40e6165c38c51f7350a73
2,581
ps1
PowerShell
Start.ps1
essdeekay/ThreatHunt
33d92a1a0b6ab61d63e22deba144c2f56e0cc558
[ "MIT" ]
112
2019-07-19T14:53:22.000Z
2022-03-21T13:01:56.000Z
Start.ps1
essdeekay/ThreatHunt
33d92a1a0b6ab61d63e22deba144c2f56e0cc558
[ "MIT" ]
null
null
null
Start.ps1
essdeekay/ThreatHunt
33d92a1a0b6ab61d63e22deba144c2f56e0cc558
[ "MIT" ]
21
2019-07-19T16:21:33.000Z
2021-12-22T01:17:16.000Z
$ScriptRun = Get-Location Function Menu { Clear-Host Do { Clear-Host Write-Host -Object '___________.__ __ ___ ___ __ ' -ForegroundColor Red Write-Host -Object '\__ ___/| |_________ ____ _____ _/ |_ / | \ __ __ _____/ |_ ' -ForegroundColor Red Write-Host -Object ' | | | | \_ __ \_/ __ \\__ \\ __\/ ~ \ | \/ \ __\' -ForegroundColor Red Write-Host -Object ' | | | Y \ | \/\ ___/ / __ \| | \ Y / | / | \ | ' -ForegroundColor Blue Write-Host -Object ' |____| |___| /__| \___ >____ /__| \___|_ /|____/|___| /__| ' -ForegroundColor Blue Write-Host -Object ' \/ \/ \/ \/ \/ ' -ForegroundColor Blue Write-Host -Object '****************************' Write-Host -Object '****************************' Write-Host -Object ' Follow the white rabbit' Write-Host -Object '****************************' Write-Host -Object '' Write-Host -Object '1. Prepare Environment ' Write-Host -Object '2. Tampering OS Security ' Write-Host -Object '3. Footprinting and Reconnaissance ' Write-Host -Object '4. Gaining and Maintaining Access ' Write-Host -Object '5. Network Discovery and Access ' Write-Host -Object '6. Data Exfiltration ' Write-Host -Object '7. Clean Up ' Write-Host -Object 'Q. Quit' Write-Host -Object '' Write-Host -Object '****************************' Write-Host -Object '*********@MiladMSFT*********' Write-Host -Object $errout $Menu = Read-Host -Prompt '(0-6 or Q to Quit)' switch ($Menu) { 1 {."$ScriptRun\scripts\prepare.ps1" pause} 2 {."$ScriptRun\scripts\tampering.ps1" pause} 3 {."$ScriptRun\scripts\scanning.ps1" pause} 4 {."$ScriptRun\scripts\gainmain.ps1" pause} 5 {."$ScriptRun\scripts\network.ps1" pause} 6 {."$ScriptRun\scripts\dataexfiltration.ps1" pause} 7 {."$ScriptRun\scripts\cleanup.ps1" pause} Q {Exit} default {$errout = 'Invalid option please try again........Try 0-6 or Q only'} } } until ($Menu -eq 'q') } # Launch The Menu Menu
38.522388
122
0.451763
159d0bc9de6ca9e23e01bb0abd6743fa6e38d854
114
rb
Ruby
app/models/role.rb
prescod/communityengine
b88534b8829bde1dd4dff8df6f28b5945b64d972
[ "MIT" ]
1
2020-12-16T17:39:33.000Z
2020-12-16T17:39:33.000Z
app/models/role.rb
prescod/communityengine
b88534b8829bde1dd4dff8df6f28b5945b64d972
[ "MIT" ]
null
null
null
app/models/role.rb
prescod/communityengine
b88534b8829bde1dd4dff8df6f28b5945b64d972
[ "MIT" ]
null
null
null
class Role < ActiveRecord::Base acts_as_enumerated validates_presence_of :name attr_accessible :name end
16.285714
31
0.789474
fb6a146a11f610a9e3deaab490511c48f01dacf4
1,046
java
Java
backend/dao/entity/SearchEntity.java
joelmieze/MRDb
ff1bc677342b17c47472df6623ac878a557c6d52
[ "MIT" ]
1
2022-02-27T06:50:09.000Z
2022-02-27T06:50:09.000Z
backend/dao/entity/SearchEntity.java
joelmieze/MRDb
ff1bc677342b17c47472df6623ac878a557c6d52
[ "MIT" ]
null
null
null
backend/dao/entity/SearchEntity.java
joelmieze/MRDb
ff1bc677342b17c47472df6623ac878a557c6d52
[ "MIT" ]
null
null
null
package com.app.mrdb.dao.entity; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; @JsonIgnoreProperties(ignoreUnknown = true) public class SearchEntity { @JsonProperty(value = "Title") private String Title; @JsonProperty(value = "Year") private String Year; @JsonProperty(value = "imdbID") private String imdbID; @JsonProperty(value = "Type") private String Type; @JsonProperty(value = "Poster") private String Poster; public String getTitle() { return Title; } public void setTitle(String title) { Title = title; } public String getYear() { return Year; } public void setYear(String year) { Year = year; } public String getImdbID() { return imdbID; } public void setImdbID(String imdbID) { this.imdbID = imdbID; } public String getType() { return Type; } public void setType(String type) { Type = type; } public String getPoster() { return Poster; } public void setPoster(String poster) { Poster = poster; } }
16.092308
61
0.709369
3e76e3dfd0dff1cfcbd5332106754a3c8fba193a
2,180
dart
Dart
lib/otp_consent.dart
sarbagyastha/otp_consent
af45f3d520c4758e7f23682dcaaebf31115ffe8b
[ "MIT" ]
null
null
null
lib/otp_consent.dart
sarbagyastha/otp_consent
af45f3d520c4758e7f23682dcaaebf31115ffe8b
[ "MIT" ]
null
null
null
lib/otp_consent.dart
sarbagyastha/otp_consent
af45f3d520c4758e7f23682dcaaebf31115ffe8b
[ "MIT" ]
null
null
null
/// /// It is compatible Android only. /// import 'dart:async'; import 'dart:io'; import 'package:flutter/services.dart'; /// /// class OtpConsent { /// Create instance [OtpConsent] plugin static OtpConsent? _singleton; factory OtpConsent() => _singleton ??= OtpConsent._(); OtpConsent._() { _channel.setMethodCallHandler(_handleMethod); // Set callback from native } /// [MethodChannel] used to communicate with the platform side. static const MethodChannel _channel = const MethodChannel('otp_consent'); final StreamController<String> _smsController = StreamController.broadcast(); Stream<String> get sms => _smsController.stream; Future<String> get platformVersion async { final String version = await _channel.invokeMethod('getPlatformVersion'); return version; } Future<bool> startListening([String? phone]) async { final bool startListening = await _channel.invokeMethod('startListening', phone); return startListening; } Future<bool> get stopListening async { final bool stopListening = await _channel.invokeMethod('stopListening'); return stopListening; } Future<dynamic> _handleMethod(MethodCall methodCall) async { switch (methodCall.method) { case "onSmsConsentReceived": _smsController.add(methodCall.arguments); break; case "onTimeout": break; case "onSmsConsentPermissionDenied": break; case "onShowPermissionDialog": break; case "onStopListener": break; } } } mixin OtpConsentAutoFill { final OtpConsent _otpConsent = OtpConsent(); String? sms; StreamSubscription? _subscription; Future<void> startSmsListening([String? phone]) async { if (Platform.isAndroid) { _subscription?.cancel(); _subscription = _otpConsent.sms.listen((sms) { this.sms = sms; smsReceived(sms); }); await _otpConsent.startListening(phone); } } Future<void> stopSmsListen() async { if (Platform.isAndroid) { await _otpConsent.stopListening; _cancel(); } } void _cancel() { _subscription?.cancel(); } void smsReceived(String sms); }
25.057471
79
0.681193
1e9a74dce9cc954c5a48388b1eb4713175dfa1a2
934
sql
SQL
seed.sql
Darkorin/Employee-Tracker
e9e6c281256944cd68793100413f17d2021807ea
[ "MIT" ]
null
null
null
seed.sql
Darkorin/Employee-Tracker
e9e6c281256944cd68793100413f17d2021807ea
[ "MIT" ]
null
null
null
seed.sql
Darkorin/Employee-Tracker
e9e6c281256944cd68793100413f17d2021807ea
[ "MIT" ]
null
null
null
USE employee_db; INSERT INTO department VALUES (1, "Engineering"); INSERT INTO department VALUES (2, "Accounting"); INSERT INTO department VALUES (3, "Sales"); INSERT INTO role VALUES (1, "Engineer", 80000.00, 1); INSERT INTO role VALUES (2, "Seinor Engineer", 100000.00, 1); INSERT INTO role VALUES (3, "Accountant", 70000.00, 2); INSERT INTO role VALUES (4, "Senior Accountant", 90000.00, 2); INSERT INTO role VALUES (5, "Salesman", 50000.00, 3); INSERT INTO role VALUES (6, "Senior Salesman", 70000.00, 3); INSERT INTO employee VALUES (1, "David", "Stewart", 1, 2); INSERT INTO employee VALUES (2, "Tim", "Dusterdieck", 2, NULL); INSERT INTO employee VALUES (3, "Phillip", "Fry", 3, 4); INSERT INTO employee VALUES (4, "Hubert", "Farnsworth", 4, NULL); INSERT INTO employee VALUES (5, "Joe", "Simpson", 5, 6); INSERT INTO employee VALUES (6, "John", "Coats", 6, NULL); INSERT INTO employee VALUES (7, "Lauren", "Stewart", 1, 2);
46.7
65
0.69379
cdb7d65d15e18a12891525e8a66adb5086336081
729
asm
Assembly
data/pokemon/base_stats/shaymin.asm
TastySnax12/pokecrystal16-493-plus
9de36c8803c9bdf4b8564ed547f988b0b66f0c41
[ "blessing" ]
2
2021-07-31T07:05:06.000Z
2021-10-16T03:32:26.000Z
data/pokemon/base_stats/shaymin.asm
TastySnax12/pokecrystal16-493-plus
9de36c8803c9bdf4b8564ed547f988b0b66f0c41
[ "blessing" ]
null
null
null
data/pokemon/base_stats/shaymin.asm
TastySnax12/pokecrystal16-493-plus
9de36c8803c9bdf4b8564ed547f988b0b66f0c41
[ "blessing" ]
3
2021-01-15T18:45:40.000Z
2021-10-16T03:35:27.000Z
db 0 ; species ID placeholder db 100, 100, 100, 100, 100, 100 ; hp atk def spd sat sdf db GRASS, GRASS ; type db 45 ; catch rate db 255 ; base exp db MIRACLEBERRY, MIRACLEBERRY ; items db GENDER_UNKNOWN ; gender ratio db 100 ; unknown 1 db 120 ; step cycles to hatch db 5 ; unknown 2 INCBIN "gfx/pokemon/shaymin/front.dimensions" db 0, 0, 0, 0 ; padding db GROWTH_MEDIUM_SLOW ; growth rate dn EGG_NONE, EGG_NONE ; egg groups ; tm/hm learnset tmhm HEADBUTT, CURSE, TOXIC, PSYCH_UP, HIDDEN_POWER, SUNNY_DAY, SWEET_SCENT, SNORE, HYPER_BEAM, PROTECT, GIGA_DRAIN, ENDURE, FRUSTRATION, SOLARBEAM, RETURN, PSYCHIC_M, MUD_SLAP, DOUBLE_TEAM, SWAGGER, SLEEP_TALK, SWIFT, DEFENSE_CURL, DETECT, REST, FLASH ; end
33.136364
253
0.728395
b2ff814a6294aedcb620a27f93776a6856ba661d
380
rs
Rust
src/rest/static_files.rs
Twi1ightSparkle/shaft
459409ea7202b870e793017e5798609198b3d4b6
[ "MIT" ]
1
2019-01-29T11:58:28.000Z
2019-01-29T11:58:28.000Z
src/rest/static_files.rs
Twi1ightSparkle/shaft
459409ea7202b870e793017e5798609198b3d4b6
[ "MIT" ]
1
2019-07-22T19:22:26.000Z
2019-08-19T17:27:13.000Z
src/rest/static_files.rs
Twi1ightSparkle/shaft
459409ea7202b870e793017e5798609198b3d4b6
[ "MIT" ]
2
2017-09-07T15:07:29.000Z
2017-09-13T12:56:19.000Z
//! Renders static files in resource directory use std::path::Path; use actix_web::web::ServiceConfig; use crate::rest::AppState; pub fn register_servlets(config: &mut ServiceConfig, state: &AppState) { let res_dir = Path::new(&state.config.resource_dir); let static_dir = res_dir.join("static"); config.service(actix_files::Files::new("/static", static_dir)); }
25.333333
72
0.721053
01acb22ffe1a90d3c142116b782e88ebdab37a10
1,859
swift
Swift
Pods/lottie-ios/lottie-swift/src/Private/Model/ShapeItems/ShapeItem.swift
AntonioFlores1/Zip-Line
5deddc1951e9a61f5ff095ce89d5765af3a59aee
[ "MIT" ]
10
2019-06-17T12:07:03.000Z
2021-09-07T14:29:36.000Z
Example/Pods/lottie-ios/lottie-swift/src/Private/Model/ShapeItems/ShapeItem.swift
iOSWizards/AwesomeLoading
9aba12694d6fd7c6f8c3a20342af58271041e332
[ "MIT" ]
1
2019-04-29T19:49:51.000Z
2019-04-29T19:49:51.000Z
Pods/lottie-ios/lottie-swift/src/Private/Model/ShapeItems/ShapeItem.swift
AntonioFlores1/Empty-Line
5deddc1951e9a61f5ff095ce89d5765af3a59aee
[ "MIT" ]
3
2019-10-28T09:00:42.000Z
2021-09-13T03:01:51.000Z
// // ShapeItem.swift // lottie-swift // // Created by Brandon Withrow on 1/8/19. // import Foundation /// Used for mapping a heterogeneous list to classes for parsing. extension ShapeType: ClassFamily { static var discriminator: Discriminator = .type func getType() -> AnyObject.Type { switch self { case .ellipse: return Ellipse.self case .fill: return Fill.self case .gradientFill: return GradientFill.self case .group: return Group.self case .gradientStroke: return GradientStroke.self case .merge: return Merge.self case .rectangle: return Rectangle.self case .repeater: return Repeater.self case .shape: return Shape.self case .star: return Star.self case .stroke: return Stroke.self case .trim: return Trim.self case .transform: return ShapeTransform.self default: return ShapeItem.self } } } enum ShapeType: String, Codable { case ellipse = "el" case fill = "fl" case gradientFill = "gf" case group = "gr" case gradientStroke = "gs" case merge = "mm" case rectangle = "rc" case repeater = "rp" case round = "rd" case shape = "sh" case star = "sr" case stroke = "st" case trim = "tm" case transform = "tr" } /// An item belonging to a Shape Layer class ShapeItem: Codable { /// The name of the shape let name: String /// The type of shape let type: ShapeType private enum CodingKeys : String, CodingKey { case name = "nm" case type = "ty" } required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: ShapeItem.CodingKeys.self) self.name = try container.decodeIfPresent(String.self, forKey: .name) ?? "Layer" self.type = try container.decode(ShapeType.self, forKey: .type) } }
21.367816
84
0.644432
207705a94eb6f99bb401e2b81ea262a8dd3b3ace
6,211
dart
Dart
lib/screens/tododetail.dart
KCCoders/todo-app
7164097889918f318b5a2542d54d70613734947f
[ "MIT" ]
null
null
null
lib/screens/tododetail.dart
KCCoders/todo-app
7164097889918f318b5a2542d54d70613734947f
[ "MIT" ]
null
null
null
lib/screens/tododetail.dart
KCCoders/todo-app
7164097889918f318b5a2542d54d70613734947f
[ "MIT" ]
null
null
null
import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:todo_app/model/todo.dart'; import 'package:todo_app/util/dbhelper.dart'; import 'package:intl/intl.dart'; var db = DbHelper(); final List<String> menuChoices = const <String> ['Save', 'Delete', 'Back']; const menuSave = 'Save'; const menuDelete = 'Delete'; const menuBack = 'Back'; class TodoDetail extends StatefulWidget { final Todo todo; TodoDetail(this.todo); @override State<StatefulWidget> createState() => TodoDetailState(todo); } class TodoDetailState extends State { Todo todo; TodoDetailState(this.todo); var _priority = 'Low'; final _priorities = ['High', 'Medium', 'Low']; var titleController = TextEditingController(); var descriptionController = TextEditingController(); @override Widget build(BuildContext context) { titleController.text = todo.title; descriptionController.text = todo.description; var textStyle = Theme.of(context).textTheme.headline6; return Scaffold( appBar: AppBar( automaticallyImplyLeading: false, title: Text(todo.title), actions: <Widget>[ PopupMenuButton<String>( onSelected: select, itemBuilder: (BuildContext context) { return menuChoices.map((String choice) { return PopupMenuItem<String>( value: choice, child: Text(choice), ); }).toList(); }, ), ], ), body: Padding( padding: EdgeInsets.only(top:35, left: 10, right:10), child: ListView(children: <Widget>[Column( children: <Widget> [ TextField( controller: titleController, style: textStyle, onChanged: (value) => this.updateTitle(), decoration: InputDecoration( labelText: 'Title', labelStyle: textStyle, border: OutlineInputBorder( borderRadius: BorderRadius.circular(5), ) ), ), Padding( padding: EdgeInsets.only(top:15, bottom:15), child: TextField( controller: descriptionController, style: textStyle, onChanged: (value) => this.updateDescription(), decoration: InputDecoration( labelText: 'Description', labelStyle: textStyle, border: OutlineInputBorder( borderRadius: BorderRadius.circular(5), ) ), ), ), Container( padding: EdgeInsets.symmetric(horizontal:5, vertical: 5), decoration: BoxDecoration( color: Colors.orangeAccent, borderRadius: BorderRadius.circular(5), ), child: Row( children: <Widget>[ Text( ' Priority', style: TextStyle(fontSize: 20, color: Colors.white), ), Container(width:20), Expanded( child: Container( padding: EdgeInsets.symmetric(horizontal:20, vertical: 5), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(5), ), child: DropdownButton<String>( items: _priorities.map((String value) { return DropdownMenuItem<String> ( value: value, child: Text(value), ); }).toList(), underline: SizedBox(), style: textStyle, value: retrievePriority(todo.priority), onChanged: (value) => updatePriority(value), ), ), ), ], ), ), ], ), ],), ), ); } void select(String value) async { int result; switch (value) { case menuSave: save(); break; case menuDelete: // if creating a new todo and you click delete, do nothing if (todo.id == null) return; // go back to previous screen Navigator.pop(context, true); // delete record and await the result result = await db.deleteTodo(todo.id); // when the result returns it will be greater than 0 // so show a message that the record is deleted if (result != 0) { var alertDialog = AlertDialog( title: Text('Delete Todo'), content: Text('The Todo has been deleted.'), ); showDialog( context: context, builder: (_) => alertDialog, ); } break; case menuBack: Navigator.pop(context, true); break; } } void save() { todo.date = DateFormat.yMd().format(DateTime.now()); if (todo.id != null) { db.updateTodo(todo); } else { db.insertTodo(todo); } Navigator.pop(context, true); } void updatePriority(String value) { switch (value) { case "High": todo.priority = 1; break; case "Medium": todo.priority = 2; break; case "Low": todo.priority = 3; break; } setState(() { _priority = value; }); } String retrievePriority(int value) { return _priorities[value-1]; } void updateTitle() { todo.title = titleController.text; } void updateDescription() { todo.description = descriptionController.text; } }
29.717703
86
0.485912
6379daa3489d4ffe1fa3c8253feedbfc473e2d75
584
asm
Assembly
stdlib/src/port.asm
brian-kelley/GoldOS
738e19c3b9310cfea6bf316c6a4b398eee900324
[ "MIT" ]
5
2016-11-10T02:29:38.000Z
2022-01-09T23:45:59.000Z
stdlib/src/port.asm
brian-kelley/GoldOS
738e19c3b9310cfea6bf316c6a4b398eee900324
[ "MIT" ]
null
null
null
stdlib/src/port.asm
brian-kelley/GoldOS
738e19c3b9310cfea6bf316c6a4b398eee900324
[ "MIT" ]
null
null
null
section .text global readport global writeport global readportw global writeportw global enableInterrupts global disableInterrupts readport: ;byte readport(dword portNum) mov edx, [esp + 4] in al, dx ret writeport: ;void writeport(dword portNum, dword value) mov edx, [esp + 4] mov eax, [esp + 8] out dx, al ret readportw: ;word readport(dword portNum) mov edx, [esp + 4] in ax, dx ret writeportw: ;void writeport(dword portNum, dword value) mov edx, [esp + 4] mov eax, [esp + 8] out dx, ax ret enableInterrupts: sti ret disableInterrupts: cli ret
14.6
55
0.707192
fb05a05edd25530c2218998bdb31c4be2ec219e2
3,476
php
PHP
routes/web.php
ssaidurr/hrm
2e6bfcf209140ca61d818d797148aff40c4cc2bf
[ "MIT" ]
null
null
null
routes/web.php
ssaidurr/hrm
2e6bfcf209140ca61d818d797148aff40c4cc2bf
[ "MIT" ]
null
null
null
routes/web.php
ssaidurr/hrm
2e6bfcf209140ca61d818d797148aff40c4cc2bf
[ "MIT" ]
null
null
null
<?php /* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | Here is where you can register web routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | contains the "web" middleware group. Now create something great! | */ Route::get('/', function () { return view('welcome'); }); Route::middleware('auth')->group(function (){ Route::get('dashboard','DashboardController@index')->name('admin.dashboard'); //Employee Route::get('employee/recycle','EmployeeController@recycle')->name('employee.recycle'); Route::post('employee/restore/{id}','EmployeeController@restore')->name('employee.restore'); Route::delete('employee/delete/{id}','EmployeeController@delete')->name('employee.delete'); Route::resource('employee','EmployeeController'); //Department Route::get('department/recycle','DepartmentController@recycle')->name('department.recycle'); Route::post('department/restore/{id}','DepartmentController@restore')->name('department.restore'); Route::delete('department/delete/{id}','DepartmentController@delete')->name('department.delete'); Route::resource('department','DepartmentController'); //Designation Route::resource('designation','DesignationController'); //Employee Emergency Contact Route::get('employee/emergency/{id}','EmergencyController@index')->name('employee.emergency.index'); Route::get('employee/emergency/add/{id}','EmergencyController@create')->name('employee.emergency.add'); Route::post('employee/emergency/store/{id}','EmergencyController@store')->name('employee.emergency.store'); Route::get('employee/emergency/edit/{employee_id}/{id}','EmergencyController@edit')->name('employee.emergency.edit'); Route::put('employee/emergency/update/{employee_id}/{id}','EmergencyController@update')->name('employee.emergency.update'); Route::delete('employee/emergency/delete/{employee_id}/{id}','EmergencyController@destroy')->name('employee.emergency.destroy'); //Employee Family Contact Route::get('employee/family/{id}','FamilyController@index')->name('employee.family.index'); Route::get('employee/family/add/{id}','FamilyController@create')->name('employee.family.add'); Route::post('employee/family/store/{id}','FamilyController@store')->name('employee.family.store'); Route::get('employee/family/edit/{employee_id}/{id}','FamilyController@edit')->name('employee.family.edit'); Route::put('employee/family/update/{employee_id}/{id}','FamilyController@update')->name('employee.family.update'); Route::delete('employee/family/delete/{employee_id}/{id}','FamilyController@destroy')->name('employee.family.destroy'); //Employee Bnak Information Route::get('employee/bank/{id}','BankInformationController@index')->name('employee.bank.index'); Route::get('employee/bank/add/{id}','BankInformationController@create')->name('employee.bank.add'); Route::post('employee/bank/store/{id}','BankInformationController@store')->name('employee.bank.store'); Route::get('employee/bank/edit/{employee_id}/{id}','BankInformationController@edit')->name('employee.bank.edit'); Route::put('employee/bank/update/{employee_id}/{id}','BankInformationController@update')->name('employee.bank.update'); Route::delete('employee/bank/delete/{employee_id}/{id}','BankInformationController@destroy')->name('employee.bank.destroy'); }); Auth::routes(); Route::get('/home', 'HomeController@index')->name('home');
59.931034
128
0.720656
7093837bef233be1d2dda03d8dcd5edb33fce960
936
h
C
include/moduleregistry.h
redxdev/Wake
6d2021e549f2dc024f60745146af7493707e2255
[ "MIT" ]
16
2015-06-02T03:36:08.000Z
2022-02-27T21:03:34.000Z
include/moduleregistry.h
redxdev/Wake
6d2021e549f2dc024f60745146af7493707e2255
[ "MIT" ]
3
2016-05-23T21:24:47.000Z
2016-05-25T15:38:20.000Z
include/moduleregistry.h
redxdev/Wake
6d2021e549f2dc024f60745146af7493707e2255
[ "MIT" ]
1
2018-09-08T04:14:07.000Z
2018-09-08T04:14:07.000Z
#pragma once #include "luautil.h" #include <list> #include <tuple> #define W_MODULE_REGISTRY (wake::ModuleRegistry::get()) #define W_REGISTER_MODULE_PRIORITY(openFunc, priority) static ModuleAutomation __w_module_##openFunc(openFunc, priority) #define W_REGISTER_MODULE(openFunc) W_REGISTER_MODULE_PRIORITY(openFunc, 0) namespace wake { class ModuleAutomation { public: ModuleAutomation(lua_CFunction openFunc, int priority); }; class ModuleRegistry { public: static ModuleRegistry& get(); public: void addToRegistry(lua_CFunction openFunc, int priority = 0); void registerAll(lua_State* L); private: ModuleRegistry(); ModuleRegistry(const ModuleRegistry& other) = delete; ModuleRegistry& operator=(const ModuleRegistry& other) = delete; ~ModuleRegistry(); std::list<std::tuple<int, lua_CFunction>> modules; }; }
22.829268
120
0.693376
3be5db5135ea6435b343f8bc7bc587c24d852025
408
kt
Kotlin
src/main/kotlin/com/github/stiangao/pipixia/domain/Dish.kt
stiangao/pipixia
c088b9518b3c2929ddba9d3dc4cb30ee6b7916e3
[ "Apache-2.0" ]
null
null
null
src/main/kotlin/com/github/stiangao/pipixia/domain/Dish.kt
stiangao/pipixia
c088b9518b3c2929ddba9d3dc4cb30ee6b7916e3
[ "Apache-2.0" ]
null
null
null
src/main/kotlin/com/github/stiangao/pipixia/domain/Dish.kt
stiangao/pipixia
c088b9518b3c2929ddba9d3dc4cb30ee6b7916e3
[ "Apache-2.0" ]
null
null
null
package com.github.stiangao.pipixia.domain import org.springframework.data.repository.CrudRepository import org.springframework.stereotype.Repository import javax.persistence.Entity /** * Created by shitiangao on 2017/8/22. */ @Entity class Dish : BaseEntity() { var name: String = "" var cuisineId: Long = -1 var type = "" } @Repository interface DishRepository : CrudRepository<Dish, Long>
22.666667
57
0.75
d10a1784d4937977b9d68d3e060fcf816f4f4366
3,243
ps1
PowerShell
external_libs/CppUTest/scripts/appveyor_ci_build.ps1
Dasudian/dsd-datahub-sdk-embedded-C
c3e6cdc3db6ef2efdeaab2a32ed78b80f3cbe430
[ "Apache-2.0" ]
5
2019-03-27T17:12:42.000Z
2020-09-25T17:20:36.000Z
external_libs/CppUTest/scripts/appveyor_ci_build.ps1
Dasudian/dsd-datahub-sdk-embedded-C
c3e6cdc3db6ef2efdeaab2a32ed78b80f3cbe430
[ "Apache-2.0" ]
null
null
null
external_libs/CppUTest/scripts/appveyor_ci_build.ps1
Dasudian/dsd-datahub-sdk-embedded-C
c3e6cdc3db6ef2efdeaab2a32ed78b80f3cbe430
[ "Apache-2.0" ]
1
2022-03-24T13:47:17.000Z
2022-03-24T13:47:17.000Z
 # Load functions from the helper file . (Join-Path (Split-Path $MyInvocation.MyCommand.Path) 'appveyor_helpers.ps1') function Invoke-BuildCommand($command, $directory = '.') { $command_wrapped = "$command;`$err = `$?" Write-Host $command Push-Location $directory Invoke-Expression $command_wrapped if ($LASTEXITCODE -ne 0) { Pop-Location Write-Host "Command Returned error: $LASTEXITCODE" Exit $LASTEXITCODE } Pop-Location } function Invoke-CygwinCommand($command, $directory = '.') { # Assume cygwin is located at C:\cygwin on x86 and C:\cygwin64 on x64 for now $cygwin_bin = Get-CygwinBin $cygwin_directory = (. "${cygwin_bin}\cygpath.exe" (Resolve-Path $directory)) $command_wrapped = "${cygwin_bin}\bash.exe --login -c 'cd $cygwin_directory ; $command'" Write-Host "Executing <$command> in <$cygwin_directory>" Invoke-Expression $command_wrapped if ($LASTEXITCODE -ne 0) { Write-Host "Command Returned error: $LASTEXITCODE" Exit $LASTEXITCODE } } # The project files that will get built $VS2008ProjectFiles = @( 'CppUTest.vcproj' , 'tests\AllTests.vcproj' ) $VS2010ProjectFiles = @( 'CppUTest.vcxproj', 'tests\AllTests.vcxproj' ) if ($env:APPVEYOR) { $logger_arg = '/logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"' } else { $logger_arg = '' } # Clean up some paths for any configuration Remove-PathFolder "C:\MinGW\bin" Remove-PathFolder "C:\Program Files\Git\bin" Remove-PathFolder "C:\Program Files\Git\cmd" Remove-PathFolder "C:\Program Files\Git\usr\bin" Remove-PathFolder "C:\Program Files (x86)\Git\bin" Remove-PathFolder "C:\Program Files (x86)\Git\cmd" Remove-PathFolder "C:\Program Files (x86)\Git\usr\bin" switch -Wildcard ($env:Platform) { 'Cygwin*' { Invoke-CygwinCommand "autoreconf -i .." "cpputest_build" Invoke-CygwinCommand "../configure" "cpputest_build" Invoke-CygwinCommand "make CppUTestTests.exe CppUTestExtTests.exe" "cpputest_build" } 'MinGW*' { $mingw_path = Get-MinGWBin # Add mingw to the path Add-PathFolder $mingw_path Invoke-BuildCommand "cmake --version" Invoke-BuildCommand "cmake -G 'MinGW Makefiles' .." 'cpputest_build' Invoke-BuildCommand "mingw32-make all" 'cpputest_build' Remove-PathFolder $mingw_path } default # Assume that anything else uses Visual C++ { if ($env:PlatformToolset -eq 'v90') { # Load environment variables from vsvars32.bat $vsvarspath = Join-Path $env:VS90COMNTOOLS vsvars32.bat Get-BatchFile($vsvarspath) $VS2008ProjectFiles | foreach { Invoke-BuildCommand "vcbuild /upgrade $_" } $VS2008ProjectFiles | foreach { Invoke-BuildCommand "vcbuild $_ $env:CONFIGURATION" } } else { $VS2010ProjectFiles | foreach { Invoke-BuildCommand "msbuild /ToolsVersion:14.0 $logger_arg $_" } } } }
29.481818
94
0.621338
a2f37995cee54406d91369087ac18d58a9dd6e2e
1,281
lua
Lua
test/unit/builder_spec.lua
paniash/nvim-snippy
307d29140676b450c55c2f8eb4a2abfbc94c497b
[ "MIT" ]
77
2021-08-29T02:52:55.000Z
2022-03-28T17:44:42.000Z
test/unit/builder_spec.lua
paniash/nvim-snippy
307d29140676b450c55c2f8eb4a2abfbc94c497b
[ "MIT" ]
38
2021-09-06T16:55:09.000Z
2022-03-27T00:37:05.000Z
test/unit/builder_spec.lua
paniash/nvim-snippy
307d29140676b450c55c2f8eb4a2abfbc94c497b
[ "MIT" ]
12
2021-09-13T20:27:26.000Z
2022-03-22T22:46:33.000Z
local Builder = require('snippy.builder') describe('Builder', function() it('resolves comment vars', function() -- Reset commentstring to default value vim.cmd([[set commentstring&]]) local builder = Builder.new({ row = 0, col = 0, indent = '', word = '' }) builder:evaluate_variable({ name = 'BLOCK_COMMENT_START' }) assert.are.equal('/*', builder.result) builder:evaluate_variable({ name = 'BLOCK_COMMENT_END' }) assert.are.equal('/**/', builder.result) builder.result = '' builder:evaluate_variable({ name = 'LINE_COMMENT' }) assert.are.equal('//', builder.result) end) it('resolves comment vars from commentstring', function() vim.cmd([[set commentstring=--%s]]) local builder = Builder.new({ row = 0, col = 0, indent = '', word = '' }) builder:evaluate_variable({ name = 'LINE_COMMENT' }) assert.are.equal('--', builder.result) vim.cmd('set commentstring=--[[%s]]') builder.result = '' builder:evaluate_variable({ name = 'BLOCK_COMMENT_START' }) assert.are.equal('--[[', builder.result) builder:evaluate_variable({ name = 'BLOCK_COMMENT_END' }) assert.are.equal('--[[]]', builder.result) end) end)
42.7
81
0.601874
29d34150edfd4d39f63a7f34ed87fbede03e6f7f
1,530
sql
SQL
Commencement.SQL/Create Scripts/usp_DownloadMissingMajors.proc.sql
ucdavis/Commencement
7ecbc4927e4095b4684779679b9d59b1576ee440
[ "MIT" ]
null
null
null
Commencement.SQL/Create Scripts/usp_DownloadMissingMajors.proc.sql
ucdavis/Commencement
7ecbc4927e4095b4684779679b9d59b1576ee440
[ "MIT" ]
51
2015-05-06T16:44:15.000Z
2020-04-22T19:47:12.000Z
Commencement.SQL/Create Scripts/usp_DownloadMissingMajors.proc.sql
ucdavis/Commencement
7ecbc4927e4095b4684779679b9d59b1576ee440
[ "MIT" ]
null
null
null
CREATE PROCEDURE [dbo].[usp_DownloadMissingMajors] AS -- declare variables declare @term varchar(6), @id uniqueidentifier, @pidm varchar(7), @tsql varchar(max) -- create the temp table IF object_id('tempdb..#StudentMajors') IS NOT NULL BEGIN DROP TABLE #StudentMajors END CREATE TABLE #StudentMajors ( id uniqueidentifier, major varchar(4) ) -- get the current term set @term = (select MAX(id) from termcodes where isactive = 1) declare @students cursor set @students = cursor for select id, pidm from students where id not in (select student_id from studentmajors) and termcode = @term open @students fetch next from @students into @id, @pidm while(@@fetch_status = 0) begin delete from #StudentMajors set @tsql = ' insert into #StudentMajors (major) select zgvlcfs_majr_code from openquery (sis, '' select zgvlcfs_majr_code from zgvlcfs where zgvlcfs_pidm = ''''' + @pidm + ''''' and zgvlcfs_levl_code in (''''UG'''', ''''U2'''') and zgvlcfs_term_code_eff in ( select max(izgvlcfs.zgvlcfs_term_code_eff) from zgvlcfs izgvlcfs where zgvlcfs.zgvlcfs_pidm = izgvlcfs.zgvlcfs_pidm ) '') ' exec(@tsql) update #StudentMajors set id = @id merge studentmajors as t using #studentmajors as s on t.student_id = s.id and t.majorcode = s.major when not matched then insert (student_id, majorcode) values(s.id, s.major); fetch next from @students into @id, @pidm end close @students deallocate @students RETURN 0
24.285714
154
0.696078
a1b768e2794270607774dd7efbccdb58c63121ed
229
sql
SQL
migrations/V56__Update_Intake_For_Rejection.sql
alfred-brown/easi-app
cdb11c3565f07c14ab209e121830279e20ee143a
[ "Apache-2.0" ]
12
2019-12-17T22:37:25.000Z
2022-03-12T04:54:30.000Z
migrations/V56__Update_Intake_For_Rejection.sql
alfred-brown/easi-app
cdb11c3565f07c14ab209e121830279e20ee143a
[ "Apache-2.0" ]
523
2019-12-19T23:31:14.000Z
2022-03-31T00:44:26.000Z
migrations/V56__Update_Intake_For_Rejection.sql
alfred-brown/easi-app
cdb11c3565f07c14ab209e121830279e20ee143a
[ "Apache-2.0" ]
13
2020-07-16T16:42:35.000Z
2022-03-03T20:54:44.000Z
ALTER TABLE system_intake ADD COLUMN rejection_reason text; ALTER TABLE system_intake ADD COLUMN decision_next_steps text; UPDATE system_intake SET decision_next_steps = lcid_next_steps WHERE lcid_next_steps IS NOT NULL;
38.166667
62
0.838428
fc18adc514e33b676b511ccdf56a6abb37aa6834
227
sql
SQL
internal/pkg/db/migrations/mysql/000001_create_users_table.up.sql
usadamasa/hackernews
595a59532d9e5e9950897dd9e1ba5686f302b1c3
[ "MIT" ]
null
null
null
internal/pkg/db/migrations/mysql/000001_create_users_table.up.sql
usadamasa/hackernews
595a59532d9e5e9950897dd9e1ba5686f302b1c3
[ "MIT" ]
null
null
null
internal/pkg/db/migrations/mysql/000001_create_users_table.up.sql
usadamasa/hackernews
595a59532d9e5e9950897dd9e1ba5686f302b1c3
[ "MIT" ]
null
null
null
CREATE TABLE IF NOT EXISTS Users ( ID INT NOT NULL UNIQUE AUTO_INCREMENT, Username VARCHAR ( 127 ) NOT NULL UNIQUE, Password VARCHAR ( 127 ) NOT NULL, PRIMARY KEY ( ID ) )
10.318182
32
0.559471
46938136deaa265f664af18c1157c3af99988b3b
2,308
css
CSS
figuras.css
RocioSalgado/cursojs
03ca4813d1f2dd66a8a8c38f2251af8b38b1bb38
[ "MIT" ]
null
null
null
figuras.css
RocioSalgado/cursojs
03ca4813d1f2dd66a8a8c38f2251af8b38b1bb38
[ "MIT" ]
null
null
null
figuras.css
RocioSalgado/cursojs
03ca4813d1f2dd66a8a8c38f2251af8b38b1bb38
[ "MIT" ]
null
null
null
*{ box-sizing: border-box; padding: 0; margin: 0; } html{ font-size: 62.5%; } body{ background-color: #3d3d3d; font-family: Arial, Helvetica, sans-serif; } header{ width: 100%; height: 30vh; background-color: #3d3d3d; display: flex; align-items: center; justify-content: center; } #header{ width: 90%; height: 25vh; font-size: 2.5rem; background-color: #3d3d3d; border: 20px; box-shadow: 2px 5px 40px 10px rgba(0, 0, 0, 0.527); display: flex; flex-direction: column; justify-content: center; align-items: center; } #cajas{ width:100%; height: 70vh; display: flex ; justify-content: space-around; align-items: center; background-color: #3d3d3d; } section{ width: 30%; height: 400px; background-color:#3d3d3d ; border-radius: 20px; box-shadow: 2px 5px 40px 10px rgba(0, 0, 0, 0.527); display: flex; flex-direction: column; justify-content: center; align-items: center; } h2{ width: 80%; font-size: 2rem; text-align: center; margin-bottom: 4%; } form{ width: 80%; height: 60%; background-color: #3d3d3d ; display: flex; flex-direction: column; text-align: center; justify-content: center; } label{ width: 80%; font-size: 2rem; text-align: center; margin: 0 auto; } span{ font-size: 1.5rem; } input{ width: 90%; height: 40%; border-radius: 10px; margin-top: 8px; background-color: #3d3d3d; } button{ width:80%; height: 30%; background-color: #3d3d3d; border-radius: 10px; box-shadow: 2px 5px 40px 10px rgba(0, 0, 0, 0.527); } #container3{ width: 90%; height: 80%; background-color: #3d3d3d; display: flex; justify-content: center; align-items: center; } #container{ width: 50%; height: 150px; background-color: #3d3d3d; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 8px; } #container2{ width: 50%; height: 150px; background-color: #3d3d3d; display: flex; flex-direction: column; align-items: center; justify-content: center; justify-content: space-evenly; padding-bottom: 8px; }
18.31746
56
0.599653
f7f34833d3db1a85d7b0ac14cdb5e8b19c6e7a2c
8,444
swift
Swift
KnowYourAngles/QuizSetupViewController.swift
IolaniDev/KnowYourAngles
b51a475d956ad4d5a0a0e5dcf55409b4eae6cc8a
[ "Apache-2.0" ]
null
null
null
KnowYourAngles/QuizSetupViewController.swift
IolaniDev/KnowYourAngles
b51a475d956ad4d5a0a0e5dcf55409b4eae6cc8a
[ "Apache-2.0" ]
4
2017-03-17T03:35:33.000Z
2020-10-06T21:11:26.000Z
KnowYourAngles/QuizSetupViewController.swift
IolaniDev/KnowYourAngles
b51a475d956ad4d5a0a0e5dcf55409b4eae6cc8a
[ "Apache-2.0" ]
null
null
null
// // QuizSetupViewController.swift // KnowYourAngles // // Created by iPad App Dev on 7/7/18. // Copyright © 2018 Iolani School. All rights reserved. // import Foundation class QuizSetupViewController: UIViewController { //label for the problemSlider to display how many problems the user wants to complete @IBOutlet weak var totalNumOfProblems: UILabel! //reference to a slider used to choose the number of problems the user wants to complete @IBOutlet weak var problemSlider: UISlider! //timerSwitch controls whether a time limit is set on how long the user has to complete the desired number of problems @IBOutlet weak var timerSwitch: UISwitch! //timerLabel displays the time limit currently set (can be 30 seconds, 1 min, 1 min 30 sec, 2 min, 2 min 30 seconds, or 3 min) @IBOutlet weak var timerLabel: UILabel! //timerSlider lets the user change the time limit @IBOutlet weak var timerSlider: UISlider! //grab the previously saved settings (if any) let defaultSettings = UserDefaults.standard //when the view loads... override open func viewDidLoad() { //call on the super class viewDidLoad method super.viewDidLoad() /**********SETTINGS FOR MAX NUM OF PROBLEMS**********/ //if there are previously saved settings for the max number of problems, use them if (defaultSettings.object(forKey: "maxNumOfProblems") != nil) { problemSlider.maximumValue = defaultSettings.value(forKey: "maxNumOfProblems") as! Float; } // if there are no pre-existing settings, then use 48 else { problemSlider.maximumValue = 48.0; defaultSettings.setValue(problemSlider.maximumValue, forKey: "maxNumOfProblems"); } /**********SETTINGS FOR NUM OF PROBLEMS**********/ //if there are previously saved settings for the number of problems, use them if (defaultSettings.object(forKey: "numOfProblems") != nil) { if(defaultSettings.value(forKey: "numOfProblems") as! Float > defaultSettings.value(forKey: "maxNumOfProblems") as! Float) { defaultSettings.setValue(defaultSettings.value(forKey: "maxNumOfProblems"), forKey: "numOfProblems"); } problemSlider.value = defaultSettings.value(forKey: "numOfProblems") as! Float; } //if there are no pre-existing settings, then... else { //set the default number of problems to 10 or the max num of problems, whichever is smaller problemSlider.value = min(10, defaultSettings.value(forKey: "maxNumOfProblems") as! Float) defaultSettings.setValue(problemSlider.value, forKey: "numOfProblems"); } // set the text on the settings page totalNumOfProblems.text = "\(lroundf(problemSlider.value))"; /**********SETTINGS FOR TIMER**********/ // if there are previously saved settings for whether the timer is on or off, then use them if(defaultSettings.object(forKey: "isTimerOn") != nil) { timerSwitch.setOn(defaultSettings.object(forKey: "isTimerOn") as! Bool, animated: true); timerSlider.isHidden = !timerSwitch.isOn; timerLabel.isHidden = !timerSwitch.isOn; } // if there are no pre-existing settings, then set default value to off. else { timerSwitch.setOn(false, animated: true); timerSlider.isHidden = true; timerLabel.isHidden = true; defaultSettings.setValue(timerSwitch.isOn, forKey: "isTimerOn"); } // if there are already settings for the amount of time allowed, then use them if(defaultSettings.object(forKey: "amtTimeMin") != nil && defaultSettings.object(forKey: "amtTimeSec") != nil) { // get the minutes & seconds stored in settings and convert to a slider value let minutes = defaultSettings.object(forKey: "amtTimeMin") as! Float; let seconds = defaultSettings.object(forKey: "amtTimeSec") as! Float; timerSlider.value = (minutes) + (seconds/60); // change the timer label if(minutes == 0) { timerLabel.text = "\(Int(seconds)) seconds"; } else if(seconds == 0) { timerLabel.text = "\(Int(minutes)) minutes"; } else { timerLabel.text = "\(Int(minutes)) minutes \(Int(seconds)) seconds"; } } // if there are no pre-existing settings for amount of time allowed, then set default values else { // if the timer is on, set to 30 seconds if(defaultSettings.object(forKey: "isTimerOn") as! Bool) { timerLabel.text = "30 seconds"; timerSlider.value = 0.5; defaultSettings.setValue(0, forKey: "amtTimeMin"); defaultSettings.setValue(30, forKey: "amtTimeSec"); } // if the timer is off, set timer to 0 else{ defaultSettings.setValue(0, forKey: "amtTimeMin"); defaultSettings.setValue(0, forKey: "amtTimeSec"); } } } //sliderChanged is called when the slider is moved to change the number of problems @IBAction func sliderChanged(_ sender: UISlider) { totalNumOfProblems.text = "\(lroundf(sender.value))"; //save the number of problems in settings defaultSettings.setValue(lroundf(sender.value), forKey: "numOfProblems"); } //timerSwitchChanged is called when the user turns on or off the timer. @IBAction func timerSwitchChanged(_ sender: UISwitch) { //get the previously set minutes and seconds let minutes = defaultSettings.object(forKey: "amtTimeMin") as! Int; let seconds = defaultSettings.object(forKey: "amtTimeSec") as! Int; //if the timer gets turned on... if(sender.isOn) { //show the timer slider and timer label timerSlider.isHidden = false; timerLabel.isHidden = false; //if there was no previously saved time, change the time to 30 seconds if(minutes == 0 && seconds == 0) { timerLabel.text = "30 seconds"; defaultSettings.setValue(30, forKey: "amtTimeSec"); } else if(minutes == 0) { timerLabel.text = "\(seconds) seconds"; } else if(seconds == 0) { timerLabel.text = "\(minutes) minutes"; } else { timerLabel.text = "\(minutes) minutes \(seconds) seconds"; } } // if the timer gets turned off else { //hide the slider and label timerSlider.isHidden = true; timerLabel.isHidden = true; //change the text timerLabel.text = "Timer: Off"; } //save the state of the timer switch in settings defaultSettings.setValue(sender.isOn, forKey: "isTimerOn"); } //function is called when the timerSlider is changed @IBAction func timerSliderChanged(_ sender: UISlider) { //get the value from the slider and round it to the nearest half let newValue = Double(lroundf(((sender.value - 0.25)/0.5)))*0.5; //from the newValue, extract the number of minutes and number of seconds for the time limit. let minutes = newValue - (newValue.truncatingRemainder(dividingBy: 1)); let seconds = 60 * (newValue.truncatingRemainder(dividingBy: 1)); if(minutes == 0) { timerLabel.text = "\(Int(seconds)) seconds"; } else if(seconds == 0) { timerLabel.text = "\(Int(minutes)) minutes"; } else { timerLabel.text = "\(Int(minutes)) minutes \(Int(seconds)) seconds"; } //set new values for the time limit in the settings defaultSettings.setValue(minutes, forKey: "amtTimeMin"); defaultSettings.setValue(seconds, forKey: "amtTimeSec"); } }
41.80198
134
0.58882
b9216a94b9db63d2f5fecb10b94aa84e9aa863ec
1,209
h
C
chaps/pam_helper_mock.h
strassek/chromiumos-platform2
12c953f41f48b8a6b0bd1c181d09bdb1de38325c
[ "BSD-3-Clause" ]
4
2020-07-24T06:54:16.000Z
2021-06-16T17:13:53.000Z
chaps/pam_helper_mock.h
strassek/chromiumos-platform2
12c953f41f48b8a6b0bd1c181d09bdb1de38325c
[ "BSD-3-Clause" ]
1
2021-04-02T17:35:07.000Z
2021-04-02T17:35:07.000Z
chaps/pam_helper_mock.h
strassek/chromiumos-platform2
12c953f41f48b8a6b0bd1c181d09bdb1de38325c
[ "BSD-3-Clause" ]
1
2020-11-04T22:31:45.000Z
2020-11-04T22:31:45.000Z
// Copyright (c) 2013 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHAPS_PAM_HELPER_MOCK_H_ #define CHAPS_PAM_HELPER_MOCK_H_ #include "chaps/pam_helper.h" #include <security/pam_appl.h> #include <security/pam_modules.h> #include <string> #include <gmock/gmock.h> #include <gtest/gtest.h> namespace chaps { class PamHelperMock : public PamHelper { public: MOCK_METHOD2(GetPamUser, bool(pam_handle_t*, std::string*)); MOCK_METHOD3(GetPamPassword, bool(pam_handle_t*, bool old_password, brillo::SecureBlob*)); MOCK_METHOD3(SaveUserAndPassword, bool(pam_handle_t*, const std::string&, const brillo::SecureBlob&)); MOCK_METHOD3(RetrieveUserAndPassword, bool(pam_handle_t*, std::string*, brillo::SecureBlob*)); MOCK_METHOD3(PutEnvironmentVariable, bool(pam_handle_t*, const std::string&, const std::string&)); MOCK_METHOD3(GetEnvironmentVariable, bool(pam_handle_t*, const std::string&, std::string*)); }; } // namespace chaps #endif // CHAPS_PAM_HELPER_MOCK_H_
29.487805
76
0.692308
131c47d875f83694654f391ea0e690674e182805
8,994
kt
Kotlin
app/src/tesseract/java/org/totschnig/ocr/OcrViewModel.kt
mtotschnig/OCR
c41fd496ba032a9f4a2f7f31c29bf39dada8eef0
[ "Apache-2.0" ]
14
2020-12-25T19:50:02.000Z
2022-01-18T07:45:27.000Z
app/src/tesseract/java/org/totschnig/ocr/OcrViewModel.kt
mtotschnig/OCR
c41fd496ba032a9f4a2f7f31c29bf39dada8eef0
[ "Apache-2.0" ]
4
2020-11-09T00:11:12.000Z
2021-04-07T19:31:22.000Z
app/src/tesseract/java/org/totschnig/ocr/OcrViewModel.kt
mtotschnig/OCR
c41fd496ba032a9f4a2f7f31c29bf39dada8eef0
[ "Apache-2.0" ]
null
null
null
package org.totschnig.ocr import Catalano.Imaging.FastBitmap import Catalano.Imaging.Filters.BradleyLocalThreshold import Catalano.Imaging.IApplyInPlace import android.app.Application import android.app.DownloadManager import android.app.DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED import android.content.Context import android.content.SharedPreferences import android.graphics.Bitmap import android.graphics.BitmapFactory import android.graphics.Matrix import android.net.Uri import androidx.core.content.ContextCompat import androidx.lifecycle.viewModelScope import androidx.preference.PreferenceManager import com.googlecode.tesseract.android.TessBaseAPI import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import java.io.File import java.util.* const val TESSERACT_DOWNLOAD_FOLDER = "tesseract4/fast/" class OcrViewModel(application: Application) : BaseViewModel(application) { val prefKey = application.getString(R.string.pref_tesseract_language_key) val preferences: SharedPreferences get() = PreferenceManager.getDefaultSharedPreferences(getApplication()) private fun initialize() { System.loadLibrary("jpeg") System.loadLibrary("png") System.loadLibrary("leptonica") System.loadLibrary("tesseract") } fun runTextRecognition(uri: Uri) { viewModelScope.launch { withContext(Dispatchers.Default) { try { val application = getApplication<Application>() if (!tessDataExists(application)) { throw IllegalStateException(application.getString(R.string.configuration_pending)) } initialize() application.contentResolver.openInputStream(uri) ?.use { inputStream -> BitmapFactory.decodeStream( inputStream, null, BitmapFactory.Options().apply { inMutable = true inPreferredConfig = Bitmap.Config.ARGB_8888 }) }?.let { with(TessBaseAPI()) { if (!init( File( application.getExternalFilesDir(null), TESSERACT_DOWNLOAD_FOLDER ).path, language() ) ) { throw IllegalStateException("Could not init Tesseract") } setVariable("tessedit_do_invert", TessBaseAPI.VAR_FALSE) setVariable("load_system_dawg", TessBaseAPI.VAR_FALSE) setVariable("load_freq_dawg", TessBaseAPI.VAR_FALSE) setVariable("load_punc_dawg", TessBaseAPI.VAR_FALSE) setVariable("load_number_dawg", TessBaseAPI.VAR_FALSE) setVariable("load_unambig_dawg", TessBaseAPI.VAR_FALSE) setVariable("load_bigram_dawg", TessBaseAPI.VAR_FALSE) setVariable("load_fixed_length_dawgs", TessBaseAPI.VAR_FALSE) pageSegMode = TessBaseAPI.PageSegMode.PSM_AUTO_OSD setImage(with(FastBitmap(it.rotate(getOrientation(uri)))) { toGrayscale() val g: IApplyInPlace = BradleyLocalThreshold() g.applyInPlace(this) toBitmap() }) utF8Text val lines = mutableListOf<Line>() with(resultIterator) { begin() do { val lineText = getUTF8Text(TessBaseAPI.PageIteratorLevel.RIL_TEXTLINE) val lineBoundingRect = getBoundingRect(TessBaseAPI.PageIteratorLevel.RIL_TEXTLINE) val elements = mutableListOf<Element>() do { val wordText = getUTF8Text(TessBaseAPI.PageIteratorLevel.RIL_WORD) val wordBoundingRect = getBoundingRect(TessBaseAPI.PageIteratorLevel.RIL_WORD) elements.add(Element(wordText, wordBoundingRect)) } while (!isAtFinalElement( TessBaseAPI.PageIteratorLevel.RIL_TEXTLINE, TessBaseAPI.PageIteratorLevel.RIL_WORD ) && next(TessBaseAPI.PageIteratorLevel.RIL_WORD) ) lines.add(Line(lineText, lineBoundingRect, elements)) } while (next(TessBaseAPI.PageIteratorLevel.RIL_TEXTLINE)) delete() recycle() result.postValue(Result.success(Text(listOf(TextBlock(lines))))) } } } ?: run { result.postValue(Result.failure(Exception("Unable to open $uri"))) } } catch (e: Exception) { result.postValue(Result.failure(e)) } } } } fun Bitmap.rotate(degrees: Int): Bitmap = if (degrees == 0) this else Bitmap.createBitmap( this, 0, 0, width, height, Matrix().apply { postRotate(degrees.toFloat()) }, true ) private fun filePath(language: String) = "${TESSERACT_DOWNLOAD_FOLDER}tessdata/${language}.traineddata" private fun fileName(language: String) = "${language}.traineddata" fun tessDataExists(context: Context): Boolean = language()?.let { File(context.getExternalFilesDir(null), filePath(it)).exists() } ?: false private fun language(): String? { return preferences.getString(prefKey, null) } fun downloadTessData(context: Context) = language()?.let { val uri = Uri.parse("https://github.com/tesseract-ocr/tessdata_fast/raw/4.0.0/${fileName(it)}") ContextCompat.getSystemService(context, DownloadManager::class.java)?.enqueue( DownloadManager.Request(uri) .setTitle( context.getString(R.string.pref_tesseract_language_title) + " : " + getLanguages(context)[it] ) .setDescription(it) .setDestinationInExternalFilesDir(context, null, filePath(it)) .setNotificationVisibility(VISIBILITY_VISIBLE_NOTIFY_COMPLETED) ) getTesseractLanguageDisplayName(context, it) } fun getLanguages(context: Context): Map<String, String> = context.resources.getStringArray(R.array.pref_tesseract_language_values) .map { it to getTesseractLanguageDisplayName(context, it) } .sortedBy { it.second } .toMap() private fun getTesseractLanguageDisplayName(context: Context, localeString: String): String { val localeParts = localeString.split("_") val lang = when (localeParts[0]) { "kmr" -> "kur" "chi" -> "zho" else -> localeParts[0] } val localeFromContext = context.resources.configuration.locale return if (localeParts.size == 2) { val script = when (localeParts[1]) { "sim" -> "Hans" "tra" -> "Hant" else -> localeParts[1] } if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) { Locale.Builder().setLanguage(lang).setScript(script).build().getDisplayName( localeFromContext ) } else { "${Locale(lang).getDisplayName(localeFromContext)} ($script)" } } else Locale(lang).getDisplayName(localeFromContext) } }
46.84375
106
0.509895