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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bf7321fbf184af3bc3e037cb9ff3d6f4a2c32920 | 1,522 | asm | Assembly | tests/emra/EM_MODE/asm/EM03.asm | ilebedev/stacktool | 0750fb632d6a06596056edb97825baa035cec418 | [
"MIT"
] | 1 | 2021-02-17T17:44:59.000Z | 2021-02-17T17:44:59.000Z | tests/emra/EM_MODE/asm/EM03.asm | ilebedev/stacktool | 0750fb632d6a06596056edb97825baa035cec418 | [
"MIT"
] | null | null | null | tests/emra/EM_MODE/asm/EM03.asm | ilebedev/stacktool | 0750fb632d6a06596056edb97825baa035cec418 | [
"MIT"
] | null | null | null | PUSH 0; # RA
PUSH 1; # 0 RA
PUSH 2; # 10 RA
PUSH 3; # 210 RA
PUSH 4; # 3210 RA
PUSH 5; # 43210 RA
PUSH 6; # 543210 RA
PUSH 7; # 6543210 RA
PUSH 8; # 76543210 RA
PUSH 9; # 876543210 RA
PUSH 10; # 9876543210 RA
PUSH 11; # 09876543210 RA
PUSH 12; # 109876543210 RA
PUSH 13; # 2109876543210 RA
PUSH 14; # 32109876543210 RA
PUSH 15; # 432109876543210 RA
PUSH 16; # 5432109876543210 RA
PUSH 17; # 65432109876543210 RA
PUSH 1; # 765432109876543210 RA
PUSH 0; # 1 765432109876543210 RA
ST_EM 2 0; # 0 1 765432109876543210 RA
PUSH 0; # 765432109876543210 RA
LD_EM 1 0; # 0 765432109876543210 RA
PUSH 0; # M0 765432109876543210 RA
SETHI 0x0200; # 0 M0 765432109876543210 RA
ST_EM 2 0; # 0x2 M0 765432109876543210 RA
DROP 0; # 765432109876543210 RA
DROP 0; # 65432109876543210 RA
DROP 0; # 5432109876543210 RA
DROP 0; # 432109876543210 RA
DROP 0; # 32109876543210 RA
DROP 0; # 2109876543210 RA
DROP 0; # 109876543210 RA
DROP 0; # 09876543210 RA
DROP 0; # 9876543210 RA
DROP 0; # 876543210 RA
DROP 0; # 76543210 RA
DROP 0; # 6543210 RA
DROP 0; # 543210 RA
DROP 0; # 43210 RA
DROP 0; # 3210 RA
DROP 0; # 210 RA
DROP 0; # 10 RA
DROP 0; # 0 RA
PUSH 0; # RA
LD_EM 1 0; # 0 RA
PUSH 1; # M0 RA
ADD; # 1 M0 RA
PUSH 0; # M01 RA
ST_EM 2 0; # 0 M01 RA
HALT; # RA | 29.843137 | 44 | 0.573587 |
7146fd73f78f3c86fa835a6c6a0800dd3f78fef1 | 815 | asm | Assembly | libsrc/alloc/farz88/strings/strlen_far.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/alloc/farz88/strings/strlen_far.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/alloc/farz88/strings/strlen_far.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; strlen function for use with far pointers
; 31/3/00 GWL
;
; $Id: strlen_far.asm,v 1.5 2017-01-02 20:37:10 aralbrec Exp $
;
SECTION code_clib
EXTERN farseg1,incfar
PUBLIC strlen_far
PUBLIC _strlen_far
;int strlen(far *s)
; finds length of s
.strlen_far
._strlen_far
pop hl
pop bc
pop de ; EBC=far pointer
push de
push bc
push hl
ld a,($04d1)
ex af,af' ; save seg 1 binding
ld ix,0 ; our counter
call farseg1 ; bind to segment 1, with address in HL
.strlen1
ld a,(hl) ; check for string end
and a
jr z,strlenend
inc ix ; increment counter
call incfar
jr strlen1
.strlenend
ex af,af'
ld ($04d1),a
out ($d1),a ; rebind segment 1
push ix
pop hl ; HL=length
ret
| 18.953488 | 62 | 0.588957 |
09b968cbeedbc0860a0636921583248c99bb32e0 | 3,252 | sql | SQL | mining.sql | shuvro-zz/Clinic-Management | 70c023c350ef22a6d48129086c89525f0e77c567 | [
"CC-BY-3.0"
] | 1 | 2019-10-19T03:26:12.000Z | 2019-10-19T03:26:12.000Z | mining.sql | NATTYJAY/Clinic-Management | 70c023c350ef22a6d48129086c89525f0e77c567 | [
"CC-BY-3.0"
] | null | null | null | mining.sql | NATTYJAY/Clinic-Management | 70c023c350ef22a6d48129086c89525f0e77c567 | [
"CC-BY-3.0"
] | 1 | 2019-10-19T03:32:08.000Z | 2019-10-19T03:32:08.000Z | -- phpMyAdmin SQL Dump
-- version 4.4.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 29, 2018 at 07:13 AM
-- Server version: 5.6.26-log
-- PHP Version: 5.6.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `mining`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE IF NOT EXISTS `admin` (
`id` int(2) NOT NULL,
`fname` varchar(20) NOT NULL,
`lname` varchar(20) NOT NULL,
`phone` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(32) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `admin`
--
INSERT INTO `admin` (`id`, `fname`, `lname`, `phone`, `email`, `password`) VALUES
(1, 'Israel', 'Honcho', '08060860316', 'admin@admin.com', '123456');
-- --------------------------------------------------------
--
-- Table structure for table `patients`
--
CREATE TABLE IF NOT EXISTS `patients` (
`id` int(6) NOT NULL,
`patient_ID` varchar(255) NOT NULL,
`fname` varchar(20) NOT NULL,
`mname` varchar(20) NOT NULL,
`lname` varchar(20) NOT NULL,
`address` varchar(100) NOT NULL,
`age` int(1) NOT NULL,
`date_created` varchar(100) NOT NULL,
`phone_one` varchar(12) NOT NULL,
`phone_two` varchar(12) DEFAULT NULL,
`Next_of_kin_FName` varchar(20) DEFAULT NULL,
`Next_of_kin_LName` varchar(20) DEFAULT NULL,
`Nok_phone` varchar(20) DEFAULT NULL,
`blood_group` varchar(5) DEFAULT NULL,
`gender` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `treatments`
--
CREATE TABLE IF NOT EXISTS `treatments` (
`id` int(6) NOT NULL,
`treatment_name` varchar(50) DEFAULT NULL,
`symtoms` varchar(255) DEFAULT NULL,
`date_of_treatement` varchar(255) DEFAULT NULL,
`Cost` int(6) DEFAULT NULL,
`Amount_paid` int(6) DEFAULT NULL,
`Amount_balance` int(6) DEFAULT NULL,
`doctor` varchar(255) DEFAULT NULL,
`patient_ID` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `patients`
--
ALTER TABLE `patients`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `treatments`
--
ALTER TABLE `treatments`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
MODIFY `id` int(2) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `patients`
--
ALTER TABLE `patients`
MODIFY `id` int(6) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `treatments`
--
ALTER TABLE `treatments`
MODIFY `id` int(6) NOT NULL AUTO_INCREMENT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| 24.824427 | 81 | 0.657749 |
f5aaf77ba4c2718f72a036af27de971a4859f1ec | 51,218 | css | CSS | postcss-icon/material-design/src.css | retyui/retyui.github.io | 7a293291461041724693792553fda06ce3de2bd2 | [
"MIT"
] | null | null | null | postcss-icon/material-design/src.css | retyui/retyui.github.io | 7a293291461041724693792553fda06ce3de2bd2 | [
"MIT"
] | 1 | 2018-05-06T20:18:42.000Z | 2018-05-10T16:53:55.000Z | postcss-icon/material-design/src.css | retyui/retyui.github.io | 7a293291461041724693792553fda06ce3de2bd2 | [
"MIT"
] | null | null | null |
.c-icon--3d-rotation::before{ @icon md-3d-rotation; }
.c-icon--ac-unit::before{ @icon md-ac-unit; }
.c-icon--access-alarm::before{ @icon md-access-alarm; }
.c-icon--access-alarms::before{ @icon md-access-alarms; }
.c-icon--access-time::before{ @icon md-access-time; }
.c-icon--accessibility::before{ @icon md-accessibility; }
.c-icon--accessible::before{ @icon md-accessible; }
.c-icon--account-balance::before{ @icon md-account-balance; }
.c-icon--account-balance-wallet::before{ @icon md-account-balance-wallet; }
.c-icon--account-box::before{ @icon md-account-box; }
.c-icon--account-circle::before{ @icon md-account-circle; }
.c-icon--adb::before{ @icon md-adb; }
.c-icon--add::before{ @icon md-add; }
.c-icon--add-a-photo::before{ @icon md-add-a-photo; }
.c-icon--add-alarm::before{ @icon md-add-alarm; }
.c-icon--add-alert::before{ @icon md-add-alert; }
.c-icon--add-box::before{ @icon md-add-box; }
.c-icon--add-circle::before{ @icon md-add-circle; }
.c-icon--add-circle-outline::before{ @icon md-add-circle-outline; }
.c-icon--add-location::before{ @icon md-add-location; }
.c-icon--add-shopping-cart::before{ @icon md-add-shopping-cart; }
.c-icon--add-to-photos::before{ @icon md-add-to-photos; }
.c-icon--add-to-queue::before{ @icon md-add-to-queue; }
.c-icon--adjust::before{ @icon md-adjust; }
.c-icon--airline-seat-flat::before{ @icon md-airline-seat-flat; }
.c-icon--airline-seat-flat-angled::before{ @icon md-airline-seat-flat-angled; }
.c-icon--airline-seat-individual-suite::before{ @icon md-airline-seat-individual-suite; }
.c-icon--airline-seat-legroom-extra::before{ @icon md-airline-seat-legroom-extra; }
.c-icon--airline-seat-legroom-normal::before{ @icon md-airline-seat-legroom-normal; }
.c-icon--airline-seat-legroom-reduced::before{ @icon md-airline-seat-legroom-reduced; }
.c-icon--airline-seat-recline-extra::before{ @icon md-airline-seat-recline-extra; }
.c-icon--airline-seat-recline-normal::before{ @icon md-airline-seat-recline-normal; }
.c-icon--airplanemode-active::before{ @icon md-airplanemode-active; }
.c-icon--airplanemode-inactive::before{ @icon md-airplanemode-inactive; }
.c-icon--airplay::before{ @icon md-airplay; }
.c-icon--airport-shuttle::before{ @icon md-airport-shuttle; }
.c-icon--alarm::before{ @icon md-alarm; }
.c-icon--alarm-add::before{ @icon md-alarm-add; }
.c-icon--alarm-off::before{ @icon md-alarm-off; }
.c-icon--alarm-on::before{ @icon md-alarm-on; }
.c-icon--album::before{ @icon md-album; }
.c-icon--all-inclusive::before{ @icon md-all-inclusive; }
.c-icon--all-out::before{ @icon md-all-out; }
.c-icon--android::before{ @icon md-android; }
.c-icon--announcement::before{ @icon md-announcement; }
.c-icon--apps::before{ @icon md-apps; }
.c-icon--archive::before{ @icon md-archive; }
.c-icon--arrow-back::before{ @icon md-arrow-back; }
.c-icon--arrow-downward::before{ @icon md-arrow-downward; }
.c-icon--arrow-drop-down::before{ @icon md-arrow-drop-down; }
.c-icon--arrow-drop-down-circle::before{ @icon md-arrow-drop-down-circle; }
.c-icon--arrow-drop-up::before{ @icon md-arrow-drop-up; }
.c-icon--arrow-forward::before{ @icon md-arrow-forward; }
.c-icon--arrow-upward::before{ @icon md-arrow-upward; }
.c-icon--art-track::before{ @icon md-art-track; }
.c-icon--aspect-ratio::before{ @icon md-aspect-ratio; }
.c-icon--assessment::before{ @icon md-assessment; }
.c-icon--assignment::before{ @icon md-assignment; }
.c-icon--assignment-ind::before{ @icon md-assignment-ind; }
.c-icon--assignment-late::before{ @icon md-assignment-late; }
.c-icon--assignment-return::before{ @icon md-assignment-return; }
.c-icon--assignment-returned::before{ @icon md-assignment-returned; }
.c-icon--assignment-turned-in::before{ @icon md-assignment-turned-in; }
.c-icon--assistant::before{ @icon md-assistant; }
.c-icon--assistant-photo::before{ @icon md-assistant-photo; }
.c-icon--attach-file::before{ @icon md-attach-file; }
.c-icon--attach-money::before{ @icon md-attach-money; }
.c-icon--attachment::before{ @icon md-attachment; }
.c-icon--audiotrack::before{ @icon md-audiotrack; }
.c-icon--autorenew::before{ @icon md-autorenew; }
.c-icon--av-timer::before{ @icon md-av-timer; }
.c-icon--backspace::before{ @icon md-backspace; }
.c-icon--backup::before{ @icon md-backup; }
.c-icon--battery-alert::before{ @icon md-battery-alert; }
.c-icon--battery-charging-full::before{ @icon md-battery-charging-full; }
.c-icon--battery-full::before{ @icon md-battery-full; }
.c-icon--battery-std::before{ @icon md-battery-std; }
.c-icon--battery-unknown::before{ @icon md-battery-unknown; }
.c-icon--beach-access::before{ @icon md-beach-access; }
.c-icon--beenhere::before{ @icon md-beenhere; }
.c-icon--block::before{ @icon md-block; }
.c-icon--bluetooth::before{ @icon md-bluetooth; }
.c-icon--bluetooth-audio::before{ @icon md-bluetooth-audio; }
.c-icon--bluetooth-connected::before{ @icon md-bluetooth-connected; }
.c-icon--bluetooth-disabled::before{ @icon md-bluetooth-disabled; }
.c-icon--bluetooth-searching::before{ @icon md-bluetooth-searching; }
.c-icon--blur-circular::before{ @icon md-blur-circular; }
.c-icon--blur-linear::before{ @icon md-blur-linear; }
.c-icon--blur-off::before{ @icon md-blur-off; }
.c-icon--blur-on::before{ @icon md-blur-on; }
.c-icon--book::before{ @icon md-book; }
.c-icon--bookmark::before{ @icon md-bookmark; }
.c-icon--bookmark-border::before{ @icon md-bookmark-border; }
.c-icon--border-all::before{ @icon md-border-all; }
.c-icon--border-bottom::before{ @icon md-border-bottom; }
.c-icon--border-clear::before{ @icon md-border-clear; }
.c-icon--border-color::before{ @icon md-border-color; }
.c-icon--border-horizontal::before{ @icon md-border-horizontal; }
.c-icon--border-inner::before{ @icon md-border-inner; }
.c-icon--border-left::before{ @icon md-border-left; }
.c-icon--border-outer::before{ @icon md-border-outer; }
.c-icon--border-right::before{ @icon md-border-right; }
.c-icon--border-style::before{ @icon md-border-style; }
.c-icon--border-top::before{ @icon md-border-top; }
.c-icon--border-vertical::before{ @icon md-border-vertical; }
.c-icon--branding-watermark::before{ @icon md-branding-watermark; }
.c-icon--brightness-1::before{ @icon md-brightness-1; }
.c-icon--brightness-2::before{ @icon md-brightness-2; }
.c-icon--brightness-3::before{ @icon md-brightness-3; }
.c-icon--brightness-4::before{ @icon md-brightness-4; }
.c-icon--brightness-5::before{ @icon md-brightness-5; }
.c-icon--brightness-6::before{ @icon md-brightness-6; }
.c-icon--brightness-7::before{ @icon md-brightness-7; }
.c-icon--brightness-auto::before{ @icon md-brightness-auto; }
.c-icon--brightness-high::before{ @icon md-brightness-high; }
.c-icon--brightness-low::before{ @icon md-brightness-low; }
.c-icon--brightness-medium::before{ @icon md-brightness-medium; }
.c-icon--broken-image::before{ @icon md-broken-image; }
.c-icon--brush::before{ @icon md-brush; }
.c-icon--bubble-chart::before{ @icon md-bubble-chart; }
.c-icon--bug-report::before{ @icon md-bug-report; }
.c-icon--build::before{ @icon md-build; }
.c-icon--burst-mode::before{ @icon md-burst-mode; }
.c-icon--business::before{ @icon md-business; }
.c-icon--business-center::before{ @icon md-business-center; }
.c-icon--cached::before{ @icon md-cached; }
.c-icon--cake::before{ @icon md-cake; }
.c-icon--call::before{ @icon md-call; }
.c-icon--call-end::before{ @icon md-call-end; }
.c-icon--call-made::before{ @icon md-call-made; }
.c-icon--call-merge::before{ @icon md-call-merge; }
.c-icon--call-missed::before{ @icon md-call-missed; }
.c-icon--call-missed-outgoing::before{ @icon md-call-missed-outgoing; }
.c-icon--call-received::before{ @icon md-call-received; }
.c-icon--call-split::before{ @icon md-call-split; }
.c-icon--call-to-action::before{ @icon md-call-to-action; }
.c-icon--camera::before{ @icon md-camera; }
.c-icon--camera-alt::before{ @icon md-camera-alt; }
.c-icon--camera-enhance::before{ @icon md-camera-enhance; }
.c-icon--camera-front::before{ @icon md-camera-front; }
.c-icon--camera-rear::before{ @icon md-camera-rear; }
.c-icon--camera-roll::before{ @icon md-camera-roll; }
.c-icon--cancel::before{ @icon md-cancel; }
.c-icon--card-giftcard::before{ @icon md-card-giftcard; }
.c-icon--card-membership::before{ @icon md-card-membership; }
.c-icon--card-travel::before{ @icon md-card-travel; }
.c-icon--casino::before{ @icon md-casino; }
.c-icon--cast::before{ @icon md-cast; }
.c-icon--cast-connected::before{ @icon md-cast-connected; }
.c-icon--center-focus-strong::before{ @icon md-center-focus-strong; }
.c-icon--center-focus-weak::before{ @icon md-center-focus-weak; }
.c-icon--change-history::before{ @icon md-change-history; }
.c-icon--chat::before{ @icon md-chat; }
.c-icon--chat-bubble::before{ @icon md-chat-bubble; }
.c-icon--chat-bubble-outline::before{ @icon md-chat-bubble-outline; }
.c-icon--check::before{ @icon md-check; }
.c-icon--check-box::before{ @icon md-check-box; }
.c-icon--check-box-outline-blank::before{ @icon md-check-box-outline-blank; }
.c-icon--check-circle::before{ @icon md-check-circle; }
.c-icon--chevron-left::before{ @icon md-chevron-left; }
.c-icon--chevron-right::before{ @icon md-chevron-right; }
.c-icon--child-care::before{ @icon md-child-care; }
.c-icon--child-friendly::before{ @icon md-child-friendly; }
.c-icon--chrome-reader-mode::before{ @icon md-chrome-reader-mode; }
.c-icon--class::before{ @icon md-class; }
.c-icon--clear::before{ @icon md-clear; }
.c-icon--clear-all::before{ @icon md-clear-all; }
.c-icon--close::before{ @icon md-close; }
.c-icon--closed-caption::before{ @icon md-closed-caption; }
.c-icon--cloud::before{ @icon md-cloud; }
.c-icon--cloud-circle::before{ @icon md-cloud-circle; }
.c-icon--cloud-done::before{ @icon md-cloud-done; }
.c-icon--cloud-download::before{ @icon md-cloud-download; }
.c-icon--cloud-off::before{ @icon md-cloud-off; }
.c-icon--cloud-queue::before{ @icon md-cloud-queue; }
.c-icon--cloud-upload::before{ @icon md-cloud-upload; }
.c-icon--code::before{ @icon md-code; }
.c-icon--collections::before{ @icon md-collections; }
.c-icon--collections-bookmark::before{ @icon md-collections-bookmark; }
.c-icon--color-lens::before{ @icon md-color-lens; }
.c-icon--colorize::before{ @icon md-colorize; }
.c-icon--comment::before{ @icon md-comment; }
.c-icon--compare::before{ @icon md-compare; }
.c-icon--compare-arrows::before{ @icon md-compare-arrows; }
.c-icon--computer::before{ @icon md-computer; }
.c-icon--confirmation-number::before{ @icon md-confirmation-number; }
.c-icon--contact-mail::before{ @icon md-contact-mail; }
.c-icon--contact-phone::before{ @icon md-contact-phone; }
.c-icon--contacts::before{ @icon md-contacts; }
.c-icon--content-copy::before{ @icon md-content-copy; }
.c-icon--content-cut::before{ @icon md-content-cut; }
.c-icon--content-paste::before{ @icon md-content-paste; }
.c-icon--control-point::before{ @icon md-control-point; }
.c-icon--control-point-duplicate::before{ @icon md-control-point-duplicate; }
.c-icon--copyright::before{ @icon md-copyright; }
.c-icon--create::before{ @icon md-create; }
.c-icon--create-new-folder::before{ @icon md-create-new-folder; }
.c-icon--credit-card::before{ @icon md-credit-card; }
.c-icon--crop::before{ @icon md-crop; }
.c-icon--crop-16-9::before{ @icon md-crop-16-9; }
.c-icon--crop-3-2::before{ @icon md-crop-3-2; }
.c-icon--crop-5-4::before{ @icon md-crop-5-4; }
.c-icon--crop-7-5::before{ @icon md-crop-7-5; }
.c-icon--crop-din::before{ @icon md-crop-din; }
.c-icon--crop-free::before{ @icon md-crop-free; }
.c-icon--crop-landscape::before{ @icon md-crop-landscape; }
.c-icon--crop-original::before{ @icon md-crop-original; }
.c-icon--crop-portrait::before{ @icon md-crop-portrait; }
.c-icon--crop-rotate::before{ @icon md-crop-rotate; }
.c-icon--crop-square::before{ @icon md-crop-square; }
.c-icon--dashboard::before{ @icon md-dashboard; }
.c-icon--data-usage::before{ @icon md-data-usage; }
.c-icon--date-range::before{ @icon md-date-range; }
.c-icon--dehaze::before{ @icon md-dehaze; }
.c-icon--delete::before{ @icon md-delete; }
.c-icon--delete-forever::before{ @icon md-delete-forever; }
.c-icon--delete-sweep::before{ @icon md-delete-sweep; }
.c-icon--description::before{ @icon md-description; }
.c-icon--desktop-mac::before{ @icon md-desktop-mac; }
.c-icon--desktop-windows::before{ @icon md-desktop-windows; }
.c-icon--details::before{ @icon md-details; }
.c-icon--developer-board::before{ @icon md-developer-board; }
.c-icon--developer-mode::before{ @icon md-developer-mode; }
.c-icon--device-hub::before{ @icon md-device-hub; }
.c-icon--devices::before{ @icon md-devices; }
.c-icon--devices-other::before{ @icon md-devices-other; }
.c-icon--dialer-sip::before{ @icon md-dialer-sip; }
.c-icon--dialpad::before{ @icon md-dialpad; }
.c-icon--directions::before{ @icon md-directions; }
.c-icon--directions-bike::before{ @icon md-directions-bike; }
.c-icon--directions-boat::before{ @icon md-directions-boat; }
.c-icon--directions-bus::before{ @icon md-directions-bus; }
.c-icon--directions-car::before{ @icon md-directions-car; }
.c-icon--directions-railway::before{ @icon md-directions-railway; }
.c-icon--directions-run::before{ @icon md-directions-run; }
.c-icon--directions-subway::before{ @icon md-directions-subway; }
.c-icon--directions-transit::before{ @icon md-directions-transit; }
.c-icon--directions-walk::before{ @icon md-directions-walk; }
.c-icon--disc-full::before{ @icon md-disc-full; }
.c-icon--dns::before{ @icon md-dns; }
.c-icon--do-not-disturb::before{ @icon md-do-not-disturb; }
.c-icon--do-not-disturb-alt::before{ @icon md-do-not-disturb-alt; }
.c-icon--do-not-disturb-off::before{ @icon md-do-not-disturb-off; }
.c-icon--do-not-disturb-on::before{ @icon md-do-not-disturb-on; }
.c-icon--dock::before{ @icon md-dock; }
.c-icon--domain::before{ @icon md-domain; }
.c-icon--done::before{ @icon md-done; }
.c-icon--done-all::before{ @icon md-done-all; }
.c-icon--donut-large::before{ @icon md-donut-large; }
.c-icon--donut-small::before{ @icon md-donut-small; }
.c-icon--drafts::before{ @icon md-drafts; }
.c-icon--drag-handle::before{ @icon md-drag-handle; }
.c-icon--drive-eta::before{ @icon md-drive-eta; }
.c-icon--dvr::before{ @icon md-dvr; }
.c-icon--edit::before{ @icon md-edit; }
.c-icon--edit-location::before{ @icon md-edit-location; }
.c-icon--eject::before{ @icon md-eject; }
.c-icon--email::before{ @icon md-email; }
.c-icon--enhanced-encryption::before{ @icon md-enhanced-encryption; }
.c-icon--equalizer::before{ @icon md-equalizer; }
.c-icon--error::before{ @icon md-error; }
.c-icon--error-outline::before{ @icon md-error-outline; }
.c-icon--euro-symbol::before{ @icon md-euro-symbol; }
.c-icon--ev-station::before{ @icon md-ev-station; }
.c-icon--event::before{ @icon md-event; }
.c-icon--event-available::before{ @icon md-event-available; }
.c-icon--event-busy::before{ @icon md-event-busy; }
.c-icon--event-note::before{ @icon md-event-note; }
.c-icon--event-seat::before{ @icon md-event-seat; }
.c-icon--exit-to-app::before{ @icon md-exit-to-app; }
.c-icon--expand-less::before{ @icon md-expand-less; }
.c-icon--expand-more::before{ @icon md-expand-more; }
.c-icon--explicit::before{ @icon md-explicit; }
.c-icon--explore::before{ @icon md-explore; }
.c-icon--exposure::before{ @icon md-exposure; }
.c-icon--exposure-neg-1::before{ @icon md-exposure-neg-1; }
.c-icon--exposure-neg-2::before{ @icon md-exposure-neg-2; }
.c-icon--exposure-plus-1::before{ @icon md-exposure-plus-1; }
.c-icon--exposure-plus-2::before{ @icon md-exposure-plus-2; }
.c-icon--exposure-zero::before{ @icon md-exposure-zero; }
.c-icon--extension::before{ @icon md-extension; }
.c-icon--face::before{ @icon md-face; }
.c-icon--fast-forward::before{ @icon md-fast-forward; }
.c-icon--fast-rewind::before{ @icon md-fast-rewind; }
.c-icon--favorite::before{ @icon md-favorite; }
.c-icon--favorite-border::before{ @icon md-favorite-border; }
.c-icon--featured-play-list::before{ @icon md-featured-play-list; }
.c-icon--featured-video::before{ @icon md-featured-video; }
.c-icon--feedback::before{ @icon md-feedback; }
.c-icon--fiber-dvr::before{ @icon md-fiber-dvr; }
.c-icon--fiber-manual-record::before{ @icon md-fiber-manual-record; }
.c-icon--fiber-new::before{ @icon md-fiber-new; }
.c-icon--fiber-pin::before{ @icon md-fiber-pin; }
.c-icon--fiber-smart-record::before{ @icon md-fiber-smart-record; }
.c-icon--file-download::before{ @icon md-file-download; }
.c-icon--file-upload::before{ @icon md-file-upload; }
.c-icon--filter::before{ @icon md-filter; }
.c-icon--filter-1::before{ @icon md-filter-1; }
.c-icon--filter-2::before{ @icon md-filter-2; }
.c-icon--filter-3::before{ @icon md-filter-3; }
.c-icon--filter-4::before{ @icon md-filter-4; }
.c-icon--filter-5::before{ @icon md-filter-5; }
.c-icon--filter-6::before{ @icon md-filter-6; }
.c-icon--filter-7::before{ @icon md-filter-7; }
.c-icon--filter-8::before{ @icon md-filter-8; }
.c-icon--filter-9::before{ @icon md-filter-9; }
.c-icon--filter-9-plus::before{ @icon md-filter-9-plus; }
.c-icon--filter-b-and-w::before{ @icon md-filter-b-and-w; }
.c-icon--filter-center-focus::before{ @icon md-filter-center-focus; }
.c-icon--filter-drama::before{ @icon md-filter-drama; }
.c-icon--filter-frames::before{ @icon md-filter-frames; }
.c-icon--filter-hdr::before{ @icon md-filter-hdr; }
.c-icon--filter-list::before{ @icon md-filter-list; }
.c-icon--filter-none::before{ @icon md-filter-none; }
.c-icon--filter-tilt-shift::before{ @icon md-filter-tilt-shift; }
.c-icon--filter-vintage::before{ @icon md-filter-vintage; }
.c-icon--find-in-page::before{ @icon md-find-in-page; }
.c-icon--find-replace::before{ @icon md-find-replace; }
.c-icon--fingerprint::before{ @icon md-fingerprint; }
.c-icon--first-page::before{ @icon md-first-page; }
.c-icon--fitness-center::before{ @icon md-fitness-center; }
.c-icon--flag::before{ @icon md-flag; }
.c-icon--flare::before{ @icon md-flare; }
.c-icon--flash-auto::before{ @icon md-flash-auto; }
.c-icon--flash-off::before{ @icon md-flash-off; }
.c-icon--flash-on::before{ @icon md-flash-on; }
.c-icon--flight::before{ @icon md-flight; }
.c-icon--flight-land::before{ @icon md-flight-land; }
.c-icon--flight-takeoff::before{ @icon md-flight-takeoff; }
.c-icon--flip::before{ @icon md-flip; }
.c-icon--flip-to-back::before{ @icon md-flip-to-back; }
.c-icon--flip-to-front::before{ @icon md-flip-to-front; }
.c-icon--folder::before{ @icon md-folder; }
.c-icon--folder-open::before{ @icon md-folder-open; }
.c-icon--folder-shared::before{ @icon md-folder-shared; }
.c-icon--folder-special::before{ @icon md-folder-special; }
.c-icon--font-download::before{ @icon md-font-download; }
.c-icon--format-align-center::before{ @icon md-format-align-center; }
.c-icon--format-align-justify::before{ @icon md-format-align-justify; }
.c-icon--format-align-left::before{ @icon md-format-align-left; }
.c-icon--format-align-right::before{ @icon md-format-align-right; }
.c-icon--format-bold::before{ @icon md-format-bold; }
.c-icon--format-clear::before{ @icon md-format-clear; }
.c-icon--format-color-fill::before{ @icon md-format-color-fill; }
.c-icon--format-color-reset::before{ @icon md-format-color-reset; }
.c-icon--format-color-text::before{ @icon md-format-color-text; }
.c-icon--format-indent-decrease::before{ @icon md-format-indent-decrease; }
.c-icon--format-indent-increase::before{ @icon md-format-indent-increase; }
.c-icon--format-italic::before{ @icon md-format-italic; }
.c-icon--format-line-spacing::before{ @icon md-format-line-spacing; }
.c-icon--format-list-bulleted::before{ @icon md-format-list-bulleted; }
.c-icon--format-list-numbered::before{ @icon md-format-list-numbered; }
.c-icon--format-paint::before{ @icon md-format-paint; }
.c-icon--format-quote::before{ @icon md-format-quote; }
.c-icon--format-shapes::before{ @icon md-format-shapes; }
.c-icon--format-size::before{ @icon md-format-size; }
.c-icon--format-strikethrough::before{ @icon md-format-strikethrough; }
.c-icon--format-textdirection-l-to-r::before{ @icon md-format-textdirection-l-to-r; }
.c-icon--format-textdirection-r-to-l::before{ @icon md-format-textdirection-r-to-l; }
.c-icon--format-underlined::before{ @icon md-format-underlined; }
.c-icon--forum::before{ @icon md-forum; }
.c-icon--forward::before{ @icon md-forward; }
.c-icon--forward-10::before{ @icon md-forward-10; }
.c-icon--forward-30::before{ @icon md-forward-30; }
.c-icon--forward-5::before{ @icon md-forward-5; }
.c-icon--free-breakfast::before{ @icon md-free-breakfast; }
.c-icon--fullscreen::before{ @icon md-fullscreen; }
.c-icon--fullscreen-exit::before{ @icon md-fullscreen-exit; }
.c-icon--functions::before{ @icon md-functions; }
.c-icon--g-translate::before{ @icon md-g-translate; }
.c-icon--gamepad::before{ @icon md-gamepad; }
.c-icon--games::before{ @icon md-games; }
.c-icon--gavel::before{ @icon md-gavel; }
.c-icon--gesture::before{ @icon md-gesture; }
.c-icon--get-app::before{ @icon md-get-app; }
.c-icon--gif::before{ @icon md-gif; }
.c-icon--golf-course::before{ @icon md-golf-course; }
.c-icon--gps-fixed::before{ @icon md-gps-fixed; }
.c-icon--gps-not-fixed::before{ @icon md-gps-not-fixed; }
.c-icon--gps-off::before{ @icon md-gps-off; }
.c-icon--grade::before{ @icon md-grade; }
.c-icon--gradient::before{ @icon md-gradient; }
.c-icon--grain::before{ @icon md-grain; }
.c-icon--graphic-eq::before{ @icon md-graphic-eq; }
.c-icon--grid-off::before{ @icon md-grid-off; }
.c-icon--grid-on::before{ @icon md-grid-on; }
.c-icon--group::before{ @icon md-group; }
.c-icon--group-add::before{ @icon md-group-add; }
.c-icon--group-work::before{ @icon md-group-work; }
.c-icon--hd::before{ @icon md-hd; }
.c-icon--hdr-off::before{ @icon md-hdr-off; }
.c-icon--hdr-on::before{ @icon md-hdr-on; }
.c-icon--hdr-strong::before{ @icon md-hdr-strong; }
.c-icon--hdr-weak::before{ @icon md-hdr-weak; }
.c-icon--headset::before{ @icon md-headset; }
.c-icon--headset-mic::before{ @icon md-headset-mic; }
.c-icon--healing::before{ @icon md-healing; }
.c-icon--hearing::before{ @icon md-hearing; }
.c-icon--help::before{ @icon md-help; }
.c-icon--help-outline::before{ @icon md-help-outline; }
.c-icon--high-quality::before{ @icon md-high-quality; }
.c-icon--highlight::before{ @icon md-highlight; }
.c-icon--highlight-off::before{ @icon md-highlight-off; }
.c-icon--history::before{ @icon md-history; }
.c-icon--home::before{ @icon md-home; }
.c-icon--hot-tub::before{ @icon md-hot-tub; }
.c-icon--hotel::before{ @icon md-hotel; }
.c-icon--hourglass-empty::before{ @icon md-hourglass-empty; }
.c-icon--hourglass-full::before{ @icon md-hourglass-full; }
.c-icon--http::before{ @icon md-http; }
.c-icon--https::before{ @icon md-https; }
.c-icon--image::before{ @icon md-image; }
.c-icon--image-aspect-ratio::before{ @icon md-image-aspect-ratio; }
.c-icon--import-contacts::before{ @icon md-import-contacts; }
.c-icon--import-export::before{ @icon md-import-export; }
.c-icon--important-devices::before{ @icon md-important-devices; }
.c-icon--inbox::before{ @icon md-inbox; }
.c-icon--indeterminate-check-box::before{ @icon md-indeterminate-check-box; }
.c-icon--info::before{ @icon md-info; }
.c-icon--info-outline::before{ @icon md-info-outline; }
.c-icon--input::before{ @icon md-input; }
.c-icon--insert-chart::before{ @icon md-insert-chart; }
.c-icon--insert-comment::before{ @icon md-insert-comment; }
.c-icon--insert-drive-file::before{ @icon md-insert-drive-file; }
.c-icon--insert-emoticon::before{ @icon md-insert-emoticon; }
.c-icon--insert-invitation::before{ @icon md-insert-invitation; }
.c-icon--insert-link::before{ @icon md-insert-link; }
.c-icon--insert-photo::before{ @icon md-insert-photo; }
.c-icon--invert-colors::before{ @icon md-invert-colors; }
.c-icon--invert-colors-off::before{ @icon md-invert-colors-off; }
.c-icon--iso::before{ @icon md-iso; }
.c-icon--keyboard::before{ @icon md-keyboard; }
.c-icon--keyboard-arrow-down::before{ @icon md-keyboard-arrow-down; }
.c-icon--keyboard-arrow-left::before{ @icon md-keyboard-arrow-left; }
.c-icon--keyboard-arrow-right::before{ @icon md-keyboard-arrow-right; }
.c-icon--keyboard-arrow-up::before{ @icon md-keyboard-arrow-up; }
.c-icon--keyboard-backspace::before{ @icon md-keyboard-backspace; }
.c-icon--keyboard-capslock::before{ @icon md-keyboard-capslock; }
.c-icon--keyboard-hide::before{ @icon md-keyboard-hide; }
.c-icon--keyboard-return::before{ @icon md-keyboard-return; }
.c-icon--keyboard-tab::before{ @icon md-keyboard-tab; }
.c-icon--keyboard-voice::before{ @icon md-keyboard-voice; }
.c-icon--kitchen::before{ @icon md-kitchen; }
.c-icon--label::before{ @icon md-label; }
.c-icon--label-outline::before{ @icon md-label-outline; }
.c-icon--landscape::before{ @icon md-landscape; }
.c-icon--language::before{ @icon md-language; }
.c-icon--laptop::before{ @icon md-laptop; }
.c-icon--laptop-chromebook::before{ @icon md-laptop-chromebook; }
.c-icon--laptop-mac::before{ @icon md-laptop-mac; }
.c-icon--laptop-windows::before{ @icon md-laptop-windows; }
.c-icon--last-page::before{ @icon md-last-page; }
.c-icon--launch::before{ @icon md-launch; }
.c-icon--layers::before{ @icon md-layers; }
.c-icon--layers-clear::before{ @icon md-layers-clear; }
.c-icon--leak-add::before{ @icon md-leak-add; }
.c-icon--leak-remove::before{ @icon md-leak-remove; }
.c-icon--lens::before{ @icon md-lens; }
.c-icon--library-add::before{ @icon md-library-add; }
.c-icon--library-books::before{ @icon md-library-books; }
.c-icon--library-music::before{ @icon md-library-music; }
.c-icon--lightbulb-outline::before{ @icon md-lightbulb-outline; }
.c-icon--line-style::before{ @icon md-line-style; }
.c-icon--line-weight::before{ @icon md-line-weight; }
.c-icon--linear-scale::before{ @icon md-linear-scale; }
.c-icon--link::before{ @icon md-link; }
.c-icon--linked-camera::before{ @icon md-linked-camera; }
.c-icon--list::before{ @icon md-list; }
.c-icon--live-help::before{ @icon md-live-help; }
.c-icon--live-tv::before{ @icon md-live-tv; }
.c-icon--local-activity::before{ @icon md-local-activity; }
.c-icon--local-airport::before{ @icon md-local-airport; }
.c-icon--local-atm::before{ @icon md-local-atm; }
.c-icon--local-bar::before{ @icon md-local-bar; }
.c-icon--local-cafe::before{ @icon md-local-cafe; }
.c-icon--local-car-wash::before{ @icon md-local-car-wash; }
.c-icon--local-convenience-store::before{ @icon md-local-convenience-store; }
.c-icon--local-dining::before{ @icon md-local-dining; }
.c-icon--local-drink::before{ @icon md-local-drink; }
.c-icon--local-florist::before{ @icon md-local-florist; }
.c-icon--local-gas-station::before{ @icon md-local-gas-station; }
.c-icon--local-grocery-store::before{ @icon md-local-grocery-store; }
.c-icon--local-hospital::before{ @icon md-local-hospital; }
.c-icon--local-hotel::before{ @icon md-local-hotel; }
.c-icon--local-laundry-service::before{ @icon md-local-laundry-service; }
.c-icon--local-library::before{ @icon md-local-library; }
.c-icon--local-mall::before{ @icon md-local-mall; }
.c-icon--local-movies::before{ @icon md-local-movies; }
.c-icon--local-offer::before{ @icon md-local-offer; }
.c-icon--local-parking::before{ @icon md-local-parking; }
.c-icon--local-pharmacy::before{ @icon md-local-pharmacy; }
.c-icon--local-phone::before{ @icon md-local-phone; }
.c-icon--local-pizza::before{ @icon md-local-pizza; }
.c-icon--local-play::before{ @icon md-local-play; }
.c-icon--local-post-office::before{ @icon md-local-post-office; }
.c-icon--local-printshop::before{ @icon md-local-printshop; }
.c-icon--local-see::before{ @icon md-local-see; }
.c-icon--local-shipping::before{ @icon md-local-shipping; }
.c-icon--local-taxi::before{ @icon md-local-taxi; }
.c-icon--location-city::before{ @icon md-location-city; }
.c-icon--location-disabled::before{ @icon md-location-disabled; }
.c-icon--location-off::before{ @icon md-location-off; }
.c-icon--location-on::before{ @icon md-location-on; }
.c-icon--location-searching::before{ @icon md-location-searching; }
.c-icon--lock::before{ @icon md-lock; }
.c-icon--lock-open::before{ @icon md-lock-open; }
.c-icon--lock-outline::before{ @icon md-lock-outline; }
.c-icon--looks::before{ @icon md-looks; }
.c-icon--looks-3::before{ @icon md-looks-3; }
.c-icon--looks-4::before{ @icon md-looks-4; }
.c-icon--looks-5::before{ @icon md-looks-5; }
.c-icon--looks-6::before{ @icon md-looks-6; }
.c-icon--looks-one::before{ @icon md-looks-one; }
.c-icon--looks-two::before{ @icon md-looks-two; }
.c-icon--loop::before{ @icon md-loop; }
.c-icon--loupe::before{ @icon md-loupe; }
.c-icon--low-priority::before{ @icon md-low-priority; }
.c-icon--loyalty::before{ @icon md-loyalty; }
.c-icon--mail::before{ @icon md-mail; }
.c-icon--mail-outline::before{ @icon md-mail-outline; }
.c-icon--map::before{ @icon md-map; }
.c-icon--markunread::before{ @icon md-markunread; }
.c-icon--markunread-mailbox::before{ @icon md-markunread-mailbox; }
.c-icon--memory::before{ @icon md-memory; }
.c-icon--menu::before{ @icon md-menu; }
.c-icon--merge-type::before{ @icon md-merge-type; }
.c-icon--message::before{ @icon md-message; }
.c-icon--mic::before{ @icon md-mic; }
.c-icon--mic-none::before{ @icon md-mic-none; }
.c-icon--mic-off::before{ @icon md-mic-off; }
.c-icon--mms::before{ @icon md-mms; }
.c-icon--mode-comment::before{ @icon md-mode-comment; }
.c-icon--mode-edit::before{ @icon md-mode-edit; }
.c-icon--monetization-on::before{ @icon md-monetization-on; }
.c-icon--money-off::before{ @icon md-money-off; }
.c-icon--monochrome-photos::before{ @icon md-monochrome-photos; }
.c-icon--mood::before{ @icon md-mood; }
.c-icon--mood-bad::before{ @icon md-mood-bad; }
.c-icon--more::before{ @icon md-more; }
.c-icon--more-horiz::before{ @icon md-more-horiz; }
.c-icon--more-vert::before{ @icon md-more-vert; }
.c-icon--motorcycle::before{ @icon md-motorcycle; }
.c-icon--mouse::before{ @icon md-mouse; }
.c-icon--move-to-inbox::before{ @icon md-move-to-inbox; }
.c-icon--movie::before{ @icon md-movie; }
.c-icon--movie-creation::before{ @icon md-movie-creation; }
.c-icon--movie-filter::before{ @icon md-movie-filter; }
.c-icon--multiline-chart::before{ @icon md-multiline-chart; }
.c-icon--music-note::before{ @icon md-music-note; }
.c-icon--music-video::before{ @icon md-music-video; }
.c-icon--my-location::before{ @icon md-my-location; }
.c-icon--nature::before{ @icon md-nature; }
.c-icon--nature-people::before{ @icon md-nature-people; }
.c-icon--navigate-before::before{ @icon md-navigate-before; }
.c-icon--navigate-next::before{ @icon md-navigate-next; }
.c-icon--navigation::before{ @icon md-navigation; }
.c-icon--near-me::before{ @icon md-near-me; }
.c-icon--network-cell::before{ @icon md-network-cell; }
.c-icon--network-check::before{ @icon md-network-check; }
.c-icon--network-locked::before{ @icon md-network-locked; }
.c-icon--network-wifi::before{ @icon md-network-wifi; }
.c-icon--new-releases::before{ @icon md-new-releases; }
.c-icon--next-week::before{ @icon md-next-week; }
.c-icon--nfc::before{ @icon md-nfc; }
.c-icon--no-encryption::before{ @icon md-no-encryption; }
.c-icon--no-sim::before{ @icon md-no-sim; }
.c-icon--not-interested::before{ @icon md-not-interested; }
.c-icon--note::before{ @icon md-note; }
.c-icon--note-add::before{ @icon md-note-add; }
.c-icon--notifications::before{ @icon md-notifications; }
.c-icon--notifications-active::before{ @icon md-notifications-active; }
.c-icon--notifications-none::before{ @icon md-notifications-none; }
.c-icon--notifications-off::before{ @icon md-notifications-off; }
.c-icon--notifications-paused::before{ @icon md-notifications-paused; }
.c-icon--offline-pin::before{ @icon md-offline-pin; }
.c-icon--ondemand-video::before{ @icon md-ondemand-video; }
.c-icon--opacity::before{ @icon md-opacity; }
.c-icon--open-in-browser::before{ @icon md-open-in-browser; }
.c-icon--open-in-new::before{ @icon md-open-in-new; }
.c-icon--open-with::before{ @icon md-open-with; }
.c-icon--pages::before{ @icon md-pages; }
.c-icon--pageview::before{ @icon md-pageview; }
.c-icon--palette::before{ @icon md-palette; }
.c-icon--pan-tool::before{ @icon md-pan-tool; }
.c-icon--panorama::before{ @icon md-panorama; }
.c-icon--panorama-fish-eye::before{ @icon md-panorama-fish-eye; }
.c-icon--panorama-horizontal::before{ @icon md-panorama-horizontal; }
.c-icon--panorama-vertical::before{ @icon md-panorama-vertical; }
.c-icon--panorama-wide-angle::before{ @icon md-panorama-wide-angle; }
.c-icon--party-mode::before{ @icon md-party-mode; }
.c-icon--pause::before{ @icon md-pause; }
.c-icon--pause-circle-filled::before{ @icon md-pause-circle-filled; }
.c-icon--pause-circle-outline::before{ @icon md-pause-circle-outline; }
.c-icon--payment::before{ @icon md-payment; }
.c-icon--people::before{ @icon md-people; }
.c-icon--people-outline::before{ @icon md-people-outline; }
.c-icon--perm-camera-mic::before{ @icon md-perm-camera-mic; }
.c-icon--perm-contact-calendar::before{ @icon md-perm-contact-calendar; }
.c-icon--perm-data-setting::before{ @icon md-perm-data-setting; }
.c-icon--perm-device-information::before{ @icon md-perm-device-information; }
.c-icon--perm-identity::before{ @icon md-perm-identity; }
.c-icon--perm-media::before{ @icon md-perm-media; }
.c-icon--perm-phone-msg::before{ @icon md-perm-phone-msg; }
.c-icon--perm-scan-wifi::before{ @icon md-perm-scan-wifi; }
.c-icon--person::before{ @icon md-person; }
.c-icon--person-add::before{ @icon md-person-add; }
.c-icon--person-outline::before{ @icon md-person-outline; }
.c-icon--person-pin::before{ @icon md-person-pin; }
.c-icon--person-pin-circle::before{ @icon md-person-pin-circle; }
.c-icon--personal-video::before{ @icon md-personal-video; }
.c-icon--pets::before{ @icon md-pets; }
.c-icon--phone::before{ @icon md-phone; }
.c-icon--phone-android::before{ @icon md-phone-android; }
.c-icon--phone-bluetooth-speaker::before{ @icon md-phone-bluetooth-speaker; }
.c-icon--phone-forwarded::before{ @icon md-phone-forwarded; }
.c-icon--phone-in-talk::before{ @icon md-phone-in-talk; }
.c-icon--phone-iphone::before{ @icon md-phone-iphone; }
.c-icon--phone-locked::before{ @icon md-phone-locked; }
.c-icon--phone-missed::before{ @icon md-phone-missed; }
.c-icon--phone-paused::before{ @icon md-phone-paused; }
.c-icon--phonelink::before{ @icon md-phonelink; }
.c-icon--phonelink-erase::before{ @icon md-phonelink-erase; }
.c-icon--phonelink-lock::before{ @icon md-phonelink-lock; }
.c-icon--phonelink-off::before{ @icon md-phonelink-off; }
.c-icon--phonelink-ring::before{ @icon md-phonelink-ring; }
.c-icon--phonelink-setup::before{ @icon md-phonelink-setup; }
.c-icon--photo::before{ @icon md-photo; }
.c-icon--photo-album::before{ @icon md-photo-album; }
.c-icon--photo-camera::before{ @icon md-photo-camera; }
.c-icon--photo-filter::before{ @icon md-photo-filter; }
.c-icon--photo-library::before{ @icon md-photo-library; }
.c-icon--photo-size-select-actual::before{ @icon md-photo-size-select-actual; }
.c-icon--photo-size-select-large::before{ @icon md-photo-size-select-large; }
.c-icon--photo-size-select-small::before{ @icon md-photo-size-select-small; }
.c-icon--picture-as-pdf::before{ @icon md-picture-as-pdf; }
.c-icon--picture-in-picture::before{ @icon md-picture-in-picture; }
.c-icon--picture-in-picture-alt::before{ @icon md-picture-in-picture-alt; }
.c-icon--pie-chart::before{ @icon md-pie-chart; }
.c-icon--pie-chart-outlined::before{ @icon md-pie-chart-outlined; }
.c-icon--pin-drop::before{ @icon md-pin-drop; }
.c-icon--place::before{ @icon md-place; }
.c-icon--play-arrow::before{ @icon md-play-arrow; }
.c-icon--play-circle-filled::before{ @icon md-play-circle-filled; }
.c-icon--play-circle-outline::before{ @icon md-play-circle-outline; }
.c-icon--play-for-work::before{ @icon md-play-for-work; }
.c-icon--playlist-add::before{ @icon md-playlist-add; }
.c-icon--playlist-add-check::before{ @icon md-playlist-add-check; }
.c-icon--playlist-play::before{ @icon md-playlist-play; }
.c-icon--plus-one::before{ @icon md-plus-one; }
.c-icon--poll::before{ @icon md-poll; }
.c-icon--polymer::before{ @icon md-polymer; }
.c-icon--pool::before{ @icon md-pool; }
.c-icon--portable-wifi-off::before{ @icon md-portable-wifi-off; }
.c-icon--portrait::before{ @icon md-portrait; }
.c-icon--power::before{ @icon md-power; }
.c-icon--power-input::before{ @icon md-power-input; }
.c-icon--power-settings-new::before{ @icon md-power-settings-new; }
.c-icon--pregnant-woman::before{ @icon md-pregnant-woman; }
.c-icon--present-to-all::before{ @icon md-present-to-all; }
.c-icon--print::before{ @icon md-print; }
.c-icon--priority-high::before{ @icon md-priority-high; }
.c-icon--public::before{ @icon md-public; }
.c-icon--publish::before{ @icon md-publish; }
.c-icon--query-builder::before{ @icon md-query-builder; }
.c-icon--question-answer::before{ @icon md-question-answer; }
.c-icon--queue::before{ @icon md-queue; }
.c-icon--queue-music::before{ @icon md-queue-music; }
.c-icon--queue-play-next::before{ @icon md-queue-play-next; }
.c-icon--radio::before{ @icon md-radio; }
.c-icon--radio-button-checked::before{ @icon md-radio-button-checked; }
.c-icon--radio-button-unchecked::before{ @icon md-radio-button-unchecked; }
.c-icon--rate-review::before{ @icon md-rate-review; }
.c-icon--receipt::before{ @icon md-receipt; }
.c-icon--recent-actors::before{ @icon md-recent-actors; }
.c-icon--record-voice-over::before{ @icon md-record-voice-over; }
.c-icon--redeem::before{ @icon md-redeem; }
.c-icon--redo::before{ @icon md-redo; }
.c-icon--refresh::before{ @icon md-refresh; }
.c-icon--remove::before{ @icon md-remove; }
.c-icon--remove-circle::before{ @icon md-remove-circle; }
.c-icon--remove-circle-outline::before{ @icon md-remove-circle-outline; }
.c-icon--remove-from-queue::before{ @icon md-remove-from-queue; }
.c-icon--remove-red-eye::before{ @icon md-remove-red-eye; }
.c-icon--remove-shopping-cart::before{ @icon md-remove-shopping-cart; }
.c-icon--reorder::before{ @icon md-reorder; }
.c-icon--repeat::before{ @icon md-repeat; }
.c-icon--repeat-one::before{ @icon md-repeat-one; }
.c-icon--replay::before{ @icon md-replay; }
.c-icon--replay-10::before{ @icon md-replay-10; }
.c-icon--replay-30::before{ @icon md-replay-30; }
.c-icon--replay-5::before{ @icon md-replay-5; }
.c-icon--reply::before{ @icon md-reply; }
.c-icon--reply-all::before{ @icon md-reply-all; }
.c-icon--report::before{ @icon md-report; }
.c-icon--report-problem::before{ @icon md-report-problem; }
.c-icon--restaurant::before{ @icon md-restaurant; }
.c-icon--restaurant-menu::before{ @icon md-restaurant-menu; }
.c-icon--restore::before{ @icon md-restore; }
.c-icon--restore-page::before{ @icon md-restore-page; }
.c-icon--ring-volume::before{ @icon md-ring-volume; }
.c-icon--room::before{ @icon md-room; }
.c-icon--room-service::before{ @icon md-room-service; }
.c-icon--rotate-90-degrees-ccw::before{ @icon md-rotate-90-degrees-ccw; }
.c-icon--rotate-left::before{ @icon md-rotate-left; }
.c-icon--rotate-right::before{ @icon md-rotate-right; }
.c-icon--rounded-corner::before{ @icon md-rounded-corner; }
.c-icon--router::before{ @icon md-router; }
.c-icon--rowing::before{ @icon md-rowing; }
.c-icon--rss-feed::before{ @icon md-rss-feed; }
.c-icon--rv-hookup::before{ @icon md-rv-hookup; }
.c-icon--satellite::before{ @icon md-satellite; }
.c-icon--save::before{ @icon md-save; }
.c-icon--scanner::before{ @icon md-scanner; }
.c-icon--schedule::before{ @icon md-schedule; }
.c-icon--school::before{ @icon md-school; }
.c-icon--screen-lock-landscape::before{ @icon md-screen-lock-landscape; }
.c-icon--screen-lock-portrait::before{ @icon md-screen-lock-portrait; }
.c-icon--screen-lock-rotation::before{ @icon md-screen-lock-rotation; }
.c-icon--screen-rotation::before{ @icon md-screen-rotation; }
.c-icon--screen-share::before{ @icon md-screen-share; }
.c-icon--sd-card::before{ @icon md-sd-card; }
.c-icon--sd-storage::before{ @icon md-sd-storage; }
.c-icon--search::before{ @icon md-search; }
.c-icon--security::before{ @icon md-security; }
.c-icon--select-all::before{ @icon md-select-all; }
.c-icon--send::before{ @icon md-send; }
.c-icon--sentiment-dissatisfied::before{ @icon md-sentiment-dissatisfied; }
.c-icon--sentiment-neutral::before{ @icon md-sentiment-neutral; }
.c-icon--sentiment-satisfied::before{ @icon md-sentiment-satisfied; }
.c-icon--sentiment-very-dissatisfied::before{ @icon md-sentiment-very-dissatisfied; }
.c-icon--sentiment-very-satisfied::before{ @icon md-sentiment-very-satisfied; }
.c-icon--settings::before{ @icon md-settings; }
.c-icon--settings-applications::before{ @icon md-settings-applications; }
.c-icon--settings-backup-restore::before{ @icon md-settings-backup-restore; }
.c-icon--settings-bluetooth::before{ @icon md-settings-bluetooth; }
.c-icon--settings-brightness::before{ @icon md-settings-brightness; }
.c-icon--settings-cell::before{ @icon md-settings-cell; }
.c-icon--settings-ethernet::before{ @icon md-settings-ethernet; }
.c-icon--settings-input-antenna::before{ @icon md-settings-input-antenna; }
.c-icon--settings-input-component::before{ @icon md-settings-input-component; }
.c-icon--settings-input-composite::before{ @icon md-settings-input-composite; }
.c-icon--settings-input-hdmi::before{ @icon md-settings-input-hdmi; }
.c-icon--settings-input-svideo::before{ @icon md-settings-input-svideo; }
.c-icon--settings-overscan::before{ @icon md-settings-overscan; }
.c-icon--settings-phone::before{ @icon md-settings-phone; }
.c-icon--settings-power::before{ @icon md-settings-power; }
.c-icon--settings-remote::before{ @icon md-settings-remote; }
.c-icon--settings-system-daydream::before{ @icon md-settings-system-daydream; }
.c-icon--settings-voice::before{ @icon md-settings-voice; }
.c-icon--share::before{ @icon md-share; }
.c-icon--shop::before{ @icon md-shop; }
.c-icon--shop-two::before{ @icon md-shop-two; }
.c-icon--shopping-basket::before{ @icon md-shopping-basket; }
.c-icon--shopping-cart::before{ @icon md-shopping-cart; }
.c-icon--short-text::before{ @icon md-short-text; }
.c-icon--show-chart::before{ @icon md-show-chart; }
.c-icon--shuffle::before{ @icon md-shuffle; }
.c-icon--signal-cellular-4-bar::before{ @icon md-signal-cellular-4-bar; }
.c-icon--signal-cellular-connected-no-internet-4-bar::before{ @icon md-signal-cellular-connected-no-internet-4-bar; }
.c-icon--signal-cellular-no-sim::before{ @icon md-signal-cellular-no-sim; }
.c-icon--signal-cellular-null::before{ @icon md-signal-cellular-null; }
.c-icon--signal-cellular-off::before{ @icon md-signal-cellular-off; }
.c-icon--signal-wifi-4-bar::before{ @icon md-signal-wifi-4-bar; }
.c-icon--signal-wifi-4-bar-lock::before{ @icon md-signal-wifi-4-bar-lock; }
.c-icon--signal-wifi-off::before{ @icon md-signal-wifi-off; }
.c-icon--sim-card::before{ @icon md-sim-card; }
.c-icon--sim-card-alert::before{ @icon md-sim-card-alert; }
.c-icon--skip-next::before{ @icon md-skip-next; }
.c-icon--skip-previous::before{ @icon md-skip-previous; }
.c-icon--slideshow::before{ @icon md-slideshow; }
.c-icon--slow-motion-video::before{ @icon md-slow-motion-video; }
.c-icon--smartphone::before{ @icon md-smartphone; }
.c-icon--smoke-free::before{ @icon md-smoke-free; }
.c-icon--smoking-rooms::before{ @icon md-smoking-rooms; }
.c-icon--sms::before{ @icon md-sms; }
.c-icon--sms-failed::before{ @icon md-sms-failed; }
.c-icon--snooze::before{ @icon md-snooze; }
.c-icon--sort::before{ @icon md-sort; }
.c-icon--sort-by-alpha::before{ @icon md-sort-by-alpha; }
.c-icon--spa::before{ @icon md-spa; }
.c-icon--space-bar::before{ @icon md-space-bar; }
.c-icon--speaker::before{ @icon md-speaker; }
.c-icon--speaker-group::before{ @icon md-speaker-group; }
.c-icon--speaker-notes::before{ @icon md-speaker-notes; }
.c-icon--speaker-notes-off::before{ @icon md-speaker-notes-off; }
.c-icon--speaker-phone::before{ @icon md-speaker-phone; }
.c-icon--spellcheck::before{ @icon md-spellcheck; }
.c-icon--star::before{ @icon md-star; }
.c-icon--star-border::before{ @icon md-star-border; }
.c-icon--star-half::before{ @icon md-star-half; }
.c-icon--stars::before{ @icon md-stars; }
.c-icon--stay-current-landscape::before{ @icon md-stay-current-landscape; }
.c-icon--stay-current-portrait::before{ @icon md-stay-current-portrait; }
.c-icon--stay-primary-landscape::before{ @icon md-stay-primary-landscape; }
.c-icon--stay-primary-portrait::before{ @icon md-stay-primary-portrait; }
.c-icon--stop::before{ @icon md-stop; }
.c-icon--stop-screen-share::before{ @icon md-stop-screen-share; }
.c-icon--storage::before{ @icon md-storage; }
.c-icon--store::before{ @icon md-store; }
.c-icon--store-mall-directory::before{ @icon md-store-mall-directory; }
.c-icon--straighten::before{ @icon md-straighten; }
.c-icon--streetview::before{ @icon md-streetview; }
.c-icon--strikethrough-s::before{ @icon md-strikethrough-s; }
.c-icon--style::before{ @icon md-style; }
.c-icon--subdirectory-arrow-left::before{ @icon md-subdirectory-arrow-left; }
.c-icon--subdirectory-arrow-right::before{ @icon md-subdirectory-arrow-right; }
.c-icon--subject::before{ @icon md-subject; }
.c-icon--subscriptions::before{ @icon md-subscriptions; }
.c-icon--subtitles::before{ @icon md-subtitles; }
.c-icon--subway::before{ @icon md-subway; }
.c-icon--supervisor-account::before{ @icon md-supervisor-account; }
.c-icon--surround-sound::before{ @icon md-surround-sound; }
.c-icon--swap-calls::before{ @icon md-swap-calls; }
.c-icon--swap-horiz::before{ @icon md-swap-horiz; }
.c-icon--swap-vert::before{ @icon md-swap-vert; }
.c-icon--swap-vertical-circle::before{ @icon md-swap-vertical-circle; }
.c-icon--switch-camera::before{ @icon md-switch-camera; }
.c-icon--switch-video::before{ @icon md-switch-video; }
.c-icon--sync::before{ @icon md-sync; }
.c-icon--sync-disabled::before{ @icon md-sync-disabled; }
.c-icon--sync-problem::before{ @icon md-sync-problem; }
.c-icon--system-update::before{ @icon md-system-update; }
.c-icon--system-update-alt::before{ @icon md-system-update-alt; }
.c-icon--tab::before{ @icon md-tab; }
.c-icon--tab-unselected::before{ @icon md-tab-unselected; }
.c-icon--tablet::before{ @icon md-tablet; }
.c-icon--tablet-android::before{ @icon md-tablet-android; }
.c-icon--tablet-mac::before{ @icon md-tablet-mac; }
.c-icon--tag-faces::before{ @icon md-tag-faces; }
.c-icon--tap-and-play::before{ @icon md-tap-and-play; }
.c-icon--terrain::before{ @icon md-terrain; }
.c-icon--text-fields::before{ @icon md-text-fields; }
.c-icon--text-format::before{ @icon md-text-format; }
.c-icon--textsms::before{ @icon md-textsms; }
.c-icon--texture::before{ @icon md-texture; }
.c-icon--theaters::before{ @icon md-theaters; }
.c-icon--thumb-down::before{ @icon md-thumb-down; }
.c-icon--thumb-up::before{ @icon md-thumb-up; }
.c-icon--thumbs-up-down::before{ @icon md-thumbs-up-down; }
.c-icon--time-to-leave::before{ @icon md-time-to-leave; }
.c-icon--timelapse::before{ @icon md-timelapse; }
.c-icon--timeline::before{ @icon md-timeline; }
.c-icon--timer::before{ @icon md-timer; }
.c-icon--timer-10::before{ @icon md-timer-10; }
.c-icon--timer-3::before{ @icon md-timer-3; }
.c-icon--timer-off::before{ @icon md-timer-off; }
.c-icon--title::before{ @icon md-title; }
.c-icon--toc::before{ @icon md-toc; }
.c-icon--today::before{ @icon md-today; }
.c-icon--toll::before{ @icon md-toll; }
.c-icon--tonality::before{ @icon md-tonality; }
.c-icon--touch-app::before{ @icon md-touch-app; }
.c-icon--toys::before{ @icon md-toys; }
.c-icon--track-changes::before{ @icon md-track-changes; }
.c-icon--traffic::before{ @icon md-traffic; }
.c-icon--train::before{ @icon md-train; }
.c-icon--tram::before{ @icon md-tram; }
.c-icon--transfer-within-a-station::before{ @icon md-transfer-within-a-station; }
.c-icon--transform::before{ @icon md-transform; }
.c-icon--translate::before{ @icon md-translate; }
.c-icon--trending-down::before{ @icon md-trending-down; }
.c-icon--trending-flat::before{ @icon md-trending-flat; }
.c-icon--trending-up::before{ @icon md-trending-up; }
.c-icon--tune::before{ @icon md-tune; }
.c-icon--turned-in::before{ @icon md-turned-in; }
.c-icon--turned-in-not::before{ @icon md-turned-in-not; }
.c-icon--tv::before{ @icon md-tv; }
.c-icon--unarchive::before{ @icon md-unarchive; }
.c-icon--undo::before{ @icon md-undo; }
.c-icon--unfold-less::before{ @icon md-unfold-less; }
.c-icon--unfold-more::before{ @icon md-unfold-more; }
.c-icon--update::before{ @icon md-update; }
.c-icon--usb::before{ @icon md-usb; }
.c-icon--verified-user::before{ @icon md-verified-user; }
.c-icon--vertical-align-bottom::before{ @icon md-vertical-align-bottom; }
.c-icon--vertical-align-center::before{ @icon md-vertical-align-center; }
.c-icon--vertical-align-top::before{ @icon md-vertical-align-top; }
.c-icon--vibration::before{ @icon md-vibration; }
.c-icon--video-call::before{ @icon md-video-call; }
.c-icon--video-label::before{ @icon md-video-label; }
.c-icon--video-library::before{ @icon md-video-library; }
.c-icon--videocam::before{ @icon md-videocam; }
.c-icon--videocam-off::before{ @icon md-videocam-off; }
.c-icon--videogame-asset::before{ @icon md-videogame-asset; }
.c-icon--view-agenda::before{ @icon md-view-agenda; }
.c-icon--view-array::before{ @icon md-view-array; }
.c-icon--view-carousel::before{ @icon md-view-carousel; }
.c-icon--view-column::before{ @icon md-view-column; }
.c-icon--view-comfy::before{ @icon md-view-comfy; }
.c-icon--view-compact::before{ @icon md-view-compact; }
.c-icon--view-day::before{ @icon md-view-day; }
.c-icon--view-headline::before{ @icon md-view-headline; }
.c-icon--view-list::before{ @icon md-view-list; }
.c-icon--view-module::before{ @icon md-view-module; }
.c-icon--view-quilt::before{ @icon md-view-quilt; }
.c-icon--view-stream::before{ @icon md-view-stream; }
.c-icon--view-week::before{ @icon md-view-week; }
.c-icon--vignette::before{ @icon md-vignette; }
.c-icon--visibility::before{ @icon md-visibility; }
.c-icon--visibility-off::before{ @icon md-visibility-off; }
.c-icon--voice-chat::before{ @icon md-voice-chat; }
.c-icon--voicemail::before{ @icon md-voicemail; }
.c-icon--volume-down::before{ @icon md-volume-down; }
.c-icon--volume-mute::before{ @icon md-volume-mute; }
.c-icon--volume-off::before{ @icon md-volume-off; }
.c-icon--volume-up::before{ @icon md-volume-up; }
.c-icon--vpn-key::before{ @icon md-vpn-key; }
.c-icon--vpn-lock::before{ @icon md-vpn-lock; }
.c-icon--wallpaper::before{ @icon md-wallpaper; }
.c-icon--warning::before{ @icon md-warning; }
.c-icon--watch::before{ @icon md-watch; }
.c-icon--watch-later::before{ @icon md-watch-later; }
.c-icon--wb-auto::before{ @icon md-wb-auto; }
.c-icon--wb-cloudy::before{ @icon md-wb-cloudy; }
.c-icon--wb-incandescent::before{ @icon md-wb-incandescent; }
.c-icon--wb-iridescent::before{ @icon md-wb-iridescent; }
.c-icon--wb-sunny::before{ @icon md-wb-sunny; }
.c-icon--wc::before{ @icon md-wc; }
.c-icon--web::before{ @icon md-web; }
.c-icon--web-asset::before{ @icon md-web-asset; }
.c-icon--weekend::before{ @icon md-weekend; }
.c-icon--whatshot::before{ @icon md-whatshot; }
.c-icon--widgets::before{ @icon md-widgets; }
.c-icon--wifi::before{ @icon md-wifi; }
.c-icon--wifi-lock::before{ @icon md-wifi-lock; }
.c-icon--wifi-tethering::before{ @icon md-wifi-tethering; }
.c-icon--work::before{ @icon md-work; }
.c-icon--wrap-text::before{ @icon md-wrap-text; }
.c-icon--youtube-searched-for::before{ @icon md-youtube-searched-for; }
.c-icon--zoom-in::before{ @icon md-zoom-in; }
.c-icon--zoom-out::before{ @icon md-zoom-out; }
.c-icon--zoom-out-map::before{ @icon md-zoom-out-map; } | 54.896034 | 117 | 0.693233 |
759ab22db3de194db478ddd65a91703fd07a9bee | 863 | h | C | src/tree_printer.h | fAndreuzzi/parallel-kd-tree | 66faa1108c9652f2b2518d658a759556135e17bc | [
"MIT"
] | 4 | 2022-01-06T16:19:49.000Z | 2022-01-17T07:00:36.000Z | src/tree_printer.h | fAndreuzzi/parallel-kd-tree | 66faa1108c9652f2b2518d658a759556135e17bc | [
"MIT"
] | null | null | null | src/tree_printer.h | fAndreuzzi/parallel-kd-tree | 66faa1108c9652f2b2518d658a759556135e17bc | [
"MIT"
] | 3 | 2022-01-07T10:31:01.000Z | 2022-03-21T14:45:30.000Z | #pragma once
#include "knode.h"
#include <iostream>
template class KNode<data_type>;
/**
* @brief Auxiliary function which pretty-prints a k-d tree.
*
* This auxiliary function prints the given k-d tree in a pretty way, i.e.
* the tree develops horizontally on the screen to exploit the space available
* in the best possible way.
*
* @param os The output file descriptor.
* @param node The root of the k-d tree to be printed.
* @return std::ostream& The output file descriptor.
*/
std::ostream &operator<<(std::ostream &os, const KNode<data_type> &node);
/**
* @brief Print the content of the given node.
*
* @param os The output file descriptor.
* @param node The root of the k-d tree to be printed.
* @return std::ostream& The output file descriptor.
*/
std::ostream &print_node_values(std::ostream &os, const KNode<data_type> &node);
| 28.766667 | 80 | 0.710313 |
f88d81d16f138b68b4e65966d4782946f76db0e5 | 949 | asm | Assembly | pkgs/tools/yasm/src/modules/arch/x86/tests/mem64.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | pkgs/tools/yasm/src/modules/arch/x86/tests/mem64.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | pkgs/tools/yasm/src/modules/arch/x86/tests/mem64.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | [bits 64]
mov ax, [0] ; 66 8B 04 25 00 00 00 00
mov rax, [qword 0] ; 48 A1 00 00 00 00 00 00 00 00
mov rax, [0] ; 48 8B 04 25 00 00 00 00
mov rax, [dword 0] ; 48 8B 04 25 00 00 00 00
mov al, [qword 0xfedcba9876543210] ; A0 10 32 54 76 98 BA DC FE
mov al, [0xfedcba9876543210] ; 8A 04 25 10 32 54 76 (+ warning)
a32 mov rax, [0] ; 67 48 A1 00 00 00 00
a32 mov eax, [0] ; 67 A1 00 00 00 00
mov ecx, [0] ; 8B 0C 25 00 00 00 00
mov edx, [dword 0] ; 8B 14 25 00 00 00 00
mov rbx, [0] ; 48 8B 1C 25 00 00 00 00
a32 mov rbx, [0] ; 67 48 8B 1C 25 00 00 00 00
mov ebx, [rcx] ; 8B 19
mov r8, [r9] ; 4D 8B 01
mov ecx, [ebx] ; 67 8B 0B
mov edx, [rip] ; 8B 15 00 00 00 00
a32 mov rcx, [rip+5] ; 67 48 8B 0D 05 00 00 00
mov rbx, [rax+rbx*4] ; 48 8B 1C 98
mov rdx, [rsp] ; 48 8B 14 24
mov rax, [r12] ; 49 8B 04 24
mov rcx, [rbp] ; 48 8B 4D 00
mov rbx, [r13] ; 49 8B 5D 00
mov ah, [rip] ; 8A 25 00 00 00 00
mov bh, [rcx] ; 8A 39
| 36.5 | 63 | 0.586934 |
e35828b6c7a3f3ea7a55faca8723db208066df11 | 4,237 | dart | Dart | lib/nba/match/widgets/item_match_player_maxdata.dart | zyxiaofeng/flutter_app | df721c04dfb2d58697b6db3fb3fdfe7329c642d7 | [
"Apache-2.0"
] | 2,300 | 2019-02-18T18:25:55.000Z | 2022-03-29T21:03:28.000Z | lib/nba/match/widgets/item_match_player_maxdata.dart | xuyongfh/flutter_app | 19614aedd99de646b5d2395e6324e0748de23d7f | [
"Apache-2.0"
] | 37 | 2019-05-14T02:08:22.000Z | 2021-07-27T01:34:24.000Z | lib/nba/match/widgets/item_match_player_maxdata.dart | xuyongfh/flutter_app | 19614aedd99de646b5d2395e6324e0748de23d7f | [
"Apache-2.0"
] | 480 | 2019-03-03T09:56:03.000Z | 2022-03-29T10:00:46.000Z | import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_app/page_index.dart';
import '../../index.dart';
class ItemMatchPlayerMaxDataView extends StatelessWidget {
final MaxPlayersBean item;
final Color leftColor;
final Color rightColor;
ItemMatchPlayerMaxDataView({
Key key,
@required this.item,
@required this.leftColor,
@required this.rightColor,
}) : super(key: key);
@override
Widget build(BuildContext context) {
int value = max(int.parse(item.leftVal), int.parse(item.rightVal));
return Container(
margin: EdgeInsets.only(bottom: 5.0, top: 5.0),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
GestureDetector(
child: ImageLoadView(
'${item.leftPlayer.icon}',
width: 70,
height: 50,
fit: BoxFit.fitHeight,
),
onTap: () => pushNewPage(context,
PlayerHomePage(id: item.rightPlayer.playerId)),
),
Padding(
padding: const EdgeInsets.only(bottom: 13.0),
child: Text(
'${item.leftVal}',
style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.bold,
color: leftColor,
),
),
),
Container(
width: 25,
height: 80 * int.parse(item.leftVal) / value,
color: leftColor,
)
],
),
),
Gaps.hGap5,
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
width: 25,
height: 80 * int.parse(item.rightVal) / value,
color: rightColor,
),
Padding(
padding: const EdgeInsets.only(bottom: 13.0),
child: Text(
'${item.rightVal}',
style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.bold,
color: rightColor,
),
),
),
GestureDetector(
child: ImageLoadView(
'${item.rightPlayer.icon}',
width: 70,
height: 50,
fit: BoxFit.fitHeight,
),
onTap: () => pushNewPage(context,
PlayerHomePage(id: item.rightPlayer.playerId)),
),
],
),
),
],
),
Gaps.vGap5,
Row(
children: <Widget>[
Expanded(child: Container(height: 3.0, color: leftColor)),
Gaps.hGap5,
Expanded(child: Container(height: 3.0, color: rightColor)),
],
),
Gaps.vGap5,
Stack(
children: <Widget>[
Row(
children: <Widget>[
Text('${item.leftPlayer.name}'),
Text('${item.rightPlayer.name}'),
],
mainAxisAlignment: MainAxisAlignment.spaceBetween,
),
Text('${item.text}'),
],
alignment: Alignment.center,
),
],
),
);
}
}
| 32.844961 | 73 | 0.408544 |
ffaf5bfa39320af294c1b5bfd00677d61979c9b6 | 1,832 | sql | SQL | sql/base.sql | imbaggaarm/fb-stranger-bot | 2ab59349bd304d86a8e39131cdaba27ac8bffa81 | [
"Apache-2.0"
] | null | null | null | sql/base.sql | imbaggaarm/fb-stranger-bot | 2ab59349bd304d86a8e39131cdaba27ac8bffa81 | [
"Apache-2.0"
] | null | null | null | sql/base.sql | imbaggaarm/fb-stranger-bot | 2ab59349bd304d86a8e39131cdaba27ac8bffa81 | [
"Apache-2.0"
] | 1 | 2022-02-12T09:50:52.000Z | 2022-02-12T09:50:52.000Z | CREATE TABLE `users`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`chat_id` char(25) NOT NULL,
`gender` tinyint(1) unsigned DEFAULT NULL,
`last_activity` datetime NOT NULL,
`match_chat_id` char(25) DEFAULT NULL,
`gender_need_match` tinyint(1) DEFAULT NULL,
`available` tinyint(1) NOT NULL DEFAULT '0',
`register_date` datetime NOT NULL,
`previous_match` char(25) DEFAULT NULL,
`safe_mode` tinyint(1) NOT NULL DEFAULT '1',
`banned_until` datetime DEFAULT NULL,
`waiting_timestamp` bigint(20) unsigned DEFAULT NULL,
`last_gender_changing` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `chat_id` (`chat_id`),
UNIQUE KEY `match_chat_id` (`match_chat_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci;
CREATE TABLE `reports`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned NOT NULL,
`reporter_id` bigint(20) unsigned NOT NULL,
`created_at` datetime NOT NULL,
`report` text NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `reporter_id` (`reporter_id`),
CONSTRAINT `reports_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `reports_ibfk_2` FOREIGN KEY (`reporter_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;
create index idx_waiting on users (waiting_timestamp); | 46.974359 | 121 | 0.582969 |
f2631e8ed655835fae43292913944476ba21f505 | 2,963 | ps1 | PowerShell | Chapter16/03_Write-CMLogEntryToFile.ps1 | wagnerhsu/packt-Learn-PowerShell-Core-6.0 | 03365901d1b1c1b23bcf17988c57c088ee8dc2a7 | [
"MIT"
] | 47 | 2018-07-23T12:53:42.000Z | 2022-03-06T15:23:57.000Z | Chapter16/03_Write-CMLogEntryToFile.ps1 | wagnerhsu/packt-Learn-PowerShell-Core-6.0 | 03365901d1b1c1b23bcf17988c57c088ee8dc2a7 | [
"MIT"
] | 1 | 2019-12-31T19:36:46.000Z | 2020-09-07T07:56:02.000Z | Chapter16/03_Write-CMLogEntryToFile.ps1 | wagnerhsu/packt-Learn-PowerShell-Core-6.0 | 03365901d1b1c1b23bcf17988c57c088ee8dc2a7 | [
"MIT"
] | 33 | 2018-07-19T08:09:52.000Z | 2022-03-06T15:24:00.000Z | function Write-CMLogEntry
{
<#
.Synopsis
Logs the entry in an CMTrace-compatible format to an logpath.
.EXAMPLE
Write-CMLogEntry -Value 'Example' -Severity 2 -LogFilePath $LogFilePath
.EXAMPLE
$TSEnvironment = New-Object -ComObject Microsoft.SMS.TSEnvironment -ErrorAction Stop
$LogFilePath = Join-Path -Path $Script:TSEnvironment.Value('_SMSTSLogPath') -ChildPath $FileName
Write-CMLogEntry -Value 'ExampleWithLogFilePath' -Severity 1 -LogFilePath $LogFilePath
.EXAMPLE
Begin {
# Construct TSEnvironment object
try
{
$TSEnvironment = New-Object -ComObject Microsoft.SMS.TSEnvironment -ErrorAction Stop
}
catch
{
Write-Warning -Message 'Unable to construct Microsoft.SMS.TSEnvironment object'
exit 1
}
$Filename = 'LogFile.log'
# Determine log file location
$LogFilePath = Join-Path -Path $Script:TSEnvironment.Value('_SMSTSLogPath') -ChildPath $FileName
}
Process {
Write-CMLogEntry -Value 'ExampleWithLogFilePath' -Severity 3 -LogFilePath $LogFilePath
}
The above code can be used in scripts to be executed with SCCM, which is why exit is used instead of returning or throwing.
It will write a message "ExampleWithLogFilePath" with severity 3 to a specified log file.
#>
param(
[parameter(Mandatory = $true, HelpMessage = 'Value added to the logfile.')]
[ValidateNotNullOrEmpty()]
[string]$Value,
[parameter(Mandatory = $true, HelpMessage = 'Severity for the log entry. 1 for Informational, 2 for Warning and 3 for Error.')]
[ValidateNotNullOrEmpty()]
[ValidateSet('1', '2', '3')]
[string]$Severity,
[parameter(Mandatory = $true, HelpMessage = 'Name of the log file that the entry will written to.')]
[ValidateNotNullOrEmpty()]
[string]$LogFilePath
)
Process {
# Construct time stamp for log entry
$Time = -join @((Get-Date -Format 'HH:mm:ss.fff'), '+', (Get-WmiObject -Class Win32_TimeZone | Select-Object -ExpandProperty Bias))
# Construct date for log entry
$Date = (Get-Date -Format 'MM-dd-yyyy')
# Construct context for log entry
$Context = $([System.Security.Principal.WindowsIdentity]::GetCurrent().Name)
# Construct final log entry
$LogText = "<![LOG[$($Value)]LOG]!><time=""$($Time)"" date=""$($Date)"" component=""DynamicApplicationsList"" context=""$($Context)"" type=""$($Severity)"" thread=""$($PID)"" file="""">"
# Add value to log file
try
{
Add-Content -Value $LogText -LiteralPath $LogFilePath -ErrorAction Stop
}
catch
{
Write-Warning -Message "Unable to append log entry to logfile: $LogFilePath"
}
}
}
| 38.986842 | 194 | 0.614242 |
b863e8d47da930a8eade2d910d6ccf4027be5bf6 | 154 | asm | Assembly | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_getcwd.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_getcwd.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_getcwd.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | null | null | null | ; unsigned char esx_f_getcwd(unsigned char *buf)
SECTION code_esxdos
PUBLIC esx_f_getcwd
EXTERN asm_esx_f_getcwd
defc esx_f_getcwd = asm_esx_f_getcwd
| 15.4 | 48 | 0.837662 |
06ba65d2537f740e0d668af24de3ff4aad2fad40 | 12,469 | sql | SQL | src/gtonline_complete.sql | appinho/SADatabasesGTOnline | 6ca70afce12722767d51a1ca3bee1745ced6be6e | [
"MIT"
] | null | null | null | src/gtonline_complete.sql | appinho/SADatabasesGTOnline | 6ca70afce12722767d51a1ca3bee1745ced6be6e | [
"MIT"
] | null | null | null | src/gtonline_complete.sql | appinho/SADatabasesGTOnline | 6ca70afce12722767d51a1ca3bee1745ced6be6e | [
"MIT"
] | null | null | null |
-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 13, 2012 at 03:16 PM
-- Server version: 5.5.24-log
-- PHP Version: 5.3.13
SET FOREIGN_KEY_CHECKS=0;
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: 'gtonline_complete'
--
CREATE DATABASE IF NOT EXISTS gtonline_complete;
USE gtonline_complete;
-- --------------------------------------------------------
--
-- Table structure for table 'adminuser'
--
DROP TABLE IF EXISTS adminuser;
CREATE TABLE IF NOT EXISTS adminuser (
email varchar(250) NOT NULL,
lastlogin datetime DEFAULT NULL,
PRIMARY KEY (email)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table 'adminuser'
--
INSERT INTO adminuser (email, lastlogin) VALUES('admin@gtonline.com', '2012-08-13 08:20:00');
-- --------------------------------------------------------
--
-- Table structure for table 'attend'
--
DROP TABLE IF EXISTS attend;
CREATE TABLE IF NOT EXISTS attend (
email varchar(250) NOT NULL,
schoolname varchar(250) NOT NULL,
yeargraduated int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (email,schoolname,yeargraduated),
KEY schoolname (schoolname)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table 'attend'
--
INSERT INTO attend (email, schoolname, yeargraduated) VALUES('michael@bluthco.com', 'Pheonix High School', 1986);
INSERT INTO attend (email, schoolname, yeargraduated) VALUES('michael@bluthco.com', 'University of California', 1989);
-- --------------------------------------------------------
--
-- Table structure for table 'comment'
--
DROP TABLE IF EXISTS `comment`;
CREATE TABLE IF NOT EXISTS `comment` (
email varchar(250) NOT NULL,
dateandtime datetime NOT NULL,
`text` varchar(1000) NOT NULL,
suemail varchar(250) NOT NULL,
sudateandtime datetime NOT NULL,
PRIMARY KEY (email,dateandtime),
KEY suemail (suemail,sudateandtime)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table 'comment'
--
INSERT INTO `comment` (email, dateandtime, `text`, suemail, sudateandtime) VALUES('dschrute@dundermifflin.com', '2012-08-13 15:02:00', 'This is a comment!', 'michael@bluthco.com', '2012-08-13 15:00:00');
-- --------------------------------------------------------
--
-- Table structure for table 'employer'
--
DROP TABLE IF EXISTS employer;
CREATE TABLE IF NOT EXISTS employer (
employername varchar(50) NOT NULL,
PRIMARY KEY (employername)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table 'employer'
--
INSERT INTO employer (employername) VALUES('Bluth Development Company');
INSERT INTO employer (employername) VALUES('Dunder Mifflin');
-- --------------------------------------------------------
--
-- Table structure for table 'employment'
--
DROP TABLE IF EXISTS employment;
CREATE TABLE IF NOT EXISTS employment (
email varchar(250) NOT NULL,
employername varchar(50) NOT NULL,
jobtitle varchar(50) NOT NULL,
PRIMARY KEY (email,employername),
KEY employername (employername)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table 'employment'
--
INSERT INTO employment (email, employername, jobtitle) VALUES('dschrute@dundermifflin.com', 'Dunder Mifflin', '');
INSERT INTO employment (email, employername, jobtitle) VALUES('michael@bluthco.com', 'Bluth Development Company', '');
-- --------------------------------------------------------
--
-- Table structure for table 'friendship'
--
DROP TABLE IF EXISTS friendship;
CREATE TABLE IF NOT EXISTS friendship (
email varchar(250) NOT NULL,
friendemail varchar(250) NOT NULL,
relationship varchar(50) NOT NULL,
dateconnected date DEFAULT NULL,
PRIMARY KEY (email,friendemail),
KEY friendemail (friendemail)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table 'friendship'
--
INSERT INTO friendship (email, friendemail, relationship, dateconnected) VALUES('michael@bluthco.com', 'gbluth@bluthco.com', 'Father', '2011-07-07');
INSERT INTO friendship (email, friendemail, relationship, dateconnected) VALUES('michael@bluthco.com', 'jhalpert@dundermifflin.com', 'Long Lost Cousin', NULL);
INSERT INTO friendship (email, friendemail, relationship, dateconnected) VALUES('michael@bluthco.com', 'lfunke@bluthco.com', 'Sister', '2012-03-05');
INSERT INTO friendship (email, friendemail, relationship, dateconnected) VALUES('pam@dundermifflin.com', 'michael@bluthco.com', 'Colleague', NULL);
-- --------------------------------------------------------
--
-- Table structure for table 'regularuser'
--
DROP TABLE IF EXISTS regularuser;
CREATE TABLE IF NOT EXISTS regularuser (
email varchar(250) NOT NULL,
sex char(1) NOT NULL,
birthdate date NOT NULL,
currentcity varchar(250) DEFAULT NULL,
hometown varchar(250) DEFAULT NULL,
PRIMARY KEY (email)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table 'regularuser'
--
INSERT INTO regularuser (email, sex, birthdate, currentcity, hometown) VALUES('dschrute@dundermifflin.com', 'M', '1971-07-15', 'Scranton', 'Rochester');
INSERT INTO regularuser (email, sex, birthdate, currentcity, hometown) VALUES('gbluth@bluthco.com', 'M', '1950-11-17', 'Los Angeles', 'Los Angeles');
INSERT INTO regularuser (email, sex, birthdate, currentcity, hometown) VALUES('jhalpert@dundermifflin.com', 'M', '1973-10-02', 'Scranton', 'Buffalo');
INSERT INTO regularuser (email, sex, birthdate, currentcity, hometown) VALUES('lfunke@bluthco.com', 'F', '1974-05-05', 'Los Angeles', 'Las Vegas');
INSERT INTO regularuser (email, sex, birthdate, currentcity, hometown) VALUES('michael@bluthco.com', 'M', '1971-01-01', 'Pheonix', 'Beverly Hills');
INSERT INTO regularuser (email, sex, birthdate, currentcity, hometown) VALUES('pam@dundermifflin.com', 'F', '1975-04-28', 'Scranton', 'Sacramento');
INSERT INTO regularuser (email, sex, birthdate, currentcity, hometown) VALUES('rocky@cc.gatech.edu', 'M', '1981-03-22', 'Atlanta', 'Conyers');
-- --------------------------------------------------------
--
-- Table structure for table 'school'
--
DROP TABLE IF EXISTS school;
CREATE TABLE IF NOT EXISTS school (
schoolname varchar(250) NOT NULL,
`type` varchar(50) DEFAULT NULL,
PRIMARY KEY (schoolname),
KEY `type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table 'school'
--
INSERT INTO school (schoolname, `type`) VALUES('Pheonix High School', 'High School');
INSERT INTO school (schoolname, `type`) VALUES('University of Georgia', 'High School');
INSERT INTO school (schoolname, `type`) VALUES('Georgia Tech', 'University');
INSERT INTO school (schoolname, `type`) VALUES('University of California', 'University');
-- --------------------------------------------------------
--
-- Table structure for table 'schooltype'
--
DROP TABLE IF EXISTS schooltype;
CREATE TABLE IF NOT EXISTS schooltype (
typename varchar(50) NOT NULL,
PRIMARY KEY (typename)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table 'schooltype'
--
INSERT INTO schooltype (typename) VALUES('Community College');
INSERT INTO schooltype (typename) VALUES('High School');
INSERT INTO schooltype (typename) VALUES('University');
-- --------------------------------------------------------
--
-- Table structure for table 'statusupdate'
--
DROP TABLE IF EXISTS statusupdate;
CREATE TABLE IF NOT EXISTS statusupdate (
email varchar(250) NOT NULL,
dateandtime datetime NOT NULL,
`text` varchar(1000) NOT NULL,
PRIMARY KEY (email,dateandtime),
KEY dateandtime (dateandtime)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table 'statusupdate'
--
INSERT INTO statusupdate (email, dateandtime, `text`) VALUES('michael@bluthco.com', '2012-08-13 15:00:00', 'My first status update!');
INSERT INTO statusupdate (email, dateandtime, `text`) VALUES('michael@bluthco.com', '2012-08-13 16:00:00', 'Going to the store.');
-- --------------------------------------------------------
--
-- Table structure for table 'user'
--
DROP TABLE IF EXISTS `user`;
CREATE TABLE IF NOT EXISTS `user` (
email varchar(250) NOT NULL,
`password` varchar(50) NOT NULL,
firstname varchar(100) NOT NULL,
lastname varchar(100) NOT NULL,
PRIMARY KEY (email)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table 'user'
--
INSERT INTO `user` (email, `password`, firstname, lastname) VALUES('admin@gtonline.com', 'admin123', 'Johnny', 'Admin');
INSERT INTO `user` (email, `password`, firstname, lastname) VALUES('dschrute@dundermifflin.com', 'dwight123', 'Dwight', 'Schrute');
INSERT INTO `user` (email, `password`, firstname, lastname) VALUES('gbluth@bluthco.com', 'george123', 'George', 'Bluth');
INSERT INTO `user` (email, `password`, firstname, lastname) VALUES('jhalpert@dundermifflin.com', 'jim123', 'Jim', 'Halpert');
INSERT INTO `user` (email, `password`, firstname, lastname) VALUES('lfunke@bluthco.com', 'lindsey123', 'Lindsey', 'Funke');
INSERT INTO `user` (email, `password`, firstname, lastname) VALUES('michael@bluthco.com', 'michael123', 'Michael', 'Bluth');
INSERT INTO `user` (email, `password`, firstname, lastname) VALUES('pam@dundermifflin.com', 'pam123', 'Pam', 'Halpert');
INSERT INTO `user` (email, `password`, firstname, lastname) VALUES('rocky@cc.gatech.edu', 'rocky123', 'Rocky', 'Dunlap');
-- --------------------------------------------------------
--
-- Table structure for table 'userinterests'
--
DROP TABLE IF EXISTS userinterests;
CREATE TABLE IF NOT EXISTS userinterests (
email varchar(250) NOT NULL,
interest varchar(250) NOT NULL,
PRIMARY KEY (email,interest)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table 'userinterests'
--
INSERT INTO userinterests (email, interest) VALUES('jhalpert@dundermifflin.com', 'bird watching');
INSERT INTO userinterests (email, interest) VALUES('michael@bluthco.com', 'golf');
INSERT INTO userinterests (email, interest) VALUES('michael@bluthco.com', 'real estate development');
INSERT INTO userinterests (email, interest) VALUES('michael@bluthco.com', 'tennis');
INSERT INTO userinterests (email, interest) VALUES('pam@dundermifflin.com', 'horse racing');
INSERT INTO userinterests (email, interest) VALUES('pam@dundermifflin.com', 'volleyball');
INSERT INTO userinterests (email, interest) VALUES('rocky@cc.gatech.edu', 'piano');
--
-- Constraints for dumped tables
--
--
-- Constraints for table `adminuser`
--
ALTER TABLE `adminuser`
ADD CONSTRAINT adminuser_ibfk_1 FOREIGN KEY (email) REFERENCES `user` (email);
--
-- Constraints for table `attend`
--
ALTER TABLE `attend`
ADD CONSTRAINT attend_ibfk_1 FOREIGN KEY (email) REFERENCES regularuser (email),
ADD CONSTRAINT attend_ibfk_2 FOREIGN KEY (schoolname) REFERENCES school (schoolname);
--
-- Constraints for table `comment`
--
ALTER TABLE `comment`
ADD CONSTRAINT comment_ibfk_1 FOREIGN KEY (suemail, sudateandtime) REFERENCES statusupdate (email, dateandtime);
--
-- Constraints for table `employment`
--
ALTER TABLE `employment`
ADD CONSTRAINT employment_ibfk_1 FOREIGN KEY (email) REFERENCES regularuser (email),
ADD CONSTRAINT employment_ibfk_2 FOREIGN KEY (employername) REFERENCES employer (employername);
--
-- Constraints for table `friendship`
--
ALTER TABLE `friendship`
ADD CONSTRAINT friendship_ibfk_1 FOREIGN KEY (email) REFERENCES regularuser (email),
ADD CONSTRAINT friendship_ibfk_2 FOREIGN KEY (friendemail) REFERENCES regularuser (email);
--
-- Constraints for table `regularuser`
--
ALTER TABLE `regularuser`
ADD CONSTRAINT regularuser_ibfk_1 FOREIGN KEY (email) REFERENCES `user` (email);
--
-- Constraints for table `school`
--
ALTER TABLE `school`
ADD CONSTRAINT school_ibfk_1 FOREIGN KEY (`type`) REFERENCES schooltype (typename);
--
-- Constraints for table `statusupdate`
--
ALTER TABLE `statusupdate`
ADD CONSTRAINT statusupdate_ibfk_1 FOREIGN KEY (email) REFERENCES regularuser (email);
--
-- Constraints for table `userinterests`
--
ALTER TABLE `userinterests`
ADD CONSTRAINT userinterests_ibfk_1 FOREIGN KEY (email) REFERENCES regularuser (email);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | 33.883152 | 203 | 0.696608 |
49ceea4b471299fc49e8aec7fc67927e388dcdc1 | 740 | html | HTML | demo/components/flex/wrap.html | quangtv92/toolkit | 4e0271e096b861da2077dc4ac9dbf1ef94667dc9 | [
"BSD-3-Clause"
] | null | null | null | demo/components/flex/wrap.html | quangtv92/toolkit | 4e0271e096b861da2077dc4ac9dbf1ef94667dc9 | [
"BSD-3-Clause"
] | null | null | null | demo/components/flex/wrap.html | quangtv92/toolkit | 4e0271e096b861da2077dc4ac9dbf1ef94667dc9 | [
"BSD-3-Clause"
] | null | null | null | <div class="region demo--flex">
<div class="block">1</div>
<div class="block">2</div>
<div class="block">3</div>
<div class="block">4</div>
<div class="block">5</div>
<div class="block">6</div>
<div class="block">7</div>
<div class="block">8</div>
<div class="block">9</div>
<div class="block">10</div>
</div>
<hr class="demo-spacer">
<div class="region region--wrap demo--flex">
<div class="block">1</div>
<div class="block">2</div>
<div class="block">3</div>
<div class="block">4</div>
<div class="block">5</div>
<div class="block">6</div>
<div class="block">7</div>
<div class="block">8</div>
<div class="block">9</div>
<div class="block">10</div>
</div>
| 26.428571 | 44 | 0.566216 |
55af1bbe777f7922573b3017f1597d8a8d783d80 | 1,105 | lua | Lua | extensions/script/tests/test_lua_scripts/foo_bar_processor.lua | nandorsoma/nifi-minifi-cpp | 182e5b98a390d6073c43ffc88ecf7511ad0d3ff5 | [
"Apache-2.0"
] | null | null | null | extensions/script/tests/test_lua_scripts/foo_bar_processor.lua | nandorsoma/nifi-minifi-cpp | 182e5b98a390d6073c43ffc88ecf7511ad0d3ff5 | [
"Apache-2.0"
] | null | null | null | extensions/script/tests/test_lua_scripts/foo_bar_processor.lua | nandorsoma/nifi-minifi-cpp | 182e5b98a390d6073c43ffc88ecf7511ad0d3ff5 | [
"Apache-2.0"
] | null | null | null | ---
--- Licensed to the Apache Software Foundation (ASF) under one or more
--- contributor license agreements. See the NOTICE file distributed with
--- this work for additional information regarding copyright ownership.
--- The ASF licenses this file to You under the Apache License, Version 2.0
--- (the "License"); you may not use this file except in compliance with
--- the License. You may obtain a copy of the License at
---
--- http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
---
local foo_module = require "foo"
local bar_module = require "bar"
function onTrigger(context, session)
flow_file = session:get()
log:info(foo_module.foo() .. bar_module.bar())
if flow_file ~= nil then
session:transfer(flow_file, REL_SUCCESS)
end
end
| 39.464286 | 77 | 0.723077 |
b6822efdff3d534d4a164b29b2c8bd9a7e423726 | 1,162 | asm | Assembly | cmd/append/appendm.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | cmd/append/appendm.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | cmd/append/appendm.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | page 60,120
;/*
; * Microsoft Confidential
; * Copyright (C) Microsoft Corporation 1991
; * All Rights Reserved.
; */
; @@04 07/30/86 Fix second APPEND hang PTM P0000053
; @@05 08/13/86 Fix bad parm message PTM P0000125
; @@10 08/28/86 Change message for @@05 PTM P0000291
; @@11 09/10/86 Support message profile and make
; msg length variable. R.G. PTM P0000479
cseg segment public para 'CODE'
assume cs:cseg
public bad_append_msg ;@@11
public path_error_msg ;@@11
public parm_error_msg ;@@11
public path_parm_error_msg ;@@11
public no_append_msg ;@@11
public append_assign_msg ;@@11
public append_tv_msg ;@@11
public bad_DOS_msg ;@@11
public second_append_msg ;@@11
public len_bad_append_msg ;@@11
public len_path_error_msg ;@@11
public len_parm_error_msg ;@@11
public len_path_parm_error_msg ;@@11
public len_no_append_msg ;@@11
public len_append_assign_msg ;@@11
public len_append_tv_msg ;@@11
public len_bad_DOS_msg ;@@11
public len_second_append_msg ;@@11
cr equ 13
lf equ 10
include appendm.inc
cseg ends
end
| 27.666667 | 65 | 0.672117 |
661019123aa2b3568a243bfd38e5004e093554c9 | 640 | asm | Assembly | GBRoms/GB2Twitter/Graphics/ShiftKey.asm | Pegmode/GB2Twitter | 6fe571a6bdf8991b4284b3c6bee564a861c73415 | [
"MIT"
] | 4 | 2019-12-31T18:53:39.000Z | 2021-04-29T20:30:59.000Z | GBRoms/GB2Twitter/Graphics/ShiftKey.asm | Pegmode/GB2Twitter | 6fe571a6bdf8991b4284b3c6bee564a861c73415 | [
"MIT"
] | null | null | null | GBRoms/GB2Twitter/Graphics/ShiftKey.asm | Pegmode/GB2Twitter | 6fe571a6bdf8991b4284b3c6bee564a861c73415 | [
"MIT"
] | null | null | null | ; SHIFTKEY.Z80
;
; Tile Source File.
;
; Info:
; Section : Tiles
; Bank : 0
; Form : All tiles as one unit.
; Format : Gameboy 4 color.
; Compression : None.
; Counter : None.
; Tile size : 8 x 8
; Tiles : 0 to 0
;
; Palette colors : None.
; SGB Palette : None.
; CGB Palette : None.
;
; Convert to metatiles : No.
;
; This file was generated by GBTD v2.2
; Start of tile array.
ShiftKey::
DB $00,$00,$00,$00,$18,$18,$3C,$3C
DB $18,$18,$18,$18,$18,$18,$00,$00
; End of SHIFTKEY.Z80
| 21.333333 | 49 | 0.471875 |
27e57d5e493fd50752258e112afe0b0636a87a00 | 4,399 | dart | Dart | lib/view/screens/home.dart | JimTim/hackernews_app | 11a12c5afa7d58c834843a699653b3c3ea7d0e87 | [
"MIT"
] | 14 | 2020-12-12T07:15:34.000Z | 2021-12-13T16:20:36.000Z | lib/view/screens/home.dart | JimTim/hackernews_app | 11a12c5afa7d58c834843a699653b3c3ea7d0e87 | [
"MIT"
] | 2 | 2021-01-28T07:23:42.000Z | 2021-09-27T17:59:18.000Z | lib/view/screens/home.dart | JimTim/hackernews_app | 11a12c5afa7d58c834843a699653b3c3ea7d0e87 | [
"MIT"
] | 6 | 2021-01-27T08:53:40.000Z | 2021-09-12T02:45:53.000Z | import 'dart:async';
import 'package:flutter/material.dart';
import 'package:hackernews/core/hn_api.dart';
import 'package:hackernews/core/model/news_item.dart';
import 'package:hackernews/core/model/stories.dart';
import 'package:hackernews/view/widgets/custom_appbar.dart';
import 'package:hackernews/view/widgets/new_card.dart';
class Home extends StatefulWidget {
Home({Key key, this.story}) : super(key: key);
final Stories story;
@override
_HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
HNapi hNapi = HNapi();
List<dynamic> _id = [];
Map<int, NewsItem> newsItems = Map();
bool _isLoading = false;
String errorTitle = "";
@override
void initState() {
super.initState();
fetchData();
}
void fetchData() async {
setState(() {
_id = [];
newsItems = Map();
_isLoading = true;
});
try {
var id = await hNapi.getNewsFeed(widget.story);
setState(() {
_isLoading = false;
_id = id.toList();
});
} catch (e) {
setState(() {
this._isLoading = false;
this.errorTitle =
"Failed to load data, please check your internet connection";
});
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFFFFFCF5),
appBar: CustomAppBar(
categoryTitle: getCategoryAppBarTitle(),
onTap: refreshData,
),
body: _isLoading ? buildLoadingAnimation() : buildBody(),
);
}
Container buildLoadingAnimation() {
return Container(
child: Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(
Color(0xFFFF6600),
),
),
),
);
}
ListView buildBody() {
return ListView.builder(
itemCount: this._id.length,
itemBuilder: (BuildContext context, int index) {
return FutureBuilder(
future: hNapi.getNewsItem(this._id[index]),
builder: (BuildContext context, AsyncSnapshot snapshot) {
if (newsItems[index] != null) {
var item = newsItems[index];
return CustomNewCard(
newsItem: item,
numIndex: "${index + 1}",
key: Key(item.id.toString()),
);
}
//? ======================
//? ======================
if (snapshot.hasData && snapshot.data != null) {
var item = snapshot.data;
newsItems[index] = item;
return CustomNewCard(
newsItem: item,
numIndex: "${index + 1}",
key: Key(item.id.toString()),
);
}
//! ======================
//! ======================
else if (snapshot.hasError) {
return Container(
padding: EdgeInsets.all(32.0),
child: Center(
child: Text(
"Error loading story ${this._id[index]}",
style: TextStyle(
color: Colors.orange,
fontSize: 18,
),
),
),
);
}
// ======================
// ======================
else {
return Container(
padding: EdgeInsets.all(32.0),
child: Center(
child: Padding(
padding: const EdgeInsets.all(20),
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(
Colors.transparent,
),
),
),
),
);
}
},
);
},
);
}
///
///
///
///
///
///
///
void refreshData() {
fetchData();
}
String getCategoryAppBarTitle() {
switch (widget.story) {
case Stories.top:
return "Top";
break;
case Stories.newest:
return "Newest";
break;
case Stories.jobs:
return "Jobs";
break;
case Stories.shows:
return "Shows";
case Stories.asks:
return "Asks";
default:
return "";
}
}
}
| 25.427746 | 73 | 0.477154 |
0f6bd49c641bf2fb47e1cad6914554553c042f01 | 15,178 | cpp | C++ | src/ConnectivityTool/ConnectivityTool.cpp | dcrsprotocol/dcrs | 8073390fa80e1670fd828cda606f0c8861318589 | [
"BSD-3-Clause"
] | 2 | 2019-09-04T23:06:54.000Z | 2019-09-10T13:30:26.000Z | src/ConnectivityTool/ConnectivityTool.cpp | dcrsprotocol/dcrs | 8073390fa80e1670fd828cda606f0c8861318589 | [
"BSD-3-Clause"
] | null | null | null | src/ConnectivityTool/ConnectivityTool.cpp | dcrsprotocol/dcrs | 8073390fa80e1670fd828cda606f0c8861318589 | [
"BSD-3-Clause"
] | null | null | null | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers
//
// This file is part of DCRS.
//
// DCRS 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 3 of the License, or
// (at your option) any later version.
//
// DCRS 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 DCRS. If not, see <http://www.gnu.org/licenses/>.
#include <boost/optional.hpp>
#include <boost/program_options.hpp>
#include <System/ContextGroup.h>
#include <System/ContextGroupTimeout.h>
#include <System/Dispatcher.h>
#include <System/Event.h>
#include <System/InterruptedException.h>
#include <System/Ipv4Address.h>
#include <System/Ipv4Resolver.h>
#include <System/TcpConnection.h>
#include <System/TcpConnector.h>
#include <System/Timer.h>
#include "Common/CommandLine.h"
#include "Common/StringTools.h"
#include "crypto/crypto.h"
#include "P2p/P2pProtocolDefinitions.h"
#include "P2p/LevinProtocol.h"
#include "Rpc/CoreRpcServerCommandsDefinitions.h"
#include "Rpc/HttpClient.h"
#include "Serialization/SerializationTools.h"
#include "version.h"
namespace po = boost::program_options;
using namespace CryptoNote;
#ifndef ENDL
#define ENDL std::endl
#endif
#ifdef ALLOW_DEBUG_COMMANDS
namespace {
const command_line::arg_descriptor<std::string, true> arg_ip = {"ip", "set ip"};
const command_line::arg_descriptor<uint16_t> arg_port = { "port", "set port" };
const command_line::arg_descriptor<uint16_t> arg_rpc_port = {"rpc_port", "set rpc port"};
const command_line::arg_descriptor<uint32_t, true> arg_timeout = {"timeout", "set timeout"};
const command_line::arg_descriptor<std::string> arg_priv_key = {"private_key", "private key to subscribe debug command", "", true};
const command_line::arg_descriptor<uint64_t> arg_peer_id = {"peer_id", "peer_id if known(if not - will be requested)", 0};
const command_line::arg_descriptor<bool> arg_generate_keys = {"generate_keys_pair", "generate private and public keys pair"};
const command_line::arg_descriptor<bool> arg_request_stat_info = {"request_stat_info", "request statistics information"};
const command_line::arg_descriptor<bool> arg_request_net_state = {"request_net_state", "request network state information (peer list, connections count)"};
const command_line::arg_descriptor<bool> arg_get_daemon_info = {"rpc_get_daemon_info", "request daemon state info vie rpc (--rpc_port option should be set ).", "", true};
}
struct response_schema {
std::string status;
std::string COMMAND_REQUEST_STAT_INFO_status;
std::string COMMAND_REQUEST_NETWORK_STATE_status;
boost::optional<COMMAND_REQUEST_STAT_INFO::response> si_rsp;
boost::optional<COMMAND_REQUEST_NETWORK_STATE::response> ns_rsp;
};
void withTimeout(System::Dispatcher& dispatcher, unsigned timeout, std::function<void()> f) {
std::string result;
System::ContextGroup cg(dispatcher);
System::ContextGroupTimeout cgTimeout(dispatcher, cg, std::chrono::milliseconds(timeout));
cg.spawn([&] {
try {
f();
} catch (System::InterruptedException&) {
result = "Operation timeout";
} catch (std::exception& e) {
result = e.what();
}
});
cg.wait();
if (!result.empty()) {
throw std::runtime_error(result);
}
}
std::ostream& get_response_schema_as_json(std::ostream& ss, response_schema &rs) {
ss << "{" << ENDL
<< " \"status\": \"" << rs.status << "\"," << ENDL
<< " \"COMMAND_REQUEST_NETWORK_STATE_status\": \"" << rs.COMMAND_REQUEST_NETWORK_STATE_status << "\"," << ENDL
<< " \"COMMAND_REQUEST_STAT_INFO_status\": \"" << rs.COMMAND_REQUEST_STAT_INFO_status << "\"";
if (rs.si_rsp.is_initialized()) {
ss << "," << ENDL << " \"si_rsp\": " << storeToJson(rs.si_rsp.get());
}
if (rs.ns_rsp.is_initialized()) {
const auto& networkState = rs.ns_rsp.get();
ss << "," << ENDL << " \"ns_rsp\": {" << ENDL
<< " \"local_time\": " << networkState.local_time << "," << ENDL
<< " \"my_id\": \"" << networkState.my_id << "\"," << ENDL
<< " \"connections_list\": [" << ENDL;
size_t i = 0;
for (const connection_entry &ce : networkState.connections_list) {
ss << " {\"peer_id\": \"" << ce.id << "\", \"ip\": \"" << Common::ipAddressToString(ce.adr.ip) << "\", \"port\": " << ce.adr.port << ", \"is_income\": " << ce.is_income << "}";
if (networkState.connections_list.size() - 1 != i)
ss << ",";
ss << ENDL;
i++;
}
ss << " ]," << ENDL;
ss << " \"local_peerlist_white\": [" << ENDL;
i = 0;
for (const PeerlistEntry &pe : networkState.local_peerlist_white) {
ss << " {\"peer_id\": \"" << pe.id << "\", \"ip\": \"" << Common::ipAddressToString(pe.adr.ip) << "\", \"port\": " << pe.adr.port << ", \"last_seen\": " << networkState.local_time - pe.last_seen << "}";
if (networkState.local_peerlist_white.size() - 1 != i)
ss << ",";
ss << ENDL;
i++;
}
ss << " ]," << ENDL;
ss << " \"local_peerlist_gray\": [" << ENDL;
i = 0;
for (const PeerlistEntry &pe : networkState.local_peerlist_gray) {
ss << " {\"peer_id\": \"" << pe.id << "\", \"ip\": \"" << Common::ipAddressToString(pe.adr.ip) << "\", \"port\": " << pe.adr.port << ", \"last_seen\": " << networkState.local_time - pe.last_seen << "}";
if (networkState.local_peerlist_gray.size() - 1 != i)
ss << ",";
ss << ENDL;
i++;
}
ss << " ]" << ENDL << " }" << ENDL;
}
ss << "}";
return ss;
}
//---------------------------------------------------------------------------------------------------------------
bool print_COMMAND_REQUEST_STAT_INFO(const COMMAND_REQUEST_STAT_INFO::response &si) {
std::cout << " ------ COMMAND_REQUEST_STAT_INFO ------ " << ENDL;
std::cout << "Version: " << si.version << ENDL;
std::cout << "OS Version: " << si.os_version << ENDL;
std::cout << "Connections: " << si.connections_count << ENDL;
std::cout << "INC Connections: " << si.incoming_connections_count << ENDL;
std::cout << "Tx pool size: " << si.payload_info.tx_pool_size << ENDL;
std::cout << "BC height: " << si.payload_info.blockchain_height << ENDL;
std::cout << "Mining speed: " << si.payload_info.mining_speed << ENDL;
std::cout << "Alternative blocks: " << si.payload_info.alternative_blocks << ENDL;
std::cout << "Top block id: " << si.payload_info.top_block_id_str << ENDL;
return true;
}
//---------------------------------------------------------------------------------------------------------------
bool print_COMMAND_REQUEST_NETWORK_STATE(const COMMAND_REQUEST_NETWORK_STATE::response &ns) {
std::cout << " ------ COMMAND_REQUEST_NETWORK_STATE ------ " << ENDL;
std::cout << "Peer id: " << ns.my_id << ENDL;
std::cout << "Active connections:" << ENDL;
for (const connection_entry &ce : ns.connections_list) {
std::cout << ce.id << "\t" << ce.adr << (ce.is_income ? "(INC)" : "(OUT)") << ENDL;
}
std::cout << "Peer list white:" << ns.my_id << ENDL;
for (const PeerlistEntry &pe : ns.local_peerlist_white) {
std::cout << pe.id << "\t" << pe.adr << "\t" << Common::timeIntervalToString(ns.local_time - pe.last_seen) << ENDL;
}
std::cout << "Peer list gray:" << ns.my_id << ENDL;
for (const PeerlistEntry &pe : ns.local_peerlist_gray) {
std::cout << pe.id << "\t" << pe.adr << "\t" << Common::timeIntervalToString(ns.local_time - pe.last_seen) << ENDL;
}
return true;
}
//---------------------------------------------------------------------------------------------------------------
bool handle_get_daemon_info(po::variables_map& vm) {
if(!command_line::has_arg(vm, arg_rpc_port)) {
std::cout << "ERROR: rpc port not set" << ENDL;
return false;
}
try {
System::Dispatcher dispatcher;
HttpClient httpClient(dispatcher, command_line::get_arg(vm, arg_ip), command_line::get_arg(vm, arg_rpc_port));
CryptoNote::COMMAND_RPC_GET_INFO::request req;
CryptoNote::COMMAND_RPC_GET_INFO::response res;
invokeJsonCommand(httpClient, "/getinfo", req, res); // TODO: timeout
std::cout << "OK" << ENDL
<< "height: " << res.height << ENDL
<< "difficulty: " << res.difficulty << ENDL
<< "transactions_count: " << res.tx_count << ENDL
<< "transactions_pool_size: " << res.tx_pool_size << ENDL
<< "alt_blocks_count: " << res.alt_blocks_count << ENDL
<< "outgoing_connections_count: " << res.outgoing_connections_count << ENDL
<< "incoming_connections_count: " << res.incoming_connections_count << ENDL
<< "white_peerlist_size: " << res.white_peerlist_size << ENDL
<< "grey_peerlist_size: " << res.grey_peerlist_size << ENDL;
} catch (const std::exception& e) {
std::cout << "ERROR: " << e.what() << std::endl;
return false;
}
return true;
}
//---------------------------------------------------------------------------------------------------------------
bool handle_request_stat(po::variables_map& vm, PeerIdType peer_id) {
if(!command_line::has_arg(vm, arg_priv_key)) {
std::cout << "{" << ENDL << " \"status\": \"ERROR: " << "secret key not set \"" << ENDL << "}";
return false;
}
Crypto::SecretKey prvk;
if (!Common::podFromHex(command_line::get_arg(vm, arg_priv_key), prvk)) {
std::cout << "{" << ENDL << " \"status\": \"ERROR: " << "wrong secret key set \"" << ENDL << "}";
return false;
}
response_schema rs;
unsigned timeout = command_line::get_arg(vm, arg_timeout);
try {
System::Dispatcher dispatcher;
System::TcpConnector connector(dispatcher);
System::Ipv4Resolver resolver(dispatcher);
std::cout << "Connecting to " << command_line::get_arg(vm, arg_ip) << ":" << command_line::get_arg(vm, arg_port) << ENDL;
auto addr = resolver.resolve(command_line::get_arg(vm, arg_ip));
System::TcpConnection connection;
withTimeout(dispatcher, timeout, [&] {
connection = connector.connect(addr, command_line::get_arg(vm, arg_port));
});
rs.status = "OK";
LevinProtocol levin(connection);
if (!peer_id) {
COMMAND_REQUEST_PEER_ID::request req;
COMMAND_REQUEST_PEER_ID::response rsp;
withTimeout(dispatcher, timeout, [&] {
levin.invoke(COMMAND_REQUEST_PEER_ID::ID, req, rsp);
});
peer_id = rsp.my_id;
}
proof_of_trust pot;
pot.peer_id = peer_id;
pot.time = time(NULL);
Crypto::PublicKey pubk;
Common::podFromHex(P2P_STAT_TRUSTED_PUB_KEY, pubk);
Crypto::Hash h = get_proof_of_trust_hash(pot);
Crypto::generate_signature(h, pubk, prvk, pot.sign);
if (command_line::get_arg(vm, arg_request_stat_info)) {
COMMAND_REQUEST_STAT_INFO::request req;
COMMAND_REQUEST_STAT_INFO::response res;
req.tr = pot;
try {
withTimeout(dispatcher, timeout, [&] {
levin.invoke(COMMAND_REQUEST_STAT_INFO::ID, req, res);
});
rs.si_rsp = std::move(res);
rs.COMMAND_REQUEST_STAT_INFO_status = "OK";
} catch (const std::exception &e) {
std::stringstream ss;
ss << "ERROR: Failed to invoke remote command COMMAND_REQUEST_STAT_INFO to "
<< command_line::get_arg(vm, arg_ip) << ":" << command_line::get_arg(vm, arg_port)
<< " - " << e.what();
rs.COMMAND_REQUEST_STAT_INFO_status = ss.str();
}
}
if (command_line::get_arg(vm, arg_request_net_state)) {
++pot.time;
h = get_proof_of_trust_hash(pot);
Crypto::generate_signature(h, pubk, prvk, pot.sign);
COMMAND_REQUEST_NETWORK_STATE::request req{ pot };
COMMAND_REQUEST_NETWORK_STATE::response res;
try {
withTimeout(dispatcher, timeout, [&] {
levin.invoke(COMMAND_REQUEST_NETWORK_STATE::ID, req, res);
});
rs.ns_rsp = std::move(res);
rs.COMMAND_REQUEST_NETWORK_STATE_status = "OK";
} catch (const std::exception &e) {
std::stringstream ss;
ss << "ERROR: Failed to invoke remote command COMMAND_REQUEST_NETWORK_STATE to "
<< command_line::get_arg(vm, arg_ip) << ":" << command_line::get_arg(vm, arg_port)
<< " - " << e.what();
rs.COMMAND_REQUEST_NETWORK_STATE_status = ss.str();
}
}
} catch (const std::exception& e) {
std::cout << "ERROR: " << e.what() << std::endl;
return false;
}
get_response_schema_as_json(std::cout, rs) << std::endl;
return true;
}
//---------------------------------------------------------------------------------------------------------------
bool generate_and_print_keys() {
Crypto::PublicKey pk;
Crypto::SecretKey sk;
generate_keys(pk, sk);
std::cout << "PUBLIC KEY: " << Common::podToHex(pk) << ENDL
<< "PRIVATE KEY: " << Common::podToHex(sk);
return true;
}
int main(int argc, char *argv[]) {
// Declare the supported options.
po::options_description desc_general("General options");
command_line::add_arg(desc_general, command_line::arg_help);
po::options_description desc_params("Connectivity options");
command_line::add_arg(desc_params, arg_ip);
command_line::add_arg(desc_params, arg_port);
command_line::add_arg(desc_params, arg_rpc_port);
command_line::add_arg(desc_params, arg_timeout);
command_line::add_arg(desc_params, arg_request_stat_info);
command_line::add_arg(desc_params, arg_request_net_state);
command_line::add_arg(desc_params, arg_generate_keys);
command_line::add_arg(desc_params, arg_peer_id);
command_line::add_arg(desc_params, arg_priv_key);
command_line::add_arg(desc_params, arg_get_daemon_info);
po::options_description desc_all;
desc_all.add(desc_general).add(desc_params);
po::variables_map vm;
bool r = command_line::handle_error_helper(desc_all, [&]() {
po::store(command_line::parse_command_line(argc, argv, desc_general, true), vm);
if (command_line::get_arg(vm, command_line::arg_help))
{
std::cout << desc_all << ENDL;
return false;
}
po::store(command_line::parse_command_line(argc, argv, desc_params, false), vm);
po::notify(vm);
return true;
});
if (!r)
return 1;
if (command_line::has_arg(vm, arg_request_stat_info) || command_line::has_arg(vm, arg_request_net_state)) {
return handle_request_stat(vm, command_line::get_arg(vm, arg_peer_id)) ? 0 : 1;
}
if (command_line::has_arg(vm, arg_get_daemon_info)) {
return handle_get_daemon_info(vm) ? 0 : 1;
}
if (command_line::has_arg(vm, arg_generate_keys)) {
return generate_and_print_keys() ? 0 : 1;
}
std::cerr << "Not enough arguments." << ENDL;
std::cerr << desc_all << ENDL;
return 1;
}
#endif | 39.118557 | 213 | 0.620108 |
80cd25b802fe1fcb2866dd63ccffaea3e866a66b | 318 | asm | Assembly | programs/oeis/131/A131439.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/131/A131439.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/131/A131439.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A131439: Inverse binomial transform of A131438 (assuming zero offset in both sequences)
; 1,7,14,18,22,26,30,34,38,42,46,50,54,58,62,66,70,74,78,82,86,90,94,98,102,106,110,114,118,122,126,130,134,138,142,146,150,154,158,162,166,170,174,178,182
mov $2,$0
lpb $0
mov $0,1
mul $2,4
lpe
mul $0,5
add $0,$2
add $0,1
| 26.5 | 155 | 0.688679 |
60594b46548a3bd3637a61b68b85e9e90b729330 | 30,239 | ps1 | PowerShell | Tests/Unit/MSFT_WaitForADDomain.Tests.ps1 | rdbartram/xActiveDirectory | 2922053bfecdba77e1eac80943919cdec760aafb | [
"MIT"
] | null | null | null | Tests/Unit/MSFT_WaitForADDomain.Tests.ps1 | rdbartram/xActiveDirectory | 2922053bfecdba77e1eac80943919cdec760aafb | [
"MIT"
] | null | null | null | Tests/Unit/MSFT_WaitForADDomain.Tests.ps1 | rdbartram/xActiveDirectory | 2922053bfecdba77e1eac80943919cdec760aafb | [
"MIT"
] | null | null | null | $script:dscModuleName = 'ActiveDirectoryDsc'
$script:dscResourceName = 'MSFT_WaitForADDomain'
#region HEADER
# Unit Test Template Version: 1.2.4
$script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or `
(-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) )
{
& git @('clone', 'https://github.com/PowerShell/DscResource.Tests.git', (Join-Path -Path $script:moduleRoot -ChildPath 'DscResource.Tests'))
}
Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath (Join-Path -Path 'DSCResource.Tests' -ChildPath 'TestHelper.psm1')) -Force
$TestEnvironment = Initialize-TestEnvironment `
-DSCModuleName $script:dscModuleName `
-DSCResourceName $script:dscResourceName `
-ResourceType 'Mof' `
-TestType Unit
#endregion HEADER
function Invoke-TestSetup
{
}
function Invoke-TestCleanup
{
Restore-TestEnvironment -TestEnvironment $TestEnvironment
}
# Begin Testing
try
{
Invoke-TestSetup
InModuleScope $script:dscResourceName {
$mockUserName = 'User1'
$mockDomainUserCredential = New-Object -TypeName 'System.Management.Automation.PSCredential' -ArgumentList @(
$mockUserName,
(ConvertTo-SecureString -String 'Password' -AsPlainText -Force)
)
$mockDomainName = 'example.com'
$mockSiteName = 'Europe'
$mockDefaultParameters = @{
DomainName = $mockDomainName
Verbose = $true
}
#region Function Get-TargetResource
Describe 'WaitForADDomain\Get-TargetResource' -Tag 'Get' {
Context 'When the system is in the desired state' {
Context 'When no domain controller is found in the domain' {
BeforeAll {
Mock -CommandName Find-DomainController -MockWith {
return $null
}
$getTargetResourceParameters = $mockDefaultParameters.Clone()
}
It 'Should return the same values as passed as parameters' {
$result = Get-TargetResource @getTargetResourceParameters
$result.DomainName | Should -Be $mockDomainName
}
It 'Should return default value for property WaitTimeout' {
$getTargetResourceResult = Get-TargetResource @getTargetResourceParameters
$getTargetResourceResult.WaitTimeout | Should -Be 300
}
It 'Should return $null for the rest of the properties' {
$getTargetResourceResult = Get-TargetResource @getTargetResourceParameters
$getTargetResourceResult.SiteName | Should -BeNullOrEmpty
$getTargetResourceResult.Credential | Should -BeNullOrEmpty
$getTargetResourceResult.RestartCount | Should -Be 0
}
}
Context 'When a domain controller is found in the domain' {
BeforeAll {
Mock -CommandName Find-DomainController -MockWith {
return New-Object -TypeName PSObject |
Add-Member -MemberType ScriptProperty -Name 'Domain' -Value {
New-Object -TypeName PSObject |
Add-Member -MemberType ScriptMethod -Name 'ToString' -Value {
return $mockDomainName
} -PassThru -Force
} -PassThru |
Add-Member -MemberType NoteProperty -Name 'SiteName' -Value $mockSiteName -PassThru -Force
}
$getTargetResourceParameters = $mockDefaultParameters.Clone()
}
Context 'When using the default parameters' {
It 'Should return the same values as passed as parameters' {
$result = Get-TargetResource @getTargetResourceParameters
$result.DomainName | Should -Be $mockDomainName
}
It 'Should return default value for property WaitTimeout' {
$getTargetResourceResult = Get-TargetResource @getTargetResourceParameters
$getTargetResourceResult.WaitTimeout | Should -Be 300
}
It 'Should return $null for the rest of the properties' {
$getTargetResourceResult = Get-TargetResource @getTargetResourceParameters
$getTargetResourceResult.SiteName | Should -Be 'Europe'
$getTargetResourceResult.Credential | Should -BeNullOrEmpty
$getTargetResourceResult.RestartCount | Should -Be 0
}
}
Context 'When using all available parameters' {
BeforeAll {
$getTargetResourceParameters['Credential'] = $mockDomainUserCredential
$getTargetResourceParameters['SiteName'] = 'Europe'
$getTargetResourceParameters['WaitTimeout'] = 600
$getTargetResourceParameters['RestartCount'] = 2
}
It 'Should return the same values as passed as parameters' {
$result = Get-TargetResource @getTargetResourceParameters
$result.DomainName | Should -Be $mockDomainName
$result.SiteName | Should -Be 'Europe'
$result.WaitTimeout | Should -Be 600
$result.RestartCount | Should -Be 2
$result.Credential.UserName | Should -Be $mockUserName
}
}
Context 'When using all available parameters' {
BeforeAll {
$mockBuiltInCredentialName = 'BuiltInCredential'
# Mock PsDscRunAsCredential context.
$PsDscContext = @{
RunAsUser = $mockBuiltInCredentialName
}
Mock -CommandName Write-Verbose -ParameterFilter {
$Message -eq ($script:localizedData.ImpersonatingCredentials -f $mockBuiltInCredentialName)
} -MockWith {
Write-Verbose -Message ('VERBOSE OUTPUT FROM MOCK: {0}' -f $Message) -Verbose
}
$getTargetResourceParameters = $mockDefaultParameters.Clone()
}
It 'Should return the same values as passed as parameters' {
$result = Get-TargetResource @getTargetResourceParameters
$result.DomainName | Should -Be $mockDomainName
$result.Credential | Should -BeNullOrEmpty
Assert-MockCalled -CommandName Write-Verbose -Exactly -Times 1 -Scope It
}
}
}
}
}
#endregion
#region Function Test-TargetResource
Describe 'WaitForADDomain\Test-TargetResource' -tag 'Test' {
Context 'When the system is in the desired state' {
Context 'When a domain controller is found' {
BeforeAll {
Mock -CommandName Compare-TargetResourceState -MockWith {
return @(
@{
ParameterName = 'IsAvailable'
InDesiredState = $true
}
)
}
}
It 'Should return $true' {
$testTargetResourceResult = Test-TargetResource @mockDefaultParameters
$testTargetResourceResult | Should -BeTrue
Assert-MockCalled -CommandName Compare-TargetResourceState -Exactly -Times 1 -Scope It
}
}
Context 'When a domain controller is found, and RestartCount was used' {
BeforeAll {
Mock -CommandName Compare-TargetResourceState -MockWith {
return @(
@{
ParameterName = 'IsAvailable'
InDesiredState = $true
}
)
}
Mock -CommandName Remove-Item
Mock -CommandName Test-Path -MockWith {
return $true
}
$testTargetResourceParameters = $mockDefaultParameters.Clone()
$testTargetResourceParameters['RestartCount'] = 2
}
It 'Should return $true' {
$testTargetResourceResult = Test-TargetResource @testTargetResourceParameters
$testTargetResourceResult | Should -BeTrue
Assert-MockCalled -CommandName Compare-TargetResourceState -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Test-Path -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Remove-Item -Exactly -Times 1 -Scope It
}
}
}
Context 'When the system is not in the desired state' {
Context 'When a domain controller cannot be reached' {
BeforeAll {
Mock -CommandName Compare-TargetResourceState -MockWith {
return @(
@{
ParameterName = 'IsAvailable'
InDesiredState = $false
}
)
}
}
It 'Should return $false' {
$testTargetResourceResult = Test-TargetResource @mockDefaultParameters
$testTargetResourceResult | Should -BeFalse
Assert-MockCalled -CommandName Compare-TargetResourceState -Exactly -Times 1 -Scope It
}
}
}
}
#endregion
Describe 'MSFT_ADDomainTrust\Compare-TargetResourceState' -Tag 'Compare' {
BeforeAll {
$mockGetTargetResource_Absent = {
return @{
DomainName = $mockDomainName
SiteName = $null
Credential = $null
WaitTimeout = 300
RestartCount = 0
IsAvailable = $false
}
}
$mockGetTargetResource_Present = {
return @{
DomainName = $mockDomainName
SiteName = $mockSiteName
Credential = $null
WaitTimeout = 300
RestartCount = 0
IsAvailable = $true
}
}
}
Context 'When the system is in the desired state' {
Context 'When a domain controller is found' {
BeforeAll {
Mock -CommandName Get-TargetResource -MockWith $mockGetTargetResource_Present
$testTargetResourceParameters = $mockDefaultParameters.Clone()
$testTargetResourceParameters['DomainName'] = $mockDomainName
}
It 'Should return the correct values' {
$compareTargetResourceStateResult = Compare-TargetResourceState @testTargetResourceParameters
$compareTargetResourceStateResult | Should -HaveCount 1
$comparedReturnValue = $compareTargetResourceStateResult.Where( { $_.ParameterName -eq 'IsAvailable' })
$comparedReturnValue | Should -Not -BeNullOrEmpty
$comparedReturnValue.Expected | Should -Be $true
$comparedReturnValue.Actual | Should -Be $true
$comparedReturnValue.InDesiredState | Should -BeTrue
Assert-MockCalled -CommandName Get-TargetResource -Exactly -Times 1 -Scope It
}
}
}
Context 'When the system is not in the desired state' {
BeforeAll {
Mock -CommandName Get-TargetResource -MockWith $mockGetTargetResource_Absent
$testTargetResourceParameters = $mockDefaultParameters.Clone()
$testTargetResourceParameters['DomainName'] = $mockDomainName
}
It 'Should return the correct values' {
$compareTargetResourceStateResult = Compare-TargetResourceState @testTargetResourceParameters
$compareTargetResourceStateResult | Should -HaveCount 1
$comparedReturnValue = $compareTargetResourceStateResult.Where( { $_.ParameterName -eq 'IsAvailable' })
$comparedReturnValue | Should -Not -BeNullOrEmpty
$comparedReturnValue.Expected | Should -Be $true
$comparedReturnValue.Actual | Should -Be $false
$comparedReturnValue.InDesiredState | Should -BeFalse
Assert-MockCalled -CommandName Get-TargetResource -Exactly -Times 1 -Scope It
}
}
}
#region Function Set-TargetResource
Describe 'WaitForADDomain\Set-TargetResource' -Tag 'Set' {
BeforeEach {
$global:DSCMachineStatus = 0
}
Context 'When the system is in the desired state' {
BeforeAll {
Mock -CommandName Remove-RestartLogFile
Mock -CommandName Receive-Job
Mock -CommandName Start-Job
Mock -CommandName Wait-Job
Mock -CommandName Remove-Job
Mock -CommandName Compare-TargetResourceState -MockWith {
return @(
@{
ParameterName = 'IsAvailable'
InDesiredState = $true
}
)
}
}
Context 'When a domain controller is found' {
It 'Should not throw and call the correct mocks' {
{ Set-TargetResource @mockDefaultParameters } | Should -Not -Throw
$global:DSCMachineStatus | Should -Be 0
Assert-MockCalled -CommandName Compare-TargetResourceState -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Receive-Job -Exactly -Times 0 -Scope It
Assert-MockCalled -CommandName Start-Job -Exactly -Times 0 -Scope It
Assert-MockCalled -CommandName Wait-Job -Exactly -Times 0 -Scope It
Assert-MockCalled -CommandName Remove-Job -Exactly -Times 0 -Scope It
Assert-MockCalled -CommandName Remove-RestartLogFile -Exactly -Times 0 -Scope It
}
}
}
Context 'When the system is not in the desired state' {
BeforeAll {
Mock -CommandName Remove-RestartLogFile
Mock -CommandName Receive-Job
<#
The code being tested is using parameter Job, so here
that parameter must be avoided so that we don't mock
in an endless loop.
#>
Mock -CommandName Start-Job -ParameterFilter {
$PSBoundParameters.ContainsKey('ArgumentList')
} -MockWith {
<#
Need to mock an object by actually creating a job
that completes successfully.
#>
$mockJobObject = Start-Job -ScriptBlock {
Start-Sleep -Milliseconds 1
}
Remove-Job -Id $mockJobObject.Id -Force
return $mockJobObject
}
<#
The code being tested is using parameter Job, so here
that parameter must be avoided so that we don't mock
in an endless loop.
#>
Mock -CommandName Remove-Job -ParameterFilter {
$null -ne $Job
}
Mock -CommandName Compare-TargetResourceState -MockWith {
return @(
@{
ParameterName = 'IsAvailable'
InDesiredState = $false
}
)
}
}
Context 'When a domain controller is reached before the timeout period' {
BeforeAll {
<#
The code being tested is using parameter Job, so here
that parameter must be avoided so that we don't mock
in an endless loop.
#>
Mock -CommandName Wait-Job -ParameterFilter {
$null -ne $Job
} -MockWith {
<#
Need to mock an object by actually creating a job
that completes successfully.
#>
$mockJobObject = Start-Job -ScriptBlock {
Start-Sleep -Milliseconds 1
}
<#
The variable name must not be the same as the one
used in the call to Wait-Job.
#>
$mockWaitJobObject = Wait-Job -Id $mockJobObject.Id
Remove-Job -Id $mockJobObject.Id -Force
return $mockJobObject
}
}
It 'Should not throw and call the correct mocks' {
{ Set-TargetResource @mockDefaultParameters } | Should -Not -Throw
$global:DSCMachineStatus | Should -Be 0
Assert-MockCalled -CommandName Compare-TargetResourceState -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Receive-Job -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Start-Job -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Wait-Job -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Remove-Job -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Remove-RestartLogFile -Exactly -Times 0 -Scope It
}
Context 'When a restart was requested' {
BeforeAll {
$setTagetResourceParameters = $mockDefaultParameters.Clone()
$setTagetResourceParameters['RestartCount'] = 1
}
It 'Should not throw and call the correct mocks' {
{ Set-TargetResource @setTagetResourceParameters } | Should -Not -Throw
$global:DSCMachineStatus | Should -Be 0
Assert-MockCalled -CommandName Remove-RestartLogFile -Exactly -Times 1 -Scope It
}
}
}
Context 'When the script that searches for a domain controller fails' {
BeforeAll {
<#
The code being tested is using parameter Job, so here
that parameter must be avoided so that we don't mock
in an endless loop.
#>
Mock -CommandName Wait-Job -ParameterFilter {
$null -ne $Job
} -MockWith {
<#
Need to mock an object by actually creating a job
that completes successfully.
#>
$mockJobObject = Start-Job -ScriptBlock {
throw 'Mocked error in mocked script'
}
<#
The variable name must not be the same as the one
used in the call to Wait-Job.
#>
$mockWaitJobObject = Wait-Job -Id $mockJobObject.Id
Remove-Job -Id $mockJobObject.Id -Force
return $mockJobObject
}
$setTagetResourceParameters = $mockDefaultParameters.Clone()
<#
To test that the background job output is written when
the job fails even if `Verbose` is not set.
#>
$setTagetResourceParameters.Remove('Verbose')
}
It 'Should not throw and call the correct mocks' {
{ Set-TargetResource @setTagetResourceParameters } | Should -Throw $script:localizedData.NoDomainController
$global:DSCMachineStatus | Should -Be 0
Assert-MockCalled -CommandName Compare-TargetResourceState -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Receive-Job -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Start-Job -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Wait-Job -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Remove-Job -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Remove-RestartLogFile -Exactly -Times 0 -Scope It
}
}
Context 'When a domain controller cannot be reached before the timeout period' {
BeforeAll {
<#
The code being tested is using parameter Job, so here
that parameter must be avoided so that we don't mock
in an endless loop.
#>
Mock -CommandName Wait-Job -ParameterFilter {
$null -ne $Job
} -MockWith {
return $null
}
}
It 'Should throw the correct error message and call the correct mocks' {
{ Set-TargetResource @mockDefaultParameters } | Should -Throw $script:localizedData.NoDomainController
$global:DSCMachineStatus | Should -Be 0
Assert-MockCalled -CommandName Compare-TargetResourceState -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Receive-Job -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Start-Job -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Wait-Job -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Remove-Job -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Remove-RestartLogFile -Exactly -Times 0 -Scope It
}
Context 'When a restart is requested when a domain controller cannot be found' {
BeforeAll {
Mock -CommandName Get-Content
Mock -CommandName Set-Content
<#
The code being tested is using parameter Job, so here
that parameter must be avoided so that we don't mock
in an endless loop.
#>
Mock -CommandName Wait-Job -ParameterFilter {
$null -ne $Job
} -MockWith {
return $null
}
$setTagetResourceParameters = $mockDefaultParameters.Clone()
$setTagetResourceParameters['RestartCount'] = 1
}
It 'Should throw the correct error message and call the correct mocks' {
{ Set-TargetResource @setTagetResourceParameters } | Should -Throw $script:localizedData.NoDomainController
$global:DSCMachineStatus | Should -Be 1
Assert-MockCalled -CommandName Compare-TargetResourceState -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Receive-Job -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Start-Job -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Wait-Job -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Remove-Job -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Get-Content -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Set-Content -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Remove-RestartLogFile -Exactly -Times 0 -Scope It
}
}
}
}
}
#endregion
Describe 'MSFT_ADDomainTrust\WaitForDomainControllerScriptBlock' -Tag 'Helper' {
BeforeAll {
Mock -CommandName Clear-DnsClientCache
Mock -CommandName Start-Sleep
}
Context 'When a domain controller cannot be found' {
BeforeAll {
Mock -CommandName Find-DomainController
}
It 'Should not throw and call the correct mocks' {
Invoke-Command -ScriptBlock $script:waitForDomainControllerScriptBlock -ArgumentList @(
'contoso.com' # DomainName
'Europe', # SiteName
$mockDomainUserCredential, # Credential
$true # RunOnce
)
Assert-MockCalled -CommandName Find-DomainController -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Clear-DnsClientCache -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Start-Sleep -Exactly -Times 1 -Scope It
}
}
Context 'When a domain controller is found' {
BeforeAll {
Mock -CommandName Find-DomainController -MockWith {
return New-Object -TypeName 'PSObject'
}
}
It 'Should not throw and call the correct mocks' {
Invoke-Command -ScriptBlock $script:waitForDomainControllerScriptBlock -ArgumentList @(
'contoso.com' # DomainName
'Europe', # SiteName
$null, # Credential
$true # RunOnce
)
Assert-MockCalled -CommandName Find-DomainController -Exactly -Times 1 -Scope It
Assert-MockCalled -CommandName Clear-DnsClientCache -Exactly -Times 0 -Scope It
Assert-MockCalled -CommandName Start-Sleep -Exactly -Times 0 -Scope It
}
}
}
}
#endregion
}
finally
{
Invoke-TestCleanup
}
| 47.620472 | 145 | 0.475049 |
803111b0cd7e86f7a29c894bc692a09c475115ed | 21,235 | java | Java | Teilimplementierungen_QUALM/Schreibweise_Abkuerzungen_Rechtschreibfehler/sourcecode/Stanford_NER/src/edu/stanford/nlp/util/Iterables.java | kieferca/qualm | 165c1ad62b1e5924ad2aab5c897b921a33528f48 | [
"MIT"
] | null | null | null | Teilimplementierungen_QUALM/Schreibweise_Abkuerzungen_Rechtschreibfehler/sourcecode/Stanford_NER/src/edu/stanford/nlp/util/Iterables.java | kieferca/qualm | 165c1ad62b1e5924ad2aab5c897b921a33528f48 | [
"MIT"
] | null | null | null | Teilimplementierungen_QUALM/Schreibweise_Abkuerzungen_Rechtschreibfehler/sourcecode/Stanford_NER/src/edu/stanford/nlp/util/Iterables.java | kieferca/qualm | 165c1ad62b1e5924ad2aab5c897b921a33528f48 | [
"MIT"
] | null | null | null | package edu.stanford.nlp.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.function.Function;
/**
* Utilities for helping out with Iterables as Collections is to Collection.
*
* NB: Some Iterables returned by methods in this class return Iterators that
* assume a call to hasNext will precede each call to next. While this usage
* is not up to the Java Iterator spec, it should work fine with
* e.g. the Java enhanced for-loop.
*
* <p>
*
* Methods in Iterators are merged.
*
* @author dramage
* @author dlwh {@link #flatMap(Iterable, Function)}
* @author Huy Nguyen (htnguyen@cs.stanford.edu)
*
*/
public class Iterables {
/**
* Transformed view of the given iterable. Returns the output
* of the given function when applied to each element of the
* iterable.
*/
public static <K,V> Iterable<V> transform(
final Iterable<K> iterable, final Function<? super K,? extends V> function) {
return new Iterable<V>() {
public Iterator<V> iterator() {
return new Iterator<V>() {
Iterator<K> inner = iterable.iterator();
public boolean hasNext() {
return inner.hasNext();
}
public V next() {
return function.apply(inner.next());
}
public void remove() {
inner.remove();
}
};
}
};
}
/**
* Filtered view of the given iterable. Returns only those elements
* from the iterable for which the given Function returns true.
*/
public static <T> Iterable<T> filter(
final Iterable<T> iterable, final Function<T,Boolean> accept) {
return new Iterable<T>() {
public Iterator<T> iterator() {
return new Iterator<T>() {
Iterator<T> inner = iterable.iterator();
boolean queued = false;
T next = null;
public boolean hasNext() {
prepare();
return queued;
}
public T next() {
prepare();
if (!queued) {
throw new RuntimeException("Filter .next() called with no next");
}
T rv = next;
next = null;
queued = false;
return rv;
}
public void prepare() {
if (queued) {
return;
}
while (inner.hasNext()) {
T next = inner.next();
if (accept.apply(next)) {
this.next = next;
this.queued = true;
return;
}
}
}
public void remove() {
throw new UnsupportedOperationException();
}
};
}
};
}
/**
* Casts all values in the given Iterable to the given type.
*/
public static <T> Iterable<T> cast(
final Iterable<?> iterable, final Class<? extends T> type) {
return new Iterable<T>() {
public Iterator<T> iterator() {
return new Iterator<T>() {
Iterator<?> inner = iterable.iterator();
public boolean hasNext() {
return inner.hasNext();
}
public T next() {
return type.cast(inner.next());
}
public void remove() {
inner.remove();
}
};
}
};
}
/**
* Returns a shortened view of an iterator. Returns at most <code>max</code> elements.
*/
public static <T> Iterable<T> take(T[] array, int max) {
return take(Arrays.asList(array),max);
}
/**
* Returns a shortened view of an iterator. Returns at most <code>max</code> elements.
*/
public static <T> Iterable<T> take(
final Iterable<T> iterable, final int max) {
return new Iterable<T>() {
final Iterator<T> iterator = iterable.iterator();
// @Override
public Iterator<T> iterator() {
return new Iterator<T>() {
int i = 0;
// @Override
public boolean hasNext() {
return i < max && iterator.hasNext();
}
// @Override
public T next() {
i++;
return iterator.next();
}
// @Override
public void remove() {
iterator.remove();
}
};
}
};
}
/**
* Returns a view of the given data, ignoring the first toDrop elements.
*/
public static <T> Iterable<T> drop(T[] array, int toDrop) {
return drop(Arrays.asList(array),toDrop);
}
/**
* Returns a view of the given data, ignoring the first toDrop elements.
*/
public static <T> Iterable<T> drop(
final Iterable<T> iterable, final int toDrop) {
return new Iterable<T>() {
final Iterator<T> iterator = iterable.iterator();
// @Override
public Iterator<T> iterator() {
return new Iterator<T>() {
int skipped = 0;
// @Override
public boolean hasNext() {
while (skipped < toDrop && iterator.hasNext()) {
iterator.next();
skipped += 1;
}
return iterator.hasNext();
}
// @Override
public T next() {
while (skipped < toDrop && iterator.hasNext()) {
iterator.next();
skipped += 1;
}
return iterator.next();
}
// @Override
public void remove() {
iterator.remove();
}
};
}
};
}
/**
* Chains together an Iterable of Iterables after transforming each one.
* Equivalent to Iterables.transform(Iterables.chain(iterables),trans);
*/
public static <T,U> Iterable<U> flatMap(final Iterable<? extends Iterable<T>> iterables, Function<? super T,U> trans) {
return transform(chain(iterables),trans);
}
/**
* Chains together a set of Iterables of compatible types. Returns all
* elements of the first iterable, then all of the second, then the third,
* etc.
*/
public static <T> Iterable<T> chain(final Iterable<? extends Iterable<T>> iterables) {
return new Iterable<T>() {
public Iterator<T> iterator() {
final Iterator<? extends Iterable<T>> iterators = iterables.iterator();
return new Iterator<T>() {
private Iterator<T> current = null;
public boolean hasNext() {
// advance current iterator if necessary, return false at end
while (current == null || !current.hasNext()) {
if (iterators.hasNext()) {
current = iterators.next().iterator();
} else {
return false;
}
}
return true;
}
public T next() {
return current.next();
}
public void remove() {
current.remove();
}
};
}
};
}
/**
* Chains together all Iterables of type T as given in an array or
* varargs parameter.
*/
public static <T> Iterable<T> chain(final Iterable<T> ... iterables) {
return chain(Arrays.asList(iterables));
}
/**
* Chains together all arrays of type T[] as given in an array or
* varargs parameter.
*/
public static <T> Iterable<T> chain(final T[] ... arrays) {
LinkedList<Iterable<T>> iterables = new LinkedList<>();
for (T[] array : arrays) {
iterables.add(Arrays.asList(array));
}
return chain(iterables);
}
/**
* Zips two iterables into one iterable over Pairs of corresponding
* elements in the two underlying iterables. Ends when the shorter
* iterable ends.
*/
public static <T1, T2> Iterable<Pair<T1,T2>> zip(
final Iterable<T1> iter1, final Iterable<T2> iter2) {
return new Iterable<Pair<T1,T2>>() {
public Iterator<Pair<T1, T2>> iterator() {
return zip(iter1.iterator(), iter2.iterator());
}
};
}
/**
* Zips two iterables into one iterable over Pairs of corresponding
* elements in the two underlying iterables. Ends when the shorter
* iterable ends.
*/
public static <T1,T2> Iterable<Pair<T1,T2>> zip(
Iterable<T1> iter, T2 array[]) {
return zip(iter, Arrays.asList(array));
}
/**
* Zips two iterables into one iterable over Pairs of corresponding
* elements in the two underlying iterables. Ends when the shorter
* iterable ends.
*/
public static <T1, T2> Iterable<Pair<T1,T2>> zip(
T1 array[], Iterable<T2> iter) {
return zip(Arrays.asList(array), iter);
}
/**
* Zips two iterables into one iterable over Pairs of corresponding
* elements in the two underlying iterables. Ends when the shorter
* iterable ends.
*/
public static <T1, T2> Iterable<Pair<T1,T2>> zip(
T1 array1[], T2 array2[]) {
return zip(Arrays.asList(array1), Arrays.asList(array2));
}
/**
* Zips up two iterators into one iterator over Pairs of corresponding
* elements. Ends when the shorter iterator ends.
*/
public static <T1,T2> Iterator<Pair<T1,T2>> zip(
final Iterator<T1> iter1, final Iterator<T2> iter2) {
return new Iterator<Pair<T1,T2>>() {
public boolean hasNext() {
return iter1.hasNext() && iter2.hasNext();
}
public Pair<T1, T2> next() {
return new Pair<>(iter1.next(), iter2.next());
}
public void remove() {
iter1.remove();
iter2.remove();
}
};
}
/**
* A comparator used by the merge functions to determine which of two
* iterators to increment by one of the merge functions.
*
* @param <V1> Type of first iterator
* @param <V2> Type of second iterator
*/
public interface IncrementComparator<V1,V2> {
/**
* Returns -1 if the value of a should come before the value of b,
* +1 if the value of b should come before the value of a, or 0 if
* the two should be merged together.
*/
public int compare(V1 a, V2 b);
}
/**
* Iterates over pairs of objects from two (sorted) iterators such that
* each pair a \in iter1, b \in iter2 returned has comparator.compare(a,b)==0.
* If the comparator says that a and b are not equal, we increment the
* iterator of the smaller value. If the comparator says that a and b are
* equal, we return that pair and increment both iterators.
*
* This is used, e.g. to return lines from two input files that have
* the same "key" as determined by the given comparator.
*
* The comparator will always be passed elements from the first iter as
* the first argument.
*/
public static <V1,V2> Iterable<Pair<V1,V2>> merge(
final Iterable<V1> iter1, final Iterable<V2> iter2,
final IncrementComparator<V1,V2> comparator) {
return new Iterable<Pair<V1,V2>>() {
Iterator<V1> iterA = iter1.iterator();
Iterator<V2> iterB = iter2.iterator();
public Iterator<Pair<V1, V2>> iterator() {
return new Iterator<Pair<V1,V2>>() {
boolean ready = false;
Pair<V1,V2> pending = null;
public boolean hasNext() {
if (!ready) {
pending = nextPair();
ready = true;
}
return pending != null;
}
public Pair<V1, V2> next() {
if (!ready && !hasNext()) {
throw new IllegalAccessError("Called next without hasNext");
}
ready = false;
return pending;
}
public void remove() {
throw new UnsupportedOperationException("Cannot remove pairs " +
"from a merged iterator");
}
private Pair<V1,V2> nextPair() {
V1 nextA = null;
V2 nextB = null;
while (iterA.hasNext() && iterB.hasNext()) {
// increment iterators are null
if (nextA == null) { nextA = iterA.next(); }
if (nextB == null) { nextB = iterB.next(); }
int cmp = comparator.compare(nextA, nextB);
if (cmp < 0) {
// iterA too small, increment it next time around
nextA = null;
} else if (cmp > 0) {
// iterB too small, increment it next time around
nextB = null;
} else {
// just right - return this pair
return new Pair<>(nextA, nextB);
}
}
return null;
}
};
}
};
}
/**
* Same as {@link #merge(Iterable, Iterable, IncrementComparator)} but using
* the given (symmetric) comparator.
*/
public static <V> Iterable<Pair<V,V>> merge(
final Iterable<V> iter1, final Iterable<V> iter2,
final Comparator<V> comparator) {
final IncrementComparator<V,V> inc = (a, b) -> comparator.compare(a,b);
return merge(iter1, iter2, inc);
}
/**
* Iterates over triples of objects from three (sorted) iterators such that
* for every returned triple a (from iter1), b (from iter2), c (from iter3)
* satisfies the constraint that <code>comparator.compare(a,b) ==
* comparator.compare(a,c) == 0</code>. Internally, this function first
* calls merge(iter1,iter2,comparatorA), and then merges that iterator
* with the iter3 by comparing based on the value returned by iter1.
*
* This is used, e.g. to return lines from three input files that have
* the same "key" as determined by the given comparator.
*/
public static <V1,V2,V3> Iterable<Triple<V1,V2,V3>> merge(
final Iterable<V1> iter1, final Iterable<V2> iter2, final Iterable<V3> iter3,
final IncrementComparator<V1,V2> comparatorA,
final IncrementComparator<V1,V3> comparatorB) {
// partial merge on first two iterables
Iterable<Pair<V1,V2>> partial = merge(iter1, iter2, comparatorA);
IncrementComparator<Pair<V1,V2>,V3> inc =
new IncrementComparator<Pair<V1,V2>,V3>() {
public int compare(Pair<V1, V2> a, V3 b) {
return comparatorB.compare(a.first, b);
}
};
// flattens the pairs into triple
Function<Pair<Pair<V1,V2>, V3>, Triple<V1,V2,V3>> flatten =
in -> new Triple<>(in.first.first, in.first.second, in.second);
return transform(merge(partial, iter3, inc), flatten);
}
/**
* Same as {@link #merge(Iterable, Iterable, Iterable, IncrementComparator, IncrementComparator)}
* but using the given (symmetric) comparator.
*/
public static <V> Iterable<Triple<V,V,V>> merge(
final Iterable<V> iter1, final Iterable<V> iter2, Iterable<V> iter3,
final Comparator<V> comparator) {
final IncrementComparator<V,V> inc = (a, b) -> comparator.compare(a,b);
return merge(iter1, iter2, iter3, inc, inc);
}
/**
* Groups consecutive elements from the given iterable based on the value
* in the given comparator. Each inner iterable will iterate over consecutive
* items from the input until the comparator says that the next item is not
* equal to the previous.
*/
public static <V> Iterable<Iterable<V>> group(final Iterable<V> iterable,
final Comparator<V> comparator) {
return new Iterable<Iterable<V>>() {
public Iterator<Iterable<V>> iterator() {
return new Iterator<Iterable<V>>() {
/** Actual iterator */
Iterator<V> it = iterable.iterator();
/** Next element to return */
V next;
public boolean hasNext() {
return next != null || it.hasNext();
}
public Iterable<V> next() {
return () -> new Iterator<V>() {
V last = null;
public boolean hasNext() {
// get next if we need to and one is available
if (next == null && it.hasNext()) {
next = it.next();
}
// if next and last both have values, compare them
if (last != null && next != null) {
return comparator.compare(last, next) == 0;
}
// one of them was not null - have more if it was next
return next != null;
}
public V next() {
if (!hasNext()) {
throw new IllegalStateException("Didn't have next");
}
V rv = next;
last = next;
next = null;
return rv;
}
public void remove() {
throw new UnsupportedOperationException();
}
};
}
public void remove() {
throw new UnsupportedOperationException();
}
};
}
};
}
/**
* Returns a string representation of the contents of calling toString
* on each element of the given iterable, joining the elements together
* with the given glue.
*/
public static <E> String toString(Iterable<E> iter, String glue) {
StringBuilder builder = new StringBuilder();
for (Iterator<E> it = iter.iterator(); it.hasNext(); ) {
builder.append(it.next());
if (it.hasNext()) {
builder.append(glue);
}
}
return builder.toString();
}
/**
* Sample k items uniformly from an Iterable of size n (without replacement).
*
* @param items The items from which to sample.
* @param n The total number of items in the Iterable.
* @param k The number of items to sample.
* @param random The random number generator.
* @return An Iterable of k items, chosen randomly from the original n items.
*/
public static <T> Iterable<T> sample(Iterable<T> items, int n, int k, Random random) {
// assemble a list of all indexes
List<Integer> indexes = new ArrayList<>();
for (int i = 0; i < n; ++i) {
indexes.add(i);
}
// shuffle the indexes and select the first k
Collections.shuffle(indexes, random);
final Set<Integer> indexSet = Generics.newHashSet(indexes.subList(0, k));
// filter down to only the items at the selected indexes
return Iterables.filter(items, new Function<T, Boolean>() {
private int index = -1;
public Boolean apply(T item) {
++this.index;
return indexSet.contains(this.index);
}
});
}
// /**
// * Returns a dummy collection wrapper for the Iterable that iterates
// * it once to get the size if requested. If the underlying iterable
// * cannot be iterated more than once, you're out of luck.
// */
// public static <E> Collection<E> toCollection(final Iterable<E> iter) {
// return new AbstractCollection<E>() {
// int size = -1;
//
// @Override
// public Iterator<E> iterator() {
// return iter.iterator();
// }
//
// @Override
// public int size() {
// if (size < 0) {
// size = 0;
// for (E elem : iter) { size++; }
// }
// return size;
// }
// };
// }
//
// public static <E,L extends List<E>> L toList(Iterable<E> iter, Class<L> type) {
// try {
// type.newInstance();
// } catch (InstantiationException e) {
// e.printStackTrace();
// } catch (IllegalAccessException e) {
// e.printStackTrace();
// }
// }
/**
* Creates an ArrayList containing all of the Objects returned by the given Iterator.
*/
public static <T> ArrayList<T> asArrayList(Iterator<? extends T> iter) {
ArrayList<T> al = new ArrayList<>();
return (ArrayList<T>) addAll(iter, al);
}
/**
* Creates a HashSet containing all of the Objects returned by the given Iterator.
*/
public static <T> HashSet<T> asHashSet(Iterator<? extends T> iter) {
HashSet<T> hs = new HashSet<>();
return (HashSet<T>) addAll(iter, hs);
}
/**
* Creates a new Collection from the given CollectionFactory, and adds all of the Objects
* returned by the given Iterator.
*/
public static <E> Collection<E> asCollection(Iterator<? extends E> iter, CollectionFactory<E> cf) {
Collection<E> c = cf.newCollection();
return addAll(iter, c);
}
/**
* Adds all of the Objects returned by the given Iterator into the given Collection.
*
* @return the given Collection
*/
public static <T> Collection<T> addAll(Iterator<? extends T> iter, Collection<T> c) {
while (iter.hasNext()) {
c.add(iter.next());
}
return c;
}
/**
* For internal debugging purposes only.
*/
public static void main(String[] args) {
String[] test = {"a", "b", "c"};
List<String> l = Arrays.asList(test);
System.out.println(asArrayList(l.iterator()));
System.out.println(asHashSet(l.iterator()));
System.out.println(asCollection(l.iterator(), CollectionFactory.<String>hashSetFactory()));
ArrayList<String> al = new ArrayList<>();
al.add("d");
System.out.println(addAll(l.iterator(), al));
}
}
| 29.209078 | 121 | 0.572498 |
ef3ee3005066690de08a917d13a62653205bc45d | 4,414 | dart | Dart | lib/Stepper/description.dart | grevity/Flutter-Gallery-Ultimate | 2fa341a25a986df9834af4651b3dcfca27ec3734 | [
"MIT"
] | 2 | 2020-09-23T21:21:54.000Z | 2021-05-25T13:38:35.000Z | lib/Stepper/description.dart | flutter-bharat/Flutter-Gallery-Ultimate | 2fa341a25a986df9834af4651b3dcfca27ec3734 | [
"MIT"
] | 9 | 2020-08-07T09:07:36.000Z | 2021-05-26T01:44:38.000Z | lib/Stepper/description.dart | grevity/Flutter-Gallery-Ultimate | 2fa341a25a986df9834af4651b3dcfca27ec3734 | [
"MIT"
] | 5 | 2020-06-10T07:43:34.000Z | 2020-08-07T06:14:46.000Z | import 'package:flutter/material.dart';
import 'package:flutter_gallery_ultimate/utils/DataFile.dart';
import 'package:flutter_highlight/flutter_highlight.dart';
import 'package:flutter_highlight/themes/googlecode.dart';
class StepperDescription extends StatelessWidget {
@override
Widget build(BuildContext context) {
var code;
Column(
children: [
HighlightView(
code = '''Stepper({
Key key,
@required this.steps,
this.physics,
this.type = StepperType.vertical,
this.currentStep = 0,
this.onStepTapped,
this.onStepContinue,
this.onStepCancel,
this.controlsBuilder,
})
'''
),
],
);
return Scaffold(
appBar: customizedAppBar("Description"),
body: ListView(
children: [
Padding(
padding: const EdgeInsets.all( 15.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 20.0),
Container(
height: 170,
width:370,
color: Colors.blue,
),
SizedBox(height: 30.0),
Container(
// padding: EdgeInsets.symmetric(horizontal: 50.0),
child: Text("Stepper",style: TextStyle(fontSize: 20.0,fontWeight: FontWeight.bold))),
SizedBox(height: 30.0),
Container(
// padding: EdgeInsets.symmetric(horizontal: 16.0),
child: Column(
children: [
Text(" A material stepper widget that displays progress through a sequence of steps. Steppers are particularly useful in the case of forms where one step requires "
"the completion of another one, or where multiple steps need to be completed in order to submit"
" the whole form.",style: TextStyle(fontSize: 15,),),
SizedBox(height: 10.0,),
Text(" The widget is a flexible wrapper. A parent class should pass currentStep to this widget based on some logic triggered by the"
" three callbacks that it provides.",style: TextStyle(fontSize: 15),),
],
),
),
SizedBox(height: 30.0),
Text("Demo Code",style: TextStyle(fontSize: 20.0,fontWeight: FontWeight.bold)),
SizedBox(height: 20.0),
Container(
height: 270,
width: 370,
child: Card(
shadowColor: Colors.grey,
elevation: 15,
child: ListView(
children: [
HighlightView(
// The original code to be highlighted
code,
// Specify language
// It is recommended to give it a value for performance
language: 'dart',
// Specify highlight theme
// All available themes are listed in `themes` folder
theme: googlecodeTheme ,
// Specify padding
padding: EdgeInsets.all(12),
// Specify text style
textStyle: TextStyle(
fontFamily: 'My awesome monospace font',
fontSize: 16,
),
),
],
),
),
),
SizedBox(height: 40.0),
Text("Related Widgets",style: TextStyle(fontSize: 20.0,fontWeight: FontWeight.bold),),
SizedBox(height: 20.0),
Container(
// padding: EdgeInsets.symmetric(horizontal: 15.0,vertical: 20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Step",style: TextStyle(color: Colors.blue,fontSize: 17),),
],
),
),
],
),
),
],
),
);
}
}
| 37.40678 | 196 | 0.470775 |
1331b6d9788f63f559a29f93ff873d815cddb6a9 | 2,561 | h | C | Yoshi-DLC/app/game/MoveBound.h | DeaTh-G/Yoshi-DLC | 56a86350df9b79d14f83f6f0f65500ed12dc17a1 | [
"MIT"
] | 12 | 2021-02-02T20:52:33.000Z | 2022-02-09T15:27:40.000Z | Yoshi-DLC/app/game/MoveBound.h | DeaTh-G/Yoshi-DLC | 56a86350df9b79d14f83f6f0f65500ed12dc17a1 | [
"MIT"
] | 2 | 2021-04-15T14:34:16.000Z | 2021-04-16T10:48:28.000Z | Yoshi-DLC/app/game/MoveBound.h | DeaTh-G/Yoshi-DLC | 56a86350df9b79d14f83f6f0f65500ed12dc17a1 | [
"MIT"
] | 3 | 2021-04-15T14:12:44.000Z | 2022-01-30T02:57:33.000Z | #pragma once
namespace app
{
namespace game
{
class alignas(16) MoveBound : public MoveController
{
public:
struct Description
{
csl::math::Vector3 field_00;
float field_10;
float field_14;
float field_18;
float field_1C;
float field_20;
float field_24;
int field_28;
float field_2C;
int field_30;
int field_34;
PathEvaluator field_38;
short field_48;
short field_4A;
int field_4C;
};
int field_10;
int field_14;
int field_18;
int field_1C;
int field_20;
int field_24;
int field_28;
int field_2C;
Description Descriptor;
int field_80;
int field_84;
int field_88;
int field_8C;
class Listener
{
protected:
virtual void OnBound(csl::math::Plane& const a1) {};
};
private:
inline static FUNCTION_PTR(int, __thiscall, f_Update, ASLR(0x004C5E40), MoveController* This, const fnd::SUpdateInfo& updateInfo);
inline static FUNCTION_PTR(int, __thiscall, f_OnEnter, ASLR(0x004C5E20), MoveController* This);
inline static FUNCTION_PTR(MoveBound*, __thiscall, __dt, ASLR(0x004C5400), MoveBound* This, int a2);
inline static FUNCTION_PTR(MoveBound*, __thiscall, __ct, ASLR(0x004C5860), MoveBound* This);
inline static FUNCTION_PTR(void, __thiscall, f_ResetListener, ASLR(0x004C53A0), MoveBound* This, Listener* a2);
protected:
void* GetRuntimeTypeInfo() override { return (void*)ASLR(0x00F6BDAC); }
public:
inline static FUNCTION_PTR(void, __thiscall, Setup, ASLR(0x004C5930), MoveBound* This, Description* a2);
int Update(const fnd::SUpdateInfo& updateInfo) override
{
return f_Update(this, updateInfo);
}
int OnEnter() override { return f_OnEnter(this); }
~MoveBound() override
{
__dt(this, 0);
}
MoveBound()
{
__ct(this);
}
void ResetListener(Listener* a2)
{
f_ResetListener(this, a2);
}
};
}
} | 30.855422 | 142 | 0.509567 |
abf8bbab3078aadee1c1564b338f4d250925d139 | 4,243 | cpp | C++ | src/gmres.cpp | sinamoeini/mapp4py | 923ef57ee5bdb6231bec2885c09a58993b6c0f1f | [
"MIT"
] | 3 | 2018-06-06T05:43:36.000Z | 2020-07-18T14:31:37.000Z | src/gmres.cpp | sinamoeini/mapp4py | 923ef57ee5bdb6231bec2885c09a58993b6c0f1f | [
"MIT"
] | null | null | null | src/gmres.cpp | sinamoeini/mapp4py | 923ef57ee5bdb6231bec2885c09a58993b6c0f1f | [
"MIT"
] | 7 | 2018-01-16T03:21:20.000Z | 2020-07-20T19:36:13.000Z | #include "gmres.h"
#include "memory.h"
/*--------------------------------------------
--------------------------------------------*/
__GMRES::__GMRES(Atoms* __atoms,int __m,int __dim):
m(__m),
n(__dim*__atoms->natms_lcl),
world(__atoms->world)
{
A_hat=new type0*[m];
*A_hat=new type0[m*(m+1)/2];
for(int i=1;i<m;i++)
A_hat[i]=A_hat[i-1]+i;
Memory::alloc(Ax_hat,m+1);
Memory::alloc(cos_sin,m+1);
Memory::alloc(x_hat,m+1);
Memory::alloc(Q,(m+1)*n);
}
/*--------------------------------------------
--------------------------------------------*/
__GMRES::~__GMRES()
{
Memory::dealloc(Q);
Memory::dealloc(x_hat);
Memory::dealloc(cos_sin);
Memory::dealloc(Ax_hat);
delete [] *A_hat;
delete [] A_hat;
}
/*--------------------------------------------
--------------------------------------------*/
type0 __GMRES::calc(type0* Ax,type0* x)
{
type0 norm_sq_lcl=0.0,norm;
for(int i=0;i<n;i++)
norm_sq_lcl+=Ax[i]*Ax[i];
MPI_Allreduce(&norm_sq_lcl,&norm,1,Vec<type0>::MPI_T,MPI_SUM,world);
norm=sqrt(norm);
type0 norm_inv=1.0/norm;
type0* q=Q;
for(int i=0;i<n;i++,q+=m+1)
x[i]=*q=norm_inv*Ax[i];
Ax_hat[0]=norm;
return norm;
}
/*--------------------------------------------
--------------------------------------------*/
type0 __GMRES::calc(int iter,type0* RESTRICT Ax,type0* RESTRICT x)
{
type0* h=A_hat[iter];
int ivec=iter+1;
for(int j=0;j<ivec;j++)
x_hat[j]=0.0;
type0* q=Q;
for(int i=0;i<n;i++)
{
type0 __ax=Ax[i];
for(int j=0;j<ivec;j++)
x_hat[j]+=__ax*q[j];
q+=m+1;
}
MPI_Allreduce(x_hat,h,ivec,Vec<type0>::MPI_T,MPI_SUM,world);
type0 norm_sq_lcl=0.0,norm;
q=Q;
for(int i=0;i<n;i++,q+=m+1)
{
q[ivec]=Ax[i];
for(int j=0;j<ivec;j++)
q[ivec]-=h[j]*q[j];
norm_sq_lcl+=q[ivec]*q[ivec];
}
MPI_Allreduce(&norm_sq_lcl,&norm,1,Vec<type0>::MPI_T,MPI_SUM,world);
norm=sqrt(norm);
type0 norm_inv=1.0/norm;
q=Q+ivec;
for(int i=0;i<n;i++,q+=m+1)
x[i]=*q*=norm_inv;
type0 tmp;
for(int i=0;i<iter;i++)
{
tmp=cos_sin[i][0]*h[i]-cos_sin[i][1]*h[i+1];
h[i+1]=cos_sin[i][1]*h[i]+cos_sin[i][0]*h[i+1];
h[i]=tmp;
}
tmp=sqrt(h[iter]*h[iter]+norm*norm);
cos_sin[iter][0]=h[iter]/tmp;
cos_sin[iter][1]=-norm/tmp;
h[iter]=cos_sin[iter][0]*h[iter]-cos_sin[iter][1]*norm;
Ax_hat[iter+1]=cos_sin[iter][1]*Ax_hat[iter];
Ax_hat[iter]*=cos_sin[iter][0];
return fabs(Ax_hat[iter+1]);
}
/*--------------------------------------------
--------------------------------------------*/
type0 __GMRES::solve_y(int nvecs,type0* x)
{
/*
printf("H={");
for(int i=0;i<nvecs;i++)
{
printf("{");
for(int j=0;j<nvecs;j++)
{
if(i>j)
printf("0.0");
else
printf("%0.10lf",H[j][i]);
if(j!=nvecs-1)
printf(",");
}
printf("}");
if(i!=nvecs-1)
printf(",");
}
printf("};\n\n");
printf("b={");
for(int i=0;i<nvecs;i++)
{
printf("%0.10lf",b_hat[i]);
if(i!=nvecs-1)
printf(",");
}
printf("};\n\n");*/
for(int i=nvecs-1;i>-1;i--)
{
x_hat[i]=Ax_hat[i];
for(int j=i+1;j<nvecs;j++)
x_hat[i]-=A_hat[j][i]*x_hat[j];
x_hat[i]/=A_hat[i][i];
}
/*
printf("y={");
for(int i=0;i<nvecs;i++)
{
printf("%0.10lf",y[i]);
if(i!=nvecs-1)
printf(",");
}
printf("};\n\n");
*/
/*
printf("r={");
for(int i=0;i<nvecs;i++)
{
type0 r=b_hat[i];
for(int j=i;j<nvecs;j++)
r-=H[j][i]*y[j];
printf("%0.10lf",r);
if(i!=nvecs-1)
printf(",");
}
printf("};\n\n");
*/
type0* q=Q;
for(int i=0;i<n;i++,q+=m+1)
{
x[i]=0.0;
for(int ivec=0;ivec<nvecs;ivec++)
x[i]+=x_hat[ivec]*q[ivec];
}
type0 norm=0.0;
for(int ivec=0;ivec<nvecs;ivec++)
norm+=x_hat[ivec]*x_hat[ivec];
return sqrt(norm);
}
| 20.014151 | 72 | 0.426349 |
a1ec6d4ef84433b6b3d023ea49177dd5e34efa26 | 810 | dart | Dart | example/lib/src/modules/drip_coffee_module.g.dart | nibo/kiwi | 666ccfcdfba63539ff44cb1c71cc00d07dd72580 | [
"MIT"
] | 1 | 2020-10-09T15:48:43.000Z | 2020-10-09T15:48:43.000Z | example/lib/src/modules/drip_coffee_module.g.dart | nibo/kiwi | 666ccfcdfba63539ff44cb1c71cc00d07dd72580 | [
"MIT"
] | null | null | null | example/lib/src/modules/drip_coffee_module.g.dart | nibo/kiwi | 666ccfcdfba63539ff44cb1c71cc00d07dd72580 | [
"MIT"
] | 1 | 2020-04-26T12:19:59.000Z | 2020-04-26T12:19:59.000Z | // GENERATED CODE - DO NOT MODIFY BY HAND
part of 'drip_coffee_module.dart';
// **************************************************************************
// InjectorGenerator
// **************************************************************************
class _$CoffeeInjector extends CoffeeInjector {
void _configureFactories() {
final Container container = Container();
container.registerFactory((c) => PowerOutlet());
container.registerSingleton((c) => Electricity(c<PowerOutlet>()));
container.registerSingleton<Heater, ElectricHeater>(
(c) => ElectricHeater(c<Electricity>()));
container.registerSingleton<Pump, Thermosiphon>(
(c) => Thermosiphon(c<Heater>()));
container.registerFactory(
(c) => CoffeeMaker(c<Heater>(), c<Pump>(), c<Model>()));
}
}
| 36.818182 | 77 | 0.550617 |
0b66d40b470e2bea7212ac0573b252ff0ab17cf7 | 374 | sql | SQL | OpenSim/Data/MSSQL/Resources/007_GridStore.sql | mcortez/opensim | 6dc971b104cf29cef1f9f3890af13cd5a10dc3e4 | [
"BSD-3-Clause"
] | 1 | 2016-07-23T23:18:20.000Z | 2016-07-23T23:18:20.000Z | OpenSim/Data/MSSQL/Resources/007_GridStore.sql | mcortez/opensim | 6dc971b104cf29cef1f9f3890af13cd5a10dc3e4 | [
"BSD-3-Clause"
] | null | null | null | OpenSim/Data/MSSQL/Resources/007_GridStore.sql | mcortez/opensim | 6dc971b104cf29cef1f9f3890af13cd5a10dc3e4 | [
"BSD-3-Clause"
] | null | null | null | BEGIN TRANSACTION
ALTER TABLE regions ADD [flags] integer NOT NULL DEFAULT 0;
CREATE INDEX [flags] ON regions(flags);
ALTER TABLE [regions] ADD [last_seen] integer NOT NULL DEFAULT 0;
ALTER TABLE [regions] ADD [PrincipalID] uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
ALTER TABLE [regions] ADD [Token] varchar(255) NOT NULL DEFAULT 0;
COMMIT
| 37.4 | 113 | 0.783422 |
ad54092fc04515bd5f5b6b88a5867d8518b2feac | 2,936 | rs | Rust | execution/executor/src/fuzzing.rs | zekun000/aptos-core | 4fac00575269ce5b77ab6a18ac0a5f75abfe153d | [
"Apache-2.0"
] | 350 | 2022-03-15T14:13:08.000Z | 2022-03-31T14:12:19.000Z | execution/executor/src/fuzzing.rs | zekun000/aptos-core | 4fac00575269ce5b77ab6a18ac0a5f75abfe153d | [
"Apache-2.0"
] | 179 | 2022-03-15T15:36:02.000Z | 2022-03-31T23:53:51.000Z | execution/executor/src/fuzzing.rs | zekun000/aptos-core | 4fac00575269ce5b77ab6a18ac0a5f75abfe153d | [
"Apache-2.0"
] | 104 | 2022-03-15T13:53:52.000Z | 2022-03-31T05:54:06.000Z | // Copyright (c) Aptos
// SPDX-License-Identifier: Apache-2.0
use crate::{block_executor::BlockExecutor, chunk_executor::ChunkExecutor};
use anyhow::Result;
use aptos_crypto::{hash::SPARSE_MERKLE_PLACEHOLDER_HASH, HashValue};
use aptos_state_view::StateView;
use aptos_types::{
ledger_info::LedgerInfoWithSignatures,
transaction::{
Transaction, TransactionListWithProof, TransactionOutput, TransactionToCommit, Version,
},
vm_status::VMStatus,
};
use aptos_vm::VMExecutor;
use executor_types::{BlockExecutorTrait, ChunkExecutorTrait};
use storage_interface::{DbReader, DbReaderWriter, DbWriter, StartupInfo};
fn create_test_executor() -> BlockExecutor<FakeVM> {
// setup fake db
let fake_db = FakeDb {};
let db_reader_writer = DbReaderWriter::new(fake_db);
BlockExecutor::<FakeVM>::new(db_reader_writer)
}
pub fn fuzz_execute_and_commit_chunk(
txn_list_with_proof: TransactionListWithProof,
verified_target_li: LedgerInfoWithSignatures,
) {
let db = DbReaderWriter::new(FakeDb {});
let executor = ChunkExecutor::<FakeVM>::new(db).unwrap();
let _events = executor.execute_and_commit_chunk(txn_list_with_proof, &verified_target_li, None);
}
pub fn fuzz_execute_and_commit_blocks(
blocks: Vec<(HashValue, Vec<Transaction>)>,
ledger_info_with_sigs: LedgerInfoWithSignatures,
) {
let executor = create_test_executor();
let mut parent_block_id = *SPARSE_MERKLE_PLACEHOLDER_HASH;
let mut block_ids = vec![];
for block in blocks {
let block_id = block.0;
let _execution_results = executor.execute_block(block, parent_block_id);
parent_block_id = block_id;
block_ids.push(block_id);
}
let _res = executor.commit_blocks(block_ids, ledger_info_with_sigs);
}
/// A fake VM implementing VMExecutor
pub struct FakeVM;
impl VMExecutor for FakeVM {
fn execute_block(
_transactions: Vec<Transaction>,
_state_view: &impl StateView,
) -> Result<Vec<TransactionOutput>, VMStatus> {
Ok(Vec::new())
}
}
/// A fake database implementing DbReader and DbWriter
pub struct FakeDb;
impl DbReader for FakeDb {
fn get_latest_version(&self) -> Result<Version> {
Ok(self.get_latest_ledger_info()?.ledger_info().version())
}
fn get_latest_commit_metadata(&self) -> Result<(Version, u64)> {
let ledger_info_with_sig = self.get_latest_ledger_info()?;
let ledger_info = ledger_info_with_sig.ledger_info();
Ok((ledger_info.version(), ledger_info.timestamp_usecs()))
}
fn get_startup_info(&self) -> Result<Option<StartupInfo>> {
Ok(Some(StartupInfo::new_for_testing()))
}
}
impl DbWriter for FakeDb {
fn save_transactions(
&self,
_txns_to_commit: &[TransactionToCommit],
_first_version: Version,
_ledger_info_with_sigs: Option<&LedgerInfoWithSignatures>,
) -> Result<()> {
Ok(())
}
}
| 31.234043 | 100 | 0.711172 |
e98ac0c6061087c5e1013087389a4d1b700d6597 | 547 | ps1 | PowerShell | Tests/GetHeader.tests.ps1 | mwc360/azure.databricks.cicd.tools | 691ba10f7c9b7955949a40c34541547ce9266a4b | [
"MIT"
] | 85 | 2018-07-11T12:18:11.000Z | 2022-03-17T08:53:32.000Z | Tests/GetHeader.tests.ps1 | mwc360/azure.databricks.cicd.tools | 691ba10f7c9b7955949a40c34541547ce9266a4b | [
"MIT"
] | 115 | 2018-10-17T18:19:06.000Z | 2022-03-28T13:43:41.000Z | Tests/GetHeader.tests.ps1 | mwc360/azure.databricks.cicd.tools | 691ba10f7c9b7955949a40c34541547ce9266a4b | [
"MIT"
] | 76 | 2018-10-22T19:44:51.000Z | 2022-03-15T11:46:33.000Z | Set-Location $PSScriptRoot
Import-Module "..\Private\GetHeaders.ps1" -Force
Import-Module "..\Private\ConnectFunctions.ps1" -Force
Import-Module "..\azure.databricks.cicd.tools.psd1" -Force
$Config = (Get-Content '.\config.json' | ConvertFrom-Json)
$BearerToken = $Config.BearerToken
$Region = $Config.Region
Describe "GetHeader Functions" {
It "GetHeaders valid"{
Set-GlobalsNull
$Params = @{"BearerToken"=$BearerToken; "Region"=$Region}
$x = GetHeaders($Params)
$x | Should -Not -Be $null
}
}
| 22.791667 | 65 | 0.667276 |
0432302ab7e57fd1fd3a862d6301fb4963e47b4f | 873 | java | Java | src/main/java/com/lambdanum/raids/infrastructure/persistence/InMemoryRaidRepositoryGarbageCollector.java | KEOTL/raidsCommands | 8a1b9df4a4b24c7e97542310c99a9fcac5ab2256 | [
"MIT"
] | null | null | null | src/main/java/com/lambdanum/raids/infrastructure/persistence/InMemoryRaidRepositoryGarbageCollector.java | KEOTL/raidsCommands | 8a1b9df4a4b24c7e97542310c99a9fcac5ab2256 | [
"MIT"
] | 9 | 2017-09-15T21:25:38.000Z | 2018-01-01T16:57:26.000Z | src/main/java/com/lambdanum/raids/infrastructure/persistence/InMemoryRaidRepositoryGarbageCollector.java | keotl/raidsCommands | 8a1b9df4a4b24c7e97542310c99a9fcac5ab2256 | [
"MIT"
] | null | null | null | package com.lambdanum.raids.infrastructure.persistence;
import java.util.concurrent.atomic.AtomicBoolean;
public class InMemoryRaidRepositoryGarbageCollector implements Runnable {
private InMemoryRaidPartyRepository inMemoryRaidPartyRepository;
private AtomicBoolean shouldStop = new AtomicBoolean(false);
public InMemoryRaidRepositoryGarbageCollector(InMemoryRaidPartyRepository inMemoryRaidPartyRepository) {
this.inMemoryRaidPartyRepository = inMemoryRaidPartyRepository;
}
@Override
public void run() {
while (!shouldStop.get()) {
inMemoryRaidPartyRepository.deleteEmptyParties();
inMemoryRaidPartyRepository.refreshParties();
try {
Thread.sleep(1000L);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
| 30.103448 | 108 | 0.702176 |
0f3e9b80fcbee316cc97f37be40623440461721d | 13,116 | hpp | C++ | src/stan/math/prim/mat/fun/get_base1.hpp | alashworth/stan-monorepo | 75596bc1f860ededd7b3e9ae9002aea97ee1cd46 | [
"BSD-3-Clause"
] | 1 | 2019-09-06T15:53:17.000Z | 2019-09-06T15:53:17.000Z | src/stan/math/prim/mat/fun/get_base1.hpp | alashworth/stan-monorepo | 75596bc1f860ededd7b3e9ae9002aea97ee1cd46 | [
"BSD-3-Clause"
] | 8 | 2019-01-17T18:51:16.000Z | 2019-01-17T18:51:39.000Z | src/stan/math/prim/mat/fun/get_base1.hpp | alashworth/stan-monorepo | 75596bc1f860ededd7b3e9ae9002aea97ee1cd46 | [
"BSD-3-Clause"
] | null | null | null | #ifndef STAN_MATH_PRIM_MAT_FUN_GET_BASE1_HPP
#define STAN_MATH_PRIM_MAT_FUN_GET_BASE1_HPP
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/prim/mat/err/check_range.hpp>
#include <vector>
namespace stan {
namespace math {
/**
* Return a reference to the value of the specified vector at the
* specified base-one index. If the index is out of range, throw
* a <code>std::out_of_range</code> exception with the specified
* error message and index indicated.
*
* @param x Vector from which to get a value.
* @param i Index into vector plus 1.
* @param error_msg Error message if the index is out of range.
* @param idx Nested index level to report in error message if
* the index is out of range.
* @return Value of vector at <code>i - 1</code>
* @tparam T type of value.
* @throw std::out_of_range if idx is out of range.
*/
template <typename T>
inline const T& get_base1(const std::vector<T>& x, size_t i,
const char* error_msg, size_t idx) {
check_range("[]", "x", x.size(), i, idx, error_msg);
return x[i - 1];
}
/**
* Return a reference to the value of the specified vector at the
* specified base-one indexes. If an index is out of range, throw
* a <code>std::out_of_range</code> exception with the specified
* error message and index indicated.
*
* @param x Vector from which to get a value.
* @param i1 First index plus 1.
* @param i2 Second index plus 1.
* @param error_msg Error message if an index is out of range.
* @param idx Nested index level to report in error message if
* the index is out of range.
* @return Value of vector at indexes.
* @tparam T type of value.
* @throw std::out_of_range if idx is out of range.
*/
template <typename T>
inline const T& get_base1(const std::vector<std::vector<T> >& x, size_t i1,
size_t i2, const char* error_msg, size_t idx) {
check_range("[]", "x", x.size(), i1, idx, error_msg);
return get_base1(x[i1 - 1], i2, error_msg, idx + 1);
}
/**
* Return a reference to the value of the specified vector at the
* specified base-one indexes. If an index is out of range, throw
* a <code>std::out_of_range</code> exception with the specified
* error message and index indicated.
*
* @param x Vector from which to get a value.
* @param i1 First index plus 1.
* @param i2 Second index plus 1.
* @param i3 Third index plus 1.
* @param error_msg Error message if an index is out of range.
* @param idx Nested index level to report in error message if
* the index is out of range.
* @return Value of vector at indexes.
* @tparam T type of value.
* @throw std::out_of_range if idx is out of range.
*/
template <typename T>
inline const T& get_base1(const std::vector<std::vector<std::vector<T> > >& x,
size_t i1, size_t i2, size_t i3,
const char* error_msg, size_t idx) {
check_range("[]", "x", x.size(), i1, idx, error_msg);
return get_base1(x[i1 - 1], i2, i3, error_msg, idx + 1);
}
/**
* Return a reference to the value of the specified vector at the
* specified base-one indexes. If an index is out of range, throw
* a <code>std::out_of_range</code> exception with the specified
* error message and index indicated.
*
* @param x Vector from which to get a value.
* @param i1 First index plus 1.
* @param i2 Second index plus 1.
* @param i3 Third index plus 1.
* @param i4 Fourth index plus 1.
* @param error_msg Error message if an index is out of range.
* @param idx Nested index level to report in error message if
* the index is out of range.
* @return Value of vector at indexes.
* @tparam T type of value.
* @throw std::out_of_range if idx is out of range.
*/
template <typename T>
inline const T& get_base1(
const std::vector<std::vector<std::vector<std::vector<T> > > >& x,
size_t i1, size_t i2, size_t i3, size_t i4, const char* error_msg,
size_t idx) {
check_range("[]", "x", x.size(), i1, idx, error_msg);
return get_base1(x[i1 - 1], i2, i3, i4, error_msg, idx + 1);
}
/**
* Return a reference to the value of the specified vector at the
* specified base-one indexes. If an index is out of range, throw
* a <code>std::out_of_range</code> exception with the specified
* error message and index indicated.
*
* @param x Vector from which to get a value.
* @param i1 First index plus 1.
* @param i2 Second index plus 1.
* @param i3 Third index plus 1.
* @param i4 Fourth index plus 1.
* @param i5 Fifth index plus 1.
* @param error_msg Error message if an index is out of range.
* @param idx Nested index level to report in error message if
* the index is out of range.
* @return Value of vector at indexes.
* @tparam T type of value.
* @throw std::out_of_range if idx is out of range.
*/
template <typename T>
inline const T& get_base1(
const std::vector<
std::vector<std::vector<std::vector<std::vector<T> > > > >& x,
size_t i1, size_t i2, size_t i3, size_t i4, size_t i5,
const char* error_msg, size_t idx) {
check_range("[]", "x", x.size(), i1, idx, error_msg);
return get_base1(x[i1 - 1], i2, i3, i4, i5, error_msg, idx + 1);
}
/**
* Return a reference to the value of the specified vector at the
* specified base-one indexes. If an index is out of range, throw
* a <code>std::out_of_range</code> exception with the specified
* error message and index indicated.
*
* @param x Vector from which to get a value.
* @param i1 First index plus 1.
* @param i2 Second index plus 1.
* @param i3 Third index plus 1.
* @param i4 Fourth index plus 1.
* @param i5 Fifth index plus 1.
* @param i6 Sixth index plus 1.
* @param error_msg Error message if an index is out of range.
* @param idx Nested index level to report in error message if
* the index is out of range.
* @return Value of vector at indexes.
* @tparam T type of value.
* @throw std::out_of_range if idx is out of range.
*/
template <typename T>
inline const T& get_base1(
const std::vector<std::vector<
std::vector<std::vector<std::vector<std::vector<T> > > > > >& x,
size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, size_t i6,
const char* error_msg, size_t idx) {
check_range("[]", "x", x.size(), i1, idx, error_msg);
return get_base1(x[i1 - 1], i2, i3, i4, i5, i6, error_msg, idx + 1);
}
/**
* Return a reference to the value of the specified vector at the
* specified base-one indexes. If an index is out of range, throw
* a <code>std::out_of_range</code> exception with the specified
* error message and index indicated.
*
* @param x Vector from which to get a value.
* @param i1 First index plus 1.
* @param i2 Second index plus 1.
* @param i3 Third index plus 1.
* @param i4 Fourth index plus 1.
* @param i5 Fifth index plus 1.
* @param i6 Sixth index plus 1.
* @param i7 Seventh index plus 1.
* @param error_msg Error message if an index is out of range.
* @param idx Nested index level to report in error message if
* the index is out of range.
* @return Value of vector at indexes.
* @tparam T type of value.
* @throw std::out_of_range if idx is out of range.
*/
template <typename T>
inline const T& get_base1(
const std::vector<std::vector<std::vector<
std::vector<std::vector<std::vector<std::vector<T> > > > > > >& x,
size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, size_t i6, size_t i7,
const char* error_msg, size_t idx) {
check_range("[]", "x", x.size(), i1, idx, error_msg);
return get_base1(x[i1 - 1], i2, i3, i4, i5, i6, i7, error_msg, idx + 1);
}
/**
* Return a reference to the value of the specified vector at the
* specified base-one indexes. If an index is out of range, throw
* a <code>std::out_of_range</code> exception with the specified
* error message and index indicated.
*
* @param x Vector from which to get a value.
* @param i1 First index plus 1.
* @param i2 Second index plus 1.
* @param i3 Third index plus 1.
* @param i4 Fourth index plus 1.
* @param i5 Fifth index plus 1.
* @param i6 Sixth index plus 1.
* @param i7 Seventh index plus 1.
* @param i8 Eigth index plus 1.
* @param error_msg Error message if an index is out of range.
* @param idx Nested index level to report in error message if
* the index is out of range.
* @return Value of vector at indexes.
* @tparam T type of value.
* @throw std::out_of_range if idx is out of range.
*/
template <typename T>
inline const T& get_base1(
const std::vector<std::vector<std::vector<std::vector<
std::vector<std::vector<std::vector<std::vector<T> > > > > > > >& x,
size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, size_t i6, size_t i7,
size_t i8, const char* error_msg, size_t idx) {
check_range("[]", "x", x.size(), i1, idx, error_msg);
return get_base1(x[i1 - 1], i2, i3, i4, i5, i6, i7, i8, error_msg, idx + 1);
}
/**
* Return a copy of the row of the specified vector at the specified
* base-one row index. If the index is out of range, throw a
* <code>std::out_of_range</code> exception with the specified
* error message and index indicated.
*
* <b>Warning</b>: Because a copy is involved, it is inefficient
* to access element of matrices by first using this method
* to get a row then using a second call to get the value at
a specified column.
*
* @param x Matrix from which to get a row
* @param m Index into matrix plus 1.
* @param error_msg Error message if the index is out of range.
* @param idx Nested index level to report in error message if
* the index is out of range.
* @return Row of matrix at <code>i - 1</code>.
* @tparam T type of value.
* @throw std::out_of_range if idx is out of range.
*/
template <typename T>
inline Eigen::Matrix<T, 1, Eigen::Dynamic> get_base1(
const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>& x, size_t m,
const char* error_msg, size_t idx) {
check_range("[]", "rows of x", x.rows(), m, idx, error_msg);
return x.block(m - 1, 0, 1, x.cols());
}
/**
* Return a reference to the value of the specified matrix at the specified
* base-one row and column indexes. If either index is out of range,
* throw a <code>std::out_of_range</code> exception with the
* specified error message and index indicated.
*
* @param x Matrix from which to get a row
* @param m Row index plus 1.
* @param n Column index plus 1.
* @param error_msg Error message if either index is out of range.
* @param idx Nested index level to report in error message if
* either index is out of range.
* @return Value of matrix at row <code>m - 1</code> and column
* <code>n - 1</code>.
* @tparam T type of value.
* @throw std::out_of_range if idx is out of range.
*/
template <typename T>
inline const T& get_base1(
const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>& x, size_t m,
size_t n, const char* error_msg, size_t idx) {
check_range("[]", "rows of x", x.rows(), m, idx, error_msg);
check_range("[]", "cols of x", x.cols(), n, idx + 1, error_msg);
return x(m - 1, n - 1);
}
/**
* Return a reference to the value of the specified column vector
* at the specified base-one index. If the index is out of range,
* throw a <code>std::out_of_range</code> exception with the
* specified error message and index indicated.
*
* @param x Column vector from which to get a value.
* @param m Row index plus 1.
* @param error_msg Error message if the index is out of range.
* @param idx Nested index level to report in error message if
* the index is out of range.
* @return Value of column vector at row <code>m - 1</code>.
* @tparam T type of value.
* @throw std::out_of_range if idx is out of range.
*/
template <typename T>
inline const T& get_base1(const Eigen::Matrix<T, Eigen::Dynamic, 1>& x,
size_t m, const char* error_msg, size_t idx) {
check_range("[]", "x", x.size(), m, idx, error_msg);
return x(m - 1);
}
/**
* Return a reference to the value of the specified row vector
* at the specified base-one index. If the index is out of range,
* throw a <code>std::out_of_range</code> exception with the
* specified error message and index indicated.
*
* @param x Row vector from which to get a value.
* @param n Column index plus 1.
* @param error_msg Error message if the index is out of range.
* @param idx Nested index level to report in error message if
* the index is out of range.
* @return Value of row vector at column <code>n - 1</code>.
* @tparam T type of value.
* @throw std::out_of_range if idx is out of range.
*/
template <typename T>
inline const T& get_base1(const Eigen::Matrix<T, 1, Eigen::Dynamic>& x,
size_t n, const char* error_msg, size_t idx) {
check_range("[]", "x", x.size(), n, idx, error_msg);
return x(n - 1);
}
} // namespace math
} // namespace stan
#endif
| 39.625378 | 81 | 0.662016 |
e81e9fed4bbdb0e1bd986e36175fc8d0267481ad | 2,275 | hh | C++ | libsrc/geomodelgrids/utils/TestDriver.hh | baagaard-usgs/geomodelgrids | 9b3b6879038691cf686a79d95b1c33092f154258 | [
"RSA-MD"
] | 2 | 2020-09-01T23:09:02.000Z | 2020-09-10T02:37:02.000Z | libsrc/geomodelgrids/utils/TestDriver.hh | baagaard-usgs/geomodelgrids | 9b3b6879038691cf686a79d95b1c33092f154258 | [
"RSA-MD"
] | 88 | 2019-10-04T18:19:19.000Z | 2021-10-20T01:54:08.000Z | libsrc/geomodelgrids/utils/TestDriver.hh | baagaard-usgs/geomodelgrids | 9b3b6879038691cf686a79d95b1c33092f154258 | [
"RSA-MD"
] | 1 | 2019-10-18T17:17:31.000Z | 2019-10-18T17:17:31.000Z | // Object for running C++ tests.
#if !defined(geomodelgrids_utils_testdriver_hh)
#define geomodelgrids_utils_testdriver_hh
#include "geomodelgrids/utils/utilsfwd.hh" // forward declaration
#include <cppunit/Test.h> /// USES CppUnit::Test
#include <vector> // USES std::vector
#include <string> // USES std::string
class geomodelgrids::utils::TestDriver {
// PUBLIC METHODS -----------------------------------------------------------------------------
public:
/// Constructor
TestDriver(void);
/// Destructor
~TestDriver(void);
/** Run test application.
*
* Arguments:
* --help
* --list
* --tests=TEST_0,...,TEST_N
*
* @param argc[in] Number of arguments passed.
* @param argv[in] Array of input arguments.
*
* @returns 1 if errors were detected, 0 otherwise.
*/
int run(int argc,
char* argv[]);
// PRIVATE METHODS ----------------------------------------------------------------------------
private:
/** Parse command line arguments.
*
* @param argc[in] Number of arguments passed.
* @param argv[in] Array of input arguments.
*/
void _parseArgs(int argc,
char* argv[]);
/// Print help information.
void _printHelp(void);
/** List test hierarchy.
*
* @param[in] test Test to list.
*/
void _printTests(const CppUnit::Test* const test);
/** Find test matching name in test hierarchy.
*
* @param[in] test Test hierarchy.
* @param[in] name Name of test to find.
* @returns Test matching name or NULL if not found.
*/
const CppUnit::Test* _findTest(const CppUnit::Test* const test,
const std::string& name);
// PRIVATE MEMBERS ----------------------------------------------------------------------------
private:
std::vector<std::string> _tests;
bool _showHelp;
bool _listTests;
// NOT IMPLEMENTED ----------------------------------------------------------------------------
private:
TestDriver(const TestDriver&); ///< Not implemented
const TestDriver& operator=(const TestDriver&); ///< Not implemented
}; // TestDriver
#endif // geomodelgrids_utils_testdriver_hh
// End of file
| 26.764706 | 99 | 0.532308 |
f0b142aa5b69af1b0c1c31fbf739694fde15773a | 964 | dart | Dart | lib/viewobject/holder/category_parameter_holder.dart | hardik-patel0810/buy_and_sell | c556d90d5539b06130820aa403333914a6665b36 | [
"MIT"
] | null | null | null | lib/viewobject/holder/category_parameter_holder.dart | hardik-patel0810/buy_and_sell | c556d90d5539b06130820aa403333914a6665b36 | [
"MIT"
] | null | null | null | lib/viewobject/holder/category_parameter_holder.dart | hardik-patel0810/buy_and_sell | c556d90d5539b06130820aa403333914a6665b36 | [
"MIT"
] | null | null | null | import 'package:flutterbuyandsell/constant/ps_constants.dart';
import 'package:flutterbuyandsell/viewobject/common/ps_holder.dart';
class CategoryParameterHolder extends PsHolder<dynamic> {
CategoryParameterHolder() {
orderBy = PsConst.FILTERING__ADDED_DATE;
}
String orderBy;
CategoryParameterHolder getTrendingParameterHolder() {
orderBy = PsConst.FILTERING__TRENDING;
return this;
}
CategoryParameterHolder getLatestParameterHolder() {
orderBy = PsConst.FILTERING__ADDED_DATE;
return this;
}
@override
Map<String, dynamic> toMap() {
final Map<String, dynamic> map = <String, dynamic>{};
map['order_by'] = orderBy;
return map;
}
@override
dynamic fromMap(dynamic dynamicData) {
orderBy = PsConst.FILTERING__ADDED_DATE;
return this;
}
@override
String getParamKey() {
String result = '';
if (orderBy != '') {
result += orderBy + ':';
}
return result;
}
}
| 19.28 | 68 | 0.691909 |
c1110b64db1e063565c9288cb4384c8fdde1a9b5 | 717 | dart | Dart | lib/UI/main_screen.dart | aman1210/Flutter-Restaurant-Finder | fd3d6510e6509bfc3c3baff54f904b73e743cdab | [
"MIT"
] | null | null | null | lib/UI/main_screen.dart | aman1210/Flutter-Restaurant-Finder | fd3d6510e6509bfc3c3baff54f904b73e743cdab | [
"MIT"
] | null | null | null | lib/UI/main_screen.dart | aman1210/Flutter-Restaurant-Finder | fd3d6510e6509bfc3c3baff54f904b73e743cdab | [
"MIT"
] | null | null | null | import 'package:flutter/material.dart';
import 'package:restaurant_finder_new/BLoC/bloc_provider.dart';
import 'package:restaurant_finder_new/BLoC/location_bloc.dart';
import 'package:restaurant_finder_new/UI/location_sceen.dart';
import 'package:restaurant_finder_new/UI/resturant_screen.dart';
class MainScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StreamBuilder(
stream: BlocProvider.of<LocationBloc>(context).locationStream,
builder: (context, snapshot) {
final location = snapshot.data;
if (location == null) {
return LocationScreen();
}
return RestaurantScreen(location: location);
},
);
}
}
| 29.875 | 68 | 0.722455 |
71a0c6922d05b67fbc88c251b2923bdd6cc909b9 | 3,005 | swift | Swift | Demo-Swift/slds-sample-app/library/controls/TabBar.swift | mdarnall/design-system-ios | 2eb228baa60a525f8920518efdfc89dc412ed4a4 | [
"BSD-3-Clause"
] | 59 | 2015-09-03T14:57:11.000Z | 2022-02-16T17:33:45.000Z | Demo-Swift/slds-sample-app/library/controls/TabBar.swift | mdarnall/design-system-ios | 2eb228baa60a525f8920518efdfc89dc412ed4a4 | [
"BSD-3-Clause"
] | 24 | 2016-04-13T22:48:50.000Z | 2019-08-30T17:30:46.000Z | Demo-Swift/slds-sample-app/library/controls/TabBar.swift | mdarnall/design-system-ios | 2eb228baa60a525f8920518efdfc89dc412ed4a4 | [
"BSD-3-Clause"
] | 37 | 2015-09-01T23:53:56.000Z | 2022-02-08T15:09:19.000Z | // Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
// Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license
import UIKit
class TabBar: ItemBar {
var underscore = UIView()
override var selectedIndex: Int {
didSet {
self.moveUnderscore(self.selectedIndex)
}
}
//––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
override var itemWidth : CGFloat {
return self.frame.width / CGFloat(self.items.count)
}
//––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
override func draw(_ rect: CGRect) {
let aPath = UIBezierPath()
aPath.move(to: CGPoint(x:0, y:self.frame.height))
aPath.addLine(to: CGPoint(x:self.frame.width, y:self.frame.height))
aPath.close()
aPath.lineWidth = 2.0
UIColor.sldsTextColor(.colorTextLinkActive).set()
aPath.stroke()
}
//––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
override func loadView() {
super.loadView()
self.accessibilityTraits = UIAccessibilityTraitTabBar
self.underscore.backgroundColor = UIColor.sldsBorderColor(.colorBorderSelection)
self.addSubview(self.underscore)
self.constrainChild(self.underscore,
xAlignment: .left,
yAlignment: .bottom,
height: 3)
}
//––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
override func layoutSubviews() {
super.layoutSubviews()
if self.underscore.widthConstraint.constant != self.itemWidth {
self.underscore.widthConstraint.constant = self.itemWidth
self.moveUnderscore(self.selectedIndex, animated: false)
}
}
//––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
func addTab(withLabelString labelString :String) {
let tab = UIButton()
tab.setTitle(labelString.uppercased(), for: .normal)
tab.titleLabel?.font = UIFont.sldsFont(.regular, with: .small)
tab.setTitleColor(UIColor.sldsTextColor(.colorTextDefault), for: .normal)
super.addItem(item: tab)
}
//––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
func moveUnderscore(_ index : Int, animated:Bool = true) {
for c in self.constraints {
if c.firstItem as! NSObject == underscore,
c.firstAttribute == .left {
c.constant = CGFloat(index) * self.itemWidth
}
}
if animated {
UIView.animate(withDuration: 0.2, delay: 0, options: .curveEaseOut, animations: {
self.layoutIfNeeded()
})
}
else
{
self.layoutIfNeeded()
}
}
}
| 33.021978 | 93 | 0.47787 |
f43bbe24dda36252ac5148f16bccde8a82bc22b3 | 293 | go | Go | models/asset.go | OTCGO/Neo-Rank | 1de17121a2ba839d62da6240a9db4a69d5003dcf | [
"MIT"
] | null | null | null | models/asset.go | OTCGO/Neo-Rank | 1de17121a2ba839d62da6240a9db4a69d5003dcf | [
"MIT"
] | null | null | null | models/asset.go | OTCGO/Neo-Rank | 1de17121a2ba839d62da6240a9db4a69d5003dcf | [
"MIT"
] | null | null | null | package models
import "gopkg.in/mgo.v2/bson"
type Asset struct {
Id_ bson.ObjectId `json:"_id" bson:"_id"`
AssetId string `json:"assetId" bson:"assetId"`
BlockIndex int32 `json:"blockIndex" bson:"blockIndex"`
Type string `json:"type" bson:"type"`
}
| 26.636364 | 63 | 0.624573 |
857315c758f082f6a74cb01b96369c032df33744 | 3,530 | rs | Rust | src/components/particle_params.rs | ManevilleF/bevy_tickles | 6d43c948db4d7f44326c388a702a005d1a6e6be3 | [
"MIT"
] | 12 | 2022-02-10T14:51:16.000Z | 2022-03-29T14:48:58.000Z | src/components/particle_params.rs | ManevilleF/bevy_particles | 6d43c948db4d7f44326c388a702a005d1a6e6be3 | [
"MIT"
] | null | null | null | src/components/particle_params.rs | ManevilleF/bevy_particles | 6d43c948db4d7f44326c388a702a005d1a6e6be3 | [
"MIT"
] | null | null | null | use crate::particle::{Particle, ParticleRotation};
use crate::{ColorOrGradient, RangeOrFixed};
use bevy::ecs::reflect::ReflectComponent;
use bevy::prelude::{Component, Reflect, Vec3};
use rand::Rng;
/// Defines the `z` rotation behaviour of particles
#[derive(Debug, Clone, Reflect)]
#[cfg_attr(feature = "inspector", derive(bevy_inspector_egui::Inspectable))]
pub enum RotationMode {
/// The particle rotation will always align to its current direction.
///
/// Note: No modifier will be able to alter the particles rotation
AlignToDirection {
/// Base rotation offset for rotation alignment
offset: f32,
},
/// The rotation is free and you may define a start rotation value
FreeRotation {
/// Start rotation for simulated particles
start_rotation: RangeOrFixed<f32>,
/// Start angular velocity for simulated particles
start_angular_velocity: RangeOrFixed<f32>,
},
}
/// Defines the initial state of emitted particles
#[derive(Debug, Clone, Component, Reflect)]
#[reflect(Component)]
#[cfg_attr(feature = "inspector", derive(bevy_inspector_egui::Inspectable))]
pub struct ParticleParams {
/// Start lifetime of simulated particles
pub start_lifetime: RangeOrFixed<f32>,
/// Start size of simulated particles
pub start_size: RangeOrFixed<f32>,
/// rotation mode for simulated particles
pub rotation: RotationMode,
/// Start speed for simulated particles
pub start_speed: RangeOrFixed<f32>,
/// Start color for simulated particles
pub start_color: ColorOrGradient,
}
impl ParticleParams {
/// Creates a [`Particle`] using current params
///
/// # Arguments
///
/// * `position` - The translation of the particle
/// * `direction` - the direction of the particle
/// * `rng`- random generator
pub fn get_particle(
&self,
position: Vec3,
start_direction: Vec3,
rng: &mut impl Rng,
) -> Particle {
let lifetime = self.start_lifetime.evaluate_rng(rng);
Particle {
translation: position,
rotation: match self.rotation {
RotationMode::AlignToDirection { offset } => {
ParticleRotation::AlignToDirection { offset }
}
RotationMode::FreeRotation {
start_rotation,
start_angular_velocity,
} => ParticleRotation::FreeRotation {
rotation: start_rotation.evaluate_rng(rng),
angular_velocity: start_angular_velocity.evaluate_rng(rng),
},
},
size: self.start_size.evaluate_rng(rng),
lifetime,
start_lifetime: lifetime,
color: self.start_color.evaluate(rng.gen_range(0.0..=1.0)),
velocity: start_direction * self.start_speed.evaluate_rng(rng),
start_direction,
}
}
}
impl Default for RotationMode {
fn default() -> Self {
Self::FreeRotation {
start_rotation: RangeOrFixed::Fixed(0.0),
start_angular_velocity: RangeOrFixed::Fixed(0.0),
}
}
}
impl Default for ParticleParams {
fn default() -> Self {
Self {
start_lifetime: RangeOrFixed::Fixed(5.0),
start_size: RangeOrFixed::Fixed(1.0),
rotation: RotationMode::default(),
start_speed: RangeOrFixed::Fixed(1.0),
start_color: ColorOrGradient::default(),
}
}
}
| 34.271845 | 79 | 0.624079 |
ca05b869bd4cd493b6fa36731062014830518cff | 306 | swift | Swift | Sources/InstantSearchCore/Extensions/Query+Facets.swift | YorNest/instantsearch-ios | 37e227edc9fb0b109c19123059798524af44fd24 | [
"Apache-2.0"
] | 586 | 2017-06-01T04:36:46.000Z | 2022-03-22T12:53:30.000Z | Sources/InstantSearchCore/Extensions/Query+Facets.swift | YorNest/instantsearch-ios | 37e227edc9fb0b109c19123059798524af44fd24 | [
"Apache-2.0"
] | 83 | 2017-07-05T09:36:35.000Z | 2022-03-27T15:37:03.000Z | Sources/InstantSearchCore/Extensions/Query+Facets.swift | YorNest/instantsearch-ios | 37e227edc9fb0b109c19123059798524af44fd24 | [
"Apache-2.0"
] | 49 | 2017-06-01T04:36:46.000Z | 2022-03-12T19:29:13.000Z | //
// Query+Facets.swift
// InstantSearchCore
//
// Created by Vladislav Fitc on 17/05/2019.
// Copyright © 2019 Algolia. All rights reserved.
//
import Foundation
extension Query {
mutating func updateQueryFacets(with attribute: Attribute) {
facets = (facets ?? []).union([attribute])
}
}
| 17 | 62 | 0.683007 |
f50f0c6dfece2230997b6379044c6d1c251e1940 | 951 | cpp | C++ | qnapctl/LedBlinker.cpp | zopieux/qnapctl | 68d22eaef0ed2696e405dd0a1d087b9cd36c8588 | [
"MIT"
] | 4 | 2021-11-26T23:00:46.000Z | 2022-02-23T08:46:43.000Z | qnapctl/LedBlinker.cpp | Zopieux/qnapctl | 68d22eaef0ed2696e405dd0a1d087b9cd36c8588 | [
"MIT"
] | 1 | 2021-11-26T19:39:59.000Z | 2021-11-27T00:54:15.000Z | qnapctl/LedBlinker.cpp | zopieux/qnapctl | 68d22eaef0ed2696e405dd0a1d087b9cd36c8588 | [
"MIT"
] | null | null | null | #include "LedBlinker.h"
#include <memory>
constexpr int kBlinkTimeMs = 100;
LedBlinker::LedBlinker(QNAPCtlInterface* ctrl, QString led, QObject* parent)
: QObject(parent), ctrl_(ctrl), led_(std::move(led)), next_interval_(0) {
timer_on_ = new QTimer(this);
timer_on_->setSingleShot(false);
connect(timer_on_, &QTimer::timeout, [this]() {
if (next_interval_ != 0) {
timer_on_->start(next_interval_);
timer_off_->start();
next_interval_ = 0;
}
ctrl_->setLED(led_, true);
});
timer_off_ = new QTimer(this);
timer_off_->setSingleShot(false);
timer_off_->setInterval(kBlinkTimeMs);
connect(timer_off_, &QTimer::timeout,
[this]() { ctrl_->setLED(led_, false); });
}
void LedBlinker::setInterval(int msec) {
if (msec == 0) {
timer_on_->stop();
return;
}
if (timer_on_->isActive()) {
next_interval_ = msec;
} else {
next_interval_ = 0;
timer_on_->start(msec);
}
}
| 24.384615 | 77 | 0.649842 |
92d59699d42a42909d04ea42851ce0134c8c94ed | 343 | h | C | IntegrityHelp/class/BaseTools/BaseAlertControler.h | TYJ1990/IntegrityHelp | 5bbeb36ee70adccf53624100d9096a8eab54bca2 | [
"Apache-2.0"
] | null | null | null | IntegrityHelp/class/BaseTools/BaseAlertControler.h | TYJ1990/IntegrityHelp | 5bbeb36ee70adccf53624100d9096a8eab54bca2 | [
"Apache-2.0"
] | null | null | null | IntegrityHelp/class/BaseTools/BaseAlertControler.h | TYJ1990/IntegrityHelp | 5bbeb36ee70adccf53624100d9096a8eab54bca2 | [
"Apache-2.0"
] | null | null | null | //
// QMQAlertControler.h
// helper
//
// Created by 秦慕乔 on 16/1/15.
// Copyright © 2016年 com.tiaohuo. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef void(^AlertBlcok)();
@interface BaseAlertControler : UIView
- (UIAlertController *)alertmessage:(NSString *)Message Title:(NSString *)title andBlock:(AlertBlcok)block;
@end
| 20.176471 | 110 | 0.708455 |
7c442eebfaae13a8eab6405008d99c13f76f402d | 242 | kt | Kotlin | app/src/main/java/nl/rsdt/japp/jotial/maps/wrapper/IPolygon.kt | RSDT/japp | e3c1c0836939ff9fed60094226c46694aacb4bdc | [
"Apache-2.0"
] | 3 | 2016-04-26T08:59:56.000Z | 2016-09-21T18:23:37.000Z | app/src/main/java/nl/rsdt/japp/jotial/maps/wrapper/IPolygon.kt | RSDT/japp | e3c1c0836939ff9fed60094226c46694aacb4bdc | [
"Apache-2.0"
] | 75 | 2016-08-01T12:43:14.000Z | 2016-10-17T16:55:29.000Z | app/src/main/java/nl/rsdt/japp/jotial/maps/wrapper/IPolygon.kt | RSDT/japp | e3c1c0836939ff9fed60094226c46694aacb4bdc | [
"Apache-2.0"
] | 2 | 2017-11-30T08:47:25.000Z | 2018-10-24T12:13:03.000Z | package nl.rsdt.japp.jotial.maps.wrapper
/**
* Created by mattijn on 08/08/17.
*/
interface IPolygon {
fun remove()
fun setStrokeWidth(strokeWidth: Int)
fun setFillColor(color: Int)
fun setVisible(visible: Boolean)
}
| 13.444444 | 40 | 0.681818 |
e41a263ae7160ca0922436bd4c66c5e279f28ced | 469 | go | Go | main.go | DOLLook/looklapi | fdd6c8af99a7bd4d338d184cbd55c7926336b1ed | [
"BSD-3-Clause"
] | 2 | 2021-11-06T04:29:09.000Z | 2021-11-11T04:23:29.000Z | main.go | DOLLook/looklapi | fdd6c8af99a7bd4d338d184cbd55c7926336b1ed | [
"BSD-3-Clause"
] | null | null | null | main.go | DOLLook/looklapi | fdd6c8af99a7bd4d338d184cbd55c7926336b1ed | [
"BSD-3-Clause"
] | null | null | null | package main
import (
"looklapi/common/appcontext"
_ "looklapi/common/service-discovery" // 导入以执行init,无需服务发现可移除
"looklapi/common/wireutils"
_ "looklapi/mqconsumers" // 导入以执行init,无需mq可移除
_ "looklapi/rpc" // 导入以执行init,无需rpc可移除
_ "looklapi/services/srv-proxy" // 导入以执行init
"looklapi/web/irisserver"
)
func main() {
wireutils.Inject()
appcontext.GetAppEventPublisher().PublishEvent(appcontext.AppEventBeanInjected(0))
irisserver.Start()
}
| 26.055556 | 83 | 0.733475 |
9170684dc8c9e114403f48c3436f4f1825dea7f9 | 11,593 | html | HTML | Documentation/_ref_workloads_8hpp.html | muthukumaravel7/armnn | 879ec231203df5b0a94462c0b247dc7d8d8a7a44 | [
"MIT"
] | null | null | null | Documentation/_ref_workloads_8hpp.html | muthukumaravel7/armnn | 879ec231203df5b0a94462c0b247dc7d8d8a7a44 | [
"MIT"
] | null | null | null | Documentation/_ref_workloads_8hpp.html | muthukumaravel7/armnn | 879ec231203df5b0a94462c0b247dc7d8d8a7a44 | [
"MIT"
] | null | null | null | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ArmNN: src/backends/reference/workloads/RefWorkloads.hpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">ArmNN
 <span id="projectnumber">NotReleased</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_ref_workloads_8hpp.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">RefWorkloads.hpp File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include "<a class="el" href="_activation_8hpp_source.html">Activation.hpp</a>"</code><br />
<code>#include "<a class="el" href="_arg_min_max_8hpp_source.html">ArgMinMax.hpp</a>"</code><br />
<code>#include "<a class="el" href="_batch_norm_impl_8hpp_source.html">BatchNormImpl.hpp</a>"</code><br />
<code>#include "<a class="el" href="_conv_impl_8hpp_source.html">ConvImpl.hpp</a>"</code><br />
<code>#include "<a class="el" href="_concatenate_8hpp_source.html">Concatenate.hpp</a>"</code><br />
<code>#include "<a class="el" href="_elementwise_function_8hpp_source.html">ElementwiseFunction.hpp</a>"</code><br />
<code>#include "<a class="el" href="_fully_connected_8hpp_source.html">FullyConnected.hpp</a>"</code><br />
<code>#include "<a class="el" href="_gather_8hpp_source.html">Gather.hpp</a>"</code><br />
<code>#include "<a class="el" href="_pooling2d_8hpp_source.html">Pooling2d.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_activation_workload_8hpp_source.html">RefActivationWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_arg_min_max_workload_8hpp_source.html">RefArgMinMaxWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_batch_normalization_workload_8hpp_source.html">RefBatchNormalizationWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_batch_to_space_nd_workload_8hpp_source.html">RefBatchToSpaceNdWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_comparison_workload_8hpp_source.html">RefComparisonWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_convolution2d_workload_8hpp_source.html">RefConvolution2dWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_constant_workload_8hpp_source.html">RefConstantWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_concat_workload_8hpp_source.html">RefConcatWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_convert_fp16_to_fp32_workload_8hpp_source.html">RefConvertFp16ToFp32Workload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_convert_fp32_to_fp16_workload_8hpp_source.html">RefConvertFp32ToFp16Workload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_debug_workload_8hpp_source.html">RefDebugWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_depth_to_space_workload_8hpp_source.html">RefDepthToSpaceWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_depthwise_convolution2d_workload_8hpp_source.html">RefDepthwiseConvolution2dWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_dequantize_workload_8hpp_source.html">RefDequantizeWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_detection_post_process_workload_8hpp_source.html">RefDetectionPostProcessWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_elementwise_workload_8hpp_source.html">RefElementwiseWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_elementwise_unary_workload_8hpp_source.html">RefElementwiseUnaryWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_fully_connected_workload_8hpp_source.html">RefFullyConnectedWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_floor_workload_8hpp_source.html">RefFloorWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_fake_quantization_float32_workload_8hpp_source.html">RefFakeQuantizationFloat32Workload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_gather_workload_8hpp_source.html">RefGatherWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_instance_normalization_workload_8hpp_source.html">RefInstanceNormalizationWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_l2_normalization_workload_8hpp_source.html">RefL2NormalizationWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_log_softmax_workload_8hpp_source.html">RefLogSoftmaxWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_lstm_workload_8hpp_source.html">RefLstmWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_mean_workload_8hpp_source.html">RefMeanWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_normalization_workload_8hpp_source.html">RefNormalizationWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_pooling2d_workload_8hpp_source.html">RefPooling2dWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_permute_workload_8hpp_source.html">RefPermuteWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_pad_workload_8hpp_source.html">RefPadWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_prelu_workload_8hpp_source.html">RefPreluWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_quantize_workload_8hpp_source.html">RefQuantizeWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_reshape_workload_8hpp_source.html">RefReshapeWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_resize_bilinear_workload_8hpp_source.html">RefResizeBilinearWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_resize_workload_8hpp_source.html">RefResizeWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_slice_workload_8hpp_source.html">RefSliceWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_splitter_workload_8hpp_source.html">RefSplitterWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_softmax_workload_8hpp_source.html">RefSoftmaxWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_space_to_batch_nd_workload_8hpp_source.html">RefSpaceToBatchNdWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_stack_workload_8hpp_source.html">RefStackWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_strided_slice_workload_8hpp_source.html">RefStridedSliceWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_space_to_depth_workload_8hpp_source.html">RefSpaceToDepthWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_transpose_convolution2d_workload_8hpp_source.html">RefTransposeConvolution2dWorkload.hpp</a>"</code><br />
<code>#include "<a class="el" href="_ref_workload_utils_8hpp_source.html">RefWorkloadUtils.hpp</a>"</code><br />
<code>#include "<a class="el" href="_resize_8hpp_source.html">Resize.hpp</a>"</code><br />
<code>#include "<a class="el" href="_softmax_8hpp_source.html">Softmax.hpp</a>"</code><br />
<code>#include "<a class="el" href="_splitter_8hpp_source.html">Splitter.hpp</a>"</code><br />
<code>#include "<a class="el" href="_tensor_buffer_array_view_8hpp_source.html">TensorBufferArrayView.hpp</a>"</code><br />
</div>
<p><a href="_ref_workloads_8hpp_source.html">Go to the source code of this file.</a></p>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_0f3cdec46afbc61a1ded8e1687c9c9a0.html">backends</a></li><li class="navelem"><a class="el" href="dir_efae4012d0e357ebeaba7d02491d70e5.html">reference</a></li><li class="navelem"><a class="el" href="dir_d2f3b8e2e64df3181ebe92efcc0a3012.html">workloads</a></li><li class="navelem"><a class="el" href="_ref_workloads_8hpp.html">RefWorkloads.hpp</a></li>
<li class="footer">Generated on Fri Mar 13 2020 16:07:01 for ArmNN by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
</ul>
</div>
</body>
</html>
| 72.91195 | 492 | 0.734236 |
1528785d1750d33289e62f6202aaf68f6a8d4918 | 1,153 | asm | Assembly | dos/DosGetPID.asm | prokushev/FamilyAPI | c07ecaba70392fe16b0b88e21e773470fa42012a | [
"BSD-3-Clause"
] | 1 | 2021-11-25T14:01:48.000Z | 2021-11-25T14:01:48.000Z | dos/DosGetPID.asm | prokushev/FamilyAPI | c07ecaba70392fe16b0b88e21e773470fa42012a | [
"BSD-3-Clause"
] | null | null | null | dos/DosGetPID.asm | prokushev/FamilyAPI | c07ecaba70392fe16b0b88e21e773470fa42012a | [
"BSD-3-Clause"
] | 2 | 2021-11-05T06:48:43.000Z | 2021-12-06T08:07:38.000Z | ;/*!
; @file
;
; @ingroup fapi
;
; @brief DosGetPID DOS wrapper
;
; (c) osFree Project 2018, <http://www.osFree.org>
; for licence see licence.txt in root directory, or project website
;
; This is Family API implementation for DOS, used with BIND tools
; to link required API
;
; @author Yuri Prokushev (yuri.prokushev@gmail.com)
;
;*/
.8086
; Helpers
INCLUDE HELPERS.INC
INCLUDE GLOBALVARS.INC
EXTERN DOSGETINFOSEG: PROC
PIDINFO struc
pidi_pid dw ? ;current process' process ID
pidi_tid dw ? ;current process' thread ID
pidi_pidParent dw ? ;process ID of the parent
PIDINFO ends
_TEXT SEGMENT BYTE PUBLIC 'CODE' USE16
@PROLOG DOSGETPID
PPID DD ?
@LOCALW GLOBALSEG
@LOCALW LOCALSEG
@START DOSGETPID
PUSH SS
LEA AX, GLOBALSEG
PUSH AX
PUSH SS
LEA AX, LOCALSEG
PUSH AX
CALL DOSGETINFOSEG
MOV AX, LOCALSEG
MOV DS, AX
LES BX,[DS:BP].ARGS.PPID
MOV AX, [DS:lis_pidCurrent]
MOV [ES:BX].PIDINFO.pidi_pid, AX
MOV AX, [DS:lis_tidCurrent]
MOV [ES:BX].PIDINFO.pidi_tid, AX
MOV AX, [DS:lis_pidParent]
MOV [ES:BX].PIDINFO.pidi_pidParent, AX
@EPILOG DOSGETPID
_TEXT ends
end
| 19.542373 | 69 | 0.692108 |
4aec412561b35f5d5781f254786550290801e4ee | 96 | sql | SQL | src/main/resources/db/migration/V27__endre_foreignkey_behandlingsresultat.sql | navikt/familie-ks-sak | 24bcd860ee4682e06a27366a231bcf207c14a31e | [
"MIT"
] | 2 | 2019-10-14T13:13:09.000Z | 2019-12-11T08:03:10.000Z | src/main/resources/db/migration/V27__endre_foreignkey_behandlingsresultat.sql | navikt/familie-ks-sak | 24bcd860ee4682e06a27366a231bcf207c14a31e | [
"MIT"
] | 334 | 2019-07-01T19:18:56.000Z | 2022-03-30T14:23:49.000Z | src/main/resources/db/migration/V27__endre_foreignkey_behandlingsresultat.sql | navikt/familie-ks-sak | 24bcd860ee4682e06a27366a231bcf207c14a31e | [
"MIT"
] | null | null | null | alter table behandling_resultat rename column vilkars_resultat_id to samlet_vilkar_resultat_id;
| 48 | 95 | 0.90625 |
b1b32d404bf67dc2be596fac3b496a7630dda644 | 5,255 | c | C | lib/acvp/acvp_list_verdict.c | ChrisKohlbacher/acvpproxy | 1478386873634838a45a3137ead4f89e2482b359 | [
"BSD-3-Clause"
] | null | null | null | lib/acvp/acvp_list_verdict.c | ChrisKohlbacher/acvpproxy | 1478386873634838a45a3137ead4f89e2482b359 | [
"BSD-3-Clause"
] | null | null | null | lib/acvp/acvp_list_verdict.c | ChrisKohlbacher/acvpproxy | 1478386873634838a45a3137ead4f89e2482b359 | [
"BSD-3-Clause"
] | null | null | null | /* List all pending request IDs
*
* Copyright (C) 2019 - 2022, Stephan Mueller <smueller@chronox.de>
*
* License: see LICENSE file in root directory
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF
* WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*/
#include <string.h>
#include <unistd.h>
#include "acvpproxy.h"
#include "internal.h"
#include "mutex_w.h"
#include "term_colors.h"
static DEFINE_MUTEX_W_UNLOCKED(acvp_list_verdicts_mutex);
static void
acvp_list_verdict_print(const struct acvp_test_verdict_status *verdict,
const bool vsid)
{
unsigned int namelen = vsid ? 20 : 26;
unsigned int modelen = 16;
unsigned int stringlen =
verdict->cipher_name ?
(unsigned int)strlen(verdict->cipher_name) :
0;
if (stringlen > namelen) {
stringlen -= namelen;
if (stringlen > modelen)
modelen = 0;
else
modelen -= stringlen;
}
if (verdict->cipher_name) {
fprintf(stdout, "%-*s ", namelen, verdict->cipher_name);
} else {
fprintf(stdout, "%-*s ", namelen, "=");
}
if (verdict->cipher_mode) {
fprintf(stdout, "%-*s ", modelen, verdict->cipher_mode);
} else {
fprintf(stdout, "%-*s ", modelen, "-");
}
if (!verdict->verdict) {
fprintf_blue(stdout, "UNVERIFIED\n");
return;
}
switch (verdict->verdict) {
case acvp_verdict_pass:
fprintf_green(stdout, "PASSED\n");
break;
case acvp_verdict_fail:
fprintf_red(stdout, "FAILED\n");
break;
case acvp_verdict_unknown:
fprintf_blue(stdout, "UNKNOWN\n");
break;
case acvp_verdict_unreceived:
fprintf_blue(stdout, "UNRECEIVED\n");
break;
case acvp_verdict_downloadpending:
fprintf_cyan(stdout, "PENDING\n");
break;
case acvp_verdict_unverified:
fprintf_blue(stdout, "UNVERIFIED\n");
break;
default:
fprintf_red(stdout, "ERROR in obtaining verdict\n");
}
}
static int acvp_list_verdicts_vsid(const struct acvp_vsid_ctx *vsid_ctx,
const struct acvp_buf *buf)
{
struct acvp_vsid_ctx tmp_ctx;
int ret;
(void)buf;
memcpy(&tmp_ctx, vsid_ctx, sizeof(tmp_ctx));
CKINT(ds->acvp_datastore_get_vsid_verdict(&tmp_ctx));
fprintf(stdout, "\tVector set ID %-6u ", vsid_ctx->vsid);
acvp_list_verdict_print(&tmp_ctx.verdict, true);
out:
return ret;
}
static int acvp_list_verdicts_cb(const struct acvp_ctx *ctx,
const struct definition *def,
const uint32_t testid)
{
const struct def_info *def_info = def->info;
const struct def_oe *def_oe = def->oe;
const struct def_dependency *def_dep;
struct acvp_testid_ctx *testid_ctx = NULL;
struct acvp_auth_ctx *auth;
int ret = 0;
CKNULL_LOG(def, -EINVAL, "Definition data not defined\n");
testid_ctx = calloc(1, sizeof(*testid_ctx));
CKNULL(testid_ctx, -ENOMEM);
testid_ctx->def = def;
testid_ctx->ctx = ctx;
testid_ctx->testid = testid;
CKINT(acvp_init_auth(testid_ctx));
/* Get auth token for test session */
CKINT(ds->acvp_datastore_read_authtoken(testid_ctx));
auth = testid_ctx->server_auth;
mutex_w_lock(&acvp_list_verdicts_mutex);
CKINT(ds->acvp_datastore_get_testid_verdict(testid_ctx));
/* If there was no testresponse, we mark it accordingly. */
if (!testid_ctx->verdict.verdict)
testid_ctx->verdict.verdict = acvp_verdict_downloadpending;
fprintf(stdout, "Test session ID %-6u ", testid_ctx->testid);
testid_ctx->verdict.cipher_name = def_info->module_name;
testid_ctx->verdict.cipher_mode = NULL;
acvp_list_verdict_print(&testid_ctx->verdict, false);
testid_ctx->verdict.cipher_name = NULL;
fprintf(stdout, "\tExpiry date: ");
acvp_print_expiry(stdout, testid_ctx->expiry);
fprintf(stdout, "\n");
fprintf(stdout, "\tDetails:");
for (def_dep = def_oe->def_dep; def_dep; def_dep = def_dep->next) {
if (def_dep->name)
fprintf(stdout, " %s", def_dep->name);
if (def_dep->proc_name)
fprintf(stdout, " %s", def_dep->proc_name);
if (def_dep->proc_family)
fprintf(stdout, " %s", def_dep->proc_family);
if (def_dep->proc_series)
fprintf(stdout, " %s", def_dep->proc_series);
}
fprintf(stdout, "\n");
if (auth->testsession_certificate_number) {
fprintf(stdout, "\tCertificate number: %s\n",
auth->testsession_certificate_number);
}
CKINT(ds->acvp_datastore_find_responses(testid_ctx,
acvp_list_verdicts_vsid));
/*
* We will get an EEXIST back due to the final call to
* acvp_datastore_find_testid_verdict in
* acvp_datastore_find_responses.
*/
ret = 0;
out:
mutex_w_unlock(&acvp_list_verdicts_mutex);
acvp_release_auth(testid_ctx);
acvp_release_testid(testid_ctx);
return ret;
}
DSO_PUBLIC
int acvp_list_verdicts(const struct acvp_ctx *ctx)
{
return acvp_process_testids(ctx, &acvp_list_verdicts_cb);
}
| 27.369792 | 72 | 0.727688 |
4a79fad39fc82e0c43bde3c6e4cf75ac46027f39 | 3,062 | html | HTML | samples/UpdateTenant.html | jasonLiu001/ISS-SentimentSystem | 6ab391d11abcecec082c539414e4c9ae8cd0e3a1 | [
"MIT"
] | null | null | null | samples/UpdateTenant.html | jasonLiu001/ISS-SentimentSystem | 6ab391d11abcecec082c539414e4c9ae8cd0e3a1 | [
"MIT"
] | null | null | null | samples/UpdateTenant.html | jasonLiu001/ISS-SentimentSystem | 6ab391d11abcecec082c539414e4c9ae8cd0e3a1 | [
"MIT"
] | null | null | null | <!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>租户更新</title>
<link href="css/bootstrap.css" rel="stylesheet" />
<script src="js/jQuery.js"></script>
<!--core javascript-->
<script src="js/knockout-3.1.0.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/UpdateTenant.js"></script>
</head>
<body>
<div class="container" id="container">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
租户更新</h4>
</div>
<div class="panel-body">
<fieldset>
<legend>租户资料更新</legend>
<div class="control-group">
<label class="control-label">公司名称:</label>
<div class="controls">
<input type="text" data-bind="value:name" name="tenantName" id="tenantName">
</div>
</div>
<div class="control-group">
<label class="control-label">公司简称:</label>
<div class="controls">
<input type="text" data-bind="value:alias" name="alias" id="alias">
</div>
</div>
<div class="control-group">
<label class="control-label">默认域:</label>
<div class="controls">
<input type="text" data-bind="value:mappeddomain" name="mappedDomain" id="mappedDomain">
</div>
</div>
<div class="control-group">
<label class="control-label">联系人电话:</label>
<div class="controls">
<input type="text" data-bind="value:phone" name="phone" id="phone">
</div>
</div>
<div class="control-group">
<label class="control-label">电子邮件:</label>
<div class="controls">
<input type="text" data-bind="value:email" name="email" id="email">
</div>
</div>
<div class="control-group">
<div class="controls">
<button id="btn_update" class="btn btn-success" >确认更新</button>
</div>
</div>
</fieldset>
</div>
<div class="panel-footer">
<div id="registerResult"></div>
</div>
</div>
</div>
</div>
</body>
</html> | 41.945205 | 120 | 0.413455 |
fe3aaf36d6059fa32ef078efb941312fec1d36bc | 440 | h | C | Pods/LMGLocalData/LMGLocalData.framework/Headers/LMGDAPagedResult+LocalData.h | unleashedspeed/WWDC-LMGIntegration | 2aa618b715191c44bb4b85f8b18d320383945c04 | [
"MIT"
] | null | null | null | Pods/LMGLocalData/LMGLocalData.framework/Headers/LMGDAPagedResult+LocalData.h | unleashedspeed/WWDC-LMGIntegration | 2aa618b715191c44bb4b85f8b18d320383945c04 | [
"MIT"
] | null | null | null | Pods/LMGLocalData/LMGLocalData.framework/Headers/LMGDAPagedResult+LocalData.h | unleashedspeed/WWDC-LMGIntegration | 2aa618b715191c44bb4b85f8b18d320383945c04 | [
"MIT"
] | null | null | null | //
// LMGDAPagedResult+LocalData.h
// LMGData
//
// Created by Myroslav Pomazan on 2018-10-31.
//
@import LMGDataAccess;
#import "LMGLDPagedResult.h"
@interface LMGDAPagedResult (LocalData)
- (nonnull LMGLDPagedResult *)toLocalDataWith:(nonnull NSManagedObjectContext *)context paramsDescription:(nonnull NSString *)paramsDescription;
@end
@interface LMGLDPagedResult (LocalData)
- (nonnull LMGDAPagedResult *)toDataAccess;
@end
| 19.130435 | 144 | 0.775 |
7f3886d5ae9b84af3a5329237e2d659fb13dbd53 | 4,141 | go | Go | money.go | fgrid/money | cd7134d3b914f6d4c91e9a351293ed88a83ff8b0 | [
"MIT"
] | 3 | 2016-07-25T14:16:19.000Z | 2018-09-11T14:41:45.000Z | money/money.go | fairxio/finance-util | 7ee21e4efeb86bf6d17c060a8da54ff246aca5df | [
"Apache-2.0"
] | 12 | 2016-07-27T06:21:32.000Z | 2017-10-21T19:08:46.000Z | money.go | fgrid/money | cd7134d3b914f6d4c91e9a351293ed88a83ff8b0 | [
"MIT"
] | 3 | 2016-08-28T19:34:39.000Z | 2018-10-30T07:01:52.000Z | package money
import "fmt"
type Money struct {
cur *Currency
subs uint64
debit bool
}
func New(subs uint64, cur *Currency) *Money {
return &Money{subs: subs, cur: cur}
}
func (m *Money) Add(o *Money) (*Money, error) {
if o == nil || m == nil {
return nil, ErrMissingParam
}
if !m.cur.Equals(o.cur) {
return nil, ErrDiffCurrencies
}
if m.debit == o.debit {
return &Money{subs: m.subs + o.subs, cur: m.cur, debit: m.debit}, nil
}
if m.subs > o.subs {
return &Money{subs: m.subs - o.subs, cur: m.cur, debit: m.debit}, nil
}
return &Money{subs: o.subs - m.subs, cur: m.cur, debit: o.debit}, nil
}
func (m *Money) Subunits() uint64 {
if m == nil {
return uint64(0)
}
return m.subs
}
func (m *Money) Cents() uint64 {
if m == nil {
return uint64(0)
}
r := m.subs
d := int(m.cur.prec) - 2
if d > 0 {
for i := 0; i < d; i++ {
r = r / 10
}
}
if d < 0 {
for i := 0; i > d; i-- {
r = r * 10
}
}
return r
}
func (m *Money) Credit() *Money {
return &Money{subs: m.subs, cur: m.cur, debit: false}
}
func (m *Money) Debit() *Money {
return &Money{subs: m.subs, cur: m.cur, debit: true}
}
func (m *Money) IsDebit() bool {
return m != nil && m.debit
}
func (m *Money) Div(o uint64) (*Money, error) {
if o == 0 {
return nil, ErrDivZero
}
v := (m.subs * 10) / o
q := v / 10
r := v % 10
if r < 5 {
v = q
} else {
v = q + 1
}
return &Money{subs: v, cur: m.cur, debit: m.debit}, nil
}
func (m *Money) Equals(o *Money) bool {
if m == o {
return true
}
if m == nil || o == nil {
return false
}
return m.cur.Equals(o.cur) &&
m.subs == o.subs &&
(m.debit == o.debit || m.subs == 0)
}
func (m *Money) Mul(o uint64) (*Money, error) {
return &Money{subs: m.subs * o, cur: m.cur, debit: m.debit}, nil
}
// MulFloat64 multiplies the amount with the given float64
func (m *Money) MulFloat64(f float64) *Money {
var newDebit bool
if f < 0 {
newDebit = !m.debit
f *= -1
} else {
newDebit = m.debit
}
return &Money{subs: uint64(float64(m.subs) * f), cur: m.cur, debit: newDebit}
}
func (m *Money) Inv() *Money {
return &Money{subs: m.subs, cur: m.cur, debit: !m.debit}
}
func (m *Money) Percent(p uint64) (*Money, error) {
if m == nil {
return nil, ErrMissingParam
}
tmp, _ := m.Mul(p)
return tmp.Div(100)
}
func (m *Money) String() string {
s := ""
if m.debit && m.subs != 0 {
s = "-"
}
return fmt.Sprintf("%s %s%s", m.CurrencyCode(), s, m.Value())
}
func (m *Money) Sub(o *Money) (*Money, error) {
if m == nil || o == nil {
return nil, ErrMissingParam
}
return m.Add(o.Inv())
}
// Value returns the absolute amount in readable form
func (m *Money) Value() string {
div := uint64(1)
for i := uint(0); i < m.cur.prec; i++ {
div = div * 10
}
q := m.subs / div
r := m.subs % div
result := fmt.Sprintf("%d", q)
if m.cur.prec > 0 {
result += fmt.Sprintf(".%0[1]*[2]d", m.cur.prec, r)
}
return result
}
// CurrencyCode returns the currency code
func (m *Money) CurrencyCode() string {
return m.cur.code
}
// GT greater than - returns true if the money is greater than the given parameter value
func (m *Money) GT(o *Money) (bool, error) {
if m == nil || o == nil {
return false, ErrMissingParam
}
if m.CurrencyCode() != o.CurrencyCode() {
return false, ErrDiffCurrencies
}
if m.debit {
return o.debit && m.subs < o.subs, nil
}
return o.debit || m.subs > o.subs, nil
}
// LE less or equal - returns true if the money is less or equal to the given parameter value
func (m *Money) LE(o *Money) (bool, error) {
result, err := m.GT(o)
return !result, err
}
// LT less than - returns true if the money is less than the given parameter value
func (m *Money) LT(o *Money) (bool, error) {
if m == nil || o == nil {
return false, ErrMissingParam
}
if m.CurrencyCode() != o.CurrencyCode() {
return false, ErrDiffCurrencies
}
if m.debit {
return !o.debit || m.subs > o.subs, nil
}
return !o.debit && m.subs < o.subs, nil
}
// GE greater or equal - returns tru if the money is greater or equal to the given parameter value
func (m *Money) GE(o *Money) (bool, error) {
result, err := m.LT(o)
return !result, err
}
| 20.914141 | 98 | 0.601546 |
31f5e072b79ef979f0537e470f68876847738d7e | 1,198 | sql | SQL | src/sql/schema/2018-04-24-2359_remove_derived_table_version_for_this_date.sql | prodypanda/mail-check | a8887d4e74d65719d828f68e39591294061ed813 | [
"Apache-2.0"
] | 59 | 2017-02-21T12:31:40.000Z | 2022-01-04T08:45:08.000Z | src/sql/schema/2018-04-24-2359_remove_derived_table_version_for_this_date.sql | prodypanda/mail-check | a8887d4e74d65719d828f68e39591294061ed813 | [
"Apache-2.0"
] | 10 | 2018-05-25T20:39:18.000Z | 2018-10-24T10:45:17.000Z | src/sql/schema/2018-04-24-2359_remove_derived_table_version_for_this_date.sql | prodypanda/mail-check | a8887d4e74d65719d828f68e39591294061ed813 | [
"Apache-2.0"
] | 12 | 2017-06-02T13:08:48.000Z | 2021-07-06T13:50:32.000Z | DROP TABLE IF EXISTS `derived_job_semaphore_20180424`;
DROP PROCEDURE IF EXISTS import_new_domains_20180424;
DROP PROCEDURE IF EXISTS import_new_providers_20180424;
DROP TABLE IF EXISTS `derived_aggregate_all_daily_senders_20180424`;
DROP TABLE IF EXISTS `derived_aggregate_daily_20180424`;
DROP TABLE IF EXISTS `derived_aggregate_top10_daily_threshold_20180424`;
DROP TABLE IF EXISTS `derived_aggregate_daily_senders_top10_20180424`;
DROP PROCEDURE IF EXISTS update_derived_aggregate_daily_senders_top10_20180424;
DROP TABLE IF EXISTS `derived_user_domain_rollup_permissions_20180424`;
DROP PROCEDURE IF EXISTS generate_derived_domain_tree_20180424;
DROP TABLE IF EXISTS domain_elements_20180424;
DROP TABLE IF EXISTS derived_domain_tree_20180424;
DROP PROCEDURE IF EXISTS update_derived_aggregate_daily_rollup_20180424;
DROP TABLE IF EXISTS `derived_aggregate_daily_rollup_20180424`;
DROP TABLE IF EXISTS `derived_aggregate_daily_senders_top10_rollup_20180424`;
DROP PROCEDURE IF EXISTS update_derived_aggregate_daily_senders_top10_rollup_20180424;
DROP PROCEDURE IF EXISTS generate_hourly_derived_tables_20180424;
DROP EVENT IF EXISTS generate_hourly_derived_tables_20180424;
| 57.047619 | 87 | 0.880634 |
0b9113a200832679e9fc55536bc662bb2d860b4c | 228 | py | Python | satyrus/sat/types/string.py | lucasvg/Satyrus3-FinalProject-EspTopsOTM | 024785752abdc46e3463d8c94df7c3da873c354d | [
"MIT"
] | null | null | null | satyrus/sat/types/string.py | lucasvg/Satyrus3-FinalProject-EspTopsOTM | 024785752abdc46e3463d8c94df7c3da873c354d | [
"MIT"
] | null | null | null | satyrus/sat/types/string.py | lucasvg/Satyrus3-FinalProject-EspTopsOTM | 024785752abdc46e3463d8c94df7c3da873c354d | [
"MIT"
] | null | null | null | from .main import SatType
class String(SatType, str):
def __new__(cls, *args, **kwargs):
return str.__new__(cls, *args, **kwargs)
def __init__(self, *args, **kwargs):
SatType.__init__(self) | 25.333333 | 49 | 0.605263 |
8933ce92efea57420394fce1d0d152f01e7f9d07 | 12,343 | swift | Swift | Sources/SwiftSDAIap242/entity-ap242/T/toroidal_surface.swift | tsun7170/SwiftSDAIap242 | d55ebf21abd4b85915a515aa8fa56dad7b5d059f | [
"MIT"
] | 1 | 2021-11-23T08:46:37.000Z | 2021-11-23T08:46:37.000Z | Sources/SwiftSDAIap242/entity-ap242/T/toroidal_surface.swift | tsun7170/SwiftSDAIap242 | d55ebf21abd4b85915a515aa8fa56dad7b5d059f | [
"MIT"
] | null | null | null | Sources/SwiftSDAIap242/entity-ap242/T/toroidal_surface.swift | tsun7170/SwiftSDAIap242 | d55ebf21abd4b85915a515aa8fa56dad7b5d059f | [
"MIT"
] | null | null | null | /* file: toroidal_surface.swift generated: Mon Jan 3 16:32:52 2022 */
/* This file was generated by the EXPRESS to Swift translator "exp2swift",
derived from STEPcode (formerly NIST's SCL).
exp2swift version: v.1.0.1, derived from stepcode v0.8 as of 2019/11/23
WARNING: You probably don't want to edit it since your modifications
will be lost if exp2swift is used to regenerate it.
*/
import SwiftSDAIcore
extension AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF {
//MARK: -ENTITY DEFINITION in EXPRESS
/*
ENTITY toroidal_surface
SUBTYPE OF ( elementary_surface );
major_radius : positive_length_measure;
minor_radius : positive_length_measure;
END_ENTITY; -- toroidal_surface (line:32827 file:ap242ed2_mim_lf_v1.101.TY.exp)
*/
//MARK: - ALL DEFINED ATTRIBUTES
/*
SUPER- ENTITY(1) representation_item
ATTR: name, TYPE: label -- EXPLICIT
SUPER- ENTITY(2) geometric_representation_item
ATTR: dim, TYPE: dimension_count -- DERIVED
:= dimension_of( SELF )
SUPER- ENTITY(3) surface
(no local attributes)
SUPER- ENTITY(4) elementary_surface
ATTR: position, TYPE: axis2_placement_3d -- EXPLICIT
ENTITY(SELF) toroidal_surface
ATTR: major_radius, TYPE: positive_length_measure -- EXPLICIT
ATTR: minor_radius, TYPE: positive_length_measure -- EXPLICIT
SUB- ENTITY(6) degenerate_toroidal_surface
ATTR: select_outer, TYPE: BOOLEAN -- EXPLICIT
*/
//MARK: - Partial Entity
public final class _toroidal_surface : SDAI.PartialEntity {
public override class var entityReferenceType: SDAI.EntityReference.Type {
eTOROIDAL_SURFACE.self
}
//ATTRIBUTES
/// EXPLICIT ATTRIBUTE
public internal(set) var _major_radius: tPOSITIVE_LENGTH_MEASURE // PLAIN EXPLICIT ATTRIBUTE
/// EXPLICIT ATTRIBUTE
public internal(set) var _minor_radius: tPOSITIVE_LENGTH_MEASURE // PLAIN EXPLICIT ATTRIBUTE
public override var typeMembers: Set<SDAI.STRING> {
var members = Set<SDAI.STRING>()
members.insert(SDAI.STRING(Self.typeName))
//SELECT data types (indirectly) referencing the current type as a member of the select list
members.insert(SDAI.STRING(sAXIAL_GEOMETRY_CONSTRAINT_ELEMENT.typeName)) // -> Self
return members
}
//VALUE COMPARISON SUPPORT
public override func hashAsValue(into hasher: inout Hasher, visited complexEntities: inout Set<SDAI.ComplexEntity>) {
super.hashAsValue(into: &hasher, visited: &complexEntities)
self._major_radius.value.hashAsValue(into: &hasher, visited: &complexEntities)
self._minor_radius.value.hashAsValue(into: &hasher, visited: &complexEntities)
}
public override func isValueEqual(to rhs: SDAI.PartialEntity, visited comppairs: inout Set<SDAI.ComplexPair>) -> Bool {
guard let rhs = rhs as? Self else { return false }
if !super.isValueEqual(to: rhs, visited: &comppairs) { return false }
if let comp = self._major_radius.value.isValueEqualOptionally(to: rhs._major_radius.value, visited: &comppairs) {
if !comp { return false }
}
else { return false }
if let comp = self._minor_radius.value.isValueEqualOptionally(to: rhs._minor_radius.value, visited: &comppairs) {
if !comp { return false }
}
else { return false }
return true
}
public override func isValueEqualOptionally(to rhs: SDAI.PartialEntity, visited comppairs: inout Set<SDAI.ComplexPair>) -> Bool? {
guard let rhs = rhs as? Self else { return false }
var result: Bool? = true
if let comp = super.isValueEqualOptionally(to: rhs, visited: &comppairs) {
if !comp { return false }
}
else { result = nil }
if let comp = self._major_radius.value.isValueEqualOptionally(to: rhs._major_radius.value, visited: &comppairs) {
if !comp { return false }
}
else { result = nil }
if let comp = self._minor_radius.value.isValueEqualOptionally(to: rhs._minor_radius.value, visited: &comppairs) {
if !comp { return false }
}
else { result = nil }
return result
}
//EXPRESS IMPLICIT PARTIAL ENTITY CONSTRUCTOR
public init(MAJOR_RADIUS: tPOSITIVE_LENGTH_MEASURE, MINOR_RADIUS: tPOSITIVE_LENGTH_MEASURE) {
self._major_radius = MAJOR_RADIUS
self._minor_radius = MINOR_RADIUS
super.init(asAbstructSuperclass:())
}
//p21 PARTIAL ENTITY CONSTRUCTOR
public required convenience init?(parameters: [P21Decode.ExchangeStructure.Parameter], exchangeStructure: P21Decode.ExchangeStructure) {
let numParams = 2
guard parameters.count == numParams
else { exchangeStructure.error = "number of p21 parameters(\(parameters.count)) are different from expected(\(numParams)) for entity(\(Self.entityName)) constructor"; return nil }
guard case .success(let p0) = exchangeStructure.recoverRequiredParameter(as: tPOSITIVE_LENGTH_MEASURE.self, from: parameters[0])
else { exchangeStructure.add(errorContext: "while recovering parameter #0 for entity(\(Self.entityName)) constructor"); return nil }
guard case .success(let p1) = exchangeStructure.recoverRequiredParameter(as: tPOSITIVE_LENGTH_MEASURE.self, from: parameters[1])
else { exchangeStructure.add(errorContext: "while recovering parameter #1 for entity(\(Self.entityName)) constructor"); return nil }
self.init( MAJOR_RADIUS: p0, MINOR_RADIUS: p1 )
}
}
//MARK: - Entity Reference
/** ENTITY reference
- EXPRESS:
```express
ENTITY toroidal_surface
SUBTYPE OF ( elementary_surface );
major_radius : positive_length_measure;
minor_radius : positive_length_measure;
END_ENTITY; -- toroidal_surface (line:32827 file:ap242ed2_mim_lf_v1.101.TY.exp)
```
*/
public final class eTOROIDAL_SURFACE : SDAI.EntityReference {
//MARK: PARTIAL ENTITY
public override class var partialEntityType: SDAI.PartialEntity.Type {
_toroidal_surface.self
}
public let partialEntity: _toroidal_surface
//MARK: SUPERTYPES
public let super_eREPRESENTATION_ITEM: eREPRESENTATION_ITEM // [1]
public let super_eGEOMETRIC_REPRESENTATION_ITEM: eGEOMETRIC_REPRESENTATION_ITEM // [2]
public let super_eSURFACE: eSURFACE // [3]
public let super_eELEMENTARY_SURFACE: eELEMENTARY_SURFACE // [4]
public var super_eTOROIDAL_SURFACE: eTOROIDAL_SURFACE { return self } // [5]
//MARK: SUBTYPES
public var sub_eDEGENERATE_TOROIDAL_SURFACE: eDEGENERATE_TOROIDAL_SURFACE? { // [6]
return self.complexEntity.entityReference(eDEGENERATE_TOROIDAL_SURFACE.self)
}
//MARK: ATTRIBUTES
/// __EXPLICIT__ attribute
/// - origin: SELF( ``eTOROIDAL_SURFACE`` )
public var MAJOR_RADIUS: tPOSITIVE_LENGTH_MEASURE {
get {
return SDAI.UNWRAP( self.partialEntity._major_radius )
}
set(newValue) {
let partial = self.partialEntity
partial._major_radius = SDAI.UNWRAP(newValue)
}
}
/// __EXPLICIT__ attribute
/// - origin: SUB( ``eDEGENERATE_TOROIDAL_SURFACE`` )
public var SELECT_OUTER: SDAI.BOOLEAN? {
get {
return sub_eDEGENERATE_TOROIDAL_SURFACE?.partialEntity._select_outer
}
set(newValue) {
guard let partial = sub_eDEGENERATE_TOROIDAL_SURFACE?.super_eDEGENERATE_TOROIDAL_SURFACE
.partialEntity else { return }
partial._select_outer = SDAI.UNWRAP(newValue)
}
}
/// __EXPLICIT__ attribute
/// - origin: SELF( ``eTOROIDAL_SURFACE`` )
public var MINOR_RADIUS: tPOSITIVE_LENGTH_MEASURE {
get {
return SDAI.UNWRAP( self.partialEntity._minor_radius )
}
set(newValue) {
let partial = self.partialEntity
partial._minor_radius = SDAI.UNWRAP(newValue)
}
}
/// __EXPLICIT__ attribute
/// - origin: SUPER( ``eELEMENTARY_SURFACE`` )
public var POSITION: eAXIS2_PLACEMENT_3D {
get {
return SDAI.UNWRAP( super_eELEMENTARY_SURFACE.partialEntity._position )
}
set(newValue) {
let partial = super_eELEMENTARY_SURFACE.partialEntity
partial._position = SDAI.UNWRAP(newValue)
}
}
/// __EXPLICIT__ attribute
/// - origin: SUPER( ``eREPRESENTATION_ITEM`` )
public var NAME: tLABEL {
get {
return SDAI.UNWRAP( super_eREPRESENTATION_ITEM.partialEntity._name )
}
set(newValue) {
let partial = super_eREPRESENTATION_ITEM.partialEntity
partial._name = SDAI.UNWRAP(newValue)
}
}
/// __DERIVE__ attribute
/// - origin: SUPER( ``eGEOMETRIC_REPRESENTATION_ITEM`` )
public var DIM: tDIMENSION_COUNT? {
get {
if let cached = cachedValue(derivedAttributeName:"DIM") {
return cached.value as! tDIMENSION_COUNT?
}
let origin = super_eGEOMETRIC_REPRESENTATION_ITEM
let value = tDIMENSION_COUNT(origin.partialEntity._dim__getter(SELF: origin))
updateCache(derivedAttributeName:"DIM", value:value)
return value
}
}
//MARK: INITIALIZERS
public convenience init?(_ entityRef: SDAI.EntityReference?) {
let complex = entityRef?.complexEntity
self.init(complex: complex)
}
public required init?(complex complexEntity: SDAI.ComplexEntity?) {
guard let partial = complexEntity?.partialEntityInstance(_toroidal_surface.self) else { return nil }
self.partialEntity = partial
guard let super1 = complexEntity?.entityReference(eREPRESENTATION_ITEM.self) else { return nil }
self.super_eREPRESENTATION_ITEM = super1
guard let super2 = complexEntity?.entityReference(eGEOMETRIC_REPRESENTATION_ITEM.self) else { return nil }
self.super_eGEOMETRIC_REPRESENTATION_ITEM = super2
guard let super3 = complexEntity?.entityReference(eSURFACE.self) else { return nil }
self.super_eSURFACE = super3
guard let super4 = complexEntity?.entityReference(eELEMENTARY_SURFACE.self) else { return nil }
self.super_eELEMENTARY_SURFACE = super4
super.init(complex: complexEntity)
}
public required convenience init?<G: SDAIGenericType>(fromGeneric generic: G?) {
guard let entityRef = generic?.entityReference else { return nil }
self.init(complex: entityRef.complexEntity)
}
public convenience init?<S: SDAISelectType>(_ select: S?) { self.init(possiblyFrom: select) }
public convenience init?(_ complex: SDAI.ComplexEntity?) { self.init(complex: complex) }
//MARK: DICTIONARY DEFINITION
public class override var entityDefinition: SDAIDictionarySchema.EntityDefinition { _entityDefinition }
private static let _entityDefinition: SDAIDictionarySchema.EntityDefinition = createEntityDefinition()
private static func createEntityDefinition() -> SDAIDictionarySchema.EntityDefinition {
let entityDef = SDAIDictionarySchema.EntityDefinition(name: "TOROIDAL_SURFACE", type: self, explicitAttributeCount: 2)
//MARK: SUPERTYPE REGISTRATIONS
entityDef.add(supertype: eREPRESENTATION_ITEM.self)
entityDef.add(supertype: eGEOMETRIC_REPRESENTATION_ITEM.self)
entityDef.add(supertype: eSURFACE.self)
entityDef.add(supertype: eELEMENTARY_SURFACE.self)
entityDef.add(supertype: eTOROIDAL_SURFACE.self)
//MARK: ATTRIBUTE REGISTRATIONS
entityDef.addAttribute(name: "MAJOR_RADIUS", keyPath: \eTOROIDAL_SURFACE.MAJOR_RADIUS,
kind: .explicit, source: .thisEntity, mayYieldEntityReference: false)
entityDef.addAttribute(name: "SELECT_OUTER", keyPath: \eTOROIDAL_SURFACE.SELECT_OUTER,
kind: .explicit, source: .subEntity, mayYieldEntityReference: false)
entityDef.addAttribute(name: "MINOR_RADIUS", keyPath: \eTOROIDAL_SURFACE.MINOR_RADIUS,
kind: .explicit, source: .thisEntity, mayYieldEntityReference: false)
entityDef.addAttribute(name: "POSITION", keyPath: \eTOROIDAL_SURFACE.POSITION,
kind: .explicit, source: .superEntity, mayYieldEntityReference: true)
entityDef.addAttribute(name: "NAME", keyPath: \eTOROIDAL_SURFACE.NAME,
kind: .explicit, source: .superEntity, mayYieldEntityReference: false)
entityDef.addAttribute(name: "DIM", keyPath: \eTOROIDAL_SURFACE.DIM,
kind: .derived, source: .superEntity, mayYieldEntityReference: false)
return entityDef
}
}
}
| 38.332298 | 185 | 0.711415 |
f50c47084a39a227cdf8dc0270ee90994821f3e6 | 1,069 | hpp | C++ | AqooleEngine/src/main/cpp/boost/boost/describe/enumerators.hpp | kodai731/Aqoole-Engine-Android-Vulkan-Rendering-Engine- | 72c8f34b6b6d507319069e681ff8c5008337b7c6 | [
"Apache-2.0",
"MIT"
] | null | null | null | AqooleEngine/src/main/cpp/boost/boost/describe/enumerators.hpp | kodai731/Aqoole-Engine-Android-Vulkan-Rendering-Engine- | 72c8f34b6b6d507319069e681ff8c5008337b7c6 | [
"Apache-2.0",
"MIT"
] | null | null | null | AqooleEngine/src/main/cpp/boost/boost/describe/enumerators.hpp | kodai731/Aqoole-Engine-Android-Vulkan-Rendering-Engine- | 72c8f34b6b6d507319069e681ff8c5008337b7c6 | [
"Apache-2.0",
"MIT"
] | null | null | null | #ifndef BOOST_DESCRIBE_ENUMERATORS_HPP_INCLUDED
#define BOOST_DESCRIBE_ENUMERATORS_HPP_INCLUDED
// Copyright 2020, 2021 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/describe/detail/void_t.hpp>
#include <boost/describe/detail/config.hpp>
#if defined(BOOST_DESCRIBE_CXX11)
#include <type_traits>
namespace boost
{
namespace describe
{
// describe_enumerators<E>
template<class E> using describe_enumerators = decltype( boost_enum_descriptor_fn( static_cast<E**>(0) ) );
// has_describe_enumerators<E>
namespace detail
{
template<class E, class En = void> struct has_describe_enumerators: std::false_type
{
};
template<class E> struct has_describe_enumerators<E, void_t<describe_enumerators<E>>>: std::true_type
{
};
} // namespace detail
template<class E> using has_describe_enumerators = detail::has_describe_enumerators<E>;
} // namespace describe
} // namespace boost
#endif // defined(BOOST_DESCRIBE_CXX11)
#endif // #ifndef BOOST_DESCRIBE_ENUMERATORS_HPP_INCLUDED
| 22.744681 | 107 | 0.787652 |
707f21f19c77fa500d2f0fce20a16d6516f29f2f | 916 | cs | C# | Assets/Dependencies/Hex/CS_Data/Runtime/Runtime/UTIData.cs | atomata/VClassroom_Proto_VSolar_ApparatusUPackageDevelopment | 2fdf35f0547af00d495dd16fa3c603ba0365e336 | [
"MIT"
] | 1 | 2021-01-13T22:52:04.000Z | 2021-01-13T22:52:04.000Z | Runtime/Runtime/UTIData.cs | hexthedev/HexCS-Data | 47be24a96742d4363eb3ae5394fec955e3003ea6 | [
"MIT"
] | 7 | 2021-10-16T18:59:41.000Z | 2022-01-05T00:18:35.000Z | Runtime/Runtime/UTIData.cs | hexthedev/HexCS-Data | 47be24a96742d4363eb3ae5394fec955e3003ea6 | [
"MIT"
] | null | null | null | using System;
using System.Collections.Generic;
using System.Text;
namespace HexCS.Data.Runtime
{
/// <summary>
/// Utility functions related to IDataObjects
/// </summary>
public static class UTIData
{
/// <summary>
/// Returns true if the fields object is valid to construct to target IData
/// </summary>
/// <param name="data"></param>
/// <param name="fields"></param>
/// <returns></returns>
public static bool ValidateDataLayout(this IData data, InterField[] fields)
{
if (fields == null || data.DataLayout.Length != fields.Length) return false;
for(int i = 0; i<data.DataLayout.Length; i++)
{
if (fields[i].Type == EDataType.Auto || data.DataLayout[i] == fields[i].Type) continue;
return false;
}
return true;
}
}
}
| 28.625 | 103 | 0.555677 |
751eb0bd9da7b1f66f751240923603f6b1b3c9e3 | 1,132 | cs | C# | Assets/Scripts/LocalDataSaver.cs | takupisu/LocalDataSaver-Unity | c4ee9481a053cbac66e01b2bdd973157ff1012fa | [
"MIT"
] | null | null | null | Assets/Scripts/LocalDataSaver.cs | takupisu/LocalDataSaver-Unity | c4ee9481a053cbac66e01b2bdd973157ff1012fa | [
"MIT"
] | null | null | null | Assets/Scripts/LocalDataSaver.cs | takupisu/LocalDataSaver-Unity | c4ee9481a053cbac66e01b2bdd973157ff1012fa | [
"MIT"
] | null | null | null | using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using UnityEngine;
using System.Text;
public static class LocalDataSaver
{
private static string SavePath = Application.persistentDataPath + "/LocalData/";
public static void Save<T>(T serializableObject) where T : new()
{
if(!Directory.Exists(SavePath)){
Directory.CreateDirectory(SavePath);
}
string json = JsonUtility.ToJson(serializableObject);
File.WriteAllText(GetSaveDataPath<T>(), json);
}
public static T Load<T>() where T : new()
{
T deserializedObject = new T();
if (File.Exists (SavePath + (new T()).GetType().FullName)) {
try
{
deserializedObject = JsonUtility.FromJson<T>(File.ReadAllText(GetSaveDataPath<T>()));
}
catch
{
Debug.Log(string.Format("{0}の定義が変更された可能性があるため読み込めませんでした。", (GetSaveDataPath<T>())));
}
}
return deserializedObject;
}
public static void Delete<T>() where T : new()
{
File.Delete(GetSaveDataPath<T>());
}
private static string GetSaveDataPath<T>() where T : new()
{
return SavePath + (new T()).GetType().FullName;
}
}
| 24.608696 | 89 | 0.701413 |
143201f223f43cb2de2b861fadbcd598c1ad1549 | 1,584 | dart | Dart | lib/screens/product_detail_screen.dart | mctaspinar/flutterShopping | e28899b7a94ff8cec24f138158685358d77562fc | [
"Apache-2.0"
] | null | null | null | lib/screens/product_detail_screen.dart | mctaspinar/flutterShopping | e28899b7a94ff8cec24f138158685358d77562fc | [
"Apache-2.0"
] | null | null | null | lib/screens/product_detail_screen.dart | mctaspinar/flutterShopping | e28899b7a94ff8cec24f138158685358d77562fc | [
"Apache-2.0"
] | null | null | null | import 'package:flutter/material.dart';
import '../providers/products_provider.dart';
import 'package:provider/provider.dart';
import '../widgets/app_bar.dart';
import '../widgets/item_description.dart';
import '../widgets/show_item_pic.dart';
import '../models/product.dart';
class ProductDetailScreen extends StatelessWidget {
static const routeName = '/product_detail';
void _toDoFunction(context) {
Navigator.of(context).pop();
}
@override
Widget build(BuildContext context) {
Product product = ModalRoute.of(context).settings.arguments as Product;
final productItem =
Provider.of<Products>(context, listen: false).findById(product.id);
final mediaQuery = MediaQuery.of(context).size;
return Scaffold(
body: SafeArea(
child: Stack(
children: [
ShowItemPic(
product: productItem,
),
Positioned(
left: 0,
top: 0,
child: CustomAppBar(
iconData: Icons.arrow_back,
toDo: _toDoFunction,
title: productItem.title,
textStyle: Theme.of(context)
.textTheme
.headline6
.copyWith(color: Colors.black),
popupMenuButton: false,
alignment: MainAxisAlignment.start,
),
),
Positioned(
bottom: mediaQuery.height * .1,
right: 0,
child: ItemDescription(
product: productItem,
),
)
],
)),
);
}
}
| 28.285714 | 75 | 0.570076 |
76f2aff91fd9183e47689f9ad44d2e9895f3cbad | 2,245 | dart | Dart | mood_clock/lib/clock_display.dart | irockel/flutter_clock | 0fe939998361872d99fdcf61f23bd0b4a9124a30 | [
"BSD-3-Clause"
] | null | null | null | mood_clock/lib/clock_display.dart | irockel/flutter_clock | 0fe939998361872d99fdcf61f23bd0b4a9124a30 | [
"BSD-3-Clause"
] | null | null | null | mood_clock/lib/clock_display.dart | irockel/flutter_clock | 0fe939998361872d99fdcf61f23bd0b4a9124a30 | [
"BSD-3-Clause"
] | null | null | null | import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:mood_clock/theme_factory.dart';
///
/// encapsulates just the time presentation, is stateless and has to
/// be updated from the outside. As a timer is needed for other elements
/// also, there's no use in having its own.
///
class ClockDisplay extends StatelessWidget {
final bool is24HourFormat;
ClockDisplay(this.is24HourFormat);
@override
Widget build(BuildContext context) {
DateTime dateTime = DateTime.now();
// Date format for hour, minute and seconds
final hours = DateFormat(this.is24HourFormat ? 'HH' : 'hh')
.format(dateTime)
.split('');
final minutes = DateFormat('mm').format(dateTime).split('');
final seconds = DateFormat('ss').format(dateTime).split('');
return Row(
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.ideographic,
children: [
ClockDisplayDigit(
digit: hours[0], style: ThemeFactory.hourStyle(context)),
ClockDisplayDigit(
digit: hours[1], style: ThemeFactory.hourStyle(context)),
SizedBox(width: 30),
ClockDisplayDigit(
digit: minutes[0], style: ThemeFactory.minuteStyle(context)),
ClockDisplayDigit(
digit: minutes[1], style: ThemeFactory.minuteStyle(context)),
SizedBox(width: 30),
ClockDisplayDigit(digit: seconds[0]),
ClockDisplayDigit(digit: seconds[1]),
],
);
}
}
///
/// display and animate a clock display digit
///
class ClockDisplayDigit extends StatelessWidget {
final String digit;
final TextStyle style;
///
/// provide digit and optionally style to display
///
ClockDisplayDigit({this.digit, this.style});
@override
Widget build(BuildContext context) {
return AnimatedSwitcher(
duration: const Duration(milliseconds: 500),
switchInCurve: Curves.easeInCirc,
switchOutCurve: Curves.easeOutCirc,
child: Text("$digit", style: style, key: ValueKey(digit)),
transitionBuilder: (Widget child, Animation<double> animation) {
return ScaleTransition(
child: child,
scale: animation,
);
},
);
}
}
| 29.539474 | 73 | 0.664143 |
16bcfbbcca6b7f6adce9db2a92a963664a4e054c | 1,667 | ts | TypeScript | server/index.ts | Assist-DevQ/screenshot-service | a1d5da46f43a76e6bee422c136caaad7fa8358d7 | [
"MIT"
] | null | null | null | server/index.ts | Assist-DevQ/screenshot-service | a1d5da46f43a76e6bee422c136caaad7fa8358d7 | [
"MIT"
] | 1 | 2022-02-13T00:48:35.000Z | 2022-02-13T00:48:35.000Z | server/index.ts | Assist-DevQ/screenshot-service | a1d5da46f43a76e6bee422c136caaad7fa8358d7 | [
"MIT"
] | null | null | null | import './common/env'
import Server from './common/server'
import routes from './routes'
import { GithubService } from './api/services/github.service'
import { TarService } from './api/services/tar.service'
import { ScreenService } from './api/services/screen.service'
import { GCStorage } from './api/services/GCStorage.service'
import { IGithubConfig } from './api/services/types/github-config'
import { Application } from 'express'
import { Orchestrator } from './api/services/orchestrator.service'
import { BackEndAPI } from './api/services/BackEndApi.sevice'
import { IApiConf } from './api/services/types/api-conf'
import { PixelDiff } from './api/services/PixelDiff.service'
import { DiffOrchestrator } from './api/services/DiffOrchestrator.service'
const boot = async (): Promise<Application> => {
const port = Number(process.env.PORT)
const gitConf: IGithubConfig = { baseUrl: process.env.GITHUB_BASE, archiveType: process.env.GITHUB_FORMAT }
const apiConf: IApiConf = {
baseUrl: process.env.BACK_API_BASE_URL,
scenarios: process.env.SCENARIOS,
auth: process.env.BACK_API_AUTH
}
const github: GithubService = new GithubService(gitConf)
const tar: TarService = new TarService(process.env.CODE_DIR)
const screens: ScreenService = await ScreenService.build()
const storage: GCStorage = new GCStorage()
const backApi: BackEndAPI = new BackEndAPI(apiConf)
const pix = new PixelDiff()
const diffOrchestrator = new DiffOrchestrator(storage, pix)
const orchestrator = new Orchestrator({ github, tar, screens, backApi, diffOrchestrator })
return new Server().router(routes(orchestrator)).listen(port)
}
export default boot()
| 46.305556 | 109 | 0.75225 |
c7e3f799800389515bc6977e7f433b57e50adde4 | 2,186 | py | Python | reversialphazero/config.py | FritzFlorian/bachelor-thesis-code | 609bc82ab6ac9879eed82f9a2968ae8ee2ef1ebb | [
"MIT"
] | null | null | null | reversialphazero/config.py | FritzFlorian/bachelor-thesis-code | 609bc82ab6ac9879eed82f9a2968ae8ee2ef1ebb | [
"MIT"
] | null | null | null | reversialphazero/config.py | FritzFlorian/bachelor-thesis-code | 609bc82ab6ac9879eed82f9a2968ae8ee2ef1ebb | [
"MIT"
] | null | null | null | import hometrainer.config
import reversialphazero.ai_trivial_agent
import definitions
class CustomConfiguration(hometrainer.config.Configuration):
def __init__(self):
super().__init__()
# Overwrite all defaults to the defaults of these experiments
# Default Settings for Search/Training
# Number of game states for one training batch
self._training_batch_size = 64
# Number of last games used for training
self._training_history_size = 128
# Simulations per selfplay/selfeval turn
self._simulations_per_turn = 128
# Turn time for each player during ai evaluation
self._external_evaluation_turn_time = 1.0
# Number of selfplay games for each iteration
self._n_self_play = 42
# Number of self evaluation games for each iteration, 0 will skip it
self._n_self_eval = 21
# Number of evaluation games against the ai-trivial client for each client, 0 will skip it
self._n_external_eval = 14
# The self evaluation avg. score needed to see this iteration as new best.
# This means if the new weights scored >= this value they will be chosen as best weights.
# 0.05 is a sane default for scores between -1 and 1.
self._needed_avg_self_eval_score = 0.05
# C-PUCT used in Tree search
self._c_puct = 3
# Configure the number of concurrent search threads, 1 means no multithreading
self._n_search_threads_external_eval = 8
self._n_search_threads_self_eval = 8
self._n_search_threads_selfplay = 8
def external_evaluation_possible(self):
return definitions.AI_TRIVIAL_AVAILABLE
def external_ai_agent(self, start_game_state):
return reversialphazero.ai_trivial_agent.AITrivialAgent()
def zmq_use_secure_connection(self):
return True
def zmq_client_secret(self):
return definitions.CLIENT_SECRET
def zmq_server_secret(self):
return definitions.SERVER_SECRET
def zmq_server_public(self):
return definitions.SERVER_PUBLIC
def zmq_public_keys_dir(self):
return definitions.PUBLIC_KEYS_DIR
| 35.836066 | 98 | 0.707228 |
e4ba76fb7332880ed9b04caa525f63df17657860 | 630 | go | Go | cmd/send.go | mengelbart/bwe-test-pion | 46461dc7a9b7df32fccee4985ef5d55d22467d38 | [
"MIT"
] | 1 | 2022-01-21T11:52:23.000Z | 2022-01-21T11:52:23.000Z | cmd/send.go | mengelbart/bwe-test-pion | 46461dc7a9b7df32fccee4985ef5d55d22467d38 | [
"MIT"
] | null | null | null | cmd/send.go | mengelbart/bwe-test-pion | 46461dc7a9b7df32fccee4985ef5d55d22467d38 | [
"MIT"
] | null | null | null | package cmd
import (
"log"
"github.com/mengelbart/bwe-test-pion/rtc"
"github.com/spf13/cobra"
)
var (
senderOfferAddr, senderAnswerAddr string
)
func init() {
rootCmd.AddCommand(sendCmd)
sendCmd.Flags().StringVarP(&senderOfferAddr, "offer", "o", ":50000", "Offer address")
sendCmd.Flags().StringVarP(&senderAnswerAddr, "answer", "a", "localhost:60000", "Answer address")
}
var sendCmd = &cobra.Command{
Use: "send",
Run: func(_ *cobra.Command, _ []string) {
if err := startSender(); err != nil {
log.Fatal(err)
}
},
}
func startSender() error {
return rtc.StartSender(senderOfferAddr, senderAnswerAddr)
}
| 19.090909 | 98 | 0.690476 |
0ab54027df3796178f6255c7307f724f498c79f2 | 6,559 | go | Go | controller/admin/common.go | guyigood/webserver | c7220f85771142b6556900662625f2cb3376473c | [
"MIT"
] | null | null | null | controller/admin/common.go | guyigood/webserver | c7220f85771142b6556900662625f2cb3376473c | [
"MIT"
] | null | null | null | controller/admin/common.go | guyigood/webserver | c7220f85771142b6556900662625f2cb3376473c | [
"MIT"
] | null | null | null | package admin
import (
"net/http"
"encoding/base64"
"strconv"
"time"
"io/ioutil"
"encoding/json"
"gylib/common"
"fmt"
"os"
"io"
"regexp"
"websever/public/module"
)
func get_ueditor_config() (string) {
file, err := os.Open("conf/config.json")
if err != nil {
return "error"
}
defer file.Close()
fd, err := ioutil.ReadAll(file)
src := string(fd)
re, _ := regexp.Compile("\\/\\*[\\S\\s]+?\\*\\/") //参考php的$CONFIG = json_decode(preg_replace("/\/\*[\s\S]+?\*\//", "", file_get_contents("config.json")), true);
//将php中的正则移植到go中,需要将/ \/\*[\s\S]+?\*\/ /去掉前后的/,然后将\改成2个\\
//参考//去除所有尖括号内的HTML代码,并换成换行符
// re, _ = regexp.Compile("\\<[\\S\\s]+?\\>")
// src = re.ReplaceAllString(src, "\n")
//当把<和>换成/*和*\时,斜杠/和*之间加双斜杠\\才行。
src = re.ReplaceAllString(src, "")
return src
}
func (this *AdminController) AdminCommon_popAction() {
title := "名称"
url_list := "/admin/nav_get_parent_menu/"
input_box := `<input type='hidden' id='parent_id_name'>
<input type='hidden' id='parent_id'>`
set_js := `$('#parent_id').val(node.id);
$('#parent_id_name').val(node.name);
$('#label').text('当前选中:'+node.name);`
close_js := `parent.layui.$('#parent_id').val($('#parent_id').val());
parent.layui.$('#parent_id_name').val($('#parent_id_name').val());`
switch this.R.FormValue("name") {
case "dept":
title = "部门名称"
url_list = "/admin/depart_tree/"
set_js = `
var node_id=node.id;
var node_name=node.name;
if($('#parent_id').val()!=""){
node_id=$('#parent_id').val()+","+node.id;
node_name=$('#parent_id_name').val()+","+node.name;
}
$('#parent_id').val(node_id);
$('#parent_id_name').val(node_name);
$('#label').text('当前选中:'+node_name);
`
close_js = `parent.layui.$('#dept_id').val($('#parent_id').val());
parent.layui.$('#dept_name').val($('#parent_id_name').val());`
case "goods":
title = "分类选择"
url_list = "/admin/cate_get_parent_menu/"
set_js = `
var node_id=node.id;
var node_name=node.name;
$('#parent_id').val(node_id);
$('#parent_id_name').val(node_name);
$('#label').text('当前选中:'+node_name);
`
close_js = `parent.layui.$('#cat_id').val($('#parent_id').val());
parent.layui.$('#cat_id_name').val($('#parent_id_name').val());`
case "china":
title = "城市选择"
url_list = "/admin/common_get_china/"
input_box = `<input type='hidden' id='province'>
<input type='hidden' id='full_name'>
<input type='hidden' id='area'>
<input type='hidden' id='city'>`
set_js = `
var node_id=node.id;
var node_name=node.full_name;
$('#province').val(node.province);
$('#city').val(node.city);
$('#area').val(node.area);
$('#full_name').val(node.full_name);
$('#label').text('当前选中:'+node_name);
`
close_js = `parent.layui.$('#province').val($('#province').val());
parent.layui.$('#city').val($('#city').val());
parent.layui.$('#area').val($('#area').val());
parent.layui.$('#full_name').val($('#full_name').val());`
}
this.Data["title"] = title
this.Data["list_url"] = url_list
this.Data["set_js"] = set_js
this.Data["hidden_input"] = input_box
this.Data["close_js"] = close_js
//fmt.Println(this.Data)
this.Tplname = "views/admin/common/pop.html"
this.Rander()
}
func (this *AdminController) AdminCommon_get_chinaAction() {
//redis_ct := redispack.Get_redis_pool()
//client := redis_ct.Get()
//hasok, _ := client.Do("GET", "china")
data := make([]map[string]interface{}, 0)
china := module.NewOrgStruct()
data = china.Get_china_data(this.R.FormValue("name"))
//fmt.Println(data)
/*fmt.Println(hasok)
if (hasok ==nil) {
china := module.NewOrgStruct()
data = china.Get_china_data( this.R.FormValue("name"))
fmt.Println("data", data)
tmp, _ := json.Marshal(&data)
client.Do("SETEX", "china", 3600, tmp)
} else {
if(hasok!=nil) {
json.Unmarshal(hasok.([]byte), &data)
}
}*/
raw, _ := json.Marshal(&data)
this.W.Write(raw)
}
func (this *AdminController) AdminCommon_get_db_listAction(){
}
func (this *AdminController) AdminCommon_get_china_treeAction() {
//redis_ct := redispack.Get_redis_pool()
//client := redis_ct.Get()
//hasok, _ := client.Do("GET", "china")
data := make([]map[string]interface{}, 0)
china := module.NewOrgStruct()
data = china.Get_china_tree()
//fmt.Println(data)
/*fmt.Println(hasok)
if (hasok ==nil) {
china := module.NewOrgStruct()
data = china.Get_china_data( this.R.FormValue("name"))
fmt.Println("data", data)
tmp, _ := json.Marshal(&data)
client.Do("SETEX", "china", 3600, tmp)
} else {
if(hasok!=nil) {
json.Unmarshal(hasok.([]byte), &data)
}
}*/
raw, _ := json.Marshal(&data)
this.W.Write(raw)
}
func (this *AdminController) AdminCommon_uploadAction() {
op := this.R.FormValue("action")
switch op {
case "config":
src := get_ueditor_config()
tt := []byte(src)
var r interface{}
json.Unmarshal(tt, &r) //这个byte要解码
conf, _ := json.Marshal(&r)
this.W.Write(conf)
case "uploadimage", "uploadfile", "uploadvideo":
baidu_json := save_baidu_file(this.R)
b, _ := json.Marshal(&baidu_json)
this.W.Write(b)
case "uploadscrawl":
baidu_json := save_baidu_base64(this.R)
b, _ := json.Marshal(&baidu_json)
this.W.Write(b)
case "listimage":
case "catchimage":
}
}
func save_baidu_base64(r *http.Request) map[string]interface{} {
fhs := r.FormValue("upfile")
ddd, _ := base64.StdEncoding.DecodeString(fhs)
newname := strconv.FormatInt(time.Now().Unix(), 10) // + "_" + filename
filename := common.Get_Upload_filename(newname, "")
ioutil.WriteFile(filename+".jpg", ddd, 0666) //buffer输出到jpg文件中(不做处理,直接写到文件)
json_str := map[string]interface{}{
"state": "SUCCESS",
"url": filename[1:],
"title": newname + ".jpg",
"original": newname + ".jpg",
}
return json_str
}
func save_baidu_file(r *http.Request) map[string]interface{} {
baidu_json := make(map[string]interface{})
fhs := r.MultipartForm.File["upfile"][0]
file, err := fhs.Open()
if err != nil {
fmt.Println(err)
return nil
}
filename := common.Get_Upload_filename(fhs.Filename, "")
f, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE, 0666)
if err != nil {
fmt.Println(err)
return nil
}
defer f.Close()
io.Copy(f, file)
baidu_json["original"] = "图片"
baidu_json["size"] = 11220
baidu_json["state"] = "SUCCESS"
baidu_json["title"] = "图片"
baidu_json["type"] = ".jpg"
baidu_json["url"] = filename[1:]
return baidu_json
}
| 28.641921 | 161 | 0.61732 |
4315df097f4e8a046189a6cb02e6fd18ed661d1d | 1,160 | lua | Lua | Sorting/bunch_of_sorts.lua | gustavodiel/trashCode | d657cebb02bec219d7caf799539db58d71655015 | [
"WTFPL",
"Unlicense"
] | null | null | null | Sorting/bunch_of_sorts.lua | gustavodiel/trashCode | d657cebb02bec219d7caf799539db58d71655015 | [
"WTFPL",
"Unlicense"
] | null | null | null | Sorting/bunch_of_sorts.lua | gustavodiel/trashCode | d657cebb02bec219d7caf799539db58d71655015 | [
"WTFPL",
"Unlicense"
] | null | null | null | --[[local oi = "Meu nome é gustavo"
local tamLinha = 20
local title = "Teste"
print ("[ " .. ( "=" ):rep(tamLinha - 4 - math.floor(#title/2)) .. "[ " .. title .. " ]" .. ( "=" ):rep(tamLinha - 3 - math.floor(#title/2)) .. " ]" )
for i = 1, #oi, 2 do
local text = oi:sub(i, #oi + 1 - i)
if ( #text <= 1 ) then
break
end
local space = (" "):rep( tamLinha - math.floor(#text/2))
text = ( "[" .. space .. text )
print ( text .. space .. "]" )
end
foo = 10;
]]
function randomize( tab, s, e )
local n = #tab
for i = s + 1, e do
local j , k = math.random(s, e), math.random(s, e)
tab[j], tab[k] = tab[k], tab[j]
end
return tab
end
function isSorted( tab, comp, s, e )
for i = s + 1, e do
if not comp(tab[i-1], tab[i]) then
return false
end
end
return true
end
function bogosort( t, comp, s, e )
while not isSorted(t, comp, s, e) do
randomize(t, s, e)
end
return t
end
function oi(tbl, comp)
local array_len = #tbl
comp = comp or function(a, b) return a < b end
for bound = 2, array_len do
bogosort(tbl, comp, 1, bound)
end
for i = 1, array_len do
print(tbl[i])
end
end
print "as"
| 19.333333 | 150 | 0.553448 |
85994675eea8390a1dab25160b11169b82ae1459 | 292 | js | JavaScript | redux-finish/src/functional/arrays.js | sumansjs/redux-app | 44c2f1d1fe1d3cd9944595bef1ac4dcc4edee0de | [
"MIT"
] | null | null | null | redux-finish/src/functional/arrays.js | sumansjs/redux-app | 44c2f1d1fe1d3cd9944595bef1ac4dcc4edee0de | [
"MIT"
] | 8 | 2021-03-10T21:10:25.000Z | 2022-02-19T03:15:02.000Z | redux/functional/arrays.js | markhary/coding_with_mosh | 109707530808245afb63b2f185d72e8d16edcf69 | [
"Unlicense"
] | null | null | null | const numbers = [1, 2, 3];
// Adding
const index = numbers.indexOf(2);
const added = [...numbers.slice(0, index), 4, ...numbers.slice(index)];
// Removing
const removed = numbers.filter(n => n !== 2);
// Updating
const updated = numbers.map(n => (n === 2 ? 20 : n));
console.log(updated);
| 22.461538 | 71 | 0.619863 |
0a091b958d736bf78d0b9427830c745bae26cf0b | 2,586 | h | C | src/WebHelper.h | drewgreenwell/Arduino-WebHelper | 551ef6523a9ee730c86dacb0c4bddefeb2c9fde8 | [
"MIT"
] | null | null | null | src/WebHelper.h | drewgreenwell/Arduino-WebHelper | 551ef6523a9ee730c86dacb0c4bddefeb2c9fde8 | [
"MIT"
] | null | null | null | src/WebHelper.h | drewgreenwell/Arduino-WebHelper | 551ef6523a9ee730c86dacb0c4bddefeb2c9fde8 | [
"MIT"
] | null | null | null | #ifndef WebHelper_h
#define WebHelper_h
enum RequestType {
GET = 1,
POST = 2,
PUT = 3,
PATCH = 4,
DELETE = 5,
OPTIONS = 6,
CONNECT = 7,
TRACE = 8
};
enum StatusCode {
OK = 0,
MULTIPLE_CHOICES = 1,
MOVED_PERMANENTLY = 2,
FOUND = 3,
NOT_MODIFIED = 4,
TEMPORARY_REDIRECT = 5,
BAD_REQUEST = 6,
UNAUTHORIZED = 7,
FORBIDDEN = 8,
NOT_FOUND = 9,
GONE = 10,
SERVER_ERROR = 11,
NOT_IMPLEMENTED = 12,
SERVICE_UNAVAILABLE = 13,
PERMISSION_DENIED = 14
};
enum RouteMatchType {
FULL = 1,
STARTS_WITH = 2,
ENDS_WITH = 3,
CONTAINS = 4
};
struct RequestInfo {
RequestInfo() : contentLength(-1) { }
int contentLength;
String contentType;
String host;
String url;
String path;
String query;
String userAgent;
String requestMethod;
String body;
String head;
String authType;
String authCredential;
String accept;
String acceptEncoding;
String acceptLanguage;
String connection;
enum RequestType requestType;
};
struct ResponseType {
String message;
int statusCode;
enum StatusCode responseType;
};
typedef void (*RouteHandler)(RequestInfo &request, Client &client);
typedef void (*TokenHandler)(String &token, Client &client);
struct Route {
String route;
RouteHandler handler;
RouteMatchType matchType;
};
class WebHelper
{
private:
static void init();
static boolean setRequestValue(String &property, String &line, const char * match);
static boolean setRequestTypeAndUrl(RequestInfo &request, String &line);
static boolean setAuthorization(RequestInfo &request, String &line);
static boolean setContentLength(RequestInfo &request, String &line);
public:
static const char * REQ_USER_AGENT;
static const char * REQ_CONTENT_TYPE;
static const char * REQ_HOST;
static const char * REQ_CONTENT_LENGTH;
static const char * REQ_AUTH;
static const char * REQ_ACCEPT;
static const char * REQ_ACCEPT_ENC;
static const char * REQ_ACCEPT_LNG;
static const char * REQ_CONNECTION;
static const String RequestTypes[];
static const ResponseType ResponseTypes[];
static RequestInfo parseRequest(Client &client);
static boolean handleRoutes(Route *routes, int routes_length, RequestInfo &request, Client &client);
static void respondWith(StatusCode statusCode, String contentType, String headers, const char * body, Client &client, TokenHandler tokenHandler);
};
#endif | 25.60396 | 153 | 0.672467 |
d5530a7928e93911affc1c6b49d7eb89857aaeb9 | 2,407 | kt | Kotlin | auth/src/jsMain/kotlin/com/github/lamba92/firebasemultiplatform/auth/FirebaseUser.kt | lamba92/FirebaseMultiplatform | b6b671bd6ecb5465ee67ef5d277bc37e591eb496 | [
"Apache-2.0"
] | 23 | 2020-01-24T15:13:57.000Z | 2022-01-01T07:19:31.000Z | auth/src/jsMain/kotlin/com/github/lamba92/firebasemultiplatform/auth/FirebaseUser.kt | lamba92/firebase-multiplatform | b6b671bd6ecb5465ee67ef5d277bc37e591eb496 | [
"Apache-2.0"
] | 9 | 2019-12-25T10:30:54.000Z | 2022-01-01T07:21:59.000Z | auth/src/jsMain/kotlin/com/github/lamba92/firebasemultiplatform/auth/FirebaseUser.kt | lamba92/FirebaseMultiplatform | b6b671bd6ecb5465ee67ef5d277bc37e591eb496 | [
"Apache-2.0"
] | 2 | 2020-01-23T17:49:34.000Z | 2020-03-23T17:20:09.000Z | package com.github.lamba92.firebasemultiplatform.auth
import firebase.User
import kotlinx.coroutines.await
actual class FirebaseUser(val delegate: User) {
actual val displayName: String?
get() = delegate.displayName
actual val email: String?
get() = delegate.email
actual val metadata: FirebaseUserMetadata?
get() = delegate.metadata.toMpp()
actual val phoneNumber: String?
get() = delegate.phoneNumber
actual val photoUrl: String?
get() = delegate.photoURL
actual val providerData: List<FirebaseUserInfo>
get() = delegate.providerData.mapNotNull { it?.toMpp() }
actual val providerId: String
get() = delegate.providerId
actual val uid: String
get() = delegate.uid
actual val isAnonymous: Boolean
get() = delegate.isAnonymous
actual val isEmailVerified: Boolean
get() = delegate.emailVerified
actual suspend fun delete() =
delegate.delete().await()
actual suspend fun getIdToken(forceRefresh: Boolean) =
delegate.getIdTokenResult(forceRefresh).await().toMpp()
actual suspend fun linkWithCredentials(credential: AuthCredential) =
delegate.linkWithCredential(credential.delegate).await().toMpp()
actual suspend fun reauthenticate(credential: AuthCredential) {
delegate.reauthenticateWithCredential(credential.delegate).await()
}
actual suspend fun reauthenticateAndRetrieveData(credential: AuthCredential) =
delegate.reauthenticateAndRetrieveDataWithCredential(credential.delegate).await().toMpp()
actual suspend fun reload() =
delegate.reload().await()
actual suspend fun sendEmailVerification() =
delegate.sendEmailVerification().await()
actual suspend fun unlink(providerId: String) {
delegate.unlink(this.providerId).await()
}
actual suspend fun updateEmail(email: String) =
delegate.updateEmail(email).await()
actual suspend fun updatePassword(password: String) =
delegate.updatePassword(password).await()
actual suspend fun updatePhoneNumber(phoneAuthCredential: PhoneAuthCredential) =
delegate.updatePhoneNumber(phoneAuthCredential.delegate).await()
actual suspend fun updateProfile(userProfileChangeRequest: UserProfileChangeRequest) =
delegate.updateProfile(userProfileChangeRequest.delegate).await()
} | 31.25974 | 97 | 0.717906 |
f07320187da09dd13226ebf15b281c23c4b206d4 | 486 | py | Python | gipsy/admin.py | marwahaha/gipsy-1 | 5d31c37cff26b9b26cd6d24e1b6de13c81ebbe6e | [
"MIT"
] | 10 | 2015-02-11T02:11:33.000Z | 2018-03-22T13:08:33.000Z | gipsy/admin.py | marwahaha/gipsy-1 | 5d31c37cff26b9b26cd6d24e1b6de13c81ebbe6e | [
"MIT"
] | 9 | 2015-01-22T15:45:44.000Z | 2015-10-19T14:18:09.000Z | gipsy/admin.py | marwahaha/gipsy-1 | 5d31c37cff26b9b26cd6d24e1b6de13c81ebbe6e | [
"MIT"
] | 7 | 2015-04-28T15:20:57.000Z | 2019-07-16T03:45:12.000Z | from django.contrib import admin
class ChildrenInline(admin.TabularInline):
sortable_field_name = "order"
class GipsyMenu(admin.ModelAdmin):
inlines = [ChildrenInline]
exclude = ('parent',)
list_display = ['name', 'order']
ordering = ['order']
def get_queryset(self, request):
"""Overrides default queryset to only display parent items"""
query = super(GipsyMenu, self).get_queryset(request)
return query.filter(parent__isnull=True)
| 27 | 69 | 0.693416 |
7527118643c1c0b1c42d0aed48b99816745c371f | 1,171 | rs | Rust | tests/web.rs | alordash/wasm-pack-template | 2bc5cd7d4ebd3457bbd4f4487804962b748ce541 | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/web.rs | alordash/wasm-pack-template | 2bc5cd7d4ebd3457bbd4f4487804962b748ce541 | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/web.rs | alordash/wasm-pack-template | 2bc5cd7d4ebd3457bbd4f4487804962b748ce541 | [
"Apache-2.0",
"MIT"
] | null | null | null | //! Test suite for the Web and headless browsers.
#![cfg(target_arch = "wasm32")]
extern crate wasm_bindgen_test;
use std::println;
use wasm_bindgen_test::*;
use wasm_game_of_life::Universe;
wasm_bindgen_test_configure!(run_in_browser);
#[wasm_bindgen_test]
fn pass() {
assert_eq!(1 + 1, 2);
}
#[cfg(test)]
pub fn input_spaceship() -> Universe {
let mut universe = Universe::new(6, 6, false);
universe.set_cells(true, &[(1, 2), (2, 3), (3, 1), (3, 2), (3, 3)]);
universe
}
#[cfg(test)]
pub fn expected_spaceship() -> Universe {
let mut universe = Universe::new(6, 6, false);
universe.set_cells(true, &[(2, 1), (2, 3), (3, 2), (3, 3), (4, 2)]);
universe
}
#[wasm_bindgen_test]
pub fn test_tick() {
let mut input_universe = input_spaceship();
println!("input universe:\n{}", input_universe);
let expected_universe = expected_spaceship();
let exp = format!("{}", expected_universe);
println!("expected_universe:\n{}", expected_universe);
input_universe.tick();
let inp = format!("{}", input_universe);
assert_eq!(inp, exp);
assert_eq!(&input_universe.get_cells(), &expected_universe.get_cells());
}
| 24.914894 | 76 | 0.652434 |
9df94408e9bc9717490689ff2fa3d2445ba4f574 | 678 | lua | Lua | Projects/DataTemplates/template_lua2/tag_tbtesttag.lua | fanlanweiy/luban_examples | 9ddca2a01e8db1573953be3f32c59104451cd96e | [
"MIT"
] | 44 | 2021-05-06T06:16:55.000Z | 2022-03-30T06:27:25.000Z | Projects/DataTemplates/template_lua2/tag_tbtesttag.lua | HFX-93/luban_examples | 5b90e392d404950d12ff803a186b26bdea5e0292 | [
"MIT"
] | 1 | 2021-07-25T16:35:32.000Z | 2021-08-23T04:59:49.000Z | Projects/DataTemplates/template_lua2/tag_tbtesttag.lua | HFX-93/luban_examples | 5b90e392d404950d12ff803a186b26bdea5e0292 | [
"MIT"
] | 14 | 2021-06-09T10:38:59.000Z | 2022-03-30T06:27:24.000Z |
-- tag.TbTestTag
return
{
[2001] =
{
id=2001,
value="导出",
},
[2004] =
{
id=2004,
value="any",
},
[2003] =
{
id=2003,
value="test",
},
[100] =
{
id=100,
value="导出",
},
[1] =
{
id=1,
value="导出",
},
[2] =
{
id=2,
value="导出",
},
[6] =
{
id=6,
value="导出",
},
[7] =
{
id=7,
value="导出",
},
[9] =
{
id=9,
value="测试",
},
[10] =
{
id=10,
value="测试",
},
[11] =
{
id=11,
value="any",
},
[12] =
{
id=12,
value="导出",
},
[13] =
{
id=13,
value="导出",
},
[104] =
{
id=104,
value="any",
},
[102] =
{
id=102,
value="test",
},
[3001] =
{
id=3001,
value="export",
},
[3004] =
{
id=3004,
value="any",
},
[3003] =
{
id=3003,
value="test",
},
}
| 6.848485 | 16 | 0.421829 |
c4992bfc634080814cbcbcd590f59a06df2fc062 | 4,350 | dart | Dart | packages/flutter/test/widgets/selection_container_test.dart | jhonsnow456/flutter | 1debb14c339c6adedfd3bd5669d38818ce4a418d | [
"BSD-3-Clause"
] | 13 | 2021-09-30T10:31:12.000Z | 2022-03-23T06:20:21.000Z | packages/flutter/test/widgets/selection_container_test.dart | jhonsnow456/flutter | 1debb14c339c6adedfd3bd5669d38818ce4a418d | [
"BSD-3-Clause"
] | 14 | 2022-01-04T18:19:17.000Z | 2022-03-31T06:30:41.000Z | packages/flutter/test/widgets/selection_container_test.dart | jhonsnow456/flutter | 1debb14c339c6adedfd3bd5669d38818ce4a418d | [
"BSD-3-Clause"
] | null | null | null | // Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
Future<void> pumpContainer(WidgetTester tester, Widget child) async {
await tester.pumpWidget(
DefaultSelectionStyle(
selectionColor: Colors.red,
child: child,
),
);
}
testWidgets('updates its registrar and delegate based on the number of selectables', (WidgetTester tester) async {
final TestSelectionRegistrar registrar = TestSelectionRegistrar();
final TestContainerDelegate delegate = TestContainerDelegate();
await pumpContainer(
tester,
SelectionContainer(
registrar: registrar,
delegate: delegate,
child: Column(
children: const <Widget>[
Text('column1', textDirection: TextDirection.ltr),
Text('column2', textDirection: TextDirection.ltr),
Text('column3', textDirection: TextDirection.ltr),
],
),
),
);
expect(registrar.selectables.length, 1);
expect(delegate.selectables.length, 3);
});
testWidgets('disabled container', (WidgetTester tester) async {
final TestSelectionRegistrar registrar = TestSelectionRegistrar();
final TestContainerDelegate delegate = TestContainerDelegate();
await pumpContainer(
tester,
SelectionContainer(
registrar: registrar,
delegate: delegate,
child: SelectionContainer.disabled(
child: Column(
children: const <Widget>[
Text('column1', textDirection: TextDirection.ltr),
Text('column2', textDirection: TextDirection.ltr),
Text('column3', textDirection: TextDirection.ltr),
],
),
),
),
);
expect(registrar.selectables.length, 0);
expect(delegate.selectables.length, 0);
});
testWidgets('selection container registers itself if there is a selectable child', (WidgetTester tester) async {
final TestSelectionRegistrar registrar = TestSelectionRegistrar();
final TestContainerDelegate delegate = TestContainerDelegate();
await pumpContainer(
tester,
SelectionContainer(
registrar: registrar,
delegate: delegate,
child: Column(
),
),
);
expect(registrar.selectables.length, 0);
await pumpContainer(
tester,
SelectionContainer(
registrar: registrar,
delegate: delegate,
child: Column(
children: const <Widget>[
Text('column1', textDirection: TextDirection.ltr),
],
),
),
);
expect(registrar.selectables.length, 1);
await pumpContainer(
tester,
SelectionContainer(
registrar: registrar,
delegate: delegate,
child: Column(
),
),
);
expect(registrar.selectables.length, 0);
});
testWidgets('selection container gets registrar from context if not provided', (WidgetTester tester) async {
final TestSelectionRegistrar registrar = TestSelectionRegistrar();
final TestContainerDelegate delegate = TestContainerDelegate();
await pumpContainer(
tester,
SelectionRegistrarScope(
registrar: registrar,
child: SelectionContainer(
delegate: delegate,
child: Column(
children: const <Widget>[
Text('column1', textDirection: TextDirection.ltr),
],
),
),
),
);
expect(registrar.selectables.length, 1);
});
}
class TestContainerDelegate extends MultiSelectableSelectionContainerDelegate {
@override
SelectionResult dispatchSelectionEventToChild(Selectable selectable, SelectionEvent event) {
throw UnimplementedError();
}
@override
void ensureChildUpdated(Selectable selectable) {
throw UnimplementedError();
}
}
class TestSelectionRegistrar extends SelectionRegistrar {
final Set<Selectable> selectables = <Selectable>{};
@override
void add(Selectable selectable) => selectables.add(selectable);
@override
void remove(Selectable selectable) => selectables.remove(selectable);
}
| 29.591837 | 116 | 0.657931 |
dff5c7f2c78de7ad0c89fa9838a296f037fd8af3 | 2,365 | ts | TypeScript | src/map/node/node.service.ts | Curry/lost-nest | 30c13ec883b4279f2002ddce417fd65c352fcbbb | [
"MIT"
] | null | null | null | src/map/node/node.service.ts | Curry/lost-nest | 30c13ec883b4279f2002ddce417fd65c352fcbbb | [
"MIT"
] | 5 | 2021-03-10T13:08:12.000Z | 2022-01-22T11:20:14.000Z | src/map/node/node.service.ts | Curry/lost-nest | 30c13ec883b4279f2002ddce417fd65c352fcbbb | [
"MIT"
] | null | null | null | import { Injectable, Inject } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { Node } from './node.interface';
import { from } from 'rxjs';
import { RedisPubSub } from 'graphql-redis-subscriptions';
import { tap } from 'rxjs/operators';
import { NodeInput } from './node.input';
@Injectable()
export class NodeService {
constructor(
@InjectModel('Node')
private nodeModel: Model<Node>,
@Inject('PUB_SUB')
private pubSub: RedisPubSub,
) {}
saveNode = (mapId: number, systemId: number) =>
from(
this.nodeModel.findOneAndUpdate(
{
mapId,
systemId,
},
{
mapId,
systemId,
},
{
upsert: true,
setDefaultsOnInsert: true,
new: true,
},
),
).pipe(
tap(node => {
this.generateStateChange('Add Node', node);
}),
);
syncChanges = (node: NodeInput) =>
from(
this.nodeModel.findByIdAndUpdate(node.id, node, {
upsert: true,
setDefaultsOnInsert: true,
new: true,
}),
);
moveNode = (id: string, posX: number, posY: number) =>
from(
this.nodeModel.findByIdAndUpdate(id,
{
posX,
posY,
},
{
new: true,
},
),
).pipe(
tap(node => {
this.generateStateChange('Move Node', node);
}),
);
findNodesByMapId = (mapId: number) => from(this.nodeModel.find({ mapId }));
findNodeBySystem = (systemId: number) =>
from(this.nodeModel.findOne({ systemId }));
deleteNode = (id: string) =>
from(this.nodeModel.findByIdAndDelete(id)).pipe(
tap(node => {
this.generateStateChange('Delete Node', node);
}),
);
deleteNodeBySystem = (systemId: number) =>
from(this.nodeModel.findOneAndDelete({ systemId })).pipe(
tap(node => {
this.generateStateChange('Delete Node', node);
}),
);
generateStateChange = (
type: string,
{ id, mapId, systemId, system, alias, posX, posY }: Node,
) => {
this.pubSub.publish(`sub.${mapId}`, {
type: `[Socket] ${type}`,
props: JSON.stringify({
id,
mapId,
systemId,
system,
alias,
posX,
posY,
}),
});
};
}
| 22.52381 | 77 | 0.539112 |
81673060b1a062e0e7d0df7e5fd58e6c9442233a | 1,226 | go | Go | client/app/services/download/download_service.go | userado/CHAOS | 8e676365130e13262d5f6a0712d88f76d7bdf82b | [
"MIT"
] | 1,591 | 2017-07-11T18:38:49.000Z | 2022-03-31T21:04:00.000Z | client/app/services/download/download_service.go | userado/CHAOS | 8e676365130e13262d5f6a0712d88f76d7bdf82b | [
"MIT"
] | 67 | 2017-07-14T20:58:06.000Z | 2022-03-31T22:04:15.000Z | client/app/services/download/download_service.go | userado/CHAOS | 8e676365130e13262d5f6a0712d88f76d7bdf82b | [
"MIT"
] | 417 | 2017-07-11T18:41:37.000Z | 2022-03-22T14:46:24.000Z | package download
import (
"fmt"
"github.com/tiagorlampert/CHAOS/client/app/gateway"
"github.com/tiagorlampert/CHAOS/client/app/services"
"github.com/tiagorlampert/CHAOS/client/app/shared/environment"
"io/ioutil"
"net/http"
"os"
"path/filepath"
)
type DownloadService struct {
Configuration *environment.Configuration
Gateway gateway.Gateway
}
func NewDownloadService(configuration *environment.Configuration, gateway gateway.Gateway) services.Download {
return &DownloadService{
Configuration: configuration,
Gateway: gateway,
}
}
func (d DownloadService) DownloadFile(filepath string) ([]byte, error) {
filename := getFilenameFromPath(filepath)
url := fmt.Sprintf("%s/%s", fmt.Sprint(d.Configuration.Server.URL, d.Configuration.Server.Download), filename)
res, err := d.Gateway.NewRequest(http.MethodGet, url, nil)
if err != nil {
return nil, err
}
if res.StatusCode != http.StatusOK {
return nil, fmt.Errorf("request failed with status code: %d", res.StatusCode)
}
if err := ioutil.WriteFile(filepath, res.ResponseBody, os.ModePerm); err != nil {
return nil, err
}
return []byte(filename), nil
}
func getFilenameFromPath(path string) string {
return filepath.Base(path)
}
| 26.085106 | 111 | 0.74062 |
de68e6674357449620f23b4349743b310e4f79dc | 38 | ps1 | PowerShell | core-example/build.ps1 | semiodesk/trinity-rdf-examples | 873169fcfa443fd6104cce01f3ff19520c471367 | [
"MIT"
] | null | null | null | core-example/build.ps1 | semiodesk/trinity-rdf-examples | 873169fcfa443fd6104cce01f3ff19520c471367 | [
"MIT"
] | null | null | null | core-example/build.ps1 | semiodesk/trinity-rdf-examples | 873169fcfa443fd6104cce01f3ff19520c471367 | [
"MIT"
] | 1 | 2021-11-05T12:46:02.000Z | 2021-11-05T12:46:02.000Z |
docker build -t core-example:latest . | 19 | 37 | 0.763158 |
ef410437a7459e41914c1c1a891964f7a9eab877 | 30,217 | ps1 | PowerShell | Get-BaselineFixedDisablev3.ps1 | VashsWrath/Get-Baseline | 908b872e09609354725ea4144cc7c2e4680901f4 | [
"MIT"
] | null | null | null | Get-BaselineFixedDisablev3.ps1 | VashsWrath/Get-Baseline | 908b872e09609354725ea4144cc7c2e4680901f4 | [
"MIT"
] | null | null | null | Get-BaselineFixedDisablev3.ps1 | VashsWrath/Get-Baseline | 908b872e09609354725ea4144cc7c2e4680901f4 | [
"MIT"
] | null | null | null | function Get-Baseline {
<#
.SYNOPSIS
This script is used to get useful baseline information from windows systems in scope.
It is designed for the Incident Response scenario. It primarily relies on PowerShell
Remoting and can enable PSRemoting over SMB or WMI if necessary.
Function: Get-Baseline
Author: Jake Van Duyne
Contributers: Matthew A Hand, Charles Thompson, Calvin Simpson
Required Dependencies:
-Sysinternals Suite served via http. Update $url variable
-List hostnames of target systems in Targets array
-Targets have remote administration enabled - PSRemoting, SMB, or WMI
Optional Dependencies: None
Version: 1.0
.DESCRIPTION
This script is used to get useful information from a computer. Currently, the script gets the following information:
-System Information
-Tasklist
-Netstat
-Loaded DLLs
-Audit Configuration
-Event Log Configuration
-Event Log Data
-Autorunsc
-SigCheck SysWOW64,System32
.PARAMETER NoHash
Bool: Set to $true to skip the hashing function for executables and dlls. Default: $false
.PARAMETER Targets
String[]: Comma separated list of hostnames to execute script on.
Can also be $(get-content <IP_list_file>.txt)
.PARAMETER url
String: Provide the URL of the Sysinternals Suite http server.
.EXAMPLE
PS> Get-Baseline -Targets dc01,srv01,pc02win10 -url "http://10.0.0.133:8080/" -SkipSigcheck
PS> Get-Baseline -Targets dc01 -url "http://10.0.0.133:8080/" -SkipSigcheck
PS> Get-Baseline -Targets $(get-content lab.txt) -SkipSigcheck
PS> Get-Baseline -Targets dc02,srv01win2012r2,srv02win2012r2,srv03win2016,pc01win10,pc02win10,srv04win2008 -SkipSigcheck
.EXAMPLE
PS> Get-Baseline -Targets $(get-content hostname_list.txt) -url "http://10.0.0.128:8080/" -SkipSigcheck
.LINK
#>
[cmdletbinding()]
Param([bool] $NoHash = $false,
[String[]]$Targets,
[String]$url,
[Switch]$SkipSystemInfo,
[Switch]$SkipTasklist,
[Switch]$SkipDLLs,
[Switch]$SkipNetstat,
[Switch]$SkipAutoruns,
[Switch]$SkipAuditConfig,
[Switch]$SkipEventLogSettings,
[Switch]$SkipRemoteEnable,
[Switch]$SkipEventLogData)
$VerbosePreference = "Continue"
New-Item ./Baseline -type directory -force -EA SilentlyContinue
# Test local PSVersion (must be greater than 4.0)
if ( $PSVersionTable.PSVersion.Major -lt 4 ) {
Write-Warning "The system running this script must have a PSVersion of 4.0 or greater"
Write-Warning "The remote systems can be as low as 2.0"
Stop-Transcript
continue
}
# Check Targets for Remote Access and Enable.
if (-Not $SkipRemoteEnable) {
$PSTargets = @()
$PSTargets = Enable-RemoteAccess -Targets $Targets
} else {
$PSTargets = $Targets
}
Write-Host "Scheduled to execute baseline collection on:"
Write-Host $PSTargets
$ExecuteConfirmation = Read-Host "`nAre you sure you want to execute? [y/n]"
if (($ExecuteConfirmation -eq "n") -OR ($ExecuteConfirmation -eq "N")) {
continue
}
# Begin Collection
if (-Not $SkipAuditConfig) {
Write-Verbose "Getting Audit Levels"
Invoke-Command -ComputerName $PSTargets -ScriptBlock {& auditpol /get /category:* /r | Convertfrom-Csv} -ThrottleLimit 5 | Export-Csv ./Baseline/auditpol.csv -NoTypeInformation
Write-Verbose "Getting Additional Audit Options"
Invoke-Command -ComputerName $PSTargets -ScriptBlock ${Function:Get-AuditOptions} -ThrottleLimit 5 | Export-Csv ./Baseline/auditoptions.csv -NoTypeInformation
}
if (-Not $SkipSystemInfo) {
Write-Verbose "Getting System Information"
Invoke-Command -ComputerName $PSTargets -ScriptBlock {& systeminfo /FO CSV | Convertfrom-Csv} | Export-Csv ./Baseline/systeminfo.csv -NoTypeInformation
}
if (-Not $SkipTasklist) {
Write-Verbose "Getting Better Tasklist"
Invoke-Command -ComputerName $PSTargets -ScriptBlock ${Function:Get-BetterTasklist} -ArgumentList $NoHash | Export-Csv ./Baseline/tasklist.csv -NoTypeInformation
}
if (-Not $SkipDLLs) {
Write-Verbose "Getting Loaded DLLs"
Invoke-Command -ComputerName $PSTargets -ScriptBlock ${Function:Get-DLLs} -ArgumentList $NoHash | Export-Csv ./Baseline/dlls.csv -NoTypeInformation
}
if (-Not $SkipNetstat) {
Write-Verbose "Getting Better TCP Netstat"
Invoke-Command -ComputerName $PSTargets -ScriptBlock ${Function:Get-BetterNetstatTCP} -ArgumentList $NoHash | Export-Csv ./Baseline/netstat_TCP.csv -NoTypeInformation
Write-Verbose "Getting Better TCPv6 Netstat"
Invoke-Command -ComputerName $PSTargets -ScriptBlock ${Function:Get-BetterNetstatTCPv6} -ArgumentList $NoHash | Export-Csv ./Baseline/netstat_TCPv6.csv -NoTypeInformation
Write-Verbose "Getting Better UDP Netstat"
Invoke-Command -ComputerName $PSTargets -ScriptBlock ${Function:Get-BetterNetstatUDP} -ArgumentList $NoHash | Export-Csv ./Baseline/netstat_UDP.csv -NoTypeInformation
Write-Verbose "Getting Better UDPv6 Netstat"
Invoke-Command -ComputerName $PSTargets -ScriptBlock ${Function:Get-BetterNetstatUDPv6} -ArgumentList $NoHash | Export-Csv ./Baseline/netstat_UDPv6.csv -NoTypeInformation
}
if (-Not $SkipAutoruns) {
Write-Verbose "Getting Autorunsc Data"
Invoke-Command -ComputerName $PSTargets -ScriptBlock {New-Item -path C:\blue_temp\ -ItemType directory -force}
foreach ($i in $PSTargets) {
if (Test-Path \\$i\c$\blue_temp\) {
Copy-Item .\autorunsc.exe \\$i\c$\blue_temp\ -Verbose
} else {
Write-Verbose "Error creating remote directory!"
}
}
Invoke-Command -ComputerName $PSTargets -ScriptBlock ${Function:Invoke-Autorunsc} -ArgumentList $url | Export-Csv ./Baseline/autorunsc.csv -NoTypeInformation
foreach ($i in $PSTargets) {
if (Test-Path \\$i\c$\blue_temp\autorunsc.exe) {
Write-Verbose "Error removing remote files!"
}
}
}
if (-Not $SkipEventLogSettings) {
Write-Verbose "Getting Event Log Settings"
Invoke-Command -ComputerName $PSTargets -ScriptBlock {Get-EventLog -list | Select LogDisplayName,Log,MachineName,MaximumKilobytes,OverflowAction,MinimumRetentionDays,EnableRaisingEvent,SynchronizingObject,Source,Site,Container
} | Export-Csv ./Baseline/eventloglist.csv -NoTypeInformation
}
Write-Verbose "Getting Windows Defender Detections"
Invoke-Command -ComputerName $PSTargets -ScriptBlock {Get-MpThreat} | Export-Csv ./Baseline/MpThreat.csv -NoTypeInformation
Invoke-Command -ComputerName $PSTargets -ScriptBlock {Get-MpThreatDetection} | Export-Csv ./Baseline/MpThreatDetection.csv -NoTypeInformation
Write-Verbose "Getting Windows PowerShell History"
Invoke-Command -ComputerName $PSTargets -ScriptBlock {gc $((Get-PSReadlineOption).HistorySavePath)} | Export-Csv ./Baseline/PowerShellHistory.csv -NoTypeInformation
if (-Not $SkipEventLogData) {
Get-HuntData -Targets $PSTargets
}
Write-Verbose "Disabling Remote Data Collection for Get-Baseline"
Disable-WinRm -Targets $PSTargets
}
function Get-HuntData {
<#
.SYNOPSIS
This script queries remote systems for windows event logs.
Function: Get-HuntData
Author:
Required Dependencies: PSRemoting
Optional Dependencies: None
Version: 1.0
.DESCRIPTION
Be mindful of size. 313,746 Entries creates a 279 MB CSV...
Recommend running this script on 5 or fewer targest at a time.
Also Note that Get-WinEvent requires PowerShell Version 3.5+
.PARAMETER Verbose
.PARAMETER Targets
String[]: Comma separated list of hostnames to execute script on.
Can also be $(get-content <IP_list_file.txt)
.EXAMPLE
PS> Get-HuntData -Targets pc01win7
.LINK
#>
[cmdletbinding()]
Param([String[]]$Targets)
$VerbosePreference = "Continue"
New-Item ./EventLogData -type directory -force
foreach ($i in $Targets) {
New-Item ./EventLogData/$i -type directory -force
Write-Verbose "Collecting Application Log on $i"
Invoke-Command -ComputerName $i -ScriptBlock {Get-WinEvent -LogName Application | Format-Table ProviderName,TimeCreated,Id,LevelDisplayName,Message} | Export-Csv ./EventLogData/$i/eventlog_application_$i`.csv -NoTypeInformation
Write-Verbose "Collecting System Log on $i"
Invoke-Command -ComputerName $i -ScriptBlock {Get-Winevent -LogName System | Format-Table ProviderName,TimeCreated,Id,LevelDisplayName,Message} | Export-Csv ./EventLogData/$i/eventlog_system_$i`.csv -NoTypeInformation
Write-Verbose "Collecting Powershell Log on $i"
Invoke-Command -ComputerName $i -ScriptBlock {Get-Winevent -LogName 'Windows PowerShell' } | Export-Csv ./EventLogData/$i/eventlog_powershell_$i`.csv -NoTypeInformation
Write-Verbose "Collecting Microsoft-Windows-Windows Defender/Operational on $i"
Invoke-Command -ComputerName $i -ScriptBlock {Get-WinEvent -LogName 'Microsoft-Windows-Windows Defender/Operational'} -EA SilentlyContinue | Export-Csv ./EventLogData/$i/eventlog_defender_operational_$i`.csv -NoTypeInformation
Write-Verbose "Collecting Microsoft-Windows-AppLocker/EXE and DLL on $i"
Invoke-Command -ComputerName $i -ScriptBlock {Get-WinEvent -LogName 'Microsoft-Windows-AppLocker/EXE and DLL'} -EA SilentlyContinue | Export-Csv ./EventLogData/$i/eventlog_applocker_exedll_$i`.csv -NoTypeInformation
Write-Verbose "Collecting Microsoft-Windows-AppLocker/MSI and Script on $i"
Invoke-Command -ComputerName $i -ScriptBlock {Get-WinEvent -LogName 'Microsoft-Windows-AppLocker/MSI and Script'} -EA SilentlyContinue | Export-Csv ./EventLogData/$i/eventlog_applocker_msiscript_$i`.csv -NoTypeInformation
Write-Verbose "Collecting Microsoft-Windows-AppLocker/Packaged app-Execution on $i"
Invoke-Command -ComputerName $i -ScriptBlock {Get-WinEvent -LogName 'Microsoft-Windows-AppLocker/Packaged app-Execution'} -EA SilentlyContinue | Export-Csv ./EventLogData/$i/eventlog_applocker_packaged_$i`.csv -NoTypeInformation
Write-Verbose "Collecting Microsoft-Windows-DeviceGuard/Operational on $i"
Invoke-Command -ComputerName $i -ScriptBlock {Get-WinEvent -LogName 'Microsoft-Windows-DeviceGuard/Operational'} -EA SilentlyContinue | Export-Csv ./EventLogData/$i/eventlog_deviceguard_operational_$i`.csv -NoTypeInformation
Write-Verbose "Collecting Microsoft-Windows-PowerShell/Operational on $i"
Invoke-Command -ComputerName $i -ScriptBlock {Get-WinEvent -LogName 'Microsoft-Windows-PowerShell/Operational'} -EA SilentlyContinue | Export-Csv ./EventLogData/$i/eventlog_powershell_operational_$i`.csv -NoTypeInformation
Write-Verbose "Collecting Microsoft-Windows-Windows Firewall With Advanced Security/Firewall on $i"
Invoke-Command -ComputerName $i -ScriptBlock {Get-WinEvent -LogName 'Microsoft-Windows-Windows Firewall With Advanced Security/Firewall'} -EA SilentlyContinue | Export-Csv ./EventLogData/$i/eventlog_firewall_$i`.csv -NoTypeInformation
Write-Verbose "Collecting Microsoft-Windows-Sysmon/Operational on $i"
Invoke-Command -ComputerName $i -ScriptBlock {Get-WinEvent -LogName "Microsoft-Windows-Sysmon/Operational"} -EA SilentlyContinue | Export-Csv ./EventLogData/$i/eventlog_sysmon_operational_$i`.csv -NoTypeInformation
Write-Verbose "Collecting Security Log on $i"
Invoke-Command -ComputerName $i -ScriptBlock {Get-WinEvent -Logname "Security"} | Export-Csv ./EventLogData/$i/eventlog_security_$i`.csv -NoTypeInformation
}
}
function Enable-RemoteAccess {
[cmdletbinding()]
Param([String[]] $Targets)
$VerbosePreference = "Continue"
$SMBConfirmation = Read-Host "`n`nIf WinRM/PSRemoting is DISABLED, attempt to ENABLE with PsExec? [y/n]"
$WMIConfirmation = Read-Host "`nIf WinRM/PSRemoting and SMB is DISABLED, attempt to ENABLE with WMI? [y/n]"
$PSTargets = @()
$SMBTargets = @()
$WMITargets = @()
$NoRemoteTargets = @()
$SMBChangedTargets = @()
$SMBFailedTargets = @()
$WMIChangedTargets = @()
$WMIFailedTargets = @()
foreach ($i in $Targets) {
Write-Verbose "Testing Remote Management Options for $i"
if ( Test-WSMan $i -EA SilentlyContinue ) {
Write-Verbose "PSRemoting Enabled on $i"
$PSTargets += $i
} elseif ( Test-Path \\$i\admin$ -EA SilentlyContinue ) {
Write-Verbose "SMB Enabled on $i"
$SMBTargets += $i
} elseif ( Invoke-WmiMethod -class Win32_process -name Create -ArgumentList "CMD.EXE /c ipconfig" -ComputerName $i -EA SilentlyContinue ) {
Write-Verbose "WMI Enabled on $i"
$WMITargets += $i
} else {
Write-Verbose "NO REMOTING Enabled on $i"
$NoRemoteTargets += $i
}
}
Write-Host "`n========================================================================"
Write-Host "Pre-Execution Report"
Write-Host "`nPowerShell Remoting Targets:"
Write-Host $PSTargets
Write-Host "`nSMB/PsExec Remoting Targets:"
Write-Host $SMBTargets
Write-Host "`nWMI Remoting Targets:"
Write-Host $WMITargets
Write-Host "`nTargets with NO REMOTING Options:"
Write-Host $NoRemoteTargets
Write-Host "`n========================================================================`n"
if (($SMBConfirmation -eq "y") -OR ($SMBConfirmation -eq "Y")) {
Write-Host "You have elected to enable PSRemoting via PsExec."
} else {
Write-Host "You have elected NOT to enable PSRemoting via PsExec."
}
if (($WMIConfirmation -eq "y") -OR ($WMIConfirmation -eq "Y")) {
Write-Host "You have elected to enable PSRemoting via WMI."
} else {
Write-Host "You have elected NOT to enable PSRemoting via WMI."
}
$ExecuteConfirmation = Read-Host "`nAre you sure you want to execute? [y/n]"
if (($ExecuteConfirmation -eq "y") -OR ($ExecuteConfirmation -eq "Y")) {
if (($SMBConfirmation -eq "y") -OR ($SMBConfirmation -eq "Y")) {
Write-Verbose "Executing PsExec..."
if ( -Not (Test-Path .\PsExec.exe)) {
Write-Warning "You must have PsExec.exe in the current working directory to run this function!"
continue
}
# Enable WinRM via PsExec
$SMBChangedTargets = Enable-WinRMPsExec -SMBTargets $SMBTargets
#Write-Verbose "`n`nValue of SMBChangedTargets: $SMBChangedTargets"
# Determine which systems failed enabling PSRemoting via PsExec and store in variable SMBFailedTargets
if ($SMBChangedTargets -ne $null) {
$SMBFailedTargets = Compare-Object -ReferenceObject $SMBChangedTargets -DifferenceObject $SMBTargets -PassThru
} else {
$SMBFailedTargets = $SMBTargets
}
# If PsExec fails on systems and WMI is allowed by user, Attempt enable via WMI
if (($SMBFailedTargets -ne $null) -AND (($WMIConfirmation -eq "y") -OR ($WMIConfirmation -eq "Y")) ) {
Write-Verbose "Adding SMB Failed Targets to WMI Targets..."
$WMITargets += $SMBFailedTargets
}
}
if (($WMIConfirmation -eq "y") -OR ($WMIConfirmation -eq "Y")) {
Write-Verbose "Executing WMI..."
$WMIChangedTargets += Enable-WinRMWMI -WMITargets $WMITargets
#Write-Verbose "`n`nValue of WMIChangedTargets: $WMIChangedTargets"
# Determine which systems failed enabling PSRemoting via PsExec and store in variable WMIFailedTargets
if ($WMIChangedTargets -ne $null) {
$WMIFailedTargets = Compare-Object -ReferenceObject $WMIChangedTargets -DifferenceObject $WMITargets -PassThru
} else {
$WMIFailedTargets = $WMITargets
}
}
} else {
Write-Verbose "Exiting..."
continue
}
Write-Host "`n========================================================================"
Write-Host "Post-Execution Report"
Write-Host "`nPowerShell Remoting Targets:"
Write-Host $PSTargets
Write-Host "`n`nSMB/PsExec Remoting Targets SUCCESS enabling PSRemoting:"
Write-Host $SMBChangedTargets
Write-Host "`nSMB/PsExec Remoting Targets FAILED enabling PSRemoting:"
Write-Host $SMBFailedTargets
Write-Host "`n`nWMI Remoting Targets SUCCESS enabling PSRemoting:"
Write-Host $WMIChangedTargets
Write-Host "`nWMI Remoting Targets FAILED enabling PSRemoting:"
Write-Host $WMIFailedTargets
Write-Host "`n`nTargets with NO REMOTING Options:"
Write-Host $NoRemoteTargets
$PSTargets += $SMBChangedTargets
$PSTargets += $WMIChangedTargets
Write-Host "`n`nFINAL Targets ready for PSRemoting:"
Write-Host $PSTargets
Write-Host "========================================================================`n"
return $PSTargets
}
function Enable-WinRMPsExec {
[cmdletbinding()]
Param([String[]] $SMBTargets)
$ChangedTargets = @()
if ( -Not (Test-Path .\PsExec.exe)) {
Write-Warning "You must have PsExec.exe in the current working directory to run this function!"
continue
}
foreach ($i in $SMBTargets) {
# Enable WinRM over PsExec
Write-Verbose "Executing winrm quickconfig -q on $i with PsExec"
$a = .\PsExec.exe \\$i -s winrm.cmd quickconfig -quiet -force 2>&1>$null
if ( Test-WSMan $i -EA SilentlyContinue ) {
Write-Verbose "Success enabling PSRemoting on $i with PsExec"
$ChangedTargets += $i
} else {
Write-Warning "PsExec Failed!"
}
}
return $ChangedTargets
}
function Enable-WinRMWMI {
[cmdletbinding()]
Param([String[]] $WMITargets)
$ChangedTargets = @()
foreach ($i in $WMITargets) {
# Enable WinRM over WMI
Write-Verbose "Executing winrm quickconfig -q on $i with WMI"
$a = Invoke-WmiMethod -ComputerName $i -Path win32_process -Name create -ArgumentList "powershell.exe -command Enable-PSRemoting -SkipNetworkProfileCheck -Force" 2>&1>$null
$a = Start-Sleep 10
$a = Invoke-WmiMethod -ComputerName $i -Class Win32_process -Name Create -ArgumentList "CMD.EXE /c winrm quickconfig -quiet -force" -EnableAllPrivileges 2>&1>$null
#$a = Invoke-WmiMethod -class Win32_process -name Create -ArgumentList "CMD.EXE /c winrm set winrm/config/client @{TrustedHost=10.20.4.3}" -ComputerName $i 2>&1>$null
#$a = Invoke-WmiMethod -class Win32_process -name Create -ArgumentList "CMD.EXE /c winrm set winrm/config/client/auth @{Basic=`"true`"}" -ComputerName $i 2>&1>$null
#$a = Invoke-WmiMethod -class Win32_process -name Create -ArgumentList "CMD.EXE /c winrm set winrm/config/client/auth @{Kerberos=`"true`"}" -ComputerName $i 2>&1>$null
$a = Start-Sleep 10
if ( Test-WSMan $i -EA SilentlyContinue ) {
Write-Verbose "Success enabling PSRemoting on $i with WMI"
$ChangedTargets += $i
} else {
Write-Warning "WMI Failed!"
}
}
return $ChangedTargets
}
function Disable-WinRM {
[cmdletbinding()]
Param([String[]] $Targets)
foreach ($i in $Targets)
{
#Disable WinRM
Write-Verbose "Diabling WinRM on $i"
$a = Invoke-WmiMethod -ComputerName $i -Class Win32_process -Name Create -ArgumentList "CMD.EXE /c winrm delete winrm/config/Listener?Address=*+Transport=HTTP" 2>&1>$null
$a = Invoke-WmiMethod -ComputerName $i -Class Win32_process -Name Create -ArgumentList "CMD.EXE /c sc.exe stop winrm" 2>&1>$null
$a = Invoke-WmiMethod -ComputerName $i -Class Win32_process -Name Create -ArgumentList "CMD.EXE /c sc.exe config winrm start= disabled" 2>&1>$null
}
}
function Get-BetterTasklist {
[cmdletbinding()]
Param([bool] $NoHash = $false)
$TimeGenerated = get-date -format r
$betterPsList = Get-WmiObject -Class Win32_process `
| select -property Name,ProcessID,ParentProcessId,ExecutablePath,CommandLine `
| Foreach {
if ($_.ExecutablePath -ne $null -AND -NOT $NoHash) {
$sha1 = New-Object -TypeName System.Security.Cryptography.SHA1CryptoServiceProvider
$hash = [System.BitConverter]::ToString($sha1.ComputeHash([System.IO.File]::ReadAllBytes($_.ExecutablePath)))
$_ | Add-Member -MemberType NoteProperty SHA_1 $($hash -replace "-","")
} else {
$_ | Add-Member -MemberType NoteProperty SHA_1 $null
}
$_ | Add-Member -MemberType NoteProperty TimeGenerated $TimeGenerated
$_
}
$betterPsList | Select TimeGenerated,Name,ProcessID,ParentProcessId,ExecutablePath,SHA_1,CommandLine
}
function Get-DLLs {
[cmdletbinding()]
Param([bool] $NoHash = $false)
$TimeGenerated = get-date -format r
$results = Get-Process | Select-Object -ExpandProperty Modules -ErrorAction SilentlyContinue | sort FileName -Unique | % {
if ($_.FileName -ne $null -AND -NOT $NoHash) {
$sha1 = New-Object -TypeName System.Security.Cryptography.SHA1CryptoServiceProvider
$hash = [System.BitConverter]::ToString($sha1.ComputeHash([System.IO.File]::ReadAllBytes($_.FileName)))
$_ | Add-Member -MemberType NoteProperty SHA_1 $($hash -replace "-","")
}
else {
$_ | Add-Member -MemberType NoteProperty SHA_1 $null
}
$_ | Add-Member -MemberType NoteProperty TimeGenerated $TimeGenerated
$_
}
$results | select TimeGenerated,ModuleName,FileName,SHA_1,Size,Company,Description,FileVersion,Product,ProductVersion
}
function Get-BetterNetstatTCP {
[cmdletbinding()]
Param([bool] $NoHash = $false)
$TimeGenerated = get-date -format r
# TCP
$data = netstat -nao -p TCP
$betterNetstat = Foreach ($line in $data[4..$data.count])
{
$line = $line -replace '^\s+',''
$line = $line -split '\s+'
$properties = @{
Protocol = $line[0]
LocalAddressIP = ($line[1] -split ":")[0]
LocalAddressPort = ($line[1] -split ":")[1]
ForeignAddressIP = ($line[2] -split ":")[0]
ForeignAddressPort = ($line[2] -split ":")[1]
State = $line[3]
ProcessId = $line[4]
}
$currentLineObj = New-Object -TypeName PSObject -Property $properties
$proc = get-wmiobject -query ('select * from win32_process where ProcessId="{0}"' -f $line[4])
$currentLineObj | Add-Member -MemberType NoteProperty ParentProcessId $proc.ParentProcessId
$currentLineObj | Add-Member -MemberType NoteProperty Name $proc.Caption
$currentLineObj | Add-Member -MemberType NoteProperty ExecutablePath $proc.ExecutablePath
if ($currentLineObj.ExecutablePath -ne $null -AND -NOT $NoHash) {
$sha1 = New-Object -TypeName System.Security.Cryptography.SHA1CryptoServiceProvider
$hash = [System.BitConverter]::ToString($sha1.ComputeHash([System.IO.File]::ReadAllBytes($proc.ExecutablePath)))
$currentLineObj | Add-Member -MemberType NoteProperty SHA_1 $($hash -replace "-","")
}
else {
$currentLineObj | Add-Member -MemberType NoteProperty SHA_1 $null
}
$currentLineObj | Add-Member -MemberType NoteProperty CommandLine $proc.CommandLine
$currentLineObj | Add-Member -MemberType NoteProperty TimeGenerated $TimeGenerated
$currentLineObj
}
$betterNetstat | select TimeGenerated,Protocol,LocalAddressIP,LocalAddressPort,ForeignAddressIP,ForeignAddressPort,State,Name,ProcessId,ParentProcessId,ExecutablePath,SHA_1,CommandLine
}
function Get-BetterNetstatTCPv6 {
[cmdletbinding()]
Param([bool] $NoHash = $false)
$TimeGenerated = get-date -format r
# TCPv6
$data = netstat -nao -p TCPv6
$betterNetstat = Foreach ($line in $data[4..$data.count])
{
$line = $line -replace '^\s+',''
$line = $line -split '\s+'
$properties = @{
Protocol = $line[0]
LocalAddress = $line[1]
ForeignAddress = $line[2]
State = $line[3]
ProcessId = $line[4]
}
$currentLineObj = New-Object -TypeName PSObject -Property $properties
$proc = get-wmiobject -query ('select * from win32_process where ProcessId="{0}"' -f $line[4])
$currentLineObj | Add-Member -MemberType NoteProperty ParentProcessId $proc.ParentProcessId
$currentLineObj | Add-Member -MemberType NoteProperty Name $proc.Caption
$currentLineObj | Add-Member -MemberType NoteProperty ExecutablePath $proc.ExecutablePath
if ($currentLineObj.ExecutablePath -ne $null -AND -NOT $NoHash) {
$sha1 = New-Object -TypeName System.Security.Cryptography.SHA1CryptoServiceProvider
$hash = [System.BitConverter]::ToString($sha1.ComputeHash([System.IO.File]::ReadAllBytes($proc.ExecutablePath)))
$currentLineObj | Add-Member -MemberType NoteProperty SHA_1 $($hash -replace "-","")
}
else {
$currentLineObj | Add-Member -MemberType NoteProperty SHA_1 $null
}
$currentLineObj | Add-Member -MemberType NoteProperty CommandLine $proc.CommandLine
$currentLineObj | Add-Member -MemberType NoteProperty TimeGenerated $TimeGenerated
$currentLineObj
}
$betterNetstat | select TimeGenerated,Protocol,LocalAddress,ForeignAddress,State,Name,ProcessId,ParentProcessId,ExecutablePath,SHA_1,CommandLine
}
function Get-BetterNetstatUDP {
[cmdletbinding()]
Param([bool] $NoHash = $false)
$TimeGenerated = get-date -format r
# Now UDP
$data = netstat -nao -p UDP
$betterNetstat = Foreach ($line in $data[4..$data.count])
{
$line = $line -replace '^\s+',''
$line = $line -split '\s+'
$properties = @{
Protocol = $line[0]
LocalAddressIP = ($line[1] -split ":")[0]
LocalAddressPort = ($line[1] -split ":")[1]
ForeignAddressIP = ($line[2] -split ":")[0]
ForeignAddressPort = ($line[2] -split ":")[1]
#State = $line[3]
ProcessId = $line[3]
}
$currentLineObj = New-Object -TypeName PSObject -Property $properties
$proc = get-wmiobject -query ('select * from win32_process where ProcessId="{0}"' -f $line[3])
$currentLineObj | Add-Member -MemberType NoteProperty ParentProcessId $proc.ParentProcessId
$currentLineObj | Add-Member -MemberType NoteProperty Name $proc.Caption
$currentLineObj | Add-Member -MemberType NoteProperty ExecutablePath $proc.ExecutablePath
if ($currentLineObj.ExecutablePath -ne $null -AND -NOT $NoHash -AND $proc.Caption -ne "dns.exe") {
$sha1 = New-Object -TypeName System.Security.Cryptography.SHA1CryptoServiceProvider
$hash = [System.BitConverter]::ToString($sha1.ComputeHash([System.IO.File]::ReadAllBytes($proc.ExecutablePath)))
$currentLineObj | Add-Member -MemberType NoteProperty SHA_1 $($hash -replace "-","")
}
else {
$currentLineObj | Add-Member -MemberType NoteProperty SHA_1 $null
}
$currentLineObj | Add-Member -MemberType NoteProperty CommandLine $proc.CommandLine
$currentLineObj | Add-Member -MemberType NoteProperty TimeGenerated $TimeGenerated
$currentLineObj
}
$betterNetstat | select TimeGenerated,Protocol,LocalAddressIP,LocalAddressPort,Name,ProcessId,ParentProcessId,ExecutablePath,SHA_1,CommandLine
}
function Get-BetterNetstatUDPv6 {
[cmdletbinding()]
Param([bool] $NoHash = $false)
$TimeGenerated = get-date -format r
# Now UDPv6
$data = netstat -nao -p UDPv6
$betterNetstat = Foreach ($line in $data[4..$data.count])
{
$line = $line -replace '^\s+',''
$line = $line -split '\s+'
$properties = @{
Protocol = $line[0]
LocalAddress = $line[1]
ForeignAddress = $line[2]
ProcessId = $line[3]
}
$currentLineObj = New-Object -TypeName PSObject -Property $properties
$proc = get-wmiobject -query ('select * from win32_process where ProcessId="{0}"' -f $line[3])
$currentLineObj | Add-Member -MemberType NoteProperty ParentProcessId $proc.ParentProcessId
$currentLineObj | Add-Member -MemberType NoteProperty Name $proc.Caption
$currentLineObj | Add-Member -MemberType NoteProperty ExecutablePath $proc.ExecutablePath
if ($currentLineObj.ExecutablePath -ne $null -AND -NOT $NoHash) {
$sha1 = New-Object -TypeName System.Security.Cryptography.SHA1CryptoServiceProvider
$hash = [System.BitConverter]::ToString($sha1.ComputeHash([System.IO.File]::ReadAllBytes($proc.ExecutablePath)))
$currentLineObj | Add-Member -MemberType NoteProperty SHA_1 $($hash -replace "-","")
}
else {
$currentLineObj | Add-Member -MemberType NoteProperty SHA_1 $null
}
$currentLineObj | Add-Member -MemberType NoteProperty CommandLine $proc.CommandLine
$currentLineObj | Add-Member -MemberType NoteProperty TimeGenerated $TimeGenerated
$currentLineObj
}
$betterNetstat | select TimeGenerated,Protocol,LocalAddress,Name,ProcessId,ParentProcessId,ExecutablePath,SHA_1,CommandLine
}
function Invoke-Autorunsc {
[cmdletbinding()]
Param([String] $url)
# python -m SimpleHTTPServer 8080
#$urla = $url + "autorunsc.exe"
$path = "C:\blue_temp\autorunsc.exe"
#(New-Object Net.WebClient).DownloadFile($urla, $path)
$results = & $path -accepteula -h -c -nobanner -a * -s -t | ConvertFrom-Csv
Remove-Item $path
Remove-Item C:\blue_temp
$results
}
# Check for
function Get-AuditOptions {
$regConfig = @"
regKey,name
"HKLM:\SYSTEM\CurrentControlSet\Control\Lsa","scenoapplylegacyauditpolicy"
"HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\Audit","ProcessCreationIncludeCmdLine_Enabled"
"HKLM:\Software\Policies\Microsoft\Windows\PowerShell\Transcription","EnableTranscripting"
"HKLM:\Software\Policies\Microsoft\Windows\PowerShell\Transcription","OutputDirectory"
"HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging","EnableScriptBlockLogging"
"HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging","EnableModuleLogging"
"HKLM:\SOFTWARE\Policies\Microsoft\Windows\EventLog\EventForwarding\SubscriptionManager",1
"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest","UseLogonCredential"
"HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults","Allow*"
"HKLM:\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation","Allow*"
"@
$regConfig | ConvertFrom-Csv | ForEach-Object {
if (-Not (Test-Path $_.regKey)) {
# Registry path does not exist -> document DNE
#Write-Warning "Path $($_.regKey) does not exist"
New-Object PSObject -Property @{regKey = $_.regKey; name = "DNE"; value = "DNE"}
}
else {
if ((Get-ItemProperty $_.regKey | Select-Object -Property $_.name).$_.name -ne $null) {
# Registry key exists. Document value
#Write-Warning "Key $($_.regKey) if $(Get-ItemProperty $_.regKey | Select-Object -Property $_.name)"
#Write-Warning "Property $($_.name) exists. Documenting Value: $(Get-ItemProperty $_.regKey | Select-Object -ExpandProperty $_.name)"
# Handle Cases where SubscriptionManager value already exists.
if ($_.regKey -like "*SubscriptionManager*") {
#Write-Warning "RegKey is Like SubscriptionManager"
#Write-Warning "Property = $($_.name)"
$wecNum = 1
# Backup each currently configured SubscriptionManager values.
while ( (Get-ItemProperty $_.regKey | Select-Object -ExpandProperty $([string]$wecNum) -ErrorAction SilentlyContinue) ) {
#Write-Warning "RegKey with property = $wecNum exists"
New-Object PSObject -Property @{regKey = $_.regKey; name = $wecNum; value = $(Get-ItemProperty $_.regKey | Select-Object -ExpandProperty $([string]$wecNum))}
#Write-Warning "Incrementing wecNum"
$wecNum++
}
}
# Backup all non-SubscriptionManager values to array.
else {
New-Object PSObject -Property @{regKey = $_.regKey; name = $_.name; value = $(Get-ItemProperty $_.regKey | Select-Object -ExpandProperty $_.name)}
}
}
else {
# Registry key does not exist. Document DNE
#Write-Warning "Property $($_.name) DNE. Documenting Null"
New-Object PSObject -Property @{regKey = $_.regKey; name = $_.name; value = "DNE"}
}
}
}
}
| 43.105563 | 236 | 0.733958 |
0f0d3d83500c627230062ad453170666cf0f8653 | 1,530 | cpp | C++ | demos/multiplatform/file_io/source/main.cpp | aakashvarshney23/SJSU-CmpE-146 | 9d71d9897faac435a6adafc8f3158d373dfe8b20 | [
"Apache-2.0"
] | 1 | 2019-08-02T04:32:53.000Z | 2019-08-02T04:32:53.000Z | demos/multiplatform/file_io/source/main.cpp | aakashvarshney23/SJSU-CmpE-146 | 9d71d9897faac435a6adafc8f3158d373dfe8b20 | [
"Apache-2.0"
] | null | null | null | demos/multiplatform/file_io/source/main.cpp | aakashvarshney23/SJSU-CmpE-146 | 9d71d9897faac435a6adafc8f3158d373dfe8b20 | [
"Apache-2.0"
] | null | null | null | #include <cstdint>
#include <cstring>
#include <project_config.hpp>
#include "third_party/fatfs/source/ff.h"
#include "utility/log.hpp"
FRESULT ScanFiles(char * start_path, size_t path_length)
{
static FILINFO fno;
FRESULT res;
DIR dir;
res = f_opendir(&dir, start_path); /* Open the directory */
if (res == FR_OK)
{
size_t i;
while (true)
{
res = f_readdir(&dir, &fno); /* Read a directory item */
// Break on error or end of dir
if (res != FR_OK || fno.fname[0] == 0)
{
break;
}
// Check if file is a directory
if (fno.fattrib & AM_DIR)
{
i = strlen(start_path);
snprintf(&start_path[i], path_length - i, "/%s", fno.fname);
res = ScanFiles(start_path, path_length); /* Enter the directory */
if (res != FR_OK)
{
break;
}
start_path[i] = 0;
}
// It is a file.
else
{
printf("%s/%s\n", start_path, fno.fname);
}
}
f_closedir(&dir);
}
return res;
}
int main()
{
LOG_INFO("Starting FileIO Application...");
// Read a text file and display it
/* Register work area to the default drive */
LOG_INFO("Mounting filesystem...");
FATFS fat_fs;
f_mount(&fat_fs, "", 0);
LOG_INFO("Filesystem mounted!");
LOG_INFO("Scanning files in SD card...");
char path[1024] = "/";
ScanFiles(path, sizeof(path));
LOG_INFO("SD card file scan complete!");
LOG_INFO("FileIO Application Complete!");
sjsu::Halt();
return 0;
}
| 22.173913 | 75 | 0.579085 |
bb3724ef9967403c8a53d19ff2933aabe36804fb | 880 | dart | Dart | object_orientation/test_order.dart | steniooliv/dart_course | 592d1a9eb1979db1a8b2b0518cdaa86f28fc3c78 | [
"MIT"
] | null | null | null | object_orientation/test_order.dart | steniooliv/dart_course | 592d1a9eb1979db1a8b2b0518cdaa86f28fc3c78 | [
"MIT"
] | null | null | null | object_orientation/test_order.dart | steniooliv/dart_course | 592d1a9eb1979db1a8b2b0518cdaa86f28fc3c78 | [
"MIT"
] | null | null | null | import 'order.dart';
import 'consumer.dart';
import 'order_item.dart';
import 'product.dart';
main() {
var venda = Venda(
cliente: Cliente(
nome: "Stenio Oliveira",
cpf: "123.456.789-00",
),
itens: <VendaItem>[
VendaItem(
quantidade: 10,
produto: Produto(
codigo: 1, nome: "Caneta Bic", preco: 5.89, desconto: 0.5)),
VendaItem(
quantidade: 10,
produto: Produto(
codigo: 2, nome: 'Caneca Pilot', preco: 3.89, desconto: 0.5)),
VendaItem(
quantidade: 100,
produto: Produto(
codigo: 3, nome: "Caderno Tilibra", preco: 8.89, desconto: 0.5)),
],
);
print("O valor total da venda é ${venda.valorTotal}");
print("O nome do primeiro produto é ${venda.itens[0].produto.nome}");
print("O cpf do cliente é ${venda.cliente.cpf}");
}
| 27.5 | 79 | 0.564773 |
f04b25d10196843175ed158d8658c6dd85f4722b | 2,009 | py | Python | src/autodoc/python/rst/base/block_quote.py | LudditeLabs/autodoc-tool | b4ae7e3b61907e7e9c3a1b534fce055e5860ffab | [
"Apache-2.0"
] | null | null | null | src/autodoc/python/rst/base/block_quote.py | LudditeLabs/autodoc-tool | b4ae7e3b61907e7e9c3a1b534fce055e5860ffab | [
"Apache-2.0"
] | null | null | null | src/autodoc/python/rst/base/block_quote.py | LudditeLabs/autodoc-tool | b4ae7e3b61907e7e9c3a1b534fce055e5860ffab | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Luddite Labs Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Block Quotes
------------
Line blocks are groups of lines beginning with vertical bar ("|") prefixes.
Each vertical bar prefix indicates a new line, so line breaks are preserved.
Initial indents are also significant, resulting in a nested structure.
Inline markup is supported. Continuation lines are wrapped portions
of long lines; they begin with a space in place of the vertical bar.
The left edge of a continuation line must be indented, but need not be aligned
with the left edge of the text above it. A line block ends with a blank line.
Syntax diagram:
+------------------------------+
| (current level of |
| indentation) |
+------------------------------+
+---------------------------+
| block quote |
| (body elements)+ |
| |
| -- attribution text |
| (optional) |
+---------------------------+
http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#block-quotes
"""
class BlockQuoteMixin:
def visit_block_quote(self, node):
self.open_block(indent=self.options['indent'], top_margin=1,
bottom_margin=1)
def depart_block_quote(self, node):
self.close_block()
def visit_attribution(self, node):
self.block.add_text(u'-- ')
def depart_attribution(self, node):
pass
| 34.637931 | 79 | 0.621702 |
04aea6030ce489e5826fc558ffaeb152746ef3ea | 4,877 | java | Java | src/com/byronkatz/reap/general/ValueEnum.java | byronka/reap | e0e3309105bb4f3573e46eccb1d61ff8738f9ba7 | [
"MIT"
] | null | null | null | src/com/byronkatz/reap/general/ValueEnum.java | byronka/reap | e0e3309105bb4f3573e46eccb1d61ff8738f9ba7 | [
"MIT"
] | null | null | null | src/com/byronkatz/reap/general/ValueEnum.java | byronka/reap | e0e3309105bb4f3573e46eccb1d61ff8738f9ba7 | [
"MIT"
] | null | null | null | package com.byronkatz.reap.general;
public enum ValueEnum {
ACCUM_INTEREST ("accumulated interest paid", ValueType.CURRENCY, false, true),
ATCF ("After Tax Cash Flow", ValueType.CURRENCY, false, true),
ATCF_ACCUMULATOR ("After Tax Cash Flow Accumulator", ValueType.CURRENCY, false, true),
ATCF_NPV ("After Tax Cash Flow NPV", ValueType.CURRENCY, false, true),
ATER ("After Tax Equity Reversion", ValueType.CURRENCY, false, true),
ATER_PV ("Present Value ATER", ValueType.CURRENCY, false, true),
BROKER_CUT_OF_SALE ("Broker cut at sale", ValueType.CURRENCY, false, true),
BUILDING_VALUE("building value", ValueType.CURRENCY, true, false),
CITY("city", ValueType.STRING, true, false),
CLOSING_COSTS("closing costs", ValueType.CURRENCY, true, false),
CURRENT_AMOUNT_OUTSTANDING ("current amount outstanding", ValueType.CURRENCY, false, true),
DOWN_PAYMENT("down payment", ValueType.CURRENCY, true, false),
ESTIMATED_RENT_PAYMENTS("estimated rent payments", ValueType.CURRENCY, true, false),
FIX_UP_COSTS("fix up costs", ValueType.CURRENCY, true, false),
GENERAL_SALE_EXPENSES("general sale expenses", ValueType.CURRENCY, true, false),
INFLATION_RATE("inflation rate", ValueType.PERCENTAGE, true, false),
INITIAL_YEARLY_GENERAL_EXPENSES("initial yearly general expenses", ValueType.CURRENCY, true, false),
LOCAL_MUNICIPAL_FEES("local municipal fees", ValueType.CURRENCY, true, false),
MARGINAL_TAX_RATE("marginal tax rate", ValueType.PERCENTAGE, true, false),
MODIFIED_INTERNAL_RATE_OF_RETURN("modified internal rate of return", ValueType.PERCENTAGE, false, true),
MONTHLY_MORTGAGE_PAYMENT ("monthly mortgage payment", ValueType.CURRENCY, false, false),
NET_CASH_OUT_VALUE ("Net cash-out value", ValueType.CURRENCY, false, true),
NPV ("Net present value", ValueType.CURRENCY, false, true),
NUMBER_OF_COMPOUNDING_PERIODS("number of compounding periods", ValueType.INTEGER, true, false),
PRIVATE_MORTGAGE_INSURANCE ("Private mortgage insurance", ValueType.CURRENCY, true, false),
PROJECTED_HOME_VALUE ("projected home value at sale time", ValueType.CURRENCY, false, true),
PROPERTY_TAX("property tax", ValueType.CURRENCY, true, false),
REAL_ESTATE_APPRECIATION_RATE("real estate appreciation rate", ValueType.PERCENTAGE, true, false),
REQUIRED_RATE_OF_RETURN("required rate of return", ValueType.PERCENTAGE, true, false),
SELLING_BROKER_RATE("selling broker rate", ValueType.PERCENTAGE, true, false),
SELLING_EXPENSES ("inflation adjusted selling expenses", ValueType.CURRENCY, false, true),
STATE_INITIALS("State", ValueType.STRING, true, false),
STREET_ADDRESS("street address", ValueType.STRING, true, false),
TAXABLE_INCOME ("yearly taxable income", ValueType.CURRENCY, false, true),
TAXES_DUE_AT_SALE ("taxes due at sale", ValueType.CURRENCY, false, true),
TOTAL_PURCHASE_VALUE ("total purchase value", ValueType.CURRENCY, true, false),
VACANCY_AND_CREDIT_LOSS_RATE("vacancy and credit loss rate", ValueType.PERCENTAGE, true, false),
YEARLY_ACCUMULATED_DEPRECIATION ("yearly accumulated depreciation", ValueType.CURRENCY, false, true),
YEARLY_GENERAL_EXPENSES ("yearly general expenses", ValueType.CURRENCY, false, true),
YEARLY_HOME_INSURANCE("yearly home insurance", ValueType.CURRENCY, true, false),
YEARLY_INCOME ("yearly rent income", ValueType.CURRENCY, false, true),
YEARLY_INTEREST_PAID ("yearly interest paid", ValueType.CURRENCY, false, true),
YEARLY_INTEREST_RATE("yearly interest rate", ValueType.PERCENTAGE, true, false),
YEARLY_MORTGAGE_PAYMENT ("yearly mortgage payment", ValueType.CURRENCY, false, false),
YEARLY_PRIVATE_MORTGAGE_INSURANCE ("yearly private mortgage insurance", ValueType.CURRENCY, false, true),
YEARLY_PRINCIPAL_PAID ("yearly principal paid", ValueType.CURRENCY, false, true),
YEARLY_PROPERTY_TAX ("yearly property tax", ValueType.CURRENCY, false, true);
private ValueEnum(String valueText, ValueType valueType,
Boolean isSavedToDatabase, Boolean isVaryingByYear) {
this.valueText = valueText;
this.valueType = valueType;
this.isSavedToDatabase = isSavedToDatabase;
this.isVaryingByYear = isVaryingByYear;
}
public String toString() {
return valueText;
}
public ValueType getType() {
return valueType;
}
public Boolean isSavedToDatabase() {
return isSavedToDatabase;
}
public void setIsSavedToDatabase(Boolean isSavedToDatabase) {
this.isSavedToDatabase = isSavedToDatabase;
}
public Boolean isVaryingByYear() {
return isVaryingByYear;
}
private String valueText;
private ValueType valueType;
private Boolean isSavedToDatabase;
private Boolean isVaryingByYear;
public enum ValueType {
PERCENTAGE,
CURRENCY,
INTEGER,
STRING
}
}
| 51.336842 | 108 | 0.752102 |
e8a7b7fe757885609316783beea0e5fc3dcf1896 | 1,261 | hpp | C++ | src/Werk/Threading/Watchdog.hpp | mish24/werk | 2f8822842fb8f68a4402775d1d3b41021b5a9945 | [
"MIT"
] | null | null | null | src/Werk/Threading/Watchdog.hpp | mish24/werk | 2f8822842fb8f68a4402775d1d3b41021b5a9945 | [
"MIT"
] | null | null | null | src/Werk/Threading/Watchdog.hpp | mish24/werk | 2f8822842fb8f68a4402775d1d3b41021b5a9945 | [
"MIT"
] | null | null | null | #pragma once
#include <cassert>
#include "Werk/OS/Time.hpp"
#include "Werk/Utility/Action.hpp"
#include "Werk/Utility/Latch.hpp"
namespace Werk {
class Watchdog : public Action {
private:
const Clock* _clock;
uint64_t _interval;
uint64_t _allowedMisses;
Action* _action;
uint64_t _lastTime = 0;
uint64_t _misses = 0;
Latch<volatile bool> _latch;
public:
Watchdog(const std::string& name, const Clock* clock, Action* action,
uint64_t interval, uint64_t allowedMisses=0) :
Action(name), _clock(clock), _interval(interval), _allowedMisses(allowedMisses),
_action(action) {
assert(nullptr != action);
}
uint64_t interval() const { return _interval; }
uint64_t allowedMisses() const { return _allowedMisses; }
Action* action() { return _action; }
bool latch() const { return _latch.value(); }
void reset() { _latch.reset(); }
void execute() override {
uint64_t time = _clock->time();
if(_latch.value()) {
_latch.set();
_lastTime = time;
_misses = 0;
return;
}
//otherwise if flag is not set, is interval passed?
if(time > _lastTime + _interval) {
_misses += 1;
//only execute the action once
if(_misses == _allowedMisses + 1) {
_action->execute();
}
}
}
};
} | 23.792453 | 82 | 0.667724 |
80743380f3b4843adea797b92fa98d69a7271f95 | 6,307 | java | Java | src/main/java/es/ubu/lsi/ubumonitor/view/chart/logs/Scatter.java | yjx0003/UBUGrades | 79af016d9329a30c4f404b8cbd27b88b389a9d21 | [
"MIT"
] | 17 | 2019-05-23T15:17:04.000Z | 2022-03-03T13:29:17.000Z | src/main/java/es/ubu/lsi/ubumonitor/view/chart/logs/Scatter.java | yjx0003/UBUMonitor | 1496acfe117cb0c9aa500b0f72a2a2cc2a98ff32 | [
"MIT"
] | 102 | 2019-02-14T23:42:34.000Z | 2021-12-10T09:30:56.000Z | src/main/java/es/ubu/lsi/ubumonitor/view/chart/logs/Scatter.java | yjx0003/UBUGrades | 79af016d9329a30c4f404b8cbd27b88b389a9d21 | [
"MIT"
] | 6 | 2019-06-18T00:32:30.000Z | 2021-01-13T15:16:38.000Z | package es.ubu.lsi.ubumonitor.view.chart.logs;
import java.io.IOException;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.csv.CSVPrinter;
import es.ubu.lsi.ubumonitor.controllers.MainController;
import es.ubu.lsi.ubumonitor.model.EnrolledUser;
import es.ubu.lsi.ubumonitor.model.LogLine;
import es.ubu.lsi.ubumonitor.model.datasets.DataSet;
import es.ubu.lsi.ubumonitor.model.log.GroupByAbstract;
import es.ubu.lsi.ubumonitor.model.log.TypeTimes;
import es.ubu.lsi.ubumonitor.util.JSArray;
import es.ubu.lsi.ubumonitor.util.JSObject;
import es.ubu.lsi.ubumonitor.util.ManageDuplicate;
import es.ubu.lsi.ubumonitor.view.chart.ChartType;
import es.ubu.lsi.ubumonitor.view.chart.Plotly;
public class Scatter extends PlotlyLog {
public Scatter(MainController mainController) {
super(mainController, ChartType.SCATTER);
useLegend = true;
useRangeDate = true;
}
@Override
public GroupByAbstract<?> getGroupBy() {
return actualCourse.getLogStats()
.getByType(TypeTimes.DAY);
}
@Override
public <E> JSArray createData(List<E> typeLogs, DataSet<E> dataSet, List<EnrolledUser> selectedUsers,
LocalDate dateStart, LocalDate dateEnd, GroupByAbstract<?> groupBy) {
JSArray data = new JSArray();
Map<EnrolledUser, Map<E, List<LogLine>>> map = dataSet.getUserLogs(groupBy, selectedUsers, typeLogs, dateStart,
dateEnd);
for (E typeLog : typeLogs) {
JSArray x = new JSArray();
JSArray y = new JSArray();
JSArray userids = new JSArray();
ManageDuplicate manageDuplicate = new ManageDuplicate();
for (EnrolledUser user : selectedUsers) {
String userFullName = manageDuplicate.getValue(user.getFullName());
List<LogLine> logLines = map.get(user)
.get(typeLog);
for (LogLine logLine : logLines) {
y.addWithQuote(userFullName);
x.addWithQuote(logLine.getTime()
.toLocalDateTime());
userids.add(user.getId());
}
}
JSObject trace = createTrace(dataSet.translate(typeLog), x, y);
trace.put("userids", userids);
data.add(trace);
}
return data;
}
@Override
public <E> JSObject createLayout(List<E> typeLogs, DataSet<E> dataSet, LocalDate dateStart, LocalDate dateEnd,
GroupByAbstract<?> groupBy) {
JSObject layout = new JSObject();
JSObject xaxis = new JSObject();
JSArray range = new JSArray();
range.addWithQuote(dateStart);
range.addWithQuote(dateEnd);
Plotly.defaultAxisValues(xaxis, null, null);
xaxis.put("type", "'date'");
xaxis.put("range", range);
JSObject yaxis = new JSObject();
Plotly.defaultAxisValues(yaxis, null, null);
yaxis.put("autorange", "'reversed'");
yaxis.put("type", "'category'");
layout.put("xaxis", xaxis);
layout.put("yaxis", yaxis);
layout.put("hovermode", "'closest'");
return layout;
}
private JSObject createTrace(String name, JSArray x, JSArray y) {
JSObject trace = new JSObject();
JSObject marker = new JSObject();
trace.putWithQuote("name", name);
trace.put("type", "'scatter'");
trace.put("mode", "'markers'");
trace.put("x", x);
trace.put("y", y);
trace.put("marker", marker);
trace.put("hovertemplate", "'<b>%{data.name}<br>%{y}: </b>%{x}<extra></extra>'");
marker.put("color", rgb(name));
return trace;
}
@Override
protected <E> void exportCSV(CSVPrinter printer, DataSet<E> dataSet, List<E> typeLogs) throws IOException {
LocalDate dateStart = datePickerStart.getValue();
LocalDate dateEnd = datePickerEnd.getValue();
GroupByAbstract<?> groupBy = actualCourse.getLogStats()
.getByType(TypeTimes.DAY);
List<?> rangeDates = groupBy.getRange(dateStart, dateEnd);
List<EnrolledUser> enrolledUsers = getSelectedEnrolledUser();
Map<EnrolledUser, Map<E, List<Integer>>> userCounts = dataSet.getUserCounts(groupBy, enrolledUsers, typeLogs,
dateStart, dateEnd);
for (EnrolledUser selectedUser : enrolledUsers) {
Map<E, List<Integer>> types = userCounts.get(selectedUser);
List<Integer> results = new ArrayList<>();
for (int j = 0; j < rangeDates.size(); j++) {
int result = 0;
for (E type : typeLogs) {
List<Integer> times = types.get(type);
result += times.get(j);
}
results.add(result);
}
printer.print(selectedUser.getId());
printer.print(selectedUser.getFullName());
printer.printRecord(results);
}
}
@Override
protected String[] getCSVHeader() {
LocalDate dateStart = datePickerStart.getValue();
LocalDate dateEnd = datePickerEnd.getValue();
GroupByAbstract<?> groupBy = actualCourse.getLogStats()
.getByType(TypeTimes.DAY);
List<String> range = groupBy.getRangeString(dateStart, dateEnd);
range.add(0, "userid");
range.add(1, "fullname");
return range.toArray(new String[0]);
}
@Override
protected <E> void exportCSVDesglosed(CSVPrinter printer, DataSet<E> dataSet, List<E> typeLogs) throws IOException {
LocalDate dateStart = datePickerStart.getValue();
LocalDate dateEnd = datePickerEnd.getValue();
GroupByAbstract<?> groupBy = actualCourse.getLogStats()
.getByType(TypeTimes.DAY);
List<EnrolledUser> enrolledUsers = getSelectedEnrolledUser();
Map<EnrolledUser, Map<E, List<Integer>>> userCounts = dataSet.getUserCounts(groupBy, enrolledUsers, typeLogs,
dateStart, dateEnd);
for (EnrolledUser selectedUser : enrolledUsers) {
Map<E, List<Integer>> types = userCounts.get(selectedUser);
for (E type : typeLogs) {
List<Integer> times = types.get(type);
printer.print(selectedUser.getId());
printer.print(selectedUser.getFullName());
if (hasId()) {
printer.print(type.hashCode());
}
printer.print(type);
printer.printRecord(times);
}
}
}
@Override
protected String[] getCSVDesglosedHeader() {
LocalDate dateStart = datePickerStart.getValue();
LocalDate dateEnd = datePickerEnd.getValue();
GroupByAbstract<?> groupBy = actualCourse.getLogStats()
.getByType(TypeTimes.DAY);
List<String> list = new ArrayList<>();
list.add("userid");
list.add("fullname");
String selectedTab = tabPaneSelection.getSelectionModel()
.getSelectedItem()
.getText();
if (hasId()) {
list.add(selectedTab + "_id");
}
list.add(selectedTab);
list.addAll(groupBy.getRangeString(dateStart, dateEnd));
return list.toArray(new String[0]);
}
}
| 31.222772 | 117 | 0.711749 |
95bb3bad0cd4190cba1f7e1e1c7c411eb3eca10f | 4,098 | asm | Assembly | c2000/C2000Ware_1_00_06_00/libraries/dsp/FixedPoint/c28/source/CFFT32_mag.asm | ramok/Themis_ForHPSDR | d0f323a843ac0a488ef816ccb7c828032855a40a | [
"Unlicense"
] | null | null | null | c2000/C2000Ware_1_00_06_00/libraries/dsp/FixedPoint/c28/source/CFFT32_mag.asm | ramok/Themis_ForHPSDR | d0f323a843ac0a488ef816ccb7c828032855a40a | [
"Unlicense"
] | null | null | null | c2000/C2000Ware_1_00_06_00/libraries/dsp/FixedPoint/c28/source/CFFT32_mag.asm | ramok/Themis_ForHPSDR | d0f323a843ac0a488ef816ccb7c828032855a40a | [
"Unlicense"
] | 1 | 2021-07-21T08:10:37.000Z | 2021-07-21T08:10:37.000Z | ;;#############################################################################
;;! \file source/CFFT32_mag.asm
;;!
;;! \brief Magnitude function for the complex FFT
;;!
;;! \date Nov 2, 2010
;;!
;;
;; Group: C2000
;; Target Family: C28x
;;
;;#############################################################################
;;$TI Release: C28x Fixed Point DSP Library v1.20.00.00 $
;;$Release Date: Thu Oct 18 15:57:22 CDT 2018 $
;;$Copyright: Copyright (C) 2014-2018 Texas Instruments Incorporated -
;; http://www.ti.com/ ALL RIGHTS RESERVED $
;;#############################################################################
;;
;;
;;*****************************************************************************
;; includes
;;*****************************************************************************
;;
;;*****************************************************************************
;; globals
;;*****************************************************************************
; Module definition for external reference
.def _CFFT32_mag
;; Module Structure
;; typedef struct { <--------- XAR4
;; int32_t *ipcbptr; /* +0 Pointer to input buffer */
;; int32_t *tfptr /* +2 Pointer to twiddle factors */
;; int16_t size; /* +4 Size of the FFT */
;; int16_t nrstage; /* +5 Number of FFT stages (log2(size)) */
;; int16_t *magptr; /* +6 Pointer to the magnitude buffer */
;; int16_t *winptr; /* +8 Pointer to the sampling window */
;; int16_t peakmag; /* +10 Peak magnitude value */
;; int16_t peakfrq; /* +11 Peak Frequency */
;; int16_t ratio; /* +12 Twiddles Skip factor */
;; void (*init)(void); /* +14 Pointer to the initialization () */
;; void (*izero)(void *); /* +16 Pointer to the zero-out imaginary () */
;; void (*calc)(void *); /* +18 Pointer to the calculation () */
;; void (*mag)(void *); /* +20 Pointer to the magnitude () */
;; void (*win)(void *); /* +22 Pointer to the windowing () */
;;}CFFT32;
;;=============================================================================
;; Routine Type : C Callable
;; Description :
;; void CFFT32_mag(CFFT32_Handle)
;; This function computes the magnitude square of complex FFT outputs. Allows in-place
;; and off-place storage of the magnitude square results.
;;
_CFFT32_mag:
SETC SXM
MOVL XAR7,*XAR4 ; XAR5=ipcbptr
MOVL XAR6,*+XAR4[6] ; XAR6=magptr
MOVZ AR0,*+XAR4[4] ; AR7=size
SUBB XAR0,#1 ; AR0=size-1
MAG_LP:
ZAPA ; ACC=0, P=0
QMACL P,*XAR7,*XAR7++ ; Q15*Q15=Q30
QMACL P,*XAR7,*XAR7++ ; Q15*Q15+Q30=Q30
ADDL ACC,P
MOVL *XAR6++,ACC ; Store in Q30
BANZ MAG_LP,AR0--
; Find maximum magnitude
ADDB XAR4,#4 ; XAR4->size
MOVB ACC,#0
MOVL *+XAR4[6],ACC ; peakmag=0
MOVZ AR0,*XAR4 ; AR0=size
MOVL XAR5,*+XAR4[2] ; XAR5=magptr
MOV ACC,#0
SUBB XAR0,#1 ; AR0=size-1
;Find the maximum value among the FFT Magnitudes
RPT AR0
|| MAXL ACC,*XAR5++
MOVL *+XAR4[6],ACC ; update peak magnitude
MOVB XAR7,#0 ; XAR7=0
MOVL XAR5,*+XAR4[2] ; XAR5=magptr
;Find the spectral bin corresponding to maximum magnitude.
NEXT_BIN:
MAXL ACC,*XAR5++
NOP *XAR7++
SBF NEXT_BIN,NEQ
NOP *--XAR7
ADDB XAR4,#8 ; XAR4->peakfrq
MOV *XAR4,AR7 ; update peak magnitude
LRETR
;;#############################################################################
;; End of File
;;#############################################################################
| 39.786408 | 86 | 0.403123 |
ebb36c16076658e4a7ef70cb081873dd8d34ed8a | 129,472 | asm | Assembly | reports/13_match_rune_1.exp1.asm | arnaudroger/re2j-benchmark | ecfb2d6975948a1fbb53ccf101b285655b850058 | [
"MIT"
] | null | null | null | reports/13_match_rune_1.exp1.asm | arnaudroger/re2j-benchmark | ecfb2d6975948a1fbb53ccf101b285655b850058 | [
"MIT"
] | null | null | null | reports/13_match_rune_1.exp1.asm | arnaudroger/re2j-benchmark | ecfb2d6975948a1fbb53ccf101b285655b850058 | [
"MIT"
] | null | null | null | # JMH version: 1.19
# VM version: JDK 1.8.0_131, VM 25.131-b11
# VM invoker: /usr/lib/jvm/java-8-oracle/jre/bin/java
# VM options: <none>
# Warmup: 20 iterations, 1 s each
# Measurement: 20 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: com.github.arnaudroger.re2j.Re2jFindRegex.testExp1
# Run progress: 0.00% complete, ETA 00:00:40
# Fork: 1 of 1
# Preparing profilers: LinuxPerfAsmProfiler
# Profilers consume stdout and stderr from target VM, use -v EXTRA to copy to console
# Warmup Iteration 1: 11265.578 ops/s
# Warmup Iteration 2: 21332.081 ops/s
# Warmup Iteration 3: 21348.135 ops/s
# Warmup Iteration 4: 21340.992 ops/s
# Warmup Iteration 5: 21401.548 ops/s
# Warmup Iteration 6: 21412.385 ops/s
# Warmup Iteration 7: 21243.209 ops/s
# Warmup Iteration 8: 21570.634 ops/s
# Warmup Iteration 9: 21584.552 ops/s
# Warmup Iteration 10: 21599.147 ops/s
# Warmup Iteration 11: 21592.008 ops/s
# Warmup Iteration 12: 21596.412 ops/s
# Warmup Iteration 13: 19572.573 ops/s
# Warmup Iteration 14: 21594.987 ops/s
# Warmup Iteration 15: 21543.262 ops/s
# Warmup Iteration 16: 21578.845 ops/s
# Warmup Iteration 17: 21428.194 ops/s
# Warmup Iteration 18: 21424.439 ops/s
# Warmup Iteration 19: 21426.859 ops/s
# Warmup Iteration 20: 21426.540 ops/s
Iteration 1: 21425.027 ops/s
Iteration 2: 21408.134 ops/s
Iteration 3: 20911.970 ops/s
Iteration 4: 19037.730 ops/s
Iteration 5: 20751.165 ops/s
Iteration 6: 20749.039 ops/s
Iteration 7: 20713.305 ops/s
Iteration 8: 20744.907 ops/s
Iteration 9: 20751.214 ops/s
Iteration 10: 20747.468 ops/s
Iteration 11: 21152.379 ops/s
Iteration 12: 21406.756 ops/s
Iteration 13: 21559.376 ops/s
Iteration 14: 21569.287 ops/s
Iteration 15: 21577.605 ops/s
Iteration 16: 21539.209 ops/s
Iteration 17: 21563.067 ops/s
Iteration 18: 21553.226 ops/s
Iteration 19: 21517.126 ops/s
Iteration 20: 21568.772 ops/s
# Processing profiler results: LinuxPerfAsmProfiler
Result "com.github.arnaudroger.re2j.Re2jFindRegex.testExp1":
21112.338 ±(99.9%) 527.635 ops/s [Average]
(min, avg, max) = (19037.730, 21112.338, 21577.605), stdev = 607.626
CI (99.9%): [20584.703, 21639.973] (assumes normal distribution)
Secondary result "com.github.arnaudroger.re2j.Re2jFindRegex.testExp1:·asm":
PrintAssembly processed: 195132 total address lines.
Perf output processed (skipped 23.364 seconds):
Column 1: cycles (20645 events)
Column 2: instructions (20648 events)
Hottest code regions (>10.00% "cycles" events):
....[Hottest Region 1]..............................................................................
C2, level 4, com.google.re2j.Machine::step, version 500 (797 bytes)
0x00007fb44122255f: jae 0x00007fb441222d91
0x00007fb441222565: mov %rdx,%r10
0x00007fb441222568: mov %rcx,%r9
0x00007fb44122256b: shr $0x3,%r9
0x00007fb44122256f: mov %r9d,(%rdx)
0x00007fb441222572: shr $0x9,%r10
0x00007fb441222576: movabs $0x7fb451f2f000,%r8
0x00007fb441222580: mov %r12b,(%r8,%r10,1) ;*synchronization entry
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.17% 0.07% 0x00007fb441222584: mov 0x30(%rsp),%rax
0.07% 0.12% 0x00007fb441222589: mov 0x9c(%rsp),%r13d
0.10% 0.10% 0x00007fb441222591: mov 0x94(%rsp),%r10d ;*aload
; - com.google.re2j.Machine::step@207 (line 315)
2.10% 2.76% ↗ 0x00007fb441222599: inc %r10d ;*iinc
│ ; - com.google.re2j.Machine::step@218 (line 282)
0.16% 0.29% │ 0x00007fb44122259c: cmp %r13d,%r10d
│ 0x00007fb44122259f: jge 0x00007fb441222a33 ;*aload_0
│ ; - com.google.re2j.Machine::step@25 (line 285)
0.27% 0.24% │ 0x00007fb4412225a5: mov 0x8(%rsp),%r8
0.40% 0.32% │ 0x00007fb4412225aa: movzbl 0x11(%r8),%r8d ;*getfield captures
│ ; - com.google.re2j.Machine::step@26 (line 285)
3.35% 3.22% │ 0x00007fb4412225af: test %r8d,%r8d
│ 0x00007fb4412225b2: jne 0x00007fb441222b95 ;*ifne
│ ; - com.google.re2j.Machine::step@29 (line 285)
0.76% 0.76% │ 0x00007fb4412225b8: mov 0x20(%rax),%ebp ;*getfield denseThreadsInstructions
│ ; - com.google.re2j.Machine::step@82 (line 295)
0.45% 0.48% │ 0x00007fb4412225bb: mov 0xc(%r12,%rbp,8),%r8d ; implicit exception: dispatches to 0x00007fb4412236dd
0.78% 0.81% │ 0x00007fb4412225c0: cmp %r8d,%r10d
│ 0x00007fb4412225c3: jae 0x00007fb441222b6d
1.77% 2.03% │ 0x00007fb4412225c9: lea (%r12,%rbp,8),%r8
0.70% 0.74% │ 0x00007fb4412225cd: mov 0x10(%r8,%r10,4),%r9d ;*aaload
│ ; - com.google.re2j.Machine::step@87 (line 295)
0.88% 0.82% │ 0x00007fb4412225d2: mov 0xc(%r12,%r9,8),%ebp ;*getfield op
│ ; - com.google.re2j.Machine::step@92 (line 297)
│ ; implicit exception: dispatches to 0x00007fb4412236f1
2.59% 2.10% │ 0x00007fb4412225d7: cmp $0x6,%ebp
│ 0x00007fb4412225da: je 0x00007fb441222be9 ;*if_icmpne
│ ; - com.google.re2j.Machine::step@97 (line 297)
2.30% 2.21% │ 0x00007fb4412225e0: cmp $0xa,%ebp
│ 0x00007fb4412225e3: jne 0x00007fb4412229c2 ;*if_icmpne
│ ; - com.google.re2j.Inst::matchRune@6 (line 90)
│ ; - com.google.re2j.Machine::step@181 (line 312)
0.44% 0.46% │ 0x00007fb4412225e9: mov 0x2c(%r12,%r9,8),%r9d ;*getfield outInst
│ ; - com.google.re2j.Machine::step@189 (line 313)
0.14% 0.05% │ 0x00007fb4412225ee: mov 0x8(%r12,%r9,8),%ebx ; implicit exception: dispatches to 0x00007fb441223701
0.82% 0.53% │ 0x00007fb4412225f3: lea (%r12,%r9,8),%r8
0.07% 0.07% │ 0x00007fb4412225f7: cmp $0xf8019843,%ebx ; {metadata('com/google/re2j/Inst$Alt2Inst')}
│ 0x00007fb4412225fd: jne 0x00007fb441222a63 ;*invokevirtual add
│ ; - com.google.re2j.Machine::step@202 (line 313)
0.59% 0.58% │ 0x00007fb441222603: mov 0x18(%r8),%edx ;*getfield pc
│ ; - com.google.re2j.Inst$Alt2Inst::add@2 (line 175)
│ ; - com.google.re2j.Machine::step@-1 (line 280)
0.09% 0.06% │ 0x00007fb441222607: mov 0x10(%r11),%r9 ;*getfield pcsl
│ ; - com.google.re2j.Machine$Queue::contains@7 (line 42)
│ ; - com.google.re2j.Inst$Alt2Inst::add@5 (line 175)
│ ; - com.google.re2j.Machine::step@-1 (line 280)
│ ; implicit exception: dispatches to 0x00007fb441223719
0.01% 0.03% │ 0x00007fb44122260b: cmp $0x40,%edx
│ 0x00007fb44122260e: jg 0x00007fb441222e91 ;*if_icmpgt
│ ; - com.google.re2j.Machine$Queue::contains@3 (line 41)
│ ; - com.google.re2j.Inst$Alt2Inst::add@5 (line 175)
│ ; - com.google.re2j.Machine::step@-1 (line 280)
0.40% 0.44% │ 0x00007fb441222614: mov $0x1,%edi
0.14% 0.16% │ 0x00007fb441222619: mov %edx,%ecx
0.03% 0.03% │ 0x00007fb44122261b: shl %cl,%rdi ;*lshl
│ ; - com.google.re2j.Machine$Queue::contains@12 (line 42)
│ ; - com.google.re2j.Inst$Alt2Inst::add@5 (line 175)
│ ; - com.google.re2j.Machine::step@-1 (line 280)
1.08% 0.85% │ 0x00007fb44122261e: mov %r9,%rcx
0.00% 0.00% │ 0x00007fb441222621: and %rdi,%rcx
0.00% 0.04% │ 0x00007fb441222624: test %rcx,%rcx
╰ 0x00007fb441222627: jne 0x00007fb441222599 ;*ifeq
; - com.google.re2j.Machine$Queue::contains@16 (line 42)
; - com.google.re2j.Inst$Alt2Inst::add@5 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.35% 0.37% 0x00007fb44122262d: cmp $0x40,%edx
0x00007fb441222630: jge 0x00007fb441222ef1 ;*if_icmpge
; - com.google.re2j.Machine$Queue::add@3 (line 51)
; - com.google.re2j.Inst$Alt2Inst::add@19 (line 178)
; - com.google.re2j.Machine::step@-1 (line 280)
0.27% 0.21% 0x00007fb441222636: mov %r12b,0x18(%r11) ;*putfield empty
; - com.google.re2j.Machine$Queue::add@33 (line 56)
; - com.google.re2j.Inst$Alt2Inst::add@19 (line 178)
; - com.google.re2j.Machine::step@-1 (line 280)
0.01% 0.02% 0x00007fb44122263a: mov 0x2c(%r8),%ebp ;*getfield outInst
; - com.google.re2j.Inst$Alt2Inst::add@23 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.01% 0.02% 0x00007fb44122263e: or %r9,%rdi ;*lor ; - com.google.re2j.Machine$Queue::add@14 (line 52)
; - com.google.re2j.Inst$Alt2Inst::add@19 (line 178)
; - com.google.re2j.Machine::step@-1 (line 280)
0.39% 0.29% 0x00007fb441222641: mov %rdi,0x10(%r11) ;*putfield pcsl
; - com.google.re2j.Machine$Queue::add@15 (line 52)
; - com.google.re2j.Inst$Alt2Inst::add@19 (line 178)
; - com.google.re2j.Machine::step@-1 (line 280)
0.31% 0.23% 0x00007fb441222645: mov 0x8(%r12,%rbp,8),%r9d ; implicit exception: dispatches to 0x00007fb44122372d
1.08% 1.06% 0x00007fb44122264a: cmp $0xf8019909,%r9d ; {metadata('com/google/re2j/Inst$MatchInst')}
0x00007fb441222651: jne 0x00007fb441222c9d
0.59% 0.49% 0x00007fb441222657: lea (%r12,%rbp,8),%r9 ;*invokevirtual add
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.04% 0.04% 0x00007fb44122265b: mov 0x18(%r9),%ecx ;*getfield pc
; - com.google.re2j.Inst$MatchInst::add@2 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.28% 0.17% 0x00007fb44122265f: cmp $0x40,%ecx
0x00007fb441222662: jg 0x00007fb441222f51 ;*if_icmpgt
; - com.google.re2j.Machine$Queue::contains@3 (line 41)
; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.44% 0.17% 0x00007fb441222668: mov $0x1,%ebx
0.25% 0.16% 0x00007fb44122266d: shl %cl,%rbx ;*lshl
; - com.google.re2j.Machine$Queue::contains@12 (line 42)
; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.94% 0.52% 0x00007fb441222670: mov %rdi,%rdx
0.16% 0.15% 0x00007fb441222673: and %rbx,%rdx ;*land
; - com.google.re2j.Machine$Queue::contains@13 (line 42)
; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.00% 0x00007fb441222676: test %rdx,%rdx
0x00007fb441222679: jne 0x00007fb441222b1a ;*ifeq
; - com.google.re2j.Machine$Queue::contains@16 (line 42)
; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.20% 0.15% 0x00007fb44122267f: xor %ebp,%ebp ;*ireturn
; - com.google.re2j.Machine$Queue::contains@24 (line 42)
; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.21% 0.12% 0x00007fb441222681: test %rdx,%rdx
0x00007fb441222684: jne 0x00007fb441222fb1 ;*ifeq
; - com.google.re2j.Inst$MatchInst::add@8 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.29% 0.21% 0x00007fb44122268a: cmp $0x40,%ecx
0x00007fb44122268d: jge 0x00007fb44122300d ;*if_icmpge
; - com.google.re2j.Machine$Queue::add@3 (line 51)
; - com.google.re2j.Inst$MatchInst::add@19 (line 147)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.02% 0.00% 0x00007fb441222693: or %rbx,%rdi ;*lor ; - com.google.re2j.Machine$Queue::add@14 (line 52)
; - com.google.re2j.Inst$MatchInst::add@19 (line 147)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.02% 0.02% 0x00007fb441222696: mov %rdi,0x10(%r11) ;*putfield pcsl
; - com.google.re2j.Machine$Queue::add@15 (line 52)
; - com.google.re2j.Inst$MatchInst::add@19 (line 147)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.31% 0.20% 0x00007fb44122269a: mov 0x20(%r11),%ebx ;*getfield denseThreadsInstructions
; - com.google.re2j.Machine$Queue::addThread@1 (line 66)
; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.33% 0.17% 0x00007fb44122269e: mov 0xc(%r11),%ecx ;*getfield size
; - com.google.re2j.Machine$Queue::addThread@6 (line 66)
; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.05% 0x00007fb4412226a2: mov %ecx,%edx
0.05% 0.07% 0x00007fb4412226a4: inc %edx ;*iadd
; - com.google.re2j.Machine$Queue::addThread@11 (line 66)
; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.32% 0.17% 0x00007fb4412226a6: mov %edx,0xc(%r11) ;*putfield size
; - com.google.re2j.Machine$Queue::addThread@12 (line 66)
; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.35% 0.20% 0x00007fb4412226aa: mov 0xc(%r12,%rbx,8),%r14d ; implicit exception: dispatches to 0x00007fb441223745
0.01% 0.01% 0x00007fb4412226af: cmp %r14d,%ecx
0x00007fb4412226b2: jae 0x00007fb441222c3d
0.02% 0.03% 0x00007fb4412226b8: mov 0x8(%r12,%rbx,8),%esi
0.24% 0.14% 0x00007fb4412226bd: cmp $0xf8019807,%esi ; {metadata('com/google/re2j/Inst'[])}
0x00007fb4412226c3: jne 0x00007fb441222cf9 ;*aastore
; - com.google.re2j.Machine$Queue::addThread@16 (line 66)
; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.34% 0.32% 0x00007fb4412226c9: mov 0x34(%r8),%r8d ;*getfield inst2
; - com.google.re2j.Inst$Alt2Inst::add@41 (line 181)
; - com.google.re2j.Machine::step@-1 (line 280)
0.01% 0x00007fb4412226cd: mov %r9,%rsi
0.04% 0.04% 0x00007fb4412226d0: shr $0x3,%rsi ;*aastore
; - com.google.re2j.Machine$Queue::addThread@16 (line 66)
; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.24% 0.15% 0x00007fb4412226d4: lea (%r12,%rbx,8),%r9 ;*getfield denseThreadsInstructions
; - com.google.re2j.Machine$Queue::addThread@1 (line 66)
; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.24% 0.36% 0x00007fb4412226d8: lea 0x10(%r9,%rcx,4),%rbp
0.03% 0.00% 0x00007fb4412226dd: mov %esi,0x0(%rbp)
0.06% 0.06% 0x00007fb4412226e0: mov %rbp,%rsi
0.29% 0.24% 0x00007fb4412226e3: shr $0x9,%rsi
0.21% 0.35% 0x00007fb4412226e7: movabs $0x7fb451f2f000,%rbp
0.01% 0x00007fb4412226f1: mov %r12b,0x0(%rbp,%rsi,1) ;*aastore
; - com.google.re2j.Machine$Queue::addThread@16 (line 66)
; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Machine::step@-1 (line 280)
0.13% 0.12% 0x00007fb4412226f6: mov 0x8(%r12,%r8,8),%esi ;*invokevirtual add
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Machine::step@-1 (line 280)
; implicit exception: dispatches to 0x00007fb441223761
0.26% 0.26% 0x00007fb4412226fb: vmovd %edx,%xmm2
0.23% 0.32% 0x00007fb4412226ff: vmovd %ebx,%xmm1
0.02% 0.01% 0x00007fb441222703: mov %r10d,0x94(%rsp)
0.09% 0.06% 0x00007fb44122270b: mov %r13d,0x9c(%rsp)
0.23% 0.26% 0x00007fb441222713: mov %r11,%r13
0.29% 0.31% 0x00007fb441222716: mov %rax,0x30(%rsp)
0.03% 0.02% 0x00007fb44122271b: mov %ecx,%eax
0.11% 0.07% 0x00007fb44122271d: movslq %ecx,%r10
0.32% 0.16% 0x00007fb441222720: lea (%r9,%r10,4),%rbx ;*aastore
; - com.google.re2j.Machine$Queue::addThread@16 (line 66)
; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.25% 0.24% 0x00007fb441222724: mov %rbx,%rdx
0.01% 0.01% 0x00007fb441222727: add $0x14,%rdx ;*aastore
; - com.google.re2j.Machine$Queue::addThread@16 (line 66)
; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Machine::step@-1 (line 280)
0.09% 0.09% 0x00007fb44122272b: lea (%r12,%r8,8),%r11
0.30% 0.20% 0x00007fb44122272f: mov %ecx,%r10d
0.31% 0.14% 0x00007fb441222732: add $0x2,%r10d ;*iadd
; - com.google.re2j.Machine$Queue::addThread@11 (line 66)
; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Machine::step@-1 (line 280)
0.02% 0.03% 0x00007fb441222736: cmp $0xf8019885,%esi ; {metadata('com/google/re2j/Inst$CaptureInst')}
0x00007fb44122273c: jne 0x00007fb4412224ff ;*invokevirtual add
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Machine::step@-1 (line 280)
0.09% 0.05% 0x00007fb441222742: vmovq %r11,%xmm0
0.32% 0.33% 0x00007fb441222747: mov 0x18(%r11),%r11d ;*getfield pc
; - com.google.re2j.Inst$CaptureInst::add@2 (line 461)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.28% 0.23% 0x00007fb44122274b: mov %r11d,%ecx
0.01% 0.04% 0x00007fb44122274e: cmp $0x40,%r11d
0x00007fb441222752: jg 0x00007fb441223171 ;*if_icmpgt
; - com.google.re2j.Machine$Queue::contains@3 (line 41)
; - com.google.re2j.Inst$CaptureInst::add@5 (line 461)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.06% 0.04% 0x00007fb441222758: mov $0x1,%r8d
0.28% 0.18% 0x00007fb44122275e: shl %cl,%r8 ;*lshl
; - com.google.re2j.Machine$Queue::contains@12 (line 42)
; - com.google.re2j.Inst$CaptureInst::add@5 (line 461)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.42% 0.15% 0x00007fb441222761: mov %rdi,%r11
0.34% 0.15% 0x00007fb441222764: and %r8,%r11 ;*land
; - com.google.re2j.Machine$Queue::contains@13 (line 42)
; - com.google.re2j.Inst$CaptureInst::add@5 (line 461)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.29% 0.06% 0x00007fb441222767: test %r11,%r11
0x00007fb44122276a: jne 0x00007fb441222b24 ;*ifeq
; - com.google.re2j.Machine$Queue::contains@16 (line 42)
; - com.google.re2j.Inst$CaptureInst::add@5 (line 461)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.03% 0.01% 0x00007fb441222770: xor %ebp,%ebp ;*ireturn
; - com.google.re2j.Machine$Queue::contains@24 (line 42)
; - com.google.re2j.Inst$CaptureInst::add@5 (line 461)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.05% 0.03% 0x00007fb441222772: test %r11,%r11
0x00007fb441222775: jne 0x00007fb4412231a1 ;*ifeq
; - com.google.re2j.Inst$CaptureInst::add@8 (line 461)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.27% 0.17% 0x00007fb44122277b: mov %ecx,%r11d
0.30% 0.05% 0x00007fb44122277e: cmp $0x40,%r11d
0x00007fb441222782: jge 0x00007fb4412231c5 ;*if_icmpge
; - com.google.re2j.Machine$Queue::add@3 (line 51)
; - com.google.re2j.Inst$CaptureInst::add@19 (line 464)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.03% 0.02% 0x00007fb441222788: or %r8,%rdi ;*lor ; - com.google.re2j.Machine$Queue::add@14 (line 52)
; - com.google.re2j.Inst$CaptureInst::add@19 (line 464)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.09% 0.09% 0x00007fb44122278b: mov %rdi,0x10(%r13) ;*putfield pcsl
; - com.google.re2j.Machine$Queue::add@15 (line 52)
; - com.google.re2j.Inst$CaptureInst::add@19 (line 464)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.21% 0.16% 0x00007fb44122278f: vmovq %xmm0,%r11
0.28% 0.17% 0x00007fb441222794: mov 0x2c(%r11),%ebp ;*getfield outInst
; - com.google.re2j.Inst$CaptureInst::add@83 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.03% 0.04% 0x00007fb441222798: mov 0x8(%r12,%rbp,8),%r11d ; implicit exception: dispatches to 0x00007fb441223799
0.13% 0.12% 0x00007fb44122279d: cmp $0xf8019843,%r11d ; {metadata('com/google/re2j/Inst$Alt2Inst')}
0x00007fb4412227a4: jne 0x00007fb441222e51
0.34% 0.21% 0x00007fb4412227aa: lea (%r12,%rbp,8),%r11 ;*invokevirtual add
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.31% 0.30% 0x00007fb4412227ae: vmovq %r11,%xmm0
0.00% 0x00007fb4412227b3: mov 0x18(%r11),%r11d ;*getfield pc
; - com.google.re2j.Inst$Alt2Inst::add@2 (line 175)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.08% 0.05% 0x00007fb4412227b7: vmovd %r11d,%xmm3
0.41% 0.03% 0x00007fb4412227bc: cmp $0x40,%r11d
0.21% 0.21% 0x00007fb4412227c0: jg 0x00007fb441223271 ;*if_icmpgt
; - com.google.re2j.Machine$Queue::contains@3 (line 41)
; - com.google.re2j.Inst$Alt2Inst::add@5 (line 175)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.09% 0.05% 0x00007fb4412227c6: mov $0x1,%r8d
0.07% 0.02% 0x00007fb4412227cc: mov %r11d,%ecx
0.31% 0.36% 0x00007fb4412227cf: shl %cl,%r8 ;*lshl
; - com.google.re2j.Machine$Queue::contains@12 (line 42)
; - com.google.re2j.Inst$Alt2Inst::add@5 (line 175)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.34% 0.59% 0x00007fb4412227d2: mov %rdi,%r11
0.30% 0.47% 0x00007fb4412227d5: and %r8,%r11
0.33% 0.42% 0x00007fb4412227d8: test %r11,%r11
0x00007fb4412227db: jne 0x00007fb441222b3d ;*ifeq
; - com.google.re2j.Machine$Queue::contains@16 (line 42)
; - com.google.re2j.Inst$Alt2Inst::add@5 (line 175)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.03% 0.07% 0x00007fb4412227e1: mov %ecx,%r11d
0.05% 0.11% 0x00007fb4412227e4: cmp $0x40,%r11d
0x00007fb4412227e8: jge 0x00007fb4412232a1 ;*if_icmpge
; - com.google.re2j.Machine$Queue::add@3 (line 51)
; - com.google.re2j.Inst$Alt2Inst::add@19 (line 178)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.27% 0.27% 0x00007fb4412227ee: vmovq %xmm0,%r11
0.24% 0.30% 0x00007fb4412227f3: mov 0x2c(%r11),%ebp ;*getfield outInst
; - com.google.re2j.Inst$Alt2Inst::add@23 (line 180)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.06% 0.06% 0x00007fb4412227f7: or %r8,%rdi ;*lor ; - com.google.re2j.Machine$Queue::add@14 (line 52)
; - com.google.re2j.Inst$Alt2Inst::add@19 (line 178)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.06% 0.07% 0x00007fb4412227fa: mov %rdi,0x10(%r13) ;*putfield pcsl
; - com.google.re2j.Machine$Queue::add@15 (line 52)
; - com.google.re2j.Inst$Alt2Inst::add@19 (line 178)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.26% 0.35% 0x00007fb4412227fe: mov 0x8(%r12,%rbp,8),%r8d ; implicit exception: dispatches to 0x00007fb4412237b1
0.41% 0.66% 0x00007fb441222803: cmp $0xf8019909,%r8d ; {metadata('com/google/re2j/Inst$MatchInst')}
0x00007fb44122280a: jne 0x00007fb441222e71
0.13% 0.15% 0x00007fb441222810: lea (%r12,%rbp,8),%r11 ;*invokevirtual add
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.06% 0.06% 0x00007fb441222814: vmovq %r11,%xmm3
0.23% 0.36% 0x00007fb441222819: mov 0x18(%r11),%r11d ;*getfield pc
; - com.google.re2j.Inst$MatchInst::add@2 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.26% 0.33% 0x00007fb44122281d: mov %r11d,%ecx
0.14% 0.15% 0x00007fb441222820: cmp $0x40,%r11d
0x00007fb441222824: jg 0x00007fb4412232d1 ;*if_icmpgt
; - com.google.re2j.Machine$Queue::contains@3 (line 41)
; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.13% 0.07% 0x00007fb44122282a: mov $0x1,%r8d
0.19% 0.23% 0x00007fb441222830: shl %cl,%r8 ;*lshl
; - com.google.re2j.Machine$Queue::contains@12 (line 42)
; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.58% 0.62% 0x00007fb441222833: mov %rdi,%r11
0.21% 0.21% 0x00007fb441222836: and %r8,%r11 ;*land
; - com.google.re2j.Machine$Queue::contains@13 (line 42)
; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.18% 0.18% 0x00007fb441222839: test %r11,%r11
0x00007fb44122283c: jne 0x00007fb441222b45 ;*ifeq
; - com.google.re2j.Machine$Queue::contains@16 (line 42)
; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.19% 0.20% 0x00007fb441222842: xor %ebp,%ebp ;*ireturn
; - com.google.re2j.Machine$Queue::contains@24 (line 42)
; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.09% 0.05% 0x00007fb441222844: test %r11,%r11
0x00007fb441222847: jne 0x00007fb441223305 ;*ifeq
; - com.google.re2j.Inst$MatchInst::add@8 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.28% 0.37% 0x00007fb44122284d: mov %ecx,%r11d
0.19% 0.23% 0x00007fb441222850: cmp $0x40,%r11d
0x00007fb441222854: jge 0x00007fb44122332d ;*if_icmpge
; - com.google.re2j.Machine$Queue::add@3 (line 51)
; - com.google.re2j.Inst$MatchInst::add@19 (line 147)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.09% 0.14% 0x00007fb44122285a: mov %r10d,0xc(%r13) ;*putfield size
; - com.google.re2j.Machine$Queue::addThread@12 (line 66)
; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.09% 0.12% 0x00007fb44122285e: or %r8,%rdi ;*lor ; - com.google.re2j.Machine$Queue::add@14 (line 52)
; - com.google.re2j.Inst$MatchInst::add@19 (line 147)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.38% 0.35% 0x00007fb441222861: mov %rdi,0x10(%r13) ;*putfield pcsl
; - com.google.re2j.Machine$Queue::add@15 (line 52)
; - com.google.re2j.Inst$MatchInst::add@19 (line 147)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.19% 0.21% 0x00007fb441222865: cmp %r14d,%r10d
0x00007fb441222868: jae 0x00007fb441222df5 ;*aastore
; - com.google.re2j.Machine$Queue::addThread@16 (line 66)
; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.10% 0.08% 0x00007fb44122286e: vmovq %xmm0,%r10
0.10% 0.05% 0x00007fb441222873: mov 0x34(%r10),%r11d ;*getfield inst2
; - com.google.re2j.Inst$Alt2Inst::add@41 (line 181)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.37% 0.37% 0x00007fb441222877: mov %rdx,%r10
0.17% 0.18% 0x00007fb44122287a: vmovq %xmm3,%r8
0.08% 0.17% 0x00007fb44122287f: shr $0x3,%r8
0.07% 0.06% 0x00007fb441222883: mov %r8d,(%rdx)
0.37% 0.42% 0x00007fb441222886: shr $0x9,%r10
0.13% 0.27% 0x00007fb44122288a: movabs $0x7fb451f2f000,%r8
0.08% 0.09% 0x00007fb441222894: mov %r12b,(%r8,%r10,1) ;*aastore
; - com.google.re2j.Machine$Queue::addThread@16 (line 66)
; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
; - com.google.re2j.Inst$Alt2Inst::add@35 (line 180)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.08% 0.08% 0x00007fb441222898: mov 0x8(%r12,%r11,8),%r8d ; implicit exception: dispatches to 0x00007fb4412237c9
0.32% 0.40% 0x00007fb44122289d: lea (%r12,%r11,8),%r10
0.18% 0.22% 0x00007fb4412228a1: cmp $0xf8019885,%r8d ; {metadata('com/google/re2j/Inst$CaptureInst')}
0x00007fb4412228a8: jne 0x00007fb441222943 ;*invokevirtual add
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0x00007fb4412228ae: mov 0x18(%r10),%ecx ;*getfield pc
; - com.google.re2j.Inst$CaptureInst::add@2 (line 461)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
....................................................................................................
45.75% 42.75% <total for region 1>
....[Hottest Region 2]..............................................................................
C2, level 4, com.google.re2j.Machine::match, version 540 (923 bytes)
0x00007fb44123af69: mov %r10d,%ebx
0x00007fb44123af6c: mov %r11d,0x30(%rsp)
0x00007fb44123af71: mov $0x5,%r10d ;*iload_1
; - com.google.re2j.Utils::emptyOpContext@29 (line 182)
; - com.google.re2j.Machine::match@121 (line 205)
0x00007fb44123af77: cmp $0xa,%edi
0x00007fb44123af7a: je 0x00007fb44123b89b ;*iload_0
; - com.google.re2j.Utils::emptyOpContext@39 (line 185)
; - com.google.re2j.Machine::match@121 (line 205)
0x00007fb44123af80: mov %edi,%r8d
0.01% 0x00007fb44123af83: add $0xffffffbf,%r8d
0x00007fb44123af87: cmp $0x1a,%r8d
╭ 0x00007fb44123af8b: jb 0x00007fb44123af9e ;*if_icmple
│ ; - com.google.re2j.Utils::isWordRune@9 (line 149)
│ ; - com.google.re2j.Utils::emptyOpContext@44 (line 185)
│ ; - com.google.re2j.Machine::match@121 (line 205)
│ 0x00007fb44123af8d: mov %edi,%r11d
│ 0x00007fb44123af90: add $0xffffff9f,%r11d
0.01% │ 0x00007fb44123af94: cmp $0x1a,%r11d
│ 0x00007fb44123af98: jae 0x00007fb44123b8b2 ;*iconst_1
│ ; - com.google.re2j.Utils::isWordRune@42 (line 149)
│ ; - com.google.re2j.Utils::emptyOpContext@44 (line 185)
│ ; - com.google.re2j.Machine::match@121 (line 205)
0.00% ↘ 0x00007fb44123af9e: or $0x10,%r10d ;*iload_2
; - com.google.re2j.Utils::emptyOpContext@63 (line 190)
; - com.google.re2j.Machine::match@121 (line 205)
0x00007fb44123afa2: movzbl 0x11(%r13),%r9d ;*getfield captures
; - com.google.re2j.Machine::match@283 (line 240)
0.01% 0.01% 0x00007fb44123afa7: mov %rcx,%r11
0.00% 0.01% 0x00007fb44123afaa: shl $0x3,%r11 ;*getfield q1
; - com.google.re2j.Machine::match@53 (line 192)
0x00007fb44123afae: mov %r11,0x60(%rsp)
0x00007fb44123afb3: xor %eax,%eax
0x00007fb44123afb5: xor %r8d,%r8d
0.01% 0x00007fb44123afb8: mov %r8d,0x5c(%rsp)
0.00% ╭ 0x00007fb44123afbd: jmpq 0x00007fb44123b147
0.09% 0.13% │ ↗ 0x00007fb44123afc2: or $0x20,%r9d ;*ior ; - com.google.re2j.Utils::emptyOpContext@61 (line 188)
│ │ ; - com.google.re2j.Machine::match@322 (line 245)
0.14% 0.17% │ │ 0x00007fb44123afc6: mov %r9d,0x2c(%rsp) ;*iload_2
│ │ ; - com.google.re2j.Utils::emptyOpContext@63 (line 190)
│ │ ; - com.google.re2j.Machine::match@322 (line 245)
0.39% 0.42% │ │↗ 0x00007fb44123afcb: cmp 0x14(%rsp),%eax
│ ││ 0x00007fb44123afcf: je 0x00007fb44123b7c8 ;*if_icmpne
│ ││ ; - com.google.re2j.Machine::match@347 (line 246)
0.46% 0.46% │ ││ 0x00007fb44123afd5: xor %ebx,%ebx ;*invokespecial step
│ ││ ; - com.google.re2j.Machine::match@355 (line 246)
0.05% 0.09% │ ││ 0x00007fb44123afd7: mov %rax,-0x8(%rsp)
0.19% 0.18% │ ││ 0x00007fb44123afdc: mov 0x5c(%rsp),%eax
0.14% 0.12% │ ││ 0x00007fb44123afe0: mov %eax,0x38(%rsp)
0.52% 0.41% │ ││ 0x00007fb44123afe4: mov -0x8(%rsp),%rax
0.45% 0.24% │ ││ 0x00007fb44123afe9: mov %r10d,0x20(%rsp) ;*invokevirtual endPos
│ ││ ; - com.google.re2j.Machine::match@344 (line 246)
0.27% 0.18% │ ││ 0x00007fb44123afee: add 0x28(%rsp),%eax ;*iadd
│ ││ ; - com.google.re2j.Machine::match@336 (line 246)
0.35% 0.27% │ ││ 0x00007fb44123aff2: mov %eax,0x5c(%rsp)
0.24% 0.20% │ ││ 0x00007fb44123aff6: mov 0x50(%rsp),%rsi
0.05% 0.05% │ ││ 0x00007fb44123affb: mov 0x18(%rsp),%rdx
0.20% 0.18% │ ││ 0x00007fb44123b000: mov 0x60(%rsp),%rcx
0.18% 0.24% │ ││ 0x00007fb44123b005: mov 0x38(%rsp),%r8d
0.31% 0.25% │ ││ 0x00007fb44123b00a: mov %eax,%r9d
0.04% 0.06% │ ││ 0x00007fb44123b00d: mov 0x2c(%rsp),%r11d
0.15% 0.09% │ ││ 0x00007fb44123b012: mov %r11d,(%rsp)
0.19% 0.14% │ ││ 0x00007fb44123b016: mov 0x3c(%rsp),%r11d
0.27% 0.21% │ ││ 0x00007fb44123b01b: mov %r11d,0x8(%rsp)
0.04% 0.12% │ ││ 0x00007fb44123b020: mov %ebx,0x10(%rsp)
0.19% 0.15% │ ││ 0x00007fb44123b024: data16 xchg %ax,%ax
0.21% 0.23% │ ││ 0x00007fb44123b027: callq 0x00007fb441046020 ; OopMap{[24]=Oop [52]=NarrowOop [72]=Oop [80]=Oop [96]=Oop off=652}
│ ││ ;*invokespecial step
│ ││ ; - com.google.re2j.Machine::match@355 (line 246)
│ ││ ; {optimized virtual_call}
0.00% │ ││ 0x00007fb44123b02c: mov 0x50(%rsp),%r10
0.56% 0.89% │ ││ 0x00007fb44123b031: movzbl 0x11(%r10),%r9d ;*getfield captures
│ ││ ; - com.google.re2j.Machine::match@367 (line 250)
0.02% 0.00% │ ││ 0x00007fb44123b036: movzbl 0x10(%r10),%eax ;*getfield matched
│ ││ ; - com.google.re2j.Machine::match@374 (line 250)
│ ││ 0x00007fb44123b03b: mov 0x28(%rsp),%r8d
0.66% 0.77% │ ││ 0x00007fb44123b040: test %r8d,%r8d
│ ││ 0x00007fb44123b043: je 0x00007fb44123b788 ;*ifne
│ ││ ; - com.google.re2j.Machine::match@360 (line 247)
│ ││ 0x00007fb44123b049: test %r9d,%r9d
│ ││ 0x00007fb44123b04c: jne 0x00007fb44123bb41 ;*ifne
│ ││ ; - com.google.re2j.Machine::match@370 (line 250)
0.00% 0.01% │ ││ 0x00007fb44123b052: test %eax,%eax
│ ││ 0x00007fb44123b054: jne 0x00007fb44123bd35 ;*ifeq
│ ││ ; - com.google.re2j.Machine::match@377 (line 250)
│ ││ 0x00007fb44123b05a: mov 0x48(%rsp),%rdx
0.60% 0.78% │ ││ 0x00007fb44123b05f: mov 0x10(%rdx),%ecx ;*getfield end
│ ││ ; - com.google.re2j.MachineInput$UTF16Input::step@9 (line 186)
│ ││ ; - com.google.re2j.Machine::match@407 (line 259)
0.01% 0.01% │ ││ 0x00007fb44123b062: mov 0xc(%rdx),%r11d ;*getfield start
│ ││ ; - com.google.re2j.MachineInput$UTF16Input::step@2 (line 185)
│ ││ ; - com.google.re2j.Machine::match@407 (line 259)
0.01% 0.00% │ ││ 0x00007fb44123b066: mov %r11d,0x24(%rsp)
0.01% │ ││ 0x00007fb44123b06b: mov 0x14(%rdx),%r11d ;*getfield str
│ ││ ; - com.google.re2j.MachineInput$UTF16Input::step@16 (line 187)
│ ││ ; - com.google.re2j.Machine::match@407 (line 259)
0.69% 0.82% │ ││ 0x00007fb44123b06f: mov 0x20(%rsp),%ebp
│ ││ 0x00007fb44123b073: cmp $0xffffffff,%ebp
│ ││ 0x00007fb44123b076: je 0x00007fb44123b7d2 ;*if_icmpeq
│ ││ ; - com.google.re2j.Machine::match@399 (line 258)
0.01% 0.00% │ ││ 0x00007fb44123b07c: mov 0x30(%rsp),%ebx
0.00% 0.00% │ ││ 0x00007fb44123b080: add 0x5c(%rsp),%ebx
0.66% 0.80% │ ││ 0x00007fb44123b084: add 0x24(%rsp),%ebx ;*iadd
│ ││ ; - com.google.re2j.MachineInput$UTF16Input::step@5 (line 185)
│ ││ ; - com.google.re2j.Machine::match@407 (line 259)
0.10% 0.10% │ ││ 0x00007fb44123b088: cmp %ecx,%ebx
│ ││ 0x00007fb44123b08a: jge 0x00007fb44123b7e1 ;*if_icmpge
│ ││ ; - com.google.re2j.MachineInput$UTF16Input::step@12 (line 186)
│ ││ ; - com.google.re2j.Machine::match@407 (line 259)
0.02% 0.03% │ ││ 0x00007fb44123b090: mov %ebp,%r14d
│ ││ 0x00007fb44123b093: mov %r10,%rdi
0.65% 0.77% │ ││ 0x00007fb44123b096: mov 0x8(%r12,%r11,8),%r8d ; implicit exception: dispatches to 0x00007fb44123ca1d
0.02% 0.01% │ ││ 0x00007fb44123b09b: cmp $0xf80002da,%r8d ; {metadata('java/lang/String')}
│ ││ 0x00007fb44123b0a2: jne 0x00007fb44123ba55
0.01% 0.01% │ ││ 0x00007fb44123b0a8: lea (%r12,%r11,8),%r13 ;*invokeinterface charAt
│ ││ ; - java.lang.Character::codePointAt@2 (line 4866)
│ ││ ; - com.google.re2j.MachineInput$UTF16Input::step@20 (line 187)
│ ││ ; - com.google.re2j.Machine::match@407 (line 259)
0.00% │ ││ 0x00007fb44123b0ac: test %ebx,%ebx
│ ││ 0x00007fb44123b0ae: jl 0x00007fb44123bb81 ;*iflt
│ ││ ; - java.lang.String::charAt@1 (line 657)
│ ││ ; - java.lang.Character::codePointAt@2 (line 4866)
│ ││ ; - com.google.re2j.MachineInput$UTF16Input::step@20 (line 187)
│ ││ ; - com.google.re2j.Machine::match@407 (line 259)
0.65% 0.63% │ ││ 0x00007fb44123b0b4: mov 0xc(%r13),%r8d ;*getfield value
│ ││ ; - java.lang.String::charAt@6 (line 657)
│ ││ ; - java.lang.Character::codePointAt@2 (line 4866)
│ ││ ; - com.google.re2j.MachineInput$UTF16Input::step@20 (line 187)
│ ││ ; - com.google.re2j.Machine::match@407 (line 259)
0.01% 0.01% │ ││ 0x00007fb44123b0b8: mov 0xc(%r12,%r8,8),%ebp ;*arraylength
│ ││ ; - java.lang.String::charAt@9 (line 657)
│ ││ ; - java.lang.Character::codePointAt@2 (line 4866)
│ ││ ; - com.google.re2j.MachineInput$UTF16Input::step@20 (line 187)
│ ││ ; - com.google.re2j.Machine::match@407 (line 259)
│ ││ ; implicit exception: dispatches to 0x00007fb44123ca31
0.38% 0.49% │ ││ 0x00007fb44123b0bd: cmp %ebp,%ebx
│ ││ 0x00007fb44123b0bf: jge 0x00007fb44123bd75 ;*if_icmplt
│ ││ ; - java.lang.String::charAt@10 (line 657)
│ ││ ; - java.lang.Character::codePointAt@2 (line 4866)
│ ││ ; - com.google.re2j.MachineInput$UTF16Input::step@20 (line 187)
│ ││ ; - com.google.re2j.Machine::match@407 (line 259)
0.42% 0.45% │ ││ 0x00007fb44123b0c5: cmp %ebp,%ebx
│ ││ 0x00007fb44123b0c7: jae 0x00007fb44123b951
0.43% 0.33% │ ││ 0x00007fb44123b0cd: lea (%r12,%r8,8),%r10
0.01% │ ││ 0x00007fb44123b0d1: movzwl 0x10(%r10,%rbx,2),%r8d ;*caload
│ ││ ; - java.lang.String::charAt@27 (line 660)
│ ││ ; - java.lang.Character::codePointAt@2 (line 4866)
│ ││ ; - com.google.re2j.MachineInput$UTF16Input::step@20 (line 187)
│ ││ ; - com.google.re2j.Machine::match@407 (line 259)
0.12% 0.14% │ ││ 0x00007fb44123b0d7: cmp $0xd800,%r8d
│ ││ 0x00007fb44123b0de: jge 0x00007fb44123bdd9 ;*if_icmplt
│ ││ ; - java.lang.Character::isHighSurrogate@3 (line 4729)
│ ││ ; - java.lang.Character::codePointAt@9 (line 4867)
│ ││ ; - com.google.re2j.MachineInput$UTF16Input::step@20 (line 187)
│ ││ ; - com.google.re2j.Machine::match@407 (line 259)
0.49% 0.43% │ ││ 0x00007fb44123b0e4: shl $0x3,%r8d ;*ishl
│ ││ ; - com.google.re2j.MachineInput$UTF16Input::step@38 (line 190)
│ ││ ; - com.google.re2j.Machine::match@407 (line 259)
0.30% 0.26% │ ││ 0x00007fb44123b0e8: mov %r8d,%ebx
│ ││ 0x00007fb44123b0eb: or $0x1,%ebx
0.39% 0.37% │ ││ 0x00007fb44123b0ee: and $0x7,%r8d
0.16% 0.16% │ ││ 0x00007fb44123b0f2: sar $0x3,%ebx ;*ishr
│ ││ ; - com.google.re2j.Machine::match@415 (line 260)
0.44% 0.48% │ ││ 0x00007fb44123b0f5: or $0x1,%r8d ;*ior ; - com.google.re2j.MachineInput$UTF16Input::step@41 (line 190)
│ ││ ; - com.google.re2j.Machine::match@407 (line 259)
0.02% 0.03% │ ││ 0x00007fb44123b0f9: mov %rdi,%r10
│ ││ 0x00007fb44123b0fc: mov %r14d,%ebp ;*aload
│ ││ ; - com.google.re2j.Machine::match@425 (line 263)
0.15% 0.12% │ ││ 0x00007fb44123b0ff: mov %r10,%r13 ; OopMap{r10=Oop r11=NarrowOop r13=Oop [24]=Oop [72]=Oop [96]=Oop off=866}
│ ││ ;*goto
│ ││ ; - com.google.re2j.Machine::match@437 (line 266)
0.46% 0.46% │ ││ 0x00007fb44123b102: test %eax,0x182ebef8(%rip) # 0x00007fb459527000
│ ││ ;*goto
│ ││ ; - com.google.re2j.Machine::match@437 (line 266)
│ ││ ; {poll}
0.02% 0.02% │ ││ 0x00007fb44123b108: mov 0x28(%r10),%r14d ;*getfield matchcap
│ ││ ; - com.google.re2j.Machine::match@307 (line 243)
0.01% │ ││ 0x00007fb44123b10c: mov 0x14(%r10),%esi ;*getfield re2
│ ││ ; - com.google.re2j.Machine::match@169 (line 220)
0.13% 0.12% │ ││ 0x00007fb44123b110: mov 0x60(%rsp),%r10
0.40% 0.50% │ ││ 0x00007fb44123b115: mov %r10,%rdi
0.02% 0.01% │ ││ 0x00007fb44123b118: shr $0x3,%rdi
│ ││ 0x00007fb44123b11c: mov %edi,0x34(%rsp)
0.14% 0.14% │ ││ 0x00007fb44123b120: mov %ebp,%edi
0.52% 0.54% │ ││ 0x00007fb44123b122: mov 0x2c(%rsp),%r10d
0.05% 0.02% │ ││ 0x00007fb44123b127: mov 0x18(%rsp),%rdx
0.01% 0.00% │ ││ 0x00007fb44123b12c: mov %rdx,0x60(%rsp)
0.11% 0.18% │ ││ 0x00007fb44123b131: mov 0x30(%rsp),%ebp
0.43% 0.51% │ ││ 0x00007fb44123b135: mov %ebp,0x28(%rsp)
0.04% 0.04% │ ││ 0x00007fb44123b139: mov %r8d,0x30(%rsp)
0.01% 0.02% │ ││ 0x00007fb44123b13e: mov %ecx,0x14(%rsp)
0.18% 0.18% │ ││ 0x00007fb44123b142: vmovd %r11d,%xmm2 ;*getfield matchcap
│ ││ ; - com.google.re2j.Machine::match@307 (line 243)
0.44% 0.67% ↘ ││ 0x00007fb44123b147: mov 0x34(%rsp),%r11d
0.10% 0.08% ││ 0x00007fb44123b14c: movzbl 0x18(%r12,%r11,8),%r8d ; implicit exception: dispatches to 0x00007fb44123c9c5
0.07% 0.00% ││ 0x00007fb44123b152: shl $0x3,%r11 ;*aload
││ ; - com.google.re2j.Machine::match@136 (line 211)
0.15% 0.15% ││ 0x00007fb44123b156: mov %r11,0x18(%rsp)
0.52% 0.64% ││ 0x00007fb44123b15b: test %r8d,%r8d
││ 0x00007fb44123b15e: jne 0x00007fb44123b3e3 ;*aload_0
││ ; - com.google.re2j.Machine::match@267 (line 237)
0.01% 0.04% ││ 0x00007fb44123b164: test %eax,%eax
││ 0x00007fb44123b166: jne 0x00007fb44123bab1 ;*ifne
││ ; - com.google.re2j.Machine::match@271 (line 237)
0.01% ││ 0x00007fb44123b16c: mov 0x5c(%rsp),%r11d
0.13% 0.12% ││ 0x00007fb44123b171: test %r11d,%r11d
││ 0x00007fb44123b174: je 0x00007fb44123b866 ;*ifeq
││ ; - com.google.re2j.Machine::match@275 (line 237)
0.55% 0.64% ││ 0x00007fb44123b17a: mov 0x3c(%rsp),%edx
0.03% 0.03% ││ 0x00007fb44123b17e: test %edx,%edx
0.00% ││ 0x00007fb44123b180: jne 0x00007fb44123baf9 ;*aload_0
││ ; - com.google.re2j.Machine::match@282 (line 240)
0.16% 0.17% ││ 0x00007fb44123b186: test %r9d,%r9d
││ 0x00007fb44123b189: jne 0x00007fb44123bbe5 ;*ifeq
││ ; - com.google.re2j.Machine::match@286 (line 240)
0.50% 0.53% ││ 0x00007fb44123b18f: mov %r13,%r9
0.05% 0.02% ││ 0x00007fb44123b192: mov 0x18(%r13),%r8d ;*getfield prog
││ ; - com.google.re2j.Machine::match@297 (line 243)
0.01% ││ 0x00007fb44123b196: mov 0x1c(%r12,%r8,8),%ebp ;*getfield startInst
││ ; - com.google.re2j.Machine::match@300 (line 243)
││ ; implicit exception: dispatches to 0x00007fb44123c9d5
0.20% 0.15% ││ 0x00007fb44123b19b: mov 0x8(%r12,%rbp,8),%ecx ; implicit exception: dispatches to 0x00007fb44123c9e5
0.54% 0.65% ││ 0x00007fb44123b1a0: cmp $0xf8019909,%ecx ; {metadata('com/google/re2j/Inst$MatchInst')}
││ 0x00007fb44123b1a6: jne 0x00007fb44123b9ad
0.14% 0.15% ││ 0x00007fb44123b1ac: lea (%r12,%rbp,8),%r10 ;*invokevirtual add
││ ; - com.google.re2j.Machine::match@314 (line 243)
0.00% ││ 0x00007fb44123b1b0: mov 0x18(%r10),%ecx ;*getfield pc
││ ; - com.google.re2j.Inst$MatchInst::add@2 (line 144)
││ ; - com.google.re2j.Machine::match@314 (line 243)
0.11% 0.17% ││ 0x00007fb44123b1b4: cmp $0x40,%ecx
││ 0x00007fb44123b1b7: jg 0x00007fb44123bc25 ;*if_icmpgt
││ ; - com.google.re2j.Machine$Queue::contains@3 (line 41)
││ ; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
││ ; - com.google.re2j.Machine::match@314 (line 243)
0.44% 0.57% ││ 0x00007fb44123b1bd: mov %r10,%r13
0.08% 0.10% ││ 0x00007fb44123b1c0: mov 0x5c(%rsp),%eax
0.01% 0.01% ││ 0x00007fb44123b1c4: mov %edx,0x3c(%rsp)
0.16% 0.17% ││ 0x00007fb44123b1c8: mov %r9,0x50(%rsp)
0.42% 0.49% ││ 0x00007fb44123b1cd: mov $0x1,%r10d
0.10% 0.10% ││ 0x00007fb44123b1d3: shl %cl,%r10 ;*lshl
││ ; - com.google.re2j.Machine$Queue::contains@12 (line 42)
││ ; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
││ ; - com.google.re2j.Machine::match@314 (line 243)
0.58% 0.63% ││ 0x00007fb44123b1d6: mov 0x34(%rsp),%r8d
0.15% 0.09% ││ 0x00007fb44123b1db: mov 0x10(%r12,%r8,8),%r9 ;*getfield pcsl
││ ; - com.google.re2j.Machine$Queue::contains@7 (line 42)
││ ; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
││ ; - com.google.re2j.Machine::match@314 (line 243)
0.00% 0.01% ││ 0x00007fb44123b1e0: mov %r9,%r8
0.16% 0.13% ││ 0x00007fb44123b1e3: and %r10,%r8 ;*land
││ ; - com.google.re2j.Machine$Queue::contains@13 (line 42)
││ ; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
││ ; - com.google.re2j.Machine::match@314 (line 243)
0.39% 0.40% ││ 0x00007fb44123b1e6: test %r8,%r8
││ 0x00007fb44123b1e9: jne 0x00007fb44123b86f ;*ifeq
││ ; - com.google.re2j.Machine$Queue::contains@16 (line 42)
││ ; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
││ ; - com.google.re2j.Machine::match@314 (line 243)
0.11% 0.14% ││ 0x00007fb44123b1ef: xor %ebp,%ebp ;*ireturn
││ ; - com.google.re2j.Machine$Queue::contains@24 (line 42)
││ ; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
││ ; - com.google.re2j.Machine::match@314 (line 243)
││ 0x00007fb44123b1f1: test %r8,%r8
││ 0x00007fb44123b1f4: jne 0x00007fb44123bc81 ;*ifeq
││ ; - com.google.re2j.Inst$MatchInst::add@8 (line 144)
││ ; - com.google.re2j.Machine::match@314 (line 243)
0.12% 0.10% ││ 0x00007fb44123b1fa: cmp $0x40,%ecx
││ 0x00007fb44123b1fd: jge 0x00007fb44123bcdd ;*if_icmpge
││ ; - com.google.re2j.Machine$Queue::add@3 (line 51)
││ ; - com.google.re2j.Inst$MatchInst::add@19 (line 147)
││ ; - com.google.re2j.Machine::match@314 (line 243)
0.50% 0.44% ││ 0x00007fb44123b203: mov 0x34(%rsp),%r8d
0.12% 0.09% ││ 0x00007fb44123b208: mov %r12b,0x18(%r12,%r8,8) ;*putfield empty
││ ; - com.google.re2j.Machine$Queue::add@33 (line 56)
││ ; - com.google.re2j.Inst$MatchInst::add@19 (line 147)
││ ; - com.google.re2j.Machine::match@314 (line 243)
0.02% 0.02% ││ 0x00007fb44123b20d: mov 0xc(%r12,%r8,8),%r11d ;*getfield size
││ ; - com.google.re2j.Machine$Queue::addThread@6 (line 66)
││ ; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
││ ; - com.google.re2j.Machine::match@314 (line 243)
0.14% 0.08% ││ 0x00007fb44123b212: mov 0x20(%r12,%r8,8),%r8d ;*getfield denseThreadsInstructions
││ ; - com.google.re2j.Machine$Queue::addThread@1 (line 66)
││ ; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
││ ; - com.google.re2j.Machine::match@314 (line 243)
0.36% 0.46% ││ 0x00007fb44123b217: or %r9,%r10
0.12% 0.15% ││ 0x00007fb44123b21a: mov 0x34(%rsp),%ecx
││ 0x00007fb44123b21e: mov %r10,0x10(%r12,%rcx,8) ;*putfield pcsl
││ ; - com.google.re2j.Machine$Queue::add@15 (line 52)
││ ; - com.google.re2j.Inst$MatchInst::add@19 (line 147)
││ ; - com.google.re2j.Machine::match@314 (line 243)
0.15% 0.17% ││ 0x00007fb44123b223: mov %r11d,%r9d
0.44% 0.37% ││ 0x00007fb44123b226: inc %r9d
0.09% 0.05% ││ 0x00007fb44123b229: mov %r9d,0xc(%r12,%rcx,8) ;*putfield size
││ ; - com.google.re2j.Machine$Queue::addThread@12 (line 66)
││ ; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
││ ; - com.google.re2j.Machine::match@314 (line 243)
0.02% 0.01% ││ 0x00007fb44123b22e: mov 0xc(%r12,%r8,8),%r9d ; implicit exception: dispatches to 0x00007fb44123ca05
0.15% 0.27% ││ 0x00007fb44123b233: cmp %r9d,%r11d
││ 0x00007fb44123b236: jae 0x00007fb44123b8fb
0.52% 0.31% ││ 0x00007fb44123b23c: mov 0x8(%r12,%r8,8),%r9d
0.11% 0.08% ││ 0x00007fb44123b241: cmp $0xf8019807,%r9d ; {metadata('com/google/re2j/Inst'[])}
││ 0x00007fb44123b248: jne 0x00007fb44123b9fd ;*aastore
││ ; - com.google.re2j.Machine$Queue::addThread@16 (line 66)
││ ; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
││ ; - com.google.re2j.Machine::match@314 (line 243)
0.02% 0.05% ││ 0x00007fb44123b24e: test %edi,%edi
╭ ││ 0x00007fb44123b250: jl 0x00007fb44123b2f6 ;*ifge
│ ││ ; - com.google.re2j.Utils::emptyOpContext@3 (line 173)
│ ││ ; - com.google.re2j.Machine::match@322 (line 245)
0.14% 0.07% │ ││ 0x00007fb44123b256: xor %r9d,%r9d ;*iload_0
│ ││ ; - com.google.re2j.Utils::emptyOpContext@10 (line 176)
│ ││ ; - com.google.re2j.Machine::match@322 (line 245)
0.50% 0.47% │ ││↗ 0x00007fb44123b259: cmp $0xa,%edi
│ │││ 0x00007fb44123b25c: je 0x00007fb44123b655 ;*iload_1
│ │││ ; - com.google.re2j.Utils::emptyOpContext@20 (line 179)
│ │││ ; - com.google.re2j.Machine::match@322 (line 245)
0.08% 0.13% │ │││ 0x00007fb44123b262: mov %ebx,%r10d
0.02% 0.03% │ │││ 0x00007fb44123b265: test %ebx,%ebx
│ │││ 0x00007fb44123b267: jl 0x00007fb44123b64c ;*iload_1
│ │││ ; - com.google.re2j.Utils::emptyOpContext@29 (line 182)
│ │││ ; - com.google.re2j.Machine::match@322 (line 245)
0.09% 0.09% │ │││ 0x00007fb44123b26d: cmp $0xa,%ebx
│ │││ 0x00007fb44123b270: je 0x00007fb44123b65e ;*iload_0
│ │││ ; - com.google.re2j.Utils::emptyOpContext@39 (line 185)
│ │││ ; - com.google.re2j.Machine::match@322 (line 245)
0.43% 0.46% │ │││ 0x00007fb44123b276: mov %r13,%rcx
0.09% 0.10% │ │││ 0x00007fb44123b279: shr $0x3,%rcx ;*aastore
│ │││ ; - com.google.re2j.Machine$Queue::addThread@16 (line 66)
│ │││ ; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
│ │││ ; - com.google.re2j.Machine::match@314 (line 243)
0.03% 0.05% │ │││ 0x00007fb44123b27d: shl $0x3,%r8 ;*getfield denseThreadsInstructions
│ │││ ; - com.google.re2j.Machine$Queue::addThread@1 (line 66)
│ │││ ; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
│ │││ ; - com.google.re2j.Machine::match@314 (line 243)
0.13% 0.11% │ │││ 0x00007fb44123b281: lea 0x10(%r8,%r11,4),%r11
0.55% 0.44% │ │││ 0x00007fb44123b286: mov %ecx,(%r11)
0.70% 0.78% │ │││ 0x00007fb44123b289: mov %edi,%ecx
0.02% 0.01% │ │││ 0x00007fb44123b28b: add $0xffffffbf,%ecx
0.06% 0.10% │ │││ 0x00007fb44123b28e: shr $0x9,%r11
0.30% 0.32% │ │││ 0x00007fb44123b292: movabs $0x7fb451f2f000,%r8
0.25% 0.40% │ │││ 0x00007fb44123b29c: mov %r12b,(%r8,%r11,1) ;*aastore
│ │││ ; - com.google.re2j.Machine$Queue::addThread@16 (line 66)
│ │││ ; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
│ │││ ; - com.google.re2j.Machine::match@314 (line 243)
0.37% 0.51% │ │││ 0x00007fb44123b2a0: cmp $0x1a,%ecx
│╭ │││ 0x00007fb44123b2a3: jb 0x00007fb44123b2b6 ;*if_icmple
││ │││ ; - com.google.re2j.Utils::isWordRune@9 (line 149)
││ │││ ; - com.google.re2j.Utils::emptyOpContext@40 (line 185)
││ │││ ; - com.google.re2j.Machine::match@322 (line 245)
0.03% 0.07% ││ │││ 0x00007fb44123b2a5: mov %edi,%r8d
0.20% 0.23% ││ │││ 0x00007fb44123b2a8: add $0xffffff9f,%r8d
0.23% 0.33% ││ │││ 0x00007fb44123b2ac: cmp $0x1a,%r8d
││ │││ 0x00007fb44123b2b0: jae 0x00007fb44123b823 ;*iconst_1
││ │││ ; - com.google.re2j.Utils::isWordRune@42 (line 149)
││ │││ ; - com.google.re2j.Utils::emptyOpContext@40 (line 185)
││ │││ ; - com.google.re2j.Machine::match@322 (line 245)
0.13% 0.18% │↘ │││ 0x00007fb44123b2b6: mov $0x1,%ebp ;*ireturn
│ │││ ; - com.google.re2j.Utils::isWordRune@47 (line 149)
│ │││ ; - com.google.re2j.Utils::emptyOpContext@40 (line 185)
│ │││ ; - com.google.re2j.Machine::match@322 (line 245)
0.06% 0.11% │ │││ 0x00007fb44123b2bb: mov %ebx,%r11d
0.23% 0.23% │ │││ 0x00007fb44123b2be: add $0xffffffbf,%r11d
0.24% 0.31% │ │││ 0x00007fb44123b2c2: cmp $0x1a,%r11d
│ ╭│││ 0x00007fb44123b2c6: jb 0x00007fb44123b2d9 ;*if_icmple
│ ││││ ; - com.google.re2j.Utils::isWordRune@9 (line 149)
│ ││││ ; - com.google.re2j.Utils::emptyOpContext@44 (line 185)
│ ││││ ; - com.google.re2j.Machine::match@322 (line 245)
0.14% 0.21% │ ││││ 0x00007fb44123b2c8: mov %ebx,%r8d
0.09% 0.09% │ ││││ 0x00007fb44123b2cb: add $0xffffff9f,%r8d
0.20% 0.30% │ ││││ 0x00007fb44123b2cf: cmp $0x1a,%r8d
│ ││││ 0x00007fb44123b2d3: jae 0x00007fb44123b844 ;*iconst_1
│ ││││ ; - com.google.re2j.Utils::isWordRune@42 (line 149)
│ ││││ ; - com.google.re2j.Utils::emptyOpContext@44 (line 185)
│ ││││ ; - com.google.re2j.Machine::match@322 (line 245)
0.20% 0.25% │ ↘│││ 0x00007fb44123b2d9: mov $0x1,%r11d ;*ireturn
│ │││ ; - com.google.re2j.Utils::isWordRune@47 (line 149)
│ │││ ; - com.google.re2j.Utils::emptyOpContext@44 (line 185)
│ │││ ; - com.google.re2j.Machine::match@322 (line 245)
0.15% 0.18% │ │││ 0x00007fb44123b2df: cmp %r11d,%ebp
│ ╰││ 0x00007fb44123b2e2: je 0x00007fb44123afc2 ;*if_icmpeq
│ ││ ; - com.google.re2j.Utils::emptyOpContext@47 (line 185)
│ ││ ; - com.google.re2j.Machine::match@322 (line 245)
0.16% 0.19% │ ││ 0x00007fb44123b2e8: or $0x10,%r9d ;*ior ; - com.google.re2j.Utils::emptyOpContext@53 (line 186)
│ ││ ; - com.google.re2j.Machine::match@322 (line 245)
0.04% 0.06% │ ││ 0x00007fb44123b2ec: mov %r9d,0x2c(%rsp)
0.37% 0.44% │ ╰│ 0x00007fb44123b2f1: jmpq 0x00007fb44123afcb
↘ │ 0x00007fb44123b2f6: mov $0x5,%r9d
╰ 0x00007fb44123b2fc: jmpq 0x00007fb44123b259
0x00007fb44123b301: mov %r11d,0x54(%rsp)
0.02% 0x00007fb44123b306: jmpq 0x00007fb44123b586
0x00007fb44123b30b: mov 0x54(%rsp),%r11d
0x00007fb44123b310: add $0x2,%r11d
0x00007fb44123b314: mov %r11d,0x54(%rsp)
0x00007fb44123b319: mov 0x54(%rsp),%r11d
0.00% 0x00007fb44123b31e: inc %r11d
0x00007fb44123b321: mov %r11d,0x50(%rsp)
0x00007fb44123b326: jmp 0x00007fb44123b353
0x00007fb44123b328: mov 0x54(%rsp),%r11d
0x00007fb44123b32d: add $0x2,%r11d
0x00007fb44123b331: mov %r11d,0x50(%rsp)
0x00007fb44123b336: jmp 0x00007fb44123b346
0x00007fb44123b338: mov 0x54(%rsp),%r11d
0x00007fb44123b33d: add $0x2,%r11d
0x00007fb44123b341: mov %r11d,0x54(%rsp)
0.00% 0x00007fb44123b346: mov 0x54(%rsp),%r11d
....................................................................................................
31.14% 33.33% <total for region 2>
....[Hottest Region 3]..............................................................................
C2, level 4, com.google.re2j.Machine::step, version 500 (466 bytes)
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Machine::step@202 (line 313)
; {optimized virtual_call}
0x00007fb441222930: test %rax,%rax
0x00007fb441222933: jne 0x00007fb441223459 ;*ifnull
; - com.google.re2j.Machine::step@209 (line 315)
0x00007fb441222939: mov 0x10(%rsp),%r11
0x00007fb44122293e: jmpq 0x00007fb441222584
0.14% 0.10% 0x00007fb441222943: cmp $0xf8019909,%r8d ; {metadata('com/google/re2j/Inst$MatchInst')}
0x00007fb44122294a: jne 0x00007fb44122312d ;*invokevirtual add
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.11% 0.06% 0x00007fb441222950: mov 0x18(%r10),%ecx ;*getfield pc
; - com.google.re2j.Inst$MatchInst::add@2 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.30% 0.27% 0x00007fb441222954: cmp $0x40,%ecx
0x00007fb441222957: jg 0x00007fb4412233dd ;*if_icmpgt
; - com.google.re2j.Machine$Queue::contains@3 (line 41)
; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.19% 0.06% 0x00007fb44122295d: mov $0x1,%r11d
0.05% 0.10% 0x00007fb441222963: shl %cl,%r11 ;*lshl
; - com.google.re2j.Machine$Queue::contains@12 (line 42)
; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.53% 0.80% 0x00007fb441222966: mov %rdi,%r8
0.09% 0.12% 0x00007fb441222969: and %r11,%r8 ;*land
; - com.google.re2j.Machine$Queue::contains@13 (line 42)
; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.10% 0.11% 0x00007fb44122296c: test %r8,%r8
0x00007fb44122296f: jne 0x00007fb441222b59 ;*ifeq
; - com.google.re2j.Machine$Queue::contains@16 (line 42)
; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.30% 0.41% 0x00007fb441222975: xor %ebp,%ebp ;*ireturn
; - com.google.re2j.Machine$Queue::contains@24 (line 42)
; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.15% 0.26% 0x00007fb441222977: test %r8,%r8
0x00007fb44122297a: jne 0x00007fb441223409 ;*ifeq
; - com.google.re2j.Inst$MatchInst::add@8 (line 144)
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.11% 0.10% 0x00007fb441222980: cmp $0x40,%ecx
0x00007fb441222983: jge 0x00007fb44122342d ;*if_icmpge
; - com.google.re2j.Machine$Queue::add@3 (line 51)
; - com.google.re2j.Inst$MatchInst::add@19 (line 147)
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.08% 0.08% 0x00007fb441222989: or %r11,%rdi
0.36% 0.36% 0x00007fb44122298c: mov %r13,%r11
0.15% 0.25% 0x00007fb44122298f: mov %rdi,0x10(%r11) ;*putfield pcsl
; - com.google.re2j.Machine$Queue::add@15 (line 52)
; - com.google.re2j.Inst$MatchInst::add@19 (line 147)
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.15% 0.12% 0x00007fb441222993: add $0x18,%rbx
0.09% 0.11% 0x00007fb441222997: mov %r10,%r8
0.31% 0.37% 0x00007fb44122299a: shr $0x3,%r8
0.18% 0.19% 0x00007fb44122299e: mov %r8d,(%rbx) ;*aastore
; - com.google.re2j.Machine$Queue::addThread@16 (line 66)
; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.09% 0.09% 0x00007fb4412229a1: mov %rbx,%r10
0.06% 0.09% 0x00007fb4412229a4: add $0x3,%eax
0.35% 0.33% 0x00007fb4412229a7: mov %eax,0xc(%r11) ;*putfield size
; - com.google.re2j.Machine$Queue::addThread@12 (line 66)
; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.15% 0.19% 0x00007fb4412229ab: shr $0x9,%r10
0.09% 0.09% 0x00007fb4412229af: movabs $0x7fb451f2f000,%r8
0.04% 0.05% 0x00007fb4412229b9: mov %r12b,(%r8,%r10,1) ;*aastore
; - com.google.re2j.Machine$Queue::addThread@16 (line 66)
; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
; - com.google.re2j.Inst$Alt2Inst::add@53 (line 181)
; - com.google.re2j.Inst$CaptureInst::add@95 (line 472)
; - com.google.re2j.Inst$Alt2Inst::add@-1 (line 175)
; - com.google.re2j.Machine::step@-1 (line 280)
0.35% 0.27% 0x00007fb4412229bd: jmpq 0x00007fb441222584
0.56% 0.67% 0x00007fb4412229c2: cmp $0xb,%ebp
0x00007fb4412229c5: je 0x00007fb441222d59 ;*if_icmpne
; - com.google.re2j.Inst::matchRune@17 (line 94)
; - com.google.re2j.Machine::step@181 (line 312)
0.58% 0.75% 0x00007fb4412229cb: mov 0x1c(%r12,%r9,8),%r8d ;*getfield f0
; - com.google.re2j.Inst::matchRune@42 (line 99)
; - com.google.re2j.Machine::step@181 (line 312)
0.03% 0.02% 0x00007fb4412229d0: cmp $0x9,%ebp
╭ 0x00007fb4412229d3: je 0x00007fb441222a1e ;*if_icmpne
│ ; - com.google.re2j.Inst::matchRune@38 (line 98)
│ ; - com.google.re2j.Machine::step@181 (line 312)
0.41% 0.48% │ 0x00007fb4412229d5: cmp $0xc,%ebp
│ 0x00007fb4412229d8: jne 0x00007fb44122306d ;*if_icmpne
│ ; - com.google.re2j.Inst::matchRune@61 (line 102)
│ ; - com.google.re2j.Machine::step@181 (line 312)
0.37% 0.42% │ 0x00007fb4412229de: cmp 0x28(%rsp),%r8d
│╭ 0x00007fb4412229e3: je 0x00007fb441222b10 ;*if_icmpeq
││ ; - com.google.re2j.Inst::matchRune@69 (line 103)
││ ; - com.google.re2j.Machine::step@181 (line 312)
0.21% 0.30% ││ 0x00007fb4412229e9: mov 0x20(%r12,%r9,8),%r8d ;*getfield f1
││ ; - com.google.re2j.Inst::matchRune@73 (line 103)
││ ; - com.google.re2j.Machine::step@181 (line 312)
0.00% 0.01% ││ 0x00007fb4412229ee: cmp 0x28(%rsp),%r8d
││╭ 0x00007fb4412229f3: je 0x00007fb441222b10 ;*if_icmpeq
│││ ; - com.google.re2j.Inst::matchRune@77 (line 103)
│││ ; - com.google.re2j.Machine::step@181 (line 312)
0.37% 0.47% │││ 0x00007fb4412229f9: mov 0x24(%r12,%r9,8),%ebp ;*getfield f2
│││ ; - com.google.re2j.Inst::matchRune@81 (line 103)
│││ ; - com.google.re2j.Machine::step@181 (line 312)
0.14% 0.16% │││ 0x00007fb4412229fe: cmp 0x28(%rsp),%ebp
│││ 0x00007fb441222a02: je 0x00007fb4412230bd ;*if_icmpeq
│││ ; - com.google.re2j.Inst::matchRune@85 (line 103)
│││ ; - com.google.re2j.Machine::step@181 (line 312)
0.41% 0.34% │││ 0x00007fb441222a08: mov 0x28(%r12,%r9,8),%ebp ;*getfield f3
│││ ; - com.google.re2j.Inst::matchRune@89 (line 103)
│││ ; - com.google.re2j.Machine::step@181 (line 312)
0.00% 0.02% │││ 0x00007fb441222a0d: cmp 0x28(%rsp),%ebp
│││ 0x00007fb441222a11: je 0x00007fb4412230f5 ;*if_icmpne
│││ ; - com.google.re2j.Inst::matchRune@93 (line 103)
│││ ; - com.google.re2j.Machine::step@181 (line 312)
0.22% 0.33% │││ 0x00007fb441222a17: xor %ecx,%ecx
0.11% 0.12% │││ 0x00007fb441222a19: jmpq 0x00007fb4412224f2
1.14% 1.19% ↘││ 0x00007fb441222a1e: cmp 0x28(%rsp),%r8d
││ 0x00007fb441222a23: jne 0x00007fb4412224f0 ;*if_icmpne
││ ; - com.google.re2j.Inst::matchRune@46 (line 99)
││ ; - com.google.re2j.Machine::step@181 (line 312)
0.01% 0.01% ││ 0x00007fb441222a29: mov $0x1,%ecx
││ 0x00007fb441222a2e: jmpq 0x00007fb4412224f2 ;*if_icmpge
││ ; - com.google.re2j.Machine::step@22 (line 282)
0.66% 0.89% ││ 0x00007fb441222a33: movzbl 0x18(%rax),%r10d
0.00% ││ 0x00007fb441222a38: test %r10d,%r10d
││╭ 0x00007fb441222a3b: jne 0x00007fb441222a54 ;*ifeq
│││ ; - com.google.re2j.Machine$Queue::clear@4 (line 69)
│││ ; - com.google.re2j.Machine::step@225 (line 319)
0.01% │││ 0x00007fb441222a3d: movb $0x1,0x18(%rax) ;*putfield empty
│││ ; - com.google.re2j.Machine$Queue::clear@15 (line 71)
│││ ; - com.google.re2j.Machine::step@225 (line 319)
│││ 0x00007fb441222a41: mov 0x1c(%rax),%ebp ;*getfield pcs
│││ ; - com.google.re2j.Machine$Queue::clear@29 (line 73)
│││ ; - com.google.re2j.Machine::step@225 (line 319)
0.78% 0.70% │││ 0x00007fb441222a44: mov %r12d,0xc(%rax) ;*putfield size
│││ ; - com.google.re2j.Machine$Queue::clear@10 (line 70)
│││ ; - com.google.re2j.Machine::step@225 (line 319)
0.00% 0.00% │││ 0x00007fb441222a48: mov %r12,0x10(%rax) ;*putfield pcsl
│││ ; - com.google.re2j.Machine$Queue::clear@25 (line 72)
│││ ; - com.google.re2j.Machine::step@225 (line 319)
0.01% │││ 0x00007fb441222a4c: test %ebp,%ebp
│││ 0x00007fb441222a4e: jne 0x00007fb4412230a5 ;*getfield size
│││ ; - com.google.re2j.Machine::step@10 (line 281)
0.00% ││↘ 0x00007fb441222a54: add $0x80,%rsp
0.69% 0.84% ││ 0x00007fb441222a5b: pop %rbp
││ 0x00007fb441222a5c: test %eax,0x1830459e(%rip) # 0x00007fb459527000
││ ; {poll_return}
0.00% ││ 0x00007fb441222a62: retq
0.02% 0.01% ││ 0x00007fb441222a63: cmp $0xf8019909,%ebx ; {metadata('com/google/re2j/Inst$MatchInst')}
││ 0x00007fb441222a69: jne 0x00007fb441223509 ;*invokevirtual add
││ ; - com.google.re2j.Machine::step@202 (line 313)
0.01% ││ 0x00007fb441222a6f: mov 0x18(%r8),%edx ;*getfield pc
││ ; - com.google.re2j.Inst$MatchInst::add@2 (line 144)
││ ; - com.google.re2j.Machine::step@202 (line 313)
││ 0x00007fb441222a73: mov 0x10(%r11),%rbx ;*getfield pcsl
││ ; - com.google.re2j.Machine$Queue::contains@7 (line 42)
││ ; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
││ ; - com.google.re2j.Machine::step@202 (line 313)
││ ; implicit exception: dispatches to 0x00007fb4412237f9
││ 0x00007fb441222a77: cmp $0x40,%edx
││ 0x00007fb441222a7a: jg 0x00007fb4412235b9 ;*if_icmpgt
││ ; - com.google.re2j.Machine$Queue::contains@3 (line 41)
││ ; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
││ ; - com.google.re2j.Machine::step@202 (line 313)
0.02% 0.03% ││ 0x00007fb441222a80: mov $0x1,%edi
0.00% ││ 0x00007fb441222a85: mov %edx,%ecx
││ 0x00007fb441222a87: shl %cl,%rdi ;*lshl
││ ; - com.google.re2j.Machine$Queue::contains@12 (line 42)
││ ; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
││ ; - com.google.re2j.Machine::step@202 (line 313)
0.04% 0.02% ││ 0x00007fb441222a8a: mov %rbx,%r9
││ 0x00007fb441222a8d: and %rdi,%r9 ;*land
││ ; - com.google.re2j.Machine$Queue::contains@13 (line 42)
││ ; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
││ ; - com.google.re2j.Machine::step@202 (line 313)
││ 0x00007fb441222a90: test %r9,%r9
││ 0x00007fb441222a93: jne 0x00007fb441222b63 ;*ifeq
││ ; - com.google.re2j.Machine$Queue::contains@16 (line 42)
││ ; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
││ ; - com.google.re2j.Machine::step@202 (line 313)
0.01% ││ 0x00007fb441222a99: xor %ebp,%ebp ;*ireturn
││ ; - com.google.re2j.Machine$Queue::contains@24 (line 42)
││ ; - com.google.re2j.Inst$MatchInst::add@5 (line 144)
││ ; - com.google.re2j.Machine::step@202 (line 313)
0.01% 0.00% ││ 0x00007fb441222a9b: test %r9,%r9
││ 0x00007fb441222a9e: jne 0x00007fb441223619 ;*ifeq
││ ; - com.google.re2j.Inst$MatchInst::add@8 (line 144)
││ ; - com.google.re2j.Machine::step@202 (line 313)
││ 0x00007fb441222aa4: cmp $0x40,%edx
││ 0x00007fb441222aa7: jge 0x00007fb44122366d ;*if_icmpge
││ ; - com.google.re2j.Machine$Queue::add@3 (line 51)
││ ; - com.google.re2j.Inst$MatchInst::add@19 (line 147)
││ ; - com.google.re2j.Machine::step@202 (line 313)
││ 0x00007fb441222aad: mov %r12b,0x18(%r11) ;*putfield empty
││ ; - com.google.re2j.Machine$Queue::add@33 (line 56)
││ ; - com.google.re2j.Inst$MatchInst::add@19 (line 147)
││ ; - com.google.re2j.Machine::step@202 (line 313)
0.01% 0.01% ││ 0x00007fb441222ab1: mov 0x20(%r11),%r9d ;*getfield denseThreadsInstructions
││ ; - com.google.re2j.Machine$Queue::addThread@1 (line 66)
││ ; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
││ ; - com.google.re2j.Machine::step@202 (line 313)
0.01% ││ 0x00007fb441222ab5: or %rbx,%rdi
0.00% ││ 0x00007fb441222ab8: mov %rdi,0x10(%r11) ;*putfield pcsl
││ ; - com.google.re2j.Machine$Queue::add@15 (line 52)
││ ; - com.google.re2j.Inst$MatchInst::add@19 (line 147)
││ ; - com.google.re2j.Machine::step@202 (line 313)
││ 0x00007fb441222abc: mov 0xc(%r11),%ebp ;*getfield size
││ ; - com.google.re2j.Machine$Queue::addThread@6 (line 66)
││ ; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
││ ; - com.google.re2j.Machine::step@202 (line 313)
0.00% 0.00% ││ 0x00007fb441222ac0: mov %ebp,%ebx
0.02% 0.01% ││ 0x00007fb441222ac2: inc %ebx
││ 0x00007fb441222ac4: mov %ebx,0xc(%r11) ;*putfield size
││ ; - com.google.re2j.Machine$Queue::addThread@12 (line 66)
││ ; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
││ ; - com.google.re2j.Machine::step@202 (line 313)
││ 0x00007fb441222ac8: mov 0xc(%r12,%r9,8),%ebx ; implicit exception: dispatches to 0x00007fb44122380d
0.01% 0.01% ││ 0x00007fb441222acd: cmp %ebx,%ebp
││ 0x00007fb441222acf: jae 0x00007fb4412234ad
0.01% ││ 0x00007fb441222ad5: mov 0x8(%r12,%r9,8),%ebx
0.01% 0.01% ││ 0x00007fb441222ada: cmp $0xf8019807,%ebx ; {metadata('com/google/re2j/Inst'[])}
││ 0x00007fb441222ae0: jne 0x00007fb44122355d ;*aastore
││ ; - com.google.re2j.Machine$Queue::addThread@16 (line 66)
││ ; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
││ ; - com.google.re2j.Machine::step@202 (line 313)
││ 0x00007fb441222ae6: shl $0x3,%r9 ;*getfield denseThreadsInstructions
││ ; - com.google.re2j.Machine$Queue::addThread@1 (line 66)
││ ; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
││ ; - com.google.re2j.Machine::step@202 (line 313)
││ 0x00007fb441222aea: lea 0x10(%r9,%rbp,4),%r9
0.00% 0.01% ││ 0x00007fb441222aef: shr $0x3,%r8
││ 0x00007fb441222af3: mov %r8d,(%r9)
0.06% 0.01% ││ 0x00007fb441222af6: mov %r9,%r8
0.00% 0.00% ││ 0x00007fb441222af9: shr $0x9,%r8
0.01% ││ 0x00007fb441222afd: movabs $0x7fb451f2f000,%r9
││ 0x00007fb441222b07: mov %r12b,(%r9,%r8,1) ;*aastore
││ ; - com.google.re2j.Machine$Queue::addThread@16 (line 66)
││ ; - com.google.re2j.Inst$MatchInst::add@75 (line 158)
││ ; - com.google.re2j.Machine::step@202 (line 313)
0.05% 0.01% ││ 0x00007fb441222b0b: jmpq 0x00007fb441222599 ;*iconst_1
││ ; - com.google.re2j.Inst::matchRune@96 (line 103)
││ ; - com.google.re2j.Machine::step@181 (line 312)
0.14% 0.15% ↘↘ 0x00007fb441222b10: mov $0x1,%ecx
0.09% 0.07% 0x00007fb441222b15: jmpq 0x00007fb4412224f2
0x00007fb441222b1a: mov $0x1,%ebp
0x00007fb441222b1f: jmpq 0x00007fb441222681
0x00007fb441222b24: mov $0x1,%ebp
0x00007fb441222b29: jmpq 0x00007fb441222772
0x00007fb441222b2e: mov %ecx,%ebx
0x00007fb441222b30: mov %r11,%rcx
0x00007fb441222b33: mov $0x1,%ebp
0x00007fb441222b38: jmpq 0x00007fb441222537
0x00007fb441222b3d: mov %r13,%r11
0x00007fb441222b40: jmpq 0x00007fb441222584
....................................................................................................
11.77% 13.12% <total for region 3>
....[Hottest Regions]...............................................................................
45.75% 42.75% C2, level 4 com.google.re2j.Machine::step, version 500 (797 bytes)
31.14% 33.33% C2, level 4 com.google.re2j.Machine::match, version 540 (923 bytes)
11.77% 13.12% C2, level 4 com.google.re2j.Machine::step, version 500 (466 bytes)
5.31% 5.42% C2, level 4 com.google.re2j.Machine::step, version 500 (90 bytes)
1.84% 1.84% [kernel.kallsyms] [unknown] (0 bytes)
0.61% 0.79% C2, level 4 com.google.re2j.Machine::match, version 540 (62 bytes)
0.17% 0.11% C2, level 4 com.google.re2j.Pattern::find, version 556 (20 bytes)
0.16% 0.12% C2, level 4 com.google.re2j.Machine::match, version 540 (309 bytes)
0.16% 0.11% C2, level 4 com.google.re2j.Machine::match, version 540 (230 bytes)
0.14% 0.07% C2, level 4 com.google.re2j.Pattern::find, version 556 (8 bytes)
0.12% 0.15% C2, level 4 com.google.re2j.Pattern::find, version 556 (20 bytes)
0.12% 0.02% C2, level 4 java.util.Collections::shuffle, version 565 (228 bytes)
0.11% C2, level 4 com.google.re2j.Pattern::find, version 556 (112 bytes)
0.10% 0.01% [kernel.kallsyms] [unknown] (2 bytes)
0.09% 0.01% [kernel.kallsyms] [unknown] (49 bytes)
0.09% 0.10% C2, level 4 com.google.re2j.Pattern::find, version 556 (8 bytes)
0.08% 0.07% C2, level 4 com.google.re2j.Machine::match, version 540 (234 bytes)
0.08% C2, level 4 com.google.re2j.Pattern::find, version 556 (113 bytes)
0.08% 0.09% C2, level 4 java.util.Collections::shuffle, version 565 (35 bytes)
0.06% 0.06% C2, level 4 com.google.re2j.Machine::match, version 540 (212 bytes)
2.03% 1.83% <...other 387 warm regions...>
....................................................................................................
100.00% 100.00% <totals>
....[Hottest Methods (after inlining)]..............................................................
62.84% 61.30% C2, level 4 com.google.re2j.Machine::step, version 500
32.37% 34.57% C2, level 4 com.google.re2j.Machine::match, version 540
2.79% 2.57% [kernel.kallsyms] [unknown]
0.85% 0.44% C2, level 4 com.google.re2j.Pattern::find, version 556
0.24% 0.12% C2, level 4 java.util.Collections::shuffle, version 565
0.14% 0.06% C2, level 4 com.github.arnaudroger.re2j.generated.Re2jFindRegex_testExp1_jmhTest::testExp1_thrpt_jmhStub, version 596
0.07% 0.04% libjvm.so _ZN19GenericTaskQueueSetI17OverflowTaskQueueI8StarTaskL10MemoryType1ELj131072EELS2_1EE15steal_best_of_2EjPiRS1_
0.06% 0.03% [vdso] [unknown]
0.05% 0.02% hsdis-amd64.so decode_instructions
0.03% 0.05% libjvm.so _ZN18PSPromotionManager22copy_to_survivor_spaceILb0EEEP7oopDescS2_
0.03% 0.07% libjvm.so _ZN10fileStream5writeEPKcm
0.03% 0.00% libc-2.26.so __clock_gettime
0.03% 0.09% libjvm.so _ZN13RelocIterator10initializeEP7nmethodPhS2_
0.02% C2, level 4 org.openjdk.jmh.infra.Blackhole::consume, version 557
0.02% 0.01% libjvm.so _ZN18PSPromotionManager18drain_stacks_depthEb
0.02% libjvm.so _ZN2os13javaTimeNanosEv
0.01% 0.04% libc-2.26.so _IO_fwrite
0.01% 0.02% libjvm.so _ZN13xmlTextStream5writeEPKcm
0.01% 0.00% runtime stub StubRoutines::jint_disjoint_arraycopy
0.01% 0.02% libc-2.26.so _IO_fflush
0.35% 0.26% <...other 63 warm methods...>
....................................................................................................
100.00% 99.72% <totals>
....[Distribution by Source]........................................................................
96.45% 96.49% C2, level 4
2.79% 2.57% [kernel.kallsyms]
0.42% 0.56% libjvm.so
0.14% 0.26% libc-2.26.so
0.06% 0.03% [vdso]
0.05% 0.02% hsdis-amd64.so
0.03% 0.04% libpthread-2.26.so
0.03% 0.01% interpreter
0.01% 0.00% runtime stub
0.00% libnet.so
0.00% C1, level 3
....................................................................................................
100.00% 100.00% <totals>
# Run complete. Total time: 00:00:45
Benchmark Mode Cnt Score Error Units
Re2jFindRegex.testExp1 thrpt 20 21112.338 ± 527.635 ops/s
Re2jFindRegex.testExp1:·asm thrpt NaN ---
| 95.130051 | 150 | 0.39709 |
0c7942973839d872711b9f1a9088d3281915f41e | 5,563 | htm | HTML | _data/Vol14_Ch0701-0853/HRS0846E/HRS_0846E-0004.htm | bronsonavila/hrsscraper | ecbb1048ab284af361fae78adb481eff554b067a | [
"MIT"
] | 1 | 2019-02-22T10:35:29.000Z | 2019-02-22T10:35:29.000Z | _data/Vol14_Ch0701-0853/HRS0846E/HRS_0846E-0004.htm | bronsonavila/hrsscraper | ecbb1048ab284af361fae78adb481eff554b067a | [
"MIT"
] | null | null | null | _data/Vol14_Ch0701-0853/HRS0846E/HRS_0846E-0004.htm | bronsonavila/hrsscraper | ecbb1048ab284af361fae78adb481eff554b067a | [
"MIT"
] | null | null | null | <div class="WordSection1">
<p class="RegularParagraphs"> <b>§846E-4 </b><b>Duties upon discharge, parole, or release of covered offender.</b> (a) Each person, or that person's designee, in charge of a jail, prison, hospital, school, or other institution to which a covered offender has been committed pursuant to a conviction, or an acquittal or finding of unfitness to proceed pursuant to chapter 704, for a covered offense, and each judge, or that judge's designee, who continues bail for or releases a covered offender following sentencing and the entry of a judgment of conviction, who releases a covered offender on probation or who discharges a covered offender upon payment of a fine, and each agency having jurisdiction, shall, prior to the discharge, parole, or release of the covered offender:</p>
<p class="1Paragraph"> (1) Explain to the covered offender the duty to register and the consequences of failing to register under this chapter;</p>
<p class="1Paragraph"> (2) Obtain from the covered offender all of the registration information required by this chapter;</p>
<p class="1Paragraph"> (3) Inform the covered offender that if at any time the covered offender changes any of the covered offender's registration information, the covered offender shall notify the attorney general of the new registration information in writing within three working days;</p>
<p class="1Paragraph"> (4) Inform the covered offender that, if at any time the covered offender changes residence to another state, the covered offender shall register the new address with the attorney general and also with a designated law enforcement agency in the new state, if the new state has a registration requirement, within the period of time mandated by the new state's sex offender registration laws;</p>
<p class="1Paragraph"> (5) Obtain and verify fingerprints and a photograph of the covered offender, if these have not already been obtained or verified in connection with the offense that triggers the registration;</p>
<p class="1Paragraph"> (6) Require the covered offender to sign a statement indicating that the duty to register has been explained to the covered offender; and</p>
<p class="1Paragraph"> (7) Give one copy of the signed statement and one copy of the registration information to the covered offender.</p>
<p class="RegularParagraphs"> (b) No covered offender required to register under this chapter shall be discharged, released from any confinement, or placed on parole or probation unless the requirements of subsection (a) have been satisfied and all registration information required under section 846E-2 has been obtained.</p>
<p class="RegularParagraphs"> (c) Notwithstanding any law to the contrary, a copy of the signed statement and one copy of the registration information shall be transmitted to the attorney general within three working days.</p>
<p class="RegularParagraphs"> (d) Following receipt of the information from the agency having jurisdiction over the covered offender, the attorney general immediately shall enter the information into a statewide record system, unless the information has been previously entered into a statewide record system, and notify the county police department or appropriate law enforcement agency having jurisdiction where the covered offender expects to reside. The attorney general immediately shall transmit the conviction data and verified fingerprints to the Federal Bureau of Investigation, unless the items have been previously transmitted to the Federal Bureau of Investigation.</p>
<p class="RegularParagraphs"> (e) The chief of police shall transmit any covered offender registration information required by this chapter to the attorney general, by entering the information into a statewide record system, if the information has not previously been entered into the system, and also shall provide the attorney general with a photograph and fingerprints of the covered offender, taken at the time the covered offender registers with the chief of police. The covered offender shall report in person every five years until June 30, 2009, and beginning on July 1, 2009, every year, within the thirty-day period following the offender's date of birth, to the chief of police where the covered offender's residence is located, or to such other department or agency that may be designated by the attorney general in rules adopted pursuant to chapter 91 for purposes of the administration of this subsection, and shall review the existing information in the registry that is within the offender's knowledge, correct any information that has changed or is inaccurate, provide any new information that may be required, and allow the police and such other department or agency designated by the attorney general to take a current photograph of the offender. [L 1997, c 316, pt of §2; am L 1998, c 194, §§4 to 6; am L 2003, c 62, §§6, 7; am L 2005, c 45, §6; am L 2008, c 80, §7; am L 2013, c 64, §6]</p>
<p class="RegularParagraphs"></p>
<p class="XNotesHeading">Note</p>
<p class="XNotes"></p>
<p class="XNotes"> The 2013 amendment applies to any acts committed prior to, on, or after April 30, 2013. L 2013, c 64, §11.</p>
<p class="XNotes"></p>
<p class="XNotesHeading">Case Notes</p>
<p class="XNotes"></p>
<p class="XNotes"> As the registration requirements of chapter 846E do not interfere with any of a sex offender's protected liberty interests, the protections of procedural due process are not triggered. 97 H. 285, 36 P.3d 1255 (2001).</p>
<p class="XNotes"></p>
<p class="XNotes"></p>
</div> | 231.791667 | 1,411 | 0.789143 |
04f61b5b0710f713eaa6949da25d6cc080089d0f | 1,903 | java | Java | src/main/java/org/workholiday/coffeemaker/util/PropertiesUtil.java | MrHunterZhao/CoffeeMaker | b77acc43a1deec94d65488aae12aabea08e78fef | [
"Apache-2.0"
] | 13 | 2017-12-06T02:45:23.000Z | 2018-07-25T09:56:44.000Z | src/main/java/org/workholiday/coffeemaker/util/PropertiesUtil.java | MrHunterZhao/CoffeeMaker | b77acc43a1deec94d65488aae12aabea08e78fef | [
"Apache-2.0"
] | null | null | null | src/main/java/org/workholiday/coffeemaker/util/PropertiesUtil.java | MrHunterZhao/CoffeeMaker | b77acc43a1deec94d65488aae12aabea08e78fef | [
"Apache-2.0"
] | 6 | 2017-12-06T03:34:49.000Z | 2018-07-17T01:53:47.000Z | package org.workholiday.coffeemaker.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
/**
* Author: Hunter Zhao
* Mail: zhaohevip@gmail.com
* Date: 20:35 07/14/2017
* Version: 1.0
* Description: 配置文件工具类
*/
public class PropertiesUtil {
private static Logger logger = LoggerFactory.getLogger(PropertiesUtil.class);
private static final String CONFIG_FILE = "config.properties";
private PropertiesUtil() {
// to avoid creating instance
}
/** 配置文件对象 */
private static Properties props;
/** PropertiesUtil实例 */
private static PropertiesUtil instance;
/**
* 获取PropertiesUtil实例
* @return
*/
public static PropertiesUtil getInstance() {
if (instance == null) {
instance = new PropertiesUtil();
}
return instance;
}
/**
* 加载properties
*/
private void loadProperties() {
ClassLoader loader = PropertiesUtil.class.getClassLoader();
InputStream in = null;
try {
in = loader.getResourceAsStream(CONFIG_FILE);
props = new Properties();
props.load(in);
} catch (IOException e) {
logger.error("Error loading properties file.", e);
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
// ignored
}
}
}
}
/**
* 确保properties不为空
*/
private void ensure() {
if (props == null) {
this.loadProperties();
}
}
/**
* 获取配置项
* @param key
* @return
*/
public String getProperty(String key) {
ensure();
return props.getProperty(key);
}
}
| 21.144444 | 81 | 0.54598 |
ba9af419ea05a8d41f327385822dee0ca48d13f3 | 4,319 | psm1 | PowerShell | data/train/powershell/ba9af419ea05a8d41f327385822dee0ca48d13f3League.psm1 | aliostad/deep-learning-lang-detection | d6b031f3ebc690cf2ffd0ae1b08ffa8fb3b38a62 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/train/powershell/ba9af419ea05a8d41f327385822dee0ca48d13f3League.psm1 | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2018-03-29T11:50:46.000Z | 2021-04-26T13:33:18.000Z | data/train/powershell/ba9af419ea05a8d41f327385822dee0ca48d13f3League.psm1 | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | Function Get-LeagueBySummoner
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true,
ParameterSetName='ID')]
[string[]]$ID,
[Parameter(Mandatory=$true,
ParameterSetName='Name')]
[string[]]$Name,
[ValidateSet('br', 'eune', 'euw', 'kr', 'lan', 'las', 'na', 'oce', 'ru', 'tr')]
[string]$Region = 'na'
)
If($PSCmdlet.ParameterSetName -eq 'Name')
{
$summoner = Get-Summoner -Name $Name -Region $Region
}
ElseIf($PSCmdlet.ParameterSetName -eq 'ID')
{
$summoner = Get-Summoner -ID $ID -Region $Region
}
$results = Invoke-RiotRestMethod -BaseUri "https://$Region.api.pvp.net/api/lol/$Region/v2.5/league/by-summoner/" -Parameter $summoner.id
Foreach($result in $results)
{
$summonerName = $summoner | Where-Object {$_.id -eq $result.participantId} | Select-Object -ExpandProperty Name
$result | Add-Member -MemberType NoteProperty -Name participantName -Value $summonerName
$result
}
}
Function Get-LeagueEntryBySummoner
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true,
ParameterSetName='ID')]
[string[]]$ID,
[Parameter(Mandatory=$true,
ParameterSetName='Name')]
[string[]]$Name,
[ValidateSet('br', 'eune', 'euw', 'kr', 'lan', 'las', 'na', 'oce', 'ru', 'tr')]
[string]$Region = 'na'
)
If($PSCmdlet.ParameterSetName -eq 'Name')
{
$summoner = Get-Summoner -Name $Name -Region $Region
}
ElseIf($PSCmdlet.ParameterSetName -eq 'ID')
{
$summoner = Get-Summoner -ID $ID -Region $Region
}
$results = Invoke-RiotRestMethod -BaseUri "https://$Region.api.pvp.net/api/lol/$Region/v2.5/league/by-summoner/" -Parameter $summoner.id -Method '/entry'
Foreach($result in $results)
{
$summonerName = $summoner | Where-Object {$_.id -eq $result.participantId} | Select-Object -ExpandProperty Name
$result | Add-Member -MemberType NoteProperty -Name participantName -Value $summonerName
$result
}
}
Function Get-LeagueByTeam
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true)]
[string[]]$TeamID,
[ValidateSet('br', 'eune', 'euw', 'kr', 'lan', 'las', 'na', 'oce', 'ru', 'tr')]
[string]$Region = 'na'
)
Invoke-RiotRestMethod -BaseUri "https://$Region.api.pvp.net/api/lol/$Region/v2.5/league/by-team/" -Parameter $TeamID
}
Function Get-LeagueEntryByTeam
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true)]
[string[]]$TeamID,
[ValidateSet('br', 'eune', 'euw', 'kr', 'lan', 'las', 'na', 'oce', 'ru', 'tr')]
[string]$Region = 'na'
)
Invoke-RiotRestMethod -BaseUri "https://$Region.api.pvp.net/api/lol/$Region/v2.5/league/by-team/" -Parameter $TeamID -Method '/entry'
}
Function Get-ChallengerLeague
{
[CmdletBinding()]
Param
(
[ValidateSet('br', 'eune', 'euw', 'kr', 'lan', 'las', 'na', 'oce', 'ru', 'tr')]
[string]$Region = 'na',
[ValidateSet('Solo', 'Team3', 'Team5')]
[Parameter(Mandatory=$true)]
[string]$LeagueType
)
Switch($LeagueType)
{
'Solo'
{
$type = 'RANKED_SOLO_5x5'
}
'Team3'
{
$type = 'RANKED_TEAM_3x3'
}
'Team5'
{
$type = 'RANKED_TEAM_5x5'
}
}
$league = Invoke-RiotRestMethod -BaseUri "https://$Region.api.pvp.net/api/lol/$Region/v2.5/league/challenger" -Query "type=$type&"
$league.entries
}
Function Get-MasterLeague
{
[CmdletBinding()]
Param
(
[ValidateSet('br', 'eune', 'euw', 'kr', 'lan', 'las', 'na', 'oce', 'ru', 'tr')]
[string]$Region = 'na',
[ValidateSet('Solo', 'Team3', 'Team5')]
[Parameter(Mandatory=$true)]
[string]$LeagueType
)
Switch($LeagueType)
{
'Solo'
{
$type = 'RANKED_SOLO_5x5'
}
'Team3'
{
$type = 'RANKED_TEAM_3x3'
}
'Team5'
{
$type = 'RANKED_TEAM_5x5'
}
}
$league = Invoke-RiotRestMethod -BaseUri "https://$Region.api.pvp.net/api/lol/$Region/v2.5/league/master" -Query "type=$type&"
$league.entries
} | 29.380952 | 157 | 0.559852 |
df8ba986686d754ebac1299e1fbb3d71918333b4 | 895 | ts | TypeScript | native/queries/cartItems/add.ts | keenplify/public-market-mobile-app | b96bfc1120a773770636eeef9e61df4c3414b30f | [
"MIT"
] | null | null | null | native/queries/cartItems/add.ts | keenplify/public-market-mobile-app | b96bfc1120a773770636eeef9e61df4c3414b30f | [
"MIT"
] | null | null | null | native/queries/cartItems/add.ts | keenplify/public-market-mobile-app | b96bfc1120a773770636eeef9e61df4c3414b30f | [
"MIT"
] | null | null | null | import AsyncStorage from "@react-native-async-storage/async-storage";
import axios, { AxiosResponse } from "axios";
import { SERVER_API } from "../../helpers/string";
import { CartItem, Product } from "../../helpers/types";
interface AddCartItemResponse {
message: string;
cartItem: CartItem;
}
interface Props {
product: Partial<Product>;
quantity: number;
}
export const AddCartItemQuery = async ({ product, quantity }: Props) => {
const asToken = await AsyncStorage.getItem("token");
if (asToken === null || !asToken) return null;
try {
const response: AxiosResponse<AddCartItemResponse> = await axios.post(
SERVER_API + "/api/cartitems/add",
{ productId: product.id, quantity },
{
headers: {
Authorization: "Bearer " + asToken,
},
}
);
return response.data;
} catch (error) {
console.log(error);
}
};
| 24.189189 | 74 | 0.64581 |
801758ae21ff80cd2393107844ba0e76c756cacc | 676 | java | Java | src/main/java/net/minecraft/world/gen/feature/BlockStateProvidingFeatureConfig.java | grialion/Modern-Utility | 4f1f75748ca83b8ccde5ed79bf3816c52ff425ec | [
"MIT"
] | null | null | null | src/main/java/net/minecraft/world/gen/feature/BlockStateProvidingFeatureConfig.java | grialion/Modern-Utility | 4f1f75748ca83b8ccde5ed79bf3816c52ff425ec | [
"MIT"
] | null | null | null | src/main/java/net/minecraft/world/gen/feature/BlockStateProvidingFeatureConfig.java | grialion/Modern-Utility | 4f1f75748ca83b8ccde5ed79bf3816c52ff425ec | [
"MIT"
] | null | null | null | package net.minecraft.world.gen.feature;
import com.mojang.serialization.Codec;
import net.minecraft.world.gen.blockstateprovider.BlockStateProvider;
public class BlockStateProvidingFeatureConfig implements IFeatureConfig
{
public static final Codec<BlockStateProvidingFeatureConfig> field_236453_a_ = BlockStateProvider.CODEC.fieldOf("state_provider").xmap(BlockStateProvidingFeatureConfig::new, (p_236454_0_) ->
{
return p_236454_0_.field_227268_a_;
}).codec();
public final BlockStateProvider field_227268_a_;
public BlockStateProvidingFeatureConfig(BlockStateProvider p_i225830_1_)
{
this.field_227268_a_ = p_i225830_1_;
}
}
| 35.578947 | 193 | 0.797337 |
2f67d9071f09b18ce23710d883499ba50b99bcf3 | 1,662 | cs | C# | Tethered.Client.Tests.Unit/Protocol/TetheredTcpSocketClientTests.cs | zixoan/tethered | 26fb5f4ddb91426501534173bd901bbd99dc732c | [
"BSD-3-Clause"
] | null | null | null | Tethered.Client.Tests.Unit/Protocol/TetheredTcpSocketClientTests.cs | zixoan/tethered | 26fb5f4ddb91426501534173bd901bbd99dc732c | [
"BSD-3-Clause"
] | null | null | null | Tethered.Client.Tests.Unit/Protocol/TetheredTcpSocketClientTests.cs | zixoan/tethered | 26fb5f4ddb91426501534173bd901bbd99dc732c | [
"BSD-3-Clause"
] | null | null | null | // SPDX-FileCopyrightText: 2022 zixoan
//
// SPDX-License-Identifier: BSD-3-Clause
using System.Net;
using System.Threading.Tasks;
using FluentAssertions;
using Xunit;
using Zixoan.Tethered.Client.Protocol;
using Zixoan.Tethered.Core;
using Zixoan.Tethered.Core.Buffer;
namespace Zixoan.Tethered.Client.Tests.Unit.Protocol;
public class TetheredTcpSocketClientTests : IClassFixture<TcpEchoServerClassFixture>
{
private readonly TcpEchoServerClassFixture tcpEchoServerClassFixture;
public TetheredTcpSocketClientTests(
TcpEchoServerClassFixture tcpEchoServerClassFixture)
{
this.tcpEchoServerClassFixture = tcpEchoServerClassFixture;
}
[Fact]
public async Task Send_When_Sending_And_WaitingForResponseFromEchoServer_Then_ReceivedDataMatchesSentData()
{
// Arrange
const uint requestId = 2;
using var tetheredTcpSocketClient = new TetheredTcpSocketClient();
using var pooledByteBuffer = new PooledByteBuffer(Operation.Login, requestId);
pooledByteBuffer.WriteByte((byte)StatusCode.Ok);
// Data
pooledByteBuffer.WriteUInt(123456);
pooledByteBuffer.WriteString("Hello, Tethered!");
pooledByteBuffer.EndPacket();
// Act
await tetheredTcpSocketClient.ConnectAsync(IPAddress.Loopback.ToString(), this.tcpEchoServerClassFixture.Port);
IByteBuffer receiveByteBuffer = await tetheredTcpSocketClient.SendAndWaitForResponseAsync(requestId, pooledByteBuffer);
// Assert
receiveByteBuffer.ReadUInt().Should().Be(123456);
receiveByteBuffer.ReadString()!.Should().Be("Hello, Tethered!");
}
} | 33.918367 | 127 | 0.746691 |
b46c55da832efa29f96ee3456576bd05a8a8474d | 3,712 | sql | SQL | Database/AdventureWorks2014/Tables/Sales.SalesPersonQuotaHistory.sql | CodeAperture/AdventureWorksSourceControl | 21039d52f595affdf5b575ab59fa188e7bfdcc08 | [
"MIT"
] | null | null | null | Database/AdventureWorks2014/Tables/Sales.SalesPersonQuotaHistory.sql | CodeAperture/AdventureWorksSourceControl | 21039d52f595affdf5b575ab59fa188e7bfdcc08 | [
"MIT"
] | null | null | null | Database/AdventureWorks2014/Tables/Sales.SalesPersonQuotaHistory.sql | CodeAperture/AdventureWorksSourceControl | 21039d52f595affdf5b575ab59fa188e7bfdcc08 | [
"MIT"
] | null | null | null | CREATE TABLE [Sales].[SalesPersonQuotaHistory]
(
[BusinessEntityID] [int] NOT NULL,
[QuotaDate] [datetime] NOT NULL,
[SalesQuota] [money] NOT NULL,
[rowguid] [uniqueidentifier] NOT NULL ROWGUIDCOL CONSTRAINT [DF_SalesPersonQuotaHistory_rowguid] DEFAULT (newid()),
[ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_SalesPersonQuotaHistory_ModifiedDate] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [Sales].[SalesPersonQuotaHistory] ADD CONSTRAINT [CK_SalesPersonQuotaHistory_SalesQuota] CHECK (([SalesQuota]>(0.00)))
GO
ALTER TABLE [Sales].[SalesPersonQuotaHistory] ADD CONSTRAINT [PK_SalesPersonQuotaHistory_BusinessEntityID_QuotaDate] PRIMARY KEY CLUSTERED ([BusinessEntityID], [QuotaDate]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [AK_SalesPersonQuotaHistory_rowguid] ON [Sales].[SalesPersonQuotaHistory] ([rowguid]) ON [PRIMARY]
GO
ALTER TABLE [Sales].[SalesPersonQuotaHistory] ADD CONSTRAINT [FK_SalesPersonQuotaHistory_SalesPerson_BusinessEntityID] FOREIGN KEY ([BusinessEntityID]) REFERENCES [Sales].[SalesPerson] ([BusinessEntityID])
GO
EXEC sp_addextendedproperty N'MS_Description', N'Sales performance tracking.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPersonQuotaHistory', NULL, NULL
GO
EXEC sp_addextendedproperty N'MS_Description', N'Sales person identification number. Foreign key to SalesPerson.BusinessEntityID.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPersonQuotaHistory', 'COLUMN', N'BusinessEntityID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Date and time the record was last updated.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPersonQuotaHistory', 'COLUMN', N'ModifiedDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Sales quota date.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPersonQuotaHistory', 'COLUMN', N'QuotaDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPersonQuotaHistory', 'COLUMN', N'rowguid'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Sales quota amount.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPersonQuotaHistory', 'COLUMN', N'SalesQuota'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Check constraint [SalesQuota] > (0.00)', 'SCHEMA', N'Sales', 'TABLE', N'SalesPersonQuotaHistory', 'CONSTRAINT', N'CK_SalesPersonQuotaHistory_SalesQuota'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of GETDATE()', 'SCHEMA', N'Sales', 'TABLE', N'SalesPersonQuotaHistory', 'CONSTRAINT', N'DF_SalesPersonQuotaHistory_ModifiedDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of NEWID()', 'SCHEMA', N'Sales', 'TABLE', N'SalesPersonQuotaHistory', 'CONSTRAINT', N'DF_SalesPersonQuotaHistory_rowguid'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key constraint referencing SalesPerson.SalesPersonID.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPersonQuotaHistory', 'CONSTRAINT', N'FK_SalesPersonQuotaHistory_SalesPerson_BusinessEntityID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key (clustered) constraint', 'SCHEMA', N'Sales', 'TABLE', N'SalesPersonQuotaHistory', 'CONSTRAINT', N'PK_SalesPersonQuotaHistory_BusinessEntityID_QuotaDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Unique nonclustered index. Used to support replication samples.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPersonQuotaHistory', 'INDEX', N'AK_SalesPersonQuotaHistory_rowguid'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Clustered index created by a primary key constraint.', 'SCHEMA', N'Sales', 'TABLE', N'SalesPersonQuotaHistory', 'INDEX', N'PK_SalesPersonQuotaHistory_BusinessEntityID_QuotaDate'
GO
| 84.363636 | 243 | 0.793103 |
f543f20922bcbbad906d8567618eecd91f510cc3 | 548 | cc | C++ | src/lib/parser/tracksparser_test.cc | arthurfait/soundcloudcpp | 23ae084aa620f245e65c3b11178d423cd9363b36 | [
"MIT"
] | 6 | 2015-02-12T09:28:58.000Z | 2021-10-30T07:53:34.000Z | src/lib/parser/tracksparser_test.cc | arthurfait/soundcloudcpp | 23ae084aa620f245e65c3b11178d423cd9363b36 | [
"MIT"
] | 9 | 2015-01-13T23:02:46.000Z | 2020-09-05T19:12:29.000Z | src/lib/parser/tracksparser_test.cc | arthurfait/soundcloudcpp | 23ae084aa620f245e65c3b11178d423cd9363b36 | [
"MIT"
] | null | null | null | #include <fstream>
#include <string>
#include <iostream>
#include "parser.h"
int main(int argc, char* argv[])
{
std::string inputFileName = "o.js";
// if (argv > 1)
std::ifstream ifs (inputFileName, std::ifstream::in);
std::string data;
while(ifs.good()) {
std::string line;
ifs >> line;
data.append(line);
}
// std::cout << data << std::endl;
soundcloud::Parser parser;
auto tracks = parser.parseTracks(data);
for (const auto& track: tracks) {
std::cout << track;
}
}
| 21.076923 | 57 | 0.574818 |
cb3d62de549bd38a920375e45c9eb45a69c8bb93 | 16,746 | go | Go | optimization/apiv1/fleet_routing_client.go | quartzmo/google-cloud-go | 25b77757c1e6f372e03bf99ab7461264bba48d26 | [
"Apache-2.0"
] | null | null | null | optimization/apiv1/fleet_routing_client.go | quartzmo/google-cloud-go | 25b77757c1e6f372e03bf99ab7461264bba48d26 | [
"Apache-2.0"
] | null | null | null | optimization/apiv1/fleet_routing_client.go | quartzmo/google-cloud-go | 25b77757c1e6f372e03bf99ab7461264bba48d26 | [
"Apache-2.0"
] | null | null | null | // Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package optimization
import (
"context"
"fmt"
"math"
"net/url"
"time"
"cloud.google.com/go/longrunning"
lroauto "cloud.google.com/go/longrunning/autogen"
gax "github.com/googleapis/gax-go/v2"
"google.golang.org/api/option"
"google.golang.org/api/option/internaloption"
gtransport "google.golang.org/api/transport/grpc"
optimizationpb "google.golang.org/genproto/googleapis/cloud/optimization/v1"
longrunningpb "google.golang.org/genproto/googleapis/longrunning"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
)
var newFleetRoutingClientHook clientHook
// FleetRoutingCallOptions contains the retry settings for each method of FleetRoutingClient.
type FleetRoutingCallOptions struct {
OptimizeTours []gax.CallOption
BatchOptimizeTours []gax.CallOption
}
func defaultFleetRoutingGRPCClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("cloudoptimization.googleapis.com:443"),
internaloption.WithDefaultMTLSEndpoint("cloudoptimization.mtls.googleapis.com:443"),
internaloption.WithDefaultAudience("https://cloudoptimization.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
internaloption.EnableJwtWithScope(),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
}
}
func defaultFleetRoutingCallOptions() *FleetRoutingCallOptions {
return &FleetRoutingCallOptions{
OptimizeTours: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
BatchOptimizeTours: []gax.CallOption{
gax.WithRetry(func() gax.Retryer {
return gax.OnCodes([]codes.Code{
codes.Unavailable,
}, gax.Backoff{
Initial: 1000 * time.Millisecond,
Max: 10000 * time.Millisecond,
Multiplier: 1.30,
})
}),
},
}
}
// internalFleetRoutingClient is an interface that defines the methods available from Cloud Optimization API.
type internalFleetRoutingClient interface {
Close() error
setGoogleClientInfo(...string)
Connection() *grpc.ClientConn
OptimizeTours(context.Context, *optimizationpb.OptimizeToursRequest, ...gax.CallOption) (*optimizationpb.OptimizeToursResponse, error)
BatchOptimizeTours(context.Context, *optimizationpb.BatchOptimizeToursRequest, ...gax.CallOption) (*BatchOptimizeToursOperation, error)
BatchOptimizeToursOperation(name string) *BatchOptimizeToursOperation
}
// FleetRoutingClient is a client for interacting with Cloud Optimization API.
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
//
// A service for optimizing vehicle tours.
//
// Validity of certain types of fields:
//
// google.protobuf.Timestamp
//
// Times are in Unix time: seconds since 1970-01-01T00:00:00+00:00.
//
// seconds must be in [0, 253402300799],
// i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
//
// nanos must be unset or set to 0.
//
// google.protobuf.Duration
//
// seconds must be in [0, 253402300799],
// i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
//
// nanos must be unset or set to 0.
//
// google.type.LatLng
//
// latitude must be in [-90.0, 90.0].
//
// longitude must be in [-180.0, 180.0].
//
// at least one of latitude and longitude must be non-zero.
type FleetRoutingClient struct {
// The internal transport-dependent client.
internalClient internalFleetRoutingClient
// The call options for this service.
CallOptions *FleetRoutingCallOptions
// LROClient is used internally to handle long-running operations.
// It is exposed so that its CallOptions can be modified if required.
// Users should not Close this client.
LROClient *lroauto.OperationsClient
}
// Wrapper methods routed to the internal client.
// Close closes the connection to the API service. The user should invoke this when
// the client is no longer required.
func (c *FleetRoutingClient) Close() error {
return c.internalClient.Close()
}
// setGoogleClientInfo sets the name and version of the application in
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *FleetRoutingClient) setGoogleClientInfo(keyval ...string) {
c.internalClient.setGoogleClientInfo(keyval...)
}
// Connection returns a connection to the API service.
//
// Deprecated.
func (c *FleetRoutingClient) Connection() *grpc.ClientConn {
return c.internalClient.Connection()
}
// OptimizeTours sends an OptimizeToursRequest containing a ShipmentModel and returns an
// OptimizeToursResponse containing ShipmentRoutes, which are a set of
// routes to be performed by vehicles minimizing the overall cost.
//
// A ShipmentModel model consists mainly of Shipments that need to be
// carried out and Vehicles that can be used to transport the Shipments.
// The ShipmentRoutes assign Shipments to Vehicles. More specifically,
// they assign a series of Visits to each vehicle, where a Visit
// corresponds to a VisitRequest, which is a pickup or delivery for a
// Shipment.
//
// The goal is to provide an assignment of ShipmentRoutes to Vehicles that
// minimizes the total cost where cost has many components defined in the
// ShipmentModel.
func (c *FleetRoutingClient) OptimizeTours(ctx context.Context, req *optimizationpb.OptimizeToursRequest, opts ...gax.CallOption) (*optimizationpb.OptimizeToursResponse, error) {
return c.internalClient.OptimizeTours(ctx, req, opts...)
}
// BatchOptimizeTours optimizes vehicle tours for one or more OptimizeToursRequest
// messages as a batch.
//
// This method is a Long Running Operation (LRO). The inputs for optimization
// (OptimizeToursRequest messages) and outputs (OptimizeToursResponse
// messages) are read/written from/to Cloud Storage in user-specified
// format. Like the OptimizeTours method, each OptimizeToursRequest
// contains a ShipmentModel and returns an OptimizeToursResponse
// containing ShipmentRoutes, which are a set of routes to be performed by
// vehicles minimizing the overall cost.
func (c *FleetRoutingClient) BatchOptimizeTours(ctx context.Context, req *optimizationpb.BatchOptimizeToursRequest, opts ...gax.CallOption) (*BatchOptimizeToursOperation, error) {
return c.internalClient.BatchOptimizeTours(ctx, req, opts...)
}
// BatchOptimizeToursOperation returns a new BatchOptimizeToursOperation from a given name.
// The name must be that of a previously created BatchOptimizeToursOperation, possibly from a different process.
func (c *FleetRoutingClient) BatchOptimizeToursOperation(name string) *BatchOptimizeToursOperation {
return c.internalClient.BatchOptimizeToursOperation(name)
}
// fleetRoutingGRPCClient is a client for interacting with Cloud Optimization API over gRPC transport.
//
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type fleetRoutingGRPCClient struct {
// Connection pool of gRPC connections to the service.
connPool gtransport.ConnPool
// flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE
disableDeadlines bool
// Points back to the CallOptions field of the containing FleetRoutingClient
CallOptions **FleetRoutingCallOptions
// The gRPC API client.
fleetRoutingClient optimizationpb.FleetRoutingClient
// LROClient is used internally to handle long-running operations.
// It is exposed so that its CallOptions can be modified if required.
// Users should not Close this client.
LROClient **lroauto.OperationsClient
// The x-goog-* metadata to be sent with each request.
xGoogMetadata metadata.MD
}
// NewFleetRoutingClient creates a new fleet routing client based on gRPC.
// The returned client must be Closed when it is done being used to clean up its underlying connections.
//
// A service for optimizing vehicle tours.
//
// Validity of certain types of fields:
//
// google.protobuf.Timestamp
//
// Times are in Unix time: seconds since 1970-01-01T00:00:00+00:00.
//
// seconds must be in [0, 253402300799],
// i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
//
// nanos must be unset or set to 0.
//
// google.protobuf.Duration
//
// seconds must be in [0, 253402300799],
// i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
//
// nanos must be unset or set to 0.
//
// google.type.LatLng
//
// latitude must be in [-90.0, 90.0].
//
// longitude must be in [-180.0, 180.0].
//
// at least one of latitude and longitude must be non-zero.
func NewFleetRoutingClient(ctx context.Context, opts ...option.ClientOption) (*FleetRoutingClient, error) {
clientOpts := defaultFleetRoutingGRPCClientOptions()
if newFleetRoutingClientHook != nil {
hookOpts, err := newFleetRoutingClientHook(ctx, clientHookParams{})
if err != nil {
return nil, err
}
clientOpts = append(clientOpts, hookOpts...)
}
disableDeadlines, err := checkDisableDeadlines()
if err != nil {
return nil, err
}
connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
if err != nil {
return nil, err
}
client := FleetRoutingClient{CallOptions: defaultFleetRoutingCallOptions()}
c := &fleetRoutingGRPCClient{
connPool: connPool,
disableDeadlines: disableDeadlines,
fleetRoutingClient: optimizationpb.NewFleetRoutingClient(connPool),
CallOptions: &client.CallOptions,
}
c.setGoogleClientInfo()
client.internalClient = c
client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool))
if err != nil {
// This error "should not happen", since we are just reusing old connection pool
// and never actually need to dial.
// If this does happen, we could leak connp. However, we cannot close conn:
// If the user invoked the constructor with option.WithGRPCConn,
// we would close a connection that's still in use.
// TODO: investigate error conditions.
return nil, err
}
c.LROClient = &client.LROClient
return &client, nil
}
// Connection returns a connection to the API service.
//
// Deprecated.
func (c *fleetRoutingGRPCClient) Connection() *grpc.ClientConn {
return c.connPool.Conn()
}
// setGoogleClientInfo sets the name and version of the application in
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *fleetRoutingGRPCClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
// Close closes the connection to the API service. The user should invoke this when
// the client is no longer required.
func (c *fleetRoutingGRPCClient) Close() error {
return c.connPool.Close()
}
func (c *fleetRoutingGRPCClient) OptimizeTours(ctx context.Context, req *optimizationpb.OptimizeToursRequest, opts ...gax.CallOption) (*optimizationpb.OptimizeToursResponse, error) {
if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines {
cctx, cancel := context.WithTimeout(ctx, 3600000*time.Millisecond)
defer cancel()
ctx = cctx
}
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append((*c.CallOptions).OptimizeTours[0:len((*c.CallOptions).OptimizeTours):len((*c.CallOptions).OptimizeTours)], opts...)
var resp *optimizationpb.OptimizeToursResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
resp, err = c.fleetRoutingClient.OptimizeTours(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
return nil, err
}
return resp, nil
}
func (c *fleetRoutingGRPCClient) BatchOptimizeTours(ctx context.Context, req *optimizationpb.BatchOptimizeToursRequest, opts ...gax.CallOption) (*BatchOptimizeToursOperation, error) {
if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines {
cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond)
defer cancel()
ctx = cctx
}
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
opts = append((*c.CallOptions).BatchOptimizeTours[0:len((*c.CallOptions).BatchOptimizeTours):len((*c.CallOptions).BatchOptimizeTours)], opts...)
var resp *longrunningpb.Operation
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
resp, err = c.fleetRoutingClient.BatchOptimizeTours(ctx, req, settings.GRPC...)
return err
}, opts...)
if err != nil {
return nil, err
}
return &BatchOptimizeToursOperation{
lro: longrunning.InternalNewOperation(*c.LROClient, resp),
}, nil
}
// BatchOptimizeToursOperation manages a long-running operation from BatchOptimizeTours.
type BatchOptimizeToursOperation struct {
lro *longrunning.Operation
}
// BatchOptimizeToursOperation returns a new BatchOptimizeToursOperation from a given name.
// The name must be that of a previously created BatchOptimizeToursOperation, possibly from a different process.
func (c *fleetRoutingGRPCClient) BatchOptimizeToursOperation(name string) *BatchOptimizeToursOperation {
return &BatchOptimizeToursOperation{
lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
}
}
// Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
//
// See documentation of Poll for error-handling information.
func (op *BatchOptimizeToursOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*optimizationpb.BatchOptimizeToursResponse, error) {
var resp optimizationpb.BatchOptimizeToursResponse
if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
return nil, err
}
return &resp, nil
}
// Poll fetches the latest state of the long-running operation.
//
// Poll also fetches the latest metadata, which can be retrieved by Metadata.
//
// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
// the operation has completed with failure, the error is returned and op.Done will return true.
// If Poll succeeds and the operation has completed successfully,
// op.Done will return true, and the response of the operation is returned.
// If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (op *BatchOptimizeToursOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*optimizationpb.BatchOptimizeToursResponse, error) {
var resp optimizationpb.BatchOptimizeToursResponse
if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
return nil, err
}
if !op.Done() {
return nil, nil
}
return &resp, nil
}
// Metadata returns metadata associated with the long-running operation.
// Metadata itself does not contact the server, but Poll does.
// To get the latest metadata, call this method after a successful call to Poll.
// If the metadata is not available, the returned metadata and error are both nil.
func (op *BatchOptimizeToursOperation) Metadata() (*optimizationpb.AsyncModelMetadata, error) {
var meta optimizationpb.AsyncModelMetadata
if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
return nil, nil
} else if err != nil {
return nil, err
}
return &meta, nil
}
// Done reports whether the long-running operation has completed.
func (op *BatchOptimizeToursOperation) Done() bool {
return op.lro.Done()
}
// Name returns the name of the long-running operation.
// The name is assigned by the server and is unique within the service from which the operation is created.
func (op *BatchOptimizeToursOperation) Name() string {
return op.lro.Name()
}
| 38.496552 | 183 | 0.751762 |
c2c32d0591a6788177695368a18d56b7e2a1801b | 923 | swift | Swift | modules/CocoaPods/Pods/SwiftCommons/modules/RoxieMobile.SwiftCommons/Core.Abstractions/Module/Sources/Models/PostValidatable.swift | NSemakov/HockeyAppLogger | 7d175df4fc0eb377605ec13e99102fe073ba9a43 | [
"BSD-4-Clause"
] | null | null | null | modules/CocoaPods/Pods/SwiftCommons/modules/RoxieMobile.SwiftCommons/Core.Abstractions/Module/Sources/Models/PostValidatable.swift | NSemakov/HockeyAppLogger | 7d175df4fc0eb377605ec13e99102fe073ba9a43 | [
"BSD-4-Clause"
] | null | null | null | modules/CocoaPods/Pods/SwiftCommons/modules/RoxieMobile.SwiftCommons/Core.Abstractions/Module/Sources/Models/PostValidatable.swift | NSemakov/HockeyAppLogger | 7d175df4fc0eb377605ec13e99102fe073ba9a43 | [
"BSD-4-Clause"
] | null | null | null | // ----------------------------------------------------------------------------
//
// PostValidatable.swift
//
// @author Alexander Bragin <bragin-av@roxiemobile.com>
// @copyright Copyright (c) 2017, Roxie Mobile Ltd. All rights reserved.
// @link http://www.roxiemobile.com/
//
// ----------------------------------------------------------------------------
@available(*, deprecated, message: "\n• Write a description.")
public protocol PostValidatable
{
// MARK: - Properties
/// Checks if object should be validated after construction.
///
/// - Returns:
/// `true` if object should be validated after construction; otherwise, `false`.
///
var isShouldPostValidate: Bool { get }
// MARK: - Methods
/// Checks the current state of the object for correctness.
func validate() throws
}
// ----------------------------------------------------------------------------
| 29.774194 | 86 | 0.486457 |
7da19bf32dcb38be0eb63e95332317d1dff4b71b | 126 | html | HTML | templates/cookie.html | arturoalf93/SMwebapp | 35c50e99005f0912fca47e8ce4cd1d7cf0913417 | [
"MIT"
] | null | null | null | templates/cookie.html | arturoalf93/SMwebapp | 35c50e99005f0912fca47e8ce4cd1d7cf0913417 | [
"MIT"
] | null | null | null | templates/cookie.html | arturoalf93/SMwebapp | 35c50e99005f0912fca47e8ce4cd1d7cf0913417 | [
"MIT"
] | null | null | null | {% extends 'base/base.html' %}
{% block title %} Cookie {% endblock %}
{% block content %}
<h2>Cookie!</h2>
{% endblock %} | 14 | 39 | 0.579365 |
379951348107d3d12a692c23928f4dc31abd0df3 | 2,660 | swift | Swift | Demos/Swift/UFileSDKDemo-swift/UFileSDKDemo-swift/file/FileDeleteQueryVC.swift | ucloud/ufile-sdk-ios | d199e1e02fa7defd896db15de479ec9a149b2a0e | [
"MIT"
] | 8 | 2018-12-21T06:45:30.000Z | 2020-11-20T07:51:25.000Z | Demos/Swift/UFileSDKDemo-swift/UFileSDKDemo-swift/file/FileDeleteQueryVC.swift | ucloud/ufile-sdk-ios | d199e1e02fa7defd896db15de479ec9a149b2a0e | [
"MIT"
] | 1 | 2018-12-29T06:11:59.000Z | 2019-01-02T04:01:12.000Z | Demos/Swift/UFileSDKDemo-swift/UFileSDKDemo-swift/file/FileDeleteQueryVC.swift | ucloud/ufile-sdk-ios | d199e1e02fa7defd896db15de479ec9a149b2a0e | [
"MIT"
] | 1 | 2019-10-24T03:59:17.000Z | 2019-10-24T03:59:17.000Z | //
// FileDeleteQueryVC.swift
// UFileSDKDemo-swift
//
// Created by ethan on 2018/12/12.
// Copyright © 2018 ucloud. All rights reserved.
//
import UIKit
class FileDeleteQueryVC: UIViewController {
@IBOutlet weak var fileNameTF:UITextField!
@IBOutlet weak var resTV:UITextView!
var fileClient:UFFileClient = UFFileClient()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.fileNameTF.text = "initscreen.jpg";
}
func processDQHandler(ufError:UFError?, ufResponse:Any?) -> Void {
DispatchQueue.main.async {
if ufError == nil {
if ufResponse is UFQueryFileResponse{
let ufQueryFileResponse:UFQueryFileResponse = ufResponse as! UFQueryFileResponse
self.resTV.text = "查询成功,服务器返回信息-->" + ufQueryFileResponse.description
return
}
if ufResponse == nil{
self.resTV.text = "删除成功"
return
}
}
if ufError?.type == UFErrorType_Sys{
let error = ufError?.error as! NSError
self.resTV.text = "删除(查询)失败,系统错误信息-->" + error.description
return
}
self.resTV.text = "删除(查询)失败,服务器返回错误信息-->" + (ufError?.fileClientError.description)!
}
}
@IBAction func onpressedButtonQuery(_ sender:Any)
{
self.resTV.text = nil
self.hideKeyboaryd()
let fileName = self.fileNameTF.text
if (fileName?.lengthOfBytes(using: .utf8))! <= 0{
return
}
weak var weakself:FileDeleteQueryVC! = self
self.fileClient.query(withKeyName:fileName!) { (ufError:UFError?, ufQueryFileResponse:UFQueryFileResponse?) in
weakself.processDQHandler(ufError: ufError, ufResponse: ufQueryFileResponse)
}
}
@IBAction func onpressedButtonDelete(_ sender: Any)
{
self.resTV.text = nil
self.hideKeyboaryd()
let fileName = self.fileNameTF.text
if (fileName?.lengthOfBytes(using: .utf8))! <= 0{
return
}
weak var weakself:FileDeleteQueryVC! = self
self.fileClient.delete(withKeyName: fileName!) { (ufError:UFError?, obj:NSObject?) in
weakself.processDQHandler(ufError: ufError, ufResponse: obj)
}
}
func hideKeyboaryd() -> Void {
if self.fileNameTF.isFirstResponder {
self.fileNameTF.resignFirstResponder()
}
}
}
| 30.574713 | 118 | 0.577068 |
0c970d3ec8700bf4ba9fc36c0e2442a0f8fd3a16 | 2,031 | html | HTML | third_party/WebKit/LayoutTests/fast/canvas/image-pattern-rotate.html | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 777 | 2017-08-29T15:15:32.000Z | 2022-03-21T05:29:41.000Z | third_party/WebKit/LayoutTests/fast/canvas/image-pattern-rotate.html | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 66 | 2017-08-30T18:31:18.000Z | 2021-08-02T10:59:35.000Z | third_party/WebKit/LayoutTests/fast/canvas/image-pattern-rotate.html | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 123 | 2017-08-30T01:19:34.000Z | 2022-03-17T22:55:31.000Z | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="../../resources/js-test.js"></script>
<style>
canvas {
border: 1px solid #000;
margin: 2px;
}
</style>
<script>
var img;
var imgdata;
function imageLoaded() {
var NUM_IMAGE = 16;
for (var i = 0; i < NUM_IMAGE; i++) {
var canvases = document.getElementById('canvases')
var canvas = document.createElement('canvas');
canvas.width = 9;
canvas.height = 9;
var ctx = canvas.getContext('2d');
var pattern = ctx.createPattern(img, 'no-repeat');
ctx.fillStyle = pattern;
ctx.translate(img.width / 2, img.height / 2);
var angle = 2 * Math.PI * i / NUM_IMAGE;
ctx.rotate(angle);
ctx.translate(- img.width / 2, - img.height / 2);
ctx.fillRect(0, 0, img.width, img.height);
var div = document.createElement('div');
div.appendChild(canvas);
canvases.appendChild(div);
var imageData = ctx.getImageData(4, 4, 1, 1);
imgdata = imageData.data;
shouldBe("imgdata[0]", "0");
shouldBe("imgdata[1]", "255");
shouldBe("imgdata[2]", "0");
}
if (window.testRunner) {
testRunner.notifyDone();
}
}
function runTests() {
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
var patternCanvas = document.createElement('canvas');
patternCanvas.width = 9;
patternCanvas.height = 9;
var patternCtx = patternCanvas.getContext('2d');
patternCtx.fillStyle = '#0F0';
patternCtx.fillRect(3, 3, 3, 3);
img = new Image();
img.onload = imageLoaded;
img.src = patternCanvas.toDataURL();
}
</script>
</head>
<body onload="runTests();">
Visual result below is for debugging purposes only (test uses text baseline only). You should see sixteen canvases with a green dot (rotated square) in the center.
<div id="canvases"></div>
</pre>
</body>
</html>
| 27.445946 | 163 | 0.610537 |
64d27988b2e8efba53ea57de1a5bbaac424c84d6 | 10,182 | ps1 | PowerShell | integration/oqs_openssl/winrun.ps1 | zrlmib/testing | acf41dc5e81d53d479dafe768850ec37380d9443 | [
"MIT"
] | null | null | null | integration/oqs_openssl/winrun.ps1 | zrlmib/testing | acf41dc5e81d53d479dafe768850ec37380d9443 | [
"MIT"
] | null | null | null | integration/oqs_openssl/winrun.ps1 | zrlmib/testing | acf41dc5e81d53d479dafe768850ec37380d9443 | [
"MIT"
] | null | null | null | #########################################
# OpenSSL integration test on Windows
#########################################
# edit these variables as needed (TODO: make these script arguments)
$download_and_build_liboqs = 1 # set to 0 to manually download and build
$liboqs_url = "https://github.com/open-quantum-safe/liboqs/archive/master.zip"
$liboqs_zip = "liboqs.zip"
$liboqs_path = "liboqs\liboqs-master" # base path when unzipping the downloaded package
$test_openssl_1_0_2 = 1 # set to 0 to skip 1.0.2
$download_and_build_openssl_1_0_2 = 1 # set to 0 to manually download and build
$openssl102_url = "https://github.com/open-quantum-safe/openssl/archive/OQS-OpenSSL_1_0_2-stable.zip"
$openssl102_zip = "openssl102.zip"
$openssl102_path = "openssl102\openssl-OQS-OpenSSL_1_0_2-stable" # base path when unzipping the downloaded package
$test_openssl_1_1_1 = 1 # set to 0 to skip 1.1.1
$download_and_build_openssl_1_1_1 = 1 # set to 0 to manually download and build
$openssl111_url = "https://github.com/open-quantum-safe/openssl/archive/OQS-OpenSSL_1_1_1-stable.zip"
$openssl111_zip = "openssl111.zip"
$openssl111_path = "openssl111\openssl-OQS-OpenSSL_1_1_1-stable" # base path when unzipping the downloaded package
#########################################
# setup
#########################################
$wc = New-Object System.Net.WebClient
$test_success = 0
$test_error = 1
# generate a Q.txt file with a Q char to pass to OpenSSL's s_client (to quit the session)
if (-Not (Test-Path -Path "Q.txt")) {
Add-Content -Path "Q.txt" -Value "Q"
}
function Install-OQS {
param($path)
New-Item -ItemType Directory -Force -Path $path\oqs\lib
Copy-Item -Path $liboqs_path\VisualStudio\x64\Release\oqs.lib $path\oqs\lib\ -Recurse
Copy-Item -Path $liboqs_path\VisualStudio\include $path\oqs -Recurse
}
#########################################
# OQS
#########################################
#download and build liboqs (master branch)
Write-Host "Downloading liboqs"
if ($download_and_build_liboqs -eq 1) {
$wc.DownloadFile($liboqs_url, $liboqs_zip)
if ($LASTEXITCODE -eq 1) {
Write-Host -ForegroundColor Red "Failed downloading OQS from $liboqs_url"
Exit $test_error
}
Expand-Archive $liboqs_zip
if ($LASTEXITCODE -eq 1) {
Write-Host -ForegroundColor Red "Failed unzipping OQS"
Exit $test_error
}
msbuild $liboqs_path\VisualStudio\liboqs.sln --% /p:Configuration=Release;Platform=x64
if ($LASTEXITCODE -eq 1) {
Write-Host -ForegroundColor Red "Failed building OQS"
Exit $test_error
}
}
#########################################
# OpenSSL 1.0.2
#########################################
$success102 = 1 # flip to 0 on failure
$failures102 = "OpenSSL_1_0_2: "
if ($test_openssl_1_0_2) {
#download openssl 1.0.2
if ($download_and_build_openssl_1_0_2 -eq 1) {
Write-Host "Downloading OpenSSL 1.0.2"
$wc.DownloadFile($openssl102_url, $openssl102_zip)
if ($LASTEXITCODE -eq 1) {
Write-Host -ForegroundColor Red "Failed downloading OpenSSL 1.0.2 from $openssl102_url"
Exit $test_error
}
Expand-Archive $openssl102_zip
if ($LASTEXITCODE -eq 1) {
Write-Host -ForegroundColor Red "Failed unzipping OpenSSL 1.0.2"
Exit $test_error
}
Install-OQS($openssl102_path)
}
# build openssl 1.0.2 (static and DLL target)
ForEach ($target102 in 'nt.mak', 'ntdll.mak') {
if ($download_and_build_openssl_1_0_2 -eq 1) {
cd $openssl102_path
perl Configure VC-WIN64A
ms\do_win64a
nmake -f ms\$target102
if ($LASTEXITCODE -eq 1) {
Write-Host -ForegroundColor Red "Failed building OpenSSL 1.0.2 - $target102"
Exit $test_error
}
cd $PSScriptRoot
}
$target102_path = "out32"
if ($target102 -eq 'ntdll.mak') {
$target102_path = $target102_path + 'dll'
}
#run tests
Write-Host "Redirecting stdout/stderr to $openssl102_path\client_std(out/err)_KEXALG_SIGALG.txt"
ForEach ($sigalg in 'rsa') {
Write-Host "Generating $sigalg key"
Start-Process -FilePath "$openssl102_path\$target102_path\openssl.exe" -WorkingDirectory "$openssl102_path\" -WindowStyle Hidden -ArgumentList "req -x509 -new -newkey $sigalg -keyout $sigalg.key -out $sigalg.crt -nodes -subj `"/CN=oqstest`" -days 365 -config apps\openssl.cnf"
Write-Host "Starting server with $sigalg cert"
$server = Start-Process -FilePath "$openssl102_path\$target102_path\openssl.exe" -WorkingDirectory "$openssl102_path\" -WindowStyle Hidden -ArgumentList "s_server -cert $sigalg.crt -key $sigalg.key -HTTP -tls1_2" -PassThru
Start-Sleep -Seconds 2 # make sure server is up
# TODO: check server is running correctly.
ForEach ($kexalg in 'OQSKEM-DEFAULT', 'OQSKEM-DEFAULT-ECDHE') {
# TODO: put cancel timer on operations to avoid blocking
$stdout = "$openssl102_path\client_stdout_" + $kexalg + "_" + $sigalg + ".txt"
$stderr = "$openssl102_path\client_stderr_" + $kexalg + "_" + $sigalg + ".txt"
Write-Host "Starting client with $kexalg kex" # start client (Q.txt contains a 'Q' character to stop the client after the request)
$client = Start-Process -FilePath "$openssl102_path\$target102_path\openssl.exe" -WorkingDirectory "$openssl102_path" -WindowStyle Hidden -ArgumentList "s_client -cipher $kexalg -connect localhost:4433" -RedirectStandardOutput "$stdout" -RedirectStandardError "$stderr" -RedirectStandardInput "Q.txt" -PassThru -Wait
if ($client.HasExited -and $client.ExitCode -ne 0) {
Write-Host -ForegroundColor Red "$kexalg with $sigalg FAILED!"
$success102 = 0
$failures102 = $failures102 + $target102 + "/" + $kexalg + "/" + $sigalg + ", "
}
}
Stop-Process $server
}
}
}
#########################################
# OpenSSL 1.1.1
#########################################
$success111 = 1 # flip to 0 on failure
$failures111 = "OpenSSL_1_1_1: "
if ($test_openssl_1_1_1) {
#download and build openssl 1.1.1
if ($download_and_build_openssl_1_1_1 -eq 1) {
Write-Host "Downloading OpenSSL 1.1.1"
$wc.DownloadFile($openssl111_url, $openssl111_zip)
if ($LASTEXITCODE -eq 1) {
Write-Host -ForegroundColor Red "Failed downloading OpenSSL 1.1.1 from $openssl111_url"
Exit $test_error
}
Expand-Archive $openssl111_zip
if ($LASTEXITCODE -eq 1) {
Write-Host -ForegroundColor Red "Failed unzipping OpenSSL 1.1.1"
Exit $test_error
}
Install-OQS($openssl111_path)
cd $openssl111_path
perl Configure VC-WIN64A
nmake
if ($LASTEXITCODE -eq 1) {
Write-Host -ForegroundColor Red "Failed building OpenSSL 1.1.1"
Exit $test_error
}
cd $PSScriptRoot
}
#run tests
Write-Host "Redirecting stdout/stderr to $openssl111_path\client_std(out/err)_KEXALG_SIGALG.txt"
ForEach ($sigalg in 'rsa', 'picnicl1fs', 'rsa3072_picnicl1fs', 'p256_picnicl1fs') {
Write-Host "Generating $sigalg key"
Start-Process -FilePath "$openssl111_path\apps\openssl.exe" -WorkingDirectory "$openssl111_path\" -WindowStyle Hidden -ArgumentList "req -x509 -new -newkey $sigalg -keyout $sigalg.key -out $sigalg.crt -nodes -subj `"/CN=oqstest`" -days 365 -config apps\openssl.cnf"
Write-Host "Starting server with $sigalg cert"
$server = Start-Process -FilePath "$openssl111_path\apps\openssl.exe" -WorkingDirectory "$openssl111_path\" -WindowStyle Hidden -ArgumentList "s_server -cert $sigalg.crt -key $sigalg.key -HTTP -tls1_3" -PassThru
Start-Sleep -Seconds 2 # make sure server is up
# TODO: check server is running correctly.
ForEach ($kexalg in 'oqs_kem_default', 'frodo640aes', 'frodo640cshake', 'frodo976aes', 'frodo976cshake', 'newhope512cca', 'newhope1024cca', 'sidh503', 'sidh751', 'sike503', 'sike751', 'p256-oqs_kem_default', 'p256-frodo640aes', 'p256-frodo640cshake', 'p256-newhope512cca', 'p256-sidh503', 'p256-sike503') {
# TODO: put cancel timer on operations to avoid blocking
$stdout = "$openssl111_path\client_stdout_" + $kexalg + "_" + $sigalg + ".txt"
$stderr = "$openssl111_path\client_stderr_" + $kexalg + "_" + $sigalg + ".txt"
Write-Host "Starting client with $kexalg kex" # start client (Q.txt contains a 'Q' character to stop the client after the request)
$client = Start-Process -FilePath "$openssl111_path\apps\openssl.exe" -WorkingDirectory "$openssl111_path" -WindowStyle Hidden -ArgumentList "s_client -curves $kexalg -connect localhost:4433" -RedirectStandardOutput "$stdout" -RedirectStandardError "$stderr" -RedirectStandardInput "Q.txt" -PassThru -Wait
if ($client.HasExited -and $client.ExitCode -ne 0) {
Write-Host -ForegroundColor Red "$kexalg with $sigalg FAILED!" # TODO: add to list of failing ciphers, to be printed at the end of the script
$success111 = 0
$failures111 = $failures111 + $kexalg + "/" + $sigalg + ", "
}
}
Stop-Process $server
}
}
#########################################
# Results
#########################################
if ($success102 -ne 1 -or $success111 -ne 1) {
Write-Host -ForegroundColor Red "Tests failed:"
if ($success102 -ne 1) {Write-Host -ForegroundColor Red "$failures102"}
if ($success111 -ne 1) {Write-Host -ForegroundColor Red "$failures111"}
Exit $test_error
} else {
Write-Host -ForegroundColor Blue "All tests passed"
Exit $test_success
}
| 49.188406 | 333 | 0.617266 |
a09d9a42ef8375c86c71b6e18406ad07ee4700d2 | 49 | sql | SQL | server/database/sql/users/updateEmail.sql | lexnapoles/Bayuk | fbab786262c19e058e229be7b03422e71b9f0afd | [
"MIT"
] | 1 | 2019-01-24T16:50:32.000Z | 2019-01-24T16:50:32.000Z | server/database/sql/users/updateEmail.sql | lexnapoles/Bayuk | fbab786262c19e058e229be7b03422e71b9f0afd | [
"MIT"
] | 1 | 2022-03-02T11:29:17.000Z | 2022-03-02T11:29:17.000Z | server/database/sql/users/updateEmail.sql | lexnapoles/Bayuk | fbab786262c19e058e229be7b03422e71b9f0afd | [
"MIT"
] | 2 | 2017-06-09T17:16:01.000Z | 2017-12-29T09:45:56.000Z | SELECT * FROM update_user_email(${id}, ${email}); | 49 | 49 | 0.693878 |
04ecd9ed673e3ec6f8933179f12b6893fb87f06d | 1,168 | java | Java | src/main/java/gov/nasa/jpl/mbee/mdk/generator/graphs/DirectedEdgeVector.java | Enquier/mdk | 4d5c82d267d0ce1401868703cab62effa9aeb75d | [
"Apache-2.0"
] | 30 | 2016-12-21T00:55:41.000Z | 2022-02-16T20:39:13.000Z | src/main/java/gov/nasa/jpl/mbee/mdk/generator/graphs/DirectedEdgeVector.java | Enquier/mdk | 4d5c82d267d0ce1401868703cab62effa9aeb75d | [
"Apache-2.0"
] | 47 | 2017-01-01T23:33:17.000Z | 2022-03-15T14:34:16.000Z | src/main/java/gov/nasa/jpl/mbee/mdk/generator/graphs/DirectedEdgeVector.java | Enquier/mdk | 4d5c82d267d0ce1401868703cab62effa9aeb75d | [
"Apache-2.0"
] | 18 | 2017-01-05T02:14:35.000Z | 2022-01-26T06:40:45.000Z | package gov.nasa.jpl.mbee.mdk.generator.graphs;
import java.util.HashSet;
import java.util.Set;
public class DirectedEdgeVector<VertexType> extends UndirectedEdgeVector<VertexType> implements
DirectedEdge<VertexType> {
/**
*
*/
private static final long serialVersionUID = 1L;
public DirectedEdgeVector(VertexType sourceVertex, VertexType targetVertex) {
super(sourceVertex, targetVertex);
}
@Override
public Set<VertexType> getSourceVertices() {
Set<VertexType> vertices = new HashSet<VertexType>();
vertices.add(getSourceVertex());
return vertices;
}
@Override
public Set<VertexType> getTargetVertices() {
Set<VertexType> vertices = new HashSet<VertexType>();
vertices.add(getTargetVertex());
return vertices;
}
@Override
public VertexType getSourceVertex() {
return this.get(0);
}
@Override
public VertexType getTargetVertex() {
return this.get(1);
}
@Override
public synchronized String toString() {
return getSourceVertex().toString() + " -> " + getTargetVertex().toString();
}
}
| 24.851064 | 95 | 0.659247 |
f406cb50cf5f8bdb2371641fa6b40411e8b150ad | 2,861 | dart | Dart | lib/notifications/notification_list.dart | hungrybearpls/CoverMe_Beta | a4aad6f5a8e21f5aac6c9337baf16a9f68b6136c | [
"MIT"
] | null | null | null | lib/notifications/notification_list.dart | hungrybearpls/CoverMe_Beta | a4aad6f5a8e21f5aac6c9337baf16a9f68b6136c | [
"MIT"
] | null | null | null | lib/notifications/notification_list.dart | hungrybearpls/CoverMe_Beta | a4aad6f5a8e21f5aac6c9337baf16a9f68b6136c | [
"MIT"
] | null | null | null | import 'dart:math';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_devfest/home/venue.dart';
import 'package:flutter_devfest/notifications/notification_detail.dart';
import 'package:flutter_devfest/utils/tools.dart';
class NotificationList extends StatelessWidget {
final List<Venues> allPosts;
const NotificationList({Key key, @required this.allPosts}) : super(key: key);
@override
Widget build(BuildContext context) {
return ListView.builder(
shrinkWrap: false,
itemCount: allPosts.length,
itemBuilder: (c, i) {
// return Text("sdd");
return Card(
elevation: 0.0,
child: ListTile(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => NotificationDetail(
post: allPosts[i],
),
),
);
},
// dense: true,
isThreeLine: true,
trailing: RichText(
textAlign: TextAlign.center,
text: TextSpan(
text: "${allPosts[i].postTotalTime}\n",
style: Theme.of(context)
.textTheme
.title
.copyWith(fontSize: 14, fontWeight: FontWeight.bold),
children: [
TextSpan(
text: allPosts[i].postStartTime,
style: Theme.of(context).textTheme.subtitle.copyWith(
fontSize: 12,
),
),
],
),
),
leading: Hero(
tag: allPosts[i].venueImage,
child: CircleAvatar(
radius: 30,
backgroundImage:
CachedNetworkImageProvider(allPosts[i].venueImage),
),
),
title: RichText(
text: TextSpan(
text: "${allPosts[i].postTitle}\n",
style: Theme.of(context).textTheme.title.copyWith(fontSize: 16),
children: [
TextSpan(
text: allPosts[i].venueName,
style: Theme.of(context).textTheme.subtitle.copyWith(
fontSize: 14,
color: Tools.multiColors[Random().nextInt(4)],
),
children: []),
],
),
),
subtitle: Text(
allPosts[i].postDesc,
style: Theme.of(context).textTheme.caption.copyWith(
fontSize: 10.0,
),
),
),
);
},
);
}
}
| 32.885057 | 80 | 0.463824 |
83ce699962024a67de35eb4b6f816b4aec04a10f | 133 | java | Java | springboot-service-locator-factory-bean/src/main/java/com/springboot/registry/ServiceRegistry.java | SimpleProgramming/springboot-servicelocatorfactorybean | 2eb47dd30d08a171367fae142e9cfc1b1937dbdf | [
"MIT"
] | 3 | 2020-09-13T23:23:42.000Z | 2022-01-18T11:10:21.000Z | springboot-service-locator-factory-bean/src/main/java/com/springboot/registry/ServiceRegistry.java | dolfi/springboot-servicelocatorfactorybean | 2eb47dd30d08a171367fae142e9cfc1b1937dbdf | [
"MIT"
] | null | null | null | springboot-service-locator-factory-bean/src/main/java/com/springboot/registry/ServiceRegistry.java | dolfi/springboot-servicelocatorfactorybean | 2eb47dd30d08a171367fae142e9cfc1b1937dbdf | [
"MIT"
] | 5 | 2019-04-12T11:57:47.000Z | 2021-06-30T02:51:59.000Z | package com.springboot.registry;
public interface ServiceRegistry {
public <T> AdapterService<T> getService(String serviceName);
}
| 22.166667 | 61 | 0.804511 |
80a620ec9d2c13dcdb449e22e47465a1455ab453 | 1,664 | dart | Dart | lib/flutter_shake_plugin.dart | ajaykumargithub2114/FlutterShakePlugin | 8d2d9c6c48525921afd906033f51206e5b43f50b | [
"Apache-2.0"
] | 3 | 2019-04-24T15:08:30.000Z | 2020-05-31T18:24:33.000Z | lib/flutter_shake_plugin.dart | ajaykumargithub2114/FlutterShakePlugin | 8d2d9c6c48525921afd906033f51206e5b43f50b | [
"Apache-2.0"
] | null | null | null | lib/flutter_shake_plugin.dart | ajaykumargithub2114/FlutterShakePlugin | 8d2d9c6c48525921afd906033f51206e5b43f50b | [
"Apache-2.0"
] | 2 | 2020-03-13T05:26:50.000Z | 2021-09-21T19:43:59.000Z | import 'dart:async';
import 'dart:math';
import 'package:sensors/sensors.dart';
import 'package:vibration/vibration.dart';
/// Callback for phone shakes
typedef Null PhoneShakeCallback();
class FlutterShakePlugin {
/// callback for phone shake
final PhoneShakeCallback onPhoneShaken;
/// Minimum time between shake
final int shakeTimeMS;
/// Last shake time
var _lastTime = 0;
/// Shake detection threshold
final double shakeThresholdGravity;
/// if do vibration when phone shakes
final bool shouldVibrate;
/// vibration duration
final int vibrateDuration;
/// StreamSubscription for Accelerometer events
StreamSubscription? streamSubscription;
/// This constructor waits until [startListening] is called
FlutterShakePlugin({
required this.onPhoneShaken,
this.shakeTimeMS = 500,
this.shakeThresholdGravity = 3.25,
this.shouldVibrate = true,
this.vibrateDuration = 500,
});
/// Starts listening to accerelometer events
void startListening() {
streamSubscription = accelerometerEvents.listen((AccelerometerEvent event) {
var now = DateTime.now().millisecondsSinceEpoch;
if ((now - _lastTime) > shakeTimeMS) {
double x = event.x;
double y = event.y;
double z = event.z;
double acceleration = sqrt(x * x + y * y + z * z) - 9.8;
if (acceleration > shakeThresholdGravity) {
if (shouldVibrate) Vibration.vibrate(duration: vibrateDuration);
_lastTime = now;
onPhoneShaken();
}
}
});
}
/// Stops listening to accelerometer events
void stopListening() {
streamSubscription?.cancel();
}
}
| 26 | 80 | 0.683293 |
60dec4ab658df4fce77dd8d30ab75ea5beb1a9ef | 477 | sql | SQL | sql/_17_sql_extension2/_02_full_test/_05_date_time_function/_15_sec_to_time/cases/sec_to_time_002.sql | Zhaojia2019/cubrid-testcases | 475a828e4d7cf74aaf2611fcf791a6028ddd107d | [
"BSD-3-Clause"
] | 9 | 2016-03-24T09:51:52.000Z | 2022-03-23T10:49:47.000Z | sql/_17_sql_extension2/_02_full_test/_05_date_time_function/_15_sec_to_time/cases/sec_to_time_002.sql | Zhaojia2019/cubrid-testcases | 475a828e4d7cf74aaf2611fcf791a6028ddd107d | [
"BSD-3-Clause"
] | 173 | 2016-04-13T01:16:54.000Z | 2022-03-16T07:50:58.000Z | sql/_17_sql_extension2/_02_full_test/_05_date_time_function/_15_sec_to_time/cases/sec_to_time_002.sql | Zhaojia2019/cubrid-testcases | 475a828e4d7cf74aaf2611fcf791a6028ddd107d | [
"BSD-3-Clause"
] | 38 | 2016-03-24T17:10:31.000Z | 2021-10-30T22:55:45.000Z | --pass marginal int values to the parameter
--marginal values
select sec_to_time(2147483648);
select sec_to_time(23*59*59);
select sec_to_time(0);
select sec_to_time(1);
--exceptional values
select sec_to_time(-1);
select sec_to_time(10000000000);
select sec_to_time(24*60*60);
select sec_to_time(1.23);
select sec_to_time(-2147483648);
select sec_to_time();
select sec_to_time(null);
select sec_to_time(200, 200);
select sec_to_time(?);
select sec_to_time;
| 12.891892 | 43 | 0.761006 |
9c746a8687f61e0ba45d2f039d3da6363df34a93 | 3,773 | js | JavaScript | seekers.js | dominictarr/bipf | 2851ec61edae77a7cf6df0be3bdf2339d34b4066 | [
"MIT"
] | 10 | 2019-06-12T10:05:17.000Z | 2020-07-11T12:13:31.000Z | seekers.js | dominictarr/bipf | 2851ec61edae77a7cf6df0be3bdf2339d34b4066 | [
"MIT"
] | 2 | 2020-09-01T10:02:07.000Z | 2020-09-02T07:45:27.000Z | seekers.js | dominictarr/bipf | 2851ec61edae77a7cf6df0be3bdf2339d34b4066 | [
"MIT"
] | 2 | 2020-07-21T18:03:34.000Z | 2020-09-01T09:49:02.000Z | const varint = require('fast-varint')
const { decode } = require('./decode')
const { STRING, OBJECT, TAG_SIZE, TAG_MASK } = require('./constants')
// buffer -> start -> target -> result
// WeakMap<Buffer, Map<number, Map<string, number>>>
const cache1 = new WeakMap()
// TODO rewrite the seek methods so that there is minimal copies.
function seekKey(buffer, start, target) {
if (start === -1) return -1
const tag = varint.decode(buffer, start)
const type = tag & TAG_MASK
if (type !== OBJECT) return -1
target = Buffer.isBuffer(target) ? target : Buffer.from(target)
const targetLength = target.length
const len = tag >> TAG_SIZE
for (let c = varint.decode.bytes; c < len; ) {
const keyTag = varint.decode(buffer, start + c)
c += varint.decode.bytes
const keyLen = keyTag >> TAG_SIZE
const keyType = keyTag & TAG_MASK
if (keyType === STRING && targetLength === keyLen)
if (
buffer.compare(
target,
0,
targetLength,
start + c,
start + c + targetLength
) === 0
)
return start + c + keyLen
c += keyLen
const valueTag = varint.decode(buffer, start + c)
c += varint.decode.bytes
const valueLen = valueTag >> TAG_SIZE
c += valueLen
}
return -1
}
function createSeekPathSrc(target) {
return (
'"use strict";\n' + //go fast sauce!
target
.map(function (e, i) {
return ' var k' + i + ' = Buffer.from(' + JSON.stringify(e) + ');' //strings only!
})
.join('\n') +
'\n' +
' return function (buffer, start) {\n' +
target
.map(function (_, i) {
return ' start = seekKey(buffer, start, k' + i + ')'
})
.join('\n') +
'\n' +
' return start;\n' +
'}\n'
)
}
function seekKey2(buffer, start, target, targetStart) {
const tag = varint.decode(buffer, start)
const type = tag & TAG_MASK
if (type !== OBJECT) return -1
let c = varint.decode.bytes
const len = tag >> TAG_SIZE
const targetTag = varint.decode(target, targetStart)
const targetLen = (targetTag >> TAG_SIZE) + varint.decode.bytes
for (; c < len; ) {
const keyTag = varint.decode(buffer, start + c)
if (
keyTag === targetTag &&
buffer.compare(
target,
targetStart,
targetLen,
start + c,
start + c + targetLen
) === 0
)
return start + c + targetLen
c += varint.decode.bytes
const keyLen = keyTag >> TAG_SIZE
c += keyLen
const valueTag = varint.decode(buffer, start + c)
c += varint.decode.bytes
const valueLen = valueTag >> TAG_SIZE
c += valueLen
}
return -1
}
function seekKeyCached(buffer, start, target) {
let cache2 = cache1.get(buffer)
if (!cache2) cache1.set(buffer, (cache2 = new Map()))
let cache3 = cache2.get(start)
if (!cache3) cache2.set(start, (cache3 = new Map()))
if (typeof target !== 'string') {
throw new Error('seekKeyCached only supports string target')
}
if (cache3.has(target)) {
return cache3.get(target)
} else {
const result = seekKey(buffer, start, target)
cache3.set(target, result)
return result
}
}
function seekPath(buffer, start, target, targetStart) {
targetStart = targetStart || 0
const ary = decode(target, targetStart)
if (!Array.isArray(ary)) throw new Error('path must be encoded array')
for (let i = 0; i < ary.length; i++) {
var string = ary[i]
start = seekKey(buffer, start, string)
if (start === -1) return -1
}
return start
}
function createSeekPath(target) {
return new Function('seekKey', createSeekPathSrc(target))(seekKey)
}
module.exports = {
seekKey,
seekKey2,
seekKeyCached,
seekPath,
createSeekPathSrc,
createSeekPath,
}
| 26.570423 | 91 | 0.606414 |