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
0a9bc0a70564334310f182d94ad690aeb834a2f9
5,157
dart
Dart
packages/flutter/test/material/localizations_test.dart
mmadde10/flutter
248d746575b713da74144750527356a1c0095546
[ "BSD-3-Clause" ]
2
2020-06-27T00:54:51.000Z
2020-07-09T13:02:17.000Z
packages/flutter/test/material/localizations_test.dart
yungzhu/flutter
599566177736e6b30af922a8f06e8a260acafc36
[ "BSD-3-Clause" ]
null
null
null
packages/flutter/test/material/localizations_test.dart
yungzhu/flutter
599566177736e6b30af922a8f06e8a260acafc36
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @dart = 2.8 import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('English translations exist for all MaterialLocalizations properties', (WidgetTester tester) async { const MaterialLocalizations localizations = DefaultMaterialLocalizations(); expect(localizations.openAppDrawerTooltip, isNotNull); expect(localizations.backButtonTooltip, isNotNull); expect(localizations.closeButtonTooltip, isNotNull); expect(localizations.deleteButtonTooltip, isNotNull); expect(localizations.moreButtonTooltip, isNotNull); expect(localizations.nextMonthTooltip, isNotNull); expect(localizations.previousMonthTooltip, isNotNull); expect(localizations.nextPageTooltip, isNotNull); expect(localizations.previousPageTooltip, isNotNull); expect(localizations.showMenuTooltip, isNotNull); expect(localizations.licensesPageTitle, isNotNull); expect(localizations.rowsPerPageTitle, isNotNull); expect(localizations.cancelButtonLabel, isNotNull); expect(localizations.closeButtonLabel, isNotNull); expect(localizations.continueButtonLabel, isNotNull); expect(localizations.copyButtonLabel, isNotNull); expect(localizations.cutButtonLabel, isNotNull); expect(localizations.okButtonLabel, isNotNull); expect(localizations.pasteButtonLabel, isNotNull); expect(localizations.selectAllButtonLabel, isNotNull); expect(localizations.viewLicensesButtonLabel, isNotNull); expect(localizations.anteMeridiemAbbreviation, isNotNull); expect(localizations.postMeridiemAbbreviation, isNotNull); expect(localizations.timePickerHourModeAnnouncement, isNotNull); expect(localizations.timePickerMinuteModeAnnouncement, isNotNull); expect(localizations.modalBarrierDismissLabel, isNotNull); expect(localizations.drawerLabel, isNotNull); expect(localizations.popupMenuLabel, isNotNull); expect(localizations.dialogLabel, isNotNull); expect(localizations.alertDialogLabel, isNotNull); expect(localizations.searchFieldLabel, isNotNull); expect(localizations.dateSeparator, isNotNull); expect(localizations.dateHelpText, isNotNull); expect(localizations.selectYearSemanticsLabel, isNotNull); expect(localizations.unspecifiedDate, isNotNull); expect(localizations.unspecifiedDateRange, isNotNull); expect(localizations.dateInputLabel, isNotNull); expect(localizations.dateRangeStartLabel, isNotNull); expect(localizations.dateRangeEndLabel, isNotNull); expect(localizations.invalidDateFormatLabel, isNotNull); expect(localizations.invalidDateRangeLabel, isNotNull); expect(localizations.dateOutOfRangeLabel, isNotNull); expect(localizations.saveButtonLabel, isNotNull); expect(localizations.datePickerHelpText, isNotNull); expect(localizations.dateRangePickerHelpText, isNotNull); expect(localizations.calendarModeButtonLabel, isNotNull); expect(localizations.inputDateModeButtonLabel, isNotNull); expect(localizations.signedInLabel, isNotNull); expect(localizations.hideAccountsLabel, isNotNull); expect(localizations.showAccountsLabel, isNotNull); expect(localizations.reorderItemToStart, isNotNull); expect(localizations.reorderItemToEnd, isNotNull); expect(localizations.reorderItemUp, isNotNull); expect(localizations.reorderItemDown, isNotNull); expect(localizations.reorderItemLeft, isNotNull); expect(localizations.reorderItemRight, isNotNull); expect(localizations.aboutListTileTitle('FOO'), isNotNull); expect(localizations.aboutListTileTitle('FOO'), contains('FOO')); expect(localizations.selectedRowCountTitle(0), isNotNull); expect(localizations.selectedRowCountTitle(1), isNotNull); expect(localizations.selectedRowCountTitle(2), isNotNull); expect(localizations.selectedRowCountTitle(100), isNotNull); expect(localizations.selectedRowCountTitle(0).contains(r'$selectedRowCount'), isFalse); expect(localizations.selectedRowCountTitle(1).contains(r'$selectedRowCount'), isFalse); expect(localizations.selectedRowCountTitle(2).contains(r'$selectedRowCount'), isFalse); expect(localizations.selectedRowCountTitle(100).contains(r'$selectedRowCount'), isFalse); expect(localizations.pageRowsInfoTitle(1, 10, 100, true), isNotNull); expect(localizations.pageRowsInfoTitle(1, 10, 100, false), isNotNull); expect(localizations.pageRowsInfoTitle(1, 10, 100, true).contains(r'$firstRow'), isFalse); expect(localizations.pageRowsInfoTitle(1, 10, 100, true).contains(r'$lastRow'), isFalse); expect(localizations.pageRowsInfoTitle(1, 10, 100, true).contains(r'$rowCount'), isFalse); expect(localizations.pageRowsInfoTitle(1, 10, 100, false).contains(r'$firstRow'), isFalse); expect(localizations.pageRowsInfoTitle(1, 10, 100, false).contains(r'$lastRow'), isFalse); expect(localizations.pageRowsInfoTitle(1, 10, 100, false).contains(r'$rowCount'), isFalse); }); }
55.451613
114
0.789606
67d35aa48e9339ebf475a73be073e45355c6e092
4,809
rs
Rust
hstr/src/main.rs
joshka/hstr-rs
dab0245d3d6dd5f30f60cc377bee1927fb79b743
[ "MIT" ]
null
null
null
hstr/src/main.rs
joshka/hstr-rs
dab0245d3d6dd5f30f60cc377bee1927fb79b743
[ "MIT" ]
null
null
null
hstr/src/main.rs
joshka/hstr-rs
dab0245d3d6dd5f30f60cc377bee1927fb79b743
[ "MIT" ]
null
null
null
use crate::app::Application; use crate::ui::UserInterface; use crate::util::write_file; use ncurses as nc; use setenv::get_shell; mod app; mod sort; mod ui; mod util; const CTRL_E: u32 = 5; const CTRL_F: u32 = 6; const TAB: u32 = 9; const ENTER: u32 = 10; const CTRL_T: u32 = 20; const ESC: u32 = 27; const CTRL_SLASH: u32 = 31; const Y: i32 = 121; fn main() -> Result<(), std::io::Error> { nc::initscr(); nc::noecho(); nc::keypad(nc::stdscr(), true); let shell = get_shell().get_name(); let mut app = Application::new(shell); app.load_commands(); let mut user_interface = UserInterface::new(); user_interface.init_color_pairs(); user_interface.populate_screen(&app); loop { let user_input = nc::get_wch(); match user_input.unwrap() { nc::WchResult::Char(ch) => match ch { CTRL_E => { app.toggle_regex_mode(); user_interface.selected = 0; user_interface.populate_screen(&app); } CTRL_F => { let commands = app.get_commands(); let command = user_interface.get_selected(&commands); app.add_or_rm_fav(command); write_file( format!(".config/hstr-rs/.{}_favorites", shell), app.commands .as_ref() .unwrap() .get(&app::View::Favorites) .unwrap(), )?; } TAB => { let commands = app.get_commands(); let command = user_interface.get_selected(&commands); util::echo(command); break; } ENTER => { let commands = app.get_commands(); let command = user_interface.get_selected(&commands); util::echo(command); util::echo("\n".to_string()); break; } CTRL_T => { app.toggle_case(); user_interface.populate_screen(&app); } ESC => break, CTRL_SLASH => { app.toggle_view(); user_interface.selected = 0; user_interface.populate_screen(&app); } _ => { app.search_string .push(std::char::from_u32(ch as u32).unwrap()); user_interface.selected = 0; user_interface.page = 1; nc::clear(); app.search(); user_interface.populate_screen(&app); } }, nc::WchResult::KeyCode(code) => match code { nc::KEY_UP => { let commands = app.get_commands(); user_interface.move_selected(commands, -1); user_interface.populate_screen(&app); } nc::KEY_DOWN => { let commands = app.get_commands(); user_interface.move_selected(commands, 1); user_interface.populate_screen(&app); } nc::KEY_BACKSPACE => { app.search_string.pop(); app.restore(); nc::clear(); app.search(); user_interface.populate_screen(&app); } nc::KEY_DC => { let commands = app.get_commands(); let command = user_interface.get_selected(&commands); user_interface.prompt_for_deletion(&command); if nc::getch() == Y { app.delete_from_history(command); write_file(format!(".{}_history", shell), app.get_commands())?; } app.load_commands(); user_interface.populate_screen(&app); } nc::KEY_NPAGE => { let commands = app.get_commands(); user_interface.turn_page(commands, 1); user_interface.populate_screen(&app); } nc::KEY_PPAGE => { let commands = app.get_commands(); user_interface.turn_page(commands, -1); user_interface.populate_screen(&app); } _ => {} }, } } nc::clear(); nc::refresh(); nc::doupdate(); nc::endwin(); Ok(()) }
35.622222
87
0.438969
2583aedb2da64caa112c10b5c359b0d784f42f98
5,495
js
JavaScript
src/data/regions.js
vivelarepublique/eve_space
6b2e4333a929a668bcbcd9e5fb27c7254909ef77
[ "MIT" ]
null
null
null
src/data/regions.js
vivelarepublique/eve_space
6b2e4333a929a668bcbcd9e5fb27c7254909ef77
[ "MIT" ]
null
null
null
src/data/regions.js
vivelarepublique/eve_space
6b2e4333a929a668bcbcd9e5fb27c7254909ef77
[ "MIT" ]
null
null
null
export default [ { id: '10000001', name: '德里克', }, { id: '10000002', name: '伏尔戈', }, { id: '10000003', name: '静寂谷', }, { id: '10000004', name: 'UUA-F4', }, { id: '10000005', name: '底特里德', }, { id: '10000006', name: '邪恶湾流', }, { id: '10000007', name: '地窖', }, { id: '10000008', name: '灼热之径', }, { id: '10000009', name: '因斯姆尔', }, { id: '10000010', name: '特布特', }, { id: '10000011', name: '大荒野', }, { id: '10000012', name: '柯尔斯', }, { id: '10000013', name: '糟粕之域', }, { id: '10000014', name: '卡彻', }, { id: '10000015', name: '维纳尔', }, { id: '10000016', name: '长征', }, { id: '10000017', name: 'J7HZ-F', }, { id: '10000018', name: '螺旋之域', }, { id: '10000019', name: 'A821-A', }, { id: '10000020', name: '塔什蒙贡', }, { id: '10000021', name: '域外走廊', }, { id: '10000022', name: '混浊', }, { id: '10000023', name: '黑渊', }, { id: '10000025', name: '伊梅瑟亚', }, { id: '10000027', name: '琉蓝之穹', }, { id: '10000028', name: '摩登赫斯', }, { id: '10000029', name: '对舞之域', }, { id: '10000030', name: '西玛特尔', }, { id: '10000031', name: '绝径', }, { id: '10000032', name: '金纳泽', }, { id: '10000033', name: '赛塔德洱', }, { id: '10000034', name: '卡勒瓦拉阔地', }, { id: '10000035', name: '德克廉', }, { id: '10000036', name: '破碎', }, { id: '10000037', name: '埃维希尔', }, { id: '10000038', name: '幽暗之域', }, { id: '10000039', name: '埃索特亚', }, { id: '10000040', name: '欧莎', }, { id: '10000041', name: '辛迪加', }, { id: '10000042', name: '美特伯里斯', }, { id: '10000043', name: '多美', }, { id: '10000044', name: '孤独之域', }, { id: '10000045', name: '特纳', }, { id: '10000046', name: '斐德', }, { id: '10000047', name: '普罗维登斯', }, { id: '10000048', name: '宁静之域', }, { id: '10000049', name: '卡尼迪', }, { id: '10000050', name: '逑瑞斯', }, { id: '10000051', name: '云环', }, { id: '10000052', name: '卡多尔', }, { id: '10000053', name: '钴蓝边域', }, { id: '10000054', name: '艾里迪亚', }, { id: '10000055', name: '血脉', }, { id: '10000056', name: '非塔波利斯', }, { id: '10000057', name: '外环', }, { id: '10000058', name: '源泉之域', }, { id: '10000059', name: '摄魂之域', }, { id: '10000060', name: '绝地之域', }, { id: '10000061', name: '特里菲斯', }, { id: '10000062', name: '欧米斯特', }, { id: '10000063', name: '贝斯', }, { id: '10000064', name: '精华之域', }, { id: '10000065', name: '柯埃佐', }, { id: '10000066', name: '佩利根弗', }, { id: '10000067', name: '吉勒西斯', }, { id: '10000068', name: '维格温铎', }, { id: '10000069', name: '暗涌之域', }, { id: '10000070', name: '波赫文', }, { id: '11000001', name: 'A-R00001', }, { id: '11000002', name: 'A-R00002', }, { id: '11000003', name: 'A-R00003', }, { id: '11000004', name: 'B-R00004', }, { id: '11000005', name: 'B-R00005', }, { id: '11000006', name: 'B-R00006', }, { id: '11000007', name: 'B-R00007', }, { id: '11000008', name: 'B-R00008', }, { id: '11000009', name: 'C-R00009', }, { id: '11000010', name: 'C-R00010', }, { id: '11000011', name: 'C-R00011', }, { id: '11000012', name: 'C-R00012', }, { id: '11000013', name: 'C-R00013', }, { id: '11000014', name: 'C-R00014', }, { id: '11000015', name: 'C-R00015', }, { id: '11000016', name: 'D-R00016', }, { id: '11000017', name: 'D-R00017', }, { id: '11000018', name: 'D-R00018', }, { id: '11000019', name: 'D-R00019', }, { id: '11000020', name: 'D-R00020', }, { id: '11000021', name: 'D-R00021', }, { id: '11000022', name: 'D-R00022', }, { id: '11000023', name: 'D-R00023', }, { id: '11000024', name: 'E-R00024', }, { id: '11000025', name: 'E-R00025', }, { id: '11000026', name: 'E-R00026', }, { id: '11000027', name: 'E-R00027', }, { id: '11000028', name: 'E-R00028', }, { id: '11000029', name: 'E-R00029', }, { id: '11000030', name: 'F-R00030', }, { id: '11000031', name: 'G-R00031', }, { id: '11000032', name: 'H-R00032', }, { id: '11000033', name: 'K-R00033', }, { id: '12000001', name: 'ADR01', }, { id: '12000002', name: 'ADR02', }, { id: '12000003', name: 'ADR03', }, { id: '12000004', name: 'ADR04', }, { id: '12000005', name: 'ADR05', }, { id: '13000001', name: 'PR-01', }, { id: '14000001', name: 'VR-01', }, { id: '14000002', name: 'VR-02', }, { id: '14000003', name: 'VR-03', }, { id: '14000004', name: 'VR-04', }, { id: '14000005', name: 'VR-05', }, { id: '15000001', name: '索拉弗雷尔实验室', }, { id: '15000002', name: '索拉弗雷尔实验室', }, ];
11.971678
21
0.389445
3f2db4012aca1f8e8f73637ecb6c0d8ab3c81645
5,899
php
PHP
work_summery.php
jerald-jacob/Studio_automation
8238f1556ec5d8b51b99c1d198825ba02094a6dd
[ "MIT" ]
1
2019-07-11T04:00:28.000Z
2019-07-11T04:00:28.000Z
work_summery.php
jerald-jacob/Studio_automation
8238f1556ec5d8b51b99c1d198825ba02094a6dd
[ "MIT" ]
1
2020-07-17T16:45:20.000Z
2020-07-17T16:45:20.000Z
work_summery.php
jerald-jacob/Studio_automation
8238f1556ec5d8b51b99c1d198825ba02094a6dd
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <title>SB Admin - Tables</title> <!-- Custom fonts for this template--> <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css"> <!-- Page level plugin CSS--> <link href="vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet"> <!-- Custom styles for this template--> <link href="css/sb-admin.css" rel="stylesheet"> </head> <body id="page-top"> <?php include("nav.php"); ?> <div id="content-wrapper"> <div class="container-fluid"> <!-- Breadcrumbs--> <ol class="breadcrumb"> <li class="breadcrumb-item"> <a href="#">Dashboard</a> </li> <li class="breadcrumb-item active">Tables</li> </ol> <!-- DataTables Example --> <div class="card mb-3"> <div class="card-header"> <i class="fas fa-table"></i> Client details</div> <div class="card-body"> <div class="table-responsive"> <?php include('code/connection.php'); $msg = ""; error_reporting(0); $result=mysqli_query($db,"SELECT * FROM camrin_work_registration"); if($row = mysqli_fetch_array($result)) { echo "<table class='table table-bordered' id='dataTable' width='100%' cellspacing='0'>"; echo " <thead> <tr> <th>client</th> <th>location</th> <th>engagement</th> <th>wedding</th> <th>reception</th> <th>Amount</th> <th>Advance </th> </tr> </thead> <tfoot> <tr> <th>client</th> <th>location</th> <th>engagement</th> <th>wedding</th> <th>reception</th> <th>Amount</th> <th>Advance</th> </tr> </tfoot> <tbody>"; echo "<tr>"; echo "<td>" ."<a href='cam_client_view.php?id=".$row['id']."'>" . $row['ClientName'] ."</td>"; echo "<td>" . $row['location'] . "</td>"; echo "<td>" . $row['engagement'] . "</td>"; echo "<td>" . $row['wedding'] . "</td>"; echo "<td>" . $row['reception'] . "</td>"; echo "<td>" . $row['Total_Amount'] . "</td>"; echo "<td>" . $row['Advance'] . "</td>"; echo "</tr>"; } elseif($row = mysqli_fetch_array($teacher_member_result)) { echo "<tr>"; echo "<td>" . $row['fname'] . "</td>"; echo "<td>" ."<a href='cam_client_view.php?id=".$row['username']."'>" . $row['ClientName'] ."</td>"; echo "</tr>"; } else { echo "SEARCH A STUDENT OR TEACHER"; } echo "</table>"; echo "</tbody></table></div>"; ?> <tr> <td>Tiger Nixon</td> <td>System Architect</td> <td>Edinburgh</td> <td>61</td> <td>2011/04/25</td> <td>$320,800</td> </tr> </tbody> </table> </div> </div> <div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div> </div> <p class="small text-center text-muted my-5"> <em>More table examples coming soon...</em> </p> </div> <!-- /.container-fluid --> <!-- Sticky Footer --> <footer class="sticky-footer"> <div class="container my-auto"> <div class="copyright text-center my-auto"> <span>Copyright © Your Website 2019</span> </div> </div> </footer> </div> <!-- /.content-wrapper --> </div> <!-- /#wrapper --> <!-- Scroll to Top Button--> <a class="scroll-to-top rounded" href="#page-top"> <i class="fas fa-angle-up"></i> </a> <!-- Logout Modal--> <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5> <button class="close" type="button" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body">Select "Logout" below if you are ready to end your current session.</div> <div class="modal-footer"> <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button> <a class="btn btn-primary" href="login.html">Logout</a> </div> </div> </div> </div> <!-- Bootstrap core JavaScript--> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- Core plugin JavaScript--> <script src="vendor/jquery-easing/jquery.easing.min.js"></script> <!-- Page level plugin JavaScript--> <script src="vendor/datatables/jquery.dataTables.js"></script> <script src="vendor/datatables/dataTables.bootstrap4.js"></script> <!-- Custom scripts for all pages--> <script src="js/sb-admin.min.js"></script> <!-- Demo scripts for this page--> <script src="js/demo/datatables-demo.js"></script> </body> </html>
28.77561
127
0.496186
0d37f941b3943f4b41f33ffdf9012a82654483aa
11,583
h
C
darkness-shared/include/engine/primitives/Matrix3.h
Karmiska/Darkness
c87eaf067a2707a0141909125ff461f69a3812e0
[ "MIT" ]
6
2019-10-17T11:31:55.000Z
2022-02-11T08:51:20.000Z
darkness-shared/include/engine/primitives/Matrix3.h
Karmiska/Darkness
c87eaf067a2707a0141909125ff461f69a3812e0
[ "MIT" ]
1
2020-08-11T09:01:29.000Z
2020-08-11T09:01:29.000Z
darkness-shared/include/engine/primitives/Matrix3.h
Karmiska/Darkness
c87eaf067a2707a0141909125ff461f69a3812e0
[ "MIT" ]
1
2020-06-02T15:48:20.000Z
2020-06-02T15:48:20.000Z
#pragma once #include "Vector3.h" #include "Vector4.h" #include "Math.h" #include <memory> namespace engine { template<class T> class Matrix3 { public: T m00; T m01; T m02; T m10; T m11; T m12; T m20; T m21; T m22; Matrix3() : m00{ (T)1 }, m01{ (T)0 }, m02{ (T)0 } , m10{ (T)0 }, m11{ (T)1 }, m12{ (T)0 } , m20{ (T)0 }, m21{ (T)0 }, m22{ (T)1 } { }; Matrix3(const T& a, const T& b, const T& c, const T& d, const T& e, const T& f, const T& g, const T& h, const T& i) : m00{ a }, m01{ b }, m02{ c } , m10{ d }, m11{ e }, m12{ f } , m20{ g }, m21{ h }, m22{ i } { }; Vector4<T> toAxisAngles() const { Vector4<T> result; T epsilon = (T)0.01; // margin to allow for rounding errors T epsilon2 = (T)0.1; // margin to distinguish between 0 and 180 degrees // optional check that input is pure rotation, 'isRotationMatrix' is defined at: // http://www.euclideanspace.com/maths/algebra/matrix/orthogonal/rotation/ //assert isRotationMatrix(m) : "not valid rotation matrix";// for debugging if (((T)std::fabs((double)m00 - (double)m10)< epsilon) && ((T)std::fabs((double)m02 - (double)m20)< epsilon) && ((T)std::fabs((double)m12 - (double)m21)< epsilon)) { // singularity found // first check for identity matrix which must have +1 for all terms // in leading diagonaland zero in other terms if (((T)std::fabs((double)m00 + (double)m10) < epsilon2) && ((T)std::fabs((double)m02 + (double)m20) < epsilon2) && ((T)std::fabs((double)m12 + (double)m21) < epsilon2) && ((T)std::fabs((double)m00 + (double)m11 + (double)m22 - (double)3) < epsilon2)) { // this singularity is identity matrix so angle = 0 return{ (T)1, (T)0, (T)0, (T)0 }; // zero angle, arbitrary axis } // otherwise this singularity is angle = 180 result.w = (T)M_PIl; T xx = (m00 + (T)1) / (T)2; T yy = (m11 + (T)1) / (T)2; T zz = (m22 + (T)1) / (T)2; T xy = (m00 + m10) / (T)4; T xz = (m02 + m20) / (T)4; T yz = (m12 + m21) / (T)4; if ((xx > yy) && (xx > zz)) { // m00 is the largest diagonal term if (xx< epsilon) { result.x = (T)0; result.y = (T)0.7071; result.z = (T)0.7071; } else { result.x = (T)std::sqrt((double)xx); result.y = xy / result.x; result.z = xz / result.x; } } else if (yy > zz) { // m11 is the largest diagonal term if (yy< epsilon) { result.x = (T)0.7071; result.y = (T)0; result.z = (T)0.7071; } else { result.y = (T)std::sqrt((double)yy); result.x = xy / result.y; result.z = yz / result.y; } } else { // m22 is the largest diagonal term so base result on this if (zz< epsilon) { result.x = (T)0.7071; result.y = (T)0.7071; result.z = (T)0; } else { result.z = (T)std::sqrt((double)zz); result.x = xz / result.z; result.y = yz / result.z; } } return result; // return 180 deg rotation } // as we have reached here there are no singularities so we can handle normally T s = (T)std::sqrt(((double)m21 - (double)m12)*((double)m21 - (double)m12) + ((double)m02 - (double)m20)*((double)m02 - (double)m20) + ((double)m10 - (double)m00)*((double)m10 - (double)m00)); // used to normalise if ((T)std::fabs(s) < (T)0.001) s = (T)1; // prevent divide by zero, should not happen if matrix is orthogonal and should be // caught by singularity test above, but I've left it in just in case result.w = (T)std::acos(((double)m00 + (double)m11 + (double)m22 - (double)1) / (double)2); result.x = (T)(m21 - m12) / s; result.y = (T)(m02 - m20) / s; result.z = (T)(m10 - m00) / s; return result; } Vector3<T> toEulerAngles() const { // x = heading // y = attitude // z = bank Vector3<T> result; // Assuming the angles are in radians. if (m10 > (T)0.998) { // singularity at north pole result.x = (T)std::atan2((double)m02, (double)m22); result.y = (T)M_PIl / (T)2; result.z = (T)0; return result; } if (m10 < (T)-0.998) { // singularity at south pole result.x = (T)std::atan2((double)m02, (double)m22); result.y = -(T)M_PIl / (T)2; result.z = (T)0; return result; } result.x = (T)std::atan2((double)-m20, (double)m00); result.z = (T)std::atan2((double)-m12, (double)m11); result.y = (T)std::asin((double)m10); return result; } Vector4<T> toQuaternion() const { w = (T)(std::sqrt((double)1.0 + (double)m00 + (double)m11 + (double)m22) / 2.0); double w4 = (4.0 * (double)w); x = (T)(((double)m21 - (double)m12) / w4); y = (T)(((double)m02 - (double)m20) / w4); z = (T)(((double)m10 - (double)m01) / w4); return{ x, y, z, w }; } Matrix3& fromAxisAngles(T x, T y, T z, T w) { T c = (T)std::cos((double)w); T s = (T)std::sin((double)w); T t = (T)1.0 - c; // normalize T magnitude = (T)std::sqrt((double)x * (double)x + (double)y * (double)y + (double)z * (double)z); x /= magnitude; y /= magnitude; z /= magnitude; m00 = c + x * x * t; m11 = c + y * y * t; m22 = c + z * z * t; T tmp1 = x * y * t; T tmp2 = z * s; m10 = tmp1 + tmp2; m01 = tmp1 - tmp2; tmp1 = x * z * t; tmp2 = y * s; m20 = tmp1 - tmp2; m02 = tmp1 + tmp2; tmp1 = y * z * t; tmp2 = x * s; m21 = tmp1 + tmp2; m12 = tmp1 - tmp2; return *this; } Matrix3& fromEulerAngles(T x, T y, T z) { // Assuming the angles are in radians. double ch = std::cos((double)x); double sh = std::sin((double)x); double ca = std::cos((double)y); double sa = std::sin((double)y); double cb = std::cos((double)z); double sb = std::sin((double)z); m00 = (T)(ch * ca); m01 = (T)(sh*sb - ch*sa*cb); m02 = (T)(ch*sa*sb + sh*cb); m10 = (T)(sa); m11 = (T)(ca*cb); m12 = (T)(-ca*sb); m20 = (T)(-sh*ca); m21 = (T)(sh*sa*cb + ch*sb); m22 = (T)(-sh*sa*sb + ch*cb); return *this; } Matrix3& fromQuaternion(const Vector4<T>& quaternion) { T sqx = quaternion.x * quaternion.x; T sqy = quaternion.y * quaternion.y; T sqz = quaternion.z * quaternion.z; T sqw = quaternion.w * quaternion.w; // invs (inverse square length) is only required if quaternion is not already normalised T invs = (T)1 / (sqx + sqy + sqz + sqw); m00 = (sqx - sqy - sqz + sqw) * invs; // since sqw + sqx + sqy + sqz =1/invs*invs m11 = (-sqx + sqy - sqz + sqw) * invs; m22 = (-sqx - sqy + sqz + sqw) * invs; T tmp1 = quaternion.x * quaternion.y; T tmp2 = quaternion.z * quaternion.w; m10 = (T)2.0 * (tmp1 + tmp2) * invs; m01 = (T)2.0 * (tmp1 - tmp2) * invs; tmp1 = quaternion.x * quaternion.z; tmp2 = quaternion.y * quaternion.w; m20 = (T)2.0 * (tmp1 - tmp2) * invs; m02 = (T)2.0 * (tmp1 + tmp2) * invs; tmp1 = quaternion.y * quaternion.z; tmp2 = quaternion.x * quaternion.w; m21 = (T)2.0 * (tmp1 + tmp2) * invs; m12 = (T)2.0 * (tmp1 - tmp2) * invs; return *this; } Matrix3(const Matrix3<T>& mat) { memcpy(&m00, &mat.m00, sizeof(T) * 9); }; Matrix3& operator=(const Matrix3<T>& mat) { memcpy(&m00, &mat.m00, sizeof(T) * 9); } static Matrix3<T> identity() { return{ (T)1, (T)0, (T)0, (T)0, (T)1, (T)0, (T)0, (T)0, (T)1 }; } static Matrix3<T> rotate(const T& x, const T& y, const T& z) { T a = (T)cos((T)x * DEG_TO_RAD); T b = (T)sin((T)x * DEG_TO_RAD); T c = (T)cos((T)y * DEG_TO_RAD); T d = (T)sin((T)y * DEG_TO_RAD); T e = (T)cos((T)z * DEG_TO_RAD); T f = (T)sin((T)z * DEG_TO_RAD); T ad = a * d; T bd = b * d; return Matrix3<T>( c * e, // 0 -c * f, // 1 d, // 2 (T)0, // 3 bd * e + a * f, // 4 -bd * f + a * e,// 5 -b * c, // 6 (T)0, // 7 -ad * e + b * f,// 8 ad * f + b * e, // 9 a * c, // 10 (T)0, // 11 (T)0, // 12 (T)0, // 13 (T)0, // 14 (T)1 // 15 ); } const T& operator[](int index) const { return *(&m00 + index); } Matrix3<T> operator* (const Matrix3<T> mat) { return{ (m00 * mat.m00) + (m01 * mat.m10) + (m02 * mat.m20), (m00 * mat.m01) + (m01 * mat.m11) + (m02 * mat.m21), (m00 * mat.m02) + (m01 * mat.m12) + (m02 * mat.m22), (m10 * mat.m00) + (m11 * mat.m10) + (m12 * mat.m20), (m10 * mat.m01) + (m11 * mat.m11) + (m12 * mat.m21), (m10 * mat.m02) + (m11 * mat.m12) + (m12 * mat.m22), (m20 * mat.m00) + (m21 * mat.m10) + (m22 * mat.m20), (m20 * mat.m01) + (m21 * mat.m11) + (m22 * mat.m21), (m20 * mat.m02) + (m21 * mat.m12) + (m22 * mat.m22) }; } }; using Matrix3f = Matrix3<float>; using Matrix3d = Matrix3<double>; }
36.310345
113
0.395925
0ac8d43eaa925208be461dcd6110dfff2967b9ce
377
cs
C#
DemoConsoleApp/DemoConsoleApp/Program.cs
georgekunchattil1992479/building-blocks-demo
9d0e5b09520c739417fc53c9628ad789addc48aa
[ "MIT" ]
null
null
null
DemoConsoleApp/DemoConsoleApp/Program.cs
georgekunchattil1992479/building-blocks-demo
9d0e5b09520c739417fc53c9628ad789addc48aa
[ "MIT" ]
null
null
null
DemoConsoleApp/DemoConsoleApp/Program.cs
georgekunchattil1992479/building-blocks-demo
9d0e5b09520c739417fc53c9628ad789addc48aa
[ "MIT" ]
null
null
null
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DemoConsoleApp { class Program { static void Main(string[] args) { Console.WriteLine("Hello, world! = Changed on server"); Console.WriteLine("Another line from client"); } } }
19.842105
67
0.615385
4360b8d5056be8bcde1538a80405a4bc29b69fc6
30
ts
TypeScript
common/shared.ts
kennethlynne/alfred-kubernetes
6d23511765bc75a9c8bcd78fba783811e930ffd5
[ "MIT" ]
7
2018-01-14T23:52:55.000Z
2019-07-08T06:10:59.000Z
common/shared.ts
kennethlynne/alfred-kubernetes
6d23511765bc75a9c8bcd78fba783811e930ffd5
[ "MIT" ]
1
2020-12-01T06:36:10.000Z
2020-12-01T06:36:10.000Z
common/shared.ts
kennethlynne/alfred-kubernetes
6d23511765bc75a9c8bcd78fba783811e930ffd5
[ "MIT" ]
1
2019-06-20T06:19:18.000Z
2019-06-20T06:19:18.000Z
require('alfred-notifier')();
15
29
0.7
a7c8c93982552d05ebdeb9b8834587cf2b4b4277
2,116
swift
Swift
LeetCode/LeetCode/8.swift
Link913/LeetcodeForLink
66717eab699593ca1fc8976cdd203fdbe31042ae
[ "MIT" ]
null
null
null
LeetCode/LeetCode/8.swift
Link913/LeetcodeForLink
66717eab699593ca1fc8976cdd203fdbe31042ae
[ "MIT" ]
null
null
null
LeetCode/LeetCode/8.swift
Link913/LeetcodeForLink
66717eab699593ca1fc8976cdd203fdbe31042ae
[ "MIT" ]
null
null
null
// // 8.swift // LeetCode // // Created by Link on 2020/5/30. // Copyright © 2020 Link. All rights reserved. // import Cocoa // https://leetcode-cn.com/problems/string-to-integer-atoi/solution/ // 字符串转换整数 (atoi) class Solution8 { enum FirstValueType { case noteFound case number case signed } func myAtoi(_ str: String) -> Int { let numberArray = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] let signArray = ["+", "-"] let space = " " var resultStr = "" let mergeArray = [numberArray, signArray, [space]].flatMap { $0 } var firstStrState = FirstValueType.noteFound var isGreatThan0 = true for c in Array(str) { let subStr = String(c) // 其他情况 if !mergeArray.contains(subStr) { break } // 开头的0跳跃处理 if subStr == "0", resultStr.count == 0 { firstStrState = .number continue } // 空格处理 if subStr == space, firstStrState == .noteFound { continue // 第一位已经是数字或者符号时 } else if subStr == space, firstStrState != .noteFound { break } // 符号处理 if signArray.contains(subStr), firstStrState == .noteFound { firstStrState = .signed isGreatThan0 = subStr == "+" ? true : false continue } else if signArray.contains(subStr), firstStrState != .noteFound { // 符号已有 break } // 数字处理 if numberArray.contains(subStr) { firstStrState = .number resultStr += subStr } } let result = Int32(resultStr) ?? 0 if result == 0, resultStr.count > 0 { return isGreatThan0 ? Int(Int32.max) : Int(Int32.min) } return Int(isGreatThan0 ? result : -result) } }
27.480519
79
0.459357
e253fd0e0076138a7ea9242e1e2a04cc4a760e53
1,176
py
Python
tests/unit/models/test_unit.py
nethad/moco-wrapper
012f9aab6e9fa60e3ccdf7254f0366b108651899
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
tests/unit/models/test_unit.py
nethad/moco-wrapper
012f9aab6e9fa60e3ccdf7254f0366b108651899
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
tests/unit/models/test_unit.py
nethad/moco-wrapper
012f9aab6e9fa60e3ccdf7254f0366b108651899
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
import pytest from .. import UnitTest class TestUnit(UnitTest): def test_get(self): unit_id = 25 response = self.moco.Unit.get(unit_id) assert response["method"] == "GET" def test_getlist(self): response = self.moco.Unit.getlist() assert response["method"] == "GET" def test_getlist_sort_default(self): sort_by = "sort by field" response = self.moco.Unit.getlist(sort_by=sort_by) assert response["params"]["sort_by"] == "{} asc".format(sort_by) def test_getlist_sort_overwrite(self): sort_by = "sort by field" sort_order = "desc" response = self.moco.Unit.getlist(sort_by=sort_by, sort_order=sort_order) assert response["params"]["sort_by"] == "{} {}".format(sort_by, sort_order) def test_getlist_page_default(self): page_default = 1 response = self.moco.Unit.getlist() assert response["params"]["page"] == page_default def test_getlist_page_overwrite(self): page_overwrite = 22 response = self.moco.Unit.getlist(page=page_overwrite) assert response["params"]["page"] == page_overwrite
28
83
0.636905
cdc75928e5f322552d921aca5815d406de492197
350
cs
C#
Core/EnterpriseWebFramework/Layout/Section/SectionStyle.cs
enduracode/enterprise-web-library
4ec92b55c75340b99bc222dffee2b348e917a3da
[ "MIT" ]
35
2015-03-25T08:21:43.000Z
2022-02-09T13:07:09.000Z
Core/EnterpriseWebFramework/Layout/Section/SectionStyle.cs
enduracode/enterprise-web-library
4ec92b55c75340b99bc222dffee2b348e917a3da
[ "MIT" ]
1
2022-02-17T17:23:44.000Z
2022-02-17T17:23:44.000Z
Core/EnterpriseWebFramework/Layout/Section/SectionStyle.cs
enduracode/enterprise-web-library
4ec92b55c75340b99bc222dffee2b348e917a3da
[ "MIT" ]
12
2015-02-25T07:46:13.000Z
2022-02-09T13:07:10.000Z
namespace EnterpriseWebLibrary.EnterpriseWebFramework { /// <summary> /// A style for a section. /// </summary> public enum SectionStyle { /// <summary> /// Normal style. /// </summary> Normal, /// <summary> /// A captioned rectangular area that distinguishes itself from its surroundings. /// </summary> Box } }
21.875
84
0.625714
3f5ea41ff23132e80e56ef7bd04e6dc1fd6b1694
1,832
php
PHP
lib/Simpleflake.php
nhymxu/simpleflake-php
4c0ecbb86daa90f262fb06ffd4034ed6b0080231
[ "MIT" ]
null
null
null
lib/Simpleflake.php
nhymxu/simpleflake-php
4c0ecbb86daa90f262fb06ffd4034ed6b0080231
[ "MIT" ]
null
null
null
lib/Simpleflake.php
nhymxu/simpleflake-php
4c0ecbb86daa90f262fb06ffd4034ed6b0080231
[ "MIT" ]
1
2018-03-02T09:55:04.000Z
2018-03-02T09:55:04.000Z
<?php namespace Simpleflake; /** * @var int */ const EPOCH = 1451606400; // 2016-01-01 /** * @var int */ const TIMESTAMP_SHIFT = 23; /** * @var int */ const RANDOM_MAX_VALUE = 4194303; /** * Generate a 64 bit, roughly-ordered, globally-unique ID. * * @param int|null $timestamp * @param int|null $randomBits * @param int $epoch * @return int */ function generate($timestamp = null, $randomBits = null, $epoch = EPOCH) { $timestamp = ($timestamp !== null) ? $timestamp: microtime(true); $timestamp -= $epoch; $timestamp *= 1000; $timestamp = (int) $timestamp; if ($randomBits !== null) { $randomBits = (int) $randomBits; } else if (function_exists("mt_rand")) { $randomBits = mt_rand(0, RANDOM_MAX_VALUE); } else { $randomBits = (int) rand() * RANDOM_MAX_VALUE; } $flake = ($timestamp << TIMESTAMP_SHIFT) | $randomBits; return $flake; } /** * Parses a simpleflake and returns a named tuple with the parts. * * @param int $flake * @param int $epoch * @return int */ function parse($flake, $epoch = EPOCH) { $timestamp = ($flake >> TIMESTAMP_SHIFT) / 1000.0; $randomBits = $flake & RANDOM_MAX_VALUE; return array( "timestamp" => $timestamp + $epoch, "randomBits" => $randomBits ); } /** * Alias for generate to be "compatible" with the python idol :) * * @param int|null $timestamp * @param int|null $randomBits * @param int $epoch * @return int */ function simpleflake($timestamp = null, $randomBits = null, $epoch = EPOCH) { return generate($timestamp, $randomBits, $epoch); } /** * Alias for parse to be "compatible" with the python idol :) * * @param int $flake * @param int $epoch * @return int */ function parse_simpleflake($flake, $epoch = EPOCH) { return parse($flake, $epoch); }
20.58427
75
0.622271
dd53581b67305534f04356cd241c53cfae107efb
12,900
java
Java
hazelcast-jet-core/src/main/java/com/hazelcast/jet/datamodel/DataModelSerializerHooks.java
jahanzebbaber/hazelcast-jet
faa682422c97aec6b9c0e8c6b110b2ffd4c3fe0b
[ "Apache-2.0" ]
1
2020-02-18T02:18:51.000Z
2020-02-18T02:18:51.000Z
hazelcast-jet-core/src/main/java/com/hazelcast/jet/datamodel/DataModelSerializerHooks.java
sjoshid/hazelcast-jet
a84d20be7d31c1a39df8fdee6f222c988759b8f9
[ "Apache-2.0" ]
null
null
null
hazelcast-jet-core/src/main/java/com/hazelcast/jet/datamodel/DataModelSerializerHooks.java
sjoshid/hazelcast-jet
a84d20be7d31c1a39df8fdee6f222c988759b8f9
[ "Apache-2.0" ]
null
null
null
/* * Copyright (c) 2008-2019, Hazelcast, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.hazelcast.jet.datamodel; import com.hazelcast.jet.impl.serialization.SerializerHookConstants; import com.hazelcast.nio.ObjectDataInput; import com.hazelcast.nio.ObjectDataOutput; import com.hazelcast.nio.serialization.Serializer; import com.hazelcast.nio.serialization.SerializerHook; import com.hazelcast.nio.serialization.StreamSerializer; import java.io.IOException; import java.util.Map.Entry; import java.util.Set; import static com.hazelcast.jet.datamodel.Tuple2.tuple2; import static com.hazelcast.jet.datamodel.Tuple3.tuple3; import static com.hazelcast.jet.datamodel.Tuple4.tuple4; import static com.hazelcast.jet.datamodel.Tuple5.tuple5; /** * Hazelcast serializer hooks for the classes in the {@code * com.hazelcast.jet.datamodel} package. This is not a public-facing API. */ class DataModelSerializerHooks { public static final class WindowResultHook implements SerializerHook<WindowResult> { @Override public Class<WindowResult> getSerializationType() { return WindowResult.class; } @Override public Serializer createSerializer() { return new StreamSerializer<WindowResult>() { @Override public void write(ObjectDataOutput out, WindowResult wr) throws IOException { out.writeLong(wr.start()); out.writeLong(wr.end()); out.writeBoolean(wr.isEarly()); out.writeObject(wr.result()); } @Override public WindowResult read(ObjectDataInput in) throws IOException { long start = in.readLong(); long end = in.readLong(); boolean isEarly = in.readBoolean(); Object result = in.readObject(); return new WindowResult<>(start, end, result, isEarly); } @Override public int getTypeId() { return SerializerHookConstants.WINDOW_RESULT; } @Override public void destroy() { } }; } @Override public boolean isOverwritable() { return false; } } public static final class KeyedWindowResultHook implements SerializerHook<KeyedWindowResult> { @Override public Class<KeyedWindowResult> getSerializationType() { return KeyedWindowResult.class; } @Override public Serializer createSerializer() { return new StreamSerializer<KeyedWindowResult>() { @Override public void write(ObjectDataOutput out, KeyedWindowResult kwr) throws IOException { out.writeLong(kwr.start()); out.writeLong(kwr.end()); out.writeBoolean(kwr.isEarly()); out.writeObject(kwr.key()); out.writeObject(kwr.result()); } @Override public KeyedWindowResult read(ObjectDataInput in) throws IOException { long start = in.readLong(); long end = in.readLong(); boolean isEarly = in.readBoolean(); Object key = in.readObject(); Object result = in.readObject(); return new KeyedWindowResult<>(start, end, key, result, isEarly); } @Override public int getTypeId() { return SerializerHookConstants.KEYED_WINDOW_RESULT; } @Override public void destroy() { } }; } @Override public boolean isOverwritable() { return false; } } public static final class TimestampedItemHook implements SerializerHook<TimestampedItem> { @Override public Class<TimestampedItem> getSerializationType() { return TimestampedItem.class; } @Override public Serializer createSerializer() { return new StreamSerializer<TimestampedItem>() { @Override public int getTypeId() { return SerializerHookConstants.TIMESTAMPED_ITEM; } @Override public void destroy() { } @Override public void write(ObjectDataOutput out, TimestampedItem timestampedItem) throws IOException { out.writeLong(timestampedItem.timestamp()); out.writeObject(timestampedItem.item()); } @Override public TimestampedItem read(ObjectDataInput in) throws IOException { long timestamp = in.readLong(); Object item = in.readObject(); return new TimestampedItem<>(timestamp, item); } }; } @Override public boolean isOverwritable() { return false; } } public static final class Tuple2Hook implements SerializerHook<Tuple2> { @Override public Class<Tuple2> getSerializationType() { return Tuple2.class; } @Override public Serializer createSerializer() { return new StreamSerializer<Tuple2>() { @Override public void write(ObjectDataOutput out, Tuple2 t) throws IOException { out.writeObject(t.f0()); out.writeObject(t.f1()); } @Override public Tuple2 read(ObjectDataInput in) throws IOException { return tuple2(in.readObject(), in.readObject()); } @Override public int getTypeId() { return SerializerHookConstants.TUPLE2; } @Override public void destroy() { } }; } @Override public boolean isOverwritable() { return false; } } public static final class Tuple3Hook implements SerializerHook<Tuple3> { @Override public Class<Tuple3> getSerializationType() { return Tuple3.class; } @Override public Serializer createSerializer() { return new StreamSerializer<Tuple3>() { @Override public void write(ObjectDataOutput out, Tuple3 t) throws IOException { out.writeObject(t.f0()); out.writeObject(t.f1()); out.writeObject(t.f2()); } @Override public Tuple3 read(ObjectDataInput in) throws IOException { return tuple3(in.readObject(), in.readObject(), in.readObject()); } @Override public int getTypeId() { return SerializerHookConstants.TUPLE3; } @Override public void destroy() { } }; } @Override public boolean isOverwritable() { return false; } } public static final class Tuple4Hook implements SerializerHook<Tuple4> { @Override public Class<Tuple4> getSerializationType() { return Tuple4.class; } @Override public Serializer createSerializer() { return new StreamSerializer<Tuple4>() { @Override public void write(ObjectDataOutput out, Tuple4 t) throws IOException { out.writeObject(t.f0()); out.writeObject(t.f1()); out.writeObject(t.f2()); out.writeObject(t.f3()); } @Override public Tuple4 read(ObjectDataInput in) throws IOException { return tuple4(in.readObject(), in.readObject(), in.readObject(), in.readObject()); } @Override public int getTypeId() { return SerializerHookConstants.TUPLE4; } @Override public void destroy() { } }; } @Override public boolean isOverwritable() { return false; } } public static final class Tuple5Hook implements SerializerHook<Tuple5> { @Override public Class<Tuple5> getSerializationType() { return Tuple5.class; } @Override public Serializer createSerializer() { return new StreamSerializer<Tuple5>() { @Override public void write(ObjectDataOutput out, Tuple5 t) throws IOException { out.writeObject(t.f0()); out.writeObject(t.f1()); out.writeObject(t.f2()); out.writeObject(t.f3()); out.writeObject(t.f4()); } @Override public Tuple5 read(ObjectDataInput in) throws IOException { return tuple5(in.readObject(), in.readObject(), in.readObject(), in.readObject(), in.readObject()); } @Override public int getTypeId() { return SerializerHookConstants.TUPLE5; } @Override public void destroy() { } }; } @Override public boolean isOverwritable() { return false; } } public static final class TagHook implements SerializerHook<Tag> { @Override public Class<Tag> getSerializationType() { return Tag.class; } @Override public Serializer createSerializer() { return new StreamSerializer<Tag>() { @Override public void write(ObjectDataOutput out, Tag tag) throws IOException { out.writeInt(tag.index()); } @Override public Tag read(ObjectDataInput in) throws IOException { return Tag.tag(in.readInt()); } @Override public int getTypeId() { return SerializerHookConstants.TAG; } @Override public void destroy() { } }; } @Override public boolean isOverwritable() { return false; } } public static final class ItemsByTagHook implements SerializerHook<ItemsByTag> { @Override public Class<ItemsByTag> getSerializationType() { return ItemsByTag.class; } @Override public Serializer createSerializer() { return new ItemsByTagSerializer(); } @Override public boolean isOverwritable() { return false; } } private static class ItemsByTagSerializer implements StreamSerializer<ItemsByTag> { @Override public void write(ObjectDataOutput out, ItemsByTag ibt) throws IOException { Set<Entry<Tag<?>, Object>> entries = ibt.entrySet(); out.writeInt(entries.size()); for (Entry<Tag<?>, Object> e : entries) { out.writeObject(e.getKey()); Object val = e.getValue(); out.writeObject(val); } } @Override public ItemsByTag read(ObjectDataInput in) throws IOException { int size = in.readInt(); ItemsByTag ibt = new ItemsByTag(); for (int i = 0; i < size; i++) { ibt.put(in.readObject(), in.readObject()); } return ibt; } @Override public int getTypeId() { return SerializerHookConstants.ITEMS_BY_TAG; } @Override public void destroy() { } } }
31.386861
119
0.533178
57f2e3efd024dd9771a3c5a9305c25bbf97e106e
7,117
php
PHP
application/views/admin/akademik/kenaikan_kelas/naik.php
erevnaprisma/sistem-akademik
cef94e961c4b66d5ea3e8b5ae5dcbaee8d0d9375
[ "MIT" ]
null
null
null
application/views/admin/akademik/kenaikan_kelas/naik.php
erevnaprisma/sistem-akademik
cef94e961c4b66d5ea3e8b5ae5dcbaee8d0d9375
[ "MIT" ]
1
2021-09-29T17:40:48.000Z
2021-09-29T17:40:48.000Z
application/views/admin/akademik/kenaikan_kelas/naik.php
erevnaprisma/sistem-akademik
cef94e961c4b66d5ea3e8b5ae5dcbaee8d0d9375
[ "MIT" ]
null
null
null
<form id="kenaikanKelasForm" method="post" action="<?=base_url('api/akademik/kenaikan_kelas/'.$action); ?>" class="form-horizontal"> <input type="hidden" name="id" value="<?=$id; ?>"> <!-- input states --> <div class="row "> <div class="col-md-6 sebelum"> <div class="form-group"> <label class="col-md-3"> Tahun</label> <div class="col-md-9"> <select name="id_tahun" class="form-control"> <option value="">Select</option> </select> <span class="help-block"></span> </div> </div> <div class="form-group"> <label class="col-md-3"> Sekolah</label> <div class="col-md-9"> <select name="id_skl" class="form-control"> <option value="">Select</option> </select> <span class="help-block"></span> </div> </div> <div class="form-group"> <label class="col-md-3"> Semester</label> <div class="col-md-9"> <select name="id_semester" class="form-control"> <option value="">Select</option> </select> <span class="help-block"></span> </div> </div> <div class="form-group"> <label class="col-md-3"> Jurusan</label> <div class="col-md-9"> <select name="id_jurusan" class="form-control"> <option value="">Select</option> </select> <span class="help-block"></span> </div> </div> <div class="form-group"> <label class="col-md-3"> Kelas</label> <div class="col-md-9"> <select name="id_kelas" class="form-control"> <option value="">Select</option> </select> <span class="help-block"></span> </div> </div> <div class="form-group"> <label class="col-md-3"></label> <div class="col-md-9"> <button class="btn btn-primary btn-cari" disabled>Cari</button> </div> </div> <hr /> <div class="table-responsive" id="table-responsive"> <table id="dvExcel1" class="table table-striped table-bordered nowrap responsive"> <thead> <tr> <th>No</th> <th>Check</th> <th>Nama Siswa</th> <th>Email Siswa</th> <th>No Induk</th> <th>NISN</th> <th>Jenis Kelamin</th> </tr> </thead> <tbody> </tbody> </table> </div> <hr /> </div> <div class="col-md-6 sesudah"> <div class="form-group"> <label class="col-md-3"> Tahun</label> <div class="col-md-9"> <select name="id_tahun" class="form-control"> <option value="">Select</option> </select> <span class="help-block"></span> </div> </div> <div class="form-group"> <label class="col-md-3"> Sekolah</label> <div class="col-md-9"> <select name="id_skl" class="form-control"> <option value="">Select</option> </select> <span class="help-block"></span> </div> </div> <div class="form-group"> <label class="col-md-3"> Semester</label> <div class="col-md-9"> <select name="id_semester" class="form-control"> <option value="">Select</option> </select> <span class="help-block"></span> </div> </div> <div class="form-group"> <label class="col-md-3"> Jurusan</label> <div class="col-md-9"> <select name="id_jurusan" class="form-control"> <option value="">Select</option> </select> <span class="help-block"></span> </div> </div> <div class="form-group"> <label class="col-md-3"> Kelas</label> <div class="col-md-9"> <select name="id_kelas" class="form-control"> <option value="">Select</option> </select> <span class="help-block"></span> </div> </div> <div class="form-group"> <label class="col-md-3"></label> <div class="col-md-9"> <button class="btn btn-primary btn-cari" disabled>Cari</button> </div> </div> <hr /> <div class="table-responsive" id="table-responsive"> <table id="dvExcel2" class="table table-striped table-bordered nowrap responsive"> <thead> <tr> <th>No</th> <th>Nama Siswa</th> <th>Email Siswa</th> <th>No Induk</th> <th>NISN</th> <th>Jenis Kelamin</th> </tr> </thead> <tbody> </tbody> </table> </div> <hr /> <div class="form-group"> <label class="col-md-3"></label> <div class="col-md-9"> <button class="btn btn-primary btn-save" disabled>Submit</button> </div> </div> </div> </div> </form> <script> $(document).ready(function() { var form = '#kenaikanKelasForm'; $.when( Data.getSekolah(form, ' select[name="id_skl"]'), Data.getTahun(form, ' select[name="id_tahun"]'), Data.getKelas(form, ' select[name="id_kelas"]'), Data.getSemester(form, ' select[name="id_semester"]'), Data.getJurusan(form, ' select[name="id_jurusan"]'), Data.getSiswa(form, ' select[name="id_siswa"]') ).done(function(usertype) { // setTimeout(() => { // getDatabyId() // }, 300); }) })
39.104396
108
0.388787
0d3d1a30ac92369a6c2e100b98c343b029e6c5c6
1,590
h
C
ogsNumerics/NumLib/Coupling/Algorithm/PartitionedConvergenceCheck.h
Yonghui56/NCP
29680706b7d8dd9b78d51c10d4a36799eb24c38f
[ "BSD-4-Clause" ]
null
null
null
ogsNumerics/NumLib/Coupling/Algorithm/PartitionedConvergenceCheck.h
Yonghui56/NCP
29680706b7d8dd9b78d51c10d4a36799eb24c38f
[ "BSD-4-Clause" ]
1
2016-07-08T03:44:02.000Z
2016-07-08T08:59:45.000Z
ogsNumerics/NumLib/Coupling/Algorithm/PartitionedConvergenceCheck.h
Yonghui56/NCP
29680706b7d8dd9b78d51c10d4a36799eb24c38f
[ "BSD-4-Clause" ]
null
null
null
/** * Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.com) * Distributed under a Modified BSD License. * See accompanying file LICENSE.txt or * http://www.opengeosys.com/LICENSE.txt * * * \file PartitionedConvergenceCheck.h * * Created on 2012-08-17 by Norihiro Watanabe */ #pragma once #include <vector> #include "NumLib/Coupling/ParameterProblemMappingTable.h" #include "IConvergenceCheck.h" namespace NumLib { /** * */ template <class T_PROBLEM> class PartitionedConvergenceCheck : public IConvergenceCheck { public: PartitionedConvergenceCheck(std::vector<T_PROBLEM*>* list_subproblems, ParameterProblemMappingTable* mapt) : _list_subproblems(list_subproblems), _map(mapt) {}; virtual ~PartitionedConvergenceCheck() {}; virtual bool isConverged(UnnamedParameterSet& vars_prev, UnnamedParameterSet& vars_current, double eps, double &v_diff) { bool is_converged = true; for (size_t i=0; i<_list_subproblems->size(); i++) { T_PROBLEM* prob = (*_list_subproblems)[i]; IConvergenceCheck* check = prob->getConvergenceChecker(); double temp_diff = .0; bool is_this_converged = check->isConverged(vars_prev, vars_current, eps, temp_diff); v_diff = std::max(temp_diff, v_diff); if (!is_this_converged) { is_converged = false; } } return is_converged; } private: std::vector<T_PROBLEM*>* _list_subproblems; ParameterProblemMappingTable* _map; }; } //end
27.413793
123
0.665409
b2e1ea8c30aea8a33f5c1b711d31b2d2ee244e13
828
css
CSS
mc-settings-panel/src/index.css
adroste/3cx-tools
a9ed30e79a3b1b77f45fc960615771e6267fb18d
[ "MIT" ]
2
2021-12-26T15:54:32.000Z
2021-12-28T18:33:17.000Z
mc-settings-panel/src/index.css
adroste/3cx-tools
a9ed30e79a3b1b77f45fc960615771e6267fb18d
[ "MIT" ]
2
2021-12-30T12:36:27.000Z
2022-01-18T15:25:01.000Z
mc-settings-panel/src/index.css
adroste/3cx-tools
a9ed30e79a3b1b77f45fc960615771e6267fb18d
[ "MIT" ]
null
null
null
@tailwind base; @tailwind components; @tailwind utilities; .tcx-tools-wrapper { margin: 0; font-family: Arial,Helvetica Neue,Helvetica,sans-serif; color: #333; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } body { background-color: #f0f3f4; } #app-container { position: relative !important; } #tcx-tools-panel-app { height: 0; width: 0; overflow: hidden; } #demo-layout { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; height: 100vh; width: 100vw; } #demo-header { grid-column-start: 1; grid-column-end: 3; background: #363535; height: 50px; width: 100%; } #demo-nav { width: 220px; background: #fff; height: 100%; } .demo-app-container { grid-column-start: 2; overflow-y: auto; width: 100%; height: 100%; }
15.333333
57
0.666667
ddb53f6847b4824491e50bf876803daf7fd25870
5,413
java
Java
TS_Designator/src/main/java/nl/tno/rpr/interactions/MunitionDetonation.java
IVCTool/TS_Designator
6f7c7d9ea7f19cdad37deb14c5c1c2cb5ca2472d
[ "Apache-2.0" ]
null
null
null
TS_Designator/src/main/java/nl/tno/rpr/interactions/MunitionDetonation.java
IVCTool/TS_Designator
6f7c7d9ea7f19cdad37deb14c5c1c2cb5ca2472d
[ "Apache-2.0" ]
2
2020-08-24T12:35:50.000Z
2020-09-09T08:45:29.000Z
TS_Designator/src/main/java/nl/tno/rpr/interactions/MunitionDetonation.java
IVCTool/TS_Designator
6f7c7d9ea7f19cdad37deb14c5c1c2cb5ca2472d
[ "Apache-2.0" ]
null
null
null
// This file was generated by the TNO Bean Generator. // Any modifications to this file will be lost upon re-generation. // Generated on: 2020/03/27 12:19:05 package nl.tno.rpr.interactions; import nl.tno.rpr.datatypes.ArticulatedParameterStruct; import nl.tno.rpr.datatypes.DetonationResultCodeEnum8; import nl.tno.rpr.datatypes.EntityTypeStruct; import nl.tno.rpr.datatypes.EventIdentifierStruct; import nl.tno.rpr.datatypes.FuseTypeEnum16; import nl.tno.rpr.datatypes.RelativePositionStruct; import nl.tno.rpr.datatypes.VelocityVectorStruct; import nl.tno.rpr.datatypes.WarheadTypeEnum16; import nl.tno.rpr.datatypes.WorldLocationStruct; /** Communicates information associated with the impact or detonation of a munition */ public class MunitionDetonation { /** * The set of articulated parts affected by the detonation (including where on the articulated * part the detonation has affected). */ ArticulatedParameterStruct[] ArticulatedPartData; /** The location, in world coordinates, at which the munition detonated. */ WorldLocationStruct DetonationLocation; /** The type of detonation (including no detonation). */ DetonationResultCodeEnum8 DetonationResultCode; /** * An ID, generated by the issuing federate, used to associate related fire and detonation events. */ EventIdentifierStruct EventIdentifier; /** The object instance ID of the entity that fired the munition. */ String FiringObjectIdentifier; /** The velocity vector of the munition at the moment of the detonation. */ VelocityVectorStruct FinalVelocityVector; /** The type of fuse on the munition. */ FuseTypeEnum16 FuseType; /** The Object instance ID of the fired munition, if an object instance is registered. */ String MunitionObjectIdentifier; /** The type of munition that is detonating. */ EntityTypeStruct MunitionType; /** The number of rounds fired in the burst. */ short QuantityFired; /** The rate of fire in rounds per minute when quantity > 1. Zero otherwise. */ short RateOfFire; /** The location of the detonation in coordinates relative to the target entity (if any). */ RelativePositionStruct RelativeDetonationLocation; /** The object instance ID of the entity that the munition has detonated on (if any). */ String TargetObjectIdentifier; /** The type of warhead on the munition. */ WarheadTypeEnum16 WarheadType; public ArticulatedParameterStruct[] getArticulatedPartData() { return this.ArticulatedPartData; } public void setArticulatedPartData(ArticulatedParameterStruct[] ArticulatedPartData) { this.ArticulatedPartData = ArticulatedPartData; } public WorldLocationStruct getDetonationLocation() { return this.DetonationLocation; } public void setDetonationLocation(WorldLocationStruct DetonationLocation) { this.DetonationLocation = DetonationLocation; } public DetonationResultCodeEnum8 getDetonationResultCode() { return this.DetonationResultCode; } public void setDetonationResultCode(DetonationResultCodeEnum8 DetonationResultCode) { this.DetonationResultCode = DetonationResultCode; } public EventIdentifierStruct getEventIdentifier() { return this.EventIdentifier; } public void setEventIdentifier(EventIdentifierStruct EventIdentifier) { this.EventIdentifier = EventIdentifier; } public String getFiringObjectIdentifier() { return this.FiringObjectIdentifier; } public void setFiringObjectIdentifier(String FiringObjectIdentifier) { this.FiringObjectIdentifier = FiringObjectIdentifier; } public VelocityVectorStruct getFinalVelocityVector() { return this.FinalVelocityVector; } public void setFinalVelocityVector(VelocityVectorStruct FinalVelocityVector) { this.FinalVelocityVector = FinalVelocityVector; } public FuseTypeEnum16 getFuseType() { return this.FuseType; } public void setFuseType(FuseTypeEnum16 FuseType) { this.FuseType = FuseType; } public String getMunitionObjectIdentifier() { return this.MunitionObjectIdentifier; } public void setMunitionObjectIdentifier(String MunitionObjectIdentifier) { this.MunitionObjectIdentifier = MunitionObjectIdentifier; } public EntityTypeStruct getMunitionType() { return this.MunitionType; } public void setMunitionType(EntityTypeStruct MunitionType) { this.MunitionType = MunitionType; } public short getQuantityFired() { return this.QuantityFired; } public void setQuantityFired(short QuantityFired) { this.QuantityFired = QuantityFired; } public short getRateOfFire() { return this.RateOfFire; } public void setRateOfFire(short RateOfFire) { this.RateOfFire = RateOfFire; } public RelativePositionStruct getRelativeDetonationLocation() { return this.RelativeDetonationLocation; } public void setRelativeDetonationLocation(RelativePositionStruct RelativeDetonationLocation) { this.RelativeDetonationLocation = RelativeDetonationLocation; } public String getTargetObjectIdentifier() { return this.TargetObjectIdentifier; } public void setTargetObjectIdentifier(String TargetObjectIdentifier) { this.TargetObjectIdentifier = TargetObjectIdentifier; } public WarheadTypeEnum16 getWarheadType() { return this.WarheadType; } public void setWarheadType(WarheadTypeEnum16 WarheadType) { this.WarheadType = WarheadType; } }
30.240223
100
0.774432
c3dbf2ea52f4d352cc86aed8717888f515b7a95c
292
cs
C#
app/Assets/Scripts/RevealWindowState.cs
mikelovesrobots/anthill
8a70740c510f18d930cece8e77e50e16fa52b416
[ "MIT" ]
null
null
null
app/Assets/Scripts/RevealWindowState.cs
mikelovesrobots/anthill
8a70740c510f18d930cece8e77e50e16fa52b416
[ "MIT" ]
null
null
null
app/Assets/Scripts/RevealWindowState.cs
mikelovesrobots/anthill
8a70740c510f18d930cece8e77e50e16fa52b416
[ "MIT" ]
null
null
null
using System.Collections; using System.Collections.Generic; using UnityEngine; using Pixelplacement; public class RevealWindowState : State { public ScreensController ScreensController; public string Name; void OnEnable() { ScreensController.Reveal(Name); } }
18.25
46
0.732877
f9131091c94c435cc2ca036129a2a77bb337c546
498
dart
Dart
uncoupling/biz/demo.dart
fisherjoe/flutter_uncoupling
e0e159bbbd8befaa57439b1de82b64ef743f705c
[ "BSD-3-Clause" ]
1
2021-08-02T08:18:43.000Z
2021-08-02T08:18:43.000Z
uncoupling/biz/demo.dart
fisherjoe/flutter_uncoupling
e0e159bbbd8befaa57439b1de82b64ef743f705c
[ "BSD-3-Clause" ]
null
null
null
uncoupling/biz/demo.dart
fisherjoe/flutter_uncoupling
e0e159bbbd8befaa57439b1de82b64ef743f705c
[ "BSD-3-Clause" ]
1
2021-08-01T03:56:07.000Z
2021-08-01T03:56:07.000Z
/* * @Author: yz.yujingzhou * @Date: 2021-07-30 15:25:59 * @Last Modified by: yz.yujingzhou * @Last Modified time: 2021-07-30 15:27:39 * @Describe: 描述 */ part of '../run.dart'; Map demo = { "alarm" : ''' "key1" : "我是要解耦的内容", ''', "task" : ''' print('---我---'); print('---是---'); print('---要---'); print('---替--'); print('---换--'); print('---的--'); print('---内--'); print('---容--'); ''' };
19.92
43
0.383534
c54b6537d889db51138413fd8891c771f47e63d1
5,866
css
CSS
assets/pagefly-main.css
puma1027/Shopify-Theme
7ba404a4ed314c83a77d5bca0492e88c264f386d
[ "Apache-2.0" ]
null
null
null
assets/pagefly-main.css
puma1027/Shopify-Theme
7ba404a4ed314c83a77d5bca0492e88c264f386d
[ "Apache-2.0" ]
null
null
null
assets/pagefly-main.css
puma1027/Shopify-Theme
7ba404a4ed314c83a77d5bca0492e88c264f386d
[ "Apache-2.0" ]
null
null
null
.__pf img,.__pf video{max-width:100%;border:0;vertical-align:middle}.__pf *,.__pf :after,.__pf :before{box-sizing:border-box}.__pf [disabled],.__pf [readonly]{cursor:default}.__pf [data-href]{cursor:pointer}.__pf [disabled]{pointer-events:none}.__pf [hidden]{display:none!important}.__pf [data-link=inherit]{color:inherit;text-decoration:none}.__pf [data-pf-placeholder]{outline:0;height:auto;display:none;pointer-events:none!important}.__pf .pf-ifr,.__pf [style*="--ratio"] img{position:absolute;height:100%;left:0;top:0;width:100%}.__pf .pf-r,.__pf .pf-r-eh>.pf-c{display:flex}.__pf [style*="--cw"]{padding:0 15px;width:100%;margin:auto;max-width:var(--cw)}.__pf .pf-ifr{border:0}.__pf .pf-bg-lazy{background-image:none!important}.__pf .pf-r{flex-wrap:wrap}.__pf .pf-r-dg{display:grid}.__pf [style*="--c-xs"]{max-width:calc(100%/12*var(--c-xs));flex-basis:calc(100%/12*var(--c-xs))}.__pf [style*="--s-xs"]{margin:0 calc(-1 * var(--s-xs))}.__pf [style*="--s-xs"]>.pf-c{padding:var(--s-xs)}.__pf .pf-r-ew>.pf-c{flex-grow:1;flex-basis:0}.__pf [style*="--ew-xs"]>.pf-c{flex-basis:calc(100% / var(--ew-xs));max-width:calc(100% / var(--ew-xs))}.__pf [style*="--ratio"]{position:relative;padding-bottom:var(--ratio)}@media (max-width:767px){.__pf .pf-hide{display:none!important}}@media (max-width:1024px) and (min-width:768px){.__pf .pf-sm-hide{display:none!important}}@media (max-width:1199px) and (min-width:1025px){.__pf .pf-md-hide{display:none!important}}@media (min-width:768px){.__pf [style*="--s-sm"]{margin:0 calc(-1 * var(--s-sm))}.__pf [style*="--c-sm"]{max-width:calc(100%/12*var(--c-sm));flex-basis:calc(100%/12*var(--c-sm))}.__pf [style*="--s-sm"]>.pf-c{padding:var(--s-sm)}.__pf [style*="--ew-sm"]>.pf-c{flex-basis:calc(100% / var(--ew-sm));max-width:calc(100% / var(--ew-sm))}}@media (min-width:1025px){.__pf [style*="--s-md"]{margin:0 calc(-1 * var(--s-md))}.__pf [style*="--c-md"]{max-width:calc(100%/12*var(--c-md));flex-basis:calc(100%/12*var(--c-md))}.__pf [style*="--s-md"]>.pf-c{padding:var(--s-md)}.__pf [style*="--ew-md"]>.pf-c{flex-basis:calc(100% / var(--ew-md));max-width:calc(100% / var(--ew-md))}}@media (min-width:1200px){.__pf [style*="--s-lg"]{margin:0 calc(-1 * var(--s-lg))}.__pf [style*="--c-lg"]{max-width:calc(100%/12*var(--c-lg));flex-basis:calc(100%/12*var(--c-lg))}.__pf [style*="--s-lg"]>.pf-c{padding:var(--s-lg)}.__pf [style*="--ew-lg"]>.pf-c{flex-basis:calc(100% / var(--ew-lg));max-width:calc(100% / var(--ew-lg))}.__pf .pf-lg-hide{display:none!important}}.__pf .pf-r-eh>.pf-c>div{width:100%}.__pf .pf-c-lt{justify-content:flex-start;align-items:flex-start}.__pf .pf-c-ct{justify-content:center;align-items:flex-start}.__pf .pf-c-rt{justify-content:flex-end;align-items:flex-start}.__pf .pf-c-lm{justify-content:flex-start;align-items:center}.__pf .pf-c-cm{justify-content:center;align-items:center}.__pf .pf-c-rm{justify-content:flex-end;align-items:center}.__pf .pf-c-lb{justify-content:flex-start;align-items:flex-end}.__pf .pf-c-cb{justify-content:center;align-items:flex-end}.__pf .pf-c-rb{justify-content:flex-end;align-items:flex-end}@media all{.__pf .pf-gs-button-1,.__pf .pf-gs-button-2,.__pf .pf-gs-button-3{padding:12px 20px;font-size:16px;line-height:16px;letter-spacing:0;margin:0}.__pf{--pf-primary-color:rgb(250, 84, 28);--pf-secondary-color:rgb(121, 103, 192);--pf-foreground-color:rgb(28, 29, 31);--pf-background-color:rgb(244, 245, 250);--pf-primary-font:Playfair Display;--pf-secondary-font:Lato;--pf-tertiary-font:Source Sans Pro}.__pf .pf-gs-button-1{background-color:#919da9;color:#fff}.__pf .pf-gs-button-2{color:#919da9;border:1px solid #919da9}.__pf .pf-gs-button-3{background-color:#919da9;color:#fff;border-radius:40px}.__pf .pf-gs-button-4{color:#919da9;border-radius:40px;border:1px solid #919da9;padding:12px 20px;margin:0;font-size:16px;line-height:16px;letter-spacing:0}.__pf .pf-gs-button-5,.__pf .pf-gs-button-6{color:#919da9;border-style:solid;border-color:#919da9;padding:12px 20px;font-size:16px;line-height:16px;letter-spacing:0}.__pf .pf-gs-button-5{border-width:0 0 3px;margin:0}.__pf .pf-gs-button-6{border-width:0 3px 3px 0;margin:0}.__pf .pf-gs-icon-1,.__pf .pf-gs-icon-2{background-color:#919da9;color:#fff;padding:8px;margin:0;border-style:none}.__pf .pf-gs-icon-1{border-radius:0}.__pf .pf-gs-icon-2{border-radius:50%}.__pf .pf-gs-icon-3,.__pf .pf-gs-icon-4{background-color:#fff;color:#919da9;padding:8px;margin:0;border:1px solid #919da9}.__pf .pf-gs-icon-4{border-radius:50%}.__pf .pf-gs-icon-5,.__pf .pf-gs-icon-6{background-color:#f5f5f5;color:#919da9;padding:8px;margin:0;border:1px solid #919da9}.__pf .pf-gs-icon-6{border-radius:50%}.__pf .pf-gs-image-1{width:100%}.__pf .pf-gs-image-2{border:3px solid #919da9;width:100%}.__pf .pf-gs-image-3{border:3px solid #919da9;padding:10px;width:100%}.__pf .pf-gs-image-4,.__pf .pf-gs-image-5{border-radius:50%;width:100%}.__pf .pf-gs-image-5{border:3px solid #919da9}.__pf .pf-gs-image-6{border-radius:50%;border:3px solid #919da9;padding:10px;width:100%}.__pf .pf-gs-heading-1,.__pf .pf-gs-heading-2,.__pf .pf-gs-heading-3,.__pf .pf-gs-heading-4,.__pf .pf-gs-heading-5{color:#000;padding:0;margin:18px 0}.__pf .pf-gs-heading-1{font-size:32px}.__pf .pf-gs-heading-2{font-size:24px}.__pf .pf-gs-heading-3{font-size:20px}.__pf .pf-gs-heading-4{font-size:18px}.__pf .pf-gs-heading-5{font-size:16px}.__pf .pf-gs-heading-6{margin:18px 0;font-size:14px;color:#000;padding:0}.__pf .pf-gs-paragraph-1,.__pf .pf-gs-paragraph-2,.__pf .pf-gs-paragraph-3,.__pf .pf-gs-paragraph-4{color:#000;padding:0;margin:16px 0;font-size:16px}.__pf .pf-gs-paragraph-1{text-align:left}.__pf .pf-gs-paragraph-2{text-align:right}.__pf .pf-gs-paragraph-3{text-align:center}.__pf .pf-gs-divider-1{color:#919da9;padding:16px 0;margin:0}.__pf .pf-gs-divider-2{color:#444749;padding:16px 0;margin:0}.__pf .pf-gs-divider-3{color:#b9bfca;padding:16px 0;margin:0}}
5,866
5,866
0.712922
e089991bfe0edc4fd7b2451027ac7eed4e8bcabc
699
h
C
interface.h
retrhelo/Stu_Info_Management
3afee7f16713c9f064eae4554f98d269d67188f6
[ "MIT" ]
null
null
null
interface.h
retrhelo/Stu_Info_Management
3afee7f16713c9f064eae4554f98d269d67188f6
[ "MIT" ]
null
null
null
interface.h
retrhelo/Stu_Info_Management
3afee7f16713c9f064eae4554f98d269d67188f6
[ "MIT" ]
null
null
null
/* writthe by joel retrhelo * finish time: Jan 13, 2019 */ /* interface.h is for user interface, including some functions * to show students' information, the menu and read user's input */ #ifndef _INTERFACE_H #define _INTERFACE_H #include <stdlib.h> #include <stdio.h> #include "storage.h" /* the system command for clearing the screen */ #define CLEAR "clear" /* size of buf */ #define BUF_SIZE 32 extern char buf[BUF_SIZE]; /* read a line from the input, first store the input into buf, * if str != NULL, copy the content of buf into str */ void read_line(char *str); /* display the menu */ void show_menu(void); /* display student info */ void show_stu_info(s_stu *stu); #endif
19.416667
64
0.708155
58a836f0de852a491931460c610d47c4549f38ad
32
css
CSS
src/app/Tracking/AuthenticatedUsersAccesses/time-report/time-report.component.css
qb-team/Stalker-Admin
df404aa0eeb96efc33dbbcd384b8e4d8aeae1dd2
[ "MIT" ]
3
2020-02-24T15:35:08.000Z
2020-06-17T12:23:15.000Z
src/app/Tracking/AuthenticatedUsersAccesses/time-report/time-report.component.css
qb-team/Stalker-Admin
df404aa0eeb96efc33dbbcd384b8e4d8aeae1dd2
[ "MIT" ]
144
2020-03-19T10:47:29.000Z
2020-06-16T11:54:50.000Z
src/app/Tracking/AuthenticatedUsersAccesses/time-report/time-report.component.css
qb-team/Stalker-Admin
df404aa0eeb96efc33dbbcd384b8e4d8aeae1dd2
[ "MIT" ]
1
2020-06-19T13:38:47.000Z
2020-06-19T13:38:47.000Z
.btn{ margin-bottom: 0.5em; }
8
23
0.59375
1448a13021bebdcd0cddb66cd39b3125c86645ce
585
tsx
TypeScript
material-icons/src/icons/SwapVerticalBoldIcon.tsx
otissv/redesign
d2838f8463d4222af1cd55bf93749ea445a0dcf3
[ "MIT" ]
1
2021-04-13T06:23:57.000Z
2021-04-13T06:23:57.000Z
material-icons/src/icons/SwapVerticalBoldIcon.tsx
otissv/redesign
d2838f8463d4222af1cd55bf93749ea445a0dcf3
[ "MIT" ]
null
null
null
material-icons/src/icons/SwapVerticalBoldIcon.tsx
otissv/redesign
d2838f8463d4222af1cd55bf93749ea445a0dcf3
[ "MIT" ]
null
null
null
import React, { FC } from 'react'; import { Icon, IconInterface } from "@redesign-system/ui-core"; export const SwapVerticalBoldIcon: FC<IconInterface> = function SwapVerticalBoldIcon({ className, ...propsRest }) { const classNames = `SwapVerticalBoldIcon ${className}`; return ( <Icon alt="SwapVerticalBold" className={classNames} {...propsRest}> <path d="M14,8H11V14H6V8H3L8.5,2L14,8M15.5,22L21,16H18V10H13V16H10L15.5,22Z" /> </Icon> ); }; SwapVerticalBoldIcon.displayName = 'SwapVerticalBoldIcon';
36.5625
90
0.647863
13b38f900880937eba2bf7e49829083d467dfbb5
1,035
ps1
PowerShell
Functions/GetSelectProfileSystem.ps1
exactmike/OneShell
8d766e30648632c895f2c62e7904f61b1a30d9e2
[ "MIT" ]
11
2018-04-05T15:26:43.000Z
2021-10-03T12:23:13.000Z
Functions/GetSelectProfileSystem.ps1
exactmike/OneShell
8d766e30648632c895f2c62e7904f61b1a30d9e2
[ "MIT" ]
6
2016-12-14T19:40:51.000Z
2018-12-13T22:45:07.000Z
Functions/GetSelectProfileSystem.ps1
exactmike/OneShell
8d766e30648632c895f2c62e7904f61b1a30d9e2
[ "MIT" ]
4
2017-10-03T19:55:24.000Z
2018-10-11T15:39:38.000Z
Function GetSelectProfileSystem { [cmdletbinding()] param ( [parameter(Mandatory)] [psobject[]]$PotentialSystems , [parameter()] [AllowNull()] $Identity , [parameter(Mandatory)] [ValidateSet('Remove', 'Edit', 'Associate', 'Get', 'Use')] $Operation ) $System = $( if ($null -eq $Identity -or (Test-IsNullOrWhiteSpace -String $identity)) { Select-ProfileSystem -Systems $PotentialSystems -Operation $Operation } else { if ($Identity -in $PotentialSystems.Identity -or $Identity -in $PotentialSystems.Name) {$PotentialSystems | Where-Object -FilterScript {$_.Identity -eq $Identity -or $_.Name -eq $Identity}} } ) if ($null -eq $system -or $system.count -ge 2 -or $system.count -eq 0) {throw("Invalid SystemIdentity $Identity was provided. No such system exists or ambiguous system exists.")} else {$system} }
28.75
114
0.568116
664648702bcc6ec913aaba9c0a9a2c5df33bcc0a
583
py
Python
ATSAMD51P19A/libsrc/ATSAMD51P19A/NVIC_.py
t-ikegami/WioTerminal-CircuitPython
efbdc2e13ad969fe009d88f7ec4b836ca61ae973
[ "MIT" ]
null
null
null
ATSAMD51P19A/libsrc/ATSAMD51P19A/NVIC_.py
t-ikegami/WioTerminal-CircuitPython
efbdc2e13ad969fe009d88f7ec4b836ca61ae973
[ "MIT" ]
1
2022-01-19T00:16:02.000Z
2022-01-26T03:43:34.000Z
ATSAMD51P19A/libsrc/ATSAMD51P19A/NVIC_.py
t-ikegami/WioTerminal-CircuitPython
efbdc2e13ad969fe009d88f7ec4b836ca61ae973
[ "MIT" ]
null
null
null
import uctypes as ct NVIC_ = { 'ISER' : ( 0x00 | ct.ARRAY, 5 | ct.UINT32 ), 'ICER' : ( 0x80 | ct.ARRAY, 5 | ct.UINT32 ), 'ISPR' : ( 0x100 | ct.ARRAY, 5 | ct.UINT32 ), 'ICPR' : ( 0x180 | ct.ARRAY, 5 | ct.UINT32 ), 'IABR' : ( 0x200 | ct.ARRAY, 5 | ct.UINT32 ), 'IP' : ( 0x300 | ct.ARRAY, 35, { 'reg' : 0x00 | ct.UINT8, 'PRI0' : 0x00 | ct.BFUINT8 | 0 << ct.BF_POS | 3 << ct.BF_LEN, }), 'STIR' : ( 0xE00, { 'reg' : 0x00 | ct.UINT32, 'INTID' : 0x00 | ct.BFUINT32 | 0 << ct.BF_POS | 9 << ct.BF_LEN, }), } NVIC = ct.struct(0xe000e100, NVIC_)
29.15
71
0.511149
8541202cd2cf34c45f9a8a851fe4d8f3d0bb3268
1,513
cs
C#
test/SlowTests/Bugs/IndexWithTwoProperties.cs
ryanheath/ravendb
f32ee65b73912aa1532929164d004e027d266270
[ "Linux-OpenIB" ]
1
2017-03-02T13:05:14.000Z
2017-03-02T13:05:14.000Z
test/SlowTests/Bugs/IndexWithTwoProperties.cs
ryanheath/ravendb
f32ee65b73912aa1532929164d004e027d266270
[ "Linux-OpenIB" ]
1
2019-03-12T12:10:52.000Z
2019-03-12T12:10:52.000Z
test/SlowTests/Bugs/IndexWithTwoProperties.cs
aviv86/ravendb
3ee33d576fecd2c47dc7a9f5b671a46731fed659
[ "Linux-OpenIB" ]
null
null
null
//----------------------------------------------------------------------- // <copyright file="IndexWithTwoProperties.cs" company="Hibernating Rhinos LTD"> // Copyright (c) Hibernating Rhinos LTD. All rights reserved. // </copyright> //----------------------------------------------------------------------- using System.Linq; using FastTests; using Raven.Client.Documents.Conventions; using Raven.Client.Documents.Indexes; using Raven.Client.Documents.Operations.Indexes; using Xunit; namespace SlowTests.Bugs { public class IndexWithTwoProperties : RavenTestBase { [Fact] public void CanCreateIndexByTwoProperties() { using (var store = GetDocumentStore()) using (var session = store.OpenSession()) { session.Store(new Foo { Id = "1", Value = "foo" }); session.Store(new Foo { Id = "2", Value = "bar" }); session.SaveChanges(); var index = new IndexDefinitionBuilder<Foo>("FeedSync/TwoProperties") { Map = ids => from id in ids select new {id.Id, id.Value}, }.ToIndexDefinition(new DocumentConventions()); store.Maintenance.Send(new PutIndexesOperation(index)); } } public class Foo { public string Id { get; set; } public string Value { get; set; } } } }
31.520833
86
0.497687
a3b3616ccf3c3db25f36b3ec901cb5aa3bf280d4
3,664
java
Java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/datastreaming/DataStreamProcessorBinarySelfTest.java
DirectXceriD/gridgain
093e512a9147e266f83f6fe1cf088c0b037b501c
[ "Apache-2.0", "CC0-1.0" ]
1
2019-03-11T08:52:37.000Z
2019-03-11T08:52:37.000Z
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/datastreaming/DataStreamProcessorBinarySelfTest.java
DirectXceriD/gridgain
093e512a9147e266f83f6fe1cf088c0b037b501c
[ "Apache-2.0", "CC0-1.0" ]
null
null
null
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/datastreaming/DataStreamProcessorBinarySelfTest.java
DirectXceriD/gridgain
093e512a9147e266f83f6fe1cf088c0b037b501c
[ "Apache-2.0", "CC0-1.0" ]
null
null
null
/* * GridGain Community Edition Licensing * Copyright 2019 GridGain Systems, Inc. * * Licensed under the Apache License, Version 2.0 (the "License") modified with Commons Clause * Restriction; you may not use this file except in compliance with the License. You may obtain a * copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. * * Commons Clause Restriction * * The Software is provided to you by the Licensor under the License, as defined below, subject to * the following condition. * * Without limiting other conditions in the License, the grant of rights under the License will not * include, and the License does not grant to you, the right to Sell the Software. * For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you * under the License to provide to third parties, for a fee or other consideration (including without * limitation fees for hosting or consulting/ support services related to the Software), a product or * service whose value derives, entirely or substantially, from the functionality of the Software. * Any license notice or attribution required by the License must also include this Commons Clause * License Condition notice. * * For purposes of the clause above, the “Licensor” is Copyright 2019 GridGain Systems, Inc., * the “License” is the Apache License, Version 2.0, and the Software is the GridGain Community * Edition software provided with this notice. */ package org.apache.ignite.internal.processors.cache.binary.datastreaming; import java.util.Collection; import java.util.Map; import org.apache.ignite.IgniteCache; import org.apache.ignite.binary.BinaryObject; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.processors.datastreamer.DataStreamProcessorSelfTest; import org.apache.ignite.internal.binary.BinaryMarshaller; import org.apache.ignite.stream.StreamReceiver; /** * */ public class DataStreamProcessorBinarySelfTest extends DataStreamProcessorSelfTest { /** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); BinaryMarshaller marsh = new BinaryMarshaller(); cfg.setMarshaller(marsh); return cfg; } /** {@inheritDoc} */ @Override protected StreamReceiver<String, TestObject> getStreamReceiver() { return new TestDataReceiver(); } /** {@inheritDoc} */ @Override protected boolean customKeepBinary() { return true; } /** * */ private static class TestDataReceiver implements StreamReceiver<String, TestObject> { /** {@inheritDoc} */ @Override public void receive(IgniteCache<String, TestObject> cache, Collection<Map.Entry<String, TestObject>> entries) { for (Map.Entry<String, TestObject> e : entries) { assertTrue(e.getKey() instanceof String); assertTrue(String.valueOf(e.getValue()), e.getValue() instanceof BinaryObject); TestObject obj = ((BinaryObject)e.getValue()).deserialize(); cache.put(e.getKey(), new TestObject(obj.val + 1)); } } } }
41.168539
106
0.72107
54a13bfc06eece89d17f8617f2e49f720f03d0d8
227
lua
Lua
Interface/AddOns/LittleWigs/TBC/TheBlackMorass/Locales/itIT.lua
ChinarG/Game-Wow-Plugins-Setting
e3fd3ddec1387c1f971dc195fec4fd9045d3105d
[ "Apache-2.0" ]
null
null
null
Interface/AddOns/LittleWigs/TBC/TheBlackMorass/Locales/itIT.lua
ChinarG/Game-Wow-Plugins-Setting
e3fd3ddec1387c1f971dc195fec4fd9045d3105d
[ "Apache-2.0" ]
null
null
null
Interface/AddOns/LittleWigs/TBC/TheBlackMorass/Locales/itIT.lua
ChinarG/Game-Wow-Plugins-Setting
e3fd3ddec1387c1f971dc195fec4fd9045d3105d
[ "Apache-2.0" ]
null
null
null
local L = BigWigs:NewBossLocale("The Black Morass Trash", "itIT") if not L then return end if L then --L.wave = "Wave Warnings" --L.wave_desc = "Announce approximate warning messages for the waves." L.medivh = "Medivh" end
25.222222
71
0.718062
458f660d3ddedcb738f8b3e31ff415e90a1bde9a
6,470
py
Python
tools/eqget/MainWindow.py
chalmersplasmatheory/DREAM
715637ada94f5e35db16f23c2fd49bb7401f4a27
[ "MIT" ]
12
2020-09-07T11:19:10.000Z
2022-02-17T17:40:19.000Z
tools/eqget/MainWindow.py
chalmersplasmatheory/DREAM
715637ada94f5e35db16f23c2fd49bb7401f4a27
[ "MIT" ]
110
2020-09-02T15:29:24.000Z
2022-03-09T09:50:01.000Z
tools/eqget/MainWindow.py
chalmersplasmatheory/DREAM
715637ada94f5e35db16f23c2fd49bb7401f4a27
[ "MIT" ]
3
2021-05-21T13:24:31.000Z
2022-02-11T14:43:12.000Z
import numpy as np from PyQt5 import QtWidgets from PyQt5.QtWidgets import QFileDialog, QMessageBox from ui import MainWindow_design from PlotWindow import PlotWindow from DREAM import DREAMIO import AUG import EqFile from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure class MainWindow(QtWidgets.QMainWindow): def __init__(self, argv): """ Constructor. """ QtWidgets.QMainWindow.__init__(self) self.ui = MainWindow_design.Ui_EqGet() self.ui.setupUi(self) self.equil = None # Set up flux surface figure self.canvas = FigureCanvas(Figure()) self.fluxSurfaceLayout = QtWidgets.QVBoxLayout(self.ui.frameFluxSurfaces) self.fluxSurfaceLayout.addWidget(self.canvas) self.setupPlot() # List of open windows self.windows = {} if AUG.isAvailable(): self.ui.cbTokamak.addItem('ASDEX Upgrade', AUG) self.ui.cbTokamak.addItem('File', EqFile) self.toggleEnabled(False) self.bindEvents() def bindEvents(self): """ Bind control events to methods. """ self.ui.actionExit.triggered.connect(self.exit) self.ui.btnLoad.clicked.connect(self.load) self.ui.btnPlotPsi.clicked.connect(self.plotPsi) self.ui.btnPlotB.clicked.connect(self.plotB) self.ui.btnPlotBpol.clicked.connect(self.plotBpol) self.ui.btnPlotBr.clicked.connect(self.plotBr) self.ui.btnPlotBz.clicked.connect(self.plotBz) self.ui.btnPlotBphi.clicked.connect(self.plotBphi) self.ui.btnSave.clicked.connect(self.save) def closeEvent(self, event): self.exit() def exit(self): """ Close any child windows before exiting. """ for _, w in self.windows.items(): w.close() self.close() def toggleEnabled(self, enabled=True): """ Toggle the enabled state of controls which require data to be available. """ self.ui.btnPlotPsi.setEnabled(enabled) self.ui.btnPlotB.setEnabled(enabled) self.ui.btnPlotBpol.setEnabled(enabled) self.ui.btnPlotBr.setEnabled(enabled) self.ui.btnPlotBz.setEnabled(enabled) self.ui.btnPlotBphi.setEnabled(enabled) self.ui.btnSave.setEnabled(enabled) def load(self): """ Load data using the selected module. """ shot = self.ui.tbShot.text() # Try to convert to integer. If that fails, the user may # have provided a file name instead... try: shot = int(shot) except: pass try: mod = self.ui.cbTokamak.currentData() self.equil = mod.getLUKE(shot) print("Loaded '{}'...".format(shot)) self.plotFluxSurfaces() self.toggleEnabled(True) except Exception as ex: QMessageBox.critical(self, 'Error loading shot', "The specified shot file could not be loaded:\n\n{}".format(ex)) def plotFluxSurfaces(self): """ Plot flux surfaces from loaded equilibrium data. """ ax = self.fluxSurfaceAx ptx = self.equil['ptx'] pty = self.equil['pty'] Rp = self.equil['Rp'] Zp = self.equil['Zp'] ax.plot(ptx[:,:-1]+Rp, pty[:,:-1]+Zp, linewidth=0.7, color=(0.5, 0.5, 0.5)) ax.plot(ptx[:,-1]+Rp, pty[:,-1]+Zp, linewidth=2, color='r') ax.plot(Rp, Zp, 's', color='r') ax.axis('equal') self.canvas.draw() def plotPsi(self): """ Plot poloidal flux as function of minor radius. """ if 'psi' in self.windows: self.windows['psi'].close() w = PlotWindow(600, 400) r = self.equil['ptx'][0,:] psi_apRp = self.equil['psi_apRp'] Rp = self.equil['Rp'] ap = r[-1] psi = psi_apRp * (Rp/ap) w.ax.plot(r, psi) w.ax.set_xlim([0, ap]) w.ax.set_xlabel(r'$r$ (m)') w.ax.set_ylabel(r'Poloidal flux $\Psi$ (Wb)') w.show() self.windows['psi'] = w def plot2D(self, name, data): """ Plot the given magnetic field. """ if name in self.windows: self.windows[name].close() w = PlotWindow() Rp = self.equil['Rp'] Zp = self.equil['Zp'] R = self.equil['ptx'] + Rp Z = self.equil['pty'] + Zp cnt = w.ax.contourf(R, Z, data, cmap='GeriMap', levels=40) cbar = w.figure.colorbar(cnt) w.ax.set_xlabel('$R$ (m)') w.ax.set_ylabel('$Z$ (m)') w.ax.axis('equal') cbar.set_label('{} (T)'.format(name)) w.show() self.windows[name] = w def plotB(self): """ Plot the magnetic field strength in (R, Z). """ Br = self.equil['ptBx'] Bz = self.equil['ptBy'] Bp = self.equil['ptBPHI'] self.plot2D('$|B|$', np.sqrt(Br**2 + Bz**2 + Bp**2)) def plotBpol(self): """ Plot the poloidal magnetic field. """ Br = self.equil['ptBx'] Bz = self.equil['ptBy'] self.plot2D(r'$B_{\rm pol}$', np.sqrt(Br**2 + Bz**2)) def plotBr(self): """ Plot the radial magnetic field component. """ self.plot2D(r'$B_r$', self.equil['ptBx']) def plotBz(self): """ Plot the radial magnetic field component. """ self.plot2D(r'$B_z$', self.equil['ptBy']) def plotBphi(self): """ Plot the toroidal magnetic field component. """ self.plot2D(r'$B_\varphi$', self.equil['ptBPHI']) def save(self): """ Save the loaded equilibrium to file. """ filename, _ = QFileDialog.getSaveFileName(self, caption="Save LUKE equilibrium file", filter='HDF5 file (*.h5)') if filename: DREAMIO.SaveDictAsHDF5(filename, {'equil': self.equil}) QMessageBox.information(self, "Equilibrium file saved", "The magnetic equilibrium data was saved to the file '{}'.".format(filename)) def setupPlot(self): self.fluxSurfaceAx = self.canvas.figure.subplots() self.fluxSurfaceAx.set_xlabel(r'$R$ (m)') self.fluxSurfaceAx.set_ylabel(r'$Z$ (m)') self.fluxSurfaceAx.figure.tight_layout()
26.194332
145
0.568934
992cc34cb18eb2d4eab032cc4cc252f44a054e0d
3,139
swift
Swift
Sources/DigiMeSDK/Private/Utilities/AES256.swift
digime/digime-sdk-ios
eecdcd56e329adf38c122f877c43a1f66f4fdf69
[ "Apache-2.0" ]
5
2018-04-12T10:32:07.000Z
2020-04-19T16:08:57.000Z
Sources/DigiMeSDK/Private/Utilities/AES256.swift
digime/digime-sdk-ios
eecdcd56e329adf38c122f877c43a1f66f4fdf69
[ "Apache-2.0" ]
22
2018-03-23T13:10:38.000Z
2021-09-22T13:46:45.000Z
Sources/DigiMeSDK/Private/Utilities/AES256.swift
digime/digime-sdk-ios
eecdcd56e329adf38c122f877c43a1f66f4fdf69
[ "Apache-2.0" ]
3
2018-03-18T21:34:11.000Z
2020-04-20T08:41:03.000Z
// // AES256.swift // DigiMeSDK // // Created on 16/06/2021. // Copyright © 2021 digi.me Limited. All rights reserved. // import CommonCrypto import Foundation struct AES256 { private let key: Data private let iv: Data enum AESError: Error { case invalidKeyLength case invalidInitializationVectorLength case cryptFailed(status: CCCryptorStatus) } init(key: Data, iv: Data) throws { guard key.count == kCCKeySizeAES256 else { throw AESError.invalidKeyLength } guard iv.count == kCCBlockSizeAES128 else { throw AESError.invalidInitializationVectorLength } self.key = key self.iv = iv } static func generateSymmetricKey() -> Data { Crypto.secureRandomData(length: kCCKeySizeAES256) } static func generateInitializationVector() -> Data { Crypto.secureRandomData(length: kCCBlockSizeAES128) } /// Encrypt with AES-CBC algorithm func encrypt(_ digest: Data) throws -> Data { return try crypt(input: digest, operation: CCOperation(kCCEncrypt)) } /// Decrypt with AES-CBC algorithm func decrypt(_ encrypted: Data) throws -> Data { return try crypt(input: encrypted, operation: CCOperation(kCCDecrypt)) } private func crypt(input: Data, operation: CCOperation) throws -> Data { var outputBytes = [UInt8](repeating: 0, count: input.count + kCCBlockSizeAES128) var numBytesWritten = 0 var status = CCCryptorStatus(kCCSuccess) input.withUnsafeBytes { rawBufferPointer in let inputBytes = rawBufferPointer.baseAddress! iv.withUnsafeBytes { rawBufferPointer in let ivBytes = rawBufferPointer.baseAddress! key.withUnsafeBytes { rawBufferPointer in let keyBytes = rawBufferPointer.baseAddress! status = CCCrypt( operation, // operation CCAlgorithm(kCCAlgorithmAES128), // algorithm CCOptions(kCCOptionPKCS7Padding), // options keyBytes, // key key.count, // keylength ivBytes, // iv inputBytes, // dataIn input.count, // dataInLength &outputBytes, // dataOut outputBytes.count, // dataOutAvailable &numBytesWritten // dataOutMoved ) } } } guard status == kCCSuccess else { throw AESError.cryptFailed(status: status) } outputBytes.removeSubrange(numBytesWritten..<outputBytes.count) // trim extra padding return Data(outputBytes) } }
34.494505
93
0.527557
3f9c6ef90c38f4fe1d48ac9d585eb50a3c40919d
438
php
PHP
resources/views/xml/getProviderByPhone.blade.php
sayrus383/cashback
03b26abf8b5a56a5627bdec77432f3785e5ca428
[ "MIT" ]
null
null
null
resources/views/xml/getProviderByPhone.blade.php
sayrus383/cashback
03b26abf8b5a56a5627bdec77432f3785e5ca428
[ "MIT" ]
null
null
null
resources/views/xml/getProviderByPhone.blade.php
sayrus383/cashback
03b26abf8b5a56a5627bdec77432f3785e5ca428
[ "MIT" ]
null
null
null
{!! '<'.'?xml version="1.0"?>' !!} <request> <client terminal="{{ config('ssl.qiwi.terminal.client_attributes.terminal') }}" software="{{ config('ssl.qiwi.terminal.client_attributes.software') }}" serial="{{ config('ssl.qiwi.terminal.client_attributes.serial') }}"/> <providers> <getProviderByPhone> <phone>{{ $phone }}</phone> </getProviderByPhone> </providers> </request>
36.5
83
0.591324
ddbd1432c40090320c3799c1f16c67b1703a7415
4,645
java
Java
src/main/java/org/oddjob/arooa/types/ValueType.java
robjg/arooa
72a73bc28a8948240542d7966d1d9fa32c604294
[ "Apache-2.0" ]
null
null
null
src/main/java/org/oddjob/arooa/types/ValueType.java
robjg/arooa
72a73bc28a8948240542d7966d1d9fa32c604294
[ "Apache-2.0" ]
null
null
null
src/main/java/org/oddjob/arooa/types/ValueType.java
robjg/arooa
72a73bc28a8948240542d7966d1d9fa32c604294
[ "Apache-2.0" ]
null
null
null
package org.oddjob.arooa.types; import java.io.Serializable; import org.oddjob.arooa.ArooaValue; import org.oddjob.arooa.convert.ArooaConversionException; import org.oddjob.arooa.convert.ArooaConverter; import org.oddjob.arooa.convert.ConversionLookup; import org.oddjob.arooa.convert.ConversionStep; import org.oddjob.arooa.convert.ConversionProvider; import org.oddjob.arooa.convert.ConversionRegistry; import org.oddjob.arooa.convert.Joker; import org.oddjob.arooa.deploy.annotations.ArooaAttribute; import org.oddjob.arooa.design.DesignFactory; import org.oddjob.arooa.design.DesignInstance; import org.oddjob.arooa.design.DesignProperty; import org.oddjob.arooa.design.DesignValueBase; import org.oddjob.arooa.design.SimpleTextAttribute; import org.oddjob.arooa.design.screem.Form; import org.oddjob.arooa.design.screem.TextPseudoForm; import org.oddjob.arooa.parsing.ArooaContext; import org.oddjob.arooa.parsing.ArooaElement; /** * @oddjob.description A simple value. This is the most commonly used * type. * <p> * A value can be: * <ul> * <li>Any simple type, either text or a number or boolean.</li> * <li>It can also be a reference to any other type somewhere else. i.e. * value can contain a ${someid.anyvalue} reference.</li> * </ul> * <p> * The ValueType value is expected to be an {@link ArooaValue}. This ensures * that references to other types aren't converted until the ValueType * itself is converted. Because of this, simple values will be wrapped * as an {@link ArooaObject} by the automatic internal conversion. For * normal use this is entirely transparent. An example below demonstrates * this. * * @oddjob.example * * A value that is a constant string value. * * {@oddjob.xml.resource org/oddjob/arooa/types/ValueTypeExample1.xml} * * @oddjob.example * * A value that is a reference to a property. * * {@oddjob.xml.resource org/oddjob/arooa/types/ValueTypeExample2.xml} * * @oddjob.example * * Examining the internals of a value in Oddjob. * * {@oddjob.xml.resource org/oddjob/arooa/types/ValueTypeInternalsExample.xml} * * The output is: * * {@oddjob.text.resource org/oddjob/arooa/types/ValueTypeInternalsExampleOut.txt} * * * @author Rob Gordon. */ public class ValueType implements ArooaValue, Serializable { private static final long serialVersionUID = 20070312; // private static final Logger logger = LoggerFactory.getLogger(ValueType.class); public static final ArooaElement ELEMENT = new ArooaElement("value"); /** * @oddjob.property * @oddjob.description Any simple value. * @oddjob.required No, If missing this value will resolve to be null. */ private ArooaValue value; public static class Conversions implements ConversionProvider { public void registerWith(ConversionRegistry registry) { registry.registerJoker(ValueType.class, new Joker<ValueType>() { public <T> ConversionStep<ValueType, T> lastStep( Class<? extends ValueType> from, final Class<T> to, ConversionLookup conversions) { return new ConversionStep<ValueType, T>() { public Class<ValueType> getFromClass() { return ValueType.class; } public Class<T> getToClass() { return to; } public T convert(ValueType from, ArooaConverter converter) throws ArooaConversionException { return converter.convert(from.value, to); } }; } }); } } public static class ValueDesignFactory implements DesignFactory { public DesignInstance createDesign( ArooaElement element, ArooaContext arooaContext) { return new ValueTypeDesign(element, arooaContext); } } static class ValueTypeDesign extends DesignValueBase { private final SimpleTextAttribute value; ValueTypeDesign(ArooaElement element, ArooaContext parentContext) { super(element, parentContext); value = new SimpleTextAttribute("value", this); } public DesignProperty[] children() { return new DesignProperty[] { value }; } public Form detail() { return new TextPseudoForm(value); } } /** * @oddjob.property value * @oddjob.description The value. * @oddjob.required No. */ @ArooaAttribute public void setValue(ArooaValue value) { this.value = value; } public ArooaValue getValue() { return value; } public String toString() { if (value == null) { return "null"; } return value.toString(); } }
28.323171
83
0.695371
dc2a0786b324bcdfc382deccce23fbea5ff5a3de
680
rb
Ruby
Casks/megahertz-knotes.rb
stefansundin/homebrew-cask
751f1d5b2c4c3a34528c6fc2b836f5fe5a8331f6
[ "BSD-2-Clause" ]
null
null
null
Casks/megahertz-knotes.rb
stefansundin/homebrew-cask
751f1d5b2c4c3a34528c6fc2b836f5fe5a8331f6
[ "BSD-2-Clause" ]
33
2020-11-09T06:27:52.000Z
2022-03-28T11:02:21.000Z
Casks/megahertz-knotes.rb
ConnorGray/homebrew-cask
03f5424ad4782b0060be2c1f15243d4bb52cb76c
[ "BSD-2-Clause" ]
null
null
null
cask "megahertz-knotes" do version "2.6.0" sha256 "5946b48b0e6ac588331336f760711c11c53ef9b0030616f39db6e9a41551d434" # knotes2.s3-ap-northeast-1.amazonaws.com/ was verified as official when first introduced to the cask url "https://knotes2.s3-ap-northeast-1.amazonaws.com/download/mac/Knotes-#{version}.dmg" appcast "https://knotes#{version.major}-release-cn.s3.amazonaws.com/mac/latest-mac.yml" name "Knotes" desc "Reading notes management tool" homepage "https://knotesapp.com/" app "Knotes.app" zap trash: [ "~/Library/Application Support/Knotes*", "~/Library/Logs/Knotes*", "~/Library/Preferences/com.knotesapp.knotes.helper.plist", ] end
34
103
0.738235
798450273444e178e8be1557e54222ac06fcb3ee
92
php
PHP
Constants.php
mdzzohrabi/azera-build
fddc4a8c8c0a918eaad0c8f21de0e45aa7d4d0b1
[ "MIT" ]
null
null
null
Constants.php
mdzzohrabi/azera-build
fddc4a8c8c0a918eaad0c8f21de0e45aa7d4d0b1
[ "MIT" ]
null
null
null
Constants.php
mdzzohrabi/azera-build
fddc4a8c8c0a918eaad0c8f21de0e45aa7d4d0b1
[ "MIT" ]
null
null
null
<?php namespace Azera\Build; const BUILD_DIR = '.build'; const DS = DIRECTORY_SEPARATOR; ?>
15.333333
31
0.728261
7daf86f9d2ddc1820f3f7fd3711ea6020783ba6d
1,429
rs
Rust
src/lib.rs
UltiRequiem/moni
28631cb6f85aa8293e8c8136a798000a28eb9522
[ "MIT" ]
4
2022-01-01T16:21:30.000Z
2022-03-19T23:59:40.000Z
src/lib.rs
UltiRequiem/moni
28631cb6f85aa8293e8c8136a798000a28eb9522
[ "MIT" ]
null
null
null
src/lib.rs
UltiRequiem/moni
28631cb6f85aa8293e8c8136a798000a28eb9522
[ "MIT" ]
3
2022-01-01T16:21:32.000Z
2022-01-01T16:50:48.000Z
use futures::future::join_all; use owo_colors::{colors::*, OwoColorize}; use std::{ fs::{metadata, set_permissions}, io::Result, path::Path, }; use tokio::fs::{remove_dir_all, remove_file}; use walkdir::WalkDir; pub fn common_unwanted_directories() -> Vec<String> { vec![ "node_modules".to_string(), "target".to_string(), "__pycache__".to_string(), ".cache".to_string(), "dist".to_string(), "build".to_string(), "bowerComponents".to_string(), ] } pub fn set_writable(path: &Path) { let mut perms = metadata(path).unwrap().permissions(); perms.set_readonly(false); set_permissions(path, perms).unwrap(); } pub async fn delete(entry: &Path) -> Result<()> { if entry.is_file() { remove_file(entry).await?; } else { remove_dir_all(entry).await?; } println!("{}", entry.display().fg::<Black>().bg::<Yellow>()); Ok(()) } pub async fn delete_dirs(dirs: Vec<String>) -> i64 { let mut futures = Vec::new(); let mut count: i64 = 0; for dir in dirs.iter() { for entry in WalkDir::new(dir).into_iter().filter_map(|e| e.ok()) { let path = entry.into_path(); set_writable(&path); count = count + 1; let future = async move { delete(&path).await }; futures.push(future); } } join_all(futures).await; count }
23.048387
75
0.574528
c39dd4c01b84d960b33f69e6819646c8203e074c
10,412
lua
Lua
Source.lua
PysephWasntAvailable/Roblox-Table-To-String
de41fa121855441a048037f5c3743b2d5c9dfde9
[ "Apache-2.0" ]
null
null
null
Source.lua
PysephWasntAvailable/Roblox-Table-To-String
de41fa121855441a048037f5c3743b2d5c9dfde9
[ "Apache-2.0" ]
null
null
null
Source.lua
PysephWasntAvailable/Roblox-Table-To-String
de41fa121855441a048037f5c3743b2d5c9dfde9
[ "Apache-2.0" ]
null
null
null
-- Created by Pyseph#0001 local SpecialCharacters = {['\a'] = '\\a', ['\b'] = '\\b', ['\f'] = '\\f', ['\n'] = '\\n', ['\r'] = '\\r', ['\t'] = '\\t', ['\v'] = '\\v', ['\0'] = '\\0'} local Keywords = { ['and'] = true, ['break'] = true, ['do'] = true, ['else'] = true, ['elseif'] = true, ['end'] = true, ['false'] = true, ['for'] = true, ['function'] = true, ['if'] = true, ['in'] = true, ['local'] = true, ['nil'] = true, ['not'] = true, ['or'] = true, ['repeat'] = true, ['return'] = true, ['then'] = true, ['true'] = true, ['until'] = true, ['while'] = true, ['continue'] = true} local Functions = {[DockWidgetPluginGuiInfo.new] = "DockWidgetPluginGuiInfo.new"; [warn] = "warn"; [CFrame.fromMatrix] = "CFrame.fromMatrix"; [CFrame.fromAxisAngle] = "CFrame.fromAxisAngle"; [CFrame.fromOrientation] = "CFrame.fromOrientation"; [CFrame.fromEulerAnglesXYZ] = "CFrame.fromEulerAnglesXYZ"; [CFrame.Angles] = "CFrame.Angles"; [CFrame.fromEulerAnglesYXZ] = "CFrame.fromEulerAnglesYXZ"; [CFrame.new] = "CFrame.new"; [gcinfo] = "gcinfo"; [os.clock] = "os.clock"; [os.difftime] = "os.difftime"; [os.time] = "os.time"; [os.date] = "os.date"; [tick] = "tick"; [bit32.band] = "bit32.band"; [bit32.extract] = "bit32.extract"; [bit32.bor] = "bit32.bor"; [bit32.bnot] = "bit32.bnot"; [bit32.arshift] = "bit32.arshift"; [bit32.rshift] = "bit32.rshift"; [bit32.rrotate] = "bit32.rrotate"; [bit32.replace] = "bit32.replace"; [bit32.lshift] = "bit32.lshift"; [bit32.lrotate] = "bit32.lrotate"; [bit32.btest] = "bit32.btest"; [bit32.bxor] = "bit32.bxor"; [pairs] = "pairs"; [NumberSequence.new] = "NumberSequence.new"; [assert] = "assert"; [tonumber] = "tonumber"; [Color3.fromHSV] = "Color3.fromHSV"; [Color3.toHSV] = "Color3.toHSV"; [Color3.fromRGB] = "Color3.fromRGB"; [Color3.new] = "Color3.new"; [Delay] = "Delay"; [Stats] = "Stats"; [UserSettings] = "UserSettings"; [coroutine.resume] = "coroutine.resume"; [coroutine.yield] = "coroutine.yield"; [coroutine.running] = "coroutine.running"; [coroutine.status] = "coroutine.status"; [coroutine.wrap] = "coroutine.wrap"; [coroutine.create] = "coroutine.create"; [coroutine.isyieldable] = "coroutine.isyieldable"; [NumberRange.new] = "NumberRange.new"; [PhysicalProperties.new] = "PhysicalProperties.new"; [PluginManager] = "PluginManager"; [Ray.new] = "Ray.new"; [NumberSequenceKeypoint.new] = "NumberSequenceKeypoint.new"; [Version] = "Version"; [Vector2.new] = "Vector2.new"; [Instance.new] = "Instance.new"; [delay] = "delay"; [spawn] = "spawn"; [unpack] = "unpack"; [string.split] = "string.split"; [string.match] = "string.match"; [string.gmatch] = "string.gmatch"; [string.upper] = "string.upper"; [string.gsub] = "string.gsub"; [string.format] = "string.format"; [string.lower] = "string.lower"; [string.sub] = "string.sub"; [string.pack] = "string.pack"; [string.rep] = "string.rep"; [string.char] = "string.char"; [string.packsize] = "string.packsize"; [string.reverse] = "string.reverse"; [string.byte] = "string.byte"; [string.unpack] = "string.unpack"; [string.len] = "string.len"; [string.find] = "string.find"; [CellId.new] = "CellId.new"; [ypcall] = "ypcall"; [version] = "version"; [print] = "print"; [stats] = "stats"; [printidentity] = "printidentity"; [settings] = "settings"; [UDim2.fromOffset] = "UDim2.fromOffset"; [UDim2.fromScale] = "UDim2.fromScale"; [UDim2.new] = "UDim2.new"; [table.pack] = "table.pack"; [table.move] = "table.move"; [table.insert] = "table.insert"; [table.getn] = "table.getn"; [table.foreachi] = "table.foreachi"; [table.maxn] = "table.maxn"; [table.foreach] = "table.foreach"; [table.concat] = "table.concat"; [table.unpack] = "table.unpack"; [table.find] = "table.find"; [table.create] = "table.create"; [table.sort] = "table.sort"; [table.remove] = "table.remove"; [TweenInfo.new] = "TweenInfo.new"; [loadstring] = "loadstring"; [require] = "require"; [Vector3.FromNormalId] = "Vector3.FromNormalId"; [Vector3.FromAxis] = "Vector3.FromAxis"; [Vector3.fromAxis] = "Vector3.fromAxis"; [Vector3.fromNormalId] = "Vector3.fromNormalId"; [Vector3.new] = "Vector3.new"; [Vector3int16.new] = "Vector3int16.new"; [setmetatable] = "setmetatable"; [next] = "next"; [Wait] = "Wait"; [wait] = "wait"; [ipairs] = "ipairs"; [elapsedTime] = "elapsedTime"; [time] = "time"; [rawequal] = "rawequal"; [Vector2int16.new] = "Vector2int16.new"; [collectgarbage] = "collectgarbage"; [newproxy] = "newproxy"; [Spawn] = "Spawn"; [PluginDrag.new] = "PluginDrag.new"; [Region3.new] = "Region3.new"; [utf8.offset] = "utf8.offset"; [utf8.codepoint] = "utf8.codepoint"; [utf8.nfdnormalize] = "utf8.nfdnormalize"; [utf8.char] = "utf8.char"; [utf8.codes] = "utf8.codes"; [utf8.len] = "utf8.len"; [utf8.graphemes] = "utf8.graphemes"; [utf8.nfcnormalize] = "utf8.nfcnormalize"; [xpcall] = "xpcall"; [tostring] = "tostring"; [rawset] = "rawset"; [PathWaypoint.new] = "PathWaypoint.new"; [DateTime.fromUnixTimestamp] = "DateTime.fromUnixTimestamp"; [DateTime.now] = "DateTime.now"; [DateTime.fromIsoDate] = "DateTime.fromIsoDate"; [DateTime.fromUnixTimestampMillis] = "DateTime.fromUnixTimestampMillis"; [DateTime.fromLocalTime] = "DateTime.fromLocalTime"; [DateTime.fromUniversalTime] = "DateTime.fromUniversalTime"; [Random.new] = "Random.new"; [typeof] = "typeof"; [RaycastParams.new] = "RaycastParams.new"; [math.log] = "math.log"; [math.ldexp] = "math.ldexp"; [math.rad] = "math.rad"; [math.cosh] = "math.cosh"; [math.random] = "math.random"; [math.frexp] = "math.frexp"; [math.tanh] = "math.tanh"; [math.floor] = "math.floor"; [math.max] = "math.max"; [math.sqrt] = "math.sqrt"; [math.modf] = "math.modf"; [math.pow] = "math.pow"; [math.atan] = "math.atan"; [math.tan] = "math.tan"; [math.cos] = "math.cos"; [math.sign] = "math.sign"; [math.clamp] = "math.clamp"; [math.log10] = "math.log10"; [math.noise] = "math.noise"; [math.acos] = "math.acos"; [math.abs] = "math.abs"; [math.sinh] = "math.sinh"; [math.asin] = "math.asin"; [math.min] = "math.min"; [math.deg] = "math.deg"; [math.fmod] = "math.fmod"; [math.randomseed] = "math.randomseed"; [math.atan2] = "math.atan2"; [math.ceil] = "math.ceil"; [math.sin] = "math.sin"; [math.exp] = "math.exp"; [getfenv] = "getfenv"; [pcall] = "pcall"; [ColorSequenceKeypoint.new] = "ColorSequenceKeypoint.new"; [ColorSequence.new] = "ColorSequence.new"; [type] = "type"; [Region3int16.new] = "Region3int16.new"; [ElapsedTime] = "ElapsedTime"; [select] = "select"; [getmetatable] = "getmetatable"; [rawget] = "rawget"; [Faces.new] = "Faces.new"; [Rect.new] = "Rect.new"; [BrickColor.Blue] = "BrickColor.Blue"; [BrickColor.White] = "BrickColor.White"; [BrickColor.Yellow] = "BrickColor.Yellow"; [BrickColor.Red] = "BrickColor.Red"; [BrickColor.Gray] = "BrickColor.Gray"; [BrickColor.palette] = "BrickColor.palette"; [BrickColor.New] = "BrickColor.New"; [BrickColor.Black] = "BrickColor.Black"; [BrickColor.Green] = "BrickColor.Green"; [BrickColor.Random] = "BrickColor.Random"; [BrickColor.DarkGray] = "BrickColor.DarkGray"; [BrickColor.random] = "BrickColor.random"; [BrickColor.new] = "BrickColor.new"; [setfenv] = "setfenv"; [UDim.new] = "UDim.new"; [Axes.new] = "Axes.new"; [error] = "error"; [debug.traceback] = "debug.traceback"; [debug.profileend] = "debug.profileend"; [debug.profilebegin] = "debug.profilebegin"} function GetHierarchy(Object) local Hierarchy = {} local ChainLength = 1 local Parent = Object while Parent do Parent = Parent.Parent ChainLength = ChainLength + 1 end Parent = Object local Num = 0 while Parent do Num = Num + 1 local ObjName = string.gsub(Parent.Name, '[%c%z]', SpecialCharacters) ObjName = Parent == game and 'game' or ObjName if Keywords[ObjName] or not string.match(ObjName, '^[_%a][_%w]*$') then ObjName = '["' .. ObjName .. '"]' elseif Num ~= ChainLength - 1 then ObjName = '.' .. ObjName end Hierarchy[ChainLength - Num] = ObjName Parent = Parent.Parent end return table.concat(Hierarchy) end local function SerializeType(Value, Class) if Class == 'string' then -- Not using %q as it messes up the special characters fix return string.format('"%s"', string.gsub(Value, '[%c%z]', SpecialCharacters)) elseif Class == 'Instance' then return GetHierarchy(Value) elseif type(Value) ~= Class then -- CFrame, Vector3, UDim2, ... return Class .. '.new(' .. tostring(Value) .. ')' elseif Class == 'function' then return Functions[Value] or '\'[Unknown ' .. (pcall(setfenv, Value, getfenv(Value)) and 'Lua' or 'C') .. ' ' .. tostring(Value) .. ']\'' elseif Class == 'userdata' then return 'newproxy(' .. tostring(not not getmetatable(Value)) .. ')' elseif Class == 'thread' then return '\'' .. tostring(Value) .. ', status: ' .. coroutine.status(Value) .. '\'' else -- thread, number, boolean, nil, ... return tostring(Value) end end local function TableToString(Table, IgnoredTables, DepthData, Path) IgnoredTables = IgnoredTables or {} local CyclicData = IgnoredTables[Table] if CyclicData then return ((CyclicData[1] == DepthData[1] - 1 and '\'[Cyclic Parent ' or '\'[Cyclic ') .. tostring(Table) .. ', path: ' .. CyclicData[2] .. ']\'') end Path = Path or 'ROOT' DepthData = DepthData or {0, Path} local Depth = DepthData[1] + 1 DepthData[1] = Depth DepthData[2] = Path IgnoredTables[Table] = DepthData local Tab = string.rep(' ', Depth) local TrailingTab = string.rep(' ', Depth - 1) local Result = '{' local LineTab = '\n' .. Tab local HasOrder = true local Index = 1 local IsEmpty = true for Key, Value in next, Table do IsEmpty = false if Index ~= Key then HasOrder = false else Index = Index + 1 end local KeyClass, ValueClass = typeof(Key), typeof(Value) local HasBrackets = false if KeyClass == 'string' then Key = string.gsub(Key, '[%c%z]', SpecialCharacters) if Keywords[Key] or not string.match(Key, '^[_%a][_%w]*$') then HasBrackets = true Key = string.format('["%s"]', Key) end else HasBrackets = true Key = '[' .. (KeyClass == 'table' and string.gsub(TableToString(Key, IgnoredTables, {Depth, Path}), '^%s*(.-)%s*$', '%1') or SerializeType(Key, KeyClass)) .. ']' end Value = ValueClass == 'table' and TableToString(Value, IgnoredTables, {Depth, Path}, Path .. (HasBrackets and '' or '.') .. Key) or SerializeType(Value, ValueClass) Result = Result .. LineTab .. (HasOrder and Value or Key .. ' = ' .. Value) .. ',' end return IsEmpty and Result .. '}' or string.sub(Result, 1, -2) .. '\n' .. TrailingTab .. '}' end
98.226415
6,627
0.6529
8eb872a87d8a8f5b4eac732438c0184bd0c0ef1c
417
js
JavaScript
src/actions/index.js
kirizhu/chat-client
7dc0217a408ba45c9011854ad16b89e04d666f0c
[ "MIT" ]
null
null
null
src/actions/index.js
kirizhu/chat-client
7dc0217a408ba45c9011854ad16b89e04d666f0c
[ "MIT" ]
null
null
null
src/actions/index.js
kirizhu/chat-client
7dc0217a408ba45c9011854ad16b89e04d666f0c
[ "MIT" ]
null
null
null
export const ADD_MESSAGE = 'ADD_MESSAGE'; export const ADD_USERNAME = 'ADD_USERNAME'; export const ADD_USERLIST = 'ADD_USERLIST'; export function addMessage(data) { return { type: ADD_MESSAGE, payload: data, }; } export function addUsername(data) { return { type: ADD_USERNAME, payload: data, }; } export function addUsers(data) { return { type: ADD_USERLIST, payload: data, }; }
18.130435
43
0.681055
fd90885fb1f3c131fdcdea96acd9d0862dee98f0
1,720
css
CSS
clinicamedica/src/main/resources/static/webapp/resources/css/styles.css
andrehgustavo/clinica-medica
e2b8b8882260d68432ffebf12f88dab048234634
[ "Apache-2.0" ]
null
null
null
clinicamedica/src/main/resources/static/webapp/resources/css/styles.css
andrehgustavo/clinica-medica
e2b8b8882260d68432ffebf12f88dab048234634
[ "Apache-2.0" ]
null
null
null
clinicamedica/src/main/resources/static/webapp/resources/css/styles.css
andrehgustavo/clinica-medica
e2b8b8882260d68432ffebf12f88dab048234634
[ "Apache-2.0" ]
null
null
null
*, *::before, *::after { box-sizing: border-box; } html { font-family: sans-serif; line-height: 1.15; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } article, aside, figcaption, figure, footer, header, hgroup, main, nav, section { display: block; } body { margin: 0; font-family: "Roboto Slab", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: 1rem; font-weight: 400; line-height: 1.5; color: #212529; text-align: left; background-color: #fff; } .section{ height: 100%; } .green-dark { background-color: #027368; } .green-light { background-color: #04D99D; } .jumbotron { text-align: center; margin: 50px; } #home-page .jumbotron:hover { background-color: #04D99D; transition: 3s; } .col-jub-50{ width: 50%; } .list-item { display: relative; color: #F2F2F2; } .negrito { font-weight: bold; color: #ffcf33; } .inputs-div { margin: 20px; } .buttons-div { height: 90px; justify-content: space-around; align-items: center; padding: auto; } #cadatro { display: flex; flex-direction: column; justify-content: center; align-items: center; } .modal { display: flexbox; } .form-line{ margin-top: 50px; justify-content: space-around; align-items: center; } .button-action{ cursor: pointer; } .row-flex-100{ display: flex; width: 100%; } .row-50-left{ width: -moz-available; width: 50%; text-align: left; } .row-50-right{ width: -moz-available; width: 50%; text-align: right; }
14.700855
199
0.618605
435d770b809f85cb1d0efc2a0f2d7f0558885b69
1,425
ts
TypeScript
src/difference-parameters.ts
alirya/object
300e909526a1d8eec215130601db42bc69b241d0
[ "Apache-2.0" ]
null
null
null
src/difference-parameters.ts
alirya/object
300e909526a1d8eec215130601db42bc69b241d0
[ "Apache-2.0" ]
null
null
null
src/difference-parameters.ts
alirya/object
300e909526a1d8eec215130601db42bc69b241d0
[ "Apache-2.0" ]
null
null
null
import Equal from '@alirya/boolean/equal-parameters'; import Callable from '@alirya/function/callable'; import {A} from 'ts-toolbelt'; export type DifferenceParametersArgumentValidation<Type extends object, Compare extends object = Type> = Callable<[Type[keyof Type], A.At<Compare, keyof Type>, keyof Type], boolean>; /** * return all data from {@param object} that does not match with {@param compare} * * @param object * base object that value to be returned * * @param compare * object to be compared * * @param validation * comparison for {@param object} and {@param compare} value, if valid * value {@param object} will be returned * * @example * ( { number : 1, * string : 'a', * boolean : true, * }, * { * number : 1, * object : {} * } * )=> { * string : 'a', * boolean : true, * } */ export default function DifferenceParameters<Type extends object, Compare extends object = Type>( object: Type, compare : Compare, validation : DifferenceParametersArgumentValidation<Type, Compare> = Equal as DifferenceParametersArgumentValidation<Type, Compare> ) : Partial<Type> { const results : Partial<Type> = {}; for(const key in object) { if(!validation(object[key], compare[key as PropertyKey], key)) { results[key] = object[key]; } } return results; }
27.403846
135
0.626667
c668f5b013583437e8b15720641b5bff93215e37
1,190
py
Python
bloc_client/internal/rabbitmq.py
fBloc/bloc-client-python
68b61610db0d0a30ba21807a18b4c81db8327500
[ "MIT" ]
null
null
null
bloc_client/internal/rabbitmq.py
fBloc/bloc-client-python
68b61610db0d0a30ba21807a18b4c81db8327500
[ "MIT" ]
null
null
null
bloc_client/internal/rabbitmq.py
fBloc/bloc-client-python
68b61610db0d0a30ba21807a18b4c81db8327500
[ "MIT" ]
null
null
null
from typing import Any from dataclasses import dataclass, field import pika ExchangeName = "bloc_topic_exchange" @dataclass class RabbitMQ: user: str password: str host: str port: int v_host: str channel: Any = field(init=False) def __post_init__(self): connection = pika.BlockingConnection( pika.ConnectionParameters( host=self.host, port=self.port, # virtual_host=self.v_host, credentials=pika.PlainCredentials( self.user, self.password) ) ) channel = connection.channel() channel.basic_qos(prefetch_count=1) channel.exchange_declare(exchange=ExchangeName, exchange_type='topic', durable=True) self.channel = channel def consume_prepare( self, queue_name: str, routing_key: str, ): self.channel.exchange_declare(exchange=ExchangeName, exchange_type='topic', durable=True) self.channel.queue_declare(queue_name, durable=True, exclusive=False, auto_delete=False) self.channel.queue_bind(exchange=ExchangeName, queue=queue_name, routing_key=routing_key)
28.333333
97
0.653782
a4244b9bb9a80c82d3e4d219afed025047c2b6c0
96
php
PHP
resources/views/welcome.blade.php
KhaingThandarHtun/bookstore
71f89e2e99d08399d4f905bcb165a274897e4dd2
[ "MIT" ]
null
null
null
resources/views/welcome.blade.php
KhaingThandarHtun/bookstore
71f89e2e99d08399d4f905bcb165a274897e4dd2
[ "MIT" ]
null
null
null
resources/views/welcome.blade.php
KhaingThandarHtun/bookstore
71f89e2e99d08399d4f905bcb165a274897e4dd2
[ "MIT" ]
null
null
null
@extends('layouts.master') @section('content') <h1>Book Store Management System</h1> @endsection
24
37
0.760417
f8071731c89e0a8f8c38f3abc2066108528e3248
3,984
go
Go
pkg/service/articles_create.go
n8225/readflow
6dac606fb226163366ba2ff556df2074b02f0fdc
[ "MIT" ]
null
null
null
pkg/service/articles_create.go
n8225/readflow
6dac606fb226163366ba2ff556df2074b02f0fdc
[ "MIT" ]
null
null
null
pkg/service/articles_create.go
n8225/readflow
6dac606fb226163366ba2ff556df2074b02f0fdc
[ "MIT" ]
null
null
null
package service import ( "context" "github.com/ncarlier/readflow/pkg/event" "github.com/ncarlier/readflow/pkg/html" "github.com/ncarlier/readflow/pkg/model" // activate all content providers _ "github.com/ncarlier/readflow/pkg/scraper/content-provider/all" ) // ArticleCreationOptions article creation options type ArticleCreationOptions struct { IgnoreHydrateError bool } // CreateArticle creates new article func (reg *Registry) CreateArticle(ctx context.Context, form model.ArticleCreateForm, opts ArticleCreationOptions) (*model.Article, error) { uid := getCurrentUserFromContext(ctx) plan, err := reg.GetCurrentUserPlan(ctx) if err != nil { return nil, err } if plan != nil { // Check user quota req := model.ArticlesPageRequest{} totalArticles, err := reg.CountCurrentUserArticles(ctx, req) if err != nil { reg.logger.Info().Err(err).Uint( "uid", uid, ).Str("title", form.TruncatedTitle()).Msg("unable to create article") return nil, err } if totalArticles >= plan.TotalArticles { err = ErrUserQuotaReached reg.logger.Debug().Err(err).Uint( "uid", uid, ).Str("title", form.TruncatedTitle()).Uint( "total", totalArticles, ).Msg("unable to create article") return nil, err } } // TODO validate article! // Get category if specified var category *model.Category if form.CategoryID != nil { cat, err := reg.GetCategory(ctx, *form.CategoryID) if err != nil { reg.logger.Info().Err(err).Uint( "uid", uid, ).Str("title", form.TruncatedTitle()).Msg("unable to create article") return nil, err } category = cat } if category == nil { // Process article by the rule engine if err := reg.ProcessArticleByRuleEngine(ctx, &form); err != nil { reg.logger.Info().Err(err).Uint( "uid", uid, ).Str("title", form.TruncatedTitle()).Msg("unable to create article") return nil, err } } if form.URL != nil && !form.IsComplete() { // Fetch original article in order to extract missing attributes if err := reg.hydrateArticle(ctx, &form); err != nil { reg.logger.Info().Err(err).Uint( "uid", uid, ).Str("title", form.TruncatedTitle()).Msg("unable to fetch original article") // TODO excerpt and image should be extracted from HTML content if !opts.IgnoreHydrateError { return nil, err } } } // Sanitize HTML content if form.HTML != nil { content := html.Sanitize(*form.HTML) form.HTML = &content } reg.logger.Debug().Uint( "uid", uid, ).Str("title", form.TruncatedTitle()).Msg("creating article...") article, err := reg.db.CreateArticleForUser(uid, form) if err != nil { reg.logger.Info().Err(err).Uint( "uid", uid, ).Str("title", form.TruncatedTitle()).Msg("unable to create article") return nil, err } reg.logger.Info().Uint( "uid", uid, ).Str("title", form.TruncatedTitle()).Uint("id", article.ID).Msg("article created") event.Emit(event.CreateArticle, *article) return article, nil } // CreateArticles creates new articles func (reg *Registry) CreateArticles(ctx context.Context, data []model.ArticleCreateForm) *model.CreatedArticlesResponse { result := model.CreatedArticlesResponse{} for _, art := range data { article, err := reg.CreateArticle(ctx, art, ArticleCreationOptions{ IgnoreHydrateError: true, }) if err != nil { result.Errors = append(result.Errors, err) } if article != nil { result.Articles = append(result.Articles, article) } } return &result } // hydrateArticle add missing attributes form original article func (reg *Registry) hydrateArticle(ctx context.Context, article *model.ArticleCreateForm) error { page, err := reg.webScraper.Scrap(ctx, *article.URL) if page == nil { return err } article.URL = &page.URL if article.Title == "" { article.Title = page.Title } if article.HTML == nil { article.HTML = &page.HTML } if article.Text == nil { article.Text = &page.Text } if article.Image == nil { article.Image = &page.Image } return err }
26.738255
140
0.685241
464c3ae84b6c678b8e7570b9c9e25a3c04eeb864
2,861
php
PHP
admin/cli.php
Under5/bitrix-module-migrations
b9a9c49cba6686fe6ea048ae7d2b7d5208605aa3
[ "MIT" ]
null
null
null
admin/cli.php
Under5/bitrix-module-migrations
b9a9c49cba6686fe6ea048ae7d2b7d5208605aa3
[ "MIT" ]
null
null
null
admin/cli.php
Under5/bitrix-module-migrations
b9a9c49cba6686fe6ea048ae7d2b7d5208605aa3
[ "MIT" ]
null
null
null
<?php $DOCUMENT_ROOT = $_SERVER["DOCUMENT_ROOT"]; define("NO_KEEP_STATISTIC", true); define("NOT_CHECK_PERMISSIONS",true); define('CHK_EVENT', true); @set_time_limit(0); /** * @author Maxim Sokolovsky <sokolovsky@worksolutions.ru> */ $out = fopen('php://stdout', 'w'); $print = function ($str) use (& $out) { fwrite($out, $str."\n"); }; $readln = function () { return trim(fgets(STDIN)); }; $registeredFixes = array(); $registerFix = function ($name) use (& $registeredFixes) { $registeredFixes[$name]++; }; $printRegisteredFixes = function () use (& $registeredFixes, $print) { foreach ($registeredFixes as $name => $count) { $count = $count > 1 ? '['.$count.']' : ''; $print($name.' '.$count); } }; $print(""); array_shift($argv); if (empty($argv)) { $print("Call params are empty"); exit(); } $params = $argv; if ($params[0] == '--help') { $print("Action list:"); $print("* list List of new migrations"); $print("* apply Apply new migrations, \n -f Without approve"); $print("* rollback Rollback last applied migrations"); exit(); } require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php"); require_once(__DIR__."/../include.php"); require_once(__DIR__."/../prolog.php"); $hasForce = in_array('-f', $params); $module = \WS\Migrations\Module::getInstance(); $action = $params[0]; switch ($action) { case "list": $has = false; foreach ($module->getNotAppliedFixes() as $notAppliedFix) { $registerFix($notAppliedFix->getLabel()); $has = true; } foreach ($module->getNotAppliedScenarios() as $notAppliedScenario) { $registerFix($notAppliedScenario::name()); $has = true; } !$has && $print("Nothing to apply"); $has && $printRegisteredFixes(); break; case "apply": if (!$hasForce) { $print("Are you sure? (yes|no):"); $answer = $readln(); if ($answer != 'yes') { exit(); } } $diagnosticTester = $module->getDiagnosticTester(); if (!$diagnosticTester->run()) { $print("Diagnostic is not valid"); exit(); } $print("Applying new fixes is started...."); $time = time(); $count = (int)$module->applyNewFixes(); $interval = time() - $time; $print("Apply action is finished! $count items, time $interval sec"); break; case "rollback": $print("Are you sure? (yes|no):"); $answer = $readln(); if ($answer != 'yes') { exit(); } $module->rollbackLastChanges(); $print("Rollback action is finished!"); break; default: $print("Action `$action` is not supported"); exit(); }
28.326733
95
0.554701
4a825f8a02d93e79bfa998fb99ab260d88bd5272
119
sql
SQL
SQL Queries/top_products_placements.sql
Milwaukee-Bugs-NTUA/DataBasics
c07e7c42ccbc0fdfb28a65e0c7d18b9fa89db798
[ "MIT" ]
null
null
null
SQL Queries/top_products_placements.sql
Milwaukee-Bugs-NTUA/DataBasics
c07e7c42ccbc0fdfb28a65e0c7d18b9fa89db798
[ "MIT" ]
1
2020-05-07T17:54:32.000Z
2020-05-07T17:54:32.000Z
SQL Queries/top_products_placements.sql
Milwaukee-Bugs-NTUA/DataBasics
c07e7c42ccbc0fdfb28a65e0c7d18b9fa89db798
[ "MIT" ]
null
null
null
select alley_number,shelf_number from offers group by alley_number,shelf_number order by count(*) desc limit 5;
19.833333
36
0.781513
6e0cc8ef6a87ebd90e7e58e991b03f45ab17f9e3
1,957
asm
Assembly
SE-1/MAC/Assign11/assign11.asm
Adityajn/College-Codes
f40e1eee53b951f2101981230fc72201081fd5f7
[ "Unlicense" ]
1
2017-02-22T18:22:39.000Z
2017-02-22T18:22:39.000Z
SE-1/MAC/Assign11/assign11.asm
Adityajn/College-Codes
f40e1eee53b951f2101981230fc72201081fd5f7
[ "Unlicense" ]
null
null
null
SE-1/MAC/Assign11/assign11.asm
Adityajn/College-Codes
f40e1eee53b951f2101981230fc72201081fd5f7
[ "Unlicense" ]
null
null
null
%macro print 2 push rax push rbx push rcx push rdx mov eax,4 mov ebx,1 mov ecx,%1 mov edx,%2 int 80h pop rdx pop rcx pop rbx pop rax %endmacro section .data fname db "text",0 ;saves asciiz value of file(hello) in var(fname) section .bss buffer resb 512 ;reserve buffer of 512 bytes for contents fid resd 1 ;reserve buffer of 4bytes for file discriptor cnt resd 1 ;reserve buffer of 4bytes for actual size of contents in buffer result resb 2 ;reserve 2 buyes for result temp resb 1 ;reserve 1 byte for temp section .text global _start _start: mov eax,005 ;system open mov ebx,fname ;asciiz filename mov ecx,0 ;read only mov edx,700q ;owner have read, write and execute permissions int 80h mov [fid],eax ;return file discriptor to file sysread: ;take input from file and store in buffer max 512bytes mov eax,3 mov ebx,[fid] mov ecx,buffer mov edx,512 int 80H mov [cnt],eax ;returns actual bytes stored in buffer mov esi,buffer ;initialize pointer to buffer mov edi,[cnt] ;intialize counter for no of bytes in buffer nxtbyte: mov cl,2 ;initialize counter for both bytes of ascii mov ebx,result ;initialize pointer to result mov al,[esi] ;mov first ascii no to al up: rol al,4 ;rotate left content of al by 4 bits mov [temp],al ;preserve contents of al and al,0Fh ;mask upper 4 bit of al ;conversion of lower 4bits into its ascii cmp al,09h jbe add30 add al,07h add30: add al,30h mov [ebx],al ;store content of al in address of ebx inc ebx ;increase ebx by i byte mov al,[temp] ;recover content of al dec cl ;decrease counter jnz up ;jump if not zero to up print result,2 ;print result inc esi ;increament of pointer dec edi ;decreament of counter of total bytes jnz nxtbyte ;if bytes displayed is equal to size of buffer then displays next 512 bytes cmp dword [cnt],512 jb exit jmp sysread exit: mov eax,6 ;file close mov ebx,[fid] ;file discriptor int 80h mov eax,1 mov ebx,0 int 80h
22.755814
76
0.737864
572bc381de91aeddd7290e2875a41ad0c2114925
1,722
js
JavaScript
src/zlog.js
Zbeyer/providence-vtt
d98ee7647e75c2dd3003d251a6e579a915af0df6
[ "MIT" ]
null
null
null
src/zlog.js
Zbeyer/providence-vtt
d98ee7647e75c2dd3003d251a6e579a915af0df6
[ "MIT" ]
null
null
null
src/zlog.js
Zbeyer/providence-vtt
d98ee7647e75c2dd3003d251a6e579a915af0df6
[ "MIT" ]
null
null
null
let ZB_MODULE_NAME = "PROVIDENCE"; let ZB_LOG_LEVEL = "DEBUG"; let ZB_WHO_AM_I = "Zbeyer"; let ZB_ASCII_ART = ` ██████╗ ██████╗ ██████╗ ██╗ ██╗██╗██████╗ ███████╗███╗ ██╗ ██████╗███████╗ ██╔══██╗██╔══██╗██╔═══██╗██║ ██║██║██╔══██╗██╔════╝████╗ ██║██╔════╝██╔════╝ ██████╔╝██████╔╝██║ ██║██║ ██║██║██║ ██║█████╗ ██╔██╗ ██║██║ █████╗ ██╔═══╝ ██╔══██╗██║ ██║╚██╗ ██╔╝██║██║ ██║██╔══╝ ██║╚██╗██║██║ ██╔══╝ ██║ ██║ ██║╚██████╔╝ ╚████╔╝ ██║██████╔╝███████╗██║ ╚████║╚██████╗███████╗ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═══╝ ╚═╝╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═════╝╚══════╝ `; let DEFAULT_LOG_MESSAGE = `${ZB_MODULE_NAME} ${ZB_LOG_LEVEL}\n\t${ZB_WHO_AM_I}\n`; /** ██████╗ ██████╗ ██████╗ ██╗ ██╗██╗██████╗ ███████╗███╗ ██╗ ██████╗███████╗ ██╔══██╗██╔══██╗██╔═══██╗██║ ██║██║██╔══██╗██╔════╝████╗ ██║██╔════╝██╔════╝ ██████╔╝██████╔╝██║ ██║██║ ██║██║██║ ██║█████╗ ██╔██╗ ██║██║ █████╗ ██╔═══╝ ██╔══██╗██║ ██║╚██╗ ██╔╝██║██║ ██║██╔══╝ ██║╚██╗██║██║ ██╔══╝ ██║ ██║ ██║╚██████╔╝ ╚████╔╝ ██║██████╔╝███████╗██║ ╚████║╚██████╗███████╗ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═══╝ ╚═╝╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═════╝╚══════╝ **/ // https://github.com/League-of-Foundry-Developers/foundryvtt-forien-quest-log/blob/master/src/control/FQLHooks.js let zLog = function (...data) { if (ZB_LOG_LEVEL !== "DEBUG") return; // let caller = JSON.stringify(arguments, 0, '\t') data[0] = DEFAULT_LOG_MESSAGE + data[0]; // data.push('caller' + caller); // data.splice(0,0, console.log(...data); } zLog(ZB_ASCII_ART); export default zLog;
41
118
0.245064
b93a16274384d424d617f280385fb09b3f797453
2,868
css
CSS
BetterDiscord/Dev/Files/badges.css
DJ-JR30/temp
7e6d9fe0ec181e55bd01e2b66a53c8f988861e7c
[ "Apache-2.0" ]
null
null
null
BetterDiscord/Dev/Files/badges.css
DJ-JR30/temp
7e6d9fe0ec181e55bd01e2b66a53c8f988861e7c
[ "Apache-2.0" ]
2
2020-11-01T05:32:50.000Z
2020-11-01T05:34:03.000Z
BetterDiscord/Dev/Files/badges.css
DJ-JR30/temp
7e6d9fe0ec181e55bd01e2b66a53c8f988861e7c
[ "Apache-2.0" ]
null
null
null
.avatar-1BDn8e + h2 > .headerText-3Uvj1Y > .username-1A8OIy::after { display: inline-block; height: 14px; width: 14px; line-height: 14px; background-position: center; background-repeat: no-repeat; background-size: contain; background-image: url(''); position: relative; top: 2px; margin-left: 5px; } .avatar-1BDn8e + h2 > .headerText-3Uvj1Y > .username-1A8OIy:hover::after { width: auto; border-radius: 4px; padding: 2px 5px; background-image: none!important; background-color: #0d0d0d; color: #fff; font-size: 12px; top: -1px; font-weight: normal; animation-timing-function: linear; transition: color .2s ease, background-color .2s ease; } @keyframes rainbow { from{filter: hue-rotate(0deg)} to{filter: hue-rotate(360deg);} } @keyframes scaleIn { from{transform: scale(.1);} to{transform: scale(1);} } @keyframes fadeIn { from{opacity: 0;} to{opacity: 1;} } /*==| MODS |==*/ /* ACE */ .avatar-1BDn8e[src*="781647373129875467"] + h2 > .headerText-3Uvj1Y > .username-1A8OIy::after { content: ""; background-image: url('https://raw.githubusercontent.com/DJ-JR30/ACE-BetterDiscord/gh-pages/BetterDiscord/Dev/Files/images/ExtraLogo/CEO_Logo.png'); } .avatar-1BDn8e[src*="781647373129875467"] + h2 > .headerText-3Uvj1Y > .username-1A8OIy:hover::after { content: "ACE CEO"; animation: fadeIn .5s linear 1; color: #ff8080; width: 75px; text-align: center; background-color: transparent; background-image: url(''); } /*==[OfflineTV ]==*/ /* Pokimane */ .avatar-1BDn8e[src*="95641937423372288"] + h2 > .headerText-3Uvj1Y > .username-1A8OIy::after { content: ""; background-image: url('https://raw.githubusercontent.com/DJ-JR30/ACE-BetterDiscord/gh-pages/BetterDiscord/Dev/Files/images/OfflineTV/Pokimane/pokimane_badges.png'); } .avatar-1BDn8e[src*="95641937423372288"] + h2 > .headerText-3Uvj1Y > .username-1A8OIy:hover::after { content: "Pokimane"; animation: fadeIn .5s linear 1; color: #ff8080; width: 75px; text-align: center; background-color: transparent; background-image: url(''); } /*==|CUSTOM BADGES|==*/ /* Spectra */ .avatar-1BDn8e[src*="286208664623120384"] + h2 > .headerText-3Uvj1Y > .username-1A8OIy::after { content: ""; width: 30px; background-position: left, right; background-image: url('https://i.imgur.com/q3aIwjM.png'), url('https://svgshare.com/i/P5f.svg');} .avatar-1BDn8e[src*="286208664623120384"] + h2 > .headerText-3Uvj1Y > .username-1A8OIy:hover::after { content: ""; background-image: url('https://i.imgur.com/q3aIwjM.png'), url('https://svgshare.com/i/P5f.svg') !important; background-color: transparent !important; padding: 0 !important; transform: none!important; display: inline-block; height: 14px; width: 30px; line-height: 14px; background-position: left, right; top: 2px; margin-left: 5px; }
29.265306
166
0.688633
ae51c973549385fdc52e228b8c86316c4a031764
2,366
cs
C#
samplecode.iOS/CustomRenderers/CustomPickerRenderer.cs
wisnuwh22/XamarinExplorer-SampleCode
097f33831a42815ff4d2e192102429c0c8771d3d
[ "MIT" ]
1
2018-11-30T15:33:25.000Z
2018-11-30T15:33:25.000Z
samplecode.iOS/CustomRenderers/CustomPickerRenderer.cs
MNADEEMCH/XamarinExplorer-SampleCode
097f33831a42815ff4d2e192102429c0c8771d3d
[ "MIT" ]
1
2019-05-29T09:27:24.000Z
2019-05-29T09:27:24.000Z
samplecode.iOS/CustomRenderers/CustomPickerRenderer.cs
MNADEEMCH/XamarinExplorer-SampleCode
097f33831a42815ff4d2e192102429c0c8771d3d
[ "MIT" ]
2
2019-03-11T06:53:37.000Z
2021-12-07T12:04:35.000Z
using System; using Foundation; using samplecode.CustomPickerFolder; using samplecode.iOS.CustomRenderers; using UIKit; using Xamarin.Forms; using Xamarin.Forms.Platform.iOS; [assembly: ExportRenderer(typeof(CustomPicker), typeof(CustomPickerRenderer))] namespace samplecode.iOS.CustomRenderers { public class CustomPickerRenderer : PickerRenderer { protected override void OnElementChanged(ElementChangedEventArgs<Picker> e) { base.OnElementChanged(e); if (e.NewElement != null) { var customPicker = e.NewElement as CustomPicker; // get Bindable properties UIColor placeholderColor = GetUIColor(customPicker.PlaceholderColor); float textSize = (float)customPicker.TextSize; // create font decsriptor var label = new UILabel(); var fontDescriptor = label.Font.FontDescriptor; // adjusting font size var newDescriptor = fontDescriptor.CreateWithAttributes(new UIFontAttributes() { Size = textSize }); UIFont font = UIFont.FromDescriptor(newDescriptor, 0); // set attributes var placeholderAttributes = new NSAttributedString(customPicker.Title, new UIStringAttributes() { ForegroundColor = placeholderColor, Font = font }); Control.AttributedPlaceholder = placeholderAttributes; var textAttributes = new NSAttributedString(customPicker.Title, new UIStringAttributes() { ForegroundColor = placeholderColor, Font = font }); Control.AttributedText = textAttributes; } } private UIColor GetUIColor(string color) { return UIColor.FromRGB(GetRed(color), GetGreen(color), GetBlue(color)); } private float GetRed(string color) { Color c = Color.FromHex(color); return (float)c.R; } private float GetGreen(string color) { Color c = Color.FromHex(color); return (float)c.G; } private float GetBlue(string color) { Color c = Color.FromHex(color); return (float)c.B; } } }
30.333333
111
0.592984
e26cefc6b4bbe90e82d4a8e6444c6878c23bd473
2,370
js
JavaScript
Help/help.js
immunization-tracker/UI
39cd5e0124e464b9eb893988ba40f659a63109d7
[ "MIT" ]
null
null
null
Help/help.js
immunization-tracker/UI
39cd5e0124e464b9eb893988ba40f659a63109d7
[ "MIT" ]
1
2019-06-27T14:32:39.000Z
2019-06-27T14:32:39.000Z
Help/help.js
immunization-tracker/UI
39cd5e0124e464b9eb893988ba40f659a63109d7
[ "MIT" ]
2
2019-06-24T16:26:34.000Z
2019-06-25T15:43:05.000Z
// @@@@@@@@@@@@@@@@@@@@ Accordion @@@@@@@@@@@@@@@@@@@@ const expandBtn = document.querySelectorAll('.expand-btn') const collapseBtn = document.querySelectorAll('.collapse-btn') $(".accordion").on("click", ".accordion-header", function() { // if border is highlighted when clicked, close the panel and do nothing else if ($(this).hasClass('active-header')) { $(this).toggleClass("active-header").next().slideToggle() $(this).find('.expand-btn').toggleClass('hidden-btn') $(this).find('.collapse-btn').toggleClass('hidden-btn') } else { // otherwise, reset the other panels (collapse all) and then open clicked panel // resets all panels $('.accordion-header').removeClass("active-header").next().slideUp() expandBtn.forEach(item => item.classList.remove('hidden-btn')) collapseBtn.forEach(item => item.classList.add('hidden-btn')) // turn on panel $(this).toggleClass("active-header").next().slideToggle() $(this).find('.expand-btn').toggleClass('hidden-btn') $(this).find('.collapse-btn').toggleClass('hidden-btn') } }) document.addEventListener('click', event => { if ((event.target.closest('.accordion-header')) || (event.target.closest('.accordion-content'))) return $('.accordion-header').removeClass("active-header").next().slideUp() expandBtn.forEach(item => item.classList.remove('hidden-btn')) collapseBtn.forEach(item => item.classList.add('hidden-btn')) }) window.addEventListener('resize', event => { $('.accordion-header').removeClass("active-header").next().slideUp() expandBtn.forEach(item => item.classList.remove('hidden-btn')) collapseBtn.forEach(item => item.classList.add('hidden-btn')) }) // @@@@@@@@@@@@@@@@@@@@ Search Bar @@@@@@@@@@@@@@@@@@@@ document.querySelector('.search-icon').addEventListener('click', () => alert('Search functionality currently down. Please try again later.')) // @@@@@@@@@@@@@@@@@@@@ Night Mode @@@@@@@@@@@@@@@@@@@@ const nightModeButton = document.querySelector('.night-mode-button') nightModeButton.addEventListener('click', () => { if (nightModeButton.textContent === 'Night Mode') { nightModeButton.textContent = 'Day Mode' } else { nightModeButton.textContent = 'Night Mode' } document.querySelector('body').classList.toggle('night-mode-toggle') })
48.367347
141
0.640084
e2b7bcfd53ac1eba89cc37c32e2dbb8e9648c88d
436
py
Python
halo_flask/settingsx.py
yoramk2/halo_flask
d3daddb19b1236f50332c18c8a34ca129746549c
[ "MIT" ]
1
2020-07-14T12:49:22.000Z
2020-07-14T12:49:22.000Z
halo_flask/settingsx.py
yoramk2/halo_flask
d3daddb19b1236f50332c18c8a34ca129746549c
[ "MIT" ]
null
null
null
halo_flask/settingsx.py
yoramk2/halo_flask
d3daddb19b1236f50332c18c8a34ca129746549c
[ "MIT" ]
null
null
null
from __future__ import print_function from flask import current_app as app from halo_flask.classes import AbsBaseClass class settingsx(AbsBaseClass): def __getattribute__(self, name): global flx try: settings = app.config attr = settings.get(name) return attr except RuntimeError as e: print("settingsx=" + name + " error:" + str(e)) return None
27.25
59
0.626147
c99544bec7f14a5ceca562853705e7ff3d22cea2
860
ts
TypeScript
src/rest/GuideResources.ts
pip-suite/pip-suite-guidance
fda012cc6199d9b8ac2d010dc2418f470fed12eb
[ "MIT" ]
null
null
null
src/rest/GuideResources.ts
pip-suite/pip-suite-guidance
fda012cc6199d9b8ac2d010dc2418f470fed12eb
[ "MIT" ]
null
null
null
src/rest/GuideResources.ts
pip-suite/pip-suite-guidance
fda012cc6199d9b8ac2d010dc2418f470fed12eb
[ "MIT" ]
null
null
null
// configured Rest resource function pipGuideDataConfig(pipRestProvider: pip.rest.IRestProvider) { pipRestProvider.registerPagedCollection('guides', '/api/v1/guides/:guide_id'); pipRestProvider.registerResource('guidesRandom', '/api/v1/guides/random'); } // this.registerRoute('get', '/guides', this.getGuides); // this.registerRoute('get', '/guides/random', this.getRandomGuide); // this.registerRoute('get', '/guides/:guide_id', this.getGuide); // this.registerRouteWithAuth('post', '/guides', this._auth.admin(), this.createGuide); // this.registerRouteWithAuth('put', '/guides/:guide_id', this._auth.admin(), this.updateGuide); // this.registerRouteWithAuth('del', '/guides/:guide_id', this._auth.admin(), this.deleteGuide); angular .module('pipGuidance.Rest') .config(pipGuideDataConfig);
50.588235
104
0.696512
affea9791d1b5b376a84f7735d19a245b967217a
1,398
py
Python
test/modules/tls/test_13_proxy.py
tititiou36/httpd
1348607c00ba58ce371f2f8ecb08abf610227043
[ "Apache-2.0" ]
2,529
2015-01-02T11:52:53.000Z
2022-03-30T19:54:27.000Z
test/modules/tls/test_13_proxy.py
tititiou36/httpd
1348607c00ba58ce371f2f8ecb08abf610227043
[ "Apache-2.0" ]
133
2015-04-21T05:50:45.000Z
2022-03-30T14:23:40.000Z
test/modules/tls/test_13_proxy.py
tititiou36/httpd
1348607c00ba58ce371f2f8ecb08abf610227043
[ "Apache-2.0" ]
1,113
2015-01-01T14:47:02.000Z
2022-03-29T16:47:18.000Z
from datetime import timedelta import pytest from .conf import TlsTestConf class TestProxy: @pytest.fixture(autouse=True, scope='class') def _class_scope(self, env): conf = TlsTestConf(env=env, extras={ 'base': "LogLevel proxy:trace1 proxy_http:trace1 ssl:trace1", env.domain_b: [ "ProxyPreserveHost on", f'ProxyPass "/proxy/" "http://127.0.0.1:{env.http_port}/"', f'ProxyPassReverse "/proxy/" "http://{env.domain_b}:{env.http_port}"', ] }) # add vhosts a+b and a ssl proxy from a to b conf.add_tls_vhosts(domains=[env.domain_a, env.domain_b]) conf.install() assert env.apache_restart() == 0 def test_13_proxy_http_get(self, env): data = env.tls_get_json(env.domain_b, "/proxy/index.json") assert data == {'domain': env.domain_b} @pytest.mark.parametrize("name, value", [ ("SERVER_NAME", "b.mod-tls.test"), ("SSL_SESSION_RESUMED", ""), ("SSL_SECURE_RENEG", ""), ("SSL_COMPRESS_METHOD", ""), ("SSL_CIPHER_EXPORT", ""), ("SSL_CLIENT_VERIFY", ""), ]) def test_13_proxy_http_vars(self, env, name: str, value: str): r = env.tls_get(env.domain_b, f"/proxy/vars.py?name={name}") assert r.exit_code == 0, r.stderr assert r.json == {name: value}, r.stdout
34.097561
86
0.587983
0dd94191fbd7274a3a2f39960cdc2a5cc1c92932
9,556
rb
Ruby
lib/chess/figures.rb
dudekowsky/ruby_chess
05978dd667c03a7fedc628f1e1a83503e0bcd3e5
[ "MIT" ]
null
null
null
lib/chess/figures.rb
dudekowsky/ruby_chess
05978dd667c03a7fedc628f1e1a83503e0bcd3e5
[ "MIT" ]
null
null
null
lib/chess/figures.rb
dudekowsky/ruby_chess
05978dd667c03a7fedc628f1e1a83503e0bcd3e5
[ "MIT" ]
null
null
null
class Empty def owner :none end def legal_move?(origin,target,board) false end def name :none end end class Figure attr_reader :sign, :owner attr_accessor :x, :y, :moves def initialize(x,y) @moves = 0 @x = x @y = y @owner = find_owner(y) @sign = find_sign end def find_sign end def move(origin, target) end def find_owner(y) if y < 3 "black" else "white" end end def other_owner return "black" if @owner == "white" return "white" if @owner == "black" end end class Rook < Figure def name "Rook" end def find_sign if @owner == "white" return "\u2656" else return @sign = "\u265C" end end def possible_moves(origin, board) output = [] i,j = origin[0],origin[1] #adds all possible tiles on the top while true break if i <= 0 i-= 1 break if board[i,j].figure.owner == @owner output.push([i,j]) break if board[i,j].figure.owner == other_owner end #add all possible tiles on the bottom i,j = origin[0],origin[1] while true break if i >= 7 i+= 1 break if board[i,j].figure.owner == @owner output.push([i,j]) break if board[i,j].figure.owner == other_owner end #add all possible tiles to the left i,j = origin[0],origin[1] while true break if j <= 0 j-= 1 break if board[i,j].figure.owner == @owner output.push([i,j]) break if board[i,j].figure.owner == other_owner end #add all possible tiles to the right i,j = origin[0],origin[1] while true break if j >= 7 j+= 1 break if board[i,j].figure.owner == @owner output.push([i,j]) break if board[i,j].figure.owner == other_owner end output end def legal_move?(origin, target, board) return true if possible_moves(origin, board).include?(target) false end end class Pawn < Figure def name "Pawn" end def initialize(x,y) super @moves = 0 end def find_sign if @owner == "white" return "\u2659" else return "\u265F" end end def possible_moves(origin, board) output = [] y = origin[0] x = origin[1] #white pawn goes into other direction than black pawn if @owner == "black" # puts "black pawn" #move downward two if first move output.push([y+2,x]) if !board[y+2,x].nil? && (board[y+1,x].figure.owner == :none && board[y+2,x].figure.owner == :none && (@moves == 0)) #move downward output.push([y+1,x]) if !board[y+1,x].nil? && board[y+1,x].figure.owner == :none #take left-downward output.push([y+1,x-1]) if !board[y+1,x-1].nil? && board[y+1,x-1].figure.owner == other_owner #take right-downward output.push([y+1,x+1]) if !board[y+1,x+1].nil? && board[y+1,x+1].figure.owner == other_owner else # puts "white pawn" #move upward two if first move output.push([y-2,x]) if !board[y-2,x].nil? && (board[y-2,x].figure.owner == :none) && (@moves == 0) #move upward output.push([y-1,x]) if !board[y-1,x].nil? && board[y-1,x].figure.owner == :none #take left-upward output.push([y-1,x-1]) if !board[y-1,x-1].nil? && board[y-1,x-1].figure.owner == other_owner #take right-upward output.push([y-1,x+1]) if !board[y-1,x+1].nil? && board[y-1,x+1].figure.owner == other_owner end output end def legal_move?(origin, target, board) return true if possible_moves(origin, board).include?(target) false end end class Bishop < Figure def name "Bishop" end def find_sign if @owner == "white" return "\u2657" else return "\u265D" end end def possible_moves(origin, board) output = [] i,j = origin[0],origin[1] #adds all possible tiles on the top-left while true break if i <= 0 break if j <= 0 i-= 1 j-= 1 break if board[i,j].figure.owner == @owner output.push([i,j]) break if board[i,j].figure.owner == other_owner end #add all possible tiles on the bottom-left i,j = origin[0],origin[1] while true break if i >= 7 break if j <= 0 i+= 1 j-= 1 break if board[i,j].figure.owner == @owner output.push([i,j]) break if board[i,j].figure.owner == other_owner end #add all possible tiles to the top-right i,j = origin[0],origin[1] while true break if i <= 0 break if j >= 7 i-= 1 j+= 1 break if board[i,j].figure.owner == @owner output.push([i,j]) break if board[i,j].figure.owner == other_owner end #add all possible tiles to the bottom-right i,j = origin[0],origin[1] while true break if i >= 7 break if j >= 7 i+= 1 j+= 1 break if board[i,j].figure.owner == @owner output.push([i,j]) break if board[i,j].figure.owner == other_owner end output end def legal_move?(origin, target, board) return true if possible_moves(origin, board).include?(target) false end end class Knight < Figure def name "Knight" end def find_sign if @owner == "white" return "\u2658" else return "\u265E" end end def possible_moves(origin, board) output = [] y = origin[0] x = origin[1] relative_moves = [[2,1],[2,-1],[-2,1],[-2,-1],[1,2],[1,-2],[-1,2],[-1,-2]] relative_moves.each do |relmove| total_move = [ relmove[0] + y, relmove[1] + x ] next if total_move[0] > 7 || total_move[0] < 0 || total_move[1] > 7 || total_move[1] < 0 # puts total_move.to_s output.push(total_move) if !(board[total_move[0],total_move[1]].figure.owner == @owner) # puts output.to_s end output end def legal_move?(origin, target, board) return true if possible_moves(origin,board).include?(target) false end end class King < Figure def name "King" end def find_sign if @owner == "white" return "\u2654" else return "\u265A" end end def possible_moves(origin, board) output = [] y = origin[0] x = origin[1] relative_moves = [[1,1],[1,-1],[-1,1],[-1,-1],[1,0],[-1,0],[0,1,],[0,-1]] relative_moves.each do |relmove| total_move = [ relmove[0] + y, relmove[1] + x ] next if total_move[0] > 7 || total_move[0] < 0 || total_move[1] > 7 || total_move[1] < 0 # puts total_move.to_s output.push(total_move) if !(board[total_move[0],total_move[1]].figure.owner == @owner) # puts output.to_s end output end def legal_move?(origin, target, board) return true if possible_moves(origin, board).include?(target) false end end class Queen < Figure def name "Queen" end def find_sign if @owner == "white" return "\u2655" else return "\u265B" end end def possible_moves(origin, board) output = [] #adds all possible tiles on the top-left i,j = origin[0],origin[1] while true break if i <= 0 break if j <= 0 i-= 1 j-= 1 break if board[i,j].figure.owner == @owner output.push([i,j]) break if board[i,j].figure.owner == other_owner end # puts output.to_s #add all possible tiles on the bottom-left i,j = origin[0],origin[1] while true break if i >= 7 break if j <= 0 i+= 1 j-= 1 break if board[i,j].figure.owner == @owner output.push([i,j]) break if board[i,j].figure.owner == other_owner end # puts output.to_s #add all possible tiles to the top-right i,j = origin[0],origin[1] while true break if i <= 0 break if j >= 7 i-= 1 j+= 1 break if board[i,j].figure.owner == @owner output.push([i,j]) break if board[i,j].figure.owner == other_owner end #add all possible tiles to the bottom-right i,j = origin[0],origin[1] while true break if i >= 7 break if j >= 7 i+= 1 j+= 1 break if board[i,j].figure.owner == @owner output.push([i,j]) break if board[i,j].figure.owner == other_owner end # puts "schräg abgehakt" # puts output.to_s #adds all possible tiles on the top i,j = origin[0],origin[1] while true break if i <= 0 i-= 1 break if board[i,j].figure.owner == @owner output.push([i,j]) break if board[i,j].figure.owner == other_owner end #add all possible tiles on the bottom i,j = origin[0],origin[1] while true break if i >= 7 i+= 1 break if board[i,j].figure.owner == @owner output.push([i,j]) break if board[i,j].figure.owner == other_owner end #add all possible tiles to the left i,j = origin[0],origin[1] while true break if j <= 0 j-= 1 break if board[i,j].figure.owner == @owner output.push([i,j]) break if board[i,j].figure.owner == other_owner end #add all possible tiles to the right i,j = origin[0],origin[1] while true break if j >= 7 j+= 1 break if board[i,j].figure.owner == @owner output.push([i,j]) break if board[i,j].figure.owner == other_owner end output end def legal_move?(origin, target, board) # puts "gerade abgehakt" # puts output.to_s # puts target.to_s return true if possible_moves(origin, board).include?(target) false end end
23.536946
98
0.571787
9177d6969245d0dc6fdf56574bd79106ae99bbff
1,062
sql
SQL
backend/de.metas.vertical.pharma/src/main/sql/postgresql/system/5557140_sys_gh6459-app_add_attachment_listener.sql
dram/metasfresh
a1b881a5b7df8b108d4c4ac03082b72c323873eb
[ "RSA-MD" ]
1,144
2016-02-14T10:29:35.000Z
2022-03-30T09:50:41.000Z
backend/de.metas.vertical.pharma/src/main/sql/postgresql/system/5557140_sys_gh6459-app_add_attachment_listener.sql
vestigegroup/metasfresh
4b2d48c091fb2a73e6f186260a06c715f5e2fe96
[ "RSA-MD" ]
8,283
2016-04-28T17:41:34.000Z
2022-03-30T13:30:12.000Z
backend/de.metas.vertical.pharma/src/main/sql/postgresql/system/5557140_sys_gh6459-app_add_attachment_listener.sql
vestigegroup/metasfresh
4b2d48c091fb2a73e6f186260a06c715f5e2fe96
[ "RSA-MD" ]
441
2016-04-29T08:06:07.000Z
2022-03-28T06:09:56.000Z
-- 2020-04-13T14:32:31.881Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_JavaClass (AD_Client_ID,AD_JavaClass_ID,AD_JavaClass_Type_ID,AD_Org_ID,Classname,Created,CreatedBy,EntityType,IsActive,IsInterface,Name,Updated,UpdatedBy) VALUES (0,540054,540042,0,'de.metas.invoice.export.HealthcareXMLAttachedToInvoiceListener',TO_TIMESTAMP('2020-04-13 16:32:31','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.healthcare.forum_datenaustausch_ch','Y','N','HealthcareXMLAttachedToInvoiceListener',TO_TIMESTAMP('2020-04-13 16:32:31','YYYY-MM-DD HH24:MI:SS'),100) ; -- 2020-04-13T19:00:27.799Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Table_AttachmentListener (AD_Client_ID,AD_JavaClass_ID,AD_Org_ID,AD_Table_AttachmentListener_ID,AD_Table_ID,Created,CreatedBy,IsActive,IsSendNotification,SeqNo,Updated,UpdatedBy) VALUES (0,540054,0,540005,318,TO_TIMESTAMP('2020-04-13 21:00:27','YYYY-MM-DD HH24:MI:SS'),100,'Y','N',10,TO_TIMESTAMP('2020-04-13 21:00:27','YYYY-MM-DD HH24:MI:SS'),100) ;
81.692308
363
0.800377
dfaa4d8893ed4ece2a16c48667ce26bc305cfd4f
821
cs
C#
Vostok.Hercules.Client/Sink/State/IStreamState.cs
vostok/hercules.client
99d5b8fc0b3f600c85bf15c8355a525fab191706
[ "MIT" ]
1
2019-10-03T10:48:53.000Z
2019-10-03T10:48:53.000Z
Vostok.Hercules.Client/Sink/State/IStreamState.cs
vostok/hercules.client
99d5b8fc0b3f600c85bf15c8355a525fab191706
[ "MIT" ]
9
2019-03-23T12:41:49.000Z
2021-11-29T05:41:17.000Z
Vostok.Hercules.Client/Sink/State/IStreamState.cs
vostok/hercules.client
99d5b8fc0b3f600c85bf15c8355a525fab191706
[ "MIT" ]
null
null
null
using JetBrains.Annotations; using Vostok.Commons.Threading; using Vostok.Hercules.Client.Abstractions.Models; using Vostok.Hercules.Client.Sink.Analyzer; using Vostok.Hercules.Client.Sink.Buffers; using Vostok.Hercules.Client.Sink.Statistics; using Vostok.Hercules.Client.Sink.Writing; namespace Vostok.Hercules.Client.Sink.State { internal interface IStreamState { [NotNull] string Name { get; } [NotNull] IBufferPool BufferPool { get; } [NotNull] IMemoryAnalyzer MemoryAnalyzer { get; } [NotNull] IRecordWriter RecordWriter { get; } [NotNull] IStatisticsCollector Statistics { get; } [NotNull] StreamSettings Settings { get; set; } [NotNull] AsyncManualResetEvent SendSignal { get; } } }
24.147059
49
0.671133
b0888d11844661860889ae797cae619842ca8fbe
481
py
Python
xcx_interface/route/system_r.py
linjingheng-dev/python_service
c44d92a4c82f52228617dbabdbb1a57b6ad6de57
[ "Apache-2.0" ]
8
2021-08-08T07:47:31.000Z
2021-08-17T12:09:32.000Z
xcx_interface/route/system_r.py
linjingheng-dev/python_service
c44d92a4c82f52228617dbabdbb1a57b6ad6de57
[ "Apache-2.0" ]
1
2021-07-31T10:16:19.000Z
2021-07-31T10:16:19.000Z
xcx_interface/route/system_r.py
linjingheng-dev/python_service
c44d92a4c82f52228617dbabdbb1a57b6ad6de57
[ "Apache-2.0" ]
1
2021-12-01T15:32:47.000Z
2021-12-01T15:32:47.000Z
from django.urls import path from xcx_interface.controller.system.system_msg import getUserInfo, addUserToBlackList, blackList, getInterfaceList urlpatterns = [ # 获取接口权限表 path('getInterfaceList', getInterfaceList, name='getInterfaceList'), # 获取用户信息 path('getUserInfo', getUserInfo, name='getUserInfo'), # 将用户添加到黑名单中 path('addUserToBlackList', addUserToBlackList, name='addUserToBlackList'), # 删除黑名单 path('blackList', blackList, name='blackList') ]
34.357143
115
0.748441
9ffdf3319fcb0a786ce225c1825be8455c45631d
960
py
Python
day-04/part-1/thomas.py
badouralix/adventofcode-2018
543ce39d4eeb7d9d695459ffadca001a8c56386d
[ "MIT" ]
31
2018-12-01T00:43:40.000Z
2020-05-30T05:18:59.000Z
day-04/part-1/thomas.py
badouralix/adventofcode-2018
543ce39d4eeb7d9d695459ffadca001a8c56386d
[ "MIT" ]
14
2018-12-01T12:14:26.000Z
2021-05-07T22:41:47.000Z
day-04/part-1/thomas.py
badouralix/adventofcode-2018
543ce39d4eeb7d9d695459ffadca001a8c56386d
[ "MIT" ]
10
2018-12-01T23:38:34.000Z
2020-12-28T13:36:10.000Z
from tool.runners.python import SubmissionPy import numpy as np from collections import defaultdict from functools import partial import re import operator import datetime class ThomsSubmission(SubmissionPy): def run(self, s): guards = defaultdict(partial(np.zeros, 60)) guard_id = -1 asleep_since = None lines = s.split("\n") lines.sort() for line in lines: minute = int(line[15:17]) m = re.match(r".* #(\d+) .*", line) if m: guard_id = int(m.group(1)) elif "falls asleep" in line: asleep_since = minute elif "wakes up" in line: guards[guard_id][asleep_since:minute] += 1 asleep_since = None chosen_guard = max([(np.sum(l), guard_id) for guard_id, l in guards.items()])[1] chosen_minute = np.argmax(guards[chosen_guard]) return chosen_guard * chosen_minute
32
88
0.589583
cc682cdeab3558d97a7d7f6e84b8228d4d228880
771
rb
Ruby
talents-bank/spec/features/opportunities/admin_edit_opportunity_spec.rb
Eduardo9976/talents-bank
286aa9c7622b20b3a79e9279353fd60e30cb8b51
[ "MIT" ]
null
null
null
talents-bank/spec/features/opportunities/admin_edit_opportunity_spec.rb
Eduardo9976/talents-bank
286aa9c7622b20b3a79e9279353fd60e30cb8b51
[ "MIT" ]
8
2021-03-10T19:43:26.000Z
2022-02-27T05:26:34.000Z
talents-bank/spec/features/opportunities/admin_edit_opportunity_spec.rb
Eduardo9976/talents-bank
286aa9c7622b20b3a79e9279353fd60e30cb8b51
[ "MIT" ]
null
null
null
require 'rails_helper' feature 'Admin edit and update opportunity' do scenario 'Create opportunity' do oportunidade = create(:opportunity) other_oportunity = create(:opportunity) visit opportunity_path(id: '1' ) expect(page).to have_content'Desenvolvedor 1' expect(page).to have_content'Back-end' expect(page).to have_content'Nível: Junior' expect(page).not_to have_content 'Desenvolvedor 2' end scenario 'Successfully' do oportunidade = create(:opportunity) visit opportunity_path(id: '1' ) click_on 'Editar' fill_in 'Nível', with: 'Pleno' click_on 'Enviar' expect(page).to have_content'Desenvolvedor 3' expect(page).to have_content'Back-end' expect(page).to have_content'Nível: Pleno' end end
28.555556
54
0.715953
a1639688352f4e38f2d09f5b11e38f275455b78c
199
ts
TypeScript
out/ZeneithDB/Meta/Zeneith/Database.schema.d.ts
Divine-Star-Software/ZeneithDB
40522eccfe341e56beee8a52724d797bb80cf7b1
[ "MIT" ]
null
null
null
out/ZeneithDB/Meta/Zeneith/Database.schema.d.ts
Divine-Star-Software/ZeneithDB
40522eccfe341e56beee8a52724d797bb80cf7b1
[ "MIT" ]
null
null
null
out/ZeneithDB/Meta/Zeneith/Database.schema.d.ts
Divine-Star-Software/ZeneithDB
40522eccfe341e56beee8a52724d797bb80cf7b1
[ "MIT" ]
null
null
null
import { ZeneithDatabaseCreationData } from "../Database/Database.types"; export declare type ZeneithDatabaseSchema = { collectionCount: number; creationData: ZeneithDatabaseCreationData; };
33.166667
73
0.78392
f071d55d8502b39a4f4adb3b87de71fec4c86e33
4,217
dart
Dart
.pub/deps/debug/angular_test/lib/src/bootstrap.dart
smirina/tour_of_heroes
216b8c6491dfa0c83aca365e5ac053f9d1c54eda
[ "MIT" ]
null
null
null
.pub/deps/debug/angular_test/lib/src/bootstrap.dart
smirina/tour_of_heroes
216b8c6491dfa0c83aca365e5ac053f9d1c54eda
[ "MIT" ]
null
null
null
.pub/deps/debug/angular_test/lib/src/bootstrap.dart
smirina/tour_of_heroes
216b8c6491dfa0c83aca365e5ac053f9d1c54eda
[ "MIT" ]
null
null
null
// Copyright (c) 2016, 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. import 'dart:async'; import 'dart:html'; import 'package:angular/angular.dart'; import 'package:angular/src/core/application_ref.dart'; import 'package:angular/src/core/change_detection/constants.dart'; import 'package:angular/src/core/linker/app_view_utils.dart'; import 'package:angular/src/core/linker/view_ref.dart'; import 'package:angular_router/angular_router.dart'; import 'package:angular_router/testing.dart'; /// Returns an application injector for [providers] based on a [platform]. /// /// Optionally can include the deprecated router APIs [withRouter]. Injector createTestInjector(List<dynamic> providers, {bool withRouter: false}) { final appInjector = ReflectiveInjector.resolveAndCreate([ BROWSER_APP_PROVIDERS, withRouter ? const [ const Provider(LocationStrategy, useClass: MockLocationStrategy), ] : const [], providers, ], browserStaticPlatform().injector); appViewUtils ??= appInjector.get(AppViewUtils); return appInjector; } /// Returns a future that completes with a new instantiated component. /// /// It is treated as the root component of a temporary application for testing /// and created within the [hostElement] provided. /// /// If [beforeChangeDetection] is specified, allows interacting with instance of /// component created _before_ the initial change detection occurs; for example /// setting up properties or state. Future<ComponentRef> bootstrapForTest<E>( Type appComponentType, Element hostElement, { void beforeChangeDetection(E componentInstance), List addProviders: const [], }) { if (appComponentType == null) { throw new ArgumentError.notNull('appComponentType'); } if (hostElement == null) { throw new ArgumentError.notNull('hostElement'); } // This should be kept in sync with 'bootstrapStatic' as much as possible. final appInjector = createTestInjector([ BROWSER_APP_PROVIDERS, addProviders, ]); final ApplicationRefImpl appRef = appInjector.get(ApplicationRef); NgZoneError caughtError; final NgZone ngZone = appInjector.get(NgZone); final onErrorSub = ngZone.onError.listen((e) { caughtError = e; }); return appRef.run(() { return _runAndLoadComponent( appRef, appComponentType, hostElement, appInjector, beforeChangeDetection: beforeChangeDetection, ).then((componentRef) async { hostElement.append(componentRef.location); await ngZone.onTurnDone.first; onErrorSub.cancel(); if (caughtError != null) { return new Future.error( caughtError.error, new StackTrace.fromString(caughtError.stackTrace.join('\n')), ); } return componentRef; }); }); } Future<ComponentRef> _runAndLoadComponent<E>( ApplicationRefImpl appRef, Type appComponentType, Element hostElement, Injector appInjector, { void beforeChangeDetection(E componentInstance), }) async { final resolver = appInjector.get(ComponentResolver) as ComponentResolver; final componentFactory = await resolver.resolveComponent(appComponentType); final componentRef = componentFactory.create(appInjector); final cdMode = (componentRef.hostView as ViewRefImpl).appView.cdMode; if (!isDefaultChangeDetectionStrategy(cdMode) && cdMode != ChangeDetectionStrategy.CheckAlways) { throw new UnsupportedError( 'The root component in an Angular test or application must use the ' 'default form of change detection (ChangeDetectionStrategy.Default). ' 'Instead got ${(componentRef.hostView as ViewRefImpl).appView.cdMode} ' 'on component $appComponentType.'); } if (beforeChangeDetection != null) { beforeChangeDetection(componentRef.instance); } hostElement.append(componentRef.location); appRef.registerChangeDetector(componentRef.changeDetectorRef); componentRef.onDestroy(() { appRef.unregisterChangeDetector(componentRef.changeDetectorRef); }); appRef.tick(); return componentRef; }
36.353448
80
0.734171
ff0677d426d906ec072e8c409dcea165674da19d
8,153
dart
Dart
lib/src/Math/Region2.dart
regenvanwalbeek/ThreeDart
0ad2d3bb83f17cff6861a07778f6c4ef9a295bbe
[ "BSD-3-Clause" ]
null
null
null
lib/src/Math/Region2.dart
regenvanwalbeek/ThreeDart
0ad2d3bb83f17cff6861a07778f6c4ef9a295bbe
[ "BSD-3-Clause" ]
null
null
null
lib/src/Math/Region2.dart
regenvanwalbeek/ThreeDart
0ad2d3bb83f17cff6861a07778f6c4ef9a295bbe
[ "BSD-3-Clause" ]
null
null
null
part of ThreeDart.Math; /// A math structure for storing a 2D region, like a rectangle. /// This is also used for AABBs (axial alligned bounding boxes). class Region2 { /// The left edge component of the region. final double x; /// The top edge component of the region. final double y; /// The width component of the region. final double dx; /// The height component of the region. final double dy; /// Constructs a new [Region2] instance. Region2._(double this.x, double this.y, double this.dx, double this.dy); /// Constructs a new [Region2] instance. factory Region2(double x, double y, double dx, double dy) { if (dx < 0.0) { x = x + dx; dx = -dx; } if (dy < 0.0) { y = y + dy; dy = -dy; } return new Region2._(x, y, dx, dy); } /// Constructs a new [Region2] at the origin. factory Region2.zero() => new Region2(0.0, 0.0, 0.0, 0.0); /// Constructs a new [Region2] at the given point, [pnt]. factory Region2.fromPoint(Point2 pnt, [double dx = 0.0, double dy = 0.0]) => new Region2(pnt.x, pnt.y, dx, dy); /// Constructs a new [Region2] from two opposite corners. factory Region2.fromCorners(Point2 a, Point2 b) => new Region2(a.x, a.y, b.x-a.x, b.y-a.y); /// Constructs a new [Region2] at the given ray. factory Region2.fromRay(Ray2 ray) => new Region2(ray.x, ray.y, ray.dx, ray.dy); /// Constructs a new [Region2] instance given a list of 4 doubles. /// [values] is a list of doubles are in the order x, y, dx, then dy. factory Region2.fromList(List<double> values) { assert(values.length == 4); return new Region2(values[0], values[1], values[2], values[3]); } /// Constructs the union of the given regions. If both are null, null is returned. factory Region2.union(Region2 a, Region2 b) { if (a == null) return b; if (b == null) return a; double x = math.min(a.x, b.x); double y = math.min(a.y, b.y); double x2 = math.max(a.x+a.dx, b.x+b.dx); double y2 = math.max(a.y+a.dy, b.y+b.dy); return new Region2._(x, y, x2-x, y2-y); } /// Expands the region to include the given point, [pnt]. Region2 expandWithPoint(Point2 pnt) => this.expand(pnt.x, pnt.y); /// Expands the region to include the given location components. Region2 expand(double x, double y) { double dx = this.dx; if (x < this.x) dx = this.dx + (this.x - x); else { if (x > this.x + this.dx) dx = x - this.x; x = this.x; } double dy = this.dy; if (y < this.y) dy = this.dy + (this.y - y); else { if (y > this.y + this.dy) dy = y - this.y; y = this.y; } return new Region2._(x, y, dx, dy); } /// Gets an list of 4 doubles in the order x, y, dx, then dy. List<double> toList() => [this.x, this.y, this.dx, this.dy]; /// The minimum side of the region. double get minSide { if (this.dx > this.dy) return this.dy; else return this.dx; } /// The maximum side of the region. double get maxSide { if (this.dx > this.dy) return this.dx; else return this.dy; } /// Gets the adjusted point of the given [raw] point. /// This point is normalized into the region. Point2 adjustPoint(Point2 raw) { final double width = this.dx*0.5; final double height = this.dy*0.5; final double x = raw.x - this.x - width; final double y = raw.y - this.y - height; return new Point2(x, y)*2.0/this.minSide; } /// Gets the adjusted vector of the given [raw] vector. /// This vector is normalized into the region. Vector2 adjustVector(Vector2 raw) { return raw*2.0/this.minSide; } /// Determines the location the given point is in relation to the region. HitRegion hit(Point2 a) { HitRegion region = HitRegion.None; if (a.x < this.x) region |= HitRegion.XNeg; else if (a.x >= this.x+this.dx) region |= HitRegion.XPos; else region |= HitRegion.XCenter; if (a.y < this.y) region |= HitRegion.YNeg; else if (a.y >= this.y+this.dy) region |= HitRegion.YPos; else region |= HitRegion.YCenter; return region; } /// nearestPoint finds the closest point in or on the edge of this region to the given point. Point2 nearestPoint(Point2 a) { HitRegion reg = this.hit(a); double x = reg.has(HitRegion.XNeg)? this.x: reg.has(HitRegion.XPos)? this.x+this.dx: a.x; double y = reg.has(HitRegion.YNeg)? this.y: reg.has(HitRegion.YPos)? this.y+this.dy: a.y; return new Point2(x, y); } /// Determines the intersection between the given [ray] and this region. /// Will return nil if there is no intersection. IntersectionRayRegion2 rayIntersection(Ray2 ray) { final double maxx = this.x + this.dx; final double maxy = this.y + this.dy; // Check for point inside box, trivial reject, and determine // parametric distance to each front face bool inside = true; double xt, xn, xp; HitRegion xregion; if (ray.x < this.x) { xt = this.x - ray.x; if (xt > ray.dx) return null; xt /= ray.dx; inside = false; xn = -1.0; xp = this.x; xregion = HitRegion.XNeg; } else { if (ray.x > maxx) { xt = maxx - ray.x; if (xt < ray.dx) return null; xt /= ray.dx; inside = false; xn = 1.0; xp = maxx; xregion = HitRegion.XPos; } else { xt = -1.0; } } double yt, yn, yp; HitRegion yregion; if (ray.y < this.y) { yt = this.y - ray.y; if (yt > ray.dy) return null; yt /= ray.dy; inside = false; yn = -1.0; yp = this.y; yregion = HitRegion.YNeg; } else { if (ray.y > maxy) { yt = maxy - ray.y; if (yt < ray.dy) return null; yt /= ray.dy; inside = false; yn = 1.0; yp = maxy; yregion = HitRegion.YPos; } else { yt = -1.0; } } if (inside) { return new IntersectionRayRegion2(ray.start, -ray.vector.normal(), 0.0, HitRegion.Inside); } // The farthest plane is the plane of intersection. if (yt > xt) { // intersect with xz plane double x = ray.x + ray.dx*yt; if (x < this.x || x > maxx) return null; return new IntersectionRayRegion2(new Point2(x, yp), new Vector2(0.0, yn), yt, yregion); } else { // intersect with yz plane double y = ray.y + ray.dy*xt; if (y < this.y || y > maxy) return null; return new IntersectionRayRegion2(new Point2(xp, y), new Vector2(xn, 0.0), xt, xregion); } } /// Determines if the given point is contained inside this region. bool contains(Point2 a) { if (a.x < this.x) return false; else if (a.x >= this.x+this.dx) return false; if (a.y < this.y) return false; else if (a.y >= this.y+this.dy) return false; return true; } /// Determines if the two regions overlap even partually. bool overlap(Region2 a) => (a.x <= this.x + this.dx) && (a.y <= this.y + this.dy) && (a.x + a.dx >= this.x) && (a.y + a.dy >= this.y); /// Determines if the given [other] variable is a [Region2] equal to this region. /// The equality of the doubles is tested with the current [Comparer] method. bool operator ==(var other) { if (identical(this, other)) return true; if (other is! Region2) return false; Region2 size = other as Region2; if (!Comparer.equals(size.x, this.x)) return false; if (!Comparer.equals(size.y, this.y)) return false; if (!Comparer.equals(size.dx, this.dx)) return false; if (!Comparer.equals(size.dy, this.dy)) return false; return true; } /// Gets the string for this region. String toString() => this.format(); /// Gets the formatted string for this region. String format([int fraction = 3, int whole = 0]) => '['+ formatDouble(this.x, fraction, whole)+ ', '+formatDouble(this.y, fraction, whole)+ ', '+formatDouble(this.dx, fraction, whole)+ ', '+formatDouble(this.dy, fraction, whole)+']'; }
30.650376
96
0.589599
3851c884c14d03f8cb6982fab14a3d3c502d1ca4
1,024
php
PHP
app/Models/admin_seminarmodel.php
br4masta/ci4app-Project-Tugas-Akhir
02c3f61431e492d8b1298c306d5849ebc3378825
[ "MIT" ]
null
null
null
app/Models/admin_seminarmodel.php
br4masta/ci4app-Project-Tugas-Akhir
02c3f61431e492d8b1298c306d5849ebc3378825
[ "MIT" ]
null
null
null
app/Models/admin_seminarmodel.php
br4masta/ci4app-Project-Tugas-Akhir
02c3f61431e492d8b1298c306d5849ebc3378825
[ "MIT" ]
null
null
null
<?php namespace App\Models; use CodeIgniter\Model; class admin_seminarmodel extends Model { protected $table = 'seminar_proposal'; protected $primaryKey = 'id_seminar'; protected $allowedFields = ['id_seminar', 'id_jadwal', 'status']; public function get_statuspenjadwalan($id) { return $this->db->table('penjadwalan_sidang') ->join('bimbingan', 'bimbingan.id_bimbingan = penjadwalan_sidang.id_bimbingan') ->join('pengajuan_judul', 'pengajuan_judul.id_pengajuan = bimbingan.id_pengajuan') ->join('mahasiswa', 'mahasiswa.id_mhs = pengajuan_judul.id_mhs') // ->join('dosen_penguji', 'dosen_penguji.id_dosenpenguji = penjadwalan_sidang.penguji_2') // ->join('dosen_tugasakhir', 'dosen_tugasakhir.id_dosenta = dosen_penguji.id_dosenta') // ->join('dosen', 'dosen.id_dosen = dosen_tugasakhir.id_dosen') ->where(['id_jadwal' => $id]) // ->where($where) ->get()->getResultArray(); } }
35.310345
102
0.647461
e0a122bc1cdb06d25c686d5e7fb68c7217169e96
5,900
h
C
kernel/linux-4.13/lib/842/842.h
ShawnZhong/SplitFS
7e21a6fc505ff70802e5666d097326ecb97a4ae3
[ "Apache-2.0" ]
55
2019-12-20T03:25:14.000Z
2022-01-16T07:19:47.000Z
kernel/linux-4.13/lib/842/842.h
braymill/SplitFS
00a42bb1b51718048e4c15dde31e9d358932575e
[ "Apache-2.0" ]
5
2020-04-04T09:24:09.000Z
2020-04-19T12:33:55.000Z
kernel/linux-4.13/lib/842/842.h
braymill/SplitFS
00a42bb1b51718048e4c15dde31e9d358932575e
[ "Apache-2.0" ]
30
2018-05-02T08:43:27.000Z
2022-01-23T03:25:54.000Z
#ifndef __842_H__ #define __842_H__ /* The 842 compressed format is made up of multiple blocks, each of * which have the format: * * <template>[arg1][arg2][arg3][arg4] * * where there are between 0 and 4 template args, depending on the specific * template operation. For normal operations, each arg is either a specific * number of data bytes to add to the output buffer, or an index pointing * to a previously-written number of data bytes to copy to the output buffer. * * The template code is a 5-bit value. This code indicates what to do with * the following data. Template codes from 0 to 0x19 should use the template * table, the static "decomp_ops" table used in decompress. For each template * (table row), there are between 1 and 4 actions; each action corresponds to * an arg following the template code bits. Each action is either a "data" * type action, or a "index" type action, and each action results in 2, 4, or 8 * bytes being written to the output buffer. Each template (i.e. all actions * in the table row) will add up to 8 bytes being written to the output buffer. * Any row with less than 4 actions is padded with noop actions, indicated by * N0 (for which there is no corresponding arg in the compressed data buffer). * * "Data" actions, indicated in the table by D2, D4, and D8, mean that the * corresponding arg is 2, 4, or 8 bytes, respectively, in the compressed data * buffer should be copied directly to the output buffer. * * "Index" actions, indicated in the table by I2, I4, and I8, mean the * corresponding arg is an index parameter that points to, respectively, a 2, * 4, or 8 byte value already in the output buffer, that should be copied to * the end of the output buffer. Essentially, the index points to a position * in a ring buffer that contains the last N bytes of output buffer data. * The number of bits for each index's arg are: 8 bits for I2, 9 bits for I4, * and 8 bits for I8. Since each index points to a 2, 4, or 8 byte section, * this means that I2 can reference 512 bytes ((2^8 bits = 256) * 2 bytes), I4 * can reference 2048 bytes ((2^9 = 512) * 4 bytes), and I8 can reference 2048 * bytes ((2^8 = 256) * 8 bytes). Think of it as a kind-of ring buffer for * each of I2, I4, and I8 that are updated for each byte written to the output * buffer. In this implementation, the output buffer is directly used for each * index; there is no additional memory required. Note that the index is into * a ring buffer, not a sliding window; for example, if there have been 260 * bytes written to the output buffer, an I2 index of 0 would index to byte 256 * in the output buffer, while an I2 index of 16 would index to byte 16 in the * output buffer. * * There are also 3 special template codes; 0x1b for "repeat", 0x1c for * "zeros", and 0x1e for "end". The "repeat" operation is followed by a 6 bit * arg N indicating how many times to repeat. The last 8 bytes written to the * output buffer are written again to the output buffer, N + 1 times. The * "zeros" operation, which has no arg bits, writes 8 zeros to the output * buffer. The "end" operation, which also has no arg bits, signals the end * of the compressed data. There may be some number of padding (don't care, * but usually 0) bits after the "end" operation bits, to fill the buffer * length to a specific byte multiple (usually a multiple of 8, 16, or 32 * bytes). * * This software implementation also uses one of the undefined template values, * 0x1d as a special "short data" template code, to represent less than 8 bytes * of uncompressed data. It is followed by a 3 bit arg N indicating how many * data bytes will follow, and then N bytes of data, which should be copied to * the output buffer. This allows the software 842 compressor to accept input * buffers that are not an exact multiple of 8 bytes long. However, those * compressed buffers containing this sw-only template will be rejected by * the 842 hardware decompressor, and must be decompressed with this software * library. The 842 software compression module includes a parameter to * disable using this sw-only "short data" template, and instead simply * reject any input buffer that is not a multiple of 8 bytes long. * * After all actions for each operation code are processed, another template * code is in the next 5 bits. The decompression ends once the "end" template * code is detected. */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/bitops.h> #include <linux/crc32.h> #include <asm/unaligned.h> #include <linux/sw842.h> /* special templates */ #define OP_REPEAT (0x1B) #define OP_ZEROS (0x1C) #define OP_END (0x1E) /* sw only template - this is not in the hw design; it's used only by this * software compressor and decompressor, to allow input buffers that aren't * a multiple of 8. */ #define OP_SHORT_DATA (0x1D) /* additional bits of each op param */ #define OP_BITS (5) #define REPEAT_BITS (6) #define SHORT_DATA_BITS (3) #define I2_BITS (8) #define I4_BITS (9) #define I8_BITS (8) #define CRC_BITS (32) #define REPEAT_BITS_MAX (0x3f) #define SHORT_DATA_BITS_MAX (0x7) /* Arbitrary values used to indicate action */ #define OP_ACTION (0x70) #define OP_ACTION_INDEX (0x10) #define OP_ACTION_DATA (0x20) #define OP_ACTION_NOOP (0x40) #define OP_AMOUNT (0x0f) #define OP_AMOUNT_0 (0x00) #define OP_AMOUNT_2 (0x02) #define OP_AMOUNT_4 (0x04) #define OP_AMOUNT_8 (0x08) #define D2 (OP_ACTION_DATA | OP_AMOUNT_2) #define D4 (OP_ACTION_DATA | OP_AMOUNT_4) #define D8 (OP_ACTION_DATA | OP_AMOUNT_8) #define I2 (OP_ACTION_INDEX | OP_AMOUNT_2) #define I4 (OP_ACTION_INDEX | OP_AMOUNT_4) #define I8 (OP_ACTION_INDEX | OP_AMOUNT_8) #define N0 (OP_ACTION_NOOP | OP_AMOUNT_0) /* the max of the regular templates - not including the special templates */ #define OPS_MAX (0x1a) #endif
45.384615
79
0.73678
4b8d04959850606e294d564058ef814be9b6bfaf
267
dart
Dart
lib/src/utils/constants.dart
giorgiofran/vy_language_tag
7e10bc5e14b85a2ba6158f091d9fca7f504b6e38
[ "BSD-3-Clause" ]
1
2020-03-02T01:11:32.000Z
2020-03-02T01:11:32.000Z
lib/src/utils/constants.dart
giorgiofran/vy_language_tag
7e10bc5e14b85a2ba6158f091d9fca7f504b6e38
[ "BSD-3-Clause" ]
null
null
null
lib/src/utils/constants.dart
giorgiofran/vy_language_tag
7e10bc5e14b85a2ba6158f091d9fca7f504b6e38
[ "BSD-3-Clause" ]
null
null
null
/// Copyright © 2020 Giorgio Franceschetti. All rights reserved. const charHyphen = '-'; const charUnderscore = '_'; const keyLanguage = 'language'; const keyExtlang = 'extlang'; const keyScript = 'script'; const keyRegion = 'region'; const keyVariant = 'variant';
24.272727
64
0.722846
2c93ae9c2b4f2672806792576fc4a130563d3faa
879
py
Python
lbrynet/dht/distance.py
Invariant-Change/lbry
2ddd6b051d4457f0d747428e3d97aa37839f3c93
[ "MIT" ]
null
null
null
lbrynet/dht/distance.py
Invariant-Change/lbry
2ddd6b051d4457f0d747428e3d97aa37839f3c93
[ "MIT" ]
null
null
null
lbrynet/dht/distance.py
Invariant-Change/lbry
2ddd6b051d4457f0d747428e3d97aa37839f3c93
[ "MIT" ]
null
null
null
from lbrynet.dht import constants class Distance(object): """Calculate the XOR result between two string variables. Frequently we re-use one of the points so as an optimization we pre-calculate the long value of that point. """ def __init__(self, key): if len(key) != constants.key_bits / 8: raise ValueError("invalid key length: %i" % len(key)) self.key = key self.val_key_one = long(key.encode('hex'), 16) def __call__(self, key_two): val_key_two = long(key_two.encode('hex'), 16) return self.val_key_one ^ val_key_two def is_closer(self, a, b): """Returns true is `a` is closer to `key` than `b` is""" return self(a) < self(b) def to_contact(self, contact): """A convenience function for calculating the distance to a contact""" return self(contact.id)
31.392857
78
0.634812
44af894b484abb5a3aecef728a2c89f78ce3da3e
4,437
dart
Dart
lib/src/link_to.dart
exaby73/deact_router
06a32b78e38430694dc197cbec133ca6428d061e
[ "MIT" ]
1
2021-10-15T23:45:04.000Z
2021-10-15T23:45:04.000Z
lib/src/link_to.dart
exaby73/deact_router
06a32b78e38430694dc197cbec133ca6428d061e
[ "MIT" ]
null
null
null
lib/src/link_to.dart
exaby73/deact_router
06a32b78e38430694dc197cbec133ca6428d061e
[ "MIT" ]
null
null
null
import 'dart:html' as h; import 'package:deact/deact.dart'; import 'package:deact/deact_html52.dart'; import 'package:deact_router/deact_router.dart'; DeactNode linkTo({ Object? key, Ref<h.Element?>? ref, String? accesskey, String? className, String? contenteditable, String? dir, String? draggable, String? hidden, String? id, String? lang, String? spellcheck, String? style, String? tabindex, String? title, EventListener<h.UIEvent>? onabort, EventListener<h.Event>? onafterprint, EventListener<h.Event>? onbeforeprint, EventListener<h.BeforeUnloadEvent>? onbeforeunload, EventListener<h.FocusEvent>? onblur, EventListener<h.Event>? onchange, EventListener<h.CompositionEvent>? oncompositionend, EventListener<h.CompositionEvent>? oncompositionstart, EventListener<h.CompositionEvent>? oncompositionupdate, EventListener<h.MouseEvent>? oncontextmenu, EventListener<h.MouseEvent>? ondblclick, EventListener<h.MouseEvent>? ondrag, EventListener<h.MouseEvent>? ondragend, EventListener<h.MouseEvent>? ondragenter, EventListener<h.MouseEvent>? ondragleave, EventListener<h.MouseEvent>? ondragover, EventListener<h.MouseEvent>? ondragstart, EventListener<h.MouseEvent>? ondrop, EventListener<h.UIEvent>? onerror, EventListener<h.FocusEvent>? onfocus, EventListener<h.FocusEvent>? onfocusin, EventListener<h.FocusEvent>? onfocusout, EventListener<h.HashChangeEvent>? onhashchange, EventListener<h.Event>? oninput, EventListener<h.Event>? oninvalid, EventListener<h.KeyboardEvent>? onkeydown, EventListener<h.KeyboardEvent>? onkeyup, EventListener<h.Event>? onlanguagechange, EventListener<h.UIEvent>? onload, EventListener<h.MouseEvent>? onmousedown, EventListener<h.MouseEvent>? onmouseenter, EventListener<h.MouseEvent>? onmouseleave, EventListener<h.MouseEvent>? onmousemove, EventListener<h.MouseEvent>? onmouseout, EventListener<h.MouseEvent>? onmouseover, EventListener<h.MouseEvent>? onmouseup, EventListener<h.PageTransitionEvent>? onpagehide, EventListener<h.PageTransitionEvent>? onpageshow, EventListener<h.PopStateEvent>? onpopstate, EventListener<h.Event>? onreset, EventListener<h.UIEvent>? onresize, EventListener<h.UIEvent>? onscroll, EventListener<h.UIEvent>? onselect, EventListener<h.MouseEvent>? onshow, EventListener<h.Event>? onsubmit, EventListener<h.UIEvent>? onunload, EventListener<h.WheelEvent>? onwheel, Iterable<DeactNode>? children, required String href, }) { const _style = 'user-select: none; cursor: pointer;'; return fc( (ctx) => div( key: key, ref: ref, accesskey: accesskey, className: className, contenteditable: contenteditable, dir: dir, draggable: draggable, hidden: hidden, id: id, lang: lang, spellcheck: spellcheck, style: style == null ? _style : '$_style$style', tabindex: tabindex, title: title, onabort: onabort, onafterprint: onafterprint, onbeforeprint: onbeforeprint, onbeforeunload: onbeforeunload, onblur: onblur, onclick: (_) => goto(ctx, href), onchange: onchange, oncompositionend: oncompositionend, oncompositionstart: oncompositionstart, oncompositionupdate: oncompositionupdate, oncontextmenu: oncontextmenu, ondblclick: ondblclick, ondrag: ondrag, ondragend: ondragend, ondragenter: ondragenter, ondragleave: ondragleave, ondragover: ondragover, ondragstart: ondragstart, ondrop: ondrop, onerror: onerror, onfocus: onfocus, onfocusin: onfocusin, onfocusout: onfocusout, onhashchange: onhashchange, oninput: oninput, oninvalid: oninvalid, onkeydown: onkeydown, onkeyup: onkeyup, onlanguagechange: onlanguagechange, onload: onload, onmousedown: onmousedown, onmouseenter: onmouseenter, onmouseleave: onmouseleave, onmousemove: onmousemove, onmouseout: onmouseout, onmouseover: onmouseover, onmouseup: onmouseup, onpagehide: onpagehide, onpageshow: onpageshow, onpopstate: onpopstate, onreset: onreset, onresize: onresize, onscroll: onscroll, onselect: onselect, onshow: onshow, onsubmit: onsubmit, onunload: onunload, onwheel: onwheel, children: children, ), ); }
31.468085
57
0.713545
fd77f89fbeb00ee83d8be36e45edfcdfda1afb70
134
css
CSS
desafios/d009/style.css
GabrielVeroneze/html-css
da9e9d8a8b8e2ca3e593423c010222a75b5023fc
[ "MIT" ]
null
null
null
desafios/d009/style.css
GabrielVeroneze/html-css
da9e9d8a8b8e2ca3e593423c010222a75b5023fc
[ "MIT" ]
null
null
null
desafios/d009/style.css
GabrielVeroneze/html-css
da9e9d8a8b8e2ca3e593423c010222a75b5023fc
[ "MIT" ]
null
null
null
@charset "UTF-8"; body { background-color: rgb(29, 29, 29); color: white; text-align: center; } a { color: white; }
11.166667
38
0.559701
41227750ed7384edfdc4cacc35d8e53730bacd8d
734
lua
Lua
[maps]/grassremover/server.lua
bekiroj/melancia-resources
bc412b2c319bf1562ff1177434b703c2b96251ee
[ "MIT" ]
null
null
null
[maps]/grassremover/server.lua
bekiroj/melancia-resources
bc412b2c319bf1562ff1177434b703c2b96251ee
[ "MIT" ]
1
2022-03-29T01:55:39.000Z
2022-03-29T14:03:53.000Z
[maps]/grassremover/server.lua
bekiroj/melancia-resources
bc412b2c319bf1562ff1177434b703c2b96251ee
[ "MIT" ]
null
null
null
local shader = dxCreateShader("shader.fx") local texture = dxCreateTexture("alpha.png") dxSetShaderValue(shader, "gTexture", texture) local leavesTextureNames = { "sm_Agave_1", "sm_josh_leaf", "sm_Agave_2", "sm_minipalm1", "sm_Agave_bloom", "clothline1_LAe", "deadpalm01", "kbplanter_plants1", "plantb256", "dead_fuzzy", "dead_agave", -- add texture name to the table what you want to make invisible } for _, name in ipairs(leavesTextureNames) do -- loader engineApplyShaderToWorldTexture(shader, name) end setWorldSpecialPropertyEnabled ( "randomfoliage", false ) removeWorldModel ( 859, 10000, 0, 0, 0 ) removeWorldModel ( 678, 10000, 0, 0, 0 ) removeWorldModel ( 677, 10000, 0, 0, 0 ) removeWorldModel ( 677, 10000, 0, 0, 0 )
40.777778
172
0.746594
259e2702eadc14a21e04522d1ae71950a501467d
41
rb
Ruby
sdk/test/Unity/Calabash/features/step_definitions/calabash_steps.rb
tomhaigh/aws-sdk-net
8d2394843b526d9dd5f090c1ae7526df921aa1f8
[ "Apache-2.0" ]
253
2015-01-02T15:10:38.000Z
2022-02-18T18:50:09.000Z
sdk/test/Unity/Calabash/features/step_definitions/calabash_steps.rb
lukeenterprise/aws-sdk-net
5f883a331dc0039ecef910470f6f212ceda5e167
[ "Apache-2.0" ]
59
2015-01-05T09:38:15.000Z
2020-10-22T23:28:38.000Z
sdk/test/Unity/Calabash/features/step_definitions/calabash_steps.rb
lukeenterprise/aws-sdk-net
5f883a331dc0039ecef910470f6f212ceda5e167
[ "Apache-2.0" ]
112
2015-01-04T13:06:51.000Z
2022-02-11T19:08:44.000Z
require 'calabash-android/calabash_steps'
41
41
0.878049
da60dd1f805ebff3cee684d01f0ecc0367e588cb
876
php
PHP
src/Dashboards/Dashboard.php
ImanRJB/admin-cards
2e9a60fda86aaf684c5f8a2706beeaf808e22528
[ "MIT" ]
null
null
null
src/Dashboards/Dashboard.php
ImanRJB/admin-cards
2e9a60fda86aaf684c5f8a2706beeaf808e22528
[ "MIT" ]
null
null
null
src/Dashboards/Dashboard.php
ImanRJB/admin-cards
2e9a60fda86aaf684c5f8a2706beeaf808e22528
[ "MIT" ]
null
null
null
<?php namespace Milyoona\NovaHorizon\Dashboards; use Milyoona\NovaHorizon\Cards\CompletedJobs; use Milyoona\NovaHorizon\Cards\FailedJobs; use Milyoona\NovaHorizon\Cards\PendingJobs; use Milyoona\NovaHorizon\Cards\Stats; use Milyoona\NovaHorizon\Cards\Workload; use Laravel\Nova\Dashboard as NovaDashboard; class Dashboard extends NovaDashboard { /** * Get the cards for the dashboard. * * @return array */ public function cards() { return [ new Stats, new Workload, new PendingJobs, new FailedJobs, new CompletedJobs, ]; } public static function label() { return 'Horizon'; } /** * Get the URI key for the dashboard. * * @return string */ public static function uriKey() { return 'horizon'; } }
19.466667
45
0.610731
b27b7e1265f95e29852fd4384cadc60f753f4d29
117
css
CSS
c014/css/empty-cells.css
alysoncoimbra/HTML5andCSS3
207acc13481d67346dd30e7373f6a3581299d6cb
[ "MIT" ]
null
null
null
c014/css/empty-cells.css
alysoncoimbra/HTML5andCSS3
207acc13481d67346dd30e7373f6a3581299d6cb
[ "MIT" ]
null
null
null
c014/css/empty-cells.css
alysoncoimbra/HTML5andCSS3
207acc13481d67346dd30e7373f6a3581299d6cb
[ "MIT" ]
null
null
null
td{ border: 1px solid #0088dd; padding: 15px; } table.one{ empty-cells: show; } table.two{ empty-cells: hide; }
9.75
27
0.65812
b0a12fd6901a7d8adbc8ba76cdfdeda2941d0028
758
py
Python
report_xlsx_helper/models/ir_actions_report.py
NextERP-Romania/addons_extern
d08f428aeea4cda1890adfd250bc359bda0c33f3
[ "Apache-2.0" ]
null
null
null
report_xlsx_helper/models/ir_actions_report.py
NextERP-Romania/addons_extern
d08f428aeea4cda1890adfd250bc359bda0c33f3
[ "Apache-2.0" ]
null
null
null
report_xlsx_helper/models/ir_actions_report.py
NextERP-Romania/addons_extern
d08f428aeea4cda1890adfd250bc359bda0c33f3
[ "Apache-2.0" ]
null
null
null
# Copyright 2009-2018 Noviat. # License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html). from odoo import _, api, models from odoo.exceptions import UserError class IrActionsReport(models.Model): _inherit = "ir.actions.report" @api.model def render_xlsx(self, docids, data): if not self and self.env.context.get("report_name"): report_model_name = "report.{}".format(self.env.context["report_name"]) report_model = self.env.get(report_model_name) if report_model is None: raise UserError(_("%s model was not found" % report_model_name)) return report_model.create_xlsx_report(docids, data) return super(IrActionsReport, self).render_xlsx(docids, data)
37.9
83
0.684697
ead009070bf428e1ee4fb7c731b295c023d42b03
618
swift
Swift
{PROJECT_NAME}/Sources/Supports/Extensions/UIKit/Color+Application.swift
Hainess/likpia
8ce87e00a2df1744e317e18ddcd849f31b957c3d
[ "MIT" ]
2
2018-07-02T01:18:20.000Z
2018-07-02T04:32:23.000Z
{PROJECT_NAME}/Sources/Supports/Extensions/UIKit/Color+Application.swift
Hainess/likpia
8ce87e00a2df1744e317e18ddcd849f31b957c3d
[ "MIT" ]
56
2018-03-09T11:15:17.000Z
2018-10-12T09:32:20.000Z
{PROJECT_NAME}/Sources/Supports/Extensions/UIKit/Color+Application.swift
Hainess/likpia
8ce87e00a2df1744e317e18ddcd849f31b957c3d
[ "MIT" ]
null
null
null
// swiftlint:disable:this file_name // // UIColor+Application.swift // import UIKit // MARK: - Application colors extension UIColor { convenience init(red: Int, green: Int, blue: Int, alpha: CGFloat) { self.init( red: CGFloat(red) / 255.0, green: CGFloat(green) / 255.0, blue: CGFloat(blue) / 255.0, alpha: alpha ) } convenience init(hex: Int, alpha: CGFloat = 1.0) { self.init( red: (hex >> 16) & 0xFF, green: (hex >> 8) & 0xFF, blue: hex & 0xFF, alpha: alpha ) } }
20.6
71
0.504854
8db77f7aa0794a23c083a12d95cb00e8740ef909
362
ps1
PowerShell
Chapter03/5331_03_04_Copy-NanoServerPhysicalImage.ps1
PacktPublishing/Getting-Started-with-Nano-Server
1c7337e1bf207bf3236fe73685388f694ce0ffa5
[ "MIT" ]
3
2018-01-22T09:04:50.000Z
2021-10-04T04:52:55.000Z
Chapter03/5331_03_04_Copy-NanoServerPhysicalImage.ps1
PacktPublishing/Getting-Started-with-Nano-Server
1c7337e1bf207bf3236fe73685388f694ce0ffa5
[ "MIT" ]
null
null
null
Chapter03/5331_03_04_Copy-NanoServerPhysicalImage.ps1
PacktPublishing/Getting-Started-with-Nano-Server
1c7337e1bf207bf3236fe73685388f694ce0ffa5
[ "MIT" ]
1
2018-01-22T09:06:11.000Z
2018-01-22T09:06:11.000Z
# Copy Nano Server VHD to Physical Computer # Author - Charbel Nemnom # https://charbelnemnom.com # Date - January 18, 2017 # Version 2.0 $ip = "172.16.20.120" $s = New-PSSession -ComputerName $ip -Credential ~\Administrator Invoke-Command -Session $s -ScriptBlock {mkdir c:\Nano} Copy-Item -ToSession $s -Path .\NanoServer01.vhdx -Destination c:\Nano
36.2
70
0.71547
b018c9cad7ae7c283f401fcfcde7addbadba5cc0
4,958
py
Python
tests/test_coesa.py
TheMagicNacho/artemis-nozzle
5c02672feb7b437a4ff0ccc45394de3010bcd5ab
[ "BSD-2-Clause" ]
89
2016-02-11T04:00:24.000Z
2022-02-22T02:54:44.000Z
tests/test_coesa.py
TheMagicNacho/artemis-nozzle
5c02672feb7b437a4ff0ccc45394de3010bcd5ab
[ "BSD-2-Clause" ]
27
2017-06-15T23:34:04.000Z
2021-09-03T20:24:29.000Z
tests/test_coesa.py
TheMagicNacho/artemis-nozzle
5c02672feb7b437a4ff0ccc45394de3010bcd5ab
[ "BSD-2-Clause" ]
27
2016-03-13T17:08:41.000Z
2021-11-10T09:37:30.000Z
# coding: utf-8 """ Tests of the U.S. 1976 Standard Atmosphere implementation. All of them are validated against the `standard`_. .. _`standard`: http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19770009539_1977009539.pdf """ from __future__ import division, absolute_import import numpy as np from numpy.testing import (assert_equal, assert_almost_equal, assert_array_equal, assert_array_almost_equal) import scipy as sp import scipy.constants from skaero.atmosphere import coesa, util def _C2K(val): """Convert Celsius to Kelvins.""" return scipy.constants.convert_temperature([val], 'C', 'K') def test_sea_level(): """Tests sea level values. """ h = 0.0 expected_h = 0.0 expected_T = _C2K(15) expected_p = sp.constants.atm expected_rho = 1.2250 h, T, p, rho = coesa.table(h) assert_equal(h, expected_h) assert_equal(T, expected_T) assert_equal(p, expected_p) assert_almost_equal(rho, expected_rho, decimal=4) def test_sea_level_0d_array(): """Tests sea level values using zero dimension array. """ h = np.array(0.0) expected_h = np.array(0.0) expected_T = np.array(_C2K(15)) expected_p = np.array(sp.constants.atm) expected_rho = np.array(1.2250) h, T, p, rho = coesa.table(h) assert_array_equal(h, expected_h) assert_array_almost_equal(T, expected_T) assert_array_almost_equal(p, expected_p) assert_array_almost_equal(rho, expected_rho) def test_sea_level_nd_array(): """Tests sea level values using n dimension array. """ h = np.array([0.0, 0.0, 0.0]) expected_h = np.array([0.0, 0.0, 0.0]) expected_T = np.array([288.15] * 3) expected_p = np.array([101325.0] * 3) expected_rho = np.array([1.2250] * 3) h, T, p, rho = coesa.table(h) assert_array_equal(h, expected_h) assert_array_almost_equal(T, expected_T) assert_array_almost_equal(p, expected_p) assert_array_almost_equal(rho, expected_rho) def test_geometric_to_geopotential(): z = np.array([50.0, 5550.0, 10450.0]) h = util.geometric_to_geopotential(z) expected_h = np.array([50.0, 5545.0, 10433.0]) assert_array_almost_equal(h, expected_h, decimal=0) def test_under_1000m(): """Tests for altitude values under 1000.0 m """ z = np.array([50.0, 550.0, 850.0]) h = util.geometric_to_geopotential(z) expected_h = np.array([50.0, 550.0, 850.0]) expected_T = np.array([287.825, 284.575, 282.626]) expected_p = np.array([100720.0, 94890.0, 91523.0]) expected_rho = np.array([1.2191, 1.1616, 1.1281]) h, T, p, rho = coesa.table(h) assert_array_almost_equal(h, expected_h, decimal=0) assert_array_almost_equal(T, expected_T, decimal=3) assert_array_almost_equal(p, expected_p, decimal=-1) assert_array_almost_equal(rho, expected_rho, decimal=4) def test_under_11km(): """Tests for altitude values between 1 and 11 km """ z = np.array([500.0, 2500.0, 6500.0, 9000.0, 11000.0]) h = util.geometric_to_geopotential(z) expected_h = np.array([500.0, 2499.0, 6493.0, 8987.0, 10981.0]) expected_T = np.array([284.900, 271.906, 245.943, 229.733, 216.774]) expected_p = np.array([95461.0, 74691.0, 44075.0, 30800.0, 22699.0]) expected_rho = np.array([1.1673, 0.95695, 0.62431, 0.46706, 0.36480]) h, T, p, rho = coesa.table(h) assert_array_almost_equal(h, expected_h, decimal=0) assert_array_almost_equal(T, expected_T, decimal=3) assert_array_almost_equal(p, expected_p, decimal=0) assert_array_almost_equal(rho, expected_rho, decimal=4) def test_under_35km(): """Tests for altitude values between 11 and 35 km """ z = np.array([15000.0, 25000.0, 35000.0]) h = util.geometric_to_geopotential(z) expected_h = np.array([14965.0, 24902., 34808.0]) expected_T = np.array([216.65, 221.552, 236.513]) expected_p = np.array([12111.0, 2549.2, 574.59]) expected_rho = np.array([0.19476, 0.040084, 0.0084634]) h, T, p, rho = coesa.table(h) assert_array_almost_equal(h, expected_h, decimal=0) assert_array_almost_equal(T, expected_T, decimal=3) assert_array_almost_equal(p, expected_p, decimal=0) assert_array_almost_equal(rho, expected_rho, decimal=5) def test_under_86km(): """Tests for altitude values between 35 and 86 km """ z = np.array([50000.0, 70000.0, 86000.0]) h = util.geometric_to_geopotential(z) expected_h = np.array([49610.0, 69238., 84852.0]) expected_T = np.array([270.65, 219.585, 186.87]) expected_p = np.array([79.779, 5.2209, 0.37338]) expected_rho = np.array([0.0010269, 0.000082829, 0.000006958]) h, T, p, rho = coesa.table(h) assert_array_almost_equal(h, expected_h, decimal=0) assert_array_almost_equal(T, expected_T, decimal=2) assert_array_almost_equal(p, expected_p, decimal=3) assert_array_almost_equal(rho, expected_rho, decimal=7)
30.604938
95
0.681121
b931ef76b40cfb4024287b3550e706d76245a842
25
css
CSS
test-projects/scenario-1-app-using-tailwind/sample-app/app/styles/app.css
soxhub/ember-cli-tailwind
9a5ed80fd35509de59b5d25a8e91885dc40c90bd
[ "MIT" ]
106
2018-03-09T01:26:31.000Z
2021-09-26T20:39:35.000Z
test-projects/scenario-1-app-using-tailwind/sample-app/app/styles/app.css
soxhub/ember-cli-tailwind
9a5ed80fd35509de59b5d25a8e91885dc40c90bd
[ "MIT" ]
212
2018-03-10T22:15:54.000Z
2021-08-14T11:58:51.000Z
test-projects/scenario-1-app-using-tailwind/sample-app/app/styles/app.css
soxhub/ember-cli-tailwind
9a5ed80fd35509de59b5d25a8e91885dc40c90bd
[ "MIT" ]
39
2018-02-14T16:27:13.000Z
2021-09-26T20:39:37.000Z
@import 'tailwind.css';
8.333333
23
0.68
b65c8e09f37792f6d83cd852aa6423792787275b
28
lua
Lua
rt/dups/mf/d/1.0.lua
wpoely86/Lmod
9323970e5d191d3f919bbadac14ff2c5670f9a34
[ "MIT" ]
318
2015-01-16T11:39:11.000Z
2022-03-14T18:11:25.000Z
rt/dups/mf/d/1.0.lua
wpoely86/Lmod
9323970e5d191d3f919bbadac14ff2c5670f9a34
[ "MIT" ]
498
2015-01-06T15:12:34.000Z
2022-03-25T10:14:10.000Z
rt/dups/mf/d/1.0.lua
wpoely86/Lmod
9323970e5d191d3f919bbadac14ff2c5670f9a34
[ "MIT" ]
123
2015-02-16T10:33:35.000Z
2022-02-25T15:25:45.000Z
append_path("RTM_PATH","A")
14
27
0.714286
ad7125475bce1b7013958285f3e60da7c02f888a
6,614
rs
Rust
tooling/cli/src/helpers/manifest.rs
dumpmemory/tauri
c8667f9ff75275b1c8743411cc996aac032434f2
[ "Apache-2.0", "MIT" ]
111
2019-07-13T15:32:32.000Z
2019-08-14T10:10:32.000Z
tooling/cli/src/helpers/manifest.rs
dumpmemory/tauri
c8667f9ff75275b1c8743411cc996aac032434f2
[ "Apache-2.0", "MIT" ]
5
2019-07-14T09:44:36.000Z
2019-08-08T13:28:04.000Z
tooling/cli/src/helpers/manifest.rs
dumpmemory/tauri
c8667f9ff75275b1c8743411cc996aac032434f2
[ "Apache-2.0", "MIT" ]
4
2019-07-14T02:41:12.000Z
2019-07-28T18:17:18.000Z
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use super::{ app_paths::tauri_dir, config::{ConfigHandle, PatternKind}, }; use anyhow::Context; use toml_edit::{Array, Document, InlineTable, Item, Table, Value}; use std::{ collections::{HashMap, HashSet}, fs::File, io::{Read, Write}, iter::FromIterator, path::Path, }; #[derive(Default)] pub struct Manifest { pub inner: Document, pub tauri_features: HashSet<String>, } impl Manifest { pub fn features(&self) -> HashMap<String, Vec<String>> { let mut f = HashMap::new(); if let Some(features) = self .inner .as_table() .get("features") .and_then(|f| f.as_table()) { for (feature, enabled_features) in features.into_iter() { if let Item::Value(Value::Array(enabled_features)) = enabled_features { let mut enabled = Vec::new(); for value in enabled_features { if let Value::String(s) = value { enabled.push(s.value().clone()); } } f.insert(feature.to_string(), enabled); } } } f } pub fn all_enabled_features(&self, enabled_features: &[String]) -> Vec<String> { let mut all_enabled_features: Vec<String> = self .tauri_features .iter() .map(|f| format!("tauri/{}", f)) .collect(); let manifest_features = self.features(); for f in enabled_features { all_enabled_features.extend(get_enabled_features(&manifest_features, f)); } all_enabled_features } } fn get_enabled_features(list: &HashMap<String, Vec<String>>, feature: &str) -> Vec<String> { let mut f = Vec::new(); if let Some(enabled_features) = list.get(feature) { for enabled in enabled_features { if list.contains_key(enabled) { f.extend(get_enabled_features(list, enabled)); } else { f.push(enabled.clone()); } } } f } fn read_manifest(manifest_path: &Path) -> crate::Result<Document> { let mut manifest_str = String::new(); let mut manifest_file = File::open(manifest_path) .with_context(|| format!("failed to open `{:?}` file", manifest_path))?; manifest_file.read_to_string(&mut manifest_str)?; let manifest: Document = manifest_str .parse::<Document>() .with_context(|| "failed to parse Cargo.toml")?; Ok(manifest) } fn toml_array(features: &HashSet<String>) -> Array { let mut f = Array::default(); let mut features: Vec<String> = features.iter().map(|f| f.to_string()).collect(); features.sort(); for feature in features { f.push(feature.as_str()); } f } fn write_features( dependencies: &mut Table, dependency_name: &str, all_features: Vec<&str>, features: &mut HashSet<String>, ) -> crate::Result<bool> { let item = dependencies.entry(dependency_name).or_insert(Item::None); if let Some(dep) = item.as_table_mut() { let manifest_features = dep.entry("features").or_insert(Item::None); if let Item::Value(Value::Array(f)) = &manifest_features { for feat in f.iter() { if let Value::String(feature) = feat { if !all_features.contains(&feature.value().as_str()) { features.insert(feature.value().to_string()); } } } } *manifest_features = Item::Value(Value::Array(toml_array(features))); Ok(true) } else if let Some(dep) = item.as_value_mut() { match dep { Value::InlineTable(table) => { let manifest_features = table.get_or_insert("features", Value::Array(Default::default())); if let Value::Array(f) = &manifest_features { for feat in f.iter() { if let Value::String(feature) = feat { if !all_features.contains(&feature.value().as_str()) { features.insert(feature.value().to_string()); } } } } *manifest_features = Value::Array(toml_array(features)); } Value::String(version) => { let mut def = InlineTable::default(); def.get_or_insert( "version", version.to_string().replace('\"', "").replace(' ', ""), ); def.get_or_insert("features", Value::Array(toml_array(features))); *dep = Value::InlineTable(def); } _ => { return Err(anyhow::anyhow!( "Unsupported {} dependency format on Cargo.toml", dependency_name )) } } Ok(true) } else { Ok(false) } } pub fn rewrite_manifest(config: ConfigHandle) -> crate::Result<Manifest> { let manifest_path = tauri_dir().join("Cargo.toml"); let mut manifest = read_manifest(&manifest_path)?; let config_guard = config.lock().unwrap(); let config = config_guard.as_ref().unwrap(); let mut tauri_build_features = HashSet::new(); if let PatternKind::Isolation { .. } = config.tauri.pattern { tauri_build_features.insert("isolation".to_string()); } let resp = write_features( manifest .as_table_mut() .entry("build-dependencies") .or_insert(Item::Table(Table::new())) .as_table_mut() .expect("manifest build-dependencies isn't a table"), "tauri-build", vec!["isolation"], &mut tauri_build_features, )?; let mut tauri_features = HashSet::from_iter(config.tauri.features().into_iter().map(|f| f.to_string())); let cli_managed_tauri_features = super::config::TauriConfig::all_features(); let res = match write_features( manifest .as_table_mut() .entry("dependencies") .or_insert(Item::Table(Table::new())) .as_table_mut() .expect("manifest dependencies isn't a table"), "tauri", cli_managed_tauri_features, &mut tauri_features, ) { Err(e) => Err(e), Ok(t) if !resp => Ok(t), _ => Ok(true), }; match res { Ok(true) => { let mut manifest_file = File::create(&manifest_path).with_context(|| "failed to open Cargo.toml for rewrite")?; manifest_file.write_all( manifest .to_string() // apply some formatting fixes .replace(r#"" ,features =["#, r#"", features = ["#) .replace(r#"" , features"#, r#"", features"#) .replace("]}", "] }") .replace("={", "= {") .replace("=[", "= [") .as_bytes(), )?; manifest_file.flush()?; Ok(Manifest { inner: manifest, tauri_features, }) } Ok(false) => Ok(Manifest { inner: manifest, tauri_features, }), Err(e) => Err(e), } }
27.907173
98
0.599637
3bfffbd0407b4bb3b0b4958b16f4c61c7f1c5cd1
256
sql
SQL
modules/core/db/update/hsql/18/180527-2-add-mapperMode-to-ImportAttributeMapper.sql
beatle01/cuba-component-data-import
06e3226135834ec212ba48137ee221a5c43316b3
[ "Apache-2.0" ]
21
2018-04-21T09:51:13.000Z
2021-05-31T17:52:02.000Z
modules/core/db/update/hsql/18/180527-2-add-mapperMode-to-ImportAttributeMapper.sql
anjul/cuba-component-data-import
0149f173bf1f7d45905fa4e5a4da557209d28f53
[ "Apache-2.0" ]
109
2018-02-20T11:43:57.000Z
2021-06-21T10:37:14.000Z
modules/core/db/update/hsql/18/180527-2-add-mapperMode-to-ImportAttributeMapper.sql
anjul/cuba-component-data-import
0149f173bf1f7d45905fa4e5a4da557209d28f53
[ "Apache-2.0" ]
15
2018-04-18T12:44:52.000Z
2021-08-23T14:04:59.000Z
alter table DDCDI_IMPORT_ATTRIBUTE_MAPPER add column MAPPER_MODE varchar(50) ^ update DDCDI_IMPORT_ATTRIBUTE_MAPPER set MAPPER_MODE = 'AUTOMATIC' where MAPPER_MODE is null ; alter table DDCDI_IMPORT_ATTRIBUTE_MAPPER alter column MAPPER_MODE set not null ;
64
94
0.855469
e770c2fe491bd1830126f67bc7ce7d27b8a27ce6
316
php
PHP
modules/forum/controllers/ProfesionController.php
maik101010/evaluacion
36dd49b24efd4bceee3e27596c4ce0c3d7352db0
[ "BSD-3-Clause" ]
null
null
null
modules/forum/controllers/ProfesionController.php
maik101010/evaluacion
36dd49b24efd4bceee3e27596c4ce0c3d7352db0
[ "BSD-3-Clause" ]
null
null
null
modules/forum/controllers/ProfesionController.php
maik101010/evaluacion
36dd49b24efd4bceee3e27596c4ce0c3d7352db0
[ "BSD-3-Clause" ]
null
null
null
<?php namespace app\modules\forum\controllers; use yii\rest\ActiveController; class ProfesionController extends ActiveController { // ... public $modelClass = 'app\modules\forum\models\Profesion'; // public function verbs() // { // $res = parent::verb(); // return $res; // } }
19.75
62
0.626582
4ac409c06cc6aec6da24d65cbdc4ee24880f6abc
738
dart
Dart
lib/screens/profile_screens/support/interactor/viewmodels/support_bloc.dart
chuck-h/seeds_light_wallet
a95d20d3724d5b458faf03fc5c0677798c6d208b
[ "MIT" ]
2
2019-12-21T10:38:56.000Z
2019-12-22T01:23:51.000Z
lib/screens/profile_screens/support/interactor/viewmodels/support_bloc.dart
chuck-h/seeds_light_wallet
a95d20d3724d5b458faf03fc5c0677798c6d208b
[ "MIT" ]
null
null
null
lib/screens/profile_screens/support/interactor/viewmodels/support_bloc.dart
chuck-h/seeds_light_wallet
a95d20d3724d5b458faf03fc5c0677798c6d208b
[ "MIT" ]
null
null
null
import 'package:bloc/bloc.dart'; import 'package:equatable/equatable.dart'; import 'package:seeds/screens/profile_screens/support/interactor/mappers/support_data_state_mapper.dart'; import 'package:seeds/screens/profile_screens/support/interactor/usecases/get_support_data_usecase.dart'; part 'support_event.dart'; part 'support_state.dart'; class SupportBloc extends Bloc<SupportEvent, SupportState> { SupportBloc() : super(SupportState.initial()) { on<LoadSupportData>(_loadSupportData); } Future<void> _loadSupportData(LoadSupportData event, Emitter<SupportState> emit) async { final SupportDto results = await GetSupportDataUseCase().run(); emit(SupportDataStateMapper().mapResultToState(state, results)); } }
36.9
105
0.794038
81d171c53f5e1f338802fd485fdf432af72142da
1,561
rs
Rust
packages/yew-macro/tests/html_macro/as-return-value-pass.rs
zstewar1/yew
f5b921984ab8cc9b745cfe5a669a812f6d75e261
[ "Apache-2.0", "MIT" ]
8,292
2017-12-24T12:34:44.000Z
2019-08-04T03:56:11.000Z
packages/yew-macro/tests/html_macro/as-return-value-pass.rs
zstewar1/yew
f5b921984ab8cc9b745cfe5a669a812f6d75e261
[ "Apache-2.0", "MIT" ]
504
2017-12-24T20:53:56.000Z
2019-08-04T03:30:44.000Z
packages/yew-macro/tests/html_macro/as-return-value-pass.rs
zstewar1/yew
f5b921984ab8cc9b745cfe5a669a812f6d75e261
[ "Apache-2.0", "MIT" ]
349
2017-12-24T23:37:30.000Z
2019-08-03T03:12:50.000Z
#![no_implicit_prelude] // Shadow primitives #[allow(non_camel_case_types)] pub struct bool; #[allow(non_camel_case_types)] pub struct char; #[allow(non_camel_case_types)] pub struct f32; #[allow(non_camel_case_types)] pub struct f64; #[allow(non_camel_case_types)] pub struct i128; #[allow(non_camel_case_types)] pub struct i16; #[allow(non_camel_case_types)] pub struct i32; #[allow(non_camel_case_types)] pub struct i64; #[allow(non_camel_case_types)] pub struct i8; #[allow(non_camel_case_types)] pub struct isize; #[allow(non_camel_case_types)] pub struct str; #[allow(non_camel_case_types)] pub struct u128; #[allow(non_camel_case_types)] pub struct u16; #[allow(non_camel_case_types)] pub struct u32; #[allow(non_camel_case_types)] pub struct u64; #[allow(non_camel_case_types)] pub struct u8; #[allow(non_camel_case_types)] pub struct usize; pub struct MyComponent; impl ::yew::Component for MyComponent { type Message = (); type Properties = (); fn create(_ctx: &::yew::Context<Self>) -> Self { ::std::unimplemented!() } fn view(&self, _ctx: &::yew::Context<Self>) -> ::yew::Html { ::std::unimplemented!() } } // can test "unused braces" warning inside the macro // https://github.com/yewstack/yew/issues/2157 fn make_my_component()-> ::yew::virtual_dom::VChild<MyComponent>{ ::yew::html_nested!{<MyComponent/>} } // can test "unused braces" warning inside the macro // https://github.com/yewstack/yew/issues/2157 fn make_my_component_html()-> ::yew::Html{ ::yew::html!{<MyComponent/>} } fn main(){}
24.777778
65
0.71877
13afbef74ddbc415646a9676bc9e819e958a922b
2,402
dart
Dart
lib/page/profile/top_bar.dart
aykutbilici/Flutter
8a2c0478bbdc76bf9a4a4d79723a9db7bbc1ce72
[ "Apache-2.0" ]
2,852
2018-12-24T18:02:15.000Z
2021-02-11T03:04:37.000Z
lib/page/profile/top_bar.dart
elileo1/flutter-ui-nice
dd4accc8319c318bdeee3df7a359a4f8db72700d
[ "Apache-2.0" ]
10
2018-12-30T08:03:49.000Z
2020-08-08T04:27:19.000Z
lib/page/profile/top_bar.dart
elileo1/flutter-ui-nice
dd4accc8319c318bdeee3df7a359a4f8db72700d
[ "Apache-2.0" ]
482
2018-12-24T18:04:05.000Z
2021-01-30T00:45:35.000Z
/// /// Created by Terrance Duong on 2019/01/03 /// Github: https://github.com/dndoanh /// Email: dndoanh@gmail.com /// import "package:flutter/material.dart"; import 'profile_const.dart'; import 'package:flutter_ui_nice/const/color_const.dart'; import 'package:flutter_ui_nice/util/SizeUtil.dart'; class TopBar extends StatelessWidget { TopBar( {this.leftIcon, this.rightIcon, this.title, this.onLeftIconPressed, this.onRightIconPressed}); final String leftIcon; final String rightIcon; final String title; final Function() onLeftIconPressed; final Function() onRightIconPressed; @override Widget build(BuildContext context) { final icons = <Widget>[]; if (leftIcon != null) { icons.add(InkWell( onTap: onLeftIconPressed, child: Image.asset(leftIcon, width: SizeUtil.getAxisY(CIRCLE_BUTTON_HEIGHT), height: SizeUtil.getAxisY(CIRCLE_BUTTON_HEIGHT)), )); } if (rightIcon != null) { icons.add(InkWell( onTap: onRightIconPressed, child: Image.asset(rightIcon, width: SizeUtil.getAxisY(CIRCLE_BUTTON_HEIGHT), height: SizeUtil.getAxisY(CIRCLE_BUTTON_HEIGHT)), )); } return Container( constraints: BoxConstraints.expand(height: SizeUtil.getAxisY(TOP_BAR_HEIGHT)), child: Stack( children: <Widget>[ Container( constraints: BoxConstraints.expand( height: SizeUtil.getAxisY(TOP_BAR_GRADIENT_HEIGHT)), decoration: BoxDecoration(gradient: LinearGradient(colors: [YELLOW, BLUE])), ), Center( child: Padding( padding: EdgeInsets.only(top: SizeUtil.getAxisY(30.0)), child: Text( this.title.toUpperCase(), style: TextStyle( color: TEXT_BLACK, fontSize: SizeUtil.getAxisBoth(TEXT_SIZE_L), fontWeight: FontWeight.w700), ), ), ), Container( padding: EdgeInsets.symmetric(horizontal: SizeUtil.getAxisX(24.0)), alignment: AlignmentDirectional.bottomStart, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: icons), ) ], ), ); } }
30.025
80
0.596586
bdc845b88b0326048513adef6f94bbf664d427a2
2,277
rb
Ruby
components/runtime/src/cmdline/vendor/tidy/tidylib.rb
appcelerator/entourage
2f8f9b648a51e043693e9a884673aea20c339e45
[ "Apache-2.0" ]
1
2018-07-16T05:22:41.000Z
2018-07-16T05:22:41.000Z
components/runtime/src/cmdline/vendor/tidy/tidylib.rb
appcelerator/entourage
2f8f9b648a51e043693e9a884673aea20c339e45
[ "Apache-2.0" ]
null
null
null
components/runtime/src/cmdline/vendor/tidy/tidylib.rb
appcelerator/entourage
2f8f9b648a51e043693e9a884673aea20c339e45
[ "Apache-2.0" ]
null
null
null
# Ruby wrapper for HTML Tidy Library Project (http://tidy.sf.net). # module Tidylib extend DL::Importable module_function # Load the library. # def load(path) begin dlload(path) rescue raise LoadError, "Unable to load #{path}" end extern "void *tidyCreate()" extern "void tidyBufFree(void*)" extern "int tidyCleanAndRepair(void*)" extern "int tidyLoadConfig(void*, char*)" extern "int tidyOptGetIdForName(char*)" extern "char tidyOptGetValue(void*, unsigned int)" extern "int tidyOptParseValue(void*, char*, char*)" extern "int tidyParseString(void*, char*)" extern "void tidyRelease(void*)" extern "char* tidyReleaseDate()" extern "int tidyRunDiagnostics(void*)" extern "int tidySaveBuffer(void*, void*)" extern "int tidySetErrorBuffer(void*, void*)" end # tidyBufFree # def buf_free(buf) tidyBufFree(buf) end # tidyCreate # def create tidyCreate end # tidyCleanAndRepair # def clean_and_repair(doc) tidyCleanAndRepair(doc) end # tidyLoadConfig # def load_config(doc, file) tidyLoadConfig(doc, file.to_s) end # tidyOptParseValue # def opt_parse_value(doc, name, value) tidyOptParseValue(doc, translate_name(name), value.to_s) end # tidyOptGetValue (returns true/false instead of 1/0) # def opt_get_value(doc, name) value = tidyOptGetValue(doc, tidyOptGetIdForName(translate_name(name))) Tidy.to_b(value) end # tidyParseString # def parse_string(doc, str) tidyParseString(doc, str.to_s) end # tidyRelease # def release(doc) tidyRelease(doc) end # tidyReleaseDate # def release_date tidyReleaseDate end # tidyRunDiagnostics # def run_diagnostics(doc) tidyRunDiagnostics(doc) end # tidySaveBuffer # def save_buffer(doc, buf) tidySaveBuffer(doc, buf) end # tidySetErrorBuffer # def set_error_buffer(doc, buf) tidySetErrorBuffer(doc, buf) end # Convert to string, replace underscores with dashes (:output_xml => 'output-xml'). # def translate_name(name) name.to_s.gsub('_', '-') end end
20.330357
86
0.639877
93753c7dda196b68ccbb8436a7bf3b7f7d2bbd24
1,645
cs
C#
Library/CustomField.cs
devigo/recurly-client-net
cbda9dc58bd45a0a0b10f89ae77d6cbc4b7c8dad
[ "MIT" ]
null
null
null
Library/CustomField.cs
devigo/recurly-client-net
cbda9dc58bd45a0a0b10f89ae77d6cbc4b7c8dad
[ "MIT" ]
null
null
null
Library/CustomField.cs
devigo/recurly-client-net
cbda9dc58bd45a0a0b10f89ae77d6cbc4b7c8dad
[ "MIT" ]
null
null
null
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml; namespace Recurly { public class CustomField : RecurlyEntity { public string Name; public string Value; public CustomField() { } public CustomField(string name, string value) { Name = name; Value = value; } internal CustomField(XmlTextReader reader) : this() { ReadXml(reader); } internal override void ReadXml(XmlTextReader reader) { while (reader.Read()) { // End of custom_field element, get out of here if (reader.Name == "custom_field" && reader.NodeType == XmlNodeType.EndElement) break; if (reader.NodeType != XmlNodeType.Element) continue; switch (reader.Name) { case "name": Name = reader.ReadElementContentAsString(); break; case "value": Value = reader.ReadElementContentAsString(); break; } } } internal override void WriteXml(XmlTextWriter xmlWriter) { xmlWriter.WriteStartElement("custom_field"); xmlWriter.WriteElementString("name", Name); xmlWriter.WriteElementString("value", Value); xmlWriter.WriteEndElement(); } } }
26.967213
96
0.500912
fd7efe8979b0c79514f2e2b6cad06b79cbb99ca8
2,112
css
CSS
weather-app/src/index.css
devraj255/dev
e8412b94a95d585ec7440a35b607a94f2218ba77
[ "MIT" ]
4
2021-02-09T17:02:50.000Z
2021-07-15T20:19:12.000Z
weather-app/src/index.css
textbook-haroon/ReactJS-Projects
106d0e2610223d9565b886fcc7126387a02ebf7b
[ "MIT" ]
null
null
null
weather-app/src/index.css
textbook-haroon/ReactJS-Projects
106d0e2610223d9565b886fcc7126387a02ebf7b
[ "MIT" ]
1
2021-07-13T14:35:30.000Z
2021-07-13T14:35:30.000Z
* { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: "Ubuntu", sans-serif; } .App { background-image: linear-gradient(to right, rgba(255, 0, 0, 0.52), rgba(0, 195, 255, 0.73)), url("img/app.jpg"); background-repeat: no-repeat; transition: 0.2s ease; } .App.hot { background-image: linear-gradient(to bottom, rgba(255, 16, 16, 0.52), rgba(0, 0, 0, 0.73)), url("img/hot.jpg"); background-repeat: no-repeat; background-size: cover; transition: 0.2s ease; } main { min-height: 100vh; padding: 25px; } .App.cold { background-image: linear-gradient(to bottom, rgba(0, 255, 213, 0.52), rgba(0, 0, 0, 0.73)), url("img/cold.jpg"); background-repeat: no-repeat; background-size: cover; transition: 0.2s ease; } .search-container { width: 100%; margin: 0 0 75px; } .search-bar { color: black; font-size: 15px; display: block; width: 100%; padding: 15px; border: none; outline: none; appearance: none; border-radius: 15px 15px 15px 15px; box-shadow: 0px 5px rgba(58, 53, 53, 0.73); background: rgba(255, 255, 255, 0.52); transition: 0.4s ease; } .search-container .search-bar:focus { background-color: white; } .location-container { color: white; font-size: 30px; text-align: center; text-shadow: 3px 3px rgba(58, 53, 53, 0.73); } .location-container .date { color: white; font-size: 20px; text-align: center; text-shadow: 3px 3px rgba(58, 53, 53, 0.73); } .weather-container { text-align: center; } .weather-container .temperature { color: white; position: relative; display: inline-block; margin: 30px auto; padding: 15px 25px; font-size: 100px; font-weight: 700; background-color: rgb(255, 255, 255, 0.1); border-radius: 16px; box-shadow: 3px 3px rgba(58, 53, 53, 0.73); text-shadow: 3px 3px rgba(58, 53, 53, 0.73); } .weather-container .weather { color: white; font-size: 50px; font-weight: 700; text-shadow: 3px 3px rgba(58, 53, 53, 0.73); } label { color: white; margin: 5px; font-size: 15px; font-family: fantasy; }
18.690265
46
0.633523
0785a470f20588a04cd3884b9f0917c7bfb81eb3
1,883
sql
SQL
dev/kyuubi-tpcds/src/main/resources/tpcds_2_4/q39b.sql
lsm1/incubator-kyuubi
56efdf8cc13c8a517d2a19b2f1f8f44bed6f1e4f
[ "Apache-2.0" ]
411
2021-07-12T17:57:49.000Z
2022-03-31T07:05:32.000Z
dev/kyuubi-tpcds/src/main/resources/tpcds_2_4/q39b.sql
lsm1/incubator-kyuubi
56efdf8cc13c8a517d2a19b2f1f8f44bed6f1e4f
[ "Apache-2.0" ]
1,340
2021-07-12T15:22:33.000Z
2022-03-31T15:53:46.000Z
dev/kyuubi-tpcds/src/main/resources/tpcds_2_4/q39b.sql
lsm1/incubator-kyuubi
56efdf8cc13c8a517d2a19b2f1f8f44bed6f1e4f
[ "Apache-2.0" ]
168
2021-07-12T16:31:17.000Z
2022-03-31T07:05:52.000Z
-- -- Licensed to the Apache Software Foundation (ASF) under one or more -- contributor license agreements. See the NOTICE file distributed with -- this work for additional information regarding copyright ownership. -- The ASF licenses this file to You under the Apache License, Version 2.0 -- (the "License"); you may not use this file except in compliance with -- the License. You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- --q39b.sql-- with inv as (select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy ,stdev,mean, case mean when 0 then null else stdev/mean end cov from(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy ,stddev_samp(inv_quantity_on_hand) stdev,avg(inv_quantity_on_hand) mean from inventory, item, warehouse, date_dim where inv_item_sk = i_item_sk and inv_warehouse_sk = w_warehouse_sk and inv_date_sk = d_date_sk and d_year = 2001 group by w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy) foo where case mean when 0 then 0 else stdev/mean end > 1) select inv1.w_warehouse_sk,inv1.i_item_sk,inv1.d_moy,inv1.mean, inv1.cov ,inv2.w_warehouse_sk,inv2.i_item_sk,inv2.d_moy,inv2.mean, inv2.cov from inv inv1,inv inv2 where inv1.i_item_sk = inv2.i_item_sk and inv1.w_warehouse_sk = inv2.w_warehouse_sk and inv1.d_moy=1 and inv2.d_moy=1+1 and inv1.cov > 1.5 order by inv1.w_warehouse_sk,inv1.i_item_sk,inv1.d_moy,inv1.mean,inv1.cov ,inv2.d_moy,inv2.mean, inv2.cov
43.790698
84
0.738184
99d5106295c08553b6519dbf31c2a3ae9004052a
2,833
swift
Swift
Wechat/Wechat/ViewController.swift
gongmingqm10/SwiftTraining
e6b7acb5e79adc692a874be1c335a065e3009340
[ "MIT" ]
null
null
null
Wechat/Wechat/ViewController.swift
gongmingqm10/SwiftTraining
e6b7acb5e79adc692a874be1c335a065e3009340
[ "MIT" ]
null
null
null
Wechat/Wechat/ViewController.swift
gongmingqm10/SwiftTraining
e6b7acb5e79adc692a874be1c335a065e3009340
[ "MIT" ]
null
null
null
// // ViewController.swift // Wechat // // Created by Ming Gong on 6/18/15. // Copyright © 2015 gongmingqm10. All rights reserved. // import UIKit class ViewController: UITableViewController { @IBOutlet var factTableView: UITableView! @IBOutlet weak var factNavigationTitle: UINavigationItem! let momentDetailSegue = "momentDetailSegue" var moments: [Moment] = [] var selectedMoment: Moment? override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. readJson() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func readJson() { let path = NSBundle.mainBundle().pathForResource("facts-sample", ofType: "json") let jsonData = NSData(contentsOfFile: path!) do { let jsonResult = try NSJSONSerialization.JSONObjectWithData(jsonData!, options: NSJSONReadingOptions.MutableContainers) factNavigationTitle.title = jsonResult["title"] as? String let rows = jsonResult["rows"] as! Array<AnyObject> for index in 0...rows.count - 1 { let row = rows[index] as! NSDictionary let moment = Moment(json: row) if moment.isValid() { moments.append(moment) } } factTableView.reloadData() } catch let error as NSError{ print(error.description) } } override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = factTableView.dequeueReusableCellWithIdentifier("MomentCell", forIndexPath: indexPath) as! MomentTableCell let moment = moments[indexPath.row] cell.populate(moment) return cell } override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return moments.count } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == momentDetailSegue { let navigationController = segue.destinationViewController as! UINavigationController let momentDetailController = navigationController.viewControllers.first as! MomentDetailController momentDetailController.moment = selectedMoment } } override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { self.selectedMoment = moments[indexPath.row] self.performSegueWithIdentifier(momentDetailSegue, sender: self) } @IBAction func unwindToList(segue: UIStoryboardSegue) { } }
33.329412
131
0.655136
25d7ff2f995808413c36283a6480d8e100acd06b
1,060
cs
C#
samples/Playground/Playground.Droid/Views/Frames/FramesActivity.cs
Softeq/XToolkit.WhiteLabel
62c33e8bcf0cf56cc5e164772bd6375c5f4119a9
[ "MIT" ]
25
2018-11-14T16:11:27.000Z
2022-02-23T21:12:24.000Z
samples/Playground/Playground.Droid/Views/Frames/FramesActivity.cs
Softeq/XToolkit.WhiteLabel
62c33e8bcf0cf56cc5e164772bd6375c5f4119a9
[ "MIT" ]
91
2018-11-20T12:34:24.000Z
2022-02-23T11:59:52.000Z
samples/Playground/Playground.Droid/Views/Frames/FramesActivity.cs
Softeq/XToolkit.WhiteLabel
62c33e8bcf0cf56cc5e164772bd6375c5f4119a9
[ "MIT" ]
4
2018-10-25T16:06:37.000Z
2022-01-08T15:49:42.000Z
// Developed by Softeq Development Corporation // http://www.softeq.com using Android.App; using Android.OS; using Playground.ViewModels.Frames; using Softeq.XToolkit.WhiteLabel.Droid; using Softeq.XToolkit.WhiteLabel.Droid.Navigation; namespace Playground.Droid.Views.Frames { [Activity] public class FramesActivity : ActivityBase<FramesViewModel> { protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_frames); ViewModel.InitializeNavigation( new FrameNavigationConfig( SupportFragmentManager, Resource.Id.activity_frames_navigation)); if (savedInstanceState == null) { ViewModel.RestoreState(); } } public override void OnBackPressed() { if (ViewModel.TryHandleBackPress()) { base.OnBackPressed(); } } } }
25.853659
67
0.610377
a45ae33591d0d3a7feaf8e2cab2b20dbb1830a5c
2,750
php
PHP
html/lib/internal/Magento/Framework/App/Test/Unit/Action/AbstractActionTest.php
tarikgwa/test
4b2f33b14d59f60609e432de28051fb5a7092431
[ "Apache-2.0" ]
null
null
null
html/lib/internal/Magento/Framework/App/Test/Unit/Action/AbstractActionTest.php
tarikgwa/test
4b2f33b14d59f60609e432de28051fb5a7092431
[ "Apache-2.0" ]
null
null
null
html/lib/internal/Magento/Framework/App/Test/Unit/Action/AbstractActionTest.php
tarikgwa/test
4b2f33b14d59f60609e432de28051fb5a7092431
[ "Apache-2.0" ]
2
2020-11-04T08:26:46.000Z
2020-11-06T07:38:14.000Z
<?php /** * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Framework\App\Test\Unit\Action; class AbstractActionTest extends \PHPUnit_Framework_TestCase { /** @var \Magento\Framework\App\Action\AbstractAction|\PHPUnit_Framework_MockObject_MockObject */ protected $action; /** @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $request; /** @var \Magento\Framework\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $response; /** @var \Magento\Framework\App\Response\RedirectInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $redirectFactory; /** @var \Magento\Framework\Controller\Result\Redirect|\PHPUnit_Framework_MockObject_MockObject */ protected $redirect; /** @var \Magento\Framework\App\Action\Context|\PHPUnit_Framework_MockObject_MockObject */ protected $context; public function setUp() { $this->request = $this->getMockBuilder('Magento\Framework\App\RequestInterface') ->disableOriginalConstructor()->getMock(); $this->response = $this->getMock('Magento\Framework\App\ResponseInterface', [], [], '', false); $this->redirect = $this->getMockBuilder('Magento\Framework\Controller\Result\Redirect') ->setMethods(['setRefererOrBaseUrl']) ->disableOriginalConstructor() ->getMock(); $this->redirectFactory = $this->getMockBuilder('Magento\Backend\Model\View\Result\RedirectFactory') ->setMethods(['create']) ->disableOriginalConstructor() ->getMock(); $this->redirectFactory->expects($this->any()) ->method('create') ->willReturn($this->redirect); $this->context = $this->getMockBuilder('Magento\Framework\App\Action\Context') ->disableOriginalConstructor() ->getMock(); $this->context->expects($this->any()) ->method('getResultRedirectFactory') ->willReturn($this->redirectFactory); $this->context->expects($this->once()) ->method('getRequest') ->willReturn($this->request); $this->context->expects($this->once()) ->method('getResponse') ->willReturn($this->response); $this->action = $this->getMockForAbstractClass('Magento\Framework\App\Action\AbstractAction', [$this->context]); } public function testGetRequest() { $this->assertEquals($this->request, $this->action->getRequest()); } public function testGetResponse() { $this->assertEquals($this->response, $this->action->getResponse()); } }
37.671233
120
0.656727
d2ce8a5b975ae7592de12b53d329029487bc6e17
6,028
sql
SQL
nbshu.sql
jomslx/thinkshu
aff87ed2408eac158faf0936bdabaef1ff08a049
[ "BSD-2-Clause" ]
null
null
null
nbshu.sql
jomslx/thinkshu
aff87ed2408eac158faf0936bdabaef1ff08a049
[ "BSD-2-Clause" ]
null
null
null
nbshu.sql
jomslx/thinkshu
aff87ed2408eac158faf0936bdabaef1ff08a049
[ "BSD-2-Clause" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 4.4.13.1deb1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: 2015-11-30 03:57:15 -- 服务器版本: 5.6.27-0ubuntu1 -- PHP Version: 5.6.11-1ubuntu3.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `nbshu` -- -- -------------------------------------------------------- -- -- 表的结构 `nb_art_artitle` -- CREATE TABLE IF NOT EXISTS `nb_art_artitle` ( `artitleid` int(8) unsigned NOT NULL, `categoryid` int(8) unsigned NOT NULL DEFAULT '0' COMMENT '类别', `postdate` int(11) unsigned NOT NULL COMMENT '上传时间', `lastupdate` int(11) unsigned NOT NULL COMMENT '最后更新时间', `title` varchar(50) NOT NULL COMMENT '文章标题', `initial` varchar(1) NOT NULL COMMENT '首字母', `authorid` int(8) DEFAULT NULL COMMENT '作者ID', `authorname` varchar(30) DEFAULT NULL COMMENT '作者名', `intro` text NOT NULL COMMENT '简介', `size` int(11) unsigned DEFAULT '0' COMMENT '文章字数', `dayvisit` int(11) unsigned DEFAULT '0' COMMENT '日访问量', `weekvisit` int(11) unsigned DEFAULT '0', `monthvisit` int(11) unsigned DEFAULT '0', `allvisit` int(20) unsigned DEFAULT '0', `saleprice` int(8) DEFAULT NULL, `delete` tinyint(1) unsigned NOT NULL DEFAULT '0', `recommend` int(8) unsigned DEFAULT NULL COMMENT '推荐方式', `tag` varchar(255) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- 表的结构 `nb_art_chapter` -- CREATE TABLE IF NOT EXISTS `nb_art_chapter` ( `chapterid` int(8) unsigned NOT NULL, `articleid` int(8) unsigned NOT NULL COMMENT '文章ID', `uid` int(8) unsigned NOT NULL COMMENT '提交人ID', `uname` varchar(20) NOT NULL COMMENT '提交人姓名', `postdate` int(11) unsigned NOT NULL COMMENT '提交时间', `lastdate` int(11) unsigned NOT NULL COMMENT '更新时间', `chaptername` varchar(20) NOT NULL COMMENT '章节名', `content` text COMMENT '内容', `order` int(11) NOT NULL COMMENT '排序', `size` int(11) NOT NULL COMMENT '字数', `saleprice` int(8) NOT NULL COMMENT '售价', `type` tinyint(1) NOT NULL COMMENT '0文章1卷', `recommend` int(8) NOT NULL COMMENT '推荐方式', `delete` tinyint(1) NOT NULL COMMENT '是否删除' ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- 表的结构 `nb_art_class` -- CREATE TABLE IF NOT EXISTS `nb_art_class` ( `classid` int(11) unsigned NOT NULL, `parentid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '上级分类ID', `classname` varchar(100) NOT NULL COMMENT '类别名', `classorder` int(10) unsigned DEFAULT '0' COMMENT '排序', `classtpl` varchar(255) DEFAULT NULL COMMENT '分类魔板', `contenttpl` varchar(255) DEFAULT NULL COMMENT '内容页模板' ) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=utf8; -- -- 转存表中的数据 `nb_art_class` -- INSERT INTO `nb_art_class` (`classid`, `parentid`, `classname`, `classorder`, `classtpl`, `contenttpl`) VALUES (1, 0, '小说首页', 0, NULL, NULL), (2, 0, '言情小说', 0, NULL, NULL), (3, 0, '玄幻小说', 0, NULL, NULL), (7, 2, '异界言情', 0, NULL, NULL), (6, 3, '异界大陆', 0, NULL, NULL), (8, 0, '武侠小说', 0, NULL, NULL), (11, 2, '子分类2', 0, '', ''), (17, 3, '穿越小说', 0, '', ''); -- -------------------------------------------------------- -- -- 表的结构 `nb_sys_menu` -- CREATE TABLE IF NOT EXISTS `nb_sys_menu` ( `menuid` int(11) unsigned NOT NULL, `title` varchar(100) NOT NULL COMMENT '标题', `link` varchar(200) NOT NULL COMMENT '链接', `reorder` int(11) DEFAULT '0' COMMENT '排序', `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '类别' ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='菜单'; -- -------------------------------------------------------- -- -- 表的结构 `nb_sys_users` -- CREATE TABLE IF NOT EXISTS `nb_sys_users` ( `uid` int(8) unsigned NOT NULL, `uname` varchar(20) NOT NULL, `pass` varchar(20) NOT NULL, `groupid` smallint(2) unsigned NOT NULL, `regdate` int(11) NOT NULL, `sex` tinyint(1) unsigned DEFAULT '0' COMMENT '1男2女', `email` varchar(20) DEFAULT NULL, `intro` text, `lastip` int(15) DEFAULT NULL, `logindate` int(11) DEFAULT NULL ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='用户资料'; -- -- 转存表中的数据 `nb_sys_users` -- INSERT INTO `nb_sys_users` (`uid`, `uname`, `pass`, `groupid`, `regdate`, `sex`, `email`, `intro`, `lastip`, `logindate`) VALUES (1, 'admin', '123', 0, 1448319780, 1, NULL, '管理员', NULL, NULL); -- -- Indexes for dumped tables -- -- -- Indexes for table `nb_art_artitle` -- ALTER TABLE `nb_art_artitle` ADD PRIMARY KEY (`artitleid`); -- -- Indexes for table `nb_art_chapter` -- ALTER TABLE `nb_art_chapter` ADD PRIMARY KEY (`chapterid`); -- -- Indexes for table `nb_art_class` -- ALTER TABLE `nb_art_class` ADD PRIMARY KEY (`classid`); -- -- Indexes for table `nb_sys_menu` -- ALTER TABLE `nb_sys_menu` ADD PRIMARY KEY (`menuid`); -- -- Indexes for table `nb_sys_users` -- ALTER TABLE `nb_sys_users` ADD PRIMARY KEY (`uid`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `nb_art_artitle` -- ALTER TABLE `nb_art_artitle` MODIFY `artitleid` int(8) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `nb_art_chapter` -- ALTER TABLE `nb_art_chapter` MODIFY `chapterid` int(8) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `nb_art_class` -- ALTER TABLE `nb_art_class` MODIFY `classid` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=21; -- -- AUTO_INCREMENT for table `nb_sys_menu` -- ALTER TABLE `nb_sys_menu` MODIFY `menuid` int(11) unsigned NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `nb_sys_users` -- ALTER TABLE `nb_sys_users` MODIFY `uid` int(8) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2; /*!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.980769
128
0.657266
dc1e4cdfe75f7775ae1530971e7a54d95ad3f2d7
267
rb
Ruby
lib/ocrsdk/abstract_entity.rb
elevatedrails/ocrsdk
bcfc5d41fcb0aad3a998095788e988ff32c5ac12
[ "MIT" ]
3
2015-06-09T10:34:17.000Z
2021-03-02T12:30:39.000Z
lib/ocrsdk/abstract_entity.rb
elevatedrails/ocrsdk
bcfc5d41fcb0aad3a998095788e988ff32c5ac12
[ "MIT" ]
null
null
null
lib/ocrsdk/abstract_entity.rb
elevatedrails/ocrsdk
bcfc5d41fcb0aad3a998095788e988ff32c5ac12
[ "MIT" ]
1
2015-04-14T08:06:22.000Z
2015-04-14T08:06:22.000Z
class OCRSDK::AbstractEntity def initialize @url = prepare_url OCRSDK.config.application_id, OCRSDK.config.password end private def prepare_url(app_id, pass) URI("http://#{CGI.escape app_id}:#{CGI.escape pass}@#{OCRSDK.config.service_url}") end end
22.25
86
0.734082
eeae298eeb69668a90fbe2ea55a53f3b258adbe6
150
sql
SQL
mariaDB4j/src/test/resources/ch/vorburger/mariadb4j/characterTest.sql
srbala/MariaDB4j
3f13618fd77cb2b2df217c065421dcb4ddd8a551
[ "Apache-2.0" ]
null
null
null
mariaDB4j/src/test/resources/ch/vorburger/mariadb4j/characterTest.sql
srbala/MariaDB4j
3f13618fd77cb2b2df217c065421dcb4ddd8a551
[ "Apache-2.0" ]
null
null
null
mariaDB4j/src/test/resources/ch/vorburger/mariadb4j/characterTest.sql
srbala/MariaDB4j
3f13618fd77cb2b2df217c065421dcb4ddd8a551
[ "Apache-2.0" ]
1
2020-02-20T16:06:03.000Z
2020-02-20T16:06:03.000Z
use junittest; CREATE TABLE test( id int PRIMARY KEY AUTO_INCREMENT, name varchar(255) NOT NULL ); INSERT INTO test (name) VALUES ('测试(字符集)');
15
43
0.706667
1703eb7d2d214c75be68e54744bc3f50614ef157
1,497
dart
Dart
lib/widgets/dialogs/loading_dialog.dart
kranfix/balance_flutter_app
2289a3bf25546bf96008a484acf70db38cce92c0
[ "MIT" ]
1
2022-01-30T19:46:47.000Z
2022-01-30T19:46:47.000Z
lib/widgets/dialogs/loading_dialog.dart
kranfix/balance_flutter_app
2289a3bf25546bf96008a484acf70db38cce92c0
[ "MIT" ]
null
null
null
lib/widgets/dialogs/loading_dialog.dart
kranfix/balance_flutter_app
2289a3bf25546bf96008a484acf70db38cce92c0
[ "MIT" ]
3
2022-01-30T01:43:21.000Z
2022-03-15T03:15:38.000Z
import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; //import 'package:nubank_flutter_challenge/utils/utils.dart'; import 'package:nubank_flutter_challenge/widgets/commons/commons.dart'; class LoadingDialog extends StatelessWidget { const LoadingDialog({Key? key}) : super(key: key); @override Widget build(BuildContext context) { final theme = Theme.of(context); return Dialog( shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(2)), ), child: Container( color: theme.scaffoldBackgroundColor, height: 250, width: 250, alignment: Alignment.center, child: const SizedBox( width: 60, height: 60, child: Loader(), ), ), ); } static Future<T?> show<T>( BuildContext context, { required AsyncValueGetter<T> futureBuilder, ValueSetter<T>? onSuccess, //AsyncValueConverter<dynamic, T>? onError, }) { futureBuilder().then( (value) { Navigator.pop(context); onSuccess?.call(value); }, //onError: (dynamic err) async { // Navigator.pop(context); // await onError?.call(err); //}, ); // ignore: use_build_context_synchronously return showDialog( context: context, useSafeArea: true, barrierDismissible: false, useRootNavigator: false, builder: (context) => const LoadingDialog(), ); } }
26.732143
71
0.628591
ae60c64df1373a35b43285e2476150af078308d8
14,840
cs
C#
Raindrops.UI.WebView.TestWPF/Browser.cs
TKKChina/Raindrops.UI.WebView
0dc25f3ef9bb37b1b105b2e313dea27dfb0dc7be
[ "Apache-2.0" ]
31
2021-03-21T05:21:44.000Z
2022-03-09T08:01:32.000Z
Raindrops.UI.WebView.TestWPF/Browser.cs
TKKChina/Raindrops.UI.WebView
0dc25f3ef9bb37b1b105b2e313dea27dfb0dc7be
[ "Apache-2.0" ]
1
2022-02-28T14:34:15.000Z
2022-03-23T04:37:33.000Z
Raindrops.UI.WebView.TestWPF/Browser.cs
TKKChina/Raindrops.UI.WebView
0dc25f3ef9bb37b1b105b2e313dea27dfb0dc7be
[ "Apache-2.0" ]
5
2021-05-21T09:49:53.000Z
2022-03-30T07:53:26.000Z
using Raindrops.UI.WebView.Miniblink; using Raindrops.UI.WebView.Miniblink.Event; using Raindrops.UI.WebView.Miniblink.PInvoke; using Raindrops.UI.WebView.Miniblink.PInvoke.Handle; using System; using System.Collections.Generic; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using System.Windows.Interop; using System.Runtime.InteropServices; using System.IO; using System.Diagnostics; using System.Globalization; using System.Threading; using System.Windows.Controls.Primitives; namespace Raindrops.UI.WebView.TestWPF { [TemplatePart(Name = "PART_ContentHost", Type = typeof(FrameworkElement))] public class Browser : FrameworkElement, IMiniblinkProxy, IDisposable { [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] static extern bool SetDllDirectory(string lpPathName); //Draw private WriteableBitmap _image; private Size _drawSize; static Browser() { SetDllDirectory(System.IO.Path.Combine(Directory.GetCurrentDirectory(), Environment.Is64BitProcess ? "x64\\" : "x86\\")); } private mbWebsocketHookCallbacks mbWebsocketHookCallbacks; private mbPaintBitUpdatedCallback mbPaintBitUpdatedCallback; public EventAdapter<LoadUrlBeginEventArgs, mbLoadUrlBeginCallback> LoadUrlBegin; public EventAdapter<TitleChangeEventArgs, mbTitleChangedCallback> TitleChanged; public EventAdapter<UrlChangeEventArgs, mbURLChangedCallback> UrlChanged; public EventAdapter<NewWindowEventArgs, mbCreateViewCallback> NewWindow; public EventAdapter<WebSocketWillConnectEventArgs, onWillConnect> WebSocketOnWillConnect; public EventAdapter<WebSocketConnectedEventArgs, onConnected> WebSocketOnConnect; public EventAdapter<WebSocketDataEventArgs, onReceive> WebSocketOnReceive; public EventAdapter<WebSocketDataEventArgs, onSend> WebSocketOnSend; public EventAdapter<WebSocketErrorEventArgs, onError> WebSocketOnError; public EventAdapter<LoadUrlEndEventArgs, mbLoadUrlEndCallback> LoadUrlEnd; public EventAdapter<DocumentReadyEventArgs, mbDocumentReadyCallback> DocumentReady; public Browser() { if (IsDesignMode) return; WebView = mbWebView.Create(); TitleChanged = new EventAdapter<TitleChangeEventArgs, mbTitleChangedCallback>(this, NativeMethods.mbOnTitleChanged); UrlChanged = new EventAdapter<UrlChangeEventArgs, mbURLChangedCallback>(this, NativeMethods.mbOnURLChanged); NewWindow = new EventAdapter<NewWindowEventArgs, mbCreateViewCallback>(this, NativeMethods.mbOnCreateView); LoadUrlBegin = new EventAdapter<LoadUrlBeginEventArgs, mbLoadUrlBeginCallback>(this, NativeMethods.mbOnLoadUrlBegin); WebSocketOnWillConnect = new EventAdapter<WebSocketWillConnectEventArgs, onWillConnect>(this, RegSocketOnWillConnect); WebSocketOnConnect = new EventAdapter<WebSocketConnectedEventArgs, onConnected>(this, RegSocketOnConnected); WebSocketOnReceive = new EventAdapter<WebSocketDataEventArgs, onReceive>(this, RegSocketOnReceive); WebSocketOnSend = new EventAdapter<WebSocketDataEventArgs, onSend>(this, RegSocketOnSend); WebSocketOnError = new EventAdapter<WebSocketErrorEventArgs, onError>(this, RegSocketOnError); LoadUrlEnd = new EventAdapter<LoadUrlEndEventArgs, mbLoadUrlEndCallback>(this, NativeMethods.mbOnLoadUrlEnd); DocumentReady = new EventAdapter<DocumentReadyEventArgs, mbDocumentReadyCallback>(this, NativeMethods.mbOnDocumentReady); mbPaintBitUpdatedCallback = new mbPaintBitUpdatedCallback(mbPaintBitUpdated); NativeMethods.mbOnPaintBitUpdated(WebView, mbPaintBitUpdatedCallback, IntPtr.Zero); ClipToBounds = true; Focusable = true; IsEnabled = true; InputMethod.SetIsInputMethodEnabled(this, true); InputMethod.SetIsInputMethodSuspended(this, false); InputMethod.Current.ImeState = InputMethodState.Off; } public void mbPaintBitUpdated(mbWebView webview, IntPtr param, IntPtr buffer, ref mbRect r, int width, int height) { int stride = width * 4; if (_image == null || _image.PixelWidth < width || _image.PixelHeight < height) { _image = new WriteableBitmap(width, height, 96, 96, PixelFormats.Pbgra32, BitmapPalettes.WebPaletteTransparent); InvalidateVisual(); } //计算更新区域 var rect = new Int32Rect(); rect.X = r.x >= width ? width - 1 : r.x; rect.Y = r.y >= height ? height - 1 : r.y; rect.Width = rect.X + r.w > width ? width - rect.X : r.w; rect.Height = rect.Y + r.h > height ? height - rect.Y : r.h; _image.WritePixels(rect, buffer, stride * (rect.Height + rect.Y), stride, r.x, r.y); _drawSize = new Size(width, height); } public mbWebView WebView { get; private set; } public bool Simulate { get; set; } public bool IsDesignMode { get { string processName = Process.GetCurrentProcess().ProcessName; return System.ComponentModel.DesignerProperties.GetIsInDesignMode(this) || processName.Contains("devenv") || processName.Contains("DesignToolsServer"); } } protected override void OnRender(DrawingContext dc) { if (IsDesignMode) { DrawString(dc, "Browser"); return; } if (_image != null) dc.DrawImage(_image, new Rect(0, 0, _image.Width, _image.Height)); } protected void DrawString(DrawingContext dc, string message) { FormattedText formattedText = new FormattedText( message, CultureInfo.CurrentUICulture, FlowDirection.LeftToRight, new Typeface("Arial"), 32, Brushes.Gray, 1); dc.DrawText(formattedText, new Point(0, 0)); } public bool RegSocketOnWillConnect(mbWebView mbWebView, onWillConnect onWillConnect, IntPtr param) { mbWebsocketHookCallbacks.onWillConnect = onWillConnect; return RegWebsocketHookCallbacks(mbWebView, ref mbWebsocketHookCallbacks, param); } public bool RegWebsocketHookCallbacks(mbWebView mbWebView, ref mbWebsocketHookCallbacks mbWebsocketHookCallbacks, IntPtr param) { if (mbWebsocketHookCallbacks.CanUse) NativeMethods.mbNetSetWebsocketCallback(mbWebView, ref mbWebsocketHookCallbacks, param); return true; } public bool RegSocketOnConnected(mbWebView mbWebView, onConnected onConnected, IntPtr param) { mbWebsocketHookCallbacks.onConnected = onConnected; return RegWebsocketHookCallbacks(mbWebView, ref mbWebsocketHookCallbacks, param); } public bool RegSocketOnReceive(mbWebView mbWebView, onReceive onReceive, IntPtr param) { mbWebsocketHookCallbacks.onReceive = onReceive; return RegWebsocketHookCallbacks(mbWebView, ref mbWebsocketHookCallbacks, param); ; } public bool RegSocketOnSend(mbWebView mbWebView, onSend onSend, IntPtr param) { mbWebsocketHookCallbacks.onSend = onSend; return RegWebsocketHookCallbacks(mbWebView, ref mbWebsocketHookCallbacks, param); } public bool RegSocketOnError(mbWebView mbWebView, onError onError, IntPtr param) { mbWebsocketHookCallbacks.onError = onError; return RegWebsocketHookCallbacks(mbWebView, ref mbWebsocketHookCallbacks, param); } protected override void OnGotFocus(RoutedEventArgs e) { if (WebView.HaveValue && !Simulate) { WebView.SetFocus(); } base.OnGotFocus(e); } protected override void OnLostFocus(RoutedEventArgs e) { if (WebView.HaveValue && !Simulate) { WebView.KillFocus(); } base.OnLostFocus(e); } protected override void OnMouseMove(MouseEventArgs e) { Point point = e.GetPosition(this); if (WebView.HaveValue && !Simulate) { WebView.FireMouseEvent((uint)mbMouseMsg.MB_MSG_MOUSEMOVE, (int)point.X, (int)point.Y, (uint)GetMouseFlags(e)); } base.OnMouseMove(e); } protected override void OnMouseDown(MouseButtonEventArgs e) { Focus(); Point point = e.GetPosition(this); if (WebView.HaveValue && !Simulate) WebView.FireMouseEvent((uint)GetmbMouseMsg(e), (int)point.X, (int)point.Y, (uint)GetMouseFlags(e)); base.OnMouseDown(e); } protected override void OnMouseUp(MouseButtonEventArgs e) { Point point = e.GetPosition(this); if (WebView.HaveValue && !Simulate) WebView.FireMouseEvent((uint)GetmbMouseMsg(e), (int)point.X, (int)point.Y, (uint)GetMouseFlags(e)); base.OnMouseDown(e); } protected override void OnMouseWheel(MouseWheelEventArgs e) { if (WebView.HaveValue && !Simulate) { Point point = e.GetPosition(this); WebView.FireMouseWheelEvent((int)point.X, (int)point.Y, e.Delta, (uint)GetMouseFlags(e)); } base.OnMouseWheel(e); } protected override void OnKeyDown(KeyEventArgs e) { if (WebView.HaveValue && !Simulate) { WebView.FireKeyDownEvent((uint)KeyInterop.VirtualKeyFromKey(e.Key), 0, false); } base.OnKeyDown(e); } protected override void OnKeyUp(KeyEventArgs e) { if (WebView.HaveValue && !Simulate) { WebView.FireKeyUpEvent((uint)KeyInterop.VirtualKeyFromKey(e.Key), 0, false); } base.OnKeyUp(e); } protected override void OnTextInput(TextCompositionEventArgs e) { if (WebView.HaveValue && !Simulate) { if (!string.IsNullOrEmpty(e.Text)) foreach (char wchar in e.Text) WebView.FireKeyPressEvent((uint)wchar, 0, false); } base.OnTextInput(e); } private static mbMouseMsg GetmbMouseMsg(MouseButtonEventArgs e) { mbMouseMsg flags = 0; switch (e.ChangedButton) { case MouseButton.Left: flags |= e.LeftButton == MouseButtonState.Pressed ? mbMouseMsg.MB_MSG_LBUTTONDOWN : mbMouseMsg.MB_MSG_LBUTTONUP; break; case MouseButton.Right: flags |= e.LeftButton == MouseButtonState.Released ? mbMouseMsg.MB_MSG_RBUTTONDOWN : mbMouseMsg.MB_MSG_RBUTTONUP; break; case MouseButton.Middle: flags |= e.LeftButton == MouseButtonState.Released ? mbMouseMsg.MB_MSG_MBUTTONDOWN : mbMouseMsg.MB_MSG_MBUTTONUP; break; } return flags; } private static mbMouseFlags GetMouseFlags(MouseEventArgs e) { mbMouseFlags flags = 0; if (e.LeftButton == MouseButtonState.Pressed) { flags |= mbMouseFlags.MB_LBUTTON; } if (e.RightButton == MouseButtonState.Pressed) { flags |= mbMouseFlags.MB_RBUTTON; } if (e.MiddleButton == MouseButtonState.Pressed) { flags |= mbMouseFlags.MB_MBUTTON; } return flags; } private Window _window; private HwndSource _hwndSource; private HwndSourceHook _hwndSourceHook; protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo) { if (WebView.HaveValue) { int width = (int)sizeInfo.NewSize.Width; int height = (int)sizeInfo.NewSize.Height; _window = Window.GetWindow(this); if (_hwndSource == null) { _hwndSource = HwndSource.FromHwnd(new WindowInteropHelper(_window).Handle); Debug.WriteLine(Thread.CurrentThread.ManagedThreadId); Debug.WriteLine(_hwndSource.Handle); _hwndSourceHook = new HwndSourceHook(HwndSourceHook); _hwndSource.AddHook(HwndSourceHook); WebView.SetHandle(_hwndSource.Handle); } Point location = TransformToVisual(_window).Transform(new Point(0, 0)); WebView.SetHandleOffset((int)location.X, (int)location.Y); WebView.Resize(width, height); if (_image != null) { if (_drawSize.Width <= 100 || _drawSize.Height <= 100 || sizeInfo.NewSize.Width <= 100 || sizeInfo.NewSize.Height <= 100) { _drawSize = sizeInfo.NewSize; } else { Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); while (_drawSize != sizeInfo.NewSize && stopwatch.ElapsedMilliseconds < 500) { WebView.Wake(); } stopwatch.Stop(); } } } base.OnRenderSizeChanged(sizeInfo); } private IntPtr HwndSourceHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { IntPtr r = IntPtr.Zero; if (WebView.HaveValue && WebView.FireWindowsMessage(hwnd, (uint)msg, wParam, lParam, ref r)) { handled = true; return r; } return IntPtr.Zero; } public void Dispose() { if (_hwndSource != null) { _hwndSource.Dispose(); } WebView.SetHandle(IntPtr.Zero); WebView.Destroy(); } } }
44.298507
167
0.609097
30d1f453c57ae99f01d888ba1967a8707ef57140
3,191
php
PHP
resources/views/student/result/view_result.blade.php
Anskhilji/quiz-app
25a2141ad73ff407403510c5a20d87f6cef0ed02
[ "MIT" ]
null
null
null
resources/views/student/result/view_result.blade.php
Anskhilji/quiz-app
25a2141ad73ff407403510c5a20d87f6cef0ed02
[ "MIT" ]
null
null
null
resources/views/student/result/view_result.blade.php
Anskhilji/quiz-app
25a2141ad73ff407403510c5a20d87f6cef0ed02
[ "MIT" ]
null
null
null
@extends('student.layouts.app') @section('content') <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <div class="container-full"> <!-- Main content --> <section class="content"> <div class="row"> <div class="col-12"> <div class="box"> <div class="box-header with-border"> <h3 class="box-title">Result</h3> </div> <!-- /.box-header --> <div class="box-body"> <div class="table-responsive"> <table class="table table-bordered table-striped example1"> <thead> <tr> <th>ID</th> <th>Teacher Name</th> <th>Student Name</th> <th>Subject</th> <th>Obtained Marks</th> <th>Total Marks</th> </tr> </thead> <tbody> @php($i=1) @foreach($attempted as $attempt) <?php $an = $attempt->result_announce; $is_show = false; if($an!=""){ if(time() >= strtotime($an)){ $is_show = true; } } ?> @if($is_show) <tr> <td>{{ $i++ }}</td> <td>{{ $attempt->teacher_name }}</td> <td>{{ $attempt->name }}</td> <td>{{ $attempt->subject_name }}</td> <td>{{ $attempt->obtained_marks }}</td> <td>{{ $attempt->total_marks }}</td> </tr> @endif @endforeach </table> </div> </div> <!-- /.box-body --> </div> </div> </div> </section> <!-- /.content --> </div> </div> <!-- /.content-wrapper --> @endsection
46.926471
96
0.230962
b0eeb532ab3970c759bf5a5a0aaf1104ef8ea490
641
h
C
src/PacketBuffer.h
ddaeschler/audio-reflector
9f0f42ba16509c4b4bdeb73ad22a0ff250a06090
[ "MIT" ]
2
2020-05-25T05:15:17.000Z
2022-02-03T19:55:23.000Z
src/PacketBuffer.h
ddaeschler/audio-reflector
9f0f42ba16509c4b4bdeb73ad22a0ff250a06090
[ "MIT" ]
null
null
null
src/PacketBuffer.h
ddaeschler/audio-reflector
9f0f42ba16509c4b4bdeb73ad22a0ff250a06090
[ "MIT" ]
1
2018-10-03T23:30:56.000Z
2018-10-03T23:30:56.000Z
/* * PacketBuffer.h * * Created on: May 25, 2013 * Author: ddaeschler */ #ifndef PACKETBUFFER_H_ #define PACKETBUFFER_H_ #include "ARTypes.h" #include <boost/shared_ptr.hpp> #include <boost/noncopyable.hpp> namespace audioreflector { /** * Buffer that holds outbound packet data */ struct packet_buffer : public boost::noncopyable { public: static const int BUF_SZ = MTU; static const int BUF_MAX_DATA = MTU - HEADER_SZ; char contents[BUF_SZ]; public: packet_buffer() { } ~packet_buffer() { } }; typedef boost::shared_ptr<packet_buffer> packet_buffer_ptr; } #endif /* PACKETBUFFER_H_ */
15.634146
60
0.687988
93f3c1dc910783f66cf99d53d5fb8cc8cc09bbe9
1,245
cs
C#
Old Code/Programming Basics/Old Exams/04.Hospital/Program.cs
Koceto/SoftUni
c61d8a97fcc19e3b69e5d0d575293c9d2a851a2d
[ "MIT" ]
2
2018-11-30T10:33:26.000Z
2019-04-27T15:12:53.000Z
Old Code/Programming Basics/Old Exams/04.Hospital/Program.cs
Koceto/SoftUni
c61d8a97fcc19e3b69e5d0d575293c9d2a851a2d
[ "MIT" ]
null
null
null
Old Code/Programming Basics/Old Exams/04.Hospital/Program.cs
Koceto/SoftUni
c61d8a97fcc19e3b69e5d0d575293c9d2a851a2d
[ "MIT" ]
null
null
null
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _04.Hospital { class Program { static void Main(string[] args) { int calculationsDuration = int.Parse(Console.ReadLine()); int doctors = 7; int patientsSendedToOtherHospital = 0; int patientsChecked = 0; for (int days = 1; days <= calculationsDuration; days++) { int patientsPerDay = int.Parse(Console.ReadLine()); if (days % 3 == 0 && patientsChecked < patientsSendedToOtherHospital) { doctors++; } patientsSendedToOtherHospital = patientsPerDay <= doctors ? patientsSendedToOtherHospital += 0 : patientsSendedToOtherHospital += patientsPerDay - doctors; patientsChecked = patientsPerDay <= doctors ? patientsChecked += patientsPerDay : patientsChecked += doctors; } Console.WriteLine("Treated patients: {0}.", patientsChecked); Console.WriteLine("Untreated patients: {0}.", patientsSendedToOtherHospital); } } }
33.648649
112
0.582329
4d3733be6f31d654b93e2b5628a14f7e12916c33
1,567
js
JavaScript
Models/CustomersModel.js
PJDevUK/Ground-Zero
2e59379131e964305a74a42e59c8d74cb53fa019
[ "MIT" ]
null
null
null
Models/CustomersModel.js
PJDevUK/Ground-Zero
2e59379131e964305a74a42e59c8d74cb53fa019
[ "MIT" ]
null
null
null
Models/CustomersModel.js
PJDevUK/Ground-Zero
2e59379131e964305a74a42e59c8d74cb53fa019
[ "MIT" ]
1
2018-06-29T11:05:57.000Z
2018-06-29T11:05:57.000Z
import mongoose from 'mongoose' import dataTables from 'mongoose-datatables' import Email from '../Controllers/emailValidator' const Schema = mongoose.Schema /** * @description Customers Domain Model Mongoose Schema * @param Email * Class which is located in emailValidator.js within the Controllers Folder * this class ensures only true emails are stored to the database. * @param Invoice_AdrsID * Refers to an Address document stored within (Addresses Collection) within the database * which has been choosen as the customers default mailing address for * invoicing and purchasing purposes. */ const customersSchema = new Schema({ cusID: { type: Number, min: 10000000000, max: 99999999999, required: true }, invoiceAdrsID: { type: Number, min: 10000000000, max: 99999999999, required: true }, companyName: { type: String, max: 50 }, title: { type: String, max: 10, required: true }, firstName: { type: String, max: 25, required: true }, surname: { type: String, max: 25, required: true }, mobileContact: { type: Number }, landlineContact: { type: Number }, email: { type: Email, required: true }, loginPassword: { type: String, required: true }, postZipCode: { type: String, required: true }, mobileNotifications: { type: String, required: true } }, { timestamps: { timestamps: true } }) // Allows Datatables to access Customers data customersSchema.plugin(dataTables) // Creates the Mongoose model const Customers = mongoose.model('Customers', customersSchema) // This exports the model. export default Customers
35.613636
90
0.729419
c4c386ed6ec04217de9acf9177b5619084e84b1f
1,612
cpp
C++
BOJ_solve/16583.cpp
python-programmer1512/Code_of_gunwookim
e72e6724fb9ee6ccf2e1064583956fa954ba0282
[ "MIT" ]
4
2021-01-27T11:51:30.000Z
2021-01-30T17:02:55.000Z
BOJ_solve/16583.cpp
python-programmer1512/Code_of_gunwookim
e72e6724fb9ee6ccf2e1064583956fa954ba0282
[ "MIT" ]
null
null
null
BOJ_solve/16583.cpp
python-programmer1512/Code_of_gunwookim
e72e6724fb9ee6ccf2e1064583956fa954ba0282
[ "MIT" ]
5
2021-01-27T11:46:12.000Z
2021-05-06T05:37:47.000Z
#include <bits/stdc++.h> #define x first #define y second #define pb push_back #define all(v) v.begin(),v.end() #pragma gcc optimize("O3") #pragma gcc optimize("Ofast") #pragma gcc optimize("unroll-loops") using namespace std; const int INF = 1e9; const int TMX = 1 << 18; const long long llINF = 5e18; const long long mod = 1e9+7; const long long hmod1 = 1e9+409; const long long hmod2 = 1e9+433; const long long base = 257; typedef long long ll; typedef long double ld; typedef pair <int,int> pi; typedef pair <ll,ll> pl; typedef vector <int> vec; typedef vector <pi> vecpi; typedef long long ll; int n,m,c[200005]; int p[200005],o[200005],g; vec v[200005]; struct Ans {int x,y,z;}; vector <Ans> ans; int Find(int x) {return (p[x]^x ? p[x] = Find(p[x]) : x);} int dfs(int x,int pr) { int st = 0; c[x] = 1; for(int i : v[x]) { if(i == pr) continue; int tmp = dfs(i,x); if(tmp) { if(st) ans.pb({o[st],o[x],o[i]}), st = 0; else st = i; } } if(st&&pr != -1) { ans.pb({o[st],o[x],o[pr]}); return 0; } return 1; } int main() { ios_base::sync_with_stdio(false), cin.tie(0); cin >> n >> m; g = n; for(int i = 1;i <= n;i++) p[i] = o[i] = i; for(int i = 1;i <= m;i++) { int x,y; cin >> x >> y; if(Find(x)^Find(y)) v[x].pb(y), v[y].pb(x), p[Find(y)] = Find(x); else v[x].pb(++g), v[g].pb(x), o[g] = y; } for(int i = 1;i <= g;i++) { if(!c[i]) dfs(i,-1); } cout << ans.size() << '\n'; for(Ans i : ans) cout << i.x << ' ' << i.y << ' ' << i.z << '\n'; }
24.424242
73
0.519231
1be1ff49dfc5883412ca8198af8b86deb52850ff
294
php
PHP
resources/views/layouts/partials/_flash_message.blade.php
alons182/suenosdevida
ac2ca267ebb460608b8ac73e3cc929d98205c1ec
[ "MIT" ]
null
null
null
resources/views/layouts/partials/_flash_message.blade.php
alons182/suenosdevida
ac2ca267ebb460608b8ac73e3cc929d98205c1ec
[ "MIT" ]
null
null
null
resources/views/layouts/partials/_flash_message.blade.php
alons182/suenosdevida
ac2ca267ebb460608b8ac73e3cc929d98205c1ec
[ "MIT" ]
null
null
null
@if (Session::has('flash_message')) @if (Session::has('flash_type')) <div class="flash-message alert {!! Session::get('flash_type') !!}"> @else <div class="flash-message alert alert-info "> @endif <p>{!! Session::get('flash_message') !!}</p> </div> @endif
18.375
68
0.571429