hexsha
stringlengths 40
40
| size
int64 5
1.05M
| ext
stringclasses 98
values | lang
stringclasses 21
values | max_stars_repo_path
stringlengths 3
945
| max_stars_repo_name
stringlengths 4
118
| max_stars_repo_head_hexsha
stringlengths 40
78
| max_stars_repo_licenses
listlengths 1
10
| max_stars_count
int64 1
368k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 3
945
| max_issues_repo_name
stringlengths 4
118
| max_issues_repo_head_hexsha
stringlengths 40
78
| max_issues_repo_licenses
listlengths 1
10
| max_issues_count
int64 1
134k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 3
945
| max_forks_repo_name
stringlengths 4
135
| max_forks_repo_head_hexsha
stringlengths 40
78
| max_forks_repo_licenses
listlengths 1
10
| max_forks_count
int64 1
105k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 5
1.05M
| avg_line_length
float64 1
1.03M
| max_line_length
int64 2
1.03M
| alphanum_fraction
float64 0
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a7ce08c69dda6524fd182901b8ff3f4da18f9741
| 36 |
sql
|
SQL
|
src/test/feature/Ranger/sql/admin/29.sql
|
YangHao666666/hawq
|
10cff8350f1ba806c6fec64eb67e0e6f6f24786c
|
[
"Artistic-1.0-Perl",
"ISC",
"bzip2-1.0.5",
"TCL",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"PostgreSQL",
"BSD-3-Clause"
] | 450 |
2015-09-05T09:12:51.000Z
|
2018-08-30T01:45:36.000Z
|
src/test/feature/Ranger/sql/admin/29.sql
|
YangHao666666/hawq
|
10cff8350f1ba806c6fec64eb67e0e6f6f24786c
|
[
"Artistic-1.0-Perl",
"ISC",
"bzip2-1.0.5",
"TCL",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"PostgreSQL",
"BSD-3-Clause"
] | 1,274 |
2015-09-22T20:06:16.000Z
|
2018-08-31T22:14:00.000Z
|
src/test/feature/Ranger/sql/admin/29.sql
|
YangHao666666/hawq
|
10cff8350f1ba806c6fec64eb67e0e6f6f24786c
|
[
"Artistic-1.0-Perl",
"ISC",
"bzip2-1.0.5",
"TCL",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"PostgreSQL",
"BSD-3-Clause"
] | 278 |
2015-09-21T19:15:06.000Z
|
2018-08-31T00:36:51.000Z
|
insert into ext_t2(i) values(234);
| 12 | 34 | 0.722222 |
905ba268c297bf6901acb0c9efc030e3f20bc1f0
| 111 |
sql
|
SQL
|
keycloak/exploring-data/00-get-all-tables.sql
|
robk-dev/gardenio-demo
|
ff5ceb96d97472c7ed188aa1e374a27ce689a4b1
|
[
"MIT"
] | null | null | null |
keycloak/exploring-data/00-get-all-tables.sql
|
robk-dev/gardenio-demo
|
ff5ceb96d97472c7ed188aa1e374a27ce689a4b1
|
[
"MIT"
] | null | null | null |
keycloak/exploring-data/00-get-all-tables.sql
|
robk-dev/gardenio-demo
|
ff5ceb96d97472c7ed188aa1e374a27ce689a4b1
|
[
"MIT"
] | null | null | null |
SELECT table_name
FROM information_schema.tables
WHERE table_schema='public'
AND table_type='BASE TABLE';
| 27.75 | 32 | 0.801802 |
de34f77bce6576a74a0fd3808708aafd5a515776
| 1,420 |
swift
|
Swift
|
SwiftUI-WebViewScreenshotOnBackground/tmp/WebView.swift
|
luannguyen252/my-swift-journey
|
788d66f256358dc5aefa2f3093ef74fd572e83b3
|
[
"MIT"
] | 14 |
2020-12-09T08:53:39.000Z
|
2021-12-07T09:15:44.000Z
|
SwiftUI-WebViewScreenshotOnBackground/tmp/WebView.swift
|
luannguyen252/my-swift-journey
|
788d66f256358dc5aefa2f3093ef74fd572e83b3
|
[
"MIT"
] | null | null | null |
SwiftUI-WebViewScreenshotOnBackground/tmp/WebView.swift
|
luannguyen252/my-swift-journey
|
788d66f256358dc5aefa2f3093ef74fd572e83b3
|
[
"MIT"
] | 8 |
2020-12-10T05:59:26.000Z
|
2022-01-03T07:49:21.000Z
|
//
// WebView.swift
// tmp
//
// Created by Elias Lankinen on 10/5/20.
//
import Foundation
import SwiftUI
import WebKit
struct WebView: UIViewRepresentable {
var url: String
@Binding var uiimage: UIImage?
@Binding var snap: Bool
func makeUIView(context: Context) -> WKWebView {
guard let url = URL(string: self.url) else {
return WKWebView()
}
let request = URLRequest(url: url)
let wkWebView = WKWebView()
wkWebView.load(request)
return wkWebView
}
func updateUIView(_ uiView: UIViewType, context: Context) {
if snap {
print("snap")
let config = WKSnapshotConfiguration()
config.afterScreenUpdates = false
if let a = uiView as? WKWebView {
a.takeSnapshot(with: config, completionHandler: {image, error in
DispatchQueue.main.async {
print("image: \(image)")
print("error: \(error)")
uiimage = image
snap = false
}
})
}
}
}
}
extension UIView {
func setImage(rect: CGRect) -> UIImage {
let renderer = UIGraphicsImageRenderer(bounds: rect)
return renderer.image { rendererContext in
layer.render(in: rendererContext.cgContext)
}
}
}
| 26.296296 | 80 | 0.540845 |
4a5a1b9afc694c2975706427e1818958e383d712
| 1,346 |
js
|
JavaScript
|
bin/constants.js
|
hokugawa/griffon-plugin-tools
|
2dffb27c42e7196b4d73fbca8f7e6e285ad043d7
|
[
"Apache-2.0"
] | 1 |
2020-08-29T14:11:44.000Z
|
2020-08-29T14:11:44.000Z
|
bin/constants.js
|
hokugawa/griffon-plugin-tools
|
2dffb27c42e7196b4d73fbca8f7e6e285ad043d7
|
[
"Apache-2.0"
] | 1 |
2020-12-10T21:52:46.000Z
|
2020-12-10T21:52:46.000Z
|
bin/constants.js
|
hokugawa/griffon-plugin-tools
|
2dffb27c42e7196b4d73fbca8f7e6e285ad043d7
|
[
"Apache-2.0"
] | 2 |
2020-09-27T10:40:21.000Z
|
2021-04-14T20:05:43.000Z
|
/*
Copyright 2020 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/
module.exports = {
DESCRIPTOR_NAME: 'plugin.json',
ENVIRONMENTS: {
// for Adobe internal use only
dev: {
GRAFFIAS_SERVER: 'https://graffias-dev.adobe.io/graffias/graphql',
IMS_HOST: 'https://ims-na1-stg1.adobelogin.com'
},
// for Adobe internal use only
qa: {
GRAFFIAS_SERVER: 'https://graffias-qa.adobe.io/graffias/graphql',
IMS_HOST: 'https://ims-na1-stg1.adobelogin.com'
},
// for Adobe internal use only
stage: {
GRAFFIAS_SERVER: 'https://graffias-preprod.adobe.io/graffias/graphql',
IMS_HOST: 'https://ims-na1.adobelogin.com'
},
prod: {
GRAFFIAS_SERVER: 'https://graffias.adobe.io/graffias/graphql',
IMS_HOST: 'https://ims-na1.adobelogin.com'
}
}
};
| 37.388889 | 86 | 0.707281 |
722497870937183f78eece296d80fed8906f3542
| 279 |
rs
|
Rust
|
src/test/ui/threads-sendsync/task-comm-17.rs
|
Eric-Arellano/rust
|
0f6f2d681b39c5f95459cd09cb936b6ceb27cd82
|
[
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 66,762 |
2015-01-01T08:32:03.000Z
|
2022-03-31T23:26:40.000Z
|
src/test/ui/threads-sendsync/task-comm-17.rs
|
Eric-Arellano/rust
|
0f6f2d681b39c5f95459cd09cb936b6ceb27cd82
|
[
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 76,993 |
2015-01-01T00:06:33.000Z
|
2022-03-31T23:59:15.000Z
|
src/test/ui/threads-sendsync/task-comm-17.rs
|
Eric-Arellano/rust
|
0f6f2d681b39c5f95459cd09cb936b6ceb27cd82
|
[
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11,787 |
2015-01-01T00:01:19.000Z
|
2022-03-31T19:03:42.000Z
|
// run-pass
#![allow(unused_must_use)]
// ignore-emscripten no threads support
// pretty-expanded FIXME #23616
// Issue #922
// This test is specifically about spawning temporary closures.
use std::thread;
fn f() {
}
pub fn main() {
thread::spawn(move|| f() ).join();
}
| 15.5 | 63 | 0.670251 |
b4c3a321f49e7afb14d0ecc5403663ba7e200385
| 719 |
swift
|
Swift
|
CorePersistence/Classes/Comparison/ComparisonClause.swift
|
SynchronicSolutions/CorePersistence
|
fefd4e7b2a8951636b2c78773c24d4aaf77a70f1
|
[
"MIT"
] | 3 |
2019-06-19T14:29:53.000Z
|
2020-04-01T13:47:55.000Z
|
CorePersistence/Classes/Comparison/ComparisonClause.swift
|
SynchronicSolutions/CorePersistence
|
fefd4e7b2a8951636b2c78773c24d4aaf77a70f1
|
[
"MIT"
] | null | null | null |
CorePersistence/Classes/Comparison/ComparisonClause.swift
|
SynchronicSolutions/CorePersistence
|
fefd4e7b2a8951636b2c78773c24d4aaf77a70f1
|
[
"MIT"
] | null | null | null |
//
// ComparisonClause.swift
// CorePersistence
//
// Created by Milos Babic on 12/18/19.
//
import Foundation
public struct ComparisonClause {
let sortDescriptor: NSSortDescriptor
public static func ascending<EntityType: PersistableManagedObject, PropertyType>(_ keyPath: KeyPath<EntityType, PropertyType>) -> ComparisonClause {
return ComparisonClause(sortDescriptor: NSSortDescriptor(keyPath: keyPath, ascending: true))
}
public static func descending<EntityType: PersistableManagedObject, PropertyType>(_ keyPath: KeyPath<EntityType, PropertyType>) -> ComparisonClause {
return ComparisonClause(sortDescriptor: NSSortDescriptor(keyPath: keyPath, ascending: false))
}
}
| 35.95 | 153 | 0.76217 |
9aa89fbec497403cc07fac38bc22ccf6d1a1576c
| 200 |
css
|
CSS
|
haburi/src/component/LoginPage/index.css
|
gitdog01/relay_09
|
7d1798da85c7a5f89334d3e3896338e340e76644
|
[
"MIT"
] | null | null | null |
haburi/src/component/LoginPage/index.css
|
gitdog01/relay_09
|
7d1798da85c7a5f89334d3e3896338e340e76644
|
[
"MIT"
] | 2 |
2020-08-07T08:29:03.000Z
|
2020-08-07T14:45:41.000Z
|
haburi/src/component/LoginPage/index.css
|
gitdog01/relay_09
|
7d1798da85c7a5f89334d3e3896338e340e76644
|
[
"MIT"
] | 14 |
2020-07-31T04:06:59.000Z
|
2020-11-20T08:54:16.000Z
|
.App {
height: 100vh;
}
.myForm {
max-width: 300px;
margin: 50px auto 0;
padding: 20px;
}
#formContent {
margin-left: 20px;
margin-right: 20px;
float: left;
}
| 13.333333 | 24 | 0.54 |
ff920c2078f8e1a704dfc2c6459a3aec2f9b5092
| 1,394 |
swift
|
Swift
|
TextDemo/TextDemo/Classes/Mine/HomeLive/MineView.swift
|
codeAndylau/App_Demo
|
82208da73bd7b98c89bb77011057f36698ff366c
|
[
"MIT"
] | null | null | null |
TextDemo/TextDemo/Classes/Mine/HomeLive/MineView.swift
|
codeAndylau/App_Demo
|
82208da73bd7b98c89bb77011057f36698ff366c
|
[
"MIT"
] | null | null | null |
TextDemo/TextDemo/Classes/Mine/HomeLive/MineView.swift
|
codeAndylau/App_Demo
|
82208da73bd7b98c89bb77011057f36698ff366c
|
[
"MIT"
] | null | null | null |
//
// MineView.swift
// TextDemo
//
// Created by lau Andy on 2018/10/6.
// Copyright © 2018年 Andylau. All rights reserved.
//
import UIKit
class MineView: UIView, LCLoadXib {
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
lazy var topView: UIView = {
let v = UIView()
return v
}()
}
extension MineView {
func setupUI() {
addSubview(topView)
topView.backgroundColor = UIColor.white
topView.snp.makeConstraints { (make) in
make.top.left.right.equalTo(self)
if IS_IPhone_X {
make.height.equalTo(300)
}else {
make.height.equalTo(200)
}
}
}
override func layoutSubviews() {
super.layoutSubviews()
printLog("fff---\(topView.frame)")
// 添加渐变色
let gl = CAGradientLayer.init()
gl.frame = topView.frame
gl.startPoint = CGPoint(x: 0, y: 0.5)
gl.endPoint = CGPoint(x: 1, y: 0.5)
gl.colors = [UIColor(r: 11, g: 195, b: 179, alpha: 1).cgColor,
UIColor(r: 40, g: 214, b: 142, alpha: 1).cgColor]
gl.locations = [0,1]
topView.layer.insertSublayer(gl, at: 0)
}
}
| 22.483871 | 70 | 0.525825 |
d97e6eca2965ca1436d1da0203620d376311f9f8
| 369 |
kt
|
Kotlin
|
common/data/models/src/commonMain/kotlin/com/gmvalentino/models/TodoModel.kt
|
gmvalentino8/mvi-multiplatform
|
088077dc5db7245e1e116e32b8c65b74c510326f
|
[
"Apache-2.0"
] | 1 |
2021-07-09T04:48:56.000Z
|
2021-07-09T04:48:56.000Z
|
common/data/models/src/commonMain/kotlin/com/gmvalentino/models/TodoModel.kt
|
gmvalentino8/mvi-multiplatform
|
088077dc5db7245e1e116e32b8c65b74c510326f
|
[
"Apache-2.0"
] | null | null | null |
common/data/models/src/commonMain/kotlin/com/gmvalentino/models/TodoModel.kt
|
gmvalentino8/mvi-multiplatform
|
088077dc5db7245e1e116e32b8c65b74c510326f
|
[
"Apache-2.0"
] | null | null | null |
package com.gmvalentino.models
import kotlinx.datetime.LocalDateTime
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class TodoModel(
val id: String,
val title: String,
@SerialName("description") val details: String,
val date: LocalDateTime,
@SerialName("is_complete") val isComplete: Boolean
)
| 26.357143 | 54 | 0.780488 |
a759ac011697c8188d3fb724cea3a921dd84e0f4
| 254 |
sql
|
SQL
|
sql/updates/0.8/4496_spell_script_target.sql
|
Ambal/mangos
|
9833ce4e393ca36668751dbcc9dfcf7cae8ff4ff
|
[
"OpenSSL"
] | 1 |
2019-01-19T06:35:40.000Z
|
2019-01-19T06:35:40.000Z
|
sql/updates/0.8/4496_spell_script_target.sql
|
mfooo/wow
|
3e5fad4cfdf0fd1c0a2fd7c9844e6f140a1bb32d
|
[
"OpenSSL"
] | null | null | null |
sql/updates/0.8/4496_spell_script_target.sql
|
mfooo/wow
|
3e5fad4cfdf0fd1c0a2fd7c9844e6f140a1bb32d
|
[
"OpenSSL"
] | null | null | null |
DROP TABLE IF EXISTS `spell_script_target`;
CREATE TABLE `spell_script_target` (
`entry` int(6) unsigned NOT NULL,
`type` int(8) unsigned default '0',
`targetEntry` int(11) default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Spell System';
| 36.285714 | 62 | 0.740157 |
48dbb1746daec6f047a0fa6c51f4ece151e3bf81
| 163 |
h
|
C
|
components/uart0/include/Utf8ToGbk.h
|
hello-qiuhe/lv_port_esp32
|
e0a7e1e70fba3d3fe1d76e3a75869e0748ec28d8
|
[
"MIT"
] | null | null | null |
components/uart0/include/Utf8ToGbk.h
|
hello-qiuhe/lv_port_esp32
|
e0a7e1e70fba3d3fe1d76e3a75869e0748ec28d8
|
[
"MIT"
] | null | null | null |
components/uart0/include/Utf8ToGbk.h
|
hello-qiuhe/lv_port_esp32
|
e0a7e1e70fba3d3fe1d76e3a75869e0748ec28d8
|
[
"MIT"
] | null | null | null |
#ifndef _UTF8TOGBK_H_
#define _UTF8TOGBK_H_
int SwitchToGbk(const unsigned char* pszBufIn, int nBufInLen, unsigned char* pszBufOut, int* pnBufOutLen);
#endif
| 18.111111 | 107 | 0.791411 |
1fc3579a4b194a2ff74d9f303158dbc52fb26f5a
| 3,291 |
html
|
HTML
|
_posts/2014-07-15-mozmit-makes-its-debut.html
|
Algogator/Algogator.github.io
|
fe202777c73689d6d2df7b281f1a4c4ef8746015
|
[
"MIT"
] | 1 |
2020-07-31T15:29:46.000Z
|
2020-07-31T15:29:46.000Z
|
_posts/2014-07-15-mozmit-makes-its-debut.html
|
Algogator/Algogator.github.io
|
fe202777c73689d6d2df7b281f1a4c4ef8746015
|
[
"MIT"
] | null | null | null |
_posts/2014-07-15-mozmit-makes-its-debut.html
|
Algogator/Algogator.github.io
|
fe202777c73689d6d2df7b281f1a4c4ef8746015
|
[
"MIT"
] | null | null | null |
---
layout: post
title: MozMIT makes its debut!
date: 2014-07-15 07:15:12.000000000 -05:00
type: post
parent_id: '0'
published: true
password: ''
status: publish
categories:
- FIrefox
tags:
- firefox
- mozmit
- student ambassador
meta:
_edit_last: '1'
_aioseop_opengraph_settings: a:8:{s:32:"aioseop_opengraph_settings_title";s:0:"";s:31:"aioseop_opengraph_settings_desc";s:0:"";s:36:"aioseop_opengraph_settings_customimg";s:0:"";s:37:"aioseop_opengraph_settings_imagewidth";s:0:"";s:38:"aioseop_opengraph_settings_imageheight";s:0:"";s:35:"aioseop_opengraph_settings_category";s:0:"";s:30:"aioseop_opengraph_settings_tag";s:0:"";s:34:"aioseop_opengraph_settings_setcard";s:7:"summary";}
_aioseop_keywords: mozmit, firefox, student ambassador
author:
login: admin
email: admin@annaphilips.com
display_name: Anna
first_name: ''
last_name: ''
permalink: "/mozmit-makes-its-debut/"
---
<p><a href="http://jodanna.org/blog/wp-content/uploads/2014/07/14644249342_7402f82569_o.jpg"><img src="{{ site.baseurl }}/assets/14644249342_7402f82569_o.jpg" alt="14644249342_7402f82569_o" /></a></p>
<p>The newest addition to the CSMIT family is the Mozilla team - “MozMIT” a spinoff of the Firefox student ambassador program, was started the semester before. Its primary objective is to prep students so that they can actively contribute to the open source community(Mozilla in particular) as opposed to being mere users.</p>
<p>Mozilla has a number of projects under its umbrella so contributions do not necessarily have to take the form of code. A writer? There are a lot of new features that require documentation. If you are bilingual, consider translating articles, guides, tutorials etc.(L10N). If graphic design is your forte we have a place for you as well.</p>
<p><img src="{{ site.baseurl }}/assets/14458074679_92b8c85765_o-1024x650.jpg" alt="OLYMPUS DIGITAL CAMERA" /></p>
<p>An “introductory” session was held last saturday at the computer centre in MIT mostly for the benefit of the new team members(so they know what they’re getting into). The speakers were Mozillians who actively contributed to various projects in Mozilla, technical and nontechnical - Shashank Gaikaiwari (Localization), Nikhil Patel and Achyuth KP(Appmaker, Thimble and Popcorn) and Vikneshwar (Coding). Plus the mozilla rep/evangelist Shreyas Narayanan Kutty.</p>
<p><img src="{{ site.baseurl }}/assets/14458267977_324f092ac4_o-1024x566.jpg" alt="OLYMPUS DIGITAL CAMERA" /></p>
<p>The session got off to a good start after the ice breaker. And we managed to cover up everything in the agenda minus WoMoz, (support program for Women in Mozilla) ironically more girls had showed up that day. The Mozilla rep brought along his shiny new tab (Firefox OS) courtesy Mozilla (one of the few perks of being a mozillain) and we had a thorough demo on how to contribute to Mozillas codebase by Vikneshwar. The allotted 2 hours was a bit of a squeeze and before we knew it, it was time for lunch. We split up after the rep gave all the new members cute mozilla badges. So in short, it was a fun and productive session.</p>
<p><img src="{{ site.baseurl }}/assets/14458270157_0856c2d70e_o.jpg" alt="OLYMPUS DIGITAL CAMERA" /></p>
<p>MozMIT is still recruiting. Drop by for one of our sessions to get initiated :)</p>
| 88.945946 | 633 | 0.773017 |
ef322696656d019ac08bb2031221a827b7ec34f3
| 1,108 |
kt
|
Kotlin
|
app/src/main/java/com/vs/takenotes/room/AppDatabase.kt
|
vineelsai26/Take-Notes
|
d00139ea1331ebe2c3f58153758187da60ecc3fc
|
[
"MIT"
] | null | null | null |
app/src/main/java/com/vs/takenotes/room/AppDatabase.kt
|
vineelsai26/Take-Notes
|
d00139ea1331ebe2c3f58153758187da60ecc3fc
|
[
"MIT"
] | null | null | null |
app/src/main/java/com/vs/takenotes/room/AppDatabase.kt
|
vineelsai26/Take-Notes
|
d00139ea1331ebe2c3f58153758187da60ecc3fc
|
[
"MIT"
] | null | null | null |
package com.vs.takenotes.room
import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.sqlite.db.SupportSQLiteDatabase
import com.vs.takenotes.dependencies.ApplicationScope
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
import javax.inject.Inject
import javax.inject.Provider
@Database(entities = [Task::class, Note::class], version = 1)
abstract class AppDatabase : RoomDatabase() {
abstract fun taskDao(): TaskDao
abstract fun noteDao(): NoteDao
class Callback @Inject constructor(
private val database: Provider<AppDatabase>,
@ApplicationScope private val applicationScope: CoroutineScope
) : RoomDatabase.Callback() {
override fun onCreate(db: SupportSQLiteDatabase) {
super.onCreate(db)
// To add custom notes or tasks at launch
// val taskDao = database.get().taskDao()
// val noteDao = database.get().noteDao()
applicationScope.launch {
// noteDao.insert(Note("Get Started", "Getting Started Guide"))
}
}
}
}
| 31.657143 | 78 | 0.694043 |
3d8fb6eb27c56ffa0c44636431bd0c6d0063943b
| 3,162 |
rs
|
Rust
|
rust/sdk/src/contract/builder.rs
|
m10io/sdk
|
62f773304da0567986d5fc33c282649238c9f5c2
|
[
"MIT"
] | 1 |
2022-01-13T17:55:08.000Z
|
2022-01-13T17:55:08.000Z
|
rust/sdk/src/contract/builder.rs
|
m10io/sdk
|
62f773304da0567986d5fc33c282649238c9f5c2
|
[
"MIT"
] | null | null | null |
rust/sdk/src/contract/builder.rs
|
m10io/sdk
|
62f773304da0567986d5fc33c282649238c9f5c2
|
[
"MIT"
] | null | null | null |
use m10_protos::prost::Message;
use m10_protos::sdk::{
Contract, CreateLedgerTransfer, CreateLedgerTransfers, CreateTransfer, TransferStep,
};
use std::time::{Duration, SystemTime};
pub const DEFAULT_CONTRACT_DURATION: Duration = Duration::from_secs(300);
/// A builder for [`Contract`]
///
/// A [`Contract`] in M10's system is an agreement amoung multiple parties to complete a series of transactions.
/// Each contract contains series of endorsements from each of the parties. Contracts are designed
/// to be executed across ledgers, for scenarios like FX swaps or other multi-currency transactions.
#[derive(Clone, Debug, Default)]
pub struct ContractBuilder {
transfers: Vec<CreateLedgerTransfer>,
valid_for: Duration,
}
impl From<CreateLedgerTransfers> for ContractBuilder {
fn from(transfer_request: CreateLedgerTransfers) -> Self {
let valid_for = if transfer_request.valid_until == 0 {
DEFAULT_CONTRACT_DURATION
} else {
let valid_until = SystemTime::UNIX_EPOCH
+ std::time::Duration::from_micros(transfer_request.valid_until);
valid_until
.duration_since(SystemTime::now())
.unwrap_or_else(|_| Duration::new(0, 0))
};
Self {
transfers: transfer_request.transfers,
valid_for,
}
}
}
impl From<Vec<CreateLedgerTransfer>> for ContractBuilder {
fn from(transfers: Vec<CreateLedgerTransfer>) -> Self {
Self {
transfers,
valid_for: DEFAULT_CONTRACT_DURATION,
}
}
}
impl ContractBuilder {
/// Adds a transfer to the contract between two accounts on a particular ledger.
pub fn transfer(
mut self,
ledger_id: &str,
from_account_id: Vec<u8>,
to_account_id: Vec<u8>,
amount: u64,
memo: Option<&str>,
) -> Self {
let memo = memo.map(m10_protos::metadata::memo);
self.transfers.push(CreateLedgerTransfer {
ledger_id: ledger_id.to_string(),
nonce: fastrand::u64(..),
transfer: Some(CreateTransfer {
transfer_steps: vec![TransferStep {
from_account_id,
to_account_id,
amount,
metadata: memo.into_iter().collect(),
}],
}),
});
self
}
/// Adds a timeout to the contract
pub fn valid_for(mut self, duration: Duration) -> Self {
self.valid_for = duration;
self
}
/// Builds the [`Contract`]
pub fn build(self) -> Result<Contract, m10_protos::prost::EncodeError> {
let valid_until = (SystemTime::now() + self.valid_for)
.duration_since(SystemTime::UNIX_EPOCH)
.unwrap()
.as_micros() as u64;
let transfer_reqs = CreateLedgerTransfers {
transfers: self.transfers,
valid_until,
};
let mut transactions = vec![];
transfer_reqs.encode(&mut transactions)?;
Ok(Contract {
transactions,
endorsements: Vec::new(),
})
}
}
| 32.597938 | 112 | 0.602467 |
553bba2aab2ec051c477e9ea478141b716cfb797
| 3,404 |
kt
|
Kotlin
|
common/src/test/kotlin/com/scurab/kuproxy/matcher/DefaultRequestMatcherTest.kt
|
jbruchanov/kuproxy
|
2e10d85e7e318850679be3a21fe4406645f88811
|
[
"Apache-2.0"
] | 3 |
2021-11-29T11:44:32.000Z
|
2022-01-25T11:36:16.000Z
|
common/src/test/kotlin/com/scurab/kuproxy/matcher/DefaultRequestMatcherTest.kt
|
jbruchanov/kuproxy
|
2e10d85e7e318850679be3a21fe4406645f88811
|
[
"Apache-2.0"
] | null | null | null |
common/src/test/kotlin/com/scurab/kuproxy/matcher/DefaultRequestMatcherTest.kt
|
jbruchanov/kuproxy
|
2e10d85e7e318850679be3a21fe4406645f88811
|
[
"Apache-2.0"
] | null | null | null |
package com.scurab.kuproxy.matcher
import com.scurab.kuproxy.comm.IRequest
import com.scurab.kuproxy.comm.Url
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.extension.ExtensionContext
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.ArgumentsProvider
import org.junit.jupiter.params.provider.ArgumentsSource
import test.request
internal class DefaultRequestMatcherTest {
private val matcher = DefaultRequestMatcher()
@ParameterizedTest(name = "{0}")
@ArgumentsSource(Args::class)
fun match(@Suppress("UNUSED_PARAMETER") name: String, equals: Boolean, real: IRequest, stored: IRequest) {
Assertions.assertEquals(equals, matcher.isMatching(real, stored))
}
class Args : ArgumentsProvider {
override fun provideArguments(context: ExtensionContext) = listOf(
Arguments.of(
"Same request is matching", true,
request {
url = Url("http://www.test.com/test?a=b&b=c")
method = GET
},
request {
url = Url("http://www.test.com/test?b=c&a=b&")
method = GET
}
),
Arguments.of(
"Different methods is NOT matching", false,
request {
url = Url("http://www.test.com")
method = POST
},
request {
url = Url("http://www.test.com")
method = GET
}
),
Arguments.of(
"Matching headers, more values in real request is fine", true,
request {
url = Url("http://www.test.com")
method = GET
headers = mapOf(ContentType to "a; b", AcceptEncoding to "c")
},
request {
url = Url("http://www.test.com")
method = GET
headers = mapOf(ContentType to "a; b")
}
),
Arguments.of(
"Matching headers, no stored headers, matches anything", true,
request {
url = Url("http://www.test.com")
method = GET
headers = mapOf(ContentType to "a; b", AcceptEncoding to "c")
},
request {
url = Url("http://www.test.com")
method = GET
}
),
Arguments.of(
"Matching headers, different values are NOT matching", false,
request {
url = Url("http://www.test.com")
method = GET
headers = mapOf(ContentType to "a; b", AcceptEncoding to "c")
},
request {
url = Url("http://www.test.com")
method = GET
headers = mapOf(ContentType to "a; c", AcceptEncoding to "b")
}
)
).stream()
}
companion object {
const val GET = "GET"
const val POST = "POST"
const val ContentType = "Content-Type"
const val AcceptEncoding = "Accept-Encoding"
}
}
| 35.831579 | 110 | 0.493537 |
2110de19357b690d6c160820fce6c4f9ff5eefc3
| 193,586 |
sql
|
SQL
|
nwu_laravel.sql
|
bdcms/academic
|
9bba734f422bb050203b62760683bd6d57b64293
|
[
"MIT"
] | null | null | null |
nwu_laravel.sql
|
bdcms/academic
|
9bba734f422bb050203b62760683bd6d57b64293
|
[
"MIT"
] | null | null | null |
nwu_laravel.sql
|
bdcms/academic
|
9bba734f422bb050203b62760683bd6d57b64293
|
[
"MIT"
] | null | null | null |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 24, 2018 at 08:00 PM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `nwu_laravel`
--
-- --------------------------------------------------------
--
-- Table structure for table `cms_apicustom`
--
CREATE TABLE `cms_apicustom` (
`id` int(10) UNSIGNED NOT NULL,
`permalink` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`tabel` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`aksi` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`kolom` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`orderby` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`sub_query_1` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`sql_where` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`nama` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`keterangan` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`parameter` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`method_type` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`parameters` longtext COLLATE utf8mb4_unicode_ci,
`responses` longtext COLLATE utf8mb4_unicode_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `cms_apikey`
--
CREATE TABLE `cms_apikey` (
`id` int(10) UNSIGNED NOT NULL,
`screetkey` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`hit` int(11) DEFAULT NULL,
`status` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `cms_dashboard`
--
CREATE TABLE `cms_dashboard` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`id_cms_privileges` int(11) DEFAULT NULL,
`content` longtext COLLATE utf8mb4_unicode_ci,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `cms_email_queues`
--
CREATE TABLE `cms_email_queues` (
`id` int(10) UNSIGNED NOT NULL,
`send_at` datetime DEFAULT NULL,
`email_recipient` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email_from_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email_from_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email_cc_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email_subject` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email_content` text COLLATE utf8mb4_unicode_ci,
`email_attachments` text COLLATE utf8mb4_unicode_ci,
`is_sent` tinyint(1) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `cms_email_templates`
--
CREATE TABLE `cms_email_templates` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`slug` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`subject` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`content` longtext COLLATE utf8mb4_unicode_ci,
`description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`from_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`from_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`cc_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `cms_email_templates`
--
INSERT INTO `cms_email_templates` (`id`, `name`, `slug`, `subject`, `content`, `description`, `from_name`, `from_email`, `cc_email`, `created_at`, `updated_at`) VALUES
(1, 'Email Template Forgot Password Backend', 'forgot_password_backend', NULL, '<p>Hi,</p><p>Someone requested forgot password, here is your new password : </p><p>[password]</p><p><br></p><p>--</p><p>Regards,</p><p>Admin</p>', '[password]', 'System', 'system@crudbooster.com', NULL, '2018-07-17 14:21:19', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `cms_logs`
--
CREATE TABLE `cms_logs` (
`id` int(10) UNSIGNED NOT NULL,
`ipaddress` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`useragent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`details` text COLLATE utf8mb4_unicode_ci,
`id_cms_users` int(11) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `cms_logs`
--
INSERT INTO `cms_logs` (`id`, `ipaddress`, `useragent`, `url`, `description`, `details`, `id_cms_users`, `created_at`, `updated_at`) VALUES
(1, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-17 14:22:14', NULL),
(2, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/users/edit-save/1', 'Update data Super Admin at Users Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>photo</td><td></td><td>uploads/1/2018-07/my.jpg</td></tr><tr><td>contact</td><td>01969516500</td><td>01969516501</td></tr><tr><td>password</td><td>$2y$10$pKkWq5dKjg0z/jfxu8YWU.fl.SBnKMAxxTHnBrGxbPQtWSZF5dO.G</td><td></td></tr><tr><td>id_cms_privileges</td><td>1</td><td></td></tr><tr><td>status</td><td>Active</td><td></td></tr></tbody></table>', 1, '2018-07-17 14:40:54', NULL),
(3, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'admin@crudbooster.com logout', '', 1, '2018-07-17 15:05:36', NULL),
(4, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-17 15:05:50', NULL),
(5, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'admin@crudbooster.com logout', '', 1, '2018-07-17 15:18:06', NULL),
(6, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-17 21:29:58', NULL),
(7, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/users/add-save', 'Add New Data Editor at Users Management', '', 1, '2018-07-17 21:31:34', NULL),
(8, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'editor@gmail.com login with IP Address ::1', '', 2, '2018-07-17 21:33:18', NULL),
(9, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/add-save', 'Add New Data User at Menu Management', '', 1, '2018-07-17 21:34:32', NULL),
(10, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/1', 'Update data User at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>sorting</td><td></td><td></td></tr></tbody></table>', 1, '2018-07-17 21:35:03', NULL),
(11, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/users/add-save', 'Add New Data Kamal at Users Management', '', 2, '2018-07-17 21:36:43', NULL),
(12, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'editor@gmail.com logout', '', 2, '2018-07-17 21:42:52', NULL),
(13, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'editor@gmail.com login with IP Address ::1', '', 2, '2018-07-17 21:43:25', NULL),
(14, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-17 22:48:30', NULL),
(15, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'editor@gmail.com logout', '', 2, '2018-07-17 23:02:08', NULL),
(16, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'editor@gmail.com login with IP Address ::1', '', 2, '2018-07-17 23:02:12', NULL),
(17, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/users', 'Try view the data :name at Users Management', '', 2, '2018-07-17 23:02:15', NULL),
(18, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'editor@gmail.com logout', '', 2, '2018-07-17 23:03:00', NULL),
(19, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'editor@gmail.com login with IP Address ::1', '', 2, '2018-07-17 23:03:02', NULL),
(20, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/users/edit-save/2', 'Update data Editor at Users Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>password</td><td>$2y$10$GEmkE8m9fEImGV2ye7efQe49lcdMc95n40AT4TUbaW3yEDIaSarEC</td><td></td></tr><tr><td>contact</td><td>01969516500</td><td>01969516502</td></tr><tr><td>birth_date</td><td></td><td></td></tr><tr><td>address</td><td></td><td></td></tr><tr><td>dept_name</td><td></td><td></td></tr><tr><td>position</td><td></td><td></td></tr><tr><td>last_institute</td><td></td><td></td></tr><tr><td>note</td><td></td><td></td></tr><tr><td>id_cms_privileges</td><td>2</td><td></td></tr><tr><td>status</td><td>Active</td><td></td></tr><tr><td>verify_token</td><td></td><td></td></tr></tbody></table>', 2, '2018-07-17 23:03:14', NULL),
(21, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/users', 'Try view the data :name at Users Management', '', 2, '2018-07-17 23:03:25', NULL),
(22, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-18 01:45:29', NULL),
(23, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-18 13:32:16', NULL),
(24, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'kamal@gmail.com login with IP Address ::1', '', 3, '2018-07-18 13:41:43', NULL),
(25, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/users/edit-save/3', 'Update data Kamal at Users Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>password</td><td>$2y$10$o77b.EYZaD0UMpfGpGHvD.ZgfaX8MHs50eOqmcBdlSgti0du/BPgy</td><td>$2y$10$5zFqEpAJjsoX2ygt6tpAQOe5kX8VSI56CZfWf.etggvaCbgsAwT6y</td></tr><tr><td>address</td><td></td><td>Nirala Khulna</td></tr><tr><td>last_institute</td><td></td><td></td></tr><tr><td>note</td><td></td><td>I love my country Bangladesh.</td></tr><tr><td>id_cms_privileges</td><td>2</td><td></td></tr><tr><td>status</td><td>Active</td><td></td></tr><tr><td>varifyToken</td><td>1</td><td></td></tr></tbody></table>', 3, '2018-07-18 14:08:03', NULL),
(26, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/users/edit-save/3', 'Update data Kamal at Users Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>password</td><td>$2y$10$5zFqEpAJjsoX2ygt6tpAQOe5kX8VSI56CZfWf.etggvaCbgsAwT6y</td><td></td></tr><tr><td>last_institute</td><td>Khulna University</td><td>Khulna University, Khulna.</td></tr><tr><td>id_cms_privileges</td><td>2</td><td></td></tr><tr><td>status</td><td>Active</td><td></td></tr><tr><td>varifyToken</td><td>1</td><td></td></tr></tbody></table>', 3, '2018-07-18 14:10:12', NULL),
(27, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'kamal@gmail.com logout', '', 3, '2018-07-18 14:11:06', NULL),
(28, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-18 14:32:15', NULL),
(29, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-18 14:32:26', NULL),
(30, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-18 14:32:41', NULL),
(31, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/delete/1', 'Delete data User at Menu Management', '', 1, '2018-07-18 15:27:56', NULL),
(32, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/add-save', 'Add New Data Security Keword at Menu Management', '', 1, '2018-07-18 15:30:31', NULL),
(33, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/1', 'Update data Security Keword at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>sorting</td><td></td><td></td></tr></tbody></table>', 1, '2018-07-18 15:30:50', NULL),
(34, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/module_generator/delete/12', 'Delete data Cover Picture at Module Generator', '', 1, '2018-07-18 17:36:17', NULL),
(35, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/delete/6', 'Delete data 6 at Cover Picture', '', 1, '2018-07-18 17:39:26', NULL),
(36, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/add-save', 'Add New Data 6 at Cover Picture', '', 1, '2018-07-18 17:45:59', NULL),
(37, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/delete-image', 'Delete the image of 6 at Cover Picture', '', 1, '2018-07-18 17:47:50', NULL),
(38, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/edit-save/6', 'Update data at Cover Picture', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>gallary_cover</td><td></td><td>uploads/1/2018-07/desktop_wallpaper_to_personalize_computer_high_wallpaper_hd_desktop.jpg</td></tr><tr><td>teacher_id</td><td>1</td><td></td></tr></tbody></table>', 1, '2018-07-18 17:48:02', NULL),
(39, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/action-selected', 'Delete data 5,4,3,2,1 at Cover Picture', '', 1, '2018-07-18 17:50:03', NULL),
(40, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/3', 'Update data Cover Picture at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>color</td><td></td><td>normal</td></tr></tbody></table>', 1, '2018-07-18 17:55:27', NULL),
(41, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-18 17:55:47', NULL),
(42, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'kamal@gmail.com login with IP Address ::1', '', 3, '2018-07-18 17:56:04', NULL),
(43, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'kamal@gmail.com logout', '', 3, '2018-07-18 17:56:57', NULL),
(44, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'kamal@gmail.com login with IP Address ::1', '', 3, '2018-07-18 17:56:59', NULL),
(45, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections', 'Try view the data :name at Cover Picture', '', 3, '2018-07-18 17:57:01', NULL),
(46, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections', 'Try view the data :name at Cover Picture', '', 3, '2018-07-18 17:57:04', NULL),
(47, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/3', 'Update data Cover Picture at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>type</td><td>Route</td><td>URL</td></tr><tr><td>path</td><td>AdminTblSectionsControllerGetIndex</td><td>http://localhost/Academic/public/admin/tbl_sections/edit/6?return_url=http%3A%2F%2Flocalhost%2FAcademic%2Fpublic%2Fadmin%2Ftbl_sections&parent_id=&parent_field=</td></tr></tbody></table>', 1, '2018-07-18 17:57:54', NULL),
(48, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'kamal@gmail.com logout', '', 3, '2018-07-18 17:58:02', NULL),
(49, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'kamal@gmail.com login with IP Address ::1', '', 3, '2018-07-18 17:58:03', NULL),
(50, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/edit/6', 'Try edit the data 6 at Cover Picture', '', 3, '2018-07-18 17:58:07', NULL),
(51, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/edit/6', 'Try edit the data 6 at Cover Picture', '', 3, '2018-07-18 17:58:09', NULL),
(52, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'kamal@gmail.com logout', '', 3, '2018-07-18 17:58:42', NULL),
(53, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'kamal@gmail.com login with IP Address ::1', '', 3, '2018-07-18 17:58:44', NULL),
(54, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/delete-image', 'Try delete the image of 6 data at Cover Picture', '', 3, '2018-07-18 17:59:10', NULL),
(55, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'kamal@gmail.com logout', '', 3, '2018-07-18 17:59:48', NULL),
(56, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'kamal@gmail.com login with IP Address ::1', '', 3, '2018-07-18 17:59:50', NULL),
(57, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/delete-image', 'Delete the image of 6 at Cover Picture', '', 3, '2018-07-18 17:59:55', NULL),
(58, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/edit-save/6', 'Update data at Cover Picture', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>home_cover</td><td></td><td>uploads/3/2018-07/desktop_wallpaper_to_personalize_computer_high_wallpaper_hd_desktop.jpg</td></tr><tr><td>teacher_id</td><td>2</td><td></td></tr></tbody></table>', 3, '2018-07-18 18:00:12', NULL),
(59, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/edit-save/6', 'Update data at Cover Picture', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>teacher_id</td><td>2</td><td></td></tr></tbody></table>', 3, '2018-07-18 18:04:32', NULL),
(60, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/edit-save/6', 'Update data at Cover Picture', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>teacher_id</td><td>2</td><td></td></tr></tbody></table>', 3, '2018-07-18 18:06:19', NULL),
(61, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/edit-save/6', 'Update data at Cover Picture', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>teacher_id</td><td>2</td><td></td></tr></tbody></table>', 3, '2018-07-18 18:06:33', NULL),
(62, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/edit-save/6', 'Update data at Cover Picture', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>teacher_id</td><td>2</td><td></td></tr></tbody></table>', 3, '2018-07-18 18:08:05', NULL),
(63, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/edit-save/6', 'Update data at Cover Picture', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>teacher_id</td><td>2</td><td></td></tr></tbody></table>', 3, '2018-07-18 18:08:43', NULL),
(64, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/3', 'Update data Cover Picture at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>type</td><td>URL</td><td>Module</td></tr><tr><td>path</td><td>http://localhost/Academic/public/admin/tbl_sections/edit/6?return_url=http%3A%2F%2Flocalhost%2FAcademic%2Fpublic%2Fadmin%2Ftbl_sections&parent_id=&parent_field=</td><td>tbl_sections</td></tr><tr><td>icon</td><td>fa fa-file-picture-o</td><td>fa fa-picture-o</td></tr></tbody></table>', 1, '2018-07-18 18:11:29', NULL),
(65, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'kamal@gmail.com logout', '', 3, '2018-07-18 18:11:51', NULL),
(66, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'kamal@gmail.com login with IP Address ::1', '', 3, '2018-07-18 18:11:53', NULL),
(67, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/delete-image', 'Try delete the image of 6 data at Cover Picture', '', 3, '2018-07-18 18:12:03', NULL),
(68, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/delete-image', 'Try delete the image of 6 data at Cover Picture', '', 3, '2018-07-18 18:13:10', NULL),
(69, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-18 23:41:27', NULL),
(70, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/delete-image', 'Delete the image of 6 at Cover Picture', '', 1, '2018-07-19 01:04:45', NULL),
(71, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/edit-save/6', 'Update data at Cover Picture', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>research_cover</td><td>https://lorempixel.com/1200/500/</td><td></td></tr><tr><td>teacher_id</td><td>2</td><td></td></tr></tbody></table>', 1, '2018-07-19 01:04:59', NULL),
(72, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', ' logout', '', NULL, '2018-07-19 01:49:14', NULL),
(73, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 01:49:23', NULL),
(74, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/3', 'Update data Cover Picture at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody></tbody></table>', 1, '2018-07-19 01:50:30', NULL),
(75, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-19 01:51:18', NULL),
(76, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 01:51:24', NULL),
(77, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'admin@crudbooster.com logout', '', 1, '2018-07-19 01:51:45', NULL),
(78, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 01:52:01', NULL),
(79, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-19 01:52:23', NULL),
(80, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-19 01:52:36', NULL),
(81, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/1', 'Update data Security Keword at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>sorting</td><td></td><td></td></tr></tbody></table>', 1, '2018-07-19 01:54:11', NULL),
(82, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-19 01:54:24', NULL),
(83, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 01:54:27', NULL),
(84, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-19 01:54:56', NULL),
(85, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'kamal@gmail.com login with IP Address ::1', '', 3, '2018-07-19 01:55:47', NULL),
(86, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'kamal@gmail.com logout', '', 3, '2018-07-19 01:56:46', NULL),
(87, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 01:58:04', NULL),
(88, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-19 02:47:02', NULL),
(89, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 02:47:06', NULL),
(90, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-19 02:47:23', NULL),
(91, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/1', 'Update data Security Keword at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>sorting</td><td></td><td></td></tr></tbody></table>', 1, '2018-07-19 02:48:00', NULL),
(92, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 02:48:13', NULL),
(93, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 13:13:43', NULL),
(94, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-19 13:13:56', NULL),
(95, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 13:15:49', NULL),
(96, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-19 13:15:53', NULL),
(97, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 13:17:17', NULL),
(98, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-19 13:17:21', NULL),
(99, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 13:19:28', NULL),
(100, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-19 13:19:32', NULL),
(101, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 13:21:18', NULL),
(102, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-19 13:21:27', NULL),
(103, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 13:22:35', NULL),
(104, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-19 13:22:40', NULL),
(105, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 13:27:43', NULL),
(106, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-19 13:27:49', NULL),
(107, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 15:02:49', NULL),
(108, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-19 15:04:11', NULL),
(109, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-19 15:04:42', NULL),
(110, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-19 21:25:31', NULL),
(111, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-19 21:43:51', NULL),
(112, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 21:45:19', NULL),
(113, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-19 21:45:35', NULL),
(114, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/admin/login', 'kamal@gmail.com login with IP Address ::1', '', 3, '2018-07-19 21:47:27', NULL),
(115, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'kamal@gmail.com logout', '', 3, '2018-07-19 21:47:39', NULL),
(116, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/admin/login', 'kamal@gmail.com login with IP Address ::1', '', 3, '2018-07-19 21:58:32', NULL),
(117, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'kamal@gmail.com logout', '', 3, '2018-07-19 21:58:49', NULL),
(118, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/admin/login', 'kamal@gmail.com login with IP Address ::1', '', 3, '2018-07-19 21:59:21', NULL),
(119, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 21:59:30', NULL),
(120, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-19 22:00:05', NULL),
(121, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/admin/login', 'lemon@gmail.com login with IP Address ::1', '', 15, '2018-07-19 22:01:33', NULL),
(122, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'lemon@gmail.com logout', '', 15, '2018-07-19 22:02:57', NULL),
(123, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'kamal@gmail.com login with IP Address ::1', '', 3, '2018-07-19 22:03:12', NULL),
(124, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/users/edit-save/3', 'Update data Kamal at Users Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>password</td><td>$2y$10$5zFqEpAJjsoX2ygt6tpAQOe5kX8VSI56CZfWf.etggvaCbgsAwT6y</td><td></td></tr><tr><td>contact</td><td>01931039338</td><td>019310393383</td></tr><tr><td>id_cms_privileges</td><td>2</td><td></td></tr><tr><td>status</td><td>Active</td><td></td></tr><tr><td>varifyToken</td><td>1</td><td></td></tr></tbody></table>', 3, '2018-07-19 22:03:26', NULL),
(125, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/users/edit-save/3', 'Update data Kamal at Users Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>password</td><td>$2y$10$5zFqEpAJjsoX2ygt6tpAQOe5kX8VSI56CZfWf.etggvaCbgsAwT6y</td><td></td></tr><tr><td>contact</td><td>019310393383</td><td>019310393385</td></tr><tr><td>id_cms_privileges</td><td>2</td><td></td></tr><tr><td>status</td><td>Active</td><td></td></tr><tr><td>varifyToken</td><td>1</td><td></td></tr></tbody></table>', 3, '2018-07-19 22:03:39', NULL),
(126, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/users/delete-image', 'Try delete the image of Kamal data at Users Management', '', 3, '2018-07-19 22:03:44', NULL),
(127, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/users/delete-image', 'Try delete the image of Kamal data at Users Management', '', 3, '2018-07-19 22:05:21', NULL),
(128, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'kamal@gmail.com logout', '', 3, '2018-07-19 22:05:25', NULL),
(129, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'kamal@gmail.com login with IP Address ::1', '', 3, '2018-07-19 22:05:34', NULL),
(130, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/users/delete-image', 'Delete the image of Kamal at Users Management', '', 3, '2018-07-19 22:05:43', NULL),
(131, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/users/edit-save/3', 'Update data Kamal at Users Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>photo</td><td></td><td>uploads/3/2018-07/koala.jpg</td></tr><tr><td>password</td><td>$2y$10$5zFqEpAJjsoX2ygt6tpAQOe5kX8VSI56CZfWf.etggvaCbgsAwT6y</td><td></td></tr><tr><td>id_cms_privileges</td><td>2</td><td></td></tr><tr><td>status</td><td>Active</td><td></td></tr><tr><td>varifyToken</td><td>1</td><td></td></tr></tbody></table>', 3, '2018-07-19 22:05:53', NULL),
(132, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'admin@crudbooster.com logout', '', 1, '2018-07-19 22:15:39', NULL),
(133, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-19 22:15:55', NULL),
(134, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'admin@crudbooster.com logout', '', 1, '2018-07-19 22:34:52', NULL),
(135, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-19 22:35:07', NULL),
(136, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'kamal@gmail.com logout', '', 3, '2018-07-19 22:41:34', NULL),
(137, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'bis@gmail.com login with IP Address ::1', '', 16, '2018-07-19 22:41:47', NULL),
(138, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'bis@gmail.com logout', '', 16, '2018-07-19 22:47:32', NULL),
(139, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'kamal@gmail.com login with IP Address ::1', '', 3, '2018-07-19 22:48:15', NULL),
(140, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'kamal@gmail.com logout', '', 3, '2018-07-19 22:48:27', NULL),
(141, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'bis@gmail.com login with IP Address ::1', '', 16, '2018-07-19 22:48:34', NULL),
(142, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'bis@gmail.com logout', '', 16, '2018-07-19 22:49:17', NULL),
(143, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'bis@gmail.com login with IP Address ::1', '', 16, '2018-07-19 22:49:24', NULL),
(144, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'bis@gmail.com logout', '', 16, '2018-07-19 22:53:14', NULL),
(145, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/admin/login', 'again@gmail.com login with IP Address ::1', '', 18, '2018-07-19 23:02:27', NULL),
(146, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/users/edit-save/18', 'Update data again at Users Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>photo</td><td></td><td>uploads/18/2018-07/hydrangeas.jpg</td></tr><tr><td>password</td><td>$2y$10$b.Mt481CA4PcaAEgvQD30.4ji1rwbkkRs6XA1eertmCqDxjRJudeO</td><td></td></tr><tr><td>address</td><td></td><td>Nirala Khulna</td></tr><tr><td>last_institute</td><td>Khulna University</td><td>Khulna Universitysdfasdf</td></tr><tr><td>note</td><td></td><td>somethingasdfasdfasdfasdfasd</td></tr><tr><td>id_cms_privileges</td><td>2</td><td></td></tr><tr><td>status</td><td>Active</td><td></td></tr><tr><td>varifyToken</td><td>1</td><td></td></tr></tbody></table>', 18, '2018-07-19 23:03:31', NULL),
(147, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'again@gmail.com logout', '', 18, '2018-07-19 23:03:42', NULL),
(148, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'bis@gmail.com login with IP Address ::1', '', 16, '2018-07-19 23:03:46', NULL),
(149, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'again@gmail.com login with IP Address ::1', '', 18, '2018-07-19 23:03:56', NULL),
(150, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/delete/4', 'Delete data Awards at Menu Management', '', 1, '2018-07-20 00:22:18', NULL),
(151, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_awards/action-selected', 'Delete data 9,8,7,6,5,4,3 at Awards', '', 1, '2018-07-20 00:26:35', NULL),
(152, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_awards/edit-save/2', 'Update data Building Innovative Brands at Awards', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>awr_by</td><td></td><td>Bangladesh Goverment</td></tr><tr><td>awr_teacher_id</td><td>2</td><td></td></tr></tbody></table>', 1, '2018-07-20 00:45:55', NULL),
(153, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_awards/edit-save/1', 'Update data Distinguished Scientific at Awards', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>awr_by</td><td></td><td>BTCL</td></tr><tr><td>awr_teacher_id</td><td>14</td><td></td></tr></tbody></table>', 1, '2018-07-20 00:46:11', NULL),
(154, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/5', 'Update data Awards at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>color</td><td></td><td>normal</td></tr><tr><td>sorting</td><td>2</td><td></td></tr></tbody></table>', 1, '2018-07-20 00:47:04', NULL);
INSERT INTO `cms_logs` (`id`, `ipaddress`, `useragent`, `url`, `description`, `details`, `id_cms_users`, `created_at`, `updated_at`) VALUES
(155, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_awards', 'Try view the data :name at Awards', '', 18, '2018-07-20 00:47:12', NULL),
(156, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'again@gmail.com logout', '', 18, '2018-07-20 00:47:18', NULL),
(157, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'again@gmail.com login with IP Address ::1', '', 18, '2018-07-20 00:47:27', NULL),
(158, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_awards/add-save', 'Add New Data BCB Technical support at Awards', '', 18, '2018-07-20 00:53:22', NULL),
(159, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/5', 'Update data Awards at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>icon</td><td>fa fa-glass</td><td>fa fa-list-alt</td></tr><tr><td>sorting</td><td>2</td><td></td></tr></tbody></table>', 1, '2018-07-20 00:53:58', NULL),
(160, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/admin/login', 'again@gmail.com login with IP Address ::1', '', 18, '2018-07-20 13:52:56', NULL),
(161, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-20 13:53:59', NULL),
(162, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_projects/action-selected', 'Delete data 17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1 at Projects', '', 1, '2018-07-20 14:09:54', NULL),
(163, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/6', 'Update data Projects at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>color</td><td></td><td>normal</td></tr><tr><td>sorting</td><td>3</td><td></td></tr></tbody></table>', 1, '2018-07-20 14:13:38', NULL),
(164, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_projects', 'Try view the data :name at Projects', '', 18, '2018-07-20 14:13:45', NULL),
(165, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'again@gmail.com logout', '', 18, '2018-07-20 14:13:50', NULL),
(166, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'again@gmail.com login with IP Address ::1', '', 18, '2018-07-20 14:13:55', NULL),
(167, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_projects/add-save', 'Add New Data BDCMS at Projects', '', 18, '2018-07-20 14:21:18', NULL),
(168, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_gallerys/action-selected', 'Delete data 33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14 at Gallery', '', 1, '2018-07-20 14:29:59', NULL),
(169, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_gallerys/action-selected', 'Delete data 13,12,11,10,9,8,7,6,5,4,3,2,1 at Gallery', '', 1, '2018-07-20 14:30:09', NULL),
(170, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_awards/add-save', 'Add New Data Educations at Awards', '', 18, '2018-07-20 14:39:35', NULL),
(171, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_gallerys/add-save', 'Add New Data First at Gallery', '', 1, '2018-07-20 14:40:46', NULL),
(172, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/7', 'Update data Gallery at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>color</td><td></td><td>normal</td></tr><tr><td>sorting</td><td>4</td><td></td></tr></tbody></table>', 1, '2018-07-20 14:44:19', NULL),
(173, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_publications/action-selected', 'Delete data 14,13,12,11,10,9,8,7,6,5,4,3,2,1 at Publications', '', 1, '2018-07-20 14:50:15', NULL),
(174, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/8', 'Update data Publications at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>color</td><td></td><td>normal</td></tr><tr><td>sorting</td><td>5</td><td></td></tr></tbody></table>', 1, '2018-07-20 14:54:12', NULL),
(175, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_publications', 'Try view the data :name at Publications', '', 18, '2018-07-20 14:54:43', NULL),
(176, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'again@gmail.com logout', '', 18, '2018-07-20 14:54:48', NULL),
(177, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'again@gmail.com login with IP Address ::1', '', 18, '2018-07-20 14:54:53', NULL),
(178, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_publications/add-save', 'Add New Data Himu History at Publications', '', 18, '2018-07-20 14:58:35', NULL),
(179, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_trainings/action-selected', 'Delete data 11,10,9,8,7,6,5,4,3,2,1 at Trainings', '', 1, '2018-07-20 15:12:02', NULL),
(180, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_trainings/add-save', 'Add New Data CCNA at Trainings', '', 1, '2018-07-20 15:16:18', NULL),
(181, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_trainings/edit-save/1', 'Update data CCNA at Trainings', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>duration</td><td>6 Months</td><td>1 Year</td></tr><tr><td>desc</td><td><p><span style=\"color: rgb(51, 51, 51); font-family: "Open Sans", Arial, sans-serif; font-size: 12px; text-align: justify; background-color: rgb(245, 245, 245);\">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.</span></p><p><span style=\"color: rgb(51, 51, 51); font-family: "Open Sans", Arial, sans-serif; font-size: 12px; text-align: justify; background-color: rgb(245, 245, 245);\">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.</span><span style=\"color: rgb(51, 51, 51); font-family: "Open Sans", Arial, sans-serif; font-size: 12px; text-align: justify; background-color: rgb(245, 245, 245);\"><br></span><br></p></td><td><p><span style=\"color: rgb(51, 51, 51); font-family: \"Open Sans\", Arial, sans-serif; font-size: 12px; text-align: justify; background-color: rgb(245, 245, 245);\">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.</span></p><p><span style=\"color: rgb(51, 51, 51); font-family: \"Open Sans\", Arial, sans-serif; font-size: 12px; text-align: justify; background-color: rgb(245, 245, 245);\">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.</span><span style=\"color: rgb(51, 51, 51); font-family: \"Open Sans\", Arial, sans-serif; font-size: 12px; text-align: justify; background-color: rgb(245, 245, 245);\"><br></span><br></p></td></tr><tr><td>teacher_id</td><td>1</td><td></td></tr></tbody></table>', 1, '2018-07-20 17:12:29', NULL),
(182, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/9', 'Update data Trainings at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>color</td><td></td><td>normal</td></tr><tr><td>sorting</td><td>6</td><td></td></tr></tbody></table>', 1, '2018-07-20 17:14:43', NULL),
(183, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_trainings', 'Try view the data :name at Trainings', '', 18, '2018-07-20 17:15:00', NULL),
(184, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'again@gmail.com logout', '', 18, '2018-07-20 17:15:06', NULL),
(185, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'again@gmail.com login with IP Address ::1', '', 18, '2018-07-20 17:15:11', NULL),
(186, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_trainings/add-save', 'Add New Data Lorem Isupm at Trainings', '', 18, '2018-07-20 17:16:30', NULL),
(187, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-22 09:05:53', NULL),
(188, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_department/add-save', 'Add New Data 1 at Department', '', 1, '2018-07-22 09:11:16', NULL),
(189, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_department/add-save', 'Add New Data 2 at Department', '', 1, '2018-07-22 09:12:06', NULL),
(190, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_department/edit-save/1', 'Update data at Department', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>department</td><td>Computer Science & Engineering.</td><td>Computer Science & Engineering</td></tr></tbody></table>', 1, '2018-07-22 09:12:18', NULL),
(191, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_department/add-save', 'Add New Data 3 at Department', '', 1, '2018-07-22 09:12:32', NULL),
(192, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_department/add-save', 'Add New Data 4 at Department', '', 1, '2018-07-22 09:12:37', NULL),
(193, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_department/add-save', 'Add New Data 5 at Department', '', 1, '2018-07-22 09:12:48', NULL),
(194, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_department/add-save', 'Add New Data 6 at Department', '', 1, '2018-07-22 09:13:03', NULL),
(195, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/users/edit-save/1', 'Update data Super Admin at Users Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>password</td><td>$2y$10$NFM1qAYEdwkSf.zxgxUOZ.6e3DrI0VIpY6Hab5OvM4l9xZJTT0DDC</td><td></td></tr><tr><td>birth_date</td><td></td><td>1981-02-03</td></tr><tr><td>address</td><td></td><td>15/1 , Nirala , Khulna, Bangladesh</td></tr><tr><td>dept_name</td><td></td><td>1</td></tr><tr><td>position</td><td></td><td>3</td></tr><tr><td>last_institute</td><td></td><td>Khulna University</td></tr><tr><td>note</td><td></td><td>The world is very beutiful</td></tr><tr><td>status</td><td>Active</td><td></td></tr></tbody></table>', 1, '2018-07-22 12:11:58', NULL),
(196, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/users/edit-save/1', 'Update data Shariful Islam at Users Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>name</td><td>Super Admin</td><td>Shariful Islam</td></tr><tr><td>password</td><td>$2y$10$NFM1qAYEdwkSf.zxgxUOZ.6e3DrI0VIpY6Hab5OvM4l9xZJTT0DDC</td><td></td></tr><tr><td>status</td><td>Active</td><td></td></tr></tbody></table>', 1, '2018-07-22 12:12:15', NULL),
(197, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/add-save', 'Add New Data Teachers at Menu Management', '', 1, '2018-07-22 13:21:03', NULL),
(198, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_interests/add-save', 'Add New Data Python at Interests', '', 1, '2018-07-22 13:26:37', NULL),
(199, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_interests/action-selected', 'Delete data 28,27,26 at Interests', '', 1, '2018-07-22 13:28:43', NULL),
(200, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_educations/add-save', 'Add New Data 25 at Educations', '', 1, '2018-07-22 14:05:44', NULL),
(201, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-23 21:11:40', NULL),
(202, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_expriences/add-save', 'Add New Data BRAC at Expriences', '', 1, '2018-07-23 21:29:41', NULL),
(203, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-23 21:33:08', NULL),
(204, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_researchs/add-save', 'Add New Data Educations at Resarches', '', 1, '2018-07-23 21:48:03', NULL),
(205, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/delete-image', 'Delete the image of 9 at Cover Picture', '', 1, '2018-07-23 21:55:38', NULL),
(206, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/delete-image', 'Delete the image of 9 at Cover Picture', '', 1, '2018-07-23 21:55:41', NULL),
(207, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/delete-image', 'Delete the image of 9 at Cover Picture', '', 1, '2018-07-23 21:55:44', NULL),
(208, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/delete-image', 'Delete the image of 9 at Cover Picture', '', 1, '2018-07-23 21:55:47', NULL),
(209, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/delete-image', 'Delete the image of 9 at Cover Picture', '', 1, '2018-07-23 21:55:50', NULL),
(210, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/delete-image', 'Delete the image of 9 at Cover Picture', '', 1, '2018-07-23 21:55:55', NULL),
(211, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/delete-image', 'Delete the image of 9 at Cover Picture', '', 1, '2018-07-23 21:55:58', NULL),
(212, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/delete-image', 'Delete the image of 9 at Cover Picture', '', 1, '2018-07-23 21:56:03', NULL),
(213, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_sections/edit-save/9', 'Update data at Cover Picture', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>home_cover</td><td></td><td>uploads/1/2018-07/cover1.jpg</td></tr><tr><td>public_cover</td><td></td><td>uploads/1/2018-07/cover2.jpg</td></tr><tr><td>research_cover</td><td></td><td>uploads/1/2018-07/cover3.jpg</td></tr><tr><td>project_cover</td><td></td><td>uploads/1/2018-07/cover4.jpg</td></tr><tr><td>train_cover</td><td></td><td>uploads/1/2018-07/cover5.jpg</td></tr><tr><td>gallary_cover</td><td></td><td>uploads/1/2018-07/cover6.jpg</td></tr><tr><td>contact_cover</td><td></td><td>uploads/1/2018-07/cover7.jpg</td></tr><tr><td>course_cover</td><td></td><td>uploads/1/2018-07/desktop_wallpaper_03.jpg</td></tr><tr><td>teacher_id</td><td>1</td><td></td></tr></tbody></table>', 1, '2018-07-23 21:56:43', NULL),
(214, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_gallerys/delete/1', 'Delete data First at Gallery', '', 1, '2018-07-23 22:02:45', NULL),
(215, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_gallerys/add-save', 'Add New Data asdfasdf at Gallery', '', 1, '2018-07-23 22:04:54', NULL),
(216, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_gallerys/add-save', 'Add New Data dgadfg at Gallery', '', 1, '2018-07-23 22:05:28', NULL),
(217, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_gallerys/delete/2', 'Delete data dgadfg at Gallery', '', 1, '2018-07-23 22:06:09', NULL),
(218, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_courses/add-save', 'Add New Data Algorithm at Courses', '', 1, '2018-07-23 22:23:52', NULL),
(219, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/add-save', 'Add New Data Social Links at Menu Management', '', 1, '2018-07-23 22:54:13', NULL),
(220, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/admin/login', 'sojib@gmail.com login with IP Address ::1', '', 19, '2018-07-23 23:14:59', NULL),
(221, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/users/edit-save/19', 'Update data Sojib Khan at Users Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>photo</td><td></td><td>uploads/19/2018-07/tulips.jpg</td></tr><tr><td>password</td><td>$2y$10$9loRciNgvAepkBo1GhEBF.lRgIbYTvuTl86Gz8VOxR5k9scMAlxli</td><td></td></tr><tr><td>address</td><td></td><td>15/1 , Nirala , Khulna, Bangladesh</td></tr><tr><td>note</td><td></td><td>The world is very beutiful</td></tr><tr><td>status</td><td>Active</td><td></td></tr><tr><td>varifyToken</td><td>1</td><td></td></tr></tbody></table>', 19, '2018-07-23 23:15:37', NULL),
(222, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'sojib@gmail.com logout', '', 19, '2018-07-23 23:15:43', NULL),
(223, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'sojib@gmail.com login with IP Address ::1', '', 19, '2018-07-23 23:15:55', NULL),
(224, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'sojib@gmail.com logout', '', 19, '2018-07-23 23:17:12', NULL),
(225, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'sojib@gmail.com login with IP Address ::1', '', 19, '2018-07-23 23:17:20', NULL),
(226, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/10', 'Update data Department at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>color</td><td></td><td>normal</td></tr><tr><td>sorting</td><td>7</td><td></td></tr></tbody></table>', 1, '2018-07-23 23:40:32', NULL),
(227, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/12', 'Update data Interest at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>color</td><td></td><td>normal</td></tr><tr><td>sorting</td><td>8</td><td></td></tr></tbody></table>', 1, '2018-07-23 23:40:41', NULL),
(228, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/13', 'Update data Educations at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>color</td><td></td><td>normal</td></tr><tr><td>sorting</td><td>9</td><td></td></tr></tbody></table>', 1, '2018-07-23 23:40:52', NULL),
(229, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/14', 'Update data Expriences at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>color</td><td></td><td>normal</td></tr><tr><td>icon</td><td>fa fa-times</td><td>fa fa-th</td></tr><tr><td>sorting</td><td>10</td><td></td></tr></tbody></table>', 1, '2018-07-23 23:41:39', NULL),
(230, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/7', 'Update data Gallery at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>icon</td><td>fa fa-gamepad</td><td>fa fa-modx</td></tr><tr><td>sorting</td><td>4</td><td></td></tr></tbody></table>', 1, '2018-07-23 23:42:13', NULL),
(231, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/8', 'Update data Publications at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>icon</td><td>fa fa-envelope-o</td><td>fa fa-list-alt</td></tr><tr><td>sorting</td><td>5</td><td></td></tr></tbody></table>', 1, '2018-07-23 23:42:46', NULL),
(232, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/add-save', 'Add New Data Academic at Menu Management', '', 1, '2018-07-23 23:44:39', NULL),
(233, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/10', 'Update data Department at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>sorting</td><td>11</td><td></td></tr></tbody></table>', 1, '2018-07-23 23:45:13', NULL),
(234, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/add-save', 'Add New Data Parsonal at Menu Management', '', 1, '2018-07-23 23:49:09', NULL),
(235, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/10', 'Update data Department at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>icon</td><td>fa fa-signal</td><td>fa fa-credit-card</td></tr><tr><td>sorting</td><td>3</td><td></td></tr></tbody></table>', 1, '2018-07-23 23:51:02', NULL),
(236, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/18', 'Update data Academic at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>sorting</td><td>4</td><td></td></tr></tbody></table>', 1, '2018-07-23 23:51:15', NULL),
(237, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/16', 'Update data Courses at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>color</td><td></td><td>normal</td></tr><tr><td>parent_id</td><td>18</td><td></td></tr></tbody></table>', 1, '2018-07-23 23:51:25', NULL),
(238, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/15', 'Update data Resarches at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>color</td><td></td><td>normal</td></tr><tr><td>parent_id</td><td>18</td><td></td></tr><tr><td>sorting</td><td>5</td><td></td></tr></tbody></table>', 1, '2018-07-23 23:51:37', NULL),
(239, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/9', 'Update data Trainings at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>icon</td><td>fa fa-user</td><td>fa fa-th-list</td></tr><tr><td>parent_id</td><td>18</td><td></td></tr><tr><td>sorting</td><td>2</td><td></td></tr></tbody></table>', 1, '2018-07-23 23:52:17', NULL),
(240, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/5', 'Update data Awards at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>icon</td><td>fa fa-list-alt</td><td>fa fa-briefcase</td></tr><tr><td>parent_id</td><td>18</td><td></td></tr><tr><td>sorting</td><td>6</td><td></td></tr></tbody></table>', 1, '2018-07-23 23:53:25', NULL),
(241, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_educations', 'Try view the data :name at Educations', '', 19, '2018-07-23 23:54:01', NULL),
(242, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'sojib@gmail.com logout', '', 19, '2018-07-23 23:54:08', NULL),
(243, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'sojib@gmail.com login with IP Address ::1', '', 19, '2018-07-23 23:54:22', NULL),
(244, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_trainings/add-save', 'Add New Data BRTA at Trainings', '', 19, '2018-07-23 23:56:55', NULL),
(245, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-24 13:31:05', NULL),
(246, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-24 13:40:57', NULL),
(247, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/admin/login', 'admin@crudbooster.com login with IP Address ::1', '', 1, '2018-07-24 21:11:03', NULL),
(248, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/add-save', 'Add New Data Visit Site at Menu Management', '', 1, '2018-07-24 21:18:42', NULL),
(249, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/20', 'Update data Visit Site at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>path</td><td>AdminCmsUsersController@getProfile</td><td>AdminCmsUsersController@getProfilesite</td></tr><tr><td>sorting</td><td></td><td></td></tr></tbody></table>', 1, '2018-07-24 21:23:15', NULL),
(250, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/20', 'Update data Visit Site at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>path</td><td>AdminCmsUsersController@getProfilesite</td><td>ProfileController@getProfilesite</td></tr><tr><td>sorting</td><td></td><td></td></tr></tbody></table>', 1, '2018-07-24 21:29:25', NULL),
(251, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/20', 'Update data Visit Site at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>sorting</td><td></td><td></td></tr></tbody></table>', 1, '2018-07-24 21:30:03', NULL),
(252, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/add-save', 'Add New Data saasdfasdf at Menu Management', '', 1, '2018-07-24 21:31:29', NULL),
(253, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/delete/21', 'Delete data saasdfasdf at Menu Management', '', 1, '2018-07-24 21:31:38', NULL),
(254, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/20', 'Update data Visit Site at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>type</td><td>Controller & Method</td><td>Route</td></tr><tr><td>path</td><td>ProfileController@getProfilesite</td><td>profiledashboard</td></tr><tr><td>sorting</td><td></td><td></td></tr></tbody></table>', 1, '2018-07-24 21:33:40', NULL),
(255, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/admin/login', 'mijanur@gmail.com login with IP Address ::1', '', 20, '2018-07-24 22:33:16', NULL),
(256, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'mijanur@gmail.com logout', '', 20, '2018-07-24 22:35:27', NULL),
(257, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'mijanur@gmail.com login with IP Address ::1', '', 20, '2018-07-24 22:35:50', NULL),
(258, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'mijanur@gmail.com logout', '', 20, '2018-07-24 22:36:44', NULL),
(259, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'mijanur@gmail.com login with IP Address ::1', '', 20, '2018-07-24 22:36:56', NULL),
(260, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'mijanur@gmail.com logout', '', 20, '2018-07-24 22:39:19', NULL),
(261, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'mijanur@gmail.com login with IP Address ::1', '', 20, '2018-07-24 22:39:31', NULL),
(262, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/13', 'Update data Educations at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>icon</td><td>fa fa-medium</td><td>fa fa-graduation-cap</td></tr><tr><td>parent_id</td><td>18</td><td></td></tr><tr><td>sorting</td><td>3</td><td></td></tr></tbody></table>', 1, '2018-07-24 22:56:57', NULL),
(263, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/16', 'Update data Courses at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>icon</td><td>fa fa-qrcode</td><td>fa fa-leanpub</td></tr><tr><td>parent_id</td><td>18</td><td></td></tr></tbody></table>', 1, '2018-07-24 23:00:29', NULL),
(264, '::1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', 'http://localhost/Academic/public/admin/menu_management/edit-save/1', 'Update data Security Keword at Menu Management', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>icon</td><td>fa fa-adjust</td><td>fa fa-key</td></tr></tbody></table>', 1, '2018-07-24 23:00:51', NULL),
(265, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/logout', 'mijanur@gmail.com logout', '', 20, '2018-07-24 23:04:30', NULL),
(266, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/login', 'mijanur@gmail.com login with IP Address ::1', '', 20, '2018-07-24 23:04:45', NULL),
(267, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_educations/add-save', 'Add New Data 26 at Educations', '', 20, '2018-07-24 23:05:37', NULL),
(268, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_educations/add-save', 'Add New Data 27 at Educations', '', 20, '2018-07-24 23:06:48', NULL),
(269, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_educations/add-save', 'Add New Data 28 at Educations', '', 20, '2018-07-24 23:08:35', NULL),
(270, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_expriences/add-save', 'Add New Data Somaj Unnayan Songstha at Expriences', '', 20, '2018-07-24 23:19:29', NULL),
(271, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_expriences/edit-save/27', 'Update data Somaj Unnayan Songstha at Expriences', '<table class=\"table table-striped\"><thead><tr><th>Key</th><th>Old Value</th><th>New Value</th></thead><tbody><tr><td>exp_teacher_id</td><td>20</td><td></td></tr><tr><td>exp_desc</td><td><p><strong style=\"margin: 0px; padding: 0px; font-family: "Open Sans", Arial, sans-serif; text-align: justify;\">Lorem Ipsum</strong><span style=\"font-family: "Open Sans", Arial, sans-serif; text-align: justify;\"> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</span><br></p></td><td><p><strong style=\"margin: 0px; padding: 0px; font-family: \"Open Sans\", Arial, sans-serif; text-align: justify;\">Lorem Ipsum</strong><span style=\"font-family: \"Open Sans\", Arial, sans-serif; text-align: justify;\"> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</span><br></p></td></tr><tr><td>exp_department</td><td>something</td><td></td></tr></tbody></table>', 20, '2018-07-24 23:20:07', NULL),
(272, '::1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/7.0.185.1002 Safari/537.36', 'http://localhost/Academic/public/admin/tbl_expriences/add-save', 'Add New Data NGO at Expriences', '', 20, '2018-07-24 23:21:06', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `cms_menus`
--
CREATE TABLE `cms_menus` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'url',
`path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`color` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`icon` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`parent_id` int(11) DEFAULT NULL,
`is_active` tinyint(1) NOT NULL DEFAULT '1',
`is_dashboard` tinyint(1) NOT NULL DEFAULT '0',
`id_cms_privileges` int(11) DEFAULT NULL,
`sorting` int(11) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `cms_menus`
--
INSERT INTO `cms_menus` (`id`, `name`, `type`, `path`, `color`, `icon`, `parent_id`, `is_active`, `is_dashboard`, `id_cms_privileges`, `sorting`, `created_at`, `updated_at`) VALUES
(1, 'Security Keword', 'URL', 'http://localhost/Academic/public/keywordEdit', 'normal', 'fa fa-key', 0, 1, 0, 1, 1, '2018-07-18 15:30:31', '2018-07-24 23:00:51'),
(3, 'Cover Picture', 'Module', 'tbl_sections', 'normal', 'fa fa-picture-o', 19, 1, 0, 1, 2, '2018-07-18 17:37:04', '2018-07-19 01:50:30'),
(5, 'Awards', 'Route', 'AdminTblAwards1ControllerGetIndex', 'normal', 'fa fa-briefcase', 18, 1, 0, 1, 6, '2018-07-20 00:22:40', '2018-07-23 23:53:25'),
(6, 'Projects', 'Route', 'AdminTblProjectsControllerGetIndex', 'normal', 'fa fa-heart', 19, 1, 0, 1, 4, '2018-07-20 13:58:16', '2018-07-20 14:13:38'),
(7, 'Gallery', 'Route', 'AdminTblGallerysControllerGetIndex', 'normal', 'fa fa-modx', 19, 1, 0, 1, 1, '2018-07-20 14:26:19', '2018-07-23 23:42:12'),
(8, 'Publications', 'Route', 'AdminTblPublicationsControllerGetIndex', 'normal', 'fa fa-list-alt', 18, 1, 0, 1, 4, '2018-07-20 14:45:48', '2018-07-23 23:42:46'),
(9, 'Trainings', 'Route', 'AdminTblTrainingsControllerGetIndex', 'normal', 'fa fa-th-list', 18, 1, 0, 1, 2, '2018-07-20 15:01:41', '2018-07-23 23:52:17'),
(10, 'Department', 'Route', 'AdminTblDepartmentControllerGetIndex', 'normal', 'fa fa-credit-card', 0, 1, 0, 1, 3, '2018-07-22 09:09:26', '2018-07-23 23:51:02'),
(11, 'Teachers', 'URL', 'http://localhost/Academic/public/admin/users', 'normal', 'fa fa-users', 0, 1, 0, 1, 2, '2018-07-22 13:21:03', NULL),
(12, 'Interest', 'Route', 'AdminTblInterestsControllerGetIndex', 'normal', 'fa fa-star-o', 19, 1, 0, 1, 5, '2018-07-22 13:22:26', '2018-07-23 23:40:41'),
(13, 'Educations', 'Route', 'AdminTblEducationsControllerGetIndex', 'normal', 'fa fa-graduation-cap', 18, 1, 0, 1, 3, '2018-07-22 13:29:46', '2018-07-24 22:56:57'),
(14, 'Expriences', 'Route', 'AdminTblExpriencesControllerGetIndex', 'normal', 'fa fa-th', 19, 1, 0, 1, 3, '2018-07-23 21:14:56', '2018-07-23 23:41:39'),
(15, 'Resarches', 'Route', 'AdminTblResearchsControllerGetIndex', 'normal', 'fa fa-pencil-square-o', 18, 1, 0, 1, 5, '2018-07-23 21:37:57', '2018-07-23 23:51:36'),
(16, 'Courses', 'Route', 'AdminTblCoursesControllerGetIndex', 'normal', 'fa fa-leanpub', 18, 1, 0, 1, 1, '2018-07-23 22:09:11', '2018-07-24 23:00:29'),
(17, 'Social Links', 'URL', 'http://localhost/Academic/public/socialEdit', 'normal', 'fa fa-qrcode', 19, 1, 0, 1, 6, '2018-07-23 22:54:12', NULL),
(18, 'Academic', 'URL', '#', 'normal', 'fa fa-pencil-square-o', 0, 1, 0, 1, 4, '2018-07-23 23:44:39', '2018-07-23 23:51:15'),
(19, 'Parsonal', 'URL', '#', 'normal', 'fa fa-user-secret', 0, 1, 0, 1, 5, '2018-07-23 23:49:09', NULL),
(20, 'Visit Site', 'Route', 'profiledashboard', 'normal', 'fa fa-delicious', 0, 1, 0, 1, NULL, '2018-07-24 21:18:41', '2018-07-24 21:33:40');
-- --------------------------------------------------------
--
-- Table structure for table `cms_menus_privileges`
--
CREATE TABLE `cms_menus_privileges` (
`id` int(10) UNSIGNED NOT NULL,
`id_cms_menus` int(11) DEFAULT NULL,
`id_cms_privileges` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `cms_menus_privileges`
--
INSERT INTO `cms_menus_privileges` (`id`, `id_cms_menus`, `id_cms_privileges`) VALUES
(2, 2, 1),
(3, 3, 1),
(4, 3, 2),
(6, 4, 1),
(9, 6, 1),
(10, 6, 2),
(18, 11, 1),
(24, 17, 1),
(25, 17, 2),
(28, 12, 1),
(29, 12, 2),
(32, 14, 1),
(33, 14, 2),
(34, 7, 1),
(35, 7, 2),
(36, 8, 1),
(37, 8, 2),
(41, 19, 1),
(42, 19, 2),
(43, 10, 1),
(44, 18, 1),
(45, 18, 2),
(48, 15, 1),
(49, 15, 2),
(50, 9, 1),
(51, 9, 2),
(52, 5, 1),
(53, 5, 2),
(56, 21, 1),
(57, 21, 2),
(58, 20, 1),
(59, 20, 2),
(60, 13, 1),
(61, 13, 2),
(62, 16, 1),
(63, 16, 2),
(64, 1, 1);
-- --------------------------------------------------------
--
-- Table structure for table `cms_moduls`
--
CREATE TABLE `cms_moduls` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`icon` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`table_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`controller` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`is_protected` tinyint(1) NOT NULL DEFAULT '0',
`is_active` tinyint(1) NOT NULL DEFAULT '0',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `cms_moduls`
--
INSERT INTO `cms_moduls` (`id`, `name`, `icon`, `path`, `table_name`, `controller`, `is_protected`, `is_active`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Notifications', 'fa fa-cog', 'notifications', 'cms_notifications', 'NotificationsController', 1, 1, '2018-07-17 14:21:17', NULL, NULL),
(2, 'Privileges', 'fa fa-cog', 'privileges', 'cms_privileges', 'PrivilegesController', 1, 1, '2018-07-17 14:21:17', NULL, NULL),
(3, 'Privileges Roles', 'fa fa-cog', 'privileges_roles', 'cms_privileges_roles', 'PrivilegesRolesController', 1, 1, '2018-07-17 14:21:17', NULL, NULL),
(4, 'Users Management', 'fa fa-users', 'users', 'cms_users', 'AdminCmsUsersController', 0, 1, '2018-07-17 14:21:17', NULL, NULL),
(5, 'Settings', 'fa fa-cog', 'settings', 'cms_settings', 'SettingsController', 1, 1, '2018-07-17 14:21:17', NULL, NULL),
(6, 'Module Generator', 'fa fa-database', 'module_generator', 'cms_moduls', 'ModulsController', 1, 1, '2018-07-17 14:21:17', NULL, NULL),
(7, 'Menu Management', 'fa fa-bars', 'menu_management', 'cms_menus', 'MenusController', 1, 1, '2018-07-17 14:21:17', NULL, NULL),
(8, 'Email Templates', 'fa fa-envelope-o', 'email_templates', 'cms_email_templates', 'EmailTemplatesController', 1, 1, '2018-07-17 14:21:17', NULL, NULL),
(9, 'Statistic Builder', 'fa fa-dashboard', 'statistic_builder', 'cms_statistics', 'StatisticBuilderController', 1, 1, '2018-07-17 14:21:17', NULL, NULL),
(10, 'API Generator', 'fa fa-cloud-download', 'api_generator', '', 'ApiCustomController', 1, 1, '2018-07-17 14:21:17', NULL, NULL),
(11, 'Log User Access', 'fa fa-flag-o', 'logs', 'cms_logs', 'LogsController', 1, 1, '2018-07-17 14:21:17', NULL, NULL),
(13, 'Cover Picture', 'fa fa-file-picture-o', 'tbl_sections', 'tbl_sections', 'AdminTblSectionsController', 0, 0, '2018-07-18 17:37:04', NULL, NULL),
(14, 'Awards', 'fa fa-briefcase', 'tbl_awards', 'tbl_awards', 'AdminTblAwards1Controller', 0, 0, '2018-07-20 00:22:40', NULL, NULL),
(15, 'Projects', 'fa fa-heart', 'tbl_projects', 'tbl_projects', 'AdminTblProjectsController', 0, 0, '2018-07-20 13:58:16', NULL, NULL),
(16, 'Gallery', ' \r\nfa fa-modx\r\n', 'tbl_gallerys', 'tbl_gallerys', 'AdminTblGallerysController', 0, 0, '2018-07-20 14:26:19', NULL, NULL),
(17, 'Publications', 'fa fa-list-alt\r\n', 'tbl_publications', 'tbl_publications', 'AdminTblPublicationsController', 0, 0, '2018-07-20 14:45:48', NULL, NULL),
(18, 'Trainings', 'fa fa-th-list', 'tbl_trainings', 'tbl_trainings', 'AdminTblTrainingsController', 0, 0, '2018-07-20 15:01:41', NULL, NULL),
(19, 'Department', 'fa fa-credit-card', 'tbl_department', 'tbl_department', 'AdminTblDepartmentController', 0, 0, '2018-07-22 09:09:26', NULL, NULL),
(20, 'Interests', 'fa fa-star-o', 'tbl_interests', 'tbl_interests', 'AdminTblInterestsController', 0, 0, '2018-07-22 13:22:26', NULL, NULL),
(21, 'Educations', 'fa fa-graduation-cap', 'tbl_educations', 'tbl_educations', 'AdminTblEducationsController', 0, 0, '2018-07-22 13:29:46', NULL, NULL),
(22, 'Expriences', 'fa fa-th', 'tbl_expriences', 'tbl_expriences', 'AdminTblExpriencesController', 0, 0, '2018-07-23 21:14:56', NULL, NULL),
(23, 'Resarches', 'fa fa-pencil-square-o', 'tbl_researchs', 'tbl_researchs', 'AdminTblResearchsController', 0, 0, '2018-07-23 21:37:57', NULL, NULL),
(24, 'Courses', 'fa fa-leanpub', 'tbl_courses', 'tbl_courses', 'AdminTblCoursesController', 0, 0, '2018-07-23 22:09:11', NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `cms_notifications`
--
CREATE TABLE `cms_notifications` (
`id` int(10) UNSIGNED NOT NULL,
`id_cms_users` int(11) DEFAULT NULL,
`content` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`is_read` tinyint(1) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `cms_notifications`
--
INSERT INTO `cms_notifications` (`id`, `id_cms_users`, `content`, `url`, `is_read`, `created_at`, `updated_at`) VALUES
(1, 1, 'Wait for your approvement', 'http://localhost/Academic/public/admin/users', 1, NULL, NULL),
(2, 1, 'Bismillah from MBA department is waiting for your approval', 'http://localhost/Academic/public/admin/users', 1, '2018-07-19 15:39:02', '2018-07-19 15:39:02'),
(3, 1, 'again from MBA department is waiting for your approval', 'http://localhost/Academic/public/admin/users', 1, '2018-07-19 16:00:47', '2018-07-19 16:00:47'),
(4, 1, 'Md Mijanur Rahaman from 2 department is waiting for your approval', 'http://localhost/Academic/public/admin/users', 1, '2018-07-24 15:26:27', '2018-07-24 15:26:27'),
(5, 1, 'Rony Adikari from 4 department is waiting for your approval', 'http://localhost/Academic/public/admin/users', 1, '2018-07-24 15:43:57', '2018-07-24 15:43:57');
-- --------------------------------------------------------
--
-- Table structure for table `cms_privileges`
--
CREATE TABLE `cms_privileges` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`is_superadmin` tinyint(1) DEFAULT NULL,
`theme_color` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `cms_privileges`
--
INSERT INTO `cms_privileges` (`id`, `name`, `is_superadmin`, `theme_color`, `created_at`, `updated_at`) VALUES
(1, 'Super Administrator', 1, 'skin-green', '2018-07-17 14:21:17', NULL),
(2, 'Teacher', 0, 'skin-purple', NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `cms_privileges_roles`
--
CREATE TABLE `cms_privileges_roles` (
`id` int(10) UNSIGNED NOT NULL,
`is_visible` tinyint(1) DEFAULT NULL,
`is_create` tinyint(1) DEFAULT NULL,
`is_read` tinyint(1) DEFAULT NULL,
`is_edit` tinyint(1) DEFAULT NULL,
`is_delete` tinyint(1) DEFAULT NULL,
`id_cms_privileges` int(11) DEFAULT NULL,
`id_cms_moduls` int(11) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `cms_privileges_roles`
--
INSERT INTO `cms_privileges_roles` (`id`, `is_visible`, `is_create`, `is_read`, `is_edit`, `is_delete`, `id_cms_privileges`, `id_cms_moduls`, `created_at`, `updated_at`) VALUES
(54, 1, 1, 1, 1, 1, 2, 14, '2018-07-24 16:04:16', '2018-07-24 16:04:16'),
(55, 1, 1, 1, 1, 1, 2, 24, '2018-07-24 16:04:16', '2018-07-24 16:04:16'),
(56, 1, 0, 1, 1, 1, 2, 13, '2018-07-24 16:04:16', '2018-07-24 16:04:16'),
(57, 1, 1, 1, 1, 1, 2, 19, '2018-07-24 16:04:16', '2018-07-24 16:04:16'),
(58, 1, 1, 1, 1, 1, 2, 21, '2018-07-24 16:04:16', '2018-07-24 16:04:16'),
(59, 1, 1, 1, 1, 1, 2, 22, '2018-07-24 16:04:16', '2018-07-24 16:04:16'),
(60, 1, 1, 1, 1, 1, 2, 16, '2018-07-24 16:04:16', '2018-07-24 16:04:16'),
(61, 1, 1, 1, 1, 1, 2, 20, '2018-07-24 16:04:16', '2018-07-24 16:04:16'),
(62, 1, 1, 1, 1, 1, 2, 15, '2018-07-24 16:04:16', '2018-07-24 16:04:16'),
(63, 1, 1, 1, 1, 1, 2, 17, '2018-07-24 16:04:16', '2018-07-24 16:04:16'),
(64, 1, 1, 1, 1, 1, 2, 23, '2018-07-24 16:04:16', '2018-07-24 16:04:16'),
(65, 1, 1, 1, 1, 1, 2, 18, '2018-07-24 16:04:16', '2018-07-24 16:04:16'),
(66, 0, 0, 0, 1, 1, 2, 4, '2018-07-24 16:04:16', '2018-07-24 16:04:16'),
(67, 1, 1, 1, 1, 1, 1, 14, '2018-07-24 16:10:01', '2018-07-24 16:10:01'),
(68, 1, 1, 1, 1, 1, 1, 24, '2018-07-24 16:10:01', '2018-07-24 16:10:01'),
(69, 1, 1, 1, 1, 1, 1, 13, '2018-07-24 16:10:01', '2018-07-24 16:10:01'),
(70, 1, 1, 1, 1, 1, 1, 19, '2018-07-24 16:10:01', '2018-07-24 16:10:01'),
(71, 1, 1, 1, 1, 1, 1, 21, '2018-07-24 16:10:01', '2018-07-24 16:10:01'),
(72, 1, 1, 1, 1, 1, 1, 22, '2018-07-24 16:10:01', '2018-07-24 16:10:01'),
(73, 1, 1, 1, 1, 1, 1, 16, '2018-07-24 16:10:01', '2018-07-24 16:10:01'),
(74, 1, 1, 1, 1, 1, 1, 20, '2018-07-24 16:10:01', '2018-07-24 16:10:01'),
(75, 1, 1, 1, 1, 1, 1, 15, '2018-07-24 16:10:01', '2018-07-24 16:10:01'),
(76, 1, 1, 1, 1, 1, 1, 17, '2018-07-24 16:10:01', '2018-07-24 16:10:01'),
(77, 1, 1, 1, 1, 1, 1, 23, '2018-07-24 16:10:01', '2018-07-24 16:10:01'),
(78, 1, 1, 1, 1, 1, 1, 18, '2018-07-24 16:10:01', '2018-07-24 16:10:01'),
(79, 1, 1, 1, 1, 1, 1, 4, '2018-07-24 16:10:01', '2018-07-24 16:10:01');
-- --------------------------------------------------------
--
-- Table structure for table `cms_settings`
--
CREATE TABLE `cms_settings` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`content` text COLLATE utf8mb4_unicode_ci,
`content_input_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`dataenum` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`helper` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`group_setting` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `cms_settings`
--
INSERT INTO `cms_settings` (`id`, `name`, `content`, `content_input_type`, `dataenum`, `helper`, `created_at`, `updated_at`, `group_setting`, `label`) VALUES
(1, 'login_background_color', NULL, 'text', NULL, 'Input hexacode', '2018-07-17 14:21:18', NULL, 'Login Register Style', 'Login Background Color'),
(2, 'login_font_color', NULL, 'text', NULL, 'Input hexacode', '2018-07-17 14:21:18', NULL, 'Login Register Style', 'Login Font Color'),
(3, 'login_background_image', NULL, 'upload_image', NULL, NULL, '2018-07-17 14:21:18', NULL, 'Login Register Style', 'Login Background Image'),
(4, 'email_sender', 'support@academicnwu.com', 'text', NULL, NULL, '2018-07-17 14:21:18', NULL, 'Email Setting', 'Email Sender'),
(5, 'smtp_driver', 'mail', 'select', 'smtp,mail,sendmail', NULL, '2018-07-17 14:21:18', NULL, 'Email Setting', 'Mail Driver'),
(6, 'smtp_host', '', 'text', NULL, NULL, '2018-07-17 14:21:18', NULL, 'Email Setting', 'SMTP Host'),
(7, 'smtp_port', '25', 'text', NULL, 'default 25', '2018-07-17 14:21:18', NULL, 'Email Setting', 'SMTP Port'),
(8, 'smtp_username', '', 'text', NULL, NULL, '2018-07-17 14:21:18', NULL, 'Email Setting', 'SMTP Username'),
(9, 'smtp_password', '', 'text', NULL, NULL, '2018-07-17 14:21:18', NULL, 'Email Setting', 'SMTP Password'),
(10, 'appname', 'Academic NWU', 'text', NULL, NULL, '2018-07-17 14:21:18', NULL, 'Application Setting', 'Application Name'),
(11, 'default_paper_size', 'Legal', 'text', NULL, 'Paper size, ex : A4, Legal, etc', '2018-07-17 14:21:18', NULL, 'Application Setting', 'Default Paper Print Size'),
(12, 'logo', NULL, 'upload_image', NULL, NULL, '2018-07-17 14:21:18', NULL, 'Application Setting', 'Logo'),
(13, 'favicon', NULL, 'upload_image', NULL, NULL, '2018-07-17 14:21:18', NULL, 'Application Setting', 'Favicon'),
(14, 'api_debug_mode', 'true', 'select', 'true,false', NULL, '2018-07-17 14:21:18', NULL, 'Application Setting', 'API Debug Mode'),
(15, 'google_api_key', NULL, 'text', NULL, NULL, '2018-07-17 14:21:18', NULL, 'Application Setting', 'Google API Key'),
(16, 'google_fcm_key', NULL, 'text', NULL, NULL, '2018-07-17 14:21:18', NULL, 'Application Setting', 'Google FCM Key');
-- --------------------------------------------------------
--
-- Table structure for table `cms_statistics`
--
CREATE TABLE `cms_statistics` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`slug` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `cms_statistic_components`
--
CREATE TABLE `cms_statistic_components` (
`id` int(10) UNSIGNED NOT NULL,
`id_cms_statistics` int(11) DEFAULT NULL,
`componentID` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`component_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`area_name` varchar(55) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`sorting` int(11) DEFAULT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`config` longtext COLLATE utf8mb4_unicode_ci,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `cms_users`
--
CREATE TABLE `cms_users` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`photo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`contact` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`birth_date` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`dept_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`position` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`last_institute` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`note` text COLLATE utf8mb4_unicode_ci,
`id_cms_privileges` int(11) NOT NULL DEFAULT '2',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`status` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT '0',
`varifyToken` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `cms_users`
--
INSERT INTO `cms_users` (`id`, `name`, `photo`, `email`, `password`, `contact`, `birth_date`, `address`, `dept_name`, `position`, `last_institute`, `note`, `id_cms_privileges`, `created_at`, `updated_at`, `status`, `varifyToken`) VALUES
(1, 'Shariful Islam', 'uploads/1/2018-07/my.jpg', 'admin@crudbooster.com', '$2y$10$NFM1qAYEdwkSf.zxgxUOZ.6e3DrI0VIpY6Hab5OvM4l9xZJTT0DDC', '01969516501', '1981-02-03', '15/1 , Nirala , Khulna, Bangladesh', '1', '3', 'Khulna University', 'The world is very beutiful', 1, '2018-07-17 14:21:17', '2018-07-22 12:12:15', 'Active', '1'),
(2, 'Editor', 'uploads/1/2018-07/images.png', 'editor@gmail.com', '$2y$10$GEmkE8m9fEImGV2ye7efQe49lcdMc95n40AT4TUbaW3yEDIaSarEC', '01969516502', '', '', '1', '2', '', NULL, 2, '2018-07-17 21:31:33', '2018-07-17 23:03:14', 'Active', '1'),
(3, 'Kamal', 'uploads/3/2018-07/koala.jpg', 'kamal@gmail.com', '$2y$10$5zFqEpAJjsoX2ygt6tpAQOe5kX8VSI56CZfWf.etggvaCbgsAwT6y', '019310393385', '1983-07-13', 'Nirala Khulna', '2', '3', 'Khulna University, Khulna.', 'I love my country Bangladesh.', 2, '2018-07-17 21:36:43', '2018-07-19 22:05:53', 'Active', '1'),
(14, 'Momen Ali', ' \r\nuploads/1/2018-07/images.png', 'momen@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '01955454545', '1983-07-13', NULL, '1', '4', 'Khulna University', NULL, 2, '2018-07-18 01:42:34', '2018-07-18 01:43:37', 'Active', '1'),
(16, 'Bismillah', 'uploads/1/2018-07/images.png', 'bis@gmail.com', '$2y$10$vBsWhczgGDHm2dhTICVbseXOQIikiZqSItxlp/qWMBYf5Iq9XxxJO', '01952525252', '1982-07-20', NULL, '3', '3', 'Khulna University', NULL, 2, '2018-07-19 22:38:29', '2018-07-19 22:39:02', 'Active', '1'),
(17, 'Morshad Alom', 'images/profile.jpg', 'final@gmail.com', '$2y$10$2f5FxLsCcdcQCvCIjDyrxe9FY0ffenBNPRwuM8flcfvE4lH0udqrG', '01999999999', '1983-07-20', NULL, '4', '5', 'KUET', NULL, 2, '2018-07-19 22:54:19', '2018-07-19 22:54:19', 'Active', '1'),
(18, 'again', 'uploads/18/2018-07/hydrangeas.jpg', 'again@gmail.com', '$2y$10$b.Mt481CA4PcaAEgvQD30.4ji1rwbkkRs6XA1eertmCqDxjRJudeO', '01956565656', '1955-07-21', 'Nirala Khulna', '3', '3', 'Khulna Universitysdfasdf', 'somethingasdfasdfasdfasdfasd', 2, '2018-07-19 22:58:49', '2018-07-19 23:03:31', 'Active', '1'),
(19, 'Sojib Khan', 'uploads/19/2018-07/tulips.jpg', 'sojib@gmail.com', '$2y$10$9loRciNgvAepkBo1GhEBF.lRgIbYTvuTl86Gz8VOxR5k9scMAlxli', '01969696969', '1965-03-31', '15/1 , Nirala , Khulna, Bangladesh', '2', '3', 'Khulna University', 'The world is very beutiful', 2, '2018-07-22 09:41:52', '2018-07-23 23:15:37', 'Active', '1'),
(20, 'Md Mijanur Rahaman', 'images/profile.jpg', 'mijanur@gmail.com', '$2y$10$Dh5jLCo/H9arRZffr657o.Z6EQTCpmax2LMyY2o3OYVFUG6LNLHJO', '01969516522', '1983-12-31', NULL, '2', '3', 'Bangladesh University', NULL, 2, '2018-07-24 22:17:03', '2018-07-24 22:26:27', 'Active', '1'),
(21, 'Rony Adikari', 'images/profile.jpg', 'rony@gmail.com', '$2y$10$lr6J2MaMIwFUpgxXh0DLF.U6lSINN/rdVT96yJXGMEjJ5Ga2RfxEC', '01969696969', '2083-12-31', NULL, '4', '3', 'Khulna University, Khulna.', NULL, 2, '2018-07-24 22:43:15', '2018-07-24 22:43:57', 'Active', '1');
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2018_07_11_041832_create_tbl_profiles', 1),
(2, '2018_07_11_043202_create_tbl_projects', 2),
(3, '2018_07_11_043552_create_tbl_gallerys', 3),
(4, '2018_07_11_044101_create_tbl_interests', 4),
(5, '2018_07_11_044308_create_tbl_socials', 5),
(6, '2018_07_11_044415_create_tbl_sections', 5),
(7, '2018_07_11_044449_create_tbl_securitys', 5),
(8, '2018_07_11_060031_create_tbl_awards', 6),
(9, '2018_07_12_035618_create_tbl_researchs', 7),
(10, '2018_07_12_053525_create_tbl_educations', 8),
(11, '2018_07_12_053845_create_tbl_awards', 9),
(12, '2018_07_12_054107_create_tbl_contacts', 10),
(13, '2018_07_12_054216_create_tbl_trainings', 10),
(14, '2018_07_12_060823_create_tbl_expriences', 11),
(15, '2018_07_12_061045_create_tbl_publications', 12),
(16, '2018_07_14_095456_create_tbl_positions', 13),
(17, '2018_07_14_104352_create_tbl_courses', 14),
(18, '2018_07_14_104756_create_tbl_coursetypes', 15),
(19, '2016_08_07_145904_add_table_cms_apicustom', 16),
(20, '2016_08_07_150834_add_table_cms_dashboard', 16),
(21, '2016_08_07_151210_add_table_cms_logs', 16),
(22, '2016_08_07_151211_add_details_cms_logs', 16),
(23, '2016_08_07_152014_add_table_cms_privileges', 16),
(24, '2016_08_07_152214_add_table_cms_privileges_roles', 16),
(25, '2016_08_07_152320_add_table_cms_settings', 16),
(26, '2016_08_07_152421_add_table_cms_users', 16),
(27, '2016_08_07_154624_add_table_cms_menus_privileges', 16),
(28, '2016_08_07_154624_add_table_cms_moduls', 16),
(29, '2016_08_17_225409_add_status_cms_users', 16),
(30, '2016_08_20_125418_add_table_cms_notifications', 16),
(31, '2016_09_04_033706_add_table_cms_email_queues', 16),
(32, '2016_09_16_035347_add_group_setting', 16),
(33, '2016_09_16_045425_add_label_setting', 16),
(34, '2016_09_17_104728_create_nullable_cms_apicustom', 16),
(35, '2016_10_01_141740_add_method_type_apicustom', 16),
(36, '2016_10_01_141846_add_parameters_apicustom', 16),
(37, '2016_10_01_141934_add_responses_apicustom', 16),
(38, '2016_10_01_144826_add_table_apikey', 16),
(39, '2016_11_14_141657_create_cms_menus', 16),
(40, '2016_11_15_132350_create_cms_email_templates', 16),
(41, '2016_11_15_190410_create_cms_statistics', 16),
(42, '2016_11_17_102740_create_cms_statistic_components', 16),
(43, '2017_06_06_164501_add_deleted_at_cms_moduls', 16);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_awards`
--
CREATE TABLE `tbl_awards` (
`id` int(10) UNSIGNED NOT NULL,
`awr_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`awr_year` int(11) NOT NULL,
`awr_desc` text COLLATE utf8mb4_unicode_ci NOT NULL,
`awr_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`awr_date` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`awr_teacher_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tbl_awards`
--
INSERT INTO `tbl_awards` (`id`, `awr_name`, `awr_year`, `awr_desc`, `awr_by`, `awr_date`, `awr_teacher_id`, `created_at`, `updated_at`) VALUES
(1, 'Distinguished Scientific', 2015, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed egestas dapibus lectus non dignissim. Pellentesque auctor ornare urna, volutpat condimentum quam porttitor at. Vestibulum tincidunt diam in eros aliquam luctus. Donec sagittis a purus a porttitor. Sed non feugiat enim. Donec eget metus erat. Vivamus sed consequat orci. <a href=\"http://themeforest.net/item/faculty-responsive-academic-wordpress-theme/6817161\" target=\"_blank\">Aenean</a> commodo lectus sed purus auctor ullamcorper.', 'BTCL', '12/12/2015', 14, NULL, '2018-07-20 00:46:11'),
(2, 'Building Innovative Brands', 1017, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed egestas dapibus lectus non dignissim. Pellentesque auctor ornare urna, volutpat condimentum quam porttitor at. Vestibulum tincidunt diam in eros aliquam luctus. Donec sagittis a purus a porttitor. Sed non feugiat enim. Donec eget metus erat. Vivamus sed consequat orci. <a href=\"http://themeforest.net/item/faculty-responsive-academic-wordpress-theme/6817161\" target=\"_blank\">Aenean</a> commodo lectus sed purus auctor ullamcorper.', 'Bangladesh Goverment', '12/12/2017', 2, NULL, '2018-07-20 00:45:55'),
(3, 'BCB Technical support', 2017, '<p><strong style=\"margin: 0px; padding: 0px; font-family: "Open Sans", Arial, sans-serif; text-align: justify;\">Lorem Ipsum</strong><span style=\"font-family: "Open Sans", Arial, sans-serif; text-align: justify;\"> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</span><br></p>', 'KDA', '2017-05-25', 18, '2018-07-20 00:53:22', NULL),
(4, 'Educations', 2018, '<p>kahdfk alkdfj hadsf asdf</p>', 'NWU', '2018-07-05', 18, '2018-07-20 14:39:35', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_contacts`
--
CREATE TABLE `tbl_contacts` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`message` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`teacher_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tbl_contacts`
--
INSERT INTO `tbl_contacts` (`id`, `name`, `number`, `email`, `message`, `teacher_id`, `created_at`, `updated_at`) VALUES
(1, 'Md.Nazmul Hossain', '1931039338', 'csenazmul96@gmail.com', 'Hello ', 25, NULL, NULL),
(2, 'MD.NAZMUL HOSSAIN', '2', 'nadia@gmail.com', 'f', 25, NULL, NULL),
(3, 'MD.NAZMUL HOSSAIN', '2323', 'kamal@gmail.com', 'sdf', 25, NULL, NULL),
(4, 'MD.NAZMUL HOSSAIN', '2323', 'kamal@gmail.com', 'sdf', 25, NULL, NULL),
(5, 'MD.NAZMUL HOSSAIN', '3242343', 'kamal@gmail.com', 'fdsf', 25, NULL, NULL),
(6, 'MD.NAZMUL HOSSAIN', '345435645', 'sanazmul5@gmail.com', 'efdsfdsfdsf', 25, NULL, NULL),
(7, 'MD.NAZMUL HOSSAIN', '23', 'sanazmul5@gmail.com', 'dfgvxcv', 25, NULL, NULL),
(8, 'MD.NAZMUL HOSSAIN', '23', 'kamal@gmail.com', 'dfg', 25, NULL, NULL),
(9, 'MD.NAZMUL HOSSAIN', '234', 'kamal@gmail.com', 'sefsd', 27, NULL, NULL),
(10, 'MD.NAZMUL HOSSAIN', '34', 'nadia@gmail.com', 'efsdf', 25, NULL, NULL),
(11, 'ooooooo', '12345678911', 'sanazmul5@gmail.com', 'ertert', 25, NULL, NULL),
(12, 'MD.NAZMUL HOSSAIN', '3432432', 'kamal@gmail.com', 'scxcxc', 25, NULL, NULL),
(13, 'MD.NAZMUL HOSSAIN', '324234', 'kamal@gmail.com', 'wefsdfsd', 27, NULL, NULL),
(14, 'Kamal', '01969516500', 'kamal@gmail.com', 'asdf asdfa sdf', 20, NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_courses`
--
CREATE TABLE `tbl_courses` (
`course_id` int(10) UNSIGNED NOT NULL,
`course_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`course_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`program` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`course_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`course_desc` text COLLATE utf8mb4_unicode_ci NOT NULL,
`teacher_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tbl_courses`
--
INSERT INTO `tbl_courses` (`course_id`, `course_name`, `course_code`, `program`, `course_type`, `course_desc`, `teacher_id`, `created_at`, `updated_at`) VALUES
(1, 'Numerical Analysis', 'CSE-2201', 'CSE 3y', 'Lab Course', 'Round robin', 2, NULL, NULL),
(2, 'Networking', 'cse-3101', 'CSE-4y', 'Theory', 'Routing', 2, NULL, NULL),
(3, 'Mathmetic', 'cse-2102', 'CIVIL 3y', 'Lab Course', 'Matrix', 2, NULL, NULL),
(4, 'Data analysis and design', 'CSE-3303', 'CSE 4y', 'Lab Course', 'Algorithm', 2, NULL, NULL),
(5, 'Arithmetic 2 ', 'CSE-3302', 'CSE-3y', 'Theory', 'tristique risus consequat. Donec tincidunt mi a magna rhoncus dapibus. Integer ut lectus euismod', 1, NULL, NULL),
(6, 'English', 'CIVIL-3302', 'CIVIL 4y', 'Theory', 'tristique risus consequat. Donec tincidunt mi a magna rhoncus dapibus. Integer ut lectus euismod', 1, NULL, NULL),
(7, 'Arithmetic 2 ', 'CSE-3302', 'CSE-3y', 'Theory', 'tristique risus consequat. Donec tincidunt mi a magna rhoncus dapibus. Integer ut lectus euismod', 1, NULL, NULL),
(8, 'English', 'CIVIL-3302', 'CIVIL 4y', 'Theory', 'tristique risus consequat. Donec tincidunt mi a magna rhoncus dapibus. Integer ut lectus euismod', 1, NULL, NULL),
(9, 'Arithmetic 2 ', 'CSE-3302', 'CSE-3y', 'Theory', 'tristique risus consequat. Donec tincidunt mi a magna rhoncus dapibus. Integer ut lectus euismod', 1, NULL, NULL),
(10, 'English', 'CIVIL-3302', 'CIVIL 4y', 'Theory', 'tristique risus consequat. Donec tincidunt mi a magna rhoncus dapibus. Integer ut lectus euismod', 1, NULL, NULL),
(11, 'Arithmetic 2 ', 'CSE-3302', 'CSE-3y', 'Theory', 'tristique risus consequat. Donec tincidunt mi a magna rhoncus dapibus. Integer ut lectus euismod', 3, NULL, NULL),
(12, 'Data Structure', 'CSE-2201', 'CSE-4y', 'Lab', 'tristique risus consequat. Donec tincidunt mi a magna rhoncus dapibus. Integer ut lectus euismod', 3, NULL, NULL),
(13, 'English', 'CIVIL-3302', 'CIVIL 4y', 'Theory', 'tristique risus consequat. Donec tincidunt mi a magna rhoncus dapibus. Integer ut lectus euismod', 3, NULL, NULL),
(14, 'Arithmetic 2 ', 'CSE-3302', 'CSE-3y', 'Theory', 'tristique risus consequat. Donec tincidunt mi a magna rhoncus dapibus. Integer ut lectus euismod', 3, NULL, NULL),
(15, 'Data Structure', 'CSE-2201', 'CSE-4y', 'Lab', 'tristique risus consequat. Donec tincidunt mi a magna rhoncus dapibus. Integer ut lectus euismod', 3, NULL, NULL),
(16, 'English', 'CIVIL-3302', 'CIVIL 4y', 'Theory', 'tristique risus consequat. Donec tincidunt mi a magna rhoncus dapibus. Integer ut lectus euismod', 3, NULL, NULL),
(17, 'Algorithm', 'CSE 3301', 'CSE 4Y', 'Theory Course', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.', 1, '2018-07-23 22:23:52', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_department`
--
CREATE TABLE `tbl_department` (
`id` int(11) NOT NULL,
`department` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_department`
--
INSERT INTO `tbl_department` (`id`, `department`) VALUES
(1, 'Computer Science & Engineering'),
(2, 'Electrical & Electronic Engineering'),
(3, 'MBA'),
(4, 'BBA'),
(5, 'Civil Engineering'),
(6, 'English Department');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_educations`
--
CREATE TABLE `tbl_educations` (
`id` int(10) UNSIGNED NOT NULL,
`edu_degree` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`edu_board` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`edu_pass_year` int(11) NOT NULL,
`edu_gpa` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`edu_subject` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`edu_teacher_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tbl_educations`
--
INSERT INTO `tbl_educations` (`id`, `edu_degree`, `edu_board`, `edu_pass_year`, `edu_gpa`, `edu_subject`, `edu_teacher_id`, `created_at`, `updated_at`) VALUES
(1, 'SSC', 'Jessore', 2009, '3.31', 'Business', 1, NULL, NULL),
(2, 'Diploma in engineering', 'Technical', 2013, '3.35', 'Business', 2, NULL, NULL),
(3, 'S.S.C', 'Jessore', 2009, '4.30', 'Science', 2, NULL, NULL),
(4, 'H.S.C', 'Jessore', 2011, '4.50', 'Science', 3, NULL, NULL),
(5, 'S.S.C', 'Jessore', 2009, '4.30', 'Science', 2, NULL, NULL),
(6, 'B.S.C', 'KUET', 2011, '3.50', 'CSE', 2, NULL, NULL),
(7, 'H.S.C', 'Jessore', 2009, '4.30', 'Science', 14, NULL, NULL),
(8, 'M.S.C', 'Khulna University', 2011, '3.50', 'EEE', 18, NULL, NULL),
(9, 'S.S.C', 'Jessore', 2009, '4.30', 'Science', 16, NULL, NULL),
(10, 'B.S.C', 'KUET', 2011, '3.50', 'CSE', 16, NULL, NULL),
(11, 'S.S.C', 'Jessore', 2009, '4.30', 'Science', 18, NULL, NULL),
(12, 'M.S.C', 'Khulna University', 2011, '3.50', 'EEE', 18, NULL, NULL),
(13, 'S.S.C', 'Jessore', 2009, '4.30', 'Science', 2, NULL, NULL),
(14, 'B.S.C', 'KUET', 2011, '3.50', 'CSE', 3, NULL, NULL),
(15, 'S.S.C', 'Jessore', 2009, '4.30', 'Science', 3, NULL, NULL),
(16, 'M.S.C', 'Khulna University', 2011, '3.50', 'EEE', 1, NULL, NULL),
(17, 'S.S.C', 'Jessore', 2009, '4.30', 'Science', 1, NULL, NULL),
(18, 'B.S.C', 'KUET', 2011, '3.50', 'CSE', 16, NULL, NULL),
(19, 'H.S.C', 'Jessore', 2009, '4.30', 'Science', 18, NULL, NULL),
(20, 'M.S.C', 'Khulna University', 2011, '3.50', 'EEE', 16, NULL, NULL),
(21, 'S.S.C', 'Jessore', 2009, '4.30', 'Science', 3, NULL, NULL),
(22, 'B.S.C', 'KUET', 2011, '3.50', 'CSE', 3, NULL, NULL),
(23, 'S.S.C', 'Jessore', 2009, '4.30', 'Science', 1, NULL, NULL),
(24, 'M.S.C', 'Khulna University', 2011, '3.50', 'EEE', 1, NULL, NULL),
(25, 'SSC', 'Jessore', 2009, '3.38 out of (5.00)', 'Business', 1, '2018-07-22 14:05:44', NULL),
(26, 'SSC', 'Jessore', 2009, '3.38 out of (5.00)', 'Business', 20, '2018-07-24 23:05:37', NULL),
(27, 'Diploma In Engineering', 'BTEB', 2013, '3.71 out of (4.00)', 'Computer Technology', 20, '2018-07-24 23:06:48', NULL),
(28, 'B.SC.', 'North Western University', 2018, '3.91 out of (4.00)', 'Computer Science and Engineering', 20, '2018-07-24 23:08:35', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_expriences`
--
CREATE TABLE `tbl_expriences` (
`id` int(10) UNSIGNED NOT NULL,
`exp_company_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`exp_post_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`exp_strt_date` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`exp_end_date` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`exp_teacher_id` int(11) NOT NULL,
`exp_desc` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`exp_department` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tbl_expriences`
--
INSERT INTO `tbl_expriences` (`id`, `exp_company_name`, `exp_post_name`, `exp_strt_date`, `exp_end_date`, `exp_teacher_id`, `exp_desc`, `exp_department`, `created_at`, `updated_at`) VALUES
(1, 'BRWSSP', 'Data Processing Operator', 'Feb/2015', 'Jan/2017', 2, 'Good Job', 'CSE', NULL, NULL),
(2, 'Akij Group of Industry', 'Assistant programmers', 'Jan-2012', 'Continue', 2, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'CSE', NULL, NULL),
(3, 'City Medical College ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 2, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(4, 'Akij Group of Industry', 'Assistant programmers', 'Jan-2012', 'Continue', 3, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'CSE', NULL, NULL),
(5, 'City Medical College ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 2, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(6, 'Amzed Fish Feed LTD ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 16, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(7, 'Star Jut Mils LTD ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 17, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(8, 'Akij Group of Industry', 'Assistant programmers', 'Jan-2012', 'Continue', 18, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'CSE', NULL, NULL),
(9, 'City Medical College ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 17, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(10, 'Amzed Fish Feed LTD ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 19, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(11, 'Star Jut Mils LTD ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 14, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(12, 'Akij Group of Industry', 'Assistant programmers', 'Jan-2012', 'Continue', 14, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'CSE', NULL, NULL),
(13, 'City Medical College ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 19, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(14, 'Amzed Fish Feed LTD ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 19, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(15, 'Star Jut Mils LTD ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 3, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(16, 'Akij Group of Industry', 'Assistant programmers', 'Jan-2012', 'Continue', 3, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'CSE', NULL, NULL),
(17, 'City Medical College ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 14, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(18, 'Amzed Fish Feed LTD ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 3, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(19, 'City Medical College ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 1, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(20, 'Amzed Fish Feed LTD ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 1, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(21, 'Star Jut Mils LTD ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 1, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(22, 'Akij Group of Industry', 'Assistant programmers', 'Jan-2012', 'Continue', 3, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'CSE', NULL, NULL),
(23, 'City Medical College ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 3, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(24, 'Amzed Fish Feed LTD ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 2, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(25, 'Star Jut Mils LTD ', 'Executive IT officer', 'Jun-2009', 'Jan-2012', 2, 'sodales tincidunt lorem sit amet, vestibulum commodo tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tempor ex sed iaculis vulputate.', 'IT', NULL, NULL),
(26, 'BRAC', 'Computer Operator', 'May - 2011', 'Continue', 1, '<p>sodales tincidunt lorem sit amet, vestibulum commodo tortor. </p><p>sodales tincidunt lorem sit amet, vestibulum commodo tortor. sodales tincidunt lorem sit amet, vestibulum commodo tortor. sodales tincidunt lorem sit amet, vestibulum commodo tortor. sodales tincidunt lorem sit amet, vestibulum commodo tortor. sodales tincidunt lorem sit amet, vestibulum commodo tortor. sodales tincidunt lorem sit amet, vestibulum commodo tortor. sodales tincidunt lorem sit amet, vestibulum commodo tortor. sodales tincidunt lorem sit amet, vestibulum commodo tortor. sodales tincidunt lorem sit amet, vestibulum commodo tortor. sodales tincidunt lorem sit amet, vestibulum commodo tortor. sodales tincidunt lorem sit amet, vestibulum commodo tortor. sodales tincidunt lorem sit amet, vestibulum commodo tortor. <br></p>', 'Social', '2018-07-23 21:29:41', '2018-07-23 14:29:41'),
(27, 'Somaj Unnayan Songstha', 'Computer Operator', 'March 2011', 'August 2013', 20, '<p><strong style=\"margin: 0px; padding: 0px; font-family: \"Open Sans\", Arial, sans-serif; text-align: justify;\">Lorem Ipsum</strong><span style=\"font-family: \"Open Sans\", Arial, sans-serif; text-align: justify;\"> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</span><br></p>', '', '2018-07-24 23:19:29', '2018-07-24 23:20:07'),
(28, 'NGO', 'Data entry oparator', 'February 2015', 'Continue', 20, '<p><strong style=\"margin: 0px; padding: 0px; font-family: "Open Sans", Arial, sans-serif; text-align: justify;\">Lorem Ipsum</strong><span style=\"font-family: "Open Sans", Arial, sans-serif; text-align: justify;\"> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</span><br></p>', '', '2018-07-24 23:21:06', '2018-07-24 16:21:06');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_gallerys`
--
CREATE TABLE `tbl_gallerys` (
`id` int(10) UNSIGNED NOT NULL,
`glry_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`glry_cover` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`teacher_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tbl_gallerys`
--
INSERT INTO `tbl_gallerys` (`id`, `glry_name`, `glry_cover`, `teacher_id`, `created_at`, `updated_at`) VALUES
(1, 'asdfasdf', 'uploads/1/2018-07/cover1.jpg', 1, '2018-07-23 22:04:54', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_interests`
--
CREATE TABLE `tbl_interests` (
`id` int(10) UNSIGNED NOT NULL,
`inst_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`teacher_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tbl_interests`
--
INSERT INTO `tbl_interests` (`id`, `inst_name`, `teacher_id`, `created_at`, `updated_at`) VALUES
(1, 'Time, Money and Happiness', 2, NULL, NULL),
(2, 'Building Innovative Brands', 18, NULL, NULL),
(3, 'Cricket', 14, NULL, NULL),
(4, 'Football', 2, NULL, NULL),
(5, 'Asian Game', 14, NULL, NULL),
(6, 'Long Tour', 18, NULL, NULL),
(7, 'Band Music', 2, NULL, NULL),
(8, 'Programming', 3, NULL, NULL),
(9, 'Asian Game', 2, NULL, NULL),
(10, 'Long Tour', 3, NULL, NULL),
(11, 'Band Music', 3, NULL, NULL),
(12, 'Programming', 2, NULL, NULL),
(13, 'Asian Game', 14, NULL, NULL),
(14, 'Long Tour', 18, NULL, NULL),
(15, 'Band Music', 18, NULL, NULL),
(16, 'Programming', 14, NULL, NULL),
(17, 'Asian Game', 16, NULL, NULL),
(18, 'Long Tour', 18, NULL, NULL),
(19, 'Band Music', 14, NULL, NULL),
(20, 'Programming', 16, NULL, NULL),
(21, 'Asian Game', 16, NULL, NULL),
(22, 'Long Tour', 1, NULL, NULL),
(23, 'Band Music', 1, NULL, NULL),
(24, 'Programming', 1, NULL, NULL),
(25, 'Asian Game', 16, NULL, NULL),
(29, 'Python', 1, '2018-07-22 13:26:37', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_positions`
--
CREATE TABLE `tbl_positions` (
`id` int(10) UNSIGNED NOT NULL,
`pos_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tbl_positions`
--
INSERT INTO `tbl_positions` (`id`, `pos_name`, `created_at`, `updated_at`) VALUES
(1, 'Lecturer', NULL, NULL),
(2, 'Senior Lecturer', NULL, NULL),
(3, 'Assistant Professor', NULL, NULL),
(4, 'Associate Professor', NULL, NULL),
(5, 'Professor', NULL, NULL),
(6, 'Research Assistant', NULL, NULL),
(7, 'Researcher', NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_profiles`
--
CREATE TABLE `tbl_profiles` (
`teacher_id` int(10) UNSIGNED NOT NULL,
`fullname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`birth_date` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`dept_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`position` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`contact` int(11) NOT NULL,
`last_institute` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`note` text COLLATE utf8mb4_unicode_ci,
`status` int(11) NOT NULL DEFAULT '0',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tbl_profiles`
--
INSERT INTO `tbl_profiles` (`teacher_id`, `fullname`, `image`, `birth_date`, `password`, `email`, `address`, `dept_name`, `position`, `contact`, `last_institute`, `note`, `status`, `created_at`, `updated_at`) VALUES
(26, 'Raton Kumer Mondal', 'public/uploads/MsV84M9mx2parBcq2gSO.jpg', '2018-07-01', 'e10adc3949ba59abbe56e057f20f883e', 'nadia@gmail.com', NULL, 'CSE', 'Teacher', 234234, 'North Western University', '<p><span style=\"color: #000000;\">A social psychologist and marketer, Jennifer Doe is the General Atlantic Professor of Marketing and Ormond Family Faculty at Stanford University’s Graduate School of Business. Her research spans time, money and happiness. She focuses on questions such as: What actually makes people happy, as opposed to what they think makes them happy?</span></p>\r\n <p><span style=\"color: #000000;\">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor.sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</span></p>', 1, NULL, NULL),
(25, 'Md.Shariful Islam', 'public/uploads/1GhNJqZSCLEZnjQJxz2T.jpg', '2018-07-04', 'e10adc3949ba59abbe56e057f20f883e', 'csenazmul96@gmail.com', NULL, 'CSE', 'Teacher', 123456, 'North Western University', '<p><span style=\"color: #000000;\">A social psychologist and marketer, Jennifer Doe is the General Atlantic Professor of Marketing and Ormond Family Faculty at Stanford University’s Graduate School of Business. Her research spans time, money and happiness. She focuses on questions such as: What actually makes people happy, as opposed to what they think makes them happy?</span></p>\r\n <p><span style=\"color: #000000;\">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor.sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</span></p>', 1, NULL, NULL),
(27, 'Md.Maruf Sheikh', 'public/uploads/lab4.jpg', '02/07/1994', 'e10adc3949ba59abbe56e057f20f883e', 'maruf@gmail.com', 'alaipur', 'CIVIL', 'ASSISTANT Lecturer', 1993395874, 'KUET', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent vel tortor facilisis, volutpat nulla placerat, tincidunt mi. Nullam vel orc', 0, NULL, NULL),
(28, 'Rita islam', 'public/uploads/girl-437989_1920-150x150.jpg', '9/12/1990', 'e10adc3949ba59abbe56e057f20f883e', 'rita@gmail.com', 'Borobazar,khulna-9000', 'EEE', 'Professor', 1723345678, 'Khulna University', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent vel tortor facilisis, volutpat nulla placerat, tincidunt mi. Nullam vel orc', 0, NULL, NULL),
(29, 'Asma akther', 'public/uploads/1GhNJqZSCLEZnjQJxz2T.jpg', '3/6/1980', 'e10adc3949ba59abbe56e057f20f883e', 'asma@gmail.com', 'Khalishpur,khulna', 'CSE', 'Lecturer', 1912456789, 'North Western University', 'Nullam non nisi ut dolor pellentesque eleifend. Aliquam commodo vitae risus malesuada varius. Nulla ornare lacus eu elit sollicitudin varius. Nulla aliquet ornare massa id tempor. Sed luctus dui non turpis sodales, ac tristique risus consequat. Donec tincidunt mi a magna rhoncus dapibus. Integer ut lectus euismod', 1, NULL, NULL),
(30, 'Prinka Tarafder', 'public/uploads/woman-578429_1920-150x150.jpg', '12/12/1978', 'e10adc3949ba59abbe56e057f20f883e', 'prinka@gmail.com', 'Nirala,khulna', 'EEE', 'Lecturer', 1912456789, 'North Western University', 'Nullam non nisi ut dolor pellentesque eleifend. Aliquam commodo vitae risus malesuada varius. Nulla ornare lacus eu elit sollicitudin varius. Nulla aliquet ornare massa id tempor. Sed luctus dui non turpis sodales, ac tristique risus consequat. Donec tincidunt mi a magna rhoncus dapibus. Integer ut lectus euismod', 0, NULL, NULL),
(31, 'Paglu Khan', 'public/uploads/eGZHwsx8eWwmrSGRN3PQ.jpg', '1994-07-19', 'e10adc3949ba59abbe56e057f20f883e', 'paglu@gmail.com', NULL, 'CSE', 'Select Position', 1969516500, 'Khulna University', NULL, 0, NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_projects`
--
CREATE TABLE `tbl_projects` (
`id` int(10) UNSIGNED NOT NULL,
`pro_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`pro_cover` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`pro_start` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`pro_end` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`pro_desc` text COLLATE utf8mb4_unicode_ci NOT NULL,
`pro_shortdesc` text COLLATE utf8mb4_unicode_ci NOT NULL,
`teacher_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tbl_projects`
--
INSERT INTO `tbl_projects` (`id`, `pro_name`, `pro_cover`, `pro_start`, `pro_end`, `pro_desc`, `pro_shortdesc`, `teacher_id`, `created_at`, `updated_at`) VALUES
(1, 'BDCMS', 'uploads/18/2018-07/desert.jpg', 'January-2018', 'September-2018', '<p><strong style=\"margin: 0px; padding: 0px; font-family: "Open Sans", Arial, sans-serif; text-align: justify;\">Lorem Ipsum</strong><span style=\"font-family: "Open Sans", Arial, sans-serif; text-align: justify;\"> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum</span></p><p><strong style=\"margin: 0px; padding: 0px; font-family: "Open Sans", Arial, sans-serif; text-align: justify;\">Lorem Ipsum</strong><span style=\"font-family: "Open Sans", Arial, sans-serif; text-align: justify;\"> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</span><span style=\"font-family: "Open Sans", Arial, sans-serif; text-align: justify;\">.</span><br></p>', 'release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.', 18, '2018-07-20 14:21:18', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_publications`
--
CREATE TABLE `tbl_publications` (
`id` int(10) UNSIGNED NOT NULL,
`pub_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`pub_cover` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`pub_date` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`pub_teacher_id` int(11) NOT NULL,
`pub_way` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`pub_short_desc` text COLLATE utf8mb4_unicode_ci NOT NULL,
`pub_long_desc` text COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tbl_publications`
--
INSERT INTO `tbl_publications` (`id`, `pub_name`, `pub_cover`, `pub_date`, `pub_teacher_id`, `pub_way`, `pub_short_desc`, `pub_long_desc`, `created_at`, `updated_at`) VALUES
(1, 'Himu History', 'uploads/18/2018-07/jellyfish.jpg', '2018-03-21', 18, 'NWU', 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.', '<p style=\"margin-bottom: 15px; padding: 0px; text-align: justify; font-family: "Open Sans", Arial, sans-serif;\">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.</p><p style=\"margin-bottom: 15px; padding: 0px; text-align: justify; font-family: "Open Sans", Arial, sans-serif;\">The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from \"de Finibus Bonorum et Malorum\" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.</p>', '2018-07-20 14:58:35', '2018-07-20 07:58:35');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_researchs`
--
CREATE TABLE `tbl_researchs` (
`id` int(10) UNSIGNED NOT NULL,
`re_title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`re_desc` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`re_strt_date` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`re_end_date` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`re_team` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`org_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`teacher_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tbl_researchs`
--
INSERT INTO `tbl_researchs` (`id`, `re_title`, `re_desc`, `re_strt_date`, `re_end_date`, `re_team`, `org_name`, `teacher_id`, `created_at`, `updated_at`) VALUES
(1, 'Nullam non nisi ut dolor pellentesque eleifend', 'Recent trends in deep-submicron very large-scale integration (VLSI) circuit technology have resulted in new requirements for algorithms in integrated circuit layout. Much of my work centers on new formulations that capture performance and density criteria in the physical layout phases of computer-aided design (CAD). Our results include near-optimal approximation algorithms for such computationally difficult problems as minimum-cost Steiner tree routing, low-skew clock networks, cost-radius tradeoffs, bounded-density trees, circuit probe testing, high-performing Elmore-based constructions, layout density control, and improved manufacturability.', 'jun-2015', 'jun-2015', 'CSE-BDCMS', 'North Western University', 2, NULL, NULL),
(2, 'Educations', '<p>Recent trends in deep-submicron very large-scale integration (VLSI) circuit </p><p>Recent trends in deep-submicron very large-scale integration (VLSI) circuit Recent trends in deep-submicron very large-scale integration (VLSI) circuit Recent trends in deep-submicron very large-scale integration (VLSI) circuit Recent trends in deep-submicron very large-scale integration (VLSI) circuit Recent trends in deep-submicron very large-scale integration (VLSI) circuit Recent trends in deep-submicron very large-scale integration (VLSI) circuit Recent trends in deep-submicron very large-scale integration (VLSI) circuit Recent trends in deep-submicron very large-scale integration (VLSI) circuit Recent trends in deep-submicron very large-scale integration (VLSI) circuit <br></p>', 'May 2016', 'June 2017', '', 'NWU', 1, '2018-07-23 21:48:03', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_sections`
--
CREATE TABLE `tbl_sections` (
`id` int(10) UNSIGNED NOT NULL,
`home_note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`home_cover` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`public_cover` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`research_cover` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`project_cover` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`train_cover` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`gallary_cover` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`contact_cover` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`course_cover` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`teacher_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tbl_sections`
--
INSERT INTO `tbl_sections` (`id`, `home_note`, `home_cover`, `public_cover`, `research_cover`, `project_cover`, `train_cover`, `gallary_cover`, `contact_cover`, `course_cover`, `teacher_id`, `created_at`, `updated_at`) VALUES
(12, 'The best and most beautiful things in the world cannot be seen or even touched - they must be felt with the heart.', 'https://lorempixel.com/1201/500/', 'https://lorempixel.com/1200/501/', 'https://lorempixel.com/1202/500/', 'https://lorempixel.com/1200/502/', 'https://lorempixel.com/1203/500/', 'https://lorempixel.com/1200/503/', 'https://lorempixel.com/1204/500/', 'https://lorempixel.com/1200/504/', 17, NULL, NULL),
(11, 'The best and most beautiful things in the world cannot be seen or even touched - they must be felt with the heart.', 'https://lorempixel.com/1201/500/', 'https://lorempixel.com/1200/501/', 'https://lorempixel.com/1202/500/', 'https://lorempixel.com/1200/502/', 'https://lorempixel.com/1203/500/', 'https://lorempixel.com/1200/503/', 'https://lorempixel.com/1204/500/', 'https://lorempixel.com/1200/504/', 16, NULL, NULL),
(10, 'The best and most beautiful things in the world cannot be seen or even touched - they must be felt with the heart.', 'https://lorempixel.com/1201/500/', 'https://lorempixel.com/1200/501/', 'https://lorempixel.com/1202/500/', 'https://lorempixel.com/1200/502/', 'https://lorempixel.com/1203/500/', 'https://lorempixel.com/1200/503/', 'https://lorempixel.com/1204/500/', 'https://lorempixel.com/1200/504/', 2, NULL, NULL),
(8, 'The best and most beautiful things in the world cannot be seen or even touched - they must be felt with the heart.', 'https://lorempixel.com/1201/500/', 'https://lorempixel.com/1200/501/', 'https://lorempixel.com/1202/500/', 'https://lorempixel.com/1200/502/', 'https://lorempixel.com/1203/500/', 'https://lorempixel.com/1200/503/', 'https://lorempixel.com/1204/500/', 'https://lorempixel.com/1200/504/', 3, NULL, NULL),
(9, 'The best and most beautiful things in the world cannot be seen or even touched - they must be felt with the heart.', 'uploads/1/2018-07/cover1.jpg', 'uploads/1/2018-07/cover2.jpg', 'uploads/1/2018-07/cover3.jpg', 'uploads/1/2018-07/cover4.jpg', 'uploads/1/2018-07/cover5.jpg', 'uploads/1/2018-07/cover6.jpg', 'uploads/1/2018-07/cover7.jpg', 'uploads/1/2018-07/desktop_wallpaper_03.jpg', 1, NULL, '2018-07-23 21:56:43'),
(6, 'super admin note', 'uploads/3/2018-07/desktop_wallpaper_to_personalize_computer_high_wallpaper_hd_desktop.jpg', 'uploads/1/2018-07/cover1.jpg', NULL, 'uploads/1/2018-07/beautiful_and_elegant_hydrangeas_desktop_wallpaper_desktop_tzfb9yg.jpg', 'uploads/1/2018-07/desktop_wallpaper_green.jpg', 'uploads/1/2018-07/desktop_wallpaper_to_personalize_computer_high_wallpaper_hd_desktop.jpg', 'uploads/1/2018-07/desktop_wallpaper_03.jpg', 'uploads/1/2018-07/computer_desktop_wallpapers_3d.jpg', 18, '2018-07-18 17:45:59', '2018-07-19 01:04:59'),
(7, 'The best and most beautiful things in the world cannot be seen or even touched - they must be felt with the heart.', 'https://lorempixel.com/1201/500/', 'https://lorempixel.com/1200/501/', 'https://lorempixel.com/1202/500/', 'https://lorempixel.com/1200/502/', 'https://lorempixel.com/1203/500/', 'https://lorempixel.com/1200/503/', 'https://lorempixel.com/1204/500/', 'https://lorempixel.com/1200/504/', 14, NULL, NULL),
(13, 'The best and most beautiful things in the world cannot be seen or even touched - they must be felt with the heart.', 'https://lorempixel.com/1201/500/', 'https://lorempixel.com/1200/501/', 'https://lorempixel.com/1202/500/', 'https://lorempixel.com/1200/502/', 'https://lorempixel.com/1203/500/', 'https://lorempixel.com/1200/503/', 'https://lorempixel.com/1204/500/', 'https://lorempixel.com/1200/504/', 19, NULL, NULL),
(14, 'The best and most beautiful things in the world cannot be seen or even touched - they must be felt with the heart.', 'https://lorempixel.com/1201/500/', 'https://lorempixel.com/1200/501/', 'https://lorempixel.com/1202/500/', 'https://lorempixel.com/1200/502/', 'https://lorempixel.com/1203/500/', 'https://lorempixel.com/1200/503/', 'https://lorempixel.com/1204/500/', 'https://lorempixel.com/1200/504/', 20, NULL, NULL),
(15, 'The best and most beautiful things in the world cannot be seen or even touched - they must be felt with the heart.', 'https://lorempixel.com/1201/500/', 'https://lorempixel.com/1200/501/', 'https://lorempixel.com/1202/500/', 'https://lorempixel.com/1200/502/', 'https://lorempixel.com/1203/500/', 'https://lorempixel.com/1200/503/', 'https://lorempixel.com/1204/500/', 'https://lorempixel.com/1200/504/', 21, NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_securitys`
--
CREATE TABLE `tbl_securitys` (
`id` int(10) UNSIGNED NOT NULL,
`keyword` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tbl_securitys`
--
INSERT INTO `tbl_securitys` (`id`, `keyword`, `created_at`, `updated_at`) VALUES
(1, 'Bangladesh', NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_socials`
--
CREATE TABLE `tbl_socials` (
`id` int(10) UNSIGNED NOT NULL,
`facebook` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`twitter` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`linkedin` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`researchgate` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`teacher_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tbl_socials`
--
INSERT INTO `tbl_socials` (`id`, `facebook`, `twitter`, `linkedin`, `researchgate`, `teacher_id`, `created_at`, `updated_at`) VALUES
(1, 'http://www.facebook.com', 'http://www.twitter.com', 'http://www.linkedin.com', 'https://www.researchgate.net', 1, NULL, NULL),
(2, 'http://www.facebook.com/sojibuddin', 'http://www.twitter.com', 'http://www.linkedin.com', 'https://www.researchgate.net', 19, NULL, NULL),
(3, 'http://www.facebook.com/', 'http://www.twitter.com/', 'http://www.linkedin.com/', 'http://www.researchgate.com/', 2, NULL, NULL),
(4, 'http://www.facebook.com/', 'http://www.twitter.com/', 'http://www.linkedin.com/', 'http://www.researchgate.com/', 3, NULL, NULL),
(5, 'http://www.facebook.com/', 'http://www.twitter.com/', 'http://www.linkedin.com/', 'http://www.researchgate.com/', 16, NULL, NULL),
(6, 'http://www.facebook.com/', 'http://www.twitter.com/', 'http://www.linkedin.com/', 'http://www.researchgate.com/', 14, NULL, NULL),
(7, 'http://www.facebook.com/', 'http://www.twitter.com/', 'http://www.linkedin.com/', 'http://www.researchgate.com/', 17, NULL, NULL),
(8, 'http://www.facebook.com/', 'http://www.twitter.com/', 'http://www.linkedin.com/', 'http://www.researchgate.com/', 18, NULL, NULL),
(12, 'http://www.facebook.com', 'http://www.twitter.com', 'http://www.linkedin.com', 'https://www.researchgate.net', 21, NULL, NULL),
(11, 'http://www.facebook.com', 'http://www.twitter.com', 'http://www.linkedin.com', 'https://www.researchgate.net', 20, NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_trainings`
--
CREATE TABLE `tbl_trainings` (
`id` int(10) UNSIGNED NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`org_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`duration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`tropic` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`desc` text COLLATE utf8mb4_unicode_ci NOT NULL,
`strt_date` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`end_date` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`teacher_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `tbl_trainings`
--
INSERT INTO `tbl_trainings` (`id`, `title`, `org_name`, `duration`, `tropic`, `desc`, `strt_date`, `end_date`, `teacher_id`, `created_at`, `updated_at`) VALUES
(2, 'Lorem Isupm', 'BCTX', '3 Months', 'CCNA', '<p style=\"margin-bottom: 15px; padding: 0px; text-align: justify; font-family: "Open Sans", Arial, sans-serif;\">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.</p><p style=\"margin-bottom: 15px; padding: 0px; text-align: justify; font-family: "Open Sans", Arial, sans-serif;\">The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from \"de Finibus Bonorum et Malorum\" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.</p>', '2018-01-16 00:00:00', '2018-07-20 00:00:00', 18, '2018-07-20 17:16:30', '2018-07-20 10:16:30'),
(3, 'BRTA', 'BRAC', '3 Month', 'Programming', '<p style=\"margin: 0px 14.3906px 0px 28.7969px; padding: 0px; width: 436.797px; float: left; font-family: "Open Sans", Arial, sans-serif;\"></p><p style=\"text-align: justify; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; line-height: 24px; font-family: DauphinPlain; font-size: 24px;\"><strong style=\"margin: 0px; padding: 0px; font-family: "Open Sans", Arial, sans-serif; font-size: 14px;\">Lorem Ipsum</strong><span style=\"font-family: "Open Sans", Arial, sans-serif; font-size: 14px;\"><span class=\"Apple-converted-space\"> </span>is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</span></p><p style=\"text-align: justify; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding: 0px; line-height: 24px; font-family: DauphinPlain; font-size: 24px;\"><strong style=\"margin: 0px; padding: 0px; font-family: "Open Sans", Arial, sans-serif; font-size: 14px;\">Lorem Ipsum</strong><span style=\"font-family: "Open Sans", Arial, sans-serif; font-size: 14px;\"><span class=\"Apple-converted-space\"> </span>is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</span><span style=\"font-family: "Open Sans", Arial, sans-serif; font-size: 14px;\"><br></span><br></p>', '2018-07-11 00:00:00', '2018-09-12 00:00:00', 19, '2018-07-23 23:56:55', '2018-07-23 16:56:55'),
(1, 'CCNA', 'BTCL', '1 Year', 'CCNA', '<p><span style=\"color: rgb(51, 51, 51); font-family: \"Open Sans\", Arial, sans-serif; font-size: 12px; text-align: justify; background-color: rgb(245, 245, 245);\">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.</span></p><p><span style=\"color: rgb(51, 51, 51); font-family: \"Open Sans\", Arial, sans-serif; font-size: 12px; text-align: justify; background-color: rgb(245, 245, 245);\">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.</span><span style=\"color: rgb(51, 51, 51); font-family: \"Open Sans\", Arial, sans-serif; font-size: 12px; text-align: justify; background-color: rgb(245, 245, 245);\"><br></span><br></p>', '2016-08-07 00:00:00', '2017-08-07 00:00:00', 1, '2018-07-20 15:16:18', '2018-07-20 17:12:29');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `cms_apicustom`
--
ALTER TABLE `cms_apicustom`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cms_apikey`
--
ALTER TABLE `cms_apikey`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cms_dashboard`
--
ALTER TABLE `cms_dashboard`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cms_email_queues`
--
ALTER TABLE `cms_email_queues`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cms_email_templates`
--
ALTER TABLE `cms_email_templates`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cms_logs`
--
ALTER TABLE `cms_logs`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cms_menus`
--
ALTER TABLE `cms_menus`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cms_menus_privileges`
--
ALTER TABLE `cms_menus_privileges`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cms_moduls`
--
ALTER TABLE `cms_moduls`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cms_notifications`
--
ALTER TABLE `cms_notifications`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cms_privileges`
--
ALTER TABLE `cms_privileges`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cms_privileges_roles`
--
ALTER TABLE `cms_privileges_roles`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cms_settings`
--
ALTER TABLE `cms_settings`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cms_statistics`
--
ALTER TABLE `cms_statistics`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cms_statistic_components`
--
ALTER TABLE `cms_statistic_components`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `cms_users`
--
ALTER TABLE `cms_users`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_awards`
--
ALTER TABLE `tbl_awards`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_contacts`
--
ALTER TABLE `tbl_contacts`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_courses`
--
ALTER TABLE `tbl_courses`
ADD PRIMARY KEY (`course_id`);
--
-- Indexes for table `tbl_department`
--
ALTER TABLE `tbl_department`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_educations`
--
ALTER TABLE `tbl_educations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_expriences`
--
ALTER TABLE `tbl_expriences`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_gallerys`
--
ALTER TABLE `tbl_gallerys`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_interests`
--
ALTER TABLE `tbl_interests`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_positions`
--
ALTER TABLE `tbl_positions`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_profiles`
--
ALTER TABLE `tbl_profiles`
ADD PRIMARY KEY (`teacher_id`);
--
-- Indexes for table `tbl_projects`
--
ALTER TABLE `tbl_projects`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_publications`
--
ALTER TABLE `tbl_publications`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_researchs`
--
ALTER TABLE `tbl_researchs`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_sections`
--
ALTER TABLE `tbl_sections`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_securitys`
--
ALTER TABLE `tbl_securitys`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_socials`
--
ALTER TABLE `tbl_socials`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_trainings`
--
ALTER TABLE `tbl_trainings`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `cms_apicustom`
--
ALTER TABLE `cms_apicustom`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `cms_apikey`
--
ALTER TABLE `cms_apikey`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `cms_dashboard`
--
ALTER TABLE `cms_dashboard`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `cms_email_queues`
--
ALTER TABLE `cms_email_queues`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `cms_email_templates`
--
ALTER TABLE `cms_email_templates`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `cms_logs`
--
ALTER TABLE `cms_logs`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=273;
--
-- AUTO_INCREMENT for table `cms_menus`
--
ALTER TABLE `cms_menus`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
--
-- AUTO_INCREMENT for table `cms_menus_privileges`
--
ALTER TABLE `cms_menus_privileges`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=65;
--
-- AUTO_INCREMENT for table `cms_moduls`
--
ALTER TABLE `cms_moduls`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
--
-- AUTO_INCREMENT for table `cms_notifications`
--
ALTER TABLE `cms_notifications`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `cms_privileges`
--
ALTER TABLE `cms_privileges`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `cms_privileges_roles`
--
ALTER TABLE `cms_privileges_roles`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=80;
--
-- AUTO_INCREMENT for table `cms_settings`
--
ALTER TABLE `cms_settings`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT for table `cms_statistics`
--
ALTER TABLE `cms_statistics`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `cms_statistic_components`
--
ALTER TABLE `cms_statistic_components`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `cms_users`
--
ALTER TABLE `cms_users`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=44;
--
-- AUTO_INCREMENT for table `tbl_awards`
--
ALTER TABLE `tbl_awards`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `tbl_contacts`
--
ALTER TABLE `tbl_contacts`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `tbl_courses`
--
ALTER TABLE `tbl_courses`
MODIFY `course_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
--
-- AUTO_INCREMENT for table `tbl_department`
--
ALTER TABLE `tbl_department`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `tbl_educations`
--
ALTER TABLE `tbl_educations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;
--
-- AUTO_INCREMENT for table `tbl_expriences`
--
ALTER TABLE `tbl_expriences`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;
--
-- AUTO_INCREMENT for table `tbl_gallerys`
--
ALTER TABLE `tbl_gallerys`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;
--
-- AUTO_INCREMENT for table `tbl_interests`
--
ALTER TABLE `tbl_interests`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;
--
-- AUTO_INCREMENT for table `tbl_positions`
--
ALTER TABLE `tbl_positions`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `tbl_profiles`
--
ALTER TABLE `tbl_profiles`
MODIFY `teacher_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;
--
-- AUTO_INCREMENT for table `tbl_projects`
--
ALTER TABLE `tbl_projects`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
--
-- AUTO_INCREMENT for table `tbl_publications`
--
ALTER TABLE `tbl_publications`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `tbl_researchs`
--
ALTER TABLE `tbl_researchs`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `tbl_sections`
--
ALTER TABLE `tbl_sections`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
--
-- AUTO_INCREMENT for table `tbl_securitys`
--
ALTER TABLE `tbl_securitys`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `tbl_socials`
--
ALTER TABLE `tbl_socials`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `tbl_trainings`
--
ALTER TABLE `tbl_trainings`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| 105.3816 | 4,695 | 0.700185 |
5c56fd4b80f0ddf376eb1eaae2cb3fcf4d020199
| 872 |
swift
|
Swift
|
Carthage/Checkouts/russell-iOS/Russell/RussellUIForDemo/VerifySMSCodeViewController.swift
|
yuxiaoxi/DebugPanel-swift
|
717edcc857616d5fdda5a3724bf75e21bc52a828
|
[
"MIT"
] | null | null | null |
Carthage/Checkouts/russell-iOS/Russell/RussellUIForDemo/VerifySMSCodeViewController.swift
|
yuxiaoxi/DebugPanel-swift
|
717edcc857616d5fdda5a3724bf75e21bc52a828
|
[
"MIT"
] | null | null | null |
Carthage/Checkouts/russell-iOS/Russell/RussellUIForDemo/VerifySMSCodeViewController.swift
|
yuxiaoxi/DebugPanel-swift
|
717edcc857616d5fdda5a3724bf75e21bc52a828
|
[
"MIT"
] | null | null | null |
//
// VerifySMSCodeViewController.swift
// RussellDemo
//
// Created by Yunfan Cui on 2018/12/18.
// Copyright © 2018 LLS. All rights reserved.
//
import UIKit
final class VerifySMSCodeViewController: UIViewController {
@IBOutlet private weak var smsField: UITextField!
@IBOutlet weak var resultLabel: UILabel!
var coordinator: SMSLoginSessionCoordinator?
override func viewDidLoad() {
super.viewDidLoad()
navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(close))
}
@objc private func close() {
dismiss(animated: true, completion: nil)
}
@IBAction private func verify() {
guard let code = smsField.text else {
return
}
coordinator?.verifySMSCode(code)
}
@IBAction private func resendSMS() {
coordinator?.resendSMS()
}
}
| 21.8 | 123 | 0.696101 |
3d0b4ca67679416555bcb408ec40acbd3d303046
| 9,366 |
go
|
Go
|
internal/states/scaling_states_test.go
|
serdarkalayci/pre-scaling-operator
|
4becf1f7d7e7e8ce3b3ddab8b9b742a5da6506b3
|
[
"Apache-2.0"
] | null | null | null |
internal/states/scaling_states_test.go
|
serdarkalayci/pre-scaling-operator
|
4becf1f7d7e7e8ce3b3ddab8b9b742a5da6506b3
|
[
"Apache-2.0"
] | null | null | null |
internal/states/scaling_states_test.go
|
serdarkalayci/pre-scaling-operator
|
4becf1f7d7e7e8ce3b3ddab8b9b742a5da6506b3
|
[
"Apache-2.0"
] | null | null | null |
package states
import (
"context"
"reflect"
"testing"
"github.com/containersol/prescale-operator/api/v1alpha1"
scalingv1alpha1 "github.com/containersol/prescale-operator/api/v1alpha1"
g "github.com/containersol/prescale-operator/pkg/utils/global"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes/scheme"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
)
func TestGetPrioritisedState(t *testing.T) {
stateA := State{
Name: "peak",
Priority: 1,
}
stateB := State{
Name: "bay",
Priority: 5,
}
got := GetPrioritisedState(stateA, stateB)
if got != stateA {
t.Errorf("Priority state not being returned. Expected %s, Got %s", stateA, got)
}
got = GetPrioritisedState(stateB, stateA)
if got != stateA {
t.Errorf("Priority state not being returned. Expected %s, Got %s", stateA, got)
}
}
func Test_getNamespaceScalingStateNameReturnsCorrectStateName(t *testing.T) {
_ = scalingv1alpha1.AddToScheme(scheme.Scheme)
client := fake.
NewClientBuilder().
WithObjects(&scalingv1alpha1.ScalingState{
TypeMeta: v1.TypeMeta{
Kind: "ScalingState",
APIVersion: "scaling.prescale.com/v1alpha1",
},
ObjectMeta: v1.ObjectMeta{
Name: "product-scaling-state",
Namespace: "product",
},
Spec: scalingv1alpha1.ScalingStateSpec{
State: "peak",
},
}).
WithScheme(scheme.Scheme).
Build()
got, _ := GetNamespaceScalingStateName(context.TODO(), client, "product")
if got != "peak" {
t.Errorf("Did not return expected state name. Expected %s, Got %s", "peak", got)
}
}
func Test_getNamespaceScalingStateNameReturnsCorrectErrorIfNoStatesExist(t *testing.T) {
_ = scalingv1alpha1.AddToScheme(scheme.Scheme)
client := fake.
NewClientBuilder().
WithScheme(scheme.Scheme).
Build()
_, err := GetNamespaceScalingStateName(context.TODO(), client, "product")
if _, ok := err.(NotFound); !ok {
t.Errorf("Received incorrect error. Expected NotFound, got %s", err)
}
}
func Test_getNamespaceScalingStateNameReturnsCorrectErrorIfTooManyStatesExist(t *testing.T) {
_ = scalingv1alpha1.AddToScheme(scheme.Scheme)
client := fake.
NewClientBuilder().
WithObjects(&scalingv1alpha1.ScalingState{
TypeMeta: v1.TypeMeta{
Kind: "ScalingState",
APIVersion: "scaling.prescale.com/v1alpha1",
},
ObjectMeta: v1.ObjectMeta{
Name: "product-scaling-state",
Namespace: "product",
},
Spec: scalingv1alpha1.ScalingStateSpec{
State: "peak",
},
}, &scalingv1alpha1.ScalingState{
TypeMeta: v1.TypeMeta{
Kind: "ScalingState",
APIVersion: "scaling.prescale.com/v1alpha1",
},
ObjectMeta: v1.ObjectMeta{
Name: "product-scaling-state-contender",
Namespace: "product",
},
Spec: scalingv1alpha1.ScalingStateSpec{
State: "bau",
},
}).
WithScheme(scheme.Scheme).
Build()
_, err := GetNamespaceScalingStateName(context.TODO(), client, "product")
if _, ok := err.(TooMany); !ok {
t.Errorf("Received incorrect error. Expected TooMany, got %s", err)
}
}
func TestGetAppliedState(t *testing.T) {
type args struct {
ctx context.Context
_client client.Client
namespace string
stateDefinitions States
clusterState State
}
_ = scalingv1alpha1.AddToScheme(scheme.Scheme)
tests := []struct {
name string
args args
want State
wantErr bool
}{
{
name: "TestEmptyClusterState",
args: args{
ctx: context.TODO(),
_client: fake.
NewClientBuilder().
WithObjects(&scalingv1alpha1.ClusterScalingState{
TypeMeta: metav1.TypeMeta{
Kind: "ScalingState",
APIVersion: "scaling.prescale.com/v1alpha1",
},
ObjectMeta: metav1.ObjectMeta{
Name: "product-scaling-state",
Namespace: "product",
},
Spec: scalingv1alpha1.ClusterScalingStateSpec{
State: "peak",
},
}).
WithScheme(scheme.Scheme).
Build(),
namespace: "default",
stateDefinitions: []State{
{
Name: "bau",
Priority: 0,
},
{
Name: "peak",
Priority: 3,
},
},
clusterState: State{
Name: "bau",
Priority: 0,
},
},
want: State{
Name: "bau",
Priority: 0,
},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := GetAppliedStateOld(tt.args.ctx, tt.args._client, tt.args.namespace, tt.args.stateDefinitions, tt.args.clusterState)
if (err != nil) != tt.wantErr {
t.Errorf("GetAppliedState() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("GetAppliedState() = %v, want %v", got, tt.want)
}
})
}
}
func Test_fetchNameSpaceState(t *testing.T) {
type args struct {
ctx context.Context
_client client.Client
stateDefinitions States
namespace string
}
_ = scalingv1alpha1.AddToScheme(scheme.Scheme)
tests := []struct {
name string
args args
want State
wantErr bool
}{
{
name: "",
args: args{
ctx: context.TODO(),
_client: fake.
NewClientBuilder().
WithScheme(scheme.Scheme).
Build(),
stateDefinitions: []State{},
namespace: "default",
},
want: State{},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := FetchNameSpaceState(tt.args.ctx, tt.args._client, tt.args.stateDefinitions, tt.args.namespace)
if (err != nil) != tt.wantErr {
t.Errorf("fetchNameSpaceState() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("fetchNameSpaceState() = %v, want %v", got, tt.want)
}
})
}
}
func Test_fetchClusterState(t *testing.T) {
type args struct {
ctx context.Context
_client client.Client
stateDefinitions States
}
_ = scalingv1alpha1.AddToScheme(scheme.Scheme)
tests := []struct {
name string
args args
want State
wantErr bool
}{
{
name: "TestClusterState",
args: args{
ctx: context.TODO(),
_client: fake.
NewClientBuilder().
WithScheme(scheme.Scheme).
Build(),
stateDefinitions: []State{},
},
want: State{},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := fetchClusterState(tt.args.ctx, tt.args._client, tt.args.stateDefinitions)
if (err != nil) != tt.wantErr {
t.Errorf("fetchClusterState() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("fetchClusterState() = %v, want %v", got, tt.want)
}
})
}
}
func TestGetScalingClassFromLabelScalingItem(t *testing.T) {
type args struct {
deploymentItem g.ScalingInfo
}
tests := []struct {
name string
args args
wantClass ScalingClass
}{
{
name: "TestGetClassFound",
args: args{
deploymentItem: g.ScalingInfo{
Name: "foo",
Namespace: "bar",
Annotations: map[string]string{},
Labels: map[string]string{
"scaler/opt-in": "false",
"scaler/scaling-class": "test"},
SpecReplica: 2,
ScalingItemType: g.ScalingItemType{ItemTypeName: "Deployment"},
Failure: false,
FailureMessage: "",
ReadyReplicas: 2,
DesiredReplicas: 4,
},
},
wantClass: ScalingClass{
Name: "test",
},
},
{
name: "TestGetClassNotFound",
args: args{
deploymentItem: g.ScalingInfo{
Name: "foo",
Namespace: "bar",
Annotations: map[string]string{},
Labels: map[string]string{"scaler/opt-in": "false"},
SpecReplica: 2,
ScalingItemType: g.ScalingItemType{ItemTypeName: "Deployment"},
Failure: false,
FailureMessage: "",
ReadyReplicas: 2,
DesiredReplicas: 4,
},
},
wantClass: ScalingClass{
Name: "default",
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
class := GetAppliedScalingClassFromScalingItem(tt.args.deploymentItem)
if class != tt.wantClass {
t.Errorf("The returned class was not correct! Wanted %s Got %s", tt.wantClass.Name, class.Name)
}
})
}
}
func TestGetScalingClassFromClusterscalingstate(t *testing.T) {
type args struct {
css v1alpha1.ClusterScalingState
}
tests := []struct {
name string
args args
wantClass ScalingClass
}{
{
name: "TestGetClassFound",
args: args{
css: v1alpha1.ClusterScalingState{
Spec: v1alpha1.ClusterScalingStateSpec{
State: "peak",
ScalingClass: "test",
},
},
},
wantClass: ScalingClass{
Name: "test",
},
},
{
name: "TestGetClassNotFound",
args: args{
css: v1alpha1.ClusterScalingState{
Spec: v1alpha1.ClusterScalingStateSpec{
State: "peak",
},
},
},
wantClass: ScalingClass{
Name: "default",
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
class := GetAppliedScalingClassFromClusterScalingState(tt.args.css)
if class != tt.wantClass {
t.Errorf("The returned class was not correct! Wanted %s Got %s", tt.wantClass.Name, class.Name)
}
})
}
}
| 24.390625 | 130 | 0.631326 |
a1c2d145290c136fb1d59d070f88426694752ce5
| 2,380 |
go
|
Go
|
server.go
|
UKHomeOffice/dockerfile-validator
|
056b995261861667aaab083c2c1f65d661112883
|
[
"MIT"
] | 1 |
2017-09-03T12:08:04.000Z
|
2017-09-03T12:08:04.000Z
|
server.go
|
UKHomeOffice/dockerfile-validator
|
056b995261861667aaab083c2c1f65d661112883
|
[
"MIT"
] | 2 |
2016-02-04T15:06:24.000Z
|
2016-02-25T14:19:23.000Z
|
server.go
|
UKHomeOffice/dockerfile-validator
|
056b995261861667aaab083c2c1f65d661112883
|
[
"MIT"
] | 1 |
2021-04-11T09:41:02.000Z
|
2021-04-11T09:41:02.000Z
|
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func uploadRulesHandler(w http.ResponseWriter, r *http.Request) {
switch r.Method {
//GET displays the upload form.
case "GET":
message := "Rules currently defined: \n\n" + rules.String()
w.Write([]byte(message))
//POST takes the uploaded file(s) and saves it to disk.
case "POST":
rulesfile, _, _ := r.FormFile("rules")
defer rulesfile.Close()
rulesdata, _ := ioutil.ReadAll(rulesfile)
rules, _ = loadRules(rulesdata)
fmt.Fprintf(w, "Rules file uploaded")
default:
w.WriteHeader(http.StatusMethodNotAllowed)
}
}
func validateHandler(w http.ResponseWriter, r *http.Request) {
switch r.Method {
//GET displays the upload form.
case "GET":
message := "Post your Dockerfile to validate it against the rules: \n\n" + rules.String()
w.Write([]byte(message))
//POST takes the uploaded file(s) and saves it to disk.
case "POST":
dockerfile, _, _ := r.FormFile("dockerfile")
dfile, _ := DockerfileRead(dockerfile)
defer dockerfile.Close()
v := Validation{rules, dfile}
valid, msg := v.validate()
if valid {
w.WriteHeader(http.StatusOK)
return
} else {
w.WriteHeader(http.StatusConflict)
fmt.Fprintf(w, msg)
}
// w.WriteHeader(http.StatusConflict)
// fmt.Fprintf(w, "No Dockerfile found in request")
default:
w.WriteHeader(http.StatusMethodNotAllowed)
}
}
func uploadHandler(w http.ResponseWriter, r *http.Request) {
switch r.Method {
//GET displays the upload form.
case "GET":
message := "Post your Dockerfile and Rules to check if it's valid"
w.Write([]byte(message))
//POST takes the uploaded file(s) and saves it to disk.
case "POST":
dockerfile, _, _ := r.FormFile("dockerfile")
dfile, _ := DockerfileRead(dockerfile)
defer dockerfile.Close()
rulesfile, _, _ := r.FormFile("rules")
defer rulesfile.Close()
rulesdata, _ := ioutil.ReadAll(rulesfile)
rules, _ := loadRules(rulesdata)
v := Validation{rules, dfile}
valid, msg := v.validate()
if valid {
w.WriteHeader(http.StatusOK)
} else {
w.WriteHeader(http.StatusConflict)
fmt.Fprintf(w, msg)
}
default:
w.WriteHeader(http.StatusMethodNotAllowed)
}
}
func defaultHandler(w http.ResponseWriter, r *http.Request) {
message := "Dockerfile Validator. Upload your Dockerfile to test if it's complaiant with the rules"
w.Write([]byte(message))
}
| 23.106796 | 100 | 0.692857 |
7244081bae4a13a2235923b10100dc424d141fc8
| 5,691 |
rs
|
Rust
|
control-plane/rest/service/src/authentication.rs
|
Abhinandan-Purkait-Bolt/mayastor-control-plane
|
ae4b39b42cc54bf8520f0256568e5d8635eb4f39
|
[
"Apache-2.0"
] | 13 |
2021-03-29T15:10:15.000Z
|
2022-03-23T04:01:59.000Z
|
control-plane/rest/service/src/authentication.rs
|
Abhinandan-Purkait-Bolt/mayastor-control-plane
|
ae4b39b42cc54bf8520f0256568e5d8635eb4f39
|
[
"Apache-2.0"
] | 146 |
2021-03-30T13:14:56.000Z
|
2022-03-31T15:54:38.000Z
|
control-plane/rest/service/src/authentication.rs
|
Abhinandan-Purkait-Bolt/mayastor-control-plane
|
ae4b39b42cc54bf8520f0256568e5d8635eb4f39
|
[
"Apache-2.0"
] | 12 |
2021-06-22T13:53:01.000Z
|
2022-03-31T12:07:36.000Z
|
use actix_web::HttpRequest;
use jsonwebtoken::{crypto, Algorithm, DecodingKey};
use http::HeaderValue;
use std::fs::File;
use snafu::{ResultExt, Snafu};
/// Authorization Errors
#[derive(Debug, Snafu)]
pub enum AuthError {
#[snafu(display("Internal error: {}", details))]
InternalError { details: String },
#[snafu(display("No Bearer Token was provided in the HTTP Header"))]
NoBearerToken {},
#[snafu(display("Invalid token, cannot be parsed into a string: {}", source.to_string()))]
InvalidTokenStr { source: http::header::ToStrError },
#[snafu(display("Unauthorized token({}) for uri({})", token, uri))]
Unauthorized { token: String, uri: String },
#[snafu(display(
"Verification process failed, {}. Please check your json web token.",
source
))]
Verification { source: jsonwebtoken::errors::Error },
#[snafu(display("Invalid Bearer Token: {}", details))]
InvalidToken { details: String },
}
/// Initialise JWK with the contents of the file at 'jwk_path'.
/// If jwk_path is 'None', authentication is disabled.
pub fn init(jwk_path: Option<String>) -> JsonWebKey {
match jwk_path {
Some(path) => {
let jwk_file = File::open(path).expect("Failed to open JWK file");
JsonWebKey::from(Some(jwk_file))
}
None => JsonWebKey::from(None),
}
}
#[derive(serde::Deserialize, Default, Debug)]
pub struct JsonWebKey {
#[serde(skip_deserializing)]
enabled: bool,
#[serde(alias = "alg")]
algorithm: Algorithm,
#[serde(alias = "n")]
modulus: String,
#[serde(alias = "e")]
exponent: String,
}
impl JsonWebKey {
/// Validates and returns new JsonWebKey
pub(crate) fn from(jwk_file: Option<File>) -> Self {
match jwk_file {
Some(jwk_file) => {
let mut jwk: Self = match serde_json::from_reader(jwk_file) {
Ok(jwk) => jwk,
Err(e) => panic!("Failed to deserialize the jwk: {}", e),
};
jwk.enabled = true;
jwk
}
None => Self::default(),
}
}
/// Validate a bearer token
pub(crate) fn validate(&self, token: &str, uri: &str) -> Result<(), AuthError> {
let (message, signature) = split_token(token)?;
match crypto::verify(&signature, &message, &self.decoding_key(), self.algorithm()) {
Ok(true) => Ok(()),
Ok(false) => Err(AuthError::Unauthorized {
token: token.to_string(),
uri: uri.to_string(),
}),
Err(source) => Err(AuthError::Verification { source }),
}
}
// Returns true if REST calls should be authenticated.
fn auth_enabled(&self) -> bool {
self.enabled
}
// Return the algorithm.
fn algorithm(&self) -> Algorithm {
self.algorithm
}
// Return the modulus.
fn modulus(&self) -> &str {
&self.modulus
}
// Return the exponent.
fn exponent(&self) -> &str {
&self.exponent
}
// Return the decoding key
fn decoding_key(&self) -> DecodingKey {
DecodingKey::from_rsa_components(self.modulus(), self.exponent())
}
}
/// Authenticate the HTTP request by checking the authorisation token to ensure
/// the sender is who they claim to be.
pub fn authenticate(req: &HttpRequest) -> Result<(), AuthError> {
let jwk: &JsonWebKey = match req.app_data() {
Some(jwk) => Ok(jwk),
None => Err(AuthError::InternalError {
details: "Json Web Token not configured in the REST server".to_string(),
}),
}?;
// If authentication is disabled there is nothing to do.
if !jwk.auth_enabled() {
return Ok(());
}
match req.headers().get(http::header::AUTHORIZATION) {
Some(token) => jwk.validate(&format_token(token)?, &req.uri().to_string()),
None => Err(AuthError::NoBearerToken {}),
}
}
// Ensure the token is formatted correctly by removing the "Bearer " prefix if
// present.
fn format_token(token: &HeaderValue) -> Result<String, AuthError> {
let token = token
.to_str()
.context(InvalidTokenStr)?
.trim_start_matches("Bearer ");
Ok(token.trim().into())
}
// Split the JSON Web Token (JWT) into 2 parts, message and signature.
// The message comprises the header and payload.
//
// JWT format:
// <header>.<payload>.<signature>
// \______ ________/
// \/
// message
fn split_token(token: &str) -> Result<(String, String), AuthError> {
let elems = token.split('.').collect::<Vec<&str>>();
if elems.len() == 3 {
let message = format!("{}.{}", elems[0], elems[1]);
let signature = elems[2];
Ok((message, signature.into()))
} else {
Err(AuthError::InvalidToken {
details: "Should be formatted as: header.payload.signature".to_string(),
})
}
}
#[test]
fn validate_test() {
let token_file = std::env::current_dir()
.expect("Failed to get current directory")
.join("authentication")
.join("token");
let mut token = std::fs::read_to_string(token_file).expect("Failed to get bearer token");
let jwk_file = std::env::current_dir()
.expect("Failed to get current directory")
.join("authentication")
.join("jwk");
let jwk = init(Some(jwk_file.to_str().unwrap().into()));
jwk.validate(&token, "uri").expect("Validation should pass");
// create invalid token
token.push_str("invalid");
jwk.validate(&token, "uri")
.expect_err("Validation should fail with an invalid token");
}
| 31.793296 | 94 | 0.593217 |
13887922362e9321f104c60f8397e7151d9c8876
| 618 |
asm
|
Assembly
|
pwnlib/shellcraft/templates/arm/linux/thumb_read_stack.asm
|
alexpark07/pwntools
|
c86022e844c8264ba4c35ed1dd5d55f1c76be90b
|
[
"MIT"
] | 1 |
2015-04-21T11:30:28.000Z
|
2015-04-21T11:30:28.000Z
|
pwnlib/shellcraft/templates/arm/linux/thumb_read_stack.asm
|
alexpark07/pwntools
|
c86022e844c8264ba4c35ed1dd5d55f1c76be90b
|
[
"MIT"
] | null | null | null |
pwnlib/shellcraft/templates/arm/linux/thumb_read_stack.asm
|
alexpark07/pwntools
|
c86022e844c8264ba4c35ed1dd5d55f1c76be90b
|
[
"MIT"
] | null | null | null |
<% from pwnlib.shellcraft import arm, common %>
<% from pwnlib.util.misc import align %>
<% from pwnlib.asm import cpp %>
<%page args="in_fd=None, size=128, allocate_stack=True" />
<%docstring>
Reads to the stack in thumb mode.
You can optioanlly shave a few bytes not allocating the stack space.
Args:
in_fd (imm/reg) = STDIN_FILENO
size (int/str) = 128
allocate_stack(bool) = True
</%docstring>
.code 16
%if allocate_stack:
sub sp, #${align(4, int(size))}
%endif
movs r0, #${in_fd}
movs r2, #${size}
mov r1, sp
movs r7, #${cpp("SYS_read", arch = "thumb", os = "linux")}
svc 1
.align 2
| 22.888889 | 68 | 0.656958 |
ebe55c9244ad0380e13c6efbd5500a6e2cfdffa7
| 1,402 |
sql
|
SQL
|
atd-vzd/schema/atd_txdot__cas_transp_locat_lkp.sql
|
cityofaustin/transportation-vz-data
|
efe3cd95a532720e0f3f83b7cbd8e048a44de5a4
|
[
"CC0-1.0"
] | 7 |
2019-11-22T19:04:50.000Z
|
2022-03-10T20:07:40.000Z
|
atd-vzd/schema/atd_txdot__cas_transp_locat_lkp.sql
|
cityofaustin/atd-vz-data
|
cb00f0eba6cbb330d4325d2d1f18d862f5573205
|
[
"CC0-1.0"
] | 645 |
2019-04-18T19:20:51.000Z
|
2022-03-22T19:53:03.000Z
|
atd-vzd/schema/atd_txdot__cas_transp_locat_lkp.sql
|
cityofaustin/transportation-vz-data
|
efe3cd95a532720e0f3f83b7cbd8e048a44de5a4
|
[
"CC0-1.0"
] | 1 |
2019-10-31T17:04:54.000Z
|
2019-10-31T17:04:54.000Z
|
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.6
-- Dumped by pg_dump version 10.10
-- Started on 2019-10-15 13:50:00 CDT
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- TOC entry 263 (class 1259 OID 2345945)
-- Name: atd_txdot__cas_transp_locat_lkp; Type: TABLE; Schema: public; Owner: atd_vz_data
--
CREATE TABLE public.atd_txdot__cas_transp_locat_lkp (
cas_transp_locat_id integer NOT NULL,
cas_transp_locat_desc character varying(128),
eff_beg_date character varying(32),
eff_end_date character varying(32)
);
ALTER TABLE public.atd_txdot__cas_transp_locat_lkp OWNER TO atd_vz_data;
--
-- TOC entry 5618 (class 2606 OID 2346536)
-- Name: atd_txdot__cas_transp_locat_lkp atd_txdot__cas_transp_locat_lkp_pk; Type: CONSTRAINT; Schema: public; Owner: atd_vz_data
--
ALTER TABLE ONLY public.atd_txdot__cas_transp_locat_lkp
ADD CONSTRAINT atd_txdot__cas_transp_locat_lkp_pk PRIMARY KEY (cas_transp_locat_id);
-- Completed on 2019-10-15 13:50:03 CDT
--
-- PostgreSQL database dump complete
--
| 25.490909 | 129 | 0.777461 |
f1161f3b6942036e132eba6c66a691257131f95f
| 579 |
rb
|
Ruby
|
spec/support/sidekiq.rb
|
zorbash/sidekiq-dry
|
01ac4aff8394462b2b41ae04ef1cdefbb66e4b2e
|
[
"MIT"
] | 7 |
2021-01-11T15:27:59.000Z
|
2021-12-19T09:17:30.000Z
|
spec/support/sidekiq.rb
|
zorbash/sidekiq-dry
|
01ac4aff8394462b2b41ae04ef1cdefbb66e4b2e
|
[
"MIT"
] | null | null | null |
spec/support/sidekiq.rb
|
zorbash/sidekiq-dry
|
01ac4aff8394462b2b41ae04ef1cdefbb66e4b2e
|
[
"MIT"
] | null | null | null |
require 'sidekiq/testing'
# Load all middlewares to be tested
Sidekiq.configure_client do |config|
config.client_middleware do |chain|
chain.prepend Sidekiq::Dry::Client::SerializationMiddleware
end
end
# Class to test how the deserialization middleware interacts with
# other middlewares
class DummyMiddleware
def call(_worker, job, _queue)
yield
rescue Exception => e
report(job)
end
def report(job)
end
end
Sidekiq::Testing.server_middleware do |chain|
chain.add DummyMiddleware
chain.add Sidekiq::Dry::Server::DeserializationMiddleware
end
| 20.678571 | 65 | 0.768566 |
f84f565fc56e41115ecceb39ea59ee5313d9b718
| 166 |
asm
|
Assembly
|
libsrc/_DEVELOPMENT/arch/zx/nirvanam/z80/asm_NIRVANAM_drawTW_di.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 640 |
2017-01-14T23:33:45.000Z
|
2022-03-30T11:28:42.000Z
|
libsrc/_DEVELOPMENT/arch/zx/nirvanam/z80/asm_NIRVANAM_drawTW_di.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 1,600 |
2017-01-15T16:12:02.000Z
|
2022-03-31T12:11:12.000Z
|
libsrc/_DEVELOPMENT/arch/zx/nirvanam/z80/asm_NIRVANAM_drawTW_di.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 215 |
2017-01-17T10:43:03.000Z
|
2022-03-23T17:25:02.000Z
|
SECTION code_clib
SECTION code_nirvanam
PUBLIC asm_NIRVANAM_drawTW_di
EXTERN asm_NIRVANAM_drawTW
asm_NIRVANAM_drawTW_di:
di
call asm_NIRVANAM_drawTW
ei
ret
| 11.857143 | 29 | 0.849398 |
b5c6f96a3f456639e20518344225349b5861c8de
| 3,836 |
kt
|
Kotlin
|
app/src/main/java/com/panda/pda/app/operation/qms/quality_task/QualityTaskCommitFragment.kt
|
Givennn/pda
|
24f6284eed22b1fe91b5462a0cdd5a466d6531ad
|
[
"MIT"
] | null | null | null |
app/src/main/java/com/panda/pda/app/operation/qms/quality_task/QualityTaskCommitFragment.kt
|
Givennn/pda
|
24f6284eed22b1fe91b5462a0cdd5a466d6531ad
|
[
"MIT"
] | null | null | null |
app/src/main/java/com/panda/pda/app/operation/qms/quality_task/QualityTaskCommitFragment.kt
|
Givennn/pda
|
24f6284eed22b1fe91b5462a0cdd5a466d6531ad
|
[
"MIT"
] | null | null | null |
package com.panda.pda.app.operation.qms.quality_task
import android.os.Bundle
import android.view.View
import androidx.fragment.app.activityViewModels
import androidx.fragment.app.setFragmentResultListener
import by.kirich1409.viewbindingdelegate.viewBinding
import com.jakewharton.rxbinding4.view.clicks
import com.panda.pda.app.R
import com.panda.pda.app.base.BaseFragment
import com.panda.pda.app.base.extension.toast
import com.panda.pda.app.base.retrofit.WebClient
import com.panda.pda.app.common.ModelPropertyCreator
import com.panda.pda.app.common.OrgNodeSelectFragment
import com.panda.pda.app.common.data.model.OrgNodeModel
import com.panda.pda.app.databinding.FragmentQualityCommitBinding
import com.panda.pda.app.operation.qms.QualityViewModel
import com.panda.pda.app.operation.qms.data.QualityApi
import com.panda.pda.app.operation.qms.data.model.QualityDetailModel
import com.panda.pda.app.operation.qms.data.model.QualityTaskCommitRequest
import com.trello.rxlifecycle4.kotlin.bindToLifecycle
import java.util.concurrent.TimeUnit
/**
* created by AnJiwei 2021/9/29
*/
class QualityTaskCommitFragment : BaseFragment(R.layout.fragment_quality_commit) {
private val viewBinding by viewBinding<FragmentQualityCommitBinding>()
private val viewModel by activityViewModels<QualityViewModel>()
private var selectedVerifier: OrgNodeModel? = null
private lateinit var currentQualityTask: QualityDetailModel
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
setFragmentResultListener(OrgNodeSelectFragment.ORG_NODE_RESULT) { requestKey, bundle ->
if (requestKey == OrgNodeSelectFragment.ORG_NODE_RESULT) {
val nodeModel =
bundle.getSerializable(OrgNodeSelectFragment.PERSON_SELECT_KEY) as? OrgNodeModel
if (nodeModel != null) {
updateVerifier(nodeModel)
}
}
}
viewBinding.topAppBar.setNavigationOnClickListener { navBackListener.invoke(it) }
val modelProperty = ModelPropertyCreator(
QualityDetailModel::class.java,
viewBinding.llPropertyInfo
)
viewModel.qualityDetailInfoData.observe(viewLifecycleOwner) {
modelProperty.setData(it)
currentQualityTask = it
}
viewBinding.llSelectVerifier.clicks()
.throttleFirst(500, TimeUnit.MILLISECONDS)
.bindToLifecycle(requireView())
.subscribe {
navController.navigate(
R.id.orgNodeSelectFragment,
Bundle().apply {
putString(
OrgNodeSelectFragment.TITLE_KEY,
getString(R.string.verifier)
)
})
}
viewBinding.btnConfirm.clicks()
.throttleFirst(500, TimeUnit.MILLISECONDS)
.bindToLifecycle(requireView())
.subscribe {
commit()
}
}
private fun updateVerifier(verifier: OrgNodeModel) {
selectedVerifier = verifier
viewBinding.tvVerifier.text = verifier.nodeName
}
private fun commit() {
if (selectedVerifier == null) {
toast("请选择审核人")
return
}
val verifierId = selectedVerifier!!.id
val remark = viewBinding.etRemark.text.toString()
WebClient.request(QualityApi::class.java)
.pdaQmsTaskCommitPost(QualityTaskCommitRequest(currentQualityTask.id, verifierId, remark))
.bindToFragment()
.subscribe({
toast(R.string.quality_task_commit_success)
navBackListener.invoke(requireView())
}, {})
}
}
| 39.142857 | 102 | 0.672576 |
03fd5f37bd08215e1f647da282cfa0d866e114b6
| 1,072 |
swift
|
Swift
|
Sources/AWSSDKSwift/Services/DirectoryService/DirectoryService_Paginator.swift
|
eveenendaal/aws-sdk-swift
|
1651fb83c9b9d1951418ab5df953f2262f5e72ab
|
[
"Apache-2.0"
] | 1 |
2020-11-12T20:58:09.000Z
|
2020-11-12T20:58:09.000Z
|
Sources/AWSSDKSwift/Services/DirectoryService/DirectoryService_Paginator.swift
|
0xTim/aws-sdk-swift
|
bdb0c83b61a2eb7874a6ae25bdf7059e6b55d747
|
[
"Apache-2.0"
] | null | null | null |
Sources/AWSSDKSwift/Services/DirectoryService/DirectoryService_Paginator.swift
|
0xTim/aws-sdk-swift
|
bdb0c83b61a2eb7874a6ae25bdf7059e6b55d747
|
[
"Apache-2.0"
] | null | null | null |
// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/swift-aws/aws-sdk-swift/blob/master/CodeGenerator/Sources/CodeGenerator/main.swift. DO NOT EDIT.
import NIO
//MARK: Paginators
extension DirectoryService {
/// Provides information about any domain controllers in your directory.
public func describeDomainControllersPaginator(_ input: DescribeDomainControllersRequest, onPage: @escaping (DescribeDomainControllersResult, EventLoop)->EventLoopFuture<Bool>) -> EventLoopFuture<Void> {
return client.paginate(input: input, command: describeDomainControllers, tokenKey: \DescribeDomainControllersResult.nextToken, onPage: onPage)
}
}
extension DirectoryService.DescribeDomainControllersRequest: AWSPaginateStringToken {
public func usingPaginationToken(_ token: String) -> DirectoryService.DescribeDomainControllersRequest {
return .init(
directoryId: self.directoryId,
domainControllerIds: self.domainControllerIds,
limit: self.limit,
nextToken: token
)
}
}
| 36.965517 | 207 | 0.751866 |
890d6bef9bd176b12e06fd39777d122d9efe29bb
| 2,829 |
kt
|
Kotlin
|
kotlinextensions/src/main/kotlin/com/extensions/general/Jsons.kt
|
Krunal-Kevadiya/kotlin-extension
|
6b556c47887cd2ded327783b63a92f76aee5cffc
|
[
"Apache-2.0"
] | 3 |
2019-01-31T08:12:17.000Z
|
2019-09-23T04:43:01.000Z
|
kotlinextensions/src/main/kotlin/com/extensions/general/Jsons.kt
|
Krunal-Kevadiya/Kotlin-Extension
|
6b556c47887cd2ded327783b63a92f76aee5cffc
|
[
"Apache-2.0"
] | null | null | null |
kotlinextensions/src/main/kotlin/com/extensions/general/Jsons.kt
|
Krunal-Kevadiya/Kotlin-Extension
|
6b556c47887cd2ded327783b63a92f76aee5cffc
|
[
"Apache-2.0"
] | null | null | null |
package com.extensions.general
import org.json.JSONArray
import org.json.JSONObject
fun String.createJSONObject(): JSONObject? = this.convertAcceptNull({ JSONObject(this) }, null)
fun Map<*, *>.createJSONObject(): JSONObject? = this.convertAcceptNull({ JSONObject(this) }, null)
fun String.createJSONArray(): JSONArray? = this.convertAcceptNull({ JSONArray(this) }, null)
fun List<*>.createJSONArray(): JSONArray? = this.convertAcceptNull({ JSONArray(this) }, null)
fun getJSONObject(jsonObject: JSONObject?, name: String): JSONObject? = jsonObject.convertAcceptNull({ it?.getJSONObject(name) }, null)
fun getJSONObject(jsonArray: JSONArray?, index: Int): JSONObject? = jsonArray.convertAcceptNull({ it?.getJSONObject(index) }, null)
fun getJSONArray(jsonObject: JSONObject?, name: String): JSONArray? = jsonObject.convertAcceptNull({ it?.getJSONArray(name) }, null)
fun getJSONArray(jsonArray: JSONArray?, index: Int): JSONArray? = jsonArray.convertAcceptNull({ it?.getJSONArray(index) }, null)
@JvmOverloads
fun JSONObject.getJSONString(name: String, def: String = ""): String = this.convert({ it.getString(name) }, def)
@JvmOverloads
fun JSONArray.getJSONString(index: Int, def: String = ""): String = this.convert({ it.getString(index) }, def)
@JvmOverloads
fun JSONObject.getJSONInt(name: String, def: Int = 0): Int = this.convert({ it.getInt(name) }, def)
@JvmOverloads
fun JSONArray.getJSONInt(index: Int, def: Int = 0): Int = this.convert({ it.getInt(index) }, def)
@JvmOverloads
fun JSONObject.getJSONBoolean(name: String, def: Boolean = false): Boolean = this.convert({ it.getBoolean(name) }, def)
@JvmOverloads
fun JSONArray.getJSONBoolean(index: Int, def: Boolean = false): Boolean = this.convert({ it.getBoolean(index) }, def)
@JvmOverloads
fun JSONObject.getJSONDouble(name: String, def: Double = 0.toDouble()): Double = this.convert({ it.getDouble(name) }, def)
@JvmOverloads
fun JSONArray.getJSONDouble(index: Int, def: Double = 0.toDouble()): Double = this.convert({ it.getDouble(index) }, def)
@JvmOverloads
fun JSONObject.getJSONLong(name: String, def: Long = 0.toLong()): Long = this.convert({ it.getLong(name) }, def)
@JvmOverloads
fun JSONArray.getJSONLong(index: Int, def: Long = 0.toLong()): Long = this.convert({ it.getLong(index) }, def)
fun put(jsonObject: JSONObject?, name: String, value: Any) = jsonObject?.put(name, value)
fun put(jsonArray: JSONArray?, index: Int, value: Any) = jsonArray?.put(index, value)
fun put(jsonArray: JSONArray?, value: Any) = jsonArray?.put(value)
@JvmName("forObjectEach")
inline fun JSONArray.forEach(action: (JSONObject) -> Unit) {
for (i in 0 until this.length()) action(getJSONObject(i))
}
@JvmName("toObjectList")
fun JSONArray.toList(): List<JSONObject> = List<JSONObject>(length()) { index -> getJSONObject(index) }
| 34.084337 | 135 | 0.730647 |
74ae18e4cc810649185cde7d55e19f176d1098ea
| 22,086 |
js
|
JavaScript
|
packages/publisher-dapp/src/Services/Redux/actionCreators/organizationActions.js
|
raamb/snet-dapp-monorepo
|
44db14c6b761977ab80acaf3f31d8a5ff833427a
|
[
"MIT"
] | null | null | null |
packages/publisher-dapp/src/Services/Redux/actionCreators/organizationActions.js
|
raamb/snet-dapp-monorepo
|
44db14c6b761977ab80acaf3f31d8a5ff833427a
|
[
"MIT"
] | null | null | null |
packages/publisher-dapp/src/Services/Redux/actionCreators/organizationActions.js
|
raamb/snet-dapp-monorepo
|
44db14c6b761977ab80acaf3f31d8a5ff833427a
|
[
"MIT"
] | 1 |
2021-01-15T11:10:10.000Z
|
2021-01-15T11:10:10.000Z
|
import { API } from "aws-amplify";
import isEmpty from "lodash/isEmpty";
import * as Sentry from "@sentry/browser";
import { APIEndpoints, APIPaths } from "../../AWS/APIEndpoints";
import { initializeAPIOptions } from "../../../Utils/API";
import { fetchAuthenticatedUser } from "./userActions/loginActions";
import { errorActions, loaderActions } from "./";
import { LoaderContent } from "../../../Utils/Loader";
import { APIError, responseStatus } from "shared/dist/utils/API";
import { addressTypes, organizationSetupStatuses, orgSubmitActions } from "../../../Utils/organizationSetup";
import { initSDK } from "shared/dist/utils/snetSdk";
import { blockChainEvents } from "../../../Utils/Blockchain";
import { clientTypes } from "shared/dist/utils/clientTypes";
import { GlobalRoutes } from "../../../GlobalRouter/Routes";
import { defaultContacts } from "../reducers/organizationReducer";
import RegistryContract from "../../../Utils/PlatformContracts/RegistryContract";
import { MetamaskError } from "shared/dist/utils/error";
import { userRoles } from "../../../Utils/user";
export const SET_ALL_ORG_ATTRIBUTES = "SET_ALL_ORG_ATTRIBUTES";
export const SET_ONE_BASIC_DETAIL = "SET_ONE_BASIC_DETAIL";
export const RESET_ORGANIZATION_DATA = "RESET_ORGANIZATION_DATA";
export const SET_CONTACTS = "SET_CONTACTS";
export const SET_HERO_IMAGE = "SET_HERO_IMAGE";
export const SET_GROUPS = "SET_GROUPS";
export const SET_ORGANIZATION_STATUS = "SET_ORGANIZATION_STATUS";
export const SET_ORG_SAME_MAILING_ADDRESS = "SET_ORG_SAME_MAILING_ADDRESS";
export const SET_ORG_HQ_ADDRESS_DETAIL = "SET_HQ_ADDRES_DETAIL";
export const SET_ORG_MAILING_ADDRESS_DETAIL = "SET_MAILING_ADDRESS_DETAIL";
export const SET_ORG_OWNER = "SET_ORG_OWNER";
export const SET_ORG_STATE_ALL = "SET_ORG_STATE_ALL";
export const SET_ORG_STATE_STATE = "SET_ORG_STATE_STATE";
export const SET_ORG_STATE_UPDATED_ON = "SET_ORG_STATE_UPDATED_ON";
export const SET_ORG_STATE_UPDATED_BY = "SET_ORG_STATE_UPDATED_BY";
export const SET_ORG_STATE_REVIEWED_BY = "SET_ORG_STATE_REVIEWED_BY";
export const SET_ORG_STATE_REVIEWED_ON = "SET_ORG_STATE_REVIEWED_ON";
export const SET_ORG_HERO_IMAGE_URL = "SET_ORG_HERO_IMAGE_URL";
export const SET_ORG_FOUND_IN_BLOCKCHAIN = "SET_ORG_FOUND_IN_BLOCKCHAIN";
export const SET_ORGANIZATION_TOUCHED_FLAG = "SET_ORGANIZATION_TOUCHED_FLAG";
export const SET_ORGANIZATION_AVAILABILITY = "SET_ORGANIZATION_AVAILABILITY";
export const SET_ORG_ALLOW_CHANGE_REQUEST_EDIT = "SET_ALLOW_CHANGE_REQUEST_EDIT";
export const SET_ORG_MEMBERSHIP_DETAILS = "SET_ORG_MEMBERSHIP_DETAILS";
export const setAllAttributes = value => ({ type: SET_ALL_ORG_ATTRIBUTES, payload: value });
export const setOneBasicDetail = (name, value) => ({ type: SET_ONE_BASIC_DETAIL, payload: { [name]: value } });
export const resetOrganizationData = () => ({ type: RESET_ORGANIZATION_DATA });
export const setContacts = contacts => ({ type: SET_CONTACTS, payload: contacts });
export const setHeroImage = (raw, fileType) => ({ type: SET_HERO_IMAGE, payload: { raw, fileType } });
export const setGroups = groups => ({ type: SET_GROUPS, payload: groups });
export const setOrganizationStatus = status => ({ type: SET_ORGANIZATION_STATUS, payload: status });
export const setOrgHqAddressDetail = (name, value) => ({ type: SET_ORG_HQ_ADDRESS_DETAIL, payload: { [name]: value } });
export const setOrgMailingAddressDetail = (name, value) => ({
type: SET_ORG_MAILING_ADDRESS_DETAIL,
payload: { [name]: value },
});
export const setOrgOwner = owner => ({ type: SET_ORG_OWNER, payload: owner });
export const setOrgStateAll = state => ({ type: SET_ORG_STATE_ALL, payload: state });
export const setOrgStateState = state => ({ type: SET_ORG_STATE_STATE, payload: state });
export const setOrgSameMailingAddress = value => ({ type: SET_ORG_SAME_MAILING_ADDRESS, payload: value });
export const setOrgHeroImageUrl = url => ({ type: SET_ORG_HERO_IMAGE_URL, payload: url });
export const setOrgFoundInBlockchain = found => ({ type: SET_ORG_FOUND_IN_BLOCKCHAIN, payload: found });
export const setOrganizationTouchedFlag = touchFlag => ({
type: SET_ORGANIZATION_TOUCHED_FLAG,
payload: touchFlag,
});
export const setOrgAvailability = orgAvailability => ({
type: SET_ORGANIZATION_AVAILABILITY,
payload: orgAvailability,
});
export const setOrgAllowChangeRequestEdit = allow => ({ type: SET_ORG_ALLOW_CHANGE_REQUEST_EDIT, payload: allow });
export const setOrgMembershipDetails = details => ({ type: SET_ORG_MEMBERSHIP_DETAILS, payload: details });
const validateOrgIdAPI = orgUuid => async dispatch => {
const { token } = await dispatch(fetchAuthenticatedUser());
const apiName = APIEndpoints.REGISTRY.name;
const apiPath = APIPaths.ORGANIZATION_ID_VALIDATE(orgUuid);
const apiOptions = initializeAPIOptions(token);
return await API.get(apiName, apiPath, apiOptions);
};
export const validateOrgId = orgId => async dispatch => {
try {
dispatch(loaderActions.startValidateOrgIdLoader());
const { data, error } = await dispatch(validateOrgIdAPI(orgId));
if (error.code) {
throw new APIError(error.message);
}
dispatch(loaderActions.stopValidateOrgIdLoader());
return data;
} catch (error) {
dispatch(loaderActions.stopValidateOrgIdLoader());
throw error;
}
};
const uploadFileAPI = (assetType, fileBlob, orgUuid) => async dispatch => {
const { token } = await dispatch(fetchAuthenticatedUser());
let url = `${APIEndpoints.UTILITY.endpoint}${APIPaths.UPLOAD_FILE}?type=${assetType}&org_uuid=${orgUuid}`;
const res = await fetch(url, { method: "POST", headers: { authorization: token }, body: fileBlob });
return await res.json();
};
export const uploadFile = (assetType, fileBlob, orgUuid) => async dispatch => {
try {
dispatch(loaderActions.startAppLoader(LoaderContent.UPLOAD_FILE));
const { data, error } = await dispatch(uploadFileAPI(assetType, fileBlob, orgUuid));
if (error.code) {
throw new APIError(error.message);
}
dispatch(loaderActions.stopAppLoader());
return data;
} catch (error) {
dispatch(loaderActions.stopAppLoader());
throw error;
}
};
const payloadForSubmit = organization => {
// prettier-ignore
const { id, uuid, duns, name, type, website, shortDescription, longDescription, metadataIpfsUri,
contacts, assets, orgAddress } = organization;
const { hqAddress, mailingAddress, sameMailingAddress } = orgAddress;
const payload = {
origin: clientTypes.PUBLISHER_DAPP,
org_id: id,
org_uuid: uuid,
org_name: name,
duns_no: duns,
org_type: type,
metadata_ipfs_uri: metadataIpfsUri,
description: longDescription,
short_description: shortDescription,
url: website,
contacts: contacts.map(contact => ({ contact_type: contact.type, email: contact.email, phone: contact.phone })),
org_address: {
mail_address_same_hq_address: sameMailingAddress,
addresses: [
{
address_type: addressTypes.HEAD_QUARTERS,
street_address: hqAddress.street,
apartment: hqAddress.apartment,
city: hqAddress.city,
pincode: hqAddress.zip,
country: hqAddress.country,
},
{
address_type: addressTypes.MAILING,
street_address: sameMailingAddress ? hqAddress.street : mailingAddress.street,
apartment: sameMailingAddress ? hqAddress.apartment : mailingAddress.apartment,
city: sameMailingAddress ? hqAddress.city : mailingAddress.city,
pincode: sameMailingAddress ? hqAddress.zip : mailingAddress.zip,
country: sameMailingAddress ? hqAddress.country : mailingAddress.country,
},
],
},
assets: {
hero_image: {
url: organization.assets.heroImage.url,
ipfs_hash: organization.assets.heroImage.ipfsHash || "",
},
},
ownerAddress: organization.ownerAddress,
};
const groupsToBeSubmitted = organization.groups.map(group => ({
name: group.name,
id: group.id,
payment_address: group.paymentAddress,
payment_config: {
payment_expiration_threshold: Number(group.paymentConfig.paymentExpirationThreshold),
payment_channel_storage_type: group.paymentConfig.paymentChannelStorageType,
payment_channel_storage_client: {
connection_timeout: `${group.paymentConfig.paymentChannelStorageClient.connectionTimeout}s`,
request_timeout: `${group.paymentConfig.paymentChannelStorageClient.requestTimeout}s`,
endpoints: group.paymentConfig.paymentChannelStorageClient.endpoints,
},
},
}));
payload.groups = groupsToBeSubmitted;
if (assets.heroImage.url) {
payload.assets.hero_image = { ...payload.assets.hero_image, url: assets.heroImage.url };
} else {
payload.assets.hero_image = {
...payload.assets.hero_image,
raw: assets.heroImage.raw,
file_type: assets.heroImage.fileType,
};
}
return payload;
};
const getStatusAPI = () => async dispatch => {
const { token } = await dispatch(fetchAuthenticatedUser());
const apiName = APIEndpoints.REGISTRY.name;
const apiPath = APIPaths.ORG_SETUP;
const apiOptions = initializeAPIOptions(token);
return await API.get(apiName, apiPath, apiOptions);
};
const selectOrg = data => data[0];
const parseOrgData = selectedOrg => {
const parseOrgAddress = () => {
const { mail_address_same_hq_address, addresses } = selectedOrg.org_address;
const mailingAddressData = addresses.find(el => el.address_type === addressTypes.MAILING);
const hqAddressData = addresses.find(el => el.address_type === addressTypes.HEAD_QUARTERS);
const orgAddress = {
sameMailingAddress: mail_address_same_hq_address,
hqAddress: !hqAddressData
? {}
: {
street: hqAddressData.street_address,
apartment: hqAddressData.apartment,
city: hqAddressData.city,
zip: hqAddressData.pincode,
country: hqAddressData.country,
},
mailingAddress: !mailingAddressData
? {}
: {
street: mailingAddressData.street_address,
apartment: mailingAddressData.apartment,
city: mailingAddressData.city,
zip: mailingAddressData.pincode,
country: mailingAddressData.country,
},
};
return orgAddress;
};
const organization = {
state: selectedOrg.state,
id: selectedOrg.org_id,
uuid: selectedOrg.org_uuid,
name: selectedOrg.org_name,
type: selectedOrg.org_type,
longDescription: selectedOrg.description,
shortDescription: selectedOrg.short_description,
website: selectedOrg.url,
duns: selectedOrg.duns_no,
contacts: isEmpty(selectedOrg.contacts)
? defaultContacts
: selectedOrg.contacts.map(contact => ({
type: contact.contact_type,
email: contact.email,
phone: contact.phone,
})),
orgAddress: parseOrgAddress(),
assets: {
heroImage: {
url: selectedOrg.assets.hero_image.url,
ipfsHash: selectedOrg.assets.hero_image.ipfs_hash,
},
},
};
if (selectedOrg.assets && selectedOrg.assets.hero_image && selectedOrg.assets.hero_image.url) {
organization.assets = {};
organization.assets.heroImage = { url: selectedOrg.assets.hero_image.url };
}
if (!isEmpty(selectedOrg.groups)) {
const parsedGroups = selectedOrg.groups.map(group => ({
name: group.name,
id: group.id,
paymentAddress: group.payment_address,
paymentConfig: {
paymentExpirationThreshold: group.payment_config.payment_expiration_threshold,
paymentChannelStorageType: group.payment_config.payment_channel_storage_type,
paymentChannelStorageClient: {
connectionTimeout: group.payment_config.payment_channel_storage_client.connection_timeout.replace("s", ""),
requestTimeout: group.payment_config.payment_channel_storage_client.connection_timeout.replace("s", ""),
endpoints: group.payment_config.payment_channel_storage_client.endpoints,
},
},
}));
organization.groups = parsedGroups;
}
return organization;
};
export const getStatus = async dispatch => {
const { data } = await dispatch(getStatusAPI());
if (isEmpty(data)) {
return data;
}
const selectedOrg = selectOrg(data);
const organization = parseOrgData(selectedOrg);
const orgDetailsInBlockchain = await findOrganizationInBlockchain(organization.id);
dispatch(setOrgFoundInBlockchain(orgDetailsInBlockchain.found));
dispatch(setAllAttributes(organization));
return data;
};
const finishLaterAPI = payload => async dispatch => {
const { token } = await dispatch(fetchAuthenticatedUser());
const apiName = APIEndpoints.REGISTRY.name;
const apiPath = APIPaths.UPDATE_ORG(payload.org_uuid);
const queryStringParameters = { action: orgSubmitActions.DRAFT };
const apiOptions = initializeAPIOptions(token, payload, queryStringParameters);
return await API.post(apiName, apiPath, apiOptions);
};
export const finishLater = (organization, type = "") => async dispatch => {
try {
dispatch(loaderActions.startAppLoader(LoaderContent.ORG_SETUP_FINISH_LATER));
const payload = payloadForSubmit(organization);
if (type === "ONBOARDING") {
payload.groups = [];
}
await dispatch(finishLaterAPI(payload));
dispatch(loaderActions.stopAppLoader());
return payload;
} catch (error) {
dispatch(loaderActions.stopAppLoader());
throw error;
}
};
const submitForApprovalAPI = payload => async dispatch => {
const { token } = await dispatch(fetchAuthenticatedUser());
const apiName = APIEndpoints.REGISTRY.name;
const apiPath = APIPaths.UPDATE_ORG(payload.org_uuid);
const queryStringParameters = { action: orgSubmitActions.SUBMIT };
const apiOptions = initializeAPIOptions(token, payload, queryStringParameters);
return await API.post(apiName, apiPath, apiOptions);
};
export const submitForApproval = organization => async dispatch => {
try {
dispatch(loaderActions.startAppLoader(LoaderContent.ORG_SETUP_SUBMIT_FOR_APPROVAL));
const payload = payloadForSubmit(organization);
const { status, error } = await dispatch(submitForApprovalAPI(payload));
if (status !== responseStatus.SUCCESS) {
throw new APIError(error.message);
}
dispatch(loaderActions.stopAppLoader());
} catch (error) {
dispatch(loaderActions.stopAppLoader());
throw error;
}
};
const createOrganizationAPI = payload => async dispatch => {
const { token } = await dispatch(fetchAuthenticatedUser());
const apiName = APIEndpoints.ORCHESTRATOR.name;
const apiPath = APIPaths.CREATE_ORG_ORG;
const apiOptions = initializeAPIOptions(token, payload);
return await API.post(apiName, apiPath, apiOptions);
};
export const createOrganization = organization => async dispatch => {
try {
dispatch(loaderActions.startAppLoader(LoaderContent.ORG_SETUP_CREATE));
const payload = payloadForSubmit(organization);
payload.groups = [];
const { data, error } = await dispatch(createOrganizationAPI(payload));
if (error.code) {
throw new APIError(error.message);
}
const createdOrganization = parseOrgData(data);
dispatch(setAllAttributes(createdOrganization));
dispatch(setOrgFoundInBlockchain(false));
dispatch(loaderActions.stopAppLoader());
return data;
} catch (error) {
dispatch(loaderActions.stopAppLoader());
throw error;
}
};
const publishToIPFSAPI = uuid => async dispatch => {
const { token } = await dispatch(fetchAuthenticatedUser());
const apiName = APIEndpoints.REGISTRY.name;
const apiPath = APIPaths.PUBLISH_TO_IPFS(uuid);
const apiOptions = initializeAPIOptions(token);
return await API.post(apiName, apiPath, apiOptions);
};
export const publishToIPFS = uuid => async dispatch => {
try {
dispatch(loaderActions.startAppLoader(LoaderContent.ORG_SETUP_PUBLISH_TO_IPFS));
const { status, data, error } = await dispatch(publishToIPFSAPI(uuid));
dispatch(setOneBasicDetail("metadataIpfsUri", data.metadata_ipfs_uri));
if (status !== responseStatus.SUCCESS) {
dispatch(loaderActions.stopAppLoader());
throw new APIError(error.message);
}
return data.metadata_ipfs_uri;
} catch (error) {
dispatch(loaderActions.stopAppLoader());
throw error;
}
};
const saveTransactionAPI = (orgUuid, hash, ownerAddress) => async dispatch => {
const { token } = await dispatch(fetchAuthenticatedUser());
const apiName = APIEndpoints.REGISTRY.name;
const apiPath = APIPaths.SAVE_TRANSACTION(orgUuid);
const body = { transaction_hash: hash, wallet_address: ownerAddress };
const apiOptions = initializeAPIOptions(token, body);
return await API.post(apiName, apiPath, apiOptions);
};
const saveTransaction = (orgUuid, hash, ownerAddress) => async dispatch => {
try {
dispatch(loaderActions.startAppLoader(LoaderContent.ORG_SETUP_SAVING_TRANSACTION));
const { status, error } = await dispatch(saveTransactionAPI(orgUuid, hash, ownerAddress));
if (status !== responseStatus.SUCCESS) {
throw new APIError(error.message);
}
} catch (error) {
dispatch(loaderActions.stopAppLoader());
throw error;
}
};
const registerOrganizationInBlockChain = (organization, metadataIpfsUri, history) => async dispatch => {
dispatch(loaderActions.startAppLoader(LoaderContent.METAMASK_TRANSACTION));
const sdk = await initSDK();
const orgId = organization.id;
const orgMetadataURI = metadataIpfsUri;
const members = [organization.ownerAddress];
return new Promise((resolve, reject) => {
try {
const method = sdk._registryContract
.createOrganization(orgId, orgMetadataURI, members)
.send()
.on(blockChainEvents.TRANSACTION_HASH, async hash => {
await dispatch(saveTransaction(organization.uuid, hash, organization.ownerAddress));
dispatch(loaderActions.startAppLoader(LoaderContent.BLOCKHAIN_SUBMISSION));
resolve(hash);
})
.once(blockChainEvents.CONFIRMATION, async () => {
dispatch(setOrgStateState(organizationSetupStatuses.PUBLISH_IN_PROGRESS));
await history.push(GlobalRoutes.SERVICES.path.replace(":orgUuid", organization.uuid));
await dispatch(setOrgFoundInBlockchain(true));
dispatch(loaderActions.stopAppLoader());
await method.off();
})
.on(blockChainEvents.ERROR, error => {
dispatch(loaderActions.stopAppLoader());
reject(new MetamaskError(error.message));
});
} catch (error) {
reject(error);
}
});
};
const updateOrganizationInBlockChain = (organization, metadataIpfsUri, history) => async dispatch => {
const sdk = await initSDK();
const orgId = organization.id;
const orgMetadataURI = metadataIpfsUri;
return new Promise((resolve, reject) => {
const method = sdk._registryContract
.changeOrganizationMetadataURI(orgId, orgMetadataURI)
.send()
.on(blockChainEvents.TRANSACTION_HASH, async hash => {
await dispatch(saveTransaction(organization.uuid, hash, organization.ownerAddress));
dispatch(loaderActions.startAppLoader(LoaderContent.BLOCKHAIN_SUBMISSION));
resolve(hash);
})
.once(blockChainEvents.CONFIRMATION, async () => {
dispatch(setOrgStateState(organizationSetupStatuses.PUBLISH_IN_PROGRESS));
await history.push(GlobalRoutes.SERVICES.path.replace(":orgUuid", organization.uuid));
dispatch(loaderActions.stopAppLoader());
await method.off();
})
.on(blockChainEvents.ERROR, error => {
dispatch(loaderActions.stopAppLoader());
reject(new MetamaskError(error.message));
});
});
};
const findOrganizationInBlockchain = async orgId => {
const registry = new RegistryContract();
return await registry.getOrganizationById(orgId).call();
};
export const publishOrganizationInBlockchain = (organization, metadataIpfsUri, history) => async dispatch => {
try {
const orgId = organization.id;
const orgMetadataURI = metadataIpfsUri;
const OrganizationDetailsFromBlockChain = await findOrganizationInBlockchain(orgId);
if (!OrganizationDetailsFromBlockChain.found) {
return await dispatch(registerOrganizationInBlockChain(organization, orgMetadataURI, history));
}
return await dispatch(updateOrganizationInBlockChain(organization, orgMetadataURI, history));
} catch (error) {
dispatch(loaderActions.stopAppLoader());
throw error;
}
};
const getMembersAPI = (uuid, role) => async dispatch => {
const { token } = await dispatch(fetchAuthenticatedUser());
const apiName = APIEndpoints.REGISTRY.name;
const apiPath = APIPaths.GET_MEMBERS(uuid);
const queryStringParameters = { role };
const apiOptions = initializeAPIOptions(token, null, queryStringParameters);
return await API.get(apiName, apiPath, apiOptions);
};
export const getOwner = uuid => async dispatch => {
const { data } = await dispatch(getMembersAPI(uuid, userRoles.OWNER));
await dispatch(setOrgOwner(data[0].username));
return data;
};
export const getMembershipDetails = (uuid, username) => async dispatch => {
const { data } = await dispatch(getMembersAPI(uuid, userRoles.MEMBER));
const membershipDetails = data.find(el => el.username === username);
if (membershipDetails) {
await dispatch(setOrgMembershipDetails(membershipDetails));
}
return membershipDetails;
};
export const initializeOrg = username => async dispatch => {
try {
const data = await dispatch(getStatus);
if (data && data[0]) {
const orgUuid = data[0].org_uuid;
await Promise.all[(dispatch(getOwner(orgUuid)), dispatch(getMembershipDetails(orgUuid, username)))];
}
} catch (error) {
Sentry.captureException(error);
dispatch(errorActions.setAppError(error));
// ! do not remove this catch. It stops the error bubbling and allows
// ! the login to work seamlessly even if the initializeOrg fails
return undefined;
}
};
| 39.651706 | 120 | 0.719596 |
9c3df8830867b8aab4e426754654f3ab5a21b31f
| 611 |
swift
|
Swift
|
SinaWeibo_swift/SinaWeibo_swift/Classess/Tools/Common.swift
|
ios-archy/Sinaweibo_swift
|
4b5a946e1a2d54977a0081f41421fab42061c8a2
|
[
"MIT"
] | null | null | null |
SinaWeibo_swift/SinaWeibo_swift/Classess/Tools/Common.swift
|
ios-archy/Sinaweibo_swift
|
4b5a946e1a2d54977a0081f41421fab42061c8a2
|
[
"MIT"
] | null | null | null |
SinaWeibo_swift/SinaWeibo_swift/Classess/Tools/Common.swift
|
ios-archy/Sinaweibo_swift
|
4b5a946e1a2d54977a0081f41421fab42061c8a2
|
[
"MIT"
] | null | null | null |
//
// Common.swift
// SinaWeibo_swift
//
// Created by archy on 16/10/25.
// Copyright © 2016年 archy. All rights reserved.
//
import Foundation
//MARK: --授权常量
let app_key = "3216380832"
let app_secret = "415a1932f3a79577ff1979606e55ebed"
let redirect_uri = "http://ios.itcast.cn"
// MARK:- 选择照片的通知常量
let PicPickerAddPhotoNote = "PicPickerAddPhotoNote"
let PicPickerRemovePhotoNote = "PicPickerRemovePhotoNote"
// MARK:- 照片浏览器的通知常量
let ShowPhotoBrowserNote = "ShowPhotoBrowserNote"
let ShowPhotoBrowserIndexKey = "ShowPhotoBrowserIndexKey"
let ShowPhotoBrowserUrlsKey = "ShowPhotoBrowserUrlsKey"
| 19.709677 | 57 | 0.767594 |
327d27c6743b26b15e8e28f7f7e90cdb9a5bf69b
| 814 |
sql
|
SQL
|
sql/user_role.sql
|
tiaodan/bugcount_flask
|
7cb8aaf486e7d845acb3d5f42e73919ee939d979
|
[
"MulanPSL-1.0"
] | null | null | null |
sql/user_role.sql
|
tiaodan/bugcount_flask
|
7cb8aaf486e7d845acb3d5f42e73919ee939d979
|
[
"MulanPSL-1.0"
] | null | null | null |
sql/user_role.sql
|
tiaodan/bugcount_flask
|
7cb8aaf486e7d845acb3d5f42e73919ee939d979
|
[
"MulanPSL-1.0"
] | null | null | null |
/*
Navicat MySQL Data Transfer
Source Server : 192.168.1.156
Source Server Version : 50173
Source Host : 192.168.1.156:3306
Source Database : myomc
Target Server Type : MYSQL
Target Server Version : 50173
File Encoding : 65001
Date: 2020-07-15 16:45:46
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `user_role`
-- ----------------------------
DROP TABLE IF EXISTS `user_role`;
CREATE TABLE `user_role` (
`userId` int(11) NOT NULL,
`roleId` int(11) NOT NULL,
PRIMARY KEY (`userId`,`roleId`),
KEY `roleId` (`roleId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of user_role
-- ----------------------------
INSERT INTO `user_role` VALUES ('8', '6');
INSERT INTO `user_role` VALUES ('9', '7');
| 23.941176 | 42 | 0.567568 |
123c271fd26ed7c816de06ae701b07d5a15c7efe
| 588 |
c
|
C
|
Store_Bill/Storebill.c
|
Puppalakoushik/C-Language-Projets
|
245f670066e34dd5a443cd2eb488b6886c9a276d
|
[
"MIT"
] | 1 |
2020-12-11T03:54:54.000Z
|
2020-12-11T03:54:54.000Z
|
Store_Bill/Storebill.c
|
puppala-koushik/C-Language-Projets
|
245f670066e34dd5a443cd2eb488b6886c9a276d
|
[
"MIT"
] | null | null | null |
Store_Bill/Storebill.c
|
puppala-koushik/C-Language-Projets
|
245f670066e34dd5a443cd2eb488b6886c9a276d
|
[
"MIT"
] | null | null | null |
/*This is an Generated Bill of two products
Maker:koushikpuppala
Date:23-Oct-20
Time:8:10 pm*/
#include <stdio.h>
main()
{
printf(" Hello!...Welcome to our store\n");
int x,y,z;
x=0;
y=0;
z=0;
printf("\n");
printf("Price of AXE body perfume....: ",x);
scanf("%d",&x);
printf("Price of Fair and Handsome...: ",y);
scanf("%d",&y);
z=x+y;
printf("Total price of goods.........: %d\n",z);
printf("\n");
printf(" Have a nice day\n");
printf(" Vist Again");
getch();
printf("\n");
}
| 22.615385 | 53 | 0.494898 |
dde814d0d2b72f46e9d81bf40cce48c80aaf6c3a
| 723 |
go
|
Go
|
settings/comm_test.go
|
eaglexiang/go
|
5de3d9cf50d3a9b19b865236e00ed590ad5e66d8
|
[
"MIT"
] | null | null | null |
settings/comm_test.go
|
eaglexiang/go
|
5de3d9cf50d3a9b19b865236e00ed590ad5e66d8
|
[
"MIT"
] | null | null | null |
settings/comm_test.go
|
eaglexiang/go
|
5de3d9cf50d3a9b19b865236e00ed590ad5e66d8
|
[
"MIT"
] | null | null | null |
/*
* @Author: EagleXiang
* @LastEditors: EagleXiang
* @Email: eagle.xiang@outlook.com
* @Github: https://github.com/eaglexiang
* @Date: 2019-08-26 22:29:35
* @LastEditTime: 2019-08-28 20:22:43
*/
package settings
import (
"testing"
)
func Test_getChild(t *testing.T) {
_, _, ok := getChild("testKey")
if ok {
t.Error("testKey should not has className")
}
className, subKey, ok := getChild("testParent.testKey")
if !ok {
t.Error("testParent.testKey should has className testParent")
}
if className != "testParent" {
t.Error("testParent.testKey should has className testParent but ", className)
}
if subKey != "testKey" {
t.Error("testParent.testKey should has subKey testKey but ", subKey)
}
}
| 21.909091 | 79 | 0.687414 |
7be12228ea880d4e19ba3758840c366eedb3d195
| 2,180 |
rb
|
Ruby
|
recipes/efa_install.rb
|
rexcsn/cfncluster-cookbook
|
16aa17998c6dcdf264c3abe05d52f0ad64d75ef4
|
[
"Apache-2.0"
] | null | null | null |
recipes/efa_install.rb
|
rexcsn/cfncluster-cookbook
|
16aa17998c6dcdf264c3abe05d52f0ad64d75ef4
|
[
"Apache-2.0"
] | 27 |
2021-05-05T07:58:18.000Z
|
2022-03-23T07:17:01.000Z
|
recipes/efa_install.rb
|
rexcsn/aws-parallelcluster-cookbook
|
16aa17998c6dcdf264c3abe05d52f0ad64d75ef4
|
[
"Apache-2.0"
] | null | null | null |
# frozen_string_literal: true
#
# Cookbook Name:: aws-parallelcluster
# Recipe:: efa_install
#
# Copyright 2013-2019 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.
efa_tarball = "#{node['cfncluster']['sources_dir']}/aws-efa-installer.tar.gz"
# Get EFA Installer
remote_file efa_tarball do
source node['cfncluster']['efa']['installer_url']
mode '0644'
retries 3
retry_delay 5
not_if { ::File.exist?(efa_tarball) }
end
# default openmpi installation conflicts with new install
# new one is installed in /opt/amazon/efa/bin/
case node['platform_family']
when 'rhel', 'amazon'
package %w[openmpi-devel openmpi] do
action :remove
not_if { ::Dir.exist?('/opt/amazon/efa') }
end
when 'debian'
package "libopenmpi-dev" do
action :remove
not_if { ::Dir.exist?('/opt/amazon/efa') }
end
end
installer_options = "-y"
# skip efa-kmod installation on not supported platforms
installer_options += " -k" unless node['conditions']['efa_supported']
# enable gpudirect support
installer_options += " -g" if efa_gdr_enabled?
bash "install efa" do
cwd node['cfncluster']['sources_dir']
code <<-EFAINSTALL
set -e
tar -xzf #{efa_tarball}
cd aws-efa-installer
./efa_installer.sh #{installer_options}
EFAINSTALL
not_if { ::Dir.exist?('/opt/amazon/efa') && !efa_gdr_enabled? }
end
# EFA installer v1.11.0 removes libibverbs-core, which contains hwloc-devel during install
# hwloc-devel is needed to compile SGE
# Reinstall hwloc-devel by itself explicitly
package "install hwloc-devel explicitly" do
package_name value_for_platform(
'default' => "hwloc-devel",
'ubuntu' => { 'default' => "libhwloc-dev" }
)
retries 3
retry_delay 5
end
| 30.277778 | 121 | 0.723394 |
ad101aac1cbd61b36a455d160b94a05920cbf073
| 21,584 |
rs
|
Rust
|
src/pnm/encoder.rs
|
Robzz/image-1
|
74ea4c83a367f05bb8680dedc23f46381316fb37
|
[
"MIT"
] | null | null | null |
src/pnm/encoder.rs
|
Robzz/image-1
|
74ea4c83a367f05bb8680dedc23f46381316fb37
|
[
"MIT"
] | null | null | null |
src/pnm/encoder.rs
|
Robzz/image-1
|
74ea4c83a367f05bb8680dedc23f46381316fb37
|
[
"MIT"
] | null | null | null |
//! Encoding of PNM Images
use std::fmt;
use std::io;
use std::io::Write;
use super::AutoBreak;
use super::{ArbitraryHeader, ArbitraryTuplType, BitmapHeader, GraymapHeader, PixmapHeader};
use super::{HeaderRecord, PNMHeader, PNMSubtype, SampleEncoding};
use color::{num_components, ColorType};
use byteorder::{BigEndian, WriteBytesExt};
enum HeaderStrategy {
Dynamic,
Subtype(PNMSubtype),
Chosen(PNMHeader),
}
#[derive(Clone, Copy)]
pub enum FlatSamples<'a> {
U8(&'a [u8]),
U16(&'a [u16]),
}
/// Encodes images to any of the `pnm` image formats.
pub struct PNMEncoder<W: Write> {
writer: W,
header: HeaderStrategy,
}
/// Encapsulate the checking system in the type system. Non of the fields are actually accessed
/// but requiring them forces us to validly construct the struct anyways.
struct CheckedImageBuffer<'a> {
_image: FlatSamples<'a>,
_width: u32,
_height: u32,
_color: ColorType,
}
// Check the header against the buffer. Each struct produces the next after a check.
struct UncheckedHeader<'a> {
header: &'a PNMHeader,
}
struct CheckedDimensions<'a> {
unchecked: UncheckedHeader<'a>,
width: u32,
height: u32,
}
struct CheckedHeaderColor<'a> {
dimensions: CheckedDimensions<'a>,
color: ColorType,
}
struct CheckedHeader<'a> {
color: CheckedHeaderColor<'a>,
encoding: TupleEncoding<'a>,
_image: CheckedImageBuffer<'a>,
}
enum TupleEncoding<'a> {
PbmBits {
samples: FlatSamples<'a>,
width: u32,
},
Ascii {
samples: FlatSamples<'a>,
},
Bytes {
samples: FlatSamples<'a>,
},
}
impl<W: Write> PNMEncoder<W> {
/// Create new PNMEncoder from the `writer`.
///
/// The encoded images will have some `pnm` format. If more control over the image type is
/// required, use either one of `with_subtype` or `with_header`. For more information on the
/// behaviour, see `with_dynamic_header`.
pub fn new(writer: W) -> Self {
PNMEncoder {
writer,
header: HeaderStrategy::Dynamic,
}
}
/// Encode a specific pnm subtype image.
///
/// The magic number and encoding type will be chosen as provided while the rest of the header
/// data will be generated dynamically. Trying to encode incompatible images (e.g. encoding an
/// RGB image as Graymap) will result in an error.
///
/// This will overwrite the effect of earlier calls to `with_header` and `with_dynamic_header`.
pub fn with_subtype(self, subtype: PNMSubtype) -> Self {
PNMEncoder {
writer: self.writer,
header: HeaderStrategy::Subtype(subtype),
}
}
/// Enforce the use of a chosen header.
///
/// While this option gives the most control over the actual written data, the encoding process
/// will error in case the header data and image parameters do not agree. It is the users
/// obligation to ensure that the width and height are set accordingly, for example.
///
/// Choose this option if you want a lossless decoding/encoding round trip.
///
/// This will overwrite the effect of earlier calls to `with_subtype` and `with_dynamic_header`.
pub fn with_header(self, header: PNMHeader) -> Self {
PNMEncoder {
writer: self.writer,
header: HeaderStrategy::Chosen(header),
}
}
/// Create the header dynamically for each image.
///
/// This is the default option upon creation of the encoder. With this, most images should be
/// encodable but the specific format chosen is out of the users control. The pnm subtype is
/// chosen arbitrarily by the library.
///
/// This will overwrite the effect of earlier calls to `with_subtype` and `with_header`.
pub fn with_dynamic_header(self) -> Self {
PNMEncoder {
writer: self.writer,
header: HeaderStrategy::Dynamic,
}
}
/// Encode an image whose samples are represented as `u8`.
///
/// Some `pnm` subtypes are incompatible with some color options, a chosen header most
/// certainly with any deviation from the original decoded image.
pub fn encode<'s, S>(
&mut self,
image: S,
width: u32,
height: u32,
color: ColorType,
) -> io::Result<()>
where
S: Into<FlatSamples<'s>>,
{
let image = image.into();
match self.header {
HeaderStrategy::Dynamic => self.write_dynamic_header(image, width, height, color),
HeaderStrategy::Subtype(subtype) => {
self.write_subtyped_header(subtype, image, width, height, color)
}
HeaderStrategy::Chosen(ref header) => {
Self::write_with_header(&mut self.writer, header, image, width, height, color)
}
}
}
/// Choose any valid pnm format that the image can be expressed in and write its header.
///
/// Returns how the body should be written if successful.
fn write_dynamic_header(
&mut self,
image: FlatSamples,
width: u32,
height: u32,
color: ColorType,
) -> io::Result<()> {
let depth = num_components(color) as u32;
let (maxval, tupltype) = match color {
ColorType::Gray(1) => (1, ArbitraryTuplType::BlackAndWhite),
ColorType::GrayA(1) => (1, ArbitraryTuplType::BlackAndWhiteAlpha),
ColorType::Gray(n @ 1...16) => ((1 << n) - 1, ArbitraryTuplType::Grayscale),
ColorType::GrayA(n @ 1...16) => ((1 << n) - 1, ArbitraryTuplType::GrayscaleAlpha),
ColorType::RGB(n @ 1...16) => ((1 << n) - 1, ArbitraryTuplType::RGB),
ColorType::RGBA(n @ 1...16) => ((1 << n) - 1, ArbitraryTuplType::RGBAlpha),
_ => {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
&format!("Encoding colour type {:?} is not supported", color)[..],
))
}
};
let header = PNMHeader {
decoded: HeaderRecord::Arbitrary(ArbitraryHeader {
width,
height,
depth,
maxval,
tupltype: Some(tupltype),
}),
encoded: None,
};
Self::write_with_header(&mut self.writer, &header, image, width, height, color)
}
/// Try to encode the image with the chosen format, give its corresponding pixel encoding type.
fn write_subtyped_header(
&mut self,
subtype: PNMSubtype,
image: FlatSamples,
width: u32,
height: u32,
color: ColorType,
) -> io::Result<()> {
let header = match (subtype, color) {
(PNMSubtype::ArbitraryMap, color) => {
return self.write_dynamic_header(image, width, height, color)
}
(PNMSubtype::Pixmap(encoding), ColorType::RGB(8)) => PNMHeader {
decoded: HeaderRecord::Pixmap(PixmapHeader {
encoding,
width,
height,
maxval: 255,
}),
encoded: None,
},
(PNMSubtype::Graymap(encoding), ColorType::Gray(8)) => PNMHeader {
decoded: HeaderRecord::Graymap(GraymapHeader {
encoding,
width,
height,
maxwhite: 255,
}),
encoded: None,
},
(PNMSubtype::Bitmap(encoding), ColorType::Gray(8))
| (PNMSubtype::Bitmap(encoding), ColorType::Gray(1)) => PNMHeader {
decoded: HeaderRecord::Bitmap(BitmapHeader {
encoding,
width,
height,
}),
encoded: None,
},
(_, _) => {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
"Color type can not be represented in the chosen format",
))
}
};
Self::write_with_header(&mut self.writer, &header, image, width, height, color)
}
/// Try to encode the image with the chosen header, checking if values are correct.
///
/// Returns how the body should be written if successful.
fn write_with_header(
writer: &mut Write,
header: &PNMHeader,
image: FlatSamples,
width: u32,
height: u32,
color: ColorType,
) -> io::Result<()> {
let unchecked = UncheckedHeader { header };
unchecked
.check_header_dimensions(width, height)?
.check_header_color(color)?
.check_sample_values(image)?
.write_header(writer)?
.write_image(writer)
}
}
impl<'a> CheckedImageBuffer<'a> {
fn check(
image: FlatSamples<'a>,
width: u32,
height: u32,
color: ColorType,
) -> io::Result<CheckedImageBuffer<'a>> {
let components = num_components(color);
let uwidth = width as usize;
let uheight = height as usize;
match Some(components)
.and_then(|v| v.checked_mul(uwidth))
.and_then(|v| v.checked_mul(uheight))
{
None => Err(io::Error::new(
io::ErrorKind::InvalidInput,
&format!(
"Image dimensions invalid: {}×{}×{} (w×h×d)",
width, height, components
)[..],
)),
Some(v) if v == image.len() => Ok(CheckedImageBuffer {
_image: image,
_width: width,
_height: height,
_color: color,
}),
Some(_) => Err(io::Error::new(
io::ErrorKind::InvalidInput,
&"Image buffer does not correspond to size and colour".to_string()[..],
)),
}
}
}
impl<'a> UncheckedHeader<'a> {
fn check_header_dimensions(self, width: u32, height: u32) -> io::Result<CheckedDimensions<'a>> {
if self.header.width() != width || self.header.height() != height {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
"Chosen header does not match Image dimensions",
));
}
Ok(CheckedDimensions {
unchecked: self,
width,
height,
})
}
}
impl<'a> CheckedDimensions<'a> {
// Check color compatibility with the header. This will only error when we are certain that
// the comination is bogus (e.g. combining Pixmap and Palette) but allows uncertain
// combinations (basically a ArbitraryTuplType::Custom with any color of fitting depth).
fn check_header_color(self, color: ColorType) -> io::Result<CheckedHeaderColor<'a>> {
let components = match color {
ColorType::Gray(_) => 1,
ColorType::GrayA(_) => 2,
ColorType::Palette(_) | ColorType::RGB(_) => 3,
ColorType::RGBA(_) => 4,
};
match *self.unchecked.header {
PNMHeader {
decoded: HeaderRecord::Bitmap(_),
..
} => match color {
ColorType::Gray(_) => (),
_ => {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
"PBM format only support ColorType::Gray",
))
}
},
PNMHeader {
decoded: HeaderRecord::Graymap(_),
..
} => match color {
ColorType::Gray(_) => (),
_ => {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
"PGM format only support ColorType::Gray",
))
}
},
PNMHeader {
decoded: HeaderRecord::Pixmap(_),
..
} => match color {
ColorType::RGB(_) => (),
_ => {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
"PPM format only support ColorType::RGB",
))
}
},
PNMHeader {
decoded:
HeaderRecord::Arbitrary(ArbitraryHeader {
depth,
ref tupltype,
..
}),
..
} => match (tupltype, color) {
(&Some(ArbitraryTuplType::BlackAndWhite), ColorType::Gray(_)) => (),
(&Some(ArbitraryTuplType::BlackAndWhiteAlpha), ColorType::GrayA(_)) => (),
(&Some(ArbitraryTuplType::Grayscale), ColorType::Gray(_)) => (),
(&Some(ArbitraryTuplType::GrayscaleAlpha), ColorType::GrayA(_)) => (),
(&Some(ArbitraryTuplType::RGB), ColorType::RGB(_)) => (),
(&Some(ArbitraryTuplType::RGBAlpha), ColorType::RGBA(_)) => (),
(&None, _) if depth == components => (),
(&Some(ArbitraryTuplType::Custom(_)), _) if depth == components => (),
_ if depth != components => {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
format!("Depth mismatch: header {} vs. color {}", depth, components),
))
}
_ => {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
"Invalid color type for selected PAM color type",
))
}
},
}
Ok(CheckedHeaderColor {
dimensions: self,
color,
})
}
}
impl<'a> CheckedHeaderColor<'a> {
fn check_sample_values(self, image: FlatSamples<'a>) -> io::Result<CheckedHeader<'a>> {
let header_maxval = match self.dimensions.unchecked.header.decoded {
HeaderRecord::Bitmap(_) => 1,
HeaderRecord::Graymap(GraymapHeader { maxwhite, .. }) => maxwhite,
HeaderRecord::Pixmap(PixmapHeader { maxval, .. }) => maxval,
HeaderRecord::Arbitrary(ArbitraryHeader { maxval, .. }) => maxval,
};
// We trust the image color bit count to be correct at least.
let max_sample = match self.color {
// Protects against overflows from shifting and gives a better error.
ColorType::Gray(n)
| ColorType::GrayA(n)
| ColorType::Palette(n)
| ColorType::RGB(n)
| ColorType::RGBA(n) if n > 16 =>
{
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
"Encoding colors with a bit depth greater 16 not supported",
))
}
ColorType::Gray(n)
| ColorType::GrayA(n)
| ColorType::Palette(n)
| ColorType::RGB(n)
| ColorType::RGBA(n) => (1 << n) - 1,
};
// Avoid the performance heavy check if possible, e.g. if the header has been chosen by us.
if header_maxval < max_sample && !image.all_smaller(header_maxval) {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
"Sample value greater than allowed for chosen header",
));
}
let encoding = image.encoding_for(&self.dimensions.unchecked.header.decoded);
let image = CheckedImageBuffer::check(
image,
self.dimensions.width,
self.dimensions.height,
self.color,
)?;
Ok(CheckedHeader {
color: self,
encoding,
_image: image,
})
}
}
impl<'a> CheckedHeader<'a> {
fn write_header(self, writer: &mut Write) -> io::Result<TupleEncoding<'a>> {
self.header().write(writer)?;
Ok(self.encoding)
}
fn header(&self) -> &PNMHeader {
self.color.dimensions.unchecked.header
}
}
struct SampleWriter<'a>(&'a mut Write);
impl<'a> SampleWriter<'a> {
fn write_samples_ascii<V>(self, samples: V) -> io::Result<()>
where
V: Iterator,
V::Item: fmt::Display,
{
let mut auto_break_writer = AutoBreak::new(self.0, 70);
for value in samples {
write!(auto_break_writer, "{} ", value)?;
}
auto_break_writer.flush()
}
fn write_pbm_bits<V>(self, samples: &[V], width: u32) -> io::Result<()>
/* Default gives 0 for all primitives. TODO: replace this with `Zeroable` once it hits stable */
where
V: Default + Eq + Copy,
{
// The length of an encoded scanline
let line_width = (width - 1) / 8 + 1;
// We'll be writing single bytes, so buffer
let mut line_buffer = Vec::with_capacity(line_width as usize);
for line in samples.chunks(width as usize) {
for byte_bits in line.chunks(8) {
let mut byte = 0u8;
for i in 0..8 {
// Black pixels are encoded as 1s
if let Some(&v) = byte_bits.get(i) {
if v == V::default() {
byte |= 1u8 << (7 - i)
}
}
}
line_buffer.push(byte)
}
self.0.write_all(line_buffer.as_slice())?;
line_buffer.clear();
}
self.0.flush()
}
}
impl<'a> FlatSamples<'a> {
fn len(&self) -> usize {
match *self {
FlatSamples::U8(arr) => arr.len(),
FlatSamples::U16(arr) => arr.len(),
}
}
fn all_smaller(&self, max_val: u32) -> bool {
match *self {
FlatSamples::U8(arr) => arr.iter().any(|&val| u32::from(val) > max_val),
FlatSamples::U16(arr) => arr.iter().any(|&val| u32::from(val) > max_val),
}
}
fn encoding_for(&self, header: &HeaderRecord) -> TupleEncoding<'a> {
match *header {
HeaderRecord::Bitmap(BitmapHeader {
encoding: SampleEncoding::Binary,
width,
..
}) => TupleEncoding::PbmBits {
samples: *self,
width,
},
HeaderRecord::Bitmap(BitmapHeader {
encoding: SampleEncoding::Ascii,
..
}) => TupleEncoding::Ascii { samples: *self },
HeaderRecord::Arbitrary(_) => TupleEncoding::Bytes { samples: *self },
HeaderRecord::Graymap(GraymapHeader {
encoding: SampleEncoding::Ascii,
..
})
| HeaderRecord::Pixmap(PixmapHeader {
encoding: SampleEncoding::Ascii,
..
}) => TupleEncoding::Ascii { samples: *self },
HeaderRecord::Graymap(GraymapHeader {
encoding: SampleEncoding::Binary,
..
})
| HeaderRecord::Pixmap(PixmapHeader {
encoding: SampleEncoding::Binary,
..
}) => TupleEncoding::Bytes { samples: *self },
}
}
}
impl<'a> From<&'a [u8]> for FlatSamples<'a> {
fn from(samples: &'a [u8]) -> Self {
FlatSamples::U8(samples)
}
}
impl<'a> From<&'a [u16]> for FlatSamples<'a> {
fn from(samples: &'a [u16]) -> Self {
FlatSamples::U16(samples)
}
}
impl<'a> TupleEncoding<'a> {
fn write_image(&self, writer: &mut Write) -> io::Result<()> {
match *self {
TupleEncoding::PbmBits {
samples: FlatSamples::U8(samples),
width,
} => SampleWriter(writer).write_pbm_bits(samples, width),
TupleEncoding::PbmBits {
samples: FlatSamples::U16(samples),
width,
} => SampleWriter(writer).write_pbm_bits(samples, width),
TupleEncoding::Bytes {
samples: FlatSamples::U8(samples),
} => writer.write_all(samples),
TupleEncoding::Bytes {
samples: FlatSamples::U16(samples),
} => samples
.iter()
.map(|&sample| writer.write_u16::<BigEndian>(sample))
.collect(),
TupleEncoding::Ascii {
samples: FlatSamples::U8(samples),
} => SampleWriter(writer).write_samples_ascii(samples.iter()),
TupleEncoding::Ascii {
samples: FlatSamples::U16(samples),
} => SampleWriter(writer).write_samples_ascii(samples.iter()),
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn custom_header_and_color() {
let data: [u8; 12] = [0, 0, 0, 1, 1, 1, 255, 255, 255, 0, 0, 0];
let header = ArbitraryHeader {
width: 2,
height: 2,
depth: 3,
maxval: 255,
tupltype: Some(ArbitraryTuplType::Custom("Palette".to_string())),
};
let mut output = Vec::new();
PNMEncoder::new(&mut output)
.with_header(header.into())
.encode(&data[..], 2, 2, ColorType::Palette(8))
.expect("Failed encoding custom color value");
}
}
| 33.206154 | 100 | 0.519413 |
85d4b8da5d544c4dfd4ec02cf533813138b7bc3a
| 266 |
js
|
JavaScript
|
data/js/3c/1a/0f/00/00/00.24.js
|
hdm/mac-tracker
|
69f0c4efaa3d60111001d40f7a33886cc507e742
|
[
"CC-BY-4.0",
"MIT"
] | 20 |
2018-12-26T17:06:05.000Z
|
2021-08-05T07:47:31.000Z
|
data/js/3c/1a/0f/00/00/00.24.js
|
hdm/mac-tracker
|
69f0c4efaa3d60111001d40f7a33886cc507e742
|
[
"CC-BY-4.0",
"MIT"
] | 1 |
2021-06-03T12:20:55.000Z
|
2021-06-03T16:36:26.000Z
|
data/js/3c/1a/0f/00/00/00.24.js
|
hdm/mac-tracker
|
69f0c4efaa3d60111001d40f7a33886cc507e742
|
[
"CC-BY-4.0",
"MIT"
] | 8 |
2018-12-27T05:07:48.000Z
|
2021-01-26T00:41:17.000Z
|
macDetailCallback("3c1a0f000000/24",[{"d":"2014-09-17","t":"add","a":"99 Summer Street\nSuite 1130\nBoston MA 02110\n","c":"UNITED STATES","o":"ClearSky Data"},{"d":"2015-08-27","t":"change","a":"99 Summer Street Boston MA US 02110","c":"US","o":"ClearSky Data"}]);
| 133 | 265 | 0.646617 |
f0954e38182c20d45ab612a3da269fe9a1333976
| 23,018 |
js
|
JavaScript
|
argus/docs/doxygen/html/search/all_67.js
|
gwli/JetPack_tegra_multimedia_api_sample
|
554e27757a707515f8505006bac2ef7f37c42e44
|
[
"Unlicense"
] | 2 |
2020-01-09T21:20:13.000Z
|
2020-05-26T11:22:02.000Z
|
argus/docs/doxygen/html/search/all_67.js
|
gwli/JetPack_tegra_multimedia_api_sample
|
554e27757a707515f8505006bac2ef7f37c42e44
|
[
"Unlicense"
] | null | null | null |
argus/docs/doxygen/html/search/all_67.js
|
gwli/JetPack_tegra_multimedia_api_sample
|
554e27757a707515f8505006bac2ef7f37c42e44
|
[
"Unlicense"
] | 1 |
2020-05-20T02:33:52.000Z
|
2020-05-20T02:33:52.000Z
|
var searchData=
[
['g',['g',['../classArgus_1_1RGBTuple.html#a9516fdcf52eb502e914e51ef51d6dfc1',1,'Argus::RGBTuple::g()'],['../classArgus_1_1RGBTuple.html#a8aaba7c05b9ba66e75cff7cc4662caec',1,'Argus::RGBTuple::g() const ']]],
['get',['get',['../classArgus_1_1UniqueObj.html#ac232da34a550fc649e83f324fcddcba2',1,'Argus::UniqueObj']]],
['getaeantibandingmode',['getAeAntibandingMode',['../classArgus_1_1IAutoControlSettings.html#ae01194a64dce1b96dac831b07e363688',1,'Argus::IAutoControlSettings']]],
['getaelock',['getAeLock',['../classArgus_1_1IAutoControlSettings.html#a4bd156e2237d64c13de650d2a8c8f032',1,'Argus::IAutoControlSettings']]],
['getaelocked',['getAeLocked',['../classArgus_1_1ICaptureMetadata.html#abf822cf9536f41f3a76d43e14b7d5ad9',1,'Argus::ICaptureMetadata']]],
['getaeregions',['getAeRegions',['../classArgus_1_1ICaptureMetadata.html#a90e107b0a98925ec123bf2892bf708f3',1,'Argus::ICaptureMetadata::getAeRegions()'],['../classArgus_1_1IAutoControlSettings.html#a34283535ad28228952f23a9e46db2650',1,'Argus::IAutoControlSettings::getAeRegions()']]],
['getaestate',['getAeState',['../classArgus_1_1ICaptureMetadata.html#a919f4bf191780091e046a1d33d356c36',1,'Argus::ICaptureMetadata']]],
['getallsensormodes',['getAllSensorModes',['../classArgus_1_1ICameraProperties.html#afc4a1031659b1448c6429a48f162ae31',1,'Argus::ICameraProperties']]],
['getanaloggainrange',['getAnalogGainRange',['../classArgus_1_1ISensorMode.html#abe32fa7a650854b01764dfe73a42043c',1,'Argus::ISensorMode']]],
['getautocontrolsettings',['getAutoControlSettings',['../classArgus_1_1IRequest.html#a9d507e495cddb7545d406c4fec889695',1,'Argus::IRequest']]],
['getavailableeventtypes',['getAvailableEventTypes',['../classArgus_1_1IEventProvider.html#af38efc609dd89a838aef0be14f12d02e',1,'Argus::IEventProvider']]],
['getaverages',['getAverages',['../classArgus_1_1Ext_1_1IBayerAverageMap.html#aa46eec481fa2eeef8f497cab9bb1bcb3',1,'Argus::Ext::IBayerAverageMap']]],
['getawbcct',['getAwbCct',['../classArgus_1_1ICaptureMetadata.html#a1dcf35b95160f8f636815fa0ff6da133',1,'Argus::ICaptureMetadata']]],
['getawbgains',['getAwbGains',['../classArgus_1_1ICaptureMetadata.html#ac51f2a51d57de9f5e0319e2320e681ce',1,'Argus::ICaptureMetadata']]],
['getawblock',['getAwbLock',['../classArgus_1_1IAutoControlSettings.html#a54bb7a31c80a75e1c6571be1f56e7787',1,'Argus::IAutoControlSettings']]],
['getawbmode',['getAwbMode',['../classArgus_1_1ICaptureMetadata.html#a57895228042b144ba7bbea6319f7ea6c',1,'Argus::ICaptureMetadata::getAwbMode()'],['../classArgus_1_1IAutoControlSettings.html#ad739ff8af431390046a48722aa9ff7c3',1,'Argus::IAutoControlSettings::getAwbMode()']]],
['getawbregions',['getAwbRegions',['../classArgus_1_1ICaptureMetadata.html#ad6546ade71adb7546533c2451d730f94',1,'Argus::ICaptureMetadata::getAwbRegions()'],['../classArgus_1_1IAutoControlSettings.html#a5a8f0f5c88879b23220dffc00ce86981',1,'Argus::IAutoControlSettings::getAwbRegions()']]],
['getawbstate',['getAwbState',['../classArgus_1_1ICaptureMetadata.html#a62bdff18264fe2f6b200a630c98dc095',1,'Argus::ICaptureMetadata']]],
['getawbwbestimate',['getAwbWbEstimate',['../classArgus_1_1ICaptureMetadata.html#afcfc8ac7a6d7ccd31b5277c45b8a1665',1,'Argus::ICaptureMetadata']]],
['getbasicsensormodes',['getBasicSensorModes',['../classArgus_1_1ICameraProperties.html#ab485a075d86ace425b0a5372910b2c21',1,'Argus::ICameraProperties']]],
['getbayeraveragemapenable',['getBayerAverageMapEnable',['../classArgus_1_1Ext_1_1IBayerAverageMapSettings.html#a0a4e8c05b58466bc4b5df96ff847044f',1,'Argus::Ext::IBayerAverageMapSettings']]],
['getbayerhistogram',['getBayerHistogram',['../classArgus_1_1ICaptureMetadata.html#a2f81472b69ef2e2b1d0572cd521dab04',1,'Argus::ICaptureMetadata']]],
['getbayersharpnessmapenable',['getBayerSharpnessMapEnable',['../classArgus_1_1Ext_1_1IBayerSharpnessMapSettings.html#ae3712057fe83dc2d2c619dabd2e46b19',1,'Argus::Ext::IBayerSharpnessMapSettings']]],
['getbincount',['getBinCount',['../classArgus_1_1IBayerHistogram.html#af25acd8ae2b6320801343bdd6d239b9f',1,'Argus::IBayerHistogram::getBinCount()'],['../classArgus_1_1IRGBHistogram.html#acd569b4aacd4852a79a3c9f686270242',1,'Argus::IRGBHistogram::getBinCount()'],['../classArgus_1_1Ext_1_1IBayerAverageMap.html#a5115cae571ba9ae4615e47e2a84cecf6',1,'Argus::Ext::IBayerAverageMap::getBinCount()'],['../classArgus_1_1Ext_1_1IBayerSharpnessMap.html#a857a09eccf5b7a79a1994e18e2c17cbb',1,'Argus::Ext::IBayerSharpnessMap::getBinCount()']]],
['getbininterval',['getBinInterval',['../classArgus_1_1Ext_1_1IBayerAverageMap.html#a8de14405e92ee3965825303fb73aae42',1,'Argus::Ext::IBayerAverageMap::getBinInterval()'],['../classArgus_1_1Ext_1_1IBayerSharpnessMap.html#aae470d2f210c57b3b5927af2b234dd76',1,'Argus::Ext::IBayerSharpnessMap::getBinInterval()']]],
['getbinsize',['getBinSize',['../classArgus_1_1Ext_1_1IBayerAverageMap.html#a914049af3406294aaa83e73bed8fa0b3',1,'Argus::Ext::IBayerAverageMap::getBinSize()'],['../classArgus_1_1Ext_1_1IBayerSharpnessMap.html#a5ff8828d18a95d48f839621f57b57665',1,'Argus::Ext::IBayerSharpnessMap::getBinSize()']]],
['getbinstart',['getBinStart',['../classArgus_1_1Ext_1_1IBayerAverageMap.html#af53cd6457aff366bd580c93f0296e2c4',1,'Argus::Ext::IBayerAverageMap::getBinStart()'],['../classArgus_1_1Ext_1_1IBayerSharpnessMap.html#a0fd9503bf8eaa0f7a02c481507b5a6c0',1,'Argus::Ext::IBayerSharpnessMap::getBinStart()']]],
['getcameradevice',['getCameraDevice',['../classArgus_1_1IOutputStreamSettings.html#aed4ac71a14aa0d97a61db34dbd28323a',1,'Argus::IOutputStreamSettings']]],
['getcameradevices',['getCameraDevices',['../classArgus_1_1ICameraProvider.html#a7f63838a3f19a97e47a77a3bcb833fd6',1,'Argus::ICameraProvider']]],
['getcaptureid',['getCaptureId',['../classArgus_1_1ICaptureMetadata.html#a4d9a04079b2060c0bdcd23f8969bcdc8',1,'Argus::ICaptureMetadata::getCaptureId()'],['../classArgus_1_1IEvent.html#a02d9c260f5d322cdf47eb303b3e65a89',1,'Argus::IEvent::getCaptureId()']]],
['getclientdata',['getClientData',['../classArgus_1_1ICaptureMetadata.html#a84ba48ca390cf19e816c0f5c3b5b143c',1,'Argus::ICaptureMetadata::getClientData()'],['../classArgus_1_1IRequest.html#a3bc9907a6109167e1bc65c157c57b6b9',1,'Argus::IRequest::getClientData()']]],
['getclipcounts',['getClipCounts',['../classArgus_1_1Ext_1_1IBayerAverageMap.html#a57c975266b4a2936bca6020db7b65301',1,'Argus::Ext::IBayerAverageMap']]],
['getcolorcorrectionmatrix',['getColorCorrectionMatrix',['../classArgus_1_1ICaptureMetadata.html#ab6cdd7d5b1b700cedf26c4ab3ea78673',1,'Argus::ICaptureMetadata::getColorCorrectionMatrix()'],['../classArgus_1_1IAutoControlSettings.html#ae42dc1f98a706ea58e01947123067033',1,'Argus::IAutoControlSettings::getColorCorrectionMatrix()']]],
['getcolorcorrectionmatrixenable',['getColorCorrectionMatrixEnable',['../classArgus_1_1ICaptureMetadata.html#a0502f76cd91c797644aea3cc23b42fd0',1,'Argus::ICaptureMetadata::getColorCorrectionMatrixEnable()'],['../classArgus_1_1IAutoControlSettings.html#a2880815ed38d23f5027c72b9ac93f2b8',1,'Argus::IAutoControlSettings::getColorCorrectionMatrixEnable()']]],
['getcolorcorrectionmatrixsize',['getColorCorrectionMatrixSize',['../classArgus_1_1IAutoControlSettings.html#a2ea37ac7491888cb1fecf4b08d459083',1,'Argus::IAutoControlSettings']]],
['getcolorsaturation',['getColorSaturation',['../classArgus_1_1ICaptureMetadata.html#aaf0a31203cf7ce8b6085ba2ce51cb09d',1,'Argus::ICaptureMetadata::getColorSaturation()'],['../classArgus_1_1IAutoControlSettings.html#a96598a88504668ea2e7a2ab9b45c33d8',1,'Argus::IAutoControlSettings::getColorSaturation()']]],
['getcolorsaturationbias',['getColorSaturationBias',['../classArgus_1_1IAutoControlSettings.html#af2433b421f9534000f6813758fd974db',1,'Argus::IAutoControlSettings']]],
['getcolorsaturationenable',['getColorSaturationEnable',['../classArgus_1_1IAutoControlSettings.html#aee82acb3f900fb4829bf377bd8bb8410',1,'Argus::IAutoControlSettings']]],
['getconfidence',['getConfidence',['../classArgus_1_1Ext_1_1IFaceDetectResult.html#ae3a74ab8e63fbe0449f2b4a9726d9b1b',1,'Argus::Ext::IFaceDetectResult']]],
['getcontrolpointcount',['getControlPointCount',['../classArgus_1_1Ext_1_1IPwlWdrSensorMode.html#a6e60adf988f519e381f3efbc63cfcce7',1,'Argus::Ext::IPwlWdrSensorMode']]],
['getcontrolpoints',['getControlPoints',['../classArgus_1_1Ext_1_1IPwlWdrSensorMode.html#ae3bac9332fc586b6f03c31b799f3d707',1,'Argus::Ext::IPwlWdrSensorMode']]],
['getdefogamount',['getDeFogAmount',['../classArgus_1_1Ext_1_1IDeFogSettings.html#a5e9b775314872ae4f80b1cc4501fab09',1,'Argus::Ext::IDeFogSettings']]],
['getdefogenable',['getDeFogEnable',['../classArgus_1_1Ext_1_1IDeFogSettings.html#a22c549cba657523aeb1280fa19548c9d',1,'Argus::Ext::IDeFogSettings']]],
['getdefogquality',['getDeFogQuality',['../classArgus_1_1Ext_1_1IDeFogSettings.html#a1deedf48baad18dfd64a88cb29429f8a',1,'Argus::Ext::IDeFogSettings']]],
['getdenoisemode',['getDenoiseMode',['../classArgus_1_1IDenoiseMetadata.html#ad35ce53392cbb81d0508d64dcd669be1',1,'Argus::IDenoiseMetadata::getDenoiseMode()'],['../classArgus_1_1IDenoiseSettings.html#a54d567615841e8b277c0a2416bd329ea',1,'Argus::IDenoiseSettings::getDenoiseMode()']]],
['getdenoisestrength',['getDenoiseStrength',['../classArgus_1_1IDenoiseMetadata.html#a5e1c3d84df8f08c8a216f65bf13165f1',1,'Argus::IDenoiseMetadata::getDenoiseStrength()'],['../classArgus_1_1IDenoiseSettings.html#a8d0f2f4d8bdf0991fe7f21c118f85c07',1,'Argus::IDenoiseSettings::getDenoiseStrength()']]],
['getedgeenhancemode',['getEdgeEnhanceMode',['../classArgus_1_1IEdgeEnhanceMetadata.html#a23f59b915b7b8de00289d9c07b6fc2aa',1,'Argus::IEdgeEnhanceMetadata::getEdgeEnhanceMode()'],['../classArgus_1_1IEdgeEnhanceSettings.html#adbda0b29310a8b62f7f47bad811dba4d',1,'Argus::IEdgeEnhanceSettings::getEdgeEnhanceMode()']]],
['getedgeenhancestrength',['getEdgeEnhanceStrength',['../classArgus_1_1IEdgeEnhanceMetadata.html#af82fb71ffd6c8b484c0b13917c7eb595',1,'Argus::IEdgeEnhanceMetadata::getEdgeEnhanceStrength()'],['../classArgus_1_1IEdgeEnhanceSettings.html#a82f3b4630bc4bcb2b35b85de24b4cc44',1,'Argus::IEdgeEnhanceSettings::getEdgeEnhanceStrength()']]],
['getegldisplay',['getEGLDisplay',['../classArgus_1_1IStream.html#a5aaf95de9e18badfcc25216e53499f04',1,'Argus::IStream::getEGLDisplay()'],['../classArgus_1_1IOutputStreamSettings.html#a0020a2d784894bd3863eaa2bddf60f29',1,'Argus::IOutputStreamSettings::getEGLDisplay()']]],
['geteglstream',['getEGLStream',['../classArgus_1_1IStream.html#abe16781888e2c46ab287265c80a6572c',1,'Argus::IStream']]],
['getevent',['getEvent',['../classArgus_1_1IEventQueue.html#a118c2b07a47740267925f4aa2dff640a',1,'Argus::IEventQueue']]],
['geteventtype',['getEventType',['../classArgus_1_1IEvent.html#a4379af7f983acef26b7241f47e54b308',1,'Argus::IEvent']]],
['geteventtypes',['getEventTypes',['../classArgus_1_1IEventQueue.html#a2460960a1e826e556125455d2a1e84a6',1,'Argus::IEventQueue']]],
['getexposurecompensation',['getExposureCompensation',['../classArgus_1_1IAutoControlSettings.html#a0de8a80e016759234a4c110cd686bf7e',1,'Argus::IAutoControlSettings']]],
['getexposurecompensationrange',['getExposureCompensationRange',['../classArgus_1_1ICameraProperties.html#a2ae73495b253bf7150ed6006ca113e9e',1,'Argus::ICameraProperties']]],
['getexposuretimerange',['getExposureTimeRange',['../classArgus_1_1ISensorMode.html#a2b8b2f9aa1fab2217a7afa651ba902d0',1,'Argus::ISensorMode::getExposureTimeRange()'],['../classArgus_1_1ISourceSettings.html#aabdb1b6d5d271bb07122cc8b156de3e5',1,'Argus::ISourceSettings::getExposureTimeRange()']]],
['getfacedetectenable',['getFaceDetectEnable',['../classArgus_1_1Ext_1_1IFaceDetectSettings.html#a27d11316ead281c727c7acd39441d008',1,'Argus::Ext::IFaceDetectSettings']]],
['getfacedetectresults',['getFaceDetectResults',['../classArgus_1_1Ext_1_1IFaceDetectMetadata.html#a3d0da4295217fd2bf526ca86f9c9a9df',1,'Argus::Ext::IFaceDetectMetadata']]],
['getfifolength',['getFifoLength',['../classArgus_1_1IOutputStreamSettings.html#abb57b02b9bd6392579cedec52814da45',1,'Argus::IOutputStreamSettings']]],
['getfocuserposition',['getFocuserPosition',['../classArgus_1_1ICaptureMetadata.html#aabc2a04cf17cd231fe41f925c1bf905c',1,'Argus::ICaptureMetadata']]],
['getfocusposition',['getFocusPosition',['../classArgus_1_1ISourceSettings.html#a2cdd0d750bba5848cec6c6cdb44b6b6f',1,'Argus::ISourceSettings']]],
['getfocuspositionrange',['getFocusPositionRange',['../classArgus_1_1ICameraProperties.html#a905673cc0e0c9229fd6b48d4e33d7726',1,'Argus::ICameraProperties']]],
['getframeduration',['getFrameDuration',['../classArgus_1_1ICaptureMetadata.html#ae56b617b3416599dae93145dda3792c5',1,'Argus::ICaptureMetadata']]],
['getframedurationrange',['getFrameDurationRange',['../classArgus_1_1ISensorMode.html#a1c0962fe8bd2c5a562e799766e7f5d75',1,'Argus::ISensorMode::getFrameDurationRange()'],['../classArgus_1_1ISourceSettings.html#a6cbc2fe946e1f77f48c6d9f3df184c99',1,'Argus::ISourceSettings::getFrameDurationRange()']]],
['getframereadouttime',['getFrameReadoutTime',['../classArgus_1_1ICaptureMetadata.html#a9d94662b7537f8c12554da01be4fb2a2',1,'Argus::ICaptureMetadata']]],
['getgainrange',['getGainRange',['../classArgus_1_1ISourceSettings.html#a41c3135c4a5e43d37ac58e0983df9ad7',1,'Argus::ISourceSettings']]],
['gethistogram',['getHistogram',['../classArgus_1_1IBayerHistogram.html#a2d9f63683adf9957dc3cebe351b974eb',1,'Argus::IBayerHistogram::getHistogram()'],['../classArgus_1_1IRGBHistogram.html#a3cfc447d9f7a1e84a945ec05b820b9fd',1,'Argus::IRGBHistogram::getHistogram()']]],
['getinputbitdepth',['getInputBitDepth',['../classArgus_1_1ISensorMode.html#a3df17c3f6e992a4f1bd24474da74ea0e',1,'Argus::ISensorMode']]],
['getinterface',['getInterface',['../classArgus_1_1InterfaceProvider.html#a63917032ebe375098e45a673e5ae818a',1,'Argus::InterfaceProvider']]],
['getinternalframecount',['getInternalFrameCount',['../classArgus_1_1Ext_1_1IInternalFrameCount.html#a7ff02d93895277658df8847f3120f73b',1,'Argus::Ext::IInternalFrameCount']]],
['getispdigitalgain',['getIspDigitalGain',['../classArgus_1_1ICaptureMetadata.html#a10381e1e830640e2fc373569ffe17213',1,'Argus::ICaptureMetadata']]],
['getispdigitalgainrange',['getIspDigitalGainRange',['../classArgus_1_1ICameraProperties.html#aea5453e4036326b63ea795237a135632',1,'Argus::ICameraProperties::getIspDigitalGainRange()'],['../classArgus_1_1IAutoControlSettings.html#a6b494e039255bed4679d43fb527fc28b',1,'Argus::IAutoControlSettings::getIspDigitalGainRange()']]],
['getlensaperturerange',['getLensApertureRange',['../classArgus_1_1ICameraProperties.html#aa074121387a5da56a41de2b1f0876ef5',1,'Argus::ICameraProperties']]],
['getmaxaeregions',['getMaxAeRegions',['../classArgus_1_1ICameraProperties.html#a372e6b264377c0ff6f29b399d8687137',1,'Argus::ICameraProperties']]],
['getmaxawbregions',['getMaxAwbRegions',['../classArgus_1_1ICameraProperties.html#a2e89af6e134c60d6ca3bc0caecdfdf63',1,'Argus::ICameraProperties']]],
['getmaxfacedetectresults',['getMaxFaceDetectResults',['../classArgus_1_1Ext_1_1IFaceDetectCaps.html#a7aa3df99ba453beede25807788a9aef5',1,'Argus::Ext::IFaceDetectCaps']]],
['getmetadata',['getMetadata',['../classArgus_1_1IEventCaptureComplete.html#aa23f7bf7ab6dec11970cd75426983120',1,'Argus::IEventCaptureComplete::getMetadata()'],['../classArgus_1_1Ext_1_1ISensorPrivateMetadata.html#ad5d098a7f14f18794ec53d3594d452a3',1,'Argus::Ext::ISensorPrivateMetadata::getMetadata()']]],
['getmetadataenable',['getMetadataEnable',['../classArgus_1_1Ext_1_1ISensorPrivateMetadataRequest.html#a19c2e13714b5e8bc36525a7947ec43d6',1,'Argus::Ext::ISensorPrivateMetadataRequest::getMetadataEnable()'],['../classArgus_1_1IOutputStreamSettings.html#a0d3aa9d2c4ebef9ef0e01e544d3df82f',1,'Argus::IOutputStreamSettings::getMetadataEnable()']]],
['getmetadatasize',['getMetadataSize',['../classArgus_1_1Ext_1_1ISensorPrivateMetadataCaps.html#aaa5da5cf3038cedc5e26a92670411875',1,'Argus::Ext::ISensorPrivateMetadataCaps::getMetadataSize()'],['../classArgus_1_1Ext_1_1ISensorPrivateMetadata.html#a4a7d4d4ab579b47364215ae20d285b99',1,'Argus::Ext::ISensorPrivateMetadata::getMetadataSize()']]],
['getmode',['getMode',['../classArgus_1_1IOutputStreamSettings.html#a90a57c0f7234c4f7c5ec60d5dd1cf16a',1,'Argus::IOutputStreamSettings']]],
['getname',['getName',['../classArgus_1_1NamedUUID.html#ac4b955b92325de19ef969e1de4e2d416',1,'Argus::NamedUUID']]],
['getnextevent',['getNextEvent',['../classArgus_1_1IEventQueue.html#ac3410fdb8b9d18d39243d93d4645f26c',1,'Argus::IEventQueue']]],
['getopticalblack',['getOpticalBlack',['../classArgus_1_1ISourceSettings.html#a81341fd47703ea1f48104b0e8a0af1a6',1,'Argus::ISourceSettings']]],
['getopticalblackenable',['getOpticalBlackEnable',['../classArgus_1_1ISourceSettings.html#a0a5e6f5cb6b542d92ff0cc06736097cc',1,'Argus::ISourceSettings']]],
['getoutputbitdepth',['getOutputBitDepth',['../classArgus_1_1ISensorMode.html#abfb8ec340a93413809c6554a307ddde9',1,'Argus::ISensorMode']]],
['getoutputstreams',['getOutputStreams',['../classArgus_1_1IRequest.html#a76357f02804e1a067c7f0496af9ffa78',1,'Argus::IRequest']]],
['getpixelformat',['getPixelFormat',['../classArgus_1_1IStream.html#afe74873223f8d4f2a58dda43a9e8f126',1,'Argus::IStream::getPixelFormat()'],['../classArgus_1_1IOutputStreamSettings.html#a2c133f879555f1d7fd14795ef96942b5',1,'Argus::IOutputStreamSettings::getPixelFormat()']]],
['getpostprocessingenable',['getPostProcessingEnable',['../classArgus_1_1IStreamSettings.html#a77d1750bc5a1cfb7c7ec961f21ccef09',1,'Argus::IStreamSettings']]],
['getrect',['getRect',['../classArgus_1_1Ext_1_1IFaceDetectResult.html#a670c55f9eae01fefd70cb256af2a4840',1,'Argus::Ext::IFaceDetectResult']]],
['getresolution',['getResolution',['../classArgus_1_1ISensorMode.html#a07c3812c182fe139ef9b6a60804be398',1,'Argus::ISensorMode::getResolution()'],['../classArgus_1_1IStream.html#a2ee9ba314f0b8b0a78b29c9a55f99cbd',1,'Argus::IStream::getResolution()'],['../classArgus_1_1IOutputStreamSettings.html#a4faf0b87c3e3925bd6c79d93e47c0807',1,'Argus::IOutputStreamSettings::getResolution()']]],
['getrgbhistogram',['getRGBHistogram',['../classArgus_1_1ICaptureMetadata.html#a776256477536913b9d07759e170a4f50',1,'Argus::ICaptureMetadata']]],
['getscenelux',['getSceneLux',['../classArgus_1_1ICaptureMetadata.html#a633017c0368156c00b99fcf45f81752c',1,'Argus::ICaptureMetadata']]],
['getsensoranaloggain',['getSensorAnalogGain',['../classArgus_1_1ICaptureMetadata.html#af42d6b1c3a5cb94bd5ed444e06e5fb40',1,'Argus::ICaptureMetadata']]],
['getsensorexposuretime',['getSensorExposureTime',['../classArgus_1_1ICaptureMetadata.html#a0bff976e9d1dfd965145e5c18f91fbb0',1,'Argus::ICaptureMetadata']]],
['getsensormode',['getSensorMode',['../classArgus_1_1ISourceSettings.html#a2fb8a20e2e089ba358f4add0f5061924',1,'Argus::ISourceSettings']]],
['getsensormodetype',['getSensorModeType',['../classArgus_1_1ISensorMode.html#ac1384dca87b03da766bdd6920847b8b6',1,'Argus::ISensorMode']]],
['getsensorsensitivity',['getSensorSensitivity',['../classArgus_1_1ICaptureMetadata.html#ab301501f415adfe2c1c69a87d39d9012',1,'Argus::ICaptureMetadata']]],
['getsensortimestamp',['getSensorTimestamp',['../classArgus_1_1ICaptureMetadata.html#ae4ff79489b0aef6766742a61d1a17cfc',1,'Argus::ICaptureMetadata']]],
['getsharpnessvalues',['getSharpnessValues',['../classArgus_1_1Ext_1_1IBayerSharpnessMap.html#adf6bf6562f95fcf538b9324471cd722e',1,'Argus::Ext::IBayerSharpnessMap']]],
['getsize',['getSize',['../classArgus_1_1IEventQueue.html#ac3d00adb91d653dc9b1d3a60ce6b978e',1,'Argus::IEventQueue']]],
['getsourcecliprect',['getSourceClipRect',['../classArgus_1_1IStreamCaptureMetadata.html#a23a81e22a569df320c30183236e59602',1,'Argus::IStreamCaptureMetadata::getSourceClipRect()'],['../classArgus_1_1IStreamSettings.html#af62fc7ceaebb8be1cce415c83c213f03',1,'Argus::IStreamSettings::getSourceClipRect()']]],
['getsourcesettings',['getSourceSettings',['../classArgus_1_1IRequest.html#ae1cda43ecffe49f5bd7688302c8c973d',1,'Argus::IRequest']]],
['getstatus',['getStatus',['../classArgus_1_1IEventError.html#a693a4a9eccbe625ef1db5a25de4c76fb',1,'Argus::IEventError::getStatus()'],['../classArgus_1_1IEventCaptureComplete.html#aa0d532e250496e1e929a213afe7aeb70',1,'Argus::IEventCaptureComplete::getStatus()']]],
['getstreammetadata',['getStreamMetadata',['../classArgus_1_1ICaptureMetadata.html#a6a29343fc48af79064fab6d5e390cce0',1,'Argus::ICaptureMetadata']]],
['getstreamsettings',['getStreamSettings',['../classArgus_1_1IRequest.html#aae9e0f4a0f5d1d0bc4e7a657f24def41',1,'Argus::IRequest']]],
['gettime',['getTime',['../classArgus_1_1IEvent.html#a6ead1c7618a5679a9d19d766126ca3d9',1,'Argus::IEvent']]],
['gettonemapcurve',['getToneMapCurve',['../classArgus_1_1ICaptureMetadata.html#a99b0918ad354b228b3202f4351a11d6a',1,'Argus::ICaptureMetadata::getToneMapCurve()'],['../classArgus_1_1IAutoControlSettings.html#a8bb8c7f22a54d01a325435df3a79ce57',1,'Argus::IAutoControlSettings::getToneMapCurve()']]],
['gettonemapcurveenable',['getToneMapCurveEnable',['../classArgus_1_1IAutoControlSettings.html#ab5b6e206509f251ce7d5cd058d110b5c',1,'Argus::IAutoControlSettings']]],
['gettonemapcurveenabled',['getToneMapCurveEnabled',['../classArgus_1_1ICaptureMetadata.html#aa42e458304f64dd30d9ce8b686286b5f',1,'Argus::ICaptureMetadata']]],
['gettonemapcurvesize',['getToneMapCurveSize',['../classArgus_1_1IAutoControlSettings.html#ac813eee05838049acf97b1c23927573d',1,'Argus::IAutoControlSettings']]],
['getuuid',['getUUID',['../classArgus_1_1ICameraProperties.html#acc03568c65948948525a19c8fefea785',1,'Argus::ICameraProperties']]],
['getvendor',['getVendor',['../classArgus_1_1ICameraProvider.html#a7027c9a594e9c5a93d29b4717d21b004',1,'Argus::ICameraProvider']]],
['getversion',['getVersion',['../classArgus_1_1ICameraProvider.html#a3012922e1e188d2c74ef0fbe6bc1e663',1,'Argus::ICameraProvider']]],
['getvideostabilizationmode',['getVideoStabilizationMode',['../classArgus_1_1IVideoStabilizationMetadata.html#a71fccfea8fb982b2b5874c222a1b6cdb',1,'Argus::IVideoStabilizationMetadata::getVideoStabilizationMode()'],['../classArgus_1_1IVideoStabilizationSettings.html#ae2f620f7edddf2589c2f2f0f0fe9ed24',1,'Argus::IVideoStabilizationSettings::getVideoStabilizationMode()']]],
['getwbgains',['getWbGains',['../classArgus_1_1IAutoControlSettings.html#a444bde06c05f51441b27cc104c2978a6',1,'Argus::IAutoControlSettings']]],
['getworkingrange',['getWorkingRange',['../classArgus_1_1Ext_1_1IBayerAverageMap.html#ac1327cfca0f6e5c7abfff81ef04ab5aa',1,'Argus::Ext::IBayerAverageMap']]],
['geven',['gEven',['../classArgus_1_1BayerTuple.html#ab793a9235eb65c86dc8a7c54301f8221',1,'Argus::BayerTuple::gEven()'],['../classArgus_1_1BayerTuple.html#a44641085e5c41d9b9df8fcba8c8e6069',1,'Argus::BayerTuple::gEven() const ']]],
['godd',['gOdd',['../classArgus_1_1BayerTuple.html#a18b1d6c872f7bdfc8d5eab7ce44818c0',1,'Argus::BayerTuple::gOdd()'],['../classArgus_1_1BayerTuple.html#a2620eca95b0cf37a55fe04acfe5f82b9',1,'Argus::BayerTuple::gOdd() const ']]]
];
| 188.672131 | 534 | 0.811235 |
a9345eea6a3719b34c4e5a940f956c60bbc9d49d
| 1,094 |
kt
|
Kotlin
|
state/src/main/java/com/hzy/state/controller/ViewStateNetworkStateProvider.kt
|
huangziye/ViewState
|
a701b75230efc6537b5d777fe4bbff6852225134
|
[
"Apache-2.0"
] | 1 |
2019-11-25T02:10:03.000Z
|
2019-11-25T02:10:03.000Z
|
state/src/main/java/com/hzy/state/controller/ViewStateNetworkStateProvider.kt
|
huangziye/ViewState
|
a701b75230efc6537b5d777fe4bbff6852225134
|
[
"Apache-2.0"
] | null | null | null |
state/src/main/java/com/hzy/state/controller/ViewStateNetworkStateProvider.kt
|
huangziye/ViewState
|
a701b75230efc6537b5d777fe4bbff6852225134
|
[
"Apache-2.0"
] | null | null | null |
package com.hzy.state.controller
import android.content.Context
import com.hzy.state.listener.OnRequestNetworkStateEvent
/**
* ViewState 控制器网络状态提供者
* @author: ziye_huang
* @date: 2019/3/22
*/
class ViewStateNetworkStateProvider private constructor() {
private var mNetworkStateEvent: OnRequestNetworkStateEvent? = null
companion object {
private var mInstance: ViewStateNetworkStateProvider? = null
get() {
if (field == null) {
field = ViewStateNetworkStateProvider()
}
return field
}
/**
* 需要线程安全的时候可以加上 @Synchronized
*/
@Synchronized
fun getInstance(): ViewStateNetworkStateProvider {
return mInstance!!
}
}
fun isConnected(context: Context): Boolean {
return null == mNetworkStateEvent || mNetworkStateEvent!!.onRequestNetworkState(context)
}
fun registerOnRequestNetworkStateEvent(networkStateEvent: OnRequestNetworkStateEvent) {
mNetworkStateEvent = networkStateEvent
}
}
| 26.682927 | 96 | 0.646252 |
87c4ced20a2902f2934c95c32d97d4be95e07f24
| 634 |
sql
|
SQL
|
share/DB/20180123UpdateTables.sql
|
ryhanai/teachingplugin
|
a495885899eaa36ea00ba8ab89057cd4d3f36350
|
[
"MIT"
] | 2 |
2020-07-21T06:08:42.000Z
|
2020-07-21T06:08:44.000Z
|
share/DB/20180123UpdateTables.sql
|
ryhanai/teachingplugin
|
a495885899eaa36ea00ba8ab89057cd4d3f36350
|
[
"MIT"
] | null | null | null |
share/DB/20180123UpdateTables.sql
|
ryhanai/teachingplugin
|
a495885899eaa36ea00ba8ab89057cd4d3f36350
|
[
"MIT"
] | null | null | null |
DELETE from T_TASK_INST_PARAMETER Where type = 1;
ALTER TABLE T_TASK_INST_PARAMETER RENAME TO tmp_T_TASK_INST_PARAMETER;
CREATE TABLE T_TASK_INST_PARAMETER (
task_inst_id integer not null,
task_param_id integer not null,
elem_num integer not null,
name text,
rname text,
unit text,
value text,
hide integer,
primary key(task_inst_id, task_param_id)
);
INSERT INTO T_TASK_INST_PARAMETER(task_inst_id, task_param_id, elem_num, name, rname, unit, value, hide)
SELECT task_inst_id, task_param_id, elem_num, name, rname, unit, value, hide
FROM tmp_T_TASK_INST_PARAMETER;
drop table tmp_T_TASK_INST_PARAMETER;
vacuum;
| 30.190476 | 104 | 0.801262 |
de10e1509f6dfa140de63e5a9db392063e95dd58
| 17,775 |
rs
|
Rust
|
0xx_core_mix/src/crypto/backend/ristretto_b.rs
|
sololouve/MaaraaDAO
|
d53c244599182472789a2c71e6ea56bcc9f78569
|
[
"CC0-1.0"
] | 2 |
2021-06-13T21:55:16.000Z
|
2021-07-30T08:52:58.000Z
|
0xx_core_mix/src/crypto/backend/ristretto_b.rs
|
sololouve/MaaraaDAO
|
d53c244599182472789a2c71e6ea56bcc9f78569
|
[
"CC0-1.0"
] | null | null | null |
0xx_core_mix/src/crypto/backend/ristretto_b.rs
|
sololouve/MaaraaDAO
|
d53c244599182472789a2c71e6ea56bcc9f78569
|
[
"CC0-1.0"
] | 2 |
2021-06-13T07:39:16.000Z
|
2021-09-04T20:02:29.000Z
|
use rand::rngs::OsRng;
use rand::rngs::StdRng;
use rand::RngCore;
use rand::SeedableRng;
use serde::{Deserialize, Serialize};
use curve25519_dalek::constants::RISTRETTO_BASEPOINT_POINT;
use curve25519_dalek::ristretto::{CompressedRistretto, RistrettoPoint};
use curve25519_dalek::scalar::Scalar;
use curve25519_dalek::traits::Identity;
use crate::crypto::base::*;
use crate::crypto::elgamal::*;
use crate::crypto::hashing::{hash_bytes_256, HashTo, RistrettoHasher};
use crate::util;
impl Element for RistrettoPoint {
type Exp = Scalar;
type Plaintext = [u8; 30];
fn mul(&self, other: &Self) -> Self {
self + other
}
fn div(&self, other: &Self, _modulus: &Self) -> Self {
self - other
}
fn mod_pow(&self, other: &Self::Exp, _modulus: &Self) -> Self {
self * other
}
fn modulo(&self, _modulus: &Self) -> Self {
*self
}
fn mul_identity() -> RistrettoPoint {
RistrettoPoint::identity()
}
}
impl Exponent for Scalar {
fn add(&self, other: &Scalar) -> Scalar {
self + other
}
fn sub(&self, other: &Scalar) -> Scalar {
self - other
}
fn neg(&self) -> Scalar {
-self
}
fn mul(&self, other: &Scalar) -> Scalar {
self * other
}
fn modulo(&self, _modulus: &Scalar) -> Scalar {
*self
}
fn add_identity() -> Scalar {
Scalar::zero()
}
fn mul_identity() -> Scalar {
Scalar::one()
}
fn to_string(&self) -> String {
hex::encode(self.to_bytes())
}
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct RistrettoGroup;
impl RistrettoGroup {
fn encode_test(&self, data: [u8; 30]) -> (RistrettoPoint, usize) {
let mut bytes = [0u8; 32];
bytes[1..1 + data.len()].copy_from_slice(&data);
for j in 0..64 {
bytes[31] = j as u8;
for i in 0..128 {
bytes[0] = 2 * i as u8;
if let Some(point) = CompressedRistretto(bytes).decompress() {
return (point, i + j * 128);
}
}
}
panic!("a very unlikely event occurred");
}
}
impl Group<RistrettoPoint> for RistrettoGroup {
fn generator(&self) -> RistrettoPoint {
RISTRETTO_BASEPOINT_POINT
}
fn rnd(&self) -> RistrettoPoint {
let mut rng = OsRng;
RistrettoPoint::random(&mut rng)
}
fn modulus(&self) -> RistrettoPoint {
RistrettoPoint::default()
}
fn rnd_exp(&self) -> Scalar {
let mut rng = OsRng;
Scalar::random(&mut rng)
}
fn rnd_plaintext(&self) -> [u8; 30] {
let mut csprng = OsRng;
let mut value = [0u8; 30];
csprng.fill_bytes(&mut value);
value
}
fn exp_modulus(&self) -> Scalar {
Scalar::default()
}
// see https://github.com/ruescasd/braid-mg/issues/4
fn encode(&self, data: &[u8; 30]) -> RistrettoPoint {
let mut bytes = [0u8; 32];
bytes[1..1 + data.len()].copy_from_slice(data);
for j in 0..64 {
bytes[31] = j as u8;
for i in 0..128 {
bytes[0] = 2 * i as u8;
if let Some(point) = CompressedRistretto(bytes).decompress() {
return point;
}
}
}
panic!("Failed to encode into ristretto point");
}
fn decode(&self, element: &RistrettoPoint) -> [u8; 30] {
let compressed = element.compress();
let slice = &compressed.as_bytes()[1..31];
util::to_u8_30(&slice.to_vec())
}
fn gen_key(&self) -> PrivateKey<RistrettoPoint, Self> {
let secret = self.rnd_exp();
PrivateKey::from(&secret, self)
}
fn pk_from_value(&self, value: &RistrettoPoint) -> PublicKey<RistrettoPoint, Self> {
PublicKey::from(&value, &self.clone())
}
fn exp_hasher(&self) -> Box<dyn HashTo<Scalar>> {
Box::new(RistrettoHasher)
}
fn elem_hasher(&self) -> Box<dyn HashTo<RistrettoPoint>> {
Box::new(RistrettoHasher)
}
// FIXME not kosher
fn generators(&self, size: usize, contest: u32, seed: Vec<u8>) -> Vec<RistrettoPoint> {
let mut seed_ = seed.to_vec();
seed_.extend(&contest.to_le_bytes());
let hashed = hash_bytes_256(seed_);
let mut csprng: StdRng = SeedableRng::from_seed(hashed);
let mut ret: Vec<RistrettoPoint> = Vec::with_capacity(size);
for _ in 0..size {
let g = RistrettoPoint::random(&mut csprng);
ret.push(g);
}
ret
}
}
#[cfg(test)]
mod tests {
extern crate textplots;
use textplots::{utils, Chart, Plot, Shape};
use rand::rngs::OsRng;
use rand::RngCore;
use curve25519_dalek::ristretto::RistrettoPoint;
use curve25519_dalek::traits::Identity;
use crate::crypto::backend::ristretto_b::*;
use crate::crypto::keymaker::*;
use crate::crypto::shuffler::*;
use crate::crypto::symmetric;
use crate::data::artifact::*;
use crate::data::bytes::*;
use crate::util;
#[test]
fn test_ristretto_elgamal() {
let mut csprng = OsRng;
let group = RistrettoGroup;
let sk = group.gen_key();
let pk = PublicKey::from(&sk.public_value, &group);
let mut fill = [0u8; 30];
csprng.fill_bytes(&mut fill);
let plaintext = group.encode(&util::to_u8_30(&fill.to_vec()));
let c = pk.encrypt(&plaintext);
let d = sk.decrypt(&c);
let recovered = group.decode(&d).to_vec();
assert_eq!(fill.to_vec(), recovered);
}
#[test]
fn test_ristretto_js_encoding() {
let rg = RistrettoGroup;
// since we are not encoding ristretto, this string cannot be changed
let text = "this has to be exactly 32 bytes!";
// data generated by ristretto255.js
let skb: [u8; 32] = [
157, 127, 250, 139, 158, 32, 121, 69, 255, 102, 151, 206, 199, 225, 118, 203, 168, 220,
193, 198, 226, 74, 167, 77, 209, 52, 70, 173, 180, 176, 153, 9,
];
let a: [u8; 32] = [
72, 60, 143, 64, 93, 212, 68, 113, 253, 8, 206, 72, 111, 39, 75, 156, 189, 63, 176,
223, 97, 221, 58, 132, 11, 209, 70, 149, 90, 73, 141, 70,
];
let b: [u8; 32] = [
182, 67, 141, 0, 95, 109, 54, 179, 179, 226, 25, 148, 80, 160, 171, 82, 173, 129, 68,
24, 64, 236, 36, 144, 183, 193, 36, 180, 82, 206, 98, 41,
];
let sk_ = PrivateKey::from(&Scalar::from_bytes_mod_order(skb), &rg);
let c_ = Ciphertext {
a: CompressedRistretto(a).decompress().unwrap(),
b: CompressedRistretto(b).decompress().unwrap(),
};
let d_: RistrettoPoint = sk_.decrypt(&c_);
let recovered_ = String::from_utf8(d_.compress().as_bytes().to_vec());
assert_eq!(text, recovered_.unwrap());
}
#[test]
fn test_ristretto_prob_encoding() {
let mut csprng = OsRng;
let mut bytes = [00u8; 30];
let group = RistrettoGroup;
let iterations = 10000;
println!(
"test_r_encoding: running {} encode iterations..",
iterations
);
let v: Vec<(f32, f32)> = (0..iterations)
.map(|i| {
csprng.fill_bytes(&mut bytes);
let fixed = util::to_u8_30(&bytes.to_vec());
(i as f32, group.encode_test(fixed).1 as f32)
})
.collect();
let size: f32 = v.len() as f32;
let values: Vec<u32> = v.iter().map(|x| x.1 as u32).collect();
let sum: f32 = v.iter().map(|x| x.1).fold(0f32, |a, b| a + b);
let sum_f = sum as f32;
println!("test_r_encoding: average {}", sum_f / size);
println!("test_r_encoding: max is {}", values.iter().max().unwrap());
let hist = utils::histogram(&v, 0.0, 30.0, 30);
Chart::new(380, 100, 0.0, 30.0)
.lineplot(&Shape::Bars(&hist))
.nice();
}
#[test]
fn test_ristretto_schnorr() {
let group = RistrettoGroup;
let g = group.generator();
let secret = group.rnd_exp();
let public = g.mod_pow(&secret, &group.modulus());
let schnorr = group.schnorr_prove(&secret, &public, &g, &vec![]);
let verified = group.schnorr_verify(&public, &g, &schnorr, &vec![]);
assert!(verified == true);
let public_false = group
.generator()
.mod_pow(&group.rnd_exp(), &group.modulus());
let verified_false = group.schnorr_verify(&public_false, &g, &schnorr, &vec![]);
assert!(verified_false == false);
}
#[test]
fn test_ristretto_chaumpedersen() {
let group = RistrettoGroup;
let g1 = group.generator();
let g2 = group.rnd();
let secret = group.rnd_exp();
let public1 = g1.mod_pow(&secret, &group.modulus());
let public2 = g2.mod_pow(&secret, &group.modulus());
let proof = group.cp_prove(&secret, &public1, &public2, &g1, &g2, &vec![]);
let verified = group.cp_verify(&public1, &public2, &g1, &g2, &proof, &vec![]);
assert!(verified == true);
let public_false = group
.generator()
.mod_pow(&group.rnd_exp(), &group.modulus());
let verified_false = group.cp_verify(&public1, &public_false, &g1, &g2, &proof, &vec![]);
assert!(verified_false == false);
}
#[test]
fn test_ristretto_vdecryption() {
let mut csprng = OsRng;
let group = RistrettoGroup;
let sk = group.gen_key();
let pk = PublicKey::from(&sk.public_value, &group);
let mut fill = [0u8; 30];
csprng.fill_bytes(&mut fill);
let plaintext = group.encode(&util::to_u8_30(&fill.to_vec()));
let c = pk.encrypt(&plaintext);
let (d, proof) = sk.decrypt_and_prove(&c, &vec![]);
let dec_factor = c.a.div(&d, &group.modulus()).modulo(&group.modulus());
let verified = group.cp_verify(
&pk.value,
&dec_factor,
&group.generator(),
&c.b,
&proof,
&vec![],
);
let recovered = group.decode(&d).to_vec();
assert!(verified == true);
assert_eq!(fill.to_vec(), recovered);
}
#[test]
fn test_ristretto_distributed() {
let mut csprng = OsRng;
let group = RistrettoGroup;
let km1 = Keymaker::gen(&group);
let km2 = Keymaker::gen(&group);
let (pk1, proof1) = km1.share(&vec![]);
let (pk2, proof2) = km2.share(&vec![]);
let verified1 = group.schnorr_verify(&pk1.value, &group.generator(), &proof1, &vec![]);
let verified2 = group.schnorr_verify(&pk2.value, &group.generator(), &proof2, &vec![]);
assert!(verified1 == true);
assert!(verified2 == true);
let mut fill = [0u8; 30];
csprng.fill_bytes(&mut fill);
let plaintext = group.encode(&util::to_u8_30(&fill.to_vec()));
let pk1_value = &pk1.value.clone();
let pk2_value = &pk2.value.clone();
let pks = vec![pk1, pk2];
let pk_combined = Keymaker::combine_pks(&group, pks);
let c = pk_combined.encrypt(&plaintext);
let (dec_f1, proof1) = km1.decryption_factor(&c, &vec![]);
let (dec_f2, proof2) = km2.decryption_factor(&c, &vec![]);
let verified1 = group.cp_verify(
pk1_value,
&dec_f1,
&group.generator(),
&c.b,
&proof1,
&vec![],
);
let verified2 = group.cp_verify(
pk2_value,
&dec_f2,
&group.generator(),
&c.b,
&proof2,
&vec![],
);
assert!(verified1 == true);
assert!(verified2 == true);
let decs = vec![dec_f1, dec_f2];
let d = Keymaker::joint_dec(&group, decs, &c);
let recovered = group.decode(&d).to_vec();
assert_eq!(fill.to_vec(), recovered);
}
#[test]
fn test_ristretto_distributed_serde() {
let mut csprng = OsRng;
let group = RistrettoGroup;
let km1 = Keymaker::gen(&group);
let km2 = Keymaker::gen(&group);
let (pk1, proof1) = km1.share(&vec![]);
let (pk2, proof2) = km2.share(&vec![]);
let sym1 = symmetric::gen_key();
let sym2 = symmetric::gen_key();
let esk1 = km1.get_encrypted_sk(sym1);
let esk2 = km2.get_encrypted_sk(sym2);
let share1 = Keyshare {
share: pk1,
proof: proof1,
encrypted_sk: esk1,
};
let share2 = Keyshare {
share: pk2,
proof: proof2,
encrypted_sk: esk2,
};
let share1_b = share1.ser();
let share2_b = share2.ser();
let share1_d = Keyshare::<RistrettoPoint, RistrettoGroup>::deser(&share1_b).unwrap();
let share2_d = Keyshare::<RistrettoPoint, RistrettoGroup>::deser(&share2_b).unwrap();
let verified1 = Keymaker::verify_share(&group, &share1_d.share, &share1_d.proof, &vec![]);
let verified2 = Keymaker::verify_share(&group, &share2_d.share, &share2_d.proof, &vec![]);
assert!(verified1 == true);
assert!(verified2 == true);
let pk1_value = &share1_d.share.value.clone();
let pk2_value = &share2_d.share.value.clone();
let pks = vec![share1_d.share, share2_d.share];
let pk_combined = Keymaker::combine_pks(&group, pks);
let mut cs = Vec::with_capacity(10);
let mut bs = Vec::with_capacity(10);
for _ in 0..10 {
let mut fill = [0u8; 30];
csprng.fill_bytes(&mut fill);
let encoded = group.encode(&util::to_u8_30(&fill.to_vec()));
let c = pk_combined.encrypt(&encoded);
bs.push(fill.to_vec());
cs.push(c);
}
let (decs1, proofs1) = km1.decryption_factor_many(&cs, &vec![]);
let (decs2, proofs2) = km2.decryption_factor_many(&cs, &vec![]);
let pd1 = PartialDecryption {
pd_ballots: decs1,
proofs: proofs1,
};
let pd2 = PartialDecryption {
pd_ballots: decs2,
proofs: proofs2,
};
let pd1_b = pd1.ser();
let pd2_b = pd2.ser();
let pd1_d = PartialDecryption::<RistrettoPoint>::deser(&pd1_b).unwrap();
let pd2_d = PartialDecryption::<RistrettoPoint>::deser(&pd2_b).unwrap();
let verified1 = Keymaker::verify_decryption_factors(
&group,
pk1_value,
&cs,
&pd1_d.pd_ballots,
&pd1_d.proofs,
&vec![],
);
let verified2 = Keymaker::verify_decryption_factors(
&group,
pk2_value,
&cs,
&pd2_d.pd_ballots,
&pd2_d.proofs,
&vec![],
);
assert!(verified1 == true);
assert!(verified2 == true);
let decs = vec![pd1_d.pd_ballots, pd2_d.pd_ballots];
let ds = Keymaker::joint_dec_many(&group, &decs, &cs);
let recovered: Vec<Vec<u8>> = ds.into_iter().map(|d| group.decode(&d).to_vec()).collect();
assert_eq!(bs, recovered);
}
#[test]
fn test_identity() {
let mut csprng = OsRng;
let x = RistrettoPoint::random(&mut csprng);
assert_eq!(x + RistrettoPoint::identity(), x);
}
#[test]
fn test_ristretto_shuffle_serde() {
let group = RistrettoGroup;
let exp_hasher = &*group.exp_hasher();
let sk = group.gen_key();
let pk = PublicKey::from(&sk.public_value, &group);
let es = util::random_ristretto_ballots(10, &group).ciphertexts;
let seed = vec![];
let hs = generators(es.len() + 1, &group, 0, seed);
let shuffler = Shuffler {
pk: &pk,
generators: &hs,
hasher: exp_hasher,
};
let (e_primes, rs, perm) = shuffler.gen_shuffle(&es);
let proof = shuffler.gen_proof(&es, &e_primes, &rs, &perm, &vec![]);
let ok = shuffler.check_proof(&proof, &es, &e_primes, &vec![]);
let mix = Mix {
mixed_ballots: e_primes,
proof: proof,
};
let pk_b = pk.ser();
let es_b = es.ser();
let mix_b = mix.ser();
assert!(ok == true);
let pk_d = PublicKey::<RistrettoPoint, RistrettoGroup>::deser(&pk_b).unwrap();
let es_d = Vec::<Ciphertext<RistrettoPoint>>::deser(&es_b).unwrap();
let mix_d = Mix::<RistrettoPoint>::deser(&mix_b).unwrap();
let shuffler_d = Shuffler {
pk: &pk_d,
generators: &hs,
hasher: exp_hasher,
};
let ok_d = shuffler_d.check_proof(&mix_d.proof, &es_d, &mix_d.mixed_ballots, &vec![]);
assert!(ok_d == true);
}
#[test]
fn test_ristretto_encrypted_pk() {
let mut csprng = OsRng;
let group = RistrettoGroup;
let sk = group.gen_key();
let pk = PublicKey::from(&sk.public_value, &group);
let mut fill = [0u8; 30];
csprng.fill_bytes(&mut fill);
let plaintext = group.encode(&util::to_u8_30(&fill.to_vec()));
let c = pk.encrypt(&plaintext);
let sym_key = symmetric::gen_key();
let enc_sk = sk.to_encrypted(sym_key);
let enc_sk_b = enc_sk.ser();
let enc_sk_d = EncryptedPrivateKey::deser(&enc_sk_b).unwrap();
let sk_d = PrivateKey::from_encrypted(sym_key, enc_sk_d, &group);
let d = sk_d.decrypt(&c);
let recovered = group.decode(&d).to_vec();
assert_eq!(fill.to_vec(), recovered);
}
}
| 31.571936 | 99 | 0.547961 |
9c6352e49eadcd186d703f4a96b3724ba7bd6e0b
| 1,404 |
js
|
JavaScript
|
lib/couchbase.js
|
zengamingx/couchbase-promises
|
77e6d4bf57cc5e7992e3b0132d5a608e0c03dab7
|
[
"MIT"
] | 19 |
2015-11-17T18:28:43.000Z
|
2019-07-06T02:47:04.000Z
|
lib/couchbase.js
|
zengamingx/couchbase-promises
|
77e6d4bf57cc5e7992e3b0132d5a608e0c03dab7
|
[
"MIT"
] | 12 |
2015-12-03T19:51:23.000Z
|
2019-03-07T17:53:36.000Z
|
lib/couchbase.js
|
zengamingx/couchbase-promises
|
77e6d4bf57cc5e7992e3b0132d5a608e0c03dab7
|
[
"MIT"
] | 12 |
2016-04-05T22:00:13.000Z
|
2020-02-18T04:07:22.000Z
|
'use strict';
const couchbase = require('couchbase');
const elv = require('elv');
const Bucket = require('./bucket');
const Cluster = require('./cluster');
const promises = require('./promises');
const Mock = {
Cluster: require('./mock-cluster'),
SpatialQuery: couchbase.Mock.SpatialQuery,
ViewQuery: couchbase.Mock.ViewQuery,
N1qlQuery: couchbase.Mock.N1qlQuery,
Mock: null,
Error: couchbase.Mock.Error,
errors: couchbase.Mock.errors
};
Mock.Mock = Mock;
class Couchbase {
static get Cluster() { return Cluster; }
static get SpatialQuery() { return couchbase.SpatialQuery; }
static get ViewQuery() { return couchbase.ViewQuery; }
static get N1qlQuery() { return couchbase.N1qlQuery; }
static get CbasQuery() { return couchbase.CbasQuery; }
static get SearchQuery() { return couchbase.SearchQuery; }
static get SearchFacet() { return couchbase.SearchFacet; }
static get MutationState() { return couchbase.MutationState; }
static get Mock() { return Mock; }
static get Error() { return couchbase.Error; }
static get errors() { return couchbase.errors; }
static get ClassicAuthenticator() { return couchbase.ClassicAuthenticator; }
static get Promise() { return promises.Promise; }
static setPromiseLib(lib) { promises.set(lib); }
static revertPromiseLib() { promises.revert(); }
}
module.exports = Couchbase;
| 31.909091 | 79 | 0.700142 |
e7127e7beba22b3e99aa152efa08615be6b2e5ba
| 75,289 |
js
|
JavaScript
|
akan_files/1307051291-idpiframe.js
|
ClarisseU/MyPortfolio
|
d0df25d67ca2e2efca449d9a904f792f5e6ecc39
|
[
"MIT"
] | null | null | null |
akan_files/1307051291-idpiframe.js
|
ClarisseU/MyPortfolio
|
d0df25d67ca2e2efca449d9a904f792f5e6ecc39
|
[
"MIT"
] | 2 |
2021-09-02T20:33:10.000Z
|
2022-03-29T10:04:07.000Z
|
akan_files/1307051291-idpiframe.js
|
ClarisseU/MyPortfolio
|
d0df25d67ca2e2efca449d9a904f792f5e6ecc39
|
[
"MIT"
] | null | null | null |
var m,aa=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}},p=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}},ba="function"==typeof Object.create?Object.create:function(a){var b=function(){};b.prototype=a;return new b},ca;
if("function"==typeof Object.setPrototypeOf)ca=Object.setPrototypeOf;else{var da;a:{var ea={a:!0},fa={};try{fa.__proto__=ea;da=fa.a;break a}catch(a){}da=!1}ca=da?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}
var ha=ca,ia=function(a,b){a.prototype=ba(b.prototype);a.prototype.constructor=a;if(ha)ha(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.kb=b.prototype},ja="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},q="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:
this,ka=function(a,b){if(b){var c=q;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&ja(c,a,{configurable:!0,writable:!0,value:b})}},la=function(){la=function(){};q.Symbol||(q.Symbol=ma)},na=function(a,b){this.Vb=a;ja(this,"description",{configurable:!0,writable:!0,value:b})};na.prototype.toString=function(){return this.Vb};
var ma=function(){function a(c){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return new na("jscomp_symbol_"+(c||"")+"_"+b++,c)}var b=0;return a}(),pa=function(){la();var a=q.Symbol.iterator;a||(a=q.Symbol.iterator=q.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[a]&&ja(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return oa(aa(this))}});pa=function(){}},oa=function(a){pa();a={next:a};a[q.Symbol.iterator]=function(){return this};return a},
t=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};
ka("WeakMap",function(a){function b(){}function c(k){var l=typeof k;return"object"===l&&null!==k||"function"===l}function d(k){if(!t(k,g)){var l=new b;ja(k,g,{value:l})}}function e(k){var l=Object[k];l&&(Object[k]=function(n){if(n instanceof b)return n;d(n);return l(n)})}if(function(){if(!a||!Object.seal)return!1;try{var k=Object.seal({}),l=Object.seal({}),n=new a([[k,2],[l,3]]);if(2!=n.get(k)||3!=n.get(l))return!1;n["delete"](k);n.set(l,4);return!n.has(k)&&4==n.get(l)}catch(r){return!1}}())return a;
var g="$jscomp_hidden_"+Math.random();e("freeze");e("preventExtensions");e("seal");var f=0,h=function(k){this.na=(f+=Math.random()+1).toString();if(k){k=p(k);for(var l;!(l=k.next()).done;)l=l.value,this.set(l[0],l[1])}};h.prototype.set=function(k,l){if(!c(k))throw Error("Invalid WeakMap key");d(k);if(!t(k,g))throw Error("WeakMap key fail: "+k);k[g][this.na]=l;return this};h.prototype.get=function(k){return c(k)&&t(k,g)?k[g][this.na]:void 0};h.prototype.has=function(k){return c(k)&&t(k,g)&&t(k[g],
this.na)};h.prototype["delete"]=function(k){return c(k)&&t(k,g)&&t(k[g],this.na)?delete k[g][this.na]:!1};return h});
ka("Map",function(a){if(function(){if(!a||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var h=Object.seal({x:4}),k=new a(p([[h,"s"]]));if("s"!=k.get(h)||1!=k.size||k.get({x:4})||k.set({x:4},"t")!=k||2!=k.size)return!1;var l=k.entries(),n=l.next();if(n.done||n.value[0]!=h||"s"!=n.value[1])return!1;n=l.next();return n.done||4!=n.value[0].x||"t"!=n.value[1]||!l.next().done?!1:!0}catch(r){return!1}}())return a;pa();var b=new WeakMap,c=function(h){this.ka={};this.R=
g();this.size=0;if(h){h=p(h);for(var k;!(k=h.next()).done;)k=k.value,this.set(k[0],k[1])}};c.prototype.set=function(h,k){h=0===h?0:h;var l=d(this,h);l.list||(l.list=this.ka[l.id]=[]);l.w?l.w.value=k:(l.w={next:this.R,S:this.R.S,head:this.R,key:h,value:k},l.list.push(l.w),this.R.S.next=l.w,this.R.S=l.w,this.size++);return this};c.prototype["delete"]=function(h){h=d(this,h);return h.w&&h.list?(h.list.splice(h.index,1),h.list.length||delete this.ka[h.id],h.w.S.next=h.w.next,h.w.next.S=h.w.S,h.w.head=
null,this.size--,!0):!1};c.prototype.clear=function(){this.ka={};this.R=this.R.S=g();this.size=0};c.prototype.has=function(h){return!!d(this,h).w};c.prototype.get=function(h){return(h=d(this,h).w)&&h.value};c.prototype.entries=function(){return e(this,function(h){return[h.key,h.value]})};c.prototype.keys=function(){return e(this,function(h){return h.key})};c.prototype.values=function(){return e(this,function(h){return h.value})};c.prototype.forEach=function(h,k){for(var l=this.entries(),n;!(n=l.next()).done;)n=
n.value,h.call(k,n[1],n[0],this)};c.prototype[Symbol.iterator]=c.prototype.entries;var d=function(h,k){var l=k&&typeof k;"object"==l||"function"==l?b.has(k)?l=b.get(k):(l=""+ ++f,b.set(k,l)):l="p_"+k;var n=h.ka[l];if(n&&t(h.ka,l))for(h=0;h<n.length;h++){var r=n[h];if(k!==k&&r.key!==r.key||k===r.key)return{id:l,list:n,index:h,w:r}}return{id:l,list:n,index:-1,w:void 0}},e=function(h,k){var l=h.R;return oa(function(){if(l){for(;l.head!=h.R;)l=l.S;for(;l.next!=l.head;)return l=l.next,{done:!1,value:k(l)};
l=null}return{done:!0,value:void 0}})},g=function(){var h={};return h.S=h.next=h.head=h},f=0;return c});
ka("Set",function(a){if(function(){if(!a||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var c=Object.seal({x:4}),d=new a(p([c]));if(!d.has(c)||1!=d.size||d.add(c)!=d||1!=d.size||d.add({x:4})!=d||2!=d.size)return!1;var e=d.entries(),g=e.next();if(g.done||g.value[0]!=c||g.value[1]!=c)return!1;g=e.next();return g.done||g.value[0]==c||4!=g.value[0].x||g.value[1]!=g.value[0]?!1:e.next().done}catch(f){return!1}}())return a;pa();var b=function(c){this.N=new Map;
if(c){c=p(c);for(var d;!(d=c.next()).done;)this.add(d.value)}this.size=this.N.size};b.prototype.add=function(c){c=0===c?0:c;this.N.set(c,c);this.size=this.N.size;return this};b.prototype["delete"]=function(c){c=this.N["delete"](c);this.size=this.N.size;return c};b.prototype.clear=function(){this.N.clear();this.size=0};b.prototype.has=function(c){return this.N.has(c)};b.prototype.entries=function(){return this.N.entries()};b.prototype.values=function(){return this.N.values()};b.prototype.keys=b.prototype.values;
b.prototype[Symbol.iterator]=b.prototype.values;b.prototype.forEach=function(c,d){var e=this;this.N.forEach(function(g){return c.call(d,g,g,e)})};return b});
ka("Promise",function(a){function b(){this.T=null}function c(f){return f instanceof e?f:new e(function(h){h(f)})}if(a)return a;b.prototype.wb=function(f){if(null==this.T){this.T=[];var h=this;this.xb(function(){h.rc()})}this.T.push(f)};var d=q.setTimeout;b.prototype.xb=function(f){d(f,0)};b.prototype.rc=function(){for(;this.T&&this.T.length;){var f=this.T;this.T=[];for(var h=0;h<f.length;++h){var k=f[h];f[h]=null;try{k()}catch(l){this.gc(l)}}}this.T=null};b.prototype.gc=function(f){this.xb(function(){throw f;
})};var e=function(f){this.ua=0;this.fb=void 0;this.ea=[];var h=this.Oa();try{f(h.resolve,h.reject)}catch(k){h.reject(k)}};e.prototype.Oa=function(){function f(l){return function(n){k||(k=!0,l.call(h,n))}}var h=this,k=!1;return{resolve:f(this.Wc),reject:f(this.eb)}};e.prototype.Wc=function(f){if(f===this)this.eb(new TypeError("A Promise cannot resolve to itself"));else if(f instanceof e)this.dd(f);else{a:switch(typeof f){case "object":var h=null!=f;break a;case "function":h=!0;break a;default:h=!1}h?
this.Vc(f):this.Db(f)}};e.prototype.Vc=function(f){var h=void 0;try{h=f.then}catch(k){this.eb(k);return}"function"==typeof h?this.ed(h,f):this.Db(f)};e.prototype.eb=function(f){this.Tb(2,f)};e.prototype.Db=function(f){this.Tb(1,f)};e.prototype.Tb=function(f,h){if(0!=this.ua)throw Error("Cannot settle("+f+", "+h+"): Promise already settled in state"+this.ua);this.ua=f;this.fb=h;this.sc()};e.prototype.sc=function(){if(null!=this.ea){for(var f=0;f<this.ea.length;++f)g.wb(this.ea[f]);this.ea=null}};var g=
new b;e.prototype.dd=function(f){var h=this.Oa();f.xa(h.resolve,h.reject)};e.prototype.ed=function(f,h){var k=this.Oa();try{f.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};e.prototype.then=function(f,h){function k(I,W){return"function"==typeof I?function(jb){try{l(I(jb))}catch(kb){n(kb)}}:W}var l,n,r=new e(function(I,W){l=I;n=W});this.xa(k(f,l),k(h,n));return r};e.prototype["catch"]=function(f){return this.then(void 0,f)};e.prototype.xa=function(f,h){function k(){switch(l.ua){case 1:f(l.fb);break;
case 2:h(l.fb);break;default:throw Error("Unexpected state: "+l.ua);}}var l=this;null==this.ea?g.wb(k):this.ea.push(k)};e.resolve=c;e.reject=function(f){return new e(function(h,k){k(f)})};e.race=function(f){return new e(function(h,k){for(var l=p(f),n=l.next();!n.done;n=l.next())c(n.value).xa(h,k)})};e.all=function(f){var h=p(f),k=h.next();return k.done?c([]):new e(function(l,n){function r(jb){return function(kb){I[jb]=kb;W--;0==W&&l(I)}}var I=[],W=0;do I.push(void 0),W++,c(k.value).xa(r(I.length-
1),n),k=h.next();while(!k.done)})};return e});
var u=this||self,qa=function(){},v=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&
!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a.call)return"object";return b},ra=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b},sa=function(a,b){function c(){}c.prototype=b.prototype;a.kb=b.prototype;a.prototype=new c;a.prototype.constructor=a};var ta=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,ta);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};sa(ta,Error);ta.prototype.name="CustomError";var ua=function(a,b){a=a.split("%s");for(var c="",d=a.length-1,e=0;e<d;e++)c+=a[e]+(e<b.length?b[e]:"%s");ta.call(this,c+a[d])};sa(ua,ta);ua.prototype.name="AssertionError";
var va=function(a,b,c,d){var e="Assertion failed";if(c){e+=": "+c;var g=d}else a&&(e+=": "+a,g=b);throw new ua(""+e,g||[]);},w=function(a,b,c){a||va("",null,b,Array.prototype.slice.call(arguments,2));return a},wa=function(a,b){throw new ua("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1));},xa=function(a,b,c){"string"!==typeof a&&va("Expected string but got %s: %s.",[v(a),a],b,Array.prototype.slice.call(arguments,2))};var ya=Array.prototype.indexOf?function(a,b){w(null!=a.length);return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if("string"===typeof a)return"string"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1};var za=function(a){for(var b=[],c=0,d=0;d<a.length;d++){var e=a.charCodeAt(d);255<e&&(b[c++]=e&255,e>>=8);b[c++]=e}return b};var Aa=function(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return!0;return!1};var Da=function(a,b){this.jb=a===Ba&&b||"";this.ec=Ca};Da.prototype.W=!0;Da.prototype.V=function(){return this.jb};Da.prototype.toString=function(){return"Const{"+this.jb+"}"};var Ea=function(a){if(a instanceof Da&&a.constructor===Da&&a.ec===Ca)return a.jb;wa("expected object of type Const, got '"+a+"'");return"type_error:Const"},Ca={},Ba={};var Fa=function(){this.Za=""};Fa.prototype.W=!0;Fa.prototype.V=function(){return this.Za.toString()};Fa.prototype.toString=function(){return"SafeScript{"+this.Za+"}"};Fa.prototype.X=function(a){this.Za=a;return this};(new Fa).X("");var Ga=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]},Oa=function(a,b){if(b)a=a.replace(Ha,"&").replace(Ia,"<").replace(Ja,">").replace(Ka,""").replace(La,"'").replace(Ma,"�");else{if(!Na.test(a))return a;-1!=a.indexOf("&")&&(a=a.replace(Ha,"&"));-1!=a.indexOf("<")&&(a=a.replace(Ia,"<"));-1!=a.indexOf(">")&&(a=a.replace(Ja,">"));-1!=a.indexOf('"')&&(a=a.replace(Ka,"""));-1!=a.indexOf("'")&&(a=a.replace(La,
"'"));-1!=a.indexOf("\x00")&&(a=a.replace(Ma,"�"))}return a},Ha=/&/g,Ia=/</g,Ja=/>/g,Ka=/"/g,La=/'/g,Ma=/\x00/g,Na=/[\x00&<>"']/,Pa=function(a,b){return a<b?-1:a>b?1:0};var Sa=function(a,b){this.bb=a===Qa&&b||"";this.dc=Ra};m=Sa.prototype;m.W=!0;m.V=function(){return this.bb.toString()};m.Ib=!0;m.Sa=function(){return 1};m.toString=function(){return"SafeUrl{"+this.bb+"}"};var Ta=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i,Ra={},Qa={};var Ua=function(){this.ab=""};Ua.prototype.W=!0;Ua.prototype.V=function(){return this.ab};Ua.prototype.toString=function(){return"SafeStyle{"+this.ab+"}"};Ua.prototype.X=function(a){this.ab=a;return this};(new Ua).X("");var Va=function(){this.$a=""};Va.prototype.W=!0;Va.prototype.V=function(){return this.$a};Va.prototype.toString=function(){return"SafeStyleSheet{"+this.$a+"}"};Va.prototype.X=function(a){this.$a=a;return this};(new Va).X("");var x;a:{var Wa=u.navigator;if(Wa){var Xa=Wa.userAgent;if(Xa){x=Xa;break a}}x=""};var y=function(){this.Ba="";this.cc=Ya;this.Cb=null};m=y.prototype;m.Ib=!0;m.Sa=function(){return this.Cb};m.W=!0;m.V=function(){return this.Ba.toString()};m.toString=function(){return"SafeHtml{"+this.Ba+"}"};
var Za=function(a){if(a instanceof y&&a.constructor===y&&a.cc===Ya)return a.Ba;wa("expected object of type SafeHtml, got '"+a+"' of type "+v(a));return"type_error:SafeHtml"},ab=function(a){if(a instanceof y)return a;var b="object"==typeof a,c=null;b&&a.Ib&&(c=a.Sa());return $a(Oa(b&&a.W?a.V():String(a)),c)},Ya={},$a=function(a,b){return(new y).X(a,b)};y.prototype.X=function(a,b){this.Ba=a;this.Cb=b;return this};$a("<!DOCTYPE html>",0);var bb=$a("",0);$a("<br>",0);var cb=function(a){var b=!1,c;return function(){b||(c=a(),b=!0);return c}}(function(){if("undefined"===typeof document)return!1;var a=document.createElement("div"),b=document.createElement("div");b.appendChild(document.createElement("div"));a.appendChild(b);if(!a.firstChild)return!1;b=a.firstChild.firstChild;a.innerHTML=Za(bb);return!b.parentElement}),db=function(a){var b=document.location;a:{try{var c=b&&b.ownerDocument,d=c&&(c.defaultView||c.parentWindow);d=d||u;if(d.Element&&d.Location){var e=
d;break a}}catch(f){}e=null}if(e&&(!b||!(b instanceof e.Location)&&b instanceof e.Element)){if(ra(b))try{var g=b.constructor.displayName||b.constructor.name||Object.prototype.toString.call(b)}catch(f){g="<object could not be stringified>"}else g=void 0===b?"undefined":null===b?"null":typeof b;wa("Argument is not a Location (or a non-Element mock); got: %s",g)}a instanceof Sa||a instanceof Sa||(a="object"==typeof a&&a.W?a.V():String(a),w(Ta.test(a),"%s does not match the safe URL pattern",a)||(a="about:invalid#zClosurez"),
a=new Sa(Qa,a));a instanceof Sa&&a.constructor===Sa&&a.dc===Ra?a=a.bb:(wa("expected object of type SafeUrl, got '"+a+"' of type "+v(a)),a="type_error:SafeUrl");b.href=a};var eb=function(a){eb[" "](a);return a};eb[" "]=qa;var fb=-1!=x.indexOf("Opera"),gb=-1!=x.indexOf("Trident")||-1!=x.indexOf("MSIE"),hb=-1!=x.indexOf("Edge"),ib=-1!=x.indexOf("Gecko")&&!(-1!=x.toLowerCase().indexOf("webkit")&&-1==x.indexOf("Edge"))&&!(-1!=x.indexOf("Trident")||-1!=x.indexOf("MSIE"))&&-1==x.indexOf("Edge"),lb=-1!=x.toLowerCase().indexOf("webkit")&&-1==x.indexOf("Edge"),mb=function(){var a=u.document;return a?a.documentMode:void 0},nb;
a:{var ob="",pb=function(){var a=x;if(ib)return/rv:([^\);]+)(\)|;)/.exec(a);if(hb)return/Edge\/([\d\.]+)/.exec(a);if(gb)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(lb)return/WebKit\/(\S+)/.exec(a);if(fb)return/(?:Version)[ \/]?(\S+)/.exec(a)}();pb&&(ob=pb?pb[1]:"");if(gb){var qb=mb();if(null!=qb&&qb>parseFloat(ob)){nb=String(qb);break a}}nb=ob}var rb=nb,sb={},tb;tb=u.document&&gb?mb():void 0;var ub={},vb=null;var wb=function(){this.u=-1};var xb=function(a,b,c){this.u=-1;this.G=a;this.u=c||a.u||16;this.Kb=Array(this.u);this.Ya=Array(this.u);a=b;a.length>this.u&&(this.G.update(a),a=this.G.digest(),this.G.reset());for(c=0;c<this.u;c++)b=c<a.length?a[c]:0,this.Kb[c]=b^92,this.Ya[c]=b^54;this.G.update(this.Ya)};sa(xb,wb);xb.prototype.reset=function(){this.G.reset();this.G.update(this.Ya)};xb.prototype.update=function(a,b){this.G.update(a,b)};
xb.prototype.digest=function(){var a=this.G.digest();this.G.reset();this.G.update(this.Kb);this.G.update(a);return this.G.digest()};var yb=function(){this.u=64;this.o=Array(4);this.ic=Array(this.u);this.Fa=this.ja=0;this.reset()};sa(yb,wb);yb.prototype.reset=function(){this.o[0]=1732584193;this.o[1]=4023233417;this.o[2]=2562383102;this.o[3]=271733878;this.Fa=this.ja=0};
var zb=function(a,b,c){c||(c=0);var d=Array(16);if("string"===typeof b)for(var e=0;16>e;++e)d[e]=b.charCodeAt(c++)|b.charCodeAt(c++)<<8|b.charCodeAt(c++)<<16|b.charCodeAt(c++)<<24;else for(e=0;16>e;++e)d[e]=b[c++]|b[c++]<<8|b[c++]<<16|b[c++]<<24;b=a.o[0];c=a.o[1];e=a.o[2];var g=a.o[3];var f=b+(g^c&(e^g))+d[0]+3614090360&4294967295;b=c+(f<<7&4294967295|f>>>25);f=g+(e^b&(c^e))+d[1]+3905402710&4294967295;g=b+(f<<12&4294967295|f>>>20);f=e+(c^g&(b^c))+d[2]+606105819&4294967295;e=g+(f<<17&4294967295|f>>>
15);f=c+(b^e&(g^b))+d[3]+3250441966&4294967295;c=e+(f<<22&4294967295|f>>>10);f=b+(g^c&(e^g))+d[4]+4118548399&4294967295;b=c+(f<<7&4294967295|f>>>25);f=g+(e^b&(c^e))+d[5]+1200080426&4294967295;g=b+(f<<12&4294967295|f>>>20);f=e+(c^g&(b^c))+d[6]+2821735955&4294967295;e=g+(f<<17&4294967295|f>>>15);f=c+(b^e&(g^b))+d[7]+4249261313&4294967295;c=e+(f<<22&4294967295|f>>>10);f=b+(g^c&(e^g))+d[8]+1770035416&4294967295;b=c+(f<<7&4294967295|f>>>25);f=g+(e^b&(c^e))+d[9]+2336552879&4294967295;g=b+(f<<12&4294967295|
f>>>20);f=e+(c^g&(b^c))+d[10]+4294925233&4294967295;e=g+(f<<17&4294967295|f>>>15);f=c+(b^e&(g^b))+d[11]+2304563134&4294967295;c=e+(f<<22&4294967295|f>>>10);f=b+(g^c&(e^g))+d[12]+1804603682&4294967295;b=c+(f<<7&4294967295|f>>>25);f=g+(e^b&(c^e))+d[13]+4254626195&4294967295;g=b+(f<<12&4294967295|f>>>20);f=e+(c^g&(b^c))+d[14]+2792965006&4294967295;e=g+(f<<17&4294967295|f>>>15);f=c+(b^e&(g^b))+d[15]+1236535329&4294967295;c=e+(f<<22&4294967295|f>>>10);f=b+(e^g&(c^e))+d[1]+4129170786&4294967295;b=c+(f<<
5&4294967295|f>>>27);f=g+(c^e&(b^c))+d[6]+3225465664&4294967295;g=b+(f<<9&4294967295|f>>>23);f=e+(b^c&(g^b))+d[11]+643717713&4294967295;e=g+(f<<14&4294967295|f>>>18);f=c+(g^b&(e^g))+d[0]+3921069994&4294967295;c=e+(f<<20&4294967295|f>>>12);f=b+(e^g&(c^e))+d[5]+3593408605&4294967295;b=c+(f<<5&4294967295|f>>>27);f=g+(c^e&(b^c))+d[10]+38016083&4294967295;g=b+(f<<9&4294967295|f>>>23);f=e+(b^c&(g^b))+d[15]+3634488961&4294967295;e=g+(f<<14&4294967295|f>>>18);f=c+(g^b&(e^g))+d[4]+3889429448&4294967295;c=
e+(f<<20&4294967295|f>>>12);f=b+(e^g&(c^e))+d[9]+568446438&4294967295;b=c+(f<<5&4294967295|f>>>27);f=g+(c^e&(b^c))+d[14]+3275163606&4294967295;g=b+(f<<9&4294967295|f>>>23);f=e+(b^c&(g^b))+d[3]+4107603335&4294967295;e=g+(f<<14&4294967295|f>>>18);f=c+(g^b&(e^g))+d[8]+1163531501&4294967295;c=e+(f<<20&4294967295|f>>>12);f=b+(e^g&(c^e))+d[13]+2850285829&4294967295;b=c+(f<<5&4294967295|f>>>27);f=g+(c^e&(b^c))+d[2]+4243563512&4294967295;g=b+(f<<9&4294967295|f>>>23);f=e+(b^c&(g^b))+d[7]+1735328473&4294967295;
e=g+(f<<14&4294967295|f>>>18);f=c+(g^b&(e^g))+d[12]+2368359562&4294967295;c=e+(f<<20&4294967295|f>>>12);f=b+(c^e^g)+d[5]+4294588738&4294967295;b=c+(f<<4&4294967295|f>>>28);f=g+(b^c^e)+d[8]+2272392833&4294967295;g=b+(f<<11&4294967295|f>>>21);f=e+(g^b^c)+d[11]+1839030562&4294967295;e=g+(f<<16&4294967295|f>>>16);f=c+(e^g^b)+d[14]+4259657740&4294967295;c=e+(f<<23&4294967295|f>>>9);f=b+(c^e^g)+d[1]+2763975236&4294967295;b=c+(f<<4&4294967295|f>>>28);f=g+(b^c^e)+d[4]+1272893353&4294967295;g=b+(f<<11&4294967295|
f>>>21);f=e+(g^b^c)+d[7]+4139469664&4294967295;e=g+(f<<16&4294967295|f>>>16);f=c+(e^g^b)+d[10]+3200236656&4294967295;c=e+(f<<23&4294967295|f>>>9);f=b+(c^e^g)+d[13]+681279174&4294967295;b=c+(f<<4&4294967295|f>>>28);f=g+(b^c^e)+d[0]+3936430074&4294967295;g=b+(f<<11&4294967295|f>>>21);f=e+(g^b^c)+d[3]+3572445317&4294967295;e=g+(f<<16&4294967295|f>>>16);f=c+(e^g^b)+d[6]+76029189&4294967295;c=e+(f<<23&4294967295|f>>>9);f=b+(c^e^g)+d[9]+3654602809&4294967295;b=c+(f<<4&4294967295|f>>>28);f=g+(b^c^e)+d[12]+
3873151461&4294967295;g=b+(f<<11&4294967295|f>>>21);f=e+(g^b^c)+d[15]+530742520&4294967295;e=g+(f<<16&4294967295|f>>>16);f=c+(e^g^b)+d[2]+3299628645&4294967295;c=e+(f<<23&4294967295|f>>>9);f=b+(e^(c|~g))+d[0]+4096336452&4294967295;b=c+(f<<6&4294967295|f>>>26);f=g+(c^(b|~e))+d[7]+1126891415&4294967295;g=b+(f<<10&4294967295|f>>>22);f=e+(b^(g|~c))+d[14]+2878612391&4294967295;e=g+(f<<15&4294967295|f>>>17);f=c+(g^(e|~b))+d[5]+4237533241&4294967295;c=e+(f<<21&4294967295|f>>>11);f=b+(e^(c|~g))+d[12]+1700485571&
4294967295;b=c+(f<<6&4294967295|f>>>26);f=g+(c^(b|~e))+d[3]+2399980690&4294967295;g=b+(f<<10&4294967295|f>>>22);f=e+(b^(g|~c))+d[10]+4293915773&4294967295;e=g+(f<<15&4294967295|f>>>17);f=c+(g^(e|~b))+d[1]+2240044497&4294967295;c=e+(f<<21&4294967295|f>>>11);f=b+(e^(c|~g))+d[8]+1873313359&4294967295;b=c+(f<<6&4294967295|f>>>26);f=g+(c^(b|~e))+d[15]+4264355552&4294967295;g=b+(f<<10&4294967295|f>>>22);f=e+(b^(g|~c))+d[6]+2734768916&4294967295;e=g+(f<<15&4294967295|f>>>17);f=c+(g^(e|~b))+d[13]+1309151649&
4294967295;c=e+(f<<21&4294967295|f>>>11);f=b+(e^(c|~g))+d[4]+4149444226&4294967295;b=c+(f<<6&4294967295|f>>>26);f=g+(c^(b|~e))+d[11]+3174756917&4294967295;g=b+(f<<10&4294967295|f>>>22);f=e+(b^(g|~c))+d[2]+718787259&4294967295;e=g+(f<<15&4294967295|f>>>17);f=c+(g^(e|~b))+d[9]+3951481745&4294967295;a.o[0]=a.o[0]+b&4294967295;a.o[1]=a.o[1]+(e+(f<<21&4294967295|f>>>11))&4294967295;a.o[2]=a.o[2]+e&4294967295;a.o[3]=a.o[3]+g&4294967295};
yb.prototype.update=function(a,b){void 0===b&&(b=a.length);for(var c=b-this.u,d=this.ic,e=this.ja,g=0;g<b;){if(0==e)for(;g<=c;)zb(this,a,g),g+=this.u;if("string"===typeof a)for(;g<b;){if(d[e++]=a.charCodeAt(g++),e==this.u){zb(this,d);e=0;break}}else for(;g<b;)if(d[e++]=a[g++],e==this.u){zb(this,d);e=0;break}}this.ja=e;this.Fa+=b};
yb.prototype.digest=function(){var a=Array((56>this.ja?this.u:2*this.u)-this.ja);a[0]=128;for(var b=1;b<a.length-8;++b)a[b]=0;var c=8*this.Fa;for(b=a.length-8;b<a.length;++b)a[b]=c&255,c/=256;this.update(a);a=Array(16);for(b=c=0;4>b;++b)for(var d=0;32>d;d+=8)a[c++]=this.o[b]>>>d&255;return a};var Ab=Object.freeze||function(a){return a};var Bb=function(a){var b=document;return"string"===typeof a?b.getElementById(a):a};var Cb;(Cb=!gb)||(Cb=9<=Number(tb));var Db=Cb,Eb;
if(Eb=gb){var Fb;if(Object.prototype.hasOwnProperty.call(sb,"9"))Fb=sb["9"];else{for(var Gb=0,Hb=Ga(String(rb)).split("."),Ib=Ga("9").split("."),Jb=Math.max(Hb.length,Ib.length),Kb=0;0==Gb&&Kb<Jb;Kb++){var Lb=Hb[Kb]||"",Mb=Ib[Kb]||"";do{var Nb=/(\d*)(\D*)(.*)/.exec(Lb)||["","","",""],Ob=/(\d*)(\D*)(.*)/.exec(Mb)||["","","",""];if(0==Nb[0].length&&0==Ob[0].length)break;Gb=Pa(0==Nb[1].length?0:parseInt(Nb[1],10),0==Ob[1].length?0:parseInt(Ob[1],10))||Pa(0==Nb[2].length,0==Ob[2].length)||Pa(Nb[2],Ob[2]);
Lb=Nb[3];Mb=Ob[3]}while(0==Gb)}Fb=sb["9"]=0<=Gb}Eb=!Fb}var Pb=Eb,Qb=function(){if(!u.addEventListener||!Object.defineProperty)return!1;var a=!1,b=Object.defineProperty({},"passive",{get:function(){a=!0}});try{u.addEventListener("test",qa,b),u.removeEventListener("test",qa,b)}catch(c){}return a}();var Rb=function(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.cb=!1};Rb.prototype.stopPropagation=function(){this.cb=!0};Rb.prototype.preventDefault=function(){this.defaultPrevented=!0};var Sb;Sb=lb?"webkitTransitionEnd":fb?"otransitionend":"transitionend";var z=function(a,b){Rb.call(this,a?a.type:"");this.relatedTarget=this.currentTarget=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=this.offsetY=this.offsetX=0;this.key="";this.charCode=this.keyCode=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.state=null;this.pointerId=0;this.pointerType="";this.ma=null;a&&this.I(a,b)};sa(z,Rb);var Tb=Ab({2:"touch",3:"pen",4:"mouse"});
z.prototype.I=function(a,b){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.currentTarget=b;if(b=a.relatedTarget){if(ib){a:{try{eb(b.nodeName);var e=!0;break a}catch(g){}e=!1}e||(b=null)}}else"mouseover"==c?b=a.fromElement:"mouseout"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=
d.screenY||0):(this.offsetX=lb||void 0!==a.offsetX?a.offsetX:a.layerX,this.offsetY=lb||void 0!==a.offsetY?a.offsetY:a.layerY,this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.keyCode=a.keyCode||0;this.key=a.key||"";this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.pointerId=
a.pointerId||0;this.pointerType="string"===typeof a.pointerType?a.pointerType:Tb[a.pointerType]||"";this.state=a.state;this.ma=a;a.defaultPrevented&&this.preventDefault()};z.prototype.stopPropagation=function(){z.kb.stopPropagation.call(this);this.ma.stopPropagation?this.ma.stopPropagation():this.ma.cancelBubble=!0};
z.prototype.preventDefault=function(){z.kb.preventDefault.call(this);var a=this.ma;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,Pb)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};var Ub="closure_listenable_"+(1E6*Math.random()|0),Vb=0;var Wb=function(a,b,c,d,e){this.listener=a;this.Ca=null;this.src=b;this.type=c;this.capture=!!d;this.i=e;this.key=++Vb;this.sa=this.Ma=!1},Xb=function(a){a.sa=!0;a.listener=null;a.Ca=null;a.src=null;a.i=null};var Yb=function(a){this.src=a;this.J={};this.Ga=0};Yb.prototype.add=function(a,b,c,d,e){var g=a.toString();a=this.J[g];a||(a=this.J[g]=[],this.Ga++);var f=Zb(a,b,d,e);-1<f?(b=a[f],c||(b.Ma=!1)):(b=new Wb(b,this.src,g,!!d,e),b.Ma=c,a.push(b));return b};Yb.prototype.remove=function(a,b,c,d){a=a.toString();if(!(a in this.J))return!1;var e=this.J[a];b=Zb(e,b,c,d);return-1<b?(Xb(e[b]),w(null!=e.length),Array.prototype.splice.call(e,b,1),0==e.length&&(delete this.J[a],this.Ga--),!0):!1};
Yb.prototype.hasListener=function(a,b){var c=void 0!==a,d=c?a.toString():"",e=void 0!==b;return Aa(this.J,function(g){for(var f=0;f<g.length;++f)if(!(c&&g[f].type!=d||e&&g[f].capture!=b))return!0;return!1})};var Zb=function(a,b,c,d){for(var e=0;e<a.length;++e){var g=a[e];if(!g.sa&&g.listener==b&&g.capture==!!c&&g.i==d)return e}return-1};var $b="closure_lm_"+(1E6*Math.random()|0),ac={},bc=0,dc=function(a,b,c,d,e){if(d&&d.once)return cc(a,b,c,d,e);if("array"==v(b)){for(var g=0;g<b.length;g++)dc(a,b[g],c,d,e);return null}c=ec(c);return a&&a[Ub]?A(a,b,c,ra(d)?!!d.capture:!!d):fc(a,b,c,!1,d,e)},fc=function(a,b,c,d,e,g){if(!b)throw Error("Invalid event type");var f=ra(e)?!!e.capture:!!e,h=gc(a);h||(a[$b]=h=new Yb(a));c=h.add(b,c,d,f,g);if(c.Ca)return c;d=hc();c.Ca=d;d.src=a;d.listener=c;if(a.addEventListener)Qb||(e=f),void 0===e&&(e=!1),
a.addEventListener(b.toString(),d,e);else if(a.attachEvent)a.attachEvent(ic(b.toString()),d);else if(a.addListener&&a.removeListener)w("change"===b,"MediaQueryList only has a change event"),a.addListener(d);else throw Error("addEventListener and attachEvent are unavailable.");bc++;return c},hc=function(){var a=jc,b=Db?function(c){return a.call(b.src,b.listener,c)}:function(c){c=a.call(b.src,b.listener,c);if(!c)return c};return b},cc=function(a,b,c,d,e){if("array"==v(b)){for(var g=0;g<b.length;g++)cc(a,
b[g],c,d,e);return null}c=ec(c);return a&&a[Ub]?a.od(b,c,ra(d)?!!d.capture:!!d,e):fc(a,b,c,!0,d,e)},kc=function(a){if("number"!==typeof a&&a&&!a.sa){var b=a.src;if(b&&b[Ub])b.qd(a);else{var c=a.type,d=a.Ca;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(ic(c),d):b.addListener&&b.removeListener&&b.removeListener(d);bc--;if(c=gc(b)){d=a.type;if(d in c.J){var e=c.J[d],g=ya(e,a),f;if(f=0<=g)w(null!=e.length),Array.prototype.splice.call(e,g,1);f&&(Xb(a),0==c.J[d].length&&
(delete c.J[d],c.Ga--))}0==c.Ga&&(c.src=null,b[$b]=null)}else Xb(a)}}},ic=function(a){return a in ac?ac[a]:ac[a]="on"+a},mc=function(a,b,c,d){var e=!0;if(a=gc(a))if(b=a.J[b.toString()])for(b=b.concat(),a=0;a<b.length;a++){var g=b[a];g&&g.capture==c&&!g.sa&&(g=lc(g,d),e=e&&!1!==g)}return e},lc=function(a,b){var c=a.listener,d=a.i||a.src;a.Ma&&kc(a);return c.call(d,b)},jc=function(a,b){if(a.sa)return!0;if(!Db){if(!b)a:{b=["window","event"];for(var c=u,d=0;d<b.length;d++)if(c=c[b[d]],null==c){b=null;
break a}b=c}d=b;b=new z(d,this);c=!0;if(!(0>d.keyCode||void 0!=d.returnValue)){a:{var e=!1;if(0==d.keyCode)try{d.keyCode=-1;break a}catch(f){e=!0}if(e||void 0==d.returnValue)d.returnValue=!0}d=[];for(e=b.currentTarget;e;e=e.parentNode)d.push(e);a=a.type;for(e=d.length-1;!b.cb&&0<=e;e--){b.currentTarget=d[e];var g=mc(d[e],a,!0,b);c=c&&g}for(e=0;!b.cb&&e<d.length;e++)b.currentTarget=d[e],g=mc(d[e],a,!1,b),c=c&&g}return c}return lc(a,new z(b,this))},gc=function(a){a=a[$b];return a instanceof Yb?a:null},
nc="__closure_events_fn_"+(1E9*Math.random()>>>0),ec=function(a){w(a,"Listener can not be null.");if("function"==v(a))return a;w(a.handleEvent,"An object listener must have handleEvent method.");a[nc]||(a[nc]=function(b){return a.handleEvent(b)});return a[nc]};var oc=function(a,b,c){for(;0<=(b=a.indexOf("hl",b))&&b<c;){var d=a.charCodeAt(b-1);if(38==d||63==d)if(d=a.charCodeAt(b+2),!d||61==d||38==d||35==d)return b;b+=3}return-1},pc=/#|$/,qc=/[?&]($|#)/,rc=function(a){var b=document.location.href;for(var c=b.search(pc),d=0,e,g=[];0<=(e=oc(b,d,c));)g.push(b.substring(d,e)),d=Math.min(b.indexOf("&",e)+1||c,c);g.push(b.substr(d));b=g.join("").replace(qc,"$1");(a="hl"+(null!=a?"="+encodeURIComponent(String(a)):""))?(c=b.indexOf("#"),0>c&&(c=b.length),d=b.indexOf("?"),
0>d||d>c?(d=c,e=""):e=b.substring(d+1,c),b=[b.substr(0,d),e,b.substr(c)],c=b[1],b[1]=a?c?c+"&"+a:a:c,a=b[0]+(b[1]?"?"+b[1]:"")+b[2]):a=b;return a};var sc={pd:!0},B=function(){throw Error("Do not instantiate directly");};B.prototype.Na=null;B.prototype.toString=function(){return this.content};var tc=function(){B.call(this)};sa(tc,B);tc.prototype.aa=sc;var vc=function(a,b,c,d){w(b,"Soy template may not be null.");c=b(c||uc,void 0,d);if(ra(c))if(c instanceof B){if(c.aa!==sc)throw Error("Sanitized content was not of kind HTML.");b=c.toString();c=c.Na;d=new Da(Ba,"Soy SanitizedContent of kind HTML produces SafeHtml-contract-compliant value.");xa(Ea(d),"must provide justification");w(!/^[\s\xa0]*$/.test(Ea(d)),"must provide non-empty justification");b=$a(b,c||null)}else wa("Soy template output is unsafe for use as HTML: "+c),b=ab("zSoyz");else b=ab(String(c));
a=w(a);if(cb())for(;a.lastChild;)a.removeChild(a.lastChild);a.innerHTML=Za(b)},uc={};var wc=function(a){var b=null!=a&&a.aa===sc;b&&w(a.constructor===tc);return b};var xc=function(a){if(null!=a)switch(a.Na){case 1:return 1;case -1:return-1;case 0:return 0}return null},zc=function(a){return wc(a)?a:a instanceof y?C(Za(a).toString(),a.Sa()):C(yc(String(a)),xc(a))},C=function(a){function b(c){this.content=c}b.prototype=a.prototype;return function(c,d){c=new b(String(c));void 0!==d&&(c.Na=d);return c}}(tc),D=function(a){return wc(a)?String(String(a.content).replace(Ac,"").replace(Bc,"<")).replace(Cc,Dc):yc(a)},Ec=function(a,b){a||(a=b instanceof Function?b.displayName||
b.name||"unknown type name":b instanceof Object?b.constructor.displayName||b.constructor.name||Object.prototype.toString.call(b):null===b?"null":typeof b,wa("expected param origin of type string, but got "+a+"."));return b},yc=function(a){a=String(a);return a=Oa(a,void 0)},Fc={"\x00":"�","\t":"	","\n":" ","\x0B":"","\f":"","\r":" "," ":" ",'"':""","&":"&","'":"'","-":"-","/":"/","<":"<","=":"=",">":">","`":"`","\u0085":"…","\u00a0":" ",
"\u2028":"
","\u2029":"
"},Dc=function(a){return Fc[a]},Cc=/[\x00\x22\x27\x3c\x3e]/g,Ac=/<(?:!|\/?([a-zA-Z][a-zA-Z0-9:\-]*))(?:[^>'"]|"[^"]*"|'[^']*')*>/g,Bc=/</g;var Gc=function(){var a='<div class="'+D("dialog-header")+'"><div class="'+D("google-icon")+'">';var b=C('<svg class="'+D("icon")+'" xmlns="https://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="#4285F4" d="M45.12 24.5c0-1.56-.14-3.06-.4-4.5H24v8.51h11.84c-.51 2.75-2.06 5.08-4.39 6.64v5.52h7.11c4.16-3.83 6.56-9.47 6.56-16.17z"/><path fill="#34A853" d="M24 46c5.94 0 10.92-1.97 14.56-5.33l-7.11-5.52c-1.97 1.32-4.49 2.1-7.45 2.1-5.73 0-10.58-3.87-12.31-9.07H4.34v5.7C7.96 41.07 15.4 46 24 46z"/><path fill="#FBBC05" d="M11.69 28.18C11.25 26.86 11 25.45 11 24s.25-2.86.69-4.18v-5.7H4.34C2.85 17.09 2 20.45 2 24c0 3.55.85 6.91 2.34 9.88l7.35-5.7z"/><path fill="#EA4335" d="M24 10.75c3.23 0 6.13 1.11 8.41 3.29l6.31-6.31C34.91 4.18 29.93 2 24 2 15.4 2 7.96 6.93 4.34 14.12l7.35 5.7c1.73-5.2 6.58-9.07 12.31-9.07z"/><path fill="none" d="M2 2h44v44H2z"/></svg>');
return C(a+b+"</div><p>Continue with Google</p></div>")},Hc=function(a){var b=C,c='<div class="'+D("dialog-footer")+'">',d=a.Pa;a=a.languages;var e='<div id="language_selector" class="'+D("language-selector")+'"><div class="'+D("language-selected")+'">';if((d instanceof B?d.content:d)&&(a instanceof B?a.content:a)){for(var g="",f=a.length,h=0;h<f;h++){var k=a[h];var l=k.code;var n=d;l="function"==v(l)&&"function"==v(n)?l.aa!==n.aa?!1:l.toString()===n.toString():l instanceof B&&n instanceof B?l.aa!=
n.aa?!1:l.toString()==n.toString():l==n;g+=l?""+k.displayName:""}e+="<div>"+zc(g)+"</div>"}e+='<div class="'+D("chevron")+'"></div></div><div id="language_list" class="'+D("language-list")+'">';if(a)for(d=a.length,f=0;f<d;f++)h=a[f],e+='<div class="'+D("language-option")+'" data-languagecode="'+D(h.code)+'">'+zc(h.displayName)+"</div>";a=C(e+"</div></div>");c+=a;a='<ul class="'+D("footer-menu")+'"><li class="'+D("menu-item")+'"><a class="'+D("menu-content")+'" href="#">';a=a+'Help</a></li><li class="'+
(D("menu-item")+'"><a class="'+D("menu-content")+'" href="#">');a=a+'Privacy</a></li><li class="'+(D("menu-item")+'"><a class="'+D("menu-content")+'" href="#">');a=C(a+"Terms</a></li></ul>");return b(c+a+"</div>")};var Ic=function(a,b,c){b=c||b;var d=Ec("string"===typeof a.origin,a.origin);a=C;c='<div class="'+D("dialog-container dialog-modal")+'"><div class="'+D("dialog inflated-dialog")+'"><div class="'+D("dialog-body")+'">'+Gc()+'<div class="'+D("dialog-content")+'">';var e='<h1 class="'+D("title")+'">';e=C(e+"You'll need to give Safari permission to continue</h1>");c+=e;e=Ec("string"===typeof d,d);d='<div class="'+D("consent-form")+'"><p class="'+D("consent-text")+'">';e="In order to continue with your Google Account, Safari will ask if it's ok for Google to use cookies on "+
(zc(e)+".");d=C(d+e+"</p></div>");c+=d;d='<div class="'+D("button-group")+'"><div class="'+D("button button-cancel")+'" id="confirm_no">';d=d+'Cancel</div><div class="'+(D("button button-confirm")+'" id="confirm_yes">');d=C(d+"Continue</div></div>");return a(c+d+"</div></div>"+Hc(b)+"</div></div>")};Ic.hd="oauth2.gsi.soy.itp.newgrant.dialog";var Jc=function(a,b,c){b=c||b;var d=Ec("string"===typeof a.origin,a.origin);a=C;c='<div class="'+D("dialog-container dialog-modal")+'"><div class="'+D("dialog")+'"><div class="'+D("dialog-body")+'">'+Gc()+'<div class="'+D("dialog-content")+'">';var e=Ec("string"===typeof d,d);d='<h1 class="'+D("title")+'">';e="Do you still want Safari to let Google use cookies on "+(zc(e)+"?");d=C(d+e+"</h1>");c+=d;d='<div class="'+D("button-group button-group-high")+'"><div class="'+D("button button-cancel")+'" id="confirm_no">';
d=d+'No thanks</div><div class="'+(D("button button-confirm")+'" id="confirm_yes">');d=C(d+"Yes</div></div>");return a(c+d+"</div></div>"+Hc(b)+"</div></div>")};Jc.hd="oauth2.gsi.soy.itp.regrant.dialog";var Kc=function(){this.za=new Set},A=function(a,b,c,d){b=dc(b,c,d);a.za.add(b);return b},Lc=function(a,b){kc(b);a.za["delete"](b)};var Mc=function(){this.za=new Set;this.zb=null};ia(Mc,Kc);var Nc=function(a,b){if(a.zb)throw Error("Component already rendered.");a.zb=b};var Oc=function(){this.za=new Set;this.Y=this.hb=this.Da=null;this.Qb=!1};ia(Oc,Kc);Oc.prototype.register=function(a,b){var c=this;if(this.Qb)throw Error("LanguageSelectorModel is already registered.");this.Qb=!0;this.hb=a;this.Y=b;this.Nb=A(this,this.hb,"click",function(){return Pc(c)})};
var Pc=function(a){a.Y.style.visibility="visible";a.Y.style.opacity=1;Lc(a,a.Nb);a.Jc=A(a,document,"mouseup",function(b){return Qc(a,b)})},Qc=function(a,b){a.Da=b.target.getAttribute("data-languagecode");if(null!=a.Da||b.target!=a.Y)Lc(a,a.Jc),a.Ic=A(a,a.Y,Sb,function(){return Rc(a)}),a.Y.style.opacity=0},Rc=function(a){Lc(a,a.Ic);a.Y.style.visibility="hidden";a.Nb=A(a,a.hb,"click",function(){return Pc(a)});if(null!=a.Da){var b=rc(a.Da);db(b)}};var Sc=function(a){var b=a.origin,c=a.Pa;a=a.languages;Mc.call(this);this.h=b;this.Bb=c;this.Ob=a};ia(Sc,Mc);Sc.prototype.Tc=function(a,b,c){Nc(this,a);vc(a,Ic,{origin:this.h},{Pa:this.Bb,languages:this.Ob});a=Bb("confirm_yes");A(this,a,"click",function(){(void 0==document.hasStorageAccess?Promise.resolve():document.requestStorageAccess()).then(function(){return b()},function(){return c()})});a=Bb("confirm_no");A(this,a,"click",function(){return c()});Tc(this)};
Sc.prototype.Uc=function(a,b,c){Nc(this,a);vc(a,Jc,{origin:this.h},{Pa:this.Bb,languages:this.Ob});a=Bb("confirm_yes");A(this,a,"click",function(){return b()});a=Bb("confirm_no");A(this,a,"click",function(){return c()});Tc(this)};var Tc=function(a){void 0==a.Mb&&(a.Mb=new Oc);var b=Bb("language_selector"),c=Bb("language_list");a.Mb.register(b,c)};var Uc,Vc,Wc=void 0,E=function(a){try{return u.JSON.parse.call(u.JSON,a)}catch(b){return!1}},F=function(a){return Object.prototype.toString.call(a)},Xc=F(0),Yc=F(new Date(0)),Zc=F(!0),$c=F(""),ad=F({}),bd=F([]),cd=function(a,b){if(b)for(var c=0,d=b.length;c<d;++c)if(a===b[c])throw new TypeError("Converting circular structure to JSON");d=typeof a;if("undefined"!==d){c=Array.prototype.slice.call(b||[],0);c[c.length]=a;b=[];var e=F(a);if(null!=a&&"function"===typeof a.toJSON&&(Object.prototype.hasOwnProperty.call(a,
"toJSON")||(e!==bd||a.constructor!==Array&&a.constructor!==Object)&&(e!==ad||a.constructor!==Array&&a.constructor!==Object)&&e!==$c&&e!==Xc&&e!==Zc&&e!==Yc))return cd(a.toJSON.call(a),c);if(null==a)b[b.length]="null";else if(e===Xc)a=Number(a),isNaN(a)||isNaN(a-a)?a="null":-0===a&&0>1/a&&(a="-0"),b[b.length]=String(a);else if(e===Zc)b[b.length]=String(!!Number(a));else{if(e===Yc)return cd(a.toISOString.call(a),c);if(e===bd&&F(a.length)===Xc){b[b.length]="[";var g=0;for(d=Number(a.length)>>0;g<d;++g)g&&
(b[b.length]=","),b[b.length]=cd(a[g],c)||"null";b[b.length]="]"}else if(e==$c&&F(a.length)===Xc){b[b.length]='"';g=0;for(c=Number(a.length)>>0;g<c;++g)d=String.prototype.charAt.call(a,g),e=String.prototype.charCodeAt.call(a,g),b[b.length]="\b"===d?"\\b":"\f"===d?"\\f":"\n"===d?"\\n":"\r"===d?"\\r":"\t"===d?"\\t":"\\"===d||'"'===d?"\\"+d:31>=e?"\\u"+(e+65536).toString(16).substr(1):32<=e&&65535>=e?d:"\ufffd";b[b.length]='"'}else if("object"===d){b[b.length]="{";d=0;for(g in a)Object.prototype.hasOwnProperty.call(a,
g)&&(e=cd(a[g],c),void 0!==e&&(d++&&(b[b.length]=","),b[b.length]=cd(g),b[b.length]=":",b[b.length]=e));b[b.length]="}"}else return}return b.join("")}},dd=/[\0-\x07\x0b\x0e-\x1f]/,ed=/^([^"]*"([^\\"]|\\.)*")*[^"]*"([^"\\]|\\.)*[\0-\x1f]/,fd=/^([^"]*"([^\\"]|\\.)*")*[^"]*"([^"\\]|\\.)*\\[^\\\/"bfnrtu]/,gd=/^([^"]*"([^\\"]|\\.)*")*[^"]*"([^"\\]|\\.)*\\u([0-9a-fA-F]{0,3}[^0-9a-fA-F])/,hd=/"([^\0-\x1f\\"]|\\[\\\/"bfnrt]|\\u[0-9a-fA-F]{4})*"/g,id=/-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][-+]?[0-9]+)?/g,jd=/[ \t\n\r]+/g,
kd=/[^"]:/,ld=/""/g,md=/true|false|null/g,nd=/00/,od=/[\{]([^0\}]|0[^:])/,pd=/(^|\[)[,:]|[,:](\]|\}|[,:]|$)/,qd=/[^\[,:][\[\{]/,rd=/^(\{|\}|\[|\]|,|:|0)+/,sd=/\u2028/g,td=/\u2029/g,ud=function(a){a=String(a);if(dd.test(a)||ed.test(a)||fd.test(a)||gd.test(a))return!1;var b=a.replace(hd,'""');b=b.replace(id,"0");b=b.replace(jd,"");if(kd.test(b))return!1;b=b.replace(ld,"0");b=b.replace(md,"0");if(nd.test(b)||od.test(b)||pd.test(b)||qd.test(b)||!b||(b=b.replace(rd,"")))return!1;a=a.replace(sd,"\\u2028").replace(td,
"\\u2029");b=void 0;try{b=Wc?[E(a)]:eval("(function (var_args) {\n return Array.prototype.slice.call(arguments, 0);\n})(\n"+a+"\n)")}catch(c){return!1}return b&&1===b.length?b[0]:!1},vd=function(){var a=((u.document||{}).scripts||[]).length;if((void 0===Uc||void 0===Wc||Vc!==a)&&-1!==Vc){Uc=Wc=!1;Vc=-1;try{try{Wc=!!u.JSON&&'{"a":[3,true,"1970-01-01T00:00:00.000Z"]}'===u.JSON.stringify.call(u.JSON,{a:[3,!0,new Date(0)],c:function(){}})&&!0===E("true")&&3===E('[{"a":3}]')[0].a}catch(b){}Uc=Wc&&!E("[00]")&&
!E('"\u0007"')&&!E('"\\0"')&&!E('"\\v"')}finally{Vc=a}}},wd=!Date.prototype.toISOString||"function"!==typeof Date.prototype.toISOString||"1970-01-01T00:00:00.000Z"!==(new Date(0)).toISOString(),xd=function(){var a=Date.prototype.getUTCFullYear.call(this);return[0>a?"-"+String(1E6-a).substr(1):9999>=a?String(1E4+a).substr(1):"+"+String(1E6+a).substr(1),"-",String(101+Date.prototype.getUTCMonth.call(this)).substr(1),"-",String(100+Date.prototype.getUTCDate.call(this)).substr(1),"T",String(100+Date.prototype.getUTCHours.call(this)).substr(1),
":",String(100+Date.prototype.getUTCMinutes.call(this)).substr(1),":",String(100+Date.prototype.getUTCSeconds.call(this)).substr(1),".",String(1E3+Date.prototype.getUTCMilliseconds.call(this)).substr(1),"Z"].join("")};Date.prototype.toISOString=wd?xd:Date.prototype.toISOString;var yd,zd=!1,G=function(a){try{zd&&window.console&&window.console.log&&window.console.log(a)}catch(b){}},H=function(a,b){if(!a)return-1;if(a.indexOf)return a.indexOf(b,void 0);for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J=function(a,b){function c(){}if(!a)throw"Child class cannot be empty.";if(!b)throw"Parent class cannot be empty.";c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},Ad=function(a){return"[object Function]"===Object.prototype.toString.call(a)},Bd=
function(a){var b=[],c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];if(null===d||void 0===d)d="";b.push(encodeURIComponent(c)+"="+encodeURIComponent(d))}return b.join("&")},Cd=function(a){var b=window.location.hash;a=new RegExp("[&#]"+a+"=([^&]*)");b=decodeURIComponent(b);b=a.exec(b);return null==b?"":b[1].replace(/\+/g," ")},Dd=function(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent)a.attachEvent("on"+b,c);else throw"Add event handler for "+b+" failed.";},Ed=function(a,
b){a=(a||"").split(" ");b=(b||"").split(" ");for(var c=0;c<b.length;c++)if(b[c]&&0>H(a,b[c]))return!1;return!0},Fd=function(){if("undefined"!=typeof yd)return yd;a:{try{if(window.localStorage){var a=window.localStorage;break a}}catch(b){}a=void 0}if(!a)return yd=!1;try{a.setItem("test","test"),a.removeItem("test"),yd=!0}catch(b){yd=!1}return yd},Gd=function(){var a=navigator.userAgent.toLowerCase();return-1!=a.indexOf("msie")&&8==parseInt(a.split("msie")[1],10)},Hd=function(){return Object.hasOwnProperty.call(window,
"ActiveXObject")&&!window.ActiveXObject},Id=function(){var a=navigator.userAgent.toLowerCase();return 0>a.indexOf("edge/")&&(-1<a.indexOf("chrome/")||-1<a.indexOf("crios/"))},Jd=function(){var a=navigator.userAgent,b;if(b=!!a&&-1!=a.indexOf("CriOS"))b=-1,(a=a.match(/CriOS\/(\d+)/))&&a[1]&&(b=parseInt(a[1],10)||-1),b=48>b;return b},Kd=function(){var a=navigator.userAgent.toLowerCase();return-1<a.indexOf("safari/")&&0>a.indexOf("chrome/")&&0>a.indexOf("crios/")&&0>a.indexOf("android")},K=window.JSON,
L=function(a){this.nb=a||[];this.H={}};L.prototype.addEventListener=function(a,b){if(!(0<=H(this.nb,a)))throw"Unrecognized event type: "+a;if(!Ad(b))throw"The listener for event '"+a+"' is not a function.";this.H[a]||(this.H[a]=[]);0>H(this.H[a],b)&&this.H[a].push(b)};L.prototype.removeEventListener=function(a,b){if(!(0<=H(this.nb,a)))throw"Unrecognized event type: "+a;Ad(b)&&this.H[a]&&this.H[a].length&&(b=H(this.H[a],b),0<=b&&this.H[a].splice(b,1))};
L.prototype.dispatchEvent=function(a){var b=a.type;if(!(b&&0<=H(this.nb,b)))throw"Failed to dispatch unrecognized event type: "+b;if(this.H[b]&&this.H[b].length)for(var c=0,d=this.H[b].length;c<d;c++)this.H[b][c](a)};K={parse:function(a){a="["+String(a)+"]";-1===Vc?a=!1:(vd(),a=(Uc?E:ud)(a));if(!1===a||1!==a.length)throw new SyntaxError("JSON parsing failed.");return a[0]},stringify:function(a){-1!==Vc?(vd(),a=Wc?u.JSON.stringify.call(u.JSON,a):cd(a)):a=void 0;return a}};var M={md:{}},N=N||{};N.U=function(a){a=encodeURIComponent(a);var b=N.Eb();if(b&&(a=b.match("(^|;) ?"+a+"=([^;]*)(;|$)"))&&2<a.length&&(a=a[2]))return decodeURIComponent(a)};N.xc=function(a){var b;(a=N.U(a))&&(b=String(Ld(a)));return b};N.Eb=function(){return document.cookie};N.ad=function(a){document.cookie=a};M=M||{};
M.Gc=function(a,b,c){if(!0===M.Va)a();else{var d=2,e=function(){d--;0==d&&(M.Va=!0,a())},g=function(f){b(f)};switch(Md()){case "sessionStorage":M.va=new Nd;M.va.I(e,g);if(c)try{M.va.clear()}catch(f){}break;case "inMemoryStorage":M.va=new Od;M.va.I(e,g);break;default:c=Error("Unsupported storage type: "+Md());b(c);return}switch(Pd()){case "localStorage":M.fa=new Qd;M.fa.I(e,g);break;case "indexedDb":M.fa=new Rd;M.fa.I(e,g);break;case "cookieStorage":M.fa=new Sd;M.fa.I(e,g);break;default:c=Error("Unsupported storage type: "+
Pd()),b(c)}}};M.Gb=function(){if(!M.Va)throw Error("Storages are not initialized yet!");return M.fa};M.Dc=function(){if(!M.Va)throw Error("Storages are not initialized yet!");return M.va};var Qd=function(){};m=Qd.prototype;m.I=function(a,b){Fd()?(this.la=window.localStorage,a()):b&&b(Error("localStorage is not available in the current environment."))};m.getItem=function(a,b){b(this.la.getItem(a))};m.setItem=function(a,b,c){void 0===b||null===b?this.la.removeItem(a):this.la.setItem(a,b);c&&c()};
m.removeItem=function(a,b){this.la.removeItem(a);b&&b()};m.clear=function(a){this.la.clear();a&&a()};var Rd=function(){};m=Rd.prototype;m.I=function(a,b){var c=this,d=window.indexedDB.open("oauth");d.onsuccess=function(e){c.ya=e.target.result;a()};d.onupgradeneeded=function(e){e.target.result.createObjectStore("oauth")};d.onerror=function(e){e=e.target.errorCode;b&&b(Error("IndexedDb initialization failed: "+e))}};
m.getItem=function(a,b){var c=this.ya.transaction("oauth","readwrite").objectStore("oauth").get(a);c.onsuccess=function(){b(c.result)}};m.setItem=function(a,b,c){var d=this.ya.transaction("oauth","readwrite").objectStore("oauth");if(void 0===b||null===b)d["delete"](a);else d.put(b,a);d.transaction.oncomplete=function(){c&&c()}};m.removeItem=function(a,b){var c=this.ya.transaction("oauth","readwrite").objectStore("oauth");c["delete"](a);c.transaction.oncomplete=function(){b&&b()}};
m.clear=function(a){var b=this.ya.transaction("oauth","readwrite").objectStore("oauth");b.clear();b.transaction.oncomplete=function(){a&&a()}};var Od=function(){};m=Od.prototype;m.I=function(a){this.Ea={};a()};m.getItem=function(a,b){b(this.Ea[a]||null)};m.setItem=function(a,b,c){this.Ea[a]=b;c&&c()};m.removeItem=function(a,b){delete this.Ea[a];b&&b()};m.clear=function(a){this.Ea={};a&&a()};var Nd=function(){};m=Nd.prototype;m.I=function(a,b){Fd()?(this.ta=window.sessionStorage,a()):b&&b(Error("sessionStorage is not available in the current environment."))};
m.getItem=function(a,b){b(this.ta.getItem(a))};m.setItem=function(a,b,c){void 0===b||null===b?this.ta.removeItem(a):this.ta.setItem(a,b);c&&c()};m.removeItem=function(a,b){this.ta.removeItem(a);b&&b()};m.clear=function(a){this.ta.clear();a&&a()};var Sd=function(){this.Mc=O.Xb};m=Sd.prototype;m.I=function(a,b){navigator.cookieEnabled?a():b&&b(Error("Cookies are not enabled in current environment."))};m.getItem=function(a,b){for(var c=null,d=Td(a),e=0;e<d.length;e++)if(d[e].key==a){c=d[e].value;break}b(c)};
m.setItem=function(a,b,c){var d=O.Ra(a.split(O.m)[0]);if(d){var e=Ud(d);b={key:a,value:b};for(var g=0;g<e.length;g++)if(e[g].key==a){e.splice(g,1);break}e.push(b);Vd(this,d,e)}c&&c()};m.removeItem=function(a,b){for(var c=Td(a),d=0;d<c.length;d++)if(c[d].key==a){c.splice(d,1);break}(a=O.Ra(a.split(O.m)[0]))&&Vd(this,a,c);b&&b()};m.clear=function(a){M.lc();a&&a()};
var Td=function(a){return(a=O.Ra(a.split(O.m)[0]))?Ud(a):[]},Ud=function(a){a=N.U(a);return M.nc(a||null)},Vd=function(a,b,c){var d=M.qc(c);d.length>a.Mc?(c.splice(0,1),0<c.length?Vd(a,b,c):G("Failed to write Cookie based cache due to the big size.")):M.Sb(b,d)};M.mc=function(a){try{return atob(a)}catch(b){return a}};M.pc=function(a){try{return btoa(a)}catch(b){return a}};
M.nc=function(a){if(!a)return[];a=M.mc(a);try{return K.parse(a).items||[]}catch(b){return G("Error while parsing items from cookie:"+b.message),[]}};M.qc=function(a){return M.pc(K.stringify({items:a}))};M.Sb=function(a,b){var c=window.location.hostname,d=window.location.pathname;a=encodeURIComponent(a)+"="+encodeURIComponent(b)+"; domain="+c+";";-1!=navigator.userAgent.toLowerCase().indexOf("msie")||Hd()||(a+=" path="+d+";");"https:"==window.location.protocol&&(a+=" secure;");N.ad(a)};
M.lc=function(){var a=O.Ia,b=N.Eb();if(b){b=b.replace(/((?:^|\s*;)[^=]+)(?=;|$)|^\s*|\s*(?:=[^;]*)?(?:\1|$)/g,"").split(/\s*(?:=[^;]*)?;\s*/);for(var c=0;c<b.length;c++){var d=decodeURIComponent(b[c]);0==d.indexOf(a)&&M.Sb(d,"")}}};var Wd=function(a){this.Lb=a;L.call(this,["storageValueChanged"])};J(Wd,L);var Xd=function(a,b){M.Gb().getItem(a.Lb,b)};Wd.prototype.addListener=function(a){this.addEventListener("storageValueChanged",a)};
Wd.prototype.start=function(){var a=this;Xd(this,function(b){a.Qc=b;a.Pb=0;a.Wa=window.setInterval(Yd(a),200)})};Wd.prototype.stop=function(){void 0!==this.Wa&&(clearInterval(this.Wa),this.Wa=void 0)};
var Yd=function(a){return function(){a.Pb++;Xd(a,function(b){b!=a.Qc?(a.dispatchEvent({type:"storageValueChanged",key:a.Lb,newValue:b}),a.stop()):1500<=a.Pb&&a.stop()})}},Ld=function(a){var b=0,c;if(a){var d=0;for(c=a.length;d<c;d++){var e=a.charCodeAt(d);b=(b<<5)-b+e;b|=0}}return b},P=function(a){return!!a&&0<=a.indexOf(O.m)},Zd=function(a,b){if(!a&&!b)return!0;if(!a||!b)return!1;a=a.extraQueryParams;b=b.extraQueryParams;if(!a&&!b)return!0;if(!a||!b||Object.keys&&Object.keys(a).length!=Object.keys(b).length)return!1;
for(var c in a)if(a[c]!==b[c])return!1;if(!Object.keys)for(c in b)if(a[c]!==b[c])return!1;return!0},O=O||{};O.La="SID";O.tb="SSID";O.Wb=100;O.vb="/oauth2/sessionstate/action/updateState";O.ob="/oauth2/sessionstate/action/checkOrigin";O.sb="/oauth2/permission/action/refresh";O.rb="/oauth2/permission/action/code";O.Ka="/oauth2/permission/action/listSessions";O.bc="/o/oauth2/revoke";O.wa="response_type login_hint client_id origin scope ss_domain authuser hd enable_serial_consent include_granted_scopes nonce".split(" ");
O.Zb="login_hint client_id origin scope ss_domain authuser hd enable_serial_consent include_granted_scopes".split(" ");O.$b="client_id origin scope ss_domain authuser hd enable_serial_consent".split(" ");O.m="::";O.Ja="_ss_";O.qb="_tr_";O.ia="oauth2_ss";O.pb="oauth2_cs";O.ub="oauth2_tr";O.Yb="oauth2_is";O.ha="oauth2_ar";O.Ia="oauth2c_";O.Xb=1500;O.ld=function(){var a={Ja:1,qb:2,ia:3,pb:4,ub:5,ha:6},b;for(b in a)if(a=O[b],!a||0<=a.indexOf(O.m))throw"Invalid value for 'oauth2.spi."+b+"'.";};O.ld();
O.ac=512;O.fc=function(a){var b;(b=void 0===a.hint)||(b=a.hint,b=(""===b?!0:b?"string"==typeof b||"object"==typeof b&&b.constructor===String:!1)&&a.hint.length<=O.ac);return!a.id&&b};O.Bc=function(){return"https:"==window.location.protocol?O.tb:O.La};O.Ra=function(a){switch(a){case O.ha:return O.Ia+O.ha;case O.ia:return O.Ia+O.ia;default:return null}};
var Pd=function(){return(Kd()||Id())&&!Fd()||Hd()&&!window.indexedDB?"cookieStorage":Hd()?"indexedDb":"localStorage"},Md=function(){return!Kd()&&!Id()||Fd()?"sessionStorage":"inMemoryStorage"};N=N||{};N.Ha="cookieValueChanged";var $d=function(a,b){this.Ab=a;this.Hc=b;L.call(this,[N.Ha])};J($d,L);$d.prototype.U=function(){return N.U(this.Ab)};var Q=function(a){return N.xc(a.Ab)};$d.prototype.addListener=function(a){this.addEventListener(N.Ha,a)};
var ce=function(a){ae(a);a.Aa=a.U();a.lb=window.setInterval(be(a),a.Hc);G("IDP Session Cookie monitor is started.")},ae=function(a){void 0!==a.lb&&(window.clearInterval(a.lb),a.lb=void 0,G("IDP Session Cookie monitor is stoped."))},be=function(a){return function(){var b=a.U();if(a.Aa!=b){var c={type:N.Ha,newHash:b&&Ld(b),oldHash:a.Aa&&Ld(a.Aa)};a.Aa=b;a.dispatchEvent(c)}}},de=function(a){this.h=a;this.Ub=void 0},ee=function(a,b,c){var d=O.bc,e=new XMLHttpRequest;e.onreadystatechange=function(){if(4==
e.readyState&&200==e.status){var h;e.responseText&&(h=K.parse(e.responseText));c(h)}else 4==e.readyState&&0==e.status?c({error:"network_error"}):4==e.readyState&&c({error:"server_error",error_subtype:e.responseText})};e.open("POST",d,!0);e.setRequestHeader("Content-type","application/x-www-form-urlencoded");var g="xsrfToken=";a.Ub&&(g+=a.Ub);if(b)for(var f in b)f&&b[f]&&(g+="&"+f+"="+encodeURIComponent(b[f]));G("Call "+d+" with postData: "+g);e.send(g)},fe=function(a,b,c,d){var e=new XMLHttpRequest;
e.onreadystatechange=function(){if(4==e.readyState&&200==e.status){var f;if(e.responseText&&(f=K.parse(e.responseText))){var h=f;if(h.error){h.thrown_by="server";try{h.error=h.error.toLowerCase()}catch(k){}}}d(f)}else 4==e.readyState&&0==e.status?d({error:"network_error"}):4==e.readyState&&d({error:"server_error",error_subtype:e.responseText})};if(b=Bd(b))a+=0>a.indexOf("?")?"?":"&",a+=b;e.open("GET",a,!0);e.setRequestHeader("X-Requested-With","XmlHttpRequest");if(c)for(var g in c)if(c.hasOwnProperty(g)){b=
c[g];if(null===b||void 0===b)b="";e.setRequestHeader(g,b)}G("Call "+a+" with Get method.");e.send()},ge=function(a,b,c){fe(O.ob,{origin:a.h,client_id:b},null,c)},he=function(a,b,c){b&&b.length?fe(O.vb,{login_hint:b.join(" "),origin:a.h},null,c):c({activeHints:{}})},je=function(a,b,c){b.origin=a.h;0>O.wa.indexOf("enable_serial_consent")&&O.wa.push("enable_serial_consent");b=ie(b,O.wa);fe(O.sb,b,null,c)},ke=function(a,b,c){b.origin=a.h;b=ie(b,O.Zb);fe(O.rb,b,null,c)},le=function(a,b,c){b.origin=a.h;
b=ie(b,O.$b);fe(O.Ka,b,null,c)},me=function(a,b,c){ee(a,{token:b},c)},ie=function(a,b){for(var c={},d=0;d<b.length;d++){var e=b[d];void 0!==a[e]&&null!==a[e]&&(c[e]=a[e])}return c};M=M||{};var ne=function(){};ne.prototype.F=function(){return!1};var oe={};M.Sc=function(){var a=new pe;if(!a)throw"policy cannot be empty.";if(M.Jb("DEFAULT"))throw"Duplicate policyName [DEFAULT].";oe.DEFAULT=a};M.Jb=function(a){for(var b in oe)if(a==b)return!0;return!1};M.Fb=function(a){return a&&M.Jb(a)?a:"DEFAULT"};
M.yc=function(a){return oe[M.Fb(a)]};M.F=function(a,b,c,d){return M.yc(d).F(a,b,c)};M.nd=function(a,b,c,d){if(!M.F(a,b,c,d))throw"permission_error";};var qe=function(){};J(qe,ne);qe.prototype.F=function(a,b,c){a=c?this.Ta(a):this.Ua(a);return 0<=H(a,b)};
qe.prototype.Ua=function(a){var b=[];if(a&&(b.push(a),"http://"==a.substring(0,7)||"https://"==a.substring(0,8))){var c=document.createElement("a");c.href=a;a!=c.protocol+"//"+c.hostname&&b.push(c.protocol+"//"+c.hostname);"https:"==c.protocol&&b.push("http://"+c.hostname)}return b};
qe.prototype.Ta=function(a){var b=[];if(a){b.push(a);var c=document.createElement("a");c.href=a;if("http:"==c.protocol||"https:"==c.protocol)for(a=c.hostname.split(".");1<a.length;)b.push(c.protocol+"//"+a.join(".")),"https:"==c.protocol&&b.push("http://"+a.join(".")),a.shift()}return b};var pe=function(){};J(pe,ne);pe.prototype.F=function(a,b,c){a=c?this.Ta(a):this.Ua(a);return 0<=H(a,b)};
pe.prototype.Ua=function(a){var b=[];if(a&&(b.push(a),"https://"==a.substring(0,8))){var c=document.createElement("a");c.href=a;""!=c.port&&0!=c.port&&443!=c.port||b.push("http://"+c.hostname)}return b};
pe.prototype.Ta=function(a){var b=[];if(a){var c=document.createElement("a");c.href=a;if("https:"==c.protocol&&(""==c.port||0==c.port||443==c.port)||"http:"==c.protocol&&(""==c.port||0==c.port||80==c.port))for(a=c.hostname.split(".");1<a.length;)b.push(c.protocol+"//"+a.join(".")),"https:"==c.protocol&&b.push("http://"+a.join(".")),a.shift();else b.push(a)}return b};M.Sc();var R=function(){};R.prototype.Xa=function(){return!0};var S=function(a){return a.Xa()?M.Dc():M.Gb()};
R.prototype.l=function(){throw Error("unimplemented abstract method");};R.prototype.da=function(){throw Error("unimplemented abstract method");};R.prototype.B=function(){throw Error("unimplemented abstract method");};R.prototype.C=function(){throw Error("unimplemented abstract method");};var T=function(){};J(T,R);
T.prototype.B=function(a,b,c){var d=this,e=this.l(a);S(this).getItem(e,function(g){if(g)try{var f=K.parse(g);if(f.cookieHash!=b){S(d).removeItem(e,function(){c(void 0)});return}var h=f&&f.cachedValue}catch(k){}c(h)})};T.prototype.C=function(a,b,c,d){a=this.l(a);void 0===b||null===b?S(this).removeItem(a,d):(b=K.stringify({cookieHash:c,cachedValue:b}),S(this).setItem(a,b,d))};var re=function(){};J(re,R);
re.prototype.B=function(a,b,c){S(this).getItem(this.l(a),function(d){if(d)try{var e=K.parse(d);var g=e&&e.cachedValue}catch(f){}c(g)})};re.prototype.C=function(a,b,c,d){a=this.l(a);void 0===b||null===b?S(this).removeItem(a,d):(b=K.stringify({cachedValue:b}),S(this).setItem(a,b,d))};var se=function(){};J(se,re);se.prototype.Xa=function(){return!1};se.prototype.l=function(a){return[O.ha,a.origin,a.clientId,a.id].join(O.m)};
se.prototype.da=function(a){var b={};a&&(a=a.split(O.m),4==a.length&&(b.origin=a[1],b.clientId=a[2],b.id=a[3]));return b};var te=function(){};J(te,T);te.prototype.l=function(a){return[O.pb,a.origin,a.clientId].join(O.m)};te.prototype.da=function(a){a=a.split(O.m);var b={};3==a.length&&(b.origin=a[1],b.clientId=a[2]);return b};var ue=function(){};J(ue,T);ue.prototype.l=function(a){return[O.Yb,a.origin,a.clientId].join(O.m)};
ue.prototype.B=function(a,b,c){var d=this;T.prototype.B.call(this,a,b,function(e){e&&e.expires_at?6E4>e.expires_at-(new Date).getTime()?S(d).removeItem(d.l(a),c):Ed(e.scope,a.scope)&&Ed(a.scope,e.scope)?(e.expires_in=Math.floor((e.expires_at-(new Date).getTime())/1E3),c&&c(e)):S(d).removeItem(d.l(a),c):c&&c(void 0)})};ue.prototype.C=function(a,b,c,d){var e;b&&b.expires_at&&18E4<b.expires_at-(new Date).getTime()&&(e=b);T.prototype.C.call(this,a,e,c,d)};var ve=function(){};J(ve,re);
ve.prototype.Xa=function(){return!1};ve.prototype.l=function(a){return[O.ia,a.domain,a.crossSubDomains?"1":"0",M.Fb(a.policy),a.id||O.Ja].join(O.m)};ve.prototype.da=function(a){a=a.split(O.m);var b={};5==a.length&&(b.domain=a[1],b.crossSubDomains="1"==a[2],b.policy=a[3],b.id=a[4]);"DEFAULT"==b.policy&&delete b.policy;b.id==O.Ja&&delete b.id;return b};var we=function(a){this.Pc=a||O.ub};J(we,T);we.prototype.l=function(a){return[this.Pc,a.origin,a.clientId,a.id||O.qb].join(O.m)};
we.prototype.B=function(a,b,c){var d=this;T.prototype.B.call(this,a,b,function(e){e&&e.ga&&e.ga.expires_at?a.loginHint!=e.ga.login_hint?S(d).removeItem(d.l(a),c):6E4>e.ga.expires_at-(new Date).getTime()?S(d).removeItem(d.l(a),c):Ed(e.ga.scope,a.scope)?Ed(e.responseType,a.responseType)?(e=e.ga,e.expires_in=Math.floor((e.expires_at-(new Date).getTime())/1E3),c&&c(e)):S(d).removeItem(d.l(a),c):S(d).removeItem(d.l(a),c):c&&c(void 0)})};
we.prototype.C=function(a,b,c,d){var e;b&&b.expires_at&&18E4<b.expires_at-(new Date).getTime()&&(e={ga:b,responseType:a.responseType});T.prototype.C.call(this,a,e,c,d)};var xe=function(a,b){this.h=a;this.gb=b;this.Qa=!1;this.ra={};this.qa={};this.pa={}},ye=function(a,b){if(!b)throw"message object cannot be null.";b.rpcToken=a.gb;b=K.stringify(b);G("IDP IFrame sends message: "+b);window.parent.postMessage(b,a.h)},U=function(a,b,c){b&&ye(a,{id:b,result:c})};
xe.prototype.Rc=function(a){if(a.source==window.parent&&a.origin==this.h){G("IDP Session State IFrame receive message:"+a.data);try{var b=K.parse(a.data)}catch(d){return}if((b.rpcToken||this.gb)&&b.rpcToken!=this.gb)G("RPC token mismatch.");else if(b&&b.method&&("showDialog"==b.method||this.ra[b.method]))if("showDialog"==b.method)if(this.Qa)ye(this,{id:b.id,error:"dialog_already_displayed"});else if(a=b.params,b.id&&a&&a.dialogType&&this.pa[a.dialogType]){var c=this.pa[a.dialogType];c.s&&!c.s(a)?
(G("Bad request."),ye(this,{id:b.id,error:"bad_request"})):c.i(b)}else G("Bad dialog request.");else a=this.ra[b.method],a.O&&!b.id?G("Bad request."):a.s&&!a.s(b)?(G("Bad request."),ye(this,{id:b.id,error:"bad_request"})):a.i(b);else G("Bad request.")}};
var V=function(a,b){if(b&&b.type&&a.qa[b.type]){var c=a.qa[b.type].filter;c&&!c(b)||ye(a,{method:"fireIdpEvent",params:b})}else G("Invalid event type.")},ze=function(a){V(a,{type:"displayIFrame",Fc:!1,options:{fullScreen:!0}});a.Qa=!0},Ae=function(a){V(a,{type:"displayIFrame",Fc:!0});a.Qa=!1},Be=function(a,b){a.ra={};a.qa={};a.pa={};if(b){if(b.A)for(var c=0;c<b.A.length;c++){var d=b.A[c];if(!d.method||!d.i)throw"Error in RPC policy: method or handler is empty.";if(a.ra[d.method])throw"Error in RPC policy: duplicate entry for RPC '"+
d.method+"'.";var e=d.method;a.ra[e]={i:d.i,O:d.O,s:d.s,method:e}}if(b.M)for(c=0;c<b.M.length;c++){d=b.M[c];if(!d.type)throw"Error in Event policy: type is empty.";if(a.qa[d.type])throw"Error in Event policy: duplicate entry for type '"+d.type+"'.";e=d.type;a.qa[e]={filter:d.filter,type:e}}if(b.ba)for(c=0;c<b.ba.length;c++){d=b.ba[c];if(!d.ca)throw"Error in Dialog policy: dialogType is empty.";if(a.pa[d.ca])throw"Error in Dialog policy: duplicate entry for dialogType '"+d.ca+"'.";e=d.ca;a.pa[e]={ca:e,
i:d.i,s:d.s}}}},Ce=function(a,b,c,d){V(a,{type:"sessionStateChanged",clientId:b,user:c,sessionState:d})},De=function(a){var b=new ve,c=O.ia+O.m;return function(d){if(d.key&&0===d.key.indexOf(c)){var e=b.da(d.key);if(M.F(a.h,e.domain,e.crossSubDomains,e.policy)){var g;if(d.newValue)try{var f=K.parse(d.newValue);f&&(g=f.cachedValue)}catch(h){return}V(a,{type:"sessionSelectorChanged",newValue:g,crossSubDomains:e.crossSubDomains,domain:e.domain,policy:e.policy,id:e.id})}}}},Ee=function(a){var b=new se,
c=[O.ha,a.h].join(O.m)+O.m;return function(d){if(!d.key&&Gd()){var e=null,g=[];for(d=0;d<window.localStorage.length;d++){var f=window.localStorage.key(d);if(0===f.indexOf(c))if(e)g.push(f);else{var h=window.localStorage.getItem(f);g.push(f);if(h){try{var k=K.parse(h)}catch(l){continue}k&&k.cachedValue&&(e=b.da(f),e={type:"authResult",clientId:e.clientId,id:e.id,authResult:k.cachedValue})}}}for(d=0;d<g.length;d++)window.localStorage.removeItem(g[d]);(k=e)&&V(a,k)}else if(d.key&&0===d.key.indexOf(c)&&
d.newValue){try{g=K.parse(d.newValue)}catch(l){return}g&&g.cachedValue&&(k=b.da(d.key),k={type:"authResult",clientId:k.clientId,id:k.id,authResult:g.cachedValue},V(a,k))}}},Fe=function(a,b){this.h=a;this.v=b;this.yb=new te;this.Rb=new ve;this.mb=new we;this.Hb=new ue},Ge=function(a,b,c,d,e){a.yb.C({origin:a.h,clientId:b},{user:c.L,session:c.L?c.Z:void 0},d,e)},He=function(a,b,c){a.yb.B({origin:a.h,clientId:b},Q(a.v),c)},Ie=function(a,b,c,d,e,g,f){a.mb.B({loginHint:b,origin:a.h,clientId:c,responseType:d,
scope:e,id:g},Q(a.v),f)},Je=function(a,b,c,d,e,g,f){a.mb.C({origin:a.h,clientId:c,responseType:d,id:g},e,b,f)},Ke=function(a,b,c){var d=a.mb;a={origin:a.h,clientId:b};S(d).removeItem(d.l(a),c)},Le=function(a,b,c,d,e,g){if(!a.F(b,c,e))throw"Permission denied for '"+a.h+"' to read session selector for domain '"+b+"'.";a.Rb.B({domain:b,crossSubDomains:c,policy:e,id:d},void 0,function(f){g&&g(f)})},Me=function(a,b,c,d,e,g,f){if(!a.F(b,c,g))throw"Permission denied for '"+a.h+"' to write session selector for domain '"+
b+"'.";a.Rb.C({domain:b,crossSubDomains:c,policy:g,id:e},d,void 0,f)};Fe.prototype.F=function(a,b,c){return M.F(this.h,a,b,c)};
var Ne=function(a,b,c,d){a.Hb.B({origin:a.h,clientId:b,scope:c},Q(a.v),d)},Oe=function(a,b,c,d,e){a.Hb.C({origin:a.h,clientId:c},d,b,e)},Pe=function(a,b,c){this.$=a;this.g=b;this.j=c},Qe=function(a,b,c){a.L?c&&void 0!==c[a.L]?(c=c[a.L],Zd(a.Z,c)||(a.Z=c,Ge(a.j,a.$,a,b,function(){Ce(a.g,a.$,a.L,a.Z)}))):a.Z&&(a.Z=void 0,Ge(a.j,a.$,a,b,function(){Ce(a.g,a.$,a.L,void 0)})):b&&Ce(a.g,a.$,a.L,void 0)},Se=function(a,b,c,d){this.v=a;this.g=b;this.K=c;this.j=d;this.oa=void 0;this.D={};this.ib=[];var e=this;
this.v.addListener(function(g){Re(e,g)})},Te=function(a){var b=[],c;for(c in a.D){var d=a.D[c].L;d&&b.push(d)}return b},Re=function(a,b){if(b.newHash)he(a.K,Te(a),function(d){for(var e in a.D)Qe(a.D[e],b.newHash,d&&d.activeHints)});else for(var c in a.D)Qe(a.D[c],b.newHash,void 0)},Ue=function(a,b,c,d,e){var g=a.D[b];g||(g=new Pe(b,a.g,a.j),a.D[b]=g);a=g;b=c.login_hint;c=c.session_state;a.L!=b?(a.L=b,a.Z=b?c:void 0,Ge(a.j,a.$,a,d,e)):e&&e()},Ve=function(a,b,c){var d=a.D[b];d?c(!0):He(a.j,b,function(e){e?
(d=new Pe(b,a.g,a.j),a.D[b]=d,d.L=e.user,d.Z=e.session,c(!0)):ge(a.K,b,function(g){g&&g.valid?(g=new Pe(b,a.g,a.j),a.D[b]=g,Ge(a.j,b,g,Q(a.v),function(){c(!0)})):c(!1)})})},We=function(a,b){Hd()||Jd()?a.ib.push(b):Dd(Gd()?document:window,"storage",b)},X=function(a,b,c){this.h=a;this.kc=c;this.g=new xe(a,b);this.v=new $d(O.La,O.Wb);this.K=new de(a);this.j=new Fe(a,this.v);this.P=new Se(this.v,this.g,this.K,this.j)};m=X.prototype;
m.start=function(){var a=this,b=function(){a.g.Rc.apply(a.g,arguments)},c=function(){V(a.g,{type:"idpReady"});G("Initialize IDP IFrame successfully.")},d=function(e){var g=window;if(g.removeEventListener)g.removeEventListener("message",b,!1);else if(g.detachEvent)g.detachEvent("onmessage",b);else throw"Remove event handler for message failed.";ae(a.v);V(a.g,{type:"idpError",error:e.message})};try{Be(this.g,this.createPolicy()),Dd(window,"message",b),We(this.P,De(this.g)),We(this.P,Ee(this.g)),ce(this.v),
M.Gc(c,d,this.kc)}catch(e){d(e)}};m.Nc=function(a){var b=this;Ve(this.P,(a.params||{}).clientId,function(c){U(b.g,a.id,c)})};
m.wc=function(a){var b=a.params||{},c=this,d=function(r){U(c.g,a.id,r)},e=b.clientId,g=b.loginHint,f=b.request,h=b.sessionSelector;f.client_id=e;f.login_hint=g;f.ss_domain=h.domain;var k=Q(this.v);if(k){var l=!!f.enable_serial_consent,n=function(r){r&&!r.error&&r.login_hint?(r.first_issued_at=(new Date).getTime(),r.expires_at=r.first_issued_at+1E3*r.expires_in,r.session_state||(r.session_state={}),l||r.scope||(r.scope=f.scope),b.skipCache?Ue(c.P,e,r,k,function(){d(r)}):Je(c.j,k,e,f.response_type,
r,b.id,function(){Ue(c.P,e,r,k,function(){d(r)})})):(r=r||{},d(r))};b.forceRefresh?je(this.K,f,n):Ie(this.j,g,e,f.response_type,f.scope,b.id,function(r){r&&18E4<r.expires_at-(new Date).getTime()?Ue(c.P,e,r,k,function(){d(r)}):je(c.K,f,n)})}else U(c.g,a.id,{error:"user_logged_out"})};m.zc=function(a){var b=this,c=function(f){U(b.g,a.id,f)};if(Q(this.v)){var d=a.params||{},e=d.request,g=d.sessionSelector;e.client_id=d.clientId;e.login_hint=d.loginHint;e.ss_domain=g.domain;ke(this.K,e,c)}else c({error:"user_logged_out"})};
m.Xc=function(a){var b=a.params||{},c=b.clientId,d=this;me(this.K,b.token,function(e){Ke(d.j,c,function(){U(d.g,a.id,e)})})};m.jd=function(a){if(Hd()||Jd()){var b=a.params||{},c=(new se).l({clientId:b.clientId,id:b.id,origin:b.origin});b=this.P;if(Hd()||Jd()){b.oa&&b.oa.stop();b.oa=new Wd(c);for(c=0;c<b.ib.length;c++)b.oa.addListener(b.ib[c]);b.oa.start()}}U(this.g,a.id,!0)};m.vc=function(a){var b=this,c=a.params||{};Le(this.j,c.domain,c.crossSubDomains,c.id,c.policy,function(d){U(b.g,a.id,d)})};
m.bd=function(a){var b=a.params||{},c=b.hint,d=!!b.disabled,e=b.domain,g=b.crossSubDomains,f=b.id,h=b.policy,k=this;if(c||d)var l={hint:c,disabled:d};Me(this.j,e,g,l,f,h,function(){V(k.g,{type:"sessionSelectorChanged",newValue:l,domain:e,crossSubDomains:g,id:f,policy:h});U(k.g,a.id,!0)})};
m.Kc=function(a){var b=a.params||{},c=this,d=function(l){U(c.g,a.id,l)},e=b.clientId,g=b.request,f=b.sessionSelector;g.client_id=e;g.response_type="id_token";g.ss_domain=f.domain;var h=Q(this.v);if(h){var k=function(l){l&&!l.error?(l.first_issued_at=(new Date).getTime(),l.expires_at=l.first_issued_at+1E3*l.expires_in,l.scope=g.scope,Oe(c.j,h,e,l,function(){d(l)})):(l=l||{error:"No response returned from Server."},d(l))};b.forceRefresh?le(this.K,g,k):Ne(this.j,e,g.scope,function(l){l?d(l):le(c.K,g,
k)})}else d({scope:g.scope,sessions:[]})};m.jc=function(a){if(document.hasStorageAccess&&Ad(document.hasStorageAccess)){var b=this;document.hasStorageAccess().then(function(c){U(b.g,a.id,{hasAccess:c})},function(c){G("CheckStorageAccess failed: "+c);U(b.g,a.id,{hasAccess:!1})})}else U(this.g,a.id,{hasAccess:!0})};m.Oc=function(a){a=a&&a.params||{};return a.clientId&&!P(a.clientId)};
m.Ec=function(a){var b=a&&a.params||{};a=b.loginHint;var c=!P(b.id),d=b.clientId&&!P(b.clientId),e=!!b.request,g=e&&b.request.scope;(b=(e=e&&b.request.response_type)&&0<=b.request.response_type.indexOf("code"))&&G("Bad request: 'code' response_type is not supported.");return a&&c&&d&&g&&e&&!b};m.Ac=function(a){a=a&&a.params||{};var b=!P(a.id),c=a.clientId&&!P(a.clientId),d=!!a.request&&a.request.scope;return a.loginHint&&b&&c&&d};
m.Cc=function(a){a=a&&a.params||{};var b=a.domain&&!P(a.domain),c=!P(a.policy);return!P(a.id)&&b&&c&&this.j.F(a.domain,!!a.crossSubDomains,a.policy)};m.cd=function(a){a=a&&a.params||{};var b=a.domain&&!P(a.domain),c=!P(a.policy);return!P(a.id)&&b&&c&&this.j.F(a.domain,!!a.crossSubDomains,a.policy)&&O.fc(a)};m.Lc=function(a){a=a&&a.params||{};var b=a.clientId&&!P(a.clientId),c=!!a.request&&a.request.scope;return!P(a.id)&&b&&c};
m.Yc=function(a){a=a&&a.params||{};var b=!!a.token,c=a.clientId&&!P(a.clientId);return!P(a.id)&&b&&c};m.kd=function(a){a=a&&a.params||{};var b=a.origin&&!P(a.origin),c=a.id&&!P(a.id);return a.clientId&&!P(a.clientId)&&b&&c};m.$c=function(a){var b;if(b=a.clientId)a=a.clientId,b=!(!a||!this.P.D[a]);return b};m.hc=function(a){var b;if(b=a.clientId)b=a.clientId,b=!(!b||!this.P.D[b]);return b&&a.id&&a.authResult};m.oc=function(a){return!!a.hide||!!a.options};
m.Zc=function(a){return a.domain&&this.j.F(a.domain,a.crossSubDomains,a.policy)};var Y=function(a,b){return function(){return b.apply(a,arguments)}};X.prototype.createPolicy=function(){var a={A:[],M:[],ba:[]};Xe(this,a);return a};
var Xe=function(a,b){b.A.push({method:"monitorClient",i:Y(a,a.Nc),O:!1,s:Y(a,a.Oc)});b.A.push({method:"getTokenResponse",i:Y(a,a.wc),O:!0,s:Y(a,a.Ec)});b.A.push({method:"getOnlineCode",i:Y(a,a.zc),O:!0,s:Y(a,a.Ac)});b.A.push({method:"getSessionSelector",i:Y(a,a.vc),O:!0,s:Y(a,a.Cc)});b.A.push({method:"setSessionSelector",i:Y(a,a.bd),O:!1,s:Y(a,a.cd)});b.A.push({method:"listIdpSessions",i:Y(a,a.Kc),O:!0,s:Y(a,a.Lc)});b.A.push({method:"revoke",i:Y(a,a.Xc),s:Y(a,a.Yc)});b.A.push({method:"startPolling",
i:Y(a,a.jd),s:Y(a,a.kd)});b.M.push({type:"idpReady"});b.M.push({type:"idpError"});b.M.push({type:"sessionStateChanged",filter:Y(a,a.$c)});b.M.push({type:"sessionSelectorChanged",filter:Y(a,a.Zc)});b.M.push({type:"authResult",filter:Y(a,a.hc)});b.M.push({type:"displayIFrame",filter:Y(a,a.oc)});b.A.push({method:"checkStorageAccess",i:Y(a,a.jc),O:!0})};var Ye="client_id origin ss_domain scope privileged authuser".split(" ");O.wa="response_type login_hint client_id origin scope ss_domain authuser hd include_granted_scopes nonce spec_compliant".split(" ");var $e=function(a,b,c){b.origin=a.h;b.privileged=!0;b=ie(b,Ye);fe(O.Ka,b,Ze(a.h),function(d){c(d)})};
function Ze(a){var b={},c=N.U(O.Bc());if(c){if(!c)throw Error("Session cookie value cannot be empty.");c=new xb(new yb,za(c));a=za(a);c.reset();c.update(a);a=c.digest();var d;c=v(a);w("array"==c||"object"==c&&"number"==typeof a.length,"encodeByteArray takes an array as a parameter");void 0===d&&(d=0);if(!vb){vb={};c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split("");for(var e=["+/=","+/","-_=","-_.","-_"],g=0;5>g;g++){var f=c.concat(e[g].split(""));ub[g]=f;for(var h=0;h<f.length;h++){var k=
f[h],l=vb[k];void 0===l?vb[k]=h:w(l===h)}}}d=ub[d];c=[];for(e=0;e<a.length;e+=3){l=a[e];var n=(g=e+1<a.length)?a[e+1]:0;k=(f=e+2<a.length)?a[e+2]:0;h=l>>2;l=(l&3)<<4|n>>4;n=(n&15)<<2|k>>6;k&=63;f||(k=64,g||(n=64));c.push(d[h],d[l],d[n]||"",d[k]||"")}b["X-Csrf-Token"]=c.join("")}return b};var af=function(){};J(af,T);af.prototype.l=function(a){a=void 0===a?{}:a;return["gsi_gs",void 0===a.origin?null:a.origin,void 0===a.clientId?null:a.clientId].join(O.m)};af.prototype.B=function(a,b,c){var d=this;c=void 0===c?function(){}:c;T.prototype.B.call(this,a,b,function(e){e?!e.expires_at||e.expires_at<=(new Date).getTime()?S(d).removeItem(d.l(a),function(){return c(null)}):(e.expires_at=void 0,c(e)):c(null)})};
af.prototype.C=function(a,b,c,d){b&&(b.expires_at=(new Date).getTime()+864E5);T.prototype.C.call(this,a,b,c,d)};X.prototype.tc=function(a){var b=this;a=void 0===a?{}:a;var c=a.id,d=void 0===a.params?{}:a.params,e=function(n){n&&n.sessions?(n=bf(g,n.sessions),U(b.g,c,n)):U(b.g,c,null)},g=d.loginHint;delete d.loginHint;var f=Q(this.v);if(f){a=d.clientId;var h=d.request;d=d.sessionSelector;h.client_id=a;h.ss_domain=d.domain;var k=new af,l={clientId:a,origin:this.h};k.B(l,f,function(n){n?e(n):$e(b.K,h,function(r){!r||r.error?e(null):k.C(l,r,f,function(){e(r)})})})}else e(null)};
function bf(a,b){if(!b.length)return null;var c=a.toLowerCase();b=p(b);for(var d=b.next();!d.done;d=b.next())if(d=d.value,d.login_hint){if(a===d.obfuscatedGaiaId)return d.login_hint;if(d.emails&&d.emails.length)for(var e=p(d.emails),g=e.next();!g.done;g=e.next())if(c===g.value.toLowerCase())return d.login_hint}return null}X.prototype.fd=function(a){cf(this,a,!1)};X.prototype.gd=function(a){cf(this,a,!0)};
var cf=function(a,b,c){document.requestStorageAccess&&Ad(document.requestStorageAccess)?document.hasStorageAccess().then(function(d){if(d)U(a.g,b.id,{hasAccess:!0});else{d=new Sc({origin:a.h});var e=document.getElementById("container");(c?d.Uc:d.Tc).call(d,e,function(){Ae(a.g);U(a.g,b.id,{hasAccess:!0})},function(){Ae(a.g);U(a.g,b.id,{hasAccess:!1})});ze(a.g)}},function(d){G("StorageAccess check failed: "+d);U(a.g,b.id,{hasAccess:!1})}):U(a.g,b.id,{hasAccess:!0})};X.prototype.uc=function(a){a=void 0===a?{}:a;a=void 0===a.params?{}:a.params;var b=!!a.clientId&&!P(a.clientId),c=!!a.request,d=!!a.sessionSelector;return!!a.loginHint&&b&&c&&d};X.prototype.createPolicy=function(){var a={A:[],ba:[],M:[]};Xe(this,a);a.A.push({method:"gsi:fetchLoginHint",i:Y(this,this.tc),O:!0,s:Y(this,this.uc)});a.ba.push({ca:"itpNewGrant",i:Y(this,this.fd)});a.ba.push({ca:"itpRegrant",i:Y(this,this.gd)});return a};O.La="APISID";O.tb="SAPISID";O.vb="/o/oauth2/iframerpc?action=sessionState";O.ob="/o/oauth2/iframerpc?action=checkOrigin";O.sb="/o/oauth2/iframerpc?action=issueToken";O.rb="/o/oauth2/iframerpc?action=issueOnlineCode";O.Ka="/o/oauth2/iframerpc?action=listSessions";
var df=function(){var a=Cd("origin");if(!a)throw"Failed to get parent origin from URL hash!";var b=Cd("rpcToken");if(!b)throw"Failed to get rpcToken from URL hash!";var c=!!Cd("clearCache"),d=Cd("debug");zd="0"!=d&&!!d;(new X(a,b,c)).start()},ef=["lso","startIdpIFrame"],Z=u;ef[0]in Z||"undefined"==typeof Z.execScript||Z.execScript("var "+ef[0]);for(var ff;ef.length&&(ff=ef.shift());)ef.length||void 0===df?Z=Z[ff]&&Z[ff]!==Object.prototype[ff]?Z[ff]:Z[ff]={}:Z[ff]=df;
| 515.678082 | 2,005 | 0.656271 |
5cf25095229f76ea5b1c842457d2ef0950c966a6
| 1,877 |
css
|
CSS
|
public/style4.css
|
supersamuj533/progettoEsame
|
161c74cec8190c8aec1abea41ae8394a1e0c6b29
|
[
"MIT"
] | null | null | null |
public/style4.css
|
supersamuj533/progettoEsame
|
161c74cec8190c8aec1abea41ae8394a1e0c6b29
|
[
"MIT"
] | null | null | null |
public/style4.css
|
supersamuj533/progettoEsame
|
161c74cec8190c8aec1abea41ae8394a1e0c6b29
|
[
"MIT"
] | null | null | null |
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
box-sizing: border-box;
background-color: #06b0da;
}
.sfondo {
position: absolute;
top: 50px;
left: 550px ;
height: 65%;
width: 30%;
background-color: rgb(255, 255, 255);
border-radius: 15px;
}
.logo{
display: flex;
flex-direction: column;
position: absolute;
top: 10px;
left: 5% ;
width: 10%;
height:30%;
}
.text1{
font-size:180%;
font-weight: bold;
position: absolute;
top: 100px;
left: 30px ;
font-style: verdana;
text-align: right;
}
.accedi{
background-color: #06b0da;
transition: background-color .5s;
border-radius: 25px;
text-transform: uppercase;
color: #fff;
font-size: 10px;
padding: 10px 50px;
cursor: pointer;
font-weight: bold;
width: 350px;
height:45px;
align-self: center;
border: none;
margin-top: 1rem;
text-transform: uppercase;
position: absolute;
top: 310px;
left: 8% ;
text-align: center;
}
.input {
height: 600px;
width: 600px;
}
.input1 {
display: flex;
flex-direction: column;
position: absolute;
left: 18px ;
top: 80px;
height: 60px;
width: 400px;
}
.input2 {
display: flex;
flex-direction: column;
position: absolute;
left: 18px ;
top: 150px;
height:40px;
width: 400px;
}
.input1:focus{
border: 4px solid #06b0da;
}
.input2:focus{
border: 4px solid #06b0da;
}
.input1::-webkit-input-placeholder { color: #06b0da; font-style:italic; }
.input2::-webkit-input-placeholder { color: #06b0da; font-style:italic;}
.errore{
display: flex;
flex-direction: column;
position: absolute;
left: 20% ;
top: 85%;
height:40px;
width: 250px;
color: red;
border: 1px solid #da0606;
text-align: center;
}
| 17.063636 | 74 | 0.602557 |
c13c5ad0ef6a6d5545104f66f38faca6cbbfda17
| 1,892 |
rs
|
Rust
|
src/game/mod.rs
|
chutslar/rust-avec-sdl
|
199bd38c916afe32235114d0e9463b656ae00f28
|
[
"MIT"
] | null | null | null |
src/game/mod.rs
|
chutslar/rust-avec-sdl
|
199bd38c916afe32235114d0e9463b656ae00f28
|
[
"MIT"
] | null | null | null |
src/game/mod.rs
|
chutslar/rust-avec-sdl
|
199bd38c916afe32235114d0e9463b656ae00f28
|
[
"MIT"
] | null | null | null |
extern crate sdl2;
use events::{Event, EventType, EventPool};
use controller::{Controllers, ControllerState};
use controller::sdl2::controller::{Axis, Button};
pub struct Game<'a> {
// Required to use events
event_pool: &'a mut EventPool,
controllers: &'a Controllers,
controller_state: ControllerState,
// Used for example logic
signaled: bool,
check_signal_count: u32
}
impl<'a> Game<'a> {
pub fn new(
event_pool : &'a mut EventPool,
controllers: &'a Controllers) -> Self {
Game {
event_pool,
controllers,
controller_state: ControllerState::new(&controllers),
signaled: false,
check_signal_count: 0
}
}
pub fn update(&mut self, delta_time_ms: u64) {
// Example logic using events
if !self.signaled {
self.event_pool.signal_event(
EventType::OnNameEntered,
Event::OnNameEntered {
trigger_id: 23,
name: "Jaques"
}
);
self.signaled = true;
} else {
let event = self.event_pool.poll_events(
EventType::OnNameEntered,
23,
if self.check_signal_count > 5 { true } else { false }
);
match event {
Some(e) => println!("Got event: {:?}", e),
None => (),
}
self.check_signal_count += 1;
}
match self.controllers.button_down(0, Button::A, &self.controller_state) {
Some(b) => if b { println!("Got A") },
None => (),
}
// Remove events marked for removal each frame
self.event_pool.remove_events();
// Update controller state
self.controller_state.update(self.controllers);
}
}
| 28.238806 | 82 | 0.525899 |
856387b15db7d1b07802e548c3275c31439d5680
| 1,024 |
kt
|
Kotlin
|
src/main/kotlin/marcombo/lcriadof/capitulo7/fichero/properties/c7p3.kt
|
Marcombo/El-gran-libro-de-Kotlin
|
fa02ae2555d8cc693638a65806c3f6ea07e4a7ff
|
[
"MIT"
] | null | null | null |
src/main/kotlin/marcombo/lcriadof/capitulo7/fichero/properties/c7p3.kt
|
Marcombo/El-gran-libro-de-Kotlin
|
fa02ae2555d8cc693638a65806c3f6ea07e4a7ff
|
[
"MIT"
] | null | null | null |
src/main/kotlin/marcombo/lcriadof/capitulo7/fichero/properties/c7p3.kt
|
Marcombo/El-gran-libro-de-Kotlin
|
fa02ae2555d8cc693638a65806c3f6ea07e4a7ff
|
[
"MIT"
] | null | null | null |
/*
El gran libro de Kotlin
(para programadores de back end)
Editorial: Marcombo (https://www.marcombo.com/)
Autor: Luis Criado Fernández (http://luis.criado.online/)
CAPÍTULO 7: FICHEROS
*/
package marcombo.lcriadof.capitulo7.fichero.properties
import java.io.FileInputStream
import java.util.*
fun main(){
try {
val directorioRaiz:String="/tmp/kotlin/"
val prop = Properties()
val f=FileInputStream(directorioRaiz+"oracleBITver2.properties")
prop.load(f) // cargamos el fichero de propiedades
val ip:String?=prop.getProperty("instancia.ip")
val puerto:String?=prop.getProperty("instancia.puerto")
val nombre:String?=prop.getProperty("instancia.nombre")
val usuario:String?=prop.getProperty("usuario.nombre")
val clave:String?=prop.getProperty("usuario.clave")
println("Instancia a BBDD: $nombre $ip:$puerto")
println(" usuariao: $usuario clave:$clave")
}catch (e: Exception) {
println(e)
}
}
| 26.947368 | 72 | 0.671875 |
b58102903d6f0b79507aae9a89fc7d596eabc4fd
| 5,169 |
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0_notsx.log_21829_945.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9 |
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0_notsx.log_21829_945.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1 |
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0_notsx.log_21829_945.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3 |
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x7a95, %rsi
lea addresses_D_ht+0x4375, %rdi
xor $62850, %r11
mov $86, %rcx
rep movsb
nop
nop
nop
nop
nop
add %r11, %r11
lea addresses_WC_ht+0x17e31, %rsi
lea addresses_A_ht+0x15475, %rdi
clflush (%rdi)
nop
nop
nop
nop
add $22983, %r12
mov $111, %rcx
rep movsb
nop
nop
nop
nop
cmp %r12, %r12
lea addresses_D_ht+0x16e75, %r12
nop
nop
nop
and $58200, %r9
movups (%r12), %xmm1
vpextrq $0, %xmm1, %rcx
nop
xor $25267, %r12
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r8
push %r9
push %rax
push %rbp
push %rdi
// Load
mov $0xe75, %rdi
nop
xor %r8, %r8
mov (%rdi), %rax
nop
nop
nop
nop
nop
add %rdi, %rdi
// Store
lea addresses_normal+0x1dcb5, %rdi
nop
xor $50263, %rbp
mov $0x5152535455565758, %r10
movq %r10, %xmm1
vmovups %ymm1, (%rdi)
and %r8, %r8
// Faulty Load
lea addresses_A+0x14475, %rbp
nop
xor $11115, %r9
mov (%rbp), %r10d
lea oracles, %r9
and $0xff, %r10
shlq $12, %r10
mov (%r9,%r10,1), %r10
pop %rdi
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 1, 'NT': True, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_P', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 6}}
[Faulty Load]
{'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 4, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 7, 'same': True}}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 44.560345 | 2,999 | 0.658348 |
1628c41ae24bf509922c21c504fbd72a7ec3d731
| 1,609 |
h
|
C
|
src/bf_lpm_trie/bf_lpm_trie/bf_lpm_trie.h
|
jafingerhut/behavioral-model
|
e1fcd5d54cecf7679f46ac462fdf92e049711e6c
|
[
"Apache-2.0"
] | 390 |
2015-10-13T05:22:51.000Z
|
2022-03-30T19:18:14.000Z
|
src/bf_lpm_trie/bf_lpm_trie/bf_lpm_trie.h
|
jafingerhut/behavioral-model
|
e1fcd5d54cecf7679f46ac462fdf92e049711e6c
|
[
"Apache-2.0"
] | 919 |
2015-08-10T17:50:50.000Z
|
2022-03-31T17:46:07.000Z
|
src/bf_lpm_trie/bf_lpm_trie/bf_lpm_trie.h
|
jafingerhut/behavioral-model
|
e1fcd5d54cecf7679f46ac462fdf92e049711e6c
|
[
"Apache-2.0"
] | 351 |
2015-09-18T03:32:32.000Z
|
2022-03-31T03:56:38.000Z
|
/* Copyright 2013-present Barefoot Networks, Inc.
* Copyright 2021 VMware, 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.
*/
/*
* Antonin Bas
*
*/
#ifndef _BF_LPM_TRIE_H
#define _BF_LPM_TRIE_H
#ifdef __cplusplus
extern "C"{
#endif
#include <stddef.h>
#include <stdbool.h>
typedef struct bf_lpm_trie_s bf_lpm_trie_t;
typedef uintptr_t value_t;
bf_lpm_trie_t *bf_lpm_trie_create(size_t key_width_bytes, bool auto_shrink);
void bf_lpm_trie_destroy(bf_lpm_trie_t *t);
void bf_lpm_trie_insert(bf_lpm_trie_t *trie,
const char *prefix, int prefix_length,
const value_t value);
bool bf_lpm_trie_has_prefix(const bf_lpm_trie_t *trie,
const char *prefix, int prefix_length);
bool bf_lpm_trie_retrieve_value(const bf_lpm_trie_t *trie,
const char *prefix, int prefix_length,
value_t *pvalue);
bool bf_lpm_trie_lookup(const bf_lpm_trie_t *trie, const char *key,
value_t *pvalue);
bool bf_lpm_trie_delete(bf_lpm_trie_t *trie, const char *prefix,
int prefix_length);
#ifdef __cplusplus
}
#endif
#endif
| 25.951613 | 76 | 0.73151 |
f05ff75311109e9783190938edb768d0c1aeae71
| 2,772 |
js
|
JavaScript
|
src/pages/authority/resource-mgnt/index.js
|
watertao/teemo
|
13b0ebafb853d0f110c6ed7817667229efaa22e0
|
[
"DOC",
"MIT"
] | 11 |
2019-07-11T04:16:32.000Z
|
2021-05-16T09:26:51.000Z
|
src/pages/authority/resource-mgnt/index.js
|
watertao/teemo
|
13b0ebafb853d0f110c6ed7817667229efaa22e0
|
[
"DOC",
"MIT"
] | 5 |
2019-04-27T01:27:46.000Z
|
2019-11-15T00:56:28.000Z
|
src/pages/authority/resource-mgnt/index.js
|
watertao/teemo
|
13b0ebafb853d0f110c6ed7817667229efaa22e0
|
[
"DOC",
"MIT"
] | 2 |
2019-02-20T00:58:33.000Z
|
2019-08-08T03:03:50.000Z
|
import React, { Component } from 'react';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import { formatMessage as fm, FormattedMessage } from 'umi/locale';
import mm from '@/utils/message-util';
import {Button, Icon, Table, Tag} from 'antd';
import TMDataList from '@/components/TMDataList';
import { connect } from 'dva';
import styles from './style.less';
@connect(({ resource, loading }) => ({ resource, loading }))
export default class ResourceManagement extends Component {
constructor(props) {
super(props);
this.tmDataListRef = React.createRef();
this._onDataFetchExpect = this._onDataFetchExpect.bind(this);
}
componentDidMount() {
this.tmDataListRef.current.query();
}
render = () => {
const { resource: { list }, loading } = this.props;
const columns = [
{
title: '#',
dataIndex: 'seq',
width: 50,
render: (text, record, index) => {
return <span style={{ fontWeight: '500' }}>{index + 1}</span>;
}
},
{
title: mm('resource.field.method'),
dataIndex: 'verb',
key: 'verb',
width: 170,
render: (text, record, index) => {
switch(record.verb) {
case 'DELETE':
return <Tag color='#F50'>{ record.verb }</Tag>;
case 'GET':
return <Tag color='#87D068'>{ record.verb }</Tag>;
case 'POST':
return <Tag color='#108EE9'>{ record.verb }</Tag>;
case 'PUT':
return <Tag color='#2DB7F5'>{ record.verb }</Tag>;
default:
return <Tag color='#BFBFBF'>{ record.verb }</Tag>
}
},
sorter: true,
},
{
title: mm('resource.field.pattern'),
dataIndex: 'uri_pattern',
key: 'uri_pattern',
sorter: true,
render: (text) => {
return <span className={styles['uri_pattern']}>{text}</span>
}
},
{
title: mm('resource.field.name'),
dataIndex: 'name',
key: 'name'
},
{
title: mm('resource.field.remark'),
dataIndex: 'remark',
key: 'remark'
},
];
return (
<PageHeaderWrapper
title={mm('moduleName')}
>
<TMDataList
ref={this.tmDataListRef}
onDataFetchExpect={this._onDataFetchExpect}
dataSource={list}
columns={columns}
loading={loading.effects['resource/fetchList']}
/>
</PageHeaderWrapper>
);
}
_onDataFetchExpect = (filterParameters) => {
const { dispatch } = this.props;
return dispatch({
type: 'resource/fetchList',
payload: {
filterParameters,
}
});
}
}
| 25.2 | 72 | 0.535714 |
4748bd63b73ae404133a6cd40b42b7b481a67901
| 1,673 |
html
|
HTML
|
krish-pabani/animation2.html
|
swapnil-tiwari/Awesome-Web-Art
|
75e8ff32b69cda59955e85800e5f715cca5e714f
|
[
"MIT"
] | 14 |
2020-10-01T07:51:34.000Z
|
2022-03-09T03:39:34.000Z
|
krish-pabani/animation2.html
|
swapnil-tiwari/Awesome-Web-Art
|
75e8ff32b69cda59955e85800e5f715cca5e714f
|
[
"MIT"
] | 60 |
2020-10-01T08:06:33.000Z
|
2020-11-05T08:50:58.000Z
|
krish-pabani/animation2.html
|
swapnil-tiwari/Awesome-Web-Art
|
75e8ff32b69cda59955e85800e5f715cca5e714f
|
[
"MIT"
] | 59 |
2020-09-30T17:11:34.000Z
|
2021-10-18T09:57:19.000Z
|
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
/* reset */
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
min-height: 100vh;
padding: 20px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
/* other */
p {
color: #2e2e2e;
margin-bottom: 20px;
}
/* block-$ */
.block-effect {
font-size: calc(8px + 6vw);
}
.block-reveal {
--t: calc(var(--td) + var(--d));
color: transparent;
padding: 4px;
position: relative;
overflow: hidden;
animation: revealBlock 0s var(--t) forwards;
}
.block-reveal::after {
content: '';
width: 0%;
height: 100%;
padding-bottom: 4px;
position: absolute;
top: 0;
left: 0;
background: var(--bc);
animation: revealingIn var(--td) var(--d) forwards, revealingOut var(--td) var(--t) forwards;
}
/* animations */
@keyframes revealBlock {
100% {
color: #0f0f0f;
}
}
@keyframes revealingIn {
0% {
width: 0;
}
100% {
width: 100%;
}
}
@keyframes revealingOut {
0% {
transform: translateX(0);
}
100% {
transform: translateX(100%);
}
}
.abs-site-link {
position: fixed;
bottom: 20px;
left: 20px;
color: hsla(0, 0%, 0%, .6);
font-size: 16px;
}
</style>
</head>
<body>
<h1 class="block-effect" style="--td: 1.2s">
<div class="block-reveal" style="--bc: #4040bf; --d: .1s">Block</div>
<div class="block-reveal" style="--bc: #bf4060; --d: .5s">Revealing Effect</div>
</h1>
</body>
</html>
| 14.675439 | 139 | 0.598924 |
def5ef4aeb1944c3edce5ef336d24bdb8ff9473a
| 9,116 |
rs
|
Rust
|
pallets/dex-api/benchmarking/src/lib.rs
|
metrocoindev/sora2-parachain
|
b6e0f16fe8c90e483ddccaf320b00fafa08d2db8
|
[
"BSD-4-Clause"
] | null | null | null |
pallets/dex-api/benchmarking/src/lib.rs
|
metrocoindev/sora2-parachain
|
b6e0f16fe8c90e483ddccaf320b00fafa08d2db8
|
[
"BSD-4-Clause"
] | null | null | null |
pallets/dex-api/benchmarking/src/lib.rs
|
metrocoindev/sora2-parachain
|
b6e0f16fe8c90e483ddccaf320b00fafa08d2db8
|
[
"BSD-4-Clause"
] | null | null | null |
// This file is part of the SORA network and Polkaswap app.
// Copyright (c) 2020, 2021, Polka Biome Ltd. All rights reserved.
// SPDX-License-Identifier: BSD-4-Clause
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
// Redistributions of source code must retain the above copyright notice, this list
// of conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright notice, this
// list of conditions and the following disclaimer in the documentation and/or other
// materials provided with the distribution.
//
// All advertising materials mentioning features or use of this software must display
// the following acknowledgement: This product includes software developed by Polka Biome
// Ltd., SORA, and Polkaswap.
//
// Neither the name of the Polka Biome Ltd. nor the names of its contributors may be used
// to endorse or promote products derived from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY Polka Biome Ltd. AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Polka Biome Ltd. BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//! DEX-API module benchmarking.
#![cfg_attr(not(feature = "std"), no_std)]
#[macro_use]
extern crate alloc;
use dex_api::*;
use codec::Decode;
use common::prelude::{Balance, SwapVariant};
use common::{
balance, AssetName, AssetSymbol, DEXId, LiquiditySourceType, DOT, PSWAP, USDT, VAL, XOR,
};
use frame_benchmarking::benchmarks;
use frame_support::traits::Get;
use frame_system::{EventRecord, RawOrigin};
use frame_benchmarking::Zero;
use hex_literal::hex;
use sp_std::prelude::*;
use assets::Pallet as Assets;
use multicollateral_bonding_curve_pool::Pallet as MBCPool;
use permissions::Pallet as Permissions;
use pool_xyk::Pallet as XYKPool;
use trading_pair::Pallet as TradingPair;
pub const DEX: DEXId = DEXId::Polkaswap;
#[cfg(test)]
mod mock;
pub struct Module<T: Config>(dex_api::Module<T>);
pub trait Config:
dex_api::Config + pool_xyk::Config + technical::Config + multicollateral_bonding_curve_pool::Config
{
}
// Support Functions
fn alice<T: Config>() -> T::AccountId {
let bytes = hex!("d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d");
T::AccountId::decode(&mut &bytes[..]).expect("Failed to decode account ID")
}
// Prepare Runtime for running benchmarks
fn setup_benchmark<T: Config>() -> Result<(), &'static str> {
let owner = alice::<T>();
let owner_origin: <T as frame_system::Config>::Origin = RawOrigin::Signed(owner.clone()).into();
let dex_id: T::DEXId = DEX.into();
// Grant permissions to self in case they haven't been explicitly given in genesis config
Permissions::<T>::assign_permission(
owner.clone(),
&owner,
permissions::MANAGE_DEX,
permissions::Scope::Limited(common::hash(&dex_id)),
)
.unwrap();
let _ = Permissions::<T>::assign_permission(
owner.clone(),
&owner,
permissions::MINT,
permissions::Scope::Unlimited,
);
let _ = Permissions::<T>::assign_permission(
owner.clone(),
&owner,
permissions::BURN,
permissions::Scope::Unlimited,
);
let _ = Assets::<T>::register_asset_id(
owner.clone(),
XOR.into(),
AssetSymbol(b"XOR".to_vec()),
AssetName(b"XOR".to_vec()),
18,
Balance::zero(),
true,
);
let _ = Assets::<T>::register_asset_id(
owner.clone(),
VAL.into(),
AssetSymbol(b"VAL".to_vec()),
AssetName(b"VAL".to_vec()),
18,
Balance::zero(),
true,
);
let _ = Assets::<T>::register_asset_id(
owner.clone(),
PSWAP.into(),
AssetSymbol(b"PSWAP".to_vec()),
AssetName(b"PSWAP".to_vec()),
18,
Balance::zero(),
true,
);
let _ = Assets::<T>::register_asset_id(
owner.clone(),
USDT.into(),
AssetSymbol(b"USDT".to_vec()),
AssetName(b"USDT".to_vec()),
18,
Balance::zero(),
true,
);
let _ = Assets::<T>::register_asset_id(
owner.clone(),
DOT.into(),
AssetSymbol(b"DOT".to_vec()),
AssetName(b"DOT".to_vec()),
18,
Balance::zero(),
true,
);
Assets::<T>::mint_to(&XOR.into(), &owner.clone(), &owner.clone(), balance!(50000)).unwrap();
Assets::<T>::mint_to(
&DOT.into(),
&owner.clone(),
&owner.clone(),
balance!(50000000),
)
.unwrap();
Assets::<T>::mint_to(
&USDT.into(),
&owner.clone(),
&owner.clone(),
balance!(50000000),
)
.unwrap();
Assets::<T>::mint_to(
&VAL.into(),
&owner.clone(),
&owner.clone(),
balance!(50000000),
)
.unwrap();
Assets::<T>::mint_to(
&PSWAP.into(),
&owner.clone(),
&owner.clone(),
balance!(50000000),
)
.unwrap();
TradingPair::<T>::register(owner_origin.clone(), DEX.into(), XOR.into(), DOT.into()).unwrap();
TradingPair::<T>::register(owner_origin.clone(), DEX.into(), XOR.into(), USDT.into()).unwrap();
TradingPair::<T>::register(owner_origin.clone(), DEX.into(), XOR.into(), VAL.into()).unwrap();
TradingPair::<T>::register(owner_origin.clone(), DEX.into(), XOR.into(), PSWAP.into()).unwrap();
XYKPool::<T>::initialize_pool(owner_origin.clone(), DEX.into(), XOR.into(), DOT.into())?;
XYKPool::<T>::initialize_pool(owner_origin.clone(), DEX.into(), XOR.into(), VAL.into())?;
XYKPool::<T>::initialize_pool(owner_origin.clone(), DEX.into(), XOR.into(), PSWAP.into())?;
XYKPool::<T>::initialize_pool(owner_origin.clone(), DEX.into(), XOR.into(), USDT.into())?;
XYKPool::<T>::deposit_liquidity(
owner_origin.clone(),
DEX.into(),
XOR.into(),
DOT.into(),
balance!(1000),
balance!(2000),
balance!(0),
balance!(0),
)?;
XYKPool::<T>::deposit_liquidity(
owner_origin.clone(),
DEX.into(),
XOR.into(),
VAL.into(),
balance!(1000),
balance!(2000),
balance!(0),
balance!(0),
)?;
XYKPool::<T>::deposit_liquidity(
owner_origin.clone(),
DEX.into(),
XOR.into(),
PSWAP.into(),
balance!(1000),
balance!(2000),
balance!(0),
balance!(0),
)?;
XYKPool::<T>::deposit_liquidity(
owner_origin.clone(),
DEX.into(),
XOR.into(),
USDT.into(),
balance!(1000),
balance!(2000),
balance!(0),
balance!(0),
)?;
MBCPool::<T>::initialize_pool(owner_origin.clone(), USDT.into())?;
MBCPool::<T>::initialize_pool(owner_origin.clone(), VAL.into())?;
Ok(())
}
#[allow(dead_code)]
fn assert_last_event<T: Config>(generic_event: <T as dex_api::Config>::Event) {
let events = frame_system::Pallet::<T>::events();
let system_event: <T as frame_system::Config>::Event = generic_event.into();
// compare to the last event record
let EventRecord { event, .. } = &events[events.len() - 1];
assert_eq!(event, &system_event);
}
benchmarks! {
swap {
let n in 1 .. 1000 => setup_benchmark::<T>()?;
let caller = alice::<T>();
let base_asset: T::AssetId = <T as assets::Config>::GetBaseAssetId::get();
let target_asset: T::AssetId = DOT.into();
}: _(
RawOrigin::Signed(caller.clone()),
DEX.into(),
LiquiditySourceType::XYKPool,
base_asset.clone(),
target_asset.clone(),
balance!(1000),
0,
SwapVariant::WithDesiredInput,
None
)
verify {
// TODO: implement proper verification method
// assert_last_event::<T>(Event::DirectExchange(
// caller.clone(),
// caller.clone(),
// DEX.into(),
// LiquiditySourceType::XYKPool,
// base_asset.clone(),
// target_asset.clone(),
// fixed!(1000),
// fixed!(667),
// fixed!(3)
// ).into())
}
}
#[cfg(test)]
mod tests {
use super::*;
use crate::mock::{ExtBuilder, Runtime};
use frame_support::assert_ok;
#[test]
fn test_benchmarks() {
ExtBuilder::default().build().execute_with(|| {
assert_ok!(test_benchmark_swap::<Runtime>());
});
}
}
| 31.32646 | 103 | 0.609149 |
3510707c7419ab1db94318384b88d2624d8e0e4d
| 228 |
kt
|
Kotlin
|
ok-remindercalendar-common-be/src/main/kotlin/ru/otus/otuskotlin/remindercalendar/common/backend/model/StubCase.kt
|
otuskotlin/otuskotlin-202012-remindercalendar-km
|
772f6ee3282683875ea3f49cc91a6db7c22a35f7
|
[
"MIT"
] | null | null | null |
ok-remindercalendar-common-be/src/main/kotlin/ru/otus/otuskotlin/remindercalendar/common/backend/model/StubCase.kt
|
otuskotlin/otuskotlin-202012-remindercalendar-km
|
772f6ee3282683875ea3f49cc91a6db7c22a35f7
|
[
"MIT"
] | null | null | null |
ok-remindercalendar-common-be/src/main/kotlin/ru/otus/otuskotlin/remindercalendar/common/backend/model/StubCase.kt
|
otuskotlin/otuskotlin-202012-remindercalendar-km
|
772f6ee3282683875ea3f49cc91a6db7c22a35f7
|
[
"MIT"
] | null | null | null |
package ru.otus.otuskotlin.remindercalendar.common.backend.model
enum class StubCase {
NONE,
EVENT_FILTER_SUCCESS,
EVENT_CREATE_SUCCESS,
EVENT_READ_SUCCESS,
EVENT_UPDATE_SUCCESS,
EVENT_DELETE_SUCCESS,
}
| 20.727273 | 64 | 0.77193 |
558db00c78fcec37d296e75587484d099bd5623f
| 5,949 |
html
|
HTML
|
index.html
|
calba5141114/sable-web
|
66f24f8a8b27d7e5feac08719b334e610fdee029
|
[
"MIT"
] | null | null | null |
index.html
|
calba5141114/sable-web
|
66f24f8a8b27d7e5feac08719b334e610fdee029
|
[
"MIT"
] | null | null | null |
index.html
|
calba5141114/sable-web
|
66f24f8a8b27d7e5feac08719b334e610fdee029
|
[
"MIT"
] | null | null | null |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="description" content="Sable is a web development firm that specializes in SEO, content creation and satisfying small businesses. ">
<meta name="keywords" content="Web Design, Websites , Small Business Websites, Sites, ">
<meta name="author" content="Sable Web Design">
<title>Sable Website Design</title>
<link rel="icon" href="assets/favicon.ico">
<link href="css/index-css/index.css" rel="stylesheet">
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="node_modules/scrollreveal/src/scrollreveal.js"></script>
</head>
<body>
<nav class="navbar navbar-expand navbar-light bg-light">
<a class="navbar-brand" href="#">
<h1 class="main_h1">SABLE</h1>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="pages/pricing.html">Pricing</a>
</li>
<li>
<!-- <a class="nav-link" href="pages/portfolio.html">Portfolio</a> -->
</li>
</ul>
</div>
</nav>
<div class="jumbotron jumbotron-fluid foo" style="background-image: url('assets/img-bg.jpg')">
<div class="container">
<h1 class="display-3">Hey there.</h1>
<p class="lead" style="word-spacing: 1rem;">Developers Hackers Creators Artist Musicians Pioneers</p>
</div>
</div>
<div class="container" id="main">
<h1 class="foo"> About Us.</h1>
<p class="foo">
Sable is a creative collective dedicated to producing amazing websites developed with the latest web technologies and SEC
tatics. Building a website is not as simple as it seems, in todays world it is the first impression and attention
grabber of any business. Sable can develop beautiful, mobile freindly and truly immersive web experiences.
</p>
<h1 class="foo"> Web API Integration. </h1>
<p class="foo">
We provide Integration for Google maps, Yelp Reviews , Youtube, Spotify, Soundcloud and pretty much any service running on
the web for no additional cost. We are dedicated to helping our clients find and retain new customers. If you
go with Sable you will get the best bang for your buck .
</p>
<br>
</div>
<div class="jumbotron jumbotron-fluid foo" style="background-image: url('assets/bellingham.jpg'); object-fit:scale-down;">
<div class="container text-white">
<h1 class="display-3">Beauty</h1>
<p class="lead" style="word-spacing: 1rem;">Gorgeous Amazing Stunning Astounding</p>
</div>
</div>
<div class="container">
<h1 class="foo"> Clean Elegant Design.</h1>
<p class="foo">
Sable is a creative collective dedicated to producing amazing websites developed with the latest web technologies and SEC
tatics. Building a website is not as simple as it seems, in todays world it is the first impression and attention
grabber of any business. Sable can develop beautiful, mobile freindly and truly immersive web experiences.
</p>
<h1 class="foo"> Mobile Design.</h1>
<p class="foo">
Most developers do not care about mobile design and at Sable we always test on 20 devices of different sizes. We provide
Integration for Google maps, Yelp Reviews , Youtube, Spotify, Soundcloud and pretty much any service running
on the web for no additional cost. We are dedicated to helping our clients find and retain new customers. If
you go with Sable you will get the best bang for your buck .
</p>
<br>
</div>
<div class="jumbotron jumbotron-fluid foo" style="background-image: url('assets/blue.jpg'); object-fit:scale-down;">
<div class="container text-white">
<h1 class="display-3">Virtuoso</h1>
<p class="lead" style="word-spacing: 1rem;"> Expert Professional Maestro Ace.</p>
</div>
</div>
<div class="container">
<h1 class="foo">Team Workflow</h1>
<p class="foo">
Sable partners are friendly, clean cut, honest and always willing to work with clients needs and wants. A Sable Man is a
team player and an MVP all rolled up into one.
</p>
<h1 class="foo"> Content Producers </h1>
<p class="foo">
We provide content production services for your company for a small fee. Sable can provide text, images, music and videos
a massive advantage and edge to your company. You can always of course send us your content for use on your site.
</p>
<br>
<h1>Questions?</h1>
<p>
You can email us @<a href="mailto:soradev4@gmail.com" class="item-link">soradev4@gmail.com</a>
</p>
<br>
</div>
<section id="footer" class="text-center text-dark">
<p class="h6">© All right Reversed. Sable Design
</p>
</hr>
</section>
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="src/index-page.js"></script>
</body>
</html>
| 38.62987 | 152 | 0.623634 |
f558069f16d3d5699b6f6fffaeab4c98a0cabffd
| 7,850 |
rs
|
Rust
|
tests/unit_test.rs
|
gnxlxnxx/dubins_path
|
92d21aeb9a059ba57850374c38e5e5b826227cc8
|
[
"Apache-2.0",
"MIT"
] | 2 |
2020-05-20T23:18:48.000Z
|
2020-05-20T23:19:26.000Z
|
tests/unit_test.rs
|
gnxlxnxx/dubins_path
|
92d21aeb9a059ba57850374c38e5e5b826227cc8
|
[
"Apache-2.0",
"MIT"
] | 1 |
2020-05-21T08:52:24.000Z
|
2020-05-21T08:52:24.000Z
|
tests/unit_test.rs
|
gnxlxnxx/dubins_path
|
92d21aeb9a059ba57850374c38e5e5b826227cc8
|
[
"Apache-2.0",
"MIT"
] | 1 |
2020-05-20T15:02:35.000Z
|
2020-05-20T15:02:35.000Z
|
#[cfg(test)]
mod tests {
use dubins_path::*;
#[test]
#[should_panic]
fn test_overlapping_circles_rsl() {
let radius = 0.5;
let end_point = Point::new(radius, 0.0);
let end_angle = Angle::zero();
RouteCSC::rsl(radius, end_point, end_angle).unwrap();
}
#[test]
#[should_panic]
fn test_overlapping_circles_lsr() {
let radius = 0.5;
let end_point = Point::new(-radius, 0.0);
let end_angle = Angle::zero();
RouteCSC::lsr(radius, end_point, end_angle).unwrap();
}
#[test]
#[should_panic]
fn test_far_apart_circles_rlr() {
let radius = 0.5;
let end_point = Point::new(7.0 * radius, 0.0);
let end_angle = Angle::zero();
RouteCCC::rlr(radius, end_point, end_angle).unwrap();
}
#[test]
#[should_panic]
fn test_far_apart_circles_lrl() {
let radius = 0.5;
let end_point = Point::new(-7.0 * radius, 0.0);
let end_angle = Angle::zero();
RouteCCC::lrl(radius, end_point, end_angle).unwrap();
}
#[test]
fn test_points_rsr() {
{
let radius = 0.5;
let end_point = Point::new(0.0, 10.0);
let end_angle = Angle::zero();
let expected_result_rsr = RouteCSC {
start: CirclePath {
center: Point::new(0.5, 0.0),
radius: radius,
angle: Angle::zero(),
},
tangent: StraightPath {
origin: Point::new(0.0, 0.0),
vector: Vector::from_angle_and_length(Angle::frac_pi_2(), 10.0),
},
end: CirclePath {
center: Point::new(0.5, 10.0),
radius: radius,
angle: Angle::zero(),
},
};
let result_rsr = RouteCSC::rsr(radius, end_point, end_angle).unwrap();
assert!(result_rsr.start.approx_eq(expected_result_rsr.start));
assert!(result_rsr.tangent.approx_eq(expected_result_rsr.tangent));
assert!(result_rsr.end.approx_eq(expected_result_rsr.end));
}
}
#[test]
fn test_points_rsl() {
{
let radius = 0.5;
let end_point = Point::new(0.0, 10.0);
let end_angle = Angle::zero();
let expected_result_rsl = RouteCSC {
start: CirclePath {
center: Point::new(0.5, 0.0),
radius: radius,
angle: Angle::zero(),
},
tangent: StraightPath {
origin: Point::new(0.0, 0.0),
vector: Vector::from_angle_and_length(Angle::frac_pi_2(), 10.0),
},
end: CirclePath {
center: Point::new(-0.5, 10.0),
radius: radius,
angle: Angle::zero(),
},
};
let result_rsl = RouteCSC::rsl(radius, end_point, end_angle).unwrap();
assert!(result_rsl.start.approx_eq(expected_result_rsl.start));
assert!(result_rsl.tangent.approx_eq(expected_result_rsl.tangent));
assert!(result_rsl.end.approx_eq(expected_result_rsl.end));
}
}
#[test]
fn test_points_lsl() {
{
let radius = 0.5;
let end_point = Point::new(0.0, 10.0);
let end_angle = Angle::zero();
let expected_result_lsl = RouteCSC {
start: CirclePath {
center: Point::new(-0.5, 0.0),
radius: radius,
angle: Angle::zero(),
},
tangent: StraightPath {
origin: Point::new(0.0, 0.0),
vector: Vector::from_angle_and_length(Angle::frac_pi_2(), 10.0),
},
end: CirclePath {
center: Point::new(-0.5, 10.0),
radius: radius,
angle: Angle::zero(),
},
};
let result_lsl = RouteCSC::lsl(radius, end_point, end_angle).unwrap();
assert!(result_lsl.start.approx_eq(expected_result_lsl.start));
assert!(result_lsl.tangent.approx_eq(expected_result_lsl.tangent));
assert!(result_lsl.end.approx_eq(expected_result_lsl.end));
}
}
#[test]
fn test_point_lsr() {
{
let radius = 0.5;
let end_point = Point::new(0.0, 10.0);
let end_angle = Angle::zero();
let expected_result_lsr = RouteCSC {
start: CirclePath {
center: Point::new(-0.5, 0.0),
radius: radius,
angle: Angle::zero(),
},
tangent: StraightPath {
origin: Point::new(0.0, 0.0),
vector: Vector::from_angle_and_length(Angle::frac_pi_2(), 10.0),
},
end: CirclePath {
center: Point::new(0.5, 10.0),
radius: radius,
angle: Angle::zero(),
},
};
let result_lsr = RouteCSC::lsr(radius, end_point, end_angle).unwrap();
assert!(result_lsr.start.approx_eq(expected_result_lsr.start));
assert!(result_lsr.tangent.approx_eq(expected_result_lsr.tangent));
assert!(result_lsr.end.approx_eq(expected_result_lsr.end));
}
}
#[test]
fn test_point_rlr() {
{
let radius = 0.5;
let end_point = Point::new(3.0, 0.0);
let end_angle = Angle::pi();
let expected_result_rlr = RouteCCC {
start: CirclePath {
center: Point::new(0.5, 0.0),
radius: radius,
angle: Angle::pi(),
},
middle: CirclePath {
center: Point::new(1.5, 0.0),
radius: radius,
angle: Angle::pi(),
},
end: CirclePath {
center: Point::new(2.5, 0.0),
radius: radius,
angle: Angle::pi(),
},
};
let result_rlr = RouteCCC::rlr(radius, end_point, end_angle).unwrap();
assert!(result_rlr.start.approx_eq(expected_result_rlr.start));
assert!(result_rlr.middle.approx_eq(expected_result_rlr.middle));
assert!(result_rlr.end.approx_eq(expected_result_rlr.end));
}
}
#[test]
fn test_point_lrl() {
{
let radius = 0.5;
let end_point = Point::new(-3.0, 0.0);
let end_angle = Angle::pi();
let expected_result_lrl = RouteCCC {
start: CirclePath {
center: Point::new(-0.5, 0.0),
radius: radius,
angle: Angle::pi(),
},
middle: CirclePath {
center: Point::new(-1.5, 0.0),
radius: radius,
angle: Angle::pi(),
},
end: CirclePath {
center: Point::new(-2.5, 0.0),
radius: radius,
angle: Angle::pi(),
},
};
let result_lrl = RouteCCC::lrl(radius, end_point, end_angle).unwrap();
assert!(result_lrl.start.approx_eq(expected_result_lrl.start));
assert!(result_lrl.middle.approx_eq(expected_result_lrl.middle));
println!("{:?}", result_lrl.end);
assert!(result_lrl.end.approx_eq(expected_result_lrl.end));
}
}
}
| 33.262712 | 84 | 0.474395 |
9967cf6d67e3c42c80cd6804cd55156b6dfcd432
| 1,131 |
h
|
C
|
kitten/include/arch-x86_64/current.h
|
tsinghua-os-spring-2013/palacios
|
7ee817d2495b48dc882df66ded9e8ebf2c4803d9
|
[
"BSD-3-Clause"
] | 1 |
2015-03-09T04:25:00.000Z
|
2015-03-09T04:25:00.000Z
|
kitten/include/arch-x86_64/current.h
|
tsinghua-os-spring-2013/palacios
|
7ee817d2495b48dc882df66ded9e8ebf2c4803d9
|
[
"BSD-3-Clause"
] | null | null | null |
kitten/include/arch-x86_64/current.h
|
tsinghua-os-spring-2013/palacios
|
7ee817d2495b48dc882df66ded9e8ebf2c4803d9
|
[
"BSD-3-Clause"
] | null | null | null |
#ifndef _X86_64_CURRENT_H
#define _X86_64_CURRENT_H
#if !defined(__ASSEMBLY__)
struct task_struct;
#include <arch/pda.h>
/**
* In normal operation, the current task pointer is read directly from
* the PDA.
*
* If the PDA has not been setup or is not available for some reason,
* the slower get_current_via_RSP() must be used instead. This is
* sometimes necessary during the bootstrap process.
*/
static inline struct task_struct *
get_current(void)
{
struct task_struct *t = read_pda(pcurrent);
return t;
}
#define current get_current()
/**
* Derives the current task pointer from the current value of the
* stack pointer (RSP register).
*
* WARNING: Do not call this from interrupt context. It won't work.
* It is only safe to call this from task context.
*/
static inline struct task_struct *
get_current_via_RSP(void)
{
struct task_struct *tsk;
__asm__("andq %%rsp,%0; " : "=r" (tsk) : "0" (~(TASK_SIZE - 1)));
return tsk;
}
#else
#ifndef ASM_OFFSET_H
#include <arch/asm-offsets.h>
#endif
#define GET_CURRENT(reg) movq %gs:(pda_pcurrent),reg
#endif
#endif /* !(_X86_64_CURRENT_H) */
| 22.176471 | 70 | 0.712644 |
c3b0a8a2e995a2396bd816e1e98bc83cb2f40a2f
| 2,684 |
go
|
Go
|
engine/worker/cmd_update.go
|
mvdan/cds
|
fcf66ba206a2cbf45540b8b3f578436ec3da5678
|
[
"BSD-3-Clause"
] | 1 |
2019-04-29T12:34:50.000Z
|
2019-04-29T12:34:50.000Z
|
engine/worker/cmd_update.go
|
mvdan/cds
|
fcf66ba206a2cbf45540b8b3f578436ec3da5678
|
[
"BSD-3-Clause"
] | null | null | null |
engine/worker/cmd_update.go
|
mvdan/cds
|
fcf66ba206a2cbf45540b8b3f578436ec3da5678
|
[
"BSD-3-Clause"
] | null | null | null |
package main
import (
"fmt"
"net/http"
"time"
"github.com/inconshreveable/go-update"
"github.com/spf13/cobra"
"github.com/ovh/cds/sdk"
"github.com/ovh/cds/sdk/cdsclient"
)
func cmdUpdate(w *currentWorker) *cobra.Command {
c := &cobra.Command{
Use: "update",
Short: "worker update [flags]",
Long: `Update worker from CDS API or from CDS Release
Update from Github:
worker update --from-github
Update from your CDS API:
worker update --api https://your-cds-api.localhost
`,
Run: updateCmd(w),
}
c.Flags().Bool(flagFromGithub, false, "Update binary from latest github release")
c.Flags().String(flagAPI, "", "URL of CDS API")
c.Flags().Bool(flagInsecure, false, `(SSL) This option explicitly allows curl to perform "insecure" SSL connections and transfers.`)
return c
}
func updateCmd(w *currentWorker) func(cmd *cobra.Command, args []string) {
return func(cmd *cobra.Command, args []string) {
fmt.Println(sdk.VersionString())
var urlBinary string
if !FlagBool(cmd, "from-github") {
w.apiEndpoint = FlagString(cmd, flagAPI)
if w.apiEndpoint == "" {
sdk.Exit("--api not provided, aborting update.")
}
w.client = cdsclient.NewWorker(w.apiEndpoint, "download", cdsclient.NewHTTPClient(time.Second*360, FlagBool(cmd, flagInsecure)))
urlBinary = w.client.DownloadURLFromAPI("worker", sdk.GOOS, sdk.GOARCH)
fmt.Printf("Updating worker binary from CDS API on %s...\n", urlBinary)
} else {
// no need to have apiEndpoint here
w.client = cdsclient.NewWorker("", "download", nil)
var errGH error
urlBinary, errGH = w.client.DownloadURLFromGithub(sdk.GetArtifactFilename("worker", sdk.GOOS, sdk.GOARCH))
if errGH != nil {
sdk.Exit("Error while getting URL from Github: %s", errGH)
}
fmt.Printf("Updating worker binary from Github on %s...\n", urlBinary)
}
resp, err := http.Get(urlBinary)
if err != nil {
sdk.Exit("Error while getting binary from CDS API: %s\n", err)
}
defer resp.Body.Close()
if contentType := getContentType(resp); contentType != "application/octet-stream" {
sdk.Exit("Invalid Binary (Content-Type: %s). Please try again or download it manually from %s\n", contentType, sdk.URLGithubReleases)
}
if resp.StatusCode != 200 {
sdk.Exit("Error http code: %d, url called: %s\n", resp.StatusCode, urlBinary)
}
if err := update.Apply(resp.Body, update.Options{}); err != nil {
sdk.Exit("Error while getting updating worker from CDS API: %s\n", err)
}
fmt.Println("Update worker done.")
}
}
func getContentType(resp *http.Response) string {
for k, v := range resp.Header {
if k == "Content-Type" && len(v) >= 1 {
return v[0]
}
}
return ""
}
| 29.822222 | 136 | 0.684426 |
17ebe374d409c0dc5b747caf9d0e1c4c93a76da6
| 2,940 |
sql
|
SQL
|
junior/pack2_junior/p3_sql_jdbc/ch1_crud/create_v1.sql
|
multiscripter/job4j
|
2aaaf59c2b4e1d9866395f1247897d5f09f9ef84
|
[
"Apache-2.0"
] | 1 |
2018-01-16T11:27:23.000Z
|
2018-01-16T11:27:23.000Z
|
junior/pack2_junior/p3_sql_jdbc/ch1_crud/create_v1.sql
|
multiscripter/job4j
|
2aaaf59c2b4e1d9866395f1247897d5f09f9ef84
|
[
"Apache-2.0"
] | 11 |
2020-07-01T18:39:12.000Z
|
2022-02-16T01:11:31.000Z
|
junior/pack2_junior/p3_sql_jdbc/ch1_crud/create_v1.sql
|
multiscripter/job4j
|
2aaaf59c2b4e1d9866395f1247897d5f09f9ef84
|
[
"Apache-2.0"
] | null | null | null |
-- Database: job4j
create database job4j
WITH
OWNER = postgres
ENCODING = 'UTF8'
LC_COLLATE = 'Russian_Russia.1251'
LC_CTYPE = 'Russian_Russia.1251'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
create table if not exists statuses (
id serial not null primary key,
status varchar (16) not null
);
insert into statuses (status) values ('new');
insert into statuses (status) values ('in work');
insert into statuses (status) values ('closed');
create table if not exists categories (
id serial not null primary key,
category varchar (16) not null
);
insert into categories (category) values ('normal');
insert into categories (category) values ('urgent');
create table if not exists rights (
id serial not null primary key,
canAdd bool not null,
canEdit bool not null,
canDel bool not null
);
insert into rights (canAdd, canEdit, canDel) values (true, false, false);
insert into rights (canAdd, canEdit, canDel) values (true, true, false);
insert into rights (canAdd, canEdit, canDel) values (true, true, true);
create table if not exists roles (
id serial not null primary key,
rightsId int not null references rights(id),
role varchar (16) not null
);
insert into roles (rightsId, role) values (1, 'user');
insert into roles (rightsId, role) values (2, 'moder');
insert into roles (rightsId, role) values (3, 'admin');
create table if not exists users (
id serial not null primary key,
name varchar (64) not null,
regdate date not null default CURRENT_DATE,
roleId int not null references roles(id)
);
insert into users (name, roleId) values ('Ivanov', 1);
insert into users (name, roleId) values ('Petrov', 2);
insert into users (name, roleId) values ('Sidorov', 3);
insert into users (name, roleId) values ('Smirnov', 1);
create table if not exists orders (
id serial not null primary key,
userId int not null references users(id),
catId int not null references categories(id),
message text not null,
regdate timestamp not null default now(),
statusId int not null references statuses(id) default 1
);
insert into orders (userId, catId, message) values (1, 1, 'Text content of first order.');
insert into orders (userId, catId, message) values (1, 1, 'Second order description.');
insert into orders (userId, catId, message) values (4, 1, 'Third order description.');
insert into orders (userId, catId, message) values (4, 2, 'four order description.');
create table if not exists comments (
id serial not null primary key,
orderId int not null references orders(id),
userId int not null references users(id),
comment text not null
);
insert into comments (orderId, userId, comment) values (1, 1, 'This is comment for order 1 from user Ivanov');
create table if not exists files (
id serial not null primary key,
orderId int not null references orders(id),
file varchar (255) not null
);
| 35.853659 | 110 | 0.709524 |
417e26373a870cd1abf93d713bdb582729bf0aa5
| 2,285 |
asm
|
Assembly
|
programs/oeis/157/A157448.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1 |
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/157/A157448.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/157/A157448.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A157448: a(n) = 2048*n^2 - 128*n + 1.
; 1921,7937,18049,32257,50561,72961,99457,130049,164737,203521,246401,293377,344449,399617,458881,522241,589697,661249,736897,816641,900481,988417,1080449,1176577,1276801,1381121,1489537,1602049,1718657,1839361,1964161,2093057,2226049,2363137,2504321,2649601,2798977,2952449,3110017,3271681,3437441,3607297,3781249,3959297,4141441,4327681,4518017,4712449,4910977,5113601,5320321,5531137,5746049,5965057,6188161,6415361,6646657,6882049,7121537,7365121,7612801,7864577,8120449,8380417,8644481,8912641,9184897,9461249,9741697,10026241,10314881,10607617,10904449,11205377,11510401,11819521,12132737,12450049,12771457,13096961,13426561,13760257,14098049,14439937,14785921,15136001,15490177,15848449,16210817,16577281,16947841,17322497,17701249,18084097,18471041,18862081,19257217,19656449,20059777,20467201,20878721,21294337,21714049,22137857,22565761,22997761,23433857,23874049,24318337,24766721,25219201,25675777,26136449,26601217,27070081,27543041,28020097,28501249,28986497,29475841,29969281,30466817,30968449,31474177,31984001,32497921,33015937,33538049,34064257,34594561,35128961,35667457,36210049,36756737,37307521,37862401,38421377,38984449,39551617,40122881,40698241,41277697,41861249,42448897,43040641,43636481,44236417,44840449,45448577,46060801,46677121,47297537,47922049,48550657,49183361,49820161,50461057,51106049,51755137,52408321,53065601,53726977,54392449,55062017,55735681,56413441,57095297,57781249,58471297,59165441,59863681,60566017,61272449,61982977,62697601,63416321,64139137,64866049,65597057,66332161,67071361,67814657,68562049,69313537,70069121,70828801,71592577,72360449,73132417,73908481,74688641,75472897,76261249,77053697,77850241,78650881,79455617,80264449,81077377,81894401,82715521,83540737,84370049,85203457,86040961,86882561,87728257,88578049,89431937,90289921,91152001,92018177,92888449,93762817,94641281,95523841,96410497,97301249,98196097,99095041,99998081,100905217,101816449,102731777,103651201,104574721,105502337,106434049,107369857,108309761,109253761,110201857,111154049,112110337,113070721,114035201,115003777,115976449,116953217,117934081,118919041,119908097,120901249,121898497,122899841,123905281,124914817,125928449,126946177,127968001
mov $1,16
mul $1,$0
add $1,31
mul $1,$0
mul $1,128
add $1,1921
| 228.5 | 2,180 | 0.869147 |
ad2780804d0eff912bad0f46c51ba7524053e683
| 17,960 |
sql
|
SQL
|
postgresql_old/01_citydb_util_DML_FUNCTIONS.sql
|
gioagu/3dcitydb_utilities
|
5d365ba48d27b99b9781227a3b7ed8a0359a29a7
|
[
"Apache-2.0"
] | 1 |
2019-04-03T14:42:20.000Z
|
2019-04-03T14:42:20.000Z
|
postgresql_old/01_citydb_util_DML_FUNCTIONS.sql
|
gioagu/3dcitydb_utilities
|
5d365ba48d27b99b9781227a3b7ed8a0359a29a7
|
[
"Apache-2.0"
] | null | null | null |
postgresql_old/01_citydb_util_DML_FUNCTIONS.sql
|
gioagu/3dcitydb_utilities
|
5d365ba48d27b99b9781227a3b7ed8a0359a29a7
|
[
"Apache-2.0"
] | null | null | null |
-- 3D City Database Utilities Package
--
-- August 2017
--
-- 3D City Database: http://www.3dcitydb.org
--
--
-- Copyright 2017
-- Austrian Institute of Technology G.m.b.H., Austria
-- Center for Energy - Smart Cities and Regions Research Field
-- http://www.ait.ac.at/en/research-fields/smart-cities-and-regions/
--
-- 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.
--
-- ***********************************************************************
-- ****************** 01_citydb_util_DML_FUNCTIONS.sql *******************
--
-- This script installs the extension "uuid-ossp" and additional
-- stored procedures into the citydb_pkg schema.
--
-- ***********************************************************************
-- ***********************************************************************
CREATE EXTENSION IF NOT EXISTS "uuid-ossp" SCHEMA public;
----------------------------------------------------------------
-- Function INSERT_CITYOBJECT
----------------------------------------------------------------
DROP FUNCTION IF EXISTS citydb_pkg.insert_cityobject(integer, integer, character varying, character varying, character varying, character varying, character varying, geometry, timestamp with time zone, timestamp with time zone, character varying, character varying, timestamp with time zone, character varying, character varying, character varying, character varying) CASCADE;
CREATE OR REPLACE FUNCTION citydb_pkg.insert_cityobject (
objectclass_id integer,
id integer DEFAULT NULL,
gmlid varchar(256) DEFAULT NULL,
gmlid_codespace varchar(1000) DEFAULT NULL,
name varchar(1000) DEFAULT NULL,
name_codespace varchar(4000) DEFAULT NULL,
description varchar(4000) DEFAULT NULL,
envelope geometry DEFAULT NULL,
creation_date timestamp(0) with time zone DEFAULT NULL,
termination_date timestamp(0) with time zone DEFAULT NULL,
relative_to_terrain varchar(256) DEFAULT NULL,
relative_to_water varchar(256) DEFAULT NULL,
last_modification_date timestamp with time zone DEFAULT NULL,
updating_person varchar(256) DEFAULT NULL,
reason_for_update varchar(4000) DEFAULT NULL,
lineage varchar(256) DEFAULT NULL,
schema_name varchar DEFAULT 'citydb'::varchar
)
RETURNS integer
AS
$$
DECLARE
p_id integer := id ;
p_objectclass_id integer := objectclass_id ;
p_gmlid varchar(256) := gmlid ;
p_gmlid_codespace varchar(1000) := gmlid_codespace ;
p_name varchar(1000) := name ;
p_name_codespace varchar(4000) := name_codespace ;
p_description varchar(4000) := description ;
p_envelope geometry := envelope ;
p_creation_date timestamp(0) with time zone := creation_date ;
p_termination_date timestamp(0) with time zone := termination_date ;
p_relative_to_terrain varchar(256) := relative_to_terrain ;
p_relative_to_water varchar(256) := relative_to_water ;
p_last_modification_date timestamp with time zone := last_modification_date;
p_updating_person varchar(256) := updating_person ;
p_reason_for_update varchar(4000) := reason_for_update ;
p_lineage varchar(256) := lineage ;
--
p_schema_name varchar := schema_name;
seq_name varchar;
inserted_id integer;
BEGIN
-- IF the ID is not given, then generate a new one.
IF p_id IS NULL THEN
seq_name=schema_name||'.cityobject_seq';
p_id=nextval(seq_name::regclass);
END IF;
-- IF the GmlID is not given, then generate a new one.
IF p_gmlid IS NULL THEN
p_gmlid='UUID_'||uuid_generate_v4();
END IF;
-- IF the creation_date is not given, then generate a new one.
IF p_creation_date IS NULL THEN
p_creation_date=now()::timestamp(0) with time zone;
END IF;
EXECUTE format('INSERT INTO %I.cityobject (
id,
objectclass_id,
gmlid,
gmlid_codespace,
name,
name_codespace,
description,
envelope,
creation_date,
termination_date,
relative_to_terrain,
relative_to_water,
last_modification_date,
updating_person,
reason_for_update,
lineage
) VALUES (
%L, %L, %L, %L, %L, %L, %L, %L, %L, %L,
%L, %L, %L, %L, %L, %L
) RETURNING id',
p_schema_name, -- ADD schema_name,
p_id, -- ADD p_id
p_objectclass_id,
p_gmlid,
p_gmlid_codespace,
p_name,
p_name_codespace,
p_description,
p_envelope,
p_creation_date,
p_termination_date,
p_relative_to_terrain,
p_relative_to_water,
p_last_modification_date,
p_updating_person,
p_reason_for_update,
p_lineage
) INTO inserted_id;
RETURN inserted_id;
EXCEPTION
WHEN OTHERS THEN RAISE NOTICE 'citydb_pkg.insert_cityobject (id: %): %', p_id, SQLERRM;
END;
$$
LANGUAGE 'plpgsql';
----------------------------------------------------------------
-- Function INSERT_CITYOBJECTGROUP
----------------------------------------------------------------
DROP FUNCTION IF EXISTS citydb_pkg.insert_cityobjectgroup(integer, character varying, character varying, character varying, character varying, character varying, character varying, integer, geometry, integer, character varying) CASCADE;
CREATE OR REPLACE FUNCTION citydb_pkg.insert_cityobjectgroup (
id integer,
class varchar(256) DEFAULT NULL,
class_codespace varchar(4000) DEFAULT NULL,
function varchar(1000) DEFAULT NULL,
function_codespace varchar(4000) DEFAULT NULL,
usage varchar(1000) DEFAULT NULL,
usage_codespace varchar(4000) DEFAULT NULL,
brep_id integer DEFAULT NULL,
other_geom geometry DEFAULT NULL,
parent_cityobject_id integer DEFAULT NULL,
schema_name varchar DEFAULT 'citydb'::varchar
)
RETURNS integer
AS
$$
DECLARE
p_id integer := id ;
p_class varchar(256) := class ;
p_class_codespace varchar(4000) := class_codespace ;
p_function varchar(1000) := function ;
p_function_codespace varchar(4000) := function_codespace ;
p_usage varchar(1000) := usage ;
p_usage_codespace varchar(4000) := usage_codespace ;
p_brep_id integer := brep_id ;
p_other_geom geometry := other_geom ;
p_parent_cityobject_id integer := parent_cityobject_id;
--
p_schema_name varchar := schema_name;
inserted_id integer;
BEGIN
EXECUTE format('INSERT INTO %I.cityobjectgroup (
id,
class,
class_codespace,
function,
function_codespace,
usage,
usage_codespace,
brep_id,
other_geom,
parent_cityobject_id
) VALUES (
%L, %L, %L, %L, %L, %L, %L, %L, %L, %L
) RETURNING id',
p_schema_name,
p_id,
p_class,
p_class_codespace,
p_function,
p_function_codespace,
p_usage,
p_usage_codespace,
p_brep_id,
p_other_geom,
p_parent_cityobject_id
) INTO inserted_id;
RETURN inserted_id;
EXCEPTION
WHEN OTHERS THEN RAISE NOTICE 'citydb_pkg.insert_cityobjectgroup (id: %): %', p_id, SQLERRM;
END;
$$
LANGUAGE 'plpgsql';
----------------------------------------------------------------
-- Function INSERT_GROUP_TO_CITYOBJECT
----------------------------------------------------------------
DROP FUNCTION IF EXISTS citydb_pkg.insert_group_to_cityobject (integer, integer, varchar, varchar) CASCADE;
CREATE OR REPLACE FUNCTION citydb_pkg.insert_group_to_cityobject (
cityobjectgroup_id integer,
cityobject_id integer,
role varchar DEFAULT NULL,
--
schema_name varchar DEFAULT 'citydb'::varchar
)
RETURNS void
AS $$
DECLARE
p_cityobjectgroup_id integer := cityobjectgroup_id;
p_cityobject_id integer := cityobject_id;
p_role varchar := role;
--
p_schema_name varchar := schema_name;
BEGIN
EXECUTE format('INSERT INTO %I.group_to_cityobject (
cityobjectgroup_id,
cityobject_id,
role
) VALUES (
%L, %L, %L
)',
p_schema_name,
p_cityobjectgroup_id,
p_cityobject_id,
p_role
);
EXCEPTION
WHEN OTHERS THEN RAISE NOTICE 'citydb_pkg.insert_group_to_cityobject (cityobjectgroup_id: %, cityobject_id %): %', cityobjectgroup_id, cityobject_id, SQLERRM;
END;
$$
LANGUAGE 'plpgsql';
---------------------------------------------------------------
-- Function INSERT_BUILDING
---------------------------------------------------------------
DROP FUNCTION IF EXISTS citydb_pkg.insert_building(integer, integer, integer, character varying, character varying, character varying, character varying, character varying, character varying, date, date, character varying, character varying, double precision, character varying, numeric, numeric, character varying, character varying, character varying, character varying, geometry, geometry, geometry, geometry, geometry, geometry, geometry, integer, integer, integer, integer, integer, integer, integer, integer, integer, integer, character varying);
CREATE OR REPLACE FUNCTION citydb_pkg.insert_building (
id integer,
building_parent_id integer DEFAULT NULL,
building_root_id integer DEFAULT NULL,
class varchar(256) DEFAULT NULL,
class_codespace varchar(4000) DEFAULT NULL,
function varchar(1000) DEFAULT NULL,
function_codespace varchar(4000) DEFAULT NULL,
usage varchar(1000) DEFAULT NULL,
usage_codespace varchar(4000) DEFAULT NULL,
year_of_construction date DEFAULT NULL,
year_of_demolition date DEFAULT NULL,
roof_type varchar(256) DEFAULT NULL,
roof_type_codespace varchar(4000) DEFAULT NULL,
measured_height double precision DEFAULT NULL,
measured_height_unit varchar(4000) DEFAULT NULL,
storeys_above_ground numeric(8) DEFAULT NULL,
storeys_below_ground numeric(8) DEFAULT NULL,
storey_heights_above_ground varchar(4000) DEFAULT NULL,
storey_heights_ag_unit varchar(4000) DEFAULT NULL,
storey_heights_below_ground varchar(4000) DEFAULT NULL,
storey_heights_bg_unit varchar(4000) DEFAULT NULL,
lod1_terrain_intersection geometry DEFAULT NULL,
lod2_terrain_intersection geometry DEFAULT NULL,
lod3_terrain_intersection geometry DEFAULT NULL,
lod4_terrain_intersection geometry DEFAULT NULL,
lod2_multi_curve geometry DEFAULT NULL,
lod3_multi_curve geometry DEFAULT NULL,
lod4_multi_curve geometry DEFAULT NULL,
lod0_footprint_id integer DEFAULT NULL,
lod0_roofprint_id integer DEFAULT NULL,
lod1_multi_surface_id integer DEFAULT NULL,
lod2_multi_surface_id integer DEFAULT NULL,
lod3_multi_surface_id integer DEFAULT NULL,
lod4_multi_surface_id integer DEFAULT NULL,
lod1_solid_id integer DEFAULT NULL,
lod2_solid_id integer DEFAULT NULL,
lod3_solid_id integer DEFAULT NULL,
lod4_solid_id integer DEFAULT NULL,
schema_name varchar DEFAULT 'citydb'::varchar
)
RETURNS integer
AS
$$
DECLARE
p_id integer := id ;
p_building_parent_id integer := building_parent_id ;
p_building_root_id integer := building_root_id ;
p_class varchar(256) := class ;
p_class_codespace varchar(4000) := class_codespace ;
p_function varchar(1000) := function ;
p_function_codespace varchar(4000) := function_codespace ;
p_usage varchar(1000) := usage ;
p_usage_codespace varchar(4000) := usage_codespace ;
p_year_of_construction date := year_of_construction ;
p_year_of_demolition date := year_of_demolition ;
p_roof_type varchar(256) := roof_type ;
p_roof_type_codespace varchar(4000) := roof_type_codespace ;
p_measured_height double precision := measured_height ;
p_measured_height_unit varchar(4000) := measured_height_unit ;
p_storeys_above_ground numeric(8) := storeys_above_ground ;
p_storeys_below_ground numeric(8) := storeys_below_ground ;
p_storey_heights_above_ground varchar(4000) := storey_heights_above_ground;
p_storey_heights_ag_unit varchar(4000) := storey_heights_ag_unit ;
p_storey_heights_below_ground varchar(4000) := storey_heights_below_ground;
p_storey_heights_bg_unit varchar(4000) := storey_heights_bg_unit ;
p_lod1_terrain_intersection geometry := lod1_terrain_intersection ;
p_lod2_terrain_intersection geometry := lod2_terrain_intersection ;
p_lod3_terrain_intersection geometry := lod3_terrain_intersection ;
p_lod4_terrain_intersection geometry := lod4_terrain_intersection ;
p_lod2_multi_curve geometry := lod2_multi_curve ;
p_lod3_multi_curve geometry := lod3_multi_curve ;
p_lod4_multi_curve geometry := lod4_multi_curve ;
p_lod0_footprint_id integer := lod0_footprint_id ;
p_lod0_roofprint_id integer := lod0_roofprint_id ;
p_lod1_multi_surface_id integer := lod1_multi_surface_id ;
p_lod2_multi_surface_id integer := lod2_multi_surface_id ;
p_lod3_multi_surface_id integer := lod3_multi_surface_id ;
p_lod4_multi_surface_id integer := lod4_multi_surface_id ;
p_lod1_solid_id integer := lod1_solid_id ;
p_lod2_solid_id integer := lod2_solid_id ;
p_lod3_solid_id integer := lod3_solid_id ;
p_lod4_solid_id integer := lod4_solid_id ;
--
p_schema_name varchar := schema_name;
inserted_id integer;
BEGIN
EXECUTE format('INSERT INTO %I.building (
id,
building_parent_id,
building_root_id,
class,
class_codespace,
function,
function_codespace,
usage,
usage_codespace,
year_of_construction,
year_of_demolition,
roof_type,
roof_type_codespace,
measured_height,
measured_height_unit,
storeys_above_ground,
storeys_below_ground,
storey_heights_above_ground,
storey_heights_ag_unit,
storey_heights_below_ground,
storey_heights_bg_unit,
lod1_terrain_intersection,
lod2_terrain_intersection,
lod3_terrain_intersection,
lod4_terrain_intersection,
lod2_multi_curve,
lod3_multi_curve,
lod4_multi_curve,
lod0_footprint_id,
lod0_roofprint_id,
lod1_multi_surface_id,
lod2_multi_surface_id,
lod3_multi_surface_id,
lod4_multi_surface_id,
lod1_solid_id,
lod2_solid_id,
lod3_solid_id,
lod4_solid_id
) VALUES (
%L, %L, %L, %L, %L, %L, %L, %L, %L, %L,
%L, %L, %L, %L, %L, %L, %L, %L, %L, %L,
%L, %L, %L, %L, %L, %L, %L, %L, %L, %L,
%L, %L, %L, %L, %L, %L, %L, %L
) RETURNING id',
p_schema_name,
p_id,
p_building_parent_id,
p_building_root_id,
p_class,
p_class_codespace,
p_function,
p_function_codespace,
p_usage,
p_usage_codespace,
p_year_of_construction,
p_year_of_demolition,
p_roof_type,
p_roof_type_codespace,
p_measured_height,
p_measured_height_unit,
p_storeys_above_ground,
p_storeys_below_ground,
p_storey_heights_above_ground,
p_storey_heights_ag_unit,
p_storey_heights_below_ground,
p_storey_heights_bg_unit,
p_lod1_terrain_intersection,
p_lod2_terrain_intersection,
p_lod3_terrain_intersection,
p_lod4_terrain_intersection,
p_lod2_multi_curve,
p_lod3_multi_curve,
p_lod4_multi_curve,
p_lod0_footprint_id,
p_lod0_roofprint_id,
p_lod1_multi_surface_id,
p_lod2_multi_surface_id,
p_lod3_multi_surface_id,
p_lod4_multi_surface_id,
p_lod1_solid_id,
p_lod2_solid_id,
p_lod3_solid_id,
p_lod4_solid_id
) INTO inserted_id;
RETURN inserted_id;
EXCEPTION
WHEN OTHERS THEN RAISE NOTICE 'citydb_pkg.insert_building (id: %): %', p_id, SQLERRM;
END;
$$
LANGUAGE 'plpgsql';
-- ***********************************************************************
-- ***********************************************************************
DO
$$
BEGIN
RAISE NOTICE '
********************************
Additional DML functions for 3DCityDB installed correctly!
********************************
';
END
$$;
SELECT 'Additional DML functions for 3DCityDB installed correctly!'::varchar AS installation_result;
-- ***********************************************************************
-- ***********************************************************************
--
-- END OF FILE
--
-- ***********************************************************************
-- ***********************************************************************
| 38.958785 | 555 | 0.624889 |
60b02ffb4ae157d9b3b042bb137bd378dcd32b2e
| 52 |
sql
|
SQL
|
tests/queries/134-var-bytearray-gt-3.sql
|
pydemo/spv_14.4
|
ad3b62d6bdbbfc29e56391f512ba0ee17dad4eb7
|
[
"Apache-2.0"
] | null | null | null |
tests/queries/134-var-bytearray-gt-3.sql
|
pydemo/spv_14.4
|
ad3b62d6bdbbfc29e56391f512ba0ee17dad4eb7
|
[
"Apache-2.0"
] | null | null | null |
tests/queries/134-var-bytearray-gt-3.sql
|
pydemo/spv_14.4
|
ad3b62d6bdbbfc29e56391f512ba0ee17dad4eb7
|
[
"Apache-2.0"
] | null | null | null |
SELECT COUNT(*) FROM nulls3 WHERE binary_9 > X''
50
| 17.333333 | 48 | 0.711538 |
583f96106a16757226093a1606d6d449a7d11b22
| 5,001 |
h
|
C
|
chrome/browser/password_edit_dialog/android/password_edit_dialog_bridge.h
|
zealoussnow/chromium
|
fd8a8914ca0183f0add65ae55f04e287543c7d4a
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 14,668 |
2015-01-01T01:57:10.000Z
|
2022-03-31T23:33:32.000Z
|
chrome/browser/password_edit_dialog/android/password_edit_dialog_bridge.h
|
zealoussnow/chromium
|
fd8a8914ca0183f0add65ae55f04e287543c7d4a
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 86 |
2015-10-21T13:02:42.000Z
|
2022-03-14T07:50:50.000Z
|
chrome/browser/password_edit_dialog/android/password_edit_dialog_bridge.h
|
zealoussnow/chromium
|
fd8a8914ca0183f0add65ae55f04e287543c7d4a
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5,941 |
2015-01-02T11:32:21.000Z
|
2022-03-31T16:35:46.000Z
|
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_PASSWORD_EDIT_DIALOG_ANDROID_PASSWORD_EDIT_DIALOG_BRIDGE_H_
#define CHROME_BROWSER_PASSWORD_EDIT_DIALOG_ANDROID_PASSWORD_EDIT_DIALOG_BRIDGE_H_
#include <memory>
#include "base/android/jni_android.h"
#include "base/android/scoped_java_ref.h"
#include "base/callback.h"
namespace content {
class WebContents;
} // namespace content
// The bridge to invoke password edit dialog in Java from native password
// manager code.
// The native code owns the lifetime of the bridge.
// PasswordEditDialogBridge::Create() creates an instance of the bridge. It can
// return nullptr when WebContents is not attached to any window. Show()
// displays the dialog on the screen.
//
// OnDialogAccepted callback is called when the user accepts saving the
// presented password (by tapping Update button). The callback parameter denotes
// the index of selected username in the list of usernames. The dialog will be
// dismissed after this callback, feature code shouldn't call Dismiss from
// callback implementation to dismiss the dialog.
//
// OnDialogDismissed callback is called when the dialog is dismissed either from
// user interactions or from the call to Dismiss() method. The implementation of
// this callback should destroy the dialog bridge instance.
//
// Here is how typically dialog bridge is created:
// m_dialog_bridge = PasswordEditDialogBridge::Create(web_contents,
// base::BindOnce(&OnDialogAccepted),base::BindOnce(&OnDialogDismissed));
// if (m_dialog_bridge) m_dialog_bridge->Show(...);
//
// The owning class should dismiss displayed dialog during its own destruction:
// if (m_dialog_bridge) m_dialog_bridge->Dismiss();
//
// Dialog bridge instance should be destroyed in OnDialogDismissed callback:
// void OnDialogDismissed() {
// m_dialog_bridge.reset();
// }
//
// The PasswordEditDialog is the interface created to facilitate mocking in
// tests. PasswordEditDialogBridge contains the implementation.
class PasswordEditDialog {
public:
using DialogAcceptedCallback = base::OnceCallback<void(int)>;
using DialogDismissedCallback = base::OnceCallback<void(bool)>;
virtual ~PasswordEditDialog();
// Calls Java side of the bridge to display password edit modal dialog.
virtual void Show(const std::vector<std::u16string>& usernames,
int selected_username_index,
const std::u16string& password,
const std::u16string& origin,
const std::string& account_email) = 0;
// Dismisses displayed dialog. The owner of PassworDeidtDialogBridge should
// call this function to correctly dismiss and destroy the dialog. The object
// can be safely destroyed after dismiss callback is executed.
virtual void Dismiss() = 0;
};
class PasswordEditDialogBridge : public PasswordEditDialog {
public:
~PasswordEditDialogBridge() override;
// Creates and returns an instance of PasswordEditDialogBridge and
// corresponding Java counterpart.
// Returns nullptr if |web_contents| is not attached to a window.
static std::unique_ptr<PasswordEditDialog> Create(
content::WebContents* web_contents,
DialogAcceptedCallback dialog_accepted_callback,
DialogDismissedCallback dialog_dismissed_callback);
// Disallow copy and assign.
PasswordEditDialogBridge(const PasswordEditDialogBridge&) = delete;
PasswordEditDialogBridge& operator=(const PasswordEditDialogBridge&) = delete;
// Calls Java side of the bridge to display password edit modal dialog.
void Show(const std::vector<std::u16string>& usernames,
int selected_username_index,
const std::u16string& password,
const std::u16string& origin,
const std::string& account_email) override;
// Dismisses displayed dialog. The owner of PassworDeidtDialogBridge should
// call this function to correctly dismiss and destroy the dialog. The object
// can be safely destroyed after dismiss callback is executed.
void Dismiss() override;
// Called from Java to indicate that the user tapped the positive button with
// |selected_username| being selected from usernames list.
void OnDialogAccepted(JNIEnv* env, jint selected_username_index);
// Called from Java when the modal dialog is dismissed.
void OnDialogDismissed(JNIEnv* env, jboolean dialogAccepted);
private:
PasswordEditDialogBridge(
base::android::ScopedJavaLocalRef<jobject> jwindow_android,
DialogAcceptedCallback dialog_accepted_callback,
DialogDismissedCallback dialog_dismissed_callback);
base::android::ScopedJavaGlobalRef<jobject> java_password_dialog_;
DialogAcceptedCallback dialog_accepted_callback_;
DialogDismissedCallback dialog_dismissed_callback_;
};
#endif // CHROME_BROWSER_PASSWORD_EDIT_DIALOG_ANDROID_PASSWORD_EDIT_DIALOG_BRIDGE_H_
| 42.74359 | 85 | 0.766647 |
39d7027b00af6f69984e54c088d2259050baa863
| 2,435 |
js
|
JavaScript
|
.core/.cli/commands/electron/builder/index.js
|
Atomic-Reactor/Reactium-SSR
|
ce5906db22fa726cdd25d9670343b45b9ed33e61
|
[
"MIT"
] | 18 |
2019-01-01T20:40:21.000Z
|
2021-05-24T02:00:08.000Z
|
.core/.cli/commands/electron/builder/index.js
|
Atomic-Reactor/Reactium-SSR
|
ce5906db22fa726cdd25d9670343b45b9ed33e61
|
[
"MIT"
] | 21 |
2018-07-12T12:11:19.000Z
|
2022-02-20T23:26:18.000Z
|
.core/.cli/commands/electron/builder/index.js
|
Atomic-Reactor/Reactium-SSR
|
ce5906db22fa726cdd25d9670343b45b9ed33e61
|
[
"MIT"
] | 6 |
2018-12-14T19:22:21.000Z
|
2022-03-07T16:22:23.000Z
|
/**
* -----------------------------------------------------------------------------
* Imports
* -----------------------------------------------------------------------------
*/
const generator = require('./generator');
const path = require('path');
const op = require('object-path');
const mod = path.dirname(require.main.filename);
const { error, message } = require(`${mod}/lib/messenger`);
/**
* NAME String
* @description Constant defined as the command name. Value passed to the commander.command() function.
* @example $ arcli electron-build
* @see https://www.npmjs.com/package/commander#command-specific-options
* @since 2.0.0
*/
const NAME = 'electron-build';
/**
* DESC String
* @description Constant defined as the command description. Value passed to
* the commander.desc() function. This string is also used in the --help flag output.
* @see https://www.npmjs.com/package/commander#automated---help
* @since 2.0.0
*/
const DESC = 'Command for building Reactium into an Electron app.';
/**
* CANCELED String
* @description Message sent when the command is canceled
* @since 2.0.0
*/
const CANCELED = 'electron-build canceled!';
/**
* HELP Function
* @description Function called in the commander.on('--help', callback) callback.
* @see https://www.npmjs.com/package/commander#automated---help
* @since 2.0.0
*/
const HELP = () =>
console.log(`
Example:
$ arcli electron-build
`);
/**
* ACTION Function
* @description Function used as the commander.action() callback.
* @see https://www.npmjs.com/package/commander
* @param opt Object The commander options passed into the function.
* @param props Object The CLI props passed from the calling class `orcli.js`.
* @since 2.0.0
*/
const ACTION = ({ opt, props }) =>
generator({ props })
.then(() => console.log(''))
.catch(err => console.log(err));
/**
* COMMAND Function
* @description Function that executes program.command()
*/
const COMMAND = ({ program, props }) =>
program
.command(NAME)
.description(DESC)
.action(opt => ACTION({ opt, props }))
.on('--help', HELP);
/**
* Module Constructor
* @description Internal constructor of the module that is being exported.
* @param program Class Commander.program reference.
* @param props Object The CLI props passed from the calling class `arcli.js`.
* @since 2.0.0
*/
module.exports = {
COMMAND,
NAME,
};
| 28.647059 | 103 | 0.627926 |
89e111c50828992611f3715b9ae88f7d3b37d526
| 6,591 |
swift
|
Swift
|
LazySwifter/StringExtension.swift
|
quocnb/LazySwifter
|
fa22f21b25803d8bf763a28dc27712ee573eb482
|
[
"MIT"
] | null | null | null |
LazySwifter/StringExtension.swift
|
quocnb/LazySwifter
|
fa22f21b25803d8bf763a28dc27712ee573eb482
|
[
"MIT"
] | null | null | null |
LazySwifter/StringExtension.swift
|
quocnb/LazySwifter
|
fa22f21b25803d8bf763a28dc27712ee573eb482
|
[
"MIT"
] | null | null | null |
//
// StringExtension.swift
// LazySwifter
//
// Created by Quoc Nguyen on 2/14/18.
//
import UIKit
public extension String {
public func index(by distance: Int) -> String.Index? {
if distance >= 0 {
return index(startIndex, offsetBy: distance, limitedBy: endIndex)
} else {
return index(endIndex, offsetBy: distance, limitedBy: startIndex)
}
}
public func index(from: Int, to: Int) -> String.Index? {
guard let left = index(by: from) else {
return nil
}
return index(left, offsetBy: to - from, limitedBy: endIndex)
}
// String[1]
public subscript(index: Int) -> String {
guard let idx = self.index(by: index) else {
return ""
}
return String(self[idx])
}
// String[1..<2]
public subscript(range: Range<Int>) -> String {
guard let left = index(by: range.lowerBound) else {
return ""
}
guard let right = index(from: range.lowerBound, to: range.upperBound) else {
return ""
}
return String(self[left..<right])
}
// String[1...2]
public subscript(range: ClosedRange<Int>) -> String {
guard let left = index(by: range.lowerBound) else {
return ""
}
guard let right = index(from: range.lowerBound, to: range.upperBound) else {
return ""
}
return String(self[left...right])
}
// String[..<1]
public subscript(range: PartialRangeUpTo<Int>) -> String {
guard let right = index(from: 0, to: range.upperBound) else {
return ""
}
return String(self[..<right])
}
// String[...1]
public subscript(range: PartialRangeThrough<Int>) -> String {
guard let right = index(from: 0, to: range.upperBound) else {
return ""
}
return String(self[...right])
}
// String[1...]
public subscript(range: PartialRangeFrom<Int>) -> String {
guard let left = index(by: range.lowerBound) else {
return ""
}
return String(self[left...])
}
// String["substring"]
public subscript(string: String) -> [Range<String.Index>] {
var occurences = [Range<String.Index>]()
var initialLeftBound = startIndex
while initialLeftBound < endIndex {
guard let range = self.range(
of: string, options: [],
range: initialLeftBound..<endIndex, locale: nil
) else {
break
}
occurences.append(range)
initialLeftBound = range.upperBound
}
return occurences
}
// String["begin"..."end"]
public subscript(range: ClosedRange<String>) -> [ClosedRange<String.Index>] {
var occurences = [ClosedRange<String.Index>]()
var initialLeftBound = startIndex
while initialLeftBound < endIndex {
guard let beginRange = self.range(
of: range.lowerBound, options: [],
range: initialLeftBound..<endIndex, locale: nil
) else {
break
}
guard let endRange = self.range(
of: range.upperBound, options: [],
range: beginRange.upperBound..<endIndex, locale: nil
) else {
break
}
occurences.append(beginRange.lowerBound...endRange.upperBound)
initialLeftBound = endRange.upperBound
}
return occurences
}
// String["begin"..<"end"]
public subscript(range: Range<String>) -> [Range<String.Index>] {
var occurences = [Range<String.Index>]()
var initialLeftBound = startIndex
while initialLeftBound < endIndex {
guard let beginRange = self.range(
of: range.lowerBound, options: [],
range: initialLeftBound..<endIndex, locale: nil
) else {
break
}
guard let endRange = self.range(
of: range.upperBound, options: [],
range: beginRange.upperBound..<endIndex, locale: nil
) else {
break
}
occurences.append(beginRange.upperBound..<endRange.lowerBound)
initialLeftBound = endRange.upperBound
}
return occurences
}
// String[Character("a")]
public subscript(character: Character) -> [String.Index] {
var occurences = [String.Index]()
var initialLeftBound = startIndex
while initialLeftBound < endIndex {
guard let beginRange = self.range(
of: String(character), options: [],
range: initialLeftBound..<endIndex, locale: nil
) else {
break
}
occurences.append(beginRange.lowerBound)
initialLeftBound = beginRange.upperBound
}
return occurences
}
// String["begin"...]
public subscript(range: PartialRangeFrom<String>) -> PartialRangeFrom<String.Index>? {
guard self.index(by: range.lowerBound.count) != nil else {
return nil
}
guard let beginRange = self.range(
of: range.lowerBound, options: [],
range: startIndex..<endIndex, locale: nil
) else {
return nil
}
return beginRange.upperBound...
}
// String[..."end"]
public subscript(range: PartialRangeThrough<String>) -> PartialRangeThrough<String.Index>? {
guard self.index(by: range.upperBound.count) != nil else {
return nil
}
guard let endRange = self.range(
of: range.upperBound, options: [],
range: startIndex..<endIndex, locale: nil
) else {
return nil
}
return ...endRange.lowerBound
}
}
public extension String {
public var localizedString: String {
return NSLocalizedString(self, comment: "")
}
public static func * (text: String, times: Int) -> String {
return String(repeating: text, count: times)
}
public func trimmed() -> String {
let trim = self.trimmingCharacters(in: .whitespacesAndNewlines)
guard let regex = try? NSRegularExpression(pattern: "\\s+", options: .caseInsensitive) else {
return trim
}
let range = NSMakeRange(0, trim.count)
return regex.stringByReplacingMatches(in: trim, options: [], range: range, withTemplate: " ")
}
}
| 31.84058 | 101 | 0.553634 |
895ce6825f768f011555499e87987795614dee3d
| 5,226 |
sql
|
SQL
|
everyday_record.sql
|
zza00000/EverydayRecord
|
04c07c7c204a9bd100186874de9af6b58ead9bd6
|
[
"MIT"
] | null | null | null |
everyday_record.sql
|
zza00000/EverydayRecord
|
04c07c7c204a9bd100186874de9af6b58ead9bd6
|
[
"MIT"
] | null | null | null |
everyday_record.sql
|
zza00000/EverydayRecord
|
04c07c7c204a9bd100186874de9af6b58ead9bd6
|
[
"MIT"
] | null | null | null |
-- Create syntax for TABLE 'core_account'
CREATE TABLE `core_account`(
`id` INT(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '账户ID',
`username` varchar(32) NOT NULL COMMENT '用户名',
`phone` varchar(11) COMMENT '电话',
`password` varchar(32) NOT NULL COMMENT '密码',
`salt` varchar(5) NOT NULL COMMENT '盐',
`gender` tinyint(4) unsigned NOT NULL COMMENT '性别(1:男2:女)',
`email` varchar(32) NOT NULL COMMENT '邮箱',
`type` tinyint(4) unsigned NOT NULL COMMENT '账户类型(0:管理员,1:普通用户,2:VIP用户)',
`status` tinyint(4) unsigned NOT NULL COMMENT '状态(0:正常,1:非正常)',
`question` varchar(32) NOT NULL COMMENT '密码提示问题(0:没有密码提示问题,1:我的真实姓名,2:我的女朋友姓名,3:我的身份证号码)',
`answer` varchar(32) NOT NULL COMMENT '密码提示问题答案(0:没有密码提示问题)',
`createdTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY(`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='账户';
-- Create syntax for TABLE 'core_user_bill'
CREATE TABLE `core_user_bill`(
`id` INT(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID',
`accountID` int(11) unsigned NOT NULL COMMENT '用户accountID',
`ways` tinyint(4) unsigned NOT NULL COMMENT '消费方式(1:天猫超市,2:京东超市,3:淘宝天猫,4:京东商城,5:当当网,6:亚马逊,7:现金消费,8:唯品会,9:其它)',
`type` tinyint(4) unsigned NOT NULL COMMENT '消费用途(1:生活用品,2:学习书籍,3:电子产品,4:公交地铁打车,5:饭卡充值,6:餐饮,7:礼品赠品,8:其它)',
`money` decimal(10,2) unsigned NOT NULL COMMENT '消费金额',
`createdTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY(`id`),
KEY `fk_user_bill_account_id` (`accountID`),
CONSTRAINT `fk_user_bill_account_id` FOREIGN KEY (`accountID`) REFERENCES `core_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户记账';
-- Create syntax for TABLE 'core_user_memo'
CREATE TABLE `core_user_memo`(
`id` INT(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID',
`accountID` int(11) unsigned NOT NULL COMMENT '用户accountID',
`theme` varchar(32) NOT NULL COMMENT '主题',
`time` datetime NOT NULL COMMENT '备忘录时间',
`content` varchar(255) NOT NULL COMMENT '内容',
`createdTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY(`id`),
KEY `fk_user_bill_memo_id` (`accountID`),
CONSTRAINT `fk_user_bill_memo_id` FOREIGN KEY (`accountID`) REFERENCES `core_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户备忘录';
-- Create syntax for TABLE 'core_user_breaking_new'
CREATE TABLE `core_user_breaking_new`(
`id` INT(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID',
`accountID` int(11) unsigned NOT NULL COMMENT '用户accountID',
`theme` varchar(32) NOT NULL COMMENT '主题',
`time` datetime NOT NULL COMMENT '时间',
`figure` varchar(32) NOT NULL COMMENT '人物',
`content` varchar(255) NOT NULL COMMENT '内容',
`createdTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY(`id`),
KEY `fk_user_breaking_new_id` (`accountID`),
CONSTRAINT `fk_user_breaking_new_id` FOREIGN KEY (`accountID`) REFERENCES `core_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户大事件';
-- Create syntax for TABLE 'core_user_study_plan'
CREATE TABLE `core_user_study_plan`(
`id` INT(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID',
`accountID` int(11) unsigned NOT NULL COMMENT '用户accountID',
`subject` varchar(32) NOT NULL COMMENT '学科(1:计算机)',
`category` varchar(32) NOT NULL COMMENT '类别(1:数据库,2:Node.js,3:源码,4:NPM模块,5:架构,6:JavaScript,7:React,8:HTML+CSS,9:其它)',
`planTime` datetime NOT NULL COMMENT '计划完成时间',
`actualTime` datetime COMMENT '实际完成时间',
`finish` tinyint(2) NOT NULL DEFAULT 0 COMMENT '是否完成(0:未完成,1:完成)',
`cause` varchar(255) COMMENT '未按时完成原因',
`content` varchar(255) NOT NULL COMMENT '学习内容',
`createdTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY(`id`),
KEY `fk_user_study_plan_id` (`accountID`),
CONSTRAINT `fk_study_plan_id` FOREIGN KEY (`accountID`) REFERENCES `core_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户学习计划';
-- Create syntax for TABLE 'core_user_study_experience'
CREATE TABLE `core_user_study_experience`(
`id` INT(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID',
`accountID` int(11) unsigned NOT NULL COMMENT '用户accountID',
`subject` varchar(32) NOT NULL COMMENT '学科(1:计算机)',
`category` varchar(32) NOT NULL COMMENT '类别(1:数据库,2:Node.js,3:源码,4:NPM模块,5:架构,6:JavaScript,7:React,8:HTML+CSS,9:其它)',
`content` varchar(255) NOT NULL COMMENT '学习心得',
`createdTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY(`id`),
KEY `fk_user_study_experience_id` (`accountID`),
CONSTRAINT `fk_user_study_experience_id` FOREIGN KEY (`accountID`) REFERENCES `core_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户学习心得';
| 53.876289 | 118 | 0.755645 |
85b15accf37b1f3dd159492eee4d427d79728fad
| 1,090 |
js
|
JavaScript
|
framework/PVRCore/docs/html/search/enumvalues_a.js
|
senthuran-ukr/Native_SDK
|
2c7f0713cd1af5cb47e2351f83418fa8c7ff49bf
|
[
"MIT"
] | 2 |
2020-11-04T03:57:28.000Z
|
2020-11-04T03:57:33.000Z
|
framework/PVRCore/docs/html/search/enumvalues_a.js
|
senthuran-ukr/Native_SDK
|
2c7f0713cd1af5cb47e2351f83418fa8c7ff49bf
|
[
"MIT"
] | 1 |
2021-02-09T19:06:05.000Z
|
2021-02-09T19:06:05.000Z
|
framework/PVRCore/docs/html/search/enumvalues_a.js
|
senthuran-ukr/Native_SDK
|
2c7f0713cd1af5cb47e2351f83418fa8c7ff49bf
|
[
"MIT"
] | 1 |
2021-12-09T09:49:35.000Z
|
2021-12-09T09:49:35.000Z
|
var searchData=
[
['less',['Less',['../namespacepvr.html#a24a87498f839b45b6e1bc3c8b2ca20fca1cfdf0e8d0c87a228c1f40d9bee7888b',1,'pvr']]],
['lessequal',['LessEqual',['../namespacepvr.html#a24a87498f839b45b6e1bc3c8b2ca20fcad3e6fdac55bb7b0edd7834c968ba1f38',1,'pvr']]],
['linear',['Linear',['../namespacepvr.html#ac7a59f03f943f1c79a5339331fc15abea32a843da6ea40ab3b17a3421ccdf671b',1,'pvr']]],
['linelist',['LineList',['../namespacepvr.html#a95105fe432efbe2b976187f0270b6012a596e1b7afe8925f3f578c716d5af8fef',1,'pvr']]],
['linelistwithadjacency',['LineListWithAdjacency',['../namespacepvr.html#a95105fe432efbe2b976187f0270b6012af951dbe32c0c5d525b8e0ec3884de6c7',1,'pvr']]],
['linestrip',['LineStrip',['../namespacepvr.html#a95105fe432efbe2b976187f0270b6012ae7f9e73b8edd21f420a63b3ace5768a2',1,'pvr']]],
['linestripwithadjacency',['LineStripWithAdjacency',['../namespacepvr.html#a95105fe432efbe2b976187f0270b6012ae6a2093eb583f16122d50acb096af542',1,'pvr']]],
['lrgb',['lRGB',['../namespacepvr.html#a1b94afe6b8a7c21e8f8ddee1f7b5cb91a4c8bf835da6d934b50f620cdd0cc3913',1,'pvr']]]
];
| 90.833333 | 156 | 0.795413 |
b6a87ac8cfef55a30951a35eccb93f0c33f8d424
| 6,784 |
rb
|
Ruby
|
test/unit/user_test.rb
|
doomydoom/tweet_tracker
|
b02583b1b4a55452a1d96f3464f7b6cca1025ce2
|
[
"MIT"
] | 1 |
2016-05-08T20:11:21.000Z
|
2016-05-08T20:11:21.000Z
|
test/unit/user_test.rb
|
doomydoom/tweet_tracker
|
b02583b1b4a55452a1d96f3464f7b6cca1025ce2
|
[
"MIT"
] | null | null | null |
test/unit/user_test.rb
|
doomydoom/tweet_tracker
|
b02583b1b4a55452a1d96f3464f7b6cca1025ce2
|
[
"MIT"
] | null | null | null |
require 'test_helper'
require File.expand_path(File.dirname(__FILE__) + "/../factories/user_factories")
require 'digest/sha2'
class UserTest < ActiveSupport::TestCase
test "Should be invalid without a login" do
@user = Factory.build(:new_user, :login => nil)
assert ! @user.valid?
assert @user.errors.on(:login)
@user.login = 'joeuser'
assert @user.valid?
end
test "Should be invalid without an email" do
@user = Factory.build(:new_user, :email => nil)
assert ! @user.valid?
assert @user.errors.on(:email)
@user.email = 'joeuser@domain.com'
assert @user.valid?
end
test "Should be invalid without a password" do
@user = Factory.build(:new_user, :password => nil)
assert ! @user.valid?
assert @user.errors.on(:password)
@user.password = 'a1b2c3'
assert @user.valid?
end
test "Should be invalid without a password_confirmation" do
@user = Factory.build(:new_user, :password_confirmation => nil)
assert ! @user.valid?
assert @user.errors.on(:password_confirmation)
@user.password_confirmation = 'a1b2c3'
assert @user.valid?
end
test "Should be invalid with too short of a password" do
@user = Factory.build(:new_user)
@user.password = @user.password_confirmation = 'x' * (User::PASSWORD_MIN_LENGTH - 1)
assert ! @user.valid?
assert @user.errors.on(:password)
@user.password = @user.password_confirmation = 'x' * User::PASSWORD_MIN_LENGTH
assert @user.valid?
end
test "Should be invalid with too short a login" do
@user = Factory.build(:new_user)
@user.login = 'x' * (User::LOGIN_MIN_LENGTH - 1)
assert ! @user.valid?
assert @user.errors.on(:login)
@user.login = 'x' * User::LOGIN_MIN_LENGTH
assert @user.valid?
end
test "Should be invalid with too long of a login" do
@user = Factory.build(:new_user)
@user.login = 'x' * (User::LOGIN_MAX_LENGTH + 1)
assert ! @user.valid?
assert @user.errors.on(:login)
@user.login = 'x' * User::LOGIN_MAX_LENGTH
assert @user.valid?
end
test "Should be invalid with an invalidly formatted login" do
@user = Factory.build(:new_user)
@user.login = 'joe-user'
assert ! @user.valid?
assert @user.errors.on(:login)
@user.login = 'joe_user'
assert ! @user.valid?
assert @user.errors.on(:login)
@user.login = 'joeuser'
assert @user.valid?
@user.login = 'JoeUser'
assert @user.valid?
end
test "should not be valid with invalid email format" do
@user = Factory.build(:new_user)
@user.email = 'joeuseratdomain.com'
assert ! @user.valid?
assert @user.errors.on(:email)
assert_equal('must be in the format [user@domain.com]', @user.errors.on(:email))
@user.email = 'joeuser@domaincom'
assert ! @user.valid?
assert @user.errors.on(:email)
assert_equal('must be in the format [user@domain.com]', @user.errors.on(:email))
@user.email = 'joeuser@domain.com'
assert @user.valid?
end
test "should create a salt, and then hash the salt with SHA256" do
@user = User.create!(Factory.attributes_for(:new_user))
assert_not_nil @user.password_salt
assert_equal(64, @user.password_salt.length)
end
test "should create a crypted_password which is a combination of the password and salt" do
@user = User.create!(Factory.attributes_for(:new_user))
expected_crypted_password = Digest::SHA256.hexdigest("--#{@user.password_salt}--#{@user.password}--")
assert_not_nil @user.crypted_password
assert_equal(64, @user.crypted_password.length)
assert_equal(expected_crypted_password, @user.crypted_password)
end
test "should generate a activation_token if email activation is enabled" do
@user = User.create!(Factory.attributes_for(:new_user))
# Since the default email_activation is true, we are sure it's enabled
assert_not_nil @user.activation_token
# Activation token is a SHA256 hash, so it should be 64 chars
assert_equal(64, @user.activation_token.length)
# activated_on should be nil since the user has not been activated
assert_nil @user.activated_at
end
test "should set the activated_at date and leave activation_token nil if email_activation is false" do
@user = Factory.build(:new_user)
Settings.email_activation = false
@user.save
assert_not_nil @user.activated_at
assert_nil @user.activation_token
end
test "should return true if the user is already activated" do
@user = Factory.build(:new_user)
Settings.email_activation = false
@user.save
assert @user.activated?
end
test "should return false if the user is not already activated" do
@user = Factory(:new_user)
assert ! @user.activated?
end
test "should clean the login string before validation" do
@user = Factory(:new_user, :login => ' Joe User ') # This would be invalid normally
assert @user.valid?
assert_equal('joeuser', @user.login)
end
test "should clean the email string before validation" do
@user = Factory(:new_user, :email => ' JoeUser @ Domain.Com ') # should be invalid
assert @user.valid?
assert_equal('joeuser@domain.com', @user.email)
end
test "should strip the spaces before and after the user's password" do
@user = Factory(:new_user, :password => ' a1b2c3 ', :password_confirmation => ' a1b2c3 ')
assert @user.valid?
assert_equal('a1b2c3', @user.password)
assert_equal('a1b2c3', @user.password_confirmation)
end
test "should be invalid if login already exists" do
Factory(:new_user)
@user = Factory.build(:new_user)
assert ! @user.valid?
assert @user.errors.on(:login)
assert_equal('has already been taken', @user.errors.on(:login))
end
test "should be invalid if email already exists" do
Factory(:new_user)
@user = Factory.build(:new_user)
assert ! @user.valid?
assert @user.errors.on(:email)
assert_equal('has already been taken', @user.errors.on(:email))
end
test "should not require a password if the password is not being updated" do
Factory(:new_user)
@user = User.find_by_login('joeuser')
@user.login = 'joeuser2'
@user.save
assert @user.valid?
end
test "should require a password if updating_password is set" do
Factory(:new_user)
@user = User.find_by_login('joeuser')
@user.login = 'joeuser2'
@user.updating_password = true
@user.save
assert ! @user.valid?
assert @user.errors.on(:password)
end
test "should be invalid if password and password_confirmation do not match" do
@user = Factory.build(:new_user, :password_confirmation => 'c1b2a3')
assert ! @user.valid?
assert @user.errors.on(:password)
assert_equal("doesn't match confirmation", @user.errors.on(:password))
end
end
| 34.436548 | 105 | 0.690448 |
b65d37d8b81dcfccaee6c49dba4da0767a9cdfc9
| 151 |
rb
|
Ruby
|
eight_queens.rb
|
johnobrien8642/queen-puzzle
|
7c840c8cf72e779293d6a97cf5a267a2f9970531
|
[
"MIT"
] | null | null | null |
eight_queens.rb
|
johnobrien8642/queen-puzzle
|
7c840c8cf72e779293d6a97cf5a267a2f9970531
|
[
"MIT"
] | 5 |
2020-07-20T14:20:30.000Z
|
2020-11-07T00:03:33.000Z
|
eight_queens.rb
|
johnobrien8642/queen-puzzle
|
7c840c8cf72e779293d6a97cf5a267a2f9970531
|
[
"MIT"
] | 2 |
2020-07-21T18:04:58.000Z
|
2020-07-21T18:17:06.000Z
|
require_relative "lib/console_printer"
require_relative "lib/brute_force_solver"
grid = BruteForceSolver.new(5).solve
ConsolePrinter.new(grid).print
| 21.571429 | 41 | 0.834437 |
0bdf516531d721be675a93f579029d65351cd4e6
| 349 |
lua
|
Lua
|
examples/tcp_client.lua
|
ljatsh/luv
|
bc5ca5b0f325fb5449cc42ae9928f92442509fed
|
[
"Apache-2.0"
] | null | null | null |
examples/tcp_client.lua
|
ljatsh/luv
|
bc5ca5b0f325fb5449cc42ae9928f92442509fed
|
[
"Apache-2.0"
] | null | null | null |
examples/tcp_client.lua
|
ljatsh/luv
|
bc5ca5b0f325fb5449cc42ae9928f92442509fed
|
[
"Apache-2.0"
] | null | null | null |
local luv = require("luv")
local host = luv.net.getaddrinfo("www.baidu.com")
local sock = luv.net.tcp()
print("conn:", sock:connect(host, 80))
print("write:", sock:write("GET / HTTP/1.0\r\nHost: www.baidu.com\r\n\r\n"))
repeat
local count, data = sock:read()
if not count then
print(data)
break
end
print(count, data)
until false
| 21.8125 | 76 | 0.661891 |
b4230a2f99e49d412acc8e9b45e8c6f1111a14b8
| 390 |
kt
|
Kotlin
|
app/src/main/java/com/srg/codetestrickmorty/domain/features/characters/CharactersRepository.kt
|
sebrodgar/code-test-rick-morty
|
dfb2f16f8d12809bc97f17cbe4a267df46bf3ffa
|
[
"Apache-2.0"
] | null | null | null |
app/src/main/java/com/srg/codetestrickmorty/domain/features/characters/CharactersRepository.kt
|
sebrodgar/code-test-rick-morty
|
dfb2f16f8d12809bc97f17cbe4a267df46bf3ffa
|
[
"Apache-2.0"
] | null | null | null |
app/src/main/java/com/srg/codetestrickmorty/domain/features/characters/CharactersRepository.kt
|
sebrodgar/code-test-rick-morty
|
dfb2f16f8d12809bc97f17cbe4a267df46bf3ffa
|
[
"Apache-2.0"
] | null | null | null |
package com.srg.codetestrickmorty.domain.features.characters
import androidx.paging.PagingData
import com.srg.codetestrickmorty.domain.features.characters.models.CharacterDomainModel
import kotlinx.coroutines.flow.Flow
interface CharactersRepository {
fun getAllCharacters(): Flow<PagingData<CharacterDomainModel>>
suspend fun addCharacterFav(isFav: Boolean, characterId: Long)
}
| 35.454545 | 87 | 0.841026 |
501cf2c50053933c3fdfd2a4a921ec31a10d1a9c
| 10,870 |
go
|
Go
|
lobby-sdk/pkg/lobbyclient/operations/admin_update_party_attributes_v1_responses.go
|
AccelByte/accelbyte-services-api
|
6e7246d1d3e5bc92bf283fca8692b4196a950f9b
|
[
"MIT"
] | 3 |
2021-09-23T13:34:34.000Z
|
2022-02-10T06:35:48.000Z
|
lobby-sdk/pkg/lobbyclient/operations/admin_update_party_attributes_v1_responses.go
|
AccelByte/accelbyte-services-api
|
6e7246d1d3e5bc92bf283fca8692b4196a950f9b
|
[
"MIT"
] | null | null | null |
lobby-sdk/pkg/lobbyclient/operations/admin_update_party_attributes_v1_responses.go
|
AccelByte/accelbyte-services-api
|
6e7246d1d3e5bc92bf283fca8692b4196a950f9b
|
[
"MIT"
] | 3 |
2021-07-19T04:52:57.000Z
|
2021-09-23T05:26:09.000Z
|
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"io/ioutil"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/AccelByte/accelbyte-go-sdk/lobby-sdk/pkg/lobbyclientmodels"
)
// AdminUpdatePartyAttributesV1Reader is a Reader for the AdminUpdatePartyAttributesV1 structure.
type AdminUpdatePartyAttributesV1Reader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AdminUpdatePartyAttributesV1Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAdminUpdatePartyAttributesV1OK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewAdminUpdatePartyAttributesV1BadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewAdminUpdatePartyAttributesV1Unauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewAdminUpdatePartyAttributesV1Forbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 404:
result := NewAdminUpdatePartyAttributesV1NotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 412:
result := NewAdminUpdatePartyAttributesV1PreconditionFailed()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 500:
result := NewAdminUpdatePartyAttributesV1InternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
data, err := ioutil.ReadAll(response.Body())
if err != nil {
return nil, err
}
return nil, fmt.Errorf("Requested PUT /lobby/v1/admin/party/namespaces/{namespace}/parties/{partyId}/attributes returns an error %d: %s", response.Code(), string(data))
}
}
// NewAdminUpdatePartyAttributesV1OK creates a AdminUpdatePartyAttributesV1OK with default headers values
func NewAdminUpdatePartyAttributesV1OK() *AdminUpdatePartyAttributesV1OK {
return &AdminUpdatePartyAttributesV1OK{}
}
/*AdminUpdatePartyAttributesV1OK handles this case with default header values.
OK
*/
type AdminUpdatePartyAttributesV1OK struct {
Payload *lobbyclientmodels.ModelsPartyData
}
func (o *AdminUpdatePartyAttributesV1OK) Error() string {
return fmt.Sprintf("[PUT /lobby/v1/admin/party/namespaces/{namespace}/parties/{partyId}/attributes][%d] adminUpdatePartyAttributesV1OK %+v", 200, o.Payload)
}
func (o *AdminUpdatePartyAttributesV1OK) GetPayload() *lobbyclientmodels.ModelsPartyData {
return o.Payload
}
func (o *AdminUpdatePartyAttributesV1OK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(lobbyclientmodels.ModelsPartyData)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAdminUpdatePartyAttributesV1BadRequest creates a AdminUpdatePartyAttributesV1BadRequest with default headers values
func NewAdminUpdatePartyAttributesV1BadRequest() *AdminUpdatePartyAttributesV1BadRequest {
return &AdminUpdatePartyAttributesV1BadRequest{}
}
/*AdminUpdatePartyAttributesV1BadRequest handles this case with default header values.
Bad Request
*/
type AdminUpdatePartyAttributesV1BadRequest struct {
Payload *lobbyclientmodels.RestapiErrorResponseBody
}
func (o *AdminUpdatePartyAttributesV1BadRequest) Error() string {
return fmt.Sprintf("[PUT /lobby/v1/admin/party/namespaces/{namespace}/parties/{partyId}/attributes][%d] adminUpdatePartyAttributesV1BadRequest %+v", 400, o.Payload)
}
func (o *AdminUpdatePartyAttributesV1BadRequest) GetPayload() *lobbyclientmodels.RestapiErrorResponseBody {
return o.Payload
}
func (o *AdminUpdatePartyAttributesV1BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(lobbyclientmodels.RestapiErrorResponseBody)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAdminUpdatePartyAttributesV1Unauthorized creates a AdminUpdatePartyAttributesV1Unauthorized with default headers values
func NewAdminUpdatePartyAttributesV1Unauthorized() *AdminUpdatePartyAttributesV1Unauthorized {
return &AdminUpdatePartyAttributesV1Unauthorized{}
}
/*AdminUpdatePartyAttributesV1Unauthorized handles this case with default header values.
Unauthorized
*/
type AdminUpdatePartyAttributesV1Unauthorized struct {
Payload *lobbyclientmodels.RestapiErrorResponseBody
}
func (o *AdminUpdatePartyAttributesV1Unauthorized) Error() string {
return fmt.Sprintf("[PUT /lobby/v1/admin/party/namespaces/{namespace}/parties/{partyId}/attributes][%d] adminUpdatePartyAttributesV1Unauthorized %+v", 401, o.Payload)
}
func (o *AdminUpdatePartyAttributesV1Unauthorized) GetPayload() *lobbyclientmodels.RestapiErrorResponseBody {
return o.Payload
}
func (o *AdminUpdatePartyAttributesV1Unauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(lobbyclientmodels.RestapiErrorResponseBody)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAdminUpdatePartyAttributesV1Forbidden creates a AdminUpdatePartyAttributesV1Forbidden with default headers values
func NewAdminUpdatePartyAttributesV1Forbidden() *AdminUpdatePartyAttributesV1Forbidden {
return &AdminUpdatePartyAttributesV1Forbidden{}
}
/*AdminUpdatePartyAttributesV1Forbidden handles this case with default header values.
Forbidden
*/
type AdminUpdatePartyAttributesV1Forbidden struct {
Payload *lobbyclientmodels.RestapiErrorResponseBody
}
func (o *AdminUpdatePartyAttributesV1Forbidden) Error() string {
return fmt.Sprintf("[PUT /lobby/v1/admin/party/namespaces/{namespace}/parties/{partyId}/attributes][%d] adminUpdatePartyAttributesV1Forbidden %+v", 403, o.Payload)
}
func (o *AdminUpdatePartyAttributesV1Forbidden) GetPayload() *lobbyclientmodels.RestapiErrorResponseBody {
return o.Payload
}
func (o *AdminUpdatePartyAttributesV1Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(lobbyclientmodels.RestapiErrorResponseBody)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAdminUpdatePartyAttributesV1NotFound creates a AdminUpdatePartyAttributesV1NotFound with default headers values
func NewAdminUpdatePartyAttributesV1NotFound() *AdminUpdatePartyAttributesV1NotFound {
return &AdminUpdatePartyAttributesV1NotFound{}
}
/*AdminUpdatePartyAttributesV1NotFound handles this case with default header values.
Not Found
*/
type AdminUpdatePartyAttributesV1NotFound struct {
Payload *lobbyclientmodels.RestapiErrorResponseBody
}
func (o *AdminUpdatePartyAttributesV1NotFound) Error() string {
return fmt.Sprintf("[PUT /lobby/v1/admin/party/namespaces/{namespace}/parties/{partyId}/attributes][%d] adminUpdatePartyAttributesV1NotFound %+v", 404, o.Payload)
}
func (o *AdminUpdatePartyAttributesV1NotFound) GetPayload() *lobbyclientmodels.RestapiErrorResponseBody {
return o.Payload
}
func (o *AdminUpdatePartyAttributesV1NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(lobbyclientmodels.RestapiErrorResponseBody)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAdminUpdatePartyAttributesV1PreconditionFailed creates a AdminUpdatePartyAttributesV1PreconditionFailed with default headers values
func NewAdminUpdatePartyAttributesV1PreconditionFailed() *AdminUpdatePartyAttributesV1PreconditionFailed {
return &AdminUpdatePartyAttributesV1PreconditionFailed{}
}
/*AdminUpdatePartyAttributesV1PreconditionFailed handles this case with default header values.
Precondition Failed
*/
type AdminUpdatePartyAttributesV1PreconditionFailed struct {
Payload *lobbyclientmodels.RestapiErrorResponseBody
}
func (o *AdminUpdatePartyAttributesV1PreconditionFailed) Error() string {
return fmt.Sprintf("[PUT /lobby/v1/admin/party/namespaces/{namespace}/parties/{partyId}/attributes][%d] adminUpdatePartyAttributesV1PreconditionFailed %+v", 412, o.Payload)
}
func (o *AdminUpdatePartyAttributesV1PreconditionFailed) GetPayload() *lobbyclientmodels.RestapiErrorResponseBody {
return o.Payload
}
func (o *AdminUpdatePartyAttributesV1PreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(lobbyclientmodels.RestapiErrorResponseBody)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAdminUpdatePartyAttributesV1InternalServerError creates a AdminUpdatePartyAttributesV1InternalServerError with default headers values
func NewAdminUpdatePartyAttributesV1InternalServerError() *AdminUpdatePartyAttributesV1InternalServerError {
return &AdminUpdatePartyAttributesV1InternalServerError{}
}
/*AdminUpdatePartyAttributesV1InternalServerError handles this case with default header values.
Internal Server Error
*/
type AdminUpdatePartyAttributesV1InternalServerError struct {
Payload *lobbyclientmodels.RestapiErrorResponseBody
}
func (o *AdminUpdatePartyAttributesV1InternalServerError) Error() string {
return fmt.Sprintf("[PUT /lobby/v1/admin/party/namespaces/{namespace}/parties/{partyId}/attributes][%d] adminUpdatePartyAttributesV1InternalServerError %+v", 500, o.Payload)
}
func (o *AdminUpdatePartyAttributesV1InternalServerError) GetPayload() *lobbyclientmodels.RestapiErrorResponseBody {
return o.Payload
}
func (o *AdminUpdatePartyAttributesV1InternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(lobbyclientmodels.RestapiErrorResponseBody)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
| 35.064516 | 175 | 0.80092 |
c61eeeb0449492479692c6bc93823072da7a0535
| 217 |
rb
|
Ruby
|
test/vcr_setup.rb
|
dvci/iis-shc-issuer
|
7958f6806c4e5157bb6082b2ea3308f72536ce54
|
[
"Apache-2.0"
] | 2 |
2021-07-27T13:22:29.000Z
|
2021-09-03T07:41:53.000Z
|
test/vcr_setup.rb
|
cronkllr/iis-shc-issuer
|
03b4ba6eb6bca304e483e4308f063dff18da10b8
|
[
"Apache-2.0"
] | 4 |
2021-08-04T20:51:42.000Z
|
2021-11-10T15:19:55.000Z
|
test/vcr_setup.rb
|
cronkllr/iis-shc-issuer
|
03b4ba6eb6bca304e483e4308f063dff18da10b8
|
[
"Apache-2.0"
] | 1 |
2021-09-03T07:39:32.000Z
|
2021-09-03T07:39:32.000Z
|
require 'vcr'
VCR.configure do |config|
config.cassette_library_dir = 'test/vcr_cassettes/iis_shc_issuer'
config.hook_into :webmock
config.default_cassette_options = { match_requests_on: [:method, :path] }
end
| 27.125 | 75 | 0.778802 |
f03dcba898ec552a2f7c60986bdb27f4d98d95f4
| 986 |
js
|
JavaScript
|
kasa/Server/routes/api/Image.js
|
starlenj/sirket_siparis
|
5e45821a3f1b14801b621c2a91d67729eeb3e9f7
|
[
"MIT"
] | null | null | null |
kasa/Server/routes/api/Image.js
|
starlenj/sirket_siparis
|
5e45821a3f1b14801b621c2a91d67729eeb3e9f7
|
[
"MIT"
] | null | null | null |
kasa/Server/routes/api/Image.js
|
starlenj/sirket_siparis
|
5e45821a3f1b14801b621c2a91d67729eeb3e9f7
|
[
"MIT"
] | null | null | null |
const expres = require('express')
const route = expres.Router()
const multer = require('multer')
const path = require('path')
const fileFilter = (req, file, cb) => {
const allwedTypes = ["image/jpeg", "image/png"]
if (!allwedTypes.includes(file.mimetype)) {
const error = new Error("Desteklenmeyen Dosya Türü")
error.code = "LIMIT_FILE_TYPES"
return cb(error, false);
}
cb(null, true)
}
const storage = multer.diskStorage({
destination: 'C:/inetpub/wwwroot/Hmbrgr/assets/Upload',
filename: function (req, file, cb) {
cb(null, Date.now() + path.extname(file.originalname)) //Appending extension
}
})
const upload = multer({
dest: './Public/Images/',
fileFilter,
storage: storage,
limits: {
fileSize: 100000000
}
})
// @router POST api/Category
// @desc Create a Category
// @access Public
route.post('/', upload.single('file'), (req, res) => {
res.send(req.file)
})
module.exports = route
| 24.65 | 84 | 0.634888 |
f1cf83410b8a5d4a579eebaf312a5d015ed272e8
| 15,621 |
rb
|
Ruby
|
server/WAPI.rb
|
tl-its-umich-edu/StudentDashboard
|
eaaef3a834dd0fce164feea7ebe7bb7706c129ea
|
[
"Apache-2.0"
] | 1 |
2018-11-02T19:53:42.000Z
|
2018-11-02T19:53:42.000Z
|
server/WAPI.rb
|
tl-its-umich-edu/StudentDashboard
|
eaaef3a834dd0fce164feea7ebe7bb7706c129ea
|
[
"Apache-2.0"
] | 99 |
2015-01-29T15:22:52.000Z
|
2018-04-09T17:36:04.000Z
|
server/WAPI.rb
|
tl-its-umich-edu/StudentDashboard
|
eaaef3a834dd0fce164feea7ebe7bb7706c129ea
|
[
"Apache-2.0"
] | 4 |
2015-04-30T18:13:03.000Z
|
2016-06-15T20:37:35.000Z
|
# Utility class to run requests against a WSO2 API.
# This has two entry points of interest:
# Constructor: new(hash)
# The hash should contain the following values:
# 'token_server','api_prefix','key','secret'
# It may contain the current token value but does not need to
# since WAPI will renew tokens as necessary.
# get_request(string): This string will be appended to the api_prefix and
# executed as a GET
# See the WAPI_result_wrapper class code for the output format. The data for a request
# is expected to be returned as a JSON string.
# Only GET is explicitly supported at the moment. (Internally it also uses a POST to renew tokens.)
require 'base64'
require 'rest-client'
require "link_header"
require_relative './Logging'
require_relative './WAPI_result_wrapper'
require_relative './WAPI_status'
require_relative './stopwatch'
## For detailed tracing set this to anything but FalseClass
TRACE=FalseClass
include Logging
class WAPI
# The application provides the values required to make a connection
# to the WSO2 ESB. The key and secret are oauth key and secret for generating tokens.
# The token_server is full url for request to generate / renew tokens.
#
# The api_prefix is string that will be prefixed to every request made
# through this instance. It will contain host and anything else
# that will appear in front of every request. E.g. It might contain
# https://woodpigeon.dsc.umich.edu:8243/StudentDashboard/v1 or just
# https://woodpigeon.dsc.umich.edu:8243 depending on how you choose
# to use it.
def initialize(application)
if application.nil?
msg = "No ESB Application values provided to WAPI initialize"
logger.warn msg
raise StandardError, msg
end
logger.debug("application: #{application}")
@token_server = application['token_server']
@api_prefix = application['api_prefix']
@key = application['key']
@secret = application['secret']
@token = application['token']
# # added for IBM Api manager
# # client_id and client_secret will be key and secret
@scope = application['scope']
@grant_type = application['grant_type']
#
if (@scope.nil?)
logger.error("missing value: scope")
raise "WAPI: missing value: scope"
end
if (@grant_type.nil?)
logger.error("missing value: grant_type") if (@grant_type.nil?)
raise "WAPI: missing value: grant_type"
end
#
# ## special uniqname may be supplied for testing
@uniqname = application['uniqname']
#
@renewal = WAPI.build_renewal(@key, @secret)
logger.info("#{self.class.to_s}:#{__method__}:#{__LINE__}: initialized WAPI with #{@api_prefix}")
end
def self.build_renewal(key, secret)
b64 = base64_key_secret(key, secret)
"Basic #{b64}"
end
def self.base64_key_secret(key, secret)
ks = "#{key}:#{secret}"
Base64.strict_encode64(ks)
end
######### utilities for URL formatting
# use instance specific configuration information to generate the full url.
def format_url(request)
"#{@api_prefix}#{request}"
end
# Responses may contain partial results. In that case information about how to get the remaining data is returned
# in the 'Link' header. Link headers come back with explicit URLs pointing to Canvas servers.
# Remove that server added by the external service since we need to send queries back through the ESB rather than
# straight to the external service.
# This code assumes that the main portion of the next link (more_url) looks like the original request except that
# the beginning may be different (e.g. direct to canvas host vs through the ESB proxy) and the query parameters
# may be different (e.g. maybe add info about where to restart retrieval).
# A trivial more_url should become an empty string.
# Query parameters on the more_url should be passed through.
# Query parameters on the request_string should be ignored.
# The more_url is a complete URL that was returned from the external service. The
# request_string it the partial url generated internally that doesn't have any explicit server / api
# version information.
def reduce_url(more_url, request_string)
logger.debug "#{self.class.to_s}:#{__method__}:#{__LINE__}: more_url: #{more_url} request_string: #{request_string}"
return "" if more_url.nil? || more_url.length == 0
# Get the main part of the original request without any query parameters.
main_request = request_string.index('?') ? request_string[/(^.+)\?/] : request_string
# Pull out the part of more_url that matches the original query and also pull along query parameters that were
# supplied in the more_url.
more_url = more_url[/#{main_request}.*/]
logger.debug "#{self.class.to_s}:#{__method__}:#{__LINE__}: reduced more_url: #{more_url}"
more_url
end
# Make a request to an external service and handle error conditions and headers.
def do_request(request_string)
RestClient.log = logger if (logger.debug? and TRACE != FalseClass)
# make the request specific to the separately configured API.
url=format_url(request_string)
logger.debug "#{self.class.to_s}:#{__method__}:#{__LINE__}: url: #{url}"
r = Stopwatch.new(Thread.current.to_s+": "+url)
r.start
begin
response = RestClient.get url, {:Authorization => "Bearer #{@token}",
'x-ibm-client-id' => @key,
:accept => :json,
:verify_ssl => true}
# If the request has more data pull out the external url to get it.
more_url = process_link_header(response)
# fix it up to go through our proxy.
more_url = reduce_url(more_url, request_string)
## try to parse as json. If can't do that generate an error.
json_response = JSON.parse(response)
## json_response is a JSON object. Only print part of it.
logger.debug "#{self.class.to_s}:#{__method__}:#{__LINE__}: esb response as json"+JSON.generate(json_response)[0..30]
# fix up the json a bit.
json_response = standardize_json(json_response, response)
####### Now we have a parsed json object
# figure out the overall response code for the request. That may come from the esb call or data returned
# from the request url
rc = compute_response_code_to_return(json_response, response)
## We have parsed JSON, now make it a json string so it can be returned
json_response = JSON.generate(json_response)
wrapped_response = WAPIResultWrapper.new(rc, "COMPLETED", json_response, more_url)
### handle some error conditions explicitly.
rescue URI::InvalidURIError => exp
logger.debug "#{self.class.to_s}:#{__method__}:#{__LINE__}: invalid URI: "+exp.to_s
wrapped_response = WAPIResultWrapper.new(WAPIStatus::BAD_REQUEST, "INVALID URL", exp.to_s)
rescue StandardError => exp
logger.debug "#{self.class.to_s}:#{__method__}:#{__LINE__}: exception: "+exp.inspect
if exp.response.code == WAPIStatus::HTTP_NOT_FOUND
wrapped_response = WAPIResultWrapper.new(WAPIStatus::HTTP_NOT_FOUND, "NOT FOUND", exp)
else
wrapped_response = WAPIResultWrapper.new(WAPIStatus::UNKNOWN_ERROR, "EXCEPTION", exp)
end
end
r.stop
logger.info "#{self.class.to_s}:#{__method__}:#{__LINE__}:do_request: stopwatch: "+ r.pretty_summary
wrapped_response
end
# A response may provide link headers that indicate the data returned is partial and more is available if you
# use the 'next' url provided. Get that link and log some information so we can track this.
def process_link_header(response)
linkheader = LinkHeader.parse(response.headers[:link]).to_a
next_link, last_link = nil, nil
#### extract the interesting header links
linkheader.each { |link|
next_link ||= header_link_for_rel(link, 'next')
last_link ||= header_link_for_rel(link, 'last')
}
# If there is more data on another page log that.
if !next_link.nil?
page_estimate = ""
# Log last_page and per_page values from the 'last' url so can get rough estimate of total number of
# entries for query. Note: We use the page/per_page information because it turns out that Canvas puts that
# in the URL. However that isn't a standard and we shouldn't rely on it for processing.
if !last_link.nil?
p = Regexp.new(/page=(\d+)&per_page=(\d+)/)
p.match(last_link)
last_page, per_page = $1, $2
page_estimate = "last_page: #{last_page} page_size: #{per_page} "
end
logger.warn "#{self.class.to_s}:#{__method__}:#{__LINE__}: pagination: #{page_estimate} next_link: #{next_link}"
end
# return the raw next link (or an empty string)
next_link.nil? ? "" : next_link
end
# Utility to extract URL for the desired link type from the full link header.
def header_link_for_rel(link, desired)
link[1][0][1] == desired ? link[0] : nil
end
## detailed dump of response object
def dump_json_object(json_response, response)
logger.debug "#{self.class.to_s}:#{__method__}:#{__LINE__}: after initial parse"
logger.info "#{self.class.to_s}:#{__method__}:#{__LINE__}: response.code: "+json_response[response.code].to_s
end
## Figure out the response status code to return. It might be from the response body or from the RestClient response.
def compute_response_code_to_return(j, response)
# default to the restClient value
rc = response.code
if Hash.try_convert(j)
# if the whole thing in an error response then pull out the contents
# of the error response.
if j.has_key?('ErrorResponse')
j=j['ErrorResponse']
end
# if there is a nested response code then use that.
if j.has_key?('responseCode')
rc = j['responseCode']
end
end
logger.debug "#{self.class.to_s}:#{__method__}:#{__LINE__}: use response code: [#{rc}]"
rc
end
## Fix up the json a bit.
def standardize_json(j, response)
# if there is a nested response code then make sure it is an integer.
begin
if (!j.kind_of?(Array) && j.has_key?('responseCode'))
# returned value may have a response code element that needs to be converted to an integer
j['responseCode'] = j['responseCode'].to_i
end
rescue => err
logger.info "#{self.class.to_s}:#{__method__}:#{__LINE__}: conversion error "+j.inspect
# because of the error reset j back to the original json response.
j = JSON.parse(response)
end
j
end
# Entry point to make the URL request. It may end up making multiple calls to do_request since
# it may need to deal with authorization / token renewal and with big requests that make
# many calls in order to get a complete data set.
# In any case will return a WAPI wrapper result.
def get_request(request)
wrapped_response = do_request(request)
logger.debug "#{self.class.to_s}:#{__method__}:#{__LINE__}: initial request: "+request.to_s
## If required try to renew the token and redo the request.
if wrapped_response.meta_status == WAPIStatus::UNKNOWN_ERROR &&
wrapped_response.result.respond_to?('http_code') &&
wrapped_response.result.http_code == WAPIStatus::HTTP_UNAUTHORIZED
wrapped_response = renew_token()
## if the token renewed ok then try the request again.
if wrapped_response.meta_status == WAPIStatus::SUCCESS
wrapped_response = do_request(request)
end
end
# If it didn't work just return that information.
logger.debug "#{self.class.to_s}:#{__method__}:#{__LINE__}: wrapped_response: meta_status: #{wrapped_response.meta_status}"
if wrapped_response.meta_status != WAPIStatus::SUCCESS
return wrapped_response
end
## Ran a query successfully. See if got partial data and need to keep going.
logger.debug "#{self.class.to_s}:#{__method__}:#{__LINE__}: wrapped_response: data length: #{wrapped_response.result.length}"
# See if there is a link header, if so get the rest of the data.
if wrapped_response.meta_more.length > 0
logger.debug "#{self.class.to_s}:#{__method__}:#{__LINE__}: found link header: >>#{wrapped_response.meta_more}<<"
more_data = get_request(wrapped_response.meta_more)
logger.debug "#{self.class.to_s}:#{__method__}:#{__LINE__}: more_data status: #{more_data.meta}"
if more_data.meta_status == WAPIStatus::SUCCESS
logger.debug "#{self.class.to_s}:#{__method__}:#{__LINE__}: will merge data: initial wrapped_response: #{wrapped_response.result.length} more_data: #{more_data.result.length}"
wrapped_response = wrapped_response.append_json_results(more_data)
else
logger.error "#{self.class.to_s}:#{__method__}:#{__LINE__}: can not merge more_data: #{more_data.inspect}"
end
end
logger.debug "#{self.class.to_s}:#{__method__}:#{__LINE__}: final wrapped_response: result length: #{wrapped_response.result.length}"
wrapped_response
end
# Renew the current token. Will set the current @token value in the object
def renew_token
begin
logger.info("#{self.class.to_s}:#{__method__}:#{__LINE__}: token_server: #{@token_server}")
response = runTokenRenewalPost
## If it worked then parse the result as json. This is here to capture any JSON parsing exceptions.
if response.code == WAPIStatus::HTTP_SUCCESS
## will need to get the access_token below. If it is not JSON that is an error.
s = JSON.parse(response)
@token = s['access_token']
end
rescue Exception => exp
# If got an exception for the renewal then wrap that up to be returned.
logger.warn("#{self.class.to_s}:#{__method__}:#{__LINE__}: renewal post exception: "+exp.to_json)
logger.warn("#{self.class.to_s}:#{__method__}:#{__LINE__}: renewal post exception: "+exp.to_json+":"+exp.http_code.to_s)
return WAPIResultWrapper.new(exp.http_code, "EXCEPTION DURING TOKEN RENEWAL", exp)
end
## got no response so say that.
if response.nil?
logger.warn("#{self.class.to_s}:#{__method__}:#{__LINE__}: error renewing token: nil response ")
return WAPIResultWrapper.new(WAPIStatus::UNKNOWN_ERROR, "error renewing token: nil response", response)
end
# if got an error so say that.
if response.code != WAPIStatus::HTTP_SUCCESS
logger.warn("#{self.class.to_s}:#{__method__}:#{__LINE__}: error renewing token: response code: "+response.code)
return WAPIResultWrapper.new(WAPIStatus::UNKNOWN_ERROR, "error renewing token: response code", response)
end
# all ok
print_token = sprintf "%5s", @token
logger.debug("#{self.class.to_s}:#{__method__}:#{__LINE__}: renewed token: #{print_token}")
return WAPIResultWrapper.new(WAPIStatus::SUCCESS, "token renewed", response)
end
## Uses global class instance variables for these values for now
def runTokenRenewalPost
msg = Thread.current.to_s
renew = Stopwatch.new(msg)
renew.start
payload = "grant_type=#{@grant_type}&scope=#{@scope}&client_id=#{@key}&client_secret=#{@secret}"
response = RestClient.post @token_server,
payload,
{
:content_type => "application/x-www-form-urlencoded"
}
ensure
# make sure to print the elapsed time for the renewal.
renew.stop
logger.info("WAPI: renew token post: stopwatch: "+renew.pretty_summary)
end
end
| 42.44837 | 184 | 0.690417 |
307d40bbdcac4f0670d5510a7d893f3b75e84511
| 90,197 |
html
|
HTML
|
recodoc2/testdata/hib35doc/querysql.html
|
bartdag/recodoc2
|
592c90fdd8e5bd8f9cbb3229771731294f4a1fba
|
[
"BSD-3-Clause"
] | 9 |
2015-06-16T01:20:02.000Z
|
2022-01-16T02:36:59.000Z
|
recodoc2/testdata/hib35doc/querysql.html
|
xwyangjshb/recodoc2
|
592c90fdd8e5bd8f9cbb3229771731294f4a1fba
|
[
"BSD-3-Clause"
] | null | null | null |
recodoc2/testdata/hib35doc/querysql.html
|
xwyangjshb/recodoc2
|
592c90fdd8e5bd8f9cbb3229771731294f4a1fba
|
[
"BSD-3-Clause"
] | 4 |
2019-10-20T10:10:34.000Z
|
2022-01-16T02:36:51.000Z
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory">Chapter 17. Native SQL</title><link rel="stylesheet" href="css/hibernate.css" type="text/css"/><meta xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" name="generator" content="DocBook XSL Stylesheets V1.74.0"/><link rel="home" href="index.html" title="HIBERNATE - Relational Persistence for Idiomatic Java"/><link rel="up" href="index.html" title="HIBERNATE - Relational Persistence for Idiomatic Java"/><link rel="prev" href="querycriteria.html" title="Chapter 16. Criteria Queries"/><link rel="next" href="filters.html" title="Chapter 18. Filtering data"/><link rel="copyright" href="Legal_Notice.html" title="Legal Notice"/></head><body><p id="title"><a href="http://www.hibernate.org" class="site_href"><strong>Hibernate.org</strong></a><a href="http://hibernate.org/Documentation/DocumentationOverview" class="doc_href"><strong>Community Documentation</strong></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="querycriteria.html"><strong>Prev</strong></a></li><li class="next"><a accesskey="n" href="filters.html"><strong>Next</strong></a></li></ul><div class="chapter" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="querysql"/>Chapter 17. Native SQL</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="querysql.html#querysql-creating">17.1. Using a SQLQuery</a></span></dt><dd><dl><dt><span class="section"><a href="querysql.html#d0e14208">17.1.1. Scalar queries</a></span></dt><dt><span class="section"><a href="querysql.html#d0e14258">17.1.2. Entity queries</a></span></dt><dt><span class="section"><a href="querysql.html#d0e14294">17.1.3. Handling associations and collections</a></span></dt><dt><span class="section"><a href="querysql.html#d0e14325">17.1.4. Returning multiple entities</a></span></dt><dt><span class="section"><a href="querysql.html#d0e14466">17.1.5. Returning non-managed entities</a></span></dt><dt><span class="section"><a href="querysql.html#d0e14487">17.1.6. Handling inheritance</a></span></dt><dt><span class="section"><a href="querysql.html#d0e14492">17.1.7. Parameters</a></span></dt></dl></dd><dt><span class="section"><a href="querysql.html#querysql-namedqueries">17.2. Named SQL queries</a></span></dt><dd><dl><dt><span class="section"><a href="querysql.html#propertyresults">17.2.1. Using return-property to explicitly specify column/alias
names</a></span></dt><dt><span class="section"><a href="querysql.html#sp_query">17.2.2. Using stored procedures for querying</a></span></dt></dl></dd><dt><span class="section"><a href="querysql.html#querysql-cud">17.3. Custom SQL for create, update and delete</a></span></dt><dt><span class="section"><a href="querysql.html#querysql-load">17.4. Custom SQL for loading</a></span></dt></dl></div><p>You can also express queries in the native SQL dialect of your
database. This is useful if you want to utilize database-specific features
such as query hints or the <code class="literal">CONNECT</code> keyword in Oracle. It
also provides a clean migration path from a direct SQL/JDBC based
application to Hibernate.</p><p>Hibernate3 allows you to specify handwritten SQL, including stored
procedures, for all create, update, delete, and load operations.</p><div class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="querysql-creating"/>17.1. Using a <code class="literal">SQLQuery</code></h2></div></div></div><p>Execution of native SQL queries is controlled via the
<code class="literal">SQLQuery</code> interface, which is obtained by calling
<code class="literal">Session.createSQLQuery()</code>. The following sections describe how
to use this API for querying.</p><div class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="d0e14208"/>17.1.1. Scalar queries</h3></div></div></div><p>The most basic SQL query is to get a list of scalars
(values).</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="JAVA"><!-- <br/> --><span class="java_plain">sess</span><!-- <br/> --><span class="java_separator">.</span><!-- <br/> --><span class="java_plain">createSQLQuery</span><!-- <br/> --><span class="java_separator">(</span><!-- <br/> --><span class="java_literal">"SELECT * FROM CATS"</span><!-- <br/> --><span class="java_separator">).</span><!-- <br/> --><span class="java_plain">list</span><!-- <br/> --><span class="java_separator">();</span>
<!-- --><br/><span class="java_plain">sess</span><span class="java_separator">.</span><span class="java_plain">createSQLQuery</span><span class="java_separator">(</span><span class="java_literal">"SELECT ID, NAME, BIRTHDATE FROM CATS"</span><span class="java_separator">).</span><span class="java_plain">list</span><span class="java_separator">();</span>
</pre><p>These will return a List of Object arrays (Object[]) with
scalar values for each column in the CATS table. Hibernate will use
ResultSetMetadata to deduce the actual order and types of the returned
scalar values.</p><p>To avoid the overhead of using
<code class="literal">ResultSetMetadata</code>, or simply to be more explicit in
what is returned, one can use <code class="literal">addScalar()</code>:</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="JAVA"><!-- <br/> --><span class="java_plain">sess</span><!-- <br/> --><span class="java_separator">.</span><!-- <br/> --><span class="java_plain">createSQLQuery</span><!-- <br/> --><span class="java_separator">(</span><!-- <br/> --><span class="java_literal">"SELECT * FROM CATS"</span><!-- <br/> --><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">addScalar</span><span class="java_separator">(</span><span class="java_literal">"ID"</span><span class="java_separator">,</span><span class="java_plain"> </span><span class="java_type">Hibernate</span><span class="java_separator">.</span><span class="java_plain">LONG</span><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">addScalar</span><span class="java_separator">(</span><span class="java_literal">"NAME"</span><span class="java_separator">,</span><span class="java_plain"> </span><span class="java_type">Hibernate</span><span class="java_separator">.</span><span class="java_plain">STRING</span><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">addScalar</span><span class="java_separator">(</span><span class="java_literal">"BIRTHDATE"</span><span class="java_separator">,</span><span class="java_plain"> </span><span class="java_type">Hibernate</span><span class="java_separator">.</span><span class="java_plain">DATE</span><span class="java_separator">)</span>
</pre><p>This query specified:</p><div class="itemizedlist"><ul><li><p>the SQL query string</p></li><li><p>the columns and types to return</p></li></ul></div><p>This will return Object arrays, but now it will not use
<code class="literal">ResultSetMetadata</code> but will instead explicitly get the
ID, NAME and BIRTHDATE column as respectively a Long, String and a Short
from the underlying resultset. This also means that only these three
columns will be returned, even though the query is using
<code class="literal">*</code> and could return more than the three listed
columns.</p><p>It is possible to leave out the type information for all or some
of the scalars.</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="JAVA"><!-- <br/> --><span class="java_plain">sess</span><!-- <br/> --><span class="java_separator">.</span><!-- <br/> --><span class="java_plain">createSQLQuery</span><!-- <br/> --><span class="java_separator">(</span><!-- <br/> --><span class="java_literal">"SELECT * FROM CATS"</span><!-- <br/> --><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">addScalar</span><span class="java_separator">(</span><span class="java_literal">"ID"</span><span class="java_separator">,</span><span class="java_plain"> </span><span class="java_type">Hibernate</span><span class="java_separator">.</span><span class="java_plain">LONG</span><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">addScalar</span><span class="java_separator">(</span><span class="java_literal">"NAME"</span><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">addScalar</span><span class="java_separator">(</span><span class="java_literal">"BIRTHDATE"</span><span class="java_separator">)</span>
</pre><p>This is essentially the same query as before, but now
<code class="literal">ResultSetMetaData</code> is used to determine the type of NAME
and BIRTHDATE, where as the type of ID is explicitly specified.</p><p>How the java.sql.Types returned from ResultSetMetaData is mapped
to Hibernate types is controlled by the Dialect. If a specific type is
not mapped, or does not result in the expected type, it is possible to
customize it via calls to <code class="literal">registerHibernateType</code> in
the Dialect.</p></div><div class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="d0e14258"/>17.1.2. Entity queries</h3></div></div></div><p>The above queries were all about returning scalar values,
basically returning the "raw" values from the resultset. The following
shows how to get entity objects from a native sql query via
<code class="literal">addEntity()</code>.</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="JAVA"><!-- <br/> --><span class="java_plain">sess</span><!-- <br/> --><span class="java_separator">.</span><!-- <br/> --><span class="java_plain">createSQLQuery</span><!-- <br/> --><span class="java_separator">(</span><!-- <br/> --><span class="java_literal">"SELECT * FROM CATS"</span><!-- <br/> --><span class="java_separator">).</span><!-- <br/> --><span class="java_plain">addEntity</span><!-- <br/> --><span class="java_separator">(</span><!-- <br/> --><span class="java_type">Cat</span><!-- <br/> --><span class="java_separator">.</span><!-- <br/> --><span class="java_keyword">class</span><!-- <br/> --><span class="java_separator">);</span>
<!-- --><br/><span class="java_plain">sess</span><span class="java_separator">.</span><span class="java_plain">createSQLQuery</span><span class="java_separator">(</span><span class="java_literal">"SELECT ID, NAME, BIRTHDATE FROM CATS"</span><span class="java_separator">).</span><span class="java_plain">addEntity</span><span class="java_separator">(</span><span class="java_type">Cat</span><span class="java_separator">.</span><span class="java_keyword">class</span><span class="java_separator">);</span>
</pre><p>This query specified:</p><div class="itemizedlist"><ul><li><p>the SQL query string</p></li><li><p>the entity returned by the query</p></li></ul></div><p>Assuming that Cat is mapped as a class with the columns ID, NAME
and BIRTHDATE the above queries will both return a List where each
element is a Cat entity.</p><p>If the entity is mapped with a <code class="literal">many-to-one</code> to
another entity it is required to also return this when performing the
native query, otherwise a database specific "column not found" error
will occur. The additional columns will automatically be returned when
using the * notation, but we prefer to be explicit as in the following
example for a <code class="literal">many-to-one</code> to a
<code class="literal">Dog</code>:</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="JAVA"><!-- <br/> --><span class="java_plain">sess</span><!-- <br/> --><span class="java_separator">.</span><!-- <br/> --><span class="java_plain">createSQLQuery</span><!-- <br/> --><span class="java_separator">(</span><!-- <br/> --><span class="java_literal">"SELECT ID, NAME, BIRTHDATE, DOG_ID FROM CATS"</span><!-- <br/> --><span class="java_separator">).</span><!-- <br/> --><span class="java_plain">addEntity</span><!-- <br/> --><span class="java_separator">(</span><!-- <br/> --><span class="java_type">Cat</span><!-- <br/> --><span class="java_separator">.</span><!-- <br/> --><span class="java_keyword">class</span><!-- <br/> --><span class="java_separator">);</span>
</pre><p>This will allow cat.getDog() to function properly.</p></div><div class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="d0e14294"/>17.1.3. Handling associations and collections</h3></div></div></div><p>It is possible to eagerly join in the <code class="literal">Dog</code> to
avoid the possible extra roundtrip for initializing the proxy. This is
done via the <code class="literal">addJoin()</code> method, which allows you to
join in an association or collection.</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="JAVA"><!-- <br/> --><span class="java_plain">sess</span><!-- <br/> --><span class="java_separator">.</span><!-- <br/> --><span class="java_plain">createSQLQuery</span><!-- <br/> --><span class="java_separator">(</span><!-- <br/> --><span class="java_literal">"SELECT c.ID, NAME, BIRTHDATE, DOG_ID, D_ID, D_NAME FROM CATS c, DOGS d WHERE c.DOG_ID = d.D_ID"</span><!-- <br/> --><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">addEntity</span><span class="java_separator">(</span><span class="java_literal">"cat"</span><span class="java_separator">,</span><span class="java_plain"> </span><span class="java_type">Cat</span><span class="java_separator">.</span><span class="java_keyword">class</span><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">addJoin</span><span class="java_separator">(</span><span class="java_literal">"cat.dog"</span><span class="java_separator">);</span>
</pre><p>In this example, the returned <code class="literal">Cat</code>'s will have
their <code class="literal">dog</code> property fully initialized without any
extra roundtrip to the database. Notice that you added an alias name
("cat") to be able to specify the target property path of the join. It
is possible to do the same eager joining for collections, e.g. if the
<code class="literal">Cat</code> had a one-to-many to <code class="literal">Dog</code>
instead.</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="JAVA"><!-- <br/> --><span class="java_plain">sess</span><!-- <br/> --><span class="java_separator">.</span><!-- <br/> --><span class="java_plain">createSQLQuery</span><!-- <br/> --><span class="java_separator">(</span><!-- <br/> --><span class="java_literal">"SELECT ID, NAME, BIRTHDATE, D_ID, D_NAME, CAT_ID FROM CATS c, DOGS d WHERE c.ID = d.CAT_ID"</span><!-- <br/> --><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">addEntity</span><span class="java_separator">(</span><span class="java_literal">"cat"</span><span class="java_separator">,</span><span class="java_plain"> </span><span class="java_type">Cat</span><span class="java_separator">.</span><span class="java_keyword">class</span><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">addJoin</span><span class="java_separator">(</span><span class="java_literal">"cat.dogs"</span><span class="java_separator">);</span>
</pre><p>
At this stage you are reaching the limits of what is possible with native queries, without starting to
enhance the sql queries to make them usable in Hibernate. Problems can arise when returning
multiple entities of the same type or when the default alias/column names are not enough.
</p></div><div class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="d0e14325"/>17.1.4. Returning multiple entities</h3></div></div></div><p>Until now, the result set column names are assumed to be the same
as the column names specified in the mapping document. This can be
problematic for SQL queries that join multiple tables, since the same
column names can appear in more than one table.</p><p>Column alias injection is needed in the following query (which
most likely will fail):</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="JAVA"><!-- <br/> --><span class="java_plain">sess</span><!-- <br/> --><span class="java_separator">.</span><!-- <br/> --><span class="java_plain">createSQLQuery</span><!-- <br/> --><span class="java_separator">(</span><!-- <br/> --><span class="java_literal">"SELECT c.*, m.* FROM CATS c, CATS m WHERE c.MOTHER_ID = c.ID"</span><!-- <br/> --><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">addEntity</span><span class="java_separator">(</span><span class="java_literal">"cat"</span><span class="java_separator">,</span><span class="java_plain"> </span><span class="java_type">Cat</span><span class="java_separator">.</span><span class="java_keyword">class</span><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">addEntity</span><span class="java_separator">(</span><span class="java_literal">"mother"</span><span class="java_separator">,</span><span class="java_plain"> </span><span class="java_type">Cat</span><span class="java_separator">.</span><span class="java_keyword">class</span><span class="java_separator">)</span>
</pre><p>
The query was intended to return two Cat instances per
row: a cat and its mother. The query will, however, fail because there is a conflict of
names; the instances are mapped to the same column names. Also, on some
databases the returned column aliases will most likely be on the form
"c.ID", "c.NAME", etc. which are not equal to the columns specified in
the mappings ("ID" and "NAME").
</p><p>The following form is not vulnerable to column name
duplication:</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="JAVA"><!-- <br/> --><span class="java_plain">sess</span><!-- <br/> --><span class="java_separator">.</span><!-- <br/> --><span class="java_plain">createSQLQuery</span><!-- <br/> --><span class="java_separator">(</span><!-- <br/> --><span class="java_literal">"SELECT {cat.*}, {mother.*} FROM CATS c, CATS m WHERE c.MOTHER_ID = c.ID"</span><!-- <br/> --><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">addEntity</span><span class="java_separator">(</span><span class="java_literal">"cat"</span><span class="java_separator">,</span><span class="java_plain"> </span><span class="java_type">Cat</span><span class="java_separator">.</span><span class="java_keyword">class</span><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">addEntity</span><span class="java_separator">(</span><span class="java_literal">"mother"</span><span class="java_separator">,</span><span class="java_plain"> </span><span class="java_type">Cat</span><span class="java_separator">.</span><span class="java_keyword">class</span><span class="java_separator">)</span>
</pre><p>This query specified:</p><div class="itemizedlist"><ul><li><p>the SQL query string, with placeholders for Hibernate to
inject column aliases</p></li><li><p>the entities returned by the query</p></li></ul></div><p>The {cat.*} and {mother.*} notation used above is a shorthand for
"all properties". Alternatively, you can list the columns explicitly, but
even in this case Hibernate injects the SQL column aliases for
each property. The placeholder for a column alias is just the property
name qualified by the table alias. In the following example, you retrieve
Cats and their mothers from a different table (cat_log) to the one
declared in the mapping metadata. You can even use the
property aliases in the where clause.</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="JAVA"><!-- <br/> --><span class="java_type">String</span><!-- <br/> --><span class="java_plain"> sql </span><!-- <br/> --><span class="java_operator">=</span><!-- <br/> --><span class="java_plain"> </span><!-- <br/> --><span class="java_literal">"SELECT ID as {c.id}, NAME as {c.name}, "</span><!-- <br/> --><span class="java_plain"> </span><!-- <br/> --><span class="java_operator">+</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_literal">"BIRTHDATE as {c.birthDate}, MOTHER_ID as {c.mother}, {mother.*} "</span><span class="java_plain"> </span><span class="java_operator">+</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_literal">"FROM CAT_LOG c, CAT_LOG m WHERE {c.mother} = c.ID"</span><span class="java_separator">;</span>
</span>
<!-- --><br/><span class="java_type">List</span><span class="java_plain"> loggedCats </span><span class="java_operator">=</span><span class="java_plain"> sess</span><span class="java_separator">.</span><span class="java_plain">createSQLQuery</span><span class="java_separator">(</span><span class="java_plain">sql</span><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">addEntity</span><span class="java_separator">(</span><span class="java_literal">"cat"</span><span class="java_separator">,</span><span class="java_plain"> </span><span class="java_type">Cat</span><span class="java_separator">.</span><span class="java_keyword">class</span><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">addEntity</span><span class="java_separator">(</span><span class="java_literal">"mother"</span><span class="java_separator">,</span><span class="java_plain"> </span><span class="java_type">Cat</span><span class="java_separator">.</span><span class="java_keyword">class</span><span class="java_separator">).</span><span class="java_plain">list</span><span class="java_separator">()</span>
</pre><div class="section" lang="en-US"><div class="titlepage"><div><div><h4 class="title"><a id="querysql-aliasreferences"/>17.1.4.1. Alias and property references</h4></div></div></div><p>In most cases the above alias injection is needed. For
queries relating to more complex mappings, like composite properties,
inheritance discriminators, collections etc., you can use specific
aliases that allow Hibernate to inject the proper aliases.</p><p>The following table shows the different ways you can use
the alias injection. Please note that the alias names in the result are simply examples;
each alias will have a unique and probably different name when
used.</p><div class="table"><a id="aliasinjection-summary"/><p class="title"><b>Table 17.1. Alias injection names</b></p><div class="table-contents"><table summary="Alias injection names" border="1"><colgroup><col/><col/><col/></colgroup><thead><tr><th>Description</th><th>Syntax</th><th>Example</th></tr></thead><tbody><tr><td>A simple property</td><td><code class="literal">{[aliasname].[propertyname]</code></td><td><code class="literal">A_NAME as {item.name}</code></td></tr><tr><td>A composite property</td><td><code class="literal">{[aliasname].[componentname].[propertyname]}</code></td><td><code class="literal">CURRENCY as {item.amount.currency}, VALUE as
{item.amount.value}</code></td></tr><tr><td>Discriminator of an entity</td><td><code class="literal">{[aliasname].class}</code></td><td><code class="literal">DISC as {item.class}</code></td></tr><tr><td>All properties of an entity</td><td><code class="literal">{[aliasname].*}</code></td><td><code class="literal">{item.*}</code></td></tr><tr><td>A collection key</td><td><code class="literal">{[aliasname].key}</code></td><td><code class="literal">ORGID as {coll.key}</code></td></tr><tr><td>The id of an collection</td><td><code class="literal">{[aliasname].id}</code></td><td><code class="literal">EMPID as {coll.id}</code></td></tr><tr><td>The element of an collection</td><td><code class="literal">{[aliasname].element}</code></td><td><code class="literal">XID as {coll.element}</code></td></tr><tr><td>property of the element in the collection</td><td><code class="literal">{[aliasname].element.[propertyname]}</code></td><td><code class="literal">NAME as {coll.element.name}</code></td></tr><tr><td>All properties of the element in the collection</td><td><code class="literal">{[aliasname].element.*}</code></td><td><code class="literal">{coll.element.*}</code></td></tr><tr><td>All properties of the collection</td><td><code class="literal">{[aliasname].*}</code></td><td><code class="literal">{coll.*}</code></td></tr></tbody></table></div></div><br class="table-break"/></div></div><div class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="d0e14466"/>17.1.5. Returning non-managed entities</h3></div></div></div><p>It is possible to apply a ResultTransformer to native SQL queries, allowing it to return non-managed entities.</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="JAVA"><!-- <br/> --><span class="java_plain">sess</span><!-- <br/> --><span class="java_separator">.</span><!-- <br/> --><span class="java_plain">createSQLQuery</span><!-- <br/> --><span class="java_separator">(</span><!-- <br/> --><span class="java_literal">"SELECT NAME, BIRTHDATE FROM CATS"</span><!-- <br/> --><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">setResultTransformer</span><span class="java_separator">(</span><span class="java_type">Transformers</span><span class="java_separator">.</span><span class="java_plain">aliasToBean</span><span class="java_separator">(</span><span class="java_type">CatDTO</span><span class="java_separator">.</span><span class="java_keyword">class</span><span class="java_separator">))</span></pre><p>This query specified:</p><div class="itemizedlist"><ul><li><p>the SQL query string</p></li><li><p>a result transformer</p></li></ul></div><p>
The above query will return a list of <code class="literal">CatDTO</code> which has been instantiated and injected the values of NAME and BIRTHNAME into its corresponding
properties or fields.
</p></div><div class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="d0e14487"/>17.1.6. Handling inheritance</h3></div></div></div><p>Native SQL queries which query for entities that are mapped as part
of an inheritance must include all properties for the baseclass and all
its subclasses.</p></div><div class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="d0e14492"/>17.1.7. Parameters</h3></div></div></div><p>Native SQL queries support positional as well as named
parameters:</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="JAVA"><!-- <br/> --><span class="java_type">Query</span><!-- <br/> --><span class="java_plain"> query </span><!-- <br/> --><span class="java_operator">=</span><!-- <br/> --><span class="java_plain"> sess</span><!-- <br/> --><span class="java_separator">.</span><!-- <br/> --><span class="java_plain">createSQLQuery</span><!-- <br/> --><span class="java_separator">(</span><!-- <br/> --><span class="java_literal">"SELECT * FROM CATS WHERE NAME like ?"</span><!-- <br/> --><span class="java_separator">).</span><!-- <br/> --><span class="java_plain">addEntity</span><!-- <br/> --><span class="java_separator">(</span><!-- <br/> --><span class="java_type">Cat</span><!-- <br/> --><span class="java_separator">.</span><!-- <br/> --><span class="java_keyword">class</span><!-- <br/> --><span class="java_separator">);</span>
<!-- --><br/><span class="java_type">List</span><span class="java_plain"> pusList </span><span class="java_operator">=</span><span class="java_plain"> query</span><span class="java_separator">.</span><span class="java_plain">setString</span><span class="java_separator">(</span><span class="java_literal">0</span><span class="java_separator">,</span><span class="java_plain"> </span><span class="java_literal">"Pus%"</span><span class="java_separator">).</span><span class="java_plain">list</span><span class="java_separator">();</span>
<!-- --><br/><span class="java_plain"> </span>
<!-- --><br/><span class="java_plain">query </span><span class="java_operator">=</span><span class="java_plain"> sess</span><span class="java_separator">.</span><span class="java_plain">createSQLQuery</span><span class="java_separator">(</span><span class="java_literal">"SELECT * FROM CATS WHERE NAME like :name"</span><span class="java_separator">).</span><span class="java_plain">addEntity</span><span class="java_separator">(</span><span class="java_type">Cat</span><span class="java_separator">.</span><span class="java_keyword">class</span><span class="java_separator">);</span>
<!-- --><br/><span class="java_type">List</span><span class="java_plain"> pusList </span><span class="java_operator">=</span><span class="java_plain"> query</span><span class="java_separator">.</span><span class="java_plain">setString</span><span class="java_separator">(</span><span class="java_literal">"name"</span><span class="java_separator">,</span><span class="java_plain"> </span><span class="java_literal">"Pus%"</span><span class="java_separator">).</span><span class="java_plain">list</span><span class="java_separator">();</span><span class="java_plain"> </span></pre></div></div><div class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="querysql-namedqueries"/>17.2. Named SQL queries</h2></div></div></div><p>Named SQL queries can be defined in the mapping document and called
in exactly the same way as a named HQL query. In this case, you do
<span class="emphasis"><em>not</em></span> need to call
<code class="literal">addEntity()</code>.</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="XML"><!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) -->
<span class="xml_tag_symbols"><</span><span class="xml_tag_name">sql-query</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"persons"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return</span><span class="xml_plain"> </span><span class="xml_attribute_name">alias</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"person"</span><span class="xml_plain"> </span><span class="xml_attribute_name">class</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"eg.Person"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> SELECT person.NAME AS {person.name},</span><br />
<span class="xml_plain"> person.AGE AS {person.age},</span><br />
<span class="xml_plain"> person.SEX AS {person.sex}</span><br />
<span class="xml_plain"> FROM PERSON person</span><br />
<span class="xml_plain"> WHERE person.NAME LIKE :namePattern</span><br />
<span class="xml_tag_symbols"></</span><span class="xml_tag_name">sql-query</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
</pre><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="JAVA"><!-- <br/> --><span class="java_type">List</span><!-- <br/> --><span class="java_plain"> people </span><!-- <br/> --><span class="java_operator">=</span><!-- <br/> --><span class="java_plain"> sess</span><!-- <br/> --><span class="java_separator">.</span><!-- <br/> --><span class="java_plain">getNamedQuery</span><!-- <br/> --><span class="java_separator">(</span><!-- <br/> --><span class="java_literal">"persons"</span><!-- <br/> --><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">setString</span><span class="java_separator">(</span><span class="java_literal">"namePattern"</span><span class="java_separator">,</span><span class="java_plain"> namePattern</span><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">setMaxResults</span><span class="java_separator">(</span><span class="java_literal">50</span><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">list</span><span class="java_separator">();</span></pre><p>The <code class="literal"><return-join></code> element is use to join associations and
the <code class="literal"><load-collection></code> element is used to define queries which initialize collections,
</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="XML"><!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) -->
<span class="xml_tag_symbols"><</span><span class="xml_tag_name">sql-query</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"personsWith"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return</span><span class="xml_plain"> </span><span class="xml_attribute_name">alias</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"person"</span><span class="xml_plain"> </span><span class="xml_attribute_name">class</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"eg.Person"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-join</span><span class="xml_plain"> </span><span class="xml_attribute_name">alias</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"address"</span><span class="xml_plain"> </span><span class="xml_attribute_name">property</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"person.mailingAddress"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> SELECT person.NAME AS {person.name},</span><br />
<span class="xml_plain"> person.AGE AS {person.age},</span><br />
<span class="xml_plain"> person.SEX AS {person.sex},</span><br />
<span class="xml_plain"> address.STREET AS {address.street},</span><br />
<span class="xml_plain"> address.CITY AS {address.city},</span><br />
<span class="xml_plain"> address.STATE AS {address.state},</span><br />
<span class="xml_plain"> address.ZIP AS {address.zip}</span><br />
<span class="xml_plain"> FROM PERSON person</span><br />
<span class="xml_plain"> JOIN ADDRESS address</span><br />
<span class="xml_plain"> ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'</span><br />
<span class="xml_plain"> WHERE person.NAME LIKE :namePattern</span><br />
<span class="xml_tag_symbols"></</span><span class="xml_tag_name">sql-query</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
</pre><p>A named SQL query may return a scalar value. You must declare the
column alias and Hibernate type using the
<code class="literal"><return-scalar></code> element:</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="XML"><!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) -->
<span class="xml_tag_symbols"><</span><span class="xml_tag_name">sql-query</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"mySqlQuery"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-scalar</span><span class="xml_plain"> </span><span class="xml_attribute_name">column</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"name"</span><span class="xml_plain"> </span><span class="xml_attribute_name">type</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"string"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-scalar</span><span class="xml_plain"> </span><span class="xml_attribute_name">column</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"age"</span><span class="xml_plain"> </span><span class="xml_attribute_name">type</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"long"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> SELECT p.NAME AS name,</span><br />
<span class="xml_plain"> p.AGE AS age,</span><br />
<span class="xml_plain"> FROM PERSON p WHERE p.NAME LIKE 'Hiber%'</span><br />
<span class="xml_tag_symbols"></</span><span class="xml_tag_name">sql-query</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
</pre><p>You can externalize the resultset mapping information in a
<code class="literal"><resultset></code> element which will allow you to either reuse them across
several named queries or through the
<code class="literal">setResultSetMapping()</code> API.</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="XML"><!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) -->
<span class="xml_tag_symbols"><</span><span class="xml_tag_name">resultset</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"personAddress"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return</span><span class="xml_plain"> </span><span class="xml_attribute_name">alias</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"person"</span><span class="xml_plain"> </span><span class="xml_attribute_name">class</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"eg.Person"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-join</span><span class="xml_plain"> </span><span class="xml_attribute_name">alias</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"address"</span><span class="xml_plain"> </span><span class="xml_attribute_name">property</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"person.mailingAddress"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_tag_symbols"></</span><span class="xml_tag_name">resultset</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"></span><br />
<span class="xml_tag_symbols"><</span><span class="xml_tag_name">sql-query</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"personsWith"</span><span class="xml_plain"> </span><span class="xml_attribute_name">resultset-ref</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"personAddress"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> SELECT person.NAME AS {person.name},</span><br />
<span class="xml_plain"> person.AGE AS {person.age},</span><br />
<span class="xml_plain"> person.SEX AS {person.sex},</span><br />
<span class="xml_plain"> address.STREET AS {address.street},</span><br />
<span class="xml_plain"> address.CITY AS {address.city},</span><br />
<span class="xml_plain"> address.STATE AS {address.state},</span><br />
<span class="xml_plain"> address.ZIP AS {address.zip}</span><br />
<span class="xml_plain"> FROM PERSON person</span><br />
<span class="xml_plain"> JOIN ADDRESS address</span><br />
<span class="xml_plain"> ON person.ID = address.PERSON_ID AND address.TYPE='MAILING'</span><br />
<span class="xml_plain"> WHERE person.NAME LIKE :namePattern</span><br />
<span class="xml_tag_symbols"></</span><span class="xml_tag_name">sql-query</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
</pre><p>You can, alternatively, use the resultset mapping information in your
hbm files directly in java code.</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="JAVA"><!-- <br/> --><span class="java_type">List</span><!-- <br/> --><span class="java_plain"> cats </span><!-- <br/> --><span class="java_operator">=</span><!-- <br/> --><span class="java_plain"> sess</span><!-- <br/> --><span class="java_separator">.</span><!-- <br/> --><span class="java_plain">createSQLQuery</span><!-- <br/> --><span class="java_separator">(</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_literal">"select {cat.*}, {kitten.*} from cats cat, cats kitten where kitten.mother = cat.id"</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">setResultSetMapping</span><span class="java_separator">(</span><span class="java_literal">"catAndKitten"</span><span class="java_separator">)</span>
<!-- --><br/><span class="java_plain"> </span><span class="java_separator">.</span><span class="java_plain">list</span><span class="java_separator">();</span></pre><div class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="propertyresults"/>17.2.1. Using return-property to explicitly specify column/alias
names</h3></div></div></div><p>You can explicitly
tell Hibernate what column aliases to use with <code class="literal"><return-property></code>, instead of using the
<code class="literal">{}</code>-syntax to let Hibernate inject its own
aliases.For example:</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="XML"><!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) -->
<span class="xml_tag_symbols"><</span><span class="xml_tag_name">sql-query</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"mySqlQuery"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return</span><span class="xml_plain"> </span><span class="xml_attribute_name">alias</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"person"</span><span class="xml_plain"> </span><span class="xml_attribute_name">class</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"eg.Person"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-property</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"name"</span><span class="xml_plain"> </span><span class="xml_attribute_name">column</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"myName"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-property</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"age"</span><span class="xml_plain"> </span><span class="xml_attribute_name">column</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"myAge"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-property</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"sex"</span><span class="xml_plain"> </span><span class="xml_attribute_name">column</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"mySex"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">return</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> SELECT person.NAME AS myName,</span><br />
<span class="xml_plain"> person.AGE AS myAge,</span><br />
<span class="xml_plain"> person.SEX AS mySex,</span><br />
<span class="xml_plain"> FROM PERSON person WHERE person.NAME LIKE :name</span><br />
<span class="xml_tag_symbols"></</span><span class="xml_tag_name">sql-query</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
</pre><p><code class="literal"><return-property></code> also works with
multiple columns. This solves a limitation with the
<code class="literal">{}</code>-syntax which cannot allow fine grained control of
multi-column properties.</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="XML"><!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) -->
<span class="xml_tag_symbols"><</span><span class="xml_tag_name">sql-query</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"organizationCurrentEmployments"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return</span><span class="xml_plain"> </span><span class="xml_attribute_name">alias</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"emp"</span><span class="xml_plain"> </span><span class="xml_attribute_name">class</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"Employment"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-property</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"salary"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-column</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"VALUE"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-column</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"CURRENCY"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">return-property</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-property</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"endDate"</span><span class="xml_plain"> </span><span class="xml_attribute_name">column</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"myEndDate"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">return</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},</span><br />
<span class="xml_plain"> STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},</span><br />
<span class="xml_plain"> REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY</span><br />
<span class="xml_plain"> FROM EMPLOYMENT</span><br />
<span class="xml_plain"> WHERE EMPLOYER = :id AND ENDDATE IS NULL</span><br />
<span class="xml_plain"> ORDER BY STARTDATE ASC</span><br />
<span class="xml_tag_symbols"></</span><span class="xml_tag_name">sql-query</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
</pre><p>In this example
<code class="literal"><return-property></code> was used in combination with the
<code class="literal">{}</code>-syntax for injection. This allows users to choose how
they want to refer column and properties.</p><p>If your mapping has a discriminator you must use
<code class="literal"><return-discriminator></code> to specify the
discriminator column.</p></div><div class="section" lang="en-US"><div class="titlepage"><div><div><h3 class="title"><a id="sp_query"/>17.2.2. Using stored procedures for querying</h3></div></div></div><p>Hibernate3 provides support for queries via stored procedures
and functions. Most of the following documentation is equivalent for
both. The stored procedure/function must return a resultset as the first
out-parameter to be able to work with Hibernate. An example of such a
stored function in Oracle 9 and higher is as follows:</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="XML"><!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) -->
<span class="xml_plain">CREATE OR REPLACE FUNCTION selectAllEmployments</span><br />
<span class="xml_plain"> RETURN SYS_REFCURSOR</span><br />
<span class="xml_plain">AS</span><br />
<span class="xml_plain"> st_cursor SYS_REFCURSOR;</span><br />
<span class="xml_plain">BEGIN</span><br />
<span class="xml_plain"> OPEN st_cursor FOR</span><br />
<span class="xml_plain"> SELECT EMPLOYEE, EMPLOYER,</span><br />
<span class="xml_plain"> STARTDATE, ENDDATE,</span><br />
<span class="xml_plain"> REGIONCODE, EID, VALUE, CURRENCY</span><br />
<span class="xml_plain"> FROM EMPLOYMENT;</span><br />
<span class="xml_plain"> RETURN st_cursor;</span><br />
<span class="xml_plain"> END;</span><br />
</pre><p>To use this query in Hibernate you need to map it via a named
query.</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="XML"><!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) -->
<span class="xml_tag_symbols"><</span><span class="xml_tag_name">sql-query</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"selectAllEmployees_SP"</span><span class="xml_plain"> </span><span class="xml_attribute_name">callable</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"true"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return</span><span class="xml_plain"> </span><span class="xml_attribute_name">alias</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"emp"</span><span class="xml_plain"> </span><span class="xml_attribute_name">class</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"Employment"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-property</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"employee"</span><span class="xml_plain"> </span><span class="xml_attribute_name">column</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"EMPLOYEE"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-property</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"employer"</span><span class="xml_plain"> </span><span class="xml_attribute_name">column</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"EMPLOYER"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-property</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"startDate"</span><span class="xml_plain"> </span><span class="xml_attribute_name">column</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"STARTDATE"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-property</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"endDate"</span><span class="xml_plain"> </span><span class="xml_attribute_name">column</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"ENDDATE"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-property</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"regionCode"</span><span class="xml_plain"> </span><span class="xml_attribute_name">column</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"REGIONCODE"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-property</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"id"</span><span class="xml_plain"> </span><span class="xml_attribute_name">column</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"EID"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-property</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"salary"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-column</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"VALUE"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-column</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"CURRENCY"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">return-property</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">return</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> { ? = call selectAllEmployments() }</span><br />
<span class="xml_tag_symbols"></</span><span class="xml_tag_name">sql-query</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
</pre><p>Stored procedures currently only return scalars and
entities. <code class="literal"><return-join></code> and
<code class="literal"><load-collection></code> are not supported.</p><div class="section" lang="en-US"><div class="titlepage"><div><div><h4 class="title"><a id="querysql-limits-storedprocedures"/>17.2.2.1. Rules/limitations for using stored procedures</h4></div></div></div><p>You cannot use stored procedures with Hibernate unless you follow some procedure/function
rules. If they do not follow those rules they are
not usable with Hibernate. If you still want to use these procedures
you have to execute them via <code class="literal">session.connection()</code>.
The rules are different for each database, since database vendors have
different stored procedure semantics/syntax.</p><p>Stored procedure queries cannot be paged with
<code class="literal">setFirstResult()/setMaxResults()</code>.</p><p>The recommended call form is standard SQL92: <code class="literal">{ ? = call
functionName(<parameters>) }</code> or <code class="literal">{ ? = call
procedureName(<parameters>}</code>. Native call syntax is not
supported.</p><p>For Oracle the following rules apply:</p><div class="itemizedlist"><ul compact="compact"><li><p>A function must return a result set. The first parameter of
a procedure must be an <code class="literal">OUT</code> that returns a
result set. This is done by using a
<code class="literal">SYS_REFCURSOR</code> type in Oracle 9 or 10. In Oracle
you need to define a <code class="literal">REF CURSOR</code> type. See
Oracle literature for further information.</p></li></ul></div><p>For Sybase or MS SQL server the following rules apply:</p><div class="itemizedlist"><ul compact="compact"><li><p>The procedure must return a result set. Note that since
these servers can return multiple result sets and update
counts, Hibernate will iterate the results and take the first
result that is a result set as its return value. Everything else
will be discarded.</p></li><li><p>If you can enable <code class="literal">SET NOCOUNT ON</code> in your
procedure it will probably be more efficient, but this is not a
requirement.</p></li></ul></div></div></div></div><div class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="querysql-cud"/>17.3. Custom SQL for create, update and delete</h2></div></div></div><p>Hibernate3 can use custom SQL for create, update, and delete operations.
The SQL can be overridden at the statement level or inidividual column level. This
section describes statement overrides. For columns, see
<a class="xref" href="mapping.html#mapping-column-read-and-write" title="5.7. Column read and write expressions">Section 5.7, “Column read and write expressions”</a>.
</p><p>
The class and collection persisters in Hibernate already contain a set of
configuration time generated strings (insertsql, deletesql, updatesql etc.).
The mapping tags
<code class="literal"><sql-insert></code>,
<code class="literal"><sql-delete></code>, and
<code class="literal"><sql-update></code> override these strings:</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="XML"><!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) -->
<span class="xml_tag_symbols"><</span><span class="xml_tag_name">class</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"Person"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">id</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"id"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">generator</span><span class="xml_plain"> </span><span class="xml_attribute_name">class</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"increment"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">id</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">property</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"name"</span><span class="xml_plain"> </span><span class="xml_attribute_name">not-null</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"true"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">sql-insert</span><span class="xml_tag_symbols">></span><span class="xml_plain">INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )</span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">sql-insert</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">sql-update</span><span class="xml_tag_symbols">></span><span class="xml_plain">UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">sql-update</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">sql-delete</span><span class="xml_tag_symbols">></span><span class="xml_plain">DELETE FROM PERSON WHERE ID=?</span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">sql-delete</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_tag_symbols"></</span><span class="xml_tag_name">class</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
</pre><p>The SQL is directly executed in your database, so you can
use any dialect you like. This will reduce the portability of
your mapping if you use database specific SQL.</p><p>Stored procedures are supported if the <code class="literal">callable</code>
attribute is set:</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="XML"><!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) -->
<span class="xml_tag_symbols"><</span><span class="xml_tag_name">class</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"Person"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">id</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"id"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">generator</span><span class="xml_plain"> </span><span class="xml_attribute_name">class</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"increment"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">id</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">property</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"name"</span><span class="xml_plain"> </span><span class="xml_attribute_name">not-null</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"true"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">sql-insert</span><span class="xml_plain"> </span><span class="xml_attribute_name">callable</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"true"</span><span class="xml_tag_symbols">></span><span class="xml_plain">{call createPerson (?, ?)}</span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">sql-insert</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">sql-delete</span><span class="xml_plain"> </span><span class="xml_attribute_name">callable</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"true"</span><span class="xml_tag_symbols">></span><span class="xml_plain">{? = call deletePerson (?)}</span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">sql-delete</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">sql-update</span><span class="xml_plain"> </span><span class="xml_attribute_name">callable</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"true"</span><span class="xml_tag_symbols">></span><span class="xml_plain">{? = call updatePerson (?, ?)}</span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">sql-update</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_tag_symbols"></</span><span class="xml_tag_name">class</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
</pre><p>The order of the positional parameters is vital, as they
must be in the same sequence as Hibernate expects them.</p><p>You can view the expected order by enabling debug logging for the
<code class="literal">org.hibernate.persister.entity</code> level. With this level
enabled, Hibernate will print out the static SQL that is used to create,
update, delete etc. entities. To view the expected sequence, do
not include your custom SQL in the mapping files, as this will override the
Hibernate generated static SQL.</p><p>The stored procedures are in most cases
required to return the number of rows inserted, updated and deleted, as
Hibernate has some runtime checks for the success of the statement.
Hibernate always registers the first statement parameter as a numeric
output parameter for the CUD operations:</p><pre class="programlisting">CREATE OR REPLACE FUNCTION updatePerson (uid IN NUMBER, uname IN VARCHAR2)
RETURN NUMBER IS
BEGIN
update PERSON
set
NAME = uname,
where
ID = uid;
return SQL%ROWCOUNT;
END updatePerson;</pre></div><div class="section" lang="en-US"><div class="titlepage"><div><div><h2 class="title"><a id="querysql-load"/>17.4. Custom SQL for loading</h2></div></div></div><p>You can also declare your own SQL (or HQL) queries for entity
loading. As with inserts, updates, and deletes, this can be done at the
individual column level as described in
<a class="xref" href="mapping.html#mapping-column-read-and-write" title="5.7. Column read and write expressions">Section 5.7, “Column read and write expressions”</a>
or at the statement level. Here is an example of a statement level override:
</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="XML"><!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) -->
<span class="xml_tag_symbols"><</span><span class="xml_tag_name">sql-query</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"person"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return</span><span class="xml_plain"> </span><span class="xml_attribute_name">alias</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"pers"</span><span class="xml_plain"> </span><span class="xml_attribute_name">class</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"Person"</span><span class="xml_plain"> </span><span class="xml_attribute_name">lock-mode</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"upgrade"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> SELECT NAME AS {pers.name}, ID AS {pers.id}</span><br />
<span class="xml_plain"> FROM PERSON</span><br />
<span class="xml_plain"> WHERE ID=?</span><br />
<span class="xml_plain"> FOR UPDATE</span><br />
<span class="xml_tag_symbols"></</span><span class="xml_tag_name">sql-query</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
</pre><p>This is just a named query declaration, as discussed earlier. You
can reference this named query in a class mapping:</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="XML"><!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) -->
<span class="xml_tag_symbols"><</span><span class="xml_tag_name">class</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"Person"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">id</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"id"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">generator</span><span class="xml_plain"> </span><span class="xml_attribute_name">class</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"increment"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">id</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">property</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"name"</span><span class="xml_plain"> </span><span class="xml_attribute_name">not-null</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"true"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">loader</span><span class="xml_plain"> </span><span class="xml_attribute_name">query-ref</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"person"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_tag_symbols"></</span><span class="xml_tag_name">class</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
</pre><p>This even works with stored procedures.</p><p>You can even define a query for collection loading:</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="XML"><!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) -->
<span class="xml_tag_symbols"><</span><span class="xml_tag_name">set</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"employments"</span><span class="xml_plain"> </span><span class="xml_attribute_name">inverse</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"true"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">key</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">one-to-many</span><span class="xml_plain"> </span><span class="xml_attribute_name">class</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"Employment"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">loader</span><span class="xml_plain"> </span><span class="xml_attribute_name">query-ref</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"employments"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_tag_symbols"></</span><span class="xml_tag_name">set</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
</pre><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="XML"><!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) -->
<span class="xml_tag_symbols"><</span><span class="xml_tag_name">sql-query</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"employments"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">load-collection</span><span class="xml_plain"> </span><span class="xml_attribute_name">alias</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"emp"</span><span class="xml_plain"> </span><span class="xml_attribute_name">role</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"Person.employments"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> SELECT {emp.*}</span><br />
<span class="xml_plain"> FROM EMPLOYMENT emp</span><br />
<span class="xml_plain"> WHERE EMPLOYER = :id</span><br />
<span class="xml_plain"> ORDER BY STARTDATE ASC, EMPLOYEE ASC</span><br />
<span class="xml_tag_symbols"></</span><span class="xml_tag_name">sql-query</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
</pre><p>You can also define an entity loader that loads a collection by
join fetching:</p><pre xmlns="" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="XML"><!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) -->
<span class="xml_tag_symbols"><</span><span class="xml_tag_name">sql-query</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"person"</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return</span><span class="xml_plain"> </span><span class="xml_attribute_name">alias</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"pers"</span><span class="xml_plain"> </span><span class="xml_attribute_name">class</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"Person"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">return-join</span><span class="xml_plain"> </span><span class="xml_attribute_name">alias</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"emp"</span><span class="xml_plain"> </span><span class="xml_attribute_name">property</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"pers.employments"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
<span class="xml_plain"> SELECT NAME AS {pers.*}, {emp.*}</span><br />
<span class="xml_plain"> FROM PERSON pers</span><br />
<span class="xml_plain"> LEFT OUTER JOIN EMPLOYMENT emp</span><br />
<span class="xml_plain"> ON pers.ID = emp.PERSON_ID</span><br />
<span class="xml_plain"> WHERE ID=?</span><br />
<span class="xml_tag_symbols"></</span><span class="xml_tag_name">sql-query</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
</pre></div></div><HR xmlns=""/><a xmlns="" href="legalnotice.html"><p xmlns="http://www.w3.org/1999/xhtml" class="copyright">Copyright © 2004 Red Hat, Inc.</p></a><ul class="docnav"><li class="previous"><a accesskey="p" href="querycriteria.html"><strong>Prev</strong>Chapter 16. Criteria Queries</a></li><li class="up"><a accesskey="u" href="#"><strong>Top of page</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Front page</strong></a></li><li class="next"><a accesskey="n" href="filters.html"><strong>Next</strong>Chapter 18. Filtering data</a></li></ul></body></html>
| 228.926396 | 2,471 | 0.712197 |
753c60cd4996ec8ac665f93219527d7c7e96d3c2
| 21,876 |
c
|
C
|
agent/plugin/file/attribute.c
|
mexicowilly/Yella
|
63888d9abe143219ed923625f8066eaf17a8d553
|
[
"Apache-2.0"
] | null | null | null |
agent/plugin/file/attribute.c
|
mexicowilly/Yella
|
63888d9abe143219ed923625f8066eaf17a8d553
|
[
"Apache-2.0"
] | 36 |
2016-08-10T02:46:17.000Z
|
2021-05-31T14:07:48.000Z
|
agent/plugin/file/attribute.c
|
mexicowilly/Yella
|
63888d9abe143219ed923625f8066eaf17a8d553
|
[
"Apache-2.0"
] | null | null | null |
#include "attribute.h"
#include "common/file.h"
#include "common/text_util.h"
#include <string.h>
static yella_file_type fb_to_file_type(yella_fb_file_file_type_enum_t fbt)
{
yella_file_type result;
switch (fbt)
{
case yella_fb_file_file_type_BLOCK_SPECIAL:
result = YELLA_FILE_TYPE_BLOCK_SPECIAL;
break;
case yella_fb_file_file_type_CHARACTER_SPECIAL:
result = YELLA_FILE_TYPE_CHARACTER_SPECIAL;
break;
case yella_fb_file_file_type_DIRECTORY:
result = YELLA_FILE_TYPE_DIRECTORY;
break;
case yella_fb_file_file_type_FIFO:
result = YELLA_FILE_TYPE_FIFO;
break;
case yella_fb_file_file_type_SYMBOLIC_LINK:
result = YELLA_FILE_TYPE_SYMBOLIC_LINK;
break;
case yella_fb_file_file_type_REGULAR:
result = YELLA_FILE_TYPE_REGULAR;
break;
case yella_fb_file_file_type_SOCKET:
result = YELLA_FILE_TYPE_SOCKET;
break;
case yella_fb_file_file_type_WHITEOUT:
result = YELLA_FILE_TYPE_WHITEOUT;
break;
default:
assert(false);
}
return result;
}
static yella_fb_file_attr_type_enum_t file_type_to_fb(yella_file_type ft)
{
yella_fb_file_file_type_enum_t result;
switch (ft)
{
case YELLA_FILE_TYPE_BLOCK_SPECIAL:
result = yella_fb_file_file_type_BLOCK_SPECIAL;
break;
case YELLA_FILE_TYPE_CHARACTER_SPECIAL:
result = yella_fb_file_file_type_CHARACTER_SPECIAL;
break;
case YELLA_FILE_TYPE_DIRECTORY:
result = yella_fb_file_file_type_DIRECTORY;
break;
case YELLA_FILE_TYPE_FIFO:
result = yella_fb_file_file_type_FIFO;
break;
case YELLA_FILE_TYPE_SYMBOLIC_LINK:
result = yella_fb_file_file_type_SYMBOLIC_LINK;
break;
case YELLA_FILE_TYPE_REGULAR:
result = yella_fb_file_file_type_REGULAR;
break;
case YELLA_FILE_TYPE_SOCKET:
result = yella_fb_file_file_type_SOCKET;
break;
case YELLA_FILE_TYPE_WHITEOUT:
result = yella_fb_file_file_type_WHITEOUT;
break;
default:
assert(false);
}
return result;
}
static void acl_entry_destructor(void* elem, void* udata)
{
posix_acl_entry* entry = (posix_acl_entry*)elem;
free(entry->usr_grp.name);
free(entry);
}
uint16_t attribute_type_to_fb(attribute_type atp)
{
uint16_t result;
switch (atp)
{
case ATTR_TYPE_FILE_TYPE:
result = yella_fb_file_attr_type_FILE_TYPE;
break;
case ATTR_TYPE_SHA256:
result = yella_fb_file_attr_type_SHA256;
break;
case ATTR_TYPE_POSIX_PERMISSIONS:
result = yella_fb_file_attr_type_POSIX_PERMISSIONS;
break;
case ATTR_TYPE_USER:
result = yella_fb_file_attr_type_USER;
break;
case ATTR_TYPE_GROUP:
result = yella_fb_file_attr_type_GROUP;
break;
case ATTR_TYPE_SIZE:
result = yella_fb_file_attr_type_SIZE;
break;
case ATTR_TYPE_ACCESS_TIME:
result = yella_fb_file_attr_type_ACCESS_TIME;
break;
case ATTR_TYPE_METADATA_CHANGE_TIME:
result = yella_fb_file_attr_type_METADATA_CHANGE_TIME;
break;
case ATTR_TYPE_MODIFICATION_TIME:
result = yella_fb_file_attr_type_MODIFICATION_TIME;
break;
case ATTR_TYPE_POSIX_ACL:
result = yella_fb_file_attr_type_POSIX_ACL;
break;
default:
assert(false);
}
return result;
}
int compare_attributes(const attribute* const lhs, const attribute* const rhs)
{
int rc;
size_t i;
posix_acl_entry* e1;
posix_acl_entry* e2;
rc = (int)lhs->type - (int)rhs->type;
if (rc == 0)
{
switch (lhs->type)
{
case ATTR_TYPE_FILE_TYPE:
rc = lhs->value.integer - rhs->value.integer;
break;
case ATTR_TYPE_SHA256:
rc = (int64_t)lhs->value.byte_array.sz - (int64_t)rhs->value.byte_array.sz;
if (rc == 0)
rc = memcmp(lhs->value.byte_array.mem, rhs->value.byte_array.mem, lhs->value.byte_array.sz);
break;
case ATTR_TYPE_POSIX_PERMISSIONS:
rc = memcmp(&lhs->value.psx_permissions, &rhs->value.psx_permissions, sizeof(posix_permissions));
break;
case ATTR_TYPE_USER:
case ATTR_TYPE_GROUP:
rc = (int64_t)lhs->value.usr_grp.id - (int64_t)rhs->value.usr_grp.id;
if (rc == 0)
rc = u_strcmp(lhs->value.usr_grp.name, rhs->value.usr_grp.name);
break;
case ATTR_TYPE_SIZE:
rc = (int64_t)lhs->value.size - (int64_t)rhs->value.size;
break;
case ATTR_TYPE_ACCESS_TIME:
case ATTR_TYPE_METADATA_CHANGE_TIME:
case ATTR_TYPE_MODIFICATION_TIME:
rc = (int64_t)lhs->value.millis_since_epoch - (int64_t)rhs->value.millis_since_epoch;
break;
case ATTR_TYPE_POSIX_ACL:
rc = (int64_t)yella_ptr_vector_size(lhs->value.posix_acl_entries) - (int64_t)yella_ptr_vector_size(rhs->value.posix_acl_entries);
if (rc == 0 && yella_ptr_vector_size(lhs->value.posix_acl_entries) > 0)
{
for (i = 0; i < yella_ptr_vector_size(lhs->value.posix_acl_entries); i++)
{
e1 = yella_ptr_vector_at(lhs->value.posix_acl_entries, i);
e2 = yella_ptr_vector_at(rhs->value.posix_acl_entries, i);
rc = e1->type - e2->type;
if (rc == 0)
{
rc = (int64_t)e1->usr_grp.id - (int64_t)e2->usr_grp.id;
if (rc == 0)
{
rc = u_strcmp(e1->usr_grp.name, e2->usr_grp.name);
if (rc == 0)
{
rc = memcmp(&e1->perm, &e2->perm, sizeof(struct posix_permission));
}
}
}
}
}
break;
default:
assert(false);
}
}
return rc;
}
attribute* create_attribute_from_table(const yella_fb_file_attr_table_t tbl)
{
attribute* result;
flatbuffers_uint8_vec_t bytes;
yella_fb_file_posix_permissions_table_t psx_perms;
yella_fb_file_user_group_table_t usr_grp;
yella_fb_file_posix_permission_table_t psx_perm;
yella_fb_file_posix_access_control_entry_vec_t acl_entries;
yella_fb_file_posix_access_control_entry_table_t fb_entry;
size_t i;
posix_acl_entry* entry;
result = malloc(sizeof(attribute));
switch (yella_fb_file_attr_type(tbl))
{
case yella_fb_file_attr_type_FILE_TYPE:
result->type = ATTR_TYPE_FILE_TYPE;
result->value.integer = fb_to_file_type(yella_fb_file_attr_ftype(tbl));
break;
case yella_fb_file_attr_type_SHA256:
result->type = ATTR_TYPE_SHA256;
bytes = yella_fb_file_attr_bytes(tbl);
result->value.byte_array.sz = flatbuffers_uint8_vec_len(bytes);
result->value.byte_array.mem = malloc(result->value.byte_array.sz);
memcpy(result->value.byte_array.mem, bytes, result->value.byte_array.sz);
break;
case yella_fb_file_attr_type_POSIX_PERMISSIONS:
result->type = ATTR_TYPE_POSIX_PERMISSIONS;
memset(&result->value.psx_permissions, 0, sizeof(posix_permissions));
psx_perms = yella_fb_file_attr_psx_permissions(tbl);
if (yella_fb_file_posix_permissions_owner_is_present(psx_perms))
{
psx_perm = yella_fb_file_posix_permissions_owner(psx_perms);
result->value.psx_permissions.owner.read = yella_fb_file_posix_permission_read(psx_perm) ? true : false;
result->value.psx_permissions.owner.write = yella_fb_file_posix_permission_write(psx_perm) ? true : false;
result->value.psx_permissions.owner.execute = yella_fb_file_posix_permission_execute(psx_perm) ? true : false;
}
if (yella_fb_file_posix_permissions_group_is_present(psx_perms))
{
psx_perm = yella_fb_file_posix_permissions_group(psx_perms);
result->value.psx_permissions.group.read = yella_fb_file_posix_permission_read(psx_perm) ? true : false;
result->value.psx_permissions.group.write = yella_fb_file_posix_permission_write(psx_perm) ? true : false;
result->value.psx_permissions.group.execute = yella_fb_file_posix_permission_execute(psx_perm) ? true : false;
}
if (yella_fb_file_posix_permissions_other_is_present(psx_perms))
{
psx_perm = yella_fb_file_posix_permissions_other(psx_perms);
result->value.psx_permissions.other.read = yella_fb_file_posix_permission_read(psx_perm) ? true : false;
result->value.psx_permissions.other.write = yella_fb_file_posix_permission_write(psx_perm) ? true : false;
result->value.psx_permissions.other.execute = yella_fb_file_posix_permission_execute(psx_perm) ? true : false;
}
result->value.psx_permissions.set_uid = yella_fb_file_posix_permissions_set_uid(psx_perms) ? true : false;
result->value.psx_permissions.set_gid = yella_fb_file_posix_permissions_set_gid(psx_perms) ? true : false;
result->value.psx_permissions.sticky = yella_fb_file_posix_permissions_sticky(psx_perms) ? true : false;
break;
case yella_fb_file_attr_type_USER:
case yella_fb_file_attr_type_GROUP:
result->type = (yella_fb_file_attr_type(tbl) == yella_fb_file_attr_type_USER) ? ATTR_TYPE_USER : ATTR_TYPE_GROUP;
usr_grp = yella_fb_file_attr_usr_grp(tbl);
result->value.usr_grp.id = yella_fb_file_user_group_id(usr_grp);
result->value.usr_grp.name = yella_from_utf8(yella_fb_file_user_group_name(usr_grp));
break;
case yella_fb_file_attr_type_SIZE:
result->type = ATTR_TYPE_SIZE;
result->value.size = yella_fb_file_attr_unsigned_int(tbl);
break;
case yella_fb_file_attr_type_ACCESS_TIME:
result->type = ATTR_TYPE_ACCESS_TIME;
result->value.millis_since_epoch = yella_fb_file_attr_milliseconds_since_epoch(tbl);
break;
case yella_fb_file_attr_type_METADATA_CHANGE_TIME:
result->type = ATTR_TYPE_METADATA_CHANGE_TIME;
result->value.millis_since_epoch = yella_fb_file_attr_milliseconds_since_epoch(tbl);
break;
case yella_fb_file_attr_type_MODIFICATION_TIME:
result->type = ATTR_TYPE_MODIFICATION_TIME;
result->value.millis_since_epoch = yella_fb_file_attr_milliseconds_since_epoch(tbl);
break;
case yella_fb_file_attr_type_POSIX_ACL:
result->type = ATTR_TYPE_POSIX_ACL;
result->value.posix_acl_entries = yella_create_ptr_vector();
yella_set_ptr_vector_destructor(result->value.posix_acl_entries, acl_entry_destructor, NULL);
if (yella_fb_file_attr_psx_acl_is_present(tbl))
{
acl_entries = yella_fb_file_attr_psx_acl(tbl);
for (i = 0; i < yella_fb_file_posix_access_control_entry_vec_len(acl_entries); i++)
{
fb_entry = yella_fb_file_posix_access_control_entry_vec_at(acl_entries, i);
entry = malloc(sizeof(posix_acl_entry));
entry->type = yella_fb_file_posix_access_control_entry_type(fb_entry) == yella_fb_file_posix_access_control_entry_type_USER ?
PACL_ENTRY_TYPE_USER : PACL_ENTRY_TYPE_GROUP;
usr_grp = yella_fb_file_posix_access_control_entry_usr_grp(fb_entry);
entry->usr_grp.id = yella_fb_file_user_group_id(usr_grp);
entry->usr_grp.name = yella_from_utf8(yella_fb_file_user_group_name(usr_grp));
psx_perm = yella_fb_file_posix_access_control_entry_permission(fb_entry);
entry->perm.read = yella_fb_file_posix_permission_read(psx_perm) ? true : false;
entry->perm.write = yella_fb_file_posix_permission_write(psx_perm) ? true : false;
entry->perm.execute = yella_fb_file_posix_permission_execute(psx_perm) ? true : false;
yella_push_back_ptr_vector(result->value.posix_acl_entries, entry);
}
}
break;
default:
assert(false);
}
return result;
}
void destroy_attribute(attribute* attr)
{
switch (attr->type)
{
case ATTR_TYPE_SHA256:
free(attr->value.byte_array.mem);
break;
case ATTR_TYPE_USER:
case ATTR_TYPE_GROUP:
free(attr->value.usr_grp.name);
break;
case ATTR_TYPE_POSIX_ACL:
yella_destroy_ptr_vector(attr->value.posix_acl_entries);
break;
default:
break;
}
free(attr);
}
attribute_type fb_to_attribute_type(uint16_t fb)
{
attribute_type result;
switch (fb)
{
case yella_fb_file_attr_type_FILE_TYPE:
result = ATTR_TYPE_FILE_TYPE;
break;
case yella_fb_file_attr_type_SHA256:
result = ATTR_TYPE_SHA256;
break;
case yella_fb_file_attr_type_POSIX_PERMISSIONS:
result = ATTR_TYPE_POSIX_PERMISSIONS;
break;
case yella_fb_file_attr_type_USER:
result = ATTR_TYPE_USER;
break;
case yella_fb_file_attr_type_GROUP:
result = ATTR_TYPE_GROUP;
break;
case yella_fb_file_attr_type_SIZE:
result = ATTR_TYPE_SIZE;
break;
case yella_fb_file_attr_type_ACCESS_TIME:
result = ATTR_TYPE_ACCESS_TIME;
break;
case yella_fb_file_attr_type_METADATA_CHANGE_TIME:
result = ATTR_TYPE_METADATA_CHANGE_TIME;
break;
case yella_fb_file_attr_type_MODIFICATION_TIME:
result = ATTR_TYPE_MODIFICATION_TIME;
break;
case yella_fb_file_attr_type_POSIX_ACL:
result = ATTR_TYPE_POSIX_ACL;
break;
default:
assert(false);
}
return result;
}
yella_fb_file_attr_ref_t pack_attribute(const attribute* const attr, flatcc_builder_t* bld)
{
yella_fb_file_attr_type_enum_t fb_type;
char* utf8;
size_t i;
posix_acl_entry* entry;
yella_fb_file_posix_access_control_entry_type_enum_t fb_pacl_type;
yella_fb_file_attr_start(bld);
switch (attr->type)
{
case ATTR_TYPE_FILE_TYPE:
fb_type = yella_fb_file_attr_type_FILE_TYPE;
yella_fb_file_attr_ftype_add(bld, file_type_to_fb(attr->value.integer));
break;
case ATTR_TYPE_SHA256:
fb_type = yella_fb_file_attr_type_SHA256;
yella_fb_file_attr_bytes_add(bld,
flatbuffers_uint8_vec_create(bld,
attr->value.byte_array.mem,
attr->value.byte_array.sz));
break;
case ATTR_TYPE_POSIX_PERMISSIONS:
fb_type = yella_fb_file_attr_type_POSIX_PERMISSIONS;
yella_fb_file_posix_permissions_start(bld);
if (attr->value.psx_permissions.owner.read ||
attr->value.psx_permissions.owner.write ||
attr->value.psx_permissions.owner.execute)
{
yella_fb_file_posix_permissions_owner_add(bld,
yella_fb_file_posix_permission_create(bld,
attr->value.psx_permissions.owner.read,
attr->value.psx_permissions.owner.write,
attr->value.psx_permissions.owner.execute));
}
if (attr->value.psx_permissions.group.read ||
attr->value.psx_permissions.group.write ||
attr->value.psx_permissions.group.execute)
{
yella_fb_file_posix_permissions_group_add(bld,
yella_fb_file_posix_permission_create(bld,
attr->value.psx_permissions.group.read,
attr->value.psx_permissions.group.write,
attr->value.psx_permissions.group.execute));
}
if (attr->value.psx_permissions.other.read ||
attr->value.psx_permissions.other.write ||
attr->value.psx_permissions.other.execute)
{
yella_fb_file_posix_permissions_other_add(bld,
yella_fb_file_posix_permission_create(bld,
attr->value.psx_permissions.other.read,
attr->value.psx_permissions.other.write,
attr->value.psx_permissions.other.execute));
}
if (attr->value.psx_permissions.set_uid)
yella_fb_file_posix_permissions_set_uid_add(bld, true);
if (attr->value.psx_permissions.set_gid)
yella_fb_file_posix_permissions_set_gid_add(bld, true);
if (attr->value.psx_permissions.sticky)
yella_fb_file_posix_permissions_sticky_add(bld, true);
yella_fb_file_attr_psx_permissions_add(bld, yella_fb_file_posix_permissions_end(bld));
break;
case ATTR_TYPE_USER:
case ATTR_TYPE_GROUP:
fb_type = (attr->type == ATTR_TYPE_USER) ? yella_fb_file_attr_type_USER : yella_fb_file_attr_type_GROUP;
yella_fb_file_user_group_start(bld);
yella_fb_file_user_group_id_add(bld, attr->value.usr_grp.id);
utf8 = yella_to_utf8(attr->value.usr_grp.name);
yella_fb_file_user_group_name_create_str(bld, utf8);
free(utf8);
yella_fb_file_attr_usr_grp_add(bld, yella_fb_file_user_group_end(bld));
break;
case ATTR_TYPE_SIZE:
fb_type = yella_fb_file_attr_type_SIZE;
yella_fb_file_attr_unsigned_int_add(bld, attr->value.size);
break;
case ATTR_TYPE_ACCESS_TIME:
fb_type = yella_fb_file_attr_type_ACCESS_TIME;
yella_fb_file_attr_milliseconds_since_epoch_add(bld, attr->value.millis_since_epoch);
break;
case ATTR_TYPE_METADATA_CHANGE_TIME:
fb_type = yella_fb_file_attr_type_METADATA_CHANGE_TIME;
yella_fb_file_attr_milliseconds_since_epoch_add(bld, attr->value.millis_since_epoch);
break;
case ATTR_TYPE_MODIFICATION_TIME:
fb_type = yella_fb_file_attr_type_MODIFICATION_TIME;
yella_fb_file_attr_milliseconds_since_epoch_add(bld, attr->value.millis_since_epoch);
break;
case ATTR_TYPE_POSIX_ACL:
fb_type = yella_fb_file_attr_type_POSIX_ACL;
if (yella_ptr_vector_size(attr->value.posix_acl_entries) > 0)
{
yella_fb_file_posix_access_control_entry_vec_start(bld);
for (i = 0; i < yella_ptr_vector_size(attr->value.posix_acl_entries); i++)
{
entry = yella_ptr_vector_at(attr->value.posix_acl_entries, i);
yella_fb_file_posix_access_control_entry_start(bld);
if (entry->type == PACL_ENTRY_TYPE_USER)
fb_pacl_type = yella_fb_file_posix_access_control_entry_type_USER;
else if (entry->type == PACL_ENTRY_TYPE_GROUP)
fb_pacl_type = yella_fb_file_posix_access_control_entry_type_GROUP;
else if (entry->type == PACL_ENTRY_TYPE_MASK)
fb_pacl_type = yella_fb_file_posix_access_control_entry_type_MASK;
else if (entry->type == PACL_ENTRY_TYPE_USER_OBJ)
fb_pacl_type = yella_fb_file_posix_access_control_entry_type_USER_OBJ;
else if (entry->type == PACL_ENTRY_TYPE_GROUP_OBJ)
fb_pacl_type = yella_fb_file_posix_access_control_entry_type_GROUP_OBJ;
else if (entry->type == PACL_ENTRY_TYPE_OTHER)
fb_pacl_type = yella_fb_file_posix_access_control_entry_type_OTHER;
yella_fb_file_posix_access_control_entry_type_add(bld, fb_pacl_type);
if (entry->type == PACL_ENTRY_TYPE_USER || entry->type == PACL_ENTRY_TYPE_GROUP)
{
utf8 = yella_to_utf8(entry->usr_grp.name);
yella_fb_file_posix_access_control_entry_usr_grp_add(bld, yella_fb_file_user_group_create(bld,
entry->usr_grp.id,
flatbuffers_string_create_str(
bld,
utf8)));
free(utf8);
}
yella_fb_file_posix_access_control_entry_permission_add(bld, yella_fb_file_posix_permission_create(bld, entry->perm.read, entry->perm.write, entry->perm.execute));
yella_fb_file_posix_access_control_entry_vec_push(bld, yella_fb_file_posix_access_control_entry_end(bld));
}
yella_fb_file_attr_psx_acl_add(bld, yella_fb_file_posix_access_control_entry_vec_end(bld));
}
break;
default:
assert(false);
}
yella_fb_file_attr_type_add(bld, fb_type);
return yella_fb_file_attr_end(bld);
}
| 43.839679 | 179 | 0.632337 |
ec05efa7f754104cb44b17c5135491643708dff3
| 22,383 |
kt
|
Kotlin
|
src/main/kotlin/germanskript/Interpretierer.kt
|
lulugo19/GermanScript
|
bafd9d81ce1ad130d3cf9036138dcdb74777db69
|
[
"MIT"
] | 5 |
2020-07-23T10:45:12.000Z
|
2021-06-03T22:28:21.000Z
|
src/main/kotlin/germanskript/Interpretierer.kt
|
lulugo19/GermanSkript
|
bafd9d81ce1ad130d3cf9036138dcdb74777db69
|
[
"MIT"
] | 4 |
2020-06-22T13:52:57.000Z
|
2020-07-21T14:25:14.000Z
|
src/main/kotlin/germanskript/Interpretierer.kt
|
lulugo19/GermanScript
|
bafd9d81ce1ad130d3cf9036138dcdb74777db69
|
[
"MIT"
] | null | null | null |
package germanskript
import germanskript.intern.*
import java.io.File
import java.util.*
import kotlin.collections.HashMap
import kotlin.math.*
import kotlin.random.Random
typealias WerfeFehler = (String, String, Token) -> Objekt
typealias InterpretiereInjectionMethodenAufruf = (String, Token, Objekt, List<Objekt>) -> Objekt
class Interpretierer(startDatei: File): PipelineKomponente(startDatei) {
private val codeGenerator = CodeGenerator(startDatei)
private val typPrüfer = codeGenerator.typPrüfer
private var aufrufStapel = AufrufStapel()
private val flags = EnumSet.noneOf(Flag::class.java)
private var geworfenerFehler: Objekt? = null
private var geworfenerFehlerToken: Token? = null
private lateinit var rückgabeWert: Objekt
private val klassenDefinitionen = HashMap<String, Pair<AST.Definition.Typdefinition.Klasse, IM_AST.Definition.Klasse>>()
private val umgebung: Umgebung get() = aufrufStapel.top().umgebung
private val globaleVariablen: Bereich get() = aufrufStapel.stapel.firstElement().umgebung.bereiche.firstElement()
private lateinit var interpretInjection: InterpretInjection
companion object {
val preloadedKlassenDefinitionen = arrayOf("Fehler", "KonvertierungsFehler", "SchlüsselNichtGefundenFehler", "IndexFehler")
}
object Konstanten {
const val CALL_STACK_OUTPUT_LIMIT = 50
}
// region Klassen
private enum class Flag {
SCHLEIFE_ABBRECHEN,
SCHLEIFE_FORTFAHREN,
ZURÜCK,
FEHLER_GEWORFEN,
}
class Bereich {
val variablen: HashMap<String, Objekt> = HashMap()
fun leseVariable(varName: String): Objekt? {
return variablen[varName]
}
fun schreibeVariable(varName: String, wert: Objekt) {
variablen[varName] = wert
}
}
class Umgebung() {
val bereiche = Stack<Bereich>()
fun leseVariable(varName: String): Objekt? {
return bereiche.findLast { bereich -> bereich.variablen.containsKey(varName) }?.leseVariable(varName)
}
fun schreibeVariable(varName: String, wert: Objekt, überschreibe: Boolean) {
val bereich = if (überschreibe) {
bereiche.findLast { it.variablen.containsKey(varName) } ?: bereiche.peek()!!
} else bereiche.peek()!!
bereich.schreibeVariable(varName, wert)
}
fun pushBereich() {
bereiche.push(Bereich())
}
fun popBereich() {
bereiche.pop()
}
override fun toString(): String {
return bereiche.map { it.variablen.entries }.flatten().joinToString("\n") {
"${it.key} -> ${it.value}"
}
}
}
class AufrufStapelElement(val funktionsAufruf: IM_AST.Satz.Ausdruck.IAufruf, val objekt: Objekt?, val umgebung: Umgebung)
class AufrufStapel {
val stapel = Stack<AufrufStapelElement>()
fun top(): AufrufStapelElement = stapel.peek()
fun push(funktionsAufruf: IM_AST.Satz.Ausdruck.IAufruf, neueUmgebung: Umgebung, aufrufObjekt: Objekt? = null) {
stapel.push(AufrufStapelElement(funktionsAufruf, aufrufObjekt, neueUmgebung))
}
fun pop(): AufrufStapelElement = stapel.pop()
override fun toString(): String {
if (stapel.isEmpty()) {
return ""
}
return "Aufrufstapel:\n"+ stapel.drop(1).reversed().joinToString(
"\n",
"\t",
"",
Konstanten.CALL_STACK_OUTPUT_LIMIT,
"...",
::aufrufStapelElementToString
)
}
private fun aufrufStapelElementToString(element: AufrufStapelElement): String {
val aufruf = element.funktionsAufruf
var zeichenfolge = "'${aufruf.name}' in ${aufruf.token.position}"
if (element.objekt != null) {
val klassenName = element.objekt.typ.definition.name.hauptWort
zeichenfolge = "'für $klassenName: ${aufruf.name}' in ${aufruf.token.position}"
}
return zeichenfolge
}
}
class InterpretInjection(
val aufrufStapel: AufrufStapel,
val werfeFehler: WerfeFehler,
val interpretiereInjectionMethodenAufruf: InterpretiereInjectionMethodenAufruf,
val startDatei: File
) {
val umgebung: Umgebung get() = aufrufStapel.stapel.peek()!!.umgebung
}
// endregion
fun interpretiere() {
val programm = codeGenerator.generiere()
initKlassenDefinitionen()
interpretInjection = InterpretInjection(
aufrufStapel,
::werfeFehler,
::interpretiereInjectionMethodenAufruf,
startDatei
)
try {
interpretiereFunktionsAufruf(programm)
if (flags.contains(Flag.FEHLER_GEWORFEN)) {
werfeLaufZeitFehler()
}
}
catch (fehler: Throwable) {
when (fehler) {
// Ein StackOverflow wird als Laufzeitfehler in Germanskript gehandelt
is StackOverflowError -> throw GermanSkriptFehler.LaufzeitFehler(
aufrufStapel.top().funktionsAufruf.token,
aufrufStapel.toString(),
"Stack Overflow")
// andere Fehler sollten nicht auftreten
else -> {
System.err.println(aufrufStapel.toString())
throw fehler
}
}
}
}
private fun initKlassenDefinitionen() {
for (klassenString in preloadedKlassenDefinitionen) {
val definition = typPrüfer.typisierer.definierer.holeTypDefinition(klassenString, null)
as AST.Definition.Typdefinition.Klasse
klassenDefinitionen[klassenString] = Pair(definition, codeGenerator.klassen[definition]!!)
}
}
private fun werfeFehler(fehlerMeldung: String, fehlerKlassenName: String, token: Token): Objekt {
val (astKlassenDefinition, immKlassenDefinition) = klassenDefinitionen.getValue(fehlerKlassenName)
geworfenerFehler = Objekt.SkriptObjekt(immKlassenDefinition, Typ.Compound.Klasse(astKlassenDefinition, emptyList()))
geworfenerFehler!!.setzeEigenschaft("FehlerMeldung", Zeichenfolge(fehlerMeldung))
geworfenerFehlerToken = token
flags.add(Flag.FEHLER_GEWORFEN)
return Niemals
}
private fun werfeLaufZeitFehler() {
flags.remove(Flag.FEHLER_GEWORFEN)
val alsZeichenfolge = geworfenerFehler!!.klasse.methoden.getValue("als Zeichenfolge")
val aufruf = object : IM_AST.Satz.Ausdruck.IAufruf {
override val token: Token = geworfenerFehler!!.typ.definition.konvertierungen.getValue("Zeichenfolge").typ.name.bezeichnerToken
override val name = "als Zeichenfolge"
override val argumente: List<IM_AST.Satz.Ausdruck> = emptyList()
}
val zeichenfolge = interpretiereAufruf(
Umgebung(),
aufruf,
alsZeichenfolge,
geworfenerFehler
) as Zeichenfolge
throw GermanSkriptFehler.UnbehandelterFehler(geworfenerFehlerToken!!, aufrufStapel.toString(), zeichenfolge.zeichenfolge)
}
// region Sätze
private fun interpretiereVariablenDeklaration(variablenDeklaration: IM_AST.Satz.VariablenDeklaration): Objekt {
val wert = interpretiereAusdruck(variablenDeklaration.wert)
umgebung.schreibeVariable(
variablenDeklaration.name,
wert, variablenDeklaration.überschreibe
)
return if (fehlerGeworfen()) Niemals else Nichts
}
private fun interpretiereSetzeEigenschaft(setzeEigenschaft: IM_AST.Satz.SetzeEigenschaft): Objekt {
val objekt = interpretiereAusdruck(setzeEigenschaft.objekt).also { if (fehlerGeworfen()) return Niemals}
objekt.setzeEigenschaft(
setzeEigenschaft.name,
interpretiereAusdruck(setzeEigenschaft.ausdruck).also { if (fehlerGeworfen()) return Niemals}
)
return Nichts
}
private fun interpretiereSolangeSchleife(schleife: IM_AST.Satz.SolangeSchleife): Objekt {
while (!flags.contains(Flag.SCHLEIFE_ABBRECHEN) &&
!flags.contains(Flag.ZURÜCK) &&
(interpretiereAusdruck(schleife.bedingungsTerm.bedingung).also { if (fehlerGeworfen()) return Niemals}
as germanskript.intern.Boolean).boolean
) {
flags.remove(Flag.SCHLEIFE_FORTFAHREN)
interpretiereBereich(schleife.bedingungsTerm.bereich, true)
}
flags.remove(Flag.SCHLEIFE_ABBRECHEN)
return Nichts
}
private fun interpretiereIntern(intern: IM_AST.Satz.Intern): Objekt {
val aufruf = aufrufStapel.top().funktionsAufruf
return when (val objekt = aufrufStapel.top().objekt) {
is Objekt -> objekt.rufeMethodeAuf(aufruf, interpretInjection)
else -> interneFunktionen.getValue(aufruf.name)()
}.also { rückgabeWert = it }
}
private fun interpretiereZurückgabe(zurückgabe: IM_AST.Satz.Zurückgabe): Objekt {
return interpretiereAusdruck(zurückgabe.ausdruck).also {
flags.add(Flag.ZURÜCK)
rückgabeWert = it
}
}
// endregion
// region Ausdrücke
private fun interpretiereAusdruck(ausdruck: IM_AST.Satz.Ausdruck): Objekt {
if (fehlerGeworfen()) {
return Niemals
}
return when (ausdruck) {
is IM_AST.Satz.Ausdruck.LogischesUnd -> interpretiereLogischesUnd(ausdruck)
is IM_AST.Satz.Ausdruck.LogischesOder -> interpretiereLogischesOder(ausdruck)
is IM_AST.Satz.Ausdruck.LogischesNicht -> interpretiereLogischesNicht(ausdruck)
is IM_AST.Satz.Ausdruck.Vergleich -> interpretiereVergleich(ausdruck)
is IM_AST.Satz.Ausdruck.Bereich -> interpretiereBereich(ausdruck, true)
is IM_AST.Satz.Ausdruck.Bedingung -> interpretiereBedingung(ausdruck)
is IM_AST.Satz.Ausdruck.FunktionsAufruf -> interpretiereFunktionsAufruf(ausdruck)
is IM_AST.Satz.Ausdruck.MethodenAufruf -> interpretiereMethodenAufruf(ausdruck)
is IM_AST.Satz.Ausdruck.Variable -> interpretiereVariable(ausdruck)
is IM_AST.Satz.Ausdruck.Eigenschaft -> interpretiereEigenschaft(ausdruck)
is IM_AST.Satz.Ausdruck.ObjektInstanziierung -> interpretiereObjektInstanziierung(ausdruck)
is IM_AST.Satz.Ausdruck.Konstante.Zahl -> Zahl(ausdruck.zahl)
is IM_AST.Satz.Ausdruck.Konstante.Zeichenfolge -> Zeichenfolge(ausdruck.zeichenfolge)
is IM_AST.Satz.Ausdruck.Konstante.Boolean -> Boolean(ausdruck.boolean)
IM_AST.Satz.Ausdruck.Konstante.Nichts -> Nichts
is IM_AST.Satz.Ausdruck.VersucheFange -> interpretiereVersucheFange(ausdruck)
is IM_AST.Satz.Ausdruck.Werfe -> interpretiereWerfe(ausdruck)
is IM_AST.Satz.Ausdruck.TypÜberprüfung -> interpretiereTypÜberprüfung(ausdruck)
is IM_AST.Satz.Ausdruck.TypCast -> interpretiereTypCast(ausdruck)
}.let { if (fehlerGeworfen()) {Niemals} else it }
}
private fun interpretiereVariable(variable: IM_AST.Satz.Ausdruck.Variable): Objekt {
return umgebung.leseVariable(variable.name) ?:
globaleVariablen.leseVariable(variable.name)!!
}
private fun interpretiereObjektInstanziierung(instanziierung: IM_AST.Satz.Ausdruck.ObjektInstanziierung): Objekt {
// TODO: Wie löse ich das Problem, dass hier interne Objekte instanziiert werden können eleganter?
return when(instanziierung.klasse.name) {
"Liste" -> Liste(instanziierung.typ, mutableListOf())
"HashMap" -> germanskript.intern.HashMap(instanziierung.typ)
"HashSet" -> germanskript.intern.HashSet(instanziierung.typ)
"Datei" -> Datei()
else ->
if (instanziierung.objektArt != IM_AST.Satz.Ausdruck.ObjektArt.Klasse)
Objekt.ClosureObjekt(instanziierung.klasse, instanziierung.typ, umgebung, instanziierung.objektArt)
else Objekt.SkriptObjekt(instanziierung.klasse, instanziierung.typ)
}
}
private fun interpretiereEigenschaft(eigenschaft: IM_AST.Satz.Ausdruck.Eigenschaft): Objekt {
val objekt = interpretiereAusdruck(eigenschaft.objekt)
return objekt.holeEigenschaft(eigenschaft.name)
}
private fun interpretiereBedingungsTerm(term: IM_AST.Satz.BedingungsTerm): Objekt? {
return if (!fehlerGeworfen() && (interpretiereAusdruck(term.bedingung) as germanskript.intern.Boolean).boolean) {
interpretiereBereich(term.bereich, true)
} else {
null
}
}
private fun interpretiereBedingung(bedingungsSatz: IM_AST.Satz.Ausdruck.Bedingung): Objekt {
val inBedingung = bedingungsSatz.bedingungen.any { bedingung ->
interpretiereBedingungsTerm(bedingung)?.also { return it } != null
}
return if (!inBedingung && bedingungsSatz.sonst != null ) {
interpretiereBereich(bedingungsSatz.sonst, true)
} else {
return Nichts
}
}
private fun interpretiereVersucheFange(versucheFange: IM_AST.Satz.Ausdruck.VersucheFange): Objekt {
var rückgabe = interpretiereBereich(versucheFange.versuchBereich, true)
if (flags.contains(Flag.FEHLER_GEWORFEN)) {
val fehlerObjekt = geworfenerFehler!!
val fehlerKlasse = fehlerObjekt.typ
val fange = versucheFange.fange.find { fange ->
typPrüfer.typIstTyp(fehlerKlasse, fange.typ)
}
if (fange != null) {
flags.remove(Flag.FEHLER_GEWORFEN)
umgebung.pushBereich()
umgebung.schreibeVariable(fange.param, fehlerObjekt, false)
rückgabe = interpretiereBereich(fange.bereich, false)
umgebung.popBereich()
}
}
if (versucheFange.schlussendlich != null) {
val fehlerGeworfen = flags.contains(Flag.FEHLER_GEWORFEN)
flags.remove(Flag.FEHLER_GEWORFEN)
interpretiereBereich(versucheFange.schlussendlich, true)
if (fehlerGeworfen) {
flags.add(Flag.FEHLER_GEWORFEN)
}
}
return rückgabe
}
private fun interpretiereWerfe(werfe: IM_AST.Satz.Ausdruck.Werfe): Objekt {
geworfenerFehler = interpretiereAusdruck(werfe.ausdruck)
geworfenerFehlerToken = werfe.werfe.toUntyped()
flags.add(Flag.FEHLER_GEWORFEN)
return Niemals
}
private fun interpretiereTypÜberprüfung(typÜberprüfung: IM_AST.Satz.Ausdruck.TypÜberprüfung): Objekt {
val typ = interpretiereAusdruck(typÜberprüfung.ausdruck).typ
val istTyp = typPrüfer.typIstTyp(typ, typÜberprüfung.typ)
return Boolean(istTyp)
}
private fun interpretiereTypCast(typCast: IM_AST.Satz.Ausdruck.TypCast): Objekt {
val wert = interpretiereAusdruck(typCast.ausdruck)
return if (typPrüfer.typIstTyp(wert.typ, typCast.zielTyp)) {
wert
} else {
val fehlerMeldung = "Ungültige Konvertierung!\n" +
"Die Klasse '${wert.klasse.name}' kann nicht nach '${typCast.zielTyp}' konvertiert werden."
werfeFehler(fehlerMeldung, "KonvertierungsFehler", typCast.token)
}
}
private fun interpretiereLogischesUnd(logischesUnd: IM_AST.Satz.Ausdruck.LogischesUnd): Objekt {
return Boolean(
(interpretiereAusdruck(logischesUnd.links) as germanskript.intern.Boolean).boolean &&
(interpretiereAusdruck(logischesUnd.rechts) as germanskript.intern.Boolean).boolean
)
}
private fun interpretiereLogischesOder(logischesOder: IM_AST.Satz.Ausdruck.LogischesOder): Objekt {
return Boolean(
(interpretiereAusdruck(logischesOder.links) as germanskript.intern.Boolean).boolean ||
(interpretiereAusdruck(logischesOder.rechts) as germanskript.intern.Boolean).boolean
)
}
private fun interpretiereLogischesNicht(logischesNicht: IM_AST.Satz.Ausdruck.LogischesNicht): Objekt {
return Boolean(!(interpretiereAusdruck(logischesNicht.ausdruck) as germanskript.intern.Boolean).boolean)
}
private fun interpretiereVergleich(vergleich: IM_AST.Satz.Ausdruck.Vergleich): Objekt {
val vergleichsWert = (interpretiereMethodenAufruf(vergleich.vergleichsMethode) as Zahl).zahl
return when (vergleich.operator) {
IM_AST.Satz.Ausdruck.VergleichsOperator.KLEINER -> Boolean(vergleichsWert < 0)
IM_AST.Satz.Ausdruck.VergleichsOperator.GRÖSSER -> Boolean(vergleichsWert > 0)
IM_AST.Satz.Ausdruck.VergleichsOperator.KLEINER_GLEICH -> Boolean(vergleichsWert <= 0)
IM_AST.Satz.Ausdruck.VergleichsOperator.GRÖSSER_GLEICH -> Boolean(vergleichsWert >= 0)
}
}
private fun sollteAbbrechen(): Boolean {
return flags.contains(Flag.SCHLEIFE_FORTFAHREN) ||
flags.contains(Flag.SCHLEIFE_ABBRECHEN) ||
flags.contains(Flag.ZURÜCK)
}
private fun fehlerGeworfen(): Boolean = flags.contains(Flag.FEHLER_GEWORFEN)
private fun interpretiereBereich(bereich: IM_AST.Satz.Ausdruck.Bereich, neuerBereich: Boolean): Objekt {
if (neuerBereich) {
umgebung.pushBereich()
}
var rückgabe: Objekt = Nichts
for (satz in bereich.sätze) {
if (sollteAbbrechen()) {
return Nichts
}
if (fehlerGeworfen()) {
return Nichts
}
rückgabe = when (satz) {
is IM_AST.Satz.Intern -> interpretiereIntern(satz)
IM_AST.Satz.Fortfahren -> flags.add(Flag.SCHLEIFE_FORTFAHREN).let { Nichts }
IM_AST.Satz.Abbrechen -> flags.add(Flag.SCHLEIFE_ABBRECHEN).let { Nichts }
is IM_AST.Satz.Zurückgabe -> interpretiereZurückgabe(satz)
is IM_AST.Satz.VariablenDeklaration -> interpretiereVariablenDeklaration(satz)
is IM_AST.Satz.SetzeEigenschaft -> interpretiereSetzeEigenschaft(satz)
is IM_AST.Satz.SolangeSchleife -> interpretiereSolangeSchleife(satz)
is IM_AST.Satz.Ausdruck -> interpretiereAusdruck(satz)
}
}
if (neuerBereich) {
umgebung.popBereich()
}
return rückgabe
}
private fun interpretiereAufruf(
aufrufUmgebung: Umgebung,
funktionsAufruf: IM_AST.Satz.Ausdruck.IAufruf,
funktionsDefinition: IM_AST.Definition.Funktion,
aufrufObjekt: Objekt?
): Objekt {
aufrufUmgebung.pushBereich()
val parameter = funktionsDefinition.parameter
val argumente = funktionsAufruf.argumente
for (index in parameter.indices) {
aufrufUmgebung.schreibeVariable(
parameter[index],
interpretiereAusdruck(argumente[index]),
false
)
if (fehlerGeworfen()) {
return Niemals
}
}
if (aufrufObjekt != null) {
aufrufUmgebung.schreibeVariable(CodeGenerator.SELBST_VAR_NAME, aufrufObjekt, false)
}
aufrufStapel.push(funktionsAufruf, aufrufUmgebung, aufrufObjekt)
rückgabeWert = Nichts
return interpretiereBereich(funktionsDefinition.körper!!, false).let {
aufrufStapel.pop()
if (aufrufObjekt != null && aufrufObjekt is Objekt.ClosureObjekt
&& aufrufObjekt.objektArt == IM_AST.Satz.Ausdruck.ObjektArt.Lambda) it else rückgabeWert.also {
flags.remove(Flag.ZURÜCK)
}
}
}
private fun interpretiereFunktionsAufruf(funktionsAufruf: IM_AST.Satz.Ausdruck.FunktionsAufruf): Objekt {
return interpretiereAufruf(Umgebung(), funktionsAufruf, funktionsAufruf.funktion, null)
}
private fun interpretiereMethodenAufruf(methodenAufruf: IM_AST.Satz.Ausdruck.MethodenAufruf): Objekt {
val objekt = interpretiereAusdruck(methodenAufruf.objekt).also { if (fehlerGeworfen()) return Niemals }
val aufrufUmgebung = if (objekt is Objekt.ClosureObjekt) objekt.umgebung else Umgebung()
val funktionsDefinition = methodenAufruf.funktion ?: objekt.klasse.methoden.getValue(methodenAufruf.name)
return interpretiereAufruf(aufrufUmgebung, methodenAufruf, funktionsDefinition, objekt)
}
private fun interpretiereInjectionMethodenAufruf(methodenName: String, token: Token, objekt: Objekt, argumente: List<Objekt>): Objekt {
val aufrufUmgebung = if (objekt is Objekt.ClosureObjekt) objekt.umgebung else Umgebung()
val funktionsDefinition = objekt.klasse.methoden.getValue(methodenName)
aufrufUmgebung.pushBereich()
val parameter = funktionsDefinition.parameter
for (index in parameter.indices) {
aufrufUmgebung.schreibeVariable(
parameter[index],
argumente[index],
false
)
if (fehlerGeworfen()) {
return Niemals
}
}
aufrufUmgebung.schreibeVariable(CodeGenerator.SELBST_VAR_NAME, objekt, false)
aufrufStapel.push(object: IM_AST.Satz.Ausdruck.IAufruf {
override val name = methodenName
override val token = token
// TODO: Das sollte hier nicht leer sein!
override val argumente = emptyList<IM_AST.Satz.Ausdruck>()
}, aufrufUmgebung, objekt)
rückgabeWert = Nichts
return interpretiereBereich(funktionsDefinition.körper!!, false).let {
aufrufStapel.pop()
if (objekt is Objekt.ClosureObjekt
&& objekt.objektArt == IM_AST.Satz.Ausdruck.ObjektArt.Lambda) it else rückgabeWert.also {
flags.remove(Flag.ZURÜCK)
}
}
}
// endregion
// region interne Funktionen
private val interneFunktionen = mapOf<String, () -> (Objekt)>(
"schreibe die Zeichenfolge" to {
val zeichenfolge = umgebung.leseVariable("Zeichenfolge") as Zeichenfolge
print(zeichenfolge)
Nichts
},
"schreibe die Zeile" to {
val zeile = umgebung.leseVariable("Zeile") as Zeichenfolge
println(zeile)
Nichts
},
"schreibe die Zahl" to {
val zahl = umgebung.leseVariable("Zahl") as Zahl
println(zahl)
Nichts
},
"schreibe die Meldung" to {
val zeichenfolge = umgebung.leseVariable("FehlerMeldung") as Zahl
System.err.println(zeichenfolge)
Nichts
},
"erstelle aus dem Code" to {
val zeichenfolge = umgebung.leseVariable("Code") as Zahl
Zeichenfolge(zeichenfolge.toInt().toChar().toString())
},
"lese" to {
Zeichenfolge(readLine()!!)
},
"runde die Zahl" to {
val zahl = umgebung.leseVariable("Zahl") as Zahl
Zahl(round(zahl.zahl))
},
"runde die Zahl ab" to {
val zahl = umgebung.leseVariable("Zahl") as Zahl
Zahl(floor(zahl.zahl))
},
"runde die Zahl auf" to {
val zahl = umgebung.leseVariable("Zahl") as Zahl
Zahl(ceil(zahl.zahl))
},
"sinus von der Zahl" to {
val zahl = umgebung.leseVariable("Zahl") as Zahl
Zahl(sin(zahl.zahl))
},
"cosinus von der Zahl" to {
val zahl = umgebung.leseVariable("Zahl") as Zahl
Zahl(cos(zahl.zahl))
},
"tangens von der Zahl" to {
val zahl = umgebung.leseVariable("Zahl") as Zahl
Zahl(tan(zahl.zahl))
},
"wurzel von der Zahl" to {
val zahl = umgebung.leseVariable("Zahl") as Zahl
Zahl(sqrt(zahl.zahl))
},
"randomisiere" to {
Zahl(Random.nextDouble())
},
"randomisiere zwischen dem Minimum, dem Maximum" to {
val min = umgebung.leseVariable("Minimum") as Zahl
val max = umgebung.leseVariable("Maximum") as Zahl
Zahl(Random.nextDouble(min.zahl, max.zahl))
}
)
// endregion
}
| 36.935644 | 137 | 0.704865 |
67df42d567965bced321f4a905df7ec611a80168
| 785 |
sql
|
SQL
|
local_migrations/20181024005814_add_trial_tsp_users.sql
|
mr337/mymove
|
42b08f2c6dcc95d58f0a3d32d63013c9a6a8426d
|
[
"MIT"
] | 46 |
2018-02-08T19:15:16.000Z
|
2022-03-18T17:52:04.000Z
|
local_migrations/20181024005814_add_trial_tsp_users.sql
|
mr337/mymove
|
42b08f2c6dcc95d58f0a3d32d63013c9a6a8426d
|
[
"MIT"
] | 5,729 |
2018-01-19T01:11:09.000Z
|
2022-03-31T21:46:17.000Z
|
local_migrations/20181024005814_add_trial_tsp_users.sql
|
mr337/mymove
|
42b08f2c6dcc95d58f0a3d32d63013c9a6a8426d
|
[
"MIT"
] | 39 |
2018-02-01T22:31:08.000Z
|
2022-03-25T17:43:10.000Z
|
-- Local test migration.
-- This will be run on development environments. It should mirror what you
-- intend to apply on production, but do not include any sensitive data.
INSERT INTO public.tsp_users
VALUES (
uuid_generate_v4(), NULL,
'Donkey', 'Kong', NULL,
'd.kong@example.com', '(555) 342-4654',
'd7c0e4e0-ddcf-47b8-bdfd-6c0bce555b28',
now(), now()
);
INSERT INTO public.tsp_users
VALUES (
uuid_generate_v4(), NULL,
'Michael', 'Jackson', NULL,
'michaelj@example.com', '(555) 432-8098',
'd7c0e4e0-ddcf-47b8-bdfd-6c0bce555b28',
now(), now()
);
INSERT INTO public.tsp_users
VALUES (
uuid_generate_v4(), NULL,
'Joey', 'Schabadoo', 'Joe-Joe',
'j.jj.shabadoo@example.com', '(555) 348-9080',
'd7c0e4e0-ddcf-47b8-bdfd-6c0bce555b28',
now(), now()
);
| 25.322581 | 74 | 0.681529 |
90f8b820017fdf120c9b12eef43db55e08a459fc
| 4,211 |
swift
|
Swift
|
JudoKit_iOSTests/Sevices/iDeal/JPIDEALServiceTest.swift
|
Judopay/JudoKit-iOS
|
0866f67e149082596b024c55e45c2e628d373026
|
[
"MIT"
] | 1 |
2020-07-29T07:46:24.000Z
|
2020-07-29T07:46:24.000Z
|
JudoKit_iOSTests/Sevices/iDeal/JPIDEALServiceTest.swift
|
Judopay/JudoKit-iOS
|
0866f67e149082596b024c55e45c2e628d373026
|
[
"MIT"
] | 111 |
2020-05-06T01:08:57.000Z
|
2021-11-14T22:24:36.000Z
|
JudoKit_iOSTests/Sevices/iDeal/JPIDEALServiceTest.swift
|
Judopay/JudoKit-iOS
|
0866f67e149082596b024c55e45c2e628d373026
|
[
"MIT"
] | 4 |
2020-06-17T12:46:21.000Z
|
2021-06-29T10:10:10.000Z
|
//
// JPIDEALServiceTest.swift
// JudoKit_iOSTests
//
// Copyright (c) 2020 Alternative Payments Ltd
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
import XCTest
@testable import JudoKit_iOS
class JPIDEALServiceTest: XCTestCase {
lazy var service = JPApiServiceiDealStub()
lazy var configuration = JPConfiguration(judoID: "judoId",
amount: JPAmount("123", currency: "EUR"),
reference: JPReference(consumerReference: "consumerReference"))
var sut: JPIDEALService! = nil
let bank = JPIDEALBank(type: .ING)
override func setUp() {
super.setUp()
HTTPStubs.setEnabled(true)
sut = JPIDEALService(configuration:configuration,
apiService:service)
}
override func tearDown() {
HTTPStubs.removeAllStubs()
super.tearDown()
}
/*
* GIVEN: JPIDEALService calling bank sale point
*
* WHEN: Every parameter in config model is valid
*
* THEN: should return valid response
*/
func test_RedirectURL_WhenBankiDeal_ShouldReturnValidiDealResponse() {
let expectation = self.expectation(description: "get response from iDeal sale")
let completion: JPCompletionBlock = { (response, error) in
XCTAssertNotNil(response)
XCTAssertNil(error)
expectation.fulfill()
}
sut.redirectURL(for: bank, completion: completion)
waitForExpectations(timeout: 5, handler: nil)
}
/*
* GIVEN: JPIDEALService polling status
*
* WHEN: response is stuck at Pending status for more then 60 sec (kTimerDuration)
*
* THEN: should return error: "Request did not complete in the specified time"
*/
func test_PollTransactionStatus_WhenPendingInfinite_ShouldThrowErrorAfterkTimerDuration() {
let expectation = self.expectation(description: "get response from iDeal pending sale")
let completion: JPCompletionBlock = { (response, error) in
XCTAssertNil(response)
XCTAssertEqual(error?.localizedDescription, "The request has timed out.")
expectation.fulfill()
}
sut.pollTransactionStatus(forOrderId: "", checksum: "", completion: completion)
waitForExpectations(timeout: 65, handler: nil)
}
/*
* GIVEN: JPIDEALService polling status
*
* WHEN: response handled successfully
*
* THEN: should return response with status "SUCCESS"
*/
func test_PollTransactionStatus_WhenResponseSuccess_ShouldReturnSuccess() {
let expectation = self.expectation(description: "get response from iDeal success sale")
let completion: JPCompletionBlock = { (response, error) in
XCTAssertEqual(response?.orderDetails?.orderStatus, "SUCCESS")
XCTAssertNil(error)
expectation.fulfill()
}
sut.pollTransactionStatus(forOrderId: "123456", checksum: "", completion: completion)
waitForExpectations(timeout: 5, handler: nil)
}
}
| 38.990741 | 108 | 0.665638 |
bee4b73e57759fbe6a0d76b9905eed848e04ba16
| 953 |
html
|
HTML
|
manuscript/page-1115/body.html
|
marvindanig/the-iliad
|
3982f687b6808a6db81d484cd85930ba4f0c4b97
|
[
"BlueOak-1.0.0",
"MIT"
] | null | null | null |
manuscript/page-1115/body.html
|
marvindanig/the-iliad
|
3982f687b6808a6db81d484cd85930ba4f0c4b97
|
[
"BlueOak-1.0.0",
"MIT"
] | null | null | null |
manuscript/page-1115/body.html
|
marvindanig/the-iliad
|
3982f687b6808a6db81d484cd85930ba4f0c4b97
|
[
"BlueOak-1.0.0",
"MIT"
] | null | null | null |
<div class="leaf flex"><div class="inner justify"><p class="no-indent ">bleed,</p><p>Nor must thy corse lie honour'd on the bier,</p><p>Nor spouse, nor mother, grace thee with a tear!</p><p>Far from our pious rites those dear remains</p><p>Must feast the vultures on the naked plains."</p><p>So they, while down their cheeks the torrents roll;</p><p>But fix'd remains the purpose of his soul;</p><p>Resolved he stands, and with a fiery glance</p><p>Expects the hero's terrible advance.</p><p>So, roll'd up in his den, the swelling snake</p><p>Beholds the traveller approach the brake;</p><p>When fed with noxious herbs his turgid veins</p><p>Have gather'd half the poisons of the plains;</p><p>He burns, he stiffens with collected ire,</p><p>And his red eyeballs glare with living fire.</p><p>Beneath a turret, on his shield reclined,</p><p>He stood, and question'd thus his mighty mind:</p><p>"Where lies my way? to enter in the wall?</p></div> </div>
| 953 | 953 | 0.719832 |
8e851f54c36f67d2c1da7349d63d10d1507fd4b5
| 1,620 |
kt
|
Kotlin
|
src/test/kotlin/xyz/poeschl/kixelflut/DrawUtilsTest.kt
|
Poeschl/Kixelflut
|
a4a423c1ab6157db9fdf30e5400f0b192e73c955
|
[
"Apache-2.0"
] | null | null | null |
src/test/kotlin/xyz/poeschl/kixelflut/DrawUtilsTest.kt
|
Poeschl/Kixelflut
|
a4a423c1ab6157db9fdf30e5400f0b192e73c955
|
[
"Apache-2.0"
] | null | null | null |
src/test/kotlin/xyz/poeschl/kixelflut/DrawUtilsTest.kt
|
Poeschl/Kixelflut
|
a4a423c1ab6157db9fdf30e5400f0b192e73c955
|
[
"Apache-2.0"
] | null | null | null |
package xyz.poeschl.kixelflut
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import java.awt.Color
internal class DrawUtilsTest {
@Test
fun createHorizontalPixels() {
//WHEN
val startingPoint = Point(1, 1)
//THEN
val pixels = createHorizontalPixels(startingPoint, 5, Color.BLUE)
//VERIFY
assertThat(pixels).containsExactlyInAnyOrder(
Pixel(Point(1, 1), Color.BLUE),
Pixel(Point(2, 1), Color.BLUE),
Pixel(Point(3, 1), Color.BLUE),
Pixel(Point(4, 1), Color.BLUE),
Pixel(Point(5, 1), Color.BLUE)
)
}
@Test
fun createVerticalPixels() {
//WHEN
val startingPoint = Point(1, 1)
//THEN
val pixels = createVerticalPixels(startingPoint, 5, Color.BLUE)
//VERIFY
assertThat(pixels).containsExactlyInAnyOrder(
Pixel(Point(1, 1), Color.BLUE),
Pixel(Point(1, 2), Color.BLUE),
Pixel(Point(1, 3), Color.BLUE),
Pixel(Point(1, 4), Color.BLUE),
Pixel(Point(1, 5), Color.BLUE)
)
}
@Test
fun createRectPixels() {
//WHEN
val startingPoint = Point(1, 1)
//THEN
val pixels = createRectPixels(startingPoint, Pair(2, 2), Color.GREEN)
//VERIFY
assertThat(pixels).containsExactlyInAnyOrder(
Pixel(Point(1, 1), Color.GREEN),
Pixel(Point(1, 2), Color.GREEN),
Pixel(Point(2, 1), Color.GREEN),
Pixel(Point(2, 2), Color.GREEN)
)
}
}
| 25.714286 | 77 | 0.562963 |
06d5b3cf7b64a8433f3b0045a16e085706b75dd8
| 256 |
kt
|
Kotlin
|
navigation/src/main/java/org/auspiciousrhino/navigation/ErrorParams.kt
|
rainqer/quick_setup_9th_age
|
9a4988d4135aa47436497c4873fe6e0465552ab3
|
[
"Apache-2.0"
] | null | null | null |
navigation/src/main/java/org/auspiciousrhino/navigation/ErrorParams.kt
|
rainqer/quick_setup_9th_age
|
9a4988d4135aa47436497c4873fe6e0465552ab3
|
[
"Apache-2.0"
] | null | null | null |
navigation/src/main/java/org/auspiciousrhino/navigation/ErrorParams.kt
|
rainqer/quick_setup_9th_age
|
9a4988d4135aa47436497c4873fe6e0465552ab3
|
[
"Apache-2.0"
] | null | null | null |
package org.auspiciousrhino.navigation
import android.os.Parcelable
import com.google.gson.annotations.SerializedName
import kotlinx.parcelize.Parcelize
@Parcelize
data class ErrorParams(
@SerializedName("error") val errorMessage: String
) : Parcelable
| 25.6 | 51 | 0.835938 |
c349fb0c9feb761b5641f905ba4ff6c343f00986
| 31,963 |
rs
|
Rust
|
utils/ts-bookkeeping/src/data.rs
|
0xpr03/tsclientlib
|
3aa03661a2b9c62a6faf05e0f16a94e606c4fdb6
|
[
"Apache-2.0",
"MIT"
] | 85 |
2017-10-28T23:37:26.000Z
|
2022-03-19T21:07:04.000Z
|
utils/ts-bookkeeping/src/data.rs
|
0xpr03/tsclientlib
|
3aa03661a2b9c62a6faf05e0f16a94e606c4fdb6
|
[
"Apache-2.0",
"MIT"
] | 25 |
2018-02-15T11:14:15.000Z
|
2022-02-18T22:57:14.000Z
|
utils/ts-bookkeeping/src/data.rs
|
0xpr03/tsclientlib
|
3aa03661a2b9c62a6faf05e0f16a94e606c4fdb6
|
[
"Apache-2.0",
"MIT"
] | 21 |
2017-10-28T23:41:45.000Z
|
2021-05-09T22:21:18.000Z
|
use std::borrow::Cow;
use std::collections::{HashMap, HashSet};
use std::net::{IpAddr, SocketAddr};
use std::{iter, mem, u16};
use serde::{Deserialize, Serialize};
use time::{Duration, OffsetDateTime};
use tsproto_packets::packets::OutCommand;
use tsproto_types::crypto::EccKeyPubP256;
use tsproto_types::*;
use crate::events::{Event, ExtraInfo, PropertyId, PropertyValue, PropertyValueRef};
use crate::messages::s2c::InMessage;
use crate::messages::{c2s, s2c};
use crate::{Error, MessageTarget, Result};
include!(concat!(env!("OUT_DIR"), "/m2bdecls.rs"));
include!(concat!(env!("OUT_DIR"), "/structs.rs"));
include!(concat!(env!("OUT_DIR"), "/properties.rs"));
pub mod exts {
use super::*;
include!(concat!(env!("OUT_DIR"), "/b2mdecls.rs"));
}
macro_rules! max_clients {
($msg:ident) => {{
if $msg.is_max_clients_unlimited.unwrap_or_default() {
Some(MaxClients::Unlimited)
} else if $msg.max_clients.map(|i| i >= 0 && i <= u16::MAX as i32).unwrap_or_default() {
Some(MaxClients::Limited($msg.max_clients.unwrap() as u16))
} else {
// Max clients is less than zero or too high so ignore it
None
}
}};
}
macro_rules! copy_attrs {
($from:ident, $to:ident; $($attr:ident),* $(,)*; $($extra:ident: $ex:expr),* $(,)*) => {
$to {
$($attr: $from.$attr.clone(),)*
$($extra: $ex,)*
}
};
}
impl Connection {
pub fn new(public_key: EccKeyPubP256, msg: &s2c::InInitServer) -> Self {
let packet = msg.iter().next().unwrap();
Self {
own_client: packet.client_id,
server: copy_attrs!(packet, Server;
ask_for_privilegekey,
codec_encryption_mode,
created,
default_channel_group,
default_server_group,
hostbanner_gfx_interval,
hostbanner_gfx_url,
hostbanner_mode,
hostbanner_url,
hostbutton_gfx_url,
hostbutton_tooltip,
hostbutton_url,
hostmessage_mode,
hostmessage,
icon,
max_clients,
name,
nickname,
phonetic_name,
platform,
priority_speaker_dimm_modificator,
protocol_version,
temp_channel_default_delete_delay,
version,
welcome_message,
;
id: packet.virtual_server_id,
public_key: public_key,
ips: packet.ips.clone().unwrap_or_else(Vec::new),
// TODO Get from license struct
license: LicenseType::NoLicense,
optional_data: None,
connection_data: None,
),
clients: HashMap::new(),
channels: HashMap::new(),
channel_groups: HashMap::new(),
server_groups: HashMap::new(),
}
}
pub fn handle_command(&mut self, msg: &s2c::InMessage) -> Result<(Vec<Event>, bool)> {
// Returns if it handled the message so we can warn if a message is
// unhandled.
let (mut handled, mut events) = self.handle_command_generated(msg)?;
// Handle special messages
match msg {
InMessage::TextMessage(msg) => {
for msg in msg.iter() {
let target = match msg.target {
TextMessageTargetMode::Server => MessageTarget::Server,
TextMessageTargetMode::Channel => MessageTarget::Channel,
TextMessageTargetMode::Client => {
let client = if let Some(client) = msg.target_client_id {
client
} else {
return Err(Error::MessageWithoutTargetClientId);
};
MessageTarget::Client(client)
}
TextMessageTargetMode::Unknown => {
return Err(Error::UnknownTextMessageTargetMode);
}
};
events.push(Event::Message {
target,
invoker: Invoker {
name: msg.invoker_name.clone(),
id: msg.invoker_id,
uid: msg.invoker_uid.clone(),
},
message: msg.message.to_string(),
});
handled = true;
}
}
InMessage::ClientPoke(msg) => {
for msg in msg.iter() {
events.push(Event::Message {
target: MessageTarget::Poke(msg.invoker_id),
invoker: Invoker {
name: msg.invoker_name.clone(),
id: msg.invoker_id,
uid: msg.invoker_uid.clone(),
},
message: msg.message.to_string(),
});
handled = true;
}
}
InMessage::CommandError(_) => handled = true,
_ => {}
}
if let Some(invoker) = events.first().and_then(Event::get_invoker) {
// If we know this client and the name change, adjust the name.
if let Ok(client) = self.get_mut_client(invoker.id) {
if client.name != invoker.name {
let old = mem::replace(&mut client.name, invoker.name.clone());
events.push(Event::PropertyChanged {
id: PropertyId::ClientName(client.id),
old: PropertyValue::String(old),
invoker: None,
extra: ExtraInfo { reason: None },
});
}
}
}
Ok((events, handled))
}
fn get_server(&self) -> Result<&Server> { Ok(&self.server) }
fn get_mut_server(&mut self) -> Result<&mut Server> { Ok(&mut self.server) }
fn get_channel_group(&self, group: ChannelGroupId) -> Result<&ChannelGroup> {
self.channel_groups
.get(&group)
.ok_or_else(|| Error::NotFound("ChannelGroup", group.to_string()))
}
fn add_channel_group(
&mut self, group: ChannelGroupId, r: ChannelGroup, _: &mut Vec<Event>,
) -> Result<Option<ChannelGroup>> {
Ok(self.channel_groups.insert(group, r))
}
fn get_server_group(&self, group: ServerGroupId) -> Result<&ServerGroup> {
self.server_groups
.get(&group)
.ok_or_else(|| Error::NotFound("ServerGroup", group.to_string()))
}
fn add_server_group(
&mut self, group: ServerGroupId, r: ServerGroup, _: &mut Vec<Event>,
) -> Result<Option<ServerGroup>> {
Ok(self.server_groups.insert(group, r))
}
fn get_optional_server_data(&self) -> Result<Option<&OptionalServerData>> {
Ok(self.server.optional_data.as_ref())
}
fn replace_optional_server_data(
&mut self, r: OptionalServerData, _: &mut Vec<Event>,
) -> Result<Option<OptionalServerData>> {
Ok(mem::replace(&mut self.server.optional_data, Some(r)))
}
fn remove_optional_server_data(
&mut self, _: &mut Vec<Event>,
) -> Result<Option<OptionalServerData>> {
Ok(self.server.optional_data.take())
}
fn get_connection_server_data(&self) -> Result<Option<&ConnectionServerData>> {
Ok(self.server.connection_data.as_ref())
}
fn replace_connection_server_data(
&mut self, r: ConnectionServerData, _: &mut Vec<Event>,
) -> Result<Option<ConnectionServerData>> {
Ok(mem::replace(&mut self.server.connection_data, Some(r)))
}
fn get_connection(&self) -> Result<&Connection> { Ok(&self) }
fn get_client(&self, client: ClientId) -> Result<&Client> {
self.clients.get(&client).ok_or_else(|| Error::NotFound("Client", client.to_string()))
}
fn get_mut_client(&mut self, client: ClientId) -> Result<&mut Client> {
self.clients.get_mut(&client).ok_or_else(|| Error::NotFound("Client", client.to_string()))
}
fn add_client(
&mut self, client: ClientId, r: Client, _: &mut Vec<Event>,
) -> Result<Option<Client>> {
Ok(self.clients.insert(client, r))
}
fn remove_client(&mut self, client: ClientId, _: &mut Vec<Event>) -> Result<Option<Client>> {
Ok(self.clients.remove(&client))
}
fn get_connection_client_data(
&self, client: ClientId,
) -> Result<Option<&ConnectionClientData>> {
if let Some(c) = self.clients.get(&client) {
Ok(c.connection_data.as_ref())
} else {
Err(Error::NotFound("Client", client.to_string()))
}
}
fn replace_connection_client_data(
&mut self, client: ClientId, r: ConnectionClientData, _: &mut Vec<Event>,
) -> Result<Option<ConnectionClientData>> {
if let Some(client) = self.clients.get_mut(&client) {
Ok(mem::replace(&mut client.connection_data, Some(r)))
} else {
Err(Error::NotFound("Client", client.to_string()))
}
}
fn get_optional_client_data(&self, client: ClientId) -> Result<Option<&OptionalClientData>> {
if let Some(c) = self.clients.get(&client) {
Ok(c.optional_data.as_ref())
} else {
Err(Error::NotFound("Client", client.to_string()))
}
}
fn replace_optional_client_data(
&mut self, client: ClientId, r: OptionalClientData, _: &mut Vec<Event>,
) -> Result<Option<OptionalClientData>> {
if let Some(c) = self.clients.get_mut(&client) {
Ok(mem::replace(&mut c.optional_data, Some(r)))
} else {
Err(Error::NotFound("Client", client.to_string()))
}
}
fn get_channel(&self, channel: ChannelId) -> Result<&Channel> {
self.channels.get(&channel).ok_or_else(|| Error::NotFound("Channel", channel.to_string()))
}
fn get_mut_channel(&mut self, channel: ChannelId) -> Result<&mut Channel> {
self.channels
.get_mut(&channel)
.ok_or_else(|| Error::NotFound("Channel", channel.to_string()))
}
fn add_channel(
&mut self, channel: ChannelId, r: Channel, events: &mut Vec<Event>,
) -> Result<Option<Channel>> {
self.channel_order_insert(r.id, r.order, r.parent, events);
Ok(self.channels.insert(channel, r))
}
fn remove_channel(
&mut self, channel: ChannelId, events: &mut Vec<Event>,
) -> Result<Option<Channel>> {
let old = self.channels.remove(&channel);
if let Some(ch) = &old {
self.channel_order_remove(ch.id, ch.order, events);
}
Ok(old)
}
fn get_optional_channel_data(
&self, channel: ChannelId,
) -> Result<Option<&OptionalChannelData>> {
if let Some(c) = self.channels.get(&channel) {
Ok(c.optional_data.as_ref())
} else {
Err(Error::NotFound("Channel", channel.to_string()))
}
}
fn replace_optional_channel_data(
&mut self, channel: ChannelId, r: OptionalChannelData, _: &mut Vec<Event>,
) -> Result<Option<OptionalChannelData>> {
if let Some(c) = self.channels.get_mut(&channel) {
Ok(mem::replace(&mut c.optional_data, Some(r)))
} else {
Err(Error::NotFound("Channel", channel.to_string()))
}
}
fn remove_optional_channel_data(
&mut self, channel: ChannelId, _: &mut Vec<Event>,
) -> Result<Option<OptionalChannelData>> {
if let Some(c) = self.channels.get_mut(&channel) {
Ok(c.optional_data.take())
} else {
Err(Error::NotFound("Channel", channel.to_string()))
}
}
// Backing functions for MessageToBook declarations
fn return_false<T>(&self, _: T, _: &mut Vec<Event>) -> Result<bool> { Ok(false) }
fn return_none<T, O>(&self, _: T, _: &mut Vec<Event>) -> Result<Option<O>> { Ok(None) }
fn return_some_none<T, O>(&self, _: T, _: &mut Vec<Event>) -> Result<Option<Option<O>>> {
Ok(Some(None))
}
fn void_fun<T, U, V>(&self, _: T, _: U, _: V) -> Result<()> { Ok(()) }
fn max_clients_cc_fun(
&self, msg: &s2c::InChannelCreatedPart, _: &mut Vec<Event>,
) -> Result<(Option<MaxClients>, Option<MaxClients>)> {
let ch = max_clients!(msg);
let ch_fam = if msg.is_max_family_clients_unlimited.unwrap_or_default() {
Some(MaxClients::Unlimited)
} else if msg.inherits_max_family_clients.unwrap_or_default() {
Some(MaxClients::Inherited)
} else if msg.max_family_clients.map(|i| i >= 0 && i <= u16::MAX as i32).unwrap_or_default()
{
Some(MaxClients::Limited(msg.max_family_clients.unwrap() as u16))
} else {
// Max clients is less than zero or too high so ignore it
None
};
Ok((ch, ch_fam))
}
fn max_clients_ce_fun(
&mut self, channel_id: ChannelId, msg: &s2c::InChannelEditedPart, events: &mut Vec<Event>,
) -> Result<()> {
let channel = self.get_mut_channel(channel_id)?;
let ch = max_clients!(msg);
if let Some(ch) = ch {
events.push(Event::PropertyChanged {
id: PropertyId::ChannelMaxClients(channel_id),
old: PropertyValue::OptionMaxClients(channel.max_clients.take()),
invoker: msg.get_invoker(),
extra: ExtraInfo { reason: Some(msg.reason) },
});
channel.max_clients = Some(ch);
}
let ch_fam = if msg.is_max_family_clients_unlimited.unwrap_or_default() {
Some(MaxClients::Unlimited)
} else if msg.inherits_max_family_clients.unwrap_or_default() {
Some(MaxClients::Inherited)
} else if msg.max_family_clients.map(|i| i >= 0 && i <= u16::MAX as i32).unwrap_or_default()
{
Some(MaxClients::Limited(msg.max_family_clients.unwrap() as u16))
} else {
// Max clients is less than zero or too high so ignore it
None
};
if let Some(ch_fam) = ch_fam {
events.push(Event::PropertyChanged {
id: PropertyId::ChannelMaxFamilyClients(channel_id),
old: PropertyValue::OptionMaxClients(channel.max_family_clients.take()),
invoker: msg.get_invoker(),
extra: ExtraInfo { reason: Some(msg.reason) },
});
channel.max_family_clients = Some(ch_fam);
}
Ok(())
}
fn max_clients_cl_fun(
&self, msg: &s2c::InChannelListPart, _: &mut Vec<Event>,
) -> Result<(Option<MaxClients>, Option<MaxClients>)> {
let max_clients: i32 = msg.max_clients;
let ch = if msg.is_max_clients_unlimited {
Some(MaxClients::Unlimited)
} else if max_clients >= 0 && max_clients <= u16::MAX as i32 {
Some(MaxClients::Limited(max_clients as u16))
} else {
// Max clients is less than zero or too high so ignore it
None
};
let max_clients: i32 = msg.max_family_clients;
let ch_fam = if msg.is_max_family_clients_unlimited {
Some(MaxClients::Unlimited)
} else if msg.inherits_max_family_clients {
Some(MaxClients::Inherited)
} else if max_clients >= 0 && max_clients <= u16::MAX as i32 {
Some(MaxClients::Limited(max_clients as u16))
} else {
// Max clients is less than zero or too high so ignore it
Some(MaxClients::Unlimited)
};
Ok((ch, ch_fam))
}
fn channel_type_cc_fun(
&self, msg: &s2c::InChannelCreatedPart, _: &mut Vec<Event>,
) -> Result<ChannelType> {
Ok(Self::channel_flags_to_type(msg.is_permanent, msg.is_semi_permanent))
}
fn channel_type_ce_fun(
&mut self, channel_id: ChannelId, msg: &s2c::InChannelEditedPart, events: &mut Vec<Event>,
) -> Result<()> {
let channel = self.get_mut_channel(channel_id)?;
if !msg.is_permanent.is_some() && !msg.is_semi_permanent.is_some() {
return Ok(());
}
let typ = Self::channel_flags_to_type(msg.is_permanent, msg.is_semi_permanent);
events.push(Event::PropertyChanged {
id: PropertyId::ChannelChannelType(channel_id),
old: PropertyValue::ChannelType(channel.channel_type),
invoker: msg.get_invoker(),
extra: ExtraInfo { reason: Some(msg.reason) },
});
channel.channel_type = typ;
Ok(())
}
fn channel_type_cl_fun(
&self, msg: &s2c::InChannelListPart, _: &mut Vec<Event>,
) -> Result<ChannelType> {
Ok(Self::channel_flags_to_type(Some(msg.is_permanent), Some(msg.is_semi_permanent)))
}
fn channel_flags_to_type(perm: Option<bool>, semi: Option<bool>) -> ChannelType {
match (perm.unwrap_or_default(), semi.unwrap_or_default()) {
(true, _) => ChannelType::Permanent,
(_, true) => ChannelType::SemiPermanent,
(false, false) => ChannelType::Temporary,
}
}
fn channel_codec_cc_fun(
&self, msg: &s2c::InChannelCreatedPart, _: &mut Vec<Event>,
) -> Result<Codec> {
Ok(msg.codec.unwrap_or(Codec::OpusVoice))
}
fn away_cev_fun(
&self, msg: &s2c::InClientEnterViewPart, _: &mut Vec<Event>,
) -> Result<Option<String>> {
if msg.is_away { Ok(Some(msg.away_message.clone())) } else { Ok(None) }
}
fn client_type_cev_fun(
&self, msg: &s2c::InClientEnterViewPart, _: &mut Vec<Event>,
) -> Result<ClientType> {
if msg.uid.is_server_admin() {
if let ClientType::Query { .. } = msg.client_type {
return Ok(ClientType::Query { admin: true });
}
}
Ok(msg.client_type.clone())
}
fn away_cu_fun(
&mut self, client_id: ClientId, msg: &s2c::InClientUpdatedPart, events: &mut Vec<Event>,
) -> Result<()> {
let client = self.get_mut_client(client_id)?;
if let Some(is_away) = msg.is_away {
if is_away != client.away_message.is_some() {
let away = if is_away {
Some(msg.away_message.clone().unwrap_or_else(String::new))
} else {
None
};
events.push(Event::PropertyChanged {
id: PropertyId::ClientAwayMessage(client_id),
old: PropertyValue::OptionString(client.away_message.take()),
invoker: msg.get_invoker(),
extra: ExtraInfo { reason: None },
});
client.away_message = away;
}
} else if let Some(away_message) = &msg.away_message {
if let Some(cur_msg) = &client.away_message {
if away_message != cur_msg {
events.push(Event::PropertyChanged {
id: PropertyId::ClientAwayMessage(client_id),
old: PropertyValue::OptionString(client.away_message.take()),
invoker: msg.get_invoker(),
extra: ExtraInfo { reason: None },
});
client.away_message = Some(away_message.clone());
}
}
}
Ok(())
}
fn talk_power_cev_fun(
&self, msg: &s2c::InClientEnterViewPart, _: &mut Vec<Event>,
) -> Result<Option<TalkPowerRequest>> {
if msg.talk_power_request_time.unix_timestamp() > 0 {
Ok(Some(TalkPowerRequest {
time: msg.talk_power_request_time,
message: msg.talk_power_request_message.clone(),
}))
} else {
Ok(None)
}
}
fn talk_power_cu_fun(
&mut self, client_id: ClientId, msg: &s2c::InClientUpdatedPart, events: &mut Vec<Event>,
) -> Result<()> {
if let Some(talk_request) = msg.talk_power_request_time {
let client = self.get_mut_client(client_id)?;
let talk_request = if talk_request.unix_timestamp() > 0 {
Some(TalkPowerRequest {
time: talk_request,
message: msg.talk_power_request_message.clone().unwrap_or_else(String::new),
})
} else {
None
};
events.push(Event::PropertyChanged {
id: PropertyId::ClientTalkPowerRequest(client_id),
old: PropertyValue::OptionTalkPowerRequest(client.talk_power_request.take()),
invoker: msg.get_invoker(),
extra: ExtraInfo { reason: None },
});
client.talk_power_request = talk_request;
}
Ok(())
}
fn address_fun(
&self, msg: &s2c::InClientConnectionInfoPart, _: &mut Vec<Event>,
) -> Result<Option<Option<SocketAddr>>> {
if let (Some(ip), Some(port)) = (&msg.ip, &msg.port) {
if !ip.is_empty() {
return Ok(Some(Some(SocketAddr::new(
ip.trim_matches(&['[', ']'][..]).parse().map_err(Error::InvalidConnectionIp)?,
*port,
))));
}
}
Ok(Some(None))
}
fn channel_subscribe_fun(
&mut self, channel_id: ChannelId, _: &s2c::InChannelSubscribedPart, events: &mut Vec<Event>,
) -> Result<()> {
let channel = self.get_mut_channel(channel_id)?;
events.push(Event::PropertyChanged {
id: PropertyId::ChannelSubscribed(channel_id),
old: PropertyValue::Bool(channel.subscribed),
invoker: None,
extra: ExtraInfo { reason: None },
});
channel.subscribed = true;
Ok(())
}
fn channel_unsubscribe_fun(
&mut self, channel_id: ChannelId, _: &s2c::InChannelUnsubscribedPart,
events: &mut Vec<Event>,
) -> Result<()> {
let channel = self.get_mut_channel(channel_id)?;
events.push(Event::PropertyChanged {
id: PropertyId::ChannelSubscribed(channel_id),
old: PropertyValue::Bool(channel.subscribed),
invoker: None,
extra: ExtraInfo { reason: None },
});
channel.subscribed = false;
// Remove all known clients from this channel
let remove_clients = self
.clients
.values()
.filter_map(|c| if c.channel == channel_id { Some(c.id) } else { None })
.collect::<Vec<_>>();
for id in remove_clients {
events.push(Event::PropertyRemoved {
id: PropertyId::Client(id),
old: PropertyValue::Client(self.clients.remove(&id).unwrap()),
invoker: None,
extra: ExtraInfo { reason: None },
});
}
Ok(())
}
fn channel_order_remove(
&mut self, channel_id: ChannelId, channel_order: ChannelId, events: &mut Vec<Event>,
) {
// [ C:7 | O:_ ]
// [ C:5 | O:7 ] ─>X
// [ C:_ | O:5 ] (Upd: O -> 7)
self.channels.values_mut().any(|c| {
if c.order == channel_id && c.id != channel_id {
events.push(Event::PropertyChanged {
id: PropertyId::ChannelOrder(c.id),
old: PropertyValue::ChannelId(c.order),
invoker: None,
extra: ExtraInfo { reason: None },
});
c.order = channel_order;
true
} else {
false
}
});
}
fn channel_order_insert(
&mut self, channel_id: ChannelId, channel_order: ChannelId, channel_parent: ChannelId,
events: &mut Vec<Event>,
) {
// [ C:7 | O:_ ]
// [ <── (New: C:5 | O:7)
// [ C:_ | O:7 ] (Upd: O -> 5)
//
// Also work for the first channel, the order will be 0.
self.channels.values_mut().any(|c| {
if c.order == channel_order && c.parent == channel_parent && c.id != channel_id {
events.push(Event::PropertyChanged {
id: PropertyId::ChannelOrder(c.id),
old: PropertyValue::ChannelId(c.order),
invoker: None,
extra: ExtraInfo { reason: None },
});
c.order = channel_id;
true
} else {
false
}
});
}
fn channel_order_cc_fun(
&mut self, msg: &s2c::InChannelCreatedPart, events: &mut Vec<Event>,
) -> Result<ChannelId> {
self.channel_order_insert(msg.channel_id, msg.order, msg.parent_id, events);
Ok(msg.order)
}
fn channel_order_ce_fun(
&mut self, channel_id: ChannelId, msg: &s2c::InChannelEditedPart, events: &mut Vec<Event>,
) -> Result<()> {
self.channel_order_move_fun(channel_id, msg.order, msg.parent_id, events)
}
fn channel_order_cm_fun(
&mut self, channel_id: ChannelId, msg: &s2c::InChannelMovedPart, events: &mut Vec<Event>,
) -> Result<()> {
self.channel_order_move_fun(channel_id, Some(msg.order), Some(msg.parent_id), events)
}
fn channel_order_move_fun(
&mut self, channel_id: ChannelId, new_order: Option<ChannelId>, parent: Option<ChannelId>,
events: &mut Vec<Event>,
) -> Result<()> {
if new_order.is_some() || parent.is_some() {
let old_order;
let new_parent;
{
let channel = self.get_mut_channel(channel_id)?;
old_order = channel.order;
new_parent = parent.unwrap_or(channel.parent);
if let Some(order) = new_order {
events.push(Event::PropertyChanged {
id: PropertyId::ChannelOrder(channel.id),
old: PropertyValue::ChannelId(channel.order),
invoker: None,
extra: ExtraInfo { reason: None },
});
channel.order = order;
}
}
self.channel_order_remove(channel_id, old_order, events);
self.channel_order_insert(
channel_id,
new_order.unwrap_or(old_order),
new_parent,
events,
);
}
Ok(())
}
fn subscribe_channel_fun(
&mut self, client_id: ClientId, msg: &s2c::InClientMovedPart, events: &mut Vec<Event>,
) -> Result<()> {
if client_id == self.own_client && msg.target_channel_id.0 != 0 {
let channel = self.get_mut_channel(msg.target_channel_id)?;
events.push(Event::PropertyChanged {
id: PropertyId::ChannelSubscribed(msg.target_channel_id),
old: PropertyValue::Bool(channel.subscribed),
invoker: None,
extra: ExtraInfo { reason: None },
});
channel.subscribed = true;
}
Ok(())
}
// Book to messages
fn away_fun_b2m<'a>(msg: Option<&'a str>) -> (bool, &'a str) {
if let Some(msg) = msg { (true, msg) } else { (false, "") }
}
}
impl Client {
// Book to messages
fn password_b2m<'a>(password: &'a str) -> String {
tsproto_types::crypto::encode_password(password.as_bytes()).into()
}
fn channel_id_b2m(&self, channel: ChannelId) -> ChannelId { channel }
pub fn send_textmessage(&self, message: &str) -> OutCommand {
c2s::OutSendTextMessageMessage::new(&mut iter::once(c2s::OutSendTextMessagePart {
target: TextMessageTargetMode::Client,
target_client_id: Some(self.id),
message: message.into(),
}))
}
pub fn poke(&self, message: &str) -> OutCommand {
c2s::OutClientPokeRequestMessage::new(&mut iter::once(c2s::OutClientPokeRequestPart {
client_id: self.id,
message: message.into(),
}))
}
}
impl Channel {
// Book to messages
fn password_b2m<'a>(&self, password: &'a str) -> String {
tsproto_types::crypto::encode_password(password.as_bytes()).into()
}
fn password_b2m2<'a>(password: &'a str) -> String {
tsproto_types::crypto::encode_password(password.as_bytes()).into()
}
fn password_flagged_b2m<'a>(password: Option<&'a str>) -> (bool, Cow<'static, str>) {
if let Some(password) = password {
(true, tsproto_types::crypto::encode_password(password.as_bytes()).into())
} else {
(false, "".into())
}
}
fn channel_type_fun_b2m(channel_type: ChannelType) -> (bool, bool) {
match channel_type {
ChannelType::Temporary => (false, false),
ChannelType::SemiPermanent => (true, false),
ChannelType::Permanent => (false, true),
}
}
fn max_clients_fun_b2m(max_clients: MaxClients) -> (i32, bool) {
match max_clients {
MaxClients::Inherited => (0, false),
MaxClients::Unlimited => (0, true),
MaxClients::Limited(num) => (num.into(), false),
}
}
fn max_family_clients_fun_b2m(max_clients: MaxClients) -> (i32, bool, bool) {
match max_clients {
MaxClients::Inherited => (0, false, true),
MaxClients::Unlimited => (0, true, false),
MaxClients::Limited(num) => (num.into(), false, false),
}
}
fn channel_id_b2m(&self, channel: ChannelId) -> ChannelId { channel }
pub fn set_subscribed(&self, subscribed: bool) -> OutCommand {
if subscribed {
c2s::OutChannelSubscribeMessage::new(&mut iter::once(c2s::OutChannelSubscribePart {
channel_id: self.id,
}))
} else {
c2s::OutChannelUnsubscribeMessage::new(&mut iter::once(
c2s::OutChannelUnsubscribePart { channel_id: self.id },
))
}
}
}
/// The `ChannelOptions` are used to set initial properties of a new channel.
///
/// A channel can be created with [`ServerMut::add_channel`]. The only necessary
/// property of a channel is the name, all other properties will be set to their
/// default value.
#[derive(Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct ChannelOptions<'a> {
name: &'a str,
description: Option<&'a str>,
parent_id: Option<ChannelId>,
codec: Option<Codec>,
codec_quality: Option<u8>,
delete_delay: Option<Duration>,
password: Option<&'a str>,
is_default: bool,
max_clients: Option<MaxClients>,
max_family_clients: Option<MaxClients>,
channel_type: Option<ChannelType>,
is_unencrypted: Option<bool>,
order: Option<ChannelId>,
phonetic_name: Option<&'a str>,
topic: Option<&'a str>,
}
impl<'a> ChannelOptions<'a> {
/// Create new `ChannelOptions` to add a new channel to a server.
///
/// # Arguments
/// You have to supply a name for the new channel. All other properties are
/// optional.
pub fn new(name: &'a str) -> Self {
Self {
name,
description: None,
parent_id: None,
codec: None,
codec_quality: None,
delete_delay: None,
password: None,
is_default: false,
max_clients: None,
max_family_clients: None,
channel_type: None,
is_unencrypted: None,
order: None,
phonetic_name: None,
topic: None,
}
}
pub fn description(mut self, description: &'a str) -> Self {
self.description = Some(description);
self
}
pub fn parent_id(mut self, parent_id: ChannelId) -> Self {
self.parent_id = Some(parent_id);
self
}
pub fn codec(mut self, codec: Codec) -> Self {
self.codec = Some(codec);
self
}
pub fn codec_quality(mut self, codec_quality: u8) -> Self {
self.codec_quality = Some(codec_quality);
self
}
pub fn delete_delay(mut self, delete_delay: Duration) -> Self {
self.delete_delay = Some(delete_delay);
self
}
pub fn password(mut self, password: &'a str) -> Self {
self.password = Some(password);
self
}
pub fn default(mut self) -> Self {
self.is_default = true;
self
}
pub fn max_clients(mut self, max_clients: MaxClients) -> Self {
self.max_clients = Some(max_clients);
self
}
pub fn max_family_clients(mut self, max_family_clients: MaxClients) -> Self {
self.max_family_clients = Some(max_family_clients);
self
}
pub fn channel_type(mut self, channel_type: ChannelType) -> Self {
self.channel_type = Some(channel_type);
self
}
pub fn is_unencrypted(mut self, is_unencrypted: bool) -> Self {
self.is_unencrypted = Some(is_unencrypted);
self
}
/// The previous order
pub fn order(mut self, order: ChannelId) -> Self {
self.order = Some(order);
self
}
pub fn phonetic_name(mut self, phonetic_name: &'a str) -> Self {
self.phonetic_name = Some(phonetic_name);
self
}
pub fn topic(mut self, topic: &'a str) -> Self {
self.topic = Some(topic);
self
}
}
impl Server {
pub fn add_channel(&self, options: ChannelOptions) -> OutCommand {
let inherits_max_family_clients = options
.max_family_clients
.as_ref()
.and_then(|m| if let MaxClients::Inherited = m { Some(true) } else { None });
let is_max_family_clients_unlimited = options
.max_family_clients
.as_ref()
.and_then(|m| if let MaxClients::Unlimited = m { Some(true) } else { None });
let max_family_clients = options
.max_family_clients
.as_ref()
.and_then(|m| if let MaxClients::Limited(n) = m { Some(*n as i32) } else { None });
let is_max_clients_unlimited = options
.max_clients
.as_ref()
.and_then(|m| if let MaxClients::Unlimited = m { Some(true) } else { None });
let max_clients = options
.max_clients
.as_ref()
.and_then(|m| if let MaxClients::Limited(n) = m { Some(*n as i32) } else { None });
let is_permanent = options
.channel_type
.as_ref()
.and_then(|t| if *t == ChannelType::Permanent { Some(true) } else { None });
let is_semi_permanent = options
.channel_type
.as_ref()
.and_then(|t| if *t == ChannelType::SemiPermanent { Some(true) } else { None });
c2s::OutChannelCreateMessage::new(&mut iter::once(c2s::OutChannelCreatePart {
name: options.name.into(),
description: options.description.map(Into::into),
parent_id: options.parent_id,
codec: options.codec,
codec_quality: options.codec_quality,
delete_delay: options.delete_delay,
has_password: if options.password.is_some() { Some(true) } else { None },
is_default: if options.is_default { Some(true) } else { None },
inherits_max_family_clients,
is_max_family_clients_unlimited,
is_max_clients_unlimited,
is_permanent,
is_semi_permanent,
max_family_clients,
max_clients,
is_unencrypted: options.is_unencrypted,
order: options.order,
password: options
.password
.map(|p| tsproto_types::crypto::encode_password(p.as_bytes()).into()),
phonetic_name: options.phonetic_name.map(Into::into),
topic: options.topic.map(Into::into),
}))
}
pub fn send_textmessage(&self, message: &str) -> OutCommand {
c2s::OutSendTextMessageMessage::new(&mut iter::once(c2s::OutSendTextMessagePart {
target: TextMessageTargetMode::Server,
target_client_id: None,
message: message.into(),
}))
}
/// Subscribe or unsubscribe from all channels.
pub fn set_subscribed(&self, subscribed: bool) -> OutCommand {
if subscribed {
c2s::OutChannelSubscribeAllMessage::new()
} else {
c2s::OutChannelUnsubscribeAllMessage::new()
}
}
fn zero_channel_id(&self) -> ChannelId { ChannelId(0) }
fn empty_string(&self) -> &'static str { "" }
// Book to messages
fn password_b2m<'a>(password: Option<&'a str>) -> Cow<'static, str> {
if let Some(password) = password {
tsproto_types::crypto::encode_password(password.as_bytes()).into()
} else {
"".into()
}
}
}
impl Connection {
pub fn send_message(&self, target: MessageTarget, message: &str) -> OutCommand {
match target {
MessageTarget::Server => {
c2s::OutSendTextMessageMessage::new(&mut iter::once(c2s::OutSendTextMessagePart {
target: TextMessageTargetMode::Server,
target_client_id: None,
message: message.into(),
}))
}
MessageTarget::Channel => {
c2s::OutSendTextMessageMessage::new(&mut iter::once(c2s::OutSendTextMessagePart {
target: TextMessageTargetMode::Channel,
target_client_id: None,
message: message.into(),
}))
}
MessageTarget::Client(id) => {
c2s::OutSendTextMessageMessage::new(&mut iter::once(c2s::OutSendTextMessagePart {
target: TextMessageTargetMode::Client,
target_client_id: Some(id),
message: message.into(),
}))
}
MessageTarget::Poke(id) => c2s::OutClientPokeRequestMessage::new(&mut iter::once(
c2s::OutClientPokeRequestPart { client_id: id, message: message.into() },
)),
}
}
pub fn disconnect(&self, options: crate::DisconnectOptions) -> OutCommand {
c2s::OutDisconnectMessage::new(&mut iter::once(c2s::OutDisconnectPart {
reason: options.reason,
reason_message: options.message.map(Into::into),
}))
}
}
| 30.325427 | 94 | 0.673216 |
580d553bc4c69ce27e44c82bee7db2c5d7a99f8d
| 1,052 |
c
|
C
|
holo-client-c/src/future.c
|
Invoker-liu/alibabacloud-hologres-connectors
|
48c095795f4e5aa78ec926ba1f6f896e2c7d16db
|
[
"Apache-2.0"
] | 25 |
2021-02-02T09:30:26.000Z
|
2022-03-28T06:21:50.000Z
|
holo-client-c/src/future.c
|
Invoker-liu/alibabacloud-hologres-connectors
|
48c095795f4e5aa78ec926ba1f6f896e2c7d16db
|
[
"Apache-2.0"
] | 5 |
2021-08-13T07:52:19.000Z
|
2022-02-22T03:00:47.000Z
|
holo-client-c/src/future.c
|
Invoker-liu/alibabacloud-hologres-connectors
|
48c095795f4e5aa78ec926ba1f6f896e2c7d16db
|
[
"Apache-2.0"
] | 14 |
2021-07-09T09:27:04.000Z
|
2022-03-03T01:39:23.000Z
|
#include "future.h"
#include "utils.h"
Future* create_future() {
Future* future = MALLOC(1, Future);
future->completed = false;
future->retVal = NULL;
future->mutex = MALLOC(1, pthread_mutex_t);
future->cond = MALLOC(1, pthread_cond_t);
pthread_mutex_init(future->mutex, NULL);
pthread_cond_init(future->cond, NULL);
return future;
}
void destroy_future(Future* future) {
pthread_mutex_destroy(future->mutex);
pthread_cond_destroy(future->cond);
FREE(future->mutex);
FREE(future->cond);
FREE(future);
future = NULL;
}
void complete_future(Future* future, void* value) {
pthread_mutex_lock(future->mutex);
future->retVal = value;
future->completed = true;
pthread_cond_signal(future->cond);
pthread_mutex_unlock(future->mutex);
}
void* get_future_result(Future* future) {
pthread_mutex_lock(future->mutex);
while(!future->completed) {
pthread_cond_wait(future->cond, future->mutex);
}
pthread_mutex_unlock(future->mutex);
return future->retVal;
}
| 29.222222 | 55 | 0.686312 |
217883fe1b98d0650a223e8945b97d5babf3f7aa
| 383 |
rs
|
Rust
|
build.rs
|
niladic/csv-exec
|
55ac3959f67ef481c5e11b86d2fc8c7f308234e8
|
[
"MIT"
] | 2 |
2021-01-21T17:40:09.000Z
|
2021-01-21T17:40:10.000Z
|
build.rs
|
niladic/csv-exec
|
55ac3959f67ef481c5e11b86d2fc8c7f308234e8
|
[
"MIT"
] | null | null | null |
build.rs
|
niladic/csv-exec
|
55ac3959f67ef481c5e11b86d2fc8c7f308234e8
|
[
"MIT"
] | null | null | null |
use std::env;
use std::path::Path;
fn main() {
let out_dir = env::var("OUT_DIR").unwrap();
let dest_path = Path::new(&out_dir).join("buildinfo.rs");
let build_consts = format!(
r#"
const BUILDINFO_VERSION: &str = "{}";
"#,
env::var("CARGO_PKG_VERSION").unwrap(),
);
std::fs::write(&dest_path, build_consts.as_bytes()).unwrap();
}
| 25.533333 | 65 | 0.574413 |
f182d809b6473858bb0782ca8d5a8831f9129089
| 3,820 |
kt
|
Kotlin
|
src/test/kotlin/io/github/wulkanowy/api/repository/StudentStartRepositoryTest.kt
|
dominik-korsa/api
|
3a9d1e8a62727a4631ad42ef4af25e3df57d8d1b
|
[
"Apache-2.0"
] | 11 |
2018-08-21T07:34:56.000Z
|
2021-01-09T20:20:49.000Z
|
src/test/kotlin/io/github/wulkanowy/api/repository/StudentStartRepositoryTest.kt
|
dominik-korsa/api
|
3a9d1e8a62727a4631ad42ef4af25e3df57d8d1b
|
[
"Apache-2.0"
] | 43 |
2018-11-19T05:36:09.000Z
|
2019-12-06T13:49:19.000Z
|
src/test/kotlin/io/github/wulkanowy/api/repository/StudentStartRepositoryTest.kt
|
dominik-korsa/api
|
3a9d1e8a62727a4631ad42ef4af25e3df57d8d1b
|
[
"Apache-2.0"
] | 4 |
2019-02-19T23:30:47.000Z
|
2019-12-06T09:09:44.000Z
|
package io.github.wulkanowy.api.repository
import io.github.wulkanowy.api.Api
import io.github.wulkanowy.api.BaseLocalTest
import io.github.wulkanowy.api.register.RegisterTest
import io.github.wulkanowy.api.register.Semester
import io.reactivex.observers.TestObserver
import okhttp3.mockwebserver.MockResponse
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
class StudentStartRepositoryTest : BaseLocalTest() {
private val api by lazy {
Api().apply {
ssl = false
loginType = Api.LoginType.STANDARD
host = "fakelog.localhost:3000" //
symbol = "Default"
email = "jan@fakelog.cf"
password = "jan123"
schoolSymbol = "123456"
diaryId = 101
useNewStudent = true
}
}
@Test
fun getSemesters() {
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenDziennik.json").readText()))
server.start(3000) //
api.studentId = 1
api.classId = 1
val semesters = api.getSemesters()
val semestersObserver = TestObserver<List<Semester>>()
semesters.subscribe(semestersObserver)
semestersObserver.assertComplete()
val items = semestersObserver.values()[0]
assertEquals(6, items.size)
assertEquals(1234568, items[0].semesterId)
assertEquals(1234567, items[1].semesterId)
assertEquals(2018, items[0].schoolYear)
assertEquals(2018, items[1].schoolYear)
assertEquals(1234566, items[2].semesterId)
assertEquals(2017, items[2].schoolYear)
assertEquals(2017, items[3].schoolYear)
assertTrue(items.single { it.current }.current)
}
@Test
fun getSemesters_empty() {
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenDziennik.json").readText()))
server.start(3000) //
api.studentId = 1
api.classId = 2 //
val semesters = api.getSemesters()
val semestersObserver = TestObserver<List<Semester>>()
semesters.subscribe(semestersObserver)
semestersObserver.assertComplete()
val items = semestersObserver.values()[0]
assertEquals(0, items.size)
}
@Test
fun getSemesters_studentWithMultiClasses() {
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenDziennik-multi.json").readText()))
server.start(3000) //
api.studentId = 3881
api.classId = 121
val semesters = api.getSemesters()
val semestersObserver = TestObserver<List<Semester>>()
semesters.subscribe(semestersObserver)
semestersObserver.assertComplete()
val items = semestersObserver.values()[0]
assertEquals(2, items.size)
assertEquals(714, items[0].semesterId)
assertEquals(713, items[1].semesterId)
assertTrue(items.single { it.current }.current)
}
@Test
fun getSemesters_graduate() {
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenDziennik.json").readText()))
server.start(3000) //
api.studentId = 2
api.classId = 2
val semesters = api.getSemesters()
val semestersObserver = TestObserver<List<Semester>>()
semesters.subscribe(semestersObserver)
semestersObserver.assertComplete()
val items = semestersObserver.values()[0]
assertEquals(6, items.size)
assertEquals(1234568, items[0].semesterId)
assertEquals(1234568, items.single { it.current }.semesterId)
assertEquals(1234567, items[1].semesterId)
assertTrue(items.single { it.current }.current)
assertTrue(items[0].current)
}
}
| 31.570248 | 123 | 0.659424 |
0c806a0eaf687b2d10c9f68f4752a320058970ab
| 737 |
py
|
Python
|
.eggs/py2app-0.14-py3.6.egg/py2app/recipes/matplotlib.py
|
stfbnc/mtsa_py
|
0dd14f0e51e3251f10b3da781867fbc7173608eb
|
[
"MIT"
] | 17 |
2018-08-28T04:40:07.000Z
|
2021-12-15T06:19:31.000Z
|
.eggs/py2app-0.14-py3.6.egg/py2app/recipes/matplotlib.py
|
stfbnc/mtsa_py
|
0dd14f0e51e3251f10b3da781867fbc7173608eb
|
[
"MIT"
] | 4 |
2019-05-17T09:35:30.000Z
|
2022-03-13T03:50:20.000Z
|
.eggs/py2app-0.14-py3.6.egg/py2app/recipes/matplotlib.py
|
stfbnc/mtsa_py
|
0dd14f0e51e3251f10b3da781867fbc7173608eb
|
[
"MIT"
] | 3 |
2019-01-15T07:13:53.000Z
|
2020-03-29T00:48:39.000Z
|
import os
def check(cmd, mf):
m = mf.findNode('matplotlib')
if m is None or m.filename is None:
return None
if cmd.matplotlib_backends:
backends = {}
for backend in cmd.matplotlib_backends:
if backend == '-':
pass
elif backend == '*':
mf.import_hook('matplotlib.backends', m, ['*'])
else:
mf.import_hook('matplotlib.backends.backend_%s' % (
backend,), m)
else:
backends = {'packages': ['matplotlib']}
return dict(
prescripts=['py2app.recipes.matplotlib_prescript'],
resources=[os.path.join(os.path.dirname(m.filename), 'mpl-data')],
**backends
)
| 24.566667 | 74 | 0.530529 |
5fce6a497f7d47553f6120616369ac3c78ff3ff9
| 1,506 |
h
|
C
|
EP Mobile/EP Mobile/EPSAVAnnulusViewController.h
|
mannd/epmobile-ios
|
7974764c7c5233668f02876598af985e0f79692d
|
[
"Apache-2.0"
] | 2 |
2015-02-13T17:16:50.000Z
|
2015-08-19T01:51:56.000Z
|
EP Mobile/EP Mobile/EPSAVAnnulusViewController.h
|
mannd/epmobile-ios
|
7974764c7c5233668f02876598af985e0f79692d
|
[
"Apache-2.0"
] | 6 |
2015-10-26T06:16:56.000Z
|
2020-12-08T17:21:50.000Z
|
EP Mobile/EP Mobile/EPSAVAnnulusViewController.h
|
mannd/epmobile-ios
|
7974764c7c5233668f02876598af985e0f79692d
|
[
"Apache-2.0"
] | 1 |
2022-03-13T21:59:39.000Z
|
2022-03-13T21:59:39.000Z
|
//
// EPSAVAnnulusViewController.h
// EP Mobile
//
// Created by David Mann on 8/7/12.
// Copyright (c) 2012 EP Studios. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface EPSAVAnnulusViewController : UIViewController
@property (strong, nonatomic) IBOutlet UIImageView *mapImageView;
@property (strong, nonatomic) IBOutlet UIImageView *asapImageView;
@property (strong, nonatomic) IBOutlet UIImageView *epicardialapImageView;
@property (strong, nonatomic) IBOutlet UIImageView *lalapImageView;
@property (strong, nonatomic) IBOutlet UIImageView *llapImageView;
@property (strong, nonatomic) IBOutlet UIImageView *lpapImageView;
@property (strong, nonatomic) IBOutlet UIImageView *lplapImageView;
@property (strong, nonatomic) IBOutlet UIImageView *msapImageView;
@property (strong, nonatomic) IBOutlet UIImageView *psmaapImageView;
@property (strong, nonatomic) IBOutlet UIImageView *pstaapImageView;
@property (strong, nonatomic) IBOutlet UIImageView *raapImageView;
@property (strong, nonatomic) IBOutlet UIImageView *ralapImageView;
@property (strong, nonatomic) IBOutlet UIImageView *rlapImageView;
@property (strong, nonatomic) IBOutlet UIImageView *rplapImageView;
@property (strong, nonatomic) IBOutlet UIImageView *rpapImageView;
@property (strong, nonatomic) IBOutlet UILabel *mapLocationLabel;
@property BOOL showPathway;
@property (strong, nonatomic) NSString *message;
@property (strong, nonatomic) NSString *location1;
@property (strong, nonatomic) NSString *location2;
@end
| 40.702703 | 74 | 0.800133 |
b2d18501d17a461813526ffc739b3386958593ec
| 2,829 |
py
|
Python
|
backend/fief/schemas/workspace.py
|
fief-dev/fief
|
cbfeec11da7a03aa345cb7ceb088b5d8ec9d6ab1
|
[
"MIT"
] | 1 |
2022-02-13T17:39:42.000Z
|
2022-02-13T17:39:42.000Z
|
backend/fief/schemas/workspace.py
|
fief-dev/fief
|
cbfeec11da7a03aa345cb7ceb088b5d8ec9d6ab1
|
[
"MIT"
] | 1 |
2022-02-13T14:46:24.000Z
|
2022-02-13T14:46:24.000Z
|
backend/fief/schemas/workspace.py
|
fief-dev/fief
|
cbfeec11da7a03aa345cb7ceb088b5d8ec9d6ab1
|
[
"MIT"
] | null | null | null |
from typing import Optional
from pydantic import BaseModel, root_validator, validator
from fief.crypto.encryption import decrypt
from fief.db.types import DatabaseType
from fief.errors import APIErrorCode
from fief.schemas.generics import UUIDSchema
from fief.settings import settings
def validate_all_database_settings(cls, values):
database_type = values.get("database_type")
database_settings = [
values.get("database_host"),
values.get("database_port"),
values.get("database_username"),
values.get("database_password"),
values.get("database_name"),
]
if database_type is None and not any(database_settings):
return values
if database_type is None and any(database_settings):
raise ValueError(APIErrorCode.WORKSPACE_CREATE_MISSING_DATABASE_SETTINGS)
database_name = values.get("database_name")
if database_type == DatabaseType.SQLITE:
if database_name is None:
raise ValueError(APIErrorCode.WORKSPACE_CREATE_MISSING_DATABASE_SETTINGS)
else:
if not all(database_settings):
raise ValueError(APIErrorCode.WORKSPACE_CREATE_MISSING_DATABASE_SETTINGS)
return values
class WorkspaceCheckConnection(BaseModel):
database_type: DatabaseType
database_host: str
database_port: int
database_username: str
database_password: str
database_name: str
_validate_all_database_settings = root_validator(allow_reuse=True)(
validate_all_database_settings
)
class WorkspaceCreate(BaseModel):
name: str
database_type: Optional[DatabaseType]
database_host: Optional[str]
database_port: Optional[int]
database_username: Optional[str]
database_password: Optional[str]
database_name: Optional[str]
_validate_all_database_settings = root_validator(allow_reuse=True)(
validate_all_database_settings
)
class BaseWorkspace(UUIDSchema):
name: str
domain: str
class Workspace(BaseWorkspace):
database_type: Optional[DatabaseType]
database_host: Optional[str]
database_port: Optional[int]
database_username: Optional[str]
database_password: Optional[str]
database_name: Optional[str]
@validator(
"database_host",
"database_username",
"database_password",
"database_name",
pre=True,
)
def decrypt_database_setting(cls, value: Optional[str]) -> Optional[str]:
if value is None:
return value
return decrypt(value, settings.encryption_key)
@validator("database_port", pre=True)
def decrypt_database_port(cls, value: Optional[str]) -> Optional[int]:
if value is None:
return value
return int(decrypt(value, settings.encryption_key))
class WorkspacePublic(BaseWorkspace):
pass
| 28.29 | 85 | 0.721456 |
f1712a989077760f2b977fa2248efa1ecb1216c4
| 348 |
rb
|
Ruby
|
test/test_helper.rb
|
warwickshire/indulgence
|
a679747244a73f5a4dc780027b05a86c550488c5
|
[
"MIT"
] | null | null | null |
test/test_helper.rb
|
warwickshire/indulgence
|
a679747244a73f5a4dc780027b05a86c550488c5
|
[
"MIT"
] | null | null | null |
test/test_helper.rb
|
warwickshire/indulgence
|
a679747244a73f5a4dc780027b05a86c550488c5
|
[
"MIT"
] | null | null | null |
ENV["RAILS_ENV"] = "test"
$:.unshift File.join(File.dirname(__FILE__),'units')
$:.unshift File.join(File.dirname(__FILE__),'lib')
$:.unshift File.join(File.dirname(__FILE__),'..','lib','indulgence')
require 'test/unit'
require 'active_record'
ActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => "test/db/test.sqlite3.db"
| 34.8 | 102 | 0.721264 |
9c81d7357950bdee8236c451c9facd808791d4a5
| 627 |
js
|
JavaScript
|
backend/src/database/knex/index.js
|
IagooCesaar/cursos-rocketseat-omnistack-11
|
177221c9a9044786b8456b5e0f57b9ea0270a516
|
[
"MIT"
] | 10 |
2020-04-20T21:53:48.000Z
|
2020-06-06T20:52:10.000Z
|
backend/src/database/knex/index.js
|
IagooCesaar/cursos-rocketseat-omnistack-11
|
177221c9a9044786b8456b5e0f57b9ea0270a516
|
[
"MIT"
] | 9 |
2021-03-10T12:40:18.000Z
|
2022-02-27T02:02:51.000Z
|
backend/src/database/knex/index.js
|
IagooCesaar/cursos-rocketseat-omnistack-11
|
177221c9a9044786b8456b5e0f57b9ea0270a516
|
[
"MIT"
] | null | null | null |
const knex = require("knex");
const knexConfig = require("../../../knexfile");
const canLog = process.env.CAN_LOG || false === true;
let config = null;
const getConfig = () => {
switch (process.env.NODE_ENV) {
case "test":
config = knexConfig.test;
return;
case "prod":
config = knexConfig.production;
return;
case "staging":
config = knexConfig.staging;
return;
default:
config = knexConfig.dev;
return;
}
};
getConfig();
// console.log("Knex config to env ", process.env.NODE_ENV, config);
const connection = knex(config);
module.exports = connection;
| 20.9 | 68 | 0.62201 |
9c7bc5120420a0cb25ef620b57ad969b440a8f11
| 1,829 |
js
|
JavaScript
|
js/iconType.js
|
baajur/twint-desktop-native
|
3801fed6c6e4d31a6354ef1faa37a959c29de57c
|
[
"MIT"
] | 14 |
2019-09-02T14:18:13.000Z
|
2022-03-15T01:07:46.000Z
|
js/iconType.js
|
baajur/twint-desktop-native
|
3801fed6c6e4d31a6354ef1faa37a959c29de57c
|
[
"MIT"
] | 2 |
2021-10-12T22:18:57.000Z
|
2022-03-25T18:44:19.000Z
|
js/iconType.js
|
baajur/twint-desktop-native
|
3801fed6c6e4d31a6354ef1faa37a959c29de57c
|
[
"MIT"
] | 6 |
2020-05-10T23:52:01.000Z
|
2021-07-23T16:03:57.000Z
|
const solid = "../icons/solid/"
const brands = "../icons/brands/"
const icons = {
"email" : solid + "envelope.svg",
"domain" : solid + "building.svg",
"criminal" : solid + "angry.svg",
"malware" : solid + "bug.svg",
"vector" : solid + "bus.svg",
"lightDrug" : solid + "cannabis.svg",
"heavyDrug" : solid + "capsules.svg",
"IOC" : solid + "car-crash.svg",
"admin" : solid + "crown.svg",
"child" : solid + "child.svg",
"market" : solid + "city.svg",
"cloud" : solid + "cloud.svg",
"forum" : solid + "comments.svg",
"creditCard" : solid + "credit-card.svg",
"arms" : solid + "crosshairs.svg",
"dumps" : solid + "datasolid.svg",
"pdf" : solid + "file-pdf.svg",
"audio" : solid + "file-audio.svg",
"image" : solid + "file-image.svg",
"ppt" : solid + "file-powerpoint.svg",
"video" : solid + "file-video.svg",
"docx" : solid + "file-word.svg",
"fingerprint" : solid + "fingerprint.svg",
"key" : solid + "key.svg",
"position" : solid + "map-marked-alt.svg",
"user" : solid + "user-alt.svg",
"bitcoin" : brands + "bitcoin.svg",
"discord" : brands + "discord.svg",
"facebook" : brands + "facebook.svg",
"keybase" : brands + "keybase.svg",
"linkedin" : brands + "linkedin.svg",
"monero" : brands + "monero.svg",
"paypal" : brands + "paypal.svg",
"reddit" : brands + "reddit.svg",
"skype" : brands + "skype.svg",
"snapchat" : brands + "snapchat-square.svg",
"stackOverflow" : brands + "stack-overflow.svg",
"telegram" : brands + "telegram.svg",
"tumblr" : brands + "tumblr-square.svg",
"twitter" : brands + "twitter-square.svg",
"vk" : brands + "vk.svg",
"whatsapp" : brands + "whatsapp.svg",
"yahoo" : brands + "yahoo.svg",
"youtube" : brands + "youtube.svg",
}
| 36.58 | 52 | 0.56479 |
0e39ad6d35627e7cc119369d04d0ef7bf5d89883
| 9,090 |
html
|
HTML
|
doc/dist/users/tour.html
|
embedthis/pak
|
3ef3e5fdb7b74814db5d63c949b8c8bb5c1bd844
|
[
"Zlib",
"Apache-2.0",
"BSD-2-Clause"
] | 7 |
2015-07-28T11:37:10.000Z
|
2020-11-09T07:19:44.000Z
|
doc/dist/users/tour.html
|
embedthis/pak
|
3ef3e5fdb7b74814db5d63c949b8c8bb5c1bd844
|
[
"Zlib",
"Apache-2.0",
"BSD-2-Clause"
] | 39 |
2015-04-10T01:06:18.000Z
|
2019-09-28T11:46:54.000Z
|
doc/dist/users/tour.html
|
embedthis/pak
|
3ef3e5fdb7b74814db5d63c949b8c8bb5c1bd844
|
[
"Zlib",
"Apache-2.0",
"BSD-2-Clause"
] | 9 |
2016-03-01T10:53:48.000Z
|
2021-11-09T12:57:25.000Z
|
<!DOCTYPE html>
<html lang="en">
<head>
<title>Quick Tour</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<meta name="description" content="Package manager for Applications">
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Open+Sans:300italic,400,300,700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Julius+Sans+One' rel='stylesheet' type='text/css'>
<link href="../images/favicon.ico" rel="shortcut icon">
<link href="../lib/semantic-ui/semantic.min.css" rel="stylesheet" type="text/css">
<link href="../css/all.min.css" rel="stylesheet" type="text/css">
<link href="../css/api.min.css" rel="stylesheet" type="text/css">
</head>
<body class="show-sidebar">
<div class="sidebar">
<div class="ui large left vertical inverted labeled menu">
<div class="item">
<a href="../index.html" class="logo">Pak Docs</a>
</div>
<div class="item">
<a href="../index.html">
<b>General</b>
</a>
<div class="menu">
<a class="item" href="../index.html">Pak Overview</a>
<a class="item" href="../users/features.html">Pak Features</a>
<a class="item" href="https://embedthis.com/pak/download.html">Download</a>
<a class="item" href="../licensing/index.html">Licensing</a>
</div>
</div>
<div class="item">
<a href="../start/index.html">
<b>Getting Started</b>
</a>
<div class="menu">
<a class="item" href="../start/quick.html">Quick Start</a>
<a class="item" href="../start/installing.html">Installing</a>
<a class="item" href="../start/releaseNotes.html">Release Notes</a>
<a class="item" href="../start/source.html">Building from Source</a>
</div>
</div>
<div class="item">
<a href="../users/index.html"><b>User's Guide</b></a>
<div class="menu">
<a class="item" href="../users/tour.html">Quick Tour</a>
<a class="item" href="../users/installing.html">Installing Packages</a>
<a class="item" href="../users/customizing.html">Customizing Packages</a>
<a class="item" href="../users/versions.html">Package Versions</a>
<a class="item" href="../users/profiles.html">Pak Profiles</a>
</div>
</div>
<div class="item">
<a href="../developers/index.html"><b>Developer's Guide</b></a>
<div class="menu">
<a class="item" href="../developers/creating.html">Creating Packages</a>
<a class="item" href="../developers/events.html">Package Events</a>
<a class="item" href="../developers/configuration.html">Pak Configuration</a>
</div>
</div>
<div class="item">
<a href="../users/project.html">Project Resources</a>
<div class="menu">
<a class="item" href="https://embedthis.com/blog/categories/Pak/">Official Pak News</a>
<a class="item" href="https://embedthis.com/pak/">Pak Web Site</a>
<a class="item" href="https://github.com/embedthis/pak">Source Code Repository</a>
<a class="item" href="https://github.com/embedthis/pak/issues">Project Issue Database</a>
<a class="item" href="https://github.com/embedthis/pak/releases">Change Log</a>
<a class="item" href="https://github.com/embedthis/pak/milestones">Roadmap</a>
<a class="item" href="https://embedthis.com/developers/contributors.html">Contributors Agreement</a>
</div>
</div>
<div class="item">
<b>Links</b>
<div class="menu">
<a class="item" href="https://embedthis.com/">Embedthis Web Site</a>
<a class="item" href="https://embedthis.com/blog/">Embedthis Blog</a>
<a class="item" href="http://twitter.com/embedthat">Twitter</a>
</div>
</div>
</div>
</div>
<div class="ui inverted masthead">
<div class="ui fixed inverted menu">
<div class="ui sidebar-launch button">
<i class="icon list layout"></i>
</div>
<div class="right menu">
<a class="item" href="https://embedthis.com/">Embedthis</a>
<a class="item" href="https://embedthis.com/pak/">Pak Site</a>
<span class="desktop-only">
<a class="item" href="https://embedthis.com/blog/categories/Pak/">Pak News</a>
<a class="item" href="https://github.com/embedthis/pak">Repository</a>
<a class="item" href="https://embedthis.com/blog/">Blog</a>
<a class="item" href="https://twitter.com/embedthat">Twitter</a>
</span>
</div>
</div>
<div class="ui breadcrumb">
<a class="section" href="../">Home</a>
<div class="divider">/</div>
<a class="section" href="tour.html">
User's Guide
</a>
<div class="divider">/</div>
<a class="active section" href="tour.html">Quick Tour</a>
</div>
<iframe class="version desktop-only" src="../version.html"></iframe>
</div>
<div class="content">
<h1>Quick Tour of Pak</h1>
<h2>Installing Paks</h2>
<p>To install named packages:</p>
<code>pak install NAME...</code>
<p>Where NAME can be the name of a package published in the Pak catalog, NPM or bower catalog,
a GitHub repository endpoint, a GitHub account/repository or a path to a local
package directory. Here are some of the forms you can use to install packages.</p>
<code>pak install jquery
pak install jquery
pak install https://github.com/embedthis/jquery.git
pak install git@github.com:embedthis/jquery
pak install embedthis/jquery</code>
<p>When a package is installed, all required dependent packages will be automatically installed.</p>
<h3>Installing Specific Versions</h3>
<p>A PAK name may have a <em>#version</em> suffix that nominates a specific version to install.
<code>pak install 'jquery#2.1.3'</code>
<p>To install all the packages required by an application as specified in its pak.json:</p>
<code>pak install</code>
<h2>Removing Paks</h2>
<p>To uninstall a package from your local directory. The package will remain in the local Pak cache under
<em>~/.paks</em>.</p>
<code>pak uninstall PAK...</code>
<h2>List Paks</h2>
<p>To list installed packages in your local directory:</p>
<code>pak list</code>
<p>The list will display the package name, installed version and from where the package was downloaded.
Paks may designated as optional if the pak.json describes them in the 'optionalDependencies' list. </p>
<h2>Pak Dependencies</h2>
<p>To display dependencies for installed packages in your local directory</p>
<code>pak depend</code>
<p>This will display the installed packages and their dependencies with versions.</p>
<h2>Cached Paks</h2>
<p>When Pak installs a package, it keeps a copy of the package in the Pak cache which is typically at
<em>~/.paks</em>.
The cache stores all versions downloaded of a Pak.</p>
<code>pak cached</code>
<h2>Pre-Caching</h2>
<p>To download and cache a package but not install in the local directory</p>
<code>pak cache Name</code>
<h2>Pruning Paks</h2>
<p>To prune old versions from the cache</p>
<code>pak prune Name</code>
</div>
<div class="terms ui basic center aligned segment">
<p>© Embedthis Software. All rights reserved.</p>
</div>
<script src="../lib/jquery/jquery.min.js"></script>
<script src="../lib/semantic-ui/semantic.min.js"></script>
<script src="../scripts/sidebar.min.js"></script>
| 44.558824 | 146 | 0.538944 |
67f5394ce79bb56fe20797602fec4beb6eb9acc7
| 269 |
swift
|
Swift
|
Sources/AnyLint/Extensions/URLExt.swift
|
andrej8888/AnyLint
|
8914705c3cffeb0411f0238265a6070abcfd7b53
|
[
"MIT"
] | 117 |
2020-03-22T23:09:10.000Z
|
2022-03-21T06:44:24.000Z
|
Sources/AnyLint/Extensions/URLExt.swift
|
andrej8888/AnyLint
|
8914705c3cffeb0411f0238265a6070abcfd7b53
|
[
"MIT"
] | 31 |
2020-03-18T07:57:25.000Z
|
2022-03-31T09:56:46.000Z
|
Sources/AnyLint/Extensions/URLExt.swift
|
andrej8888/AnyLint
|
8914705c3cffeb0411f0238265a6070abcfd7b53
|
[
"MIT"
] | 4 |
2020-03-27T15:36:04.000Z
|
2022-01-19T14:19:21.000Z
|
import Foundation
import Utility
extension URL {
/// Returns the relative path of from the current path.
public var relativePathFromCurrent: String {
String(path.replacingOccurrences(of: fileManager.currentDirectoryPath, with: "").dropFirst())
}
}
| 26.9 | 101 | 0.732342 |
e3ce814683a93366437d595026deb0931785d9a4
| 6,830 |
go
|
Go
|
service/cognitoidentityprovider/api_op_GetUserAttributeVerificationCode.go
|
kichik/aws-sdk-go-v2
|
e6432821e1e212895376c492e01cffaa7f39262e
|
[
"Apache-2.0"
] | null | null | null |
service/cognitoidentityprovider/api_op_GetUserAttributeVerificationCode.go
|
kichik/aws-sdk-go-v2
|
e6432821e1e212895376c492e01cffaa7f39262e
|
[
"Apache-2.0"
] | null | null | null |
service/cognitoidentityprovider/api_op_GetUserAttributeVerificationCode.go
|
kichik/aws-sdk-go-v2
|
e6432821e1e212895376c492e01cffaa7f39262e
|
[
"Apache-2.0"
] | null | null | null |
// Code generated by smithy-go-codegen DO NOT EDIT.
package cognitoidentityprovider
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets the user attribute verification code for the specified attribute name. This
// action might generate an SMS text message. Starting June 1, 2021, US telecom
// carriers require you to register an origination phone number before you can send
// SMS messages to U.S. phone numbers. If you use SMS text messages in Amazon
// Cognito, you must register a phone number with Amazon Pinpoint
// (https://console.aws.amazon.com/pinpoint/home/). Amazon Cognito will use the
// registered number automatically. Otherwise, Amazon Cognito users that must
// receive SMS messages might be unable to sign up, activate their accounts, or
// sign in. If you have never used SMS text messages with Amazon Cognito or any
// other Amazon Web Service, Amazon Simple Notification Service might place your
// account in SMS sandbox. In sandbox mode
// (https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html) , you will have
// limitations, such as sending messages only to verified phone numbers. After
// testing in the sandbox environment, you can move out of the SMS sandbox and into
// production. For more information, see SMS message settings for Amazon Cognito
// User Pools
// (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html)
// in the Amazon Cognito Developer Guide.
func (c *Client) GetUserAttributeVerificationCode(ctx context.Context, params *GetUserAttributeVerificationCodeInput, optFns ...func(*Options)) (*GetUserAttributeVerificationCodeOutput, error) {
if params == nil {
params = &GetUserAttributeVerificationCodeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetUserAttributeVerificationCode", params, optFns, c.addOperationGetUserAttributeVerificationCodeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetUserAttributeVerificationCodeOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents the request to get user attribute verification.
type GetUserAttributeVerificationCodeInput struct {
// The access token returned by the server response to get the user attribute
// verification code.
//
// This member is required.
AccessToken *string
// The attribute name returned by the server response to get the user attribute
// verification code.
//
// This member is required.
AttributeName *string
// A map of custom key-value pairs that you can provide as input for any custom
// workflows that this action triggers. You create custom workflows by assigning
// Lambda functions to user pool triggers. When you use the
// GetUserAttributeVerificationCode API action, Amazon Cognito invokes the function
// that is assigned to the custom message trigger. When Amazon Cognito invokes this
// function, it passes a JSON payload, which the function receives as input. This
// payload contains a clientMetadata attribute, which provides the data that you
// assigned to the ClientMetadata parameter in your
// GetUserAttributeVerificationCode request. In your function code in Lambda, you
// can process the clientMetadata value to enhance your workflow for your specific
// needs. For more information, see Customizing User Pool Workflows with Lambda
// Triggers
// (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html)
// in the Amazon Cognito Developer Guide. When you use the ClientMetadata
// parameter, remember that Amazon Cognito won't do the following:
//
// * Store the
// ClientMetadata value. This data is available only to Lambda triggers that are
// assigned to a user pool to support custom workflows. If your user pool
// configuration doesn't include triggers, the ClientMetadata parameter serves no
// purpose.
//
// * Validate the ClientMetadata value.
//
// * Encrypt the ClientMetadata
// value. Don't use Amazon Cognito to provide sensitive information.
ClientMetadata map[string]string
noSmithyDocumentSerde
}
// The verification code response returned by the server response to get the user
// attribute verification code.
type GetUserAttributeVerificationCodeOutput struct {
// The code delivery details returned by the server in response to the request to
// get the user attribute verification code.
CodeDeliveryDetails *types.CodeDeliveryDetailsType
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetUserAttributeVerificationCodeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetUserAttributeVerificationCode{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetUserAttributeVerificationCode{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetUserAttributeVerificationCodeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetUserAttributeVerificationCode(options.Region), middleware.Before); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetUserAttributeVerificationCode(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
OperationName: "GetUserAttributeVerificationCode",
}
}
| 40.176471 | 194 | 0.77306 |
272ac8348e4e641e4b81f55ba49dd3a70f7c5918
| 223 |
css
|
CSS
|
admin/admin-app/src/views/BuildToolView.css
|
16patsle/abtf-reborn
|
eb70d7b8ba977aa29573f32ce48713984e73cc3d
|
[
"MIT"
] | 2 |
2019-04-26T21:30:23.000Z
|
2019-10-01T13:51:13.000Z
|
admin/admin-app/src/views/BuildToolView.css
|
16patsle/abtf-reborn
|
eb70d7b8ba977aa29573f32ce48713984e73cc3d
|
[
"MIT"
] | null | null | null |
admin/admin-app/src/views/BuildToolView.css
|
16patsle/abtf-reborn
|
eb70d7b8ba977aa29573f32ce48713984e73cc3d
|
[
"MIT"
] | null | null | null |
.abtfr-wrapper .submit-buttons input:first-of-type {
margin-right: 5px;
}
.abtfr-wrapper ul.small-list {
list-style: disc;
padding-left: 2em;
margin: 0;
}
.abtfr-wrapper ul.small-list li {
margin-bottom: 2px;
}
| 15.928571 | 52 | 0.681614 |
5feefee1ba73ea8d1e7461cad9206f5c799308bf
| 2,095 |
h
|
C
|
board/trembyle/board.h
|
SiliconMitus39/Emb_Contr
|
0aa1ab988d902380f449b274ca9a05f2aa3d5539
|
[
"BSD-3-Clause"
] | null | null | null |
board/trembyle/board.h
|
SiliconMitus39/Emb_Contr
|
0aa1ab988d902380f449b274ca9a05f2aa3d5539
|
[
"BSD-3-Clause"
] | null | null | null |
board/trembyle/board.h
|
SiliconMitus39/Emb_Contr
|
0aa1ab988d902380f449b274ca9a05f2aa3d5539
|
[
"BSD-3-Clause"
] | 1 |
2021-05-27T03:14:47.000Z
|
2021-05-27T03:14:47.000Z
|
/* Copyright 2019 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.
*/
/* Trembyle board configuration */
#ifndef __CROS_EC_BOARD_H
#define __CROS_EC_BOARD_H
#include "baseboard.h"
/*
* Allow dangerous commands.
* TODO: Remove this config before production.
*/
#define CONFIG_SYSTEM_UNLOCKED
#define CONFIG_BRINGUP
#define CONFIG_I2C_DEBUG
#define CONFIG_MKBP_USE_GPIO
/* Motion sensing drivers */
#define CONFIG_ACCELGYRO_BMI160
#define CONFIG_ACCELGYRO_BMI160_INT_EVENT \
TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL)
#define CONFIG_ACCEL_INTERRUPTS
#define CONFIG_ACCEL_KX022
#define CONFIG_CMD_ACCELS
#define CONFIG_CMD_ACCEL_INFO
#define CONFIG_TABLET_MODE
#define CONFIG_LID_ANGLE
#define CONFIG_LID_ANGLE_UPDATE
#define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL
#define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL
/* GPIO mapping from board specific name to EC common name. */
#define CONFIG_BATTERY_PRESENT_GPIO GPIO_EC_BATT_PRES_ODL
#define GPIO_AC_PRESENT GPIO_ACOK_OD
#define GPIO_CPU_PROCHOT GPIO_PROCHOT_ODL
#define GPIO_EC_INT_L GPIO_EC_AP_INT_ODL
#define GPIO_ENABLE_BACKLIGHT_L GPIO_EC_EDP_BL_DISABLE
#define GPIO_ENTERING_RW GPIO_EC_ENTERING_RW
#define GPIO_KBD_KSO2 GPIO_EC_KSO_02_INV
#define GPIO_PCH_RSMRST_L GPIO_EC_FCH_RSMRST_L
#define GPIO_PCH_SLP_S3_L GPIO_SLP_S3_L
#define GPIO_PCH_SLP_S5_L GPIO_SLP_S5_L
#define GPIO_PCH_WAKE_L GPIO_EC_FCH_WAKE_L
#define GPIO_POWER_BUTTON_L GPIO_EC_PWR_BTN_ODL
#define GPIO_S0_PGOOD GPIO_S0_PWROK_OD
#define GPIO_S5_PGOOD GPIO_EC_PWROK_OD
#define GPIO_SYS_RESET_L GPIO_EC_SYS_RST_L
#define GPIO_VOLUME_DOWN_L GPIO_VOLDN_BTN_ODL
#define GPIO_VOLUME_UP_L GPIO_VOLUP_BTN_ODL
#define GPIO_WP_L GPIO_EC_WP_L
#ifndef __ASSEMBLER__
/* These GPIOs moved. Temporarily detect and support the V0 HW. */
extern enum gpio_signal GPIO_PCH_PWRBTN_L;
extern enum gpio_signal GPIO_PCH_SYS_PWROK;
enum battery_type {
BATTERY_AP18F4M,
BATTERY_TYPE_COUNT,
};
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
| 29.097222 | 73 | 0.836754 |
0c9b6c9c5f4b186068f0fcfe5f2c329ce7772e4d
| 740 |
py
|
Python
|
Module 2/Chapter08/template_simple.py
|
real-slim-chadi/Python_Master-the-Art-of-Design-Patterns
|
95ec92272374e330b04d931208abbb184c7c7908
|
[
"MIT"
] | 73 |
2016-09-15T23:07:04.000Z
|
2022-03-05T15:09:48.000Z
|
Module 2/Chapter08/template_simple.py
|
real-slim-chadi/Python_Master-the-Art-of-Design-Patterns
|
95ec92272374e330b04d931208abbb184c7c7908
|
[
"MIT"
] | null | null | null |
Module 2/Chapter08/template_simple.py
|
real-slim-chadi/Python_Master-the-Art-of-Design-Patterns
|
95ec92272374e330b04d931208abbb184c7c7908
|
[
"MIT"
] | 51 |
2016-10-07T20:47:51.000Z
|
2021-12-22T21:00:24.000Z
|
__author__ = 'Chetan'
from abc import ABCMeta, abstractmethod
class AbstractClass(metaclass=ABCMeta):
def __init__(self):
pass
@abstractmethod
def operation1(self):
pass
@abstractmethod
def operation2(self):
pass
def template_method(self):
print("Defining the Algorithm. Operation1 follows Operation2")
self.operation2()
self.operation1()
class ConcreteClass(AbstractClass):
def operation1(self):
print("My Concrete Operation1")
def operation2(self):
print("Operation 2 remains same")
class Client:
def main(self):
self.concreate = ConcreteClass()
self.concreate.template_method()
client = Client()
client.main()
| 19.473684 | 70 | 0.660811 |
b1f0da1864c6d0cb454639bbc614a6072fc389f1
| 1,463 |
kt
|
Kotlin
|
server/src/main/kotlin/org/cueglow/server/gdtf/RenderGdtfStateToDmx.kt
|
cueglow/glowdtf
|
b670ca9768cdd49551fa32af126498fe2ff261ba
|
[
"MIT"
] | null | null | null |
server/src/main/kotlin/org/cueglow/server/gdtf/RenderGdtfStateToDmx.kt
|
cueglow/glowdtf
|
b670ca9768cdd49551fa32af126498fe2ff261ba
|
[
"MIT"
] | null | null | null |
server/src/main/kotlin/org/cueglow/server/gdtf/RenderGdtfStateToDmx.kt
|
cueglow/glowdtf
|
b670ca9768cdd49551fa32af126498fe2ff261ba
|
[
"MIT"
] | null | null | null |
package org.cueglow.server.gdtf
fun renderGdtfStateToDmx(chValues: List<Long>, dmxMode: GlowDmxMode): ByteArray {
val output = mutableListOf<Byte>()
dmxMode.multiByteChannels
.groupBy { it.dmxBreak }
.toSortedMap()
.forEach { dmxBreak ->
val startInd = output.size
//logger.info("doing dmxBreak ${dmxBreak.key}")
dmxBreak.value.forEach { ch ->
val chInd = dmxMode.multiByteChannels.indexOf(ch)
val chValue = chValues[chInd]
ch.offsets
.reversed() // from least to most significant
.forEachIndexed { offsetIndex, offset ->
//logger.info("doing offset $offset with offsetIndex $offsetIndex")
val byteValue = (chValue shr 8 * offsetIndex).toByte()
// grow to right size
val dmxChannelInd = startInd + offset - 1
//logger.info("#wanting to insert at $dmxChannelInd")
while (output.size <= dmxChannelInd) {
//logger.info("growing one element for channel ${ch.name}")
output.add(0)
}
//logger.info("grown to ${output.size}")
output[dmxChannelInd] = byteValue
}
}
}
return output.toByteArray()
}
| 43.029412 | 91 | 0.505126 |
3972b168bd9b7c6da1d7a29c1c272697d639d74d
| 18,867 |
sql
|
SQL
|
src/main/resources/archetype-resources/docs/sql/init.sql
|
flian/carp-project-archetype
|
9ea237aa697f8ad41348cf04805a81d2ec6d63da
|
[
"MIT"
] | 1 |
2019-05-06T11:50:14.000Z
|
2019-05-06T11:50:14.000Z
|
src/main/resources/archetype-resources/docs/sql/init.sql
|
flian/carp-project-archetype
|
9ea237aa697f8ad41348cf04805a81d2ec6d63da
|
[
"MIT"
] | null | null | null |
src/main/resources/archetype-resources/docs/sql/init.sql
|
flian/carp-project-archetype
|
9ea237aa697f8ad41348cf04805a81d2ec6d63da
|
[
"MIT"
] | null | null | null |
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for carp_action
-- ----------------------------
CREATE TABLE `carp_action` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`action_method` varchar(5) DEFAULT NULL,
`action_url` varchar(100) NOT NULL,
`leaf` bit(1) NOT NULL,
`name` varchar(20) NOT NULL,
`parent_id` int(11) DEFAULT '-1',
`priority` int(11) DEFAULT '100',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of carp_action
-- ----------------------------
INSERT INTO `carp_action` VALUES ('1', 'ALL', 'NONE', '\0', '系统管理', '-1', '1');
INSERT INTO `carp_action` VALUES ('2', 'ALL', 'NONE', '\0', '业务管理', '-1', '1');
INSERT INTO `carp_action` VALUES ('3', 'ALL', 'NONE', '\0', '示例管理', '-1', '2');
INSERT INTO `carp_action` VALUES ('4', 'ALL', 'NONE', '\0', '权限中心', '1', '1');
INSERT INTO `carp_action` VALUES ('5', 'ALL', 'NONE', '\0', '示例中心', '3', '1');
INSERT INTO `carp_action` VALUES ('6', 'ALL', '/profile.*', '', '用户管理', '4', '1');
INSERT INTO `carp_action` VALUES ('7', 'ALL', '/roles.*', '', '角色管理', '4', '1');
INSERT INTO `carp_action` VALUES ('8', 'ALL', '/menus.*', '', '菜单管理', '4', '2');
INSERT INTO `carp_action` VALUES ('9', 'ALL', '/actions.*', '', '功能管理', '4', '3');
INSERT INTO `carp_action` VALUES ('10', 'ALL', '/cards.*', '', '卡片管理示范', '5', '1');
INSERT INTO `carp_action` VALUES ('11', 'ALL', '#', '\0', '客户管理', '2', '1');
INSERT INTO `carp_action` VALUES ('16', 'ALL', '/customer.*', '', '客户管理', '11', '1');
-- ----------------------------
-- Table structure for carp_customer
-- ----------------------------
CREATE TABLE `carp_customer` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`avatar` varchar(150) DEFAULT NULL,
`gender` int(11) DEFAULT NULL,
`mobile` varchar(11) NOT NULL,
`nick_name` varchar(32) CHARACTER SET utf8mb4 NOT NULL,
`password` varchar(64) NOT NULL,
`user_name` varchar(32) NOT NULL,
`uuid` varchar(64) NOT NULL,
`last_password_reset_date` datetime DEFAULT NULL,
`from_channel` varchar(64) NOT NULL,
`wx_open_id` varchar(32) DEFAULT NULL,
`wx_union_id` varchar(32) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UK_user_name` (`user_name`),
UNIQUE KEY `UK_uuid` (`uuid`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of carp_customer
-- ----------------------------
INSERT INTO `carp_customer` VALUES ('1', '11', '1', '13333333333', '小白', '$2a$10$tpYOWdQtvOKLWN02mUbDMO/Y3aHE8dM4q9jc.7cYJh/9mFPPnIEIi', 'test_001', '$10$tpYOWdQtvOKLWN02mUbDMO/Y3aHE8dM4q9jc.7cYJh/9mF2PnIEIi', null, 'NORMAL', null, null);
INSERT INTO `carp_customer` VALUES ('2', '222', '1', '13333333333', '大白', '$10$tpYOWdQtvOKLWN02mUbDMO/Y3aHE8dM4q9jc.7cYJh/9mFPPnIEIi', 'test_002', '$10$tpYOWdQtvOKLWN02mUbDMO/Y3aHE8dM4q9jc.7cYJh/9maPPnIEIi', null, 'NORMAL', null, null);
INSERT INTO `carp_customer` VALUES ('3', '33', '1', '13333333333', '张三', '$10$tpYOWdQtvOKLWN02mUbDMO/Y3aHE8dM4q9jc.7cYJh/9mFPPnIEIi', 'test_003', '$10$tpYOWdQtvOKLWN02mUbDMO/Y3aHE8dM4q9jc.7cYJh/9mFdPnIEIi', null, 'NORMAL', null, null);
INSERT INTO `carp_customer` VALUES ('4', '4', '1', '13333333333', '李四', '$10$tpYOWdQtvOKLWN02mUbDMO/Y3aHE8dM4q9jc.7cYJh/9mFPPnIEIi', 'test_004', '$10$tpYOWdQtvOKLWN02mUbDMO/Y3aHE8dM4q9jc.7cYJh/9mFxPnIEIi', null, 'NORMAL', null, null);
INSERT INTO `carp_customer` VALUES ('5', '5', '1', '13333333333', '王五', '$10$tpYOWdQtvOKLWN02mUbDMO/Y3aHE8dM4q9jc.7cYJh/9mFPPnIEIi', 'test_005', '$10$tdYOWdQtvOKLWN02mUbDMO/Y3aHE8dM4q9jc.7cYJh/9mFPPnIEIi', null, 'NORMAL', null, null);
INSERT INTO `carp_customer` VALUES ('6', '1', '1', '13333333333', '刘六', '$10$tpYOWdQtvOKLWN02mUbDMO/Y3aHE8dM4q9jc.7cYJh/9mFPPnIEIi', 'test_006', '$10$tpYOWdQtvOKLWN02mUbDMO/Y3aHE8dM4q9jc.7cYJh/9mXPPnIEIi', null, 'NORMAL', null, null);
INSERT INTO `carp_customer` VALUES ('7', 'http://thirdwx.qlogo.cn/mmopen/vi_32/DYAIOgq83eqdClaMPEeJeF8FubefH33VDZWYjCOZhyYQhicQjGcuibJ0xrcTQtcCia77I3t29LlCrfuLmtwIdthUw/132', '1', '00000000000', 'f? oy', '$2a$10$plvg4rx4NBV44cmHfJISLuKnLP3K4dvxE4SVrgDEXgHvwyBOBNq8e', 'oX__v0vDEShGvs22VD8xifHggmQc', 'b3a1ff72-1a47-40af-81c0-96356a054a16', '2018-08-17 13:14:45', 'WECHAT', 'oX__v0vDEShGvs22VD8xifHggmQc', null);
-- ----------------------------
-- Table structure for carp_menu
-- ----------------------------
CREATE TABLE `carp_menu` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`leaf` bit(1) NOT NULL,
`name` varchar(20) NOT NULL,
`parent_id` int(11) DEFAULT '-1',
`priority` int(11) DEFAULT '100',
`url` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=82 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of carp_menu
-- ----------------------------
INSERT INTO `carp_menu` VALUES ('1', '\0', '系统管理', '-1', '1', '');
INSERT INTO `carp_menu` VALUES ('2', '\0', '业务管理', '-1', '2', '');
INSERT INTO `carp_menu` VALUES ('5', '\0', '权限中心', '1', '1', '');
INSERT INTO `carp_menu` VALUES ('6', '', '用户管理', '5', '1', '/profile');
INSERT INTO `carp_menu` VALUES ('7', '', '角色管理', '5', '2', '/roles');
INSERT INTO `carp_menu` VALUES ('8', '', '菜单管理', '5', '3', '/menus');
INSERT INTO `carp_menu` VALUES ('9', '', '功能管理', '5', '4', '/actions');
INSERT INTO `carp_menu` VALUES ('10', '\0', '静态页面', '-1', '3', 'NONE');
INSERT INTO `carp_menu` VALUES ('12', '\0', 'Dashboard', '10', '1', 'NONE');
INSERT INTO `carp_menu` VALUES ('14', '', 'Dashboard V1', '12', '1', '/webjars/AdminLTE/index.html');
INSERT INTO `carp_menu` VALUES ('15', '', 'dashboard v2', '12', '1', '/webjars/AdminLTE/index2.html');
INSERT INTO `carp_menu` VALUES ('16', '\0', 'layout Options', '10', '2', 'NONE');
INSERT INTO `carp_menu` VALUES ('18', '\0', 'Charts', '10', '4', 'NONE');
INSERT INTO `carp_menu` VALUES ('19', '\0', 'Widgets', '10', '5', 'NONE');
INSERT INTO `carp_menu` VALUES ('20', '\0', 'UI Elements', '10', '6', 'NONE');
INSERT INTO `carp_menu` VALUES ('21', '\0', 'Forms', '10', '7', 'NONE');
INSERT INTO `carp_menu` VALUES ('22', '\0', 'Tables', '10', '8', 'NONE');
INSERT INTO `carp_menu` VALUES ('23', '\0', 'Calendar', '10', '9', 'NONE');
INSERT INTO `carp_menu` VALUES ('24', '\0', 'Mailbox', '10', '10', 'NONE');
INSERT INTO `carp_menu` VALUES ('27', '\0', 'Examples', '10', '13', 'NONE');
INSERT INTO `carp_menu` VALUES ('30', '\0', 'Documents', '10', '16', 'NONE');
INSERT INTO `carp_menu` VALUES ('31', '', 'documentation', '30', '1', '/webjars/AdminLTE/documentation/index.html');
INSERT INTO `carp_menu` VALUES ('32', '', 'Top Navigation', '16', '1', '/webjars/AdminLTE/pages/layout/top-nav.html');
INSERT INTO `carp_menu` VALUES ('33', '', 'Boxed', '16', '1', '/webjars/AdminLTE/pages/layout/boxed.html');
INSERT INTO `carp_menu` VALUES ('34', '', 'Fixed', '16', '2', '/webjars/AdminLTE/pages/layout/fixed.html');
INSERT INTO `carp_menu` VALUES ('35', '', 'Collapsed Sidebar', '16', '3', '/webjars/AdminLTE/pages/layout/collapsed-sidebar.html');
INSERT INTO `carp_menu` VALUES ('36', '', 'ChartJS', '18', '1', '/webjars/AdminLTE/pages/charts/chartjs.html');
INSERT INTO `carp_menu` VALUES ('37', '', 'Morris', '18', '1', '/webjars/AdminLTE/pages/charts/morris.html');
INSERT INTO `carp_menu` VALUES ('38', '', 'Flot', '18', '2', '/webjars/AdminLTE/pages/charts/flot.html');
INSERT INTO `carp_menu` VALUES ('39', '', 'Inline charts', '18', '3', '/webjars/AdminLTE/pages/charts/inline.html');
INSERT INTO `carp_menu` VALUES ('40', '', 'Widgets', '19', '1', '/webjars/AdminLTE/pages/widgets.html');
INSERT INTO `carp_menu` VALUES ('41', '', 'General', '20', '1', '/webjars/AdminLTE/pages/UI/general.html');
INSERT INTO `carp_menu` VALUES ('42', '', 'Icons', '20', '1', '/webjars/AdminLTE/pages/UI/icons.html');
INSERT INTO `carp_menu` VALUES ('43', '', 'Buttons', '20', '2', '/webjars/AdminLTE/pages/UI/buttons.html');
INSERT INTO `carp_menu` VALUES ('44', '', 'Sliders', '20', '3', '/webjars/AdminLTE/pages/UI/sliders.html');
INSERT INTO `carp_menu` VALUES ('45', '', 'Timeline', '20', '4', '/webjars/AdminLTE/pages/UI/timeline.html');
INSERT INTO `carp_menu` VALUES ('46', '', 'Modals', '20', '5', '/webjars/AdminLTE/pages/UI/modals.html');
INSERT INTO `carp_menu` VALUES ('51', '', 'General Elements', '21', '4', '/webjars/AdminLTE/pages/forms/general.html');
INSERT INTO `carp_menu` VALUES ('52', '', 'Advanced Elements', '21', '5', '/webjars/AdminLTE/pages/forms/advanced.html');
INSERT INTO `carp_menu` VALUES ('53', '', 'Editors', '21', '6', '/webjars/AdminLTE/pages/forms/editors.html');
INSERT INTO `carp_menu` VALUES ('54', '', 'Simple Tables', '22', '1', '/webjars/AdminLTE/pages/tables/simple.html');
INSERT INTO `carp_menu` VALUES ('55', '', 'Data tables', '22', '1', '/webjars/AdminLTE/pages/tables/data.html');
INSERT INTO `carp_menu` VALUES ('56', '', 'Calendar', '23', '1', '/webjars/AdminLTE/pages/calendar.html');
INSERT INTO `carp_menu` VALUES ('57', '', 'MainBox', '24', '1', '/webjars/AdminLTE/pages/mailbox/mailbox.html');
INSERT INTO `carp_menu` VALUES ('58', '', 'Invoice', '27', '1', '/webjars/AdminLTE/pages/examples/invoice.html');
INSERT INTO `carp_menu` VALUES ('59', '', 'Profile', '27', '1', '/webjars/AdminLTE/pages/examples/profile.html');
INSERT INTO `carp_menu` VALUES ('60', '', 'Login', '27', '2', '/webjars/AdminLTE/pages/examples/login.html');
INSERT INTO `carp_menu` VALUES ('61', '', 'Register', '27', '3', '/webjars/AdminLTE/pages/examples/register.html');
INSERT INTO `carp_menu` VALUES ('62', '', 'Lockscreen', '27', '4', '/webjars/AdminLTE/pages/examples/lockscreen.html');
INSERT INTO `carp_menu` VALUES ('63', '', '404 Error', '27', '5', '/webjars/AdminLTE/pages/examples/404.html');
INSERT INTO `carp_menu` VALUES ('64', '', '500 Error', '27', '6', '/webjars/AdminLTE/pages/examples/500.html');
INSERT INTO `carp_menu` VALUES ('65', '', 'Blank Page', '27', '7', '/webjars/AdminLTE/pages/examples/blank.html');
INSERT INTO `carp_menu` VALUES ('66', '', 'Pace Page', '27', '8', '/webjars/AdminLTE/pages/examples/pace.html');
INSERT INTO `carp_menu` VALUES ('67', '\0', '示例管理', '-1', '4', 'NONE');
INSERT INTO `carp_menu` VALUES ('68', '\0', '示例中心', '67', '1', 'NONE');
INSERT INTO `carp_menu` VALUES ('69', '', '卡片管理示范', '68', '1', '/cards');
INSERT INTO `carp_menu` VALUES ('70', '\0', '客户管理', '2', '1', '#');
INSERT INTO `carp_menu` VALUES ('75', '', '客户管理', '70', '1', '/customer');
-- ----------------------------
-- Table structure for carp_role
-- ----------------------------
CREATE TABLE `carp_role` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '逻辑主键',
`role_code` varchar(30) NOT NULL COMMENT '角色编码,业务主键。',
`role_name` varchar(50) NOT NULL COMMENT '角色名称。',
PRIMARY KEY (`id`),
UNIQUE KEY `UK_role_code` (`role_code`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of carp_role
-- ----------------------------
INSERT INTO `carp_role` VALUES ('1', 'ROLE_ADMIN', '系统管理员');
INSERT INTO `carp_role` VALUES ('2', 'ROLE_USER', '一般用户');
-- ----------------------------
-- Table structure for carp_role_action
-- ----------------------------
CREATE TABLE `carp_role_action` (
`role_id` bigint(20) NOT NULL,
`action_id` int(11) NOT NULL,
PRIMARY KEY (`role_id`,`action_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of carp_role_action
-- ----------------------------
INSERT INTO `carp_role_action` VALUES ('1', '6');
INSERT INTO `carp_role_action` VALUES ('1', '7');
INSERT INTO `carp_role_action` VALUES ('1', '8');
INSERT INTO `carp_role_action` VALUES ('1', '9');
INSERT INTO `carp_role_action` VALUES ('1', '10');
INSERT INTO `carp_role_action` VALUES ('1', '16');
-- ----------------------------
-- Table structure for carp_role_menu
-- ----------------------------
CREATE TABLE `carp_role_menu` (
`role_id` bigint(20) NOT NULL,
`menu_id` int(11) NOT NULL,
PRIMARY KEY (`role_id`,`menu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of carp_role_menu
-- ----------------------------
INSERT INTO `carp_role_menu` VALUES ('1', '6');
INSERT INTO `carp_role_menu` VALUES ('1', '7');
INSERT INTO `carp_role_menu` VALUES ('1', '8');
INSERT INTO `carp_role_menu` VALUES ('1', '9');
INSERT INTO `carp_role_menu` VALUES ('1', '14');
INSERT INTO `carp_role_menu` VALUES ('1', '15');
INSERT INTO `carp_role_menu` VALUES ('1', '31');
INSERT INTO `carp_role_menu` VALUES ('1', '32');
INSERT INTO `carp_role_menu` VALUES ('1', '33');
INSERT INTO `carp_role_menu` VALUES ('1', '34');
INSERT INTO `carp_role_menu` VALUES ('1', '35');
INSERT INTO `carp_role_menu` VALUES ('1', '36');
INSERT INTO `carp_role_menu` VALUES ('1', '37');
INSERT INTO `carp_role_menu` VALUES ('1', '38');
INSERT INTO `carp_role_menu` VALUES ('1', '39');
INSERT INTO `carp_role_menu` VALUES ('1', '40');
INSERT INTO `carp_role_menu` VALUES ('1', '41');
INSERT INTO `carp_role_menu` VALUES ('1', '42');
INSERT INTO `carp_role_menu` VALUES ('1', '43');
INSERT INTO `carp_role_menu` VALUES ('1', '44');
INSERT INTO `carp_role_menu` VALUES ('1', '45');
INSERT INTO `carp_role_menu` VALUES ('1', '46');
INSERT INTO `carp_role_menu` VALUES ('1', '51');
INSERT INTO `carp_role_menu` VALUES ('1', '52');
INSERT INTO `carp_role_menu` VALUES ('1', '53');
INSERT INTO `carp_role_menu` VALUES ('1', '54');
INSERT INTO `carp_role_menu` VALUES ('1', '55');
INSERT INTO `carp_role_menu` VALUES ('1', '56');
INSERT INTO `carp_role_menu` VALUES ('1', '57');
INSERT INTO `carp_role_menu` VALUES ('1', '58');
INSERT INTO `carp_role_menu` VALUES ('1', '59');
INSERT INTO `carp_role_menu` VALUES ('1', '60');
INSERT INTO `carp_role_menu` VALUES ('1', '61');
INSERT INTO `carp_role_menu` VALUES ('1', '62');
INSERT INTO `carp_role_menu` VALUES ('1', '63');
INSERT INTO `carp_role_menu` VALUES ('1', '64');
INSERT INTO `carp_role_menu` VALUES ('1', '65');
INSERT INTO `carp_role_menu` VALUES ('1', '66');
INSERT INTO `carp_role_menu` VALUES ('1', '69');
INSERT INTO `carp_role_menu` VALUES ('1', '75');
-- ----------------------------
-- Table structure for carp_showcase_card
-- ----------------------------
CREATE TABLE `carp_showcase_card` (
`id` bigint(50) NOT NULL AUTO_INCREMENT COMMENT '逻辑主键',
`card_id` varchar(64) NOT NULL COMMENT '卡号,业务主键',
`card_type` varchar(4) NOT NULL DEFAULT '0001' COMMENT '卡片类型',
`issue_value` decimal(12,2) NOT NULL COMMENT '卡片发行时价格',
`frozen_value` decimal(12,2) NOT NULL COMMENT '已冻结金额',
`balance_value` decimal(12,2) NOT NULL COMMENT '当前余额',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of carp_showcase_card
-- ----------------------------
INSERT INTO `carp_showcase_card` VALUES ('1', 'card001', '0001', '1000.00', '11.00', '1000.00');
INSERT INTO `carp_showcase_card` VALUES ('2', 'card002', '0001', '100.00', '0.00', '100.00');
INSERT INTO `carp_showcase_card` VALUES ('3', 'card003', '0001', '1000.00', '1.00', '1000.00');
INSERT INTO `carp_showcase_card` VALUES ('4', 'card004', '0001', '100.00', '0.00', '100.00');
INSERT INTO `carp_showcase_card` VALUES ('5', 'card005', '0001', '1000.00', '1.00', '1000.00');
INSERT INTO `carp_showcase_card` VALUES ('6', 'card006', '0001', '100.00', '0.00', '100.00');
INSERT INTO `carp_showcase_card` VALUES ('7', 'card007', '0001', '1000.00', '1.00', '1000.00');
INSERT INTO `carp_showcase_card` VALUES ('8', 'card008', '0001', '100.00', '0.00', '100.00');
INSERT INTO `carp_showcase_card` VALUES ('9', 'card009', '0001', '1000.00', '1.00', '1000.00');
INSERT INTO `carp_showcase_card` VALUES ('10', 'card010', '0001', '100.00', '0.00', '100.00');
INSERT INTO `carp_showcase_card` VALUES ('11', 'card011', '0001', '1000.00', '1.00', '1000.00');
INSERT INTO `carp_showcase_card` VALUES ('12', 'card012', '0001', '100.00', '0.00', '100.00');
-- ----------------------------
-- Table structure for carp_user
-- ----------------------------
CREATE TABLE `carp_user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '逻辑主键',
`password` varchar(64) NOT NULL COMMENT '密码',
`user_name` varchar(20) NOT NULL COMMENT '用户名',
PRIMARY KEY (`id`),
UNIQUE KEY `UK_user_name` (`user_name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of carp_user
-- ----------------------------
INSERT INTO `carp_user` VALUES ('1', '$2a$10$Ohb6kWObdqM231o8lzIkT.AWkApqhEe2XNL2akji9y0wzREdOa37q', 'admin');
INSERT INTO `carp_user` VALUES ('2', '$2a$10$HkOAFyU86LVXjtnlILOtFu2SdHQ4dJgYd6DATL.EydBLfvmRTo6wm', 'user');
-- ----------------------------
-- Table structure for carp_user_role
-- ----------------------------
CREATE TABLE `carp_user_role` (
`user_name` varchar(20) NOT NULL,
`role_code` varchar(30) NOT NULL,
PRIMARY KEY (`user_name`,`role_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of carp_user_role
-- ----------------------------
INSERT INTO `carp_user_role` VALUES ('admin', 'ROLE_ADMIN');
INSERT INTO `carp_user_role` VALUES ('user', 'ROLE_USER');
-- ----------------------------
-- Table structure for flyway_schema_history
-- ----------------------------
CREATE TABLE `flyway_schema_history` (
`installed_rank` int(11) NOT NULL,
`version` varchar(50) DEFAULT NULL,
`description` varchar(200) NOT NULL,
`type` varchar(20) NOT NULL,
`script` varchar(1000) NOT NULL,
`checksum` int(11) DEFAULT NULL,
`installed_by` varchar(100) NOT NULL,
`installed_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`execution_time` int(11) NOT NULL,
`success` tinyint(1) NOT NULL,
PRIMARY KEY (`installed_rank`),
KEY `flyway_schema_history_s_idx` (`success`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of flyway_schema_history
-- ----------------------------
INSERT INTO `flyway_schema_history` VALUES ('1', '1.0.0', 'security init', 'SQL', 'mysql/V1_0_0__security_init.sql', '2023838508', 'root', '2019-04-15 03:58:54', '749', '1');
INSERT INTO `flyway_schema_history` VALUES ('2', '1.1.0', 'showcase init', 'SQL', 'mysql/V1_1_0__showcase_init.sql', '-1608744166', 'root', '2019-04-15 03:58:55', '24', '1');
INSERT INTO `flyway_schema_history` VALUES ('3', '1.1.1', 'customer table init', 'SQL', 'mysql/V1_1_1__customer_table_init.sql', '-414965373', 'root', '2019-04-15 03:58:55', '72', '1');
INSERT INTO `flyway_schema_history` VALUES ('4', '1.1.10', 'core menu action init', 'SQL', 'mysql/V1_1_10__core_menu_action_init.sql', '313705840', 'root', '2019-04-15 03:58:55', '46', '1');
INSERT INTO `flyway_schema_history` VALUES ('5', '1.1.11', 'core seed data init', 'SQL', 'mysql/V1_1_11__core_seed_data_init.sql', '238315186', 'root', '2019-04-15 03:58:55', '76', '1');
INSERT INTO `flyway_schema_history` VALUES ('6', null, 'security assign admin everything', 'SQL', 'mysql/R__security_assign_admin_everything.sql', '-790612620', 'root', '2019-04-15 03:58:55', '41', '1');
| 57.346505 | 411 | 0.623523 |
2f988e203f65ad301f8dddcad2fa5ab167229b4f
| 465 |
sql
|
SQL
|
Minkeu_Question3.sql
|
imeldakamdem/timetable
|
99f5dedefe43b54dcf9ffacf248bcafa726523ef
|
[
"MIT"
] | null | null | null |
Minkeu_Question3.sql
|
imeldakamdem/timetable
|
99f5dedefe43b54dcf9ffacf248bcafa726523ef
|
[
"MIT"
] | null | null | null |
Minkeu_Question3.sql
|
imeldakamdem/timetable
|
99f5dedefe43b54dcf9ffacf248bcafa726523ef
|
[
"MIT"
] | null | null | null |
CREATE VIEW emploiTemps
AS SELECT DISTINCT C.codeCours,
T.jourCoursDate,T. TRANCHE,C.VOLUMEH FROM Cours C
JOIN Typehoraire T ON C.codeCours= T.crsCodeCours
JOIN Jourcours J ON J.dateJourCours=T.jourCoursDate
JOIN Coursdeclasse cls ON T.crsCodeCours=cls.crsCodeCours
JOIN Classe Cl ON cl.specialiteNomSpec=cls.classSpecialiteNomspec
WHERE T.jourCoursDate IN ('lundi','mardi','mercredi','jeudi','vendredi','samedi')
AND cls.classNiveauidNiveau=001;
| 46.5 | 83 | 0.787097 |
f2c765ddf28eb546bf88b303147d919ac9d138d7
| 1,161 |
swift
|
Swift
|
Sources/Network/Network+ErrorDecoding.swift
|
Mindera/Alicerce
|
21f56cbed3c392daf96dfce0f7f634513e5111f8
|
[
"MIT"
] | 449 |
2016-12-16T02:27:38.000Z
|
2021-12-16T18:49:30.000Z
|
Sources/Network/Network+ErrorDecoding.swift
|
Mindera/Alicerce
|
21f56cbed3c392daf96dfce0f7f634513e5111f8
|
[
"MIT"
] | 220 |
2017-03-08T14:46:34.000Z
|
2022-02-09T17:30:21.000Z
|
Sources/Network/Network+ErrorDecoding.swift
|
Mindera/Alicerce
|
21f56cbed3c392daf96dfce0f7f634513e5111f8
|
[
"MIT"
] | 37 |
2017-06-01T11:09:10.000Z
|
2021-09-15T03:14:01.000Z
|
import Foundation
extension Network {
/// A custom error decoding witness.
public struct ErrorDecoding<Payload, Metadata> {
/// The error decode closure, invoked when some operation fails in an attempt to extract a custom error
/// (e.g. extract API specific error after a HTTP protocol error).
public let decode: (Payload?, Metadata) -> Error?
/// Instantiates a new error decoder, with the given decode closure.
/// - Parameter decode: The error decode closure.
public init(decode: @escaping (Payload?, Metadata) -> Error?) {
self.decode = decode
}
}
}
extension Network.ErrorDecoding where Payload == Data {
/// An error decoding witness for `Decodable` errors encoded in JSON.
public static func json<E: Error & Decodable>(
_ t: E.Type = E.self,
decoder: JSONDecoder = .init()
) -> Self {
.init { data, _ in data.flatMap { try? decoder.decode(E.self, from: $0) } }
}
}
extension Network.ErrorDecoding {
/// An error decoding witness that doesn't decode errors.
public static var dummy: Self { .init { _, _ in nil } }
}
| 30.552632 | 111 | 0.637382 |
95b10b6c7418dcd5328895354ef51759ab32e2a0
| 3,467 |
css
|
CSS
|
assets/css/style.css
|
SheylaPopovich/project-1
|
02029c742c90220a747fe833a9f799a90d674c1f
|
[
"MIT"
] | 2 |
2021-07-30T04:21:09.000Z
|
2021-08-03T00:51:33.000Z
|
assets/css/style.css
|
SheylaPopovich/project-1
|
02029c742c90220a747fe833a9f799a90d674c1f
|
[
"MIT"
] | 18 |
2021-07-31T19:37:10.000Z
|
2021-08-05T15:41:19.000Z
|
assets/css/style.css
|
SheylaPopovich/project-1
|
02029c742c90220a747fe833a9f799a90d674c1f
|
[
"MIT"
] | null | null | null |
body,
html {
background-color: #0a0a0a;
height: 100%;
margin: 0;
overflow-y: auto;
overflow-x: hidden;
color: white;
width: 100vw;
}
.hide {
display: none;
}
a {
font-family: "Bitter", serif;
margin-left: 88%;
color: white;
font-size: 1rem;
text-shadow: 0 0 5px #c2ccec, 0 0 10px #c2ccec, 0 0 20px #c2ccec,
0 0 30px #c2ccec, 0 0 40px #c2ccec;
}
.hero-image {
background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
url("../images/pullup.jpg");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
height: 100%;
}
.hero-image1 {
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
height: 100vh;
}
.hero-image2 {
background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
url("../assest/images/men-sled.jfif");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
height: 100%;
}
.hero-text {
text-align: center;
color: white;
line-height: 60px;
font-family: "Bitter", serif;
font-size: 1.4rem;
font-weight: bolder;
}
#hero-text1 {
font-family: "Bitter", serif;
padding-left: 5%;
padding-right: 5%;
text-align: center;
margin-top: 2%;
font-size: 1.7rem;
color: #ffffff;
text-shadow: 0 0 5px #c2ccec, 0 0 10px #c2ccec, 0 0 20px #c2ccec,
0 0 30px #c2ccec, 0 0 40px #c2ccec;
}
#hero-text2 {
font-family: "Bitter", serif;
padding-left: 50%;
color: #ffffff;
text-shadow: 0 0 5px #c2ccec, 0 0 10px #c2ccec, 0 0 20px #c2ccec,
0 0 30px #c2ccec, 0 0 40px #c2ccec;
text-align: center;
}
#title {
display: block;
margin-left: auto;
margin-right: auto;
padding-top: 12%;
}
.title {
color: rgb(0, 4, 255);
font-size: 2rem;
font-weight: 600;
line-height: 1.125;
font-family: "Bitter", serif;
}
#titleHeader {
font-family: "Alfa Slab One", cursive;
font-size: 3rem;
font-style: oblique;
text-align: left;
}
#subtitle {
font-family: "Bitter", serif;
line-height: 2;
padding-top: 0%;
border-top: solid rgb(0, 4, 255);
}
.subtitle {
font-family: "Bitter", serif;
color: #4a4a4a;
font-size: 1.25rem;
font-weight: 400;
}
.workout-title {
font-family: "Alfa Slab One", cursive;
color: rgb(0, 4, 255);
border-bottom: solid white;
font-size: 1.4rem;
}
.work-out {
padding-left: 7%;
padding-right: 7%;
padding-top: 5%;
padding-bottom: 5%;
margin-left: 8%;
margin-right: 8%;
margin-top: 5%;
background: #232526;
background: -webkit-linear-gradient(to right, #414345, #232526);
background: linear-gradient(to right, #414345, #232526);
mix-blend-mode: hard-light;
transition: all 0.2s linear;
}
.work-out:hover {
color: #52bff2;
}
.column {
padding: 0%;
}
#column1 {
background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
url("../images/woman-weights.jfif");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
#button-div {
margin-left: 40%;
margin-bottom: 10%;
}
.box {
background-color: #363636;
border-radius: 6px;
box-shadow: 0 0.5em 1em -0.125em rgb(10 10 10 / 10%),
0 0 0 1px rgb(10 10 10 / 2%);
color: #ffffff;
display: block;
font-family: "Bitter", serif;
padding: 1.5rem;
}
.button.is-info {
background-color: rgb(0, 4, 255);
border-color: transparent;
color: #fff;
margin-right: 2%;
}
| 19.261111 | 76 | 0.637727 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.