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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
575dba07a9779b464e441d23c96da48c39a1db83 | 1,157 | c | C | Udemy_Course_1/lonie_count_solution.c | pteczar/c_learning_1 | b5f51307ecf7d4a476d216a87a593b2357d6850a | [
"MIT"
] | 1 | 2022-01-20T17:15:39.000Z | 2022-01-20T17:15:39.000Z | Udemy_Course_1/lonie_count_solution.c | pteczar/c_learning_1 | b5f51307ecf7d4a476d216a87a593b2357d6850a | [
"MIT"
] | null | null | null | Udemy_Course_1/lonie_count_solution.c | pteczar/c_learning_1 | b5f51307ecf7d4a476d216a87a593b2357d6850a | [
"MIT"
] | null | null | null | #include <stdio.h>
int main()
{
FILE *fp;
char filename[100];
char ch;
int linecount, wordcount, charcount;
// Initialize counter variables
linecount = 0;
wordcount = 0;
charcount = 0;
// Prompt user to enter filename
printf("Enter a filename :");
fgets(filename, 1000, stdin);
// Open file in read-only mode
fp = fopen(filename,"r");
// If file opened successfully, then write the string to file
if ( fp )
{
//Repeat until End Of File character is reached.
while ((ch=getc(fp)) != EOF) {
// Increment character count if NOT new line or space
if (ch != ' ' && ch != '\n') { ++charcount; }
// Increment word count if new line or space character
if (ch == ' ' || ch == '\n') { ++wordcount; }
// Increment line count if new line character
if (ch == '\n') { ++linecount; }
}
if (charcount > 0) {
++linecount;
++wordcount;
}
}
else
{
printf("Failed to open the file\n");
}
printf("Lines : %d \n", linecount);
printf("Words : %d \n", wordcount);
printf("Characters : %d \n", charcount);
getchar();
return(0);
} | 20.660714 | 64 | 0.566984 |
90085b3d90e34b325db804cfa02dee7e41b82fba | 5,147 | swift | Swift | FOSSAsia/EventsBaseListViewController.swift | GodsEye-07/open-event-ios-development | 3ad58d5a26988c5efbdc8e920b24099b3ba97db5 | [
"MIT"
] | null | null | null | FOSSAsia/EventsBaseListViewController.swift | GodsEye-07/open-event-ios-development | 3ad58d5a26988c5efbdc8e920b24099b3ba97db5 | [
"MIT"
] | null | null | null | FOSSAsia/EventsBaseListViewController.swift | GodsEye-07/open-event-ios-development | 3ad58d5a26988c5efbdc8e920b24099b3ba97db5 | [
"MIT"
] | null | null | null | //
// EventsBaseListViewController.swift
// FOSSAsia
//
// Created by Jurvis Tan on 12/2/16.
// Copyright © 2016 FossAsia. All rights reserved.
//
import UIKit
import Pages
class EventsBaseListViewController: UIViewController, EventListBrowsingByDate, UIViewControllerPreviewingDelegate {
fileprivate var collapseDetailViewController = true
weak var pagesVC: PagesController!
@IBOutlet weak var pagingView: SchedulePagingView!
var currentViewController: EventsBaseViewController! {
didSet {
self.registerForPreviewing(with: self, sourceView: currentViewController.tableView)
currentViewController.delegate = self
}
}
var viewModel: EventsListViewModel? {
didSet {
viewModel?.allSchedules.observe {
[unowned self] in
guard $0.count > 0 else {
return
}
self.onViewModelScheduleChange($0)
}
}
}
override func viewDidLoad() {
super.viewDidLoad()
viewModel = getEventsListViewModel()
pagingView.delegate = self
navigationController?.splitViewController?.delegate = self
splitViewController?.preferredDisplayMode = .allVisible
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if (segue.identifier == "EventsPageViewController") {
if let embeddedPageVC = segue.destination as? PagesController {
self.pagesVC = embeddedPageVC
let storyboard = UIStoryboard(name: LoadingViewController.StoryboardConstants.storyboardName, bundle: nil)
let loadingVC = storyboard.instantiateViewController(withIdentifier: LoadingViewController.StoryboardConstants.viewControllerId)
self.pagesVC.add([loadingVC])
self.pagesVC.enableSwipe = false
self.pagesVC.pagesDelegate = self
}
}
}
func onViewModelScheduleChange(_ newSchedule: [ScheduleViewModel]) {
let viewControllers = newSchedule.map { viewModel in
return ScheduleViewController.scheduleViewControllerFor(viewModel)
}
self.pagesVC.add(viewControllers)
self.pagesVC.startPage = 1
}
}
// MARK:- ScheduleViewControllerDelegate Conformance {
extension EventsBaseListViewController: ScheduleViewControllerDelegate {
func eventDidGetSelected(_ tableView: UITableView, atIndexPath: IndexPath) {
collapseDetailViewController = false
}
}
// MARK:- UISplitViewControllerDelegate Conformance
extension EventsBaseListViewController: UISplitViewControllerDelegate {
func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController: UIViewController, onto primaryViewController: UIViewController) -> Bool {
return collapseDetailViewController
}
}
// MARK:- UIViewControllerPreviewingDelegate Conformance
extension EventsBaseListViewController {
func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? {
guard let indexPath = self.currentViewController.tableView.indexPathForRow(at: location) else {
return nil
}
let eventVM = self.currentViewController.eventViewModelForIndexPath(indexPath)
if let eventCell = self.currentViewController.tableView.cellForRow(at: indexPath) {
previewingContext.sourceRect = eventCell.frame
}
let eventVC = EventViewController.eventViewControllerForEvent(eventVM)
return eventVC
}
@objc(previewingContext:commitViewController:) func previewingContext(_ previewingContext: UIViewControllerPreviewing, commit viewControllerToCommit: UIViewController) {
navigationController?.pushViewController(viewControllerToCommit, animated: true)
}
}
extension EventsBaseListViewController {
func nextButtonDidPress(_ sender: SchedulePagingView) {
self.pagesVC.next()
}
func prevButtonDidPress(_ sender: SchedulePagingView) {
self.pagesVC.previous()
}
func pageViewController(_ pageViewController: UIPageViewController, setViewController viewController: UIViewController, atPage page: Int) {
guard let currentVC = viewController as? EventsBaseViewController else {
return
}
pagingView.dateLabel.text = ((currentVC.viewModel?.date.value)! as NSDate).formattedDate(withFormat: "EEEE, MMM dd")
// Govern Previous Button
if page == 1 {
pagingView.prevButton.isEnabled = false
} else {
pagingView.prevButton.isEnabled = true
}
// Govern Next Button
if let scheduleViewModels = viewModel {
if page == scheduleViewModels.count.value {
pagingView.nextButton.isEnabled = false
} else {
pagingView.nextButton.isEnabled = true
}
}
self.currentViewController = currentVC
}
}
| 38.125926 | 191 | 0.684476 |
0b78677adaa1ddcbacf884f29508f3b4ea829e33 | 5,100 | py | Python | focus/receiver.py | frederikhermans/focus | 6228ba5fc8b41c74f2e22d5c2de20040b206d70a | [
"BSD-3-Clause"
] | 6 | 2016-04-18T09:40:16.000Z | 2021-01-05T22:03:54.000Z | focus/receiver.py | horizon00/focus | 6228ba5fc8b41c74f2e22d5c2de20040b206d70a | [
"BSD-3-Clause"
] | 1 | 2017-12-10T14:13:50.000Z | 2017-12-10T14:13:50.000Z | focus/receiver.py | horizon00/focus | 6228ba5fc8b41c74f2e22d5c2de20040b206d70a | [
"BSD-3-Clause"
] | 5 | 2018-01-04T14:59:50.000Z | 2018-10-20T14:40:21.000Z | # Copyright (c) 2016, Frederik Hermans, Liam McNamara
#
# This file is part of FOCUS and is licensed under the 3-clause BSD license.
# The full license can be found in the file COPYING.
import cPickle as pickle
import sys
import click
import imageframer
import numpy as np
import rscode
import focus
def _grayscale(frame):
if len(frame.shape) == 2:
return frame # Is already grayscale
elif len(frame.shape) == 3:
return frame[:, :, 1] # Return green channel
else:
raise ValueError('Unexpected data format {}.'.format(frame.shape))
class Receiver(object):
def __init__(self, nsubchannels, nelements_per_subchannel=(64+16)*4,
parity=16, shape=(512, 512), border=0.15, cyclic_prefix=8,
use_hints=True, calibration_profile=None):
self.rs = rscode.RSCode(parity)
self.qpsk = focus.modulation.QPSK()
self.idxs = focus.spectrum.subchannel_idxs(nsubchannels,
nelements_per_subchannel,
shape)
self.shape_with_cp = tuple(np.array(shape) + 2*cyclic_prefix)
self.framer = imageframer.Framer(self.shape_with_cp, border,
calibration_profile=calibration_profile)
self.cyclic_prefix = cyclic_prefix
# Crop indices
self.spectrum_bbox = focus.spectrum.get_bbox(self.idxs)
cropped_idxs = tuple(focus.spectrum.crop(i, *self.spectrum_bbox)
for i in self.idxs)
self.idxs = np.array(cropped_idxs)
if use_hints:
self.hints = list()
else:
self.hints = None
def decode(self, frame, debug=False, copy_frame=True):
# Locate
try:
corners = self.framer.locate(frame, hints=self.hints)
except ValueError as ve:
# sys.stderr.write('WARNING: {}\n'.format(ve))
result = {'fragments': []}
if debug:
result['status'] = 'notfound'
result['locator-message'] = str(ve)
return result
if copy_frame:
frame = frame.copy()
code = self.framer.extract(_grayscale(frame), self.shape_with_cp,
corners, hints=self.hints)
code = focus.phy.strip_cyclic_prefix(code, self.cyclic_prefix)
# Compute, crop and unload spectrum
spectrum = focus.phy.rx(code)
# -> complex64 makes angle() faster.
spectrum = spectrum.astype(np.complex64)
spectrum = focus.spectrum.crop(spectrum, *self.spectrum_bbox)
# Unload symbols from the spectrum
symbols = focus.spectrum.unload(spectrum, self.idxs)
# Modulate all symbols with one call to demodulate()
coded_fragments = self.qpsk.demodulate(np.array(symbols).T).T
# Make array contiguous, so we can pass it to rs.decode()
coded_fragments = np.ascontiguousarray(coded_fragments)
# Recover and unmask all fragments
fragments = list()
for channel_idx, coded_frag in enumerate(coded_fragments):
nerrors, fragment = self.rs.decode(coded_frag)
if nerrors < 0:
# Recovery failed
fragment = None
else:
focus.link.mask_fragments(fragment, channel_idx)
fragments.append(fragment)
result = {'fragments': fragments}
if debug:
result.update({'coded_fragments': coded_fragments,
'symbols': symbols,
'corners': corners,
'status': 'found'})
return result
def decode_many(self, frames, debug=False):
return tuple(self.decode(frame, debug=debug) for frame in frames)
def benchmark(frames='frames.pickle'):
import cProfile as profile
import pstats
if isinstance(frames, basestring):
frames = focus.util.load_frames(frames)
pr = profile.Profile()
recv = Receiver(16)
pr.enable()
recv.decode_many(frames)
pr.disable()
stats = pstats.Stats(pr).sort_stats(2)
stats.print_stats()
@click.command('receiver')
@click.option('--nsubchannels', type=int, default=16)
@click.option('--calibration-profile', type=str, default=None)
@click.option('--shape', type=str, default='512x512')
@click.option('--cyclic-prefix', type=int, default=8)
@click.option('--verbosity', type=int, default=0)
def main(nsubchannels, calibration_profile, shape, cyclic_prefix, verbosity):
shape = focus.util.parse_resolution(shape)
recv = Receiver(nsubchannels, calibration_profile=calibration_profile,
shape=shape, cyclic_prefix=cyclic_prefix)
while True:
try:
frames = pickle.load(sys.stdin)
except EOFError:
break
fragments = recv.decode_many(frames, debug=verbosity > 0)
pickle.dump(fragments, sys.stdout, protocol=pickle.HIGHEST_PROTOCOL)
sys.stdout.flush()
if __name__ == '__main__':
main()
| 36.428571 | 81 | 0.610196 |
8598b20ca4643aa03186fb2618959f04dd1ee588 | 625 | js | JavaScript | editor/icon-baseline-linear-scale-element/template.js | AgeOfLearning/material-design-icons | b1da14a0e8a7011358bf4453c127d9459420394f | [
"Apache-2.0"
] | null | null | null | editor/icon-baseline-linear-scale-element/template.js | AgeOfLearning/material-design-icons | b1da14a0e8a7011358bf4453c127d9459420394f | [
"Apache-2.0"
] | null | null | null | editor/icon-baseline-linear-scale-element/template.js | AgeOfLearning/material-design-icons | b1da14a0e8a7011358bf4453c127d9459420394f | [
"Apache-2.0"
] | null | null | null | export default (context, html) => html`
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24"><defs><path id="a" d="M0 0h24v24H0V0z"/></defs><clipPath id="b"><use xlink:href="#a" overflow="visible"/></clipPath><path clip-path="url(#b)" d="M19.5 9.5c-1.03 0-1.9.62-2.29 1.5h-2.92c-.39-.88-1.26-1.5-2.29-1.5s-1.9.62-2.29 1.5H6.79c-.39-.88-1.26-1.5-2.29-1.5C3.12 9.5 2 10.62 2 12s1.12 2.5 2.5 2.5c1.03 0 1.9-.62 2.29-1.5h2.92c.39.88 1.26 1.5 2.29 1.5s1.9-.62 2.29-1.5h2.92c.39.88 1.26 1.5 2.29 1.5 1.38 0 2.5-1.12 2.5-2.5s-1.12-2.5-2.5-2.5z"/></svg>
`; | 208.333333 | 582 | 0.6224 |
20238695db6c8ea6645548997ee3171353f09383 | 96 | css | CSS | gulp-rev/app/css/components/circle-box-list.css | jackkunfu/try | c028ecfdb5662f9c215761e4551561c162ac0f7f | [
"MIT"
] | null | null | null | gulp-rev/app/css/components/circle-box-list.css | jackkunfu/try | c028ecfdb5662f9c215761e4551561c162ac0f7f | [
"MIT"
] | 15 | 2021-03-08T19:51:18.000Z | 2022-02-26T15:35:59.000Z | gulp-rev/app/css/components/circle-box-list.css | jackkunfu/try | c028ecfdb5662f9c215761e4551561c162ac0f7f | [
"MIT"
] | null | null | null | body{
text-align: center;
}
.circle-box {
}
.circle-box ul{
}
.circle-box ul li {
} | 8.727273 | 21 | 0.541667 |
1b3fdfac1c3492d8dda5dcfb7371fea78593b0a1 | 7,279 | swift | Swift | SeekPreview/SeekPreview.swift | Enricoza/SeekPreview | 219e5068d67817a27a8f1f3de316e1b15e508fa5 | [
"MIT"
] | null | null | null | SeekPreview/SeekPreview.swift | Enricoza/SeekPreview | 219e5068d67817a27a8f1f3de316e1b15e508fa5 | [
"MIT"
] | 2 | 2021-03-17T21:04:34.000Z | 2021-03-20T16:10:22.000Z | SeekPreview/SeekPreview.swift | Enricoza/SeekPreview | 219e5068d67817a27a8f1f3de316e1b15e508fa5 | [
"MIT"
] | null | null | null | //
// PreviewSeekBar.swift
// PreviewSeekBar
//
// Created by Enrico Zannini on 14/03/2021.
//
import UIKit
/**
* A view that can be attached to a seekbar (UISlider) to act as a Seek Preview for a video player.
*
* The view needs to be as wide as we want to slide the preview, it will internally resize and follow the slider thumb up to the edges.
* The height of this view will always be taken as a limit for the preview itself, while the width of the preview will always be in 16:9 proportion.
*
* Position this view on top of a slider, with a little bit of vertical spacing, and take all the horizontal space you need.
*
* Set the delegate to handle the loading of preview images during the seek.
*
* N.B. This view doesn't handle the loading of preview images and doesn't suggest a method to do so.
* We only suggest to prefetch those images ahead because the delegate calls will be made synchronously on the main thread.
*/
@IBDesignable
open class SeekPreview: UIView {
private let preview = UIImageView()
private var centerAnchor: NSLayoutConstraint!
@IBOutlet var slider: UISlider? {
didSet {
oldValue?.removeTarget(self, action: nil, for: [.valueChanged, .touchUpInside, .touchUpOutside, .touchDown])
if let anchor = self.centerAnchor {
preview.removeConstraint(anchor)
}
if let slider = self.slider {
linkSlider(slider: slider)
}
}
}
/// A delegate that handles the loading of preview images
@IBOutlet public weak var delegate: SeekPreviewDelegate?
/// An animator that is used to show and hide the preview
public var animator: SeekPreviewAnimator = ScalePreviewAnimator(duration: 0.2)
/**
* Change this color to reflect the border color of the inner preview
*
* In order for this to have any effect, borderWidth needs to be passed as well and be greater than 0
*/
@IBInspectable
public var borderColor: UIColor? {
get {
guard let color = preview.layer.borderColor else {
return nil
}
return UIColor(cgColor: color)
}
set {
preview.layer.borderColor = newValue?.cgColor
}
}
/**
* Change this borderWidth to give the inner preview a border color needs to be passed as well and be different from clear color
*
* In order for this to have any effect, borderColor needs to be
*/
@IBInspectable
public var borderWidth: CGFloat {
get {
preview.layer.borderWidth
}
set {
preview.layer.borderWidth = newValue
}
}
/**
* Set this radius to give the inner preview round corners
*
* When you set this property the preview will automatically set its layer masksToBounds to true
*/
@IBInspectable
public var cornerRadius: CGFloat {
get {
preview.layer.cornerRadius
}
set {
preview.layer.cornerRadius = newValue
preview.layer.masksToBounds = newValue > CGFloat.zero
}
}
open override var backgroundColor: UIColor? {
get {
preview.backgroundColor
}
set {
preview.backgroundColor = newValue
}
}
open override var contentMode: UIView.ContentMode {
get {
preview.contentMode
}
set {
preview.contentMode = newValue
}
}
/**
* Creates and returns the view.
*
* - parameter animator: The animator that handles appearing and disappearing of the preview
*/
convenience public init(animator: SeekPreviewAnimator) {
self.init()
}
convenience public init() {
self.init(frame: CGRect.zero)
}
public override init(frame: CGRect) {
super.init(frame: frame)
initSubviews()
}
required public init?(coder: NSCoder) {
super.init(coder: coder)
initSubviews()
}
private func initSubviews() {
super.backgroundColor = .clear
self.addSubview(preview)
preview.translatesAutoresizingMaskIntoConstraints = false
preview.heightAnchor.constraint(equalTo: preview.widthAnchor, multiplier: 9/16).isActive = true
preview.leftAnchor.constraint(greaterThanOrEqualTo: self.leftAnchor).isActive = true
preview.rightAnchor.constraint(lessThanOrEqualTo: self.rightAnchor).isActive = true
preview.topAnchor.constraint(equalTo: self.topAnchor).isActive = true
preview.bottomAnchor.constraint(equalTo: self.bottomAnchor).isActive = true
animator.hidePreview(preview, animated: false)
}
/**
* Attaches this preview to a single slider.
*
* When the preview attaches to a slider, it automatically detaches from a previous slider.
* From the attach, going forward, the preview will follow the thumb of the slider and will request new preview images on value changes.
*
* - parameter slider: the slider to which this preview will attach
*
* WARNING: the slider needs to be in the same view hierarchy as this `SeekPreview` object.
*/
public func attachToSlider(slider: UISlider) {
self.slider = slider
}
private func linkSlider(slider: UISlider) {
slider.addTarget(self, action: #selector(onTouchDrag(sender:)), for: .valueChanged)
slider.addTarget(self, action: #selector(onTouchUp(sender:)), for: .touchUpInside)
slider.addTarget(self, action: #selector(onTouchUp(sender:)), for: .touchUpOutside)
slider.addTarget(self, action: #selector(onTouchDown(sender:)), for: .touchDown)
centerAnchor = preview.centerXAnchor.constraint(equalTo: self.leftAnchor, constant: previewCenterForSlider(slider: slider))
centerAnchor.priority = UILayoutPriority(900)
centerAnchor.isActive = true
}
@objc private func onTouchDown(sender: UISlider) {
animator.showPreview(self.preview, animated: true)
}
@objc private func onTouchUp(sender: UISlider) {
animator.hidePreview(self.preview, animated: true)
}
@objc private func onTouchDrag(sender: UISlider) {
centerAnchor.constant = previewCenterForSlider(slider: sender)
preview.image = delegate?.getSeekPreview(value: sender.value)
}
private func previewCenterForSlider(slider: UISlider) -> CGFloat {
let trackRect = slider.trackRect(forBounds: slider.bounds)
let thumbRect = slider.thumbRect(forBounds: slider.bounds, trackRect: trackRect, value: slider.value)
let sliderPercentage = (slider.value - slider.minimumValue)/(slider.maximumValue - slider.minimumValue)
return CGFloat(sliderPercentage) * (slider.frame.width - thumbRect.width) + thumbRect.width/2 + self.convert(slider.frame.origin, to: self).x - self.frame.origin.x
}
open override func prepareForInterfaceBuilder() {
super.prepareForInterfaceBuilder()
animator.showPreview(preview, animated: false)
self.centerXAnchor.constraint(equalTo: preview.centerXAnchor).isActive = true
}
}
| 35.857143 | 171 | 0.656684 |
6eb60cf7b7e164787ff684f5b56e999048dedc36 | 56 | sql | SQL | public_html/OrionBank/queries/UPDATE_USER_LASTNAME.sql | JMortonTan/IT202450 | 1a22a9f7815adc194a694d089da1b0e8b1ee115e | [
"MIT"
] | null | null | null | public_html/OrionBank/queries/UPDATE_USER_LASTNAME.sql | JMortonTan/IT202450 | 1a22a9f7815adc194a694d089da1b0e8b1ee115e | [
"MIT"
] | null | null | null | public_html/OrionBank/queries/UPDATE_USER_LASTNAME.sql | JMortonTan/IT202450 | 1a22a9f7815adc194a694d089da1b0e8b1ee115e | [
"MIT"
] | null | null | null | UPDATE Users SET last_name = :input WHERE id = :user_id; | 56 | 56 | 0.75 |
df6a7b8b9640a44671033e9c1f3c07ff07a8b57c | 322 | rb | Ruby | lib/graphql/internal_representation.rb | daemonsy/graphql-ruby | 7902732fe80f9d094a3b2d08d2ac8236f2e564f2 | [
"MIT"
] | 5,340 | 2015-02-10T00:43:13.000Z | 2022-03-31T17:35:25.000Z | lib/graphql/internal_representation.rb | daemonsy/graphql-ruby | 7902732fe80f9d094a3b2d08d2ac8236f2e564f2 | [
"MIT"
] | 3,327 | 2015-02-10T19:02:51.000Z | 2022-03-31T23:11:32.000Z | lib/graphql/internal_representation.rb | daemonsy/graphql-ruby | 7902732fe80f9d094a3b2d08d2ac8236f2e564f2 | [
"MIT"
] | 1,476 | 2015-02-26T22:50:27.000Z | 2022-03-29T21:38:43.000Z | # frozen_string_literal: true
require "graphql/internal_representation/document"
require "graphql/internal_representation/node"
require "graphql/internal_representation/print"
require "graphql/internal_representation/rewrite"
require "graphql/internal_representation/scope"
require "graphql/internal_representation/visit"
| 40.25 | 50 | 0.872671 |
7f79475e53d63fa7a7be09fab5984222e99e708e | 9,200 | rs | Rust | samplecode/localattestation/attestation/src/func.rs | lacabra/rust-sgx-sdk | af16efe23834010668ff210160868e963c389458 | [
"Apache-2.0"
] | 4 | 2019-02-09T04:20:39.000Z | 2021-04-22T21:37:29.000Z | samplecode/localattestation/attestation/src/func.rs | MiaZmy1221/rust_sgx_sdk | 8f37c76c0928cfc0c5e0379cfac59e7afc4b07a0 | [
"Apache-2.0"
] | null | null | null | samplecode/localattestation/attestation/src/func.rs | MiaZmy1221/rust_sgx_sdk | 8f37c76c0928cfc0c5e0379cfac59e7afc4b07a0 | [
"Apache-2.0"
] | 2 | 2019-02-09T04:20:39.000Z | 2020-02-06T02:02:56.000Z | // Copyright (C) 2017-2018 Baidu, Inc. All Rights Reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in
// the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Baidu, Inc., nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//use core::mem;
//use core::sync::atomic::{AtomicPtr, Ordering};
use sgx_types::*;
use sgx_trts::trts::{rsgx_raw_is_outside_enclave, rsgx_lfence};
use sgx_tdh::{SgxDhMsg1, SgxDhMsg2, SgxDhMsg3, SgxDhInitiator, SgxDhResponder};
use std::boxed::Box;
use std::sync::atomic::{AtomicPtr, Ordering};
use std::mem;
use types::*;
use err::*;
extern {
pub fn session_request_ocall(ret: *mut u32,
src_enclave_id: sgx_enclave_id_t,
dest_enclave_id: sgx_enclave_id_t,
dh_msg1: *mut sgx_dh_msg1_t) -> sgx_status_t;
pub fn exchange_report_ocall(ret: *mut u32,
src_enclave_id: sgx_enclave_id_t,
dest_enclave_id: sgx_enclave_id_t,
dh_msg2: *mut sgx_dh_msg2_t,
dh_msg3: *mut sgx_dh_msg3_t) -> sgx_status_t;
pub fn end_session_ocall(ret: *mut u32,
src_enclave_id:sgx_enclave_id_t,
dest_enclave_id:sgx_enclave_id_t) -> sgx_status_t;
}
static CALLBACK_FN: AtomicPtr<()> = AtomicPtr::new(0 as * mut ());
pub fn init(cb: Callback) {
let ptr = CALLBACK_FN.load(Ordering::SeqCst);
if ptr.is_null() {
let ptr: * mut Callback = Box::into_raw(Box::new(cb));
CALLBACK_FN.store(ptr as * mut (), Ordering::SeqCst);
}
}
fn get_callback() -> Option<&'static Callback>{
let ptr = CALLBACK_FN.load(Ordering::SeqCst) as *mut Callback;
if ptr.is_null() {
return None;
}
unsafe { Some( &* ptr ) }
}
pub fn create_session(src_enclave_id: sgx_enclave_id_t, dest_enclave_id: sgx_enclave_id_t) -> ATTESTATION_STATUS {
let mut dh_msg1: SgxDhMsg1 = SgxDhMsg1::default(); //Diffie-Hellman Message 1
let mut dh_msg2: SgxDhMsg2 = SgxDhMsg2::default(); //Diffie-Hellman Message 2
let mut dh_aek: sgx_key_128bit_t = sgx_key_128bit_t::default(); // Session Key
let mut responder_identity: sgx_dh_session_enclave_identity_t = sgx_dh_session_enclave_identity_t::default();
let mut ret = 0;
let mut initiator: SgxDhInitiator = SgxDhInitiator::init_session();
let status = unsafe { session_request_ocall(&mut ret, src_enclave_id, dest_enclave_id, &mut dh_msg1) };
if status != sgx_status_t::SGX_SUCCESS {
return ATTESTATION_STATUS::ATTESTATION_SE_ERROR;
}
let err = ATTESTATION_STATUS::from_repr(ret).unwrap();
if err != ATTESTATION_STATUS::SUCCESS{
return err;
}
let status = initiator.proc_msg1(&dh_msg1, &mut dh_msg2);
if status.is_err() {
return ATTESTATION_STATUS::ATTESTATION_ERROR;
}
let mut dh_msg3_raw = sgx_dh_msg3_t::default();
let status = unsafe { exchange_report_ocall(&mut ret, src_enclave_id, dest_enclave_id, &mut dh_msg2, &mut dh_msg3_raw as *mut sgx_dh_msg3_t) };
if status != sgx_status_t::SGX_SUCCESS {
return ATTESTATION_STATUS::ATTESTATION_SE_ERROR;
}
if ret != ATTESTATION_STATUS::SUCCESS as u32 {
return ATTESTATION_STATUS::from_repr(ret).unwrap();
}
let dh_msg3_raw_len = mem::size_of::<sgx_dh_msg3_t>() as u32 + dh_msg3_raw.msg3_body.additional_prop_length;
let dh_msg3 = unsafe{ SgxDhMsg3::from_raw_dh_msg3_t(&mut dh_msg3_raw, dh_msg3_raw_len ) };
if dh_msg3.is_none() {
return ATTESTATION_STATUS::ATTESTATION_SE_ERROR;
}
let dh_msg3 = dh_msg3.unwrap();
let status = initiator.proc_msg3(&dh_msg3, &mut dh_aek, &mut responder_identity);
if status.is_err() {
return ATTESTATION_STATUS::ATTESTATION_ERROR;
}
let cb = get_callback();
if cb.is_some() {
let ret = (cb.unwrap().verify)(&responder_identity);
if ret != ATTESTATION_STATUS::SUCCESS as u32{
return ATTESTATION_STATUS::INVALID_SESSION;
}
}
ATTESTATION_STATUS::SUCCESS
}
pub fn close_session(src_enclave_id: sgx_enclave_id_t, dest_enclave_id: sgx_enclave_id_t) -> ATTESTATION_STATUS {
let mut ret = 0;
let status = unsafe { end_session_ocall(&mut ret, src_enclave_id, dest_enclave_id) };
if status != sgx_status_t::SGX_SUCCESS {
return ATTESTATION_STATUS::ATTESTATION_SE_ERROR;
}
ATTESTATION_STATUS::from_repr(ret as u32).unwrap()
}
fn session_request_safe(src_enclave_id: sgx_enclave_id_t, dh_msg1: &mut sgx_dh_msg1_t, session_ptr: &mut usize) -> ATTESTATION_STATUS {
let mut responder = SgxDhResponder::init_session();
let status = responder.gen_msg1(dh_msg1);
if status.is_err() {
return ATTESTATION_STATUS::INVALID_SESSION;
}
let mut session_info = DhSessionInfo::default();
session_info.enclave_id = src_enclave_id;
session_info.session.session_status = DhSessionStatus::InProgress(responder);
let ptr = Box::into_raw(Box::new(session_info));
*session_ptr = ptr as * mut _ as usize;
ATTESTATION_STATUS::SUCCESS
}
//Handle the request from Source Enclave for a session
#[no_mangle]
pub extern "C" fn session_request(src_enclave_id: sgx_enclave_id_t, dh_msg1: *mut sgx_dh_msg1_t, session_ptr: *mut usize) -> ATTESTATION_STATUS {
unsafe {
session_request_safe(src_enclave_id, &mut *dh_msg1, &mut *session_ptr)
}
}
#[allow(unused_variables)]
fn exchange_report_safe(src_enclave_id: sgx_enclave_id_t, dh_msg2: &mut sgx_dh_msg2_t , dh_msg3: &mut sgx_dh_msg3_t, session_info: &mut DhSessionInfo) -> ATTESTATION_STATUS {
let mut dh_aek = sgx_key_128bit_t::default() ; // Session key
let mut initiator_identity = sgx_dh_session_enclave_identity_t::default();
let mut responder = match session_info.session.session_status {
DhSessionStatus::InProgress(res) => {res},
_ => {
return ATTESTATION_STATUS::INVALID_SESSION;
}
};
let mut dh_msg3_r = SgxDhMsg3::default();
let status = responder.proc_msg2(dh_msg2, &mut dh_msg3_r, &mut dh_aek, &mut initiator_identity);
if status.is_err() {
return ATTESTATION_STATUS::ATTESTATION_ERROR;
}
unsafe{ dh_msg3_r.to_raw_dh_msg3_t(dh_msg3, (dh_msg3.msg3_body.additional_prop_length as usize + mem::size_of::<sgx_dh_msg3_t>() ) as u32); };
let cb = get_callback();
if cb.is_some() {
let ret = (cb.unwrap().verify)(&initiator_identity);
if ret != ATTESTATION_STATUS::SUCCESS as u32 {
return ATTESTATION_STATUS::INVALID_SESSION;
}
}
session_info.session.session_status = DhSessionStatus::Active(dh_aek);
ATTESTATION_STATUS::SUCCESS
}
//Verify Message 2, generate Message3 and exchange Message 3 with Source Enclave
#[no_mangle]
pub extern "C" fn exchange_report(src_enclave_id: sgx_enclave_id_t, dh_msg2: *mut sgx_dh_msg2_t , dh_msg3: *mut sgx_dh_msg3_t, session_ptr: *mut usize) -> ATTESTATION_STATUS {
if rsgx_raw_is_outside_enclave(session_ptr as * const u8, mem::size_of::<DhSessionInfo>()) {
return ATTESTATION_STATUS::INVALID_PARAMETER;
}
rsgx_lfence();
unsafe {
exchange_report_safe(src_enclave_id, &mut *dh_msg2, &mut *dh_msg3, &mut *(session_ptr as *mut DhSessionInfo))
}
}
//Respond to the request from the Source Enclave to close the session
#[no_mangle]
#[allow(unused_variables)]
pub extern "C" fn end_session(src_enclave_id: sgx_enclave_id_t, session_ptr: *mut usize) -> ATTESTATION_STATUS {
if rsgx_raw_is_outside_enclave(session_ptr as * const u8, mem::size_of::<DhSessionInfo>()) {
return ATTESTATION_STATUS::INVALID_PARAMETER;
}
rsgx_lfence();
let _ = unsafe { Box::from_raw(session_ptr as *mut DhSessionInfo) };
ATTESTATION_STATUS::SUCCESS
} | 40.350877 | 175 | 0.699565 |
d5b952fbc8c75876cc915046c4ad4e96c8ea9e3c | 1,336 | h | C | src/http/interfaces/server_interface.h | edenreich/http-component | d1de28b7f29d0fc56adac991786d06952d236287 | [
"MIT"
] | null | null | null | src/http/interfaces/server_interface.h | edenreich/http-component | d1de28b7f29d0fc56adac991786d06952d236287 | [
"MIT"
] | null | null | null | src/http/interfaces/server_interface.h | edenreich/http-component | d1de28b7f29d0fc56adac991786d06952d236287 | [
"MIT"
] | null | null | null | #ifndef SERVER_INTERFACE_H
#define SERVER_INTERFACE_H
#include "../events/common_events.h"
#include <string>
namespace Http {
namespace Interfaces {
/**
* The Server Interface
*/
class ServerInterface {
public:
/**
* Virtual destructor.
*/
virtual ~ServerInterface() {}
/**
* Bind the server to specific address.
*
* @param const std::string & address
* @return void
*/
virtual void bind(const std::string & address) = 0;
/**
* Start an http server on given port.
*
* @param const unsigned int port
* @return void
*/
virtual void listen(const unsigned int port) = 0;
/**
* On data recieved event.
*
* @param Http::Events::MessageRecievedHandler handler
* @return void
*/
virtual void onConnection(::Http::Events::MessageRecievedHandler handler) = 0;
/**
* Shutdown the http server.
*
* @return void
*/
virtual void shutdown() = 0;
};
}
}
#endif // SERVER_INTERFACE_H
| 21.901639 | 90 | 0.461826 |
0936ee7082fd0510c516fd65bcbcfd0072215553 | 31 | sql | SQL | source/packr/testdata/7_test.up.sql | nkonev/migrate | 719f17f88e714128b95a145a2ec69807e9722939 | [
"MIT"
] | null | null | null | source/packr/testdata/7_test.up.sql | nkonev/migrate | 719f17f88e714128b95a145a2ec69807e9722939 | [
"MIT"
] | null | null | null | source/packr/testdata/7_test.up.sql | nkonev/migrate | 719f17f88e714128b95a145a2ec69807e9722939 | [
"MIT"
] | null | null | null | INSERT INTO test(i) VALUES (7); | 31 | 31 | 0.709677 |
1fddb48d2bb2e4de99d5dafb913e421872d7623b | 172 | css | CSS | src/css/index.css | fperich/saltala-react-node-mysql | 7a405a664179ee5f85c7a5e5916f0e14693d2319 | [
"MIT"
] | null | null | null | src/css/index.css | fperich/saltala-react-node-mysql | 7a405a664179ee5f85c7a5e5916f0e14693d2319 | [
"MIT"
] | null | null | null | src/css/index.css | fperich/saltala-react-node-mysql | 7a405a664179ee5f85c7a5e5916f0e14693d2319 | [
"MIT"
] | null | null | null | body {
font-size: 26px;
margin-top: 60px;
}
.name {
color: white;
margin-right: 20px;
}
input, select {
margin-bottom: 10px;
margin-right: 10px;
} | 12.285714 | 24 | 0.581395 |
d5f6b851407ab580441961fcba5e8a9b724ae52c | 1,125 | h | C | libutils/utils/file_utils.h | Mu-L/confluo | e9b8621e99f56b1adf5675c4296c006d89e6e582 | [
"Apache-2.0"
] | 1,398 | 2018-12-05T19:13:15.000Z | 2022-03-29T08:26:03.000Z | libutils/utils/file_utils.h | Mu-L/confluo | e9b8621e99f56b1adf5675c4296c006d89e6e582 | [
"Apache-2.0"
] | 53 | 2018-10-21T03:28:25.000Z | 2021-03-16T03:50:54.000Z | libutils/utils/file_utils.h | Mu-L/confluo | e9b8621e99f56b1adf5675c4296c006d89e6e582 | [
"Apache-2.0"
] | 208 | 2018-10-28T03:05:46.000Z | 2022-02-06T06:16:37.000Z | #ifndef UTILS_FILE_UTILS_H_
#define UTILS_FILE_UTILS_H_
#include <stdio.h>
#include <dirent.h>
#include <unistd.h>
#include <cstdlib>
#include <string>
#include <errno.h>
#include <ftw.h>
#include <climits>
#include <fcntl.h>
#include <sys/stat.h>
#include "assertions.h"
namespace utils {
class file_utils {
public:
static const int PERMISSIONS = (S_IRWXU | S_IRWXG | S_IRWXO);
static size_t file_size(const std::string &path);
static void create_dir(const std::string &path);
static void clear_dir(const std::string &path);
static void delete_dir(const std::string &path);
static bool exists_file(const std::string &path);
static int delete_file(const std::string &path);
static int open_file(const std::string &path, int flags);
static void truncate_file(const std::string &path, size_t size);
static void truncate_file(int fd, size_t size);
static void close_file(int fd);
static std::string full_path(const std::string &path);
private:
static int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf);
};
}
#endif /* UTILS_FILE_UTILS_H_ */
| 20.833333 | 99 | 0.727111 |
ef8924b3313df18d7e2c383c1af3465b704bc4d4 | 9,310 | sql | SQL | Initial/src/DBScript.sql | vkhorikov/LegacyProjects | c423e69c7a126472867c9cfbb3f7b72e37f45ed9 | [
"MIT"
] | 36 | 2018-03-29T02:24:20.000Z | 2022-01-07T14:39:30.000Z | Initial/src/DBScript.sql | vkhorikov/LegacyProjects | c423e69c7a126472867c9cfbb3f7b72e37f45ed9 | [
"MIT"
] | null | null | null | Initial/src/DBScript.sql | vkhorikov/LegacyProjects | c423e69c7a126472867c9cfbb3f7b72e37f45ed9 | [
"MIT"
] | 20 | 2019-02-11T12:23:18.000Z | 2021-11-27T03:45:14.000Z | create database PackageDelivery
go
USE PackageDelivery
GO
/****** Object: Table [dbo].[ADDR_TBL] Script Date: 1/16/2018 11:34:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ADDR_TBL](
[ID_CLM] [int] IDENTITY(1,1) NOT NULL,
[STR] [char](300) NULL,
[CT_ST] [char](200) NULL,
[ZP] [char](5) NULL,
[DLVR] [int] NULL,
CONSTRAINT [PK_ADDR_TBL] PRIMARY KEY CLUSTERED
(
[ID_CLM] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[DLVR_TBL] Script Date: 1/16/2018 11:34:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[DLVR_TBL](
[NMB_CLM] [int] IDENTITY(1,1) NOT NULL,
[CSTM] [int] NULL,
[STS] [char](1) NULL,
[ESTM_CLM] [float] NULL,
[PRD_LN_1] [int] NULL,
[PRD_LN_1_AMN] [char](2) NULL,
[PRD_LN_2] [int] NULL,
[PRD_LN_2_AMN] [char](2) NULL,
CONSTRAINT [PK_DLVR_TBL] PRIMARY KEY CLUSTERED
(
[NMB_CLM] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[DLVR_TBL2] Script Date: 1/16/2018 11:34:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[DLVR_TBL2](
[NMB_CLM] [int] NOT NULL,
[PRD_LN_3] [int] NULL,
[PRD_LN_3_AMN] [char](2) NULL,
[PRD_LN_4] [int] NULL,
[PRD_LN_4_AMN] [char](2) NULL,
CONSTRAINT [PK_DLVR_TBL2] PRIMARY KEY CLUSTERED
(
[NMB_CLM] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[P_TBL] Script Date: 1/16/2018 11:34:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[P_TBL](
[NMB_CLM] [int] IDENTITY(1,1) NOT NULL,
[NM_CLM] [char](100) NULL,
[ADDR1] [int] NULL,
[ADDR2] [int] NULL,
CONSTRAINT [PK_P_TBL] PRIMARY KEY CLUSTERED
(
[NMB_CLM] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[PRD_TBL] Script Date: 1/16/2018 11:34:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[PRD_TBL](
[NMB_CM] [int] IDENTITY(1,1) NOT NULL,
[NM_CLM] [char](100) NULL,
[DSC_CLM] [char](500) NULL,
[WT] [float] NULL,
[WT_KG] [float] NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[ADDR_TBL] ON
GO
INSERT [dbo].[ADDR_TBL] ([ID_CLM], [STR], [CT_ST], [ZP], [DLVR]) VALUES (1, N'1234 Main St ', N'Washington DC ', N'22200', NULL)
GO
INSERT [dbo].[ADDR_TBL] ([ID_CLM], [STR], [CT_ST], [ZP], [DLVR]) VALUES (2, N'2345 2nd St ', N'Washington DC ', N'22201', NULL)
GO
INSERT [dbo].[ADDR_TBL] ([ID_CLM], [STR], [CT_ST], [ZP], [DLVR]) VALUES (3, N'8338 3rd St ', N'Arlington VA ', N'22202', NULL)
GO
INSERT [dbo].[ADDR_TBL] ([ID_CLM], [STR], [CT_ST], [ZP], [DLVR]) VALUES (11, N'1234 Main St ', N'Washington DC ', N'22200', 8)
GO
INSERT [dbo].[ADDR_TBL] ([ID_CLM], [STR], [CT_ST], [ZP], [DLVR]) VALUES (12, N'1321 S Eads St ', N'Arlingron VA ', N'22202', 9)
GO
SET IDENTITY_INSERT [dbo].[ADDR_TBL] OFF
GO
SET IDENTITY_INSERT [dbo].[DLVR_TBL] ON
GO
INSERT [dbo].[DLVR_TBL] ([NMB_CLM], [CSTM], [STS], [ESTM_CLM], [PRD_LN_1], [PRD_LN_1_AMN], [PRD_LN_2], [PRD_LN_2_AMN]) VALUES (8, 2, N'R', 320, 1, N'2 ', 2, N'1 ')
GO
INSERT [dbo].[DLVR_TBL] ([NMB_CLM], [CSTM], [STS], [ESTM_CLM], [PRD_LN_1], [PRD_LN_1_AMN], [PRD_LN_2], [PRD_LN_2_AMN]) VALUES (9, 1, N'R', 40, 1, N'1 ', NULL, N'0 ')
GO
SET IDENTITY_INSERT [dbo].[DLVR_TBL] OFF
GO
INSERT [dbo].[DLVR_TBL2] ([NMB_CLM], [PRD_LN_3], [PRD_LN_3_AMN], [PRD_LN_4], [PRD_LN_4_AMN]) VALUES (8, 3, N'1 ', 5, N'4 ')
GO
INSERT [dbo].[DLVR_TBL2] ([NMB_CLM], [PRD_LN_3], [PRD_LN_3_AMN], [PRD_LN_4], [PRD_LN_4_AMN]) VALUES (9, NULL, N'0 ', NULL, N'0 ')
GO
SET IDENTITY_INSERT [dbo].[P_TBL] ON
GO
INSERT [dbo].[P_TBL] ([NMB_CLM], [NM_CLM], [ADDR1], [ADDR2]) VALUES (1, N'Macro Soft ', 1, NULL)
GO
INSERT [dbo].[P_TBL] ([NMB_CLM], [NM_CLM], [ADDR1], [ADDR2]) VALUES (2, N'Devices for Everyone ', 2, NULL)
GO
INSERT [dbo].[P_TBL] ([NMB_CLM], [NM_CLM], [ADDR1], [ADDR2]) VALUES (3, N'Kwik-E-Mart ', 3, NULL)
GO
SET IDENTITY_INSERT [dbo].[P_TBL] OFF
GO
SET IDENTITY_INSERT [dbo].[PRD_TBL] ON
GO
INSERT [dbo].[PRD_TBL] ([NMB_CM], [NM_CLM], [DSC_CLM], [WT], [WT_KG]) VALUES (1, N'Best Pizza Ever ', N'Your favorite cheese pizza made with classic marinara sauce topped with mozzarella cheese. ', 2, NULL)
GO
INSERT [dbo].[PRD_TBL] ([NMB_CM], [NM_CLM], [DSC_CLM], [WT], [WT_KG]) VALUES (2, N'myPhone ', NULL, NULL, 0.5)
GO
INSERT [dbo].[PRD_TBL] ([NMB_CM], [NM_CLM], [DSC_CLM], [WT], [WT_KG]) VALUES (3, N'Couch ', N'Made with a sturdy wood frame and upholstered in touchable and classic linen, this fold-down futon provides a stylish seating solution along with an extra space for overnight guests. ', 83.5, NULL)
GO
INSERT [dbo].[PRD_TBL] ([NMB_CM], [NM_CLM], [DSC_CLM], [WT], [WT_KG]) VALUES (4, N'TV Set ', NULL, NULL, 7)
GO
INSERT [dbo].[PRD_TBL] ([NMB_CM], [NM_CLM], [DSC_CLM], [WT], [WT_KG]) VALUES (5, N'Fridge ', NULL, NULL, 34)
GO
SET IDENTITY_INSERT [dbo].[PRD_TBL] OFF
GO
| 55.748503 | 702 | 0.396348 |
2b5eb30dcb76aa16197956275cf92ab04f81abcb | 27,328 | sql | SQL | dbscripts/insert.sql | openMF/egalite-web-service | ac4904b323c7440a4e651e73817abf4c9e80d8a1 | [
"Apache-2.0"
] | 1 | 2016-05-13T03:09:20.000Z | 2016-05-13T03:09:20.000Z | dbscripts/insert.sql | openMF/egalite-web-service | ac4904b323c7440a4e651e73817abf4c9e80d8a1 | [
"Apache-2.0"
] | null | null | null | dbscripts/insert.sql | openMF/egalite-web-service | ac4904b323c7440a4e651e73817abf4c9e80d8a1 | [
"Apache-2.0"
] | 9 | 2016-05-13T03:09:33.000Z | 2019-02-02T21:16:18.000Z | INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00001','UserManagement','List','listUsers');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00002','UserManagement','Add','addUser');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00003','UserManagement','Modify','modifyUser');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00004','UserManagement','Delete','deleteUser');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00005','UserManagement','Authorize','authUser');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00006','RoleManagement','List','listRoles');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00007','RoleManagement','Add','addRole');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00008','RoleManagement','Modify','modifyRole');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00053','RoleManagement','Delete','deleteRole');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00010','RoleManagement','Authorize','authRole');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00011','AgentManagement','List','listAgents');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00012','AgentManagement','Add','addAgent');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00013','AgentManagement','Modify','modifyAgent');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00014','AgentManagement','Delete','deleteAgent');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00015','AgentManagement','Authorize','authAgent');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00016','DeviceManagement','List','listDevices');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00017','DeviceManagement','Add','addDevice');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00018','DeviceManagement','Modify','modifyDevice');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00019','DeviceManagement','Delete','deleteDevice');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00020','DeviceManagement','Authorize','authDevice');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00021','CashSettlement','List','listCashSettlements');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00022','CashSettlement','Add','addCashSettlement');
//INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00023','CashSettlement','Delete','deleteCashSettlement');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00024','CashSettlement','Authorize','authCashSettlement');
//INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00030','AgentAllocations','List','listAgentAllocations');
//INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00031','AgentAllocations','Assign','addAgentAllocations');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00032','AgentManagement','Key','generateKeyAgent');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00033','SystemParameter','List','listSystemParameters');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00034','SystemParameter','Modify','modifySystemParameter');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00035','Customers','List','listCustomers');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00036','Loan Detail','List','listLoanAccounts');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00037','Transaction Tracker','List','listAgentTxn');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00038','CBS JobHistory','List','listCbsJobHistory');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00039', 'UserManagement', 'Reset', 'resetUser');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID, BASE_FUNC, FUNC_DESC, FUNC_COMMAND) VALUES ('FUN00040', 'UserManagement','UnLock User','unLockUser');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID, BASE_FUNC, FUNC_DESC, FUNC_COMMAND) VALUES ('FUN00041', 'EnrollCustomerManagement','List','listEnrollmentCustomer');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID, BASE_FUNC, FUNC_DESC, FUNC_COMMAND) VALUES ('FUN00042', 'EnrollCustomerManagement','Enrich','enrichEnrollCustomerDetail');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00043','DisburseScheduleManagement','List','listManualDisbrSchedule');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00044','DisburseScheduleManagement','Add','addManualDisburseSchedule');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00045','DisburseScheduleManagement','Modify','modifyManualDisburseSchedule');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00046','DisburseScheduleManagement','Delete','deleteManualDisburseSchedule');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00047','DisburseScheduleManagement','Authorize','authManualDisburseSchedule');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00048','Loan Detail','Allocate Agent','addAgentAllocations');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00049','Loan Detail','Add','addManualDisburseSchedule');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00050','ListPigmyDesposit','List','listPigmyDesposit');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00052','ReferenceManagement','List','addRefCode');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00054','Micro Deposit Request','List','DepositeReqList');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00056', 'ReferenceManagement','Modify','modifyRefCode');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00057', 'ReferenceManagement','Authorize','authRefCode');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00059', 'CashSettlement','Delete','deleteCashSettlement');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00055','ListPigmyDesposit','AgentAllocation','allocateAgentForDeposit');
------------------------------------
//insert into IBSMFITEST.AMTB_USERS (USER_ID, BRANCH_CODE, FIRST_NAME, LAST_NAME, DATE_OF_BIRTH, GENDER, COMMUNICATION_ADDRESS1, COMMUNICATION_ADDRESS2, COMMUNICATION_ADDRESS3, COMMUNICATION_POSTAL_CODE, PERMANENT_ADDRESS1, PERMANENT_ADDRESS2, PERMANENT_ADDRESS3, PERMANENT_POSTAL_CODE, MOBILE_NUMBER, EMAIL_ID, PASSWORD, USER_TYPE, USER_STATUS, START_DATE, END_DATE, NO_OF_FAILED_LOGINS, LAST_LOGIN_DATE, USER_PREV_PASSWORD1, USER_PREV_PASSWORD2, AUTH_STATUS)
values ('admin', null, null, 'Administrator', null, '1', null, null, null, null, null, null, null, null, null, null, '240be518fabd2724ddb6f04eeb1da5967448d7e831c08c8fa822809f74c720a9', '2', 'A', null, null, null, null, null, null, 'A');
--------------------------------------------------
INSERT INTO "IBSMFITEST"."AMTB_ROLES" (ROLE_ID,ROLE_NAME,ROLE_DESC,AUTH_STATUS) VALUES ('ROL00000','ADMINISTRATOR','Administrator of the system','A');
INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00001');
INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00002');
INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00003');
INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00004');
INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00005');
INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00006');
INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00007');
INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00008');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00009');
INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00010');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00011');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00012');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00013');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00014');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00015');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00016');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00017');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00018');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00019');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00020');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00021');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00022');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00023');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00024');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00025');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00026');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00027');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00028');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00029');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00030');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00031');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00032');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00033');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00034');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00035');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00036');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00037');
//INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00038');
INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00039');
//INSERT INTO "IBSMFITEST"."AMTB_USER_ROLES" (USER_ID,ROLE_ID) VALUES ('admin','ROL00000');
INSERT INTO "IBSMFITEST"."IFTB_BRANCH_DETAILS" (BRANCH_CODE,BRANCH_NAME,BRN_ADD1,BRN_ADD2,BRN_ADD3,BRN_DATE,BRN_EOD_STAT,BRN_LCY,SYNC_TIME,SYNC_STAT) VALUES ('PPP','Phnom Penh Sub Branch','Building71, St. 163, Toul Svay Prey I, Chamkamorn',null,null,to_timestamp('2013-DEC-20 00:00:00', 'RRRR-MON-DD HH24:MI:SS'),'N','KHR',to_timestamp('2014-FEB-17 17:22:27', 'RRRR-MON-DD HH24:MI:SS'),'Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('agentStatus','I','Inactive','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('agentStatus','A','Active','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('agentType','1','Credit Officer','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('agentType','2','Field Officer','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('authorize','A','Authorized','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('authorize','U','Unauthorized','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('cashInOut','1','CashIn','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('cashInOut','2','CashOut','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('deviceStatus','I','Inactive','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('deviceStatus','A','Active','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('deviceType','1','Mobile','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('deviceType','2','Tablet','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('gender','1','Male','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('gender','2','Female','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('language','1','English','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('language','2','khmer','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('paramValue','Y','Editable','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('paramValue','N','NonEditable','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('txnType','2','Sink','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('txnType','3','Adjustment','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME,LIST_VALUE,DESN,STATUS) VALUES ('txnType','1','Cash','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME, LIST_VALUE, DESN, STATUS) values ('userType','1','Credit Officer','Y');
INSERT INTO "IBSMFITEST"."AMTB_LIST_VALUE" (LIST_NAME, LIST_VALUE, DESN, STATUS) values ('userType','2','Others','Y');
insert into "IBSMFITEST"."AMTB_AUDIT_DETAIL" (table_name, key_id, version_no, maker_id, maker_dt, checker_id, checker_dt)
values ('AMTB_USERS', 'admin', 1, 'admin', SYSDATE, 'admin', SYSDATE);
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('MINIMUM PASSWORD LENGTH', 'PASSWORD', 'INTEGER', '28', 'Y', 'Mobile');
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('NUMBERS OF INVALID LOGINS', 'INVALID LOGINS', 'INTEGER', '45', 'N', 'All');
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('DEFAULT AGENT LOGIN EXPIRY DAYS', 'EXPIRY DAYS', 'INTEGER', '3', 'y', 'All');
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('MOBILE REGISTRATION KEY LENGTH', 'REGISTRATION KEY', 'INTEGER', '1', 'y', 'Mobile');
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('MOBILE REGISTRATION KEY EXPIRATION TIME(IN MINUTES)', 'KEY EXPIRATION', 'INTEGER', '423', 'y', 'Mobile');
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('MINIMUM MOBILE LOGIN PASSWORD LENGTH', 'MOBILE PASSWORD', 'INTEGER', '15', 'y', 'Mobile');
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('MINIMUM MOBILE FAILED LOGINS', 'MOBILE FAILED LOGINS', 'INTEGER', '25', 'y', 'Mobile');
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('CBS INTERFACE POLLING ENABLED', 'POLLING ENABLED', 'BOOLEAN', 'True', 'Y', 'All');
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('CBS INTERFACE POLLING INTERVAL IN SECONDS', 'POLLING INTERVAL', 'INTEGER', '66', 'y', 'All');
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('DEFAULT DEVICE SYNCH BATCH SIZE', 'SYNCH BATCH SIZE', 'INTEGER', '5', 'y', 'All');
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('DAYS_FWD_DISB_AGENDA', 'DISBURSEMENT AGENDA', 'INTEGER', '7', 'Y', 'Mobile');
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('DAYS_FWD_REPAY_AGENDA', 'REPAYMENT AGENDA', 'INTEGER', '23', 'Y', 'Mobile');
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('HOST NAME', 'HOST', 'VARCHAR', '192.168.1.112', 'Y', 'Mobile');
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('NUMBERS OF RETRY', 'RETRY', 'VARCHAR', '3', 'Y', 'ALL');
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('DAYS SYNC', 'HOST', 'INTEGER', '3', 'Y', 'Mobile');
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('DEBUG', 'DEBUG', 'STRING', 'sadf', 'Y', 'All');
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('DEBUG_AREA', 'DEBUG_AREA', 'STRING', 'E:\MFI_APP_IBS\DB_Debug', 'Y', 'All');
insert into AMTB_PARAMETERS (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('INSUFFICIENT BALANCE OVERRIDE', 'INSUFFICIENT BALANCE', 'BOOLEAN', 'True', 'Y', 'All');
######################## Added on 12-03-3014 for unlock user and reset password (Nirmal kanna S) ########################
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00039', 'UserManagement', 'Reset Password', 'resetUser');
INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00039');
INSERT INTO "IBSMFITEST"."AMTB_FUNCTION" (FUNC_ID,BASE_FUNC,FUNC_DESC,FUNC_COMMAND) VALUES ('FUN00040', 'UserManagement', 'UnLock User', 'unLockUser');
INSERT INTO "IBSMFITEST"."AMTB_ROLE_ENTITLEMENT" (ROLE_ID,FUNC_ID) VALUES ('ROL00000','FUN00040');
######################## Added on 12-03-3014 for unlock user and reset password (Nirmal kanna S) ########################
insert into IBSMFITEST.amtb_parameters (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('MINIMUM PASSWORD LENGTH', 'PASSWORD', 'INTEGER', '28', 'Y', 'Mobile');
insert into IBSMFITEST.amtb_parameters (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('NUMBERS OF INVALID LOGINS', 'INVALID LOGINS', 'INTEGER', '3', 'N', 'All');
insert into IBSMFITEST.amtb_parameters (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('DEFAULT AGENT LOGIN EXPIRY DAYS', 'EXPIRY DAYS', 'INTEGER', '3', 'y', 'All');
insert into IBSMFITEST.amtb_parameters (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('MOBILE REGISTRATION KEY LENGTH', 'REGISTRATION KEY', 'INTEGER', '1', 'y', 'Mobile');
insert into IBSMFITEST.amtb_parameters (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('MOBILE REGISTRATION KEY EXPIRATION TIME(IN MINUTES)', 'KEY EXPIRATION', 'INTEGER', '423', 'y', 'Mobile');
insert into IBSMFITEST.amtb_parameters (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('MINIMUM MOBILE LOGIN PASSWORD LENGTH', 'MOBILE PASSWORD', 'INTEGER', '15', 'y', 'Mobile');
insert into IBSMFITEST.amtb_parameters (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('MINIMUM MOBILE FAILED LOGINS', 'MOBILE FAILED LOGINS', 'INTEGER', '25', 'y', 'Mobile');
insert into IBSMFITEST.amtb_parameters (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('CBS INTERFACE POLLING ENABLED', 'POLLING ENABLED', 'BOOLEAN', 'True', 'Y', 'All');
insert into IBSMFITEST.amtb_parameters (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('CBS INTERFACE POLLING INTERVAL IN SECONDS', 'POLLING INTERVAL', 'INTEGER', '6', 'y', 'All');
insert into IBSMFITEST.amtb_parameters (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('DEFAULT DEVICE SYNCH BATCH SIZE', 'SYNCH BATCH SIZE', 'INTEGER', '5', 'y', 'All');
insert into IBSMFITEST.amtb_parameters (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('DAYS_FWD_DISB_AGENDA', 'DISBURSEMENT AGENDA', 'INTEGER', '7', 'Y', 'Mobile');
insert into IBSMFITEST.amtb_parameters (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('DAYS_FWD_REPAY_AGENDA', 'REPAYMENT AGENDA', 'INTEGER', '23', 'Y', 'Mobile');
insert into IBSMFITEST.amtb_parameters (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('HOST NAME', 'HOST', 'VARCHAR', '192.168.1.112', 'Y', 'Mobile');
insert into IBSMFITEST.amtb_parameters (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('NUMBERS OF RETRY', 'RETRY', 'VARCHAR', '3', 'Y', 'ALL');
insert into IBSMFITEST.amtb_parameters (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('DEBUG', 'DEBUG', 'STRING', 'sadf', 'Y', 'All');
insert into IBSMFITEST.amtb_parameters (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('DEBUG_AREA', 'DEBUG_AREA', 'STRING', 'E:\MFI_APP_IBS\DB_Debug', 'Y', 'All');
insert into IBSMFITEST.amtb_parameters (PARAM_NAME, PARAM_TEXT, PARAM_TYPE, PARAM_VALUE, EDITABLE, COMPONENTS)
values ('INSUFFICIENT BALANCE OVERRIDE', 'INSUFFICIENT BALANCE', 'BOOLEAN', 'True', 'Y', 'All');
INSERT INTO AMTB_USER_ROLES (USER_ID,ROLE_ID) VALUES ('su','ROL00000');
insert into AMTB_USERS (USER_ID, BRANCH_CODE, FIRST_NAME, LAST_NAME, DATE_OF_BIRTH, GENDER, COMMUNICATION_ADDRESS1, COMMUNICATION_ADDRESS2, COMMUNICATION_ADDRESS3, COMMUNICATION_POSTAL_CODE, PERMANENT_ADDRESS1, PERMANENT_ADDRESS2, PERMANENT_ADDRESS3, PERMANENT_POSTAL_CODE, MOBILE_NUMBER, EMAIL_ID, PASSWORD, USER_TYPE, USER_STATUS, START_DATE, END_DATE, NO_OF_FAILED_LOGINS, LAST_LOGIN_DATE, USER_PREV_PASSWORD1, USER_PREV_PASSWORD2, AUTH_STATUS)
values ('su', null, null, 'Administrator', null, '1', null, null, null, null, null, null, null, null, null, null, '240be518fabd2724ddb6f04eeb1da5967448d7e831c08c8fa822809f74c720a9', '2', 'A', null, null, null, null, null, null, 'A');
insert into "IBSMFITEST"."AMTB_FUNCTION" (func_id,base_func,func_desc,func_command) values ('FUN00048','Loan Detail','Allocate Agent','addAgentAllocations');
delete from AMTB_ROLE_ENTITLEMENT where func_id in ('FUN00030','FUN00031');
delete from amtb_function where BASE_FUNC='AgentAllocations'
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('custCategory','1','Mobile Customer','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('homeBranch','1','0001','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('homeBranch','2','0002','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('homeBranch','3','0003','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('homeBranch','4','0004','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('homeBranch','5','0005','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('relOfficer','1','Chantou','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('relOfficer','2','Chann','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('relOfficer','3','Chakara','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('relOfficer','4','Anil','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('relOfficer','5','Marks','Y');
insert into AMTB_PARAMETERS (PARAM_NAME,PARAM_TEXT,PARAM_TYPE,PARAM_VALUE,EDITABLE,COMPONENTS) values ('TEMP HOST NAME','HOST','STRING','192.168.1.142:9090','Y','Mobile');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('customerStatus','A','Acknowleged','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('customerStatus','NA','Not Acknowleged','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('customerStatus','P','Pending','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('loanStatus','A','Acknowleged','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('loanStatus','NA','Not Acknowleged','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('loanStatus','P','Pending','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('txnStatus','A','Acknowleged','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('txnStatus','F','Fail','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('txnStatus','P','Processing ','Y');
Insert into AMTB_LIST_VALUE (LIST_NAME,LIST_VALUE,DESN,STATUS) values ('txnStatus','R','Ready For Cbs','Y');
******************************* Starts From dd/mm/2014 *******************************
******************************* Ends Here *******************************
******************************* Starts From dd/mm/2014 *******************************
******************************* Ends Here *******************************
| 92.952381 | 460 | 0.758489 |
20a368a5eeec0a4197d528b6ea4bbd3e34d9541c | 24,389 | css | CSS | src/App.css | aurora-collective/aurora-front | 121211d47e80f1928beac79d12046016c474375f | [
"Apache-2.0"
] | null | null | null | src/App.css | aurora-collective/aurora-front | 121211d47e80f1928beac79d12046016c474375f | [
"Apache-2.0"
] | null | null | null | src/App.css | aurora-collective/aurora-front | 121211d47e80f1928beac79d12046016c474375f | [
"Apache-2.0"
] | null | null | null | body,html{
margin:0;
padding:0
}
*{
-webkit-box-sizing:border-box;
box-sizing:border-box
}
a{
color:#fff
}
html{
color:ivory;
font-family:rubik;
font-size:16px
}
body{
background-color:#000;
background-image:url(./img/background.png);
-webkit-animation:bganim 20s linear 0s infinite;
animation:bganim 20s linear 0s infinite
}
h1,h2,h3,h4,h5,h6{
font-family:montserrat;
font-weight:300;
line-height:1
}
h1{
font-size:2rem
}
::-moz-selection{
background-color:rgba(255,255,255,.25)
}
::selection{
background-color:rgba(255,255,255,.25)
}
// width ::-webkit-scrollbar{
width:10px
}
// track ::-webkit-scrollbar-track{
background:#f1f1f1
}
// handle ::-webkit-scrollbar-thumb{
background:#595b61
}
// handle on hover ::-webkit-scrollbar-thumb:hover{
background:#555
}
.icon{
height:1rem;
width:1rem;
fill:currentColor;
opacity:1;
vertical-align:center;
margin-right:calc(1rem/4)
}
.material-icons-outlined{
font-size:18px
}
.spacer{
padding-left:calc(calc(1rem * 4)/2);
padding-right:calc(calc(1rem * 4)/2)
}
.container{
margin-right:auto;
margin-left:auto
}
.row{
-webkit-box-sizing:border-box;
box-sizing:border-box;
display:-webkit-box;
display:-ms-flexbox;
display:flex;
-webkit-box-flex:0;
-ms-flex:0 1 auto;
flex:0 1 auto;
-webkit-box-direction:normal;
-ms-flex-direction:row;
flex-direction:row;
-ms-flex-wrap:wrap;
flex-wrap:wrap;
margin-right:-.5rem;
margin-left:-.5rem
}
.row,.row.reverse{
-webkit-box-orient:horizontal
}
.row.reverse{
-ms-flex-direction:row-reverse;
flex-direction:row-reverse
}
.col.reverse,.row.reverse{
-webkit-box-direction:reverse
}
.col.reverse{
-webkit-box-orient:vertical;
-ms-flex-direction:column-reverse;
flex-direction:column-reverse
}
.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{
-webkit-box-sizing:border-box;
box-sizing:border-box;
-webkit-box-flex:0;
-ms-flex:0 0 auto;
flex:0 0 auto;
padding-right:.5rem;
padding-left:.5rem
}
.col-xs{
-webkit-box-flex:1;
-ms-flex-positive:1;
flex-grow:1;
-ms-flex-preferred-size:0;
flex-basis:0;
max-width:100%
}
.col-xs-1{
-ms-flex-preferred-size:8.33333333%;
flex-basis:8.33333333%;
max-width:8.33333333%
}
.col-xs-2{
-ms-flex-preferred-size:16.66666667%;
flex-basis:16.66666667%;
max-width:16.66666667%
}
.col-xs-3{
-ms-flex-preferred-size:25%;
flex-basis:25%;
max-width:25%
}
.col-xs-4{
-ms-flex-preferred-size:33.33333333%;
flex-basis:33.33333333%;
max-width:33.33333333%
}
.col-xs-5{
-ms-flex-preferred-size:41.66666667%;
flex-basis:41.66666667%;
max-width:41.66666667%
}
.col-xs-6{
-ms-flex-preferred-size:50%;
flex-basis:50%;
max-width:50%
}
.col-xs-7{
-ms-flex-preferred-size:58.33333333%;
flex-basis:58.33333333%;
max-width:58.33333333%
}
.col-xs-8{
-ms-flex-preferred-size:66.66666667%;
flex-basis:66.66666667%;
max-width:66.66666667%
}
.col-xs-9{
-ms-flex-preferred-size:75%;
flex-basis:75%;
max-width:75%
}
.col-xs-10{
-ms-flex-preferred-size:83.33333333%;
flex-basis:83.33333333%;
max-width:83.33333333%
}
.col-xs-11{
-ms-flex-preferred-size:91.66666667%;
flex-basis:91.66666667%;
max-width:91.66666667%
}
.col-xs-12{
-ms-flex-preferred-size:100%;
flex-basis:100%;
max-width:100%
}
.start-xs{
-webkit-box-pack:start;
-ms-flex-pack:start;
justify-content:flex-start;
text-align:start
}
.center-xs{
-webkit-box-pack:center;
-ms-flex-pack:center;
justify-content:center;
text-align:center
}
.end-xs{
-webkit-box-pack:end;
-ms-flex-pack:end;
justify-content:flex-end;
text-align:end
}
.top-xs{
-webkit-box-align:start;
-ms-flex-align:start;
align-items:flex-start
}
.around-xs{
-ms-flex-pack:distribute;
justify-content:space-around
}
.between-xs{
-webkit-box-pack:justify;
-ms-flex-pack:justify;
justify-content:space-between
}
.first-xs{
-webkit-box-ordinal-group:0;
-ms-flex-order:-1;
order:-1
}
@media only screen and (min-width:48em){
.container{
width:49rem
}
.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{
-webkit-box-sizing:border-box;
box-sizing:border-box;
-webkit-box-flex:0;
-ms-flex:0 0 auto;
flex:0 0 auto;
padding-right:.5rem;
padding-left:.5rem
}
.col-sm{
-webkit-box-flex:1;
-ms-flex-positive:1;
flex-grow:1;
-ms-flex-preferred-size:0;
flex-basis:0;
max-width:100%
}
.col-sm-1{
-ms-flex-preferred-size:8.33333333%;
flex-basis:8.33333333%;
max-width:8.33333333%
}
.col-sm-2{
-ms-flex-preferred-size:16.66666667%;
flex-basis:16.66666667%;
max-width:16.66666667%
}
.col-sm-3{
-ms-flex-preferred-size:25%;
flex-basis:25%;
max-width:25%
}
.col-sm-4{
-ms-flex-preferred-size:33.33333333%;
flex-basis:33.33333333%;
max-width:33.33333333%
}
.col-sm-5{
-ms-flex-preferred-size:41.66666667%;
flex-basis:41.66666667%;
max-width:41.66666667%
}
.col-sm-6{
-ms-flex-preferred-size:50%;
flex-basis:50%;
max-width:50%
}
.col-sm-7{
-ms-flex-preferred-size:58.33333333%;
flex-basis:58.33333333%;
max-width:58.33333333%
}
.col-sm-8{
-ms-flex-preferred-size:66.66666667%;
flex-basis:66.66666667%;
max-width:66.66666667%
}
.col-sm-9{
-ms-flex-preferred-size:75%;
flex-basis:75%;
max-width:75%
}
.col-sm-10{
-ms-flex-preferred-size:83.33333333%;
flex-basis:83.33333333%;
max-width:83.33333333%
}
.col-sm-11{
-ms-flex-preferred-size:91.66666667%;
flex-basis:91.66666667%;
max-width:91.66666667%
}
.col-sm-12{
-ms-flex-preferred-size:100%;
flex-basis:100%;
max-width:100%
}
.start-sm{
-webkit-box-pack:start;
-ms-flex-pack:start;
justify-content:flex-start;
text-align:start
}
.center-sm{
-webkit-box-pack:center;
-ms-flex-pack:center;
justify-content:center;
text-align:center
}
.end-sm{
-webkit-box-pack:end;
-ms-flex-pack:end;
justify-content:flex-end;
text-align:end
}
.top-sm{
-webkit-box-align:start;
-ms-flex-align:start;
align-items:flex-start
}
.around-sm{
-ms-flex-pack:distribute;
justify-content:space-around
}
.between-sm{
-webkit-box-pack:justify;
-ms-flex-pack:justify;
justify-content:space-between
}
.first-sm{
-webkit-box-ordinal-group:0;
-ms-flex-order:-1;
order:-1
}
}
@media only screen and (min-width:64em){
.container{
width:65rem
}
.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{
-webkit-box-sizing:border-box;
box-sizing:border-box;
-webkit-box-flex:0;
-ms-flex:0 0 auto;
flex:0 0 auto;
padding-right:.5rem;
padding-left:.5rem
}
.col-md{
-webkit-box-flex:1;
-ms-flex-positive:1;
flex-grow:1;
-ms-flex-preferred-size:0;
flex-basis:0;
max-width:100%
}
.col-md-1{
-ms-flex-preferred-size:8.33333333%;
flex-basis:8.33333333%;
max-width:8.33333333%
}
.col-md-2{
-ms-flex-preferred-size:16.66666667%;
flex-basis:16.66666667%;
max-width:16.66666667%
}
.col-md-3{
-ms-flex-preferred-size:25%;
flex-basis:25%;
max-width:25%
}
.col-md-4{
-ms-flex-preferred-size:33.33333333%;
flex-basis:33.33333333%;
max-width:33.33333333%
}
.col-md-5{
-ms-flex-preferred-size:41.66666667%;
flex-basis:41.66666667%;
max-width:41.66666667%
}
.col-md-6{
-ms-flex-preferred-size:50%;
flex-basis:50%;
max-width:50%
}
.col-md-7{
-ms-flex-preferred-size:58.33333333%;
flex-basis:58.33333333%;
max-width:58.33333333%
}
.col-md-8{
-ms-flex-preferred-size:66.66666667%;
flex-basis:66.66666667%;
max-width:66.66666667%
}
.col-md-9{
-ms-flex-preferred-size:75%;
flex-basis:75%;
max-width:75%
}
.col-md-10{
-ms-flex-preferred-size:83.33333333%;
flex-basis:83.33333333%;
max-width:83.33333333%
}
.col-md-11{
-ms-flex-preferred-size:91.66666667%;
flex-basis:91.66666667%;
max-width:91.66666667%
}
.col-md-12{
-ms-flex-preferred-size:100%;
flex-basis:100%;
max-width:100%
}
.start-md{
-webkit-box-pack:start;
-ms-flex-pack:start;
justify-content:flex-start;
text-align:start
}
.center-md{
-webkit-box-pack:center;
-ms-flex-pack:center;
justify-content:center;
text-align:center
}
.end-md{
-webkit-box-pack:end;
-ms-flex-pack:end;
justify-content:flex-end;
text-align:end
}
.top-md{
-webkit-box-align:start;
-ms-flex-align:start;
align-items:flex-start
}
.around-md{
-ms-flex-pack:distribute;
justify-content:space-around
}
.between-md{
-webkit-box-pack:justify;
-ms-flex-pack:justify;
justify-content:space-between
}
.first-md{
-webkit-box-ordinal-group:0;
-ms-flex-order:-1;
order:-1
}
}
@media only screen and (min-width:75em){
.container{
width:76rem
}
.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{
-webkit-box-sizing:border-box;
box-sizing:border-box;
-webkit-box-flex:0;
-ms-flex:0 0 auto;
flex:0 0 auto;
padding-right:.5rem;
padding-left:.5rem
}
.col-lg{
-webkit-box-flex:1;
-ms-flex-positive:1;
flex-grow:1;
-ms-flex-preferred-size:0;
flex-basis:0;
max-width:100%
}
.col-lg-1{
-ms-flex-preferred-size:8.33333333%;
flex-basis:8.33333333%;
max-width:8.33333333%
}
.col-lg-2{
-ms-flex-preferred-size:16.66666667%;
flex-basis:16.66666667%;
max-width:16.66666667%
}
.col-lg-3{
-ms-flex-preferred-size:25%;
flex-basis:25%;
max-width:25%
}
.col-lg-4{
-ms-flex-preferred-size:33.33333333%;
flex-basis:33.33333333%;
max-width:33.33333333%
}
.col-lg-5{
-ms-flex-preferred-size:41.66666667%;
flex-basis:41.66666667%;
max-width:41.66666667%
}
.col-lg-6{
-ms-flex-preferred-size:50%;
flex-basis:50%;
max-width:50%
}
.col-lg-7{
-ms-flex-preferred-size:58.33333333%;
flex-basis:58.33333333%;
max-width:58.33333333%
}
.col-lg-8{
-ms-flex-preferred-size:66.66666667%;
flex-basis:66.66666667%;
max-width:66.66666667%
}
.col-lg-9{
-ms-flex-preferred-size:75%;
flex-basis:75%;
max-width:75%
}
.col-lg-10{
-ms-flex-preferred-size:83.33333333%;
flex-basis:83.33333333%;
max-width:83.33333333%
}
.col-lg-11{
-ms-flex-preferred-size:91.66666667%;
flex-basis:91.66666667%;
max-width:91.66666667%
}
.col-lg-12{
-ms-flex-preferred-size:100%;
flex-basis:100%;
max-width:100%
}
.start-lg{
-webkit-box-pack:start;
-ms-flex-pack:start;
justify-content:flex-start;
text-align:start
}
.center-lg{
-webkit-box-pack:center;
-ms-flex-pack:center;
justify-content:center;
text-align:center
}
.end-lg{
-webkit-box-pack:end;
-ms-flex-pack:end;
justify-content:flex-end;
text-align:end
}
.top-lg{
-webkit-box-align:start;
-ms-flex-align:start;
align-items:flex-start
}
.around-lg{
-ms-flex-pack:distribute;
justify-content:space-around
}
.between-lg{
-webkit-box-pack:justify;
-ms-flex-pack:justify;
justify-content:space-between
}
.first-lg{
-webkit-box-ordinal-group:0;
-ms-flex-order:-1;
order:-1
}
}
.flex-center{
-webkit-box-align:center!important;
-ms-flex-align:center!important;
align-items:center!important
}
.flex-center,.flex-center__x{
-webkit-box-pack:center!important;
-ms-flex-pack:center!important;
justify-content:center!important
}
@media(max-width:48em){
.hidden-xs{
display:none!important
}
}
@media(min-width:48em) and (max-width:64em){
.hidden-sm{
display:none!important
}
}
@media(min-width:64em) and (max-width:75em){
.hidden-md{
display:none!important
}
}
@media(min-width:75em){
.hidden-lg{
display:none!important
}
}
.mg-15{
padding-top:40px
}
header{
margin:0;
padding:calc(1rem * 2) 0 0;
-webkit-transform:translateZ(0);
transform:translateZ(0);
z-index:2
}
header a{
color:#fff
}
header .logo{
display:-webkit-box;
display:-ms-flexbox;
display:flex;
-webkit-box-align:center;
-ms-flex-align:center;
align-items:center;
-webkit-box-pack:start;
-ms-flex-pack:start;
justify-content:flex-start;
height:100%;
text-decoration:none;
color:ivory;
font-size:1.2rem;
font-weight:300
}
header .logo img{
height:80px;
margin-top:-15px
}
header .links{
display:-webkit-box;
display:-ms-flexbox;
display:flex;
-webkit-box-pack:end;
-ms-flex-pack:end;
justify-content:flex-end;
list-style:none;
padding:0;
margin:0;
margin-right:calc(1rem * -1)
}
header .links a{
display:block;
padding:.5rem 1rem;
margin-left:1rem;
background-color:hsla(60,93%,94%,.1);
text-decoration:none;
border:2px solid transparent;
transition:border .5s
}
header .links a:hover{
border-color:#fff;
-webkit-box-shadow:none;
box-shadow:none
}
header .links a.active{
-webkit-box-shadow:0 -2px 0 #f40552 inset;
box-shadow:0 -2px 0 #f40552 inset
}
header .burger-toggle{
display:-webkit-box;
display:-ms-flexbox;
display:flex;
-webkit-box-align:center;
-ms-flex-align:center;
align-items:center;
-webkit-box-pack:end;
-ms-flex-pack:end;
justify-content:flex-end;
cursor:pointer;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none
}
.burger-links .material-icons-outlined,header .burger-toggle .material-icons-outlined{
font-size:1.75rem
}
.burger-links{
position:fixed;
top:0;
left:0;
width:100vw;
height:100vh;
display:-webkit-box;
display:-ms-flexbox;
display:flex;
background-color:rgba(22,26,35,.5);
-webkit-backdrop-filter:blur(10px);
backdrop-filter:blur(10px);
padding:calc(calc(1rem * 4)/2);
z-index:10;
-webkit-transform:translateX(100vw);
-ms-transform:translateX(100vw);
transform:translateX(100vw);
-webkit-transition:all .2s ease;
-o-transition:all .2s ease;
transition:all .2s ease
}
.burger-links.active{
-webkit-transform:translateX(0);
-ms-transform:translateX(0);
transform:translateX(0)
}
.burger-links .links{
-webkit-box-flex:1;
-ms-flex-positive:1;
flex-grow:1;
list-style:none;
padding:0;
margin:0
}
.burger-links .links a{
display:block;
padding:1rem;
margin-bottom:1rem;
margin-right:calc(1rem * 2);
background-color:hsla(60,93%,94%,.1);
text-decoration:none
}
.burger-links .links a:hover{
background-color:#f40552;
-webkit-box-shadow:none;
box-shadow:none
}
.burger-links .close{
display:-webkit-box;
display:-ms-flexbox;
display:flex;
-webkit-box-pack:center;
-ms-flex-pack:center;
justify-content:center;
width:calc(1rem * 2);
cursor:pointer;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none
}
@supports not ((-webkit-backdrop-filter:blur) or (backdrop-filter:blur)){
.burger-links{
background-color:#000;
background-image:url(./img/background.png)
}
}
section.features{
padding-top:20px;
position:relative;
--top-offset: calc(1rem * 5);
margin-top:calc(var(--top-offset) * -1);
z-index:2;
margin-top:0;
padding-bottom:50px
}
section.features:before{
position:absolute;
content:"";
display:block;
top:var(--top-offset);
left:0;
right:0;
bottom:0
}
section.features .container{
z-index:4;
-webkit-transform:translateZ(0);
transform:translateZ(0)
}
section.features article{
padding:25px;
margin:1rem;
-webkit-backdrop-filter:blur(10px);
backdrop-filter:blur(10px);
background-color:var(--shadow-color);
-webkit-transition:-webkit-transform .2s ease;
transition:-webkit-transform .2s ease;
-o-transition:transform .2s ease;
transition:transform .2s ease;
transition:transform .2s ease,-webkit-transform .2s ease
}
section.features article h2{
font-family:montserrat;
margin:0 0 1rem
}
section.features article h2{
display:-webkit-box;
display:-ms-flexbox;
display:flex;
-webkit-box-align:center;
-ms-flex-align:center;
align-items:center
}
section.features article h2 .icon{
fill:var(--icon-color);
margin-right:0
}
section.features article h2 .material-icons-outlined{
color:var(--icon-color)
}
section.features article.first{
--icon-color: rgba(6, 82, 221, 0.5);
--shadow-color: rgba(234, 32, 39, 0.1)
}
section.features article.second{
--icon-color: rgba(234, 32, 39, 0.5);
--shadow-color: rgba(6, 82, 221, 0.1)
}
section.hero{
position:relative;
-webkit-transform:translateZ(0);
transform:translateZ(0);
padding:calc(1rem * 7) 0 calc(1rem * 13);
display:-webkit-box;
display:-ms-flexbox;
display:flex;
-webkit-box-align:center;
-ms-flex-align:center;
align-items:center;
-webkit-box-pack:justify;
-ms-flex-pack:justify;
justify-content:space-between;
z-index:2
}
section.hero .lead{
margin:0;
color:ivory;
font-family:montserrat;
font-size:1.5rem
}
@media only screen and (min-width:48em){
section.hero .lead{
font-size:2rem
}
}
@-webkit-keyframes bganim{
0%{
background-position:0 0
}
50%{
background-position:500px -500px
}
to{
background-position:1000px -1000px
}
}
@keyframes bganim{
0%{
background-position:0 0
}
50%{
background-position:500px -500px
}
to{
background-position:1000px -1000px
}
}
.bg-holder{
position:relative;
background-size:cover;
padding-bottom:calc(1rem * 2)
}
section.hero .cta{
display:-webkit-box;
display:-ms-flexbox;
display:flex;
-webkit-box-orient:vertical;
-webkit-box-direction:normal;
-ms-flex-direction:column;
flex-direction:column
}
section.hero .cta #client-download{
padding:1rem calc(1rem * 2);
font-weight:300;
font-family:rubik;
font-size:1.5rem;
cursor:pointer;
color:ivory;
background-color:rgba(234,32,39,.5);
background-image:url(./img/background.png);
-webkit-animation:bganim 40s linear 0s infinite;
animation:bganim 40s linear 0s infinite;
border:2px solid transparent;
-webkit-backdrop-filter:blur(10px);
backdrop-filter:blur(10px);
outline:0;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
-webkit-transition:background .2s ease;
-o-transition:background .2s ease;
transition:background .2s ease;
transition:border .5s
}
section.hero .cta #client-download:hover{
border-color:#fff;
-webkit-transition:none;
-o-transition:none;
transition:none
}
section.hero .cta #client-download2{
padding:1rem calc(1rem * 2);
font-weight:300;
font-family:rubik;
font-size:1.5rem;
cursor:pointer;
color:ivory;
background-color:rgba(6,82,221,.5);
background-image:url(./img/background.png);
-webkit-animation:bganim 40s linear 0s infinite;
animation:bganim 40s linear 0s infinite;
border:2px solid transparent;
-webkit-backdrop-filter:blur(10px);
backdrop-filter:blur(10px);
outline:0;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
-webkit-transition:background .2s ease;
-o-transition:background .2s ease;
transition:background .2s ease;
transition:border .5s
}
section.hero .cta #client-download2:hover{
border-color:#fff;
-webkit-transition:none;
-o-transition:none;
transition:none
}
section.hero .cta #client-download .description{
display:block;
margin-top:.5rem;
font-size:1rem;
font-family:rubik;
opacity:.75
}
section.hero .cta #client-download2 .description{
display:block;
margin-top:.5rem;
font-size:1rem;
font-family:rubik;
opacity:.75
}
section.hero .cta .server{
display:-webkit-box;
display:-ms-flexbox;
display:flex;
-webkit-box-align:center;
-ms-flex-align:center;
align-items:center;
-webkit-box-pack:justify;
-ms-flex-pack:justify;
justify-content:space-between;
margin-top:calc(1rem * 2);
padding:0
}
@-moz-document url-prefix(){
.terms{
background-color:#000
}
}
section.hero .seller{
opacity:0;
pointer-events:none;
-webkit-transition:all .2s ease;
-o-transition:all .2s ease;
transition:all .2s ease
}
section.hero .seller.active{
opacity:1;
-webkit-filter:none;
filter:none;
pointer-events:all
}
section.reqs{
padding:calc(1rem * 2) 0 calc(1rem * 4);
color:#fff;
text-shadow:none;
-webkit-backdrop-filter:blur(5px);
backdrop-filter:blur(5px);
background-color:rgba(255,255,255,.025)
}
section.reqs h1{
margin-bottom:15px
}
section.reqs .windows-version{
display:inline-block;
margin:calc(1rem * 2) 1rem 0 0;
padding:.5rem 1rem;
color:rgba(255,255,255,.75);
border:1px solid;
border-right:none;
border-left:none;
border-top:none
}
section.reqs ul{
margin:0;
padding:0;
list-style:none
}
section.reqs .stat{
color:hsla(60,93%,94%,.75)
}
@-webkit-keyframes bloop{
0%{
-webkit-box-shadow:0 0 30px 3px rgba(244,5,82,.5),0 0 0 .5rem rgba(244,5,82,.5);
box-shadow:0 0 30px 3px rgba(244,5,82,.5),0 0 0 .5rem rgba(244,5,82,.5)
}
to{
-webkit-box-shadow:0 0 2px transparent;
box-shadow:0 0 2px transparent
}
}
@keyframes bloop{
0%{
-webkit-box-shadow:0 0 30px 3px rgba(244,5,82,.5),0 0 0 .5rem rgba(244,5,82,.5);
box-shadow:0 0 30px 3px rgba(244,5,82,.5),0 0 0 .5rem rgba(244,5,82,.5)
}
to{
-webkit-box-shadow:0 0 2px transparent;
box-shadow:0 0 2px transparent
}
}
.featured-video{
width:100%;
padding:25px 0 50px;
-webkit-backdrop-filter:blur(5px);
backdrop-filter:blur(5px);
background-color:rgba(255,255,255,.025);
box-sizing:border-box
}
.featured-video .content{
display:block;
margin:0 auto
}
.featured-video .content iframe{
width:100%;
height:300px
}
.featured-video .content h1{
margin:50px 0
}
.featured-video .content .title{
border-left:2px solid #fff;
margin:20px 0 0;
padding-left:15px;
vertical-align:middle
}
.featured-video .content .title h4{
color:#fff;
margin:0;
padding:0;
font-size:12px
}
.featured-video .content .title h2{
color:#fff;
margin:0;
padding:10px 0 0;
font-size:24px
}
.featured-video .info h2{
border-left:4px solid #fff;
color:#fff;
padding:0 0 0 15px;
margin:0;
font-size:32px
}
.featured-video .info h5{
color:#fff;
font-size:14px;
margin:25px 0 0;
padding:0
}
.changes{
width:100%
}
.changes .changelog{
width:100%;
margin-bottom:50px
}
.changes .changelog button{
background-color:hsla(60,93%,94%,.1);
border:2px solid transparent;
color:#fff;
font-weight:700;
padding:10px 15px;
margin:0 auto;
display:block;
margin-top:25px;
transition:border-color .5s;
outline:0;
text-decoration:none
}
.changes .changelog button:hover{
border-color:#fff;
cursor:pointer
}
.changes .changelog .tab{
width:100%;
background-color:hsla(60,93%,94%,.05);
color:#fff;
font-size:18px;
font-weight:500;
padding:15px 25px;
border:2px solid transparent;
box-sizing:border-box;
transition:border-color .5s
}
.changes .changelog .tab.active{
background-color:hsla(60,93%,94%,.1)
}
.changes .changelog .tab .inner{
padding-left:25px;
padding-top:15px
}
.changes .changelog .tab .inner p{
font-weight:100;
font-size:14px;
margin:5px 0 0;
padding:0 0 0 5px;
border-left:2px solid #fff
}
.changes .changelog .tab:hover{
border-color:#fff;
cursor:pointer
}
footer{
padding:25px;
color:#fff;
text-align:center;
background-color:transparent
}
footer a{
color:#fff;
text-decoration:underline
}
::-webkit-scrollbar{
width:10px
}
::-webkit-scrollbar-thumb{
background:#595b61
}
::-webkit-scrollbar-track{
background:#f1f1f1
}
| 21.189401 | 133 | 0.65058 |
673d19073a68ece9813a6f10a3be8f2f07a279b2 | 1,467 | swift | Swift | Durak/DurakServiceManager.swift | carolineberger/Durak | 4aec12dddfc27b69d1bd9e732bbc9149b858742d | [
"MIT"
] | null | null | null | Durak/DurakServiceManager.swift | carolineberger/Durak | 4aec12dddfc27b69d1bd9e732bbc9149b858742d | [
"MIT"
] | null | null | null | Durak/DurakServiceManager.swift | carolineberger/Durak | 4aec12dddfc27b69d1bd9e732bbc9149b858742d | [
"MIT"
] | null | null | null | //
// DurakServiceManager.swift
// Durak
//
// Created by Caroline Berger on 14/06/2018.
// Copyright © 2018 Caroline Berger. All rights reserved.
//
import Foundation
import MultipeerConnectivity
class DurakServiceManager : NSObject {
// Service type must be a unique string, at most 15 characters long
// and can contain only ASCII lowercase letters, numbers and hyphens.
private let DurakServiceType = "example-color"
private let myPeerId = MCPeerID(displayName: UIDevice.current.name)
private let serviceAdvertiser : MCNearbyServiceAdvertiser
override init() {
self.serviceAdvertiser = MCNearbyServiceAdvertiser(peer: myPeerId, discoveryInfo: nil, serviceType: DurakServiceType)
super.init()
self.serviceAdvertiser.delegate = self
self.serviceAdvertiser.startAdvertisingPeer()
}
deinit {
self.serviceAdvertiser.stopAdvertisingPeer()
}
}
extension DurakServiceManager : MCNearbyServiceAdvertiserDelegate {
func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didNotStartAdvertisingPeer error: Error) {
NSLog("%@", "didNotStartAdvertisingPeer: \(error)")
}
func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: Data?, invitationHandler: @escaping (Bool, MCSession?) -> Void) {
NSLog("%@", "didReceiveInvitationFromPeer \(peerID)")
}
}
| 32.6 | 194 | 0.718473 |
124f18a6a6fc938a01851bf4a6b9346cf7003ec2 | 495 | asm | Assembly | programs/oeis/075/A075425.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/075/A075425.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/075/A075425.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A075425: Number of steps to reach 1 starting with n and iterating the map n ->rad(n)-1, where rad(n) is the squarefree kernel of n (A007947).
; 0,1,2,1,2,3,4,1,2,3,4,3,4,5,6,1,2,3,4,3,4,5,6,3,2,3,2,5,6,7,8,1,2,3,4,3,4,5,6,3,4,5,6,5,6,7,8,3,4,3,4,3,4,3,4,5,6,7,8,7,8,9,4,1,2,3,4,3,4,5,6,3,4,5,6,5,6,7,8,3,2,3,4,5,6,7,8,5,6,7,8,7,8,9,10,3,4,5,2,3
lpb $0
seq $0,7947 ; Largest squarefree number dividing n: the squarefree kernel of n, rad(n), radical of n.
sub $0,2
add $1,1
lpe
mov $0,$1
| 49.5 | 202 | 0.614141 |
680b55fe0c7327fc184dfffedcf339f3a8969a26 | 537 | sql | SQL | lubanlou-master/lubanlou-provider/lubanlou-provider-oauth2/src/main/resources/db/migration/V2019.12.23.1__modify_table.sql | osgvsun/lubanlou | 16d87a30edcb677bb399e001a2020e8527ba26f2 | [
"BSD-3-Clause"
] | 1 | 2022-01-20T04:42:37.000Z | 2022-01-20T04:42:37.000Z | lubanlou-master/lubanlou-provider/lubanlou-provider-oauth2/src/main/resources/db/migration/V2019.12.23.1__modify_table.sql | osgvsun/lubanlou | 16d87a30edcb677bb399e001a2020e8527ba26f2 | [
"BSD-3-Clause"
] | null | null | null | lubanlou-master/lubanlou-provider/lubanlou-provider-oauth2/src/main/resources/db/migration/V2019.12.23.1__modify_table.sql | osgvsun/lubanlou | 16d87a30edcb677bb399e001a2020e8527ba26f2 | [
"BSD-3-Clause"
] | null | null | null | alter table cookie
drop primary key;
delete from cookie
where client_id is null or client_id = 'null' or client_id = 'NULL' or username is null or username = 'NULL' or username = 'null';
alter table cookie
add id int primary key auto_increment
first;
alter table cookie
add constraint fk_cookie_client_id_oauth_client_details_client_id foreign key (client_id) references oauth_client_details (client_id);
alter table cookie
add constraint fk_cookie_username_users_username foreign key (username) references users(username); | 35.8 | 136 | 0.806331 |
84fd7ac46548921ae9033f15d124a4e7dd4c92dd | 3,177 | asm | Assembly | src/test/ref/font-hex-show.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/test/ref/font-hex-show.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/test/ref/font-hex-show.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | // Shows a font where each char contains the number of the char (00-ff)
/// @file
/// Commodore 64 Registers and Constants
/// @file
/// The MOS 6526 Complex Interface Adapter (CIA)
///
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Commodore 64 PRG executable file
.file [name="font-hex-show.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
/// $D018 VIC-II base addresses
// @see #VICII_MEMORY
.label D018 = $d018
.label SCREEN = $400
.label CHARSET = $2000
.segment Code
main: {
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET)/4&$f
// *D018 = toD018(SCREEN, CHARSET)
lda #toD0181_return
sta D018
// init_font_hex(CHARSET)
jsr init_font_hex
ldx #0
// Show all chars on screen
__b1:
// SCREEN[c] = c
txa
sta SCREEN,x
// for (byte c: 0..255)
inx
cpx #0
bne __b1
// }
rts
}
// Make charset from proto chars
// void init_font_hex(__zp(5) char *charset)
init_font_hex: {
.label __0 = 3
.label idx = 2
.label proto_lo = 7
.label charset = 5
.label c1 = 4
.label proto_hi = 9
.label c = $b
lda #0
sta.z c
lda #<FONT_HEX_PROTO
sta.z proto_hi
lda #>FONT_HEX_PROTO
sta.z proto_hi+1
lda #<CHARSET
sta.z charset
lda #>CHARSET
sta.z charset+1
__b1:
lda #0
sta.z c1
lda #<FONT_HEX_PROTO
sta.z proto_lo
lda #>FONT_HEX_PROTO
sta.z proto_lo+1
__b2:
// charset[idx++] = 0
lda #0
tay
sta (charset),y
lda #1
sta.z idx
ldx #0
__b3:
// proto_hi[i]<<4
txa
tay
lda (proto_hi),y
asl
asl
asl
asl
sta.z __0
// proto_lo[i]<<1
txa
tay
lda (proto_lo),y
asl
// proto_hi[i]<<4 | proto_lo[i]<<1
ora.z __0
// charset[idx++] = proto_hi[i]<<4 | proto_lo[i]<<1
ldy.z idx
sta (charset),y
// charset[idx++] = proto_hi[i]<<4 | proto_lo[i]<<1;
inc.z idx
// for( byte i: 0..4)
inx
cpx #5
bne __b3
// charset[idx++] = 0
lda #0
ldy.z idx
sta (charset),y
// charset[idx++] = 0;
iny
// charset[idx++] = 0
sta (charset),y
// proto_lo += 5
lda #5
clc
adc.z proto_lo
sta.z proto_lo
bcc !+
inc.z proto_lo+1
!:
// charset += 8
lda #8
clc
adc.z charset
sta.z charset
bcc !+
inc.z charset+1
!:
// for( byte c: 0..15 )
inc.z c1
lda #$10
cmp.z c1
bne __b2
// proto_hi += 5
lda #5
clc
adc.z proto_hi
sta.z proto_hi
bcc !+
inc.z proto_hi+1
!:
// for( byte c: 0..15 )
inc.z c
lda #$10
cmp.z c
bne __b1
// }
rts
}
.segment Data
// Bit patterns for symbols 0-f (3x5 pixels) used in font hex
FONT_HEX_PROTO: .byte 2, 5, 5, 5, 2, 6, 2, 2, 2, 7, 6, 1, 2, 4, 7, 6, 1, 2, 1, 6, 5, 5, 7, 1, 1, 7, 4, 6, 1, 6, 3, 4, 6, 5, 2, 7, 1, 1, 1, 1, 2, 5, 2, 5, 2, 2, 5, 3, 1, 1, 2, 5, 7, 5, 5, 6, 5, 6, 5, 6, 2, 5, 4, 5, 2, 6, 5, 5, 5, 6, 7, 4, 6, 4, 7, 7, 4, 6, 4, 4
| 21.039735 | 262 | 0.548316 |
aa2c29b22f9602ebfdfd78edfba35f1bb9192b7b | 346 | lua | Lua | Projects/GenerateDatas/convert_lua/item.TbItemExtra/1040040001.lua | fanlanweiy/luban_examples | 9ddca2a01e8db1573953be3f32c59104451cd96e | [
"MIT"
] | 44 | 2021-05-06T06:16:55.000Z | 2022-03-30T06:27:25.000Z | Projects/GenerateDatas/convert_lua/item.TbItemExtra/1040040001.lua | fanlanweiy/luban_examples | 9ddca2a01e8db1573953be3f32c59104451cd96e | [
"MIT"
] | 1 | 2021-07-25T16:35:32.000Z | 2021-08-23T04:59:49.000Z | Projects/GenerateDatas/convert_lua/item.TbItemExtra/1040040001.lua | fanlanweiy/luban_examples | 9ddca2a01e8db1573953be3f32c59104451cd96e | [
"MIT"
] | 14 | 2021-06-09T10:38:59.000Z | 2022-03-30T06:27:24.000Z | return {
_name = 'InteractionItem',
id = 1040040001,
holding_static_mesh = "StaticMesh'/Game/X6GameData/Prototype/PrototypeAssets/StaticMesh/SM_Ball.SM_Ball'",
holding_static_mesh_mat = "MaterialInstanceConstant'/Game/X6GameData/Prototype/PrototypeAssets/CustomizableGrid/Materials/Presets/M_Grid_preset_002.M_Grid_preset_002'",
} | 57.666667 | 172 | 0.809249 |
5cec5d0755ebf4f0c497288e33e72feb451b8152 | 4,049 | css | CSS | css/theme/octo.css | pixelastic/talk-webperfs | 8e64bcd65a1e560eea548477047c0c14ca44a0fb | [
"MIT"
] | null | null | null | css/theme/octo.css | pixelastic/talk-webperfs | 8e64bcd65a1e560eea548477047c0c14ca44a0fb | [
"MIT"
] | null | null | null | css/theme/octo.css | pixelastic/talk-webperfs | 8e64bcd65a1e560eea548477047c0c14ca44a0fb | [
"MIT"
] | null | null | null | /**
* Octo theme for reveal.js.
*/
@font-face {
font-family: "IntervalSansProRegular";
src: url("../../fonts/interval_regular-webfont.eot");
src: url("../../fonts/interval_regular-webfont.eot?#iefix") format("embedded-opentype"),
url("../../fonts/interval_regular-webfont.woff") format("woff"),
url("../../fonts/interval_regular-webfont.ttf") format("truetype"),
url("../../fonts/interval_regular-webfont.svg#IntervalSansProRegular") format("svg");
font-weight: normal;
font-style: normal
}
@font-face {
font-family: "IntervalSansProSemiBold";
src: url("../../fonts/interval_semi_bold-webfont.eot");
src: url("../../fonts/interval_semi_bold-webfont.eot?#iefix") format("embedded-opentype"),
url("../../fonts/interval_semi_bold-webfont.woff") format("woff"),
url("../../fonts/interval_semi_bold-webfont.ttf") format("truetype"),
url("../../fonts/interval_semi_bold-webfont.svg#IntervalSansProSemiBold") format("svg");
font-weight: normal;
font-style: normal
}
body {
background-color: #002458;
background-image: -webkit-radial-gradient(50% 50%, circle cover, #123961 0, #123961 45%, #002458 85%, #072255 100%);
background-image: -moz-radial-gradient(50% 50%, circle cover, #123961 0, #123961 45%, #002458 85%, #072255 100%);
background-image: -ms-radial-gradient(50% 50%, circle cover, #123961 0, #123961 45%, #002458 85%, #072255 100%);
background-image: -o-radial-gradient(50% 50%, circle cover, #123961 0, #123961 45%, #002458 85%, #072255 100%);
}
.reveal {
font-family: "IntervalSansProRegular", Arial, sans-serif;
font-size: 30px;
font-weight: normal;
color: #FFFFFF;
}
/* Headers */
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4,
.reveal h5,
.reveal h6 {
font-family: "IntervalSansProSemiBold", Arial, sans-serif;
text-shadow: 2px 2px #00294c;
line-height: 1.3em;
margin: 0 0 20px 0;
}
/* Links */
.reveal a {
color: #FFFFFF;
text-decoration: none;
-webkit-transition: none;
-moz-transition: none;
-ms-transition: none;
-o-transition: none;
transition: none;
}
.reveal a:hover {
color: #b01f16;
text-shadow: none;
border: none;
}
/* Lists */
.reveal ul,
.reveal ol {
min-width:600px;
margin:0 auto 20px auto;
}
.reveal ul ul,
.reveal ul ol,
.reveal ol ol,
.reveal ol ul {
font-size:0.8em;
}
.reveal blockquote {
margin-bottom:20px;
padding:20px;
}
.reveal strong {
color:#87C868;
}
.reveal em {
font-size:0.9em;
font-style:normal;
color:#a3adb2;
}
.reveal pre {
background:#000000;
color:#FFFFFF;
}
.reveal code {
background:#3F3F3F;
color:#DCDCDC;
padding:0.2em 0.5em;
font-size:0.8em;
}
.reveal pre code {
font-size:inherit;
}
.reveal code.cropped {
text-overflow:ellipsis;
overflow:hidden;
word-wrap:normal;
}
.reveal code.expanded {
word-wrap:break-word;
}
/* Progress bar */
.reveal .progress {
background: url('../../img/ui-octo-pattern.png') 0 5px repeat-x #030e2b;
height: 30px;
}
.reveal .progress span {
position: absolute;
top: -10px;
height: 10px;
background: #00a9c5;
}
/* Navigation */
.reveal .controls div.navigate-left,
.reveal .controls div.navigate-left.enabled {
border-right-color: #04568C;
}
.reveal .controls div.navigate-right,
.reveal .controls div.navigate-right.enabled {
border-left-color: #04568C;
}
.reveal .controls div.navigate-up,
.reveal .controls div.navigate-up.enabled {
border-bottom-color: #04568C;
}
.reveal .controls div.navigate-down,
.reveal .controls div.navigate-down.enabled {
border-top-color: #04568C;
}
.reveal .controls div.navigate-left.enabled:hover {
border-right-color: #00A2D8;
}
.reveal .controls div.navigate-right.enabled:hover {
border-left-color: #00A2D8;
}
.reveal .controls div.navigate-up.enabled:hover {
border-bottom-color: #00A2D8;
}
.reveal .controls div.navigate-down.enabled:hover {
border-top-color: #00A2D8;
}
/* Grid */
.reveal .row {
overflow:hidden;
}
.reveal .row .column {
float:left;
}
.reveal .col2 .column {
width:50%;
}
.reveal .col3 .column {
width:33%;
}
| 23.270115 | 118 | 0.676957 |
0bc25237116d36d1b3724261d878f108f7fb3326 | 1,103 | py | Python | abc199/d/main.py | KeiNishikawa218/atcoder | 0af5e091f8b1fd64d5ca7b46b06b9356eacfe601 | [
"MIT"
] | null | null | null | abc199/d/main.py | KeiNishikawa218/atcoder | 0af5e091f8b1fd64d5ca7b46b06b9356eacfe601 | [
"MIT"
] | null | null | null | abc199/d/main.py | KeiNishikawa218/atcoder | 0af5e091f8b1fd64d5ca7b46b06b9356eacfe601 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
class UnionFind():
def __init__(self, n):
self.parent = [-1 for _ in range(n)]
# 正==子: 根の頂点番号 / 負==根: 連結頂点数
def find(self, x):
if self.parent[x] < 0:
return x
else:
self.parent[x] = self.find(self.parent[x])
return self.parent[x]
def unite(self, x, y):
x, y = self.find(x), self.find(y)
if x == y:
return False
else:
if self.size(x) < self.size(y):
x, y = y, x
self.parent[x] += self.parent[y]
self.parent[y] = x
def same(self, x, y):
return self.find(x) == self.find(y)
def size(self, x):
x = self.find(x)
return -self.parent[x]
def is_root(self, x):
return self.parent[x] < 0
def main():
n, m = map(int, input().split())
count = 0
pair_list = []
uf = UnionFind(n)
for i in range(m):
array = list(map(int,input().split()))
array[0] -=1 ; array[1] -= 1
pair_list.append(array)
print(uf.unite(n-1,m-1))
main() | 23.978261 | 54 | 0.481414 |
e7e46d31c42a93c03c2df71128dd11ecc6e4322c | 3,289 | py | Python | lib/misc.py | cripplet/langmuir-hash | 5b4aa8e705b237704dbb99fbaa89af8cc2e7a8b5 | [
"MIT"
] | null | null | null | lib/misc.py | cripplet/langmuir-hash | 5b4aa8e705b237704dbb99fbaa89af8cc2e7a8b5 | [
"MIT"
] | null | null | null | lib/misc.py | cripplet/langmuir-hash | 5b4aa8e705b237704dbb99fbaa89af8cc2e7a8b5 | [
"MIT"
] | null | null | null | # custom libs
from lib.args import getConf
# Python libs
from re import sub
from os import mkdir
from os.path import exists
from getpass import getuser
from socket import gethostname
def genFrame(file):
from classes.frame import Frame
from lib.array import getGrid
grid = getGrid(file)
return(Frame(len(grid[0]), len(grid), 0, grid))
# given an int (treated as binary list), generate all unique rotational permutations of int (circular shifts)
# http://bit.ly/GLdKmI
def genPermutations(i, width):
permutations = list()
for j in range(width):
permutations.append(i)
# (i & 1) << (width - 1) advances the end bit to the beginning of the binary string
i = (i >> 1) | ((i & 1) << (width - 1))
return(list(set(permutations)))
# given a string representation of a neighbor configuration, return the number of neighbors in the configuration
def getConfigNum(config):
return(len(filter(lambda x: x == "1", list(config))))
# makes a unique directory
def initDir(dir):
i = 0
tmpDir = dir
while(exists(tmpDir)):
i += 1
tmpDir = dir + "." + str(i)
mkdir(tmpDir)
return(tmpDir)
def pad(i, max):
maxLength = len(str(max))
return(str(i).zfill(maxLength))
def resolveBoundary(bound, coord):
if(coord < 0):
return(coord + bound)
if(coord > bound - 1):
return(coord - bound)
return(coord)
# given an array of lines:
# stripping lines that begin with "#"
# stripping the rest of a line with "#" in the middle
# stripping lines that end with ":"
# remove whitespace
def prep(file):
lines = list()
for line in file:
line = sub(r'\s', '', line.split("#")[0])
if((line != "") and (line[-1] != ":")):
lines.append(line)
return(lines)
# bin() format is "0bxxxxxx"
# [2:] strips "0b"
# [-width:] selects last < width > chars
def toBin(i, width):
return(bin(i)[2:][-width:].zfill(width))
# renders the configuration file
# def renderConfig(folder):
# if(folder[-1] != "/"):
# folder += "/"
# fp = open(folder + "config.conf", "r")
# s = "config file for " + folder[:-1] + ":\n\n"
# for line in fp:
# s += line
# return(s)
def renderConfig(name):
fp = open(name, "r")
s = "config file for " + name + ":\n\n"
for line in fp:
s += line
return(s)
# given a config file, output a CSV line
def renderCSV(simulation):
try:
open(simulation + "/conf.conf", "r")
except IOError as err:
return()
params = getConf(simulation + "/config.conf")
s = getuser() + "@" + gethostname() + ":" + simulation + ","
s += str(params["steps"]) + ","
s += str(params["dens"]) + ","
s += str(params["hori"]) + ","
s += str(params["diag"]) + ","
s += str(params["beta"]) + ","
s += str(params["energies"][0]["000000"]) + ","
s += str(params["energies"][1]["000001"]) + ","
s += str(params["energies"][2]["000011"]) + ","
s += str(params["energies"][2]["000101"]) + ","
s += str(params["energies"][2]["001001"]) + ","
s += str(params["energies"][3]["000111"]) + ","
s += str(params["energies"][3]["001011"]) + ","
s += str(params["energies"][3]["010011"]) + ","
s += str(params["energies"][3]["010101"]) + ","
s += str(params["energies"][4]["001111"]) + ","
s += str(params["energies"][4]["010111"]) + ","
s += str(params["energies"][4]["011011"]) + ","
s += str(params["energies"][5]["011111"]) + ","
s += str(params["energies"][6]["111111"])
return(s)
| 28.353448 | 112 | 0.617817 |
f56c6fd191fa78fec47808b6b0354aa2e8d3f834 | 1,449 | rs | Rust | src/screeps_ai/offer_manager/action/my_hook_impl.rs | yxwsbobo/screeps_src_rust | cddf310b9033d70c8cd1589804ab1497224a6a99 | [
"MIT"
] | null | null | null | src/screeps_ai/offer_manager/action/my_hook_impl.rs | yxwsbobo/screeps_src_rust | cddf310b9033d70c8cd1589804ab1497224a6a99 | [
"MIT"
] | null | null | null | src/screeps_ai/offer_manager/action/my_hook_impl.rs | yxwsbobo/screeps_src_rust | cddf310b9033d70c8cd1589804ab1497224a6a99 | [
"MIT"
] | null | null | null | //use screeps::{objects::*, Transferable};
//unsafe impl Transferable for RoomObject {}
//unsafe impl Withdrawable for RoomObject {}
//unsafe impl Attackable for RoomObject {}
//unsafe impl HasStore for RoomObject {}
//unsafe impl HasId for RoomObject {}
//unsafe impl StructureProperties for RoomObject {}
//unsafe impl CanStoreEnergy for RoomObject {}
//unsafe impl HasCooldown for RoomObject {}
//unsafe impl CanDecay for RoomObject {}
//unsafe impl OwnedStructureProperties for RoomObject {}
//creep_simple_concrete_action! {
// (_attack_controller(RoomObject) -> attackController),
// (_build(RoomObject) -> build),
// (_claim_controller(RoomObject) -> claimController),
// (_generate_safe_mode(RoomObject) -> generateSafeMode),
// (_harvest(RoomObject) -> harvest),
// (_heal(RoomObject) -> heal),
// (_pickup(RoomObject) -> pickup),
// (_ranged_heal(RoomObject) -> rangedHeal),
// (_reserve_controller(RoomObject) -> reserveController),
// (_upgrade_controller(RoomObject) -> upgradeController),
//}
//
//impl RoomObject {
// pub fn energy_full(&self) -> bool {
// js_unwrap! { @{self.as_ref()}.energy === @{self.as_ref()}.energyCapacity }
// }
//
// pub fn energy_empty(&self) -> bool {
// js_unwrap! { @{self.as_ref()}.energy === 0 }
// }
//
// pub fn build_over(&self) -> bool {
// js_unwrap! { @{self.as_ref()}.progress === @{self.as_ref()}.progressTotal }
// }
//}
| 35.341463 | 85 | 0.665286 |
0b95ab4e62401288fe9f479867e2cab6f6c5d09c | 373 | py | Python | tests/conftest.py | scottmanderson/minerva | fe6a6857d892d9c7d881701c91990d9697bde00e | [
"MIT"
] | null | null | null | tests/conftest.py | scottmanderson/minerva | fe6a6857d892d9c7d881701c91990d9697bde00e | [
"MIT"
] | null | null | null | tests/conftest.py | scottmanderson/minerva | fe6a6857d892d9c7d881701c91990d9697bde00e | [
"MIT"
] | null | null | null | import pytest
from app import create_app, db
from config import TestConfig
@pytest.fixture
def test_client():
flask_app = create_app(TestConfig)
with flask_app.test_client() as testing_client:
with flask_app.app_context():
yield testing_client
@pytest.fixture
def init_database(test_client):
db.create_all()
yield
db.drop_all()
| 18.65 | 51 | 0.72118 |
18127c90dba9ee39967f4f6b45a5051345c025a2 | 178 | rs | Rust | question13/src/main.rs | masahikokawai/rust_compile_challenge | 3b13f2ab71adcbc761bab3790110832fe1ce0709 | [
"MIT"
] | null | null | null | question13/src/main.rs | masahikokawai/rust_compile_challenge | 3b13f2ab71adcbc761bab3790110832fe1ce0709 | [
"MIT"
] | null | null | null | question13/src/main.rs | masahikokawai/rust_compile_challenge | 3b13f2ab71adcbc761bab3790110832fe1ce0709 | [
"MIT"
] | null | null | null | // personが出力できるように構造体だけ修正してください
#[derive(Debug)]
struct Person<'a> {
name: &'a str,
}
fn main() {
let person = Person { name: "zakku" };
println!("{:?}", person);
}
| 16.181818 | 42 | 0.578652 |
22d691563196c8b157757c1535f94599a8af4454 | 4,333 | c | C | AED2/FinalProject/ABB/ABB.c | matheuscr30/UFU | e947e5a4ccd5c025cb8ef6e00b42ea1160742712 | [
"MIT"
] | null | null | null | AED2/FinalProject/ABB/ABB.c | matheuscr30/UFU | e947e5a4ccd5c025cb8ef6e00b42ea1160742712 | [
"MIT"
] | 11 | 2020-01-28T22:59:24.000Z | 2022-03-11T23:59:04.000Z | AED2/FinalProject/ABB/ABB.c | matheuscr30/UFU | e947e5a4ccd5c025cb8ef6e00b42ea1160742712 | [
"MIT"
] | null | null | null | #include <stdio.h>
#include <stdlib.h>
#include "ABB.h"
Arv cria_vazia()
{
return NULL;
}
void libera_arvore(Arv *A)
{
if (A != NULL)
{
libera_arvore(&(*A)->sae);
libera_arvore(&(*A)->sad);
free(*A);
}
A = NULL;
}
void exibe_arvore(Arv A)
{
if (A == NULL)
printf("<>");
printf("<");
printf("%d", A->info.idade);
exibe_arvore(A->sae);
exibe_arvore(A->sad);
printf(">");
}
void exibe_ordenado(Arv A)
{
if (A != NULL)
{
exibe_ordenado(A->sae);
printf("%d ", A->info.idade);
exibe_ordenado(A->sad);
}
}
int insere_ord(Arv *A, reg elem)
{
if (A == NULL)
return 0;
if (*A == NULL)
{
Arv novo = (Arv)malloc(sizeof(struct no));
if (novo == NULL)
return 0;
novo->info = elem;
novo->sae = NULL;
novo->sad = NULL;
*A = novo;
return 1;
}
if (elem.idade > (*A)->info.idade)
return insere_ord(&(*A)->sad, elem);
else
return insere_ord(&(*A)->sae, elem);
}
int remove_ord(Arv *A, int idade)
{
if (A == NULL || (*A) == NULL)
return 0;
if (idade > (*A)->info.idade)
remove_ord(&(*A)->sad, idade);
else if (idade < (*A)->info.idade)
remove_ord(&(*A)->sae, idade);
else
{
if ((*A)->sae == NULL && (*A)->sad == NULL) //Nó folha
{
free(*A);
A = NULL;
return 1;
}
else if ((*A)->sae != NULL && (*A)->sad == NULL) //Nó com 1 filho a esquerda
{
Arv aux = (*A);
A = &aux->sae;
free(aux);
return 1;
}
else if ((*A)->sae == NULL && (*A)->sad != NULL) //Nó com 1 filho a direita
{
Arv aux = (*A);
A = &aux->sad;
free(aux);
return 1;
}
else //Nó com 2 filhos
{
Arv aux = (*A)->sae;
while(aux->sad != NULL)
{
aux = aux->sad;
}
reg temp = (*A)->info;
(*A)->info = aux->info;
aux->info = temp;
return remove_ord(&(*A)->sae, idade);
}
}
}
Arv busca_bin(Arv A, int idade)
{
if (A == NULL)
return NULL;
if (A->info.idade == idade)
return A;
else if (idade > A->info.idade)
return busca_bin(A->sad, idade);
else
return busca_bin(A->sae, idade);
}
reg* maior(Arv A){
if (A == NULL) return NULL;
else if (A->sae == NULL && A->sad == NULL) return &A->info;
else if (A->sae != NULL && A->sad == NULL) return &A->info;
else if (A->sae == NULL && A->sad != NULL) return maior(A->sad);
else
{
return maior(A->sad);
}
}
int de_maior(Arv A){
if (A == NULL) return 0;
else if (A->sae == NULL && A->sad == NULL){
if (A->info.idade >= 18) return 1;
else return 0;
}
else if (A->sae != NULL && A->sad == NULL)
{
if (A->info.idade >= 18) return 1 + de_maior(A->sae);
else return de_maior(A->sae);
}
else if (A->sae == NULL && A->sad != NULL)
{
if (A->info.idade >= 18) return 1 + de_maior(A->sad);
else return de_maior(A->sad);
}
else{
if (A->info.idade >= 18) return 1 + de_maior(A->sae) + de_maior(A->sad);
else return de_maior(A->sae) + de_maior(A->sad);
}
}
int qtde_nos(Arv A, int ini, int fim){
if (A == NULL) return 0;
else if (A->sae == NULL && A->sad == NULL){
if (A->info.idade >= ini && A->info.idade <= fim) return 1;
else return 0;
}
else if (A->sae != NULL && A->sad == NULL)
{
if (A->info.idade >= ini && A->info.idade <= fim) return 1 + qtde_nos(A->sae, ini, fim);
else return qtde_nos(A->sae, ini, fim);
}
else if (A->sae == NULL && A->sad != NULL)
{
if (A->info.idade >= ini && A->info.idade <= fim) return 1 + qtde_nos(A->sad, ini, fim);
else return qtde_nos(A->sad, ini, fim);
}
else{
if (A->info.idade >= ini && A->info.idade <= fim) return 1 + qtde_nos(A->sae, ini, fim) + qtde_nos(A->sad, ini, fim);
else return qtde_nos(A->sae, ini, fim) + qtde_nos(A->sad, ini, fim);
}
}
void juntarAux(Arv A, Arv A2){
if (A == NULL) return;
else if (A->sae == NULL && A->sad == NULL) insere_ord(&A2, A->info);
else if (A->sae != NULL && A->sad == NULL){
insere_ord(&A2, A->info);
juntarAux(A->sae, A2);
}
else if (A->sae == NULL && A->sad != NULL){
insere_ord(&A2, A->info);
juntarAux(A->sad, A2);
}
else{
insere_ord(&A2, A->info);
juntarAux(A->sae, A2);
juntarAux(A->sad, A2);
}
}
Arv juntar(Arv A1, Arv A2){
juntarAux(A1, A2);
return A2;
}
| 20.535545 | 121 | 0.519963 |
25c51ba65a0da4e79572a21a54851de8b97e2028 | 992 | lua | Lua | jyx2/data/lua/jygame/ka33.lua | Leo-YJL/jynew | 66fbefb65e8dee8b0ea17611e98d36d9d83cd3c3 | [
"MIT"
] | null | null | null | jyx2/data/lua/jygame/ka33.lua | Leo-YJL/jynew | 66fbefb65e8dee8b0ea17611e98d36d9d83cd3c3 | [
"MIT"
] | null | null | null | jyx2/data/lua/jygame/ka33.lua | Leo-YJL/jynew | 66fbefb65e8dee8b0ea17611e98d36d9d83cd3c3 | [
"MIT"
] | null | null | null | if InTeam(1) == false then goto label0 end;
Talk(3, "胡斐,你准备好了吗?", "talkname3", 0);
if AskBattle() == true then goto label1 end;
do return end;
::label1::
if TryBattle(4) == false then goto label2 end;
LightScence();
Talk(3, "不错,你有这样的武艺,你爹也可放心了.来,把我杀了,替你爹报仇.", "talkname3", 0);
Talk(1, "兄弟,我们走吧.仇我已经报了.", "talkname1", 1);
Talk(0, "对嘛!这才是我的好大哥.", "talkname0", 1);
Talk(3, "走之前,拿了这把冷月宝刀,这是一把适合你的宝刀.还有,这本书拿去吧,希望能帮小兄弟解决困难.", "talkname3", 0);
GetItem(116, 1);
GetItem(144, 1);
Talk(0, "呀呼!找到”飞狐外传”了", "talkname0", 1);
ModifyEvent(-2, -2, -2, -2, 34, -1, -1, -2, -2, -2, -2, -2, -2);--by fanyu 启动脚本34 场景24-编号8
AddEthics(2);
do return end;
::label2::
LightScence();
Talk(3, "再去好好琢磨琢磨.", "talkname3", 0);
do return end;
::label0::
Talk(3, "麻烦你转告胡斐,等他准备好了,可随时来找我.", "talkname3", 0);
do return end;
| 39.68 | 102 | 0.514113 |
d00f08109ab0bc768a950755ca35fca6cdefd797 | 199 | rb | Ruby | db/migrate/20200418095948_remove_unneeded_fields.rb | farisshajahan/coronaport | 076970a95dfa10d44c9e3c865d706ce5f4074740 | [
"MIT"
] | null | null | null | db/migrate/20200418095948_remove_unneeded_fields.rb | farisshajahan/coronaport | 076970a95dfa10d44c9e3c865d706ce5f4074740 | [
"MIT"
] | 48 | 2020-04-27T17:29:14.000Z | 2022-03-31T01:06:37.000Z | db/migrate/20200418095948_remove_unneeded_fields.rb | coronasafe/coronapoint | 7e835e1f6b9fbfd929ceb207fd6ddee4319e605b | [
"MIT"
] | 2 | 2020-04-28T08:36:09.000Z | 2021-04-12T20:17:50.000Z | class RemoveUnneededFields < ActiveRecord::Migration[6.0]
def change
drop_table :applications
drop_table :non_medical_reqs
drop_table :medical_reqs
drop_table :travellers
end
end
| 22.111111 | 57 | 0.768844 |
c66f5894b9952d7b2637d058310f90365ee56bcb | 308 | rb | Ruby | lib/rakefile/grep.rb | bendiken/rakefile | 574693a47a3436575fde44b92a8695a5369b9087 | [
"Unlicense"
] | 1 | 2016-05-09T12:05:59.000Z | 2016-05-09T12:05:59.000Z | lib/rakefile/grep.rb | bendiken/rakefile | 574693a47a3436575fde44b92a8695a5369b9087 | [
"Unlicense"
] | null | null | null | lib/rakefile/grep.rb | bendiken/rakefile | 574693a47a3436575fde44b92a8695a5369b9087 | [
"Unlicense"
] | null | null | null | def egrep(pattern, files)
Dir[files].each do |file|
File.open(file).readlines.each_with_index do |line, lineno|
puts "#{file}:#{lineno + 1}:#{line}" if line =~ pattern
end
end
end
desc 'Look for TODO and FIXME tags in the code base.'
task :todo do
egrep /#.*(FIXME|TODO)/, '**/*.rb'
end
| 23.692308 | 63 | 0.636364 |
9b8fc07ea11670c9fa21d2efd5d414f1fcbf25bb | 6,761 | js | JavaScript | www/js/app.js | raviatobjectz/udacity_Corporate_Dashboard | 21f7bcda6ddf58fdb2b387f18c6788f13d74eca1 | [
"MIT"
] | null | null | null | www/js/app.js | raviatobjectz/udacity_Corporate_Dashboard | 21f7bcda6ddf58fdb2b387f18c6788f13d74eca1 | [
"MIT"
] | null | null | null | www/js/app.js | raviatobjectz/udacity_Corporate_Dashboard | 21f7bcda6ddf58fdb2b387f18c6788f13d74eca1 | [
"MIT"
] | null | null | null | var app=angular.module('CorporateDashboard', ['ngMaterial', 'ngMessages', 'smart-table']);
app.controller('allTabs', function($scope, $timeout, $interval, $q, $filter) {
$scope.pageHeading = "XYZ Corporate Dashboard";
$scope.selectedMenu = 1;
google.charts.load('current', {packages: ['corechart', 'bar']});
$scope.homeView = function() {
$scope.pageHeading = "XYZ Corporate Dashboard";
$scope.selectedMenu = 1;
};
$scope.geoView = function() {
$scope.pageHeading = "GeoSpatial Employee Counts Dashboard";
$scope.selectedMenu = 2;
$timeout($scope.drawMap, 100);
$interval($scope.drawMap, 5000);
};
$scope.metricsView = function() {
$scope.pageHeading = "Key Metrics Dashboard";
$scope.selectedMenu = 3;
$timeout($scope.readCSV, 100);
$interval($scope.readCSV, 1000);
};
$scope.dataView = function() {
$scope.pageHeading = "Issue Dashboard";
$scope.selectedMenu = 4;
$scope.showDataView();
$interval($scope.showDataView, 1000);
};
$scope.map == null;
$scope.company = {};
$scope.customers = new Array();
$scope.drawMap = function() {
$.getScript("data/employee.json")
.done(function() {
$scope.company = companyVar;
if ($scope.map == null) {
$scope.map = new google.maps.Map(document.getElementById('map'), {
zoom: 1,
center: new google.maps.LatLng(0, 0),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
}
var markerClusterer = null;
$scope.markers = [];
for (i = 0; i < $scope.company.employees.length; i++){
for (j = 0; j < $scope.company.employees[i].Count; j++) {
var marker = new google.maps.Marker({
position: new google.maps.LatLng($scope.company.employees[i].LAT, $scope.company.employees[i].LON),
draggable: true
});
$scope.markers.push(marker);
}
}
markerClusterer = new MarkerClusterer($scope.map, $scope.markers, {
styles: [{
url: 'https://raw.githubusercontent.com/googlemaps/js-marker-clusterer/gh-pages/images/pin.png',
height: 48,
width: 30,
anchor: [-18, 0],
textColor: '#ffffff',
textSize: 10,
iconAnchor: [15, 48]
}]
});
});
};
$scope.openIssues = [];
$scope.closedIssues = [];
$scope.openIssuesCount = 0;
var month = new Array();
month[0] = "January";
month[1] = "February";
month[2] = "March";
month[3] = "April";
month[4] = "May";
var issueCounts = new Array();
var customerCounts = new Array();
for (var k = 0; k < month.length; k++) {
issueCounts[month[k]] = 0;
customerCounts[month[k]] = 0;
}
$scope.readCSV = function() {
//$scope.openIssuesCount = 0;
$scope.openIssues = [];
$scope.closedIssues = [];
for (var k = 0; k < month.length; k++) {
issueCounts[month[k]] = 0;
customerCounts[month[k]] = 0;
}
$.ajax({
type: "GET",
url: "data/issues.csv",
dataType: "text",
success: function(idata) {
var lines = idata.split("\n");
for (var i = 1; i < lines.length; i++) {
var columns = lines[i].split(',');
var d = new Date(columns[4]);
issueCounts[month[d.getMonth()]] = issueCounts[month[d.getMonth()]] + 1;
if (columns[5] == ' open') {
$scope.openIssues.push(lines[i])
}
if (columns[5] == ' closed') {
$scope.closedIssues.push(lines[i])
}
}
$scope.openIssuesCount = $scope.openIssues.length;
$scope.drawBarChart();
}
});
$.getScript("data/customer.json").done(function() {
$scope.customers = customerVar;
for(var a = 0; a < $scope.customers.length; a++) {
if ($scope.customers[a].Paying == 'YES') {
var d1 = new Date($scope.customers[a].Customer_From);
customerCounts[month[d1.getMonth()]] = customerCounts[month[d1.getMonth()]] + 1;
}
}
$scope.drawLineChart();
});
}
$scope.drawBarChart = function() {
$scope.data1 = new google.visualization.DataTable();
$scope.data1.addColumn('string', 'Month');
$scope.data1.addColumn('number', 'Issue Count');
$scope.data1.addRows([
[month[0], issueCounts[month[0]]],
[month[1], issueCounts[month[1]]],
[month[2], issueCounts[month[2]]],
[month[3], issueCounts[month[3]]],
[month[4], issueCounts[month[4]]]
]);
$scope.options = {
title: 'Issues over Time',
hAxis: {
title: '2016 Issues',
},
vAxis: {
title: '# of issues'
}
};
$scope.chart = new google.visualization.ColumnChart(
document.getElementById('chart_div'));
$scope.chart.draw($scope.data1, $scope.options);
}
$scope.drawLineChart = function() {
$scope.data2 = new google.visualization.DataTable();
$scope.data2.addColumn('string', 'Month');
$scope.data2.addColumn('number', 'Customer Count');
$scope.data2.addRows([
[month[0], customerCounts[month[0]]],
[month[1], customerCounts[month[1]]],
[month[2], customerCounts[month[2]]],
[month[3], customerCounts[month[3]]],
[month[4], customerCounts[month[4]]]
]);
$scope.options = {
title: 'Paying Customers Over Time',
curveType: 'function',
hAxis: {
title: '2016 Paying Customers',
},
vAxis: {
title: '# of Paying Costomers'
}
};
$scope.chart = new google.visualization.LineChart(
document.getElementById('chart_line'));
$scope.chart.draw($scope.data2, $scope.options);
}
$scope.rowCollection = [];
$scope.showDataView = function() {
$.ajax({
type: "GET",
url: "data/issues.csv",
dataType: "text",
success: function(fileData) {
var lines = fileData.split("\n");
$scope.rowCollection = [];
for (var b = 1; b < lines.length; b++) {
var columns = lines[b].split(',');
var rowVar = {
IssueNumber: parseInt(columns[0]),
Description: columns[1],
Company: columns[2],
Email: columns[3],
Open: columns[4],
Status: columns[5],
Close: columns[6],
Employee: columns[7]
};
$scope.rowCollection.push(rowVar);
}
$scope.$apply();
}
});
}
});
| 30.183036 | 115 | 0.533057 |
5bf4701edb2909ecc7507e98cdbf5f2b66c13172 | 5,548 | c | C | Code/Source/Game.c | polluks/Parrot | ef8ce4d3bbe76d1de8fcf3a1748d577e0cb11483 | [
"MIT"
] | null | null | null | Code/Source/Game.c | polluks/Parrot | ef8ce4d3bbe76d1de8fcf3a1748d577e0cb11483 | [
"MIT"
] | null | null | null | Code/Source/Game.c | polluks/Parrot | ef8ce4d3bbe76d1de8fcf3a1748d577e0cb11483 | [
"MIT"
] | null | null | null | /**
$Id: Game.c, 1.2 2020/05/07 08:54:00, betajaen Exp $
Parrot - Point and Click Adventure Game Player
==============================================
Copyright 2020 Robin Southern http://github.com/betajaen/parrot
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#include <Parrot/Parrot.h>
#include <Parrot/Archive.h>
#include <Parrot/Arena.h>
#include <Parrot/Requester.h>
#include <Parrot/Asset.h>
#include <Parrot/Room.h>
#include <Parrot/String.h>
#include <Parrot/Graphics.h>
#include <Parrot/Input.h>
#include "Asset.h"
#include <proto/exec.h>
#include <proto/dos.h>
struct ARCHIVE* GameArchive;
struct GAME_INFO* GameInfo;
struct PALETTE_TABLE* GamePalette;
struct PALETTE_TABLE* GameCursorPalette;
struct UNPACKED_ROOM GameRoom;
STATIC VOID Load(STRPTR path)
{
UWORD ii, roomNo;
WORD w, lw;
Busy();
/* Load all Start Object Tables */
for (ii = 0; ii < 16; ii++)
{
if (GameInfo->gi_StartTables[ii].tr_ClassType == 0)
break;
LoadObjectTable(&GameInfo->gi_StartTables[ii]);
}
/* Load and Use Start Palette */
if (0 == GameInfo->gi_StartPalette)
{
PARROT_ERR(
"Unable to start Game!\n"
"Reason: Starting Palette was None"
PARROT_ERR_INT("GAME_INFO::gi_StartPalette"),
GameInfo->gi_StartPalette
);
}
GamePalette = LoadAssetT(struct PALETTE_TABLE, ArenaGame, ARCHIVE_UNKNOWN, CT_PALETTE, GameInfo->gi_StartPalette, CHUNK_FLAG_ARCH_AGA);
if (NULL == GamePalette)
{
PARROT_ERR(
"Unable to start Game!\n"
"Reason: Starting Palette Table was not found"
PARROT_ERR_INT("GAME_INFO::gi_StartPalette"),
(ULONG)GameInfo->gi_StartCursorPalette
);
}
GfxLoadColours32(0, (ULONG*) &GamePalette->pt_Data[0]);
ArenaRollback(ArenaChapter);
ArenaRollback(ArenaRoom);
NotBusy();
}
EXPORT VOID GameStart(STRPTR path)
{
struct SCREEN_INFO screenInfo;
struct ROOM* room;
struct UNPACKED_ROOM uroom;
struct ENTRANCE entrance;
struct VIEW_LAYOUTS viewLayouts;
struct VIEW_LAYOUT* roomLayout;
struct VIEW_LAYOUT* verbLayout;
UBYTE ii;
GameArchive = NULL;
GameInfo = NULL;
GamePalette = NULL;
GameCursorPalette = NULL;
ArenaGame = NULL;
ArenaChapter = NULL;
ArenaRoom = NULL;
InitStackVar(struct UNPACKED_ROOM, uroom);
ArenaGame = ArenaOpen(16384, MEMF_CLEAR);
ArenaChapter = ArenaOpen(131072, MEMF_CLEAR);
ArenaRoom = ArenaOpen(131072, MEMF_CLEAR);
InitialiseArchives(path);
GameArchive = OpenArchive(0);
if (GameArchive == NULL)
{
ErrorF("Did not open Game Archive");
}
GameInfo = LoadAssetT(struct GAME_INFO, ArenaGame, ARCHIVE_GLOBAL, CT_GAME_INFO, 1, CHUNK_FLAG_ARCH_ANY);
if (GameInfo == NULL)
{
ErrorF("Did not load Game Info");
}
CloseArchive(0);
#if 0
screenInfo.si_Width = GameInfo->gi_Width;
screenInfo.si_Height = 128; // GameInfo->gi_Height;
screenInfo.si_Depth = GameInfo->gi_Depth;
screenInfo.si_Flags = 0;
screenInfo.si_Left = 0;
screenInfo.si_Top = 0;
screenInfo.si_Title = &GameInfo->gi_Title[0];
ScreenOpen(0, &screenInfo);
ScreenLoadPaletteTable(0, &DefaultPalette);
ScreenClose(0);
#else
viewLayouts.v_NumLayouts = 2;
viewLayouts.v_Width = GameInfo->gi_Width;
viewLayouts.v_Height = GameInfo->gi_Height;
viewLayouts.v_Left = 0;
viewLayouts.v_Top = 0;
roomLayout = &viewLayouts.v_Layouts[0];
verbLayout = &viewLayouts.v_Layouts[1];
roomLayout->vl_Width = 320;
roomLayout->vl_Height = 128;
roomLayout->vl_BitMapWidth = 960;
roomLayout->vl_BitmapHeight = 128;
roomLayout->vl_Horizontal = 0;
roomLayout->vl_Vertical = 0;
roomLayout->vl_Depth = 4;
verbLayout->vl_Width = 320;
verbLayout->vl_Height = 70;
verbLayout->vl_BitMapWidth = 320;
verbLayout->vl_BitmapHeight = 70;
verbLayout->vl_Horizontal = 0;
verbLayout->vl_Vertical = 130;
verbLayout->vl_Depth = 2;
GfxInitialise();
GfxOpen(&viewLayouts);
GfxShow();
Load(path);
ArenaRollback(ArenaChapter);
InputInitialise();
entrance.en_Room = 3; // GameInfo->gi_StartRoom;
entrance.en_Exit = 0;
while (entrance.en_Room != 0 && InEvtForceQuit == FALSE)
{
ArenaRollback(ArenaRoom);
/* Start First Room */
PlayRoom(0, &entrance, GameInfo);
}
InputExit();
GfxHide();
GfxClose();
#endif
CloseArchives();
ArenaClose(ArenaRoom);
ArenaClose(ArenaChapter);
ArenaClose(ArenaGame);
}
EXPORT VOID GameDelayTicks(UWORD ticks)
{
Delay(ticks);
}
EXPORT VOID GameDelaySeconds(UWORD seconds)
{
Delay(seconds * 50);
}
| 24.121739 | 137 | 0.706741 |
80bbb840c30eea5d582f62f48dc9f307e64e6179 | 2,713 | kt | Kotlin | app/src/main/java/com/vjgarcia/chucknorrisjokes/presentation/JokesStore.kt | vjgarciag96/chuck-norris-jokes | 2914428c1a986148e1b19ef060682c85d146f2ca | [
"MIT"
] | null | null | null | app/src/main/java/com/vjgarcia/chucknorrisjokes/presentation/JokesStore.kt | vjgarciag96/chuck-norris-jokes | 2914428c1a986148e1b19ef060682c85d146f2ca | [
"MIT"
] | null | null | null | app/src/main/java/com/vjgarcia/chucknorrisjokes/presentation/JokesStore.kt | vjgarciag96/chuck-norris-jokes | 2914428c1a986148e1b19ef060682c85d146f2ca | [
"MIT"
] | 1 | 2020-06-15T21:12:54.000Z | 2020-06-15T21:12:54.000Z | package com.vjgarcia.chucknorrisjokes.presentation
import com.jakewharton.rxrelay2.BehaviorRelay
import com.jakewharton.rxrelay2.PublishRelay
import com.vjgarcia.chucknorrisjokes.domain.*
import com.vjgarcia.chucknorrisjokes.presentation.model.JokesEffects
import com.vjgarcia.chucknorrisjokes.presentation.model.JokesModel
import com.vjgarcia.chucknorrisjokes.presentation.model.JokesState
import com.vjgarcia.chucknorrisjokes.presentation.reducer.JokesReducer
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.disposables.Disposable
import io.reactivex.functions.BiFunction
class JokesStore(
private val jokesReducer: JokesReducer,
private val loadInitialMiddleware: LoadInitialMiddleware,
private val loadNextMiddleware: LoadNextMiddleware,
private val refreshMiddleware: RefreshMiddleware,
private val filterJokesMiddleware: FilterJokesMiddleware
) {
private val stateRelay = BehaviorRelay.createDefault<JokesState>(JokesState.Loading)
private val effectRelay = PublishRelay.create<JokesEffects>()
private val actionsRelay = PublishRelay.create<JokesAction>()
private val actionResultsRelay = PublishRelay.create<JokesActionResult>()
fun wire(): Disposable {
val disposable = CompositeDisposable()
actionResultsRelay
.withLatestFrom(stateRelay, BiFunction<JokesActionResult, JokesState, JokesModel> { actionResult, state ->
jokesReducer.reduce(state, actionResult)
})
.distinctUntilChanged()
.subscribe { (state, effect) ->
stateRelay.accept(state)
effectRelay.accept(effect)
}
.let(disposable::add)
Observable.merge(
loadInitialMiddleware.bind(actionsRelay),
loadNextMiddleware.bind(actionsRelay),
refreshMiddleware.bind(actionsRelay),
filterJokesMiddleware.bind(actionsRelay, stateRelay)
)
.subscribe(actionResultsRelay::accept)
.let(disposable::add)
return disposable
}
fun bind(
actions: Observable<JokesAction>,
render: (JokesState) -> Unit,
executeEffects: (JokesEffects) -> Unit
): Disposable {
val disposable = CompositeDisposable()
stateRelay.distinctUntilChanged().observeOn(AndroidSchedulers.mainThread()).subscribe(render).let(disposable::add)
effectRelay.observeOn(AndroidSchedulers.mainThread()).subscribe(executeEffects).let(disposable::add)
actions.subscribe(actionsRelay::accept).let(disposable::add)
return disposable
}
} | 41.106061 | 122 | 0.733137 |
bbf03dfbc0597b6c02e1710339fe0b5ae74c8343 | 1,984 | rs | Rust | crates/cli/src/main.rs | GODcoin/GODcoin-rs | 73065ded9917896c26040c388b88f26f4367768e | [
"MIT"
] | 3 | 2018-09-17T05:34:00.000Z | 2019-05-30T07:36:20.000Z | crates/cli/src/main.rs | GODcoin/GODcoin-rs | 73065ded9917896c26040c388b88f26f4367768e | [
"MIT"
] | 2 | 2018-10-26T23:33:50.000Z | 2019-05-23T22:28:44.000Z | crates/cli/src/main.rs | GODcoin/GODcoin-rs | 73065ded9917896c26040c388b88f26f4367768e | [
"MIT"
] | null | null | null | use clap::{App, AppSettings, Arg, SubCommand};
use std::{
env,
path::{Path, PathBuf},
};
mod keypair;
mod wallet;
use self::keypair::*;
use self::wallet::*;
fn main() {
godcoin::init().unwrap();
let app = App::new("godcoin")
.about("GODcoin core CLI")
.version(env!("CARGO_PKG_VERSION"))
.setting(AppSettings::VersionlessSubcommands)
.setting(AppSettings::SubcommandRequiredElseHelp)
.subcommand(SubCommand::with_name("keygen").about("Generates a keypair"))
.subcommand(
SubCommand::with_name("wallet")
.about("Opens the GODcoin CLI wallet")
.arg(
Arg::with_name("node_url")
.long("node-url")
.default_value("ws://localhost:7777")
.empty_values(false)
.help("Connects to the following node"),
),
);
let matches = app.get_matches();
if matches.subcommand_matches("keygen").is_some() {
generate_keypair();
} else if let Some(matches) = matches.subcommand_matches("wallet") {
let home: PathBuf = {
let home = {
match env::var("GODCOIN_HOME") {
Ok(s) => PathBuf::from(s),
Err(_) => Path::join(&dirs::data_local_dir().unwrap(), "godcoin"),
}
};
if !Path::is_dir(&home) {
let res = std::fs::create_dir(&home);
res.unwrap_or_else(|_| panic!("Failed to create dir at {:?}", &home));
println!("Created GODcoin home at {:?}", &home);
} else {
println!("Found GODcoin home at {:?}", &home);
}
home
};
let url = matches.value_of("node_url").unwrap();
Wallet::new(home, url).start();
} else {
println!("Failed to match subcommand");
std::process::exit(1);
}
}
| 32.52459 | 86 | 0.503528 |
064dec3164bb80ee3b76d27fae203dbc8594db92 | 2,331 | rs | Rust | app/src-tauri/src/main.rs | arturh85/factorio-bot-tauri | 133aa25f8a42ff11dd019c9bfd70c96df8622f9e | [
"MIT"
] | 1 | 2021-05-19T20:58:32.000Z | 2021-05-19T20:58:32.000Z | app/src-tauri/src/main.rs | arturh85/factorio-bot-tauri | 133aa25f8a42ff11dd019c9bfd70c96df8622f9e | [
"MIT"
] | 102 | 2022-02-16T22:51:50.000Z | 2022-03-31T20:58:42.000Z | app/src-tauri/src/main.rs | arturh85/factorio-bot-tauri | 133aa25f8a42ff11dd019c9bfd70c96df8622f9e | [
"MIT"
] | null | null | null | #![warn(clippy::all, clippy::pedantic)]
#![cfg_attr(
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
#[macro_use]
extern crate paris;
mod commands;
mod constants;
use async_std::sync::{Arc, RwLock};
use async_std::task::JoinHandle;
use factorio_bot::cli::handle_cli;
use factorio_bot_core::process::process_control::InstanceState;
use factorio_bot_core::settings::AppSettings;
use miette::{DiagnosticResult, IntoDiagnostic};
use std::borrow::Cow;
fn app_settings() -> DiagnosticResult<AppSettings> {
let mut app_settings = AppSettings::load(constants::app_settings_path())?;
if app_settings.workspace_path == "" {
let s: String = constants::app_workspace_path().to_str().unwrap().into();
app_settings.workspace_path = Cow::from(s);
}
Ok(app_settings)
}
#[async_std::main]
async fn main() -> DiagnosticResult<()> {
color_eyre::install().unwrap();
handle_cli().await;
std::fs::create_dir_all(constants::app_data_dir())
.into_diagnostic("factorio::output_parser::could_not_canonicalize")?;
std::fs::create_dir_all(constants::app_workspace_path())
.into_diagnostic("factorio::output_parser::could_not_canonicalize")?;
info!("factorio-bot started");
let instance_state: Option<InstanceState> = None;
let restapi_handle: Option<JoinHandle<DiagnosticResult<()>>> = None;
#[allow(clippy::items_after_statements)]
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![
crate::commands::is_instance_started,
crate::commands::is_port_available,
crate::commands::load_script,
crate::commands::load_scripts_in_directory,
crate::commands::execute_rcon,
crate::commands::execute_script,
crate::commands::update_settings,
crate::commands::load_settings,
crate::commands::save_settings,
crate::commands::start_instances,
crate::commands::stop_instances,
crate::commands::start_restapi,
crate::commands::stop_restapi,
crate::commands::maximize_window,
crate::commands::file_exists,
crate::commands::open_in_browser,
])
.manage(Arc::new(RwLock::new(app_settings()?)))
.manage(Arc::new(RwLock::new(instance_state)))
.manage(RwLock::new(restapi_handle))
.run(tauri::generate_context!())
.expect("failed to run app");
Ok(())
}
| 34.279412 | 77 | 0.715573 |
0687f384625fbf470d66c72bf61985ba1b6189b9 | 5,004 | kt | Kotlin | atomicfu-transformer/src/main/kotlin/kotlinx/atomicfu/transformer/AsmUtil.kt | deepmedia/kotlinx.atomicfu | 450b056efa4c8e4f922f2a3f8d1958404513b1f7 | [
"Apache-2.0"
] | null | null | null | atomicfu-transformer/src/main/kotlin/kotlinx/atomicfu/transformer/AsmUtil.kt | deepmedia/kotlinx.atomicfu | 450b056efa4c8e4f922f2a3f8d1958404513b1f7 | [
"Apache-2.0"
] | null | null | null | atomicfu-transformer/src/main/kotlin/kotlinx/atomicfu/transformer/AsmUtil.kt | deepmedia/kotlinx.atomicfu | 450b056efa4c8e4f922f2a3f8d1958404513b1f7 | [
"Apache-2.0"
] | null | null | null | /*
* Copyright 2017-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
package kotlinx.atomicfu.transformer
import org.objectweb.asm.*
import org.objectweb.asm.Opcodes.*
import org.objectweb.asm.Type.*
import org.objectweb.asm.tree.*
import org.objectweb.asm.util.*
val AbstractInsnNode.line: Int?
get() {
var cur = this
while (true) {
if (cur is LineNumberNode) return cur.line
cur = cur.previous ?: return null
}
}
fun AbstractInsnNode.atIndex(insnList: InsnList?): String {
var cur = insnList?.first
var index = 1
while (cur != null && cur != this) {
if (!cur.isUseless()) index++
cur = cur.next
}
if (cur == null) return ""
return "inst #$index: "
}
val AbstractInsnNode.nextUseful: AbstractInsnNode?
get() {
var cur: AbstractInsnNode? = next
while (cur.isUseless()) cur = cur!!.next
return cur
}
val AbstractInsnNode?.thisOrPrevUseful: AbstractInsnNode?
get() {
var cur: AbstractInsnNode? = this
while (cur.isUseless()) cur = cur!!.previous
return cur
}
fun getInsnOrNull(from: AbstractInsnNode?, to: AbstractInsnNode?, predicate: (AbstractInsnNode) -> Boolean): AbstractInsnNode? {
var cur: AbstractInsnNode? = from?.next
while (cur != null && cur != to && !predicate(cur)) cur = cur.next
return cur
}
private fun AbstractInsnNode?.isUseless() = this is LabelNode || this is LineNumberNode || this is FrameNode
fun InsnList.listUseful(limit: Int = Int.MAX_VALUE): List<AbstractInsnNode> {
val result = ArrayList<AbstractInsnNode>(limit)
var cur = first
while (cur != null && result.size < limit) {
if (!cur.isUseless()) result.add(cur)
cur = cur.next
}
return result
}
fun AbstractInsnNode.isAload(index: Int) =
this is VarInsnNode && this.opcode == ALOAD && this.`var` == index
fun AbstractInsnNode.isGetField(owner: String) =
this is FieldInsnNode && this.opcode == GETFIELD && this.owner == owner
fun AbstractInsnNode.isGetStatic(owner: String) =
this is FieldInsnNode && this.opcode == GETSTATIC && this.owner == owner
fun AbstractInsnNode.isGetFieldOrGetStatic() =
this is FieldInsnNode && (this.opcode == GETFIELD || this.opcode == GETSTATIC)
fun AbstractInsnNode.isAreturn() =
this.opcode == ARETURN
fun AbstractInsnNode.isReturn() =
this.opcode == RETURN
fun AbstractInsnNode.isTypeReturn(type: Type) =
opcode == when (type) {
INT_TYPE -> IRETURN
LONG_TYPE -> LRETURN
BOOLEAN_TYPE -> IRETURN
else -> ARETURN
}
fun AbstractInsnNode.isInvokeVirtual() =
this.opcode == INVOKEVIRTUAL
@Suppress("UNCHECKED_CAST")
fun MethodNode.localVar(v: Int, node: AbstractInsnNode): LocalVariableNode? =
(localVariables as List<LocalVariableNode>).firstOrNull { it.index == v && verifyLocalVarScopeStart(v, node, it.start)}
// checks that the store instruction is followed by the label equal to the local variable scope start from the local variables table
private fun verifyLocalVarScopeStart(v: Int, node: AbstractInsnNode, scopeStart: LabelNode): Boolean {
var i = node.next
while (i != null) {
// check that no other variable is stored into the same slot v before finding the scope start label
if (i is VarInsnNode && i.`var` == v) return false
if (i is LabelNode && i === scopeStart) return true
i = i.next
}
return false
}
inline fun forVarLoads(v: Int, start: LabelNode, end: LabelNode, block: (VarInsnNode) -> AbstractInsnNode?) {
var cur: AbstractInsnNode? = start
while (cur != null && cur !== end) {
if (cur is VarInsnNode && cur.opcode == ALOAD && cur.`var` == v) {
cur = block(cur)
} else
cur = cur.next
}
}
fun nextVarLoad(v: Int, start: AbstractInsnNode): VarInsnNode {
var cur: AbstractInsnNode? = start
while (cur != null) {
when (cur.opcode) {
GOTO, TABLESWITCH, LOOKUPSWITCH, ATHROW, IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IFNULL, IFNONNULL,
IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ACMPEQ, IF_ACMPNE,
IRETURN, FRETURN, ARETURN, RETURN, LRETURN, DRETURN -> {
abort("Unsupported branching/control while searching for load of spilled variable #$v", cur)
}
ALOAD -> {
if ((cur as VarInsnNode).`var` == v) return cur
}
}
cur = cur.next
}
abort("Flow control falls after the end of the method while searching for load of spilled variable #$v")
}
fun accessToInvokeOpcode(access: Int) =
if (access and ACC_STATIC != 0) INVOKESTATIC else INVOKEVIRTUAL
fun AbstractInsnNode.toText(): String {
val printer = Textifier()
accept(TraceMethodVisitor(printer))
return (printer.getText()[0] as String).trim()
}
val String.ownerPackageName get() = substringBeforeLast('/')
| 33.810811 | 132 | 0.653477 |
08c75c6bd89142a65fb4a27874e2fcb8ee4b5c87 | 325 | sql | SQL | backend/de.metas.fresh/de.metas.fresh.base/src/main/sql/postgresql/system/70-de.metas.fresh/5512030_sys_purchase_invoice_perf_imrpovements.sql | dram/metasfresh | a1b881a5b7df8b108d4c4ac03082b72c323873eb | [
"RSA-MD"
] | 1,144 | 2016-02-14T10:29:35.000Z | 2022-03-30T09:50:41.000Z | backend/de.metas.fresh/de.metas.fresh.base/src/main/sql/postgresql/system/70-de.metas.fresh/5512030_sys_purchase_invoice_perf_imrpovements.sql | vestigegroup/metasfresh | 4b2d48c091fb2a73e6f186260a06c715f5e2fe96 | [
"RSA-MD"
] | 8,283 | 2016-04-28T17:41:34.000Z | 2022-03-30T13:30:12.000Z | backend/de.metas.fresh/de.metas.fresh.base/src/main/sql/postgresql/system/70-de.metas.fresh/5512030_sys_purchase_invoice_perf_imrpovements.sql | vestigegroup/metasfresh | 4b2d48c091fb2a73e6f186260a06c715f5e2fe96 | [
"RSA-MD"
] | 441 | 2016-04-29T08:06:07.000Z | 2022-03-28T06:09:56.000Z | DROP INDEX IF EXISTS m_hu_assignment_document_idx;
CREATE INDEX m_hu_assignment_document_idx
ON public.m_hu_assignment USING btree
(record_id, ad_table_id)
TABLESPACE pg_default;
COMMENT ON INDEX m_hu_assignment_document_idx
IS 'have record_id first, because it''s much, much more distinctive than ad_table_id';
| 36.111111 | 86 | 0.821538 |
1fa0440bda43dfbff4eb9a69b31b12a2e7f4b689 | 1,045 | html | HTML | manuscript/page-193/body.html | marvindanig/ecce-homo | 998a2f772c3378ff3cfe8f606fa205bf052177b8 | [
"BlueOak-1.0.0",
"CC-BY-4.0",
"Unlicense"
] | null | null | null | manuscript/page-193/body.html | marvindanig/ecce-homo | 998a2f772c3378ff3cfe8f606fa205bf052177b8 | [
"BlueOak-1.0.0",
"CC-BY-4.0",
"Unlicense"
] | null | null | null | manuscript/page-193/body.html | marvindanig/ecce-homo | 998a2f772c3378ff3cfe8f606fa205bf052177b8 | [
"BlueOak-1.0.0",
"CC-BY-4.0",
"Unlicense"
] | null | null | null | <div class="leaf flex"><div class="inner justify"><p class="no-indent ">thee all the speech and word shrines of the world, here would all existence become speech, here would all Becoming learn of thee how to speak.") This is my experience of inspiration. I do not doubt but that I should have to go back thousands of years before I could find another who could say to me: "It is mine also!"</p><p class=" stretch-last-line ">For a few weeks afterwards I lay an invalid in Genoa. Then followed a melancholy spring in Rome, where I only just managed to live—and this was no easy matter. This city, which is absolutely unsuited to the poet-author of <em>Zarathustra,</em> and for the choice of which I was not responsible, made me inordinately miserable. I tried to leave it. I wanted to go to Aquila—the opposite of Rome in every respect, and actually founded in a spirit of hostility towards that city, just as I also shall found a city some day, as a memento of an atheist and genuine enemy of the Church, a person very closely</p></div> </div> | 1,045 | 1,045 | 0.766507 |
d4642717f336993bdf72b8a6deb6a570cc41d3e7 | 1,398 | kt | Kotlin | app/src/main/java/com/lagradost/shiro/ui/MyMiniControllerFragment.kt | deceptions/no | 6f8d6a26f9cc380899582b4aa642fca9998a9d08 | [
"MIT"
] | 160 | 2021-09-13T15:25:41.000Z | 2022-03-31T17:01:31.000Z | app/src/main/java/com/lagradost/shiro/ui/MyMiniControllerFragment.kt | Redddtt/no | 45f132cd888ec6a4a6613b23cddc053f09103057 | [
"MIT"
] | 158 | 2021-09-14T15:54:21.000Z | 2022-03-31T14:56:39.000Z | app/src/main/java/com/lagradost/shiro/ui/MyMiniControllerFragment.kt | Redddtt/no | 45f132cd888ec6a4a6613b23cddc053f09103057 | [
"MIT"
] | 9 | 2021-09-16T23:56:35.000Z | 2022-03-19T04:23:14.000Z | package com.lagradost.shiro.ui
import android.os.Bundle
import android.view.View
import android.widget.LinearLayout
import android.widget.ProgressBar
import android.widget.RelativeLayout
import com.google.android.gms.cast.framework.media.widget.MiniControllerFragment
import com.jaredrummler.cyanea.Cyanea
import com.lagradost.shiro.R
import com.lagradost.shiro.utils.AppUtils.adjustAlpha
import com.lagradost.shiro.utils.AppUtils.getColorFromAttr
class MyMiniControllerFragment : MiniControllerFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
// SEE https://github.com/dandar3/android-google-play-services-cast-framework/blob/master/res/layout/cast_mini_controller.xml
try {
val progressBar: ProgressBar = view.findViewById(R.id.progressBar)
val containerAll: LinearLayout = view.findViewById(R.id.container_all)
containerAll.getChildAt(0)?.alpha = 0f // REMOVE GRADIENT
context?.let { ctx ->
progressBar.setBackgroundColor(adjustAlpha(Cyanea.instance.primary, 0.35f))
val params = RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, 2.toPx)
progressBar.layoutParams = params
}
} catch (e : Exception) {
// JUST IN CASE
}
}
} | 39.942857 | 133 | 0.723176 |
9c6b9d99a76cb6fde8a6ce4a84dda57e51191696 | 3,102 | js | JavaScript | src/js/pmz/pmz-utils.js | RomanGolovanov/ametro-editor | 5d323d91e4182c5b985220cc1fb8ea19a7365877 | [
"MIT"
] | 2 | 2016-09-16T07:55:41.000Z | 2018-09-03T14:45:20.000Z | src/js/pmz/pmz-utils.js | RomanGolovanov/ametro-editor | 5d323d91e4182c5b985220cc1fb8ea19a7365877 | [
"MIT"
] | 1 | 2018-09-05T22:44:05.000Z | 2018-09-05T22:44:05.000Z | src/js/pmz/pmz-utils.js | RomanGolovanov/ametro-editor | 5d323d91e4182c5b985220cc1fb8ea19a7365877 | [
"MIT"
] | 3 | 2018-09-05T23:14:38.000Z | 2020-06-29T23:09:57.000Z |
var PmzUtils = (function(){
'use strict';
function asInt(text){
return text && text!=='?' ? parseInt(text) : null;
}
function asArray(text){
if(!text) return [];
return text.split(',').map(function(item){
return item === '?' ? null : item;
});
}
function asIntArray(text){
return asArray(text).map(function(item){
if(!item) return null;
return parseInt(item);
});
}
function asFloatArray(text){
return asArray(text).map(function(item){
if(!item) return null;
return parseFloat(item);
});
}
return {
constants: {
DEFAULT_MAP_NAME: 'Metro.map',
DEFAULT_TRP_NAME: 'Metro.trp',
DEFAULT_LINE_COLOR: 'black'
},
asArray: asArray,
asIntArray: asIntArray,
asFloatArray: asFloatArray,
asPmzPointArray: function(text){
var values = asIntArray(text);
var points = [];
for(var i =0; i<(values.length-1); i+=2){
points.push(new PmzPoint(values[i],values[i+1]));
}
return points;
},
asPmzRectArray: function(text){
var values = asIntArray(text);
var rects = [];
for(var i =0; i<(values.length-3); i+=2){
rects.push(new PmzRect(values[i],values[i+1],values[i+2],values[i+3]));
}
return rects;
},
asPmzPoint: function(text){
var values = asIntArray(text);
return new PmzPoint(values[0],values[1]);
},
asPmzRect: function(text){
var values = asIntArray(text);
return new PmzRect(values[0],values[1],values[2],values[3]);
},
asAdditionalNodes: function(text){
var parts = asArray(text);
var line = parts[0];
var src = parts[1];
var dst = parts[2];
var isSpline = parts.length % 2 === 0;
var points = [];
for(var i=3;i<(parts.length-1); i+=2){
points.push(new PmzPoint(parseInt(parts[i]), parseInt(parts[i+1])));
}
return new PmzAdditionNodes(line, src, dst, points, isSpline);
},
asPmzTime: function(text){
if(!text || !text.length){
return null;
}
var parts = text.split('.');
return new PmzTime(asInt(parts[0]),
parts.length === 2 ? asInt(parts[1]) : null);
},
asColor: function(text){
if(!text || !text.length){
return null;
}
return '#' + text;
},
decodeWindows1251 : function (buffer){
var byteString = '';
buffer.forEach(function(b){
byteString = byteString + String.fromCharCode(b);
});
return windows1251.decode(byteString, { 'mode': 'fatal' });
},
encodeWindows1251 : function (text){
var asciiEncodedText = windows1251.encode(text);
var buffer = new Uint8Array(asciiEncodedText.length);
for(var i=0;i<asciiEncodedText.length;i++){
buffer[i] = asciiEncodedText.charCodeAt(i);
}
return buffer;
}
};
})(); | 26.288136 | 81 | 0.537073 |
9c662e20f4a0664c46bff2cc2da174f189da037b | 5,504 | js | JavaScript | src/pages/driverList/ViewDriver.js | tharshan24/we4us-web | 7c41cc668492e478fd35d19113f3a8756c7ef18f | [
"MIT"
] | null | null | null | src/pages/driverList/ViewDriver.js | tharshan24/we4us-web | 7c41cc668492e478fd35d19113f3a8756c7ef18f | [
"MIT"
] | null | null | null | src/pages/driverList/ViewDriver.js | tharshan24/we4us-web | 7c41cc668492e478fd35d19113f3a8756c7ef18f | [
"MIT"
] | null | null | null | import { useState, useEffect } from "react";
import {
// CalendarToday,
LocationSearching,
MailOutline,
PermIdentity,
PhoneAndroid,
// Publish,
} from "@material-ui/icons";
import FeaturedPlayListIcon from '@mui/icons-material/FeaturedPlayList';
import { useParams, useHistory } from "react-router-dom";
// import { Link } from "react-router-dom";
import "../notification/user.css";
import http from "../../services/httpService";
import { CircularProgress, Snackbar } from "@material-ui/core";
import { Alert } from "@mui/material";
export default function ViewDriver() {
const history = useHistory();
const [driver, setDriver] = useState();
const [loading, setLoading] = useState(true);
const [isSuccess, setIsSuccess] = useState(false);
const { userId } = useParams();
useEffect(() => {
const fetchDriver = async () => {
setLoading(true);
const { data } = await http.get(`/admin/viewDriverById/${userId}`);
setDriver(data.result.row[0]);
console.log(data.result.row[0]);
setLoading(false);
};
fetchDriver();
}, []);
const handleDriverStatus = async (status) => {
try {
await http.get(`/admin/updateDriverStatus/${userId}/${status}`);
setIsSuccess(true);
} catch (e) {
console.log(e);
}
};
if (loading)
return (
<div
style={{
width: "100%",
display: "flex",
justifyContent: "center",
}}
>
<CircularProgress />
</div>
);
return (
<div className="user">
<Snackbar
open={isSuccess}
anchorOrigin={{ vertical: "top", horizontal: "right" }}
onClose={() => {
setIsSuccess(false);
history.goBack();
}}
>
<Alert severity="success" sx={{ width: "100%" }}>
Successfully updated the status
</Alert>
</Snackbar>
;
<div className="userTitleContainer">
<h1 className="userTitle">DETAILS</h1>
</div>
<div className="userContainer">
<div className="userShow">
<div className="userShowTop">
{driver.profile_picture_path && (
<img src={driver.profile_picture_path.split(" ")[0]} height={50} width={50} />
)}
<div className="userShowTopTitle">
<span className="userShowUsername">{`${driver.first_name} ${driver.last_name}`}</span>
</div>
</div>
<div className="userShowBottom">
<span className="userShowTitle">Account Details</span>
<div className="userShowInfo">
<PermIdentity className="userShowIcon" />
<span className="userShowInfoTitle">{driver.user_name}</span>
</div>
<div className="userShowInfo">
<FeaturedPlayListIcon className="userShowIcon" />
<span className="userShowInfoTitle">{driver.license_no}</span>
</div>
<span className="userShowTitle">Contact Details</span>
<div className="userShowInfo">
<PhoneAndroid className="userShowIcon" />
<span className="userShowInfoTitle">{driver.mobile_number}</span>
</div>
<div className="userShowInfo">
<MailOutline className="userShowIcon" />
<span className="userShowInfoTitle">{driver.email}</span>
</div>
<div className="userShowInfo">
<LocationSearching className="userShowIcon" />
<span className="userShowInfoTitle">{driver.name_en}</span>
</div>
</div>
</div>
<div className="userUpdate">
<span className="userUpdateTitle">Description</span>
<div className="userShowBottom"></div>
<div className="img1">
{driver.license_proof_path && (
<img src={driver.license_proof_path.split(" ")[0]} height={250} width={300} />
)}
<span
style={{
textAlign: "center",
color: "#ffff",
fontSize: 32,
fontWeight: 600,
}}
> ...
</span>
{/* </div>
<div className="img2"> */}
{driver.license_proof_path && (
<img src={driver.vehicle_book_proof.split(" ")[0]} height={250} width={300} />
)}
</div>
<div className="userUpdateRight">
{/* <button
className="userUpdateButton1"
onClick={() => handleDriverStatus(1)}
>
Accept
</button>
</div>
<div className="userUpdateRight">
<button
className="userUpdateButton2"
onClick={() => handleDriverStatus(0)}
>
Reject
</button> */}
{loading ? driver.status===1(
<button className="userUpdateButton1"
onClick={e =>
window.confirm("Are you sure you wish to accept") &&
handleDriverStatus(0)
} >
Confirm
</button>
): <button className="userUpdateButton1"
onClick={e =>
window.confirm("Are you sure you wish to cancle") &&
handleDriverStatus(1)
} >
Cancel
</button>
}
</div>
</div>
</div>
</div>
);
}
| 30.921348 | 100 | 0.525981 |
4d98a040b542a9a83b85c4a68ec2d6b99c52dfab | 466 | html | HTML | primeiro_teste/numeros_um_a_cem.html | wtomalves/logica_programacao_inicial_1 | 2f4697b322780a5332413473ac143951d7ac70f3 | [
"MIT"
] | null | null | null | primeiro_teste/numeros_um_a_cem.html | wtomalves/logica_programacao_inicial_1 | 2f4697b322780a5332413473ac143951d7ac70f3 | [
"MIT"
] | null | null | null | primeiro_teste/numeros_um_a_cem.html | wtomalves/logica_programacao_inicial_1 | 2f4697b322780a5332413473ac143951d7ac70f3 | [
"MIT"
] | null | null | null | <!DOCTYPE html>
<html lang="pt">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Um a Cem</title>
</head>
<body>
<script>
function pulaLinha(){
document.write("<br>")
}
function mostra(frase) {
document.write(frase);
pulaLinha();
}
var um = 2
var cem = 100
while (um <= cem) {
mostra(um)
um += 2
}
</script>
</body>
</html>
| 14.5625 | 72 | 0.538627 |
f5e7cc14776d08d1d9150097d9f61adfe56286de | 8,809 | swift | Swift | Raiblocks/New User Experience/SeedConfirmationViewController.swift | sarmadmakhdoom/nano-wallet-ios | 5c8d2578003a86f56dbfeb7186a17002de32a8f3 | [
"BSD-2-Clause"
] | null | null | null | Raiblocks/New User Experience/SeedConfirmationViewController.swift | sarmadmakhdoom/nano-wallet-ios | 5c8d2578003a86f56dbfeb7186a17002de32a8f3 | [
"BSD-2-Clause"
] | null | null | null | Raiblocks/New User Experience/SeedConfirmationViewController.swift | sarmadmakhdoom/nano-wallet-ios | 5c8d2578003a86f56dbfeb7186a17002de32a8f3 | [
"BSD-2-Clause"
] | null | null | null | //
// SeedConfirmationViewController.swift
// Nano
//
// Created by Zack Shapiro on 1/19/18.
// Copyright © 2018 Nano Wallet Company. All rights reserved.
//
import UIKit
import LocalAuthentication
import MobileCoreServices
import Cartography
import Fabric
class SeedConfirmationViewController: UIViewController {
private var credentials: Credentials
private var seedWasCopied = false
private weak var textView: UITextView?
init() {
guard let credentials = Credentials(seed: RaiCore().createSeed()) else {
AnalyticsEvent.trackCustomException("Credential Creation Failed")
fatalError()
}
self.credentials = credentials
UserService().store(credentials: credentials)
super.init(nibName: nil, bundle: nil)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override var prefersStatusBarHidden: Bool { return true }
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
let appDelegate = UIApplication.shared.delegate as! AppDelegate
if !appDelegate.devConfig.skipLegal {
if !credentials.hasCompletedLegalAgreements {
let vc = LegalViewController(useForLoggedInState: false)
vc.delegate = self
present(vc, animated: false)
}
}
}
override func viewWillDisappear(_ animated: Bool) {
if let credentials = UserService().fetchCredentials(), credentials.hasCompletedLegalAgreements {
self.navigationController?.setNavigationBarHidden(false, animated: animated)
}
super.viewWillDisappear(animated)
}
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
let logo = UIImageView(image: UIImage(named: "largeNanoMarkBlue"))
view.addSubview(logo)
constrain(logo) {
$0.top == $0.superview!.top + CGFloat(44)
$0.centerX == $0.superview!.centerX
}
let titleLabel = UILabel()
titleLabel.text = "Your SellCoin Wallet Seed"
titleLabel.textColor = Styleguide.Colors.darkBlue.color
titleLabel.font = Styleguide.Fonts.nunitoRegular.font(ofSize: 20)
view.addSubview(titleLabel)
constrain(titleLabel, logo) {
$0.centerX == $1.centerX
$0.top == $1.bottom + CGFloat(20)
}
let button = NanoButton(withType: .lightBlue)
button.addTarget(self, action: #selector(continueButtonWasPressed), for: .touchUpInside)
button.setAttributedTitle("I Understand, Continue", withKerning: 0.8)
view.addSubview(button)
constrain(button) {
$0.centerX == $0.superview!.centerX
$0.bottom == $0.superview!.bottom - CGFloat((isiPhoneX() ? 34 : 20))
$0.width == $0.superview!.width * CGFloat(0.8)
$0.height == CGFloat(55)
}
let textView = UITextView()
textView.text = credentials.seed
textView.isEditable = false
textView.layer.cornerRadius = 3
textView.font = UIFont.systemFont(ofSize: 14, weight: .regular)
textView.clipsToBounds = true
textView.textColor = .white
textView.backgroundColor = Styleguide.Colors.darkBlue.color
textView.tintColor = Styleguide.Colors.lightBlue.color
textView.textAlignment = .center
textView.returnKeyType = .done
textView.isScrollEnabled = false
if isiPhoneSE() {
textView.textContainerInset = UIEdgeInsets(top: 15, left: 20, bottom: 12, right: 20)
} else {
textView.textContainerInset = UIEdgeInsets(top: 15, left: 30, bottom: 12, right: 30)
}
textView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(copySeed)))
view.addSubview(textView)
constrain(textView, button) {
$0.height == CGFloat(80)
$0.bottom == $1.top - CGFloat(33)
$0.width == $1.width
$0.centerX == $1.centerX
}
self.textView = textView
let smallCopy = UILabel()
smallCopy.font = Styleguide.Fonts.notoSansRegular.font(ofSize: 14)
smallCopy.textColor = Styleguide.Colors.darkBlue.color
smallCopy.attributedText = NSAttributedString(string: "Tap to copy", attributes: [.kern: 1.0])
view.addSubview(smallCopy)
constrain(smallCopy, textView) {
$0.centerX == $1.centerX
$0.top == $1.bottom + CGFloat(6)
}
let textBody = UITextView()
textBody.textAlignment = .left
textBody.isUserInteractionEnabled = true
textBody.isEditable = false
textBody.isSelectable = false
let attributedText = NSMutableAttributedString(string: "Your CellCoin Wallet Seed is a unique code that enables you to access your wallet on the CellCoin network.\n\nIt is the only way for you to recover your wallet and access any CellCoin currency you may have.\n\nWe do not have access to it and cannot recover your Wallet Seed or any funds in your wallet without your Wallet Seed.\n\nYou are solely responsible for recording your Wallet Seed in a safe and secure place and manner. Never share your Wallet Seed with anyone.")
attributedText.addAttribute(.foregroundColor, value: Styleguide.Colors.darkBlue.color, range: NSMakeRange(0, attributedText.length))
attributedText.addAttribute(.font, value: Styleguide.Fonts.nunitoRegular.font(ofSize: 16), range: NSMakeRange(0, attributedText.length))
attributedText.addAttribute(.foregroundColor, value: Styleguide.Colors.red.color, range: NSMakeRange(204, 119)) // Middle sentence "We do not have access..."
attributedText.addAttribute(.foregroundColor, value: Styleguide.Colors.red.color, range: NSMakeRange(attributedText.length - 42, 42)) // last sentence "Never give it..."
textBody.attributedText = attributedText
textBody.isScrollEnabled = true
view.addSubview(textBody)
constrain(textBody, titleLabel, textView) {
$0.width == $2.width
$0.centerX == $0.superview!.centerX
if isiPhoneSE() {
$0.top == $1.bottom + CGFloat(22)
$0.bottom == $2.top - CGFloat(6 )
} else {
$0.top == $1.bottom + CGFloat(33)
$0.bottom == $2.top - CGFloat(16)
}
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
@objc func copySeed() {
AnalyticsEvent.seedCopied.track(customAttributes: ["location": "seed confirmation"])
textView?.selectedTextRange = nil
DispatchQueue.global().async {
UIPasteboard.general.setObjects([self], localOnly: false, expirationDate: Date().addingTimeInterval(120))
DispatchQueue.main.sync {
let ac = UIAlertController(title: "Wallet Seed Copied", message: "Your Wallet Seed is pastable for 2 minutes.\nAfter, you can access it in Settings.\n\nPlease backup your Wallet Seed somewhere safe like password management software or print it out and put it in a safe.", preferredStyle: .actionSheet)
ac.addAction(UIAlertAction(title: "Okay", style: .default))
self.present(ac, animated: true, completion: nil)
}
}
}
@objc func continueButtonWasPressed() {
AnalyticsEvent.seedConfirmatonContinueButtonPressed.track()
let ac = UIAlertController(title: "Welcome to CellCoin Wallet!", message: "Please confirm you have properly stored your Wallet Seed somewhere safe.", preferredStyle: .actionSheet)
ac.addAction(UIAlertAction(title: "I have backed up my Wallet Seed", style: .default) { _ in
self.navigationController?.pushViewController(HomeViewController(viewModel: HomeViewModel()), animated: true)
})
ac.addAction(UIAlertAction(title: "Back", style: .cancel))
present(ac, animated: true, completion: nil)
}
}
extension SeedConfirmationViewController: NSItemProviderWriting {
static var writableTypeIdentifiersForItemProvider: [String] {
return [kUTTypeUTF8PlainText as String]
}
func loadData(withTypeIdentifier typeIdentifier: String, forItemProviderCompletionHandler completionHandler: @escaping (Data?, Error?) -> Void) -> Progress? {
DispatchQueue.main.sync {
completionHandler(credentials.seed.data(using: .utf8), nil)
}
return nil
}
}
extension SeedConfirmationViewController: LegalViewControllerDelegate {
func didFinishWithLegalVC() {
UserService().updateUserAgreesToTracking(true)
}
}
| 40.040909 | 535 | 0.658872 |
a452ee41d69219cf5190d4d0f185c319920f7ff3 | 1,030 | lua | Lua | appuio/redis/node_ready.lua | isantospardo/charts | d96bee5151118159b042268fcb8b163ebc82d4af | [
"BSD-3-Clause"
] | 11 | 2019-05-15T06:08:13.000Z | 2021-10-16T09:59:25.000Z | appuio/redis/node_ready.lua | isantospardo/charts | d96bee5151118159b042268fcb8b163ebc82d4af | [
"BSD-3-Clause"
] | 123 | 2018-06-01T14:03:18.000Z | 2022-02-14T10:17:18.000Z | appuio/redis/node_ready.lua | isantospardo/charts | d96bee5151118159b042268fcb8b163ebc82d4af | [
"BSD-3-Clause"
] | 25 | 2018-06-01T09:05:07.000Z | 2021-10-21T05:37:33.000Z | local raw_state = redis.call("info", "replication")
local split = function(text, delim)
return text:gmatch("[^"..delim.."]+")
end
local collect = function(iter)
local elements = {}
for s in iter do table.insert(elements, s); end
return elements
end
local has_prefix = function(text, prefix)
return text:find(prefix, 1, true) == 1
end
local replication_state = {}
for s in split(raw_state, "\r\n") do
(function(s)
if has_prefix(s,"#") then
return
end
local kv = collect(split(s, ":"))
replication_state[kv[1]] = kv[2]
end)(s)
end
local isSlave = replication_state["role"] == "slave"
local isMasterLinkDown = replication_state["master_link_status"] == "down"
local isSyncing = replication_state["master_sync_in_progress"] == "1"
if isSlave and isMasterLinkDown then
if isSyncing then
return redis.error_reply("node is syncing")
else
return redis.error_reply("link to master down")
end
end
return redis.status_reply("ready")
| 24.52381 | 74 | 0.662136 |
3316542a2058418ad1159222b80cb45ab969c4ba | 1,230 | py | Python | yocto/poky/bitbake/lib/bb/ui/crumbs/hobcolor.py | jxtxinbing/ops-build | 9008de2d8e100f3f868c66765742bca9fa98f3f9 | [
"Apache-2.0"
] | 16 | 2017-01-17T15:20:43.000Z | 2021-03-19T05:45:14.000Z | yocto/poky/bitbake/lib/bb/ui/crumbs/hobcolor.py | jxtxinbing/ops-build | 9008de2d8e100f3f868c66765742bca9fa98f3f9 | [
"Apache-2.0"
] | 415 | 2016-12-20T17:20:45.000Z | 2018-09-23T07:59:23.000Z | yocto/poky/bitbake/lib/bb/ui/crumbs/hobcolor.py | jxtxinbing/ops-build | 9008de2d8e100f3f868c66765742bca9fa98f3f9 | [
"Apache-2.0"
] | 10 | 2016-12-20T13:24:50.000Z | 2021-03-19T05:46:43.000Z | #
# BitBake Graphical GTK User Interface
#
# Copyright (C) 2012 Intel Corporation
#
# Authored by Shane Wang <shane.wang@intel.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
class HobColors:
WHITE = "#ffffff"
PALE_GREEN = "#aaffaa"
ORANGE = "#eb8e68"
PALE_RED = "#ffaaaa"
GRAY = "#aaaaaa"
LIGHT_GRAY = "#dddddd"
SLIGHT_DARK = "#5f5f5f"
DARK = "#3c3b37"
BLACK = "#000000"
PALE_BLUE = "#53b8ff"
DEEP_RED = "#aa3e3e"
KHAKI = "#fff68f"
OK = WHITE
RUNNING = PALE_GREEN
WARNING = ORANGE
ERROR = PALE_RED
| 31.538462 | 73 | 0.662602 |
0b6439e111fde6d2d72ca7b4f1a3a62557d36d00 | 8,850 | py | Python | code/reasoningtool/kg-construction/QueryUniprot.py | andrewsu/RTX | dd1de262d0817f7e6d2f64e5bec7d5009a3a2740 | [
"MIT"
] | 31 | 2018-03-05T20:01:10.000Z | 2022-02-01T03:31:22.000Z | code/reasoningtool/kg-construction/QueryUniprot.py | andrewsu/RTX | dd1de262d0817f7e6d2f64e5bec7d5009a3a2740 | [
"MIT"
] | 1,774 | 2018-03-06T01:55:03.000Z | 2022-03-31T03:09:04.000Z | code/reasoningtool/kg-construction/QueryUniprot.py | andrewsu/RTX | dd1de262d0817f7e6d2f64e5bec7d5009a3a2740 | [
"MIT"
] | 19 | 2018-05-10T00:43:19.000Z | 2022-03-08T19:26:16.000Z | """ This module defines the class QueryUniprot which connects to APIs at
http://www.uniprot.org/uploadlists/, querying reactome pathways from uniprot id.
* map_enzyme_commission_id_to_uniprot_ids(ec_id)
Description:
map enzyme commission id to UniProt ids
Args:
ec_id (str): enzyme commission id, e.g., "ec:1.4.1.17"
Returns:
ids (set): a set of the enzyme commission ids, or empty set if no UniProt id can be obtained or the response
status code is not 200.
"""
__author__ = ""
__copyright__ = ""
__credits__ = []
__license__ = ""
__version__ = ""
__maintainer__ = ""
__email__ = ""
__status__ = "Prototype"
# import requests
# import requests_cache
from cache_control_helper import CacheControlHelper
import CachedMethods
import sys
import urllib.parse
import xmltodict
class QueryUniprot:
API_BASE_URL = "http://www.uniprot.org/uploadlists/"
TIMEOUT_SEC = 120
HANDLER_MAP = {
'map_enzyme_commission_id_to_uniprot_ids': 'uniprot/?query=({id})&format=tab&columns=id',
'get_protein': 'uniprot/{id}.xml'
}
@staticmethod
@CachedMethods.register
def uniprot_id_to_reactome_pathways(uniprot_id):
"""returns a ``set`` of reactome IDs of pathways associated with a given string uniprot ID
:param uniprot_id: a ``str`` uniprot ID, like ``"P68871"``
:returns: a ``set`` of string Reactome IDs
"""
payload = { 'from': 'ACC',
'to': 'REACTOME_ID',
'format': 'tab',
'query': uniprot_id }
contact = "stephen.ramsey@oregonstate.edu"
header = {'User-Agent': 'Python %s' % contact}
requests = CacheControlHelper()
try:
url =QueryUniprot.API_BASE_URL
res = requests.post(QueryUniprot.API_BASE_URL, data=payload, headers=header)
except requests.exceptions.Timeout:
print(url, file=sys.stderr)
print('Timeout in QueryUniprot for URL: ' + QueryUniprot.API_BASE_URL, file=sys.stderr)
return None
except KeyboardInterrupt:
sys.exit(0)
except BaseException as e:
print(url, file=sys.stderr)
print('%s received in QueryUniprot for URL: %s' % (e, url), file=sys.stderr)
return None
status_code = res.status_code
if status_code != 200:
print(QueryUniprot.API_BASE_URL, file=sys.stderr)
print('Status code ' + str(status_code) + ' for url: ' + QueryUniprot.API_BASE_URL, file=sys.stderr)
return None
# assert 200 == res.status_code
res_set = set()
for line in res.text.splitlines():
field_str = line.split("\t")[1]
if field_str != "To":
res_set.add(field_str)
return res_set
@staticmethod
def __access_api(handler):
api_base_url = 'http://www.uniprot.org'
url = api_base_url + '/' + handler
#print(url)
contact = "stephen.ramsey@oregonstate.edu"
header = {'User-Agent': 'Python %s' % contact}
requests = CacheControlHelper()
try:
res = requests.get(url, timeout=QueryUniprot.TIMEOUT_SEC, headers=header)
except requests.exceptions.Timeout:
print(url, file=sys.stderr)
print('Timeout in QueryUniprot for URL: ' + url, file=sys.stderr)
return None
except requests.exceptions.ChunkedEncodingError:
print(url, file=sys.stderr)
print('ChunkedEncodingError for URL: ' + url, file=sys.stderr)
return None
except BaseException as e:
print(url, file=sys.stderr)
print('%s received in QueryUniprot for URL: %s' % (e, url), file=sys.stderr)
return None
status_code = res.status_code
if status_code != 200:
print(url, file=sys.stderr)
print('Status code ' + str(status_code) + ' for url: ' + url, file=sys.stderr)
return None
return res.text
@staticmethod
def map_enzyme_commission_id_to_uniprot_ids(ec_id):
res_set = set()
if not isinstance(ec_id, str):
return res_set
ec_id_encoded = urllib.parse.quote_plus(ec_id)
handler = QueryUniprot.HANDLER_MAP['map_enzyme_commission_id_to_uniprot_ids'].format(id=ec_id_encoded)
res = QueryUniprot.__access_api(handler)
if res is not None:
res = res[res.find('\n')+1:]
for line in res.splitlines():
res_set.add(line)
return res_set
@staticmethod
def __get_entity(entity_type, entity_id):
if entity_id[:10] == 'UniProtKB:':
entity_id = entity_id[10:]
handler = QueryUniprot.HANDLER_MAP[entity_type].format(id=entity_id)
results = QueryUniprot.__access_api(handler)
entity = None
if results is not None:
obj = xmltodict.parse(results)
if 'uniprot' in obj.keys():
if 'entry' in obj['uniprot'].keys():
entity = obj['uniprot']['entry']
return entity
@staticmethod
def get_protein_gene_symbol(entity_id):
ret_symbol = "None"
if not isinstance(entity_id, str):
return ret_symbol
entity_obj = QueryUniprot.__get_entity("get_protein", entity_id)
if entity_obj is not None:
if 'gene' in entity_obj.keys():
if "name" in entity_obj["gene"].keys():
gene_name_obj = entity_obj["gene"]["name"]
if not type(gene_name_obj) == list:
gene_name_obj = [gene_name_obj]
for name_dict in gene_name_obj:
# print(name_dict)
if "primary" in name_dict.values() and "#text" in name_dict.keys():
ret_symbol = name_dict["#text"]
return ret_symbol
@staticmethod
def __get_name(entity_type, entity_id):
entity_obj = QueryUniprot.__get_entity(entity_type, entity_id)
name = "UNKNOWN"
if entity_obj is not None:
if 'protein' in entity_obj.keys():
if 'recommendedName' in entity_obj['protein'].keys():
if 'fullName' in entity_obj['protein']['recommendedName'].keys():
name = entity_obj['protein']['recommendedName']['fullName']
if isinstance(name, dict):
name = name['#text']
return name
@staticmethod
def get_protein_name(protein_id):
if not isinstance(protein_id, str):
return "UNKNOWN"
return QueryUniprot.__get_name("get_protein", protein_id)
@staticmethod
def get_citeable_accession_for_accession(accession_number):
res_acc = None
res_tab = QueryUniprot.__access_api("uniprot/" + accession_number + ".tab")
if res_tab is None:
return res_acc
res_lines = res_tab.splitlines()
if len(res_lines) > 1:
res_acc = res_lines[1].split("\t")[0]
return res_acc
if __name__ == '__main__':
print(QueryUniprot.get_citeable_accession_for_accession("P35354"))
print(QueryUniprot.get_citeable_accession_for_accession("A8K802"))
print(QueryUniprot.get_citeable_accession_for_accession("Q16876"))
# print(QueryUniprot.uniprot_id_to_reactome_pathways("P68871"))
# print(QueryUniprot.uniprot_id_to_reactome_pathways("Q16621"))
# print(QueryUniprot.uniprot_id_to_reactome_pathways("P09601"))
print(CachedMethods.cache_info())
print(QueryUniprot.map_enzyme_commission_id_to_uniprot_ids("ec:1.4.1.17")) # small results
print(QueryUniprot.map_enzyme_commission_id_to_uniprot_ids("ec:1.3.1.110")) # empty result
print(QueryUniprot.map_enzyme_commission_id_to_uniprot_ids("ec:1.2.1.22")) # large results
print(QueryUniprot.map_enzyme_commission_id_to_uniprot_ids("ec:4.4.1.xx")) # fake id
print(QueryUniprot.map_enzyme_commission_id_to_uniprot_ids("R-HSA-1912422")) # wrong id
print(QueryUniprot.get_protein_gene_symbol('UniProtKB:P20848'))
print(QueryUniprot.get_protein_gene_symbol("UniProtKB:P01358"))
print(QueryUniprot.get_protein_gene_symbol("UniProtKB:Q96P88"))
print(QueryUniprot.get_protein_name('UniProtKB:P01358'))
print(QueryUniprot.get_protein_name('UniProtKB:P20848'))
print(QueryUniprot.get_protein_name('UniProtKB:Q9Y471'))
print(QueryUniprot.get_protein_name('UniProtKB:O60397'))
print(QueryUniprot.get_protein_name('UniProtKB:Q8IZJ3'))
print(QueryUniprot.get_protein_name('UniProtKB:Q7Z2Y8'))
print(QueryUniprot.get_protein_name('UniProtKB:Q8IWN7'))
print(QueryUniprot.get_protein_name('UniProtKB:Q156A1'))
| 40.410959 | 116 | 0.63209 |
123962b0374f10a73d0d6336ebe8faddd4bbcc26 | 1,017 | h | C | Division-Engine/Engine/Rendering/3D/MaterialHandler.h | Dlee4428/Division-Engine | fea6b1d389fbd10cac78b8510fa5a2c3d66d4791 | [
"MIT"
] | null | null | null | Division-Engine/Engine/Rendering/3D/MaterialHandler.h | Dlee4428/Division-Engine | fea6b1d389fbd10cac78b8510fa5a2c3d66d4791 | [
"MIT"
] | null | null | null | Division-Engine/Engine/Rendering/3D/MaterialHandler.h | Dlee4428/Division-Engine | fea6b1d389fbd10cac78b8510fa5a2c3d66d4791 | [
"MIT"
] | null | null | null | #ifndef MATERIALHANDLER_H
#define MATERIALHANDLER_H
#include "../Texture/TextureHandler.h"
#include "../../Core/Entity/Entity.h"
#include "../Shader/ShaderProgram.h"
// Material Handler Class that binds all shader and textures
class MaterialHandler : public Entity{
public:
MaterialHandler();
virtual ~MaterialHandler();
void SetTexture(unsigned int idx_, TextureHandler* texHandler_);
void SetShaderProgram(unsigned int idx_, ShaderProgram* sProgram_);
inline ShaderProgram* GetShaderProgram(int shader_) const { return sProgramVector[shader_]; }
inline TextureHandler* GetTextureHandler(int texture_) const { return texVector[texture_]; }
inline void SetActiveShader (int shaderActive_) { activeShader = shaderActive_; }
inline int GetTextureSize() { return texVector.size(); }
void Bind() const;
void BindShader() const;
void BindTexture() const;
private:
int activeShader;
std::vector<TextureHandler*> texVector;
std::vector<ShaderProgram*> sProgramVector;
};
#endif // !MATERIALHANDLER_H
| 29.057143 | 94 | 0.772861 |
b8c242f8ef523d8a05886a01b0afe8354e7bae21 | 4,908 | swift | Swift | Animatify/Transitions/RowAnimator.swift | Shubham0812/Animatify-ios | 74e9152e124dca3982ea65de0dee09e889466ef4 | [
"Apache-2.0"
] | 445 | 2020-06-15T03:05:49.000Z | 2022-03-19T09:34:23.000Z | Animatify/Transitions/RowAnimator.swift | muizidn/Animatify-ios | fb587aed2e1378bba5a9e23a24227ac8a45994b1 | [
"Apache-2.0"
] | 25 | 2020-06-19T15:54:59.000Z | 2021-10-30T17:30:00.000Z | Animatify/Transitions/RowAnimator.swift | muizidn/Animatify-ios | fb587aed2e1378bba5a9e23a24227ac8a45994b1 | [
"Apache-2.0"
] | 86 | 2020-06-18T09:38:41.000Z | 2022-01-16T16:57:27.000Z | //
// RowAnimator.swift
// Animatify
//
// Created by Shubham Singh on 11/02/21.
// Copyright © 2021 Shubham Singh. All rights reserved.
//
import Foundation
import UIKit
class RowAnimator: NSObject, UIViewControllerAnimatedTransitioning {
static var animator = RowAnimator()
enum RowTransitionMode: Int {
case present, dismiss
}
// MARK:- variables
let presentationDuration: TimeInterval = 0.325
let dismissDuration: TimeInterval = 0.2
var selectedFrame: CGRect?
var selectedColor: UIColor?
var transition: RowTransitionMode = .present
var animationOption: UIView.AnimationOptions!
var topView: UIView!
var bottomView: UIView!
func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
if (transition == .present) {
return presentationDuration
} else {
return dismissDuration
}
}
func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
/// present
guard let initialViewController = transitionContext.viewController(forKey: .from), let selectedFrame = selectedFrame, let toViewController = transitionContext.viewController(forKey: .to) else { return }
let initialFrame = initialViewController.view.frame
let containerView = transitionContext.containerView
if (transition == .present) {
topView = initialViewController.view.resizableSnapshotView(from: initialFrame, afterScreenUpdates: true, withCapInsets: UIEdgeInsets(top: selectedFrame.origin.y, left: 0, bottom: 0, right: 0))
topView.frame = CGRect(x: 0, y: 0, width: initialFrame.width, height: initialFrame.origin.y)
containerView.addSubview(topView)
// bottom view
bottomView = initialViewController.view.resizableSnapshotView(from: initialFrame, afterScreenUpdates: true, withCapInsets: UIEdgeInsets(top: 0, left: 0, bottom: initialFrame.height - selectedFrame.origin.y - selectedFrame.height, right: 0))
bottomView.frame = CGRect(x: 0, y: selectedFrame.origin.y + selectedFrame.height, width: initialFrame.width, height: initialFrame.height - selectedFrame.origin.y - selectedFrame.height)
containerView.addSubview(bottomView)
/// take a snapshot and animate it during the transitionContext.
let snapshotView = toViewController.view.resizableSnapshotView(from: initialFrame, afterScreenUpdates: true, withCapInsets: UIEdgeInsets.zero)!
snapshotView.frame = selectedFrame
containerView.addSubview(snapshotView)
toViewController.view.alpha = 0.0
containerView.addSubview(toViewController.view)
UIView.animate(withDuration: presentationDuration, delay: 0, options: animationOption) {
/// animate the views
self.topView.frame = CGRect(x: 0, y: -self.topView.frame.height, width: self.topView.frame.width, height: self.topView.frame.height)
snapshotView.frame = toViewController.view.frame
} completion: { _ in
snapshotView.removeFromSuperview()
toViewController.view.alpha = 1.0
/// finish the transition
transitionContext.completeTransition(true)
}
// bottom part goes first for a better view
UIView.animate(withDuration: presentationDuration * 0.8, delay: 0, options: animationOption) {
self.bottomView.frame = CGRect(x: 0, y: initialFrame.height, width: self.bottomView.frame.width, height: self.bottomView.frame.height)
}
} else {
let snapshotView = initialViewController.view.resizableSnapshotView(from: initialViewController.view.bounds, afterScreenUpdates: true, withCapInsets: UIEdgeInsets.zero)!
containerView.addSubview(snapshotView)
initialViewController.view.alpha = 0.0
UIView.animate(withDuration: dismissDuration, delay: 0, options: .curveEaseIn) {
self.topView.frame = CGRect(x: 0, y: 0, width: self.topView.frame.width, height: self.topView.frame.height)
self.bottomView.frame = CGRect(x: 0, y: initialViewController.view.frame.height - self.bottomView.frame.height, width: self.bottomView.frame.width, height: self.bottomView.frame.height)
snapshotView.frame = self.selectedFrame!
} completion: { _ in
snapshotView.removeFromSuperview()
transitionContext.completeTransition(true)
}
}
}
}
| 45.444444 | 252 | 0.646903 |
b84a909ecfe8262025460936554de7520e88eaad | 337 | asm | Assembly | programs/oeis/335/A335048.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/335/A335048.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/335/A335048.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A335048: Minimum sum of primes (see Comments).
; 0,3,8,13,22,31,44,57,74,91,112,133,158,183,212,241,274,307,344,381,422,463,508,553,602,651,704,757,814,871,932,993,1058,1123,1192,1261,1334,1407,1484,1561,1642,1723,1808,1893,1982,2071,2164,2257,2354,2451,2552
mov $1,2
add $1,$0
mul $1,$0
lpb $0
sub $1,$0
gcd $0,2
add $1,$0
lpe
| 28.083333 | 211 | 0.688427 |
2cffdc3b96999e6655ac6e8888f152d958c0889d | 2,653 | kt | Kotlin | app/src/main/java/com/jpsison/formverifier/MainViewModel.kt | jpsison-io/form-verifier | 4947e18ba2ad57d5ebedeaaa4a60a17a1b5587c4 | [
"MIT"
] | null | null | null | app/src/main/java/com/jpsison/formverifier/MainViewModel.kt | jpsison-io/form-verifier | 4947e18ba2ad57d5ebedeaaa4a60a17a1b5587c4 | [
"MIT"
] | null | null | null | app/src/main/java/com/jpsison/formverifier/MainViewModel.kt | jpsison-io/form-verifier | 4947e18ba2ad57d5ebedeaaa4a60a17a1b5587c4 | [
"MIT"
] | null | null | null | package com.jpsison.formverifier
import android.app.Application
import androidx.lifecycle.AndroidViewModel
import com.jpsison.formverify.FormVerifier
import com.jpsison.formverify.Verify
import java.util.*
class MainViewModel(application: Application) : AndroidViewModel(application) {
val birthdayFormat = "MMMM dd, yyyy"
var verifier = FormVerifier()
.addField(
R.id.til_first_name,
Verify.Builder()
.required()
.minChar(3)
.build()
)
.addField(
R.id.til_last_name,
Verify.Builder()
.required()
.minChar(3)
.build()
)
.addField(
R.id.til_gender,
Verify.Builder()
.required()
.build()
)
.addField(
R.id.til_birthday,
Verify.Builder()
.required()
.maxDate(
Date(),
birthdayFormat,
application.getString(R.string.error_birthday)
)
.build()
)
.addField(
R.id.til_email,
Verify.Builder()
.required()
.email()
.build()
)
.addField(
R.id.til_password,
Verify.Builder()
.required()
.minChar(8)
.maxChar(20)
.regex(
"((?=.*\\d)|(?=.*\\W+))(?![.\\n])(?=.*[A-Z])(?=.*[a-z]).*\$",
application.getString(R.string.error_password_weak)
)
.build()
)
.addField(
R.id.til_confirm_password,
Verify.Builder()
.required()
.match(
R.id.til_password,
application.getString(R.string.error_password_not_match)
)
.build()
)
fun onSignUpClick() {
val valid = verifier.validate()
if (valid) {
val name = verifier.getValue(R.id.til_first_name)
val email = verifier.getValue(R.id.til_email)
val password = verifier.getValue(R.id.til_password)
val confirmPassword = verifier.getValue(R.id.til_confirm_password)
}
verifier.realtimeValidation = true
}
fun onBirthdayClick() {
}
fun onGenderClick() {
}
fun signIn() {
val email = verifier.getValue(R.id.til_email)
val password = verifier.getValue(R.id.til_password)
}
} | 27.071429 | 81 | 0.471542 |
a8e0e5969e4555669b18957d270e181491ca958b | 4,713 | swift | Swift | GroundSdk/Internal/ComponentCore.swift | FZehana/pod_groundsdk | 3c9e8389c18d7478211c9c82ac0d64fa864fe95d | [
"BSD-3-Clause"
] | 13 | 2019-05-29T00:17:09.000Z | 2021-12-22T16:05:15.000Z | GroundSdk/Internal/ComponentCore.swift | FZehana/pod_groundsdk | 3c9e8389c18d7478211c9c82ac0d64fa864fe95d | [
"BSD-3-Clause"
] | 5 | 2019-05-08T01:11:42.000Z | 2021-07-20T21:29:33.000Z | GroundSdk/Internal/ComponentCore.swift | FZehana/pod_groundsdk | 3c9e8389c18d7478211c9c82ac0d64fa864fe95d | [
"BSD-3-Clause"
] | 10 | 2019-05-07T18:43:29.000Z | 2021-09-14T13:41:14.000Z | // Copyright (C) 2019 Parrot Drones SAS
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in
// the documentation and/or other materials provided with the
// distribution.
// * Neither the name of the Parrot Company nor the names
// of its contributors may be used to endorse or promote products
// derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// PARROT COMPANY BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
import Foundation
/// Base for a component implementation class.
@objc(GSComponentCore)
public class ComponentCore: NSObject, Component {
/// Component descriptor
public let desc: ComponentDescriptor
/// Callback type for listeners observers
public typealias ListenersDidChangeCallback = () -> Void
/// CallBack called when a first listener is registered for the component
public let didRegisterFirstListenerCallback: ListenersDidChangeCallback
/// CallBack called when the last listener is unregistered for the component
public let didUnregisterLastListenerCallback: ListenersDidChangeCallback
/// Component store where this component is stored
private unowned var store: ComponentStoreCore
/// Informs about pending changes waiting for notifyUpdated call
private var changed = false
/// Informs if this component has been published
private(set) var published = false
/// Constructor
///
/// - Parameters:
/// - desc: piloting interface component descriptor
/// - store: store where this interface will be stored
/// - didRegisterFirstListenerCallback : CallBack called when a first listener is registered for the component.
/// For example, this callback can be used to start an activity only necessary when one or more listeners exist
/// - didUnregisterLastListenerCallback: CallBack called when the last listener is unregistered for the component.
/// For example, this callback can be used to stop an activity when no more listeners exist
init(desc: ComponentDescriptor, store: ComponentStoreCore,
didRegisterFirstListenerCallback: @escaping ListenersDidChangeCallback = {},
didUnregisterLastListenerCallback: @escaping ListenersDidChangeCallback = {}) {
self.desc = desc
self.store = store
self.didRegisterFirstListenerCallback = didRegisterFirstListenerCallback
self.didUnregisterLastListenerCallback = didUnregisterLastListenerCallback
super.init()
}
func markChanged() {
changed = true
}
}
extension ComponentCore: SettingChangeDelegate {
func userDidChangeSetting() {
markChanged()
notifyUpdated()
}
}
/// Backend callback methods
extension ComponentCore {
/// Publish the component by adding it to its store
final public func publish() {
if !published {
store.add(self)
published = true
changed = false
}
}
/// Unpublish the component by removing it to its store
final public func unpublish() {
if published {
store.remove(self)
published = false
}
reset()
}
/// Notify changes made by previously called setters
@objc public func notifyUpdated() {
if changed {
changed = false
store.notifyUpdated(self)
}
}
/// Reset component state. Called when the component is unpublished.
///
/// Subclass can override this function to reset other values
@objc func reset() {
}
}
| 39.605042 | 120 | 0.701676 |
4d6138de0f3c64a84f482168951b9654e6ca0e2c | 648 | swift | Swift | TBLCategoriesTests/OperatorTests.swift | twobitlabs/TBLCategories | 8869e12ce4abdff9d866cd6fc0cd5d3b293c2a75 | [
"MIT"
] | 5 | 2015-08-28T01:02:28.000Z | 2021-03-03T02:36:11.000Z | TBLCategoriesTests/OperatorTests.swift | twobitlabs/TBLCategories | 8869e12ce4abdff9d866cd6fc0cd5d3b293c2a75 | [
"MIT"
] | null | null | null | TBLCategoriesTests/OperatorTests.swift | twobitlabs/TBLCategories | 8869e12ce4abdff9d866cd6fc0cd5d3b293c2a75 | [
"MIT"
] | 5 | 2016-01-06T11:41:13.000Z | 2021-05-25T15:31:59.000Z |
import TBLCategories
import Quick
import Nimble
class OperatorTests: QuickSpec {
override func spec() {
let bar = "bar"
describe("nil coalesce operator") {
it("should overwite if left side is nil") {
var foo: String? = nil
foo ??= bar
expect(foo).to(equal(bar))
}
it("should not overwrite if left side is not nil") {
var foo: String? = "foo"
foo ??= bar
expect(foo).to(equal("foo"))
foo ??= nil
expect(foo).to(equal("foo"))
}
}
}
}
| 20.903226 | 64 | 0.455247 |
715bdd94a26e4aee0fc106adc7acffc40641e818 | 2,988 | kt | Kotlin | 2 Layouts/AboutMe/app/src/main/java/com/nbcc/aboutme/MainActivity.kt | Android-SrB-2020/homework-JT-Stevens | a362be05db8977babbb0274a816d43edc2b1f5d6 | [
"MIT"
] | null | null | null | 2 Layouts/AboutMe/app/src/main/java/com/nbcc/aboutme/MainActivity.kt | Android-SrB-2020/homework-JT-Stevens | a362be05db8977babbb0274a816d43edc2b1f5d6 | [
"MIT"
] | null | null | null | 2 Layouts/AboutMe/app/src/main/java/com/nbcc/aboutme/MainActivity.kt | Android-SrB-2020/homework-JT-Stevens | a362be05db8977babbb0274a816d43edc2b1f5d6 | [
"MIT"
] | null | null | null | package com.nbcc.aboutme
import android.content.Context
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.view.inputmethod.InputMethodManager
import androidx.databinding.DataBindingUtil
import com.nbcc.aboutme.databinding.ActivityMainBinding
import org.w3c.dom.Text
class MainActivity : AppCompatActivity() {
private lateinit var binding: ActivityMainBinding
private val myName: MyName = MyName("Jeremy Stevens")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// setContentView(R.layout.activity_main)
binding = DataBindingUtil.setContentView(this, R.layout.activity_main)
binding.myName = myName
//Done button click event
// findViewById<Button>(R.id.done_button).setOnClickListener{
// addNickname(it)
// }
binding.doneButton.setOnClickListener {
addNickname(it)
}
//Nickname text click event
// findViewById<TextView>(R.id.nickname_text).setOnClickListener{
// updateNickname(it)
// }
binding.nicknameText.setOnClickListener{
updateNickname(it)
}
}
/**
* Updates users nickname
*/
private fun addNickname(view: View) {
// val editText = findViewById<EditText>(R.id.nickname_edit)
val editText = binding.nicknameEdit
// val nicknameTextView = findViewById<TextView>(R.id.nickname_text)
val nicknameTextView = binding.nicknameText
binding.apply {
myName?.nickname = nicknameEdit.text.toString()
//UI is refreshed with the value in the updated binding object.
invalidateAll()
nicknameEdit.visibility = View.GONE
doneButton.visibility = View.GONE
nicknameText.visibility = View.VISIBLE
}
// nicknameTextView.text = editText.text
// myName?.nickname = nicknameEdit.text.tos
// editText.visibility = View.GONE
// view.visibility = View.GONE
// nicknameTextView.visibility = View.VISIBLE
//Hide keyboard
val inputMethodManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0)
}
/**
* Un-hides hidden controls allowing user to re-enter nickname
*/
private fun updateNickname (view: View){
// val editText = findViewById<EditText>(R.id.nickname_edit)
// val doneButton = findViewById<Button>(R.id.done_button)
val editText = binding.nicknameEdit
val doneButton = binding.doneButton
editText.visibility =View.VISIBLE
doneButton.visibility = View.VISIBLE
view.visibility = View.GONE
editText.requestFocus()
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.showSoftInput(editText, 0)
}
}
| 32.835165 | 101 | 0.678046 |
0bb638739c980ce790455d27735a6b270c8bac91 | 57,331 | js | JavaScript | js/main.fae2fbf2.chunk.js | swk23C8/swk23c8.github.io | 2f6b2ef279fbcf89bc05649a3b1649cf990cdaa4 | [
"Unlicense"
] | null | null | null | js/main.fae2fbf2.chunk.js | swk23C8/swk23c8.github.io | 2f6b2ef279fbcf89bc05649a3b1649cf990cdaa4 | [
"Unlicense"
] | null | null | null | js/main.fae2fbf2.chunk.js | swk23C8/swk23c8.github.io | 2f6b2ef279fbcf89bc05649a3b1649cf990cdaa4 | [
"Unlicense"
] | null | null | null | (window.webpackJsonpdexontech = window.webpackJsonpdexontech || []).push([
[0], {
128: function(e, t, a) {
e.exports = a(286)
},
160: function(e, t) {},
162: function(e, t) {},
178: function(e, t) {},
181: function(e, t) {},
257: function(e, t) {
function a(e) {
var t = new Error("Cannot find module '" + e + "'");
throw t.code = "MODULE_NOT_FOUND", t
}
a.keys = function() {
return []
}, a.resolve = a, e.exports = a, a.id = 257
},
271: function(e, t) {},
286: function(e, t, a) {
"use strict";
a.r(t);
var n = a(0),
l = a.n(n),
i = a(123),
s = a(31),
r = a(30),
o = (a(133), a(16)),
h = a(17),
c = a(20),
u = a(18),
m = a(19),
f = a(26),
g = a(29),
d = a(51),
b = function(e) {
function t(e) {
var a;
return Object(o.a)(this, t), (a = Object(c.a)(this, Object(u.a)(t).call(this, e))).state = {
showGoBack: !1
}, a
}
return Object(m.a)(t, e), Object(h.a)(t, [{
key: "componentDidMount",
value: function() {
var e = this;
this.verifyGoBack(), this.props.history.listen(function(t, a) {
e.verifyGoBack(t)
})
}
}, {
key: "verifyGoBack",
value: function() {
var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null;
e ? "/" !== e.pathname ? this.setState({
showGoBack: !0
}) : this.setState({
showGoBack: !1
}) : "/" !== this.props.location.pathname ? this.setState({
showGoBack: !0
}) : this.setState({
showGoBack: !1
})
}
}, {
key: "render",
value: function() {
var e = {
marginRight: "10px",
lineHeight: "32px"
},
t = {
marginTop: "4px",
marginRight: "7px"
},
a = {
display: this.state.showGoBack ? "inline-block" : "none",
float: "left",
color: "#fff"
};
return l.a.createElement("header", null, l.a.createElement("div", {
className: "row",
style: {
position: "absolute",
width: "100%"
}
}, l.a.createElement("div", {
className: "col s12",
style: {
textAlign: "right",
paddingTop: "10px"
}
}, l.a.createElement(r.b, {
to: "/",
className: "waves-effect btn-flat",
style: a
}, l.a.createElement(f.a, {
icon: g.c
})), l.a.createElement("a", {
className: "waves-effect waves-light btn-small blue",
href: "https://jsfiddle.net/user/swk23c8/fiddles",
target: "_blank",
rel: "noopener noreferrer",
style: e
}, l.a.createElement(f.a, {
icon: d.c,
className: "material-icons left",
style: t
}), " JSFiddle"), l.a.createElement("a", {
className: "waves-effect waves-light btn-small blue-grey darken-4",
href: "https://github.com/swk23c8",
target: "_blank",
rel: "noopener noreferrer",
style: e
}, l.a.createElement(f.a, {
icon: d.b,
className: "material-icons left",
style: t
}), " Github"))))
}
}]), t
}(l.a.Component),
p = Object(s.f)(b),
v = a(43),
y = a.n(v),
w = function(e) {
function t() {
return Object(o.a)(this, t), Object(c.a)(this, Object(u.a)(t).apply(this, arguments))
}
return Object(m.a)(t, e), Object(h.a)(t, [{
key: "componentDidMount",
value: function() {
y.a.AutoInit()
}
}, {
key: "render",
value: function() {
var e = {
marginRight: "10px",
lineHeight: "32px",
color: "#ecf0f1"
},
t = {
marginTop: "4px",
marginRight: "7px"
};
return l.a.createElement("footer", null, l.a.createElement("div", {
className: "row",
style: {
position: "absolute",
width: "100%",
bottom: 0,
textAlign: "center"
}
}, l.a.createElement("div", {
className: "col s12"
}, l.a.createElement(r.b, {
to: "/c",
className: "waves-effect btn-flat",
style: e
}, l.a.createElement(f.a, {
icon: g.a,
className: "material-icons left",
style: t
}), " Convertion tool"), l.a.createElement(r.b, {
to: "/vanitygen",
className: "waves-effect btn-flat",
style: e
}, l.a.createElement(f.a, {
icon: d.a,
className: "material-icons left",
style: t
}), " Vanity Generator"), l.a.createElement(r.b, {
to: "/aipong",
className: "waves-effect btn-flat",
style: e
}, l.a.createElement(f.a, {
icon: g.d,
className: "material-icons left",
style: t
}), " Machine Learning - Pong"))))
}
}]), t
}(l.a.Component),
S = function(e) {
function t(e) {
var a;
return Object(o.a)(this, t), (a = Object(c.a)(this, Object(u.a)(t).call(this, e))).state = {}, a
}
return Object(m.a)(t, e), Object(h.a)(t, [{
key: "render",
value: function() {
return l.a.createElement("section", {
style: {
position: "absolute",
top: "0",
right: "0",
bottom: "0",
left: "0",
boxShadow: "0 0 300px 70px rgba(0, 0, 0, 0.2) inset",
backgroundColor: "#2c3e50",
backgroundImage: "url(/images/noise.png), url(/images/sl.png)",
color: "#7f8c8d"
}
}, l.a.createElement("div", {
className: "row valign-wrapper",
style: {
height: "100%",
textAlign: "center",
position: "relative"
}
}, l.a.createElement("div", {
className: "col s12"
}, l.a.createElement("h4", {
style: {
color: "#ecf0f1",
margin: "0"
}
}, "Hello, I build Web stuff"), l.a.createElement("h5", {
style: {
color: "#7f8c8d",
margin: "1rem 0"
}
}, "sunwookkim@riseup.net"))))
}
}]), t
}(l.a.Component),
x = a(4),
E = a(126),
Y = a.n(E),
k = function(e) {
function t(e) {
var a;
return Object(o.a)(this, t), (a = Object(c.a)(this, Object(u.a)(t).call(this, e))).state = {
fromAmount: 1,
fromSymbol: "BTC",
toSymbol: "USD",
conversion: "",
autoRefresh: !1,
autoRefreshProgress: 0,
autoRefreshTimer: null,
autoRefreshProgressBarStyle: {
display: "none"
}
}, a.handleInputChange = a.handleInputChange.bind(Object(x.a)(a)), a.handleConvertButton = a.handleConvertButton.bind(Object(x.a)(a)), a.doConvert = a.doConvert.bind(Object(x.a)(a)), a
}
return Object(m.a)(t, e), Object(h.a)(t, [{
key: "componentDidMount",
value: function() {
y.a.AutoInit(), this.doConvert(), this.updateAutoRefreshProgress()
}
}, {
key: "handleInputChange",
value: function(e) {
"autoRefresh" === e.target.name && (e.target.checked ? this.setState({
autoRefresh: !0
}) : this.setState({
autoRefresh: !1
})), "fromSymbol" === e.target.name ? this.refs.ref_fromSymbol.value = String(this.refs.ref_fromSymbol.value).toUpperCase() : "toSymbol" === e.target.name && (this.refs.ref_toSymbol.value = String(this.refs.ref_toSymbol.value).toUpperCase())
}
}, {
key: "handleConvertButton",
value: function() {
var e = this;
this.setState({
fromAmount: parseFloat(this.refs.ref_fromAmount.value),
fromSymbol: String(this.refs.ref_fromSymbol.value).toUpperCase(),
toSymbol: String(this.refs.ref_toSymbol.value).toUpperCase()
}, function() {
e.doConvert()
})
}
}, {
key: "doConvert",
value: function() {
var e = this;
Y.a.get("https://min-api.cryptocompare.com/data/price?fsym=".concat(this.state.fromSymbol, "&tsyms=").concat(this.state.toSymbol)).then(function(t) {
"Error" === t.data.Response ? e.setState({
conversion: "Invalid pairs. (".concat(e.state.fromSymbol, "/").concat(e.state.toSymbol, ")")
}) : e.setState({
conversion: "".concat(e.state.fromAmount, " ").concat(e.state.fromSymbol, " is ").concat(parseFloat((e.state.fromAmount * t.data[e.state.toSymbol]).toFixed(6)), " ").concat(e.state.toSymbol),
autoRefreshProgress: 0
})
}).catch(function(t) {
e.setState({
conversion: "Invalid pairs. (".concat(e.state.fromSymbol, "/").concat(e.state.toSymbol, ")")
}), console.error(t)
})
}
}, {
key: "updateAutoRefreshProgress",
value: function() {
var e = this;
if (this.state.autoRefresh)
if (this.setState({
autoRefreshProgressBarStyle: {
height: "2px"
}
}), this.state.autoRefreshProgress >= 100) this.doConvert(), this.setState({
autoRefreshProgress: 0
});
else {
var t = this.state.autoRefreshProgress + .5;
this.setState({
autoRefreshProgress: t
})
}
else this.setState({
autoRefreshProgressBarStyle: {
display: "none"
},
autoRefreshProgress: 0
});
var a = setTimeout(function() {
e.updateAutoRefreshProgress()
}, 200);
this.setState({
autoRefreshTimer: a
})
}
}, {
key: "render",
value: function() {
var e = {
color: "#fff"
};
return l.a.createElement("section", {
style: {
position: "absolute",
top: "0",
right: "0",
bottom: "0",
left: "0",
boxShadow: "0 0 300px 70px rgba(0, 0, 0, 0.2) inset",
backgroundColor: "#2c3e50",
backgroundImage: "url(/images/noise.png), url(/images/sl.png)",
color: "#7f8c8d"
}
}, l.a.createElement("div", {
className: "row valign-wrapper",
style: {
height: "100%",
textAlign: "center",
position: "relative"
}
}, l.a.createElement("div", {
className: "col s12"
}, l.a.createElement("div", {
className: "container"
}, l.a.createElement("div", {
className: "row"
}, l.a.createElement("div", {
className: "col s12 m8 l6 offset-m2 offset-l3"
}, l.a.createElement("div", {
class: "progress blue-grey lighten-5",
style: this.state.autoRefreshProgressBarStyle
}, l.a.createElement("div", {
class: "determinate blue-grey lighten-2",
style: {
width: this.state.autoRefreshProgress + "%"
}
})), l.a.createElement("h4", {
style: {
color: "#ecf0f1"
}
}, this.state.conversion))), l.a.createElement("div", {
className: "row"
}, l.a.createElement("div", {
className: "col s12 m8 l6 offset-m2 offset-l3"
}, l.a.createElement("div", {
className: "row"
}, l.a.createElement("div", {
className: "col m2 s5 input-field"
}, l.a.createElement("input", {
className: "form-control",
name: "fromAmount",
ref: "ref_fromAmount",
type: "number",
min: "0",
placeholder: "1",
defaultValue: "1",
autocomplete: "off",
style: e,
onChange: this.handleInputChange
}), l.a.createElement("label", {
className: "active"
}, "Amount")), l.a.createElement("div", {
className: "col m5 s7 input-field"
}, l.a.createElement("input", {
name: "fromSymbol",
ref: "ref_fromSymbol",
type: "text",
placeholder: "BTC",
defaultValue: "BTC",
autocomplete: "off",
style: e,
onChange: this.handleInputChange
}), l.a.createElement("label", {
className: "active"
}, "From Symbol")), l.a.createElement("div", {
className: "col m5 s12 input-field"
}, l.a.createElement("input", {
name: "toSymbol",
ref: "ref_toSymbol",
type: "text",
placeholder: "USD",
defaultValue: "USD",
autocomplete: "off",
style: e,
onChange: this.handleInputChange
}), l.a.createElement("label", {
className: "active"
}, "To Symbol"))))), l.a.createElement("div", {
className: "row"
}, l.a.createElement("div", {
className: "col s12"
}, l.a.createElement("button", {
class: "btn waves-effect",
onClick: this.handleConvertButton
}, "Convert"), l.a.createElement("p", null, "Auto refresh price"), l.a.createElement("div", {
className: "switch"
}, l.a.createElement("label", null, "Off", l.a.createElement("input", {
name: "autoRefresh",
ref: "ref_autoRefreshCheckbox",
type: "checkbox",
onChange: this.handleInputChange
}), l.a.createElement("span", {
className: "lever"
}), "On")), l.a.createElement("p", null, "Powered by ", l.a.createElement("a", {
href: "https://www.cryptocompare.com/",
target: "_blank",
rel: "noopener noreferrer"
}, "CryptoCompare"), ".")))))))
}
}]), t
}(l.a.Component),
O = a(45),
C = a.n(O),
T = function(e) {
function t(e) {
var a;
return Object(o.a)(this, t), (a = Object(c.a)(this, Object(u.a)(t).call(this, e))).state = {
isGenerating: !1,
hasError: !1,
P2SH: !1,
prefixInput: "",
hps: 0,
result: ""
}, a.ref_prefixInput = l.a.createRef(), a.ref_P2SHCheckbox = l.a.createRef(), a.ref_inputHelperText = l.a.createRef(), a.ref_exampleAddyRest = l.a.createRef(), a.ref_genButton = l.a.createRef(), a.genRandomHex = a.genRandomHex.bind(Object(x.a)(a)), a.handleInputChange = a.handleInputChange.bind(Object(x.a)(a)), a.handleGenerate = a.handleGenerate.bind(Object(x.a)(a)), a.generate = a.generate.bind(Object(x.a)(a)), a.amountHashes = 0, a.hpsTimer = null, a
}
return Object(m.a)(t, e), Object(h.a)(t, [{
key: "componentDidMount",
value: function() {
y.a.AutoInit(), this.ref_exampleAddyRest.current.innerText = this.genRandomHex(33)
}
}, {
key: "genRandomHex",
value: function(e) {
for (var t = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz", a = "", n = 0; n < e; n++) a += t[Math.floor(Math.random() * t.length)];
return a
}
}, {
key: "handleInputChange",
value: function(e) {
if ("prefixInput" === e.target.id) {
var t = e.target.value;
0 === t.length ? (e.target.classList.remove("valid"), e.target.classList.remove("invalid"), this.setState({
prefixInput: t,
hasError: !1
})) : new RegExp("^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{0,8}$").test(t) ? (e.target.classList.add("valid"), e.target.classList.remove("invalid"), this.setState({
prefixInput: t,
hasError: !1
})) : (e.target.classList.remove("valid"), e.target.classList.add("invalid"), this.setState({
hasError: !0
})), this.setState({
custom: e.target.value
}), this.ref_exampleAddyRest.current.innerText = this.genRandomHex(33 - t.length)
} else "P2SH" === e.target.id && (e.target.checked ? this.setState({
P2SH: !0
}) : this.setState({
P2SH: !1
}))
}
}, {
key: "handleGenerate",
value: function() {
var e = this;
if (!this.state.hasError)
if (this.state.isGenerating) this.setState({
isGenerating: !1,
hps: 0
}, function() {
e.ref_genButton.current.classList.remove("grey"), e.ref_genButton.current.classList.add("blue"), e.ref_genButton.current.innerText = "Generate", e.ref_prefixInput.current.disabled = !1, e.ref_P2SHCheckbox.current.disabled = !1, e.amountHashes = 0
});
else {
if (this.state.isGenerating) return;
this.setState({
isGenerating: !0,
hps: 0,
result: {}
}, function() {
e.ref_genButton.current.classList.remove("blue"), e.ref_genButton.current.classList.add("grey"), e.ref_genButton.current.innerText = "Stop", e.ref_prefixInput.current.disabled = !0, e.ref_P2SHCheckbox.current.disabled = !0, e.amountHashes = 0, e.hpsTimer = setInterval(function() {
e.setState({
hps: e.amountHashes
}, function() {
e.amountHashes = 0
}), e.state.isGenerating || clearInterval(e.hpsTimer)
}, 1e3), e.generate(e.state.prefixInput, e.state.P2SH)
})
}
}
}, {
key: "generate",
value: function(e, t) {
var a = this;
if (this.state.isGenerating) {
var n = null;
if (t) {
var l = C.a.ECPair.makeRandom();
if ((n = {
pub: C.a.payments.p2sh({
redeem: C.a.payments.p2wpkh({
pubkey: l.publicKey
})
}).address,
priv: l.toWIF()
}).pub.substring(0, e.length + 1) === "3" + e) return this.setState({
isGenerating: !1,
hps: 0,
result: {
pub: n.pub,
priv: n.priv
}
}, function() {
a.ref_genButton.current.classList.remove("grey"), a.ref_genButton.current.classList.add("blue"), a.ref_genButton.current.innerText = "Generate", a.ref_prefixInput.current.disabled = !1, a.ref_P2SHCheckbox.current.disabled = !1, a.amountHashes = 0
}), console.log(n)
} else {
var i = C.a.ECPair.makeRandom();
if ((n = {
pub: C.a.payments.p2pkh({
pubkey: i.publicKey
}).address,
priv: i.toWIF()
}).pub.substring(0, e.length + 1) === "1" + e) return this.setState({
isGenerating: !1,
hps: 0,
result: {
pub: n.pub,
priv: n.priv
}
}, function() {
a.ref_genButton.current.classList.remove("grey"), a.ref_genButton.current.classList.add("blue"), a.ref_genButton.current.innerText = "Generate", a.ref_prefixInput.current.disabled = !1, a.ref_P2SHCheckbox.current.disabled = !1, a.amountHashes = 0
}), console.log(n)
}
this.amountHashes++, window.requestAnimationFrame(function() {
a.generate(e, t)
})
}
}
}, {
key: "render",
value: function() {
var e = {
display: this.state.hasError ? "hidden" : "inline-block"
};
return l.a.createElement("section", {
style: {
position: "absolute",
top: "0",
right: "0",
bottom: "0",
left: "0",
boxShadow: "0 0 300px 70px rgba(0, 0, 0, 0.2) inset",
backgroundColor: "#2c3e50",
backgroundImage: "url(/images/noise.png), url(/images/sl.png)",
color: "#7f8c8d"
}
}, l.a.createElement("div", {
className: "row valign-wrapper",
style: {
height: "100%",
textAlign: "center",
position: "relative"
}
}, l.a.createElement("div", {
className: "col s12"
}, l.a.createElement("div", {
className: "container"
}, l.a.createElement("div", {
className: "row"
}, l.a.createElement("div", {
className: "col s12 m10 offset-m1"
}, l.a.createElement("div", {
className: "input-field col s9"
}, l.a.createElement(f.a, {
icon: g.b,
className: "material-icons prefix",
style: {
fontSize: "20px",
top: "1rem"
}
}), l.a.createElement("input", {
className: "validate",
ref: this.ref_prefixInput,
id: "prefixInput",
type: "text",
maxLength: "8",
"data-length": "8",
style: {
color: "#fff"
},
onChange: this.handleInputChange
}), l.a.createElement("label", {
for: "prefixInput"
}, "Prefix"), l.a.createElement("span", {
className: "helper-text",
ref: this.ref_inputHelperText,
"data-error": "Alphanumeric characters only and no ambiguity (O,l,0 or I)",
"data-success": ""
}, " ")), l.a.createElement("div", {
className: "input-field col s2"
}, l.a.createElement("p", null, l.a.createElement("label", null, l.a.createElement("input", {
id: "P2SH",
ref: this.ref_P2SHCheckbox,
type: "checkbox",
onChange: this.handleInputChange
}), l.a.createElement("span", null, "SegWit P2SH")))), l.a.createElement("div", {
className: "input-field col s12"
}, l.a.createElement("h5", null, "Ex. ", l.a.createElement("span", {
id: "exampleAddyStart",
style: {
color: "#EC9D35"
}
}, this.state.P2SH ? "3" : "1"), l.a.createElement("span", {
style: {
color: "#FFFFFF"
}
}, this.state.prefixInput), l.a.createElement("span", {
ref: this.ref_exampleAddyRest
})), l.a.createElement("h6", null, this.state.hps > 0 ? this.state.hps + " Hashes per seconds" : ""), l.a.createElement("h6", null, this.state.result.pub ? "Address: " + this.state.result.pub : ""), l.a.createElement("h6", null, this.state.result.priv ? "WIF: " + this.state.result.priv : "")), l.a.createElement("div", {
className: "col s12"
}, l.a.createElement("button", {
className: "btn waves-effect waves-light blue",
ref: this.ref_genButton,
style: e,
onClick: this.handleGenerate
}, "Generate"))))))))
}
}]), t
}(l.a.Component),
P = a(127),
N = a.n(P),
R = a(84),
I = a.n(R),
j = function(e) {
function t(e) {
var a;
return Object(o.a)(this, t), (a = Object(c.a)(this, Object(u.a)(t).call(this, e))).state = {
width: null,
height: null,
humanPoints: 0,
aiPoints: 0,
humanY: 0,
aiY: 0,
ballX: null,
ballY: null,
ballOriginX: null,
ballOriginY: null,
ballTargetX: null,
ballTargetY: null,
ballSpeed: 6,
lastBallUpdate: null,
aiHistory: [],
gameState: "iddle"
}, a.getPercent = a.getPercent.bind(Object(x.a)(a)), a.getValue = a.getValue.bind(Object(x.a)(a)), a.onresize = a.onresize.bind(Object(x.a)(a)), a.onmousemove = a.onmousemove.bind(Object(x.a)(a)), a.onclick = a.onclick.bind(Object(x.a)(a)), a.draw = a.draw.bind(Object(x.a)(a)), a.teachAI = a.teachAI.bind(Object(x.a)(a)), a.ai = new N.a.NeuralNetwork, a
}
return Object(m.a)(t, e), Object(h.a)(t, [{
key: "getPercent",
value: function(e, t) {
return parseFloat(e / t)
}
}, {
key: "getValue",
value: function(e, t) {
return parseFloat(t * e)
}
}, {
key: "componentDidMount",
value: function() {
this.setState({
width: window.innerWidth,
height: window.innerHeight,
humanY: window.innerHeight / 2 - 30,
aiY: window.innerHeight / 2 - 30,
ballX: window.innerWidth / 2 - 5,
ballY: window.innerHeight / 2 - 5,
ballOriginX: window.innerWidth / 2 - 5,
ballOriginY: window.innerHeight / 2 - 5,
ballTargetX: null,
ballTargetY: null,
ballSpeed: 6,
lastBallUpdate: (new Date).getTime(),
aiHistory: [],
gameState: "iddle"
}), window.addEventListener("resize", this.onresize), this.draw()
}
}, {
key: "componentWillUnmount",
value: function() {
window.removeEventListener("resize", this.onresize)
}
}, {
key: "onresize",
value: function() {
var e = this.refs.canvas;
e.width = window.innerWidth, e.height = window.innerHeight, this.setState({
width: e.width,
height: e.height,
ballX: e.width * this.state.ballX / this.state.width,
ballY: e.height * this.state.ballY / this.state.height,
ballOriginX: e.width * this.state.ballOriginX / this.state.width,
ballOriginY: e.height * this.state.ballOriginY / this.state.height,
ballTargetX: e.width * this.state.ballTargetX / this.state.width,
ballTargetY: e.height * this.state.ballTargetY / this.state.height,
humanY: Math.max(0, Math.min(this.state.height - 60, e.height * this.state.humanY / this.state.height)),
aiY: Math.max(0, Math.min(this.state.height - 60, e.height * this.state.aiY / this.state.height))
})
}
}, {
key: "onmousemove",
value: function(e) {
this.setState({
humanY: Math.max(0, Math.min(this.state.height - 60, e.clientY - 30))
})
}
}, {
key: "onclick",
value: function() {
"iddle" === this.state.gameState && this.setState({
gameState: "playing",
ballOriginX: this.state.ballX,
ballOriginY: this.state.ballY,
ballTargetX: this.state.humanPoints >= this.state.aiPoints ? this.state.width : 0,
ballTargetY: this.state.ballY
})
}
}, {
key: "draw",
value: function() {
var e = this,
t = this.refs.canvas;
if (t) {
var a = t.getContext("2d");
a.clearRect(0, 0, this.state.width, this.state.height);
! function() {
a.fillStyle = "white";
var n = e.state.ballX,
l = e.state.ballY;
if (a.fillRect(n, l, 10, 10), "playing" === e.state.gameState && (new Date).getTime() > e.state.lastBallUpdate + 16) {
if (null !== e.state.ballTargetX && e.state.ballX !== e.state.ballTargetX && (n += (e.state.ballTargetX - (e.state.ballTargetX < e.state.width / 2 ? e.state.width : 0)) / (1e3 - 100 * e.state.ballSpeed)), null !== e.state.ballTargetY && e.state.ballY !== e.state.ballTargetY && (l += (e.state.ballOriginY + e.state.ballTargetY - e.state.ballOriginY) / (1e3 - 100 * e.state.ballSpeed)), n <= 15 && l <= e.state.humanY + 60 && l + 10 >= e.state.humanY) {
var i = l + 10 < e.state.humanY + 30,
s = l > e.state.humanY + 30,
r = l < e.state.humanY + 30 && l + 10 > e.state.humanY + 30,
o = 0;
if (i) o = Math.max(-29, l + 10 - (e.state.humanY + 30));
else if (s) o = Math.min(29, l - (e.state.humanY + 30));
else if (r) {
var h = e.state.humanY + 30 - l,
c = l + 10 - (e.state.humanY + 30);
o = h > c ? -1 * h : c
}
var u = e.state.width,
m = e.state.height * e.getPercent(o, 30);
return e.teachAI(e.state, !0), e.setState(function(e) {
return {
ballX: Math.max(0, Math.min(e.width - 10, n)),
ballY: Math.max(0, Math.min(e.height - 10, l)),
lastBallUpdate: (new Date).getTime(),
ballTargetX: u,
ballTargetY: m,
ballOriginX: n,
ballOriginY: l,
ballSpeed: Math.min(9.5, e.ballSpeed += .2)
}
})
}
if (n + 10 >= e.state.width - 15 && l <= e.state.aiY + 60 && l + 10 >= e.state.aiY) {
var f = l + 10 < e.state.aiY + 30,
g = l > e.state.aiY + 30,
d = l < e.state.aiY + 30 && l + 10 > e.state.aiY + 30,
b = 0;
if (f) b = Math.max(-29, l + 10 - (e.state.aiY + 30));
else if (g) b = Math.min(29, l - (e.state.aiY + 30));
else if (d) {
var p = e.state.aiY + 30 - l,
v = l + 10 - (e.state.aiY + 30);
b = p > v ? -1 * p : v
}
var y = e.state.height * e.getPercent(b, 30);
return e.teachAI(e.state, !1, !0), e.setState(function(e) {
return {
ballX: Math.max(0, Math.min(e.width - 10, n)),
ballY: Math.max(0, Math.min(e.height - 10, l)),
lastBallUpdate: (new Date).getTime(),
ballTargetX: 0,
ballTargetY: y,
ballOriginX: n,
ballOriginY: l,
ballSpeed: Math.min(9.5, e.ballSpeed += .2)
}
})
}
if (l <= 0) {
l = 1;
var w = I.a.float(.1 * e.state.height, 1.5 * e.state.height);
return e.setState(function(e) {
return {
ballX: Math.max(0, Math.min(e.width - 10, n)),
ballY: Math.max(0, Math.min(e.height - 10, l)),
lastBallUpdate: (new Date).getTime(),
ballTargetY: w,
ballOriginX: n,
ballOriginY: l
}
})
}
if (l >= e.state.height - 10) {
l = e.state.height - 11;
var S = e.state.height - I.a.float(.1 * e.state.height, 1.5 * e.state.height);
return e.setState(function(e) {
return {
ballX: Math.max(0, Math.min(e.width - 10, n)),
ballY: Math.max(0, Math.min(e.height - 10, l)),
lastBallUpdate: (new Date).getTime(),
ballTargetY: S,
ballOriginX: n,
ballOriginY: l
}
})
}
if ("playing" === e.state.gameState) {
if (n <= 0) return console.log("AI SCORED"), e.setState({
gameState: "iddle",
ballX: t.width / 2 - 5,
ballY: t.height / 2 - 5,
ballTargetX: null,
ballTargetY: null,
ballSpeed: 6,
aiPoints: e.state.aiPoints + 1
});
if (n + 10 >= e.state.width) return console.log("HUMAN SCORED"), e.teachAI(e.state), e.setState({
gameState: "iddle",
ballX: t.width / 2 - 5,
ballY: t.height / 2 - 5,
ballTargetX: null,
ballTargetY: null,
ballSpeed: 6,
humanPoints: e.state.humanPoints + 1
})
}
e.setState(function(e) {
return {
ballX: Math.max(0, Math.min(e.width - 10, n)),
ballY: Math.max(0, Math.min(e.height - 10, l)),
lastBallUpdate: (new Date).getTime()
}
}, function() {
if (e.state.aiHistory.length > 0) {
var t = e.ai.run({
ballX: e.getPercent(e.state.ballX, e.state.width),
ballY: e.getPercent(e.state.ballY, e.state.height),
ballTargetX: e.getPercent(e.state.ballTargetX, e.state.width),
ballTargetY: e.getPercent(e.state.ballTargetY, e.state.height),
humanY: e.getPercent(e.state.humanY, e.state.height),
aiY: e.getPercent(e.state.aiY, e.state.height)
});
e.setState(function(a) {
return {
aiY: Math.max(0, Math.min(a.height - 60, e.getValue(parseFloat(t.y), a.height)))
}
})
}
})
}
}(),
function() {
a.fillStyle = "white";
var t = null !== e.state.humanY ? e.state.humanY : e.state.height / 2 - 30;
a.fillRect(5, t, 10, 60)
}(),
function() {
a.fillStyle = "white";
var t = e.state.width - 15,
n = null !== e.state.aiY ? e.state.aiY : e.state.height / 2 - 30;
a.fillRect(t, n, 10, 60)
}(),
function() {
a.fillStyle = "white";
for (var t = e.state.width / 2 - 1, n = 5; n < e.state.height - 15;) a.fillRect(t, n, 2, 15), n += 30
}(), a.font = "25px PressStart2P", a.fillStyle = "white", a.textAlign = "right", a.fillText(e.state.humanPoints, e.state.width / 2 - 30, 50), a.textAlign = "left", a.fillText(e.state.aiPoints, e.state.width / 2 + 30, 50), window.requestAnimationFrame(this.draw)
}
}
}, {
key: "teachAI",
value: function(e) {
var t = this,
a = arguments.length > 1 && void 0 !== arguments[1] && arguments[1],
n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2],
l = this.state.aiHistory,
i = {
input: {
ballX: this.getPercent(e.ballX, e.width),
ballY: this.getPercent(e.ballY, e.height),
ballTargetX: this.getPercent(e.ballTargetX, e.width),
ballTargetY: this.getPercent(e.ballTargetY, e.height)
},
output: {
y: this.getPercent(a ? e.humanY : n ? e.aiY : e.ballY - 25, e.height)
}
};
a ? i.input.humanY = this.getPercent(e.humanY, e.height) : n && (i.input.aiY = this.getPercent(e.aiY, e.height)), l.push(i), this.setState({
aiHistory: l
}, function() {
t.ai.train(t.state.aiHistory, {
callback: function(e) {
if (parseFloat(e.error) >= .4) return console.error("AI Failed to learn.")
}
})
})
}
}, {
key: "render",
value: function() {
var e = {
backgroundColor: "#000000",
width: "".concat(this.state.width, "px"),
height: "".concat(this.state.height, "px"),
position: "relative",
zIndex: "10"
};
return l.a.createElement("canvas", {
ref: "canvas",
width: this.state.width,
height: this.state.height,
style: e,
onMouseMove: this.onmousemove,
onClick: this.onclick
})
}
}]), t
}(l.a.Component);
Object(i.render)(l.a.createElement(r.a, null, l.a.createElement("div", null, l.a.createElement(p, null), l.a.createElement(function() {
return l.a.createElement("main", null, l.a.createElement(s.c, null, l.a.createElement(s.a, {
exact: !0,
path: "/",
component: S
}), l.a.createElement(s.a, {
exact: !0,
path: "/c",
component: k
}), l.a.createElement(s.a, {
exact: !0,
path: "/vanitygen",
component: T
}), l.a.createElement(s.a, {
exact: !0,
path: "/aipong",
component: j
})))
}, null), l.a.createElement(w, null))), document.querySelector("#app"))
}
},
[
[128, 1, 2]
]
]);
//# sourceMappingURL=main.fae2fbf2.chunk.js.map
| 58.620654 | 492 | 0.308542 |
bcaf410ee6e323ce494d4f79ba16fb607c31dad8 | 403 | js | JavaScript | server/models/createTables/createUsersTable.js | hustlaviola/Auto-Mart | a90c5b2b4aab9113cd4850584d45b4c6c8e71405 | [
"MIT"
] | null | null | null | server/models/createTables/createUsersTable.js | hustlaviola/Auto-Mart | a90c5b2b4aab9113cd4850584d45b4c6c8e71405 | [
"MIT"
] | 4 | 2019-10-02T11:42:08.000Z | 2021-05-09T04:57:32.000Z | server/models/createTables/createUsersTable.js | hustlaviola/auto-mart | a90c5b2b4aab9113cd4850584d45b4c6c8e71405 | [
"MIT"
] | null | null | null | const createUsersTable = `
CREATE TABLE IF NOT EXISTS users(
id SERIAL PRIMARY KEY NOT NULL,
email VARCHAR(70) UNIQUE NOT NULL,
first_name VARCHAR (30) NOT NULL,
last_name VARCHAR (30) NOT NULL,
password VARCHAR(60) NOT NULL,
address VARCHAR(255),
is_admin BOOLEAN DEFAULT false,
updated TIMESTAMP WITH TIME ZONE DEFAULT now()
);
`;
export default createUsersTable;
| 26.866667 | 50 | 0.709677 |
e7538911fc06cefb78ecb0dc7a98558ab9017ceb | 695 | js | JavaScript | handler.js | clifflu/summit-lucky-draw | f1b8cebad0ab465fec11c61e329967641803d45c | [
"MIT"
] | null | null | null | handler.js | clifflu/summit-lucky-draw | f1b8cebad0ab465fec11c61e329967641803d45c | [
"MIT"
] | null | null | null | handler.js | clifflu/summit-lucky-draw | f1b8cebad0ab465fec11c61e329967641803d45c | [
"MIT"
] | null | null | null | const DOMAIN = process.env.DOMAIN;
function wrappedWebRequest(fp, successPath, failPath) {
function redir(path, cb) {
cb(null, {
statusCode: 303,
headers: {
location: `https://${DOMAIN}/${path}`
}
});
}
return (evt, ctx, cb) => {
fp(evt, ctx)
.then(_ => redir(successPath, cb))
.catch(err => {
console.error(err);
redir(failPath, cb);
});
};
}
function drawOne (evt, ctx, cb) {
return require('./src/draw').one()
.then(data => cb(null, data))
.catch(cb)
}
module.exports = {
register: wrappedWebRequest(
require("./src/register").register,
"success.html",
"again.html"
),
drawOne
};
| 18.783784 | 55 | 0.555396 |
9c0d51af0a9f6e110e365c2a15645796d9f1d513 | 1,156 | js | JavaScript | React/Challenge-2/src/components/search-header.js | SyamsulAlterra/Alta | 13e8c185e91414e3f46e5d20f39370f8e58e7cd0 | [
"MIT"
] | null | null | null | React/Challenge-2/src/components/search-header.js | SyamsulAlterra/Alta | 13e8c185e91414e3f46e5d20f39370f8e58e7cd0 | [
"MIT"
] | 6 | 2021-09-02T18:50:40.000Z | 2022-02-27T11:06:31.000Z | React/Challenge-2/src/components/search-header.js | SyamsulAlterra/Alta | 13e8c185e91414e3f46e5d20f39370f8e58e7cd0 | [
"MIT"
] | null | null | null | import React from "react";
import "../css/style.css";
import "../css/bootstrap.min.css";
class SearchHeader extends React.Component {
constructor(props) {
super(props);
this.onChange = this.onChange.bind(this);
}
onChange(e) {
// e.preventDefault();
const input = e.target.value;
this.props.onChange(input);
}
render() {
return (
<table className="table-center search">
<tbody>
<tr>
<td>
{/* <SearchField
placeholder="Search..."
onChange={this.onChange}
searchText="This is initial search text"
classNames="test-class"
/> */}
<input
type="search"
placeholder="search"
onChange={this.onChange}
/>
</td>
{/* <td>
<img
src="https://dumielauxepices.net/sites/default/files/search-icon-circle-755348-7781912.png"
alt=""
/>
</td> */}
</tr>
</tbody>
</table>
);
}
}
export default SearchHeader;
| 23.591837 | 107 | 0.478374 |
70a82abafa7c59946a62da174533c16e51e4e5c3 | 2,929 | h | C | src/point.h | Wicwik/k-means | df99bd1e0d4436426de9dd82c2315d6ae40c4e47 | [
"MIT"
] | null | null | null | src/point.h | Wicwik/k-means | df99bd1e0d4436426de9dd82c2315d6ae40c4e47 | [
"MIT"
] | null | null | null | src/point.h | Wicwik/k-means | df99bd1e0d4436426de9dd82c2315d6ae40c4e47 | [
"MIT"
] | null | null | null | #pragma once
class Point
{
public:
Point()
: m_x{0}
, m_y{0}
, m_cluster{-1}
, m_minimal_distance{__DBL_MAX__}
{
}
Point(double x, double y)
: m_x{x}
, m_y{y}
, m_cluster{-1}
, m_minimal_distance{__DBL_MAX__}
{
}
Point(const Point& other)
: m_x{other.m_x}
, m_y{other.m_y}
, m_cluster{other.m_cluster}
, m_minimal_distance{other.m_minimal_distance}
{
}
Point& operator=(const Point& rhs)
{
Point tmp(rhs);
m_swap(tmp);
return *this;
}
double distance(Point p)
{
return (p.m_x - m_x) * (p.m_x - m_x) + (p.m_y - m_y) * (p.m_y - m_y);
}
double get_minimal_distance()
{
return m_minimal_distance;
}
void set_minimal_distance(double minimal_distance)
{
m_minimal_distance = minimal_distance;
}
int get_cluster()
{
return m_cluster;
}
void set_cluster(int cluster)
{
m_cluster = cluster;
}
double get_x()
{
return m_x;
}
void set_x(double x)
{
m_x = x;
}
double get_y()
{
return m_y;
}
void set_y(double y)
{
m_y = y;
}
private:
double m_x;
double m_y;
int m_cluster;
double m_minimal_distance;
void m_swap(Point tmp)
{
m_x = tmp.m_x;
m_y = tmp.m_y;
m_cluster = tmp.m_cluster;
m_minimal_distance = tmp.m_minimal_distance;
}
friend std::ostream& operator<<(std::ostream& lhs, const Point& rhs);
friend Point operator+(Point lhs, const Point& rhs);
friend Point operator+(Point lhs, const double& rhs);
friend Point operator-(Point lhs, const Point& rhs);
friend Point operator-(Point lhs, const double& rhs);
friend Point operator*(Point lhs, const Point& rhs);
friend Point operator*(Point lhs, const double& rhs);
friend bool operator==(const Point& lhs, const Point& rhs);
friend bool operator!=(const Point& lhs, const Point& rhs);
};
std::ostream& operator<<(std::ostream& lhs, const Point& rhs)
{
return lhs << "[" << rhs.m_x << "," << rhs.m_y << "]";
}
Point operator+(Point lhs, const Point& rhs)
{
return Point{(lhs.m_x + rhs.m_x), (lhs.m_y + rhs.m_y)};
}
Point operator+(Point lhs, const double& rhs)
{
return Point{(lhs.m_x + rhs), (lhs.m_y + rhs)};
}
Point operator-(Point lhs, const Point& rhs)
{
return Point{(lhs.m_x - rhs.m_x), (lhs.m_y - rhs.m_y)};
}
Point operator-(Point lhs, const double& rhs)
{
return Point{(lhs.m_x - rhs), (lhs.m_y - rhs)};
}
Point operator*(Point lhs, const Point& rhs)
{
return Point{(lhs.m_x * rhs.m_x), (lhs.m_y * rhs.m_y)};
}
Point operator*(Point lhs, const double& rhs)
{
return Point{(lhs.m_x * rhs), (lhs.m_y * rhs)};
}
bool operator==(const Point& lhs, const Point& rhs)
{
if (lhs.m_x == rhs.m_x && lhs.m_y == rhs.m_y)
{
return true;
}
else
{
return false;
}
}
bool operator!=(const Point& lhs, const Point& rhs)
{
if (lhs == rhs)
{
return false;
}
return true;
} | 17.969325 | 74 | 0.613861 |
1bdfc6238e93739384e4a63e8f3b98dfaab89a34 | 335 | asm | Assembly | programs/oeis/021/A021025.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/021/A021025.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/021/A021025.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A021025: Decimal expansion of 1/21.
; 0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7,6,1,9,0,4,7
add $0,5
mov $1,10
pow $1,$0
sub $1,6
mul $1,9
div $1,18
add $1,4
div $1,42
mod $1,10
mov $0,$1
| 23.928571 | 199 | 0.540299 |
e575c356f3099b38287a04bbc1a1cd7bfabf0fce | 67,240 | asm | Assembly | ioq3/build/release-js-js/baseq3/game/g_team.asm | RawTechnique/quake-port | 2e7c02095f0207831a6026ec23b1c1d75c24f98d | [
"MIT"
] | 1 | 2021-12-31T10:26:58.000Z | 2021-12-31T10:26:58.000Z | ioq3/build/release-js-js/baseq3/game/g_team.asm | unfriendly/quake-port | 2e7c02095f0207831a6026ec23b1c1d75c24f98d | [
"MIT"
] | 28 | 2019-03-05T20:45:07.000Z | 2019-03-05T20:45:57.000Z | ioq3/build/release-js-js/baseq3/game/g_team.asm | unfriendly/quake-port | 2e7c02095f0207831a6026ec23b1c1d75c24f98d | [
"MIT"
] | null | null | null | export Team_InitGame
code
proc Team_InitGame 0 12
ADDRGP4 teamgame
ARGP4
CNSTI4 0
ARGI4
CNSTU4 36
ARGU4
ADDRGP4 qk_memset
CALLP4
pop
ADDRGP4 g_gametype+12
INDIRI4
CNSTI4 4
EQI4 $57
ADDRGP4 $55
JUMPV
LABELV $57
ADDRGP4 teamgame+8
CNSTI4 -1
ASGNI4
CNSTI4 1
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 Team_SetFlagStatus
CALLV
pop
ADDRGP4 teamgame+12
CNSTI4 -1
ASGNI4
CNSTI4 2
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 Team_SetFlagStatus
CALLV
pop
LABELV $55
LABELV $53
endproc Team_InitGame 0 12
export OtherTeam
proc OtherTeam 0 0
ADDRFP4 0
INDIRI4
CNSTI4 1
NEI4 $61
CNSTI4 2
RETI4
ADDRGP4 $60
JUMPV
LABELV $61
ADDRFP4 0
INDIRI4
CNSTI4 2
NEI4 $63
CNSTI4 1
RETI4
ADDRGP4 $60
JUMPV
LABELV $63
ADDRFP4 0
INDIRI4
RETI4
LABELV $60
endproc OtherTeam 0 0
export TeamName
proc TeamName 0 0
ADDRFP4 0
INDIRI4
CNSTI4 1
NEI4 $66
ADDRGP4 $68
RETP4
ADDRGP4 $65
JUMPV
LABELV $66
ADDRFP4 0
INDIRI4
CNSTI4 2
NEI4 $69
ADDRGP4 $71
RETP4
ADDRGP4 $65
JUMPV
LABELV $69
ADDRFP4 0
INDIRI4
CNSTI4 3
NEI4 $72
ADDRGP4 $74
RETP4
ADDRGP4 $65
JUMPV
LABELV $72
ADDRGP4 $75
RETP4
LABELV $65
endproc TeamName 0 0
export TeamColorString
proc TeamColorString 0 0
ADDRFP4 0
INDIRI4
CNSTI4 1
NEI4 $77
ADDRGP4 $79
RETP4
ADDRGP4 $76
JUMPV
LABELV $77
ADDRFP4 0
INDIRI4
CNSTI4 2
NEI4 $80
ADDRGP4 $82
RETP4
ADDRGP4 $76
JUMPV
LABELV $80
ADDRFP4 0
INDIRI4
CNSTI4 3
NEI4 $83
ADDRGP4 $85
RETP4
ADDRGP4 $76
JUMPV
LABELV $83
ADDRGP4 $86
RETP4
LABELV $76
endproc TeamColorString 0 0
proc PrintMsg 1048 16
ADDRLP4 1028
ADDRFP4 4+4
ASGNP4
ADDRLP4 4
ARGP4
CNSTU4 1024
ARGU4
ADDRFP4 4
INDIRP4
ARGP4
ADDRLP4 1028
INDIRP4
ARGP4
ADDRLP4 1032
ADDRGP4 qk_vsnprintf
CALLI4
ASGNI4
ADDRLP4 1032
INDIRI4
CVIU4 4
CNSTU4 1024
LTU4 $89
ADDRGP4 $91
ARGP4
ADDRGP4 G_Error
CALLV
pop
LABELV $89
ADDRLP4 1028
CNSTP4 0
ASGNP4
ADDRGP4 $93
JUMPV
LABELV $92
ADDRLP4 0
INDIRP4
CNSTI1 39
ASGNI1
LABELV $93
ADDRLP4 4
ARGP4
CNSTI4 34
ARGI4
ADDRLP4 1036
ADDRGP4 qk_strchr
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 1036
INDIRP4
ASGNP4
ADDRLP4 1036
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $92
ADDRGP4 $96
ARGP4
ADDRLP4 4
ARGP4
ADDRLP4 1044
ADDRGP4 va
CALLP4
ASGNP4
ADDRFP4 0
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $97
ADDRLP4 1040
CNSTI4 -1
ASGNI4
ADDRGP4 $98
JUMPV
LABELV $97
ADDRLP4 1040
ADDRFP4 0
INDIRP4
CVPU4 4
ADDRGP4 g_entities
CVPU4 4
SUBU4
CVUI4 4
CNSTI4 804
DIVI4
ASGNI4
LABELV $98
ADDRLP4 1040
INDIRI4
ARGI4
ADDRLP4 1044
INDIRP4
ARGP4
ADDRGP4 trap_SendServerCommand
CALLV
pop
LABELV $87
endproc PrintMsg 1048 16
export AddTeamScore
proc AddTeamScore 16 8
ADDRFP4 0
INDIRP4
ARGP4
CNSTI4 47
ARGI4
ADDRLP4 4
ADDRGP4 G_TempEntity
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 4
INDIRP4
ASGNP4
ADDRLP4 8
ADDRLP4 0
INDIRP4
CNSTI4 424
ADDP4
ASGNP4
ADDRLP4 8
INDIRP4
ADDRLP4 8
INDIRP4
INDIRI4
CNSTI4 32
BORI4
ASGNI4
ADDRFP4 4
INDIRI4
CNSTI4 1
NEI4 $100
ADDRGP4 level+44+4
INDIRI4
ADDRFP4 8
INDIRI4
ADDI4
ADDRGP4 level+44+8
INDIRI4
NEI4 $102
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
CNSTI4 12
ASGNI4
ADDRGP4 $101
JUMPV
LABELV $102
ADDRGP4 level+44+4
INDIRI4
ADDRGP4 level+44+8
INDIRI4
GTI4 $108
ADDRGP4 level+44+4
INDIRI4
ADDRFP4 8
INDIRI4
ADDI4
ADDRGP4 level+44+8
INDIRI4
LEI4 $108
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
CNSTI4 10
ASGNI4
ADDRGP4 $101
JUMPV
LABELV $108
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
CNSTI4 8
ASGNI4
ADDRGP4 $101
JUMPV
LABELV $100
ADDRGP4 level+44+8
INDIRI4
ADDRFP4 8
INDIRI4
ADDI4
ADDRGP4 level+44+4
INDIRI4
NEI4 $118
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
CNSTI4 12
ASGNI4
ADDRGP4 $119
JUMPV
LABELV $118
ADDRGP4 level+44+8
INDIRI4
ADDRGP4 level+44+4
INDIRI4
GTI4 $124
ADDRGP4 level+44+8
INDIRI4
ADDRFP4 8
INDIRI4
ADDI4
ADDRGP4 level+44+4
INDIRI4
LEI4 $124
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
CNSTI4 11
ASGNI4
ADDRGP4 $125
JUMPV
LABELV $124
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
CNSTI4 9
ASGNI4
LABELV $125
LABELV $119
LABELV $101
ADDRLP4 12
ADDRFP4 4
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 level+44
ADDP4
ASGNP4
ADDRLP4 12
INDIRP4
ADDRLP4 12
INDIRP4
INDIRI4
ADDRFP4 8
INDIRI4
ADDI4
ASGNI4
LABELV $99
endproc AddTeamScore 16 8
export OnSameTeam
proc OnSameTeam 16 0
ADDRLP4 0
CNSTI4 516
ASGNI4
ADDRLP4 4
CNSTU4 0
ASGNU4
ADDRFP4 0
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRP4
CVPU4 4
ADDRLP4 4
INDIRU4
EQU4 $138
ADDRFP4 4
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRP4
CVPU4 4
ADDRLP4 4
INDIRU4
NEU4 $136
LABELV $138
CNSTI4 0
RETI4
ADDRGP4 $135
JUMPV
LABELV $136
ADDRGP4 g_gametype+12
INDIRI4
CNSTI4 3
GEI4 $139
CNSTI4 0
RETI4
ADDRGP4 $135
JUMPV
LABELV $139
ADDRLP4 8
CNSTI4 516
ASGNI4
ADDRLP4 12
CNSTI4 616
ASGNI4
ADDRFP4 0
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRI4
ADDRFP4 4
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRI4
NEI4 $142
CNSTI4 1
RETI4
ADDRGP4 $135
JUMPV
LABELV $142
CNSTI4 0
RETI4
LABELV $135
endproc OnSameTeam 16 0
data
align 1
LABELV ctfFlagStatusRemap
byte 1 48
byte 1 49
byte 1 42
byte 1 42
byte 1 50
align 1
LABELV oneFlagStatusRemap
byte 1 48
byte 1 49
byte 1 50
byte 1 51
byte 1 52
export Team_SetFlagStatus
code
proc Team_SetFlagStatus 16 8
ADDRLP4 0
CNSTI4 0
ASGNI4
ADDRLP4 4
ADDRFP4 0
INDIRI4
ASGNI4
ADDRLP4 4
INDIRI4
CNSTI4 0
EQI4 $157
ADDRLP4 4
INDIRI4
CNSTI4 1
EQI4 $147
ADDRLP4 4
INDIRI4
CNSTI4 2
EQI4 $152
ADDRGP4 $145
JUMPV
LABELV $147
ADDRGP4 teamgame+8
INDIRI4
ADDRFP4 4
INDIRI4
EQI4 $146
ADDRGP4 teamgame+8
ADDRFP4 4
INDIRI4
ASGNI4
ADDRLP4 0
CNSTI4 1
ASGNI4
ADDRGP4 $146
JUMPV
LABELV $152
ADDRGP4 teamgame+12
INDIRI4
ADDRFP4 4
INDIRI4
EQI4 $146
ADDRGP4 teamgame+12
ADDRFP4 4
INDIRI4
ASGNI4
ADDRLP4 0
CNSTI4 1
ASGNI4
ADDRGP4 $146
JUMPV
LABELV $157
ADDRGP4 teamgame+16
INDIRI4
ADDRFP4 4
INDIRI4
EQI4 $146
ADDRGP4 teamgame+16
ADDRFP4 4
INDIRI4
ASGNI4
ADDRLP4 0
CNSTI4 1
ASGNI4
LABELV $145
LABELV $146
ADDRLP4 0
INDIRI4
CNSTI4 0
EQI4 $162
ADDRGP4 g_gametype+12
INDIRI4
CNSTI4 4
NEI4 $164
ADDRLP4 12
ADDRGP4 ctfFlagStatusRemap
ASGNP4
ADDRLP4 8
ADDRGP4 teamgame+8
INDIRI4
ADDRLP4 12
INDIRP4
ADDP4
INDIRI1
ASGNI1
ADDRLP4 8+1
ADDRGP4 teamgame+12
INDIRI4
ADDRLP4 12
INDIRP4
ADDP4
INDIRI1
ASGNI1
ADDRLP4 8+2
CNSTI1 0
ASGNI1
ADDRGP4 $165
JUMPV
LABELV $164
ADDRLP4 8
ADDRGP4 teamgame+16
INDIRI4
ADDRGP4 oneFlagStatusRemap
ADDP4
INDIRI1
ASGNI1
ADDRLP4 8+1
CNSTI1 0
ASGNI1
LABELV $165
CNSTI4 23
ARGI4
ADDRLP4 8
ARGP4
ADDRGP4 trap_SetConfigstring
CALLV
pop
LABELV $162
LABELV $144
endproc Team_SetFlagStatus 16 8
export Team_CheckDroppedItem
proc Team_CheckDroppedItem 0 8
ADDRFP4 0
INDIRP4
CNSTI4 800
ADDP4
INDIRP4
CNSTI4 40
ADDP4
INDIRI4
CNSTI4 7
NEI4 $174
CNSTI4 1
ARGI4
CNSTI4 4
ARGI4
ADDRGP4 Team_SetFlagStatus
CALLV
pop
ADDRGP4 $175
JUMPV
LABELV $174
ADDRFP4 0
INDIRP4
CNSTI4 800
ADDP4
INDIRP4
CNSTI4 40
ADDP4
INDIRI4
CNSTI4 8
NEI4 $176
CNSTI4 2
ARGI4
CNSTI4 4
ARGI4
ADDRGP4 Team_SetFlagStatus
CALLV
pop
ADDRGP4 $177
JUMPV
LABELV $176
ADDRFP4 0
INDIRP4
CNSTI4 800
ADDP4
INDIRP4
CNSTI4 40
ADDP4
INDIRI4
CNSTI4 9
NEI4 $178
CNSTI4 0
ARGI4
CNSTI4 4
ARGI4
ADDRGP4 Team_SetFlagStatus
CALLV
pop
LABELV $178
LABELV $177
LABELV $175
LABELV $173
endproc Team_CheckDroppedItem 0 8
export Team_ForceGesture
proc Team_ForceGesture 12 0
ADDRFP4 0
ADDRFP4 0
INDIRI4
ASGNI4
ADDRLP4 4
CNSTI4 0
ASGNI4
LABELV $181
ADDRLP4 0
CNSTI4 804
ADDRLP4 4
INDIRI4
MULI4
ADDRGP4 g_entities
ADDP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 520
ADDP4
INDIRI4
CNSTI4 0
NEI4 $185
ADDRGP4 $182
JUMPV
LABELV $185
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $187
ADDRGP4 $182
JUMPV
LABELV $187
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
ADDRFP4 0
INDIRI4
EQI4 $189
ADDRGP4 $182
JUMPV
LABELV $189
ADDRLP4 8
ADDRLP4 0
INDIRP4
CNSTI4 536
ADDP4
ASGNP4
ADDRLP4 8
INDIRP4
ADDRLP4 8
INDIRP4
INDIRI4
CNSTI4 32768
BORI4
ASGNI4
LABELV $182
ADDRLP4 4
ADDRLP4 4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 4
INDIRI4
CNSTI4 64
LTI4 $181
LABELV $180
endproc Team_ForceGesture 12 0
export Team_FragBonuses
proc Team_FragBonuses 288 16
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 8
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 4
CNSTP4 0
ASGNP4
ADDRLP4 68
CNSTI4 516
ASGNI4
ADDRLP4 72
CNSTU4 0
ASGNU4
ADDRFP4 0
INDIRP4
ADDRLP4 68
INDIRI4
ADDP4
INDIRP4
CVPU4 4
ADDRLP4 72
INDIRU4
EQU4 $196
ADDRFP4 8
INDIRP4
ADDRLP4 68
INDIRI4
ADDP4
INDIRP4
CVPU4 4
ADDRLP4 72
INDIRU4
EQU4 $196
ADDRFP4 0
INDIRP4
CVPU4 4
ADDRFP4 8
INDIRP4
CVPU4 4
EQU4 $196
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 8
INDIRP4
ARGP4
ADDRLP4 80
ADDRGP4 OnSameTeam
CALLI4
ASGNI4
ADDRLP4 80
INDIRI4
CNSTI4 0
EQI4 $192
LABELV $196
ADDRGP4 $191
JUMPV
LABELV $192
ADDRLP4 84
ADDRFP4 0
INDIRP4
CNSTI4 516
ADDP4
ASGNP4
ADDRLP4 88
CNSTI4 616
ASGNI4
ADDRLP4 56
ADDRLP4 84
INDIRP4
INDIRP4
ADDRLP4 88
INDIRI4
ADDP4
INDIRI4
ASGNI4
ADDRLP4 84
INDIRP4
INDIRP4
ADDRLP4 88
INDIRI4
ADDP4
INDIRI4
ARGI4
ADDRLP4 92
ADDRGP4 OtherTeam
CALLI4
ASGNI4
ADDRLP4 20
ADDRLP4 92
INDIRI4
ASGNI4
ADDRLP4 20
INDIRI4
CNSTI4 0
GEI4 $197
ADDRGP4 $191
JUMPV
LABELV $197
ADDRLP4 56
INDIRI4
CNSTI4 1
NEI4 $199
ADDRLP4 16
CNSTI4 7
ASGNI4
ADDRLP4 60
CNSTI4 8
ASGNI4
ADDRGP4 $200
JUMPV
LABELV $199
ADDRLP4 16
CNSTI4 8
ASGNI4
ADDRLP4 60
CNSTI4 7
ASGNI4
LABELV $200
ADDRLP4 96
CNSTI4 0
ASGNI4
ADDRLP4 52
ADDRLP4 96
INDIRI4
ASGNI4
ADDRLP4 60
INDIRI4
CNSTI4 2
LSHI4
ADDRFP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 312
ADDP4
ADDP4
INDIRI4
ADDRLP4 96
INDIRI4
EQI4 $201
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 600
ADDP4
ADDRGP4 level+32
INDIRI4
CVIF4 4
ASGNF4
ADDRFP4 8
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
ARGP4
CNSTI4 2
ARGI4
ADDRGP4 AddScore
CALLV
pop
ADDRLP4 100
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 580
ADDP4
ASGNP4
ADDRLP4 100
INDIRP4
ADDRLP4 100
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 56
INDIRI4
ARGI4
ADDRLP4 104
ADDRGP4 TeamName
CALLP4
ASGNP4
CNSTP4 0
ARGP4
ADDRGP4 $204
ARGP4
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 512
ADDP4
ARGP4
ADDRLP4 104
INDIRP4
ARGP4
ADDRGP4 PrintMsg
CALLV
pop
ADDRLP4 0
CNSTI4 0
ASGNI4
ADDRGP4 $208
JUMPV
LABELV $205
ADDRLP4 12
CNSTI4 804
ADDRLP4 0
INDIRI4
MULI4
ADDRGP4 g_entities
ADDP4
ASGNP4
ADDRLP4 12
INDIRP4
CNSTI4 520
ADDP4
INDIRI4
CNSTI4 0
EQI4 $210
ADDRLP4 12
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
ADDRLP4 20
INDIRI4
NEI4 $210
ADDRLP4 12
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 588
ADDP4
CNSTF4 0
ASGNF4
LABELV $210
LABELV $206
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
LABELV $208
ADDRLP4 0
INDIRI4
ADDRGP4 g_maxclients+12
INDIRI4
LTI4 $205
ADDRGP4 $191
JUMPV
LABELV $201
ADDRLP4 52
INDIRI4
CNSTI4 0
EQI4 $212
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 600
ADDP4
ADDRGP4 level+32
INDIRI4
CVIF4 4
ASGNF4
ADDRFP4 8
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
ARGP4
ADDRLP4 52
INDIRI4
CNSTI4 1
LSHI4
ADDRLP4 52
INDIRI4
MULI4
ARGI4
ADDRGP4 AddScore
CALLV
pop
ADDRLP4 104
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 580
ADDP4
ASGNP4
ADDRLP4 104
INDIRP4
ADDRLP4 104
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 56
INDIRI4
ARGI4
ADDRLP4 108
ADDRGP4 TeamName
CALLP4
ASGNP4
CNSTP4 0
ARGP4
ADDRGP4 $215
ARGP4
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 512
ADDP4
ARGP4
ADDRLP4 108
INDIRP4
ARGP4
ADDRGP4 PrintMsg
CALLV
pop
ADDRLP4 0
CNSTI4 0
ASGNI4
ADDRGP4 $219
JUMPV
LABELV $216
ADDRLP4 12
CNSTI4 804
ADDRLP4 0
INDIRI4
MULI4
ADDRGP4 g_entities
ADDP4
ASGNP4
ADDRLP4 12
INDIRP4
CNSTI4 520
ADDP4
INDIRI4
CNSTI4 0
EQI4 $221
ADDRLP4 12
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
ADDRLP4 20
INDIRI4
NEI4 $221
ADDRLP4 12
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 588
ADDP4
CNSTF4 0
ASGNF4
LABELV $221
LABELV $217
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
LABELV $219
ADDRLP4 0
INDIRI4
ADDRGP4 g_maxclients+12
INDIRI4
LTI4 $216
ADDRGP4 $191
JUMPV
LABELV $212
ADDRLP4 100
CNSTI4 516
ASGNI4
ADDRLP4 104
ADDRFP4 0
INDIRP4
ADDRLP4 100
INDIRI4
ADDP4
INDIRP4
CNSTI4 588
ADDP4
INDIRF4
ASGNF4
ADDRLP4 104
INDIRF4
CNSTF4 0
EQF4 $223
ADDRGP4 level+32
INDIRI4
CVIF4 4
ADDRLP4 104
INDIRF4
SUBF4
CNSTF4 1174011904
GEF4 $223
ADDRLP4 16
INDIRI4
CNSTI4 2
LSHI4
ADDRFP4 8
INDIRP4
ADDRLP4 100
INDIRI4
ADDP4
INDIRP4
CNSTI4 312
ADDP4
ADDP4
INDIRI4
CNSTI4 0
NEI4 $223
ADDRFP4 8
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
ARGP4
CNSTI4 2
ARGI4
ADDRGP4 AddScore
CALLV
pop
ADDRLP4 108
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 572
ADDP4
ASGNP4
ADDRLP4 108
INDIRP4
ADDRLP4 108
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 588
ADDP4
CNSTF4 0
ASGNF4
ADDRLP4 112
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 292
ADDP4
ASGNP4
ADDRLP4 112
INDIRP4
ADDRLP4 112
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 116
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 116
INDIRP4
ADDRLP4 116
INDIRP4
INDIRI4
CNSTI4 -231497
BANDI4
ASGNI4
ADDRLP4 120
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 120
INDIRP4
ADDRLP4 120
INDIRP4
INDIRI4
CNSTI4 65536
BORI4
ASGNI4
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 744
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 2000
ADDI4
ASGNI4
ADDRGP4 $191
JUMPV
LABELV $223
ADDRLP4 108
ADDRFP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 588
ADDP4
INDIRF4
ASGNF4
ADDRLP4 108
INDIRF4
CNSTF4 0
EQF4 $227
ADDRGP4 level+32
INDIRI4
CVIF4 4
ADDRLP4 108
INDIRF4
SUBF4
CNSTF4 1174011904
GEF4 $227
ADDRFP4 8
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
ARGP4
CNSTI4 2
ARGI4
ADDRGP4 AddScore
CALLV
pop
ADDRLP4 112
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 572
ADDP4
ASGNP4
ADDRLP4 112
INDIRP4
ADDRLP4 112
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 588
ADDP4
CNSTF4 0
ASGNF4
ADDRLP4 116
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 292
ADDP4
ASGNP4
ADDRLP4 116
INDIRP4
ADDRLP4 116
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 120
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 120
INDIRP4
ADDRLP4 120
INDIRP4
INDIRI4
CNSTI4 -231497
BANDI4
ASGNI4
ADDRLP4 124
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 124
INDIRP4
ADDRLP4 124
INDIRP4
INDIRI4
CNSTI4 65536
BORI4
ASGNI4
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 744
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 2000
ADDI4
ASGNI4
ADDRGP4 $191
JUMPV
LABELV $227
ADDRLP4 112
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
ASGNI4
ADDRLP4 112
INDIRI4
CNSTI4 1
EQI4 $234
ADDRLP4 112
INDIRI4
CNSTI4 2
EQI4 $236
ADDRGP4 $191
JUMPV
LABELV $234
ADDRLP4 24
ADDRGP4 $235
ASGNP4
ADDRGP4 $232
JUMPV
LABELV $236
ADDRLP4 24
ADDRGP4 $237
ASGNP4
LABELV $232
ADDRLP4 0
CNSTI4 0
ASGNI4
ADDRGP4 $241
JUMPV
LABELV $238
ADDRLP4 4
CNSTI4 804
ADDRLP4 0
INDIRI4
MULI4
ADDRGP4 g_entities
ADDP4
ASGNP4
ADDRLP4 124
CNSTI4 0
ASGNI4
ADDRLP4 4
INDIRP4
CNSTI4 520
ADDP4
INDIRI4
ADDRLP4 124
INDIRI4
EQI4 $243
ADDRLP4 16
INDIRI4
CNSTI4 2
LSHI4
ADDRLP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 312
ADDP4
ADDP4
INDIRI4
ADDRLP4 124
INDIRI4
EQI4 $243
ADDRGP4 $240
JUMPV
LABELV $243
ADDRLP4 4
CNSTP4 0
ASGNP4
LABELV $239
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
LABELV $241
ADDRLP4 0
INDIRI4
ADDRGP4 g_maxclients+12
INDIRI4
LTI4 $238
LABELV $240
ADDRLP4 8
CNSTP4 0
ASGNP4
ADDRGP4 $246
JUMPV
LABELV $245
ADDRLP4 8
INDIRP4
CNSTI4 536
ADDP4
INDIRI4
CNSTI4 4096
BANDI4
CNSTI4 0
NEI4 $248
ADDRGP4 $247
JUMPV
LABELV $248
LABELV $246
ADDRLP4 8
INDIRP4
ARGP4
CNSTI4 524
ARGI4
ADDRLP4 24
INDIRP4
ARGP4
ADDRLP4 120
ADDRGP4 G_Find
CALLP4
ASGNP4
ADDRLP4 8
ADDRLP4 120
INDIRP4
ASGNP4
ADDRLP4 120
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $245
LABELV $247
ADDRLP4 8
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $250
ADDRGP4 $191
JUMPV
LABELV $250
ADDRLP4 128
CNSTI4 488
ASGNI4
ADDRLP4 28
ADDRFP4 0
INDIRP4
ADDRLP4 128
INDIRI4
ADDP4
INDIRF4
ADDRLP4 8
INDIRP4
ADDRLP4 128
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 136
CNSTI4 492
ASGNI4
ADDRLP4 28+4
ADDRFP4 0
INDIRP4
ADDRLP4 136
INDIRI4
ADDP4
INDIRF4
ADDRLP4 8
INDIRP4
ADDRLP4 136
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 140
CNSTI4 496
ASGNI4
ADDRLP4 28+8
ADDRFP4 0
INDIRP4
ADDRLP4 140
INDIRI4
ADDP4
INDIRF4
ADDRLP4 8
INDIRP4
ADDRLP4 140
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 148
CNSTI4 488
ASGNI4
ADDRLP4 40
ADDRFP4 8
INDIRP4
ADDRLP4 148
INDIRI4
ADDP4
INDIRF4
ADDRLP4 8
INDIRP4
ADDRLP4 148
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 156
CNSTI4 492
ASGNI4
ADDRLP4 40+4
ADDRFP4 8
INDIRP4
ADDRLP4 156
INDIRI4
ADDP4
INDIRF4
ADDRLP4 8
INDIRP4
ADDRLP4 156
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 160
CNSTI4 496
ASGNI4
ADDRLP4 40+8
ADDRFP4 8
INDIRP4
ADDRLP4 160
INDIRI4
ADDP4
INDIRF4
ADDRLP4 8
INDIRP4
ADDRLP4 160
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 28
ARGP4
ADDRLP4 164
ADDRGP4 VectorLength
CALLF4
ASGNF4
ADDRLP4 164
INDIRF4
CNSTF4 1148846080
GEF4 $259
ADDRLP4 168
CNSTI4 488
ASGNI4
ADDRLP4 8
INDIRP4
ADDRLP4 168
INDIRI4
ADDP4
ARGP4
ADDRFP4 0
INDIRP4
ADDRLP4 168
INDIRI4
ADDP4
ARGP4
ADDRLP4 172
ADDRGP4 trap_InPVS
CALLI4
ASGNI4
ADDRLP4 172
INDIRI4
CNSTI4 0
NEI4 $258
LABELV $259
ADDRLP4 40
ARGP4
ADDRLP4 176
ADDRGP4 VectorLength
CALLF4
ASGNF4
ADDRLP4 176
INDIRF4
CNSTF4 1148846080
GEF4 $256
ADDRLP4 180
CNSTI4 488
ASGNI4
ADDRLP4 8
INDIRP4
ADDRLP4 180
INDIRI4
ADDP4
ARGP4
ADDRFP4 8
INDIRP4
ADDRLP4 180
INDIRI4
ADDP4
ARGP4
ADDRLP4 184
ADDRGP4 trap_InPVS
CALLI4
ASGNI4
ADDRLP4 184
INDIRI4
CNSTI4 0
EQI4 $256
LABELV $258
ADDRLP4 188
CNSTI4 516
ASGNI4
ADDRLP4 192
CNSTI4 616
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 188
INDIRI4
ADDP4
INDIRP4
ADDRLP4 192
INDIRI4
ADDP4
INDIRI4
ADDRFP4 0
INDIRP4
ADDRLP4 188
INDIRI4
ADDP4
INDIRP4
ADDRLP4 192
INDIRI4
ADDP4
INDIRI4
EQI4 $256
ADDRFP4 8
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
ARGP4
CNSTI4 1
ARGI4
ADDRGP4 AddScore
CALLV
pop
ADDRLP4 196
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 568
ADDP4
ASGNP4
ADDRLP4 196
INDIRP4
ADDRLP4 196
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 200
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 292
ADDP4
ASGNP4
ADDRLP4 200
INDIRP4
ADDRLP4 200
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 204
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 204
INDIRP4
ADDRLP4 204
INDIRP4
INDIRI4
CNSTI4 -231497
BANDI4
ASGNI4
ADDRLP4 208
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 208
INDIRP4
ADDRLP4 208
INDIRP4
INDIRI4
CNSTI4 65536
BORI4
ASGNI4
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 744
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 2000
ADDI4
ASGNI4
ADDRGP4 $191
JUMPV
LABELV $256
ADDRLP4 196
ADDRLP4 4
INDIRP4
CVPU4 4
ASGNU4
ADDRLP4 196
INDIRU4
CNSTU4 0
EQU4 $261
ADDRLP4 196
INDIRU4
ADDRFP4 8
INDIRP4
CVPU4 4
EQU4 $261
ADDRLP4 204
CNSTI4 488
ASGNI4
ADDRLP4 28
ADDRFP4 0
INDIRP4
ADDRLP4 204
INDIRI4
ADDP4
INDIRF4
ADDRLP4 4
INDIRP4
ADDRLP4 204
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 212
CNSTI4 492
ASGNI4
ADDRLP4 28+4
ADDRFP4 0
INDIRP4
ADDRLP4 212
INDIRI4
ADDP4
INDIRF4
ADDRLP4 4
INDIRP4
ADDRLP4 212
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 216
CNSTI4 496
ASGNI4
ADDRLP4 28+8
ADDRFP4 0
INDIRP4
ADDRLP4 216
INDIRI4
ADDP4
INDIRF4
ADDRLP4 4
INDIRP4
ADDRLP4 216
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 224
CNSTI4 488
ASGNI4
ADDRLP4 28
ADDRFP4 8
INDIRP4
ADDRLP4 224
INDIRI4
ADDP4
INDIRF4
ADDRLP4 4
INDIRP4
ADDRLP4 224
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 232
CNSTI4 492
ASGNI4
ADDRLP4 28+4
ADDRFP4 8
INDIRP4
ADDRLP4 232
INDIRI4
ADDP4
INDIRF4
ADDRLP4 4
INDIRP4
ADDRLP4 232
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 236
CNSTI4 496
ASGNI4
ADDRLP4 28+8
ADDRFP4 8
INDIRP4
ADDRLP4 236
INDIRI4
ADDP4
INDIRF4
ADDRLP4 4
INDIRP4
ADDRLP4 236
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 28
ARGP4
ADDRLP4 240
ADDRGP4 VectorLength
CALLF4
ASGNF4
ADDRLP4 240
INDIRF4
CNSTF4 1148846080
GEF4 $270
ADDRLP4 244
CNSTI4 488
ASGNI4
ADDRLP4 4
INDIRP4
ADDRLP4 244
INDIRI4
ADDP4
ARGP4
ADDRFP4 0
INDIRP4
ADDRLP4 244
INDIRI4
ADDP4
ARGP4
ADDRLP4 248
ADDRGP4 trap_InPVS
CALLI4
ASGNI4
ADDRLP4 248
INDIRI4
CNSTI4 0
NEI4 $269
LABELV $270
ADDRLP4 40
ARGP4
ADDRLP4 252
ADDRGP4 VectorLength
CALLF4
ASGNF4
ADDRLP4 252
INDIRF4
CNSTF4 1148846080
GEF4 $267
ADDRLP4 256
CNSTI4 488
ASGNI4
ADDRLP4 4
INDIRP4
ADDRLP4 256
INDIRI4
ADDP4
ARGP4
ADDRFP4 8
INDIRP4
ADDRLP4 256
INDIRI4
ADDP4
ARGP4
ADDRLP4 260
ADDRGP4 trap_InPVS
CALLI4
ASGNI4
ADDRLP4 260
INDIRI4
CNSTI4 0
EQI4 $267
LABELV $269
ADDRLP4 264
CNSTI4 516
ASGNI4
ADDRLP4 268
CNSTI4 616
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 264
INDIRI4
ADDP4
INDIRP4
ADDRLP4 268
INDIRI4
ADDP4
INDIRI4
ADDRFP4 0
INDIRP4
ADDRLP4 264
INDIRI4
ADDP4
INDIRP4
ADDRLP4 268
INDIRI4
ADDP4
INDIRI4
EQI4 $267
ADDRFP4 8
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
ARGP4
CNSTI4 1
ARGI4
ADDRGP4 AddScore
CALLV
pop
ADDRLP4 272
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 572
ADDP4
ASGNP4
ADDRLP4 272
INDIRP4
ADDRLP4 272
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 276
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 292
ADDP4
ASGNP4
ADDRLP4 276
INDIRP4
ADDRLP4 276
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 280
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 280
INDIRP4
ADDRLP4 280
INDIRP4
INDIRI4
CNSTI4 -231497
BANDI4
ASGNI4
ADDRLP4 284
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 284
INDIRP4
ADDRLP4 284
INDIRP4
INDIRI4
CNSTI4 65536
BORI4
ASGNI4
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 744
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 2000
ADDI4
ASGNI4
LABELV $267
LABELV $261
LABELV $191
endproc Team_FragBonuses 288 16
export Team_CheckHurtCarrier
proc Team_CheckHurtCarrier 36 0
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 4
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 4
CNSTI4 516
ASGNI4
ADDRLP4 8
CNSTU4 0
ASGNU4
ADDRFP4 0
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRP4
CVPU4 4
ADDRLP4 8
INDIRU4
EQU4 $275
ADDRFP4 4
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRP4
CVPU4 4
ADDRLP4 8
INDIRU4
NEU4 $273
LABELV $275
ADDRGP4 $272
JUMPV
LABELV $273
ADDRFP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
CNSTI4 1
NEI4 $276
ADDRLP4 0
CNSTI4 8
ASGNI4
ADDRGP4 $277
JUMPV
LABELV $276
ADDRLP4 0
CNSTI4 7
ASGNI4
LABELV $277
ADDRLP4 12
CNSTI4 516
ASGNI4
ADDRLP4 16
ADDRFP4 0
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRP4
ASGNP4
ADDRLP4 0
INDIRI4
CNSTI4 2
LSHI4
ADDRLP4 16
INDIRP4
CNSTI4 312
ADDP4
ADDP4
INDIRI4
CNSTI4 0
EQI4 $278
ADDRLP4 20
CNSTI4 616
ASGNI4
ADDRLP4 16
INDIRP4
ADDRLP4 20
INDIRI4
ADDP4
INDIRI4
ADDRFP4 4
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRP4
ADDRLP4 20
INDIRI4
ADDP4
INDIRI4
EQI4 $278
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 588
ADDP4
ADDRGP4 level+32
INDIRI4
CVIF4 4
ASGNF4
LABELV $278
ADDRLP4 24
CNSTI4 516
ASGNI4
ADDRLP4 28
ADDRFP4 0
INDIRP4
ADDRLP4 24
INDIRI4
ADDP4
INDIRP4
ASGNP4
ADDRLP4 28
INDIRP4
CNSTI4 440
ADDP4
INDIRI4
CNSTI4 0
EQI4 $281
ADDRLP4 32
CNSTI4 616
ASGNI4
ADDRLP4 28
INDIRP4
ADDRLP4 32
INDIRI4
ADDP4
INDIRI4
ADDRFP4 4
INDIRP4
ADDRLP4 24
INDIRI4
ADDP4
INDIRP4
ADDRLP4 32
INDIRI4
ADDP4
INDIRI4
EQI4 $281
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 588
ADDP4
ADDRGP4 level+32
INDIRI4
CVIF4 4
ASGNF4
LABELV $281
LABELV $272
endproc Team_CheckHurtCarrier 36 0
export Team_ResetFlag
proc Team_ResetFlag 20 12
ADDRLP4 8
CNSTP4 0
ASGNP4
ADDRLP4 12
ADDRFP4 0
INDIRI4
ASGNI4
ADDRLP4 12
INDIRI4
CNSTI4 0
EQI4 $289
ADDRLP4 12
INDIRI4
CNSTI4 1
EQI4 $287
ADDRLP4 12
INDIRI4
CNSTI4 2
EQI4 $288
ADDRGP4 $285
JUMPV
LABELV $287
ADDRLP4 4
ADDRGP4 $235
ASGNP4
ADDRGP4 $286
JUMPV
LABELV $288
ADDRLP4 4
ADDRGP4 $237
ASGNP4
ADDRGP4 $286
JUMPV
LABELV $289
ADDRLP4 4
ADDRGP4 $290
ASGNP4
ADDRGP4 $286
JUMPV
LABELV $285
CNSTP4 0
RETP4
ADDRGP4 $284
JUMPV
LABELV $286
ADDRLP4 0
CNSTP4 0
ASGNP4
ADDRGP4 $292
JUMPV
LABELV $291
ADDRLP4 0
INDIRP4
CNSTI4 536
ADDP4
INDIRI4
CNSTI4 4096
BANDI4
CNSTI4 0
EQI4 $294
ADDRLP4 0
INDIRP4
ARGP4
ADDRGP4 G_FreeEntity
CALLV
pop
ADDRGP4 $295
JUMPV
LABELV $294
ADDRLP4 8
ADDRLP4 0
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
ARGP4
ADDRGP4 RespawnItem
CALLV
pop
LABELV $295
LABELV $292
ADDRLP4 0
INDIRP4
ARGP4
CNSTI4 524
ARGI4
ADDRLP4 4
INDIRP4
ARGP4
ADDRLP4 16
ADDRGP4 G_Find
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 16
INDIRP4
ASGNP4
ADDRLP4 16
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $291
ADDRFP4 0
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 Team_SetFlagStatus
CALLV
pop
ADDRLP4 8
INDIRP4
RETP4
LABELV $284
endproc Team_ResetFlag 20 12
export Team_ResetFlags
proc Team_ResetFlags 0 4
ADDRGP4 g_gametype+12
INDIRI4
CNSTI4 4
NEI4 $297
CNSTI4 1
ARGI4
ADDRGP4 Team_ResetFlag
CALLP4
pop
CNSTI4 2
ARGI4
ADDRGP4 Team_ResetFlag
CALLP4
pop
LABELV $297
LABELV $296
endproc Team_ResetFlags 0 4
export Team_ReturnFlagSound
proc Team_ReturnFlagSound 12 8
ADDRFP4 0
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $301
ADDRGP4 $303
ARGP4
ADDRGP4 G_Printf
CALLV
pop
ADDRGP4 $300
JUMPV
LABELV $301
ADDRFP4 0
INDIRP4
CNSTI4 24
ADDP4
ARGP4
CNSTI4 47
ARGI4
ADDRLP4 4
ADDRGP4 G_TempEntity
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 4
INDIRP4
ASGNP4
ADDRFP4 4
INDIRI4
CNSTI4 2
NEI4 $304
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
CNSTI4 2
ASGNI4
ADDRGP4 $305
JUMPV
LABELV $304
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
CNSTI4 3
ASGNI4
LABELV $305
ADDRLP4 8
ADDRLP4 0
INDIRP4
CNSTI4 424
ADDP4
ASGNP4
ADDRLP4 8
INDIRP4
ADDRLP4 8
INDIRP4
INDIRI4
CNSTI4 32
BORI4
ASGNI4
LABELV $300
endproc Team_ReturnFlagSound 12 8
export Team_TakeFlagSound
proc Team_TakeFlagSound 16 8
ADDRFP4 0
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $307
ADDRGP4 $309
ARGP4
ADDRGP4 G_Printf
CALLV
pop
ADDRGP4 $306
JUMPV
LABELV $307
ADDRLP4 4
ADDRFP4 4
INDIRI4
ASGNI4
ADDRLP4 4
INDIRI4
CNSTI4 1
EQI4 $312
ADDRLP4 4
INDIRI4
CNSTI4 2
EQI4 $322
ADDRGP4 $310
JUMPV
LABELV $312
ADDRGP4 teamgame+12
INDIRI4
CNSTI4 0
EQI4 $313
ADDRGP4 teamgame+24
INDIRI4
ADDRGP4 level+32
INDIRI4
CNSTI4 10000
SUBI4
LEI4 $316
ADDRGP4 $306
JUMPV
LABELV $316
LABELV $313
ADDRGP4 teamgame+24
ADDRGP4 level+32
INDIRI4
ASGNI4
ADDRGP4 $311
JUMPV
LABELV $322
ADDRGP4 teamgame+8
INDIRI4
CNSTI4 0
EQI4 $323
ADDRGP4 teamgame+20
INDIRI4
ADDRGP4 level+32
INDIRI4
CNSTI4 10000
SUBI4
LEI4 $326
ADDRGP4 $306
JUMPV
LABELV $326
LABELV $323
ADDRGP4 teamgame+20
ADDRGP4 level+32
INDIRI4
ASGNI4
LABELV $310
LABELV $311
ADDRFP4 0
INDIRP4
CNSTI4 24
ADDP4
ARGP4
CNSTI4 47
ARGI4
ADDRLP4 8
ADDRGP4 G_TempEntity
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 8
INDIRP4
ASGNP4
ADDRFP4 4
INDIRI4
CNSTI4 2
NEI4 $332
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
CNSTI4 4
ASGNI4
ADDRGP4 $333
JUMPV
LABELV $332
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
CNSTI4 5
ASGNI4
LABELV $333
ADDRLP4 12
ADDRLP4 0
INDIRP4
CNSTI4 424
ADDP4
ASGNP4
ADDRLP4 12
INDIRP4
ADDRLP4 12
INDIRP4
INDIRI4
CNSTI4 32
BORI4
ASGNI4
LABELV $306
endproc Team_TakeFlagSound 16 8
export Team_CaptureFlagSound
proc Team_CaptureFlagSound 12 8
ADDRFP4 0
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $335
ADDRGP4 $337
ARGP4
ADDRGP4 G_Printf
CALLV
pop
ADDRGP4 $334
JUMPV
LABELV $335
ADDRFP4 0
INDIRP4
CNSTI4 24
ADDP4
ARGP4
CNSTI4 47
ARGI4
ADDRLP4 4
ADDRGP4 G_TempEntity
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 4
INDIRP4
ASGNP4
ADDRFP4 4
INDIRI4
CNSTI4 2
NEI4 $338
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
CNSTI4 1
ASGNI4
ADDRGP4 $339
JUMPV
LABELV $338
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
CNSTI4 0
ASGNI4
LABELV $339
ADDRLP4 8
ADDRLP4 0
INDIRP4
CNSTI4 424
ADDP4
ASGNP4
ADDRLP4 8
INDIRP4
ADDRLP4 8
INDIRP4
INDIRI4
CNSTI4 32
BORI4
ASGNI4
LABELV $334
endproc Team_CaptureFlagSound 12 8
export Team_ReturnFlag
proc Team_ReturnFlag 8 12
ADDRFP4 0
ADDRFP4 0
INDIRI4
ASGNI4
ADDRFP4 0
INDIRI4
ARGI4
ADDRLP4 0
ADDRGP4 Team_ResetFlag
CALLP4
ASGNP4
ADDRLP4 0
INDIRP4
ARGP4
ADDRFP4 0
INDIRI4
ARGI4
ADDRGP4 Team_ReturnFlagSound
CALLV
pop
ADDRFP4 0
INDIRI4
CNSTI4 0
NEI4 $341
CNSTP4 0
ARGP4
ADDRGP4 $343
ARGP4
ADDRGP4 PrintMsg
CALLV
pop
ADDRGP4 $342
JUMPV
LABELV $341
ADDRFP4 0
INDIRI4
ARGI4
ADDRLP4 4
ADDRGP4 TeamName
CALLP4
ASGNP4
CNSTP4 0
ARGP4
ADDRGP4 $344
ARGP4
ADDRLP4 4
INDIRP4
ARGP4
ADDRGP4 PrintMsg
CALLV
pop
LABELV $342
LABELV $340
endproc Team_ReturnFlag 8 12
export Team_FreeEntity
proc Team_FreeEntity 0 4
ADDRFP4 0
INDIRP4
CNSTI4 800
ADDP4
INDIRP4
CNSTI4 40
ADDP4
INDIRI4
CNSTI4 7
NEI4 $346
CNSTI4 1
ARGI4
ADDRGP4 Team_ReturnFlag
CALLV
pop
ADDRGP4 $347
JUMPV
LABELV $346
ADDRFP4 0
INDIRP4
CNSTI4 800
ADDP4
INDIRP4
CNSTI4 40
ADDP4
INDIRI4
CNSTI4 8
NEI4 $348
CNSTI4 2
ARGI4
ADDRGP4 Team_ReturnFlag
CALLV
pop
ADDRGP4 $349
JUMPV
LABELV $348
ADDRFP4 0
INDIRP4
CNSTI4 800
ADDP4
INDIRP4
CNSTI4 40
ADDP4
INDIRI4
CNSTI4 9
NEI4 $350
CNSTI4 0
ARGI4
ADDRGP4 Team_ReturnFlag
CALLV
pop
LABELV $350
LABELV $349
LABELV $347
LABELV $345
endproc Team_FreeEntity 0 4
export Team_DroppedFlagThink
proc Team_DroppedFlagThink 8 8
ADDRLP4 0
CNSTI4 0
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 800
ADDP4
INDIRP4
CNSTI4 40
ADDP4
INDIRI4
CNSTI4 7
NEI4 $353
ADDRLP4 0
CNSTI4 1
ASGNI4
ADDRGP4 $354
JUMPV
LABELV $353
ADDRFP4 0
INDIRP4
CNSTI4 800
ADDP4
INDIRP4
CNSTI4 40
ADDP4
INDIRI4
CNSTI4 8
NEI4 $355
ADDRLP4 0
CNSTI4 2
ASGNI4
ADDRGP4 $356
JUMPV
LABELV $355
ADDRFP4 0
INDIRP4
CNSTI4 800
ADDP4
INDIRP4
CNSTI4 40
ADDP4
INDIRI4
CNSTI4 9
NEI4 $357
ADDRLP4 0
CNSTI4 0
ASGNI4
LABELV $357
LABELV $356
LABELV $354
ADDRLP4 0
INDIRI4
ARGI4
ADDRLP4 4
ADDRGP4 Team_ResetFlag
CALLP4
ASGNP4
ADDRLP4 4
INDIRP4
ARGP4
ADDRLP4 0
INDIRI4
ARGI4
ADDRGP4 Team_ReturnFlagSound
CALLV
pop
LABELV $352
endproc Team_DroppedFlagThink 8 8
export Team_TouchOurFlag
proc Team_TouchOurFlag 68 16
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 4
ADDRFP4 4
INDIRP4
ASGNP4
ADDRFP4 8
ADDRFP4 8
INDIRI4
ASGNI4
ADDRLP4 8
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
ASGNP4
ADDRLP4 8
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
CNSTI4 1
NEI4 $360
ADDRLP4 12
CNSTI4 8
ASGNI4
ADDRGP4 $361
JUMPV
LABELV $360
ADDRLP4 12
CNSTI4 7
ASGNI4
LABELV $361
ADDRFP4 0
INDIRP4
CNSTI4 536
ADDP4
INDIRI4
CNSTI4 4096
BANDI4
CNSTI4 0
EQI4 $362
ADDRFP4 8
INDIRI4
ARGI4
ADDRLP4 16
ADDRGP4 TeamName
CALLP4
ASGNP4
CNSTP4 0
ARGP4
ADDRGP4 $364
ARGP4
ADDRLP4 8
INDIRP4
CNSTI4 512
ADDP4
ARGP4
ADDRLP4 16
INDIRP4
ARGP4
ADDRGP4 PrintMsg
CALLV
pop
ADDRFP4 4
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
ARGP4
CNSTI4 1
ARGI4
ADDRGP4 AddScore
CALLV
pop
ADDRLP4 20
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 576
ADDP4
ASGNP4
ADDRLP4 20
INDIRP4
ADDRLP4 20
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 592
ADDP4
ADDRGP4 level+32
INDIRI4
CVIF4 4
ASGNF4
ADDRFP4 8
INDIRI4
ARGI4
ADDRLP4 24
ADDRGP4 Team_ResetFlag
CALLP4
ASGNP4
ADDRLP4 24
INDIRP4
ARGP4
ADDRFP4 8
INDIRI4
ARGI4
ADDRGP4 Team_ReturnFlagSound
CALLV
pop
CNSTI4 0
RETI4
ADDRGP4 $359
JUMPV
LABELV $362
ADDRLP4 12
INDIRI4
CNSTI4 2
LSHI4
ADDRLP4 8
INDIRP4
CNSTI4 312
ADDP4
ADDP4
INDIRI4
CNSTI4 0
NEI4 $366
CNSTI4 0
RETI4
ADDRGP4 $359
JUMPV
LABELV $366
ADDRFP4 8
INDIRI4
ARGI4
ADDRLP4 16
ADDRGP4 OtherTeam
CALLI4
ASGNI4
ADDRLP4 16
INDIRI4
ARGI4
ADDRLP4 20
ADDRGP4 TeamName
CALLP4
ASGNP4
CNSTP4 0
ARGP4
ADDRGP4 $368
ARGP4
ADDRLP4 8
INDIRP4
CNSTI4 512
ADDP4
ARGP4
ADDRLP4 20
INDIRP4
ARGP4
ADDRGP4 PrintMsg
CALLV
pop
ADDRLP4 12
INDIRI4
CNSTI4 2
LSHI4
ADDRLP4 8
INDIRP4
CNSTI4 312
ADDP4
ADDP4
CNSTI4 0
ASGNI4
ADDRGP4 teamgame
ADDRGP4 level+32
INDIRI4
CVIF4 4
ASGNF4
ADDRGP4 teamgame+4
ADDRFP4 8
INDIRI4
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 24
ADDP4
ARGP4
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
ARGI4
CNSTI4 1
ARGI4
ADDRGP4 AddTeamScore
CALLV
pop
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
ARGI4
ADDRGP4 Team_ForceGesture
CALLV
pop
ADDRLP4 24
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 564
ADDP4
ASGNP4
ADDRLP4 24
INDIRP4
ADDRLP4 24
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 28
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 28
INDIRP4
ADDRLP4 28
INDIRP4
INDIRI4
CNSTI4 -231497
BANDI4
ASGNI4
ADDRLP4 32
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 32
INDIRP4
ADDRLP4 32
INDIRP4
INDIRI4
CNSTI4 2048
BORI4
ASGNI4
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 744
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 2000
ADDI4
ASGNI4
ADDRLP4 36
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 304
ADDP4
ASGNP4
ADDRLP4 36
INDIRP4
ADDRLP4 36
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRFP4 4
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
ARGP4
CNSTI4 5
ARGI4
ADDRGP4 AddScore
CALLV
pop
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 8
INDIRI4
ARGI4
ADDRGP4 Team_CaptureFlagSound
CALLV
pop
ADDRLP4 4
CNSTI4 0
ASGNI4
ADDRGP4 $375
JUMPV
LABELV $372
ADDRLP4 0
CNSTI4 804
ADDRLP4 4
INDIRI4
MULI4
ADDRGP4 g_entities
ADDP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 520
ADDP4
INDIRI4
CNSTI4 0
EQI4 $379
ADDRLP4 0
INDIRP4
CVPU4 4
ADDRFP4 4
INDIRP4
CVPU4 4
NEU4 $377
LABELV $379
ADDRGP4 $373
JUMPV
LABELV $377
ADDRLP4 44
CNSTI4 616
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
ADDRLP4 44
INDIRI4
ADDP4
INDIRI4
ADDRLP4 8
INDIRP4
ADDRLP4 44
INDIRI4
ADDP4
INDIRI4
EQI4 $380
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 588
ADDP4
CNSTF4 3231711232
ASGNF4
ADDRGP4 $381
JUMPV
LABELV $380
ADDRLP4 48
CNSTI4 616
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
ADDRLP4 48
INDIRI4
ADDP4
INDIRI4
ADDRLP4 8
INDIRP4
ADDRLP4 48
INDIRI4
ADDP4
INDIRI4
NEI4 $382
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 592
ADDP4
INDIRF4
CNSTF4 1176256512
ADDF4
ADDRGP4 level+32
INDIRI4
CVIF4 4
LEF4 $384
ADDRLP4 0
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
ARGP4
CNSTI4 1
ARGI4
ADDRGP4 AddScore
CALLV
pop
ADDRLP4 52
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 584
ADDP4
ASGNP4
ADDRLP4 52
INDIRP4
ADDRLP4 52
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 56
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 296
ADDP4
ASGNP4
ADDRLP4 56
INDIRP4
ADDRLP4 56
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 60
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 60
INDIRP4
ADDRLP4 60
INDIRP4
INDIRI4
CNSTI4 -231497
BANDI4
ASGNI4
ADDRLP4 64
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 64
INDIRP4
ADDRLP4 64
INDIRP4
INDIRI4
CNSTI4 131072
BORI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 744
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 2000
ADDI4
ASGNI4
LABELV $384
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 600
ADDP4
INDIRF4
CNSTF4 1176256512
ADDF4
ADDRGP4 level+32
INDIRI4
CVIF4 4
LEF4 $388
ADDRLP4 0
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
ARGP4
CNSTI4 2
ARGI4
ADDRGP4 AddScore
CALLV
pop
ADDRLP4 52
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 584
ADDP4
ASGNP4
ADDRLP4 52
INDIRP4
ADDRLP4 52
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 56
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 296
ADDP4
ASGNP4
ADDRLP4 56
INDIRP4
ADDRLP4 56
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 60
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 60
INDIRP4
ADDRLP4 60
INDIRP4
INDIRI4
CNSTI4 -231497
BANDI4
ASGNI4
ADDRLP4 64
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 64
INDIRP4
ADDRLP4 64
INDIRP4
INDIRI4
CNSTI4 131072
BORI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 744
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 2000
ADDI4
ASGNI4
LABELV $388
LABELV $382
LABELV $381
LABELV $373
ADDRLP4 4
ADDRLP4 4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
LABELV $375
ADDRLP4 4
INDIRI4
ADDRGP4 g_maxclients+12
INDIRI4
LTI4 $372
ADDRGP4 Team_ResetFlags
CALLV
pop
ADDRGP4 CalculateRanks
CALLV
pop
CNSTI4 0
RETI4
LABELV $359
endproc Team_TouchOurFlag 68 16
export Team_TouchEnemyFlag
proc Team_TouchEnemyFlag 8 16
ADDRFP4 8
ADDRFP4 8
INDIRI4
ASGNI4
ADDRLP4 0
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
ASGNP4
ADDRFP4 8
INDIRI4
ARGI4
ADDRLP4 4
ADDRGP4 TeamName
CALLP4
ASGNP4
CNSTP4 0
ARGP4
ADDRGP4 $393
ARGP4
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 512
ADDP4
ARGP4
ADDRLP4 4
INDIRP4
ARGP4
ADDRGP4 PrintMsg
CALLV
pop
ADDRFP4 8
INDIRI4
CNSTI4 1
NEI4 $394
ADDRLP4 0
INDIRP4
CNSTI4 340
ADDP4
CNSTI4 2147483647
ASGNI4
ADDRGP4 $395
JUMPV
LABELV $394
ADDRLP4 0
INDIRP4
CNSTI4 344
ADDP4
CNSTI4 2147483647
ASGNI4
LABELV $395
ADDRFP4 8
INDIRI4
ARGI4
CNSTI4 1
ARGI4
ADDRGP4 Team_SetFlagStatus
CALLV
pop
ADDRLP4 0
INDIRP4
CNSTI4 596
ADDP4
ADDRGP4 level+32
INDIRI4
CVIF4 4
ASGNF4
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 8
INDIRI4
ARGI4
ADDRGP4 Team_TakeFlagSound
CALLV
pop
CNSTI4 -1
RETI4
LABELV $392
endproc Team_TouchEnemyFlag 8 16
export Pickup_Team
proc Pickup_Team 20 12
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 4
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 524
ADDP4
INDIRP4
ARGP4
ADDRGP4 $235
ARGP4
ADDRLP4 8
ADDRGP4 qk_strcmp
CALLI4
ASGNI4
ADDRLP4 8
INDIRI4
CNSTI4 0
NEI4 $398
ADDRLP4 0
CNSTI4 1
ASGNI4
ADDRGP4 $399
JUMPV
LABELV $398
ADDRFP4 0
INDIRP4
CNSTI4 524
ADDP4
INDIRP4
ARGP4
ADDRGP4 $237
ARGP4
ADDRLP4 12
ADDRGP4 qk_strcmp
CALLI4
ASGNI4
ADDRLP4 12
INDIRI4
CNSTI4 0
NEI4 $400
ADDRLP4 0
CNSTI4 2
ASGNI4
ADDRGP4 $401
JUMPV
LABELV $400
ADDRFP4 4
INDIRP4
ARGP4
ADDRGP4 $402
ARGP4
ADDRGP4 PrintMsg
CALLV
pop
CNSTI4 0
RETI4
ADDRGP4 $397
JUMPV
LABELV $401
LABELV $399
ADDRLP4 0
INDIRI4
ADDRLP4 4
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
NEI4 $403
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 4
INDIRP4
ARGP4
ADDRLP4 0
INDIRI4
ARGI4
ADDRLP4 16
ADDRGP4 Team_TouchOurFlag
CALLI4
ASGNI4
ADDRLP4 16
INDIRI4
RETI4
ADDRGP4 $397
JUMPV
LABELV $403
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 4
INDIRP4
ARGP4
ADDRLP4 0
INDIRI4
ARGI4
ADDRLP4 16
ADDRGP4 Team_TouchEnemyFlag
CALLI4
ASGNI4
ADDRLP4 16
INDIRI4
RETI4
LABELV $397
endproc Pickup_Team 20 12
export Team_GetLocation
proc Team_GetLocation 48 8
ADDRLP4 24
CNSTP4 0
ASGNP4
ADDRLP4 20
CNSTF4 1296039936
ASGNF4
ADDRLP4 4
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
INDIRB
ASGNB 12
ADDRLP4 0
ADDRGP4 level+9172
INDIRP4
ASGNP4
ADDRGP4 $409
JUMPV
LABELV $406
ADDRLP4 32
ADDRLP4 4
INDIRF4
ADDRLP4 0
INDIRP4
CNSTI4 488
ADDP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 36
ADDRLP4 0
INDIRP4
CNSTI4 492
ADDP4
INDIRF4
ASGNF4
ADDRLP4 40
ADDRLP4 0
INDIRP4
CNSTI4 496
ADDP4
INDIRF4
ASGNF4
ADDRLP4 16
ADDRLP4 32
INDIRF4
ADDRLP4 32
INDIRF4
MULF4
ADDRLP4 4+4
INDIRF4
ADDRLP4 36
INDIRF4
SUBF4
ADDRLP4 4+4
INDIRF4
ADDRLP4 36
INDIRF4
SUBF4
MULF4
ADDF4
ADDRLP4 4+8
INDIRF4
ADDRLP4 40
INDIRF4
SUBF4
ADDRLP4 4+8
INDIRF4
ADDRLP4 40
INDIRF4
SUBF4
MULF4
ADDF4
ASGNF4
ADDRLP4 16
INDIRF4
ADDRLP4 20
INDIRF4
LEF4 $415
ADDRGP4 $407
JUMPV
LABELV $415
ADDRLP4 4
ARGP4
ADDRLP4 0
INDIRP4
CNSTI4 488
ADDP4
ARGP4
ADDRLP4 44
ADDRGP4 trap_InPVS
CALLI4
ASGNI4
ADDRLP4 44
INDIRI4
CNSTI4 0
NEI4 $417
ADDRGP4 $407
JUMPV
LABELV $417
ADDRLP4 20
ADDRLP4 16
INDIRF4
ASGNF4
ADDRLP4 24
ADDRLP4 0
INDIRP4
ASGNP4
LABELV $407
ADDRLP4 0
ADDRLP4 0
INDIRP4
CNSTI4 604
ADDP4
INDIRP4
ASGNP4
LABELV $409
ADDRLP4 0
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $406
ADDRLP4 24
INDIRP4
RETP4
LABELV $405
endproc Team_GetLocation 48 8
export Team_GetLocationMsg
proc Team_GetLocationMsg 12 24
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 4
ADDRGP4 Team_GetLocation
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 4
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $420
CNSTI4 0
RETI4
ADDRGP4 $419
JUMPV
LABELV $420
ADDRLP4 0
INDIRP4
CNSTI4 756
ADDP4
INDIRI4
CNSTI4 0
EQI4 $422
ADDRLP4 0
INDIRP4
CNSTI4 756
ADDP4
INDIRI4
CNSTI4 0
GEI4 $424
ADDRLP4 0
INDIRP4
CNSTI4 756
ADDP4
CNSTI4 0
ASGNI4
LABELV $424
ADDRLP4 0
INDIRP4
CNSTI4 756
ADDP4
INDIRI4
CNSTI4 7
LEI4 $426
ADDRLP4 0
INDIRP4
CNSTI4 756
ADDP4
CNSTI4 7
ASGNI4
LABELV $426
ADDRFP4 4
INDIRP4
ARGP4
ADDRFP4 8
INDIRI4
ARGI4
ADDRGP4 $428
ARGP4
CNSTI4 94
ARGI4
ADDRLP4 0
INDIRP4
CNSTI4 756
ADDP4
INDIRI4
CNSTI4 48
ADDI4
ARGI4
ADDRLP4 0
INDIRP4
CNSTI4 636
ADDP4
INDIRP4
ARGP4
ADDRGP4 Com_sprintf
CALLI4
pop
ADDRGP4 $423
JUMPV
LABELV $422
ADDRFP4 4
INDIRP4
ARGP4
ADDRFP4 8
INDIRI4
ARGI4
ADDRGP4 $429
ARGP4
ADDRLP4 0
INDIRP4
CNSTI4 636
ADDP4
INDIRP4
ARGP4
ADDRGP4 Com_sprintf
CALLI4
pop
LABELV $423
CNSTI4 1
RETI4
LABELV $419
endproc Team_GetLocationMsg 12 24
export SelectRandomTeamSpawnPoint
proc SelectRandomTeamSpawnPoint 152 12
ADDRFP4 0
INDIRI4
CNSTI4 0
NEI4 $431
ADDRFP4 4
INDIRI4
CNSTI4 1
NEI4 $433
ADDRLP4 8
ADDRGP4 $435
ASGNP4
ADDRGP4 $432
JUMPV
LABELV $433
ADDRFP4 4
INDIRI4
CNSTI4 2
NEI4 $436
ADDRLP4 8
ADDRGP4 $438
ASGNP4
ADDRGP4 $432
JUMPV
LABELV $436
CNSTP4 0
RETP4
ADDRGP4 $430
JUMPV
LABELV $431
ADDRFP4 4
INDIRI4
CNSTI4 1
NEI4 $439
ADDRLP4 8
ADDRGP4 $441
ASGNP4
ADDRGP4 $440
JUMPV
LABELV $439
ADDRFP4 4
INDIRI4
CNSTI4 2
NEI4 $442
ADDRLP4 8
ADDRGP4 $444
ASGNP4
ADDRGP4 $443
JUMPV
LABELV $442
CNSTP4 0
RETP4
ADDRGP4 $430
JUMPV
LABELV $443
LABELV $440
LABELV $432
ADDRLP4 4
CNSTI4 0
ASGNI4
ADDRLP4 0
CNSTP4 0
ASGNP4
ADDRGP4 $446
JUMPV
LABELV $445
ADDRLP4 0
INDIRP4
ARGP4
ADDRLP4 144
ADDRGP4 SpotWouldTelefrag
CALLI4
ASGNI4
ADDRLP4 144
INDIRI4
CNSTI4 0
EQI4 $448
ADDRGP4 $446
JUMPV
LABELV $448
ADDRLP4 4
INDIRI4
CNSTI4 2
LSHI4
ADDRLP4 12
ADDP4
ADDRLP4 0
INDIRP4
ASGNP4
ADDRLP4 148
ADDRLP4 4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 4
ADDRLP4 148
INDIRI4
ASGNI4
ADDRLP4 148
INDIRI4
CNSTI4 32
NEI4 $450
ADDRGP4 $447
JUMPV
LABELV $450
LABELV $446
ADDRLP4 0
INDIRP4
ARGP4
CNSTI4 524
ARGI4
ADDRLP4 8
INDIRP4
ARGP4
ADDRLP4 144
ADDRGP4 G_Find
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 144
INDIRP4
ASGNP4
ADDRLP4 144
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $445
LABELV $447
ADDRLP4 4
INDIRI4
CNSTI4 0
NEI4 $452
CNSTP4 0
ARGP4
CNSTI4 524
ARGI4
ADDRLP4 8
INDIRP4
ARGP4
ADDRLP4 148
ADDRGP4 G_Find
CALLP4
ASGNP4
ADDRLP4 148
INDIRP4
RETP4
ADDRGP4 $430
JUMPV
LABELV $452
ADDRLP4 148
ADDRGP4 qk_rand
CALLI4
ASGNI4
ADDRLP4 140
ADDRLP4 148
INDIRI4
ADDRLP4 4
INDIRI4
MODI4
ASGNI4
ADDRLP4 140
INDIRI4
CNSTI4 2
LSHI4
ADDRLP4 12
ADDP4
INDIRP4
RETP4
LABELV $430
endproc SelectRandomTeamSpawnPoint 152 12
export SelectCTFSpawnPoint
proc SelectCTFSpawnPoint 12 16
ADDRFP4 4
INDIRI4
ARGI4
ADDRFP4 0
INDIRI4
ARGI4
ADDRLP4 4
ADDRGP4 SelectRandomTeamSpawnPoint
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 4
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $455
ADDRGP4 vec3_origin
ARGP4
ADDRFP4 8
INDIRP4
ARGP4
ADDRFP4 12
INDIRP4
ARGP4
ADDRFP4 16
INDIRI4
ARGI4
ADDRLP4 8
ADDRGP4 SelectSpawnPoint
CALLP4
ASGNP4
ADDRLP4 8
INDIRP4
RETP4
ADDRGP4 $454
JUMPV
LABELV $455
ADDRFP4 8
INDIRP4
ADDRLP4 0
INDIRP4
CNSTI4 92
ADDP4
INDIRB
ASGNB 12
ADDRLP4 8
ADDRFP4 8
INDIRP4
CNSTI4 8
ADDP4
ASGNP4
ADDRLP4 8
INDIRP4
ADDRLP4 8
INDIRP4
INDIRF4
CNSTF4 1091567616
ADDF4
ASGNF4
ADDRFP4 12
INDIRP4
ADDRLP4 0
INDIRP4
CNSTI4 116
ADDP4
INDIRB
ASGNB 12
ADDRLP4 0
INDIRP4
RETP4
LABELV $454
endproc SelectCTFSpawnPoint 12 16
proc SortClients 0 0
ADDRFP4 0
INDIRP4
INDIRI4
ADDRFP4 4
INDIRP4
INDIRI4
SUBI4
RETI4
LABELV $457
endproc SortClients 0 0
export TeamplayInfoMessage
proc TeamplayInfoMessage 9408 36
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 612
ADDP4
INDIRI4
CNSTI4 0
NEI4 $459
ADDRGP4 $458
JUMPV
LABELV $459
ADDRFP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
CNSTI4 3
NEI4 $461
ADDRLP4 9376
ADDRFP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
ASGNP4
ADDRLP4 9376
INDIRP4
CNSTI4 624
ADDP4
INDIRI4
CNSTI4 2
NEI4 $465
ADDRLP4 9376
INDIRP4
CNSTI4 628
ADDP4
INDIRI4
CNSTI4 0
GEI4 $463
LABELV $465
ADDRGP4 $458
JUMPV
LABELV $463
ADDRLP4 12
CNSTI4 804
ADDRFP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 628
ADDP4
INDIRI4
MULI4
ADDRGP4 g_entities+516
ADDP4
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
ASGNI4
ADDRGP4 $462
JUMPV
LABELV $461
ADDRLP4 12
ADDRFP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
ASGNI4
LABELV $462
ADDRLP4 12
INDIRI4
CNSTI4 1
EQI4 $467
ADDRLP4 12
INDIRI4
CNSTI4 2
EQI4 $467
ADDRGP4 $458
JUMPV
LABELV $467
ADDRLP4 9380
CNSTI4 0
ASGNI4
ADDRLP4 4
ADDRLP4 9380
INDIRI4
ASGNI4
ADDRLP4 8
ADDRLP4 9380
INDIRI4
ASGNI4
ADDRGP4 $472
JUMPV
LABELV $469
ADDRLP4 0
CNSTI4 804
ADDRLP4 4
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 level+84
ADDP4
INDIRI4
MULI4
ADDRGP4 g_entities
ADDP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 520
ADDP4
INDIRI4
CNSTI4 0
EQI4 $475
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
ADDRLP4 12
INDIRI4
NEI4 $475
ADDRLP4 9388
ADDRLP4 8
INDIRI4
ASGNI4
ADDRLP4 8
ADDRLP4 9388
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 9392
CNSTI4 2
ASGNI4
ADDRLP4 9388
INDIRI4
ADDRLP4 9392
INDIRI4
LSHI4
ADDRLP4 9248
ADDP4
ADDRLP4 4
INDIRI4
ADDRLP4 9392
INDIRI4
LSHI4
ADDRGP4 level+84
ADDP4
INDIRI4
ASGNI4
LABELV $475
LABELV $470
ADDRLP4 4
ADDRLP4 4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
LABELV $472
ADDRLP4 4
INDIRI4
ADDRGP4 g_maxclients+12
INDIRI4
GEI4 $478
ADDRLP4 8
INDIRI4
CNSTI4 32
LTI4 $469
LABELV $478
ADDRLP4 9248
ARGP4
ADDRLP4 8
INDIRI4
CVIU4 4
ARGU4
CNSTU4 4
ARGU4
ADDRGP4 SortClients
ARGP4
ADDRGP4 qk_qsort
CALLV
pop
ADDRLP4 1056
CNSTI1 0
ASGNI1
ADDRLP4 9384
CNSTI4 0
ASGNI4
ADDRLP4 1048
ADDRLP4 9384
INDIRI4
ASGNI4
ADDRLP4 4
ADDRLP4 9384
INDIRI4
ASGNI4
ADDRLP4 8
ADDRLP4 9384
INDIRI4
ASGNI4
ADDRGP4 $482
JUMPV
LABELV $479
ADDRLP4 0
CNSTI4 804
ADDRLP4 4
INDIRI4
MULI4
ADDRGP4 g_entities
ADDP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 520
ADDP4
INDIRI4
CNSTI4 0
EQI4 $484
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
ADDRLP4 12
INDIRI4
NEI4 $484
ADDRLP4 9392
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
ASGNP4
ADDRLP4 1040
ADDRLP4 9392
INDIRP4
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
ASGNI4
ADDRLP4 1044
ADDRLP4 9392
INDIRP4
INDIRP4
CNSTI4 196
ADDP4
INDIRI4
ASGNI4
ADDRLP4 1040
INDIRI4
CNSTI4 0
GEI4 $486
ADDRLP4 1040
CNSTI4 0
ASGNI4
LABELV $486
ADDRLP4 1044
INDIRI4
CNSTI4 0
GEI4 $488
ADDRLP4 1044
CNSTI4 0
ASGNI4
LABELV $488
ADDRLP4 16
ARGP4
CNSTI4 1024
ARGI4
ADDRGP4 $490
ARGP4
ADDRLP4 4
INDIRI4
ARGI4
ADDRLP4 9400
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
ASGNP4
ADDRLP4 9400
INDIRP4
CNSTI4 560
ADDP4
INDIRI4
ARGI4
ADDRLP4 1040
INDIRI4
ARGI4
ADDRLP4 1044
INDIRI4
ARGI4
ADDRLP4 9400
INDIRP4
CNSTI4 144
ADDP4
INDIRI4
ARGI4
ADDRLP4 0
INDIRP4
CNSTI4 188
ADDP4
INDIRI4
ARGI4
ADDRGP4 Com_sprintf
CALLI4
pop
ADDRLP4 16
ARGP4
ADDRLP4 9404
ADDRGP4 qk_strlen
CALLU4
ASGNU4
ADDRLP4 1052
ADDRLP4 9404
INDIRU4
CVUI4 4
ASGNI4
ADDRLP4 1048
INDIRI4
ADDRLP4 1052
INDIRI4
ADDI4
CVIU4 4
CNSTU4 8192
LTU4 $491
ADDRGP4 $481
JUMPV
LABELV $491
ADDRLP4 1048
INDIRI4
ADDRLP4 1056
ADDP4
ARGP4
ADDRLP4 16
ARGP4
ADDRGP4 qk_strcpy
CALLP4
pop
ADDRLP4 1048
ADDRLP4 1048
INDIRI4
ADDRLP4 1052
INDIRI4
ADDI4
ASGNI4
ADDRLP4 8
ADDRLP4 8
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
LABELV $484
LABELV $480
ADDRLP4 4
ADDRLP4 4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
LABELV $482
ADDRLP4 4
INDIRI4
ADDRGP4 g_maxclients+12
INDIRI4
GEI4 $493
ADDRLP4 8
INDIRI4
CNSTI4 32
LTI4 $479
LABELV $493
LABELV $481
ADDRGP4 $494
ARGP4
ADDRLP4 8
INDIRI4
ARGI4
ADDRLP4 1056
ARGP4
ADDRLP4 9388
ADDRGP4 va
CALLP4
ASGNP4
ADDRFP4 0
INDIRP4
CVPU4 4
ADDRGP4 g_entities
CVPU4 4
SUBU4
CVUI4 4
CNSTI4 804
DIVI4
ARGI4
ADDRLP4 9388
INDIRP4
ARGP4
ADDRGP4 trap_SendServerCommand
CALLV
pop
LABELV $458
endproc TeamplayInfoMessage 9408 36
export CheckTeamStatus
proc CheckTeamStatus 24 4
ADDRGP4 level+32
INDIRI4
ADDRGP4 level+60
INDIRI4
SUBI4
CNSTI4 1000
LEI4 $496
ADDRGP4 level+60
ADDRGP4 level+32
INDIRI4
ASGNI4
ADDRLP4 4
CNSTI4 0
ASGNI4
ADDRGP4 $505
JUMPV
LABELV $502
ADDRLP4 0
CNSTI4 804
ADDRLP4 4
INDIRI4
MULI4
ADDRGP4 g_entities
ADDP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 468
ADDP4
INDIRI4
CNSTI4 2
EQI4 $507
ADDRGP4 $503
JUMPV
LABELV $507
ADDRLP4 0
INDIRP4
CNSTI4 520
ADDP4
INDIRI4
CNSTI4 0
EQI4 $509
ADDRLP4 16
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
ASGNI4
ADDRLP4 16
INDIRI4
CNSTI4 1
EQI4 $511
ADDRLP4 16
INDIRI4
CNSTI4 2
NEI4 $509
LABELV $511
ADDRLP4 0
INDIRP4
ARGP4
ADDRLP4 20
ADDRGP4 Team_GetLocation
CALLP4
ASGNP4
ADDRLP4 8
ADDRLP4 20
INDIRP4
ASGNP4
ADDRLP4 8
INDIRP4
CVPU4 4
CNSTU4 0
EQU4 $512
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 560
ADDP4
ADDRLP4 8
INDIRP4
CNSTI4 728
ADDP4
INDIRI4
ASGNI4
ADDRGP4 $513
JUMPV
LABELV $512
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 560
ADDP4
CNSTI4 0
ASGNI4
LABELV $513
LABELV $509
LABELV $503
ADDRLP4 4
ADDRLP4 4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
LABELV $505
ADDRLP4 4
INDIRI4
ADDRGP4 g_maxclients+12
INDIRI4
LTI4 $502
ADDRLP4 4
CNSTI4 0
ASGNI4
ADDRGP4 $517
JUMPV
LABELV $514
ADDRLP4 0
CNSTI4 804
ADDRLP4 4
INDIRI4
MULI4
ADDRGP4 g_entities
ADDP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 468
ADDP4
INDIRI4
CNSTI4 2
EQI4 $519
ADDRGP4 $515
JUMPV
LABELV $519
ADDRLP4 0
INDIRP4
CNSTI4 520
ADDP4
INDIRI4
CNSTI4 0
EQI4 $521
ADDRLP4 0
INDIRP4
ARGP4
ADDRGP4 TeamplayInfoMessage
CALLV
pop
LABELV $521
LABELV $515
ADDRLP4 4
ADDRLP4 4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
LABELV $517
ADDRLP4 4
INDIRI4
ADDRGP4 g_maxclients+12
INDIRI4
LTI4 $514
LABELV $496
LABELV $495
endproc CheckTeamStatus 24 4
export SP_team_CTF_redplayer
proc SP_team_CTF_redplayer 0 0
LABELV $523
endproc SP_team_CTF_redplayer 0 0
export SP_team_CTF_blueplayer
proc SP_team_CTF_blueplayer 0 0
LABELV $524
endproc SP_team_CTF_blueplayer 0 0
export SP_team_CTF_redspawn
proc SP_team_CTF_redspawn 0 0
LABELV $525
endproc SP_team_CTF_redspawn 0 0
export SP_team_CTF_bluespawn
proc SP_team_CTF_bluespawn 0 0
LABELV $526
endproc SP_team_CTF_bluespawn 0 0
bss
export neutralObelisk
align 4
LABELV neutralObelisk
skip 4
export teamgame
align 4
LABELV teamgame
skip 36
import trap_SnapVector
import trap_GeneticParentsAndChildSelection
import trap_BotResetWeaponState
import trap_BotFreeWeaponState
import trap_BotAllocWeaponState
import trap_BotLoadWeaponWeights
import trap_BotGetWeaponInfo
import trap_BotChooseBestFightWeapon
import trap_BotAddAvoidSpot
import trap_BotInitMoveState
import trap_BotFreeMoveState
import trap_BotAllocMoveState
import trap_BotPredictVisiblePosition
import trap_BotMovementViewTarget
import trap_BotReachabilityArea
import trap_BotResetLastAvoidReach
import trap_BotResetAvoidReach
import trap_BotMoveInDirection
import trap_BotMoveToGoal
import trap_BotResetMoveState
import trap_BotFreeGoalState
import trap_BotAllocGoalState
import trap_BotMutateGoalFuzzyLogic
import trap_BotSaveGoalFuzzyLogic
import trap_BotInterbreedGoalFuzzyLogic
import trap_BotFreeItemWeights
import trap_BotLoadItemWeights
import trap_BotUpdateEntityItems
import trap_BotInitLevelItems
import trap_BotSetAvoidGoalTime
import trap_BotAvoidGoalTime
import trap_BotGetLevelItemGoal
import trap_BotGetMapLocationGoal
import trap_BotGetNextCampSpotGoal
import trap_BotItemGoalInVisButNotVisible
import trap_BotTouchingGoal
import trap_BotChooseNBGItem
import trap_BotChooseLTGItem
import trap_BotGetSecondGoal
import trap_BotGetTopGoal
import trap_BotGoalName
import trap_BotDumpGoalStack
import trap_BotDumpAvoidGoals
import trap_BotEmptyGoalStack
import trap_BotPopGoal
import trap_BotPushGoal
import trap_BotResetAvoidGoals
import trap_BotRemoveFromAvoidGoals
import trap_BotResetGoalState
import trap_BotSetChatName
import trap_BotSetChatGender
import trap_BotLoadChatFile
import trap_BotReplaceSynonyms
import trap_UnifyWhiteSpaces
import trap_BotMatchVariable
import trap_BotFindMatch
import trap_StringContains
import trap_BotGetChatMessage
import trap_BotEnterChat
import trap_BotChatLength
import trap_BotReplyChat
import trap_BotNumInitialChats
import trap_BotInitialChat
import trap_BotNumConsoleMessages
import trap_BotNextConsoleMessage
import trap_BotRemoveConsoleMessage
import trap_BotQueueConsoleMessage
import trap_BotFreeChatState
import trap_BotAllocChatState
import trap_Characteristic_String
import trap_Characteristic_BInteger
import trap_Characteristic_Integer
import trap_Characteristic_BFloat
import trap_Characteristic_Float
import trap_BotFreeCharacter
import trap_BotLoadCharacter
import trap_EA_ResetInput
import trap_EA_GetInput
import trap_EA_EndRegular
import trap_EA_View
import trap_EA_Move
import trap_EA_DelayedJump
import trap_EA_Jump
import trap_EA_SelectWeapon
import trap_EA_MoveRight
import trap_EA_MoveLeft
import trap_EA_MoveBack
import trap_EA_MoveForward
import trap_EA_MoveDown
import trap_EA_MoveUp
import trap_EA_Crouch
import trap_EA_Respawn
import trap_EA_Use
import trap_EA_Attack
import trap_EA_Talk
import trap_EA_Gesture
import trap_EA_Action
import trap_EA_Command
import trap_EA_SayTeam
import trap_EA_Say
import trap_AAS_PredictClientMovement
import trap_AAS_Swimming
import trap_AAS_AlternativeRouteGoals
import trap_AAS_PredictRoute
import trap_AAS_EnableRoutingArea
import trap_AAS_AreaTravelTimeToGoalArea
import trap_AAS_AreaReachability
import trap_AAS_IntForBSPEpairKey
import trap_AAS_FloatForBSPEpairKey
import trap_AAS_VectorForBSPEpairKey
import trap_AAS_ValueForBSPEpairKey
import trap_AAS_NextBSPEntity
import trap_AAS_PointContents
import trap_AAS_TraceAreas
import trap_AAS_PointReachabilityAreaIndex
import trap_AAS_PointAreaNum
import trap_AAS_Time
import trap_AAS_PresenceTypeBoundingBox
import trap_AAS_Initialized
import trap_AAS_EntityInfo
import trap_AAS_AreaInfo
import trap_AAS_BBoxAreas
import trap_BotUserCommand
import trap_BotGetServerCommand
import trap_BotGetSnapshotEntity
import trap_BotLibTest
import trap_BotLibUpdateEntity
import trap_BotLibLoadMap
import trap_BotLibStartFrame
import trap_BotLibDefine
import trap_BotLibVarGet
import trap_BotLibVarSet
import trap_BotLibShutdown
import trap_BotLibSetup
import trap_DebugPolygonDelete
import trap_DebugPolygonCreate
import trap_GetEntityToken
import trap_GetUsercmd
import trap_BotFreeClient
import trap_BotAllocateClient
import trap_EntityContact
import trap_EntitiesInBox
import trap_UnlinkEntity
import trap_LinkEntity
import trap_AreasConnected
import trap_AdjustAreaPortalState
import trap_InPVSIgnorePortals
import trap_InPVS
import trap_PointContents
import trap_Trace
import trap_SetBrushModel
import trap_GetServerinfo
import trap_SetUserinfo
import trap_GetUserinfo
import trap_GetConfigstring
import trap_SetConfigstring
import trap_SendServerCommand
import trap_DropClient
import trap_LocateGameData
import trap_Cvar_VariableStringBuffer
import trap_Cvar_VariableValue
import trap_Cvar_VariableIntegerValue
import trap_Cvar_Set
import trap_Cvar_Update
import trap_Cvar_Register
import trap_SendConsoleCommand
import trap_FS_Seek
import trap_FS_GetFileList
import trap_FS_FCloseFile
import trap_FS_Write
import trap_FS_Read
import trap_FS_FOpenFile
import trap_Args
import trap_Argv
import trap_Argc
import trap_RealTime
import trap_Milliseconds
import trap_Error
import trap_Print
import g_proxMineTimeout
import g_singlePlayer
import g_enableBreath
import g_enableDust
import g_rankings
import pmove_msec
import pmove_fixed
import g_smoothClients
import g_blueteam
import g_redteam
import g_cubeTimeout
import g_obeliskRespawnDelay
import g_obeliskRegenAmount
import g_obeliskRegenPeriod
import g_obeliskHealth
import g_filterBan
import g_banIPs
import g_teamForceBalance
import g_teamAutoJoin
import g_allowVote
import g_blood
import g_doWarmup
import g_warmup
import g_motd
import g_synchronousClients
import g_weaponTeamRespawn
import g_weaponRespawn
import g_debugDamage
import g_debugAlloc
import g_debugMove
import g_inactivity
import g_forcerespawn
import g_quadfactor
import g_knockback
import g_speed
import g_gravity
import g_needpass
import g_password
import g_friendlyFire
import g_capturelimit
import g_timelimit
import g_fraglimit
import g_dmflags
import g_restarted
import g_maxGameClients
import g_maxclients
import g_cheats
import g_dedicated
import g_gametype
import g_entities
import level
import BotTestAAS
import BotAIStartFrame
import BotAIShutdownClient
import BotAISetupClient
import BotAILoadMap
import BotAIShutdown
import BotAISetup
import BotInterbreedEndMatch
import Svcmd_BotList_f
import Svcmd_AddBot_f
import G_BotConnect
import G_RemoveQueuedBotBegin
import G_CheckBotSpawn
import G_GetBotInfoByName
import G_GetBotInfoByNumber
import G_InitBots
import Svcmd_AbortPodium_f
import SpawnModelsOnVictoryPads
import UpdateTournamentInfo
import G_WriteSessionData
import G_InitWorldSession
import G_InitSessionData
import G_ReadSessionData
import Svcmd_GameMem_f
import G_InitMemory
import G_Alloc
import CheckObeliskAttack
import G_RunClient
import ClientEndFrame
import ClientThink
import ClientCommand
import ClientBegin
import ClientDisconnect
import ClientUserinfoChanged
import ClientConnect
import G_Error
import G_Printf
import SendScoreboardMessageToAllClients
import G_LogPrintf
import AddTournamentQueue
import G_RunThink
import CheckTeamLeader
import SetLeader
import FindIntermissionPoint
import MoveClientToIntermission
import DeathmatchScoreboardMessage
import FireWeapon
import G_FilterPacket
import G_ProcessIPBans
import ConsoleCommand
import SpotWouldTelefrag
import CalculateRanks
import AddScore
import player_die
import ClientSpawn
import InitBodyQue
import BeginIntermission
import ClientRespawn
import CopyToBodyQue
import SelectSpawnPoint
import SetClientViewAngle
import PickTeam
import TeamLeader
import TeamCount
import Weapon_HookThink
import Weapon_HookFree
import CheckGauntletAttack
import SnapVectorTowards
import CalcMuzzlePoint
import LogAccuracyHit
import TeleportPlayer
import trigger_teleporter_touch
import Touch_DoorTrigger
import G_RunMover
import fire_grapple
import fire_bfg
import fire_rocket
import fire_grenade
import fire_plasma
import G_RunMissile
import TossClientCubes
import TossClientItems
import body_die
import G_InvulnerabilityEffect
import G_RadiusDamage
import G_Damage
import CanDamage
import BuildShaderStateConfig
import AddRemap
import G_SetOrigin
import G_AddEvent
import G_AddPredictableEvent
import vectoyaw
import vtos
import tv
import G_TouchTriggers
import G_EntitiesFree
import G_FreeEntity
import G_Sound
import G_TempEntity
import G_Spawn
import G_InitGentity
import G_SetMovedir
import G_UseTargets
import G_PickTarget
import G_Find
import G_KillBox
import G_TeamCommand
import G_SoundIndex
import G_ModelIndex
import SaveRegisteredItems
import RegisterItem
import ClearRegisteredItems
import Touch_Item
import Add_Ammo
import ArmorIndex
import Think_Weapon
import FinishSpawningItem
import G_SpawnItem
import SetRespawn
import LaunchItem
import Drop_Item
import PrecacheItem
import UseHoldableItem
import RespawnItem
import G_RunItem
import G_CheckTeamItems
import Cmd_FollowCycle_f
import SetTeam
import BroadcastTeamChange
import StopFollowing
import Cmd_Score_f
import G_NewString
import G_SpawnEntitiesFromString
import G_SpawnVector
import G_SpawnInt
import G_SpawnFloat
import G_SpawnString
import BG_PlayerTouchesItem
import BG_PlayerStateToEntityStateExtraPolate
import BG_PlayerStateToEntityState
import BG_TouchJumpPad
import BG_AddPredictableEventToPlayerstate
import BG_EvaluateTrajectoryDelta
import BG_EvaluateTrajectory
import BG_CanItemBeGrabbed
import BG_FindItemForHoldable
import BG_FindItemForPowerup
import BG_FindItemForWeapon
import BG_FindItem
import bg_numItems
import bg_itemlist
import Pmove
import PM_UpdateViewAngles
import Com_Printf
import Com_Error
import Info_NextPair
import Info_Validate
import Info_SetValueForKey_Big
import Info_SetValueForKey
import Info_RemoveKey_Big
import Info_RemoveKey
import Info_ValueForKey
import Com_TruncateLongString
import va
import Q_CountChar
import Q_CleanStr
import Q_PrintStrlen
import Q_strcat
import Q_strncpyz
import Q_stristr
import Q_strupr
import Q_strlwr
import Q_stricmpn
import Q_strncmp
import Q_stricmp
import Q_isintegral
import Q_isanumber
import Q_isalpha
import Q_isupper
import Q_islower
import Q_isprint
import Com_RandomBytes
import Com_SkipCharset
import Com_SkipTokens
import Com_sprintf
import Com_HexStrToInt
import Parse3DMatrix
import Parse2DMatrix
import Parse1DMatrix
import SkipRestOfLine
import SkipBracedSection
import COM_MatchToken
import COM_ParseWarning
import COM_ParseError
import COM_Compress
import COM_ParseExt
import COM_Parse
import COM_GetCurrentParseLine
import COM_BeginParseSession
import COM_DefaultExtension
import COM_CompareExtension
import COM_StripExtension
import COM_GetExtension
import COM_SkipPath
import Com_Clamp
import PerpendicularVector
import AngleVectors
import MatrixMultiply
import MakeNormalVectors
import RotateAroundDirection
import RotatePointAroundVector
import ProjectPointOnPlane
import PlaneFromPoints
import AngleDelta
import AngleNormalize180
import AngleNormalize360
import AnglesSubtract
import AngleSubtract
import LerpAngle
import AngleMod
import BoundsIntersectPoint
import BoundsIntersectSphere
import BoundsIntersect
import BoxOnPlaneSide
import SetPlaneSignbits
import AxisCopy
import AxisClear
import AnglesToAxis
import vectoangles
import Q_crandom
import Q_random
import Q_rand
import Q_acos
import Q_log2
import VectorRotate
import Vector4Scale
import VectorNormalize2
import VectorNormalize
import CrossProduct
import VectorInverse
import VectorNormalizeFast
import DistanceSquared
import Distance
import VectorLengthSquared
import VectorLength
import VectorCompare
import AddPointToBounds
import ClearBounds
import RadiusFromBounds
import NormalizeColor
import ColorBytes4
import ColorBytes3
import _VectorMA
import _VectorScale
import _VectorCopy
import _VectorAdd
import _VectorSubtract
import _DotProduct
import ByteToDir
import DirToByte
import ClampShort
import ClampChar
import Q_rsqrt
import Q_fabs
import Q_isnan
import axisDefault
import vec3_origin
import g_color_table
import colorDkGrey
import colorMdGrey
import colorLtGrey
import colorWhite
import colorCyan
import colorMagenta
import colorYellow
import colorBlue
import colorGreen
import colorRed
import colorBlack
import bytedirs
import Hunk_AllocDebug
import FloatSwap
import LongSwap
import ShortSwap
import CopyLongSwap
import CopyShortSwap
import qk_acos
import qk_fabs
import qk_abs
import qk_tan
import qk_atan2
import qk_cos
import qk_sin
import qk_sqrt
import qk_floor
import qk_ceil
import qk_memcpy
import qk_memset
import qk_memmove
import qk_sscanf
import qk_vsnprintf
import qk_strtol
import qk_atoi
import qk_strtod
import qk_atof
import qk_toupper
import qk_tolower
import qk_strncpy
import qk_strstr
import qk_strrchr
import qk_strchr
import qk_strcmp
import qk_strcpy
import qk_strcat
import qk_strlen
import qk_rand
import qk_srand
import qk_qsort
lit
align 1
LABELV $494
byte 1 116
byte 1 105
byte 1 110
byte 1 102
byte 1 111
byte 1 32
byte 1 37
byte 1 105
byte 1 32
byte 1 37
byte 1 115
byte 1 0
align 1
LABELV $490
byte 1 32
byte 1 37
byte 1 105
byte 1 32
byte 1 37
byte 1 105
byte 1 32
byte 1 37
byte 1 105
byte 1 32
byte 1 37
byte 1 105
byte 1 32
byte 1 37
byte 1 105
byte 1 32
byte 1 37
byte 1 105
byte 1 0
align 1
LABELV $444
byte 1 116
byte 1 101
byte 1 97
byte 1 109
byte 1 95
byte 1 67
byte 1 84
byte 1 70
byte 1 95
byte 1 98
byte 1 108
byte 1 117
byte 1 101
byte 1 115
byte 1 112
byte 1 97
byte 1 119
byte 1 110
byte 1 0
align 1
LABELV $441
byte 1 116
byte 1 101
byte 1 97
byte 1 109
byte 1 95
byte 1 67
byte 1 84
byte 1 70
byte 1 95
byte 1 114
byte 1 101
byte 1 100
byte 1 115
byte 1 112
byte 1 97
byte 1 119
byte 1 110
byte 1 0
align 1
LABELV $438
byte 1 116
byte 1 101
byte 1 97
byte 1 109
byte 1 95
byte 1 67
byte 1 84
byte 1 70
byte 1 95
byte 1 98
byte 1 108
byte 1 117
byte 1 101
byte 1 112
byte 1 108
byte 1 97
byte 1 121
byte 1 101
byte 1 114
byte 1 0
align 1
LABELV $435
byte 1 116
byte 1 101
byte 1 97
byte 1 109
byte 1 95
byte 1 67
byte 1 84
byte 1 70
byte 1 95
byte 1 114
byte 1 101
byte 1 100
byte 1 112
byte 1 108
byte 1 97
byte 1 121
byte 1 101
byte 1 114
byte 1 0
align 1
LABELV $429
byte 1 37
byte 1 115
byte 1 0
align 1
LABELV $428
byte 1 37
byte 1 99
byte 1 37
byte 1 99
byte 1 37
byte 1 115
byte 1 94
byte 1 55
byte 1 0
align 1
LABELV $402
byte 1 68
byte 1 111
byte 1 110
byte 1 39
byte 1 116
byte 1 32
byte 1 107
byte 1 110
byte 1 111
byte 1 119
byte 1 32
byte 1 119
byte 1 104
byte 1 97
byte 1 116
byte 1 32
byte 1 116
byte 1 101
byte 1 97
byte 1 109
byte 1 32
byte 1 116
byte 1 104
byte 1 101
byte 1 32
byte 1 102
byte 1 108
byte 1 97
byte 1 103
byte 1 32
byte 1 105
byte 1 115
byte 1 32
byte 1 111
byte 1 110
byte 1 46
byte 1 10
byte 1 0
align 1
LABELV $393
byte 1 37
byte 1 115
byte 1 94
byte 1 55
byte 1 32
byte 1 103
byte 1 111
byte 1 116
byte 1 32
byte 1 116
byte 1 104
byte 1 101
byte 1 32
byte 1 37
byte 1 115
byte 1 32
byte 1 102
byte 1 108
byte 1 97
byte 1 103
byte 1 33
byte 1 10
byte 1 0
align 1
LABELV $368
byte 1 37
byte 1 115
byte 1 94
byte 1 55
byte 1 32
byte 1 99
byte 1 97
byte 1 112
byte 1 116
byte 1 117
byte 1 114
byte 1 101
byte 1 100
byte 1 32
byte 1 116
byte 1 104
byte 1 101
byte 1 32
byte 1 37
byte 1 115
byte 1 32
byte 1 102
byte 1 108
byte 1 97
byte 1 103
byte 1 33
byte 1 10
byte 1 0
align 1
LABELV $364
byte 1 37
byte 1 115
byte 1 94
byte 1 55
byte 1 32
byte 1 114
byte 1 101
byte 1 116
byte 1 117
byte 1 114
byte 1 110
byte 1 101
byte 1 100
byte 1 32
byte 1 116
byte 1 104
byte 1 101
byte 1 32
byte 1 37
byte 1 115
byte 1 32
byte 1 102
byte 1 108
byte 1 97
byte 1 103
byte 1 33
byte 1 10
byte 1 0
align 1
LABELV $344
byte 1 84
byte 1 104
byte 1 101
byte 1 32
byte 1 37
byte 1 115
byte 1 32
byte 1 102
byte 1 108
byte 1 97
byte 1 103
byte 1 32
byte 1 104
byte 1 97
byte 1 115
byte 1 32
byte 1 114
byte 1 101
byte 1 116
byte 1 117
byte 1 114
byte 1 110
byte 1 101
byte 1 100
byte 1 33
byte 1 10
byte 1 0
align 1
LABELV $343
byte 1 84
byte 1 104
byte 1 101
byte 1 32
byte 1 102
byte 1 108
byte 1 97
byte 1 103
byte 1 32
byte 1 104
byte 1 97
byte 1 115
byte 1 32
byte 1 114
byte 1 101
byte 1 116
byte 1 117
byte 1 114
byte 1 110
byte 1 101
byte 1 100
byte 1 33
byte 1 10
byte 1 0
align 1
LABELV $337
byte 1 87
byte 1 97
byte 1 114
byte 1 110
byte 1 105
byte 1 110
byte 1 103
byte 1 58
byte 1 32
byte 1 32
byte 1 78
byte 1 85
byte 1 76
byte 1 76
byte 1 32
byte 1 112
byte 1 97
byte 1 115
byte 1 115
byte 1 101
byte 1 100
byte 1 32
byte 1 116
byte 1 111
byte 1 32
byte 1 84
byte 1 101
byte 1 97
byte 1 109
byte 1 95
byte 1 67
byte 1 97
byte 1 112
byte 1 116
byte 1 117
byte 1 114
byte 1 101
byte 1 70
byte 1 108
byte 1 97
byte 1 103
byte 1 83
byte 1 111
byte 1 117
byte 1 110
byte 1 100
byte 1 10
byte 1 0
align 1
LABELV $309
byte 1 87
byte 1 97
byte 1 114
byte 1 110
byte 1 105
byte 1 110
byte 1 103
byte 1 58
byte 1 32
byte 1 32
byte 1 78
byte 1 85
byte 1 76
byte 1 76
byte 1 32
byte 1 112
byte 1 97
byte 1 115
byte 1 115
byte 1 101
byte 1 100
byte 1 32
byte 1 116
byte 1 111
byte 1 32
byte 1 84
byte 1 101
byte 1 97
byte 1 109
byte 1 95
byte 1 84
byte 1 97
byte 1 107
byte 1 101
byte 1 70
byte 1 108
byte 1 97
byte 1 103
byte 1 83
byte 1 111
byte 1 117
byte 1 110
byte 1 100
byte 1 10
byte 1 0
align 1
LABELV $303
byte 1 87
byte 1 97
byte 1 114
byte 1 110
byte 1 105
byte 1 110
byte 1 103
byte 1 58
byte 1 32
byte 1 32
byte 1 78
byte 1 85
byte 1 76
byte 1 76
byte 1 32
byte 1 112
byte 1 97
byte 1 115
byte 1 115
byte 1 101
byte 1 100
byte 1 32
byte 1 116
byte 1 111
byte 1 32
byte 1 84
byte 1 101
byte 1 97
byte 1 109
byte 1 95
byte 1 82
byte 1 101
byte 1 116
byte 1 117
byte 1 114
byte 1 110
byte 1 70
byte 1 108
byte 1 97
byte 1 103
byte 1 83
byte 1 111
byte 1 117
byte 1 110
byte 1 100
byte 1 10
byte 1 0
align 1
LABELV $290
byte 1 116
byte 1 101
byte 1 97
byte 1 109
byte 1 95
byte 1 67
byte 1 84
byte 1 70
byte 1 95
byte 1 110
byte 1 101
byte 1 117
byte 1 116
byte 1 114
byte 1 97
byte 1 108
byte 1 102
byte 1 108
byte 1 97
byte 1 103
byte 1 0
align 1
LABELV $237
byte 1 116
byte 1 101
byte 1 97
byte 1 109
byte 1 95
byte 1 67
byte 1 84
byte 1 70
byte 1 95
byte 1 98
byte 1 108
byte 1 117
byte 1 101
byte 1 102
byte 1 108
byte 1 97
byte 1 103
byte 1 0
align 1
LABELV $235
byte 1 116
byte 1 101
byte 1 97
byte 1 109
byte 1 95
byte 1 67
byte 1 84
byte 1 70
byte 1 95
byte 1 114
byte 1 101
byte 1 100
byte 1 102
byte 1 108
byte 1 97
byte 1 103
byte 1 0
align 1
LABELV $215
byte 1 37
byte 1 115
byte 1 94
byte 1 55
byte 1 32
byte 1 102
byte 1 114
byte 1 97
byte 1 103
byte 1 103
byte 1 101
byte 1 100
byte 1 32
byte 1 37
byte 1 115
byte 1 39
byte 1 115
byte 1 32
byte 1 115
byte 1 107
byte 1 117
byte 1 108
byte 1 108
byte 1 32
byte 1 99
byte 1 97
byte 1 114
byte 1 114
byte 1 105
byte 1 101
byte 1 114
byte 1 33
byte 1 10
byte 1 0
align 1
LABELV $204
byte 1 37
byte 1 115
byte 1 94
byte 1 55
byte 1 32
byte 1 102
byte 1 114
byte 1 97
byte 1 103
byte 1 103
byte 1 101
byte 1 100
byte 1 32
byte 1 37
byte 1 115
byte 1 39
byte 1 115
byte 1 32
byte 1 102
byte 1 108
byte 1 97
byte 1 103
byte 1 32
byte 1 99
byte 1 97
byte 1 114
byte 1 114
byte 1 105
byte 1 101
byte 1 114
byte 1 33
byte 1 10
byte 1 0
align 1
LABELV $96
byte 1 112
byte 1 114
byte 1 105
byte 1 110
byte 1 116
byte 1 32
byte 1 34
byte 1 37
byte 1 115
byte 1 34
byte 1 0
align 1
LABELV $91
byte 1 80
byte 1 114
byte 1 105
byte 1 110
byte 1 116
byte 1 77
byte 1 115
byte 1 103
byte 1 32
byte 1 111
byte 1 118
byte 1 101
byte 1 114
byte 1 114
byte 1 117
byte 1 110
byte 1 0
align 1
LABELV $86
byte 1 94
byte 1 55
byte 1 0
align 1
LABELV $85
byte 1 94
byte 1 51
byte 1 0
align 1
LABELV $82
byte 1 94
byte 1 52
byte 1 0
align 1
LABELV $79
byte 1 94
byte 1 49
byte 1 0
align 1
LABELV $75
byte 1 70
byte 1 82
byte 1 69
byte 1 69
byte 1 0
align 1
LABELV $74
byte 1 83
byte 1 80
byte 1 69
byte 1 67
byte 1 84
byte 1 65
byte 1 84
byte 1 79
byte 1 82
byte 1 0
align 1
LABELV $71
byte 1 66
byte 1 76
byte 1 85
byte 1 69
byte 1 0
align 1
LABELV $68
byte 1 82
byte 1 69
byte 1 68
byte 1 0
| 10.961852 | 45 | 0.831172 |
dd98eca6511e3fd7db1cc2c998342940041ca639 | 292 | go | Go | 04_quicksort/golang/04_recursive_max.go | filchyboy/grokking_algorithms_work | 16dace97610e2cb0938704e2b8cfd6e92d6b024d | [
"MIT"
] | 13 | 2021-03-11T00:25:22.000Z | 2022-03-19T00:19:23.000Z | book04grokkingAlgo/04_quicksort/golang/04_recursive_max.go | mcuallen/CodeLrn2019 | adc727d92904c5c5d445a2621813dfa99474206d | [
"Apache-2.0"
] | 160 | 2021-04-26T19:04:15.000Z | 2022-03-26T20:18:37.000Z | book04grokkingAlgo/04_quicksort/golang/04_recursive_max.go | mcuallen/CodeLrn2019 | adc727d92904c5c5d445a2621813dfa99474206d | [
"Apache-2.0"
] | 12 | 2021-04-26T19:43:01.000Z | 2022-01-31T08:36:29.000Z | package main
import "fmt"
func max(list []int) int {
if len(list) == 2 {
if list[0] > list[1] {
return list[0]
}
return list[1]
}
subMax := max(list[1:])
if list[0] > subMax {
return list[0]
}
return subMax
}
func main() {
fmt.Println(max([]int{1, 5, 10, 25, 16, 1}))
}
| 12.695652 | 45 | 0.561644 |
9a9ce14cda49a7b5591769f1dac6318c4a393a98 | 288 | lua | Lua | game/dota_addons/dota_imba_reborn/scripts/vscripts/components/modifiers/mutation/modifier_no_health_bar.lua | naowin/dota_imba | 6cb1df7a5ddb69f624042dd277434f1b9608ac10 | [
"Apache-2.0"
] | 2 | 2017-08-16T08:38:02.000Z | 2017-08-23T21:19:25.000Z | game/dota_addons/dota_imba_reborn/scripts/vscripts/components/modifiers/mutation/modifier_no_health_bar.lua | naowin/dota_imba | 6cb1df7a5ddb69f624042dd277434f1b9608ac10 | [
"Apache-2.0"
] | 30 | 2017-08-11T07:32:36.000Z | 2017-08-30T08:19:12.000Z | game/dota_addons/dota_imba_reborn/scripts/vscripts/components/modifiers/mutation/modifier_no_health_bar.lua | naowin/dota_imba | 6cb1df7a5ddb69f624042dd277434f1b9608ac10 | [
"Apache-2.0"
] | 10 | 2017-08-12T09:23:13.000Z | 2017-08-30T03:17:27.000Z | modifier_no_health_bar = class({})
function modifier_no_health_bar:IsHidden() return true end
function modifier_no_health_bar:RemoveOnDeath() return false end
function modifier_no_health_bar:CheckState()
local state =
{
[MODIFIER_STATE_NO_HEALTH_BAR] = true,
}
return state
end
| 20.571429 | 64 | 0.802083 |
e92d185a6bc768d3bbbbe90a8241e3cd5b9a6ddd | 1,745 | rb | Ruby | model/roomba/ai/path_finder.rb | WojciechKo/lecture-assignment-wmh | 6207a34f236966e160757d08936cca0981000ae1 | [
"Unlicense"
] | 1 | 2018-06-15T11:05:37.000Z | 2018-06-15T11:05:37.000Z | model/roomba/ai/path_finder.rb | WojciechKo/self-driving-vacuum-cleaner | 6207a34f236966e160757d08936cca0981000ae1 | [
"Unlicense"
] | null | null | null | model/roomba/ai/path_finder.rb | WojciechKo/self-driving-vacuum-cleaner | 6207a34f236966e160757d08936cca0981000ae1 | [
"Unlicense"
] | null | null | null | class PathFinder
MOVES = [:left, :right, :up, :down]
def initialize(mapper)
@mapper = mapper
end
def path_to(field)
(1..1000).each do |n|
path = n_steps_paths(n).find { |vector, path| path.destination_field == field }
return path[1].moves unless path.nil?
end
end
private
def n_steps_paths(n)
if n == 1
@paths = {[0, 0] => Path.new([], @mapper)}
@paths.merge!(MOVES.map { |m| Path.new([m], @mapper) }
.select { |p| p.destination_field != :blocked }
.inject({}) { |result, path| result[path.vector] = path; result })
else
@paths = @paths
.select { |vector, path| path.moves.size == (n -1) }
.values
.map(&:moves)
.product(MOVES)
.map { |p| Path.new(p[0] + [p[1]], @mapper) }
.select { |p| p.destination_field != :blocked }
.inject({}) { |result, path| result[path.vector] = path; result }
.merge(@paths)
@paths.select { |vector, path| path.moves.size == n }
end
end
end
class Path
attr_reader :moves
def initialize(moves, mapper)
@moves = moves
@mapper = mapper
end
def destination_field
coordinates = @mapper.coordinates.zip(vector).map { |pair| pair[0] + pair[1] }
@mapper.map.field(*coordinates)
end
def to_s
moves.to_s
end
def vector
@vector ||= moves.inject([0, 0]) do |vector, move|
case move
when :right
vector[0] += 1
when :left
vector[0] -= 1
when :up
vector[1] += 1
when :down
vector[1] -= 1
end
vector
end
end
end
| 24.577465 | 90 | 0.508883 |
4c01b78ce28fa867e96753de193e2551cdcb7d18 | 2,624 | swift | Swift | Tests/GraphTests/GraphTests.swift | pkrll/Graph.swift | 46148cb857be1470776c866dbbddfb5f0fe1f7de | [
"Apache-2.0"
] | 1 | 2019-02-03T22:32:10.000Z | 2019-02-03T22:32:10.000Z | Tests/GraphTests/GraphTests.swift | pkrll/Graph.swift | 46148cb857be1470776c866dbbddfb5f0fe1f7de | [
"Apache-2.0"
] | null | null | null | Tests/GraphTests/GraphTests.swift | pkrll/Graph.swift | 46148cb857be1470776c866dbbddfb5f0fe1f7de | [
"Apache-2.0"
] | 1 | 2019-01-13T17:07:04.000Z | 2019-01-13T17:07:04.000Z | import XCTest
@testable import Graph
final class GraphTests: XCTestCase {
func testNodeCreation() {
let label = 0
let node = Node(withLabel: label)
XCTAssertEqual(node.label, label)
}
func testNodeAddEdge() {
let source = Node(withLabel: 0)
let target = Node(withLabel: 1)
XCTAssertEqual(source.numberOfEdges, 0)
XCTAssertEqual(target.numberOfEdges, 0)
source.addEdge(to: target)
XCTAssertEqual(source.numberOfEdges, 1)
XCTAssertEqual(target.numberOfEdges, 0)
}
func testNodeProperties() {
let node = Node(withLabel: 0)
node["color"] = "Blue"
XCTAssertNotNil(node["color"])
XCTAssertEqual(node["color"] as! String, "Blue")
node["color"] = "Red"
XCTAssertEqual(node["color"] as! String, "Red")
node.setProperty("color", to: "Yellow")
XCTAssertEqual(node["color"] as! String, "Yellow")
}
func testGraphCreation() {
let graph = Graph()
XCTAssertEqual(graph.size, 0)
}
func testGraphAddNode() {
let graph = Graph()
graph.addNode(withLabel: 1)
XCTAssertEqual(graph.size, 1)
graph.addNode(withLabel: 2)
XCTAssertEqual(graph.size, 2)
graph.addNode(withLabel: 3)
XCTAssertEqual(graph.size, 3)
}
func testGraphSubscript() {
let graph = Graph()
var node = graph[5]
XCTAssertNil(node)
graph.addNode(withLabel: 3)
node = graph[3]
XCTAssertNotNil(node)
XCTAssertEqual(node!.label, 3)
}
func testGraph() {
let graph = Graph()
graph.addNode(withLabel: 0)
graph.addNode(withLabel: 1)
graph.addNode(withLabel: 2)
let target = Node(withLabel: 3)
graph.addNode(target)
XCTAssertEqual(graph.size, 4)
let weights = [0: [2, 5], 1: [5], 2: [1]]
XCTAssertTrue(graph.addEdge(from: 0, to: 1, withWeight: weights[0]![0]))
XCTAssertTrue(graph.addEdge(from: 0, to: 2, withWeight: weights[0]![1]))
XCTAssertTrue(graph.addEdge(from: 1, to: 3, withWeight: weights[1]![0]))
XCTAssertTrue(graph.addEdge(from: 2, to: 3, withWeight: weights[2]![0]))
XCTAssertFalse(graph.addEdge(from: 5, to: 3, withWeight: 0))
for node in graph.nodes {
XCTAssertNil(node["visited"])
var index = 0
for edge in node.edges {
XCTAssertEqual(edge.weight, weights[node.label]![index])
index += 1
}
node["visited"] = true
XCTAssertNotNil(node["visited"])
XCTAssertTrue(node["visited"] as! Bool)
}
}
static var allTests = [
("testNodeCreation", testNodeCreation),
("testNodeAddEdge", testNodeAddEdge),
("testNodeProperties", testNodeProperties),
("testGraphCreation", testGraphCreation),
("testGraphAddNode", testGraphAddNode),
("testGraphSubscript", testGraphSubscript),
("testGraph", testGraph)
]
}
| 23.428571 | 74 | 0.690549 |
5c41797993fd8d9177897e84d8c74c15c5d03c3e | 18,047 | c | C | src/player-timed.c | lukexorz/angband | a7c4cd5ec9a43c638bd9d3a9d7fadda51739e21d | [
"CC-BY-3.0"
] | null | null | null | src/player-timed.c | lukexorz/angband | a7c4cd5ec9a43c638bd9d3a9d7fadda51739e21d | [
"CC-BY-3.0"
] | null | null | null | src/player-timed.c | lukexorz/angband | a7c4cd5ec9a43c638bd9d3a9d7fadda51739e21d | [
"CC-BY-3.0"
] | null | null | null | /**
* \file player-timed.c
* \brief Timed effects handling
*
* Copyright (c) 1997 Ben Harrison
* Copyright (c) 2007 Andi Sidwell
*
* This work is free software; you can redistribute it and/or modify it
* under the terms of either:
*
* a) the GNU General Public License as published by the Free Software
* Foundation, version 2, or
*
* b) the "Angband licence":
* This software may be copied and distributed for educational, research,
* and not for profit purposes provided that this copyright and statement
* are included in all such copies. Other copyrights may also apply.
*/
#include "angband.h"
#include "cave.h"
#include "datafile.h"
#include "init.h"
#include "mon-util.h"
#include "obj-knowledge.h"
#include "player-calcs.h"
#include "player-timed.h"
#include "player-util.h"
/**
* The "stun" and "cut" statuses need to be handled by special functions of
* their own, as they are more complex than the ones handled by the generic
* code.
*/
static bool set_stun(struct player *p, int v);
static bool set_cut(struct player *p, int v);
struct timed_effect_data timed_effects[TMD_MAX] = {
#define TMD(a, b, c) { #a, b, c },
#include "list-player-timed.h"
#undef TMD
};
int timed_name_to_idx(const char *name)
{
for (size_t i = 0; i < N_ELEMENTS(timed_effects); i++) {
if (my_stricmp(name, timed_effects[i].name) == 0) {
return i;
}
}
return -1;
}
/**
* Undo scrambled stats when effect runs out.
*/
void player_fix_scramble(struct player *p)
{
/* Figure out what stats should be */
int new_cur[STAT_MAX];
int new_max[STAT_MAX];
for (int i = 0; i < STAT_MAX; i++) {
new_cur[p->stat_map[i]] = p->stat_cur[i];
new_max[p->stat_map[i]] = p->stat_max[i];
}
/* Apply new stats and clear the stat_map */
for (int i = 0; i < STAT_MAX; i++) {
p->stat_cur[i] = new_cur[i];
p->stat_max[i] = new_max[i];
p->stat_map[i] = i;
}
}
/**
* Set a timed effect.
*/
bool player_set_timed(struct player *p, int idx, int v, bool notify)
{
assert(idx >= 0);
assert(idx < TMD_MAX);
struct timed_effect_data *effect = &timed_effects[idx];
/* Limit values */
v = MIN(v, 10000);
v = MAX(v, 0);
/* No change */
if (p->timed[idx] == v)
return false;
/* Hack -- call other functions */
if (idx == TMD_STUN)
return set_stun(p, v);
else if (idx == TMD_CUT)
return set_cut(p, v);
/* Don't mention effects which already match the player state. */
if (idx == TMD_OPP_ACID && player_is_immune(p, ELEM_ACID))
notify = false;
else if (idx == TMD_OPP_ELEC && player_is_immune(p, ELEM_ELEC))
notify = false;
else if (idx == TMD_OPP_FIRE && player_is_immune(p, ELEM_FIRE))
notify = false;
else if (idx == TMD_OPP_COLD && player_is_immune(p, ELEM_COLD))
notify = false;
else if (idx == TMD_OPP_CONF && player_of_has(p, OF_PROT_CONF))
notify = false;
/* Always mention start or finish, otherwise on request */
if (v == 0) {
msgt(MSG_RECOVER, "%s", effect->on_end);
notify = true;
} else if (p->timed[idx] == 0) {
msgt(effect->msgt, "%s", effect->on_begin);
notify = true;
} else if (notify) {
/* Decrementing */
if (p->timed[idx] > v && effect->on_decrease)
msgt(effect->msgt, "%s", effect->on_decrease);
/* Incrementing */
else if (v > p->timed[idx] && effect->on_increase)
msgt(effect->msgt, "%s", effect->on_increase);
}
/* Use the value */
p->timed[idx] = v;
/* Sort out the sprint effect */
if (idx == TMD_SPRINT && v == 0) {
player_inc_timed(p, TMD_SLOW, 100, true, false);
}
/* Undo stat swap */
if (idx == TMD_SCRAMBLE && v == 0) {
player_fix_scramble(p);
}
if (notify) {
/* Disturb */
disturb(p, 0);
/* Update the visuals, as appropriate. */
p->upkeep->update |= effect->flag_update;
p->upkeep->redraw |= (PR_STATUS | effect->flag_redraw);
/* Handle stuff */
handle_stuff(p);
}
return notify;
}
/**
* Check whether a timed effect will affect the player
*/
bool player_inc_check(struct player *p, int idx, bool lore)
{
struct timed_effect_data *effect = &timed_effects[idx];
/* Check that @ can be affected by this effect */
if (!effect->fail_code) {
return true;
}
/* If we're only doing this for monster lore purposes */
if (lore) {
if (((effect->fail_code == TMD_FAIL_FLAG_OBJECT) &&
(of_has(p->known_state.flags, effect->fail))) ||
((effect->fail_code == TMD_FAIL_FLAG_RESIST) &&
(p->known_state.el_info[effect->fail].res_level > 0)) ||
((effect->fail_code == TMD_FAIL_FLAG_VULN) &&
(p->known_state.el_info[effect->fail].res_level < 0))) {
return false;
} else {
return true;
}
}
/* Determine whether an effect can be prevented by a flag */
if (effect->fail_code == TMD_FAIL_FLAG_OBJECT) {
/* If the effect is from a monster action, extra stuff happens */
struct monster *mon = cave->mon_current > 0 ?
cave_monster(cave, cave->mon_current) : NULL;
/* Effect is inhibited by an object flag */
equip_learn_flag(p, effect->fail);
if (mon) {
update_smart_learn(mon, player, effect->fail, 0, -1);
}
if (player_of_has(p, effect->fail)) {
if (mon) {
msg("You resist the effect!");
}
return false;
}
} else if (effect->fail_code == TMD_FAIL_FLAG_RESIST) {
/* Effect is inhibited by a resist */
equip_learn_element(p, effect->fail);
if (p->state.el_info[effect->fail].res_level > 0) {
return false;
}
} else if (effect->fail_code == TMD_FAIL_FLAG_VULN) {
/* Effect is inhibited by a vulnerability
* the asymmetry with resists is OK for now - NRM */
equip_learn_element(p, effect->fail);
if (p->state.el_info[effect->fail].res_level < 0) {
return false;
}
}
/* Special case */
if (effect->index == TMD_POISONED && p->timed[TMD_OPP_POIS])
return false;
return true;
}
/**
* Increase the timed effect `idx` by `v`. Mention this if `notify` is true.
* Check for resistance to the effect if `check` is true.
*/
bool player_inc_timed(struct player *p, int idx, int v, bool notify, bool check)
{
assert(idx >= 0);
assert(idx < TMD_MAX);
if (check == false || player_inc_check(p, idx, false) == true) {
/* Paralysis should be non-cumulative */
if (idx == TMD_PARALYZED && p->timed[TMD_PARALYZED] > 0) {
return false;
} else {
return player_set_timed(p,
idx,
p->timed[idx] + v,
notify);
}
}
return false;
}
/**
* Decrease the timed effect `idx` by `v`. Mention this if `notify` is true.
*/
bool player_dec_timed(struct player *p, int idx, int v, bool notify)
{
assert(idx >= 0);
assert(idx < TMD_MAX);
return player_set_timed(p,
idx,
p->timed[idx] - v,
notify);
}
/**
* Clear the timed effect `idx`. Mention this if `notify` is true.
*/
bool player_clear_timed(struct player *p, int idx, bool notify)
{
assert(idx >= 0);
assert(idx < TMD_MAX);
return player_set_timed(p, idx, 0, notify);
}
/**
* Set "player->timed[TMD_STUN]", notice observable changes
*
* Note the special code to only notice "range" changes.
*/
static bool set_stun(struct player *p, int v)
{
int old_aux, new_aux;
bool notice = false;
/* Hack -- Force good values */
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
/* Old state */
if (p->timed[TMD_STUN] > 100)
/* Knocked out */
old_aux = 3;
else if (p->timed[TMD_STUN] > 50)
/* Heavy stun */
old_aux = 2;
else if (p->timed[TMD_STUN] > 0)
/* Stun */
old_aux = 1;
else
/* None */
old_aux = 0;
/* New state */
if (v > 100)
/* Knocked out */
new_aux = 3;
else if (v > 50)
/* Heavy stun */
new_aux = 2;
else if (v > 0)
/* Stun */
new_aux = 1;
else
/* None */
new_aux = 0;
/* Increase or decrease stun */
if (new_aux > old_aux) {
/* Describe the state */
switch (new_aux) {
/* Stun */
case 1: {
msgt(MSG_STUN, "You have been stunned.");
break;
}
/* Heavy stun */
case 2: {
msgt(MSG_STUN, "You have been heavily stunned.");
break;
}
/* Knocked out */
case 3: {
msgt(MSG_STUN, "You have been knocked out.");
break;
}
}
/* Notice */
notice = true;
} else if (new_aux < old_aux) {
/* Describe the state */
switch (new_aux) {
/* None */
case 0: {
msgt(MSG_RECOVER, "You are no longer stunned.");
disturb(player, 0);
break;
}
}
/* Notice */
notice = true;
}
/* Use the value */
p->timed[TMD_STUN] = v;
/* No change */
if (!notice) return (false);
/* Disturb and update */
disturb(player, 0);
p->upkeep->update |= (PU_BONUS);
p->upkeep->redraw |= (PR_STATUS);
handle_stuff(player);
/* Result */
return (true);
}
/**
* Set "player->timed[TMD_CUT]", notice observable changes
*
* Note the special code to only notice "range" changes.
*/
static bool set_cut(struct player *p, int v)
{
int old_aux, new_aux;
bool notice = false;
/* Hack -- Force good values */
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
/* Old state */
if (p->timed[TMD_CUT] > TMD_CUT_DEEP)
/* Mortal wound */
old_aux = 7;
else if (p->timed[TMD_CUT] > TMD_CUT_SEVERE)
/* Deep gash */
old_aux = 6;
else if (p->timed[TMD_CUT] > TMD_CUT_NASTY)
/* Severe cut */
old_aux = 5;
else if (p->timed[TMD_CUT] > TMD_CUT_BAD)
/* Nasty cut */
old_aux = 4;
else if (p->timed[TMD_CUT] > TMD_CUT_LIGHT)
/* Bad cut */
old_aux = 3;
else if (p->timed[TMD_CUT] > TMD_CUT_GRAZE)
/* Light cut */
old_aux = 2;
else if (p->timed[TMD_CUT] > TMD_CUT_NONE)
/* Graze */
old_aux = 1;
else
/* None */
old_aux = 0;
/* New state */
if (v > TMD_CUT_DEEP)
/* Mortal wound */
new_aux = 7;
else if (v > TMD_CUT_SEVERE)
/* Deep gash */
new_aux = 6;
else if (v > TMD_CUT_NASTY)
/* Severe cut */
new_aux = 5;
else if (v > TMD_CUT_BAD)
/* Nasty cut */
new_aux = 4;
else if (v > TMD_CUT_LIGHT)
/* Bad cut */
new_aux = 3;
else if (v > TMD_CUT_GRAZE)
/* Light cut */
new_aux = 2;
else if (v > TMD_CUT_NONE)
/* Graze */
new_aux = 1;
else
/* None */
new_aux = 0;
/* Increase or decrease cut */
if (new_aux > old_aux) {
/* Describe the state */
switch (new_aux) {
/* Graze */
case 1: {
msgt(MSG_CUT, "You have been given a graze.");
break;
}
/* Light cut */
case 2: {
msgt(MSG_CUT, "You have been given a light cut.");
break;
}
/* Bad cut */
case 3: {
msgt(MSG_CUT, "You have been given a bad cut.");
break;
}
/* Nasty cut */
case 4: {
msgt(MSG_CUT, "You have been given a nasty cut.");
break;
}
/* Severe cut */
case 5: {
msgt(MSG_CUT, "You have been given a severe cut.");
break;
}
/* Deep gash */
case 6: {
msgt(MSG_CUT, "You have been given a deep gash.");
break;
}
/* Mortal wound */
case 7: {
msgt(MSG_CUT, "You have been given a mortal wound.");
break;
}
}
/* Notice */
notice = true;
} else if (new_aux < old_aux) {
/* Describe the state */
switch (new_aux) {
/* None */
case 0: {
msgt(MSG_RECOVER, "You are no longer bleeding.");
disturb(player, 0);
break;
}
}
/* Notice */
notice = true;
}
/* Use the value */
p->timed[TMD_CUT] = v;
/* No change */
if (!notice) return (false);
/* Disturb and update */
disturb(player, 0);
p->upkeep->update |= (PU_BONUS);
p->upkeep->redraw |= (PR_STATUS);
handle_stuff(player);
/* Result */
return (true);
}
/**
* Set "player->food", notice observable changes
*
* The "player->food" variable can get as large as 20000, allowing the
* addition of the most "filling" item, Elvish Waybread, which adds
* 7500 food units, without overflowing the 32767 maximum limit.
*
* Perhaps we should disturb the player with various messages,
* especially messages about hunger status changes. XXX XXX XXX
*
* Digestion of food is handled in "dungeon.c", in which, normally,
* the player digests about 20 food units per 100 game turns, more
* when "fast", more when "regenerating", less with "slow digestion".
*/
bool player_set_food(struct player *p, int v)
{
int old_aux, new_aux;
bool notice = false;
/* Hack -- Force good values */
v = MIN(v, PY_FOOD_MAX);
v = MAX(v, 0);
/* Current value */
if (p->food < PY_FOOD_FAINT) old_aux = 0;
else if (p->food < PY_FOOD_WEAK) old_aux = 1;
else if (p->food < PY_FOOD_ALERT) old_aux = 2;
else if (p->food < PY_FOOD_FULL) old_aux = 3;
else old_aux = 4;
/* New value */
if (v < PY_FOOD_FAINT) new_aux = 0;
else if (v < PY_FOOD_WEAK) new_aux = 1;
else if (v < PY_FOOD_ALERT) new_aux = 2;
else if (v < PY_FOOD_FULL) new_aux = 3;
else new_aux = 4;
/* Food increase or decrease */
if (new_aux > old_aux) {
switch (new_aux) {
case 1:
msg("You are still weak.");
break;
case 2:
msg("You are still hungry.");
break;
case 3:
msg("You are no longer hungry.");
break;
case 4:
msg("You are full!");
break;
}
/* Change */
notice = true;
} else if (new_aux < old_aux) {
switch (new_aux) {
case 0:
msgt(MSG_NOTICE, "You are getting faint from hunger!");
break;
case 1:
msgt(MSG_NOTICE, "You are getting weak from hunger!");
break;
case 2:
msgt(MSG_HUNGRY, "You are getting hungry.");
break;
case 3:
msgt(MSG_NOTICE, "You are no longer full.");
break;
}
/* Change */
notice = true;
}
/* Use the value */
p->food = v;
/* Nothing to notice */
if (!notice) return (false);
/* Disturb and update */
disturb(player, 0);
p->upkeep->update |= (PU_BONUS);
p->upkeep->redraw |= (PR_STATUS);
handle_stuff(player);
/* Result */
return (true);
}
/*
* Parsing functions for player_timed.txt
*/
/**
* List of timed effect names
*/
static const char *list_timed_effect_names[] = {
#define TMD(a, b, c) #a,
#include "list-player-timed.h"
#undef TMD
"MAX",
NULL
};
static enum parser_error parse_player_timed_name(struct parser *p)
{
const char *name = parser_getstr(p, "name");
int index;
if (grab_name("timed effect",
name,
list_timed_effect_names,
N_ELEMENTS(list_timed_effect_names),
&index)) {
/* XXX not a desctiptive error */
return PARSE_ERROR_INVALID_SPELL_NAME;
}
struct timed_effect_data *t = &timed_effects[index];
t->index = index;
parser_setpriv(p, t);
return PARSE_ERROR_NONE;
}
static enum parser_error parse_player_timed_desc(struct parser *p)
{
struct timed_effect_data *t = parser_priv(p);
assert(t);
t->desc = string_append(t->desc, parser_getstr(p, "text"));
return PARSE_ERROR_NONE;
}
static enum parser_error parse_player_timed_begin_message(struct parser *p)
{
struct timed_effect_data *t = parser_priv(p);
assert(t);
t->on_begin = string_append(t->on_begin, parser_getstr(p, "text"));
return PARSE_ERROR_NONE;
}
static enum parser_error parse_player_timed_end_message(struct parser *p)
{
struct timed_effect_data *t = parser_priv(p);
assert(t);
t->on_end = string_append(t->on_end, parser_getstr(p, "text"));
return PARSE_ERROR_NONE;
}
static enum parser_error parse_player_timed_increase_message(struct parser *p)
{
struct timed_effect_data *t = parser_priv(p);
assert(t);
t->on_increase = string_append(t->on_increase, parser_getstr(p, "text"));
return PARSE_ERROR_NONE;
}
static enum parser_error parse_player_timed_decrease_message(struct parser *p)
{
struct timed_effect_data *t = parser_priv(p);
assert(t);
t->on_decrease = string_append(t->on_decrease, parser_getstr(p, "text"));
return PARSE_ERROR_NONE;
}
static enum parser_error parse_player_timed_message_type(struct parser *p)
{
struct timed_effect_data *t = parser_priv(p);
assert(t);
t->msgt = message_lookup_by_name(parser_getsym(p, "type"));
return t->msgt < 0 ?
PARSE_ERROR_INVALID_MESSAGE :
PARSE_ERROR_NONE;
}
static enum parser_error parse_player_timed_fail(struct parser *p)
{
struct timed_effect_data *t = parser_priv(p);
assert(t);
t->fail_code = parser_getuint(p, "code");
const char *name = parser_getstr(p, "flag");
if (t->fail_code == TMD_FAIL_FLAG_OBJECT) {
int flag = lookup_flag(list_obj_flag_names, name);
if (flag == FLAG_END)
return PARSE_ERROR_INVALID_FLAG;
else
t->fail = flag;
} else if ((t->fail_code == TMD_FAIL_FLAG_RESIST) ||
(t->fail_code == TMD_FAIL_FLAG_VULN)) {
size_t i = 0;
while (list_element_names[i] && !streq(list_element_names[i], name))
i++;
if (i == ELEM_MAX)
return PARSE_ERROR_INVALID_FLAG;
else
t->fail = i;
} else {
return PARSE_ERROR_INVALID_FLAG;
}
return PARSE_ERROR_NONE;
}
static struct parser *init_parse_player_timed(void)
{
struct parser *p = parser_new();
parser_setpriv(p, NULL);
parser_reg(p, "name str name", parse_player_timed_name);
parser_reg(p, "desc str text", parse_player_timed_desc);
parser_reg(p, "on-begin str text", parse_player_timed_begin_message);
parser_reg(p, "on-end str text", parse_player_timed_end_message);
parser_reg(p, "on-increase str text", parse_player_timed_increase_message);
parser_reg(p, "on-decrease str text", parse_player_timed_decrease_message);
parser_reg(p, "msgt sym type", parse_player_timed_message_type);
parser_reg(p, "fail uint code str flag", parse_player_timed_fail);
return p;
}
static errr run_parse_player_timed(struct parser *p)
{
return parse_file_quit_not_found(p, "player_timed");
}
static errr finish_parse_player_timed(struct parser *p)
{
parser_destroy(p);
return 0;
}
static void cleanup_player_timed(void)
{
for (size_t i = 0; i < TMD_MAX; i++) {
struct timed_effect_data *effect = &timed_effects[i];
string_free(effect->desc);
if (effect->on_begin)
string_free(effect->on_begin);
if (effect->on_end)
string_free(effect->on_end);
if (effect->on_increase)
string_free(effect->on_increase);
if (effect->on_decrease)
string_free(effect->on_decrease);
effect->desc = NULL;
effect->on_begin = NULL;
effect->on_end = NULL;
effect->on_increase = NULL;
effect->on_decrease = NULL;
}
}
struct file_parser player_timed_parser = {
"player timed effects",
init_parse_player_timed,
run_parse_player_timed,
finish_parse_player_timed,
cleanup_player_timed
};
| 22.757881 | 80 | 0.645426 |
f0d8f300dda220dba7c8e98da601c1581273c260 | 3,597 | swift | Swift | Demo/Demo/FirestoreModel/Fruit.swift | y-okudera/FirestoreDao | a6adf4a2f5b2d2e16d7817783970acc0b3c4878f | [
"MIT"
] | 3 | 2020-05-26T01:35:21.000Z | 2020-05-27T07:50:34.000Z | Demo/Demo/FirestoreModel/Fruit.swift | y-okudera/FirestoreDao | a6adf4a2f5b2d2e16d7817783970acc0b3c4878f | [
"MIT"
] | null | null | null | Demo/Demo/FirestoreModel/Fruit.swift | y-okudera/FirestoreDao | a6adf4a2f5b2d2e16d7817783970acc0b3c4878f | [
"MIT"
] | null | null | null | //
// Fruit.swift
// Demo
//
// Created by okudera on 2020/05/25.
// Copyright © 2020 yuoku. All rights reserved.
//
import Foundation
import FirebaseFirestore
import FirestoreDao
/// Firestore field model sample
struct Fruit: FirestoreModel {
static let collectionPath: String = "fruit"
let documentPath: String
let fruitID: String
let name: String
let content: String
let backImage: String?
let iconImage: String?
let createdAt: Timestamp
let updatedAt: Timestamp
init(documentPath: String, data: [String: Any]) {
self.documentPath = documentPath
self.fruitID = data[Keys.fruitID.key] as! String
self.name = data[Keys.name.key] as! String
self.content = data[Keys.content.key] as! String
self.backImage = data[Keys.backImage.key] as? String
self.iconImage = data[Keys.iconImage.key] as? String
self.createdAt = data[Keys.createdAt.key] as? Timestamp ?? Timestamp()
self.updatedAt = data[Keys.updatedAt.key] as? Timestamp ?? Timestamp()
}
/// Initializer for new data.
init(uid: String, name: String) {
let fruitData: [String: Any] = [
Keys.fruitID.key: uid,
Keys.name.key: name,
Keys.content.key: "",
Keys.createdAt.key: Timestamp(),
Keys.updatedAt.key: Timestamp()
]
self = .init(documentPath: uid, data: fruitData)
}
/// Initializer for update data.
init(oldFruitData: Fruit, content: String, iconImageUrl: URL?, backImageUrl: URL?) {
let iconImageUrlString = iconImageUrl?.absoluteString ?? ""
let backImageUrlString = backImageUrl?.absoluteString ?? ""
var fruitData: [String: Any] = [
Keys.fruitID.key: oldFruitData.fruitID,
Keys.name.key: oldFruitData.name,
Keys.content.key: content,
Keys.createdAt.key: oldFruitData.createdAt,
Keys.updatedAt.key: oldFruitData.updatedAt
]
if !iconImageUrlString.isEmpty {
fruitData[Keys.iconImage.key] = iconImageUrlString
}
if !backImageUrlString.isEmpty {
fruitData[Keys.backImage.key] = backImageUrlString
}
self = .init(documentPath: oldFruitData.fruitID, data: fruitData)
}
var initialDictionary: [String: Any] {
var dic = self.dictionaryWithoutTimestamp
dic[Keys.createdAt.key] = FieldValue.serverTimestamp()
dic[Keys.updatedAt.key] = FieldValue.serverTimestamp()
return dic
}
var updateDictionary: [String: Any] {
var dic = self.dictionaryWithoutTimestamp
dic[Keys.createdAt.key] = self.createdAt
dic[Keys.updatedAt.key] = FieldValue.serverTimestamp()
return dic
}
private var dictionaryWithoutTimestamp: [String: Any] {
var dic: [String: Any] = [
Keys.fruitID.key: fruitID,
Keys.name.key: name,
Keys.content.key: content
]
if let backImage = self.backImage {
dic[Keys.backImage.key] = backImage
}
if let iconImage = self.iconImage {
dic[Keys.iconImage.key] = iconImage
}
return dic
}
}
extension Fruit {
/// Fruit property keys
enum Keys: FirestoreModelKeys {
typealias FirestoreModelType = Demo.Fruit
case content
case backImage
case iconImage
case fruitID
case name
case createdAt
case updatedAt
var key: String {
return self.mirror.label
}
}
}
| 29.975 | 88 | 0.616625 |
4b6b08873c51e0047c1d349f331dc5566040fa38 | 1,038 | lua | Lua | res/npc/npc_douglas/dl_npc_douglas.lua | tizian/Cendric2 | 5b0438c73a751bcc0d63c3af839af04ab0fb21a3 | [
"MIT"
] | 279 | 2015-05-06T19:04:07.000Z | 2022-03-21T21:33:38.000Z | res/npc/npc_douglas/dl_npc_douglas.lua | tizian/Cendric2 | 5b0438c73a751bcc0d63c3af839af04ab0fb21a3 | [
"MIT"
] | 222 | 2016-10-26T15:56:25.000Z | 2021-10-03T15:30:18.000Z | res/npc/npc_douglas/dl_npc_douglas.lua | tizian/Cendric2 | 5b0438c73a751bcc0d63c3af839af04ab0fb21a3 | [
"MIT"
] | 49 | 2015-10-01T21:23:03.000Z | 2022-03-19T20:11:31.000Z | -- Dialogue for NPC "npc_douglas"
loadDialogue = function(DL)
if (not DL:isConditionFulfilled("npc_douglas", "talked")) then
DL:setRoot(1)
else
DL:setRoot(2)
end
if (not DL:isConditionFulfilled("npc_douglas", "talked")) then
DL:createNPCNode(1, -2, "DL_Douglas_Hi") -- Hey you! You look like you could use some new armour! Come and take a look!
DL:addConditionProgress("npc_douglas", "talked")
DL:addNode()
end
DL:createChoiceNode(2)
DL:addChoice(3, "DL_Choice_ShowYourWares") -- Show me your armour.
if (DL:isQuestState("receiver", "started")) then
DL:addChoice(4, "DL_Choice_Receiver") -- How much is your monocle?
end
DL:addChoice(-1, "") --
DL:addNode()
DL:createTradeNode(3, -2)
DL:addNode()
if (DL:isQuestState("receiver", "started")) then
DL:createNPCNode(4, -2, "DL_Douglas_Receiver") -- (Grins) That's priceless.
DL:changeQuestState("receiver", "completed")
DL:addConditionProgress("default", "receiver_douglas")
DL:addReputationProgress("thief", 5)
DL:addNode()
end
end | 25.317073 | 121 | 0.702312 |
f07426eccdae8a79bc721acbbbff0f819238aafe | 185 | swift | Swift | MusicKit/MusicKit.swift | tengyifei/MusicKit | 607aac723cd67ac9819c1f53fcae4f8f87c246b5 | [
"MIT"
] | null | null | null | MusicKit/MusicKit.swift | tengyifei/MusicKit | 607aac723cd67ac9819c1f53fcae4f8f87c246b5 | [
"MIT"
] | null | null | null | MusicKit/MusicKit.swift | tengyifei/MusicKit | 607aac723cd67ac9819c1f53fcae4f8f87c246b5 | [
"MIT"
] | null | null | null | // Copyright (c) 2015 Ben Guo. All rights reserved.
import Foundation
public struct MusicKit {
/// The global value of concert A
public static var concertA: Double = 440.0
}
| 20.555556 | 52 | 0.702703 |
ac654411262d5c3ab8a98ae2fcbae1c477cd8dcb | 1,032 | sql | SQL | db/seeds.sql | scottgeleas/eManage | d3ad550b46c3a54b190888938551dc92aa8ce46c | [
"Unlicense"
] | null | null | null | db/seeds.sql | scottgeleas/eManage | d3ad550b46c3a54b190888938551dc92aa8ce46c | [
"Unlicense"
] | null | null | null | db/seeds.sql | scottgeleas/eManage | d3ad550b46c3a54b190888938551dc92aa8ce46c | [
"Unlicense"
] | null | null | null | USE company_db;
INSERT INTO departments (`name`)
VALUES ("Marketing");
INSERT INTO departments (`name`)
VALUES ("Leadership");
INSERT INTO departments (`name`)
VALUES ("Accounting");
INSERT INTO departments (`name`)
VALUES ("R&D");
INSERT INTO roles (`title`, `salary`, `department_id`)
VALUES ("Engineer", 100000, 4);
INSERT INTO roles (`title`, `salary`, `department_id`)
VALUES ("Manager", 75000, 2);
INSERT INTO roles (`title`, `salary`, `department_id`)
VALUES ("Accountant", 65000, 3);
INSERT INTO employees (`first_name`, `last_name`, `role_id`, `manager_id`)
VALUES ('Tom', 'Fish', 1, 1);
INSERT INTO employees (`first_name`, `last_name`, `role_id`, `manager_id`)
VALUES ('Bruce', 'Koala', 2, 2);
INSERT INTO employees (`first_name`, `last_name`, `role_id`, `manager_id`)
VALUES ('Jim', 'Shark', 3, 3);
INSERT INTO employees (`first_name`, `last_name`, `role_id`, `manager_id`)
VALUES ('Paul', 'Crab', 4 ,4);
INSERT INTO employees (`first_name`, `last_name`, `role_id`, `manager_id`)
VALUES ('Penny', 'Butterfly', 5, 5);
| 35.586207 | 74 | 0.687016 |
e714ac708631ee96ad789bb2f3e80388bc73e4c7 | 2,254 | js | JavaScript | neuraum/src/MainPage/index.js | leo-alexander/code-test | 244b4e3cbac3242672b667a049686b55012ecb80 | [
"MIT"
] | null | null | null | neuraum/src/MainPage/index.js | leo-alexander/code-test | 244b4e3cbac3242672b667a049686b55012ecb80 | [
"MIT"
] | null | null | null | neuraum/src/MainPage/index.js | leo-alexander/code-test | 244b4e3cbac3242672b667a049686b55012ecb80 | [
"MIT"
] | null | null | null | import React, { Component } from "react";
// import PropTypes from "prop-types";
import VendorTable from "./components/VendorTable"
import styles from "./mainPage.css";
class MainPage extends Component {
state = {
houses: {},
error: false,
success: false,
sortBy: 'internal_id'
}
componentDidMount = () => {
fetch("https://www.fertighaus.de/-/houses.json?vendor__in=28,10")
.then(res => res.json())
.then(
(result) => {
this.setState({
houses: this.formatHouses(result.results),
success: true,
});
},
(error) => {
this.setState({
error
});
}
)
}
formatHouses = (houses) => {
// arrange houses by vendor category
let formattedHouses = {}
houses.forEach((house) => {
let houseId = house.vendor_verbose.id
if (!formattedHouses.hasOwnProperty(houseId)) {
// add the vendor and create a directory for its houses
house.vendor_verbose['houses'] = []
formattedHouses[houseId] = house.vendor_verbose
}
// add the house to the correct vendor
formattedHouses[houseId].houses.push(house)
})
console.log(formattedHouses)
return formattedHouses
}
changeGlobalSort = (e) => {
this.setState({
sortBy: e.target.value
})
}
render() {
const { houses, success, sortBy} = this.state
return (
<div className={styles.container}>
<div className={styles.globalSort}>
<div className={styles.sortText}>Sort By: </div>
<select id="sortSelector" onChange={(e) => this.changeGlobalSort(e)} value={this.state.sortBy}>
<option value="internal_id">House ID</option>
<option value="name">Name</option>
<option value="price">Price</option>
<option value="living_area_total">Size</option>
</select>
</div>
{success ?
<div className={styles.vendorTablesContainer}>
{Object.entries(houses).map(([vendorId, vendor]) => {
return(<VendorTable vendor={vendor} sortBy={sortBy}/>
)})}
</div>
:
<div>Loading</div>
}
</div>
)
}
}
export default MainPage;
| 28.175 | 105 | 0.575421 |
b098c1279d9893cec2f84cded02ecb4fd11da8cf | 2,319 | rs | Rust | src/validation/error.rs | akashgurava/oas3-rs | 535523c99c44cb71c53100ec5fdaad1a468723ab | [
"MIT"
] | 11 | 2020-11-06T12:38:52.000Z | 2022-02-11T17:37:42.000Z | src/validation/error.rs | akashgurava/oas3-rs | 535523c99c44cb71c53100ec5fdaad1a468723ab | [
"MIT"
] | null | null | null | src/validation/error.rs | akashgurava/oas3-rs | 535523c99c44cb71c53100ec5fdaad1a468723ab | [
"MIT"
] | 4 | 2021-03-06T13:02:58.000Z | 2022-02-24T21:52:14.000Z | use std::fmt;
use derive_more::{Display, Error};
use http::{Method, StatusCode};
use serde_json::Value as JsonValue;
use super::Path;
use crate::spec::{Error as SchemaError, SchemaType};
#[derive(Debug, Clone, PartialEq)]
pub struct AggregateError {
errors: Vec<Error>,
}
impl AggregateError {
pub fn new(errors: Vec<Error>) -> Self {
Self { errors }
}
pub fn empty() -> Self {
Self { errors: vec![] }
}
pub fn push(&mut self, err: Error) {
self.errors.push(err)
}
}
impl fmt::Display for AggregateError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let errs = self
.errors
.iter()
.map(|err| format!(" => {}", err.to_string()))
.collect::<Vec<_>>()
.join("\n");
f.write_str(&errs)
}
}
/// Validation Errors
#[derive(Clone, PartialEq, Debug, Display, Error)]
pub enum Error {
//
// Wrapped Errors
//
#[display(fmt = "Schema error")]
Schema(SchemaError),
//
// Leaf Errors
//
#[display(fmt = "Not JSON")]
NotJson,
#[display(fmt = "{} is not a {:?}", _0, _1)]
TypeMismatch(Path, SchemaType),
#[display(fmt = "Array item type mismatch: {}", _0)]
ArrayItemTypeMismatch(JsonValue, #[error(source)] Box<Error>),
#[display(fmt = "Undocumented field: {}", _0)]
UndocumentedField(#[error(not(source))] String),
#[display(fmt = "Status mismatch: expected {}; got {}", _0, _1)]
StatusMismatch(StatusCode, StatusCode),
#[display(fmt = "Required field missing: {}", _0)]
RequiredFieldMissing(#[error(not(source))] Path),
#[display(fmt = "Type did not match any `anyOf` variant: {}\n{}", _0, _1)]
OneOfNoMatch(Path, AggregateError),
#[display(fmt = "Non-nullable field was null: {}", _0)]
InvalidNull(#[error(not(source))] Path),
#[display(fmt = "Operation not found: {} {}", _0, _1)]
OperationNotFound(Method, String),
#[display(fmt = "Operation ID not found: {}", _0)]
OperationIdNotFound(#[error(not(source))] String),
#[display(fmt = "Parameter not found: {}", _0)]
ParameterNotFound(#[error(not(source))] String),
#[display(fmt = "Invalid parameter location: {}", _0)]
InvalidParameterLocation(#[error(not(source))] String),
}
| 25.766667 | 78 | 0.589047 |
b6a6e79a6ecfce5cd1cd3d1bc2e2d08590604a29 | 1,972 | swift | Swift | NimbleMedium/Sources/Presentation/Modules/UserProfile/CreatedArticlesTab/UserProfileCreatedArticlesTab.swift | nimblehq/nimble-medium-ios | d0014f8fd9641ac919122c8b747b55dd0b0f6998 | [
"MIT"
] | 1 | 2022-03-09T04:36:41.000Z | 2022-03-09T04:36:41.000Z | NimbleMedium/Sources/Presentation/Modules/UserProfile/CreatedArticlesTab/UserProfileCreatedArticlesTab.swift | nimblehq/nimble-medium-ios | d0014f8fd9641ac919122c8b747b55dd0b0f6998 | [
"MIT"
] | 221 | 2021-08-05T09:07:20.000Z | 2021-12-03T04:48:28.000Z | NimbleMedium/Sources/Presentation/Modules/UserProfile/CreatedArticlesTab/UserProfileCreatedArticlesTab.swift | nimblehq/nimble-medium-ios | d0014f8fd9641ac919122c8b747b55dd0b0f6998 | [
"MIT"
] | null | null | null | //
// UserProfileCreatedArticlesTab.swift
// NimbleMedium
//
// Created by Mark G on 06/10/2021.
//
import PagerTabStripView
import SwiftUI
import ToastUI
struct UserProfileCreatedArticlesTab: View {
@ObservedViewModel private var viewModel: UserProfileCreatedArticlesTabViewModelProtocol
@State private var articleRowViewModels = [ArticleRowViewModelProtocol]()
@State private var isErrorToastPresented = false
@State private var isCreatedArticlesFetched = false
@State private var isFetchCreatedArticlesFailed = false
var body: some View {
Group {
if isCreatedArticlesFetched {
if articleRowViewModels.isEmpty {
Text(Localizable.feedsNoArticle())
} else {
UserProfileArticleList(viewModels: articleRowViewModels)
}
} else {
if isFetchCreatedArticlesFailed {
Text(Localizable.feedsNoArticle())
} else { ProgressView() }
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.pagerTabItem {
PagerTabItemTitle(Localizable.userProfileCreatedArticlesTitle())
}
.toast(isPresented: $isErrorToastPresented, dismissAfter: 3.0) {
ToastView(Localizable.errorGenericMessage()) {} background: {
Color.clear
}
}
.onReceive(viewModel.output.didFetchCreatedArticles) { _ in
isCreatedArticlesFetched = true
}
.onReceive(viewModel.output.didFailToFetchCreatedArticles) { _ in
isErrorToastPresented = true
isFetchCreatedArticlesFailed = true
}
.bind(viewModel.output.articleRowVieModels, to: _articleRowViewModels)
.onAppear { viewModel.input.fetchCreatedArticles() }
}
init(viewModel: UserProfileCreatedArticlesTabViewModelProtocol) {
self.viewModel = viewModel
}
}
| 33.423729 | 92 | 0.643002 |
c8ce6cc5dbba6f3dee3de74236e620d3db05563c | 6,756 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xca_notsx.log_21829_368.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xca_notsx.log_21829_368.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xca_notsx.log_21829_368.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 %r13
push %r14
push %r15
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x2679, %r15
xor %rsi, %rsi
and $0xffffffffffffffc0, %r15
movntdqa (%r15), %xmm7
vpextrq $1, %xmm7, %r14
nop
nop
cmp $31794, %rbp
lea addresses_D_ht+0xfe79, %rbx
nop
nop
add $54083, %rax
mov $0x6162636465666768, %r13
movq %r13, %xmm3
vmovups %ymm3, (%rbx)
nop
nop
nop
nop
sub $7222, %rbx
lea addresses_UC_ht+0x11379, %rax
nop
nop
nop
xor %r15, %r15
movl $0x61626364, (%rax)
nop
nop
xor $59275, %r13
lea addresses_A_ht+0x1eb27, %rsi
lea addresses_UC_ht+0x3c79, %rdi
clflush (%rdi)
nop
nop
nop
nop
add $33076, %rbp
mov $122, %rcx
rep movsw
nop
xor $19566, %r14
lea addresses_WT_ht+0x15af9, %r14
and %rbx, %rbx
mov $0x6162636465666768, %r15
movq %r15, (%r14)
nop
nop
nop
nop
dec %r13
lea addresses_WT_ht+0xee79, %rcx
nop
nop
dec %rsi
mov $0x6162636465666768, %rbp
movq %rbp, %xmm1
and $0xffffffffffffffc0, %rcx
movaps %xmm1, (%rcx)
nop
nop
sub %rbp, %rbp
lea addresses_A_ht+0xd581, %rsi
nop
nop
nop
cmp $56115, %rax
mov $0x6162636465666768, %rdi
movq %rdi, (%rsi)
nop
nop
add $756, %rcx
lea addresses_D_ht+0x19179, %rcx
sub %r13, %r13
mov (%rcx), %r14d
nop
sub $37618, %r14
lea addresses_normal_ht+0x10fb4, %rsi
lea addresses_A_ht+0xcaf9, %rdi
dec %rax
mov $84, %rcx
rep movsq
nop
xor $49810, %rcx
lea addresses_D_ht+0xeb29, %rbp
nop
nop
nop
nop
nop
sub $2113, %rax
mov (%rbp), %ecx
nop
nop
nop
nop
xor %rdi, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r15
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r15
push %rcx
push %rdi
push %rdx
// Load
lea addresses_UC+0x11bef, %rdx
clflush (%rdx)
nop
nop
nop
nop
cmp %r15, %r15
mov (%rdx), %di
nop
add $12209, %r11
// Faulty Load
lea addresses_WC+0x19e79, %rdx
nop
nop
nop
nop
nop
and %r15, %r15
mov (%rdx), %r13w
lea oracles, %r11
and $0xff, %r13
shlq $12, %r13
mov (%r11,%r13,1), %r13
pop %rdx
pop %rdi
pop %rcx
pop %r15
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WC', 'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 8}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_A_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 3}}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
| 37.120879 | 2,999 | 0.658674 |
4a2ca0e4b691919a25a3a9fc623e1242f1e1eea8 | 3,844 | js | JavaScript | node_modules/tingodb/lib/tindex.js | ahmedhussiney/WABAppService | 939c0e06f152f1ca72938e0f08f614a30a3e3cce | [
"Apache-2.0"
] | 47 | 2015-03-24T05:34:25.000Z | 2022-03-22T16:51:21.000Z | node_modules/tingodb/lib/tindex.js | ahmedhussiney/WABAppService | 939c0e06f152f1ca72938e0f08f614a30a3e3cce | [
"Apache-2.0"
] | 2 | 2015-06-15T11:30:28.000Z | 2017-12-05T12:14:12.000Z | node_modules/tingodb/lib/tindex.js | ahmedhussiney/WABAppService | 939c0e06f152f1ca72938e0f08f614a30a3e3cce | [
"Apache-2.0"
] | 22 | 2015-03-25T01:57:12.000Z | 2020-02-27T04:00:34.000Z | var _ = require('lodash');
var BPlusTree = require('./bplustree');
function tindex (key,tcoll,options,name) {
this.options = options || {};
this.name = name || key+'_';
this._unique = this.options.unique || false;
this._c = tcoll;
this._nuls = {};
this._array = this.options._tiarr || false;
this.key = key[0][0];
this.order = key[0][1];
if (key.length > 1) this._sub = key.slice(1);
this._bp = BPlusTree.create({ sort: this.order, order: 100 });
var getter = new tcoll._tdb.Finder.field(this.key);
/* jshint ignore:start */
eval("this._get = function (obj) { return "+ (this._array?getter.native3():getter.native()) + " }");
/* jshint ignore:end */
}
tindex.prototype.clear = function () {
if (this.count())
this._bp = BPlusTree.create({ sort: this.order, order: 100 });
};
tindex.prototype.set = function (k_,v, check) {
var self = this;
var k = this._get(k_);
if (check) {
if (!this._sub && this._unique && this._bp.get(k) !== null)
throw new Error("duplicate key error index");
} else {
if (_.isArray(k)) {
_.each(k, function (k1) {
self._set(k1, v, k_);
});
}
else
return this._set(k, v, k_);
}
};
tindex.prototype._set = function (k, v, o) {
if (this._sub) {
var s = (_.isNull(k) || _.isUndefined(k)) ? this._nuls[v] : this._bp.get(k);
if (!s) {
s = new tindex(this._sub, this._c, this.options, this.name + '_' + k);
if (_.isNull(k) || _.isUndefined(k)) this._nuls[v] = s;
else this._bp.set(k, s);
}
s.set(o, v);
return;
}
if (_.isNull(k) || _.isUndefined(k)) {
this._nuls[v]=v;
return;
}
if (this._unique)
return this._bp.set(k,v);
else {
var l = this._bp.get(k);
var n = l || [];
n.push(v);
if (!l) this._bp.set(k,n);
}
};
tindex.prototype.del = function (k_,v) {
var self = this;
var k = this._get(k_);
if (_.isArray(k)) {
_.each(k, function (k1) {
self._del(k1, v, k_);
});
}
else
return this._del(k, v, k_);
};
tindex.prototype._del = function (k, v, o) {
if (this._sub) {
var s = (_.isNull(k) || _.isUndefined(k)) ? this._nuls[v] : this._bp.get(k);
if (s) s.del(o, v);
return;
}
delete this._nuls[v];
if (this._unique) {
this._bp.del(k);
}
else {
var l = this._bp.get(k);
if (l) {
var i = l.indexOf(v);
if (i!=-1)
l.splice(i,1);
if (l.length===0)
this._bp.del(k);
}
}
};
tindex.prototype.match = function (k) {
var m = this._bp.get(k);
if (!m) return [];
return this._unique || this._sub ? [ m ] : m;
};
tindex.prototype.range = function (s, e, si, ei) {
var r = this._bp.rangeSync(s,e,si,ei);
return this._unique || this._sub ? r : _.flatten(r);
};
tindex.prototype.all = function (order, shallow) {
var a = this._bp.all();
var n = _.values(this._nuls);
var r = this.order > 0 ? _.union(n, a) : _.union(a, n);
if (order && order.length > 0) {
if (order[0] != this.order) r = r.reverse();
order = order.slice(1);
}
if (this._sub) return shallow ? r : _.flatten(_.map(r, function (i) { return i.all(order); }), true);
return this._unique?r:_.flatten(r);
};
tindex.prototype.nuls = function () {
return _.values(this._nuls);
};
tindex.prototype.values = function () {
var r = this._bp.all();
return this._unique || this._sub ? r : _.flatten(r);
};
tindex.prototype.count = function () {
var c = 0;
this._bp.each(function (k,v) {
c += this._sub ? v.count() : v.length;
});
return c;
};
tindex.prototype.fields = function () {
var result = [ [ this.key, this.order ] ];
if (this._sub) result = result.concat(this._sub);
return result;
};
tindex.prototype.depth = function () {
return this._sub ? this._sub.length + 1 : 1;
};
tindex.prototype.inspect = function (depth) {
return '[Index ' + this.name + ']';
};
module.exports = tindex;
/* IDEAS
*
* - Keep some stats about index to allow of making decisions about which index to use in query
*
*/
| 23.582822 | 102 | 0.599636 |
80f2bb7a68e563926a60b703c5db40d84324f423 | 1,222 | swift | Swift | AlgorithmPractice/LeetCode-Go/50-PowxN.swift | YuanmuShi/AlgorithmPractice | 32d87b34f59999b47212dca87156c43a6aee9a3e | [
"MIT"
] | null | null | null | AlgorithmPractice/LeetCode-Go/50-PowxN.swift | YuanmuShi/AlgorithmPractice | 32d87b34f59999b47212dca87156c43a6aee9a3e | [
"MIT"
] | null | null | null | AlgorithmPractice/LeetCode-Go/50-PowxN.swift | YuanmuShi/AlgorithmPractice | 32d87b34f59999b47212dca87156c43a6aee9a3e | [
"MIT"
] | null | null | null | //
// 50-PowxN.swift
// AlgorithmPractice
//
// Created by Jeffrey on 2021/1/19.
// Copyright © 2021 Jeffrey. All rights reserved.
//
import Foundation
/*
50. Pow(x, n)
实现 pow(x, n) ,即计算 x 的 n 次幂函数(即,xn)。
示例 1:
输入:x = 2.00000, n = 10
输出:1024.00000
示例 2:
输入:x = 2.10000, n = 3
输出:9.26100
示例 3:
输入:x = 2.00000, n = -2
输出:0.25000
解释:2-2 = 1/22 = 1/4 = 0.25
提示:
-100.0 < x < 100.0
-231 <= n <= 231-1
-104 <= xn <= 104
*/
extension Solution {
static func test50() {
print(myPow(2, 3))
// print(myPow1(8.84372, -5))
}
// 循环法
private static func myPow(_ x: Double, _ n: Int) -> Double {
var tmpX = x
var tmpN = n
if n < 0 {
tmpX = 1 / x
tmpN = -n
}
var result: Double = 1
var power = tmpX
while tmpN > 0 {
if tmpN % 2 == 1 {
result *= power
}
power *= power
tmpN /= 2
}
return result
}
// 递归法
private static func myPow1(_ x: Double, _ n: Int) -> Double {
if n == 0 {
return 1
}
if n < 0 {
return 1 / myPow(x, -n)
}
if n % 2 == 0 {
return myPow(x * x, n / 2)
}
return x * myPow(x * x, n / 2)
}
}
| 14.209302 | 63 | 0.47054 |
996659eb5622878b9686f003b14a59ab91ae7075 | 536 | h | C | ios/sdk/component/videoplayer/HippyVideoPlayer.h | mc-zone/Hippy | cd46465a1c7f3df6768e8593e4e456b280000a65 | [
"Apache-2.0"
] | 1 | 2021-04-21T02:11:00.000Z | 2021-04-21T02:11:00.000Z | ios/sdk/component/videoplayer/HippyVideoPlayer.h | iyang519/Hippy | cd46465a1c7f3df6768e8593e4e456b280000a65 | [
"MIT"
] | null | null | null | ios/sdk/component/videoplayer/HippyVideoPlayer.h | iyang519/Hippy | cd46465a1c7f3df6768e8593e4e456b280000a65 | [
"MIT"
] | null | null | null | //
// HippyVideoPlayer.h
// Hippy
//
// Created by 万致远 on 2019/4/29.
// Copyright © 2019 Tencent. All rights reserved.
//
#import "HippyView.h"
#import <AVFoundation/AVFoundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface HippyVideoPlayer : HippyView
- (void)play;
- (void)pause;
- (void)seekToTime:(CMTime)time;
@property (nonatomic, strong) NSString *src;
@property (nonatomic, assign) BOOL *autoPlay;
@property (nonatomic, assign) BOOL *loop;
@property (nonatomic, strong) HippyDirectEventBlock onLoad;
@end
NS_ASSUME_NONNULL_END
| 21.44 | 59 | 0.744403 |
4a448ea429e14998449bf77d3471155fb1fc4986 | 2,553 | js | JavaScript | tests/integration/slider/slider_core.js | Teleburna/jquery-mobile | f075f58e80e71014bbeb94dc0d2efd4cd800a0ba | [
"CC0-1.0"
] | 2,140 | 2015-01-01T15:29:54.000Z | 2021-10-01T00:21:19.000Z | tests/integration/slider/slider_core.js | Teleburna/jquery-mobile | f075f58e80e71014bbeb94dc0d2efd4cd800a0ba | [
"CC0-1.0"
] | 1,030 | 2015-01-01T12:40:58.000Z | 2021-09-14T02:06:01.000Z | tests/integration/slider/slider_core.js | Teleburna/jquery-mobile | f075f58e80e71014bbeb94dc0d2efd4cd800a0ba | [
"CC0-1.0"
] | 883 | 2015-01-02T16:58:12.000Z | 2021-10-22T00:35:05.000Z | define( [ "qunit", "jquery" ], function( QUnit, $ ) {
function defineTooltipTest( name, slider, hasValue, hasTooltip ) {
QUnit.test( name, function( assert ) {
var widget = slider.slider( "instance" ),
track = slider.siblings( ".ui-slider-track" ),
handle = track.children( ".ui-slider-handle" ),
popup = slider.siblings( ".ui-slider-popup" ),
assertState = function( condition, popupVisible ) {
var expectedHandleText = ( hasValue ? ( widget.options.mini ? "" : ( "" + slider.val() ) ) : "" );
assert.deepEqual( popup.is( ":visible" ), popupVisible,
"Upon " + condition + " popup is " + ( popupVisible ? "" : "not " ) +
"visible" );
if ( popupVisible ) {
assert.deepEqual( popup.text(), ( "" + slider.val() ),
"Upon " + condition +
" the popup reflects the input value (" + slider.val() + ")" );
}
assert.deepEqual( handle.text(), expectedHandleText,
"Upon " + condition + " the handle text is " + expectedHandleText );
};
assertState( "startup", false );
// Make sure the widget updates correctly when dragging by the handle
handle.trigger( "vmousedown" );
assertState( "handle vmousedown", hasTooltip );
// Move to 89% of the length of the slider
handle.trigger( $.extend( $.Event( "vmousemove" ), {
pageX: track.offset().left + track.width() * 0.89
} ) );
assertState( "handle vmousemove", hasTooltip );
handle.trigger( "vmouseup" );
assertState( "handle vmouseup", false );
// Make sure the widget updates correctly when clicking on the track at 47%
track.trigger( $.extend( $.Event( "vmousedown" ), {
pageX: track.offset().left + track.width() * 0.47
} ) );
assertState( "track vmousedown", hasTooltip );
// Move to 53%
track.trigger( $.extend( $.Event( "vmousemove" ), {
pageX: track.offset().left + track.width() * 0.53
} ) );
assertState( "track vmousemove", hasTooltip );
track.trigger( "vmouseup" );
assertState( "track vmouseup", false );
} );
}
function defineTests( moduleNameSuffix, idPrefix ) {
QUnit.module( "Slider tooltip - " + moduleNameSuffix );
defineTooltipTest( "Basic slider", $( "#" + idPrefix + "basic-slider" ), false, false );
defineTooltipTest( "Slider showing value", $( "#" + idPrefix + "show-value" ), true, false );
defineTooltipTest( "Slider showing tooltip", $( "#" + idPrefix + "popup" ), false, true );
defineTooltipTest( "Tooltip and value", $( "#" + idPrefix + "value-and-popup" ), true, true );
}
defineTests( "regular size", "" );
defineTests( "mini size", "mini-" );
} );
| 37 | 102 | 0.631022 |
ddc3612361783e313e1f1a8fd84050c4e821ceab | 94 | sql | SQL | src/oc_erchef/schema/revert/reporting_schema_info.sql | riddopic/chef-server | 35354f6c967f68f9cad99114df8bfbc21b0d9317 | [
"Apache-2.0"
] | 300 | 2015-01-22T22:53:16.000Z | 2022-02-23T17:16:31.000Z | src/oc_erchef/schema/revert/reporting_schema_info.sql | riddopic/chef-server | 35354f6c967f68f9cad99114df8bfbc21b0d9317 | [
"Apache-2.0"
] | 2,599 | 2015-01-22T22:04:09.000Z | 2022-03-31T13:22:02.000Z | src/oc_erchef/schema/revert/reporting_schema_info.sql | riddopic/chef-server | 35354f6c967f68f9cad99114df8bfbc21b0d9317 | [
"Apache-2.0"
] | 242 | 2015-05-02T12:08:11.000Z | 2022-03-31T11:22:30.000Z | -- Revert reporting_schema_info
BEGIN;
DROP TABLE IF EXISTS reporting_schema_info;
COMMIT;
| 11.75 | 43 | 0.808511 |
726ced452dde1464ec82f8f4fdc795536f8f74a6 | 366 | lua | Lua | Loops/endless-loop-coroutine-with-delay.lua | NTUSPMS/BinooAPI | f371f2f3a424ca8a1ac3e9736e4b89bb7012d68b | [
"MIT"
] | null | null | null | Loops/endless-loop-coroutine-with-delay.lua | NTUSPMS/BinooAPI | f371f2f3a424ca8a1ac3e9736e4b89bb7012d68b | [
"MIT"
] | 1 | 2018-02-14T03:49:17.000Z | 2018-02-14T03:51:50.000Z | Loops/endless-loop-coroutine-with-delay.lua | NTUSPMS/BinooAPI | f371f2f3a424ca8a1ac3e9736e4b89bb7012d68b | [
"MIT"
] | 1 | 2019-10-07T02:26:28.000Z | 2019-10-07T02:26:28.000Z | -- delay variable in coroutine only works in v2.34 or later
b = BinooAPI
b:SendCommand("MESSAGE|HelloWorld!")
return function()
local x = 0
while true do
x = x + 1
b:CreateLine(-10,10+x,0,10,10+x,0);
-- wait 7 seconds
coroutine.yield(7)
x = x + 1
b:CreateLine(-20,10+x,0,20,10+x,0);
-- wait 1 second
coroutine.yield(1)
end
end
| 20.333333 | 59 | 0.620219 |
85f7715b98f7757ea8f441e7a8df94916feeed23 | 7,053 | h | C | src/glsl/pathtracer_internal.h | johannes-braun/myrt | bb7d96e9f5de264054f4a27de78722d0763c21a8 | [
"MIT"
] | 1 | 2020-12-05T18:00:23.000Z | 2020-12-05T18:00:23.000Z | src/glsl/pathtracer_internal.h | johannes-braun/myrt | bb7d96e9f5de264054f4a27de78722d0763c21a8 | [
"MIT"
] | null | null | null | src/glsl/pathtracer_internal.h | johannes-braun/myrt | bb7d96e9f5de264054f4a27de78722d0763c21a8 | [
"MIT"
] | null | null | null | #pragma once
#include "intersect.h"
#include "raymarch.h"
// Forward declare visitor functions.
bool visit_triangle(MYRT_INDEX_TYPE node_base_index, MYRT_INDEX_TYPE primitive_base_index, vec3 ro, vec3 rd, float maxt);
bool visit_object_aabb(MYRT_INDEX_TYPE node_base_index, MYRT_INDEX_TYPE primitive_base_index, vec3 ro, vec3 rd, float maxt);
#define MYRT_BVH_NODES_BUFFER bvh_nodes
#define MYRT_BVH_INDICES_BUFFER bvh_indices
#define MYRT_BVH_TRAVERSE bvh_traverse
#define MYRT_BVH_VISIT_PRIMITIVE visit_triangle
#include "bvh.impl.h"
#undef MYRT_BVH_VISIT_PRIMITIVE
#undef MYRT_BVH_TRAVERSE
#undef MYRT_BVH_INDICES_BUFFER
#undef MYRT_BVH_NODES_BUFFER
#define MYRT_BVH_NODES_BUFFER global_bvh_nodes
#define MYRT_BVH_INDICES_BUFFER global_bvh_indices
#define MYRT_BVH_TRAVERSE bvh_traverse_global
#define MYRT_BVH_VISIT_PRIMITIVE visit_object_aabb
#include "bvh.impl.h"
#undef MYRT_BVH_VISIT_PRIMITIVE
#undef MYRT_BVH_TRAVERSE
#undef MYRT_BVH_INDICES_BUFFER
#undef MYRT_BVH_NODES_BUFFER
struct traversal_state_t
{
bool any_hit;
float t;
float global_t;
vec2 barycentric;
vec2 global_barycentric;
uint hit_geometry;
uint hit_index;
uint global_hit_index;
uint base_index;
uint base_vertex;
uint current_geometry;
} traversal;
void traversal_init() {
const float inf = 1.0 / 0.0;
traversal.any_hit = false;
traversal.t = inf;
traversal.global_t = inf;
traversal.barycentric = vec2(0, 0);
traversal.global_barycentric = vec2(0, 0);
traversal.hit_geometry = 0;
traversal.hit_index = 0;
traversal.global_hit_index = 0;
traversal.base_index = 0;
traversal.base_vertex = 0;
}
bool visit_triangle(vec3 ray_origin, vec3 ray_direction, uint index, inout float max_ray_distance, out bool hits)
{
vec3 p0 = points[traversal.base_vertex + indices[traversal.base_index + index * 3 + 0]].xyz;
vec3 p1 = points[traversal.base_vertex + indices[traversal.base_index + index * 3 + 1]].xyz;
vec3 p2 = points[traversal.base_vertex + indices[traversal.base_index + index * 3 + 2]].xyz;
float t_current = 0;
vec2 barycentric_current = vec2(0, 0);
hits = intersect_triangle(ray_origin, ray_direction, p0, p1, p2, t_current, barycentric_current) &&
t_current < max_ray_distance&&
traversal.t > t_current;
if (hits)
{
traversal.t = t_current;
traversal.barycentric = barycentric_current;
traversal.hit_index = index;
max_ray_distance = traversal.t;
}
if (traversal.any_hit && hits) return true;
return false;
}
bool visit_object_aabb(vec3 ray_origin, vec3 ray_direction, uint i, inout float max_ray_distance, out bool hits)
{
traversal.base_index = geometries[i].indices_base_index;
traversal.base_vertex = geometries[i].points_base_index;
vec3 ro = (geometries[i].inverse_transformation * vec4(ray_origin, 1)).xyz;
vec3 rd = (((geometries[i].inverse_transformation) * vec4(ray_direction, 0)).xyz);
traversal.t = max_ray_distance;
bool current_hits = bvh_traverse(geometries[i].bvh_node_base_index, geometries[i].bvh_index_base_index, ro, rd, max_ray_distance);
current_hits = current_hits && traversal.global_t > traversal.t;
if (current_hits)
{
traversal.global_t = traversal.t;
traversal.global_barycentric = traversal.barycentric;
traversal.global_hit_index = traversal.hit_index;
traversal.hit_geometry = i;
max_ray_distance = traversal.global_t;
}
hits = current_hits;
if (traversal.any_hit && hits) return true;
return false;
}
bool any_hit(vec3 ray_origin, vec3 ray_direction, float max_distance)
{
traversal_init();
traversal.any_hit = true;
traversal.t = max_distance;
traversal.global_t = max_distance;
bool hits = bvh_traverse_global(0, 0, ray_origin, ray_direction, max_distance);
if (!hits)
{
for (int i = 0; i < sdfs.length(); ++i)
{
sdf_current = i;
if (march_sdf(ray_origin, ray_direction, max_distance, true).hits)
return true;
}
}
return hits;
}
hit_t nearest_hit(vec3 ray_origin, vec3 ray_direction, float max_distance)
{
hit_t hit;
traversal_init();
traversal.any_hit = false;
traversal.global_t = max_distance;
hit.hits = bvh_traverse_global(0, 0, ray_origin, ray_direction, max_distance);
hit.t = traversal.global_t;
bool hit_marched = false;
for (int i = 0; i < sdfs.length(); ++i)
{
sdf_current = i;
hit_t h = march_sdf(ray_origin, ray_direction, hit.hits ? hit.t : max_distance, false);
if (h.hits && h.t < hit.t) {
hit = h;
hit_marched = true;
}
}
if (hit_marched)
return hit;
vec2 hit_bary = traversal.global_barycentric;
uint hit_triangle = traversal.global_hit_index;
uint hit_geometry = traversal.hit_geometry;
uint base_vertex = geometries[hit_geometry].points_base_index;
uint base_index = geometries[hit_geometry].indices_base_index;
vec3 p0 = points[base_vertex + indices[base_index + 3 * hit_triangle + 0]].xyz;
vec3 p1 = points[base_vertex + indices[base_index + 3 * hit_triangle + 1]].xyz;
vec3 p2 = points[base_vertex + indices[base_index + 3 * hit_triangle + 2]].xyz;
hit.position = (geometries[hit_geometry].transformation * vec4(hit_bary.x * p1 + hit_bary.y * p2 + (1.0 - hit_bary.x - hit_bary.y) * p0, 1)).xyz;
vec3 n0 = normals[base_vertex + indices[base_index + 3 * hit_triangle + 0]].xyz;
vec3 n1 = normals[base_vertex + indices[base_index + 3 * hit_triangle + 1]].xyz;
vec3 n2 = normals[base_vertex + indices[base_index + 3 * hit_triangle + 2]].xyz;
mat4 normal_matrix = mat4(mat3(transpose(geometries[hit_geometry].inverse_transformation)));
vec3 normal = normalize((normal_matrix
* vec4((hit_bary.x * n1 + hit_bary.y * n2 + (1.0 - hit_bary.x - hit_bary.y) * n0), 0)).xyz);
vec3 face_normal = (normal_matrix * vec4(normalize(cross(normalize(p1 - p0), normalize(p2 - p0))), 0)).xyz;
if (sign(dot(normal, ray_direction)) != sign(dot(face_normal, ray_direction)))
{
normal = face_normal;
}
hit.normal = normal;
hit.material = materials[geometries[hit_geometry].material_index];
return hit;
}
vec3 sample_cosine_hemisphere(vec2 uv)
{
// (Uniformly) sample a point on the unit disk
float r = sqrt(uv.x);
float theta = 2 * 3.14159265359f * uv.y;
float x = r * cos(theta);
float y = r * sin(theta);
// Project point up to the unit sphere
float z = float(sqrt(max(0.f, 1 - x * x - y * y)));
return vec3(x, y, z);
}
vec3 bsdf_local_to_world(const in vec3 vector, const in vec3 normal)
{
// Find an axis that is not parallel to normal
vec3 perp = vec3(1, 0, 0);
vec3 u = normalize(cross(normal, perp));
for (int i = 1; any(isnan(u)) && i < 3; ++i)
{
perp[i - 1] = 0;
perp[i] = 1;
u = normalize(cross(normal, perp));
}
return normalize(mat3(u, cross(normal, u), normal) * vector);
} | 33.908654 | 149 | 0.69318 |
84e99258a5e557c97eed87b16fe547871cc9b4a9 | 13 | h | C | ZF/ZFLua_impl/zf3rd/zfautoscript_zf3rd_setup_lua_header_prefix.h | ZFFrameworkDist/ZFFramework | 6b498e7b95ee6d6aaa28d8369eef8c2ff94daaf7 | [
"MIT"
] | 57 | 2016-06-12T11:05:55.000Z | 2021-05-22T13:12:17.000Z | ZF/ZFLua_impl/zf3rd/zfautoscript_zf3rd_setup_lua_header_prefix.h | ZFFrameworkDist/ZFFramework | 6b498e7b95ee6d6aaa28d8369eef8c2ff94daaf7 | [
"MIT"
] | null | null | null | ZF/ZFLua_impl/zf3rd/zfautoscript_zf3rd_setup_lua_header_prefix.h | ZFFrameworkDist/ZFFramework | 6b498e7b95ee6d6aaa28d8369eef8c2ff94daaf7 | [
"MIT"
] | 20 | 2016-05-26T04:47:37.000Z | 2020-12-13T01:39:39.000Z | extern "C" {
| 6.5 | 12 | 0.538462 |
566bf76283454eeff5ffbff52efd6a487446c0cc | 124 | sql | SQL | src/main/resources/schema.sql | nirvana124/event-publisher | b12798dc49148f0f883e4e8ba724267160b0fa8f | [
"MIT"
] | null | null | null | src/main/resources/schema.sql | nirvana124/event-publisher | b12798dc49148f0f883e4e8ba724267160b0fa8f | [
"MIT"
] | null | null | null | src/main/resources/schema.sql | nirvana124/event-publisher | b12798dc49148f0f883e4e8ba724267160b0fa8f | [
"MIT"
] | null | null | null | DROP TABLE IF EXISTS USER;
CREATE TABLE USER (id SERIAL PRIMARY KEY, first_name VARCHAR, last_name VARCHAR, mobile VARCHAR); | 62 | 97 | 0.806452 |
3e4c3f4ec7b0201c8e0ae1ed394baf61821a2328 | 18,143 | c | C | vlc_linux/vlc-3.0.16/src/input/stream.c | Brook1711/biubiu_Qt6 | 5c4d22a1d1beef63bc6c7738dce6c477c4642803 | [
"MIT"
] | null | null | null | vlc_linux/vlc-3.0.16/src/input/stream.c | Brook1711/biubiu_Qt6 | 5c4d22a1d1beef63bc6c7738dce6c477c4642803 | [
"MIT"
] | null | null | null | vlc_linux/vlc-3.0.16/src/input/stream.c | Brook1711/biubiu_Qt6 | 5c4d22a1d1beef63bc6c7738dce6c477c4642803 | [
"MIT"
] | null | null | null | /*****************************************************************************
* stream.c
*****************************************************************************
* Copyright (C) 1999-2004 VLC authors and VideoLAN
* Copyright 2008-2015 Rémi Denis-Courmont
* $Id: b94279b4316e127c2d0d4b0d146b524e62afff1c $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
#include <vlc_common.h>
#include <vlc_block.h>
#include <vlc_memory.h>
#include <vlc_access.h>
#include <vlc_charset.h>
#include <vlc_interrupt.h>
#include <vlc_stream_extractor.h>
#include <libvlc.h>
#include "stream.h"
#include "mrl_helpers.h"
typedef struct stream_priv_t
{
stream_t stream;
void (*destroy)(stream_t *);
block_t *block;
block_t *peek;
uint64_t offset;
bool eof;
/* UTF-16 and UTF-32 file reading */
struct {
vlc_iconv_t conv;
unsigned char char_width;
bool little_endian;
} text;
} stream_priv_t;
/**
* Allocates a VLC stream object
*/
stream_t *vlc_stream_CommonNew(vlc_object_t *parent,
void (*destroy)(stream_t *))
{
stream_priv_t *priv = vlc_custom_create(parent, sizeof (*priv), "stream");
if (unlikely(priv == NULL))
return NULL;
stream_t *s = &priv->stream;
s->p_module = NULL;
s->psz_url = NULL;
s->p_source = NULL;
s->pf_read = NULL;
s->pf_block = NULL;
s->pf_readdir = NULL;
s->pf_seek = NULL;
s->pf_control = NULL;
s->p_sys = NULL;
s->p_input = NULL;
assert(destroy != NULL);
priv->destroy = destroy;
priv->block = NULL;
priv->peek = NULL;
priv->offset = 0;
priv->eof = false;
/* UTF16 and UTF32 text file conversion */
priv->text.conv = (vlc_iconv_t)(-1);
priv->text.char_width = 1;
priv->text.little_endian = false;
return s;
}
void stream_CommonDelete(stream_t *s)
{
stream_priv_t *priv = (stream_priv_t *)s;
if (priv->text.conv != (vlc_iconv_t)(-1))
vlc_iconv_close(priv->text.conv);
if (priv->peek != NULL)
block_Release(priv->peek);
if (priv->block != NULL)
block_Release(priv->block);
free(s->psz_url);
vlc_object_release(s);
}
/**
* Destroy a stream
*/
void vlc_stream_Delete(stream_t *s)
{
stream_priv_t *priv = (stream_priv_t *)s;
priv->destroy(s);
stream_CommonDelete(s);
}
stream_t *(vlc_stream_NewURL)(vlc_object_t *p_parent, const char *psz_url)
{
if( !psz_url )
return NULL;
stream_t *s = stream_AccessNew( p_parent, NULL, false, psz_url );
if( s == NULL )
msg_Err( p_parent, "no suitable access module for `%s'", psz_url );
return s;
}
stream_t *(vlc_stream_NewMRL)(vlc_object_t* parent, const char* mrl )
{
stream_t* stream = vlc_stream_NewURL( parent, mrl );
if( stream == NULL )
return NULL;
char const* anchor = strchr( mrl, '#' );
if( anchor == NULL )
return stream;
char const* extra;
if( stream_extractor_AttachParsed( &stream, anchor + 1, &extra ) )
{
msg_Err( parent, "unable to open %s", mrl );
vlc_stream_Delete( stream );
return NULL;
}
if( extra && *extra )
msg_Warn( parent, "ignoring extra fragment data: %s", extra );
return stream;
}
/**
* Read from the stream until first newline.
* \param s Stream handle to read from
* \return A pointer to the allocated output string. You need to free this when you are done.
*/
#define STREAM_PROBE_LINE 2048
#define STREAM_LINE_MAX (2048*100)
char *vlc_stream_ReadLine( stream_t *s )
{
stream_priv_t *priv = (stream_priv_t *)s;
char *p_line = NULL;
int i_line = 0, i_read = 0;
/* Let's fail quickly if this is a readdir access */
if( s->pf_read == NULL && s->pf_block == NULL )
return NULL;
for( ;; )
{
char *psz_eol;
const uint8_t *p_data;
int i_data;
int64_t i_pos;
/* Probe new data */
i_data = vlc_stream_Peek( s, &p_data, STREAM_PROBE_LINE );
if( i_data <= 0 ) break; /* No more data */
/* BOM detection */
i_pos = vlc_stream_Tell( s );
if( i_pos == 0 && i_data >= 2 )
{
const char *psz_encoding = NULL;
bool little_endian = false;
if( unlikely(priv->text.conv != (vlc_iconv_t)-1) )
{ /* seek back to beginning? reset */
vlc_iconv_close( priv->text.conv );
priv->text.conv = (vlc_iconv_t)-1;
}
priv->text.char_width = 1;
priv->text.little_endian = false;
if( !memcmp( p_data, "\xFF\xFE", 2 ) )
{
psz_encoding = "UTF-16LE";
little_endian = true;
}
else if( !memcmp( p_data, "\xFE\xFF", 2 ) )
{
psz_encoding = "UTF-16BE";
}
/* Open the converter if we need it */
if( psz_encoding != NULL )
{
msg_Dbg( s, "UTF-16 BOM detected" );
priv->text.conv = vlc_iconv_open( "UTF-8", psz_encoding );
if( unlikely(priv->text.conv == (vlc_iconv_t)-1) )
{
msg_Err( s, "iconv_open failed" );
goto error;
}
priv->text.char_width = 2;
priv->text.little_endian = little_endian;
}
}
if( i_data % priv->text.char_width )
{
/* keep i_char_width boundary */
i_data = i_data - ( i_data % priv->text.char_width );
msg_Warn( s, "the read is not i_char_width compatible");
}
if( i_data == 0 )
break;
/* Check if there is an EOL */
if( priv->text.char_width == 1 )
{
/* UTF-8: 0A <LF> */
psz_eol = memchr( p_data, '\n', i_data );
if( psz_eol == NULL )
/* UTF-8: 0D <CR> */
psz_eol = memchr( p_data, '\r', i_data );
}
else
{
const uint8_t *p_last = p_data + i_data - priv->text.char_width;
uint16_t eol = priv->text.little_endian ? 0x0A00 : 0x000A;
assert( priv->text.char_width == 2 );
psz_eol = NULL;
/* UTF-16: 000A <LF> */
for( const uint8_t *p = p_data; p <= p_last; p += 2 )
{
if( U16_AT( p ) == eol )
{
psz_eol = (char *)p + 1;
break;
}
}
if( psz_eol == NULL )
{ /* UTF-16: 000D <CR> */
eol = priv->text.little_endian ? 0x0D00 : 0x000D;
for( const uint8_t *p = p_data; p <= p_last; p += 2 )
{
if( U16_AT( p ) == eol )
{
psz_eol = (char *)p + 1;
break;
}
}
}
}
if( psz_eol )
{
i_data = (psz_eol - (char *)p_data) + 1;
p_line = realloc_or_free( p_line,
i_line + i_data + priv->text.char_width ); /* add \0 */
if( !p_line )
goto error;
i_data = vlc_stream_Read( s, &p_line[i_line], i_data );
if( i_data <= 0 ) break; /* Hmmm */
i_line += i_data - priv->text.char_width; /* skip \n */;
i_read += i_data;
/* We have our line */
break;
}
/* Read data (+1 for easy \0 append) */
p_line = realloc_or_free( p_line,
i_line + STREAM_PROBE_LINE + priv->text.char_width );
if( !p_line )
goto error;
i_data = vlc_stream_Read( s, &p_line[i_line], STREAM_PROBE_LINE );
if( i_data <= 0 ) break; /* Hmmm */
i_line += i_data;
i_read += i_data;
if( i_read >= STREAM_LINE_MAX )
goto error; /* line too long */
}
if( i_read > 0 )
{
if( priv->text.char_width > 1 )
{
int i_new_line = 0;
size_t i_in = 0, i_out = 0;
const char * p_in = NULL;
char * p_out = NULL;
char * psz_new_line = NULL;
/* iconv */
/* UTF-8 needs at most 150% of the buffer as many as UTF-16 */
i_new_line = i_line * 3 / 2 + 1;
psz_new_line = malloc( i_new_line );
if( psz_new_line == NULL )
goto error;
i_in = (size_t)i_line;
i_out = (size_t)i_new_line;
p_in = p_line;
p_out = psz_new_line;
if( vlc_iconv( priv->text.conv, &p_in, &i_in, &p_out, &i_out ) == (size_t)-1 )
{
msg_Err( s, "conversion error: %s", vlc_strerror_c( errno ) );
msg_Dbg( s, "original: %d, in %zu, out %zu", i_line, i_in, i_out );
}
free( p_line );
p_line = psz_new_line;
i_line = (size_t)i_new_line - i_out; /* does not include \0 */
}
/* Remove trailing LF/CR */
while( i_line >= 1 &&
(p_line[i_line - 1] == '\r' || p_line[i_line - 1] == '\n') )
i_line--;
/* Make sure the \0 is there */
p_line[i_line] = '\0';
return p_line;
}
error:
/* We failed to read any data, probably EOF */
free( p_line );
return NULL;
}
static ssize_t vlc_stream_CopyBlock(block_t **restrict pp,
void *buf, size_t len)
{
block_t *block = *pp;
if (block == NULL)
return -1;
if (len > block->i_buffer)
len = block->i_buffer;
if (buf != NULL)
memcpy(buf, block->p_buffer, len);
block->p_buffer += len;
block->i_buffer -= len;
if (block->i_buffer == 0)
{
block_Release(block);
*pp = NULL;
}
return likely(len > 0) ? (ssize_t)len : -1;
}
static ssize_t vlc_stream_ReadRaw(stream_t *s, void *buf, size_t len)
{
stream_priv_t *priv = (stream_priv_t *)s;
ssize_t ret;
assert(len <= SSIZE_MAX);
if (vlc_killed())
return 0;
if (s->pf_read != NULL)
{
assert(priv->block == NULL);
if (buf == NULL)
{
if (unlikely(len == 0))
return 0;
char dummy[(len <= 256 ? len : 256)];
ret = s->pf_read(s, dummy, sizeof (dummy));
}
else
ret = s->pf_read(s, buf, len);
return ret;
}
ret = vlc_stream_CopyBlock(&priv->block, buf, len);
if (ret >= 0)
return ret;
if (s->pf_block != NULL)
{
bool eof = false;
priv->block = s->pf_block(s, &eof);
ret = vlc_stream_CopyBlock(&priv->block, buf, len);
if (ret >= 0)
return ret;
return eof ? 0 : -1;
}
return 0;
}
ssize_t vlc_stream_ReadPartial(stream_t *s, void *buf, size_t len)
{
stream_priv_t *priv = (stream_priv_t *)s;
ssize_t ret;
ret = vlc_stream_CopyBlock(&priv->peek, buf, len);
if (ret >= 0)
{
priv->offset += ret;
assert(ret <= (ssize_t)len);
return ret;
}
ret = vlc_stream_ReadRaw(s, buf, len);
if (ret > 0)
priv->offset += ret;
if (ret == 0)
priv->eof = len != 0;
assert(ret <= (ssize_t)len);
return ret;
}
ssize_t vlc_stream_Read(stream_t *s, void *buf, size_t len)
{
size_t copied = 0;
while (len > 0)
{
ssize_t ret = vlc_stream_ReadPartial(s, buf, len);
if (ret < 0)
continue;
if (ret == 0)
break;
if (buf != NULL)
buf = (char *)buf + ret;
assert(len >= (size_t)ret);
len -= ret;
copied += ret;
}
return copied;
}
ssize_t vlc_stream_Peek(stream_t *s, const uint8_t **restrict bufp, size_t len)
{
stream_priv_t *priv = (stream_priv_t *)s;
block_t *peek;
peek = priv->peek;
if (peek == NULL)
{
peek = priv->block;
priv->peek = peek;
priv->block = NULL;
}
if (peek == NULL)
{
peek = block_Alloc(len);
if (unlikely(peek == NULL))
return VLC_ENOMEM;
peek->i_buffer = 0;
}
else
if (peek->i_buffer < len)
{
size_t avail = peek->i_buffer;
peek = block_TryRealloc(peek, 0, len);
if (unlikely(peek == NULL))
return VLC_ENOMEM;
peek->i_buffer = avail;
}
priv->peek = peek;
*bufp = peek->p_buffer;
while (peek->i_buffer < len)
{
size_t avail = peek->i_buffer;
ssize_t ret;
ret = vlc_stream_ReadRaw(s, peek->p_buffer + avail, len - avail);
if (ret < 0)
continue;
peek->i_buffer += ret;
if (ret == 0)
return peek->i_buffer;
}
return len;
}
block_t *vlc_stream_ReadBlock(stream_t *s)
{
stream_priv_t *priv = (stream_priv_t *)s;
block_t *block;
if (vlc_killed())
{
priv->eof = true;
return NULL;
}
if (priv->peek != NULL)
{
block = priv->peek;
priv->peek = NULL;
}
else if (priv->block != NULL)
{
block = priv->block;
priv->block = NULL;
}
else if (s->pf_block != NULL)
{
priv->eof = false;
block = s->pf_block(s, &priv->eof);
}
else
{
block = block_Alloc(4096);
if (unlikely(block == NULL))
return NULL;
ssize_t ret = s->pf_read(s, block->p_buffer, block->i_buffer);
if (ret > 0)
block->i_buffer = ret;
else
{
block_Release(block);
block = NULL;
}
priv->eof = !ret;
}
if (block != NULL)
priv->offset += block->i_buffer;
return block;
}
uint64_t vlc_stream_Tell(const stream_t *s)
{
const stream_priv_t *priv = (const stream_priv_t *)s;
return priv->offset;
}
bool vlc_stream_Eof(const stream_t *s)
{
const stream_priv_t *priv = (const stream_priv_t *)s;
return priv->eof;
}
int vlc_stream_Seek(stream_t *s, uint64_t offset)
{
stream_priv_t *priv = (stream_priv_t *)s;
priv->eof = false;
block_t *peek = priv->peek;
if (peek != NULL)
{
if (offset >= priv->offset
&& offset <= (priv->offset + peek->i_buffer))
{ /* Seeking within the peek buffer */
size_t fwd = offset - priv->offset;
peek->p_buffer += fwd;
peek->i_buffer -= fwd;
priv->offset = offset;
if (peek->i_buffer == 0)
{
priv->peek = NULL;
block_Release(peek);
}
return VLC_SUCCESS;
}
}
else
{
if (priv->offset == offset)
return VLC_SUCCESS; /* Nothing to do! */
}
if (s->pf_seek == NULL)
return VLC_EGENERIC;
int ret = s->pf_seek(s, offset);
if (ret != VLC_SUCCESS)
return ret;
priv->offset = offset;
if (peek != NULL)
{
priv->peek = NULL;
block_Release(peek);
}
if (priv->block != NULL)
{
block_Release(priv->block);
priv->block = NULL;
}
return VLC_SUCCESS;
}
/**
* Use to control the "stream_t *". Look at #stream_query_e for
* possible "i_query" value and format arguments. Return VLC_SUCCESS
* if ... succeed ;) and VLC_EGENERIC if failed or unimplemented
*/
int vlc_stream_vaControl(stream_t *s, int cmd, va_list args)
{
stream_priv_t *priv = (stream_priv_t *)s;
switch (cmd)
{
case STREAM_SET_TITLE:
case STREAM_SET_SEEKPOINT:
{
int ret = s->pf_control(s, cmd, args);
if (ret != VLC_SUCCESS)
return ret;
priv->offset = 0;
if (priv->peek != NULL)
{
block_Release(priv->peek);
priv->peek = NULL;
}
if (priv->block != NULL)
{
block_Release(priv->block);
priv->block = NULL;
}
return VLC_SUCCESS;
}
}
return s->pf_control(s, cmd, args);
}
/**
* Read data into a block.
*
* @param s stream to read data from
* @param size number of bytes to read
* @return a block of data, or NULL on error
@ note The block size may be shorter than requested if the end-of-stream was
* reached.
*/
block_t *vlc_stream_Block( stream_t *s, size_t size )
{
if( unlikely(size > SSIZE_MAX) )
return NULL;
block_t *block = block_Alloc( size );
if( unlikely(block == NULL) )
return NULL;
ssize_t val = vlc_stream_Read( s, block->p_buffer, size );
if( val <= 0 )
{
block_Release( block );
return NULL;
}
block->i_buffer = val;
return block;
}
/**
* Returns a node containing all the input_item of the directory pointer by
* this stream. returns VLC_SUCCESS on success.
*/
int vlc_stream_ReadDir( stream_t *s, input_item_node_t *p_node )
{
return s->pf_readdir( s, p_node );
}
| 25.024828 | 93 | 0.518272 |
24fe08c571eacfced30dae5c705e12c192c18ac3 | 5,916 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_4k_sm_/i7-7700_9_0x48.log_8869_47.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_4k_sm_/i7-7700_9_0x48.log_8869_47.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_4k_sm_/i7-7700_9_0x48.log_8869_47.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 %r13
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x5251, %r9
nop
sub $26963, %r13
mov $0x6162636465666768, %r8
movq %r8, %xmm1
movups %xmm1, (%r9)
nop
add $12758, %r9
lea addresses_A_ht+0x86d1, %r13
nop
nop
xor $59520, %rdi
mov $0x6162636465666768, %r12
movq %r12, (%r13)
nop
nop
xor $51042, %r9
lea addresses_UC_ht+0x8559, %rsi
lea addresses_D_ht+0x10204, %rdi
nop
nop
nop
mfence
mov $84, %rcx
rep movsq
nop
nop
dec %r9
lea addresses_D_ht+0x1bf59, %rsi
lea addresses_UC_ht+0xc909, %rdi
and %rax, %rax
mov $7, %rcx
rep movsq
nop
nop
nop
nop
nop
inc %r8
lea addresses_WC_ht+0xad59, %rcx
nop
nop
nop
nop
inc %r9
movb $0x61, (%rcx)
nop
and %r12, %r12
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r9
push %rbp
push %rbx
push %rcx
push %rsi
// Load
lea addresses_D+0x1c159, %r14
nop
nop
sub %rcx, %rcx
movaps (%r14), %xmm5
vpextrq $0, %xmm5, %rbx
nop
nop
nop
nop
nop
cmp $56663, %rbp
// Store
lea addresses_D+0x10d59, %rbp
nop
nop
nop
nop
and $18786, %rsi
mov $0x5152535455565758, %rcx
movq %rcx, %xmm5
movups %xmm5, (%rbp)
nop
nop
cmp $52648, %rbx
// Store
lea addresses_A+0xf559, %rsi
nop
nop
nop
nop
nop
sub %rcx, %rcx
movb $0x51, (%rsi)
nop
cmp $20967, %rsi
// Faulty Load
lea addresses_A+0xf559, %rcx
nop
nop
nop
and $39397, %r14
movb (%rcx), %bl
lea oracles, %rcx
and $0xff, %rbx
shlq $12, %rbx
mov (%rcx,%rbx,1), %rbx
pop %rsi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': True, 'congruent': 10, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 11, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 3, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 2, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 10, 'size': 1, 'same': False, 'NT': True}}
{'51': 8869}
51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51
*/
| 38.167742 | 2,999 | 0.656694 |
7f38ea4c5d991d6e4497e6b8babde7a3b6e3b4e0 | 2,982 | go | Go | src/codechef/easy/section10/section11/bit2c/solution.go | wangsenyuan/learn-go | a2ee4862b006e78cfb993b4cac229d6c58b8c583 | [
"Apache-2.0"
] | 5 | 2020-06-04T03:44:24.000Z | 2021-11-14T03:16:25.000Z | src/codechef/easy/section10/section11/bit2c/solution.go | wangsenyuan/learn-go | a2ee4862b006e78cfb993b4cac229d6c58b8c583 | [
"Apache-2.0"
] | null | null | null | src/codechef/easy/section10/section11/bit2c/solution.go | wangsenyuan/learn-go | a2ee4862b006e78cfb993b4cac229d6c58b8c583 | [
"Apache-2.0"
] | null | null | null | package main
import (
"bufio"
"fmt"
"os"
)
func readInt(bytes []byte, from int, val *int) int {
i := from
sign := 1
if bytes[i] == '-' {
sign = -1
i++
}
tmp := 0
for i < len(bytes) && bytes[i] != ' ' {
tmp = tmp*10 + int(bytes[i]-'0')
i++
}
*val = tmp * sign
return i
}
func readNum(scanner *bufio.Scanner) (a int) {
scanner.Scan()
readInt(scanner.Bytes(), 0, &a)
return
}
func readTwoNums(scanner *bufio.Scanner) (a int, b int) {
res := readNNums(scanner, 2)
a, b = res[0], res[1]
return
}
func readNNums(scanner *bufio.Scanner, n int) []int {
res := make([]int, n)
x := 0
scanner.Scan()
for i := 0; i < n; i++ {
for x < len(scanner.Bytes()) && scanner.Bytes()[x] == ' ' {
x++
}
x = readInt(scanner.Bytes(), x, &res[i])
}
return res
}
func fillNNums(scanner *bufio.Scanner, n int, res []int) {
x := 0
scanner.Scan()
for i := 0; i < n; i++ {
for x < len(scanner.Bytes()) && scanner.Bytes()[x] == ' ' {
x++
}
x = readInt(scanner.Bytes(), x, &res[i])
}
}
func readUint64(bytes []byte, from int, val *uint64) int {
i := from
var tmp uint64
for i < len(bytes) && bytes[i] != ' ' {
tmp = tmp*10 + uint64(bytes[i]-'0')
i++
}
*val = tmp
return i
}
func readInt64(bytes []byte, from int, val *int64) int {
i := from
var tmp int64
for i < len(bytes) && bytes[i] != ' ' {
tmp = tmp*10 + int64(bytes[i]-'0')
i++
}
*val = tmp
return i
}
func readNInt64Nums(scanner *bufio.Scanner, n int) []int64 {
res := make([]int64, n)
x := -1
scanner.Scan()
for i := 0; i < n; i++ {
x = readInt64(scanner.Bytes(), x+1, &res[i])
}
return res
}
func main() {
scanner := bufio.NewScanner(os.Stdin)
tc := readNum(scanner)
for tc > 0 {
tc--
scanner.Scan()
s := scanner.Text()
fmt.Println(solve(s))
}
}
func solve(s string) int {
nums := make([]int, 0, 11)
ops := make([]byte, 0, 11)
var num int
for i := 0; i <= len(s); i++ {
if i == len(s) || !isDigit(s[i]) {
nums = append(nums, num)
if i < len(s) {
ops = append(ops, s[i])
}
num = 0
continue
}
x := int(s[i] - '0')
num = num*10 + x
}
n := len(nums)
dp := make([][]map[int]bool, n)
for i := 0; i < n; i++ {
dp[i] = make([]map[int]bool, n)
}
var dfs func(i, j int) map[int]bool
dfs = func(i, j int) map[int]bool {
if dp[i][j] != nil {
return dp[i][j]
}
dp[i][j] = make(map[int]bool)
if i == j {
dp[i][j][nums[i]] = true
return dp[i][j]
}
for k := i; k < j; k++ {
a := dfs(i, k)
b := dfs(k+1, j)
for aa := range a {
for bb := range b {
cc := bitOp(aa, bb, ops[k])
dp[i][j][cc] = true
}
}
}
return dp[i][j]
}
res := dfs(0, n-1)
var ans int
for k := range res {
ans = max(ans, k)
}
return ans
}
func isDigit(x byte) bool {
return x >= '0' && x <= '9'
}
func bitOp(a int, b int, c byte) int {
if c == '&' {
return a & b
}
if c == '|' {
return a | b
}
return a ^ b
}
func max(a, b int) int {
if a >= b {
return a
}
return b
}
| 15.777778 | 61 | 0.518779 |
bf7ea575975fc4257b834c1760d7cfeaac659dd0 | 5,551 | swift | Swift | Shared/Views/CommandView.swift | Holger-Mayer/Markdown | c7a210f1aa98dd03dd111444611906696f062875 | [
"MIT"
] | null | null | null | Shared/Views/CommandView.swift | Holger-Mayer/Markdown | c7a210f1aa98dd03dd111444611906696f062875 | [
"MIT"
] | null | null | null | Shared/Views/CommandView.swift | Holger-Mayer/Markdown | c7a210f1aa98dd03dd111444611906696f062875 | [
"MIT"
] | null | null | null | //
// CommandView.swift
// MarkdownEditor
//
// Created by holgermayer on 03.11.20.
//
import SwiftUI
struct CommandView: View {
@Binding var markdownContent : String
@Binding var selectedRange : NSRange
var body: some View {
HStack {
Button("Chapter") {
let tag = "\n# Chapter"
replaceRangeWith(tag)
}
Button("Section") {
let tag = "\n## Section"
replaceRangeWith(tag)
}
Button(action: {
let tag =
"""
\n
| A | B | C | D | E |
|:---|:---:|---:|---|---|
| l | c | r | | |
| l | c | r | | |
| l | c | r | | |
\n
"""
replaceRangeWith(tag)
}) {
Image(systemName: "tablecells")
}
Button(action: {
toogleSurroundingTag(tag: "**")
}) {
Image(systemName: "bold")
}
Button(action: {
toogleSurroundingTag(tag: "*")
}) {
Image(systemName: "italic")
}
Button("Lorem") {
let tag = """
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
"""
replaceRangeWith(tag)
}
}
}
func replaceRangeWith(_ tag : String) {
let range = Range(selectedRange,in:markdownContent)
markdownContent.replaceSubrange(range!, with:tag)
selectedRange = NSMakeRange(selectedRange.length+selectedRange.location+tag.count,0)
}
func surroundRangeWith(startTag:String, endTag:String) {
let range = Range(selectedRange,in:markdownContent)
let startIndex = range?.lowerBound
let endIndex = range?.upperBound
let innerContent = markdownContent[startIndex!..<endIndex!]
let newInnerContent = startTag + innerContent + endTag
markdownContent.replaceSubrange(range!, with: newInnerContent)
selectedRange = NSMakeRange(selectedRange.location,selectedRange.length + startTag.count + endTag.count)
}
func toogleSurroundingTag(tag : String){
let range = Range(selectedRange,in:markdownContent)
let startIndex = range?.lowerBound
let endIndex = range?.upperBound
let innerContent = markdownContent[startIndex!..<endIndex!]
if innerContent.hasPrefix(tag) && innerContent.hasSuffix(tag) && innerContent.count >= tag.count * 2 {
var newInnerContent = innerContent.dropFirst(tag.count)
newInnerContent = newInnerContent.dropLast(tag.count)
markdownContent.replaceSubrange(range!, with: newInnerContent)
selectedRange = NSMakeRange(selectedRange.location,selectedRange.length - 2 * tag.count)
} else {
surroundRangeWith(startTag: tag, endTag: tag)
}
}
}
struct CommandView_Previews: PreviewProvider {
static var previews: some View {
CommandView(markdownContent: .constant("Dies ist ein Hugo"), selectedRange: .constant(NSMakeRange(0, 0)))
}
}
| 50.463636 | 903 | 0.620609 |
9c2f377dc4b145eb3a4750cf2b4d2146b93066f6 | 1,395 | js | JavaScript | src/Administration/Resources/app/administration/src/core/service/api/custom-field-set.service.js | logTom/platform | c4abfdc17d4583d3efd76498be395f5ec376828d | [
"MIT"
] | 1 | 2021-01-13T21:58:08.000Z | 2021-01-13T21:58:08.000Z | src/Administration/Resources/app/administration/src/core/service/api/custom-field-set.service.js | logTom/platform | c4abfdc17d4583d3efd76498be395f5ec376828d | [
"MIT"
] | 243 | 2020-08-05T07:54:54.000Z | 2022-03-25T17:53:20.000Z | src/Administration/Resources/app/administration/src/core/service/api/custom-field-set.service.js | logTom/platform | c4abfdc17d4583d3efd76498be395f5ec376828d | [
"MIT"
] | 1 | 2020-01-17T10:23:14.000Z | 2020-01-17T10:23:14.000Z | import CriteriaFactory from 'src/core/factory/criteria.factory';
import ApiService from '../api.service';
/**
* @deprecated tag:v6.4.0 - use src/core/data-new/repository.data.js for handling entity data
*
* Gateway for the API end point "custom-field-set"
* @class
* @extends ApiService
*/
class CustomFieldSetApiService extends ApiService {
constructor(httpClient, loginService, apiEndpoint = 'custom-field-set') {
super(httpClient, loginService, apiEndpoint);
this.name = 'customFieldSetService';
}
/**
* @deprecated tag:v6.4.0 - use src/core/data-new/repository.data.js search() function instead
*/
getList(options, onlyActive = true) {
this.showDeprecationWarning('getList');
if (onlyActive) {
const activeCriteria = CriteriaFactory.equals('active', true);
options.criteria = options.criteria
? CriteriaFactory.multi('AND', options.criteria, activeCriteria)
: activeCriteria;
if (options.associations && options.associations.customFields) {
const { associations: { customFields } } = options;
if (!customFields.filter) {
customFields.filter = [activeCriteria.getQuery()];
}
}
}
return super.getList(options);
}
}
export default CustomFieldSetApiService;
| 34.02439 | 98 | 0.635125 |
e756dd326d378dc4baa05a2c0c44a2078959c642 | 2,110 | js | JavaScript | src/api/parser/src/utils/__mocks__/supabase.js | nguyenhung15913/telescope | 11268ac446a52cf3337e3ab607fa6c1e950afbd7 | [
"BSD-2-Clause"
] | null | null | null | src/api/parser/src/utils/__mocks__/supabase.js | nguyenhung15913/telescope | 11268ac446a52cf3337e3ab607fa6c1e950afbd7 | [
"BSD-2-Clause"
] | 14 | 2022-01-20T21:30:19.000Z | 2022-01-27T22:23:01.000Z | src/api/parser/src/utils/__mocks__/supabase.js | AmasiaNalbandian/telescope | 182e00e98053db6e6b8184c4b8d25f225d7e3f2e | [
"BSD-2-Clause"
] | 1 | 2022-02-21T03:25:06.000Z | 2022-02-21T03:25:06.000Z | const { hash } = require('@senecacdot/satellite');
const normalizeUrl = require('normalize-url');
const urlToId = (url) => hash(normalizeUrl(url));
let feeds = [];
let feedIds = new Set();
module.exports = {
__resetMockFeeds: () => {
feeds = [];
feedIds = new Set();
},
/**
* @param {Array<Feed | { url: string }>} feedObjects
*/
__setMockFeeds: (feedObjects) => {
const mockFeeds = feedObjects.reduce((uniqueFeeds, feed) => {
const id = feed.id || urlToId(feed.url);
if (!feedIds.has(id)) {
feedIds.add(id);
return uniqueFeeds.concat({ id, invalid: false, flagged: false });
}
return uniqueFeeds;
}, []);
feeds = feeds.concat(mockFeeds);
},
// Invalid feed related functions
setInvalidFeed: (id) => {
feeds.forEach((feed) => {
if (feed.id === id) {
feed.invalid = true;
}
});
return Promise.resolve();
},
getInvalidFeeds: () => {
const invalidFeedIds = feeds.filter((feed) => feed.flagged).map((feed) => ({ id: feed.id }));
return Promise.resolve(invalidFeedIds);
},
isInvalid: (id) => {
const targetFeed = feeds.find((feed) => feed.id === id);
return Promise.resolve(!!targetFeed.invalid);
},
// Flagged feed related functions
getAllFeeds: jest.fn().mockImplementation(() => Promise.resolve(feeds)),
setFlaggedFeed: jest.fn().mockImplementation((id) => {
feeds.forEach((feed) => {
if (feed.id === id) {
feed.flagged = true;
}
});
return Promise.resolve();
}),
unsetFlaggedFeed: jest.fn().mockImplementation((id) => {
feeds.forEach((feed) => {
if (feed.id === id) {
feed.flagged = false;
}
});
return Promise.resolve();
}),
getFlaggedFeeds: jest.fn().mockImplementation(() => {
const flaggedFeedIds = feeds.filter((feed) => feed.flagged).map((feed) => feed.id);
return Promise.resolve(flaggedFeedIds);
}),
isFlagged: jest.fn().mockImplementation((id) => {
const targetFeed = feeds.find((feed) => feed.id === id);
return Promise.resolve(!!targetFeed.flagged);
}),
};
| 28.513514 | 97 | 0.590995 |
39c7d39223f713edd6a469ad97cc55a22f948c3b | 271 | js | JavaScript | middleware/cookies.js | keepsteady2/QuillCMS | de5fdc740558f9a1877a65ca09fb54765b246af1 | [
"MIT"
] | 57 | 2019-01-03T13:02:31.000Z | 2022-02-12T03:57:06.000Z | middleware/cookies.js | keepsteady2/QuillCMS | de5fdc740558f9a1877a65ca09fb54765b246af1 | [
"MIT"
] | 6 | 2019-01-24T08:30:40.000Z | 2022-01-22T01:46:16.000Z | middleware/cookies.js | keepsteady2/QuillCMS | de5fdc740558f9a1877a65ca09fb54765b246af1 | [
"MIT"
] | 12 | 2019-05-02T16:47:56.000Z | 2021-12-14T06:24:50.000Z | import axios from 'axios'
// 解决服务端发送请求无法获得cookie的问题
export default function (ctx) {
if (ctx.isServer) {
axios.defaults.headers.common = {}
Object.keys(ctx.req.headers).map((key) => {
axios.defaults.headers.common[key] = ctx.req.headers[key]
})
}
}
| 22.583333 | 63 | 0.660517 |
abad3922ab4bc02e2663e799c1f9c21fefc9726c | 248 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sccz80/l_f16_inv.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 4 | 2021-12-23T15:34:05.000Z | 2021-12-23T15:36:16.000Z | libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sccz80/l_f16_inv.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 2 | 2022-03-20T22:17:35.000Z | 2022-03-24T16:10:00.000Z | libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sccz80/l_f16_inv.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | null | null | null |
SECTION code_fp_math16
PUBLIC l_f16_invf
PUBLIC invf16
EXTERN asm_f16_inv
defc l_f16_invf = asm_f16_inv
defc invf16 = asm_f16_inv
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _invf16
defc _invf16 = invf16
ENDIF
| 11.809524 | 33 | 0.717742 |
c3830185506bb0407a6bcd3d31caf6557033c575 | 1,131 | go | Go | common.go | TipsyPixie/advent-of-code-2020 | 9e178f8e5d274483690750c3fe6b6c765bcae235 | [
"Beerware"
] | null | null | null | common.go | TipsyPixie/advent-of-code-2020 | 9e178f8e5d274483690750c3fe6b6c765bcae235 | [
"Beerware"
] | null | null | null | common.go | TipsyPixie/advent-of-code-2020 | 9e178f8e5d274483690750c3fe6b6c765bcae235 | [
"Beerware"
] | null | null | null | package aoc
import (
"bufio"
"io/ioutil"
"os"
"testing"
)
type Input interface {
ReadLine() (string, bool, error)
ReadAll() (string, error)
Close() error
}
type fileInput struct {
file *os.File
scanner *bufio.Scanner
}
// to make sure fileInput implements Input
var _ Input = (*fileInput)(nil)
func FromFile(path string) (*fileInput, error) {
file, err := os.Open(path)
if err != nil {
return nil, err
}
return &fileInput{
file: file,
scanner: bufio.NewScanner(file),
}, nil
}
func (input *fileInput) ReadLine() (string, bool, error) {
if input.scanner.Scan() {
return input.scanner.Text(), true, nil
}
return "", false, input.scanner.Err()
}
func (input *fileInput) ReadAll() (string, error) {
fileContents, err := ioutil.ReadAll(input.file)
if err != nil {
return "", err
}
return string(fileContents), nil
}
func (input *fileInput) Close() error {
err := input.file.Close()
if err != nil {
return err
}
return nil
}
func CommonTest(t *testing.T, f func(string) (int, error)) {
answer, err := f("./input.txt")
if err != nil {
t.Error(err)
t.FailNow()
}
t.Log(answer)
}
| 17.136364 | 60 | 0.647215 |
0bc299479722d533572217a6216eb2f5e70a58eb | 50,867 | js | JavaScript | custom-lib/ui-bootstrap-custom.js | B-Pratik/TakeMeThere | 1cdcb4152f7db5e3c2d7f9641a34b05de704a437 | [
"MIT"
] | null | null | null | custom-lib/ui-bootstrap-custom.js | B-Pratik/TakeMeThere | 1cdcb4152f7db5e3c2d7f9641a34b05de704a437 | [
"MIT"
] | null | null | null | custom-lib/ui-bootstrap-custom.js | B-Pratik/TakeMeThere | 1cdcb4152f7db5e3c2d7f9641a34b05de704a437 | [
"MIT"
] | null | null | null | /* jshint ignore:start */
angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.datepickerPopup","ui.bootstrap.datepicker","ui.bootstrap.dateparser","ui.bootstrap.isClass","ui.bootstrap.position","ui.bootstrap.dropdown","ui.bootstrap.tabindex","ui.bootstrap.tabs"]),angular.module("ui.bootstrap.tpls",["uib/template/datepickerPopup/popup.html","uib/template/datepicker/datepicker.html","uib/template/datepicker/day.html","uib/template/datepicker/month.html","uib/template/datepicker/year.html","uib/template/tabs/tab.html","uib/template/tabs/tabset.html"]),angular.module("ui.bootstrap.datepickerPopup",["ui.bootstrap.datepicker","ui.bootstrap.position"]).value("$datepickerPopupLiteralWarning",!0).constant("uibDatepickerPopupConfig",{altInputFormats:[],appendToBody:!1,clearText:"Clear",closeOnDateSelection:!0,closeText:"Done",currentText:"Today",datepickerPopup:"yyyy-MM-dd",datepickerPopupTemplateUrl:"uib/template/datepickerPopup/popup.html",datepickerTemplateUrl:"uib/template/datepicker/datepicker.html",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},onOpenFocus:!0,showButtonBar:!0,placement:"auto bottom-left"}).controller("UibDatepickerPopupController",["$scope","$element","$attrs","$compile","$log","$parse","$window","$document","$rootScope","$uibPosition","dateFilter","uibDateParser","uibDatepickerPopupConfig","$timeout","uibDatepickerConfig","$datepickerPopupLiteralWarning",function(e,t,n,i,a,r,o,s,l,u,p,c,d,f,h,m){function g(t){var n=c.parse(t,k,e.date);if(isNaN(n))for(var i=0;i<N.length;i++)if(n=c.parse(t,N[i],e.date),!isNaN(n))return n;return n}function b(e){if(angular.isNumber(e)&&(e=new Date(e)),!e)return null;if(angular.isDate(e)&&!isNaN(e))return e;if(angular.isString(e)){var t=g(e);if(!isNaN(t))return c.fromTimezone(t,A.timezone)}return S.$options&&S.$options.allowInvalid?e:void 0}function v(e,t){var i=e||t;return n.ngRequired||i?(angular.isNumber(i)&&(i=new Date(i)),i?angular.isDate(i)&&!isNaN(i)?!0:angular.isString(i)?!isNaN(g(i)):!1:!0):!0}function y(n){if(e.isOpen||!e.disabled){var i=P[0],a=t[0].contains(n.target),r=void 0!==i.contains&&i.contains(n.target);!e.isOpen||a||r||e.$apply(function(){e.isOpen=!1})}}function w(n){27===n.which&&e.isOpen?(n.preventDefault(),n.stopPropagation(),e.$apply(function(){e.isOpen=!1}),t[0].focus()):40!==n.which||e.isOpen||(n.preventDefault(),n.stopPropagation(),e.$apply(function(){e.isOpen=!0}))}function D(){if(e.isOpen){var i=angular.element(P[0].querySelector(".uib-datepicker-popup")),a=n.popupPlacement?n.popupPlacement:d.placement,r=u.positionElements(t,i,a,$);i.css({top:r.top+"px",left:r.left+"px"}),i.hasClass("uib-position-measure")&&i.removeClass("uib-position-measure")}}var k,M,$,T,x,O,E,C,F,S,A,P,N,Y=!1,R=[];this.init=function(a){if(S=a,A=angular.isObject(a.$options)?a.$options:{timezone:null},M=angular.isDefined(n.closeOnDateSelection)?e.$parent.$eval(n.closeOnDateSelection):d.closeOnDateSelection,$=angular.isDefined(n.datepickerAppendToBody)?e.$parent.$eval(n.datepickerAppendToBody):d.appendToBody,T=angular.isDefined(n.onOpenFocus)?e.$parent.$eval(n.onOpenFocus):d.onOpenFocus,x=angular.isDefined(n.datepickerPopupTemplateUrl)?n.datepickerPopupTemplateUrl:d.datepickerPopupTemplateUrl,O=angular.isDefined(n.datepickerTemplateUrl)?n.datepickerTemplateUrl:d.datepickerTemplateUrl,N=angular.isDefined(n.altInputFormats)?e.$parent.$eval(n.altInputFormats):d.altInputFormats,e.showButtonBar=angular.isDefined(n.showButtonBar)?e.$parent.$eval(n.showButtonBar):d.showButtonBar,d.html5Types[n.type]?(k=d.html5Types[n.type],Y=!0):(k=n.uibDatepickerPopup||d.datepickerPopup,n.$observe("uibDatepickerPopup",function(e){var t=e||d.datepickerPopup;if(t!==k&&(k=t,S.$modelValue=null,!k))throw new Error("uibDatepickerPopup must have a date format specified.")})),!k)throw new Error("uibDatepickerPopup must have a date format specified.");if(Y&&n.uibDatepickerPopup)throw new Error("HTML5 date input types do not support custom formats.");E=angular.element("<div uib-datepicker-popup-wrap><div uib-datepicker></div></div>"),E.attr({"ng-model":"date","ng-change":"dateSelection(date)","template-url":x}),C=angular.element(E.children()[0]),C.attr("template-url",O),e.datepickerOptions||(e.datepickerOptions={}),Y&&"month"===n.type&&(e.datepickerOptions.datepickerMode="month",e.datepickerOptions.minMode="month"),C.attr("datepicker-options","datepickerOptions"),Y?S.$formatters.push(function(t){return e.date=c.fromTimezone(t,A.timezone),t}):(S.$$parserName="date",S.$validators.date=v,S.$parsers.unshift(b),S.$formatters.push(function(t){return S.$isEmpty(t)?(e.date=t,t):(angular.isNumber(t)&&(t=new Date(t)),e.date=c.fromTimezone(t,A.timezone),c.filter(e.date,k))})),S.$viewChangeListeners.push(function(){e.date=g(S.$viewValue)}),t.on("keydown",w),P=i(E)(e),E.remove(),$?s.find("body").append(P):t.after(P),e.$on("$destroy",function(){for(e.isOpen===!0&&(l.$$phase||e.$apply(function(){e.isOpen=!1})),P.remove(),t.off("keydown",w),s.off("click",y),F&&F.off("scroll",D),angular.element(o).off("resize",D);R.length;)R.shift()()})},e.getText=function(t){return e[t+"Text"]||d[t+"Text"]},e.isDisabled=function(t){"today"===t&&(t=c.fromTimezone(new Date,A.timezone));var n={};return angular.forEach(["minDate","maxDate"],function(t){e.datepickerOptions[t]?angular.isDate(e.datepickerOptions[t])?n[t]=new Date(e.datepickerOptions[t]):(m&&a.warn("Literal date support has been deprecated, please switch to date object usage"),n[t]=new Date(p(e.datepickerOptions[t],"medium"))):n[t]=null}),e.datepickerOptions&&n.minDate&&e.compare(t,n.minDate)<0||n.maxDate&&e.compare(t,n.maxDate)>0},e.compare=function(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate())-new Date(t.getFullYear(),t.getMonth(),t.getDate())},e.dateSelection=function(n){e.date=n;var i=e.date?c.filter(e.date,k):null;t.val(i),S.$setViewValue(i),M&&(e.isOpen=!1,t[0].focus())},e.keydown=function(n){27===n.which&&(n.stopPropagation(),e.isOpen=!1,t[0].focus())},e.select=function(t,n){if(n.stopPropagation(),"today"===t){var i=new Date;angular.isDate(e.date)?(t=new Date(e.date),t.setFullYear(i.getFullYear(),i.getMonth(),i.getDate())):(t=c.fromTimezone(i,A.timezone),t.setHours(0,0,0,0))}e.dateSelection(t)},e.close=function(n){n.stopPropagation(),e.isOpen=!1,t[0].focus()},e.disabled=angular.isDefined(n.disabled)||!1,n.ngDisabled&&R.push(e.$parent.$watch(r(n.ngDisabled),function(t){e.disabled=t})),e.$watch("isOpen",function(i){i?e.disabled?e.isOpen=!1:f(function(){D(),T&&e.$broadcast("uib:datepicker.focus"),s.on("click",y);var i=n.popupPlacement?n.popupPlacement:d.placement;$||u.parsePlacement(i)[2]?(F=F||angular.element(u.scrollParent(t)),F&&F.on("scroll",D)):F=null,angular.element(o).on("resize",D)},0,!1):(s.off("click",y),F&&F.off("scroll",D),angular.element(o).off("resize",D))}),e.$on("uib:datepicker.mode",function(){f(D,0,!1)})}]).directive("uibDatepickerPopup",function(){return{require:["ngModel","uibDatepickerPopup"],controller:"UibDatepickerPopupController",scope:{datepickerOptions:"=?",isOpen:"=?",currentText:"@",clearText:"@",closeText:"@"},link:function(e,t,n,i){var a=i[0],r=i[1];r.init(a)}}}).directive("uibDatepickerPopupWrap",function(){return{restrict:"A",transclude:!0,templateUrl:function(e,t){return t.templateUrl||"uib/template/datepickerPopup/popup.html"}}}),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.isClass"]).value("$datepickerSuppressError",!1).value("$datepickerLiteralWarning",!0).constant("uibDatepickerConfig",{datepickerMode:"day",formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",maxDate:null,maxMode:"year",minDate:null,minMode:"day",monthColumns:3,ngModelOptions:{},shortcutPropagation:!1,showWeeks:!0,yearColumns:5,yearRows:4}).controller("UibDatepickerController",["$scope","$element","$attrs","$parse","$interpolate","$locale","$log","dateFilter","uibDatepickerConfig","$datepickerLiteralWarning","$datepickerSuppressError","uibDateParser",function(e,t,n,i,a,r,o,s,l,u,p,c){function d(t){e.datepickerMode=t,e.datepickerOptions.datepickerMode=t}var f=this,h={$setViewValue:angular.noop},m={},g=[];t.addClass("uib-datepicker"),n.$set("role","application"),e.datepickerOptions||(e.datepickerOptions={}),this.modes=["day","month","year"],["customClass","dateDisabled","datepickerMode","formatDay","formatDayHeader","formatDayTitle","formatMonth","formatMonthTitle","formatYear","maxDate","maxMode","minDate","minMode","monthColumns","showWeeks","shortcutPropagation","startingDay","yearColumns","yearRows"].forEach(function(t){switch(t){case"customClass":case"dateDisabled":e[t]=e.datepickerOptions[t]||angular.noop;break;case"datepickerMode":e.datepickerMode=angular.isDefined(e.datepickerOptions.datepickerMode)?e.datepickerOptions.datepickerMode:l.datepickerMode;break;case"formatDay":case"formatDayHeader":case"formatDayTitle":case"formatMonth":case"formatMonthTitle":case"formatYear":f[t]=angular.isDefined(e.datepickerOptions[t])?a(e.datepickerOptions[t])(e.$parent):l[t];break;case"monthColumns":case"showWeeks":case"shortcutPropagation":case"yearColumns":case"yearRows":f[t]=angular.isDefined(e.datepickerOptions[t])?e.datepickerOptions[t]:l[t];break;case"startingDay":f.startingDay=angular.isDefined(e.datepickerOptions.startingDay)?e.datepickerOptions.startingDay:angular.isNumber(l.startingDay)?l.startingDay:(r.DATETIME_FORMATS.FIRSTDAYOFWEEK+8)%7;break;case"maxDate":case"minDate":e.$watch("datepickerOptions."+t,function(e){e?angular.isDate(e)?f[t]=c.fromTimezone(new Date(e),m.timezone):(u&&o.warn("Literal date support has been deprecated, please switch to date object usage"),f[t]=new Date(s(e,"medium"))):f[t]=l[t]?c.fromTimezone(new Date(l[t]),m.timezone):null,f.refreshView()});break;case"maxMode":case"minMode":e.datepickerOptions[t]?e.$watch(function(){return e.datepickerOptions[t]},function(n){f[t]=e[t]=angular.isDefined(n)?n:e.datepickerOptions[t],("minMode"===t&&f.modes.indexOf(e.datepickerOptions.datepickerMode)<f.modes.indexOf(f[t])||"maxMode"===t&&f.modes.indexOf(e.datepickerOptions.datepickerMode)>f.modes.indexOf(f[t]))&&(e.datepickerMode=f[t],e.datepickerOptions.datepickerMode=f[t])}):f[t]=e[t]=l[t]||null}}),e.uniqueId="datepicker-"+e.$id+"-"+Math.floor(1e4*Math.random()),e.disabled=angular.isDefined(n.disabled)||!1,angular.isDefined(n.ngDisabled)&&g.push(e.$parent.$watch(n.ngDisabled,function(t){e.disabled=t,f.refreshView()})),e.isActive=function(t){return 0===f.compare(t.date,f.activeDate)?(e.activeDateId=t.uid,!0):!1},this.init=function(t){h=t,m=t.$options||e.datepickerOptions.ngModelOptions||l.ngModelOptions,e.datepickerOptions.initDate?(f.activeDate=c.fromTimezone(e.datepickerOptions.initDate,m.timezone)||new Date,e.$watch("datepickerOptions.initDate",function(e){e&&(h.$isEmpty(h.$modelValue)||h.$invalid)&&(f.activeDate=c.fromTimezone(e,m.timezone),f.refreshView())})):f.activeDate=new Date;var n=h.$modelValue?new Date(h.$modelValue):new Date;this.activeDate=isNaN(n)?c.fromTimezone(new Date,m.timezone):c.fromTimezone(n,m.timezone),h.$render=function(){f.render()}},this.render=function(){if(h.$viewValue){var e=new Date(h.$viewValue),t=!isNaN(e);t?this.activeDate=c.fromTimezone(e,m.timezone):p||o.error('Datepicker directive: "ng-model" value must be a Date object')}this.refreshView()},this.refreshView=function(){if(this.element){e.selectedDt=null,this._refreshView(),e.activeDt&&(e.activeDateId=e.activeDt.uid);var t=h.$viewValue?new Date(h.$viewValue):null;t=c.fromTimezone(t,m.timezone),h.$setValidity("dateDisabled",!t||this.element&&!this.isDisabled(t))}},this.createDateObject=function(t,n){var i=h.$viewValue?new Date(h.$viewValue):null;i=c.fromTimezone(i,m.timezone);var a=new Date;a=c.fromTimezone(a,m.timezone);var r=this.compare(t,a),o={date:t,label:c.filter(t,n),selected:i&&0===this.compare(t,i),disabled:this.isDisabled(t),past:0>r,current:0===r,future:r>0,customClass:this.customClass(t)||null};return i&&0===this.compare(t,i)&&(e.selectedDt=o),f.activeDate&&0===this.compare(o.date,f.activeDate)&&(e.activeDt=o),o},this.isDisabled=function(t){return e.disabled||this.minDate&&this.compare(t,this.minDate)<0||this.maxDate&&this.compare(t,this.maxDate)>0||e.dateDisabled&&e.dateDisabled({date:t,mode:e.datepickerMode})},this.customClass=function(t){return e.customClass({date:t,mode:e.datepickerMode})},this.split=function(e,t){for(var n=[];e.length>0;)n.push(e.splice(0,t));return n},e.select=function(t){if(e.datepickerMode===f.minMode){var n=h.$viewValue?c.fromTimezone(new Date(h.$viewValue),m.timezone):new Date(0,0,0,0,0,0,0);n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n=c.toTimezone(n,m.timezone),h.$setViewValue(n),h.$render()}else f.activeDate=t,d(f.modes[f.modes.indexOf(e.datepickerMode)-1]),e.$emit("uib:datepicker.mode");e.$broadcast("uib:datepicker.focus")},e.move=function(e){var t=f.activeDate.getFullYear()+e*(f.step.years||0),n=f.activeDate.getMonth()+e*(f.step.months||0);f.activeDate.setFullYear(t,n,1),f.refreshView()},e.toggleMode=function(t){t=t||1,e.datepickerMode===f.maxMode&&1===t||e.datepickerMode===f.minMode&&-1===t||(d(f.modes[f.modes.indexOf(e.datepickerMode)+t]),e.$emit("uib:datepicker.mode"))},e.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var b=function(){f.element[0].focus()};e.$on("uib:datepicker.focus",b),e.keydown=function(t){var n=e.keys[t.which];if(n&&!t.shiftKey&&!t.altKey&&!e.disabled)if(t.preventDefault(),f.shortcutPropagation||t.stopPropagation(),"enter"===n||"space"===n){if(f.isDisabled(f.activeDate))return;e.select(f.activeDate)}else!t.ctrlKey||"up"!==n&&"down"!==n?(f.handleKeyDown(n,t),f.refreshView()):e.toggleMode("up"===n?1:-1)},t.on("keydown",function(t){e.$apply(function(){e.keydown(t)})}),e.$on("$destroy",function(){for(;g.length;)g.shift()()})}]).controller("UibDaypickerController",["$scope","$element","dateFilter",function(e,t,n){function i(e,t){return 1!==t||e%4!==0||e%100===0&&e%400!==0?r[t]:29}function a(e){var t=new Date(e);t.setDate(t.getDate()+4-(t.getDay()||7));var n=t.getTime();return t.setMonth(0),t.setDate(1),Math.floor(Math.round((n-t)/864e5)/7)+1}var r=[31,28,31,30,31,30,31,31,30,31,30,31];this.step={months:1},this.element=t,this.init=function(t){angular.extend(t,this),e.showWeeks=t.showWeeks,t.refreshView()},this.getDates=function(e,t){for(var n,i=new Array(t),a=new Date(e),r=0;t>r;)n=new Date(a),i[r++]=n,a.setDate(a.getDate()+1);return i},this._refreshView=function(){var t=this.activeDate.getFullYear(),i=this.activeDate.getMonth(),r=new Date(this.activeDate);r.setFullYear(t,i,1);var o=this.startingDay-r.getDay(),s=o>0?7-o:-o,l=new Date(r);s>0&&l.setDate(-s+1);for(var u=this.getDates(l,42),p=0;42>p;p++)u[p]=angular.extend(this.createDateObject(u[p],this.formatDay),{secondary:u[p].getMonth()!==i,uid:e.uniqueId+"-"+p});e.labels=new Array(7);for(var c=0;7>c;c++)e.labels[c]={abbr:n(u[c].date,this.formatDayHeader),full:n(u[c].date,"EEEE")};if(e.title=n(this.activeDate,this.formatDayTitle),e.rows=this.split(u,7),e.showWeeks){e.weekNumbers=[];for(var d=(11-this.startingDay)%7,f=e.rows.length,h=0;f>h;h++)e.weekNumbers.push(a(e.rows[h][d].date))}},this.compare=function(e,t){var n=new Date(e.getFullYear(),e.getMonth(),e.getDate()),i=new Date(t.getFullYear(),t.getMonth(),t.getDate());return n.setFullYear(e.getFullYear()),i.setFullYear(t.getFullYear()),n-i},this.handleKeyDown=function(e){var t=this.activeDate.getDate();if("left"===e)t-=1;else if("up"===e)t-=7;else if("right"===e)t+=1;else if("down"===e)t+=7;else if("pageup"===e||"pagedown"===e){var n=this.activeDate.getMonth()+("pageup"===e?-1:1);this.activeDate.setMonth(n,1),t=Math.min(i(this.activeDate.getFullYear(),this.activeDate.getMonth()),t)}else"home"===e?t=1:"end"===e&&(t=i(this.activeDate.getFullYear(),this.activeDate.getMonth()));this.activeDate.setDate(t)}}]).controller("UibMonthpickerController",["$scope","$element","dateFilter",function(e,t,n){this.step={years:1},this.element=t,this.init=function(e){angular.extend(e,this),e.refreshView()},this._refreshView=function(){for(var t,i=new Array(12),a=this.activeDate.getFullYear(),r=0;12>r;r++)t=new Date(this.activeDate),t.setFullYear(a,r,1),i[r]=angular.extend(this.createDateObject(t,this.formatMonth),{uid:e.uniqueId+"-"+r});e.title=n(this.activeDate,this.formatMonthTitle),e.rows=this.split(i,this.monthColumns),e.yearHeaderColspan=this.monthColumns>3?this.monthColumns-2:1},this.compare=function(e,t){var n=new Date(e.getFullYear(),e.getMonth()),i=new Date(t.getFullYear(),t.getMonth());return n.setFullYear(e.getFullYear()),i.setFullYear(t.getFullYear()),n-i},this.handleKeyDown=function(e){var t=this.activeDate.getMonth();if("left"===e)t-=1;else if("up"===e)t-=this.monthColumns;else if("right"===e)t+=1;else if("down"===e)t+=this.monthColumns;else if("pageup"===e||"pagedown"===e){var n=this.activeDate.getFullYear()+("pageup"===e?-1:1);this.activeDate.setFullYear(n)}else"home"===e?t=0:"end"===e&&(t=11);this.activeDate.setMonth(t)}}]).controller("UibYearpickerController",["$scope","$element","dateFilter",function(e,t){function n(e){return parseInt((e-1)/a,10)*a+1}var i,a;this.element=t,this.yearpickerInit=function(){i=this.yearColumns,a=this.yearRows*i,this.step={years:a}},this._refreshView=function(){for(var t,r=new Array(a),o=0,s=n(this.activeDate.getFullYear());a>o;o++)t=new Date(this.activeDate),t.setFullYear(s+o,0,1),r[o]=angular.extend(this.createDateObject(t,this.formatYear),{uid:e.uniqueId+"-"+o});e.title=[r[0].label,r[a-1].label].join(" - "),e.rows=this.split(r,i),e.columns=i},this.compare=function(e,t){return e.getFullYear()-t.getFullYear()},this.handleKeyDown=function(e){var t=this.activeDate.getFullYear();"left"===e?t-=1:"up"===e?t-=i:"right"===e?t+=1:"down"===e?t+=i:"pageup"===e||"pagedown"===e?t+=("pageup"===e?-1:1)*a:"home"===e?t=n(this.activeDate.getFullYear()):"end"===e&&(t=n(this.activeDate.getFullYear())+a-1),this.activeDate.setFullYear(t)}}]).directive("uibDatepicker",function(){return{templateUrl:function(e,t){return t.templateUrl||"uib/template/datepicker/datepicker.html"},scope:{datepickerOptions:"=?"},require:["uibDatepicker","^ngModel"],restrict:"A",controller:"UibDatepickerController",controllerAs:"datepicker",link:function(e,t,n,i){var a=i[0],r=i[1];a.init(r)}}}).directive("uibDaypicker",function(){return{templateUrl:function(e,t){return t.templateUrl||"uib/template/datepicker/day.html"},require:["^uibDatepicker","uibDaypicker"],restrict:"A",controller:"UibDaypickerController",link:function(e,t,n,i){var a=i[0],r=i[1];r.init(a)}}}).directive("uibMonthpicker",function(){return{templateUrl:function(e,t){return t.templateUrl||"uib/template/datepicker/month.html"},require:["^uibDatepicker","uibMonthpicker"],restrict:"A",controller:"UibMonthpickerController",link:function(e,t,n,i){var a=i[0],r=i[1];r.init(a)}}}).directive("uibYearpicker",function(){return{templateUrl:function(e,t){return t.templateUrl||"uib/template/datepicker/year.html"},require:["^uibDatepicker","uibYearpicker"],restrict:"A",controller:"UibYearpickerController",link:function(e,t,n,i){var a=i[0];angular.extend(a,i[1]),a.yearpickerInit(),a.refreshView()}}}),angular.module("ui.bootstrap.dateparser",[]).service("uibDateParser",["$log","$locale","dateFilter","orderByFilter",function(e,t,n,i){function a(e){var t=[],n=e.split(""),a=e.indexOf("'");if(a>-1){var r=!1;e=e.split("");for(var o=a;o<e.length;o++)r?("'"===e[o]&&(o+1<e.length&&"'"===e[o+1]?(e[o+1]="$",n[o+1]=""):(n[o]="",r=!1)),e[o]="$"):"'"===e[o]&&(e[o]="$",n[o]="",r=!0);e=e.join("")}return angular.forEach(g,function(i){var a=e.indexOf(i.key);if(a>-1){e=e.split(""),n[a]="("+i.regex+")",e[a]="$";for(var r=a+1,o=a+i.key.length;o>r;r++)n[r]="",e[r]="$";e=e.join(""),t.push({index:a,key:i.key,apply:i.apply,matcher:i.regex})}}),{regex:new RegExp("^"+n.join("")+"$"),map:i(t,"index")}}function r(e){for(var t,n,i=[],a=0;a<e.length;)if(angular.isNumber(n)){if("'"===e.charAt(a))(a+1>=e.length||"'"!==e.charAt(a+1))&&(i.push(o(e,n,a)),n=null);else if(a===e.length)for(;n<e.length;)t=s(e,n),i.push(t),n=t.endIdx;a++}else"'"!==e.charAt(a)?(t=s(e,a),i.push(t.parser),a=t.endIdx):(n=a,a++);return i}function o(e,t,n){return function(){return e.substr(t+1,n-t-1)}}function s(e,t){for(var n=e.substr(t),i=0;i<g.length;i++)if(new RegExp("^"+g[i].key).test(n)){var a=g[i];return{endIdx:t+a.key.length,parser:a.formatter}}return{endIdx:t+1,parser:function(){return n.charAt(0)}}}function l(e,t,n){return 1>n?!1:1===t&&n>28?29===n&&(e%4===0&&e%100!==0||e%400===0):3===t||5===t||8===t||10===t?31>n:!0}function u(e){return parseInt(e,10)}function p(e,t){return e&&t?h(e,t):e}function c(e,t){return e&&t?h(e,t,!0):e}function d(e,t){e=e.replace(/:/g,"");var n=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return isNaN(n)?t:n}function f(e,t){return e=new Date(e.getTime()),e.setMinutes(e.getMinutes()+t),e}function h(e,t,n){n=n?-1:1;var i=e.getTimezoneOffset(),a=d(t,i);return f(e,n*(a-i))}var m,g,b=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;this.init=function(){m=t.id,this.parsers={},this.formatters={},g=[{key:"yyyy",regex:"\\d{4}",apply:function(e){this.year=+e},formatter:function(e){var t=new Date;return t.setFullYear(Math.abs(e.getFullYear())),n(t,"yyyy")}},{key:"yy",regex:"\\d{2}",apply:function(e){e=+e,this.year=69>e?e+2e3:e+1900},formatter:function(e){var t=new Date;return t.setFullYear(Math.abs(e.getFullYear())),n(t,"yy")}},{key:"y",regex:"\\d{1,4}",apply:function(e){this.year=+e},formatter:function(e){var t=new Date;return t.setFullYear(Math.abs(e.getFullYear())),n(t,"y")}},{key:"M!",regex:"0?[1-9]|1[0-2]",apply:function(e){this.month=e-1},formatter:function(e){var t=e.getMonth();return/^[0-9]$/.test(t)?n(e,"MM"):n(e,"M")}},{key:"MMMM",regex:t.DATETIME_FORMATS.MONTH.join("|"),apply:function(e){this.month=t.DATETIME_FORMATS.MONTH.indexOf(e)},formatter:function(e){return n(e,"MMMM")}},{key:"MMM",regex:t.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(e){this.month=t.DATETIME_FORMATS.SHORTMONTH.indexOf(e)},formatter:function(e){return n(e,"MMM")}},{key:"MM",regex:"0[1-9]|1[0-2]",apply:function(e){this.month=e-1},formatter:function(e){return n(e,"MM")}},{key:"M",regex:"[1-9]|1[0-2]",apply:function(e){this.month=e-1},formatter:function(e){return n(e,"M")}},{key:"d!",regex:"[0-2]?[0-9]{1}|3[0-1]{1}",apply:function(e){this.date=+e},formatter:function(e){var t=e.getDate();return/^[1-9]$/.test(t)?n(e,"dd"):n(e,"d")}},{key:"dd",regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(e){this.date=+e},formatter:function(e){return n(e,"dd")}},{key:"d",regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(e){this.date=+e},formatter:function(e){return n(e,"d")}},{key:"EEEE",regex:t.DATETIME_FORMATS.DAY.join("|"),formatter:function(e){return n(e,"EEEE")}},{key:"EEE",regex:t.DATETIME_FORMATS.SHORTDAY.join("|"),formatter:function(e){return n(e,"EEE")}},{key:"HH",regex:"(?:0|1)[0-9]|2[0-3]",apply:function(e){this.hours=+e},formatter:function(e){return n(e,"HH")}},{key:"hh",regex:"0[0-9]|1[0-2]",apply:function(e){this.hours=+e},formatter:function(e){return n(e,"hh")}},{key:"H",regex:"1?[0-9]|2[0-3]",apply:function(e){this.hours=+e},formatter:function(e){return n(e,"H")}},{key:"h",regex:"[0-9]|1[0-2]",apply:function(e){this.hours=+e},formatter:function(e){return n(e,"h")}},{key:"mm",regex:"[0-5][0-9]",apply:function(e){this.minutes=+e},formatter:function(e){return n(e,"mm")}},{key:"m",regex:"[0-9]|[1-5][0-9]",apply:function(e){this.minutes=+e},formatter:function(e){return n(e,"m")}},{key:"sss",regex:"[0-9][0-9][0-9]",apply:function(e){this.milliseconds=+e},formatter:function(e){return n(e,"sss")}},{key:"ss",regex:"[0-5][0-9]",apply:function(e){this.seconds=+e},formatter:function(e){return n(e,"ss")}},{key:"s",regex:"[0-9]|[1-5][0-9]",apply:function(e){this.seconds=+e},formatter:function(e){return n(e,"s")}},{key:"a",regex:t.DATETIME_FORMATS.AMPMS.join("|"),apply:function(e){12===this.hours&&(this.hours=0),"PM"===e&&(this.hours+=12)},formatter:function(e){return n(e,"a")}},{key:"Z",regex:"[+-]\\d{4}",apply:function(e){var t=e.match(/([+-])(\d{2})(\d{2})/),n=t[1],i=t[2],a=t[3];this.hours+=u(n+i),this.minutes+=u(n+a)},formatter:function(e){return n(e,"Z")}},{key:"ww",regex:"[0-4][0-9]|5[0-3]",formatter:function(e){return n(e,"ww")}},{key:"w",regex:"[0-9]|[1-4][0-9]|5[0-3]",formatter:function(e){return n(e,"w")}},{key:"GGGG",regex:t.DATETIME_FORMATS.ERANAMES.join("|").replace(/\s/g,"\\s"),formatter:function(e){return n(e,"GGGG")}},{key:"GGG",regex:t.DATETIME_FORMATS.ERAS.join("|"),formatter:function(e){return n(e,"GGG")}},{key:"GG",regex:t.DATETIME_FORMATS.ERAS.join("|"),formatter:function(e){return n(e,"GG")}},{key:"G",regex:t.DATETIME_FORMATS.ERAS.join("|"),formatter:function(e){return n(e,"G")}}]},this.init(),this.filter=function(e,n){if(!angular.isDate(e)||isNaN(e)||!n)return"";n=t.DATETIME_FORMATS[n]||n,t.id!==m&&this.init(),this.formatters[n]||(this.formatters[n]=r(n));var i=this.formatters[n];return i.reduce(function(t,n){return t+n(e)},"")},this.parse=function(n,i,r){if(!angular.isString(n)||!i)return n;i=t.DATETIME_FORMATS[i]||i,i=i.replace(b,"\\$&"),t.id!==m&&this.init(),this.parsers[i]||(this.parsers[i]=a(i,"apply"));var o=this.parsers[i],s=o.regex,u=o.map,p=n.match(s),c=!1;if(p&&p.length){var d,f;angular.isDate(r)&&!isNaN(r.getTime())?d={year:r.getFullYear(),month:r.getMonth(),date:r.getDate(),hours:r.getHours(),minutes:r.getMinutes(),seconds:r.getSeconds(),milliseconds:r.getMilliseconds()}:(r&&e.warn("dateparser:","baseDate is not a valid date"),d={year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0});for(var h=1,g=p.length;g>h;h++){var v=u[h-1];"Z"===v.matcher&&(c=!0),v.apply&&v.apply.call(d,p[h])}var y=c?Date.prototype.setUTCFullYear:Date.prototype.setFullYear,w=c?Date.prototype.setUTCHours:Date.prototype.setHours;return l(d.year,d.month,d.date)&&(!angular.isDate(r)||isNaN(r.getTime())||c?(f=new Date(0),y.call(f,d.year,d.month,d.date),w.call(f,d.hours||0,d.minutes||0,d.seconds||0,d.milliseconds||0)):(f=new Date(r),y.call(f,d.year,d.month,d.date),w.call(f,d.hours,d.minutes,d.seconds,d.milliseconds))),f}},this.toTimezone=p,this.fromTimezone=c,this.timezoneToOffset=d,this.addDateMinutes=f,this.convertTimezoneToLocal=h}]),angular.module("ui.bootstrap.isClass",[]).directive("uibIsClass",["$animate",function(e){var t=/^\s*([\s\S]+?)\s+on\s+([\s\S]+?)\s*$/,n=/^\s*([\s\S]+?)\s+for\s+([\s\S]+?)\s*$/;return{restrict:"A",compile:function(i,a){function r(e,t){l.push(e),u.push({scope:e,element:t}),h.forEach(function(t){o(t,e)}),e.$on("$destroy",s)}function o(t,i){var a=t.match(n),r=i.$eval(a[1]),o=a[2],s=p[t];if(!s){var l=function(t){var n=null;u.some(function(e){var i=e.scope.$eval(d);return i===t?(n=e,!0):void 0}),s.lastActivated!==n&&(s.lastActivated&&e.removeClass(s.lastActivated.element,r),n&&e.addClass(n.element,r),s.lastActivated=n)};p[t]=s={lastActivated:null,scope:i,watchFn:l,compareWithExp:o,watcher:i.$watch(o,l)}}s.watchFn(i.$eval(o))}function s(e){var t=e.targetScope,n=l.indexOf(t);if(l.splice(n,1),u.splice(n,1),l.length){var i=l[0];angular.forEach(p,function(e){e.scope===t&&(e.watcher=i.$watch(e.compareWithExp,e.watchFn),e.scope=i)})}else p={}}var l=[],u=[],p={},c=a.uibIsClass.match(t),d=c[2],f=c[1],h=f.split(",");return r}}}]),angular.module("ui.bootstrap.position",[]).factory("$uibPosition",["$document","$window",function(e,t){var n,i,a={normal:/(auto|scroll)/,hidden:/(auto|scroll|hidden)/},r={auto:/\s?auto?\s?/i,primary:/^(top|bottom|left|right)$/,secondary:/^(top|bottom|left|right|center)$/,vertical:/^(top|bottom)$/},o=/(HTML|BODY)/;return{getRawNode:function(e){return e.nodeName?e:e[0]||e},parseStyle:function(e){return e=parseFloat(e),isFinite(e)?e:0},offsetParent:function(n){function i(e){return"static"===(t.getComputedStyle(e).position||"static")}n=this.getRawNode(n);for(var a=n.offsetParent||e[0].documentElement;a&&a!==e[0].documentElement&&i(a);)a=a.offsetParent;return a||e[0].documentElement},scrollbarWidth:function(a){if(a){if(angular.isUndefined(i)){var r=e.find("body");r.addClass("uib-position-body-scrollbar-measure"),i=t.innerWidth-r[0].clientWidth,i=isFinite(i)?i:0,r.removeClass("uib-position-body-scrollbar-measure")}return i}if(angular.isUndefined(n)){var o=angular.element('<div class="uib-position-scrollbar-measure"></div>');e.find("body").append(o),n=o[0].offsetWidth-o[0].clientWidth,n=isFinite(n)?n:0,o.remove()}return n},scrollbarPadding:function(e){e=this.getRawNode(e);var n=t.getComputedStyle(e),i=this.parseStyle(n.paddingRight),a=this.parseStyle(n.paddingBottom),r=this.scrollParent(e,!1,!0),s=this.scrollbarWidth(o.test(r.tagName));return{scrollbarWidth:s,widthOverflow:r.scrollWidth>r.clientWidth,right:i+s,originalRight:i,heightOverflow:r.scrollHeight>r.clientHeight,bottom:a+s,originalBottom:a}},isScrollable:function(e,n){e=this.getRawNode(e);var i=n?a.hidden:a.normal,r=t.getComputedStyle(e);return i.test(r.overflow+r.overflowY+r.overflowX)},scrollParent:function(n,i,r){n=this.getRawNode(n);var o=i?a.hidden:a.normal,s=e[0].documentElement,l=t.getComputedStyle(n);if(r&&o.test(l.overflow+l.overflowY+l.overflowX))return n;var u="absolute"===l.position,p=n.parentElement||s;if(p===s||"fixed"===l.position)return s;for(;p.parentElement&&p!==s;){var c=t.getComputedStyle(p);if(u&&"static"!==c.position&&(u=!1),!u&&o.test(c.overflow+c.overflowY+c.overflowX))break;p=p.parentElement}return p},position:function(n,i){n=this.getRawNode(n);var a=this.offset(n);if(i){var r=t.getComputedStyle(n);a.top-=this.parseStyle(r.marginTop),a.left-=this.parseStyle(r.marginLeft)}var o=this.offsetParent(n),s={top:0,left:0};return o!==e[0].documentElement&&(s=this.offset(o),s.top+=o.clientTop-o.scrollTop,s.left+=o.clientLeft-o.scrollLeft),{width:Math.round(angular.isNumber(a.width)?a.width:n.offsetWidth),height:Math.round(angular.isNumber(a.height)?a.height:n.offsetHeight),top:Math.round(a.top-s.top),left:Math.round(a.left-s.left)}},offset:function(n){n=this.getRawNode(n);var i=n.getBoundingClientRect();return{width:Math.round(angular.isNumber(i.width)?i.width:n.offsetWidth),height:Math.round(angular.isNumber(i.height)?i.height:n.offsetHeight),top:Math.round(i.top+(t.pageYOffset||e[0].documentElement.scrollTop)),left:Math.round(i.left+(t.pageXOffset||e[0].documentElement.scrollLeft))}},viewportOffset:function(n,i,a){n=this.getRawNode(n),a=a!==!1?!0:!1;var r=n.getBoundingClientRect(),o={top:0,left:0,bottom:0,right:0},s=i?e[0].documentElement:this.scrollParent(n),l=s.getBoundingClientRect();if(o.top=l.top+s.clientTop,o.left=l.left+s.clientLeft,s===e[0].documentElement&&(o.top+=t.pageYOffset,o.left+=t.pageXOffset),o.bottom=o.top+s.clientHeight,o.right=o.left+s.clientWidth,a){var u=t.getComputedStyle(s);o.top+=this.parseStyle(u.paddingTop),o.bottom-=this.parseStyle(u.paddingBottom),o.left+=this.parseStyle(u.paddingLeft),o.right-=this.parseStyle(u.paddingRight)}return{top:Math.round(r.top-o.top),bottom:Math.round(o.bottom-r.bottom),left:Math.round(r.left-o.left),right:Math.round(o.right-r.right)}},parsePlacement:function(e){var t=r.auto.test(e);return t&&(e=e.replace(r.auto,"")),e=e.split("-"),e[0]=e[0]||"top",r.primary.test(e[0])||(e[0]="top"),e[1]=e[1]||"center",r.secondary.test(e[1])||(e[1]="center"),e[2]=t?!0:!1,e},positionElements:function(e,n,i,a){e=this.getRawNode(e),n=this.getRawNode(n);var o=angular.isDefined(n.offsetWidth)?n.offsetWidth:n.prop("offsetWidth"),s=angular.isDefined(n.offsetHeight)?n.offsetHeight:n.prop("offsetHeight");i=this.parsePlacement(i);var l=a?this.offset(e):this.position(e),u={top:0,left:0,placement:""};if(i[2]){var p=this.viewportOffset(e,a),c=t.getComputedStyle(n),d={width:o+Math.round(Math.abs(this.parseStyle(c.marginLeft)+this.parseStyle(c.marginRight))),height:s+Math.round(Math.abs(this.parseStyle(c.marginTop)+this.parseStyle(c.marginBottom)))};if(i[0]="top"===i[0]&&d.height>p.top&&d.height<=p.bottom?"bottom":"bottom"===i[0]&&d.height>p.bottom&&d.height<=p.top?"top":"left"===i[0]&&d.width>p.left&&d.width<=p.right?"right":"right"===i[0]&&d.width>p.right&&d.width<=p.left?"left":i[0],i[1]="top"===i[1]&&d.height-l.height>p.bottom&&d.height-l.height<=p.top?"bottom":"bottom"===i[1]&&d.height-l.height>p.top&&d.height-l.height<=p.bottom?"top":"left"===i[1]&&d.width-l.width>p.right&&d.width-l.width<=p.left?"right":"right"===i[1]&&d.width-l.width>p.left&&d.width-l.width<=p.right?"left":i[1],"center"===i[1])if(r.vertical.test(i[0])){var f=l.width/2-o/2;
p.left+f<0&&d.width-l.width<=p.right?i[1]="left":p.right+f<0&&d.width-l.width<=p.left&&(i[1]="right")}else{var h=l.height/2-d.height/2;p.top+h<0&&d.height-l.height<=p.bottom?i[1]="top":p.bottom+h<0&&d.height-l.height<=p.top&&(i[1]="bottom")}}switch(i[0]){case"top":u.top=l.top-s;break;case"bottom":u.top=l.top+l.height;break;case"left":u.left=l.left-o;break;case"right":u.left=l.left+l.width}switch(i[1]){case"top":u.top=l.top;break;case"bottom":u.top=l.top+l.height-s;break;case"left":u.left=l.left;break;case"right":u.left=l.left+l.width-o;break;case"center":r.vertical.test(i[0])?u.left=l.left+l.width/2-o/2:u.top=l.top+l.height/2-s/2}return u.top=Math.round(u.top),u.left=Math.round(u.left),u.placement="center"===i[1]?i[0]:i[0]+"-"+i[1],u},adjustTop:function(e,t,n,i){return-1!==e.indexOf("top")&&n!==i?{top:t.top-i+"px"}:void 0},positionArrow:function(e,n){e=this.getRawNode(e);var i=e.querySelector(".tooltip-inner, .popover-inner");if(i){var a=angular.element(i).hasClass("tooltip-inner"),o=e.querySelector(a?".tooltip-arrow":".arrow");if(o){var s={top:"",bottom:"",left:"",right:""};if(n=this.parsePlacement(n),"center"===n[1])return void angular.element(o).css(s);var l="border-"+n[0]+"-width",u=t.getComputedStyle(o)[l],p="border-";p+=r.vertical.test(n[0])?n[0]+"-"+n[1]:n[1]+"-"+n[0],p+="-radius";var c=t.getComputedStyle(a?i:e)[p];switch(n[0]){case"top":s.bottom=a?"0":"-"+u;break;case"bottom":s.top=a?"0":"-"+u;break;case"left":s.right=a?"0":"-"+u;break;case"right":s.left=a?"0":"-"+u}s[n[1]]=c,angular.element(o).css(s)}}}}}]),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.position"]).constant("uibDropdownConfig",{appendToOpenClass:"uib-dropdown-open",openClass:"open"}).service("uibDropdownService",["$document","$rootScope",function(e,t){var n=null;this.open=function(t){n||e.on("click",i),n&&n!==t&&(n.isOpen=!1),n=t},this.close=function(t){n===t&&(e.off("click",i),e.off("keydown",this.keybindFilter),n=null)};var i=function(e){if(n&&!(e&&"disabled"===n.getAutoClose()||e&&3===e.which)){var i=n.getToggleElement();if(!(e&&i&&i[0].contains(e.target))){var a=n.getDropdownElement();e&&"outsideClick"===n.getAutoClose()&&a&&a[0].contains(e.target)||(n.focusToggleElement(),n.isOpen=!1,t.$$phase||n.$apply())}}};this.keybindFilter=function(e){if(n){var t=n.getDropdownElement(),a=n.getToggleElement(),r=t&&t[0].contains(e.target),o=a&&a[0].contains(e.target);27===e.which?(e.stopPropagation(),n.focusToggleElement(),i()):n.isKeynavEnabled()&&-1!==[38,40].indexOf(e.which)&&n.isOpen&&(r||o)&&(e.preventDefault(),e.stopPropagation(),n.focusDropdownEntry(e.which))}}}]).controller("UibDropdownController",["$scope","$element","$attrs","$parse","uibDropdownConfig","uibDropdownService","$animate","$uibPosition","$document","$compile","$templateRequest",function(e,t,n,i,a,r,o,s,l,u,p){var c,d,f=this,h=e.$new(),m=a.appendToOpenClass,g=a.openClass,b=angular.noop,v=n.onToggle?i(n.onToggle):angular.noop,y=!1,w=null,D=!1,k=l.find("body");t.addClass("dropdown"),this.init=function(){if(n.isOpen&&(d=i(n.isOpen),b=d.assign,e.$watch(d,function(e){h.isOpen=!!e})),angular.isDefined(n.dropdownAppendTo)){var a=i(n.dropdownAppendTo)(h);a&&(w=angular.element(a))}y=angular.isDefined(n.dropdownAppendToBody),D=angular.isDefined(n.keyboardNav),y&&!w&&(w=k),w&&f.dropdownMenu&&(w.append(f.dropdownMenu),t.on("$destroy",function(){f.dropdownMenu.remove()}))},this.toggle=function(e){return h.isOpen=arguments.length?!!e:!h.isOpen,angular.isFunction(b)&&b(h,h.isOpen),h.isOpen},this.isOpen=function(){return h.isOpen},h.getToggleElement=function(){return f.toggleElement},h.getAutoClose=function(){return n.autoClose||"always"},h.getElement=function(){return t},h.isKeynavEnabled=function(){return D},h.focusDropdownEntry=function(e){var n=f.dropdownMenu?angular.element(f.dropdownMenu).find("a"):t.find("ul").eq(0).find("a");switch(e){case 40:f.selectedOption=angular.isNumber(f.selectedOption)?f.selectedOption===n.length-1?f.selectedOption:f.selectedOption+1:0;break;case 38:f.selectedOption=angular.isNumber(f.selectedOption)?0===f.selectedOption?0:f.selectedOption-1:n.length-1}n[f.selectedOption].focus()},h.getDropdownElement=function(){return f.dropdownMenu},h.focusToggleElement=function(){f.toggleElement&&f.toggleElement[0].focus()},h.$watch("isOpen",function(n,i){if(w&&f.dropdownMenu){var a,d,D,k=s.positionElements(t,f.dropdownMenu,"bottom-left",!0),M=0;if(a={top:k.top+"px",display:n?"block":"none"},d=f.dropdownMenu.hasClass("dropdown-menu-right"),d?(a.left="auto",D=s.scrollbarPadding(w),D.heightOverflow&&D.scrollbarWidth&&(M=D.scrollbarWidth),a.right=window.innerWidth-M-(k.left+t.prop("offsetWidth"))+"px"):(a.left=k.left+"px",a.right="auto"),!y){var $=s.offset(w);a.top=k.top-$.top+"px",d?a.right=window.innerWidth-(k.left-$.left+t.prop("offsetWidth"))+"px":a.left=k.left-$.left+"px"}f.dropdownMenu.css(a)}var T=w?w:t,x=T.hasClass(w?m:g);if(x===!n&&o[n?"addClass":"removeClass"](T,w?m:g).then(function(){angular.isDefined(n)&&n!==i&&v(e,{open:!!n})}),n)f.dropdownMenuTemplateUrl?p(f.dropdownMenuTemplateUrl).then(function(e){c=h.$new(),u(e.trim())(c,function(e){var t=e;f.dropdownMenu.replaceWith(t),f.dropdownMenu=t,l.on("keydown",r.keybindFilter)})}):l.on("keydown",r.keybindFilter),h.focusToggleElement(),r.open(h,t);else{if(r.close(h,t),f.dropdownMenuTemplateUrl){c&&c.$destroy();var O=angular.element('<ul class="dropdown-menu"></ul>');f.dropdownMenu.replaceWith(O),f.dropdownMenu=O}f.selectedOption=null}angular.isFunction(b)&&b(e,n)})}]).directive("uibDropdown",function(){return{controller:"UibDropdownController",link:function(e,t,n,i){i.init()}}}).directive("uibDropdownMenu",function(){return{restrict:"A",require:"?^uibDropdown",link:function(e,t,n,i){if(i&&!angular.isDefined(n.dropdownNested)){t.addClass("dropdown-menu");var a=n.templateUrl;a&&(i.dropdownMenuTemplateUrl=a),i.dropdownMenu||(i.dropdownMenu=t)}}}}).directive("uibDropdownToggle",function(){return{require:"?^uibDropdown",link:function(e,t,n,i){if(i){t.addClass("dropdown-toggle"),i.toggleElement=t;var a=function(a){a.preventDefault(),t.hasClass("disabled")||n.disabled||e.$apply(function(){i.toggle()})};t.bind("click",a),t.attr({"aria-haspopup":!0,"aria-expanded":!1}),e.$watch(i.isOpen,function(e){t.attr("aria-expanded",!!e)}),e.$on("$destroy",function(){t.unbind("click",a)})}}}}),angular.module("ui.bootstrap.tabindex",[]).directive("uibTabindexToggle",function(){return{restrict:"A",link:function(e,t,n){n.$observe("disabled",function(e){n.$set("tabindex",e?-1:null)})}}}),angular.module("ui.bootstrap.tabs",[]).controller("UibTabsetController",["$scope",function(e){function t(e){for(var t=0;t<i.tabs.length;t++)if(i.tabs[t].index===e)return t}var n,i=this;i.tabs=[],i.select=function(e,r){if(!a){var o=t(n),s=i.tabs[o];if(s){if(s.tab.onDeselect({$event:r,$selectedIndex:e}),r&&r.isDefaultPrevented())return;s.tab.active=!1}var l=i.tabs[e];l?(l.tab.onSelect({$event:r}),l.tab.active=!0,i.active=l.index,n=l.index):!l&&angular.isDefined(n)&&(i.active=null,n=null)}},i.addTab=function(e){if(i.tabs.push({tab:e,index:e.index}),i.tabs.sort(function(e,t){return e.index>t.index?1:e.index<t.index?-1:0}),e.index===i.active||!angular.isDefined(i.active)&&1===i.tabs.length){var n=t(e.index);i.select(n)}},i.removeTab=function(e){for(var t,n=0;n<i.tabs.length;n++)if(i.tabs[n].tab===e){t=n;break}if(i.tabs[t].index===i.active){var a=t===i.tabs.length-1?t-1:t+1%i.tabs.length;i.select(a)}i.tabs.splice(t,1)},e.$watch("tabset.active",function(e){angular.isDefined(e)&&e!==n&&i.select(t(e))});var a;e.$on("$destroy",function(){a=!0})}]).directive("uibTabset",function(){return{transclude:!0,replace:!0,scope:{},bindToController:{active:"=?",type:"@"},controller:"UibTabsetController",controllerAs:"tabset",templateUrl:function(e,t){return t.templateUrl||"uib/template/tabs/tabset.html"},link:function(e,t,n){e.vertical=angular.isDefined(n.vertical)?e.$parent.$eval(n.vertical):!1,e.justified=angular.isDefined(n.justified)?e.$parent.$eval(n.justified):!1}}}).directive("uibTab",["$parse",function(e){return{require:"^uibTabset",replace:!0,templateUrl:function(e,t){return t.templateUrl||"uib/template/tabs/tab.html"},transclude:!0,scope:{heading:"@",index:"=?",classes:"@?",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},controllerAs:"tab",link:function(t,n,i,a,r){t.disabled=!1,i.disable&&t.$parent.$watch(e(i.disable),function(e){t.disabled=!!e}),angular.isUndefined(i.index)&&(t.index=a.tabs&&a.tabs.length?Math.max.apply(null,a.tabs.map(function(e){return e.index}))+1:0),angular.isUndefined(i.classes)&&(t.classes=""),t.select=function(e){if(!t.disabled){for(var n,i=0;i<a.tabs.length;i++)if(a.tabs[i].tab===t){n=i;break}a.select(n,e)}},a.addTab(t),t.$on("$destroy",function(){a.removeTab(t)}),t.$transcludeFn=r}}}]).directive("uibTabHeadingTransclude",function(){return{restrict:"A",require:"^uibTab",link:function(e,t){e.$watch("headingElement",function(e){e&&(t.html(""),t.append(e))})}}}).directive("uibTabContentTransclude",function(){function e(e){return e.tagName&&(e.hasAttribute("uib-tab-heading")||e.hasAttribute("data-uib-tab-heading")||e.hasAttribute("x-uib-tab-heading")||"uib-tab-heading"===e.tagName.toLowerCase()||"data-uib-tab-heading"===e.tagName.toLowerCase()||"x-uib-tab-heading"===e.tagName.toLowerCase()||"uib:tab-heading"===e.tagName.toLowerCase())}return{restrict:"A",require:"^uibTabset",link:function(t,n,i){var a=t.$eval(i.uibTabContentTransclude).tab;a.$transcludeFn(a.$parent,function(t){angular.forEach(t,function(t){e(t)?a.headingElement=t:n.append(t)})})}}}),angular.module("uib/template/datepickerPopup/popup.html",[]).run(["$templateCache",function(e){e.put("uib/template/datepickerPopup/popup.html",'<ul role="presentation" class="uib-datepicker-popup dropdown-menu uib-position-measure" dropdown-nested ng-if="isOpen" ng-keydown="keydown($event)" ng-click="$event.stopPropagation()">\n <li ng-transclude></li>\n <li ng-if="showButtonBar" class="uib-button-bar">\n <span class="btn-group pull-left">\n <button type="button" class="btn btn-sm btn-info uib-datepicker-current" ng-click="select(\'today\', $event)" ng-disabled="isDisabled(\'today\')">{{ getText(\'current\') }}</button>\n <button type="button" class="btn btn-sm btn-danger uib-clear" ng-click="select(null, $event)">{{ getText(\'clear\') }}</button>\n </span>\n <button type="button" class="btn btn-sm btn-success pull-right uib-close" ng-click="close($event)">{{ getText(\'close\') }}</button>\n </li>\n</ul>\n')}]),angular.module("uib/template/datepicker/datepicker.html",[]).run(["$templateCache",function(e){e.put("uib/template/datepicker/datepicker.html",'<div ng-switch="datepickerMode">\n <div uib-daypicker ng-switch-when="day" tabindex="0" class="uib-daypicker"></div>\n <div uib-monthpicker ng-switch-when="month" tabindex="0" class="uib-monthpicker"></div>\n <div uib-yearpicker ng-switch-when="year" tabindex="0" class="uib-yearpicker"></div>\n</div>\n')}]),angular.module("uib/template/datepicker/day.html",[]).run(["$templateCache",function(e){e.put("uib/template/datepicker/day.html",'<table role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left uib-left" ng-click="move(-1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-left"></i><span class="sr-only">previous</span></button></th>\n <th colspan="{{::5 + showWeeks}}"><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm uib-title" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right uib-right" ng-click="move(1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-right"></i><span class="sr-only">next</span></button></th>\n </tr>\n <tr>\n <th ng-if="showWeeks" class="text-center"></th>\n <th ng-repeat="label in ::labels track by $index" class="text-center"><small aria-label="{{::label.full}}">{{::label.abbr}}</small></th>\n </tr>\n </thead>\n <tbody>\n <tr class="uib-weeks" ng-repeat="row in rows track by $index" role="row">\n <td ng-if="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n <td ng-repeat="dt in row" class="uib-day text-center" role="gridcell"\n id="{{::dt.uid}}"\n ng-class="::dt.customClass">\n <button type="button" class="btn btn-default btn-sm"\n uib-is-class="\n \'btn-info\' for selectedDt,\n \'active\' for activeDt\n on dt"\n ng-click="select(dt.date)"\n ng-disabled="::dt.disabled"\n tabindex="-1"><span ng-class="::{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{::dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/datepicker/month.html",[]).run(["$templateCache",function(e){e.put("uib/template/datepicker/month.html",'<table role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left uib-left" ng-click="move(-1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-left"></i><span class="sr-only">previous</span></button></th>\n <th colspan="{{::yearHeaderColspan}}"><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm uib-title" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right uib-right" ng-click="move(1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-right"></i><span class="sr-only">next</span></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr class="uib-months" ng-repeat="row in rows track by $index" role="row">\n <td ng-repeat="dt in row" class="uib-month text-center" role="gridcell"\n id="{{::dt.uid}}"\n ng-class="::dt.customClass">\n <button type="button" class="btn btn-default"\n uib-is-class="\n \'btn-info\' for selectedDt,\n \'active\' for activeDt\n on dt"\n ng-click="select(dt.date)"\n ng-disabled="::dt.disabled"\n tabindex="-1"><span ng-class="::{\'text-info\': dt.current}">{{::dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/datepicker/year.html",[]).run(["$templateCache",function(e){e.put("uib/template/datepicker/year.html",'<table role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left uib-left" ng-click="move(-1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-left"></i><span class="sr-only">previous</span></button></th>\n <th colspan="{{::columns - 2}}"><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm uib-title" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right uib-right" ng-click="move(1)" tabindex="-1"><i aria-hidden="true" class="glyphicon glyphicon-chevron-right"></i><span class="sr-only">next</span></button></th>\n </tr>\n </thead>\n <tbody>\n <tr class="uib-years" ng-repeat="row in rows track by $index" role="row">\n <td ng-repeat="dt in row" class="uib-year text-center" role="gridcell"\n id="{{::dt.uid}}"\n ng-class="::dt.customClass">\n <button type="button" class="btn btn-default"\n uib-is-class="\n \'btn-info\' for selectedDt,\n \'active\' for activeDt\n on dt"\n ng-click="select(dt.date)"\n ng-disabled="::dt.disabled"\n tabindex="-1"><span ng-class="::{\'text-info\': dt.current}">{{::dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/tabs/tab.html",[]).run(["$templateCache",function(e){e.put("uib/template/tabs/tab.html",'<li ng-class="[{active: active, disabled: disabled}, classes]" class="uib-tab nav-item">\n <a href ng-click="select($event)" class="nav-link" uib-tab-heading-transclude>{{heading}}</a>\n</li>\n')}]),angular.module("uib/template/tabs/tabset.html",[]).run(["$templateCache",function(e){e.put("uib/template/tabs/tabset.html",'<div>\n <ul class="nav nav-{{tabset.type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n <div class="tab-content">\n <div class="tab-pane"\n ng-repeat="tab in tabset.tabs"\n ng-class="{active: tabset.active === tab.index}"\n uib-tab-content-transclude="tab">\n </div>\n </div>\n</div>\n')}]),angular.module("ui.bootstrap.datepickerPopup").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerpopupCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-datepicker-popup.dropdown-menu{display:block;float:none;margin:0;}.uib-button-bar{padding:10px 9px 2px;}</style>'),angular.$$uibDatepickerpopupCss=!0}),angular.module("ui.bootstrap.datepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-datepicker .uib-title{width:100%;}.uib-day button,.uib-month button,.uib-year button{min-width:100%;}.uib-left,.uib-right{width:100%}</style>'),angular.$$uibDatepickerCss=!0}),angular.module("ui.bootstrap.position").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibPositionCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-position-measure{display:block !important;visibility:hidden !important;position:absolute !important;top:-9999px !important;left:-9999px !important;}.uib-position-scrollbar-measure{position:absolute !important;top:-9999px !important;width:50px !important;height:50px !important;overflow:scroll !important;}.uib-position-body-scrollbar-measure{overflow:scroll !important;}</style>'),angular.$$uibPositionCss=!0});
/* jshint ignore:end */ | 12,716.75 | 32,290 | 0.703029 |
9ad43f7c3c1a81db45f8d79cf5e7dd34a49e522f | 1,190 | css | CSS | styles/blog-post.css | sean-siddells/sean-siddells.github.io | d71d3311f30a5411bfa4a86d7fd8b130730e1da1 | [
"MIT"
] | null | null | null | styles/blog-post.css | sean-siddells/sean-siddells.github.io | d71d3311f30a5411bfa4a86d7fd8b130730e1da1 | [
"MIT"
] | null | null | null | styles/blog-post.css | sean-siddells/sean-siddells.github.io | d71d3311f30a5411bfa4a86d7fd8b130730e1da1 | [
"MIT"
] | null | null | null | /* h1 {
font-size: 80px;
font-family: "Press Start 2P", monospace;
text-align: center;
color: rgba(102, 173, 255, 0.808);
font-style: italic;
} */
h2 {
font-size: 200%;
font-style: italic;
}
.pink-text {
color: rgb(255, 155, 252);
}
body {
background: #afe2eb69;
text-align: left;
font-family: "Padauk", monospace;
font-size: 20px;
}
.banner {
border: 0px solid darkslateblue;
width: 100%;
height: 300px;
margin: auto;
}
img {
width: 100%;
height: 100%;
object-fit: cover;
}
.list {
width: 25%;
height: 400px;
border: 5px solid darkblue;
margin:auto;
}
ul {
list-style:inside;
text-align: left;
}
#subheading-color {
color: rgb(240, 105, 105)
}
.blog-title {
margin: 100px;
text-align: center;
}
.paragraph-content {
margin: 5% 15%;
border: 5px solid rgb(255, 150, 150);
padding: 50px;
}
.relative {
position: relative;
right: 50px;
}
.absolute {
position: absolute;
right: 50px;
}
.fixed {
position: fixed;
bottom: 0px;
left:0px;
margin: 0px
}
| 15.866667 | 46 | 0.537815 |
bcc90a2fdf7a8ac2034716cb72d8f695ed8adabb | 1,060 | js | JavaScript | src/components/account/account.js | AAlsop12/AACredit | 03cdaafc009ecc106cac6df17b2e7dbc9ae348e2 | [
"MIT"
] | null | null | null | src/components/account/account.js | AAlsop12/AACredit | 03cdaafc009ecc106cac6df17b2e7dbc9ae348e2 | [
"MIT"
] | null | null | null | src/components/account/account.js | AAlsop12/AACredit | 03cdaafc009ecc106cac6df17b2e7dbc9ae348e2 | [
"MIT"
] | null | null | null | import React, { Component } from 'react';
import { connect } from 'react-redux';
import * as actions from '../../actions';
class Account extends Component {
componentDidMount() {
const navbarLinks = [
{
_id: 0,
title: 'Credit Card',
active: true,
path: '/card',
icon: <i className="fas fa-credit-card"></i>
},
{
_id: 1,
title: 'Term Loan',
active: false,
path: './loan',
icon: <i className="fas fa-dollar-sign"></i>
},
]
this.props.setNavbarLinks(navbarLinks);
}
render() {
return (
<div className='allTabs'>
</div>
)
}
}
function mapStateToProps(state) {
const { navbarLinks } = state.headerNavbar;
return { navbarLinks }
}
Account = connect(mapStateToProps, actions)(Account);
export default Account; | 17.666667 | 60 | 0.457547 |
b2ec6ef197e2fb9ff51a3b958346b6692ead91be | 1,018 | py | Python | donatello/utils.py | adrianchifor/donatello | 5a384b3203965b16324e9d322e83a8f1f1b27fd1 | [
"Apache-2.0"
] | 7 | 2018-12-01T10:41:16.000Z | 2021-04-08T19:04:46.000Z | donatello/utils.py | adrianchifor/donatello | 5a384b3203965b16324e9d322e83a8f1f1b27fd1 | [
"Apache-2.0"
] | 4 | 2018-12-01T15:31:58.000Z | 2018-12-01T23:59:52.000Z | donatello/utils.py | adrianchifor/donatello | 5a384b3203965b16324e9d322e83a8f1f1b27fd1 | [
"Apache-2.0"
] | 2 | 2018-12-01T10:41:29.000Z | 2018-12-02T15:56:30.000Z | import http.client
def getFunctionPublicIP():
conn = http.client.HTTPSConnection('api.ipify.org', 443)
conn.request('GET', '/?format=json')
ip = conn.getresponse().read()
print(ip)
conn.close()
return str(ip)
def non_zero_balance(balance):
"""
Return the balance with zero-value coins removed
"""
non_zero_balance = {}
for coin, amount in balance.items():
if amount > 0:
non_zero_balance[coin] = amount
return non_zero_balance
def supported_coins_balance(balance, tickers):
"""
Return the balance with non-supported coins removed
"""
supported_coins_balance = {}
for coin in balance.keys():
if coin != "BTC":
if f"{coin}/BTC" in tickers:
supported_coins_balance[coin] = balance[coin]
else:
try:
supported_coins_balance["BTC"] = balance[coin]
except KeyError:
print("BTC not in balance")
return supported_coins_balance
| 24.829268 | 62 | 0.609037 |
9c7fd5e8c0ccfa43129f18b0610571a2dec36a55 | 450 | js | JavaScript | src/Predict/JobCard.test.js | vanvalenlab/kiosk-frontend | db6ac731720fe0b7a2e9007ca9aa9745b0264287 | [
"Apache-2.0"
] | 1 | 2022-02-12T12:06:47.000Z | 2022-02-12T12:06:47.000Z | src/Predict/JobCard.test.js | vanvalenlab/kiosk-frontend | db6ac731720fe0b7a2e9007ca9aa9745b0264287 | [
"Apache-2.0"
] | 55 | 2018-10-15T16:44:28.000Z | 2022-02-14T19:00:41.000Z | src/Predict/JobCard.test.js | vanvalenlab/kiosk-frontend | db6ac731720fe0b7a2e9007ca9aa9745b0264287 | [
"Apache-2.0"
] | 1 | 2019-06-24T21:09:14.000Z | 2019-06-24T21:09:14.000Z | import React from 'react';
import { render } from '@testing-library/react';
import '@testing-library/jest-dom';
import JobCard from './JobCard';
describe('<JobCard/> component tests', () => {
it('<JobCard/> renders with default values', () => {
const expectedName = 'ModelName';
const { getByText } = render(<JobCard name={'ModelName'} />);
const element = getByText(expectedName);
expect(element).toBeInTheDocument();
});
});
| 28.125 | 65 | 0.66 |
7f5b23b4d0759581973e4de767108f2490a08e1b | 33,996 | html | HTML | processing_libraries/minim/doc/ddf/minim/Controller.html | drakh/enterin_wodies | d352ee9f4444999c7fd169db341fbe4d7882cd7b | [
"CC0-1.0"
] | 2 | 2017-06-01T22:24:17.000Z | 2019-08-04T10:44:26.000Z | libraries/minim/doc/ddf/minim/Controller.html | nkmrh/BOX | 425914f2afe8e1cb04114288f338b0278cf563ec | [
"MIT"
] | null | null | null | libraries/minim/doc/ddf/minim/Controller.html | nkmrh/BOX | 425914f2afe8e1cb04114288f338b0278cf563ec | [
"MIT"
] | null | null | null | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_20) on Sun Oct 04 16:38:51 CDT 2009 -->
<TITLE>
Controller
</TITLE>
<META NAME="keywords" CONTENT="ddf.minim.Controller class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Controller";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Controller.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../ddf/minim/BufferedAudio.html" title="interface in ddf.minim"><B>PREV CLASS</B></A>
<A HREF="../../ddf/minim/Effectable.html" title="interface in ddf.minim"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?ddf/minim/Controller.html" target="_top"><B>FRAMES</B></A>
<A HREF="Controller.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
ddf.minim</FONT>
<BR>
Class Controller</H2>
<PRE>
java.lang.Object
<IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>ddf.minim.Controller</B>
</PRE>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../ddf/minim/AudioSnippet.html" title="class in ddf.minim">AudioSnippet</A>, <A HREF="../../ddf/minim/AudioSource.html" title="class in ddf.minim">AudioSource</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>Controller</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
<code>Controller</code> is the base class of all Minim classes that deal
with audio I/O. It provides control over the underlying <code>DataLine</code>,
which is a low-level JavaSound class that talks directly to the audio
hardware of the computer. This means that you can make changes to the audio
without having to manipulate the samples directly. The downside to this is
that when outputting sound to the system (such as with an
<code>AudioOutput</code>), these changes will not be present in the
samples made available to your program.
<p>
The <A HREF="../../ddf/minim/Controller.html#volume()"><CODE>volume()</CODE></A>, <A HREF="../../ddf/minim/Controller.html#gain()"><CODE>gain()</CODE></A>, <A HREF="../../ddf/minim/Controller.html#pan()"><CODE>pan()</CODE></A>, and
<A HREF="../../ddf/minim/Controller.html#balance()"><CODE>balance()</CODE></A> methods return objects of type <code>FloatControl</code>,
which is a class defined by the JavaSound API. A <code>FloatControl</code>
represents a control of a line that holds a <code>float</code> value. This
value has an associated maximum and minimum value (such as between -1 and 1
for pan), and also a unit type (such as dB for gain). You should refer to the
<a
href="http://java.sun.com/j2se/1.5.0/docs/api/javax/sound/sampled/FloatControl.html">FloatControl
Javadoc</a> for the full description of the methods available.
<p>
Not all controls are available on all objects. Before calling the methods
mentioned above, you should call
<A HREF="../../ddf/minim/Controller.html#hasControl(javax.sound.sampled.Control.Type)"><CODE>hasControl(javax.sound.sampled.Control.Type)</CODE></A> with the control type
you want to use. Alternatively, you can use the <code>get</code> and
<code>set</code> methods, which will simply do nothing if the control you
are trying to manipulate is not available.
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>Damien Di Fede</DD>
</DL>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static javax.sound.sampled.FloatControl.Type</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#BALANCE">BALANCE</A></B></CODE>
<BR>
The balance control type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static javax.sound.sampled.FloatControl.Type</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#GAIN">GAIN</A></B></CODE>
<BR>
The gain control type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static javax.sound.sampled.BooleanControl.Type</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#MUTE">MUTE</A></B></CODE>
<BR>
The mute control type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static javax.sound.sampled.FloatControl.Type</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#PAN">PAN</A></B></CODE>
<BR>
The pan control type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static javax.sound.sampled.FloatControl.Type</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#SAMPLE_RATE">SAMPLE_RATE</A></B></CODE>
<BR>
The sample rate control type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static javax.sound.sampled.FloatControl.Type</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#VOLUME">VOLUME</A></B></CODE>
<BR>
The volume control type.</TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#Controller(javax.sound.sampled.Control[])">Controller</A></B>(javax.sound.sampled.Control[] cntrls)</CODE>
<BR>
Constructs a <code>Controller</code> for the given <code>Line</code>.</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> javax.sound.sampled.FloatControl</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#balance()">balance</A></B>()</CODE>
<BR>
Gets the balance control for the <code>Line</code>, if it exists.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> javax.sound.sampled.FloatControl</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#gain()">gain</A></B>()</CODE>
<BR>
Gets the gain control for the <code>Line</code>, if it exists.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> float</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#getBalance()">getBalance</A></B>()</CODE>
<BR>
Returns the current balance of the line.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> javax.sound.sampled.Control</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#getControl(javax.sound.sampled.Control.Type)">getControl</A></B>(javax.sound.sampled.Control.Type type)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> javax.sound.sampled.Control[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#getControls()">getControls</A></B>()</CODE>
<BR>
Returns an array of all the available <code>Control</code>s for the
<code>DataLine</code> being controlled.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> float</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#getGain()">getGain</A></B>()</CODE>
<BR>
Returns the current gain.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> float</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#getPan()">getPan</A></B>()</CODE>
<BR>
Returns the current pan value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> float</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#getVolume()">getVolume</A></B>()</CODE>
<BR>
Returns the current volume.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#hasControl(javax.sound.sampled.Control.Type)">hasControl</A></B>(javax.sound.sampled.Control.Type type)</CODE>
<BR>
Returns whether or not the particular control type is supported by the Line
being controlled.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#isMuted()">isMuted</A></B>()</CODE>
<BR>
Returns true if the line is muted.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#mute()">mute</A></B>()</CODE>
<BR>
Mutes the line.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> javax.sound.sampled.FloatControl</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#pan()">pan</A></B>()</CODE>
<BR>
Gets the pan control for the <code>Line</code>, if it exists.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#printControls()">printControls</A></B>()</CODE>
<BR>
Prints the available controls and their ranges to the console.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#setBalance(float)">setBalance</A></B>(float v)</CODE>
<BR>
Sets the balance of the line to <code>v</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#setGain(float)">setGain</A></B>(float v)</CODE>
<BR>
Sets the gain to <code>v</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#setPan(float)">setPan</A></B>(float v)</CODE>
<BR>
Sets the pan of the line to <code>v</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#setVolume(float)">setVolume</A></B>(float v)</CODE>
<BR>
Sets the volume to <code>v</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#shiftBalance(float, float, int)">shiftBalance</A></B>(float from,
float to,
int millis)</CODE>
<BR>
Shifts the value of the balance from <code>from</code> to <code>to</code>
in the space of <code>millis</code> milliseconds.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#shiftGain(float, float, int)">shiftGain</A></B>(float from,
float to,
int millis)</CODE>
<BR>
Shifts the value of the gain from <code>from</code> to <code>to</code>
in the space of <code>millis</code></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#shiftPan(float, float, int)">shiftPan</A></B>(float from,
float to,
int millis)</CODE>
<BR>
Shifts the value of the pan from <code>from</code> to <code>to</code>
in the space of <code>millis</code> milliseconds.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#shiftVolume(float, float, int)">shiftVolume</A></B>(float from,
float to,
int millis)</CODE>
<BR>
Shifts the value of the volume from <code>from</code> to <code>to</code>
in the space of <code>millis</code> milliseconds.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#unmute()">unmute</A></B>()</CODE>
<BR>
Unmutes the line.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> javax.sound.sampled.FloatControl</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../ddf/minim/Controller.html#volume()">volume</A></B>()</CODE>
<BR>
Gets the volume control for the <code>Line</code>, if it exists.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="VOLUME"><!-- --></A><H3>
VOLUME</H3>
<PRE>
public static javax.sound.sampled.FloatControl.Type <B>VOLUME</B></PRE>
<DL>
<DD>The volume control type.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="GAIN"><!-- --></A><H3>
GAIN</H3>
<PRE>
public static javax.sound.sampled.FloatControl.Type <B>GAIN</B></PRE>
<DL>
<DD>The gain control type.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="BALANCE"><!-- --></A><H3>
BALANCE</H3>
<PRE>
public static javax.sound.sampled.FloatControl.Type <B>BALANCE</B></PRE>
<DL>
<DD>The balance control type.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="PAN"><!-- --></A><H3>
PAN</H3>
<PRE>
public static javax.sound.sampled.FloatControl.Type <B>PAN</B></PRE>
<DL>
<DD>The pan control type.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="SAMPLE_RATE"><!-- --></A><H3>
SAMPLE_RATE</H3>
<PRE>
public static javax.sound.sampled.FloatControl.Type <B>SAMPLE_RATE</B></PRE>
<DL>
<DD>The sample rate control type.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="MUTE"><!-- --></A><H3>
MUTE</H3>
<PRE>
public static javax.sound.sampled.BooleanControl.Type <B>MUTE</B></PRE>
<DL>
<DD>The mute control type.
<P>
<DL>
</DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="Controller(javax.sound.sampled.Control[])"><!-- --></A><H3>
Controller</H3>
<PRE>
public <B>Controller</B>(javax.sound.sampled.Control[] cntrls)</PRE>
<DL>
<DD>Constructs a <code>Controller</code> for the given <code>Line</code>.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>cntrls</CODE> - an array of Controls that this Controller will manipulate</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="printControls()"><!-- --></A><H3>
printControls</H3>
<PRE>
public void <B>printControls</B>()</PRE>
<DL>
<DD>Prints the available controls and their ranges to the console. Not all
lines have all of the controls available on them so this is a way to find
out what is available.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="hasControl(javax.sound.sampled.Control.Type)"><!-- --></A><H3>
hasControl</H3>
<PRE>
public boolean <B>hasControl</B>(javax.sound.sampled.Control.Type type)</PRE>
<DL>
<DD>Returns whether or not the particular control type is supported by the Line
being controlled.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>true if the control is available<DT><B>See Also:</B><DD><A HREF="../../ddf/minim/Controller.html#VOLUME"><CODE>VOLUME</CODE></A>,
<A HREF="../../ddf/minim/Controller.html#GAIN"><CODE>GAIN</CODE></A>,
<A HREF="../../ddf/minim/Controller.html#BALANCE"><CODE>BALANCE</CODE></A>,
<A HREF="../../ddf/minim/Controller.html#PAN"><CODE>PAN</CODE></A>,
<A HREF="../../ddf/minim/Controller.html#SAMPLE_RATE"><CODE>SAMPLE_RATE</CODE></A>,
<A HREF="../../ddf/minim/Controller.html#MUTE"><CODE>MUTE</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getControls()"><!-- --></A><H3>
getControls</H3>
<PRE>
public javax.sound.sampled.Control[] <B>getControls</B>()</PRE>
<DL>
<DD>Returns an array of all the available <code>Control</code>s for the
<code>DataLine</code> being controlled. You can use this if you want to
access the controls directly, rather than using the convenience methods
provided by this class.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>an array of all available controls</DL>
</DD>
</DL>
<HR>
<A NAME="getControl(javax.sound.sampled.Control.Type)"><!-- --></A><H3>
getControl</H3>
<PRE>
public javax.sound.sampled.Control <B>getControl</B>(javax.sound.sampled.Control.Type type)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="volume()"><!-- --></A><H3>
volume</H3>
<PRE>
public javax.sound.sampled.FloatControl <B>volume</B>()</PRE>
<DL>
<DD>Gets the volume control for the <code>Line</code>, if it exists. You
should check for the availability of a volume control by using
<A HREF="../../ddf/minim/Controller.html#hasControl(javax.sound.sampled.Control.Type)"><CODE>hasControl(javax.sound.sampled.Control.Type)</CODE></A> before calling this
method.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the volume control</DL>
</DD>
</DL>
<HR>
<A NAME="gain()"><!-- --></A><H3>
gain</H3>
<PRE>
public javax.sound.sampled.FloatControl <B>gain</B>()</PRE>
<DL>
<DD>Gets the gain control for the <code>Line</code>, if it exists. You
should check for the availability of a gain control by using
<A HREF="../../ddf/minim/Controller.html#hasControl(javax.sound.sampled.Control.Type)"><CODE>hasControl(javax.sound.sampled.Control.Type)</CODE></A> before calling this
method.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the gain control</DL>
</DD>
</DL>
<HR>
<A NAME="balance()"><!-- --></A><H3>
balance</H3>
<PRE>
public javax.sound.sampled.FloatControl <B>balance</B>()</PRE>
<DL>
<DD>Gets the balance control for the <code>Line</code>, if it exists. You
should check for the availability of a balance control by using
<A HREF="../../ddf/minim/Controller.html#hasControl(javax.sound.sampled.Control.Type)"><CODE>hasControl(javax.sound.sampled.Control.Type)</CODE></A> before calling this
method.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the balance control</DL>
</DD>
</DL>
<HR>
<A NAME="pan()"><!-- --></A><H3>
pan</H3>
<PRE>
public javax.sound.sampled.FloatControl <B>pan</B>()</PRE>
<DL>
<DD>Gets the pan control for the <code>Line</code>, if it exists. You should
check for the availability of a pan control by using
<A HREF="../../ddf/minim/Controller.html#hasControl(javax.sound.sampled.Control.Type)"><CODE>hasControl(javax.sound.sampled.Control.Type)</CODE></A> before calling this
method.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the pan control</DL>
</DD>
</DL>
<HR>
<A NAME="mute()"><!-- --></A><H3>
mute</H3>
<PRE>
public void <B>mute</B>()</PRE>
<DL>
<DD>Mutes the line.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="unmute()"><!-- --></A><H3>
unmute</H3>
<PRE>
public void <B>unmute</B>()</PRE>
<DL>
<DD>Unmutes the line.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="isMuted()"><!-- --></A><H3>
isMuted</H3>
<PRE>
public boolean <B>isMuted</B>()</PRE>
<DL>
<DD>Returns true if the line is muted.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current mute state</DL>
</DD>
</DL>
<HR>
<A NAME="getVolume()"><!-- --></A><H3>
getVolume</H3>
<PRE>
public float <B>getVolume</B>()</PRE>
<DL>
<DD>Returns the current volume. If a volume control is not available, this
returns 0. Note that the volume is not the same thing as the
<code>level()</code> of an AudioBuffer!
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current volume or zero if a volume control is unavailable</DL>
</DD>
</DL>
<HR>
<A NAME="setVolume(float)"><!-- --></A><H3>
setVolume</H3>
<PRE>
public void <B>setVolume</B>(float v)</PRE>
<DL>
<DD>Sets the volume to <code>v</code>. If a volume control is not available,
this does nothing.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>v</CODE> - the new value for the volume</DL>
</DD>
</DL>
<HR>
<A NAME="shiftVolume(float, float, int)"><!-- --></A><H3>
shiftVolume</H3>
<PRE>
public void <B>shiftVolume</B>(float from,
float to,
int millis)</PRE>
<DL>
<DD>Shifts the value of the volume from <code>from</code> to <code>to</code>
in the space of <code>millis</code> milliseconds.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>from</CODE> - the starting volume<DD><CODE>to</CODE> - the ending volume<DD><CODE>millis</CODE> - the length of the transition</DL>
</DD>
</DL>
<HR>
<A NAME="getGain()"><!-- --></A><H3>
getGain</H3>
<PRE>
public float <B>getGain</B>()</PRE>
<DL>
<DD>Returns the current gain. If a gain control is not available, this returns
0. Note that the gain is not the same thing as the <code>level()</code>
of an AudioBuffer!
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current gain or zero if a gain control is unavailable</DL>
</DD>
</DL>
<HR>
<A NAME="setGain(float)"><!-- --></A><H3>
setGain</H3>
<PRE>
public void <B>setGain</B>(float v)</PRE>
<DL>
<DD>Sets the gain to <code>v</code>. If a gain control is not available,
this does nothing.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>v</CODE> - the new value for the gain</DL>
</DD>
</DL>
<HR>
<A NAME="shiftGain(float, float, int)"><!-- --></A><H3>
shiftGain</H3>
<PRE>
public void <B>shiftGain</B>(float from,
float to,
int millis)</PRE>
<DL>
<DD>Shifts the value of the gain from <code>from</code> to <code>to</code>
in the space of <code>millis</code>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>from</CODE> - the starting volume<DD><CODE>to</CODE> - the ending volume<DD><CODE>millis</CODE> - the length of the transition</DL>
</DD>
</DL>
<HR>
<A NAME="getBalance()"><!-- --></A><H3>
getBalance</H3>
<PRE>
public float <B>getBalance</B>()</PRE>
<DL>
<DD>Returns the current balance of the line. This will be in the range [-1, 1].
If a balance control is not available, this will do nothing.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current balance or zero if a balance control is unavailable</DL>
</DD>
</DL>
<HR>
<A NAME="setBalance(float)"><!-- --></A><H3>
setBalance</H3>
<PRE>
public void <B>setBalance</B>(float v)</PRE>
<DL>
<DD>Sets the balance of the line to <code>v</code>. The provided value
should be in the range [-1, 1]. If a balance control is not available, this
will do nothing.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>v</CODE> - the new value for the balance</DL>
</DD>
</DL>
<HR>
<A NAME="shiftBalance(float, float, int)"><!-- --></A><H3>
shiftBalance</H3>
<PRE>
public void <B>shiftBalance</B>(float from,
float to,
int millis)</PRE>
<DL>
<DD>Shifts the value of the balance from <code>from</code> to <code>to</code>
in the space of <code>millis</code> milliseconds.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>from</CODE> - the starting volume<DD><CODE>to</CODE> - the ending volume<DD><CODE>millis</CODE> - the length of the transition</DL>
</DD>
</DL>
<HR>
<A NAME="getPan()"><!-- --></A><H3>
getPan</H3>
<PRE>
public float <B>getPan</B>()</PRE>
<DL>
<DD>Returns the current pan value. This will be in the range [-1, 1]. If the
pan control is not available
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current pan or zero if a pan control is unavailable</DL>
</DD>
</DL>
<HR>
<A NAME="setPan(float)"><!-- --></A><H3>
setPan</H3>
<PRE>
public void <B>setPan</B>(float v)</PRE>
<DL>
<DD>Sets the pan of the line to <code>v</code>. The provided value should be
in the range [-1, 1].
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>v</CODE> - the new value for the pan</DL>
</DD>
</DL>
<HR>
<A NAME="shiftPan(float, float, int)"><!-- --></A><H3>
shiftPan</H3>
<PRE>
public void <B>shiftPan</B>(float from,
float to,
int millis)</PRE>
<DL>
<DD>Shifts the value of the pan from <code>from</code> to <code>to</code>
in the space of <code>millis</code> milliseconds.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>from</CODE> - the starting pan<DD><CODE>to</CODE> - the ending pan<DD><CODE>millis</CODE> - the length of the transition</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Controller.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../ddf/minim/BufferedAudio.html" title="interface in ddf.minim"><B>PREV CLASS</B></A>
<A HREF="../../ddf/minim/Effectable.html" title="interface in ddf.minim"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?ddf/minim/Controller.html" target="_top"><B>FRAMES</B></A>
<A HREF="Controller.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
| 35.4125 | 232 | 0.647635 |
41405ec0a7164cd9dddec12b252ca2d6c7880cbf | 7,779 | h | C | emulator/src/emu/debug/debugcmd.h | rjw57/tiw-computer | 5ef1c79893165b8622d1114d81cd0cded58910f0 | [
"MIT"
] | 1 | 2022-01-15T21:38:38.000Z | 2022-01-15T21:38:38.000Z | emulator/src/emu/debug/debugcmd.h | rjw57/tiw-computer | 5ef1c79893165b8622d1114d81cd0cded58910f0 | [
"MIT"
] | null | null | null | emulator/src/emu/debug/debugcmd.h | rjw57/tiw-computer | 5ef1c79893165b8622d1114d81cd0cded58910f0 | [
"MIT"
] | null | null | null | // license:BSD-3-Clause
// copyright-holders:Aaron Giles,Ryan Holtz
/*********************************************************************
debugcmd.h
Debugger command interface engine.
*********************************************************************/
#ifndef MAME_EMU_DEBUG_DEBUGCMD_H
#define MAME_EMU_DEBUG_DEBUGCMD_H
#pragma once
#include "debugcpu.h"
#include "debugcon.h"
class debugger_commands
{
public:
debugger_commands(running_machine& machine, debugger_cpu& cpu, debugger_console& console);
/* validates a parameter as a boolean value */
bool validate_boolean_parameter(const std::string ¶m, bool &result);
/* validates a parameter as a numeric value */
bool validate_number_parameter(const std::string ¶m, u64 &result);
/* validates a parameter as a cpu */
bool validate_cpu_parameter(const char *param, device_t *&result);
/* validates a parameter as a cpu and retrieves the given address space */
bool validate_cpu_space_parameter(const char *param, int spacenum, address_space *&result);
private:
struct global_entry
{
global_entry() { }
void * base = nullptr;
u32 size = 0;
};
struct cheat_map
{
u64 offset;
u64 first_value;
u64 previous_value;
u8 state:1;
u8 undo:7;
};
// TODO [RH 31 May 2016]: Move this cheat stuff into its own class
struct cheat_system
{
char cpu[2];
u8 width;
std::vector<cheat_map> cheatmap;
u8 undo;
u8 signed_cheat;
u8 swapped_cheat;
};
struct cheat_region_map
{
u64 offset;
u64 endoffset;
const char *share;
u8 disabled;
};
bool debug_command_parameter_expression(const std::string ¶m, parsed_expression &result);
bool debug_command_parameter_command(const char *param);
bool cheat_address_is_valid(address_space &space, offs_t address);
u64 cheat_sign_extend(const cheat_system *cheatsys, u64 value);
u64 cheat_byte_swap(const cheat_system *cheatsys, u64 value);
u64 cheat_read_extended(const cheat_system *cheatsys, address_space &space, offs_t address);
u64 execute_min(symbol_table &table, int params, const u64 *param);
u64 execute_max(symbol_table &table, int params, const u64 *param);
u64 execute_if(symbol_table &table, int params, const u64 *param);
u64 global_get(symbol_table &table, global_entry *global);
void global_set(symbol_table &table, global_entry *global, u64 value);
int mini_printf(char *buffer, const char *format, int params, u64 *param);
void execute_trace_internal(int ref, const std::vector<std::string> ¶ms, bool trace_over);
void execute_help(int ref, const std::vector<std::string> ¶ms);
void execute_print(int ref, const std::vector<std::string> ¶ms);
void execute_printf(int ref, const std::vector<std::string> ¶ms);
void execute_logerror(int ref, const std::vector<std::string> ¶ms);
void execute_tracelog(int ref, const std::vector<std::string> ¶ms);
void execute_tracesym(int ref, const std::vector<std::string> ¶ms);
void execute_quit(int ref, const std::vector<std::string> ¶ms);
void execute_do(int ref, const std::vector<std::string> ¶ms);
void execute_step(int ref, const std::vector<std::string> ¶ms);
void execute_over(int ref, const std::vector<std::string> ¶ms);
void execute_out(int ref, const std::vector<std::string> ¶ms);
void execute_go(int ref, const std::vector<std::string> ¶ms);
void execute_go_vblank(int ref, const std::vector<std::string> ¶ms);
void execute_go_interrupt(int ref, const std::vector<std::string> ¶ms);
void execute_go_time(int ref, const std::vector<std::string> ¶ms);
void execute_focus(int ref, const std::vector<std::string> ¶ms);
void execute_ignore(int ref, const std::vector<std::string> ¶ms);
void execute_observe(int ref, const std::vector<std::string> ¶ms);
void execute_next(int ref, const std::vector<std::string> ¶ms);
void execute_comment_add(int ref, const std::vector<std::string> ¶ms);
void execute_comment_del(int ref, const std::vector<std::string> ¶ms);
void execute_comment_save(int ref, const std::vector<std::string> ¶ms);
void execute_comment_list(int ref, const std::vector<std::string> ¶ms);
void execute_comment_commit(int ref, const std::vector<std::string> ¶ms);
void execute_bpset(int ref, const std::vector<std::string> ¶ms);
void execute_bpclear(int ref, const std::vector<std::string> ¶ms);
void execute_bpdisenable(int ref, const std::vector<std::string> ¶ms);
void execute_bplist(int ref, const std::vector<std::string> ¶ms);
void execute_wpset(int ref, const std::vector<std::string> ¶ms);
void execute_wpclear(int ref, const std::vector<std::string> ¶ms);
void execute_wpdisenable(int ref, const std::vector<std::string> ¶ms);
void execute_wplist(int ref, const std::vector<std::string> ¶ms);
void execute_rpset(int ref, const std::vector<std::string> ¶ms);
void execute_rpclear(int ref, const std::vector<std::string> ¶ms);
void execute_rpdisenable(int ref, const std::vector<std::string> ¶ms);
void execute_rplist(int ref, const std::vector<std::string> ¶ms);
void execute_hotspot(int ref, const std::vector<std::string> ¶ms);
void execute_statesave(int ref, const std::vector<std::string> ¶ms);
void execute_stateload(int ref, const std::vector<std::string> ¶ms);
void execute_rewind(int ref, const std::vector<std::string> ¶ms);
void execute_save(int ref, const std::vector<std::string> ¶ms);
void execute_load(int ref, const std::vector<std::string> ¶ms);
void execute_dump(int ref, const std::vector<std::string> ¶ms);
void execute_cheatinit(int ref, const std::vector<std::string> ¶ms);
void execute_cheatnext(int ref, const std::vector<std::string> ¶ms);
void execute_cheatlist(int ref, const std::vector<std::string> ¶ms);
void execute_cheatundo(int ref, const std::vector<std::string> ¶ms);
void execute_dasm(int ref, const std::vector<std::string> ¶ms);
void execute_find(int ref, const std::vector<std::string> ¶ms);
void execute_trace(int ref, const std::vector<std::string> ¶ms);
void execute_traceover(int ref, const std::vector<std::string> ¶ms);
void execute_traceflush(int ref, const std::vector<std::string> ¶ms);
void execute_history(int ref, const std::vector<std::string> ¶ms);
void execute_trackpc(int ref, const std::vector<std::string> ¶ms);
void execute_trackmem(int ref, const std::vector<std::string> ¶ms);
void execute_pcatmem(int ref, const std::vector<std::string> ¶ms);
void execute_snap(int ref, const std::vector<std::string> ¶ms);
void execute_source(int ref, const std::vector<std::string> ¶ms);
void execute_map(int ref, const std::vector<std::string> ¶ms);
void execute_memdump(int ref, const std::vector<std::string> ¶ms);
void execute_symlist(int ref, const std::vector<std::string> ¶ms);
void execute_softreset(int ref, const std::vector<std::string> ¶ms);
void execute_hardreset(int ref, const std::vector<std::string> ¶ms);
void execute_images(int ref, const std::vector<std::string> ¶ms);
void execute_mount(int ref, const std::vector<std::string> ¶ms);
void execute_unmount(int ref, const std::vector<std::string> ¶ms);
void execute_input(int ref, const std::vector<std::string> ¶ms);
void execute_dumpkbd(int ref, const std::vector<std::string> ¶ms);
running_machine& m_machine;
debugger_cpu& m_cpu;
debugger_console& m_console;
std::unique_ptr<global_entry []> m_global_array;
cheat_system m_cheat;
static const size_t MAX_GLOBALS;
};
#endif // MAME_EMU_DEBUG_DEBUGCMD_H
| 44.451429 | 95 | 0.725672 |
7fc1a6466f68409df8167bd413b294a08d89eea2 | 22,727 | rs | Rust | src/valid/type.rs | francesco-cattoglio/naga | 33998799ae12dcc7cd8480a25f1b6c544d8770ab | [
"Apache-2.0",
"MIT"
] | null | null | null | src/valid/type.rs | francesco-cattoglio/naga | 33998799ae12dcc7cd8480a25f1b6c544d8770ab | [
"Apache-2.0",
"MIT"
] | null | null | null | src/valid/type.rs | francesco-cattoglio/naga | 33998799ae12dcc7cd8480a25f1b6c544d8770ab | [
"Apache-2.0",
"MIT"
] | null | null | null | use super::Capabilities;
use crate::{
arena::{Arena, BadHandle, Handle, UniqueArena},
proc::Alignment,
};
bitflags::bitflags! {
/// Flags associated with [`Type`]s by [`Validator`].
///
/// [`Type`]: crate::Type
/// [`Validator`]: crate::valid::Validator
#[repr(transparent)]
pub struct TypeFlags: u8 {
/// Can be used for data variables.
///
/// This flag is required on types of local variables, function
/// arguments, array elements, and struct members.
///
/// This includes all types except `Image`, `Sampler`,
/// and some `Pointer` types.
const DATA = 0x1;
/// The data type has a size known by pipeline creation time.
///
/// Unsized types are quite restricted. The only unsized types permitted
/// by Naga, other than the non-[`DATA`] types like [`Image`] and
/// [`Sampler`], are dynamically-sized [`Array`s], and [`Struct`s] whose
/// last members are such arrays. See the documentation for those types
/// for details.
///
/// [`DATA`]: TypeFlags::DATA
/// [`Image`]: crate::Type::Image
/// [`Sampler`]: crate::Type::Sampler
/// [`Array`]: crate::Type::Array
/// [`Struct`]: crate::Type::struct
const SIZED = 0x2;
/// The data can be copied around.
const COPY = 0x4;
/// Can be be used for interfacing between pipeline stages.
///
/// This includes non-bool scalars and vectors, matrices, and structs
/// and arrays containing only interface types.
const INTERFACE = 0x8;
/// Can be used for host-shareable structures.
const HOST_SHARED = 0x10;
/// This type can be passed as a function argument.
const ARGUMENT = 0x40;
}
}
#[derive(Clone, Copy, Debug, thiserror::Error)]
pub enum Disalignment {
#[error("The array stride {stride} is not a multiple of the required alignment {alignment}")]
ArrayStride { stride: u32, alignment: u32 },
#[error("The struct span {span}, is not a multiple of the required alignment {alignment}")]
StructSpan { span: u32, alignment: u32 },
#[error("The struct member[{index}] offset {offset} is not a multiple of the required alignment {alignment}")]
MemberOffset {
index: u32,
offset: u32,
alignment: u32,
},
#[error("The struct member[{index}] is not statically sized")]
UnsizedMember { index: u32 },
#[error("The type is not host-shareable")]
NonHostShareable,
}
#[derive(Clone, Debug, thiserror::Error)]
pub enum TypeError {
#[error(transparent)]
BadHandle(#[from] BadHandle),
#[error("The {0:?} scalar width {1} is not supported")]
InvalidWidth(crate::ScalarKind, crate::Bytes),
#[error("The {0:?} scalar width {1} is not supported for an atomic")]
InvalidAtomicWidth(crate::ScalarKind, crate::Bytes),
#[error("The base handle {0:?} can not be resolved")]
UnresolvedBase(Handle<crate::Type>),
#[error("Invalid type for pointer target {0:?}")]
InvalidPointerBase(Handle<crate::Type>),
#[error("Unsized types like {base:?} must be in the `Storage` storage class, not `{class:?}`")]
InvalidPointerToUnsized {
base: Handle<crate::Type>,
class: crate::StorageClass,
},
#[error("Expected data type, found {0:?}")]
InvalidData(Handle<crate::Type>),
#[error("Base type {0:?} for the array is invalid")]
InvalidArrayBaseType(Handle<crate::Type>),
#[error("The constant {0:?} can not be used for an array size")]
InvalidArraySizeConstant(Handle<crate::Constant>),
#[error("The constant {0:?} is specialized, and cannot be used as an array size")]
UnsupportedSpecializedArrayLength(Handle<crate::Constant>),
#[error("Array type {0:?} must have a length of one or more")]
NonPositiveArrayLength(Handle<crate::Constant>),
#[error("Array stride {stride} is smaller than the base element size {base_size}")]
InsufficientArrayStride { stride: u32, base_size: u32 },
#[error("Field '{0}' can't be dynamically-sized, has type {1:?}")]
InvalidDynamicArray(String, Handle<crate::Type>),
#[error("Structure member[{index}] at {offset} overlaps the previous member")]
MemberOverlap { index: u32, offset: u32 },
#[error(
"Structure member[{index}] at {offset} and size {size} crosses the structure boundary of size {span}"
)]
MemberOutOfBounds {
index: u32,
offset: u32,
size: u32,
span: u32,
},
}
// Only makes sense if `flags.contains(HOST_SHARED)`
type LayoutCompatibility = Result<Option<Alignment>, (Handle<crate::Type>, Disalignment)>;
fn check_member_layout(
accum: &mut LayoutCompatibility,
member: &crate::StructMember,
member_index: u32,
member_layout: LayoutCompatibility,
parent_handle: Handle<crate::Type>,
) {
*accum = match (*accum, member_layout) {
(Ok(cur_alignment), Ok(align)) => {
let align = align.unwrap().get();
if member.offset % align != 0 {
Err((
parent_handle,
Disalignment::MemberOffset {
index: member_index,
offset: member.offset,
alignment: align,
},
))
} else {
let combined_alignment = ((cur_alignment.unwrap().get() - 1) | (align - 1)) + 1;
Ok(Alignment::new(combined_alignment))
}
}
(Err(e), _) | (_, Err(e)) => Err(e),
};
}
#[derive(Clone, Debug)]
pub(super) struct TypeInfo {
pub flags: TypeFlags,
pub uniform_layout: LayoutCompatibility,
pub storage_layout: LayoutCompatibility,
}
impl TypeInfo {
fn dummy() -> Self {
TypeInfo {
flags: TypeFlags::empty(),
uniform_layout: Ok(None),
storage_layout: Ok(None),
}
}
fn new(flags: TypeFlags, align: u32) -> Self {
let alignment = Alignment::new(align);
TypeInfo {
flags,
uniform_layout: Ok(alignment),
storage_layout: Ok(alignment),
}
}
}
impl super::Validator {
pub(super) fn check_width(&self, kind: crate::ScalarKind, width: crate::Bytes) -> bool {
match kind {
crate::ScalarKind::Bool => width == crate::BOOL_WIDTH,
crate::ScalarKind::Float => {
width == 4 || (width == 8 && self.capabilities.contains(Capabilities::FLOAT64))
}
crate::ScalarKind::Sint | crate::ScalarKind::Uint => width == 4,
}
}
pub(super) fn reset_types(&mut self, size: usize) {
self.types.clear();
self.types.resize(size, TypeInfo::dummy());
self.layouter.clear();
}
pub(super) fn validate_type(
&self,
handle: Handle<crate::Type>,
types: &UniqueArena<crate::Type>,
constants: &Arena<crate::Constant>,
) -> Result<TypeInfo, TypeError> {
use crate::TypeInner as Ti;
Ok(match types[handle].inner {
Ti::Scalar { kind, width } => {
if !self.check_width(kind, width) {
return Err(TypeError::InvalidWidth(kind, width));
}
TypeInfo::new(
TypeFlags::DATA
| TypeFlags::SIZED
| TypeFlags::COPY
| TypeFlags::INTERFACE
| TypeFlags::HOST_SHARED
| TypeFlags::ARGUMENT,
width as u32,
)
}
Ti::Vector { size, kind, width } => {
if !self.check_width(kind, width) {
return Err(TypeError::InvalidWidth(kind, width));
}
let count = if size >= crate::VectorSize::Tri { 4 } else { 2 };
TypeInfo::new(
TypeFlags::DATA
| TypeFlags::SIZED
| TypeFlags::COPY
| TypeFlags::INTERFACE
| TypeFlags::HOST_SHARED
| TypeFlags::ARGUMENT,
count * (width as u32),
)
}
Ti::Matrix {
columns: _,
rows,
width,
} => {
if !self.check_width(crate::ScalarKind::Float, width) {
return Err(TypeError::InvalidWidth(crate::ScalarKind::Float, width));
}
let count = if rows >= crate::VectorSize::Tri { 4 } else { 2 };
TypeInfo::new(
TypeFlags::DATA
| TypeFlags::SIZED
| TypeFlags::COPY
| TypeFlags::INTERFACE
| TypeFlags::HOST_SHARED
| TypeFlags::ARGUMENT,
count * (width as u32),
)
}
Ti::Atomic { kind, width } => {
let good = match kind {
crate::ScalarKind::Bool | crate::ScalarKind::Float => false,
crate::ScalarKind::Sint | crate::ScalarKind::Uint => width == 4,
};
if !good {
return Err(TypeError::InvalidAtomicWidth(kind, width));
}
TypeInfo::new(
TypeFlags::DATA | TypeFlags::SIZED | TypeFlags::HOST_SHARED,
width as u32,
)
}
Ti::Pointer { base, class } => {
use crate::StorageClass as Sc;
if base >= handle {
return Err(TypeError::UnresolvedBase(base));
}
let base_info = &self.types[base.index()];
if !base_info.flags.contains(TypeFlags::DATA) {
return Err(TypeError::InvalidPointerBase(base));
}
// Runtime-sized values can only live in the `Storage` storage
// class, so it's useless to have a pointer to such a type in
// any other class.
//
// Detecting this problem here prevents the definition of
// functions like:
//
// fn f(p: ptr<workgroup, UnsizedType>) -> ... { ... }
//
// which would otherwise be permitted, but uncallable. (They
// may also present difficulties in code generation).
if !base_info.flags.contains(TypeFlags::SIZED) {
match class {
Sc::Storage { .. } => {}
_ => {
return Err(TypeError::InvalidPointerToUnsized { base, class });
}
}
}
// Pointers passed as arguments to user-defined functions must
// be in the `Function`, `Private`, or `Workgroup` storage
// class. We only mark pointers in those classes as `ARGUMENT`.
//
// `Validator::validate_function` actually checks the storage
// class of pointer arguments explicitly before checking the
// `ARGUMENT` flag, to give better error messages. But it seems
// best to set `ARGUMENT` accurately anyway.
let argument_flag = match class {
Sc::Function | Sc::Private | Sc::WorkGroup => TypeFlags::ARGUMENT,
Sc::Uniform | Sc::Storage { .. } | Sc::Handle | Sc::PushConstant => {
TypeFlags::empty()
}
};
// Pointers cannot be stored in variables, structure members, or
// array elements, so we do not mark them as `DATA`.
TypeInfo::new(argument_flag | TypeFlags::SIZED | TypeFlags::COPY, 0)
}
Ti::ValuePointer {
size: _,
kind,
width,
class: _,
} => {
if !self.check_width(kind, width) {
return Err(TypeError::InvalidWidth(kind, width));
}
TypeInfo::new(TypeFlags::DATA | TypeFlags::SIZED | TypeFlags::COPY, 0)
}
Ti::Array { base, size, stride } => {
if base >= handle {
return Err(TypeError::UnresolvedBase(base));
}
let base_info = &self.types[base.index()];
if !base_info.flags.contains(TypeFlags::DATA | TypeFlags::SIZED) {
return Err(TypeError::InvalidArrayBaseType(base));
}
//Note: `unwrap()` is fine, since `Layouter` goes first and calls it
let base_size = types[base].inner.size(constants);
if stride < base_size {
return Err(TypeError::InsufficientArrayStride { stride, base_size });
}
let general_alignment = self.layouter[base].alignment;
let uniform_layout = match base_info.uniform_layout {
Ok(base_alignment) => {
// combine the alignment requirements
let align = ((base_alignment.unwrap().get() - 1)
| (general_alignment.get() - 1))
+ 1;
if stride % align != 0 {
Err((
handle,
Disalignment::ArrayStride {
stride,
alignment: align,
},
))
} else {
Ok(Alignment::new(align))
}
}
Err(e) => Err(e),
};
let storage_layout = match base_info.storage_layout {
Ok(base_alignment) => {
let align = ((base_alignment.unwrap().get() - 1)
| (general_alignment.get() - 1))
+ 1;
if stride % align != 0 {
Err((
handle,
Disalignment::ArrayStride {
stride,
alignment: align,
},
))
} else {
Ok(Alignment::new(align))
}
}
Err(e) => Err(e),
};
let sized_flag = match size {
crate::ArraySize::Constant(const_handle) => {
let constant = constants.try_get(const_handle)?;
let length_is_positive = match *constant {
crate::Constant {
specialization: Some(_),
..
} => {
// Many of our back ends don't seem to support
// specializable array lengths. If you want to try to make
// this work, be sure to address all uses of
// `Constant::to_array_length`, which ignores
// specialization.
return Err(TypeError::UnsupportedSpecializedArrayLength(
const_handle,
));
}
crate::Constant {
inner:
crate::ConstantInner::Scalar {
width: _,
value: crate::ScalarValue::Uint(length),
},
..
} => length > 0,
// Accept a signed integer size to avoid
// requiring an explicit uint
// literal. Type inference should make
// this unnecessary.
crate::Constant {
inner:
crate::ConstantInner::Scalar {
width: _,
value: crate::ScalarValue::Sint(length),
},
..
} => length > 0,
_ => {
log::warn!("Array size {:?}", constant);
return Err(TypeError::InvalidArraySizeConstant(const_handle));
}
};
if !length_is_positive {
return Err(TypeError::NonPositiveArrayLength(const_handle));
}
TypeFlags::SIZED | TypeFlags::ARGUMENT
}
crate::ArraySize::Dynamic => {
// Non-SIZED types may only appear as the last element of a structure.
// This is enforced by checks for SIZED-ness for all compound types,
// and a special case for structs.
TypeFlags::empty()
}
};
let base_mask = TypeFlags::COPY | TypeFlags::HOST_SHARED | TypeFlags::INTERFACE;
TypeInfo {
flags: TypeFlags::DATA | (base_info.flags & base_mask) | sized_flag,
uniform_layout,
storage_layout,
}
}
Ti::Struct { ref members, span } => {
let mut ti = TypeInfo::new(
TypeFlags::DATA
| TypeFlags::SIZED
| TypeFlags::COPY
| TypeFlags::HOST_SHARED
| TypeFlags::INTERFACE
| TypeFlags::ARGUMENT,
1,
);
let mut min_offset = 0;
for (i, member) in members.iter().enumerate() {
if member.ty >= handle {
return Err(TypeError::UnresolvedBase(member.ty));
}
let base_info = &self.types[member.ty.index()];
if !base_info.flags.contains(TypeFlags::DATA) {
return Err(TypeError::InvalidData(member.ty));
}
if !base_info.flags.contains(TypeFlags::HOST_SHARED) {
if ti.uniform_layout.is_ok() {
ti.uniform_layout = Err((member.ty, Disalignment::NonHostShareable));
}
if ti.storage_layout.is_ok() {
ti.storage_layout = Err((member.ty, Disalignment::NonHostShareable));
}
}
ti.flags &= base_info.flags;
if member.offset < min_offset {
//HACK: this could be nicer. We want to allow some structures
// to not bother with offsets/alignments if they are never
// used for host sharing.
if member.offset == 0 {
ti.flags.set(TypeFlags::HOST_SHARED, false);
} else {
return Err(TypeError::MemberOverlap {
index: i as u32,
offset: member.offset,
});
}
}
//Note: `unwrap()` is fine because `Layouter` goes first and checks this
let base_size = types[member.ty].inner.size(constants);
min_offset = member.offset + base_size;
if min_offset > span {
return Err(TypeError::MemberOutOfBounds {
index: i as u32,
offset: member.offset,
size: base_size,
span,
});
}
check_member_layout(
&mut ti.uniform_layout,
member,
i as u32,
base_info.uniform_layout,
handle,
);
check_member_layout(
&mut ti.storage_layout,
member,
i as u32,
base_info.storage_layout,
handle,
);
// The last field may be an unsized array.
if !base_info.flags.contains(TypeFlags::SIZED) {
let is_array = match types[member.ty].inner {
crate::TypeInner::Array { .. } => true,
_ => false,
};
if !is_array || i + 1 != members.len() {
let name = member.name.clone().unwrap_or_default();
return Err(TypeError::InvalidDynamicArray(name, member.ty));
}
if ti.uniform_layout.is_ok() {
ti.uniform_layout =
Err((handle, Disalignment::UnsizedMember { index: i as u32 }));
}
}
}
let alignment = self.layouter[handle].alignment.get();
if span % alignment != 0 {
ti.uniform_layout = Err((handle, Disalignment::StructSpan { span, alignment }));
ti.storage_layout = Err((handle, Disalignment::StructSpan { span, alignment }));
}
ti
}
Ti::Image { .. } | Ti::Sampler { .. } => TypeInfo::new(TypeFlags::ARGUMENT, 0),
})
}
}
| 41.931734 | 114 | 0.452589 |