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
sequencelengths 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
sequencelengths 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
sequencelengths 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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0ecb577a1af149e6c6549c2dd354934e917c9ccc | 2,891 | h | C | include/usb_pd_dpm.h | IssacAlegre/chrome-ec | 19c3731dfd5250bfadaa90940f108476444d49b1 | [
"BSD-3-Clause"
] | null | null | null | include/usb_pd_dpm.h | IssacAlegre/chrome-ec | 19c3731dfd5250bfadaa90940f108476444d49b1 | [
"BSD-3-Clause"
] | null | null | null | include/usb_pd_dpm.h | IssacAlegre/chrome-ec | 19c3731dfd5250bfadaa90940f108476444d49b1 | [
"BSD-3-Clause"
] | null | null | null | /* Copyright 2020 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*
* Device Policy Manager implementation
* Refer to USB PD 3.0 spec, version 2.0, sections 8.2 and 8.3
*/
#ifndef __CROS_EC_USB_DPM_H
#define __CROS_EC_USB_DPM_H
#include "ec_commands.h"
#include "usb_pd_tcpm.h"
/*
* Initializes DPM state for a port.
*
* @param port USB-C port number
*/
void dpm_init(int port);
/*
* Informs the DPM that Exit Mode request is received
*
* @param port USB-C port number
*/
void dpm_set_mode_exit_request(int port);
/*
* Informs the DPM that a VDM ACK was received.
*
* @param port USB-C port number
* @param type Transmit type (SOP, SOP') for received ACK
* @param vdo_count The number of VDOs in vdm; must be at least 1
* @param vdm The VDM payload of the ACK
*/
void dpm_vdm_acked(int port, enum tcpm_transmit_type type, int vdo_count,
uint32_t *vdm);
/*
* Informs the DPM that a VDM NAK was received. Also applies when a VDM request
* received a Not Supported response or timed out waiting for a response.
*
* @param port USB-C port number
* @param type Transmit type (SOP, SOP') for request
* @param svid The SVID of the request
* @param vdm_cmd The VDM command of the request
*/
void dpm_vdm_naked(int port, enum tcpm_transmit_type type, uint16_t svid,
uint8_t vdm_cmd);
/*
* Drives the Policy Engine through entry/exit mode process
*
* @param port USB-C port number
*/
void dpm_run(int port);
/*
* Determines the current allocation for the connection, past the basic
* CONFIG_USB_PD_PULLUP value set by the TC (generally 1.5 A)
*
* @param port USB-C port number
* @param vsafe5v_pdo Copy of first Sink_Capability PDO, which should
* represent the vSafe5V fixed PDO
*/
void dpm_evaluate_sink_fixed_pdo(int port, uint32_t vsafe5v_pdo);
/*
* Registers port as a non-PD sink, so that can be taken into account when
* allocating current.
*
* @param port USB-C port number
*/
void dpm_add_non_pd_sink(int port);
/*
* Remove this port as a sink, and reallocate maximum current as needed.
*
* @param port USB-C port number
*/
void dpm_remove_sink(int port);
/*
* Remove this port as a source, and reallocate reserved FRS maximum current
* as needed.
*
* @param port USB-C port number
*/
void dpm_remove_source(int port);
/*
* Return the appropriate Source Capability PDO to offer this port
*
* @param src_pdo Will point to appropriate PDO to offer
* @param port USB-C port number
* @return Number of PDOs
*/
int dpm_get_source_pdo(const uint32_t **src_pdo, const int port);
/*
* Report offered source current for this port
*
* @param port USB-C port number
* @return Current offered, in mA
*/
int dpm_get_source_current(const int port);
#endif /* __CROS_EC_USB_DPM_H */
| 25.8125 | 79 | 0.717399 |
b1a575c8d5c5eed81e615134536a5f6ee1762929 | 234 | h | C | demo_XTFMDB/DisplayCell.h | Akateason/XTFMDB | 75f57f97c69a9d98edba547e849bc0bebbd007e1 | [
"MIT"
] | 29 | 2017-05-05T01:09:52.000Z | 2020-07-05T11:17:39.000Z | demo_XTFMDB/DisplayCell.h | Akateason/XTFMDB | 75f57f97c69a9d98edba547e849bc0bebbd007e1 | [
"MIT"
] | 6 | 2017-05-05T01:35:54.000Z | 2019-01-08T03:21:02.000Z | demo_XTFMDB/DisplayCell.h | Akateason/XTFMDB | 75f57f97c69a9d98edba547e849bc0bebbd007e1 | [
"MIT"
] | 6 | 2017-05-10T07:03:28.000Z | 2020-07-05T11:17:47.000Z | //
// DisplayCell.h
// demo_XTFMDB
//
// Created by teason23 on 2017/5/4.
// Copyright © 2017年 teaason. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface DisplayCell : UITableViewCell
- (void)configure:(id)model;
@end
| 15.6 | 51 | 0.688034 |
6b2426805982684b8462529019f1a5746ca724bb | 390 | sql | SQL | sql/immutable/01-address.sql | warncke/immutable-commerce | 18adb9c5489265bbb4bd0ce46172048fefe9578e | [
"MIT"
] | null | null | null | sql/immutable/01-address.sql | warncke/immutable-commerce | 18adb9c5489265bbb4bd0ce46172048fefe9578e | [
"MIT"
] | null | null | null | sql/immutable/01-address.sql | warncke/immutable-commerce | 18adb9c5489265bbb4bd0ce46172048fefe9578e | [
"MIT"
] | null | null | null | CREATE TABLE `address` (
`addressId` binary(16) NOT NULL,
`accountId` binary(16) DEFAULT NULL,
`sessionId` binary(16) NOT NULL,
`addressData` mediumtext NOT NULL,
`addressType` varchar(255) DEFAULT NULL,
`addressCreateTime` datetime(6) NOT NULL,
PRIMARY KEY (`addressId`),
KEY `accountId` (`accountId`),
KEY `sessionId` (`sessionId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
| 32.5 | 43 | 0.712821 |
185385b42c4069985b3b5d0627dc0503694b1f41 | 407 | rb | Ruby | spec/rubyspec/core/numeric/odd_spec.rb | roblander/opal | 39f78566949ca42b02de39a7948bf4ddf5a07df5 | [
"MIT"
] | 1 | 2015-11-05T20:33:53.000Z | 2015-11-05T20:33:53.000Z | spec/rubyspec/core/numeric/odd_spec.rb | roblander/opal | 39f78566949ca42b02de39a7948bf4ddf5a07df5 | [
"MIT"
] | null | null | null | spec/rubyspec/core/numeric/odd_spec.rb | roblander/opal | 39f78566949ca42b02de39a7948bf4ddf5a07df5 | [
"MIT"
] | null | null | null | describe "Numeric#odd?" do
it "is false for zero" do
0.odd?.should be_false
end
it "is false for even positive Fixnums" do
4.odd?.should be_false
end
it "is false for even negative Fixnums" do
(-4).odd?.should be_false
end
it "is true for odd positive Fixnums" do
5.odd?.should be_true
end
it "is true for odd negative Fixnums" do
(-5).odd?.should be_true
end
end | 19.380952 | 44 | 0.668305 |
1f6893ebd4e4224a5dcf6d0a18feb4dc2b779eb8 | 7,813 | css | CSS | szgd/szgd-wechat-web/target/szgd-wechat-web/resources/template/cms/thkjy/css/style.css | huachao0410/myJavaDemo | 99ee3951e677c12d616f596cc3fa6e6d87221e84 | [
"Apache-2.0"
] | null | null | null | szgd/szgd-wechat-web/target/szgd-wechat-web/resources/template/cms/thkjy/css/style.css | huachao0410/myJavaDemo | 99ee3951e677c12d616f596cc3fa6e6d87221e84 | [
"Apache-2.0"
] | null | null | null | szgd/szgd-wechat-web/target/szgd-wechat-web/resources/template/cms/thkjy/css/style.css | huachao0410/myJavaDemo | 99ee3951e677c12d616f596cc3fa6e6d87221e84 | [
"Apache-2.0"
] | null | null | null | /*header*/
.header_outside{width: 100%; height: 50px;}
.header{position: fixed;top: 0; left: 0; z-index: 99; width: 100%; height: 50px; background: #12b7f5;}
.header .menu_icon_open{display: block; position: absolute;left: 0; top: 0; z-index: 22; width: 50px;height: 50px; text-align: center;line-height: 40px; color: #fff; font-size: 28px}
.header .menu_icon_close{display: none; position: absolute;left: 0; top: 0; z-index: 22; width: 50px;height: 50px; text-align: center;line-height: 40px; color: #fff; font-size: 28px}
.blank_bg{display: none; position: fixed; top: 50px; left: 0; z-index: 999; width: 100%; height: 100%; background: rgba(0,0,0,0.5);}
.menu{display: none;position: fixed;top: 50px; left: 0; z-index: 999; width: 100%; min-height: 240px; max-height: 80%; overflow-y: auto; padding-top: 20px; padding-bottom: 30px; background: #354045;}
.menu a{display: block; width: 100%; height: 50px; line-height: 50px; font-size: 15px; color: #fff; padding-left: 30px; box-sizing: border-box;}
.menu a:hover{color: #869fb1; background: #131e26;}
.show{display: block;}
.hide{display: none;}
.search_a{margin: 11px 10px 0 10px; height: 28px; background: #fff; line-height: 28px;}
.search_a a{display: block; font-size: 14px; color: #666; text-align: center;}
.header .title{text-align: center;line-height: 50px;font-size: 16px;color: #fff;}
.header .login_a{display: block; position: absolute;right: 0; top: 0; z-index: 22; width: 50px;height: 50px; text-align: center;line-height: 50px; color: #fff; font-size: 28px}
.header .inedx_a{display: block; position: absolute;right: 0; top: 0; z-index: 22; width: 50px;height: 50px; text-align: center;line-height: 40px; color: #fff; font-size: 28px}
/*菜单展开收起*/
.treebox{ width: 100%;}
.tree_menu{ overflow: hidden;}
/*第一层*/
.tree_menu li.level1>a{
display:block;
height: 45px;
line-height: 45px;
color: #fff;
padding-left: 30px;
font-size: 14px;
position: relative;
}
/*============修饰图标*/
.ico{ width: 20px; height: 20px; display:block; position: absolute; left: 20px; top: 10px; background-repeat: no-repeat; background-image: url(images/ico1.png); }
/*============小箭头*/
.level1 i{ width: 20px; height: 20px; background-image:url(../images/arrow_down.png); background-repeat: no-repeat; display: block; position: absolute; right: 20px; top: 16px; }
/*.level1 i.menu_arrow{background-image:url(../images/arrow_d.png.png); }*/
.tree_menu li.on i.menu_arrow{ background-image:url(../images/arrow_u.png);}
/*第二层*/
.tree_menu li ul{ overflow: hidden;padding-bottom: 10px; }
.tree_menu li ul.level2{ display: none;background: #131e26; }
.tree_menu li.on .level2{display: block;}
.tree_menu li.on .tree_menu_a{background: #131e26; }
.tree_menu li ul.level2 li a{
display: block;
height: 45px;padding-left: 40px !important;
line-height: 45px;
color: #fff;
text-indent: 60px;
/*border-bottom: 1px solid #ddd; */
font-size: 14px;
}
/*首页----------------------------------------*/
/*新闻*/
.index_news{background: #fff;}
.index_news .index_news_ul li{height: 70px;padding: 25px 20px; overflow: hidden;border-bottom: #dcdcdc 1px dashed;}
.index_news .index_news_ul li:last-child{border-bottom: none;}
.index_news .news_div{position: relative;}
.index_news .news_div a{display: block;}
.index_news .news_div .index_news_img{position: absolute;right: 0; top: 0; z-index: 1; width: 90px; height: 70px;}
.index_news .news_div .index_news_title{height: 44px; margin-bottom: 8px; line-height: 22px;overflow: hidden;
padding-right: 110px; font-size: 15px; color: #333;display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2; }
.index_news .news_div a:hover .index_news_title{color: #12b7f5;}
.index_news .news_div .index_news_content{ height: 44px; margin-bottom: 5px; line-height: 22px;
padding-right: 80px; font-size: 13px; color: #666;
display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2; overflow: hidden;}
.index_news .news_time{display: block;width: 80px;height: 24px;line-height: 24px;overflow: hidden; font-size: 12px; color: #999;}
.index_news .news_item{font-size: 12px; color: #999; line-height: 24px;}
.index_news .news_item i{font-size: 16px; float: left;}
/*搜索页---------------------------------------*/
.weui-search-bar:after, .weui-search-bar:before{border-bottom: none !important; border-top: none;}
/*热词*/
.hot_title{display: block; height: 20px; padding-left: 10px; line-height: 20px; font-size: 14px; color: #222; border-left: #3ea2f9 3px solid;}
.hot_word{overflow: hidden; margin-top: 15px;}
.hot_word a{display: block;float: left; width: auto;height: 26px; margin: 0 5px 10px 5px; line-height: 26px; padding: 0 15px;font-size: 12px; background: #f5f5f5; color: #333;}
.hot_word a:hover{color: #ff0000;}
/*首页-------------*/
.content_nav{overflow: hidden; padding: 10px;}
.content_nav span{float: left;display: block;width: 5px;height: 16px; margin-top: 5px; border-radius: 2px;background: #5a98de;}
.content_nav b{padding-left: 5px; font-size: 14px;color: #999; font-weight: normal;}
.content_list li{float: left; width: 25%; text-align: center; padding: 0 10px; margin-bottom: 15px;box-sizing: border-box;}
.content_list li a{display: block;}
.content_list li img{width: 25px;}
.content_list li span{display: block;font-size: 14px; color: #222; }
/*新闻详情页---------------------*/
.news_title{font-size: 18px;padding: 20px 15px;}
.news_info{padding: 0 15px 15px; font-size: 12px;color: #999;}
.news_content{font-size: 14px; line-height: 22px; padding: 0 15px 20px;}
.news_content img{max-width: 100%; margin: 10px 0;}
.news_bottom{padding: 0 15px 10px;}
.news_bottom .news_bottom_a{font-size: 14px;color: #5a98de;}
.collection{font-size: 20px; padding: 0 5px; margin-left: 15px;}
/*点赞*/
.praise_a{display: block;width: auto;padding: 0 13px;height: 30px;
font-size: 14px;color: #999;line-height: 32px;
border: #dcdcdc 1px solid;border-radius: 4px;}
.praise_a i{float: left;display: block; margin-top: -2px; margin-right: 5px; font-size: 16px;}
.praise_a.on{color: #12b7f5;border: #12b7f5 1px solid;}
/*评论*/
.comment_t{position: relative; padding: 10px 0 10px 20px;font-size: 18px;}
.comment_t:before{position: absolute;content: ''; left: 0;top: 24px; z-index: 1; width: 100%;height: 1px;
border-bottom: #dcdcdc 1px solid;}
.comment_t .comment_b{position: relative; z-index: 33;background: #fff;display: block;float: left;padding: 0 10px 0 20px;font-weight: bold;}
/*我要评论*/
.comment_edit_div{position: relative; padding-left: 70px; padding-right: 15px;}
.comment_user_img{position: absolute;left: 15px;top: 0; z-index: 1;width: 40px;height: 40px;border-radius: 100%;overflow: hidden;}
.comment_user_img img{width: 100%;}
.comment_edit_div .comment_input_text{width: 100%;height: 55px;border-radius: 6px;border: #dcdcdc 1px solid; padding: 10px;box-sizing: border-box;}
.comment_edit_div .comment_btn_div{display: none; padding: 20px 0; text-align: right;}
.comment_edit_div .comment_btn_div .comment_cancel{font-size: 14px;color: #666; margin-right: 15px;}
.comment_edit_div .comment_btn_div .comment_submit{padding: 3px 15px; font-size: 14px;border: #12b7f5 1px solid;color: #12b7f5;border-radius: 2px;background: none; font-family: "微软雅黑";}
.comment_edit_div .comment_btn_div .comment_submit[disabled="disabled"]{border: #dcdcdc 1px solid;color: #999;}
/*评论列表*/
.comment_list{padding: 10px 15px 10px 0;}
.comment_list li{position: relative; padding: 0 0 20px 70px;}
.comment_list li .comment_username{display: block;margin-bottom: 5px; font-size: 14px;color: #333;}
.comment_list li .comment_n{display: block;font-size: 14px;color: #333; line-height: 22px;}
.comment_list li .comment_operation{overflow: hidden; margin-top: 10px; font-size: 12px;color: #999;}
.comment_operation .comment_praise.on{color: #12b7f5;}
.comment_operation .comment_step.on{color: #12b7f5;}
| 58.30597 | 199 | 0.716242 |
cb315730bf316573ab4eedc9ef121b533fd92afb | 1,036 | go | Go | amass/sources/arquivo.go | mikailtunc/Amass | fffcca4461d95cc95a4f2221e22239acb7d03e9a | [
"Apache-2.0"
] | null | null | null | amass/sources/arquivo.go | mikailtunc/Amass | fffcca4461d95cc95a4f2221e22239acb7d03e9a | [
"Apache-2.0"
] | null | null | null | amass/sources/arquivo.go | mikailtunc/Amass | fffcca4461d95cc95a4f2221e22239acb7d03e9a | [
"Apache-2.0"
] | 1 | 2021-08-14T18:04:48.000Z | 2021-08-14T18:04:48.000Z | // Copyright 2017 Jeff Foley. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
package sources
import "github.com/OWASP/Amass/amass/core"
// Arquivo is data source object type that implements the DataSource interface.
type Arquivo struct {
BaseDataSource
baseURL string
}
// NewArquivo returns an initialized Arquivo as a DataSource.
func NewArquivo(srv core.AmassService) DataSource {
a := &Arquivo{baseURL: "http://arquivo.pt/wayback"}
a.BaseDataSource = *NewBaseDataSource(srv, core.ARCHIVE, "Arquivo Arc")
return a
}
// Query returns the subdomain names discovered when querying this data source.
func (a *Arquivo) Query(domain, sub string) []string {
if sub == "" {
return []string{}
}
names, err := a.crawl(a.baseURL, domain, sub)
if err != nil {
a.Service.Config().Log.Printf("%v", err)
}
return names
}
// Subdomains returns true when the data source can query for subdomain names.
func (a *Arquivo) Subdomains() bool {
return true
}
| 26.564103 | 97 | 0.73166 |
a18ee9fb9bcfa03b6cf0b9303e64f19e9e76b324 | 327 | sql | SQL | app/SQL/ajuste_salida_tipo.sql | abimael93/zapateria | d874e68d7b2e7b8c874cb4d7fff204ef515c9220 | [
"MIT"
] | null | null | null | app/SQL/ajuste_salida_tipo.sql | abimael93/zapateria | d874e68d7b2e7b8c874cb4d7fff204ef515c9220 | [
"MIT"
] | null | null | null | app/SQL/ajuste_salida_tipo.sql | abimael93/zapateria | d874e68d7b2e7b8c874cb4d7fff204ef515c9220 | [
"MIT"
] | null | null | null | INSERT INTO `zapateria`.`ajuste_salida_tipo` (`nombre`, `exclusivo_sistema`, `descripcion`) VALUES ('Devolución', 'N', 'Producto devuelto hacia el proveedor');
INSERT INTO `zapateria`.`ajuste_salida_tipo` (`nombre`, `exclusivo_sistema`, `descripcion`) VALUES ('Producción', 'N', 'Producto necesario para algún proceso/tarea');
| 109 | 166 | 0.752294 |
4a527b9ef6a99301c532b1a519ba2e16d92ad2fe | 633 | js | JavaScript | src/Header/Header.js | c-jordi/Antwork | e35b4b0ffd2063fbd2f6e29e17872cf3e90227fa | [
"MIT"
] | 1 | 2020-05-05T12:48:16.000Z | 2020-05-05T12:48:16.000Z | src/Header/Header.js | c-jordi/Antwork | e35b4b0ffd2063fbd2f6e29e17872cf3e90227fa | [
"MIT"
] | 4 | 2021-03-10T14:50:31.000Z | 2022-02-27T03:09:46.000Z | src/Header/Header.js | c-jordi/Antwork | e35b4b0ffd2063fbd2f6e29e17872cf3e90227fa | [
"MIT"
] | null | null | null | import React from "react";
import { BrowserRouter as Router, Link } from "react-router-dom";
import "./Header.css";
import ControlBar from "../ControlBar";
const Header = () => {
return (
<div className="header">
<div className="icon">
<span role="img" aria-label="Antwork">
🐜
</span>
</div>
<nav>
<div>
<Link className="page" to="/">
Home
</Link>
</div>
<div>
<Link className="page" to="/about">
About
</Link>
</div>
</nav>
<div className="control-container">
<ControlBar Link={Link}></ControlBar>
</div>
</div>
);
};
export default Header;
| 18.617647 | 65 | 0.565561 |
7bc3aa3e0ce0700ac99793849a625feb1d66f776 | 671 | css | CSS | src/app/app.component.css | darendal/ostara | 1f00a14f4ab49aa0fa8dd48f07d21e754cc57d30 | [
"Apache-2.0"
] | null | null | null | src/app/app.component.css | darendal/ostara | 1f00a14f4ab49aa0fa8dd48f07d21e754cc57d30 | [
"Apache-2.0"
] | 3 | 2021-05-11T06:53:56.000Z | 2022-03-02T07:46:59.000Z | src/app/app.component.css | darendal/ostara | 1f00a14f4ab49aa0fa8dd48f07d21e754cc57d30 | [
"Apache-2.0"
] | null | null | null | .logo{
width: 90px;
margin-bottom: 0;
}
.wrap-branding{
display: block;
width: 100%;
top: 0;
left: 0;
padding: 20px 0 15px;
text-align: center;
transition: all .5s ease-in-out;
z-index: 9;
}
.nav {
justify-content: center;
text-align: center;
}
.sidebar {
flex: 0 0 12em;
}
.title-bar {
justify-content: center;
}
.main-content {
display: flex;
flex: 1;
flex-direction: column;
text-align: center;
}
mat-sidenav {
width: 160px;
-moz-box-shadow: -1px 0 5px 0 #555;
-webkit-box-shadow: -1px 0 5px 0 #555;
box-shadow: -1px 0 5px 0 #555;
}
mat-list-option {
width: 100%;
}
mat-grid-tile{
background: aqua;
}
| 13.156863 | 40 | 0.608048 |
0bb6a5d642c93c26a0b0cbe953e0b9d6df9f6ced | 524 | js | JavaScript | src/components/GameOfLife/GameOfLife.js | stefanwille/react-gameoflife | 65682067832b7fd08a5f3f7038086b606f44ae82 | [
"MIT"
] | null | null | null | src/components/GameOfLife/GameOfLife.js | stefanwille/react-gameoflife | 65682067832b7fd08a5f3f7038086b606f44ae82 | [
"MIT"
] | null | null | null | src/components/GameOfLife/GameOfLife.js | stefanwille/react-gameoflife | 65682067832b7fd08a5f3f7038086b606f44ae82 | [
"MIT"
] | null | null | null | import React from 'react'
import HeadLine from 'components/HeadLine/HeadLine'
import Controls from 'components/Controls/Controls'
import Board from 'components/Board/Board'
import Dimensions from 'components/Dimensions/Dimensions'
import PlayLoop from 'components/PlayLoop/PlayLoop'
import './GameOfLife.scss'
const GameOfLife = () => {
return (
<div className='GameOfLife'>
<HeadLine />
<Controls />
<Board />
<Dimensions />
<PlayLoop />
</div>
)
}
export default GameOfLife
| 20.153846 | 57 | 0.696565 |
217d246671db25b05a61f58edab621aaa32610d3 | 757 | sql | SQL | src/EdFi.AnalyticsMiddleTier.DataStandard33/Indexes/MSSQL/0001-Index-Grade-Create.sql | jleiva-gap/Ed-Fi-Analytics-Middle-Tier | e9cfb3545ee40c330cab1286b5cbdbd1417bc696 | [
"Apache-2.0"
] | 5 | 2020-05-27T14:29:49.000Z | 2022-01-10T06:26:17.000Z | src/EdFi.AnalyticsMiddleTier.DataStandard33/Indexes/MSSQL/0001-Index-Grade-Create.sql | jleiva-gap/Ed-Fi-Analytics-Middle-Tier | e9cfb3545ee40c330cab1286b5cbdbd1417bc696 | [
"Apache-2.0"
] | 41 | 2020-05-04T22:46:00.000Z | 2022-03-29T16:46:12.000Z | src/EdFi.AnalyticsMiddleTier.DataStandard33/Indexes/MSSQL/0001-Index-Grade-Create.sql | jleiva-gap/Ed-Fi-Analytics-Middle-Tier | e9cfb3545ee40c330cab1286b5cbdbd1417bc696 | [
"Apache-2.0"
] | 9 | 2020-06-21T18:12:52.000Z | 2021-12-02T16:55:11.000Z | -- SPDX-License-Identifier: Apache-2.0
-- Licensed to the Ed-Fi Alliance under one or more agreements.
-- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
-- See the LICENSE and NOTICES files in the project root for more information.
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE NAME = N'IX_AMT_Grade_SectionKey')
CREATE NONCLUSTERED INDEX IX_AMT_Grade_SectionKey
ON edfi.Grade (StudentUSI,SchoolId,LocalCourseCode,SchoolYear,SectionIdentifier,SessionName)
INCLUDE (NumericGradeEarned)
GO
IF NOT EXISTS (SELECT * FROM analytics_config.IndexJournal WHERE FullyQualifiedIndexName = '[edfi].[Grade].[IX_AMT_Grade_SectionKey]')
INSERT INTO analytics_config.IndexJournal VALUES ('[edfi].[Grade].[IX_AMT_Grade_SectionKey]')
| 58.230769 | 134 | 0.805812 |
35cb0b95eb8ab7de23bd8cecd4b371610c69f84e | 7,687 | lua | Lua | system_drive/libs/window.lua | poeticAndroid/homegirl_pro | 224f7060423ed3d615baf0116029c9cf8eeb6c3d | [
"MIT"
] | 7 | 2020-05-09T06:12:53.000Z | 2021-05-29T02:50:45.000Z | system_drive/libs/window.lua | poeticAndroid/homegirl_pro | 224f7060423ed3d615baf0116029c9cf8eeb6c3d | [
"MIT"
] | 1 | 2020-08-16T13:44:11.000Z | 2020-08-18T09:35:59.000Z | system_drive/libs/window.lua | poeticAndroid/homegirl_pro | 224f7060423ed3d615baf0116029c9cf8eeb6c3d | [
"MIT"
] | null | null | null | local Widget = require("widget")
local Window = Widget:extend()
do
function Window:constructor(title, left, top, width, height, parent)
self.children = {}
self:attachto(nil, parent, parent)
self:size(width, height)
self:position(left, top)
self:title(title)
end
function Window:attachto(...)
Widget.attachto(self, ...)
self.mainvp = view.new(self.container)
self._closebtn = view.new(self.container)
self._titlevp = view.new(self.container)
self._hidebtn = view.new(self.container)
self._resbtn = view.new(self.container, 8, 8, 8, 8)
self:title(self:title())
view.active(self.mainvp)
self:redraw()
if view.attribute(self.parentvp, "hide-enabled") == "true" then
self.onhide = function(self)
view.visible(self.container, false)
end
end
end
function Window:redraw()
if not self.container then
return
end
local prevvp = view.active()
view.active(self.container)
local focused = view.focused(self.container)
local mx, my, mbtn = input.mouse()
local sw, sh = view.size(self.container)
local tw, th = text.draw(self._title, self.font, 0, 0)
local btnw, btnh = math.ceil((th + 2) * 1.5), th + 2
view.position(self.mainvp, 3, btnh)
view.size(self.mainvp, sw - 6, sh - btnh - 3)
gfx.bgcolor(focused and self.fgcolor or self.bgcolor)
gfx.cls()
self:outset(0, 0, sw, sh)
self:inset(2, 2, sw - 4, sh - 4)
view.active(self._closebtn)
view.size(self._closebtn, btnw, btnh)
gfx.bgcolor(focused and self.fgcolor or self.bgcolor)
gfx.cls()
gfx.fgcolor(self.darkcolor)
gfx.bar(4, 3, btnw - 8, btnh - 6)
gfx.fgcolor(focused and self.lightcolor or self.bgcolor)
gfx.bar(5, 4, btnw - 10, btnh - 8)
if view.attribute(self._closebtn, "pressed") == "true" then
self:inset(0, 0, btnw, btnh)
else
self:outset(0, 0, btnw, btnh)
end
view.visible(self._closebtn, self.onclose and true or false)
view.active(self._titlevp)
local btns = 0
if self.onclose then
btns = btns + 1
end
view.position(self._titlevp, btnw * btns, 0)
if self.onhide then
btns = btns + 1
end
local w, h = view.size(self._titlevp, sw - btnw * btns, btnh)
gfx.bgcolor(focused and self.fgcolor or self.bgcolor)
gfx.cls()
gfx.fgcolor(focused and self.fgtextcolor or self.bgtextcolor)
text.draw(self._title, self.font, math.min(w - tw, w / 2 - tw / 2), 1)
self:outset(0, 0, w, h)
if not self.onclose then
gfx.pixel(0, h - 1, gfx.pixel(0, h - 2))
gfx.pixel(1, h - 1, gfx.pixel(1, h - 2))
end
if not self.onhide then
gfx.pixel(w - 2, h - 1, gfx.pixel(w - 2, h - 2))
end
view.active(self._hidebtn)
view.position(self._hidebtn, sw - btnw, 0)
view.size(self._hidebtn, btnw, btnh)
gfx.bgcolor(focused and self.fgcolor or self.bgcolor)
gfx.cls()
gfx.fgcolor(self.darkcolor)
gfx.bar(3, 2, btnw - 6, btnh - 4)
gfx.fgcolor(focused and self.fgcolor or self.bgcolor)
gfx.bar(4, 3, btnw - 8, btnh - 6)
gfx.fgcolor(self.darkcolor)
gfx.bar(3, 2, btnw / 2 - 2, btnh / 2 - 1)
gfx.fgcolor(focused and self.lightcolor or self.bgcolor)
gfx.bar(4, 3, btnw / 2 - 4, btnh / 2 - 3)
if view.attribute(self._hidebtn, "pressed") == "true" then
self:inset(0, 0, btnw, btnh)
else
self:outset(0, 0, btnw, btnh)
end
view.visible(self._hidebtn, self.onhide and true or false)
view.active(self._resbtn)
local w, h = view.size(self._resbtn)
view.position(self._resbtn, sw - w, sh - h)
gfx.bgcolor(focused and self.fgcolor or self.bgcolor)
gfx.cls()
self:outset(0, 0, w + 1, h + 1)
self:outset(-1, -1, w + 1, h + 1)
gfx.pixel(0, h - 2, gfx.pixel(1, h - 2))
gfx.pixel(w - 2, 0, gfx.pixel(w - 2, 1))
view.visible(self._resbtn, self.resizable and true or false)
view.active(prevvp)
end
function Window:title(title)
if title then
if self.container then
self._title = view.attribute(self.container, "title", title)
end
self:redraw()
end
return self._title
end
function Window:icon(icon)
if icon then
if self.container then
self._icon = view.attribute(self.container, "icon", icon)
end
end
return self._icon
end
function Window:position(l, t)
if not t then
l, t = view.position(self.container)
end
local sw, sh = view.size(self.parentvp)
local ww, wh = view.size(self.container)
local bw, bh = view.size(self._closebtn)
local minl = -ww + bw * 2
local maxl = sw - bw * 2
local mint = 0
local maxt = sh - bh
local thres = 16
if l >= 0 and t >= 0 and l <= sw - ww and t <= sh - wh then
self._snapped = false
end
if l < -thres or t < -thres or l > sw - ww + thres or t > sh - wh + thres then
self._snapped = true
end
if not self._snapped then
minl, mint = 0, 0
maxl, maxt = sw - ww, sh - wh
end
if wh > sh then
maxl = sw - ww
maxt = sh - wh
end
if l < minl then
l = minl
end
if t < mint then
t = mint
end
if l > maxl then
l = maxl
end
if t > maxt then
t = maxt
end
return Widget.position(self, l, t)
end
function Window:size(w, h)
if not h then
w, h = view.size(self.container)
end
local wl, wt = view.position(self.container)
local sw, sh = view.size(self.parentvp)
local bw, bh = view.size(self._closebtn)
local minw, minh = bw * 2, bh * 2
local maxw, maxh = 640, 480
if not self._snapped then
maxw, maxh = sw - wl, sh - wt
end
if w < minw then
w = minw
end
if h < minh then
h = minh
end
if w > maxw then
w = maxw
end
if h > maxh then
h = maxh
end
return Widget.size(self, w, h)
end
function Window:step(time)
local prevvp = view.active()
view.active(self.container)
local vw, vh = view.size(self.container)
local mx, my, mbtn, _x, _y = input.mouse()
if self._lastmbtn == 0 and mbtn == 1 then
view.zindex(self.container, -1)
end
if self.onclose and self:gotclicked(self._closebtn) then
self:redraw()
view.active(prevvp)
return self:onclose()
end
if self.onhide and self:gotclicked(self._hidebtn) then
self:redraw()
view.active(prevvp)
return self:onhide()
end
view.active(self._titlevp)
_x, _y, mbtn = input.mouse()
if mbtn == 1 and not self._moving then
self._moving = true
self._movingx = mx
self._movingy = my
end
view.active(self._resbtn)
_x, _y, mbtn = input.mouse()
if mbtn == 1 then
self._resizing = true
vw, vh = view.size(self._resbtn)
self:size(mx + vw / 2, my + vh / 2)
self:redraw()
else
self._resizing = false
self:position()
end
view.active(self.container)
_x, _y, mbtn = input.mouse()
if mbtn == 1 then
if self._moving then
local left, top = self:position()
self:position(left + mx - self._movingx, top + my - self._movingy)
end
else
self._moving = false
if view.focused(self.container) then
view.focused(self.mainvp, true)
end
end
if self._focused ~= view.focused(self.container) or mbtn ~= 0 then
self._focused = view.focused(self.container)
self._lastmbtn = mbtn
self:redraw()
end
if not self._moving and not self._resizing then
for name, child in pairs(self.children) do
child:step(time)
end
end
view.active(prevvp)
end
end
return Window
| 28.261029 | 82 | 0.605958 |
c66c209af731970bf59a8e4f14b9474866b8b913 | 922 | rb | Ruby | lib/archangel_posts/engine.rb | archangel/archangel_posts | 41c465bd2f8b5ca101d1c9f88510e158a53ad35f | [
"MIT"
] | null | null | null | lib/archangel_posts/engine.rb | archangel/archangel_posts | 41c465bd2f8b5ca101d1c9f88510e158a53ad35f | [
"MIT"
] | null | null | null | lib/archangel_posts/engine.rb | archangel/archangel_posts | 41c465bd2f8b5ca101d1c9f88510e158a53ad35f | [
"MIT"
] | null | null | null | module ArchangelPosts
class Engine < ::Rails::Engine
require "archangel"
isolate_namespace Archangel
engine_name "archangel_posts"
config.generators do |g|
g.test_framework :rspec,
fixtures: false,
view_specs: false,
helper_specs: true,
routing_specs: false,
controller_specs: true,
request_specs: true
g.fixture_replacement :factory_girl, dir: "spec/factories"
end
initializer "archangel_posts.configurations" do |app|
app.config.archangel.config << ["archangel_posts"]
end
def self.activate
Dir[File.join(__dir__, "../../app/**/*_decorator*.rb")].each do |klass|
Rails.application.config.cache_classes ? require(klass) : load(klass)
end
end
config.to_prepare(&method(:activate).to_proc)
end
end
| 28.8125 | 77 | 0.596529 |
b650548ec3f39f4fca2c37282c163177d1c9a14b | 631 | rb | Ruby | ee/app/services/ee/applications/create_service.rb | 0vert1m3/test | 2efa557754bb7c8b2f0cd75e4d6c12e06d134f32 | [
"MIT"
] | null | null | null | ee/app/services/ee/applications/create_service.rb | 0vert1m3/test | 2efa557754bb7c8b2f0cd75e4d6c12e06d134f32 | [
"MIT"
] | null | null | null | ee/app/services/ee/applications/create_service.rb | 0vert1m3/test | 2efa557754bb7c8b2f0cd75e4d6c12e06d134f32 | [
"MIT"
] | 2 | 2019-11-28T19:12:40.000Z | 2020-11-04T05:29:58.000Z | module EE
module Applications
# rubocop:disable Gitlab/ModuleWithInstanceVariables
module CreateService
def execute(request)
super.tap do |application|
audit_event_service(request.remote_ip).for_user(application.name).security_event
end
end
def audit_event_service(ip_address)
::AuditEventService.new(@current_user,
@current_user,
action: :custom,
custom_message: 'OAuth access granted',
ip_address: ip_address)
end
end
end
end
| 30.047619 | 90 | 0.570523 |
97d647435a896334265b8467605a2fe3d354e33b | 128 | sql | SQL | src/test/resources/boundary4.test_42.sql | jdkoren/sqlite-parser | 9adf75ff5eca36f6e541594d2e062349f9ced654 | [
"MIT"
] | 131 | 2015-03-31T18:59:14.000Z | 2022-03-09T09:51:06.000Z | src/test/resources/boundary4.test_42.sql | jdkoren/sqlite-parser | 9adf75ff5eca36f6e541594d2e062349f9ced654 | [
"MIT"
] | 20 | 2015-03-31T21:35:38.000Z | 2018-07-02T16:15:51.000Z | src/test/resources/boundary4.test_42.sql | jdkoren/sqlite-parser | 9adf75ff5eca36f6e541594d2e062349f9ced654 | [
"MIT"
] | 43 | 2015-04-28T02:01:55.000Z | 2021-06-06T09:33:38.000Z | -- boundary4.test
--
-- db eval {
-- UPDATE t1 SET rowid=a, a=rowid, x=z, z=x
-- }
UPDATE t1 SET rowid=a, a=rowid, x=z, z=x | 21.333333 | 47 | 0.570313 |
c42787066617e25c95da296ab2889e14134d9002 | 1,952 | h | C | FreeBSD/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointIDList.h | TigerBSD/FreeBSD-Custom-ThinkPad | 3d092f261b362f73170871403397fc5d6b89d1dc | [
"0BSD"
] | 4 | 2016-08-22T22:02:55.000Z | 2017-03-04T22:56:44.000Z | FreeBSD/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointIDList.h | TigerBSD/FreeBSD-Custom-ThinkPad | 3d092f261b362f73170871403397fc5d6b89d1dc | [
"0BSD"
] | 21 | 2016-08-11T09:43:43.000Z | 2017-01-29T12:52:56.000Z | FreeBSD/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointIDList.h | TigerBSD/TigerBSD | 3d092f261b362f73170871403397fc5d6b89d1dc | [
"0BSD"
] | null | null | null | //===-- BreakpointIDList.h --------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_BreakpointIDList_h_
#define liblldb_BreakpointIDList_h_
// C Includes
// C++ Includes
#include <vector>
// Other libraries and framework includes
// Project includes
#include "lldb/lldb-private.h"
#include "lldb/Breakpoint/BreakpointID.h"
namespace lldb_private {
//----------------------------------------------------------------------
// class BreakpointIDList
//----------------------------------------------------------------------
class BreakpointIDList
{
public:
typedef std::vector<BreakpointID> BreakpointIDArray;
BreakpointIDList ();
virtual
~BreakpointIDList ();
size_t
GetSize();
BreakpointID &
GetBreakpointIDAtIndex (size_t index);
bool
RemoveBreakpointIDAtIndex (size_t index);
void
Clear();
bool
AddBreakpointID (BreakpointID bp_id);
bool
AddBreakpointID (const char *bp_id);
bool
FindBreakpointID (BreakpointID &bp_id, size_t *position);
bool
FindBreakpointID (const char *bp_id, size_t *position);
void
InsertStringArray (const char **string_array, size_t array_size, CommandReturnObject &result);
static bool
StringContainsIDRangeExpression (const char *in_string, size_t *range_start_len, size_t *range_end_pos);
static void
FindAndReplaceIDRanges (Args &old_args, Target *target, bool allow_locations, CommandReturnObject &result, Args &new_args);
private:
BreakpointIDArray m_breakpoint_ids;
BreakpointID m_invalid_id;
DISALLOW_COPY_AND_ASSIGN(BreakpointIDList);
};
} // namespace lldb_private
#endif // liblldb_BreakpointIDList_h_
| 23.518072 | 127 | 0.623975 |
1f880f681f5ff376997de35606d3f926b1167848 | 5,236 | html | HTML | app/views/lfd-home-ordering/v3/test-choice.html | uk-gov-mirror/nhsdigital.nhs-antibody-testing-registration-prototype | 3085f9ba81d016a3060b7a9ff6d000ebd52530f5 | [
"MIT"
] | 7 | 2020-08-26T08:40:34.000Z | 2022-01-05T19:26:52.000Z | app/views/lfd-home-ordering/v3/test-choice.html | uk-gov-mirror/nhsdigital.nhs-antibody-testing-registration-prototype | 3085f9ba81d016a3060b7a9ff6d000ebd52530f5 | [
"MIT"
] | 3 | 2020-11-26T16:21:58.000Z | 2021-05-12T09:49:39.000Z | app/views/lfd-home-ordering/v3/test-choice.html | uk-gov-mirror/nhsdigital.nhs-antibody-testing-registration-prototype | 3085f9ba81d016a3060b7a9ff6d000ebd52530f5 | [
"MIT"
] | 19 | 2020-06-11T10:31:39.000Z | 2022-03-30T10:15:59.000Z | {% set version = "v3" %}
{% set pageTitle = "How do you want to get the coronavirus test?" %}
{% extends "includes/layout.html" %}
{% block beforeContent %}
<div class="govuk-phase-banner">
<p class="govuk-phase-banner__content">
<strong class="govuk-tag govuk-phase-banner__content__tag">
alpha
</strong>
<span class="govuk-phase-banner__text">
This is a new service – your <a class="govuk-link" href="#">feedback</a> will help us to improve it.
</span>
</p>
</div>
{% if data['email-address'] == "[email protected]" %}
<div class="govuk-phase-banner govuk-!-margin-bottom-7" style="margin-top: -40px;">
<p class="govuk-phase-banner__content" style="line-height: 35px">
<span class="govuk-phase-banner__text">
Signed in as <strong>{{ data['first-name'] or "Pete" }} {{ data['last-name'] or "Smith" }}</strong>
</span>
</p>
<div style="float: right; margin-top: -30px">
<a href="/lfd-home-ordering/{{version}}/user-account/edit-personal-details/home-page" style="margin-right: 20px">Edit login details</a>
<a href="/lfd-home-ordering/{{version}}/order-home-test">Sign out</a>
</div>
</div>
{% endif %}
<a class="govuk-back-link" href="/lfd-home-ordering/{{version}}/work-from-home">Back</a>
{% endblock %}
{% block content %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<form action="/lfd-home-ordering/{{version}}/action10/test-choice" method="post">
<div class="govuk-form-group govuk-!-padding-bottom-5">
<fieldset class="govuk-fieldset">
<legend class="govuk-fieldset__legend govuk-fieldset__legend--l">
<h1 class="govuk-heading-xl govuk-!-margin-bottom-3">
{{ pageTitle }}
</h1>
</legend>
<div class="govuk-radios govuk-!-margin-top-5">
<div class="govuk-radios__item">
<input class="govuk-radios__input" id="test-choice-1" name="test-choice" type="radio" value="Collect tests to take home" {{ checked("test-choice", "Collect tests to take home") }}>
<label class="govuk-label govuk-radios__label" for="test-choice-1">
<strong class="govuk-!-font-size-24">Collect tests to take home</strong>
</label>
</div>
<ul class="govuk-list govuk-list--bullet govuk-!-margin-left-2">
<li>Check to see where your <a href="https://maps.test-and-trace.nhs.uk/findatestcenter.html#" target="blank" class="govuk-link">nearest collection point is</a></li>
<li>You can collect at the COVID-secure site today</li>
<li>You can get up to 14 tests per household</li>
<li>You need to register some basic personal details before collecting</li>
</ul>
<div class="govuk-radios__item">
<input class="govuk-radios__input" id="test-choice-3" name="test-choice" type="radio" value="Order tests to your home" {{ checked("test-choice", "Order tests to your home") }}>
<label class="govuk-label govuk-radios__label" for="test-choice-3">
<strong class="govuk-!-font-size-24">Order tests to your home</strong>
</label>
</div>
<ul class="govuk-list govuk-list--bullet govuk-!-margin-left-2">
<li>You can get 7 tests delivered by post</li>
<li>Tests should arrive within 2 working days</li>
<li>You need to register some basic personal details before ordering</li>
</ul>
<div class="govuk-radios__item">
<input class="govuk-radios__input" id="test-choice-2" name="test-choice" type="radio" value="Get a one off test at a community test site" {{ checked("test-choice", "Get a one off test at a community test site") }}>
<label class="govuk-label govuk-radios__label" for="test-choice-2">
<strong class="govuk-!-font-size-24">Get a one off test at a community test site</strong>
</label>
</div>
<ul class="govuk-list govuk-list--bullet govuk-!-margin-left-2 govuk-!-margin-top-2">
<li>You should register for the test before you go to the test site</li>
<li>Check to see where your <a href="https://maps.test-and-trace.nhs.uk/findatestcenter.html#" target="blank" class="govuk-link">local community assisted test site is</a></li>
</ul>
</div>
</fieldset>
</div>
<button class="govuk-button" data-module="govuk-button">Continue</button>
</form>
</div>
</div>
{% endblock %}
| 55.702128 | 242 | 0.540489 |
4118163215955ea20a7a9337d04632245968123a | 1,310 | h | C | modules/ngx_tcp_ssl_module.h | chobits/nginx_tcp_proxy_module | 213b59d26ff9ec4a37030666e3e317b4c243d722 | [
"Unlicense"
] | 1,074 | 2015-01-06T07:47:36.000Z | 2022-03-29T20:28:10.000Z | modules/ngx_tcp_ssl_module.h | chobits/nginx_tcp_proxy_module | 213b59d26ff9ec4a37030666e3e317b4c243d722 | [
"Unlicense"
] | 80 | 2015-01-22T02:40:38.000Z | 2022-01-24T01:04:08.000Z | modules/ngx_tcp_ssl_module.h | chobits/nginx_tcp_proxy_module | 213b59d26ff9ec4a37030666e3e317b4c243d722 | [
"Unlicense"
] | 286 | 2015-01-06T23:52:47.000Z | 2022-03-29T02:47:49.000Z |
#ifndef _NGX_TCP_SSL_H_INCLUDED_
#define _NGX_TCP_SSL_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_tcp.h>
typedef struct {
ngx_flag_t enable;
ngx_ssl_t ssl;
ngx_flag_t prefer_server_ciphers;
ngx_uint_t protocols;
ngx_uint_t verify;
ngx_uint_t verify_depth;
ssize_t builtin_session_cache;
time_t session_timeout;
ngx_str_t certificate;
ngx_str_t certificate_key;
ngx_str_t dhparam;
#if defined(nginx_version) && nginx_version >= 1000006
ngx_str_t ecdh_curve;
#endif
ngx_str_t client_certificate;
ngx_str_t crl;
ngx_str_t ciphers;
#if defined(nginx_version) && nginx_version >= 1007003
ngx_array_t *passwords;
#endif
ngx_shm_zone_t *shm_zone;
u_char *file;
ngx_uint_t line;
} ngx_tcp_ssl_srv_conf_t;
extern ngx_module_t ngx_tcp_ssl_module;
#endif /* _NGX_TCP_SSL_H_INCLUDED_ */
| 24.716981 | 58 | 0.509924 |
dd1ceea118ab3f26da3035d5115b14faafc67fa9 | 846 | go | Go | mdl/retention/t_bc_test.go | kld123509945/gofem | 7670324a6a6bf4a859a78d0db4b1eb67e81847db | [
"BSD-3-Clause"
] | 1 | 2020-06-24T07:55:38.000Z | 2020-06-24T07:55:38.000Z | mdl/retention/t_bc_test.go | kld123509945/gofem | 7670324a6a6bf4a859a78d0db4b1eb67e81847db | [
"BSD-3-Clause"
] | null | null | null | mdl/retention/t_bc_test.go | kld123509945/gofem | 7670324a6a6bf4a859a78d0db4b1eb67e81847db | [
"BSD-3-Clause"
] | 1 | 2020-10-13T13:22:18.000Z | 2020-10-13T13:22:18.000Z | // Copyright 2016 The Gofem Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package retention
import (
"testing"
"github.com/cpmech/gosl/chk"
"github.com/cpmech/gosl/plt"
)
func Test_bc01(tst *testing.T) {
//verbose()
chk.PrintTitle("bc01")
mdl := new(BrooksCorey)
prm := mdl.GetPrms(true)
slmax := prm.Find("slmax")
slmax.V = 0.95
mdl.Init(prm)
pc0 := -1.0
sl0 := mdl.SlMax()
pcf := 3.0
nptsA := 11
nptsB := 11
if chk.Verbose {
plt.Reset(false, nil)
Plot(mdl, pc0, sl0, pcf, nptsA, false, "'b.-'", "'r+-'", "bc")
}
tolCc := 1e-11
tolD1a, tolD1b := 1e-10, 1e-17
tolD2a, tolD2b := 1e-10, 1e-17
checkDerivs(tst, mdl, pc0, sl0, pcf, nptsB, tolCc, tolD1a, tolD1b, tolD2a, tolD2b, chk.Verbose, []float64{0.2}, 1e-7, chk.Verbose)
}
| 20.634146 | 131 | 0.646572 |
b2bd4f949111e868e7c604ca11722af37078a8f7 | 1,889 | rs | Rust | panic_examples/closures/rustc_234/test1.rs | ani003/prusti_panic_test | a1d26a5506a719704ab86942d45efff10651b06e | [
"MIT"
] | null | null | null | panic_examples/closures/rustc_234/test1.rs | ani003/prusti_panic_test | a1d26a5506a719704ab86942d45efff10651b06e | [
"MIT"
] | null | null | null | panic_examples/closures/rustc_234/test1.rs | ani003/prusti_panic_test | a1d26a5506a719704ab86942d45efff10651b06e | [
"MIT"
] | null | null | null | fn main() {
let _ = (0..1).map(Some);
}
/*
thread 'rustc' panicked at 'DefId::expect_local: `DefId(2:40546 ~ core[734c]::option::Option::Some::{constructor#0})` isn't local', /rustc/8007b506ac5da629f223b755f5a5391edd5f6d01/compiler/rustc_span/src/def_id.rs:234:43
stack backtrace:
0: rust_begin_unwind
at /rustc/8007b506ac5da629f223b755f5a5391edd5f6d01/library/std/src/panicking.rs:517:5
1: std::panicking::begin_panic_fmt
at /rustc/8007b506ac5da629f223b755f5a5391edd5f6d01/library/std/src/panicking.rs:460:5
2: rustc_span::def_id::DefId::expect_local::{{closure}}
3: prusti_interface::environment::procedure::Procedure::new
4: prusti_interface::environment::Environment::get_procedure
5: prusti_viper::encoder::encoder::Encoder::encode_spec_funcs
6: prusti_viper::encoder::encoder::Encoder::encode_const_expr
7: prusti_viper::encoder::mir_encoder::MirEncoder::encode_operand_expr
8: prusti_viper::encoder::procedure_encoder::ProcedureEncoder::encode_impure_function_call
9: prusti_viper::encoder::procedure_encoder::ProcedureEncoder::encode_terminator
10: prusti_viper::encoder::procedure_encoder::ProcedureEncoder::encode_statement_at
11: prusti_viper::encoder::procedure_encoder::ProcedureEncoder::encode_blocks_group
12: prusti_viper::encoder::procedure_encoder::ProcedureEncoder::encode
13: prusti_viper::encoder::encoder::Encoder::encode_procedure
14: prusti_viper::encoder::encoder::Encoder::process_encoding_queue
15: prusti_viper::verifier::Verifier::verify
16: prusti_driver::verifier::verify
17: <prusti_driver::callbacks::PrustiCompilerCalls as rustc_driver::Callbacks>::after_analysis
18: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
19: rustc_span::with_source_map
20: rustc_interface::interface::create_compiler_and_run
21: scoped_tls::ScopedKey<T>::set
*/
| 57.242424 | 220 | 0.784013 |
32c8f31b9bf18e1374337cbac35262c6899aa168 | 86 | kt | Kotlin | library-store-coroutines/src/test/java/ru/fabit/storecoroutines/order/OrderState.kt | FabitMobile/store-coroutines | a9d053e5b1918faa5f3c33efe59af16e128bc3f6 | [
"MIT"
] | null | null | null | library-store-coroutines/src/test/java/ru/fabit/storecoroutines/order/OrderState.kt | FabitMobile/store-coroutines | a9d053e5b1918faa5f3c33efe59af16e128bc3f6 | [
"MIT"
] | null | null | null | library-store-coroutines/src/test/java/ru/fabit/storecoroutines/order/OrderState.kt | FabitMobile/store-coroutines | a9d053e5b1918faa5f3c33efe59af16e128bc3f6 | [
"MIT"
] | null | null | null | package ru.fabit.storecoroutines.order
data class OrderState(
val value: String
) | 17.2 | 38 | 0.77907 |
85d1d13a76fe375430d96b2b341507ec5740d438 | 11,559 | js | JavaScript | redpwn/2021/pwn/empires/mojojs/gen/third_party/blink/public/mojom/interest_group/restricted_interest_group_store.mojom.js | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | redpwn/2021/pwn/empires/mojojs/gen/third_party/blink/public/mojom/interest_group/restricted_interest_group_store.mojom.js | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | redpwn/2021/pwn/empires/mojojs/gen/third_party/blink/public/mojom/interest_group/restricted_interest_group_store.mojom.js | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | // third_party/blink/public/mojom/interest_group/restricted_interest_group_store.mojom.js is auto generated by mojom_bindings_generator.py, do not edit
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
'use strict';
(function() {
var mojomId = 'third_party/blink/public/mojom/interest_group/restricted_interest_group_store.mojom';
if (mojo.internal.isMojomLoaded(mojomId)) {
console.warn('The following mojom is loaded multiple times: ' + mojomId);
return;
}
mojo.internal.markMojomLoaded(mojomId);
var bindings = mojo;
var associatedBindings = mojo;
var codec = mojo.internal;
var validator = mojo.internal;
var exports = mojo.internal.exposeNamespace('blink.mojom');
var interest_group_types$ =
mojo.internal.exposeNamespace('blink.mojom');
if (mojo.config.autoLoadMojomDeps) {
mojo.internal.loadMojomIfNecessary(
'third_party/blink/public/mojom/interest_group/interest_group_types.mojom', 'interest_group_types.mojom.js');
}
var origin$ =
mojo.internal.exposeNamespace('url.mojom');
if (mojo.config.autoLoadMojomDeps) {
mojo.internal.loadMojomIfNecessary(
'url/mojom/origin.mojom', '../../../../../url/mojom/origin.mojom.js');
}
var url$ =
mojo.internal.exposeNamespace('url.mojom');
if (mojo.config.autoLoadMojomDeps) {
mojo.internal.loadMojomIfNecessary(
'url/mojom/url.mojom', '../../../../../url/mojom/url.mojom.js');
}
function RestrictedInterestGroupStore_JoinInterestGroup_Params(values) {
this.initDefaults_();
this.initFields_(values);
}
RestrictedInterestGroupStore_JoinInterestGroup_Params.prototype.initDefaults_ = function() {
this.group = null;
};
RestrictedInterestGroupStore_JoinInterestGroup_Params.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
RestrictedInterestGroupStore_JoinInterestGroup_Params.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 16}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate RestrictedInterestGroupStore_JoinInterestGroup_Params.group
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, interest_group_types$.InterestGroup, false);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
RestrictedInterestGroupStore_JoinInterestGroup_Params.encodedSize = codec.kStructHeaderSize + 8;
RestrictedInterestGroupStore_JoinInterestGroup_Params.decode = function(decoder) {
var packed;
var val = new RestrictedInterestGroupStore_JoinInterestGroup_Params();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.group =
decoder.decodeStructPointer(interest_group_types$.InterestGroup);
return val;
};
RestrictedInterestGroupStore_JoinInterestGroup_Params.encode = function(encoder, val) {
var packed;
encoder.writeUint32(RestrictedInterestGroupStore_JoinInterestGroup_Params.encodedSize);
encoder.writeUint32(0);
encoder.encodeStructPointer(interest_group_types$.InterestGroup, val.group);
};
function RestrictedInterestGroupStore_LeaveInterestGroup_Params(values) {
this.initDefaults_();
this.initFields_(values);
}
RestrictedInterestGroupStore_LeaveInterestGroup_Params.prototype.initDefaults_ = function() {
this.owner = null;
this.name = null;
};
RestrictedInterestGroupStore_LeaveInterestGroup_Params.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
RestrictedInterestGroupStore_LeaveInterestGroup_Params.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 24}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate RestrictedInterestGroupStore_LeaveInterestGroup_Params.owner
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, origin$.Origin, false);
if (err !== validator.validationError.NONE)
return err;
// validate RestrictedInterestGroupStore_LeaveInterestGroup_Params.name
err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false)
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
RestrictedInterestGroupStore_LeaveInterestGroup_Params.encodedSize = codec.kStructHeaderSize + 16;
RestrictedInterestGroupStore_LeaveInterestGroup_Params.decode = function(decoder) {
var packed;
var val = new RestrictedInterestGroupStore_LeaveInterestGroup_Params();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.owner =
decoder.decodeStructPointer(origin$.Origin);
val.name =
decoder.decodeStruct(codec.String);
return val;
};
RestrictedInterestGroupStore_LeaveInterestGroup_Params.encode = function(encoder, val) {
var packed;
encoder.writeUint32(RestrictedInterestGroupStore_LeaveInterestGroup_Params.encodedSize);
encoder.writeUint32(0);
encoder.encodeStructPointer(origin$.Origin, val.owner);
encoder.encodeStruct(codec.String, val.name);
};
var kRestrictedInterestGroupStore_JoinInterestGroup_Name = 0;
var kRestrictedInterestGroupStore_LeaveInterestGroup_Name = 1;
function RestrictedInterestGroupStorePtr(handleOrPtrInfo) {
this.ptr = new bindings.InterfacePtrController(RestrictedInterestGroupStore,
handleOrPtrInfo);
}
function RestrictedInterestGroupStoreAssociatedPtr(associatedInterfacePtrInfo) {
this.ptr = new associatedBindings.AssociatedInterfacePtrController(
RestrictedInterestGroupStore, associatedInterfacePtrInfo);
}
RestrictedInterestGroupStoreAssociatedPtr.prototype =
Object.create(RestrictedInterestGroupStorePtr.prototype);
RestrictedInterestGroupStoreAssociatedPtr.prototype.constructor =
RestrictedInterestGroupStoreAssociatedPtr;
function RestrictedInterestGroupStoreProxy(receiver) {
this.receiver_ = receiver;
}
RestrictedInterestGroupStorePtr.prototype.joinInterestGroup = function() {
return RestrictedInterestGroupStoreProxy.prototype.joinInterestGroup
.apply(this.ptr.getProxy(), arguments);
};
RestrictedInterestGroupStoreProxy.prototype.joinInterestGroup = function(group) {
var params_ = new RestrictedInterestGroupStore_JoinInterestGroup_Params();
params_.group = group;
var builder = new codec.MessageV0Builder(
kRestrictedInterestGroupStore_JoinInterestGroup_Name,
codec.align(RestrictedInterestGroupStore_JoinInterestGroup_Params.encodedSize));
builder.encodeStruct(RestrictedInterestGroupStore_JoinInterestGroup_Params, params_);
var message = builder.finish();
this.receiver_.accept(message);
};
RestrictedInterestGroupStorePtr.prototype.leaveInterestGroup = function() {
return RestrictedInterestGroupStoreProxy.prototype.leaveInterestGroup
.apply(this.ptr.getProxy(), arguments);
};
RestrictedInterestGroupStoreProxy.prototype.leaveInterestGroup = function(owner, name) {
var params_ = new RestrictedInterestGroupStore_LeaveInterestGroup_Params();
params_.owner = owner;
params_.name = name;
var builder = new codec.MessageV0Builder(
kRestrictedInterestGroupStore_LeaveInterestGroup_Name,
codec.align(RestrictedInterestGroupStore_LeaveInterestGroup_Params.encodedSize));
builder.encodeStruct(RestrictedInterestGroupStore_LeaveInterestGroup_Params, params_);
var message = builder.finish();
this.receiver_.accept(message);
};
function RestrictedInterestGroupStoreStub(delegate) {
this.delegate_ = delegate;
}
RestrictedInterestGroupStoreStub.prototype.joinInterestGroup = function(group) {
return this.delegate_ && this.delegate_.joinInterestGroup && this.delegate_.joinInterestGroup(group);
}
RestrictedInterestGroupStoreStub.prototype.leaveInterestGroup = function(owner, name) {
return this.delegate_ && this.delegate_.leaveInterestGroup && this.delegate_.leaveInterestGroup(owner, name);
}
RestrictedInterestGroupStoreStub.prototype.accept = function(message) {
var reader = new codec.MessageReader(message);
switch (reader.messageName) {
case kRestrictedInterestGroupStore_JoinInterestGroup_Name:
var params = reader.decodeStruct(RestrictedInterestGroupStore_JoinInterestGroup_Params);
this.joinInterestGroup(params.group);
return true;
case kRestrictedInterestGroupStore_LeaveInterestGroup_Name:
var params = reader.decodeStruct(RestrictedInterestGroupStore_LeaveInterestGroup_Params);
this.leaveInterestGroup(params.owner, params.name);
return true;
default:
return false;
}
};
RestrictedInterestGroupStoreStub.prototype.acceptWithResponder =
function(message, responder) {
var reader = new codec.MessageReader(message);
switch (reader.messageName) {
default:
return false;
}
};
function validateRestrictedInterestGroupStoreRequest(messageValidator) {
var message = messageValidator.message;
var paramsClass = null;
switch (message.getName()) {
case kRestrictedInterestGroupStore_JoinInterestGroup_Name:
if (!message.expectsResponse() && !message.isResponse())
paramsClass = RestrictedInterestGroupStore_JoinInterestGroup_Params;
break;
case kRestrictedInterestGroupStore_LeaveInterestGroup_Name:
if (!message.expectsResponse() && !message.isResponse())
paramsClass = RestrictedInterestGroupStore_LeaveInterestGroup_Params;
break;
}
if (paramsClass === null)
return validator.validationError.NONE;
return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes());
}
function validateRestrictedInterestGroupStoreResponse(messageValidator) {
return validator.validationError.NONE;
}
var RestrictedInterestGroupStore = {
name: 'blink.mojom.RestrictedInterestGroupStore',
kVersion: 0,
ptrClass: RestrictedInterestGroupStorePtr,
proxyClass: RestrictedInterestGroupStoreProxy,
stubClass: RestrictedInterestGroupStoreStub,
validateRequest: validateRestrictedInterestGroupStoreRequest,
validateResponse: null,
};
RestrictedInterestGroupStoreStub.prototype.validator = validateRestrictedInterestGroupStoreRequest;
RestrictedInterestGroupStoreProxy.prototype.validator = null;
exports.RestrictedInterestGroupStore = RestrictedInterestGroupStore;
exports.RestrictedInterestGroupStorePtr = RestrictedInterestGroupStorePtr;
exports.RestrictedInterestGroupStoreAssociatedPtr = RestrictedInterestGroupStoreAssociatedPtr;
})(); | 39.99654 | 151 | 0.763215 |
bcc92458c391c8085583fce51cfa1038a1f33f6c | 1,072 | js | JavaScript | frontend/app/src/_services/user.service.js | dnguyenngoc/film | e1dcf447d298f7666194ad308cb7c2686cad9962 | [
"BSD-2-Clause"
] | 1 | 2020-11-28T18:58:47.000Z | 2020-11-28T18:58:47.000Z | frontend/app/src/_services/user.service.js | dnguyenngoc/film | e1dcf447d298f7666194ad308cb7c2686cad9962 | [
"BSD-2-Clause"
] | null | null | null | frontend/app/src/_services/user.service.js | dnguyenngoc/film | e1dcf447d298f7666194ad308cb7c2686cad9962 | [
"BSD-2-Clause"
] | null | null | null | // import { authHeader } from '../_helpers';
import config from 'config';
export const userService = {
login,
logout
};
function login(username, password) {
const requestOptions = {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username, password })
};
return fetch(`${config.apiUrl}/accounts/login`, requestOptions)
.then(handleResponse)
.then(token => {
// store user details and jwt token in local storage to keep user logged in between page refreshes
// localStorage.setItem('token', JSON.stringify(token));
return token;
});
}
function logout() {
// remove user from local storage to log user out
// localStorage.removeItem('user');
}
function register(user) {
const requestOptions = {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(user)
};
return fetch(`${config.apiUrl}/accounts/register`, requestOptions).then(handleResponse);
} | 28.210526 | 110 | 0.623134 |
8efbbbcb9aabf6db05a2c1f3377b25ca1fa926e9 | 471 | rb | Ruby | app/models/concerns/user_capabilities.rb | clacroix12/catalog-api | 15be3ab8961a64bbdbd3d2d356cde01891700d05 | [
"Apache-2.0"
] | 2 | 2020-05-05T21:58:57.000Z | 2020-09-04T13:51:56.000Z | app/models/concerns/user_capabilities.rb | clacroix12/catalog-api | 15be3ab8961a64bbdbd3d2d356cde01891700d05 | [
"Apache-2.0"
] | 358 | 2019-11-15T21:04:10.000Z | 2022-01-21T01:47:49.000Z | app/models/concerns/user_capabilities.rb | clacroix12/catalog-api | 15be3ab8961a64bbdbd3d2d356cde01891700d05 | [
"Apache-2.0"
] | 10 | 2020-02-19T16:19:19.000Z | 2021-04-14T16:20:45.000Z | module UserCapabilities
include Pundit
extend ActiveSupport::Concern
included do
attribute :metadata, ActiveRecord::Type::Json.new
end
class_methods do
def policy_class
@policy_class ||= "#{self}Policy".constantize
end
end
private
def user_capabilities
return nil if user_context.nil?
self.class.policy_class.new(user_context, self).user_capabilities
end
def user_context
UserContext.current_user_context
end
end
| 17.444444 | 69 | 0.738854 |
71bfef80486fba5c6d181919493667fdf5ccafa5 | 227 | kt | Kotlin | src/main/kotlin/armada/engine/api/TheatreData.kt | fr33r4ng3r/armada | 90610d9ab60248f42630a90ab110f0c9ac4b0cc0 | [
"Apache-2.0",
"MIT"
] | null | null | null | src/main/kotlin/armada/engine/api/TheatreData.kt | fr33r4ng3r/armada | 90610d9ab60248f42630a90ab110f0c9ac4b0cc0 | [
"Apache-2.0",
"MIT"
] | null | null | null | src/main/kotlin/armada/engine/api/TheatreData.kt | fr33r4ng3r/armada | 90610d9ab60248f42630a90ab110f0c9ac4b0cc0 | [
"Apache-2.0",
"MIT"
] | null | null | null | package armada.engine.api
data class TheatreData(val gridWidth: Int, val gridHeight: Int, val numberOfShips: Int, val ships: List<ShipData>) {
data class ShipData(val descriptor: String, val width: Int, val length: Int)
}
| 37.833333 | 116 | 0.753304 |
c4f3f2ff2b3beb7b020d479852a3b6514dd8b23d | 563 | swift | Swift | workspaces/ios-javascript/JavascriptWrapper/SetTimeout.swift | philips-software/cogito | e84ddb4fb1e9ae95652595f3111c43eebb6e4982 | [
"MIT"
] | 17 | 2018-08-15T08:53:18.000Z | 2022-02-17T10:10:52.000Z | workspaces/ios-javascript/JavascriptWrapper/SetTimeout.swift | philips-software/cogito | e84ddb4fb1e9ae95652595f3111c43eebb6e4982 | [
"MIT"
] | 105 | 2018-09-21T13:42:22.000Z | 2022-02-26T21:31:51.000Z | workspaces/ios-javascript/JavascriptWrapper/SetTimeout.swift | philips-software/cogito | e84ddb4fb1e9ae95652595f3111c43eebb6e4982 | [
"MIT"
] | 7 | 2018-08-07T06:58:35.000Z | 2019-04-09T05:22:54.000Z | import JavaScriptCore
public extension JSContext {
public func addSetTimeout() -> JSContext {
self.globalObject.setValue(setTimeout, forProperty: "setTimeout")
return self
}
}
fileprivate let setTimeout: @convention(block) (JSValue?, JSValue?) -> Void = { callback, milliseconds in
var delay: Double = 0
if let milliseconds = milliseconds, milliseconds.isNumber {
delay = milliseconds.toDouble() / 1000
}
DispatchQueue.main.asyncAfter(deadline: .now() + delay) {
callback?.call(withArguments: [])
}
}
| 29.631579 | 105 | 0.676732 |
6ee17b533d12addc33dc420f2573dceab7b2d519 | 4,098 | html | HTML | application/shop/view/shop_info/dispatchArea.html | tsingStar/tpybt | a91453802fc612761825160f4e63d3710b1c5111 | [
"Apache-2.0"
] | null | null | null | application/shop/view/shop_info/dispatchArea.html | tsingStar/tpybt | a91453802fc612761825160f4e63d3710b1c5111 | [
"Apache-2.0"
] | null | null | null | application/shop/view/shop_info/dispatchArea.html | tsingStar/tpybt | a91453802fc612761825160f4e63d3710b1c5111 | [
"Apache-2.0"
] | null | null | null | {include file='pub/header'/}
<title>小区列表</title>
</head>
<body class="pos-r">
<div>
<nav class="breadcrumb">{$breadNav} <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
href="javascript:location.replace(location.href);" title="刷新"><i
class="Hui-iconfont"></i></a></nav>
<div class="page-container">
<div class="cl pd-5 bg-1 bk-gray mt-20">
<span class="l">
<a href="javascript:;" onclick="datadel()" class="btn btn-danger radius">
<i class="Hui-iconfont"></i> 批量删除
</a>
<a class="btn btn-primary radius" onclick="area_add('添加小区','{:url(\'areaAdd\')}')" href="javascript:;">
<i class="Hui-iconfont"></i> 添加小区
</a>
</span>
</div>
<div class="mt-20">
<table class="table table-border table-bordered table-bg table-hover table-sort">
<thead>
<tr class="text-c">
<th width="40"><input name="" type="checkbox" value=""></th>
<th width="40">ID</th>
<th width="40">小区名称</th>
<th width="60">经度</th>
<th width="100">纬度</th>
<th width="100">操作</th>
</tr>
</thead>
<tbody>
{foreach $areaList as $area}
<tr class="text-c va-m">
<td><input name="id" type="checkbox" value="{$area.id}"></td>
<td>{$area.id}</td>
<td>{$area.residential_name}</td>
<td>{$area.lng}</td>
<td>{$area.lat}</td>
<td class="td-manage">
<a style="text-decoration:none" class="ml-5" onClick="area_del(this,'{$area.id}')"
href="javascript:;" title="删除">
<i class="Hui-iconfont">删除</i>
</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</div>
{include file='pub/footer'/}
<script type="text/javascript">
$(function () {
var is_set_location = "{$location}";
if(!is_set_location){
layer.alert('设置店铺位置后再选择配送小区');
}
});
$('.table-sort').dataTable({
"aaSorting": [[1, "asc"]],//默认第几个排序
"bStateSave": true,//状态保存
"aoColumnDefs": [
{"orderable": false, "aTargets": [0, 5]}// 制定列不参与排序
]
});
/*产品-添加*/
function area_add(title, url) {
var index = layer.open({
resize: true,
type: 2,
title: title,
content: url,
area:['800px','600px']
});
// layer.full(index);
}
/*小区-删除*/
function area_del(obj, id) {
layer.confirm('确认要删除吗?', function () {
$.post("{:url('ShopInfo/delData')}", {idstr:id}, function (res) {
if(res.code == 1){
layer.msg('删除成功');
$(obj).parents('tr').remove();
}else{
layer.msg(res.msg);
}
});
});
}
//删除选中产品
function datadel() {
var $ids = $("input[name='id']:checked");
if($ids.length<1){
layer.alert('请选中后在操作');
return false;
}
var idarr = new Array();
$.each($ids, function (i, v) {
idarr.push($(v).val());
});
var idStr = idarr.toString();
layer.confirm('确认删除选中项?', function () {
$.post("{:url('ShopInfo/delData')}", {idstr:idStr}, function (res) {
if(res.code == 1){
layer.msg('删除成功');
$ids.parents('tr').remove();
}else{
layer.msg(res.msg);
}
});
});
}
</script>
</body>
</html> | 33.590164 | 119 | 0.418009 |
dd66aeadc83afe26033cefc1913ea0c459cc15c2 | 4,345 | swift | Swift | OktoIDE/Pods/Prestyler/Prestyler/Classes/Extensions.swift | MediBoss/OktoIDE | e34fa137b5f093c32b7f2ad7a016f5ecacf4cf36 | [
"Apache-2.0"
] | null | null | null | OktoIDE/Pods/Prestyler/Prestyler/Classes/Extensions.swift | MediBoss/OktoIDE | e34fa137b5f093c32b7f2ad7a016f5ecacf4cf36 | [
"Apache-2.0"
] | 2 | 2019-07-08T23:43:09.000Z | 2019-07-17T16:43:50.000Z | OktoIDE/Pods/Prestyler/Prestyler/Classes/Extensions.swift | mediassumani/OktoIDE | e34fa137b5f093c32b7f2ad7a016f5ecacf4cf36 | [
"Apache-2.0"
] | null | null | null | //
// StringExtension.swift
// Pods-Prestyler_Example
//
// Created by Ilya Krupko on 28/02/2019.
//
import Foundation
/// Prestyler uses a public extension to provide access to string formatting. Next methods can be used for every string.
public extension String {
/// Convert string to attributed string by looking for embeded tag and find sutable patterns.
///
/// - Returns: Attributed string
func prestyled() -> NSAttributedString {
var textToStyle = self
let appliedRules = Prestyler.findTextRules(&textToStyle)
var resultedText = NSMutableAttributedString(string: textToStyle)
appliedRules.forEach { $0.applyTo(text: &resultedText) }
return resultedText
}
/// Convert string to attributed string by using provided rule pattern.
///
/// - Parameter rule: pattern rule to apply
/// - Returns: attributed string
func prestyledBy(rule: String) -> NSAttributedString {
return (rule + self + rule).prestyled()
}
/// Convert string to attributed string by using provided styles.
///
/// - Parameter styles: styles to apply
/// - Returns: attributed string
func prestyledBy(styles: Any...) -> NSAttributedString {
let rule = TextRule(styles: styles, positions: [0, self.count])
var resultedText = NSMutableAttributedString(string: self)
rule.applyTo(text: &resultedText)
return resultedText
}
}
extension String {
func index(at position: Int, from start: Index? = nil) -> Index? {
let startingIndex = start ?? startIndex
return index(startingIndex, offsetBy: position, limitedBy: endIndex)
}
func character(at position: Int) -> Character? {
guard position >= 0, let indexPosition = index(at: position) else {
return nil
}
return self[indexPosition]
}
func hexToUIColor() -> UIColor? {
var string = self.trimmingCharacters(in: .whitespacesAndNewlines).uppercased()
string = string.replacingOccurrences(of: "#", with: "")
if string.count == 3 {
let r = string.character(at: 0) ?? "0"
let g = string.character(at: 1) ?? "0"
let b = string.character(at: 2) ?? "0"
string = "\(r)\(r)\(g)\(g)\(b)\(b)"
}
if string.count != 6 {
return nil
}
var rgbValue: UInt32 = 0
Scanner(string: string).scanHexInt32(&rgbValue)
return UIColor(
red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0,
green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0,
blue: CGFloat(rgbValue & 0x0000FF) / 255.0,
alpha: CGFloat(1.0)
)
}
}
extension StringProtocol where Index == String.Index {
func indexes(of string: Self, options: String.CompareOptions = []) -> [Int] {
var result: [Int] = []
var start = startIndex
while start < endIndex,
let range = self[start..<endIndex].range(of: string, options: options) {
result.append(range.lowerBound.encodedOffset)
start = range.lowerBound < range.upperBound ? range.upperBound :
index(range.lowerBound, offsetBy: 1, limitedBy: endIndex) ?? endIndex
}
return result
}
}
extension UIColor {
func mixin(infusion: UIColor, alpha: CGFloat) -> UIColor {
let alpha2 = min(1.0, max(0, alpha))
let beta = 1.0 - alpha2
var r1:CGFloat = 0, r2:CGFloat = 0
var g1:CGFloat = 0, g2:CGFloat = 0
var b1:CGFloat = 0, b2:CGFloat = 0
var a1:CGFloat = 0, a2:CGFloat = 0
if getRed(&r1, green: &g1, blue: &b1, alpha: &a1) &&
infusion.getRed(&r2, green: &g2, blue: &b2, alpha: &a2) {
let red = r1 * beta + r2 * alpha2;
let green = g1 * beta + g2 * alpha2;
let blue = b1 * beta + b2 * alpha2;
let alpha = a1 * beta + a2 * alpha2;
return UIColor(red: red, green: green, blue: blue, alpha: alpha)
}
return self
}
}
extension NSRange {
func splitUnitary() -> [NSRange] {
var result = [NSRange]()
for index in 0..<self.length {
result.append(NSRange(location: self.location + index, length: 1))
}
return result
}
}
| 35.040323 | 120 | 0.588953 |
559619a6f9f6780fbcd4571407fd564c05405520 | 703 | html | HTML | app/user/templates/registration/password_reset_form.html | duboisR/django-stripe | add707f91ca43522ca19b7b735196ddc16aad651 | [
"MIT"
] | null | null | null | app/user/templates/registration/password_reset_form.html | duboisR/django-stripe | add707f91ca43522ca19b7b735196ddc16aad651 | [
"MIT"
] | null | null | null | app/user/templates/registration/password_reset_form.html | duboisR/django-stripe | add707f91ca43522ca19b7b735196ddc16aad651 | [
"MIT"
] | null | null | null | {% extends 'base.html' %}
{% block extend_title %}Forgot PWD |{% endblock %}
{% block content %}
<div class="col-6 mx-auto pt-5">
<div class="border rounded p-4">
<h3 class="mb-5 text-center">Forgot password</h3>
<form method="post">
{% csrf_token %}
<div class="form-group">
<input type="text" name="email" autofocus="false" placeholder="Email" class="form-control"
required="" id="id_username">
</div>
<button type="submit" class="btn btn-lg btn-dark btn-round btn-block btn-loading shadow-sm mt-4">
Submit
</button>
</form>
</div>
</div>
{% endblock %} | 30.565217 | 109 | 0.536273 |
47908c0cbc123206fb23a6e466b7b81e41a1e7af | 306 | htm | HTML | dist/gameserver/data/html-en/quests/_194_SevenSignsMammonsContract/colin_q194_12a.htm | Arodev76/L2Advanced | 12625a32ea7114b9d1d1ac0238da8422d714fc17 | [
"MIT"
] | 7 | 2018-02-05T10:28:56.000Z | 2020-08-06T06:35:54.000Z | dist/gameserver/data/html-en/quests/_194_SevenSignsMammonsContract/colin_q194_12a.htm | Kryspo/L2jRamsheart | 98c39d754f5aba1806f92acc9e8e63b3b827be49 | [
"MIT"
] | 3 | 2020-02-26T06:49:17.000Z | 2020-03-05T05:11:05.000Z | dist/gameserver/data/html-en/quests/_194_SevenSignsMammonsContract/colin_q194_12a.htm | Kryspo/L2jRamsheart | 98c39d754f5aba1806f92acc9e8e63b3b827be49 | [
"MIT"
] | 12 | 2018-02-12T20:58:07.000Z | 2020-06-07T02:44:42.000Z | !Secret Agent Collin:
There - you're a child again. Now hurry and bring me a belonging from the old woman, all right?
Now the transformation won't last long, so move fast, and steer clear of water! You'll also want to use some of your movement skills to get you there before the illusion wears off.
Go!
| 38.25 | 180 | 0.761438 |
5ae222da8ce3145238c55a2bbf4a71a4f81e8c8a | 5,657 | rs | Rust | layout21raw/src/bbox.rs | colepoirier/Layout21 | 227c0a317619176e9b4ca87aa23cbd99526f260c | [
"BSD-3-Clause"
] | null | null | null | layout21raw/src/bbox.rs | colepoirier/Layout21 | 227c0a317619176e9b4ca87aa23cbd99526f260c | [
"BSD-3-Clause"
] | null | null | null | layout21raw/src/bbox.rs | colepoirier/Layout21 | 227c0a317619176e9b4ca87aa23cbd99526f260c | [
"BSD-3-Clause"
] | null | null | null | //!
//! # Rectangular Bounding Boxes and Associated Trait
//!
// Crates.io
use serde::{Deserialize, Serialize};
// Local imports
use crate::{
geom::{Point, Shape},
Int, Rect,
};
/// # Axis-Aligned Rectangular Bounding Box
///
/// Points `p0` and `p1` represent opposite corners of a bounding rectangle.
/// `p0` is always closest to negative-infinity, in both x and y,
/// and `p1` is always closest to positive-infinity.
///
#[derive(Debug, Default, Copy, Clone, Deserialize, Serialize, PartialEq, Eq)]
pub struct BoundBox {
pub p0: Point,
pub p1: Point,
}
impl BoundBox {
/// Create a new [BoundBox] from two [Point]s.
/// Callers are responsible for ensuring that p0.x <= p1.x, and p0.y <= p1.y.
fn new(p0: Point, p1: Point) -> Self {
Self { p0, p1 }
}
/// Create a new [BoundBox] from a single [Point].
/// The resultant [BoundBox] comprises solely the point, having zero area.
pub fn from_point(pt: &Point) -> Self {
Self {
p0: pt.clone(),
p1: pt.clone(),
}
}
/// Create a new [BoundBox] from two points
pub fn from_points(p0: &Point, p1: &Point) -> Self {
Self {
p0: Point::new(p0.x.min(p1.x), p0.y.min(p1.y)),
p1: Point::new(p0.x.max(p1.x), p0.y.max(p1.y)),
}
}
/// Create an empty, otherwise invalid [BoundBox]
pub fn empty() -> Self {
Self {
p0: Point::new(Int::MAX, Int::MAX),
p1: Point::new(Int::MIN, Int::MIN),
}
}
/// Boolean indication of whether a box is empty
pub fn is_empty(&self) -> bool {
self.p0.x > self.p1.x || self.p0.y > self.p1.y
}
/// Boolean indication of whether [Point] `pt` lies inside out box.
pub fn contains(&self, pt: &Point) -> bool {
self.p0.x <= pt.x && self.p1.x >= pt.x && self.p0.y <= pt.y && self.p1.y >= pt.y
}
/// Expand an existing [BoundBox] in all directions by `delta`
pub fn expand(&mut self, delta: Int) {
self.p0.x -= delta;
self.p0.y -= delta;
self.p1.x += delta;
self.p1.y += delta;
}
/// Get the box's size as an (x,y) tuple
pub fn size(&self) -> (Int, Int) {
(self.p1.x - self.p0.x, self.p1.y - self.p0.y)
}
/// Get the box's center
pub fn center(&self) -> Point {
Point::new((self.p0.x + self.p1.x) / 2, (self.p0.y + self.p1.y) / 2)
}
}
///
/// # Bounding Box Trait
///
/// Methods for interacting with [BoundBox]s.
/// Implementations for [Point]s, [Shape]s, and [BoundBox]s
/// enable geometric transformations such as union and intersection.
///
pub trait BoundBoxTrait {
/// Compute a rectangular bounding box around the implementing type.
fn bbox(&self) -> BoundBox;
/// Compute the intersection with rectangular bounding box `bbox`.
/// Creates and returns a new [BoundBox].
/// Default implementation is to return the intersection of `self.bbox()` and `bbox`.
fn intersection(&self, bbox: &BoundBox) -> BoundBox {
self.bbox().intersection(&bbox)
}
/// Compute the union with rectangular bounding box `bbox`.
/// Creates and returns a new [BoundBox].
/// Default implementation is to return the union of `self.bbox()` and `bbox`.
fn union(&self, bbox: &BoundBox) -> BoundBox {
self.bbox().union(&bbox)
}
}
impl BoundBoxTrait for BoundBox {
fn bbox(&self) -> BoundBox {
// We're great as we are, as a [BoundBox] already.
// Create a clone to adhere to our "new bbox" return-type.
self.clone()
}
fn intersection(&self, bbox: &BoundBox) -> BoundBox {
let pmin = Point::new(self.p0.x.max(bbox.p0.x), self.p0.y.max(bbox.p0.y));
let pmax = Point::new(self.p1.x.min(bbox.p1.x), self.p1.y.min(bbox.p1.y));
// Check for empty intersection, and return an empty box if so
if pmin.x > pmax.x || pmin.y > pmax.y {
return BoundBox::empty();
}
// Otherwise return the intersection
BoundBox::new(pmin, pmax)
}
fn union(&self, bbox: &BoundBox) -> BoundBox {
// Take the minimum and maximum of the two bounding boxes
BoundBox::new(
Point::new(self.p0.x.min(bbox.p0.x), self.p0.y.min(bbox.p0.y)),
Point::new(self.p1.x.max(bbox.p1.x), self.p1.y.max(bbox.p1.y)),
)
}
}
impl BoundBoxTrait for Point {
fn bbox(&self) -> BoundBox {
BoundBox::from_point(self)
}
fn intersection(&self, bbox: &BoundBox) -> BoundBox {
if !bbox.contains(self) {
return BoundBox::empty();
}
bbox.intersection(&BoundBox::from_point(self))
}
fn union(&self, bbox: &BoundBox) -> BoundBox {
BoundBox::new(
Point::new(self.x.min(bbox.p0.x), self.y.min(bbox.p0.y)),
Point::new(self.x.max(bbox.p1.x), self.y.max(bbox.p1.y)),
)
}
}
impl BoundBoxTrait for Shape {
fn bbox(&self) -> BoundBox {
// Dispatch based on shape-type, either two-Point or multi-Point form.
match self {
Shape::Rect(ref r) => BoundBox::from_points(&r.p0, &r.p1),
Shape::Polygon(ref p) => (&p.points).bbox(),
Shape::Path(ref p) => (&p.points).bbox(),
}
}
}
impl BoundBoxTrait for Rect {
fn bbox(&self) -> BoundBox {
BoundBox::from_points(&self.p0, &self.p1)
}
}
impl BoundBoxTrait for Vec<Point> {
fn bbox(&self) -> BoundBox {
// Take the union of all points in the vector
let mut bbox = BoundBox::empty();
for pt in self {
bbox = bbox.union(&pt.bbox());
}
bbox
}
}
| 33.473373 | 89 | 0.574156 |
e71a9018506274fe3929425ceb0e6a2195c9ffbd | 734 | js | JavaScript | 7-kyu/Find the Square Root/index.js | ayessetova/codeW | fa5479162a19b863047ea318ad728c86946a3f46 | [
"MIT"
] | 314 | 2017-12-08T16:51:31.000Z | 2022-03-30T01:59:49.000Z | 7-kyu/Find the Square Root/index.js | ayessetova/codeW | fa5479162a19b863047ea318ad728c86946a3f46 | [
"MIT"
] | 4 | 2018-04-27T03:54:20.000Z | 2020-12-06T20:13:40.000Z | 7-kyu/Find the Square Root/index.js | ayessetova/codeW | fa5479162a19b863047ea318ad728c86946a3f46 | [
"MIT"
] | 141 | 2017-12-18T18:19:13.000Z | 2022-03-29T12:16:38.000Z | /*
Title:
Find the Square Root
Description:
Create a Function that takes one parameter and returns its square root rounded to 5 decimal places.
You are not allowed to use the Math.sqrt() or the Math.pow() methods.
Notes:
Trailing zeros should be left out. For example
squareRoot(39) // => 6.245;
rather than
squareRoot(39) // => 6.24500;
Kata Link:
https://www.codewars.com/kata/find-the-square-root
Discuss Link:
https://www.codewars.com/kata/find-the-square-root/discuss
Solutions Link:
https://www.codewars.com/kata/find-the-square-root/solutions
*/
// Long Solution
const squareRoot = x => Number((x ** 0.5).toFixed(5))
// Function Export
module.exports = squareRoot
| 24.466667 | 103 | 0.685286 |
f056ae8251838894808d67cd460616e37f606b9f | 1,938 | js | JavaScript | src/components/Articles/ArticlesLarge.js | DomenART/stroydrevgroup | 11015d96f819bb1d8570a64aedcc7fce9d06edbb | [
"MIT"
] | 1 | 2019-05-23T22:57:03.000Z | 2019-05-23T22:57:03.000Z | src/components/Articles/ArticlesLarge.js | DomenART/stroydrevgroup | 11015d96f819bb1d8570a64aedcc7fce9d06edbb | [
"MIT"
] | null | null | null | src/components/Articles/ArticlesLarge.js | DomenART/stroydrevgroup | 11015d96f819bb1d8570a64aedcc7fce9d06edbb | [
"MIT"
] | null | null | null | import React, { Component } from 'react'
import classNames from 'classnames'
import urlParse from 'url-parse'
import Link from '../UI/Link'
import SvgIcon from '../UI/SvgIcon'
import styles from './ArticlesLarge.module.sass'
class ArticlesLarge extends Component {
render() {
const { title, link, thumbnail, excerpt, tags, date } = this.props
const objDate = new Date(date)
const formatDate = [
('0' + objDate.getDate()).slice(-2),
('0' + objDate.getMonth()).slice(-2),
objDate.getFullYear()
]
return (
<div className={styles.box}>
<div className={styles.headline}>
<div className={styles.tags}>
<SvgIcon name="list" />
{tags}
</div>
<div className={styles.date}>
<SvgIcon name="schedule" />
{formatDate.join('.')}
</div>
</div>
<div
className={styles.title}
dangerouslySetInnerHTML={{__html:title.rendered}}
/>
{thumbnail && (
<div className={styles.image}>
<img src={thumbnail} />
</div>
)}
{excerpt && (
<div
className={styles.intro}
dangerouslySetInnerHTML={{__html:excerpt.rendered}}
/>
)}
<Link
to={urlParse(link).pathname}
className={classNames(styles.more, 'button-jitney')}
>
<span>читать </span>полностью
<SvgIcon name="arrow-right" />
</Link>
</div>
)
}
}
export default ArticlesLarge | 34 | 75 | 0.437049 |
5fb2dc0ed4ef9c084300299a5e6ce1b8fb549683 | 1,713 | css | CSS | assets/css/style.css | khnguyen94/NBA-Trivia | 573a04ae73306940b2f559749b58e5d35df6b944 | [
"MIT"
] | null | null | null | assets/css/style.css | khnguyen94/NBA-Trivia | 573a04ae73306940b2f559749b58e5d35df6b944 | [
"MIT"
] | null | null | null | assets/css/style.css | khnguyen94/NBA-Trivia | 573a04ae73306940b2f559749b58e5d35df6b944 | [
"MIT"
] | null | null | null | html {
height: 100%;
}
body {
background-image: url("../images/court-background.jpg");
background-repeat: no-repeat;
background-size: 100rem;
background-attachment: fixed;
background-position: center;
height: 100%;
}
#app-wrapper {
height: 90%;
box-sizing: border-box;
margin: 2.5% auto;
display: flex;
justify-content: center;
align-items: center;
}
.jumbotron {
width: 95%;
height: 90%;
outline: grey solid 2px;
text-align: center;
background-color: rgba(0, 0, 0, 0.5);
}
#app-title {
background-color: white;
height: 10%;
display: flex;
justify-content: center;
align-items: center;
}
hr{
border: 2px solid rgba(43, 43, 43, 0.5);
border-radius: 5px;
}
#main-display {
outline: grey solid 2px;
background-color: white;
text-align: center;
height: 85%;
display: flex;
justify-content: center;
align-items: center;
}
#trivia-area-disp {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
#start-btn {
display: block;
width: 15%;
height: 8%;
display: inline-block;
vertical-align: middle;
}
#score-area-row {
text-align: center;
height: 30%;
width: 75%;
display: block;
justify-content: center;
align-items: center;
clear: both;
}
#score-jumbotron {
height: 50%;
}
#score-area-disp {
width: 100%;
height: 40%;
display: flex;
justify-content: center;
align-items: center;
clear: both;
}
#question-area-disp {
width: 80%;
height: 40%;
display: flex;
justify-content: center;
align-items: center;
clear: both;
}
| 16.314286 | 60 | 0.598949 |
e9532f24592c48ae3041a15182ad502ad19ce5a4 | 3,734 | rs | Rust | src/lib.rs | 1011X/inkml | f2fea66841307f7220acdccbd0963ec942ca4175 | [
"MIT"
] | null | null | null | src/lib.rs | 1011X/inkml | f2fea66841307f7220acdccbd0963ec942ca4175 | [
"MIT"
] | null | null | null | src/lib.rs | 1011X/inkml | f2fea66841307f7220acdccbd0963ec942ca4175 | [
"MIT"
] | null | null | null | // TODO:
// + what will the api look like?
// + will it be like the xml and svg crates, i.e. with events?
// + or more "high-level" than that?
// + ...or both?
// + is an api like svg's necessary if xml-rs can already achieve the same thing?
// + how will the data be presented?
// + what fields will be public?
// + how will modules be organized/structured?
//
//
pub mod parse;
pub mod node;
//mod channel;
//mod context;
//mod brush;
/*
mod elements {
mod definitions;
mod context;
mod trace;
mod traceGroup;
mod traceView;
mod annotation;
mod annotationXML;
}
*/
use self::parse::Trace;
use std::io::Read;
use xml::reader::XmlEvent;
use xml::name::OwnedName;
//use xml::attribute::{Attribute, OwnedAttribute};
use xml::reader::Result as XmlResult;
struct Ink {
//document_id: Option<String>,
traces: Vec<Trace>,
/*
children: Vec<Box<dyn Node>>,
definitions: Vec<Definition>,
contexts: Vec<Context>,
trace_groups: Vec<TraceGroup>,
trace_views: Vec<TraceView>,
annotations: Vec<Annotation>,
annotations_xml: Vec<AnnotationXML>,
*/
}
impl Ink {
fn parse<R: Read>(er: &mut xml::reader::EventReader<R>) -> XmlResult<Self> {
use XmlEvent::*;
let mut traces = Vec::new();
loop {
match er.next()? {
EndElement { name: OwnedName { local_name, .. } }
if local_name == "ink" => break,
StartElement { name: OwnedName { local_name, .. }, .. }
if local_name == "trace" => {
let trace = Trace::parse(er)?;
traces.push(trace);
}
_ => unimplemented!()
}
}
Ok(Ink { traces })
}
}
/*
value ::= difference_order? wsp* "-"? wsp* number | "T" | "F" | "*" | "?"
number ::= (decimal | double | hex)
double ::= decimal ("e"|"E") ("+"|"-")? digit+
decimal ::= digit+ ("." digit*)? | "." digit+
difference_order ::= ("!" | "'" | '"')
*/
//enum DifferenceOrder { First, Second, Third }
pub static INKML_URI: &str = "http://www.w3.org/2003/InkML";
fn open<R: Read>(source: R) -> XmlResult<Ink> {
let mut reader = xml::EventReader::new(source);
let mut ink = Ink { traces: Vec::new() };
let mut path = Vec::new();
loop {
match reader.next()? {
XmlEvent::StartDocument { .. } => {}
XmlEvent::Whitespace(_) => {}
XmlEvent::EndDocument => break,
XmlEvent::StartElement { name: OwnedName { local_name, .. }, .. } => {
path.push(local_name.clone());
}
XmlEvent::Characters(data) => {
println!("got chars: {}", data);
if path.last().unwrap() == "trace" {
match Trace::parse_content(&data) {
Ok(points) =>
ink.traces.push(Trace { content: points }),
Err(e) => panic!("{:?}", e),
}
}
}
XmlEvent::EndElement { name: OwnedName { local_name, .. } } => {
assert_eq!(path.pop().unwrap(), local_name);
}
evt => {
println!("{:?}", evt);
unimplemented!()
}
}
}
Ok(ink)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn read_minimal() {
let test: &[u8] = include_bytes!("minimal.ink");
open(test).unwrap();
}
#[test]
fn read_hello() {
let test: &[u8] = include_bytes!("hello.ink");
open(test).unwrap();
}
}
| 24.728477 | 83 | 0.491162 |
f0430557dbfd094f1b6f8f4b8c1e8e82129f2452 | 6,822 | js | JavaScript | dist/models/state-models.js | a9udn9u/last-step | 7e7e95ed52f8f8af9cb0621ac618859f95843cc1 | [
"MIT"
] | 2 | 2017-03-28T00:16:40.000Z | 2018-11-18T06:24:54.000Z | dist/models/state-models.js | a9udn9u/last-step | 7e7e95ed52f8f8af9cb0621ac618859f95843cc1 | [
"MIT"
] | null | null | null | dist/models/state-models.js | a9udn9u/last-step | 7e7e95ed52f8f8af9cb0621ac618859f95843cc1 | [
"MIT"
] | null | null | null | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("~/utils");
/**
* Simple 1-to-M mapping
*/
class OneToMany extends Map {
constructor() {
super();
}
}
/**
* Target to sources mapping
*/
class TargetToSources extends OneToMany {
/**
* Key is the target file, value is a set of sources that contribute
* to the target
*/
constructor() {
super();
}
/**
* For each target, trace sources back to their original sources
* @param {Object} oldTts Old targetToSourcesMap
*/
trace(oldTTS) {
this.forEach((values, key) => {
let newValues = Array.from(values)
.map(v => oldTTS.get(v))
.filter(vals => !!vals)
.reduce((all, vals) => utils_1.Utils.union(all, vals), new Set());
this.set(key, newValues);
});
}
/**
* Create a new map with flipped key/values
*/
flip() {
let flipped = new SourceToTargets();
this.forEach((values, key) => {
values.forEach(val => {
let rev = flipped.get(val) || new Set();
rev.add(key);
flipped.set(val, rev);
});
});
return flipped;
}
}
exports.TargetToSources = TargetToSources;
class SourceToTargets extends OneToMany {
}
exports.SourceToTargets = SourceToTargets;
class Context {
constructor(packed = {}) {
this.rootDir = packed.rootDir;
this.sourceDir = packed.sourceDir;
this.workDir = packed.workDir;
this.index = packed.index;
this.input = packed.input;
this.output = packed.output;
this.targetToSources = packed.targetToSources;
this.sourceToTargets = packed.sourceToTargets;
}
}
exports.Context = Context;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhdGUtbW9kZWxzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL21vZGVscy9zdGF0ZS1tb2RlbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxtQ0FBZ0M7QUFJaEM7O0dBRUc7QUFDSCxlQUFtQixTQUFRLEdBQWM7SUFDdkM7UUFDRSxLQUFLLEVBQUUsQ0FBQztJQUNWLENBQUM7Q0FDRjtBQUVEOztHQUVHO0FBQ0gscUJBQTZCLFNBQVEsU0FBaUI7SUFDcEQ7OztPQUdHO0lBQ0g7UUFDRSxLQUFLLEVBQUUsQ0FBQztJQUNWLENBQUM7SUFFRDs7O09BR0c7SUFDSCxLQUFLLENBQUMsTUFBdUI7UUFDM0IsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDLE1BQU0sRUFBRSxHQUFHLEVBQUUsRUFBRTtZQUMzQixJQUFJLFNBQVMsR0FBRyxLQUFLLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQztpQkFDN0IsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQztpQkFDdkIsTUFBTSxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQztpQkFDdEIsTUFBTSxDQUFDLENBQUMsR0FBRyxFQUFFLElBQUksRUFBRSxFQUFFLENBQUMsYUFBSyxDQUFDLEtBQUssQ0FBQyxHQUFHLEVBQUUsSUFBSSxDQUFDLEVBQUUsSUFBSSxHQUFHLEVBQUUsQ0FBQyxDQUFDO1lBQzlELElBQUksQ0FBQyxHQUFHLENBQUMsR0FBRyxFQUFFLFNBQVMsQ0FBQyxDQUFDO1FBQzNCLENBQUMsQ0FBQyxDQUFDO0lBQ0wsQ0FBQztJQUVEOztPQUVHO0lBQ0gsSUFBSTtRQUNGLElBQUksT0FBTyxHQUFvQixJQUFJLGVBQWUsRUFBRSxDQUFDO1FBQ3JELElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQyxNQUFNLEVBQUUsR0FBRyxFQUFFLEVBQUU7WUFDM0IsTUFBTSxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsRUFBRTtnQkFDbkIsSUFBSSxHQUFHLEdBQUcsT0FBTyxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsSUFBSSxJQUFJLEdBQUcsRUFBVSxDQUFDO2dCQUNoRCxHQUFHLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxDQUFDO2dCQUNiLE9BQU8sQ0FBQyxHQUFHLENBQUMsR0FBRyxFQUFFLEdBQUcsQ0FBQyxDQUFDO1lBQ3hCLENBQUMsQ0FBQyxDQUFDO1FBQ0wsQ0FBQyxDQUFDLENBQUM7UUFDSCxNQUFNLENBQUMsT0FBTyxDQUFDO0lBQ2pCLENBQUM7Q0FDRjtBQXJDRCwwQ0FxQ0M7QUFFRCxxQkFBNkIsU0FBUSxTQUFpQjtDQUNyRDtBQURELDBDQUNDO0FBRUQ7SUFVRSxZQUFZLFNBQWMsRUFBRTtRQUMxQixJQUFJLENBQUMsT0FBTyxHQUFHLE1BQU0sQ0FBQyxPQUFPLENBQUM7UUFDOUIsSUFBSSxDQUFDLFNBQVMsR0FBRyxNQUFNLENBQUMsU0FBUyxDQUFDO1FBQ2xDLElBQUksQ0FBQyxPQUFPLEdBQUcsTUFBTSxDQUFDLE9BQU8sQ0FBQztRQUM5QixJQUFJLENBQUMsS0FBSyxHQUFHLE1BQU0sQ0FBQyxLQUFLLENBQUM7UUFDMUIsSUFBSSxDQUFDLEtBQUssR0FBRyxNQUFNLENBQUMsS0FBSyxDQUFDO1FBQzFCLElBQUksQ0FBQyxNQUFNLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQztRQUM1QixJQUFJLENBQUMsZUFBZSxHQUFHLE1BQU0sQ0FBQyxlQUFlLENBQUM7UUFDOUMsSUFBSSxDQUFDLGVBQWUsR0FBRyxNQUFNLENBQUMsZUFBZSxDQUFDO0lBQ2hELENBQUM7Q0FDRjtBQXBCRCwwQkFvQkMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBVdGlscyB9IGZyb20gJ34vdXRpbHMnO1xuaW1wb3J0IHsgUHJvY2Vzc29ySW5wdXQsIFByb2Nlc3Nvck91dHB1dCB9IGZyb20gJ34vbW9kZWxzL3Byb2Nlc3Nvci1tb2RlbHMnO1xuaW1wb3J0IHsgUHJvY2Vzc29yIH0gZnJvbSAnfi9wcm9jZXNzb3JzL3Byb2Nlc3Nvcic7XG5cbi8qKlxuICogU2ltcGxlIDEtdG8tTSBtYXBwaW5nXG4gKi9cbmNsYXNzIE9uZVRvTWFueTxUPiBleHRlbmRzIE1hcDxULCBTZXQ8VD4+IHtcbiAgY29uc3RydWN0b3IoKSB7XG4gICAgc3VwZXIoKTtcbiAgfVxufVxuXG4vKipcbiAqIFRhcmdldCB0byBzb3VyY2VzIG1hcHBpbmdcbiAqL1xuZXhwb3J0IGNsYXNzIFRhcmdldFRvU291cmNlcyBleHRlbmRzIE9uZVRvTWFueTxzdHJpbmc+IHtcbiAgLyoqXG4gICAqIEtleSBpcyB0aGUgdGFyZ2V0IGZpbGUsIHZhbHVlIGlzIGEgc2V0IG9mIHNvdXJjZXMgdGhhdCBjb250cmlidXRlXG4gICAqIHRvIHRoZSB0YXJnZXRcbiAgICovXG4gIGNvbnN0cnVjdG9yKCkge1xuICAgIHN1cGVyKCk7XG4gIH1cblxuICAvKipcbiAgICogRm9yIGVhY2ggdGFyZ2V0LCB0cmFjZSBzb3VyY2VzIGJhY2sgdG8gdGhlaXIgb3JpZ2luYWwgc291cmNlc1xuICAgKiBAcGFyYW0ge09iamVjdH0gb2xkVHRzIE9sZCB0YXJnZXRUb1NvdXJjZXNNYXBcbiAgICovXG4gIHRyYWNlKG9sZFRUUzogVGFyZ2V0VG9Tb3VyY2VzKTogdm9pZCB7XG4gICAgdGhpcy5mb3JFYWNoKCh2YWx1ZXMsIGtleSkgPT4ge1xuICAgICAgbGV0IG5ld1ZhbHVlcyA9IEFycmF5LmZyb20odmFsdWVzKVxuICAgICAgICAgIC5tYXAodiA9PiBvbGRUVFMuZ2V0KHYpKVxuICAgICAgICAgIC5maWx0ZXIodmFscyA9PiAhIXZhbHMpXG4gICAgICAgICAgLnJlZHVjZSgoYWxsLCB2YWxzKSA9PiBVdGlscy51bmlvbihhbGwsIHZhbHMpLCBuZXcgU2V0KCkpO1xuICAgICAgdGhpcy5zZXQoa2V5LCBuZXdWYWx1ZXMpO1xuICAgIH0pO1xuICB9XG5cbiAgLyoqXG4gICAqIENyZWF0ZSBhIG5ldyBtYXAgd2l0aCBmbGlwcGVkIGtleS92YWx1ZXNcbiAgICovXG4gIGZsaXAoKTogU291cmNlVG9UYXJnZXRzIHtcbiAgICBsZXQgZmxpcHBlZDogU291cmNlVG9UYXJnZXRzID0gbmV3IFNvdXJjZVRvVGFyZ2V0cygpO1xuICAgIHRoaXMuZm9yRWFjaCgodmFsdWVzLCBrZXkpID0+IHtcbiAgICAgIHZhbHVlcy5mb3JFYWNoKHZhbCA9PiB7XG4gICAgICAgIGxldCByZXYgPSBmbGlwcGVkLmdldCh2YWwpIHx8IG5ldyBTZXQ8c3RyaW5nPigpO1xuICAgICAgICByZXYuYWRkKGtleSk7XG4gICAgICAgIGZsaXBwZWQuc2V0KHZhbCwgcmV2KTtcbiAgICAgIH0pO1xuICAgIH0pO1xuICAgIHJldHVybiBmbGlwcGVkO1xuICB9XG59XG5cbmV4cG9ydCBjbGFzcyBTb3VyY2VUb1RhcmdldHMgZXh0ZW5kcyBPbmVUb01hbnk8c3RyaW5nPiB7XG59XG5cbmV4cG9ydCBjbGFzcyBDb250ZXh0IHtcbiAgcm9vdERpcjogc3RyaW5nO1xuICBzb3VyY2VEaXI6IHN0cmluZztcbiAgd29ya0Rpcjogc3RyaW5nO1xuICBpbmRleDogbnVtYmVyO1xuICBpbnB1dDogUHJvY2Vzc29ySW5wdXQ7XG4gIG91dHB1dDogUHJvY2Vzc29yT3V0cHV0O1xuICB0YXJnZXRUb1NvdXJjZXM6IFRhcmdldFRvU291cmNlcztcbiAgc291cmNlVG9UYXJnZXRzOiBTb3VyY2VUb1RhcmdldHM7XG5cbiAgY29uc3RydWN0b3IocGFja2VkOiBhbnkgPSB7fSkge1xuICAgIHRoaXMucm9vdERpciA9IHBhY2tlZC5yb290RGlyO1xuICAgIHRoaXMuc291cmNlRGlyID0gcGFja2VkLnNvdXJjZURpcjtcbiAgICB0aGlzLndvcmtEaXIgPSBwYWNrZWQud29ya0RpcjtcbiAgICB0aGlzLmluZGV4ID0gcGFja2VkLmluZGV4O1xuICAgIHRoaXMuaW5wdXQgPSBwYWNrZWQuaW5wdXQ7XG4gICAgdGhpcy5vdXRwdXQgPSBwYWNrZWQub3V0cHV0O1xuICAgIHRoaXMudGFyZ2V0VG9Tb3VyY2VzID0gcGFja2VkLnRhcmdldFRvU291cmNlcztcbiAgICB0aGlzLnNvdXJjZVRvVGFyZ2V0cyA9IHBhY2tlZC5zb3VyY2VUb1RhcmdldHM7XG4gIH1cbn0iXX0= | 100.323529 | 4,970 | 0.880827 |
cb6d2278c36538a57e3c5dbd40ff6e59281167a7 | 3,505 | go | Go | main.go | kscarlett/nginx-log-generator | afd35e6114802159da59685f758a7c082ec5e434 | [
"MIT"
] | 37 | 2020-01-09T13:40:39.000Z | 2022-03-16T12:33:34.000Z | main.go | kscarlett/nginx-log-generator | afd35e6114802159da59685f758a7c082ec5e434 | [
"MIT"
] | 1 | 2022-03-24T16:51:21.000Z | 2022-03-24T16:51:21.000Z | main.go | kscarlett/nginx-log-generator | afd35e6114802159da59685f758a7c082ec5e434 | [
"MIT"
] | 5 | 2020-11-21T19:55:37.000Z | 2021-12-13T09:29:22.000Z | package main
import (
"fmt"
"strings"
"time"
"github.com/brianvoe/gofakeit/v6"
"github.com/caarlos0/env/v6"
)
type config struct {
Rate float32 `env:"RATE" envDefault:"1"`
IPv4Percent int `env:"IPV4_PERCENT" envDefault:"100"`
StatusOkPercent int `env:"STATUS_OK_PERCENT" envDefault:"80"`
PathMinLength int `env:"PATH_MIN" envDefault:"1"`
PathMaxLength int `env:"PATH_MAX" envDefault:"5"`
PercentageGet int `env:"GET_PERCENT" envDefault:"60"`
PercentagePost int `env:"POST_PERCENT" envDefault:"30"`
PercentagePut int `env:"PUT_PERCENT" envDefault:"0"`
PercentagePatch int `env:"PATCH_PERCENT" envDefault:"0"`
PercentageDelete int `env:"DELETE_PERCENT" envDefault:"0"`
}
func main() {
cfg := config{}
if err := env.Parse(&cfg); err != nil {
panic(err)
}
checkMinMax(&cfg.PathMinLength, &cfg.PathMaxLength)
ticker := time.NewTicker(time.Second / time.Duration(cfg.Rate))
gofakeit.Seed(time.Now().UnixNano())
var ip, httpMethod, path, httpVersion, referrer, userAgent string
var statusCode, bodyBytesSent int
var timeLocal time.Time
httpVersion = "HTTP/1.1"
referrer = "-"
for range ticker.C {
timeLocal = time.Now()
ip = weightedIPVersion(cfg.IPv4Percent)
httpMethod = weightedHTTPMethod(cfg.PercentageGet, cfg.PercentagePost, cfg.PercentagePut, cfg.PercentagePatch, cfg.PercentageDelete)
path = randomPath(cfg.PathMinLength, cfg.PathMaxLength)
statusCode = weightedStatusCode(cfg.StatusOkPercent)
bodyBytesSent = realisticBytesSent(statusCode)
userAgent = gofakeit.UserAgent()
fmt.Printf("%s - - [%s] \"%s %s %s\" %v %v \"%s\" \"%s\"\n", ip, timeLocal.Format("02/Jan/2006:15:04:05 -0700"), httpMethod, path, httpVersion, statusCode, bodyBytesSent, referrer, userAgent)
}
}
func realisticBytesSent(statusCode int) int {
if statusCode != 200 {
return gofakeit.Number(30, 120)
}
return gofakeit.Number(800, 3100)
}
func weightedStatusCode(percentageOk int) int {
roll := gofakeit.Number(0, 100)
if roll <= percentageOk {
return 200
}
return gofakeit.HTTPStatusCodeSimple()
}
func weightedHTTPMethod(percentageGet, percentagePost, percentagePut, percentagePatch, percentageDelete int) string {
if percentageGet+percentagePost >= 100 {
panic("HTTP method percentages add up to more than 100%")
}
roll := gofakeit.Number(0, 100)
if roll <= percentageGet {
return "GET"
} else if roll <= percentagePost {
return "POST"
} else if roll <= percentagePut {
return "PUT"
} else if roll <= percentagePatch {
return "PATCH"
} else if roll <= percentageDelete {
return "DELETE"
}
return gofakeit.HTTPMethod()
}
func weightedIPVersion(percentageIPv4 int) string {
roll := gofakeit.Number(0, 100)
if roll <= percentageIPv4 {
return gofakeit.IPv4Address()
} else {
return gofakeit.IPv6Address()
}
}
func randomPath(min, max int) string {
var path strings.Builder
length := gofakeit.Number(min, max)
path.WriteString("/")
for i := 0; i < length; i++ {
if i > 0 {
path.WriteString(gofakeit.RandomString([]string{"-", "-", "_", "%20", "/", "/", "/"}))
}
path.WriteString(gofakeit.BuzzWord())
}
path.WriteString(gofakeit.RandomString([]string{".hmtl", ".php", ".htm", ".jpg", ".png", ".gif", ".svg", ".css", ".js"}))
result := path.String()
return strings.Replace(result, " ", "%20", -1)
}
func checkMinMax(min, max *int) {
if *min < 1 {
*min = 1
}
if *max < 1 {
*max = 1
}
if *min > *max {
*min, *max = *max, *min
}
}
| 26.156716 | 193 | 0.679315 |
0ee04d971595e99d456de4640f915ca4e86c3100 | 3,041 | h | C | include/book.h | hdp1213/billionaire | 96a2138665c9f546971a6a732ee5f56609a7f598 | [
"MIT"
] | null | null | null | include/book.h | hdp1213/billionaire | 96a2138665c9f546971a6a732ee5f56609a7f598 | [
"MIT"
] | null | null | null | include/book.h | hdp1213/billionaire | 96a2138665c9f546971a6a732ee5f56609a7f598 | [
"MIT"
] | null | null | null | #ifndef _BOOK_H_
#define _BOOK_H_
#include <stdlib.h>
#include <stdbool.h>
#include <json-c/json.h>
#include "card_location.h"
#include "utils.h"
#define OFFER_INDEX_OFFSET 2
#define MAX_PARTICIPANTS 2
typedef struct book book;
typedef struct offer offer;
/**
* Struct storing current offers.
*/
struct book {
/**
* Zero-indexed array containing offers.
*/
offer* offers[(TOTAL_COMMODITY_AMOUNT + 1) - OFFER_INDEX_OFFSET];
};
/**
* Struct storing offers.
*/
struct offer {
/**
* ID of the owner of this offer.
*/
char owner_id[HASH_LENGTH];
/**
* Cards involved in offer.
*/
card_location* cards;
};
/**
* Create a new empty book.
*/
book* book_new();
/**
* Check if there is an offer already in the book at some index.
*/
bool offer_at(book* book_obj, int offer_ind);
/**
* Check if there is no offer already in the book at some index.
*/
bool no_offer_at(book* book_obj, int offer_ind);
/**
* Set an offer in the book at a given index to a given offer.
*/
void set_offer_at(book* book_obj, int offer_ind, offer* offer_obj);
/**
* Get an offer from a book at a given index.
*/
offer* get_offer_at(book* book_obj, int offer_ind);
/**
* Remove an offer from the book.
*
* NOTE: this method does not free the removed offer from memory.
*/
void remove_offer_at(book* book_obj, int offer_ind);
/**
* Add an offer to the book, or return one that is ready to complete.
*
* Sets cmd_errno to EOFFEROVER, on failure returns NULL.
*/
offer* fill_offer(book* book_obj, offer* offer_obj);
/**
* Remove an offer from the book if it exists and belongs to the client.
*
* Sets cmd_errno to ECANEMPTY or ECANPERM, on failure returns NULL.
*/
offer* cancel_offer(book* book_obj, size_t card_amt, const char* client_id);
/**
* Removes all current offers in book and frees associated memory.
*/
void clear_book(book* book_obj);
/**
* Free a book.
*/
void free_book(book* book_obj);
/**
* Convert an offer struct to a JSON object offer.
*
* Only used in check_book.c to confirm offer JSON works.
*/
json_object* JSON_from_offer(offer* offer_obj);
/**
* Create a new empty offer.
*/
offer* offer_new();
/**
* Initialise an offer struct with cards and the offer owner's ID.
*/
offer* offer_init(card_location* cards, const char* owner_id);
/**
* Initialise an offer struct with a number of cards.
*
* Used for testing purposes only.
*/
offer* offer_init_cards(card_id card, size_t amount, const char* owner_id);
/**
* Get the index of an offer corresponding to its place in a book.
*/
int get_offer_index(offer* offer_obj);
/**
* Return the offset index corresponding to the number of cards in a trade.
*/
int offset_index(size_t card_amt);
/**
* Check if a prospective owner actually owns the offer in question.
*/
bool is_owner(offer* offer_obj, const char* prospective_owner_id);
/**
* Check if two offers have the same owner.
*/
bool have_same_owner(offer* offer1, offer* offer2);
/**
* Free an offer.
*/
void free_offer(offer* offer_obj);
#endif
| 20.273333 | 76 | 0.699112 |
5a948b17bf5c78c6101424ac9c19a5ada0957d8a | 17,644 | pck | SQL | dataplots/THERM_00/120/aS120_gr3.700_mu0.104_T1.090.pck | PedroMDuarte/hubbard-lda3 | 485b290c7bff97143f6f865b88131620f63282d7 | [
"Unlicense",
"MIT"
] | 2 | 2020-12-20T03:05:02.000Z | 2021-01-18T13:50:33.000Z | dataplots/THERM_00/120/aS120_gr3.700_mu0.104_T1.090.pck | liangjj/hubbard-lda3 | 47c3257140da265cd9e74be1a8a04b45844cba48 | [
"Unlicense",
"MIT"
] | null | null | null | dataplots/THERM_00/120/aS120_gr3.700_mu0.104_T1.090.pck | liangjj/hubbard-lda3 | 47c3257140da265cd9e74be1a8a04b45844cba48 | [
"Unlicense",
"MIT"
] | 6 | 2015-04-24T08:18:27.000Z | 2021-02-06T12:26:31.000Z | (dp0
S'gr'
p1
F3.7
sS'k111'
p2
NsS't111'
p3
cnumpy.core.multiarray
_reconstruct
p4
(cnumpy
ndarray
p5
(I0
tp6
S'b'
p7
tp8
Rp9
(I1
(I80
tp10
cnumpy
dtype
p11
(S'f8'
p12
I0
I1
tp13
Rp14
(I3
S'<'
p15
NNNI-1
I-1
I0
tp16
bI00
S'`{,\x1f\xff\xb3\xb5?+\xd3\xbds\xbe\r\xb5?\xbb\xb4\xbb\x13\x93r\xb4?\x00\xcd\x8d\xcb}\xd7\xb3?\x05\xd4J-\xb7<\xb3?\xeb\xc7\xb6\x95\x1a\xb2\xb2?\xcb\xf0\xdf\xed:(\xb2?\xe0\xe6<\xdf@\x9f\xb1?\xeb\xfe\x9a\xc9\x9c\x1f\xb1?\xebU\x86\x81\xc6\xa6\xb0?\x0bk\xaf\x85S/\xb0?\xb5\x0b\xb9t\x05u\xaf?\xc0\xd4\xcf\x84}\xa4\xae?k\x9a\x7f\xeb\x84\xd7\xad?\x8b\xdb\x14\xb4v\x0e\xad?5\xd1p\xb6AQ\xac? \xfd\xae\x1a\x9a\xa4\xab?\xab\xf1\xc8Pi\xfc\xaa?\x002\x1b:\xfeX\xaa?\xab\x8e\x1a\x86\xd2\xbf\xa9?@\xb3P\xb3Q6\xa9?k\xb6o\xc0\xe7\xb1\xa8?\x0b\xe4\xec\x89\xd52\xa8?\x80\x93\x99\xe3Y\xb9\xa7?\xeb\xac\x8e\xbf\xc0L\xa7?\xd5\xb0\xd0\x9b+\xea\xa6?\xd5\xf2`\xea9\x8d\xa6?\x00\xeaW\x19\x1b6\xa6?UB\xb5\xe8\xfb\xe4\xa5?+\xec\x18D\x06\x9a\xa5?+\x8f\x9c\x04,W\xa5?@7\xe7.2\x1f\xa5?\xd5\x96\x05\xf0$\xed\xa4?\x80\xd0~\xa4\x1e\xc1\xa4?k\x9b-\x916\x9b\xa4?\xd5+\xc2\xce\x80{\xa4?\xf5n\x018\x0eb\xa4?\xab\x8d\xd7Z\xecN\xa4?\x0b7Pl%B\xa4?\x00\xa5\x83?\xc0;\xa4?\x00\xa5\x83?\xc0;\xa4?\x0b7Pl%B\xa4?\xab\x8d\xd7Z\xecN\xa4?\xf5n\x018\x0eb\xa4?\xd5+\xc2\xce\x80{\xa4?k\x9b-\x916\x9b\xa4?\x80\xd0~\xa4\x1e\xc1\xa4?\xd5\x96\x05\xf0$\xed\xa4?@7\xe7.2\x1f\xa5?+\x8f\x9c\x04,W\xa5?+\xec\x18D\x06\x9a\xa5?UB\xb5\xe8\xfb\xe4\xa5?\x00\xeaW\x19\x1b6\xa6?\xd5\xf2`\xea9\x8d\xa6?\xc0\xb0\xd0\x9b+\xea\xa6?\xe0\xac\x8e\xbf\xc0L\xa7?\x80\x93\x99\xe3Y\xb9\xa7?\x0b\xe4\xec\x89\xd52\xa8?k\xb6o\xc0\xe7\xb1\xa8?@\xb3P\xb3Q6\xa9?\xab\x8e\x1a\x86\xd2\xbf\xa9?\x002\x1b:\xfeX\xaa?\xab\xf1\xc8Pi\xfc\xaa?5\xfd\xae\x1a\x9a\xa4\xab?5\xd1p\xb6AQ\xac?\x8b\xdb\x14\xb4v\x0e\xad?k\x9a\x7f\xeb\x84\xd7\xad?\xc0\xd4\xcf\x84}\xa4\xae?\xb5\x0b\xb9t\x05u\xaf?\x05k\xaf\x85S/\xb0?\xf0U\x86\x81\xc6\xa6\xb0?\xe0\xfe\x9a\xc9\x9c\x1f\xb1?\xe5\xe6<\xdf@\x9f\xb1?\xd0\xf0\xdf\xed:(\xb2?\xeb\xc7\xb6\x95\x1a\xb2\xb2?\x05\xd4J-\xb7<\xb3?\x00\xcd\x8d\xcb}\xd7\xb3?\xbb\xb4\xbb\x13\x93r\xb4?+\xd3\xbds\xbe\r\xb5?`{,\x1f\xff\xb3\xb5?'
p17
tp18
bsS'muPlus'
p19
F0.104
sS'spi111'
p20
g4
(g5
(I0
tp21
g7
tp22
Rp23
(I1
(I80
tp24
g14
I00
S'\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\xda\xa0\xb3/\x1b\x01\xf0?\xfa\xe8\xf6r\xf6\x19\xf0?\xed\xa7\x15t\x047\xf0?R\xb8\x1e\x85\xebQ\xf0?c\xa3\xd5"8\x82\xf0?U!\x06\x14\x15\xb7\xf0?\x83\x84T;\xd1\xed\xf0?\xdcG\x83a\n@\xf1?\x9d\x9bb)#\xb5\xf1?*\x07\xca{\x95\x15\xf2?2\x11\xd5\xba\xac\x8b\xf2?6s\xba\x84\xa1\x9c\xf2?\xaa\x8a\x95sI\xce\xf2?aEo\xc3\x1c\x8d\xf2?\xedDL[\x8d\xa1\xf1?\n\xd6\xbb\x9f\xe7\x91\xf0?\xb7\x88\x97\x8b.]\xef?G:\xbcM\xdd\xea\xec? [6)\x11[\xea?l\x8e\x95\xf4\x8c\x9a\xe8?\x8e\xeb\x1d\x12.\xf4\xe6?"\x8b\xdf\x88zo\xe5?\x82\x0f\xebJ\x8ca\xe4?\xb0l\xeb\xc6\x10q\xe3?\xe9_\x0c"\xee\xba\xe2?\xcd[\x94\xc0?4\xe2??lIu\xa4\xdc\xe1?\xbf\xeb!\xa0\xc4\xb0\xe1?\xbf\xeb!\xa0\xc4\xb0\xe1??lIu\xa4\xdc\xe1?\xcd[\x94\xc0?4\xe2?\xe9_\x0c"\xee\xba\xe2?Zl\xeb\xc6\x10q\xe3?\x82\x0f\xebJ\x8ca\xe4?"\x8b\xdf\x88zo\xe5?\x8e\xeb\x1d\x12.\xf4\xe6?\xde\x8e\x95\xf4\x8c\x9a\xe8? [6)\x11[\xea?G:\xbcM\xdd\xea\xec?\xb7\x88\x97\x8b.]\xef?\n\xd6\xbb\x9f\xe7\x91\xf0?\xedDL[\x8d\xa1\xf1?\x86Eo\xc3\x1c\x8d\xf2?\xa6\x8a\x95sI\xce\xf2?6s\xba\x84\xa1\x9c\xf2?2\x11\xd5\xba\xac\x8b\xf2?*\x07\xca{\x95\x15\xf2?\x9d\x9bb)#\xb5\xf1?\xdcG\x83a\n@\xf1?\x8a\x84T;\xd1\xed\xf0?U!\x06\x14\x15\xb7\xf0?a\xa3\xd5"8\x82\xf0?R\xb8\x1e\x85\xebQ\xf0?\xed\xa7\x15t\x047\xf0?\xee\xe8\xf6r\xf6\x19\xf0?\xda\xa0\xb3/\x1b\x01\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?'
p25
tp26
bsS'U111'
p27
g4
(g5
(I0
tp28
g7
tp29
Rp30
(I1
(I80
tp31
g14
I00
S'\xa4$\xb5v\xdbm\xf3?\xaa\x92\xa3\xb5\x0b\x9d\xf4?\xaa\xbe\x8d\x83\x95\xd4\xf5?\xe9x\'\x92\xf7\x1e\xf7?\n\xa7\x12\x15q}\xf8?\xba\xbcF\xbe\xa4\xdb\xf9?\xcdmM\xdb\xc3L\xfb?\xa2\x05\x18\t\xa4\xd1\xfc?\x9d\x88?\xc1\x89\\\xfe?\xdf\xa8\xbcS=\xf0\xff?Q\x02\x13F9\xcb\x00@\x8e\xc5\xf5\x1d\xa1\xa6\x01@\x15\xf0\xc1\x18y~\x02@\xf3z\x81g\x05^\x03@\xac\xd2\xf3\xe0iD\x04@X\xf9\x1d\xfd\xa0,\x05@\x99\xe0\xeb\t\xb6\x11\x06@\xb5\xbb\xfa^\xe1\xfb\x06@k\x9d:[\x97\xea\x07@\x8f\xd1\xc8i1\xd8\x08@\x04\xebd\xc7\xc0\xbd\t@Q\x1a\xcd\xb5"\xa3\n@\xbakq\x9dP\x88\x0b@\x08~\x13\xecal\x0c@tbT%GE\r@\xa2K\x9cf\x8c\x14\x0e@\x10\xbe\xc5lr\xde\x0e@Q\xa6\xc7\x16\xb0\xa1\x0f@\xaeT\xcc\xa8x.\x10@\xba\xd3F\xa5m\x87\x10@\xcd\xffX0\x9e\xd9\x10@9\xf6\x10\xe1\xfb!\x11@\xd0\x1b\xe7\x8f\xadc\x11@\x18\xddX\x02|\x9e\x11@D\xc9\x1f\xae\xe7\xd1\x11@\xcc8\x01\xb3}\xfd\x11@e\xae\xd36\xda \x12@\r\xa8\xf3\x86\xaa;\x12@d{(\xea\xaeM\x12@i\x95D\x10\xbcV\x12@i\x95D\x10\xbcV\x12@d{(\xea\xaeM\x12@\r\xa8\xf3\x86\xaa;\x12@e\xae\xd36\xda \x12@\xcc8\x01\xb3}\xfd\x11@D\xc9\x1f\xae\xe7\xd1\x11@\x18\xddX\x02|\x9e\x11@\xd0\x1b\xe7\x8f\xadc\x11@8\xf6\x10\xe1\xfb!\x11@\xcd\xffX0\x9e\xd9\x10@\xba\xd3F\xa5m\x87\x10@\xaeT\xcc\xa8x.\x10@Q\xa6\xc7\x16\xb0\xa1\x0f@\x10\xbe\xc5lr\xde\x0e@\xbcK\x9cf\x8c\x14\x0e@\x80bT%GE\r@\x08~\x13\xecal\x0c@\xbakq\x9dP\x88\x0b@Q\x1a\xcd\xb5"\xa3\n@\x04\xebd\xc7\xc0\xbd\t@\x8f\xd1\xc8i1\xd8\x08@j\x9d:[\x97\xea\x07@\xb5\xbb\xfa^\xe1\xfb\x06@\x87\xe0\xeb\t\xb6\x11\x06@X\xf9\x1d\xfd\xa0,\x05@\xac\xd2\xf3\xe0iD\x04@\xf0z\x81g\x05^\x03@\x15\xf0\xc1\x18y~\x02@\x8d\xc5\xf5\x1d\xa1\xa6\x01@V\x02\x13F9\xcb\x00@\xd4\xa8\xbcS=\xf0\xff?\xaf\x88?\xc1\x89\\\xfe?\x98\x05\x18\t\xa4\xd1\xfc?\xc4mM\xdb\xc3L\xfb?\xba\xbcF\xbe\xa4\xdb\xf9?\x07\xa7\x12\x15q}\xf8?\xe9x\'\x92\xf7\x1e\xf7?\xa6\xbe\x8d\x83\x95\xd4\xf5?\xa7\x92\xa3\xb5\x0b\x9d\xf4?\xa4$\xb5v\xdbm\xf3?'
p32
tp33
bsS'entrbulk'
p34
cnumpy.core.multiarray
scalar
p35
(g14
S'\xf7v \xa3Vh\xf1?'
p36
tp37
Rp38
sS'spi111_fine'
p39
NsS'aS'
p40
I120
sS'n111'
p41
g4
(g5
(I0
tp42
g7
tp43
Rp44
(I1
(I80
tp45
g14
I00
S'\x86\xca0\xb9\xca\x92\xd7>\xc1\xf3W$\x9bK\xed>X\xa5|\xc6\xcb\x86\x05?$\x0e\x80\'\xd4G\x1b?\x7f(\xa9)6\xa1/?\xf7\xd0\xd3[\x99\xd2B?Xk\x11\x9e`QU?J(\x0f]\xa1\x16g?\x986\xae\x9c\x1a)y?\xaes\x80%|\xd7\x89?V\x16-?\x9cp\x98?\xd9\x95C\x05ZB\xa5?\x03\xa5\x93\xbf\x82\xa6\xb1?\x91\x97\x9d\xa2|\t\xbb?\xbc\x8d\xdb\x164a\xc3?^\xab\x82Byt\xca?l\x01\xb3D\xfcy\xd1?@\xa9\xee\xc5\x046\xd6?<\xe9~#\xf3F\xdb?&\x15\xe4\xda\x17M\xe0?\xa4-\x02\xbaq\x13\xe3?\xa7\xed%0\x98\xb8\xe5?\x02\xe5\xff\x9d/1\xe8?,\xd1\xd2\r\x1aq\xea?\x13\xfe\xb9\xb79\x88\xec?\xb07\xaemmq\xee?\xe0n%dZ\x0e\xf0?\xa6/W\xc9\x13\xdf\xf0?5K\\\xa8]}\xf1?\x1c)\x16.\xe47\xf2?\x9e\xbd\xb7\xdfF\xe0\xf2?b\xc3\xea\xaf\x17n\xf3?\x12\x9d\x9b&\xa8\xed\xf3?\x96Kd\x8f\xdb]\xf4?\x0by~\xa5q\xc5\xf4?\\]\x92\xafx\x13\xf5?:}\xcb\xf8\xf3P\xf5?\x1d\x13\t\xed\x7f~\xf5?w\x11\x92\xeb\x96\x9c\xf5?\x80q8\x05\x8d\xab\xf5?\x80q8\x05\x8d\xab\xf5?w\x11\x92\xeb\x96\x9c\xf5?\x1d\x13\t\xed\x7f~\xf5?:}\xcb\xf8\xf3P\xf5?x]\x92\xafx\x13\xf5?\x0by~\xa5q\xc5\xf4?\x96Kd\x8f\xdb]\xf4?\x12\x9d\x9b&\xa8\xed\xf3?;\xc3\xea\xaf\x17n\xf3?\x9e\xbd\xb7\xdfF\xe0\xf2?\x1c)\x16.\xe47\xf2?5K\\\xa8]}\xf1?\xa6/W\xc9\x13\xdf\xf0?\xe0n%dZ\x0e\xf0?^7\xaemmq\xee?-\xfe\xb9\xb79\x88\xec?,\xd1\xd2\r\x1aq\xea?\x02\xe5\xff\x9d/1\xe8?\xa7\xed%0\x98\xb8\xe5?\xa4-\x02\xbaq\x13\xe3?&\x15\xe4\xda\x17M\xe0?\x05\xea~#\xf3F\xdb?@\xa9\xee\xc5\x046\xd6?.\x01\xb3D\xfcy\xd1?`\xac\x82Byt\xca?\xbc\x8d\xdb\x164a\xc3?\xa0\x95\x9d\xa2|\t\xbb?\x03\xa5\x93\xbf\x82\xa6\xb1?.\x97C\x05ZB\xa5?\xac\x15-?\x9cp\x98?\xd2s\x80%|\xd7\x89?"5\xae\x9c\x1a)y?\xe1&\x0f]\xa1\x16g?3m\x11\x9e`QU?\xf7\xd0\xd3[\x99\xd2B?\x9b*\xa9)6\xa1/?\xaf\x0e\x80\'\xd4G\x1b?^\xa4|\xc6\xcb\x86\x05?\xc1\xf3W$\x9bK\xed>\x86\xca0\xb9\xca\x92\xd7>'
p46
tp47
bsS'SpiBulk'
p48
g35
(g14
S'\x15\x8b\x0e(p\xa1\xf0?'
p49
tp50
Rp51
sS'dens111'
p52
g4
(g5
(I0
tp53
g7
tp54
Rp55
(I1
(I80
tp56
g14
I00
S'\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x0c\x81\xf7q\xfb+y?\xdb\x1f\x15\x8c\xb6\xd9\x89?\xed\x88B\xadIr\x98?\xa6n\xb0tqC\xa5?Q\xc9\xb6\x023\xa7\xb1?s\xee\x14\x1c?\n\xbb?\\\xecsB\xa4a\xc3?z\xe2\xce;\xf0t\xca?\xbcg*\xdb;z\xd1?\x87\x92\xed1C6\xd6?\x00\x9a\xbdZ1G\xdb?\x8c\x88\xd4:1M\xe0?\xbd\xbf9\xfc\x84\x13\xe3?\x06\x1e_,\xa5\xb8\xe5?t\xea\x1eN81\xe8?\xac|W\xb6 q\xea?!\xf5\xe9x?\x88\xec?\xaf7\xaemmq\xee?\xe0n%dZ\x0e\xf0?\xa6/W\xc9\x13\xdf\xf0?5K\\\xa8]}\xf1?\x1d)\x16.\xe47\xf2?\x9e\xbd\xb7\xdfF\xe0\xf2?\xdf\x12Vu\x08n\xf3?4G\x9a\xc7\x98\xed\xf3?\xd8\xf2\xc7\x0f\xcc]\xf4?\x05w_\tb\xc5\xf4?-\xbdH\xfbh\x13\xf5?\x11\xa7\xe60\xe4P\xf5?VIF\x16p~\xf5?]\xeb\xd1\n\x87\x9c\xf5?D\x8as\x1f}\xab\xf5?D\x8as\x1f}\xab\xf5?]\xeb\xd1\n\x87\x9c\xf5?VIF\x16p~\xf5?\x11\xa7\xe60\xe4P\xf5?H\xbdH\xfbh\x13\xf5?\x05w_\tb\xc5\xf4?\xd8\xf2\xc7\x0f\xcc]\xf4?4G\x9a\xc7\x98\xed\xf3?\xb8\x12Vu\x08n\xf3?\x9e\xbd\xb7\xdfF\xe0\xf2?\x1d)\x16.\xe47\xf2?5K\\\xa8]}\xf1?\xa6/W\xc9\x13\xdf\xf0?\xe0n%dZ\x0e\xf0?^7\xaemmq\xee?;\xf5\xe9x?\x88\xec?\xac|W\xb6 q\xea?t\xea\x1eN81\xe8?\x06\x1e_,\xa5\xb8\xe5?\xbd\xbf9\xfc\x84\x13\xe3?\x8c\x88\xd4:1M\xe0?\xc8\x9a\xbdZ1G\xdb?\x87\x92\xed1C6\xd6?}g*\xdb;z\xd1?|\xe3\xce;\xf0t\xca?\\\xecsB\xa4a\xc3?\x82\xec\x14\x1c?\n\xbb?Q\xc9\xb6\x023\xa7\xb1?\xfbo\xb0tqC\xa5?D\x88B\xadIr\x98?\xff\x1f\x15\x8c\xb6\xd9\x89?\x96\x7f\xf7q\xfb+y?\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f\x00\x00\x00\x00\x00\x00\xf8\x7f'
p57
tp58
bsS'n111_fine'
p59
NsS'r111_fine'
p60
NsS'Tdens'
p61
F1.09
sS'mu111_Er'
p62
NsS'k111htse_list'
p63
(lp64
sS'savedir'
p65
S'dataplots/THERM/120/'
p66
sS'v0111'
p67
g4
(g5
(I0
tp68
g7
tp69
Rp70
(I1
(I80
tp71
g14
I00
S'\x05a\xd2x\xa5C\x10@+`\x8d\xd5D\xb6\x10@\x9a\xd9I\xa4\xfc(\x11@\xfe\x13\xa0\x1d\xa4\x9b\x11@\x06\xd4\xd6n\x11\x0e\x12@\xa1m\x1b\xd1\x19\x80\x12@\xe2\x0c/\xa2\x91\xf1\x12@\xbb\xf9w~Lb\x13@`jc\\\x1d\xd2\x13@!V\x02\xa9\xd6@\x14@b\xab\xc9eJ\xae\x14@\x03Q\\GJ\x1a\x15@\xdc{C\xd5\xa7\x84\x15@\x06\x1dx\x8a4\xed\x15@\x9e\x8b\x9e\xf6\xc1S\x16@M\r\xd4\xdf!\xb8\x16@\x8e\x89\xecd&\x1a\x17@\xaf\x85\xfd\x1f\xa2y\x17@Q\x86\x12Ih\xd6\x17@*!\xe6\xd8L0\x18@\xc7hz\xab$\x87\x18@e\xeej\xa2\xc5\xda\x18@I\\\xd2\xc6\x06+\x19@\xc3\xa7\x9dj\xc0w\x19@Y\x0c\'I\xcc\xc0\x19@\xcdk\xf3\xa6\x05\x06\x1a@\x06OmpIG\x1a@I\x9byWv\x84\x1a@S\x1c\xc3\xefl\xbd\x1a@\xd4E\x9b\xc9\x0f\xf2\x1a@\x0e\x04P\x8bC"\x1b@\xd3\x19\xd8\x08\xefM\x1b@0`\xb9Y\xfbt\x1b@c>\x0e\xedS\x97\x1b@\xb2\xdc\x91\x9b\xe6\xb4\x1b@\xf5\xe7\x9c\xb7\xa3\xcd\x1b@\x980\xff\x1a~\xe1\x1b@<\x05\xa52k\xf0\x1b@\x18\xd9\xf9\x07c\xfa\x1b@)\x8d\xfcG`\xff\x1b@)\x8d\xfcG`\xff\x1b@\x18\xd9\xf9\x07c\xfa\x1b@<\x05\xa52k\xf0\x1b@\x980\xff\x1a~\xe1\x1b@\xf5\xe7\x9c\xb7\xa3\xcd\x1b@\xb2\xdc\x91\x9b\xe6\xb4\x1b@c>\x0e\xedS\x97\x1b@0`\xb9Y\xfbt\x1b@\xd1\x19\xd8\x08\xefM\x1b@\x0e\x04P\x8bC"\x1b@\xd4E\x9b\xc9\x0f\xf2\x1a@S\x1c\xc3\xefl\xbd\x1a@I\x9byWv\x84\x1a@\x06OmpIG\x1a@\xcck\xf3\xa6\x05\x06\x1a@Y\x0c\'I\xcc\xc0\x19@\xc3\xa7\x9dj\xc0w\x19@I\\\xd2\xc6\x06+\x19@e\xeej\xa2\xc5\xda\x18@\xc7hz\xab$\x87\x18@*!\xe6\xd8L0\x18@Q\x86\x12Ih\xd6\x17@\xaf\x85\xfd\x1f\xa2y\x17@\x8d\x89\xecd&\x1a\x17@M\r\xd4\xdf!\xb8\x16@\x9e\x8b\x9e\xf6\xc1S\x16@\x04\x1dx\x8a4\xed\x15@\xdc{C\xd5\xa7\x84\x15@\x02Q\\GJ\x1a\x15@b\xab\xc9eJ\xae\x14@!V\x02\xa9\xd6@\x14@^jc\\\x1d\xd2\x13@\xb9\xf9w~Lb\x13@\xe2\x0c/\xa2\x91\xf1\x12@\xa1m\x1b\xd1\x19\x80\x12@\x04\xd4\xd6n\x11\x0e\x12@\xfe\x13\xa0\x1d\xa4\x9b\x11@\x97\xd9I\xa4\xfc(\x11@)`\x8d\xd5D\xb6\x10@\x05a\xd2x\xa5C\x10@'
p72
tp73
bsS'SthBulk'
p74
g35
(g14
S'\x08\n\x19\x88C6\xe6?'
p75
tp76
Rp77
sS'k111_fine'
p78
NsS'Number'
p79
g35
(g14
S'C\x13\x8cF\xf5t\xff@'
p80
tp81
Rp82
sS'entr111'
p83
g4
(g5
(I0
tp84
g7
tp85
Rp86
(I1
(I80
tp87
g14
I00
S'P\xa64\x88I\xad\x12?N\x8f\xd4\x9e\xb4\xca(?\xacV\x1b(OX=?:\x16\x01j\xf6\x8fO?\xe6\x13M\xfb\xf8\xbe_?\xe4\xe1\x18\xaf\xba?p?\x88\xbeH-\xe3\x86\x7f?,O\xa99OE\x8d?L@\x84\xc0\xee\x9b\x9a?oy\xa8\x92\x85\x00\xa7?\x9a\x128\xa7\x11\xaa\xb2?\xba\xb3\xc5\x06\xe4\x05\xbc?\x08\x7f\xbf\xe1~\x11\xc4?mCR~\x83\xe9\xca?6GtU\xca(\xd1?\xf8\xf7zYv;\xd5?t\xc0\xbdE\x9d\xa8\xd9?\xee\xcds\xd2<$\xde?m\xf7u\x10\x0c4\xe1?\xbbt\x93V\xe8M\xe3?\xef\xbaH\xf5D\xf3\xe4?\x90\xc7\x8b\xd4\x8b>\xe6?*1^\xfd\xb09\xe7?\xb0|iA\x01\xf2\xe7?\xbe\xfb\xe0\xc5\xa1t\xe8?\xa3\x02\xcf\x85\xe1\xd0\xe8?l\x9a%)\xf4\x16\xe9?\x92\xb2\\\x85\xf5P\xe9?r\xc2~}\x96m\xe9?\xce2\xfa\x02\xf9p\xe9?\t\xdeJ\x07Ab\xe9?\xea\xa5\xb2\xebyC\xe9?\xc2\xa9\x9f\xac\xac\x1d\xe9?\xd8\xcc\x82\xbee\xee\xe8?VO\xd5g\x05\xb8\xe8?e\x84\x87\x9d\xb0\x87\xe8?\x0c\xc3X\xd7E^\xe8?\x96\xf2\xecQ{>\xe8?.\x04\x1f\x9d\x83&\xe8?4"M\xfc\xbd\x1a\xe8?4"M\xfc\xbd\x1a\xe8?.\x04\x1f\x9d\x83&\xe8?\x96\xf2\xecQ{>\xe8?\x0c\xc3X\xd7E^\xe8?O\x84\x87\x9d\xb0\x87\xe8?VO\xd5g\x05\xb8\xe8?\xd8\xcc\x82\xbee\xee\xe8?\xc2\xa9\x9f\xac\xac\x1d\xe9?\xfe\xa5\xb2\xebyC\xe9?\t\xdeJ\x07Ab\xe9?\xce2\xfa\x02\xf9p\xe9?r\xc2~}\x96m\xe9?\x92\xb2\\\x85\xf5P\xe9?l\x9a%)\xf4\x16\xe9?\xae\x02\xcf\x85\xe1\xd0\xe8?\xc7\xfb\xe0\xc5\xa1t\xe8?\xb0|iA\x01\xf2\xe7?*1^\xfd\xb09\xe7?\x90\xc7\x8b\xd4\x8b>\xe6?\xef\xbaH\xf5D\xf3\xe4?\xbbt\x93V\xe8M\xe3?\xb1\xf7u\x10\x0c4\xe1?\xee\xcds\xd2<$\xde?+\xc0\xbdE\x9d\xa8\xd9?|\xf8zYv;\xd5?6GtU\xca(\xd1?4BR~\x83\xe9\xca?\x08\x7f\xbf\xe1~\x11\xc4?\xea\xb4\xc5\x06\xe4\x05\xbc?F\x128\xa7\x11\xaa\xb2?\x84y\xa8\x92\x85\x00\xa7?#?\x84\xc0\xee\x9b\x9a?\xd8M\xa99OE\x8d?\xbe\xc0H-\xe3\x86\x7f?\xe4\xe1\x18\xaf\xba?p?\xbd\x15M\xfb\xf8\xbe_?\xca\x16\x01j\xf6\x8fO?\x87U\x1b(OX=?N\x8f\xd4\x9e\xb4\xca(?P\xa64\x88I\xad\x12?'
p88
tp89
bsS'sth111'
p90
g4
(g5
(I0
tp91
g7
tp92
Rp93
(I1
(I80
tp94
g14
I00
S'\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?B\x86`\xbb\x86\xf9\xef?Ta-\xda\xb1+\xef?\x10\x8b\x0etlO\xee?\xce\x91\x84\xc5\x8ea\xed?\x0e\x01p,\x9aH\xec?\xdfs\xf1\x9e\x99\x0e\xeb?\x90\x02\xcc\\\n\xf2\xe9?\x8b\xce\x8f,\xa7\xdf\xe8?\x14{\xb5\r\xc3\xd8\xe7?\x04P\xc5c\x8b\xe2\xe6?giR+\x1e\r\xe6?,\xd6\xcf\x00H=\xe5?"\x07;\\Sl\xe4?\x012z\xf9\x1d~\xe3?a\xe2\rT\xac\xb5\xe2?\xd1u\xe6[\x0b\xe2\xe1?=v]\xa3; \xe1?\x9cVu\xc8\x96f\xe0?\xa5\x07\xa8\x8e\xd3N\xdf?\xe0\x0f\xe0\xb9+\xc5\xdd?\xd2\xde\'*e\x9f\xdc?N\xebj\xdf\xde\x8e\xdb?\xa4R\x03 E\x8a\xda?\xe4ID\xe43\xd8\xd9?\xca\xa0\\\x07\x110\xd9?\xb0\x96`\xfaq\xae\xd8?&\x1d\xd9\xfe\xa6]\xd8?p\x0e~>-5\xd8?p\x0e~>-5\xd8?&\x1d\xd9\xfe\xa6]\xd8?\xb0\x96`\xfaq\xae\xd8?\xca\xa0\\\x07\x110\xd9?\x9dID\xe43\xd8\xd9?\xa4R\x03 E\x8a\xda?N\xebj\xdf\xde\x8e\xdb?\xd2\xde\'*e\x9f\xdc?=\x10\xe0\xb9+\xc5\xdd?\xa5\x07\xa8\x8e\xd3N\xdf?\x9cVu\xc8\x96f\xe0?=v]\xa3; \xe1?\xd1u\xe6[\x0b\xe2\xe1?a\xe2\rT\xac\xb5\xe2?22z\xf9\x1d~\xe3?\x16\x07;\\Sl\xe4?,\xd6\xcf\x00H=\xe5?giR+\x1e\r\xe6?\x04P\xc5c\x8b\xe2\xe6?\x14{\xb5\r\xc3\xd8\xe7?\x8b\xce\x8f,\xa7\xdf\xe8?a\x02\xcc\\\n\xf2\xe9?\xdfs\xf1\x9e\x99\x0e\xeb?\x1e\x01p,\x9aH\xec?\xaa\x91\x84\xc5\x8ea\xed?\x10\x8b\x0etlO\xee?\xc0a-\xda\xb1+\xef?B\x86`\xbb\x86\xf9\xef?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf0?'
p95
tp96
bsS'r111'
p97
g4
(g5
(I0
tp98
g7
tp99
Rp100
(I1
(I80
tp101
g14
I00
S'\x00\x00\x00\x00\x00\x00>\xc0{\x06\xa2\xd2\x91==\xc0\xf5\x0cD\xa5#{<\xc0q\x13\xe6w\xb5\xb8;\xc0\xec\x19\x88JG\xf6:\xc0h *\x1d\xd93:\xc0\xe3&\xcc\xefjq9\xc0^-n\xc2\xfc\xae8\xc0\xd93\x10\x95\x8e\xec7\xc0T:\xb2g *7\xc0\xd0@T:\xb2g6\xc0JG\xf6\x0cD\xa55\xc0\xc6M\x98\xdf\xd5\xe24\xc0@T:\xb2g 4\xc0\xbcZ\xdc\x84\xf9]3\xc07a~W\x8b\x9b2\xc0\xb2g *\x1d\xd91\xc0-n\xc2\xfc\xae\x161\xc0\xa9td\xcf@T0\xc0G\xf6\x0cD\xa5#/\xc0=\x03Q\xe9\xc8\x9e-\xc04\x10\x95\x8e\xec\x19,\xc0*\x1d\xd93\x10\x95*\xc0 *\x1d\xd93\x10)\xc0\x167a~W\x8b\'\xc0\x0cD\xa5#{\x06&\xc0\x02Q\xe9\xc8\x9e\x81$\xc0\xf8]-n\xc2\xfc"\xc0\xf0jq\x13\xe6w!\xc0\xcc\xefjq\x13\xe6\x1f\xc0\xb9\t\xf3\xbbZ\xdc\x1c\xc0\xa4#{\x06\xa2\xd2\x19\xc0\x90=\x03Q\xe9\xc8\x16\xc0|W\x8b\x9b0\xbf\x13\xc0hq\x13\xe6w\xb5\x10\xc0\xa8\x167a~W\x0b\xc0\x80JG\xf6\x0cD\x05\xc0\xc0\xfc\xae\x167a\xfe\xbfpd\xcf@T:\xf2\xbf\x800\xbf\xab\xc5M\xd8\xbf\xc00\xbf\xab\xc5M\xd8?\x80d\xcf@T:\xf2?\xce\xfc\xae\x167a\xfe?\x90JG\xf6\x0cD\x05@\xb0\x167a~W\x0b@pq\x13\xe6w\xb5\x10@\x80W\x8b\x9b0\xbf\x13@\x98=\x03Q\xe9\xc8\x16@\xa8#{\x06\xa2\xd2\x19@\xb9\t\xf3\xbbZ\xdc\x1c@\xd2\xefjq\x13\xe6\x1f@\xf0jq\x13\xe6w!@\xfc]-n\xc2\xfc"@\x04Q\xe9\xc8\x9e\x81$@\x10D\xa5#{\x06&@\x187a~W\x8b\'@ *\x1d\xd93\x10)@,\x1d\xd93\x10\x95*@4\x10\x95\x8e\xec\x19,@@\x03Q\xe9\xc8\x9e-@H\xf6\x0cD\xa5#/@\xaatd\xcf@[email protected]\xc2\xfc\xae\x161@\xb4g *\x1d\xd91@8a~W\x8b\x9b2@\xbcZ\xdc\x84\xf9]3@BT:\xb2g 4@\xc6M\x98\xdf\xd5\xe24@LG\xf6\x0cD\xa55@\xd0@T:\xb2g6@V:\xb2g *7@\xda3\x10\x95\x8e\xec7@`-n\xc2\xfc\xae8@\xe4&\xcc\xefjq9@h *\x1d\xd93:@\xee\x19\x88JG\xf6:@r\x13\xe6w\xb5\xb8;@\xf9\x0cD\xa5#{<@|\x06\xa2\xd2\x91==@\x00\x00\x00\x00\x00\x00>@'
p102
tp103
bsS'Tspi'
p104
F1.09
sS'ldanum'
p105
g35
(g14
S'\x9b1<\xa5Zb\xff@'
p106
tp107
Rp108
s. | 70.294821 | 1,952 | 0.705849 |
28a04347113095a03f086fc1cb50fcfa10a4b5c3 | 366 | kt | Kotlin | zircon.core/src/commonMain/kotlin/org/hexworks/zircon/api/extensions/TileExtensions.kt | EnderL2000/zircon | fd3857d42c0d03f73b720876250be70ae6b9d788 | [
"MIT"
] | null | null | null | zircon.core/src/commonMain/kotlin/org/hexworks/zircon/api/extensions/TileExtensions.kt | EnderL2000/zircon | fd3857d42c0d03f73b720876250be70ae6b9d788 | [
"MIT"
] | null | null | null | zircon.core/src/commonMain/kotlin/org/hexworks/zircon/api/extensions/TileExtensions.kt | EnderL2000/zircon | fd3857d42c0d03f73b720876250be70ae6b9d788 | [
"MIT"
] | null | null | null | package org.hexworks.zircon.api.extensions
import org.hexworks.zircon.api.data.Tile
fun List<Tile>.transform(tileTransformer: (Tile) -> Tile): List<Tile> {
return this.map(tileTransformer::invoke)
}
fun List<Tile>.transformIndexed(transformer: (Int, Tile) -> Tile): List<Tile> {
return this.mapIndexed { index, tile -> transformer.invoke(index, tile) }
}
| 30.5 | 79 | 0.73224 |
6c45d8720237f3f673b225f2631cd7d031215a6a | 739 | lua | Lua | secure-boot-genkey.lua | oc-t35/secure-boot-lua-BIOS | 250bcc4ec56d90d0ec98a2038c715c8f6a5801c0 | [
"Unlicense"
] | null | null | null | secure-boot-genkey.lua | oc-t35/secure-boot-lua-BIOS | 250bcc4ec56d90d0ec98a2038c715c8f6a5801c0 | [
"Unlicense"
] | null | null | null | secure-boot-genkey.lua | oc-t35/secure-boot-lua-BIOS | 250bcc4ec56d90d0ec98a2038c715c8f6a5801c0 | [
"Unlicense"
] | null | null | null | local io = require("io")
local component = require("component")
local data
for d in component.list("data") do
d = component.proxy(d)
if d.generateKeyPair ~= nil then
data = d
end
end
if data == nil then
print("You need a T3 data card for secure boot!")
return
end
print("generating keypair")
local pub, priv = data.generateKeyPair(256)
print("saving public key to /home/pubkey")
local f, err = io.open("/home/pubkey","wb")
if f ~= nil then
f:write(pub.serialize())
f:close()
else
print("could not save the keys: "..err)
return
end
print("saving private key to /home/privkey")
f, err = io.open("/home/privkey","wb")
if f ~= nil then
f:write(priv.serialize())
f:close()
else
print("could not save the keys: "..err)
return
end
| 21.735294 | 50 | 0.691475 |
4c00a61ce18e0e6bf38c4294d512c9e1642981fe | 1,121 | kt | Kotlin | Boats_to_Save_People_v1.kt | xiekc/leetcode | 56dc65850ac68752f7c6f50f8b35eb23bfafed93 | [
"MIT"
] | null | null | null | Boats_to_Save_People_v1.kt | xiekc/leetcode | 56dc65850ac68752f7c6f50f8b35eb23bfafed93 | [
"MIT"
] | null | null | null | Boats_to_Save_People_v1.kt | xiekc/leetcode | 56dc65850ac68752f7c6f50f8b35eb23bfafed93 | [
"MIT"
] | null | null | null | class Solution {
fun numRescueBoats(people: IntArray, limit: Int): Int {
people.sort()
var left = 0
var right = people.size - 1
var result = 0
while (right >= left) {
var sum = 0
var count = 0
while (right >= left && sum + people[right] <= limit && count < 2) {
sum += people[right]
right--
count++
}
while (right >= left && sum + people[left] <= limit && count < 2) {
sum += people[left]
left++
count++
}
result++
}
return result
}
}
class TestCase(val people: IntArray, val limit: Int)
fun main() {
val solution = Solution()
val testCases = arrayOf(TestCase(intArrayOf(1, 2), 3), TestCase(intArrayOf(1, 1, 1, 2, 2, 2), 3),
TestCase(intArrayOf(3, 2, 2, 1), 3), TestCase(intArrayOf(3, 5, 3, 4), 5),
TestCase(intArrayOf(3, 2, 3, 2, 2), 6))
for (case in testCases) {
println(solution.numRescueBoats(case.people, case.limit))
}
}
| 30.297297 | 101 | 0.482605 |
9c0464d3febf40d0d8a4cd5697b9e27ca24b15b7 | 2,912 | js | JavaScript | src/domains/components/SlaveZone.js | mighteejim/manager | 86365b7142a78956e04821c0cb9e0adadaf0de3c | [
"BSD-3-Clause"
] | null | null | null | src/domains/components/SlaveZone.js | mighteejim/manager | 86365b7142a78956e04821c0cb9e0adadaf0de3c | [
"BSD-3-Clause"
] | null | null | null | src/domains/components/SlaveZone.js | mighteejim/manager | 86365b7142a78956e04821c0cb9e0adadaf0de3c | [
"BSD-3-Clause"
] | null | null | null | import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import { replace } from 'react-router-redux';
import { Card, CardHeader } from 'linode-components/cards';
import { Table } from 'linode-components/tables';
import { ButtonCell } from 'linode-components/tables/cells';
import { showModal, hideModal } from '~/actions/modal';
import EditSOARecord from '../components/EditSOARecord';
export class SlaveZone extends Component {
renderSOAEditRecord() {
const { dispatch, domain } = this.props;
dispatch(showModal(
'Edit SOA Record',
<EditSOARecord
dispatch={dispatch}
domains={domain}
close={(newDomain) => () => {
dispatch(hideModal());
dispatch(replace(`/domains/${newDomain || domain.domain}`));
}}
/>
));
}
renderEditRecord(title, component, props = {}) {
const { dispatch, domain } = this.props;
dispatch(showModal(
title,
React.createElement(component, {
...props,
dispatch,
zone: domain,
close: () => dispatch(hideModal()),
}),
));
}
renderEditSOARecord(title) {
return this.renderEditRecord(title, EditSOARecord);
}
render() {
const { domain } = this.props;
if (!domain) {
return null;
}
const { axfr_ips, master_ips } = domain;
const soaRecord = {
...domain,
axfr_ips: axfr_ips.map(ip => <div key={ip}>{ip}</div>),
master_ips: master_ips.map(ip => <div key={ip}>{ip}</div>),
};
return (
<div>
<header className="main-header main-header--border">
<div className="container">
<Link to="/domains">Domains</Link>
<h1 title={domain.id}>
{domain.group ? `${domain.group} / ` : ''}
{domain.domain}
</h1>
</div>
</header>
<div className="container">
<Card
id="soa"
header={
<CardHeader title="SOA Record" />
}
>
<Table
className="Table--secondary"
columns={[
{ dataKey: 'domain', label: 'Primary Domain' },
{ dataKey: 'axfr_ips', label: 'Domain Transfers' },
{ dataKey: 'master_ips', label: 'Masters' },
{
cellComponent: ButtonCell,
headerClassName: 'ButtonColumn',
text: 'Edit',
onClick: () => {
this.renderSOAEditRecord();
},
},
]}
data={[soaRecord]}
/>
</Card>
</div>
</div>
);
}
}
SlaveZone.propTypes = {
dispatch: PropTypes.func.isRequired,
domain: PropTypes.object.isRequired,
};
export default connect()(SlaveZone);
| 26.472727 | 70 | 0.522665 |
e75d78dc593546abf19c8fe4e2fb9a014bc568c0 | 543 | js | JavaScript | src/IntlProvider/IntlProvider.js | marciobarrios/react-intl-number | 90f7aa8523a74597a457a3c0528d756b8f2155c3 | [
"MIT"
] | 14 | 2019-05-24T08:35:11.000Z | 2022-03-15T19:14:29.000Z | src/IntlProvider/IntlProvider.js | marciobarrios/react-intl-number | 90f7aa8523a74597a457a3c0528d756b8f2155c3 | [
"MIT"
] | 1 | 2020-01-02T01:56:04.000Z | 2020-09-09T08:13:34.000Z | src/IntlProvider/IntlProvider.js | marciobarrios/react-intl-number | 90f7aa8523a74597a457a3c0528d756b8f2155c3 | [
"MIT"
] | 2 | 2020-04-17T07:38:10.000Z | 2021-03-25T23:17:11.000Z | import React, { createContext, useContext, useMemo, useState } from "react"
import { defaultIntlConfig } from "../helpers"
const IntlContext = createContext()
const useIntl = () => useContext(IntlContext)
const IntlProvider = props => {
const [config, setConfig] = useState({
...defaultIntlConfig,
...props.config,
})
const value = useMemo(
() => ({
config,
setConfig,
}),
[config]
)
return <IntlContext.Provider value={value} {...props} />
}
export { useIntl, IntlProvider, defaultIntlConfig }
| 20.884615 | 75 | 0.64825 |
7b5a0b89a17c16da59692c35254c3c9ca8b26aae | 181 | rb | Ruby | app/controllers/spree/products_controller_decorator.rb | sammieValsangkar/solidus_searchkick | d69deb716d5b7a10127baa52ac0d483a5118b460 | [
"MIT"
] | null | null | null | app/controllers/spree/products_controller_decorator.rb | sammieValsangkar/solidus_searchkick | d69deb716d5b7a10127baa52ac0d483a5118b460 | [
"MIT"
] | null | null | null | app/controllers/spree/products_controller_decorator.rb | sammieValsangkar/solidus_searchkick | d69deb716d5b7a10127baa52ac0d483a5118b460 | [
"MIT"
] | null | null | null | Spree::ProductsController.class_eval do
def autocomplete
keywords = params[:keywords] ||= nil
json = Spree::Product.autocomplete(keywords)
render json: json
end
end
| 22.625 | 48 | 0.723757 |
6aa33a9eaf72d6f8047c0dfc95b5f3b78df84cdc | 5,807 | kt | Kotlin | component/component-kaiheila-parent/kaiheila-core/src/main/java/love/forte/simbot/kaiheila/api/ApiDataRequestUtil.kt | 58563528/simpler-robot | ad8efda7936559edf8e7bd00f46ad08719a28c6d | [
"Apache-2.0"
] | 259 | 2020-09-25T01:31:18.000Z | 2022-03-31T02:06:34.000Z | component/component-kaiheila-parent/kaiheila-core/src/main/java/love/forte/simbot/kaiheila/api/ApiDataRequestUtil.kt | Maousuki/simpler-robot | a17fe3793e26fa1219d49f2afdb3b52c784a87c6 | [
"Apache-2.0"
] | 186 | 2020-11-19T15:17:17.000Z | 2022-03-09T02:07:42.000Z | component/component-kaiheila-parent/kaiheila-core/src/main/java/love/forte/simbot/kaiheila/api/ApiDataRequestUtil.kt | Maousuki/simpler-robot | a17fe3793e26fa1219d49f2afdb3b52c784a87c6 | [
"Apache-2.0"
] | 37 | 2020-10-09T06:47:06.000Z | 2022-03-31T02:00:35.000Z | /*
*
* * Copyright (c) 2021. ForteScarlet All rights reserved.
* * Project simple-robot
* * File MiraiAvatar.kt
* *
* * You can contact the author through the following channels:
* * github https://github.com/ForteScarlet
* * gitee https://gitee.com/ForteScarlet
* * email [email protected]
* * QQ 1149159218
*
*/
@file:JvmName("ApiDataRequestUtil")
package love.forte.simbot.kaiheila.api
import io.ktor.client.*
import io.ktor.client.request.*
import io.ktor.http.*
import kotlinx.serialization.json.*
import love.forte.simbot.kaiheila.KhlBot
import love.forte.simbot.kaiheila.khlJson
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import kotlin.contracts.ExperimentalContracts
@JvmSynthetic
public val logger: Logger = LoggerFactory.getLogger(ApiData::class.java)
/**
*
* 通过Bot进行请求,同时也会为需要Bot数据的地方提供Bot信息。
*
*/
public suspend inline fun <reified HTTP_RESP : ApiData.Resp<*>> ApiData.Req<HTTP_RESP>.doRequest(
bot: KhlBot, client: HttpClient = bot.client,
): HTTP_RESP {
val response = doRequest(bot.api, client, bot.token, AuthorizationType.BOT)
when (response) {
is EmptyResp -> {
response.bot = bot
}
is ListResp<*, *> -> {
response._bot(bot)
}
is ObjectResp<*> -> {
response._bot(bot)
}
}
return response
}
/**
* 请求一个 [ApiData.Req] 并得到一个对应的 [响应体][ApiData.Resp].
* [token] 存在的时候,[authorizationType] 必须存在.
*/
@OptIn(ExperimentalContracts::class)
public suspend inline fun <reified HTTP_RESP : ApiData.Resp<*>> ApiData.Req<HTTP_RESP>.doRequest(
api: Api,
client: HttpClient,
token: String? = null,
authorizationType: AuthorizationType = AuthorizationType.BOT,
): HTTP_RESP {
var apiPath: List<String>
// client.submitFormWithBinaryData<Unit>()
// MultiPartFormDataContent(formData)
val responseContent = client.request<String> {
// contentType(ContentType.Application.Json)
method = [email protected]
token?.let { auth ->
// header("Authorization", authorizationType.getAuthorization(auth))
header(HttpHeaders.Authorization, authorizationType.getAuthorization(auth))
}
val httpRequestBuilder = this
url {
val routeInfoBuilder = RouteInfoBuilder.getInstance(object : ParametersAppender {
override fun append(key: String, value: Any) {
httpRequestBuilder.parameter(key, value)
}
}, ContentType.Application.Json) // ContentType.Application.Json)
[email protected](routeInfoBuilder)
apiPath = routeInfoBuilder.apiPath
routeInfoBuilder.contentType?.let { contentType(it) }
[email protected]?.let { b -> body = b }
this.toKhlBuild(api, apiPath)
}
}
logger.debug("Request api `{}` response content: {}", key.id, responseContent)
// println(responseContent)
val jsonElement = khlJson.parseToJsonElement(responseContent)
val jsonObject = jsonElement.jsonObject
val forDecodeElement = if (jsonObject["code"]?.jsonPrimitive?.intOrNull != 0) {
buildJsonObject {
for ((k, v) in jsonElement.jsonObject) {
if (k != "data") {
put(k, v)
} else {
put("data", JsonNull)
}
}
}
} else jsonElement
// val jsonObject = jsonElement.jsonObject
// val code = jsonObject["code"]?.jsonPrimitive?.intOrNull ?: 0
//
// if (code != 0) {
// val message = jsonObject["message"]?.jsonPrimitive?.toString()
// throw KhlApiHttpResponseException(buildString {
// append("api: ").append("'").append([email protected]).append("', ")
// append("code: ").append(code)
// append(", msg: ").append(message ?: "<EMPTY MESSAGE>")
// append(", data: ").append(jsonObject["data"])
// })
// }
// val contentText = resp.readText(Charsets.UTF_8)
return khlJson.decodeFromJsonElement(deserializer = this.dataSerializer, forDecodeElement).also(::post)
}
/**
* 执行这个 [请求][ApiData.Req] 并在 **成功** 的情况下得到其对应的响应值 [D].
*
*/
public suspend inline fun <D, reified HTTP_RESP : ApiData.Resp<out D>> ApiData.Req<HTTP_RESP>.doRequestForData(
api: Api,
client: HttpClient,
token: String? = null,
authorizationType: AuthorizationType = AuthorizationType.BOT,
): D = doRequest(api, client, token, authorizationType).also { resp ->
val code = resp.code
if (code != 0) {
val message = resp.message
throw KhlApiHttpResponseException(buildString {
append("api: ").append("'").append([email protected]).append("'")
append(", code: ").append(code)
append(", msg: ").append(message)
})
}
}.data
/**
* 执行这个 [请求][ApiData.Req] 并在 **成功** 的情况下得到其对应的响应值 [D].
*
*/
public suspend inline fun <D, reified HTTP_RESP : ApiData.Resp<out D>> ApiData.Req<HTTP_RESP>.doRequestForData(
bot: KhlBot,
client: HttpClient = bot.client,
): D = doRequest(bot, client).also { resp ->
val code = resp.code
if (code != 0) {
val message = resp.message
throw KhlApiHttpResponseException(buildString {
append("api: ").append("'").append([email protected]).append("'")
append(", code: ").append(code)
append(", msg: ").append(message)
})
}
}.data
/**
*
* 当 [HTTP_RESP] 的 [code] == 0 且 [ObjectResp.data] 不为null的时执行逻辑 [block].
*/
public inline fun <D : ApiData.Resp.Data, reified HTTP_RESP : ObjectResp<out D>> HTTP_RESP.ifSuccess(block: (D) -> Unit) {
if (isSuccess) {
data?.apply(block)
}
}
| 30.403141 | 122 | 0.62218 |
f6ce5e61633cafff7ec54c3d2e632647f5696371 | 685 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/am9511/c/sccz80/cam32_sccz80_fmul.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/am9511/c/sccz80/cam32_sccz80_fmul.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/am9511/c/sccz80/cam32_sccz80_fmul.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; float __fmul(float left, float right)
SECTION code_clib
SECTION code_fp_am9511
PUBLIC cam32_sccz80_fmul
EXTERN cam32_sccz80_switch_arg, cam32_sccz80_readl
EXTERN asm_am9511_fmul
; multiply two sccz80 floats
;
; enter : stack = sccz80_float left, sccz80_float right, ret
;
; exit : DEHL = sccz80_float(left*right)
;
; uses : af, bc, de, hl, af', bc', de', hl'
.cam32_sccz80_fmul
call cam32_sccz80_switch_arg
call cam32_sccz80_readl
jp asm_am9511_fmul ; enter stack = sccz80_float right, sccz80_float left, ret
; DEHL = sccz80_float right
; return DEHL = sccz80_float
| 26.346154 | 86 | 0.654015 |
74453b146b3de21f5ef837486eafa505ce78af8a | 420 | rs | Rust | src/map/generator/mod.rs | DeeUnderscore/cubeglobe | 47b48b6038a736a47f0d96ce25d128aebb26fef6 | [
"0BSD"
] | 8 | 2018-12-11T06:59:16.000Z | 2021-11-09T11:44:11.000Z | src/map/generator/mod.rs | DeeUnderscore/cubeglobe | 47b48b6038a736a47f0d96ce25d128aebb26fef6 | [
"0BSD"
] | 1 | 2021-04-01T23:53:46.000Z | 2021-04-01T23:53:46.000Z | src/map/generator/mod.rs | DeeUnderscore/cubeglobe | 47b48b6038a736a47f0d96ce25d128aebb26fef6 | [
"0BSD"
] | 2 | 2019-01-07T02:21:52.000Z | 2021-01-12T22:41:39.000Z | //! Generators for procedurally generating [`IsoMap`s](struct.IsoMap.html)
mod tergenone;
mod tergentwo;
mod testing;
pub use map::generator::testing::TestingGenerator;
pub use map::generator::tergenone::TerGenOne;
pub use map::generator::tergentwo::TerGenTwo;
use map::IsoMap;
/// A generator capable of returning an
/// [`IsoMap`](map/struct.IsoMap.html).
pub trait Generator {
fn generate(&self) -> IsoMap;
}
| 23.333333 | 74 | 0.735714 |
c5dc4fa8b04ed23ddc621a9465fcc221c0355a86 | 114 | sql | SQL | insertRoles.sql | kristin-green-and-associates/aws-aurora-data-api-response-formatter | 0f15a65371d63b4f07e43013a1dfa9569a74c8e9 | [
"MIT"
] | null | null | null | insertRoles.sql | kristin-green-and-associates/aws-aurora-data-api-response-formatter | 0f15a65371d63b4f07e43013a1dfa9569a74c8e9 | [
"MIT"
] | null | null | null | insertRoles.sql | kristin-green-and-associates/aws-aurora-data-api-response-formatter | 0f15a65371d63b4f07e43013a1dfa9569a74c8e9 | [
"MIT"
] | null | null | null | INSERT INTO Role (RoleID, RoleName) VALUES
(1, "Administrators"),
(2, "Managers"),
(3, "Sales Associates");
| 22.8 | 42 | 0.649123 |
752884e2e1360b084c50ca23cbf298cdc7a3c546 | 317 | h | C | src/process/fdop.h | leaningtech/cheerp-musl | ed96bd0bd6b9b0a578b6552114ac1d225db54a26 | [
"MIT"
] | 2 | 2022-02-22T17:11:22.000Z | 2022-03-13T21:57:46.000Z | src/process/fdop.h | leaningtech/cheerp-musl | ed96bd0bd6b9b0a578b6552114ac1d225db54a26 | [
"MIT"
] | null | null | null | src/process/fdop.h | leaningtech/cheerp-musl | ed96bd0bd6b9b0a578b6552114ac1d225db54a26 | [
"MIT"
] | null | null | null | #define FDOP_CLOSE 1
#define FDOP_DUP2 2
#define FDOP_OPEN 3
#define FDOP_CHDIR 4
#define FDOP_FCHDIR 5
struct fdop {
struct fdop *next, *prev;
int cmd, fd, srcfd, oflag;
mode_t mode;
char path[];
};
//#define malloc __libc_malloc
//#define calloc __libc_calloc
#define realloc undef
//#define free __libc_free
| 17.611111 | 30 | 0.747634 |
653d695cd3021eadcb097d2dd9fa97ca942ec702 | 10,454 | py | Python | etc/check-python.py | maxzheng/auto-update | 7d9afa139f890ff9a6bbeb01549a311bdb5168d0 | [
"MIT"
] | 7 | 2018-08-22T21:03:54.000Z | 2022-02-04T20:31:20.000Z | etc/check-python.py | maxzheng/auto-update | 7d9afa139f890ff9a6bbeb01549a311bdb5168d0 | [
"MIT"
] | null | null | null | etc/check-python.py | maxzheng/auto-update | 7d9afa139f890ff9a6bbeb01549a311bdb5168d0 | [
"MIT"
] | 2 | 2019-04-24T20:49:01.000Z | 2019-10-30T17:45:19.000Z | #!/usr/bin/env python
import argparse
import os
import platform
import re
import shutil
import subprocess
import sys
SUPPORTED_VERSIONS = ('3.6', '3.7')
IS_DEBIAN = platform.system() == 'Linux' and os.path.exists('/etc/debian_version')
IS_OLD_UBUNTU = (IS_DEBIAN and os.path.exists('/etc/lsb-release')
and re.search('RELEASE=1[46]', open('/etc/lsb-release').read()))
IS_MACOS = platform.system() == 'Darwin'
SUDO = 'sudo ' if os.getuid() else ''
parser = argparse.ArgumentParser(description='Check and fix Python installation')
parser.add_argument('--autofix', action='store_true', help='Automatically fix any problems found')
parser.add_argument('--version', default=SUPPORTED_VERSIONS[0], choices=SUPPORTED_VERSIONS,
help='Python version to check')
args = parser.parse_args()
PY_VERSION = args.version
AUTOFIX = args.autofix
def check_sudo():
if not run('which sudo', return_output=True):
error('! sudo is not installed.')
print(' Please ask an administrator to install it and run this again.')
sys.exit(1)
def check_apt():
os.environ['DEBIAN_FRONTEND'] = 'noninteractive'
run(SUDO + 'apt-get install -y apt-utils', return_output=True)
def check_curl():
if not run('which curl', return_output=True):
error('! curl is not installed.')
if IS_DEBIAN:
raise AutoFixSuggestion('To install, run', SUDO + 'apt-get install -y curl')
sys.exit(1)
def check_python():
py3_path = run('which python' + PY_VERSION, return_output=True)
if not py3_path:
error('! Python ' + PY_VERSION + ' is not installed.')
if '--version' not in sys.argv:
print(' autopip supports Python {}.'.format(', '.join(SUPPORTED_VERSIONS))
+ ' To check a different version, re-run using "python - --version x.y"')
if IS_OLD_UBUNTU:
raise AutoFixSuggestion('To install, run',
(SUDO + 'apt-get update',
SUDO + 'apt-get install -y software-properties-common',
SUDO + 'add-apt-repository -y ppa:deadsnakes/ppa',
SUDO + 'apt-get update',
SUDO + 'apt-get install -y python' + PY_VERSION))
elif IS_DEBIAN:
raise AutoFixSuggestion('To install, run',
(SUDO + 'apt-get update', SUDO + 'apt-get install -y python' + PY_VERSION))
elif IS_MACOS:
raise AutoFixSuggestion('To install, run', 'brew install python')
print(' Please install Python ' + PY_VERSION
+ ' per http://docs.python-guide.org/en/latest/starting/installation/')
sys.exit(1)
def check_pip():
if not run('which pip3', return_output=True):
error('! pip3 is not installed.')
if IS_DEBIAN:
raise AutoFixSuggestion('To install, run', SUDO + 'apt-get install -y python3-pip')
elif IS_MACOS:
raise AutoFixSuggestion('To install, run', 'curl -s https://bootstrap.pypa.io/get-pip.py | '
+ SUDO + 'python' + PY_VERSION)
print(' If your package repo has a *-pip package for Python ' + PY_VERSION
+ ', then installing it from there is recommended.')
print(' To install directly, run: curl -s https://bootstrap.pypa.io/get-pip.py | '
+ SUDO + 'python' + PY_VERSION)
sys.exit(1)
version_full = run('pip3 --version', return_output=True)
if 'python ' + PY_VERSION not in version_full:
print(' ' + version_full.strip())
error('! pip3 is pointing to another Python version and not Python ' + PY_VERSION)
if '--version' not in sys.argv:
print(' autopip supports Python {}.'.format(', '.join(SUPPORTED_VERSIONS))
+ ' To check a different version, re-run using "python - --version x.y"')
raise AutoFixSuggestion('To re-install for Python ' + PY_VERSION + ', run',
'curl -s https://bootstrap.pypa.io/get-pip.py | ' + SUDO + 'python' + PY_VERSION)
version_str = version_full.split()[1]
version = tuple(map(_int_or, version_str.split('.', 2)))
if version < (9, 0, 3):
error('! Version is', version_str + ', but should be 9.0.3+')
raise AutoFixSuggestion('To upgrade, run', SUDO + 'pip3 install pip==9.0.3')
def check_venv():
test_venv_path = '/tmp/check-python-venv-{}'.format(os.getpid())
try:
try:
run('python' + PY_VERSION + ' -m venv ' + test_venv_path, stderr=subprocess.STDOUT, return_output=True,
raises=True)
except Exception:
error('! Could not create virtual environment.')
if IS_DEBIAN:
raise AutoFixSuggestion('To install, run', SUDO + 'apt-get install -y python' + PY_VERSION + '-venv')
print(' Please make sure Python venv package is installed.')
sys.exit(1)
finally:
shutil.rmtree(test_venv_path, ignore_errors=True)
try:
try:
run('virtualenv --python python' + PY_VERSION + ' ' + test_venv_path, stderr=subprocess.STDOUT,
return_output=True,
raises=True)
except Exception as e:
if run('which virtualenv', return_output=True):
error('! Could not create virtual environment.')
print(' ' + str(e))
sys.exit(1)
else:
error('! virtualenv is not installed.')
raise AutoFixSuggestion('To install, run', SUDO + 'pip3 install virtualenv')
finally:
shutil.rmtree(test_venv_path, ignore_errors=True)
def check_setuptools():
try:
version_str = run('python' + PY_VERSION + ' -m easy_install --version', return_output=True, raises=True)
except Exception:
error('! setuptools is not installed.')
raise AutoFixSuggestion('To install, run', SUDO + 'pip3 install setuptools')
version_str = version_str.split()[1]
version = tuple(map(_int_or, version_str.split('.')))
if version < (39,):
error('! Version is', version_str + ', but should be 39+')
raise AutoFixSuggestion('To upgrade, run', SUDO + 'pip3 install -U setuptools')
def check_wheel():
try:
version_str = run('python' + PY_VERSION + ' -m wheel version ', return_output=True, raises=True)
except Exception:
error('! wheel is not installed.')
raise AutoFixSuggestion('To install, run', SUDO + 'pip3 install wheel')
version_str = version_str.split()[1]
version = tuple(map(_int_or, version_str.split('.')))
if version < (0, 31):
error('! Version is', version_str + ', but should be 0.31+')
raise AutoFixSuggestion('To upgrade, run', SUDO + 'pip3 install -U wheel')
def check_python_dev():
include_path = run('python' + PY_VERSION
+ ' -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())"',
return_output=True)
if not include_path:
error('! Failed to get Python include path, so not sure if Python dev package is installed')
if IS_DEBIAN:
raise AutoFixSuggestion('To install, run', SUDO + ' apt-get install -y python' + PY_VERSION + '-dev')
sys.exit(1)
python_h = os.path.join(include_path.strip(), 'Python.h')
if not os.path.exists(python_h):
error('! Python dev package is not installed as', python_h, 'does not exist')
if IS_DEBIAN:
raise AutoFixSuggestion('To install, run', SUDO + 'apt-get install -y python' + PY_VERSION + '-dev')
sys.exit(1)
def run(cmd, return_output=False, raises=False, **kwargs):
print('+ ' + str(cmd))
if '"' in cmd or '|' in cmd:
kwargs['shell'] = True
elif isinstance(cmd, str):
cmd = cmd.split()
check_call = subprocess.check_output if return_output else subprocess.check_call
try:
output = check_call(cmd, **kwargs)
if isinstance(output, bytes):
output = output.decode('utf-8')
return output
except Exception:
if return_output and not raises:
return
else:
raise
def _int_or(value):
try:
return int(value)
except Exception:
return value
def error(*msg):
msg = ' '.join(map(str, msg))
echo(msg, color=None if AUTOFIX else 'red')
def echo(msg, color=None):
if sys.stdout.isatty() and color:
if color == 'red':
color = '\033[0;31m'
elif color == 'green':
color = '\033[92m'
msg = color + msg + '\033[0m'
print(msg)
class AutoFixSuggestion(Exception):
def __init__(self, instruction, cmd):
super(AutoFixSuggestion, self).__init__(instruction)
self.cmd = cmd
checks = [check_python, check_pip, check_venv, check_setuptools, check_wheel, check_python_dev]
if AUTOFIX:
checks.insert(0, check_curl)
if IS_DEBIAN:
checks.insert(0, check_apt)
if SUDO:
checks.insert(0, check_sudo)
try:
last_fix = None
for check in checks:
print('Checking ' + check.__name__.split('_', 1)[1].replace('_', ' '))
while True:
try:
check()
break
except AutoFixSuggestion as e:
cmds = e.cmd if isinstance(e.cmd, tuple) else (e.cmd,)
if AUTOFIX:
if cmds == last_fix:
error('! Failed to fix automatically, so you gotta fix it yourself.')
sys.exit(1)
else:
for cmd in cmds:
run(cmd, return_output=True, raises=True)
last_fix = cmds
else:
print(' ' + str(e) + ': ' + ' && '.join(cmds) + '\n')
print('# Run the above suggested command(s) manually and then re-run to continue checking,')
print(' or re-run using "python - --autofix" to run all suggested commands automatically.')
sys.exit(1)
print('')
except Exception as e:
error('!', str(e))
sys.exit(1)
except KeyboardInterrupt:
sys.exit(1)
echo('Python is alive and well. Good job!', color='green')
| 34.730897 | 117 | 0.583604 |
8ca9ba845d478f56e88d64dbe2da8f0ea5549fa4 | 460 | asm | Assembly | data/pokemon/base_stats/hoenn/swablu.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | null | null | null | data/pokemon/base_stats/hoenn/swablu.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | null | null | null | data/pokemon/base_stats/hoenn/swablu.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | null | null | null | db 0 ; 333 DEX NO
db 45, 40, 60, 50, 40, 75
; hp atk def spd sat sdf
db NORMAL, FLYING ; type
db 255 ; catch rate
db 74 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_F50 ; gender ratio
db 100 ; unknown 1
db 20 ; step cycles to hatch
db 5 ; unknown 2
INCBIN "gfx/pokemon/hoenn/swablu/front.dimensions"
db 0, 0, 0, 0 ; padding
db GROWTH_ERRATIC ; growth rate
dn EGG_FLYING, EGG_DRAGON ; egg groups
; tm/hm learnset
tmhm
; end
| 20.909091 | 51 | 0.663043 |
f1ac7aa41b580c8db42419cec8a769b053dbac2f | 415 | rb | Ruby | db/migrate/20201206183348_add_taxon_images_credit.rb | MattBlissett/bionomia | 90d9026d5f9357b7e40ad93b6908723ae4ea292c | [
"MIT"
] | 8 | 2020-06-21T11:36:31.000Z | 2021-12-15T02:21:42.000Z | db/migrate/20201206183348_add_taxon_images_credit.rb | MattBlissett/bionomia | 90d9026d5f9357b7e40ad93b6908723ae4ea292c | [
"MIT"
] | 135 | 2020-06-16T22:45:54.000Z | 2022-03-09T03:51:56.000Z | db/migrate/20201206183348_add_taxon_images_credit.rb | MattBlissett/bionomia | 90d9026d5f9357b7e40ad93b6908723ae4ea292c | [
"MIT"
] | 11 | 2020-06-21T11:36:34.000Z | 2021-12-06T18:49:46.000Z | class AddTaxonImagesCredit < ActiveRecord::Migration[6.0]
def up
unless column_exists? :taxon_images, :credit
add_column :taxon_images, :credit, :string
add_column :taxon_images, :licenseURL, :string
end
end
def down
if column_exists? :taxon_images, :credit
remove_column :taxon_images, :credit, :string
remove_column :taxon_images, :licenseURL, :string
end
end
end
| 25.9375 | 57 | 0.710843 |
7932ee22245535cb2f3a6aaa3cca03f8b87a4bd8 | 6,704 | kt | Kotlin | src/test/kotlin/com/github/vertical_blank/sqlformatter/N1qlFormatterTest.kt | Willam2004/sql-formatter | bb9d26533e417378730aed91fc3e75f0994d1fb5 | [
"MIT"
] | 106 | 2019-06-04T13:57:09.000Z | 2022-03-17T12:44:45.000Z | src/test/kotlin/com/github/vertical_blank/sqlformatter/N1qlFormatterTest.kt | Willam2004/sql-formatter | bb9d26533e417378730aed91fc3e75f0994d1fb5 | [
"MIT"
] | 42 | 2019-04-04T16:42:27.000Z | 2022-03-01T14:13:35.000Z | src/test/kotlin/com/github/vertical_blank/sqlformatter/N1qlFormatterTest.kt | Willam2004/sql-formatter | bb9d26533e417378730aed91fc3e75f0994d1fb5 | [
"MIT"
] | 25 | 2019-10-02T07:29:29.000Z | 2022-01-21T02:46:27.000Z | package com.github.vertical_blank.sqlformatter
import com.github.vertical_blank.sqlformatter.features.supportsBetween
import com.github.vertical_blank.sqlformatter.features.supportsJoin
import com.github.vertical_blank.sqlformatter.features.supportsOperators
import com.github.vertical_blank.sqlformatter.features.supportsSchema
import com.github.vertical_blank.sqlformatter.features.supportsStrings
import com.github.vertical_blank.sqlformatter.languages.Dialect
import com.github.vertical_blank.sqlformatter.languages.StringLiteral
import org.spekframework.spek2.Spek
import org.spekframework.spek2.style.specification.describe
object N1qlFormatterTest :
Spek({
val formatter = SqlFormatter.of(Dialect.N1ql)
describe("N1qlFormatter") {
with(formatter) {
behavesLikeSqlFormatter(formatter)
supportsStrings(
formatter,
listOf(
StringLiteral.DOUBLE_QUOTE, StringLiteral.SINGLE_QUOTE, StringLiteral.BACK_QUOTE))
supportsBetween(formatter)
supportsSchema(formatter)
supportsOperators(formatter, listOf("%", "==", "!="))
supportsJoin(formatter, without = listOf("FULL", "CROSS", "NATURAL"))
it("formats SELECT query with element selection expression") {
val result = format("SELECT order_lines[0].productId FROM orders;")
expect(result)
.toBe(
"""
SELECT
order_lines[0].productId
FROM
orders;
""".trimIndent())
}
it("formats SELECT query with primary key querying") {
val result = format("SELECT fname, email FROM tutorial USE KEYS ['dave', 'ian'];")
expect(result)
.toBe(
"""
SELECT
fname,
email
FROM
tutorial
USE KEYS
['dave', 'ian'];
""".trimIndent())
}
it("formats INSERT with {} object literal") {
val result =
format("INSERT INTO heroes (KEY, VALUE) VALUES ('123', {'id':1,'type':'Tarzan'});")
expect(result)
.toBe(
"""
INSERT INTO
heroes (KEY, VALUE)
VALUES
('123', {'id': 1, 'type': 'Tarzan'});
""".trimIndent())
}
it("formats INSERT with large object and array literals") {
val result =
format(
"""
INSERT INTO heroes (KEY, VALUE) VALUES ('123', {'id': 1, 'type': 'Tarzan',
'array': [123456789, 123456789, 123456789, 123456789, 123456789], 'hello': 'world'});
""")
expect(result)
.toBe(
"""
INSERT INTO
heroes (KEY, VALUE)
VALUES
(
'123',
{
'id': 1,
'type': 'Tarzan',
'array': [
123456789,
123456789,
123456789,
123456789,
123456789
],
'hello': 'world'
}
);
""".trimIndent())
}
it("formats SELECT query with UNNEST top level reserver word") {
val result = format("SELECT * FROM tutorial UNNEST tutorial.children c;")
expect(result)
.toBe(
"""
SELECT
*
FROM
tutorial
UNNEST
tutorial.children c;
""".trimIndent())
}
it("formats SELECT query with NEST and USE KEYS") {
val result =
format(
"""
SELECT * FROM usr
USE KEYS 'Elinor_33313792' NEST orders_with_users orders
ON KEYS ARRAY s.order_id FOR s IN usr.shipped_order_history END;
""")
expect(result)
.toBe(
"""
SELECT
*
FROM
usr
USE KEYS
'Elinor_33313792'
NEST
orders_with_users orders ON KEYS ARRAY s.order_id FOR s IN usr.shipped_order_history END;
""".trimIndent())
}
it("formats explained DELETE query with USE KEYS and RETURNING") {
val result = format("EXPLAIN DELETE FROM tutorial t USE KEYS 'baldwin' RETURNING t")
expect(result)
.toBe(
"""
EXPLAIN DELETE FROM
tutorial t
USE KEYS
'baldwin' RETURNING t
""".trimIndent())
}
it("formats UPDATE query with USE KEYS and RETURNING") {
val result =
format(
"UPDATE tutorial USE KEYS 'baldwin' SET type = 'actor' RETURNING tutorial.type")
expect(result)
.toBe(
"""
UPDATE
tutorial
USE KEYS
'baldwin'
SET
type = 'actor' RETURNING tutorial.type
""".trimIndent())
}
it("recognizes \$variables") {
val result = format("SELECT \$variable, \$'var name', \$\"var name\", \$`var name`;")
expect(result)
.toBe(
"""
SELECT
${"$"}variable,
${"$"}'var name',
${"$"}"var name",
${"$"}`var name`;
""".trimIndent())
}
it("replaces \$variables with param values") {
val result =
format(
"SELECT \$variable, $'var name', \$\"var name\", \$`var name`;",
mapOf(
"variable" to """"variable value"""",
"var name" to "'var value'",
))
expect(result)
.toBe(
"""
SELECT
"variable value",
'var value',
'var value',
'var value';
""".trimIndent())
}
it("replaces $ numbered placeholders with param values") {
val result =
format(
"SELECT \$1, \$2, \$0;",
mapOf(
"0" to "first",
"1" to "second",
"2" to "third",
))
expect(result)
.toBe(
"""
SELECT
second,
third,
first;
""".trimIndent())
}
}
}
})
| 30.894009 | 100 | 0.459427 |
3d069350c98ac23bcf102b03abe21bdf895724a4 | 10,091 | sql | SQL | MySQL_POOL/pysical_model.sql | jimjimliu/LOL_Match_Prediction | 9764ee897f7d1811477ad33926504877fa4873e6 | [
"MIT"
] | 3 | 2020-10-06T23:32:59.000Z | 2020-11-22T01:58:39.000Z | MySQL_POOL/pysical_model.sql | jimjimliu/LOL_Match_Prediction | 9764ee897f7d1811477ad33926504877fa4873e6 | [
"MIT"
] | null | null | null | MySQL_POOL/pysical_model.sql | jimjimliu/LOL_Match_Prediction | 9764ee897f7d1811477ad33926504877fa4873e6 | [
"MIT"
] | 1 | 2021-05-17T06:16:08.000Z | 2021-05-17T06:16:08.000Z | --create database RIOT;
-- table to store all summoner information
create table `all_league_entry`(
`id` int not null auto_increment unique key,
`leagueId` varchar(255) comment 'league game ID',
`queueType` varchar(255) comment 'game queue type. i.e. rank solo5x5',
`tier` TINYTEXT comment 'rank tier. i.e. diamond',
`rank` char(3) comment 'rank level. i.e. diamond IV',
`summonerId` varchar(255) not null comment 'game user id',
`summonerName` varchar(255) comment 'user name in the game',
`leaguePoints` MEDIUMINT comment '',
`wins` MEDIUMINT comment '',
`losses` MEDIUMINT comment '',
`veteran` TINYINT(1) comment '',
`inactive` TINYINT(1) comment '',
`freshBlood` TINYINT(1) comment '',
`hotStreak` TINYINT(1) comment '',
`accountId` varchar(255) not null comment 'user RIOT account id encrypted',
`puuid` varchar(255) not null comment '',
`summonerLevel` MEDIUMINT comment '',
primary key(`accountId`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
--alter table all_league_entry add constraint unique_account unique(`accountId`);
--alter table all_league_entry add id int not null auto_increment unique key;
-- table stores all the champions
create table `all_champion`(
`id` int not null auto_increment unique key comment '',
`version` varchar(10) comment 'current client version',
`champion_id` varchar(255) not null comment 'champion name',
`key` SMALLINT not null comment 'champion id',
`name` varchar(255) not null comment '',
`tag1` varchar(20) not null comment 'champion tag',
`tag2` varchar(20) not null comment '',
`title` varchar(100) comment '',
`hp` SMALLINT comment '',
`hpperlevel` SMALLINT comment '',
`mp` SMALLINT comment '',
`mpperlevel` SMALLINT comment '',
`movespeed` SMALLINT comment '',
`armor` SMALLINT comment '',
`armorperlevel` decimal(5,3) comment '',
`spellblock` decimal(5,3) comment '',
`spellblockperlevel` decimal(5,3) comment '',
`attackrange` SMALLINT comment '',
`hpregen` SMALLINT comment '',
`hpregenperlevel` SMALLINT comment '',
`mpregen` SMALLINT comment '',
`mpregenperlevel` SMALLINT comment '',
`crit` SMALLINT comment '',
`critperlevel` SMALLINT comment '',
`attackdamage` SMALLINT comment '',
`attackdamageperlevel` SMALLINT comment '',
`attackspeedperlevel` decimal(5,3) comment '',
`attackspeed` decimal(5,3) comment '',
primary key (`key`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- table to store matches
create table `match_list`(
`id` int not null auto_increment comment '',
`accountId` varchar(255) not null comment 'user RIOT account id',
`gameId` BIGINT not null comment 'id that refers to a specific game',
`role` varchar(100) comment '',
`season` TINYINT comment '',
`platformId` varchar(255) comment '',
`champion` SMALLINT comment 'champion id',
`queue` SMALLINT comment '',
`lane` varchar(100) comment '',
`timestamp` TIMESTAMP comment '',
primary key(`gameId`),
unique key (`id`),
foreign key(`champion`) references all_champion(`key`),
foreign key (`accountId`) references all_league_entry(`accountId`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- table stores the game data of a champion used in a game
-- one row in table match maps to 10 rows in champ_game_stat
create table `champ_game_stat`(
`statId` int not null primary key,
`gameId` BIGINT not null,
`championId` SMALLINT,
`spell1Id` SMALLINT,
`spell2Id` SMALLINT,
`item0` SMALLINT,
`item1` SMALLINT,
`item2` SMALLINT,
`item3` SMALLINT,
`item4` SMALLINT,
`item5` SMALLINT,
`item6` SMALLINT,
`kills` SMALLINT,
`deaths` SMALLINT,
`assists` SMALLINT,
`largestKillingSpree` SMALLINT,
`largestMultiKill` SMALLINT,
`killingSprees` SMALLINT,
`longestTimeSpentLiving` SMALLINT,
`doubleKills` SMALLINT,
`tripleKills` SMALLINT,
`quadraKills` SMALLINT,
`pentaKills` SMALLINT,
`unrealKills` SMALLINT,
`totalDamageDealt` MEDIUMINT,
`magicDamageDealt` MEDIUMINT,
`physicalDamageDealt` MEDIUMINT,
`trueDamageDealt` MEDIUMINT,
`largestCriticalStrike` MEDIUMINT,
`totalDamageDealtToChampions` MEDIUMINT,
`magicDamageDealtToChampions` MEDIUMINT,
`physicalDamageDealtToChampions` MEDIUMINT,
`trueDamageDealtToChampions` MEDIUMINT,
`totalHeal` MEDIUMINT,
`totalUnitsHealed` MEDIUMINT,
`damageSelfMitigated` MEDIUMINT,
`damageDealtToObjectives` MEDIUMINT,
`damageDealtToTurrets` MEDIUMINT,
`visionScore` SMALLINT,
`timeCCingOthers` SMALLINT,
`totalDamageTaken` MEDIUMINT,
`magicalDamageTaken` MEDIUMINT,
`physicalDamageTaken` MEDIUMINT,
`trueDamageTaken` MEDIUMINT,
`goldEarned` MEDIUMINT,
`goldSpent` MEDIUMINT,
`turretKills` SMALLINT,
`inhibitorKills` SMALLINT,
`totalMinionsKilled` MEDIUMINT,
`neutralMinionsKilled` SMALLINT,
`neutralMinionsKilledTeamJungle` SMALLINT,
`neutralMinionsKilledEnemyJungle` SMALLINT,
`totalTimeCrowdControlDealt` MEDIUMINT,
`champLevel` SMALLINT,
`visionWardsBoughtInGame` SMALLINT,
`sightWardsBoughtInGame` SMALLINT,
`wardsPlaced` SMALLINT,
`wardsKilled` SMALLINT,
`firstBloodKill` TINYINT,
`firstBloodAssist` TINYINT,
`firstTowerKill` TINYINT,
`firstTowerAssist` TINYINT,
`firstInhibitorKill` TINYINT,
`firstInhibitorAssist` TINYINT,
foreign key(`championId`) references all_champion(`key`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- table stores a matches' game data in details
create table `match`(
`id` int not null auto_increment unique key,
`gameId` BIGINT not null primary key,
`gameDuration` SMALLINT,
`team1_win` TINYINT not null,
`team1_firstBlood` TINYINT,
`team1_firstTower` TINYINT,
`team1_firstInhibitor` TINYINT,
`team1_firstBaron` TINYINT,
`team1_firstDragon` TINYINT,
`team1_firstRiftHerald` TINYINT,
`team1_towerKills` SMALLINT,
`team1_inhibitorKills` SMALLINT,
`team1_baronKills` SMALLINT,
`team1_dragonKills` SMALLINT,
`team1_vilemawKills` SMALLINT,
`team1_riftHeraldKills` SMALLINT,
`team1_dominionVictoryScore` SMALLINT,
`team1_ban1` SMALLINT,
`team1_ban2` SMALLINT,
`team1_ban3` SMALLINT,
`team1_ban4` SMALLINT,
`team1_ban5` SMALLINT,
`team1_champ1_championId` SMALLINT not null comment 'champion id',
`team1_champ2_championId` SMALLINT not null comment 'champion id',
`team1_champ3_championId` SMALLINT not null comment 'champion id',
`team1_champ4_championId` SMALLINT not null comment 'champion id',
`team1_champ5_championId` SMALLINT not null comment 'champion id',
`team1_champ1_statId` int not null comment 'champion stats in the game',
`team1_champ2_statId` int not null comment 'champion stats in the game',
`team1_champ3_statId` int not null comment 'champion stats in the game',
`team1_champ4_statId` int not null comment 'champion stats in the game',
`team1_champ5_statId` int not null comment 'champion stats in the game',
`team2_win` TINYINT not null,
`team2_firstBlood` TINYINT,
`team2_firstTower` TINYINT,
`team2_firstInhibitor` TINYINT,
`team2_firstBaron` TINYINT,
`team2_firstDragon` TINYINT,
`team2_firstRiftHerald` TINYINT,
`team2_towerKills` SMALLINT,
`team2_inhibitorKills` SMALLINT,
`team2_baronKills` SMALLINT,
`team2_dragonKills` SMALLINT,
`team2_vilemawKills` SMALLINT,
`team2_riftHeraldKills` SMALLINT,
`team2_dominionVictoryScore` SMALLINT,
`team2_ban1` SMALLINT,
`team2_ban2` SMALLINT,
`team2_ban3` SMALLINT,
`team2_ban4` SMALLINT,
`team2_ban5` SMALLINT,
`team2_champ1_championId` SMALLINT not null comment 'champion id',
`team2_champ2_championId` SMALLINT not null comment 'champion id',
`team2_champ3_championId` SMALLINT not null comment 'champion id',
`team2_champ4_championId` SMALLINT not null comment 'champion id',
`team2_champ5_championId` SMALLINT not null comment 'champion id',
`team2_champ1_statId` int not null comment 'champion stats in the game',
`team2_champ2_statId` int not null comment 'champion stats in the game',
`team2_champ3_statId` int not null comment 'champion stats in the game',
`team2_champ4_statId` int not null comment 'champion stats in the game',
`team2_champ5_statId` int not null comment 'champion stats in the game',
foreign key(`team1_champ1_championId`) references all_champion(`key`),
foreign key(`team1_champ2_championId`) references all_champion(`key`),
foreign key(`team1_champ3_championId`) references all_champion(`key`),
foreign key(`team1_champ4_championId`) references all_champion(`key`),
foreign key(`team1_champ5_championId`) references all_champion(`key`),
foreign key(`team2_champ1_championId`) references all_champion(`key`),
foreign key(`team2_champ2_championId`) references all_champion(`key`),
foreign key(`team2_champ3_championId`) references all_champion(`key`),
foreign key(`team2_champ4_championId`) references all_champion(`key`),
foreign key(`team2_champ5_championId`) references all_champion(`key`),
foreign key(`team1_champ1_statId`) references champ_game_stat(`statId`),
foreign key(`team1_champ2_statId`) references champ_game_stat(`statId`),
foreign key(`team1_champ3_statId`) references champ_game_stat(`statId`),
foreign key(`team1_champ4_statId`) references champ_game_stat(`statId`),
foreign key(`team1_champ5_statId`) references champ_game_stat(`statId`),
foreign key(`team2_champ1_statId`) references champ_game_stat(`statId`),
foreign key(`team2_champ2_statId`) references champ_game_stat(`statId`),
foreign key(`team2_champ3_statId`) references champ_game_stat(`statId`),
foreign key(`team2_champ4_statId`) references champ_game_stat(`statId`),
foreign key(`team2_champ5_statId`) references champ_game_stat(`statId`),
foreign key(`gameId`) references match_list(`gameId`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
| 42.940426 | 81 | 0.724309 |
2c6d3738ccc354acdd3c973dcd255157c4f68c90 | 52 | sql | SQL | src/main/tsql/aggregation/the-blunder.sql | hiepluong2205/algo-champion | c451b8bd796d9f160ccff62d2a2d9d3d34a67685 | [
"MIT"
] | null | null | null | src/main/tsql/aggregation/the-blunder.sql | hiepluong2205/algo-champion | c451b8bd796d9f160ccff62d2a2d9d3d34a67685 | [
"MIT"
] | 2 | 2022-03-08T19:05:02.000Z | 2022-03-08T19:05:51.000Z | src/main/tsql/aggregation/the-blunder.sql | hiepluong2205/algo-champion | c451b8bd796d9f160ccff62d2a2d9d3d34a67685 | [
"MIT"
] | null | null | null | SELECT * FROM EMPLOYEES
WHERE
ORDER BY
GROUP BY
; | 10.4 | 24 | 0.730769 |
bb48183252c64fb06b8fcecff08251c140f9c874 | 1,795 | lua | Lua | lua/lualine/themes/idjo.lua | cocatrip/onedark.nvim | 3e104772992105b00c9be9c57424d1ad37bfdd5e | [
"MIT"
] | null | null | null | lua/lualine/themes/idjo.lua | cocatrip/onedark.nvim | 3e104772992105b00c9be9c57424d1ad37bfdd5e | [
"MIT"
] | null | null | null | lua/lualine/themes/idjo.lua | cocatrip/onedark.nvim | 3e104772992105b00c9be9c57424d1ad37bfdd5e | [
"MIT"
] | null | null | null | local c = require('idjo.colors')
local idjo_lualine = {
inactive = {
a = {fg = c.grey, bg = c.bg_d, gui = 'bold'},
b = {fg = c.grey, bg = c.bg_d},
c = {fg = c.grey, bg = c.bg_d},
x = {fg = c.grey, bg = c.bg_d},
y = {fg = c.grey, bg = c.bg_d},
z = {fg = c.grey, bg = c.bg_d},
},
normal = {
a = {fg = c.green , bg = c.bg1, gui = 'bold'},
b = {fg = c.fg , bg = c.bg3},
c = {fg = c.fg , bg = c.bg_d},
x = {fg = c.fg , bg = c.bg_d},
y = {fg = c.fg , bg = c.bg3},
z = {fg = c.fg , bg = c.bg1},
},
visual = {
a = {fg = c.purple , bg = c.bg1, gui = 'bold'},
b = {fg = c.fg , bg = c.bg3},
c = {fg = c.fg , bg = c.bg_d},
x = {fg = c.fg , bg = c.bg_d},
y = {fg = c.fg , bg = c.bg3},
z = {fg = c.fg , bg = c.bg1},
},
replace = {
a = {fg = c.red , bg = c.bg1, gui = 'bold'},
b = {fg = c.fg , bg = c.bg3},
c = {fg = c.fg , bg = c.bg_d},
x = {fg = c.fg , bg = c.bg_d},
y = {fg = c.fg , bg = c.bg3},
z = {fg = c.fg , bg = c.bg1},
},
insert = {
a = {fg = c.blue, bg = c.bg1, gui = 'bold'},
b = {fg = c.fg , bg = c.bg3},
c = {fg = c.fg , bg = c.bg_d},
x = {fg = c.fg , bg = c.bg_d},
y = {fg = c.fg , bg = c.bg3},
z = {fg = c.fg , bg = c.bg1},
},
command = {
a = {fg = c.yellow , bg = c.bg1, gui = 'bold'},
b = {fg = c.fg , bg = c.bg3},
c = {fg = c.fg , bg = c.bg_d},
x = {fg = c.fg , bg = c.bg_d},
y = {fg = c.fg , bg = c.bg3},
z = {fg = c.fg , bg = c.bg1},
}
}
return idjo_lualine;
| 32.053571 | 56 | 0.342061 |
bb15d390bd894ef866d42100987c982bbb511f48 | 1,486 | rb | Ruby | app/models/tag.rb | ipfs-shipyard/ecosystem-dashboard | d4de15e3eb451c268beae7ff90050a157faa0ea9 | [
"Apache-2.0",
"MIT"
] | 15 | 2020-08-13T18:28:41.000Z | 2022-03-16T02:37:42.000Z | app/models/tag.rb | web-developer77/ruby-ecosystem | 9b45c4699b23bac31fea4d914f8055da2292aef8 | [
"Apache-2.0",
"MIT"
] | 225 | 2020-06-05T15:44:08.000Z | 2022-03-29T17:02:44.000Z | app/models/tag.rb | web-developer77/ruby-ecosystem | 9b45c4699b23bac31fea4d914f8055da2292aef8 | [
"Apache-2.0",
"MIT"
] | 6 | 2020-06-15T19:31:56.000Z | 2021-05-19T03:17:19.000Z | class Tag < ApplicationRecord
include Releaseable
belongs_to :repository
validates_presence_of :name, :sha, :repository
validates_uniqueness_of :name, scope: :repository_id
scope :published, -> { where('published_at IS NOT NULL') }
after_commit :save_packages
def save_packages
repository.try(:save_packages)
end
def has_packages?
repository && repository.packages.without_versions.length > 0
end
def <=>(other)
if parsed_number.is_a?(String) || other.parsed_number.is_a?(String)
other.number <=> number
else
other.parsed_number <=> parsed_number
end
end
def prerelease?
!!parsed_number.try(:pre)
end
def number
name
end
def repository_url
case repository.host_type
when 'GitHub'
"#{repository.url}/releases/tag/#{name}"
when 'GitLab'
"#{repository.url}/tags/#{name}"
when 'Bitbucket'
"#{repository.url}/commits/tag/#{name}"
end
end
def related_tags
repository.sorted_tags
end
def tag_index
related_tags.index(self)
end
def next_tag
related_tags[tag_index - 1]
end
def previous_tag
related_tags[tag_index + 1]
end
alias_method :previous_version, :previous_tag
def related_tag
true
end
def diff_url
return nil unless repository && previous_tag && previous_tag
repository.compare_url(previous_tag.number, number)
end
def runtime_dependencies_count
nil # tags can't have dependencies yet
end
end
| 19.051282 | 71 | 0.696501 |
b2c5e558b71549ec4885e41eca936b455678ffaf | 1,555 | py | Python | api/client/src/pcluster_client/sigv4_auth.py | maclema/aws-parallelcluster | ade6e5e76201ee43c6e222fcd1c2891aba938838 | [
"Apache-2.0"
] | 415 | 2018-11-13T15:02:15.000Z | 2022-03-31T15:26:06.000Z | api/client/src/pcluster_client/sigv4_auth.py | maclema/aws-parallelcluster | ade6e5e76201ee43c6e222fcd1c2891aba938838 | [
"Apache-2.0"
] | 2,522 | 2018-11-13T16:16:27.000Z | 2022-03-31T13:57:10.000Z | api/client/src/pcluster_client/sigv4_auth.py | yuleiwan/aws-parallelcluster | aad2a3019ef4ad08d702f5acf41b152b3f7a0b46 | [
"Apache-2.0"
] | 164 | 2018-11-14T22:47:46.000Z | 2022-03-22T11:33:22.000Z | """Sigv4 Signing Support"""
# Copyright 2021 Amazon.com, Inc. or its affiliates. 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. A copy
# of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
# OF ANY KIND, express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import boto3
import botocore
import json
def sigv4_auth(method, host, path, querys, body, headers):
"Adds authorization headers for sigv4 to headers parameter."
endpoint = host.replace('https://', '').replace('http://', '')
_api_id, _service, region, _domain = endpoint.split('.', maxsplit=3)
request_parameters = '&'.join([f"{k}={v}" for k, v in querys])
url = f"{host}{path}?{request_parameters}"
session = botocore.session.Session()
request = botocore.awsrequest.AWSRequest(method=method,
url=url,
data=json.dumps(body) if body else None)
botocore.auth.SigV4Auth(session.get_credentials(),
"execute-api", region).add_auth(request)
prepared_request = request.prepare()
headers['host'] = endpoint.split('/', maxsplit=1)[0]
for k, value in prepared_request.headers.items():
headers[k] = value
| 39.871795 | 85 | 0.659807 |
afb2b542b324f10f1730b7826ccd52f9fa679ba5 | 1,039 | rb | Ruby | recipes/default.rb | johnbellone/mesos-cluster-cookbook | 587dbeb5a25428eafbc9cba9d035ad23e056399f | [
"Apache-2.0"
] | 1 | 2015-08-06T01:33:52.000Z | 2015-08-06T01:33:52.000Z | recipes/default.rb | johnbellone/mesos-cluster-cookbook | 587dbeb5a25428eafbc9cba9d035ad23e056399f | [
"Apache-2.0"
] | null | null | null | recipes/default.rb | johnbellone/mesos-cluster-cookbook | 587dbeb5a25428eafbc9cba9d035ad23e056399f | [
"Apache-2.0"
] | null | null | null | #
# Cookbook: mesos-cluster
# License: Apache 2.0
#
# Copyright (C) 2015 Bloomberg Finance L.P.
#
include_recipe 'build-essential::default'
include_recipe 'selinux::permissive'
node.default['java']['jdk_version'] = '7'
node.default['java']['accept_license_agreement'] = true
include_recipe 'java::default', 'maven::default'
include_recipe 'python::default'
poise_service_user node['mesos-cluster']['service_user'] do
group node['mesos-cluster']['service_group']
end
config = mesos_config node['mesos-cluster']['service_name'] do |r|
user node['mesos-cluster']['service_user']
group node['mesos-cluster']['service_group']
node['mesos-cluster']['config'].each_pair { |k, v| r.send(k ,v) }
notifies :restart, "mesos_service[#{name}]", :delayed
end
mesos_service node['mesos-cluster']['service_name'] do |r|
user node['mesos-cluster']['service_user']
group node['mesos-cluster']['service_group']
config_path config.path
node['mesos-cluster']['service'].each_pair { |k, v| r.send(k ,v) }
action [:create, :enable]
end
| 29.685714 | 68 | 0.714148 |
745763e48dbe4ef8fa198c206a9245ed6c7c3d7c | 155 | sql | SQL | src/test/resources/sql/create_function/d179eb70.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 66 | 2018-06-15T11:34:03.000Z | 2022-03-16T09:24:49.000Z | src/test/resources/sql/create_function/d179eb70.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 13 | 2019-03-19T11:56:28.000Z | 2020-08-05T04:20:50.000Z | src/test/resources/sql/create_function/d179eb70.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 28 | 2019-01-05T19:59:02.000Z | 2022-03-24T11:55:50.000Z | -- file:rangetypes.sql ln:396 expect:true
create function anyarray_anyrange_func(a anyarray, r anyrange)
returns anyelement as 'select $1[1] + lower($2)
| 38.75 | 62 | 0.767742 |
0785e1b9ca79af7bf14d4e956edf97088bcf2ca0 | 136 | kt | Kotlin | compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/genericInReceiver.kt | Mu-L/kotlin | 5c3ce66e9979d2b3592d06961e181fa27fa88431 | [
"ECL-2.0",
"Apache-2.0"
] | 45,293 | 2015-01-01T06:23:46.000Z | 2022-03-31T21:55:51.000Z | compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/genericInReceiver.kt | Seantheprogrammer93/kotlin | f7aabf03f89bdd39d9847572cf9e0051ea42c247 | [
"ECL-2.0",
"Apache-2.0"
] | 3,386 | 2015-01-12T13:28:50.000Z | 2022-03-31T17:48:15.000Z | compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/genericInReceiver.kt | Seantheprogrammer93/kotlin | f7aabf03f89bdd39d9847572cf9e0051ea42c247 | [
"ECL-2.0",
"Apache-2.0"
] | 6,351 | 2015-01-03T12:30:09.000Z | 2022-03-31T20:46:54.000Z | fun test_1(a: String, s: String) {
val pair = s.let(a::to)
}
fun test_2(a: String, s: String) {
val pair = s.let { a.to(it) }
} | 19.428571 | 34 | 0.558824 |
701053625669410e31dfb732c90d83f42e4979b7 | 3,690 | go | Go | pkg/notifications/reweigh_requested.go | pshrabstein/mymove | 480fe4105383461b3037d7f0be92484422050d31 | [
"MIT"
] | null | null | null | pkg/notifications/reweigh_requested.go | pshrabstein/mymove | 480fe4105383461b3037d7f0be92484422050d31 | [
"MIT"
] | 115 | 2022-01-04T01:21:00.000Z | 2022-03-31T11:27:16.000Z | pkg/notifications/reweigh_requested.go | pshrabstein/mymove | 480fe4105383461b3037d7f0be92484422050d31 | [
"MIT"
] | null | null | null | package notifications
import (
"bytes"
"fmt"
html "html/template"
"strings"
text "text/template"
"github.com/gofrs/uuid"
"go.uber.org/zap"
"github.com/transcom/mymove/pkg/appcontext"
"github.com/transcom/mymove/pkg/assets"
"github.com/transcom/mymove/pkg/models"
)
var (
reweighRequestedRawTextTemplate = string(assets.MustAsset("pkg/notifications/templates/reweigh_requested_template.txt"))
reweighRequestedTextTemplate = text.Must(text.New("text_template").Parse(reweighRequestedRawTextTemplate))
reweighRequestedRawHTMLTemplate = string(assets.MustAsset("pkg/notifications/templates/reweigh_requested_template.html"))
reweighRequestedHTMLTemplate = html.Must(html.New("text_template").Parse(reweighRequestedRawHTMLTemplate))
)
// ReweighRequested has notification content for submitted moves
type ReweighRequested struct {
moveID uuid.UUID
shipment models.MTOShipment
htmlTemplate *html.Template
textTemplate *text.Template
}
// NewReweighRequested returns a new move submitted notification
func NewReweighRequested(moveID uuid.UUID, shipment models.MTOShipment) *ReweighRequested {
return &ReweighRequested{
moveID: moveID,
shipment: shipment,
htmlTemplate: reweighRequestedHTMLTemplate,
textTemplate: reweighRequestedTextTemplate,
}
}
func (m ReweighRequested) emails(appCtx appcontext.AppContext) ([]emailContent, error) {
var emails []emailContent
serviceMember, err := models.GetCustomerFromShipment(appCtx.DB(), m.shipment.ID)
if err != nil {
appCtx.Logger().Error("error retrieving service member associated with this shipment", zap.Error(err))
}
if len(*serviceMember.PersonalEmail) == 0 {
return emails, fmt.Errorf("no email found for service member")
}
htmlBody, textBody, err := m.renderTemplates(appCtx, reweighRequestedEmailData{})
if err != nil {
appCtx.Logger().Error("error rendering template", zap.Error(err))
}
shipmentType := strings.Split(string(m.shipment.ShipmentType), "_")[0]
smEmail := emailContent{
recipientEmail: *serviceMember.PersonalEmail,
subject: fmt.Sprintf("FYI: Your %v should be reweighed before it is delivered", shipmentType),
htmlBody: htmlBody,
textBody: textBody,
}
appCtx.Logger().Info("Generated reweigh requested email",
zap.String("moveLocator", m.shipment.MoveTaskOrder.Locator))
// TODO: Send email to trusted contacts when that's supported
return append(emails, smEmail), nil
}
func (m ReweighRequested) renderTemplates(appCtx appcontext.AppContext, data reweighRequestedEmailData) (string, string, error) {
htmlBody, err := m.RenderHTML(appCtx, data)
if err != nil {
return "", "", fmt.Errorf("error rendering html template using %#v", data)
}
textBody, err := m.RenderText(appCtx, data)
if err != nil {
return "", "", fmt.Errorf("error rendering text template using %#v", data)
}
return htmlBody, textBody, nil
}
type reweighRequestedEmailData struct{}
// RenderHTML renders the html for the email
func (m ReweighRequested) RenderHTML(appCtx appcontext.AppContext, data reweighRequestedEmailData) (string, error) {
var htmlBuffer bytes.Buffer
if err := m.htmlTemplate.Execute(&htmlBuffer, data); err != nil {
appCtx.Logger().Error("cant render html template ", zap.Error(err))
}
return htmlBuffer.String(), nil
}
// RenderText renders the text for the email
func (m ReweighRequested) RenderText(appCtx appcontext.AppContext, data reweighRequestedEmailData) (string, error) {
var textBuffer bytes.Buffer
if err := m.textTemplate.Execute(&textBuffer, data); err != nil {
appCtx.Logger().Error("cant render text template ", zap.Error(err))
return "", err
}
return textBuffer.String(), nil
}
| 33.853211 | 129 | 0.754201 |
e7894e01aa2c71682ed23fafe2136b7242e4eaac | 663 | js | JavaScript | src/components/FeaturedArt/AbstractCollection.js | magic8baller/sifis-portfolio-1 | 0a5e0874ef4bcba57ffa5ee9a9838d1d165109e0 | [
"MIT"
] | 1 | 2019-09-15T17:57:04.000Z | 2019-09-15T17:57:04.000Z | src/components/FeaturedArt/AbstractCollection.js | magic8baller/sifis-portfolio-1 | 0a5e0874ef4bcba57ffa5ee9a9838d1d165109e0 | [
"MIT"
] | 7 | 2021-03-09T17:18:41.000Z | 2022-02-26T17:37:43.000Z | src/components/FeaturedArt/AbstractCollection.js | magic8baller/sifis-portfolio-1 | 0a5e0874ef4bcba57ffa5ee9a9838d1d165109e0 | [
"MIT"
] | null | null | null | import {Link} from "gatsby";
import React from 'react';
import styles from '../../css/items.module.css';
import {useAbstract} from '../../hooks';
import {Artwork} from '../Artwork';
import Title from '../StyledTitle';
const AbstractCollection = () => {
const artworks = useAbstract()
return (
<main className={styles.artworks}>
<Title title='abstract' subtitle='collection' />
<section className={styles.center}>
{artworks.map(({node}) => {
return <Artwork key={node.contentful_id} art={node} />
})}
</section>
<Link to='/gallery/' className='btn-primary'>return to gallery</Link>
</main>
)
}
export default AbstractCollection
| 25.5 | 72 | 0.665158 |
969ccd2d585e04155dab0552f197aa8e293c4a13 | 6,824 | html | HTML | gltf-asset-test.html | ZeaInc/gltf-loader | 437f633eab5ac507190ba5fa3fb1100e9a20c97c | [
"MIT"
] | 2 | 2021-04-26T20:53:24.000Z | 2021-04-29T03:39:00.000Z | gltf-asset-test.html | ZeaInc/gltf-loader | 437f633eab5ac507190ba5fa3fb1100e9a20c97c | [
"MIT"
] | 2 | 2021-05-17T08:06:18.000Z | 2021-11-01T16:56:22.000Z | gltf-asset-test.html | ZeaInc/gltf-loader | 437f633eab5ac507190ba5fa3fb1100e9a20c97c | [
"MIT"
] | null | null | null | <!DOCTYPE html>
<html>
<head>
<title>GLTF Loader Test</title>
<link rel="stylesheet" href="./testing-e2e/styles/tachyons.min.css" />
<link rel="stylesheet" href="./testing-e2e/styles/main.css" />
<script src="https://cdn.jsdelivr.net/npm/@zeainc/zea-engine/dist/index.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@zeainc/zea-engine/dist/plugins.umd.js"></script>
<script src="https://www.gstatic.com/draco/v1/decoders/draco_decoder_gltf.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@zeainc/gltf-loader/dist/index.umd.js"></script>
<style>
body {
height: 100vh;
overflow: hidden;
margin: 0em;
}
#canvas {
position: relative;
height: 100%;
width: 100%;
}
.fps-display {
position: fixed;
bottom: 10px;
right: 10px;
color: #333333;
}
.progress-display {
position: fixed;
left: 0px;
bottom: 0px;
width: 100%;
height: 10px;
}
.hidden {
visibility: hidden;
}
</style>
</head>
<body>
<canvas id="canvas"></canvas>
<div class="fps-display" id="fps"></div>
<progress class="progress-display" id="progress" value="0" max="100">0%</progress>
<div id="dropZoneWrapper">
<div id="dropZone">
<form class="my-form">
<p>Drag and drop a GLTF file to view</p>
<input type="file" id="fileElem" multiple accept="*.glb" onchange="handleFiles(this.files)" />
<label class="button" for="fileElem">Select a GLTF file</label>
</form>
</div>
<script type="module">
const {
GLRenderer,
Scene,
Vec3,
Xfo,
Color,
Sphere,
Material,
GeomItem,
GLBoundingBoxPass,
EnvMap,
resourceLoader,
} = zeaEngine
const scene = new Scene()
const renderer = new GLRenderer(document.getElementById('canvas'), { hideSplash: true, xrCompatible: false })
renderer.setScene(scene)
const envMap = new EnvMap()
envMap.load('./testing-e2e/data/pisa.zenv')
scene.setEnvMap(envMap)
scene.displayEnvMapParam.value = false
renderer.exposure = 1.2
renderer.getViewport().getCamera().setPositionAndTarget(new Vec3(3, -3, 1.7), new Vec3(0, 0, 0.1))
// /////////////////////////////////////
// Setup a Bounding Box pass to display all
// the bounding boxes of the items in the scene.
// const boundingBoxPass = new GLBoundingBoxPass()
// renderer.addPass(boundingBoxPass)
// boundingBoxPass.addTreeItem(scene.getRoot(), true)
// /////////////////////////////////////
// Setup the custom classes
// The custom pass to handle rendering, and add a custom
// TreeItem to the scene tree
const { GLTFAsset } = gltfLoader
const loadGLTF = (url, filename) => {
document.getElementById('dropZone').classList.add('hidden')
const asset = new GLTFAsset('gltf')
asset.load(url, filename).then(() => {
console.log('Loading done')
const xfo = new Xfo()
const box = asset.getParameter('BoundingBox').getValue()
if (urlParams.has('y2zup')) {
xfo.ori.setFromAxisAndAngle(new Vec3(1, 0, 0), Math.PI * 0.5)
xfo.tr.z = -box.p0.y
} else {
xfo.tr.z = -box.p0.z
}
asset.getParameter('LocalXfo').setValue(xfo)
renderer.frameAll()
})
if (scene.getRoot().getNumChildren() > 1) scene.getRoot().removeChild(1)
scene.getRoot().addChild(asset)
}
const urlParams = new URLSearchParams(window.location.search)
if (urlParams.has('gltf')) {
loadGLTF(urlParams.get('gltf'))
}
// /////////////////////////////////////
// Check that pointer interactions work.
let highlighted
renderer.getViewport().on('pointerMove', (event) => {
if (event.intersectionData) {
const { geomItem, dist } = event.intersectionData
if (geomItem != highlighted) {
if (highlighted) highlighted.removeHighlight('custom')
highlighted = geomItem
highlighted.addHighlight('custom', new Color(0, 1, 0, 0.1))
}
} else {
if (highlighted) highlighted.removeHighlight('custom')
highlighted = null
}
})
// /////////////////////////////////////
// Drag-n-Drop support
const dropZoneWrapper = document.getElementById('dropZoneWrapper')
const dropArea = document.getElementById('dropZone')
;['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => {
dropZoneWrapper.addEventListener(eventName, preventDefaults, false)
})
function preventDefaults(e) {
e.preventDefault()
e.stopPropagation()
}
;['dragenter', 'dragover'].forEach((eventName) => {
dropZoneWrapper.addEventListener(eventName, highlight, false)
})
;['dragleave', 'drop'].forEach((eventName) => {
dropZoneWrapper.addEventListener(eventName, unhighlight, false)
})
function highlight(e) {
dropArea.classList.remove('hidden')
dropArea.classList.add('highlight')
}
function unhighlight(e) {
dropArea.classList.remove('highlight')
}
dropArea.addEventListener('drop', handleDrop, false)
function handleDrop(e) {
let dt = e.dataTransfer
let files = dt.files
handleFiles(files)
}
function handleFiles(files) {
([...files]).forEach((file) => {
if (file) {
const reader = new FileReader();
reader.addEventListener("load", function () {
// convert image file to base64 string
loadGLTF(reader.result, file.name);
}, false);
reader.readAsDataURL(file);
}
})
}
window.handleFiles = handleFiles
// /////////////////////////////////////
let frameCounter = 0
let fps = 0
renderer.on('redrawOccurred', () => {
frameCounter++
})
const fpsElement = document.getElementById('fps')
setInterval(() => {
if (fps != frameCounter * 2) {
fps = frameCounter * 2
fpsElement.textContent = `FPS: ${fps}`
}
frameCounter = 0
}, 500)
// /////////////////////////////////////
resourceLoader.on('progressIncremented', (event) => {
const pct = document.getElementById('progress')
pct.value = event.percent
if (event.percent >= 100) {
setTimeout(() => pct.classList.add('hidden'), 1000)
}
})
</script>
</body>
</html>
| 31.302752 | 115 | 0.552902 |
0bb73302438f93d70fc86fc3be95e9990747a4a0 | 882 | js | JavaScript | config.js | inbitcoin/ccoinsd | 82e5cfd2ca77844b33035dfe6f6bc7584ee5c311 | [
"Apache-2.0"
] | null | null | null | config.js | inbitcoin/ccoinsd | 82e5cfd2ca77844b33035dfe6f6bc7584ee5c311 | [
"Apache-2.0"
] | null | null | null | config.js | inbitcoin/ccoinsd | 82e5cfd2ca77844b33035dfe6f6bc7584ee5c311 | [
"Apache-2.0"
] | null | null | null | var log = require('loglevel')
var config = {
env: 'production',
testnet: false,
cexplorer: {
url: 'https://cexplorer.example.com',
},
logLevel: 'info',
port: 8080,
}
function moduleExists(name) {
try {
return require.resolve(name)
} catch (e) {
return false
}
}
var localConfig = { cexplorer: {} }
if (moduleExists('./config-local')) {
console.log('Loading a local configuration')
localConfig = require('./config-local')
}
config.env = process.env.NODE_ENV || localConfig.env || config.env
config.cexplorer.url = process.env.CEXPLORER_URL || localConfig.cexplorer.url || config.cexplorer.url
config.testnet = process.env.TESTNET || localConfig.testnet || config.testnet
config.logLevel = process.env.LOG_LEVEL || localConfig.logLevel || config.logLevel
config.port = process.env.PORT || localConfig.port || config.port
module.exports = config
| 25.941176 | 101 | 0.701814 |
0bf046105267ff115611416395b08effef2f6aec | 6,417 | js | JavaScript | src/common/mocks/FormListMock.js | caiohsramos/usp-smped-front | e8e54b17b53c86e59b01cf6e0f01e27f55b9251b | [
"MIT"
] | null | null | null | src/common/mocks/FormListMock.js | caiohsramos/usp-smped-front | e8e54b17b53c86e59b01cf6e0f01e27f55b9251b | [
"MIT"
] | null | null | null | src/common/mocks/FormListMock.js | caiohsramos/usp-smped-front | e8e54b17b53c86e59b01cf6e0f01e27f55b9251b | [
"MIT"
] | null | null | null | export const formList = [
{
_id: "5bc7740798d99800109c3504",
version: "1",
owner: "user",
name: "Palestra sobre acessibilidade para web no IME.",
office: "smped",
activity: "Palestra",
axis: "",
fields: [
{
label: "campo 1",
type: "number",
required: true,
order: 1,
_id: "5bc7740798d99800109c3502"
},
{
label: "campo 2",
type: "text",
required: false,
order: 2,
_id: "5bc7740798d99800109c3503"
}
],
_updated: "Wed, 17 Oct 2018 17:40:23 GMT",
_created: "Wed, 17 Oct 2018 17:40:23 GMT",
_links: {
self: {
title: "Form",
href: "forms/5bc7740798d99800109c3504"
}
}
},
{
_id: "5bc7740798d99800109c3504",
version: "1",
owner: "user",
name: "Palestra sobre comunidades indígenas.",
office: "smdhc",
activity: "Palestra",
axis: "Formação e Sensibilização",
fields: [
{
label: "campo 1",
type: "number",
required: true,
order: 1,
_id: "5bc7740798d99800109c3502"
},
{
label: "campo 2",
type: "text",
required: false,
order: 2,
_id: "5bc7740798d99800109c3503"
}
],
_updated: "Wed, 17 Oct 2018 17:40:23 GMT",
_created: "Wed, 17 Oct 2018 17:40:23 GMT",
_links: {
self: {
title: "Form",
href: "forms/5bc7740798d99800109c3504"
}
}
},
{
_id: "5bc7740798d99800109c3504",
version: "1",
owner: "user",
name: "Emissão de documentos para estrangeiros.",
office: "smdhc",
activity: "Mutirão",
axis: "Atendimento ao Cidadão",
fields: [
{
label: "campo 1",
type: "number",
required: true,
order: 1,
_id: "5bc7740798d99800109c3502"
},
{
label: "campo 2",
type: "text",
required: false,
order: 2,
_id: "5bc7740798d99800109c3503"
}
],
_updated: "Wed, 17 Oct 2018 17:40:23 GMT",
_created: "Wed, 17 Oct 2018 17:40:23 GMT",
_links: {
self: {
title: "Form",
href: "forms/5bc7740798d99800109c3504"
}
}
},
{
_id: "5bc7740798d99800109c3504",
version: "1",
owner: "user",
name: "Prêmio inclusão.",
office: "smdhc",
activity: "Prêmio",
axis: "Reconhecimento",
fields: [
{
label: "campo 1",
type: "number",
required: true,
order: 1,
_id: "5bc7740798d99800109c3502"
},
{
label: "campo 2",
type: "text",
required: false,
order: 2,
_id: "5bc7740798d99800109c3503"
}
],
_updated: "Wed, 17 Oct 2018 17:40:23 GMT",
_created: "Wed, 17 Oct 2018 17:40:23 GMT",
_links: {
self: {
title: "Form",
href: "forms/5bc7740798d99800109c3504"
}
}
},
{
_id: "5bc7740798d99800109c3504",
version: "1",
owner: "user",
name: "Prêmio cidadão.",
office: "smdhc",
activity: "Prêmio",
axis: "Reconhecimento",
fields: [
{
label: "campo 1",
type: "number",
required: true,
order: 1,
_id: "5bc7740798d99800109c3502"
},
{
label: "campo 2",
type: "text",
required: false,
order: 2,
_id: "5bc7740798d99800109c3503"
}
],
_updated: "Wed, 17 Oct 2018 17:40:23 GMT",
_created: "Wed, 17 Oct 2018 17:40:23 GMT",
_links: {
self: {
title: "Form",
href: "forms/5bc7740798d99800109c3504"
}
}
},
{
_id: "5bc7740798d99800109c3504",
version: "1",
owner: "user",
name: "Encontro com imigrantes venezuelanos.",
office: "smdhc",
activity: "Reunião",
axis: "Articulação Política",
fields: [
{
label: "campo 1",
type: "number",
required: true,
order: 1,
_id: "5bc7740798d99800109c3502"
},
{
label: "campo 2",
type: "text",
required: false,
order: 2,
_id: "5bc7740798d99800109c3503"
}
],
_updated: "Wed, 17 Oct 2018 17:40:23 GMT",
_created: "Wed, 17 Oct 2018 17:40:23 GMT",
_links: {
self: {
title: "Form",
href: "forms/5bc7740798d99800109c3504"
}
}
},
{
_id: "5bc7740798d99800109c3504",
version: "1",
owner: "user",
name: "Oficina de braile.",
office: "smped",
activity: "Oficina",
axis: "",
fields: [
{
label: "campo 1",
type: "number",
required: true,
order: 1,
_id: "5bc7740798d99800109c3502"
},
{
label: "campo 2",
type: "text",
required: false,
order: 2,
_id: "5bc7740798d99800109c3503"
}
],
_updated: "Wed, 17 Oct 2018 17:40:23 GMT",
_created: "Wed, 17 Oct 2018 17:40:23 GMT",
_links: {
self: {
title: "Form",
href: "forms/5bc7740798d99800109c3504"
}
}
},
]; | 26.516529 | 63 | 0.399875 |
4a626492a1d9becaa50733879d5ef78abd1c2d77 | 780 | js | JavaScript | bear-ts-express/build/server/src/routes/user/user.routes.js | thoughtbit/node-web-starter | 394b773479c9331d6ca69c70ebfeaa5554e216ac | [
"MIT"
] | 4 | 2018-11-26T02:06:16.000Z | 2021-06-07T05:20:59.000Z | bear-ts-express/build/server/src/routes/user/user.routes.js | thoughtbit/node-web-starter | 394b773479c9331d6ca69c70ebfeaa5554e216ac | [
"MIT"
] | null | null | null | bear-ts-express/build/server/src/routes/user/user.routes.js | thoughtbit/node-web-starter | 394b773479c9331d6ca69c70ebfeaa5554e216ac | [
"MIT"
] | null | null | null | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const express = require("express");
const ctrl = require("./user.controller");
const passport = require("passport");
let router = express.Router();
router.get('/', function (req, res, next) {
res.send('Hello World!');
});
/**
* OAuth authentication routes. (Sign in)
*/
router.get('/auth/facebook', passport.authenticate('facebook', { scope: ['email', 'public_profile'] }));
router.get('/auth/facebook/callback', passport.authenticate('facebook', { failureRedirect: '/login' }), (req, res) => {
res.redirect(req.session.returnTo || '/');
});
router.get('/:id', ctrl.getUser);
router.get('/:username/profile', ctrl.getUsername);
exports.default = router;
//# sourceMappingURL=user.routes.js.map | 39 | 119 | 0.683333 |
5c436043a2e188642b06e97382e7a7059fef77d5 | 2,294 | h | C | 004_motion_detector/include/DataReader.h | DreamWaterFound/Codes | e7d80eb8bfd7d6f104abd18724cb4bface419233 | [
"WTFPL"
] | 13 | 2019-02-28T14:28:23.000Z | 2021-12-04T04:55:19.000Z | 004_motion_detector/include/DataReader.h | DreamWaterFound/Codes | e7d80eb8bfd7d6f104abd18724cb4bface419233 | [
"WTFPL"
] | 1 | 2019-09-07T09:00:50.000Z | 2019-12-04T02:13:25.000Z | 004_motion_detector/include/DataReader.h | DreamWaterFound/Codes | e7d80eb8bfd7d6f104abd18724cb4bface419233 | [
"WTFPL"
] | 1 | 2020-03-11T16:47:31.000Z | 2020-03-11T16:47:31.000Z | /**
* @file DataReader.h
* @author guoqing ([email protected])
* @brief 数据库阅读器类的声明
* @version 0.1
* @date 2019-01-05
*
* @copyright Copyright (c) 2019
*
*/
#ifndef __DATA_READER_H__
#define __DATA_READER_H__
#include "common.h"
/**
* @brief 读取数据集CDW-2014的类
*
*/
class DataReader
{
public:
/**
* @brief Construct a new Data Reader object
*
*/
DataReader();
/**
* @brief Destroy the Data Reader object
*
*/
~DataReader();
/**
* @brief 打开图像序列的
*
* @param[in] path 图像序列的位置
* @return true 打开成功
* @return false 打开失败
*/
bool openSeq(const char* path);
/**
* @brief 关闭序列
* @detials 其实主要是关闭读取序列的指针
*/
void closeSeq(void);
/**
* @brief 获取视频序列中的总帧数
* @return int 总帧数。如果为0说明要么没有,要么数据集打开失败。
*/
inline int getTotalFrames(void)
{
return mnFrameLength;
}
/**
* @brief Get the New Frame
*
* @param[out] img 新的一帧的图像
* @return true 获取成功
* @return false 获取失败(一般是因为数据集没有正确打开或者是已经是最后一帧了)
*/
bool getNewFrame(cv::Mat &img);
/**
* @brief 重设读取帧的指针
*
*/
void ResetFramePos(void);
/**
* @brief 获取当前帧的位置
*
* @return int 当前帧的位置
*/
int getCurrFramePos(void);
/**
* @brief 获取视频的播放速率
* @notes 但是目前还没有比较好的确定图像序列的帧率的办法,所以目前
* 采取的措施还是要靠人工给定
*
* @return int 帧率
*/
inline int getFPS(void)
{
return mnFPS;
}
/**
* @brief Get the Frame Size
*
* @return cv::Size 帧的大小
*/
inline cv::Size getFrameSize(void)
{
return mFrameSize;
}
/**
* @brief Get the Frame Channels
*
* @return int 帧的颜色通道数
*/
inline int getFrameChannels(void)
{
return mnFrameChannels;
}
private:
/**
* @brief 根据图像序列的第一帧来确定图像帧的大小
*
*/
void checkFrameSizeChannels(void);
/**
* @brief 确定这组图像序列的长度
*
*/
void checkFrameLength(void);
private:
///图像帧率
int mnFPS; ///<图像帧率
///帧的大小
cv::Size mFrameSize;
///帧的总长度
int mnFrameLength;
///当前帧的位置
int mnCurFramePos;
///数据集的路径
string data_path;
///帧的通道数
int mnFrameChannels;
};
#endif | 15.82069 | 55 | 0.528771 |
065553903342d96e156bb5d7c9e4f3aeac3c6aea | 7,347 | rs | Rust | src/router.rs | explodingcamera/rust-http-server-from-scratch | 109fc07f42910f997fb032e5e81a8d31eb6032dd | [
"MIT"
] | null | null | null | src/router.rs | explodingcamera/rust-http-server-from-scratch | 109fc07f42910f997fb032e5e81a8d31eb6032dd | [
"MIT"
] | null | null | null | src/router.rs | explodingcamera/rust-http-server-from-scratch | 109fc07f42910f997fb032e5e81a8d31eb6032dd | [
"MIT"
] | null | null | null | use anyhow::Result;
use futures::future::BoxFuture;
use parking_lot::Mutex;
use std::{collections::BTreeMap, fmt::Debug, sync::Arc};
use tokio::net::TcpStream;
// https://stackoverflow.com/questions/27883509/can-you-clone-a-closure
use crate::{
http_request::{Method, Request},
http_response::ResponseBuilder,
HTTPServer,
};
pub trait HandlerFn = Fn(MiddlewareCtx) -> HandlerFut + Send + 'static + Sync + ?Sized;
// pub trait HandlerFn =
// (Fn(&MiddlewareContext) -> dyn Future<Output = Result<()>>) + Send + 'static + Sync + ?Sized;
// A Box<Future> is `impl<F: ?Sized + Future> Future for Box<F>`
// so we can just use it to get an unsized future (so we can call it later on)
// however we also need to pin it, so they actually implement the future trait.
// BoxFuture is a helper type which does this for us:
pub type HandlerFut = BoxFuture<'static, Result<(), anyhow::Error>>;
// for reference, the equivalent would be
// pub type HandlerFut = Box<dyn Future<Output = Result<()>> + Unpin + Send + 'static>;
pub type MiddlewareCtx = Arc<Mutex<MiddlewareContext>>;
pub struct MiddlewareContext {
/// Current request
pub request: Request,
/// Response builder
pub response: ResponseBuilder,
/// Params
pub params: BTreeMap<String, RequestPathParams>,
/// Socket
pub socket: TcpStream,
/// End the request prematurely
ended: bool,
// enable raw socket mode
raw: bool,
}
impl MiddlewareContext {
pub fn new(request: Request, response: ResponseBuilder, socket: TcpStream) -> Self {
Self {
socket,
request,
response,
ended: false,
params: BTreeMap::new(),
raw: false,
}
}
pub fn set_raw(&mut self, val: bool) {
self.raw = val;
}
pub fn is_raw(&mut self) -> bool {
self.raw
}
pub fn end(&mut self) {
self.ended = true
}
pub fn has_ended(&self) -> bool {
self.ended
}
}
pub struct Route {
pub path: String,
pub method: Option<Method>,
pub handler: Arc<Box<dyn HandlerFn>>,
}
impl Debug for Route {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("Point")
.field("path", &self.path)
.field("method", &self.method)
.field("handler", &"[handlerFn]".to_string())
.finish()
}
}
impl Clone for Route {
fn clone(&self) -> Self {
Self {
path: self.path.clone(),
method: self.method.clone(),
handler: self.handler.clone(),
}
}
}
pub trait Router<F>
where
F: HandlerFn,
{
fn handle(&mut self, method: Method, path: &str, handler: F) -> &mut Self;
fn any(&mut self, path: &str, handler: F) -> &mut Self;
fn get(&mut self, path: &str, handler: F) -> &mut Self;
fn head(&mut self, path: &str, handler: F) -> &mut Self;
fn post(&mut self, path: &str, handler: F) -> &mut Self;
fn put(&mut self, path: &str, handler: F) -> &mut Self;
fn delete(&mut self, path: &str, handler: F) -> &mut Self;
fn connect(&mut self, path: &str, handler: F) -> &mut Self;
fn options(&mut self, path: &str, handler: F) -> &mut Self;
fn trace(&mut self, path: &str, handler: F) -> &mut Self;
fn patch(&mut self, path: &str, handler: F) -> &mut Self;
}
#[derive(Debug, Clone)]
pub struct RequestPath {
pub path: String,
pub params: BTreeMap<String, RequestPathParams>,
}
#[derive(Debug, Clone)]
pub struct RequestPathParams {
pub param: String,
pub value: String,
}
pub fn middleware_matches_request(request: &Request, route: &Route) -> Result<Option<RequestPath>> {
let request_path = request.path.clone().unwrap_or_else(|| "".to_string());
let request_segments = request_path.split('/').peekable();
let route_path = &route.path;
let mut route_segments = route_path.split('/').peekable();
let mut params: BTreeMap<String, RequestPathParams> = BTreeMap::new();
for request_segment in request_segments {
let route_segment = match route_segments.next() {
Some(val) => val,
None => return Ok(None),
};
match route_segment {
// wildcard parameter
"*" => {
// path = `/*/123/sadfsadf` will behave like a param
// path = `/123/*/` will also behave like a param
// path = `/123/*` will accept any path, even when nesting /'s (e.g `/123/456`, `/123/456/789`)
if route_segments.peek().is_none() && !route_path.ends_with('/') {
break;
}
params.insert(
"*".to_string(),
RequestPathParams {
param: "*".to_string(),
value: request_segment.to_string(),
},
);
}
// named param
s if s.starts_with(':') => {
params.insert(
s.to_string(),
RequestPathParams {
param: s.to_string(),
value: request_segment.to_string(),
},
);
}
// not matching
s if s != request_segment => return Ok(None),
// matching
_ => {}
}
}
let path = RequestPath {
path: request_path,
params,
};
Ok(Some(path))
}
impl<F> Router<F> for HTTPServer
where
F: HandlerFn,
{
fn handle(&mut self, method: Method, path: &str, handler: F) -> &mut Self {
let handler: Arc<Box<dyn HandlerFn>> = Arc::new(Box::new(handler));
let route: Route = Route {
path: path.to_string(),
method: Some(method),
handler,
};
self.add_route(route);
self
}
fn any(&mut self, path: &str, handler: F) -> &mut Self {
let handler: Arc<Box<dyn HandlerFn>> = Arc::new(Box::new(handler));
let route: Route = Route {
path: path.to_string(),
method: None,
handler,
};
self.add_route(route);
self
}
fn get(&mut self, path: &str, handler: F) -> &mut Self {
self.handle(Method::GET, path, handler)
}
fn head(&mut self, path: &str, handler: F) -> &mut Self {
self.handle(Method::HEAD, path, handler)
}
fn post(&mut self, path: &str, handler: F) -> &mut Self {
self.handle(Method::POST, path, handler)
}
fn put(&mut self, path: &str, handler: F) -> &mut Self {
self.handle(Method::PUT, path, handler)
}
fn delete(&mut self, path: &str, handler: F) -> &mut Self {
self.handle(Method::DELETE, path, handler)
}
fn connect(&mut self, path: &str, handler: F) -> &mut Self {
self.handle(Method::CONNECT, path, handler)
}
fn options(&mut self, path: &str, handler: F) -> &mut Self {
self.handle(Method::OPTIONS, path, handler)
}
fn trace(&mut self, path: &str, handler: F) -> &mut Self {
self.handle(Method::TRACE, path, handler)
}
fn patch(&mut self, path: &str, handler: F) -> &mut Self {
self.handle(Method::PATCH, path, handler)
}
}
| 29.388 | 122 | 0.55179 |
08e52ff0d0e06a524ca896483eaab38db681ff4f | 455 | sql | SQL | Miscellaneous/StoredProcedures/Backup_2015 March 24/h3giUpgradeGetPreviousContractEndDate.sql | Foxpips/LayeredArchitecture | c75f83e8591ad78c7a5d3175c29ea0b0cb88e91f | [
"MIT"
] | 3 | 2015-04-10T14:39:41.000Z | 2021-02-22T20:53:05.000Z | Miscellaneous/StoredProcedures/Backup_2015 March 25/h3giUpgradeGetPreviousContractEndDate.sql | Foxpips/LayeredArchitecture | c75f83e8591ad78c7a5d3175c29ea0b0cb88e91f | [
"MIT"
] | null | null | null | Miscellaneous/StoredProcedures/Backup_2015 March 25/h3giUpgradeGetPreviousContractEndDate.sql | Foxpips/LayeredArchitecture | c75f83e8591ad78c7a5d3175c29ea0b0cb88e91f | [
"MIT"
] | 1 | 2015-11-05T14:37:38.000Z | 2015-11-05T14:37:38.000Z |
CREATE PROCEDURE [dbo].[h3giUpgradeGetPreviousContractEndDate]
@orderref INT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
select hu.contractEndDate from h3giOrderheader hoh
left outer join h3giUpgrade hu
on hoh.UpgradeID = hu.UpgradeId
where hoh.orderref = @orderref
END
GRANT EXECUTE ON h3giUpgradeGetPreviousContractEndDate TO b4nuser
GO
| 21.666667 | 65 | 0.76044 |
19228a61f238e0a828d6f9c5b6b56b5770023c13 | 415 | asm | Assembly | programs/oeis/104/A104147.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/104/A104147.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/104/A104147.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A104147: Number of cubes <= n-th prime.
; 2,2,2,2,3,3,3,3,3,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9
seq $0,6005 ; The odd prime numbers together with 1.
seq $0,48766 ; Integer part of cube root of n. Or, number of cubes <= n. Or, n appears 3n^2 + 3n + 1 times.
add $0,1
| 59.285714 | 201 | 0.583133 |
7e15334cb40065237be2385c489d3b5d1b50a440 | 2,971 | css | CSS | style/style.css | Snehabhatt61/e-commerce-page | 4407cc774c91839eae52b07028860c7192dfd6fa | [
"MIT"
] | null | null | null | style/style.css | Snehabhatt61/e-commerce-page | 4407cc774c91839eae52b07028860c7192dfd6fa | [
"MIT"
] | null | null | null | style/style.css | Snehabhatt61/e-commerce-page | 4407cc774c91839eae52b07028860c7192dfd6fa | [
"MIT"
] | null | null | null | html {
font-size: 14px;
}
body {
font-family: 'Open Sans', sans-serif;
text-align: left;
margin: 0;
padding: 0;
overflow: auto;
max-width: 100%;
overflow-x: hidden;
}
:focus {
outline: none;
}
:hover {
outline: none;
}
a:hover {
text-decoration: none;
color: black;
cursor: pointer;
}
ul{
list-style: none;
-webkit-padding-start: 0;
}
li {
list-style: none;
-webkit-padding-start: 0;
}
.user-img {
height : 80px;
width : 80px;
}
.header {
padding:10px 30px;
background-color:#eeff41;
}
.sub-header {
height: 20px;
background-color: #b8cc00;
}
.app .modal .modal-area {
background-color: white;
}
.header li {
padding: 0 10px;
}
.header-sub {
justify-content: space-between;
}
.header-sub-category {
}
.header-search {
width : 550px;
margin-left: 80px;
border-radius : 6px;
border-color: #b8cc00;
border: none;
background: rgba(244,244,244,0.6);
border: none;
font-size: 14px;
color: #909090;
border-right: none;
height: 30px;
padding: 0 10px 0 32px;
outline: none;
text-overflow: ellipsis;
border-radius: 2px 0px 0px 2px;
font-family: "font-regular";
}
.header-search-button {
height: 30px;
width: 80px;
top: 0 ;
left:550px;
background-color:#b8cc00;
text-align: center;
color : #000;
line-height: 25px;
font-size: 14px;
border-radius: 0 3px 3px 0 ;
border: none;
cursor: pointer;
}
.header-logo {
/* margin: 0px 30px; */
font-size: 25px;
line-height: 30px;
font-style: italic;
font-family: serif;
}
.push {
margin-left: auto;
}
.push p {
margin-right: 20px;
color: #333;
line-height: 25px;
font-size: 14px;
cursor: pointer;
}
.sidebar {
padding: 20px 0px 100px 20px;
height: 100%;
background-color:#ffff78;
}
.sidebar p {
font-size: 14px;
}
.abc {
margin:0;
}
.user-container {
display: flex;
align-content: space-between;
flex-wrap:wrap;
/* background-color: #E0E1E0; */
}
.user-card {
position: relative;
background-color: #fff;
border-radius: 2px;
text-align: center;
padding: 25px 0px;
margin: 10px 20px 20px 0;
width: 200px;
box-shadow: 0 2px 4px 0 rgba(156, 156, 156, 0.5);
}
.header-dropdown {
width: 120px;
border: none;
border-left:none;
border-top: 1px;
justify-content: center;
margin-left: 80px;
border-radius : 6px;
border-color: #b8cc00;
border: none;
background: rgba(244,244,244,0.6);
margin-left:160px;
font-size: 14px;
color: #909090;
border-right: none;
height: 30px;
padding: 0 5px 0 15px;
outline: none;
text-overflow: ellipsis;
border-radius: 2px 0px 0px 2px;
font-family: "font-regular";
}
.sortButton {
border: none;
background-color: #b8cc00;
float:right;
padding: 5px 30px;
border-radius: 0 0 4px 4px;
font-size: 14px;
} | 18.006061 | 50 | 0.602154 |
54dc62bde9c12405e01de23c4b56463c4d99e039 | 7,924 | kt | Kotlin | imitate/src/main/java/com/engineer/imitate/ui/fragments/SlideFragment.kt | YuMENGQI/AndroidAnimationExercise | 43c6d1f417ecebd29d929063326ea3a43e82d16f | [
"Apache-2.0"
] | 1,566 | 2016-10-20T15:42:10.000Z | 2022-03-31T23:28:43.000Z | imitate/src/main/java/com/engineer/imitate/ui/fragments/SlideFragment.kt | YuMENGQI/AndroidAnimationExercise | 43c6d1f417ecebd29d929063326ea3a43e82d16f | [
"Apache-2.0"
] | 11 | 2017-07-20T10:22:28.000Z | 2020-04-09T06:14:53.000Z | imitate/src/main/java/com/engineer/imitate/ui/fragments/SlideFragment.kt | YuMENGQI/AndroidAnimationExercise | 43c6d1f417ecebd29d929063326ea3a43e82d16f | [
"Apache-2.0"
] | 318 | 2016-10-20T15:41:59.000Z | 2022-03-22T03:46:19.000Z | package com.engineer.imitate.ui.fragments
import android.os.Bundle
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.ItemTouchHelper
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.facade.annotation.Route
import com.engineer.imitate.R
import com.engineer.imitate.ui.list.adapter.SlideListAdapter
import com.engineer.imitate.ui.widget.view.layoutmanager.ItemConfig
import com.engineer.imitate.ui.widget.view.layoutmanager.ItemTouchHelperCallback
import com.engineer.imitate.ui.widget.view.layoutmanager.OnSlideListener
import com.engineer.imitate.ui.widget.view.layoutmanager.SlideLayoutManager
import kotlinx.android.synthetic.main.fragment_slide.*
import java.util.*
/**
* A simple [Fragment] subclass.
*
*/
@Route(path = "/anim/slide")
class SlideFragment : Fragment() {
private var datas: MutableList<String> = ArrayList()
private lateinit var mItemTouchHelperCallback: ItemTouchHelperCallback<String>
private lateinit var mItemTouchHelper: ItemTouchHelper
private lateinit var mSlideLayoutManager: SlideLayoutManager
private var mOnSlideListener: SimpleOnSlideListener = SimpleOnSlideListener()
var array1: Array<String> = arrayOf("http://ww1.sinaimg.cn/large/610dc034ly1ffmwnrkv1hj20ku0q1wfu.jpg",
"https://ws1.sinaimg.cn/large/610dc034ly1ffla9ostxuj20ku0q2abt.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-05-12-18380140_455327614813449_854681840315793408_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-05-11-18380166_305443499890139_8426655762360565760_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-05-10-18382517_1955528334668679_3605707761767153664_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-05-09-18443931_429618670743803_5734501112254300160_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-05-08-18252341_289400908178710_9137908350942445568_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-05-05-18251898_1013302395468665_8734429858911748096_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-05-04-18299181_1306649979420798_1108869403736276992_n.jpg",
"http://ww1.sinaimg.cn/large/61e74233ly1feuogwvg27j20p00zkqe7.jpg")
var array2: Array<String> = arrayOf(
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-05-02-926821_1453024764952889_775781470_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-28-18094719_120129648541065_8356500748640452608_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-27-17934080_117414798808566_8957027985114791936_n.jpg?imageslim",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-25-13651793_897557617014845_571817176_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-24-18013547_1532023163498554_215541963087151104_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-24-18094714_158946097967074_5909424912493182976_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-21-18013964_1389732981073150_4044061109068496896_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-20-17932350_1238028809599424_2089669844847820800_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-19-17881407_1845958195665029_1132383288824954880_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-18-17882540_190116561497334_440657494176432128_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-16-17934400_1738549946443321_2924146161843437568_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-14-17881962_1329090457138411_8289893708619317248_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-13-17882785_926451654163513_7725522121023029248_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-12-17662441_1675934806042139_7236493360834281472_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-11-17881546_248332202297978_2420944671002853376_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-09-17586558_426275167734768_6312107349515436032_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-07-17817932_274034076387428_5240190736292380672_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-06-17493825_1061197430652762_1457834104966873088_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-04-04-17438270_1418311001574160_8728796670000627712_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-03-31-17662615_1819763634937161_2829588299293655040_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-03-30-17265582_1877445642507654_3057988544061505536_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-03-29-17267498_392021674501739_8632065627013513216_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-03-28-17494350_115579865647756_2448160714821468160_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-03-26-17495078_643307445877569_4485136026821459968_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-03-24-17438359_1470934682925012_1066984844010979328_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-03-23-17265820_645330569008169_4543676027339014144_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-03-22-17332868_1929305090624552_8918542166154805248_n.jpg",
"http://7xi8d6.com1.z0.glb.clouddn.com/2017-03-21-17268102_763630507137257_3620762734536163328_n%20-1-.jpg", "http://7xi8d6.com1.z0.glb.clouddn.com/2017-03-20-17333300_1680707251945881_2009298023053524992_n.jpg", "http://7xi8d6.com1.z0.glb.clouddn.com/2017-03-17-17332809_1277469728986540_3201752429582352384_n.jpg", "http://7xi8d6.com1.z0.glb.clouddn.com/2017-03-16-17333221_108837802984751_2789267558635667456_n.jpg", "http://7xi8d6.com1.z0.glb.clouddn.com/2017-03-15-17126482_115753765623699_4225645012014071808_n.jpg", "http://7xi8d6.com1.z0.glb.clouddn.com/2017-03-13-17267506_264626920661300_5781854075880472576_n.jpg", "http://7xi8d6.com1.z0.glb.clouddn.com/2017-03-13-17265708_396005157434387_3099040288153272320_n.jpg")
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_slide, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initData()
list.adapter = SlideListAdapter(datas)
mItemTouchHelperCallback = ItemTouchHelperCallback(list.adapter as SlideListAdapter, datas)
mItemTouchHelper = ItemTouchHelper(mItemTouchHelperCallback)
mSlideLayoutManager = SlideLayoutManager(list, mItemTouchHelper)
mItemTouchHelper.attachToRecyclerView(list)
list.layoutManager = mSlideLayoutManager
mItemTouchHelperCallback.setOnSlideListener(mOnSlideListener)
}
var index: Int = 0
private inner class SimpleOnSlideListener : OnSlideListener<String> {
override fun onSliding(viewHolder: RecyclerView.ViewHolder, ratio: Float, direction: Int) {
}
override fun onSlided(viewHolder: RecyclerView.ViewHolder, t: String, direction: Int) {
datas.add(datas.size - 1, array2[index])
index += 1
when (direction) {
ItemConfig.SLIDED_LEFT -> Toast.makeText(context, "赞", Toast.LENGTH_SHORT).show()
ItemConfig.SLIDED_RIGHT -> Toast.makeText(context, "讨厌", Toast.LENGTH_SHORT).show()
}
}
override fun onClear() {
}
}
private fun initData() {
datas.addAll(array1)
}
}
| 61.426357 | 740 | 0.747855 |
fa024f1a480b20e24b4f0af9855f1161f6df9bfd | 1,432 | kt | Kotlin | komock-core/src/main/kotlin/ua/com/lavi/komock/model/ByteResource.kt | laviua/komock | 2cddcc088373fc468d54a2c40a150ee1bde64700 | [
"Apache-2.0"
] | 11 | 2017-01-21T19:10:41.000Z | 2022-02-13T18:11:51.000Z | komock-core/src/main/kotlin/ua/com/lavi/komock/model/ByteResource.kt | laviua/komock | 2cddcc088373fc468d54a2c40a150ee1bde64700 | [
"Apache-2.0"
] | 22 | 2017-01-22T20:50:01.000Z | 2019-10-25T19:17:13.000Z | komock-core/src/main/kotlin/ua/com/lavi/komock/model/ByteResource.kt | laviua/komock | 2cddcc088373fc468d54a2c40a150ee1bde64700 | [
"Apache-2.0"
] | 1 | 2017-11-08T23:03:16.000Z | 2017-11-08T23:03:16.000Z | package ua.com.lavi.komock.model
import org.eclipse.jetty.util.resource.Resource
import java.io.ByteArrayInputStream
import java.io.File
import java.io.InputStream
import java.net.URL
import java.nio.channels.ReadableByteChannel
/**
* Created by Oleksandr Loushkin
*/
class ByteResource(private val content: ByteArray) : Resource() {
override fun isContainedIn(resource: Resource): Boolean {
return false
}
override fun close() {
// nothing to close
}
override fun exists(): Boolean {
return true
}
override fun isDirectory(): Boolean {
return false
}
override fun lastModified(): Long {
return 0
}
override fun length(): Long {
return 0
}
override fun getURL(): URL? {
return null
}
override fun getFile(): File? {
return null
}
override fun getName(): String? {
return null
}
override fun getInputStream(): InputStream {
return ByteArrayInputStream(content)
}
override fun getReadableByteChannel(): ReadableByteChannel? {
return null
}
override fun delete(): Boolean {
return false
}
override fun renameTo(dest: Resource): Boolean {
return false
}
override fun list(): Array<String> {
return arrayOf("")
}
override fun addPath(path: String): Resource? {
return null
}
}
| 18.842105 | 65 | 0.622905 |
e2784eca801886f85d93d10bfc662a3661dd9dc5 | 1,087 | swift | Swift | Landmarks/Landmarks/CalculatorView.swift | togbaliberty/iOS-Swift-Tutorials | 7b1b21ce3de02f7a2da3e0dfd6abd9d4939b7d49 | [
"MIT"
] | null | null | null | Landmarks/Landmarks/CalculatorView.swift | togbaliberty/iOS-Swift-Tutorials | 7b1b21ce3de02f7a2da3e0dfd6abd9d4939b7d49 | [
"MIT"
] | null | null | null | Landmarks/Landmarks/CalculatorView.swift | togbaliberty/iOS-Swift-Tutorials | 7b1b21ce3de02f7a2da3e0dfd6abd9d4939b7d49 | [
"MIT"
] | null | null | null | //
// ContentView.swift
// Landmarks
//
// Created by Togba Liberty on 3/30/20.
// Copyright © 2020 Togba Liberty. All rights reserved.
//
import SwiftUI
struct CalculatorView: View {
var body: some View {
VStack {
TemplateUIKitMap()
.edgesIgnoringSafeArea(.top)
.frame(height: 300)
TemplateImage()
.offset(y: -130)
.padding(.bottom, -130)
VStack(alignment: .leading) {
Text("Financial Calculator")
.font(.title)
.foregroundColor(.green)
HStack {
Text("Monthly Payment")
.font(.subheadline)
Spacer()
Text("Refinance")
.font(.subheadline)
}
}
.padding()
Spacer()
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
CalculatorView()
}
}
| 23.630435 | 56 | 0.447102 |
0e60e981ddcf7e93ce654ef991077faf1396f783 | 1,259 | html | HTML | reports/reports/templates/report_item.html | tomaszpiotro/honeypot_reports | 79f59b4967dff6ba52e70309ad668c136a8c0c3d | [
"MIT"
] | null | null | null | reports/reports/templates/report_item.html | tomaszpiotro/honeypot_reports | 79f59b4967dff6ba52e70309ad668c136a8c0c3d | [
"MIT"
] | null | null | null | reports/reports/templates/report_item.html | tomaszpiotro/honeypot_reports | 79f59b4967dff6ba52e70309ad668c136a8c0c3d | [
"MIT"
] | null | null | null | <!DOCTYPE html>
<html>
<style>
body {background-color:lightgray}
h1 {color:blue}
p {color:green}
table, th, td{ border: thin solid darkblue;
text-align: center;
border-collapse: collapse;
margin: auto;}
</style>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<table>
<tr>
<th>frequent item set id</th>
<th>protocol</th>
<th>remote host </th>
<th>remote port </th>
<th>local host </th>
<th>local port </th>
<th>count </th>
<th>generator </th>
<th>jep </th>
<th>interesting </th>
<th>1h occurrences </th>
</tr>
{% for item in items %}
<tr>
<td>{{ item.itemset.id }}</td>
<td>{{ item.itemset.protocol }}</td>
<td>{{ item.itemset.remote_host }}</td>
<td>{{ item.itemset.remote_port }}</td>
<td>{{ item.itemset.local_host }}</td>
<td>{{ item.itemset.local_port }}</td>
<td>{{ item.itemset.count }}</td>
<td>{{ item.itemset.generator }}</td>
<td>{{ item.itemset.jep }}</td>
<td>{{ item.itemset.interesting }}</td>
<td>{{ item.one_hour_occurrences }}</td>
</tr>
{% endfor %}
</table>
</body>
</html>
| 23.314815 | 48 | 0.515488 |
db6fc1d485d1692f8de994e2cefb4bf3999176c2 | 100 | sql | SQL | protocol_derivations.sql | sanders41/clintrial_queries | 22f9e149a17277cd45d8d55236b9d4b4ec1ac8c0 | [
"MIT"
] | null | null | null | protocol_derivations.sql | sanders41/clintrial_queries | 22f9e149a17277cd45d8d55236b9d4b4ec1ac8c0 | [
"MIT"
] | null | null | null | protocol_derivations.sql | sanders41/clintrial_queries | 22f9e149a17277cd45d8d55236b9d4b4ec1ac8c0 | [
"MIT"
] | null | null | null | SELECT *
FROM ctsdd.derivation
WHERE protocol = 'ENTER PROTOCOL NAME'
ORDER BY panel,
deriv_name;
| 16.666667 | 38 | 0.77 |
6e313ee4c42e5f5a96c735d1c5a3ef5adc2018ae | 1,013 | html | HTML | angular/src/app/car/car-details/car-details.component.html | idreeshaddad/SimpleTaxiAngular | a41abbb24e3f4add55efd20dddcf5ba0fe8a041e | [
"MIT"
] | null | null | null | angular/src/app/car/car-details/car-details.component.html | idreeshaddad/SimpleTaxiAngular | a41abbb24e3f4add55efd20dddcf5ba0fe8a041e | [
"MIT"
] | null | null | null | angular/src/app/car/car-details/car-details.component.html | idreeshaddad/SimpleTaxiAngular | a41abbb24e3f4add55efd20dddcf5ba0fe8a041e | [
"MIT"
] | null | null | null | <div class="container my-4">
<h1 class="page-title">Car Details</h1>
<hr>
<button mat-raised-button [routerLink]="['/cars']">Back to list</button>
<hr>
<div class="row mb-3">
<div class="col-md-2 font-weight-bold">Plate Number</div>
<div class="col-md-10">{{detailsCar?.plateNumber}}</div>
</div>
<div class="row mb-3">
<div class="col-md-2 font-weight-bold">Name</div>
<div class="col-md-10">{{detailsCar?.name}}</div>
</div>
<div class="row mb-3">
<div class="col-md-2 font-weight-bold">Year</div>
<div class="col-md-10">{{detailsCar?.makeYear | date: 'yyyy'}}</div>
</div>
<div class="row mb-3">
<div class="col-md-2 font-weight-bold">Fuel Type</div>
<div class="col-md-10">{{ detailsCar?.fuelType }}
</div>
</div>
<div class="row mb-3">
<div class="col-md-2 font-weight-bold">Car Type</div>
<div class="col-md-10">{{ detailsCar?.carType }}</div>
</div>
</div> | 34.931034 | 76 | 0.558736 |
3e8b85de38103808b26476457831826e9799283c | 12,706 | h | C | ext/phalcon/mvc/model/query.zep.h | frqnck/cphalcon | 9c66927d02a04bfa87f0a6517a761744e376df42 | [
"BSD-3-Clause"
] | 3 | 2016-07-25T09:17:38.000Z | 2020-11-24T09:52:24.000Z | ext/phalcon/mvc/model/query.zep.h | frqnck/cphalcon | 9c66927d02a04bfa87f0a6517a761744e376df42 | [
"BSD-3-Clause"
] | null | null | null | ext/phalcon/mvc/model/query.zep.h | frqnck/cphalcon | 9c66927d02a04bfa87f0a6517a761744e376df42 | [
"BSD-3-Clause"
] | null | null | null |
extern zend_class_entry *phalcon_mvc_model_query_ce;
ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Query);
PHP_METHOD(Phalcon_Mvc_Model_Query, __construct);
PHP_METHOD(Phalcon_Mvc_Model_Query, setDI);
PHP_METHOD(Phalcon_Mvc_Model_Query, getDI);
PHP_METHOD(Phalcon_Mvc_Model_Query, setUniqueRow);
PHP_METHOD(Phalcon_Mvc_Model_Query, getUniqueRow);
PHP_METHOD(Phalcon_Mvc_Model_Query, _getQualified);
PHP_METHOD(Phalcon_Mvc_Model_Query, _getCallArgument);
PHP_METHOD(Phalcon_Mvc_Model_Query, _getCaseExpression);
PHP_METHOD(Phalcon_Mvc_Model_Query, _getFunctionCall);
PHP_METHOD(Phalcon_Mvc_Model_Query, _getExpression);
PHP_METHOD(Phalcon_Mvc_Model_Query, _getSelectColumn);
PHP_METHOD(Phalcon_Mvc_Model_Query, _getTable);
PHP_METHOD(Phalcon_Mvc_Model_Query, _getJoin);
PHP_METHOD(Phalcon_Mvc_Model_Query, _getJoinType);
PHP_METHOD(Phalcon_Mvc_Model_Query, _getSingleJoin);
PHP_METHOD(Phalcon_Mvc_Model_Query, _getMultiJoin);
PHP_METHOD(Phalcon_Mvc_Model_Query, _getJoins);
PHP_METHOD(Phalcon_Mvc_Model_Query, _getOrderClause);
PHP_METHOD(Phalcon_Mvc_Model_Query, _getGroupClause);
PHP_METHOD(Phalcon_Mvc_Model_Query, _getLimitClause);
PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect);
PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert);
PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate);
PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareDelete);
PHP_METHOD(Phalcon_Mvc_Model_Query, parse);
PHP_METHOD(Phalcon_Mvc_Model_Query, getCache);
PHP_METHOD(Phalcon_Mvc_Model_Query, _executeSelect);
PHP_METHOD(Phalcon_Mvc_Model_Query, _executeInsert);
PHP_METHOD(Phalcon_Mvc_Model_Query, _executeUpdate);
PHP_METHOD(Phalcon_Mvc_Model_Query, _executeDelete);
PHP_METHOD(Phalcon_Mvc_Model_Query, _getRelatedRecords);
PHP_METHOD(Phalcon_Mvc_Model_Query, execute);
PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleResult);
PHP_METHOD(Phalcon_Mvc_Model_Query, setType);
PHP_METHOD(Phalcon_Mvc_Model_Query, getType);
PHP_METHOD(Phalcon_Mvc_Model_Query, setBindParams);
PHP_METHOD(Phalcon_Mvc_Model_Query, getBindParams);
PHP_METHOD(Phalcon_Mvc_Model_Query, setBindTypes);
PHP_METHOD(Phalcon_Mvc_Model_Query, setSharedLock);
PHP_METHOD(Phalcon_Mvc_Model_Query, getBindTypes);
PHP_METHOD(Phalcon_Mvc_Model_Query, setIntermediate);
PHP_METHOD(Phalcon_Mvc_Model_Query, getIntermediate);
PHP_METHOD(Phalcon_Mvc_Model_Query, cache);
PHP_METHOD(Phalcon_Mvc_Model_Query, getCacheOptions);
PHP_METHOD(Phalcon_Mvc_Model_Query, getSql);
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query___construct, 0, 0, 0)
ZEND_ARG_INFO(0, phql)
ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 1)
ZEND_ARG_INFO(0, options)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_setdi, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_setuniquerow, 0, 0, 1)
ZEND_ARG_INFO(0, uniqueRow)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getqualified, 0, 0, 1)
ZEND_ARG_ARRAY_INFO(0, expr, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getcallargument, 0, 0, 1)
ZEND_ARG_ARRAY_INFO(0, argument, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getcaseexpression, 0, 0, 1)
ZEND_ARG_ARRAY_INFO(0, expr, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getfunctioncall, 0, 0, 1)
ZEND_ARG_ARRAY_INFO(0, expr, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getexpression, 0, 0, 1)
ZEND_ARG_INFO(0, expr)
ZEND_ARG_INFO(0, quoting)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getselectcolumn, 0, 0, 1)
ZEND_ARG_ARRAY_INFO(0, column, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__gettable, 0, 0, 2)
ZEND_ARG_OBJ_INFO(0, manager, Phalcon\\Mvc\\Model\\ManagerInterface, 0)
ZEND_ARG_INFO(0, qualifiedName)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getjoin, 0, 0, 2)
ZEND_ARG_OBJ_INFO(0, manager, Phalcon\\Mvc\\Model\\ManagerInterface, 0)
ZEND_ARG_INFO(0, join)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getjointype, 0, 0, 1)
ZEND_ARG_INFO(0, join)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getsinglejoin, 0, 0, 5)
ZEND_ARG_INFO(0, joinType)
ZEND_ARG_INFO(0, joinSource)
ZEND_ARG_INFO(0, modelAlias)
ZEND_ARG_INFO(0, joinAlias)
ZEND_ARG_OBJ_INFO(0, relation, Phalcon\\Mvc\\Model\\RelationInterface, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getmultijoin, 0, 0, 5)
ZEND_ARG_INFO(0, joinType)
ZEND_ARG_INFO(0, joinSource)
ZEND_ARG_INFO(0, modelAlias)
ZEND_ARG_INFO(0, joinAlias)
ZEND_ARG_OBJ_INFO(0, relation, Phalcon\\Mvc\\Model\\RelationInterface, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getjoins, 0, 0, 1)
ZEND_ARG_INFO(0, select)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getorderclause, 0, 0, 1)
ZEND_ARG_INFO(0, order)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getgroupclause, 0, 0, 1)
ZEND_ARG_ARRAY_INFO(0, group, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getlimitclause, 0, 0, 1)
ZEND_ARG_ARRAY_INFO(0, limitClause, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__prepareselect, 0, 0, 0)
ZEND_ARG_INFO(0, ast)
ZEND_ARG_INFO(0, merge)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__executeselect, 0, 0, 3)
ZEND_ARG_INFO(0, intermediate)
ZEND_ARG_INFO(0, bindParams)
ZEND_ARG_INFO(0, bindTypes)
ZEND_ARG_INFO(0, simulate)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__executeinsert, 0, 0, 3)
ZEND_ARG_INFO(0, intermediate)
ZEND_ARG_INFO(0, bindParams)
ZEND_ARG_INFO(0, bindTypes)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__executeupdate, 0, 0, 3)
ZEND_ARG_INFO(0, intermediate)
ZEND_ARG_INFO(0, bindParams)
ZEND_ARG_INFO(0, bindTypes)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__executedelete, 0, 0, 3)
ZEND_ARG_INFO(0, intermediate)
ZEND_ARG_INFO(0, bindParams)
ZEND_ARG_INFO(0, bindTypes)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getrelatedrecords, 0, 0, 4)
ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0)
ZEND_ARG_INFO(0, intermediate)
ZEND_ARG_INFO(0, bindParams)
ZEND_ARG_INFO(0, bindTypes)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_execute, 0, 0, 0)
ZEND_ARG_INFO(0, bindParams)
ZEND_ARG_INFO(0, bindTypes)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_getsingleresult, 0, 0, 0)
ZEND_ARG_INFO(0, bindParams)
ZEND_ARG_INFO(0, bindTypes)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_settype, 0, 0, 1)
ZEND_ARG_INFO(0, type)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_setbindparams, 0, 0, 1)
ZEND_ARG_ARRAY_INFO(0, bindParams, 0)
ZEND_ARG_INFO(0, merge)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_setbindtypes, 0, 0, 1)
ZEND_ARG_ARRAY_INFO(0, bindTypes, 0)
ZEND_ARG_INFO(0, merge)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_setsharedlock, 0, 0, 0)
ZEND_ARG_INFO(0, sharedLock)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_setintermediate, 0, 0, 1)
ZEND_ARG_ARRAY_INFO(0, intermediate, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_cache, 0, 0, 1)
ZEND_ARG_INFO(0, cacheOptions)
ZEND_END_ARG_INFO()
ZEPHIR_INIT_FUNCS(phalcon_mvc_model_query_method_entry) {
PHP_ME(Phalcon_Mvc_Model_Query, __construct, arginfo_phalcon_mvc_model_query___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_ME(Phalcon_Mvc_Model_Query, setDI, arginfo_phalcon_mvc_model_query_setdi, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, getDI, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, setUniqueRow, arginfo_phalcon_mvc_model_query_setuniquerow, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, getUniqueRow, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, _getQualified, arginfo_phalcon_mvc_model_query__getqualified, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _getCallArgument, arginfo_phalcon_mvc_model_query__getcallargument, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _getCaseExpression, arginfo_phalcon_mvc_model_query__getcaseexpression, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _getFunctionCall, arginfo_phalcon_mvc_model_query__getfunctioncall, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _getExpression, arginfo_phalcon_mvc_model_query__getexpression, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _getSelectColumn, arginfo_phalcon_mvc_model_query__getselectcolumn, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _getTable, arginfo_phalcon_mvc_model_query__gettable, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _getJoin, arginfo_phalcon_mvc_model_query__getjoin, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _getJoinType, arginfo_phalcon_mvc_model_query__getjointype, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _getSingleJoin, arginfo_phalcon_mvc_model_query__getsinglejoin, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _getMultiJoin, arginfo_phalcon_mvc_model_query__getmultijoin, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _getJoins, arginfo_phalcon_mvc_model_query__getjoins, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _getOrderClause, arginfo_phalcon_mvc_model_query__getorderclause, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _getGroupClause, arginfo_phalcon_mvc_model_query__getgroupclause, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _getLimitClause, arginfo_phalcon_mvc_model_query__getlimitclause, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _prepareSelect, arginfo_phalcon_mvc_model_query__prepareselect, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _prepareInsert, NULL, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _prepareUpdate, NULL, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _prepareDelete, NULL, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, parse, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, getCache, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, _executeSelect, arginfo_phalcon_mvc_model_query__executeselect, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _executeInsert, arginfo_phalcon_mvc_model_query__executeinsert, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _executeUpdate, arginfo_phalcon_mvc_model_query__executeupdate, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _executeDelete, arginfo_phalcon_mvc_model_query__executedelete, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, _getRelatedRecords, arginfo_phalcon_mvc_model_query__getrelatedrecords, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL)
PHP_ME(Phalcon_Mvc_Model_Query, execute, arginfo_phalcon_mvc_model_query_execute, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, getSingleResult, arginfo_phalcon_mvc_model_query_getsingleresult, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, setType, arginfo_phalcon_mvc_model_query_settype, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, getType, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, setBindParams, arginfo_phalcon_mvc_model_query_setbindparams, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, getBindParams, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, setBindTypes, arginfo_phalcon_mvc_model_query_setbindtypes, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, setSharedLock, arginfo_phalcon_mvc_model_query_setsharedlock, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, getBindTypes, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, setIntermediate, arginfo_phalcon_mvc_model_query_setintermediate, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, getIntermediate, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, cache, arginfo_phalcon_mvc_model_query_cache, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, getCacheOptions, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Mvc_Model_Query, getSql, NULL, ZEND_ACC_PUBLIC)
PHP_FE_END
};
| 49.248062 | 139 | 0.871242 |
12917d89ae30517aad489aa325e22f703250f98b | 965 | h | C | src/trunk/apps/tools/inventory/fdsnxml2inv/fdsnxml/xml.h | yannikbehr/seiscomp3 | ebb44c77092555eef7786493d00ac4efc679055f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 94 | 2015-02-04T13:57:34.000Z | 2021-11-01T15:10:06.000Z | src/trunk/apps/tools/inventory/fdsnxml2inv/fdsnxml/xml.h | yannikbehr/seiscomp3 | ebb44c77092555eef7786493d00ac4efc679055f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 233 | 2015-01-28T15:16:46.000Z | 2021-08-23T11:31:37.000Z | src/trunk/apps/tools/inventory/fdsnxml2inv/fdsnxml/xml.h | yannikbehr/seiscomp3 | ebb44c77092555eef7786493d00ac4efc679055f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 95 | 2015-02-13T15:53:30.000Z | 2021-11-02T14:54:54.000Z | /***************************************************************************
* Copyright (C) 2013 by gempa GmbH
*
* Author: Jan Becker
* Email: [email protected] $
*
***************************************************************************/
#ifndef __SEISCOMP_FDSNXML_XML_H__
#define __SEISCOMP_FDSNXML_XML_H__
#include <seiscomp3/io/xml/importer.h>
#include <seiscomp3/io/xml/exporter.h>
namespace Seiscomp {
namespace FDSNXML {
class Importer : public Seiscomp::IO::XML::Importer {
// ------------------------------------------------------------------
// Xstruction
// ------------------------------------------------------------------
public:
//! C'tor
Importer();
};
class Exporter : public Seiscomp::IO::XML::Exporter {
// ------------------------------------------------------------------
// Xstruction
// ------------------------------------------------------------------
public:
//! C'tor
Exporter();
};
}
}
#endif
| 20.531915 | 77 | 0.366839 |
7bb86895a791ef433a35424e6556c42e4777493a | 348 | rb | Ruby | node/recipes/npm.rb | kawashita86/symfonyaws-chef-master | a83bf3b3b2258e05097625aaabd8368dbda8369b | [
"MIT"
] | null | null | null | node/recipes/npm.rb | kawashita86/symfonyaws-chef-master | a83bf3b3b2258e05097625aaabd8368dbda8369b | [
"MIT"
] | null | null | null | node/recipes/npm.rb | kawashita86/symfonyaws-chef-master | a83bf3b3b2258e05097625aaabd8368dbda8369b | [
"MIT"
] | null | null | null | node[:deploy].each do |app_name, deploy|
execute "npm" do
cwd "#{deploy[:deploy_to]}/current"
command "npm install"
environment "HOME" => "#{deploy[:deploy_to]}/current"
user deploy[:user]
group deploy[:group]
only_if do File.exists?("#{deploy[:deploy_to]}/current/package.json") end
end
end
| 31.636364 | 81 | 0.609195 |
c43b4590ad288c7d65ba1a18c06a2d9ed17d30b5 | 1,122 | h | C | Applications/HomeUIService/HSEntitlementContext.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | 2 | 2021-11-02T09:23:27.000Z | 2022-03-28T08:21:57.000Z | Applications/HomeUIService/HSEntitlementContext.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | null | null | null | Applications/HomeUIService/HSEntitlementContext.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | 1 | 2022-03-28T08:21:59.000Z | 2022-03-28T08:21:59.000Z | //
// Generated by classdumpios 1.0.1 (64 bit) (iOS port by DreamDevLost)(Debug version compiled Sep 26 2020 13:48:20).
//
// Copyright (C) 1997-2019 Steve Nygard.
//
#import <objc/NSObject.h>
@class NSString;
@interface HSEntitlementContext : NSObject
{
_Bool _isEntitledForHomeKitSPI; // 8 = 0x8
_Bool _isEntitledForThirdPartySetupAccessoryPayload; // 9 = 0x9
NSString *_bundleIdentifier; // 16 = 0x10
}
- (void).cxx_destruct; // IMP=0x00000001000459e0
@property(readonly, nonatomic) _Bool isEntitledForThirdPartySetupAccessoryPayload; // @synthesize isEntitledForThirdPartySetupAccessoryPayload=_isEntitledForThirdPartySetupAccessoryPayload;
@property(nonatomic, setter=setFirstPartyEntitled:) _Bool isEntitledForHomeKitSPI; // @synthesize isEntitledForHomeKitSPI=_isEntitledForHomeKitSPI;
@property(readonly, copy, nonatomic) NSString *bundleIdentifier; // @synthesize bundleIdentifier=_bundleIdentifier;
- (id)description; // IMP=0x00000001000458a4
- (id)init; // IMP=0x0000000100045794
- (id)initWithAuditToken:(CDStruct_6ad76789)arg1 bundleIdentifier:(id)arg2; // IMP=0x00000001000456f0
@end
| 40.071429 | 189 | 0.789661 |
e2c697153bde33786eaa21b2a624914c9509e833 | 3,888 | kt | Kotlin | app/src/main/java/com/szymonstasik/kalkulatorsredniejwazonej/history/HistoryWeightedAverageAdapter.kt | DeNatur/Weighted_Average_Calculator_Mobile_App | 5e4fee0a5a2f363f4173e68ed1e0d4adcdf4a7fe | [
"Apache-2.0"
] | null | null | null | app/src/main/java/com/szymonstasik/kalkulatorsredniejwazonej/history/HistoryWeightedAverageAdapter.kt | DeNatur/Weighted_Average_Calculator_Mobile_App | 5e4fee0a5a2f363f4173e68ed1e0d4adcdf4a7fe | [
"Apache-2.0"
] | null | null | null | app/src/main/java/com/szymonstasik/kalkulatorsredniejwazonej/history/HistoryWeightedAverageAdapter.kt | DeNatur/Weighted_Average_Calculator_Mobile_App | 5e4fee0a5a2f363f4173e68ed1e0d4adcdf4a7fe | [
"Apache-2.0"
] | null | null | null | package com.szymonstasik.kalkulatorsredniejwazonej.history
import android.app.Dialog
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import android.view.Window
import androidx.databinding.DataBindingUtil
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
import com.szymonstasik.kalkulatorsredniejwazonej.R
import com.szymonstasik.kalkulatorsredniejwazonej.database.WeightedAverage
import com.szymonstasik.kalkulatorsredniejwazonej.databinding.DialogWeightAverageChooserBinding
import com.szymonstasik.kalkulatorsredniejwazonej.databinding.ListItemWeightedAverageBinding
class HistoryWeightedAverageAdapter(private val historyViewModel: HistoryViewModel)
: ListAdapter<WeightedAverage, HistoryWeightedAverageAdapter.ViewHolder>
(WeightedAverageDiffCallback()){
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder.from(parent)
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val item = getItem(position) as WeightedAverage
holder.bind(item, historyViewModel)
}
class ViewHolder private constructor(private val binding: ListItemWeightedAverageBinding)
: RecyclerView.ViewHolder(binding.root) {
fun bind(item: WeightedAverage, historyViewModel: HistoryViewModel) {
binding.weightedAverage = item
binding.root.context
binding.parent.setOnClickListener {
showDialog(binding.root.context, item, historyViewModel)
}
binding.executePendingBindings()
}
companion object {
fun from(parent: ViewGroup): ViewHolder {
val layoutInflater = LayoutInflater.from(parent.context)
val binding = ListItemWeightedAverageBinding.inflate(layoutInflater, parent, false)
return ViewHolder(binding)
}
}
private fun showDialog(context: Context, item: WeightedAverage, historyViewModel: HistoryViewModel){
val dialog = Dialog(context)
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
val layoutInflater = LayoutInflater.from(context)
val binding: DialogWeightAverageChooserBinding =
DataBindingUtil.inflate(layoutInflater, R.layout.dialog_weight_average_chooser, null, false)
binding.historyViewModel = historyViewModel
binding.deleteNote.setOnClickListener {
historyViewModel.onDeleteClick(item)
dialog.dismiss()
}
binding.editNote.setOnClickListener {
historyViewModel.onEditClick(item.id)
dialog.dismiss()
}
dialog.setContentView(binding.root)
dialog.show()
}
}
/**
* Callback for calculating the diff between two non-null items in a list.
*
* Used by ListAdapter to calculate the minumum number of changes between and old list and a new
* list that's been passed to `submitList`.
*/
class WeightedAverageDiffCallback : DiffUtil.ItemCallback<WeightedAverage>(){
override fun areItemsTheSame(oldItem: WeightedAverage, newItem: WeightedAverage): Boolean {
return oldItem.id == newItem.id
}
override fun areContentsTheSame(oldItem: WeightedAverage, newItem: WeightedAverage): Boolean {
var same = true
for (position in oldItem.notes.indices){
if (oldItem.notes[position] != newItem.notes[position])
same = false
}
return same &&
oldItem.timeAddedMilli == newItem.timeAddedMilli &&
oldItem.name == newItem.name
}
}
} | 40.082474 | 108 | 0.689558 |
f21f3a680a7b222679e70d19c1ea00a08b1f59b7 | 2,758 | asm | Assembly | ugbc/src/hw/tms9918/cls_text.asm | spotlessmind1975/ugbasic | 1df3c8fde8e80b479ece86b4ff2b97b599d57ff4 | [
"Apache-2.0"
] | 10 | 2021-10-03T13:44:25.000Z | 2022-03-10T23:53:32.000Z | ugbc/src/hw/tms9918/cls_text.asm | spotlessmind1975/ugbasic | 1df3c8fde8e80b479ece86b4ff2b97b599d57ff4 | [
"Apache-2.0"
] | 379 | 2021-08-12T09:46:09.000Z | 2022-03-27T11:29:12.000Z | ugbc/src/hw/tms9918/cls_text.asm | spotlessmind1975/ugbasic | 1df3c8fde8e80b479ece86b4ff2b97b599d57ff4 | [
"Apache-2.0"
] | 2 | 2021-11-08T19:37:50.000Z | 2021-11-20T22:27:12.000Z | ; /*****************************************************************************
; * ugBASIC - an isomorphic BASIC language compiler for retrocomputers *
; *****************************************************************************
; * Copyright 2021-2022 Marco Spedaletti ([email protected])
; *
; * 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.
; *----------------------------------------------------------------------------
; * Concesso in licenza secondo i termini della Licenza Apache, versione 2.0
; * (la "Licenza"); è proibito usare questo file se non in conformità alla
; * Licenza. Una copia della Licenza è disponibile all'indirizzo:
; *
; * http://www.apache.org/licenses/LICENSE-2.0
; *
; * Se non richiesto dalla legislazione vigente o concordato per iscritto,
; * il software distribuito nei termini della Licenza è distribuito
; * "COSì COM'è", SENZA GARANZIE O CONDIZIONI DI ALCUN TIPO, esplicite o
; * implicite. Consultare la Licenza per il testo specifico che regola le
; * autorizzazioni e le limitazioni previste dalla medesima.
; ****************************************************************************/
;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;* *
;* CLEAR SCREEN ROUTINE FOR TMS9918 (text mode) *
;* *
;* by Marco Spedaletti *
;* *
;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
; NAME COLOR PATTERN
; VDPUPDATE0: $0000
; VDPUPDATE1: $0000 $0480 $0800
; VDPUPDATE2: $3800 $2000
; VDPUPDATE3: $3800 $2000 $0000
CLST:
LD A, (CURRENTMODE)
CP 0
JR Z,CLST0
CP 1
JR Z,CLST1
RET
CLST0:
LD A, (EMPTYTILE)
LD BC, $100 + 40*24
LD DE, $0000
CALL VDPFILL
RET
CLST1:
LD A, (EMPTYTILE)
LD BC, $100 + 32*24
LD DE, $0000
CALL VDPFILL
LD A, (_PAPER)
LD BC, $100 + 32
LD DE, $0480
CALL VDPFILL
RET
| 38.84507 | 80 | 0.47752 |
0e5206b53d2c3a743332c73e7ddb388de6e380d6 | 76 | html | HTML | profile/index.html | amanks-20/IITK-homepage | 0576ba5f0568ae9a0b9cc0ee0815d40742ba78b0 | [
"MIT"
] | null | null | null | profile/index.html | amanks-20/IITK-homepage | 0576ba5f0568ae9a0b9cc0ee0815d40742ba78b0 | [
"MIT"
] | null | null | null | profile/index.html | amanks-20/IITK-homepage | 0576ba5f0568ae9a0b9cc0ee0815d40742ba78b0 | [
"MIT"
] | null | null | null | <script>
window.location.replace("https://amanks-20.github.io/");
</script>
| 19 | 56 | 0.710526 |
f61c6749e0ea065b25ca11bf1d81273e3b8e63d0 | 456 | lua | Lua | gateway/plugins/property_rate_limiting/plugin.lua | wuwenhui0917/gateway | bf312118a09ffb1b918f6c754b1b6c9b479f3256 | [
"MIT"
] | null | null | null | gateway/plugins/property_rate_limiting/plugin.lua | wuwenhui0917/gateway | bf312118a09ffb1b918f6c754b1b6c9b479f3256 | [
"MIT"
] | null | null | null | gateway/plugins/property_rate_limiting/plugin.lua | wuwenhui0917/gateway | bf312118a09ffb1b918f6c754b1b6c9b479f3256 | [
"MIT"
] | null | null | null | local _M = {}
_M.name = 'property-rate-limiting-plugin'
_M.api_name = 'property-rate-limiting-api'
_M.require_prefix = 'gateway.plugins.property_rate_limiting.';
_M.plug_reponse_header_prefix = 'X-PropertyRateLimiting-Remaining-';
_M.table_name = 'property_rate_limiting'
_M.shared_dict_rw_lock_name = 'property_rate_limiting_counter_lock'
_M.message_forbidden = 'PropertyRateLimiting-Forbidden-Rule';
_M.name_for_log = 'PropertyRateLimiting';
return _M
| 35.076923 | 68 | 0.813596 |
3e6525f0518eb16f41a5dbfc72067ce7da8284bd | 1,703 | h | C | Example/Pods/Target Support Files/ZDFoundation/ZDFoundation-umbrella.h | jj89757hhb/ZDUIKit | 97badec54c2d13d027880623885ad6439874f24c | [
"MIT"
] | null | null | null | Example/Pods/Target Support Files/ZDFoundation/ZDFoundation-umbrella.h | jj89757hhb/ZDUIKit | 97badec54c2d13d027880623885ad6439874f24c | [
"MIT"
] | null | null | null | Example/Pods/Target Support Files/ZDFoundation/ZDFoundation-umbrella.h | jj89757hhb/ZDUIKit | 97badec54c2d13d027880623885ad6439874f24c | [
"MIT"
] | null | null | null | #ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "NSDate+ZDExtend.h"
#import "NSMutableArray+ZDSafe.h"
#import "NSMutableDictionary+ZDSafe.h"
#import "NSNotificationCenter+ZDExtend.h"
#import "NSObject+ZDKVO.h"
#import "NSObject+ZDNotify.h"
#import "NSString+Hash.h"
#import "NSString+ZDCalSize.h"
#import "NSString+ZDDate.h"
#import "NSString+ZDFix.h"
#import "NSString+ZDMD5.h"
#import "UIApplication+ZDExtend.h"
#import "UIBarButtonItem+ZDBlock.h"
#import "UIColor+ZDExtend.h"
#import "UIControl+ZDBlock.h"
#import "UIDevice+ZDExtend.h"
#import "UIFont+ZDExtend.h"
#import "UIGestureRecognizer+ZDBlock.h"
#import "UIImage+ZDExtend.h"
#import "UILocalNotification+ZDExtend.h"
#import "UIScrollView+ZDExtend.h"
#import "UIView+ZDExtend.h"
#import "UIView+ZDLayout.h"
#import "UIView+ZDToImage.h"
#import "ZDFoundationMacro.h"
#import "ZDFoundation.h"
#import "ZDDataQueue.h"
#import "ZDDataStack.h"
#import "ZDDispatchQueuePool.h"
#import "ZDKeyboardManager.h"
#import "UICollectionView+ZDCellClass.h"
#import "UITableView+ZDCellClass.h"
#import "ZDCellClassType.h"
#import "ZDDataProxy.h"
#import "ZDFoundationMethodSwizlling.h"
#import "ZDModelID.h"
#import "ZDMutableArray.h"
#import "ZDTableDataPrivate.h"
#import "ZDTableRow.h"
#import "ZDTableSection.h"
#import "ZDTableViewProxy.h"
#import "ZDThreadSafeArray.h"
#import "ZDThreadSafeDictionary.h"
#import "ZDVerify.h"
#import "ZDMultipleProxy.h"
#import "ZDWeakProxy.h"
FOUNDATION_EXPORT double ZDFoundationVersionNumber;
FOUNDATION_EXPORT const unsigned char ZDFoundationVersionString[];
| 27.031746 | 66 | 0.790957 |
15a02ae692611f54efa3051594e439097aa18c46 | 197 | rb | Ruby | handlers/basecamp_project_todolist_todo_create_v1/test/simple_input.rb | kineticdata/peripherals-basecamp | 1f7a4523807597f037d8a8defda2ec74e773beba | [
"MIT"
] | null | null | null | handlers/basecamp_project_todolist_todo_create_v1/test/simple_input.rb | kineticdata/peripherals-basecamp | 1f7a4523807597f037d8a8defda2ec74e773beba | [
"MIT"
] | null | null | null | handlers/basecamp_project_todolist_todo_create_v1/test/simple_input.rb | kineticdata/peripherals-basecamp | 1f7a4523807597f037d8a8defda2ec74e773beba | [
"MIT"
] | null | null | null | {
'info' =>
{
'username'=>'',
'password'=>'',
'user_id'=>''
},
'parameters' =>
{
'project_name' => '',
'todolist_name' => '',
'content'=>'',
'due_at'=>''
}
} | 13.133333 | 26 | 0.380711 |
0518cd7ea251e12fd62137962aa09da221709ef3 | 6,831 | rb | Ruby | tests/unit/utils/unit_tests_string_utils.rb | rh-messaging/cli-proton-ruby | b640931713600d63e1937162ae5dc21656f841d8 | [
"Apache-2.0"
] | 1 | 2017-11-10T16:56:48.000Z | 2017-11-10T16:56:48.000Z | tests/unit/utils/unit_tests_string_utils.rb | rh-messaging/cli-proton-ruby | b640931713600d63e1937162ae5dc21656f841d8 | [
"Apache-2.0"
] | 42 | 2018-02-08T13:03:50.000Z | 2021-02-01T14:22:09.000Z | tests/unit/utils/unit_tests_string_utils.rb | rh-messaging/cli-proton-ruby | b640931713600d63e1937162ae5dc21656f841d8 | [
"Apache-2.0"
] | 2 | 2017-11-10T16:56:51.000Z | 2018-02-23T12:55:13.000Z | #!/usr/bin/env ruby
#--
# Copyright 2017 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#++
require 'digest'
require 'minitest/autorun'
require_relative '../../../lib/utils/string_utils'
# StringUtils unit tests class
class UnitTestsStringUtils < Minitest::Test
# str_is_int
def test_string_utils_str_is_int_true_in_string
refute StringUtils.str_is_int?("true")
end
def test_string_utils_str_is_int_false_in_string
refute StringUtils.str_is_int?("false")
end
def test_string_utils_str_is_int_positive_int_in_string
assert StringUtils.str_is_int?("1")
end
def test_string_utils_str_is_int_negative_int_in_string
assert StringUtils.str_is_int?("-1")
end
def test_string_utils_str_is_int_positive_float_in_string
refute StringUtils.str_is_int?("1.3")
end
def test_string_utils_str_is_int_negative_float_in_string
refute StringUtils.str_is_int?("-1.3")
end
def test_string_utils_str_is_int_range_in_string
refute StringUtils.str_is_int?("1..10")
end
def test_string_utils_str_is_int_empty_array_in_string
refute StringUtils.str_is_int?("[]")
end
def test_string_utils_str_is_int_simple_array_in_string
refute StringUtils.str_is_int?("['A', 'B', 'C']")
end
def test_string_utils_str_is_int_empty_hash_in_string
refute StringUtils.str_is_int?("{}")
end
def test_string_utils_str_is_int_simple_hash_in_string
refute StringUtils.str_is_int?("{1=>'A', 2=>'B', 3=>'C'}")
end
def test_string_utils_str_is_int_empty_string_in_string
refute StringUtils.str_is_int?("")
end
def test_string_utils_str_is_int_simple_string_in_string
refute StringUtils.str_is_int?("string")
end
def test_string_utils_str_is_int_symbol_in_string
refute StringUtils.str_is_int?(":ruby_symbol")
end
def test_string_utils_str_is_int_nil_in_string
refute StringUtils.str_is_int?("nil")
end
# str_is_float
def test_string_utils_str_is_float_true_in_string
refute StringUtils.str_is_float?("true")
end
def test_string_utils_str_is_float_false_in_string
refute StringUtils.str_is_float?("false")
end
def test_string_utils_str_is_float_positive_int_in_string
assert StringUtils.str_is_float?("1")
end
def test_string_utils_str_is_float_negative_int_in_string
assert StringUtils.str_is_float?("-1")
end
def test_string_utils_str_is_float_positive_float_in_string
assert StringUtils.str_is_float?("1.3")
end
def test_string_utils_str_is_float_negative_float_in_string
assert StringUtils.str_is_float?("-1.3")
end
def test_string_utils_str_is_float_range_in_string
refute StringUtils.str_is_float?("1..10")
end
def test_string_utils_str_is_float_empty_array_in_string
refute StringUtils.str_is_float?("[]")
end
def test_string_utils_str_is_float_simple_array_in_string
refute StringUtils.str_is_float?("['A', 'B', 'C']")
end
def test_string_utils_str_is_float_empty_hash_in_string
refute StringUtils.str_is_float?("{}")
end
def test_string_utils_str_is_float_simple_hash_in_string
refute StringUtils.str_is_float?("{1=>'A', 2=>'B', 3=>'C'}")
end
def test_string_utils_str_is_float_empty_string_in_string
refute StringUtils.str_is_float?("")
end
def test_string_utils_str_is_float_simple_string_in_string
refute StringUtils.str_is_float?("string")
end
def test_string_utils_str_is_float_symbol_in_string
refute StringUtils.str_is_float?(":ruby_symbol")
end
def test_string_utils_str_is_float_nil_in_string
refute StringUtils.str_is_float?("nil")
end
# str_to_bool
def test_string_utils_str_to_bool_yes_in_string
assert StringUtils.str_to_bool("yes")
end
def test_string_utils_str_to_bool_camel_true_in_string
assert StringUtils.str_to_bool("True")
end
def test_string_utils_str_to_bool_lower_true_in_string
assert StringUtils.str_to_bool("yes")
end
def test_string_utils_str_to_bool_no_in_string
refute StringUtils.str_to_bool("no")
end
def test_string_utils_str_to_bool_camel_false_in_string
refute StringUtils.str_to_bool("False")
end
def test_string_utils_str_to_bool_lower_false_in_string
refute StringUtils.str_to_bool("false")
end
def test_string_utils_str_to_bool_raise_argument_error
assert_raises ArgumentError do
StringUtils.str_to_bool("string")
end
end
def test_string_utils_str_to_bool_raise_argument_error_message
value = "string"
exception = assert_raises ArgumentError do
StringUtils.str_to_bool(value)
end
assert_equal("invalid value for Boolean(): \"#{value}\"", exception.message)
end
def test_string_utils_sha1_hash_bool_true_value
value = true
assert_equal(Digest::SHA1.hexdigest(value.to_s), StringUtils.sha1_hash(value))
end
def test_string_utils_sha1_hash_bool_false_value
value = false
assert_equal(Digest::SHA1.hexdigest(value.to_s), StringUtils.sha1_hash(value))
end
def test_string_utils_sha1_hash_int_value
value = 123
assert_equal(Digest::SHA1.hexdigest(value.to_s), StringUtils.sha1_hash(value))
end
def test_string_utils_sha1_hash_float_value
value = 3.14
assert_equal(Digest::SHA1.hexdigest(value.to_s), StringUtils.sha1_hash(value))
end
def test_string_utils_sha1_hash_range_value
value = (1..10)
assert_equal(Digest::SHA1.hexdigest(value.to_s), StringUtils.sha1_hash(value))
end
def test_string_utils_sha1_hash_array_value
value = [1, 2, 3, 4, 5]
assert_equal(Digest::SHA1.hexdigest(value.to_s), StringUtils.sha1_hash(value))
end
def test_string_utils_sha1_hash_hash_value
value = {:a => true, :b => false, :c => 1, :d => 2.0, :e => (0..9), :f => [0, 1, 2]}
assert_equal(Digest::SHA1.hexdigest(value.to_s), StringUtils.sha1_hash(value))
end
def test_string_utils_sha1_hash_symbol_value
value = :my_symbol
assert_equal(Digest::SHA1.hexdigest(value.to_s), StringUtils.sha1_hash(value))
end
def test_string_utils_sha1_hash_string_value
value = "unit_test_text"
assert_equal(Digest::SHA1.hexdigest(value.to_s), StringUtils.sha1_hash(value))
end
def test_string_utils_sha1_hash_nil_value
value = nil
assert_equal(Digest::SHA1.hexdigest(value.to_s), StringUtils.sha1_hash(value))
end
end # class UnitTestsStringUtils
# eof
| 28.227273 | 88 | 0.776314 |
651f360c505b719ccafc01d1fe50f1f24c9b71d7 | 117 | py | Python | pype/modules/idle_manager/__init__.py | simonebarbieri/pype | a6dc83aa1300738749cbe8e5e2e6d2d1794e0289 | [
"MIT"
] | null | null | null | pype/modules/idle_manager/__init__.py | simonebarbieri/pype | a6dc83aa1300738749cbe8e5e2e6d2d1794e0289 | [
"MIT"
] | null | null | null | pype/modules/idle_manager/__init__.py | simonebarbieri/pype | a6dc83aa1300738749cbe8e5e2e6d2d1794e0289 | [
"MIT"
] | null | null | null | from .idle_module import (
IdleManager,
IIdleManager
)
__all__ = (
"IdleManager",
"IIdleManager"
)
| 10.636364 | 26 | 0.632479 |
6e4c3b094110ed3e732fde6003f00947b123595c | 1,016 | swift | Swift | fujiko/fujiko/Bases/ViewModel.swift | tickboxs/Swift-RxSwift-MVVM-Architecture | 12346ba9ba97aa0af079efd05c9f23872a575685 | [
"MIT"
] | 4 | 2020-09-07T09:22:48.000Z | 2021-11-18T05:53:44.000Z | fujiko/fujiko/Bases/ViewModel.swift | tickboxs/Swift-RxSwift-MVVM-Architecture | 12346ba9ba97aa0af079efd05c9f23872a575685 | [
"MIT"
] | null | null | null | fujiko/fujiko/Bases/ViewModel.swift | tickboxs/Swift-RxSwift-MVVM-Architecture | 12346ba9ba97aa0af079efd05c9f23872a575685 | [
"MIT"
] | 1 | 2021-11-22T05:47:25.000Z | 2021-11-22T05:47:25.000Z | //
// ViewModel.swift
// fujiko
//
// Created by Charlie Cai on 9/3/20.
// Copyright © 2020 tickboxs. All rights reserved.
//
import Foundation
import RxSwift
import Swinject
protocol DisposeBagable {
var disposeBag: DisposeBag { get }
}
protocol ViewModelType {
associatedtype Input
associatedtype Output
var input: Input { get }
var output: Output { get }
}
class ViewModel: NSObject, Navigatable, DisposeBagable, LifecycleAwarable {
let navigator: INavigator = Container.shared.resolve(INavigator.self)!
let disposeBag = DisposeBag()
// Lifecycle Related Methods
// You could hook more ViewController method here such as LayoutSubviews etc.
func viewDidLoad() { }
func viewWillAppear(_ animated: Bool) { }
func viewDidAppear(_ animated: Bool) { }
func viewWillDisappear(_ animated: Bool) { }
func viewDidDisappear(_ animated: Bool) { }
deinit {
Logger.log("\(self.className()) deinit", .debug)
}
}
| 22.577778 | 81 | 0.670276 |
0bcec35720facc60f6052c501eed08d234013ce4 | 6,291 | js | JavaScript | js/libs/oj/v5.1.0/min/ojpulltorefresh.js | cyberscythelibrary/apachejet | f01fc9d26528ffcae98e27ec91ccda6d1957e64a | [
"UPL-1.0"
] | 1 | 2020-04-13T11:21:32.000Z | 2020-04-13T11:21:32.000Z | js/libs/oj/v5.0.0/min/ojpulltorefresh.js | eedorenko/ojetdevops | 6cfcf1926bf09c607512f2f1480fa8e0c6e33f77 | [
"UPL-1.0"
] | null | null | null | js/libs/oj/v5.0.0/min/ojpulltorefresh.js | eedorenko/ojetdevops | 6cfcf1926bf09c607512f2f1480fa8e0c6e33f77 | [
"UPL-1.0"
] | 1 | 2018-04-24T07:13:21.000Z | 2018-04-24T07:13:21.000Z | /**
* @license
* Copyright (c) 2014, 2018, Oracle and/or its affiliates.
* The Universal Permissive License (UPL), Version 1.0
*/
"use strict";define(["ojs/ojcore","jquery","promise","ojs/ojcomponentcore"],function(e,t){e.PullToRefreshUtils={},e.PullToRefreshUtils.setupPullToRefresh=function(l,a,s){var o,n,r,i,u,d,h,c,f,p,T,g,v,R;e.PullToRefreshUtils.tearDownPullToRefresh(l),o=t(document.createElement("div")).addClass("oj-pulltorefresh-outer"),e.PullToRefreshUtils._renderAccessibleLink(l,o,a,s),n=t(document.createElement("div")).addClass("oj-pulltorefresh-panel"),o.append(n),(r=t(l)).prepend(o),r.on("touchstart.pulltorefresh",function(l){null==t.data(n[0],"data-pullstart")&&0===r[0].scrollTop&&(e.PullToRefreshUtils._handlePull(l,n,s),(f=n.find(".oj-pulltorefresh-icon")).length>0&&(p=f.parent().outerHeight(!0)),s&&!isNaN(s.threshold)&&(u=parseInt(s.threshold,10)),u=isNaN(u)?n.outerHeight(!0):Math.max(0,Math.min(u,n.outerHeight(!0))),n.css("height",0),n.removeClass("oj-pulltorefresh-transition"),t.data(n[0],"data-pullstart",l.originalEvent.touches[0].clientY),t.data(n[0],"data-pullstart-horiz",l.originalEvent.touches[0].clientX),i=!0)}).on("touchmove.pulltorefresh",function(l){if(null!=(d=t.data(n[0],"data-pullstart"))&&!((h=l.originalEvent.touches[0].clientY-parseInt(d,10))<0)&&(l.preventDefault(),null==t.data(n[0],"data-closing")))if(null==t.data(n[0],"data-loading")){if(i){if(c=l.originalEvent.touches[0].clientX-parseInt(t.data(n[0],"data-pullstart-horiz"),10),Math.abs(c)>h)return;i=!1}n.css("height",h),e.PullToRefreshUtils._fireEvent(l,"pull",n,h),null!=f&&f.length>0&&(null!=(T=t.data(n[0],"data-lasticonclass"))&&f.removeClass(T),(v=10*Math.round(h/u*10))>=100?(R="oj-pulltorefresh-icon-full",g=e.Translations.getTranslatedString("oj-pullToRefresh.titleIconFull")):(R="oj-pulltorefresh-icon-"+v+"-percent",g=e.Translations.getTranslatedString("oj-pullToRefresh.titleIcon"+v+"percent")),f.addClass(R),f.attr("title",g),t.data(n[0],"data-lasticonclass",R),e.PullToRefreshUtils._showHideDefaultText(n,h>p))}else n.css("height",Math.max(h,u))}).on("touchcancel.pulltorefresh",function(t){e.PullToRefreshUtils._cleanup(n)}).on("touchend.pulltorefresh",function(s){if(null!=(d=t.data(n[0],"data-pullstart"))&&null==t.data(n[0],"data-closing"))return null!=t.data(n[0],"data-loading")?(h=t.data(n[0],"data-panelheight"),void n.css("height",h)):void(n.outerHeight()<u?(n.addClass("oj-pulltorefresh-transition").css("height",0),e.PullToRefreshUtils._cleanup(n)):e.PullToRefreshUtils._handleRelease(s,l,n,a))})},e.PullToRefreshUtils._handlePull=function(l,a,s){var o,n;e.PullToRefreshUtils._fireEvent(l,"pull",a,0),0==a.children().length&&(s&&(o=s.primaryText,n=s.secondaryText),e.PullToRefreshUtils._createDefaultContent(a,o,n)),a.prev().text(e.Translations.getTranslatedString("oj-pullToRefresh.ariaRefreshingLink")),a.css("height","auto"),t.data(a[0],"data-panelheight",a.outerHeight())},e.PullToRefreshUtils._handleRelease=function(l,a,s,o){var n,r,i,u,d;n=t.data(s[0],"data-panelheight"),s.addClass("oj-pulltorefresh-transition").css("height",n),e.PullToRefreshUtils._fireEvent(l,"release",s,n),t.data(s[0],"data-loading",!0),(r=s.find(".oj-pulltorefresh-icon")).length>0&&(null!=(i=t.data(s[0],"data-lasticonclass"))&&r.removeClass(i),r.addClass("oj-pulltorefresh-icon-full")),u=e.Context.getContext(a).getBusyContext().addBusyState({description:"PullToRefresh:handleRelease"}),t.data(t(a)[0],"data-pulltorefresh-busystate",u),o().then(function(o){d=function(){e.PullToRefreshUtils._fireEvent(l,"complete",s,n),e.PullToRefreshUtils._cleanup(s),s.off("transitionend",d),s.prev().text(""),e.PullToRefreshUtils._resolveBusyState(a)},s.prev().text(e.Translations.getTranslatedString("oj-pullToRefresh.ariaRefreshCompleteLink")),s.prev().prev().css("position",""),t.data(s[0],"data-closing",!0),s.on("transitionend",d),s.css("height",0)},function(l){d=function(){e.PullToRefreshUtils._cleanup(s),s.off("transitionend",d),s.prev().text(""),e.PullToRefreshUtils._resolveBusyState(a)},s.prev().prev().css("position",""),t.data(s[0],"data-closing",!0),s.on("transitionend",d),s.css("height",0)})},e.PullToRefreshUtils.tearDownPullToRefresh=function(l){t(l).children(".oj-pulltorefresh-outer").remove(),t(l).off(".pulltorefresh"),e.PullToRefreshUtils._resolveBusyState(l)},e.PullToRefreshUtils._resolveBusyState=function(e){var l,a;l=t(e)[0],(a=t.data(l,"data-pulltorefresh-busystate"))&&(a(null),t.removeData(l,"data-pulltorefresh-busystate"))},e.PullToRefreshUtils._fireEvent=function(e,l,a,s){var o=t.Event("oj"+l);o.originalEvent=e,a.trigger(o,{content:a,distance:s})},e.PullToRefreshUtils._createDefaultContent=function(e,l,a){var s,o,n,r;e.addClass("oj-pulltorefresh-content").attr("aria-hidden","true"),(s=t(document.createElement("div"))).addClass("oj-icon oj-pulltorefresh-icon oj-pulltorefresh-icon-initial"),(o=t(document.createElement("div"))).addClass("oj-pulltorefresh-icon-container"),o.append(s),t.data(e[0],"data-lasticonclass","oj-pulltorefresh-icon-initial"),e.append(o),null!=l&&(n=t(document.createElement("div")).addClass("oj-pulltorefresh-primary-text").text(l),e.append(n),null!=a&&(r=t(document.createElement("div")).addClass("oj-pulltorefresh-secondary-text").text(a),e.append(r)))},e.PullToRefreshUtils._showHideDefaultText=function(e,t){var l,a;l=e.find(".oj-pulltorefresh-primary-text"),a=e.find(".oj-pulltorefresh-secondary-text"),t?(l&&l.show(),a&&a.show()):(l&&l.hide(),a&&a.hide())},e.PullToRefreshUtils._renderAccessibleLink=function(l,a,s,o){var n,r,i;(n=t(document.createElement("a"))).text(e.Translations.getTranslatedString("oj-pullToRefresh.ariaRefreshLink")),n.addClass("oj-helper-hidden-accessible").attr("href","#").focus(function(){n.css("position","static")}).blur(function(e){null!=e.relatedTarget&&n.css("position","")}).click(function(t){r=a.children().last(),e.PullToRefreshUtils._handlePull(t,r,o),e.PullToRefreshUtils._handleRelease(t,l,r,s),s()}),(i=t(document.createElement("div"))).addClass("oj-helper-hidden-accessible").attr("aria-live","polite"),a.append(n),a.append(i)},e.PullToRefreshUtils._cleanup=function(e){t.removeData(e[0],"data-pullstart"),t.removeData(e[0],"data-pullstart-horiz"),t.removeData(e[0],"data-loading"),t.removeData(e[0],"data-closing"),e.find(".oj-pulltorefresh-icon").length>0&&e.empty()}}); | 1,048.5 | 6,157 | 0.736608 |
f418d213a280a623690fe9b0c844ea616a11faa4 | 2,233 | sql | SQL | docs/database/dump/votoelettronico_votiespressi.sql | gbrsni/votoElettronico | 484229206c511dde3531d2abd58f4885831f8f47 | [
"MIT"
] | null | null | null | docs/database/dump/votoelettronico_votiespressi.sql | gbrsni/votoElettronico | 484229206c511dde3531d2abd58f4885831f8f47 | [
"MIT"
] | null | null | null | docs/database/dump/votoelettronico_votiespressi.sql | gbrsni/votoElettronico | 484229206c511dde3531d2abd58f4885831f8f47 | [
"MIT"
] | null | null | null | -- MySQL dump 10.13 Distrib 8.0.27, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: votoelettronico
-- ------------------------------------------------------
-- Server version 8.0.27
/*!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 */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `votiespressi`
--
DROP TABLE IF EXISTS `votiespressi`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `votiespressi` (
`sessioni` int NOT NULL,
`elettori` varchar(45) NOT NULL,
PRIMARY KEY (`sessioni`,`elettori`),
KEY `fk_elettori_votiespressi_idx` (`elettori`),
CONSTRAINT `fk_elettori_votiespressi` FOREIGN KEY (`elettori`) REFERENCES `elettori` (`username`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_sessioni_votiespressi` FOREIGN KEY (`sessioni`) REFERENCES `sessioni` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `votiespressi`
--
LOCK TABLES `votiespressi` WRITE;
/*!40000 ALTER TABLE `votiespressi` DISABLE KEYS */;
/*!40000 ALTER TABLE `votiespressi` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2022-05-17 14:44:58
| 41.351852 | 136 | 0.724586 |
bbcd8dd208d07d67b1d26b05c7f248fae203575e | 614 | swift | Swift | sample/ViewController.swift | Parvinderjit/CheckboxList | ff938ebbc3c78ac576f9183844d69c10b3963255 | [
"MIT"
] | null | null | null | sample/ViewController.swift | Parvinderjit/CheckboxList | ff938ebbc3c78ac576f9183844d69c10b3963255 | [
"MIT"
] | null | null | null | sample/ViewController.swift | Parvinderjit/CheckboxList | ff938ebbc3c78ac576f9183844d69c10b3963255 | [
"MIT"
] | null | null | null | //
// ViewController.swift
// sample
//
// Created by Parvinder on 20/12/21.
// Copyright © 2021 Kyle Somers. All rights reserved.
//
import UIKit
import CheckboxList
class ViewController: UIViewController {
@IBOutlet private weak var list: ChecklistView!
override func viewDidLoad() {
super.viewDidLoad()
list.checkboxSetup([
"Quality of the Service",
"Quality of the Product",
"Pricing of the Service",
"Expert’s Behaviour",
"Expert’s Punctuality"
], font: UIFont(), color: .black, isExclusive: false)
}
}
| 21.172414 | 61 | 0.614007 |
6532631e7c9cbad3268bcb207c447017749491f6 | 894 | py | Python | drs4Calibration/drs4Calibration_version_0/config.py | fact-project/DrsTemperatureCalibration | 3702ee390c16cf2c5930d4a0f24c1354d036d645 | [
"MIT"
] | null | null | null | drs4Calibration/drs4Calibration_version_0/config.py | fact-project/DrsTemperatureCalibration | 3702ee390c16cf2c5930d4a0f24c1354d036d645 | [
"MIT"
] | null | null | null | drs4Calibration/drs4Calibration_version_0/config.py | fact-project/DrsTemperatureCalibration | 3702ee390c16cf2c5930d4a0f24c1354d036d645 | [
"MIT"
] | null | null | null | from drs4Calibration.drs4Calibration_version_0.constants import NRCELL, ROI
# Dont shuffle drsValueTypes
# The order have to be the same as the of the 'RUNIDs'
# in the drsFiles
drsValueTypes = ['Baseline',
'Gain',
'TriggerOffset']
renamedDrsValueTypes = ['Baseline',
'Gain',
'ROIOffset'] # renamed TriggerOffset
nrCellsPerChid = {'Baseline': NRCELL,
'Gain': NRCELL,
'ROIOffset': ROI}
cutOffErrorFactor = {'Baseline': 2,
'Gain': 2,
'ROIOffset': 2}
hardwareBoundaries = ['2014-05-20 12',
'2015-05-26 12']
# hardwareBoundaries
#
# 20.05.2014 Camera repair, Replacement of Capacitors
# 26.5.2015 Replacement FAD board (crate 2, board 0)
#
# See also 'https://trac.fact-project.org/wiki/Protected/SystemChanges'
| 31.928571 | 75 | 0.589485 |
187014dc8ecf9cb305e87fd7f6c149590effdc2d | 7,195 | rs | Rust | rust/xaynet-server/src/state_machine/requests.rs | xaynetwork/xaynet | ae6a7b2127599b8ac9cd663a5259d2ff01392fe0 | [
"Apache-2.0"
] | 142 | 2020-07-15T09:29:45.000Z | 2022-03-26T16:23:25.000Z | rust/xaynet-server/src/state_machine/requests.rs | xaynetwork/xaynet | ae6a7b2127599b8ac9cd663a5259d2ff01392fe0 | [
"Apache-2.0"
] | 482 | 2020-07-14T08:03:23.000Z | 2022-03-28T07:26:22.000Z | rust/xaynet-server/src/state_machine/requests.rs | xaynetwork/xaynet | ae6a7b2127599b8ac9cd663a5259d2ff01392fe0 | [
"Apache-2.0"
] | 15 | 2020-07-16T07:26:34.000Z | 2022-02-05T13:04:49.000Z | //! This module provides the the `StateMachine`, `Request`, `RequestSender` and `RequestReceiver`
//! types.
use std::{
pin::Pin,
task::{Context, Poll},
};
use derive_more::From;
use displaydoc::Display;
use futures::{future::FutureExt, Stream};
use thiserror::Error;
use tokio::sync::{mpsc, oneshot};
use tracing::{trace, Span};
use crate::storage::{LocalSeedDictAddError, MaskScoreIncrError, StorageError, SumPartAddError};
use xaynet_core::{
mask::MaskObject,
message::{Message, Payload, Update},
LocalSeedDict,
ParticipantPublicKey,
SumParticipantEphemeralPublicKey,
SumParticipantPublicKey,
UpdateParticipantPublicKey,
};
/// Errors which can occur while the state machine handles a request.
#[derive(Debug, Display, Error)]
pub enum RequestError {
/// The message was rejected.
MessageRejected,
/// The message was discarded.
MessageDiscarded,
/// Invalid update: the model or scalar sent by the participant could not be aggregated.
AggregationFailed,
/// The request could not be processed due to an internal error: {0}.
InternalError(&'static str),
/// Storage request failed: {0}.
CoordinatorStorage(#[from] StorageError),
/// Adding a local seed dict to the seed dictionary failed: {0}.
LocalSeedDictAdd(#[from] LocalSeedDictAddError),
/// Adding a sum participant to the sum dictionary failed: {0}.
SumPartAdd(#[from] SumPartAddError),
/// Incrementing a mask score failed: {0}.
MaskScoreIncr(#[from] MaskScoreIncrError),
}
/// A sum request.
#[derive(Debug)]
pub struct SumRequest {
/// The public key of the participant.
pub participant_pk: SumParticipantPublicKey,
/// The ephemeral public key of the participant.
pub ephm_pk: SumParticipantEphemeralPublicKey,
}
/// An update request.
#[derive(Debug)]
pub struct UpdateRequest {
/// The public key of the participant.
pub participant_pk: UpdateParticipantPublicKey,
/// The local seed dict that contains the seed used to mask `masked_model`.
pub local_seed_dict: LocalSeedDict,
/// The masked model trained by the participant.
pub masked_model: MaskObject,
}
/// A sum2 request.
#[derive(Debug)]
pub struct Sum2Request {
/// The public key of the participant.
pub participant_pk: ParticipantPublicKey,
/// The model mask computed by the participant.
pub model_mask: MaskObject,
}
/// A [`StateMachine`] request.
///
/// [`StateMachine`]: crate::state_machine
#[derive(Debug, From)]
pub enum StateMachineRequest {
Sum(SumRequest),
Update(UpdateRequest),
Sum2(Sum2Request),
}
impl From<Message> for StateMachineRequest {
fn from(message: Message) -> Self {
let participant_pk = message.participant_pk;
match message.payload {
Payload::Sum(sum) => StateMachineRequest::Sum(SumRequest {
participant_pk,
ephm_pk: sum.ephm_pk,
}),
Payload::Update(update) => {
let Update {
local_seed_dict,
masked_model,
..
} = update;
StateMachineRequest::Update(UpdateRequest {
participant_pk,
local_seed_dict,
masked_model,
})
}
Payload::Sum2(sum2) => StateMachineRequest::Sum2(Sum2Request {
participant_pk,
model_mask: sum2.model_mask,
}),
Payload::Chunk(_) => unimplemented!(),
}
}
}
/// A handle to send requests to the [`StateMachine`].
///
/// [`StateMachine`]: crate::state_machine
#[derive(Clone, From, Debug)]
pub struct RequestSender(mpsc::UnboundedSender<(StateMachineRequest, Span, ResponseSender)>);
impl RequestSender {
/// Sends a request to the [`StateMachine`].
///
/// # Errors
/// Fails if the [`StateMachine`] has already shut down and the `Request` channel has been
/// closed as a result.
///
/// [`StateMachine`]: crate::state_machine
pub async fn request(&self, req: StateMachineRequest, span: Span) -> Result<(), RequestError> {
let (resp_tx, resp_rx) = oneshot::channel::<Result<(), RequestError>>();
self.0.send((req, span, resp_tx)).map_err(|_| {
RequestError::InternalError(
"failed to send request to the state machine: state machine is shutting down",
)
})?;
resp_rx.await.map_err(|_| {
RequestError::InternalError("failed to receive response from the state machine")
})?
}
#[cfg(test)]
pub fn is_closed(&self) -> bool {
self.0.is_closed()
}
}
/// A channel for sending the state machine to send the response to a
/// [`StateMachineRequest`].
pub(in crate::state_machine) type ResponseSender = oneshot::Sender<Result<(), RequestError>>;
/// The receiver half of the `Request` channel that is used by the [`StateMachine`] to receive
/// requests.
///
/// [`StateMachine`]: crate::state_machine
#[derive(From, Debug)]
pub struct RequestReceiver(mpsc::UnboundedReceiver<(StateMachineRequest, Span, ResponseSender)>);
impl Stream for RequestReceiver {
type Item = (StateMachineRequest, Span, ResponseSender);
fn poll_next(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
trace!("RequestReceiver: polling");
Pin::new(&mut self.get_mut().0).poll_recv(cx)
}
}
impl RequestReceiver {
/// Creates a new `Request` channel and returns the [`RequestReceiver`] as well as the
/// [`RequestSender`] half.
pub fn new() -> (Self, RequestSender) {
let (tx, rx) = mpsc::unbounded_channel::<(StateMachineRequest, Span, ResponseSender)>();
let receiver = RequestReceiver::from(rx);
let handle = RequestSender::from(tx);
(receiver, handle)
}
/// Closes the `Request` channel.
/// See [the `tokio` documentation][close] for more information.
///
/// [close]: https://docs.rs/tokio/1.1.0/tokio/sync/mpsc/struct.UnboundedReceiver.html#method.close
pub fn close(&mut self) {
self.0.close()
}
/// Receives the next request.
/// See [the `tokio` documentation][receive] for more information.
///
/// [receive]: https://docs.rs/tokio/1.1.0/tokio/sync/mpsc/struct.UnboundedReceiver.html#method.recv
pub async fn recv(&mut self) -> Option<(StateMachineRequest, Span, ResponseSender)> {
self.0.recv().await
}
/// Try to retrieve the next request without blocking
pub fn try_recv(&mut self) -> Option<Option<(StateMachineRequest, Span, ResponseSender)>> {
// Note `try_recv` (tokio 0.2.x) or `recv().now_or_never()` (tokio 1.x)
// has an implementation bug where previously sent messages may not be
// available immediately.
// Related issue: https://github.com/tokio-rs/tokio/issues/3350
// At the moment it behaves like `try_recv`, but we should check if this
// bug is a problem for us. But first we should replace the unbounded channel canal with
// a bounded channel (XN-1162)
self.0.recv().now_or_never()
}
}
| 34.927184 | 104 | 0.64517 |
f01114fcd31b24a944a91cf16636601c7b3cffa8 | 6,134 | py | Python | src/func.py | yygr/datascience_utility | aa6aa37508e46ab3568805dd1bb514ef10652240 | [
"MIT"
] | null | null | null | src/func.py | yygr/datascience_utility | aa6aa37508e46ab3568805dd1bb514ef10652240 | [
"MIT"
] | null | null | null | src/func.py | yygr/datascience_utility | aa6aa37508e46ab3568805dd1bb514ef10652240 | [
"MIT"
] | null | null | null | from pdb import set_trace
from time import time
import matplotlib.pyplot as plt
import numpy as np
from numpy import random
from scipy.stats import chi2
import renom as rm
class Enc(rm.Model):
def __init__(
self, pre, latent_dim,
output_act = None,
):
self.pre = pre
self.latent_dim = latent_dim
self.zm_ = rm.Dense(latent_dim)
self.zlv_ = rm.Dense(latent_dim)
self.output_act = output_act
def forward(self, x):
hidden = self.pre(x)
self.zm = self.zm_(hidden)
self.zlv = self.zlv_(hidden)
if self.output_act:
self.zm = self.output_act(self.zm)
self.zlv = self.output_act(self.zlv)
return self.zm
class VAE(rm.Model):
def __init__(
self,
enc,
dec,
latent_dim,
batch_size = None,
sigma = 1.
):
self.latent_dim = latent_dim
self.enc = enc
self.dec = dec
self.batch_size = batch_size
self.sigma = sigma
def forward(self, x, eps=1e-3):
nb = len(x)
self.enc(x)
e = np.random.randn(nb, self.latent_dim)*self.sigma
self.z = self.enc.zm + rm.exp(self.enc.zlv/2)*e
self.decd = self.dec(self.z)
self.reconE = rm.mean_squared_error(self.decd, x)
self.kl_loss = - 0.5 * rm.sum(
1 + self.enc.zlv - self.enc.zm**2 -rm.exp(self.enc.zlv)
)/nb
self.vae_loss = self.kl_loss + self.reconE
return self.decd
class Mahalanobis():
def __init__(self, data, label):
self.i_max = label.max() + 1
self.labels = np.unique(label)
self.d = data.shape[-1]
#print('Computing the mean')
#s = time.time()
self.mu = np.array([
data[np.where(label==x)[0]].mean(0) for x in self.labels])
#print(' {}sec'.format(time.time() - s))
#print('Computing Cov')
#s = time.time()
self.cov = np.array([
np.cov(data[np.where(label==x)[0]].T) for x in self.labels])
#print(' {}sec'.format(time.time() - s))
#n()
print('Computing Dist')
s = time()
self.comp_dist(data, label)
print(' {}sec'.format(time() - s))
#self.set_th()
def stat(self):
print('latent dimention = {}'.format(self.d))
print('{} classifier'.format(self.i_max))
def a(self, x, i):
temp = x-self.mu[i]
#return np.dot(np.dot(temp, np.linalg.inv(self.cov[i])), temp.T)
return np.dot(temp, np.linalg.solve(self.cov[i], temp.T))
def al(self, x):
return [self.a(x, i) for i in range(self.i_max)]
def comp_dist(self, data, label):
dist = []
if 0:
for x in self.labels:
sub = data[np.where(label==x)[0]]
dist.append(np.array([self.al(x) for x in sub]))
#dist.append(np.diagonal(np.dot(np.dot(sub,self.cov[i]),sub.T)))
else:
for x in self.labels:
sub = data[np.where(label==x)[0]]
sub_dist = []
for i, y in enumerate(self.labels):
temp = sub - self.mu[i]
sub_dist.append(np.diag(
np.dot(temp,
np.linalg.sove(self.cov[i], temp.T))
))
self.dist = np.array(dist)
def get_dist(self, data):
res = np.zeros((len(data), self.i_max))
for i in range(self.i_max):
temp = data - self.mu[i]
res[:,i] = np.diag(
np.dot(temp,
np.linalg.solve(self.cov[i], temp.T))
)
return res
#return np.array([self.al(x) for x in data])
def gamma(self,n):
return np.prod(np.arange(1,n))
def chi_squared(self, u, k, s):
a = 2*s
b = k//2
t = u/a
v = np.power(t,b-1)*np.exp(-t)/a/self.gamma(b)
return v
def comp_th(self, th):
assert th <= 1, "{}:th must be lower than 1 or equal to 1".format(th)
dth = 1 - th
return chi2.isf(dth, self.d)
def get_ths(self, ths):
ths_ = np.sort(ths)
acc = 0
split = 1e6
maxv = 100
delta = maxv/split
athl = []
ath = 0
pre = 0
for dth in ths_:
while acc < dth:
check_value = '\r{}'.format(acc)
sys.stdout.write(check_value)
sys.stdout.flush()
acc += self.chi_squared(ath, self.d, 1) * delta
ath += delta
athl.append(ath)
print('')
return np.array(athl)
def set_th(self, th=0.001):
th = self.comp_th(th)
self.th = th
def predict(self, data, th=None):
res = self.get_dist(data)
if th is None:
return res / self.th
return res / th
def predicts(self, data, ths):
temp = self.get_dist(data)
res = []
for th in ths:
res.append(temp/th)
return np.array(res)
def predict_prob(self, data):
res = self.get_dist(data)
prob_all = []
for item in res:
subprob = []
for i, x in enumerate(item):
distance = self.cumprob[i][0]
prob = self.cumprob[i][1]
if distance[-1] < x:
subprob.append(prob[-1])
else:
subprob.append(prob[np.argmax(distance>x)-1])
prob_all.append(np.array(subprob))
return res/self.th, np.array(prob_all)
def comp_cummlative_probability(self, bins=100):
cumprob = []
for i in range(self.dist.shape[0]):
hist, x = np.histogram(np.sort(self.dist[i][:,i]), bins)
cum_hist = np.array([hist[:j].sum() for j,_ in enumerate(hist)])
cum_hist = 1 - cum_hist/cum_hist.max().astype('float')
cumprob.append((x[:-1],cum_hist))
self.cumprob = np.array(cumprob)
| 31.137056 | 80 | 0.5 |
6b63cec15dee3ebc3a5c5738cc244d58f9da22db | 1,754 | h | C | source/extensions/filters/common/mutation_rules/mutation_rules.h | DmitriyLashko1978/envoy | d76d44494f2c91ae3fcc288ae914ebecaadffb0f | [
"Apache-2.0"
] | null | null | null | source/extensions/filters/common/mutation_rules/mutation_rules.h | DmitriyLashko1978/envoy | d76d44494f2c91ae3fcc288ae914ebecaadffb0f | [
"Apache-2.0"
] | 27 | 2022-02-02T22:32:58.000Z | 2022-03-31T22:37:08.000Z | source/extensions/filters/common/mutation_rules/mutation_rules.h | beautytiger/envoy | e675f3e65757befe9462f43c5603193e47cfc047 | [
"Apache-2.0"
] | null | null | null | #pragma once
#include "envoy/config/common/mutation_rules/v3/mutation_rules.pb.h"
#include "envoy/http/header_map.h"
#include "source/common/common/regex.h"
#include "absl/strings/string_view.h"
namespace Envoy {
namespace Extensions {
namespace Filters {
namespace Common {
namespace MutationRules {
enum class CheckOperation { SET, APPEND, REMOVE };
enum class CheckResult { OK, IGNORE, FAIL };
class ExtraRoutingHeaders;
// Checker can be used to test a proposed change to an HTTP header against
// the mutation rules expressed in the *HeaderMutationRules* proto.
class Checker {
public:
explicit Checker(const envoy::config::common::mutation_rules::v3::HeaderMutationRules& rules);
// Return whether the current rules allow the named header to be modified or removed.
// The header name in question can include HTTP headers or internal headers
// that start with ":". The result will specify whether the attempt should
// be accepted, whether it should be silently ignored, or whether it should
// cause the current HTTP operation to fail.
CheckResult check(CheckOperation op, const Http::LowerCaseString& header_name,
absl::string_view header_value) const;
private:
bool isAllowed(CheckOperation op, const Http::LowerCaseString& header_name) const;
bool isValidValue(const Http::LowerCaseString& header_name, absl::string_view header_value) const;
static const ExtraRoutingHeaders& extraRoutingHeaders();
envoy::config::common::mutation_rules::v3::HeaderMutationRules rules_;
Regex::CompiledMatcherPtr allow_expression_;
Regex::CompiledMatcherPtr disallow_expression_;
};
} // namespace MutationRules
} // namespace Common
} // namespace Filters
} // namespace Extensions
} // namespace Envoy
| 35.795918 | 100 | 0.77195 |
5c4301951d2d47d332694d9c1e00ce7b42db22ad | 15,374 | c | C | mi8/drivers/staging/qcacld-3.0/core/mac/src/cfg/cfg_param_name.c | wqk317/mi8_kernel_source | e3482d1a7ea6021de2fc8f3178496b4b043bb727 | [
"MIT"
] | null | null | null | mi8/drivers/staging/qcacld-3.0/core/mac/src/cfg/cfg_param_name.c | wqk317/mi8_kernel_source | e3482d1a7ea6021de2fc8f3178496b4b043bb727 | [
"MIT"
] | null | null | null | mi8/drivers/staging/qcacld-3.0/core/mac/src/cfg/cfg_param_name.c | wqk317/mi8_kernel_source | e3482d1a7ea6021de2fc8f3178496b4b043bb727 | [
"MIT"
] | null | null | null | /*
* Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/*
* DO NOT EDIT - This file is generated automatically
*/
/*
* IMPORTANT: This file is for system that supports STA mode ONLY.
*/
#include "cfg_priv.h"
/**
* cfg_get_string() - return string conversion of HE WNI CFG
* @cfg_id: Config ID.
*
* This utility function helps log string conversion of WNI config ID.
*
* Return: string conversion of the HE WNI config ID, if match found;
* "Invalid" otherwise.
*/
const char *cfg_get_string(uint16_t cfg_id)
{
switch (cfg_id) {
default:
break;
CASE_RETURN_STRING(WNI_CFG_STA_ID);
CASE_RETURN_STRING(WNI_CFG_CFP_PERIOD);
CASE_RETURN_STRING(WNI_CFG_CFP_MAX_DURATION);
CASE_RETURN_STRING(WNI_CFG_SSID);
CASE_RETURN_STRING(WNI_CFG_BEACON_INTERVAL);
CASE_RETURN_STRING(WNI_CFG_DTIM_PERIOD);
CASE_RETURN_STRING(WNI_CFG_WEP_DEFAULT_KEY_1);
CASE_RETURN_STRING(WNI_CFG_WEP_DEFAULT_KEY_2);
CASE_RETURN_STRING(WNI_CFG_WEP_DEFAULT_KEY_3);
CASE_RETURN_STRING(WNI_CFG_WEP_DEFAULT_KEY_4);
CASE_RETURN_STRING(WNI_CFG_WEP_DEFAULT_KEYID);
CASE_RETURN_STRING(WNI_CFG_RTS_THRESHOLD);
CASE_RETURN_STRING(WNI_CFG_FRAGMENTATION_THRESHOLD);
CASE_RETURN_STRING(WNI_CFG_ACTIVE_MINIMUM_CHANNEL_TIME);
CASE_RETURN_STRING(WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME);
CASE_RETURN_STRING(WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME);
CASE_RETURN_STRING(WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME);
CASE_RETURN_STRING(WNI_CFG_JOIN_FAILURE_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_AUTHENTICATE_RSP_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_SUPPORTED_RATES_11B);
CASE_RETURN_STRING(WNI_CFG_SUPPORTED_RATES_11A);
CASE_RETURN_STRING(WNI_CFG_DOT11_MODE);
CASE_RETURN_STRING(WNI_CFG_OPERATIONAL_RATE_SET);
CASE_RETURN_STRING(WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET);
CASE_RETURN_STRING(WNI_CFG_LISTEN_INTERVAL);
CASE_RETURN_STRING(WNI_CFG_VALID_CHANNEL_LIST);
CASE_RETURN_STRING(WNI_CFG_APSD_ENABLED);
CASE_RETURN_STRING(WNI_CFG_SHARED_KEY_AUTH_ENABLE);
CASE_RETURN_STRING(WNI_CFG_OPEN_SYSTEM_AUTH_ENABLE);
CASE_RETURN_STRING(WNI_CFG_AUTHENTICATION_TYPE);
CASE_RETURN_STRING(WNI_CFG_PRIVACY_ENABLED);
CASE_RETURN_STRING(WNI_CFG_SHORT_PREAMBLE);
CASE_RETURN_STRING(WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY);
CASE_RETURN_STRING(WNI_CFG_QOS_ENABLED);
CASE_RETURN_STRING(WNI_CFG_HCF_ENABLED);
CASE_RETURN_STRING(WNI_CFG_RSN_ENABLED);
CASE_RETURN_STRING(WNI_CFG_MAX_NUM_PRE_AUTH);
CASE_RETURN_STRING(WNI_CFG_HEART_BEAT_THRESHOLD);
CASE_RETURN_STRING(WNI_CFG_PROBE_AFTER_HB_FAIL_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_MANUFACTURER_NAME);
CASE_RETURN_STRING(WNI_CFG_MODEL_NUMBER);
CASE_RETURN_STRING(WNI_CFG_MODEL_NAME);
CASE_RETURN_STRING(WNI_CFG_MANUFACTURER_PRODUCT_NAME);
CASE_RETURN_STRING(WNI_CFG_MANUFACTURER_PRODUCT_VERSION);
CASE_RETURN_STRING(WNI_CFG_11D_ENABLED);
CASE_RETURN_STRING(WNI_CFG_MAX_TX_POWER_2_4);
CASE_RETURN_STRING(WNI_CFG_MAX_TX_POWER_5);
CASE_RETURN_STRING(WNI_CFG_CURRENT_TX_POWER_LEVEL);
CASE_RETURN_STRING(WNI_CFG_NEW_BSS_FOUND_IND);
CASE_RETURN_STRING(WNI_CFG_COUNTRY_CODE);
CASE_RETURN_STRING(WNI_CFG_11H_ENABLED);
CASE_RETURN_STRING(WNI_CFG_WT_CNF_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_OLBC_DETECT_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_PROTECTION_ENABLED);
CASE_RETURN_STRING(WNI_CFG_11G_PROTECTION_ALWAYS);
CASE_RETURN_STRING(WNI_CFG_FORCE_POLICY_PROTECTION);
CASE_RETURN_STRING(WNI_CFG_11G_SHORT_PREAMBLE_ENABLED);
CASE_RETURN_STRING(WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED);
CASE_RETURN_STRING(WNI_CFG_11G_ONLY_POLICY);
CASE_RETURN_STRING(WNI_CFG_WME_ENABLED);
CASE_RETURN_STRING(WNI_CFG_ADDTS_RSP_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_MAX_SP_LENGTH);
CASE_RETURN_STRING(WNI_CFG_WSM_ENABLED);
CASE_RETURN_STRING(WNI_CFG_EDCA_PROFILE);
CASE_RETURN_STRING(WNI_CFG_EDCA_ANI_ACBK_LOCAL);
CASE_RETURN_STRING(WNI_CFG_EDCA_ANI_ACBE_LOCAL);
CASE_RETURN_STRING(WNI_CFG_EDCA_ANI_ACVI_LOCAL);
CASE_RETURN_STRING(WNI_CFG_EDCA_ANI_ACVO_LOCAL);
CASE_RETURN_STRING(WNI_CFG_EDCA_ANI_ACBK);
CASE_RETURN_STRING(WNI_CFG_EDCA_ANI_ACBE);
CASE_RETURN_STRING(WNI_CFG_EDCA_ANI_ACVI);
CASE_RETURN_STRING(WNI_CFG_EDCA_ANI_ACVO);
CASE_RETURN_STRING(WNI_CFG_EDCA_WME_ACBK_LOCAL);
CASE_RETURN_STRING(WNI_CFG_EDCA_WME_ACBE_LOCAL);
CASE_RETURN_STRING(WNI_CFG_EDCA_WME_ACVI_LOCAL);
CASE_RETURN_STRING(WNI_CFG_EDCA_WME_ACVO_LOCAL);
CASE_RETURN_STRING(WNI_CFG_EDCA_WME_ACBK);
CASE_RETURN_STRING(WNI_CFG_EDCA_WME_ACBE);
CASE_RETURN_STRING(WNI_CFG_EDCA_WME_ACVI);
CASE_RETURN_STRING(WNI_CFG_EDCA_WME_ACVO);
CASE_RETURN_STRING(WNI_CFG_LOCAL_POWER_CONSTRAINT);
CASE_RETURN_STRING(WNI_CFG_ADMIT_POLICY);
CASE_RETURN_STRING(WNI_CFG_ADMIT_BWFACTOR);
CASE_RETURN_STRING(WNI_CFG_CHANNEL_BONDING_MODE);
CASE_RETURN_STRING(WNI_CFG_BLOCK_ACK_ENABLED);
CASE_RETURN_STRING(WNI_CFG_HT_CAP_INFO);
CASE_RETURN_STRING(WNI_CFG_HT_AMPDU_PARAMS);
CASE_RETURN_STRING(WNI_CFG_SUPPORTED_MCS_SET);
CASE_RETURN_STRING(WNI_CFG_EXT_HT_CAP_INFO);
CASE_RETURN_STRING(WNI_CFG_TX_BF_CAP);
CASE_RETURN_STRING(WNI_CFG_AS_CAP);
CASE_RETURN_STRING(WNI_CFG_HT_INFO_FIELD1);
CASE_RETURN_STRING(WNI_CFG_HT_INFO_FIELD2);
CASE_RETURN_STRING(WNI_CFG_HT_INFO_FIELD3);
CASE_RETURN_STRING(WNI_CFG_BASIC_MCS_SET);
CASE_RETURN_STRING(WNI_CFG_CURRENT_MCS_SET);
CASE_RETURN_STRING(WNI_CFG_VHT_MAX_MPDU_LENGTH);
CASE_RETURN_STRING(WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET);
CASE_RETURN_STRING(WNI_CFG_VHT_LDPC_CODING_CAP);
CASE_RETURN_STRING(WNI_CFG_VHT_SHORT_GI_80MHZ);
CASE_RETURN_STRING(WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ);
CASE_RETURN_STRING(WNI_CFG_VHT_TXSTBC);
CASE_RETURN_STRING(WNI_CFG_VHT_RXSTBC);
CASE_RETURN_STRING(WNI_CFG_VHT_SU_BEAMFORMER_CAP);
CASE_RETURN_STRING(WNI_CFG_VHT_SU_BEAMFORMEE_CAP);
CASE_RETURN_STRING(WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED);
CASE_RETURN_STRING(WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS);
CASE_RETURN_STRING(WNI_CFG_VHT_MU_BEAMFORMER_CAP);
CASE_RETURN_STRING(WNI_CFG_VHT_MU_BEAMFORMEE_CAP);
CASE_RETURN_STRING(WNI_CFG_VHT_TXOP_PS);
CASE_RETURN_STRING(WNI_CFG_VHT_HTC_VHTC_CAP);
CASE_RETURN_STRING(WNI_CFG_VHT_AMPDU_LEN_EXPONENT);
CASE_RETURN_STRING(WNI_CFG_VHT_LINK_ADAPTATION_CAP);
CASE_RETURN_STRING(WNI_CFG_VHT_RX_ANT_PATTERN);
CASE_RETURN_STRING(WNI_CFG_VHT_TX_ANT_PATTERN);
CASE_RETURN_STRING(WNI_CFG_VHT_RX_MCS_MAP);
CASE_RETURN_STRING(WNI_CFG_VHT_TX_MCS_MAP);
CASE_RETURN_STRING(WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE);
CASE_RETURN_STRING(WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE);
CASE_RETURN_STRING(WNI_CFG_VHT_BASIC_MCS_SET);
CASE_RETURN_STRING(WNI_CFG_VHT_MU_MIMO_CAP_STA_COUNT);
CASE_RETURN_STRING(WNI_CFG_VHT_SS_UNDER_UTIL);
CASE_RETURN_STRING(WNI_CFG_VHT_40MHZ_UTILIZATION);
CASE_RETURN_STRING(WNI_CFG_VHT_80MHZ_UTILIZATION);
CASE_RETURN_STRING(WNI_CFG_VHT_160MHZ_UTILIZATION);
CASE_RETURN_STRING(WNI_CFG_MPDU_DENSITY);
CASE_RETURN_STRING(WNI_CFG_MAX_RX_AMPDU_FACTOR);
CASE_RETURN_STRING(WNI_CFG_MAX_PS_POLL);
CASE_RETURN_STRING(WNI_CFG_WOWLAN_UCAST_PATTERN_FILTER_ENABLE);
CASE_RETURN_STRING(WNI_CFG_WOWLAN_CHANNEL_SWITCH_ENABLE);
CASE_RETURN_STRING(WNI_CFG_WOWLAN_DEAUTH_ENABLE);
CASE_RETURN_STRING(WNI_CFG_WOWLAN_DISASSOC_ENABLE);
CASE_RETURN_STRING(WNI_CFG_WOWLAN_MAX_MISSED_BEACON);
CASE_RETURN_STRING(WNI_CFG_WOWLAN_MAX_SLEEP_PERIOD);
CASE_RETURN_STRING(WNI_CFG_IBSS_AUTO_BSSID);
CASE_RETURN_STRING(WNI_CFG_WPS_ENABLE);
CASE_RETURN_STRING(WNI_CFG_WPS_STATE);
CASE_RETURN_STRING(WNI_CFG_WPS_VERSION);
CASE_RETURN_STRING(WNI_CFG_WPS_CFG_METHOD);
CASE_RETURN_STRING(WNI_CFG_WPS_UUID);
CASE_RETURN_STRING(WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY);
CASE_RETURN_STRING(WNI_CFG_WPS_PIMARY_DEVICE_OUI);
CASE_RETURN_STRING(WNI_CFG_WPS_DEVICE_SUB_CATEGORY);
CASE_RETURN_STRING(WNI_CFG_WPS_DEVICE_PASSWORD_ID);
CASE_RETURN_STRING(WNI_CFG_SINGLE_TID_RC);
CASE_RETURN_STRING(WNI_CFG_TELE_BCN_WAKEUP_EN);
CASE_RETURN_STRING(WNI_CFG_TELE_BCN_MAX_LI);
CASE_RETURN_STRING(WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD);
CASE_RETURN_STRING(WNI_CFG_ASSOC_STA_LIMIT);
CASE_RETURN_STRING(WNI_CFG_ENABLE_LTE_COEX);
CASE_RETURN_STRING(WNI_CFG_AP_KEEP_ALIVE_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_GO_KEEP_ALIVE_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_ENABLE_MC_ADDR_LIST);
CASE_RETURN_STRING(WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED);
CASE_RETURN_STRING(WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP);
CASE_RETURN_STRING(WNI_CFG_AP_LINK_MONITOR_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK);
CASE_RETURN_STRING(WNI_CFG_TDLS_BUF_STA_ENABLED);
CASE_RETURN_STRING(WNI_CFG_TDLS_PUAPSD_INACT_TIME);
CASE_RETURN_STRING(WNI_CFG_TDLS_RX_FRAME_THRESHOLD);
CASE_RETURN_STRING(WNI_CFG_PMF_SA_QUERY_MAX_RETRIES);
CASE_RETURN_STRING(WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL);
CASE_RETURN_STRING(WNI_CFG_GO_LINK_MONITOR_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_RMC_ACTION_PERIOD_FREQUENCY);
CASE_RETURN_STRING(WNI_CFG_CURRENT_RSSI);
CASE_RETURN_STRING(WNI_CFG_RTT3_ENABLE);
CASE_RETURN_STRING(WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL);
CASE_RETURN_STRING(WNI_CFG_TDLS_OFF_CHANNEL_ENABLED);
CASE_RETURN_STRING(WNI_CFG_IBSS_ATIM_WIN_SIZE);
CASE_RETURN_STRING(WNI_CFG_DFS_MASTER_ENABLED);
CASE_RETURN_STRING(WNI_CFG_VHT_ENABLE_TXBF_20MHZ);
CASE_RETURN_STRING(WNI_CFG_TDLS_WMM_MODE_ENABLED);
CASE_RETURN_STRING(WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME);
CASE_RETURN_STRING(WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME);
CASE_RETURN_STRING(WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL);
CASE_RETURN_STRING(WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL);
CASE_RETURN_STRING(WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL);
CASE_RETURN_STRING(WNI_CFG_OBSS_HT40_WIDTH_CH_TRANSITION_DELAY);
CASE_RETURN_STRING(WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD);
CASE_RETURN_STRING(WNI_CFG_TGT_GTX_USR_CFG);
CASE_RETURN_STRING(WNI_CFG_MAX_HT_MCS_TX_DATA);
CASE_RETURN_STRING(WNI_CFG_DISABLE_ABG_RATE_FOR_TX_DATA);
CASE_RETURN_STRING(WNI_CFG_RATE_FOR_TX_MGMT);
CASE_RETURN_STRING(WNI_CFG_HE_CONTROL);
CASE_RETURN_STRING(WNI_CFG_HE_TWT_REQUESTOR);
CASE_RETURN_STRING(WNI_CFG_HE_TWT_RESPONDER);
CASE_RETURN_STRING(WNI_CFG_HE_FRAGMENTATION);
CASE_RETURN_STRING(WNI_CFG_HE_MAX_FRAG_MSDU);
CASE_RETURN_STRING(WNI_CFG_HE_MIN_FRAG_SIZE);
CASE_RETURN_STRING(WNI_CFG_HE_TRIG_PAD);
CASE_RETURN_STRING(WNI_CFG_HE_MTID_AGGR);
CASE_RETURN_STRING(WNI_CFG_HE_LINK_ADAPTATION);
CASE_RETURN_STRING(WNI_CFG_HE_ALL_ACK);
CASE_RETURN_STRING(WNI_CFG_HE_UL_MU_RSP_SCHEDULING);
CASE_RETURN_STRING(WNI_CFG_HE_BUFFER_STATUS_RPT);
CASE_RETURN_STRING(WNI_CFG_HE_BCAST_TWT);
CASE_RETURN_STRING(WNI_CFG_HE_BA_32BIT);
CASE_RETURN_STRING(WNI_CFG_HE_MU_CASCADING);
CASE_RETURN_STRING(WNI_CFG_HE_MULTI_TID);
CASE_RETURN_STRING(WNI_CFG_HE_DL_MU_BA);
CASE_RETURN_STRING(WNI_CFG_HE_OMI);
CASE_RETURN_STRING(WNI_CFG_HE_OFDMA_RA);
CASE_RETURN_STRING(WNI_CFG_HE_MAX_AMPDU_LEN);
CASE_RETURN_STRING(WNI_CFG_HE_AMSDU_FRAG);
CASE_RETURN_STRING(WNI_CFG_HE_FLEX_TWT_SCHED);
CASE_RETURN_STRING(WNI_CFG_HE_RX_CTRL);
CASE_RETURN_STRING(WNI_CFG_HE_BSRP_AMPDU_AGGR);
CASE_RETURN_STRING(WNI_CFG_HE_QTP);
CASE_RETURN_STRING(WNI_CFG_HE_A_BQR);
CASE_RETURN_STRING(WNI_CFG_HE_SR_RESPONDER);
CASE_RETURN_STRING(WNI_CFG_HE_NDP_FEEDBACK_SUPP);
CASE_RETURN_STRING(WNI_CFG_HE_OPS_SUPP);
CASE_RETURN_STRING(WNI_CFG_HE_DUAL_BAND);
CASE_RETURN_STRING(WNI_CFG_HE_CHAN_WIDTH);
CASE_RETURN_STRING(WNI_CFG_HE_RX_PREAM_PUNC);
CASE_RETURN_STRING(WNI_CFG_HE_CLASS_OF_DEVICE);
CASE_RETURN_STRING(WNI_CFG_HE_LDPC);
CASE_RETURN_STRING(WNI_CFG_HE_LTF_PPDU);
CASE_RETURN_STRING(WNI_CFG_HE_LTF_NDP);
CASE_RETURN_STRING(WNI_CFG_HE_TX_STBC_LT80);
CASE_RETURN_STRING(WNI_CFG_HE_RX_STBC_LT80);
CASE_RETURN_STRING(WNI_CFG_HE_DOPPLER);
CASE_RETURN_STRING(WNI_CFG_HE_UL_MUMIMO);
CASE_RETURN_STRING(WNI_CFG_HE_DCM_TX);
CASE_RETURN_STRING(WNI_CFG_HE_DCM_RX);
CASE_RETURN_STRING(WNI_CFG_HE_MU_PPDU);
CASE_RETURN_STRING(WNI_CFG_HE_SU_BEAMFORMER);
CASE_RETURN_STRING(WNI_CFG_HE_SU_BEAMFORMEE);
CASE_RETURN_STRING(WNI_CFG_HE_MU_BEAMFORMER);
CASE_RETURN_STRING(WNI_CFG_HE_BFEE_STS_LT80);
CASE_RETURN_STRING(WNI_CFG_HE_BFEE_STS_GT80);
CASE_RETURN_STRING(WNI_CFG_HE_NUM_SOUND_LT80);
CASE_RETURN_STRING(WNI_CFG_HE_NUM_SOUND_GT80);
CASE_RETURN_STRING(WNI_CFG_HE_SU_FEED_TONE16);
CASE_RETURN_STRING(WNI_CFG_HE_MU_FEED_TONE16);
CASE_RETURN_STRING(WNI_CFG_HE_CODEBOOK_SU);
CASE_RETURN_STRING(WNI_CFG_HE_CODEBOOK_MU);
CASE_RETURN_STRING(WNI_CFG_HE_BFRM_FEED);
CASE_RETURN_STRING(WNI_CFG_HE_ER_SU_PPDU);
CASE_RETURN_STRING(WNI_CFG_HE_DL_PART_BW);
CASE_RETURN_STRING(WNI_CFG_HE_PPET_PRESENT);
CASE_RETURN_STRING(WNI_CFG_HE_SRP);
CASE_RETURN_STRING(WNI_CFG_HE_POWER_BOOST);
CASE_RETURN_STRING(WNI_CFG_HE_4x_LTF_GI);
CASE_RETURN_STRING(WNI_CFG_HE_MAX_NC);
CASE_RETURN_STRING(WNI_CFG_HE_TX_STBC_GT80);
CASE_RETURN_STRING(WNI_CFG_HE_RX_STBC_GT80);
CASE_RETURN_STRING(WNI_CFG_HE_ER_4x_LTF_GI);
CASE_RETURN_STRING(WNI_CFG_HE_RX_MCS_MAP_LT_80);
CASE_RETURN_STRING(WNI_CFG_HE_TX_MCS_MAP_LT_80);
CASE_RETURN_STRING(WNI_CFG_HE_RX_MCS_MAP_160);
CASE_RETURN_STRING(WNI_CFG_HE_TX_MCS_MAP_160);
CASE_RETURN_STRING(WNI_CFG_HE_RX_MCS_MAP_80_80);
CASE_RETURN_STRING(WNI_CFG_HE_TX_MCS_MAP_80_80);
CASE_RETURN_STRING(WNI_CFG_HE_PPET_2G);
CASE_RETURN_STRING(WNI_CFG_HE_PPET_5G);
CASE_RETURN_STRING(WNI_CFG_HE_OPS_BSS_COLOR);
CASE_RETURN_STRING(WNI_CFG_HE_OPS_DEFAULT_PE);
CASE_RETURN_STRING(WNI_CFG_HE_OPS_TWT_REQUIRED);
CASE_RETURN_STRING(WNI_CFG_HE_OPS_RTS_THRESHOLD);
CASE_RETURN_STRING(WNI_CFG_HE_OPS_PARTIAL_BSS_COL);
CASE_RETURN_STRING(WNI_CFG_HE_OPS_VHT_OPER_PRESENT);
CASE_RETURN_STRING(WNI_CFG_HE_OPS_MBSSID_AP);
CASE_RETURN_STRING(WNI_CFG_HE_OPS_TX_BSSID_IND);
CASE_RETURN_STRING(WNI_CFG_HE_OPS_BSS_COL_DISABLED);
CASE_RETURN_STRING(WNI_CFG_HE_OPS_BASIC_MCS_NSS);
CASE_RETURN_STRING(WNI_CFG_PS_WOW_DATA_INACTIVITY_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_HE_STA_OBSSPD);
CASE_RETURN_STRING(WNI_CFG_SAP_MAX_MCS_DATA);
CASE_RETURN_STRING(WNI_CFG_RATE_FOR_TX_MGMT_2G);
CASE_RETURN_STRING(WNI_CFG_RATE_FOR_TX_MGMT_5G);
CASE_RETURN_STRING(WNI_CFG_EDCA_ETSI_ACBK_LOCAL);
CASE_RETURN_STRING(WNI_CFG_EDCA_ETSI_ACBE_LOCAL);
CASE_RETURN_STRING(WNI_CFG_EDCA_ETSI_ACVI_LOCAL);
CASE_RETURN_STRING(WNI_CFG_EDCA_ETSI_ACVO_LOCAL);
CASE_RETURN_STRING(WNI_CFG_EDCA_ETSI_ACBK);
CASE_RETURN_STRING(WNI_CFG_EDCA_ETSI_ACBE);
CASE_RETURN_STRING(WNI_CFG_EDCA_ETSI_ACVI);
CASE_RETURN_STRING(WNI_CFG_EDCA_ETSI_ACVO);
CASE_RETURN_STRING(WNI_CFG_OBSS_DETECTION_OFFLOAD);
CASE_RETURN_STRING(WNI_CFG_OBSS_COLOR_COLLISION_OFFLOAD);
CASE_RETURN_STRING(WNI_CFG_TWT_REQUESTOR);
CASE_RETURN_STRING(WNI_CFG_TWT_RESPONDER);
CASE_RETURN_STRING(WNI_CFG_BCAST_TWT);
}
return "invalid";
}
| 46.02994 | 72 | 0.882854 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.