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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7286b341a2b518ce84e72417cd69bc9610fbb0e2
| 6,494 |
rs
|
Rust
|
program/tests/program_test/scenarios.rs
|
dboures/mango-v3
|
193f096af9a2da5a579ca83509e3def751f6cbcd
|
[
"MIT"
] | null | null | null |
program/tests/program_test/scenarios.rs
|
dboures/mango-v3
|
193f096af9a2da5a579ca83509e3def751f6cbcd
|
[
"MIT"
] | null | null | null |
program/tests/program_test/scenarios.rs
|
dboures/mango-v3
|
193f096af9a2da5a579ca83509e3def751f6cbcd
|
[
"MIT"
] | null | null | null |
use crate::*;
use solana_sdk::transport::TransportError;
#[allow(dead_code)]
pub fn arrange_deposit_all_scenario(
test: &mut MangoProgramTest,
user_index: usize,
mint_amount: f64,
quote_amount: f64,
) -> Vec<(usize, usize, f64)> {
let mut user_deposits = Vec::new();
for mint_index in 0..test.num_mints - 1 {
user_deposits.push((user_index, mint_index, mint_amount));
}
user_deposits.push((user_index, test.quote_index, quote_amount));
return user_deposits;
}
#[allow(dead_code)]
pub async fn deposit_scenario(
test: &mut MangoProgramTest,
mango_group_cookie: &mut MangoGroupCookie,
deposits: &Vec<(usize, usize, f64)>,
) {
mango_group_cookie.run_keeper(test).await;
for deposit in deposits {
let (user_index, mint_index, amount) = deposit;
let mint = test.with_mint(*mint_index);
let deposit_amount = (*amount * mint.unit) as u64;
test.perform_deposit(&mango_group_cookie, *user_index, *mint_index, deposit_amount).await;
}
}
#[allow(dead_code)]
pub async fn withdraw_scenario(
test: &mut MangoProgramTest,
mango_group_cookie: &mut MangoGroupCookie,
withdraws: &Vec<(usize, usize, f64, bool)>,
) {
mango_group_cookie.run_keeper(test).await;
for (user_index, mint_index, amount, allow_borrow) in withdraws {
let mint = test.with_mint(*mint_index);
let withdraw_amount = (*amount * mint.unit) as u64;
test.perform_withdraw(
&mango_group_cookie,
*user_index,
*mint_index,
withdraw_amount,
*allow_borrow,
)
.await;
}
}
#[allow(dead_code)]
pub async fn withdraw_scenario_with_delegate(
test: &mut MangoProgramTest,
mango_group_cookie: &mut MangoGroupCookie,
withdraw: &(usize, usize, usize, f64, bool),
) -> Result<(), TransportError> {
mango_group_cookie.run_keeper(test).await;
let (user_index, delegate_user_index, mint_index, amount, allow_borrow) = withdraw;
let mint = test.with_mint(*mint_index);
let withdraw_amount = (*amount * mint.unit) as u64;
test.perform_withdraw_with_delegate(
&mango_group_cookie,
*user_index,
*delegate_user_index,
*mint_index,
withdraw_amount,
*allow_borrow,
)
.await
}
#[allow(dead_code)]
pub async fn delegate_scenario(
test: &mut MangoProgramTest,
mango_group_cookie: &mut MangoGroupCookie,
user_index: usize,
delegate_user_index: usize,
) {
test.perform_set_delegate(&mango_group_cookie, user_index, delegate_user_index).await;
}
#[allow(dead_code)]
pub async fn reset_delegate_scenario(
test: &mut MangoProgramTest,
mango_group_cookie: &mut MangoGroupCookie,
user_index: usize,
) {
test.perform_reset_delegate(&mango_group_cookie, user_index).await;
}
#[allow(dead_code)]
pub async fn place_spot_order_scenario(
test: &mut MangoProgramTest,
mango_group_cookie: &mut MangoGroupCookie,
spot_orders: &Vec<(usize, usize, serum_dex::matching::Side, f64, f64)>,
) {
mango_group_cookie.run_keeper(test).await;
for spot_order in spot_orders {
let (user_index, market_index, order_side, order_size, order_price) = *spot_order;
let mut spot_market_cookie = mango_group_cookie.spot_markets[market_index];
spot_market_cookie
.place_order(test, mango_group_cookie, user_index, order_side, order_size, order_price)
.await;
mango_group_cookie.users_with_spot_event[market_index].push(user_index);
}
}
#[allow(dead_code)]
pub async fn place_spot_order_scenario_with_delegate(
test: &mut MangoProgramTest,
mango_group_cookie: &mut MangoGroupCookie,
spot_order: &(usize, usize, usize, serum_dex::matching::Side, f64, f64),
) -> Result<(), TransportError> {
mango_group_cookie.run_keeper(test).await;
let (user_index, delegate_user_index, market_index, order_side, order_size, order_price) =
*spot_order;
let mut spot_market_cookie = mango_group_cookie.spot_markets[market_index];
mango_group_cookie.users_with_spot_event[market_index].push(user_index);
spot_market_cookie
.place_order_with_delegate(
test,
mango_group_cookie,
user_index,
delegate_user_index,
order_side,
order_size,
order_price,
)
.await
}
#[allow(dead_code)]
pub async fn place_perp_order_scenario(
test: &mut MangoProgramTest,
mango_group_cookie: &mut MangoGroupCookie,
perp_orders: &Vec<(usize, usize, mango::matching::Side, f64, f64)>,
) {
mango_group_cookie.run_keeper(test).await;
for perp_order in perp_orders {
let (user_index, market_index, order_side, order_size, order_price) = *perp_order;
let mut perp_market_cookie = mango_group_cookie.perp_markets[market_index];
perp_market_cookie
.place_order(
test,
mango_group_cookie,
user_index,
order_side,
order_size,
order_price,
PlacePerpOptions::default(),
)
.await;
mango_group_cookie.users_with_perp_event[market_index].push(user_index);
}
}
#[allow(dead_code)]
pub async fn match_spot_order_scenario(
test: &mut MangoProgramTest,
mango_group_cookie: &mut MangoGroupCookie,
matched_spot_orders: &Vec<Vec<(usize, usize, serum_dex::matching::Side, f64, f64)>>,
) {
for matched_spot_order in matched_spot_orders {
// place_spot_order_scenario() starts by running the keeper
place_spot_order_scenario(test, mango_group_cookie, matched_spot_order).await;
mango_group_cookie.run_keeper(test).await;
mango_group_cookie.consume_spot_events(test).await;
}
mango_group_cookie.run_keeper(test).await;
}
#[allow(dead_code)]
pub async fn match_perp_order_scenario(
test: &mut MangoProgramTest,
mango_group_cookie: &mut MangoGroupCookie,
matched_perp_orders: &Vec<Vec<(usize, usize, mango::matching::Side, f64, f64)>>,
) {
for matched_perp_order in matched_perp_orders {
// place_perp_order_scenario() starts by running the keeper
place_perp_order_scenario(test, mango_group_cookie, matched_perp_order).await;
mango_group_cookie.run_keeper(test).await;
mango_group_cookie.consume_perp_events(test).await;
}
mango_group_cookie.run_keeper(test).await;
}
| 32.79798 | 99 | 0.68879 |
934ae1cd4a8acb7211585d40999680f07c48202d
| 425 |
swift
|
Swift
|
Day1/Day1/Extension/CALayer+XibConfiguration.swift
|
prabindatta/Day1
|
19bd931b1bcd6ad9e27110261e6d2165adc9f9c6
|
[
"MIT"
] | null | null | null |
Day1/Day1/Extension/CALayer+XibConfiguration.swift
|
prabindatta/Day1
|
19bd931b1bcd6ad9e27110261e6d2165adc9f9c6
|
[
"MIT"
] | null | null | null |
Day1/Day1/Extension/CALayer+XibConfiguration.swift
|
prabindatta/Day1
|
19bd931b1bcd6ad9e27110261e6d2165adc9f9c6
|
[
"MIT"
] | null | null | null |
//
// CALayer+XibConfiguration.swift
// Day1
//
// Created by Prabin K Datta on 12/12/16.
// Copyright © 2016 Prabin K Datta. All rights reserved.
//
import Foundation
import QuartzCore
import UIKit
extension CALayer{
var borderUIColor: UIColor {
get {
return UIColor.init(cgColor: self.borderColor!)
}
set(color) {
self.borderColor = color.cgColor
}
}
}
| 18.478261 | 59 | 0.616471 |
f0199c2ddd6cf1a82c3279d8fee04fa2d5d2f015
| 3,674 |
py
|
Python
|
env2048.py
|
qhduan/rl-2048
|
9730d366625ac7ffdd8875586ffbb8615468f110
|
[
"MIT"
] | 3 |
2022-02-10T02:19:58.000Z
|
2022-03-06T14:39:20.000Z
|
env2048.py
|
qhduan/rl-2048
|
9730d366625ac7ffdd8875586ffbb8615468f110
|
[
"MIT"
] | null | null | null |
env2048.py
|
qhduan/rl-2048
|
9730d366625ac7ffdd8875586ffbb8615468f110
|
[
"MIT"
] | null | null | null |
import logic
import numpy as np
import gym
ACTION_MAP = {
0: 'up',
1: 'down',
2: 'left',
3: 'right'
}
class Env2048(gym.Env):
metadata = {'render.modes': ['human']}
def __init__(self, n=4, max_idle=100, seed=None):
super(Env2048, self).__init__()
self.n = n
self.max_idle = max_idle
self.action_map = ACTION_MAP
# up, down, left, right
self.action_space = gym.spaces.Discrete(4)
self.observation_space = gym.spaces.Box(
low=0, high=255,
shape=(self.n, self.n, 2 ** n), dtype=np.uint8)
self.eye = np.eye(2 ** n)
self.reward_range = (float('-inf'), float('inf'))
if seed is not None:
self.seed(seed)
def seed(self, seed):
np.random.seed(seed)
def reset(self):
self.matrix = logic.new_game(self.n)
self.reward_i = self.i = 0
self.total_reward = 0
return self.obs
@property
def obs(self):
m = np.array(self.matrix)
m = np.clip(m, 1, float('inf')) # from 0, 2, 4, 8, ... to 1, 2, 4, 8
m = np.log2(m).astype(np.int64) # from 1, 2, 4, 8,..., 2048 to 0, 1, 2, 3, ..., 11
m = self.eye[m]
m = m * 255
m = m.astype(np.uint8)
obs = m
return obs
def step(self, action):
if isinstance(action, str) and action in ('up', 'down', 'left', 'right'):
pass
if isinstance(action, (int, np.int64, np.int32)):
action = self.action_map[int(action)]
else:
print(action, type(action))
raise
old_score = np.sort(np.array(self.matrix).flatten())[::-1]
old_matrix = str(self.matrix)
# import pdb; pdb.set_trace()
if action == 'up':
self.matrix, updated = logic.up(self.matrix)
elif action == 'down':
self.matrix, updated = logic.down(self.matrix)
elif action == 'left':
self.matrix, updated = logic.left(self.matrix)
elif action == 'right':
self.matrix, updated = logic.right(self.matrix)
new_matrix = str(self.matrix)
new_score = np.sort(np.array(self.matrix).flatten())[::-1]
reward = np.sum((new_score - old_score) * (new_score >= old_score)) * 4
reward = float(reward)
self.total_reward += reward
self.i += 1
if updated: # matrix有更新
self.matrix = logic.add_two(self.matrix)
if logic.game_state(self.matrix) == 'win':
print('you win')
return self.obs, 10000.0, True, {'i': self.i, 'ri': self.reward_i, 'tr': self.total_reward}
elif logic.game_state(self.matrix) == 'lose':
return self.obs, 100.0, True, {'i': self.i, 'ri': self.reward_i, 'tr': self.total_reward}
idle = False
if old_matrix == new_matrix:
idle = True
if idle:
reward = -1
else:
self.reward_i = self.i
if self.i - self.reward_i > self.max_idle:
return self.obs, -100, True, {'i': self.i, 'ri': self.reward_i, 'tr': self.total_reward}
return self.obs, reward, False, {'i': self.i, 'ri': self.reward_i, 'tr': self.total_reward}
def render(self, mode='human'):
pass
def close(self):
pass
def main():
env = Env2048()
obs = env.reset()
print(obs)
for _ in range(1000):
obs, reward, done, info = env.step(np.random.choice(['right', 'left', 'up', 'down']))
print(obs)
print(reward, done, info)
if done:
break
if __name__ == '__main__':
main()
| 29.15873 | 107 | 0.531301 |
73c2d46d2f7ebdd4a9948582d5a9c24650031b36
| 56,297 |
sql
|
SQL
|
db_dms_dhl (8).sql
|
poonix/dhl_mei04
|
15d18dacd13b6e3c9d3d037db6a2008245c29ee3
|
[
"MIT"
] | null | null | null |
db_dms_dhl (8).sql
|
poonix/dhl_mei04
|
15d18dacd13b6e3c9d3d037db6a2008245c29ee3
|
[
"MIT"
] | null | null | null |
db_dms_dhl (8).sql
|
poonix/dhl_mei04
|
15d18dacd13b6e3c9d3d037db6a2008245c29ee3
|
[
"MIT"
] | null | null | null |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 16, 2018 at 07:22 PM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `db_dms_dhl`
--
-- --------------------------------------------------------
--
-- Table structure for table `cms_user`
--
CREATE TABLE `cms_user` (
`id` int(10) UNSIGNED NOT NULL,
`username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`updated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `cms_user`
--
INSERT INTO `cms_user` (`id`, `username`, `password`, `name`, `remember_token`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'superadmin', '1234', 'Superadmin CMS', NULL, NULL, NULL, '2018-03-21 08:57:11', '2018-04-01 17:06:22');
-- --------------------------------------------------------
--
-- Table structure for table `dms_form`
--
CREATE TABLE `dms_form` (
`id` int(10) UNSIGNED NOT NULL,
`id_dms_form` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`plat_no` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`driver_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`id_location` int(10) NOT NULL,
`id_purpose` int(11) NOT NULL,
`asal` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`tujuan` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`driver_phone` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`type_of_vehicle` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`transporter_company` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`shipment` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`cust_proj_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`created_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`updated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `dms_form`
--
INSERT INTO `dms_form` (`id`, `id_dms_form`, `plat_no`, `driver_name`, `id_location`, `id_purpose`, `asal`, `tujuan`, `driver_phone`, `type_of_vehicle`, `transporter_company`, `shipment`, `cust_proj_name`, `created_at`, `created_by`, `updated_at`, `updated_by`) VALUES
(115, 'DMS11522614907', 'B 1234 CIB', 'Felicia', 1, 2, 'Bogor', 'Jakarta', '085718841359', 'Container 20\'', 'DHL', 'A1234', '7', '2018-04-01 09:35:07', '13', '2018-04-16 17:08:46', NULL),
(116, 'DMS11522614998', 'F 3322 CIB', 'Yudhi', 1, 2, 'Malaysia', NULL, '085716423138', 'Van / L300', 'SML', 'A1444', '8', '2018-04-01 09:36:38', '1', '2018-04-16 15:55:18', NULL),
(117, 'DMS21522615084', 'F 1123 CIB', 'Rani', 1, 2, NULL, 'Bandung', '085718841359', 'Fuso', 'SPILL', 'A1455', '8', '2018-04-01 09:38:04', '1', '2018-04-16 16:10:25', NULL),
(120, 'DMS11522615629', 'F 1123 DB', 'Fakih', 1, 1, 'Medan', NULL, '085718841359', 'Container 20\'', 'DHL', 'A098+', '7', '2018-04-01 09:47:09', '1', '2018-04-16 16:01:57', NULL),
(143, 'DMS11523368679', 'F 3361 BKD', 'Roni', 1, 1, 'Bogor', NULL, '085718841359', 'Wing-Box', 'DHL', 'A5122', '8', '2018-04-10 02:57:59', '1', '2018-04-16 16:08:04', NULL),
(144, 'DMS21523370851', 'F 6543 TR', 'Oman', 1, 2, NULL, 'Bogor', '085716423138', 'CDE / CD4', 'SYAKA', NULL, '7', '2018-04-10 03:34:11', '1', '2018-04-16 15:54:34', NULL),
(145, 'DMS21523370887', 'F 6543 TR', 'Komara', 1, 2, NULL, 'Gondangdia', '085718841359', 'CDE / CD4', 'SML', NULL, '7', '2018-04-10 03:34:47', '13', '2018-04-16 16:26:18', NULL),
(147, 'DMS11523645650', 'F1123RA', 'Felicia', 1, 1, 'Bogor', 'Jakarta', '089634848272', 'Van / L300', 'SiCepat', 'A134EE', '8', '2018-04-13 07:54:10', '1', '2018-04-16 16:10:08', NULL),
(148, 'DMS21523932700', 'F1123RA', 'Riri', 1, 2, 'Medan', 'Jakarta', '085718888888', 'CDE / CD4', 'SYAKA', 'A1444', '8', '2018-04-16 15:38:20', '1', '2018-04-16 16:10:41', NULL),
(150, 'DMS11523933866', 'F1123RA', 'Riyon', 1, 1, 'Medan', 'Gondangdia', '089634848272', 'Van / L300', 'SYAKA', 'A1234TT', '8', '2018-04-16 15:57:46', '1', '2018-04-16 16:08:30', NULL),
(151, 'DMS11523933898', 'F1233RT', 'Oman', 1, 1, 'Malaysia', 'Gondangdia', '085716423138', 'Fuso', 'SPILL', 'A1234', '7', '2018-04-16 15:58:18', '1', '2018-04-16 15:58:18', NULL),
(152, 'DMS11523933943', 'F1123RE', 'Rida', 1, 1, 'Malaysia', 'Jakarta', '0877788987898', 'Wing-Box', 'SYAKA', 'A1444', '7', '2018-04-16 15:59:03', '1', '2018-04-16 15:59:03', NULL),
(154, 'DMS11523934017', 'F1233RT', 'Omen', 1, 1, 'Medan', 'Bogor', '085716423138', 'Tronton', 'DHL', 'A1444', '7', '2018-04-16 16:00:17', '1', '2018-04-16 16:00:17', NULL),
(155, 'DMS11523934077', 'F6543TR', 'Koere', 1, 1, 'Bogor', 'Bandung', '085718888888', 'Wing-Box', 'SYAKA', 'A098+', '7', '2018-04-16 16:01:18', '1', '2018-04-16 16:01:18', NULL),
(156, 'DMS11523934155', 'F9923DB', 'Rina', 1, 1, 'Malaysia', 'Gondangdia', '089634848272', 'CDE / CD4', 'SPILL', 'A098+', '7', '2018-04-16 16:02:35', '1', '2018-04-16 16:02:35', NULL),
(157, 'DMS21523934290', 'F6543TR', 'Faqoh', 1, 2, 'Malaysia', 'Jakarta', '089635675676', 'CDD / CD6', 'SYAKA', 'A1234TT', '7', '2018-04-16 16:04:50', '1', '2018-04-16 16:04:50', NULL),
(159, 'DMS21523934397', 'F1233RT', 'Fakun', 1, 2, 'Medan', 'Bandung', '085718888888', 'Wing-Box', 'SYAKA', 'A134EE', '7', '2018-04-16 16:06:38', '1', '2018-04-16 16:06:38', NULL),
(160, 'DMS21523934457', 'F1233RT', 'Rama', 1, 2, 'Malaysia', 'Jakarta', '085718888888', 'Van / L300', 'SPILL', 'A1234TT', '7', '2018-04-16 16:07:37', '1', '2018-04-16 16:07:37', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `dms_master_asal`
--
CREATE TABLE `dms_master_asal` (
`id` int(10) UNSIGNED NOT NULL,
`asal` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`updated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `dms_master_asal`
--
INSERT INTO `dms_master_asal` (`id`, `asal`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'Bogor', '1', NULL, '2018-04-13 06:20:43', '2018-04-13 06:20:49'),
(3, 'Medan', '1', NULL, '2018-04-13 08:06:52', '2018-04-13 08:06:52'),
(4, '.', '1', NULL, '2018-04-13 08:07:00', '2018-04-13 08:07:00'),
(5, 'Medan', '1', NULL, '2018-04-16 15:41:39', '2018-04-16 15:41:39'),
(6, 'Malaysia', '1', NULL, '2018-04-16 15:55:04', '2018-04-16 15:55:04'),
(7, 'Malaysia', '1', NULL, '2018-04-16 15:55:18', '2018-04-16 15:55:18'),
(8, 'Medan', '1', NULL, '2018-04-16 15:57:46', '2018-04-16 15:57:46'),
(9, 'Malaysia', '1', NULL, '2018-04-16 15:58:18', '2018-04-16 15:58:18'),
(10, 'Malaysia', '1', NULL, '2018-04-16 15:59:04', '2018-04-16 15:59:04'),
(11, 'Medan', '1', NULL, '2018-04-16 15:59:42', '2018-04-16 15:59:42'),
(12, 'Medan', '1', NULL, '2018-04-16 16:00:18', '2018-04-16 16:00:18'),
(13, 'Bogor', '1', NULL, '2018-04-16 16:01:18', '2018-04-16 16:01:18'),
(14, 'Medan', '1', NULL, '2018-04-16 16:01:58', '2018-04-16 16:01:58'),
(15, 'Malaysia', '1', NULL, '2018-04-16 16:02:35', '2018-04-16 16:02:35'),
(16, 'Medan', '1', NULL, '2018-04-16 16:02:59', '2018-04-16 16:02:59'),
(17, 'Malaysia', '1', NULL, '2018-04-16 16:04:51', '2018-04-16 16:04:51'),
(18, 'Medan', '1', NULL, '2018-04-16 16:05:47', '2018-04-16 16:05:47'),
(19, 'Medan', '1', NULL, '2018-04-16 16:06:38', '2018-04-16 16:06:38'),
(20, 'Malaysia', '1', NULL, '2018-04-16 16:07:38', '2018-04-16 16:07:38'),
(21, 'Bogor', '1', NULL, '2018-04-16 16:08:04', '2018-04-16 16:08:04'),
(22, 'Medan', '1', NULL, '2018-04-16 16:08:30', '2018-04-16 16:08:30'),
(23, 'Medan', '1', NULL, '2018-04-16 16:08:43', '2018-04-16 16:08:43'),
(24, 'Bogor', '1', NULL, '2018-04-16 16:09:43', '2018-04-16 16:09:43'),
(25, 'Bogor', '1', NULL, '2018-04-16 16:10:08', '2018-04-16 16:10:08'),
(26, 'Medan', '1', NULL, '2018-04-16 16:10:41', '2018-04-16 16:10:41'),
(27, 'Bogor', '13', NULL, '2018-04-16 17:08:47', '2018-04-16 17:08:47');
-- --------------------------------------------------------
--
-- Table structure for table `dms_master_location`
--
CREATE TABLE `dms_master_location` (
`id` int(10) UNSIGNED NOT NULL,
`location` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`id_project` int(10) NOT NULL,
`created_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`updated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `dms_master_location`
--
INSERT INTO `dms_master_location` (`id`, `location`, `id_project`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'Cibitung', 7, '1', '', '2018-03-28 09:57:16', '2018-04-09 06:45:19'),
(2, 'Surabaya', 8, '1', '', '2018-03-28 09:57:16', '2018-04-09 06:45:22'),
(3, 'Cibitung', 8, '1', '1', '2018-03-29 04:26:33', '2018-04-09 06:45:39'),
(4, 'Surabaya', 7, '1', NULL, '2018-03-29 00:56:10', '2018-04-09 06:45:26');
-- --------------------------------------------------------
--
-- Table structure for table `dms_master_name`
--
CREATE TABLE `dms_master_name` (
`id` int(10) UNSIGNED NOT NULL,
`driver_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`updated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `dms_master_name`
--
INSERT INTO `dms_master_name` (`id`, `driver_name`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'lutfi', '1', '', NULL, NULL),
(2, 'Felicia', '1', NULL, '2018-04-13 06:58:43', '2018-04-13 06:58:43'),
(3, 'Riyan', '1', NULL, '2018-04-13 07:12:58', '2018-04-13 07:12:58'),
(4, 'Fakih', '1', NULL, '2018-04-13 08:06:52', '2018-04-13 08:06:52'),
(5, 'Riri', '1', NULL, '2018-04-16 15:41:39', '2018-04-16 15:41:39'),
(6, 'Komara', '1', NULL, '2018-04-16 15:54:18', '2018-04-16 15:54:18'),
(7, 'Oman', '1', NULL, '2018-04-16 15:54:35', '2018-04-16 15:54:35'),
(8, 'Rina', '1', NULL, '2018-04-16 15:54:49', '2018-04-16 15:54:49'),
(9, 'Yudhi Prabowo', '1', NULL, '2018-04-16 15:55:04', '2018-04-16 15:55:04'),
(10, 'Yudhi', '1', NULL, '2018-04-16 15:55:18', '2018-04-16 15:55:18'),
(11, 'Riyan', '1', NULL, '2018-04-16 15:57:46', '2018-04-16 15:57:46'),
(12, 'Oman', '1', NULL, '2018-04-16 15:58:18', '2018-04-16 15:58:18'),
(13, 'Rida', '1', NULL, '2018-04-16 15:59:04', '2018-04-16 15:59:04'),
(14, 'Komoui', '1', NULL, '2018-04-16 15:59:42', '2018-04-16 15:59:42'),
(15, 'Omen', '1', NULL, '2018-04-16 16:00:18', '2018-04-16 16:00:18'),
(16, 'Koere', '1', NULL, '2018-04-16 16:01:18', '2018-04-16 16:01:18'),
(17, 'Fakih', '1', NULL, '2018-04-16 16:01:58', '2018-04-16 16:01:58'),
(18, 'Rina', '1', NULL, '2018-04-16 16:02:35', '2018-04-16 16:02:35'),
(19, 'Riyon', '1', NULL, '2018-04-16 16:02:59', '2018-04-16 16:02:59'),
(20, 'Rani', '1', NULL, '2018-04-16 16:03:33', '2018-04-16 16:03:33'),
(21, 'Faqoh', '1', NULL, '2018-04-16 16:04:51', '2018-04-16 16:04:51'),
(22, 'Fasah', '1', NULL, '2018-04-16 16:05:47', '2018-04-16 16:05:47'),
(23, 'Fakun', '1', NULL, '2018-04-16 16:06:38', '2018-04-16 16:06:38'),
(24, 'Rama', '1', NULL, '2018-04-16 16:07:38', '2018-04-16 16:07:38'),
(25, 'Roni', '1', NULL, '2018-04-16 16:08:04', '2018-04-16 16:08:04'),
(26, 'Riyon', '1', NULL, '2018-04-16 16:08:30', '2018-04-16 16:08:30'),
(27, 'Riyon', '1', NULL, '2018-04-16 16:08:43', '2018-04-16 16:08:43'),
(28, 'Felicia', '1', NULL, '2018-04-16 16:09:43', '2018-04-16 16:09:43'),
(29, 'Felicia', '1', NULL, '2018-04-16 16:10:08', '2018-04-16 16:10:08'),
(30, 'Rani', '1', NULL, '2018-04-16 16:10:26', '2018-04-16 16:10:26'),
(31, 'Riri', '1', NULL, '2018-04-16 16:10:41', '2018-04-16 16:10:41'),
(32, 'Komara', '13', NULL, '2018-04-16 16:26:18', '2018-04-16 16:26:18'),
(33, 'Felicia', '13', NULL, '2018-04-16 17:08:47', '2018-04-16 17:08:47');
-- --------------------------------------------------------
--
-- Table structure for table `dms_master_phone`
--
CREATE TABLE `dms_master_phone` (
`id` int(10) UNSIGNED NOT NULL,
`driver_phone` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`updated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `dms_master_phone`
--
INSERT INTO `dms_master_phone` (`id`, `driver_phone`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(11, '085718841359', '1', NULL, '2018-04-01 08:27:51', '2018-04-09 06:43:53'),
(23, '089634848272', '1', NULL, '2018-04-01 09:56:02', '2018-04-09 06:44:00'),
(24, '085718888888', '2', NULL, '2018-04-01 19:52:51', '2018-04-09 06:43:57'),
(26, '089635675676', '1', NULL, '2018-04-01 20:10:55', '2018-04-09 06:44:04'),
(55, '0877788987898', '1', NULL, '2018-04-10 02:58:00', '2018-04-10 02:58:00'),
(56, '085716423138', '1', NULL, '2018-04-12 11:21:36', '2018-04-12 11:21:36'),
(57, 'g', '1', NULL, '2018-04-13 06:30:35', '2018-04-13 06:30:35'),
(58, '085718888888', '1', NULL, '2018-04-16 15:41:39', '2018-04-16 15:41:39'),
(59, '085718841359', '1', NULL, '2018-04-16 15:54:17', '2018-04-16 15:54:17'),
(60, '085716423138', '1', NULL, '2018-04-16 15:54:35', '2018-04-16 15:54:35'),
(61, '085718841359', '1', NULL, '2018-04-16 15:54:49', '2018-04-16 15:54:49'),
(62, '085716423138', '1', NULL, '2018-04-16 15:55:04', '2018-04-16 15:55:04'),
(63, '085716423138', '1', NULL, '2018-04-16 15:55:18', '2018-04-16 15:55:18'),
(64, '089634848272', '1', NULL, '2018-04-16 15:57:46', '2018-04-16 15:57:46'),
(65, '085716423138', '1', NULL, '2018-04-16 15:58:18', '2018-04-16 15:58:18'),
(66, '0877788987898', '1', NULL, '2018-04-16 15:59:03', '2018-04-16 15:59:03'),
(67, '085718888888', '1', NULL, '2018-04-16 15:59:42', '2018-04-16 15:59:42'),
(68, '085716423138', '1', NULL, '2018-04-16 16:00:17', '2018-04-16 16:00:17'),
(69, '085718888888', '1', NULL, '2018-04-16 16:01:18', '2018-04-16 16:01:18'),
(70, '085718841359', '1', NULL, '2018-04-16 16:01:57', '2018-04-16 16:01:57'),
(71, '089634848272', '1', NULL, '2018-04-16 16:02:35', '2018-04-16 16:02:35'),
(72, '089634848272', '1', NULL, '2018-04-16 16:02:59', '2018-04-16 16:02:59'),
(73, '085718841359', '1', NULL, '2018-04-16 16:03:33', '2018-04-16 16:03:33'),
(74, '089635675676', '1', NULL, '2018-04-16 16:04:51', '2018-04-16 16:04:51'),
(75, '089635675676', '1', NULL, '2018-04-16 16:05:47', '2018-04-16 16:05:47'),
(76, '085718888888', '1', NULL, '2018-04-16 16:06:38', '2018-04-16 16:06:38'),
(77, '085718888888', '1', NULL, '2018-04-16 16:07:37', '2018-04-16 16:07:37'),
(78, '085718841359', '1', NULL, '2018-04-16 16:08:04', '2018-04-16 16:08:04'),
(79, '089634848272', '1', NULL, '2018-04-16 16:08:30', '2018-04-16 16:08:30'),
(80, '089634848272', '1', NULL, '2018-04-16 16:08:43', '2018-04-16 16:08:43'),
(81, '089634848272', '1', NULL, '2018-04-16 16:09:43', '2018-04-16 16:09:43'),
(82, '089634848272', '1', NULL, '2018-04-16 16:10:08', '2018-04-16 16:10:08'),
(83, '085718841359', '1', NULL, '2018-04-16 16:10:26', '2018-04-16 16:10:26'),
(84, '085718888888', '1', NULL, '2018-04-16 16:10:41', '2018-04-16 16:10:41'),
(85, '085718841359', '13', NULL, '2018-04-16 16:26:18', '2018-04-16 16:26:18'),
(86, '085718841359', '13', NULL, '2018-04-16 17:08:47', '2018-04-16 17:08:47');
-- --------------------------------------------------------
--
-- Table structure for table `dms_master_plat`
--
CREATE TABLE `dms_master_plat` (
`id` int(10) UNSIGNED NOT NULL,
`plat_no` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`updated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `dms_master_plat`
--
INSERT INTO `dms_master_plat` (`id`, `plat_no`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(55, 'F 1123 Ra', '3', 'Superadmin CMS', '2018-04-01 09:45:39', '2018-04-11 03:45:08'),
(56, 'F 9923 DB', '3', NULL, '2018-04-01 09:47:09', '2018-04-09 06:42:21'),
(57, 'F 6543 TR', '3', NULL, '2018-04-01 09:48:24', '2018-04-09 06:42:24'),
(58, 'F 8823 TT', '3', NULL, '2018-04-01 09:49:32', '2018-04-09 06:42:26'),
(61, 'F 1233 RT', '2', NULL, '2018-04-01 19:52:51', '2018-04-09 06:42:29'),
(67, 'B 1234 CIB', '1', NULL, '2018-04-09 17:27:02', '2018-04-09 17:27:02'),
(90, 'F 3361 BKD', '1', NULL, '2018-04-10 02:58:00', '2018-04-10 02:58:00'),
(91, 'F 1123 RE', '1', NULL, '2018-04-12 11:21:36', '2018-04-12 11:21:36'),
(92, 'g', '1', NULL, '2018-04-13 06:30:35', '2018-04-13 06:30:35'),
(93, 'F1123Ra', '1', NULL, '2018-04-13 07:54:10', '2018-04-13 07:54:10'),
(94, 'F 1123 DB', '1', NULL, '2018-04-13 08:06:52', '2018-04-13 08:06:52'),
(95, 'F1123RA', '1', NULL, '2018-04-16 15:41:39', '2018-04-16 15:41:39'),
(96, 'F 6543 TR', '1', NULL, '2018-04-16 15:54:17', '2018-04-16 15:54:17'),
(97, 'F 6543 TR', '1', NULL, '2018-04-16 15:54:35', '2018-04-16 15:54:35'),
(98, 'F 1123 CIB', '1', NULL, '2018-04-16 15:54:49', '2018-04-16 15:54:49'),
(99, 'F 3322 CIB', '1', NULL, '2018-04-16 15:55:04', '2018-04-16 15:55:04'),
(100, 'F 3322 CIB', '1', NULL, '2018-04-16 15:55:18', '2018-04-16 15:55:18'),
(101, 'F1123RA', '1', NULL, '2018-04-16 15:57:46', '2018-04-16 15:57:46'),
(102, 'F1233RT', '1', NULL, '2018-04-16 15:58:18', '2018-04-16 15:58:18'),
(103, 'F1123RE', '1', NULL, '2018-04-16 15:59:03', '2018-04-16 15:59:03'),
(104, 'F8823TT', '1', NULL, '2018-04-16 15:59:42', '2018-04-16 15:59:42'),
(105, 'F1233RT', '1', NULL, '2018-04-16 16:00:17', '2018-04-16 16:00:17'),
(106, 'F6543TR', '1', NULL, '2018-04-16 16:01:18', '2018-04-16 16:01:18'),
(107, 'F 1123 DB', '1', NULL, '2018-04-16 16:01:57', '2018-04-16 16:01:57'),
(108, 'F9923DB', '1', NULL, '2018-04-16 16:02:35', '2018-04-16 16:02:35'),
(109, 'F1123RA', '1', NULL, '2018-04-16 16:02:59', '2018-04-16 16:02:59'),
(110, 'F 1123 CIB', '1', NULL, '2018-04-16 16:03:33', '2018-04-16 16:03:33'),
(111, 'F6543TR', '1', NULL, '2018-04-16 16:04:51', '2018-04-16 16:04:51'),
(112, 'F6543TR', '1', NULL, '2018-04-16 16:05:47', '2018-04-16 16:05:47'),
(113, 'F1233RT', '1', NULL, '2018-04-16 16:06:38', '2018-04-16 16:06:38'),
(114, 'F1233RT', '1', NULL, '2018-04-16 16:07:37', '2018-04-16 16:07:37'),
(115, 'F 3361 BKD', '1', NULL, '2018-04-16 16:08:04', '2018-04-16 16:08:04'),
(116, 'F1123RA', '1', NULL, '2018-04-16 16:08:30', '2018-04-16 16:08:30'),
(117, 'F1123RA', '1', NULL, '2018-04-16 16:08:43', '2018-04-16 16:08:43'),
(118, 'F1123RA', '1', NULL, '2018-04-16 16:09:43', '2018-04-16 16:09:43'),
(119, 'F1123RA', '1', NULL, '2018-04-16 16:10:08', '2018-04-16 16:10:08'),
(120, 'F 1123 CIB', '1', NULL, '2018-04-16 16:10:26', '2018-04-16 16:10:26'),
(121, 'F1123RA', '1', NULL, '2018-04-16 16:10:41', '2018-04-16 16:10:41'),
(122, 'F 6543 TR', '13', NULL, '2018-04-16 16:26:18', '2018-04-16 16:26:18'),
(123, 'B 1234 CIB', '13', NULL, '2018-04-16 17:08:47', '2018-04-16 17:08:47');
-- --------------------------------------------------------
--
-- Table structure for table `dms_master_project`
--
CREATE TABLE `dms_master_project` (
`id` int(10) UNSIGNED NOT NULL,
`master_project_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`updated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `dms_master_project`
--
INSERT INTO `dms_master_project` (`id`, `master_project_name`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(7, 'SCHNEIDER', '1', '1', '2018-03-21 23:13:07', '2018-04-09 06:42:06'),
(8, 'MONDELEZ', '1', '1', '2018-03-21 23:13:15', '2018-04-09 06:42:09');
-- --------------------------------------------------------
--
-- Table structure for table `dms_master_status`
--
CREATE TABLE `dms_master_status` (
`id` int(10) UNSIGNED NOT NULL,
`status_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`updated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `dms_master_status`
--
INSERT INTO `dms_master_status` (`id`, `status_name`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'Waiting Outside', '1', '1', '2018-03-28 03:47:07', '2018-04-09 06:41:48'),
(2, 'Waiting Gate', '1', NULL, '2018-03-28 03:47:07', '2018-04-09 06:41:37'),
(3, 'Truck Enter WH', '1', NULL, '2018-03-28 03:47:07', '2018-04-09 06:41:39'),
(4, 'Loading', '1', NULL, '2018-03-28 03:47:07', '2018-04-09 06:41:41'),
(5, 'Complete Loading', '1', NULL, '2018-03-28 03:47:07', '2018-04-09 06:41:43'),
(6, 'Leave Warehouse', '1', NULL, '2018-03-28 03:47:07', '2018-04-09 06:41:46');
-- --------------------------------------------------------
--
-- Table structure for table `dms_master_tc`
--
CREATE TABLE `dms_master_tc` (
`id` int(10) UNSIGNED NOT NULL,
`master_tc_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`updated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `dms_master_tc`
--
INSERT INTO `dms_master_tc` (`id`, `master_tc_name`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(2, 'DHL', NULL, NULL, '2018-03-13 15:10:31', '2018-03-13 15:10:31'),
(3, 'SML\r\n', NULL, NULL, '2018-03-13 15:10:31', '2018-04-15 17:53:16'),
(4, 'SPILL', NULL, NULL, '2018-03-13 15:10:31', '2018-04-15 17:53:30'),
(5, 'SYAKA', NULL, NULL, '2018-03-13 15:10:31', '2018-04-15 17:53:49');
-- --------------------------------------------------------
--
-- Table structure for table `dms_master_tujuan`
--
CREATE TABLE `dms_master_tujuan` (
`id` int(10) UNSIGNED NOT NULL,
`tujuan` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`updated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `dms_master_tujuan`
--
INSERT INTO `dms_master_tujuan` (`id`, `tujuan`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'Jakarta', '1', '', NULL, '2018-04-13 06:22:49'),
(2, NULL, '1', NULL, '2018-04-13 06:58:43', '2018-04-13 06:58:43'),
(3, 'Jakarta', '1', NULL, '2018-04-16 15:41:39', '2018-04-16 15:41:39'),
(4, 'Gondangdia', '1', NULL, '2018-04-16 15:54:18', '2018-04-16 15:54:18'),
(5, 'Bogor', '1', NULL, '2018-04-16 15:54:35', '2018-04-16 15:54:35'),
(6, 'Bandung', '1', NULL, '2018-04-16 15:54:49', '2018-04-16 15:54:49'),
(7, 'Gondangdia', '1', NULL, '2018-04-16 15:57:46', '2018-04-16 15:57:46'),
(8, 'Gondangdia', '1', NULL, '2018-04-16 15:58:19', '2018-04-16 15:58:19'),
(9, 'Jakarta', '1', NULL, '2018-04-16 15:59:04', '2018-04-16 15:59:04'),
(10, 'Gondangdia', '1', NULL, '2018-04-16 15:59:42', '2018-04-16 15:59:42'),
(11, 'Bogor', '1', NULL, '2018-04-16 16:00:18', '2018-04-16 16:00:18'),
(12, 'Bandung', '1', NULL, '2018-04-16 16:01:18', '2018-04-16 16:01:18'),
(13, 'Gondangdia', '1', NULL, '2018-04-16 16:02:35', '2018-04-16 16:02:35'),
(14, 'Gondangdia', '1', NULL, '2018-04-16 16:02:59', '2018-04-16 16:02:59'),
(15, 'Bandung', '1', NULL, '2018-04-16 16:03:33', '2018-04-16 16:03:33'),
(16, 'Jakarta', '1', NULL, '2018-04-16 16:04:51', '2018-04-16 16:04:51'),
(17, 'Gondangdia', '1', NULL, '2018-04-16 16:05:47', '2018-04-16 16:05:47'),
(18, 'Bandung', '1', NULL, '2018-04-16 16:06:38', '2018-04-16 16:06:38'),
(19, 'Jakarta', '1', NULL, '2018-04-16 16:07:38', '2018-04-16 16:07:38'),
(20, 'Gondangdia', '1', NULL, '2018-04-16 16:08:30', '2018-04-16 16:08:30'),
(21, 'Gondangdia', '1', NULL, '2018-04-16 16:08:43', '2018-04-16 16:08:43'),
(22, 'Jakarta', '1', NULL, '2018-04-16 16:09:44', '2018-04-16 16:09:44'),
(23, 'Jakarta', '1', NULL, '2018-04-16 16:10:08', '2018-04-16 16:10:08'),
(24, 'Bandung', '1', NULL, '2018-04-16 16:10:26', '2018-04-16 16:10:26'),
(25, 'Jakarta', '1', NULL, '2018-04-16 16:10:41', '2018-04-16 16:10:41'),
(26, 'Gondangdia', '13', NULL, '2018-04-16 16:26:18', '2018-04-16 16:26:18'),
(27, 'Jakarta', '13', NULL, '2018-04-16 17:08:47', '2018-04-16 17:08:47');
-- --------------------------------------------------------
--
-- Table structure for table `dms_master_vehicle`
--
CREATE TABLE `dms_master_vehicle` (
`id` int(10) UNSIGNED NOT NULL,
`master_vehicle_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`updated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `dms_master_vehicle`
--
INSERT INTO `dms_master_vehicle` (`id`, `master_vehicle_name`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(3, 'Van / L300', NULL, '1', '2018-03-13 15:07:58', '2018-04-09 06:41:12'),
(4, 'CDE / CD4', NULL, '1', '2018-03-13 15:07:58', '2018-04-09 06:41:14'),
(5, 'CDD / CD6', NULL, '1', '2018-03-13 15:07:58', '2018-04-09 06:41:17'),
(6, 'Fuso', '1', NULL, '2018-04-06 08:01:46', '2018-04-09 06:40:52'),
(7, 'Tronton', '1', NULL, '2018-04-06 08:01:53', '2018-04-09 06:40:55'),
(8, 'Wing-Box', '1', NULL, '2018-04-06 08:02:01', '2018-04-09 06:40:57'),
(9, 'Container 20\'', '1', NULL, '2018-04-06 08:02:10', '2018-04-09 06:41:03'),
(10, 'Container 40\'', '1', NULL, '2018-04-06 08:02:18', '2018-04-09 06:41:05'),
(11, 'Big Mama / Yellow', '1', NULL, '2018-04-06 08:02:26', '2018-04-09 06:41:09');
-- --------------------------------------------------------
--
-- Table structure for table `dms_purpose`
--
CREATE TABLE `dms_purpose` (
`id` int(10) UNSIGNED NOT NULL,
`purpose` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`updated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `dms_purpose`
--
INSERT INTO `dms_purpose` (`id`, `purpose`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'Inbound', '1', '1', NULL, NULL),
(2, 'Outbound', '1', '1', NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `dms_transaction`
--
CREATE TABLE `dms_transaction` (
`id` int(10) UNSIGNED NOT NULL,
`id_dms_form` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`gate_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`waiting_time` time DEFAULT NULL,
`duration` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`last_scan` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`arrival_time` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`exit_time` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`updated_by_checker` int(11) DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`created_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`updated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `dms_transaction`
--
INSERT INTO `dms_transaction` (`id`, `id_dms_form`, `gate_number`, `status`, `waiting_time`, `duration`, `last_scan`, `arrival_time`, `exit_time`, `updated_by_checker`, `created_at`, `created_by`, `updated_at`, `updated_by`) VALUES
(94, 'DMS11522614907', '2', '4', NULL, 'Apr 08, 18 21:55:15', '22:55:53 16/Apr/2018', '2018-04-01 16:35:07', 'Apr 10, 18 01:00:20', 0, '2018-04-01 09:35:07', '1', '2018-04-16 17:08:47', '13'),
(95, 'DMS11522614998', '2', '2', '15:21:00', 'Apr 04, 18 1:15:43', '', '2018-04-01 16:36:38', '2018-04-02 03:21:57', 0, '2018-04-01 09:36:38', '1', '2018-04-10 02:40:17', '1'),
(96, 'DMS21522615084', '2', '3', NULL, 'Apr 04, 18 2:15:33', '22:56:26 16/Apr/2018', '2018-04-01 16:38:04', NULL, 0, '2018-04-01 09:38:04', '1', '2018-04-16 15:56:26', '1'),
(99, 'DMS11522615629', '1', '3', NULL, 'Apr 04, 18 13:42:03', '16:13:30 13/Apr/2018', '2018-04-01 16:47:09', 'Apr 13, 18 16:13:30', 0, '2018-04-01 09:47:09', '1', '2018-04-16 17:18:50', '1'),
(119, 'DMS11523368679', NULL, '1', NULL, 'Apr 10, 18 09:57:59', NULL, 'Apr 10, 18 09:57:59', NULL, NULL, '2018-04-10 02:58:00', '1', '2018-04-16 16:08:04', '1'),
(120, 'DMS21523370851', NULL, '1', NULL, 'Apr 10, 18 10:34:11', NULL, 'Apr 10, 18 10:34:11', NULL, NULL, '2018-04-10 03:34:11', '1', '2018-04-16 15:54:35', '1'),
(121, 'DMS21523370887', NULL, '1', NULL, 'Apr 10, 18 10:34:47', NULL, 'Apr 10, 18 10:34:47', NULL, NULL, '2018-04-10 03:34:47', '1', '2018-04-16 16:26:18', '13'),
(123, 'DMS11523645650', NULL, '1', '23:03:00', 'Apr 13, 18 14:54:10', NULL, 'Apr 13, 18 14:54:10', NULL, NULL, '2018-04-13 07:54:10', '1', '2018-04-16 16:09:43', '1'),
(124, 'DMS21523932700', NULL, '1', NULL, 'Apr 16, 18 22:38:20', NULL, 'Apr 16, 18 22:38:20', NULL, NULL, '2018-04-16 15:38:20', '1', '2018-04-16 16:10:41', '1'),
(126, 'DMS11523933866', '1', '3', NULL, 'Apr 16, 18 22:57:46', '23:08:50 16/Apr/2018', 'Apr 16, 18 22:57:46', NULL, NULL, '2018-04-16 15:57:46', '1', '2018-04-16 16:08:50', '1'),
(127, 'DMS11523933898', NULL, '1', NULL, 'Apr 16, 18 22:58:18', NULL, 'Apr 16, 18 22:58:18', NULL, NULL, '2018-04-16 15:58:18', '1', '2018-04-16 15:58:18', NULL),
(128, 'DMS11523933943', NULL, '1', NULL, 'Apr 16, 18 22:59:03', NULL, 'Apr 16, 18 22:59:03', NULL, NULL, '2018-04-16 15:59:03', '1', '2018-04-16 15:59:03', NULL),
(130, 'DMS11523934017', NULL, '1', NULL, 'Apr 16, 18 23:00:17', NULL, 'Apr 16, 18 23:00:17', NULL, NULL, '2018-04-16 16:00:17', '1', '2018-04-16 16:00:17', NULL),
(131, 'DMS11523934077', NULL, '1', NULL, 'Apr 16, 18 23:01:17', NULL, 'Apr 16, 18 23:01:17', NULL, NULL, '2018-04-16 16:01:18', '1', '2018-04-16 16:01:18', NULL),
(132, 'DMS11523934155', NULL, '1', NULL, 'Apr 16, 18 23:02:35', NULL, 'Apr 16, 18 23:02:35', NULL, NULL, '2018-04-16 16:02:35', '1', '2018-04-16 16:02:35', NULL),
(133, 'DMS21523934290', NULL, '1', NULL, 'Apr 16, 18 23:04:50', NULL, 'Apr 16, 18 23:04:50', NULL, NULL, '2018-04-16 16:04:50', '1', '2018-04-16 16:04:50', NULL),
(135, 'DMS21523934397', NULL, '1', NULL, 'Apr 16, 18 23:06:37', NULL, 'Apr 16, 18 23:06:37', NULL, NULL, '2018-04-16 16:06:38', '1', '2018-04-16 16:06:38', NULL),
(136, 'DMS21523934457', NULL, '1', NULL, 'Apr 16, 18 23:07:37', NULL, 'Apr 16, 18 23:07:37', NULL, NULL, '2018-04-16 16:07:37', '1', '2018-04-16 16:07:37', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `dms_transaction_history`
--
CREATE TABLE `dms_transaction_history` (
`id` int(10) UNSIGNED NOT NULL,
`id_dms_form` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`gate_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`waiting_time` time DEFAULT NULL,
`duration` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`last_scan` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`arrival_time` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`exit_time` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`updated_by_checker` int(11) DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`created_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`updated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `dms_transaction_history`
--
INSERT INTO `dms_transaction_history` (`id`, `id_dms_form`, `gate_number`, `status`, `waiting_time`, `duration`, `last_scan`, `arrival_time`, `exit_time`, `updated_by_checker`, `created_at`, `created_by`, `updated_at`, `updated_by`) VALUES
(316, 'DMS11522659432', NULL, '3', NULL, NULL, '09:43', NULL, NULL, NULL, '2018-04-10 02:43:41', '1', '2018-04-10 02:43:41', NULL),
(317, 'DMS11522659432', NULL, '4', NULL, NULL, '09:43', NULL, NULL, NULL, '2018-04-10 02:43:46', '1', '2018-04-10 02:43:46', NULL),
(318, 'DMS11522659432', NULL, '5', NULL, NULL, '09:43', NULL, NULL, NULL, '2018-04-10 02:43:52', '1', '2018-04-10 02:43:52', NULL),
(319, 'DMS11522659432', NULL, '6', NULL, NULL, '09:43', NULL, 'Apr 10, 18 09:43:57', NULL, '2018-04-10 02:43:57', '1', '2018-04-10 02:43:57', NULL),
(320, 'DMS11523368679', NULL, '1', NULL, 'Apr 10, 18 09:57:59', NULL, 'Apr 10, 18 09:57:59', NULL, NULL, '2018-04-10 02:58:00', '1', '2018-04-10 02:58:00', NULL),
(321, 'DMS21523370851', NULL, '1', NULL, 'Apr 10, 18 10:34:11', NULL, 'Apr 10, 18 10:34:11', NULL, NULL, '2018-04-10 03:34:11', '1', '2018-04-10 03:34:11', NULL),
(322, 'DMS21523370887', NULL, '1', NULL, 'Apr 10, 18 10:34:47', NULL, 'Apr 10, 18 10:34:47', NULL, NULL, '2018-04-10 03:34:47', '1', '2018-04-10 03:34:47', NULL),
(323, 'DMS11522667446', NULL, '3', NULL, NULL, '12:48', NULL, NULL, NULL, '2018-04-10 05:48:12', '1', '2018-04-10 05:48:12', NULL),
(324, 'DMS11522667446', NULL, '4', NULL, NULL, '13:20', NULL, NULL, NULL, '2018-04-10 06:20:58', '1', '2018-04-10 06:20:58', NULL),
(325, 'DMS11522667446', NULL, '5', NULL, NULL, '11:30', NULL, NULL, NULL, '2018-04-11 04:30:53', '1', '2018-04-11 04:30:53', NULL),
(326, 'DMS11522667446', NULL, '6', NULL, NULL, '11:31', NULL, 'Apr 11, 18 11:31:07', NULL, '2018-04-11 04:31:07', '1', '2018-04-11 04:31:07', NULL),
(327, 'DMS11522667446', '3', NULL, '13:00:00', NULL, NULL, NULL, NULL, NULL, '2018-04-12 11:21:36', '1', '2018-04-12 11:21:36', NULL),
(328, 'DMS11523640635', NULL, '1', NULL, 'Apr 13, 18 13:30:35', NULL, 'Apr 13, 18 13:30:35', NULL, NULL, '2018-04-13 06:30:35', '1', '2018-04-13 06:30:35', NULL),
(329, 'DMS11522614907', NULL, '3', NULL, NULL, '13:52', NULL, NULL, NULL, '2018-04-13 06:52:02', '1', '2018-04-13 06:52:02', NULL),
(330, 'DMS11522614907', '2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-13 06:57:13', '1', '2018-04-13 06:57:13', NULL),
(331, 'DMS11522614907', '2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-13 06:57:40', '1', '2018-04-13 06:57:40', NULL),
(332, 'DMS11522614907', '2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-13 06:58:43', '1', '2018-04-13 06:58:43', NULL),
(333, 'DMS11522667446', '3', NULL, '13:00:00', NULL, NULL, NULL, NULL, NULL, '2018-04-13 07:07:39', '1', '2018-04-13 07:07:39', NULL),
(334, 'DMS11522667446', '3', NULL, '13:00:00', NULL, NULL, NULL, NULL, NULL, '2018-04-13 07:12:58', '1', '2018-04-13 07:12:58', NULL),
(335, 'DMS11522667446', '3', NULL, '13:00:00', NULL, NULL, NULL, NULL, NULL, '2018-04-13 07:13:11', '1', '2018-04-13 07:13:11', NULL),
(336, 'DMS11522667446', '3', NULL, '13:00:00', NULL, NULL, NULL, NULL, NULL, '2018-04-13 07:13:29', '1', '2018-04-13 07:13:29', NULL),
(337, 'DMS11522667446', '3', NULL, '13:00:00', NULL, NULL, NULL, NULL, NULL, '2018-04-13 07:13:47', '1', '2018-04-13 07:13:47', NULL),
(338, 'DMS11522667446', '3', NULL, '13:00:00', NULL, NULL, NULL, NULL, NULL, '2018-04-13 07:13:55', '1', '2018-04-13 07:13:55', NULL),
(339, 'DMS11523645650', NULL, '1', NULL, 'Apr 13, 18 14:54:10', NULL, 'Apr 13, 18 14:54:10', NULL, NULL, '2018-04-13 07:54:10', '1', '2018-04-13 07:54:10', NULL),
(340, 'DMS11522615629', '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-13 08:06:52', '1', '2018-04-13 08:06:52', NULL),
(341, 'DMS11522667446', '3', NULL, '13:00:00', NULL, NULL, NULL, NULL, NULL, '2018-04-13 08:07:00', '1', '2018-04-13 08:07:00', NULL),
(342, 'DMS11522615629', NULL, '3', NULL, NULL, '16:11 13 Apr 18', NULL, NULL, NULL, '2018-04-13 09:11:09', '1', '2018-04-13 09:11:09', NULL),
(343, 'DMS11522615629', NULL, '4', NULL, NULL, '16:11 13 Apr 2018', NULL, NULL, NULL, '2018-04-13 09:11:59', '1', '2018-04-13 09:11:59', NULL),
(344, 'DMS11522615629', NULL, '5', NULL, NULL, '16:13:03 13/Apr/2018', NULL, NULL, NULL, '2018-04-13 09:13:03', '1', '2018-04-13 09:13:03', NULL),
(345, 'DMS11522615629', NULL, '6', NULL, NULL, '16:13:30 13/Apr/2018', NULL, 'Apr 13, 18 16:13:30', NULL, '2018-04-13 09:13:30', '1', '2018-04-13 09:13:30', NULL),
(346, 'DMS21523932700', NULL, '1', NULL, 'Apr 16, 18 22:38:20', NULL, 'Apr 16, 18 22:38:20', NULL, NULL, '2018-04-16 15:38:21', '1', '2018-04-16 15:38:21', NULL),
(347, 'DMS21523932899', NULL, '1', NULL, 'Apr 16, 18 22:41:39', NULL, 'Apr 16, 18 22:41:39', NULL, NULL, '2018-04-16 15:41:39', '1', '2018-04-16 15:41:39', NULL),
(348, 'DMS21523370887', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-16 15:52:53', '1', '2018-04-16 15:52:53', NULL),
(349, 'DMS21523370887', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-16 15:54:17', '1', '2018-04-16 15:54:17', NULL),
(350, 'DMS21523370851', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-16 15:54:35', '1', '2018-04-16 15:54:35', NULL),
(351, 'DMS21522615084', '2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-16 15:54:49', '1', '2018-04-16 15:54:49', NULL),
(352, 'DMS11522614998', '2', NULL, '15:21:00', NULL, NULL, NULL, NULL, NULL, '2018-04-16 15:55:03', '1', '2018-04-16 15:55:03', NULL),
(353, 'DMS11522614998', '2', NULL, '15:21:00', NULL, NULL, NULL, NULL, NULL, '2018-04-16 15:55:18', '1', '2018-04-16 15:55:18', NULL),
(354, 'DMS11522614907', NULL, '4', NULL, NULL, '22:55:53 16/Apr/2018', NULL, NULL, NULL, '2018-04-16 15:55:53', '1', '2018-04-16 15:55:53', NULL),
(355, 'DMS21522615084', NULL, '3', NULL, NULL, '22:56:26 16/Apr/2018', NULL, NULL, NULL, '2018-04-16 15:56:26', '1', '2018-04-16 15:56:26', NULL),
(356, 'DMS11523933866', NULL, '1', NULL, 'Apr 16, 18 22:57:46', NULL, 'Apr 16, 18 22:57:46', NULL, NULL, '2018-04-16 15:57:46', '1', '2018-04-16 15:57:46', NULL),
(357, 'DMS11523933898', NULL, '1', NULL, 'Apr 16, 18 22:58:18', NULL, 'Apr 16, 18 22:58:18', NULL, NULL, '2018-04-16 15:58:18', '1', '2018-04-16 15:58:18', NULL),
(358, 'DMS11523933943', NULL, '1', NULL, 'Apr 16, 18 22:59:03', NULL, 'Apr 16, 18 22:59:03', NULL, NULL, '2018-04-16 15:59:03', '1', '2018-04-16 15:59:03', NULL),
(359, 'DMS11523933981', NULL, '1', NULL, 'Apr 16, 18 22:59:41', NULL, 'Apr 16, 18 22:59:41', NULL, NULL, '2018-04-16 15:59:42', '1', '2018-04-16 15:59:42', NULL),
(360, 'DMS11523934017', NULL, '1', NULL, 'Apr 16, 18 23:00:17', NULL, 'Apr 16, 18 23:00:17', NULL, NULL, '2018-04-16 16:00:17', '1', '2018-04-16 16:00:17', NULL),
(361, 'DMS11523934077', NULL, '1', NULL, 'Apr 16, 18 23:01:17', NULL, 'Apr 16, 18 23:01:17', NULL, NULL, '2018-04-16 16:01:18', '1', '2018-04-16 16:01:18', NULL),
(362, 'DMS11522615629', '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-16 16:01:57', '1', '2018-04-16 16:01:57', NULL),
(363, 'DMS11523934155', NULL, '1', NULL, 'Apr 16, 18 23:02:35', NULL, 'Apr 16, 18 23:02:35', NULL, NULL, '2018-04-16 16:02:35', '1', '2018-04-16 16:02:35', NULL),
(364, 'DMS11523933866', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-16 16:02:59', '1', '2018-04-16 16:02:59', NULL),
(365, 'DMS21522615084', '2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-16 16:03:33', '1', '2018-04-16 16:03:33', NULL),
(366, 'DMS21523934290', NULL, '1', NULL, 'Apr 16, 18 23:04:50', NULL, 'Apr 16, 18 23:04:50', NULL, NULL, '2018-04-16 16:04:51', '1', '2018-04-16 16:04:51', NULL),
(367, 'DMS21523934347', NULL, '1', NULL, 'Apr 16, 18 23:05:47', NULL, 'Apr 16, 18 23:05:47', NULL, NULL, '2018-04-16 16:05:47', '1', '2018-04-16 16:05:47', NULL),
(368, 'DMS21523934397', NULL, '1', NULL, 'Apr 16, 18 23:06:37', NULL, 'Apr 16, 18 23:06:37', NULL, NULL, '2018-04-16 16:06:38', '1', '2018-04-16 16:06:38', NULL),
(369, 'DMS21523934457', NULL, '1', NULL, 'Apr 16, 18 23:07:37', NULL, 'Apr 16, 18 23:07:37', NULL, NULL, '2018-04-16 16:07:37', '1', '2018-04-16 16:07:37', NULL),
(370, 'DMS11523368679', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-16 16:08:04', '1', '2018-04-16 16:08:04', NULL),
(371, 'DMS11523933866', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-16 16:08:30', '1', '2018-04-16 16:08:30', NULL),
(372, 'DMS11523933866', '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-16 16:08:43', '1', '2018-04-16 16:08:43', NULL),
(373, 'DMS11523933866', NULL, '3', NULL, NULL, '23:08:50 16/Apr/2018', NULL, NULL, NULL, '2018-04-16 16:08:50', '1', '2018-04-16 16:08:50', NULL),
(374, 'DMS11523645650', NULL, NULL, '23:03:00', NULL, NULL, NULL, NULL, NULL, '2018-04-16 16:09:43', '1', '2018-04-16 16:09:43', NULL),
(375, 'DMS11523645650', NULL, NULL, '23:03:00', NULL, NULL, NULL, NULL, NULL, '2018-04-16 16:10:08', '1', '2018-04-16 16:10:08', NULL),
(376, 'DMS21522615084', '2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-16 16:10:25', '1', '2018-04-16 16:10:25', NULL),
(377, 'DMS21523932700', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-16 16:10:41', '1', '2018-04-16 16:10:41', NULL),
(378, 'DMS21523370887', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-16 16:26:18', '13', '2018-04-16 16:26:18', NULL),
(379, 'DMS11522614907', '2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2018-04-16 17:08:47', '13', '2018-04-16 17:08:47', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `dms_user_group`
--
CREATE TABLE `dms_user_group` (
`id` int(10) UNSIGNED NOT NULL,
`usergroup_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`updated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `dms_user_group`
--
INSERT INTO `dms_user_group` (`id`, `usergroup_name`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'SUPER ADMIN', '1', NULL, '2018-03-09 02:53:14', '2018-04-09 06:38:12'),
(2, 'ADMIN', '1', NULL, '2018-03-16 04:38:53', '2018-04-09 06:38:04'),
(3, 'SECURITY', '1', NULL, '2018-03-16 04:38:53', '2018-04-09 06:38:05'),
(4, 'CHECKER', '1', NULL, '2018-03-23 00:53:23', '2018-04-09 06:38:08');
-- --------------------------------------------------------
--
-- Table structure for table `dms_user_management`
--
CREATE TABLE `dms_user_management` (
`id` int(10) UNSIGNED NOT NULL,
`username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`name` char(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`id_usergroup` int(11) DEFAULT NULL,
`id_location` int(10) DEFAULT NULL,
`id_project` int(15) DEFAULT NULL,
`created_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`updated_by` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `dms_user_management`
--
INSERT INTO `dms_user_management` (`id`, `username`, `name`, `password`, `remember_token`, `id_usergroup`, `id_location`, `id_project`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'superadmin', 'Superadmin DMS', '1234', NULL, 1, 1, 8, '1', '1', '2018-03-16 16:52:12', '2018-04-09 06:39:03'),
(2, 'security-1', 'Security-1', '1234', NULL, 3, 1, 7, '1', '1', '2018-03-09 02:54:37', '2018-04-15 16:48:02'),
(3, 'security-2\r\n', 'Security-2', '1234', NULL, 3, 1, 7, '1', '1', '2018-03-09 02:54:37', '2018-04-15 16:48:08'),
(4, 'security-3', 'Security-3', '1234', NULL, 3, 1, 7, '1', '1', '2018-03-19 07:25:56', '2018-04-15 16:48:14'),
(5, 'sch-checker-1', 'SCH-Checker-1', '1234', NULL, 4, 1, 7, '1', '1', '2018-03-23 02:08:28', '2018-04-15 16:48:33'),
(6, 'sch-checker-2', 'SCH-Checker-2', '1234', NULL, 4, 1, 7, '1', '1', '2018-03-19 07:25:56', '2018-04-15 16:48:46'),
(7, 'sch-checker-3', 'SCH-Checker-3', '1234', NULL, 4, 1, 7, '1', '1', '2018-03-23 02:08:28', '2018-04-15 16:48:55'),
(8, 'sch-checker-4', 'SCH-Checker-4', '1234', NULL, 4, 1, 7, '1', '1', '2018-03-27 23:09:04', '2018-04-15 16:49:03'),
(9, 'mdlz-checker-1', 'MDLZ-Checker-1', '1234', NULL, 4, 1, 8, '1', '1', '2018-03-27 23:09:04', '2018-04-15 16:49:20'),
(10, 'mdlz-checker-2', 'MDLZ-Checker-2', '1234', NULL, 4, 1, 8, '1', '1', '2018-03-27 23:09:04', '2018-04-15 16:49:26'),
(11, 'mdlz-checker-3', 'MDLZ-Checker-3', '1234', NULL, 4, 1, 8, '1', '1', '2018-03-27 23:09:04', '2018-04-15 16:49:33'),
(12, 'mdlz-checker-4', 'MDLZ-Checker-4', '1234', NULL, 4, 1, 8, '1', '1', '2018-03-19 07:25:56', '2018-04-15 16:49:39'),
(13, 'sch-admin-1', 'SCH-Admin-1', '1234', NULL, 2, 1, 7, '1', '1', '2018-03-23 02:08:28', '2018-04-15 16:50:06'),
(14, 'sch-admin-2', 'SCH-Admin-2', '1234', NULL, 2, 1, 7, '1', '1', '2018-03-19 07:25:56', '2018-04-15 16:50:11'),
(15, 'sch-admin-3', 'SCH-Admin-3', '1234', NULL, 2, 1, 7, '1', '1', '2018-03-23 02:08:28', '2018-04-15 16:50:18'),
(16, 'mdlz-admin-1', 'MDLZ-Admin-1', '1234', NULL, 2, 1, 8, '1', '1', '2018-03-27 23:09:04', '2018-04-15 16:50:36'),
(17, 'mdlz-admin-2', 'MDLZ-Admin-2', '1234', NULL, 2, 1, 8, '1', '1', '2018-03-27 23:09:04', '2018-04-15 16:50:43'),
(18, 'mdlz-admin-3', 'MDLZ-Admin-3', '1234', NULL, 2, 2, 8, '1', '1', '2018-03-27 23:09:04', '2018-04-15 16:50:54');
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(13, '2018_03_08_074209_create_master_driver_table', 1),
(14, '2018_03_08_074330_create_master_tc_table', 1),
(15, '2018_03_08_074344_create_master_project_table', 1),
(16, '2018_03_08_074354_create_master_vehicle_table', 1),
(17, '2018_03_08_074531_create_user_management_table', 1),
(18, '2018_03_08_074616_create_user_group_table', 1),
(19, '2018_03_12_064949_create_form_table', 2),
(20, '2018_03_12_065117_create_transaction_table', 2),
(21, '2018_03_12_065130_create_transaction_history_table', 2),
(22, '2018_03_12_083901_create_purpose_table', 3),
(23, '2018_03_26_035845_create_master_phone_table', 4),
(24, '2018_03_28_033755_create_master_status_table', 5),
(25, '2018_03_28_095350_create_master_location_table', 6),
(26, '2018_04_26_035844_create_master_asal_table', 7),
(27, '2018_04_26_035845_create_master_tujuan_table', 7),
(28, '2018_04_26_035846_create_master_name_table', 7);
-- --------------------------------------------------------
--
-- Table structure for table `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'lutfi', 'lutfi.febrianto@gmail.com', '$2y$10$5qSWQLDNChSgSfiSDlxmnOy/HEFoG0I5Dix3FBPjSBS4YpbIA68Le', 'n4WQrwYtOjBXwHpCpYNi9DZvBQlY4DMsJ0z27DeXNjDbfpj1IffUCrvTJGRA', '2018-03-08 02:49:19', '2018-03-08 02:49:19'),
(2, 'asd', 'asd@gmail.com', '$2y$10$ckiDXVSoVqCiU.k.DajxB.dKP7vKXLzoyAEVNY2.6wt7edNOkt4si', 'eJHBrvf9DBsfmnVBhEQhEmpOaakb13JMlX5QhIKCZLLjWM3XHDxqqlQhgcwC', '2018-03-08 02:54:55', '2018-03-08 02:54:55');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `cms_user`
--
ALTER TABLE `cms_user`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dms_form`
--
ALTER TABLE `dms_form`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dms_master_asal`
--
ALTER TABLE `dms_master_asal`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dms_master_location`
--
ALTER TABLE `dms_master_location`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dms_master_name`
--
ALTER TABLE `dms_master_name`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dms_master_phone`
--
ALTER TABLE `dms_master_phone`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dms_master_plat`
--
ALTER TABLE `dms_master_plat`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dms_master_project`
--
ALTER TABLE `dms_master_project`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dms_master_status`
--
ALTER TABLE `dms_master_status`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dms_master_tc`
--
ALTER TABLE `dms_master_tc`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dms_master_tujuan`
--
ALTER TABLE `dms_master_tujuan`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dms_master_vehicle`
--
ALTER TABLE `dms_master_vehicle`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dms_purpose`
--
ALTER TABLE `dms_purpose`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dms_transaction`
--
ALTER TABLE `dms_transaction`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dms_transaction_history`
--
ALTER TABLE `dms_transaction_history`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dms_user_group`
--
ALTER TABLE `dms_user_group`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `dms_user_management`
--
ALTER TABLE `dms_user_management`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `cms_user`
--
ALTER TABLE `cms_user`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `dms_form`
--
ALTER TABLE `dms_form`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=161;
--
-- AUTO_INCREMENT for table `dms_master_asal`
--
ALTER TABLE `dms_master_asal`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
--
-- AUTO_INCREMENT for table `dms_master_location`
--
ALTER TABLE `dms_master_location`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `dms_master_name`
--
ALTER TABLE `dms_master_name`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;
--
-- AUTO_INCREMENT for table `dms_master_phone`
--
ALTER TABLE `dms_master_phone`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=87;
--
-- AUTO_INCREMENT for table `dms_master_plat`
--
ALTER TABLE `dms_master_plat`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=124;
--
-- AUTO_INCREMENT for table `dms_master_project`
--
ALTER TABLE `dms_master_project`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `dms_master_status`
--
ALTER TABLE `dms_master_status`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `dms_master_tc`
--
ALTER TABLE `dms_master_tc`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `dms_master_tujuan`
--
ALTER TABLE `dms_master_tujuan`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
--
-- AUTO_INCREMENT for table `dms_master_vehicle`
--
ALTER TABLE `dms_master_vehicle`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `dms_purpose`
--
ALTER TABLE `dms_purpose`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `dms_transaction`
--
ALTER TABLE `dms_transaction`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=137;
--
-- AUTO_INCREMENT for table `dms_transaction_history`
--
ALTER TABLE `dms_transaction_history`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=380;
--
-- AUTO_INCREMENT for table `dms_user_group`
--
ALTER TABLE `dms_user_group`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `dms_user_management`
--
ALTER TABLE `dms_user_management`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| 54.079731 | 268 | 0.64261 |
0cc75fc2057f1d904d4d63b853c8dc9ff11fc8ab
| 987 |
py
|
Python
|
featureflags/config.py
|
enverbisevac/ff-python-server-sdk
|
e7c809229d13517e0bf4b28fc0a556e693c9034e
|
[
"Apache-2.0"
] | null | null | null |
featureflags/config.py
|
enverbisevac/ff-python-server-sdk
|
e7c809229d13517e0bf4b28fc0a556e693c9034e
|
[
"Apache-2.0"
] | null | null | null |
featureflags/config.py
|
enverbisevac/ff-python-server-sdk
|
e7c809229d13517e0bf4b28fc0a556e693c9034e
|
[
"Apache-2.0"
] | null | null | null |
"""Configuration is a base class that has default values that you can change
during the instance of the client class"""
from typing import Callable
BASE_URL = "https://config.feature-flags.uat.harness.io/api/1.0"
MINUTE = 60
PULL_INTERVAL = 1 * MINUTE
class Config(object):
def __init__(self, base_url: str = BASE_URL,
pull_interval: int = PULL_INTERVAL,
cache: object = None,
store: object = None,
enable_stream: bool = False):
self.base_url = base_url
self.pull_interval = pull_interval
self.cache = cache
self.store = store
self.enable_stream = enable_stream
default_config = Config()
def with_base_url(base_url: str) -> Callable:
def func(config: Config) -> None:
config.base_url = base_url
return func
def with_stream_enabled(value: bool) -> Callable:
def func(config: Config) -> None:
config.enable_stream = value
return func
| 25.973684 | 76 | 0.64843 |
0cb1135cd1e8235884dc831dd92989b829868853
| 704 |
py
|
Python
|
main/validadorCPF/cpf.py
|
LuizMoreira-py/cadastro
|
606c024f126f99ba943cb68115aef472ea61e57e
|
[
"MIT"
] | null | null | null |
main/validadorCPF/cpf.py
|
LuizMoreira-py/cadastro
|
606c024f126f99ba943cb68115aef472ea61e57e
|
[
"MIT"
] | null | null | null |
main/validadorCPF/cpf.py
|
LuizMoreira-py/cadastro
|
606c024f126f99ba943cb68115aef472ea61e57e
|
[
"MIT"
] | null | null | null |
class Cpf:
def __init__(self, documento):
documento = str(documento)
if self.cpf_eh_valido(documento):
self.cpf = documento
else:
raise ValueError("CPF inválido!")
def cpf_eh_valido(self, documento):
if len(documento) == 11:
return True
else:
return False
def cpf_formato(self):
fatia_um = self.cpf[:3]
fatia_dois = self.cpf[3:6]
fatia_tres = self.cpf[6:9]
fatia_quatro = self.cpf[9:]
return(
"{}.{}.{}-{}".format(
fatia_um,
fatia_dois,
fatia_tres,
fatia_quatro
)
)
| 25.142857 | 45 | 0.484375 |
84d69a2982f6735c7cb42649950271aa77b2a650
| 696 |
sql
|
SQL
|
oracle/sqlscripts/forall-bulkcollect/bulkcollect/selctinto.sql
|
landy8530/database-example
|
9fdb25e45f2828ff74481cde06a2c6b0eac53f2e
|
[
"BSD-3-Clause"
] | 4 |
2018-03-11T08:10:28.000Z
|
2019-12-17T07:48:28.000Z
|
oracle/sqlscripts/forall-bulkcollect/bulkcollect/selctinto.sql
|
landy8530/database-example
|
9fdb25e45f2828ff74481cde06a2c6b0eac53f2e
|
[
"BSD-3-Clause"
] | null | null | null |
oracle/sqlscripts/forall-bulkcollect/bulkcollect/selctinto.sql
|
landy8530/database-example
|
9fdb25e45f2828ff74481cde06a2c6b0eac53f2e
|
[
"BSD-3-Clause"
] | 6 |
2019-06-06T03:25:50.000Z
|
2022-03-20T01:21:22.000Z
|
--在SELECT INTO中使用BULK COLLECT
--说明:使用BULK COLLECT一次即可提取所有行并绑定到记录变量,这就是所谓的批量绑定。
DECLARE
-- 定义记录类型
TYPE EMP_REC_TYPE IS RECORD(
EMPNO EMP_TEST.EMPNO%TYPE,
ENAME EMP_TEST.ENAME%TYPE,
HIREDATE EMP_TEST.HIREDATE%TYPE);
-- 定义基于记录的嵌套表
TYPE NESTED_EMP_TYPE IS TABLE OF EMP_REC_TYPE;
-- 声明变量
EMP_TAB NESTED_EMP_TYPE;
BEGIN
-- 使用BULK COLLECT将所得的结果集一次性绑定到记录变量emp_tab中
SELECT EMPNO, ENAME, HIREDATE BULK COLLECT INTO EMP_TAB FROM EMP_TEST;
FOR I IN EMP_TAB.FIRST .. EMP_TAB.LAST LOOP
DBMS_OUTPUT.PUT_LINE('当前记录: ' || EMP_TAB(I)
.EMPNO || CHR(9) || EMP_TAB(I)
.ENAME || CHR(9) || EMP_TAB(I).HIREDATE);
END LOOP;
END;
| 31.636364 | 72 | 0.673851 |
413a9eb4cbca3658005c28a1bdcdf7a08c05a811
| 3,723 |
c
|
C
|
user/happytest/happytest.c
|
viccro/andthebitches
|
f19624be074d2ab10c89786e75daef0ef4e48eb9
|
[
"MIT"
] | 5 |
2016-02-01T06:43:17.000Z
|
2020-03-04T02:16:16.000Z
|
user/happytest/happytest.c
|
sixtwoseventy/joyos
|
94593ddabf7e6b53b568b3b4a04ca9ed6df123f0
|
[
"MIT"
] | null | null | null |
user/happytest/happytest.c
|
sixtwoseventy/joyos
|
94593ddabf7e6b53b568b3b4a04ca9ed6df123f0
|
[
"MIT"
] | 2 |
2016-01-20T04:29:35.000Z
|
2020-10-12T23:20:02.000Z
|
/*
* The MIT License
*
* Copyright (c) 2007 MIT 6.270 Robotics Competition
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
#include <joyos.h>
/**
* Display testName and 'Press Go'
*/
int start_test(char testName[]) {
printf("\n%s: press Go (or Stop to skip)", testName);
pause(100);
return either_click();
}
/**
* Test Servos
* servos 0 - 5 positions are set by frob knob
*/
void test_servos() {
uint8_t srv;
uint16_t pos;
while (!stop_press()) {
pos = frob_read()/2;
printf("\nservos=%d",pos);
for (srv=0;srv<6;srv++)
servo_set_pos(srv,pos);
pause(50);
}
}
/**
* Test Motors
* Motor velocity is set by frob knob
* Cycle through motors with go button
*/
void test_motors() {
uint8_t mot=0;
uint16_t pos;
while (!stop_press()) {
pos = frob_read()/2;
printf("\nmotor%d=%3d %dmA",mot,pos,motor_get_current_MA(mot));
motor_set_vel(mot,pos-256);
if (go_press()) {
go_click();
motor_set_vel(mot,0);
mot++;
if (mot==6) mot = 0;
}
pause(50);
}
motor_set_vel(mot,0);
}
/**
* Test Encoders
* Displays all encoder counts
*/
void test_encoders() {
while (!stop_press()) {
uint16_t e24 = encoder_read(24);
uint16_t e25 = encoder_read(25);
uint16_t e26 = encoder_read(26);
uint16_t e27 = encoder_read(27);
printf("\ne24=%03d e25=%03d e26=%03d e27=%03d",e24,e25,e26,e27);
pause(50);
}
}
/**
* Test Analog Inputs
* Display single analog input, select with frob knob
*/
void test_analog() {
uint8_t port;
while (!stop_press()) {
port = (frob_read()/64) + 8;
printf("\nanalog%02d=%d",port,analog_read(port));
pause(50);
}
}
/**
* Test Digital Inputs
* Displayed as single 8bit binary num
*/
void test_digital() {
while (!stop_press()) {
printf("\ndigital=");
for (uint8_t i=0;i<8;i++)
printf("%c", digital_read(i) ? '1' : '0');
pause(50);
}
}
// usetup is called during the calibration period. It must return before the
// period ends.
int usetup (void) {
return 0;
}
/**
* Run all tests
*/
int umain (void) {
printf("\nHappytest v0.61 ");
if (start_test("Servo Test"))
test_servos();
if (start_test("Motor Test"))
test_motors();
if (start_test("Digital Test"))
test_digital();
if (start_test("Analog Test"))
test_analog();
if (start_test("Encoder Test"))
test_encoders();
panic ("Testing new panic()");
printf("\nTests complete.");
while (1);
return 0;
}
| 24.175325 | 80 | 0.61993 |
2478f32686463536c411e0b834242d5e63ea0181
| 47 |
sql
|
SQL
|
pgx-examples/custom_sql/sql/multiple.sql
|
jonatas/pgx
|
d9c1db535bb5bd27f6cb70217866a040f3f98efb
|
[
"MIT"
] | 1,399 |
2020-07-12T22:25:00.000Z
|
2022-03-19T15:30:01.000Z
|
pgx-examples/custom_sql/sql/multiple.sql
|
jonatas/pgx
|
d9c1db535bb5bd27f6cb70217866a040f3f98efb
|
[
"MIT"
] | 351 |
2020-07-14T05:01:48.000Z
|
2022-03-22T17:27:35.000Z
|
pgx-examples/custom_sql/sql/multiple.sql
|
timescale/pgx
|
ed9f061db4c6d0a2e2775bea58523f92d9ff5a07
|
[
"MIT"
] | 73 |
2020-07-13T16:39:31.000Z
|
2022-03-22T15:25:39.000Z
|
INSERT INTO extension_sql VALUES ('multiple');
| 23.5 | 46 | 0.787234 |
f1593cd41d1fb7258349be6a1710dbf44287769a
| 2,523 |
rb
|
Ruby
|
spec/jobs/central_mail/submit_form4142_spec.rb
|
gg-1414/vets-api
|
263c29fa2c6e5dce50c962b068e38019eff61906
|
[
"CC0-1.0"
] | null | null | null |
spec/jobs/central_mail/submit_form4142_spec.rb
|
gg-1414/vets-api
|
263c29fa2c6e5dce50c962b068e38019eff61906
|
[
"CC0-1.0"
] | null | null | null |
spec/jobs/central_mail/submit_form4142_spec.rb
|
gg-1414/vets-api
|
263c29fa2c6e5dce50c962b068e38019eff61906
|
[
"CC0-1.0"
] | null | null | null |
# frozen_string_literal: true
require 'rails_helper'
require 'sidekiq/testing'
Sidekiq::Testing.fake!
RSpec.describe CentralMail::SubmitForm4142Job, type: :job do
before(:each) do
Sidekiq::Worker.clear_all
end
subject { described_class }
describe '.perform_async' do
let(:valid_form_content) { File.read 'spec/support/disability_compensation_form/form_4142.json' }
let(:missing_postalcode_form_content) do
File.read 'spec/support/disability_compensation_form/form_4142_missing_postalcode.json'
end
let(:evss_claim_id) { 123_456_789 }
let(:submission_id) { 123_456_790 }
let(:saved_claim) { FactoryBot.create(:va526ez) }
context 'with a successful submission job' do
it 'queues a job for submit' do
expect do
subject.perform_async(evss_claim_id, saved_claim.id, submission_id, valid_form_content)
end.to change(subject.jobs, :size).by(1)
end
it 'submits successfully' do
VCR.use_cassette('central_mail/submit_4142') do
subject.perform_async(evss_claim_id, saved_claim.id, submission_id, valid_form_content)
jid = subject.jobs.last['jid']
described_class.drain
expect(jid).not_to be_empty
end
end
end
context 'with a submission timeout' do
before do
allow_any_instance_of(Faraday::Connection).to receive(:post).and_raise(Faraday::TimeoutError)
end
it 'raises a gateway timeout error' do
subject.perform_async(evss_claim_id, saved_claim.id, submission_id, valid_form_content)
expect { described_class.drain }.to raise_error(Common::Exceptions::GatewayTimeout)
end
end
context 'with a client error' do
it 'raises a central mail response error' do
VCR.use_cassette('central_mail/submit_4142_400') do
subject.perform_async(
evss_claim_id, saved_claim.id, submission_id, missing_postalcode_form_content
)
expect { described_class.drain }.to raise_error(CentralMail::SubmitForm4142Job::CentralMailResponseError)
end
end
end
context 'with an unexpected error' do
before do
allow_any_instance_of(Faraday::Connection).to receive(:post).and_raise(StandardError.new('foo'))
end
it 'raises a standard error' do
subject.perform_async(evss_claim_id, saved_claim.id, submission_id, valid_form_content)
expect { described_class.drain }.to raise_error(StandardError)
end
end
end
end
| 34.094595 | 115 | 0.70432 |
64c3d3aaea8575c651a1b71020664a756767f1f8
| 2,066 |
sql
|
SQL
|
conf/evolutions/default/2.sql
|
PQTran/SimplyTutorServerApp
|
590c46b2e2a404947f362e8c9460835f289c9660
|
[
"Apache-2.0"
] | null | null | null |
conf/evolutions/default/2.sql
|
PQTran/SimplyTutorServerApp
|
590c46b2e2a404947f362e8c9460835f289c9660
|
[
"Apache-2.0"
] | null | null | null |
conf/evolutions/default/2.sql
|
PQTran/SimplyTutorServerApp
|
590c46b2e2a404947f362e8c9460835f289c9660
|
[
"Apache-2.0"
] | null | null | null |
# --- !Ups
INSERT INTO role (id, role_name, description) VALUES
(1, 'Admin', NULL),
(2, 'User', 'A regular user who uses this application');
INSERT INTO user (id, email, first_name, last_name,
password, hashed_password, reset_token, role_id) VALUES
(1, 'paultran@email.ca', 'Paul', 'Tran',
'ptranx23', NULL, NULL, 1),
(2, 'sharonmoon@email.ca', 'Sharon', 'Moon',
'sharonsun', NULL, NULL, 2);
INSERT INTO institute (id, name) VALUES
(1, 'Paul''s Tutoring Services'),
(2, 'Sharon''s Private Lessons');
INSERT INTO course (id, title, description, institute_id, creator_user_id) VALUES
(1, 'Integral Calculus', 'difficult preparation for mathematical examination', 1, 1),
(2, 'Mandarin Singing', NULL, 1, 1),
(3, 'Beginner Mandarin Chinese', NULL, 2, 2);
INSERT INTO enrollment (user_id, course_id) VALUES
(1, 3),
(2, 1),
(2, 2);
INSERT INTO assignment (id, name, description, course_id) VALUES
(1, 'calculus review', NULL, 1),
(2, 'riemann sums', 'adding area under graph', 1),
(3, 'chinese vocab ch1', NULL, 3);
INSERT INTO question (id, text, marks, assignment_id) VALUES
(1, 'what is a derivative?', 1, 1),
(2, 'what is an integral?', 1, 1),
(3, 'what is the derivative of x^2?', 5, 2),
(4, 'translate: hello', 10, 3);
INSERT INTO question_choice (id, text, question_order, is_correct, question_id) VALUES
(1, 'a way to view area', 1, 0, 1),
(2, 'change in graph', 2, 1, 1),
(3, '1 / slope', 3, 0, 1),
(4, 'true', 1, 0, 2),
(5, 'false', 2, 1, 2),
(6, 'log(x^2)', 1, 0, 3),
(7, 'x', 2, 0, 3),
(8, '2x^3', 3, 0, 3),
(9, '2x', 4, 1, 3),
(10, 'wo bu zhi dao', 1, 0, 4),
(11, 'zai jian', 2, 0, 4),
(12, 'nihao', 3, 1, 4);
# --- !Downs
DELETE FROM question_choice;
DELETE FROM question;
DELETE FROM assignment;
DELETE FROM enrollment;
DELETE FROM course;
DELETE FROM institute;
DELETE FROM user;
DELETE FROM role;
| 33.322581 | 92 | 0.571636 |
7f6c1b545803fdf4f895d0fced78bf36a0f270c1
| 3,303 |
rs
|
Rust
|
tests/integrations/server/kv_service.rs
|
ldeng-ustc/tikv
|
c4b7e8fa20f8f2022e634c445a53212b54e8f016
|
[
"Apache-2.0"
] | 2 |
2020-06-21T02:54:19.000Z
|
2020-06-21T02:54:24.000Z
|
tests/integrations/server/kv_service.rs
|
ldeng-ustc/tikv
|
c4b7e8fa20f8f2022e634c445a53212b54e8f016
|
[
"Apache-2.0"
] | 8 |
2020-06-03T11:56:15.000Z
|
2020-06-03T11:57:53.000Z
|
tests/integrations/server/kv_service.rs
|
ldeng-ustc/tikv
|
c4b7e8fa20f8f2022e634c445a53212b54e8f016
|
[
"Apache-2.0"
] | 1 |
2019-04-30T05:26:13.000Z
|
2019-04-30T05:26:13.000Z
|
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
use futures::{Future, Sink, Stream};
use grpcio::*;
use kvproto::tikvpb::TikvClient;
use kvproto::tikvpb::*;
use std::sync::{mpsc, Arc};
use std::thread;
use std::time::Duration;
use test_raftstore::new_server_cluster;
use tikv::server::service::batch_commands_request;
use tikv_util::HandyRwLock;
#[test]
fn test_batch_commands() {
let mut cluster = new_server_cluster(0, 1);
cluster.run();
let leader = cluster.get_region(b"").get_peers()[0].clone();
let addr = cluster.sim.rl().get_addr(leader.get_store_id()).to_owned();
let env = Arc::new(Environment::new(1));
let channel = ChannelBuilder::new(env).connect(&addr);
let client = TikvClient::new(channel);
let (mut sender, receiver) = client.batch_commands().unwrap();
for _ in 0..1000 {
let mut batch_req = BatchCommandsRequest::default();
for i in 0..10 {
batch_req.mut_requests().push(Default::default());
batch_req.mut_request_ids().push(i);
}
match sender.send((batch_req, WriteFlags::default())).wait() {
Ok(s) => sender = s,
Err(e) => panic!("tikv client send fail: {:?}", e),
}
}
let (tx, rx) = mpsc::sync_channel(1);
thread::spawn(move || {
// We have send 10k requests to the server, so we should get 10k responses.
let mut count = 0;
for x in receiver
.wait()
.map(move |b| b.unwrap().get_responses().len())
{
count += x;
if count == 10000 {
tx.send(1).unwrap();
return;
}
}
});
rx.recv_timeout(Duration::from_secs(1)).unwrap();
}
#[test]
fn test_empty_commands() {
let mut cluster = new_server_cluster(0, 1);
cluster.run();
let leader = cluster.get_region(b"").get_peers()[0].clone();
let addr = cluster.sim.rl().get_addr(leader.get_store_id()).to_owned();
let env = Arc::new(Environment::new(1));
let channel = ChannelBuilder::new(env).connect(&addr);
let client = TikvClient::new(channel);
let (mut sender, receiver) = client.batch_commands().unwrap();
for _ in 0..1000 {
let mut batch_req = BatchCommandsRequest::default();
for i in 0..10 {
let mut req = batch_commands_request::Request::default();
req.cmd = Some(batch_commands_request::request::Cmd::Empty(
Default::default(),
));
batch_req.mut_requests().push(req);
batch_req.mut_request_ids().push(i);
}
match sender.send((batch_req, WriteFlags::default())).wait() {
Ok(s) => sender = s,
Err(e) => panic!("tikv client send fail: {:?}", e),
}
}
let (tx, rx) = mpsc::sync_channel(1);
thread::spawn(move || {
// We have send 10k requests to the server, so we should get 10k responses.
let mut count = 0;
for x in receiver
.wait()
.map(move |b| b.unwrap().get_responses().len())
{
count += x;
if count == 10000 {
tx.send(1).unwrap();
return;
}
}
});
rx.recv_timeout(Duration::from_secs(1)).unwrap();
}
| 32.067961 | 83 | 0.56706 |
64f2929f1145442456cd44750af98c7c1e21cebe
| 845 |
swift
|
Swift
|
MDKits/Classes/Closure/UIGestureRecognizer+.swift
|
BeyChan/MDKits
|
fbdc86c1d9ecf8f6a11f56442cd0dbce01dc8732
|
[
"MIT"
] | null | null | null |
MDKits/Classes/Closure/UIGestureRecognizer+.swift
|
BeyChan/MDKits
|
fbdc86c1d9ecf8f6a11f56442cd0dbce01dc8732
|
[
"MIT"
] | null | null | null |
MDKits/Classes/Closure/UIGestureRecognizer+.swift
|
BeyChan/MDKits
|
fbdc86c1d9ecf8f6a11f56442cd0dbce01dc8732
|
[
"MIT"
] | null | null | null |
//
// UIGestureRecognizer+.swift
// MDFooBox
//
// Created by MarvinChan on 2019/12/27.
// Copyright © 2019 MarvinChan. All rights reserved.
//
import Foundation
public extension Container where Host: UIGestureRecognizer {
///示例 `gesture.on.tap{ }`
/// 添加事件
/// - Parameter action: 闭包动作
func tap(_ action: @escaping Action) {
let target = _GestureTarget(host: host, action: action)
targets[_GestureTarget.uniqueId] = target
}
}
private class _GestureTarget: NSObject {
var action: Action?
init(host: UIGestureRecognizer, action: @escaping Action) {
super.init()
self.action = action
host.addTarget(self, action: #selector(didOccur(_:)))
}
// MARK: - Action
@objc func didOccur(_ gestureRecognizer: UIGestureRecognizer) {
action?()
}
}
| 22.236842 | 67 | 0.64142 |
5a30701fa71831ac461b05fd618384ba360897f3
| 1,222 |
rs
|
Rust
|
src/redis_utils.rs
|
nickelc/ocypod
|
fe4b693870f67fb7a8b25aa626af286c6b65d1ca
|
[
"Apache-2.0"
] | 170 |
2019-03-29T13:27:44.000Z
|
2022-03-18T14:55:36.000Z
|
src/redis_utils.rs
|
nickelc/ocypod
|
fe4b693870f67fb7a8b25aa626af286c6b65d1ca
|
[
"Apache-2.0"
] | 27 |
2018-12-04T17:08:10.000Z
|
2022-03-11T08:39:03.000Z
|
src/redis_utils.rs
|
nickelc/ocypod
|
fe4b693870f67fb7a8b25aa626af286c6b65d1ca
|
[
"Apache-2.0"
] | 15 |
2018-12-06T22:08:45.000Z
|
2022-03-03T01:44:16.000Z
|
//! Miscellaneous Redis utilities and helper functions.
use redis::{aio::ConnectionLike, from_redis_value, FromRedisValue, Pipeline, RedisResult, Value};
/// Helper function for getting nested data structures from Redis pipelines.
///
/// Used for e.g. querying for vectors of tuples from:
/// pipe.hget(key1, [x, y, z])
/// .hget(key2, [x, y, z])
/// .hget(key3, [x, y, z])
///
/// let (a, b, c): Vec<(x_type, y_type, z_type)> = vec_from_redis_pipe(pipe, conn)?;
pub async fn vec_from_redis_pipe<C: ConnectionLike, T: FromRedisValue>(
conn: &mut C,
pipe: &Pipeline,
) -> RedisResult<Vec<T>> {
let values: Vec<Value> = pipe.query_async(conn).await?;
let mut results = Vec::with_capacity(values.len());
for v in values {
results.push(from_redis_value::<T>(&v)?);
}
Ok(results)
}
/// Simplifies async Redis transactions.
#[macro_export]
macro_rules! transaction_async {
($conn:expr, $keys:expr, $body:expr) => {
loop {
redis::cmd("WATCH").arg($keys).query_async($conn).await?;
if let Some(response) = $body {
redis::cmd("UNWATCH").query_async($conn).await?;
break response;
}
}
};
}
| 30.55 | 97 | 0.612111 |
41cfe89d62feb8dd40ed91044c1c2febae389243
| 170 |
h
|
C
|
Source/Clem/ECS/ECS.h
|
ShenMian/Clementine
|
a4d733e5f89141a7f00a043c73f0819eb3e277a8
|
[
"Apache-2.0"
] | 46 |
2020-08-27T14:30:50.000Z
|
2021-12-10T05:45:07.000Z
|
Source/Clem/ECS/ECS.h
|
ShenMian/Clementine
|
a4d733e5f89141a7f00a043c73f0819eb3e277a8
|
[
"Apache-2.0"
] | 2 |
2021-10-08T01:04:56.000Z
|
2021-12-10T08:20:08.000Z
|
Source/Clem/ECS/ECS.h
|
ShenMian/Clementine
|
a4d733e5f89141a7f00a043c73f0819eb3e277a8
|
[
"Apache-2.0"
] | 6 |
2020-09-05T08:41:13.000Z
|
2022-03-26T02:31:26.000Z
|
// Copyright 2021 SMS
// License(Apache-2.0)
#pragma once
#include "Archtype.h"
#include "Entity.h"
#include "Registry.h"
#include "System.h"
#include "TypeIndex.hpp"
| 15.454545 | 24 | 0.705882 |
166ad2c17490e6f108c15d0d1888acc0d2326310
| 1,963 |
h
|
C
|
DataFormats/HcalCalibObjects/interface/HcalIsoTrkCalibVariables.h
|
malbouis/cmssw
|
16173a30d3f0c9ecc5419c474bb4d272c58b65c8
|
[
"Apache-2.0"
] | 852 |
2015-01-11T21:03:51.000Z
|
2022-03-25T21:14:00.000Z
|
DataFormats/HcalCalibObjects/interface/HcalIsoTrkCalibVariables.h
|
gartung/cmssw
|
3072dde3ce94dcd1791d778988198a44cde02162
|
[
"Apache-2.0"
] | 30,371 |
2015-01-02T00:14:40.000Z
|
2022-03-31T23:26:05.000Z
|
DataFormats/HcalCalibObjects/interface/HcalIsoTrkCalibVariables.h
|
gartung/cmssw
|
3072dde3ce94dcd1791d778988198a44cde02162
|
[
"Apache-2.0"
] | 3,240 |
2015-01-02T05:53:18.000Z
|
2022-03-31T17:24:21.000Z
|
#ifndef DataFormatsHcalCalibObjectsHcalIsoTrkCalibVariables_h
#define DataFormatsHcalCalibObjectsHcalIsoTrkCalibVariables_h
#include <string>
#include <vector>
class HcalIsoTrkCalibVariables {
public:
HcalIsoTrkCalibVariables() { clear(); }
void clear() {
eventWeight_ = rhoh_ = 0;
nVtx_ = goodPV_ = nTrk_ = 0;
trgbits_.clear();
mindR1_ = l1pt_ = l1eta_ = l1phi_ = 0;
mindR2_ = l3pt_ = l3eta_ = l3phi_ = 0;
p_ = pt_ = phi_ = gentrackP_ = 0;
ieta_ = iphi_ = 0;
eMipDR_.clear();
eHcal_ = eHcal10_ = eHcal30_ = 0;
eHcalRaw_ = eHcal10Raw_ = eHcal30Raw_ = 0;
eHcalAux_ = eHcal10Aux_ = eHcal30Aux_ = 0;
emaxNearP_ = eAnnular_ = hmaxNearP_ = hAnnular_ = 0;
selectTk_ = qltyFlag_ = qltyMissFlag_ = qltyPVFlag_ = false;
detIds_.clear();
hitEnergies_.clear();
hitEnergiesRaw_.clear();
hitEnergiesAux_.clear();
detIds1_.clear();
hitEnergies1_.clear();
hitEnergies1Raw_.clear();
hitEnergies1Aux_.clear();
detIds3_.clear();
hitEnergies3_.clear();
hitEnergies3Raw_.clear();
hitEnergies3Aux_.clear();
};
double eventWeight_, rhoh_;
int goodPV_, nVtx_, nTrk_;
std::vector<bool> trgbits_;
double mindR1_, l1pt_, l1eta_, l1phi_;
double mindR2_, l3pt_, l3eta_, l3phi_;
double p_, pt_, phi_, gentrackP_;
int ieta_, iphi_;
std::vector<double> eMipDR_;
double eHcal_, eHcal10_, eHcal30_;
double eHcalRaw_, eHcal10Raw_, eHcal30Raw_;
double eHcalAux_, eHcal10Aux_, eHcal30Aux_;
double emaxNearP_, eAnnular_, hmaxNearP_, hAnnular_;
bool selectTk_, qltyFlag_, qltyMissFlag_, qltyPVFlag_;
std::vector<unsigned int> detIds_, detIds1_, detIds3_;
std::vector<double> hitEnergies_, hitEnergies1_, hitEnergies3_;
std::vector<double> hitEnergiesRaw_, hitEnergies1Raw_, hitEnergies3Raw_;
std::vector<double> hitEnergiesAux_, hitEnergies1Aux_, hitEnergies3Aux_;
};
typedef std::vector<HcalIsoTrkCalibVariables> HcalIsoTrkCalibVariablesCollection;
#endif
| 33.271186 | 81 | 0.724401 |
8a1750921a96e931188ff71373934b244c7062cf
| 1,306 |
sql
|
SQL
|
Minimalistic Balance Acken/Minimalistic Balance Acken/Religion/FaithCosts.sql
|
rezoacken/minimalistic_balance_civ5
|
939c96af52b32895847e26f2b25ad6d8a6bc7796
|
[
"MIT"
] | null | null | null |
Minimalistic Balance Acken/Minimalistic Balance Acken/Religion/FaithCosts.sql
|
rezoacken/minimalistic_balance_civ5
|
939c96af52b32895847e26f2b25ad6d8a6bc7796
|
[
"MIT"
] | null | null | null |
Minimalistic Balance Acken/Minimalistic Balance Acken/Religion/FaithCosts.sql
|
rezoacken/minimalistic_balance_civ5
|
939c96af52b32895847e26f2b25ad6d8a6bc7796
|
[
"MIT"
] | null | null | null |
UPDATE Defines SET Value=20 WHERE Name='RELIGION_MIN_FAITH_FIRST_PANTHEON';
UPDATE Defines SET Value=0 WHERE Name='RELIGION_GAME_FAITH_DELTA_NEXT_PANTHEON';
UPDATE Defines SET Value=100 WHERE Name='RELIGION_BASE_CHANCE_PROPHET_SPAWN';
UPDATE Eras SET FaithCostMultiplier=125 WHERE Type='ERA_RENAISSANCE';
UPDATE Eras SET FaithCostMultiplier=150 WHERE Type='ERA_INDUSTRIAL';
UPDATE Eras SET FaithCostMultiplier=175 WHERE Type='ERA_MODERN';
UPDATE Eras SET FaithCostMultiplier=200 WHERE Type='ERA_POSTMODERN';
UPDATE Eras SET FaithCostMultiplier=225 WHERE Type='ERA_FUTURE';
UPDATE Buildings SET FaithCost=250 WHERE BuildingClass='BUILDINGCLASS_UNIVERSITY';
UPDATE Buildings SET FaithCost=340 WHERE BuildingClass='BUILDINGCLASS_PUBLIC_SCHOOL';
UPDATE Buildings SET FaithCost=450 WHERE BuildingClass='BUILDINGCLASS_LABORATORY';
UPDATE Buildings SET FaithCost=250, UnlockedByBelief=1 WHERE BuildingClass='BUILDINGCLASS_OPERA_HOUSE';
UPDATE Buildings SET FaithCost=340, UnlockedByBelief=1 WHERE BuildingClass='BUILDINGCLASS_MUSEUM';
UPDATE Buildings SET FaithCost=450, UnlockedByBelief=1 WHERE BuildingClass='BUILDINGCLASS_BROADCAST_TOWER';
UPDATE Units SET FaithCost=FaithCost/2 WHERE PrereqTech IN
(SELECT type FROM Technologies WHERE Era IN ('ERA_INDUSTRIAL','ERA_MODERN','ERA_POSTMODERN','ERA_FUTURE'));
| 65.3 | 107 | 0.847626 |
a0d39a9fd1fda9ce71092fdace68c11b213c972d
| 2,266 |
kt
|
Kotlin
|
src/main/kotlin/net/thoughtmachine/please/plugin/runconfiguration/RunStates.kt
|
Tatskaari/please-intellij
|
502bc792fbd3546b8579b9dfca5c7e9f5c80df71
|
[
"Apache-2.0"
] | 1 |
2021-05-02T04:10:32.000Z
|
2021-05-02T04:10:32.000Z
|
src/main/kotlin/net/thoughtmachine/please/plugin/runconfiguration/RunStates.kt
|
Tatskaari/please-intellij
|
502bc792fbd3546b8579b9dfca5c7e9f5c80df71
|
[
"Apache-2.0"
] | null | null | null |
src/main/kotlin/net/thoughtmachine/please/plugin/runconfiguration/RunStates.kt
|
Tatskaari/please-intellij
|
502bc792fbd3546b8579b9dfca5c7e9f5c80df71
|
[
"Apache-2.0"
] | null | null | null |
package net.thoughtmachine.please.plugin.runconfiguration
import com.intellij.execution.DefaultExecutionResult
import com.intellij.execution.ExecutionResult
import com.intellij.execution.Executor
import com.intellij.execution.configurations.PtyCommandLine
import com.intellij.execution.configurations.RunProfileState
import com.intellij.execution.executors.DefaultRunExecutor
import com.intellij.execution.filters.TextConsoleBuilderFactory
import com.intellij.execution.process.ProcessHandler
import com.intellij.execution.process.ProcessHandlerFactoryImpl
import com.intellij.execution.runners.ProgramRunner
import com.intellij.execution.ui.ConsoleView
import com.intellij.icons.AllIcons
import com.intellij.openapi.project.Project
import org.apache.tools.ant.types.Commandline
import javax.swing.Icon
object PleaseBuildExecutor : DefaultRunExecutor() {
override fun getIcon(): Icon {
return AllIcons.Actions.Compile
}
override fun getStartActionText(): String {
return "Build"
}
}
object PleaseTestExecutor : DefaultRunExecutor() {
override fun getStartActionText(): String {
return "Test"
}
}
fun (Project).createConsole(processHandler: ProcessHandler): ConsoleView {
val console = TextConsoleBuilderFactory.getInstance().createBuilder(this).console
console.attachToProcess(processHandler)
return console
}
class PleaseProfileState(
private var target: String,
private var project: Project,
private val cmd : String,
private val pleaseArgs : String,
private val programArgs : String
) : RunProfileState {
private fun startProcess(): ProcessHandler {
val plzArgs = Commandline.translateCommandline(pleaseArgs)
val progArgs = Commandline.translateCommandline(programArgs)
val cmd = PtyCommandLine(mutableListOf("plz", cmd, "-p", "-v", "notice", target) + plzArgs + listOf("--") + progArgs)
cmd.setWorkDirectory(project.basePath!!)
return ProcessHandlerFactoryImpl.getInstance().createColoredProcessHandler(cmd)
}
override fun execute(executor: Executor?, runner: ProgramRunner<*>): ExecutionResult {
val process = startProcess()
return DefaultExecutionResult(project.createConsole(process), process)
}
}
| 35.968254 | 125 | 0.770962 |
5803aa9983a74df0dfac17e5d9aa07018b5ac7b3
| 1,461 |
h
|
C
|
chromeos/components/tether/device_id_tether_network_guid_map.h
|
Yannic/chromium
|
ab32e8aacb08c9fce0dc4bf09eec456ba46e3710
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 76 |
2020-09-02T03:05:41.000Z
|
2022-03-30T04:40:55.000Z
|
chromeos/components/tether/device_id_tether_network_guid_map.h
|
blueboxd/chromium-legacy
|
07223bc94bd97499909c9ed3c3f5769d718fe2e0
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 45 |
2020-09-02T03:21:37.000Z
|
2022-03-31T22:19:45.000Z
|
chromeos/components/tether/device_id_tether_network_guid_map.h
|
Yannic/chromium
|
ab32e8aacb08c9fce0dc4bf09eec456ba46e3710
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 8 |
2020-07-22T18:49:18.000Z
|
2022-02-08T10:27:16.000Z
|
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_COMPONENTS_TETHER_DEVICE_ID_TETHER_NETWORK_GUID_MAP_H_
#define CHROMEOS_COMPONENTS_TETHER_DEVICE_ID_TETHER_NETWORK_GUID_MAP_H_
#include <string>
#include "base/macros.h"
namespace chromeos {
namespace tether {
// Keeps a mapping between device ID and the tether network GUID associated with
// tethering to that device.
// TODO(hansberry): Currently, this class is stubbed out by simply returning the
// same value for both device ID and tether network GUID.
// Figure out a real mapping system.
class DeviceIdTetherNetworkGuidMap {
public:
DeviceIdTetherNetworkGuidMap();
DeviceIdTetherNetworkGuidMap(const DeviceIdTetherNetworkGuidMap&) = delete;
DeviceIdTetherNetworkGuidMap& operator=(const DeviceIdTetherNetworkGuidMap&) =
delete;
virtual ~DeviceIdTetherNetworkGuidMap();
// Returns the device ID for a given tether network GUID.
virtual std::string GetDeviceIdForTetherNetworkGuid(
const std::string& tether_network_guid);
// Returns the tether network GUID for a given device ID.
virtual std::string GetTetherNetworkGuidForDeviceId(
const std::string& device_id);
};
} // namespace tether
} // namespace chromeos
#endif // CHROMEOS_COMPONENTS_TETHER_DEVICE_ID_TETHER_NETWORK_GUID_MAP_H_
| 32.466667 | 80 | 0.772074 |
6a8e1eb9e2fb6437b4a46c78eb68080b0399a8be
| 52,843 |
sql
|
SQL
|
database/smsverificationexceladedafterbackup.sql
|
sridharlovevirus/KEC-Placement-Assistant
|
3fc83515c570fd9864a564f0ecc043c32bdccdd6
|
[
"MIT"
] | null | null | null |
database/smsverificationexceladedafterbackup.sql
|
sridharlovevirus/KEC-Placement-Assistant
|
3fc83515c570fd9864a564f0ecc043c32bdccdd6
|
[
"MIT"
] | null | null | null |
database/smsverificationexceladedafterbackup.sql
|
sridharlovevirus/KEC-Placement-Assistant
|
3fc83515c570fd9864a564f0ecc043c32bdccdd6
|
[
"MIT"
] | null | null | null |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 10, 2017 at 08:31 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
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: `kongu`
--
-- --------------------------------------------------------
--
-- Table structure for table `be`
--
CREATE TABLE `be` (
`rollno` varchar(8) NOT NULL,
`madmin` varchar(20) NOT NULL,
`co` varchar(20) NOT NULL,
`fgen` varchar(4) NOT NULL,
`sem1` int(3) NOT NULL,
`sem2` int(3) NOT NULL,
`sem3` int(3) NOT NULL,
`sem4` int(3) NOT NULL,
`sem5` int(3) NOT NULL,
`sem6` int(3) NOT NULL,
`sem7` int(3) NOT NULL,
`sem8` int(3) NOT NULL,
`cp` int(3) NOT NULL,
`ha` int(3) NOT NULL,
`sa` int(3) NOT NULL,
`ca` int(3) NOT NULL,
`cs` varchar(10) NOT NULL,
`ce` varchar(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `be`
--
INSERT INTO `be` (`rollno`, `madmin`, `co`, `fgen`, `sem1`, `sem2`, `sem3`, `sem4`, `sem5`, `sem6`, `sem7`, `sem8`, `cp`, `ha`, `sa`, `ca`, `cs`, `ce`) VALUES
('15cse121', 'counselling', 'placement', 'no', 80, 70, 60, 70, 80, 90, 80, 85, 83, 0, 0, 0, '2013', '2017');
-- --------------------------------------------------------
--
-- Table structure for table `bsc`
--
CREATE TABLE `bsc` (
`rollno` varchar(8) NOT NULL,
`madmin` varchar(15) NOT NULL,
`coption` varchar(20) NOT NULL,
`fgen` varchar(4) NOT NULL,
`sem1` int(3) NOT NULL,
`sem2` int(3) NOT NULL,
`sem3` int(3) NOT NULL,
`sem4` int(3) NOT NULL,
`sem5` int(3) NOT NULL,
`sem6` int(3) NOT NULL,
`cp` int(3) NOT NULL,
`ha` int(3) NOT NULL,
`sa` int(3) NOT NULL,
`ca` int(3) NOT NULL,
`cs` varchar(10) NOT NULL,
`ce` varchar(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `bsc`
--
INSERT INTO `bsc` (`rollno`, `madmin`, `coption`, `fgen`, `sem1`, `sem2`, `sem3`, `sem4`, `sem5`, `sem6`, `cp`, `ha`, `sa`, `ca`, `cs`, `ce`) VALUES
('15bsc001', 'counselling', 'placement', 'yes', 80, 70, 80, 70, 60, 50, 68, 0, 0, 0, '2014', '2017');
-- --------------------------------------------------------
--
-- Table structure for table `company`
--
CREATE TABLE `company` (
`cno` int(50) NOT NULL,
`cname` varchar(25) NOT NULL,
`address` varchar(70) NOT NULL,
`mailid` varchar(45) NOT NULL,
`contact` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `company`
--
INSERT INTO `company` (`cno`, `cname`, `address`, `mailid`, `contact`) VALUES
(1, 'cts', '15th park.', 'write@cts.com', '9842457454'),
(2, 'infosys', '12,maha tech park.', 'write@infog.com', '7356412345'),
(3, 'accenture', 'omr road,chennai.', 'mail@accet.com', '8098490903'),
(5, 'tcs', '2,tech park.', 'mail@tcs.com', '7373738909'),
(6, 'wipro', '3rd floor,Tech park.', 'write@wipro.com', '7373853031'),
(7, 'zoho', '15,crosscut road,chennai-11.', 'interview@zoho.com', '9865409325');
-- --------------------------------------------------------
--
-- Table structure for table `event`
--
CREATE TABLE `event` (
`eventname` varchar(60) NOT NULL,
`eventtype` varchar(30) NOT NULL,
`date` varchar(20) NOT NULL,
`noofdays` int(2) NOT NULL,
`edesc` text NOT NULL,
`id` int(5) NOT NULL,
`departments` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `event`
--
INSERT INTO `event` (`eventname`, `eventtype`, `date`, `noofdays`, `edesc`, `id`, `departments`) VALUES
('cts interview', 'Placement Regardsplacement', '2017-10-21', 1, 'Event Start At Date:<b>2017-10-21</b>. Total Days: 1.<br><br>Place : Maharaja Hall <br> Time:8:45<br>\r\n\r\n<b><u>Eligibility</u></b>\r\n<b>sslc percentage:</b>\r\n80%\r\n<br>\r\n<b>hsc percentage:</b>\r\n80%\r\n<br>\r\n<b>current percentage:</b>\r\n70%\r\n<br>\r\n<hr>All Student Must Come with Your All need Douments<hr>', 37, 'IT,computer application');
-- --------------------------------------------------------
--
-- Table structure for table `forumadd`
--
CREATE TABLE `forumadd` (
`Sno` int(5) NOT NULL,
`Topic` varchar(250) NOT NULL,
`Rollno` varchar(12) NOT NULL,
`Idea` varchar(20) NOT NULL,
`Details` mediumtext NOT NULL,
`Date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `forumadd`
--
INSERT INTO `forumadd` (`Sno`, `Topic`, `Rollno`, `Idea`, `Details`, `Date`) VALUES
(1, 'HR', '15mcl116', 'infosys', 'situation questions are preferably best to prepare', '2017-01-24'),
(2, 'technical interview', '15mcl090', 'tcs', 'apps- number series, lcm,hcf', '2017-01-24'),
(15, 'technical interview', '15adm001', 'zoho', 'good company', '2017-10-14'),
(19, 'written', '15adm001', 'Aurum tech', 'nice company', '2017-10-16'),
(20, 'group discussion', '15mcl109', 'accenture', 'good better work exp', '2017-10-20');
-- --------------------------------------------------------
--
-- Table structure for table `login`
--
CREATE TABLE `login` (
`id` varchar(10) NOT NULL,
`pa` varchar(20) NOT NULL,
`name` varchar(28) NOT NULL,
`department` varchar(20) NOT NULL,
`mailid` varchar(30) NOT NULL,
`role` varchar(15) NOT NULL,
`additionalrole` varchar(20) NOT NULL,
`mobileno` varchar(15) NOT NULL,
`dp` varchar(40) NOT NULL,
`status` varchar(40) NOT NULL,
`almail` varchar(45) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `login`
--
INSERT INTO `login` (`id`, `pa`, `name`, `department`, `mailid`, `role`, `additionalrole`, `mobileno`, `dp`, `status`, `almail`) VALUES
('15adm001', 'admin', 'Admin', 'office', 'admin@kongu.edu', 'admin', 'null', '9842454784', 'profile/15adm001.png', '1', 'sridharlovevirus@gmail.com'),
('15bsc001', '15bsc001', 'bhavana', 'bsc', '15bsc001@kongu.edu', 'student', 'null', '7789543210', 'user.jpg', '0', ''),
('15cse121', '15cse121', 'geetha', 'cse', '15cse121@kongu.edu', 'student', 'null', '8989543210', 'user.jpg', '0', ''),
('15hod115', '15hod115', 'keerthi', 'CSE', '15hod115@kongu.edu', 'hod', '', '9005054754', 'profile/15hod115.jpeg', '0', ''),
('15hod118', '15hod118', 'kowsika', 'IT', '15hod118@kongu.edu', 'hod', '', '9876543210', 'user.jpg', '0', ''),
('15hod119', '15hod119', 'ramya', 'computer application', '15hod119@kongu.edu', 'hod', 'null', '7005054754', 'profile/15hod119.png', '1', ''),
('15mbl001', '15mbl001', 'raja', 'mba', '15mbl001@kongu.edu', 'student', 'null', '8989543210', 'user.jpg', '0', ''),
('15mcl090', '123', 'raja', 'computer application', '15mcl090@kongu.edu', 'student', 'null', '9042578767', 'user.jpg', '0', 'tamilhari@gmail.com'),
('15mcl109', '15mcl109', 'mani', 'computer application', '15mcl109@kongu.edu', 'student', 'null', '9865327412', 'user.jpg', '0', ''),
('15mcl119', '15mcl119', 'tamilselvi', 'computer application', '15mcl119@kongu.edu', 'student', 'null', '7576543210', 'profile/15mcl119.png', '0', ''),
('15mcl120', '15mcl120', 'tamil', 'computer application', '15mcl120@kongu.edu', 'student', 'null', '9876543210', 'profile/15mcl120.jpeg', '0', ''),
('15mcl136', '15mcl136', 'vishnu', 'computer application', '15mcl136@kongu.edu', 'student', 'null', '9587454212', 'user.jpg', '0', ''),
('15msc001', '15msc001', 'ramya', 'msc', '15msc116@kongu.edu', 'student', 'null', '8500554744', 'user.jpg', '0', ''),
('15stf001', '15stf001', 'uma', 'computer application', '15stf001@kongu.edu', 'staff', 'placement', '9542100012', 'profile/15stf001.jpeg', '0', 'ram123@gmail.com'),
('15stf002', '15stf002', 'hari', 'bsc', '15stf002@kongu.edu', 'staff', 'placement', '9876543215', 'user.jpg', '0', ''),
('15stf003', '15stf003', 'rahu', 'mba', '15stf003@kongu.edu', 'staff', 'placement', '9600188452', 'user.jpg', '0', ''),
('15stf004', '15stf004', 'pyingkodi', 'msc', '15stf004@kongu.edu', 'staff', 'placement', '9875545242', 'user.jpg', '0', ''),
('15stf008', '15stf008', 'tamilselvi', 'cse', '15stf008@kongu.edu', 'staff', 'placement', '9876543252', 'user.jpg', '0', ''),
('15stf009', '15stf009', 'manivel', 'it', '15stf009@kongu.edu', 'staff', 'placement', '9876545252', 'user.jpg', '0', ''),
('15stf020', '15stf020', 'harisankar', 'computer application', '15stf020@kongu.edu', 'staff', 'null', '9876541230', 'user.jpg', '0', ''),
('15stf023', '15stf023', 'kavithabharathi', 'computer application', '15stf023@kongu.edu', 'staff', 'null', '9876543213', 'user.jpg', '0', '');
-- --------------------------------------------------------
--
-- Table structure for table `mail`
--
CREATE TABLE `mail` (
`sender` varchar(40) NOT NULL,
`subject` varchar(45) NOT NULL,
`r` varchar(45) NOT NULL,
`msg` text NOT NULL,
`a` varchar(50) NOT NULL,
`t` varchar(25) NOT NULL,
`id` int(10) NOT NULL,
`mailread` int(2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `mail`
--
INSERT INTO `mail` (`sender`, `subject`, `r`, `msg`, `a`, `t`, `id`, `mailread`) VALUES
('15mcl090', 'Request For Change Personal Details', '15stf001@kongu.edu', 'Reason for change data is:my address changed', 'http://localhost/admin/requestedit.php?request=1', '17/10/17 08:05:18pm', 85183, 1),
('15stf001', 'Accept for Editing Personal Information', '15mcl090', 'Your Request Was Successfully processed', '', '17/10/17 08:05:39pm', 96563, 0),
('15stf001', 'Dney For Change Personal Details', '15mcl090', 'give full details', '', '17/10/17 08:11:04pm', 0, 0),
('15stf001', 'Dney For Change Personal Details', '15mcl090', 'give full details', '', '17/10/17 08:12:07pm', 18581, 0),
('15stf001', 'hii', '15stf001@kongu.edu', 'hiii \r\n ', 'uploads/76051-e.xlsx', '17/10/17 11:53:02pm', 5433, 1),
('15hod119', 'final read mail function check', '15mcl020@kongu.edu', 'pass \r\n ', 'uploads/29433-', '18/10/17 12:48:44am', 55878, 0),
('15hod119', 'final read mail function check', '15mcl119@kongu.edu', 'pass \r\n ', 'uploads/29433-', '18/10/17 12:48:44am', 62116, 0),
('15hod119', 'final read mail function check', '15mcl120@kongu.edu', 'pass \r\n ', 'uploads/29433-', '18/10/17 12:48:44am', 44749, 0),
('15hod119', 'final read mail function check', '15mcl136@kongu.edu', 'pass \r\n ', 'uploads/29433-', '18/10/17 12:48:44am', 34754, 0),
('15hod119', 'final read mail function check', '15stf001@kongu.edu', 'pass \r\n ', 'uploads/29433-', '18/10/17 12:48:44am', 68914, 1),
('15hod119', 'final read mail function check', '15stf020@kongu.edu', 'pass \r\n ', 'uploads/29433-', '18/10/17 12:48:44am', 83990, 0),
('15hod119', 'final read mail function check', '15stf023@kongu.edu', 'pass \r\n ', 'uploads/29433-', '18/10/17 12:48:44am', 94616, 0),
('15hod119', 'mail sent check', '15stf001@kongu.edu', 'pass \r\n ', 'uploads/8586-', '18/10/17 12:50:47am', 8829, 0),
('15mcl090', 'null attanchment test', '15hod119@kongu.edu', 'pass \r\n ', 'uploads/86737-', '18/10/17 01:35:06am', 65577, 1),
('15mcl090', 'null attanchment test', '15mcl020@kongu.edu', 'pass \r\n ', 'uploads/86737-', '18/10/17 01:35:06am', 45090, 0),
('15mcl090', 'null attanchment test', '15mcl119@kongu.edu', 'pass \r\n ', 'uploads/86737-', '18/10/17 01:35:06am', 31549, 0),
('15mcl090', 'null attanchment test', '15mcl120@kongu.edu', 'pass \r\n ', 'uploads/86737-', '18/10/17 01:35:06am', 66884, 0),
('15mcl090', 'null attanchment test', '15mcl136@kongu.edu', 'pass \r\n ', 'uploads/86737-', '18/10/17 01:35:06am', 13218, 0),
('15mcl090', 'null attanchment test', '15stf001@kongu.edu', 'pass \r\n ', 'uploads/86737-', '18/10/17 01:35:06am', 51651, 0),
('15mcl090', 'null attanchment test', '15stf020@kongu.edu', 'pass \r\n ', 'uploads/86737-', '18/10/17 01:35:06am', 99434, 0),
('15mcl090', 'null attanchment test', '15stf023@kongu.edu', 'pass \r\n ', 'uploads/86737-', '18/10/17 01:35:06am', 24422, 0),
('15hod119', 'again attanchment test', '15mcl020@kongu.edu', 'fail \r\n ', 'uploads/48714-', '18/10/17 01:37:56am', 79318, 0),
('15hod119', 'again attanchment test', '15mcl119@kongu.edu', 'fail \r\n ', 'uploads/48714-', '18/10/17 01:37:56am', 12760, 0),
('15hod119', 'again attanchment test', '15mcl120@kongu.edu', 'fail \r\n ', 'uploads/48714-', '18/10/17 01:37:56am', 22749, 0),
('15hod119', 'again attanchment test', '15mcl136@kongu.edu', 'fail \r\n ', 'uploads/48714-', '18/10/17 01:37:56am', 58304, 0),
('15hod119', 'again attanchment test', '15stf001@kongu.edu', 'fail \r\n ', 'uploads/48714-', '18/10/17 01:37:56am', 96088, 0),
('15hod119', 'again attanchment test', '15stf020@kongu.edu', 'fail \r\n ', 'uploads/48714-', '18/10/17 01:37:56am', 90093, 0),
('15hod119', 'again attanchment test', '15stf023@kongu.edu', 'fail \r\n ', 'uploads/48714-', '18/10/17 01:37:56am', 42645, 0),
('15hod119', 'again repeat for bug fix ', '15mcl020@kongu.edu', 'fix ? \r\n ', 'uploads/94632-', '18/10/17 01:38:47am', 64569, 0),
('15hod119', 'again repeat for bug fix ', '15mcl119@kongu.edu', 'fix ? \r\n ', 'uploads/94632-', '18/10/17 01:38:47am', 26289, 0),
('15hod119', 'again repeat for bug fix ', '15mcl120@kongu.edu', 'fix ? \r\n ', 'uploads/94632-', '18/10/17 01:38:47am', 37795, 0),
('15hod119', 'again repeat for bug fix ', '15mcl136@kongu.edu', 'fix ? \r\n ', 'uploads/94632-', '18/10/17 01:38:47am', 92356, 0),
('15hod119', 'again repeat for bug fix ', '15stf001@kongu.edu', 'fix ? \r\n ', 'uploads/94632-', '18/10/17 01:38:47am', 30582, 0),
('15hod119', 'again repeat for bug fix ', '15stf020@kongu.edu', 'fix ? \r\n ', 'uploads/94632-', '18/10/17 01:38:47am', 96503, 0),
('15hod119', 'again repeat for bug fix ', '15stf023@kongu.edu', 'fix ? \r\n ', 'uploads/94632-', '18/10/17 01:38:47am', 46705, 0),
('15hod119', 'again repeat for bug fix ', '15mcl020@kongu.edu', 'fix ? \r\n ', '', '18/10/17 01:41:37am', 34639, 0),
('15hod119', 'again repeat for bug fix ', '15mcl119@kongu.edu', 'fix ? \r\n ', '', '18/10/17 01:41:37am', 11862, 0),
('15hod119', 'again repeat for bug fix ', '15mcl120@kongu.edu', 'fix ? \r\n ', '', '18/10/17 01:41:37am', 80946, 0),
('15hod119', 'again repeat for bug fix ', '15mcl136@kongu.edu', 'fix ? \r\n ', '', '18/10/17 01:41:37am', 16031, 0),
('15hod119', 'again repeat for bug fix ', '15stf001@kongu.edu', 'fix ? \r\n ', '', '18/10/17 01:41:37am', 88214, 0),
('15hod119', 'again repeat for bug fix ', '15stf020@kongu.edu', 'fix ? \r\n ', '', '18/10/17 01:41:37am', 34746, 0),
('15hod119', 'again repeat for bug fix ', '15stf023@kongu.edu', 'fix ? \r\n ', '', '18/10/17 01:41:37am', 83484, 0),
('KEC Placement', 'Placement Regardsplacement', '15bsc001@kongu.edu', 'Event Start At Date:<b>2017-10-16</b>. Total Days: 2.<br><br>sfsdf', 'uploads/55461-main.css', '01:01:01am', 93996, 0),
('KEC Placement', 'Placement Regardsplacement', '15stf002@kongu.edu', 'Event Start At Date:<b>2017-10-16</b>. Total Days: 2.<br><br>sfsdf', 'uploads/55461-main.css', '01:01:01am', 52756, 0),
('KEC Placement', 'Placement Regardsplacement', '15hod020@kongu.edu', 'Event Start At Date:<b>2017-10-16</b>. Total Days: 2.<br><br>sfsdf', 'uploads/55461-main.css', '01:01:01am', 61678, 0),
('KEC Placement', 'Placement Regardsplacement', '15hod118@kongu.edu', 'Event Start At Date:<b>2017-10-21</b>. Total Days: 1.<br><br>Place : Maharaja Hall <br> Time:8:45<br>\r\n\r\n<b><u>Eligibility</u></b>\r\n<b>sslc percentage:</b>\r\n80%\r\n<br>\r\n<b>hsc percentage:</b>\r\n80%\r\n<br>\r\n<b>current percentage:</b>\r\n70%\r\n<br>\r\n<hr>All Student Must Come with Your All need Douments<hr>', 'uploads/84411-PAPER ID.docx', '06:33:05pm', 85549, 0),
('KEC Placement', 'Placement Regardsplacement', '15stf009@kongu.edu', 'Event Start At Date:<b>2017-10-21</b>. Total Days: 1.<br><br>Place : Maharaja Hall <br> Time:8:45<br>\r\n\r\n<b><u>Eligibility</u></b>\r\n<b>sslc percentage:</b>\r\n80%\r\n<br>\r\n<b>hsc percentage:</b>\r\n80%\r\n<br>\r\n<b>current percentage:</b>\r\n70%\r\n<br>\r\n<hr>All Student Must Come with Your All need Douments<hr>', 'uploads/84411-PAPER ID.docx', '06:33:05pm', 57004, 0),
('KEC Placement', 'Placement Regardsplacement', '15hod119@kongu.edu', 'Event Start At Date:<b>2017-10-21</b>. Total Days: 1.<br><br>Place : Maharaja Hall <br> Time:8:45<br>\r\n\r\n<b><u>Eligibility</u></b>\r\n<b>sslc percentage:</b>\r\n80%\r\n<br>\r\n<b>hsc percentage:</b>\r\n80%\r\n<br>\r\n<b>current percentage:</b>\r\n70%\r\n<br>\r\n<hr>All Student Must Come with Your All need Douments<hr>', 'uploads/84411-PAPER ID.docx', '06:33:05pm', 16381, 0),
('KEC Placement', 'Placement Regardsplacement', '15mcl020@kongu.edu', 'Event Start At Date:<b>2017-10-21</b>. Total Days: 1.<br><br>Place : Maharaja Hall <br> Time:8:45<br>\r\n\r\n<b><u>Eligibility</u></b>\r\n<b>sslc percentage:</b>\r\n80%\r\n<br>\r\n<b>hsc percentage:</b>\r\n80%\r\n<br>\r\n<b>current percentage:</b>\r\n70%\r\n<br>\r\n<hr>All Student Must Come with Your All need Douments<hr>', 'uploads/84411-PAPER ID.docx', '06:33:05pm', 87163, 0),
('KEC Placement', 'Placement Regardsplacement', '15mcl090@kongu.edu', 'Event Start At Date:<b>2017-10-21</b>. Total Days: 1.<br><br>Place : Maharaja Hall <br> Time:8:45<br>\r\n\r\n<b><u>Eligibility</u></b>\r\n<b>sslc percentage:</b>\r\n80%\r\n<br>\r\n<b>hsc percentage:</b>\r\n80%\r\n<br>\r\n<b>current percentage:</b>\r\n70%\r\n<br>\r\n<hr>All Student Must Come with Your All need Douments<hr>', 'uploads/84411-PAPER ID.docx', '06:33:05pm', 17656, 1),
('KEC Placement', 'Placement Regardsplacement', '15mcl119@kongu.edu', 'Event Start At Date:<b>2017-10-21</b>. Total Days: 1.<br><br>Place : Maharaja Hall <br> Time:8:45<br>\r\n\r\n<b><u>Eligibility</u></b>\r\n<b>sslc percentage:</b>\r\n80%\r\n<br>\r\n<b>hsc percentage:</b>\r\n80%\r\n<br>\r\n<b>current percentage:</b>\r\n70%\r\n<br>\r\n<hr>All Student Must Come with Your All need Douments<hr>', 'uploads/84411-PAPER ID.docx', '06:33:05pm', 15416, 0),
('KEC Placement', 'Placement Regardsplacement', '15mcl120@kongu.edu', 'Event Start At Date:<b>2017-10-21</b>. Total Days: 1.<br><br>Place : Maharaja Hall <br> Time:8:45<br>\r\n\r\n<b><u>Eligibility</u></b>\r\n<b>sslc percentage:</b>\r\n80%\r\n<br>\r\n<b>hsc percentage:</b>\r\n80%\r\n<br>\r\n<b>current percentage:</b>\r\n70%\r\n<br>\r\n<hr>All Student Must Come with Your All need Douments<hr>', 'uploads/84411-PAPER ID.docx', '06:33:05pm', 76345, 0),
('KEC Placement', 'Placement Regardsplacement', '15mcl136@kongu.edu', 'Event Start At Date:<b>2017-10-21</b>. Total Days: 1.<br><br>Place : Maharaja Hall <br> Time:8:45<br>\r\n\r\n<b><u>Eligibility</u></b>\r\n<b>sslc percentage:</b>\r\n80%\r\n<br>\r\n<b>hsc percentage:</b>\r\n80%\r\n<br>\r\n<b>current percentage:</b>\r\n70%\r\n<br>\r\n<hr>All Student Must Come with Your All need Douments<hr>', 'uploads/84411-PAPER ID.docx', '06:33:05pm', 66257, 0),
('KEC Placement', 'Placement Regardsplacement', '15stf001@kongu.edu', 'Event Start At Date:<b>2017-10-21</b>. Total Days: 1.<br><br>Place : Maharaja Hall <br> Time:8:45<br>\r\n\r\n<b><u>Eligibility</u></b>\r\n<b>sslc percentage:</b>\r\n80%\r\n<br>\r\n<b>hsc percentage:</b>\r\n80%\r\n<br>\r\n<b>current percentage:</b>\r\n70%\r\n<br>\r\n<hr>All Student Must Come with Your All need Douments<hr>', 'uploads/84411-PAPER ID.docx', '06:33:05pm', 98562, 0),
('KEC Placement', 'Placement Regardsplacement', '15stf020@kongu.edu', 'Event Start At Date:<b>2017-10-21</b>. Total Days: 1.<br><br>Place : Maharaja Hall <br> Time:8:45<br>\r\n\r\n<b><u>Eligibility</u></b>\r\n<b>sslc percentage:</b>\r\n80%\r\n<br>\r\n<b>hsc percentage:</b>\r\n80%\r\n<br>\r\n<b>current percentage:</b>\r\n70%\r\n<br>\r\n<hr>All Student Must Come with Your All need Douments<hr>', 'uploads/84411-PAPER ID.docx', '06:33:05pm', 68443, 0),
('KEC Placement', 'Placement Regardsplacement', '15stf023@kongu.edu', 'Event Start At Date:<b>2017-10-21</b>. Total Days: 1.<br><br>Place : Maharaja Hall <br> Time:8:45<br>\r\n\r\n<b><u>Eligibility</u></b>\r\n<b>sslc percentage:</b>\r\n80%\r\n<br>\r\n<b>hsc percentage:</b>\r\n80%\r\n<br>\r\n<b>current percentage:</b>\r\n70%\r\n<br>\r\n<hr>All Student Must Come with Your All need Douments<hr>', 'uploads/84411-PAPER ID.docx', '06:33:05pm', 84103, 0),
('15mcl109', 'Request For Change Personal Details', '15stf001@kongu.edu', 'Reason for change data is:my address changed', 'http://localhost/admin/requestedit.php?request=1', '21/10/17 06:14:10am', 99997, 1),
('15mcl109', 'Request For Change Personal Details', '15stf001@kongu.edu', 'Reason for change data is:my addresschanged', 'http://localhost/admin/requestedit.php?request=1', '21/10/17 09:50:07am', 97279, 1),
('KEC Placement', 'Placement Regardsplacement', '15hod119@kongu.edu', 'Event Start At Date:<b>2017-10-31</b>. Total Days: 1.<br><br>before allowanced<br><br>\r\ndate:31-10-2017', 'uploads/28668-be.doc', '06:10:20pm', 55227, 0),
('KEC Placement', 'Placement Regardsplacement', '15mcl090@kongu.edu', 'Event Start At Date:<b>2017-10-31</b>. Total Days: 1.<br><br>before allowanced<br><br>\r\ndate:31-10-2017', 'uploads/28668-be.doc', '06:10:21pm', 76877, 0),
('KEC Placement', 'Placement Regardsplacement', '15mcl109@kongu.edu', 'Event Start At Date:<b>2017-10-31</b>. Total Days: 1.<br><br>before allowanced<br><br>\r\ndate:31-10-2017', 'uploads/28668-be.doc', '06:10:21pm', 74210, 1),
('KEC Placement', 'Placement Regardsplacement', '15mcl119@kongu.edu', 'Event Start At Date:<b>2017-10-31</b>. Total Days: 1.<br><br>before allowanced<br><br>\r\ndate:31-10-2017', 'uploads/28668-be.doc', '06:10:21pm', 48833, 0),
('KEC Placement', 'Placement Regardsplacement', '15mcl120@kongu.edu', 'Event Start At Date:<b>2017-10-31</b>. Total Days: 1.<br><br>before allowanced<br><br>\r\ndate:31-10-2017', 'uploads/28668-be.doc', '06:10:21pm', 64678, 0),
('KEC Placement', 'Placement Regardsplacement', '15mcl136@kongu.edu', 'Event Start At Date:<b>2017-10-31</b>. Total Days: 1.<br><br>before allowanced<br><br>\r\ndate:31-10-2017', 'uploads/28668-be.doc', '06:10:21pm', 45920, 0),
('KEC Placement', 'Placement Regardsplacement', '15stf001@kongu.edu', 'Event Start At Date:<b>2017-10-31</b>. Total Days: 1.<br><br>before allowanced<br><br>\r\ndate:31-10-2017', 'uploads/28668-be.doc', '06:10:21pm', 61005, 0),
('KEC Placement', 'Placement Regardsplacement', '15stf020@kongu.edu', 'Event Start At Date:<b>2017-10-31</b>. Total Days: 1.<br><br>before allowanced<br><br>\r\ndate:31-10-2017', 'uploads/28668-be.doc', '06:10:21pm', 81678, 0),
('KEC Placement', 'Placement Regardsplacement', '15stf023@kongu.edu', 'Event Start At Date:<b>2017-10-31</b>. Total Days: 1.<br><br>before allowanced<br><br>\r\ndate:31-10-2017', 'uploads/28668-be.doc', '06:10:21pm', 28122, 0),
('KEC Placement', 'Placement Regardsplacement', '15mcl090@kongu.edu', 'Event Start At Date:<b>2017-10-31</b>. Total Days: 1.<br><br>not null', 'uploads/91335-klogo.jpg', '08:16:47pm', 24362, 0),
('KEC Placement', 'Placement Regardsplacement', '15mcl109@kongu.edu', 'Event Start At Date:<b>2017-10-31</b>. Total Days: 1.<br><br>not null', 'uploads/91335-klogo.jpg', '08:16:47pm', 48724, 0),
('KEC Placement', 'Placement Regardsplacement', '15mcl119@kongu.edu', 'Event Start At Date:<b>2017-10-31</b>. Total Days: 1.<br><br>not null', 'uploads/91335-klogo.jpg', '08:16:47pm', 19517, 0),
('KEC Placement', 'InFosys InterviewEvent Cancelled', '15hod119@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:16:59pm', 23415, 0),
('KEC Placement', 'InFosys InterviewEvent Cancelled', '15mcl090@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:16:59pm', 63587, 0),
('KEC Placement', 'InFosys InterviewEvent Cancelled', '15mcl109@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:16:59pm', 18722, 0),
('KEC Placement', 'InFosys InterviewEvent Cancelled', '15mcl119@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:16:59pm', 65947, 0),
('KEC Placement', 'InFosys InterviewEvent Cancelled', '15mcl120@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:16:59pm', 23187, 0),
('KEC Placement', 'InFosys InterviewEvent Cancelled', '15mcl136@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:16:59pm', 22083, 0),
('KEC Placement', 'InFosys InterviewEvent Cancelled', '15stf001@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:16:59pm', 78130, 0),
('KEC Placement', 'InFosys InterviewEvent Cancelled', '15stf020@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:16:59pm', 80259, 0),
('KEC Placement', 'InFosys InterviewEvent Cancelled', '15stf023@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:16:59pm', 77647, 0),
('KEC Placement', 'CTG INTERVIEWEvent Cancelled', '15hod119@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:17:02pm', 73114, 0),
('KEC Placement', 'CTG INTERVIEWEvent Cancelled', '15mcl090@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:17:02pm', 90489, 0),
('KEC Placement', 'CTG INTERVIEWEvent Cancelled', '15mcl109@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:17:02pm', 32939, 0),
('KEC Placement', 'CTG INTERVIEWEvent Cancelled', '15mcl119@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:17:02pm', 80891, 0),
('KEC Placement', 'CTG INTERVIEWEvent Cancelled', '15mcl120@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:17:02pm', 56263, 0),
('KEC Placement', 'CTG INTERVIEWEvent Cancelled', '15mcl136@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:17:02pm', 81494, 0),
('KEC Placement', 'CTG INTERVIEWEvent Cancelled', '15stf001@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:17:02pm', 58015, 0),
('KEC Placement', 'CTG INTERVIEWEvent Cancelled', '15stf020@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:17:02pm', 64170, 0),
('KEC Placement', 'CTG INTERVIEWEvent Cancelled', '15stf023@kongu.edu', '<br><br><b>The Above Event Was Cancelled By Placement Cell for unexpected issue.<b><br><hr> <i>More details contact your placement co-ordinator</i><br>', '', '08:17:02pm', 83683, 0),
('15adm001', 'sent placement student list', '15stf001@kongu.edu', 'Plz fill and sent students list via excel file \r\n ', 'uploads/3595-e.xlsx', '03/11/17 10:55:02am', 7185, 1);
-- --------------------------------------------------------
--
-- Table structure for table `markupdate`
--
CREATE TABLE `markupdate` (
`rollno` varchar(15) NOT NULL,
`department` varchar(20) NOT NULL,
`mark` int(3) NOT NULL,
`cp` int(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `markupdate`
--
INSERT INTO `markupdate` (`rollno`, `department`, `mark`, `cp`) VALUES
('15mcl090', 'computer application', 90, 90),
('15mcl109', 'computer application', 80, 75);
-- --------------------------------------------------------
--
-- Table structure for table `mba`
--
CREATE TABLE `mba` (
`rollno` varchar(8) NOT NULL,
`eexam` varchar(20) NOT NULL,
`madmin` varchar(20) NOT NULL,
`co` varchar(20) NOT NULL,
`fgen` varchar(4) NOT NULL,
`ugcollege` varchar(40) NOT NULL,
`ugper` int(3) NOT NULL,
`ugspec` varchar(40) NOT NULL,
`sem1` int(3) NOT NULL,
`sem2` int(3) NOT NULL,
`sem3` int(3) NOT NULL,
`sem4` int(3) NOT NULL,
`cp` int(3) NOT NULL,
`ha` int(3) NOT NULL,
`sa` int(3) NOT NULL,
`ca` int(3) NOT NULL,
`cs` varchar(11) NOT NULL,
`ce` varchar(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `mba`
--
INSERT INTO `mba` (`rollno`, `eexam`, `madmin`, `co`, `fgen`, `ugcollege`, `ugper`, `ugspec`, `sem1`, `sem2`, `sem3`, `sem4`, `cp`, `ha`, `sa`, `ca`, `cs`, `ce`) VALUES
('15mbl001', 'tancet', 'counselling', 'placement', 'no', 'gobi arts and science college', 76, 'tax management', 60, 65, 60, 55, 60, 0, 0, 0, '2016', '2017');
-- --------------------------------------------------------
--
-- Table structure for table `mca`
--
CREATE TABLE `mca` (
`rollno` varchar(8) NOT NULL,
`eexam` varchar(20) NOT NULL,
`madmin` varchar(20) NOT NULL,
`co` varchar(20) NOT NULL,
`fgen` varchar(4) NOT NULL,
`ugcollege` varchar(40) NOT NULL,
`ugper` int(3) NOT NULL,
`ugspec` varchar(40) NOT NULL,
`sem1` int(3) NOT NULL,
`sem2` int(3) NOT NULL,
`sem3` int(3) NOT NULL,
`sem4` int(3) NOT NULL,
`sem5` int(3) NOT NULL,
`sem6` int(3) NOT NULL,
`cp` int(3) NOT NULL,
`ha` int(3) NOT NULL,
`sa` int(3) NOT NULL,
`ca` int(3) NOT NULL,
`cs` varchar(10) NOT NULL,
`ce` varchar(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `mca`
--
INSERT INTO `mca` (`rollno`, `eexam`, `madmin`, `co`, `fgen`, `ugcollege`, `ugper`, `ugspec`, `sem1`, `sem2`, `sem3`, `sem4`, `sem5`, `sem6`, `cp`, `ha`, `sa`, `ca`, `cs`, `ce`) VALUES
('15mcl090', 'TANCET', 'Counselling', 'higher education', 'yes', 'gobiarts', 70, 'computer science', 70, 80, 90, 80, 70, 90, 90, 0, 0, 0, '2016', '2017'),
('15mcl109', 'TANCET', 'Counselling', 'placed', 'yes', 'gobiartscollege', 75, 'computerscience', 70, 70, 80, 70, 70, 70, 75, 0, 0, 0, '2016', '2017'),
('15mcl119', 'TANCET', 'Counselling', 'Placement', 'yes', 'gobiartscollege', 80, 'computerscience', 80, 80, 80, 80, 80, 80, 80, 0, 0, 0, '2016', '2017');
-- --------------------------------------------------------
--
-- Table structure for table `msc`
--
CREATE TABLE `msc` (
`rollno` varchar(8) NOT NULL,
`coption` varchar(20) NOT NULL,
`fgen` varchar(4) NOT NULL,
`sem1` int(3) NOT NULL,
`sem2` int(3) NOT NULL,
`sem3` int(3) NOT NULL,
`sem4` int(3) NOT NULL,
`sem5` int(3) NOT NULL,
`sem6` int(3) NOT NULL,
`sem7` int(3) NOT NULL,
`sem8` int(3) NOT NULL,
`sem9` int(3) NOT NULL,
`sem10` int(3) NOT NULL,
`cp` int(3) NOT NULL,
`ha` int(3) NOT NULL,
`sa` int(11) NOT NULL,
`ca` int(11) NOT NULL,
`cs` varchar(9) NOT NULL,
`ce` varchar(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `msc`
--
INSERT INTO `msc` (`rollno`, `coption`, `fgen`, `sem1`, `sem2`, `sem3`, `sem4`, `sem5`, `sem6`, `sem7`, `sem8`, `sem9`, `sem10`, `cp`, `ha`, `sa`, `ca`, `cs`, `ce`) VALUES
('15msc001', 'placement', 'yes', 70, 80, 70, 80, 70, 80, 70, 80, 70, 80, 75, 0, 0, 0, '2013', '2017');
-- --------------------------------------------------------
--
-- Table structure for table `msg`
--
CREATE TABLE `msg` (
`rollno` varchar(9) NOT NULL,
`msg` varchar(50) NOT NULL,
`att` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `msg`
--
INSERT INTO `msg` (`rollno`, `msg`, `att`) VALUES
('15mcl118', 'hi', 'c:'),
('15mcl118', 'hw ru', 'd:');
-- --------------------------------------------------------
--
-- Table structure for table `placedstudent`
--
CREATE TABLE `placedstudent` (
`name` varchar(45) NOT NULL,
`rollno` varchar(10) NOT NULL,
`company` varchar(50) NOT NULL,
`date` varchar(25) NOT NULL,
`department` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `placedstudent`
--
INSERT INTO `placedstudent` (`name`, `rollno`, `company`, `date`, `department`) VALUES
('mani', '15mcl109', 'aurum tech', '22-06-2016', 'computer application');
-- --------------------------------------------------------
--
-- Table structure for table `request`
--
CREATE TABLE `request` (
`rollno` varchar(10) NOT NULL,
`reason` text NOT NULL,
`time` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `request`
--
INSERT INTO `request` (`rollno`, `reason`, `time`) VALUES
('15mcl090', 'address changed', '17/10/17 08:10:27pm'),
('15mcl109', 'my addresschanged', '21/10/17 09:50:07am');
-- --------------------------------------------------------
--
-- Table structure for table `sem`
--
CREATE TABLE `sem` (
`dept` varchar(30) NOT NULL,
`sem` int(2) NOT NULL,
`d` date NOT NULL,
`e` varchar(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `staffexcel`
--
CREATE TABLE `staffexcel` (
`filename` varchar(100) NOT NULL,
`id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `staffexcel`
--
INSERT INTO `staffexcel` (`filename`, `id`) VALUES
('test/68756.xlsx', 1);
-- --------------------------------------------------------
--
-- Table structure for table `student`
--
CREATE TABLE `student` (
`fname` varchar(35) NOT NULL,
`lname` varchar(35) NOT NULL,
`fathername` varchar(35) NOT NULL,
`occupation` varchar(35) NOT NULL,
`dob` varchar(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `studentinfo`
--
CREATE TABLE `studentinfo` (
`rollno` varchar(10) NOT NULL,
`firstname` varchar(35) NOT NULL,
`lastname` varchar(35) NOT NULL,
`fathername` varchar(35) NOT NULL,
`occupation` varchar(30) NOT NULL,
`dob` varchar(20) NOT NULL,
`gender` varchar(8) NOT NULL,
`mobileno` varchar(13) NOT NULL,
`email` varchar(45) NOT NULL,
`streetname` varchar(35) NOT NULL,
`villagename` varchar(35) NOT NULL,
`cityname` varchar(35) NOT NULL,
`statename` varchar(35) NOT NULL,
`pincode` int(9) NOT NULL,
`language` varchar(40) NOT NULL,
`caste` varchar(8) NOT NULL,
`comefrom` varchar(20) NOT NULL,
`skills` text NOT NULL,
`educationcap` varchar(7) NOT NULL,
`capreason` text NOT NULL,
`physicalena` varchar(7) NOT NULL,
`physicalreason` text NOT NULL,
`sslcregno` int(15) NOT NULL,
`sslcschoolname` varchar(40) NOT NULL,
`sslccerificateno` int(20) NOT NULL,
`sslcboard` varchar(20) NOT NULL,
`sslcstart` varchar(10) NOT NULL,
`sslcend` varchar(10) NOT NULL,
`hscregno` int(15) NOT NULL,
`hscschoolname` varchar(35) NOT NULL,
`hsccerificateno` int(15) NOT NULL,
`hscboard` varchar(20) NOT NULL,
`hscspecification` varchar(40) NOT NULL,
`hscstart` varchar(15) NOT NULL,
`hscend` varchar(15) NOT NULL,
`counsellingrank` int(10) NOT NULL,
`cutoffmark` varchar(8) NOT NULL,
`enterance` varchar(20) NOT NULL,
`admission` varchar(20) NOT NULL,
`careeroption` varchar(20) NOT NULL,
`beclevel` varchar(10) NOT NULL,
`firstgen` varchar(5) NOT NULL,
`becstatus` varchar(10) NOT NULL,
`degreelevel` varchar(5) NOT NULL,
`firstsem` float NOT NULL,
`secondsem` float NOT NULL,
`thirdsem` float NOT NULL,
`fourthsem` float NOT NULL,
`fifthsem` float NOT NULL,
`sixthsem` float NOT NULL,
`seventhsem` float NOT NULL,
`eigthsem` float NOT NULL,
`historyarrear` int(2) NOT NULL,
`clearedarrear` int(2) NOT NULL,
`noofstandingarrear` int(2) NOT NULL,
`coursestart` varchar(15) NOT NULL,
`currentcgpa` float NOT NULL,
`ugpercentage` float NOT NULL,
`ugpercentagewithout` float NOT NULL,
`ugspeci` varchar(35) NOT NULL,
`department` varchar(35) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `studentinfo`
--
INSERT INTO `studentinfo` (`rollno`, `firstname`, `lastname`, `fathername`, `occupation`, `dob`, `gender`, `mobileno`, `email`, `streetname`, `villagename`, `cityname`, `statename`, `pincode`, `language`, `caste`, `comefrom`, `skills`, `educationcap`, `capreason`, `physicalena`, `physicalreason`, `sslcregno`, `sslcschoolname`, `sslccerificateno`, `sslcboard`, `sslcstart`, `sslcend`, `hscregno`, `hscschoolname`, `hsccerificateno`, `hscboard`, `hscspecification`, `hscstart`, `hscend`, `counsellingrank`, `cutoffmark`, `enterance`, `admission`, `careeroption`, `beclevel`, `firstgen`, `becstatus`, `degreelevel`, `firstsem`, `secondsem`, `thirdsem`, `fourthsem`, `fifthsem`, `sixthsem`, `seventhsem`, `eigthsem`, `historyarrear`, `clearedarrear`, `noofstandingarrear`, `coursestart`, `currentcgpa`, `ugpercentage`, `ugpercentagewithout`, `ugspeci`, `department`) VALUES
('15it120', 'tamil', 'ramasamy', 'ramasamy', 'farmer', '2000-09-17', 'male', '9874521000', 'tamilsam@gmail.com', '12,km nagar', 'karattadipalayam', 'gobi', 'tamilnadu', 638453, 'tamil,english.', 'BC', 'Dayscholar', 'php', '1', '', '1', '', 123456, 'govt hr school', 1212121, 'stateboard', '06/2012', '05/2013', 546464, 'govt hr school', 124545, 'stateboard', 'computer,maths', '06/2014', '05/2015', 1212, '198', 'tancet', 'counselling', 'placement', 'preliminar', 'yes', 'B1', 'ug', 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, '05/2016', 5, 0, 0, '', 'information techonology'),
('15mcl119', 'sridhar', 'karuppusamy', 'karuppusamy', 'finance', '1995-12-28', 'male', '9845732102', 'sridharmca@gmail.com', '32,raman street.', 'karattadipalayam', 'gobichettipalayam', 'tamil nadu', 638452, 'tamil,english.', 'bc', 'hostel', 'python,java,webdesign.', '0', '', '0', '', 109494, 'diamond jubliee higher sec school', 1245785, 'stateboard', '06/2010', '05/2011', 1254545, 'diamond jubliee higher sec school', 1518451, 'state board', 'maths,computer.', '06/2012', '05/2013', 121, '1455', 'tancet', 'management', 'placement', 'B1', '0', '', 'pg', 8.3, 8.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, '06/2016', 8.5, 76, 70, 'maths,computer.', 'computer application');
-- --------------------------------------------------------
--
-- Table structure for table `studentpersonal`
--
CREATE TABLE `studentpersonal` (
`rollno` varchar(9) NOT NULL,
`fathername` varchar(35) NOT NULL,
`occupation` varchar(35) NOT NULL,
`dob` varchar(15) NOT NULL,
`gender` varchar(7) NOT NULL,
`mobileno` varchar(11) NOT NULL,
`mail` varchar(40) NOT NULL,
`streetname` varchar(40) NOT NULL,
`villagename` varchar(40) NOT NULL,
`cityname` varchar(40) NOT NULL,
`statename` varchar(40) NOT NULL,
`caste` varchar(40) NOT NULL,
`comefrom` varchar(16) NOT NULL,
`pincode` int(7) NOT NULL,
`language` varchar(20) NOT NULL,
`skills` varchar(40) NOT NULL,
`pys` varchar(4) NOT NULL,
`pysreason` text NOT NULL,
`edugap` varchar(4) NOT NULL,
`edureason` text NOT NULL,
`sslcregno` int(8) NOT NULL,
`sslcschool` varchar(40) NOT NULL,
`sslccertificate` int(8) NOT NULL,
`sslcboard` varchar(15) NOT NULL,
`sslcstart` varchar(10) NOT NULL,
`sslcend` varchar(10) NOT NULL,
`highedu` varchar(10) NOT NULL,
`hscregno` int(8) NOT NULL,
`hscschool` varchar(40) NOT NULL,
`hsccertificate` int(8) NOT NULL,
`hscboard` varchar(15) NOT NULL,
`hscstart` varchar(10) NOT NULL,
`hscend` varchar(10) NOT NULL,
`hscspec` varchar(40) NOT NULL,
`hsccutoff` int(8) NOT NULL,
`crank` int(8) NOT NULL,
`dregno` varchar(8) NOT NULL,
`dcollege` varchar(40) NOT NULL,
`dcertificate` int(8) NOT NULL,
`dboard` varchar(15) NOT NULL,
`dstart` varchar(8) NOT NULL,
`dend` varchar(8) NOT NULL,
`dspec` varchar(40) NOT NULL,
`dcutoff` int(3) NOT NULL,
`dcrank` int(5) NOT NULL,
`finish` int(2) NOT NULL,
`sslcmark` int(3) NOT NULL,
`hscmark` int(3) NOT NULL,
`hscper` int(3) NOT NULL,
`sslcper` int(3) NOT NULL,
`dper` int(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `studentpersonal`
--
INSERT INTO `studentpersonal` (`rollno`, `fathername`, `occupation`, `dob`, `gender`, `mobileno`, `mail`, `streetname`, `villagename`, `cityname`, `statename`, `caste`, `comefrom`, `pincode`, `language`, `skills`, `pys`, `pysreason`, `edugap`, `edureason`, `sslcregno`, `sslcschool`, `sslccertificate`, `sslcboard`, `sslcstart`, `sslcend`, `highedu`, `hscregno`, `hscschool`, `hsccertificate`, `hscboard`, `hscstart`, `hscend`, `hscspec`, `hsccutoff`, `crank`, `dregno`, `dcollege`, `dcertificate`, `dboard`, `dstart`, `dend`, `dspec`, `dcutoff`, `dcrank`, `finish`, `sslcmark`, `hscmark`, `hscper`, `sslcper`, `dper`) VALUES
('15mcl109', 'rajaaaa', 'dfdf', '2017-10-25', 'male', '9876543210', 'sri@hm.com', 'lsdjfvhj', 'khgkhg', 'khkhg', 'Tamilnadu', 'BC', 'Dayschooler', 698545, 'jgfkjf', 'jjhfv', 'no', '', 'no', '', 109493, 'erodegovthighersecschool', 12345678, 'Stateboard', '06-2010', '06-2011', 'HSC', 125452, 'erodegovtschool', 12345672, 'Stateboard', '06-2012', '06-2013', 'computerscience', 190, 121, '', '', 0, '', '', '', '', 0, 0, 1, 450, 880, 73, 90, 0),
('15bsc001', 'janumani', 'farmer', '28/12/1998', 'female', '9874512565', 'janaio@gmail.com', 'ramnager', 'kumaran kobil', 'nalaiyampalayam', 'tamilnadu', 'bc', 'dayschooler', 638452, 'tamil,englidh.', 'java', 'no', '', 'no', '', 151515, 'ghsschool', 3231123, 'stateboard', '06-2012', '06-2013', 'bsc', 151154, 'ghsschool', 64654111, 'stateboard', '06-2014', '06-2015', 'computer science', 121, 1452, '', '', 0, '', '', '', '', 0, 0, 1, 450, 882, 74, 90, 0),
('15mcl090', 'ram', 'business', '1996-06-11', 'male', '9999884445', 'ram@gmail.com', 'kumar nagar', 'karattuer', 'erode', 'Tamilnadu', 'BC', 'Dayschooler', 638452, 'tamil', 'php', 'no', '', 'no', '', 109555, 'govermentschool', 45545444, 'Stateboard', '06-2012', '06-2013', 'HSC', 151512, 'diamondjublieehigerscenodaryschool', 15452411, 'stateboard', '06-2012', '06-2013', 'computer science', 180, 2012, '', '', 0, '', '', '', '', 0, 0, 0, 450, 885, 74, 90, 0),
('15msc001', 'tharma', 'farmer', '28/05/1995', 'female', '9600199848', 'ramyaswty@gmail.com', 'tamil nagar', 'kallipatti', 'anthiur', 'tamilnadu', 'bc', 'hostel', 685425, 'english,tamil.', 'c,c++', 'no', '', 'no', '', 154545, 'thankalurhighschool', 454541, 'stateboard', '06-2010', '06-2011', 'hsc', 152458, 'thankalurhighschool', 45478511, 'stateboard', '06-2012', '06-2013', 'computer science', 150, 2545, '', '', 0, '', '', '', '', 0, 0, 1, 430, 830, 73, 84, 0),
('15cse121', 'ramasamy', 'tailer', '12/12/1996', 'female', '9857412345', 'geetha23@gmail.com', 'umalakshmi nagar', 'thalaivar puram', 'bavani', 'tamilnadu', 'st', 'hostel', 635842, 'tamil,english.', 'java', 'no', '', 'no', '', 184547, 'govt.highschool', 784444, 'stateboard', '06-2010', '06-2011', 'hsc', 154242, 'govt.highschool', 15754511, 'stateboard', '06-2012', '06-2013', 'compter science', 180, 1520, '', '', 0, '', '', '', '', 0, 0, 1, 430, 883, 74, 86, 0),
('15mcl119', 'raja', 'farmer', '1995-12-28', 'female', '9842454745', 'tamil@gmail.com', 'kumaran street', 'karattadipalayam', 'gobichettipalayam', 'Tamilnadu', 'BC', 'Hostel', 638453, 'tamil', 'php', 'no', '', 'no', '', 109494, 'djhsschool', 45454555, 'Stateboard', '06-2010', '06-2011', 'HSC', 155454, 'djhsschool', 41154654, 'Stateboard', '06-2012', '06-2013', 'computerscience', 192, 1221, '', '', 0, '', '', '', '', 0, 0, 1, 400, 882, 74, 80, 0),
('15mbl001', 'palani', 'businessman', '20/12/1996', 'male', '8542512365', 'rajapalani@gmail.com', 'lakhanager', 'kasipalayam', 'gobichettipalayam', 'tamilnadu', 'bc', 'hostel', 687542, 'tamil,english.', 'php,c.', 'no', '', 'no', '', 192545, 'kasihighcollege', 524524, 'stateboard', '06-2010', '06-2011', 'hsc', 784461, 'kasihighcollege', 45454551, 'stateboard', '06-2012', '06-2013', 'business maths', 190, 250, '', '', 0, '', '', '', '', 0, 0, 1, 450, 880, 73, 90, 0);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_post`
--
CREATE TABLE `tbl_post` (
`post_id` int(11) NOT NULL,
`post_title` text NOT NULL,
`post_description` text NOT NULL,
`post_status` varchar(15) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `upload`
--
CREATE TABLE `upload` (
`file` varchar(50) NOT NULL,
`type` varchar(50) NOT NULL,
`size` int(50) NOT NULL,
`Topic` varchar(50) NOT NULL,
`Info` varchar(20) NOT NULL,
`Rollno` varchar(10) NOT NULL,
`Dept` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `upload`
--
INSERT INTO `upload` (`file`, `type`, `size`, `Topic`, `Info`, `Rollno`, `Dept`) VALUES
('9828-PAPER ID.docx', 'application/vnd.openxmlformats-officedocument.word', 267125, 'Subjects', '', '15mcl090', 'computer application');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `be`
--
ALTER TABLE `be`
ADD PRIMARY KEY (`rollno`);
--
-- Indexes for table `bsc`
--
ALTER TABLE `bsc`
ADD PRIMARY KEY (`rollno`);
--
-- Indexes for table `company`
--
ALTER TABLE `company`
ADD PRIMARY KEY (`cno`);
--
-- Indexes for table `event`
--
ALTER TABLE `event`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `forumadd`
--
ALTER TABLE `forumadd`
ADD PRIMARY KEY (`Sno`);
--
-- Indexes for table `login`
--
ALTER TABLE `login`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `markupdate`
--
ALTER TABLE `markupdate`
ADD PRIMARY KEY (`rollno`);
--
-- Indexes for table `mba`
--
ALTER TABLE `mba`
ADD PRIMARY KEY (`rollno`);
--
-- Indexes for table `mca`
--
ALTER TABLE `mca`
ADD PRIMARY KEY (`rollno`);
--
-- Indexes for table `msc`
--
ALTER TABLE `msc`
ADD PRIMARY KEY (`rollno`);
--
-- Indexes for table `placedstudent`
--
ALTER TABLE `placedstudent`
ADD PRIMARY KEY (`rollno`);
--
-- Indexes for table `request`
--
ALTER TABLE `request`
ADD PRIMARY KEY (`rollno`);
--
-- Indexes for table `studentinfo`
--
ALTER TABLE `studentinfo`
ADD PRIMARY KEY (`rollno`);
--
-- Indexes for table `studentpersonal`
--
ALTER TABLE `studentpersonal`
ADD PRIMARY KEY (`hscregno`);
--
-- Indexes for table `tbl_post`
--
ALTER TABLE `tbl_post`
ADD PRIMARY KEY (`post_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `company`
--
ALTER TABLE `company`
MODIFY `cno` int(50) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `event`
--
ALTER TABLE `event`
MODIFY `id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38;
--
-- AUTO_INCREMENT for table `forumadd`
--
ALTER TABLE `forumadd`
MODIFY `Sno` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
--
-- AUTO_INCREMENT for table `tbl_post`
--
ALTER TABLE `tbl_post`
MODIFY `post_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
/*!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 */;
| 61.090173 | 871 | 0.61976 |
05e2c867d2951db4e175c0a9df15894bd0b882ea
| 797 |
rb
|
Ruby
|
lib/services/ecf/ecf_payment_calculation_service.rb
|
ConorBeaupres/cpd-payment-calculations
|
2a356dfac4807298ed23c9fcd753c22a8fe26e4e
|
[
"MIT"
] | null | null | null |
lib/services/ecf/ecf_payment_calculation_service.rb
|
ConorBeaupres/cpd-payment-calculations
|
2a356dfac4807298ed23c9fcd753c22a8fe26e4e
|
[
"MIT"
] | null | null | null |
lib/services/ecf/ecf_payment_calculation_service.rb
|
ConorBeaupres/cpd-payment-calculations
|
2a356dfac4807298ed23c9fcd753c22a8fe26e4e
|
[
"MIT"
] | null | null | null |
# frozen_string_literal: true
class EcfPaymentCalculationService
def initialize(config)
@config = config
end
def calculate
{
input: @config,
output: {
per_participant_service_fee: per_participant_service_fee,
total_service_fee: total_service_fee,
monthly_service_fee: monthly_service_fee,
},
}
end
private
def per_participant_service_fee
band_a * 0.4
end
def total_service_fee
recruitment_target * per_participant_service_fee
end
def monthly_service_fee
number_of_monthly_payments = 29
(total_service_fee / number_of_monthly_payments).round(0).to_d
end
# config accessors
def band_a
BigDecimal(@config[:band_a], 10)
end
def recruitment_target
@config[:recruitment_target]
end
end
| 18.113636 | 66 | 0.720201 |
0402afc5c96a4835ac135bab74d8a4e74b22c0e1
| 506 |
asm
|
Assembly
|
programs/oeis/314/A314838.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/314/A314838.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/314/A314838.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A314838: Coordination sequence Gal.4.52.3 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; 1,5,9,14,18,23,27,32,37,41,46,50,55,59,64,69,73,78,82,87,91,96,101,105,110,114,119,123,128,133,137,142,146,151,155,160,165,169,174,178,183,187,192,197,201,206,210,215,219,224
mov $3,$0
cmp $3,0
mov $4,$0
add $0,$3
mul $0,2
mov $2,8
add $2,$0
mul $2,2
add $2,8
div $2,7
add $2,3
mov $1,$2
sub $1,6
mov $5,$4
mul $5,4
add $1,$5
| 25.3 | 176 | 0.679842 |
3eae8e16f209dbf081c303053cbca75eb139bf7a
| 2,750 |
h
|
C
|
environments/MountainCar.h
|
AaronTrip/hog2
|
96616b40f4173959b127011c76f3e649688e1a99
|
[
"MIT"
] | 2 |
2021-06-09T13:54:15.000Z
|
2021-07-04T13:30:46.000Z
|
environments/MountainCar.h
|
AaronTrip/hog2
|
96616b40f4173959b127011c76f3e649688e1a99
|
[
"MIT"
] | null | null | null |
environments/MountainCar.h
|
AaronTrip/hog2
|
96616b40f4173959b127011c76f3e649688e1a99
|
[
"MIT"
] | 2 |
2017-04-17T11:08:57.000Z
|
2017-04-18T08:28:27.000Z
|
/*
* MountainCar.h
* hog2
*
* Created by Nathan Sturtevant on 11/29/10.
* Copyright 2010 University of Denver. All rights reserved.
*
*/
#ifndef MOUNTAINCAR_H
#define MOUNTAINCAR_H
#include "SearchEnvironment.h"
class MountainCarState {
public:
MountainCarState()
:loc(-0.5), speed(0)
{}
double loc;
double speed;
};
static bool operator==(const MountainCarState &l1, const MountainCarState &l2) {
return fequal(l1.loc, l2.loc) && fequal(l1.speed, l2.speed);
}
typedef int MountainCarAction;
class MountainCarEnvironment : public SearchEnvironment<MountainCarState, MountainCarAction>
{
public:
MountainCarEnvironment();
virtual void GetSuccessors(const MountainCarState &nodeID, std::vector<MountainCarState> &neighbors) const;
virtual void GetActions(const MountainCarState &nodeID, std::vector<MountainCarAction> &actions) const;
//virtual int GetNumSuccessors(const MountainCarState &stateID) const;
virtual MountainCarAction GetAction(const MountainCarState &s1, const MountainCarState &s2) const;
virtual void ApplyAction(MountainCarState &s, MountainCarAction a) const;
virtual void GetNextState(const MountainCarState &, MountainCarAction , MountainCarState &) const;
virtual bool InvertAction(MountainCarAction &a) const;
/** Heuristic value between two arbitrary nodes. **/
virtual double HCost(const MountainCarState &node1, const MountainCarState &node2);
/** Heuristic value between node and the stored goal. Asserts that the
goal is stored **/
virtual double HCost(const MountainCarState &node)
{ assert(bValidSearchGoal); return HCost(node, searchGoal); }
virtual double GCost(const MountainCarState &node1, const MountainCarState &node2);
virtual double GCost(const MountainCarState &node, const MountainCarAction &act);
virtual bool GoalTest(const MountainCarState &node, const MountainCarState &goal);
/** Goal Test if the goal is stored **/
virtual bool GoalTest(const MountainCarState &node)
{ return bValidSearchGoal&&(node == searchGoal); }
virtual uint64_t GetStateHash(const MountainCarState &node) const;
virtual uint64_t GetActionHash(MountainCarAction act) const;
virtual void OpenGLDraw() const;
virtual void OpenGLDraw(const MountainCarState&) const;
virtual void OpenGLDraw(const MountainCarState&, const MountainCarState&, float) const;
virtual void OpenGLDraw(const MountainCarState&, const MountainCarAction&) const;
private:
double GetHeightAtPosition(double queryPosition) const;
double GetSlope(double queryPosition) const;
double minPosition;
double maxPosition;
double minVelocity;
double maxVelocity;
double goalPosition;
double accelerationFactor;
double gravityFactor;
double hillPeakFrequency;
};
#endif
| 33.536585 | 108 | 0.778182 |
5efc1b368524b9e98a9fbd602f635aa32a30d5b7
| 4,186 |
swift
|
Swift
|
UTUITestLearning/code/UTUITestPlayground.playground/Pages/07_ImproveCodeQuality.xcplaygroundpage/Contents.swift
|
AppStudio2015/MyTest
|
7cddeb0402d3f3d66c12726f217a2a207e4d42b5
|
[
"MIT"
] | 2 |
2020-04-29T05:21:19.000Z
|
2020-06-03T06:24:05.000Z
|
UTUITestLearning/code/UTUITestPlayground.playground/Pages/07_ImproveCodeQuality.xcplaygroundpage/Contents.swift
|
AppStudio2015/MyTest
|
7cddeb0402d3f3d66c12726f217a2a207e4d42b5
|
[
"MIT"
] | null | null | null |
UTUITestLearning/code/UTUITestPlayground.playground/Pages/07_ImproveCodeQuality.xcplaygroundpage/Contents.swift
|
AppStudio2015/MyTest
|
7cddeb0402d3f3d66c12726f217a2a207e4d42b5
|
[
"MIT"
] | 2 |
2020-04-29T05:10:24.000Z
|
2020-04-30T05:05:56.000Z
|
//: [Previous](@previous)
/*:
## 提高代码质量方法
### 编码规约
* 规范团队成员编码行为,制定适合团队、项目的,相对灵活的编码规范
1. Objective-C Style
**OC Code Organization**
Use `#pragma mark -` to categorize methods in functional groupings and protocol/delegate implementations following this general structure.
```objc
#pragma mark - Lifecycle
- (instancetype)init {}
- (void)dealloc {}
- (void)viewDidLoad {}
- (void)viewWillAppear:(BOOL)animated {}
- (void)didReceiveMemoryWarning {}
#pragma mark - Custom Accessors
- (void)setCustomProperty:(id)value {}
- (id)customProperty {}
#pragma mark - IBActions
- (IBAction)submitData:(id)sender {}
#pragma mark - Public
- (void)publicMethod {}
#pragma mark - Private
- (void)privateMethod {}
#pragma mark - Protocol conformance
#pragma mark - UITextFieldDelegate
#pragma mark - UITableViewDataSource
#pragma mark - UITableViewDelegate
#pragma mark - NSCopying
- (id)copyWithZone:(NSZone *)zone {}
#pragma mark - NSObject
- (NSString *)description {}
```
2. Swift Style
**Swift Code Organization**
Use extensions to organize your code into logical blocks of functionality. Each extension should be set off with a `// MARK: -` comment to keep things well-organized.
**Protocol Conformance**
In particular, when adding protocol conformance to a model, prefer adding a separate extension for the protocol methods. This keeps the related methods grouped together with the protocol and can simplify instructions to add a protocol to a class with its associated methods.
**Preferred**:
```swift
class MyViewController: UIViewController {
// class stuff here
}
// MARK: - UITableViewDataSource
extension MyViewController: UITableViewDataSource {
// table view data source methods
}
// MARK: - UIScrollViewDelegate
extension MyViewController: UIScrollViewDelegate {
// scroll view delegate methods
}
```
**Not Preferred**:
```swift
class MyViewController: UIViewController, UITableViewDataSource, UIScrollViewDelegate {
// all methods
}
```
Since the compiler does not allow you to re-declare protocol conformance in a derived class, it is not always required to replicate the extension groups of the base class. This is especially true if the derived class is a terminal class and a small number of methods are being overridden. When to preserve the extension groups is left to the discretion of the author.
For UIKit view controllers, consider grouping lifecycle, custom accessors, and IBAction in separate class extensions.
---
### 自定义模板
* 编写适合团队、项目的,相对灵活的代码段、文件或工程模板库
* XCTemplate

* CodeSnippets

---
### Code Review
---
### 静态检查
* 引入代码静态检查工具
- Lint工具
- 其它(Infer)
---
### 单元及UI测试
---
### 第三方代码质量管理工具
* SonarQube
简介:是一款用于代码质量管理的开源工具,它主要用于管理源代码的质量。当前流行的编程语文基本都支持,Sonar可以通过PMD,CheckStyle,Findbugs等等代码规则检测工具来检测你的代码,帮助你发现代码的漏洞,Bug,异味等信息。

---
### 总结
* 单元或UI测试对于开发者的意义
- 培养良好的编程习惯,TDD。
- 提升程序设计、架构、重构能力。
- 编写可测试的代码(程序)!
- 为了我们下一次更好更好的开发!
---
### 参考
* [Raywenderlich objective-c-style-guide](https://github.com/raywenderlich/objective-c-style-guide)
* [Raywenderlich swift-style-guide](https://github.com/raywenderlich/swift-style-guide)
* [API Design Guidelines](https://swift.org/documentation/api-design-guidelines/)
* [OCLint](http://oclint.org)
* [SwiftLint](https://realm.github.io/SwiftLint)
* [Sonar Qube](https://www.sonarqube.org)
* [SonarQube 的用法](http://www.imooc.com/article/279446?block_id=tuijian_wz)
* [自定义代码段和文件模板](http://www.cocoachina.com/articles/25182)
* [自定义模板文件夹](https://blog.csdn.net/yanhaijunyan/article/details/102922079)
* [Swift的世界,如何写好单元测试?](https://www.jianshu.com/p/bb97c8d9f0cb)
*/
//: [Next](@next)
| 27.539474 | 374 | 0.65743 |
4779c149eed5d0806d2844072a19687c845faf0a
| 1,352 |
html
|
HTML
|
index.html
|
dgeren/Q-A-Entry-Editor
|
2dc075e53dc7def524083ca9e776d516835b7740
|
[
"MIT"
] | null | null | null |
index.html
|
dgeren/Q-A-Entry-Editor
|
2dc075e53dc7def524083ca9e776d516835b7740
|
[
"MIT"
] | null | null | null |
index.html
|
dgeren/Q-A-Entry-Editor
|
2dc075e53dc7def524083ca9e776d516835b7740
|
[
"MIT"
] | null | null | null |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript"src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script type="text/javascript" src="index.js"></script>
<link rel="stylesheet" href="styles.css" />
<title>Markdown Editor</title>
</head>
<body>
<h1>Q&A Editor</h1>
<div class="btnWrapper">
<p id="btnToggle">Switch to Edit Mode</p>
</div>
<div id="html">
<h2>Quiz View</h2>
<h3>Question</h3>
<div class="html" id="questionHtml"></div>
<h3>Answer</h3>
<div class="html" id="answerHtml"></div>
</div>
<div id="markdown">
<h2>Editor View <span id="save">[Save Changes]</span></h2>
<h3>Question</h3>
<textarea id="questionMarkdown"></textarea>
<h3>Answer</h3>
<textarea id="answerMarkdown"></textarea>
<br>
<ul class="lists">
<li>«Paragraph»</li>
<li><code>```Code Block```</code></li>
<li><code>`Inline Code`</code></li>
<li>**<b>Bold</b>**</li>
<li>*<i>Italic</i>*</li>
</ul>
<ul class="lists">
<li>_<u>Underline</u>_</li>
<li>Order list: #o #o</li>
<li>Unorder List: #u #u</li>
<li>List item: •item•</li>
<li>Replace < and > with the character entities (&lt; and &gt;) insde ``` and ```</li>
</ul>
</div>
</body>
</html>
| 27.591837 | 111 | 0.610207 |
181f9df7491fc0b0fb58f57a32bd44127fa048c5
| 650 |
rs
|
Rust
|
src/error.rs
|
vangork/pravega-client-rust
|
b57b2ea6eee3aa49d354e19b5fc457d4ccf72e9f
|
[
"Apache-2.0"
] | 25 |
2020-10-28T06:44:56.000Z
|
2022-02-25T05:35:43.000Z
|
src/error.rs
|
vangork/pravega-client-rust
|
b57b2ea6eee3aa49d354e19b5fc457d4ccf72e9f
|
[
"Apache-2.0"
] | 175 |
2020-10-28T14:46:05.000Z
|
2022-03-22T00:51:05.000Z
|
src/error.rs
|
vangork/pravega-client-rust
|
b57b2ea6eee3aa49d354e19b5fc457d4ccf72e9f
|
[
"Apache-2.0"
] | 12 |
2020-10-28T08:23:22.000Z
|
2022-03-16T13:49:29.000Z
|
//
// Copyright (c) Dell Inc., or its subsidiaries. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
use snafu::Snafu;
#[derive(Debug, Snafu)]
pub enum Error {
#[snafu(display("Conditional check failed: {}", msg))]
ConditionalCheckFailure { msg: String },
#[snafu(display("Internal error: {}", msg))]
InternalFailure { msg: String },
#[snafu(display("Input is invalid: {}", msg))]
InvalidInput { msg: String },
}
| 27.083333 | 69 | 0.656923 |
b48b59ebf97cafb81e047029ae8c5635c2ca67b2
| 206 |
sql
|
SQL
|
modules/core/db/update/postgres/13/130828-addDefaultTemplate.sql
|
SevDan/reports
|
edc53d543b2f6bae65fed481c058deef1b3ada12
|
[
"Apache-2.0"
] | 10 |
2018-07-05T13:35:03.000Z
|
2021-02-08T11:45:33.000Z
|
modules/core/db/update/postgres/13/130828-addDefaultTemplate.sql
|
SevDan/reports
|
edc53d543b2f6bae65fed481c058deef1b3ada12
|
[
"Apache-2.0"
] | 239 |
2018-04-06T08:56:02.000Z
|
2022-01-12T06:50:58.000Z
|
modules/core/db/update/postgres/13/130828-addDefaultTemplate.sql
|
SevDan/reports
|
edc53d543b2f6bae65fed481c058deef1b3ada12
|
[
"Apache-2.0"
] | 6 |
2019-10-03T04:31:46.000Z
|
2022-02-22T15:31:35.000Z
|
alter table REPORT_REPORT add column DEFAULT_TEMPLATE_ID uuid;
alter table REPORT_REPORT add constraint FK_REPORT_REPORT_TO_DEF_TEMPLATE foreign key (DEFAULT_TEMPLATE_ID)
references REPORT_TEMPLATE (ID);
| 34.333333 | 107 | 0.868932 |
418ab1fe6c798c4d1e7385eb2322db337fb51a2f
| 615 |
kt
|
Kotlin
|
src/main/kotlin/dev/jonaz/server/security/jwt/JwtSecretGenerator.kt
|
jonaznas/micronaut-jwt-kotlin-boilerplate
|
629db9c350a699e3b75a6c6f38409a1f7b07698f
|
[
"MIT"
] | null | null | null |
src/main/kotlin/dev/jonaz/server/security/jwt/JwtSecretGenerator.kt
|
jonaznas/micronaut-jwt-kotlin-boilerplate
|
629db9c350a699e3b75a6c6f38409a1f7b07698f
|
[
"MIT"
] | null | null | null |
src/main/kotlin/dev/jonaz/server/security/jwt/JwtSecretGenerator.kt
|
jonaznas/micronaut-jwt-kotlin-boilerplate
|
629db9c350a699e3b75a6c6f38409a1f7b07698f
|
[
"MIT"
] | null | null | null |
package dev.jonaz.server.security.jwt
import dev.jonaz.server.util.tools.GenerateString
import javax.inject.Inject
import javax.inject.Singleton
@Singleton
class JwtSecretGenerator @Inject constructor(
private val generateString: GenerateString
) {
private lateinit var secret: String
fun get(): String {
return if (this::secret.isInitialized) secret
else generateString.random(
isWithLetters = true,
isWithUppercase = true,
isWithNumbers = true,
isWithSpecial = true,
length = 256
)
}
}
| 25.625 | 53 | 0.639024 |
6b2e2d629434ad3550714c3ae2005e4258b9f4c7
| 9,766 |
rs
|
Rust
|
src/tests/iteration.rs
|
soro/rusty-hdrhistogram
|
2b0d261027c2fef898def3f4a358edebd4f55cd0
|
[
"MIT"
] | 1 |
2019-07-05T14:23:00.000Z
|
2019-07-05T14:23:00.000Z
|
src/tests/iteration.rs
|
soro/rusty-hdrhistogram
|
2b0d261027c2fef898def3f4a358edebd4f55cd0
|
[
"MIT"
] | null | null | null |
src/tests/iteration.rs
|
soro/rusty-hdrhistogram
|
2b0d261027c2fef898def3f4a358edebd4f55cd0
|
[
"MIT"
] | null | null | null |
use tests::util::*;
#[test]
fn percentiles() {
let histogram = stat_histo();
for value in histogram.percentiles(5) {
let value_at_pctl = histogram.get_value_at_percentile(value.percentile);
assert_eq!(
value.value_iterated_to,
histogram.highest_equivalent_value(value_at_pctl)
);
}
}
#[test]
fn linear_bucket_values() {
let mut index = 0;
let histogram = stat_histo();
let raw_histogram = raw_stat_histo();
for value in raw_histogram.linear_bucket_values(100000) {
let count_added_in_this_bucket = value.count_added_in_this_iteration_step;
if index == 0 {
assert_eq!(
10000,
count_added_in_this_bucket,
"Raw Linear 100 msec bucket # 0 added a count of 10000"
);
} else if index == 999 {
assert_eq!(
1,
count_added_in_this_bucket,
"Raw Linear 100 msec bucket # 999 added a count of 1"
);
} else {
assert_eq!(
0,
count_added_in_this_bucket,
"Raw Linear 100 msec bucket # {} added a count of 0",
index
);
}
index += 1;
}
assert_eq!(1000, index);
index = 0;
let mut total_added_counts = 0;
for value in histogram.linear_bucket_values(10000) {
let count_added_in_this_bucket = value.count_added_in_this_iteration_step;
if index == 0 {
assert_eq!(
10000,
count_added_in_this_bucket,
"Linear 1 sec bucket # 0 [{}..{}] added a count of 10000",
value.value_iterated_from,
value.value_iterated_to
);
}
total_added_counts += value.count_added_in_this_iteration_step;
index += 1;
}
assert_eq!(
10000,
index,
"There should be 10000 linear buckets of size 10000 usec between 0 and 100 sec."
);
assert_eq!(
20000,
total_added_counts,
"Total added counts should be 20000"
);
index = 0;
total_added_counts = 0;
for value in histogram.linear_bucket_values(1000) {
let count_added_in_this_bucket = value.count_added_in_this_iteration_step;
if index == 1 {
assert_eq!(
10000,
count_added_in_this_bucket,
"Linear 1 sec bucket # 0 [{}..{}] added a count of 10000",
value.value_iterated_from,
value.value_iterated_to
);
}
total_added_counts += value.count_added_in_this_iteration_step;
index += 1;
}
assert_eq!(
100007,
index,
"There should be 100007 linear buckets of size 1000 usec between 0 and 100 sec."
);
assert_eq!(
20000,
total_added_counts,
"Total added counts should be 20000"
);
}
#[test]
fn logarithmic_bucket_values() {
let histogram = stat_histo();
let raw_histogram = raw_stat_histo();
let mut index = 0;
for value in raw_histogram.logarithmic_bucket_values(10000, 2.0) {
let count_added_in_this_bucket = value.count_added_in_this_iteration_step;
if index == 0 {
assert_eq!(
10000,
count_added_in_this_bucket,
"Raw Logarithmic 10 msec bucket # 0 added a count of 10000"
);
} else if index == 14 {
assert_eq!(
1,
count_added_in_this_bucket,
"Raw Logarithmic 10 msec bucket # 14 added a count of 1"
);
} else {
assert_eq!(
0,
count_added_in_this_bucket,
"Raw Logarithmic 100 msec bucket # {} added a count of 0",
index
);
}
index += 1;
}
assert_eq!(14, index - 1);
index = 0;
let mut total_added_counts = 0;
for value in histogram.logarithmic_bucket_values(10000, 2.0) {
let count_added_in_this_bucket = value.count_added_in_this_iteration_step;
if index == 0 {
assert_eq!(
10000,
count_added_in_this_bucket,
"Logarithmic 10 msec bucket # 0 [{}..{}] added a count of 10000",
value.value_iterated_from,
value.value_iterated_to
);
}
total_added_counts += value.count_added_in_this_iteration_step;
index += 1;
}
assert_eq!(
14,
index - 1,
"There should be 14 Logarithmic buckets of size 10000 usec between 0 and 100 sec."
);
assert_eq!(
20000,
total_added_counts,
"Total added counts should be 20000"
);
}
#[test]
fn recorded_values() {
let histogram = stat_histo();
let raw_histogram = raw_stat_histo();
let mut index = 0;
for value in raw_histogram.recorded_values() {
let count_added_in_this_bucket = value.count_added_in_this_iteration_step;
if index == 0 {
assert_eq!(
10000,
count_added_in_this_bucket,
"Raw recorded value bucket # 0 added a count of 10000"
);
} else {
assert_eq!(
1,
count_added_in_this_bucket,
"Raw recorded value bucket # {} added a count of 1",
index
);
}
index += 1;
}
assert_eq!(2, index);
index = 0;
let mut total_added_counts = 0;
for value in histogram.recorded_values() {
let count_added_in_this_bucket = value.count_added_in_this_iteration_step;
if index == 0 {
assert_eq!(
10000,
count_added_in_this_bucket,
"Recorded bucket # 0 [{}..{}] added a count of 10000",
value.value_iterated_from,
value.value_iterated_to
);
}
assert!(
value.count_at_value_iterated_to != 0,
"The count in recorded bucket #{} is not 0",
index
);
assert_eq!(
value.count_at_value_iterated_to,
value.count_added_in_this_iteration_step,
"The count in recorded bucket # {} is exactly the amount added since the last iteration",
index
);
total_added_counts += value.count_added_in_this_iteration_step;
index += 1;
}
assert_eq!(
20000,
total_added_counts,
"Total added counts should be 20000"
);
}
#[test]
fn all_values() {
let histogram = stat_histo();
let raw_histogram = raw_stat_histo();
let mut index = 0;
#[allow(unused_assignments)]
let mut latest_value_at_index = 0;
let mut total_count_to_this_point = 0;
let mut total_value_to_this_point = 0;
for value in raw_histogram.all_values() {
let count_added_in_this_bucket = value.count_added_in_this_iteration_step;
if index == 1000 {
assert_eq!(
10000,
count_added_in_this_bucket,
"Raw allValues bucket # 0 added a count of 10000"
);
} else if histogram.values_are_equivalent(value.value_iterated_to, 100000000) {
assert_eq!(
1,
count_added_in_this_bucket,
"Raw allValues value bucket # {} added a count of 1",
index
);
} else {
assert_eq!(
0,
count_added_in_this_bucket,
"Raw allValues value bucket # {} added a count of 0",
index
);
}
latest_value_at_index = value.value_iterated_to;
total_count_to_this_point += value.count_at_value_iterated_to;
assert_eq!(
total_count_to_this_point,
value.total_count_to_this_value,
"total Count should match"
);
total_value_to_this_point += value.count_at_value_iterated_to * latest_value_at_index;
assert_eq!(
total_value_to_this_point,
value.total_value_to_this_value,
"total Value should match"
);
index += 1;
}
assert_eq!(
histogram.counts_array_length(),
index,
"index should be equal to countsArrayLength"
);
index = 0;
let mut total_added_counts = 0;
for value in histogram.all_values() {
let count_added_in_this_bucket = value.count_added_in_this_iteration_step;
if index == 1000 {
assert_eq!(
10000,
count_added_in_this_bucket,
"AllValues bucket # 0 [{}..{}] added a count of 10000",
value.value_iterated_from,
value.value_iterated_to
);
}
assert_eq!(
value.count_at_value_iterated_to,
value.count_added_in_this_iteration_step,
"The count in AllValues bucket # {} is exactly the amount added since the last iteration",
index
);
total_added_counts += value.count_added_in_this_iteration_step;
assert!(
histogram.values_are_equivalent(histogram.value_from_index(index), value.value_iterated_to),
"valueFromIndex(index) should be equal to getValueIteratedTo()"
);
index += 1;
}
assert_eq!(
histogram.counts_array_length(),
index,
"index should be equal to countsArrayLength"
);
assert_eq!(
20000,
total_added_counts,
"Total added counts should be 20000"
);
}
| 30.235294 | 104 | 0.558366 |
bd6c0a5b09fd86f0e65b4ba92a8ee5b4fdb08ed5
| 73 |
kt
|
Kotlin
|
exercises/practice/complex-numbers/src/main/kotlin/ComplexNumber.kt
|
Tarnic/kotlin
|
cd0b359248c04e8e8dd37369d377ccaec22379e5
|
[
"MIT"
] | 142 |
2017-06-19T13:34:35.000Z
|
2022-03-29T19:57:54.000Z
|
exercises/practice/complex-numbers/src/main/kotlin/ComplexNumber.kt
|
Tarnic/kotlin
|
cd0b359248c04e8e8dd37369d377ccaec22379e5
|
[
"MIT"
] | 273 |
2017-06-19T14:45:28.000Z
|
2022-03-25T13:33:04.000Z
|
exercises/practice/complex-numbers/src/main/kotlin/ComplexNumber.kt
|
Tarnic/kotlin
|
cd0b359248c04e8e8dd37369d377ccaec22379e5
|
[
"MIT"
] | 202 |
2017-06-19T04:00:46.000Z
|
2022-03-29T07:10:24.000Z
|
data class ComplexNumber(val real: Double = 0.0, val imag: Double = 0.0)
| 36.5 | 72 | 0.712329 |
2a207d16143e9ec37dd15b06f94f8a25cacf8b6e
| 239 |
html
|
HTML
|
templates/snippets-account.html
|
JordyPouw/simba
|
bbcb437766a307f921403759591df187630c1d34
|
[
"MIT"
] | 2 |
2015-01-19T20:26:27.000Z
|
2015-04-21T19:56:54.000Z
|
templates/snippets-account.html
|
JordyPouw/simba
|
bbcb437766a307f921403759591df187630c1d34
|
[
"MIT"
] | null | null | null |
templates/snippets-account.html
|
JordyPouw/simba
|
bbcb437766a307f921403759591df187630c1d34
|
[
"MIT"
] | null | null | null |
<section class="account">
<a href="{{ 'account' | url }}">
{% if page.account %}
{{ 'Welcome, $1!' | t(page.account.firstname) | raw }}
{% else %}
{{ 'My account' | t }}
{% endif %}
</a>
</section>
| 26.555556 | 74 | 0.443515 |
7525e38c434d64fa690c454922d99df75d75c983
| 5,251 |
h
|
C
|
linux-3.0.1/include/linux/memblock.h
|
tonghua209/samsun6410_linux_3_0_0_1_for_aws
|
31aa0dc27c4aab51a92309a74fd84ca65e8c6a58
|
[
"Apache-2.0"
] | 4 |
2016-07-01T04:50:02.000Z
|
2021-11-14T21:29:42.000Z
|
linux-3.0/include/linux/memblock.h
|
spartan263/vizio_oss
|
74270002d874391148119b48882db6816e7deedc
|
[
"Linux-OpenIB"
] | null | null | null |
linux-3.0/include/linux/memblock.h
|
spartan263/vizio_oss
|
74270002d874391148119b48882db6816e7deedc
|
[
"Linux-OpenIB"
] | 1 |
2020-04-03T14:00:39.000Z
|
2020-04-03T14:00:39.000Z
|
#ifndef _LINUX_MEMBLOCK_H
#define _LINUX_MEMBLOCK_H
#ifdef __KERNEL__
#define MEMBLOCK_ERROR 0
#ifdef CONFIG_HAVE_MEMBLOCK
/*
* Logical memory blocks.
*
* Copyright (C) 2001 Peter Bergner, IBM Corp.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/init.h>
#include <linux/mm.h>
#include <asm/memblock.h>
#define INIT_MEMBLOCK_REGIONS 128
struct memblock_region {
phys_addr_t base;
phys_addr_t size;
};
struct memblock_type {
unsigned long cnt; /* number of regions */
unsigned long max; /* size of the allocated array */
struct memblock_region *regions;
};
struct memblock {
phys_addr_t current_limit;
phys_addr_t memory_size; /* Updated by memblock_analyze() */
struct memblock_type memory;
struct memblock_type reserved;
};
extern struct memblock memblock;
extern int memblock_debug;
extern int memblock_can_resize;
#define memblock_dbg(fmt, ...) \
if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
u64 memblock_find_in_range(u64 start, u64 end, u64 size, u64 align);
int memblock_free_reserved_regions(void);
int memblock_reserve_reserved_regions(void);
extern void memblock_init(void);
extern void memblock_analyze(void);
extern long memblock_add(phys_addr_t base, phys_addr_t size);
extern long memblock_remove(phys_addr_t base, phys_addr_t size);
extern long memblock_free(phys_addr_t base, phys_addr_t size);
extern long memblock_reserve(phys_addr_t base, phys_addr_t size);
/* The numa aware allocator is only available if
* CONFIG_ARCH_POPULATES_NODE_MAP is set
*/
extern phys_addr_t memblock_alloc_nid(phys_addr_t size, phys_addr_t align,
int nid);
extern phys_addr_t memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align,
int nid);
extern phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align);
/* Flags for memblock_alloc_base() amd __memblock_alloc_base() */
#define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0)
#define MEMBLOCK_ALLOC_ACCESSIBLE 0
extern phys_addr_t memblock_alloc_base(phys_addr_t size,
phys_addr_t align,
phys_addr_t max_addr);
extern phys_addr_t __memblock_alloc_base(phys_addr_t size,
phys_addr_t align,
phys_addr_t max_addr);
extern phys_addr_t memblock_phys_mem_size(void);
extern phys_addr_t memblock_end_of_DRAM(void);
extern void memblock_enforce_memory_limit(phys_addr_t memory_limit);
extern int memblock_is_memory(phys_addr_t addr);
extern int memblock_is_region_memory(phys_addr_t base, phys_addr_t size);
extern int memblock_is_reserved(phys_addr_t addr);
extern int memblock_is_region_reserved(phys_addr_t base, phys_addr_t size);
extern void memblock_dump_all(void);
/* Provided by the architecture */
extern phys_addr_t memblock_nid_range(phys_addr_t start, phys_addr_t end, int *nid);
extern int memblock_memory_can_coalesce(phys_addr_t addr1, phys_addr_t size1,
phys_addr_t addr2, phys_addr_t size2);
/**
* memblock_set_current_limit - Set the current allocation limit to allow
* limiting allocations to what is currently
* accessible during boot
* @limit: New limit value (physical address)
*/
extern void memblock_set_current_limit(phys_addr_t limit);
/*
* pfn conversion functions
*
* While the memory MEMBLOCKs should always be page aligned, the reserved
* MEMBLOCKs may not be. This accessor attempt to provide a very clear
* idea of what they return for such non aligned MEMBLOCKs.
*/
/**
* memblock_region_memory_base_pfn - Return the lowest pfn intersecting with the memory region
* @reg: memblock_region structure
*/
static inline unsigned long memblock_region_memory_base_pfn(const struct memblock_region *reg)
{
return PFN_UP(reg->base);
}
/**
* memblock_region_memory_end_pfn - Return the end_pfn this region
* @reg: memblock_region structure
*/
static inline unsigned long memblock_region_memory_end_pfn(const struct memblock_region *reg)
{
return PFN_DOWN(reg->base + reg->size);
}
/**
* memblock_region_reserved_base_pfn - Return the lowest pfn intersecting with the reserved region
* @reg: memblock_region structure
*/
static inline unsigned long memblock_region_reserved_base_pfn(const struct memblock_region *reg)
{
return PFN_DOWN(reg->base);
}
/**
* memblock_region_reserved_end_pfn - Return the end_pfn this region
* @reg: memblock_region structure
*/
static inline unsigned long memblock_region_reserved_end_pfn(const struct memblock_region *reg)
{
return PFN_UP(reg->base + reg->size);
}
#define for_each_memblock(memblock_type, region) \
for (region = memblock.memblock_type.regions; \
region < (memblock.memblock_type.regions + memblock.memblock_type.cnt); \
region++)
#ifdef ARCH_DISCARD_MEMBLOCK
#define __init_memblock __init
#define __initdata_memblock __initdata
#else
#define __init_memblock
#define __initdata_memblock
#endif
#else
static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align)
{
return MEMBLOCK_ERROR;
}
#endif /* CONFIG_HAVE_MEMBLOCK */
#endif /* __KERNEL__ */
#endif /* _LINUX_MEMBLOCK_H */
| 30.005714 | 98 | 0.781375 |
22a7c2ca49095161480044744f619281d043eec3
| 32 |
html
|
HTML
|
openresty/pages/site2.html
|
s-mokrushin/openresty-auth-middleware
|
2f5000e1360c8bae0d38edf86faad4e83e4720cb
|
[
"MIT"
] | 2 |
2021-07-22T08:53:33.000Z
|
2021-12-22T01:46:38.000Z
|
openresty/pages/site2.html
|
s-mokrushin/openresty-auth-middleware
|
2f5000e1360c8bae0d38edf86faad4e83e4720cb
|
[
"MIT"
] | null | null | null |
openresty/pages/site2.html
|
s-mokrushin/openresty-auth-middleware
|
2f5000e1360c8bae0d38edf86faad4e83e4720cb
|
[
"MIT"
] | null | null | null |
<h1>Site 2</h1>
<p>Welcome!</p>
| 10.666667 | 15 | 0.5625 |
5738710a7965d97b671eb76396d0cf5c6ad41fc8
| 7,173 |
c
|
C
|
examples/MSP430F5xx_6xx/adc10_a/adc10_a_ex8_sequenceDMA.c
|
phelpsw/msp430-driverlib
|
5b818a00ba1771c4e56a7642916cb19fd3a6ebe4
|
[
"BSD-3-Clause"
] | 3 |
2020-12-09T20:05:24.000Z
|
2021-12-10T07:27:19.000Z
|
examples/MSP430F5xx_6xx/adc10_a/adc10_a_ex8_sequenceDMA.c
|
phelpsw/msp430-driverlib
|
5b818a00ba1771c4e56a7642916cb19fd3a6ebe4
|
[
"BSD-3-Clause"
] | 1 |
2020-12-19T18:49:01.000Z
|
2020-12-19T18:49:01.000Z
|
examples/MSP430F5xx_6xx/adc10_a/adc10_a_ex8_sequenceDMA.c
|
phelpsw/msp430-driverlib
|
5b818a00ba1771c4e56a7642916cb19fd3a6ebe4
|
[
"BSD-3-Clause"
] | null | null | null |
/* --COPYRIGHT--,BSD
* Copyright (c) 2017, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* --/COPYRIGHT--*/
#include "driverlib.h"
//******************************************************************************
//!
//! ADC10_A - Sample A2-0 Inputs directly to DMA, 8-Bit Res, Single Seq.
//!
//! MSP430F550x Demo
//! Sample A2/A1/A0 as single sequence with reference to AVcc. Software sets
//! ADC10SC to trigger sample sequence. In Mainloop MSP430 waits in LPM0 to
//! save power until ADC10_A conversion complete, DMA_ISR will force exit from
//! any LPMx. ADC10_A internal oscillator times sample period (16x) and
//! conversion (13x). DMA transfers conv results ADC_Result variable.
//! Notice that the conversions go in the order of A2, A1, then A0.
//1
//! MSP430F550x
//! -----------------
//! /|\| XIN|-
//! | | |
//! --|RST XOUT|-
//! | P6.2/A2|<- Sample Signal 1
//! | P6.1/A1|<- Sample Signal 2
//! | P6.0/A0|<- Sample Signal 3
//! | |
//!
//!
//! This example uses the following peripherals and I/O signals. You must
//! review these and change as needed for your own board:
//! - ADC10_A peripheral
//! - DMA peripheral
//! - GPIO Port peripheral
//! - A2
//! - A1
//! - A0
//!
//! This example uses the following interrupt handlers. To use this example
//! in your own application you must add these interrupt handlers to your
//! vector table.
//! - DMA_VECTOR
//!
//******************************************************************************
void main (void)
{
//8-bit ADC conversion result array
uint8_t ADC_Result[3];
//Stop Watchdog Timer
WDT_A_hold(WDT_A_BASE);
//Initialize the ADC10_A Module
/*
* Base Address for the ADC10_A Module
* Use internal ADC10_A bit as sample/hold signal to start conversion
* USE MODOSC 5MHZ Digital Oscillator as clock source
* Use default clock divider of 1
*/
ADC10_A_init(ADC10_A_BASE,
ADC10_A_SAMPLEHOLDSOURCE_SC,
ADC10_A_CLOCKSOURCE_ADC10OSC,
ADC10_A_CLOCKDIVIDER_1);
ADC10_A_enable(ADC10_A_BASE);
/*
* Base Address for the ADC10_A Module
* Sample/hold for 16 clock cycles
* Enable Multiple Sampling
*/
ADC10_A_setupSamplingTimer(ADC10_A_BASE,
ADC10_A_CYCLEHOLD_16_CYCLES,
ADC10_A_MULTIPLESAMPLESENABLE);
//Change the resolution to 8-bit
ADC10_A_setResolution(ADC10_A_BASE,
ADC10_A_RESOLUTION_8BIT);
//Configure Memory Buffer
/*
* Base Address for the ADC10_A Module
* Use input A2
* Use positive reference of AVcc
* Use negative reference of AVss
*/
ADC10_A_configureMemory(ADC10_A_BASE,
ADC10_A_INPUT_A2,
ADC10_A_VREFPOS_AVCC,
ADC10_A_VREFNEG_AVSS);
//Initialize and Setup DMA Channel 0
/*
* Configure DMA channel 0
* Configure channel for repeated single transfer
* DMA interrupt flag will be set after every 3 transfers
* Use DMA Trigger Source 24 (ADC10IFG)
* Transfer Byte-to-byte
* Trigger upon the Rising Edge of the Trigger Source
*/
DMA_initParam param = {0};
param.channelSelect = DMA_CHANNEL_0;
param.transferModeSelect = DMA_TRANSFER_REPEATED_SINGLE;
param.transferSize = 3;
param.triggerSourceSelect = DMA_TRIGGERSOURCE_24;
param.transferUnitSelect = DMA_SIZE_SRCBYTE_DSTBYTE;
param.triggerTypeSelect = DMA_TRIGGER_RISINGEDGE;
DMA_init(¶m);
/*
* Configure DMA channel 0
* Use ADC10_A Memory Buffer as source
* Increment destination address after every transfer
*/
DMA_setSrcAddress(DMA_CHANNEL_0,
ADC10_A_getMemoryAddressForDMA(ADC10_A_BASE),
DMA_DIRECTION_UNCHANGED);
/*
* Base Address of the DMA Module
* Configure DMA channel 0
* Use ADC_Result[0] as destination
* Increment destination address after every transfer
*/
DMA_setDstAddress(DMA_CHANNEL_0,
(uint32_t)(uintptr_t)&ADC_Result[0],
DMA_DIRECTION_INCREMENT);
//Enable DMA channel 0 interrupt
DMA_clearInterrupt(DMA_CHANNEL_0);
DMA_enableInterrupt(DMA_CHANNEL_0);
//Enable transfers on DMA channel 0
DMA_enableTransfers(DMA_CHANNEL_0);
while (1)
{
//Wait if ADC10_A core is active
while (ADC10_A_isBusy(ADC10_A_BASE)) ;
//Enable and Start the conversion
//in Sequence of Channels Conversion Mode
ADC10_A_startConversion(ADC10_A_BASE,
ADC10_A_SEQOFCHANNELS);
//LPM0, ADC10_A_ISR will force exit
__bis_SR_register(CPUOFF + GIE);
//Delay between sequence convs
__delay_cycles(5000);
//BREAKPOINT; check ADC_Result
__no_operation();
}
}
// DMA interrupt service routine
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
__interrupt
#elif defined(__GNUC__)
__attribute__((interrupt(DMA_VECTOR)))
#endif
void DMA0_ISR (void) {
switch (__even_in_range(DMAIV,16)){
case 0: break; //No interrupt
case 2: //DMA0IFG
//Sequence of Channels Conversion Complete
//exit LPM
__bic_SR_register_on_exit(CPUOFF);
break;
case 4: break; //DMA1IFG
case 6: break; //DMA2IFG
default: break;
}
}
| 35.334975 | 81 | 0.641433 |
85b7261360a516c1aaca59c4e98bd5912c933880
| 2,620 |
h
|
C
|
cyclone_tcp/netbios/nbns_client.h
|
Velleman/VM204-Firmware
|
f6836dff40ec70fc2de66a3b2c6f03fa4c36c223
|
[
"MIT"
] | 4 |
2016-04-17T00:48:37.000Z
|
2020-03-17T01:42:20.000Z
|
cyclone_tcp/netbios/nbns_client.h
|
Velleman/VM204-Firmware
|
f6836dff40ec70fc2de66a3b2c6f03fa4c36c223
|
[
"MIT"
] | null | null | null |
cyclone_tcp/netbios/nbns_client.h
|
Velleman/VM204-Firmware
|
f6836dff40ec70fc2de66a3b2c6f03fa4c36c223
|
[
"MIT"
] | 6 |
2016-04-17T00:48:41.000Z
|
2022-01-28T13:50:45.000Z
|
/**
* @file nbns_client.h
* @brief NBNS client (NetBIOS Name Service)
*
* @section License
*
* Copyright (C) 2010-2015 Oryx Embedded SARL. All rights reserved.
*
* This file is part of CycloneTCP Open.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @author Oryx Embedded SARL (www.oryx-embedded.com)
* @version 1.6.0
**/
#ifndef _NBNS_CLIENT_H
#define _NBNS_CLIENT_H
//Dependencies
#include "core/net.h"
#include "core/socket.h"
#include "core/udp.h"
#include "dns/dns_cache.h"
#include "dns/dns_common.h"
#include "netbios/nbns_common.h"
//NBNS client support
#ifndef NBNS_CLIENT_SUPPORT
#define NBNS_CLIENT_SUPPORT ENABLED
#elif (NBNS_CLIENT_SUPPORT != ENABLED && NBNS_CLIENT_SUPPORT != DISABLED)
#error NBNS_CLIENT_SUPPORT parameter is not valid
#endif
//Maximum number of retransmissions of NBNS queries
#ifndef NBNS_CLIENT_MAX_RETRIES
#define NBNS_CLIENT_MAX_RETRIES 3
#elif (NBNS_CLIENT_MAX_RETRIES < 1)
#error NBNS_CLIENT_MAX_RETRIES parameter is not valid
#endif
//Initial retransmission timeout
#ifndef NBNS_CLIENT_INIT_TIMEOUT
#define NBNS_CLIENT_INIT_TIMEOUT 1000
#elif (NBNS_CLIENT_INIT_TIMEOUT < 1000)
#error NBNS_CLIENT_INIT_TIMEOUT parameter is not valid
#endif
//Maximum retransmission timeout
#ifndef NBNS_CLIENT_MAX_TIMEOUT
#define NBNS_CLIENT_MAX_TIMEOUT 1000
#elif (NBNS_CLIENT_MAX_TIMEOUT < 1000)
#error NBNS_CLIENT_MAX_TIMEOUT parameter is not valid
#endif
//Maximum cache lifetime for NBNS entries
#ifndef NBNS_MAX_LIFETIME
#define NBNS_MAX_LIFETIME 60000
#elif (NBNS_MAX_LIFETIME < 1000)
#error NBNS_MAX_LIFETIME parameter is not valid
#endif
//NBNS related functions
error_t nbnsResolve(NetInterface *interface, const char_t *name, IpAddr *ipAddr);
error_t nbnsSendQuery(DnsCacheEntry *entry);
void nbnsProcessResponse(NetInterface *interface, const Ipv4PseudoHeader *pseudoHeader,
const UdpHeader *udpHeader, const NbnsHeader *message, size_t length);
#endif
| 31.190476 | 87 | 0.776336 |
84bebefc0b6f69a7e97cce48b9fa3ac583845e8c
| 1,878 |
h
|
C
|
Test/Fandango/include/obex_body.h
|
mfaithfull/QOR
|
0fa51789344da482e8c2726309265d56e7271971
|
[
"BSL-1.0"
] | 9 |
2016-05-27T01:00:39.000Z
|
2021-04-01T08:54:46.000Z
|
Test/Fandango/include/obex_body.h
|
mfaithfull/QOR
|
0fa51789344da482e8c2726309265d56e7271971
|
[
"BSL-1.0"
] | 1 |
2016-03-03T22:54:08.000Z
|
2016-03-03T22:54:08.000Z
|
Test/Fandango/include/obex_body.h
|
mfaithfull/QOR
|
0fa51789344da482e8c2726309265d56e7271971
|
[
"BSL-1.0"
] | 4 |
2016-05-27T01:00:43.000Z
|
2018-08-19T08:47:49.000Z
|
/**
* @file obex_body.h
*
* OBEX body reception releated functions.
* OpenOBEX library - Free implementation of the Object Exchange protocol.
*
* Copyright (c) 2012 Hendrik Sattler, All Rights Reserved.
*
* OpenOBEX is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with OpenOBEX. If not, see <http://www.gnu.org/>.
*/
#ifndef OBEX_BODY_H
#define OBEX_BODY_H
#include <stdlib.h>
#include "defines.h"
class obex;
class CObexHeader;
class CObexObject;
typedef obex obex_t;
//------------------------------------------------------------------------------
class IObexBody
{
public:
virtual int rcv(void* data, CObexHeader* hdr) = 0;
virtual const void* read ( void* data, size_t* size) = 0;
void* data;
};
//------------------------------------------------------------------------------
class CObexBodyStream : public IObexBody
{
public:
CObexBodyStream( obex_t* obex);
virtual int rcv(void* data, CObexHeader* hdr);
virtual const void* read(void* data, size_t* size);
//obex_t* data;
};
//------------------------------------------------------------------------------
class CObexBodyBuffered : public IObexBody
{
public:
CObexBodyBuffered(CObexObject* object);
virtual int rcv(void* data, CObexHeader* hdr);
virtual const void* read(void* data, size_t* size);
//CObexObject* data;
};
#endif /* OBEX_BODY_H */
| 26.828571 | 80 | 0.637913 |
e56ea32fdea24ced804f9e0b93cf6a3b756d3d4f
| 698 |
swift
|
Swift
|
ElevenNote/NoteDetailViewController.swift
|
Athitha/note-app-ios
|
771e8bf4a8f7554520f91e9bbb76e73ccf29c9a1
|
[
"MIT"
] | null | null | null |
ElevenNote/NoteDetailViewController.swift
|
Athitha/note-app-ios
|
771e8bf4a8f7554520f91e9bbb76e73ccf29c9a1
|
[
"MIT"
] | null | null | null |
ElevenNote/NoteDetailViewController.swift
|
Athitha/note-app-ios
|
771e8bf4a8f7554520f91e9bbb76e73ccf29c9a1
|
[
"MIT"
] | null | null | null |
import UIKit
class NoteDetailViewController: UIViewController {
var theNote = Note()
@IBOutlet weak var noteTitleLabel: UITextField!
@IBOutlet weak var noteTextView: UITextView!
override func viewDidLoad() {
super.viewDidLoad()
self.noteTitleLabel.text = theNote.noteTitle
self.noteTextView.text = theNote.noteText
self.noteTextView.becomeFirstResponder()
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
theNote.noteTitle = self.noteTitleLabel.text
theNote.noteText = self.noteTextView.text
}
}
| 21.8125 | 81 | 0.618911 |
abb7ecb34cea94ce1cec160c554422b0d6521ec0
| 2,325 |
lua
|
Lua
|
viewer/view_lap.lua
|
pixeljetstream/r3e-trace-analysis
|
0748715bd0d1f5b630a8f7e556e4547576ba118e
|
[
"MIT"
] | 10 |
2015-10-22T06:12:22.000Z
|
2021-12-20T21:22:07.000Z
|
viewer/view_lap.lua
|
pixeljetstream/r3e-trace-analysis
|
0748715bd0d1f5b630a8f7e556e4547576ba118e
|
[
"MIT"
] | null | null | null |
viewer/view_lap.lua
|
pixeljetstream/r3e-trace-analysis
|
0748715bd0d1f5b630a8f7e556e4547576ba118e
|
[
"MIT"
] | null | null | null |
local wx = require "wx"
local ffi = require "ffi"
local gl = require "glewgl"
local glu = require "glutils"
local utils = require "utils"
local r3e = require "r3e"
local r3etrace = require "r3etrace"
local math3d = require "math3d"
local v3,v4,m4 = math3d.namespaces.v3,math3d.namespaces.v4,math3d.namespaces.m4
local config = gCONFIG
local r3emap = gR3EMAP
local helpers = gHELPERS
local sys = gSYS
local toMS = helpers.toMS
---------------------------------------------
local function initLapView(frame, ID_LAP)
local control = wx.wxListCtrl(frame, ID_LAP,
wx.wxDefaultPosition, wx.wxSize(110, 300),
wx.wxLC_REPORT + wx.wxLC_SINGLE_SEL)
local function lapString( trace, i, sel )
local str = trace.lapData[i].valid and tostring(i) or "("..tostring(i)..")"
return sel and ""..str.." ||" or str
end
local content = {}
local lktrace = {}
local lastTrace
local lastLap
local lastIdx
local function lap(trace, lap)
local idx = lktrace[trace] + lap - 1
if (lastLap) then
control:SetItem(lastIdx, 0, lapString(lastTrace,lastLap,false))
end
control:SetItem(idx, 0, lapString(trace,lap,true))
lastTrace = trace
lastLap = lap
lastIdx = idx
end
local function append(trace)
local offset = #content
lktrace[trace] = offset
for i,v in ipairs(trace.lapData) do
local idx = offset + i - 1
control:InsertItem(idx, lapString(trace, i))
control:SetItem(idx, 1, toMS(v.time))
control:SetItem(idx, 2, helpers.getTraceShortName(trace))
content[idx] = {trace, i}
end
end
local function open(trace)
lastLap = nil
content = {}
lktrace = {}
control:ClearAll()
control:InsertColumn(0, "Lap")
control:InsertColumn(1, "Time")
control:InsertColumn(2, "File")
control:SetColumnWidth(0,36)
control:SetColumnWidth(1,60)
control:SetColumnWidth(2,200)
append(trace)
end
function control.getFromIdx(idx)
local trace, lap = content[idx][1],content[idx][2]
return trace,lap
end
sys.registerHandler(sys.events.lap, lap)
sys.registerHandler(sys.events.open, open)
sys.registerHandler(sys.events.append, append)
return control
end
return initLapView
| 24.734043 | 79 | 0.63828 |
f0304c18f64a7cd7e5d48811fe847867a8e8139c
| 1,400 |
js
|
JavaScript
|
src/actions/types.js
|
RagtagOpen/freefrom-compensation-web
|
27eed0cac762df1ebf5360cd552a53c249c60f47
|
[
"MIT"
] | 2 |
2019-07-18T16:38:40.000Z
|
2020-01-16T15:15:00.000Z
|
src/actions/types.js
|
RagtagOpen/freefrom-compensation-web
|
27eed0cac762df1ebf5360cd552a53c249c60f47
|
[
"MIT"
] | 74 |
2019-07-11T15:25:00.000Z
|
2021-04-06T15:24:30.000Z
|
src/actions/types.js
|
RagtagOpen/freefrom-compensation-web
|
27eed0cac762df1ebf5360cd552a53c249c60f47
|
[
"MIT"
] | 3 |
2019-11-20T10:17:00.000Z
|
2020-10-25T12:49:05.000Z
|
// Alerts
export const SET_ALERT = "SET_ALERT"
export const REMOVE_ALERT = "REMOVE_ALERT"
// Auth
export const REGISTER_SUCCESS = "REGISTER_SUCCESS"
export const REGISTER_FAIL = "REGISTER_FAIL"
export const USER_LOADED = "USER_LOADED"
export const AUTH_ERROR = "AUTH_ERROR"
export const LOGIN_SUCCESS = "LOGIN_SUCCESS"
export const LOGIN_FAIL = "LOGIN_FAIL"
export const LOGOUT = "LOGOUT"
// Users
export const USER_ERROR = "USER_ERROR"
export const GET_USER = "GET_USER"
// Quiz
export const SET_AGREEMENT = "SET_AGREEMENT"
export const SET_COOKIES = "SET_COOKIES"
export const SET_LOCATION = "SET_LOCATION"
export const SET_QUESTION = "SET_QUESTION"
export const GET_QUESTION_DATA = "GET_QUESTION_DATA"
export const SET_QUIZ_TALLY = "SET_QUIZ_TALLY"
export const SET_MINDSET = "SET_MINDSET"
export const SET_COMPLETED = "SET_COMPLETED"
export const RESET_QUIZ = "RESET_QUIZ"
// Mindset
export const LOAD_MINDSET_SUCCESS = "LOAD_MINDSET_SUCCESS"
export const LOAD_MINDSET_ERROR = "LOAD_MINDSET_ERROR"
export const LOAD_MINDSETS_SUCCESS = "LOAD_MINDSETS_SUCCESS"
export const LOAD_MINDSETS_ERROR = "LOAD_MINDSETS_ERROR"
// Resources
export const FETCH_FEATURE_RESOURCE = "FETCH_FEATURE_RESOURCE"
export const FETCH_RESOURCE_CATEGORIES = "FETCH_RESOURCE_CATEGORIES"
export const FETCH_RESOURCE_FOR_STATE = "FETCH_RESOURCE_FOR_STATE"
export const RESET_FEATURE_RESOURCE = "RESET_FEATURE_RESOURCE"
| 35 | 68 | 0.819286 |
b301ac290413f79b84a1f609e13040093bd78378
| 2,032 |
rb
|
Ruby
|
lib/rational_nested_set/set_validator.rb
|
sximba/rational_nested_set
|
816dffd68e1e03a8a1378f553a36f283092dfd84
|
[
"MIT"
] | null | null | null |
lib/rational_nested_set/set_validator.rb
|
sximba/rational_nested_set
|
816dffd68e1e03a8a1378f553a36f283092dfd84
|
[
"MIT"
] | null | null | null |
lib/rational_nested_set/set_validator.rb
|
sximba/rational_nested_set
|
816dffd68e1e03a8a1378f553a36f283092dfd84
|
[
"MIT"
] | null | null | null |
module CollectiveIdea #:nodoc:
module Acts #:nodoc:
module NestedSet #:nodoc:
class SetValidator
def initialize(model)
@model = model
@scope = model.all
@parent = arel_table.alias('parent')
end
def valid?
query.count == 0
end
private
attr_reader :model, :parent
attr_accessor :scope
delegate :parent_column_name, :primary_column_name, :primary_key, :numv_column_name, :denv_column_name, :snumv_column_name, :sdenv_column_name, :depth_column_name, :total_order_column_name, :is_leaf_column_name, :arel_table,
:quoted_table_name, :quoted_parent_column_full_name, :quoted_numv_column_full_name, :quoted_denv_column_full_name, :quoted_snumv_column_full_name, :quoted_sdenv_column_full_name, :quoted_total_order_column_full_name, :quoted_is_leaf_column_full_name, :quoted_primary_column_name,
:to => :model
def query
join_scope
filter_scope
end
def join_scope
join_arel = arel_table.join(parent, Arel::Nodes::OuterJoin).on(parent[primary_column_name].eq(arel_table[parent_column_name]))
self.scope = scope.joins(join_arel.join_sources)
end
def filter_scope
self.scope = scope.where(
bound_is_null(total_order_column_name).
or(left_bound_greater_than_right).
or(parent_not_null.and(bounds_outside_parent))
)
end
def bound_is_null(column_name)
arel_table[column_name].eq(nil)
end
def parent_not_null
arel_table[parent_column_name].not_eq(nil)
end
def bounds_outside_parent
arel_table[total_order_column_name].lteq(parent[total_order_column_name]).or(arel_table[total_order_column_name].gteq(parent[snumv_column_name]/parent[sdenv_column_name]))
end
end
end
end
end
| 34.440678 | 289 | 0.644685 |
0bccf7eac43e35872dc4377aa49b77edd563ae3a
| 3,136 |
js
|
JavaScript
|
app/assets/javascripts/wysiwyg.js
|
ptolts/dishgo_backend_and_frontend
|
f8bd9ebadf9e2d6c93933d4b0142e29996fca8d6
|
[
"MIT"
] | null | null | null |
app/assets/javascripts/wysiwyg.js
|
ptolts/dishgo_backend_and_frontend
|
f8bd9ebadf9e2d6c93933d4b0142e29996fca8d6
|
[
"MIT"
] | null | null | null |
app/assets/javascripts/wysiwyg.js
|
ptolts/dishgo_backend_and_frontend
|
f8bd9ebadf9e2d6c93933d4b0142e29996fca8d6
|
[
"MIT"
] | null | null | null |
/*
*= require bootstrap_wysiwyg.js
*= require colorpicker.js
*/
(function( $, ko ) {
ko.bindingHandlers['wysiwyg'] = {
init: function (element, valueAccessor, allBindingsAccessor) {
console.log("DEBUG: wysiwyg firing on: " + element);
var underlyingObservable = valueAccessor();
var interceptor = ko.computed({
read: function () {
return underlyingObservable.peek()[viewmodel.lang()];
},
write: function (newValue) {
var current = underlyingObservable.peek();
current[viewmodel.lang()] = newValue;
underlyingObservable.peek(current);
},
});
var editor = $(element).summernote({
onImageUpload: function(files, editor, $editable) {
$(element).fileupload({
url: "/app/website/upload_website_image",
dataType: 'json',
formData: {},
progressInterval: 50,
add: function(e,data){
data.img_element = $editable;
data.img_editor = editor;
data.submit();
},
submit: function(e, data){
console.log(data);
},
send: function (e, data) {
},
done: function (e, data) {
var file = data.result.files[0];
data.img_editor.insertImage(data.img_element, file.url);
},
progress: function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
console.log(progress);
},
fail: function (e, data) {
alert("There was an issue uploading your image.");
},
});
},
onkeyup: function (cm) {
interceptor($(element).code());
},
toolbar: [
['style', ['style']], // no style button
['style', ['bold', 'italic', 'underline', 'clear']],
// ['fontsize', ['fontsize']],
['color', ['color']],
['para', ['paragraph']],
['view', ['codeview']],
// ['height', ['height']],
//['insert', ['picture', 'link']], // no insert buttons
//['table', ['table']], // no table button
//['help', ['help']] //no help button
],
});
$(element).code(interceptor());
},
update: function (element, valueAccessor, allBindingsAccessor) {
console.log("DEBUG: wysiwyg firing on: " + element);
var underlyingObservable = valueAccessor();
var interceptor = ko.computed({
read: function () {
return underlyingObservable()[viewmodel.lang()];
},
write: function (newValue) {
var current = underlyingObservable();
current[viewmodel.lang()] = newValue;
underlyingObservable(current);
},
});
$(element).code(interceptor());
}
};
})( jQuery, ko );
| 33.010526 | 102 | 0.474809 |
7082d5dbd60c059b9f5c17754f328e8303770bf8
| 4,238 |
go
|
Go
|
e2e.go
|
bitrise-steplib/steps-check
|
f23fc5ecfaacf1ad9344662001d4d83f50c9fa84
|
[
"MIT"
] | null | null | null |
e2e.go
|
bitrise-steplib/steps-check
|
f23fc5ecfaacf1ad9344662001d4d83f50c9fa84
|
[
"MIT"
] | null | null | null |
e2e.go
|
bitrise-steplib/steps-check
|
f23fc5ecfaacf1ad9344662001d4d83f50c9fa84
|
[
"MIT"
] | null | null | null |
package main
import (
"fmt"
"github.com/bitrise-io/go-utils/command"
"github.com/bitrise-io/go-utils/errorutil"
"github.com/bitrise-io/go-utils/log"
"github.com/bitrise-io/go-utils/pathutil"
"github.com/segmentio/analytics-go"
"gopkg.in/yaml.v2"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"
)
const unifiedCiAppID = "48fa8fbee698622c"
const (
defaultBitriseSecretsName = ".bitrise.secrets.yml"
)
type partialBitriseModel struct {
Workflows yaml.MapSlice `json:"workflows,omitempty" yaml:"workflows,omitempty"`
}
func runE2E(commandFactory command.Factory, workDir string, segmentKey string, parentURL string) error {
e2eBitriseYMLPath := filepath.Join(workDir, "e2e", "bitrise.yml")
if exists, err := pathutil.IsPathExists(e2eBitriseYMLPath); err != nil {
return err
} else if !exists {
return fmt.Errorf("looking for bitrise.yml in e2e directory, path (%s) does not exists", e2eBitriseYMLPath)
}
log.Infof("Using bitrise.yml from: %s", e2eBitriseYMLPath)
secrets, err := lookupSecrets(workDir)
if err != nil {
return err
}
if secrets == "" {
log.Errorf("No %s found", defaultBitriseSecretsName)
} else {
log.Infof("Using secrets from: %s", secrets)
}
workflows, err := readE2EWorkflows(e2eBitriseYMLPath)
if err != nil {
return err
}
shouldSendAnalytics := parentURL != "" && segmentKey != ""
var client analytics.Client
if shouldSendAnalytics {
client = analytics.New(segmentKey)
defer client.Close()
}
for _, workflow := range workflows {
start := time.Now()
err = runE2EWorkflow(commandFactory, workDir, e2eBitriseYMLPath, secrets, workflow)
elapsed := time.Since(start).Milliseconds()
if shouldSendAnalytics {
if err := sendAnalytics(client, workflow, err == nil, parentURL, elapsed); err != nil {
return err
}
}
if err != nil {
return fmt.Errorf("failed to run workflow %s: %w", workflow, err)
}
}
return nil
}
func sendAnalytics(client analytics.Client, workflow string, success bool, parentURL string, duration int64) error {
var status string
if success {
status = "success"
} else {
status = "error"
}
if err := client.Enqueue(analytics.Track{
UserId: unifiedCiAppID,
Event: "ci_e2e_finished",
Properties: map[string]interface{}{
"workflow": workflow,
"status": status,
"parent_url": parentURL,
"stack_id": os.Getenv("BITRISEIO_STACK_ID"),
"duration": duration,
},
}); err != nil {
return err
}
return nil
}
func readE2EWorkflows(configPath string) ([]string, error) {
configBytes, err := ioutil.ReadFile(configPath)
if err != nil {
return nil, err
}
return readE2EWorkflowsFromBytes(configBytes)
}
func readE2EWorkflowsFromBytes(configBytes []byte) ([]string, error) {
model := partialBitriseModel{}
if err := yaml.Unmarshal(configBytes, &model); err != nil {
return nil, err
}
var result []string
for _, workflow := range model.Workflows {
key, ok := workflow.Key.(string)
if !ok {
return nil, fmt.Errorf("failed to cast workflow name to string")
}
if strings.HasPrefix(key, "test_") {
result = append(result, key)
}
}
return result, nil
}
func runE2EWorkflow(commandFactory command.Factory, workDir string, configPath string, secretsPath string, workflow string) error {
e2eCmdArgs := []string{"run", "--config", configPath}
if secretsPath != "" {
e2eCmdArgs = append(e2eCmdArgs, "--inventory", secretsPath)
}
e2eCmdArgs = append(e2eCmdArgs, workflow)
e2eCmd := commandFactory.Create(
"bitrise",
e2eCmdArgs,
&command.Opts{
Dir: workDir,
Stdin: os.Stdin,
Stdout: os.Stdout,
})
fmt.Println()
log.Donef("$ %s", e2eCmd.PrintableCommandArgs())
if err := e2eCmd.Run(); err != nil {
if errorutil.IsExitStatusError(err) {
return err
}
return fmt.Errorf("failed to run command: %v", err)
}
return nil
}
func lookupSecrets(workDir string) (string, error) {
secretLookupPaths := []string{
filepath.Join(workDir, "e2e", defaultBitriseSecretsName),
filepath.Join(workDir, defaultBitriseSecretsName),
}
for _, secretPath := range secretLookupPaths {
if exists, err := pathutil.IsPathExists(secretPath); err != nil {
return "", err
} else if exists {
return secretPath, nil
}
}
return "", nil
}
| 25.076923 | 131 | 0.697027 |
9c40d66869385f33e81b20122abb9a4fb93c228a
| 6,018 |
js
|
JavaScript
|
src/components/SuggestField.js
|
grachet/react-online-doc
|
b58e1bffbb5a0d75b447dfb83b71ed5a2b3624d6
|
[
"MIT"
] | null | null | null |
src/components/SuggestField.js
|
grachet/react-online-doc
|
b58e1bffbb5a0d75b447dfb83b71ed5a2b3624d6
|
[
"MIT"
] | null | null | null |
src/components/SuggestField.js
|
grachet/react-online-doc
|
b58e1bffbb5a0d75b447dfb83b71ed5a2b3624d6
|
[
"MIT"
] | null | null | null |
import React from 'react';
import PropTypes from 'prop-types';
import Autosuggest from 'react-autosuggest';
import parse from 'autosuggest-highlight/parse';
import TextField from '@material-ui/core/TextField';
import Paper from '@material-ui/core/Paper';
import MenuItem from '@material-ui/core/MenuItem';
import {withStyles} from '@material-ui/core/styles';
import InputBase from "@material-ui/core/InputBase";
function renderInputComponent(inputProps) {
const {
classes, inputRef = () => {
}, ref, ...other
} = inputProps;
return <InputBase
placeholder="Search…"
classes={{
root: classes.inputRoot,
input: classes.inputInput,
}}
InputProps={{
inputRef: node => {
ref(node);
inputRef(node);
},
classes: {
input: classes.input,
},
}}
{...other}
/>
// return (
// <TextField
// autoFocus
// fullWidth
// InputProps={{
// inputRef: node => {
// ref(node);
// inputRef(node);
// },
// classes: {
// input: classes.input,
// },
// }}
// {...other}
// />
// );
}
function escapeRegexCharacters(str) {
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
function match(text, query) {
return (
query
.trim()
.split(" ")
.reduce((result, word) => {
if (!word.length) return result;
const wordLen = word.length;
const regex = new RegExp(escapeRegexCharacters(word), 'i');
console.log(text);
const {index = -1} = text.match(regex);
if (index > -1) {
result.push([index, index + wordLen]);
// Replace what we just found with spaces so we don't find it again.
text =
text.slice(0, index) +
new Array(wordLen + 1).join(' ') +
text.slice(index + wordLen);
}
return result;
}, [])
.sort((match1, match2) => {
return match1[0] - match2[0];
})
);
};
function renderSuggestion(suggestion, {query, isHighlighted}) {
const matches = match(suggestion.label, query);
const parts = parse(suggestion.label, matches);
return (
<MenuItem selected={isHighlighted} component="div">
<div>
{parts.map((part, index) => {
return part.highlight ? (
<span key={String(index)} style={{fontWeight: 500, color: "#124191"}}>
{part.text}
</span>
) : (
<strong key={String(index)} style={{fontWeight: 300}}>
{part.text}
</strong>
);
})}
</div>
</MenuItem>
);
}
const styles = theme => ({
root: {
flexGrow: 1,
},
searchIcon: {
width: theme.spacing.unit * 9,
height: '100%',
position: 'absolute',
pointerEvents: 'none',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
},
inputRoot: {
color: 'inherit',
width: '100%',
},
container: {
position: 'relative',
},
suggestionsContainerOpen: {
position: 'absolute',
zIndex: 200,
marginTop: theme.spacing.unit,
left: 0,
right: 0,
},
suggestion: {
display: 'block',
},
inputInput: {
paddingTop: theme.spacing.unit,
paddingRight: theme.spacing.unit,
paddingBottom: theme.spacing.unit,
paddingLeft: theme.spacing.unit * 10,
transition: theme.transitions.create('width'),
width: '100%',
[theme.breakpoints.up('sm')]: {
width: 120,
'&:focus': {
width: 200,
},
},
},
suggestionsList: {
margin: 0,
padding: 0,
listStyleType: 'none',
},
divider: {
height: theme.spacing.unit * 2,
},
});
class SuggestField extends React.Component {
state = {
single: '',
suggestions: [],
};
getSuggestionValue = (suggestion) => {
this.props.setValue(suggestion.value);
return this.props.hideValue ? "" : suggestion.label;
}
resetField = () => {
this.setState({single: ""})
}
getSuggestions = (value) => {
const escapedValue = escapeRegexCharacters(value.trim().toLowerCase());
if (escapedValue === '') {
return [];
}
const regex = new RegExp(escapedValue, 'i');
return this.props.data.filter(suggestion => regex.test(suggestion.label)).slice(0, this.props.numberSuggestionsMax);
}
handleSuggestionsFetchRequested = ({value}) => {
this.setState({
suggestions: this.getSuggestions(value),
});
};
handleSuggestionsClearRequested = () => {
this.setState({
suggestions: [],
});
};
handleChange = name => (event, {newValue}) => {
this.setState({
[name]: newValue,
});
};
render() {
const {classes} = this.props;
const autosuggestProps = {
renderInputComponent,
suggestions: this.state.suggestions,
onSuggestionsFetchRequested: this.handleSuggestionsFetchRequested,
onSuggestionsClearRequested: this.handleSuggestionsClearRequested,
getSuggestionValue: this.getSuggestionValue,
renderSuggestion,
};
return (
<div className={classes.root}>
<Autosuggest
{...autosuggestProps}
inputProps={{
classes,
placeholder: this.props.placeholder,
value: this.state.single,
onChange: this.handleChange('single'),
}}
theme={{
container: classes.container,
suggestionsContainerOpen: classes.suggestionsContainerOpen,
suggestionsList: classes.suggestionsList,
suggestion: classes.suggestion,
}}
renderSuggestionsContainer={options => (
<Paper {...options.containerProps} square>
{options.children}
</Paper>
)}
/>
</div>
);
}
}
SuggestField.propTypes = {
classes: PropTypes.object.isRequired,
};
export default withStyles(styles,{withTheme: true})(SuggestField);
| 23.880952 | 120 | 0.56331 |
c3d837d08fcae163736790f02f845974386506a6
| 3,519 |
go
|
Go
|
services/vmc/orgs/TosClient.go
|
martinrohrbach/vsphere-automation-sdk-go
|
d021d3634ac8106ab5100f851237f8e85eafe669
|
[
"BSD-2-Clause"
] | 18 |
2020-01-23T06:58:53.000Z
|
2021-12-21T00:43:50.000Z
|
services/vmc/orgs/TosClient.go
|
martinrohrbach/vsphere-automation-sdk-go
|
d021d3634ac8106ab5100f851237f8e85eafe669
|
[
"BSD-2-Clause"
] | 6 |
2020-01-28T21:20:22.000Z
|
2022-03-04T10:03:24.000Z
|
services/vmc/orgs/TosClient.go
|
martinrohrbach/vsphere-automation-sdk-go
|
d021d3634ac8106ab5100f851237f8e85eafe669
|
[
"BSD-2-Clause"
] | 13 |
2020-01-29T19:40:48.000Z
|
2022-01-13T04:37:51.000Z
|
// Copyright © 2019-2021 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: BSD-2-Clause
// Auto generated code. DO NOT EDIT.
// Interface file for service: Tos
// Used by client-side stubs.
package orgs
import (
"github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors"
"github.com/vmware/vsphere-automation-sdk-go/runtime/bindings"
"github.com/vmware/vsphere-automation-sdk-go/runtime/core"
"github.com/vmware/vsphere-automation-sdk-go/runtime/lib"
"github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client"
"github.com/vmware/vsphere-automation-sdk-go/services/vmc/model"
)
const _ = core.SupportedByRuntimeVersion1
type TosClient interface {
// Queries for the terms of service of a given org.
//
// @param orgParam Organization identifier (required)
// @param termsIdParam The terms of service reference ID to check on. (required)
// @return com.vmware.vmc.model.TermsOfServiceResult
// @throws Unauthorized Forbidden
Get(orgParam string, termsIdParam string) (model.TermsOfServiceResult, error)
}
type tosClient struct {
connector client.Connector
interfaceDefinition core.InterfaceDefinition
errorsBindingMap map[string]bindings.BindingType
}
func NewTosClient(connector client.Connector) *tosClient {
interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.vmc.orgs.tos")
methodIdentifiers := map[string]core.MethodIdentifier{
"get": core.NewMethodIdentifier(interfaceIdentifier, "get"),
}
interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers)
errorsBindingMap := make(map[string]bindings.BindingType)
tIface := tosClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector}
return &tIface
}
func (tIface *tosClient) GetErrorBindingType(errorName string) bindings.BindingType {
if entry, ok := tIface.errorsBindingMap[errorName]; ok {
return entry
}
return errors.ERROR_BINDINGS_MAP[errorName]
}
func (tIface *tosClient) Get(orgParam string, termsIdParam string) (model.TermsOfServiceResult, error) {
typeConverter := tIface.connector.TypeConverter()
executionContext := tIface.connector.NewExecutionContext()
sv := bindings.NewStructValueBuilder(tosGetInputType(), typeConverter)
sv.AddStructField("Org", orgParam)
sv.AddStructField("TermsId", termsIdParam)
inputDataValue, inputError := sv.GetStructValue()
if inputError != nil {
var emptyOutput model.TermsOfServiceResult
return emptyOutput, bindings.VAPIerrorsToError(inputError)
}
operationRestMetaData := tosGetRestMetadata()
connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData}
connectionMetadata["isStreamingResponse"] = false
tIface.connector.SetConnectionMetadata(connectionMetadata)
methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.vmc.orgs.tos", "get", inputDataValue, executionContext)
var emptyOutput model.TermsOfServiceResult
if methodResult.IsSuccess() {
output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tosGetOutputType())
if errorInOutput != nil {
return emptyOutput, bindings.VAPIerrorsToError(errorInOutput)
}
return output.(model.TermsOfServiceResult), nil
} else {
methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name()))
if errorInError != nil {
return emptyOutput, bindings.VAPIerrorsToError(errorInError)
}
return emptyOutput, methodError.(error)
}
}
| 39.539326 | 139 | 0.790566 |
70f6a8bd2a0c9b700f3fedbac6c3e6085fc6fc5c
| 2,185 |
go
|
Go
|
backend/worker/parser/event_handlers.go
|
marcelogdeandrade/csgo_demo_viewer
|
54bb4d6781fe2c339ef73e1b743af046004e4ac4
|
[
"MIT"
] | 4 |
2020-08-03T16:35:34.000Z
|
2021-04-30T03:56:30.000Z
|
backend/worker/parser/event_handlers.go
|
marcelogdeandrade/csgo_demo_viewer
|
54bb4d6781fe2c339ef73e1b743af046004e4ac4
|
[
"MIT"
] | 3 |
2021-10-06T20:03:24.000Z
|
2022-02-27T08:12:26.000Z
|
backend/worker/parser/event_handlers.go
|
marcelogdeandrade/csgo_demo_viewer
|
54bb4d6781fe2c339ef73e1b743af046004e4ac4
|
[
"MIT"
] | 1 |
2021-04-30T03:56:33.000Z
|
2021-04-30T03:56:33.000Z
|
package parser
import (
models "github.com/marcelogdeandrade/csgo-demo-parser/parser/models"
dem "github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs"
events "github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/events"
)
// RegisterEventHandlers function
func RegisterEventHandlers(p dem.Parser, match *models.Match) {
p.RegisterEventHandler(func(e events.RoundStart) {
idx := AdjustFrameIndex(p.CurrentFrame(), match.FrameFactor)
roundTime := GetRoundTime(p.GameState())
if p.GameState().IsMatchStarted() {
round := models.Round{
StartTime: roundTime,
FreezetimeFrame: idx,
Frame: idx,
}
match.Rounds = append(match.Rounds, round)
}
})
p.RegisterEventHandler(func(e events.RoundFreezetimeEnd) {
idx := AdjustFrameIndex(p.CurrentFrame(), match.FrameFactor)
if p.GameState().IsMatchStarted() {
freezetime := models.Freezetime{
Frame: idx,
}
match.Freezetimes = append(match.Freezetimes, freezetime)
}
})
p.RegisterEventHandler(func(e events.Kill) {
idx := AdjustFrameIndex(p.CurrentFrame(), match.FrameFactor)
kill := models.Kill{
Victim: e.Victim.Name,
Killer: e.Killer.Name,
}
match.Frames[idx].Kills = append(match.Frames[idx].Kills, kill)
})
p.RegisterEventHandler(func(e events.SmokeStart) {
idx := AdjustFrameIndex(p.CurrentFrame(), match.FrameFactor)
grenade := e.Grenade
grenadeExplosion := models.GrenadeExplosion{
Frame: idx,
GrenadeID: grenade.UniqueID(),
}
match.GrenadeExplosions = append(match.GrenadeExplosions, grenadeExplosion)
})
p.RegisterEventHandler(func(e events.ScoreUpdated) {
idx := AdjustFrameIndex(p.CurrentFrame(), match.FrameFactor)
newScore := e.NewScore
teamID := e.TeamState.ID()
score := models.Score{
TeamID: teamID,
Value: newScore,
Frame: idx,
}
match.Scores = append(match.Scores, score)
})
p.RegisterEventHandler(func(e events.RoundEnd) {
idx := AdjustFrameIndex(p.CurrentFrame(), match.FrameFactor)
roundEnd := models.RoundEnd{
Frame: idx,
Winner: TranslateTeamStruct(e.Winner),
Reason: TranslateRoundEndReason(e.Reason),
}
match.RoundEnds = append(match.RoundEnds, roundEnd)
})
}
| 31.214286 | 77 | 0.719451 |
b53c9f51b309ff98a582508b8789e78d38854e7b
| 888 |
rs
|
Rust
|
src/rusty_lexer.rs
|
SeppahBaws/rustycom
|
86bab5222d74fe2bb5fa3fc497c2a195b7378bf1
|
[
"MIT"
] | null | null | null |
src/rusty_lexer.rs
|
SeppahBaws/rustycom
|
86bab5222d74fe2bb5fa3fc497c2a195b7378bf1
|
[
"MIT"
] | null | null | null |
src/rusty_lexer.rs
|
SeppahBaws/rustycom
|
86bab5222d74fe2bb5fa3fc497c2a195b7378bf1
|
[
"MIT"
] | null | null | null |
extern crate logos;
use logos::Logos;
use std::collections::VecDeque;
use crate::token::{
Token,
TokenType,
};
pub struct RustyLexer {
}
impl RustyLexer {
pub fn parse(contents: &str) -> VecDeque<Token> {
let mut lexer = TokenType::lexer(contents);
let mut tokens: VecDeque<Token> = VecDeque::new();
loop {
match lexer.token {
TokenType::End => break,
TokenType::Error => {
println!("Error while parsing! Unidentified token {}", lexer.slice());
break;
},
_ => {
let token = Token::new(&lexer.token, &lexer.slice());
tokens.push_back(token);
// println!("{:?}", token);
}
}
lexer.advance();
}
tokens
}
}
| 21.658537 | 90 | 0.461712 |
a8495a565eb35c8d89a77219b0b6ac34caf254bb
| 1,191 |
rs
|
Rust
|
src/config.rs
|
Floppy/ruby-version-badger
|
a783ba089dbaf78b8a8baacf14b36b0989ef0575
|
[
"MIT"
] | 2 |
2017-07-15T03:51:59.000Z
|
2020-01-29T15:41:28.000Z
|
src/config.rs
|
Floppy/ruby-version-badger
|
a783ba089dbaf78b8a8baacf14b36b0989ef0575
|
[
"MIT"
] | 78 |
2017-07-14T12:32:26.000Z
|
2021-06-21T15:41:10.000Z
|
src/config.rs
|
Floppy/ruby-version-badger
|
a783ba089dbaf78b8a8baacf14b36b0989ef0575
|
[
"MIT"
] | 2 |
2017-07-14T13:10:11.000Z
|
2017-07-15T02:36:02.000Z
|
use std::env;
use std::fs::File;
use std::io::Read;
use std::io::Error;
use yaml_rust::yaml;
pub fn port() -> String {
env::var("PORT").unwrap_or("3000".to_string())
}
pub fn language(lang: String) -> Result<yaml::Yaml, Error> {
let mut f = File::open(["config/",lang.as_str(),".yml"].join("")).unwrap();
let mut s = String::new();
f.read_to_string(&mut s).unwrap();
let docs = yaml::YamlLoader::load_from_str(&s).unwrap();
return Ok(docs[0].clone());
}
#[cfg(test)]
mod tests {
use crate::config;
use std::env;
#[test]
fn default_to_port_3k() {
assert_eq!("3000", config::port());
}
#[test]
fn uses_port_from_env() {
env::set_var("PORT", "3030");
assert_eq!("3030", config::port());
}
#[test]
fn read_language_config_file() {
let versions = config::language("test".to_string()).unwrap();
assert_eq!("2.0.0", versions["latest"][0].as_str().unwrap());
assert_eq!("1.2.3", versions["supported"][0].as_str().unwrap());
assert_eq!("1.1.2", versions["supported"][1].as_str().unwrap());
assert_eq!("1.0.3", versions["maintenance"][0].as_str().unwrap());
}
}
| 26.466667 | 79 | 0.576826 |
f05afdbd5aec954079117e24e6a1f75f80dba71c
| 1,523 |
py
|
Python
|
Consumer_test.py
|
image-store-org/image-store-py-web-api-consumer-test
|
59d805e8a7b459a97ede7285f6e4a67e87cfba02
|
[
"MIT"
] | null | null | null |
Consumer_test.py
|
image-store-org/image-store-py-web-api-consumer-test
|
59d805e8a7b459a97ede7285f6e4a67e87cfba02
|
[
"MIT"
] | null | null | null |
Consumer_test.py
|
image-store-org/image-store-py-web-api-consumer-test
|
59d805e8a7b459a97ede7285f6e4a67e87cfba02
|
[
"MIT"
] | null | null | null |
import sys
sys.path.append('dependencies/image-store-py-web-api-consumer')
from Consumer import Consumer
class Consumer_test:
def __init__(self):
self.c = Consumer()
def get(self):
print('\x1b[6;30;42m' + 'GET' + '\x1b[0m')
print(self.c.get())
print('{}\n'.format(self.c.get().json()))
# get a data entry by id
def get_id(self, id):
print('\x1b[6;30;42m' + 'GET ID({})'.format(id) + '\x1b[0m')
print(self.c.get_id(id))
print('{}\n'.format(self.c.get_id(id).json()))
# get latest data entry
def get_latest(self):
print('\x1b[6;30;42m' + 'GET LATEST' + '\x1b[0m')
print(self.c.get_latest())
print('{}\n'.format(self.c.get_latest().json()))
# post a data entry, id incremented by internal mySQL counter
def post(self):
print('\x1b[6;30;42m' + 'POST' + '\x1b[0m')
print(self.c.post())
print('{}\n'.format(self.c.post().json()))
# TODO be able to edit payload with keywords e.g: title.TEST
# edit existing data entry by id
def put(self, id):
print('\x1b[6;30;42m' + 'PUT({})'.format(id) + '\x1b[0m')
print(self.c.put(id))
# delete data entry by id
def delete(self, id):
print('\x1b[6;30;42m' + 'DELETE({})'.format(id) + '\x1b[0m')
print(self.c.delete(id))
if __name__ == '__main__':
consumer = Consumer_test()
consumer.get()
consumer.get_id(1)
consumer.post()
consumer.get_latest()
consumer.put(10)
| 30.46 | 69 | 0.570584 |
2a213fe6b3ad7ca442c15e51de546c7b7cbee9fe
| 1,112 |
html
|
HTML
|
html/hubs/html/structure.html
|
MGBergomi/mgbergomi.github.io
|
2a90654e7b58b82312974b56dae52e206ca47009
|
[
"MIT"
] | null | null | null |
html/hubs/html/structure.html
|
MGBergomi/mgbergomi.github.io
|
2a90654e7b58b82312974b56dae52e206ca47009
|
[
"MIT"
] | null | null | null |
html/hubs/html/structure.html
|
MGBergomi/mgbergomi.github.io
|
2a90654e7b58b82312974b56dae52e206ca47009
|
[
"MIT"
] | null | null | null |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="../js/reveal.js/css/reveal.css">
<link rel="stylesheet" href="../js/reveal.js/css/theme/black.css">
<style>
@import url('https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300');
</style>
</head>
<body>
<div class="container" style="width:100%;">
<div class="progress" style="width:100%;height: 2em">
<div class="progress-bar progress-bar-success" role="progressbar" style="width:20%">
</div>
<div class="progress-bar progress-bar-warning" role="progressbar" style="width:40%">
</div>
<div class="progress-bar progress-bar-danger" role="progressbar" style="width:40%">
</div>
</div>
</div>
</body>
</html>
| 37.066667 | 102 | 0.678058 |
729e0202f2d020991875ed4628ee1c1cceab0f93
| 3,086 |
rs
|
Rust
|
core/tauri-utils/src/html.rs
|
jiusanzhou/tauri
|
aa498e72614f59afcdd1f637b4e3bdf6fe00b137
|
[
"Apache-2.0",
"MIT"
] | 1 |
2021-08-03T18:59:32.000Z
|
2021-08-03T18:59:32.000Z
|
core/tauri-utils/src/html.rs
|
jiusanzhou/tauri
|
aa498e72614f59afcdd1f637b4e3bdf6fe00b137
|
[
"Apache-2.0",
"MIT"
] | null | null | null |
core/tauri-utils/src/html.rs
|
jiusanzhou/tauri
|
aa498e72614f59afcdd1f637b4e3bdf6fe00b137
|
[
"Apache-2.0",
"MIT"
] | null | null | null |
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use html5ever::{interface::QualName, namespace_url, ns, LocalName};
use kuchiki::{Attribute, ExpandedName, NodeRef};
/// Injects the invoke key token to each script on the document.
///
/// The invoke key token is replaced at runtime with the actual invoke key value.
pub fn inject_invoke_key_token(document: &mut NodeRef) {
let mut targets = vec![];
if let Ok(scripts) = document.select("script") {
for target in scripts {
targets.push(target);
}
for target in targets {
let node = target.as_node();
let element = node.as_element().unwrap();
let attrs = element.attributes.borrow();
// if the script is external (has `src`) or its type is not "module", we won't inject the token
if attrs.get("src").is_some() || attrs.get("type") != Some("module") {
continue;
}
let replacement_node = NodeRef::new_element(
QualName::new(None, ns!(html), "script".into()),
element
.attributes
.borrow()
.clone()
.map
.into_iter()
.collect::<Vec<_>>(),
);
let script = node.text_contents();
replacement_node.append(NodeRef::new_text(format!(
r#"
const __TAURI_INVOKE_KEY__ = __TAURI__INVOKE_KEY_TOKEN__;
{}
"#,
script
)));
node.insert_after(replacement_node);
node.detach();
}
}
}
/// Injects a content security policy to the HTML.
pub fn inject_csp(document: &mut NodeRef, csp: &str) {
if let Ok(ref head) = document.select_first("head") {
head.as_node().append(create_csp_meta_tag(csp));
} else {
let head = NodeRef::new_element(
QualName::new(None, ns!(html), LocalName::from("head")),
None,
);
head.append(create_csp_meta_tag(csp));
document.prepend(head);
}
}
fn create_csp_meta_tag(csp: &str) -> NodeRef {
NodeRef::new_element(
QualName::new(None, ns!(html), LocalName::from("meta")),
vec![
(
ExpandedName::new(ns!(), LocalName::from("http-equiv")),
Attribute {
prefix: None,
value: "Content-Security-Policy".into(),
},
),
(
ExpandedName::new(ns!(), LocalName::from("content")),
Attribute {
prefix: None,
value: csp.into(),
},
),
],
)
}
#[cfg(test)]
mod tests {
use kuchiki::traits::*;
#[test]
fn csp() {
let htmls = vec![
"<html><head></head></html>".to_string(),
"<html></html>".to_string(),
];
for html in htmls {
let mut document = kuchiki::parse_html().one(html);
let csp = "default-src 'self'; img-src https://*; child-src 'none';";
super::inject_csp(&mut document, csp);
assert_eq!(
document.to_string(),
format!(
r#"<html><head><meta content="{}" http-equiv="Content-Security-Policy"></head><body></body></html>"#,
csp
)
);
}
}
}
| 27.801802 | 111 | 0.581011 |
21f9095582b4b4ccdf464763694b17146a75093f
| 4,921 |
html
|
HTML
|
New_Form.html
|
inderj1909/Website
|
5fe4d3a6d96965c870bc84223829a7afc9d7e4a2
|
[
"MIT"
] | null | null | null |
New_Form.html
|
inderj1909/Website
|
5fe4d3a6d96965c870bc84223829a7afc9d7e4a2
|
[
"MIT"
] | null | null | null |
New_Form.html
|
inderj1909/Website
|
5fe4d3a6d96965c870bc84223829a7afc9d7e4a2
|
[
"MIT"
] | null | null | null |
<!DOCTYPE html>
<html lang="en">
<head>
<style>
div#load_screen{
background: #975;
opacity: 1;
position: fixed;
z-index:10;
top: 0px;
width: 100%;
height: 1600px;
}
div#load_screen > div#loading{
color:#FFF;
width:120px;
height:24px;
margin: 300px auto;
}
</style>
<script>
window.addEventListener("load", function(){
var load_screen = document.getElementById("load_screen");
document.body.removeChild(load_screen);
});
</script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="Password Reset">
<meta name="author" content="Inderjodh Singh">
<link rel="icon" href="images/favicon.ico">
<!-- Bootstrap core CSS -->
<link href="dist/css/bootstrap.min.css" rel="stylesheet">
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="signin.css" rel="stylesheet">
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<script src="assets/js/ie-emulation-modes-warning.js"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body class="password-page">
<div id="load_screen"><div id="loading">loading document</div></div>
<div class="site-wrapper">
<div class="container">
<div class="site-wrapper-inner">
<div class="cover-container">
<div class="masthead clearfix">
<div class="inner">
<nav>
<ul class="nav masthead-nav">
<li ><a href="Index.html">Home</a></li>
<li><a href="Services.html">Services</a></li>
<li><a href="Contact.html">Contact</a></li>
<li class="active"><a href="Login.html">Login</a></li>
</ul>
</nav>
</div>
</div>
</div>
</div>
<form class="form-signin">
<h2 class="form-signin-heading">Enter Your New Password</h2>
<input type="password" class="form-control" placeholder="New Password" id="password" required>
<input type="password" class="form-control" placeholder="Confirm Password" id ="confirm_password" required>
<button class="btn btn-lg btn-primary btn-block" " >Submit</button></form>
</div>
<script>
var password = document.getElementById("password")
, confirm_password = document.getElementById("confirm_password");
function validatePassword(){
if(password.value != confirm_password.value) {
confirm_password.setCustomValidity("Passwords Don't Match");
confirm_password.border = "2px solid #ff0000";
} else {
confirm_password.setCustomValidity('');
confirm_password.border = "2px solid #00ff00";
}
}
password.onchange = validatePassword;
confirm_password.onkeyup = validatePassword;
</script>
<style>
body {
padding-top: 40px;
padding-bottom: 40px;
background-color: #eee;
}
.form-signin {
max-width: 330px;
padding: 15px;
margin: 0 auto;
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
margin-bottom: 10px;
}
.form-signin .checkbox {
font-weight: normal;
}
.form-signin .form-control {
position: relative;
height: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
font-size: 16px;
}
.form-signin .form-control:focus {
z-index: 2;
}
.form-signin input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
</style>
</div> <!-- /container -->
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="assets/js/ie10-viewport-bug-workaround.js"></script>
<style type="text/css">
body.password-page {background-image: url("bg2.jpg");
/* Create the parallax scrolling effect */
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
</style>
</body>
</html>
| 30.006098 | 118 | 0.616338 |
21dd85acab7e7d6c25301860ee78d5d67f48a7f8
| 401 |
html
|
HTML
|
AppData/Modules/CMS/1.0.431/ClientResources/EPi/cms/widget/templates/ContentType.html
|
Romanets/RestImageResize
|
f9c79924994b6ff05db5caccf8343524629544b3
|
[
"MIT"
] | 1 |
2017-07-07T01:21:41.000Z
|
2017-07-07T01:21:41.000Z
|
AppData/Modules/CMS/1.0.431/ClientResources/EPi/cms/widget/templates/ContentType.html
|
Romanets/RestImageResize
|
f9c79924994b6ff05db5caccf8343524629544b3
|
[
"MIT"
] | 4 |
2015-08-07T17:10:55.000Z
|
2018-01-26T08:38:30.000Z
|
AppData/Modules/CMS/1.0.431/ClientResources/EPi/cms/widget/templates/ContentType.html
|
Romanets/RestImageResize
|
f9c79924994b6ff05db5caccf8343524629544b3
|
[
"MIT"
] | 2 |
2015-08-07T12:24:06.000Z
|
2017-04-20T12:18:19.000Z
|
<li class="clearfix" data-dojo-attach-event="onkeypress:_onKeyPress, onmouseover:_onMouseOver, onmouseout:_onMouseOut" data-dojo-attach-point="focusNode">
<div class="epi-browserWindow"><div class="epi-browserWindowContent" data-dojo-attach-point="iconNode">${emptyIconTemplate}</div></div>
<h3 data-dojo-attach-point="nameNode"></h3>
<p data-dojo-attach-point="descriptionNode"></p>
</li>
| 80.2 | 154 | 0.750623 |
8f5b9669a15d9b8207d1a7c5222e52fa31a5de8e
| 10,261 |
sql
|
SQL
|
Minimalistic Balance Acken/Minimalistic Balance Acken/Policies/Piety.sql
|
rezoacken/minimalistic_balance_civ5
|
939c96af52b32895847e26f2b25ad6d8a6bc7796
|
[
"MIT"
] | null | null | null |
Minimalistic Balance Acken/Minimalistic Balance Acken/Policies/Piety.sql
|
rezoacken/minimalistic_balance_civ5
|
939c96af52b32895847e26f2b25ad6d8a6bc7796
|
[
"MIT"
] | null | null | null |
Minimalistic Balance Acken/Minimalistic Balance Acken/Policies/Piety.sql
|
rezoacken/minimalistic_balance_civ5
|
939c96af52b32895847e26f2b25ad6d8a6bc7796
|
[
"MIT"
] | null | null | null |
/*Bugs **=supposedly fixed
**The tourism from the hermitage beleif if secondary religion isn't added
Tooltip stuff:
BuildingClassHappiness from secondary religion works but is not displayed in the tooltip on buildings (only in local happiness)
Extra yields from secondary religion aren't displayed on the buildings but works (it is displayed in the summary)
Extra culture for shrine temples isn't displayed
*/
/*OPENER*/
INSERT INTO Policy_BuildingClassYieldChanges
(PolicyType, BuildingClassType, YieldType, YieldChange) VALUES
('POLICY_PIETY', 'BUILDINGCLASS_PALACE', 'YIELD_FAITH', 1);
/*POLICY_ORGANIZED_RELIGION*/
INSERT INTO Policy_BuildingClassCultureChanges
(PolicyType, BuildingClassType, CultureChange) VALUES
('POLICY_ORGANIZED_RELIGION', 'BUILDINGCLASS_SHRINE', 1),
('POLICY_ORGANIZED_RELIGION', 'BUILDINGCLASS_TEMPLE', 1);
/*POLICY_THEOCRACY*/
/*INSERT INTO Policy_BuildingClassYieldModifiers
(PolicyType, BuildingClassType, YieldType, YieldMod) VALUES
('POLICY_THEOCRACY', 'BUILDINGCLASS_GRAND_TEMPLE', 'YIELD_GOLD', 25);*/
/*INSERT INTO Policy_BuildingClassYieldChanges
(PolicyType, BuildingClassType, YieldType, YieldChange) VALUES
('POLICY_THEOCRACY', 'BUILDINGCLASS_SHRINE', 'YIELD_GOLD', 1);
UPDATE Policy_BuildingClassYieldModifiers Set YieldMod=20 WHERE PolicyType='POLICY_THEOCRACY' AND BuildingClassType='BUILDINGCLASS_TEMPLE';*/
INSERT INTO Policy_BuildingClassYieldChanges
(PolicyType, BuildingClassType, YieldType, YieldChange) VALUES
('POLICY_THEOCRACY', 'BUILDINGCLASS_SHRINE', 'YIELD_GOLD', 2);
UPDATE Policy_BuildingClassYieldModifiers Set YieldMod=15 WHERE PolicyType='POLICY_THEOCRACY' AND BuildingClassType='BUILDINGCLASS_TEMPLE';
/*POLICY_FREE_RELIGION*/
UPDATE Policies SET SecondReligionPantheon=0 WHERE Type='POLICY_FREE_RELIGION';
UPDATE Policies SET ExtraHappinessForFollowingCity=1 WHERE Type='POLICY_FREE_RELIGION';
/*POLICY_REFORMATION*/
UPDATE Policies SET ProphetSpawnGoldenAgeBonusPerFollower=1 WHERE Type='POLICY_REFORMATION';
UPDATE Policies SET ProphetSpawnGoldBonusPerFollower=1 WHERE Type='POLICY_REFORMATION';
UPDATE Policies SET ProphetSpawnProductionBonusPerFollower=1 WHERE Type='POLICY_REFORMATION';
/*Finisher*/
UPDATE Policies SET SecondReligionPantheon=1 WHERE Type='POLICY_PIETY_FINISHER';
DELETE FROM Policy_ImprovementCultureChanges WHERE PolicyType='POLICY_PIETY_FINISHER';
/*Layout*/
DELETE FROM Policy_PrereqPolicies WHERE PolicyType='POLICY_THEOCRACY';
DELETE FROM Policy_PrereqPolicies WHERE PolicyType='POLICY_REFORMATION';
DELETE FROM Policy_PrereqPolicies WHERE PolicyType='POLICY_FREE_RELIGION';
UPDATE Policies SET GridX=3, GridY=1 where Type='POLICY_ORGANIZED_RELIGION';
UPDATE Policies SET GridX=3, GridY=2 where Type='POLICY_THEOCRACY';
UPDATE Policies SET GridX=5, GridY=1 where Type='POLICY_MANDATE_OF_HEAVEN';
UPDATE Policies SET GridX=3, GridY=3 where Type='POLICY_REFORMATION';
UPDATE Policies SET GridX=1, GridY=2 where Type='POLICY_FREE_RELIGION';
/*Prereqs*/
INSERT INTO Policy_PrereqPolicies
(PolicyType, PrereqPolicy) VALUES
('POLICY_THEOCRACY', 'POLICY_ORGANIZED_RELIGION'),
('POLICY_FREE_RELIGION', 'POLICY_ORGANIZED_RELIGION'),
('POLICY_REFORMATION', 'POLICY_THEOCRACY'),
('POLICY_REFORMATION', 'POLICY_MANDATE_OF_HEAVEN');
/*Texts*/
Update Language_en_US Set Text='[COLOR_POSITIVE_TEXT]Piety[ENDCOLOR] is best for civilizations focused on religion.[NEWLINE][NEWLINE]Adopting Piety will grant +1[ICON_PEACE] Faith in the capital. It will also increase the production of Shrines and Temples by 100%. Unlocks Borobudur.[NEWLINE][NEWLINE]Adopting all Policies in the Piety tree will grant a free Prophet. It also give access to the pantheon and follower beliefs of the second most popular religion in your cities.' Where Tag='TXT_KEY_POLICY_BRANCH_PIETY_HELP';
Update Language_en_US Set Text='[COLOR_POSITIVE_TEXT]Mandate of Heaven[ENDCOLOR][NEWLINE]Diminishes the cost by 20% on all purchases of religious units, buildings and Prophets with [ICON_PEACE] Faith.' Where Tag='TXT_KEY_POLICY_MANDATE_OF_HEAVEN_HELP';
Update Language_en_US Set Text='[COLOR_POSITIVE_TEXT]Organized Religion[ENDCOLOR][NEWLINE]+1 [ICON_PEACE] Faith and +1 [ICON_CULTURE] Culture from Shrines and Temples.' Where Tag='TXT_KEY_POLICY_ORGANIZED_RELIGION_HELP';
Update Language_en_US Set Text='[COLOR_POSITIVE_TEXT]Religious Fervour[ENDCOLOR][NEWLINE]+1 [ICON_HAPPINESS_1] Happiness from each city you own that follow your religion and from every 3 foreign cities that follow your religion.' Where Tag='TXT_KEY_POLICY_FREE_RELIGION_HELP';
Update Language_en_US Set Text='Religious Fervour' Where Tag='TXT_KEY_POLICY_FREE_RELIGION';
Update Language_en_US Set Text='Civilopedia Placeholder' Where Tag='TXT_KEY_POLICY_FREERELIGION_TEXT';
/*Update Language_en_US Set Text='[COLOR_POSITIVE_TEXT]Theocracy[ENDCOLOR][NEWLINE]Holy Sites provide +3 [ICON_GOLD] Gold.[NEWLINE]Temples boost city [ICON_GOLD] Gold output by 20% and Shrines give +1 [ICON_GOLD].' Where Tag='TXT_KEY_POLICY_THEOCRACY_HELP';*/
Update Language_en_US Set Text='[COLOR_POSITIVE_TEXT]Theocracy[ENDCOLOR][NEWLINE]Holy Sites provide +3 [ICON_GOLD] Gold.[NEWLINE]Temples boost city [ICON_GOLD] Gold output by 15% and Shrines give +2 [ICON_GOLD].'
Where Tag='TXT_KEY_POLICY_THEOCRACY_HELP';
Update Language_en_US Set Text='[COLOR_POSITIVE_TEXT]Reformation[ENDCOLOR][NEWLINE]Every time a great Prophet is born, the capital receive a bonus in [ICON_GOLD] Gold, [ICON_PRODUCTION] Production and [ICON_GOLDEN_AGE] Golden Age points equal to the number of followers of this religion up to a maximum of 100. [NEWLINE]If you founded a religion, gain a bonus Reformation belief.' Where Tag='TXT_KEY_POLICY_REFORMATION_HELP';
INSERT INTO Language_en_US
(Tag, Text) VALUES
('TXT_KEY_FREE_RELIGION_HEADER', 'Religious Fervour');
Update Language_DE_DE Set Text='[COLOR_POSITIVE_TEXT]Piety[ENDCOLOR] is best for civilizations focused on religion.[NEWLINE][NEWLINE]Adopting Piety will grant +1[ICON_PEACE] Faith in the capital. It will also increase the production of Shrines and Temples by 100%. Unlocks Borobudur.[NEWLINE][NEWLINE]Adopting all Policies in the Piety tree will grant a free Prophet. It also give access to the pantheon and follower beliefs of the second most popular religion in your cities.' Where Tag='TXT_KEY_POLICY_BRANCH_PIETY_HELP';
Update Language_DE_DE Set Text='[COLOR_POSITIVE_TEXT]Mandate of Heaven[ENDCOLOR][NEWLINE]Diminishes the cost by 20% on all purchases of religious units, buildings and Prophets with [ICON_PEACE] Faith.' Where Tag='TXT_KEY_POLICY_MANDATE_OF_HEAVEN_HELP';
Update Language_DE_DE Set Text='[COLOR_POSITIVE_TEXT]Organized Religion[ENDCOLOR][NEWLINE]+1 [ICON_PEACE] Faith and +1 [ICON_CULTURE] Culture from Shrines and Temples.' Where Tag='TXT_KEY_POLICY_ORGANIZED_RELIGION_HELP';
Update Language_DE_DE Set Text='[COLOR_POSITIVE_TEXT]Religious Fervour[ENDCOLOR][NEWLINE]+1 [ICON_HAPPINESS_1] Happiness from each city you own that follow your religion and from every 3 foreign cities that follow your religion.' Where Tag='TXT_KEY_POLICY_FREE_RELIGION_HELP';
Update Language_DE_DE Set Text='Religious Fervour' Where Tag='TXT_KEY_POLICY_FREE_RELIGION';
Update Language_DE_DE Set Text='Civilopedia Placeholder' Where Tag='TXT_KEY_POLICY_FREERELIGION_TEXT';
Update Language_DE_DE Set Text='[COLOR_POSITIVE_TEXT]Theocracy[ENDCOLOR][NEWLINE]Holy Sites provide +3 [ICON_GOLD] Gold.[NEWLINE]Temples boost city [ICON_GOLD] Gold output by 20% and Shrines give +1 [ICON_GOLD].' Where Tag='TXT_KEY_POLICY_THEOCRACY_HELP';
Update Language_DE_DE Set Text='[COLOR_POSITIVE_TEXT]Reformation[ENDCOLOR][NEWLINE]Every time a great Prophet is born, the capital receive a bonus in [ICON_GOLD] Gold, [ICON_PRODUCTION] Production and [ICON_GOLDEN_AGE] Golden Age points equal to the number of followers of this religion up to a maximum of 100. [NEWLINE]If you founded a religion, gain a bonus Reformation belief.' Where Tag='TXT_KEY_POLICY_REFORMATION_HELP';
INSERT INTO Language_DE_DE
(Tag, Text) VALUES
('TXT_KEY_FREE_RELIGION_HEADER', 'Religious Fervour');
Update Language_PL_PL Set Text='[COLOR_POSITIVE_TEXT]Piety[ENDCOLOR] is best for civilizations focused on religion.[NEWLINE][NEWLINE]Adopting Piety will grant +1[ICON_PEACE] Faith in the capital. It will also increase the production of Shrines and Temples by 100%. Unlocks Borobudur.[NEWLINE][NEWLINE]Adopting all Policies in the Piety tree will grant a free Prophet. It also give access to the pantheon and follower beliefs of the second most popular religion in your cities.' Where Tag='TXT_KEY_POLICY_BRANCH_PIETY_HELP';
Update Language_PL_PL Set Text='[COLOR_POSITIVE_TEXT]Mandate of Heaven[ENDCOLOR][NEWLINE]Diminishes the cost by 20% on all purchases of religious units, buildings and Prophets with [ICON_PEACE] Faith.' Where Tag='TXT_KEY_POLICY_MANDATE_OF_HEAVEN_HELP';
Update Language_PL_PL Set Text='[COLOR_POSITIVE_TEXT]Organized Religion[ENDCOLOR][NEWLINE]+1 [ICON_PEACE] Faith and +1 [ICON_CULTURE] Culture from Shrines and Temples.' Where Tag='TXT_KEY_POLICY_ORGANIZED_RELIGION_HELP';
Update Language_PL_PL Set Text='[COLOR_POSITIVE_TEXT]Religious Fervour[ENDCOLOR][NEWLINE]+1 [ICON_HAPPINESS_1] Happiness from each city you own that follow your religion and from every 3 foreign cities that follow your religion.' Where Tag='TXT_KEY_POLICY_FREE_RELIGION_HELP';
Update Language_PL_PL Set Text='Religious Fervour' Where Tag='TXT_KEY_POLICY_FREE_RELIGION';
Update Language_PL_PL Set Text='Civilopedia Placeholder' Where Tag='TXT_KEY_POLICY_FREERELIGION_TEXT';
Update Language_PL_PL Set Text='[COLOR_POSITIVE_TEXT]Theocracy[ENDCOLOR][NEWLINE]Holy Sites provide +3 [ICON_GOLD] Gold.[NEWLINE]Temples boost city [ICON_GOLD] Gold output by 20% and Shrines give +1 [ICON_GOLD].' Where Tag='TXT_KEY_POLICY_THEOCRACY_HELP';
Update Language_PL_PL Set Text='[COLOR_POSITIVE_TEXT]Reformation[ENDCOLOR][NEWLINE]Every time a great Prophet is born, the capital receive a bonus in [ICON_GOLD] Gold, [ICON_PRODUCTION] Production and [ICON_GOLDEN_AGE] Golden Age points equal to the number of followers of this religion up to a maximum of 100. [NEWLINE]If you founded a religion, gain a bonus Reformation belief.' Where Tag='TXT_KEY_POLICY_REFORMATION_HELP';
INSERT INTO Language_PL_PL
(Tag, Text) VALUES
('TXT_KEY_FREE_RELIGION_HEADER', 'Religious Fervour');
| 101.594059 | 523 | 0.826138 |
a983a23e84da21ec6875012ee2a92865e96e3159
| 440 |
kt
|
Kotlin
|
src/main/kotlin/org/jetbrains/plugins/dx/DxAwkLanguageInjector.kt
|
linux-china/dx-intellij-plugin
|
7d772f71d757986445ad781b167e863e69504679
|
[
"Apache-2.0"
] | 1 |
2021-05-17T11:50:02.000Z
|
2021-05-17T11:50:02.000Z
|
src/main/kotlin/org/jetbrains/plugins/dx/DxAwkLanguageInjector.kt
|
linux-china/dx-intellij-plugin
|
7d772f71d757986445ad781b167e863e69504679
|
[
"Apache-2.0"
] | null | null | null |
src/main/kotlin/org/jetbrains/plugins/dx/DxAwkLanguageInjector.kt
|
linux-china/dx-intellij-plugin
|
7d772f71d757986445ad781b167e863e69504679
|
[
"Apache-2.0"
] | 1 |
2021-11-04T02:35:10.000Z
|
2021-11-04T02:35:10.000Z
|
package org.jetbrains.plugins.dx
import com.intellij.lang.Language
class DxAwkLanguageInjector : AbstractLanguageInjector() {
val DX_JS_TAGS = arrayOf("awk")
var awkLanguage: Language? = null
init {
awkLanguage = Language.findLanguageByID("AWK")
}
override fun getTags(): Array<String> {
return DX_JS_TAGS
}
override fun getInjectionLanguage(): Language? {
return awkLanguage
}
}
| 22 | 58 | 0.679545 |
afab62aa7f53f32bcd7f7d506f8df4c9ac3e0935
| 7,263 |
rb
|
Ruby
|
spec/services/map_spec.rb
|
JohnKellyFerguson/octomaps
|
edc91b187881a91dc531cc2952e968544958e106
|
[
"MIT"
] | 5 |
2015-01-31T00:15:35.000Z
|
2016-09-20T19:42:32.000Z
|
spec/services/map_spec.rb
|
JohnKellyFerguson/octomaps
|
edc91b187881a91dc531cc2952e968544958e106
|
[
"MIT"
] | 1 |
2017-06-21T14:49:41.000Z
|
2017-12-07T02:48:20.000Z
|
spec/services/map_spec.rb
|
JohnKellyFerguson/octomaps
|
edc91b187881a91dc531cc2952e968544958e106
|
[
"MIT"
] | null | null | null |
require 'spec_helper'
describe Map do
let(:country_options) { { :displayMode => 'region',
:region => 'world',
:legend => 'none',
:colors => ['FF8F86', 'C43512']} }
let(:city_options) { { :displayMode => 'markers',
:region => 'world',
:legend => 'none',
:colors => ['FF8F86', 'C43512']}
}
describe "default attributes" do
it "should have the correct country options" do
expect(Map::COUNTRY_OPTIONS).to eq(country_options)
end
it "should have the correct city options" do
expect(Map::CITY_OPTIONS).to eq(city_options)
end
end
describe "instance methods" do
let(:john) do
double("user", :has_no_city? => false, city_name: "New York, NY, USA",
:has_no_country? => false, country_name: "United States")
end
let(:masha) do
double("user", :has_no_city? => true, :has_no_country? => true)
end
let(:justin) do
double("user", :has_no_city? => false, city_name: "New Jersey, USA",
:has_no_country? => false, country_name: "United States")
end
let(:repo) do
double("repo", full_name: "johnkellyferguson/octomaps",
users: [john, masha, justin], contributions_count: 3)
end
let(:country_params) do
{"owner"=>"johnkellyferguson", "repo"=>"octomaps",
"country"=>"Map by Country"}
end
let(:city_params) do
{"owner"=>"johnkellyferguson", "repo"=>"octomaps", "city"=>"Map by City*"}
end
let(:country_map) { Map.new(repo, country_params) }
let(:city_map) { Map.new(repo, city_params) }
describe "public methods" do
it "should respond to #type" do
expect(country_map).to respond_to(:type)
end
it "should respond to #repository" do
expect(country_map).to respond_to(:repository)
end
describe "#repository_name" do
it "should return the correct repository name" do
expect(country_map.repository_name).to eq("johnkellyferguson/octomaps")
end
end
describe "#contributions_count" do
it "should return the correct contributions count" do
expect(country_map.contributions_count).to eq(3)
end
end
describe "#number_of_locations" do
context "when it is a country map" do
it "should return the correct number of locations" do
expect(country_map.number_of_locations).to eq(2)
end
end
context "when it is a city map" do
it "should return the correct number of locations" do
expect(city_map.number_of_locations).to eq(3)
end
end
end #number_of_locations
describe "#is_of_cities?" do
context "when the map type is 'city'" do
it "should return true" do
expect(city_map.is_of_cities?).to eq(true)
end
end
context "when the map type is not 'city'" do
it "should return false" do
expect(country_map.is_of_cities?).to eq(false)
end
end
end #is_of_cities?
describe "#is_of_countries?" do
context "when the map type is 'country'" do
it "should return true" do
expect(country_map.is_of_countries?).to eq(true)
end
end
context "when the map type is not 'country'" do
it "should return false" do
expect(city_map.is_of_countries?).to eq(false)
end
end
end #is_of_countries?
describe "#sorted_list" do
it "should return a list with the location with the most contributors first" do
expect(country_map.sorted_list.first).to eq(["United States", 2])
end
it "should return a list with the location with the least contributors last" do
expect(country_map.sorted_list.last).to eq(["Location Unknown", 1])
end
end #sorted_list
describe "#google_visualr_chart_markers" do
it "should return an instance of GoogleVisualr::Interactive::GeoChart" do
expect(country_map.google_visualr_chart_markers.class).to eq(GoogleVisualr::Interactive::GeoChart)
end
end
end # public methods
describe "private methods" do
describe "#determine_type_based_upon(params)" do
context "when params['city'] is present" do
it "should return 'city'" do
expect(country_map.send(:determine_type_based_upon, city_params)).to eq("city")
end
end
context "when params['country'] is present" do
it "should return 'country'" do
expect(city_map.send(:determine_type_based_upon, country_params)).to eq("country")
end
end
context "when params['country'] or params['city'] is not present" do
it "should return nil" do
expect(country_map.send(:determine_type_based_upon, {"fake"=>"fake"})).to eq(nil)
end
end
end #determine_type_based_upon(params)
describe "#location_count_hash" do
context "when map type is city" do
it "should return the same value as #city_count_hash" do
expect(city_map.send(:location_count_hash)).to eq(city_map.send(:city_count_hash))
end
it "should not return the same value as #country_count_hash" do
expect(city_map.send(:location_count_hash)).not_to eq(city_map.send(:country_count_hash))
end
end
context "when map type is country" do
it "should return the same value as #country_count_hash" do
expect(country_map.send(:location_count_hash)).to eq(country_map.send(:country_count_hash))
end
it "should not return the same value as #city_count_hash" do
expect(country_map.send(:location_count_hash)).not_to eq(country_map.send(:city_count_hash))
end
end
end #location_count_hash
describe "#city_count_hash" do
it "returns the correct hash with count" do
expect(city_map.city_count_hash).to eq({"New York, NY, USA"=>1, "New Jersey, USA"=>1, "Location Unknown"=>1})
end
end
describe "#country_count_hash" do
it "returns the correct hash with count" do
expect(country_map.country_count_hash).to eq({"United States"=>2, "Location Unknown"=>1})
end
end
describe "#markers" do
it "should return an instance of GoogleVisualr::DataTable" do
expect(country_map.send(:markers).class).to eq(GoogleVisualr::DataTable)
end
end
describe "#options_based_upon_type" do
context "when map type is city" do
it "should return the city options hash" do
expect(city_map.send(:options_based_upon_type)).to eq(Map::CITY_OPTIONS)
end
end
context "when map type is country" do
it "should return the country options hash" do
expect(country_map.send(:options_based_upon_type)).to eq(Map::COUNTRY_OPTIONS)
end
end
end
end # private methods
end # instance methods
end
| 33.164384 | 119 | 0.610905 |
3c85815b641e5a567075a7287927a714cb308a55
| 6,395 |
rs
|
Rust
|
src/bin/peroxide.rs
|
mwatts/peroxide
|
586084a8e4d9c345db5e0441eadf8c7eac1e0af0
|
[
"Apache-2.0"
] | 12 |
2020-03-26T23:03:17.000Z
|
2021-12-06T02:13:30.000Z
|
src/bin/peroxide.rs
|
mwatts/peroxide
|
586084a8e4d9c345db5e0441eadf8c7eac1e0af0
|
[
"Apache-2.0"
] | 6 |
2020-07-02T16:54:57.000Z
|
2021-12-07T08:28:40.000Z
|
src/bin/peroxide.rs
|
mwatts/peroxide
|
586084a8e4d9c345db5e0441eadf8c7eac1e0af0
|
[
"Apache-2.0"
] | 2 |
2020-12-15T02:15:17.000Z
|
2021-10-16T20:32:38.000Z
|
// Copyright 2018-2020 Matthieu Felix
//
// 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.
extern crate clap;
extern crate core;
extern crate log;
extern crate peroxide;
extern crate pretty_env_logger;
extern crate rustyline;
use std::env;
use std::str::FromStr;
use clap::{App, Arg};
use peroxide::heap::GcMode;
use peroxide::lex::{SegmentationResult, Token};
use peroxide::repl::{FileRepl, GetLineError, ReadlineRepl, Repl, StdIoRepl};
use peroxide::Interpreter;
fn main() {
pretty_env_logger::init();
let args: Vec<String> = env::args().collect();
match do_main(args) {
Err(e) => {
println!("error: {}", e);
std::process::exit(1)
}
Ok(()) => std::process::exit(0),
}
}
fn do_main(args: Vec<String>) -> Result<(), String> {
let options = parse_args(&args.iter().map(|x| &**x).collect::<Vec<_>>())
.map_err(|e| format!("could not parse arguments: {}", e))?;
let silent = options.input_file.is_some();
let mut repl: Box<dyn Repl> = match options.input_file {
Some(f) => Box::new(FileRepl::new(&f)?),
None => {
if options.enable_readline {
Box::new(ReadlineRepl::new(Some("history.txt".to_string())))
} else {
Box::new(StdIoRepl {})
}
}
};
let interpreter = Interpreter::new(options.gc_mode);
let interruptor_clone = interpreter.interruptor();
ctrlc::set_handler(move || {
interruptor_clone.interrupt();
})
.map_err(|e| format!("error setting Ctrl+C handler: {}", e.to_string()))?;
if let Some(path) = options.stdlib_file {
interpreter.initialize(&path)?;
}
loop {
if !handle_one_expr_wrap(&mut *repl, &interpreter, silent) {
break;
}
}
repl.save_history();
Ok(())
}
// Returns true if the REPL loop should continue, false otherwise.
fn handle_one_expr_wrap(repl: &mut dyn Repl, vm_state: &Interpreter, silent: bool) -> bool {
handle_one_expr(repl, vm_state, silent)
.map_err(|e| println!("Error: {}", e))
.unwrap_or(true)
}
fn handle_one_expr(
repl: &mut dyn Repl,
vm_state: &Interpreter,
silent: bool,
) -> Result<bool, String> {
let mut current_expr_string: Vec<String> = Vec::new();
let mut exprs: Vec<Vec<Token>> = Vec::new();
let mut pending_expr: Vec<Token> = Vec::new();
let mut depth: u64 = 0;
loop {
let line_opt = if pending_expr.is_empty() {
repl.get_line(">>> ", "")
} else {
repl.get_line("... ", &" ".to_string().repeat((depth * 2) as usize))
};
match line_opt {
Err(GetLineError::Eof) => return Ok(false),
Err(GetLineError::Interrupted) => return Ok(false),
Err(GetLineError::Err(s)) => {
println!("Readline error: {}", s);
return Ok(true);
}
Ok(_) => (),
};
let line = line_opt.unwrap();
let mut tokenize_result = peroxide::lex::lex(&line)?;
current_expr_string.push(line);
pending_expr.append(&mut tokenize_result);
let SegmentationResult {
mut segments,
remainder,
depth: new_depth,
} = peroxide::lex::segment(pending_expr)?;
exprs.append(&mut segments);
if remainder.is_empty() {
break;
}
depth = new_depth;
pending_expr = remainder;
}
repl.add_to_history(¤t_expr_string.join("\n"));
let _ = rep(vm_state, exprs, silent);
Ok(true)
}
fn rep(vm_state: &Interpreter, toks: Vec<Vec<Token>>, silent: bool) -> Result<(), ()> {
for token_vector in toks {
let parse_value = peroxide::read::read_tokens(&vm_state.arena, &token_vector)
.map_err(|e| println!("parse error: {:?}", e))?;
match vm_state.parse_compile_run(parse_value) {
Ok(v) => {
if !silent {
println!(" => {}", v.pp().pretty_print())
}
}
Err(e) => println!("{}", e),
}
}
Ok(())
}
#[derive(Debug)]
struct Options {
pub enable_readline: bool,
pub stdlib_file: Option<String>,
pub input_file: Option<String>,
pub gc_mode: GcMode,
}
fn parse_args(args: &[&str]) -> Result<Options, String> {
let matches = App::new("Peroxide")
.version("0.1")
.author("Matthieu Felix <matthieufelix@gmail.com>")
.arg(
Arg::with_name("no-std")
.long("no-std")
.help("Do not load the standard library"),
)
.arg(
Arg::with_name("stdlib-file")
.long("stdlib-file")
.takes_value(true)
.conflicts_with("no-std")
.help("Specify a file to load as the standard library"),
)
.arg(
Arg::with_name("no-readline")
.long("no-readline")
.help("Disable readline library"),
)
.arg(
Arg::with_name("gc-mode")
.long("gc-mode")
.possible_values(&["off", "normal", "debug", "debug-heavy"])
.default_value("normal"),
)
.arg(Arg::with_name("input-file").help("Sets the input file to use"))
.get_matches_from(args);
let stdlib_file = if matches.is_present("no-std") {
None
} else {
let stdlib_file = matches
.value_of("stdlib-file")
.unwrap_or("src/scheme-lib/init.scm");
Some(stdlib_file.to_string())
};
Ok(Options {
enable_readline: !matches.is_present("no-readline"),
stdlib_file,
input_file: matches.value_of("input-file").map(|v| v.to_string()),
gc_mode: GcMode::from_str(matches.value_of("gc-mode").unwrap()).unwrap(),
})
}
| 30.452381 | 92 | 0.565598 |
486a2b7f47cba39f9b29bad167eb9c49ab5f1b03
| 480 |
kt
|
Kotlin
|
core/src/main/kotlin/net/dummydigit/qbranch/generic/SetT.kt
|
fuzhouch/qbranch
|
e126f99a6c8db6c1f998d1ddb0dc6c85b2ecb896
|
[
"MIT"
] | 2 |
2017-08-21T05:51:23.000Z
|
2019-05-21T09:29:12.000Z
|
core/src/main/kotlin/net/dummydigit/qbranch/generic/SetT.kt
|
fuzhouch/qbranch
|
e126f99a6c8db6c1f998d1ddb0dc6c85b2ecb896
|
[
"MIT"
] | null | null | null |
core/src/main/kotlin/net/dummydigit/qbranch/generic/SetT.kt
|
fuzhouch/qbranch
|
e126f99a6c8db6c1f998d1ddb0dc6c85b2ecb896
|
[
"MIT"
] | 1 |
2017-10-16T05:49:53.000Z
|
2017-10-16T05:49:53.000Z
|
// Licensed under the MIT license. See LICENSE file in the project root
// for full license information.
package net.dummydigit.qbranch.generic
class SetT<E : Any>(val elementT: QTypeArg<E>) : QTypeArg<MutableSet<E>>, ContainerTypeArg<E> {
private val refObj = newInstance()
override fun newInstance(): MutableSet<E> = mutableSetOf()
override fun getGenericType() : Class<MutableSet<E>> = refObj.javaClass
override fun newElement(): E = elementT.newInstance()
}
| 40 | 95 | 0.735417 |
d0397a68f6dc1fdaaf78beab207287793e0acf72
| 107 |
css
|
CSS
|
public/css/footer.css
|
svennijhuis/Blok-Tech-GamingBuddy
|
17af6d614dbda88c5e5a428b45c5f490a284b4fc
|
[
"MIT"
] | 2 |
2022-03-21T10:41:42.000Z
|
2022-03-22T12:33:52.000Z
|
public/css/footer.css
|
svennijhuis/Blok-Tech-GamingBuddy
|
17af6d614dbda88c5e5a428b45c5f490a284b4fc
|
[
"MIT"
] | 7 |
2022-03-22T10:53:43.000Z
|
2022-03-31T12:26:51.000Z
|
public/css/footer.css
|
svennijhuis/Blok-Tech-GamingBuddy
|
17af6d614dbda88c5e5a428b45c5f490a284b4fc
|
[
"MIT"
] | null | null | null |
footer{
padding: 3em 0;
display: flex;
justify-content: center;
color: var(--tekst);
}
| 17.833333 | 29 | 0.570093 |
169eac229b2c58d3977d3551eeb8d13e6c94332c
| 1,251 |
c
|
C
|
ft_memcpy.c
|
kajun1337/libft
|
d80fa31940868db3a10b7be5365a9fba7ed9eea8
|
[
"MIT"
] | 4 |
2022-02-28T11:16:08.000Z
|
2022-03-02T13:11:45.000Z
|
ft_memcpy.c
|
kajun1337/libft
|
d80fa31940868db3a10b7be5365a9fba7ed9eea8
|
[
"MIT"
] | null | null | null |
ft_memcpy.c
|
kajun1337/libft
|
d80fa31940868db3a10b7be5365a9fba7ed9eea8
|
[
"MIT"
] | null | null | null |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: muhozkan <muhozkan@student.42.tr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/02/19 16:12:41 by muhozkan #+# #+# */
/* Updated: 2022/02/25 23:19:20 by muhozkan ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memcpy(void *dest, const void *src, size_t n)
{
unsigned char *str1;
const unsigned char *str2;
if (!dest && !src)
return (0);
str1 = dest;
str2 = src;
while (n-- > 0)
{
*str1++ = *str2++;
}
return (dest);
}
/*
src hafıza bölgesinden n byte ı dst hafıza bölgesine kopyalar.
dst ve src çakışırsa tanımsız olur.
*/
| 36.794118 | 80 | 0.263789 |
f07b5eca3f7289532613d620912c4a5a90c2b863
| 558 |
js
|
JavaScript
|
1.resz/routes/users.js
|
gmaster0o0/AuthmeNodeTutorial
|
27fa1b72e542ed7a9cdf5b76c582a96e3220611f
|
[
"MIT"
] | 4 |
2019-09-19T12:01:50.000Z
|
2020-08-09T03:20:07.000Z
|
1.resz/routes/users.js
|
gmaster0o0/AuthmeNodeTutorial
|
27fa1b72e542ed7a9cdf5b76c582a96e3220611f
|
[
"MIT"
] | 4 |
2021-05-10T16:05:55.000Z
|
2021-05-11T22:03:53.000Z
|
1.resz/routes/users.js
|
gmaster0o0/AuthmeNodeTutorial
|
27fa1b72e542ed7a9cdf5b76c582a96e3220611f
|
[
"MIT"
] | 3 |
2019-10-12T20:00:32.000Z
|
2020-02-08T12:27:07.000Z
|
const express = require('express');
const router = express.Router();
const mysqlConnection = require('../config/mysqlConnection');
const AppError = require('../utils/error');
/* GET users listing. */
router.get('/', async function(req, res, next) {
try {
const connection = await mysqlConnection.connect();
const results = connection.query('SELECT * FROM `authme`');
res.json({
status: 'success',
data: results
});
} catch (error) {
console.log(error);
AppError(res, error, 500);
}
});
module.exports = router;
| 22.32 | 63 | 0.639785 |
7a61cd4baf6c5954633f02fb8f7570068e3a6efa
| 208 |
asm
|
Assembly
|
libsrc/_DEVELOPMENT/math/float/am9511/lam32/c/sccz80/fmin.asm
|
ahjelm/z88dk
|
c4de367f39a76b41f6390ceeab77737e148178fa
|
[
"ClArtistic"
] | 640 |
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/_DEVELOPMENT/math/float/am9511/lam32/c/sccz80/fmin.asm
|
C-Chads/z88dk
|
a4141a8e51205c6414b4ae3263b633c4265778e6
|
[
"ClArtistic"
] | 1,600 |
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/_DEVELOPMENT/math/float/am9511/lam32/c/sccz80/fmin.asm
|
C-Chads/z88dk
|
a4141a8e51205c6414b4ae3263b633c4265778e6
|
[
"ClArtistic"
] | 215 |
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
SECTION code_fp_am9511
PUBLIC fmin
EXTERN cam32_sccz80_fmin
defc fmin = cam32_sccz80_fmin
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _fmin
EXTERN cam32_sdcc_fmin
defc _fmin = cam32_sdcc_fmin
ENDIF
| 13.866667 | 30 | 0.822115 |
0bbab57a58980cab77be4152c0853746383805da
| 3,265 |
py
|
Python
|
examples/pincell_depletion/restart_depletion.py
|
norberto-schmidt/openmc
|
ff4844303154a68027b9c746300f5704f73e0875
|
[
"MIT"
] | 262 |
2018-08-09T21:27:03.000Z
|
2022-03-24T05:02:10.000Z
|
examples/pincell_depletion/restart_depletion.py
|
norberto-schmidt/openmc
|
ff4844303154a68027b9c746300f5704f73e0875
|
[
"MIT"
] | 753 |
2018-08-03T15:26:57.000Z
|
2022-03-29T23:54:48.000Z
|
examples/pincell_depletion/restart_depletion.py
|
norberto-schmidt/openmc
|
ff4844303154a68027b9c746300f5704f73e0875
|
[
"MIT"
] | 196 |
2018-08-06T13:41:14.000Z
|
2022-03-29T20:47:12.000Z
|
import openmc
import openmc.deplete
import matplotlib.pyplot as plt
###############################################################################
# Load previous simulation results
###############################################################################
# Load geometry from statepoint
statepoint = 'statepoint.100.h5'
with openmc.StatePoint(statepoint) as sp:
geometry = sp.summary.geometry
# Load previous depletion results
previous_results = openmc.deplete.ResultsList.from_hdf5("depletion_results.h5")
###############################################################################
# Transport calculation settings
###############################################################################
# Instantiate a Settings object, set all runtime parameters
settings = openmc.Settings()
settings.batches = 100
settings.inactive = 10
settings.particles = 10000
# Create an initial uniform spatial source distribution over fissionable zones
bounds = [-0.62992, -0.62992, -1, 0.62992, 0.62992, 1]
uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:], only_fissionable=True)
settings.source = openmc.source.Source(space=uniform_dist)
entropy_mesh = openmc.RegularMesh()
entropy_mesh.lower_left = [-0.39218, -0.39218, -1.e50]
entropy_mesh.upper_right = [0.39218, 0.39218, 1.e50]
entropy_mesh.dimension = [10, 10, 1]
settings.entropy_mesh = entropy_mesh
###############################################################################
# Initialize and run depletion calculation
###############################################################################
# Create depletion "operator"
chain_file = './chain_simple.xml'
op = openmc.deplete.Operator(geometry, settings, chain_file, previous_results)
# Perform simulation using the predictor algorithm
time_steps = [1.0, 1.0, 1.0, 1.0, 1.0] # days
power = 174 # W/cm, for 2D simulations only (use W for 3D)
integrator = openmc.deplete.PredictorIntegrator(op, time_steps, power, timestep_units='d')
integrator.integrate()
###############################################################################
# Read depletion calculation results
###############################################################################
# Open results file
results = openmc.deplete.ResultsList.from_hdf5("depletion_results.h5")
# Obtain K_eff as a function of time
time, keff = results.get_eigenvalue()
# Obtain U235 concentration as a function of time
time, n_U235 = results.get_atoms('1', 'U235')
# Obtain Xe135 capture reaction rate as a function of time
time, Xe_capture = results.get_reaction_rate('1', 'Xe135', '(n,gamma)')
###############################################################################
# Generate plots
###############################################################################
days = 24*60*60
plt.figure()
plt.plot(time/days, keff, label="K-effective")
plt.xlabel("Time (days)")
plt.ylabel("Keff")
plt.show()
plt.figure()
plt.plot(time/days, n_U235, label="U 235")
plt.xlabel("Time (days)")
plt.ylabel("n U5 (-)")
plt.show()
plt.figure()
plt.plot(time/days, Xe_capture, label="Xe135 capture")
plt.xlabel("Time (days)")
plt.ylabel("RR (-)")
plt.show()
plt.close('all')
| 35.879121 | 90 | 0.543951 |
280160e5bf397f0df2614733e15cbe29cef36951
| 1,952 |
swift
|
Swift
|
MoyaRESTfulEx/Ex/RestfulOAuthApi.swift
|
Rdxer/FastComponent
|
a815c978d1cc9a6c46167ae80b1ab6de83f5482b
|
[
"MIT"
] | null | null | null |
MoyaRESTfulEx/Ex/RestfulOAuthApi.swift
|
Rdxer/FastComponent
|
a815c978d1cc9a6c46167ae80b1ab6de83f5482b
|
[
"MIT"
] | null | null | null |
MoyaRESTfulEx/Ex/RestfulOAuthApi.swift
|
Rdxer/FastComponent
|
a815c978d1cc9a6c46167ae80b1ab6de83f5482b
|
[
"MIT"
] | null | null | null |
//
// RestfulOAuth.swift
// XXSync
//
// Created by Rdxer on 2017/8/10.
// Copyright © 2017年 Rdxer. All rights reserved.
//
import Foundation
import Moya
public var baseURLString = ""
public enum RestfulOAuthApi {
case oauth(
userName:String,
password:String,
client_id:String,
client_secret:String
)
}
extension RestfulOAuthApi:TargetType{
public var headers: [String : String]? {
return [:]
}
public var baseURL: URL {
return URL.init(string: baseURLString)!
}
public var path: String {
switch self {
case .oauth(userName: _, password: _, client_id: _, client_secret: _):
return "oauth/token"
default: return ""
}
}
/// The HTTP method used in the request.
/// 请求中使用的HTTP方法。
public var method: Moya.Method {
switch self {
case .oauth(userName: _, password: _, client_id: _, client_secret: _):
return .post
default:
return .get
}
}
public var parameters: [String: Any]? {
switch self {
case .oauth(let userName,let password,let client_id,let client_secret):
return [
"grant_type":"password",
"client_id":client_id,
"client_secret":client_secret,
"username":userName.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines),
"password":password.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)
]
default:
return nil
}
}
/// 方法用于参数编码。
public var parameterEncoding: ParameterEncoding {
return URLEncoding.default
}
/// 提供存根数据用于测试。
public var sampleData: Data {
return "".data(using: String.Encoding.utf8)!
}
/// 执行HTTP任务的类型。
public var task: Task {
return Task.requestPlain
}
}
| 23.518072 | 96 | 0.573258 |
7088fe771d8228c23de06a32edb6d7da07d7f193
| 3,437 |
go
|
Go
|
cryptohack/badges.go
|
thibaultserti/badges
|
b51155abc9a0d70d112e863f7279cba9043d118b
|
[
"MIT"
] | 2 |
2021-03-01T15:00:43.000Z
|
2022-03-09T14:18:44.000Z
|
cryptohack/badges.go
|
thibaultserti/badges
|
b51155abc9a0d70d112e863f7279cba9043d118b
|
[
"MIT"
] | 6 |
2021-02-27T09:11:14.000Z
|
2022-03-02T10:08:18.000Z
|
cryptohack/badges.go
|
thibaultserti/badges
|
b51155abc9a0d70d112e863f7279cba9043d118b
|
[
"MIT"
] | null | null | null |
package cryptohack
import (
"log"
"github.com/fogleman/gg"
"github.com/golang/freetype/truetype"
"github.com/nfnt/resize"
"github.com/thibaultserti/badges/common"
"golang.org/x/image/font/gofont/goregular"
)
const width, height = 400, 160
// CreateCryptohackBadge creates the cryptohack badge
func CreateCryptohackBadge(username string, theme string, filename string) error {
colorBG := new(common.Color)
colorFG := new(common.Color)
if theme == "dark" {
colorBG.R, colorBG.G, colorBG.B = 12./255., 18./255., 33./255.
colorFG.R, colorFG.G, colorFG.B = 1, 1, 1
} else if theme == "light" {
colorBG.R, colorBG.G, colorBG.B = 1, 1, 1
colorFG.R, colorFG.G, colorFG.B = 240./255., 78./255., 35./255.
}
// load images
logoCryptohack, err := gg.LoadImage("cryptohack/images/cryptohack.png")
if err != nil {
log.Fatal(err)
}
nameCryptohack, err := gg.LoadImage("cryptohack/images/cryptohack-name-" + theme + ".png")
if err != nil {
log.Fatal(err)
}
userCryptohack, err := gg.LoadImage("cryptohack/images/user.png")
if err != nil {
log.Fatal(err)
}
// load icons
star, err := gg.LoadImage("icons/star.png")
if err != nil {
log.Fatal(err)
}
thunder, err := gg.LoadImage("icons/thunder.png")
if err != nil {
log.Fatal(err)
}
stats, err := gg.LoadImage("icons/stats.png")
if err != nil {
log.Fatal(err)
}
trophy, err := gg.LoadImage("icons/trophy.png")
if err != nil {
log.Fatal(err)
}
// resize images
logoCryptohack = resize.Resize(0, 0.4*height, logoCryptohack, resize.Lanczos3)
nameCryptohack = resize.Resize(0, 0.175*height, nameCryptohack, resize.Lanczos3)
userCryptohack = resize.Resize(0, 0.8*height, userCryptohack, resize.Lanczos3)
star = resize.Resize(width/20, 0, star, resize.Lanczos3)
thunder = resize.Resize(width/20, 0, thunder, resize.Lanczos3)
stats = resize.Resize(width/20, 0, stats, resize.Lanczos3)
trophy = resize.Resize(width/20, 0, trophy, resize.Lanczos3)
// crawl profile
profile := getProfileCrawling(username)
// setup fonts
font, err := truetype.Parse(goregular.TTF)
fontUsername := truetype.NewFace(font, &truetype.Options{Size: width / 16})
fontOther := truetype.NewFace(font, &truetype.Options{Size: width / 28})
dc := gg.NewContext(width, height)
// set background color
dc.SetRGB(colorBG.R, colorBG.G, colorBG.B)
dc.Clear()
// set font color
dc.SetRGB(colorFG.R, colorFG.G, colorFG.B)
// set username text
dc.SetFontFace(fontUsername)
dc.DrawStringAnchored(profile.username, width/2, height/4, 0.5, 0.5)
// write other text
dc.SetFontFace(fontOther)
dc.DrawStringAnchored("Level: "+profile.level, width/5, 0.85*height, 0.4, 0.5)
dc.DrawImageAnchored(thunder, 0.1*width, 0.85*height, 0.5, 0.5)
dc.DrawStringAnchored(profile.score+" points", width/2, 0.45*height, 0.4, 0.5)
dc.DrawImageAnchored(star, 0.4*width, 0.45*height, 0.5, 0.5)
dc.DrawStringAnchored(profile.rank+"/"+profile.nbTotalUsers, width/2, 0.6*height, 0.4, 0.5)
dc.DrawImageAnchored(trophy, 0.4*width, 0.6*height, 0.5, 0.5)
dc.DrawStringAnchored("TOP "+profile.rankRelative, width/2, 0.75*height, 0.4, 0.5)
dc.DrawImageAnchored(stats, 0.4*width, 0.75*height, 0.5, 0.5)
// draw images
dc.DrawImageAnchored(logoCryptohack, 6*width/7, height/3, 0.5, 0.5)
dc.DrawImageAnchored(nameCryptohack, 4*width/5, 0.9*height, 0.5, 0.5)
dc.DrawImageAnchored(userCryptohack, width/5, height/2, 0.5, 0.6)
err = dc.SavePNG(filename) // save it
return err
}
| 31.53211 | 92 | 0.701775 |
9ba2aecd16943c472c4c9d37f0e66eb405010d19
| 37 |
js
|
JavaScript
|
extension-create/demo-extension/options/options1.js
|
cezaraugusto/browser-extension-test-data
|
f0274ca4fb79a7b086c351d814898d21d23bb62c
|
[
"Naumen",
"Condor-1.1",
"MS-PL"
] | 18 |
2020-12-08T02:51:14.000Z
|
2022-03-11T10:59:17.000Z
|
fixtures/demo-extension/options/options1.js
|
cezaraugusto/webpack-run-edge-extension
|
1ee1101e7912f60b21603ae97b56b22ac6e615b1
|
[
"MIT"
] | 6 |
2020-12-08T05:50:17.000Z
|
2021-01-24T18:00:48.000Z
|
fixtures/demo-extension/options/options1.js
|
cezaraugusto/webpack-run-edge-extension
|
1ee1101e7912f60b21603ae97b56b22ac6e615b1
|
[
"MIT"
] | 2 |
2021-03-03T04:12:39.000Z
|
2021-10-02T10:26:28.000Z
|
console.log('options script loaded')
| 18.5 | 36 | 0.783784 |
d8330f03a432c304cba0405847f321d0f1dac00f
| 845 |
swift
|
Swift
|
SwiftFeed/OverlayIndicator.swift
|
Piliwiwi/Swift-PureJsonSerializer
|
4e3ea28f7ee7173cbc418c0fc8fd57af965db677
|
[
"Apache-2.0"
] | 35 |
2015-01-05T01:56:18.000Z
|
2016-01-15T03:14:17.000Z
|
SwiftFeed/OverlayIndicator.swift
|
Piliwiwi/Swift-PureJsonSerializer
|
4e3ea28f7ee7173cbc418c0fc8fd57af965db677
|
[
"Apache-2.0"
] | 13 |
2016-01-15T08:30:03.000Z
|
2016-12-07T14:28:26.000Z
|
SwiftFeed/OverlayIndicator.swift
|
Piliwiwi/Swift-PureJsonSerializer
|
4e3ea28f7ee7173cbc418c0fc8fd57af965db677
|
[
"Apache-2.0"
] | 17 |
2016-01-23T02:32:38.000Z
|
2020-03-05T14:56:13.000Z
|
//
// OverlapIndicator.swift
// JsonSerializer
//
// Created by Fuji Goro on 2014/09/21.
// Copyright (c) 2014年 Fuji Goro. All rights reserved.
//
import UIKit
public class OverlayIndicator {
let overlay: UIActivityIndicatorView
public init() {
let window = UIApplication.sharedApplication().keyWindow!
overlay = UIActivityIndicatorView(activityIndicatorStyle: .Gray)
overlay.frame = window.frame
overlay.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.1)
window.addSubview(overlay)
overlay.startAnimating()
}
deinit {
let v = self.overlay
UIView.animateWithDuration(0.1,
animations: {
v.alpha = 0
},
completion: { (_) -> Void in
v.removeFromSuperview()
})
}
}
| 24.142857 | 80 | 0.6 |
0bd156c3187afbbb2b5232d091d6df24ad90beaa
| 1,483 |
js
|
JavaScript
|
07-Migrando_Funcionalidades/public/js/chat.js
|
joaonunesdev/websockets
|
b9a49c78ea4f63844e7b05d7a0a39c6cc2ca9ea0
|
[
"ISC"
] | null | null | null |
07-Migrando_Funcionalidades/public/js/chat.js
|
joaonunesdev/websockets
|
b9a49c78ea4f63844e7b05d7a0a39c6cc2ca9ea0
|
[
"ISC"
] | 1 |
2021-05-10T17:50:58.000Z
|
2021-05-10T17:50:58.000Z
|
07-Migrando_Funcionalidades/public/js/chat.js
|
joaonunesdev/websockets
|
b9a49c78ea4f63844e7b05d7a0a39c6cc2ca9ea0
|
[
"ISC"
] | null | null | null |
const socket = io()
// Recupera os elementos da página de chat
const $messageForm = document.querySelector('#message-form')
const $messageFormInput = $messageForm.querySelector('input')
const $messageFormButton = $messageForm.querySelector('button')
const $sendLocationButton = document.querySelector('#send-location')
const $messages = document.querySelector('#messages')
// Templates
const $messageTemplate = document.querySelector('#message-template').innerHTML
const $locationMessageTemplate = document.querySelector('#location-message-template').innerHTML
const $sidebarTemplate = document.querySelector('#sidebar-template').innerHTML
// Função auxiliar que cria uma sequência aleatória de caracteres
// Será removida em seguida
const generateFakeName = () => {
const nameLength = 5
var fakeName = ''
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
var charactersLength = characters.length
for (var i = 0; i < nameLength; i++) {
fakeName += characters.charAt(Math.floor(Math.random() * charactersLength))
}
return fakeName
}
socket.emit('join', { username: generateFakeName(), room: 'virtus1' }, error => {
if (error) {
alert(error)
location.href = '/';
}
})
socket.on('message', ({ username, text, createdAt }) => {
const html = Mustache.render($messageTemplate, {
username,
text,
createdAt: moment(createdAt).format('h:mm a')
});
$messages.insertAdjacentHTML('beforeend', html);
})
| 32.955556 | 95 | 0.729602 |
a9125c1cfb666f4c01d2a7c29b52c909f2196ce0
| 317 |
sql
|
SQL
|
Base/home/anon/Documents/sql/select_from_table.sql
|
r00ster91/serenity
|
f8387dea2689d564aff612bfd4ec5086393fac35
|
[
"BSD-2-Clause"
] | 19,438 |
2019-05-20T15:11:11.000Z
|
2022-03-31T23:31:32.000Z
|
Base/home/anon/Documents/sql/select_from_table.sql
|
r00ster91/serenity
|
f8387dea2689d564aff612bfd4ec5086393fac35
|
[
"BSD-2-Clause"
] | 7,882 |
2019-05-20T01:03:52.000Z
|
2022-03-31T23:26:31.000Z
|
Base/home/anon/Documents/sql/select_from_table.sql
|
r00ster91/serenity
|
f8387dea2689d564aff612bfd4ec5086393fac35
|
[
"BSD-2-Clause"
] | 2,721 |
2019-05-23T00:44:57.000Z
|
2022-03-31T22:49:34.000Z
|
CREATE SCHEMA TestSchema;
CREATE TABLE TestSchema.TestTable
(
TextColumn text,
IntColumn integer
);
INSERT INTO TestSchema.TestTable (TextColumn, IntColumn)
VALUES ('Test_1', 42),
('Test_3', 44),
('Test_2', 43),
('Test_4', 45),
('Test_5', 46);
SELECT *
FROM TestSchema.TestTable;
| 21.133333 | 56 | 0.646688 |
5b0ab12a6731f69855a98f5eb808c612fb5da366
| 415 |
h
|
C
|
src/ftpclient/ftpclient.h
|
yangzhiyuan0928/FTP
|
117b626727f1dd72525d80e2bb782f9cf93cbcec
|
[
"MIT"
] | null | null | null |
src/ftpclient/ftpclient.h
|
yangzhiyuan0928/FTP
|
117b626727f1dd72525d80e2bb782f9cf93cbcec
|
[
"MIT"
] | null | null | null |
src/ftpclient/ftpclient.h
|
yangzhiyuan0928/FTP
|
117b626727f1dd72525d80e2bb782f9cf93cbcec
|
[
"MIT"
] | null | null | null |
#ifndef __FTP_CLIENT_H_
#define __FTP_CLIENT_H_
#include "../util/util.h"
int read_reply(int sockfd);
void print_reply(int rspcode);
void ftpcli_login(int sockfd);
int ftpcli_send_cmd(int sockfd, struct command *cmd);
int ftpcli_read_command(char* buf, int size, struct command *cmd);
int ftpcli_open_conn(int sockfd);
int ftpcli_list(int sock_data, int sockfd);
int ftpcli_get(int sock_data, char* arg);
#endif
| 25.9375 | 66 | 0.783133 |
18bc61b3d2966ba56930e9786f8e9a16b6ba1642
| 6,126 |
sql
|
SQL
|
migrate/migrations/20180315113303-strict-rotation-state.sql
|
kanish671/goalert
|
592c2f4ed21be3be78816c377301372e0e88c6a0
|
[
"Apache-2.0"
] | 1,614 |
2019-06-11T19:55:39.000Z
|
2022-03-31T10:34:37.000Z
|
migrate/migrations/20180315113303-strict-rotation-state.sql
|
kanish671/goalert
|
592c2f4ed21be3be78816c377301372e0e88c6a0
|
[
"Apache-2.0"
] | 671 |
2019-06-14T16:01:41.000Z
|
2022-03-30T19:16:29.000Z
|
migrate/migrations/20180315113303-strict-rotation-state.sql
|
kanish671/goalert
|
592c2f4ed21be3be78816c377301372e0e88c6a0
|
[
"Apache-2.0"
] | 179 |
2019-06-11T20:17:06.000Z
|
2022-03-25T06:31:09.000Z
|
-- +migrate Up
ALTER TABLE rotation_state
DROP CONSTRAINT rotation_state_rotation_participant_id_fkey,
ADD CONSTRAINT rotation_state_rotation_participant_id_fkey
FOREIGN KEY (rotation_participant_id)
REFERENCES rotation_participants (id)
ON DELETE RESTRICT,
ALTER rotation_participant_id SET NOT NULL;
-- +migrate StatementBegin
CREATE OR REPLACE FUNCTION fn_set_rot_state_pos_on_active_change() RETURNS TRIGGER AS
$$
BEGIN
SELECT position INTO NEW.position
FROM rotation_participants
WHERE id = NEW.rotation_participant_id;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';
-- +migrate StatementEnd
-- +migrate StatementBegin
CREATE OR REPLACE FUNCTION fn_set_rot_state_pos_on_part_reorder() RETURNS TRIGGER AS
$$
BEGIN
UPDATE rotation_state
SET position = NEW.position
WHERE rotation_participant_id = NEW.id;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';
-- +migrate StatementEnd
ALTER TABLE rotations
ADD COLUMN participant_count INT NOT NULL DEFAULT 0;
-- +migrate StatementBegin
CREATE OR REPLACE FUNCTION fn_incr_part_count_on_add() RETURNS TRIGGER AS
$$
BEGIN
UPDATE rotations
SET participant_count = participant_count + 1
WHERE id = NEW.rotation_id;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';
-- +migrate StatementEnd
-- +migrate StatementBegin
CREATE OR REPLACE FUNCTION fn_decr_part_count_on_del() RETURNS TRIGGER AS
$$
BEGIN
UPDATE rotations
SET participant_count = participant_count - 1
WHERE id = OLD.rotation_id;
RETURN OLD;
END;
$$ LANGUAGE 'plpgsql';
-- +migrate StatementEnd
-- +migrate StatementBegin
CREATE OR REPLACE FUNCTION fn_start_rotation_on_first_part_add() RETURNS TRIGGER AS
$$
DECLARE
first_part UUID;
BEGIN
SELECT id
INTO first_part
FROM rotation_participants
WHERE rotation_id = NEW.rotation_id AND position = 0;
INSERT INTO rotation_state (
rotation_id, rotation_participant_id, shift_start
) VALUES (
NEW.rotation_id, first_part, now()
) ON CONFLICT DO NOTHING;
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';
-- +migrate StatementEnd
-- +migrate StatementBegin
CREATE OR REPLACE FUNCTION fn_advance_or_end_rot_on_part_del() RETURNS TRIGGER AS
$$
DECLARE
new_part UUID;
active_part UUID;
BEGIN
SELECT rotation_participant_id
INTO active_part
FROM rotation_state
WHERE rotation_id = OLD.rotation_id;
IF active_part != OLD.id THEN
RETURN OLD;
END IF;
SELECT id
INTO new_part
FROM rotation_participants
WHERE
rotation_id = OLD.rotation_id AND
id != OLD.id AND
position IN (0, OLD.position)
ORDER BY position DESC
LIMIT 1;
IF new_part ISNULL THEN
DELETE FROM rotation_state
WHERE rotation_id = OLD.rotation_id;
ELSE
UPDATE rotation_state
SET rotation_participant_id = new_part
WHERE rotation_id = OLD.rotation_id;
END IF;
RETURN OLD;
END;
$$ LANGUAGE 'plpgsql';
-- +migrate StatementEnd
LOCK rotation_participants;
WITH part_count AS (
SELECT rotation_id, count(*)
FROM rotation_participants
GROUP BY rotation_id
)
UPDATE rotations
SET participant_count = part_count.count
FROM part_count
WHERE part_count.rotation_id = rotations.id;
INSERT INTO rotation_state (rotation_id, rotation_participant_id, shift_start)
SELECT rotation_id, id, now()
FROM rotation_participants
WHERE position = 0
ON CONFLICT (rotation_id) DO NOTHING;
CREATE TRIGGER trg_set_rot_state_pos_on_active_change
BEFORE UPDATE ON rotation_state
FOR EACH ROW
WHEN (NEW.rotation_participant_id != OLD.rotation_participant_id)
EXECUTE PROCEDURE fn_set_rot_state_pos_on_active_change();
CREATE TRIGGER trg_set_rot_state_pos_on_part_reorder
BEFORE UPDATE ON rotation_participants
FOR EACH ROW
WHEN (NEW.position != OLD.position)
EXECUTE PROCEDURE fn_set_rot_state_pos_on_part_reorder();
CREATE TRIGGER trg_incr_part_count_on_add
BEFORE INSERT ON rotation_participants
FOR EACH ROW
EXECUTE PROCEDURE fn_incr_part_count_on_add();
CREATE TRIGGER trg_start_rotation_on_first_part_add
AFTER INSERT ON rotation_participants
FOR EACH ROW
EXECUTE PROCEDURE fn_start_rotation_on_first_part_add();
CREATE TRIGGER trg_10_decr_part_count_on_del
BEFORE DELETE ON rotation_participants
FOR EACH ROW
EXECUTE PROCEDURE fn_decr_part_count_on_del();
DROP TRIGGER trg_decr_rot_part_position_on_delete ON rotation_participants;
CREATE TRIGGER trg_20_decr_rot_part_position_on_delete
BEFORE DELETE ON rotation_participants
FOR EACH ROW
EXECUTE PROCEDURE fn_decr_rot_part_position_on_delete();
CREATE TRIGGER trg_30_advance_or_end_rot_on_part_del
BEFORE DELETE ON rotation_participants
FOR EACH ROW
EXECUTE PROCEDURE fn_advance_or_end_rot_on_part_del();
-- +migrate Down
ALTER TABLE rotation_state
ALTER rotation_participant_id DROP NOT NULL,
DROP CONSTRAINT rotation_state_rotation_participant_id_fkey,
ADD CONSTRAINT rotation_state_rotation_participant_id_fkey
FOREIGN KEY (rotation_participant_id)
REFERENCES rotation_participants (id)
ON DELETE SET NULL;
DROP TRIGGER trg_set_rot_state_pos_on_active_change ON rotation_state;
DROP TRIGGER trg_set_rot_state_pos_on_part_reorder ON rotation_participants;
DROP TRIGGER trg_incr_part_count_on_add ON rotation_participants;
DROP TRIGGER trg_start_rotation_on_first_part_add ON rotation_participants;
DROP TRIGGER trg_10_decr_part_count_on_del ON rotation_participants;
DROP TRIGGER trg_20_decr_rot_part_position_on_delete ON rotation_participants;
CREATE TRIGGER trg_decr_rot_part_position_on_delete
BEFORE DELETE ON rotation_participants
FOR EACH ROW
EXECUTE PROCEDURE fn_decr_rot_part_position_on_delete();
DROP TRIGGER trg_30_advance_or_end_rot_on_part_del ON rotation_participants;
DROP FUNCTION fn_set_rot_state_pos_on_active_change();
DROP FUNCTION fn_set_rot_state_pos_on_part_reorder();
DROP FUNCTION fn_incr_part_count_on_add();
DROP FUNCTION fn_decr_part_count_on_del();
DROP FUNCTION fn_start_rotation_on_first_part_add();
DROP FUNCTION fn_advance_or_end_rot_on_part_del();
ALTER TABLE rotations
DROP COLUMN participant_count;
| 27.106195 | 85 | 0.797094 |
b2bda88384a662721955747a1c788333f427aa38
| 6,822 |
py
|
Python
|
main.py
|
anurendra/Web_IE
|
4ba95320fd46d3c6fc090f3f095c7c7de78453bb
|
[
"Apache-2.0"
] | null | null | null |
main.py
|
anurendra/Web_IE
|
4ba95320fd46d3c6fc090f3f095c7c7de78453bb
|
[
"Apache-2.0"
] | null | null | null |
main.py
|
anurendra/Web_IE
|
4ba95320fd46d3c6fc090f3f095c7c7de78453bb
|
[
"Apache-2.0"
] | null | null | null |
import argparse
import numpy as np
import os
import random
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from datasets import custom_collate_fn, load_data, WebDataset
from models import WebObjExtractionNet
from train import train_model, evaluate_model
from utils import print_and_log
########## CMDLINE ARGS ##########
parser = argparse.ArgumentParser('Train Model')
parser.add_argument('-d', '--device', type=int, default=0)
parser.add_argument('-e', '--n_epochs', type=int, default=100)
parser.add_argument('-bb', '--backbone', type=str, default='alexnet', choices=['alexnet', 'resnet'])
parser.add_argument('-tc', '--trainable_convnet', type=int, default=1, choices=[0,1])
parser.add_argument('-lr', '--learning_rate', type=float, default=0.0005)
parser.add_argument('-bs', '--batch_size', type=int, default=25)
parser.add_argument('-cs', '--context_size', type=int, default=6)
parser.add_argument('-att', '--attention', type=int, default=1, choices=[0,1])
parser.add_argument('-hd', '--hidden_dim', type=int, default=300)
parser.add_argument('-r', '--roi', type=int, default=1)
parser.add_argument('-bbf', '--bbox_feat', type=int, default=1, choices=[0,1])
parser.add_argument('-wd', '--weight_decay', type=float, default=0)
parser.add_argument('-dp', '--drop_prob', type=float, default=0.5)
parser.add_argument('-mbb', '--max_bg_boxes', type=int, default=-1)
parser.add_argument('-nw', '--num_workers', type=int, default=8)
args = parser.parse_args()
device = torch.device('cuda:%d' % args.device if torch.cuda.is_available() else 'cpu')
########## MAKING RESULTS REPRODUCIBLE ##########
seed = 1
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
# torch.backends.cudnn.deterministic = True
# torch.backends.cudnn.benchmark = False
########## PARAMETERS ##########
N_CLASSES = 4
CLASS_NAMES = ['BG', 'Price', 'Title', 'Image']
IMG_HEIGHT = 1280 # Image assumed to have same height and width
EVAL_INTERVAL = 3 # Number of Epochs after which model is evaluated
NUM_WORKERS = args.num_workers # multithreaded data loading
DATA_DIR = '/shared/data_product_info/v2_8.3k/' # Contains .png and .pkl files for train and test data
OUTPUT_DIR = 'results_attn' # logs are saved here!
# NOTE: if same hyperparameter configuration is run again, previous log file and saved model will be overwritten
if not os.path.exists(OUTPUT_DIR):
os.makedirs(OUTPUT_DIR)
SPLIT_DIR = 'splits'
train_img_ids = np.loadtxt('%s/train_imgs.txt' % SPLIT_DIR, dtype=np.int32)
val_img_ids = np.loadtxt('%s/val_imgs.txt' % SPLIT_DIR, dtype=np.int32)
test_img_ids = np.loadtxt('%s/test_imgs.txt' % SPLIT_DIR, dtype=np.int32)
test_domains = np.loadtxt('%s/test_domains.txt' % SPLIT_DIR, dtype=str) # for calculating macro accuracy
########## HYPERPARAMETERS ##########
N_EPOCHS = args.n_epochs
BACKBONE = args.backbone
TRAINABLE_CONVNET = bool(args.trainable_convnet)
LEARNING_RATE = args.learning_rate
BATCH_SIZE = args.batch_size
CONTEXT_SIZE = args.context_size
USE_ATTENTION = bool(args.attention)
HIDDEN_DIM = args.hidden_dim
ROI_POOL_OUTPUT_SIZE = (args.roi, args.roi)
USE_BBOX_FEAT = bool(args.bbox_feat)
WEIGHT_DECAY = args.weight_decay
DROP_PROB = args.drop_prob
MAX_BG_BOXES = args.max_bg_boxes if args.max_bg_boxes > 0 else -1
params = '%s lr-%.0e batch-%d cs-%d att-%d hd-%d roi-%d bbf-%d wd-%.0e dp-%.2f mbb-%d' % (BACKBONE, LEARNING_RATE, BATCH_SIZE, CONTEXT_SIZE, USE_ATTENTION,
HIDDEN_DIM, ROI_POOL_OUTPUT_SIZE[0], USE_BBOX_FEAT, WEIGHT_DECAY, DROP_PROB, MAX_BG_BOXES)
log_file = '%s/%s logs.txt' % (OUTPUT_DIR, params)
test_acc_domainwise_file = '%s/%s test_acc_domainwise.csv' % (OUTPUT_DIR, params)
model_save_file = '%s/%s saved_model.pth' % (OUTPUT_DIR, params)
print('logs will be saved in \"%s\"' % (log_file))
print_and_log('Backbone Convnet: %s' % (BACKBONE), log_file, 'w')
print_and_log('Trainable Convnet: %s' % (TRAINABLE_CONVNET), log_file)
print_and_log('Learning Rate: %.0e' % (LEARNING_RATE), log_file)
print_and_log('Batch Size: %d' % (BATCH_SIZE), log_file)
print_and_log('Context Size: %d' % (CONTEXT_SIZE), log_file)
print_and_log('Attention: %s' % (USE_ATTENTION), log_file)
print_and_log('Hidden Dim: %d' % (HIDDEN_DIM), log_file)
print_and_log('RoI Pool Output Size: (%d, %d)' % ROI_POOL_OUTPUT_SIZE, log_file)
print_and_log('BBox Features: %s' % (USE_BBOX_FEAT), log_file)
print_and_log('Weight Decay: %.0e' % (WEIGHT_DECAY), log_file)
print_and_log('Dropout Probability: %.2f' % (DROP_PROB), log_file)
print_and_log('Max BG Boxes: %d\n' % (MAX_BG_BOXES), log_file)
########## DATA LOADERS ##########
train_loader, val_loader, test_loader = load_data(DATA_DIR, train_img_ids, val_img_ids, test_img_ids, CONTEXT_SIZE, BATCH_SIZE, NUM_WORKERS, MAX_BG_BOXES)
########## CREATE MODEL & LOSS FN ##########
model = WebObjExtractionNet(ROI_POOL_OUTPUT_SIZE, IMG_HEIGHT, N_CLASSES, BACKBONE, USE_ATTENTION, HIDDEN_DIM, TRAINABLE_CONVNET, DROP_PROB,
USE_BBOX_FEAT, CLASS_NAMES).to(device)
optimizer = optim.Adam(model.parameters(), lr=LEARNING_RATE, weight_decay=WEIGHT_DECAY)
criterion = nn.CrossEntropyLoss(reduction='sum').to(device)
########## TRAIN MODEL ##########
train_model(model, train_loader, optimizer, criterion, N_EPOCHS, device, val_loader, EVAL_INTERVAL, log_file, 'ckpt_%d.pth' % args.device)
########## EVALUATE TEST PERFORMANCE ##########
print('Evaluating test data class wise accuracies...')
evaluate_model(model, test_loader, criterion, device, 'TEST', log_file)
with open (test_acc_domainwise_file, 'w') as f:
f.write('Domain,N_examples,%s,%s,%s\n' % (CLASS_NAMES[1], CLASS_NAMES[2], CLASS_NAMES[3]))
print('Evaluating per domain accuracy for %d test domains...' % len(test_domains))
for domain in test_domains:
print('\n---> Domain:', domain)
test_dataset = WebDataset(DATA_DIR, np.loadtxt('%s/domain_wise_imgs/%s.txt' % (SPLIT_DIR, domain), np.int32).reshape(-1), CONTEXT_SIZE, max_bg_boxes=-1)
test_loader = DataLoader(test_dataset, batch_size=1, shuffle=False, num_workers=NUM_WORKERS, collate_fn=custom_collate_fn, drop_last=False)
per_class_acc = evaluate_model(model, test_loader, criterion, device, 'TEST')
with open (test_acc_domainwise_file, 'a') as f:
f.write('%s,%d,%.2f,%.2f,%.2f\n' % (domain, len(test_dataset), 100*per_class_acc[1], 100*per_class_acc[2], 100*per_class_acc[3]))
macro_acc_test = np.loadtxt(test_acc_domainwise_file, delimiter=',', skiprows=1, dtype=str)[:,2:].astype(np.float32).mean(0)
for i in range(1, len(CLASS_NAMES)):
print_and_log('%s Macro Acc: %.2f%%' % (CLASS_NAMES[i], macro_acc_test[i-1]), log_file)
########## SAVE MODEL ##########
torch.save(model.state_dict(), model_save_file)
print_and_log('Model can be restored from \"%s\"' % (model_save_file), log_file)
| 48.728571 | 156 | 0.726327 |
b3e2130e5ef4f58aca75d5e6257eb2ab8a014ec4
| 621 |
rb
|
Ruby
|
spec/models/gephi_import_spec.rb
|
EOL/seabase
|
4083a525cb4fcd4a4996117e5c930bd173748388
|
[
"MIT"
] | 3 |
2015-03-19T10:45:18.000Z
|
2019-07-31T15:34:17.000Z
|
spec/models/gephi_import_spec.rb
|
EOL/seabase
|
4083a525cb4fcd4a4996117e5c930bd173748388
|
[
"MIT"
] | null | null | null |
spec/models/gephi_import_spec.rb
|
EOL/seabase
|
4083a525cb4fcd4a4996117e5c930bd173748388
|
[
"MIT"
] | 2 |
2016-09-29T19:18:34.000Z
|
2019-02-02T20:43:03.000Z
|
describe GephiImport do
subject { GephiImport }
describe '.process_file' do
let(:file_path) { File.join(__dir__, '..', 'files', 'gephi_export.csv') }
let(:name) { 'Nematostella transcripts' }
before(:each) { truncate_db }
it 'processes csv file' do
expect(GephiImport.count).to eq 0
expect(Trace.count).to eq 0
expect(GephiRecord.count).to eq 0
gi = subject.process_file(file_path, name)
expect(GephiImport.count).to eq 1
expect(Trace.count).to eq 7
expect(GephiRecord.count).to eq 102
expect(gi).to be_kind_of(GephiImport)
end
end
end
| 24.84 | 77 | 0.652174 |
afd866d41a153223421b11cf17098950f5a3b52b
| 390 |
rb
|
Ruby
|
app/services/schemas/associations/validation/valid_connection.rb
|
NGLPteam/wdp-api
|
3136705f43a6c62cb8e229d7e0753c435956a461
|
[
"MIT"
] | 2 |
2022-03-11T22:38:37.000Z
|
2022-03-30T20:11:01.000Z
|
app/services/schemas/associations/validation/valid_connection.rb
|
NGLPteam/wdp-api
|
3136705f43a6c62cb8e229d7e0753c435956a461
|
[
"MIT"
] | 2 |
2021-09-24T23:19:27.000Z
|
2022-03-13T18:35:57.000Z
|
app/services/schemas/associations/validation/valid_connection.rb
|
NGLPteam/wdp-api
|
3136705f43a6c62cb8e229d7e0753c435956a461
|
[
"MIT"
] | null | null | null |
# frozen_string_literal: true
module Schemas
module Associations
module Validation
class ValidConnection < Dry::Struct
include Dry::Monads[:result]
attribute :parent, Schemas::Associations::Validation::Valid
attribute :child, Schemas::Associations::Validation::Valid
def to_monad
Success self
end
end
end
end
end
| 20.526316 | 67 | 0.658974 |
d98e71d63e7ec329c58b785c1245b11c91bcd862
| 5,374 |
rs
|
Rust
|
src/raw/parse.rs
|
mellon85/brokaw
|
a25c224ea72f70e2139bd54f23745b03ce73377c
|
[
"MIT"
] | 3 |
2020-06-12T23:20:46.000Z
|
2021-06-08T05:44:38.000Z
|
src/raw/parse.rs
|
mellon85/brokaw
|
a25c224ea72f70e2139bd54f23745b03ce73377c
|
[
"MIT"
] | 7 |
2020-06-19T20:49:41.000Z
|
2020-10-19T17:00:30.000Z
|
src/raw/parse.rs
|
mellon85/brokaw
|
a25c224ea72f70e2139bd54f23745b03ce73377c
|
[
"MIT"
] | 2 |
2020-09-11T08:27:07.000Z
|
2020-11-20T03:20:20.000Z
|
use std::convert::TryInto;
use nom::bytes::complete::take_until;
use nom::character::complete::{crlf, one_of};
use nom::combinator::all_consuming;
use nom::sequence::{terminated, tuple};
use nom::IResult;
/// The first line of an NNTP response
///
/// This struct contains data borrowed from a read buffer
#[derive(Clone, Copy, Debug, PartialEq)]
pub(crate) struct InitialResponseLine<'a> {
/// The response code
pub code: &'a [u8; 3],
/// The data within the response NOT including leading whitespace and terminator characters
pub data: &'a [u8],
/// The entire response including the response code and termination characters
pub buffer: &'a [u8],
}
/// Return true if the first character is a digit
fn one_of_digit(b: &[u8]) -> IResult<&[u8], char> {
one_of("0123456789")(b)
}
/// Takes a line from the input buffer
///
/// A "line" is a sequence of bytes terminated by a CRLF (`\r\n`) sequence.
fn take_line(b: &[u8]) -> IResult<&[u8], &[u8]> {
let (rest, line) = terminated(take_until("\r\n"), crlf)(b)?;
Ok((rest, line))
}
/// Takes a response code from the buffer
///
/// A valid response code is three ASCII digits where the first digit is between 1 and 5
fn take_response_code(b: &[u8]) -> IResult<&[u8], &[u8]> {
let res: IResult<_, (char, char, char)> =
tuple((one_of("12345"), one_of_digit, one_of_digit))(b);
let (rest, _) = res?;
Ok((rest, &b[0..3]))
}
/// Returns true if the buffer only contains a `.`
pub(crate) fn is_end_of_datablock(b: &[u8]) -> bool {
b == b"."
}
/// Parse an first line of an NNTP response
///
/// Per [RFC 3977](https://tools.ietf.org/html/rfc3977#section-3.2), the first line of an
/// NNTP response consists of a three-digit response code, a single space, and then
/// some text terminated with a CRLF.
pub(crate) fn parse_first_line(b: &[u8]) -> IResult<&[u8], InitialResponseLine<'_>> {
let res = all_consuming(tuple((
take_response_code,
nom::character::complete::char(' '),
take_until("\r\n"),
crlf,
)))(b)?;
let (rest, (code, _, data, _crlf)) = res;
let code = code
.try_into()
.expect("Code should be three bytes, there is likely a bug in the parser.");
Ok((
rest,
InitialResponseLine {
code,
data,
buffer: b,
},
))
}
/// Parse a data block line from the buffer
pub(crate) fn parse_data_block_line(b: &[u8]) -> IResult<&[u8], &[u8]> {
all_consuming(take_line)(b)
}
#[cfg(test)]
mod tests {
use super::*;
use nom::error::ErrorKind;
use nom::Err;
const MOTD: &[u8] =
b"200 news.example.com InterNetNews server INN 2.5.5 ready (transit mode)\r\n";
const MOTD_NO_CRLF: &[u8] =
b"200 news.example.com InterNetNews server INN 2.5.5 ready (transit mode)";
mod test_parse_initial_response {
use super::*;
#[test]
fn happy_path() {
let (_remainder, raw_response) = parse_first_line(MOTD).unwrap();
let expected_resp = InitialResponseLine {
code: b"200",
data: &b"news.example.com InterNetNews server INN 2.5.5 ready (transit mode)"[..],
buffer: &MOTD,
};
assert_eq!(raw_response, expected_resp)
}
#[test]
fn test_remaining_data() {
let data = [MOTD, &b"SOME MORE DATA\r\n"[..]].concat();
assert!(parse_first_line(&data).is_err());
}
}
mod test_take_line {
use super::*;
#[test]
fn happy_path() {
assert_eq!(take_line(MOTD), Ok((&b""[..], MOTD_NO_CRLF)));
}
#[test]
fn test_gzip() {
let header = include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/tests/xover_gzip_header"
));
let (rest, data) = take_line(header).unwrap();
assert_eq!(rest.len(), 0);
assert_eq!(data, &header[..header.len() - 2]);
}
}
mod test_parse_data_block {
use super::*;
#[test]
fn happy_path() {
let msg = b"101 Capability list:\r\n";
let (_remainder, block) = parse_data_block_line(msg).unwrap();
assert_eq!(block, b"101 Capability list:")
}
}
mod test_parse_response_code {
use super::*;
#[test]
fn happy_path() {
[
&b"200"[..],
&b"200 "[..],
&b"2000"[..],
&b"200000"[..],
&b"200123"[..],
&b"200abc"[..],
]
.iter()
.for_each(|input| {
let res = take_response_code(input);
assert!(res.is_ok());
let (_rest, code) = res.unwrap();
assert_eq!(code, b"200")
});
}
#[test]
fn too_short() {
println!("Testing {:?}", b"5");
assert_eq!(
take_response_code(b"5"),
Err(Err::Error((&b""[..], ErrorKind::OneOf)))
)
}
#[test]
fn not_enough_digits() {
assert_eq!(
take_response_code(b"5ab500"),
Err(Err::Error((&b"ab500"[..], ErrorKind::OneOf)))
)
}
}
}
| 28.136126 | 98 | 0.533122 |
beef916b241e3f22869e0ec53fe3e6b39601a27e
| 6,308 |
html
|
HTML
|
mdn/web/api/xrpermissiondescriptor/requiredfeatures/index.html
|
SKsakibul125/symmetrical-system
|
cb21d7a76d4821cc66dee6d41d12c1e0ef3a7335
|
[
"Unlicense"
] | 7 |
2021-08-20T00:30:13.000Z
|
2022-02-17T17:28:46.000Z
|
mdn/web/api/xrpermissiondescriptor/requiredfeatures/index.html
|
SKsakibul125/symmetrical-system
|
cb21d7a76d4821cc66dee6d41d12c1e0ef3a7335
|
[
"Unlicense"
] | 15 |
2021-07-30T18:48:20.000Z
|
2022-03-26T12:42:22.000Z
|
mdn/web/api/xrpermissiondescriptor/requiredfeatures/index.html
|
SKsakibul125/symmetrical-system
|
cb21d7a76d4821cc66dee6d41d12c1e0ef3a7335
|
[
"Unlicense"
] | 3 |
2021-08-31T00:50:25.000Z
|
2022-01-25T16:38:20.000Z
|
---
title: XRPermissionDescriptor.requiredFeatures
slug: Web/API/XRPermissionDescriptor/requiredFeatures
tags:
- API
- AR
- Mixed
- Permissions
- Property
- Reality
- Reference
- Reference Space
- VR
- Virtual
- WebXR
- WebXR API
- WebXR Device API
- XR
- XRPermissionDescriptor
- augmented
- features
- requiredFeatures
browser-compat: api.XRPermissionDescriptor.requiredFeatures
---
<p>{{APIRef("WebXR Device API")}}{{SecureContext_header}}</p>
<p>
<span class="seoSummary"
>The {{domxref("XRPermissionDescriptor")}} dictionary's <code
><strong>requiredFeatures</strong></code
> property should be set prior to calling {{domxref("permissions.query",
"navigator.permissions.query()")}} to a list of WebXR features which must be
supported for the app to work.</span
>
This ensures that permissions are checked as applicable to ensure that those
features are available upon request.
</p>
<h2 id="Syntax">Syntax</h2>
<pre class="brush: js"><em>xrPermissionDescriptor</em> = {
mode: <em>xrSessionMode</em>,
requiredFeatures: <em>reqFeatureList</em>,
optionalFeatures: <em>optFeatureList
</em>};
<em>xrPermissionDescriptor</em>.requiredFeatures = <em>reqFeatureList</em>;
<em>reqFeatureList</em> = <em>xrPermissionDescriptor</em>.requiredFeatures;</pre>
<h3 id="Value">Value</h3>
<p>
An array of strings indicating the WebXR features which <em>must</em> be
available for use by the app or site. The permissions check will be performed
in such a manner as to verify that all features in the list are available for
use with the user's permission.
</p>
<p>
Currently, all features indicate the reference space types that your app would
like permission to use. Future editions of WebXR may add more recognized
features.
</p>
<p>The permitted values are:</p>
<table class="standard-table" id="value-list">
<thead>
<tr>
<th scope="col">XRReferenceSpaceType</th>
<th scope="col">Description</th>
<th scope="col">Interface</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>bounded-floor</code></td>
<td>
Similar to the <code>local</code> type, except the user is not expected
to move outside a predetermined boundary, given by the
{{domxref("XRBoundedReferenceSpace.boundsGeometry", "boundsGeometry")}}
in the returned object.
</td>
<td>{{domxref("XRBoundedReferenceSpace")}}</td>
</tr>
<tr>
<td><code>local</code></td>
<td>
<p>
A tracking space whose native origin is located near the viewer's
position at the time the session was created. The exact position
depends on the underlying platform and implementation. The user isn't
expected to move much if at all beyond their starting position, and
tracking is optimized for this use case.
</p>
<p>
For devices with six degrees of freedom (6DoF) tracking, the
<code>local</code> reference space tries to keep the origin stable
relative to the environment.
</p>
</td>
<td>{{domxref("XRReferenceSpace")}}</td>
</tr>
<tr>
<td><code>local-floor</code></td>
<td>
Similar to the <code>local</code> type, except the starting position is
placed in a safe location for the viewer to stand, where the value of
the y axis is 0 at floor level. If that floor level isn't known, the
{{Glossary("user agent")}} will estimate the floor level. If the
estimated floor level is non-zero, the browser is expected to round it
such a way as to avoid fingerprinting (likely to the nearest
centimeter).
</td>
<td>{{domxref("XRReferenceSpace")}}</td>
</tr>
<tr>
<td><code>unbounded</code></td>
<td>
A tracking space which allows the user total freedom of movement,
possibly over extremely long distances from their origin point. The
viewer isn't tracked at all; tracking is optimized for stability around
the user's current position, so the native origin may drift as needed to
accommodate that need.
</td>
<td>{{domxref("XRReferenceSpace")}}</td>
</tr>
<tr>
<td><code>viewer</code></td>
<td>
A tracking space whose native origin tracks the viewer's position and
orientation. This is used for environments in which the user can
physically move around, and is supported by all instances of
{{domxref("XRSession")}}, both immersive and inline, though it's most
useful for inline sessions. It's particularly useful when determining
the distance between the viewer and an input, or when working with
offset spaces. Otherwise, typically, one of the other reference space
types will be used more often.
</td>
<td>{{domxref("XRReferenceSpace")}}</td>
</tr>
</tbody>
</table>
<h2 id="Examples">Examples</h2>
<p>
In this example, permissions are checked to ensure that the user has granted
permission for the site or app to use immersive augmented reality mode with
the <code>local-floor</code> reference space (presumably since the user is
unlikely to start to fly).
</p>
<pre class="brush: js">
let xrPermissionDesc = {
name: "xr",
mode: "immersive-ar",
requiredFeatures: [ "local-floor" ]
};
if (navigator.permissions) {
navigator.permissions.query(xrPermissionDesc).then(({state}) => {
switch(state) {
case "granted":
setupXR();
break;
case "prompt":
promptAndSetupXR();
break;
default:
/* do nothing otherwise */
break;
}
.catch(err) {
console.log(err);
}
} else {
setupXR();
}
</pre>
<h2 id="Specifications">Specifications</h2>
{{Specifications}}
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat}}</p>
<h2 id="See_also">See also</h2>
<ul>
<li>
<a href="/en-US/docs/Web/API/WebXR_Device_API/Permissions_and_security"
>Permissions and security for WebXR</a
>
</li>
<li>{{domxref("XRPermissionStatus")}}</li>
<li>
{{domxref("navigator.permissions")}} and
{{domxref("WorkerNavigator.permissions")}}
</li>
<li>{{domxref("Permissions")}}</li>
</ul>
| 30.47343 | 81 | 0.657895 |
b2b003035e799fc92e0fea8e8e2e11a735520bde
| 2,516 |
rs
|
Rust
|
git-ref/src/store/file/mod.rs
|
svetli-n/gitoxide
|
9f5663ed83d83c7335b346313837d4cada9cd846
|
[
"Apache-2.0",
"MIT"
] | null | null | null |
git-ref/src/store/file/mod.rs
|
svetli-n/gitoxide
|
9f5663ed83d83c7335b346313837d4cada9cd846
|
[
"Apache-2.0",
"MIT"
] | 18 |
2021-06-08T19:46:35.000Z
|
2021-07-28T05:06:07.000Z
|
git-ref/src/store/file/mod.rs
|
rsalmaso/gitoxide
|
2ee189068edcc06491e03c8551866ce5ac0cf0ba
|
[
"Apache-2.0",
"MIT"
] | null | null | null |
use std::path::PathBuf;
use git_features::threading::{MutableOnDemand, OwnShared};
/// A store for reference which uses plain files.
///
/// Each ref is represented as a single file on disk in a folder structure that follows the relative path
/// used to identify [references][crate::Reference].
#[derive(Debug, Clone)]
pub struct Store {
/// The location at which loose references can be found as per conventions of a typical git repository.
///
/// Typical base paths are `.git` repository folders.
base: PathBuf,
/// The kind of hash to assume in a couple of situations. Note that currently we are able to read any valid hash from files
/// which might want to change one day.
object_hash: git_hash::Kind,
/// The way to handle reflog edits
pub write_reflog: WriteReflog,
/// The namespace to use for edits and reads
pub namespace: Option<Namespace>,
/// A packed buffer which can be mapped in one version and shared as such.
/// It's updated only in one spot, which is prior to reading it based on file stamps.
/// Doing it like this has the benefit of being able to hand snapshots out to people without blocking others from updating it.
packed: OwnShared<MutableOnDemand<packed::modifiable::State>>,
}
mod access {
use std::path::Path;
use crate::file;
impl file::Store {
/// Return the root at which all references are loaded.
pub fn base(&self) -> &Path {
&self.base
}
}
}
/// A transaction on a file store
pub struct Transaction<'s> {
store: &'s Store,
packed_transaction: Option<crate::store_impl::packed::Transaction>,
updates: Option<Vec<transaction::Edit>>,
packed_refs: transaction::PackedRefs,
}
pub(in crate::store_impl::file) fn path_to_name(path: impl Into<PathBuf>) -> git_object::bstr::BString {
use os_str_bytes::OsStringBytes;
let path = path.into().into_raw_vec();
#[cfg(windows)]
let path = {
use git_object::bstr::ByteSlice;
path.replace(b"\\", b"/")
};
path.into()
}
///
pub mod loose;
mod overlay_iter;
///
pub mod iter {
pub use super::{
loose::iter::{loose, Loose},
overlay_iter::{LooseThenPacked, Platform},
};
///
pub mod loose_then_packed {
pub use super::super::overlay_iter::Error;
}
}
///
pub mod log;
///
pub mod find;
///
pub mod transaction;
///
pub mod packed;
mod raw_ext;
pub use raw_ext::ReferenceExt;
use crate::{store::WriteReflog, Namespace};
| 26.765957 | 130 | 0.664547 |
ba58be5333ee098395d7480706f9ab85528c7dec
| 151 |
sql
|
SQL
|
15-07-19_19-07-19/SistemaBiblioteca/Query/AutoresBiblioteca.sql
|
AndersonAluiz12/GitC
|
0de5c5428eb6d484d84e2cfcaae83002d0f589f6
|
[
"MIT"
] | null | null | null |
15-07-19_19-07-19/SistemaBiblioteca/Query/AutoresBiblioteca.sql
|
AndersonAluiz12/GitC
|
0de5c5428eb6d484d84e2cfcaae83002d0f589f6
|
[
"MIT"
] | null | null | null |
15-07-19_19-07-19/SistemaBiblioteca/Query/AutoresBiblioteca.sql
|
AndersonAluiz12/GitC
|
0de5c5428eb6d484d84e2cfcaae83002d0f589f6
|
[
"MIT"
] | null | null | null |
CREATE TABLE [dbo].[Autores]
(
[Id] INT NOT NULL PRIMARY KEY IDENTITY(1,1),
[Nome ] VARCHAR(100) NOT NULL,
[Descricao] VARCHAR(100) NULL
)
| 21.571429 | 46 | 0.642384 |
8d6b6d2e5d006e50d27e8ebf6df77ebbfb0f5a38
| 1,979 |
swift
|
Swift
|
ESCapey-iOS/ESCapey-iOS/ViewController.swift
|
brianmichel/ESCapey
|
8509b16a8c4e9ae17512abf7cc71c7a43d8cee81
|
[
"MIT"
] | 283 |
2016-10-26T02:33:29.000Z
|
2022-03-20T01:06:10.000Z
|
ESCapey-iOS/ESCapey-iOS/ViewController.swift
|
brianmichel/ESCapey
|
8509b16a8c4e9ae17512abf7cc71c7a43d8cee81
|
[
"MIT"
] | 2 |
2016-10-26T14:46:59.000Z
|
2016-12-12T09:46:45.000Z
|
ESCapey-iOS/ESCapey-iOS/ViewController.swift
|
brianmichel/ESCapey
|
8509b16a8c4e9ae17512abf7cc71c7a43d8cee81
|
[
"MIT"
] | 12 |
2016-10-26T15:05:45.000Z
|
2020-01-15T07:04:29.000Z
|
//
// ViewController.swift
// ESCapey-iOS
//
// Created by Brian Michel on 10/25/16.
// Copyright © 2016 Brian Michel. All rights reserved.
//
import UIKit
import MultipeerConnectivity
class ViewController: UIViewController, MCBrowserViewControllerDelegate {
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
@IBOutlet weak var connectionToggleButton: UIButton!
let session = MCSession(peer: MCPeerID(displayName: UIDevice.current.name))
@IBAction func escapeButtonTapped(_ sender: Any?) {
let key = "escape".data(using: .utf8)
do {
let _ = try session.send(key!, toPeers: session.connectedPeers, with: .reliable)
}
catch (_) {
}
}
@IBAction func toggleConnectionButtonTapped(_ sender: Any?) {
if session.hasPeers() {
session.disconnect()
updateConnectButtonTitle()
}
else {
let controller = MCBrowserViewController(serviceType: "ESCapey", session: session)
controller.delegate = self
controller.maximumNumberOfPeers = 1
showDetailViewController(controller, sender: self)
}
}
func browserViewControllerDidFinish(_ browserViewController: MCBrowserViewController) {
browserViewController.dismiss(animated: true, completion: nil)
updateConnectButtonTitle()
}
func browserViewControllerWasCancelled(_ browserViewController: MCBrowserViewController) {
browserViewController.dismiss(animated: true, completion: nil)
updateConnectButtonTitle()
}
private func updateConnectButtonTitle() {
let text = session.hasPeers() ? "Disconnect" : "Connect"
connectionToggleButton.setTitle(text, for: .normal)
}
}
private extension MCSession {
func hasPeers() -> Bool {
return self.connectedPeers.count > 0
}
}
| 29.102941 | 94 | 0.651844 |
18ad84958232a903b6ede66f506cf3b9d327dd72
| 1,428 |
rs
|
Rust
|
src/main.rs
|
OverengineeredOne/oecli
|
4635ae6e2c2fe5a28b49f95ff53cc54d8ca13a86
|
[
"MIT"
] | null | null | null |
src/main.rs
|
OverengineeredOne/oecli
|
4635ae6e2c2fe5a28b49f95ff53cc54d8ca13a86
|
[
"MIT"
] | null | null | null |
src/main.rs
|
OverengineeredOne/oecli
|
4635ae6e2c2fe5a28b49f95ff53cc54d8ca13a86
|
[
"MIT"
] | null | null | null |
//! oecli is a command line interface to provide a productivity boost by
//! handling boilerplate and some operational overhead with development within
//! the Overengineered ecosystem.
use clap::{Args, Parser, Subcommand};
mod github;
mod node;
/// oecli parser
#[derive(Parser)]
#[clap(author, version, about, long_about = None)]
#[clap(propagate_version = true)]
struct Cli {
/// Subcommand passed into oecli
#[clap(subcommand)]
command: Commands,
}
/// Different sub command line options available with oecli
#[derive(Subcommand)]
enum Commands {
/// Progressive Web App
PWA(PWA),
}
/// Subcommand for interacting with Progressive Web Apps. Overengineered uses
/// Yew, which is a modern Rust framework for creating multi-threaded front-end
/// web applications using WebAssembly.
#[derive(Args, Debug)]
struct PWA {
/// Will create a new Github repository with the provided name. This
/// repository will use a template to create a Yew app using the PatternFly
/// for a component library.
#[clap(long)]
new: String,
}
fn main() {
let cli = Cli::parse();
match &cli.command {
Commands::PWA(name) => {
github::create(&name.new);
let username = github::logged_in_user();
let full_repo = format!("{}/{}", &username, &name.new);
github::clone(&full_repo);
node::npm_install(&name.new);
}
}
}
| 27.461538 | 79 | 0.660364 |
4a783417b3a69642cd1bc265dbbaa2a38325a8a9
| 365 |
kt
|
Kotlin
|
school_timetable/src/main/kotlin/com/madness/collision/unit/school_timetable/MyBridge.kt
|
cliuff/boundo
|
e81cf6ad1dcfa3d43e336591443b16e9f74f626a
|
[
"Apache-2.0"
] | 23 |
2020-04-29T21:53:06.000Z
|
2022-03-15T08:47:07.000Z
|
school_timetable/src/main/kotlin/com/madness/collision/unit/school_timetable/MyBridge.kt
|
Ilithy/boundo
|
b28473307a4a4c2f3eeca41fce6830b32c6ffafe
|
[
"Apache-2.0"
] | 3 |
2021-04-27T03:13:00.000Z
|
2022-01-13T12:49:53.000Z
|
school_timetable/src/main/kotlin/com/madness/collision/unit/school_timetable/MyBridge.kt
|
Ilithy/boundo
|
b28473307a4a4c2f3eeca41fce6830b32c6ffafe
|
[
"Apache-2.0"
] | 2 |
2020-04-29T21:56:49.000Z
|
2020-08-25T06:00:39.000Z
|
package com.madness.collision.unit.school_timetable
import com.madness.collision.unit.Bridge
import com.madness.collision.unit.Unit
object MyBridge: Bridge() {
override val unitName: String = Unit.UNIT_NAME_SCHOOL_TIMETABLE
/**
* @param args empty
*/
override fun getUnitInstance(vararg args: Any?): Unit {
return MyUnit()
}
}
| 21.470588 | 67 | 0.706849 |
160b3673f09c8ce4e76293f1f713db21ebd245d1
| 1,609 |
c
|
C
|
main.c
|
moa/IAQ
|
dde5b26490891e643eed61729266284c6025928e
|
[
"MIT"
] | 1 |
2016-03-07T13:54:29.000Z
|
2016-03-07T13:54:29.000Z
|
main.c
|
moa/iaq
|
dde5b26490891e643eed61729266284c6025928e
|
[
"MIT"
] | null | null | null |
main.c
|
moa/iaq
|
dde5b26490891e643eed61729266284c6025928e
|
[
"MIT"
] | null | null | null |
/* Name: main.c
* Author: <insert your name here>
* Copyright: <insert your copyright message here>
* License: <insert your license reference here>
*/
#include <avr/io.h>
#include <util/delay.h>
#include <stdlib.h>
#include <uart.h>
#include <i2c_master.h>
#define LED PB5
#define IAQ_ADDR 0x5A
#define IAQ_READ 0xB5
char buffer[10];
uint16_t pred = 0;
uint16_t status = 0;
uint32_t resistance = 0;
uint16_t tvoc = 0;
void getVal()
{
if(i2c_start(IAQ_READ) == 0) //0 returned indicates no error
{
uart_puts("Start ");
pred = ((uint16_t)i2c_read_ack())<<8;
pred |= i2c_read_ack();
status = ((uint16_t)i2c_read_ack())<<8;
status |= i2c_read_ack();
resistance = ((uint32_t)i2c_read_ack())<<8;
resistance |= i2c_read_ack();
tvoc = ((uint16_t)i2c_read_ack())<<8;
tvoc |= i2c_read_nack();
i2c_stop();
}
else
{
uart_puts("Error");
i2c_stop();
}
}
int main(void)
{
init_uart(57600);
i2c_init();
DDRB = _BV(5);
for(;;)
{
getVal();
itoa(pred, buffer, 10); //convert decimal to string base 10
uart_puts(buffer);
uart_puts(":pred ");
itoa(status, buffer, 10);
uart_puts(buffer);
uart_puts(":status ");
itoa(resistance, buffer, 10);
uart_puts(buffer);
uart_puts(":resistance ");
itoa(tvoc, buffer, 10);
uart_puts(buffer);
uart_puts(":tvoc ");
uart_puts("\n\r");
PORTB = 0xFF;
_delay_ms(500);
PORTB = 0x00;
_delay_ms(500);
}
return 0; /* never reached */
}
| 17.681319 | 65 | 0.577377 |
3e840d3a689961f1b49c0f6e335d6fd514694df0
| 1,207 |
c
|
C
|
getmem.c
|
jcavalieri8619/XINU_emulation
|
efd9d2632f3993356dd0007646f8e50411677198
|
[
"MIT"
] | null | null | null |
getmem.c
|
jcavalieri8619/XINU_emulation
|
efd9d2632f3993356dd0007646f8e50411677198
|
[
"MIT"
] | null | null | null |
getmem.c
|
jcavalieri8619/XINU_emulation
|
efd9d2632f3993356dd0007646f8e50411677198
|
[
"MIT"
] | null | null | null |
/* getmem.c - getmem */
#include <conf.h>
#include <kernel.h>
#include <mem.h>
/*------------------------------------------------------------------------
* getmem -- allocate heap storage, returning lowest integer address
*------------------------------------------------------------------------
*/
SYSCALL *getmem( unsigned nbytes )
{
struct mblock *p, *q, *leftover;
sigset_t PS;
disable( &PS );
if ( nbytes == 0 || memlist.mnext == NULL ) {
restore( &PS );
handle_error( "getmem: " );
return ( (int *) SYSERR );
}
nbytes = (unsigned) roundew( nbytes );
for ( q = &memlist, p = memlist.mnext; p != NULL; q = p, p = p->mnext )
if ( p->mlen == nbytes ) {
q->mnext = p->mnext;
restore( &PS );
return ( (int *) p );
} else if ( p->mlen > nbytes ) {
leftover = (struct mblock *) ( (unsigned) p + nbytes );
q->mnext = leftover;
leftover->mnext = p->mnext;
leftover->mlen = p->mlen - nbytes;
restore( &PS );
return ( (int *) p );
}
restore( &PS );
handle_error( "getmem: " );
return ( (int *) SYSERR );
}
| 28.069767 | 75 | 0.428335 |
46fe9d2aa7440bde5333d91187b84e5247bf6dd8
| 6,964 |
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_648.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9 |
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_648.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1 |
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_648.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3 |
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x1851a, %rbp
nop
nop
cmp $48254, %r9
mov $0x6162636465666768, %rdx
movq %rdx, %xmm0
vmovups %ymm0, (%rbp)
nop
nop
nop
nop
nop
dec %r14
lea addresses_UC_ht+0x215a, %rax
nop
sub %r10, %r10
mov $0x6162636465666768, %r9
movq %r9, %xmm2
and $0xffffffffffffffc0, %rax
movaps %xmm2, (%rax)
nop
nop
and $33865, %rdx
lea addresses_D_ht+0x1d55a, %r14
nop
nop
nop
nop
sub %rsi, %rsi
mov $0x6162636465666768, %rax
movq %rax, (%r14)
xor $42325, %r10
lea addresses_A_ht+0xe89a, %rsi
lea addresses_D_ht+0x4c9a, %rdi
nop
nop
nop
nop
nop
cmp $64462, %rbp
mov $28, %rcx
rep movsb
nop
nop
nop
and %rcx, %rcx
lea addresses_WC_ht+0x209a, %rsi
lea addresses_normal_ht+0x3b14, %rdi
nop
nop
nop
nop
dec %r10
mov $55, %rcx
rep movsw
nop
nop
nop
sub $2114, %rdx
lea addresses_normal_ht+0x1769a, %rdi
nop
nop
nop
nop
xor %r14, %r14
mov $0x6162636465666768, %rcx
movq %rcx, %xmm0
and $0xffffffffffffffc0, %rdi
vmovntdq %ymm0, (%rdi)
nop
nop
cmp $49266, %r14
lea addresses_normal_ht+0xfe1a, %rsi
nop
nop
nop
nop
inc %rax
mov (%rsi), %r10d
nop
nop
nop
nop
nop
sub $45063, %rdi
lea addresses_normal_ht+0x35aa, %rbp
nop
nop
nop
nop
nop
and $54208, %rdx
vmovups (%rbp), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %rcx
nop
nop
xor %rax, %rax
lea addresses_A_ht+0x749a, %r14
nop
nop
nop
nop
add %rax, %rax
mov (%r14), %rdi
nop
nop
xor $30758, %rsi
lea addresses_UC_ht+0xf99a, %rsi
lea addresses_normal_ht+0x1389a, %rdi
nop
nop
nop
nop
nop
add $52652, %r14
mov $111, %rcx
rep movsb
nop
add %rax, %rax
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r8
push %r9
push %rax
push %rbp
push %rsi
// Store
lea addresses_WT+0x1a49a, %r9
nop
nop
nop
nop
cmp $11927, %r8
mov $0x5152535455565758, %rsi
movq %rsi, %xmm5
vmovups %ymm5, (%r9)
add %rbp, %rbp
// Faulty Load
lea addresses_A+0x18c9a, %r9
nop
nop
cmp %rsi, %rsi
mov (%r9), %r8
lea oracles, %rax
and $0xff, %r8
shlq $12, %r8
mov (%rax,%r8,1), %r8
pop %rsi
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 16, 'AVXalign': True, 'NT': True, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': True, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}}
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
| 34.305419 | 2,999 | 0.661976 |
3320a3f0ba332b35fac7f43f483b6bf56fe80c12
| 1,394 |
py
|
Python
|
showdownai/naive_bayes.py
|
AM22/Pokemon-AI
|
4cd29eb880981613158db0055179f4395c5599e3
|
[
"MIT"
] | null | null | null |
showdownai/naive_bayes.py
|
AM22/Pokemon-AI
|
4cd29eb880981613158db0055179f4395c5599e3
|
[
"MIT"
] | null | null | null |
showdownai/naive_bayes.py
|
AM22/Pokemon-AI
|
4cd29eb880981613158db0055179f4395c5599e3
|
[
"MIT"
] | null | null | null |
import json
from data import MOVE_CORRECTIONS, correct_mega
def get_moves(poke, known_moves, graph, data, alpha=1.0):
poke = correct_mega(poke)
co = graph['cooccurences']
freq = graph['frequencies']
probs = {}
if len(known_moves) == 0:
probs = get_freqs(poke, freq)
else:
for move in known_moves:
if move not in co[poke]:
continue
total = float(sum(co[poke][move].values()))
for othermove in co[poke][move]:
if othermove in MOVE_CORRECTIONS:
probs[MOVE_CORRECTIONS[othermove]] = probs[othermove]
del probs[move]
if othermove in known_moves:
continue
prob = co[poke][move][othermove] / total
if othermove not in probs:
probs[othermove] = 1
probs[othermove] *= prob
if probs == {}:
probs = get_freqs(poke, freq)
return sorted(probs.items(), key=lambda x: -x[1])
def get_freqs(poke, freq):
probs = {}
total = float(sum(freq[poke].values()))
for move in freq[poke]:
prob = freq[poke][move] / total
probs[move] = prob
return probs
if __name__ == "__main__":
from data import load_data
data, bw_data, graph = load_data('data')
def foo(x, y):
return get_moves(x, y, graph, data)
| 33.190476 | 73 | 0.559541 |
389c4312a3d983dbcd22b3d0fa19d9536f3d1d29
| 666 |
sql
|
SQL
|
rule/sqlite-store-migrations/000001_create_schema.up.sql
|
backwardn/gudgeon
|
e0d778acc2132a685ff4d1b894cfeb6818b9036b
|
[
"MIT"
] | 20 |
2019-03-12T05:27:48.000Z
|
2021-06-19T02:56:11.000Z
|
rule/sqlite-store-migrations/000001_create_schema.up.sql
|
backwardn/gudgeon
|
e0d778acc2132a685ff4d1b894cfeb6818b9036b
|
[
"MIT"
] | 3 |
2019-03-14T23:45:19.000Z
|
2020-04-10T19:49:45.000Z
|
rule/sqlite-store-migrations/000001_create_schema.up.sql
|
backwardn/gudgeon
|
e0d778acc2132a685ff4d1b894cfeb6818b9036b
|
[
"MIT"
] | 5 |
2018-09-14T19:51:32.000Z
|
2020-02-28T06:44:52.000Z
|
-- no automatic indexing
PRAGMA automatic_index = false;
-- list table exists so that we don't have to store the entire list name for each rule entry
CREATE TABLE IF NOT EXISTS lists (
Id INTEGER PRIMARY KEY,
ShortName TEXT,
-- list type defaults to "BLOCk"
ListType INTEGER DEFAULT 0
);
CREATE INDEX IF NOT EXISTS idx_lists_ShortName on lists (ShortName);
-- rules table is joined against the list table for unique sets of rules
CREATE TABLE IF NOT EXISTS rules (
ListRowId INTEGER,
Rule TEXT,
PRIMARY KEY(ListRowId, Rule)
);
-- without this index it is **much** slower
CREATE INDEX IF NOT EXISTS idx_rules_Rule on rules (Rule);
| 31.714286 | 92 | 0.72973 |
dde4c11522b557a408be0abcfe39cf9d0c08875e
| 512 |
go
|
Go
|
go/findpid/main.go
|
immortal/sandbox
|
761645c11399b15f624104accdf39688faf96a04
|
[
"BSD-3-Clause"
] | null | null | null |
go/findpid/main.go
|
immortal/sandbox
|
761645c11399b15f624104accdf39688faf96a04
|
[
"BSD-3-Clause"
] | 1 |
2020-06-25T03:59:50.000Z
|
2020-06-25T03:59:50.000Z
|
go/findpid/main.go
|
immortal/sandbox
|
761645c11399b15f624104accdf39688faf96a04
|
[
"BSD-3-Clause"
] | null | null | null |
package main
import (
"fmt"
"log"
"os"
"strconv"
"syscall"
)
func main() {
for _, p := range os.Args[1:] {
pid, err := strconv.ParseInt(p, 10, 64)
if err != nil {
log.Fatal(err)
}
process, err := os.FindProcess(int(pid))
if err != nil {
fmt.Printf("Failed to find process: %s\n", err)
} else {
err := process.Signal(syscall.Signal(0))
if err != nil {
fmt.Printf("process.Signal on pid %d returned: %v\n", pid, err)
} else {
fmt.Println("proccess exists")
}
}
}
}
| 17.066667 | 67 | 0.572266 |
4a3895446295ae81561a0d2d78f8ce0351aee093
| 2,348 |
js
|
JavaScript
|
src/algebras/Maybe.js
|
mandober/electron-bookmarks
|
2822950955da60e0d0e7f219726487dcfe453745
|
[
"MIT"
] | null | null | null |
src/algebras/Maybe.js
|
mandober/electron-bookmarks
|
2822950955da60e0d0e7f219726487dcfe453745
|
[
"MIT"
] | 1 |
2021-05-11T07:18:24.000Z
|
2021-05-11T07:18:24.000Z
|
src/algebras/Maybe.js
|
mandober/electron-bookmarks
|
2822950955da60e0d0e7f219726487dcfe453745
|
[
"MIT"
] | null | null | null |
/*
Maybe
=====
data Maybe a = Nothing | Just a
Maybe has an instance for:
- Semigroup
- Monoid
- Pointed
- Functor
- Applicative
- Monad
- Foldable
- Traversable
*/
class Maybe {
// -------------------------------------------------------------- internals
#value // field
constructor(x) { this.#value = x }
get isNothing() { return this.#value == null }
get isJust() { return !this.isNothing }
toString = () =>
this.isNothing ? "Nothing" : `Just(${this.#value})`
valueOf = () =>
this.isNothing ? 0 : Number(this.#value)
// --------------------------------------------------------------------- Eq
eq = b => this.#value === b
// -------------------------------------------------------------------- Ord
// ---------------------------------------------------------------- Pointed
static of = x => new Maybe(x)
// ---------------------------------------------------------------- Functor
map = f => this.isNothing ? this : Maybe.of(f(this.#value))
// ------------------------------------------------------------ Applicative
ap = f => this.isNothing ? this : f.map(this.#value)
// ------------------------------------------------------------------ Monad
chain = f => this.map(f).join()
join = () => this.isNothing ? this : this.#value
// ------------------------------------------------------------ Traversable
sequence = of => this.traverse(of, x => x)
traverse = (of, f) =>
this.isNothing ? of(this) : f(this.#value).map(Maybe.of)
}
// ---------------------------------------------------------------------- or
const Just = x => ({
// map :: Maybe a ~> (a -> b) -> Maybe b
map: f => Just(f(x)),
// fold :: Maybe a ~> (b, a -> b) -> b
fold: (_, f) => f(x)
})
const Nothing = ({
// map :: Maybe a ~> (a -> b) -> Maybe b
map: _ => Nothing,
// Return default value
// fold :: Maybe a ~> (b, a -> b) -> b
fold: (d, _) => d
})
// fromNullable :: a? -> Maybe a
const fromNullable = x => x == null ? Nothing : Just(x)
// ---------------------------------------------------------------------- check
let j = new Maybe(42)
let n = new Maybe()
console.log('\n',
j.toString(), '\n',
j + j, '\n',
n.toString(), '\n',
j + n, '\n',
fromNullable(undefined).fold(442)
)
| 24.978723 | 79 | 0.366695 |
36fc78f4fe28035601ea68aab3d41f51586efb98
| 796 |
rs
|
Rust
|
src/main.rs
|
adamsoutar/ass
|
06a8d2da8f202d57eefffb1609bef1949adb4338
|
[
"MIT"
] | 2 |
2021-05-11T22:15:39.000Z
|
2021-11-25T07:34:50.000Z
|
src/main.rs
|
adamsoutar/ass
|
06a8d2da8f202d57eefffb1609bef1949adb4338
|
[
"MIT"
] | null | null | null |
src/main.rs
|
adamsoutar/ass
|
06a8d2da8f202d57eefffb1609bef1949adb4338
|
[
"MIT"
] | 1 |
2021-11-25T07:35:03.000Z
|
2021-11-25T07:35:03.000Z
|
use std::env;
use std::fs;
mod parser;
mod codegen;
use parser::char_stream::CharStream;
use parser::tokeniser::Tokeniser;
use parser::parser::Parser;
use codegen::codegen::Codegen;
#[allow(unused_imports)]
use parser::ast_printer::print_ast_node;
fn main() {
let filename = env::args().nth(1)
.expect("Pass a C file path argument");
let code = fs::read_to_string(filename)
.expect("Failed to open code file for reading");
let stream = CharStream::new(code);
let tokeniser = Tokeniser::new(stream);
let mut parser = Parser::new(tokeniser);
let ast = parser.generate_ast();
// for node in &ast {
// print_ast_node(node, 0);
// }
let mut codegen = Codegen::new(ast);
codegen.generate();
print!("{}", codegen.generated)
}
| 22.111111 | 56 | 0.649497 |
5fda26ea2720dd31448ddd3d372cf0cdb1240178
| 5,173 |
c
|
C
|
src/contrib/netbsd-tests/lib/libc/stdio/t_printf.c
|
lastweek/source-freebsd
|
0821950b0c40cbc891a27964b342e0202a3859ec
|
[
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null |
src/contrib/netbsd-tests/lib/libc/stdio/t_printf.c
|
lastweek/source-freebsd
|
0821950b0c40cbc891a27964b342e0202a3859ec
|
[
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null |
src/contrib/netbsd-tests/lib/libc/stdio/t_printf.c
|
lastweek/source-freebsd
|
0821950b0c40cbc891a27964b342e0202a3859ec
|
[
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null |
/* $NetBSD: t_printf.c,v 1.8 2012/04/11 16:21:42 jruoho Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/types.h>
#include <sys/resource.h>
#include <atf-c.h>
#include <math.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
ATF_TC(snprintf_c99);
ATF_TC_HEAD(snprintf_c99, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test printf(3) C99 conformance (PR lib/22019)");
}
ATF_TC_BODY(snprintf_c99, tc)
{
char s[4];
(void)memset(s, '\0', sizeof(s));
(void)snprintf(s, sizeof(s), "%#.o", 0);
(void)printf("printf = %#.o\n", 0);
(void)fprintf(stderr, "snprintf = %s", s);
ATF_REQUIRE(strlen(s) == 1);
ATF_REQUIRE(s[0] == '0');
}
ATF_TC(snprintf_dotzero);
ATF_TC_HEAD(snprintf_dotzero, tc)
{
atf_tc_set_md_var(tc, "descr",
"PR lib/32951: %%.0f formats (0.0,0.5] to \"0.\"");
}
ATF_TC_BODY(snprintf_dotzero, tc)
{
char s[4];
ATF_CHECK(snprintf(s, sizeof(s), "%.0f", 0.1) == 1);
ATF_REQUIRE_STREQ(s, "0");
}
ATF_TC(snprintf_posarg);
ATF_TC_HEAD(snprintf_posarg, tc)
{
atf_tc_set_md_var(tc, "descr", "test for positional arguments");
}
ATF_TC_BODY(snprintf_posarg, tc)
{
char s[16];
ATF_CHECK(snprintf(s, sizeof(s), "%1$d", -23) == 3);
ATF_REQUIRE_STREQ(s, "-23");
}
ATF_TC(snprintf_posarg_width);
ATF_TC_HEAD(snprintf_posarg_width, tc)
{
atf_tc_set_md_var(tc, "descr", "test for positional arguments with "
"field width");
}
ATF_TC_BODY(snprintf_posarg_width, tc)
{
char s[16];
ATF_CHECK(snprintf(s, sizeof(s), "%1$*2$d", -23, 4) == 4);
ATF_REQUIRE_STREQ(s, " -23");
}
ATF_TC(snprintf_posarg_error);
ATF_TC_HEAD(snprintf_posarg_error, tc)
{
atf_tc_set_md_var(tc, "descr", "test for positional arguments out "
"of bounds");
}
ATF_TC_BODY(snprintf_posarg_error, tc)
{
char s[16], fmt[32];
snprintf(fmt, sizeof(fmt), "%%%zu$d", SIZE_MAX / sizeof(size_t));
ATF_CHECK(snprintf(s, sizeof(s), fmt, -23) == -1);
}
ATF_TC(snprintf_float);
ATF_TC_HEAD(snprintf_float, tc)
{
atf_tc_set_md_var(tc, "descr", "test that floating conversions don't"
" leak memory");
#ifdef __FreeBSD__
atf_tc_set_md_var(tc, "require.memory", "64m");
atf_tc_set_md_var(tc, "require.user", "root");
#endif
}
ATF_TC_BODY(snprintf_float, tc)
{
union {
double d;
uint64_t bits;
} u;
uint32_t ul, uh;
time_t now;
char buf[1000];
struct rlimit rl;
#ifdef __FreeBSD__
rl.rlim_cur = rl.rlim_max = 32 * 1024 * 1024;
ATF_CHECK(setrlimit(RLIMIT_AS, &rl) != -1);
rl.rlim_cur = rl.rlim_max = 32 * 1024 * 1024;
ATF_CHECK(setrlimit(RLIMIT_DATA, &rl) != -1);
#else
rl.rlim_cur = rl.rlim_max = 1 * 1024 * 1024;
ATF_CHECK(setrlimit(RLIMIT_AS, &rl) != -1);
rl.rlim_cur = rl.rlim_max = 1 * 1024 * 1024;
ATF_CHECK(setrlimit(RLIMIT_DATA, &rl) != -1);
#endif
time(&now);
srand(now);
for (size_t i = 0; i < 10000; i++) {
ul = rand();
uh = rand();
u.bits = (uint64_t)uh << 32 | ul;
ATF_CHECK(snprintf(buf, sizeof buf, " %.2f", u.d) != -1);
}
}
ATF_TC(sprintf_zeropad);
ATF_TC_HEAD(sprintf_zeropad, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test output format zero padding (PR lib/44113)");
}
ATF_TC_BODY(sprintf_zeropad, tc)
{
char str[1024];
ATF_CHECK(sprintf(str, "%010f", 0.0) == 10);
ATF_REQUIRE_STREQ(str, "000.000000");
/* ieeefp */
#ifndef __vax__
/* printf(3) should ignore zero padding for nan/inf */
ATF_CHECK(sprintf(str, "%010f", NAN) == 10);
ATF_REQUIRE_STREQ(str, " nan");
ATF_CHECK(sprintf(str, "%010f", INFINITY) == 10);
ATF_REQUIRE_STREQ(str, " inf");
#endif
}
ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, snprintf_c99);
ATF_TP_ADD_TC(tp, snprintf_dotzero);
ATF_TP_ADD_TC(tp, snprintf_posarg);
ATF_TP_ADD_TC(tp, snprintf_posarg_width);
ATF_TP_ADD_TC(tp, snprintf_posarg_error);
ATF_TP_ADD_TC(tp, snprintf_float);
ATF_TP_ADD_TC(tp, sprintf_zeropad);
return atf_no_error();
}
| 25.11165 | 78 | 0.696888 |
a603a3928e79f4e08c99f2fd17d7c5d957188a01
| 3,363 |
sql
|
SQL
|
triviadb.sql
|
DilipDKalsariya/Trivia-App
|
a52b7bc4f1a6e2c974b7a8557255c393ae68b4c0
|
[
"MIT"
] | null | null | null |
triviadb.sql
|
DilipDKalsariya/Trivia-App
|
a52b7bc4f1a6e2c974b7a8557255c393ae68b4c0
|
[
"MIT"
] | null | null | null |
triviadb.sql
|
DilipDKalsariya/Trivia-App
|
a52b7bc4f1a6e2c974b7a8557255c393ae68b4c0
|
[
"MIT"
] | null | null | null |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Sep 16, 2020 at 03:26 AM
-- Server version: 5.7.26
-- PHP Version: 7.2.18
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `triviadb`
--
-- --------------------------------------------------------
--
-- Table structure for table `question`
--
DROP TABLE IF EXISTS `question`;
CREATE TABLE IF NOT EXISTS `question` (
`que_Id` int(11) NOT NULL AUTO_INCREMENT,
`question` varchar(255) NOT NULL,
`created_on` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_on` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`que_Id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `question`
--
INSERT INTO `question` (`que_Id`, `question`, `created_on`, `updated_on`) VALUES
(1, 'What is your name ?', '2020-05-05 14:48:51', NULL),
(2, 'Who is the best cricketer in the world?', '2020-05-05 14:49:11', NULL),
(3, 'What are the colors in the Indian national flag?', '2020-05-05 14:49:37', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `quiz`
--
DROP TABLE IF EXISTS `quiz`;
CREATE TABLE IF NOT EXISTS `quiz` (
`answer_Id` int(11) NOT NULL AUTO_INCREMENT,
`que_Id` int(11) NOT NULL,
`answer` varchar(255) NOT NULL,
`created_on` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_on` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`answer_Id`)
) ENGINE=MyISAM AUTO_INCREMENT=43 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `quiz`
--
INSERT INTO `quiz` (`answer_Id`, `que_Id`, `answer`, `created_on`, `updated_on`) VALUES
(30, 3, 'White,Orange,Green', '2020-09-15 21:44:46', NULL),
(29, 2, 'Sachin Tendulkar', '2020-09-15 21:44:46', NULL),
(28, 1, 'kaju', '2020-09-15 21:44:46', NULL),
(27, 3, 'White,Orange,Green', '2020-09-15 21:24:28', NULL),
(26, 2, 'Sachin Tendulkar', '2020-09-15 21:24:28', NULL),
(25, 1, 'raju', '2020-09-15 21:24:28', NULL),
(33, 3, 'White,Orange,Green', '2020-09-15 23:21:39', NULL),
(21, 3, 'White,Orange,Green', '2020-09-15 21:07:18', NULL),
(20, 2, 'Sachin Tendulkar', '2020-09-15 21:07:18', NULL),
(19, 1, 'Dilip', '2020-09-15 21:07:18', NULL),
(32, 2, 'Sachin Tendulkar', '2020-09-15 23:21:39', NULL),
(31, 1, 'Chigu', '2020-09-15 23:21:39', '2020-09-15 23:23:23'),
(34, 1, 'Ramesh', '2020-09-15 23:25:17', NULL),
(35, 2, 'Adam Gilchirst', '2020-09-15 23:25:17', NULL),
(36, 3, 'Yellow,Orange', '2020-09-15 23:25:17', NULL),
(37, 1, 'ramu', '2020-09-15 23:33:26', NULL),
(38, 2, 'Adam Gilchirst', '2020-09-15 23:33:26', NULL),
(39, 3, 'White,Orange', '2020-09-15 23:33:26', NULL),
(40, 1, 'test', '2020-09-15 23:38:43', NULL),
(41, 2, 'Sachin Tendulkar', '2020-09-15 23:38:43', NULL),
(42, 3, 'White,Yellow,Orange,Green', '2020-09-15 23:38:43', NULL);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| 35.03125 | 87 | 0.651204 |
1198e1a05933a75b3086364306664ceba999626a
| 3,054 |
lua
|
Lua
|
lua/tanklib/shared/quaternion.lua
|
TankNut/TankLib
|
79276b44a88a5a649f2b5c5766692d0f87ce10d1
|
[
"MIT"
] | null | null | null |
lua/tanklib/shared/quaternion.lua
|
TankNut/TankLib
|
79276b44a88a5a649f2b5c5766692d0f87ce10d1
|
[
"MIT"
] | null | null | null |
lua/tanklib/shared/quaternion.lua
|
TankNut/TankLib
|
79276b44a88a5a649f2b5c5766692d0f87ce10d1
|
[
"MIT"
] | null | null | null |
local class = TankLib.Class:New("TankLib.Quaternion")
-- Most of this is transcribed from wire's E2 implementation
local deg2rad = math.pi / 180
local rad2deg = 180 / math.pi
local function qmul(a, b)
local a1, a2, a3, a4 = unpack(a)
local b1, b2, b3, b4 = unpack(b)
return {
a1 * b1 - a2 * b2 - a3 * b3 - a4 * b4,
a1 * b2 + a2 * b1 + a3 * b4 - a4 * b3,
a1 * b3 + a3 * b1 + a4 * b2 - a2 * b4,
a1 * b4 + a4 * b1 + a2 * b3 - a3 * b2
}
end
function class:Initialize(...)
local args = {...}
for i = 1, 4 do
self[i] = args[i] or 0
end
end
-- Static
function class.Static:FromVector(vec)
return class:New(0, vec.x, vec.y, vec.z)
end
function class.Static:FromAngle(ang)
local p, y, r = ang:Unpack()
p = p * deg2rad * 0.5
y = y * deg2rad * 0.5
r = r * deg2rad * 0.5
local qp = {math.cos(p), 0, math.sin(p), 0}
local qy = {math.cos(y), 0, 0, math.sin(y)}
local qr = {math.cos(r), math.sin(r), 0, 0}
return class:New(unpack(qmul(qy, qmul(qp, qr))))
end
function class.Static:FromVectors(forward, up)
local y = up:Cross(forward):GetNormalized()
local ang = forward:Angle()
ang.p = math.NormalizeAngle(ang.p)
ang.y = math.NormalizeAngle(ang.y)
local yyaw = Vector(0, 1, 0)
yyaw:Rotate(Angle(0, ang.y, 0))
local roll = math.acos(math.Clamp(y:Dot(yyaw), -1, 1)) * rad2deg
local dot = y.z
if dot < 0 then
roll = -roll
end
return self:FromAngle(Angle(ang.p, ang.y, roll))
end
function class.Static:Rotation(axis, ang)
axis = axis:GetNormalized()
ang = ang * deg2rad * 0.5
return class:New(math.cos(ang), axis.x * math.sin(ang), axis.y * math.sin(ang), axis.z * math.sin(ang))
end
-- Meta
function class.__unm(self)
return class:New(-self[1], -self[2], -self[3], -self[4])
end
function class.__add(a, b)
if isnumber(b) then
return class:New(a[1] + b, a[2], a[3], a[4])
end
return class:New(a[1] + b[1], a[2] + b[2], a[3] + b[3], a[4] + b[4])
end
function class.__sub(a, b)
if isnumber(b) then
return class:New(a[1] - b, a[2], a[3], a[4])
end
return class:New(a[1] - b[1], a[2] - b[2], a[3] - b[3], a[4] - b[4])
end
function class.__mul(a, b)
return class:New(unpack(qmul(a, b)))
end
-- Methods
function class:Angle()
local l = math.sqrt((self[1] * self[1]) + (self[2] * self[2]) + (self[3] * self[3]) + (self[4] * self[4]))
if l == 0 then
return Angle()
end
local q1 = self[1] / l
local q2 = self[2] / l
local q3 = self[3] / l
local q4 = self[4] / l
local x = Vector(
(q1 * q1) + (q2 * q2) - (q3 * q3) - (q4 * q4),
(2 * q3 * q2) + (2 * q4 * q1),
(2 * q4 * q2) - (2 * q3 * q1)
)
local y = Vector(
(2 * q2 * q3) - (2 * q4 * q1),
(q1 * q1) - (q2 * q2) + (q3 * q3) - (q4 * q4),
(2 * q2 * q1) + (2 * q3 * q4)
)
local ang = x:Angle()
ang.p = math.NormalizeAngle(ang.p)
ang.y = math.NormalizeAngle(ang.y)
local yyaw = Vector(0, 1, 0)
yyaw:Rotate(Angle(0, ang.y, 0))
local roll = math.acos(math.Clamp(y:Dot(yyaw), -1, 1)) * rad2deg
local dot = y.z
if dot < 0 then
roll = -roll
end
return Angle(ang.p, ang.y, roll)
end
TankLib.Quaternion = class
| 20.635135 | 107 | 0.588736 |
3f1fec7621ef992d6bd8e668c951c177ff04698c
| 2,097 |
swift
|
Swift
|
Tests/SMStorageTests/UserDefaultsTests.swift
|
siginur/SMStorage
|
9ff6d9ec016797699d4e64557c97490b7e40740e
|
[
"MIT"
] | null | null | null |
Tests/SMStorageTests/UserDefaultsTests.swift
|
siginur/SMStorage
|
9ff6d9ec016797699d4e64557c97490b7e40740e
|
[
"MIT"
] | null | null | null |
Tests/SMStorageTests/UserDefaultsTests.swift
|
siginur/SMStorage
|
9ff6d9ec016797699d4e64557c97490b7e40740e
|
[
"MIT"
] | null | null | null |
import XCTest
import SMStorage
final class SMStorageTests: XCTestCase {
let intValue: Int = 1
let doubleValue: Double = 2.3
let stringValue: String = "stringValue"
let boolValue: Bool = true
let dataValue: Data = "some data".data(using: .utf8)!
func testString() throws {
let storage = SMStorage.userDefaults()
storage["int"] = intValue
storage["string"] = stringValue
storage["double"] = doubleValue
storage["bool"] = boolValue
storage["data"] = dataValue
XCTAssertEqual(intValue, storage["int"])
XCTAssertEqual(stringValue, storage["string"])
XCTAssertEqual(doubleValue, storage["double"])
XCTAssertEqual(boolValue, storage["bool"])
XCTAssertEqual(dataValue, storage["data"])
}
func testInt() throws {
let storage = SMStorage<Int>.userDefaults()
storage[1] = intValue
storage[2] = stringValue
storage[3] = doubleValue
storage[4] = boolValue
storage[5] = dataValue
XCTAssertEqual(intValue, storage[1])
XCTAssertEqual(stringValue, storage[2])
XCTAssertEqual(doubleValue, storage[3])
XCTAssertEqual(boolValue, storage[4])
XCTAssertEqual(dataValue, storage[5])
}
func testEnum() throws {
enum Key: String, StorageKey {
case int
case string
case double
case bool
case dataValue
var key: String { rawValue }
}
let storage = SMStorage<Key>.userDefaults()
storage[.int] = intValue
storage[.string] = stringValue
storage[.double] = doubleValue
storage[.bool] = boolValue
storage[.dataValue] = dataValue
XCTAssertEqual(intValue, storage[.int])
XCTAssertEqual(stringValue, storage[.string])
XCTAssertEqual(doubleValue, storage[.double])
XCTAssertEqual(boolValue, storage[.bool])
XCTAssertEqual(dataValue, storage[.dataValue])
}
}
| 30.391304 | 57 | 0.596567 |
bb328ae07cbc1f78ac956231d6855b21a90e84a0
| 9,724 |
html
|
HTML
|
encryptcontent/decrypt-form.tpl.html
|
lionelyoung/mkdocs-encryptcontent-plugin
|
5306828e5dcd328300e6604ee52a9f557fb27d73
|
[
"MIT"
] | null | null | null |
encryptcontent/decrypt-form.tpl.html
|
lionelyoung/mkdocs-encryptcontent-plugin
|
5306828e5dcd328300e6604ee52a9f557fb27d73
|
[
"MIT"
] | null | null | null |
encryptcontent/decrypt-form.tpl.html
|
lionelyoung/mkdocs-encryptcontent-plugin
|
5306828e5dcd328300e6604ee52a9f557fb27d73
|
[
"MIT"
] | null | null | null |
<div id="mkdocs-encrypted-content" style="display:none">{{ ciphertext_bundle }}</div>
<div id="mkdocs-decrypted-content">
<form id="mkdocs-decrypt-form">
<h1>{{ summary }}</h1>
{% if encryption_info_message %}<p>{{ encryption_info_message }}</p>{% endif %}
<input type="password" id="mkdocs-content-password" placeholder="{{ placeholder }}" />
{% if password_button %}<button id="mkdocs-decrypt-button">{{ password_button_text }}</button>{% endif %}
<p id="mkdocs-decrypt-msg"></p>
</form>
</div>
{% for library in js_libraries %}
<script type="text/javascript" src="{{ library }}"></script>
{% endfor %}
<script type="text/javascript">
(function() {
var strip_padding = function(padded_content, padding_char) {
/* Strips the padding character from decrypted content. */
for (var i = padded_content.length; i > 0; i--) {
if (padded_content[i - 1] !== padding_char) {
return padded_content.slice(0, i);
}
}
};
var decrypt_content = function(password, iv_b64, ciphertext_b64, padding_char) {
/* Decrypts the content from the ciphertext bundle. */
var key = CryptoJS.MD5(password),
iv = CryptoJS.enc.Base64.parse(iv_b64),
ciphertext = CryptoJS.enc.Base64.parse(ciphertext_b64),
bundle = {
key: key,
iv: iv,
ciphertext: ciphertext
};
var plaintext = CryptoJS.AES.decrypt(bundle, key, {
iv: iv,
padding: CryptoJS.pad.NoPadding
});
try {
return strip_padding(plaintext.toString(CryptoJS.enc.Utf8), padding_char);
} catch (err) {
// encoding failed; wrong password
return false;
}
};
{% if remember_password %}
var setCookie = function(name,value,days,path) {
/* Set local cookie to store password */
var expires = "";
var current_path = "; path=/"
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
}
if (path) {
current_path = "; path=" + path
}
{% if disable_cookie_protection %}
encryptcontent = name + "=" + encodeURIComponent(value || "") + expires + current_path;
{% else %}
encryptcontent = name + "=" + encodeURIComponent(value || "") + expires + current_path;
// add security flag on cookie
encryptcontent = encryptcontent + "; SameSite=Strict; Secure";
{% endif %}
return encryptcontent;
};
var getCookie = function(name) {
/* Get password store in cookie */
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
};
{% endif %}
var init_decryptor = function() {
var password_input = document.getElementById('mkdocs-content-password'),
encrypted_content = document.getElementById('mkdocs-encrypted-content'),
decrypted_content = document.getElementById('mkdocs-decrypted-content'),
{% if password_button %}
decrypt_button = document.getElementById("mkdocs-decrypt-button"),
{% endif %}
decrypt_form = document.getElementById('mkdocs-decrypt-form');
// Adjust password field width to placeholder length
let input = document.getElementById("mkdocs-content-password");
input.setAttribute('size', input.getAttribute('placeholder').length);
{% if encrypted_something %}
var encrypted_something = {{ encrypted_something }}
// Decrypt all others elements
var decrypt_somethings = function() {
var html_item = ''
for (const [name, tag] of Object.entries(encrypted_something)) {
if (tag[1] == 'id') {
html_item = [document.getElementById(name)];
} else if (tag[1] == 'class') {
html_item = document.getElementsByClassName(name);
} else {
console.log('Unknow tag html found ...');
}
for (i = 0; i < html_item.length; i++) {
// grab the cipher bundle
var parts = html_item[i].innerHTML.split(';');
// decrypt it
var content = decrypt_content(
password_input.value,
parts[0],
parts[1],
parts[2]
);
if (content) {
// success; display the decrypted content
html_item[i].innerHTML = content;
html_item[i].style.display = null;
// any post processing on the decrypted content should be done here
}
}
}
}
{% endif %}
// Decrypt content
var decrypt_action = function() {
// grab the ciphertext bundle
var parts = encrypted_content.innerHTML.split(';');
// decrypt it
var content = decrypt_content(
password_input.value,
parts[0],
parts[1],
parts[2]
);
if (content) {
// success; display the decrypted content
decrypted_content.innerHTML = content;
encrypted_content.parentNode.removeChild(encrypted_content);
// any post processing on the decrypted content should be done here
{% if arithmatex %}MathJax.typesetPromise(){% endif %}
{% if hljs %}
document.getElementById("mkdocs-decrypted-content").querySelectorAll('pre code').forEach((block) => {
hljs.highlightBlock(block);
});
{% endif %}
} else {
// create HTML element for the inform message
var decrypt_msg = document.createElement('p');
decrypt_msg.setAttribute('id', 'mkdocs-decrypt-msg')
var node = document.createTextNode('{{ decryption_failure_message }}')
decrypt_msg.appendChild(node)
var mkdocs_decrypt_msg = document.getElementById('mkdocs-decrypt-msg');
// clear all previous failure messages
while (mkdocs_decrypt_msg.firstChild) {
mkdocs_decrypt_msg.firstChild.remove();
}
mkdocs_decrypt_msg.appendChild(decrypt_msg);
password_input.value = '';
password_input.focus();
}
}
{% if remember_password %}
/* If remember_password is set, try to use cookie to decrypt content when page is loaded */
var password_cookie = getCookie('encryptcontent')
if (password_cookie) {
password_input.value = password_cookie
decrypt_action();
{% if encrypted_something %}
decrypt_somethings();
{% endif %}
}
{% endif %}
{% if password_button %}
if (decrypt_button) {
decrypt_button.onclick = function(event) {
event.preventDefault();
decrypt_action();
{% if encrypted_something %}
decrypt_somethings();
{% endif %}
};
}
{% endif %}
password_input.addEventListener('keydown', function(event) {
if (event.key === "Enter") {
{% if remember_password %}
if (event.ctrlKey) {
// set password on cookie with default path=/ (Overwrite specific cookie)
// this cookie can by use on all page of your site
document.cookie = setCookie("encryptcontent", password_input.value, 1)
} else {
// set password on cookie with specific path=document.location.pathname
// this cookie can only be use on this specific page of your site
document.cookie = setCookie("encryptcontent", password_input.value, 1, document.location.pathname)
}
{% endif %}
event.preventDefault();
decrypt_action();
{% if encrypted_something %}
decrypt_somethings();
{% endif %}
}
});
};
document.addEventListener('DOMContentLoaded', init_decryptor);
})();
</script>
| 46.526316 | 122 | 0.487659 |
4af7687aa9a57022ced5cc6e8f0e2d247224084c
| 4,800 |
asm
|
Assembly
|
vp8/encoder/arm/neon/fastfdct4x4_neon.asm
|
mrchapp/libvpx
|
c2a8d8b54c7ebefd1cd9c55f53b9e8378f088e8b
|
[
"BSD-3-Clause"
] | 1 |
2015-05-03T19:25:39.000Z
|
2015-05-03T19:25:39.000Z
|
vp8/encoder/arm/neon/fastfdct4x4_neon.asm
|
mrchapp/libvpx
|
c2a8d8b54c7ebefd1cd9c55f53b9e8378f088e8b
|
[
"BSD-3-Clause"
] | null | null | null |
vp8/encoder/arm/neon/fastfdct4x4_neon.asm
|
mrchapp/libvpx
|
c2a8d8b54c7ebefd1cd9c55f53b9e8378f088e8b
|
[
"BSD-3-Clause"
] | null | null | null |
;
; Copyright (c) 2010 The VP8 project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
EXPORT |vp8_fast_fdct4x4_neon|
ARM
REQUIRE8
PRESERVE8
AREA ||.text||, CODE, READONLY, ALIGN=2
;void vp8_fast_fdct4x4_c(short *input, short *output, int pitch);
;NOTE:
;The input *src_diff. src_diff is calculated as:
;diff_ptr[c] = src_ptr[c] - pred_ptr[c]; (in Subtract* function)
;In which *src_ptr and *pred_ptr both are unsigned char.
;Therefore, *src_diff should be in the range of [-255, 255].
;CAUTION:
;The input values of 25th block are set in vp8_build_dcblock function, which are out of [-255, 255].
;But, VP8 encoder only uses vp8_short_fdct4x4_c for 25th block, not vp8_fast_fdct4x4_c. That makes
;it ok for assuming *input in [-255, 255] in vp8_fast_fdct4x4_c, but not ok in vp8_short_fdct4x4_c.
|vp8_fast_fdct4x4_neon| PROC
vld1.16 {d2}, [r0], r2 ;load input
ldr r12, _ffdct_coeff_
vld1.16 {d3}, [r0], r2
vld1.16 {d4}, [r0], r2
vld1.16 {d0}, [r12]
vld1.16 {d5}, [r0], r2
;First for-loop
;transpose d2, d3, d4, d5. Then, d2=ip[0], d3=ip[1], d4=ip[2], d5=ip[3]
vtrn.32 d2, d4
vtrn.32 d3, d5
vtrn.16 d2, d3
vtrn.16 d4, d5
vadd.s16 d6, d2, d5 ;ip[0]+ip[3]
vadd.s16 d7, d3, d4 ;ip[1]+ip[2]
vsub.s16 d8, d3, d4 ;ip[1]-ip[2]
vsub.s16 d9, d2, d5 ;ip[0]-ip[3]
vshl.i16 q3, q3, #1 ; a1, b1
vshl.i16 q4, q4, #1 ; c1, d1
vadd.s16 d10, d6, d7 ;temp1 = a1 + b1
vsub.s16 d11, d6, d7 ;temp2 = a1 - b1
vqdmulh.s16 q6, q5, d0[1]
vqdmulh.s16 q8, q4, d0[0]
vqdmulh.s16 q7, q4, d0[2]
vshr.s16 q6, q6, #1
vshr.s16 q8, q8, #1
vshr.s16 q7, q7, #1 ;d14:temp1 = ( c1 * x_c3)>>16; d15:temp1 = (d1 * x_c3)>>16
vadd.s16 q8, q4, q8 ;d16:temp2 = ((c1 * x_c1)>>16) + c1; d17:temp2 = ((d1 * x_c1)>>16) + d1
vadd.s16 d2, d10, d12 ;op[0] = ((temp1 * x_c2 )>>16) + temp1
vadd.s16 d4, d11, d13 ;op[2] = ((temp2 * x_c2 )>>16) + temp2
vadd.s16 d3, d14, d17 ;op[1] = temp1 + temp2 -- q is not necessary, just for protection
vsub.s16 d5, d15, d16 ;op[3] = temp1 - temp2
;Second for-loop
;transpose d2, d3, d4, d5. Then, d2=ip[0], d3=ip[4], d4=ip[8], d5=ip[12]
vtrn.32 d2, d4
vtrn.32 d3, d5
vtrn.16 d2, d3
vtrn.16 d4, d5
vadd.s16 d6, d2, d5 ;a1 = ip[0]+ip[12]
vadd.s16 d7, d3, d4 ;b1 = ip[4]+ip[8]
vsub.s16 d8, d3, d4 ;c1 = ip[4]-ip[8]
vsub.s16 d9, d2, d5 ;d1 = ip[0]-ip[12]
vadd.s16 d10, d6, d7 ;temp1 = a1 + b1
vsub.s16 d11, d6, d7 ;temp2 = a1 - b1
vqdmulh.s16 q6, q5, d0[1]
vqdmulh.s16 q8, q4, d0[0]
vqdmulh.s16 q7, q4, d0[2]
vshr.s16 q6, q6, #1
vshr.s16 q8, q8, #1
vshr.s16 q7, q7, #1 ;d14:temp1 = ( c1 * x_c3)>>16; d15:temp1 = (d1 * x_c3)>>16
vadd.s16 q8, q4, q8 ;d16:temp2 = ((c1 * x_c1)>>16) + c1; d17:temp2 = ((d1 * x_c1)>>16) + d1
vadd.s16 d2, d10, d12 ;a2 = ((temp1 * x_c2 )>>16) + temp1
vadd.s16 d4, d11, d13 ;c2 = ((temp2 * x_c2 )>>16) + temp2
vadd.s16 d3, d14, d17 ;b2 = temp1 + temp2 -- q is not necessary, just for protection
vsub.s16 d5, d15, d16 ;d2 = temp1 - temp2
vclt.s16 q3, q1, #0
vclt.s16 q4, q2, #0
vsub.s16 q1, q1, q3
vsub.s16 q2, q2, q4
vshr.s16 q1, q1, #1
vshr.s16 q2, q2, #1
vst1.16 {q1, q2}, [r1]
bx lr
ENDP
;-----------------
AREA fastfdct_dat, DATA, READONLY
;Data section with name data_area is specified. DCD reserves space in memory for 48 data.
;One word each is reserved. Label filter_coeff can be used to access the data.
;Data address: filter_coeff, filter_coeff+4, filter_coeff+8 ...
_ffdct_coeff_
DCD ffdct_coeff
ffdct_coeff
; 60547 = 0xEC83
; 46341 = 0xB505
; 25080 = 0x61F8
DCD 0xB505EC83, 0x000061F8
END
| 37.5 | 116 | 0.515 |
7d7ccbf6adc7d38e422c469bcde1a7e59f10d8d0
| 8,781 |
html
|
HTML
|
part2/content/api/docs/common/ref/com/sun/star/sdbcx/View.html
|
brnnnfx/openoffice-org
|
8b1023c59fd9c7a58d108bb0b01dd1f8884c9163
|
[
"Apache-2.0"
] | 5 |
2019-10-14T23:00:48.000Z
|
2021-11-06T22:21:06.000Z
|
part2/content/api/docs/common/ref/com/sun/star/sdbcx/View.html
|
brnnnfx/openoffice-org
|
8b1023c59fd9c7a58d108bb0b01dd1f8884c9163
|
[
"Apache-2.0"
] | 31 |
2020-11-14T09:27:16.000Z
|
2022-03-08T17:09:15.000Z
|
part2/content/api/docs/common/ref/com/sun/star/sdbcx/View.html
|
brnnnfx/openoffice-org
|
8b1023c59fd9c7a58d108bb0b01dd1f8884c9163
|
[
"Apache-2.0"
] | 15 |
2020-11-10T17:04:25.000Z
|
2022-01-31T12:12:48.000Z
|
<html>
<head>
<title>Service View</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../idl.css">
</head>
<body>
<div id="adc-idlref">
<a name="_top_"> </a><table class="navimain" border="0" cellpadding="3">
<tr>
<td class="navimain"><a href="../module-ix.html" class="navimain">Overview</a></td>
<td class="navimain"><a href="module-ix.html" class="navimain">Module</a></td>
<td class="navimain"><a href="View-xref.html" class="navimain">Use</a></td>
<td class="navimainnone">Devguide</td>
<td class="navimain"><a href="../../../../index-files/index-1.html" class="navimain">Index</a></td>
</tr>
</table>
<table class="navisub" border="0" cellpadding="0">
<tr>
<td class="navisub">Services' Summary</td>
<td class="navisub"><a href="#InterfacesSummary" class="navisub">Interfaces' Summary</a></td>
<td class="navisub"><a href="#PropertiesSummary" class="navisub">Properties' Summary</a></td>
<td class="navisub">Services' Details</td>
<td class="navisub"><a href="#InterfacesDetails" class="navisub">Interfaces' Details</a></td>
<td class="navisub"><a href="#PropertiesDetails" class="navisub">Properties' Details</a></td>
</tr>
</table>
<hr>
<table border="0" width="100%" cellpadding="5" cellspacing="3" class="title-table" style="margin-bottom:6pt;">
<tr>
<td><p class="namechain"><a href="../../../../module-ix.html" class="namechain">::</a> <a href="../../../module-ix.html" class="namechain">com</a> :: <a href="../../module-ix.html" class="namechain">sun</a> :: <a href="../module-ix.html" class="namechain">star</a> :: <a href="module-ix.html" class="namechain">sdbcx</a> :: </p>
</td>
</tr>
<tr>
<td class="title">service View</td>
</tr>
<tr>
<td><dl>
<dt><b>Description</b></dt>
<dd>is used to specify views on data. A view object is only used for creation and
deletion. Inspecting the command of a view is normally not supported.
</dd>
<dd><p>
If a view is going to be added to a database, the view must have a unique
name within the view and the table container, as it can be used like a table.
<b>
Note:
</b>
After addition, both the containers for views and the container for tables must
contain an element for the view.
</p>
</dd>
</dl>
</td>
</tr>
</table>
<hr>
<a name="InterfacesSummary"/><table border="1" width="100%" cellpadding="5" cellspacing="0" class="subtitle">
<tr>
<td class="subtitle" colspan="2">Exported Interfaces - Summary</td>
</tr>
<tr>
<td class="imsum_left"><a href="XRename.html">XRename</a></td>
<td class="imsum_right"><p>is optional for implementation.
(<a href="#XRename">details</a>)</p>
</td>
</tr>
<tr>
<td class="imsum_left">::com::sun::star::<a href="../beans/module-ix.html">beans</a>::<a href="../beans/XPropertySet.html">XPropertySet</a></td>
<td class="imsum_right"><dl>
<dt>(referenced entity's summary:)</dt>
<dd>provides information about and access to the
properties from an implementation.
</dd>
</dl>
</td>
</tr>
<tr>
<td class="imsum_left"><a href="XAlterView.html">XAlterView</a></td>
<td class="imsum_right"><p>allows changing the view's <a href="View.html#Command">Command</a>.
(<a href="#XAlterView">details</a>)</p>
</td>
</tr>
</table>
<a name="PropertiesSummary"/><table border="1" width="100%" cellpadding="5" cellspacing="0" class="subtitle">
<tr>
<td class="subtitle" colspan="2">Properties' Summary</td>
</tr>
<tr>
<td class="imsum_left">[ readonly ] string<br>
<a href="#Name">Name</a></td>
<td class="imsum_right">is the name of the view.
</td>
</tr>
<tr>
<td class="imsum_left">[ readonly ] string<br>
<a href="#CatalogName">CatalogName</a></td>
<td class="imsum_right">is the name of the views catalog, may be empty.
</td>
</tr>
<tr>
<td class="imsum_left">[ readonly ] string<br>
<a href="#SchemaName">SchemaName</a></td>
<td class="imsum_right">is the name of the view's schema, may be empty.
</td>
</tr>
<tr>
<td class="imsum_left">[ readonly ] string<br>
<a href="#Command">Command</a></td>
<td class="imsum_right">is the command for creating the view.
</td>
</tr>
<tr>
<td class="imsum_left">[ readonly ] long<br>
<a href="#CheckOption">CheckOption</a></td>
<td class="imsum_right">indicates if a check option should be used for the view.
</td>
</tr>
</table>
<a name="InterfacesDetails"/><table border="1" width="100%" cellpadding="5" cellspacing="0" class="subtitle">
<tr>
<td class="subtitle" colspan="2">Exported Interfaces - Details</td>
</tr>
<tr/>
<tr>
<td class="imdetail"><a name="XRename" class="membertitle"><a href="XRename.html">XRename</a></a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-data" bgcolor="#ffffff" align="center">
<tr>
<td><dl>
<dt><b>Usage Restrictions</b></dt>
<dd><i>optional</i></dd>
<dt><b>Description</b></dt>
<dd>is optional for implementation.
</dd>
</dl>
</td>
</tr>
</table>
</td>
</tr>
<tr/>
<tr>
<td class="imdetail"><a name="XPropertySet" class="membertitle">::com::sun::star::<a href="../beans/module-ix.html">beans</a>::<a href="../beans/XPropertySet.html">XPropertySet</a></a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-data" bgcolor="#ffffff" align="center">
<tr>
<td><dl>
<dt>(referenced entity's summary:)</dt>
<dd>provides information about and access to the
properties from an implementation.
</dd>
</dl>
</td>
</tr>
</table>
</td>
</tr>
<tr/>
<tr>
<td class="imdetail"><a name="XAlterView" class="membertitle"><a href="XAlterView.html">XAlterView</a></a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-data" bgcolor="#ffffff" align="center">
<tr>
<td><dl>
<dt><b>Usage Restrictions</b></dt>
<dd><i>optional</i></dd>
<dt><b>Description</b></dt>
<dd>allows changing the view's <a href="View.html#Command">Command</a>.
</dd>
</dl>
</td>
</tr>
</table>
</td>
</tr>
</table>
<a name="PropertiesDetails"/><table border="1" width="100%" cellpadding="5" cellspacing="0" class="subtitle">
<tr>
<td class="subtitle">Properties' Details</td>
</tr>
<tr>
<td class="imdetail"><a name="Name" class="membertitle">Name</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-data" bgcolor="#ffffff" align="center">
<tr>
<td>[ readonly ] string <b>Name</b>;<hr>
<dl>
<dt><b>Description</b></dt>
<dd>is the name of the view.
</dd>
</dl>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="imdetail"><a name="CatalogName" class="membertitle">CatalogName</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-data" bgcolor="#ffffff" align="center">
<tr>
<td>[ readonly ] string <b>CatalogName</b>;<hr>
<dl>
<dt><b>Description</b></dt>
<dd>is the name of the views catalog, may be empty.
</dd>
</dl>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="imdetail"><a name="SchemaName" class="membertitle">SchemaName</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-data" bgcolor="#ffffff" align="center">
<tr>
<td>[ readonly ] string <b>SchemaName</b>;<hr>
<dl>
<dt><b>Description</b></dt>
<dd>is the name of the view's schema, may be empty.
</dd>
</dl>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="imdetail"><a name="Command" class="membertitle">Command</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-data" bgcolor="#ffffff" align="center">
<tr>
<td>[ readonly ] string <b>Command</b>;<hr>
<dl>
<dt><b>Description</b></dt>
<dd>is the command for creating the view.
</dd>
<dd><p>This is typically a SQL Select-Statement.</p>
<p>This property might be empty when a backend does not support retrieving the current
SQL command of a view. However, if the <code>View</code> supports altering its command
via the <a href="#XAlterView">XAlterView</a> interface, then it's required to also provide the
current SQL command in the <code>Command</code> property.</p>
</dd>
</dl>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="imdetail"><a name="CheckOption" class="membertitle">CheckOption</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-data" bgcolor="#ffffff" align="center">
<tr>
<td>[ readonly ] long <b>CheckOption</b>;<hr>
<dl>
<dt><b>Description</b></dt>
<dd>indicates if a check option should be used for the view.
</dd>
<dt><b>See also</b></dt>
<dd><a href="CheckOption.html">CheckOption</a></dd>
</dl>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br> <a href="#_top_">Top of Page</a><hr size="3"><p class="copyright" align="center">Copyright © 2013, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.</p>
</div> <!-- id="adc-idlref" -->
</body>
</html>
| 32.522222 | 375 | 0.668261 |
e0dd6f01cd34c13c1202a3b29b51ac7827032c28
| 1,370 |
kt
|
Kotlin
|
core/src/main/kotlin/net/justmachinery/futility/streams/OverrideInputStream.kt
|
ScottPeterJohnson/futility
|
0f863a873fa6caf3aef136b03c1b5c1fde9bb9ac
|
[
"Apache-2.0"
] | null | null | null |
core/src/main/kotlin/net/justmachinery/futility/streams/OverrideInputStream.kt
|
ScottPeterJohnson/futility
|
0f863a873fa6caf3aef136b03c1b5c1fde9bb9ac
|
[
"Apache-2.0"
] | null | null | null |
core/src/main/kotlin/net/justmachinery/futility/streams/OverrideInputStream.kt
|
ScottPeterJohnson/futility
|
0f863a873fa6caf3aef136b03c1b5c1fde9bb9ac
|
[
"Apache-2.0"
] | null | null | null |
package net.justmachinery.futility.streams
import java.io.InputStream
import java.io.OutputStream
/**
* Unlike FilterInputStream and FilterOutputStream, these don't have hidden stupidities, like writing all the bytes
* in a write(ByteArray,Int,Int) method one by one.
* Note that if you override any of the read() methods, you probably want to override all of them.
*/
public open class OverrideInputStream(public val input: InputStream) : InputStream() {
override fun read(): Int = input.read()
override fun available(): Int = input.available()
override fun close(): Unit = input.close()
override fun mark(readlimit: Int): Unit = input.mark(readlimit)
override fun markSupported(): Boolean = input.markSupported()
override fun read(b: ByteArray?): Int = input.read(b)
override fun read(b: ByteArray?, off: Int, len: Int): Int = input.read(b, off, len)
override fun readAllBytes(): ByteArray = input.readAllBytes()
override fun readNBytes(len: Int): ByteArray = input.readNBytes(len)
override fun readNBytes(b: ByteArray?, off: Int, len: Int): Int = input.readNBytes(b, off, len)
override fun reset(): Unit = input.reset()
override fun skip(n: Long): Long = input.skip(n)
override fun transferTo(out: OutputStream?): Long = input.transferTo(out)
override fun skipNBytes(n: Long): Unit = input.skipNBytes(n)
}
| 52.692308 | 115 | 0.720438 |
74bde1e3735d606a9b32e06a3f471c8e8e69bd7a
| 665 |
js
|
JavaScript
|
src/gamemechanic/Leveling.js
|
ketzu/wanted-idle
|
5537d7d525564acafbbbd339847a1b07243c4a33
|
[
"Apache-2.0"
] | null | null | null |
src/gamemechanic/Leveling.js
|
ketzu/wanted-idle
|
5537d7d525564acafbbbd339847a1b07243c4a33
|
[
"Apache-2.0"
] | null | null | null |
src/gamemechanic/Leveling.js
|
ketzu/wanted-idle
|
5537d7d525564acafbbbd339847a1b07243c4a33
|
[
"Apache-2.0"
] | null | null | null |
export class Leveling {
constructor() {
this.level = 1;
this.exp = 0;
this.levelups = [
0, 1000, 2000, 4000, 8000, 16000, 32000, Infinity
];
this.boni = [
0, 1, 1.05, 1.15, 1.3, 1.5, 2, 3
];
}
tick() {
this.exp += 1;
if(this.exp > this.levelups[this.level])
this.level += 1;
}
bonus() {
return this.boni[this.level];
}
nextlevelexp() {
return this.levelups[this.level];
}
baselevelexp() {
return this.levelups[this.level-1];
}
toJSON() {
return {__objtype: "Leveling", ...this};
}
}
| 19.558824 | 61 | 0.464662 |
8909612bac12b7e07ed32db681c9b05c3e1599e6
| 309 |
asm
|
Assembly
|
libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sccz80/SMS_VRAMmemcpy_brief_callee.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640 |
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sccz80/SMS_VRAMmemcpy_brief_callee.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600 |
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sccz80/SMS_VRAMmemcpy_brief_callee.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215 |
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
; void SMS_VRAMmemcpy_brief(unsigned int dst,void *src,unsigned char size)
SECTION code_clib
SECTION code_SMSlib
PUBLIC SMS_VRAMmemcpy_brief_callee
EXTERN asm_SMSlib_VRAMmemcpy_brief
SMS_VRAMmemcpy_brief_callee:
pop hl
pop bc
pop de
ex (sp),hl
ld b,c
jp asm_SMSlib_VRAMmemcpy_brief
| 16.263158 | 74 | 0.783172 |
74c749f7956a0f11191f57b380fde113e7068682
| 1,544 |
js
|
JavaScript
|
src/components/PostHero/index.js
|
vitordino/vitordino.com
|
1dd8f8b4a308f4d0afd4352a88f75fb63ee7dd08
|
[
"MIT"
] | 10 |
2020-04-03T11:16:07.000Z
|
2021-02-23T02:23:05.000Z
|
src/components/PostHero/index.js
|
vitordino/vitordino.com
|
1dd8f8b4a308f4d0afd4352a88f75fb63ee7dd08
|
[
"MIT"
] | 7 |
2020-04-03T09:22:29.000Z
|
2022-02-27T08:09:32.000Z
|
src/components/PostHero/index.js
|
vitordino/vitordino.com
|
1dd8f8b4a308f4d0afd4352a88f75fb63ee7dd08
|
[
"MIT"
] | null | null | null |
import React from 'react'
import styled from 'styled-components'
import Canvas from '~/components/Canvas'
import Container from '~/components/Container'
import Spacer from '~/components/Spacer'
import Grid from '~/components/Grid'
import Text from '~/components/Text'
import ColorMode from '~/components/ColorMode'
const Wrapper = styled.div`
position: relative;
background: var(--color-base00);
color: var(--color-base);
`
const Content = styled(Container)`
position: relative;
`
const Tags = styled.ul`
display: flex;
flex-wrap: wrap;
margin: -1.5rem;
`
const Tag = styled(Text)`
margin: 1.5rem;
opacity: 0.5;
`
const PostHero = ({
title,
description,
tags,
canvas,
colorMode = 'dark',
...children
}) => (
<ColorMode mode={colorMode}>
<Wrapper>
<Canvas canvas={canvas} />
<Content>
<Spacer.V xs={4} md={6} lg={8} />
<Grid.Row>
<Grid.Column xs={0} lg={1} xg={2} />
<Grid.Column xs={16} md={10} lg={8} xg={6}>
<Text xs={5} md={6} weight={600} case='lowercase'>
{title}
</Text>
<Spacer.V xs={1} />
<Text xs={1} md={2}>
{description}
</Text>
<Spacer.V xs={4} md={6} lg={8} />
{!!tags?.length && (
<>
<Spacer.V xs={2} md={4} />
<Tags>
{tags.map(tag => (
<Tag key={tag} xs={0} as='li'>
{tag}
</Tag>
))}
</Tags>
<Spacer.V xs={1.5} />
</>
)}
</Grid.Column>
</Grid.Row>
</Content>
</Wrapper>
</ColorMode>
)
export default PostHero
| 20.315789 | 56 | 0.560233 |
16225152ac07ea698f24e5538f326089a5e6807f
| 1,249 |
h
|
C
|
iyan3d/trunk/Iyan3D_iOS/Iyan3D/ui/Popover Views/AnimationSelectionCollectionViewCell.h
|
RCGamer21/appanimar
|
4161f1c2dc319256b5e489cdbb439757e03bcd07
|
[
"MIT"
] | 1 |
2019-12-21T08:15:08.000Z
|
2019-12-21T08:15:08.000Z
|
iyan3d/trunk/Iyan3D_iOS/Iyan3D/ui/Popover Views/AnimationSelectionCollectionViewCell.h
|
lanping100/Iyan3d
|
c21bb191cec06039a3f6e9b2f19381cbd7537757
|
[
"MIT"
] | null | null | null |
iyan3d/trunk/Iyan3D_iOS/Iyan3D/ui/Popover Views/AnimationSelectionCollectionViewCell.h
|
lanping100/Iyan3d
|
c21bb191cec06039a3f6e9b2f19381cbd7537757
|
[
"MIT"
] | null | null | null |
//
// AnimationSelectionCollectionViewCell.h
// Iyan3D
//
// Created by Sankar on 21/12/15.
// Copyright © 2015 Smackall Games. All rights reserved.
//
#ifndef AnimationSelectionCollectionViewCell_h
#define AnimationSelectionCollectionViewCell_h
#import <UIKit/UIKit.h>
#import "WEPopoverController.h"
#import "PopUpViewController.h"
#import "SmartImageView.h"
@protocol AnimationPropsDelegate
- (void) deleteAnimationAtIndex:(int) indexVal;
- (void) cloneAnimation:(int) indexVal;
- (void) renameAnimation:(int) indexVal;
- (void) setSelectedAnimationAtIndex:(int)indexVal;
@end
@interface AnimationSelectionCollectionViewCell : UICollectionViewCell < PopUpViewControllerDelegate >
@property (assign) int selectedIndex;
@property (assign) int category;
@property (strong, nonatomic) id parentVC;
@property (weak, nonatomic) IBOutlet UIButton *propsBtn;
@property (weak, nonatomic) IBOutlet UILabel *assetNameLabel;
@property (weak, nonatomic) IBOutlet SmartImageView *assetImageView;
@property (weak, nonatomic) id < AnimationPropsDelegate > delegate;
@property (nonatomic, strong) WEPopoverController *popoverController;
@property (nonatomic, strong) PopUpViewController *popUpVc;
- (IBAction)propsAction:(id)sender;
@end
#endif
| 26.574468 | 102 | 0.789432 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.