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
43da6df5ba10a8bd6c8717b03ed30ac8b0907f95
1,441
ts
TypeScript
src/reducers/myAccount/return/apply/express.ts
vucrr/mobile-next
d3016ffb758206fb9d93be1b421e0eff1f1e499f
[ "MIT" ]
null
null
null
src/reducers/myAccount/return/apply/express.ts
vucrr/mobile-next
d3016ffb758206fb9d93be1b421e0eff1f1e499f
[ "MIT" ]
10
2020-09-04T22:06:59.000Z
2022-03-03T22:19:18.000Z
src/reducers/myAccount/return/apply/express.ts
vucrr/mobile-next
d3016ffb758206fb9d93be1b421e0eff1f1e499f
[ "MIT" ]
null
null
null
import { CHANGE_EXPRESS_ADDRESS, CHANGE_EXPRESS_TIME, CHANGE_EXPRESS_TYPE, FETCH_EXPRESS_LOGISTICS, FETCH_RETURN_APPLY_DETAIL, GET_EXPRESS_NUMBER, } from 'constant/index' import { fromJS } from 'immutable' import { ExpressDetailReturn, LogisticReturn } from 'interfaces/account/return/apply' import { handleActions } from 'redux-actions' const initialInfo: any = { expressTime: {}, expressType: '', detail: {}, expressNo: '', expressAddress: {}, logistics: {}, // 物流详情 } const expressInfoReturn = handleActions( { [FETCH_RETURN_APPLY_DETAIL](state, { payload }) { const res: ExpressDetailReturn = payload return state.set('detail', fromJS(res)) }, [CHANGE_EXPRESS_TIME](state, { payload }) { const res = payload return state.set('expressTime', fromJS(res)) }, [CHANGE_EXPRESS_TYPE](state, { payload }) { const res = payload return state.set('expressType', fromJS(res)) }, [GET_EXPRESS_NUMBER](state, { payload }) { const res = payload return state.set('expressNo', fromJS(res)) }, [CHANGE_EXPRESS_ADDRESS](state, { payload }) { const res = payload return state.set('expressAddress', fromJS(res)) }, [FETCH_EXPRESS_LOGISTICS](state, { payload }) { const res: LogisticReturn = payload return state.set('logistics', fromJS(res)) }, }, fromJS(initialInfo), ) export default expressInfoReturn
27.188679
85
0.66898
da8bd1f8104c7c657b9a2b82705eb798dc0ceb34
4,517
ts
TypeScript
src/renderer/ui/forgot.ts
omenking/push2pop
97338ac9cfa8350b44385ad3cb00bc9959d3f36d
[ "MIT" ]
46
2017-09-05T00:21:53.000Z
2022-03-03T06:41:07.000Z
src/renderer/ui/forgot.ts
omenking/push2pop
97338ac9cfa8350b44385ad3cb00bc9959d3f36d
[ "MIT" ]
241
2017-08-31T16:16:42.000Z
2018-02-28T12:57:59.000Z
src/renderer/ui/forgot.ts
omenking/push2pop
97338ac9cfa8350b44385ad3cb00bc9959d3f36d
[ "MIT" ]
10
2017-09-08T10:34:03.000Z
2021-08-13T19:19:01.000Z
import * as m from 'mithril' import Ui from 'ui/mode' import {HOST} from 'common/data' const SEND = 'form_send' const CODE = 'code' const RESET = 'form_reset' const state = { email: null, code: null, password: null, password_confirmation: null, state: SEND, errors: {} } function field_error(label,key){ if (state.errors[key]) { const arr = [] for(let i = 0; i < state.errors[key].length; i++){ arr.push(m('.err_msg', `${label} ${state.errors[key][i]}`) ) } return m('.err',arr) } } function input_email(){ return m('.field.text_field',[ //m('label','Email'), m("input[type='text']", { placeholder: 'Email', onchange: m.withAttr('value',function(val){ state.email = val}), value: state.email }), field_error('Email','email') ]) } function input_code(){ return m('.field.text_field',[ //m('label','Email'), m("input[type='text']", { placeholder: 'Code', onchange: m.withAttr('value',function(val){ state.code = val}), value: state.code }), field_error('Send Code','code') ]) } function input_password(){ return m('.field.text_field',[ //m('label','Password'), m("input[type='password']", { placeholder: 'Password', onchange: m.withAttr('value',function(val){ state.password = val}), value: state.password }), field_error('Password','password') ]) } function input_password_confirm(){ return m('.field.text_field',[ //m('label','Password Confirm'), m("input[type='password']", { placeholder: 'Password Confirm', onchange: m.withAttr('value',function(val){ state.password_confirmation = val}), value: state.password_confirmation }), field_error('Password Confirm','password_confirmation') ]) } function click_cancel(){ Ui.mode = 'login' } function button_submit(){ } function onsubmit(callback){ return function(e){ e.preventDefault() callback() return false } } class Send { static content(){ return m('form', {onsubmit: onsubmit(Send.submit)}, input_email(), Send.button_submit() ) } static button_submit(){ return m('.submit', m("input[type='submit']",{value: 'Email Reset Password'}), m('.button.cancel',{onclick: click_cancel},'Cancel') ) } static submit(){ const data = { email : state.email } m.request({ method: "POST", url: `${HOST}/reset_passwords`, data: data }).then(Send.success,Send.error) } static success(data){ state.state = CODE } static error(errors){ state.errors = errors m.redraw() } } class Code { static content(){ return m('form', {onsubmit: onsubmit(Code.submit)}, input_code(), Code.button_submit() ) } static button_submit(){ return m('.submit', m("input[type='submit']",{value: 'Cofirm Code'}), m('.button.cancel',{onclick: click_cancel},'Cancel') ) } static submit(){ const data = { email : state.email } m.request({ method: "POST", url: `${HOST}/reset_passwords/confirm`, data: data }).then(Code.success,Code.error) } static success(data){ state.state = RESET } static error(errors){ state.errors = errors m.redraw() } } class Reset { static content(){ return m('form', {onsubmit: onsubmit(Reset.submit)}, input_password(), input_password_confirm(), Reset.button_submit() ) } static submit(){ const data = { email : state.email } m.request({ method: "PUT", url: `${HOST}/reset_passwords`, data: data }).then(Reset.success,Reset.error) } static button_submit(){ return m('.submit', m("input[type='submit']",{value: 'Update Password'}), m('.button.cancel',{onclick: click_cancel},'Cancel') ) } static success(data){ } static error(errors){ state.errors = errors m.redraw() } } function content(){ if (state.state === SEND ){ return Send.content() } else if (state.state === CODE ){ return Code.content() } else if (state.state === RESET){ return Reset.content()} } export function reset(){ state.email = null state.code = null state.password = null state.password_confirmation = null state.state = SEND state.errors = {} } export function render(){ return m('main.signup', m('.logo'), content() ) }
22.142157
86
0.586008
dda1e83c884e6d80509ae7c26817ccc56bbf0d6e
969
java
Java
ee-patterns/src/main/java/victor/training/eepatterns/payloadextractor/mdb/TextMessageMDBAfter.java
AdrianaDinca/training
d8d20aa7db9d26b12f7163a70108e6ea22cc5c50
[ "MIT" ]
1
2020-10-22T04:22:39.000Z
2020-10-22T04:22:39.000Z
ee-patterns/src/main/java/victor/training/eepatterns/payloadextractor/mdb/TextMessageMDBAfter.java
AdrianaDinca/training
d8d20aa7db9d26b12f7163a70108e6ea22cc5c50
[ "MIT" ]
null
null
null
ee-patterns/src/main/java/victor/training/eepatterns/payloadextractor/mdb/TextMessageMDBAfter.java
AdrianaDinca/training
d8d20aa7db9d26b12f7163a70108e6ea22cc5c50
[ "MIT" ]
null
null
null
package victor.training.eepatterns.payloadextractor.mdb; import javax.ejb.ActivationConfigProperty; import javax.ejb.MessageDriven; import javax.inject.Inject; import javax.interceptor.Interceptors; import javax.jms.Message; import javax.jms.MessageListener; import victor.training.eepatterns.payloadextractor.PayloadExtractor; import victor.training.eepatterns.payloadextractor.facade.AsyncBusinessFacade; @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/text_in"), @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") }) @Interceptors(PayloadExtractor.class) public class TextMessageMDBAfter implements MessageListener { @Inject private AsyncBusinessFacade facade; @Override public void onMessage(Message message) { } public void consume(String payload) { System.out.println("in Consume method"); facade.consumeTextMessage(payload); } }
30.28125
99
0.817337
c61a092bd9d4e29c89342d98bce2a8e5c53d84f9
435
swift
Swift
gabbie-ios/VIPER/Compose/Interactor/ComposeInteractorOutput.swift
noppefoxwolf/Cironnup-ios
a5c43cd9b5a95b500b0befe803995453140dc324
[ "MIT" ]
4
2019-03-29T12:43:10.000Z
2019-05-30T14:10:42.000Z
gabbie-ios/VIPER/Compose/Interactor/ComposeInteractorOutput.swift
noppefoxwolf/Cironnup-ios
a5c43cd9b5a95b500b0befe803995453140dc324
[ "MIT" ]
null
null
null
gabbie-ios/VIPER/Compose/Interactor/ComposeInteractorOutput.swift
noppefoxwolf/Cironnup-ios
a5c43cd9b5a95b500b0befe803995453140dc324
[ "MIT" ]
null
null
null
// // ComposeInteractorOutput.swift // gabbie-ios // // Created by noppefoxwolf on 14/10/2018. // Copyright © 2018 . All rights reserved. // import Foundation import UIKit protocol ComposeInteractorOutput: class { func didCompressed(_ image: UIImage) func didUploaded(_ id: String, image: UIImage, mediaAttachmentID: String) func didFindNowplayingItem(_ title: String, artist: String?, album: String?, artwork: UIImage?) }
25.588235
97
0.744828
97825952476533f09bf96877a359ca50200de90b
883
ts
TypeScript
packages/backend/api/src/infra/mappers/EvaluationMapper.ts
chewtoys/luminate
f7737347a86a9da643349606f83147c04e3c62d7
[ "MIT" ]
23
2020-01-06T20:20:04.000Z
2021-10-06T23:21:46.000Z
packages/backend/api/src/infra/mappers/EvaluationMapper.ts
chewtoys/luminate
f7737347a86a9da643349606f83147c04e3c62d7
[ "MIT" ]
27
2020-01-30T03:19:27.000Z
2021-07-26T02:35:52.000Z
packages/backend/api/src/infra/mappers/EvaluationMapper.ts
chewtoys/luminate
f7737347a86a9da643349606f83147c04e3c62d7
[ "MIT" ]
9
2020-01-25T21:52:37.000Z
2022-01-09T20:52:24.000Z
import {EntityId} from '@luminate/ddd' import {Evaluation, EvaluationAttributes} from '../../domain/Evaluation' import {IEvaluationDTO} from '../dtos' import {DateEntity} from '../../domain/Date' export class EvaluationMapper { public static toAttrs(obj: any): EvaluationAttributes { return { date: obj.date ? DateEntity.create({value: obj.data}) : undefined, } } public static toDomain(obj: any) { const id = obj.id || obj._id const attrs = EvaluationMapper.toAttrs(obj) return Evaluation.create(attrs, EntityId.create(id)) } public static toDTO(evaluation: Evaluation): IEvaluationDTO { return { id: evaluation.id.toString(), date: evaluation.date?.value, } } public static toPersistence(evaluation: Evaluation): any { return { id: evaluation.id.toString(), date: evaluation.date?.value, } } }
25.970588
72
0.671574
2a9c05b867d11e0e94dda7f455f9e774b1026056
1,452
rs
Rust
day_1/part2.rs
abuchele/adventofcode2021
1ed0ddb6ceef2b8c9eb545e6bbcce11b63138162
[ "MIT" ]
null
null
null
day_1/part2.rs
abuchele/adventofcode2021
1ed0ddb6ceef2b8c9eb545e6bbcce11b63138162
[ "MIT" ]
null
null
null
day_1/part2.rs
abuchele/adventofcode2021
1ed0ddb6ceef2b8c9eb545e6bbcce11b63138162
[ "MIT" ]
null
null
null
use std::fs::File; use std::io::{self, BufRead}; use std::path::Path; fn main() { let mut prevsum: i32 = 100000; let mut num_inc: i32 = 0; let mut prev_vec = Vec::new(); // File hosts must exist in current path before this produces output if let Ok(lines) = read_lines("./day1_input.txt") { // Consumes the iterator, returns an (Optional) String for line in lines { if let Ok(ip) = line { let my_int = ip.parse::<i32>().unwrap(); println!("{:?}", prev_vec); prev_vec.push(my_int); if prev_vec.len() > 3 { prev_vec.remove(0); } if prev_vec.len() == 3 { let currsum = sum_vec(&prev_vec); if currsum > prevsum { num_inc += 1; } prevsum = currsum; } } } } println!("{:?}", num_inc); } pub fn sum_vec(vec: &[i32]) -> i32 { let mut ret_sum: i32 = 0; for num in vec { ret_sum = num + &ret_sum; } ret_sum } // The output is wrapped in a Result to allow matching on errors // Returns an Iterator to the Reader of the lines of the file. fn read_lines<P>(filename: P) -> io::Result<io::Lines<io::BufReader<File>>> where P: AsRef<Path>, { let file = File::open(filename)?; Ok(io::BufReader::new(file).lines()) }
28.470588
75
0.504132
14546f5d8441d916e39112588907b6ca3b0674f3
509
tsx
TypeScript
test/smoke/test-generator-xbc-react/src/pages/demo/mobxDemo.tsx
xbcc123/feflow-devkit-xbc-webpack4
d0a4f0546641d8a4f585120b750d56ff9463013b
[ "MIT" ]
4
2020-04-08T05:39:47.000Z
2020-07-19T02:34:34.000Z
generators/app/templates/src/pages/demo/mobxDemo.tsx
xbcc123/generator-xbc-react
32773247896b4d45083bf9ac8e4d5d369a42ce72
[ "MIT" ]
null
null
null
generators/app/templates/src/pages/demo/mobxDemo.tsx
xbcc123/generator-xbc-react
32773247896b4d45083bf9ac8e4d5d369a42ce72
[ "MIT" ]
3
2020-03-31T05:23:51.000Z
2020-04-16T00:51:10.000Z
import React, { Component } from "react"; import { observer, inject } from "mobx-react"; @inject("oneStore") @observer class Home extends Component { constructor(props) { super(props); this.state = {}; } render() { return ( <div> <h1>birds为:{this.props.oneStore.birds}</h1> <h1>birds为:{this.props.oneStore.birdCount}</h1> <button onClick={() => {this.props.oneStore.addBird(2)}}> 增加数字 </button> </div> ); } } export default Home;
21.208333
65
0.579568
adbdce2fe243a7264807ba753875c44aeb2c8c17
542
rb
Ruby
spec/environment.rb
gerrit/spec_integration
f470a87cd19a4c1afb9972bf45a1f893808fba43
[ "MIT" ]
1
2016-05-08T09:50:46.000Z
2016-05-08T09:50:46.000Z
spec/environment.rb
gerrit/spec_integration
f470a87cd19a4c1afb9972bf45a1f893808fba43
[ "MIT" ]
null
null
null
spec/environment.rb
gerrit/spec_integration
f470a87cd19a4c1afb9972bf45a1f893808fba43
[ "MIT" ]
null
null
null
unless defined?(PLUGIN_ROOT) PLUGIN_ROOT = File.expand_path(File.dirname(__FILE__) + "/..") RAILS_ROOT = PLUGIN_ROOT SUPPORT_TEMP = "#{PLUGIN_ROOT}/tmp" SUPPORT_LIB = "#{SUPPORT_TEMP}/lib" ACTIONPACK_ROOT = "#{SUPPORT_LIB}/actionpack" ACTIVESUPPORT_ROOT = "#{SUPPORT_LIB}/activesupport" ACTIVERECORD_ROOT = "#{SUPPORT_LIB}/activerecord" RSPEC_ROOT = "#{SUPPORT_LIB}/rspec" RSPEC_ON_RAILS_ROOT = "#{SUPPORT_LIB}/rspec_on_rails" SPEC_ROOT = "#{PLUGIN_ROOT}/spec" end
45.166667
72
0.658672
2dfaf04c98a7e522eb35f4b720363908ea457620
196
swift
Swift
DDComponent.playground/Pages/GettingStart.xcplaygroundpage/Contents.swift
arcangelw/DDComponent
28dfbd6bbbbc0ea747e9c276dea0c03a405b1204
[ "MIT" ]
43
2017-07-04T16:05:16.000Z
2022-03-17T12:36:57.000Z
DDComponent.playground/Pages/GettingStart.xcplaygroundpage/Contents.swift
arcangelw/DDComponent
28dfbd6bbbbc0ea747e9c276dea0c03a405b1204
[ "MIT" ]
4
2017-07-21T18:16:19.000Z
2020-04-26T13:58:05.000Z
DDComponent.playground/Pages/GettingStart.xcplaygroundpage/Contents.swift
arcangelw/DDComponent
28dfbd6bbbbc0ea747e9c276dea0c03a405b1204
[ "MIT" ]
7
2018-08-31T03:14:44.000Z
2022-03-17T12:37:00.000Z
//: # Getting Start //: 在使用`Playground`之前,请先执行以下步骤 //: 1. Build `DDComponent` Scheme import DDComponent print("\(NSStringFromClass(DDCollectionViewRootComponent)) is ready!") //: [Next](@next)
19.6
70
0.719388
016a8b4c8421d0d2dc709b0d559f90ca5952d0f2
20,903
sql
SQL
sql/yjbb/600685.sql
liangzi4000/grab-share-info
4dc632442d240c71955bbf927ecf276d570a2292
[ "MIT" ]
null
null
null
sql/yjbb/600685.sql
liangzi4000/grab-share-info
4dc632442d240c71955bbf927ecf276d570a2292
[ "MIT" ]
null
null
null
sql/yjbb/600685.sql
liangzi4000/grab-share-info
4dc632442d240c71955bbf927ecf276d570a2292
[ "MIT" ]
null
null
null
EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2017-09-30',@EPS = N'-0.1323',@EPSDeduct = N'0',@Revenue = N'154.90亿',@RevenueYoy = N'-9.25',@RevenueQoq = N'-19.95',@Profit = N'-1.87亿',@ProfitYoy = N'-2932.28',@ProfiltQoq = N'-1003.81',@NAVPerUnit = N'7.1736',@ROE = N'-1.83',@CashPerUnit = N'-2.7574',@GrossProfitRate = N'6.74',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2017-10-28' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2017-09-30',@EPS = N'-0.1323',@EPSDeduct = N'0',@Revenue = N'154.90亿',@RevenueYoy = N'-9.25',@RevenueQoq = N'-19.95',@Profit = N'-1.87亿',@ProfitYoy = N'-2932.28',@ProfiltQoq = N'-1003.81',@NAVPerUnit = N'7.1736',@ROE = N'-1.83',@CashPerUnit = N'-2.7574',@GrossProfitRate = N'6.74',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2017-10-28' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2016-09-30',@EPS = N'0.0047',@EPSDeduct = N'0',@Revenue = N'170.68亿',@RevenueYoy = N'-0.43',@RevenueQoq = N'-18.71',@Profit = N'660.44万',@ProfitYoy = N'100.70',@ProfiltQoq = N'-184.55',@NAVPerUnit = N'7.2733',@ROE = N'0.06',@CashPerUnit = N'-4.1858',@GrossProfitRate = N'6.14',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2017-10-28' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2016-06-30',@EPS = N'0.0262',@EPSDeduct = N'-0.0476',@Revenue = N'113.60亿',@RevenueYoy = N'5.09',@RevenueQoq = N'61.90',@Profit = N'3707.27万',@ProfitYoy = N'107.06',@ProfiltQoq = N'3378.46',@NAVPerUnit = N'7.2965',@ROE = N'0.36',@CashPerUnit = N'-2.6519',@GrossProfitRate = N'6.38',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2017-08-31' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2016-03-31',@EPS = N'0.0007',@EPSDeduct = N'0',@Revenue = N'43.38亿',@RevenueYoy = N'10.25',@RevenueQoq = N'-48.22',@Profit = N'103.60万',@ProfitYoy = N'100.51',@ProfiltQoq = N'-99.90',@NAVPerUnit = N'7.3004',@ROE = N'0.01',@CashPerUnit = N'-1.2071',@GrossProfitRate = N'7.03',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2017-04-29' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2015-12-31',@EPS = N'0.0709',@EPSDeduct = N'-1.2291',@Revenue = N'255.19亿',@RevenueYoy = N'21.25',@RevenueQoq = N'32.29',@Profit = N'9832.07万',@ProfitYoy = N'-76.79',@ProfiltQoq = N'347.67',@NAVPerUnit = N'7.2996',@ROE = N'0.99',@CashPerUnit = N'-0.7487',@GrossProfitRate = N'2.74',@Distribution = N'10派0.3',@DividenRate = N'0.10',@AnnounceDate = N'2017-04-01' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2015-09-30',@EPS = N'-0.688',@EPSDeduct = N'0',@Revenue = N'171.42亿',@RevenueYoy = N'22.72',@RevenueQoq = N'-7.90',@Profit = N'-9.47亿',@ProfitYoy = N'-148.29',@ProfiltQoq = N'-31.36',@NAVPerUnit = N'6.5706',@ROE = N'-10.25',@CashPerUnit = N'-3.3823',@GrossProfitRate = N'3.02',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2016-10-29' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2015-06-30',@EPS = N'-0.3866',@EPSDeduct = N'-0.4823',@Revenue = N'108.10亿',@RevenueYoy = N'28.63',@RevenueQoq = N'74.75',@Profit = N'-5.25亿',@ProfitYoy = N'-138.69',@ProfiltQoq = N'-57.76',@NAVPerUnit = N'6.8703',@ROE = N'-5.71',@CashPerUnit = N'-2.4752',@GrossProfitRate = N'2.81',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2016-08-31' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2015-03-31',@EPS = N'-0.1564',@EPSDeduct = N'0',@Revenue = N'39.34亿',@RevenueYoy = N'15.18',@RevenueQoq = N'15.45',@Profit = N'-2.04亿',@ProfitYoy = N'-22.19',@ProfiltQoq = N'-126.59',@NAVPerUnit = N'7.0992',@ROE = N'-2.38',@CashPerUnit = N'-2.3240',@GrossProfitRate = N'2.96',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2016-04-29' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2014-12-31',@EPS = N'0.3253',@EPSDeduct = N'-0.6487',@Revenue = N'210.47亿',@RevenueYoy = N'63.25',@RevenueQoq = N'52.40',@Profit = N'4.24亿',@ProfitYoy = N'169.31',@ProfiltQoq = N'323.05',@NAVPerUnit = N'8.4056',@ROE = N'4.46',@CashPerUnit = N'0.1033',@GrossProfitRate = N'3.20',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2016-03-25' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2014-09-30',@EPS = N'-0.2928',@EPSDeduct = N'0',@Revenue = N'139.69亿',@RevenueYoy = N'63.28',@RevenueQoq = N'3.77',@Profit = N'-3.81亿',@ProfitYoy = N'-742.14',@ProfiltQoq = N'-118.50',@NAVPerUnit = N'4.6895',@ROE = N'-4.25',@CashPerUnit = N'-3.2867',@GrossProfitRate = N'3.59',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2015-10-31' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2017-06-30',@EPS = N'0.0311',@EPSDeduct = N'-0.0131',@Revenue = N'104.18亿',@RevenueYoy = N'-8.30',@RevenueQoq = N'55.27',@Profit = N'4397.22万',@ProfitYoy = N'18.61',@ProfiltQoq = N'38.84',@NAVPerUnit = N'7.3381',@ROE = N'0.42',@CashPerUnit = N'-2.6687',@GrossProfitRate = N'8.14',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2017-08-31' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2014-06-30',@EPS = N'-0.1688',@EPSDeduct = N'-0.3117',@Revenue = N'84.04亿',@RevenueYoy = N'47.40',@RevenueQoq = N'24.40',@Profit = N'-2.20亿',@ProfitYoy = N'-538.84',@ProfiltQoq = N'-37.97',@NAVPerUnit = N'5.0136',@ROE = N'-2.50',@CashPerUnit = N'-2.8477',@GrossProfitRate = N'3.52',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2015-08-27' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2014-03-31',@EPS = N'-0.128',@EPSDeduct = N'0',@Revenue = N'34.16亿',@RevenueYoy = N'20.01',@RevenueQoq = N'1.66',@Profit = N'-1.67亿',@ProfitYoy = N'-625.17',@ProfiltQoq = N'-118.46',@NAVPerUnit = N'5.1760',@ROE = N'-2.09',@CashPerUnit = N'-1.4649',@GrossProfitRate = N'4.82',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2015-04-29' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2013-12-31',@EPS = N'-0.2121',@EPSDeduct = N'-0.2553',@Revenue = N'58.38亿',@RevenueYoy = N'-35.15',@RevenueQoq = N'137.87',@Profit = N'-2.19亿',@ProfitYoy = N'31.68',@ProfiltQoq = N'-600.59',@NAVPerUnit = N'6.0794',@ROE = N'0.65',@CashPerUnit = N'-0.0342',@GrossProfitRate = N'4.34',@Distribution = N'10派0.1',@DividenRate = N'0.06',@AnnounceDate = N'2015-02-17' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2013-09-30',@EPS = N'-0.1135',@EPSDeduct = N'0',@Revenue = N'37.50亿',@RevenueYoy = N'-49.06',@RevenueQoq = N'-14.31',@Profit = N'-7297.62万',@ProfitYoy = N'51.55',@ProfiltQoq = N'759.38',@NAVPerUnit = N'6.3737',@ROE = N'-1.65',@CashPerUnit = N'-1.2420',@GrossProfitRate = N'3.70',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2014-10-29' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2013-06-30',@EPS = N'-0.0412',@EPSDeduct = N'0.0253',@Revenue = N'26.37亿',@RevenueYoy = N'-49.14',@RevenueQoq = N'-8.13',@Profit = N'-4243.89万',@ProfitYoy = N'-37.11',@ProfiltQoq = N'-97.76',@NAVPerUnit = N'6.3580',@ROE = N'-0.97',@CashPerUnit = N'-1.1581',@GrossProfitRate = N'5.77',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2014-08-30' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2013-03-31',@EPS = N'-0.0244',@EPSDeduct = N'0.07',@Revenue = N'14.43亿',@RevenueYoy = N'-50.86',@RevenueQoq = N'-42.80',@Profit = N'-1571.09万',@ProfitYoy = N'-31.84',@ProfiltQoq = N'263.71',@NAVPerUnit = N'6.5035',@ROE = N'-0.35',@CashPerUnit = N'-0.8411',@GrossProfitRate = N'6.67',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2014-04-26' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2012-12-31',@EPS = N'0.0161',@EPSDeduct = N'0.1824',@Revenue = N'64.24亿',@RevenueYoy = N'-22.57',@RevenueQoq = N'13.59',@Profit = N'1032.75万',@ProfitYoy = N'-98.01',@ProfiltQoq = N'25.88',@NAVPerUnit = N'6.4457',@ROE = N'-20.85',@CashPerUnit = N'-0.2296',@GrossProfitRate = N'7.06',@Distribution = N'10派1.2',@DividenRate = N'1.34',@AnnounceDate = N'2014-03-18' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2016-12-31',@EPS = N'0.0504',@EPSDeduct = N'-0.0679',@Revenue = N'233.50亿',@RevenueYoy = N'-8.50',@RevenueQoq = N'10.04',@Profit = N'7122.43万',@ProfitYoy = N'-27.56',@ProfiltQoq = N'312.09',@NAVPerUnit = N'7.3207',@ROE = N'0.69',@CashPerUnit = N'-2.6608',@GrossProfitRate = N'7.01',@Distribution = N'10派0.16',@DividenRate = N'0.06',@AnnounceDate = N'2017-04-01' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2012-06-30',@EPS = N'0.14',@EPSDeduct = N'0.11',@Revenue = N'34.33亿',@RevenueYoy = N'-13.83',@RevenueQoq = N'-14.62',@Profit = N'8798.51万',@ProfitYoy = N'-66.59',@ProfiltQoq = N'-89.20',@NAVPerUnit = N'6.5067',@ROE = N'2.12',@CashPerUnit = N'-0.3417',@GrossProfitRate = N'6.52',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2013-08-31' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2012-03-31',@EPS = N'0.12',@EPSDeduct = N'0.1',@Revenue = N'18.52亿',@RevenueYoy = N'5.91',@RevenueQoq = N'-15.54',@Profit = N'7940.95万',@ProfitYoy = N'-54.60',@ProfiltQoq = N'-27.47',@NAVPerUnit = N'6.5125',@ROE = N'1.91',@CashPerUnit = N'-0.5929',@GrossProfitRate = N'3.76',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2013-04-27' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2011-12-31',@EPS = N'0.81',@EPSDeduct = N'0.59',@Revenue = N'82.96亿',@RevenueYoy = N'18.28',@RevenueQoq = N'3.37',@Profit = N'5.18亿',@ProfitYoy = N'-26.76',@ProfiltQoq = N'-24.73',@NAVPerUnit = N'6.3874',@ROE = N'13.31',@CashPerUnit = N'-1.8389',@GrossProfitRate = N'11.17',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2013-03-27' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2011-09-30',@EPS = N'0.64',@EPSDeduct = N'0.59',@Revenue = N'61.04亿',@RevenueYoy = N'35.04',@RevenueQoq = N'-5.11',@Profit = N'4.09亿',@ProfitYoy = N'-32.37',@ProfiltQoq = N'64.38',@NAVPerUnit = N'6.2000',@ROE = N'10.62',@CashPerUnit = N'-1.5170',@GrossProfitRate = N'12.31',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2012-10-31' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2011-06-30',@EPS = N'0.41',@EPSDeduct = N'0.47',@Revenue = N'39.83亿',@RevenueYoy = N'37.66',@RevenueQoq = N'27.84',@Profit = N'2.63亿',@ProfitYoy = N'-22.83',@ProfiltQoq = N'-49.40',@NAVPerUnit = N'7.8400',@ROE = N'6.94',@CashPerUnit = N'-0.1859',@GrossProfitRate = N'12.74',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2012-08-24' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2011-03-31',@EPS = N'0.27',@EPSDeduct = N'0.32',@Revenue = N'17.48亿',@RevenueYoy = N'16.85',@RevenueQoq = N'-29.89',@Profit = N'1.75亿',@ProfitYoy = N'9.84',@ProfiltQoq = N'69.40',@NAVPerUnit = N'7.8000',@ROE = N'4.65',@CashPerUnit = N'-1.3466',@GrossProfitRate = N'12.43',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2012-04-27' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2010-12-31',@EPS = N'1.1',@EPSDeduct = N'0.95',@Revenue = N'70.14亿',@RevenueYoy = N'7.03',@RevenueQoq = N'53.30',@Profit = N'7.08亿',@ProfitYoy = N'37.43',@ProfiltQoq = N'-60.77',@NAVPerUnit = N'7.4049',@ROE = N'20.73',@CashPerUnit = N'2.1001',@GrossProfitRate = N'13.36',@Distribution = N'10转3派1',@DividenRate = N'0.43',@AnnounceDate = N'2012-03-30' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2010-09-30',@EPS = N'0.94',@EPSDeduct = N'1.14',@Revenue = N'45.20亿',@RevenueYoy = N'-10.67',@RevenueQoq = N'16.42',@Profit = N'6.04亿',@ProfitYoy = N'49.22',@ProfiltQoq = N'44.52',@NAVPerUnit = N'7.2100',@ROE = N'17.79',@CashPerUnit = N'1.1715',@GrossProfitRate = N'15.97',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2011-10-28' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2010-06-30',@EPS = N'0.53',@EPSDeduct = N'0.67',@Revenue = N'28.94亿',@RevenueYoy = N'-7.68',@RevenueQoq = N'-6.62',@Profit = N'3.41亿',@ProfitYoy = N'41.19',@ProfiltQoq = N'14.37',@NAVPerUnit = N'6.6700',@ROE = N'10.68',@CashPerUnit = N'0.0960',@GrossProfitRate = N'14.57',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2011-08-24' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2010-03-31',@EPS = N'0.32',@EPSDeduct = N'0.32',@Revenue = N'14.96亿',@RevenueYoy = N'0.16',@RevenueQoq = N'0.20',@Profit = N'1.59亿',@ProfitYoy = N'23.16',@ProfiltQoq = N'44.92',@NAVPerUnit = N'6.7100',@ROE = N'-',@CashPerUnit = N'-0.1418',@GrossProfitRate = N'15.10',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2011-04-22' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2009-12-31',@EPS = N'1.04',@EPSDeduct = N'1.01',@Revenue = N'65.53亿',@RevenueYoy = N'-6.17',@RevenueQoq = N'-22.45',@Profit = N'5.15亿',@ProfitYoy = N'-37.23',@ProfiltQoq = N'-32.73',@NAVPerUnit = N'6.4100',@ROE = N'17.42',@CashPerUnit = N'-0.9398',@GrossProfitRate = N'12.14',@Distribution = N'10派2.8',@DividenRate = N'1.55',@AnnounceDate = N'2011-03-30' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2009-09-30',@EPS = N'0.82',@EPSDeduct = N'0.81',@Revenue = N'50.60亿',@RevenueYoy = N'5.02',@RevenueQoq = N'17.37',@Profit = N'4.05亿',@ProfitYoy = N'-41.01',@ProfiltQoq = N'45.22',@NAVPerUnit = N'6.0800',@ROE = N'-',@CashPerUnit = N'0.1395',@GrossProfitRate = N'12.70',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2010-10-26' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2009-06-30',@EPS = N'0.49',@EPSDeduct = N'0.48',@Revenue = N'31.34亿',@RevenueYoy = N'1.86',@RevenueQoq = N'9.82',@Profit = N'2.42亿',@ProfitYoy = N'-54.65',@ProfiltQoq = N'-13.00',@NAVPerUnit = N'5.8300',@ROE = N'8.58',@CashPerUnit = N'-0.2312',@GrossProfitRate = N'13.23',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2010-08-27' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2009-03-31',@EPS = N'0.26',@EPSDeduct = N'0.26',@Revenue = N'14.94亿',@RevenueYoy = N'5.84',@RevenueQoq = N'-31.03',@Profit = N'1.29亿',@ProfitYoy = N'-49.84',@ProfiltQoq = N'-3.33',@NAVPerUnit = N'5.9200',@ROE = N'-',@CashPerUnit = N'-0.0279',@GrossProfitRate = N'13.42',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2010-04-23' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2008-12-31',@EPS = N'1.66',@EPSDeduct = N'1.62',@Revenue = N'69.84亿',@RevenueYoy = N'17.33',@RevenueQoq = N'24.42',@Profit = N'8.20亿',@ProfitYoy = N'-12.78',@ProfiltQoq = N'-12.90',@NAVPerUnit = N'5.5500',@ROE = N'31.58',@CashPerUnit = N'-0.3947',@GrossProfitRate = N'13.08',@Distribution = N'10派4.5',@DividenRate = N'1.92',@AnnounceDate = N'2010-03-31' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2017-03-31',@EPS = N'0.013',@EPSDeduct = N'0',@Revenue = N'40.81亿',@RevenueYoy = N'-5.91',@RevenueQoq = N'-35.03',@Profit = N'1841.07万',@ProfitYoy = N'1677.10',@ProfiltQoq = N'-71.51',@NAVPerUnit = N'7.3340',@ROE = N'0.18',@CashPerUnit = N'-1.4488',@GrossProfitRate = N'8.33',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2017-04-29' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2008-09-30',@EPS = N'1.39',@EPSDeduct = N'1.35',@Revenue = N'48.18亿',@RevenueYoy = N'29.90',@RevenueQoq = N'4.51',@Profit = N'6.87亿',@ProfitYoy = N'0.85',@ProfiltQoq = N'-44.25',@NAVPerUnit = N'5.3500',@ROE = N'-',@CashPerUnit = N'-0.8944',@GrossProfitRate = N'15.08',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2009-10-28' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2008-06-30',@EPS = N'1.08',@EPSDeduct = N'1.06',@Revenue = N'30.77亿',@RevenueYoy = N'27.56',@RevenueQoq = N'18.01',@Profit = N'5.33亿',@ProfitYoy = N'14.62',@ProfiltQoq = N'6.85',@NAVPerUnit = N'5.1900',@ROE = N'20.20',@CashPerUnit = N'-1.2478',@GrossProfitRate = N'16.60',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2009-08-21' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2008-03-31',@EPS = N'0.52',@EPSDeduct = N'0.5071',@Revenue = N'14.11亿',@RevenueYoy = N'23.02',@RevenueQoq = N'-37.09',@Profit = N'2.58亿',@ProfitYoy = N'67.72',@ProfiltQoq = N'-0.78',@NAVPerUnit = N'5.3300',@ROE = N'-',@CashPerUnit = N'-1.1151',@GrossProfitRate = N'15.48',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2009-04-24' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2007-12-31',@EPS = N'1.9',@EPSDeduct = N'1.85',@Revenue = N'59.53亿',@RevenueYoy = N'75.12',@RevenueQoq = N'73.01',@Profit = N'9.41亿',@ProfitYoy = N'251.60',@ProfiltQoq = N'20.39',@NAVPerUnit = N'4.9600',@ROE = N'52.17',@CashPerUnit = N'3.6765',@GrossProfitRate = N'17.39',@Distribution = N'10派5',@DividenRate = N'1.39',@AnnounceDate = N'2009-03-11' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2007-09-30',@EPS = N'1.38',@EPSDeduct = N'1.36',@Revenue = N'37.09亿',@RevenueYoy = N'50.41',@RevenueQoq = N'2.51',@Profit = N'6.81亿',@ProfitYoy = N'317.58',@ProfiltQoq = N'-30.73',@NAVPerUnit = N'4.3000',@ROE = N'-',@CashPerUnit = N'2.5580',@GrossProfitRate = N'17.12',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2008-10-29' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2007-06-30',@EPS = N'0.94',@EPSDeduct = N'0.93',@Revenue = N'24.12亿',@RevenueYoy = N'57.10',@RevenueQoq = N'10.25',@Profit = N'4.65亿',@ProfitYoy = N'613.37',@ProfiltQoq = N'102.69',@NAVPerUnit = N'3.6400',@ROE = N'30.38',@CashPerUnit = N'1.2124',@GrossProfitRate = N'17.18',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2008-08-25' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2012-09-30',@EPS = N'0.0675',@EPSDeduct = N'0.04',@Revenue = N'48.33亿',@RevenueYoy = N'-20.82',@RevenueQoq = N'-11.41',@Profit = N'4338.63万',@ProfitYoy = N'-89.39',@ProfiltQoq = N'-620.07',@NAVPerUnit = N'6.4110',@ROE = N'1.05',@CashPerUnit = N'-0.9846',@GrossProfitRate = N'4.43',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2013-10-26' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2007-03-31',@EPS = N'0.31',@EPSDeduct = N'0',@Revenue = N'11.47亿',@RevenueYoy = N'59.99',@RevenueQoq = N'22.95',@Profit = N'1.54亿',@ProfitYoy = N'460.62',@ProfiltQoq = N'47.08',@NAVPerUnit = N'2.9116',@ROE = N'-',@CashPerUnit = N'0.2850',@GrossProfitRate = N'12.44',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2008-04-25' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2006-12-31',@EPS = N'0.54',@EPSDeduct = N'0.55',@Revenue = N'33.99亿',@RevenueYoy = N'24.56',@RevenueQoq = N'0.30',@Profit = N'2.68亿',@ProfitYoy = N'172.46',@ProfiltQoq = N'6.77',@NAVPerUnit = N'2.2200',@ROE = N'30.77',@CashPerUnit = N'5.2949',@GrossProfitRate = N'15.55',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2008-03-19' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2006-03-31',@EPS = N'0.0554',@EPSDeduct = N'0',@Revenue = N'7.17亿',@RevenueYoy = N'74.00',@RevenueQoq = N'-13.99',@Profit = N'2741.06万',@ProfitYoy = N'208.74',@ProfiltQoq = N'-55.56',@NAVPerUnit = N'1.7000',@ROE = N'-',@CashPerUnit = N'1.1033',@GrossProfitRate = N'11.41',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2007-04-27' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2005-12-31',@EPS = N'0.2',@EPSDeduct = N'0',@Revenue = N'27.29亿',@RevenueYoy = N'15.47',@RevenueQoq = N'18.20',@Profit = N'9819.33万',@ProfitYoy = N'191.61',@ProfiltQoq = N'286.57',@NAVPerUnit = N'1.6300',@ROE = N'12.93',@CashPerUnit = N'1.7093',@GrossProfitRate = N'7.96',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2007-03-30' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2005-09-30',@EPS = N'0',@EPSDeduct = N'0',@Revenue = N'18.95亿',@RevenueYoy = N'23.67',@RevenueQoq = N'-9.27',@Profit = N'3650.94万',@ProfitYoy = N'47.57',@ProfiltQoq = N'36.68',@NAVPerUnit = N'1.5100',@ROE = N'-',@CashPerUnit = N'0.6081',@GrossProfitRate = N'5.72',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2006-10-27' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2005-06-30',@EPS = N'0.04',@EPSDeduct = N'0',@Revenue = N'11.90亿',@RevenueYoy = N'9.11',@RevenueQoq = N'88.64',@Profit = N'2055.28万',@ProfitYoy = N'95.02',@ProfiltQoq = N'31.50',@NAVPerUnit = N'1.4800',@ROE = N'2.85',@CashPerUnit = N'-0.2694',@GrossProfitRate = N'6.51',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2006-08-18' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2006-06-30',@EPS = N'0.13',@EPSDeduct = N'0',@Revenue = N'15.36亿',@RevenueYoy = N'29.07',@RevenueQoq = N'14.12',@Profit = N'6520.26万',@ProfitYoy = N'217.24',@ProfiltQoq = N'37.87',@NAVPerUnit = N'1.7900',@ROE = N'-',@CashPerUnit = N'1.5929',@GrossProfitRate = N'12.07',@Distribution = N'不分配不转增',@DividenRate = N'-',@AnnounceDate = N'2007-08-17' EXEC [EST].[Proc_yjbb_Ins] @Code = N'600685',@CutoffDate = N'2006-09-30',@EPS = N'0.33',@EPSDeduct = N'0',@Revenue = N'24.66亿',@RevenueYoy = N'30.12',@RevenueQoq = N'13.69',@Profit = N'1.63亿',@ProfitYoy = N'346.61',@ProfiltQoq = N'158.93',@NAVPerUnit = N'2.0100',@ROE = N'-',@CashPerUnit = N'2.3529',@GrossProfitRate = N'14.12',@Distribution = N'-',@DividenRate = N'-',@AnnounceDate = N'2007-10-26'
409.862745
422
0.642492
6b2df38a6798dec319f1e142682f9e6ce1011785
121
js
JavaScript
Gracejs 2.0/BL/_/main.js
tunkjs/GraceJS
632e645dc297f21ed8a482e5cf50254cea4191d7
[ "MIT" ]
null
null
null
Gracejs 2.0/BL/_/main.js
tunkjs/GraceJS
632e645dc297f21ed8a482e5cf50254cea4191d7
[ "MIT" ]
null
null
null
Gracejs 2.0/BL/_/main.js
tunkjs/GraceJS
632e645dc297f21ed8a482e5cf50254cea4191d7
[ "MIT" ]
null
null
null
define(['./array','./each','./collections','./delay','./is','./object','./utility','./tpl'], function($) { return $; });
40.333333
106
0.520661
41debfa97b6552802274ddbf6f60677e6bf5421e
1,591
lua
Lua
mods/_testmod/scripts/world/cutscenes/hey.lua
KristalTeam/Kristal
5f49d62de0adafaffbd09f19b8f9a5c01797b2eb
[ "BSD-3-Clause" ]
10
2021-11-04T22:21:58.000Z
2022-03-22T14:50:27.000Z
mods/_testmod/scripts/world/cutscenes/hey.lua
KristalTeam/Kristal
5f49d62de0adafaffbd09f19b8f9a5c01797b2eb
[ "BSD-3-Clause" ]
5
2021-11-05T08:31:34.000Z
2022-02-06T02:47:32.000Z
mods/_testmod/scripts/world/cutscenes/hey.lua
KristalTeam/Kristal
5f49d62de0adafaffbd09f19b8f9a5c01797b2eb
[ "BSD-3-Clause" ]
7
2021-11-04T22:50:04.000Z
2022-03-10T02:21:36.000Z
return { face = function(cutscene) cutscene:setSpeaker("susie") cutscene:text("* Hey Kris Hey", "small_smile") cutscene:text("* I just learned how to\nchange my face mid\nsentence", "smile") cutscene:text("* Watch this", "closed_grin") cutscene:text("* hhooooOOOOOOOOAAAAAAAA\nAAAAAAAAAAAAAAAAA[facec:ralsei_hat/angry,-15,-10][voice:ralsei][func:explode,ralsei]AAAAA\nAAAAAAAAAAAAAAGGHHH", "teeth_b", { functions = { explode = function(textbox, char) cutscene:getCharacter(char):explode() end } }) cutscene:wait(2) cutscene:text("* Ok but for real here's\nthe [face:teeth_b]\\[face\\] command", "smile") end, fade = function(cutscene) cutscene:wait(0.2) cutscene:fadeOut(0.5, {music = true}) cutscene:wait(0.5) cutscene:text("Who knows what happened here[wait:2].[wait:2].[wait:2].[wait:2]\n.[wait:2].[wait:2].[wait:2].[wait:2].[wait:2].[wait:2].[wait:2].[wait:2].[wait:2] it could be[wait:10]\n anything") cutscene:wait(0.5) cutscene:fadeIn(0.5, {music = true, wait = true}) cutscene:wait(1) cutscene:fadeOut(2, {color = {1, 1, 1}, music = 1, global = true, wait = false}) cutscene:text("Wait no why are you white noooo\nooooooooooooooooooooooooo\noooooooooooooooo", {wait = false, advance = false}) cutscene:wait(2) cutscene:closeText() cutscene:fadeIn(0.2, {global = true}) cutscene:startEncounter("starwalker", false) end }
45.457143
204
0.603394
344448d830c67750e24835307f0c95eebe928c8c
3,702
swift
Swift
BitmovinAnalyticsCollector/Classes/Collector/data/EventData.swift
bitmovin/bitmovin-analytics-collector-ios
ad83d2afa67591ab9a139c1cec8a60a0d214ee14
[ "MIT" ]
3
2019-10-03T05:24:44.000Z
2021-10-05T15:58:04.000Z
BitmovinAnalyticsCollector/Classes/Collector/data/EventData.swift
bitmovin/bitmovin-analytics-collector-ios
ad83d2afa67591ab9a139c1cec8a60a0d214ee14
[ "MIT" ]
13
2018-06-19T13:56:59.000Z
2022-01-20T14:33:50.000Z
BitmovinAnalyticsCollector/Classes/Collector/data/EventData.swift
bitmovin/bitmovin-analytics-collector-ios
ad83d2afa67591ab9a139c1cec8a60a0d214ee14
[ "MIT" ]
13
2019-06-21T13:04:37.000Z
2021-10-05T14:20:23.000Z
import Foundation public class EventData: Codable { var domain: String? var path: String? var language: String? var userAgent: String? var errorCode: Int? var errorMessage: String? var errorData: String? var screenWidth: Int? var screenHeight: Int? var isLive: Bool = false var isCasting: Bool? = false var castTech: String? var isMuted: Bool? = false var videoDuration: Int64 = 0 var time: Double? var videoWindowWidth: Int = 0 var videoWindowHeight: Int = 0 var droppedFrames: Int = 0 var played: Int64 = 0 var buffered: Int64 = 0 var paused: Int64 = 0 var ad: Int64 = 0 var seeked: Int64 = 0 var videoPlaybackWidth: Int? var videoPlaybackHeight: Int? var videoBitrate: Double = 0 var audioBitrate: Double = 0 var videoTimeStart: Int64 = 0 var videoTimeEnd: Int64 = 0 var videoStartupTime: Int64 = 0 var duration: Int64 = 0 var startupTime: Int64 = 0 var analyticsVersion: String = "0" var key: String? var playerKey: String? var player: String? var playerTech: String? var cdnProvider: String? var streamFormat: String? var videoId: String? var videoTitle: String? var customUserId: String? var customData1: String? var customData2: String? var customData3: String? var customData4: String? var customData5: String? var customData6: String? var customData7: String? var customData8: String? var customData9: String? var customData10: String? var customData11: String? var customData12: String? var customData13: String? var customData14: String? var customData15: String? var customData16: String? var customData17: String? var customData18: String? var customData19: String? var customData20: String? var customData21: String? var customData22: String? var customData23: String? var customData24: String? var customData25: String? var experimentName: String? var userId: String? var impressionId: String var state: String? var m3u8Url: String? var mpdUrl: String? var progUrl: String? var playerStartupTime: Int64 = 0 var pageLoadType: Int = 1 var pageLoadTime: Int64 = 0 var version: String? var sequenceNumber: Int32 = 0 var drmType: String? var drmLoadTime: Int64? #if os(iOS) var platform: String = "iOS" #elseif os(tvOS) var platform: String = "tvOS" #elseif os(watchOS) var platform: String = "watchOS" #elseif os(macOS) var platform: String = "macOS" #elseif os(Linux) var platform: String = "Linux" #else var platform: String = "unknown" #endif var videoCodec: String? var audioCodec: String? var supportedVideoCodecs: [String]? var subtitleEnabled: Bool? var subtitleLanguage: String? var audioLanguage: String? var videoStartFailed: Bool? var videoStartFailedReason: String? init(_ impressionId: String) { self.impressionId = impressionId } public func jsonString() -> String { let encoder = JSONEncoder() if #available(iOS 11.0, tvOS 11.0, *) { encoder.outputFormatting = [.sortedKeys] } encoder.nonConformingFloatEncodingStrategy = .convertToString(positiveInfinity: "Infinity", negativeInfinity: "Negative Infinity", nan: "nan") do { let jsonData = try encoder.encode(self) guard let jsonString = String(data: jsonData, encoding: .utf8) else { return "" } return jsonString } catch { return "" } } }
28.476923
150
0.645597
a33cae94d8d671fecbf6a213e4b9485d548e9cb1
754
java
Java
koks/manager/event/impl/EventMotion.java
Schummel-Software/Koks-v3
b31bdcf41249c4f94029bf782a1059f23c163a51
[ "Apache-2.0" ]
8
2022-01-09T17:18:15.000Z
2022-02-02T04:34:56.000Z
koks/manager/event/impl/EventMotion.java
Schummel-Software/Koks-v3
b31bdcf41249c4f94029bf782a1059f23c163a51
[ "Apache-2.0" ]
2
2022-01-13T14:18:52.000Z
2022-01-15T01:04:08.000Z
koks/manager/event/impl/EventMotion.java
Schummel-Software/Koks-v3
b31bdcf41249c4f94029bf782a1059f23c163a51
[ "Apache-2.0" ]
2
2022-01-19T03:12:11.000Z
2022-02-02T04:27:06.000Z
package koks.manager.event.impl; import koks.manager.event.Event; /** * @author deleteboys | lmao | kroko * @created on 13.09.2020 : 05:10 */ public class EventMotion extends Event { private final Type TYPE; private float yaw,pitch; public EventMotion(Type type, float yaw, float pitch) { this.TYPE = type; this.yaw = yaw; this.pitch = pitch; } public Type getType() { return TYPE; } public float getYaw() { return yaw; } public void setYaw(float yaw) { this.yaw = yaw; } public float getPitch() { return pitch; } public void setPitch(float pitch) { this.pitch = pitch; } public enum Type { PRE,POST; } }
17.136364
59
0.574271
da1c5237be3e0f5cff0ca5f3afbe25d078dfa8cb
5,160
php
PHP
resources/views/layouts/app.blade copy.php
ErickSantiago5530/ecommerce-master_littlecloset
9de75ddfefb838260ae932e905a804ada95a6306
[ "MIT" ]
null
null
null
resources/views/layouts/app.blade copy.php
ErickSantiago5530/ecommerce-master_littlecloset
9de75ddfefb838260ae932e905a804ada95a6306
[ "MIT" ]
4
2021-03-09T10:32:55.000Z
2022-02-18T03:57:00.000Z
resources/views/layouts/app.blade copy.php
ErickSantiago5530/ecommerce-master_littlecloset
9de75ddfefb838260ae932e905a804ada95a6306
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- CSRF Token --> <meta name="csrf-token" content="{{ csrf_token() }}"> <title>{{ config('app.name', 'Laravel') }}</title> <!-- Scripts --> <!-- Fonts --> {{-- <link rel="dns-prefetch" href="//fonts.gstatic.com"> --}} {{-- <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet" type="text/css"> --}} <!-- <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> --> <!-- Styles --> <link href="{{ asset('css/app.css') }}" rel="stylesheet"> {{-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> <link href="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap3-editable/css/bootstrap-editable.css" rel="stylesheet"/> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous"> --}} <!-- <link rel="stylesheet" href="https://unpkg.com/bootstrap-material-design@4.1.1/dist/css/bootstrap-material-design.min.css" integrity="sha384-wXznGJNEXNG1NFsbm0ugrLFMQPWswR3lds2VeinahP8N0zJw9VWSopbjv2x7WCvX" crossorigin="anonymous"> --> <link rel="stylesheet" type="text/css" href="{{ url('styles/bootstrap-4.1.2/bootstrap.min.css') }}"> <link href="{{ url('plugins/font-awesome-4.7.0/css/font-awesome.min.css') }}" rel="stylesheet" type="text/css"> <link href="{{ url('plugins/fontawesome-5.9.0/css/all.min.css') }}" rel="stylesheet" type="text/css"> <link href="{{ url('plugins/sweetalert/sweetalert2.min.js') }}" rel="stylesheet" type="text/css"> <link rel="stylesheet" type="text/css" href="{{ url('plugins/OwlCarousel2-2.2.1/owl.carousel.css') }}"> <link rel="stylesheet" type="text/css" href="{{ url('plugins/OwlCarousel2-2.2.1/owl.theme.default.css') }}"> <link rel="stylesheet" type="text/css" href="{{ url('plugins/OwlCarousel2-2.2.1/animate.css') }}"> <link rel="stylesheet" type="text/css" href="{{ url('styles/main_styles.css') }}"> <link rel="stylesheet" type="text/css" href="{{ url('styles/responsive.css') }}"> <link rel="stylesheet" type="text/css" href="{{ url('styles/cart.css') }}"> <link rel="stylesheet" type="text/css" href="{{ url('styles/cart_responsive.css') }}"> </head> <body> @include("header.header") <div id="app" class="p-4"> @yield('content') </div> @include("foother.foother") <script src="{{ url('js/jquery-3.3.1.min.js') }}" ></script> {{-- <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script> --}} {{-- <script src="{{ url('/js/jquery-3.1.1.min.js') }}" ></script> --}} {{-- <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> --}} {{-- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap3-editable/js/bootstrap-editable.min.js"></script> --}} <script src="{{ url('styles/bootstrap-4.1.2/popper.js')}}"></script> <script src="{{ url('styles/bootstrap-4.1.2/bootstrap.min.js')}}"></script> <script src="{{ url('plugins/greensock/TweenMax.min.js')}}"></script> <script src="{{ url('plugins/greensock/TimelineMax.min.js')}}"></script> <script src="{{ url('plugins/scrollmagic/ScrollMagic.min.js')}}"></script> <script src="{{ url('plugins/greensock/animation.gsap.min.js')}}"></script> <script src="{{ url('plugins/greensock/ScrollToPlugin.min.js')}}"></script> <script src="{{ url('plugins/OwlCarousel2-2.2.1/owl.carousel.js')}}"></script> <script src="{{ url('plugins/sweetalert/sweetalert2.min.js')}}"></script> <script src="{{ url('plugins/easing/easing.js')}}"></script> <script src="{{ url('plugins/progressbar/progressbar.min.js')}}"></script> <script src="{{ url('plugins/parallax-js-master/parallax.min.js')}}"></script> <script src="{{ url('js/custom.js')}}"></script> <!-- <script src="{{ url('plugins/bower_components/styleswitcher/jQuery.style.switcher.js')}}"></script> --> <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script> --> <script src="{{ url('/js/app.js') }}"></script> <!-- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> --> </body> </html>
69.72973
244
0.665116
f4b3f5ca33eca5bdc11aa0ba524130af5c977d8b
1,854
tsx
TypeScript
src/component/Radio/Group.tsx
FirstCoder1/react-component
f80480ac3e06158a94d51e5bb6439c1983db5f3d
[ "MIT" ]
null
null
null
src/component/Radio/Group.tsx
FirstCoder1/react-component
f80480ac3e06158a94d51e5bb6439c1983db5f3d
[ "MIT" ]
null
null
null
src/component/Radio/Group.tsx
FirstCoder1/react-component
f80480ac3e06158a94d51e5bb6439c1983db5f3d
[ "MIT" ]
null
null
null
import React, { ChangeEvent, FC, ReactNode, useState } from "react"; import Radio,{RadioChangeType} from "./radio"; export interface GroupOptionType{ value:any label:ReactNode disabled?:boolean onChange?:RadioChangeType } export interface GroupProps{ /**默认选中的value*/ defaultValue?: any /**是否全部禁用 */ disabled?:boolean /** RadioGroup 下所有 input[type="radio"] 的 name 属性 */ name?:string /**可选项的数据data */ options?:Array<GroupOptionType|string> /**指定选中的选项 */ value?: any /**Radio选中触发事件 */ onChange?:(checkValues:any)=>void } const Group:FC<GroupProps>=(props)=>{ const {defaultValue,disabled,name,options,value,children,onChange} =props const [valueState,setValueState]=useState<any>(value||defaultValue) const _options=options?.map(option=>{ if(typeof option==='string'){ return { value:option, label:option } as GroupOptionType } return option }) const boxHandleChange=(value:any,opOnchange?:RadioChangeType)=>{ return (e:ChangeEvent<HTMLInputElement>)=>{ setValueState(value) onChange&&onChange(value) opOnchange&&opOnchange(e) } } const isValue=typeof value==='undefined'?valueState:value return ( <> {_options?_options.map(option=>[ <Radio key={option.value.toString()} value={option.value} disabled={disabled||option.disabled} checked={isValue===option.value} onChange={boxHandleChange(option.value,option.onChange)} name={name} >{option.label}</Radio> ]):children} </> ) } export default Group
28.090909
77
0.570119
c6749fdfa425e4582fca12dad19a536d3cf98f15
263
sql
SQL
migrations/000002_create_user_table.up.sql
t-okkn/bgtools-api
97e51a54cc41cd23782eb4448f4fd8e59cffa492
[ "MIT" ]
null
null
null
migrations/000002_create_user_table.up.sql
t-okkn/bgtools-api
97e51a54cc41cd23782eb4448f4fd8e59cffa492
[ "MIT" ]
null
null
null
migrations/000002_create_user_table.up.sql
t-okkn/bgtools-api
97e51a54cc41cd23782eb4448f4fd8e59cffa492
[ "MIT" ]
null
null
null
CREATE TABLE IF NOT EXISTS `M_USER` ( `id` VARCHAR(8) NOT NULL PRIMARY KEY, `user_name` VARCHAR(256) NOT NULL DEFAULT '', `mail_address` VARCHAR(256) NOT NULL DEFAULT '', `auth_key` VARCHAR(256) NOT NULL DEFAULT '' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
43.833333
50
0.718631
db7f8b083219105d55ce4f26aea776436c3efc06
736
php
PHP
resources/views/home/footer/script.blade.php
luisclaro31/tickets
73fbdc3d6f36aebeaf1b087c42f91462ac772539
[ "MIT" ]
null
null
null
resources/views/home/footer/script.blade.php
luisclaro31/tickets
73fbdc3d6f36aebeaf1b087c42f91462ac772539
[ "MIT" ]
null
null
null
resources/views/home/footer/script.blade.php
luisclaro31/tickets
73fbdc3d6f36aebeaf1b087c42f91462ac772539
[ "MIT" ]
null
null
null
<script src="{{ asset('/js/ajax.js') }}"></script> <!-- jQuery 2.1.3 --> <script src="{{ asset('theme/plugins/jQuery/jQuery-2.1.3.min.js') }}"></script> <!-- Bootstrap 3.3.2 JS --> <script src="{{ asset('theme/bootstrap/js/bootstrap.min.js') }}" type="text/javascript"></script> <!-- SlimScroll --> <script src="{{ asset('theme/plugins/slimScroll/jquery.slimScroll.min.js') }}" type="text/javascript"></script> <!-- FastClick --> <script src='{{ asset('theme/plugins/fastclick/fastclick.min.js') }}'></script> <!-- AdminLTE App --> <script src="{{ asset('theme/dist/js/app.min.js') }}" type="text/javascript"></script> <!-- AdminLTE for demo purposes --> <script src="{{ asset('dist/js/demo.js') }}" type="text/javascript"></script>
43.294118
111
0.634511
c6eb4e864fc14106342d4d7130975a3636879ce3
2,042
py
Python
jmeter_api/samplers/jsr223/test_jsr223.py
dashawn888/jmeter_api
1ab5b02f3a7c8ad1b84fc50db4fe1fc2fa7c91bd
[ "Apache-2.0" ]
11
2020-03-22T13:30:21.000Z
2021-12-25T06:23:44.000Z
jmeter_api/samplers/jsr223/test_jsr223.py
dashawn888/jmeter_api
1ab5b02f3a7c8ad1b84fc50db4fe1fc2fa7c91bd
[ "Apache-2.0" ]
37
2019-12-18T13:12:50.000Z
2022-02-10T10:52:37.000Z
jmeter_api/samplers/jsr223/test_jsr223.py
dashawn888/jmeter_api
1ab5b02f3a7c8ad1b84fc50db4fe1fc2fa7c91bd
[ "Apache-2.0" ]
5
2019-12-06T10:55:56.000Z
2020-06-01T19:32:32.000Z
import xmltodict import pytest from jmeter_api.basics.jsr223 import ScriptLanguage from jmeter_api.samplers.jsr223.elements import JSR223Sampler from jmeter_api.basics.utils import tag_wrapper class TestJSR223SamplerRender: def test_scriptLanguage(self): element = JSR223Sampler(script_language=ScriptLanguage.JAVA) rendered_doc = element.to_xml() parsed_doc = xmltodict.parse(tag_wrapper(rendered_doc,'test_result')) for tag in parsed_doc['test_result']['JSR223Sampler']['stringProp']: if tag['@name'] == 'scriptLanguage': assert tag['#text'] == 'java' def test_cacheKey(self): element = JSR223Sampler(cache_key=False) rendered_doc = element.to_xml() parsed_doc = xmltodict.parse(tag_wrapper(rendered_doc,'test_result')) for tag in parsed_doc['test_result']['JSR223Sampler']['stringProp']: if tag['@name'] == 'cacheKey': assert tag['#text'] == 'false' def test_fileName(self): element = JSR223Sampler(filename="./jmeter_api/basics/jsr223_test.groovy") rendered_doc = element.to_xml() parsed_doc = xmltodict.parse(tag_wrapper(rendered_doc,'test_result')) for tag in parsed_doc['test_result']['JSR223Sampler']['stringProp']: if tag['@name'] == 'filename': assert tag['#text'] == "./jmeter_api/basics/jsr223_test.groovy" def test_script(self): sc = """var a=2 vars.put("some value",a) log("value added")""" element = JSR223Sampler(script=sc) rendered_doc = element.to_xml() parsed_doc = xmltodict.parse(tag_wrapper(rendered_doc,'test_result')) for tag in parsed_doc['test_result']['JSR223Sampler']['stringProp']: if tag['@name'] == 'script': assert tag['#text'] == sc def test_hashtree_contain(self): element = JSR223Sampler() rendered_doc = element.to_xml() assert '<hashTree />' in rendered_doc
41.673469
82
0.63859
4386761328010ff04cc8e4bc1d34d834b5adc506
395
tsx
TypeScript
src/containers/index.tsx
huyansheng3/d2d
7bffa5381d98ca6d7ac8deeae12b5f4af36c7d91
[ "MIT" ]
null
null
null
src/containers/index.tsx
huyansheng3/d2d
7bffa5381d98ca6d7ac8deeae12b5f4af36c7d91
[ "MIT" ]
null
null
null
src/containers/index.tsx
huyansheng3/d2d
7bffa5381d98ca6d7ac8deeae12b5f4af36c7d91
[ "MIT" ]
null
null
null
export * from './Pylon'; export { default as DIYHeader } from './Header'; // page export { default as Home } from './Home'; export { default as AssetsShop } from './AssetsShop'; export { default as Help } from './Help'; export { default as LoginPage } from './LoginPage'; export { default as WorkBench } from './WorkBench'; export { default as BlockQuery } from './BlockQuery';
28.214286
54
0.655696
cf371cdcdc2b0533ca96012bfcdff77172140433
1,335
php
PHP
database/migrations/2018_06_01_190413_create_hotel_bookings_table.php
Aimanshu/getyourflight
2b361236471b8602ee32c7e46dce7a0193f99a50
[ "MIT" ]
2
2021-06-23T04:59:24.000Z
2021-06-23T05:17:59.000Z
database/migrations/2018_06_01_190413_create_hotel_bookings_table.php
Aimanshu/getyourflight
2b361236471b8602ee32c7e46dce7a0193f99a50
[ "MIT" ]
null
null
null
database/migrations/2018_06_01_190413_create_hotel_bookings_table.php
Aimanshu/getyourflight
2b361236471b8602ee32c7e46dce7a0193f99a50
[ "MIT" ]
null
null
null
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateHotelBookingsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('hotel_bookings', function (Blueprint $table) { $table->increments('id'); $table->integer('user_id')->nullable(); $table->integer('total_adults'); $table->integer('total_childerns')->nullable(); $table->longText('adults_details'); $table->longText('childrens_details')->nullable(); $table->string('phone'); $table->string('email'); $table->string('city')->nullable(); $table->boolean('status')->default(0); $table->longText('response')->nullable(); $table->boolean('iss_gst')->default(0); $table->text('gst_details')->nullable(); $table->string('transaction_id')->nullable(); $table->integer('payu_id')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('hotel_bookings'); } }
28.404255
70
0.550562
029fcb552cd2011ec8248f1989d59c42670ee26a
1,214
cpp
C++
example-projects/colours-showcase/src/colours.cpp
Will1162/Console-Graphics-Engine
c0b091af5c85eea394b9022418951efeaefb3035
[ "MIT" ]
1
2021-07-04T23:12:17.000Z
2021-07-04T23:12:17.000Z
example-projects/colours-showcase/src/colours.cpp
Will1162/Console-Graphics-Engine
c0b091af5c85eea394b9022418951efeaefb3035
[ "MIT" ]
null
null
null
example-projects/colours-showcase/src/colours.cpp
Will1162/Console-Graphics-Engine
c0b091af5c85eea394b9022418951efeaefb3035
[ "MIT" ]
null
null
null
#include <thread> #include <vector> #include <Windows.h> #include "../../../engine/engine.h" // engine config Engine engine; const std::string consoleTitle = "2D Graphics Engine"; const int consoleWidth = 33; const int consoleHeight = 16; const int charWidth = 32; const int charHeight = 32; const int maxFrameRate = 60; int main() { engine.SetupEnviroment(consoleTitle, consoleWidth, consoleHeight, charWidth, charHeight, engine.GetColours().FG_WHITE, engine.GetColours().BG_BLACK); std::vector<unsigned short> colours = engine.GetColoursArray(); // main loop while (1) { // clear screen engine.WipeScreen(); for (int i = 0; i < 16; i++) { for (int j = 0; j < 16; j++) { engine.SetColours(colours[i], colours[j + 16]); engine.SetPixel(i, j, '#'); } } for (int i = 0; i < 16; i++) { for (int j = 0; j < 16; j++) { engine.SetColours(colours[i], colours[j + 16]); engine.SetPixel(i + 17, j, engine.GetShades().Fill50); } } // limit frame rate, to use less resources engine.LimitFrameRate(maxFrameRate); // add frame rate counter (2 decimal places) to console title engine.ShowFrameRate(2); // update console contents engine.DrawScreen(); } }
23.346154
150
0.65486
85116b28ac1a54e6d8b276fbb2b73fee80b5fbdd
11,367
cs
C#
src/EventStore/EventStore.Core/Services/Transport/Http/Controllers/UsersController.cs
ianbattersby/EventStore
02af8bb647aade441c4507eb958ffb0ffac99212
[ "BSD-3-Clause" ]
null
null
null
src/EventStore/EventStore.Core/Services/Transport/Http/Controllers/UsersController.cs
ianbattersby/EventStore
02af8bb647aade441c4507eb958ffb0ffac99212
[ "BSD-3-Clause" ]
null
null
null
src/EventStore/EventStore.Core/Services/Transport/Http/Controllers/UsersController.cs
ianbattersby/EventStore
02af8bb647aade441c4507eb958ffb0ffac99212
[ "BSD-3-Clause" ]
null
null
null
// Copyright (c) 2012, Event Store LLP // 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 the Event Store LLP 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 // HOLDER 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. // using System; using EventStore.Core.Bus; using EventStore.Core.Messages; using EventStore.Transport.Http; using EventStore.Transport.Http.EntityManagement; namespace EventStore.Core.Services.Transport.Http.Controllers { public class UsersController : CommunicationController { private readonly IHttpForwarder _httpForwarder; private readonly IPublisher _networkSendQueue; public UsersController(IHttpForwarder httpForwarder, IPublisher publisher, IPublisher networkSendQueue) : base(publisher) { _httpForwarder = httpForwarder; _networkSendQueue = networkSendQueue; } protected override void SubscribeCore(IHttpService service) { RegisterUrlBased(service, "/users/", HttpMethod.Get, GetUsers); RegisterUrlBased(service, "/users/{login}", HttpMethod.Get, GetUser); RegisterUrlBased(service, "/users/$current", HttpMethod.Get, GetCurrentUser); RegisterTextBody(service, "/users/", HttpMethod.Post, PostUser); RegisterTextBody(service, "/users/{login}", HttpMethod.Put, PutUser); RegisterUrlBased(service, "/users/{login}", HttpMethod.Delete, DeleteUser); RegisterUrlBased(service, "/users/{login}/command/enable", HttpMethod.Post, PostCommandEnable); RegisterUrlBased(service, "/users/{login}/command/disable", HttpMethod.Post, PostCommandDisable); RegisterTextBody(service, "/users/{login}/command/reset-password", HttpMethod.Post, PostCommandResetPassword); RegisterTextBody(service, "/users/{login}/command/change-password", HttpMethod.Post, PostCommandChangePassword); } private void GetUsers(HttpEntityManager http, UriTemplateMatch match) { if (_httpForwarder.ForwardRequest(http)) return; var envelope = CreateReplyEnvelope<UserManagementMessage.AllUserDetailsResult>(http); var message = new UserManagementMessage.GetAll(envelope, http.User); Publish(message); } private void GetUser(HttpEntityManager http, UriTemplateMatch match) { if (_httpForwarder.ForwardRequest(http)) return; var envelope = CreateReplyEnvelope<UserManagementMessage.UserDetailsResult>(http); var login = match.BoundVariables["login"]; var message = new UserManagementMessage.Get(envelope, http.User, login); Publish(message); } private void GetCurrentUser(HttpEntityManager http, UriTemplateMatch match) { if (_httpForwarder.ForwardRequest(http)) return; var envelope = CreateReplyEnvelope<UserManagementMessage.UserDetailsResult>(http); if (http.User == null) { envelope.ReplyWith( new UserManagementMessage.UserDetailsResult(UserManagementMessage.Error.Unauthorized)); return; } var message = new UserManagementMessage.Get(envelope, http.User, http.User.Identity.Name); Publish(message); } private void PostUser(HttpEntityManager http, string s) { if (_httpForwarder.ForwardRequest(http)) return; var envelope = CreateReplyEnvelope<UserManagementMessage.UpdateResult>( http, configurator: (codec, result) => { var configuration = AutoConfigurator(codec, result); return configuration.Code == HttpStatusCode.OK ? configuration.SetCreated( MakeUrl(http, "/users/" + Uri.EscapeDataString(result.LoginName))) : configuration; }); var data = http.RequestCodec.From<PostUserData>(s); var message = new UserManagementMessage.Create( envelope, http.User, data.LoginName, data.FullName, data.Groups, data.Password); Publish(message); } private void PutUser(HttpEntityManager http, UriTemplateMatch match, string s) { if (_httpForwarder.ForwardRequest(http)) return; var envelope = CreateReplyEnvelope<UserManagementMessage.UpdateResult>(http); var login = match.BoundVariables["login"]; var data = http.RequestCodec.From<PutUserData>(s); var message = new UserManagementMessage.Update(envelope, http.User, login, data.FullName, data.Groups); Publish(message); } private void DeleteUser(HttpEntityManager http, UriTemplateMatch match) { if (_httpForwarder.ForwardRequest(http)) return; var envelope = CreateReplyEnvelope<UserManagementMessage.UpdateResult>(http); var login = match.BoundVariables["login"]; var message = new UserManagementMessage.Delete(envelope, http.User, login); Publish(message); } private void PostCommandEnable(HttpEntityManager http, UriTemplateMatch match) { if (_httpForwarder.ForwardRequest(http)) return; var envelope = CreateReplyEnvelope<UserManagementMessage.UpdateResult>(http); var login = match.BoundVariables["login"]; var message = new UserManagementMessage.Enable(envelope, http.User, login); Publish(message); } private void PostCommandDisable(HttpEntityManager http, UriTemplateMatch match) { if (_httpForwarder.ForwardRequest(http)) return; var envelope = CreateReplyEnvelope<UserManagementMessage.UpdateResult>(http); var login = match.BoundVariables["login"]; var message = new UserManagementMessage.Disable(envelope, http.User, login); Publish(message); } private void PostCommandResetPassword(HttpEntityManager http, UriTemplateMatch match, string s) { if (_httpForwarder.ForwardRequest(http)) return; var envelope = CreateReplyEnvelope<UserManagementMessage.UpdateResult>(http); var login = match.BoundVariables["login"]; var data = http.RequestCodec.From<ResetPasswordData>(s); var message = new UserManagementMessage.ResetPassword(envelope, http.User, login, data.NewPassword); Publish(message); } private void PostCommandChangePassword(HttpEntityManager http, UriTemplateMatch match, string s) { if (_httpForwarder.ForwardRequest(http)) return; var envelope = CreateReplyEnvelope<UserManagementMessage.UpdateResult>(http); var login = match.BoundVariables["login"]; var data = http.RequestCodec.From<ChangePasswordData>(s); var message = new UserManagementMessage.ChangePassword( envelope, http.User, login, data.CurrentPassword, data.NewPassword); Publish(message); } private SendToHttpEnvelope<T> CreateReplyEnvelope<T>( HttpEntityManager http, Func<ICodec, T, string> formatter = null, Func<ICodec, T, ResponseConfiguration> configurator = null) where T : UserManagementMessage.ResponseMessage { return new SendToHttpEnvelope<T>( _networkSendQueue, http, formatter ?? AutoFormatter, configurator ?? AutoConfigurator, null); } private ResponseConfiguration AutoConfigurator<T>(ICodec codec, T result) where T : UserManagementMessage.ResponseMessage { return result.Success ? new ResponseConfiguration(HttpStatusCode.OK, codec.ContentType, codec.Encoding) : new ResponseConfiguration( ErrorToHttpStatusCode(result.Error), codec.ContentType, codec.Encoding); } private string AutoFormatter<T>(ICodec codec, T result) { return codec.To(result); } private int ErrorToHttpStatusCode(UserManagementMessage.Error error) { switch (error) { case UserManagementMessage.Error.Success: return HttpStatusCode.OK; case UserManagementMessage.Error.Conflict: return HttpStatusCode.Conflict; case UserManagementMessage.Error.NotFound: return HttpStatusCode.NotFound; case UserManagementMessage.Error.Error: return HttpStatusCode.InternalServerError; case UserManagementMessage.Error.TryAgain: return HttpStatusCode.RequestTimeout; case UserManagementMessage.Error.Unauthorized: return HttpStatusCode.Unauthorized; default: return HttpStatusCode.InternalServerError; } } private class PostUserData { public string LoginName { get; set; } public string FullName { get; set; } public string[] Groups { get; set; } public string Password { get; set; } } private class PutUserData { public string FullName { get; set; } public string[] Groups { get; set; } } private class ResetPasswordData { public string NewPassword { get; set; } } private class ChangePasswordData { public string CurrentPassword { get; set; } public string NewPassword { get; set; } } } }
45.286853
124
0.639923
f9e4e50d0c7b5afdfc99923f8592da2dd067e8e9
1,473
sql
SQL
src/main/resources/db/migration/h2/V12_0__notification_data.sql
ministryofjustice/cmd-api
24d7f5e20d393b4fdcd48f2d697a1f911238dd3e
[ "MIT" ]
null
null
null
src/main/resources/db/migration/h2/V12_0__notification_data.sql
ministryofjustice/cmd-api
24d7f5e20d393b4fdcd48f2d697a1f911238dd3e
[ "MIT" ]
8
2020-08-06T13:29:28.000Z
2022-01-28T14:19:41.000Z
src/main/resources/db/migration/h2/V12_0__notification_data.sql
ministryofjustice/cmd-api
24d7f5e20d393b4fdcd48f2d697a1f911238dd3e
[ "MIT" ]
2
2020-11-06T16:47:10.000Z
2021-04-11T06:28:15.000Z
insert into NOTIFICATION (QUANTUM_ID, SHIFT_MODIFIED, DETAIL_START, DETAIL_END, ACTIVITY, PARENT_TYPE, ACTION_TYPE, PROCESSED) values ('A123EX','2021-03-17 10:03:24.0','2021-09-17 10:02:33.0','2021-09-17 10:03:46.0','ADD','SHIFT','EDIT', true); insert into NOTIFICATION (QUANTUM_ID, SHIFT_MODIFIED, DETAIL_START, DETAIL_END, ACTIVITY, PARENT_TYPE, ACTION_TYPE, PROCESSED) values ('A123EX','2021-03-17 10:03:24.0','2021-09-17 10:02:33.0','2021-09-17 10:03:46.0','ADD','SHIFT','EDIT', true); insert into NOTIFICATION (QUANTUM_ID, SHIFT_MODIFIED, DETAIL_START, DETAIL_END, ACTIVITY, PARENT_TYPE, ACTION_TYPE, PROCESSED) values ('A123EX','2021-03-17 10:03:24.0','2021-09-17 10:02:33.0','2021-09-17 10:03:46.0','ADD','SHIFT','EDIT', true); insert into NOTIFICATION (QUANTUM_ID, SHIFT_MODIFIED, DETAIL_START, DETAIL_END, ACTIVITY, PARENT_TYPE, ACTION_TYPE, PROCESSED) values ('A123EX','2021-03-17 10:03:24.0','2021-09-17 10:02:33.0','2021-09-17 10:03:46.0','ADD','OVERTIME','EDIT', true); insert into NOTIFICATION (QUANTUM_ID, SHIFT_MODIFIED, DETAIL_START, DETAIL_END, ACTIVITY, PARENT_TYPE, ACTION_TYPE, PROCESSED) values ('A123EX','2021-03-17 10:03:24.0','2021-09-17 10:02:33.0','2021-09-17 10:03:46.0','ADD','SHIFT','EDIT', true); insert into NOTIFICATION (QUANTUM_ID, SHIFT_MODIFIED, DETAIL_START, DETAIL_END, ACTIVITY, PARENT_TYPE, ACTION_TYPE, PROCESSED) values ('A123EX','2021-03-17 10:03:24.0','2021-09-17 10:02:33.0','2021-09-17 10:03:46.0','ADD','SHIFT','EDIT', true);
210.428571
247
0.735234
e70040c5b72ac89258c8b15dd6f888119b649b9a
1,464
php
PHP
resources/views/admin/phimtrongngay/list.blade.php
silverbulletsasus/PhimOnline
f83efd5bff10f4cee66e0e16eba081a7454078f8
[ "MIT" ]
1
2018-09-20T14:04:38.000Z
2018-09-20T14:04:38.000Z
resources/views/admin/phimtrongngay/list.blade.php
silverbulletsasus/PhimOnline
f83efd5bff10f4cee66e0e16eba081a7454078f8
[ "MIT" ]
1
2018-09-20T14:07:15.000Z
2018-09-20T14:07:15.000Z
resources/views/admin/phimtrongngay/list.blade.php
silverbulletsasus/PhimOnline
f83efd5bff10f4cee66e0e16eba081a7454078f8
[ "MIT" ]
null
null
null
@extends('admin.layout.master') @section('content-change') <div class="row"> <div class="col-md-12"> <h1 class="page-header">Phim Trong Ngày</h1> </div> </div> <div class="row"> <div class="col-md-12"> @if(Session::has('message')) <div class="alert alert-{{Session::get('flag')}}"> {{Session::get('message')}} </div> @endif <div class="panel panel-default"> <div class="panel-heading">Danh Sách Phim Trong Ngày</div> <div class="panel-body"> <table class="table table-hover table-striped table-bordered text-center" id="datatable"> <thead> <tr> <th>Ngày Chiếu</th> <th>Lịch Chiếu</th> <th>Phòng Chiếu</th> <th>Phim</th> <th>Rạp</th> <th>Cập Nhật</th> <th>Xóa</th> </tr> </thead> <tbody> @foreach($phimtrongngay as $row) <tr> <td>{{$row->nc_id}}</td> <td>{{$row->lc_id}}</td> <td>{{$row->pc_id}}</td> <td>{{$row->phim_id}}</td> <td>{{$row->rap_id}}</td> <td><a href="admin/phimtrongngay/EditPhimTrongNgay/{{$row->ptn_id}}"><img src="file-admin/icon/edit.png"></a></td> <td><a href="admin/phimtrongngay/DeletePhimTrongNgay/{{$row->ptn_id}}"><img src="file-admin/icon/delete.png"></a></td> </tr> @endforeach </tbody> </table> </div> </div> </div> </div> @endsection
30.5
128
0.517077
dba550d8b8fc4b459c215fc2494a4d5bb8d01d66
772
php
PHP
application/config/plugins.php
iseplutpinur/diagnosa-backend
4b30b85ffe1184da88d1fd5e9e407fedd5410185
[ "MIT" ]
1
2022-03-29T07:10:29.000Z
2022-03-29T07:10:29.000Z
application/config/plugins.php
iseplutpinur/diagnosa
25cd3021b22b091d1987a67b7b42a3fde072ddd2
[ "MIT" ]
null
null
null
application/config/plugins.php
iseplutpinur/diagnosa
25cd3021b22b091d1987a67b7b42a3fde072ddd2
[ "MIT" ]
null
null
null
<?php defined('BASEPATH') OR exit('No direct script access allowed'); $config['number'] = array( 'scripts' => array( 'assets/autoNumeric.js' ) ); $config['datatables'] = array( 'scripts' => array( 'assets/js/plugin/datatables/jquery.dataTables.min.js', 'assets/js/plugin/datatables/dataTables.colVis.min.js', 'assets/js/plugin/datatables/dataTables.tableTools.min.js', 'assets/js/plugin/datatables/dataTables.bootstrap.min.js', 'assets/js/plugin/datatable-responsive/datatables.responsive.min.js', ) ); // Hapus tab index di modal $config['select2'] = array( 'scripts' => array( 'assets/js/plugin/select2/select2.min.js', ) ); $config['multiselect'] = array( 'scripts' => array( 'assets/js/plugin/multiselect/js/bootstrap-multiselect.js', ) );
24.125
71
0.703368
815e618206db539d750db24906e63c9be4892dd4
4,995
css
CSS
css/style.css
BradFabian/redstore
0c370337a9ccc0987a6d49dc598e47fc399d77f6
[ "MIT" ]
null
null
null
css/style.css
BradFabian/redstore
0c370337a9ccc0987a6d49dc598e47fc399d77f6
[ "MIT" ]
null
null
null
css/style.css
BradFabian/redstore
0c370337a9ccc0987a6d49dc598e47fc399d77f6
[ "MIT" ]
null
null
null
* { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: "Poppins", sans-serif; } /* IMAGE */ .logo img { width: 125px; } .navbar { display: flex; align-items: center; padding: 1em; } nav { flex: 1; text-align: right; } nav ul { display: inline-block; list-style-type: none; } nav ul li { display: inline-block; margin: 0.6em; } nav ul li a { text-decoration: none; color: #555; } a { text-decoration: none; } p { color: #555; } .container { max-width: 1300px; margin: auto; padding-left: 2rem; padding-right: 2rem; } .row { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-around; } .col-2 { flex-basis: 50%; min-width: 300px; } .col-2 img { max-width: 100%; padding: 50px 0; } .col-2 h1 { font-size: 50px; line-height: 60px; margin: 1em 0; } .btn { display: inline-block; background: #ff523b; color: #fff; padding: 8px 30px; margin: 30px 0; border-radius: 30px; transition: all 0.5s; } .btn:hover { background: #563434; } .header { background: radial-gradient(#fff, #ffd6d6); } .header .row { margin-top: 70px; } .cart { height: 2em; width: 2em; margin: 0.5em; } .categories { margin: 70px 0; } .col-3 { flex-basis: 30%; min-width: 250px; margin-bottom: 30px; } .col-3 img { width: 100%; } .small-container { max-width: 1080px; margin: auto; padding-left: 20px; padding-right: 20px; } .col-4 { flex-basis: 25%; padding: 10px; min-width: 200px; margin-bottom: 50px; transition: transform 0.5s; } .col-4:hover { transform: translateY(-5px); } .col-4 img { width: 100%; } .title { text-align: center; margin: 0 auto 80px; position: relative; line-height: 60px; color: #555; } .title::after { content: ""; background: #ff523b; width: 80px; height: 5px; border-radius: 5px; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); } h4 { color: #555; font-weight: normal; } .col-4 p { font-size: 0.8rem; } .rating .fas, .far { color: #ff523b; } .offer { background: radial-gradient(#fff, #ffd6d6); margin-top: 80px; padding: 30px 0; } .offer-img { padding: 50px; } small { color: #555; } .testimonial { padding: 2em 0; } .testimonial .col-3 { text-align: center; padding: 40px 20px; box-shadow: 0 0 20px 0px rgba(0, 0, 0, 0.1); cursor: pointer; transition: transform 0.5s; position: relative; height: 100%; } .testimonial .col-3::after { content: "\201C"; color: #c7c4c4c7; position: absolute; font-size: 6em; white-space: nowrap; right: 5%; top: 10%; z-index: -1; height: 12%; } .testimonial .col-3::before { content: "\201D"; color: #c7c4c4c7; position: absolute; font-size: 6em; white-space: nowrap; height: 12%; left: 5%; top: -18px; z-index: -1; } .testimonial .col-3 img { width: 60%; margin: 20px; border-radius: 50%; } .testimonial .col-3:hover { transform: translateY(-10px); } .fa-quote-left { font-size: 2rem; color: rgb(255, 82, 59); } .col-3 p { font-size: 0.8rem; margin: 12px 0; color: #777; } .testimonial .col-3 h3 { font-weight: 600; color: #555; font-size: 1rem; } .footer { background: #000; color: #8a8a8a; font-size: 1rem; padding: 60px 0 20px; } .footer p { color: #8a8a8a; } .footer h3 { color: #fff; margin-bottom: 1em; } .footer-col-1, .footer-col-2, .footer-col-3, .footer-col-4 { min-width: 250px; margin-bottom: 20px; } .footer-col-1 { flex-basis: 30%; } .footer-col-2 { flex: 1; text-align: center; } .footer-col-2 img { width: 180px; margin-bottom: 20px; } .footer-col-3, .footer-col-4 { flex-basis: 12%; text-align: center; } ul { list-style-type: none; } .app-logo { margin-top: 20px; } .app-logo img { width: 120px; } .footer hr { border: none; background: #b5b5b5; height: 1px; margin: 20px 0; } .copyright { text-align: center; } .menu-icon { width: 1em; margin-left: 2em; display: none; } @media only screen and (max-width: 800px) { nav ul { position: fixed; text-align: center; display: none; top: 70px; right: 0; background: rgba(255, 82, 59, 0.589); box-shadow: 0 0 20px 0px rgba(0, 0, 0, 0.1); width: 30%; margin: 0.5em; z-index: 99; } .navbar__show { display: inline-block; animation: slideMe 0.5s ease-in; } .navbar__noshow { transition: display 1s; animation: slideOut 0.5s ease-out; } @keyframes slideOut { 0% { transform: translateX(0); } 100% { transform: translateX(999px); } } @keyframes slideMe { 0% { transform: translateX(80px); } 100% { transform: translateX(0); } } nav ul li { display: block; } nav ul li a { color: #fff; } .menu-icon { display: block; cursor: pointer; } } @media only screen and (max-width: 600px) { .row { text-align: center; } }
12.613636
48
0.594995
c98b2f92c9df2c815c88f3d3f1c04ad8366e2561
5,037
tsx
TypeScript
src/Experiment.tsx
elitefintech/nextjs-ssr-experiment
6d0e098d0a1dc862b6531f703c5b661a66f1033c
[ "MIT" ]
null
null
null
src/Experiment.tsx
elitefintech/nextjs-ssr-experiment
6d0e098d0a1dc862b6531f703c5b661a66f1033c
[ "MIT" ]
2
2022-01-02T10:27:52.000Z
2022-01-02T10:31:34.000Z
src/Experiment.tsx
elitefintech/nextjs-ssr-experiment
6d0e098d0a1dc862b6531f703c5b661a66f1033c
[ "MIT" ]
null
null
null
import React, {useState, useEffect, useContext} from 'react'; import {Props as VariantProps} from './Variant'; import Cookies from 'js-cookie'; import {ExperimentContext} from './ExperimentProvider'; import {Debug} from './Debug'; import {Props as Variant} from './Variant'; interface ExperimentProps { debug?: boolean; debugRoot?: HTMLElement; name: string; onClick?: ( event: React.MouseEvent<HTMLElement>, experimentName: string, variantName: string ) => void; onRunExperiment?: (experimentName: string, variantName: string) => void; children: React.ReactElement<VariantProps, any>[]; MAX_AGE?: number; } function pickVariant(variants: Variant[]): string { let total = 0; for (let i = 0; i < variants.length; ++i) { total += variants[i].weight; } const threshold = Math.random() * total; total = 0; for (let i = 0; i < variants.length - 1; ++i) { total += variants[i].weight; if (total >= threshold) { return variants[i].name; } } return variants[variants.length - 1].name; } const MAX_AGE = 30; // 30 days export function Experiment(props: ExperimentProps) { const { debug: pDebug, MAX_AGE: pMAX_AGE, name: pName, children, } = props; const debugUriParam = `experiment_${pName}_debug`; const cookieName = `experiment_${pName}`; const [debug, setDebug] = useState(props.debug ?? false); const [cookies, setCookies] = useContext(ExperimentContext); const [variant, setVariant] = useState( cookies[encodeURIComponent(cookieName)] ? cookies[encodeURIComponent(cookieName)] : -1 ); const [open, setOpen] = React.useState(false); useEffect(() => { if (variant === -1) { const pickedVariant = pickVariant(children.map(el => el.props)); setVariant(pickedVariant); } }, [children, variant]); useEffect(() => { if (!pDebug) { setDebug(window.location.href.indexOf(debugUriParam) > -1); } }, [pDebug, debugUriParam]); useEffect(() => { if (variant !== -1) { let newCookies: any = {}; if (cookies) { newCookies = { ...cookies, [encodeURIComponent(cookieName)]: variant, }; } if (JSON.stringify(cookies) !== JSON.stringify(newCookies)) { setCookies(newCookies); Cookies.set(cookieName, `${variant}`, { expires: pMAX_AGE ?? MAX_AGE, }); } } }, [variant, pMAX_AGE, cookieName, cookies, setCookies]); function removeExperimentCookie(experimentName: string) { console.log(`removing experiment named ${experimentName}`); Cookies.remove(experimentName); } const childrenWithProps = React.Children.map(props.children, (child) => { return React.cloneElement(child, { onClick: ( e: React.MouseEvent<HTMLElement>, variantName: string ) => { if (props.onClick) { props.onClick(e, props.name, variantName); } if (child.props.onClick) { child.props.onClick(e, variantName); } }, onRunVariant: (variantName: string) => { if (props.onRunExperiment) { props.onRunExperiment(props.name, variantName); } if (child.props.onRunVariant) { child.props.onRunVariant(variantName); } }, }); }); const handleOpen = () => { setOpen(true); }; const handleClose = () => { setOpen(false); }; function debugChange(e: React.ChangeEvent<HTMLInputElement>) { setVariant(e.currentTarget.value); } const experimentContent = childrenWithProps.length < 2 ? childrenWithProps[0] : childrenWithProps.length >= 2 && typeof variant === 'string' ? childrenWithProps.find((child: React.ReactElement) => child.props.name == variant) : null return ( <> {experimentContent !== null ? experimentContent : ( <span> <br /><br />loading experiment ...<br /><br /> </span> )} {typeof document !== 'undefined' && debug ? ( <> <Debug debugChange={debugChange} handleClose={handleClose} handleRemoveExperiment={removeExperimentCookie} open={open} name={props.name} variant={variant} > {childrenWithProps} </Debug> </> ) : null} </> ); }
30.90184
103
0.520945
4bb4d54b0dff96d9c2763aae213775de552d7c5c
4,830
cxx
C++
plugins/examples/noise.cxx
kahlertfr/cgv
a48139eb8af777ab63c78c09fc6aa44592908bc7
[ "BSD-3-Clause" ]
null
null
null
plugins/examples/noise.cxx
kahlertfr/cgv
a48139eb8af777ab63c78c09fc6aa44592908bc7
[ "BSD-3-Clause" ]
null
null
null
plugins/examples/noise.cxx
kahlertfr/cgv
a48139eb8af777ab63c78c09fc6aa44592908bc7
[ "BSD-3-Clause" ]
null
null
null
#include <cgv/gui/provider.h> #include <cgv/gui/dialog.h> #include <cgv/gui/file_dialog.h> #include <cgv/data/data_format.h> #include <cgv/os/clipboard.h> #include <cgv/data/data_view.h> #include <cgv/media/image/image_writer.h> #include <cgv/render/drawable.h> #include <cgv/render/context.h> #include <cgv/render/texture.h> #include <cgv/render/attribute_array_binding.h> #include <cgv/render/frame_buffer.h> #include <cgv/render/shader_program.h> #include <cgv_gl/gl/gl.h> #include <cgv/math/ftransform.h> #include <random> using namespace cgv::base; using namespace cgv::gui; using namespace cgv::data; using namespace cgv::render; using namespace cgv::utils; using namespace cgv::type; class noise : public node, public drawable, public provider { bool recreate_texture; protected: bool interpolate; float density; int w, h; int mode; texture T; public: noise() { set_name("noise"); w = 256; h = 128; mode = 0; recreate_texture = true; density = 0.5f; interpolate = false; T.set_mag_filter(TF_NEAREST); T.set_wrap_s(cgv::render::TW_REPEAT); T.set_wrap_t(cgv::render::TW_REPEAT); } void on_set(void* member_ptr) { if (member_ptr == &interpolate) { T.set_mag_filter(interpolate ? TF_LINEAR : TF_NEAREST); } if (member_ptr == &w || member_ptr == &h || member_ptr == &mode || member_ptr == &density) { recreate_texture = true; } update_member(member_ptr); post_redraw(); } void save() { std::string file_name = file_save_dialog("save noise to file", "Image Files (bmp,png,jpg,tif):*.bmp;*.png;*.jpg;*.tif|All Files:*.*"); if (file_name.empty()) return; std::vector<rgba8> data(w*h); create_texture_data(data); cgv::data::data_format df(w, h, cgv::type::info::TI_UINT8, cgv::data::CF_RGBA); cgv::data::data_view dv(&df, &data.front()); cgv::media::image::image_writer ir(file_name); ir.write_image(dv); } void copy() { std::vector<rgba8> data(w*h); create_texture_data(data); std::vector<rgb8> rgb_data(w*h); for (size_t i = 0; i < data.size(); ++i) rgb_data[i] = data[i]; cgv::os::copy_rgb_image_to_clipboard(w, h, &rgb_data.front()[0]); cgv::gui::message("copied image to clipboard"); } void create_gui() { add_member_control(this, "w", (cgv::type::DummyEnum&)w, "dropdown", "enums='4=4,8=8,16=16,32=32,64=64,128=128,256=256,512=512'"); add_member_control(this, "h", (cgv::type::DummyEnum&)h, "dropdown", "enums='4=4,8=8,16=16,32=32,64=64,128=128,256=256,512=512'"); add_member_control(this, "mode", (DummyEnum&)mode, "dropdown", "enums='grey=0;white,brown'"); add_member_control(this, "density", density, "value_slider", "min=0;max=1;ticks=true"); add_member_control(this, "interpolate", interpolate, "toggle"); connect_copy(add_button("save to file")->click, cgv::signal::rebind(this, &noise::save)); connect_copy(add_button("copy to clipboard")->click, cgv::signal::rebind(this, &noise::copy)); } bool init(context& ctx) { return true; } void draw_quad(context& ctx) { const vec2 P[4] = { vec2(-1,1), vec2(-1,-1), vec2(1,1), vec2(1,-1) }; const vec2 T[4] = { vec2(0,1), vec2(0.0f,0.0f), vec2(1,1), vec2(1.0f,0.0f) }; attribute_array_binding::set_global_attribute_array(ctx, 0, P, 4); attribute_array_binding::enable_global_array(ctx, 0); attribute_array_binding::set_global_attribute_array(ctx, 3, T, 4); attribute_array_binding::enable_global_array(ctx, 3); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); attribute_array_binding::disable_global_array(ctx, 3); attribute_array_binding::disable_global_array(ctx, 0); } void create_texture_data(std::vector<rgba8>& data) { std::default_random_engine g; std::uniform_int_distribution<cgv::type::uint32_type> d(0,255); for (auto& c : data) { cgv::type::uint8_type v = d(g); if (mode == 1) v = v < density*255 ? 0 : 255; else if (mode == 2) v = (v + d(g) + d(g) + d(g))/4; c[0] = c[1] = c[2] = v; c[3] = 255; } } void init_frame(context& ctx) { if (!recreate_texture) return; std::vector<rgba8> data(w*h); create_texture_data(data); cgv::data::data_format df(w, h, cgv::type::info::TI_UINT8, cgv::data::CF_RGBA); cgv::data::data_view dv(&df, &data.front()); T.create(ctx, dv); recreate_texture = false; } void draw(context& ctx) { glDisable(GL_CULL_FACE); ctx.push_modelview_matrix(); ctx.mul_modelview_matrix(cgv::math::scale4<double>(double(w) / h, -1.0, 1.0)); ctx.ref_default_shader_program(true).enable(ctx); ctx.set_color(rgb(1, 1, 1)); T.enable(ctx); draw_quad(ctx); T.disable(ctx); ctx.ref_default_shader_program(true).disable(ctx); ctx.pop_modelview_matrix(); glEnable(GL_CULL_FACE); } }; #include <cgv/base/register.h> /// register a factory to create new cubes extern cgv::base::factory_registration<noise> noise_fac("new/algorithms/noise", 'N');
30.764331
131
0.68323
c6f357b1649f25f88963d839847202f022659781
46,081
css
CSS
para-o-site/original/css/style.css
Demetriofds/Ctd-tecnologia
e1aea7c0ec7b56c5e21c75edf379a8236d040618
[ "MIT" ]
null
null
null
para-o-site/original/css/style.css
Demetriofds/Ctd-tecnologia
e1aea7c0ec7b56c5e21c75edf379a8236d040618
[ "MIT" ]
null
null
null
para-o-site/original/css/style.css
Demetriofds/Ctd-tecnologia
e1aea7c0ec7b56c5e21c75edf379a8236d040618
[ "MIT" ]
null
null
null
/*-- Author: W3layouts Author URL: http://w3layouts.com License: Creative Commons Attribution 3.0 Unported License URL: http://creativecommons.org/licenses/by/3.0/ --*/ body{ margin:0; padding:0; background:#fff; font-family: 'Open Sans', sans-serif; } h1,h2,h3,h4,h5,h6{ margin:0; font-family: 'Montserrat', sans-serif; } p{ margin:0; } ul{ margin:0; padding:0; } p,ul,ol{ font-size:14px; } input[type="submit"],a,.nbs-flexisel-nav-left,.nbs-flexisel-nav-right{ transition:.5s ease-in; -webkit-transition:.5s ease-in; -moz-transition:.5s ease-in; -o-transition:.5s ease-in; -ms-transition:.5s ease-in; } a:hover{ text-decoration:none; } a:focus{ outline:none; text-decoration:none; } /*-- banner --*/ /*--header -top--*/ /*-- nav --*/ .w3_navigation { padding: 0.9em 0; } .navbar-default { background: none; border: none; } .navbar { margin-bottom: 0; } .navbar-collapse { padding: 0; } .navbar-right { margin-right: 0; } .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus { color:#fff; background:none; } .navbar-default .navbar-nav > li > a { font-weight: 500; letter-spacing: 1px; } .navbar-nav > li > a { margin: 0; padding:0 1.5em; text-transform: uppercase; } .navbar-default .navbar-nav > li > a:hover{ color:#f2184f; } .navbar-default .navbar-nav > li > a:focus { color: #33cc99; outline:none; } nav.navbar.navbar-default { background: none; padding:1em 0 0 0; } .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus { color:#33cc99; background: none; } .navbar-default .navbar-nav > li > a { color: #000; } .navbar-default .navbar-nav > .active.open > a:focus { background: #0a9dbd; color: #fff; } .navbar-default .navbar-brand,.navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus { color: #dca44b; } .navbar-brand { padding: 0; font-size:1em; text-transform: uppercase; letter-spacing:1px; line-height:35px; position: relative; font-weight: 700; } .navbar-brand span { color: #82b9e2; } p.logo_w3l_agile_caption { text-transform:uppercase; letter-spacing:9px; font-size: 11px; color: #8c908c; font-family: 'Open Sans', sans-serif; font-weight: 600; text-align: center; } .agile_short_dropdown { border-radius: 0; background: #ffffff; text-align: center; padding:0; border: none; } .agile_short_dropdown li a{ text-transform:uppercase; color:#212121; font-size:13px; font-weight:600; padding: .8em 0; } .agile_short_dropdown > li > a:hover{ color: #fff; text-decoration: none; background-color: #ef5734; } .header { padding: 1em 0em; background:rgba(0, 0, 0, 0.79); } /*-- //header-left --*/ /*-- w3-header-bottom --*/ .w3-header-bottom { background: #212121; padding: 0.8em 2em; } .agileinfo-phone { float: left; margin: .5em 2em 0 0; } .agileinfo-phone p { color: #FFFFFF; font-size: .9em; margin: 0; font-weight: 600; } .agileinfo-map{ margin-right:0; } .search-grid { float: right; width: 18%; border: 1px solid #fff; } .search-grid input[type="text"] { display: inline-block; background: none; border: none; border-right: solid 1px #ffffff; width: 84%; padding: .5em; outline: none; font-size: .9em; color: #FFFFFF; } .big-dog::-webkit-input-placeholder { color: #FFFFFF !important; } .search-grid i.fa.fa-paper-plane-o{ color: #FFFFFF !important; font-size: 1.2em !important; } .search-grid button.btn1 { color: #ffffff; font-size: .9em; padding: 6px 6px; border: none; outline:none; text-align: center; text-decoration: none; background: none; transition: 0.5s all; -webkit-transition: 0.5s all; -moz-transition: 0.5s all; -o-transition: 0.5s all; -ms-transition: 0.5s all; } .search button:hover{ border: solid 1px #212121; background: #212121; } .search button:hover i.fa.fa-paper-plane-o{ color: #FFFFFF !important; } /*-- nav-effect --*/ .menu__list { position: relative; margin:0.5em 0 0; } .menu__item { display: block; margin: 1em 0; } .menu__link { font-size: 1.05em; font-weight: bold; display: block; padding: 1em; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-touch-callout: none; -khtml-user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } /* Iris */ .menu--iris .menu__item { margin:0 0.5em; } .menu--iris .menu__link { position: relative; text-align: center; -webkit-transition: color 0.3s; transition: color 0.3s; } .menu--iris .menu__link:hover, .menu--iris .menu__link:focus { color: #929292; } .menu--iris .menu__item--current .menu__link,.menu__link:hover { color:#dca44b; } .menu--iris .menu__link::before, .menu--iris .menu__link::after { content: ''; position: absolute; width: 10px; height: 10px; opacity: 0; border: 2px solid #4a4a4a; -webkit-transition: -webkit-transform 0.3s, opacity 0.3s; transition: transform 0.3s, opacity 0.3s; -webkit-transition-timing-function: cubic-bezier(0.17, 0.67, 0.05, 1.29); transition-timing-function: cubic-bezier(0.17, 0.67, 0.05, 1.29); } .menu--iris .menu__link::before { top: 0; left: 0; border-width: 2px 0 0 2px; -webkit-transform: translate3d(10px, 10px, 0); transform: translate3d(10px, 10px, 0); } .menu--iris .menu__link::after { right: 0; bottom: 0; border-width: 0 2px 2px 0; -webkit-transform: translate3d(-10px, -10px, 0); transform: translate3d(-10px, -10px, 0); } .menu--iris .menu__item--current .menu__link::before, .menu--iris .menu__item--current .menu__link::after,.menu__link:hover::before,.menu__link:hover::after { opacity: 1; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } .dropdown-menu { position: absolute; top: 226%; left: 0; z-index: 1000; display: none; } /*-- //nav-effect --*/ /*-- banner-text --*/ .header-w3layouts{ position: absolute; top: 0; z-index: 99; text-align: center; left: 0; width: 100%; } .agileits-banner-info h3 { color: #fff; font-size: 4em; margin: 0.1em 0 0.2em 0; letter-spacing: 2px; text-transform: uppercase; font-weight: 700; text-shadow: 1px 1px 2px rgb(12, 12, 12); -webkit-text-shadow: 1px 1px 2px rgb(12, 12, 12); -o-text-shadow: 1px 1px 2px rgb(12, 12, 12); -moz-text-shadow: 1px 1px 2px rgb(12, 12, 12); } .agileits-banner-info h3 span{ background: #2529d8; padding: 0 15px; } .agileits-banner-info { text-align: center; padding: 18em 0 0em; } .agileits-banner-info p { color: #e2dfdf; font-size: 1em; line-height: 2.2em; letter-spacing: 2px; font-weight: 500; width: 49%; margin: 0 auto; text-align: center; } .agileits_w3layouts_more{ position:relative; } .agileits_w3layouts_more a{ font-size: 17px; color: #fff; text-decoration: none; text-transform: uppercase; letter-spacing: 4px; position: relative; } .agileits-banner-info span { background:#ef5734; padding: 0.5em 2em; color: #fff; font-size: 1.1em; padding: 5px 2em; text-transform: uppercase; letter-spacing: 2px; } /*-- //banner-text --*/ /*-- banner-top --*/ .w3layouts-banner-top{ background: url(../images/ba1.jpg) no-repeat 0px 0px; background-size: cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; -moz-background-size: cover; min-height:700px; } .w3layouts-banner-top1{ background: url(../images/ba2.jpg) no-repeat 0px 0px; background-size: cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; -moz-background-size: cover; min-height:700px; } .w3layouts-banner-top2{ background: url(../images/ba3.jpg) no-repeat 0px 0px; background-size: cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; -moz-background-size: cover; min-height:700px; } .w3layouts-banner-top3{ background: url(../images/ba4.jpg) no-repeat 0px 0px; background-size: cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; -moz-background-size: cover; min-height:700px; } /*-- //banner-top --*/ .banner-1{ background: url(../images/ba1.jpg) no-repeat 0px -200px; background-size: cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; -moz-background-size: cover; min-height:300px; } /*--about--*/ /*-- welcome --*/ .about,.services,.w3-offer,.testimonials,.contact,.team,.gallery,.about-grids1{ padding:4em 0; } .w3-heading-all h3{ font-size: 3em; color: #f2184f; text-align: center; margin-bottom:40px; text-transform: capitalize; } /* about */ .about-left img { width: 100%; } .about-right h3 { font-size: 1em; color: #000; line-height: 1.5em; text-transform: uppercase; font-weight: 600; letter-spacing: 1px; } .about-right p { color: #999; margin: 1em 0; font-size: 1em; line-height: 1.8em; } .about-right a { background: #ffb900; border: 2px solid #ffb900; color: #FFFFFF; padding: .4em 1em; font-size: 1.3em; } .about-right a:hover { background: rgb(19,19,19); color: #fff; border: 2px solid rgb(19,19,19); } .more { margin: 3em 0 1em; } .agileits-w3layouts-info img { vertical-align: middle; width: 100%; margin-bottom: 1em; } .modal-title { text-align: center; font-size: 2em; text-transform: uppercase; font-weight: 600; margin: .5em 0; color: #dca44b; letter-spacing: 1px; } .span1{ color:#000; } .agileits-w3layouts-info p { font-size: 1em; line-height: 1.8em; line-height: 1.8em; color: #999; } .modal-content { border-radius:0px; } .more a { background: #dca44b; color: #fff; border: 2px solid #dca44b; color: #FFFFFF; padding: .4em 1em; font-size: 1.3em; } .more a:hover { background: rgb(19,19,19); color: #fff; border: 2px solid rgb(19,19,19); } .w3-about-bottom-head h3 { font-size: 3em; margin: 1em 0; color:#fff; } .w3-about-bottom-head p { font-size: 1em; line-height: 1.8em; width: 89%; color: rgba(255, 255, 255, 0.78); } .about-bottom-icon1 i { font-size: 3em; color: #4dc8ec; margin: 0.5em 0; } .about-bottom-icon1 h4 { font-size: 2em; margin: 0.5em 0; color: #fff; font-weight: 600; } .about-bottom-icon1 h3 { font-size: 2.5em; margin: 0.5em 0; text-transform: capitalize; color: #fff; } /* //about */ /*-- about page--*/ .banner-text.agileinfo.about-w3bnr h2 { font-size: 2em; letter-spacing: 3px; } .banner-text.agileinfo.about-w3bnr h2 a{ color:#03d2be; } .banner-text.agileinfo.about-w3bnr h2 a:hover{ color:#fff; } .banner-text.agileinfo.about-w3bnr{ padding: 4em 0; } .w3ls_about_left_grid h3 { color: #f2184f; font-size: 1.8em; margin-bottom: 0.54em; } .w3ls_about_left_grid:nth-child(2) { margin: 2.2em 0; } .w3ls_about_left_grid i.fa{ color: #dca44b; margin-right: 0.8em; } /*-- //about page--*/ /*-- /services --*/ .w3-services-grids{ background: url(../images/s11.jpg) no-repeat 0px -226px; background-size: cover; min-height:451px; } .w3-services-grid-right i { font-size: 3em; color: #dca44b; } .w3-services-grid-info { margin: 2em 0; } .w3-services-grid-right { background:rgba(120, 113, 113, 0.32); padding: 4em 3em; } .w3-services-grid-right1 p { color: #fff; font-size: 1em; line-height: 1.8em; } /*-- //services --*/ /*-- //team --*/ .team-social { -webkit-transition: all 0.5s; -moz-transition: all 0.5s; transition: all 0.5s; -o-transition: all 0.5s; -ms-transition: all 0.5s; margin-bottom: 1em; } .team-social a i { color: #000; font-size: 16px; padding: 10px; width: 35px; height: 35px; line-height: 15px; text-align: center; border-radius: 50%; -webkit-border-radius:50%; -o-border-radius:50%; -moz-border-radius:50%; -ms-border-radius:50%; } .team i.fa.fa-facebook { color: #3b5998; border: 1px solid #3b5998; } .team i.fa.fa-facebook:hover { color: #fff; background: #3b5998; border: 1px solid #3b5998; -webkit-transition: all 1s; -moz-transition: all 1s; transition: 1s all; -o-transition: all 1s; -ms-transition: all 1s; } .team i.fa.fa-twitter { color: #1da1f2; border: 1px solid #1da1f2; } .team i.fa.fa-twitter:hover { color: #fff; background: #1da1f2; border: 1px solid #1da1f2; -webkit-transition: all 1s; -moz-transition: all 1s; transition: 1s all; -o-transition: all 1s; -ms-transition: all 1s; } .team i.fa.fa-linkedin { color: #e68523; border: 1px solid #e68523; } .team i.fa.fa-linkedin:hover { color: #fff; background: #e68523; border: 1px solid #e68523; -webkit-transition: all 1s; -moz-transition: all 1s; transition: 1s all; -o-transition: all 1s; -ms-transition: all 1s; } .team i.fa.fa-pinterest-p { color: #bd081c; border: 1px solid #bd081c; } .team i.fa.fa-pinterest-p:hover { color: #fff; background: #bd081c; border: 1px solid #bd081c; -webkit-transition: all 1s; -moz-transition: all 1s; transition: 1s all; -o-transition: all 1s; -ms-transition: all 1s; } .teamgrids p { color: #4a4a4a; font-size: 15px; margin: .8em 0; letter-spacing: 1px; } .teamgrid1 i.fa { color: #ff4c4c; font-size: 1.2em; padding-right: .5em; } .teamgrid1 h3 { color: #000; text-transform: uppercase; margin: 1em 0; font-size: 21px; } .teaminfo { border: 1px solid #e8e8e8; padding: 1em 2em; border-top: transparent; -webkit-box-shadow: 0px 2px 14px -5px rgba(0,0,0,0.75); -moz-box-shadow: 0px 2px 14px -5px rgba(0,0,0,0.75); box-shadow: 0px 2px 14px -5px rgba(0,0,0,0.75); } .teamgrids { margin-top: 5em; } /*-- social-icons --*/ .w3-header-top-left { float: left; } .agileinfo-social-grids{ margin-left: 0; } .agileinfo-social-grids ul{ padding:0; margin:0; } .agileinfo-social-grids ul li{ display: inline-block; } .agileinfo-social-grids ul li a { color: #FFFFFF; text-align: center; } .agileinfo-social-grids ul li a span.fa{ transition: 0.5s all; -webkit-transition: 0.5s all; -moz-transition: 0.5s all; -o-transition: 0.5s all; -ms-transition: 0.5s all; } .agileinfo-social-grids ul li a span.fa.fa-facebook:hover { color: #3b5998; } .agileinfo-social-grids ul li a span.fa.fa-twitter{ margin:0 1em; } .agileinfo-social-grids ul li a span.fa.fa-twitter:hover{ color: #55acee; } .agileinfo-social-grids ul li a span.fa.fa-rss{ margin:0 1em 0 0; } .agileinfo-social-grids ul li a span.fa.fa-rss:hover{ color: #f26522; } .agileinfo-social-grids ul li a span.fa.fa-vk:hover{ color: #45668e; } /*-- //team --*/ /*-- testimonials --*/ .w3ls_testimonials_grids{ width: 80%; margin: 0em auto 3em; } .w3l_testimonial_grid{ padding: 4em 2em 2em; background: #f5f5f5; text-align: center; position: relative; margin: 5em 1.2em 0; } .w3l_testimonial_grid:focus,.agileits_testimonial_grid:focus{ outline:none; } .w3l_testimonial_grid_pos{ position:absolute; width:100%; text-align:center; top:-25%; left:0%; } .w3l_testimonial_grid_pos img{ margin:0 auto; border-radius:50%; } .w3l_testimonial_grid p{ color:#999; line-height:2em; position:relative; padding-left:2em; } .w3l_testimonial_grid p:before{ content:"\f10d"; font-size:2em; color:#dca44b; font-family:FontAwesome; position:absolute; top:0%; left:0%; } .agileits_testimonial_grid h4{ font-size:1.1em; color:#212121; margin:1em 0 0.5em; } .agileits_testimonial_grid h5{ font-size:.8em; color:#dca44b; } /* Slider */ .slick-slider { position: relative; display: block; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-touch-callout: none; -khtml-user-select: none; -ms-touch-action: pan-y; touch-action: pan-y; -webkit-tap-highlight-color: transparent; } .slick-list { position: relative; display: block; overflow: hidden; margin: 0; padding: 0; } .slick-list:focus { outline: none; } .slick-list.dragging { cursor: pointer; cursor: hand; } .slick-slider .slick-track, .slick-slider .slick-list { -webkit-transform: translate3d(0, 0, 0); -moz-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); -o-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } .slick-track { position: relative; top: 0; left: 0; display: block; } .slick-track:before, .slick-track:after { display: table; content: ''; } .slick-track:after { clear: both; } .slick-loading .slick-track { visibility: hidden; } .slick-slide { display: none; float: left; height: 100%; min-height: 1px; } [dir='rtl'] .slick-slide { float: right; } .slick-slide img { display: block; } .slick-slide.slick-loading img { display: none; } .slick-slide.dragging img { pointer-events: none; } .slick-initialized .slick-slide { display: block; } .slick-loading .slick-slide { visibility: hidden; } .slick-vertical .slick-slide { display: block; height: auto; border: 1px solid transparent; } .slick-arrow.slick-hidden { display: none; } /* Arrows */ .slick-prev, .slick-next { line-height: 0; position: absolute; top: 60%; display: block; width: 50px; height: 40px; margin-top: 0; padding: 0; cursor: pointer; color: #fff; border: none; font-size: 1em; outline: none; background: #dca44b; z-index: 9; } .slick-prev:hover, .slick-prev:focus, .slick-next:hover, .slick-next:focus { outline: none; } .slick-prev:hover:before, .slick-prev:focus:before, .slick-next:hover:before, .slick-next:focus:before { opacity: 1; } .slick-prev.slick-disabled:before, .slick-next.slick-disabled:before { opacity: .25; } .slick-prev:before, .slick-next:before { font-family: 'FontAwesome'; line-height: 1; opacity: .75; color: white; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .slick-prev:before { content:"\f177"; } [dir='rtl'] .slick-prev:before { content: "\f177"; } .slick-next,[dir='rtl'] .slick-prev { right:-6.5%; } [dir='rtl'] .slick-next,.slick-prev { right: auto; left:-6.5%; } .slick-next:before { content: "\f178"; } [dir='rtl'] .slick-next:before { content: "\f178"; } /* Dots */ .slick-slider { margin-bottom: 30px; } .slick-dots { position: absolute; bottom: -45px; display: block; width: 100%; padding: 0; list-style: none; text-align: center; } .slick-dots li { position: relative; display: inline-block; width: 20px; height: 20px; margin: 0 5px; padding: 0; cursor: pointer; } .slick-dots li button { font-size: 0; line-height: 0; display: block; width: 20px; height: 20px; padding: 5px; cursor: pointer; color: #212121; border: 0; outline: none; background:transparent; } .slick-dots li button:hover, .slick-dots li button:focus { outline: none; } .slick-dots li button:hover:before, .slick-dots li button:focus:before { opacity: 1; } .slick-dots li button:before { font-family: 'FontAwesome'; font-size: 13px; line-height: 20px; position: absolute; top: 0; left: 0; width: 20px; height: 20px; content: "\f111"; text-align: center; opacity: .25; color: #808080; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .slick-dots li.slick-active button:before { opacity: .75; color: black; } /*-- //testimonials --*/ /*-- /blog --*/ .banner-btm-top, .banner-btm-bottom { display: flex; display: -webkit-flex; } .a1 { background: #dca44b; } .a4 { background: #dca44b; } .a2 { background: url(../images/b1.jpg) no-repeat 0px 0px; background-size: cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; -ms-background-size: cover; min-height: 350px; } .a3 { background: url(../images/b2.jpg) no-repeat 0px 0px; background-size: cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; -ms-background-size: cover; min-height: 350px; } .a5 { background: url(../images/b3.jpg) no-repeat 0px 0px; background-size: cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; -ms-background-size: cover; min-height: 350px; } .a6 { background: url(../images/b4.jpg) no-repeat 0px 0px; background-size: cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; -ms-background-size: cover; min-height: 350px; } .banner-btm-left { padding: 0; } .banner-btm-inner { flex: 1; padding: 8em 2.5em; } .blog_date h4 { font-size: 0.9em; font-weight: 600; color: #230303; margin-bottom: 1em; } .banner-btm-inner h6 { font-size: 1.1em; font-weight: 600; color: #222; margin-bottom: 1em; } .banner-btm-inner h6 a { color: #222323; letter-spacing: 2px; } .banner-btm-inner p { font-size: 0.9em; color: #fff; margin: 1em 0; } a.blog-btn { background: #fff; font-size: 0.85em; padding: 0.6em 1em; color: #222; letter-spacing: 1px; } a.blog-btn:hover { background: #ff3c41; color: #fff; } /*-- //blog --*/ /*-- to-top --*/ #toTop { display: none; text-decoration: none; position: fixed; bottom: 55px; right: 2%; overflow: hidden; z-index: 999; width: 32px; height: 32px; border: none; text-indent: 100%; background: url(../images/up.png) no-repeat 0px 0px; } #toTopHover { width: 32px; height: 32px; display: block; overflow: hidden; float: right; opacity: 0; -moz-opacity: 0; filter: alpha(opacity=0); } /*-- //to-top --*/ /*-- icons --*/ .codes a { color: #999; } .icon-box { padding: 8px 15px; background:rgba(149, 149, 149, 0.18); margin: 1em 0 1em 0; border: 5px solid #ffffff; text-align: left; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; font-size: 13px; transition: 0.5s all; -webkit-transition: 0.5s all; -o-transition: 0.5s all; -ms-transition: 0.5s all; -moz-transition: 0.5s all; cursor: pointer; } .icon-box:hover { background: #000; transition:0.5s all; -webkit-transition:0.5s all; -o-transition:0.5s all; -ms-transition:0.5s all; -moz-transition:0.5s all; } .icon-box:hover i.fa { color:#fff !important; } .icon-box:hover a.agile-icon { color:#fff !important; } .codes .bs-glyphicons li { float: left; width: 12.5%; height: 115px; padding: 10px; line-height: 1.4; text-align: center; font-size: 12px; list-style-type: none; } .codes .bs-glyphicons .glyphicon { margin-top: 5px; margin-bottom: 10px; font-size: 24px; } .codes .glyphicon { position: relative; top: 1px; display: inline-block; font-style: normal; font-weight: 400; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: #777; } .codes .bs-glyphicons .glyphicon-class { display: block; text-align: center; word-wrap: break-word; } h3.icon-subheading { font-size: 28px; color: #ef5734 !important; margin: 30px 0 15px; font-weight: 600; letter-spacing: 2px; } h3.agileits-icons-title { text-align: center; font-size: 33px; color: #222222; font-weight: 600; letter-spacing: 2px; } .icons a { color: #999; } .icon-box i { margin-right: 10px !important; font-size: 20px !important; color: #282a2b !important; } .bs-glyphicons li { float: left; width: 18%; height: 115px; padding: 10px; line-height: 1.4; text-align: center; font-size: 12px; list-style-type: none; background:rgba(149, 149, 149, 0.18); margin: 1%; } .bs-glyphicons .glyphicon { margin-top: 5px; margin-bottom: 10px; font-size: 24px; color: #282a2b; } .glyphicon { position: relative; top: 1px; display: inline-block; font-style: normal; font-weight: 400; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: #777; } .bs-glyphicons .glyphicon-class { display: block; text-align: center; word-wrap: break-word; } @media (max-width:991px){ h3.agileits-icons-title { font-size: 28px; } h3.icon-subheading { font-size: 22px; } } @media (max-width:768px){ h3.agileits-icons-title { font-size: 28px; } h3.icon-subheading { font-size: 25px; } .row { margin-right: 0; margin-left: 0; } .icon-box { margin: 0; } } @media (max-width: 640px){ .icon-box { float: left; width: 50%; } } @media (max-width: 480px){ .bs-glyphicons li { width: 31%; } } @media (max-width: 414px){ h3.agileits-icons-title { font-size: 23px; } h3.icon-subheading { font-size: 18px; } .bs-glyphicons li { width: 31.33%; } } @media (max-width: 384px){ .icon-box { float: none; width: 100%; } } /*-- //icons --*/ .w3_wthree_agileits_icons.main-grid-border { padding: 6em 0; } /*--Typography--*/ .well { font-weight: 300; font-size: 14px; } .list-group-item { font-weight: 300; font-size: 14px; } li.list-group-item1 { font-size: 14px; font-weight: 300; } .typo p { margin: 0; font-size: 14px; font-weight: 300; } .show-grid [class^=col-] { background: #fff; text-align: center; margin-bottom: 10px; line-height: 2em; border: 10px solid #f0f0f0; } .show-grid [class*="col-"]:hover { background: #e0e0e0; } .grid_3{ margin-bottom:2em; } .xs h3, h3.m_1{ color:#000; font-size:1.7em; font-weight:300; margin-bottom: 1em; } .grid_3 p{ color: #999; font-size: 0.85em; margin-bottom: 1em; font-weight: 300; } .grid_4{ background:none; margin-top:50px; } .label { font-weight: 300 !important; border-radius:4px; } .grid_5{ background:none; padding:2em 0; } .grid_5 h3, .grid_5 h2, .grid_5 h1, .grid_5 h4, .grid_5 h5, h3.hdg, h3.bars { margin-bottom: 1em; color: #ef5734; font-weight: 600; font-size: 30px; letter-spacing: 2px; } .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td { border-top: none !important; } .tab-content > .active { display: block; visibility: visible; } .pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > span:hover, .pagination > .active > a:focus, .pagination > .active > span:focus { z-index: 0; } .badge-primary { background-color: #03a9f4; } .badge-success { background-color: #8bc34a; } .badge-warning { background-color: #ffc107; } .badge-danger { background-color: #e51c23; } .grid_3 p{ line-height: 2em; color: #888; font-size: 0.9em; margin-bottom: 1em; font-weight: 300; } .bs-docs-example { margin: 1em 0; } section#tables p { margin-top: 1em; } .tab-container .tab-content { border-radius: 0 2px 2px 2px; border: 1px solid #e0e0e0; padding: 16px; background-color: #ffffff; } .table td, .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th { padding: 15px!important; } .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td { font-size: 0.9em; color: #999; border-top: none !important; } .tab-content > .active { display: block; visibility: visible; } .label { font-weight: 300 !important; } .label { padding: 4px 6px; border: none; text-shadow: none; } .alert { font-size: 0.85em; } h1.t-button,h2.t-button,h3.t-button,h4.t-button,h5.t-button { line-height:2em; margin-top:0.5em; margin-bottom: 0.5em; } li.list-group-item1 { line-height: 2.5em; } .input-group { margin-bottom: 20px; } .in-gp-tl{ padding:0; } .in-gp-tb{ padding-right:0; } .list-group { margin-bottom: 48px; } ol { margin-bottom: 44px; } h2.typoh2{ margin: 0 0 10px; } @media (max-width:768px){ .grid_5 { padding: 0 0 1em; } .grid_3 { margin-bottom: 0em; } } @media (max-width:640px){ h1, .h1, h2, .h2, h3, .h3 { margin-top: 0px; margin-bottom: 0px; } .grid_5 h3, .grid_5 h2, .grid_5 h1, .grid_5 h4, .grid_5 h5, h3.hdg, h3.bars { margin-bottom: .5em; } .progress { height: 10px; margin-bottom: 10px; } ol.breadcrumb li,.grid_3 p,ul.list-group li,li.list-group-item1 { font-size: 14px; } .breadcrumb { margin-bottom: 25px; } .well { font-size: 14px; margin-bottom: 10px; } h2.typoh2 { font-size: 1.5em; } .label { font-size: 60%; } .in-gp-tl { padding: 0 1em; } .in-gp-tb { padding-right: 1em; } } @media (max-width:480px){ .grid_5 h3, .grid_5 h2, .grid_5 h1, .grid_5 h4, .grid_5 h5, h3.hdg, h3.bars { font-size: 1.2em; } .table h1 { font-size: 26px; } .table h2 { font-size: 23px; } .table h3 { font-size: 20px; } .label { font-size: 53%; } .alert,p { font-size: 14px; } .pagination { margin: 20px 0 0px; } .grid_3.grid_4.w3layouts { margin-top: 25px; } } @media (max-width: 320px){ .grid_4 { margin-top: 18px; } h3.title { font-size: 1.6em; } .alert, p,ol.breadcrumb li, .grid_3 p,.well, ul.list-group li, li.list-group-item1,a.list-group-item { font-size: 13px; } .alert { padding: 10px; margin-bottom: 10px; } ul.pagination li a { font-size: 14px; padding: 5px 11px; } .list-group { margin-bottom: 10px; } .well { padding: 10px; } .nav > li > a { font-size: 14px; } table.table.table-striped,.table-bordered,.bs-docs-example { display: none; } } /*-- //typography --*/ .typo { padding: 6em 0; } /*-- about --*/ .agileits-top-heading{ padding: 2em 0; } .agileits-top-heading h2{ color:#FFFFFF; text-align:center; } /*-- gallery --*/ #portfolio p { line-height: 1.8em; margin: 25px 0 0 0; font-size:1.1; color: #ffffff; font-weight: 300; } .gallery-section h3{ margin: 0; color: #ffffff; font-size: 36px; font-weight: 500; letter-spacing: 18px; } .gallery-grid { padding: 0; } .gallery1 { position:relative; } .gallery1 .textbox { width:100%; height:100%; position:absolute; top:0; left:0; -webkit-transform: scale(0); transform: scale(0); background-color: #dca44bad; } .gallery1:hover .textbox { -webkit-transform: scale(1); transform: scale(1); } .gallery-grid img{ width:100%; } .textbox { -webkit-transition: all 0.7s ease; transition: all 0.7s ease; text-align:center; } .textbox h4 { font-size: 1.8em; color: #FFF; margin-top: 3.5em; text-transform: uppercase; font-weight: 700; letter-spacing: 5px; } .textbox p { font-size: 26px !important; color: #fff; background: rgba(0, 0, 0, 0.83); margin: 6px 0 0 0!important; padding: 3px 0; } .gallery-grids { margin-top: 50px; } /*--//gallery--*/ /*-- Counter --*/ .stats { padding: 8em 0; background: url(../images/st2.jpg) no-repeat 0px 0px; background-size: cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; -ms-background-size: cover; background-attachment: fixed; } .stats p.text-center { font-size: 16px; padding: 0px 0 40px; color: #999; } .stats-grid { text-align: center; } .numscroller { font-size: 3em; margin: 0; color: #fff; font-weight: 500; } .stats-grid i.fa { font-size: 2em; color: #dca44b; padding-bottom: 1em; } .stats-grid h4 { font-size: 1.2em; color: #fff; text-transform: uppercase; letter-spacing: 1px; font-weight: 400; margin-top: 1em; } /*-- //Counter --*/ /*--contact--*/ .address-row { margin-top: 3em; } .address-row:hover span.glyphicon { border-color: #f44236; color: #000000; } .w3-agile-address-left { padding: 0; } .address-row span.glyphicon { font-size: 1.2em; border: 2px solid #000; padding: 1em; color: #000000; transition: .5s all } .w3-agile-address-right h5 { font-size: 1.5em; color: #000; margin: 0 0 .4em 0; font-weight: 600; } .w3-agile-address-right p { font-size: 0.9em; color: #999999; margin: 0; } .w3-agile-address-right p a { color:#f44236; } .w3-agile-address-right p a:hover{ color: #999; } .address h4 { font-size: 2.5em; color: #dca44b; margin: 0 0 .6em 0; } .contact input[type="text"] { width: 47.9%; color: #999; /* float: left; */ background: none; outline: none; font-size: .9em; padding: .7em 1em; margin-bottom: 1.5em; border: solid 1px #999; -webkit-appearance: none; display: inline-block; } .contact input.email { margin-left: 1.5em; } .contact textarea { resize: none; width: 100%; background: none; color: #999; font-size: .9em; outline: none; padding: .6em .8em; border: solid 1px #999; min-height: 12em; -webkit-appearance: none; } .contact input[type="submit"] { outline: none; color: #000; padding: 0.5em 3em; font-size: .9em; margin: 1em 0 0 0; -webkit-appearance: none; background: none; transition: 0.5s all; border: 2px solid #000; -webkit-transition: 0.5s all; transition: 0.5s all; -moz-transition: 0.5s all; } .contact input[type="submit"]:hover { color: #FFFFFF; background:#f44236; border: 2px solid #f44236; } ::-webkit-input-placeholder { color:#999 !important; } :-moz-placeholder { /* Firefox 18- */ color:#999 !important; } ::-moz-placeholder { /* Firefox 19+ */ color:#999 !important; } :-ms-input-placeholder { color:#999 !important; } /*--//contact--*/ /*-- map --*/ .map { -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); -ms-filter: grayscale(100%); -o-filter: grayscale(100%); filter: grayscale(100%); } .agileits-w3layouts-map iframe { border: none; width: 100%; height: 400px; margin-bottom:-6px; } /*-- //map --*/ /*-- subscribe --*/ .subscribe{ background: #c32040; padding: 2em 0; } .subscribe h3.heading{ color: #ffffff; } .subscribe h3.heading { color: #ffffff; text-align: center; } .subscribe h3.heading { color: #ffffff; text-align: center; font-family: 'Montserrat', sans-serif; font-size: 3em; } .agile-subscribe-heading{ text-align:center; } .subscribe-grid{ text-align: center; width: 75%; margin: 2em auto 0; } .subscribe-grid input[type="email"] { display: inline-block; background: #FFFFFF; border: solid 1px #fff; width: 60%; outline: none; padding: .7em; font-size: 1.2em; color: #999999; } .subscribe-grid i.fa.fa-paper-plane-o{ color: #FFFFFF !important; font-size: 1.2em !important; } .subscribe-grid button.btn1 { color: #ffffff; font-size: 1.2em; border: solid 1px #efb312; width: 70px; padding: .7em; text-align: center; text-decoration: none; background: #efb312; transition: 0.5s all; -webkit-transition: 0.5s all; -moz-transition: 0.5s all; -o-transition: 0.5s all; -ms-transition: 0.5s all; } button.btn1:hover i.fa.fa-paper-plane-o{ color: #efb312 !important; } /*-- //subscribe --*/ /*-- footer --*/ .w3l_footer { background: #0e0e0e; padding: 3em 0; } .w3ls_footer_grid_left { width: 33.3%; } .w3ls_footer_grid_left h4 { font-size: 1.2em; color: #fff; letter-spacing: 5px; margin-bottom: .6em; font-weight: 600; } .w3ls_footer_grid_left p { color: #9c9c9c; font-size: 16px; letter-spacing: 0.5px; } .w3ls_footer_grid_left p a { text-decoration: none; color: #EA3621; } .w3ls_footer_grid_left p a:hover { text-decoration: none; color: #fff; } .w3ls_footer_grid_left p span { color: #cecece; margin-right: 7px; } .footer-button { text-align: center; } .footer-button h2 { color: #fff; font-size: 18px; letter-spacing: 6px; margin-top: 2em; } .button-top-w3layouts { display: block; margin: 0 auto; margin-top: 2em; position:relative; } .button-top-w3layouts:before { content: ""; width: 45%; height: 4%; background:#dca44b; position: absolute; display: block; top: 49px; left: 0px; } .button-top-w3layouts:after { content: ""; width: 45%; height: 4%; background:#dca44b; position: absolute; display: block; top: 49px; right: 0px; } .button-top-w3layouts i { color: #fff; font-size: 38px; } .logo-icons-w3ls i.fa.fa-heart-o.heart2 { color: #ea3621; font-size: 48px; } .logo-icons-w3ls{ position:relative; } .logo-icons-w3ls i.heart1 { position: absolute; left: 48%; transform: rotate(-22deg); top: 34%; font-size: 30px; } .w3ls_footer_grid { margin: 0 auto; text-align: center; } /*-- copyright --*/ .footer-bot { background:#dca44b; padding: 1em 0; } .logo2{ float:left; } .logo2 h3 a { color: #fff; text-decoration: none; font-size: 1.2em; text-transform: uppercase; margin: 0; } .ftr-menu { float: right; margin-top:5px; } .ftr-menu ul li{ display:inline-block; } .ftr-menu ul li a{ transition:0.5s all; -webkit-transition:0.5s all; -moz-transition:0.5s all; -o-transition:0.5s all; -ms-transition:0.5s all; display:block; text-decoration:none; font-size:16px; font-weight:500; color:#fff; margin:0 16px; } .ftr-menu ul li a:hover{ color:#fff !important; } .copy-right{ padding:15px 0; background:#020202; } .copy-right p { margin:0px 0 0 0; font-size:14px; color: #fff; text-align:center; letter-spacing: 2px; } .copy-right p a{ color:#fff; } .copy-right p a:hover { color: #f44236; } /*-- //copyright --*/ /*-- /responsive design --*/ @media(max-width:1440px){ } @media(max-width:1366px){ } @media(max-width:1280px){ .w3-services-grid-right { padding: 2.6em 3em; } } @media(max-width:1080px){ .search-grid { width: 25%; } .agileits-banner-info h3 { color: #fff; font-size: 3.2em; } .w3layouts-banner-top,.w3layouts-banner-top1,.w3layouts-banner-top2,.w3layouts-banner-top3 { min-height: 530px; } .agileits-banner-info { padding: 15em 0 0em; } .w3-services-grid-right { padding: 2.6em 0em; } .w3-services-grid-right { padding: 1em 0em; } .w3-services-grids { min-height: 371px; background: url(../images/s11.jpg) no-repeat 0px -124px; background-size: cover; } .textbox h4 { margin-top: 2.5em; } } @media(max-width:1024px){ .agileits-banner-info p { width: 70%; } .banner-btm-inner { flex: 1; padding: 6em 2.5em; } } @media(max-width:991px){ .agileits-banner-info h3 { color: #fff; font-size: 2.8em; letter-spacing: 1px; } .about-left { width: 80%; margin: 2em auto; } .w3-services-grids { min-height: 371px; background: url(../images/s11.jpg) no-repeat 0px -49px; } .w3-services-grid-info { width: 50%; margin: 0 auto; } .w3-services-grid-left1 { width: 20%; float: left; } .w3-services-grid-right1 { width: 80%; float: left; } .w3-services-grid-info { width: 50%; margin: 2em auto; } .w3ls_footer_grid_left { width: 100%; } .agileits-banner-info h3 { color: #fff; font-size: 2.5em; letter-spacing: 1px; } .w3ls_footer_grid_left { width: 100%; margin: 0 0 2em 0; } .teamgrid1 img { width: 100%; } .teamgrid1 { width: 50%; float: left; margin-bottom:2em; } .gallery-grid.gallery1 { width: 33.33%; float: left; } .address { width: 100%; } .w3-agile-address-left { width: 12%; float: left; } .w3-agile-address-right { width: 88%; } .contact-form { width: 100%; margin: 2em 0 0 0; } } @media(max-width:800px){ .banner-1 { background: url(../images/ba1.jpg) no-repeat 0px -88px; background-size: cover; } } @media(max-width:767px){ div#bs-example-navbar-collapse-1 { position: absolute; width: 100%; z-index: 999; } .navbar-default .navbar-nav > li > a { width: 25%; margin:0 auto; padding: 1em; color: #fff !important; } li.menu__item { background: #00000094; } .navbar-default .navbar-nav .open .dropdown-menu > li > a { color: #fff; font-size: 1.05em; } .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { color: #dca44b !important; } .navbar-default .navbar-nav > li > a:hover { color: #000000 !important; } } @media(max-width:736px){ .stats-grid.stats-grid-1.gridw3,.stats-grid.stats-grid-2.gridw3,.stats-grid.stats-grid-3.gridw3 { width: 50%; margin: 0 auto 2em; } li.menu__item { background: #dca44b87; } .search-grid { width: 31%; } } @media(max-width:734px){ .search-grid { width: 35%; } } @media(max-width:667px){ .search-grid { width: 35%; } .subscribe h3.heading { font-size: 2.5em; } .about, .services, .w3-offer, .testimonials, .contact, .team, .gallery, .about-grids1 { padding: 3em 0; } .banner-1 { background: url(../images/ba1.jpg) no-repeat 0px -10px; background-size: cover; } } @media(max-width:640px){ .w3-services-grid-right1 { width: 100%; float: left; } .w3-heading-all h3 { font-size: 2.8em; } .address h4 { font-size: 2em; } } @media(max-width:600px){ .agileits-banner-info h3 { color: #fff; font-size: 2.3em; letter-spacing: 1px; } .agileits-banner-info { padding: 13em 0 0em; } .w3-heading-all h3 { font-size: 2.5em; } .navbar-default .navbar-nav > li > a { width: 35%; } .w3l_testimonial_grid_pos { top: -17%; } .logo2 { float: none; text-align: center; } .ftr-menu { float: none; margin-top: 5px; text-align: center; } .gallery-grid.gallery1 { width: 50%; float: left; } .textbox h4 { margin-top: 3.5em; } } @media(max-width:568px){ .w3l_testimonial_grid { padding: 4em 0em 2em; } .logo2 { float: none; text-align: center; } .ftr-menu { float: none; margin-top: 16px; text-align: center; } .w3ls_about_left_grid h3 { font-size: 1.5em; } } @media(max-width:480px){ .search-grid { width: 44%; margin: 1em 0; } .agileits-banner-info h3 { color: #fff; font-size: 2em; letter-spacing: 1px; } .agileits-banner-info { padding: 9em 0 0em; } .w3l_testimonial_grid p { padding-left: 1em; } .teamgrid1 { width: 80%; float: none; margin-bottom: 2em; margin: 0 auto 2em; } .navbar-default .navbar-nav > li > a { width: 50%; } .textbox h4 { margin-top: 2.5em; } .w3-agile-address-left { width: 20%; float: left; } .w3-agile-address-right { width: 80%; } .contact input[type="text"] { width: 100%; } .contact input.email { margin-left: 0; } } @media(max-width:414px){ .w3layouts-banner-top, .w3layouts-banner-top1, .w3layouts-banner-top2, .w3layouts-banner-top3 { min-height: 400px; } .w3-services-grid-info { width: 100%; margin: 2em auto; } .w3-heading-all h3 { font-size: 2em; } .subscribe h3.heading { font-size: 1.8em; } .footer-button h2 { color: #fff; font-size: 18px; letter-spacing: 3px; margin-top: 2em; } .ftr-menu ul li a { margin: 0 8px; } .search-grid { width: 65%; margin: 1em 0; } .stats-grid.stats-grid-1.gridw3, .stats-grid.stats-grid-2.gridw3, .stats-grid.stats-grid-3.gridw3 { width: 75%; margin: 0 auto 2em; } .stats { padding: 2em 0; } .gallery-grid.gallery1 { width: 100%; float: none; } .textbox h4 { margin-top: 4.5em; } } @media(max-width:412px){ .agileits-banner-info h3 { font-size: 1.8em; } .agileits-banner-info p { width: 100%; } } @media(max-width:384px){ .agileits-banner-info h3 { font-size: 1.5em; letter-spacing: 1px; } .agileits-banner-info p { width: 100%; } .w3-services-grid-right i { font-size: 2em; color: #dca44b; } .w3l_testimonial_grid p:before { font-size: 1em; } .search-grid { width: 55%; margin: 1em 0; } .about, .services, .w3-offer, .testimonials, .contact, .team, .gallery, .about-grids1 { padding: 2em 0; } .numscroller { font-size: 2em; } .w3-agile-address-right h5 { font-size: 1.3em; } .button-top-w3layouts:after { width: 34%; } .button-top-w3layouts:before { content: ""; width: 36%; } } @media(max-width:375px){ .navbar-default .navbar-nav > li > a { width: 56%; } .ftr-menu ul li a { margin: 0 4px; } .subscribe-grid input[type="email"] { width: 70%; } } @media(max-width:320px){ .search-grid { width: 80%; margin: 1em 0; } .agileinfo-phone { float: none; margin: 0 auto; } .agileinfo-phone { float: none; margin: 0.5em auto 0; width: 56%; } .search-grid { width: 100%; margin: 1em 0; } .navbar-header.navbar-left h1 { font-size: 2em; } .banner-btm-inner { flex: none; width: 100%; } .subscribe h3.heading { font-size: 1.5em; } .subscribe-grid { text-align: center; width: 100%; margin: 2em auto 0; } .ftr-menu ul li a { margin: 0 3px; } .teamgrid1 { width: 100%; float: none; } .footer-button h2 { font-size: 14px; letter-spacing: 3px; margin-top: 1em; } .textbox h4 { margin-top: 3.5em; } .w3-agile-address-left { width: 100%; float: none; } .w3-agile-address-right { width: 100%; margin-top: 1em; } .address-row { margin-top: 1em; } } /*-- /responsive design --*/
18.491573
195
0.625008
392fc1da8380a0625107ee31590f0be53de2d36b
1,616
py
Python
icse38/icse38/urls.py
rp17/icse38site
eff2f4c33db8f07140d681177148614c7401b976
[ "MIT" ]
null
null
null
icse38/icse38/urls.py
rp17/icse38site
eff2f4c33db8f07140d681177148614c7401b976
[ "MIT" ]
null
null
null
icse38/icse38/urls.py
rp17/icse38site
eff2f4c33db8f07140d681177148614c7401b976
[ "MIT" ]
null
null
null
from django.conf.urls import patterns, include, url from django.conf import settings # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', # Examples: url(r'^$', 'icse38.views.index', name='index'), # url(r'^icse38/', 'icse38.views.index'), url(r'^base$', 'icse38.views.base', name='base'), url(r'^dates$', 'icse38.views.dates', name='base'), url(r'^videoContest$', 'icse38.views.videoContest', name='base'), url(r'^formack$', 'icse38.views.formack', name='base'), url(r'^formsub$', 'icse38.views.formsub', name='base'), url(r'^team/organizing-committee$', 'icse38.views.oc', name='oc'), url(r'^downloads$', 'icse38.views.downloads', name='downloads'), url(r'^venue$', 'icse38.views.venue', name='venue'), url(r'^keynotes$', 'icse38.views.keynotes', name='keynotes') # Uncomment the admin/doc line below to enable admin documentation: # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin: # url(r'^admin/', include(admin.site.urls)), # url(r'^downloads/promo-banners$', 'icse38.views.promo', name='promo'), # url(r'^downloads/benefactors-brochures$', 'icse38.views.brochures', name='brochures'), ) # https://github.com/django-debug-toolbar/django-debug-toolbar/issues/529 # resolve error on "NoReverseMatch at / u'djdt' is not a registered namespace" if settings.DEBUG: import debug_toolbar urlpatterns += patterns('', url(r'^__debug__/', include(debug_toolbar.urls)), )
31.686275
92
0.668936
6ae15d4c3d4dbc681748193189af8fda8dcd41bc
15,587
c
C
src/block16.c
2kranki/libCmn
4f9db4c9c8e2dff64e1c741dc1c11e9f3b5d07ce
[ "Unlicense" ]
2
2017-03-23T15:23:56.000Z
2021-03-04T09:54:54.000Z
src/block16.c
2kranki/libCmn
4f9db4c9c8e2dff64e1c741dc1c11e9f3b5d07ce
[ "Unlicense" ]
null
null
null
src/block16.c
2kranki/libCmn
4f9db4c9c8e2dff64e1c741dc1c11e9f3b5d07ce
[ "Unlicense" ]
null
null
null
// vi:nu:et:sts=4 ts=4 sw=4 tw=90 /* * File: block16.c * Generated 01/05/2016 07:38:50 * */ /* This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. 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 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. For more information, please refer to <http://unlicense.org/> */ //***************************************************************** //* * * * * * * * * * * * Data Definitions * * * * * * * * * * * //***************************************************************** /* Header File Inclusion */ #include <block16_internal.h> #include <stdio.h> #ifdef __cplusplus extern "C" { #endif /**************************************************************** * * * * * * * * * * * Internal Subroutines * * * * * * * * * * ****************************************************************/ #ifdef XYZZY static void block16_task_body( void *pData ) { //BLOCK_DATA *cbp = pData; } #endif // An offset of zero should never occur. So, it denotes an error. static uint32_t block16_DataOffset( BLOCK16_DATA *this ) { uint32_t offset = 0; if (this->pBlock) { offset = ROUNDUP4(sizeof(BLOCKED16_DATA)); offset += this->pBlock->headerSize; offset += this->pBlock->dataUsed; } return offset; } /**************************************************************** * * * * * * * * * * * External Subroutines * * * * * * * * * * ****************************************************************/ //=============================================================== // *** Class Methods *** //=============================================================== BLOCK16_DATA * block16_Alloc( ) { BLOCK16_DATA *this; uint32_t cbSize = sizeof(BLOCK16_DATA); // Do initialization. this = obj_Alloc( cbSize ); // Return to caller. return this; } // Given the data size, block16_blockSize returns the size of // the block that will be acquired. uint32_t block16_CalcBlockSize( uint16_t headerSize, uint16_t dataSize ) { uint32_t cbSize; // Do initialization. cbSize = ROUNDUP4(sizeof(BLOCKED16_DATA)); if (headerSize) { cbSize += ROUNDUP4(headerSize); } if (dataSize) { cbSize += ROUNDUP4(dataSize); } else { return 0; } // Return to caller. return( cbSize ); } BLOCK16_DATA * block16_New( ) { BLOCK16_DATA *this; this = block16_Alloc( ); if (this) { this = block16_Init(this); } return this; } BLOCK16_DATA * block16_NewWithSizes( uint16_t headerSize, uint16_t dataSize ) { BLOCK16_DATA *this; this = block16_Alloc( ); if (this) { this = block16_InitWithSizes(this, headerSize, dataSize); } return this; } //=============================================================== // P r o p e r t i e s //=============================================================== void * block16_getBlock( BLOCK16_DATA *this ) { // Validate the input parameters. #ifdef NDEBUG #else if( !block16_Validate( this ) ) { DEBUG_BREAK(); return OBJ_NIL; } #endif return this->pBlock; } bool block16_setBlock( BLOCK16_DATA *this, void *pValue ) { #ifdef NDEBUG #else if( !block16_Validate( this ) ) { DEBUG_BREAK(); return false; } #endif if (this->pBlock) { mem_Free(this->pBlock); } this->pBlock = pValue; return true; } void * block16_getData( BLOCK16_DATA *this ) { // Validate the input parameters. #ifdef NDEBUG #else if( !block16_Validate( this ) ) { DEBUG_BREAK(); return OBJ_NIL; } BREAK_NULL(this->pBlock); #endif return &this->pBlock->header[this->pBlock->headerSize]; } uint16_t block16_getDataOffset( BLOCK16_DATA *this ) { // Validate the input parameters. #ifdef NDEBUG #else if( !block16_Validate(this) ) { DEBUG_BREAK(); return 0; } BREAK_NULL(this->pBlock); #endif return this->pBlock->headerSize; } uint16_t block16_getDataSize( BLOCK16_DATA *this ) { // Validate the input parameters. #ifdef NDEBUG #else if( !block16_Validate(this) ) { DEBUG_BREAK(); return 0; } BREAK_NULL(this->pBlock); #endif return this->pBlock->dataSize; } uint16_t block16_getDataUsed( BLOCK16_DATA *this ) { // Validate the input parameters. #ifdef NDEBUG #else if( !block16_Validate(this) ) { DEBUG_BREAK(); return 0; } BREAK_NULL(this->pBlock); #endif return this->pBlock->dataUsed; } bool block16_setDataUsed( BLOCK16_DATA *this, uint16_t value ) { #ifdef NDEBUG #else if( !block16_Validate(this) ) { DEBUG_BREAK(); } BREAK_NULL(this->pBlock); #endif this->pBlock->dataUsed = value; return true; } void * block16_getHeader( BLOCK16_DATA *this ) { // Validate the input parameters. #ifdef NDEBUG #else if( !block16_Validate( this ) ) { DEBUG_BREAK(); return OBJ_NIL; } BREAK_NULL(this->pBlock); #endif return &this->pBlock->header[0]; } uint16_t block16_getHeaderSize( BLOCK16_DATA *this ) { // Validate the input parameters. #ifdef NDEBUG #else if( !block16_Validate(this) ) { DEBUG_BREAK(); return 0; } BREAK_NULL(this->pBlock); #endif return this->pBlock->headerSize; } bool block16_setHeaderSize( BLOCK16_DATA *this, uint16_t value ) { #ifdef NDEBUG #else if( !block16_Validate(this) ) { DEBUG_BREAK(); } BREAK_NULL(this->pBlock); #endif this->pBlock->headerSize = value; return true; } ERESULT block16_getLastError( BLOCK16_DATA *this ) { // Validate the input parameters. #ifdef NDEBUG #else if( !block16_Validate(this) ) { DEBUG_BREAK(); return this->eRc; } #endif return this->eRc; } //=============================================================== // M e t h o d s //=============================================================== //---------------------------------------------------------- // A d d D a t a //---------------------------------------------------------- bool block16_AddData( BLOCK16_DATA *this, uint16_t dataSize, void *pData ) { void *pBlockData; /* Validate the input parameters. */ #ifdef NDEBUG #else if( !block16_Validate(this) ) { DEBUG_BREAK(); return false; } if( dataSize > (this->pBlock->dataSize - this->pBlock->dataUsed) ) return false; #endif pBlockData = (uint8_t *)(this->pBlock) + block16_DataOffset(this); if (pBlockData == NULL) { return false; } memmove(pBlockData, pData, dataSize); this->pBlock->dataUsed += dataSize; // Return to caller. return true; } //--------------------------------------------------------------- // D e a l l o c //--------------------------------------------------------------- void block16_Dealloc( OBJ_ID objId ) { BLOCK16_DATA *this = objId; // Do initialization. if (NULL == this) { return; } #ifdef NDEBUG #else if( !block16_Validate(this) ) { DEBUG_BREAK(); return; } #endif if (this->pBlock) { mem_Free(this->pBlock); this->pBlock = NULL; } obj_setVtbl(this, this->pSuperVtbl); obj_Dealloc(this); this = NULL; // Return to caller. } //--------------------------------------------------------------- // D a t a P t r //--------------------------------------------------------------- void * block16_DataPtr( BLOCK16_DATA *this ) { void *pData = NULL; // Do initialization. #ifdef NDEBUG #else if( !block16_Validate(this) ) { DEBUG_BREAK(); return NULL; } BREAK_NULL(this->pBlock); #endif pData = (void *)&this->pBlock->header[this->pBlock->headerSize]; // Return to caller. return pData; } //--------------------------------------------------------------- // I n i t //--------------------------------------------------------------- BLOCK16_DATA * block16_Init( BLOCK16_DATA *this ) { uint32_t cbSize = sizeof(BLOCK16_DATA); if (OBJ_NIL == this) { return OBJ_NIL; } cbSize = obj_getSize(this); this = (BLOCK16_DATA *)obj_Init( this, cbSize, OBJ_IDENT_BLOCK32 ); if (OBJ_NIL == this) { DEBUG_BREAK(); //obj_Release(this); return OBJ_NIL; } //obj_setSize(this, cbSize); // Needed for Inheritance //obj_setIdent((OBJ_ID)this, OBJ_IDENT_BLOCK32); this->pSuperVtbl = obj_getVtbl(this); obj_setVtbl(this, (OBJ_IUNKNOWN *)&block16_Vtbl); #ifdef NDEBUG #else if( !block16_Validate( this ) ) { DEBUG_BREAK(); obj_Release(this); return OBJ_NIL; } BREAK_NOT_BOUNDARY4(&this->pBlock); #endif return this; } BLOCK16_DATA * block16_InitWithSizes( BLOCK16_DATA *this, uint16_t headerSize, uint16_t dataSize ) { uint32_t cbBlock; if (OBJ_NIL == this) { return OBJ_NIL; } if (0 == dataSize) { obj_Release(this); return OBJ_NIL; } this = block16_Init( this ); if (OBJ_NIL == this) { DEBUG_BREAK(); //obj_Release(this); return OBJ_NIL; } cbBlock = block16_CalcBlockSize(headerSize, dataSize); if (0 == cbBlock) { obj_Release(this); return OBJ_NIL; } this->pBlock = mem_Calloc(1, cbBlock); if (NULL == this->pBlock) { obj_Release(this); return OBJ_NIL; } this->pBlock->cbSize = cbBlock; this->pBlock->headerSize = ROUNDUP_WORD(headerSize); this->pBlock->dataSize = ROUNDUP_WORD(dataSize); return this; } //--------------------------------------------------------------- // T o S t r i n g //--------------------------------------------------------------- ASTR_DATA * block16_ToDebugString( BLOCK16_DATA *this, int indent ) { char str[256]; int j; ASTR_DATA *pStr; #ifdef XYZZY ASTR_DATA *pWrkStr; #endif if (OBJ_NIL == this) { return OBJ_NIL; } pStr = AStr_New(); if (indent) { AStr_AppendCharRepeatW32(pStr, indent, ' '); } str[0] = '\0'; j = snprintf( str, sizeof(str), "{%p(block16) ", this ); AStr_AppendA(pStr, str); #ifdef XYZZY if (this->pData) { if (((OBJ_DATA *)(this->pData))->pVtbl->pToDebugString) { pWrkStr = ((OBJ_DATA *)(this->pData))->pVtbl->pToDebugString( this->pData, indent+3 ); AStr_Append(pStr, pWrkStr); obj_Release(pWrkStr); } } #endif j = snprintf( str, sizeof(str), " (block16)%p}\n", this ); AStr_AppendA(pStr, str); return pStr; } //--------------------------------------------------------------- // V a l i d a t e //--------------------------------------------------------------- #ifdef NDEBUG #else bool block16_Validate( BLOCK16_DATA *this ) { if(this) { if ( obj_IsKindOf(this, OBJ_IDENT_BLOCK16) ) ; else return false; } else return false; this->eRc = ERESULT_INVALID_OBJECT; if( !(obj_getSize(this) >= sizeof(BLOCK16_DATA)) ) return false; // Return to caller. this->eRc = ERESULT_SUCCESS; return true; } #endif #ifdef __cplusplus } #endif
22.788012
79
0.425932
366f46e5b505649a4de5fac776cd5049422a31bc
546
sql
SQL
HackerRank/SQL-MSServer/HackerRank_SQL-MSServer_WeatherObservationStation20.sql
andrecontisilva/SQL-aprendizado
c1105bd7fbd01aa98ffae2abf71ffb3522bfc26f
[ "MIT" ]
null
null
null
HackerRank/SQL-MSServer/HackerRank_SQL-MSServer_WeatherObservationStation20.sql
andrecontisilva/SQL-aprendizado
c1105bd7fbd01aa98ffae2abf71ffb3522bfc26f
[ "MIT" ]
null
null
null
HackerRank/SQL-MSServer/HackerRank_SQL-MSServer_WeatherObservationStation20.sql
andrecontisilva/SQL-aprendizado
c1105bd7fbd01aa98ffae2abf71ffb3522bfc26f
[ "MIT" ]
null
null
null
/* Site: HackerRank Type: Practice Subdomain: Aggregation Difficulty: Medium Skill: SQL (MS Server) Problem: Weather Observation Station 20 URL: https://www.hackerrank.com/challenges/weather-observation-station-20/problem */ -- SOLUTION: SELECT DISTINCT CAST( ROUND( PERCENTILE_DISC (.5) WITHIN GROUP (ORDER BY lat_n) OVER() , 4) AS DECIMAL(10,4)) FROM station; /* NOTE: More about the PERCENTILE_DISC function: https://docs.microsoft.com/pt-br/sql/t-sql/functions/percentile-disc-transact-sql?view=sql-server-ver15 */
20.222222
103
0.734432
38d37518d2226690f6292f29236603106a0d7543
980
php
PHP
test/fixture/Instrumentation/Instrumentor/coroutine-anonymous-class.output.php
langabi/dev
3e35167da0bace1653625795dd8eb97e40552012
[ "MIT" ]
4
2016-07-27T01:27:48.000Z
2021-09-20T06:55:33.000Z
test/fixture/Instrumentation/Instrumentor/coroutine-anonymous-class.output.php
langabi/dev
3e35167da0bace1653625795dd8eb97e40552012
[ "MIT" ]
17
2016-03-20T05:56:01.000Z
2022-03-06T02:55:45.000Z
test/fixture/Instrumentation/Instrumentor/coroutine-anonymous-class.output.php
langabi/dev
3e35167da0bace1653625795dd8eb97e40552012
[ "MIT" ]
1
2021-09-20T06:57:08.000Z
2021-09-20T06:57:08.000Z
<?php /** * This case verifies that methods on anonymous classes are instrumented. */ use Generator as Coroutine; new class() { public static function staticMethod() : Coroutine { assert((($μ = \class_exists(\Recoil\Dev\Instrumentation\Trace::class) ? yield \Recoil\Dev\Instrumentation\Trace::install() : null) && $μ->setCoroutine(__FILE__, __CLASS__, __FUNCTION__, '::', \func_get_args())) || true); (!assert(($μ && $μ->setLine(__LINE__)) || true) ?: yield 1); (!assert(($μ && $μ->setLine(__LINE__)) || true) ?: yield 2); } public function instanceMethod() : Coroutine { assert((($μ = \class_exists(\Recoil\Dev\Instrumentation\Trace::class) ? yield \Recoil\Dev\Instrumentation\Trace::install() : null) && $μ->setCoroutine(__FILE__, __CLASS__, __FUNCTION__, '->', \func_get_args())) || true); (!assert(($μ && $μ->setLine(__LINE__)) || true) ?: yield 1); (!assert(($μ && $μ->setLine(__LINE__)) || true) ?: yield 2); } };
46.666667
289
0.630612
444d7c3cba1b155d0280f2a43b807226f30d004e
1,991
py
Python
nums/core/settings.py
kssteven418/nums-1
d5cedbd1e2bc72b2130056a702f2a2c9dfc1a823
[ "MIT" ]
null
null
null
nums/core/settings.py
kssteven418/nums-1
d5cedbd1e2bc72b2130056a702f2a2c9dfc1a823
[ "MIT" ]
null
null
null
nums/core/settings.py
kssteven418/nums-1
d5cedbd1e2bc72b2130056a702f2a2c9dfc1a823
[ "MIT" ]
null
null
null
# coding=utf-8 # Copyright (C) 2020 NumS Development Team. # # 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. import os from pathlib import Path import multiprocessing pj = lambda *paths: os.path.abspath(os.path.expanduser(os.path.join(*paths))) # System settings. system_name = os.environ.get("NUMS_SYSTEM", "ray-cyclic") use_head = True cluster_shape = (1, 1) ray_init_default = { "num_cpus": multiprocessing.cpu_count() } # Compute settings. compute_name = os.environ.get("NUMS_COMPUTE", "numpy") # Filesystem settings. fs_root = pj("~", ".nums", "fs") Path(fs_root).mkdir(parents=True, exist_ok=True) fs_meta = pj(fs_root, "meta") Path(fs_meta).mkdir(parents=True, exist_ok=True) fs_data = pj(fs_root, "data") Path(fs_data).mkdir(parents=True, exist_ok=True) # Default block shapes for arrays with up to 2 axes. # Block shapes can grow to approximately 1 gigabytes in size. # Beyond 2 axes, block shape is a required parameter. default_block_shape = (2**18, 2**9)
34.327586
77
0.757408
e27408753efc83d2298bc68aebd9a02afa8b5e9a
796
py
Python
linear-regression.py
Kaggia/ai_exercises
700758ed43612663d4f63c39c91b347767a9c689
[ "Apache-2.0" ]
null
null
null
linear-regression.py
Kaggia/ai_exercises
700758ed43612663d4f63c39c91b347767a9c689
[ "Apache-2.0" ]
null
null
null
linear-regression.py
Kaggia/ai_exercises
700758ed43612663d4f63c39c91b347767a9c689
[ "Apache-2.0" ]
null
null
null
import matplotlib.pyplot as plt import numpy as np import pandas as pd from sklearn.linear_model import LinearRegression from warnings import filterwarnings #Loading a simple Dataframe df = pd.DataFrame( { 'stud' : [1, 2, 3, 4, 5, 6, 4, 1, 2, 1, 3], 'red' : [12000, 23000, 35000, 47000, 55000, 67000, 43000, 15000, 25000, 15000, 31500] } ) print(df) #Load data on a simple chart plt.plot(df['stud'], df['red'], "ro") #Loading data on matrix mat = np.matrix(df) x = mat[:, 0] y = mat[:, 1] #Loading Linear Regression Obj and fitting the data lr = LinearRegression() lr.fit(x, y) print(lr.intercept_) print(lr.coef_) #Prediction print(lr.predict([[4]])) plt.plot(4, lr.predict([[4]]), "s") plt.legend(['Training data', 'Predicted']) plt.show()
26.533333
94
0.644472
830d40ee61b55ca4466a70e19550400fc4944488
1,005
ts
TypeScript
src/service.ts
isfe-team/rx-cache
4b559ab8b4864ada5d48d1a247ce55735e5b741b
[ "MIT" ]
1
2018-11-27T09:17:01.000Z
2018-11-27T09:17:01.000Z
src/service.ts
isfe-team/rx-cache
4b559ab8b4864ada5d48d1a247ce55735e5b741b
[ "MIT" ]
null
null
null
src/service.ts
isfe-team/rx-cache
4b559ab8b4864ada5d48d1a247ce55735e5b741b
[ "MIT" ]
null
null
null
/*! * a simple service use cache * @bqliu */ // import axios from 'axios'; import { from } from 'rxjs'; import { AsyncCache } from './cache'; type User = { id: number; name: string; } enum ResponseStatus { OK = 0, ERROR = 1 } interface IResponse<T> { status: ResponseStatus; message: string; data: T; } type IUserResponse = IResponse<Array<User>> const userRes: IUserResponse = { status: ResponseStatus.OK, message: '', data: [ { id: 0, name: 'A' }, { id: 1, name: 'B' } ] }; const getUsersApi = (() => { let cnt = 0; return (...args: any[]) => { console.log('args', args); cnt += 1; if (cnt % 3 === 0) { return Promise.resolve(userRes); } return Promise.reject({ status: ResponseStatus.ERROR, message: 'error' }); } })(); export const user = { getUserCache(...args: any[]) { return new AsyncCache({ retryCount: 2, replayCount: 2, observableGenerator: () => from(getUsersApi.apply(null, args)) }); } }
17.327586
78
0.577114
dda5cb5c1060f9e7b5c62aa1dee14dd6f0919f7a
5,606
java
Java
agp/src/main/java/agp/ajax/AjaxPortlet.java
atziallas/ajax-generic-portlet
8f859e601cd0978e8b534470baa37013549052d4
[ "MIT" ]
null
null
null
agp/src/main/java/agp/ajax/AjaxPortlet.java
atziallas/ajax-generic-portlet
8f859e601cd0978e8b534470baa37013549052d4
[ "MIT" ]
null
null
null
agp/src/main/java/agp/ajax/AjaxPortlet.java
atziallas/ajax-generic-portlet
8f859e601cd0978e8b534470baa37013549052d4
[ "MIT" ]
null
null
null
package agp.ajax; import static agp.ajax.AjaxHandler.CONTENT_TYPE_HTML; import static agp.ajax.AjaxHandler.CONTENT_TYPE_JSON; import static agp.ajax.AjaxHandler.FILENAME; import static agp.ajax.AjaxHandler.FILE_PARAMETER; import static agp.ajax.AjaxHandler.PENDING; import static agp.ajax.AjaxHandler.PENDING_FILE; import java.io.IOException; import java.io.OutputStream; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; import javax.portlet.GenericPortlet; import javax.portlet.PortletException; import javax.portlet.PortletRequestDispatcher; import javax.portlet.PortletURL; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import javax.portlet.ResourceRequest; import javax.portlet.ResourceResponse; import javax.portlet.ResourceURL; import javax.servlet.http.HttpServletRequest; import org.apache.commons.io.IOUtils; public class AjaxPortlet extends GenericPortlet { AjaxHandler handler; @Override public void init() { String handlerClass = getPortletConfig().getInitParameter("handler-class"); Class<?> clazz; try { clazz = Class.forName(handlerClass); handler = (AjaxHandler) clazz.newInstance(); } catch (ClassNotFoundException | IllegalAccessException | InstantiationException e) { throw new RuntimeException("Incorrect parameter handler-class in portlet.xml"); } } // Renders a page. Passes a resourceUrl to the jsp, // which the frontend framework will call to get data // Also generates a CSRF token per page, draws it on the page // and stores it to the session public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { String page = request.getParameter("page"); if (page == null) // if this is the initial render page = handler.getDefaultPage(); // create a csrf token and store it to the session GenericSession session = new GenericSession(request.getPortletSession()); String csrfToken = CsrfUtils.registerCSRFToken(session, page); // create the resource url for AJAX calls ResourceURL url = response.createResourceURL(); url.setParameter("page", page); // pass these parameters to the jsp file request.setAttribute("ajaxUrl", url); request.setAttribute("csrfToken", csrfToken); // get the jsp to render PortletRequestDispatcher rd = this.getPortletContext().getRequestDispatcher("/" + page + ".jsp"); response.setContentType(CONTENT_TYPE_HTML); rd.include(request, response); } // Responds only with JSON. Redirect to another page is possible by creating and // sending a url to javascript. public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException, IOException { GenericSession session = new GenericSession(request.getPortletSession()); if (PENDING.equals(request.getParameter(FILE_PARAMETER))) { fileResponse(response, session); } else { jsonResponse(request, response, session); } } private void jsonResponse(ResourceRequest request, ResourceResponse response, GenericSession session) throws IOException, UnsupportedEncodingException { String payload = IOUtils.toString(request.getReader()); HttpServletRequest httpRequest = (HttpServletRequest) request.getAttribute("httpRequest"); String csrfToken = httpRequest.getHeader("csrf-token"); String page = request.getParameter("page"); CsrfUtils.validateCSRFToken(page, csrfToken, session); GenericResponse handlerResponse = handler.handleAjaxRequest(payload, page, session); checkForRedirectResponse(handlerResponse, response); checkForFileResponse(handlerResponse, response, session); response.setContentType(CONTENT_TYPE_JSON); PrintWriter writer = response.getWriter(); writer.write(handlerResponse.getResponse()); } // this means previous response created a resource URL and stored a file in the // session. private void fileResponse(ResourceResponse response, GenericSession session) throws IOException { byte[] file = (byte[]) session.getAttribute(PENDING_FILE); OutputStream os = response.getPortletOutputStream(); os.write(file); response.setProperty("Content-Disposition", "attachment; filename=" + session.getAttribute(FILENAME)); os.close(); session.removeAttribute(FILENAME); session.removeAttribute(PENDING_FILE); } private void checkForFileResponse(GenericResponse handlerResponse, ResourceResponse response, GenericSession session) { if (ResponseType.FILE.equals(handlerResponse.getResponseType())) { // create a resource for this file and store it in the session ResourceURL url = response.createResourceURL(); url.setParameter(FILE_PARAMETER, PENDING); session.setAttribute(PENDING_FILE, handlerResponse.getFile()); session.setAttribute(FILENAME, handlerResponse.getResponse()); AjaxHandler.convertResponseToRedirect(handlerResponse, url.toString()); } } private void checkForRedirectResponse(GenericResponse handlerResponse, ResourceResponse response) { // If the response demands a redirect to another page create a render url and // append it to the JSON // The redirect will be performed in javascript with window.location if (ResponseType.REDIRECT.equals(handlerResponse.getResponseType())) { PortletURL url = response.createRenderURL(); // the page parameter defines which jsp will be loaded on doView method url.setParameter("page", handlerResponse.getResponse()); AjaxHandler.convertResponseToRedirect(handlerResponse, url.toString()); } } }
41.220588
118
0.765787
e0a3453d44aecb01d39e2fe4ad864740ee640dc3
395
h
C
src/parsers.h
ihh/acidbot
4af653f38821f621a2cdf141dc27dc8d62841667
[ "BSD-3-Clause" ]
32
2018-11-30T00:09:52.000Z
2022-02-02T10:16:48.000Z
src/parsers.h
evoldoers/bossmachine
4af653f38821f621a2cdf141dc27dc8d62841667
[ "BSD-3-Clause" ]
58
2018-07-20T17:19:04.000Z
2018-10-19T16:52:06.000Z
src/parsers.h
evoldoers/bossmachine
4af653f38821f621a2cdf141dc27dc8d62841667
[ "BSD-3-Clause" ]
5
2018-12-05T01:39:50.000Z
2021-04-13T05:24:48.000Z
#ifndef PARSERS_INCLUDED #define PARSERS_INCLUDED #include "machine.h" namespace MachineBoss { struct RegexParser { string nonwhite, white; RegexParser(); string alphabet() const; Machine parse (const string&) const; static vguard<InputSymbol> stringToSymbols (const string&); }; WeightExpr parseWeightExpr (const string&); } // end namespace #endif /* PARSEREGEX_INCLUDED */
17.173913
61
0.744304
20d6f93b02459ef1e63c614551280cb6c3635f08
1,222
py
Python
testing/MLDB-694_external_python_procedure.py
kstepanmpmg/mldb
f78791cd34d01796705c0f173a14359ec1b2e021
[ "Apache-2.0" ]
665
2015-12-09T17:00:14.000Z
2022-03-25T07:46:46.000Z
testing/MLDB-694_external_python_procedure.py
tomzhang/mldb
a09cf2d9ca454d1966b9e49ae69f2fe6bf571494
[ "Apache-2.0" ]
797
2015-12-09T19:48:19.000Z
2022-03-07T02:19:47.000Z
testing/MLDB-694_external_python_procedure.py
matebestek/mldb
f78791cd34d01796705c0f173a14359ec1b2e021
[ "Apache-2.0" ]
103
2015-12-25T04:39:29.000Z
2022-02-03T02:55:22.000Z
# # MLDB-694_external_python_procedure.py # mldb.ai inc, 2015 # this file is part of mldb. copyright 2015 mldb.ai inc. all rights reserved. # from mldb import mldb conf = { "type": "experimental.external.procedure", "params": { "stdInData": "pwet", "scriptConfig": { "source": """ import sys import select import json std_in = "" # If there's input ready, do something, else do something # else. Note timeout is zero so select won't block at all. # https://repolinux.wordpress.com/2012/10/09/non-blocking-read-from-stdin-in-python/ while sys.stdin in select.select([sys.stdin], [], [], 0)[0]: line = sys.stdin.readline() if line: std_in += line else: # an empty line means stdin has been closed break def fib(n): a,b = 1,1 for i in range(n-1): a,b = b,a+b return a print(json.dumps({"bouya": 5, "stdin_data": std_in})) """ } } } rez = mldb.put("/v1/procedures/externalProc", conf) mldb.log(rez.text) rez = mldb.put("/v1/procedures/externalProc/runs/1") mldb.log(rez.text) js_resp = rez.json() mldb.log(js_resp) assert js_resp["status"]["return"] == {"bouya": 5, "stdin_data" : "pwet"} request.set_return("success")
22.218182
84
0.63748
749e94731b4af45f6192c5010491f95b3f700e4e
2,390
css
CSS
docs/static/css/main.b213f410.chunk.css
Adalab/f-online-life-calendar-carmen-tm
02905aba61f67b9d054c0be05b0d1e206814cb8b
[ "MIT" ]
null
null
null
docs/static/css/main.b213f410.chunk.css
Adalab/f-online-life-calendar-carmen-tm
02905aba61f67b9d054c0be05b0d1e206814cb8b
[ "MIT" ]
7
2019-06-29T14:09:20.000Z
2021-01-31T09:31:48.000Z
docs/static/css/main.b213f410.chunk.css
carmen-tm/f-online-life-calendar-carmen-tm
02905aba61f67b9d054c0be05b0d1e206814cb8b
[ "MIT" ]
1
2019-07-04T08:02:11.000Z
2019-07-04T08:02:11.000Z
.btn--save{background-color:#d91855;width:100%;font-size:20px;padding:5px;cursor:pointer;color:#fff;border-radius:5px;text-transform:uppercase;opacity:.8;-webkit-transition:all .3s ease-in;transition:all .3s ease-in}.btn--save:hover{opacity:1}.btn--cancel{background-color:transparent;width:100%;font-size:20px;padding:5px;cursor:pointer;color:#b3b3b3;-webkit-transition:all .3s ease-in;transition:all .3s ease-in}.btn--cancel:hover{color:#d91855}.btn--newRecord{background-color:#fff;width:100%;margin-bottom:30px;font-size:40px;cursor:pointer;opacity:.7;-webkit-transition:all .3s ease-in;transition:all .3s ease-in}.btn--newRecord:hover{opacity:1}.mood-item{margin:5px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;cursor:pointer}.mood-item__message{background-color:#fff;border-radius:10px;width:100px;margin:20px auto;padding:5px;text-align:center;position:relative;color:#d91855}.mood-item__message:after{content:"";width:0;height:0;position:absolute;border:10px solid transparent;border-top-color:#fff;right:40%;bottom:-18px}.mood-item__image{width:50px}.mood-item__date{color:#b3b3b3;font-size:14px}.calendar__wrapper{margin:30px 70px 0}@media (min-width:1280px){.calendar__wrapper{margin:50px 250px}}.mood-list{display:flex;flex-wrap:wrap;justify-content:center}.page__title{font-size:12px;margin-bottom:5px}.date{width:100%;height:30px;padding-left:5px;margin-top:10px;margin-bottom:20px}.mood-input{display:flex;align-items:center;margin-top:10px}.mood-input__image{width:50px}.mood-input__label{color:#d91855;padding-right:10px}.bubble-container{position:relative}.bubble-container:before{content:"";width:0;height:0;position:absolute;border:10px solid transparent;border-bottom-color:#fff;right:50%;bottom:126px}.message{width:100%;height:100px;margin-top:10px;margin-bottom:20px;background-color:#fff;border-radius:10px;position:relative;padding:20px;color:#d91855}.form{border:none}.form__legend{display:block;color:#b3b3b3;margin-top:20px}.form__fieldset,.form__item{border:inherit}.edition__wrapper{margin:30px 70px 0}@media (min-width:1280px){.edition__wrapper{margin:50px 250px}}*{margin:0;padding:0;box-sizing:border-box}body{font-family:Spectral,serif;font-size:16px;line-height:1.4;min-height:100vh;color:#000;background-color:#e7e7e7}ol,ul{list-style:none}button{border:0;padding:0} /*# sourceMappingURL=main.b213f410.chunk.css.map */
1,195
2,338
0.809205
dbc3f88f60261aca23e6003bb4c662c1c1525a54
5,160
php
PHP
vendor/s9e/text-formatter/src/Configurator/Helpers/TemplateLoader.php
poliana11/forum_pensando_no_futuro
87a315b5d18f95e1ca992ac8114003347c6071f1
[ "MIT" ]
11
2015-11-03T10:06:57.000Z
2022-03-13T11:19:53.000Z
vendor/s9e/text-formatter/src/Configurator/Helpers/TemplateLoader.php
acardosodev/acardoso.dev
e4ce0df0a01ca7ef69b0dca67542e2d75b72cd47
[ "MIT" ]
53
2015-02-23T20:49:29.000Z
2021-05-07T19:38:06.000Z
vendor/s9e/text-formatter/src/Configurator/Helpers/TemplateLoader.php
acardosodev/acardoso.dev
e4ce0df0a01ca7ef69b0dca67542e2d75b72cd47
[ "MIT" ]
6
2016-09-22T06:17:17.000Z
2020-03-16T13:48:02.000Z
<?php /** * @package s9e\TextFormatter * @copyright Copyright (c) 2010-2020 The s9e authors * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ namespace s9e\TextFormatter\Configurator\Helpers; use DOMDocument; use DOMElement; use DOMXPath; use RuntimeException; abstract class TemplateLoader { /** * XSL namespace */ const XMLNS_XSL = 'http://www.w3.org/1999/XSL/Transform'; /** * Get the XML content of an element * * @private * * @param DOMElement $element * @return string */ public static function innerXML(DOMElement $element) { // Serialize the XML then remove the outer element $xml = $element->ownerDocument->saveXML($element); $pos = 1 + strpos($xml, '>'); $len = strrpos($xml, '<') - $pos; // If the template is empty, return an empty string return ($len < 1) ? '' : substr($xml, $pos, $len); } /** * Load a template as an xsl:template node * * Will attempt to load it as XML first, then as HTML as a fallback. Either way, an xsl:template * node is returned * * @param string $template * @return DOMDocument */ public static function load($template) { $dom = self::loadAsXML($template) ?: self::loadAsXML(self::fixEntities($template)); if ($dom) { return $dom; } // If the template contains an XSL element, abort now. Otherwise, try reparsing it as HTML if (strpos($template, '<xsl:') !== false) { $error = libxml_get_last_error(); throw new RuntimeException('Invalid XSL: ' . $error->message); } return self::loadAsHTML($template); } /** * Serialize a loaded template back into a string * * NOTE: removes the root node created by load() * * @param DOMDocument $dom * @return string */ public static function save(DOMDocument $dom) { $xml = self::innerXML($dom->documentElement); if (strpos($xml, 'xmlns:xsl') !== false) { $xml = preg_replace('((<[^>]+?) xmlns:xsl="' . self::XMLNS_XSL . '")', '$1', $xml); } return $xml; } /** * Replace HTML entities and unescaped ampersands in given template * * @param string $template * @return string */ protected static function fixEntities($template) { $template = self::replaceEntities($template); $template = preg_replace('(&(?!quot;|amp;|apos;|lt;|gt;|#\\d+;|#x[A-Fa-f0-9]+;))', '&amp;', $template); return $template; } /** * Load given HTML template in a DOM document * * @param string $template Original template * @return DOMDocument */ protected static function loadAsHTML($template) { $template = self::replaceCDATA($template); $template = self::replaceEntities($template); $dom = new DOMDocument; $html = '<?xml version="1.0" encoding="utf-8" ?><html><body><div>' . $template . '</div></body></html>'; $useErrors = libxml_use_internal_errors(true); $dom->loadHTML($html, LIBXML_NSCLEAN); self::removeInvalidAttributes($dom); libxml_use_internal_errors($useErrors); // Now dump the thing as XML then reload it with the proper root element $xml = '<?xml version="1.0" encoding="utf-8" ?><xsl:template xmlns:xsl="' . self::XMLNS_XSL . '">' . self::innerXML($dom->documentElement->firstChild->firstChild) . '</xsl:template>'; $useErrors = libxml_use_internal_errors(true); $dom->loadXML($xml, LIBXML_NSCLEAN); libxml_use_internal_errors($useErrors); return $dom; } /** * Load given XSL template in a DOM document * * @param string $template Original template * @return bool|DOMDocument DOMDocument on success, FALSE otherwise */ protected static function loadAsXML($template) { $xml = '<?xml version="1.0" encoding="utf-8" ?><xsl:template xmlns:xsl="' . self::XMLNS_XSL . '">' . $template . '</xsl:template>'; $useErrors = libxml_use_internal_errors(true); $dom = new DOMDocument; $success = $dom->loadXML($xml, LIBXML_NOCDATA | LIBXML_NSCLEAN); self::removeInvalidAttributes($dom); libxml_use_internal_errors($useErrors); return ($success) ? $dom : false; } /** * Remove attributes with an invalid name from given DOM document * * @param DOMDocument $dom * @return void */ protected static function removeInvalidAttributes(DOMDocument $dom) { $xpath = new DOMXPath($dom); foreach ($xpath->query('//@*') as $attribute) { if (!preg_match('(^(?:[-\\w]+:)?(?!\\d)[-\\w]+$)D', $attribute->nodeName)) { $attribute->parentNode->removeAttributeNode($attribute); } } } /** * Replace CDATA sections in given template * * @param string $template Original template * @return string Modified template */ protected static function replaceCDATA($template) { return preg_replace_callback( '(<!\\[CDATA\\[(.*?)\\]\\]>)', function ($m) { return htmlspecialchars($m[1]); }, $template ); } /** * Replace known HTML entities * * @param string $template * @return string */ protected static function replaceEntities(string $template): string { return preg_replace_callback( '(&(?!quot;|amp;|apos;|lt;|gt;)\\w+;)', function ($m) { return html_entity_decode($m[0], ENT_HTML5 | ENT_NOQUOTES, 'UTF-8'); }, str_replace('&AMP;', '&amp;', $template) ); } }
25.418719
185
0.653488
e2f9639673bc2126d3e57732443e6e667801bf96
3,178
py
Python
envconfig/utils.py
ely-as/django-envconf
1fb16ca8c7dd41d6d84a82561c5bf50f1c5efbb6
[ "MIT" ]
null
null
null
envconfig/utils.py
ely-as/django-envconf
1fb16ca8c7dd41d6d84a82561c5bf50f1c5efbb6
[ "MIT" ]
null
null
null
envconfig/utils.py
ely-as/django-envconf
1fb16ca8c7dd41d6d84a82561c5bf50f1c5efbb6
[ "MIT" ]
null
null
null
from importlib import import_module from importlib.machinery import SourceFileLoader from importlib.util import spec_from_loader, module_from_spec from pathlib import Path from types import ModuleType from typing import List, Optional, Union import django from django.core.management.utils import get_random_secret_key # Relative path to settings.py template from django package root dir RELPATH_TO_SETTINGS_TPL = 'conf/project_template/project_name/settings.py-tpl' def find_project_name(path: Path) -> Optional[str]: search = list(set( p.parent.name for p in path.glob('*/[a|w]sgi.py') if p.parent.is_dir() )) return search[0] if len(search) == 1 else None def get_base_dir(project_name: str) -> Path: return Path(import_module(project_name).__file__).parent.parent.absolute() def get_module_settings(project_name: str) -> dict: try: mod = import_module(f'{project_name}.settings') setting_names = [s for s in dir(mod) if s.isupper()] return {s: getattr(mod, s) for s in setting_names} except ModuleNotFoundError: return {} def get_path_to_settings_template() -> Path: return Path(django.__file__).parent / RELPATH_TO_SETTINGS_TPL def get_template_settings(project_name: str) -> dict: template_settings = import_module_from_file( get_path_to_settings_template() ) setting_names = [s for s in dir(template_settings) if s.isupper()] settings = {} for s in setting_names: val = getattr(template_settings, s) if isinstance(val, str) and '{{ project_name }}' in val: val = val.replace('{{ project_name }}', project_name) settings[s] = val # Find the correct BASE_DIR base_dir = get_base_dir(project_name) # Modify the DATABASES setting for correct BASE_DIR db_name = settings['DATABASES']['default']['NAME'] if not isinstance(db_name, Path): db_name = Path(db_name) db_name = base_dir / db_name.name # Overwite some of the defaults if isinstance(settings['BASE_DIR'], str): settings['BASE_DIR'] = str(base_dir.resolve()) settings['DATABASES']['default']['NAME'] = str(db_name.resolve()) else: settings['BASE_DIR'] = base_dir settings['DATABASES']['default']['NAME'] = db_name settings['DEBUG'] = False # Ensure DEBUG defaults to False settings['SECRET_KEY'] = get_random_secret_key() return settings def import_module_from_file(path: Union[Path, str]) -> ModuleType: """Import a Python module based on file path rather than a dotted name. """ if isinstance(path, str): path = Path(path) name = path.name.split('.')[0] spec = spec_from_loader(name, SourceFileLoader(name, str(path.resolve()))) mod = module_from_spec(spec) # type: ignore # noqa spec.loader.exec_module(mod) # type: ignore # noqa return mod def modify_list( list_: List[str], add: List[str], remove: List[str] ) -> List[str]: """Add and remove items from a list. Preserve order and prevent duplication. """ return ([a for a in list_ if a not in remove] + [a for a in add if a not in list_])
34.923077
78
0.684393
b7166d6d7e36b09b99ed8fd2d7f83db848224ff1
6,089
cs
C#
src/Gsemac.Net.Curl/CurlCmdArgumentsBuilder.cs
gsemac/Gsemac.Common
a9f0ac5769708862d44d693938aaf68da3731e90
[ "MIT" ]
7
2021-01-12T07:05:08.000Z
2021-12-24T06:59:44.000Z
src/Gsemac.Net.Curl/CurlCmdArgumentsBuilder.cs
gsemac/Gsemac.Common
a9f0ac5769708862d44d693938aaf68da3731e90
[ "MIT" ]
8
2021-07-09T06:14:37.000Z
2022-03-10T01:54:26.000Z
src/Gsemac.Net.Curl/CurlCmdArgumentsBuilder.cs
gsemac/Gsemac.Common
a9f0ac5769708862d44d693938aaf68da3731e90
[ "MIT" ]
2
2021-01-12T07:05:39.000Z
2021-07-29T20:33:12.000Z
using Gsemac.Core; using Gsemac.Net.Extensions; using System; using System.Collections.Generic; using System.Globalization; using System.Net; using System.Threading; namespace Gsemac.Net.Curl { public class CurlCmdArgumentsBuilder : CmdArgumentsBuilderBase<CurlCmdArgumentsBuilder> { // Public members public CurlCmdArgumentsBuilder WithAutomaticDecompression(DecompressionMethods decompressionMethods) { if (decompressionMethods != DecompressionMethods.None) { WithArgument("--compressed"); List<string> headerValues = new List<string>(); if (decompressionMethods.HasFlag(DecompressionMethods.GZip)) headerValues.Add("gzip"); if (decompressionMethods.HasFlag(DecompressionMethods.Deflate)) headerValues.Add("deflate"); string headerValue = string.Join(",", headerValues); if (!string.IsNullOrEmpty(headerValue)) WithArgument("--header", $"Accept-Encoding: {headerValue}"); } return this; } public CurlCmdArgumentsBuilder WithAutomaticRedirect(int maxRedirections) { if (maxRedirections > 0) { WithArgument("--location"); WithArgument("--max-redirs", maxRedirections.ToString(CultureInfo.InvariantCulture)); } return this; } public CurlCmdArgumentsBuilder WithCertificateValidation(bool certificateValidationEnabled) { if (!certificateValidationEnabled) WithArgument("--insecure"); return this; } public CurlCmdArgumentsBuilder WithCookies(CookieContainer cookieContainer, Uri requestUri = null) { if (requestUri is null) requestUri = uri; if (!(cookieContainer is null)) { List<string> cookieStrings = new List<string>(); foreach (Cookie cookie in cookieContainer.GetCookies(requestUri)) cookieStrings.Add(cookie.ToString()); if (cookieStrings.Count > 0) WithArgument("--cookie", string.Join(";", cookieStrings)); } return this; } public CurlCmdArgumentsBuilder WithConnectTimeout(int timeoutSeconds) { if (timeoutSeconds != Timeout.Infinite) WithArgument("--connect-timeout", (timeoutSeconds / 1000.0).ToString(CultureInfo.InvariantCulture)); return this; } public CurlCmdArgumentsBuilder WithConsoleOutput() => WithArgument("--output", "-"); // output binary data directly to standard output public CurlCmdArgumentsBuilder WithCredentials(ICredentials credentials, Uri requestUri = null) { // Argument should be of the following form: // -u username:password if (requestUri is null) requestUri = uri; if (!(credentials is null)) WithArgument("-u", credentials.ToCredentialsString(requestUri)); return this; } public CurlCmdArgumentsBuilder WithHeaderOutput() => WithArgument("--include"); // include response headers in output public CurlCmdArgumentsBuilder WithHeaders(WebHeaderCollection headers) { for (int i = 0; i < headers.Count; ++i) { string header = headers.GetKey(i); foreach (string value in headers.GetValues(i)) WithArgument("--header", $"{header}: {headers[header]}"); } return this; } public CurlCmdArgumentsBuilder WithHttpVersion(System.Version version) { if (version != null) { if (version.Major > 1) WithArgument(string.Format("--http{0}", version.Major)); else WithArgument(string.Format("--http{0}.{1}", version.Major, version.Minor)); } return this; } public CurlCmdArgumentsBuilder WithKeepAlive(bool keepAlive) { if (!keepAlive) WithArgument("--no-keepalive"); return this; } public CurlCmdArgumentsBuilder WithMethod(string method) { if (string.IsNullOrWhiteSpace(method)) method = "GET"; switch (method.ToLowerInvariant()) { case "get": // no action required break; case "head": // make HEAD request + redirect stderr to stdout so we can read it via the ProcessStream WithArgument("--head"); WithArgument("--stderr", "-"); break; case "post": WithArgument("-X", "POST"); break; case "put": WithArgument("-X", "PUT"); break; default: WithArgument("-X", method); break; } return this; } public CurlCmdArgumentsBuilder WithPostData(string postData) { if (!string.IsNullOrWhiteSpace(postData)) WithArgument("--data", postData); return this; } public CurlCmdArgumentsBuilder WithProxy(IWebProxy proxy, Uri requestUri = null) { // Argument should be of the following form: // -x, --proxy <[protocol://][user:password@]proxyhost[:port]> if (requestUri is null) requestUri = uri; if (!(proxy is null) && !proxy.IsBypassed(requestUri)) WithArgument("--proxy", proxy.ToProxyString(requestUri)); return this; } public CurlCmdArgumentsBuilder WithUri(Uri uri) { this.uri = uri; WithArgument(uri.AbsoluteUri); return this; } // Private members private Uri uri = new Uri("http://example.com"); } }
28.721698
142
0.559698
1a7165c4f20b79806e3ba2bc8339193d556ff7fb
3,841
py
Python
src/osim/http/client.py
hashhar/major-project
bb2ba80d8a5a38f26f67a2661d21fc5a1d90ce69
[ "MIT" ]
4
2019-01-02T05:57:47.000Z
2020-12-29T19:28:23.000Z
src/osim/http/client.py
hashhar/major-project
bb2ba80d8a5a38f26f67a2661d21fc5a1d90ce69
[ "MIT" ]
null
null
null
src/osim/http/client.py
hashhar/major-project
bb2ba80d8a5a38f26f67a2661d21fc5a1d90ce69
[ "MIT" ]
1
2021-01-05T17:06:05.000Z
2021-01-05T17:06:05.000Z
# ADAPTED FROM https://github.com/openai/gym-http-api import requests import six.moves.urllib.parse as urlparse import json import os import logging logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) class Client(object): """ Gym client to interface with gym_http_server """ def __init__(self, remote_base): self.remote_base = remote_base self.session = requests.Session() self.session.headers.update({'Content-type': 'application/json'}) self.instance_id = None def _parse_server_error_or_raise_for_status(self, resp): j = {} try: j = resp.json() except: # Most likely json parse failed because of network error, not server error (server # sends its errors in json). Don't let parse exception go up, but rather raise default # error. resp.raise_for_status() if resp.status_code != 200 and "message" in j: # descriptive message from server side raise ServerError(message=j["message"], status_code=resp.status_code) resp.raise_for_status() return j def _post_request(self, route, data): url = urlparse.urljoin(self.remote_base, route) logger.info("POST {}\n{}".format(url, json.dumps(data))) resp = self.session.post(urlparse.urljoin(self.remote_base, route), data=json.dumps(data)) return self._parse_server_error_or_raise_for_status(resp) def _get_request(self, route): url = urlparse.urljoin(self.remote_base, route) logger.info("GET {}".format(url)) resp = self.session.get(url) return self._parse_server_error_or_raise_for_status(resp) def env_create(self, token): env_id = "Gait" route = '/v1/envs/' data = {'env_id': env_id, 'token': token} resp = self._post_request(route, data) self.instance_id = resp['instance_id'] self.env_monitor_start("tmp", force=True) return self.env_reset() def env_reset(self): route = '/v1/envs/{}/reset/'.format(self.instance_id) resp = self._post_request(route, None) observation = resp['observation'] return observation def env_step(self, action, render=False): route = '/v1/envs/{}/step/'.format(self.instance_id) data = {'action': action, 'render': render} resp = self._post_request(route, data) observation = resp['observation'] reward = resp['reward'] done = resp['done'] info = resp['info'] return [observation, reward, done, info] def env_monitor_start(self, directory, force=False, resume=False, video_callable=False): route = '/v1/envs/{}/monitor/start/'.format(self.instance_id) data = {'directory': directory, 'force': force, 'resume': resume, 'video_callable': video_callable} self._post_request(route, data) def submit(self): route = '/v1/envs/{}/monitor/close/'.format(self.instance_id) result = self._post_request(route, None) if result['reward']: print("Your total reward from this submission: %f" % result['reward']) else: print("There was an error in your submission. Please contact administrators.") route = '/v1/envs/{}/close/'.format(self.instance_id) self.env_close() def env_close(self): route = '/v1/envs/{}/close/'.format(self.instance_id) self._post_request(route, None) class ServerError(Exception): def __init__(self, message, status_code=None): Exception.__init__(self) self.message = message if status_code is not None: self.status_code = status_code
37.291262
98
0.620672
14f4fe80b72a2ab6647e61679315ecf1d3fd8c1a
714
tsx
TypeScript
CommitPoolApp/components/layout-container/layout-container.component.tsx
alexkeating/CommitPool-monorepo
f89ad0c5319148ce374de34d13315c0f2d611271
[ "MIT" ]
3
2021-08-31T23:30:10.000Z
2021-12-12T10:08:59.000Z
CommitPoolApp/components/layout-container/layout-container.component.tsx
alexkeating/CommitPool-monorepo
f89ad0c5319148ce374de34d13315c0f2d611271
[ "MIT" ]
57
2021-05-01T17:10:13.000Z
2022-01-13T17:19:35.000Z
CommitPoolApp/components/layout-container/layout-container.component.tsx
CommitPool/CommitPoolMatic
6a2e068a73dfcafa12f200cf560eec294e7e0eae
[ "MIT" ]
1
2021-12-14T16:12:34.000Z
2021-12-14T16:12:34.000Z
import React from "react"; import { Center, Flex, Heading, Container, VStack } from "@chakra-ui/react"; interface LayoutContainer { children?: React.ReactNode; } const LayoutContainer = ({ children }: LayoutContainer) => { return ( <VStack backgroundImage="url('https://i.imgur.com/Q1NCXvz.png')" backgroundPosition="50% 50%" backgroundSize="auto 100%" height="100%" > <Heading size="3xl" m="0.5em" color="rgba(212, 84, 84, 1)"> CommitPool </Heading> <Container color="white"> <Flex flexDir="column" align="center" h="90%" mt="5"> {children} </Flex> </Container> </VStack> ); }; export default LayoutContainer;
24.62069
76
0.603641
08b78032b3f540dd47ff578b327c2e5bcb8d2429
7,883
swift
Swift
Sources/ParserCombinators/Or.swift
turbolent/SwiftParserCombinators
672588767167a58dc43ceb9bb8e56a497798b16e
[ "MIT" ]
2
2017-09-24T17:41:12.000Z
2018-09-01T00:43:13.000Z
Sources/ParserCombinators/Or.swift
turbolent/ParserCombinators
672588767167a58dc43ceb9bb8e56a497798b16e
[ "MIT" ]
3
2017-07-03T23:03:54.000Z
2017-07-04T05:11:16.000Z
Sources/ParserCombinators/Or.swift
turbolent/SwiftParserCombinators
672588767167a58dc43ceb9bb8e56a497798b16e
[ "MIT" ]
null
null
null
import Trampoline extension Parser { /// Creates a new parser that succeeds if (and only if) either when this parser succeeds, /// or if this parser fails, when the alternative parser succeeds. /// /// - Note: /// The alternative parser is only tried if this parser's failure is non-fatal, /// i.e. not an error, and so backtracking is allowed. /// /// - Parameter alternative: A parser that will be applied if this parser fails. /// public func or<U>(_ alternative: @autoclosure @escaping () -> Parser<U, Element>) -> Parser<Either<T, U>, Element> { let lazyAlternative = Lazy(alternative) return Parser<Either<T, U>, Element> { input in self.step(input).flatMap { result in switch result { case .success: return Done(result.map { .left($0) }) case let .error(message, remaining): return Done(.error(message: message, remaining: remaining)) case let .failure(message, remaining): return More { lazyAlternative.value.step(input) } .map { altResult in switch altResult { case .success: return altResult.map { .right($0) } case let .failure(altMessage, altRemaining): if altRemaining.offset < remaining.offset { return .failure(message: message, remaining: remaining) } return .failure(message: altMessage, remaining: altRemaining) case let .error(altMessage, altRemaining): if altRemaining.offset < remaining.offset { return .error(message: message, remaining: remaining) } return .error(message: altMessage, remaining: altRemaining) } } } } } } /// Creates a new parser that succeeds if (and only if) either when this parser succeeds, /// or if this parser fails, when the alternative parser succeeds. /// /// - Note: /// The alternative parser is only tried if this parser's failure is non-fatal, /// i.e. not an error, and so backtracking is allowed. /// /// - Parameter alternative: A parser that will be applied if this parser fails. /// public func or(_ alternative: @autoclosure @escaping () -> Parser<T, Element>) -> Parser<T, Element> { return or(alternative()).map { $0.value } } /// Creates a new parser that succeeds if this parser or the alternative parser succeeds. /// If both parsers succeed, the result of the new parser is the result of the parser /// that consumed the most elements. /// /// - Note: /// The alternative parser is only tried if this parser's failure is non-fatal, /// i.e. not an error, and so backtracking is allowed. /// /// - Parameter alternative: A parser that will be applied if this parser fails. /// public func orLonger<U>(_ alternative: @autoclosure @escaping () -> Parser<U, Element>) -> Parser<Either<T, U>, Element> { let lazyAlternative = Lazy(alternative) return Parser<Either<T, U>, Element> { input in self.step(input).flatMap { result in switch result { case .success(_, let remaining): return More { lazyAlternative.value.step(input) } .map { altResult in switch altResult { case .success(_, let altRemaining): if altRemaining.offset < remaining.offset { return result.map { .left($0) } } return altResult.map { .right($0) } case .failure, .error: return result.map { .left($0) } } } case let .error(message, remaining): return Done(.error(message: message, remaining: remaining)) case let .failure(message, remaining): return More { lazyAlternative.value.step(input) } .map { altResult in switch altResult { case .success: return altResult.map { .right($0) } // NOTE: unfortunately matching a generic value in multiple patterns // is not yet supported, so can't bind `remaining` here case let .failure(altMessage, altRemaining): if altRemaining.offset < remaining.offset { return .failure(message: message, remaining: remaining) } return .failure(message: altMessage, remaining: altRemaining) case let .error(altMessage, altRemaining): if altRemaining.offset < remaining.offset { return .failure(message: message, remaining: remaining) } return .error(message: altMessage, remaining: altRemaining) } } } } } } /// Creates a new parser that succeeds if this parser or the alternative parser succeeds. /// If both parsers succeed, the result of the new parser is the result of the parser /// that consumed the most elements. /// /// - Note: /// The alternative parser is only tried if this parser's failure is non-fatal, /// i.e. not an error, and so backtracking is allowed. /// /// - Parameter alternative: A parser that will be applied if this parser fails. /// public func orLonger(_ alternative: @autoclosure @escaping () -> Parser<T, Element>) -> Parser<T, Element> { return orLonger(alternative()).map { $0.value } } } /// Creates a new parser that succeeds if (and only if) either when the first parser succeeds, /// or if it fails, when the alternative parser succeeds. /// /// - Note: /// The alternative parser is only tried if the first parser's failure is non-fatal, /// i.e. not an error, and so backtracking is allowed. /// /// - Parameters: /// - first: A parser that will be applied first. /// - alternative: A parser that will be applied if the first parser fails. /// public func || <T, U, Element>(first: Parser<T, Element>, alternative: @autoclosure @escaping () -> Parser<U, Element>) -> Parser<Either<T, U>, Element> { return first.or(alternative()) } /// Creates a new parser that succeeds if (and only if) either when the first parser succeeds, /// or if it fails, when the alternative parser succeeds. /// /// - Note: /// The alternative parser is only tried if the first parser's failure is non-fatal, /// i.e. not an error, and so backtracking is allowed. /// /// - Parameters: /// - first: A parser that will be applied first. /// - alternative: A parser that will be applied if the first parser fails. /// public func || <T, Element>(first: Parser<T, Element>, alternative: @autoclosure @escaping () -> Parser<T, Element>) -> Parser<T, Element> { return first.or(alternative()) }
43.076503
96
0.528733
da8e78b070b8c0c91e07f706d5db186423bb2dbe
1,012
php
PHP
resources/views/works/indexUser.blade.php
JonathanBlaise/burstfly
6724aa310c6dd38b69720b76578163c4357a8601
[ "MIT" ]
null
null
null
resources/views/works/indexUser.blade.php
JonathanBlaise/burstfly
6724aa310c6dd38b69720b76578163c4357a8601
[ "MIT" ]
2
2019-05-09T12:58:59.000Z
2021-10-05T21:15:17.000Z
resources/views/works/indexUser.blade.php
JonathanBlaise/burstfly
6724aa310c6dd38b69720b76578163c4357a8601
[ "MIT" ]
2
2019-05-09T12:24:23.000Z
2019-05-09T12:41:39.000Z
{{----}} {{--./ressources/views/works/indexUser.blade.php--}} {{--Variables disponibles:--}} {{---Table work, Table tag--}} {{----}} <section class="work"> @if(count($works) > 0) @foreach ($works as $work) <figure class="white"> <a href="{{ route('app_work_show',['id' => $work->id,'slug' => str_slug($work->name,'-')]) }}"> <img src="{{asset('storage/'.$work->image)}}" alt="" /> <dl> <dt>{{$work->name}}</dt> <dd>{{$work->description}}</dd> </dl> </a> <div id="wrapper-part-info"> <div class="part-info-image"><img src="{{asset('img/'.$work->tag->image)}}" alt="" width="28" height="28"/></div> <div id="part-info">{{$work->tag->name}}</div> </div> </figure> @endforeach @else <p>Aucun projet disponible</p> @endif </section>
32.645161
133
0.421937
c6dc95a437a20303f97af6f6175aec136e167ed2
40,754
py
Python
idacyber.py
fengjixuchui/IDACyber
0fa860a84a0cb4c36b604dda7ddf7b5b9b7b870e
[ "MIT" ]
null
null
null
idacyber.py
fengjixuchui/IDACyber
0fa860a84a0cb4c36b604dda7ddf7b5b9b7b870e
[ "MIT" ]
null
null
null
idacyber.py
fengjixuchui/IDACyber
0fa860a84a0cb4c36b604dda7ddf7b5b9b7b870e
[ "MIT" ]
null
null
null
import os import sys import ida_kernwin import ida_diskio import ida_bytes import ida_segment import ida_idaapi import ida_nalt import ida_idp from PyQt5.QtWidgets import (QWidget, QApplication, QCheckBox, QLabel, QComboBox, QSizePolicy, QVBoxLayout, QHBoxLayout) from PyQt5.QtGui import (QPainter, QColor, QFont, QPen, QPixmap, QImage, qRgb, QPainterPath, QStaticText) from PyQt5.QtCore import Qt, QObject, pyqtSignal, QRect, QSize, QPoint __author__ = 'Dennis Elser' BANNER = """ .___ .______ .______ ._______ ____ ____._______ ._______.______ : __|:_ _ \ : \ :_. ___\\ \_/ /: __ / : .____/: __ \ | : || | || . || : |/\ \___ ___/ | |> \ | : _/\ | \____| | || . | || : || / \ | | | |> \| / \| : \ | ||. ____/ |___| ||. _____/ |___| |_______/|_.: __/| |___\ |___| :/ |___| :/ :/ |___| """ PLUGIN_HELP = """ IDACyber Quick Manual ==================================================================== Controls: ==================================================================== Mouse controls: --------------- * Click + drag - Pan graph vertically * Click + SHIFT + drag - Pan graph horizontally * Wheel - Pan graph vertically * Wheel + SHIFT - Pan graph horizontally * Wheel + CTRL - Zoom * Wheel + h - Change width (in 8th steps) * Click + drag + h - Change width (in 8th steps) * Wheel + x - Change width (one step) * Click + drag + x - Change width (one step) * Double click - Jump to address under cursor Keyboard controls: ------------------ * CTRL-F1 - Display this help/quick manual * F2 - Display help for current filter * F12 - Export current graph to disk * UP - Pan up * DOWN - Pan down * UP + SHIFT - Pan up (one step) * DOWN + SHIFT - Pan down (one step) * PAGE UP - Pan up a 'page' * PAGE DOWN - Pan down a 'page' * CTRL-PLUS - Zoom in * CTRL-MINUS - Zoom out * B - Select previous filter * N - Select next filter * G - Go to address (accepts expressions) * S - Toggle 'sync' setting * D - Switch between hex/ascii * T - Turn hex/ascii dump on/off Check out the official project site for updates: https://github.com/patois/IDACyber """ # TODO: # * refactor # * colorfilter: improve arrows/pointers # * optimizations # * load filters using "require" # * add grid? # * use builtin Qt routines for scaling etc? # * store current settings in netnode? # * review signal handlers # * implement feature that generates a graph of all memory content/current # idb using the current color filter which is then saved/exported to disk # * implement color filter: dbghook, memory read/write tracing # * implement color filter: apply recorded trace log to graph # * implement color filter: colorize instructions/instruction groups # * implement color filter: Entropy visualization # * fix Hubert (beatcounter functionality, frame adjustment) # * draggable slider/scrollbar? # I believe this is Windows-only? FONT_DEFAULT = "Consolas" HL_COLOR = 0x0037CC HIGHLIGHTED_ITEM = None class ColorFilter(): """every new color filters must inherit this class""" name = None highlight_cursor = True help = None width = 16 sync = True lock_width = False lock_sync = False show_address_range = True zoom = 10 link_pixel = True support_selection = False disable_data = False def __init__(self, pw=None): pass """called when filter is selected in list""" def on_activate(self, idx): pass """called on deselection of filter (or when plugin closes)""" def on_deactivate(self): pass """handles mouse click events""" def on_mb_click(self, event, addr, size, mouse_offs): pass """called whenever a new frame is about to be drawn""" def on_process_buffer(self, buffers, addr, size, mouse_offs): return [] """called before tooltip is shown""" def on_get_tooltip(self, addr, size, mouse_offs): return None """called after on_process_buffer returns annotations and arrows/pointers""" def on_get_annotations(self, addr, size, mouse_offs): return None # ----------------------------------------------------------------------- def is_ida_version(requested): rv = requested.split(".") kv = ida_kernwin.get_kernel_version().split(".") count = min(len(rv), len(kv)) if not count: return False for i in xrange(count): if int(kv[i]) < int(rv[i]): return False return True # ----------------------------------------------------------------------- def highlight_item(ea): global HIGHLIGHTED_ITEM unhighlight_item() current_color = ida_nalt.get_item_color(ea) HIGHLIGHTED_ITEM = (ea, current_color) ida_nalt.set_item_color(ea, HL_COLOR) # ----------------------------------------------------------------------- def unhighlight_item(): global HIGHLIGHTED_ITEM if HIGHLIGHTED_ITEM: ida_nalt.set_item_color(HIGHLIGHTED_ITEM[0], HIGHLIGHTED_ITEM[1]) HIGHLIGHTED_ITEM = None # ----------------------------------------------------------------------- class ScreenEAHook(ida_kernwin.View_Hooks): def __init__(self): ida_kernwin.View_Hooks.__init__(self) self.sh = SignalHandler() self.new_ea = self.sh.ida_newea def view_loc_changed(self, widget, curloc, prevloc): if curloc is not prevloc: self.new_ea.emit() # ----------------------------------------------------------------------- class SignalHandler(QObject): pw_statechanged = pyqtSignal() pw_next_filter = pyqtSignal() pw_prev_filter = pyqtSignal() ida_newea = pyqtSignal() # ----------------------------------------------------------------------- class IDBBufHandler(): def __init__(self, loaderSegmentsOnly=False): pass def get_buffers(self, ea, count=0): buffers = [] base = offs = 0 i = 0 base = offs = 0 result = ida_bytes.get_bytes_and_mask(ea, count) if result: buf, mask = result for m in xrange(len(mask)): b = ord(mask[m]) if i == 0: ismapped = (b&1) != 0 for j in xrange(8): bitset = ((b>>j) & 1) != 0 if bitset != ismapped: offs = i+j buffers.append((ismapped, buf[base:offs])) base = i+j ismapped = not ismapped if j == 7: offs = i+j+1 if m == len(mask)-1: buffers.append((ismapped, buf[base:offs])) i += 8 return buffers def get_base(self, ea): base = ida_idaapi.BADADDR qty = ida_segment.get_segm_qty() for i in xrange(qty): seg = ida_segment.getnseg(i) if seg and seg.contains(ea): base = seg.start_ea break return base # ----------------------------------------------------------------------- class PixelWidget(QWidget): def __init__(self, form, bufhandler): super(PixelWidget, self).__init__() self.form = form self.set_zoom(10) self.maxPixelsPerLine = 64 self.maxPixelsTotal = 0 self.prev_mouse_y = 0 self.key = None self.buffers = None self.offs = 0 self.base = 0 self.fm = None self.filter_idx = 0 self.mouseOffs = 0 self.sync = True self.bh = bufhandler self.mouse_abs_x = 0 self.mouse_abs_y = 0 self.elemX = 0 self.elemY = 0 self.rect_x = 0 self.rect_x_width = 0 self.lock_width = False self.lock_sync = False self.link_pixel = True self.highlight_cursor = False self.render_data = True self.cur_formatter_idx = 0 self.max_formatters = 2 self.setMouseTracking(True) self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.sh = SignalHandler() self.statechanged = self.sh.pw_statechanged self.next_filter = self.sh.pw_next_filter self.prev_filter = self.sh.pw_prev_filter self.qp = QPainter() self.show() def paintEvent(self, event): if not self.fm: return # set leftmost x-coordinate of graph zoom_level = self.get_zoom() self.rect_x_width = self.get_width() * zoom_level self.rect_x = (self.rect().width() / 2) - (self.rect_x_width / 2) self.qp.begin(self) # what is a good default font for OSX/Linux? self.qp.setFont(QFont(FONT_DEFAULT)) # fill background self.qp.fillRect(self.rect(), Qt.black) content_addr = content_size = None if self.fm.support_selection: selected, start, end = ida_kernwin.read_range_selection(None) if selected: content_addr = start#min(start, end) content_size = end - start#max(start, end) - content_addr # use colorfilter to render image img = self.render_image(addr=content_addr, buf_size=content_size) if img: """ if zoom_level > 6: opacity = self.qp.opacity() full_opacity_zoom = 40.0 cur_opacity = (1.0 - (full_opacity_zoom - float(min(zoom_level-1, full_opacity_zoom)))/full_opacity_zoom) self.qp.setOpacity(1.0-cur_opacity) """ # draw image self.qp.drawImage(QRect(QPoint(self.rect_x, 0), QPoint(self.rect_x + self.get_width() * zoom_level, (self.get_pixels_total() / self.get_width()) * zoom_level)), img) # TODO: pen color contrast # TODO: data export: render data # TODO: default fonts / OS? # TODO: optimization # FIXME: there's a bug with gaps/unmapped buffers if self.render_data and not self.fm.disable_data and zoom_level > 6: self.qp.setPen(QColor(Qt.white)) fontsize = self.qp.font().pointSize() font = self.qp.font() font.setPointSize(zoom_level/3) self.qp.setFont(font) opacity = self.qp.opacity() full_opacity_zoom = 28 cur_opacity = (1.0 - (full_opacity_zoom - float(min(zoom_level-1, full_opacity_zoom)))/full_opacity_zoom) self.qp.setOpacity(cur_opacity) m = self.qp.fontMetrics() x = y = 0 num_pixels_per_row = self.get_width() if self.cur_formatter_idx == 0: sample = "%c" % (ord('X')) cwidth = m.width(sample) cheight = m.height() for mapped, buf in self.buffers: for i in range(len(buf)): if mapped: b = ord(buf[i]) data = "%c" % (chr(b) if b in range(0x20, 0x7E) else ".") self.qp.drawStaticText( self.rect_x + x*zoom_level + (zoom_level - cwidth)/2, y*zoom_level + (zoom_level - cheight)/2, QStaticText(data)) x = (i + 1) % num_pixels_per_row if not x: y = y + 1 elif self.cur_formatter_idx == 1: sample = "%02X" % (ord('X')) cwidth = m.width(sample) cheight = m.height() for mapped, buf in self.buffers: for i in range(len(buf)): if mapped: data = "%02X" % ord(buf[i]) self.qp.drawStaticText( self.rect_x + x*zoom_level + (zoom_level - cwidth)/2, y*zoom_level + (zoom_level - cheight)/2, QStaticText(data)) x = (i + 1) % num_pixels_per_row if not x: y = y + 1 self.qp.setOpacity(opacity) font.setPointSize(fontsize) self.qp.setFont(font) if self.show_address_range and self.fm.link_pixel: self.render_slider(addr=content_addr, buf_size=content_size) # get and draw annotations and pointers annotations = self.fm.on_get_annotations(content_addr if content_addr else self.get_address(), self.get_pixels_total(), self.mouseOffs) if annotations: self.render_annotations(annotations) self.qp.end() return def render_slider(self, addr=None, buf_size=None): if addr is None or buf_size is None: addr = self.base + self.offs buf_size = self.get_pixels_total() lowest_ea = ida_idaapi.get_inf_structure().get_minEA() highest_ea = ida_idaapi.get_inf_structure().get_maxEA() start_offs = addr - lowest_ea addr_space = highest_ea - lowest_ea perc_s = float(start_offs) / float(addr_space) perc_e = float(start_offs+buf_size) / float(addr_space) bar_width = 20 spaces_bar = 5 bar_x = self.rect_x - spaces_bar - bar_width bar_y = 5 bar_height = self.rect().height() - 2 * bar_y self.qp.fillRect(bar_x, bar_y, bar_width, bar_height, QColor(0x191919)) slider_offs_s = int(round(perc_s * bar_height)) slider_offs_e = int(round(perc_e * bar_height)) spaces_slider = 1 slider_x = bar_x + spaces_slider slider_y = bar_y + slider_offs_s slider_width = bar_width - 2 * spaces_slider # limit slider height to bar_height slider_height = max(min(slider_offs_e - slider_offs_s, bar_height - (slider_y - bar_y)), 4) self.qp.fillRect(slider_x, slider_y, slider_width, slider_height, QColor(0x404040)) # draw addresses top = '%X:' % self.get_address() bottom = '%X' % (self.get_address() + ((self.get_pixels_total() / self.get_width()) - 1) * self.get_width()) self.qp.setPen(QColor(0x808080)) self.qp.drawText(self.rect_x - self.qp.fontMetrics().width(top) - bar_width - 2 * spaces_bar, self.qp.fontMetrics().height(), top) self.qp.drawText(self.rect_x - self.qp.fontMetrics().width(bottom) - bar_width - 2 * spaces_bar, self.rect().height() - self.qp.fontMetrics().height() / 2, bottom) return def render_image(self, addr=None, buf_size=None, cursor=True): size = self.size() self.maxPixelsTotal = self.get_width() * (size.height() / self.pixelSize) if addr is None or buf_size is None: addr = self.base + self.offs buf_size = self.get_pixels_total() self.buffers = self.bh.get_buffers(addr, buf_size) img = QImage(self.get_width(), size.height() / self.pixelSize, QImage.Format_RGB32) pixels = self.fm.on_process_buffer(self.buffers, addr, self.get_pixels_total(), self.mouseOffs) x = y = 0 # transparency effect for unmapped bytes transparency_dark = [qRgb(0x2F,0x4F,0x4F), qRgb(0x00,0x00,0x00)] transparency_err = [qRgb(0x7F,0x00,0x00), qRgb(0x33,0x00,0x00)] for mapped, pix in pixels: if not mapped: if pix is None: pix = transparency_dark[(x&2 != 0) ^ (y&2 != 0)] img.setPixel(x, y, pix) x = (x + 1) % self.get_width() if not x: y = y + 1 if len(pixels) != self.get_pixels_total(): for i in xrange(self.get_pixels_total() - len(pixels)): pix = transparency_err[(x&2 != 0) ^ (y&2 != 0)] img.setPixel(x, y, pix) x = (x + 1) % self.get_width() if not x: y = y + 1 if ((cursor and self.fm.highlight_cursor) and self.mouse_abs_x >= self.rect_x and self.mouse_abs_x < self.rect_x + self.rect_x_width): coords = self.get_coords_by_address(self.get_cursor_address()) if coords: x,y = coords else: x = self.get_elem_x() y = self.get_elem_y() p = QPoint(x, y) img.setPixel(p, (~(img.pixelColor(p)).rgb() & 0xFFFFFFFF)) return img def render_annotations(self, annotations=[]): a_offs = 20 base_x = self.rect_x + self.get_width() * self.pixelSize + a_offs + 10 base_y = self.qp.fontMetrics().height() offs_x = 5 offs_y = base_y for coords, arr_color, ann, txt_color in annotations: # draw arrow (experimental / WIP) self.qp.setPen(QColor(Qt.white if txt_color is None else txt_color)) self.qp.drawText(base_x+10, (base_y+offs_y)/2, ann) target_x = target_y = None if coords: if isinstance(coords, tuple): target_x, target_y = coords else: ptr = self.get_coords_by_address(coords) if ptr: target_x, target_y = ptr if target_x is not None and target_y is not None: target_x *= self.get_zoom() target_y *= self.get_zoom() self.qp.setPen(QColor(Qt.white if arr_color is None else arr_color)) path = QPainterPath() path.moveTo(base_x+offs_x, (base_y+offs_y)/2-base_y/2) path.lineTo(base_x+offs_x - 4 - a_offs, (base_y+offs_y)/2-base_y/2) # left path.lineTo(base_x+offs_x - 4 - a_offs, ((target_y/10)*9) + self.get_zoom()/2) # down path.lineTo(self.rect_x + target_x + self.get_zoom() / 2, ((target_y/10)*9) + self.get_zoom()/2) # left path.lineTo(self.rect_x + target_x + self.get_zoom() / 2, target_y + self.get_zoom()/2) # down a_offs = max(a_offs-2, 0) self.qp.drawPath(path) else: if not isinstance(coords, tuple): direction = self.get_target_direction(coords) if direction: self.qp.setPen(QColor(Qt.white if arr_color is None else arr_color)) m = self.qp.fontMetrics() dirhint = ['', '<<', '>>'][direction] cwidth = m.width("%s" % (dirhint)) self.qp.drawText(base_x - cwidth, (base_y+offs_y)/2, dirhint) offs_y += 2*base_y + 5 return # functions that can be called by filters # must no be called from within on_process_buffer() def on_filter_request_update(self, ea=None, center=True): if not ea: self.repaint() else: curea = self.get_address() if ea < curea or ea >= curea + self.get_pixels_total(): # TODO: verify that ea is valid after following operation if center: ea -= self.get_pixels_total()/2 self.set_addr(ea) else: self.repaint() def on_filter_update_zoom(self, zoom): self.set_zoom(zoom) return def on_filter_update_zoom_delta(self, delta): self.set_zoom_delta(delta) return # end of functions that can be called by filters def show_help(self): ida_kernwin.info("%s" % PLUGIN_HELP) def keyPressEvent(self, event): if self.key is None: self.key = event.key() return def keyReleaseEvent(self, event): update = False key = event.key() modifiers = event.modifiers() shift_pressed = ((modifiers & Qt.ShiftModifier) == Qt.ShiftModifier) ctrl_pressed = ((modifiers & Qt.ControlModifier) == Qt.ControlModifier) if key == Qt.Key_F1 and ctrl_pressed: self.show_help() elif key == Qt.Key_G: addr = ask_addr(self.base + self.offs, 'Jump to address') if addr is not None: if self.sync: ida_kernwin.jumpto(addr) else: minea = ida_idaapi.get_inf_structure().get_minEA() maxea = ida_idaapi.get_inf_structure().get_maxEA() dst = min(max(addr, minea), maxea) self.set_addr(dst) elif key == Qt.Key_S: if not self.fm.lock_sync: self.set_sync_state(not self.get_sync_state()) update = True elif key == Qt.Key_T: self.render_data = not self.render_data self.repaint() elif key == Qt.Key_D: self.cur_formatter_idx = (self.cur_formatter_idx + 1) % self.max_formatters self.repaint() elif key == Qt.Key_N: self.next_filter.emit() elif key == Qt.Key_B: self.prev_filter.emit() elif key == Qt.Key_F2: hlp = self.fm.help if hlp is None: hlp = 'Help unavailable' ida_kernwin.info('%s\n\n' % hlp) elif key == Qt.Key_F12: img = self.render_image(cursor = False) img = img.scaled(img.width()*self.pixelSize, img.height()*self.pixelSize, Qt.KeepAspectRatio, Qt.FastTransformation) done = False i = 0 while not done: fname = 'IDACyber_%04d.bmp' % i if not os.path.isfile(fname): if img.save(fname): ida_kernwin.msg('File exported to %s\n' % fname) else: ida_kernwin.warning('Error exporting screenshot to %s.' % fname) done = True i += 1 if i > 40: ida_kernwin.warning('Aborted. Error exporting screenshot.') break elif key == Qt.Key_PageDown: self.set_offset_delta(-self.get_pixels_total()) update = True elif key == Qt.Key_PageUp: self.set_offset_delta(self.get_pixels_total()) update = True elif key == Qt.Key_Down: if shift_pressed: self.set_offset_delta(-1) else: self.set_offset_delta(-self.get_width()) update = True elif key == Qt.Key_Up: if shift_pressed: self.set_offset_delta(1) else: self.set_offset_delta(self.get_width()) update = True elif key == Qt.Key_Plus: if ctrl_pressed: self.set_zoom_delta(1) update = True elif key == Qt.Key_Minus: if ctrl_pressed: self.set_zoom_delta(-1) update = True self.key = None if update: if self.get_sync_state(): ida_kernwin.jumpto(self.base + self.offs) self.activateWindow() self.setFocus() self.statechanged.emit() self.repaint() return def mouseReleaseEvent(self, event): self.prev_mouse_y = event.pos().y() self.fm.on_mb_click(event, self.get_address(), self.get_pixels_total(), self.mouseOffs) if self.get_sync_state(): ida_kernwin.jumpto(self.base + self.offs) self.activateWindow() self.setFocus() self.statechanged.emit() return def mouseDoubleClickEvent(self, event): if self.link_pixel and event.button() == Qt.LeftButton: addr = self.base + self.offs + self._get_offs_by_pos(event.pos()) ida_kernwin.jumpto(addr) return def wheelEvent(self, event): delta = event.angleDelta().y()/120 # zoom if self.key == Qt.Key_Control: self.set_zoom_delta(delta) # width elif self.key == Qt.Key_X: if not self.lock_width: self.set_width_delta(delta) # offset (fine) elif self.key == Qt.Key_Shift: self.set_offset_delta(delta) if self.get_sync_state(): ida_kernwin.jumpto(self.base + self.offs) self.activateWindow() self.setFocus() elif self.key == Qt.Key_H: if not self.lock_width: less = delta < 0 w = -8 if less else 8 self.set_width((self.get_width() & 0xFFFFFFF8) + w) # offset (coarse) else: self.set_offset_delta(delta * self.get_width()) if self.get_sync_state(): ida_kernwin.jumpto(self.base + self.offs) self.activateWindow() self.setFocus() self.statechanged.emit() self.repaint() return def mouseMoveEvent(self, event): x = event.pos().x() y = event.pos().y() within_graph = (x >= self.rect_x and x < self.rect_x + self.rect_x_width) if within_graph: if event.buttons() == Qt.NoButton: self._update_mouse_coords(event.pos()) self.mouseOffs = self._get_offs_by_pos(event.pos()) if self.link_pixel and self.highlight_cursor: highlight_item(ida_bytes.get_item_head(self.get_cursor_address())) elif self.highlight_cursor: unhighlight_item() self.setToolTip(self.fm.on_get_tooltip(self.get_address(), self.get_pixels_total(), self.mouseOffs)) # zoom elif self.key == Qt.Key_Control: self.set_zoom_delta(-1 if y > self.prev_mouse_y else 1) # width elif self.key == Qt.Key_X: if not self.lock_width: self.set_width_delta(-1 if y > self.prev_mouse_y else 1) elif self.key == Qt.Key_H: if not self.lock_width: less = y > self.prev_mouse_y delta = -16 if less else 16 self.set_width((self.get_width() & 0xFFFFFFF0) + delta) # scrolling (offset) elif y != self.prev_mouse_y: # offset (fine) delta = y - self.prev_mouse_y # offset (coarse) if self.key != Qt.Key_Shift: delta *= self.get_width() self.set_offset_delta(delta) self.prev_mouse_y = y self.x = x self.statechanged.emit() self.repaint() return def set_sync_state(self, sync): self.sync = sync def get_sync_state(self): return self.sync def get_filter_idx(self): return self.filter_idx def set_filter(self, fltobj, idx): if self.fm: self.fm.on_deactivate() if fltobj: self.fm = fltobj """load filter config""" self.set_sync_state(self.fm.sync) self.lock_width = self.fm.lock_width self.set_width(self.fm.width) self.lock_sync = self.fm.lock_sync self.show_address_range = self.fm.show_address_range # disabled for now # self.set_zoom(self.fm.zoom) self.link_pixel = self.fm.link_pixel self.highlight_cursor = self.fm.highlight_cursor self.statechanged.emit() """load filter config end""" self.fm.on_activate(idx) self.filter_idx = idx unhighlight_item() self.repaint() def set_addr(self, ea, new_cursor=None): base = self.bh.get_base(ea) self._set_base(base) self._set_offs(ea - base) if new_cursor: self.set_cursor_address(new_cursor) if self.highlight_cursor: highlight_item(ea) self.repaint() def get_zoom(self): return self.pixelSize def set_zoom(self, zoom): self.pixelSize = zoom def set_zoom_delta(self, dzoom): self.set_zoom(max(1, self.pixelSize + dzoom)) return def get_width(self): return self.maxPixelsPerLine def get_pixels_total(self): return self.maxPixelsTotal def get_address(self): return self.base + self.offs def get_cursor_address(self): return self.get_address() + self.mouseOffs def set_cursor_address(self, ea): self.mouseOffs = ea - self.get_address() def get_coords_by_address(self, address): base = self.get_address() # if address is visible in current window if address >= base and address < base + self.get_pixels_total(): offs = address - base x = offs % self.get_width() y = offs / (self.get_width()) return (x, y) return None def get_target_direction(self, address): base = self.get_address() # if address is visible in current window direction = None if address >= base and address < base + self.get_pixels_total(): direction = 0 elif address < base: direction = 1 else: direction = 2 return direction def set_width(self, width): self.maxPixelsPerLine = max(1, width) def set_width_delta(self, dwidth): self.maxPixelsPerLine = max(1, self.maxPixelsPerLine + dwidth) def set_offset_delta(self, doffs): newea = self.base + self.offs - doffs minea = ida_idaapi.get_inf_structure().get_minEA() maxea = ida_idaapi.get_inf_structure().get_maxEA() if doffs < 0: delta = doffs if newea < maxea else doffs - (maxea - newea) else: delta = doffs if newea >= minea else doffs - (minea - newea) self._set_offs(self.offs - delta) def _get_offs_by_pos(self, pos): elemX = self.get_elem_x() elemY = self.get_elem_y() offs = elemY * self.get_width() + elemX return offs def _update_mouse_coords(self, pos): x = pos.x() y = pos.y() self.mouse_abs_x = x self.mouse_abs_y = y self.elemX = max(0, min((max(0, x - self.rect_x)) / self.pixelSize, self.get_width() - 1)) self.elemY = min(y / self.pixelSize, self.maxPixelsTotal / self.get_width() - 1) def get_elem_x(self): return self.elemX def get_elem_y(self): return self.elemY def _set_offs(self, offs): self.offs = offs def _set_base(self, ea): self.base = ea # ----------------------------------------------------------------------- class IDACyberForm(ida_kernwin.PluginForm): idbh = None hook = None windows = [] def __init__(self): if IDACyberForm.idbh is None: IDACyberForm.idbh = IDBBufHandler(True) if IDACyberForm.hook is None: IDACyberForm.hook = ScreenEAHook() IDACyberForm.hook.hook() self.__clink__ = ida_kernwin.plgform_new() self.title = None self.filterlist = None self.pw = None self.windowidx = 0 self.filterChoser = None self.cb = None self.status = None self.pw = None self.parent = None self.form = None self.clean_init = False def _update_widget(self): lbl_address = 'Address ' lbl_cursor = 'Cursor ' lbl_zoom = 'Zoom ' lbl_pixel = 'Pixels ' if self.pw.link_pixel: val_address = '%Xh' % self.pw.get_address() val_cursor = '%Xh' % self.pw.get_cursor_address() else: val_address = val_cursor = 'N/A' width = self.pw.get_width() val_zoom = '%d:1 ' % self.pw.get_zoom() val_pixel = '%dx%d ' % (width, self.pw.get_pixels_total()/width) status_text = ' | '.join((lbl_address + val_address, lbl_cursor + val_cursor, lbl_pixel + val_pixel, lbl_zoom + val_zoom)) # TODO: move code to separate, new signal handler self.cb.setChecked(self.pw.sync) self.cb.setEnabled(not self.pw.lock_sync) self.status.setText(status_text) def _load_filters(self, pw): filters = [] filterdir = os.path.join(ida_diskio.idadir('plugins'), 'cyber') if not os.path.exists(filterdir): usr_plugins_dir = os.path.join(ida_diskio.get_user_idadir(), "plugins") filterdir = os.path.join(usr_plugins_dir, 'cyber') if os.path.exists(filterdir): sys.path.append(filterdir) for entry in os.listdir(filterdir): if entry.lower().endswith('.py') and entry.lower() != '__init__.py': mod = os.path.splitext(entry)[0] fmod = __import__(mod, globals(), locals(), [], 0) if fmod is not None: flt = fmod.FILTER_INIT(pw) if flt is not None: filters.append((fmod, flt)) return filters def _unload_filters(self): for fmod, obj in self.filterlist: obj.on_deactivate() fmod.FILTER_EXIT() def _change_screen_ea(self): if self.pw.get_sync_state(): ea = ida_kernwin.get_screen_ea() self.pw.set_addr(ea, new_cursor=ea) # TODO self._update_widget() def _select_filter(self, idx): self.pw.set_filter(self.filterlist[idx][1], idx) self.pw.repaint() def _select_next_filter(self): next_idx = (self.pw.get_filter_idx() + 1) % len(self.filterlist) self.filterChoser.setCurrentIndex(next_idx) def _select_prev_filter(self): prev_idx = self.pw.get_filter_idx() - 1 if prev_idx < 0: prev_idx = len(self.filterlist) - 1 self.filterChoser.setCurrentIndex(prev_idx) def _toggle_sync(self, state): self.pw.set_sync_state(state == Qt.Checked) def Show(self, caption, options): i = 0 while True: i += 1 if i not in IDACyberForm.windows: title = 'IDACyber [%d]' % i caption = title IDACyberForm.windows.append(i) self.windowidx = i break return ida_kernwin.plgform_show(self.__clink__, self, caption, options) def OnClose(self, options): if self.clean_init and IDACyberForm.hook is not None: IDACyberForm.hook.new_ea.disconnect(self._change_screen_ea) IDACyberForm.windows.remove(self.windowidx) self._unload_filters() unhighlight_item() # once all idacyber forms are closed if not len(IDACyberForm.windows): IDACyberForm.hook.unhook() IDACyberForm.hook = None def OnCreate(self, form): self.form = form self.parent = self.FormToPyQtWidget(form) vl = QVBoxLayout() hl = QHBoxLayout() hl2 = QHBoxLayout() hl3 = QHBoxLayout() hl4 = QHBoxLayout() flt = QLabel() flt.setText('Filter:') hl.addWidget(flt) self.cb = QCheckBox('Sync') self.cb.setChecked(True) self.cb.stateChanged.connect(self._toggle_sync) hl2.addWidget(self.cb) self.status = QLabel() self.status.setText('Cyber, cyber!') hl4.addWidget(self.status) self.pw = PixelWidget(self.parent, IDACyberForm.idbh) self.pw.setFocusPolicy(Qt.StrongFocus | Qt.WheelFocus) self.pw.statechanged.connect(self._update_widget) self.pw.next_filter.connect(self._select_next_filter) self.pw.prev_filter.connect(self._select_prev_filter) self.filterlist = self._load_filters(self.pw) if not len(self.filterlist): ida_kernwin.warning("IDACyber: no filters found within /plugins/cyber/") return self.pw.set_filter(self.filterlist[0][1], 0) self.pw.set_addr(ida_kernwin.get_screen_ea()) self.filterChoser = QComboBox() self.filterChoser.addItems([obj.name for filter, obj in self.filterlist]) self.filterChoser.currentIndexChanged.connect(self._select_filter) hl.addWidget(self.filterChoser) hl.addStretch(1) vl.addWidget(self.pw) vl.addLayout(hl) vl.addLayout(hl2) vl.addLayout(hl3) vl.addLayout(hl4) self.parent.setLayout(vl) if IDACyberForm.hook is not None: IDACyberForm.hook.new_ea.connect(self._change_screen_ea) self.clean_init = True return # ----------------------------------------------------------------------- class idb_hook_t(ida_idp.IDB_Hooks): def __init__(self): ida_idp.IDB_Hooks.__init__(self) def savebase(self): unhighlight_item() return 0 # ----------------------------------------------------------------------- class IDACyberPlugin(ida_idaapi.plugin_t): flags = ida_idaapi.PLUGIN_MOD comment = '' help = '' wanted_name = 'IDACyber' wanted_hotkey = 'Ctrl-Shift-C' def init(self): if not is_ida_version("7.0"): return ida_idaapi.PLUGIN_SKIP self.idbhook = idb_hook_t() self.idbhook.hook() self.forms = [] self.options = (ida_kernwin.PluginForm.WOPN_MENU | ida_kernwin.PluginForm.WOPN_ONTOP | ida_kernwin.PluginForm.WOPN_RESTORE | ida_kernwin.PluginForm.WOPN_PERSIST | ida_kernwin.PluginForm.WCLS_CLOSE_LATER) ida_kernwin.msg('%s\n+ %s loaded.\n+ %s opens a new instance.\n+ Ctrl-F1 for help.\n\n' % ( BANNER, IDACyberPlugin.wanted_name, IDACyberPlugin.wanted_hotkey)) return ida_idaapi.PLUGIN_KEEP def run(self, arg): frm = IDACyberForm() frm.Show(None, options = self.options) self.forms.append(frm) def term(self): self.idbhook.unhook() # sloppy. windows might have been closed / memory free'd for frm in self.forms: if frm: frm.Close(options = self.options) # ----------------------------------------------------------------------- def PLUGIN_ENTRY(): return IDACyberPlugin()
35.132759
129
0.521568
b70c35a7d7d532621061877ffafb32196bb787e3
1,590
swift
Swift
Caffeine/Controllers/SettingsViewController/SVC+UITableViewDataSource.swift
the-braveknight/Caffeine
ad71ba5e52981d6129ca3b0630b267022c626dc2
[ "MIT" ]
2
2018-04-30T07:39:44.000Z
2022-01-06T09:04:05.000Z
Caffeine/Controllers/SettingsViewController/SVC+UITableViewDataSource.swift
the-braveknight/Caffeine
ad71ba5e52981d6129ca3b0630b267022c626dc2
[ "MIT" ]
null
null
null
Caffeine/Controllers/SettingsViewController/SVC+UITableViewDataSource.swift
the-braveknight/Caffeine
ad71ba5e52981d6129ca3b0630b267022c626dc2
[ "MIT" ]
null
null
null
// // SVC+UITableViewDataSource.swift // Caffeine // // Created by Zaid Rahawi on 3/19/18. // Copyright © 2018 Zaid Rahawi. All rights reserved. // import UIKit extension SettingsViewController { override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if section == 0 { return 1 } else if section == 1 { } return 0 } override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { updateCellUI(cell) } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: cellId, for: indexPath) if indexPath.section == 0 { if indexPath.row == 0 { cell.textLabel?.text = "Dark Mode" let darkModeSwitch = UISwitch() darkModeSwitch.translatesAutoresizingMaskIntoConstraints = false darkModeSwitch.isOn = Settings.colorMode == .dark darkModeSwitch.addTarget(self, action: #selector(handleDarkModeSwitch), for: .valueChanged) cell.contentView.addSubview(darkModeSwitch) darkModeSwitch.trailingAnchor.constraint(equalTo: cell.contentView.trailingAnchor, constant: -12).isActive = true darkModeSwitch.centerYAnchor.constraint(equalTo: cell.contentView.centerYAnchor).isActive = true } } return cell } }
36.136364
129
0.638365
2c80c4db68939c316c3616e6e05aaad58521c1ff
2,367
py
Python
api/src/opentrons/protocol_engine/types.py
y3rsh/opentrons
b446567910db218030fef40396ab2255cc074bba
[ "Apache-2.0" ]
235
2017-10-27T20:37:27.000Z
2022-03-30T14:09:49.000Z
api/src/opentrons/protocol_engine/types.py
y3rsh/opentrons
b446567910db218030fef40396ab2255cc074bba
[ "Apache-2.0" ]
8,425
2017-10-26T15:25:43.000Z
2022-03-31T23:54:26.000Z
api/src/opentrons/protocol_engine/types.py
y3rsh/opentrons
b446567910db218030fef40396ab2255cc074bba
[ "Apache-2.0" ]
130
2017-11-09T21:02:37.000Z
2022-03-15T18:01:24.000Z
"""Public protocol engine value types and models.""" from enum import Enum from dataclasses import dataclass from pydantic import BaseModel, Field from typing import Union from opentrons.types import MountType, DeckSlotName class EngineStatus(str, Enum): """Current execution status of a ProtocolEngine.""" READY_TO_RUN = "ready-to-run" RUNNING = "running" PAUSE_REQUESTED = "pause-requested" PAUSED = "paused" STOP_REQUESTED = "stop-requested" STOPPED = "stopped" FAILED = "failed" SUCCEEDED = "succeeded" class DeckSlotLocation(BaseModel): """Location for labware placed in a single slot.""" slot: DeckSlotName LabwareLocation = Union[DeckSlotLocation] """Union of all legal labware locations.""" class WellOrigin(str, Enum): """Origin of WellLocation offset.""" TOP = "top" BOTTOM = "bottom" class WellOffset(BaseModel): """An offset vector in (x, y, z).""" x: float = 0 y: float = 0 z: float = 0 class WellLocation(BaseModel): """A relative location in reference to a well's location.""" origin: WellOrigin = WellOrigin.TOP offset: WellOffset = Field(default_factory=WellOffset) @dataclass(frozen=True) class Dimensions: """Dimensions of an object in deck-space.""" x: float y: float z: float class CalibrationOffset(BaseModel): """Calibration offset from nomimal to actual position.""" x: float y: float z: float # TODO(mc, 2021-04-16): reconcile with opentrons_shared_data # shared-data/python/opentrons_shared_data/pipette/dev_types.py class PipetteName(str, Enum): """Pipette load name values.""" P10_SINGLE = "p10_single" P10_MULTI = "p10_multi" P20_SINGLE_GEN2 = "p20_single_gen2" P20_MULTI_GEN2 = "p20_multi_gen2" P50_SINGLE = "p50_single" P50_MULTI = "p50_multi" P300_SINGLE = "p300_single" P300_MULTI = "p300_multi" P300_SINGLE_GEN2 = "p300_single_gen2" P300_MULTI_GEN2 = "p300_multi_gen2" P1000_SINGLE = "p1000_single" P1000_SINGLE_GEN2 = "p1000_single_gen2" class LoadedPipette(BaseModel): """A pipette that has been loaded.""" id: str pipetteName: PipetteName mount: MountType class LoadedLabware(BaseModel): """A labware that has been loaded.""" id: str loadName: str definitionUri: str location: LabwareLocation
22.330189
64
0.69286
d2ffbfe6a63ac3f4c1277bd717f49974ad7a5409
2,748
rs
Rust
lucet-idl/src/lib.rs
forkkit/lucet
665886a404553d03b7300d3f226a5b4717ce18d8
[ "Apache-2.0" ]
null
null
null
lucet-idl/src/lib.rs
forkkit/lucet
665886a404553d03b7300d3f226a5b4717ce18d8
[ "Apache-2.0" ]
null
null
null
lucet-idl/src/lib.rs
forkkit/lucet
665886a404553d03b7300d3f226a5b4717ce18d8
[ "Apache-2.0" ]
null
null
null
#![deny(bare_trait_objects)] #[macro_use] extern crate failure; mod atoms; mod c; mod config; mod cursor; mod error; mod lexer; mod parser; mod prelude; pub mod pretty_writer; mod repr; mod rust; mod validate; pub use crate::atoms::{AbiType, AtomType}; pub use crate::config::{Backend, Config}; pub use crate::cursor::{ AliasDatatype, BindingDirection, BindingParam, Datatype, DatatypeVariant, EnumDatatype, EnumVariant, FuncBinding, FuncParam, Function, Module, Package, ParamPosition, StructDatatype, StructMember, }; pub use crate::error::{IDLError, ValidationError}; pub use crate::rust::{ RustFunc, RustIdiomArg, RustIdiomRet, RustName, RustTupleSyntax, RustTypeName, }; use crate::c::CGenerator; use crate::parser::Parser; use crate::rust::RustGenerator; use crate::validate::package_from_declarations; use lucet_module::bindings::Bindings; use std::collections::HashMap; use std::fs; use std::io::Write; use std::path::Path; #[derive(Debug, PartialEq, Eq, Clone, Copy, Default)] pub struct Location { pub line: usize, pub column: usize, } pub trait MemArea { fn mem_size(&self) -> usize; fn mem_align(&self) -> usize; } pub fn parse_package(input: &str) -> Result<Package, IDLError> { let mut parser = Parser::new(&input); let decls = parser.match_package_decls()?; let pkg = package_from_declarations(&decls)?; Ok(pkg) } pub fn codegen(package: &Package, config: &Config, output: Box<dyn Write>) -> Result<(), IDLError> { match config.backend { Backend::CGuest => CGenerator::new(output).generate_guest(package)?, Backend::RustGuest => RustGenerator::new(output).generate_guest(package)?, Backend::RustHost => RustGenerator::new(output).generate_host(package)?, Backend::Bindings => generate_bindings(&package.bindings(), output)?, } Ok(()) } pub fn run(config: &Config, input_path: &Path, output: Box<dyn Write>) -> Result<(), IDLError> { let input = fs::read_to_string(input_path)?; let pkg = parse_package(&input)?; codegen(&pkg, config, output) } impl Package { pub fn bindings(&self) -> Bindings { let mut bs = HashMap::new(); for m in self.modules() { let mut mod_bs = HashMap::new(); for f in m.functions() { mod_bs.insert(f.name().to_owned(), f.host_func_name()); } bs.insert(m.name().to_owned(), mod_bs); } Bindings::new(bs) } } fn generate_bindings(bindings: &Bindings, mut output: Box<dyn Write>) -> Result<(), IDLError> { let bindings_json = bindings .to_string() .map_err(|_| IDLError::InternalError("bindings generation"))?; output.write_all(bindings_json.as_bytes())?; Ok(()) }
28.625
100
0.667031
05b6dcb90460594a2b703f1266da06e75f93026d
1,227
py
Python
test/mp4/socket/simulateSocket.py
shichuzhu/sds
686ab645e2c7620b42c79bd729f5df6b91944492
[ "MIT" ]
null
null
null
test/mp4/socket/simulateSocket.py
shichuzhu/sds
686ab645e2c7620b42c79bd729f5df6b91944492
[ "MIT" ]
null
null
null
test/mp4/socket/simulateSocket.py
shichuzhu/sds
686ab645e2c7620b42c79bd729f5df6b91944492
[ "MIT" ]
null
null
null
import random import socket # create an INET, STREAMing socket # bind the socket to a public host, and a well-known port # become a server socket # accept connections from outside # now do something with the clientsocket # in this case, we'll pretend this is a threaded server def getWord(length): word = "" for i in range(length): word += chr(ord('a') + random.randint(0, 25)) return word def getLine(length): line = "" for i in range(length): wordLength = random.randint(3, 5) line += getWord(wordLength) line += ' ' line += '\n' return line random.seed(9999) with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sockfd: sevrAddr = ("localhost", 9999) sockfd.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sockfd.bind(sevrAddr) sockfd.listen(5) while True: clientsocket, address = sockfd.accept() with clientsocket: for i in range(100): try: lineLength = random.randint(5, 15) line = getLine(lineLength) clientsocket.send(line.encode()) except BrokenPipeError: exit(1) break
25.040816
65
0.603097
c500cfa242a076f5071e4a86e9f30ccd21965058
220
css
CSS
test/fixture/compress/restructure.merge/5.css
pvkopa/csso
415ab2b00f2f86ddd3f15e219a5e4c5aa3534aa7
[ "MIT" ]
2,920
2015-01-05T17:13:49.000Z
2022-03-30T19:35:48.000Z
test/fixture/compress/restructure.merge/5.css
pvkopa/csso
415ab2b00f2f86ddd3f15e219a5e4c5aa3534aa7
[ "MIT" ]
321
2015-01-05T18:35:55.000Z
2022-03-10T14:21:15.000Z
test/fixture/compress/restructure.merge/5.css
pvkopa/csso
415ab2b00f2f86ddd3f15e219a5e4c5aa3534aa7
[ "MIT" ]
203
2015-01-06T05:26:21.000Z
2022-02-28T09:47:16.000Z
/* blocks could be merged as consequence block override common styles .a, .b { color: red; width: 100px } .b { color: green } */ .a { color: red; width: 100px; } .b { width: 100px; color: green; }
14.666667
68
0.581818
af5befdb12fe17c1adb267429dd5b06cccac3012
327
py
Python
Hackerrank/Stock Maximize/Stock Maximize.py
rahil-1407/Data-Structure-and-Algorithms
ea3eb9849aeb2716ef5812a0b5621a28120b1880
[ "MIT" ]
51
2021-01-14T04:05:55.000Z
2022-01-25T11:25:37.000Z
Hackerrank/Stock Maximize/Stock Maximize.py
rahil-1407/Data-Structure-and-Algorithms
ea3eb9849aeb2716ef5812a0b5621a28120b1880
[ "MIT" ]
638
2020-12-27T18:49:53.000Z
2021-11-21T05:22:52.000Z
Hackerrank/Stock Maximize/Stock Maximize.py
rahil-1407/Data-Structure-and-Algorithms
ea3eb9849aeb2716ef5812a0b5621a28120b1880
[ "MIT" ]
124
2021-01-30T06:40:20.000Z
2021-11-21T15:14:40.000Z
def stockmax(p): ind_max = p.index(max(p)) #find the max price inv = sum(p[:ind_max]) #split the array before and after max price pf = len(p[:ind_max])*p[ind_max] - inv #buy all stocks before max price if len(p[ind_max+1:]) > 0: pf += stockmax(p[ind_max+1:]) #then sell them at max price return pf
40.875
76
0.633028
7e1c3d30604aba8ec2c1753f34b50e9e85c1ef69
1,084
rs
Rust
src/sphere.rs
faineance/rust-tracer
ec8c6a612037c358f2305849919616c272d50715
[ "MIT" ]
null
null
null
src/sphere.rs
faineance/rust-tracer
ec8c6a612037c358f2305849919616c272d50715
[ "MIT" ]
null
null
null
src/sphere.rs
faineance/rust-tracer
ec8c6a612037c358f2305849919616c272d50715
[ "MIT" ]
null
null
null
use vector::Vector; use colour::Colour; use vector::{dot, cross}; use ray::Ray; use std::num::Float; #[derive(Debug,Copy)] enum Reflection { Diffuse, Specular, Refractive } #[derive(Debug,Copy)] pub struct Sphere { pub radius: f32, pub position: Vector, pub colour: Colour, // pub emission: Vector, // pub reflection: Reflection } impl Sphere { pub fn new(radius: f32, position: Vector, colour: Colour) -> Sphere { Sphere { radius: radius, position: position, colour: colour} } //Returns distance if hit, returns 0 if no hit. pub fn intersect(&self, ray: Ray) -> f32 { let op = self.position - ray.origin; let eps = 1e-4; let b = dot(op ,ray.direction); let mut det = b * b - dot(op ,ray.direction) + self.radius * self.radius; if det < 0.0 { return 0.0; } else { det = det.sqrt(); } if (b - det) > eps { return b-det; } if (b + det) > eps { return b+det; } return 0.0; } }
22.583333
81
0.538745
dd588c000096c3283f091335d53dacc22b8de3cb
48,400
java
Java
cli/src/test/java/org/jboss/as/cli/parsing/test/RolloutPlanParsingTestCase.java
neha-b2001/wildfly-core
fe2a3c001446885373b35b63ed677ce642bbc2d3
[ "Apache-2.0" ]
156
2015-01-05T09:12:40.000Z
2022-03-10T05:38:05.000Z
cli/src/test/java/org/jboss/as/cli/parsing/test/RolloutPlanParsingTestCase.java
neha-b2001/wildfly-core
fe2a3c001446885373b35b63ed677ce642bbc2d3
[ "Apache-2.0" ]
3,440
2015-01-04T17:16:56.000Z
2022-03-31T16:47:13.000Z
cli/src/test/java/org/jboss/as/cli/parsing/test/RolloutPlanParsingTestCase.java
neha-b2001/wildfly-core
fe2a3c001446885373b35b63ed677ce642bbc2d3
[ "Apache-2.0" ]
448
2015-01-08T15:47:49.000Z
2022-03-17T03:12:10.000Z
/* * JBoss, Home of Professional Open Source. * Copyright 2016, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This 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 software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.as.cli.parsing.test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import java.util.Collection; import java.util.Iterator; import org.jboss.as.cli.CommandFormatException; import org.jboss.as.cli.Util; import org.jboss.as.cli.completion.mock.MockCommandContext; import org.jboss.as.cli.impl.HeadersArgumentValueConverter; import org.jboss.as.cli.operation.CommandLineParser; import org.jboss.as.cli.operation.ParsedOperationRequestHeader; import org.jboss.as.cli.operation.impl.DefaultCallbackHandler; import org.jboss.as.cli.operation.impl.DefaultOperationRequestParser; import org.jboss.as.cli.operation.impl.ParsedRolloutPlanHeader; import org.jboss.as.cli.operation.impl.SingleRolloutPlanGroup; import org.jboss.dmr.ModelNode; import org.junit.Test; /** * * @author Alexey Loubyansky */ public class RolloutPlanParsingTestCase { private final CommandLineParser parser = DefaultOperationRequestParser.INSTANCE; private final DefaultCallbackHandler handler = new DefaultCallbackHandler(); private final MockCommandContext ctx = new MockCommandContext(); @Test public void testHeaderListStart() throws Exception { parse("/profile=default/subsystem=threads/thread-factory=mytf:do{"); assertTrue(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertTrue(handler.endsOnSeparator()); assertTrue(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertFalse(handler.hasHeaders()); } @Test public void testEmptyHeaders() throws Exception { parse("/profile=default/subsystem=threads/thread-factory=mytf:do{}"); assertTrue(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertTrue(handler.isRequestComplete()); assertFalse(handler.hasHeaders()); } @Test public void testSingleHeader() throws Exception { parse("/profile=default/subsystem=threads/thread-factory=mytf:do{ name = value }"); assertTrue(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertTrue(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertEquals("name", header.getName()); final ModelNode node = new ModelNode(); node.get("name").set("value"); final ModelNode headersNode = new ModelNode(); header.addTo(ctx, headersNode); assertEquals(node, headersNode); } @Test public void testEndsOnHeaderSeparator() throws Exception { parse(":do{ name = value;"); assertFalse(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertTrue(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertEquals("name", header.getName()); final ModelNode node = new ModelNode(); node.get("name").set("value"); final ModelNode headersNode = new ModelNode(); header.addTo(ctx, headersNode); assertEquals(node, headersNode); assertTrue(handler.endsOnHeaderSeparator()); } @Test public void testTwoHeaders() throws Exception { parse("/profile=default/subsystem=threads/thread-factory=mytf:do{ name1 = value1 ; name2=value2 }"); assertTrue(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertTrue(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(2, headers.size()); final Iterator<ParsedOperationRequestHeader> i = headers.iterator(); ParsedOperationRequestHeader header = i.next(); assertEquals("name1", header.getName()); ModelNode node = new ModelNode(); node.get("name1").set("value1"); ModelNode headersNode = new ModelNode(); header.addTo(ctx, headersNode); assertEquals(node, headersNode); header = i.next(); assertEquals("name2", header.getName()); node = new ModelNode(); node.get("name2").set("value2"); headersNode = new ModelNode(); header.addTo(ctx, headersNode); assertEquals(node, headersNode); } /* @Test public void testRolloutWithAProp() throws Exception { parse("/profile=default/subsystem=threads/thread-factory=mytf:do{ rollout prop=value"); assertTrue(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertTrue(handler.endsOnSeparator()); assertTrue(handler.endsOnHeaderListStart()); // TODO this is kind of strange but ok... assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final List<OperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final OperationRequestHeader header = headers.get(0); assertTrue(header instanceof RolloutPlanHeader); final RolloutPlanHeader rollout = (RolloutPlanHeader) header; assertEquals("value", rollout.getProperty("prop")); } @Test public void testRolloutWithTwoProps() throws Exception { parse("/profile=default/subsystem=threads/thread-factory=mytf:do{ rollout prop1=value1 prop2 = value2"); assertTrue(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertTrue(handler.endsOnSeparator()); assertTrue(handler.endsOnHeaderListStart()); // TODO this is kind of strange but ok... assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final List<OperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final OperationRequestHeader header = headers.get(0); assertTrue(header instanceof RolloutPlanHeader); final RolloutPlanHeader rollout = (RolloutPlanHeader) header; assertEquals("value1", rollout.getProperty("prop1")); assertEquals("value2", rollout.getProperty("prop2")); } */ @Test public void testRolloutSingleGroupName() throws Exception { //parse("/profile=default/subsystem=threads/thread-factory=mytf:do{ rollout in-series = groupA}"); parse("/profile=default/subsystem=threads/thread-factory=mytf:do{ rollout groupA}"); assertTrue(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertTrue(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); final ModelNode node = new ModelNode(); final ModelNode inSeries = node.get(Util.ROLLOUT_PLAN).get(Util.IN_SERIES); final ModelNode groupA = new ModelNode(); groupA.get("groupA"); inSeries.add().get(Util.SERVER_GROUP).set(groupA); final ModelNode headersNode = new ModelNode(); header.addTo(ctx, headersNode); assertEquals(node, headersNode); } @Test public void testEndsOnGroupPropertiesStart() throws Exception { parse("/profile=default/subsystem=threads/thread-factory=mytf:do{ rollout groupA("); assertTrue(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); ParsedRolloutPlanHeader rollout = (ParsedRolloutPlanHeader) header; final SingleRolloutPlanGroup group = rollout.getLastGroup(); assertNotNull(group); assertEquals("groupA", group.getGroupName()); assertTrue(group.endsOnPropertyListStart()); assertFalse(group.endsOnPropertyListEnd()); assertFalse(group.hasProperties()); } public void testSpaceBeforeGroupPropertiesStart() throws Exception { parse(":do{ rollout groupA ("); assertFalse(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); ParsedRolloutPlanHeader rollout = (ParsedRolloutPlanHeader) header; final SingleRolloutPlanGroup group = rollout.getLastGroup(); assertNotNull(group); assertEquals("groupA", group.getGroupName()); assertTrue(group.endsOnPropertyListStart()); assertFalse(group.endsOnPropertyListEnd()); assertFalse(group.hasProperties()); } @Test public void testEndsOnGroupPropertiesEnd() throws Exception { parse("/profile=default/subsystem=threads/thread-factory=mytf:do{ rollout groupA()"); assertTrue(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); ParsedRolloutPlanHeader rollout = (ParsedRolloutPlanHeader) header; final SingleRolloutPlanGroup group = rollout.getLastGroup(); assertNotNull(group); assertEquals("groupA", group.getGroupName()); assertFalse(group.endsOnPropertyListStart()); assertTrue(group.endsOnPropertyListEnd()); assertFalse(group.hasProperties()); } @Test public void testEndsOnGroupPropertyName() throws Exception { parse(":do{ rollout groupA( prop"); assertFalse(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); ParsedRolloutPlanHeader rollout = (ParsedRolloutPlanHeader) header; final SingleRolloutPlanGroup group = rollout.getLastGroup(); assertNotNull(group); assertEquals("groupA", group.getGroupName()); assertFalse(group.endsOnPropertyListStart()); assertFalse(group.endsOnPropertyListEnd()); assertTrue(group.hasProperties()); assertFalse(group.endsOnPropertyValueSeparator()); assertEquals("prop", group.getLastPropertyName()); assertNull(group.getLastPropertyValue()); assertEquals(21, group.getLastChunkIndex()); } @Test public void testEndsOnGroupPropertyNameValueSeparator() throws Exception { parse(":do{ rollout groupA( prop ="); assertFalse(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); ParsedRolloutPlanHeader rollout = (ParsedRolloutPlanHeader) header; final SingleRolloutPlanGroup group = rollout.getLastGroup(); assertNotNull(group); assertEquals("groupA", group.getGroupName()); assertFalse(group.endsOnPropertyListStart()); assertFalse(group.endsOnPropertyListEnd()); assertTrue(group.hasProperties()); assertTrue(group.endsOnPropertyValueSeparator()); assertEquals("prop", group.getLastPropertyName()); assertNull(group.getLastPropertyValue()); assertEquals(26, group.getLastSeparatorIndex()); } @Test public void testEndsOnGroupPropertyValue() throws Exception { parse(":do{ rollout groupA( prop = v"); assertFalse(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); ParsedRolloutPlanHeader rollout = (ParsedRolloutPlanHeader) header; final SingleRolloutPlanGroup group = rollout.getLastGroup(); assertNotNull(group); assertEquals("groupA", group.getGroupName()); assertFalse(group.endsOnPropertyListStart()); assertFalse(group.endsOnPropertyListEnd()); assertTrue(group.hasProperties()); assertFalse(group.endsOnPropertyValueSeparator()); assertEquals("prop", group.getLastPropertyName()); assertEquals("v", group.getLastPropertyValue()); assertEquals(28, group.getLastChunkIndex()); } @Test public void testEndsOnGroupPropertySeparator() throws Exception { parse(":do{ rollout groupA( prop = v,"); assertFalse(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); ParsedRolloutPlanHeader rollout = (ParsedRolloutPlanHeader) header; final SingleRolloutPlanGroup group = rollout.getLastGroup(); assertNotNull(group); assertEquals("groupA", group.getGroupName()); assertFalse(group.endsOnPropertyListStart()); assertFalse(group.endsOnPropertyListEnd()); assertTrue(group.hasProperties()); assertFalse(group.endsOnPropertyValueSeparator()); assertNull(group.getLastPropertyName()); assertNull(group.getLastPropertyValue()); assertTrue(group.endsOnPropertySeparator()); assertEquals(29, group.getLastSeparatorIndex()); } @Test public void testRolloutSingleGroupWithProps() throws Exception { //parse("/profile=default/subsystem=threads/thread-factory=mytf:do{ rollout in-series=groupA(rolling-to-servers=true,max-failure-percentage=20)"); parse("/profile=default/subsystem=threads/thread-factory=mytf:do{ rollout groupA(rolling-to-servers=true,max-failure-percentage=20)"); assertTrue(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); final ModelNode node = new ModelNode(); final ModelNode inSeries = node.get(Util.ROLLOUT_PLAN).get(Util.IN_SERIES); final ModelNode groupA = new ModelNode(); final ModelNode groupProps = groupA.get("groupA"); groupProps.get("rolling-to-servers").set("true"); groupProps.get("max-failure-percentage").set("20"); inSeries.add().get(Util.SERVER_GROUP).set(groupA); final ModelNode headersNode = new ModelNode(); header.addTo(ctx, headersNode); assertEquals(node, headersNode); } @Test public void testEndsOnGroupComma() throws Exception { parse(":do{ rollout groupA( prop = v ),"); assertFalse(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); final ParsedRolloutPlanHeader rollout = (ParsedRolloutPlanHeader) header; assertTrue(rollout.endsOnGroupSeparator()); assertEquals(31, rollout.getLastSeparatorIndex()); } @Test public void testEndsOnGroupConcurrent() throws Exception { parse(":do{ rollout groupA( prop = v ) ^"); assertFalse(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); final ParsedRolloutPlanHeader rollout = (ParsedRolloutPlanHeader) header; assertTrue(rollout.endsOnGroupSeparator()); assertEquals(32, rollout.getLastSeparatorIndex()); } @Test public void testNonConcurrentGroups() throws Exception { parse("/profile=default/subsystem=threads/thread-factory=mytf:do{ rollout " + "groupA(rolling-to-servers=true,max-failure-percentage=20) , groupB"); assertTrue(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); final ModelNode node = new ModelNode(); final ModelNode inSeries = node.get(Util.ROLLOUT_PLAN).get(Util.IN_SERIES); ModelNode group = new ModelNode(); final ModelNode groupProps = group.get("groupA"); groupProps.get("rolling-to-servers").set("true"); groupProps.get("max-failure-percentage").set("20"); inSeries.add().get(Util.SERVER_GROUP).set(group); group = new ModelNode(); group.get("groupB"); inSeries.add().get(Util.SERVER_GROUP).set(group); final ModelNode headersNode = new ModelNode(); header.addTo(ctx, headersNode); assertEquals(node, headersNode); } @Test public void testNonConcurrentGroupNames() throws Exception { parse("/profile=default/subsystem=threads/thread-factory=mytf:do{ rollout groupA , groupB"); assertTrue(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); final ModelNode node = new ModelNode(); final ModelNode inSeries = node.get(Util.ROLLOUT_PLAN).get(Util.IN_SERIES); ModelNode group = new ModelNode(); group.get("groupA"); inSeries.add().get(Util.SERVER_GROUP).set(group); group = new ModelNode(); group.get("groupB"); inSeries.add().get(Util.SERVER_GROUP).set(group); final ModelNode headersNode = new ModelNode(); header.addTo(ctx, headersNode); assertEquals(node, headersNode); } @Test public void testTwoConcurrentGroups() throws Exception { parse("/profile=default/subsystem=threads/thread-factory=mytf:do{ rollout " + "groupA(rolling-to-servers=true,max-failure-percentage=20) ^ groupB"); assertTrue(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); final ModelNode node = new ModelNode(); final ModelNode inSeries = node.get(Util.ROLLOUT_PLAN).get(Util.IN_SERIES); final ModelNode concurrent = new ModelNode(); final ModelNode cg = concurrent.get(Util.CONCURRENT_GROUPS); ModelNode group = cg.get("groupA"); group.get("rolling-to-servers").set("true"); group.get("max-failure-percentage").set("20"); group = cg.get("groupB"); inSeries.add().set(concurrent); final ModelNode headersNode = new ModelNode(); header.addTo(ctx, headersNode); assertEquals(node, headersNode); } @Test public void testTwoConcurrentGroupNames() throws Exception { parse("/profile=default/subsystem=threads/thread-factory=mytf:do{ rollout groupA ^ groupB"); assertTrue(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); final ModelNode node = new ModelNode(); final ModelNode inSeries = node.get(Util.ROLLOUT_PLAN).get(Util.IN_SERIES); final ModelNode concurrent = new ModelNode(); final ModelNode cg = concurrent.get(Util.CONCURRENT_GROUPS); cg.get("groupA"); cg.get("groupB"); inSeries.add().set(concurrent); final ModelNode headersNode = new ModelNode(); header.addTo(ctx, headersNode); assertEquals(node, headersNode); } @Test public void testEndsOnHeaderListEnd() throws Exception { parse(":do{ rollout groupA }"); assertFalse(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertTrue(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); final ParsedRolloutPlanHeader rollout = (ParsedRolloutPlanHeader) header; assertFalse(rollout.hasProperties()); // assertTrue(rollout.endsOnPropertyListStart()); } @Test public void testMix() throws Exception { parse("/profile=default/subsystem=threads/thread-factory=mytf:do{ rollout " + "groupA(rolling-to-servers=true,max-failure-percentage=20) ^ groupB, groupC," + "groupD(rolling-to-servers=true,max-failed-servers=1) ^ groupE"); assertTrue(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); final ModelNode node = new ModelNode(); final ModelNode inSeries = node.get(Util.ROLLOUT_PLAN).get(Util.IN_SERIES); ModelNode concurrent = new ModelNode(); ModelNode cg = concurrent.get(Util.CONCURRENT_GROUPS); ModelNode group = cg.get("groupA"); group.get("rolling-to-servers").set("true"); group.get("max-failure-percentage").set("20"); group = cg.get("groupB"); inSeries.add().set(concurrent); ModelNode sg = new ModelNode(); group = sg.get(Util.SERVER_GROUP); group.get("groupC"); inSeries.add().set(sg); concurrent = new ModelNode(); cg = concurrent.get(Util.CONCURRENT_GROUPS); group = cg.get("groupD"); group.get("rolling-to-servers").set("true"); group.get("max-failed-servers").set("1"); group = cg.get("groupE"); inSeries.add().set(concurrent); final ModelNode headersNode = new ModelNode(); header.addTo(ctx, headersNode); assertEquals(node, headersNode); } @Test public void testMixAgainstWholeRequest() throws Exception { parse("/profile=default/subsystem=threads/thread-factory=mytf:do{ rollout " + "groupA(rolling-to-servers=true,max-failure-percentage=20) ^ groupB, groupC," + "groupD(rolling-to-servers=true,max-failed-servers=1) ^ groupE rollback-across-groups}"); assertTrue(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertTrue(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ModelNode op = handler.toOperationRequest(ctx); assertTrue(op.hasDefined(Util.OPERATION_HEADERS)); final ModelNode headersNode = op.get(Util.OPERATION_HEADERS); final ModelNode expectedHeaders = new ModelNode(); final ModelNode rolloutPlan = expectedHeaders.get(Util.ROLLOUT_PLAN); final ModelNode inSeries = rolloutPlan.get(Util.IN_SERIES); ModelNode concurrent = new ModelNode(); ModelNode cg = concurrent.get(Util.CONCURRENT_GROUPS); ModelNode group = cg.get("groupA"); group.get("rolling-to-servers").set("true"); group.get("max-failure-percentage").set("20"); group = cg.get("groupB"); inSeries.add().set(concurrent); ModelNode sg = new ModelNode(); group = sg.get(Util.SERVER_GROUP); group.get("groupC"); inSeries.add().set(sg); concurrent = new ModelNode(); cg = concurrent.get(Util.CONCURRENT_GROUPS); group = cg.get("groupD"); group.get("rolling-to-servers").set("true"); group.get("max-failed-servers").set("1"); cg.get("groupE"); inSeries.add().set(concurrent); rolloutPlan.get("rollback-across-groups").set("true"); assertEquals(expectedHeaders, headersNode); } @Test public void testRolloutIdWithValue() throws Exception { parse(":do{ rollout id = myplan}"); assertFalse(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertTrue(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); final ParsedRolloutPlanHeader rollout = (ParsedRolloutPlanHeader) header; assertEquals("myplan", rollout.getPlanRef()); assertEquals(18, rollout.getLastChunkIndex()); } @Test public void testEndsOnPlanRef() throws Exception { parse(":do{ rollout id="); assertFalse(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); final ParsedRolloutPlanHeader rollout = (ParsedRolloutPlanHeader) header; assertNull(rollout.getPlanRef()); assertFalse(rollout.hasProperties()); assertNull(rollout.getLastGroup()); assertTrue(rollout.endsOnPlanIdValueSeparator()); assertEquals(15, rollout.getLastSeparatorIndex()); } @Test public void testArgumentValueConverter() throws Exception { final ModelNode node = HeadersArgumentValueConverter.INSTANCE.fromString(ctx, "{ rollout " + "groupA(rolling-to-servers=true,max-failure-percentage=20) ^ groupB, groupC," + "groupD(rolling-to-servers=true,max-failed-servers=1) ^ groupE rollback-across-groups}"); final ModelNode expectedHeaders = new ModelNode(); final ModelNode rolloutPlan = expectedHeaders.get(Util.ROLLOUT_PLAN); final ModelNode inSeries = rolloutPlan.get(Util.IN_SERIES); ModelNode concurrent = new ModelNode(); ModelNode cg = concurrent.get(Util.CONCURRENT_GROUPS); ModelNode group = cg.get("groupA"); group.get("rolling-to-servers").set("true"); group.get("max-failure-percentage").set("20"); group = cg.get("groupB"); inSeries.add().set(concurrent); ModelNode sg = new ModelNode(); group = sg.get(Util.SERVER_GROUP); group.get("groupC"); inSeries.add().set(sg); concurrent = new ModelNode(); cg = concurrent.get(Util.CONCURRENT_GROUPS); group = cg.get("groupD"); group.get("rolling-to-servers").set("true"); group.get("max-failed-servers").set("1"); cg.get("groupE"); inSeries.add().set(concurrent); rolloutPlan.get("rollback-across-groups").set("true"); assertEquals(expectedHeaders, node); } @Test public void testRollout() throws Exception { parse(":do{rollout"); assertFalse(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(0, headers.size()); assertEquals("rollout", handler.getLastHeaderName()); } @Test public void testOnlyHeaderListStart() throws Exception { parse("{"); assertFalse(handler.hasAddress()); assertFalse(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertTrue(handler.endsOnSeparator()); assertTrue(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertFalse(handler.hasHeaders()); } @Test public void testImplictBooleanValueInGroupProperties() throws Exception { parse("{rollout grp1(prop1,prop2,prop3,prop4=toto,prop5)}"); assertTrue(handler.getHeaders().size() == 1); final ParsedRolloutPlanHeader rollout = (ParsedRolloutPlanHeader) handler.getHeaders(). iterator().next(); SingleRolloutPlanGroup grp = rollout.getLastGroup(); assertTrue(grp.hasProperty("prop1")); assertTrue(grp.hasProperty("prop2")); assertTrue(grp.hasProperty("prop3")); assertTrue(grp.hasProperty("prop4")); assertTrue(grp.hasProperty("prop5")); ModelNode mn = grp.toModelNode(); assertTrue(mn.get("prop1").asBoolean()); assertTrue(mn.get("prop2").asBoolean()); assertTrue(mn.get("prop3").asBoolean()); assertTrue(mn.get("prop4").asString().equals("toto")); assertTrue(mn.get("prop5").asBoolean()); } protected void parse(String opReq) throws CommandFormatException { handler.reset(); parser.parse(opReq, handler); } }
42.197036
154
0.69531
06ff15bf4f535e90673c66b3f24871dd2623bf67
2,225
swift
Swift
SampleRateBar/AudioManager.swift
hug963/SampleRateBar
3fb841b6f45d98db8867ad0b50979108d81e02a9
[ "MIT" ]
4
2020-06-16T13:15:05.000Z
2020-06-16T14:20:22.000Z
SampleRateBar/AudioManager.swift
hug963/SampleRateBar
3fb841b6f45d98db8867ad0b50979108d81e02a9
[ "MIT" ]
null
null
null
SampleRateBar/AudioManager.swift
hug963/SampleRateBar
3fb841b6f45d98db8867ad0b50979108d81e02a9
[ "MIT" ]
null
null
null
// // AudioManager.swift // SampleRateBar // import Cocoa import CoreAudio class AudioManager { func getSampleRate() -> Float64 { var sampleRate:Float64 = 0 var size:UInt32 = UInt32(MemoryLayout<Float64>.size) var address:AudioObjectPropertyAddress = getAdress(kAudioDevicePropertyNominalSampleRate) AudioObjectGetPropertyData(getCurrentAudioObjectID(), &address, 0, nil, &size, &sampleRate) return sampleRate; } func setSampleRate(rate: AudioValueRange) { var inputSampleRate:AudioValueRange = rate var address:AudioObjectPropertyAddress = getAdress(kAudioDevicePropertyNominalSampleRate) AudioObjectSetPropertyData(getCurrentAudioObjectID(), &address, 0, nil, UInt32(MemoryLayout<AudioValueRange>.size), &inputSampleRate) } func getAvailableSampleRates() -> [AudioValueRange] { let id = getCurrentAudioObjectID() var address:AudioObjectPropertyAddress = getAdress(kAudioDevicePropertyAvailableNominalSampleRates) var dataSize:UInt32 = 0 AudioObjectGetPropertyDataSize(id, &address, 0, nil, &dataSize) let valueCount:UInt32 = dataSize / UInt32(MemoryLayout<AudioValueRange>.size) var values:[AudioValueRange] = Array<AudioValueRange>(repeating: AudioValueRange(), count: Int(valueCount)) AudioObjectGetPropertyData(id, &address, 0, nil, &dataSize, &values) return values } func getCurrentAudioObjectID() -> AudioObjectID { var size:UInt32 = UInt32(MemoryLayout<AudioObjectID>.size) var deviceID:AudioObjectID = kAudioDeviceUnknown var address:AudioObjectPropertyAddress = getAdress(kAudioHardwarePropertyDefaultOutputDevice) AudioObjectGetPropertyData(AudioObjectID(kAudioObjectSystemObject), &address, 0, nil, &size, &deviceID); return deviceID; } func getAdress(_ selector:AudioObjectPropertySelector) -> AudioObjectPropertyAddress { var address:AudioObjectPropertyAddress = AudioObjectPropertyAddress() address.mSelector = selector address.mScope = kAudioObjectPropertyScopeGlobal address.mElement = kAudioObjectPropertyElementMaster return address } }
35.31746
141
0.731685
f4b3dd59d149d7ba65da6ba574f2d5910dfb0467
7,900
ts
TypeScript
workspace/projects/sys/src-ide/app/systab-detail/sys-disk/sys-disk.component.ts
kunpengcompute/devkit-vscode-plugin
b83e4df94cfa431aea83bdedb84f9b7a588e5f55
[ "Apache-2.0" ]
null
null
null
workspace/projects/sys/src-ide/app/systab-detail/sys-disk/sys-disk.component.ts
kunpengcompute/devkit-vscode-plugin
b83e4df94cfa431aea83bdedb84f9b7a588e5f55
[ "Apache-2.0" ]
null
null
null
workspace/projects/sys/src-ide/app/systab-detail/sys-disk/sys-disk.component.ts
kunpengcompute/devkit-vscode-plugin
b83e4df94cfa431aea83bdedb84f9b7a588e5f55
[ "Apache-2.0" ]
null
null
null
import { Component, OnInit, Input, ViewChild, AfterViewInit, Output, EventEmitter, } from '@angular/core'; import { AxiosService } from '../../service/axios.service'; import { I18nService } from '../../service/i18n.service'; import { MytipService } from '../../service/mytip.service'; import { VscodeService } from '../../service/vscode.service'; @Component({ selector: 'app-sys-disk', templateUrl: './sys-disk.component.html', styleUrls: ['./sys-disk.component.scss'] }) export class SysDiskComponent implements OnInit, AfterViewInit { constructor( public Axios: AxiosService, public i18nService: I18nService, public mytip: MytipService, public vscodeService: VscodeService) { this.i18n = this.i18nService.I18n(); } @Input() taskid: any; @Input() nodeid: any; @Input() timeLine: any; @Output() public diskSelectData = new EventEmitter<any>(); @Output() public ZoomData = new EventEmitter<any>(); @Output() public sysDiskEchartsInstOut = new EventEmitter<any>(); public i18n: any; @ViewChild('disk', { static: false }) disk; public devOption = [ ]; public devSelected: any; public typeSelected: any; public typeOption = [ ]; public diskData: any; // 存储echarts需要的数据 public diskEchartData = []; // 存储echarts需要的数据 public resData: any; public diskShow = true; // 块设备是否展示 public showLoading = false; /** * 页面初始化时执行 */ ngOnInit() { } /** * 下载 */ public downloadCsv1() { let str = ''; this.diskData.spec.forEach((el, index) => { str += this.i18n.sys.selBlock + ',' + el.label + '\n' + ','; this.diskData.data.time.forEach(ele => { str += ele + ','; }); str += '\n'; this.diskData.key.forEach(val => { str += val.label + ','; this.diskData.data.values[el.id][val.label].forEach(element => { str += element + ','; }); str += '\n'; }); str += '\n'; }); // encodeURIComponent解决中文乱码 const uri = 'data:text/csv;charset=utf-8,\ufeff' + encodeURIComponent(str); // 通过创建a标签实现 const link = document.createElement('a'); link.href = uri; // 对下载的文件命名 link.download = this.i18n.sys.titles.diskBlock + '.csv'; document.body.appendChild(link); link.click(); document.body.removeChild(link); } /** * 页面初始化后执行 */ ngAfterViewInit() { this.getData(); } /** * devChange */ public devChange(e) { this.diskShow = e.show; if (!e.show || !e.change) { // 如果不展示平均负载 筛选没有变化 直接结束 return; } this.devSelected = e.data; this.setDiskData(); this.devOption.forEach(item => { if (this.devSelected.length === 1) { if (item.id === this.devSelected[0].id) { item.disabled = true; } } else { item.disabled = false; } }); if (this.devSelected.length !== 0 && this.typeSelected.length !== 0) { setTimeout(() => { this.disk.initTable(); }, 0); } } /** * typeChange */ public typeChange(e) { this.diskShow = e.show; if (!e.show || !e.change) { // 如果不展示平均负载 筛选没有变化 直接结束 return; } this.typeSelected = e.data; this.setDiskData(); this.typeOption.forEach(item => { if (this.typeSelected.length === 1) { if (item.id === this.typeSelected[0].id) { item.disabled = true; } } else { item.disabled = false; } }); if (this.typeSelected.length !== 0 && this.devSelected.length !== 0) { setTimeout(() => { this.disk.initTable(); }, 0); } } /** * getData */ public async getData() { this.showLoading = true; const params1 = { 'node-id': this.nodeid, 'query-type': 'detail', 'query-target': 'disk_usage' // 例如cpu_usage, cpu_avgload, mem_usage等 }; this.vscodeService.get({ url: '/tasks/' + this.taskid + '/sys-performance/?' + this.Axios.converUrl(params1) }, (usageResp: any) => { this.resData = usageResp.data; this.diskSelectData.emit({ allData: this.resData, newData: this.devSelected, type: 3 }); this.initDatas(); this.showLoading = false; }); } /** * initDatas */ public initDatas() { this.initDevOption(this.resData.spec); this.initTypeOption(this.resData.key); for (const key of Object.keys(this.resData.origin_data.values)) { for (const key2 of Object.keys(this.resData.origin_data.values[key])) { if (key2 === 'util') { this.resData.origin_data.values[key][key2] = this.resData.origin_data.values[key][key2].map(item => item * 100); } } } this.setDiskData(); } /** * initDevOption */ public initDevOption(data) { this.devOption = []; this.devSelected = []; if (data.length > 0) { data.forEach(item => { this.devOption.push({ label: item, id: item }); }); this.devOption.forEach((item: any, index: number) => { if (index < 5) { this.devSelected.push(item); this.devOption[index].disabled = true; } }); } this.diskSelectData.emit({ allData: this.devOption, newData: this.devSelected, type: 1, diskShow: this.diskShow }); } /** * initTypeOption */ public initTypeOption(data) { this.typeOption = []; if (data.length > 0) { data.forEach(item => { this.typeOption.push({ label: item, id: item }); }); this.typeOption[0].disabled = true; this.typeSelected = [this.typeOption[0]]; } this.diskSelectData.emit({ allData: this.typeOption, newData: this.typeSelected, type: 2 }); } /** * setDiskData */ public setDiskData() { this.diskData = {}; const diskEchartData = []; this.diskEchartData = []; this.typeSelected.forEach(element => { const option = { spec: [...this.devSelected], key: [...[element]], data: this.resData.origin_data, title: 'CPU Usage', type: 'disk' }; diskEchartData.push(option); }); this.diskEchartData = diskEchartData; } /** * initializationData */ public initializationData() { this.diskSelectData.emit({ allData: this.devOption, newData: this.devSelected, type: 1, diskShow: this.diskShow }); this.diskSelectData.emit({ allData: this.typeOption, newData: this.typeSelected, type: 2 }); } /** * 时间轴筛选 */ public upDataTimeLine(data) { if (this.diskShow) { this.disk.upDateTimeLine(data); } } /** * 数据筛选 更新时间轴 */ public dataZoom(e) { this.ZoomData.emit(e); } /** * 由子组件传递echartsInst */ public echartsInstOut(e) { this.sysDiskEchartsInstOut.emit(e); } }
27.526132
106
0.496329
ad67dff4076e313efb35fa191ffdddd9925ade63
5,295
sql
SQL
documentacion/Dist/loginmaildb.sql
jorgedipra/loginMail
0e917726fb59fd97ccdfbc9e2f0c254d32dce617
[ "MIT" ]
null
null
null
documentacion/Dist/loginmaildb.sql
jorgedipra/loginMail
0e917726fb59fd97ccdfbc9e2f0c254d32dce617
[ "MIT" ]
1
2021-06-22T15:40:49.000Z
2021-06-22T15:40:50.000Z
documentacion/Dist/loginmaildb.sql
jorgedipra/loginMail
0e917726fb59fd97ccdfbc9e2f0c254d32dce617
[ "MIT" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 4.8.4 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 02-03-2020 a las 21:05:17 -- Versión del servidor: 10.1.37-MariaDB -- Versión de PHP: 5.6.39 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 */; -- -- Base de datos: `loginmaildb` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `lg_estadocivil` -- CREATE TABLE `lg_estadocivil` ( `Id` int(11) NOT NULL, `Nombre` varchar(30) COLLATE utf8_bin NOT NULL, `Anotacion` text COLLATE utf8_bin NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- -- Volcado de datos para la tabla `lg_estadocivil` -- INSERT INTO `lg_estadocivil` (`Id`, `Nombre`, `Anotacion`) VALUES (1, 'Casado(a)', ''), (2, 'Soltero(a)', ''), (3, 'Unión Marital', 'En Colombia, la Unión Marital de Hecho ha sido reconocida recientemente por la Corte Suprema de Justicia como un tercer estado civil.'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `lg_identificacion` -- CREATE TABLE `lg_identificacion` ( `Id` int(11) NOT NULL, `Nombre` varchar(30) COLLATE utf8_bin NOT NULL, `Acronimo` varchar(5) COLLATE utf8_bin NOT NULL, `Creada` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `Modificada` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- -- Volcado de datos para la tabla `lg_identificacion` -- INSERT INTO `lg_identificacion` (`Id`, `Nombre`, `Acronimo`, `Creada`, `Modificada`) VALUES (1, ' Cédula de Ciudadanía', 'C.C.', '2020-03-02 12:09:20', NULL), (2, 'Cédula de Extranjería', 'CE', '2020-03-02 12:11:24', NULL), (3, 'Pasaporte', 'PA', '2020-03-02 12:11:24', NULL), (4, 'Cédula de Extranjería', 'CE', '2020-03-02 12:11:33', NULL), (5, 'Pasaporte', 'PA', '2020-03-02 12:11:33', NULL), (6, 'Tarjeta de Identidad', 'TI', '2020-03-02 12:12:39', NULL); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `lg_login` -- CREATE TABLE `lg_login` ( `Id` int(11) NOT NULL, `Id_usuario` int(11) NOT NULL, `User` varchar(30) COLLATE utf8_bin NOT NULL COMMENT 'Usuario', `Pass` varchar(100) COLLATE utf8_bin NOT NULL COMMENT 'Contraseña', `Creada` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `Modificada` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `lg_usuarios` -- CREATE TABLE `lg_usuarios` ( `Id` int(11) NOT NULL, `Id_Identificacion` int(11) NOT NULL COMMENT 'tipo identificación', `nombre` varchar(30) COLLATE utf8_bin NOT NULL, `Apellido` varchar(30) COLLATE utf8_bin NOT NULL, `FechaN` datetime NOT NULL, `Id_estadoCivil` int(11) NOT NULL, `Firma` text COLLATE utf8_bin NOT NULL, `Foto` text COLLATE utf8_bin NOT NULL, `Creada` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `Modificada` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `lg_estadocivil` -- ALTER TABLE `lg_estadocivil` ADD PRIMARY KEY (`Id`), ADD KEY `Id` (`Id`); -- -- Indices de la tabla `lg_identificacion` -- ALTER TABLE `lg_identificacion` ADD PRIMARY KEY (`Id`), ADD KEY `Id` (`Id`); -- -- Indices de la tabla `lg_login` -- ALTER TABLE `lg_login` ADD PRIMARY KEY (`Id`), ADD UNIQUE KEY `User_index` (`User`), ADD KEY `Id_usuario` (`Id_usuario`); -- -- Indices de la tabla `lg_usuarios` -- ALTER TABLE `lg_usuarios` ADD PRIMARY KEY (`Id`), ADD KEY `Id_Identificacion` (`Id_Identificacion`), ADD KEY `lg_usuarios_civilFk` (`Id_estadoCivil`); -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `lg_estadocivil` -- ALTER TABLE `lg_estadocivil` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT de la tabla `lg_identificacion` -- ALTER TABLE `lg_identificacion` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT de la tabla `lg_login` -- ALTER TABLE `lg_login` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `lg_usuarios` -- ALTER TABLE `lg_usuarios` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT; -- -- Restricciones para tablas volcadas -- -- -- Filtros para la tabla `lg_login` -- ALTER TABLE `lg_login` ADD CONSTRAINT `lg_login_userFk` FOREIGN KEY (`Id_usuario`) REFERENCES `lg_usuarios` (`Id`); -- -- Filtros para la tabla `lg_usuarios` -- ALTER TABLE `lg_usuarios` ADD CONSTRAINT `lg_usuarios_civilFk` FOREIGN KEY (`Id_estadoCivil`) REFERENCES `lg_estadocivil` (`Id`), ADD CONSTRAINT `lg_usuarios_identFk_1` FOREIGN KEY (`Id_Identificacion`) REFERENCES `lg_identificacion` (`ID`); 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 */;
28.015873
158
0.679698
fac0fa6f6d25eae2b2bad59621df61bcb4afbcf1
398
swift
Swift
ServicePermissions/Sources/ServicePermissions.swift
sjsoad/ServicePermission
07ea15e15020222abc2614f82f1aa13046314719
[ "MIT" ]
null
null
null
ServicePermissions/Sources/ServicePermissions.swift
sjsoad/ServicePermission
07ea15e15020222abc2614f82f1aa13046314719
[ "MIT" ]
null
null
null
ServicePermissions/Sources/ServicePermissions.swift
sjsoad/ServicePermission
07ea15e15020222abc2614f82f1aa13046314719
[ "MIT" ]
null
null
null
// // ServicePermissions.swift // SKUtilsSwift // // Created by Sergey Kostyan on 25.09.16. // Copyright © 2016 Sergey Kostyan. All rights reserved. // import Foundation import UIKit public protocol ServicePermissions { associatedtype PermissionsState func permissionsState() -> PermissionsState func requestPermissions(handler: @escaping (PermissionsState) -> Void) }
19.9
74
0.728643
c36761904df67bae8d88059786d5fb5aeedd0f99
521
cs
C#
backend/dotnet/ticketflow/TicketFlow.MovieService.Client/Extensibility/Models/MovieModels/MovieSerializationModel.cs
ArtemK123/Ticket_Flow
56ee7eed81b2a09e82d7c016c502aede2be9f016
[ "MIT" ]
2
2021-07-29T14:25:36.000Z
2022-01-26T22:32:23.000Z
backend/dotnet/ticketflow/TicketFlow.MovieService.Client/Extensibility/Models/MovieModels/MovieSerializationModel.cs
ArtemK123/Ticket_Flow
56ee7eed81b2a09e82d7c016c502aede2be9f016
[ "MIT" ]
3
2022-02-16T01:13:49.000Z
2022-02-16T01:14:32.000Z
backend/dotnet/ticketflow/TicketFlow.MovieService.Client/Extensibility/Models/MovieModels/MovieSerializationModel.cs
ArtemK123/Ticket_Flow
56ee7eed81b2a09e82d7c016c502aede2be9f016
[ "MIT" ]
1
2021-01-21T18:53:11.000Z
2021-01-21T18:53:11.000Z
using System; using TicketFlow.MovieService.Client.Extensibility.Models.CinemaHallModels; using TicketFlow.MovieService.Client.Extensibility.Models.FilmModels; namespace TicketFlow.MovieService.Client.Extensibility.Models.MovieModels { public class MovieSerializationModel { public int Id { get; set; } public DateTime StartTime { get; set; } public FilmSerializationModel Film { get; set; } public CinemaHallSerializationModel CinemaHall { get; set; } } }
30.647059
76
0.721689
669b3263fa7547cbaf46f61af53f0492a5b7e8e5
9,845
ps1
PowerShell
MicrosoftTeams/Get-TeamsServiceNumbers.ps1
ntv-one/PowerShell-collection
9bef03bd78dbabf0851ac7b61feb6ba8760d8292
[ "BSD-3-Clause" ]
1
2021-11-12T05:44:04.000Z
2021-11-12T05:44:04.000Z
MicrosoftTeams/Get-TeamsServiceNumbers.ps1
native-it/PowerShell-collection
9bef03bd78dbabf0851ac7b61feb6ba8760d8292
[ "BSD-3-Clause" ]
null
null
null
MicrosoftTeams/Get-TeamsServiceNumbers.ps1
native-it/PowerShell-collection
9bef03bd78dbabf0851ac7b61feb6ba8760d8292
[ "BSD-3-Clause" ]
null
null
null
function Get-TeamsServiceNumbers { <# .SYNOPSIS Get the Phone numbers assigned to Teams/SfB Services .DESCRIPTION Get the Phone numbers assigned to Teams/SfB Services Supported are AutoAttendant and/or CallQueue .PARAMETER AutoAttendant Get the numbers assigned to AutoAttendant(s) .PARAMETER CallQueue Get the numbers assigned to CallQueue(s) .PARAMETER All Get all Numbers, assignee to AutoAttendant(s) and CallQueue(s) .PARAMETER LeaveTel Normally the function dumps phone numbers with a stripped tel: With this switch the function will dump it with the leading tel: .PARAMETER Export Export the result to a CSV .PARAMETER Path Path for the CSV Export .EXAMPLE PS C:\> Get-TeamsServiceNumbers -All Get all Services numbers, AutoAttendant(s) and CallQueue(s), and dump them to the terminal .EXAMPLE PS C:\> Get-TeamsServiceNumbers -All -Export -Path '.\TeamsServiceNumbers.csv' Get all Services numbers, AutoAttendant(s) and CallQueue(s), and export them to the given CSV file '.\TeamsServiceNumbers.csv' TeamsServiceNumbers.csv is in the directory where the user is right now (and calls the function) .EXAMPLE PS C:\> Get-TeamsServiceNumbers -All -Export -Path 'c:\temp\TeamsServiceNumbers.csv' Get all Services numbers, AutoAttendant(s) and CallQueue(s), and export them to the given CSV file 'c:\temp\TeamsServiceNumbers.csv' .EXAMPLE PS C:\> Get-TeamsServiceNumbers -All -Export Get all Services numbers, AutoAttendant(s) and CallQueue(s), and export them to a CSV The funtion will ask for the Path to the CSV File .EXAMPLE PS C:\> Get-TeamsServiceNumbers -AutoAttendant Get all AutoAttendant(s) Services numbers and dump them to the terminal .EXAMPLE PS C:\> Get-TeamsServiceNumbers -AA Get all AutoAttendant(s) Services numbers and dump them to the terminal Same as above, but use the Alias (Shorter) .EXAMPLE PS C:\> Get-TeamsServiceNumbers -CallQueue Get all CallQueue(s) Services numbers and dump them to the terminal .EXAMPLE PS C:\> Get-TeamsServiceNumbers -CQ Get all CallQueue(s) Services numbers and dump them to the terminal Same as above, but use the Alias (Shorter) .NOTES Additional information about the function. #> [CmdletBinding(DefaultParameterSetName = 'AllNumbers', ConfirmImpact = 'None')] [OutputType([psobject])] param ( [Parameter(ParameterSetName = 'AANumbers', ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [Alias('AA')] [switch] $AutoAttendant = $null, [Parameter(ParameterSetName = 'CQNumbers', ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [Alias('CQ')] [switch] $CallQueue = $null, [Parameter(ParameterSetName = 'AllNumbers', ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [Alias('Any')] [switch] $All, [Parameter(ParameterSetName = '__AllParameterSets', ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [switch] $LeaveTel = $null, [Parameter(ParameterSetName = '__AllParameterSets', ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [Alias('ExportCsv', 'CSV')] [switch] $Export = $false ) dynamicparam { if ($PSBoundParameters['Export']) { # The PATH parameter is only needed if -Export is given $PathAttribute = New-Object System.Management.Automation.ParameterAttribute $PathAttribute.Mandatory = $true $PathAttribute.HelpMessage = "Path for the CSV Export:" $PathAttribute.ValueFromPipeline = $true $PathAttribute.ValueFromPipelineByPropertyName = $true $PathAttribute.ParameterSetName = '__AllParameterSets' $attributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] $attributeCollection.Add($PathAttribute) $PathParam = New-Object System.Management.Automation.RuntimeDefinedParameter('Path', [String], $attributeCollection) $paramDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary $paramDictionary.Add('Path', $PathParam) $paramDictionary } } begin { switch ($PsCmdlet.ParameterSetName) { 'AANumbers' { $AutoAttendant = $true } 'CQNumbers' { $CallQueue = $true } 'AllNumbers' { $All = $true } default { $All = $true } } if ($PSBoundParameters.Path) { $Path = $PSBoundParameters.Path } $NumberReport = @() } process { if (($AutoAttendant) -or ($All)) { foreach ($AA in (Get-CsAutoAttendant -ErrorAction Continue)) { foreach ($AppInstance in $AA.ApplicationInstances) { $AAName = $AA.Name $AppPhoneNum = $null if ($LeaveTel) { $AppPhoneNum = ((Get-CsOnlineApplicationInstance -Identity $AppInstance -ErrorAction Continue).PhoneNumber) } else { $AppPhoneNum = (((Get-CsOnlineApplicationInstance -Identity $AppInstance -ErrorAction Continue).PhoneNumber).replace('tel:', '')) } Write-Verbose ('AutoAttendant ' + $AA.Name + ' has ' + $AppPhoneNum + ' assigned') $NewRow = $null $NewRow = [PSCustomObject][ordered]@{ Name = ($AA.Name) Number = ($AppPhoneNum) Type = 'AutoAttendant' } $NumberReport += $newrow } } } if (($CallQueue) -or ($All)) { foreach ($CQ in (Get-CsCallQueue -ErrorAction Continue)) { foreach ($AppInstance in $CQ.ApplicationInstances) { $CQName = $null $CQName = $CQ.Name $AppPhoneNum = $null if ($LeaveTel) { $AppPhoneNum = ((Get-CsOnlineApplicationInstance -Identity $AppInstance -ErrorAction Continue).PhoneNumber) } else { $AppPhoneNum = (((Get-CsOnlineApplicationInstance -Identity $AppInstance -ErrorAction Continue).PhoneNumber).replace('tel:', '')) } Write-Verbose ('CallQueue ' + $CQ.Name + ' has ' + $AppPhoneNum + ' assigned') $NewRow = $null $NewRow = [PSCustomObject][ordered]@{ Name = ($CQ.Name) Number = ($AppPhoneNum) Type = 'CallQueue' } $NumberReport += $newrow } } } } end { if (($PSBoundParameters['Export']) -or ($Path)) { $NumberReport | Export-Csv -Path $Path -NoTypeInformation -Encoding UTF8 -ErrorAction Stop -WarningAction Continue Write-Verbose -Message $NumberReport } else { $NumberReport } } } #region LICENSE <# BSD 3-Clause License Copyright (c) 2020, enabling Technology 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. 3. Neither the name of the copyright holder 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 HOLDER 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. #> #endregion LICENSE #region DISCLAIMER <# DISCLAIMER: - Use at your own risk, etc. - This is open-source software, if you find an issue try to fix it yourself. There is no support and/or warranty in any kind - This is a third-party Software - The developer of this Software is NOT sponsored by or affiliated with Microsoft Corp (MSFT) or any of its subsidiaries in any way - The Software is not supported by Microsoft Corp (MSFT) - By using the Software, you agree to the License, Terms, and any Conditions declared and described above - If you disagree with any of the Terms, and any Conditions declared: Just delete it and build your own solution #> #endregion DISCLAIMER
35.67029
761
0.627222
da6bd779f656e772ca1d0e4b2818b6616dc59d36
22,951
php
PHP
resources/views/admin/product.blade.php
rendhynovinez/philigrosir
40b776e18cca9c5d5276303c6b33d10d6a64a024
[ "MIT" ]
null
null
null
resources/views/admin/product.blade.php
rendhynovinez/philigrosir
40b776e18cca9c5d5276303c6b33d10d6a64a024
[ "MIT" ]
null
null
null
resources/views/admin/product.blade.php
rendhynovinez/philigrosir
40b776e18cca9c5d5276303c6b33d10d6a64a024
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html lang="en"> @include('header.header') <!-- BODY TAG OPTIONS: ================= Apply one or more of the following classes to to the body tag to get the desired effect |---------------------------------------------------------| |LAYOUT OPTIONS | sidebar-collapse | | | sidebar-mini | |---------------------------------------------------------| --> <body class="hold-transition sidebar-mini" id="Identity-check"> <div class="wrapper"> @include('navbar.navbar') @include('sidebar.sidebar') <div class="content-wrapper"> <div id="loading"></div> <!-- Content Header (Page header) --> <section class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <h1>Product</h1> </div> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item"><a href="#">Home</a></li> <li class="breadcrumb-item active">Product</li> </ol> </div> </div> </div><!-- /.container-fluid --> </section> <!-- Main content --> <section class="content"> <div id="download_pdf_data" class="container-fluid"> <div class="row"> <!-- right column --> <div class="col-md-12"> <div class="card card-danger"> <div class="card-header back-ops-okp2p"> <h3 class="card-title">Toolbox</h3> </div> <!-- /.card-header --> <div class="card-body"> <a type='button' href="javascript:void(0)" class="btn btn-lg btn-danger" id="create-new-product"> <span><i class="fas fa-boxes"></i> Add Product</span></a> </div> </div> </div> <!--/.col (right) --> </div> <div class ="row"> <div class="col-md-12"> <!-- Main content --> <section class="content"> <div class="container-fluid"> <div class="row"> <div class="col-12" id="tablelistproduct"> <div class="card"> <div class="card-header bg-danger back-ops-okp2p"> <h3 class="card-title"><b>List Product </b></h3> </div> <div class="card-body"> <table id="listproduct" class="table table-striped table-bordered table-hover" style="width:100%"> <thead> <tr> <th>No</th> <th style="display: none">ID</th> <th style="display: none">IMG</th> <th>Title</th> <th>Subtitle</th> <th>Description</th> <th>Price</th> <th>Updated At</th> <th style="display: none">Weight</th> <th style="display: none">Length</th> <th style="display: none">Height</th> <th style="display: none">Width</th> </tr> </thead> <tbody> <?php $no=1; ?> @foreach ($products as $product) <tr> <td>{{ $no++ }}</td> <td style="display: none">{{ $product->id }}</td> <td style="display: none">{{ $product->img }}</td> <td>{{ $product->title }}</td> <td>{{ $product->subtitle }}</td> <td>{{ $product->description }}</td> <td>{{ $product->price }}</td> <td>{{ $product->updated_at }}</td> <td style="display: none">{{ $product->weight }}</td> <td style="display: none">{{ $product->length }}</td> <td style="display: none">{{ $product->height }}</td> <td style="display: none">{{ $product->width }}</td> </tr> @endforeach </tbody> </table> </div> </div> </div> <!-- /.card-body --> <!-- left column --> <div class="col-md-4" id="detailproduct"> <div class="card card-danger"> <div class="card-header back-ops-okp2p"> <h3 class="card-title">Detail Product</h3> </div> <!-- /.card-header --> <div class="card-body"> <form class="form-horizontal" method="POST" action="{{ route('product-edit') }}" enctype="multipart/form-data"> {{ csrf_field() }} {{ method_field('PUT') }} <input type="hidden" name="id" id="id"> <!-- <div class="form-group"> <label for="bg" class="col-sm-12 control-label">BG</label> <div class="col-sm-12"> <input type="text" class="form-control @error('bg') is-invalid @enderror" id="bg" name="bg" placeholder="Enter Bg" value="" maxlength="50" required=""> </div> </div> --> <div class="form-group"> <label for="img" class="col-sm-12 control-label">Image</label> <div class="col-sm-12"> <input type="file" id="img" name="img"> </div> </div> <div class="form-group"> <label for="title" class="col-sm-12 control-label">Title</label> <div class="col-sm-12"> <input type="text" class="form-control @error('title') is-invalid @enderror" id="title" name="title" placeholder="Enter title" value="" required=""> </div> </div> <div class="form-group"> <label for="title" class="col-sm-12 control-label">Subtitle</label> <div class="col-sm-12"> <input type="text" class="form-control @error('subtitle') is-invalid @enderror" id="subtitle" name="subtitle" placeholder="Enter subtitle" value="" required=""> </div> </div> <div class="form-group"> <label for="title" class="col-sm-12 control-label">Description</label> <div class="col-sm-12"> <input type="text" class="form-control @error('description') is-invalid @enderror" id="description" name="description" placeholder="Enter subtitle" value="" required=""> </div> </div> <div class="form-group"> <label for="title" class="col-sm-12 control-label">Price</label> <div class="col-sm-12"> <input type="text" class="form-control @error('price') is-invalid @enderror" id="price" name="price" placeholder="Enter price" value="" required=""> </div> </div> <div class="form-group"> <label for="title" class="col-sm-12 control-label">Weight</label> <div class="col-sm-12"> <input type="text" class="form-control @error('weight') is-invalid @enderror" id="weight" name="weight" placeholder="Enter weight" value="" required=""> </div> </div> <div class="form-group"> <label for="title" class="col-sm-12 control-label">Length</label> <div class="col-sm-12"> <input type="text" class="form-control @error('length') is-invalid @enderror" id="length" name="length" placeholder="Enter Length" value="" required=""> </div> </div> <div class="form-group"> <label for="title" class="col-sm-12 control-label">Height</label> <div class="col-sm-12"> <input type="text" class="form-control @error('height') is-invalid @enderror" id="height" name="height" placeholder="Enter Height" value="" required=""> </div> </div> <div class="form-group"> <label for="title" class="col-sm-12 control-label">Width</label> <div class="col-sm-12"> <input type="text" class="form-control @error('width') is-invalid @enderror" id="width" name="width" placeholder="Enter Width" value="" required=""> </div> </div> <div class="form-group"> <label for="is_active" class="col-sm-12 control-label">Status</label> <div class="col-sm-12"> <select id="is_active" name="is_active" class="form-control"> <option value="">--- choose Status ---</option> <option value="0">Disabled</option> <option value="1">Enabled</option> </select> @error('is_active') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> </div> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-primary" value="create">Edit</button> </div> </form> </div> </div> </div> <!--/.col (left) --> </div> </div> <!-- /.col --> </div> <!-- /.row --> </div> <!-- /.container-fluid --> </section> </div> </div> <!-- /.row --> </div><!-- /.container-fluid --> </section> <!-- /.content --> {{-- MODALS --}} <div class="modal fade" id="ajax-product-modal" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title" id="productCrudModal"></h4> </div> <div class="modal-body"> <form id="productForm" name="productForm" class="form-horizontal" method="POST" enctype="multipart/form-data" action="{{ route('product-store') }}"> {{ csrf_field() }} <input type="hidden" name="id" id="id"> <!-- <div class="form-group"> <label for="bg" class="col-sm-12 control-label">BG</label> <div class="col-sm-12"> <input type="text" class="form-control @error('bg') is-invalid @enderror" id="bg" name="bg" placeholder="Enter Bg" value="" maxlength="50" required=""> </div> </div> --> <div class="form-group"> <label for="img" class="col-sm-12 control-label">Image</label> <div class="col-sm-12"> <!-- <input type="text" class="form-control @error('img') is-invalid @enderror" id="img" name="img" placeholder="Enter img" value="" required=""> --> <input type="file" id="img" name="img"> </div> </div> <div class="form-group"> <label for="title" class="col-sm-12 control-label">Title</label> <div class="col-sm-12"> <input type="text" class="form-control @error('title') is-invalid @enderror" id="title" name="title" placeholder="Enter title" value="" required=""> </div> </div> <div class="form-group"> <label for="title" class="col-sm-12 control-label">Subtitle</label> <div class="col-sm-12"> <input type="text" class="form-control @error('subtitle') is-invalid @enderror" id="subtitle" name="subtitle" placeholder="Enter subtitle" value="" required=""> </div> </div> <div class="form-group"> <label for="title" class="col-sm-12 control-label">Description</label> <div class="col-sm-12"> <input type="text" class="form-control @error('description') is-invalid @enderror" id="description" name="description" placeholder="Enter subtitle" value="" required=""> </div> </div> <div class="form-group"> <label for="title" class="col-sm-12 control-label">Price</label> <div class="col-sm-12"> <input type="text" class="form-control @error('price') is-invalid @enderror" id="price" name="price" placeholder="Enter price" value="" required=""> </div> </div> <div class="form-group"> <label for="title" class="col-sm-12 control-label">Weight</label> <div class="col-sm-12"> <input type="text" class="form-control @error('weight') is-invalid @enderror" id="weight" name="weight" placeholder="Enter weight" value="" required=""> </div> </div> <div class="form-group"> <label for="title" class="col-sm-12 control-label">Length</label> <div class="col-sm-12"> <input type="text" class="form-control @error('length') is-invalid @enderror" id="length" name="length" placeholder="Enter Length" value="" required=""> </div> </div> <div class="form-group"> <label for="title" class="col-sm-12 control-label">Height</label> <div class="col-sm-12"> <input type="text" class="form-control @error('height') is-invalid @enderror" id="height" name="height" placeholder="Enter Height" value="" required=""> </div> </div> <div class="form-group"> <label for="title" class="col-sm-12 control-label">Width</label> <div class="col-sm-12"> <input type="text" class="form-control @error('width') is-invalid @enderror" id="width" name="width" placeholder="Enter Width" value="" required=""> </div> </div> <div class="form-group"> <label for="is_active" class="col-sm-12 control-label">Status</label> <div class="col-sm-12"> <select id="is_active" name="is_active" class="form-control"> <option value="">--- choose Status ---</option> <option value="0">Disabled</option> <option value="1">Enabled</option> </select> @error('is_active') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> </div> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-danger" id="btn-save" value="create">Add </button> </div> </form> </div> </div> </div> </div> </div> <!-- Control Sidebar --> <aside class="control-sidebar control-sidebar-dark"> <!-- Control sidebar content goes here --> </aside> <!-- /.control-sidebar --> <!-- Main Footer --> @include('footer.tag-footer') </div> @include('footer.footer') </body> </html> @include('js.alert-toast') @include('js.toast-info') <script> var table $(document).ready( function () { $('#detailproduct').hide() $('#toolreset').hide() $('#toolhapus').hide() document.getElementById("tablelistproduct").className = "col-md-12"; table = $('#listproduct').DataTable(); $('#listproduct tbody').on( 'click', 'tr', function () { debugger var dataproduct = table.row( this ).data() $('#detailproduct').show() $('#toolreset').show() $('#toolhapus').show() document.getElementById("tablelistproduct").className = "col-md-8"; $('#id').val(dataproduct[1]) $('#title').val(dataproduct[3]) $('#subtitle').val(dataproduct[4]) $('#description').val(dataproduct[5]) $('#price').val(dataproduct[6]) $('#weight').val(dataproduct[8]) $('#length').val(dataproduct[9]) $('#height').val(dataproduct[10]) $('#width').val(dataproduct[11]) } ); $('#listproduct tbody').on( 'click', 'tr', function () { if ( $(this).hasClass('row_selected') ) { $(this).removeClass('row_selected') $('#detailproduct').hide() $('#toolreset').hide() $('#toolhapus').hide() document.getElementById("tablelistproduct").className = "col-md-12"; $('#id').val('') $('#name').val('') $('#email').val('') $('#permission').val('') } else { table.$('tr.row_selected').removeClass('row_selected'); $(this).addClass('row_selected') } } ); /* When product click add Product button */ $('#create-new-product').click(function () { $('#btn-save').val("create-product") $('#id').val('') $('#productForm').trigger("reset") $('#productCrudModal').html("Add Product Baru") $('#ajax-product-modal').modal('show') }); }); </script>
52.399543
213
0.362032
e36c35a29fae7019d42143413d1182d105d14110
604
rb
Ruby
spec/controllers/application_controller_spec.rb
REANNZ/saml-service
0b1fe0b4e068935b57aa2fb7e5c5786cbad66194
[ "Apache-2.0" ]
null
null
null
spec/controllers/application_controller_spec.rb
REANNZ/saml-service
0b1fe0b4e068935b57aa2fb7e5c5786cbad66194
[ "Apache-2.0" ]
2
2021-05-11T02:39:25.000Z
2021-12-14T04:51:57.000Z
spec/controllers/application_controller_spec.rb
REANNZ/saml-service
0b1fe0b4e068935b57aa2fb7e5c5786cbad66194
[ "Apache-2.0" ]
null
null
null
# frozen_string_literal: true require 'rails_helper' require 'gumboot/shared_examples/application_controller' RSpec.describe ApplicationController, type: :controller do # HACK: We can't use these examples until we can use AAF Lipstick. We're # currently using Sequel instead of ActiveRecord, but Lipstick requires the # latter, so that's not an option at this juncture. # include_examples 'Application controller' describe 'health' do def run get 'health' end it 'responds with status code 200' do run expect(response.body).to include('ok') end end end
25.166667
77
0.730132
46b9e2f93e2fccf21df8f856ad447afa70a907cd
2,244
py
Python
threeML/config/config_utils.py
jasonfan1997/threeML
21b1c76ad3423f745b9f56413d93ee01d1d5855f
[ "BSD-3-Clause" ]
42
2019-01-10T06:11:38.000Z
2022-03-21T20:08:37.000Z
threeML/config/config_utils.py
jasonfan1997/threeML
21b1c76ad3423f745b9f56413d93ee01d1d5855f
[ "BSD-3-Clause" ]
187
2019-01-15T13:21:16.000Z
2022-03-31T12:15:55.000Z
threeML/config/config_utils.py
jasonfan1997/threeML
21b1c76ad3423f745b9f56413d93ee01d1d5855f
[ "BSD-3-Clause" ]
32
2019-01-14T10:24:56.000Z
2022-03-10T10:09:59.000Z
from collections import OrderedDict from pathlib import Path from typing import Any, Dict, Optional from asciitree import LeftAligned from asciitree.drawing import BOX_DOUBLE, BoxStyle from omegaconf import OmegaConf from omegaconf.dictconfig import DictConfig from threeML.io.package_data import get_path_of_user_config from .config import threeML_config def red(x) -> str: return f"\x1b[31;1m{x}\x1b[0m" def blue(x) -> str: return f"\x1b[34;1m{x}\x1b[0m" def green(x) -> str: return f"\x1b[32;1m{x}\x1b[0m" def _to_dict(conf): if not isinstance(conf, DictConfig): dummy: Dict[str, Dict[str, Any]] = {} dummy[red(f"{conf}")] = {} return dummy else: out: Dict[str, Dict[str, Any]] = {} for k, v in conf.items(): if not isinstance(v, DictConfig): text = blue(f"{k}") else: text = green(f"{k}") out[text] = _to_dict(v) return out def show_configuration(sub_menu: Optional[str] = None): """ display the current configuration or a sub menu if provided """ tr = LeftAligned(draw=BoxStyle(gfx=BOX_DOUBLE, horiz_len=1)) out_final = {} if sub_menu is None: out_final["CONFIG"] = _to_dict(threeML_config) else: assert sub_menu in threeML_config, "not a valild topic" out_final[sub_menu] = _to_dict(threeML_config[sub_menu]) print(tr(out_final)) def get_current_configuration_copy(file_name: str = "threeML_config.yml", overwrite: bool = False): """ write a copy of the CURRENT configuration to the config directory """ outfile: Path = get_path_of_user_config() / file_name if outfile.exists() and (not overwrite): raise RuntimeError(f"{outfile} exists! Set overwrite to True") else: _read_only_keys = ["LAT", "GBM", "catalogs"] _valid_keys = [] for k, v in threeML_config.items(): if k not in _read_only_keys: _valid_keys.append(k) config_copy = OmegaConf.masked_copy(threeML_config, _valid_keys) with outfile.open("w") as f: f.write(OmegaConf.to_yaml(config_copy, sort_keys=True, resolve=True))
20.777778
99
0.634581
742415dc2d1cbcae6aa48679f5ef501cefc0776e
1,321
go
Go
matching/signatures.go
narendrakadali/gitrob
0eef84a9446c55265a3988cb05fc880f42bf014b
[ "MIT" ]
3
2021-05-13T20:03:49.000Z
2021-09-12T07:30:56.000Z
matching/signatures.go
narendrakadali/gitrob
0eef84a9446c55265a3988cb05fc880f42bf014b
[ "MIT" ]
null
null
null
matching/signatures.go
narendrakadali/gitrob
0eef84a9446c55265a3988cb05fc880f42bf014b
[ "MIT" ]
3
2021-03-29T17:48:21.000Z
2021-12-28T02:59:25.000Z
// Package matching contains specific functionality elated to scanning and detecting secrets within the given input. package matching import ( "encoding/json" "errors" "fmt" "gitrob/common" "io/ioutil" ) // Signatures holds a list of all signatures used during the session type Signatures struct { FileSignatures []FileSignature ContentSignatures []ContentSignature } // loadSignatures will check for a signature file to exist in a known location and load it if it is found. func (s *Signatures) loadSignatures(path string) error { if !common.FileExists(path) { return errors.New(fmt.Sprintf("Missing signature file: %s.\n", path)) } data, readError := ioutil.ReadFile(path) if readError != nil { return readError } if unmarshalError := json.Unmarshal(data, &s); unmarshalError != nil { return unmarshalError } return nil } // Load will load all known signatures for the various match types into the session func (s *Signatures) Load(mode int) error { var e error if mode != 3 { e = s.loadSignatures("./rules/filesignatures.json") if e != nil { return e } } if mode != 1 { //source: https://github.com/dxa4481/truffleHogRegexes/blob/master/truffleHogRegexes/regexes.json e = s.loadSignatures("./rules/contentsignatures.json") if e != nil { return e } } return nil }
25.901961
116
0.72218
88a68bd548eb910a228ae7c4091b5a200f34a483
7,853
rs
Rust
src/main.rs
frapa/sampan
f1e7201ecc668923c77557d649b6f9bb2d8be587
[ "MIT" ]
2
2021-07-26T06:27:58.000Z
2022-02-19T14:55:19.000Z
src/main.rs
frapa/sampan
f1e7201ecc668923c77557d649b6f9bb2d8be587
[ "MIT" ]
null
null
null
src/main.rs
frapa/sampan
f1e7201ecc668923c77557d649b6f9bb2d8be587
[ "MIT" ]
null
null
null
use std::fs::File; use std::io::{Read, Seek, SeekFrom, Write}; use std::str; use std::time::Instant; use byteorder::{ByteOrder, LittleEndian}; use clap::{crate_version, App, AppSettings, Arg, ArgMatches}; static EOI: [u8; 2] = [255, 217]; fn main() { let start = Instant::now(); let matches = parse_args(); let silent = matches.is_present("silent"); let in_place = matches.is_present("in-place"); let dry_run = matches.is_present("dry-run"); let force = matches.is_present("force"); let inputs: Vec<&str> = matches.values_of("INPUT").unwrap().collect(); let output_opt = matches.value_of("OUTPUT"); let (total, size) = inputs .iter() .map(|input| { if in_place { convert_file(input, input, silent, dry_run, force) } else if dry_run { convert_file(input, ".test.jpg", silent, dry_run, force) } else { let output = output_opt.unwrap(); convert_file(input, output, silent, dry_run, force) } }) .fold((0, 0), |(acc_t, acc_s), (t, s)| (acc_t + t, acc_s + s)); if !silent { println!( "---\nExtracted {} of {} MB ({} %) -- Time: {:.3} s", (size as f32 / 1_000_000.).round(), (total as f32 / 1_000_000.).round(), (100. * (size as f32 / total as f32)).round(), start.elapsed().as_millis() as f32 / 1_000., ) } } fn parse_args() -> ArgMatches<'static> { App::new("sampan") .version(crate_version!()) .author("Francesco Pasa <francescopasa@gmail.com>") .about("Strips unnecessary information from Samsung panorama images.") .setting(AppSettings::ArgRequiredElseHelp) .arg( Arg::with_name("INPUT") .help( "JPEG file to strip. Can be a pattern containing \ wildcards to process multiple files at once. \ Use ** to recurse into folders. Wildcard expansion \ only works if the shell support it.", ) .required(true) .takes_value(true) .multiple(true) .index(1), ) .arg( Arg::with_name("OUTPUT") .short("o") .long("output") .help("Output file name.") .required(true) .takes_value(true) .conflicts_with_all(&["in-place", "dry-run"]), ) .arg( Arg::with_name("silent") .short("s") .long("silent") .takes_value(false) .help("Do not print any information."), ) .arg( Arg::with_name("in-place") .short("i") .long("in-place") .takes_value(false) .help( "Overwrites file(s) in place. Ensure you have a backup. \ If this is enabled, the OUTPUT argument must not be set.", ), ) .arg( Arg::with_name("dry-run") .short("d") .long("dry-run") .takes_value(false) .help("Run program but do not write output."), ) .arg( Arg::with_name("force") .short("f") .long("force") .takes_value(false) .help( "Force conversion even if the Samsung version number \ is unsupported and even if the entity types do match. \ This option can be helpful for forcing conversion of \ some files, and will never touch files that are not in \ Samsung format.", ), ) .get_matches() } fn convert_file( input: &str, output: &str, silent: bool, dry_run: bool, force: bool, ) -> (usize, usize) { let mut file = File::open(input).expect(&format!("Cannot open file {}", input)); let total = file.metadata().unwrap().len() as usize; let entries_count = match read_entries_count(&mut file, force) { Ok(count) => count, Err(err) => { println!("{}: {}", input, err); return (total, total); } }; // Find smallest offset of the custom data that is appended to the JPEG, // which we will then proceed to eliminate. let mut smallest_offset = total; for i in 0..entries_count { match read_entry_offset(&mut file, i, entries_count, force) { Ok(offset) => { if offset < smallest_offset { smallest_offset = offset } } Err(err) => { println!("{}: {}", input, err); return (total, total); } } } if !silent { println!( "{} -> {}\n Extracting {:.1} of {:.1} MB ({} %)", input, output, smallest_offset as f32 / 1_000_000., total as f32 / 1_000_000., (100. * (smallest_offset as f32 / total as f32)).round(), ); } if !dry_run { file.seek(SeekFrom::Start(0)).unwrap(); let mut jpeg_data = vec![0; smallest_offset]; file.read(&mut jpeg_data).unwrap(); let mut output_file = File::create(output).expect(&format!("Cannot open file {}", output)); output_file .write_all(&jpeg_data) .expect(&format!("Cannot write file {}", output)); if &jpeg_data[jpeg_data.len() - 2..] != &EOI { output_file .write(&EOI) .expect(&format!("Cannot write file {}", output)); } } (total, smallest_offset) } fn read_entries_count(file: &mut File, force: bool) -> Result<i64, String> { let mut footer = [0; 8]; file.seek(SeekFrom::End(-8)).unwrap(); file.read(&mut footer).unwrap(); // ascii for SEFT if footer[4..] != [83, 69, 70, 84] { return Err("Image is not a Samsung panorama. [skip]".to_string()); } let length = LittleEndian::read_u32(&footer[..4]) as i64; file.seek(SeekFrom::End(-8 - length)).unwrap(); let mut entries_header = [0; 12]; file.read(&mut entries_header).unwrap(); // ascii for SEFH if entries_header[0..4] != [83, 69, 70, 72] { return Err("Image is not a Samsung panorama. [skip]".to_string()); } let version = LittleEndian::read_u32(&entries_header[4..8]) as i64; if !force && version != 101 && version != 103 && version != 105 && version != 106 { return Err(format!( "Unknown panorama version {}, \ sampan only supports version 101, 103, 105, 106 [skip]", version )); } Ok(LittleEndian::read_u32(&entries_header[8..12]) as i64) } fn read_entry_offset(file: &mut File, n: i64, count: i64, force: bool) -> Result<usize, String> { let footer_len = 20 + count * 12; let mut header = [0; 8]; file.seek(SeekFrom::End(12 - footer_len + n * 12)).unwrap(); file.read(&mut header).unwrap(); let type_ = LittleEndian::read_u16(&header[2..4]); let offset = LittleEndian::read_u32(&header[4..8]) as i64; let offset_from_end = footer_len + offset; file.seek(SeekFrom::End(-offset_from_end)).unwrap(); let mut data = [0; 4]; file.read(&mut data).unwrap(); let data_type = LittleEndian::read_u16(&data[2..4]); if !force && data_type != type_ { return Err(format!( "Image is corrupted, entry types do not match: {} != {}. [skip]", data_type, type_ )); } Ok(file.metadata().unwrap().len() as usize - offset_from_end as usize) }
32.450413
99
0.513689
4596166c7adf25cdd4d41a87929b5820e68f0550
191
py
Python
tests/services/test_cli.py
rscohn2/sensepy
1c00cd6d0c1920057cc732d6c5b6a791b7e79e36
[ "MIT" ]
null
null
null
tests/services/test_cli.py
rscohn2/sensepy
1c00cd6d0c1920057cc732d6c5b6a791b7e79e36
[ "MIT" ]
1
2021-02-20T17:26:15.000Z
2021-02-20T17:26:15.000Z
tests/services/test_cli.py
zignalz/zignalz
1c00cd6d0c1920057cc732d6c5b6a791b7e79e36
[ "MIT" ]
null
null
null
# SPDX-FileCopyrightText: 2020 Robert Cohn # # SPDX-License-Identifier: MIT import pytest from zignalz import cli @pytest.mark.skip def test_db_start(): cli.db.up() cli.db.down()
13.642857
42
0.717277
53971c258fc64a1951dac14b89052b797e8c3550
1,856
lua
Lua
game/scripts/vscripts/modifiers/generic/modifier_generic_change_ms.lua
efe-efe/amethyst
0d6e3c02db82a5d289e2862c7b6e94974fafd674
[ "MIT" ]
1
2021-01-15T13:19:03.000Z
2021-01-15T13:19:03.000Z
game/scripts/vscripts/modifiers/generic/modifier_generic_change_ms.lua
efe-efe/amethyst
0d6e3c02db82a5d289e2862c7b6e94974fafd674
[ "MIT" ]
null
null
null
game/scripts/vscripts/modifiers/generic/modifier_generic_change_ms.lua
efe-efe/amethyst
0d6e3c02db82a5d289e2862c7b6e94974fafd674
[ "MIT" ]
null
null
null
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]] require("lualib_bundle"); __TS__SourceMapTraceBack(debug.getinfo(1).short_src, {["5"] = 1,["6"] = 1,["7"] = 1,["8"] = 3,["9"] = 4,["10"] = 3,["11"] = 4,["12"] = 5,["13"] = 6,["14"] = 7,["16"] = 5,["17"] = 10,["18"] = 11,["19"] = 10,["20"] = 13,["21"] = 14,["22"] = 13,["23"] = 16,["24"] = 17,["25"] = 16,["26"] = 19,["27"] = 20,["28"] = 19,["29"] = 22,["30"] = 23,["31"] = 22,["32"] = 27,["33"] = 28,["34"] = 27,["35"] = 4,["37"] = 3,["39"] = 4}); local ____exports = {} local ____dota_ts_adapter = require("lib.dota_ts_adapter") local BaseModifier = ____dota_ts_adapter.BaseModifier local registerModifier = ____dota_ts_adapter.registerModifier ____exports.modifier_generic_change_ms = __TS__Class() local modifier_generic_change_ms = ____exports.modifier_generic_change_ms modifier_generic_change_ms.name = "modifier_generic_change_ms" __TS__ClassExtends(modifier_generic_change_ms, BaseModifier) function modifier_generic_change_ms.prototype.OnCreated(self, data) if IsServer() then self:SetStackCount(data.amount) end end function modifier_generic_change_ms.prototype.IsHidden(self) return true end function modifier_generic_change_ms.prototype.IsDebuff(self) return false end function modifier_generic_change_ms.prototype.IsPurgable(self) return false end function modifier_generic_change_ms.prototype.RemoveOnDeath(self) return false end function modifier_generic_change_ms.prototype.DeclareFunctions(self) return {MODIFIER_PROPERTY_MOVESPEED_BONUS_CONSTANT_UNIQUE} end function modifier_generic_change_ms.prototype.GetModifierMoveSpeedBonus_Constant_Unique(self) return self:GetStackCount() end modifier_generic_change_ms = __TS__Decorate( { registerModifier(nil) }, modifier_generic_change_ms ) return ____exports
44.190476
421
0.730065
cde7db9d016c95b75feda13c4b6174b12dec3ae5
2,950
lua
Lua
ytsearcher.lua
dustin10weering/luvit-yt-searcher
374747068e0eacfbdca88b7ac66bf40b19416355
[ "MIT" ]
null
null
null
ytsearcher.lua
dustin10weering/luvit-yt-searcher
374747068e0eacfbdca88b7ac66bf40b19416355
[ "MIT" ]
null
null
null
ytsearcher.lua
dustin10weering/luvit-yt-searcher
374747068e0eacfbdca88b7ac66bf40b19416355
[ "MIT" ]
null
null
null
-- searches video on youtube, made by dustin. -- uses the coro-http module from luvit itself --[[ HOW TO USE: require it with something like "local ytsearcher = require('ytsearcher').new(YOUTUBE_API_KEY as string)" then search a video with it like "local searcher = ytsearcher:search('banana+phone')" because this function is async, you will need to use a coroutine. Now you can do something like this: local ytsearcher = require('ytsearcher').new(YOUTUBE_API_KEY as string) local search = coroutine.wrap(function() local video,response = ytsearcher:search('banana+phone') print(video.id) -- youtube video id print(video.title) -- video title print(video.thumbnail) -- thumbnail link print(video.author) -- author name end) search() When there's an error, it will return nil (and as second argument the response if it cannot connect to the website). ]] local http = require('coro-http') local apiurl = "https://www.googleapis.com/youtube/v3/search?" local function find(body,term) local begin, last = body:find(term) if last then local last2 = body:find('"', last+3) return body:sub(last+3,last2-1) else return "" end end local module = {} module.__index = module module.new = function (ytkey,regioncode) local classSelf = {} setmetatable(classSelf, module) classSelf.key = ytkey return classSelf end function module:search(searchparam,regioncode) local searchParams = { -- note: you can add more if they are listed in the youtube api docs. key = self.key, maxResults = 1, part = 'snippet', q = searchparam, regionCode = regioncode or "US", type = 'video' } local queryUrl = "" for param,info in pairs(searchParams) do queryUrl = queryUrl.."&"..param.."="..info end queryUrl = string.sub(queryUrl,2) local response,body = http.request("GET",apiurl..queryUrl) if not body then return nil,response end -- some failsaves if body:find('API key not valid') then return nil, "Invalid api key! See https://github.com/dustin10weering/luvit-yt-searcher." end if body:find('"status": "INVALID_ARGUMENT"') then print("Invalid arguments! Invalid url: "..apiurl..queryUrl) local from = body:find('"message":') if from then return nil, "Invalid arguments! "..find(body,'"message":') else return nil, "Invalid arguments! See console for not-working url." end end if body:find('"totalResults": 0') then return nil, "No results" end local from = body:find('"high":') if from then from = nil else from = "" -- (empty thumbnail string) no thumbnail given back end -- local videoinfo = { id = find(body,'"videoId":'), title = find(body,'"title":'), thumbnail = from or find(body,'"url":',from), author = find(body,'"channelTitle":') } return videoinfo end return module
30.729167
116
0.661017
a430af11cbea23cdae8d3b3d63643f3a4d31af1e
3,189
php
PHP
src/Generator/Model/FieldDefaultValue.php
cristianoc72/Propel3
cfaef1db6ac17391a4116e9d32f35aa320a859ad
[ "MIT" ]
264
2017-01-03T16:17:24.000Z
2022-03-22T09:24:55.000Z
src/Generator/Model/FieldDefaultValue.php
cristianoc72/Propel3
cfaef1db6ac17391a4116e9d32f35aa320a859ad
[ "MIT" ]
83
2017-01-05T18:03:56.000Z
2020-10-21T15:10:33.000Z
src/Generator/Model/FieldDefaultValue.php
cristianoc72/Propel3
cfaef1db6ac17391a4116e9d32f35aa320a859ad
[ "MIT" ]
51
2017-01-05T21:53:00.000Z
2021-07-16T07:21:10.000Z
<?php declare(strict_types=1); /** * This file is part of the Propel package. * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * @license MIT License */ namespace Propel\Generator\Model; /** * A class for holding a column default value. * * @author Hans Lellelid <hans@xmpl.org> (Propel) * @author Hugo Hamon <webmaster@apprendre-php.com> (Propel) */ class FieldDefaultValue { const TYPE_VALUE = 'value'; const TYPE_EXPR = 'expr'; /** * @var mixed The default value, as specified in the schema. */ private $value; /** * @var string The type of value represented by this object (DefaultValue::TYPE_VALUE or DefaultValue::TYPE_EXPR). */ private $type = FieldDefaultValue::TYPE_VALUE; /** * Creates a new DefaultValue object. * * @param string $value The default value, as specified in the schema. * @param string $type The type of default value (DefaultValue::TYPE_VALUE or DefaultValue::TYPE_EXPR) */ public function __construct($value, $type = null) { $this->setValue($value); if (null !== $type) { $this->setType($type); } } /** * @return string The type of default value (DefaultValue::TYPE_VALUE or DefaultValue::TYPE_EXPR) */ public function getType(): string { return $this->type; } /** * @param string $type The type of default value (DefaultValue::TYPE_VALUE or DefaultValue::TYPE_EXPR) */ public function setType($type) { $this->type = $type; } /** * Convenience method to indicate whether the value in this object is an expression (as opposed to simple value). * * @return boolean Whether value this object holds is an expression. */ public function isExpression(): bool { return self::TYPE_EXPR === $this->type; } /** * @return mixed The value, as specified in the schema. */ public function getValue() { return $this->value; } /** * @param mixed $value The value, as specified in the schema. */ public function setValue($value) { $this->value = $value; } /** * A method to compare if two Default values match * * @param FieldDefaultValue $other The value to compare to * @return boolean Whether this object represents same default value as $other * @author Niklas Närhinen <niklas@narhinen.net> */ public function equals(FieldDefaultValue $other): bool { if ($this->getType() !== $other->getType()) { return false; } if ($this == $other) { return true; } if (is_string($this->getValue())) { // special case for current timestamp $equivalents = ['CURRENT_TIMESTAMP', 'NOW()']; if (in_array(strtoupper($this->getValue()), $equivalents) && in_array(strtoupper($other->getValue()), $equivalents)) { return true; } } return false; // Can't help, they are different } }
26.798319
130
0.59862
7fc71345e9a1add1ee5908fd3fa1353b9225d5c0
500
php
PHP
src/Tick/Traits/RandomGeneratorTrait.php
Dinozorlar/tick
0796f8ed4418d1d2c600bea9f52ed515c7526984
[ "MIT" ]
null
null
null
src/Tick/Traits/RandomGeneratorTrait.php
Dinozorlar/tick
0796f8ed4418d1d2c600bea9f52ed515c7526984
[ "MIT" ]
null
null
null
src/Tick/Traits/RandomGeneratorTrait.php
Dinozorlar/tick
0796f8ed4418d1d2c600bea9f52ed515c7526984
[ "MIT" ]
null
null
null
<?php namespace Tick\Traits; trait RandomGeneratorTrait { /** * @var \Tick\Service\RandomGenerator */ private $randomGenerator; /** * @return \Tick\Service\RandomGenerator */ public function getRandomGenerator() { return $this->randomGenerator; } /** * @param \Tick\Service\RandomGenerator $randomGenerator */ public function setRandomGenerator($randomGenerator) { $this->randomGenerator = $randomGenerator; } }
19.230769
60
0.628
1f04770af9c1f21d874f53af9f4f9599646e55ef
1,560
cs
C#
Assets/Editor/Scripts/ModConfig.cs
bdkuhman/KTANETerminal
605de1765f878bd631d63370b0256a22b90d179b
[ "MIT" ]
8
2017-04-16T00:47:40.000Z
2020-02-17T03:18:30.000Z
Assets/Editor/Scripts/ModConfig.cs
bdkuhman/KTANETerminal
605de1765f878bd631d63370b0256a22b90d179b
[ "MIT" ]
22
2017-03-31T11:09:07.000Z
2018-02-04T18:05:26.000Z
Assets/Editor/Scripts/ModConfig.cs
bdkuhman/KTANETerminal
605de1765f878bd631d63370b0256a22b90d179b
[ "MIT" ]
13
2017-03-31T05:35:28.000Z
2020-04-14T20:12:18.000Z
using UnityEngine; using System.Collections; using Newtonsoft.Json; using System.Collections.Generic; #if UNITY_EDITOR [UnityEditor.InitializeOnLoad] #endif public sealed class ModConfig : ScriptableObject { public static string ID { get { return Instance.id; } set { Instance.id = value; } } public static string Title { get { return Instance.title; } set { Instance.title = value; } } public static string Version { get { return Instance.version; } set { Instance.version = value; } } public static string OutputFolder { get { return Instance.outputFolder; } set { Instance.outputFolder = value; } } [SerializeField] private string id = ""; [SerializeField] private string title = ""; [SerializeField] private string version = ""; [SerializeField] private string outputFolder = "build"; private static ModConfig instance; public static ModConfig Instance { get { if (instance == null) { instance = Resources.Load<ModConfig>("ModConfig"); } return instance; } set { instance = value; } } public string ToJson() { Dictionary<string, object> dict = new Dictionary<string, object>(); dict.Add("id", id); dict.Add("title", title); dict.Add("version", version); return JsonConvert.SerializeObject(dict); ; } }
21.666667
75
0.573077
cd80d7a858318454b0ccab8c4bde48da5324a7c7
740
cs
C#
src/Agent/IoT/RestApis/IDeviceApi.cs
shashishailaj/Azure-IoT-Security-Agent-CS
7c74dec338603804e619f021089506f8eb40df6c
[ "MIT" ]
12
2019-03-28T12:56:35.000Z
2021-03-25T09:13:38.000Z
src/Agent/IoT/RestApis/IDeviceApi.cs
shashishailaj/Azure-IoT-Security-Agent-CS
7c74dec338603804e619f021089506f8eb40df6c
[ "MIT" ]
2
2019-04-08T11:53:26.000Z
2019-07-28T14:15:29.000Z
src/Agent/IoT/RestApis/IDeviceApi.cs
shashishailaj/Azure-IoT-Security-Agent-CS
7c74dec338603804e619f021089506f8eb40df6c
[ "MIT" ]
6
2019-03-29T11:56:44.000Z
2021-01-03T17:23:42.000Z
// <copyright file="IDeviceApi.cs" company="Microsoft"> // Copyright (c) Microsoft Corporation. All rights reserved. // </copyright> using Newtonsoft.Json.Linq; namespace Microsoft.Azure.IoT.Agent.IoT.RestApis { /// <summary> /// Interface for device API /// abstract functions of the supported APIs /// </summary> public interface IDeviceApi { /// <summary> /// Return the agent module of the given device id /// The return value represents the json of the Module /// </summary> /// <param name="deviceId">the device id for which we search the module</param> /// <returns>JToken of the Module</returns> JToken GetDeviceAgentModule(string deviceId); } }
32.173913
87
0.648649
8e9005fea2458603036b99feb76ecd6eab647f95
3,756
js
JavaScript
app/index.js
request-watcher/request-watcher-server
815f6339d053ebf266c1e72bb9f496bdb979d237
[ "MIT" ]
null
null
null
app/index.js
request-watcher/request-watcher-server
815f6339d053ebf266c1e72bb9f496bdb979d237
[ "MIT" ]
null
null
null
app/index.js
request-watcher/request-watcher-server
815f6339d053ebf266c1e72bb9f496bdb979d237
[ "MIT" ]
null
null
null
const Koa = require('koa') const KoaBodyParser = require('koa-bodyparser') const json = require('koa-json') const Router = require('koa-router') const serve = require('koa-static') const path = require('path') const cors = require('koa2-cors') const moment = require('moment') const app = new Koa() const router = new Router() const server = require('http').createServer(app.callback()) const io = require('socket.io')(server) const Model = require('./models') let totalUsers = 0 io.on('connection', function(socket) { totalUsers += 1 let time = moment().format('YYYY/MM/DD HH:mm:ss') console.log(`[${time}] user connected (current users: ${totalUsers})`) socket.on('disconnect', function() { totalUsers -= 1 time = moment().format('YYYY/MM/DD HH:mm:ss') console.log(`[${time}] user disconnected (current users: ${totalUsers})`) }) }) router.post('/return-json', function(ctx, next) { ctx.body = { bar: 'foo' } }) router.post('/receiver', (ctx, next) => { const saveMe = !!ctx.request.body.save // need to save to db ? let uuid = ctx.request.body && ctx.request.body.uuid.slice(0, 5) // only show short version // created time const createdAt = ctx.request.body.createdAt let time = '????/??/?? ??:??:??' if (createdAt) { time = moment(createdAt).format('YYYY/MM/DD HH:mm:ss') } if (ctx.request.body.request) { // request io.emit('request', ctx.request.body) console.log(`[${time}] emit request (${uuid}) ${ctx.request.body.request.url}`) } else if (ctx.request.body.response) { // response io.emit('response', ctx.request.body) console.log(`[${time}] emit response(${uuid})`) } else if (ctx.request.body.logger) { // logger io.emit('logger', ctx.request.body) console.log(`[${time}] emit logger (${uuid}) ${ctx.request.body.logger.title}`) } else { console.log('invalid request', ctx.request.body) } if (saveMe) { if (ctx.request.body.request) { // request Model.Request.insertDocuments([ctx.request.body]) } else if (ctx.request.body.response) { // response Model.Response.insertDocuments([ctx.request.body]) } else if (ctx.request.body.logger) { // logger Model.Logger.insertDocuments([ctx.request.body]) } else { } } ctx.body = { result: 'success' } }) router.post('/history', async (ctx, next) => { let { appname, username, startTime, endTime, labels, type = 'request' } = ctx.request.body const queries = {} if (appname) { queries.appname = appname } if (username) { queries.username = username } // if (labels && Array.isArray(labels)) { // queries.labels = { $all: labels } // } if (startTime && endTime) { queries.createdAt = { $gt: startTime, $lt: endTime } } else if (startTime) { queries.createdAt = { $gt: startTime } } else if (endTime) { queries.createdAt = { $lt: endTime } } else { } if (type === 'request') { try { let [requests, responses] = await Promise.all([ Model.Request.findDocuments(queries), Model.Response.findDocuments(queries) ]) requests.forEach(request => { const response = responses.find(response => response.uuid === request.uuid) request.response = response && response.response }) ctx.body = requests } catch (err) { console.log(err) } } else if (type === 'logger') { try { let loggers = Model.Logger.findDocuments(queries) ctx.body = loggers } catch (err) { console.log(err) } } }) const root = path.resolve(__dirname, '../www') const opts = {} app.use(cors({ credentials: true })) app.use(serve(root, opts)) app.use(KoaBodyParser()) app.use(json()) app.use(router.routes()) module.exports = server
28.671756
93
0.626198
c671d9426f65a8fa422f615060706224193028f8
601
py
Python
verify/checker/abc221/f.py
naskya/testcase-generator
02765184a275152e1d8c177f2028ca8db315cfee
[ "MIT" ]
4
2020-09-23T07:11:41.000Z
2022-02-02T09:08:21.000Z
verify/checker/abc221/f.py
naskya/testcase-generator
02765184a275152e1d8c177f2028ca8db315cfee
[ "MIT" ]
5
2021-08-29T18:23:01.000Z
2021-11-20T03:53:19.000Z
verify/checker/abc221/f.py
naskya/testcase-generator
02765184a275152e1d8c177f2028ca8db315cfee
[ "MIT" ]
null
null
null
def main() -> None: N = int(input()) assert 2 <= N <= 100 graph = [[] for _ in range(N)] for _ in range(N - 1): u, v = map(int, input().split()) assert 1 <= u <= N assert 1 <= v <= N assert u != v u -= 1 v -= 1 graph[u].append(v) graph[v].append(u) stk = [0] vis = [False] * N while stk: cnode = stk.pop() vis[cnode] = True for nnode in graph[cnode]: if not vis[nnode]: stk.append(nnode) assert all(vis) if __name__ == '__main__': main()
16.694444
40
0.432612
45b0802d3b96267eb2cb837c6de939849c10e7d1
7,405
py
Python
pydemic/api/covid19.py
GCES-Pydemic/pydemic
f221aa16e6a32ed1303fa11ebf8a357643f683d5
[ "MIT" ]
null
null
null
pydemic/api/covid19.py
GCES-Pydemic/pydemic
f221aa16e6a32ed1303fa11ebf8a357643f683d5
[ "MIT" ]
null
null
null
pydemic/api/covid19.py
GCES-Pydemic/pydemic
f221aa16e6a32ed1303fa11ebf8a357643f683d5
[ "MIT" ]
null
null
null
import io import time from functools import lru_cache from urllib.error import HTTPError import numpy as np import pandas as pd import requests import sidekick as sk import mundi from mundi import transforms from ..cache import ttl_cache from ..logging import log from ..utils import today HOURS = 3600 TIMEOUT = 6 * HOURS EPIDEMIC_CURVES_APIS = {} MOBILITY_DATA_APIS = {} def epidemic_curve_api(key): return lambda fn: EPIDEMIC_CURVES_APIS.setdefault(key, fn) def mobility_data_api(key): return lambda fn: MOBILITY_DATA_APIS.setdefault(key, fn) # # Epidemic curves # def epidemic_curve(region, api="auto", extra=False, **kwargs): """ Universal interface to all epidemic curve loaders. Always return a dataframe with ["cases", "deaths"] columns for the given region. Some API's may offer additional columns such as "recovered", "test" etc. """ code = mundi.code(region) fn = EPIDEMIC_CURVES_APIS[api] data = fn(code, **kwargs) return data if extra else data[["cases", "deaths"]] @epidemic_curve_api("auto") def auto_api(code, **kwargs): """ Select best API to load according to region code. """ if code == "BR" or code.startswith("BR-"): return brasil_io(code) elif len(code) == 2: return corona_api(code, **kwargs) raise ValueError(f"no API can load region with code: {code}") @epidemic_curve_api("corona-api.com") @ttl_cache("covid-19", timeout=TIMEOUT) def corona_api(code) -> pd.DataFrame: """ Load country's cases, deaths and recovered timeline from corona-api.com. """ data = download_corona_api(code) data = data["data"]["timeline"] df = pd.DataFrame(data).rename({"confirmed": "cases"}, axis=1) df = df[["date", "cases", "deaths", "recovered"]] df["date"] = pd.to_datetime(df["date"]) df = df.drop_duplicates("date", keep="first").set_index("date") df = df[df.fillna(0).sum(1) > 0].sort_index() # Fill missing data with previous measurement start, end = df.index[[0, -1]] full_index = pd.to_datetime(np.arange((end - start).days), unit="D", origin=start) df = df.reindex(full_index).fillna(method="ffill") return df.astype(int) @sk.retry(10, sleep=0.5) def download_corona_api(code) -> dict: log.info(f"[api/corona-api] Downloading data from corona API ({code})") url = "http://corona-api.com/countries/{code}?include=timeline" response = requests.get(url.format(code=code)) size = len(response.content) // 1024 log.info(f"[api/corona-api] Download ended with {size} kb") return response.json() @epidemic_curve_api("brasil.io") def brasil_io(code): cases = brasil_io_cases() cases = cases[cases["id"] == code].drop(columns="id") cases = cases.drop_duplicates("date") return cases.set_index("date").sort_index() @ttl_cache("covid-19", timeout=TIMEOUT) def brasil_io_cases() -> pd.DataFrame: """ Return the complete dataframe of cases and deaths from Brasil.io. """ df = download_brasil_io_cases() cols = { "last_available_confirmed": "cases", "confirmed": "cases", "last_available_deaths": "deaths", "city_ibge_code": "code", } cases = df.rename(cols, axis=1) cases = cases[cases["code"].notna()] cases["code"] = cases["code"].apply(lambda x: str(int(x))).astype("string") cases["code"] = "BR-" + cases["code"] cases["date"] = pd.to_datetime(cases["date"]) cases = cases[cases["place_type"] == "city"] cases = cases[["date", "code", "cases", "deaths"]] cases = cases.dropna().reset_index(drop=True) cases = cases.rename({"code": "id"}, axis=1) log.info(f"[api/brasil.io] Merging {len(df)} entries") result = {} for col in ["cases", "deaths"]: data = cases.pivot_table(index="id", columns="date", values=col).fillna(-1).sort_index() data = transforms.sum_children(data).reset_index() data = data.melt(id_vars=["id"], var_name="date", value_name=col) data = data[data[col] >= 0] result[col] = data out = ( pd.merge(*result.values(), on=["id", "date"], how="outer") .fillna(0) .astype({"cases": int, "deaths": int}) ) log.info("[api/brasil.io] Merge complete") return out @sk.retry(10, sleep=0.5) def download_brasil_io_cases(): log.info("[api/brasil.io] Downloading data from Brasil.io") url = "https://data.brasil.io/dataset/covid19/caso_full.csv.gz" try: # Brasil.io is now under a Cloudflare CDN and it requires proper # User-Agent headers. This means we cannot download data using pandas # builtin support for URLs in read_csv, since it does not set those # headers accordingly. response = requests.get(url, headers={"User-Agent": "python-requests"}) except HTTPError as e: log.warn(f"[api/brasil.io] error downloading: {e}, using Github fallback") url = "https://github.com/pydemic/databases/raw/master/caso_full.csv.gz" return pd.read_csv(url) else: return pd.read_csv(io.BytesIO(response.content), compression="gzip") # # Mobility data # @ttl_cache("covid-19", timeout=TIMEOUT) @sk.retry(10, sleep=0.5) def google_mobility_data(cli=False): """ Download google mobility data """ url = "https://www.gstatic.com/covid19/mobility/Global_Mobility_Report.csv" log.info(f"Downloading google mobility data {today()}") t0 = time.time() data = requests.get(url) log.info(f"Download finished after {time.time() - t0:0.2} seconds") data_cols = ["retail", "grocery", "parks", "transit", "work", "residential"] df = pd.read_csv(data.content.decode("utf8")).rename( { "retail_and_recreation_percent_change_from_baseline": "retail", "grocery_and_pharmacy_percent_change_from_baseline": "grocery", "parks_percent_change_from_baseline": "parks", "transit_stations_percent_change_from_baseline": "transit", "workplaces_percent_change_from_baseline": "work", "residential_percent_change_from_baseline": "residential", }, axis=1, ) df["date"] = pd.to_datetime(df["date"]) df[data_cols] = df[data_cols] / 100.0 return df def fix_google_mobility_data_region_codes(df): data = df[["country_region_code", "sub_region_1", "sub_region_2"]] codes = data.apply(subregion_code) return df @lru_cache(1024) def subregion_code(country, region, subregion): region = region or None subregion = subregion or None # Check arbitrary mapping mapping = google_mobility_map_codes() try: return mapping[country, region, subregion] except KeyError: pass # Fasttrack pure-country codes if not region: return country for name in (subregion, region): try: region = mundi.region(country_id=country, name=name) except LookupError: return region.id return country + "-" + region @lru_cache(1) def google_mobility_map_codes() -> dict: data = {} # Brazilian states for state in mundi.regions("BR", type="state"): data["BR", f"State of {state}", None] = state.id data["BR", "Federal District", None] = "BR-DF" return data if __name__ == "__main__": sk.import_later("..cli.api:covid19_api_downloader", package=__package__)()
29.738956
96
0.652667
ff3c15e33814b152e8873ed7e6590efe52392be5
846
py
Python
examples/example1.py
cloudflare/gatelogic
4dc763d83f7080da45ab1be0a16ab2e563a6a5d0
[ "BSD-3-Clause" ]
11
2017-12-13T11:39:08.000Z
2020-07-30T09:55:47.000Z
examples/example1.py
cloudflare/gatelogic
4dc763d83f7080da45ab1be0a16ab2e563a6a5d0
[ "BSD-3-Clause" ]
null
null
null
examples/example1.py
cloudflare/gatelogic
4dc763d83f7080da45ab1be0a16ab2e563a6a5d0
[ "BSD-3-Clause" ]
null
null
null
''' Simple example. To run: ../venv/bin/python example1.py And observe the printed values. That's it. ''' import gatelogic c = gatelogic.Controller() ingress = gatelogic.ReadableHub(c) hub = gatelogic.QueryHub(c) egress = gatelogic.ComputableHub(c) def action(cell): v = cell.value if v == None: return return (hub.get(v).value or 1) * (hub.get(v).value or 1) def ensure_map(_, kind, key, cell): if kind == 'add': egress.maintain(key, action, cell) if kind == 'delete': egress.unmaintain(key) c.subscribe(ingress, ensure_map) def sync(*args): print egress.dump() c.subscribe(egress, sync) ingress.update({1:1}) hub.update({1:2}) ingress.update({1:1, 2:2}) hub.update({2:2}) ingress.update({}) c.unsubscribe(egress, sync) c.unsubscribe(ingress, ensure_map) assert c.is_empty()
16.588235
60
0.658392
7286b2b5ea15c6babd9afac130b95239bcb9e015
276
h
C
LKHAditions/LKH/LKHViewController.h
luokehua/LKHAditions
06f4ce96a1101acd7dcb2a16d3bf138f34b632f4
[ "MIT" ]
null
null
null
LKHAditions/LKH/LKHViewController.h
luokehua/LKHAditions
06f4ce96a1101acd7dcb2a16d3bf138f34b632f4
[ "MIT" ]
null
null
null
LKHAditions/LKH/LKHViewController.h
luokehua/LKHAditions
06f4ce96a1101acd7dcb2a16d3bf138f34b632f4
[ "MIT" ]
null
null
null
// // LKHViewController.h // LKHAditions // // Created by marsmobios on 2019/10/19. // Copyright © 2019 marsmob-ios-02. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface LKHViewController : UIViewController @end NS_ASSUME_NONNULL_END
15.333333
57
0.746377
b7368d882fcd581e0fa80390ac5261b2d6fe4790
377
cs
C#
Tzkt.Api/Responses/SelectionSingleResponse.cs
jpic/tzkt
72f57acca5e63244761b2784e946461eea9bd88f
[ "MIT" ]
110
2019-10-18T07:44:24.000Z
2022-03-30T19:32:51.000Z
Tzkt.Api/Responses/SelectionSingleResponse.cs
jpic/tzkt
72f57acca5e63244761b2784e946461eea9bd88f
[ "MIT" ]
56
2020-11-12T22:59:43.000Z
2022-03-23T20:35:46.000Z
Tzkt.Api/Responses/SelectionSingleResponse.cs
jpic/tzkt
72f57acca5e63244761b2784e946461eea9bd88f
[ "MIT" ]
13
2019-09-26T10:44:56.000Z
2022-03-20T19:15:17.000Z
using System; using System.Collections.Generic; using System.Linq; using System.Text.Json; using System.Text.Json.Serialization; using System.Threading.Tasks; namespace Tzkt.Api { [JsonConverter(typeof(SelectionSingleConverter))] public class SelectionSingleResponse { public string[] Cols { get; set; } public object[] Vals { get; set; } } }
22.176471
53
0.710875
3dee4090c2bc04bc5ff42f79b61daafa05cca60e
391
py
Python
dictionaries.py
EzechielD/twitter_guessing_game
d2bab0766a8f087e5ddf1ef9489b64f9cc3c82ae
[ "BSD-2-Clause" ]
null
null
null
dictionaries.py
EzechielD/twitter_guessing_game
d2bab0766a8f087e5ddf1ef9489b64f9cc3c82ae
[ "BSD-2-Clause" ]
null
null
null
dictionaries.py
EzechielD/twitter_guessing_game
d2bab0766a8f087e5ddf1ef9489b64f9cc3c82ae
[ "BSD-2-Clause" ]
null
null
null
import tweepy from keys import consumer_key, consumer_secret, access_token, access_secret from scrape import auth, api, get_tweets from create import markov, dict_maker auth.set_access_token(access_token, access_secret) #Dictionaries for specific accounts are created here playstation = dict_maker("PlayStation") lil_nas_x = dict_maker("LilNasX") mark_hamill = dict_maker("HamillHimself")
32.583333
75
0.831202
6521d9cc06ea4d390e31ec89aedbbf546a0abebf
2,392
css
CSS
CalcularFiguras/styles.css
joaquinDemarchi/REPO--JS
004949daff75356c9ac9b06004b597a431c5f214
[ "MIT" ]
1
2021-06-30T16:14:10.000Z
2021-06-30T16:14:10.000Z
CalcularFiguras/styles.css
joaquinDemarchi/Teoria-Pruebas-Trabajos--JS
004949daff75356c9ac9b06004b597a431c5f214
[ "MIT" ]
null
null
null
CalcularFiguras/styles.css
joaquinDemarchi/Teoria-Pruebas-Trabajos--JS
004949daff75356c9ac9b06004b597a431c5f214
[ "MIT" ]
null
null
null
*{ margin: 0cm; padding: 0cm; box-sizing: border-box; } html{ font-size: 62.5%; background-color:rgba(219, 168, 0, 0.781); } header{ position: fixed; width: 100%; } h1{ display: flex; align-items: center; justify-content: center; text-align: center; width: 100%; height: 7rem; background-color: goldenrod; font-size: 3rem; } header p { display: flex; align-items: center; justify-content: center; text-align: center; background-color: black; width: 100%; height: 3rem; color: white; font-weight: bold; } section{ display: flex; justify-content: center; flex-wrap: wrap; align-items: center; width: 100%; } .cuadrado-container, .triangulo-container, .circulo-container{ display: flex; flex-wrap: wrap; align-items: center; justify-content: center; width: 100%; max-width: 60rem; margin: 2rem 20rem; padding: 1.2rem; background-color:gold; border-radius: 2rem; } .cuadrado-container{ margin-top: 15rem; } section div h2{ width: 35rem; margin: 1.5rem 1rem 2rem 1rem; text-align:center; font-weight: bold; text-transform: uppercase; line-height: 2.5rem; } form { display: flex; flex-wrap: wrap; justify-content: center; width: 35rem; } div .circulo-container--resultado, .triangulo-container--resultado, .cuadrado-container--resultado{ width: 30rem; height: 8rem; text-align: center; margin: 1.4rem; background-color:goldenrod; border-radius: 2rem; } .circulo-container--resultado, .triangulo-container--resultado, .cuadrado-container--resultado p{ font-size: 2rem; } #resultCua, #resultTri, #resultCir{ color: aliceblue; text-align:center ; padding: .3rem 3rem 0 3rem ; font-size: 1.8rem; } #resultCir{ padding: .3rem 2rem 0 2rem ; } label{ padding: 1rem; font-size: 1.2rem; } input{ width: 15rem; border: 1px solid; border-radius: 1rem; background-color: black; text-align: center; color: goldenrod; font-weight: bold; } button{ justify-content: center; margin: 1.4rem 0.5rem 0.2rem 0.5rem; width: 35rem; background-color: goldenrod; border: 3px solid goldenrod; border-radius: 1rem; color: white; } button:hover{ background-color: gold; color: black; }
17.459854
99
0.632107
b074a5a9eda921b7fe9787f5db7bb9a54517f9f3
201
py
Python
design-patterns/single-container/math_app.py
pwcz/docker-learning
f2f4eb76e41cd10c4b61813760eedcc2ed2c34ce
[ "MIT" ]
null
null
null
design-patterns/single-container/math_app.py
pwcz/docker-learning
f2f4eb76e41cd10c4b61813760eedcc2ed2c34ce
[ "MIT" ]
null
null
null
design-patterns/single-container/math_app.py
pwcz/docker-learning
f2f4eb76e41cd10c4b61813760eedcc2ed2c34ce
[ "MIT" ]
null
null
null
import flask api = flask.Flask(__name__) @api.route('/', methods=['GET']) def home(): return "<h1>Test API</h1>" @api.route("/power/<int:number>") def power(number): return str(number**2)
14.357143
33
0.626866
cd0b601cdf4e0f580a9c579d0fb64cd69c9a6ed2
105
cs
C#
C# MultiThreading-Parallel (semester 3)/Fibers/FibersLib/Priorities.cs
vladislav-miroshnikov/Computer-practice
8215611de08bccab24349af56ec7db01639dfb75
[ "MIT" ]
1
2020-09-28T11:48:17.000Z
2020-09-28T11:48:17.000Z
C# MultiThreading-Parallel (semester 3)/Fibers/FibersLib/Priorities.cs
vladislav-miroshnikov/Computer-practice
8215611de08bccab24349af56ec7db01639dfb75
[ "MIT" ]
null
null
null
C# MultiThreading-Parallel (semester 3)/Fibers/FibersLib/Priorities.cs
vladislav-miroshnikov/Computer-practice
8215611de08bccab24349af56ec7db01639dfb75
[ "MIT" ]
2
2021-04-16T13:17:45.000Z
2022-02-16T09:16:02.000Z
namespace FibersLib { internal enum SheduleType { Priority, NonPriority } }
11.666667
29
0.571429
bb017d6b3cb94f09c65c6f2c923eb0d5513c8145
3,614
cs
C#
Assets/UnityTechnologies/HMITemplate/Editor/IVI/ScreenOrientationHelper_CustomInpector.cs
sunrui19941128/CarHMI
3ab6ccd7dfbb48735dffac117b1821f530f1ad7d
[ "MIT" ]
null
null
null
Assets/UnityTechnologies/HMITemplate/Editor/IVI/ScreenOrientationHelper_CustomInpector.cs
sunrui19941128/CarHMI
3ab6ccd7dfbb48735dffac117b1821f530f1ad7d
[ "MIT" ]
null
null
null
Assets/UnityTechnologies/HMITemplate/Editor/IVI/ScreenOrientationHelper_CustomInpector.cs
sunrui19941128/CarHMI
3ab6ccd7dfbb48735dffac117b1821f530f1ad7d
[ "MIT" ]
null
null
null
using UnityEditor; using UnityEngine; using HMI.UI.IVI; /// <summary> /// Custom inspector for the screen orientation helper /// </summary> [CustomEditor(typeof(ScreenOrientationHelper))] public class ScreenOrientationHelper_CustomInpector : Editor { /// <summary> /// Inspector GUI callback /// </summary> public override void OnInspectorGUI() { base.DrawDefaultInspector(); var Script = (ScreenOrientationHelper)target; if (Script.LandscapeSettings != null) { for (var i = 0; i < Script.LandscapeSettings.Length; i++) { if (Script.LandscapeSettings[i].GameObject != null && Script.LandscapeSettings[i].Rect == null) { Script.LandscapeSettings[i].Rect = Script.LandscapeSettings[i].GameObject.GetComponent<RectTransform>(); //Position Script.LandscapeSettings[i].Position = Script.LandscapeSettings[i].Rect.anchoredPosition; //Size Script.LandscapeSettings[i].Size = Script.LandscapeSettings[i].Rect.sizeDelta; //Anchors Script.LandscapeSettings[i].AnchorMax = Script.LandscapeSettings[i].Rect.anchorMax; Script.LandscapeSettings[i].AnchorMin = Script.LandscapeSettings[i].Rect.anchorMin; //Pivot Script.LandscapeSettings[i].Pivot = Script.LandscapeSettings[i].Rect.pivot; //rotation Script.LandscapeSettings[i].Rotation = Script.LandscapeSettings[i].Rect.localEulerAngles; //Size Script.LandscapeSettings[i].Scale = Script.LandscapeSettings[i].Rect.localScale; } if (Script.LandscapeSettings[i].GameObject == null && Script.LandscapeSettings[i].Rect != null) { Script.LandscapeSettings[i] = new ScreenOrientationHelper.CanvasObject(); } } } if (Script.PortraitSettings != null) { for (var i = 0; i < Script.PortraitSettings.Length; i++) { if (Script.PortraitSettings[i].GameObject != null && Script.PortraitSettings[i].Rect == null) { Script.PortraitSettings[i].Rect = Script.PortraitSettings[i].GameObject.GetComponent<RectTransform>(); //Position Script.PortraitSettings[i].Position = Script.PortraitSettings[i].Rect.anchoredPosition; //Size Script.PortraitSettings[i].Size = Script.PortraitSettings[i].Rect.sizeDelta; //Anchors Script.PortraitSettings[i].AnchorMax = Script.PortraitSettings[i].Rect.anchorMax; Script.PortraitSettings[i].AnchorMin = Script.PortraitSettings[i].Rect.anchorMin; //Pivot Script.PortraitSettings[i].Pivot = Script.PortraitSettings[i].Rect.pivot; //rotation Script.PortraitSettings[i].Rotation = Script.PortraitSettings[i].Rect.localEulerAngles; //Size Script.PortraitSettings[i].Scale = Script.PortraitSettings[i].Rect.localScale; } if (Script.PortraitSettings[i].GameObject == null && Script.PortraitSettings[i].Rect != null) { Script.PortraitSettings[i] = new ScreenOrientationHelper.CanvasObject(); } } } } }
40.155556
124
0.572773
a49c2519d78f49fb519bdfc2aa1a51c873c92674
73
php
PHP
php/news/news.body.php
ziyoren/phtml-template
2bcd64a5f613c55b2c15c8f11cf07a05dfd70e3f
[ "MIT" ]
1
2022-03-31T07:38:44.000Z
2022-03-31T07:38:44.000Z
php/news/news.body.php
ziyoren/phtml-template
2bcd64a5f613c55b2c15c8f11cf07a05dfd70e3f
[ "MIT" ]
null
null
null
php/news/news.body.php
ziyoren/phtml-template
2bcd64a5f613c55b2c15c8f11cf07a05dfd70e3f
[ "MIT" ]
null
null
null
<?php echo '<h1>'; echo 'Hello News ', date('Y-m-d H:i:s'); echo '</h1>';
18.25
40
0.520548
a4ab2994593e6e5fd7b47291ddf9ecf5ed9445fc
472
php
PHP
resources/views/layouts/front.blade.php
couchjanus/agop-test
b88f12cdd698e919730b965172a82094125811be
[ "MIT" ]
null
null
null
resources/views/layouts/front.blade.php
couchjanus/agop-test
b88f12cdd698e919730b965172a82094125811be
[ "MIT" ]
null
null
null
resources/views/layouts/front.blade.php
couchjanus/agop-test
b88f12cdd698e919730b965172a82094125811be
[ "MIT" ]
null
null
null
@extends('layouts.app') @section('content') <!-- Page Content --> <div class="container"> <div class="row"> <div class="col-lg-3"> @include('layouts.partials._aside') </div> <!-- /.col-lg-3 --> <div class="col-lg-9"> @yield('page') </div> <!-- /.col-lg-9 --> </div> <!-- /.row --> </div> <!-- /.container --> @endsection
24.842105
51
0.383475
9fe1f99facaef9196cf1807199e8be1dbbe2affb
2,980
py
Python
BruneTransformation.py
LLNL/ferdinand
af47b415ea1e9cb21a45b20d1f3854bc7f3a4d70
[ "Apache-2.0" ]
null
null
null
BruneTransformation.py
LLNL/ferdinand
af47b415ea1e9cb21a45b20d1f3854bc7f3a4d70
[ "Apache-2.0" ]
null
null
null
BruneTransformation.py
LLNL/ferdinand
af47b415ea1e9cb21a45b20d1f3854bc7f3a4d70
[ "Apache-2.0" ]
null
null
null
# ############################################## # # # Ferdinand 0.40, Ian Thompson, LLNL # # # # gnd,endf,fresco,azure,hyrma # # # ############################################## # Brune Transformation for ferdinand.py import numpy from scipy.linalg import eigh from numpy.matlib import zeros #,matmul def BruneTransformation ( gamB, EB, Bc, Shift, debug,J,pi,lab2cm): # NCH = number of partial waves # NLEV = number of levels # Arrays input gamB(NLEV,NCH) gamma-tilde (Brune) # Bc (NLEV) boundary conditions to fix output gamS (independent of energy L) # Shift (NLEV,NCH) S_m(E_l) # EB(NLEV) R-matrix pole energy-tilde # # returns gamS(NLEV,NCH) gamma (standard) # ES(NLEV) R-matrix pole energy (standard) # # All energies and widths are on the scale of the projectile lab frame # # From C.R. Brune, Phys. Rev. C66, 044611 (2002), equations (20, 21, 24, 27). # NLEV,NCH = gamB.shape if debug: print("BT: NLEV,NCH =",NLEV,NCH) if NLEV*NCH==0: return gamB,EB M = zeros([NLEV,NLEV]) if debug: print('Bc:',Bc) if debug: print('Shift:\n',Shift) N = M.copy() for l in range(NLEV): M[l,l] = 1 N[l,l] = EB[l] for c in range(NCH): N[l,l] += gamB[l,c]**2 * (Shift[l,c] - Bc[c]) for k in range(l+1,NLEV): for c in range(NCH): M[k,l] -= gamB[l,c]*gamB[k,c] * (Shift[l,c]-Shift[k,c])/(EB[l]-EB[k]) N[k,l] += gamB[l,c]*gamB[k,c] * ( (EB[l]*Shift[k,c] - EB[k]*Shift[l,c]) /(EB[l]-EB[k]) - Bc[c]) M[l,k] = M[k,l] N[l,k] = N[k,l] if debug: print('N matrix:\n',N) if debug: print('M norm matrix:\n',M) try: ES,vec = eigh(N, M, lower=True) except: print("\nERROR in eigh for J/pi=",J,'+' if int(pi)>0 else '-') if debug: print('N matrix:\n',N) if debug: print('M norm matrix:\n',M) ES,vec = eigh(M, lower=True) print("\n Norm eigenvalues:\n",' ',ES) if debug: print("Norm eigenvectors:\n",vec) print("\n FAILED in BruneTransform for",J,'+' if int(pi)>0 else '-',"\n") ES = [9.1111 for i in range(NLEV)] # Transform gamB to gamS gamS = zeros([NLEV,NCH]) for c in range(NCH): for l in range(NLEV): sum = 0 for k in range(NLEV): sum += vec[k,l] * gamB[k,c] gamS[l,c] = sum if debug: print("EB:\n",EB) print("ES:\n",ES) print("gamB:\n",gamB) print("gamS:\n",gamS) print('\n') for l in range(NLEV): print("Brune transformation in J,pi=%.1f%c from %9.3f to %9.3f (cm: %9.3f to %9.3f)" % (J,'+' if int(pi)>0 else '-',EB[l],ES[l],EB[l]*lab2cm,ES[l]*lab2cm)) return gamS,ES
35.058824
164
0.482886
a7d5f65f5b5b53596d08250b3e9adbdf803cee76
948
dart
Dart
tests/compiler/dart2js/inference/side_effects/annotations.dart
annagrin/sdk
dfce72bbf9bf359ecd810964259978e24c55e237
[ "BSD-3-Clause" ]
2
2019-08-15T18:30:00.000Z
2020-11-03T20:17:12.000Z
tests/compiler/dart2js/inference/side_effects/annotations.dart
annagrin/sdk
dfce72bbf9bf359ecd810964259978e24c55e237
[ "BSD-3-Clause" ]
1
2021-01-21T14:45:59.000Z
2021-01-21T14:45:59.000Z
tests/compiler/dart2js/inference/side_effects/annotations.dart
annagrin/sdk
dfce72bbf9bf359ecd810964259978e24c55e237
[ "BSD-3-Clause" ]
3
2020-02-13T02:08:04.000Z
2020-08-09T07:49:55.000Z
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. /// Static field used in tests below. var field; /// Read a static field. This adds dependency of static properties to the /// side effects of the method. /*member: readStaticField:SideEffects(reads static; writes nothing)*/ readStaticField() => field; /// Read a static field. If not for the `@pragma('dart2js:noSideEffects')` /// annotation this would add dependency of static properties to the side /// effects of the method. /*member: readStaticFieldAnnotated:SideEffects(reads nothing; writes nothing)*/ @pragma('dart2js:noInline') @pragma('dart2js:noSideEffects') readStaticFieldAnnotated() => field; /*member: main:SideEffects(reads static; writes nothing)*/ main() { readStaticField(); readStaticFieldAnnotated(); }
36.461538
79
0.751055
ef68deb6aaac3332d749ff0f4d5d0aa49c3544a5
623
js
JavaScript
src/what-season.js
Roman-Gukolov/basic-js
1aa857acb89fb585b337097da92e3f3c3faecb29
[ "MIT" ]
null
null
null
src/what-season.js
Roman-Gukolov/basic-js
1aa857acb89fb585b337097da92e3f3c3faecb29
[ "MIT" ]
null
null
null
src/what-season.js
Roman-Gukolov/basic-js
1aa857acb89fb585b337097da92e3f3c3faecb29
[ "MIT" ]
null
null
null
const CustomError = require("../extensions/custom-error"); module.exports = function getSeason(date) { if (!date) { return 'Unable to determine the time of year!'; } date.valueOf(); var winter = [11, 0, 1]; var sping = [2, 3, 4]; var summer = [5, 6, 7]; var autumn = [8, 9, 10]; if (winter.includes(date.getMonth())) { return 'winter'; } else if (sping.includes(date.getMonth())) { return 'spring'; } else if (summer.includes(date.getMonth())) { return 'summer'; } else if (autumn.includes(date.getMonth())) { return 'autumn'; } };
25.958333
58
0.563403
dbdaccbc49d179942a1e55f302a6f114038affea
3,055
php
PHP
resources/views/client/history.blade.php
HemIIH/servitek-german
b25fbb49cd2b9c3f96ab57c2d2fa552749c19e55
[ "MIT" ]
null
null
null
resources/views/client/history.blade.php
HemIIH/servitek-german
b25fbb49cd2b9c3f96ab57c2d2fa552749c19e55
[ "MIT" ]
null
null
null
resources/views/client/history.blade.php
HemIIH/servitek-german
b25fbb49cd2b9c3f96ab57c2d2fa552749c19e55
[ "MIT" ]
null
null
null
@extends('layouts.client') @section('content') <div class="row"> <div class="col-md-6"> <div class="panel panel-default"> <div class="panel-heading"> <h4>{{trans('admin.Kundenhistorie')}}</h4> </div> <div class="panel-body"> <client-history :items="{{ $client->orders()->with('timetrackings')->get() }}"></client-history> </div> </div> </div> <div class="col-md-4"> <div class="panel panel-default"> <div class="panel-heading"> <h4>{{trans('admin.Monatsübersicht')}}</h4> </div> <div class="panel-body"> @if (count($timetrackings_by_date)) <table class="table"> <thead> <tr> <th>{{trans('admin.Monat')}}</th> <th>{{trans('admin.Zeiterfasst')}}</th> </tr> </thead> <tbody> @foreach($timetrackings_by_date as $timetracking) <tr> <td>{{ Date::monthName($timetracking->month) . ' ' . $timetracking->year }}</td> <td>{{ Time::output($timetracking->total_min) }}</td> </tr> @endforeach </tbody> </table> @else <p>{{trans('admin.Keine_zeiterfassten_Aufträg')}}</p> @endif </div> </div> @if (count($timetrackings_by_employee)) <div class="panel panel-default"> <div class="panel-heading"> <h4>{{trans('admin.Eingesetzte Mitarbeiter')}}</h4> </div> <div class="panel-body"> <table class="table"> <thead> <tr> <th>{{trans('admin.Mitarbeiter')}}</th> <th>{{trans('admin.Zeiterfasst')}}</th> </tr> </thead> <tbody> @foreach($timetrackings_by_employee as $timetracking) <tr> <td>{{ $timetracking->employee->last_name . ', ' . $timetracking->employee->first_name }}</td> <td>{{ Time::output($timetracking->total_min) }}</td> </tr> @endforeach </tbody> </table> </div> </div> @endif </div> </div> @stop
41.849315
130
0.343372
e70688079b13ab27df6873943180bed8a6d9e68c
23,743
php
PHP
PYTHIA8/pythia8243/share/Pythia8/phpdoc/Bibliography.php
mpoghos/AliRoot
e81490f640ad6f2a6189f679de96b07a94304b58
[ "BSD-3-Clause" ]
52
2016-12-11T13:04:01.000Z
2022-03-11T11:49:35.000Z
PYTHIA8/pythia8243/share/Pythia8/phpdoc/Bibliography.php
mpoghos/AliRoot
e81490f640ad6f2a6189f679de96b07a94304b58
[ "BSD-3-Clause" ]
1,388
2016-11-01T10:27:36.000Z
2022-03-30T15:26:09.000Z
PYTHIA8/pythia8243/share/Pythia8/phpdoc/Bibliography.php
mpoghos/AliRoot
e81490f640ad6f2a6189f679de96b07a94304b58
[ "BSD-3-Clause" ]
275
2016-06-21T20:24:05.000Z
2022-03-31T13:06:19.000Z
<html> <head> <title>Bibliography</title> <link rel="stylesheet" type="text/css" href="pythia.css"/> <link rel="shortcut icon" href="pythia32.gif"/> </head> <body> <script language=javascript type=text/javascript> function stopRKey(evt) { var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target :((evt.srcElement) ? evt.srcElement : null); if ((evt.keyCode == 13) && (node.type=="text")) {return false;} } document.onkeypress = stopRKey; </script> <?php if($_POST['saved'] == 1) { if($_POST['filepath'] != "files/") { echo "<font color='red'>SETTINGS SAVED TO FILE</font><br/><br/>"; } else { echo "<font color='red'>NO FILE SELECTED YET.. PLEASE DO SO </font><a href='SaveSettings.php'>HERE</a><br/><br/>"; } } ?> <form method='post' action='Bibliography.php'> <h2>Bibliography</h2> <dl> <dt><a name="refAli10">Ali10</a></dt> <dd>S. Alioli, P. Nason, C. Oleari, E. Re, JHEP 1006 (2010) 043, [arXiv:1002.2581 [hep-ph]]</dd> <dt><a name="refAll08">All08</a></dt> <dd>B. Allanach et al., Comput. Phys.Commun. 180 (2009) 8 [arXiv:0801.0045 [hep-ph]]</dd> <dt><a name="refAlt89">Alt89</a></dt> <dd>G. Altarelli, B. Mele and M. Ruiz-Altaba, Z. Phys. C45 (1989) 109</dd> <dt><a name="refAlv99">Alv99</a></dt> <dd>L. Alvero, J.C. Collins, J. Terron and J.J. Whitmore, Phys. Rev. D59 (1999) 074022 [hep-ph/9805268]</dd> <dt><a name="refAlv13">Alv13</a></dt> <dd>M. Alvioli, M. Strikman, Phys. Lett. B722 (2013) 347</dd> <dt><a name="refAlw06">Alw06</a></dt> <dd>J. Alwall et al., Comput. Phys. Commun. 176 (2007) 300 [hep-ph/0609017]</dd> <dt><a name="refAlw07">Alw07</a></dt> <dd>J. Alwall et al., arXiv:0712.3311 [hep-ph]</dd> <dt><a name="refAlw08">Alw08</a></dt> <dd>J. Alwall, S. de Visscher and F. Maltoni, JHEP 0902 (2009) 017 [arXiv:0810.5350 [hep-ph]]</dd> <dt><a name="refAlw11">Alw11</a></dt> <dd>J. Alwall, M. Herquet, F. Maltoni, O. Mattelaer and T. Stelzer, JHEP 1106 (2011) 128 [arXiv:1106.0522 [hep-ph]]</dd> <dt><a name="refAlw14">Alw14</a></dt> <dd>J. Alwall, R. Frederix, S. Frixione, V. Hirschi, F. Maltoni et al., JHEP 1407 (2014) 079 [arXiv:1405.0301 [hep-ph]]</dd> <dt><a name="refAnd83">And83</a></dt> <dd>B. Andersson, G. Gustafson, G. Ingelman and T. Sj&ouml;strand, Phys. Rep. 97 (1983) 31</dd> <dt><a name="refAnd87">And87</a></dt> <dd>B. Andersson, G. Gustafson and B. Nilsson-Almqvist, Nucl. Phys. B281 (1987) 289</dd> <dt><a name="refApp16">App16</a></dt> <dd>R.B. Appleby, R.J. Barlow, J. G Molson, M. Serluca and A. Toader, Eur. Phys. J. C76 (2016) 520</dd> <dt><a name="refArg14">Arg14</a></dt> <dd>S. Argyropoulos and T. Sj&ouml;strand, JHEP 1411 (2014) 043 [arXiv:1407.6653 [hep-ph]] </dd> <dt><a name="refAsk09">Ask09</a></dt> <dd>S. Ask, Eur. Phys. J. C60 (2009) 509</dd> <dt><a name="refAsk10">Ask10</a></dt> <dd>S. Ask et al., Comput. Phys. Commun. 181 (2010) 1593 [arXiv:0912.4233v1 [hep-ph]] </dd> <dt><a name="refAsk11">Ask11</a></dt> <dd>S. Ask, J.H. Collins, J.R. Forshaw, K. Joshi and A.D. Pilkington, JHEP 1201 (2012) 018 [arXiv:1108.2396 [hep-ph]] </dd> <dt><a name="refATL12">ATL12</a></dt> <dd>ATLAS Collaboration, ATL-PHYS-PUB-2012-003</dd> <dt><a name="refATL14">ATL14</a></dt> <dd>ATLAS Collaboration, JHEP 09 (2014) 145 [arXiv:1406.3660 [hep-ex]]</dd> <dt><a name="refATL14a">ATL14a</a></dt> <dd>ATLAS Collaboration, ATL-PHYS-PUB-2014-021</dd> <dt><a name="refAzu05">Azu05</a></dt> <dd>G. Azuelos, P.-H. Beauchemin and C.P. Burgess, J. Phys. G31 (2005) 1</dd> <dt><a name="refBai83">Bai83</a></dt> <dd>R. Baier and R. R&uuml;ckl, Z. Phys. C19 (1983) 251</dd> <dt><a name="refBal00">Bal00</a></dt> <dd>G. S. Bali, Phys.Rev. D62 (2000) 114503</dd> <dt><a name="refBar94">Bar94</a></dt> <dd>E. Barberio and Z. Was, Comput. Phys.Commun. 79 (1994) 291</dd> <dt><a name="refBar07">Bar07</a></dt> <dd>M. Bargiotti and V. Vagnoni, public note LHCb-2007-042</dd> <dt><a name="refBau90">Bau90</a></dt> <dd>U. Baur, M. Spira and P. M. Zerwas, Phys. Rev. D42 (1990) 815; <br/>C. Berger et al., CERN Yellow Reports 90-10, Vol. II, p.1014</dd> <dt><a name="refBay95">Bay95</a></dt> <dd>G. Baym, B. Blattel, L. L. Frankfurt, H. Heiselberg and M. Strikman, <br/>Phys. Rev. C52 (1995) 1604-1617 [arXiv:nucl-th/9502038]</dd> <dt><a name="refBel10">Bel10</a></dt> <dd>G. Bella et al., arXiv:1004.1649 [hep-ex], <br/>G. Bella et al., JHEP 1009 (2010) 025 [arXiv:1004.2432 [hep-ex]]</dd> <dt><a name="refBen85">Ben85</a></dt> <dd>H.-U. Bengtsson, W.-S. Hou, A. Soni and D.H. Stork, Phys. Rev. Lett. 55 (1985) 2762</dd> <dt><a name="refBen87">Ben87</a></dt> <dd>M. Bengtsson and T. Sj&ouml;strand, Phys.Lett. B185 (1987) 435, Nucl. Phys. B289 (1987) 810</dd> <dt><a name="refBer81">Ber81</a></dt> <dd>F.A. Berends, R. Kleiss, P. De Causmaecker, R. Gastmans and T.T. Wu, Phys. Lett. 103B (1981) 124</dd> <dt><a name="refBer87">Ber87</a></dt> <dd>UA4 Collaboration, D. Bernard et al., Phys. Lett. B198 (1987) 583</dd> <dt><a name="refBer87a">Ber87a</a></dt> <dd>E. Berger, J. Collins, D. Soper and G. Sterman, Nucl. Phys. B286 (1987) 704; <br/>K. Streng, CERN-TH.4949 (1988)</dd> <dt><a name="refBer17">Ber17</a></dt> <dd>V. Bertone, S. Carrazza, N.P. Hartland and J. Rojo, arXiv:1712.07053 [hep-ph]</dd> <dt><a name="refBer18">Ber18</a></dt> <dd>V. Bertone, R. Gauld and J. Rojo, arXiv:1808.02034 [hep-ph]</dd> <dt><a name="refBer12">Ber12</a></dt> <dd>Particle Data Group, J. Beringer et al., Phys. Rev. D86 (2012) 010001</dd> <dt><a name="refBie14">Bie14</a></dt> <dd>C. Bierlich et al., JHEP 1503 (2015) 148, arXiv:1412.6259 [hep-ph]</dd> <dt><a name="refBie15">Bie15</a></dt> <dd>C. Bierlich and J. R. Christiansen, Phys.Rev. D92 (2015) no.9, 094010 arXiv:1507.02091 [hep-ph]</dd> <dt><a name="refBie16a">Bie16a</a></dt> <dd>C. Bierlich, G. Gustafson and L. L&ouml;nnblad, JHEP 1610 (2016) 139 [arXiv:1607.04434 [hep-ph]]</dd> <dt>Bie16b</dt> <dd>C. Bierlich, G. Gustafson and L. L&ouml;nnblad, LU-TP-16-64, arXiv:1612.05132 [hep-ph]</dd> <dt><a name="refBie16c">Bie16c</a></dt> <dd>C. Bierlich, PoS DIS20016 (2016) 051, arXiv:1606.09456 [hep-ph]</dd> <dt><a name="refBie17">Bie17</a></dt> <dd>C. Bierlich, G. Gustafson and L. L&ouml;nnblad, Phys.Lett B779 (2018) 58-63, arXiv:1710.09725 [hep-ph]</dd> <dt><a name="refBij01">Bij01</a></dt> <dd>J. Bijnens et al., Phys. Lett. B503 (2001) 341</dd> <dt><a name="refBir84">Bir84</a></dt> <dd>T. Biro et al., Nucl.Phys. B245 (1984) 449</dd> <dt><a name="refBoo01">Boo01</a></dt> <dd>E. Boos et al., in the Proceedings of the Workshop on Physics at TeV Colliders, Les Houches, France, 21 May - 1 Jun 2001 [hep-ph/0109068]</dd> <dt><a name="refBow81">Bow81</a></dt> <dd>M.G. Bowler, Z. Phys. C11 (1981) 169</dd> <dt><a name="refBoz07">Boz07</a></dt> <dd>G. Bozzi, B. Fuks, B. Herrmann, M. Klasen, Nucl. Phys. B787 (2007) 1 [arXiv:0704.1826 [hep-ph]]</dd> <dt><a name="refBro09">Bro09</a></dt> <dd>W. Broniowski M. Rybczynski and P. Bozek, Comput. Phys. Commun. 180 (2009) 69 [arXiv:0710.5731 [nucl-th]]</dd> <dt><a name="refBru93">Bru93</a></dt> <dd>P. Bruni and G. Ingelman, Phys. Lett. B311 (1993) 317</dd> <dt><a name="refBuc10">Buc10</a></dt> <dd>A. Buckley et al., Comput. Phys. Commun. 184 (2013) 2803 [arXiv:1003.0694 [hep-ph]]</dd> <dt><a name="refBuc11">Buc11</a></dt> <dd>A. Buckley et al., Phys. Rep. 504 (2011) 145 [arXiv:1101.2599 [hep-ph]]</dd> <dt><a name="refBuc15">Buc15</a></dt> <dd>A. Buckley et al., Eur.Phys.J. C75 (2015) 3, 132 [arXiv:1412.7420 [hep-ph]]</dd> <dt><a name="refBut14">But14</a></dt> <dd>J. Butterworth et al., arXiv:1405.1067 [hep-ph]</dd> <dt><a name="refCab17">Cab17</a></dt> <dd>B. Cabouat and T. Sj&ouml;strand, LU TP 17-28, MCnet-17-14, arXiv:1710.00391 [hep-ph]</dd> <dt><a name="refCac06">Cac06</a></dt> <dd>M. Cacciari and G.P. Salam, Phys. Lett. B641 (2006) 57 [hep-ph/0512210]</dd> <dt><a name="refCac08">Cac08</a></dt> <dd>M. Cacciari, G.P. Salam and G. Soyez, JHEP 04 (2008) 063 [arXiv:0802.1189 [hep-ph]]</dd> <dt><a name="refCac12">Cac12</a></dt> <dd>M. Cacciari, G.P. Salam and G. Soyez, Eur. Phys. J. C72 (2012) 1896 [arXiv:1111.6097 [hep-ph]]</dd> <dt><a name="refCah82">Cah82</a></dt> <dd>R. Cahn, Z. Physik C15 (1982) 253</dd> <dt><a name="refCar10">Car10</a></dt> <dd>L. Carloni and T. Sj&ouml;strand, JHEP 1009 (2010) 105 [arXiv:1006.2911 [hep-ph]] </dd> <dt><a name="refCar11">Car11</a></dt> <dd>L. Carloni, J. Rathsman and T. Sj&ouml;strand, JHEP 1104 (2011) 091 [arXiv:1102.3795 [hep-ph]]</dd> <dt><a name="refCat91">Cat91</a></dt> <dd>S. Catani, G. Marchesini and B.R. Webber, Nucl.Phys. B349 (1991) 635</dd> <dt><a name="refChe07">Che07</a></dt> <dd>K. Cheung, W.-Y. Keung and T.-C. Yuan, Phys. Rev. D76 (2007) 055003</dd> <dt><a name="refChe14">Che14</a></dt> <dd>S.Chekanov, E.May, K. Strand, P. Van Gemmeren, Comput. Phys.Commun. 185 (2014) 2629 [arXiv:1311.1229]</dd> <dt><a name="refCho96">Cho96</a></dt> <dd>P. Cho and A. Leibovich, Phys. Rev. D53 (1996) 6203 [hep-ph/9511315]</dd> <dt><a name="refChr14">Chr14</a></dt> <dd>J.R. Christiansen and T. Sj&ouml;strand, JHEP 04 (2014) 115 [arXiv:1401.5238 [hep-ph]]</dd> <dt><a name="refChr14a">Chr14a</a></dt> <dd>J.R. Christiansen and P.Z. Skands, JHEP 1508 (2015) 003 [arXiv:1505.01681 [hep-ph]]</dd> <dt><a name="refChr15a">Chr15a</a></dt> <dd>J.R. Christiansen and S. Prestel, Eur. Phys. J. C76 (2016) 1, 39 [arXiv:1510.01517 [hep-ph]]</dd> <dt><a name="refCie12">Cie12</a></dt> <dd>R. Ciesielski and K. Goulianos, PoS ICHEP2012 (2013) 301 [arXiv:1205.1446 [hep-ph]]</dd> <dt><a name="refCio08">Cio08</a></dt> <dd>C. Ciobanu et al., FERMILAB-FN-0773, CDF/PHYS/PUBLIC/7755 (2008)</dd> <dt><a name="refCli014">Cli014</a></dt> <dd>J. M. Cline et al., JHEP 1408 (2014) 131 [arXiv:1405.7691 [hep-ph]]</dd> <dt><a name="refCMS14">CMS14</a></dt> <dd>CMS Collaboration, CMS PAS GEN-14-001, arXiv:1512.00815</dd> <dt><a name="refCor03">Cor03</a></dt> <dd>F. Cornet, P. Jankowski, M. Krawczyk and A. Lorca, Phys. Rev. D68 (2003) 014010</dd> <dt><a name="refCor09">Cor09</a></dt> <dd>R. Corke and T. Sj&ouml;strand, JHEP 1001 (2010) 035 [arXiv:0911.1909 [hep-ph]]</dd> <dt><a name="refCor10">Cor10</a></dt> <dd>R. Corke and T. Sj&ouml;strand, Eur. Phys. J. C69 (2010) 1 [arXiv:1003.2384 [hep-ph]]</dd> <dt><a name="refCor10a">Cor10a</a></dt> <dd>R. Corke and T. Sj&ouml;strand, JHEP 1103 (2011) 032 [arXiv:1011.1759 [hep-ph]]</dd> <dt><a name="refCor11">Cor11</a></dt> <dd>R. Corke and T. Sj&ouml;strand, JHEP 1105 (2011) 009 [arXiv:1101.5953 [hep-ph]] </dd> <dt><a name="refDal15">Dal15</a></dt> <dd>L.A. Dal, A.R. Raklev, Phys. Rev. D91 (2015) 123536 [arXiv:1504.07242 [hep-ph]]</dd> <dt><a name="refDav01">Dav01</a></dt> <dd>H. Davoudiasl, J.L. Hewett and T.G. Rizzo, Phys. Rev. D63 (2001) 075004</dd> <dt><a name="refDav10">Dav10</a></dt> <dd>N. Davidson, T. Przedzinski and Z. Was, arXiv:1011.0937 [hep-ph]</dd> <dt><a name="refDes11">Des11</a></dt> <dd>N. Desai and P. Skands, Eur. Phys. J. C72 (2012) 2238 [arXiv:1109.5852 [hep-ph]]</dd> <dt><a name="refDes18">Des18</a></dt> <dd>N. Desai, arXiv:1807.04240 [hep-ph]</dd> <dt><a name="refDob01">Dob01</a></dt> <dd>M. Dobbs and J.B. Hansen, Comput. Phys. Commun. 134 (2001) 41</dd> <dt><a name="refDon84">Don84</a></dt> <dd>A. Donnachie and P.V. Landshoff, Nucl. Phys. B244 (1984) 322</dd> <dt><a name="refDon92">Don92</a></dt> <dd>A. Donnachie and P.V. Landshoff, Phys. Lett. B296 (1992) 227</dd> <dt><a name="refEde97">Ede97</a></dt> <dd>P. Eden and G. Gustafson, Z. Phys. C75 (1997) 41</dd> <dt><a name="refEic83">Eic83</a></dt> <dd>E. Eichten, K. D. Lane and M. E. Peskin, Phys. Rev. Lett. 50 (1983) 811; <br/>P. Chiappetta and M. Perrottet, CERN Yellow Report 90-10, Vol. II, p. 806</dd> <dt><a name="refEsk09">Esk09</a></dt> <dd>K.J. Eskola, H. Paukkunen and C.A. Salgado, JHEP 0904 (2009) 065 [arXiv:0902.4154 [hep-ph]]</dd> <dt><a name="refEsk16">Esk16</a></dt> <dd>K.J. Eskola, P.Paakkinen, H. Paukkunen and C.A. Salgado, Eur. Phys. J. C77 (2017) 163 [arXiv:1612.05741 [hep-ph]]</dd> <dt><a name="refFis16">Fis16</a></dt> <dd>N. Fischer and T. Sj&ouml;strand, JHEP 1701 (2017) 140 [arXiv:1610.09818 [hep-ph]]</dd> <dt><a name="refFle10">Fle10</a></dt> <dd>C. Flensburg and G. Gustafson, JHEP 1004 (2010) 014 [arXiv:1004.5502 [hep-ph]]</dd> <dt><a name="refFra11">Fra11</a></dt> <dd>R. Franceschini, G.F. Giudice, P.P. Giardino, P. Lodone and A. Strumia, JHEP 1105 (2011) 092 [arXiv:1101.4919 [hep-ph]] </dd> <dt><a name="refFre11">Fre11</a></dt> <dd>R. Frederix, S. Frixione, V. Hirschi, F. Maltoni, R. Pittau and P. Torrielli, Phys.Lett. B701 (2011) 427 [arXiv:1104.5613 [hep-ph]]</dd> <dt><a name="refFre12">Fre12</a></dt> <dd>R. Frederix, S. Frixione, JHEP 1212 (2012) 061 [arXiv:1209.6215 [hep-ph]]</dd> <dt><a name="refFri02">Fri02</a></dt> <dd>S. Frixione and B.R. Webber, JHEP 0206 (2002) 029 [hep-ph/0204244]</dd> <dt><a name="refFuk11">Fuk11</a></dt> <dd>B. Fuks, B. Hermann, and M. Klasen, Phys.Rev. D86 (2012) 015002 [arXiv:1112.4838]</dd> <dt><a name="refGas87">Gas87</a></dt> <dd>R. Gastmans, W. Troost and T. Wu, Phys.Lett. B184 (1987) 257</dd> <dt><a name="refGlu95">Glu95</a></dt> <dd>M. Gl&uuml;ck, E. Reya and A. Vogt, Z. Phys. C67 (1995) 433</dd> <dt><a name="refGiu99">Giu99</a></dt> <dd>G.F. Giudice, R. Rattazzi and J.D. Wells, Nucl. Phys. B544 (1999) 3</dd> <dt><a name="refGiu04">Giu04</a></dt> <dd>G.F. Giudice, T. Plehn and A. Strumia, Nucl. Phys. B706 (2005) 455</dd> <dt><a name="refGoh18">Goh18</a></dt> <dd>M. Goharipour, H. Khanpour and V. Guzey, Eur. Phys. J. C78 (2018) 309 [arXiv:1802.01363 [hep-ph]]</dd> <dt><a name="refGre07">Gre07</a></dt> <dd>D. Grellscheid and P. Richardson, arXiv:0810.1951 [hep-ph]</dd> <dt><a name="refGun86">Gun86</a></dt> <dd>J.F. Gunion and Z. Kunszt, Phys. Rev. D33 (1986) 665</dd> <dt><a name="refGus86">Gus86</a></dt> <dd>G. Gustafson, Phys. Lett. B175 (1986) 453; <br/>G. Gustafson and U. Pettersson, Nucl. Phys. B306 (1988) 746; <br/>L. L&ouml;nnblad, Comput. Phys. Commun. 71 (1992) 15</dd> <dt><a name="refH1P06">H1P06</a></dt> <dd>H1 Collaboration, A. Aktas et al., Eur. Phys. J. C48 (2006) 715 [hep-ex/0606004]</dd> <dt><a name="refH1P06a">H1P06a</a></dt> <dd>H1 Collaboration, A. Aktas et al., Eur. Phys. J. C48 (2006) 749 [hep-ex/0606003]</dd> <dt><a name="refH1P07">H1P07</a></dt> <dd>H1 Collaboration, A. Aktas et al., JHEP 0710 (2007) 042 [arXiv:0708.3217 [hep-ex]]</dd> <dt><a name="refHew88">Hew88</a></dt> <dd>J.L. Hewett and S. Pakvasa, Phys. Rev. D37 (1988) 3165</dd> <dt><a name="refHew99">Hew99</a></dt> <dd>J.L Hewett, Phys. Rev. Lett. 82 (1999) 4765 [hep-ph/9811356]</dd> <dt><a name="refHew07">Hew07</a></dt> <dd>J. L. Hewett and T. G. Rizzo, JHEP 0712 (2007) 009</dd> <dt><a name="refHui97">Hui97</a></dt> <dd>K. Huitu, J. Maalampi, A. Pietil&auml; and M. Raidal, Nucl. Phys. B487 (1997) 27 and private communication; <br/>G. Barenboim, K. Huitu, J. Maalampi and M. Raidal, Phys. Lett. B394 (1997) 132</dd> <dt><a name="refHum83">Hum83</a></dt> <dd>B. Humpert and P. Mery, Z. Phys. C20 (1983) 83</dd> <dt><a name="refIlt12">Ilt12</a></dt> <dd>P. Ilten, arXiv:1211.6730 [hep-ph], to appear in the proceedings of Tau2012, Nagoya, Japan, 17-21 September 2012 </dd> <dt><a name="refIlt14">Ilt14</a></dt> <dd>P. Ilten, Ph.D. thesis, arXiv:1401.4902 [hep-ex] </dd> <dt><a name="refIng85">Ing85</a></dt> <dd>G.Ingelman and P. Schlein, Phys. Lett. B152 (1985) 256</dd> <dt><a name="refIng97">Ing97</a></dt> <dd>P.Bruni, A. Edin and G.Ingelman, unpublished </dd> <dt><a name="refJad90">Jad90</a></dt> <dd>S. Jadach, J.H. Kuhn and Z. Was, Comput. Phys. Commun. 64 (1990) 275; S. Jadach, Z. Was, R. Decker and J.H. Kuhn, Comput. Phys. Commun. 76 (1993) 361</dd> <dt><a name="refJun95">Jun95</a></dt> <dd>H. Jung, Comput. Phys. Commun. 86 (1995) 147</dd> <dt><a name="refKap80">Kap80</a></dt> <dd>J. Kapusta, Phys. Rev. C21 (1980) 1301</dd> <dt><a name="refKas10">Kas10</a></dt> <dd>T. Kasemets, LU TP 10-03, arXiv:1002.4376 [hep-ph]; <br/>T. Kasemets and T. Sj&ouml;strand, Eur. Phys. J. C69 (2010) 19 [arXiv:1007.0897 [hep-ph]]</dd> <dt><a name="refKle89">Kle89</a></dt> <dd>R. Kleiss et al., in `Z physics at LEP 1', eds. G. Altarelli, R. Kleiss and C. Verzegnassi, CERN 89-08 (Geneva, 1989), Vol. 3, p. 143</dd> <dt><a name="refKra04">Kra04</a></dt> <dd>A. Kraan, Eur. Phys. J. C37 (2004) 91</dd> <dt><a name="refKra08">Kra08</a></dt> <dd>A. Kraan, arXiv:0807.3123 [hep-ex]</dd> <dt><a name="refKum08">Kum08</a></dt> <dd>M.C. Kumar, P. Mathews, V. Ravindran and A. Tripathi, Phys. Rev. D77 (2008) 055013</dd> <dt><a name="refLai00">Lai00</a></dt> <dd>CTEQ Collaboration, H.L. Lai et al., Eur. Phys. J. C12 (2000) 375</dd> <dt><a name="refLon95">Lon95</a></dt> <dd>L. L&ouml;nnblad and T. Sj&ouml;strand, Phys. Lett. B351 (1995) 293, Eur. Phys. J. C2 (1998) 165</dd> <dt><a name="refLon01">Lon01</a></dt> <dd> L. L&ouml;nnblad, JHEP 05 (2002) 046 [hep-ph/0112284]</dd> <dt><a name="refLon11">Lon11</a></dt> <dd>L. L&ouml;nnblad and S. Prestel, JHEP 03 (2012) 019 [arXiv:1109.4829 [hep-ph]]</dd> <dt><a name="refLon12">Lon12</a></dt> <dd>L. L&ouml;nnblad and S. Prestel, JHEP 02 (2013) 094 [arXiv:1211.4827 [hep-ph]]</dd> <dt><a name="refLon13">Lon13</a></dt> <dd>L. L&ouml;nnblad and S. Prestel, JHEP 1303 (2013) 166 [arXiv:1211.7278 [hep-ph]]</dd> <dt><a name="refLon13a">Lon13a</a></dt> <dd>L. L&ouml;nnblad, EPJC 73 (2013) 2350 [arXiv:1211.7204 [hep-ph]]</dd> <dt><a name="refMac07">Mac07</a></dt> <dd>R. Mackeprang and A. Rizzi, Eur. Phys. J. C50 (2007) 353</dd> <dt><a name="refMan02">Man02</a></dt> <dd>M. Mangano, <a href="http://www-cpd.fnal.gov/personal/mrenna/tuning/nov2002/mlm.pdf.gz"> "The so-called MLM prescription for ME/PS matching." </a>, presented at the Fermilab ME/MC Tuning Workshop, October 4, 2002. </dd> <dt><a name="refMan03">Man03</a></dt> <dd>M. L. Mangano, M. Moretti, F. Piccinini, R. Pittau and A. D. Polosa, JHEP 0307 (2003) 001 [hep-ph/0206293]</dd> <dt><a name="refMan07">Man07</a></dt> <dd>M.L. Mangano, M. Moretti, F. Piccinini and M. Treccani, JHEP 0701 (2007) 013 [hep-ph/0611129]</dd> <dt><a name="refMar90">Mar90</a></dt> <dd>G. Marsaglia, A. Zaman and W.-W. Tsang, Stat. Prob. Lett. 9 (1990) 35</dd> <dt><a name="refMar05">Mar05</a></dt> <dd>A.D. Martin, R.G. Roberts, W.J. Stirling and R.S. Thorne, Eur. Phys. J. C39 (2005) 155</dd> <dt><a name="refMiu99">Miu99</a></dt> <dd>G. Miu and T. Sj&ouml;strand, Phys. Lett. B449 (1999) 313</dd> <dt><a name="refMre16">Mre16</a></dt> <dd>S. Mrenna and P. Skands, "Automated Parton-Shower Variations in Pythia 8"; in preparation (2016)</dd> <dt><a name="refNas00">Nas00</a></dt> <dd>P. Nason et al., in "Standard model physics (and more) at the LHC", eds. G. Altarelli and M.L. Mangano, CERN 2000-004, p. 231 [hep-ph/0003142]</dd> <dt><a name="refNas04">Nas04</a></dt> <dd>P. Nason, JHEP 0411 (2004) 040 [hep-ph/0409146]</dd> <dt><a name="refNav10">Nav10</a></dt> <dd>S. Navin, arXiv:1005.3894 [hep-ph]</dd> <dt><a name="refNor00">Nor00</a></dt> <dd>E. Norrbin and T. Sj&ouml;strand, Eur. Phys. J. C17 (2000) 137</dd> <dt><a name="refNor01">Nor01</a></dt> <dd>E. Norrbin and T. Sj&ouml;strand, Nucl. Phys. B603 (2001) 297</dd> <dt><a name="refOle13">Ole13</a></dt> <dd>C. Oleari and P. Nason, arXiv:1303.3922 [hep-ph]</dd> <dt><a name="refPat16">Pat16</a></dt> <dd>Particle Data Group, C. Patrignani et al., Chin.Phys. C40 (2016) 100001</dd> <dt><a name="refPet83">Pet83</a></dt> <dd>C. Peterson, D. Schlatter, I. Schmitt and P. Zerwas, Phys. Rev. D27 (1983) 105</dd> <dt><a name="refQia02">Qia02</a></dt> <dd>C. Qiao, Phys. Rev. D66 (2002) 057504</dd> <dt><a name="refRas16">Ras16</a></dt> <dd>C.O. Rasmussen and T. Sj&ouml;strand, JHEP 02 (2016) 142 [arXiv:1512.05525 [hep-ph]]</dd> <dt><a name="refRiz08">Riz08</a></dt> <dd>T. G. Rizzo, Phys. Lett. B665 (2008) 361</dd> <dt><a name="refRyb14">Ryb14</a></dt> <dd>M. Rybczynski, G. Stefanek, W. Broniowski and P. Bozek, Comput. Phys. Commun. 185 (2014) 1759 [arXiv:1310.5475 [nucl-th]]</dd> <dt><a name="refSav91">Sav91</a></dt> <dd>G. Savvidy and N. Ter-Arutyunyan-Savvidy, J. Comput. Phys. 97 (2016) 566</dd> <dt><a name="refSav15">Sav15</a></dt> <dd>K. Savvidy, Comput. Phys. Commun. 196 (2015) 161 [arXiv:1403.5355]</dd> <dt><a name="refSav16">Sav16</a></dt> <dd>K. Savvidy and G. Savvidy, Chaos, Solitons & Fractals 91 (2016) 33</dd> <dt><a name="refScd63">Scd63</a></dt> <dd>A. Schwarzchild, C. Zupancic, Phys. Rev. 129 (1963) 854</dd> <dt><a name="refSch94">Sch94</a></dt> <dd>G.A. Schuler and T. Sj&ouml;strand, Phys. Rev. D49 (1994) 2257</dd> <dt><a name="refSch97">Sch97</a></dt> <dd>G.A. Schuler and T. Sj&ouml;strand, Z. Phys. C73 (1997) 677</dd> <dt><a name="refScw15">Scw15</a></dt> <dd>P. Schwaller, D. Stolarski and A. Weiler, JHEP 1505 (2015) 059 [arXiv:1502.05409 [hep-ph]]</dd> <dt><a name="refSey95">Sey95</a></dt> <dd>M. Seymour, Phys. Lett. B354 (1995) 409</dd> <dt><a name="refSha15">Sha15</a></dt> <dd>H.S. Shao, Comput. Phys. Commun. 198 (2016) 238 [arXiv:1507.03435]</dd> <dt><a name="refSjo84">Sjo84</a></dt> <dd>T. Sj&ouml;strand, Nucl. Phys. B248 (1984) 469</dd> <dt><a name="refSjo85">Sjo85</a></dt> <dd>T. Sj&ouml;strand, Phys. Lett. 157B (1985) 321; <br/>M. Bengtsson, T. Sj&ouml;strand and M. van Zijl, Z. Phys. C32 (1986) 67 </dd> <dt><a name="refSjo87">Sjo87</a></dt> <dd>T. Sj&ouml;strand and M. van Zijl, Phys. Rev. D36 (1987) 2019</dd> <dt><a name="refSjo94">Sjo94</a></dt> <dd>T. Sj&ouml;strand and V.A. Khoze, Z.Phys. C62 (1994) 281, Phys.Rev.Lett. 72 (1994) 28</dd> <dt><a name="refSjo03">Sjo03</a></dt> <dd>T. Sj&ouml;strand and P.Z. Skands, Nucl. Phys. B659 (2003) 243</dd> <dt><a name="refSjo04">Sjo04</a></dt> <dd>T. Sj&ouml;strand and P.Z. Skands, JHEP 03 (2004) 053</dd> <dt><a name="refSjo05">Sjo05</a></dt> <dd>T. Sj&ouml;strand and P.Z. Skands, Eur. Phys. J. C39 (2005) 129</dd> <dt><a name="refSjo06">Sjo06</a></dt> <dd>T. Sj&ouml;strand, S. Mrenna and P.Z. Skands, JHEP 05 (2006) 026 [hep-ph/0603175]</dd> <dt><a name="refSjo08">Sjo08</a></dt> <dd>T. Sj&ouml;strand, S. Mrenna and P.Z. Skands, Comput. Phys. Commun. 178 (2008) 852 [arXiv:0710.3820]</dd> <dt><a name="refSjo15">Sjo15</a></dt> <dd>T. Sj&ouml;strand et al., Comput. Phys.Commun. 191 (2015) 159 [arXiv:1410.3012 [hep-ph]]</dd> <dt><a name="refSka04">Ska04</a></dt> <dd>P. Skands et al., JHEP 07 (2004) 036 [hep-ph/0311123]</dd> <dt><a name="refSka14">Ska14</a></dt> <dd>P. Skands, S. Carrazza and J. Rojo, Eur.Phys.J. C74 (2014) 8, 3024 [arXiv:1404.5630 [hep-ph]]</dd> <dt><a name="refTul09">Tul09</a></dt> <dd> J. Tully, Monte Carlo simulations of hard QCD radiation, Doctoral Thesis, Durham University (2009) </dd> <dt><a name="refWha05">Wha05</a></dt> <dd>M.R. Whalley, D. Bourilkov and R.C. Group, in `HERA and the LHC', eds. A. De Roeck and H. Jung, CERN-2005-014, p. 575 [hep-ph/0508110]</dd> <dt><a name="refYao06">Yao06</a></dt> <dd>Particle Data Group, W.-M. Yao et al., J. Phys. G33 (2006) 1</dd> <dt><a name="refYua98">Yua98</a></dt> <dd>F. Yuan, C. Qiao and K. Chao, Phys. Rev. D59 (1998) 014009 [hep-ph/9807329]</dd> </dl> </body> </html> <!-- Copyright (C) 2019 Torbjorn Sjostrand -->
34.610787
116
0.620351
79839e2a46eee64ffe1de2f0ff42893bb7394229
2,412
php
PHP
modules/ModUsuarios/models/Utils.php
development2gom/green-tenderos-admin
d6a8b5f9f2df792f0ce3f815cd4363d2d9914a98
[ "BSD-3-Clause" ]
null
null
null
modules/ModUsuarios/models/Utils.php
development2gom/green-tenderos-admin
d6a8b5f9f2df792f0ce3f815cd4363d2d9914a98
[ "BSD-3-Clause" ]
null
null
null
modules/ModUsuarios/models/Utils.php
development2gom/green-tenderos-admin
d6a8b5f9f2df792f0ce3f815cd4363d2d9914a98
[ "BSD-3-Clause" ]
null
null
null
<?php namespace app\modules\ModUsuarios\models; use Yii; class Utils { /** * Genera un token para guardarlo en la base de datos * * @param string $pre * @return string */ public static function generateToken($pre = 'tok') { $token = $pre . md5 ( uniqid ( $pre ) ) . uniqid (); return $token; } /** * Obtiene fecha de vencimiento para una fecha * @param unknown $fechaActualTimestamp */ public static function getFechaVencimiento($fechaActualTimestamp) { $date = date ( 'Y-m-d H:i:s', strtotime ( "+".Yii::$app->params ['modUsuarios'] ['recueperarPass'] ['diasValidos']." day", strtotime ( $fechaActualTimestamp ) ) ); return $date; } /** * Envia el correo electronico para la activiación de la cuenta * * @param array $parametrosEmail * @return boolean */ public function sendEmailActivacion($email,$parametrosEmail) { // Envia el correo electronico return $this->sendEmail ( '@app/modules/ModUsuarios/email/activarCuenta', '@app/modules/ModUsuarios/email/layouts/text', Yii::$app->params ['modUsuarios'] ['email'] ['emailActivacion'],$email, Yii::$app->params ['modUsuarios'] ['email'] ['subjectActivacion'], $parametrosEmail ); } /** * Envia el correo electronico para recuperar el correo electronico * * @param array $parametrosEmail * @return boolean */ public function sendEmailRecuperarPassword($email,$parametrosEmail) { // Envia el correo electronico return $this->sendEmail ( '@app/modules/ModUsuarios/email/recuperarPassword', '@app/modules/ModUsuarios/email/layouts/text', Yii::$app->params ['modUsuarios'] ['email'] ['emailRecuperarPass'], $email, Yii::$app->params ['modUsuarios'] ['email'] ['subjectRecuperarPass'], $parametrosEmail ); } /** * Envia mensaje de correo electronico * * @param string $templateHtml * @param string $templateText * @param string $from * @param string $to * @param string $subject * @param array $params * @return boolean */ private function sendEmail($templateHtml, $templateText, $from, $to, $subject, $params) { return Yii::$app->mailer->compose ( [ // 'html' => '@app/mail/layouts/example', // 'text' => '@app/mail/layouts/text' 'html' => $templateHtml, //'text' => $templateText ], $params )->setFrom ( $from )->setTo ( $to )->setSubject ( $subject )->send (); } }
32.594595
292
0.649668
8534c4ff95ae2e10a4b293e48fc0f69f22ed5f34
2,717
swift
Swift
Tuna/Tuna/Internal/Networking/Core/HTTP/HTTPLoading.swift
tuna-software/ios-core-sdk
3ad9d94cd42705b98e29d2a416abc3873e9b1cd0
[ "BSD-2-Clause" ]
1
2021-06-25T15:30:57.000Z
2021-06-25T15:30:57.000Z
Tuna/Tuna/Internal/Networking/Core/HTTP/HTTPLoading.swift
tuna-software/ios-core-sdk
3ad9d94cd42705b98e29d2a416abc3873e9b1cd0
[ "BSD-2-Clause" ]
null
null
null
Tuna/Tuna/Internal/Networking/Core/HTTP/HTTPLoading.swift
tuna-software/ios-core-sdk
3ad9d94cd42705b98e29d2a416abc3873e9b1cd0
[ "BSD-2-Clause" ]
null
null
null
// // HTTPLoading.swift // Tuna // // Created by Guilherme Rambo on 24/03/21. // import Foundation import os.log protocol HTTPLoading: AnyObject { func load(_ request: HTTPRequest, completion: @escaping (HTTPResult) -> Void) } extension URLSession: HTTPLoading { static let log = OSLog.tunaCoreLog(for: "URLSession+HTTPLoading") func load(_ request: HTTPRequest, completion: @escaping (HTTPResult) -> Void) { guard let url = request.url else { os_log("Failed to generate URL for request %@", log: Self.log, type: .fault, request.debugDescription) completion(.failure(.init(request: request, tunaError: TunaError(localizedDescription: "Invalid request.")))) return } var urlRequest = URLRequest(url: url) urlRequest.httpMethod = request.method.rawValue for (header, value) in request.headers { urlRequest.addValue(value, forHTTPHeaderField: header) } if !request.body.isEmpty { if let contentType = request.body.contentType { urlRequest.addValue(contentType, forHTTPHeaderField: "content-type") } do { urlRequest.httpBody = try request.body.encode() } catch { os_log("Failed to encode request body for request %@: %{public}@", log: Self.log, type: .error, request.debugDescription, String(describing: error)) completion(.failure(.init(request: request, tunaError: TunaError(localizedDescription: "Failed to encode request body: \(error).")))) } } let task = dataTask(with: urlRequest) { data, response, error in var httpResponse: HTTPResponse? if let res = response as? HTTPURLResponse { httpResponse = HTTPResponse( request: request, response: res, body: data ?? Data() ) } if let error = error { completion(.failure( HTTPError( apiError: nil, request: request, response: httpResponse, underlyingError: error ) )) return } if let response = httpResponse { completion(.success(response)) } else { completion(.failure(.init(request: request, response: nil, tunaError: TunaError(localizedDescription: "No response.")))) } } task.resume() } }
33.9625
164
0.537725
bff12f8f3ebddec3e921976739d8162c5d847cde
1,635
rb
Ruby
deps/mruby-minidsl/test/minidsl.rb
accaman/mruby-meltingpot
5554a8ce31212d7f1edda42044667a0f9eb6189c
[ "MIT" ]
null
null
null
deps/mruby-minidsl/test/minidsl.rb
accaman/mruby-meltingpot
5554a8ce31212d7f1edda42044667a0f9eb6189c
[ "MIT" ]
null
null
null
deps/mruby-minidsl/test/minidsl.rb
accaman/mruby-meltingpot
5554a8ce31212d7f1edda42044667a0f9eb6189c
[ "MIT" ]
null
null
null
class Klass < MiniDSL field :foo, :t => String field :bar, :t => String, :as => :baz field :qux, :t => Array , :freeze => true field :quux, :t => Fixnum, :load => Proc.new { |a| a.reduce(0) { |n, m| m += n } } end assert("MiniDSL.field") do assert_true Klass.method_defined?(:foo) assert_false Klass.method_defined?(:bar) assert_true Klass.method_defined?(:baz) assert_true Klass.method_defined?(:qux) assert_true Klass.method_defined?(:quux) end assert("MiniDSL.fields") do t = Klass.fields assert_equal({ :t => String }, t[:foo]) assert_equal({ :t => String, :as => :baz }, t[:bar]) assert_equal({ :t => Array, :freeze => true }, t[:qux]) # XXX, :quux end [:decode, :new].each do |m| assert("MiniDSL.#{ m }") do t = Klass.send(m, foo: "foo", bar: "bar", qux: ["cat", "dog"], quux: [1, 2, 3]) # foo assert_equal("foo", t.foo) # bar assert_raise(NoMethodError) { t.bar } assert_equal("bar", t.baz) # qux assert_equal(["cat", "dog"], t.qux) assert_true(t.qux.frozen?) # quux assert_equal(6, t.quux) end end assert("MiniDSL#to_h") do t = Klass.new(foo: "foo", bar: "bar", qux: ["cat", "dog"], quux: [1, 2, 3]).to_h # foo assert_equal("foo", t[:foo]) # bar assert_equal("bar", t[:bar]) assert_nil(t[:baz]) # qux assert_equal(["cat", "dog"], t[:qux]) assert_true(t[:qux].frozen?) # quux assert_equal(6, t[:quux]) end assert("MiniDSL#==") do t = Klass.new(foo: "foo", bar: "bar", qux: ["cat", "dog"], quux: [1, 2, 3]) u = Klass.new(foo: "foo", bar: "bar", qux: ["cat", "dog"], quux: [1, 2, 3]) assert_true(t == u) end
27.711864
86
0.579205
f439a82fd03227404102acc57ed1e5132255c3f6
758
cs
C#
Library.Tests/Controllers/CatalogControllerShould.cs
Azoq/library-management-system-master
9d757a105d3243890b48d42a95e0192e7fc1367c
[ "Apache-2.0" ]
null
null
null
Library.Tests/Controllers/CatalogControllerShould.cs
Azoq/library-management-system-master
9d757a105d3243890b48d42a95e0192e7fc1367c
[ "Apache-2.0" ]
null
null
null
Library.Tests/Controllers/CatalogControllerShould.cs
Azoq/library-management-system-master
9d757a105d3243890b48d42a95e0192e7fc1367c
[ "Apache-2.0" ]
null
null
null
using System.Collections.Generic; using System.Linq; using FluentAssertions; using Library.Data; using Library.Data.Models; using Library.Web.Controllers; using Library.Web.Models.Catalog; using Library.Web.Models.CheckoutModels; using Microsoft.AspNetCore.Mvc; using Moq; using NUnit.Framework; namespace Library.Tests.Controllers { [TestFixture] public class CatalogControllerShould { private static IEnumerable<ProfilingAsset> GetAllAssets() { return new List<ProfilingAsset> { new Profiling { Title = "Orlando", Author = "Virginia Woolf", ImageUrl = "foo", }, }; } } }
24.451613
65
0.598945
29b9734d9e913bcd21c93dcc65910cb4e4227391
2,659
lua
Lua
cmd_effect.lua
12xx12/Core
1c6abcccd054131e0dbc4f2669d791b2ad072649
[ "Apache-2.0" ]
51
2015-12-31T16:07:20.000Z
2022-02-21T15:50:21.000Z
cmd_effect.lua
12xx12/Core
1c6abcccd054131e0dbc4f2669d791b2ad072649
[ "Apache-2.0" ]
72
2015-12-21T23:34:33.000Z
2021-07-23T09:11:04.000Z
cmd_effect.lua
12xx12/Core
1c6abcccd054131e0dbc4f2669d791b2ad072649
[ "Apache-2.0" ]
43
2016-01-03T12:02:46.000Z
2021-11-20T14:12:57.000Z
function HandleEffectCommand(Split, Player) local Response if not Split[4] then Split[4] = 30 end if not Split[5] then Split[5] = 0 end local EffectID = tonumber(Split[3]) local Amplifier = tonumber(Split[5]) local ApplyEffect = function(OtherPlayer) local Seconds = (tonumber(Split[4]) * 20) OtherPlayer:AddEntityEffect(EffectID, Seconds, Amplifier) if Split[2] ~= "@a" then Response = SendMessageSuccess(Player, "Successfully added effect to player \"" .. OtherPlayer:GetName() .. "\" for " .. Split[4] .. " seconds") end end local RemoveEffects = function(OtherPlayer) OtherPlayer:ClearEntityEffects() if Split[2] ~= "@a" then Response = SendMessageSuccess(Player, "Successfully removed effects from player \"" .. OtherPlayer:GetName() .. "\"") end end if Split[3] ~= "clear" then if not Split[3] then Response = SendMessage(Player, "Usage: " .. Split[1] .. " <player> <effect> [seconds] [amplifier] OR " .. Split[1] .. " <player> clear") elseif not EffectID or EffectID < 1 or EffectID > 23 then Response = SendMessageFailure(Player, "Invalid effect ID \"" .. Split[3] .. "\"") elseif not tonumber(Split[4]) then Response = SendMessageFailure(Player, "Invalid duration \"" .. Split[4] .. "\"") elseif tonumber(Split[4]) < 0 then Response = SendMessageFailure(Player, "The duration in seconds must be at least 0") elseif tonumber(Split[4]) > 1000000 then Response = SendMessageFailure(Player, "The duration in seconds must be at most 1000000") elseif not Amplifier then Response = SendMessageFailure(Player, "Invalid amplification amount \"" .. Split[5] .. "\"") elseif Amplifier < 0 then Response = SendMessageFailure(Player, "The amplification amount must be at least 0") elseif Amplifier > 255 then Response = SendMessageFailure(Player, "The amplification amount must be at most 255") elseif Split[2] == "@a" then cRoot:Get():ForEachPlayer(ApplyEffect) Response = SendMessageSuccess(Player, "Successfully added effect to every player for " .. Split[4] .. " seconds") elseif not cRoot:Get():FindAndDoWithPlayer(Split[2], ApplyEffect) then Response = SendMessageFailure(Player, "Player \"" .. Split[2] .. "\" not found") end elseif Split[2] == "@a" then cRoot:Get():ForEachPlayer(RemoveEffects) Response = SendMessageSuccess(Player, "Successfully removed effects from every player") elseif not cRoot:Get():FindAndDoWithPlayer(Split[2], RemoveEffects) then Response = SendMessageFailure(Player, "Player \"" .. Split[2] .. "\" not found") end return true, Response end function HandleConsoleEffect(Split) return HandleEffectCommand(Split) end
37.985714
146
0.705528
49508b5ec7de2936d709df6c07ecb8f987bc7be1
5,131
py
Python
o/odbc32.py
byeongal/pefile_ordlookup
9400d24890601e4ec47f3b279b72f4fd9ca1d58d
[ "MIT" ]
null
null
null
o/odbc32.py
byeongal/pefile_ordlookup
9400d24890601e4ec47f3b279b72f4fd9ca1d58d
[ "MIT" ]
null
null
null
o/odbc32.py
byeongal/pefile_ordlookup
9400d24890601e4ec47f3b279b72f4fd9ca1d58d
[ "MIT" ]
null
null
null
# md5 : b27c56d844ab064547d40bf4f0a96eae # sha1 : c314e447018b0d8711347ee26a5795480837b2d3 # sha256 : c045615fe1b44a6409610e4e94e70f1559325eb55ab1f805b0452e852771c0ae ord_names = { 1: b'SQLAllocConnect', 2: b'SQLAllocEnv', 3: b'SQLAllocStmt', 4: b'SQLBindCol', 5: b'SQLCancel', 6: b'SQLColAttributes', 7: b'SQLConnect', 8: b'SQLDescribeCol', 9: b'SQLDisconnect', 10: b'SQLError', 11: b'SQLExecDirect', 12: b'SQLExecute', 13: b'SQLFetch', 14: b'SQLFreeConnect', 15: b'SQLFreeEnv', 16: b'SQLFreeStmt', 17: b'SQLGetCursorName', 18: b'SQLNumResultCols', 19: b'SQLPrepare', 20: b'SQLRowCount', 21: b'SQLSetCursorName', 22: b'SQLSetParam', 23: b'SQLTransact', 24: b'SQLAllocHandle', 25: b'SQLBindParam', 26: b'SQLCloseCursor', 27: b'SQLColAttribute', 28: b'SQLCopyDesc', 29: b'SQLEndTran', 30: b'SQLFetchScroll', 31: b'SQLFreeHandle', 32: b'SQLGetConnectAttr', 33: b'SQLGetDescField', 34: b'SQLGetDescRec', 35: b'SQLGetDiagField', 36: b'SQLGetDiagRec', 37: b'SQLGetEnvAttr', 38: b'SQLGetStmtAttr', 39: b'SQLSetConnectAttr', 40: b'SQLColumns', 41: b'SQLDriverConnect', 42: b'SQLGetConnectOption', 43: b'SQLGetData', 44: b'SQLGetFunctions', 45: b'SQLGetInfo', 46: b'SQLGetStmtOption', 47: b'SQLGetTypeInfo', 48: b'SQLParamData', 49: b'SQLPutData', 50: b'SQLSetConnectOption', 51: b'SQLSetStmtOption', 52: b'SQLSpecialColumns', 53: b'SQLStatistics', 54: b'SQLTables', 55: b'SQLBrowseConnect', 56: b'SQLColumnPrivileges', 57: b'SQLDataSources', 58: b'SQLDescribeParam', 59: b'SQLExtendedFetch', 60: b'SQLForeignKeys', 61: b'SQLMoreResults', 62: b'SQLNativeSql', 63: b'SQLNumParams', 64: b'SQLParamOptions', 65: b'SQLPrimaryKeys', 66: b'SQLProcedureColumns', 67: b'SQLProcedures', 68: b'SQLSetPos', 69: b'SQLSetScrollOptions', 70: b'SQLTablePrivileges', 71: b'SQLDrivers', 72: b'SQLBindParameter', 73: b'SQLSetDescField', 74: b'SQLSetDescRec', 75: b'SQLSetEnvAttr', 76: b'SQLSetStmtAttr', 77: b'SQLAllocHandleStd', 78: b'SQLBulkOperations', 79: b'CloseODBCPerfData', 80: b'CollectODBCPerfData', 81: b'CursorLibLockDbc', 82: b'CursorLibLockDesc', 83: b'CursorLibLockStmt', 84: b'ODBCGetTryWaitValue', 85: b'CursorLibTransact', 86: b'ODBCSetTryWaitValue', 87: b'DllBidEntryPoint', 88: b'GetODBCSharedData', 89: b'LockHandle', 90: b'ODBCInternalConnectW', 91: b'OpenODBCPerfData', 92: b'PostComponentError', 93: b'PostODBCComponentError', 94: b'PostODBCError', 95: b'SQLCancelHandle', 96: b'SQLCompleteAsync', 97: b'SearchStatusCode', 98: b'VFreeErrors', 99: b'VRetrieveDriverErrorsRowCol', 100: b'ValidateErrorQueue', 101: b'g_hHeapMalloc', 106: b'SQLColAttributesW', 107: b'SQLConnectW', 108: b'SQLDescribeColW', 110: b'SQLErrorW', 111: b'SQLExecDirectW', 117: b'SQLGetCursorNameW', 119: b'SQLPrepareW', 121: b'SQLSetCursorNameW', 127: b'SQLColAttributeW', 132: b'SQLGetConnectAttrW', 133: b'SQLGetDescFieldW', 134: b'SQLGetDescRecW', 135: b'SQLGetDiagFieldW', 136: b'SQLGetDiagRecW', 138: b'SQLGetStmtAttrW', 139: b'SQLSetConnectAttrW', 140: b'SQLColumnsW', 141: b'SQLDriverConnectW', 142: b'SQLGetConnectOptionW', 145: b'SQLGetInfoW', 147: b'SQLGetTypeInfoW', 150: b'SQLSetConnectOptionW', 152: b'SQLSpecialColumnsW', 153: b'SQLStatisticsW', 154: b'SQLTablesW', 155: b'SQLBrowseConnectW', 156: b'SQLColumnPrivilegesW', 157: b'SQLDataSourcesW', 160: b'SQLForeignKeysW', 162: b'SQLNativeSqlW', 165: b'SQLPrimaryKeysW', 166: b'SQLProcedureColumnsW', 167: b'SQLProceduresW', 170: b'SQLTablePrivilegesW', 171: b'SQLDriversW', 173: b'SQLSetDescFieldW', 176: b'SQLSetStmtAttrW', 206: b'SQLColAttributesA', 207: b'SQLConnectA', 208: b'SQLDescribeColA', 210: b'SQLErrorA', 211: b'SQLExecDirectA', 217: b'SQLGetCursorNameA', 219: b'SQLPrepareA', 221: b'SQLSetCursorNameA', 227: b'SQLColAttributeA', 232: b'SQLGetConnectAttrA', 233: b'SQLGetDescFieldA', 234: b'SQLGetDescRecA', 235: b'SQLGetDiagFieldA', 236: b'SQLGetDiagRecA', 238: b'SQLGetStmtAttrA', 239: b'SQLSetConnectAttrA', 240: b'SQLColumnsA', 241: b'SQLDriverConnectA', 242: b'SQLGetConnectOptionA', 245: b'SQLGetInfoA', 247: b'SQLGetTypeInfoA', 250: b'SQLSetConnectOptionA', 252: b'SQLSpecialColumnsA', 253: b'SQLStatisticsA', 254: b'SQLTablesA', 255: b'SQLBrowseConnectA', 256: b'SQLColumnPrivilegesA', 257: b'SQLDataSourcesA', 260: b'SQLForeignKeysA', 262: b'SQLNativeSqlA', 265: b'SQLPrimaryKeysA', 266: b'SQLProcedureColumnsA', 267: b'SQLProceduresA', 270: b'SQLTablePrivilegesA', 271: b'SQLDriversA', 273: b'SQLSetDescFieldA', 276: b'SQLSetStmtAttrA', 301: b'ODBCQualifyFileDSNW', }
28.192308
75
0.652115
a9400fc70d06c1f9ee72c725357a724050702953
188
css
CSS
unit-11/app-client/src/app/journals/session-journal/new-session/new-session.component.css
MihailSverkunov/JavaSIS-3.20
c5599bb3044b3a26b276ddde3558c3ee72b4ac7b
[ "Apache-2.0" ]
2
2019-08-28T09:31:59.000Z
2021-11-14T08:22:33.000Z
unit-11/app-client/src/app/journals/session-journal/new-session/new-session.component.css
MihailSverkunov/JavaSIS-3.20
c5599bb3044b3a26b276ddde3558c3ee72b4ac7b
[ "Apache-2.0" ]
20
2020-03-05T00:31:34.000Z
2022-03-02T08:10:56.000Z
unit-11/app-client/src/app/journals/session-journal/new-session/new-session.component.css
MihailSverkunov/JavaSIS-3.20
c5599bb3044b3a26b276ddde3558c3ee72b4ac7b
[ "Apache-2.0" ]
44
2020-03-03T13:54:57.000Z
2022-01-25T16:27:43.000Z
form { display: flex; flex-direction: column; } .question-title { color: blue; } .submit-button { margin: 10px 15px; } mat-card { margin: 15px; background-color: #fafafa; }
10.444444
28
0.638298