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
b3405882ccda2994494e98c34e76fd38241fdaf3
1,732
rs
Rust
src/utils/withdraw.rs
l1h3r/scarab
7af418f39862632a8f01ba636d31572206e5485f
[ "Apache-2.0", "MIT" ]
4
2021-03-08T06:56:19.000Z
2021-03-11T15:57:36.000Z
src/utils/withdraw.rs
l1h3r/scarab
7af418f39862632a8f01ba636d31572206e5485f
[ "Apache-2.0", "MIT" ]
null
null
null
src/utils/withdraw.rs
l1h3r/scarab
7af418f39862632a8f01ba636d31572206e5485f
[ "Apache-2.0", "MIT" ]
null
null
null
use wasmlib::ScAgentId; use wasmlib::ScBalances; use wasmlib::ScBaseContext; use wasmlib::ScColor; use wasmlib::ScFuncContext; use wasmlib::ScTransfers; use crate::traits::core::Array; use crate::traits::extension::ColorExt; /// Withdraw all L2 tokens of the specified `color` to the caller's L1 address. /// /// * The caller **must** be the contract creator /// * The caller **must** be an address pub fn token(ctx: &ScFuncContext, color: &ScColor) { trace!("utils::withdraw::token({}) [>]", color.name()); let creator: ScAgentId = contract_creator(ctx); let balance: i64 = ctx.balances().balance(color); let transfer: ScTransfers = ScTransfers::new(color, balance); if balance > 0 { ctx.transfer_to_address(&creator.address(), transfer); } trace!("utils::withdraw::token({}) [<]", color.name()); } /// Withdraw all L2 tokens to the caller's L1 address. /// /// * The caller **must** be the contract creator /// * The caller **must** be an address pub fn tokens(ctx: &ScFuncContext) { trace!("utils::withdraw::tokens [>]"); let creator: ScAgentId = contract_creator(ctx); let balances: ScBalances = ctx.balances(); for color in balances.colors().into_iter() { let balance: i64 = balances.balance(&color); let transfer: ScTransfers = ScTransfers::new(&color, balance); if balance > 0 { ctx.transfer_to_address(&creator.address(), transfer); } } trace!("utils::withdraw::tokens [<]"); } fn contract_creator(ctx: &ScFuncContext) -> ScAgentId { let caller: ScAgentId = ctx.caller(); let creator: ScAgentId = ctx.contract_creator(); ctx.require(creator == caller, "withdraw: unauthorized"); ctx.require(creator.is_address(), "withdraw: bad address"); creator }
28.866667
79
0.683603
f7cfaef3033d714c5decaba3bc91257d62881f01
2,689
kt
Kotlin
code/string/AhoCorasick.kt
ZeInhumane/Kotlinaughts
e45de387a43ae5784e2d82dd599c434466dcc281
[ "MIT" ]
2
2021-08-23T04:46:16.000Z
2021-09-23T23:39:18.000Z
code/string/AhoCorasick.kt
ZeInhumane/Kotlinaughts
e45de387a43ae5784e2d82dd599c434466dcc281
[ "MIT" ]
null
null
null
code/string/AhoCorasick.kt
ZeInhumane/Kotlinaughts
e45de387a43ae5784e2d82dd599c434466dcc281
[ "MIT" ]
1
2021-08-17T03:11:06.000Z
2021-08-17T03:11:06.000Z
import java.util.* /** * Add all the words you need with the add function * then call build failures once you're done setting up the dictionary * * You'll likely need to mess with countMatches to make it do exactly what you need for your current problem */ private class AhoCorasick(n: Int) { val trie = Array(n) { IntArray(26) { -1 } } val wordId = IntArray(n) { -1 } var numNodes = 1 val wordToNode = mutableListOf<Int>() val wordCount = mutableListOf<Int>() val completedWords = Array(n) { TreeSet<Int>() } val fail = IntArray(n) { -1 } fun addAllAndBuild(dict: List<String>) { for (s in dict) { add(s) } buildFailures() } private fun add(s: String) { var curNode = 0 var curDepth = 0 var curIdx = 0 while (curIdx != s.length) { val c = s[curIdx] - 'a' if (trie[curNode][c] == -1) { trie[curNode][c] = numNodes++ } curNode = trie[curNode][c] curDepth++ curIdx++ } if (wordId[curNode] == -1) { wordId[curNode] = wordToNode.size wordCount += 0 wordToNode += curNode completedWords[curNode].add(wordId[curNode]) } } private fun buildFailures() { val queue = ArrayDeque<Int>() for (c in 0 until 26) { if (trie[0][c] == -1) { trie[0][c] = 0 } else { fail[trie[0][c]] = 0 queue += trie[0][c] } } while (queue.isNotEmpty()) { val curState = queue.poll() for (c in 0 until 26) { if (trie[curState][c] != -1) { var failure = fail[curState] while (trie[failure][c] == -1) { failure = fail[failure] } failure = trie[failure][c] fail[trie[curState][c]] = failure //stuff completedWords[trie[curState][c]].addAll(completedWords[failure]) queue += trie[curState][c] } } } } private fun nextState(curState: Int, ch: Char): Int { val c = ch - 'a' var ret = curState while (trie[ret][c] == -1) { ret = fail[ret] } return trie[ret][c] } fun countMatches(s: String): Int { var curState = 0 var ct = 0 for (c in s) { curState = nextState(curState, c) ct += completedWords[curState].size } return ct } }
27.721649
108
0.467832
a32aeff97f9b52fd7788b0cc39901f16bb8f15c8
3,655
java
Java
GediCore/src/gedi/util/datastructure/collections/intcollections/AbstractIntCollection.java
erhard-lab/gedi
4d045235873a720f12bd7799d136c2e1fa70af83
[ "Apache-2.0" ]
17
2018-03-13T11:02:02.000Z
2021-12-31T06:30:39.000Z
GediCore/src/gedi/util/datastructure/collections/intcollections/AbstractIntCollection.java
erhard-lab/gedi
4d045235873a720f12bd7799d136c2e1fa70af83
[ "Apache-2.0" ]
67
2018-03-14T00:47:12.000Z
2022-03-16T12:03:42.000Z
GediCore/src/gedi/util/datastructure/collections/intcollections/AbstractIntCollection.java
erhard-lab/gedi
4d045235873a720f12bd7799d136c2e1fa70af83
[ "Apache-2.0" ]
7
2018-07-28T15:39:10.000Z
2021-12-04T01:32:21.000Z
/** * * Copyright 2017 Florian Erhard * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package gedi.util.datastructure.collections.intcollections; import java.util.AbstractCollection; import java.util.Arrays; public abstract class AbstractIntCollection extends AbstractCollection<Integer> implements IntCollection { @Override public abstract IntIterator iterator(); @Override public boolean contains(int o) { IntIterator it = iterator(); while (it.hasNext()) { if (o==it.nextInt()) { return true; } } return false; } @Override public int[] toIntArray() { // Estimate size of array; be prepared to see more or fewer elements int[] r = new int[size()]; IntIterator it = iterator(); for (int i = 0; i < r.length; i++) { if (! it.hasNext()) // fewer elements than expected return Arrays.copyOf(r, i); r[i] = it.nextInt(); } return it.hasNext() ? finishToArray(r, it) : r; } private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; private static int[] finishToArray(int[] r, IntIterator it) { int i = r.length; while (it.hasNext()) { int cap = r.length; if (i == cap) { int newCap = cap + (cap >> 1) + 1; // overflow-conscious code if (newCap - MAX_ARRAY_SIZE > 0) newCap = hugeCapacity(cap + 1); r = Arrays.copyOf(r, newCap); } r[i++] = it.nextInt(); } // trim if overallocated return (i == r.length) ? r : Arrays.copyOf(r, i); } private static int hugeCapacity(int minCapacity) { if (minCapacity < 0) // overflow throw new OutOfMemoryError ("Required array size too large"); return (minCapacity > MAX_ARRAY_SIZE) ? Integer.MAX_VALUE : MAX_ARRAY_SIZE; } @Override public boolean add(int e) { throw new UnsupportedOperationException(); } @Override public boolean remove(int o) { throw new UnsupportedOperationException(); } @Override public boolean add(Integer e) { return add(e.intValue()); } @Override public boolean remove(Object e) { if (e instanceof Integer) return remove(((Integer) e).intValue()); return false; } @Override public boolean contains(Object e) { if (e instanceof Integer) return contains(((Integer) e).intValue()); return false; } @Override public boolean containsAll(IntCollection c) { IntIterator it = c.iterator(); while (it.hasNext()) { if (!contains(it.nextInt())) return false; } return true; } @Override public boolean addAll(IntCollection c) { boolean modified = false; IntIterator it = c.iterator(); while(it.hasNext()) if (add(it.nextInt())) modified = true; return modified; } @Override public boolean removeAll(IntCollection c) { boolean modified = false; IntIterator it = iterator(); while (it.hasNext()) { if (c.contains(it.nextInt())) { it.remove(); modified = true; } } return modified; } @Override public boolean retainAll(IntCollection c) { boolean modified = false; IntIterator it = iterator(); while (it.hasNext()) { if (!c.contains(it.nextInt())) { it.remove(); modified = true; } } return modified; } }
23.132911
106
0.665116
7ad57f3a51e88af4fb7de9d32129b57b930db4d3
9,499
cs
C#
EN-us/examples/NPC.mwherman2000.NeoExpenses1/NPC.mwherman2000.NeoExpenses1.TestEncryption/Form1.Designer.cs
mwherman2000/neo-dotnetquickstart
25653c7bed2967eef66c9f597443868b19f1e818
[ "MIT" ]
12
2018-02-24T18:25:33.000Z
2021-03-19T20:36:35.000Z
EN-us/examples/NPC.mwherman2000.NeoExpenses1/NPC.mwherman2000.NeoExpenses1.TestEncryption/Form1.Designer.cs
mwherman2000/neo-dotnetquickstart
25653c7bed2967eef66c9f597443868b19f1e818
[ "MIT" ]
1
2018-02-28T12:28:33.000Z
2018-02-28T12:28:33.000Z
EN-us/examples/NPC.mwherman2000.NeoExpenses1/NPC.mwherman2000.NeoExpenses1.TestEncryption/Form1.Designer.cs
mwherman2000/neo-dotnetquickstart
25653c7bed2967eef66c9f597443868b19f1e818
[ "MIT" ]
13
2018-02-23T22:52:15.000Z
2021-08-18T05:28:28.000Z
namespace NPC.mwherman2000.NeoExpenses1.TestEncryption { partial class Form1 { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.buttonEncryptFile = new System.Windows.Forms.Button(); this.buttonDecryptFile = new System.Windows.Forms.Button(); this.buttonCreateAsmKeys = new System.Windows.Forms.Button(); this.buttonExportPublicKey = new System.Windows.Forms.Button(); this.buttonImportPublicKey = new System.Windows.Forms.Button(); this.buttonGetPrivateKey = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.openFileDialog2 = new System.Windows.Forms.OpenFileDialog(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.checkBoxExportPrivateKey = new System.Windows.Forms.CheckBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.SuspendLayout(); // // buttonEncryptFile // this.buttonEncryptFile.Location = new System.Drawing.Point(21, 116); this.buttonEncryptFile.Name = "buttonEncryptFile"; this.buttonEncryptFile.Size = new System.Drawing.Size(146, 37); this.buttonEncryptFile.TabIndex = 0; this.buttonEncryptFile.Text = "Encrypt File"; this.buttonEncryptFile.UseVisualStyleBackColor = true; this.buttonEncryptFile.Click += new System.EventHandler(this.buttonEncryptFile_Click); // // buttonDecryptFile // this.buttonDecryptFile.Location = new System.Drawing.Point(30, 111); this.buttonDecryptFile.Name = "buttonDecryptFile"; this.buttonDecryptFile.Size = new System.Drawing.Size(146, 42); this.buttonDecryptFile.TabIndex = 1; this.buttonDecryptFile.Text = "Decrypt File"; this.buttonDecryptFile.UseVisualStyleBackColor = true; this.buttonDecryptFile.Click += new System.EventHandler(this.buttonDecryptFile_Click); // // buttonCreateAsmKeys // this.buttonCreateAsmKeys.Location = new System.Drawing.Point(21, 30); this.buttonCreateAsmKeys.Name = "buttonCreateAsmKeys"; this.buttonCreateAsmKeys.Size = new System.Drawing.Size(146, 37); this.buttonCreateAsmKeys.TabIndex = 2; this.buttonCreateAsmKeys.Text = "Create Asm Keys"; this.buttonCreateAsmKeys.UseVisualStyleBackColor = true; this.buttonCreateAsmKeys.Click += new System.EventHandler(this.buttonCreateAsmKeys_Click); // // buttonExportPublicKey // this.buttonExportPublicKey.Location = new System.Drawing.Point(21, 73); this.buttonExportPublicKey.Name = "buttonExportPublicKey"; this.buttonExportPublicKey.Size = new System.Drawing.Size(146, 37); this.buttonExportPublicKey.TabIndex = 3; this.buttonExportPublicKey.Text = "Export Public Key"; this.buttonExportPublicKey.UseVisualStyleBackColor = true; this.buttonExportPublicKey.Click += new System.EventHandler(this.buttonExportPublicKey_Click); // // buttonImportPublicKey // this.buttonImportPublicKey.Location = new System.Drawing.Point(211, 116); this.buttonImportPublicKey.Name = "buttonImportPublicKey"; this.buttonImportPublicKey.Size = new System.Drawing.Size(146, 37); this.buttonImportPublicKey.TabIndex = 4; this.buttonImportPublicKey.Text = "Import Public Keys"; this.buttonImportPublicKey.UseVisualStyleBackColor = true; this.buttonImportPublicKey.Click += new System.EventHandler(this.buttonImportPublicKey_Click); // // buttonGetPrivateKey // this.buttonGetPrivateKey.Location = new System.Drawing.Point(399, 116); this.buttonGetPrivateKey.Name = "buttonGetPrivateKey"; this.buttonGetPrivateKey.Size = new System.Drawing.Size(146, 37); this.buttonGetPrivateKey.TabIndex = 5; this.buttonGetPrivateKey.Text = "Get Private Key"; this.buttonGetPrivateKey.UseVisualStyleBackColor = true; this.buttonGetPrivateKey.Click += new System.EventHandler(this.buttonGetPrivateKey_Click); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(208, 40); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(18, 17); this.label1.TabIndex = 6; this.label1.Text = "--"; // // openFileDialog1 // this.openFileDialog1.FileName = "openFileDialog1"; // // openFileDialog2 // this.openFileDialog2.FileName = "openFileDialog2"; // // groupBox1 // this.groupBox1.Controls.Add(this.checkBoxExportPrivateKey); this.groupBox1.Controls.Add(this.buttonExportPublicKey); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.buttonCreateAsmKeys); this.groupBox1.Controls.Add(this.buttonGetPrivateKey); this.groupBox1.Controls.Add(this.buttonEncryptFile); this.groupBox1.Controls.Add(this.buttonImportPublicKey); this.groupBox1.Location = new System.Drawing.Point(12, 12); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(566, 177); this.groupBox1.TabIndex = 7; this.groupBox1.TabStop = false; this.groupBox1.Text = "Current Key Management"; // // checkBoxExportPrivateKey // this.checkBoxExportPrivateKey.AutoSize = true; this.checkBoxExportPrivateKey.Checked = true; this.checkBoxExportPrivateKey.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBoxExportPrivateKey.Location = new System.Drawing.Point(211, 82); this.checkBoxExportPrivateKey.Name = "checkBoxExportPrivateKey"; this.checkBoxExportPrivateKey.Size = new System.Drawing.Size(146, 21); this.checkBoxExportPrivateKey.TabIndex = 7; this.checkBoxExportPrivateKey.Text = "Export Private Key"; this.checkBoxExportPrivateKey.UseVisualStyleBackColor = true; // // groupBox2 // this.groupBox2.Controls.Add(this.buttonDecryptFile); this.groupBox2.Location = new System.Drawing.Point(598, 12); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(198, 177); this.groupBox2.TabIndex = 8; this.groupBox2.TabStop = false; this.groupBox2.Text = "Decrypt with Current Key"; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(808, 204); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.Name = "Form1"; this.Text = "NeoExpenses Demo App"; this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); this.ResumeLayout(false); } #endregion private System.Windows.Forms.Button buttonEncryptFile; private System.Windows.Forms.Button buttonDecryptFile; private System.Windows.Forms.Button buttonCreateAsmKeys; private System.Windows.Forms.Button buttonExportPublicKey; private System.Windows.Forms.Button buttonImportPublicKey; private System.Windows.Forms.Button buttonGetPrivateKey; private System.Windows.Forms.Label label1; private System.Windows.Forms.OpenFileDialog openFileDialog1; private System.Windows.Forms.OpenFileDialog openFileDialog2; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.CheckBox checkBoxExportPrivateKey; } }
48.712821
107
0.624908
f20b868e48bb8f137149fb5738f649cd3fc27c95
1,991
cpp
C++
main.cpp
GabriellaXue/Cashier-Line-Sim
ae0984e02db0df40aa7d0effcad45e1039712614
[ "MIT" ]
1
2021-04-14T10:06:50.000Z
2021-04-14T10:06:50.000Z
main.cpp
GabriellaXue/Cashier-Line-Sim
ae0984e02db0df40aa7d0effcad45e1039712614
[ "MIT" ]
1
2021-04-13T15:59:43.000Z
2021-04-13T15:59:43.000Z
main.cpp
GabriellaXue/Cashier-Line-Sim
ae0984e02db0df40aa7d0effcad45e1039712614
[ "MIT" ]
null
null
null
#include <iostream> using std::cout; using std::endl; #include <fstream> using std::ifstream; #include <string> using std::string; #include <vector> using std::vector; #include <tuple> using std::tuple; #include <sstream> using std::stringstream; #include <queue> using std::queue; #include "simulation.h" int main() { const int inputLen = 3; // each customer should have three input vars const int MAX_LEN = 256; int numRegister; // number of registers queue< tuple<string, int, int> > customerList; // all the customers in the input file string delimiter = " "; char line[MAX_LEN - 1]; // hold line read from input temporarily while(std::cin.getline(line, MAX_LEN)) { string tmp(line); if (tmp.length() == 1) { stringstream convertNum(tmp); convertNum >> numRegister; } else { size_t pos = 0; string token; vector<string> splittedVal; while((pos = tmp.find(delimiter)) != string::npos) { token = tmp.substr(0, pos); splittedVal.push_back(token); tmp.erase(0, pos + delimiter.length()); } splittedVal.push_back(tmp); if (splittedVal.size() != inputLen) { cout << "please check input format, [{customer type}, {timestamp}, {item number}]" << endl; return 1; } int second; int third; stringstream convertNum(splittedVal[1]); convertNum >> second; stringstream convertNum2(splittedVal[2]); convertNum2 >> third; tuple<string, int, int> newTuple = make_tuple(splittedVal[0], second, third); customerList.push(newTuple); } } Simulation newSim(numRegister, customerList); int holdVal = newSim.simulate(); return 0; }
29.279412
107
0.551482
7b3c43cd673172eed6f7fca51a7d0b6276944cca
314
rb
Ruby
app/models/command.rb
craymaru/keypon
a3c0c1794d2fbe3cf2482a1357432ea3b21e95ad
[ "MIT" ]
1
2021-05-02T15:55:48.000Z
2021-05-02T15:55:48.000Z
app/models/command.rb
craymaru/keypon
a3c0c1794d2fbe3cf2482a1357432ea3b21e95ad
[ "MIT" ]
56
2020-03-02T10:17:52.000Z
2022-02-27T00:14:40.000Z
app/models/command.rb
craymaru/keypon
a3c0c1794d2fbe3cf2482a1357432ea3b21e95ad
[ "MIT" ]
null
null
null
class Command < ApplicationRecord # ASSOCIATIONS belongs_to :keymap has_many :keybindings, dependent: :destroy # VALIDATES validates :keymap_id, presence: true validates :category_name, length: { maximum: 128 } validates :name, length: { maximum: 64 } validates :when, length: { maximum: 64 } end
26.166667
52
0.726115
88a27472aa19658507e411b30922eb41cc876599
4,012
rs
Rust
examples/custom_schema/src/error.rs
Plato-solutions/okapi
4721bea83b7c17f795db879657592fd3f850016e
[ "MIT" ]
273
2019-08-27T22:01:33.000Z
2022-03-16T07:34:05.000Z
examples/custom_schema/src/error.rs
Plato-solutions/okapi
4721bea83b7c17f795db879657592fd3f850016e
[ "MIT" ]
77
2019-09-05T23:40:10.000Z
2022-03-25T15:13:43.000Z
examples/custom_schema/src/error.rs
Plato-solutions/okapi
4721bea83b7c17f795db879657592fd3f850016e
[ "MIT" ]
43
2019-12-02T21:11:04.000Z
2022-03-31T11:16:55.000Z
use rocket::{ http::{ContentType, Status}, request::Request, response::{self, Responder, Response}, }; use rocket_okapi::okapi::openapi3::Responses; use rocket_okapi::okapi::schemars::{self, Map}; use rocket_okapi::{gen::OpenApiGenerator, response::OpenApiResponderInner, OpenApiError}; /// Error messages returned to user #[derive(Debug, serde::Serialize, schemars::JsonSchema)] pub struct Error { /// The title of the error message pub err: String, /// The description of the error pub msg: Option<String>, // HTTP Status Code returned #[serde(skip)] pub http_status_code: u16, } impl OpenApiResponderInner for Error { fn responses(_generator: &mut OpenApiGenerator) -> Result<Responses, OpenApiError> { use rocket_okapi::okapi::openapi3::{RefOr, Response as OpenApiReponse}; let mut responses = Map::new(); responses.insert( "400".to_string(), RefOr::Object(OpenApiReponse { description: "\ # [400 Bad Request](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400)\n\ The request given is wrongly formatted or data asked could not be fulfilled. \ " .to_string(), ..Default::default() }), ); responses.insert( "404".to_string(), RefOr::Object(OpenApiReponse { description: "\ # [404 Not Found](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404)\n\ This response is given when you request a page that does not exists.\ " .to_string(), ..Default::default() }), ); responses.insert( "422".to_string(), RefOr::Object(OpenApiReponse { description: "\ # [422 Unprocessable Entity](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422)\n\ This response is given when you request body is not correctly formatted. \ ".to_string(), ..Default::default() }), ); responses.insert( "500".to_string(), RefOr::Object(OpenApiReponse { description: "\ # [500 Internal Server Error](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500)\n\ This response is given when something wend wrong on the server. \ ".to_string(), ..Default::default() }), ); Ok(Responses { responses, ..Default::default() }) } } impl std::fmt::Display for Error { fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!( formatter, "Error `{}`: {}", self.err, self.msg.as_deref().unwrap_or("<no message>") ) } } impl std::error::Error for Error {} impl<'r> Responder<'r, 'static> for Error { fn respond_to(self, _: &'r Request<'_>) -> response::Result<'static> { // Convert object to json let body = serde_json::to_string(&self).unwrap(); Response::build() .sized_body(body.len(), std::io::Cursor::new(body)) .header(ContentType::JSON) .status(Status::new(self.http_status_code)) .ok() } } impl From<rocket::serde::json::Error<'_>> for Error { fn from(err: rocket::serde::json::Error) -> Self { use rocket::serde::json::Error::*; match err { Io(io_error) => Error { err: "IO Error".to_owned(), msg: Some(io_error.to_string()), http_status_code: 422, }, Parse(_raw_data, parse_error) => Error { err: "Parse Error".to_owned(), msg: Some(parse_error.to_string()), http_status_code: 422, }, } } }
34
110
0.536889
bb838714e702b011ace15823197f7298e5e61bed
3,174
cs
C#
flex-js-sample/Controllers/HomeController.cs
jasonycw/cybersource-flex-samples-dotnet
81dda33546c8241debab831803a3ac4f793bab37
[ "MIT" ]
4
2020-06-05T18:23:23.000Z
2021-02-13T19:39:43.000Z
flex-js-sample/Controllers/HomeController.cs
jasonycw/cybersource-flex-samples-dotnet
81dda33546c8241debab831803a3ac4f793bab37
[ "MIT" ]
5
2019-06-03T21:54:08.000Z
2020-06-25T17:40:54.000Z
flex-js-sample/Controllers/HomeController.cs
jasonycw/cybersource-flex-samples-dotnet
81dda33546c8241debab831803a3ac4f793bab37
[ "MIT" ]
6
2020-05-01T08:20:35.000Z
2021-08-25T09:23:31.000Z
using CyberSource.Api; using CyberSource.Model; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Web.Mvc; namespace flex_js_sample.Controllers { public class HomeController : Controller { public ActionResult Checkout() { // Call the .NET CyberSource SDK to generate the Flex Key ViewBag.Jwk = "{\"kid\":\"HKJHKJ\"}"; var requestObj = new GeneratePublicKeyRequest("RsaOaep256", "http://localhost:53490"); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new KeyGenerationApi(clientConfig); var result = apiInstance.GeneratePublicKey(requestObj); Console.WriteLine(result); Console.WriteLine(result.Jwk.ToString()); Console.WriteLine(result.Jwk.ToJson().ToString()); ViewBag.Jwk = result.Jwk.ToJson().Replace("\r\n", "").Replace(@"\", ""); } catch (Exception e) { Console.WriteLine("Exception on calling the API: " + e.Message); } return View(); } public ActionResult Receipt() { dynamic flexObj = JValue.Parse(Request.Params["flexresponse"]); ViewBag.Token = flexObj.token; ViewBag.MaskedPan = flexObj.maskedPan; ViewBag.Signature = flexObj.signature; return View(); } } public class Configuration { // initialize dictionary object private readonly Dictionary<string, string> _configurationDictionary = new Dictionary<string, string>(); public Dictionary<string, string> GetConfiguration() { _configurationDictionary.Add("authenticationType", "HTTP_SIGNATURE"); _configurationDictionary.Add("merchantID", "testrest"); _configurationDictionary.Add("merchantsecretKey", "yBJxy6LjM2TmcPGu+GaJrHtkke25fPpUX+UY6/L/1tE="); _configurationDictionary.Add("merchantKeyId", "08c94330-f618-42a3-b09d-e1e43be5efda"); _configurationDictionary.Add("keysDirectory", "Resource"); _configurationDictionary.Add("keyFilename", "testrest"); _configurationDictionary.Add("runEnvironment", "cybersource.environment.sandbox"); _configurationDictionary.Add("keyAlias", "testrest"); _configurationDictionary.Add("keyPass", "testrest"); _configurationDictionary.Add("enableLog", "FALSE"); _configurationDictionary.Add("logDirectory", string.Empty); _configurationDictionary.Add("logFileName", string.Empty); _configurationDictionary.Add("logFileMaxSize", "5242880"); _configurationDictionary.Add("timeout", "1000"); _configurationDictionary.Add("proxyAddress", string.Empty); _configurationDictionary.Add("proxyPort", string.Empty); return _configurationDictionary; } } }
37.785714
112
0.628859
23c2eab5fbc269f46dc54cf94493461b8a546ac0
576
js
JavaScript
Medical/healthraise-io/client/src/navigation/MainRouter.js
ConsenSys/Labs-Test
0866f3451fe06b8423fa6beb4c06d2196bf0de96
[ "MIT" ]
17
2019-06-24T17:43:14.000Z
2021-12-27T22:11:06.000Z
Medical/healthraise-io/client/src/navigation/MainRouter.js
ConsenSys/Labs-Test
0866f3451fe06b8423fa6beb4c06d2196bf0de96
[ "MIT" ]
28
2019-06-17T20:55:38.000Z
2022-02-18T05:19:05.000Z
Medical/healthraise-io/client/src/navigation/MainRouter.js
ConsenSys/Labs-Test
0866f3451fe06b8423fa6beb4c06d2196bf0de96
[ "MIT" ]
36
2019-06-20T20:14:43.000Z
2020-03-23T15:15:25.000Z
import React, { useState, useEffect } from 'react'; import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import '../App.css'; import { Home, Profile, Settings, Individuals } from '../screens'; export default function MainRouter() { return ( <Router> <div className="container"> <Route path="/" exact component={Home} /> <Route path="/u/:user" component={Profile} /> <Route path="/settings" component={Settings} /> <Route path="/individuals" component={Individuals} /> </div> </Router> ); }
24
72
0.614583
690e2bf990af0242d3d39242e1cc0a827562390a
783
rb
Ruby
app/serializers/word_serializer.rb
sylwiavargas/The-Code-Bending-Dictionary
0c10087c3972b9dea8f99c0ca8e02b80bcf41c82
[ "PostgreSQL", "Ruby", "Unlicense" ]
21
2020-09-26T16:53:24.000Z
2021-12-09T03:53:03.000Z
app/serializers/word_serializer.rb
sylwiavargas/The-Code-Bending-Dictionary
0c10087c3972b9dea8f99c0ca8e02b80bcf41c82
[ "PostgreSQL", "Ruby", "Unlicense" ]
37
2020-09-26T12:31:56.000Z
2020-12-06T05:17:05.000Z
app/serializers/word_serializer.rb
sylwiavargas/The-Code-Bending-Dictionary
0c10087c3972b9dea8f99c0ca8e02b80bcf41c82
[ "PostgreSQL", "Ruby", "Unlicense" ]
12
2020-09-26T15:00:23.000Z
2020-11-25T19:26:18.000Z
# frozen_string_literal: true class WordSerializer < ActiveModel::Serializer attributes :id, :content, :definitions, #:relatedWords # , :technologies # this one is there for the future when we introduce "see related words" # def relatedWords # return if object.related_words.empty? # object.related_words # end def definitions return if object.definitions.okayed.empty? object.definitions.okayed.map do |defi| { content: defi.content, votes: defi.votes_total_value, technology: defi.technology.name } end end # leaving approved out for now end
31.32
85
0.550447
332d33e36bb4b3a24405060101bf5291c1ac325f
120
sql
SQL
src/test/resources/fts1o.test_19.sql
jdkoren/sqlite-parser
9adf75ff5eca36f6e541594d2e062349f9ced654
[ "MIT" ]
131
2015-03-31T18:59:14.000Z
2022-03-09T09:51:06.000Z
src/test/resources/fts1o.test_19.sql
jdkoren/sqlite-parser
9adf75ff5eca36f6e541594d2e062349f9ced654
[ "MIT" ]
20
2015-03-31T21:35:38.000Z
2018-07-02T16:15:51.000Z
src/test/resources/fts1o.test_19.sql
jdkoren/sqlite-parser
9adf75ff5eca36f6e541594d2e062349f9ced654
[ "MIT" ]
43
2015-04-28T02:01:55.000Z
2021-06-06T09:33:38.000Z
-- fts1o.test -- -- execsql { SELECT a, b, c FROM t1 WHERE c MATCH 'two'; } SELECT a, b, c FROM t1 WHERE c MATCH 'two';
30
58
0.616667
4355fd65865f5b5ff19834be794722fd966589ec
3,024
tsx
TypeScript
example/tuya-panel-kit/src/pages/navigation/tab-bar/index.tsx
sunny-ali/tuya-panel-kit
52d82c6a878b37be0c18ea92b1bb036a640fbf18
[ "MIT" ]
60
2020-11-23T10:44:42.000Z
2022-03-04T18:43:02.000Z
example/tuya-panel-kit/src/pages/navigation/tab-bar/index.tsx
sunny-ali/tuya-panel-kit
52d82c6a878b37be0c18ea92b1bb036a640fbf18
[ "MIT" ]
130
2020-11-23T12:13:43.000Z
2022-03-16T08:00:36.000Z
example/tuya-panel-kit/src/pages/navigation/tab-bar/index.tsx
sunny-ali/tuya-panel-kit
52d82c6a878b37be0c18ea92b1bb036a640fbf18
[ "MIT" ]
30
2020-12-24T06:51:20.000Z
2022-03-17T11:30:19.000Z
import React from 'react'; import { TabBar, Utils } from 'tuya-panel-kit'; import { ListView } from '#components'; import Strings from '#i18n'; const { convertX: cx } = Utils.RatioUtils; export default () => { const [tab, setTab] = React.useState('2'); const tabs = Array.from(Array(10), (v, k) => k + 1).map(v => { return { key: `${v}`, title: `Tab${v}` }; }); const [tabRadio, setTabRadio] = React.useState('2'); const tabRadios = Array.from(Array(3), (v, k) => k + 1).map(v => { return { key: `${v}`, title: `Tab${v}`, tabStyle: { alignItems: 'center', justifyContent: 'center' }, textStyle: { fontSize: 16, color: '#333333' }, activeTextStyle: { color: '#F84803', }, }; }); const [tabRadioCircle, setTabRadioCircle] = React.useState('2'); const tabRadiosCircle = Array.from(Array(3), (v, k) => k + 1).map(v => { return { key: `${v}`, title: `Tab${v}`, textStyle: { fontSize: 16 }, activeTextStyle: { color: '#F84803', }, circleStyle: { backgroundColor: '#F84803', }, }; }); return ( <ListView style={{ backgroundColor: '#F5F5F6' }} contentPadding={false} dot={false} list={[ { title: Strings.getLang('tabbar_basic'), contentStyle: { padding: 0, }, content: ( <TabBar tabs={tabs} activeKey={tab} onChange={value => setTab(value)} underlineStyle={{ width: 20, backgroundColor: '#F84803' }} tabActiveTextStyle={{ color: '#F84803', }} tabTextStyle={{ color: 'rgba(41, 50, 61, 0.4)' }} /> ), }, { title: Strings.getLang('tabbar_radio'), contentStyle: { paddingHorizontal: cx(16), }, content: ( <TabBar type="radio" tabs={tabRadios} activeKey={tabRadio} onChange={value => setTabRadio(value)} style={{ marginTop: 10, height: cx(42), borderRadius: cx(21), backgroundColor: '#E5E5E5', }} tabActiveTextStyle={{ color: '#F84803', }} /> ), }, { title: Strings.getLang('tabbar_radioCircle'), contentStyle: { paddingHorizontal: cx(16), }, content: ( <TabBar type="radioCircle" tabs={tabRadiosCircle} activeKey={tabRadioCircle} onChange={value => setTabRadioCircle(value)} style={{ marginTop: 10, height: cx(42), borderRadius: cx(21), backgroundColor: '#E5E5E5', }} /> ), }, ]} /> ); };
26.761062
74
0.450397
6226b6ff9a9521a191433c04909a5ac2457a8206
1,425
py
Python
data_access/qso_data.py
yishayv/lyacorr
deed114b4cadd4971caec68e2838a5fac39827b1
[ "MIT" ]
2
2017-03-21T14:18:35.000Z
2020-03-30T20:51:33.000Z
data_access/qso_data.py
yishayv/lyacorr
deed114b4cadd4971caec68e2838a5fac39827b1
[ "MIT" ]
null
null
null
data_access/qso_data.py
yishayv/lyacorr
deed114b4cadd4971caec68e2838a5fac39827b1
[ "MIT" ]
null
null
null
""" Helper classes for encapsulating QSO metadata and spectrum data. """ import astropy.table as table class QSORecord: def __init__(self, index, spec_obj_id, z, ra, dec, plate, mjd, fiber_id, extinction_g): self.index = index self.specObjID = spec_obj_id self.z = z self.ra = ra self.dec = dec self.plate = plate self.mjd = mjd self.fiberID = fiber_id self.extinction_g = extinction_g @classmethod def from_row(cls, qso_row): assert isinstance(qso_row, table.Row) return cls(qso_row['index'], qso_row['specObjID'], qso_row['z'], qso_row['ra'], qso_row['dec'], qso_row['plate'], qso_row['mjd'], qso_row['fiberID'], qso_row['extinction_g']) def __str__(self): return " ".join([str(self.index), str(self.specObjID), str(self.z), str(self.ra), str(self.dec), str(self.plate), str(self.mjd), str(self.fiberID)]) class QSOData: def __init__(self, qso_rec, ar_wavelength, ar_flux, ar_ivar): """ :type qso_rec: QSORecord :type ar_wavelength: np.multiarray.ndarray :type ar_flux: np.multiarray.ndarray :type ar_ivar: np.multiarray.ndarray """ self.qso_rec = qso_rec self.ar_wavelength = ar_wavelength self.ar_flux = ar_flux self.ar_ivar = ar_ivar
30.978261
104
0.596491
b311ea96ee1dc93b477e74249819ddcc783fae2b
2,683
py
Python
tests/plugins/__init__.py
kyldery/streamlink
ef36240408c194a543557fb31e4535b0426ec153
[ "BSD-2-Clause" ]
1
2022-02-25T20:14:03.000Z
2022-02-25T20:14:03.000Z
tests/plugins/__init__.py
kyldery/streamlink
ef36240408c194a543557fb31e4535b0426ec153
[ "BSD-2-Clause" ]
1
2018-07-12T18:18:05.000Z
2018-07-12T18:18:05.000Z
tests/plugins/__init__.py
kyldery/streamlink
ef36240408c194a543557fb31e4535b0426ec153
[ "BSD-2-Clause" ]
12
2022-01-30T23:34:18.000Z
2022-03-26T17:09:43.000Z
from streamlink.plugin import Plugin generic_negative_matches = [ "http://example.com/", "https://example.com/", "https://example.com/index.html", ] class PluginCanHandleUrl: __plugin__ = None # A list of URLs that should match any of the plugin's URL regexes. # ["https://foo", "https://bar"] should_match = [] # A list of URL+capturegroup tuples, where capturegroup can be a dict (re.Match.groupdict()) or a tuple (re.Match.groups()). # URLs defined in this list automatically get appended to the should_match list. # Values in capturegroup dictionaries that are None get ignored when comparing and can be omitted in the test fixtures. # [("https://foo", {"foo": "foo"}), ("https://bar", ("bar", None))] should_match_groups = [] # A list of URLs that should not match any of the plugin's URL regexes. # ["https://foo", "https://bar"] should_not_match = [] def test_class_setup(self): assert issubclass(self.__plugin__, Plugin), "Test has a __plugin__ that is a subclass of streamlink.plugin.Plugin" assert len(self.should_match + self.should_match_groups) > 0, "Test has at least one positive URL" def test_matchers(self): should_match = self.should_match + [url for url, groups in self.should_match_groups] assert all( any( matcher.pattern.match(url) for url in should_match ) for matcher in self.__plugin__.matchers ), "All plugin matchers should match" # parametrized dynamically via conftest.py def test_can_handle_url_positive(self, url): assert any( # pragma: no branch matcher.pattern.match(url) for matcher in self.__plugin__.matchers ), "URL matches" # parametrized dynamically via conftest.py def test_can_handle_url_negative(self, url): assert not any( # pragma: no branch matcher.pattern.match(url) for matcher in self.__plugin__.matchers ), "URL does not match" # parametrized dynamically via conftest.py def test_capture_groups(self, url, groups): for matcher in self.__plugin__.matchers: match = matcher.pattern.match(url) if match: # pragma: no branch res = ( # ignore None values in capture group dicts {k: v for k, v in match.groupdict().items() if v is not None} if type(groups) is dict else # capture group tuples match.groups() ) assert res == groups, "URL capture groups match"
38.884058
128
0.620201
a343ee027e1248338d7e8ae0f58b12f2ccf789fa
460
c
C
libsrc/poly1305aes-20050218/poly1305aes_macos_authenticate.c
iotcoop/pfff
c8d7bbb271320c6a5088b3d5ca810a172555884d
[ "BSD-3-Clause" ]
22
2015-03-21T21:23:47.000Z
2019-06-05T22:40:52.000Z
libsrc/poly1305aes-20050218/poly1305aes_macos_authenticate.c
iotcoop/pfff
c8d7bbb271320c6a5088b3d5ca810a172555884d
[ "BSD-3-Clause" ]
3
2015-07-20T09:28:23.000Z
2015-07-20T09:31:51.000Z
libsrc/poly1305aes-20050218/poly1305aes_macos_authenticate.c
iotcoop/pfff
c8d7bbb271320c6a5088b3d5ca810a172555884d
[ "BSD-3-Clause" ]
6
2015-03-21T21:23:48.000Z
2021-07-19T19:17:40.000Z
/* poly1305aes_macos_authenticate.c version 20050207 D. J. Bernstein Public domain. */ #include "poly1305aes_macos.h" #include "poly1305_macos.h" #include "aes_macos.h" void poly1305aes_macos_authenticate(unsigned char out[16], const unsigned char kr[32], #define k (kr + 0) #define r (kr + 16) const unsigned char n[16], const unsigned char m[],unsigned int l) { unsigned char aeskn[16]; aes_macos(aeskn,k,n); poly1305_macos(out,r,aeskn,m,l); }
20.909091
58
0.730435
a37ad64246592cf74ade0ba1f32c46363efc70d7
2,340
java
Java
java/example_code/ec2/src/main/java/aws/example/ec2/DescribeRegionsAndZones.java
onehitcombo/aws-doc-sdk-examples
03e2e0c5dee75c5decbbb99e849c51417521fd82
[ "Apache-2.0" ]
3
2021-01-19T20:23:17.000Z
2021-01-19T21:38:59.000Z
java/example_code/ec2/src/main/java/aws/example/ec2/DescribeRegionsAndZones.java
onehitcombo/aws-doc-sdk-examples
03e2e0c5dee75c5decbbb99e849c51417521fd82
[ "Apache-2.0" ]
null
null
null
java/example_code/ec2/src/main/java/aws/example/ec2/DescribeRegionsAndZones.java
onehitcombo/aws-doc-sdk-examples
03e2e0c5dee75c5decbbb99e849c51417521fd82
[ "Apache-2.0" ]
2
2019-12-27T13:58:00.000Z
2020-05-21T18:35:40.000Z
//snippet-sourcedescription:[DescribeRegionsAndZones.java demonstrates how to get a description of all regions and zones.] //snippet-keyword:[Java] //snippet-keyword:[Code Sample] //snippet-keyword:[Amazon EC2] //snippet-service:[ec2] //snippet-sourcetype:[full-example] //snippet-sourcedate:[2018-05-22] //snippet-sourceauthor:[soo-aws] /* * Copyright 2010-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" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package aws.example.ec2; import com.amazonaws.services.ec2.AmazonEC2; import com.amazonaws.services.ec2.AmazonEC2ClientBuilder; import com.amazonaws.services.ec2.model.DescribeRegionsResult; import com.amazonaws.services.ec2.model.Region; import com.amazonaws.services.ec2.model.AvailabilityZone; import com.amazonaws.services.ec2.model.DescribeAvailabilityZonesResult; /** * Describes all regions and zones */ public class DescribeRegionsAndZones { public static void main(String[] args) { final AmazonEC2 ec2 = AmazonEC2ClientBuilder.defaultClient(); DescribeRegionsResult regions_response = ec2.describeRegions(); for(Region region : regions_response.getRegions()) { System.out.printf( "Found region %s " + "with endpoint %s", region.getRegionName(), region.getEndpoint()); } DescribeAvailabilityZonesResult zones_response = ec2.describeAvailabilityZones(); for(AvailabilityZone zone : zones_response.getAvailabilityZones()) { System.out.printf( "Found availability zone %s " + "with status %s " + "in region %s", zone.getZoneName(), zone.getState(), zone.getRegionName()); } } }
36.5625
123
0.665385
a3b54aa69713fc71871a248eb64254983f602b60
2,703
java
Java
java/idea-ui/src/com/intellij/framework/library/DownloadableLibraryTypeBase.java
liveqmock/platform-tools-idea
1c4b76108add6110898a7e3f8f70b970e352d3d4
[ "Apache-2.0" ]
2
2015-05-08T15:07:10.000Z
2022-03-09T05:47:53.000Z
java/idea-ui/src/com/intellij/framework/library/DownloadableLibraryTypeBase.java
lshain-android-source/tools-idea
b37108d841684bcc2af45a2539b75dd62c4e283c
[ "Apache-2.0" ]
null
null
null
java/idea-ui/src/com/intellij/framework/library/DownloadableLibraryTypeBase.java
lshain-android-source/tools-idea
b37108d841684bcc2af45a2539b75dd62c4e283c
[ "Apache-2.0" ]
2
2017-04-24T15:48:40.000Z
2022-03-09T05:48:05.000Z
/* * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.intellij.framework.library; import com.intellij.openapi.roots.libraries.JarVersionDetectionUtil; import com.intellij.openapi.roots.libraries.LibraryUtil; import com.intellij.openapi.roots.libraries.PersistentLibraryKind; import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.net.URL; import java.util.List; public abstract class DownloadableLibraryTypeBase extends DownloadableLibraryType { private final Icon myIcon; protected DownloadableLibraryTypeBase(@NotNull String libraryCategoryName, @NotNull String libraryTypeId, @NotNull String groupId, @NotNull Icon icon, @NotNull URL... localUrls) { super(new PersistentLibraryKind<LibraryVersionProperties>(libraryTypeId) { @NotNull @Override public LibraryVersionProperties createDefaultProperties() { return new LibraryVersionProperties(); } }, libraryCategoryName, DownloadableLibraryService.getInstance().createLibraryDescription(groupId, localUrls)); myIcon = icon; } public Icon getIcon() { return myIcon; } protected abstract String[] getDetectionClassNames(); @Override public LibraryVersionProperties detect(@NotNull List<VirtualFile> classesRoots) { for (String className : getDetectionClassNames()) { final LibraryVersionProperties versionProperties = detectVersion(classesRoots, className); if (versionProperties != null) return versionProperties; } return null; } @Nullable private static LibraryVersionProperties detectVersion(List<VirtualFile> classesRoots, String detectionClass) { if (!LibraryUtil.isClassAvailableInLibrary(classesRoots, detectionClass)) { return null; } final String version = JarVersionDetectionUtil.detectJarVersion(detectionClass, classesRoots); return new LibraryVersionProperties(version); } }
37.027397
112
0.72438
7bf4ca71c0cac35c1094277049e6065f8b3ac439
7,938
lua
Lua
src/app.module.ysz.view.ccs.YszBetMenuCcsView.lua
lvqier/fishingjoy
a5569e7074664a9ca72f88d6bd0dcff9282db627
[ "Unlicense" ]
null
null
null
src/app.module.ysz.view.ccs.YszBetMenuCcsView.lua
lvqier/fishingjoy
a5569e7074664a9ca72f88d6bd0dcff9282db627
[ "Unlicense" ]
null
null
null
src/app.module.ysz.view.ccs.YszBetMenuCcsView.lua
lvqier/fishingjoy
a5569e7074664a9ca72f88d6bd0dcff9282db627
[ "Unlicense" ]
1
2022-01-18T03:26:33.000Z
2022-01-18T03:26:33.000Z
slot2 = "YszBetMenuCcsView" YszBetMenuCcsView = class(slot1) YszBetMenuCcsView.LVEL_1 = 3 YszBetMenuCcsView.LVEL_2 = 5 YszBetMenuCcsView.LVEL_3 = 8 YszBetMenuCcsView.LVEL_4 = 10 YszBetMenuCcsView.onCreationComplete = function (slot0) slot3 = slot0 slot0.init(slot2) end YszBetMenuCcsView.init = function (slot0) slot0.btnTable = { slot0.btnBet1, slot0.btnBet2, slot0.btnBet3, slot0.btnBet4 } slot0.m_lGoldCount = {} slot3 = slot0 slot0.register(slot0.btnBet4) slot3 = slot0 slot0.reset(slot0.btnBet4) end YszBetMenuCcsView.register = function (slot0) slot5 = slot0 slot0.model.lCellScoreChangedSignal.add(slot2, slot0.model.lCellScoreChangedSignal, slot0.onChangeState) slot5 = slot0 slot0.model.isShowBetMenuChangedSignal.add(slot2, slot0.model.isShowBetMenuChangedSignal, slot0.onIsShowBetMenuChanged) end YszBetMenuCcsView.onChangeJZScore = function (slot0) slot1 = 1 slot2 = slot0.model.getMyTablePlayingUserData(slot3)[1].lScore slot5 = slot0.model slot3 = slot0.model.getMyTablePlayingUserData(slot0.model)[1] ~= nil slot6 = slot0.model if slot0.model.getBMingZhu(slot5)[1] then slot1 = slot1 * 2 end slot6 = slot0.btnBet1 slot4 = slot0.btnBet1.setEnabled slot9 = slot0.model if slot0.model.getLCurrentTimes(slot8) <= YszBetMenuCcsView.LVEL_1 and slot3 then -- Decompilation error in this vicinity: slot9 = slot0.model slot7 = slot2 >= slot0.model.getLCellScore(slot8) * YszBetMenuCcsView.LVEL_1 * slot1 slot4(slot5, slot6) slot6 = slot0.btnBet2 slot4 = slot0.btnBet2.setEnabled slot9 = slot0.model if slot3 then slot9 = slot0.model slot7 = slot2 >= slot0.model.getLCellScore(slot8) * YszBetMenuCcsView.LVEL_2 * slot1 slot4(slot5, slot6) slot6 = slot0.btnBet3 slot4 = slot0.btnBet3.setEnabled slot9 = slot0.model end if slot3 then slot9 = slot0.model slot7 = slot2 >= slot0.model.getLCellScore(slot8) * YszBetMenuCcsView.LVEL_3 * slot1 slot4(slot5, slot6) slot6 = slot0.btnBet4 slot4 = slot0.btnBet4.setEnabled slot9 = slot0.model end if slot3 then slot9 = slot0.model slot7 = slot2 >= slot0.model.getLCellScore(slot8) * YszBetMenuCcsView.LVEL_4 * slot1 slot4(slot5, slot6) slot9 = slot0.btnBet1 end slot7 = (slot0.btnBet1.isEnabled(slot8) and 255) or 100 slot0.btnBet1.txt.setOpacity(slot5, slot0.btnBet1.txt) slot9 = slot0.btnBet2 slot7 = (slot0.btnBet2.isEnabled(slot8) and 255) or 100 slot0.btnBet2.txt.setOpacity(slot5, slot0.btnBet2.txt) slot9 = slot0.btnBet3 slot7 = (slot0.btnBet3.isEnabled(slot8) and 255) or 100 slot0.btnBet3.txt.setOpacity(slot5, slot0.btnBet3.txt) slot9 = slot0.btnBet4 slot7 = (slot0.btnBet4.isEnabled(slot8) and 255) or 100 slot0.btnBet4.txt.setOpacity(slot5, slot0.btnBet4.txt) return end end YszBetMenuCcsView.onBtnClick = function (slot0, slot1, slot2) if slot1 == slot0.btnBet1 then slot6 = false slot0.model.setIsShowMenu(slot4, slot0.model) slot6 = false slot0.model.setIsShowBetMenu(slot4, slot0.model) slot6 = "点击了加注1按钮" slot0.controller.sendlog(slot4, slot0.controller) slot7 = 0 slot0.controller.reqAddScore(slot4, slot0.controller, YszBetMenuCcsView.LVEL_1) elseif slot1 == slot0.btnBet2 then slot6 = false slot0.model.setIsShowBetMenu(slot4, slot0.model) slot6 = false slot0.model.setIsShowMenu(slot4, slot0.model) slot6 = "点击了加注2按钮" slot0.controller.sendlog(slot4, slot0.controller) slot7 = 0 slot0.controller.reqAddScore(slot4, slot0.controller, YszBetMenuCcsView.LVEL_2) elseif slot1 == slot0.btnBet3 then slot6 = false slot0.model.setIsShowBetMenu(slot4, slot0.model) slot6 = false slot0.model.setIsShowMenu(slot4, slot0.model) slot6 = "点击了加注3按钮" slot0.controller.sendlog(slot4, slot0.controller) slot7 = 0 slot0.controller.reqAddScore(slot4, slot0.controller, YszBetMenuCcsView.LVEL_3) elseif slot1 == slot0.btnBet4 then slot6 = false slot0.model.setIsShowBetMenu(slot4, slot0.model) slot6 = false slot0.model.setIsShowMenu(slot4, slot0.model) slot6 = "点击了加注4按钮" slot0.controller.sendlog(slot4, slot0.controller) slot7 = 0 slot0.controller.reqAddScore(slot4, slot0.controller, YszBetMenuCcsView.LVEL_4) end end YszBetMenuCcsView.addScore = function (slot0, slot1) slot5 = 0 slot0.control.reqAddScore(slot3, slot0.control) end YszBetMenuCcsView.onChangeState = function (slot0) slot1 = 1 slot4 = slot0.model if slot0.model.getBMingZhu(slot3)[1] then slot1 = slot1 * 2 end slot2 = "" slot5 = slot0.model if slot0.model.getLCellScore(slot4) * YszBetMenuCcsView.LVEL_1 * slot1 >= 10000 then slot5 = slot0.model slot2 = (slot0.model.getLCellScore(slot4) * YszBetMenuCcsView.LVEL_1) / 10000 * slot1 .. "万" else slot5 = slot0.model slot2 = slot0.model.getLCellScore(slot4) * YszBetMenuCcsView.LVEL_1 * slot1 end slot6 = slot2 slot0.btnBet1.txt.setString(slot4, slot0.btnBet1.txt) slot2 = "" slot5 = slot0.model if slot0.model.getLCellScore(slot4) * YszBetMenuCcsView.LVEL_2 * slot1 >= 10000 then slot5 = slot0.model slot2 = (slot0.model.getLCellScore(slot4) * YszBetMenuCcsView.LVEL_2) / 10000 * slot1 .. "万" else slot5 = slot0.model slot2 = slot0.model.getLCellScore(slot4) * YszBetMenuCcsView.LVEL_2 * slot1 end slot6 = slot2 slot0.btnBet2.txt.setString(slot4, slot0.btnBet2.txt) slot2 = "" slot5 = slot0.model if slot0.model.getLCellScore(slot4) * YszBetMenuCcsView.LVEL_3 * slot1 >= 10000 then slot5 = slot0.model slot2 = (slot0.model.getLCellScore(slot4) * YszBetMenuCcsView.LVEL_3) / 10000 * slot1 .. "万" else slot5 = slot0.model slot2 = slot0.model.getLCellScore(slot4) * YszBetMenuCcsView.LVEL_3 * slot1 end slot6 = slot2 slot0.btnBet3.txt.setString(slot4, slot0.btnBet3.txt) slot2 = "" slot5 = slot0.model if slot0.model.getLCellScore(slot4) * YszBetMenuCcsView.LVEL_4 * slot1 >= 10000 then slot5 = slot0.model slot2 = (slot0.model.getLCellScore(slot4) * YszBetMenuCcsView.LVEL_4) / 10000 * slot1 .. "万" else slot5 = slot0.model slot2 = slot0.model.getLCellScore(slot4) * YszBetMenuCcsView.LVEL_4 * slot1 end slot6 = slot2 slot0.btnBet4.txt.setString(slot4, slot0.btnBet4.txt) end YszBetMenuCcsView.onIsShowBetMenuChanged = function (slot0) slot3 = slot0 slot0.stopAllActions(slot2) slot3 = slot0.model if slot0.model.getIsShowBetMenu(slot2) then slot3 = slot0 slot0.onChangeState(slot2) slot3 = slot0 slot0.showBtn(slot2) else slot3 = slot0 slot0.hideBtn(slot2) end end YszBetMenuCcsView.showBtn = function (slot0) function slot4() for slot3 = 1, #slot0.btnTable, 1 do slot7 = true slot0.btnTable[slot3].setVisible(slot5, slot0.btnTable[slot3]) slot7 = true slot0.btnTable[slot3].setEnabled(slot5, slot0.btnTable[slot3]) end slot2 = slot0 slot0.onChangeJZScore(slot1) end slot5 = true slot0.setVisible(cc.CallFunc, slot0) slot4 = slot0 slot12 = 255 slot10 = nil slot0.runAction(cc.CallFunc, cc.Sequence.create(slot6, cc.Sequence, cc.FadeTo.create(slot9, cc.FadeTo, 0.1), cc.CallFunc.create(slot2, cc.CallFunc))) end YszBetMenuCcsView.hideBtn = function (slot0) for slot4 = 1, #slot0.btnTable, 1 do slot8 = false slot0.btnTable[slot4].setVisible(slot6, slot0.btnTable[slot4]) slot8 = false slot0.btnTable[slot4].setEnabled(slot6, slot0.btnTable[slot4]) end function slot4() slot3 = false slot0.setVisible(slot1, slot0) end slot4 = slot0 slot12 = 0 slot10 = nil slot0.runAction(cc.CallFunc, cc.Sequence.create(slot6, cc.Sequence, cc.FadeTo.create(slot9, cc.FadeTo, 0.1), cc.CallFunc.create(slot2, cc.CallFunc))) end YszBetMenuCcsView.reset = function (slot0) for slot4 = 1, #slot0.btnTable, 1 do slot8 = false slot0.btnTable[slot4].setEnabled(slot6, slot0.btnTable[slot4]) end slot4 = 0 slot0.setOpacity(slot2, slot0) slot4 = false slot0.setVisible(slot2, slot0) slot3 = slot0 slot0.stopAllActions(slot2) end return
22.05
150
0.738725
e2c647feafa962b123b480f32e9151056ca70a0f
1,094
py
Python
setup.py
Uberspace/nestedfacts
ee453e4cccb579e233ce813005a3597588765eb1
[ "MIT" ]
20
2016-10-06T11:38:32.000Z
2021-11-09T20:26:23.000Z
setup.py
Uberspace/nestedfacts
ee453e4cccb579e233ce813005a3597588765eb1
[ "MIT" ]
1
2019-03-13T22:47:16.000Z
2019-03-14T08:43:21.000Z
setup.py
Uberspace/nestedfacts
ee453e4cccb579e233ce813005a3597588765eb1
[ "MIT" ]
null
null
null
from setuptools import setup setup(name='nestedfacts', description='This library enables users of Ansible to load nested' 'directories as local facts. Refer to the README for' 'more details.', author='uberspace.de', author_email='hallo@uberspace.de', url='https://github.com/uberspace/nestedfacts', version='1.0.1', license='MIT', packages=['.'], zip_safe=True, install_requires=[ 'pyyaml', ], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Information Technology', 'Intended Audience :: System Administrators', 'Topic :: System :: Systems Administration', 'Topic :: Utilities', 'Natural Language :: English', 'Operating System :: POSIX :: Linux', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.5', ], )
35.290323
72
0.570384
24be0ed76e9dfb5a4b81597e8594c63689b6b911
4,686
php
PHP
routes/api.php
sakuriki/banhang
d861b89c0308c94a4c63a97a936e3ff593dbca14
[ "MIT" ]
5
2021-03-03T15:45:33.000Z
2021-11-26T08:41:22.000Z
routes/api.php
sakuriki/banhang
d861b89c0308c94a4c63a97a936e3ff593dbca14
[ "MIT" ]
null
null
null
routes/api.php
sakuriki/banhang
d861b89c0308c94a4c63a97a936e3ff593dbca14
[ "MIT" ]
11
2021-03-04T05:46:10.000Z
2022-02-09T19:23:46.000Z
<?php /* |-------------------------------------------------------------------------- | API Routes |-------------------------------------------------------------------------- | | Here is where you can register API routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | is assigned the "api" middleware group. Enjoy building your API! | */ Route::get('/export', 'Admin\OrderController@export'); Route::get('/user/{id}', 'UserController@show'); Route::get('/provinces', 'ProvinceController@index'); Route::get('/coupons/{code}', 'CouponController'); Route::get('/footer', 'FooterController'); Route::get('/settings', 'SettingController'); Route::apiResource('/tags', 'TagController')->only(["index", "show"]); Route::apiResource('brands', 'BrandController')->only(["index", "show"]); Route::apiResource('taxes', 'TaxController')->only(["index", "show"]); Route::apiResource('orders', 'OrderController'); Route::apiResource('categories', 'CategoryController')->only(["index", "show"]); Route::apiResource('ratings', 'RatingController')->only(["show"]); Route::apiResource('subscribers', 'SubscriberController')->only(["store", "destroy"]); Route::group(['prefix' => '/auth', ['middleware' => 'throttle:20,5']], function () { Route::post('/register', 'Auth\AuthController@register')->name('register'); Route::post('/login', 'Auth\AuthController@login')->name('login'); }); Route::group(['middleware' => 'jwtnew'], function () { Route::group(['prefix' => '/admin'], function () { Route::get('slides', 'Admin\SlideController@index'); Route::post('slides', 'Admin\SlideController@store'); Route::patch('slides', 'Admin\SlideController@update'); Route::delete('slides', 'Admin\SlideController@destroy'); Route::patch('settings', 'Admin\SettingController'); Route::delete('tags/bulkDestroy', 'Admin\TagController@bulkDestroy'); Route::delete('taxes/bulkDestroy', 'Admin\TaxController@bulkDestroy'); Route::delete('roles/bulkDestroy', 'Admin\RoleController@bulkDestroy'); Route::delete('users/bulkDestroy', 'Admin\UserController@bulkDestroy'); Route::delete('brands/bulkDestroy', 'Admin\BrandController@bulkDestroy'); Route::delete('orders/bulkDestroy', 'Admin\OrderController@bulkDestroy'); Route::delete('coupons/bulkDestroy', 'Admin\CouponController@bulkDestroy'); Route::delete('ratings/bulkDestroy', 'Admin\RatingController@bulkDestroy'); Route::delete('comments/bulkDestroy', 'Admin\CommentController@bulkDestroy'); Route::delete('products/bulkDestroy', 'Admin\ProductController@bulkDestroy'); Route::delete('categories/bulkDestroy', 'Admin\CategoryController@bulkDestroy'); Route::delete('permissions/bulkDestroy', 'Admin\PermissionController@bulkDestroy'); Route::delete('productImages/bulkDestroy', 'Admin\ProductImageController@bulkDestroy'); Route::apiResource('tags', 'Admin\TagController'); Route::apiResource('taxes', 'Admin\TaxController'); Route::apiResource('roles', 'Admin\RoleController'); Route::apiResource('users', 'Admin\UserController'); Route::apiResource('brands', 'Admin\BrandController'); Route::apiResource('orders', 'Admin\OrderController'); Route::apiResource('coupons', 'Admin\CouponController'); Route::apiResource('ratings', 'Admin\RatingController'); Route::apiResource('comments', 'Admin\CommentController'); Route::apiResource('products', 'Admin\ProductController'); Route::apiResource('categories', 'Admin\CategoryController'); Route::apiResource('permissions', 'Admin\PermissionController'); Route::apiResource('subscribers', 'Admin\SubscriberController'); Route::apiResource('productImages', 'Admin\ProductImageController'); Route::get('/dashboard', 'Admin\DashboardController'); }); Route::get('/auth/user', 'Auth\AuthController@user'); Route::apiResource('wishlists', 'WishlistController')->only(["index", "store", "destroy"]); Route::apiResource('addressBooks', 'AddressBookController'); }); Route::group(['middleware' => 'jwtoptinal'], function () { Route::post('/checkout', 'CheckoutController@store'); Route::get('/payment/vnpay', 'CheckoutController@test')->name('vnpay.index'); Route::get('/payment/vnpay/process', 'CheckoutController@returnVnpay')->name('vnpay.process'); // Route::get('/payment/vnpay/ipn', 'CheckoutController@test2')->name('vnpay.ipn'); Route::get('productlist', 'ProductController@showById'); Route::apiResource('products', 'ProductController')->only(["index", "show"]); Route::get('/comments/showreply/{id}', 'ProductCommentController@showreply'); Route::apiResource('comments', 'ProductCommentController'); });
57.851852
96
0.692061
f5e80b21db019ecd3f5cadfa972910bfb847a325
1,331
css
CSS
example/src/index.css
fozg/fozg-ui
048e521bd6177ea8f3f9002d3423f328ee6036b8
[ "MIT" ]
null
null
null
example/src/index.css
fozg/fozg-ui
048e521bd6177ea8f3f9002d3423f328ee6036b8
[ "MIT" ]
null
null
null
example/src/index.css
fozg/fozg-ui
048e521bd6177ea8f3f9002d3423f328ee6036b8
[ "MIT" ]
null
null
null
body { margin: 0; padding: 0; font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"; } .container { max-width: 1000px; margin: auto; } strong { font-weight: 600; } h1 { color: rgb(191, 94, 114); } h1, h2, h3, h4, h5, h6 { margin-top: 24px; margin-bottom: 16px; font-weight: 600; line-height: 1.25; color: rgb(191, 94, 114); } /* SelectGroup Demo */ .SelectGroup { padding: 5px 20px; line-height: 1; height: 44px; } .SelectGroup i { font-size: 12px; font-style: normal; line-height: 0.8; } .fozg-ui-SelectGroup-expand:nth-child(6) .SelectGroup { background-color: #5bb6ff; color: #fff; transition: 1s background-color; } .fozg-ui-SelectGroup-expand:last-of-type .SelectGroup{ background-color: #2196f3; color: #fff; transition: 1s background-color; } /* .fozg-ui-SelectGroup-expand:last-of-type.fozg-ui-SelectGroup-active .SelectGroup, .fozg-ui-SelectGroup-expand:nth-child(6).fozg-ui-SelectGroup-active .SelectGroup { background-color: transparent !important; } */ .fozg-ui-SelectGroup-expand.fozg-ui-SelectGroup-active .SelectGroup { background-color: transparent !important; } code { background-color: #eee; /* border-radius: 10px; */ display: block; }
20.166667
141
0.677686
01d9ae0da7728f4ef53c8ad6a1f6aa0ff210654d
1,106
gemspec
Ruby
gersberms.gemspec
josephglanville/gersberms
7192e0d43fedb5bb75157209fd2074d1cccd0646
[ "MIT" ]
2
2015-03-15T07:32:42.000Z
2015-03-28T05:16:11.000Z
gersberms.gemspec
josephglanville/gersberms
7192e0d43fedb5bb75157209fd2074d1cccd0646
[ "MIT" ]
null
null
null
gersberms.gemspec
josephglanville/gersberms
7192e0d43fedb5bb75157209fd2074d1cccd0646
[ "MIT" ]
null
null
null
$LOAD_PATH.push File.expand_path('../lib', __FILE__) require 'gersberms/version' Gem::Specification.new do |s| s.required_rubygems_version = Gem::Requirement.new('> 0') if s.respond_to? :required_rubygems_version= s.version = Gersberms::VERSION s.name = 'gersberms' s.summary = 'Build AMIs with Chef and Berkshelf' s.description = 'Gersberms is a simple system for building AWS EC2 AMIs using Chef and Berkshelf' s.homepage = 'http://github.com/josephglanville/gersberms' s.authors = ['Joseph Glanville'] s.email = 'jpg@jpg.id.au' s.date = '2014-08-15' s.default_executable = 'gersberms' s.license = 'MIT' s.files = `git ls-files | grep -v -E '(^test|^\.git|client.rb)'`.split s.test_files = `git ls-files | grep ^test`.split s.require_paths = ['lib'] s.executables = ['gersberms'] s.add_dependency('berkshelf', '~> 3.2') s.add_dependency('hashie', '~> 2.0') s.add_dependency('aws-sdk', '~> 1.0') s.add_dependency('net-ssh', '~> 2.9') s.add_dependency('net-scp', '~> 1.2') s.add_dependency('rake', '~> 10.4') s.add_dependency('thor', '~> 0.19') end
38.137931
104
0.664557
3771e7b2e9aaccd32be830a81182f840e37506ce
309
swift
Swift
instagator-prototype/instagator-prototype/MidwayStartViewController.swift
amcnary/cs147_instagator
853ed263f9378bfad999407ed278674bcc0f8ab1
[ "Apache-2.0" ]
null
null
null
instagator-prototype/instagator-prototype/MidwayStartViewController.swift
amcnary/cs147_instagator
853ed263f9378bfad999407ed278674bcc0f8ab1
[ "Apache-2.0" ]
null
null
null
instagator-prototype/instagator-prototype/MidwayStartViewController.swift
amcnary/cs147_instagator
853ed263f9378bfad999407ed278674bcc0f8ab1
[ "Apache-2.0" ]
null
null
null
// // MidwayStartViewController.swift // instagator-prototype // // Created by Amanda McNary on 11/16/15. // Copyright © 2015 ThePenguins. All rights reserved. // import Foundation import UIKit class MidwayStartViewController: UIViewController { @IBOutlet weak var getStartedButton: UIButton! }
20.6
54
0.747573
6b747a9ba4d27aa28effe286ed22787e180adeaf
3,390
js
JavaScript
src/controllers/user.js
xdigu/api-tickets
5b515a3b633f078899521bcd5c094ad3345d0402
[ "MIT" ]
null
null
null
src/controllers/user.js
xdigu/api-tickets
5b515a3b633f078899521bcd5c094ad3345d0402
[ "MIT" ]
1
2021-09-02T01:25:47.000Z
2021-09-02T01:25:47.000Z
src/controllers/user.js
xdigu/api-tickets
5b515a3b633f078899521bcd5c094ad3345d0402
[ "MIT" ]
1
2019-10-31T19:56:49.000Z
2019-10-31T19:56:49.000Z
const { User } = require('../models'); const responseHandler = require('../constants/responseHandler'); class UserController { async create(req, res) { const { name, email } = req.body; await User.create({ name, email }) .then(user => { const data = user; return responseHandler.success(res, { data }); }) .catch(err => { responseHandler.modelError(res, err); }); } async index(req, res) { await User.findAll() .then(users => { const data = users; return responseHandler.success(res, { data }); }) .catch(err => { responseHandler.modelError(res, err); }); } async get(req, res) { const { user_id } = req.params; if (!user_id || isNaN(user_id)) { const message = 'You must provide a user_id.'; return responseHandler.badRequest(res, { message }); } await User.findByPk(user_id, { attributes: ['id', 'name', 'email'], }) .then(user => { if (!user) { const message = 'User not found.'; return responseHandler.notFound(res, { message }); } else { const data = user; return responseHandler.success(res, { data }); } }) .catch(err => { responseHandler.modelError(res, err); }); } async put(req, res) { const { user_id } = req.params; const { name, email } = req.body; if (!user_id || isNaN(user_id)) { const message = 'You must provide a user_id.'; return responseHandler.badRequest(res, { message }); } await User.findByPk(user_id) .then(user => { if (!user) { const message = 'User not found.'; return responseHandler.notFound(res, { message }); } user.update({ name, email }) .then(user_updated => { const data = user_updated; return responseHandler.success(res, { data }); }) .catch(err => { responseHandler.modelError(res, err); }); }) .catch(err => { responseHandler.modelError(res, err); }); } async delete(req, res) { const { user_id } = req.params; if (!user_id || isNaN(user_id)) { const message = 'You must provide a user_id.'; return responseHandler.badRequest(res, { message }); } await User.findByPk(user_id) .then(user => { if (!user) { const message = 'User not found.'; return responseHandler.notFound(res, { message }); } user.destroy(); const message = 'User was deleted.'; return responseHandler.success(res, { message }); }) .catch(err => { responseHandler.modelError(res, err); }); } } module.exports = new UserController();
30.267857
70
0.449263
84772671348c1c88db63e08366f397958d4ceb76
5,327
kt
Kotlin
backend/src/apiTest/kotlin/metrik/PipelineApiTest.kt
ashishsoni123/metrik
c0b3c101a12b95396d4918bdc6e2c08fde21a99e
[ "MIT" ]
169
2021-03-27T02:52:09.000Z
2022-03-24T19:15:09.000Z
backend/src/apiTest/kotlin/metrik/PipelineApiTest.kt
ashishsoni123/metrik
c0b3c101a12b95396d4918bdc6e2c08fde21a99e
[ "MIT" ]
41
2021-03-30T09:21:02.000Z
2022-02-12T15:58:30.000Z
backend/src/apiTest/kotlin/metrik/PipelineApiTest.kt
ashishsoni123/metrik
c0b3c101a12b95396d4918bdc6e2c08fde21a99e
[ "MIT" ]
42
2021-03-27T02:52:14.000Z
2022-03-31T11:20:38.000Z
package metrik import io.restassured.RestAssured import io.restassured.http.ContentType import metrik.base.ApiTestBase import metrik.project.domain.model.PipelineConfiguration import metrik.project.domain.model.PipelineType import org.hamcrest.CoreMatchers.`is` import org.hamcrest.CoreMatchers.notNullValue import org.junit.jupiter.api.BeforeAll import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.MethodOrderer import org.junit.jupiter.api.Order import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestInstance import org.junit.jupiter.api.TestMethodOrder @TestInstance(TestInstance.Lifecycle.PER_CLASS) @TestMethodOrder(MethodOrderer.OrderAnnotation::class) internal class PipelineApiTest : ApiTestBase() { @BeforeAll fun setUpPipelineTestData() { mongoTemplate.save( PipelineConfiguration( id = "601cbb3425c1392117aa053b", projectId = "601cbae825c1392117aa0429", name = "df", username = "E9fnMY3UGE6Oms35JzLGgQ==", credential = "FVSR/5o1BYh6dJQBeQaNvQ==", url = "http://localhost:8001/job/4km-df/", type = PipelineType.JENKINS ) ) mongoTemplate.save( PipelineConfiguration( id = "601cbae825c1392117aa0429", projectId = "601cbae825c1392117aa0429", name = "cfr", username = "E9fnMY3UGE6Oms35JzLGgQ==", credential = "FVSR/5o1BYh6dJQBeQaNvQ==", url = "http://localhost:8001/job/4km-cfr/", type = PipelineType.JENKINS ) ) } @Test @Order(1) fun `should get pipeline config details with a valid ID`() { RestAssured .given() .contentType(ContentType.JSON) .get("/api/project/601cbae825c1392117aa0429/pipeline/601cbb3425c1392117aa053b") .then() .statusCode(200) .body("id", `is`("601cbb3425c1392117aa053b")) .body("name", `is`("df")) .body("username", `is`("E9fnMY3UGE6Oms35JzLGgQ==")) .body("credential", `is`("FVSR/5o1BYh6dJQBeQaNvQ==")) .body("url", `is`("http://localhost:8001/job/4km-df/")) .body("type", `is`("JENKINS")) } @Test @Order(2) fun `should throw 400 error when pipeline config type if unrecognized pipeline type received`() { val requestBody = """ { "type": "CIRCLE_CI", "url": "https://circleci.com/thoughtworks/metrik", "credential": "circleci_token" } """.trimIndent() RestAssured .given() .contentType(ContentType.JSON) .body(requestBody) .post("/api/pipeline/verify") .then() .statusCode(400) } // Right now the following test can always pass, because the config type will always fallback to the default empty implementation of PipelineService. // Once GithubActions implementation is added, these tests should be enabled immediately with necessary mocks. Consider using wiremock to stub the Github response. @Disabled @Test @Order(2) fun `should verify a Github Actions pipeline config successfully`() { val requestBody = """ { "type": "GITHUB_ACTIONS", "url": "https://github.com/thoughtworks/metrik", "credential": "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" } """.trimIndent() RestAssured .given() .contentType(ContentType.JSON) .body(requestBody) .post("/api/pipeline/verify") .then() .statusCode(200) } @Disabled @Test @Order(3) fun `should verify and save a pipeline config successfully`() { val requestBody = """ { "name": "a github actions project", "type": "GITHUB_ACTIONS", "url": "https://github.com/thoughtworks/metrik", "credential": "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" } """.trimIndent() RestAssured .given() .contentType(ContentType.JSON) .body(requestBody) .post("/api/project/601cbae825c1392117aa0429/pipeline") .then() .statusCode(201) } @Disabled @Test @Order(4) fun `should get all pipelines configured for the project with a valid project ID`() { RestAssured .given() .contentType(ContentType.JSON) .get("/api/project/601cbae825c1392117aa0429/pipelines-stages") .then() .statusCode(200) .body("[0].pipelineId", notNullValue()) .body("[0].pipelineName", `is`("a github actions project")) .body("[0].stages", notNullValue()) .body("[1].pipelineId", `is`("601cbae825c1392117aa0429")) .body("[1].pipelineName", `is`("cfr")) .body("[1].stages", notNullValue()) .body("[2].pipelineId", `is`("601cbb3425c1392117aa053b")) .body("[2].pipelineName", `is`("df")) .body("[2].stages", notNullValue()) } }
35.513333
168
0.577811
4339d676887c4a840449ad701419cec5f19995e9
2,940
ts
TypeScript
types/resources/Route53Resolver/ResolverEndpoint.ts
gabrielmoreira/typed-aws
fc6e969f7f905114ca7811b4ab96aa0fb09630c8
[ "MIT" ]
1
2022-02-12T12:28:39.000Z
2022-02-12T12:28:39.000Z
types/resources/Route53Resolver/ResolverEndpoint.ts
gabrielmoreira/typed-aws
fc6e969f7f905114ca7811b4ab96aa0fb09630c8
[ "MIT" ]
null
null
null
types/resources/Route53Resolver/ResolverEndpoint.ts
gabrielmoreira/typed-aws
fc6e969f7f905114ca7811b4ab96aa0fb09630c8
[ "MIT" ]
null
null
null
// CloudFormation Resource AWS::Route53Resolver::ResolverEndpoint import { CfnResource, Resolvable } from '../../base'; export type ResolverEndpoint_Type = 'AWS::Route53Resolver::ResolverEndpoint'; export const ResolverEndpoint_Type = 'AWS::Route53Resolver::ResolverEndpoint'; /** * Resource Type definition for AWS::Route53Resolver::ResolverEndpoint * {@link * http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53resolver-resolverendpoint.html} */ export default function ResolverEndpoint(props: ResolverEndpoint_Properties) { return new CfnResource<ResolverEndpoint_Properties>( ResolverEndpoint_Type, props ); } /** * Resource Type definition for AWS::Route53Resolver::ResolverEndpoint * {@link * http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53resolver-resolverendpoint.html} */ export type ResolverEndpoint_Properties = { /** * {@link * http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53resolver-resolverendpoint.html#cfn-route53resolver-resolverendpoint-ipaddresses} */ IpAddresses: IpAddressRequest[]; ResolverEndpointId?: Resolvable<string>; IpAddressCount?: Resolvable<string>; Arn?: Resolvable<string>; /** * {@link * http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53resolver-resolverendpoint.html#cfn-route53resolver-resolverendpoint-direction} */ Direction: Resolvable<string>; HostVPCId?: Resolvable<string>; /** * {@link * http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53resolver-resolverendpoint.html#cfn-route53resolver-resolverendpoint-securitygroupids} */ SecurityGroupIds: Resolvable<string>[]; /** * {@link * http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53resolver-resolverendpoint.html#cfn-route53resolver-resolverendpoint-tags} */ Tags?: Tag[]; /** * {@link * http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53resolver-resolverendpoint.html#cfn-route53resolver-resolverendpoint-name} */ Name?: Resolvable<string>; }; /** * {@link * http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53resolver-resolverendpoint-ipaddressrequest.html} */ export type IpAddressRequest = { /** * {@link * http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53resolver-resolverendpoint-ipaddressrequest.html#cfn-route53resolver-resolverendpoint-ipaddressrequest-ip} */ Ip?: Resolvable<string>; /** * {@link * http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53resolver-resolverendpoint-ipaddressrequest.html#cfn-route53resolver-resolverendpoint-ipaddressrequest-subnetid} */ SubnetId: Resolvable<string>; }; export type Tag = { Value: Resolvable<string>; Key: Resolvable<string>; };
37.692308
200
0.767687
04589b98ff212cfbbce1161c364cab41847f9cf7
14,240
sql
SQL
SQL/script_base_datos.sql
realvarez/ProjectDB
21b25119219c1a73007f1c654129847ed60582b0
[ "MIT" ]
null
null
null
SQL/script_base_datos.sql
realvarez/ProjectDB
21b25119219c1a73007f1c654129847ed60582b0
[ "MIT" ]
null
null
null
SQL/script_base_datos.sql
realvarez/ProjectDB
21b25119219c1a73007f1c654129847ed60582b0
[ "MIT" ]
null
null
null
/*==============================================================*/ /* Table: REGION */ /*==============================================================*/ create table REGIONS ( ID SERIAL not null, NOMBRE VARCHAR(255) not null, CREATED_AT TIMESTAMP WITHOUT TIME ZONE null, UPDATED_AT TIMESTAMP WITHOUT TIME ZONE null, primary key (ID) ); /* Index: REGION_PK */ create unique index REGIONS_PK on REGIONS (ID); /*==============================================================*/ /* Table: COMUNA */ /*==============================================================*/ create table COMUNAS ( ID SERIAL not null, REGION_ID INTEGER not null, NOMBRE VARCHAR(255) not null, CREATED_AT TIMESTAMP WITHOUT TIME ZONE null, UPDATED_AT TIMESTAMP WITHOUT TIME ZONE null, primary key (ID) ); /* Index: COMUNA_PK */ create unique index COMUNAS_PK on COMUNAS (ID); /*==============================================================*/ /* Table: CATASTROFE */ /*==============================================================*/ create table CATASTROFES ( ID SERIAL not null, USER_ID INTEGER not null, COMUNA_ID INTEGER not null, DESCRIPCION VARCHAR(255) not null, TIPO_CATASTROFE INTEGER not null, CREATED_AT TIMESTAMP WITHOUT TIME ZONE null, UPDATED_AT TIMESTAMP WITHOUT TIME ZONE null, primary key (ID) ); /* Index: CATASTROFE_PK */ create unique index CATASTROFES_PK on CATASTROFES (ID); /*==============================================================*/ /* Table: ROL */ /*==============================================================*/ create table ROLS ( ID SERIAL not null, NOMBRE VARCHAR(255) not null, CREATED_AT TIMESTAMP WITHOUT TIME ZONE null, UPDATED_AT TIMESTAMP WITHOUT TIME ZONE null, primary key (ID) ); CREATE UNIQUE INDEX ROLS_PK on ROLS (ID); /*==============================================================*/ /* Table: USERS */ /*==============================================================*/ create table USERS ( ID SERIAL not null, ROL_ID INTEGER not null, COMUNA_ID INTEGER not null, NOMBRE VARCHAR(255) not null, APELLIDO VARCHAR(255) not null, RUT VARCHAR(255) not null, EMAIL VARCHAR(255) not null, PASSWORD VARCHAR(255) not null, DIRECCION VARCHAR(255) not null, ESTADO INTEGER not null, REMEMBER_TOKEN VARCHAR(255) null, CREATED_AT TIMESTAMP WITHOUT TIME ZONE null, UPDATED_AT TIMESTAMP WITHOUT TIME ZONE null, primary key (ID) ); /* Index: USUARIO_PK */ create unique index USUARIO_PKS on USERS (ID); create unique index EMAILS_UNIQUE on USERS (EMAIL); /*==============================================================*/ /* Table: ORGANIZACION */ /*==============================================================*/ create table ORGANIZATIONS ( ID SERIAL not null, NOMBRE VARCHAR(255) not null, LOGO VARCHAR(255) not null, DESCRIPCION VARCHAR(255) not null, CREATED_AT TIMESTAMP WITHOUT TIME ZONE null, UPDATED_AT TIMESTAMP WITHOUT TIME ZONE null, primary key (ID) ); /* Index: ORGANIZACION_PK */ create unique index ORGANIZATION_PK on ORGANIZATIONS (ID); /*==============================================================*/ /* Table: ORGANIZACION_USERS */ /*==============================================================*/ create table ORGANIZATION_USERS ( ID SERIAL not null, ORGANIZATION_ID INTEGER not null, USER_ID INTEGER not null, ROL INTEGER not null, CREATED_AT TIMESTAMP WITHOUT TIME ZONE null, UPDATED_AT TIMESTAMP WITHOUT TIME ZONE null, primary key (ID) ); /* Index: ORGANIZACION_PK */ create unique index ORGANIZATION_PK_USERS on ORGANIZATION_USERS (ID); /*==============================================================*/ /* Table: RNVS */ /*==============================================================*/ create table RNVS ( ID SERIAL not null, USER_ID INTEGER not null, ULTIMA_MEDIDA INTEGER not null, RUT INTEGER not null, NOMBRE VARCHAR(255) not null, CORREO VARCHAR(255) not null, CREATED_AT TIMESTAMP WITHOUT TIME ZONE null, UPDATED_AT TIMESTAMP WITHOUT TIME ZONE null, primary key (ID) ); /* Index: RNV_PK */ create unique index RNV_PK on RNVS (ID); /* Index: PARTICIPA_FK */ /*create index PARTICIPA_FK on RNVS (USER_ID); */ /*==============================================================*/ /* Table: MEDIDAS */ /*==============================================================*/ create table MEDIDAS ( ID SERIAL not null, USER_ID INTEGER not null, ADMIN_ID INTEGER null, ORGANIZATION_ID INTEGER not null, CATASTROFE_ID INTEGER not null, TIPO_MEDIDA INTEGER not null, DESCRIPCION VARCHAR(255) not null, FECHA_INICIO DATE not null, FECHA_TERMINO DATE not null, ESTADO INTEGER not null, AVANCE INTEGER not null, "MorphMedida_id" INTEGER not null, "MorphMedida_type" VARCHAR(255) not null, CREATED_AT TIMESTAMP WITHOUT TIME ZONE null, UPDATED_AT TIMESTAMP WITHOUT TIME ZONE null, primary key (ID) ); /* Index: MEDIDAS_PK*/ create unique index MEDIDAS_PK on MEDIDAS (ID); /* Index: TIENE_FK_USERS_ID*/ /*==============================================================*/ /* Table: DEPOSITOS */ /*==============================================================*/ create table DEPOSITOS ( ID SERIAL not null, USER_ID INTEGER not null, MEDIDA_ID INTEGER not null, RUT INTEGER not null, CANTIDAD INTEGER not null, "fechaDeposito" DATE not null, DOCUMENTO VARCHAR(255) not null, CREATED_AT TIMESTAMP WITHOUT TIME ZONE null, UPDATED_AT TIMESTAMP WITHOUT TIME ZONE null, primary key(ID) ); /* iNDEX: DEPOSITOS_PK*/ create unique index DEPOSITOS_PK on DEPOSITOS (ID); /*==============================================================*/ /* Table: EVENTOS */ /*==============================================================*/ create table EVENTOS ( ID SERIAL not null, "metaDinero" INTEGER not null, "actualDinero" INTEGER not null, REGION VARCHAR(255) not null, COMUNA VARCHAR(255) not null, DIRECCION VARCHAR(255) not null, CREATED_AT TIMESTAMP WITHOUT TIME ZONE null, UPDATED_AT TIMESTAMP WITHOUT TIME ZONE null, primary key (ID) ); /* INDEX: EVENTOS_SEMI_PK*/ create unique index EVENTOS_SEMI_PK on EVENTOS (ID); /*==============================================================*/ /* Table: GASTOS */ /*==============================================================*/ create table GASTOS ( ID SERIAL not null, MEDIDA_ID INTEGER not null, DESCRIPCION VARCHAR(255) not null, CREATED_AT TIMESTAMP WITHOUT TIME ZONE null, UPDATED_AT TIMESTAMP WITHOUT TIME ZONE null, primary key (ID) ); /* Index: GASTOS_PK */ create unique index GASTOS_PK on GASTOS (ID); /*==============================================================*/ /* Table: APOYO_ECONOMICOS */ /*==============================================================*/ create table APOYO_ECONOMICOS ( ID SERIAL not null, "metaMinima" INTEGER not null, ACTUAL INTEGER not null, "numCuenta" INTEGER not null, "TipoCuenta" VARCHAR(255) not null, "bancoCuenta" VARCHAR(255) not null, "titularCuenta" VARCHAR(255) not null, "correoCuenta" VARCHAR(255) not null, CREATED_AT TIMESTAMP WITHOUT TIME ZONE null, UPDATED_AT TIMESTAMP WITHOUT TIME ZONE null, primary key (ID) ); /* Index: APOYO_ECONOMICOS_PK */ create unique index APOYO_ECONOMICOS_PK on APOYO_ECONOMICOS (ID); /*==============================================================*/ /* Table: RECOLECCIONES */ /*==============================================================*/ create table RECOLECCIONES ( ID SERIAL not null, "metaRecoleccion" INTEGER not null, "recoleccionActual" INTEGER not null, REGION VARCHAR(255) not null, COMUNA VARCHAR(255) not null, DIRECCION VARCHAR(255) not null, "tipoRecoleccion" INTEGER not null, CREATED_AT TIMESTAMP WITHOUT TIME ZONE null, UPDATED_AT TIMESTAMP WITHOUT TIME ZONE null, primary key (ID) ); /* Index: RECOLECCIONES_PK */ create unique index RECOLECCIONES_SEMI_PK on RECOLECCIONES (ID); /*==============================================================*/ /* Table: HISTORIAS */ /*==============================================================*/ create table HISTORIAS ( ID SERIAL not null, USER_ID INTEGER not null, TIPO_CAMBIO INTEGER not null, TABLA VARCHAR(255) not null, ESTADO_ANTIGUO VARCHAR(255) not null, ESTADO_NUEVO VARCHAR(255) not null, CREATED_AT TIMESTAMP WITHOUT TIME ZONE null, UPDATED_AT TIMESTAMP WITHOUT TIME ZONE null, primary key (ID) ); /* Index: HISTORIAS_PK */ create unique index HISTORIAS_PK on HISTORIAS (ID); /*==============================================================*/ /* Table: PASSWORD_RESETS */ /*==============================================================*/ create table PASSWORD_RESETS ( EMAIL VARCHAR(255) not null, TOKEN VARCHAR(255) not null, CREATED_AT TIMESTAMP WITHOUT TIME ZONE null ); /* INDEX: INDEX_EMAIL*/ create index INDEX_EMAIL on PASSWORD_RESETS (EMAIL); /*==============================================================*/ /* Table: VOLUNTARIADOS */ /*==============================================================*/ create table VOLUNTARIADOS ( ID SERIAL not null, "metaVoluntarios" INTEGER not null, "voluntariosActuales" INTEGER not null, "duracionDias" INTEGER not null, REGION VARCHAR(255) not null, COMUNA VARCHAR(255) not null, DIRECCION VARCHAR(255) not null, CREATED_AT TIMESTAMP WITHOUT TIME ZONE null, UPDATED_AT TIMESTAMP WITHOUT TIME ZONE null, primary key (ID) ); /* INDEX: INDEX_VOLUNTARIADOS*/ create index INDEX_VOLUNTARIADOS on VOLUNTARIADOS (ID); alter table HISTORIAS add foreign key (USER_ID) references USERS(ID) on delete cascade; alter table GASTOS add foreign key (MEDIDA_ID) references APOYO_ECONOMICOS(ID) on delete cascade; alter table DEPOSITOS add foreign key (USER_ID) references USERS(ID) on delete cascade; alter table DEPOSITOS add foreign key (MEDIDA_ID) references APOYO_ECONOMICOS(ID) on delete cascade; alter table MEDIDAS add foreign key (USER_ID) references USERS(ID) on delete cascade; alter table MEDIDAS add foreign key (ORGANIZATION_ID) references ORGANIZATIONS(ID) on delete cascade; alter table MEDIDAS add foreign key (ADMIN_ID) references USERS(ID) on delete cascade; alter table MEDIDAS add foreign key (CATASTROFE_ID) references CATASTROFES(ID) on delete cascade; alter table RNVS add foreign key(USER_ID) references USERS(ID) on delete cascade; alter table ORGANIZATION_USERS add foreign key (ORGANIZATION_ID) references ORGANIZATIONS (ID) on delete cascade; alter table ORGANIZATION_USERS add foreign key (USER_ID) references USERS (ID) on delete cascade; alter table COMUNAS add foreign key (REGION_ID) references REGIONS (ID) on delete cascade; alter table CATASTROFES add foreign key (USER_ID) references USERS (ID) on delete cascade; alter table CATASTROFES add foreign key (COMUNA_ID) references COMUNAS (ID) on delete cascade; alter table USERS add foreign key (ROL_ID) references ROLS (ID) on delete cascade; alter table USERS add foreign key (COMUNA_ID) references COMUNAS (ID) on delete cascade; /*---------------------------------------------------------------------------------------------------------------------------*/
36.050633
127
0.461868
4556c1af93caec5ff0b8f7cf7907d2be48c7c2a0
151
py
Python
Hello World Programs/Python/Hayloworld.py
TeacherManoj0131/HacktoberFest2020-Contributions
c7119202fdf211b8a6fc1eadd0760dbb706a679b
[ "MIT" ]
256
2020-09-30T19:31:34.000Z
2021-11-20T18:09:15.000Z
Hello World Programs/Python/Hayloworld.py
TeacherManoj0131/HacktoberFest2020-Contributions
c7119202fdf211b8a6fc1eadd0760dbb706a679b
[ "MIT" ]
293
2020-09-30T19:14:54.000Z
2021-06-06T02:34:47.000Z
Hello World Programs/Python/Hayloworld.py
TeacherManoj0131/HacktoberFest2020-Contributions
c7119202fdf211b8a6fc1eadd0760dbb706a679b
[ "MIT" ]
1,620
2020-09-30T18:37:44.000Z
2022-03-03T20:54:22.000Z
# Using list to print hello world my_list = ["H", "e", "l", "l", "o", " ", "W", "o", "r", "l", "d"] s = "" for i in my_list: s = s + i print(s)
15.1
65
0.437086
45a15006ad087869f30300bca8e4712962c1e859
286
py
Python
ExamPrep/Assignments 2014-15/A2/Py2Q3.py
FHomewood/ScientificComputing
bc3477b4607b25a700f2d89ca4f01cb3ea0998c4
[ "IJG" ]
null
null
null
ExamPrep/Assignments 2014-15/A2/Py2Q3.py
FHomewood/ScientificComputing
bc3477b4607b25a700f2d89ca4f01cb3ea0998c4
[ "IJG" ]
null
null
null
ExamPrep/Assignments 2014-15/A2/Py2Q3.py
FHomewood/ScientificComputing
bc3477b4607b25a700f2d89ca4f01cb3ea0998c4
[ "IJG" ]
null
null
null
print 'Question 3b' import math as m #Variables h1=0.5 h2=0.1 m.tanh(1+h1) def G(h): x=1.0 return (((4*m.tanh(x+(h/2)))-(4*m.tanh(x-(h/2))))/(3*h))-((m.tanh(x+h)-m.tanh(x-h))/(6*h)) print "at x=1 and h=0.5" print "G(0.5) =",G(h1) print "at x=1 and h=0.1" print "G(0.1) =",G(h2)
14.3
91
0.541958
209c858933eb341a4e7af21e53fb51724d7f92c1
575
cs
C#
DDD.Infrastructure/ApplicationDbContextFactory.cs
raminrahimzada/DDD
44bbe48ef6bec24a3e77ff62a894bba0c7e15717
[ "Apache-2.0" ]
1
2021-02-22T14:54:44.000Z
2021-02-22T14:54:44.000Z
DDD.Infrastructure/ApplicationDbContextFactory.cs
raminrahimzada/DDD
44bbe48ef6bec24a3e77ff62a894bba0c7e15717
[ "Apache-2.0" ]
null
null
null
DDD.Infrastructure/ApplicationDbContextFactory.cs
raminrahimzada/DDD
44bbe48ef6bec24a3e77ff62a894bba0c7e15717
[ "Apache-2.0" ]
null
null
null
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; namespace DDD.Infrastructure { public class ApplicationDbContextFactory : IDesignTimeDbContextFactory<AppDatabaseContext> { public AppDatabaseContext CreateDbContext(string[] args) { var optionsBuilder = new DbContextOptionsBuilder<AppDatabaseContext>(); optionsBuilder.UseSqlServer("Server=MATRIX\\SERVER17;Database=DDD;User Id=sa;Password=badimcandolmasi"); return new AppDatabaseContext(optionsBuilder.Options); } } }
35.9375
116
0.742609
f77f8e113e57423d09fff0514057cbb725ec37e7
4,840
swift
Swift
BarcodeTracker/ViewController.swift
eldare/BarcodeTracker
7653ac6b2c5cef1c27eb9c80dfc122a33552d920
[ "BSD-3-Clause" ]
3
2021-07-06T17:49:50.000Z
2021-07-13T07:14:26.000Z
BarcodeTracker/ViewController.swift
eldare/BarcodeTracker
7653ac6b2c5cef1c27eb9c80dfc122a33552d920
[ "BSD-3-Clause" ]
null
null
null
BarcodeTracker/ViewController.swift
eldare/BarcodeTracker
7653ac6b2c5cef1c27eb9c80dfc122a33552d920
[ "BSD-3-Clause" ]
null
null
null
// // ViewController.swift // BarcodeTracker // // Created by Eldar Eliav on 07/08/2020. // Copyright © 2020 none. All rights reserved. // import UIKit import SceneKit import ARKit protocol ViewProtocol: class { func addNode(_ node: SCNNode) } class ViewController: UIViewController { @IBOutlet var sceneView: ARSCNView! lazy private var viewModel: ViewModelProtocol = { return ViewModel(delegate: self) }() // helps keep the performance by allowing processing once every X number of cycles through ARKit delegate private let processOnceEveryNumberOfCycles = 20 private var cycleCounter = 0 // vertical configuration only, to track on a wall private let arSessionPlaneDetection: ARWorldTrackingConfiguration.PlaneDetection = [.vertical] private let coachingGoal: ARCoachingOverlayView.Goal = .verticalPlane // indicates when we can start processing AR frames, to find barcodes and track them private var isReadyToProcess = false { didSet { print(isReadyToProcess ? "ready to start processing" : "waiting to start processing") } } // MARK: - lifecycle override func viewDidLoad() { super.viewDidLoad() // 1. // setup scene we're going to place nodes on setupScene() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) // 2. // Configure AR session and run it; // We are not yet ready for processing setupAndStartARSession() } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) // 3. // Setup and start coaching overlay; // This will require the user to move the device to provide better result. // Coaching goal is vertical planes, like a wall. setupAndStartCoachingOverlay() } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) puaseARSession() } } // MARK: - private meta extension ViewController { private func setupDebug() { sceneView.debugOptions = [ .showFeaturePoints, .showWireframe, .showWorldOrigin, ] } private func setupScene() { sceneView.session.delegate = self sceneView.scene = SCNScene() } private func setupAndStartARSession() { let configuration = ARWorldTrackingConfiguration() configuration.planeDetection = arSessionPlaneDetection sceneView.session.run(configuration) } private func puaseARSession() { sceneView.session.pause() } } // MARK: - ARSessionDelegate related extension ViewController: ARSessionDelegate { func session(_ session: ARSession, didUpdate frame: ARFrame) { // 5. // Process incoming AR frames. // Vision is quite heavy on resources, so processing will only be called // once for X number of cycles (this method is called). guard isReadyToProcess else { return } guard cycleCounter >= processOnceEveryNumberOfCycles else { cycleCounter += 1 return } cycleCounter = 0 viewModel.process(arFrame: frame) } } // MARK: - ViewProtocol related extension ViewController: ViewProtocol { func addNode(_ node: SCNNode) { // 15. // A new node is placed on our SceneView, to indicate where the detect barcode is. // // FIN. sceneView.scene.rootNode.addChildNode(node) } } // MARK: - ARCoachingOverlayViewDelegate related extension ViewController: ARCoachingOverlayViewDelegate { private func setupAndStartCoachingOverlay() { let coachingOverlay = ARCoachingOverlayView() coachingOverlay.session = sceneView.session coachingOverlay.delegate = self coachingOverlay.translatesAutoresizingMaskIntoConstraints = false sceneView.addSubview(coachingOverlay) NSLayoutConstraint.activate([ coachingOverlay.centerXAnchor.constraint(equalTo: view.centerXAnchor), coachingOverlay.centerYAnchor.constraint(equalTo: view.centerYAnchor), coachingOverlay.widthAnchor.constraint(equalTo: view.widthAnchor), coachingOverlay.heightAnchor.constraint(equalTo: view.heightAnchor) ]) coachingOverlay.activatesAutomatically = true coachingOverlay.goal = coachingGoal } func coachingOverlayViewDidDeactivate(_ coachingOverlayView: ARCoachingOverlayView) { // 4. // Coaching overlay was dismissed; // Meaning ARKit has enough data for us to start processing. // The next AR session didUpdate delegate call will start processing. print("Info: coaching finished") isReadyToProcess = true } }
31.025641
109
0.671281
09fc6f58ba339e06dd9a29de17226f9537e1eac6
1,061
rs
Rust
src/operations/rgb/accept_transaction.rs
rgb-products/bitmask-core
208b21ebf1b29e637c1167245dec35fedd736367
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
6
2022-03-16T21:27:12.000Z
2022-03-31T23:50:17.000Z
src/operations/rgb/accept_transaction.rs
diba-io/bitmask-core
067a394ab1c41fd3590964b805bd3868c746b89e
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
11
2022-03-08T10:57:40.000Z
2022-03-31T12:41:45.000Z
src/operations/rgb/accept_transaction.rs
rgb-products/bitmask-core
208b21ebf1b29e637c1167245dec35fedd736367
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
null
null
null
use anyhow::{Context, Result}; use gloo_console::log; use gloo_net::http::Request; use crate::{ data::{constants::NODE_SERVER_BASE_URL, structs::AcceptRequest}, OutPoint, }; pub async fn accept_transfer( consignment: String, outpoint: OutPoint, blinding_factor: String, ) -> Result<String> { let accept_request = AcceptRequest { consignment, outpoint, blinding_factor, }; log!("here);"); let url = format!("{}accept", *NODE_SERVER_BASE_URL); let response = Request::post(&url) .body(serde_json::to_string(&accept_request)?) .header( "Content-Type", "application/x-www-form-urlencoded; charset=UTF-8", ) .send() .await .context("Problem at receiving request")?; log!("response"); let js: String = response .text() .await .context("Problem at serdering servor response")?; //TODO: not working log!("json"); log!(&js); log!(format!("accept transfer result: {js:?}")); Ok(js) }
25.261905
78
0.593779
0df2aa82ee8c47c27a3ef679e5ab5baea5b10ade
1,485
cs
C#
HaberSitesi.Service/YorumServis.cs
mhnds44/HaberSitesiV2
8e60d1c56be416e05b60e0cd4a5b627481c95ea8
[ "MIT" ]
5
2016-11-08T03:29:14.000Z
2021-01-10T13:30:45.000Z
HaberSitesi.Service/YorumServis.cs
mhnds44/HaberSitesiV2
8e60d1c56be416e05b60e0cd4a5b627481c95ea8
[ "MIT" ]
null
null
null
HaberSitesi.Service/YorumServis.cs
mhnds44/HaberSitesiV2
8e60d1c56be416e05b60e0cd4a5b627481c95ea8
[ "MIT" ]
2
2016-11-08T03:29:22.000Z
2017-05-02T16:27:30.000Z
using HaberSitesi.Data.Context; using HaberSitesi.Domain.DomainModel; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HaberSitesi.Service { public class YorumServis { private HaberSitesiDbContext db; public YorumServis(HaberSitesiDbContext db) { this.db = db; } public int Ekle(Yorum yorum) { db.Yorum.Add(yorum); return db.SaveChanges(); } public IEnumerable<Yorum> TumHaberYorumlar(int haberId, int kayitSayisi) { return db.Yorum .Where(x => x.HaberId == haberId) .OrderByDescending(x => x.Id) .Take(kayitSayisi); } public IEnumerable<Yorum> HaberYorumlar(int haberId) { return db.Yorum .Where(x => x.HaberId == haberId && x.Onayli && x.Aktif) .OrderByDescending(x => x.Id); } public IEnumerable<Yorum> HaberYorumlar(int haberId, int kayitSayisi) { return db.Yorum .Where(x => x.HaberId == haberId && x.Onayli && x.Aktif) .OrderByDescending(x => x.Id) .Take(kayitSayisi); } public int HaberYorumSayisi(int haberId) { return db.Yorum.Where(x => x.HaberId == haberId && x.Onayli && x.Aktif) .Count(); } } }
26.517857
83
0.546128
a315d00aa0a1febf4d75a21c77809d736060e244
3,839
h
C
MBBaseProject/MBBaseProject/Class/System/Base/BaseViewController/MBBaseViewController.h
MarioBiuuuu/MBProject
7f7ff1c3f3f2718de74ed55b2d419ae5b5d4a6fa
[ "MIT" ]
3
2017-03-17T10:08:47.000Z
2020-03-06T06:12:11.000Z
MBBaseProject/MBBaseProject/Class/System/Base/BaseViewController/MBBaseViewController.h
MarioBiuuuu/MBProject
7f7ff1c3f3f2718de74ed55b2d419ae5b5d4a6fa
[ "MIT" ]
null
null
null
MBBaseProject/MBBaseProject/Class/System/Base/BaseViewController/MBBaseViewController.h
MarioBiuuuu/MBProject
7f7ff1c3f3f2718de74ed55b2d419ae5b5d4a6fa
[ "MIT" ]
null
null
null
// // BaseViewController.h // Dangdang // // Created by ZhangXiaofei on 16/9/13. // Copyright © 2016年 Yuri. All rights reserved. // #import <UIKit/UIKit.h> #import "UIViewController+BackButtonHandler.h" #import "UINavigationController_ShouldPopOnBackButton.h" #import "MBBaseConfigure.h" typedef void(^MBBaseViewControllerHandle)(); @interface MBBaseViewController : UIViewController #pragma mark - property /** 基类基础属性设置 */ @property (nonatomic, strong) MBBaseConfigure *baseConfigure; /** * 设置无网络占位图 */ @property (nonatomic, assign) BOOL isNetworkReachable; /** * 隐藏导航栏底部线条阴影开关 */ @property (nonatomic, assign) BOOL hiddenNavigationBarShadowImageView; /** * 导航右边Item */ //@property (nonatomic, strong) UIBarButtonItem *navRightItem; @property (nonatomic, strong) UIBarButtonItem *navRightItem; /** * 导航左边Item */ //@property (nonatomic, strong) UIBarButtonItem *navLeftItem; @property (nonatomic, strong) UIBarButtonItem *navLeftItem; /** * 标题 */ @property (nonatomic, copy) NSString *navItemTitle; /** * 自动隐藏导航栏, 实现过度效果 */ @property (nonatomic, assign) BOOL autoHiddenNavigationBar; #pragma mark - function /** * 防止Cell多次点击造成多次跳转 */ - (void)singlePush; /** * 构造返回 */ - (void)createBackBarButton; /** * 出栈 */ - (void)pop; /** * 退回到Top */ - (void)popToRootVc; /** 退回到指定VC @param vc 指定控制器 */ - (void)popToVc:(UIViewController *)vc; /** * Modal出的视图dismiss */ - (void)dismiss; /** 带回调的dismiss @param completion 回调 */ - (void)dismissWithCompletion:(void(^)())completion; /** modal出某个视图控制器 @param vc 指定视图控制器 */ - (void)presentVc:(UIViewController *)vc; /** modal出某个视图控制器, 带回调 @param vc 指定视图控制器 @param completion 回调 */ - (void)presentVc:(UIViewController *)vc completion:(void (^)(void))completion; /** push到某指定视图控制器 @param vc 指定视图控制器 */ - (void)pushVc:(UIViewController *)vc; /** 移除子视图控制器 @param childVc 指定视图控制器 */ - (void)removeChildVc:(UIViewController *)childVc; /** 添加子视图控制器 @param childVc 指定视图控制器 */ - (void)addChildVc:(UIViewController *)childVc; /** * 设置导航栏右边的item * * @param itemTitle <#itemTitle description#> * @param attributes <#itemTitle description#> * @param handle <#handle description#> */ - (void)MB_setUpNavRightItemTitle:(NSString *)itemTitle attributes:(NSDictionary *)attributes handle:(void(^)(NSString *rightItemTitle))handle; /** * 设置导航栏左边的item * * @param itemTitle <#itemTitle description#> * @param attributes <#itemTitle description#> * @param handle <#handle description#> */ - (void)MB_setUpNavLeftItemTitle:(NSString *)itemTitle attributes:(NSDictionary *)attributes handle:(void(^)(NSString *rightItemTitle))handle; /** * 设置导航栏右边的item * * @param itemTitle <#itemTitle description#> * @param handle <#handle description#> */ - (void)MB_setUpNavRightItemTitle:(NSString *)itemTitle handle:(void(^)(NSString *rightItemTitle))handle __deprecated_msg("Use -MB_setUpNavRightItemTitle:attributes:handle:"); /** * 设置导航栏左边的item * * @param itemTitle <#itemTitle description#> * @param handle <#handle description#> */ - (void)MB_setUpNavLeftItemTitle:(NSString *)itemTitle handle:(void(^)(NSString *rightItemTitle))handle __deprecated_msg("Use -MB_setUpNavLeftItemTitle:attributes:handle:"); /** * 设置导航栏右边的item * * @param itemTitle <#itemTitle description#> * @param handle <#handle description#> */ - (void)MB_setUpNavRightItemImage:(UIImage *)itemImage handle:(void(^)(UIImage *rightItemImage))handle; /** * 设置导航栏左边的item * * @param itemTitle <#itemTitle description#> * @param handle <#handle description#> */ - (void)MB_setUpNavLeftItemImage:(UIImage *)itemImage handle:(void(^)(UIImage *leftItemImage))handle; /** * 加载中 */ - (void)showLoadingAnimation; /** * 停止加载 */ - (void)hideLoadingAnimation; /** * 请求数据,子类实现 */ - (void)loadData; @end
19.687179
175
0.701745
14c9af1ce102b4cda254f38b7b400bb3c4ed93ca
168
ts
TypeScript
libs/shared/src/lib/models/search/search-kind.enum.ts
OffprintStudios/pulp-fiction
71c9283751cef9f3e4226782bfdbf60e892c43db
[ "Apache-2.0" ]
5
2020-08-03T10:48:49.000Z
2021-01-26T20:44:13.000Z
libs/shared/src/lib/models/search/search-kind.enum.ts
OffprintStudios/pulp-fiction
457b65fc1bf55b57c4e2f28ead5908d4d365d2ad
[ "Apache-2.0" ]
263
2020-07-23T06:22:20.000Z
2021-01-30T08:57:59.000Z
libs/shared/src/lib/models/search/search-kind.enum.ts
OffprintStudios/dragonfish
c0341184013201e5457ff4a41f0b8891a218c6ba
[ "Apache-2.0" ]
7
2021-02-08T20:56:34.000Z
2022-02-14T09:47:47.000Z
export enum SearchKind { ProseAndPoetry = "Prose and Poetry", Prose = "Prose", Poetry = "Poetry", Blog = "Blog", News = "News", User = "User", }
21
40
0.559524
c571c96fd8d1c2a75d2b4195aa4c42bcbfefa0f1
10,086
css
CSS
web/css/6bb0b8d.css
trycatch-au/Informative-Workspaces
87e4afecd5b2f4d9f7ad094d2ec85a74f9f3386a
[ "MIT" ]
null
null
null
web/css/6bb0b8d.css
trycatch-au/Informative-Workspaces
87e4afecd5b2f4d9f7ad094d2ec85a74f9f3386a
[ "MIT" ]
1
2017-07-04T23:08:42.000Z
2017-07-04T23:08:42.000Z
web/css/6bb0b8d.css
trycatch-au/Informative-Workspaces
87e4afecd5b2f4d9f7ad094d2ec85a74f9f3386a
[ "MIT" ]
1
2018-03-30T08:55:08.000Z
2018-03-30T08:55:08.000Z
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; outline: 0; font-size: 100%; font: inherit; vertical-align: baseline; position: relative; font-family: 'Helvetica', monospace; } /* HTML5 display-role reset for older browsers */ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; } body { line-height: 1; height: 100%; } ol, ul { list-style: none; } blockquote, q { quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; } :focus { outline: 0; } /* remember to highlight inserts somehow! */ ins { text-decoration: overline; } del { text-decoration: line-through; } table { border-collapse: collapse; border-spacing: 0; } header, footer {display: none;} /* may be used for notifications in the future */ .alpha30 { /* slightly opaque background colour */ /* Fallback for web browsers that doesn't support RGBa */ background: rgb(178, 178, 178); /* RGBa with 0.6 opacity */ background: rgba(0, 0, 0, 0.3); /* For IE 5.5 - 7*/ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4c000000, endColorstr=#4c000000); /* For IE 8*/ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#4c000000, endColorstr=#4c000000)"; /* pro-tip: * to calculate the hex value of the rgba for opacity in IE, run * * Math.floor([opacity] * 255).toString(16) * * in your JS console! */ } .alpha60_white { /* slightly opaque background colour */ /* Fallback for web browsers that doesn't support RGBa */ background: rgb(255, 255, 255); /* RGBa with 0.6 opacity */ background: rgba(255, 255, 255, 0.9); /* For IE 5.5 - 7*/ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#e5ffffff, endColorstr=#e5ffffff); /* For IE 8*/ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#e5ffffff, endColorstr=#e5ffffff)"; /* pro-tip: * to calculate the hex value of the rgba for opacity in IE, run * * Math.floor([opacity] * 255).toString(16) * * in your JS console! */ } .round-corners5 { -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; } .round-corners10 { -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; } header.active { display: block; background: #000;} header.active.emergency { padding: 50px;} header.active.emergency div { padding: 30px; color: #000; } header.active.emergency { height: auto; position: relative; background-color: yellow; background-image: -webkit-gradient( linear, /* the style of the gradient */ 0 0, /* the start point of the gradient */ 100% 100%, /* the end-point of the gradient */ color-stop(.10, rgba(0, 0, 0, .7)), color-stop(.10, transparent), color-stop(.15, transparent), color-stop(.15, rgba(0, 0, 0, .7)), color-stop(.25, rgba(0, 0, 0, .7)), color-stop(.25, transparent), color-stop(.30, transparent), color-stop(.30, rgba(0, 0, 0, .7)), color-stop(.40, rgba(0, 0, 0, .7)), color-stop(.40, transparent), color-stop(.45, transparent), color-stop(.45, rgba(0, 0, 0, .7)), color-stop(.55, rgba(0, 0, 0, .7)), color-stop(.55, transparent), color-stop(.60, transparent), color-stop(.60, rgba(0, 0, 0, .7)), color-stop(.70, rgba(0, 0, 0, .7)), color-stop(.70, transparent), color-stop(.75, transparent), color-stop(.75, rgba(0, 0, 0, .7)), color-stop(.85, rgba(0, 0, 0, .7)), color-stop(.85, transparent), color-stop(.90, transparent), color-stop(.90, rgba(0, 0, 0, .7)), color-stop(1.00, rgba(0, 0, 0, .7)), color-stop(1.00, transparent), to(transparent)); background-image: -webkit-linear-gradient( -45deg, /* the angle of the linear gradient*/ rgba(0, 0, 0, .7) 10%, /* this is a color-stop. This one tells the browser to render the gradient in white with 30% opacity, and make it 10% wide */ transparent 10%, /* another color-stop. This one is transparent for 10% of the width. By making these two start at the same point, we have sharp lines */ transparent 15%, rgba(0, 0, 0, .7) 15%, /* this is a combination of the two. In each couplet the roles are reversed, to allow sharp edges all around */ rgba(0, 0, 0, .7) 25%, transparent 25%, transparent 30%, rgba(0, 0, 0, .7) 30%, rgba(0, 0, 0, .7) 40%, transparent 40%, transparent 45%, rgba(0, 0, 0, .7) 45%, rgba(0, 0, 0, .7) 55%, transparent 55%, transparent 60%, rgba(0, 0, 0, .7) 60%, rgba(0, 0, 0, .7) 70%, transparent 70%, transparent 75%, rgba(0, 0, 0, .7) 75%, rgba(0, 0, 0, .7) 85%, transparent 85%, transparent 90%, rgba(0, 0, 0, .7) 90%, rgba(0, 0, 0, .7) 100%, transparent 100%, transparent ); background-image: -moz-linear-gradient(-45deg, rgba(0, 0, 0, .7) 10%, transparent 10%, transparent 15%, rgba(0, 0, 0, .7) 15%, rgba(0, 0, 0, .7) 25%, transparent 25%, transparent 30%, rgba(0, 0, 0, .7) 30%, rgba(0, 0, 0, .7) 40%, transparent 40%, transparent 45%, rgba(0, 0, 0, .7) 45%, rgba(0, 0, 0, .7) 55%, transparent 55%, transparent 60%, rgba(0, 0, 0, .7) 60%, rgba(0, 0, 0, .7) 70%, transparent 70%, transparent 75%, rgba(0, 0, 0, .7) 75%, rgba(0, 0, 0, .7) 85%, transparent 85%, transparent 90%, rgba(0, 0, 0, .7) 90%, rgba(0, 0, 0, .7) 100%, transparent 100%, transparent); background-image: -ms-linear-gradient(-45deg, rgba(0, 0, 0, .7) 10%, transparent 10%, transparent 15%, rgba(0, 0, 0, .7) 15%, rgba(0, 0, 0, .7) 25%, transparent 25%, transparent 30%, rgba(0, 0, 0, .7) 30%, rgba(0, 0, 0, .7) 40%, transparent 40%, transparent 45%, rgba(0, 0, 0, .7) 45%, rgba(0, 0, 0, .7) 55%, transparent 55%, transparent 60%, rgba(0, 0, 0, .7) 60%, rgba(0, 0, 0, .7) 70%, transparent 70%, transparent 75%, rgba(0, 0, 0, .7) 75%, rgba(0, 0, 0, .7) 85%, transparent 85%, transparent 90%, rgba(0, 0, 0, .7) 90%, rgba(0, 0, 0, .7) 100%, transparent 100%, transparent); background-image: -o-linear-gradient(-45deg, rgba(0, 0, 0, .7) 10%, transparent 10%, transparent 15%, rgba(0, 0, 0, .7) 15%, rgba(0, 0, 0, .7) 25%, transparent 25%, transparent 30%, rgba(0, 0, 0, .7) 30%, rgba(0, 0, 0, .7) 40%, transparent 40%, transparent 45%, rgba(0, 0, 0, .7) 45%, rgba(0, 0, 0, .7) 55%, transparent 55%, transparent 60%, rgba(0, 0, 0, .7) 60%, rgba(0, 0, 0, .7) 70%, transparent 70%, transparent 75%, rgba(0, 0, 0, .7) 75%, rgba(0, 0, 0, .7) 85%, transparent 85%, transparent 90%, rgba(0, 0, 0, .7) 90%, rgba(0, 0, 0, .7) 100%, transparent 100%, transparent); background-image: linear-gradient(-45deg, rgba(0, 0, 0, .7) 10%, transparent 10%, transparent 15%, rgba(0, 0, 0, .7) 15%, rgba(0, 0, 0, .7) 25%, transparent 25%, transparent 30%, rgba(0, 0, 0, .7) 30%, rgba(0, 0, 0, .7) 40%, transparent 40%, transparent 45%, rgba(0, 0, 0, .7) 45%, rgba(0, 0, 0, .7) 55%, transparent 55%, transparent 60%, rgba(0, 0, 0, .7) 60%, rgba(0, 0, 0, .7) 70%, transparent 70%, transparent 75%, rgba(0, 0, 0, .7) 75%, rgba(0, 0, 0, .7) 85%, transparent 85%, transparent 90%, rgba(0, 0, 0, .7) 90%, rgba(0, 0, 0, .7) 100%, transparent 100%, transparent); } header.active.emergency div h1 { text-align: center; color: red; font-size: 180%;} header.active.emergency div p { line-height: 200%; font-weight: bold; font-variant: small-caps; text-align: center; font-size: 140%;} .priority.p1 { background: red;} .priority.p2 { background: darkorange;} .priority.p3 { background: lightsteelblue;} .priority.p4 { background: blue;} /* General Layout Styles */ div.clear {clear:both;} /* clears floated elements manually */ div.section.active { clear:both; border-bottom: 1px solid #fff; padding-bottom: 15px; } div.section h1 { color: #fff; padding: 10px 0 0 10px; font-size: 200%; } /* // General Layout Styles */ @media only screen and (min-width: 1080px) and (-webkit-min-device-pixel-ratio: 2){ /* ipad three stuff. needs touch controls, but high resolution */ } @media only screen and (min-width: 800px) and (max-width: 15080px){ /* for everything up to a 1080p display in landscape mode */ } @media only screen and (min-width: 480px) and (max-width: 799px) { /* almost all current tablets sit between 600px and 800px wide */ div.section h1 { font-size: 150%;} } @media only screen and (max-width: 479px) { div.section h1 { font-size: 110%;} } /* end "@media only screen and (max-width: 480px)" */
49.684729
596
0.558398
451fd6ddeb68b724bb2259cdbf3ec4dc91f657f4
597
lua
Lua
StarterPlayer/CoreGuiEvents.lua
myn55/the
0843c9ec4207b3727b2c21b1a85b21a34e99bd92
[ "MIT" ]
null
null
null
StarterPlayer/CoreGuiEvents.lua
myn55/the
0843c9ec4207b3727b2c21b1a85b21a34e99bd92
[ "MIT" ]
null
null
null
StarterPlayer/CoreGuiEvents.lua
myn55/the
0843c9ec4207b3727b2c21b1a85b21a34e99bd92
[ "MIT" ]
null
null
null
-- Author: Coronhaus local ReplicatedStorage = game:GetService('ReplicatedStorage') local RemoteEvents = ReplicatedStorage:WaitForChild('Remotes') local StarterGui = RemoteEvents:WaitForChild('StarterGui') local SetCore = StarterGui:WaitForChild('SetCore') local SetCoreGuiEnabled = StarterGui:WaitForChild('SetCoreGuiEnabled') SetCore.OnClientEvent:connect(function(core, ...) local tuple = {...} game:GetService('StarterGui'):SetCore(core, unpack(tuple)) end) SetCoreGuiEnabled.OnClientEvent:connect(function(core, bool) game:GetService('StarterGui'):SetCoreGuiEnabled(core, bool) end)
35.117647
70
0.795645
b71cb15b2080a24f2fad9a995118b727c71ab4a1
572
cs
C#
Assets/_Scripts/UI_Scripts/AnalyzingBarUI.cs
avmakesthings/Face2Face_V1
e2d58476b31926627fe63a988d9af10dc158ea4a
[ "MIT" ]
null
null
null
Assets/_Scripts/UI_Scripts/AnalyzingBarUI.cs
avmakesthings/Face2Face_V1
e2d58476b31926627fe63a988d9af10dc158ea4a
[ "MIT" ]
1
2021-06-01T23:11:55.000Z
2021-06-01T23:11:55.000Z
Assets/_Scripts/UI_Scripts/AnalyzingBarUI.cs
avmakesthings/Face2Face_V1
e2d58476b31926627fe63a988d9af10dc158ea4a
[ "MIT" ]
null
null
null
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class AnalyzingBarUI : MonoBehaviour { public Image analyzeBar; public bool analyzing; public float waitTime = 5.0f; // Update is called once per frame void Update() { if (analyzing == true) { //Reduce fill amount over 30 seconds analyzeBar.fillAmount -= 1.0f / waitTime * Time.deltaTime; } } //public IEnumerator analyzing(){ // yield return new WaitForSeconds //} }
22
70
0.634615
0a00c2cdd53820b238956f8062aec4e924080719
149
rs
Rust
actix-producer/tests/verify.rs
beltram/stubr
c140fd6a0f32c8bccdd1f7c7c7fb18692f27eac3
[ "Apache-2.0" ]
25
2020-11-06T13:37:16.000Z
2022-02-16T16:03:06.000Z
actix-producer/tests/verify.rs
beltram/stubr
c140fd6a0f32c8bccdd1f7c7c7fb18692f27eac3
[ "Apache-2.0" ]
265
2021-02-06T11:16:34.000Z
2022-03-29T10:10:09.000Z
actix-producer/tests/verify.rs
beltram/stubr
c140fd6a0f32c8bccdd1f7c7c7fb18692f27eac3
[ "Apache-2.0" ]
2
2021-03-08T14:50:50.000Z
2022-03-23T10:45:02.000Z
use actix_web::App; use actix_producer::ok; use stubr::*; #[actix_rt::test] async fn should_verify() { App::new().service(ok).verify().await; }
16.555556
42
0.671141
05f33de780e71bdb02f7cd76af10bcc1d902c7dd
601
py
Python
Builder/products.py
HOWZ1T/learning-design-patterns
73a844f9d8ea00bae711fb0d90b93ca652b2b039
[ "MIT" ]
1
2018-09-24T12:05:06.000Z
2018-09-24T12:05:06.000Z
Builder/products.py
HOWZ1T/learning-design-patterns
73a844f9d8ea00bae711fb0d90b93ca652b2b039
[ "MIT" ]
null
null
null
Builder/products.py
HOWZ1T/learning-design-patterns
73a844f9d8ea00bae711fb0d90b93ca652b2b039
[ "MIT" ]
null
null
null
from Builder import abstract_objects class VeggieBurger(abstract_objects.Burger): def price(self): return float(25.0) def name(self): return "Veggie Burger" class ChickenBurger(abstract_objects.Burger): def price(self): return float(50.5) def name(self): return "Chicken Burger" class Coke(abstract_objects.ColdDrink): def price(self): return float(30.0) def name(self): return "Coke" class Pepsi(abstract_objects.ColdDrink): def price(self): return float(35.0) def name(self): return "Pepsi"
17.676471
45
0.643927
49db352e6e64e64c9140da2b9727d8f91bae85af
1,928
lua
Lua
packages/l/libvorbis/xmake.lua
SoapyMan/xmake-repo
a8bcd72dcb062818c57ade09eb06ca42f4450328
[ "Apache-2.0" ]
1
2020-12-16T16:31:50.000Z
2020-12-16T16:31:50.000Z
packages/l/libvorbis/xmake.lua
SoapyMan/xmake-repo
a8bcd72dcb062818c57ade09eb06ca42f4450328
[ "Apache-2.0" ]
null
null
null
packages/l/libvorbis/xmake.lua
SoapyMan/xmake-repo
a8bcd72dcb062818c57ade09eb06ca42f4450328
[ "Apache-2.0" ]
null
null
null
package("libvorbis") set_homepage("https://xiph.org/vorbis") set_description("Reference implementation of the Ogg Vorbis audio format.") set_license("BSD-3") set_urls("https://ftp.osuosl.org/pub/xiph/releases/vorbis/libvorbis-$(version).tar.gz", "https://github.com/xiph/vorbis/releases/download/v$(version)/libvorbis-$(version).tar.gz", "https://gitlab.xiph.org/xiph/vorbis.git") add_versions("1.3.7", "0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab") add_deps("cmake", "libogg") on_install("windows", "linux", "macosx", "iphoneos", "mingw", "android", function (package) local configs = {} table.insert(configs, "-DBUILD_TESTING=OFF") table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) -- we pass libogg as packagedeps instead of findOgg.cmake (it does not work) local libogg = package:dep("libogg"):fetch() if libogg then local links = table.concat(table.wrap(libogg.links), " ") io.replace("CMakeLists.txt", "find_package(Ogg REQUIRED)", "", {plain = true}) io.replace("lib/CMakeLists.txt", "Ogg::ogg", links, {plain = true}) end -- disable .def file for mingw if package:config("shared") and package:is_plat("mingw") then io.replace("lib/CMakeLists.txt", [[list(APPEND VORBIS_SOURCES ../win32/vorbis.def) list(APPEND VORBISENC_SOURCES ../win32/vorbisenc.def) list(APPEND VORBISFILE_SOURCES ../win32/vorbisfile.def)]], "", {plain = true}) end import("package.tools.cmake").install(package, configs, {packagedeps = "libogg"}) end) on_test(function (package) assert(package:has_cfuncs("vorbis_info_init", {includes = "vorbis/codec.h"})) end)
49.435897
104
0.651452
b3aae293717e30e9c8ff2f13f46a8e31defabe5f
66
psd1
PowerShell
GitHub/On/IssueOpenedOrEdited.psd1
Jalalhejazi/PSDevOps
d0608a13046502816434653c8e12fe864ca06003
[ "MIT" ]
1
2022-03-09T09:22:49.000Z
2022-03-09T09:22:49.000Z
GitHub/On/IssueOpenedOrEdited.psd1
Jalalhejazi/PSDevOps
d0608a13046502816434653c8e12fe864ca06003
[ "MIT" ]
null
null
null
GitHub/On/IssueOpenedOrEdited.psd1
Jalalhejazi/PSDevOps
d0608a13046502816434653c8e12fe864ca06003
[ "MIT" ]
null
null
null
@{ issues = @{ types =@('opened','edited') } }
8.25
35
0.348485
8b3bcc2cada7cc977361cf95e48debf29043ce55
578
rb
Ruby
lib/rulers.rb
jsimpson/rulers
173a4f0b95793a3a4237982e1b7a56efdf889ad2
[ "MIT" ]
null
null
null
lib/rulers.rb
jsimpson/rulers
173a4f0b95793a3a4237982e1b7a56efdf889ad2
[ "MIT" ]
null
null
null
lib/rulers.rb
jsimpson/rulers
173a4f0b95793a3a4237982e1b7a56efdf889ad2
[ "MIT" ]
null
null
null
require 'rulers/routing' require 'rulers/util' require 'rulers/dependencies' require 'rulers/version' module Rulers class Error < StandardError; end class Application def call(env) return [404, { 'Content-Type' => 'text/html' }, []] if env['PATH_INFO'] == '/favicon.ico' klass, act = get_controller_and_action(env) controller = klass.new(env) text = controller.send(act) [200, { 'Content-Type' => 'text/html' }, [text]] end end class Controller attr_reader :env def initialize(env) @env = env end end end
19.266667
95
0.636678
e277c3002e51ca795d9dfc26f35ed970b46fd18c
1,188
py
Python
HAL/util/stats.py
cagrell/HAL
3dd7df1d2d7f6b6bd2c6bf95e3773d1ef7219a4d
[ "MIT" ]
null
null
null
HAL/util/stats.py
cagrell/HAL
3dd7df1d2d7f6b6bd2c6bf95e3773d1ef7219a4d
[ "MIT" ]
null
null
null
HAL/util/stats.py
cagrell/HAL
3dd7df1d2d7f6b6bd2c6bf95e3773d1ef7219a4d
[ "MIT" ]
null
null
null
import numpy as np import scipy as sp def norm_cdf_int(mu, std, LB, UB): """ Return P(LB < X < UB) for X Normal(mu, std) """ rv = sp.stats.norm(mu, std) return rv.cdf(UB) - rv.cdf(LB) def norm_cdf_int_approx(mu, std, LB, UB): """ Return P(LB < X < UB) for X Normal(mu, std) using approximation of Normal CDF Input: All inputs as 1-D arrays """ l = normal_cdf_approx((LB - mu)/std) u = normal_cdf_approx((UB - mu)/std) return u - l def normal_cdf_approx(x): """ Approximation of standard normal CDF Input: x = array Polynomial approximation from Abramowitz and Stegun p. 932 http://people.math.sfu.ca/~cbm/aands/frameindex.htm Absolute error < 7.5*10^-8 """ p = 0.2316419 b = [0.319381530, -0.356563782, 1.781477937, -1.821255978, 1.330274429] xx = abs(x) # Approximation only works for x > 0, return 1 - p otherwise t = 1/(1 + p*xx) Z = (1/(np.sqrt(2*np.pi)))*np.exp(-(x*x)/2) pol = b[0]*t + b[1]*(t**2) + b[2]*(t**3) + b[3]*(t**4) + b[4]*(t**5) prob = 1 - Z*pol # For x > 0 prob[x < 0] = 1 - prob[x < 0] # Change when x < 0 return prob
27
82
0.56229
84b5d2c265a49e798c91060b1e8471d45d987534
550
cs
C#
MTN/Patches/GameServerPatch/GameServer.Patch.cs
Dawilly/MTN
5af669b102da5f3919d2cbb0bf6298958d1092d8
[ "MIT" ]
3
2018-10-14T19:38:48.000Z
2021-01-15T17:14:17.000Z
MTN/Patches/GameServerPatch/GameServer.Patch.cs
Dawilly/MTN
5af669b102da5f3919d2cbb0bf6298958d1092d8
[ "MIT" ]
null
null
null
MTN/Patches/GameServerPatch/GameServer.Patch.cs
Dawilly/MTN
5af669b102da5f3919d2cbb0bf6298958d1092d8
[ "MIT" ]
6
2018-10-31T20:29:04.000Z
2021-08-07T20:53:20.000Z
using StardewValley; using StardewValley.Network; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Harmony; using StardewValley.Locations; using System.Reflection.Emit; namespace MTN.Patches.GameServerPatch { class GameServerPatch { static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { var codes = new List<CodeInstruction>(instructions); return codes.AsEnumerable(); } } }
22
97
0.729091
43b130f8cc78b5919227936e40ec152343819b60
210
ts
TypeScript
src/typing.ts
drsugiaichigo00781vn/togo
0c4ae340203328dda58ab8b57d579734ceaf0ff8
[ "MIT" ]
null
null
null
src/typing.ts
drsugiaichigo00781vn/togo
0c4ae340203328dda58ab8b57d579734ceaf0ff8
[ "MIT" ]
null
null
null
src/typing.ts
drsugiaichigo00781vn/togo
0c4ae340203328dda58ab8b57d579734ceaf0ff8
[ "MIT" ]
null
null
null
type TTask = { id: number name: string isFinished: number assignedUserId: number assignedDate: number } type TUser = { id: number name: string limitTask: number } export { TTask, TUser, }
11.052632
24
0.661905
38c0c5ffc514eaeffbb8bc9a51884a8cc43af1f8
537
php
PHP
app/Http/Controllers/AdminControllers/NoticeController.php
eunah3693/w_dnd
1e67572eac035c4b95202e5893d250cf4eb6dbe1
[ "MIT" ]
null
null
null
app/Http/Controllers/AdminControllers/NoticeController.php
eunah3693/w_dnd
1e67572eac035c4b95202e5893d250cf4eb6dbe1
[ "MIT" ]
null
null
null
app/Http/Controllers/AdminControllers/NoticeController.php
eunah3693/w_dnd
1e67572eac035c4b95202e5893d250cf4eb6dbe1
[ "MIT" ]
null
null
null
<?php namespace App\Http\Controllers\AdminControllers; use Illuminate\Http\Request; use App\Http\Controllers\Controller; class NoticeController extends Controller { // public function getBoardNoticeList(){ } public function getBoardNoticeOne(){ } public function getBoardNoticeDetail(){ } public function getBoardNoticeModify(){ } public function getBoardNoticeInsert(){ } public function getBoardNoticeUpdate(){ } public function getBoardNoticeDelete(){ } }
13.097561
48
0.692737
e3220238bf268099b278c71b3288afef0827bc34
2,866
ps1
PowerShell
Powershell/scripts/Day1-PowerShell/HelloWorld-Explained.ps1
martincho5/vscode
7d9568590d307de5319e7f7c94cc6a88ca0563d0
[ "MIT" ]
null
null
null
Powershell/scripts/Day1-PowerShell/HelloWorld-Explained.ps1
martincho5/vscode
7d9568590d307de5319e7f7c94cc6a88ca0563d0
[ "MIT" ]
null
null
null
Powershell/scripts/Day1-PowerShell/HelloWorld-Explained.ps1
martincho5/vscode
7d9568590d307de5319e7f7c94cc6a88ca0563d0
[ "MIT" ]
null
null
null
############################################################################## # Script: HelloWorld-Explained.ps1 # Date: 27.Mar.2007 # Version: 1.0 # Author: Jason Fossen (www.WindowsPowerShellTraining.com) # Purpose: Explains how the traditional "Hello World!" script in PowerShell # actually works under the hood. # Legal: Script provided "AS IS" without warranties or guarantees of any # kind. USE AT YOUR OWN RISK. Public domain, no rights reserved. ############################################################################## # A quoted string by itself will automatically be displayed: "Hello World!" # But that's because a string is really an object in the .NET Class Library # of type System.String. This object has methods and properties from # .NET that we can directly access in PowerShell: "Hello World!".GetType().FullName # You can cast it as a string object with no change in output: [System.String] "Hello World!" # But why is it printed on-screen at all? When an object is not piped anywhere # else, PowerShell pipes it into the Out-Default cmdlet by default: "Hello World!" | Out-Default # Out-Default examines the objects fed into it to determine what to do with them. # If the objects are just strings, the strings go straight to Out-Host. If the # objects have been tagged with a preferred formatter, then that formatter is # used. If no formatter is specified and the first object has five or more # properties, then Format-List is used; four or less, then Format-Table. The # output of a formatter are strings, which go straight to Out-Host. Because # our "Hello World!" is a single string, the formatter is skipped and the # output goes straight to Out-Host, the default outputter. Formatters are # the Format-* cmdlets that format object data as strings, while Outputters are # the Out-* cmdlets that actually display/print/redirect that data somewhere. "Hello World!" | Out-Default | Out-Host # The following lines all result in the exact same output: "Hello World!" [System.String] "Hello World!" "Hello World!" | out-default "Hello World!" | format-list "Hello World!" | out-host "Hello World!" | format-list | out-host "Hello World!" | out-default | format-list | out-host [System.String] "Hello World!" | out-default | out-host # But there are other formatters available which can be called: "Hello World!" | Format-List "Hello World!" | Format-Wide "Hello World!" | Format-Custom # And there are other outputters too: "Hello World!" | Format-List | Out-Null # Deletes data. "Hello World!" | Format-List | Out-String # Renders as text strings, not objects. # "Hello World!" | Format-List | Out-File C:\file.txt # Saves to file. # "Hello World!" | Format-List | Out-Printer # Goes to default printer.
33.325581
99
0.672017
7bce22766185f7a2e5cf180f54fecab8eb7d57fa
443
cpp
C++
baekjoon/stack/10799-iron-stick.cpp
honux77/algorithm
2ed8cef1fbee7ad96d8f2ae583666d52bd8892ee
[ "MIT" ]
2
2019-02-08T01:23:07.000Z
2020-11-19T12:23:52.000Z
baekjoon/stack/10799-iron-stick.cpp
honux77/algorithm
2ed8cef1fbee7ad96d8f2ae583666d52bd8892ee
[ "MIT" ]
null
null
null
baekjoon/stack/10799-iron-stick.cpp
honux77/algorithm
2ed8cef1fbee7ad96d8f2ae583666d52bd8892ee
[ "MIT" ]
null
null
null
#include <iostream> #include <stack> using namespace std; int main() { int res = 0; ios_base::sync_with_stdio(false); cin.tie(nullptr); stack<char> st; string p; cin >> p; bool prev = false; for (auto c: p) { if (c=='(') { st.push(c); prev = true; } else if (c == ')' && prev) { st.pop(); res += st.size(); prev = false; } else { st.pop(); res++; prev = false; } } cout << res << endl; return 0; }
14.766667
34
0.528217
df618fef55dd08394e714f921b23e1c270fa2600
382
cs
C#
WebDriver.SpecFlow.Demos/Pages/CelsiusFahrenheitPage/KilowattHoursPageAsserter.cs
sheirali/TestAutomationATPLevel2
87447e8e052bdc43c8ebbd1a704dac9c5b2a8642
[ "Apache-2.0" ]
1
2021-02-27T15:26:05.000Z
2021-02-27T15:26:05.000Z
WebDriver.SpecFlow.Demos/Pages/CelsiusFahrenheitPage/KilowattHoursPageAsserter.cs
sheirali/TestAutomationATPLevel2
87447e8e052bdc43c8ebbd1a704dac9c5b2a8642
[ "Apache-2.0" ]
null
null
null
WebDriver.SpecFlow.Demos/Pages/CelsiusFahrenheitPage/KilowattHoursPageAsserter.cs
sheirali/TestAutomationATPLevel2
87447e8e052bdc43c8ebbd1a704dac9c5b2a8642
[ "Apache-2.0" ]
null
null
null
using Microsoft.VisualStudio.TestTools.UnitTesting; namespace WebDriver.SpecFlow.Demos.Pages { public static class KilowattHoursPageAsserter { public static void AssertFahrenheit(this KilowattHoursPage page, string expectedNewtonMeters) { Assert.IsTrue(page.Answer.Text.Contains(string.Format("{0}Nm", expectedNewtonMeters))); } } }
31.833333
101
0.722513
f23d104278860b524d10a71be6a2d787e81d3fbf
3,275
php
PHP
resources/views/auth/login.blade.php
ericf196/proyectoDomino
fe9d02f261bd0e51dee2afd24b4e63e2cb03f819
[ "MIT" ]
null
null
null
resources/views/auth/login.blade.php
ericf196/proyectoDomino
fe9d02f261bd0e51dee2afd24b4e63e2cb03f819
[ "MIT" ]
null
null
null
resources/views/auth/login.blade.php
ericf196/proyectoDomino
fe9d02f261bd0e51dee2afd24b4e63e2cb03f819
[ "MIT" ]
null
null
null
@extends('layout.homePanel') @section('contentPanel') <div class="page login-page"> <div class="container"> <div class="form-outer text-center d-flex align-items-center"> <div class="form-inner"> <div class="logo text-uppercase"><span>Dash</span><strong class="text-primary">Express</strong></div> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud.</p> <form class="form-horizontal" method="POST" action="{{ route('login') }}"> {{ csrf_field() }} <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}"> <label for="email" class="label-custom">Usuario (Email)</label> <input id="email" type="email" name="email" value="{{ old('email') }}" required autofocus> @if ($errors->has('email')) <span class="help-block"> <strong>{{ $errors->first('email') }}</strong> </span> @endif </div> <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}"> <label for="password" class="label-custom">Contraseña</label> <input id="password" type="password" name="password" required> @if ($errors->has('password')) <span class="help-block"> <strong>{{ $errors->first('password') }}</strong> </span> @endif </div> <div class="form-group"> <div class="checkbox"> <label> <input type="checkbox" name="remember" {{ old('remember') ? 'checked' : '' }}> Recordarme </label> </div> </div> <div class="form-group"> <button type="submit" class="btn btn-primary"> Login </button> <a class="forgot-pass" href="{{ route('password.request') }}"> Forgot Your Password? </a> </div> </form> </div> <div class="copyrights text-center"> <p>Design by <a href="https://bootstrapious.com" class="external">Bootstrapious</a></p> <!-- Please do not remove the backlink to us unless you support further theme's development at https://bootstrapious.com/donate. It is part of the license conditions. Thank you for understanding :)--> </div> </div> </div> </div> @endsection
38.529412
212
0.41313
e3a158bacda541d0ab471db93dff5b9b776f111a
169
rb
Ruby
app/models/todo.rb
kevinah95/todos-api
3d3ea39bf9a404dd4622027d61f397bfda56efc7
[ "MIT" ]
null
null
null
app/models/todo.rb
kevinah95/todos-api
3d3ea39bf9a404dd4622027d61f397bfda56efc7
[ "MIT" ]
null
null
null
app/models/todo.rb
kevinah95/todos-api
3d3ea39bf9a404dd4622027d61f397bfda56efc7
[ "MIT" ]
null
null
null
class Todo < ApplicationRecord # model association has_many :items, dependent: :destroy # validations validates_presence_of :title, :created_by end
21.125
45
0.715976
c41f51c3be2e0a6a58bc01a94f7758223e06cbbb
4,903
dart
Dart
database/lib/src/database/adapters/caching.dart
Jack-Beattie/database
6bd0d939ef0ab6ace3102060b090b85147bb4270
[ "Apache-2.0" ]
60
2020-01-14T00:59:04.000Z
2022-02-03T09:12:07.000Z
database/lib/src/database/adapters/caching.dart
Jack-Beattie/database
6bd0d939ef0ab6ace3102060b090b85147bb4270
[ "Apache-2.0" ]
23
2020-01-23T17:14:08.000Z
2021-12-26T10:31:47.000Z
database/lib/src/database/adapters/caching.dart
terrier989/datastore
bb9f1650b191498e25d2f4c3c5ca74e9119ee1d7
[ "Apache-2.0" ]
17
2020-03-11T07:13:23.000Z
2022-03-01T19:23:20.000Z
// Copyright 2019 Gohilla Ltd. // // 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. import 'dart:async'; import 'package:collection/collection.dart'; import 'package:database/database.dart'; import 'package:database/database_adapter.dart'; import 'package:meta/meta.dart'; /// An adapter that enables caching of data (for example, in local memory). /// /// ## Example /// ``` /// import 'package:database/database.dart'; /// /// void main() { /// final database = CachingDatabaseAdapter( /// master: BrowserDatabaseAdapter(), /// cache: MemoryDatabaseAdapter(), /// ).database(); /// } /// ``` class CachingDatabaseAdapter extends DelegatingDatabaseAdapter { /// Master [Database]. final DatabaseAdapter master; /// Cache [Database]. final DatabaseAdapter cache; /// Whether to ignore [UnavailableException] from master and use cache /// results (or error) when this happen. The default is true. final bool useCacheWhenMasterUnavailable; CachingDatabaseAdapter({ @required this.master, @required this.cache, this.useCacheWhenMasterUnavailable = true, }) : super(master) { ArgumentError.checkNotNull(master, 'master'); ArgumentError.checkNotNull(cache, 'cache'); } @override Future<void> performDocumentDelete(DocumentDeleteRequest request) { cache.performDocumentDelete(request).catchError((_) {}); return super.performDocumentDelete(request); } @override Future<void> performDocumentDeleteBySearch( DocumentDeleteBySearchRequest request) { cache.performDocumentDeleteBySearch(request).catchError((_) {}); return super.performDocumentDeleteBySearch(request); } @override Stream<Snapshot> performDocumentRead( DocumentReadRequest request, ) async* { // Start master read final masterFuture = super.performDocumentRead(request).last; // Read from cache and yield it Snapshot cacheSnapshot; try { cacheSnapshot = await request.delegateTo(cache).last; } on DatabaseException { // Ignore } if (cacheSnapshot != null && cacheSnapshot.exists) { yield (cacheSnapshot); } // Finish master read and yield it final masterSnapshot = await masterFuture; yield (masterSnapshot); try { if (masterSnapshot.exists) { if (!const DeepCollectionEquality() .equals(cacheSnapshot?.data, masterSnapshot.data)) { // Master and cache snapshots are different. // Update cached version. await DocumentUpsertRequest( document: request.document, data: masterSnapshot.data, reach: request.reach, ).delegateTo(cache); } } else if (cacheSnapshot?.exists ?? false) { // Remove cached version. await DocumentDeleteRequest( document: request.document, mustExist: false, reach: request.reach, ).delegateTo(cache); } } on DatabaseException { // Ignore } } @override Stream<QueryResult> performDocumentSearch( DocumentSearchRequest request, ) async* { final masterFuture = request.delegateTo(master); final cacheSnapshot = await request.delegateTo(cache).last; yield (cacheSnapshot); final masterSnapshot = await masterFuture.last; yield (masterSnapshot); } @override Future<void> performDocumentTransaction(DocumentTransactionRequest request) { throw DatabaseException.transactionUnsupported(); } @override Future<void> performDocumentUpdate(DocumentUpdateRequest request) { DocumentDeleteRequest( document: request.document, mustExist: false, reach: request.reach, ).delegateTo(cache).catchError((_) {}); return super.performDocumentUpdate(request); } @override Future<void> performDocumentUpdateBySearch( DocumentUpdateBySearchRequest request) { DocumentDeleteBySearchRequest( collection: request.collection, query: request.query, reach: request.reach, ).delegateTo(cache).catchError((_) {}); return super.performDocumentUpdateBySearch(request); } @override Future<void> performDocumentUpsert(DocumentUpsertRequest request) { DocumentDeleteRequest( document: request.document, mustExist: false, reach: request.reach, ).delegateTo(cache).catchError((_) {}); return super.performDocumentUpsert(request); } }
30.265432
79
0.696308
ef5c0e1fb848a6a9751373fe2e4d74eab913cba7
2,214
js
JavaScript
chrome/test/data/webui/test_api.js
meego-tablet-ux/meego-app-browser
0f4ef17bd4b399c9c990a2f6ca939099495c2b9c
[ "BSD-3-Clause" ]
1
2015-10-12T09:14:22.000Z
2015-10-12T09:14:22.000Z
chrome/test/data/webui/test_api.js
meego-tablet-ux/meego-app-browser
0f4ef17bd4b399c9c990a2f6ca939099495c2b9c
[ "BSD-3-Clause" ]
null
null
null
chrome/test/data/webui/test_api.js
meego-tablet-ux/meego-app-browser
0f4ef17bd4b399c9c990a2f6ca939099495c2b9c
[ "BSD-3-Clause" ]
1
2020-11-04T07:22:28.000Z
2020-11-04T07:22:28.000Z
// Copyright (c) 2011 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. // Library providing basic test framework functionality. (function() { // Indicates a pass to the C++ backend. function pass() { chrome.send('Pass', []); } // Indicates a fail to the C++ backend. function fail(message) { chrome.send('Fail', [String(message)]); } // Asserts. // Use the following assertions to verify a condition within a test. // If assertion fails, the C++ backend will be immediately notified. // If assertion passes, no notification will be sent to the C++ backend. function assertBool(test, expected, message) { if (test !== expected) { if (message) message = test + '\n' + message; else message = test; throw new Error(message); } } function assertTrue(test, message) { assertBool(test, true, message); } function assertFalse(test, message) { assertBool(test, false, message); } function assertEquals(expected, actual, message) { if (expected !== actual) { throw new Error('Test Error in ' + testName(currentTest) + '\nActual: ' + actual + '\nExpected: ' + expected + '\n' + message); } if (typeof expected != typeof actual) { throw new Error('Test Error in ' + testName(currentTest) + ' (type mismatch)\nActual Type: ' + typeof actual + '\nExpected Type:' + typeof expected + '\n' + message); } } function assertNotReached(message) { throw new Error(message); } function runTest(currentTest) { try { console.log('Running test ' + currentTest.name); currentTest.call(); } catch (e) { console.error( 'Failed: ' + currentTest.name + '\nwith exception: ' + e.message); fail(e.message); return; } // All tests passed. pass(''); } // Exports. window.assertTrue = assertTrue; window.assertFalse = assertFalse; window.assertEquals = assertEquals; window.assertNotReached = assertNotReached; window.runTest = runTest; })();
27.333333
77
0.611563
25590037fee03780d8406df0237873984834928a
256
cs
C#
src/MvcClient/ImageGallery.MvcClient.ViewModels/OrderFrameViewModel.cs
VahidN/IdentityServerImageGallery
b160e21e5cb5f914808d4b7ad20b39794fda4c46
[ "Apache-2.0" ]
61
2018-09-02T11:29:24.000Z
2022-02-19T11:40:25.000Z
src/MvcClient/ImageGallery.MvcClient.ViewModels/OrderFrameViewModel.cs
VahidN/IdentityServerImageGallery
b160e21e5cb5f914808d4b7ad20b39794fda4c46
[ "Apache-2.0" ]
4
2018-12-18T15:10:31.000Z
2019-12-15T20:41:31.000Z
src/MvcClient/ImageGallery.MvcClient.ViewModels/OrderFrameViewModel.cs
VahidN/IdentityServerImageGallery
b160e21e5cb5f914808d4b7ad20b39794fda4c46
[ "Apache-2.0" ]
14
2018-09-21T17:32:36.000Z
2022-03-03T12:19:12.000Z
namespace ImageGallery.MvcClient.ViewModels { public class OrderFrameViewModel { public string Address { get; } = string.Empty; public OrderFrameViewModel(string address) { Address = address; } } }
19.692308
54
0.605469
0d398d0ab9cf47de9f622e459790f6c7aebced56
10,078
cs
C#
BCReaderDemo/BCReaderDemo/BCReaderDemo/CreateNewGroupPage.xaml.cs
LEADTOOLS/business-card-reader-demo-xamarin
fb45fbdaee5847f74f22bee55f6fe370548e5d9b
[ "AML", "RSA-MD" ]
3
2020-02-18T08:23:42.000Z
2021-06-16T08:49:19.000Z
BCReaderDemo/BCReaderDemo/BCReaderDemo/CreateNewGroupPage.xaml.cs
LEADTOOLS/business-card-reader-demo-xamarin
fb45fbdaee5847f74f22bee55f6fe370548e5d9b
[ "AML", "RSA-MD" ]
null
null
null
BCReaderDemo/BCReaderDemo/BCReaderDemo/CreateNewGroupPage.xaml.cs
LEADTOOLS/business-card-reader-demo-xamarin
fb45fbdaee5847f74f22bee55f6fe370548e5d9b
[ "AML", "RSA-MD" ]
1
2020-08-06T08:35:32.000Z
2020-08-06T08:35:32.000Z
// ************************************************************* // Copyright (c) 1991-2020 LEAD Technologies, Inc. // All Rights Reserved. // ************************************************************* using BCReaderDemo.Models; using BCReaderDemo.Utils; using Leadtools.Demos; using Rg.Plugins.Popup.Pages; using Rg.Plugins.Popup.Services; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Threading.Tasks; using Xamarin.Forms; using Xamarin.Forms.Xaml; namespace BCReaderDemo { [XamlCompilation(XamlCompilationOptions.Compile)] public partial class CreateNewGroupPage : PopupPage { private bool _preSelectedCardsAvailable = false; private ObservableCollection<GroupsPageItem> _itemsList; private ObservableCollection<GroupsPageItem> _filteredItemsList; public event EventHandler PageClosing; public CreateNewGroupPage(ObservableCollection<GroupsPageItem> itemsList, bool preSelectedCardsAvailable) { InitializeComponent(); #if __IOS__ HasSystemPadding = false; #endif _itemsList = itemsList; _preSelectedCardsAvailable = preSelectedCardsAvailable; RefreshListView(); } private async void RefreshListView(bool updateGroupsCounts = false) { if (updateGroupsCounts) { foreach (GroupsPageItem group in _itemsList) { ObservableCollection<ContactModel> groupContacts = new ObservableCollection<ContactModel>(HomePage.ContactCollection.Where(x => !string.IsNullOrEmpty(x.Group) && x.Group.Equals(group.GroupName))); group.Count = groupContacts.Count; } } // order collection items by group name _filteredItemsList = SortGroups(); if (!string.IsNullOrWhiteSpace(mainSearchBar.Text)) _filteredItemsList = await Task.Factory.StartNew(() => SearchGroups(mainSearchBar.Text)); GroupsListView.ItemsSource = null; GroupsListView.ItemsSource = _filteredItemsList; ResizeGroupsGridToFit(); } private void ResizeGroupsGridToFit() { Device.BeginInvokeOnMainThread(() => { int listViewDesiredHeight = _filteredItemsList.Count * GroupsListView.RowHeight; int groupsListViewMaxHeight = (int)(DemoUtilities.DisplayHeight - pageUpperControlsGrid.Height - PlatformsConstants.AdRowHeight - listViewHeaderRow.Height.Value - listViewHintRow.Height.Value); GroupsListView.HeightRequest = Math.Min(groupsListViewMaxHeight, GroupsListView.Height - (GroupsListView.Height - listViewDesiredHeight)); }); } private void BackButton_Tapped(object sender, EventArgs e) { OnPageClosing(); } protected override async void OnAppearing() { base.OnAppearing(); // Delay a bit, so the ad doesn't appear immediately await Task.Delay(1000); // Start the ads Ads.Start(); } protected override void OnDisappearing() { base.OnDisappearing(); // Stop the ads Ads.Stop(); } protected override bool OnBackButtonPressed() { OnPageClosing(); return true; } private async void OnPageClosing(bool closePage = true) { PageClosing?.Invoke(this, null); if (closePage) await PopupNavigation.Instance.PopAsync(); } private void SearchBarTextChanged(object sender, TextChangedEventArgs e) { RefreshListView(); } public ObservableCollection<GroupsPageItem> SearchGroups(string text) { ObservableCollection<GroupsPageItem> filteredList = new ObservableCollection<GroupsPageItem>(_itemsList.Where(x => x.GroupName.ToLower().Contains(text.ToLower()))); return filteredList; } private ObservableCollection<GroupsPageItem> SortGroups() { return new ObservableCollection<GroupsPageItem>(_itemsList.OrderBy(item => item.GroupName)); } private async void CreateGroupButton_Tapped(object sender, EventArgs e) { newGroupEntry.Unfocus(); if(string.IsNullOrWhiteSpace(newGroupEntry.Text)) { Device.BeginInvokeOnMainThread(() => HomePage.ShowMessage(notificationMessageView, "Please enter a valid group name")); return; } // Add new group to the group picker string items if (HomePage.CurrentAppData.GroupPickerItems.Items.Contains(newGroupEntry.Text)) { Device.BeginInvokeOnMainThread(() => HomePage.ShowMessage(notificationMessageView, "Group already exist")); return; } // deselect any previously selected group IEnumerable<GroupsPageItem> selectedItems = _itemsList.Where(x => x.IsSelected); foreach(GroupsPageItem item in selectedItems) { item.IsSelected = false; } HomePage.CurrentAppData.GroupPickerItems.AddItem(newGroupEntry.Text); GroupsPageItem newItem = new GroupsPageItem() { GroupName = newGroupEntry.Text, IsSelected = true }; _itemsList.Add(newItem); _filteredItemsList = SortGroups(); RefreshListView(); // Save the updated contact HomePage.Instance.SaveContactList(); if (_preSelectedCardsAvailable) { OnPageClosing(); } else { SelectCardsPage page = new SelectCardsPage(Utils.PredefinedActions.Group, newGroupEntry.Text, null, true, null); page.PageClosing += SelectCardsPage_PageClosing; await PopupNavigation.Instance.PushAsync(page); await PopupNavigation.Instance.RemovePageAsync(this, false); } } private void SelectCardsPage_PageClosing(object sender, EventArgs e) { OnPageClosing(false); } private async void DeleteGroupButton_Clicked(object sender, EventArgs e) { MenuItem menuItem = sender as MenuItem; GroupsPageItem groupItem = menuItem.CommandParameter as GroupsPageItem; if (groupItem != null) { var delete = await DisplayAlert("Delete Group", "Are you sure you want to delete this group?", "Yes", "Cancel"); if (delete) { HomePage.CurrentAppData.GroupPickerItems.DeleteItem(groupItem.GroupName); _itemsList.Remove(groupItem); _filteredItemsList.Remove(groupItem); RefreshListView(); } } } private void RenameGroupButton_Clicked(object sender, EventArgs e) { MenuItem menuItem = sender as MenuItem; GroupsPageItem groupItem = menuItem.CommandParameter as GroupsPageItem; if (groupItem != null) { groupItem.RenameGroup = true; RefreshListView(); } } private void RenameAcceptButton_Tapped(object sender, EventArgs e) { GroupsPageItem groupItem = (GroupsPageItem)(sender as Image).BindingContext; if (groupItem != null) { CustomEntry entry = ((sender as Image).Parent as Grid).Children[0] as CustomEntry; UpdateGroupName(groupItem, entry.Text); } } private void RenameCancelButton_Tapped(object sender, EventArgs e) { GroupsPageItem groupItem = (GroupsPageItem)(sender as Image).BindingContext; if (groupItem != null) { CustomEntry entry = ((sender as Image).Parent as Grid).Children[0] as CustomEntry; entry.Unfocus(); } } private void Entry_Focused(object sender, FocusEventArgs e) { // This is just a quick workaround to set the cursor to the end of the Entry field text. CustomEntry entry = sender as CustomEntry; string text = entry.Text; entry.Text = string.Empty; entry.Text = text; } private void Entry_Unfocused(object sender, FocusEventArgs e) { CustomEntry entry = sender as CustomEntry; GroupsPageItem groupItem = (GroupsPageItem)entry.BindingContext; if (groupItem != null) { groupItem.RenameGroup = false; RefreshListView(); } } private void Entry_Completed(object sender, EventArgs e) { CustomEntry entry = sender as CustomEntry; GroupsPageItem groupItem = (GroupsPageItem)entry.BindingContext; if (groupItem != null) UpdateGroupName(groupItem, entry.Text); } private async void UpdateGroupName(GroupsPageItem groupItem, string text) { // dont update the contacts if the user left the group name as is. if (!string.IsNullOrEmpty(text) && !text.Equals(groupItem.GroupName)) { // Update group picker string items HomePage.CurrentAppData.GroupPickerItems.SetItem(groupItem.GroupName, text); // We also need to update all contacts with the old group name to use the new name IEnumerable<ContactModel> groupContacts = HomePage.ContactCollection.Where(x => !string.IsNullOrEmpty(x.Group) && x.Group.Equals(groupItem.GroupName)); foreach (ContactModel contact in groupContacts) { contact.Group = text; } // Save the updated contact HomePage.Instance.SaveContactList(); groupItem.GroupName = text; _filteredItemsList = SortGroups(); if (!string.IsNullOrWhiteSpace(mainSearchBar.Text)) _filteredItemsList = await Task.Factory.StartNew(() => SearchGroups(mainSearchBar.Text)); } // This code will hide the rename cell and return the original one groupItem.RenameGroup = false; RefreshListView(); } } }
34.993056
211
0.630085
cd4193edd82ea0fd17a35499d86e66c3fc92f8e2
219
cs
C#
Exercises-Interfaces/8.MilitaryElite/Interfaces/ICommando.cs
giggals/Software-University
23ebecdc06911db80e1ed0d28ed27f58993f737a
[ "MIT" ]
null
null
null
Exercises-Interfaces/8.MilitaryElite/Interfaces/ICommando.cs
giggals/Software-University
23ebecdc06911db80e1ed0d28ed27f58993f737a
[ "MIT" ]
null
null
null
Exercises-Interfaces/8.MilitaryElite/Interfaces/ICommando.cs
giggals/Software-University
23ebecdc06911db80e1ed0d28ed27f58993f737a
[ "MIT" ]
null
null
null
using System; using System.Collections.Generic; using System.Text; public interface ICommando { List<string> Missions { get; set; } string MissionCode { get; set; } string MissionStade { get; set; } }
14.6
39
0.684932
f481bf412ffccc48137b7ad408b0b9cd7d9731ac
311
ts
TypeScript
apps/api/src/config/graphql/config.service.ts
huddle-up/huddle-up
cf747d91baf03c485a4642457034f0ba43b63d89
[ "MIT" ]
null
null
null
apps/api/src/config/graphql/config.service.ts
huddle-up/huddle-up
cf747d91baf03c485a4642457034f0ba43b63d89
[ "MIT" ]
null
null
null
apps/api/src/config/graphql/config.service.ts
huddle-up/huddle-up
cf747d91baf03c485a4642457034f0ba43b63d89
[ "MIT" ]
null
null
null
import { Injectable } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; @Injectable() export class GraphqlConfigService { constructor(private configService: ConfigService) {} get playground(): boolean { return Boolean(this.configService.get<boolean>('graphql.playground')); } }
25.916667
74
0.736334
af7aa26676f98adc34c9ceb35f062983c9cbc3bf
1,129
py
Python
dan/layers/affine_image.py
justusschock/deep_alignment_network_pytorch
2371715c2d79b754fede9dfb181957378aeb02d9
[ "BSD-2-Clause" ]
36
2019-03-05T20:41:01.000Z
2021-05-10T18:41:34.000Z
dan/layers/affine_image.py
BOOLMANOR/deep_alignment_network_pytorch
2371715c2d79b754fede9dfb181957378aeb02d9
[ "BSD-2-Clause" ]
5
2019-04-09T08:52:29.000Z
2020-10-21T15:05:33.000Z
dan/layers/affine_image.py
BOOLMANOR/deep_alignment_network_pytorch
2371715c2d79b754fede9dfb181957378aeb02d9
[ "BSD-2-Clause" ]
10
2019-05-21T12:16:51.000Z
2020-10-26T18:33:28.000Z
import torch class AffineImageTransformation(torch.nn.Module): """ Layer to transform an input image by a given affine transformation matrix """ def __init__(self, img_size: tuple): """ Parameters ---------- img_size : tuple the output image size """ super().__init__() self.img_size = img_size def forward(self, input_image, affine_params): """ Performs the actual transformation Parameters ---------- input_image : :class:`torch.Tensor` the image which should be transformed affine_params : :class:`torch.Tensor` the affine transformation matrix (of shape Nx6) Returns ------- :class:`torch.Tensor` the transformed image """ affine_params = affine_params.view(-1, 2, 3) affine_grid = torch.nn.functional.affine_grid( affine_params, (input_image.size( 0), input_image.size(1), *self.img_size)) return torch.nn.functional.grid_sample(input_image, affine_grid)
24.021277
77
0.576616
afddc361f0e6c200576ed6ed8260f87b601ff8ee
473
lua
Lua
projects/flower-extensions/flower-tasker/src/flower/tasker/AbortCommand.lua
rammie/Hanappe
9e084c478e104ac5669cb33c73516f0606ab93f3
[ "Apache-2.0" ]
null
null
null
projects/flower-extensions/flower-tasker/src/flower/tasker/AbortCommand.lua
rammie/Hanappe
9e084c478e104ac5669cb33c73516f0606ab93f3
[ "Apache-2.0" ]
null
null
null
projects/flower-extensions/flower-tasker/src/flower/tasker/AbortCommand.lua
rammie/Hanappe
9e084c478e104ac5669cb33c73516f0606ab93f3
[ "Apache-2.0" ]
null
null
null
---------------------------------------------------------------------------------------------------- -- TODO:LuaDoc ---------------------------------------------------------------------------------------------------- -- import local class = require "flower.class" local BaseCommand = require "flower.tasker.BaseCommand" -- class local AbortCommand = class(BaseCommand) --- -- TODO:LDoc function AbortCommand:executeInternal(context) return 1 end return AbortCommand
26.277778
100
0.435518
4d506e65ae42bf41670413b5af8d087fa924a153
890
lua
Lua
luaui/widgets/gui_spectate_selected.lua
techannihilation/TA
2b70333fd2617d0372cc0c9795f5f3b9c158205b
[ "CC-BY-4.0" ]
38
2017-01-20T08:12:28.000Z
2022-03-05T16:50:40.000Z
luaui/widgets/gui_spectate_selected.lua
techannihilation/TA
2b70333fd2617d0372cc0c9795f5f3b9c158205b
[ "CC-BY-4.0" ]
1,067
2016-12-09T20:14:49.000Z
2022-02-20T12:57:29.000Z
luaui/widgets/gui_spectate_selected.lua
techannihilation/TA
2b70333fd2617d0372cc0c9795f5f3b9c158205b
[ "CC-BY-4.0" ]
68
2016-12-10T09:20:25.000Z
2021-09-07T10:44:52.000Z
function widget:GetInfo() return { name = 'Spectate Selected', desc = 'Automatically spectates owner of selected unit', author = 'Niobium', version = '1.0', date = 'April 2011', license = 'GNU GPL v2', layer = 0, enabled = true } end local spGetSpectatingState = Spring.GetSpectatingState local spGetSelectedUnits = Spring.GetSelectedUnits local spGetUnitTeam = Spring.GetUnitTeam local spGetMyTeamID = Spring.GetMyTeamID local spSendCommands = Spring.SendCommands function widget:CommandsChanged() if spGetSpectatingState() then local selUnits = spGetSelectedUnits() if #selUnits > 0 then local selTeam = spGetUnitTeam(selUnits[1]) if selTeam ~= spGetMyTeamID() then spSendCommands('specteam ' .. selTeam) end end end end
27.8125
64
0.634831
db6a91478e8959ea9fc21fb417df08ea4e92cec0
631
php
PHP
app/Http/Controllers/ChapterController.php
nyatto-io/backend
1a3657deec7c66a5158823717711293be146c899
[ "MIT" ]
null
null
null
app/Http/Controllers/ChapterController.php
nyatto-io/backend
1a3657deec7c66a5158823717711293be146c899
[ "MIT" ]
null
null
null
app/Http/Controllers/ChapterController.php
nyatto-io/backend
1a3657deec7c66a5158823717711293be146c899
[ "MIT" ]
null
null
null
<?php namespace App\Http\Controllers; use App\Models\Chapter; use App\Models\Manga; use Illuminate\Http\Request; class ChapterController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index(Manga $manga) { return $manga->chapters()->get(); } /** * Display the specified resource. * * @param \App\Models\Chapter $chapter * @return \Illuminate\Http\Response */ public function show(Manga $manga, $id) { return $manga->chapters()->with('images.file')->get(); } }
19.71875
62
0.610143
c1bbe1e4496d08e00dde67ab2ac77b0963a911f2
794
lua
Lua
total-power-consumption.lua
ppx17/domoticz-scripts
c9837f971a7132904ad13ccad5ca0a4e3040550a
[ "MIT" ]
null
null
null
total-power-consumption.lua
ppx17/domoticz-scripts
c9837f971a7132904ad13ccad5ca0a4e3040550a
[ "MIT" ]
null
null
null
total-power-consumption.lua
ppx17/domoticz-scripts
c9837f971a7132904ad13ccad5ca0a4e3040550a
[ "MIT" ]
null
null
null
-- regluar expression that matches all power meter devices, BUT NOT the virtual power meter powerMeterRegex = "^.*%(watt%)$" -- find the idx property of your virtual power meter at /json.htm?type=devices totalConsumptionMeterId = 310 commandArray = {} tc=next(devicechanged) deviceChangedName=tostring(tc) if not deviceChangedName:match(powerMeterRegex) then -- not matching our power meter devices return commandArray end totalConsumption = 0 -- loop through all the devices for deviceName,deviceValue in pairs(otherdevices) do if deviceName:match(powerMeterRegex) then totalConsumption = totalConsumption + tonumber(otherdevices_svalues[deviceName]) end end commandArray['UpdateDevice'] = totalConsumptionMeterId .. "|0|" .. totalConsumption return commandArray
29.407407
91
0.775819
b15e45ebd98b5e0cb369efd18c74290e80eb5ffc
4,564
asm
Assembly
Transynther/x86/_processed/US/_ht_zr_un_/i7-7700_9_0xca.log_14418_1699.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/US/_ht_zr_un_/i7-7700_9_0xca.log_14418_1699.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/US/_ht_zr_un_/i7-7700_9_0xca.log_14418_1699.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: ret .global s_faulty_load s_faulty_load: push %r12 push %r15 push %r9 push %rax push %rdi push %rdx push %rsi // Load lea addresses_A+0x5f5c, %r15 clflush (%r15) nop nop nop nop cmp %rsi, %rsi movb (%r15), %al nop nop nop nop and $36727, %rdx // Store lea addresses_WT+0x141aa, %r15 clflush (%r15) nop nop nop nop nop inc %r12 movb $0x51, (%r15) nop nop nop nop and %rdi, %rdi // Store mov $0x90249000000097a, %r9 nop nop nop nop and %r12, %r12 movl $0x51525354, (%r9) nop nop nop nop add %rdx, %rdx // Faulty Load lea addresses_US+0x95ba, %rsi clflush (%rsi) nop nop nop and %r12, %r12 mov (%rsi), %rdx lea oracles, %r15 and $0xff, %rdx shlq $12, %rdx mov (%r15,%rdx,1), %rdx pop %rsi pop %rdx pop %rdi pop %rax pop %r9 pop %r15 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT'}} {'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_NC'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'5e': 2, '47': 1165, '00': 5536, '61': 7, '60': 6, 'd0': 7648, '62': 1, '80': 51, '5f': 2} 00 00 d0 d0 47 d0 00 00 d0 00 00 d0 d0 47 d0 d0 d0 47 d0 00 00 00 d0 00 d0 00 00 00 00 00 47 00 00 00 00 00 00 d0 d0 00 47 d0 d0 d0 d0 47 d0 d0 00 d0 00 47 00 d0 d0 d0 00 00 00 00 d0 d0 d0 00 00 d0 d0 d0 00 d0 d0 d0 47 d0 d0 00 d0 00 00 00 d0 d0 d0 d0 d0 d0 d0 d0 d0 d0 00 00 d0 d0 d0 d0 d0 d0 47 d0 47 00 47 d0 00 d0 d0 47 00 d0 d0 00 00 d0 d0 d0 d0 d0 d0 d0 d0 d0 d0 d0 00 d0 d0 00 00 00 d0 00 47 d0 d0 d0 d0 d0 00 47 d0 d0 47 d0 00 d0 d0 d0 d0 00 d0 00 00 d0 d0 d0 00 00 00 d0 00 47 d0 00 00 00 d0 00 d0 d0 00 00 d0 d0 00 00 00 47 d0 d0 d0 d0 00 d0 00 d0 00 d0 d0 d0 47 00 d0 00 d0 00 d0 d0 00 00 d0 47 47 d0 00 d0 00 47 d0 d0 47 00 d0 d0 d0 00 d0 d0 00 d0 00 d0 d0 d0 00 00 00 00 00 d0 d0 00 00 d0 00 00 47 d0 d0 d0 d0 00 d0 d0 d0 d0 d0 d0 00 d0 00 d0 47 d0 00 00 d0 d0 00 00 d0 00 d0 d0 d0 00 00 47 d0 00 00 d0 80 d0 00 d0 47 d0 d0 d0 00 00 d0 d0 00 00 d0 d0 00 d0 00 00 d0 d0 00 d0 d0 d0 00 d0 d0 00 d0 d0 d0 d0 00 00 d0 00 d0 00 00 d0 d0 d0 d0 d0 d0 d0 d0 00 d0 d0 d0 00 d0 d0 00 d0 d0 d0 d0 d0 00 00 00 d0 00 47 d0 d0 47 d0 00 00 00 d0 00 d0 00 d0 00 00 00 00 d0 00 00 d0 00 d0 d0 d0 d0 d0 d0 d0 d0 00 d0 d0 d0 00 00 d0 d0 47 d0 d0 d0 d0 00 d0 d0 d0 00 d0 d0 d0 47 d0 d0 d0 d0 d0 d0 00 00 00 00 00 d0 00 00 d0 d0 00 d0 d0 00 d0 d0 00 47 00 00 00 d0 d0 00 d0 d0 00 00 00 d0 d0 00 d0 00 00 00 d0 d0 00 00 00 d0 d0 00 d0 d0 d0 d0 d0 00 d0 d0 00 d0 d0 d0 d0 d0 d0 d0 d0 00 d0 00 00 00 00 00 d0 00 00 00 00 00 00 00 d0 00 d0 d0 00 d0 d0 d0 00 d0 00 00 d0 00 00 d0 47 d0 00 d0 00 00 00 00 00 00 00 00 00 d0 d0 00 d0 d0 d0 47 d0 d0 d0 00 80 00 00 d0 d0 d0 d0 d0 00 00 d0 d0 d0 d0 d0 00 80 00 d0 00 d0 d0 00 00 d0 00 47 d0 d0 d0 00 00 d0 d0 d0 d0 00 00 d0 d0 d0 d0 d0 00 d0 00 00 d0 00 d0 00 00 00 47 d0 00 47 00 00 00 d0 00 00 d0 d0 d0 d0 d0 d0 d0 d0 d0 00 00 d0 d0 d0 00 d0 d0 d0 00 d0 d0 d0 d0 d0 d0 00 00 00 00 d0 00 00 00 00 d0 d0 00 00 d0 d0 80 d0 00 00 d0 00 d0 d0 d0 d0 d0 00 00 d0 d0 d0 d0 00 d0 d0 00 d0 00 d0 00 00 47 d0 d0 d0 d0 00 d0 47 d0 d0 47 00 00 00 d0 d0 d0 00 00 00 d0 d0 d0 d0 d0 d0 d0 00 d0 00 00 47 d0 d0 d0 d0 d0 00 d0 00 47 d0 47 d0 d0 d0 d0 00 d0 00 00 00 47 d0 00 d0 d0 00 00 00 d0 00 d0 00 d0 00 00 d0 47 d0 00 d0 d0 00 00 47 d0 d0 d0 00 d0 d0 d0 00 d0 d0 80 d0 00 00 00 d0 00 d0 d0 00 d0 00 00 00 47 d0 00 00 d0 d0 d0 d0 00 d0 47 d0 00 00 00 d0 00 d0 00 47 00 d0 00 d0 d0 d0 00 d0 d0 d0 d0 d0 00 d0 00 d0 00 d0 d0 d0 d0 d0 00 00 d0 00 d0 00 d0 d0 d0 00 00 00 d0 d0 d0 d0 d0 d0 47 00 00 d0 00 00 d0 00 00 00 d0 d0 d0 d0 00 d0 d0 d0 d0 d0 d0 d0 00 00 d0 d0 00 47 d0 00 d0 d0 d0 d0 00 d0 00 00 d0 d0 d0 d0 d0 d0 d0 00 d0 d0 00 d0 d0 00 d0 00 00 d0 d0 00 d0 00 d0 d0 d0 d0 d0 d0 d0 00 d0 00 d0 d0 d0 d0 00 00 00 d0 d0 d0 d0 00 00 00 d0 d0 d0 d0 d0 47 00 d0 00 d0 00 00 d0 00 d0 d0 d0 d0 d0 00 d0 d0 00 00 d0 00 47 d0 d0 d0 00 00 47 d0 d0 d0 d0 d0 d0 00 d0 00 47 d0 00 d0 00 d0 00 00 d0 00 00 00 d0 00 d0 d0 d0 d0 00 00 d0 d0 d0 d0 d0 d0 00 00 00 d0 d0 00 00 d0 00 47 00 00 00 00 00 00 00 00 47 00 47 d0 47 d0 00 d0 00 00 00 00 d0 00 00 d0 00 d0 00 d0 d0 00 d0 d0 00 d0 00 d0 */
48.553191
2,999
0.652498
443c8ee4761244880c161ee31234d63fc34c202e
1,921
py
Python
uspto/pbd/document.py
Velpeo/uspto-opendata-python
fbfe292d0b9dd01e541744d654d051ede8b4ed9b
[ "MIT" ]
55
2017-10-26T19:46:57.000Z
2022-03-06T20:23:49.000Z
uspto/pbd/document.py
Velpeo/uspto-opendata-python
fbfe292d0b9dd01e541744d654d051ede8b4ed9b
[ "MIT" ]
13
2017-11-17T08:52:27.000Z
2019-06-01T13:37:42.000Z
uspto/pbd/document.py
Velpeo/uspto-opendata-python
fbfe292d0b9dd01e541744d654d051ede8b4ed9b
[ "MIT" ]
19
2017-11-08T04:16:21.000Z
2022-03-06T20:24:40.000Z
# -*- coding: utf-8 -*- # (c) 2017 Andreas Motl <andreas@ip-tools.org> import logging from uspto.util.document import GenericDocument logger = logging.getLogger(__name__) class UsptoPairBulkDataDocument(GenericDocument): XML_NAMESPACES = { 'pat': 'http://www.wipo.int/standards/XMLSchema/ST96/Patent', 'uscom': 'urn:us:gov:doc:uspto:common', 'uspat': 'urn:us:gov:doc:uspto:patent', 'com': 'http://www.wipo.int/standards/XMLSchema/ST96/Common', 'xsi': 'http://www.w3.org/2001/XMLSchema-instance' } XML_IDENTIFIER_XPATH_MAP = { 'application': '/uspat:PatentBulkData/uspat:PatentData' '/uspat:ApplicationData/uscom:ApplicationNumberText', 'publication': '/uspat:PatentBulkData/uspat:PatentData' '/uspat:PublishedDocumentData/uspat:ApplicationPublication/uspat:PatentPublicationIdentification/pat:PublicationNumber', 'patent': '/uspat:PatentBulkData/uspat:PatentData' '/uspat:ApplicationData/uspat:PatentGrantIdentification/pat:PatentNumber', } JSON_IDENTIFIER_JSONPOINTER_MAP = { 'application': '/PatentBulkData/0/applicationDataOrProsecutionHistoryDataOrPatentTermData/0' '/applicationNumberText/value', 'publication': '/PatentBulkData/0/applicationDataOrProsecutionHistoryDataOrPatentTermData/2' '/applicationPublication/patentPublicationIdentification/publicationNumber', 'patent': '/PatentBulkData/0/applicationDataOrProsecutionHistoryDataOrPatentTermData/0' '/patentGrantIdentification/patentNumber', } if __name__ == '__main__': import sys format = sys.argv[1] payload = open(sys.argv[2], 'r').read() data = {format: payload} document = UsptoPairBulkDataDocument(data=data) print('identifiers:', document.get_identifiers())
40.87234
143
0.680895
2bb1bc8292d93453b67c43687317c61c0d204a0d
2,854
swift
Swift
Classes/Views/Modular/AccessorizedLabelView.swift
starcraft3D/Meetpoint
ce81be0108bb0053c3d67ca3bbf051405df9e965
[ "Apache-2.0" ]
28
2018-08-16T12:25:49.000Z
2018-09-27T14:08:46.000Z
Classes/Views/Modular/AccessorizedLabelView.swift
mohsinalimat/Meetpoint
ce81be0108bb0053c3d67ca3bbf051405df9e965
[ "Apache-2.0" ]
null
null
null
Classes/Views/Modular/AccessorizedLabelView.swift
mohsinalimat/Meetpoint
ce81be0108bb0053c3d67ca3bbf051405df9e965
[ "Apache-2.0" ]
3
2018-08-19T13:09:24.000Z
2018-09-01T06:40:50.000Z
// // AccessorizedLabelView.swift // MeetPoint // // Created by PowerMobile Team on 16/09/2017. // Copyright © 2017 PowerMobile Team. All rights reserved. // import UIKit import PureLayout enum AccessoryImagePosition { case left case right } let AccessorizedLabelViewDefaultHeight: CGFloat = 20.0 class AccessorizedLabelView: UIView { // MARK: - Constants fileprivate var DefaultInset: CGFloat = 8.0 fileprivate var imageView: UIImageView! fileprivate var titleLabel: UILabel! fileprivate var imageViewLeftConstraint: NSLayoutConstraint! fileprivate var imageViewRightConstraint: NSLayoutConstraint! var image: UIImage! { didSet { imageView.image = image } } var title: String! { didSet { titleLabel.text = title } } var textColor: UIColor! = UIColor.secondaryLightTextColor(){ didSet { titleLabel.textColor = textColor } } var font: UIFont! = UIFont.montserratMediumFont(withSize: 14.0) { didSet { titleLabel.font = font } } var imagePosition: AccessoryImagePosition! { didSet { if imagePosition == .left { imageView.autoPinEdge(toSuperviewEdge: ALEdge.left) titleLabel.autoPinEdge(ALEdge.left, to: ALEdge.right, of: imageView, withOffset: DefaultInset) titleLabel.autoPinEdge(toSuperviewEdge: ALEdge.right) titleLabel.textAlignment = NSTextAlignment.left }else { imageView.autoPinEdge(toSuperviewEdge: ALEdge.right) titleLabel.autoPinEdge(ALEdge.right, to: ALEdge.left, of: imageView, withOffset: -DefaultInset) titleLabel.autoPinEdge(toSuperviewEdge: ALEdge.left) titleLabel.textAlignment = NSTextAlignment.right } } } // MARK: - Constructors required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) commonInit() } override init(frame: CGRect) { super.init(frame: frame) commonInit() } fileprivate func commonInit() { imageView = UIImageView.newAutoLayout() imageView.contentMode = UIViewContentMode.scaleAspectFit self.addSubview(imageView) imageView.autoSetDimensions(to: CGSize(width: 15.0, height: 15.0)) imageView.autoAlignAxis(toSuperviewAxis: ALAxis.horizontal) titleLabel = UILabel.newAutoLayout() titleLabel.font = font titleLabel.textColor = textColor self.addSubview(titleLabel) titleLabel.autoAlignAxis(toSuperviewAxis: ALAxis.horizontal) } }
26.924528
111
0.607919
2cc353fa410e03b4f6591d6f133993064384cadf
449
py
Python
gantt/migrations/0003_activity_progress.py
diacepanbimbo/colectivo_panal
0412be67f60dafb50138930dafb244cededf731c
[ "MIT" ]
null
null
null
gantt/migrations/0003_activity_progress.py
diacepanbimbo/colectivo_panal
0412be67f60dafb50138930dafb244cededf731c
[ "MIT" ]
null
null
null
gantt/migrations/0003_activity_progress.py
diacepanbimbo/colectivo_panal
0412be67f60dafb50138930dafb244cededf731c
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-02-10 03:02 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gantt', '0002_auto_20160209_2347'), ] operations = [ migrations.AddField( model_name='activity', name='progress', field=models.FloatField(default=0.0), ), ]
21.380952
49
0.612472
7adeb94577bdbd20964d88339b7fb7460a13b374
2,428
cs
C#
src/Sarif.Viewer.VisualStudio.Core/ErrorList/ColumnFilterer.cs
microsoft/sarif-visualstudio-extension
5f9b4651e958fbfec0eac5d2031491902897c1e4
[ "MIT" ]
18
2020-04-14T15:00:05.000Z
2022-03-18T21:09:38.000Z
src/Sarif.Viewer.VisualStudio/ErrorList/ColumnFilterer.cs
ConnectionMaster/sarif-visualstudio-extension
17eb68b795b824bd114499fa79cdc07cc4745afa
[ "MIT" ]
231
2019-05-09T15:54:35.000Z
2022-03-21T13:53:50.000Z
src/Sarif.Viewer.VisualStudio/ErrorList/ColumnFilterer.cs
ConnectionMaster/sarif-visualstudio-extension
17eb68b795b824bd114499fa79cdc07cc4745afa
[ "MIT" ]
15
2020-06-04T02:09:12.000Z
2022-01-13T03:25:51.000Z
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Collections.Generic; using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Interop; using Microsoft.VisualStudio.Shell.TableControl; namespace Microsoft.Sarif.Viewer.ErrorList { // This class allows the caller to filter specified values from specified columns. // It keeps track of which column/value pairs have been filtered, so that it only // does so once per column/value pair. The idea is that if the user ever checks the // box in the filter UI to show a certain value in a certain column, we should never // hide that column again. internal class ColumnFilterer { // The set of column/value pairs that have been filtered so far. private readonly HashSet<FilteredColumnValue> filteredColumnValues = new HashSet<FilteredColumnValue>(); private IWpfTableControl errorListTableControl; private IWpfTableControl ErrorListTableControl { get { ThreadHelper.ThrowIfNotOnUIThread(); if (this.errorListTableControl == null) { var errorList = ServiceProvider.GlobalProvider.GetService(typeof(SVsErrorList)) as IErrorList; if (errorList != null) { this.errorListTableControl = errorList.TableControl; } } return this.errorListTableControl; } } public void FilterOut(string columnName, string filteredValue) { ThreadHelper.ThrowIfNotOnUIThread(); var filteredColumnValue = new FilteredColumnValue(columnName, filteredValue); if (!this.filteredColumnValues.Contains(filteredColumnValue)) { ITableColumnDefinition categoryColumnDefinition = this.ErrorListTableControl.ColumnDefinitionManager.GetColumnDefinition(columnName); this.ErrorListTableControl.SetFilter( columnName, new ColumnHashSetFilter( categoryColumnDefinition, filteredValue)); this.filteredColumnValues.Add(filteredColumnValue); } } } }
37.9375
114
0.635502
8ea37166f1609ba6e493f12df751d4ce6b1b37f3
2,570
swift
Swift
Tweeter/postViewController.swift
aboudreauxa/Tweeter
3f098d9d8504a464d89f9f6c5d83ab792ca46469
[ "Apache-2.0" ]
null
null
null
Tweeter/postViewController.swift
aboudreauxa/Tweeter
3f098d9d8504a464d89f9f6c5d83ab792ca46469
[ "Apache-2.0" ]
1
2016-07-02T01:59:40.000Z
2016-07-05T22:24:00.000Z
Tweeter/postViewController.swift
aboudreauxa/Tweeter
3f098d9d8504a464d89f9f6c5d83ab792ca46469
[ "Apache-2.0" ]
null
null
null
// // postViewController.swift // Tweeter // // Created by Alexina Boudreaux-Allen on 6/29/16. // Copyright © 2016 Alexina Boudreaux-Allen. All rights reserved. // import UIKit import AFNetworking class postViewController: UIViewController, UITextViewDelegate { @IBOutlet weak var characterCount: UILabel! @IBOutlet weak var postText: UITextView! override func viewDidLoad() { super.viewDidLoad() postText.delegate = self // Do any additional setup after loading the view. let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(postViewController.dismissKeyboard)) view.addGestureRecognizer(tap) } @IBAction func onCancel(sender: AnyObject) { self.dismissViewControllerAnimated(true, completion: nil) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } @IBAction func onPost(sender: AnyObject) { let stringPost: String = self.postText.text TwitterClient.sharedInstance.post(stringPost) //self.performSegueWithIdentifier("cancelSegue", sender: nil) TwitterClient.sharedInstance.currentAccount({ (User: (User)) -> () in }, failure: { (error: NSError) -> () in print("error") }) } func dismissKeyboard() { //Causes the view (or one of its embedded text fields) to resign the first responder status. view.endEditing(true) } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { // Get the new view controller using segue.destinationViewController. // Pass the selected object to the new view controller. } */ func textView(textView: UITextView, shouldChangeTextInRange range: NSRange, replacementText text: String) -> Bool { let newLength = postText.text.characters.count - range.length //change the value of the label characterCount.text = String(newLength) //you can save this value to a global var //myCounter = newLength //return true to allow the change, if you want to limit the number of characters in the text field use something like return newLength < 140 // To just allow up to 25 characters return true } }
32.125
133
0.662257
a4601f2173b56173388705599e7ff6b914816c77
98
php
PHP
resources/views/detalles_especialistas/create.blade.php
branddcast/control_pacientes
69d5bf684e8555ad88087d3480e670679bfb426c
[ "MIT" ]
1
2019-01-19T00:50:49.000Z
2019-01-19T00:50:49.000Z
resources/views/detalles_especialistas/edit.blade.php
branddcast/control_pacientes
69d5bf684e8555ad88087d3480e670679bfb426c
[ "MIT" ]
null
null
null
resources/views/detalles_especialistas/edit.blade.php
branddcast/control_pacientes
69d5bf684e8555ad88087d3480e670679bfb426c
[ "MIT" ]
null
null
null
@extends('layouts.app') @section('content') @include('detalles_especialistas.fields') @endsection
19.6
41
0.77551
b03894890c5f131278ce44847380c4c8ad35e2fe
411
py
Python
FatherSon/HelloWorld2_source_code/listing_22-6.py
axetang/AxePython
3b517fa3123ce2e939680ad1ae14f7e602d446a6
[ "Apache-2.0" ]
1
2019-01-04T05:47:50.000Z
2019-01-04T05:47:50.000Z
FatherSon/HelloWorld2_source_code/listing_22-6.py
axetang/AxePython
3b517fa3123ce2e939680ad1ae14f7e602d446a6
[ "Apache-2.0" ]
null
null
null
FatherSon/HelloWorld2_source_code/listing_22-6.py
axetang/AxePython
3b517fa3123ce2e939680ad1ae14f7e602d446a6
[ "Apache-2.0" ]
null
null
null
# Listing_22-6.py # Copyright Warren & Csrter Sande, 2013 # Released under MIT license http://www.opensource.org/licenses/mit-license.php # Version $version ---------------------------- # Using pickle to store a list to a file import pickle my_list = ['Fred', 73, 'Hello there', 81.9876e-13] pickle_file = open('my_pickled_list.pkl', 'w') pickle.dump(my_list, pickle_file) pickle_file.close()
31.615385
82
0.664234
445fc9c2fbcc52252f1dece336d9634dde1a0676
32,563
py
Python
pysnmp_mibs/IPMROUTE-STD-MIB.py
jackjack821/pysnmp-mibs
9835ea0bb2420715caf4ee9aaa07d59bb263acd6
[ "BSD-2-Clause" ]
6
2017-04-21T13:48:08.000Z
2022-01-06T19:42:52.000Z
pysnmp_mibs/IPMROUTE-STD-MIB.py
jackjack821/pysnmp-mibs
9835ea0bb2420715caf4ee9aaa07d59bb263acd6
[ "BSD-2-Clause" ]
1
2020-05-05T16:42:25.000Z
2020-05-05T16:42:25.000Z
pysnmp_mibs/IPMROUTE-STD-MIB.py
jackjack821/pysnmp-mibs
9835ea0bb2420715caf4ee9aaa07d59bb263acd6
[ "BSD-2-Clause" ]
6
2020-02-08T20:28:49.000Z
2021-09-14T13:36:46.000Z
# # PySNMP MIB module IPMROUTE-STD-MIB (http://pysnmp.sf.net) # ASN.1 source http://mibs.snmplabs.com:80/asn1/IPMROUTE-STD-MIB # Produced by pysmi-0.0.7 at Sun Feb 14 00:18:06 2016 # On host bldfarm platform Linux version 4.1.13-100.fc21.x86_64 by user goose # Using Python version 3.5.0 (default, Jan 5 2016, 17:11:52) # ( OctetString, Integer, ObjectIdentifier, ) = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") ( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ( ValueSizeConstraint, ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection") ( IANAipMRouteProtocol, IANAipRouteProtocol, ) = mibBuilder.importSymbols("IANA-RTPROTO-MIB", "IANAipMRouteProtocol", "IANAipRouteProtocol") ( InterfaceIndexOrZero, InterfaceIndex, ) = mibBuilder.importSymbols("IF-MIB", "InterfaceIndexOrZero", "InterfaceIndex") ( SnmpAdminString, ) = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") ( ObjectGroup, ModuleCompliance, NotificationGroup, ) = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup") ( mib_2, TimeTicks, ModuleIdentity, Integer32, Counter32, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, Unsigned32, MibIdentifier, Gauge32, Counter64, Bits, NotificationType, IpAddress, ) = mibBuilder.importSymbols("SNMPv2-SMI", "mib-2", "TimeTicks", "ModuleIdentity", "Integer32", "Counter32", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "Unsigned32", "MibIdentifier", "Gauge32", "Counter64", "Bits", "NotificationType", "IpAddress") ( RowStatus, DisplayString, TruthValue, TextualConvention, ) = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "DisplayString", "TruthValue", "TextualConvention") ipMRouteStdMIB = ModuleIdentity((1, 3, 6, 1, 2, 1, 83)).setRevisions(("2000-09-22 00:00",)) if mibBuilder.loadTexts: ipMRouteStdMIB.setLastUpdated('200009220000Z') if mibBuilder.loadTexts: ipMRouteStdMIB.setOrganization('IETF IDMR Working Group') if mibBuilder.loadTexts: ipMRouteStdMIB.setContactInfo(' Dave Thaler\n Microsoft Corporation\n One Microsoft Way\n Redmond, WA 98052-6399\n US\n\n Phone: +1 425 703 8835\n EMail: dthaler@microsoft.com') if mibBuilder.loadTexts: ipMRouteStdMIB.setDescription('The MIB module for management of IP Multicast routing, but\n independent of the specific multicast routing protocol in\n use.') class LanguageTag(OctetString, TextualConvention): displayHint = '100a' subtypeSpec = OctetString.subtypeSpec+ValueSizeConstraint(1,100) ipMRouteMIBObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 83, 1)) ipMRoute = MibIdentifier((1, 3, 6, 1, 2, 1, 83, 1, 1)) ipMRouteEnable = MibScalar((1, 3, 6, 1, 2, 1, 83, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2),))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipMRouteEnable.setDescription('The enabled status of IP Multicast routing on this router.') ipMRouteEntryCount = MibScalar((1, 3, 6, 1, 2, 1, 83, 1, 1, 7), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteEntryCount.setDescription('The number of rows in the ipMRouteTable. This can be used\n to monitor the multicast routing table size.') ipMRouteTable = MibTable((1, 3, 6, 1, 2, 1, 83, 1, 1, 2), ) if mibBuilder.loadTexts: ipMRouteTable.setDescription('The (conceptual) table containing multicast routing\n information for IP datagrams sent by particular sources to\n the IP multicast groups known to this router.') ipMRouteEntry = MibTableRow((1, 3, 6, 1, 2, 1, 83, 1, 1, 2, 1), ).setIndexNames((0, "IPMROUTE-STD-MIB", "ipMRouteGroup"), (0, "IPMROUTE-STD-MIB", "ipMRouteSource"), (0, "IPMROUTE-STD-MIB", "ipMRouteSourceMask")) if mibBuilder.loadTexts: ipMRouteEntry.setDescription('An entry (conceptual row) containing the multicast routing\n information for IP datagrams from a particular source and\n addressed to a particular IP multicast group address.\n Discontinuities in counters in this entry can be detected by\n observing the value of ipMRouteUpTime.') ipMRouteGroup = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 2, 1, 1), IpAddress()) if mibBuilder.loadTexts: ipMRouteGroup.setDescription('The IP multicast group address for which this entry\n contains multicast routing information.') ipMRouteSource = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 2, 1, 2), IpAddress()) if mibBuilder.loadTexts: ipMRouteSource.setDescription('The network address which when combined with the\n corresponding value of ipMRouteSourceMask identifies the\n sources for which this entry contains multicast routing\n information.') ipMRouteSourceMask = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 2, 1, 3), IpAddress()) if mibBuilder.loadTexts: ipMRouteSourceMask.setDescription('The network mask which when combined with the corresponding\n value of ipMRouteSource identifies the sources for which\n this entry contains multicast routing information.') ipMRouteUpstreamNeighbor = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 2, 1, 4), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteUpstreamNeighbor.setDescription('The address of the upstream neighbor (e.g., RPF neighbor)\n from which IP datagrams from these sources to this multicast\n address are received, or 0.0.0.0 if the upstream neighbor is\n unknown (e.g., in CBT).') ipMRouteInIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 2, 1, 5), InterfaceIndexOrZero()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteInIfIndex.setDescription('The value of ifIndex for the interface on which IP\n datagrams sent by these sources to this multicast address\n are received. A value of 0 indicates that datagrams are not\n subject to an incoming interface check, but may be accepted\n on multiple interfaces (e.g., in CBT).') ipMRouteUpTime = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 2, 1, 6), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteUpTime.setDescription('The time since the multicast routing information\n represented by this entry was learned by the router.') ipMRouteExpiryTime = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 2, 1, 7), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteExpiryTime.setDescription('The minimum amount of time remaining before this entry will\n be aged out. The value 0 indicates that the entry is not\n subject to aging.') ipMRoutePkts = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 2, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRoutePkts.setDescription('The number of packets which this router has received from\n these sources and addressed to this multicast group\n address.') ipMRouteDifferentInIfPackets = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 2, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteDifferentInIfPackets.setDescription('The number of packets which this router has received from\n these sources and addressed to this multicast group address,\n which were dropped because they were not received on the\n interface indicated by ipMRouteInIfIndex. Packets which are\n not subject to an incoming interface check (e.g., using CBT)\n are not counted.') ipMRouteOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 2, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteOctets.setDescription('The number of octets contained in IP datagrams which were\n received from these sources and addressed to this multicast\n group address, and which were forwarded by this router.') ipMRouteProtocol = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 2, 1, 11), IANAipMRouteProtocol()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteProtocol.setDescription('The multicast routing protocol via which this multicast\n forwarding entry was learned.') ipMRouteRtProto = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 2, 1, 12), IANAipRouteProtocol()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteRtProto.setDescription('The routing mechanism via which the route used to find the\n upstream or parent interface for this multicast forwarding\n entry was learned. Inclusion of values for routing\n protocols is not intended to imply that those protocols need\n be supported.') ipMRouteRtAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 2, 1, 13), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteRtAddress.setDescription('The address portion of the route used to find the upstream\n or parent interface for this multicast forwarding entry.') ipMRouteRtMask = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 2, 1, 14), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteRtMask.setDescription('The mask associated with the route used to find the upstream\n or parent interface for this multicast forwarding entry.') ipMRouteRtType = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 2, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("unicast", 1), ("multicast", 2),))).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteRtType.setDescription('The reason the given route was placed in the (logical)\n multicast Routing Information Base (RIB). A value of\n unicast means that the route would normally be placed only\n in the unicast RIB, but was placed in the multicast RIB\n (instead or in addition) due to local configuration, such as\n when running PIM over RIP. A value of multicast means that\n\n\n\n\n\n the route was explicitly added to the multicast RIB by the\n routing protocol, such as DVMRP or Multiprotocol BGP.') ipMRouteHCOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 2, 1, 16), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteHCOctets.setDescription('The number of octets contained in IP datagrams which were\n received from these sources and addressed to this multicast\n group address, and which were forwarded by this router.\n This object is a 64-bit version of ipMRouteOctets.') ipMRouteNextHopTable = MibTable((1, 3, 6, 1, 2, 1, 83, 1, 1, 3), ) if mibBuilder.loadTexts: ipMRouteNextHopTable.setDescription('The (conceptual) table containing information on the next-\n hops on outgoing interfaces for routing IP multicast\n datagrams. Each entry is one of a list of next-hops on\n outgoing interfaces for particular sources sending to a\n particular multicast group address.') ipMRouteNextHopEntry = MibTableRow((1, 3, 6, 1, 2, 1, 83, 1, 1, 3, 1), ).setIndexNames((0, "IPMROUTE-STD-MIB", "ipMRouteNextHopGroup"), (0, "IPMROUTE-STD-MIB", "ipMRouteNextHopSource"), (0, "IPMROUTE-STD-MIB", "ipMRouteNextHopSourceMask"), (0, "IPMROUTE-STD-MIB", "ipMRouteNextHopIfIndex"), (0, "IPMROUTE-STD-MIB", "ipMRouteNextHopAddress")) if mibBuilder.loadTexts: ipMRouteNextHopEntry.setDescription('An entry (conceptual row) in the list of next-hops on\n outgoing interfaces to which IP multicast datagrams from\n particular sources to a IP multicast group address are\n routed. Discontinuities in counters in this entry can be\n detected by observing the value of ipMRouteUpTime.') ipMRouteNextHopGroup = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 3, 1, 1), IpAddress()) if mibBuilder.loadTexts: ipMRouteNextHopGroup.setDescription('The IP multicast group for which this entry specifies a\n next-hop on an outgoing interface.') ipMRouteNextHopSource = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 3, 1, 2), IpAddress()) if mibBuilder.loadTexts: ipMRouteNextHopSource.setDescription('The network address which when combined with the\n corresponding value of ipMRouteNextHopSourceMask identifies\n the sources for which this entry specifies a next-hop on an\n outgoing interface.') ipMRouteNextHopSourceMask = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 3, 1, 3), IpAddress()) if mibBuilder.loadTexts: ipMRouteNextHopSourceMask.setDescription('The network mask which when combined with the corresponding\n value of ipMRouteNextHopSource identifies the sources for\n which this entry specifies a next-hop on an outgoing\n interface.') ipMRouteNextHopIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 3, 1, 4), InterfaceIndex()) if mibBuilder.loadTexts: ipMRouteNextHopIfIndex.setDescription('The ifIndex value of the interface for the outgoing\n interface for this next-hop.') ipMRouteNextHopAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 3, 1, 5), IpAddress()) if mibBuilder.loadTexts: ipMRouteNextHopAddress.setDescription('The address of the next-hop specific to this entry. For\n most interfaces, this is identical to ipMRouteNextHopGroup.\n NBMA interfaces, however, may have multiple next-hop\n addresses out a single outgoing interface.') ipMRouteNextHopState = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 3, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("pruned", 1), ("forwarding", 2),))).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteNextHopState.setDescription("An indication of whether the outgoing interface and next-\n hop represented by this entry is currently being used to\n forward IP datagrams. The value 'forwarding' indicates it\n is currently being used; the value 'pruned' indicates it is\n not.") ipMRouteNextHopUpTime = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 3, 1, 7), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteNextHopUpTime.setDescription('The time since the multicast routing information\n represented by this entry was learned by the router.') ipMRouteNextHopExpiryTime = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 3, 1, 8), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteNextHopExpiryTime.setDescription('The minimum amount of time remaining before this entry will\n be aged out. If ipMRouteNextHopState is pruned(1), the\n remaining time until the prune expires and the state reverts\n to forwarding(2). Otherwise, the remaining time until this\n entry is removed from the table. The time remaining may be\n copied from ipMRouteExpiryTime if the protocol in use for\n this entry does not specify next-hop timers. The value 0\n\n\n\n\n\n indicates that the entry is not subject to aging.') ipMRouteNextHopClosestMemberHops = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 3, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteNextHopClosestMemberHops.setDescription('The minimum number of hops between this router and any\n member of this IP multicast group reached via this next-hop\n on this outgoing interface. Any IP multicast datagrams for\n the group which have a TTL less than this number of hops\n will not be forwarded to this next-hop.') ipMRouteNextHopProtocol = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 3, 1, 10), IANAipMRouteProtocol()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteNextHopProtocol.setDescription('The routing mechanism via which this next-hop was learned.') ipMRouteNextHopPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 3, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteNextHopPkts.setDescription('The number of packets which have been forwarded using this\n route.') ipMRouteInterfaceTable = MibTable((1, 3, 6, 1, 2, 1, 83, 1, 1, 4), ) if mibBuilder.loadTexts: ipMRouteInterfaceTable.setDescription('The (conceptual) table containing multicast routing\n information specific to interfaces.') ipMRouteInterfaceEntry = MibTableRow((1, 3, 6, 1, 2, 1, 83, 1, 1, 4, 1), ).setIndexNames((0, "IPMROUTE-STD-MIB", "ipMRouteInterfaceIfIndex")) if mibBuilder.loadTexts: ipMRouteInterfaceEntry.setDescription('An entry (conceptual row) containing the multicast routing\n information for a particular interface.') ipMRouteInterfaceIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 4, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: ipMRouteInterfaceIfIndex.setDescription('The ifIndex value of the interface for which this entry\n contains information.') ipMRouteInterfaceTtl = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 4, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipMRouteInterfaceTtl.setDescription('The datagram TTL threshold for the interface. Any IP\n multicast datagrams with a TTL less than this threshold will\n not be forwarded out the interface. The default value of 0\n means all multicast packets are forwarded out the\n interface.') ipMRouteInterfaceProtocol = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 4, 1, 3), IANAipMRouteProtocol()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteInterfaceProtocol.setDescription('The routing protocol running on this interface.') ipMRouteInterfaceRateLimit = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 4, 1, 4), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipMRouteInterfaceRateLimit.setDescription('The rate-limit, in kilobits per second, of forwarded\n multicast traffic on the interface. A rate-limit of 0\n indicates that no rate limiting is done.') ipMRouteInterfaceInMcastOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 4, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteInterfaceInMcastOctets.setDescription('The number of octets of multicast packets that have arrived\n on the interface, including framing characters. This object\n is similar to ifInOctets in the Interfaces MIB, except that\n only multicast packets are counted.') ipMRouteInterfaceOutMcastOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 4, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteInterfaceOutMcastOctets.setDescription('The number of octets of multicast packets that have been\n sent on the interface.') ipMRouteInterfaceHCInMcastOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 4, 1, 7), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteInterfaceHCInMcastOctets.setDescription('The number of octets of multicast packets that have arrived\n on the interface, including framing characters. This object\n is a 64-bit version of ipMRouteInterfaceInMcastOctets. It\n is similar to ifHCInOctets in the Interfaces MIB, except\n that only multicast packets are counted.') ipMRouteInterfaceHCOutMcastOctets = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 4, 1, 8), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipMRouteInterfaceHCOutMcastOctets.setDescription('The number of octets of multicast packets that have been\n\n\n\n\n\n sent on the interface. This object is a 64-bit version of\n ipMRouteInterfaceOutMcastOctets.') ipMRouteBoundaryTable = MibTable((1, 3, 6, 1, 2, 1, 83, 1, 1, 5), ) if mibBuilder.loadTexts: ipMRouteBoundaryTable.setDescription("The (conceptual) table listing the router's scoped\n multicast address boundaries.") ipMRouteBoundaryEntry = MibTableRow((1, 3, 6, 1, 2, 1, 83, 1, 1, 5, 1), ).setIndexNames((0, "IPMROUTE-STD-MIB", "ipMRouteBoundaryIfIndex"), (0, "IPMROUTE-STD-MIB", "ipMRouteBoundaryAddress"), (0, "IPMROUTE-STD-MIB", "ipMRouteBoundaryAddressMask")) if mibBuilder.loadTexts: ipMRouteBoundaryEntry.setDescription('An entry (conceptual row) in the ipMRouteBoundaryTable\n representing a scoped boundary.') ipMRouteBoundaryIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 5, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: ipMRouteBoundaryIfIndex.setDescription('The IfIndex value for the interface to which this boundary\n applies. Packets with a destination address in the\n associated address/mask range will not be forwarded out this\n interface.') ipMRouteBoundaryAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 5, 1, 2), IpAddress()) if mibBuilder.loadTexts: ipMRouteBoundaryAddress.setDescription('The group address which when combined with the\n corresponding value of ipMRouteBoundaryAddressMask\n identifies the group range for which the scoped boundary\n exists. Scoped addresses must come from the range 239.x.x.x\n as specified in RFC 2365.') ipMRouteBoundaryAddressMask = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 5, 1, 3), IpAddress()) if mibBuilder.loadTexts: ipMRouteBoundaryAddressMask.setDescription('The group address mask which when combined with the\n corresponding value of ipMRouteBoundaryAddress identifies\n the group range for which the scoped boundary exists.') ipMRouteBoundaryStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 5, 1, 4), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: ipMRouteBoundaryStatus.setDescription('The status of this row, by which new entries may be\n created, or old entries deleted from this table.') ipMRouteScopeNameTable = MibTable((1, 3, 6, 1, 2, 1, 83, 1, 1, 6), ) if mibBuilder.loadTexts: ipMRouteScopeNameTable.setDescription('The (conceptual) table listing the multicast scope names.') ipMRouteScopeNameEntry = MibTableRow((1, 3, 6, 1, 2, 1, 83, 1, 1, 6, 1), ).setIndexNames((0, "IPMROUTE-STD-MIB", "ipMRouteScopeNameAddress"), (0, "IPMROUTE-STD-MIB", "ipMRouteScopeNameAddressMask"), (1, "IPMROUTE-STD-MIB", "ipMRouteScopeNameLanguage")) if mibBuilder.loadTexts: ipMRouteScopeNameEntry.setDescription('An entry (conceptual row) in the ipMRouteScopeNameTable\n representing a multicast scope name.') ipMRouteScopeNameAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 6, 1, 1), IpAddress()) if mibBuilder.loadTexts: ipMRouteScopeNameAddress.setDescription('The group address which when combined with the\n corresponding value of ipMRouteScopeNameAddressMask\n identifies the group range associated with the multicast\n scope. Scoped addresses must come from the range\n 239.x.x.x.') ipMRouteScopeNameAddressMask = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 6, 1, 2), IpAddress()) if mibBuilder.loadTexts: ipMRouteScopeNameAddressMask.setDescription('The group address mask which when combined with the\n corresponding value of ipMRouteScopeNameAddress identifies\n the group range associated with the multicast scope.') ipMRouteScopeNameLanguage = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 6, 1, 3), LanguageTag()) if mibBuilder.loadTexts: ipMRouteScopeNameLanguage.setDescription('The RFC 1766-style language tag associated with the scope\n name.') ipMRouteScopeNameString = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 6, 1, 4), SnmpAdminString()).setMaxAccess("readcreate") if mibBuilder.loadTexts: ipMRouteScopeNameString.setDescription('The textual name associated with the multicast scope. The\n value of this object should be suitable for displaying to\n end-users, such as when allocating a multicast address in\n this scope. When no name is specified, the default value of\n this object should be the string 239.x.x.x/y with x and y\n replaced appropriately to describe the address and mask\n length associated with the scope.') ipMRouteScopeNameDefault = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 6, 1, 5), TruthValue().clone('false')).setMaxAccess("readcreate") if mibBuilder.loadTexts: ipMRouteScopeNameDefault.setDescription('If true, indicates a preference that the name in the\n following language should be used by applications if no name\n is available in a desired language.') ipMRouteScopeNameStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 83, 1, 1, 6, 1, 6), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: ipMRouteScopeNameStatus.setDescription('The status of this row, by which new entries may be\n created, or old entries deleted from this table.') ipMRouteMIBConformance = MibIdentifier((1, 3, 6, 1, 2, 1, 83, 2)) ipMRouteMIBCompliances = MibIdentifier((1, 3, 6, 1, 2, 1, 83, 2, 1)) ipMRouteMIBGroups = MibIdentifier((1, 3, 6, 1, 2, 1, 83, 2, 2)) ipMRouteMIBCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 83, 2, 1, 1)).setObjects(*(("IPMROUTE-STD-MIB", "ipMRouteMIBBasicGroup"), ("IPMROUTE-STD-MIB", "ipMRouteMIBRouteGroup"), ("IPMROUTE-STD-MIB", "ipMRouteMIBBoundaryGroup"), ("IPMROUTE-STD-MIB", "ipMRouteMIBHCInterfaceGroup"),)) if mibBuilder.loadTexts: ipMRouteMIBCompliance.setDescription('The compliance statement for the IP Multicast MIB.') ipMRouteMIBBasicGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 83, 2, 2, 1)).setObjects(*(("IPMROUTE-STD-MIB", "ipMRouteEnable"), ("IPMROUTE-STD-MIB", "ipMRouteEntryCount"), ("IPMROUTE-STD-MIB", "ipMRouteUpstreamNeighbor"), ("IPMROUTE-STD-MIB", "ipMRouteInIfIndex"), ("IPMROUTE-STD-MIB", "ipMRouteUpTime"), ("IPMROUTE-STD-MIB", "ipMRouteExpiryTime"), ("IPMROUTE-STD-MIB", "ipMRouteNextHopState"), ("IPMROUTE-STD-MIB", "ipMRouteNextHopUpTime"), ("IPMROUTE-STD-MIB", "ipMRouteNextHopExpiryTime"), ("IPMROUTE-STD-MIB", "ipMRouteNextHopProtocol"), ("IPMROUTE-STD-MIB", "ipMRouteNextHopPkts"), ("IPMROUTE-STD-MIB", "ipMRouteInterfaceTtl"), ("IPMROUTE-STD-MIB", "ipMRouteInterfaceProtocol"), ("IPMROUTE-STD-MIB", "ipMRouteInterfaceRateLimit"), ("IPMROUTE-STD-MIB", "ipMRouteInterfaceInMcastOctets"), ("IPMROUTE-STD-MIB", "ipMRouteInterfaceOutMcastOctets"), ("IPMROUTE-STD-MIB", "ipMRouteProtocol"),)) if mibBuilder.loadTexts: ipMRouteMIBBasicGroup.setDescription('A collection of objects to support basic management of IP\n Multicast routing.') ipMRouteMIBHopCountGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 83, 2, 2, 2)).setObjects(*(("IPMROUTE-STD-MIB", "ipMRouteNextHopClosestMemberHops"),)) if mibBuilder.loadTexts: ipMRouteMIBHopCountGroup.setDescription('A collection of objects to support management of the use of\n hop counts in IP Multicast routing.') ipMRouteMIBBoundaryGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 83, 2, 2, 3)).setObjects(*(("IPMROUTE-STD-MIB", "ipMRouteBoundaryStatus"), ("IPMROUTE-STD-MIB", "ipMRouteScopeNameString"), ("IPMROUTE-STD-MIB", "ipMRouteScopeNameDefault"), ("IPMROUTE-STD-MIB", "ipMRouteScopeNameStatus"),)) if mibBuilder.loadTexts: ipMRouteMIBBoundaryGroup.setDescription('A collection of objects to support management of scoped\n multicast address boundaries.') ipMRouteMIBPktsOutGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 83, 2, 2, 4)).setObjects(*(("IPMROUTE-STD-MIB", "ipMRouteNextHopPkts"),)) if mibBuilder.loadTexts: ipMRouteMIBPktsOutGroup.setDescription('A collection of objects to support management of packet\n counters for each outgoing interface entry of a route.') ipMRouteMIBHCInterfaceGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 83, 2, 2, 5)).setObjects(*(("IPMROUTE-STD-MIB", "ipMRouteInterfaceHCInMcastOctets"), ("IPMROUTE-STD-MIB", "ipMRouteInterfaceHCOutMcastOctets"), ("IPMROUTE-STD-MIB", "ipMRouteHCOctets"),)) if mibBuilder.loadTexts: ipMRouteMIBHCInterfaceGroup.setDescription('A collection of objects providing information specific to\n high speed (greater than 20,000,000 bits/second) network\n interfaces.') ipMRouteMIBRouteGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 83, 2, 2, 6)).setObjects(*(("IPMROUTE-STD-MIB", "ipMRouteRtProto"), ("IPMROUTE-STD-MIB", "ipMRouteRtAddress"), ("IPMROUTE-STD-MIB", "ipMRouteRtMask"), ("IPMROUTE-STD-MIB", "ipMRouteRtType"),)) if mibBuilder.loadTexts: ipMRouteMIBRouteGroup.setDescription('A collection of objects providing information on the\n relationship between multicast routing information, and the\n IP Forwarding Table.') ipMRouteMIBPktsGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 83, 2, 2, 7)).setObjects(*(("IPMROUTE-STD-MIB", "ipMRoutePkts"), ("IPMROUTE-STD-MIB", "ipMRouteDifferentInIfPackets"), ("IPMROUTE-STD-MIB", "ipMRouteOctets"),)) if mibBuilder.loadTexts: ipMRouteMIBPktsGroup.setDescription('A collection of objects to support management of packet\n counters for each forwarding entry.') mibBuilder.exportSymbols("IPMROUTE-STD-MIB", ipMRouteMIBConformance=ipMRouteMIBConformance, ipMRouteMIBPktsGroup=ipMRouteMIBPktsGroup, ipMRouteEntryCount=ipMRouteEntryCount, LanguageTag=LanguageTag, ipMRouteHCOctets=ipMRouteHCOctets, ipMRouteNextHopUpTime=ipMRouteNextHopUpTime, ipMRouteScopeNameTable=ipMRouteScopeNameTable, ipMRouteMIBBasicGroup=ipMRouteMIBBasicGroup, ipMRoutePkts=ipMRoutePkts, ipMRouteNextHopSource=ipMRouteNextHopSource, ipMRouteInterfaceRateLimit=ipMRouteInterfaceRateLimit, ipMRouteScopeNameDefault=ipMRouteScopeNameDefault, ipMRouteNextHopClosestMemberHops=ipMRouteNextHopClosestMemberHops, ipMRouteScopeNameAddress=ipMRouteScopeNameAddress, ipMRouteRtProto=ipMRouteRtProto, ipMRouteNextHopProtocol=ipMRouteNextHopProtocol, ipMRouteTable=ipMRouteTable, ipMRouteNextHopExpiryTime=ipMRouteNextHopExpiryTime, ipMRouteRtType=ipMRouteRtType, ipMRouteScopeNameEntry=ipMRouteScopeNameEntry, ipMRouteRtAddress=ipMRouteRtAddress, ipMRouteScopeNameString=ipMRouteScopeNameString, ipMRouteInterfaceProtocol=ipMRouteInterfaceProtocol, ipMRouteMIBCompliances=ipMRouteMIBCompliances, ipMRouteBoundaryTable=ipMRouteBoundaryTable, ipMRouteScopeNameStatus=ipMRouteScopeNameStatus, ipMRouteGroup=ipMRouteGroup, ipMRouteNextHopTable=ipMRouteNextHopTable, ipMRouteSource=ipMRouteSource, ipMRouteMIBHopCountGroup=ipMRouteMIBHopCountGroup, ipMRouteEntry=ipMRouteEntry, PYSNMP_MODULE_ID=ipMRouteStdMIB, ipMRouteExpiryTime=ipMRouteExpiryTime, ipMRouteBoundaryAddress=ipMRouteBoundaryAddress, ipMRouteMIBPktsOutGroup=ipMRouteMIBPktsOutGroup, ipMRouteSourceMask=ipMRouteSourceMask, ipMRouteNextHopSourceMask=ipMRouteNextHopSourceMask, ipMRouteInIfIndex=ipMRouteInIfIndex, ipMRouteScopeNameLanguage=ipMRouteScopeNameLanguage, ipMRouteOctets=ipMRouteOctets, ipMRouteNextHopPkts=ipMRouteNextHopPkts, ipMRouteNextHopAddress=ipMRouteNextHopAddress, ipMRouteNextHopState=ipMRouteNextHopState, ipMRouteMIBRouteGroup=ipMRouteMIBRouteGroup, ipMRouteBoundaryAddressMask=ipMRouteBoundaryAddressMask, ipMRouteRtMask=ipMRouteRtMask, ipMRouteInterfaceInMcastOctets=ipMRouteInterfaceInMcastOctets, ipMRouteBoundaryIfIndex=ipMRouteBoundaryIfIndex, ipMRouteProtocol=ipMRouteProtocol, ipMRouteNextHopIfIndex=ipMRouteNextHopIfIndex, ipMRouteMIBHCInterfaceGroup=ipMRouteMIBHCInterfaceGroup, ipMRouteDifferentInIfPackets=ipMRouteDifferentInIfPackets, ipMRouteInterfaceHCInMcastOctets=ipMRouteInterfaceHCInMcastOctets, ipMRouteNextHopEntry=ipMRouteNextHopEntry, ipMRouteInterfaceHCOutMcastOctets=ipMRouteInterfaceHCOutMcastOctets, ipMRouteBoundaryStatus=ipMRouteBoundaryStatus, ipMRouteEnable=ipMRouteEnable, ipMRouteMIBCompliance=ipMRouteMIBCompliance, ipMRouteInterfaceOutMcastOctets=ipMRouteInterfaceOutMcastOctets, ipMRouteNextHopGroup=ipMRouteNextHopGroup, ipMRouteInterfaceIfIndex=ipMRouteInterfaceIfIndex, ipMRouteInterfaceEntry=ipMRouteInterfaceEntry, ipMRouteStdMIB=ipMRouteStdMIB, ipMRouteInterfaceTable=ipMRouteInterfaceTable, ipMRouteUpstreamNeighbor=ipMRouteUpstreamNeighbor, ipMRouteUpTime=ipMRouteUpTime, ipMRouteScopeNameAddressMask=ipMRouteScopeNameAddressMask, ipMRoute=ipMRoute, ipMRouteInterfaceTtl=ipMRouteInterfaceTtl, ipMRouteMIBBoundaryGroup=ipMRouteMIBBoundaryGroup, ipMRouteMIBObjects=ipMRouteMIBObjects, ipMRouteBoundaryEntry=ipMRouteBoundaryEntry, ipMRouteMIBGroups=ipMRouteMIBGroups)
201.006173
3,289
0.746522
14733e1f2d24f016e7f5ce9b867efafe47c1eca9
362
ts
TypeScript
src/to-image.ts
jeetiss/image-fns
deea29c4f7790775888fe6a1264df83790f8a43f
[ "MIT" ]
4
2019-02-10T06:29:59.000Z
2019-04-05T10:51:50.000Z
src/to-image.ts
jeetiss/image-fns
deea29c4f7790775888fe6a1264df83790f8a43f
[ "MIT" ]
5
2019-02-07T14:44:29.000Z
2019-04-05T10:52:35.000Z
src/to-image.ts
jeetiss/image-fns
deea29c4f7790775888fe6a1264df83790f8a43f
[ "MIT" ]
1
2019-02-08T11:10:52.000Z
2019-02-08T11:10:52.000Z
import { Formats, getMimeType } from './supported-formats' const toImage = ( canvas: HTMLCanvasElement, options: { format?: Formats | string } ): HTMLImageElement => { const { format } = options const realImage = new Image() const mime = getMimeType(format) realImage.src = canvas.toDataURL(mime) return realImage } export default toImage
20.111111
58
0.698895
c136da14fa512498c82c9159fb63e6d60e4b5925
634
swift
Swift
programmers/42579/swift/gon125.swift
algorithm-everyday/algorithm-everyday
b79a34b4db626c15b540443b8c929edc21992e14
[ "MIT" ]
2
2021-03-29T14:30:39.000Z
2021-03-29T15:08:55.000Z
programmers/42579/swift/gon125.swift
algorithm-everyday/algorithm-everyday
b79a34b4db626c15b540443b8c929edc21992e14
[ "MIT" ]
50
2021-02-16T13:50:33.000Z
2021-06-15T04:33:46.000Z
programmers/42579/swift/gon125.swift
gon125/algorithm-everyday
b79a34b4db626c15b540443b8c929edc21992e14
[ "MIT" ]
5
2021-02-08T14:12:10.000Z
2021-02-24T13:21:22.000Z
import Foundation func solution(_ genres:[String], _ plays:[Int]) -> [Int] { var hashTable = [String: ([Int], count: Int)]() for song in plays.indices { if hashTable[genres[song]] == nil { hashTable[genres[song]] = ([Int](), count: 0) } hashTable[genres[song]]!.0.append(song) hashTable[genres[song]]!.count += plays[song] } for key in hashTable.keys { hashTable[key]!.0.sort { plays[$0] > plays[$1] || (plays[$0] == plays[$1] && $0 < $1) } } return hashTable.values.sorted { $0.count > $1.count }.flatMap { $0.0.prefix(2) } }
30.190476
85
0.531546
76a44b24965d81762ae03a6802a2b2e1ca052926
73
sql
SQL
scripts/impala/sql/count_store_sales_remainder.sql
umbrant/caching_benchmarking
53fc4159d02b7c979ed4f3c9ef633416448615aa
[ "Apache-2.0" ]
1
2017-12-11T18:37:21.000Z
2017-12-11T18:37:21.000Z
scripts/impala/sql/count_store_sales_remainder.sql
umbrant/caching_benchmarking
53fc4159d02b7c979ed4f3c9ef633416448615aa
[ "Apache-2.0" ]
null
null
null
scripts/impala/sql/count_store_sales_remainder.sql
umbrant/caching_benchmarking
53fc4159d02b7c979ed4f3c9ef633416448615aa
[ "Apache-2.0" ]
null
null
null
select count(*) from tpcds1000gb.store_sales where ss_date<'2002-11-22';
36.5
72
0.780822
79664680561389460cbf4a2366ddfb89e5fa1416
5,942
php
PHP
resources/views/vendor/adminlte/master.blade.php
egormalcev98/radioavtomat
649a52f45e1e8a942308596f8271e1b58be42bec
[ "MIT" ]
null
null
null
resources/views/vendor/adminlte/master.blade.php
egormalcev98/radioavtomat
649a52f45e1e8a942308596f8271e1b58be42bec
[ "MIT" ]
1
2021-02-02T19:49:26.000Z
2021-02-02T19:49:26.000Z
resources/views/vendor/adminlte/master.blade.php
egormalcev98/radioavtomat
649a52f45e1e8a942308596f8271e1b58be42bec
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="csrf-token" content="{{csrf_token()}}"> <title>@yield('title_prefix', config('adminlte.title_prefix', '')) @if($settings and $settings->name_sys) @yield('title', config($settings->name_sys, $settings->name_sys)) @else @yield('title', config('adminlte.title', 'AdminLTE 3')) @endif @yield('title_postfix', config('adminlte.title_postfix', ''))</title> @if(! config('adminlte.enabled_laravel_mix')) <link rel="stylesheet" href="{{ asset('vendor/fontawesome-free/css/all.min.css') }}"> <link rel="stylesheet" href="{{ asset('vendor/overlayScrollbars/css/OverlayScrollbars.min.css') }}"> @include('adminlte::plugins', ['type' => 'css']) @yield('adminlte_css_pre') <link rel="stylesheet" href="{{ asset('vendor/adminlte/dist/css/adminlte.min.css') }}"> @yield('adminlte_css') <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic"> @else <link rel="stylesheet" href="{{ mix('css/app.css') }}"> @endif @yield('meta_tags') @if(config('adminlte.use_ico_only')) <link rel="shortcut icon" href="{{ asset('favicons/favicon.ico') }}" /> @elseif(config('adminlte.use_full_favicon')) <link rel="shortcut icon" href="{{ asset('favicons/favicon.ico') }}" /> <link rel="apple-touch-icon" sizes="57x57" href="{{ asset('favicons/apple-icon-57x57.png') }}"> <link rel="apple-touch-icon" sizes="60x60" href="{{ asset('favicons/apple-icon-60x60.png') }}"> <link rel="apple-touch-icon" sizes="72x72" href="{{ asset('favicons/apple-icon-72x72.png') }}"> <link rel="apple-touch-icon" sizes="76x76" href="{{ asset('favicons/apple-icon-76x76.png') }}"> <link rel="apple-touch-icon" sizes="114x114" href="{{ asset('favicons/apple-icon-114x114.png') }}"> <link rel="apple-touch-icon" sizes="120x120" href="{{ asset('favicons/apple-icon-120x120.png') }}"> <link rel="apple-touch-icon" sizes="144x144" href="{{ asset('favicons/apple-icon-144x144.png') }}"> <link rel="apple-touch-icon" sizes="152x152" href="{{ asset('favicons/apple-icon-152x152.png') }}"> <link rel="apple-touch-icon" sizes="180x180" href="{{ asset('favicons/apple-icon-180x180.png') }}"> <link rel="icon" type="image/png" sizes="16x16" href="{{ asset('favicons/favicon-16x16.png') }}"> <link rel="icon" type="image/png" sizes="32x32" href="{{ asset('favicons/favicon-32x32.png') }}"> <link rel="icon" type="image/png" sizes="96x96" href="{{ asset('favicons/favicon-96x96.png') }}"> <link rel="icon" type="image/png" sizes="192x192" href="{{ asset('favicons/android-icon-192x192.png') }}"> <link rel="manifest" href="{{ asset('favicons/manifest.json') }}"> <meta name="msapplication-TileColor" content="#ffffff"> <meta name="msapplication-TileImage" content="{{ asset('favicon/ms-icon-144x144.png') }}"> @endif </head> <body class="@yield('classes_body')" @yield('body_data')> @yield('body') @include('crm.chat.widget') @include('crm.modal') @if(! config('adminlte.enabled_laravel_mix')) <script src="{{ asset('vendor/jquery/jquery.min.js') }}"></script> <script src="{{ asset('vendor/bootstrap/js/bootstrap.bundle.min.js') }}"></script> <script src="{{ asset('vendor/overlayScrollbars/js/jquery.overlayScrollbars.min.js') }}"></script> @include('adminlte::plugins', ['type' => 'js']) @if(auth()->check()) <script> // global app configuration object var config = { token: '{!! csrf_token() !!}', route: { chat_select_channel: '{{ route("chat.select_channel") }}', chat_read_msg: '{{ route("chat.read_msg") }}' } }; </script> <script src="https://js.pusher.com/5.0/pusher.min.js"></script> <script src="{{ asset('/js/plugins/controlmodal/control-modal.js?78') }}"></script> <script src="{{ asset('/js/plugins/masked/jquery.maskedinput.min.js') }}"></script> <script src="{{ asset('/js/main.js?58910') }}"></script> <script src="{{ asset('/js/chat.js?5') }}"></script> <script src="{{ asset('/js/date_range_picker.js') }}"></script> <script src="{{ asset('/js/task_global.js') }}"></script> <script> window.Pusher = new Pusher('{{ config("broadcasting.connections.pusher.key") }}', { wsHost: window.location.hostname, wsPort: {{ config('websockets.dashboard.port') }}, disableStats: true, authEndpoint: '/broadcasting/auth', auth: { headers: { 'X-CSRF-Token': config['token'] } } }); $(document).ready(function(){ $('#chat_users').change(function() { Chat.changeUser($(this), Pusher, {{ auth()->user()->id }}); }); $('#chat_structural_units').change(function() { Chat.changeStructuralUnit($(this), Pusher, {{ auth()->user()->id }}); }); Chat.selectedChannelAuthUser(Pusher, @if(auth()->user()->chat_channel) {!! auth()->user()->chat_channel !!} @else null @endif, {{ auth()->user()->id }}); }); var channel = Pusher.subscribe('private-user.{{ auth()->user()->id }}'); channel.bind('notifyNewMessage', function (data) { Chat.notifyNewMessage(data); }); channel.bind('updateCountNewMessages', function (data) { Chat.updateCountNewMessages(data); }); channel.bind('updateBell', function (data) { $('#notifications_bell').html(data['html']); }); channel.bind('todayJobs', function (data) { Main.popUp('<a href="' + data['rout'] + '">Перейти к задачам сегодня</a>', 'Ознакомтесь с задачами на сегодня'); // window.open(data['rout'], '_blank'); }); </script> @endif @yield('adminlte_js') @else <script src="{{ mix('js/app.js') }}"></script> @endif </body> </html>
40.421769
156
0.627903
e02a05bbc30f412eda5446414c977187f6807e69
572
h
C
DevelopmentIOS/Manager/Contact/ABPerson.h
liuboshuo/LSDevelopmentIOS
90ee7886f31cf3e8571e9dcb9dc7417e25362008
[ "MIT" ]
3
2016-09-26T08:36:58.000Z
2017-08-11T05:54:59.000Z
DevelopmentIOS/Manager/Contact/ABPerson.h
liuboshuo/LSDevelopmentIOS
90ee7886f31cf3e8571e9dcb9dc7417e25362008
[ "MIT" ]
null
null
null
DevelopmentIOS/Manager/Contact/ABPerson.h
liuboshuo/LSDevelopmentIOS
90ee7886f31cf3e8571e9dcb9dc7417e25362008
[ "MIT" ]
1
2018-09-05T07:05:17.000Z
2018-09-05T07:05:17.000Z
// // ABPersonModel.h // LSDevelopmentIOS // // Created by 刘硕 on 16/4/15. // Copyright © 2016年 liushuo. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import <AddressBook/AddressBook.h> @interface ABPerson : NSObject @property(nonatomic , assign)ABRecordID personId; @property(nonatomic , copy)NSString *name; @property(nonatomic , copy)NSString *phone; @property(nonatomic , strong)UIImage *image; -(instancetype)initWithId:(ABRecordID)personId name:(NSString *)name phone:(NSString *)phone image:(UIImage *)image; @end
20.428571
117
0.736014
46ccf3e004b85fcb622981bc020b326365c85229
451
py
Python
rgcn/data/aifb/strip_targets.py
PatriciaXiao/relational-gcn
9f90af3b325c04d28f934b367416b6b84a663a12
[ "MIT" ]
712
2018-02-20T18:37:35.000Z
2022-03-30T16:41:17.000Z
rgcn/data/aifb/strip_targets.py
miselico/relational-gcn
c6f29f0c9986d62e41176f9c66acb9f9f76557a0
[ "MIT" ]
22
2018-03-09T11:00:37.000Z
2022-02-15T12:50:30.000Z
rgcn/data/aifb/strip_targets.py
miselico/relational-gcn
c6f29f0c9986d62e41176f9c66acb9f9f76557a0
[ "MIT" ]
129
2018-02-20T18:37:36.000Z
2022-01-20T22:20:41.000Z
import rdflib as rdf import gzip g = rdf.Graph() g.parse('./aifb_fixed_complete.n3', format='n3') employs = rdf.term.URIRef("http://swrc.ontoware.org/ontology#employs") affiliation = rdf.term.URIRef("http://swrc.ontoware.org/ontology#affiliation") rels = set(g.predicates()) g.remove((None, employs, None)) g.remove((None, affiliation, None)) with gzip.open('aifb_stripped.nt.gz', 'wb') as output: g.serialize(output, format='nt') g.close()
23.736842
78
0.713969
38dbd67db80a0d2c3aed74921b1c030094f2b5ba
5,796
php
PHP
vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/CheckboxTypeTest.php
Fenozo/symfony-ecom
62cc7828ca6102d08f41ea86ac116baa43cbc3f1
[ "MIT" ]
null
null
null
vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/CheckboxTypeTest.php
Fenozo/symfony-ecom
62cc7828ca6102d08f41ea86ac116baa43cbc3f1
[ "MIT" ]
null
null
null
vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/CheckboxTypeTest.php
Fenozo/symfony-ecom
62cc7828ca6102d08f41ea86ac116baa43cbc3f1
[ "MIT" ]
2
2020-11-04T03:03:26.000Z
2020-11-05T08:14:20.000Z
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Form\Tests\Extension\Core\Type; use Symfony\Component\Form\CallbackTransformer; class CheckboxTypeTest extends BaseTypeTest { const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\CheckboxType'; /** * @group legacy */ public function testLegacyName() { $form = $this->factory->create('checkbox'); $this->assertSame('checkbox', $form->getConfig()->getType()->getName()); } public function testDataIsFalseByDefault() { $form = $this->factory->create(static::TESTED_TYPE); $this->assertFalse($form->getData()); $this->assertFalse($form->getNormData()); $this->assertNull($form->getViewData()); } public function testPassValueToView() { $view = $this->factory->create(static::TESTED_TYPE, null, array('value' => 'foobar')) ->createView(); $this->assertEquals('foobar', $view->vars['value']); } public function testCheckedIfDataTrue() { $view = $this->factory->create(static::TESTED_TYPE) ->setData(true) ->createView(); $this->assertTrue($view->vars['checked']); } public function testCheckedIfDataTrueWithEmptyValue() { $view = $this->factory->create(static::TESTED_TYPE, null, array('value' => '')) ->setData(true) ->createView(); $this->assertTrue($view->vars['checked']); } public function testNotCheckedIfDataFalse() { $view = $this->factory->create(static::TESTED_TYPE) ->setData(false) ->createView(); $this->assertFalse($view->vars['checked']); } public function testSubmitWithValueChecked() { $form = $this->factory->create(static::TESTED_TYPE, null, array( 'value' => 'foobar', )); $form->submit('foobar'); $this->assertTrue($form->getData()); $this->assertEquals('foobar', $form->getViewData()); } public function testSubmitWithRandomValueChecked() { $form = $this->factory->create(static::TESTED_TYPE, null, array( 'value' => 'foobar', )); $form->submit('krixikraxi'); $this->assertTrue($form->getData()); $this->assertEquals('foobar', $form->getViewData()); } public function testSubmitWithValueUnchecked() { $form = $this->factory->create(static::TESTED_TYPE, null, array( 'value' => 'foobar', )); $form->submit(null); $this->assertFalse($form->getData()); $this->assertNull($form->getViewData()); } public function testSubmitWithEmptyValueChecked() { $form = $this->factory->create(static::TESTED_TYPE, null, array( 'value' => '', )); $form->submit(''); $this->assertTrue($form->getData()); $this->assertSame('', $form->getViewData()); } public function testSubmitWithEmptyValueUnchecked() { $form = $this->factory->create(static::TESTED_TYPE, null, array( 'value' => '', )); $form->submit(null); $this->assertFalse($form->getData()); $this->assertNull($form->getViewData()); } public function testSubmitWithEmptyValueAndFalseUnchecked() { $form = $this->factory->create(static::TESTED_TYPE, null, array( 'value' => '', )); $form->submit(false); $this->assertFalse($form->getData()); $this->assertNull($form->getViewData()); } public function testSubmitWithEmptyValueAndTrueChecked() { $form = $this->factory->create(static::TESTED_TYPE, null, array( 'value' => '', )); $form->submit(true); $this->assertTrue($form->getData()); $this->assertSame('', $form->getViewData()); } /** * @dataProvider provideCustomModelTransformerData */ public function testCustomModelTransformer($data, $checked) { // present a binary status field as a checkbox $transformer = new CallbackTransformer( function ($value) { return 'checked' == $value; }, function ($value) { return $value ? 'checked' : 'unchecked'; } ); $form = $this->factory->createBuilder(static::TESTED_TYPE) ->addModelTransformer($transformer) ->getForm(); $form->setData($data); $view = $form->createView(); $this->assertSame($data, $form->getData()); $this->assertSame($checked, $form->getNormData()); $this->assertEquals($checked, $view->vars['checked']); } public function provideCustomModelTransformerData() { return array( array('checked', true), array('unchecked', false), ); } public function testSubmitNull($expected = null, $norm = null, $view = null) { parent::testSubmitNull(false, false, null); } public function testSubmitNullUsesDefaultEmptyData($emptyData = 'empty', $expectedData = true) { $form = $this->factory->create(static::TESTED_TYPE, null, array( 'empty_data' => $emptyData, )); $form->submit(null); // view data is transformed to the string true value $this->assertSame('1', $form->getViewData()); $this->assertSame($expectedData, $form->getNormData()); $this->assertSame($expectedData, $form->getData()); } }
28.411765
98
0.575569
3585f844fa75b2003a8b103f126786985d4ce34e
7,662
kt
Kotlin
src/test/kotlin/no/nav/familie/ef/sak/service/VedtaksbrevServiceTest.kt
blommish/familie-ef-sak
0e850df593c82a910c68c2393e6d2f30fc49eaa7
[ "MIT" ]
null
null
null
src/test/kotlin/no/nav/familie/ef/sak/service/VedtaksbrevServiceTest.kt
blommish/familie-ef-sak
0e850df593c82a910c68c2393e6d2f30fc49eaa7
[ "MIT" ]
null
null
null
src/test/kotlin/no/nav/familie/ef/sak/service/VedtaksbrevServiceTest.kt
blommish/familie-ef-sak
0e850df593c82a910c68c2393e6d2f30fc49eaa7
[ "MIT" ]
null
null
null
package no.nav.familie.ef.sak.service import io.mockk.every import io.mockk.mockk import io.mockk.slot import io.mockk.verify import no.nav.familie.ef.sak.OppslagSpringRunnerTest import no.nav.familie.ef.sak.integration.FamilieIntegrasjonerClient import no.nav.familie.ef.sak.integration.JournalpostClient import no.nav.familie.ef.sak.integration.dto.familie.Arbeidsfordelingsenhet import no.nav.familie.ef.sak.no.nav.familie.ef.sak.repository.behandling import no.nav.familie.ef.sak.no.nav.familie.ef.sak.repository.fagsak import no.nav.familie.ef.sak.repository.BehandlingRepository import no.nav.familie.ef.sak.repository.FagsakRepository import no.nav.familie.ef.sak.repository.VedtaksbrevRepository import no.nav.familie.ef.sak.repository.domain.FagsakPerson import no.nav.familie.ef.sak.repository.domain.Fil import no.nav.familie.ef.sak.repository.domain.Vedtaksbrev import no.nav.familie.ef.sak.repository.findByIdOrThrow import no.nav.familie.ef.sak.vedtaksbrev.BrevClient import no.nav.familie.kontrakter.felles.dokarkiv.ArkiverDokumentRequest import no.nav.familie.kontrakter.felles.dokarkiv.ArkiverDokumentResponse import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.springframework.beans.factory.annotation.Autowired import java.lang.IllegalStateException import java.util.* internal class VedtaksbrevServiceTest : OppslagSpringRunnerTest() { @Autowired lateinit var vedtaksbrevService: VedtaksbrevService @Autowired private lateinit var fagsakRepository: FagsakRepository @Autowired private lateinit var behandlingRepository: BehandlingRepository @Autowired private lateinit var vedtaksbrevRepository: VedtaksbrevRepository val brevClientMock = mockk<BrevClient>() val behandlingServiceMock = mockk<BehandlingService>() val fagsakServiceMock = mockk<FagsakService>() val personServiceMock = mockk<PersonService>() val journalpostClientMock = mockk<JournalpostClient>() val arbeidsfordelingServiceMock = mockk<ArbeidsfordelingService>() val vedtaksbrevRepositoryMock = mockk<VedtaksbrevRepository>() val familieIntegrasjonerClientMock = mockk<FamilieIntegrasjonerClient>() private val fagsak = fagsak(setOf(FagsakPerson(""))) private val behandling = behandling(fagsak) internal fun lagServiceMedMocker() = VedtaksbrevService(brevClientMock, vedtaksbrevRepositoryMock, behandlingServiceMock, fagsakServiceMock, personServiceMock, journalpostClientMock, arbeidsfordelingServiceMock, familieIntegrasjonerClientMock) @BeforeEach internal fun setUp() { fagsakRepository.insert(fagsak) behandlingRepository.insert(behandling) } @Test fun `skal ikke kunne lage endelig brev hvis utkast ikke finnes`() { assertThrows<IllegalStateException> { vedtaksbrevService.lagreEndeligBrev(behandlingId = behandling.id) } } @Test fun `skal lage endelig brev basert på utkast`() { val utkast = vedtaksbrevService.lagreBrevUtkast(behandlingId = behandling.id) val endelig = vedtaksbrevService.lagreEndeligBrev(behandlingId = behandling.id) assertThat(utkast).usingRecursiveComparison().ignoringFields("brevRequest", "pdf").isEqualTo(endelig) assertThat(utkast.utkastBrevRequest).usingRecursiveComparison() .ignoringFields("signaturBeslutter") .isEqualTo(endelig.brevRequest) } @Test fun `utkast skal lagres i databasen`() { val utkast = vedtaksbrevService.lagreBrevUtkast(behandlingId = behandling.id) val forventetRequest = vedtaksbrevService.lagBrevRequest(behandlingId = behandling.id) assertThat(utkast).isEqualTo(vedtaksbrevRepository.findByIdOrThrow(behandling.id)) assertThat(forventetRequest).isEqualTo(vedtaksbrevRepository.findByIdOrThrow(behandling.id).utkastBrevRequest) assertThat(vedtaksbrevRepository.findByIdOrThrow(behandling.id).utkastPdf).isNotNull } @Test fun `endelig brev skal lagres i databasen`() { vedtaksbrevService.lagreBrevUtkast(behandlingId = behandling.id) val endelig = vedtaksbrevService.lagreEndeligBrev(behandlingId = behandling.id) assertThat(endelig).isEqualTo(vedtaksbrevRepository.findByIdOrThrow(behandling.id)) assertThat(vedtaksbrevRepository.findByIdOrThrow(behandling.id).pdf).isNotNull } @Test fun `endelig brev skal ikke lagres ved generering av utkast`() { vedtaksbrevService.lagreBrevUtkast(behandlingId = behandling.id) assertThat(vedtaksbrevRepository.findByIdOrThrow(behandling.id).brevRequest).isNull() assertThat(vedtaksbrevRepository.findByIdOrThrow(behandling.id).pdf).isNull() } @Test internal fun `skal journalføre vedtaksbrev`() { val brevClient = mockk<BrevClient>() val behandlingService = mockk<BehandlingService>() val fagsakService = mockk<FagsakService>() val personService = mockk<PersonService>() val journalpostClient = mockk<JournalpostClient>() val arbeidsfordelingService = mockk<ArbeidsfordelingService>() val vedtaksbrevRepository = mockk<VedtaksbrevRepository>() val familieIntegrasjonerClient = mockk<FamilieIntegrasjonerClient>() val vedtaksbrev = Vedtaksbrev(behandling.id, mockk(), null, Fil("123".toByteArray()), Fil("123".toByteArray())) val vedtaksbrevService = VedtaksbrevService(brevClient, vedtaksbrevRepository, behandlingService, fagsakService, personService, journalpostClient, arbeidsfordelingService, familieIntegrasjonerClient) val arkiverDokumentRequestSlot = slot<ArkiverDokumentRequest>() every { arbeidsfordelingService.hentNavEnhet(any()) } returns Arbeidsfordelingsenhet("4321", "enhetNavn") every { fagsakService.hentFaksakForBehandling(behandling.id) } returns fagsak every { vedtaksbrevRepository.findById(behandling.id) } returns Optional.of(vedtaksbrev) every { journalpostClient.arkiverDokument(capture(arkiverDokumentRequestSlot)) } returns ArkiverDokumentResponse("1234", true) vedtaksbrevService.journalførVedtaksbrev(behandling.id) assertThat(arkiverDokumentRequestSlot.captured.fnr).isEqualTo(fagsak.hentAktivIdent()) assertThat(arkiverDokumentRequestSlot.captured.fagsakId).isEqualTo(fagsak.eksternId.id.toString()) } @Test internal fun `distribuerBrev skal distribuere brev`() { val journalpostId = "5555" val vedtaksbrevService = lagServiceMedMocker() every { familieIntegrasjonerClientMock.distribuerBrev(any()) } returns "9876" vedtaksbrevService.distribuerVedtaksbrev(behandling.id, journalpostId) verify { familieIntegrasjonerClientMock.distribuerBrev(journalpostId) } } }
47.590062
119
0.694466
e82d09cbe3b7e5dc07e2556be9866e106373afb3
1,425
cs
C#
Projet-Tangram/Assets/UMI3D SDK/environment dev kit/Editor/Object/UIImageEditor.cs
UMI3D/UMI3D-Tangram
355137e2131ccaaa62010953d72e0f560245465c
[ "Apache-2.0" ]
null
null
null
Projet-Tangram/Assets/UMI3D SDK/environment dev kit/Editor/Object/UIImageEditor.cs
UMI3D/UMI3D-Tangram
355137e2131ccaaa62010953d72e0f560245465c
[ "Apache-2.0" ]
null
null
null
Projet-Tangram/Assets/UMI3D SDK/environment dev kit/Editor/Object/UIImageEditor.cs
UMI3D/UMI3D-Tangram
355137e2131ccaaa62010953d72e0f560245465c
[ "Apache-2.0" ]
null
null
null
/* Copyright 2019 Gfi Informatique 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. */ #if UNITY_EDITOR using UnityEngine; using UnityEditor; using System.Reflection; using UnityEditorInternal; using umi3d.edk; using umi3d.common; namespace umi3d.edk.editor { [CustomEditor(typeof(umi3d.edk.UIImage), true)] [CanEditMultipleObjects] public class UIImageEditor : GenericObject3DEditor { SerializedProperty Resource; protected override void OnEnable() { base.OnEnable(); Resource = serializedObject.FindProperty("sprite"); } public override void OnInspectorGUI() { base.OnInspectorGUI(); EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(Resource, true); if (EditorGUI.EndChangeCheck()) { serializedObject.ApplyModifiedProperties(); } } } } #endif
27.403846
72
0.690526
974bebcfca794dd3f010f09e3f581db53ce4c743
945
rb
Ruby
spec/acceptance/ambari_agent_class_spec.rb
disaster37/puppet-hm_ambari
6717ee3a6e30416e5d3008389e688d28b1cc4ad2
[ "MIT" ]
null
null
null
spec/acceptance/ambari_agent_class_spec.rb
disaster37/puppet-hm_ambari
6717ee3a6e30416e5d3008389e688d28b1cc4ad2
[ "MIT" ]
null
null
null
spec/acceptance/ambari_agent_class_spec.rb
disaster37/puppet-hm_ambari
6717ee3a6e30416e5d3008389e688d28b1cc4ad2
[ "MIT" ]
null
null
null
require 'spec_helper_acceptance' apply_manifest_opts = { catch_failures: true, debug: true, trace: true, } describe 'ambari agent class:' do describe 'Deploy ambari agent' do it 'runs successfully' do pp = <<-EOS class { 'hm_ambari::agent': } EOS result = apply_manifest(pp, apply_manifest_opts) expect(result.exit_code).to eq 2 end describe package('java-1.8.0-openjdk-devel') do it { is_expected.to be_installed } end describe package('ambari-agent') do it { is_expected.to be_installed } end describe file('/etc/yum.repos.d/ambari.repo') do it { is_expected.to be_file } end describe file('/etc/ambari-agent/conf/ambari-agent.ini') do it { is_expected.to contain 'PROTOCOL_TLSv1_2' } end describe service('ambari-agent') do it { is_expected.to be_enabled } it { is_expected.to be_running } end end end
23.04878
63
0.648677
da7fee6bcf3aee4d2c41e6cc8e371f587a62ccbc
112
ts
TypeScript
src/environments/environment.prod.ts
feredean/node-api-starter-angular-app
8bca1330a6f9285e3d3b55b7d7894c161ac6ac44
[ "MIT" ]
8
2019-10-14T13:36:48.000Z
2020-10-21T20:18:53.000Z
src/environments/environment.prod.ts
feredean/node-api-starter-angular-app
8bca1330a6f9285e3d3b55b7d7894c161ac6ac44
[ "MIT" ]
14
2019-10-11T13:27:00.000Z
2021-05-09T05:12:41.000Z
src/environments/environment.prod.ts
feredean/node-api-starter-angular-app
8bca1330a6f9285e3d3b55b7d7894c161ac6ac44
[ "MIT" ]
1
2021-07-03T13:14:45.000Z
2021-07-03T13:14:45.000Z
export const environment = { API: 'https://node-api-starter.experiments.explabs.io/v1', production: true };
22.4
60
0.714286
6b1bc4177b6d7f153bc0af5ec5753dc373735ec6
631
js
JavaScript
src/sap.ui.webc.main/src/sap/ui/webc/main/thirdparty/types/CalendarSelectionMode.js
piejanssens/openui5
c684d949766e05522cdb56dc1a3333ef7210fe05
[ "MIT", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause" ]
2,724
2015-01-02T22:36:10.000Z
2022-03-30T10:48:25.000Z
src/sap.ui.webc.main/src/sap/ui/webc/main/thirdparty/types/CalendarSelectionMode.js
piejanssens/openui5
c684d949766e05522cdb56dc1a3333ef7210fe05
[ "MIT", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause" ]
2,991
2015-01-03T17:00:12.000Z
2022-03-31T15:56:23.000Z
src/sap.ui.webc.main/src/sap/ui/webc/main/thirdparty/types/CalendarSelectionMode.js
piejanssens/openui5
c684d949766e05522cdb56dc1a3333ef7210fe05
[ "MIT", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause" ]
1,620
2015-01-01T00:01:02.000Z
2022-03-14T23:31:35.000Z
sap.ui.define(['sap/ui/webc/common/thirdparty/base/types/DataType'], function (DataType) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; } var DataType__default = /*#__PURE__*/_interopDefaultLegacy(DataType); const CalendarSelectionModes = { Single: "Single", Multiple: "Multiple", Range: "Range", }; class CalendarSelectionMode extends DataType__default { static isValid(value) { return !!CalendarSelectionModes[value]; } } CalendarSelectionMode.generateTypeAccessors(CalendarSelectionModes); return CalendarSelectionMode; });
28.681818
111
0.730586
1a72f4e34dd866fe964431892ab5836a3f7109e7
12,655
py
Python
test_single_3d.py
SSurprising/ISBI2018_PETCT_Segmentation
d403df7cd6e284711a8cbdc9dc13d4df2bb47746
[ "MIT" ]
4
2018-10-28T07:08:19.000Z
2018-10-29T08:51:54.000Z
test_single_3d.py
SSurprising/ISBI2018_PETCT_Segmentation
d403df7cd6e284711a8cbdc9dc13d4df2bb47746
[ "MIT" ]
null
null
null
test_single_3d.py
SSurprising/ISBI2018_PETCT_Segmentation
d403df7cd6e284711a8cbdc9dc13d4df2bb47746
[ "MIT" ]
1
2018-10-28T07:12:02.000Z
2018-10-28T07:12:02.000Z
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import import argparse import SimpleITK as sitk import tensorflow as tf import os import numpy as np import pandas as pd import time import itertools import random import sys import glob import pickle from datetime import datetime from tensorflow.python.saved_model import loader from dltk.io.augmentation import add_gaussian_noise, flip, extract_class_balanced_example_array, elastic_transform from dltk.io.preprocessing import whitening from myconfig import * # supports numpy arrays and tensorflow tensors def NDHWC_to_NCHWD(arr): try: return tf.transpose(arr, perm=(0,4,2,3,1)) except: return arr.transpose((0,4,2,3,1)) def NCHWD_to_NDHWC(arr): try: return tf.transpose(arr, perm=(0,4,2,3,1)) except: return arr.transpose((0,4,2,3,1)) def dataset_input_from_tfrecords(filenames, batch_size=1, num_epochs=1, shuffle=True): # filenames = ["/var/data/file1.tfrecord", "/var/data/file2.tfrecord"] dataset = tf.data.TFRecordDataset(filenames) # Use `tf.parse_single_example()` to extract data from a `tf.Example` # protocol buffer, and perform any additional per-record preprocessing. def parser(record): keys_to_features = { 'case_name': tf.FixedLenFeature([], tf.string), 'image_raw': tf.FixedLenFeature([], tf.string), 'label_raw': tf.FixedLenFeature([], tf.string), } parsed = tf.parse_single_example(record, keys_to_features) case_name = parsed['case_name'] # Perform additional preprocessing on the parsed data. image = tf.decode_raw(parsed['image_raw'], tf.uint8) image = tf.reshape(image, [DEPTH, HEIGHT, WIDTH, 2]) label = tf.decode_raw(parsed['label_raw'], tf.uint8) label = tf.reshape(label, [DEPTH, HEIGHT, WIDTH, 2]) image = tf.cast(image, tf.float32) return image, label, case_name # Use `Dataset.map()` to build a pair of a feature dictionary and a label # tensor for each example. dataset = dataset.map(parser) if shuffle: dataset = dataset.shuffle(buffer_size=128) dataset = dataset.batch(batch_size) # dataset = dataset.apply(tf.contrib.data.batch_and_drop_remainder(batch_size)) dataset = dataset.repeat(num_epochs) iterator = dataset.make_one_shot_iterator() features, labels, case_names = iterator.get_next() return features, labels, case_names def dice_tf(logits, labels, threshold=0.5, axis=[1,2,3], smooth=1e-5): logits = tf.cast(logits, dtype=tf.float32) labels = tf.cast(labels, dtype=tf.float32) logits = tf.cast(logits > threshold, dtype=tf.float32) labels = tf.cast(labels > threshold, dtype=tf.float32) inse = tf.reduce_sum(tf.multiply(logits, labels), axis=axis) l = tf.reduce_sum(logits, axis=axis) r = tf.reduce_sum(labels, axis=axis) hard_dice = (2. * inse + smooth) / (l + r + smooth) hard_dice = tf.reduce_mean(hard_dice) return hard_dice def dice_loss1(logits, labels, threshold=0.5, axis=[1,2,3], smooth=1e-5): # exponential_map = tf.exp(logits) # sum_exp = tf.reduce_sum(exponential_map, 4, keep_dims=True) # tensor_sum_exp = tf.tile(sum_exp, tf.stack([1, 1, 1, 1, tf.shape(logits)[4]])) # prediction = tf.div(exponential_map,tensor_sum_exp) prediction = tf.nn.softmax(logits, axis=4) labels = tf.expand_dims(tf.cast(labels, dtype=tf.float32), axis=4) labels_expand = tf.concat([1-labels, labels], axis=4) eps = 1e-5 intersection = tf.reduce_sum(prediction * labels_expand, axis=[1,2,3,4]) union = eps + tf.reduce_sum(prediction, axis=[1,2,3,4]) + tf.reduce_sum(labels_expand, axis=[1,2,3,4]) loss = tf.reduce_mean(1.0 - (2 * intersection/ (union))) return loss def dice_loss(logits, labels, threshold=0.5, axis=[1,2,3], smooth=1e-5): labels = tf.cast(labels, tf.float32) prediction = tf.nn.softmax(logits, axis=4) eps = 1e-5 intersection = tf.reduce_sum(prediction[...,1] * labels, axis=[1,2,3]) union = eps + tf.reduce_sum(prediction[...,1], axis=[1,2,3]) + tf.reduce_sum(labels, axis=[1,2,3]) loss = tf.reduce_mean(1.0 - (2 * intersection/ (union))) return loss def computeDice(y_true, y_pred): y_true_f = y_true.flatten()>0.5 y_pred_f = y_pred.flatten()>0.5 intersection = np.sum(y_true_f * y_pred_f) return (2. * intersection + 1e-5) / (np.sum(y_true_f) + np.sum(y_pred_f) + 1e-5) def focal_loss1(labels, logits, gamma=1.0, alpha=1.0): epsilon = 1e-9 prediction = tf.nn.softmax(logits, axis=4) model_out = tf.add(prediction, epsilon) labels = tf.expand_dims(tf.cast(labels, dtype=tf.float32), axis=4) labels_expand = tf.concat([1-labels, labels], axis=4) ce = tf.multiply(labels_expand, -tf.log(model_out)) weight = tf.multiply(labels_expand, tf.pow(tf.subtract(1., model_out), gamma)) fl = tf.multiply(alpha, tf.multiply(weight, ce)) reduced_fl = tf.reduce_mean(tf.reduce_max(fl, axis=[4])) return reduced_fl def focal_loss(labels, logits, alpha=0.25, gamma=2.0): predictions = tf.nn.sigmoid(logits) labels = tf.expand_dims(tf.cast(labels, dtype=tf.float32), axis=4) onehot_labels = tf.concat([1.-labels, labels], axis=4) predictions_pt = tf.where(tf.equal(onehot_labels, 1.0), predictions, 1.-predictions) # add small value to avoid 0 epsilon = 1e-8 alpha_t = tf.scalar_mul(alpha, tf.ones_like(onehot_labels, dtype=tf.float32)) alpha_t = tf.where(tf.equal(onehot_labels, 1.0), alpha_t, 1-alpha_t) losses = tf.reduce_sum(-alpha_t * tf.pow(1. - predictions_pt, gamma) * tf.log(predictions_pt+epsilon), axis=4) return tf.reduce_mean(losses) def binary_cross_entropy(labels, logits): labels = tf.expand_dims(tf.cast(labels, dtype=tf.float32), axis=4) onehot_labels = tf.concat([1.-labels, labels], axis=4) loss = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(labels=onehot_labels, logits=logits)) return loss def parse_args(): # Parse arguments parser = argparse.ArgumentParser() parser.add_argument("--net_type", type=str, default='myunet_bn') parser.add_argument("--use_bn", type=int, default=1) parser.add_argument("--use_crf", type=int, default=0) parser.add_argument("--restore_ckpt_meta", type=str, default='') parser.add_argument("--feat_index", type=int, default=0) # 0: ct, 1: pt parser.add_argument('--random_seed', type=int, default=42) parser.add_argument('--test_filenames', type=str, default='testForTest0.csv') parser.add_argument('--norm_type', type=str, default='nonorm') args = parser.parse_args() return args def main(): args = parse_args() np.random.seed(args.random_seed) tf.set_random_seed(args.random_seed) subsets = ['train', 'val', 'test'] image_mean = IMAGE_MEAN image_std = IMAGE_STD image_mean_tensor = tf.constant(image_mean, dtype=tf.float32) image_std_tensor = tf.constant(image_std, dtype=tf.float32) phase_train = tf.placeholder(tf.bool, name='phase_train') global_step = tf.Variable(0, trainable=False) image_node = tf.placeholder(tf.float32, shape=[None, DEPTH, HEIGHT, WIDTH, 2]) label_node = tf.placeholder(tf.int32, shape=[None, DEPTH, HEIGHT, WIDTH, 2]) if args.norm_type == 'nonorm': image_node_new = image_node elif args.norm_type == 'globalnorm_mean': image_node_new = image_node - image_mean_tensor elif args.norm_type == 'globalnorm_meanstd': image_node_new = image_node - image_mean_tensor image_node_new /= image_std_tensor elif args.norm_type == 'instancenorm_mean': image_node_new = tf.map_fn(lambda frame: frame - tf.reduce_mean(frame, axis=[0,1,2], keep_dims=True), image_node) elif args.norm_type == 'instancenorm_meanstd': batch_mean, batch_var = tf.nn.moments(image_node, axes=[1,2,3], keep_dims=True) image_node_new = (image_node - batch_mean) / tf.sqrt(batch_var + 1e-6) if args.net_type == 'myunet3d_bn_crf': from myunet3d_basic import myunet3d_bn_crf net_output_ops = myunet3d_bn_crf( name='ct' if args.feat_index==0 else 'pt', inputs=image_node_new[...,args.feat_index][...,tf.newaxis], num_classes=NUM_CLASSES, phase_train=phase_train, use_bias=True, kernel_initializer=tf.truncated_normal_initializer(stddev=0.01), bias_initializer=tf.constant_initializer(value=0.1), kernel_regularizer=tf.contrib.layers.l2_regularizer(1e-4), bias_regularizer=tf.contrib.layers.l2_regularizer(1e-4), use_crf=args.use_crf, args=args) pred_op = net_output_ops['y_'] prob_op = net_output_ops['y_prob'] print('pred_op shape: ', pred_op.shape) print('prob_op shape: ', prob_op.shape) saver = tf.train.Saver(tf.global_variables(), max_to_keep=10) config = tf.ConfigProto() config.gpu_options.allow_growth = True sess = tf.Session(config=config) sess.run(tf.global_variables_initializer()) sess.run(tf.local_variables_initializer()) restore_ckpt = args.restore_ckpt_meta[:-5] print(restore_ckpt) save_dir = restore_ckpt + '_results' saver1 = tf.train.import_meta_graph('{}.meta'.format(restore_ckpt)) saver1.restore(sess, '{}'.format(restore_ckpt)) if save_dir != '' and not os.path.exists(save_dir): os.makedirs(save_dir) dices = [] for idx, filename in enumerate(args.test_filenames.split(',')): test_filenames = pd.read_csv( DATA_ROOT + '/' + filename, dtype=object, keep_default_na=False, na_values=[]).as_matrix() dice_val = [] for f in test_filenames: subject_id = f[0] img_fn = f[1] case_name = img_fn.split('/')[-1] ct_sitk = sitk.ReadImage(str(os.path.join(img_fn, 'InputCT_ROI.nii.gz'))) ct = sitk.GetArrayFromImage(ct_sitk).astype((np.float32)) pt_sitk = sitk.ReadImage(str(os.path.join(img_fn, 'InputPET_SUV_ROI.nii.gz'))) pt = sitk.GetArrayFromImage(pt_sitk).astype((np.float32)) lbl_ct = sitk.GetArrayFromImage(sitk.ReadImage(str(os.path.join( img_fn, 'GTV_Primary_ROI_CT{}.nii.gz'.format(GT_POSTFIX))))).astype(np.uint8) lbl_pt = sitk.GetArrayFromImage(sitk.ReadImage(str(os.path.join( img_fn, 'GTV_Primary_ROI_PET{}.nii.gz'.format(GT_POSTFIX))))).astype(np.uint8) ct[ct>200.] = 200. ct[ct<-500.] = -500. ct = 255*(ct+500)/(700.) pt[pt<0.01]=0.01 pt[pt>20.]=20. pt = 255*(pt-0.01)/(19.99) image = np.concatenate([ct[...,np.newaxis],pt[...,np.newaxis]], axis=3) label = np.concatenate([lbl_ct[...,np.newaxis],lbl_pt[...,np.newaxis]], axis=3) pred, prob = sess.run([pred_op, prob_op], feed_dict={image_node: image[np.newaxis,...], label_node: label[np.newaxis,...], phase_train: False}) dice_val_ = computeDice(label[...,args.feat_index], pred[0]) dice_val.append(dice_val_) if save_dir != '': case_save_dir = '{}/{}'.format(save_dir, case_name) if not os.path.exists(case_save_dir): os.makedirs(case_save_dir) new_sitk_ct = sitk.GetImageFromArray(pred[0].astype(np.int32)) new_sitk_ct.CopyInformation(ct_sitk) sitk.WriteImage(new_sitk_ct, str('{}/crf0_pred_{}.nii.gz'.format(case_save_dir, 'ct' if args.feat_index==0 else 'pt'))) new_sitk_ct = sitk.GetImageFromArray(prob[0][...,1].astype(np.float32)) new_sitk_ct.CopyInformation(pt_sitk) sitk.WriteImage(new_sitk_ct, str('{}/crf0_prob_{}.nii.gz'.format(case_save_dir, 'ct' if args.feat_index==0 else 'pt'))) dices.append(np.mean(np.array(dice_val))) print('FINAL_TEST {:.4f} {:.4f} {:.4f}'.format(dices[0],dices[1],dices[2])) if __name__ == '__main__': main()
42.753378
122
0.640379
404d7cf5a3e079ae3d9ecdfb1c37ea4e0aaaf2ce
615
jbuilder
Ruby
app/views/users/orders.json.jbuilder
luckypike/golovina
e26e7e1ca1f22751947b2ae600965960ed166c21
[ "Apache-2.0" ]
null
null
null
app/views/users/orders.json.jbuilder
luckypike/golovina
e26e7e1ca1f22751947b2ae600965960ed166c21
[ "Apache-2.0" ]
29
2019-11-11T09:04:15.000Z
2022-03-22T12:42:13.000Z
app/views/users/orders.json.jbuilder
luckypike/golovina
e26e7e1ca1f22751947b2ae600965960ed166c21
[ "Apache-2.0" ]
null
null
null
json.orders @orders do |order| json.partial! 'orders/order', order: order json.user order.user, partial: 'users/user', as: :user json.items order.order_items do |item| json.extract! item, :id, :quantity json.variant item.variant, partial: 'variants/variant', as: :variant json.color item.variant.color, partial: 'colors/color', as: :color json.size item.size, partial: 'sizes/size', as: :size json.quantity_available item.available json.available item.available? end if order.delivery json.extract! order, :delivery_option json.delivery_city order.delivery_city end end
34.166667
72
0.718699
a92617b4476fb92e1f4c202643869714a1df9b92
8,615
css
CSS
src/main/resources/static/css/css2/admin_style.css
jiusni0cara/caocao
666bdff1d1b871e2a58477894eb0fb9c08f5830a
[ "Apache-2.0" ]
null
null
null
src/main/resources/static/css/css2/admin_style.css
jiusni0cara/caocao
666bdff1d1b871e2a58477894eb0fb9c08f5830a
[ "Apache-2.0" ]
null
null
null
src/main/resources/static/css/css2/admin_style.css
jiusni0cara/caocao
666bdff1d1b871e2a58477894eb0fb9c08f5830a
[ "Apache-2.0" ]
null
null
null
*{ margin:0; padding:0 } body{ font-size:12px; font-family:Tahoma; color:#000000; margin:0; padding:0;height:100%; background:#f1f1f1; } ul{ list-style-type:none; } a{ text-decoration:none; } img{ border:none } .field{ margin:10px; } .field label{ float:left; padding:6px; } .field input.text{ border:1px solid #c5c5c5; padding:6px; background:url(../../img/img2/field_text_bg.jpg) repeat-x left center; } .field .button{ background:url(../../img/img2/login_button.jpg) no-repeat left center; border:none; width:94px; height:28px; cursor:pointer; } .side_switch{ width:10px; height:41px; position:absolute; left:197px; z-index:9999; top:350px; cursor:pointer; background:url(../../img/img2/close_side_ico.jpg) no-repeat left center; } .side_switchl{ width:10px; height:41px; position:absolute; z-index:9999; top:350px; display:none; cursor:pointer; background:url(../../img/img2/close_side_icol.jpg) no-repeat left center; } /*top*/ .top{ width:100%; height:98px; background:url(../../img/img2/top_bg.jpg) repeat-x left top;; } .top .admin_logo{ height:68px; float:left; margin-right:20px; } .top .admin_logo img{ margin-top:10px; margin-left:15px; } .top_nav{ height:30px; position:relative; width:900px; background:url(../../img/img2/top_nav_bg.jpg) no-repeat center 0; top:38px; margin-left:200px; } .top_about{ position:absolute; height:30px; overflow:hidden; width:170px; right:50px; background:url(../../img/img2/top_help.jpg) no-repeat center 0; top:0; } .top_about a{ float:left; line-height:20px; color:#5F5F5F; } .top_about a.help1{ margin-left:45px; } .top_about a.help2{ margin-left:30px; } .top_nav li{ float:left; padding-left:6px; } .top_nav a{ display:block; padding:8px 17px 8px 17px; text-align:center; overflow:hidden; margin:0; color:#5f5f5f; } .top_nav .selected{ background:url(../../img/img2/top_nav_selected.png) no-repeat 0 0; color:#fff; width:130px; padding:8px 0; } .top_member{ height:28px; width:100%; clear:both; color:#5f5f5f; line-height:25px; text-indent:80px; background:url(../../img/img2/top_member.jpg) repeat-x 0 bottom; } .top_member a{ color:#5f5f5f; } /*left*/ .left{ width:205px; height:100%; position:absolute; background:url(../../img/img2/side_bg.jpg) repeat-y 0 0; } .member_info{ position:relative; margin-top:-3px; background:url(../../img/img2/member_info.png) no-repeat 0 0; width:271px; height:40px; } .member_info a{ color:#f1f1f1; line-height:24px; } .member_ico img{ padding:4px 0 0 4px; } .member_ico{ width:55px; height:55px; position:absolute; margin-top:-20px; margin-left:15px; border:none; background:url(../../img/img2/member_info_ico.png) no-repeat 0 0; } .member_info a.system_a{ margin-left:94px; margin-right:33px; } .member_info a.system_logout{ margin-left:25px; } .left .left_title{ clear:both; width:197px; height:34px; border-top:1px solid #5093d1; border-bottom:1px solid #5093d1; margin:10px 0 10px 0px; line-height:36px; text-indent:40px; font-weight:bold; background:url(../../img/img2/left_title.jpg) no-repeat 0 0; } .left .side li{ margin:0; padding:0; width:205px; text-indent:30px; overflow:hidden; background: url(../../img/img2/left_ico_default.gif) no-repeat 25px center; } .left .side a{ display:block; padding:10px; text-align:left; color:#f1f1f1; margin-right:10px; } .left .side a:hover{ background:#2d689f; background:#2d689f url(../../img/img2/left_ico_light.gif) no-repeat 25px center; } .left .side .selected{ background:#2d689f url(../../img/img2/left_ico_light.gif) no-repeat 25px center; } .left .side .selected:hover{ background:#2d689f url(../../img/img2/left_ico_light.gif) no-repeat 25px center; } .left ul.catsub a{ font-weight:bold; } .left ul.catsub a:hover{ background:none; } .left ul.catsub li.feed{ background:url(../../img/img2/feed.jpg) no-repeat 20px center; } .left ul.catsub li{ border-top:1px solid #2969a6; width:195px; } .left ul.catsub li a{ border-top:1px solid #488bcb; } .left ul.catsub li.side_about{ background:url(../../img/img2/side_about.jpg) no-repeat 20px center; } /*right*/ .right{ width:100%; height:100%; background:#666; } .body{ width:99%; margin:0 auto; } .top_subnav{ text-indent:80px; padding:5px; background:url(../../img/img2/li_ico.jpg) no-repeat 75px center; } .title{ height:33px; width:100%; margin:20px auto; background:#fff url(../../img/img2/title_bg.jpg) repeat-x 0 top; } .title_info{ border:1px solid #d6d6d6; height:30px; line-height:30px; padding-left:50px; font-weight:bold; } .title_info a{font-weight:normal; color:#3186c8;} .title_info label{font-weight:normal;} .zs{ background:url(../../img/img2/zs_ico.jpg) no-repeat 10px center; } .light{ background:url(../../img/img2/light_ico.jpg) no-repeat 14px center; } .login_info{ padding:10px 0 10px 70px; background:url(../../img/img2/ico_clock.jpg) no-repeat 30px center; } .login_info a{ color:#3186c8; } .line{ height:1px; width:97%; border-top:1px solid #dfdfdf; background:#fff; margin:10px auto; overflow:hidden; } .quick_block{ clear:both; margin:0 auto; padding-left:45px; } .quick_block a { display:block; width:60px; overflow:hidden; float:left; text-align:center; color:#5f5f5f; padding:10px; } .quick_block a img{ padding:5px 5px 10px 5px; } .quick_block a span{ display:block; } a.button{ clear:both; background:url(../../img/img2/light_btn.jpg) repeat-x left center; border:1px solid #bfcfe1; text-indent:15px; height:23px; line-height:25px; width:140px; padding:0 0 0 10px; margin:20px 0 0 10px; } a.button span{ display:block; background:url(../../img/img2/btn_add_ico.jpg) no-repeat left center; } .use_meth{ padding-bottom:20px; } .use_meth p{ clear:both; padding-left:50px; line-height:30px; float:left; } p span{ float:left; } p a{ display:block; background:#fff url(../../img/img2/default_btn.jpg) repeat-x center center; overflow:hidden; padding:0px 10px 0px 10px; border:1px solid #c7c7c7; line-height:25px; float:left; margin-left:20px; color:#000; } /*iframe width 100%*/ .right_body{ margin-left:205px; height:100%; } .title_h2{ background:url(../../img/img2/s_ico.jpg) no-repeat left center; padding:10px 0px 10px 30px; margin-left:10px; font-size:14px; font-weight:bold; } .filed label{ position:absolute; padding:6px 3px 6px 0px; } .filed input { margin-left:50px; padding:3px; border-top:1px solid #bebebe; border-left:1px solid #bebebe; border-right:1px solid #e1e1e1; border-bottom:1px solid #e1e1e1; background:url(../../img/img2/input_bg.jpg) repeat-x 0 0; margin-right:10px; } .filed .button{ width:66px; height:30px; border:none; margin:0; padding:0; margin-top:-4px; background:url(../../img/img2/button_s.jpg) no-repeat 0 0; } .fl{ float:left; } .select{ margin-left:50px; background:none; border:none; } .table{ clear:both; margin:10px auto; width:100%; border:1px solid #d6d6d6; border-collapse:collapse; } .table th{ text-align:left; border-top:1px solid #dfdfdf; padding:5px; background:#f1f1f1; padding-left:15px; } .table td{ border-top:1px solid #dfdfdf; padding:8px; padding-left:15px; background:#fff; } .table th.top_th a{ float:left; overflow:hidden; width:40px; } .table th.top_th{ background:url(../../img/img2/table_th.jpg) repeat-x 0 0; line-height:31px; height:31px; padding:0; } .page p span{ text-decoration:underline; } .page ul{ float:right; } .page ul li{ float:left; padding:3px; } .page ul li a { display:block; background:url(../../img/img2/page_bg.jpg) no-repeat 0 0; padding:1px 3px 1px 3px; border:1px solid #a3a3a3; color:#000; } .page ul li a.pg_selected{ color:#fff; border:1px solid #245b8e; background:#417eb7; } .page p{ padding:3px; } .page a.pg_next,.page .pg_index,.page .pg_last{ border:none; background:none; line-height:19px; _line-height:17px; } .table th a{ padding:2px 3px 1px 23px; float:left; line-height:28px; color:#333; font-weight:200; } .table th a em{ float:left; font-style: normal; } .table th a span{ background:url(../../img/img2/line_line.jpg) no-repeat right center; width:10px; height:24px; float:right; display:block; } .table .add{ background:url(../../img/img2/add_ico_.jpg) no-repeat 0 center; } .table .edit{ background:url(../../img/img2/edit_ico.jpg) no-repeat 0 center; } .table .tongji{ background:url(../../img/img2/tj_ico_.jpg) no-repeat 0 center; } .table .sort{ background:url(../../img/img2/sort_ico.jpg) no-repeat 0 center; } .table .sort span{ background:none; } .tablelist{padding-top:23px;}
17.653689
84
0.700871
2fe95ac5ad6850056ec5d4d764a60b3bb96cbf2d
1,500
py
Python
archives/migrations/0018_auto_20220122_1014.py
mofadweb/Website
2df3fd531b8fd0b47c2c2ca67e74692383352c71
[ "MIT" ]
null
null
null
archives/migrations/0018_auto_20220122_1014.py
mofadweb/Website
2df3fd531b8fd0b47c2c2ca67e74692383352c71
[ "MIT" ]
1
2022-02-18T11:01:43.000Z
2022-02-18T11:01:43.000Z
archives/migrations/0018_auto_20220122_1014.py
mofadweb/Website
2df3fd531b8fd0b47c2c2ca67e74692383352c71
[ "MIT" ]
null
null
null
# Generated by Django 3.2 on 2022-01-22 10:14 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('archives', '0017_alter_report_type'), ] operations = [ migrations.CreateModel( name='AgencyDivision', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=200)), ('role', models.TextField()), ], ), migrations.CreateModel( name='AgencyLeader', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=100)), ('image', models.FileField(null=True, upload_to='agencyLeader_images')), ('position', models.CharField(max_length=150)), ], ), migrations.AlterField( model_name='agency', name='image', field=models.FileField(null=True, upload_to='agency_images'), ), migrations.AlterField( model_name='agency', name='name', field=models.CharField(max_length=200), ), migrations.AlterField( model_name='report', name='by', field=models.CharField(default='', max_length=80), ), ]
32.608696
117
0.550667
e2e99842b831905ba47d97227700cd77d18ad77b
1,273
py
Python
src/pyscript/puretest.py
JohndeVostok/tftest
b63123357b935db155394ccec156862f0cacee6e
[ "MIT" ]
null
null
null
src/pyscript/puretest.py
JohndeVostok/tftest
b63123357b935db155394ccec156862f0cacee6e
[ "MIT" ]
null
null
null
src/pyscript/puretest.py
JohndeVostok/tftest
b63123357b935db155394ccec156862f0cacee6e
[ "MIT" ]
null
null
null
import os import json import tensorflow as tf from tensorflow.python.client import timeline import time if __name__ == "__main__": # os.environ["CUDA_VISIBLE_DEVICES"]="-1" a = tf.random_normal([32, 224, 224, 3]) b = tf.truncated_normal([11, 11, 3, 64], mean=0, stddev=0.1, dtype=tf.float32) c = tf.nn.conv2d(a, b, [1, 4, 4, 1], padding="SAME") d = tf.nn.max_pool(c, ksize=[1, 3, 3, 1], strides=[1, 2, 2, 1], padding="VALID", name="pool1") # d = tf.random_normal([32, 27, 27, 64]) e = tf.truncated_normal([5, 5, 64, 192], dtype=tf.float32, stddev=0.1) f = tf.nn.conv2d(d, e, [1, 1, 1, 1], padding="SAME") sess = tf.Session() init_op = tf.initialize_local_variables() sess.run(init_op) run_options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE) run_metadata = tf.RunMetadata() writer=tf.summary.FileWriter("logs", sess.graph) op = time.time() sess.run(f, options=run_options, run_metadata=run_metadata) ed = time.time() print(ed-op) writer.add_run_metadata(run_metadata, 'step %03d' % 0) writer.close() tl = timeline.Timeline(run_metadata.step_stats) ctf = tl.generate_chrome_trace_format() with open('test_timeline.json', 'w') as f: f.write(ctf)
31.04878
98
0.644933
bb44368a2c92a8a9e0759a7a27a7d3d13c598bca
15,925
cs
C#
Pipeline/RoyalCode.PipelineFlow.Tests/T10_PipelineFactory_Decorators_Tests.cs
Royal-Code/Pipeline
805ea5021ad0ac4e558c618d71de91d32c798803
[ "MIT" ]
null
null
null
Pipeline/RoyalCode.PipelineFlow.Tests/T10_PipelineFactory_Decorators_Tests.cs
Royal-Code/Pipeline
805ea5021ad0ac4e558c618d71de91d32c798803
[ "MIT" ]
null
null
null
Pipeline/RoyalCode.PipelineFlow.Tests/T10_PipelineFactory_Decorators_Tests.cs
Royal-Code/Pipeline
805ea5021ad0ac4e558c618d71de91d32c798803
[ "MIT" ]
1
2022-03-11T01:11:40.000Z
2022-03-11T01:11:40.000Z
using RoyalCode.PipelineFlow.Configurations; using System; using System.Linq; using System.Reflection; using System.Threading; using System.Threading.Tasks; using Xunit; namespace RoyalCode.PipelineFlow.Tests { [Collection("Pipeline tests")] public class T10_PipelineFactory_Decorators_Tests { [Fact] public void T01_DecoratorsHandler_In() { PipelineFactory.ResetChainTypes<ITestBus>(); var factory = PipelineFactory.Configure<ITestBus>() .ConfigurePipelines(builder => { builder.AddHandlersMethods(MethodsGetter<ValueableHandler<IntInput, int>>.GetSyncMethods()); builder.AddDecoratorsMethods(MethodsGetter<DecoratorHandler_In>.GetSyncMethods()); }) .Create(); var pipeline = factory.Create<IntInput>(); Assert.NotNull(pipeline); pipeline.Send(new IntInput(1)); Assert.Equal(4, ValueableHandler<IntInput, int>.Value); } [Fact] public async Task T02_DecoratorsHandlerAsync_In() { PipelineFactory.ResetChainTypes<ITestBus>(); var factory = PipelineFactory.Configure<ITestBus>() .ConfigurePipelines(builder => { builder.AddHandlersMethods(MethodsGetter<ValueableHandler<IntInput, int>>.GetAsyncMethods()); builder.AddDecoratorsMethods(MethodsGetter<DecoratorHandlerAsync_In>.GetAsyncMethods()); }) .Create(); var pipeline = factory.Create<IntInput>(); Assert.NotNull(pipeline); await pipeline.SendAsync(new IntInput(1)); Assert.Equal(4, ValueableHandler<IntInput, int>.Value); } [Fact] public async Task T03_DecoratorsHandlerAsyncWithoutCancellationToken_In() { PipelineFactory.ResetChainTypes<ITestBus>(); var factory = PipelineFactory.Configure<ITestBus>() .ConfigurePipelines(builder => { builder.AddHandlersMethods(MethodsGetter<ValueableHandler<IntInput, int>>.GetAsyncMethods()); builder.AddDecoratorsMethods(MethodsGetter<DecoratorHandlerAsyncWithoutCancellationToken_In>.GetAsyncMethods()); }) .Create(); var pipeline = factory.Create<IntInput>(); Assert.NotNull(pipeline); await pipeline.SendAsync(new IntInput(1)); Assert.Equal(4, ValueableHandler<IntInput, int>.Value); } [Fact] public void T04_DecoratorsHandler_InOut() { PipelineFactory.ResetChainTypes<ITestBus>(); var factory = PipelineFactory.Configure<ITestBus>() .ConfigurePipelines(builder => { builder.AddHandlersMethods(MethodsGetter<ResultableHandler<IntInput, int>>.GetSyncMethods()); builder.AddDecoratorsMethods(MethodsGetter<DecoratorHandler_InOut>.GetSyncMethods()); }) .Create(); var pipeline = factory.Create<IntInput, string>(); Assert.NotNull(pipeline); var result = pipeline.Send(new IntInput(1)); Assert.Equal(4, ResultableHandler<IntInput, int>.Value); Assert.Equal("456", result); } [Fact] public async Task T05_DecoratorsHandlerAsync_InOut() { PipelineFactory.ResetChainTypes<ITestBus>(); var factory = PipelineFactory.Configure<ITestBus>() .ConfigurePipelines(builder => { builder.AddHandlersMethods(MethodsGetter<ResultableHandler<IntInput, int>>.GetAsyncMethods()); builder.AddDecoratorsMethods(MethodsGetter<DecoratorHandlerAsync_InOut>.GetAsyncMethods()); }) .Create(); var pipeline = factory.Create<IntInput, string>(); Assert.NotNull(pipeline); var result = await pipeline.SendAsync(new IntInput(1)); Assert.Equal(4, ResultableHandler<IntInput, int>.Value); Assert.Equal("456", result); } [Fact] public async Task T06_DecoratorsHandlerAsyncWithoutCancellationToken_InOut() { PipelineFactory.ResetChainTypes<ITestBus>(); var factory = PipelineFactory.Configure<ITestBus>() .ConfigurePipelines(builder => { builder.AddHandlersMethods(MethodsGetter<ResultableHandler<IntInput, int>>.GetAsyncMethods()); builder.AddDecoratorsMethods(MethodsGetter<DecoratorHandlerAsyncWithoutCancellationToken_InOut>.GetAsyncMethods()); }) .Create(); var pipeline = factory.Create<IntInput, string>(); Assert.NotNull(pipeline); var result = await pipeline.SendAsync(new IntInput(1)); Assert.Equal(4, ResultableHandler<IntInput, int>.Value); Assert.Equal("456", result); } [Fact] public void T07_DecoratorsDelegateHandler_In() { int value = 0; PipelineFactory.ResetChainTypes<ITestBus>(); var factory = PipelineFactory.Configure<ITestBus>() .ConfigurePipelines(builder => { builder.Configure<IntInput>() .Handle(i => { i.Increment(); value = i.Value; }) .Decorate((i, n) => { i.Increment(); n(); }) .Decorate((i, n) => { i.Increment(); n(); }); }) .Create(); var pipeline = factory.Create<IntInput>(); Assert.NotNull(pipeline); pipeline.Send(new IntInput(1)); Assert.Equal(4, value); } internal interface ITestBus_T08 : ITestBus { } [Fact] public async Task T08_DecoratorsDelegateHandlerAsync_In() { PipelineFactory.ResetChainTypes<ITestBus_T08>(); int value = 0; var factory = PipelineFactory.Configure<ITestBus_T08>() .ConfigurePipelines(builder => { builder.Configure<IntInput>() .HandleAsync((i, t) => { i.Increment(); value = i.Value; return Task.CompletedTask; }) .DecorateAsync((i, n, t) => { i.Increment(); return n(); }) .DecorateAsync((i, n, t) => { i.Increment(); return n(); }); }) .Create(); var pipeline = factory.Create<IntInput>(); Assert.NotNull(pipeline); await pipeline.SendAsync(new IntInput(1)); await Task.Delay(1); Assert.Equal(4, value); } [Fact] public async Task T09_DecoratorsDelegateHandlerAsyncWithoutCancellationToken_In() { int value = 0; PipelineFactory.ResetChainTypes<ITestBus>(); var factory = PipelineFactory.Configure<ITestBus>() .ConfigurePipelines(builder => { builder.Configure<IntInput>() .HandleAsync((i) => { i.Increment(); value = i.Value; return Task.CompletedTask; }) .DecorateAsync((i, n) => { i.Increment(); return n(); }) .DecorateAsync((i, n) => { i.Increment(); return n(); }); }) .Create(); var pipeline = factory.Create<IntInput>(); Assert.NotNull(pipeline); await pipeline.SendAsync(new IntInput(1)); Assert.Equal(4, value); } [Fact] public void T10_DecoratorsDelegateHandler_InOut() { int value = 0; PipelineFactory.ResetChainTypes<ITestBus>(); var factory = PipelineFactory.Configure<ITestBus>() .ConfigurePipelines(builder => { builder.Configure<IntInput, string>() .Handle(i => { i.Increment(); value = i.Value; return i.ToString(); }) .Decorate((i, n) => { i.Increment(); var r = n(); i.Increment(); return r + i.ToString(); }) .Decorate((i, n) => { i.Increment(); var r = n(); i.Increment(); return r + i.ToString(); }); }) .Create(); var pipeline = factory.Create<IntInput, string>(); Assert.NotNull(pipeline); var result = pipeline.Send(new IntInput(1)); Assert.Equal(4, value); Assert.Equal("456", result); } [Fact] public async void T11_DecoratorsDelegateHandlerAsync_InOut() { int value = 0; PipelineFactory.ResetChainTypes<ITestBus>(); var factory = PipelineFactory.Configure<ITestBus>() .ConfigurePipelines(builder => { builder.Configure<IntInput, string>() .HandleAsync((i, t) => { i.Increment(); value = i.Value; return Task.FromResult(i.ToString()); }) .DecorateAsync(async (i, n, t) => { i.Increment(); var r = await n(); i.Increment(); return r + i.ToString(); }) .DecorateAsync(async (i, n, t) => { i.Increment(); var r = await n(); i.Increment(); return r + i.ToString(); }); }) .Create(); var pipeline = factory.Create<IntInput, string>(); Assert.NotNull(pipeline); var result = await pipeline.SendAsync(new IntInput(1)); Assert.Equal(4, value); Assert.Equal("456", result); } [Fact] public async void T12_DecoratorsDelegateHandlerAsyncWithoutCancellationToken_InOut() { int value = 0; PipelineFactory.ResetChainTypes<ITestBus>(); var factory = PipelineFactory.Configure<ITestBus>() .ConfigurePipelines(builder => { builder.Configure<IntInput, string>() .HandleAsync((i) => { i.Increment(); value = i.Value; return Task.FromResult(i.ToString()); }) .DecorateAsync(async (i, n) => { i.Increment(); var r = await n(); i.Increment(); return r + i.ToString(); }) .DecorateAsync(async (i, n) => { i.Increment(); var r = await n(); i.Increment(); return r + i.ToString(); }); }) .Create(); var pipeline = factory.Create<IntInput, string>(); Assert.NotNull(pipeline); var result = await pipeline.SendAsync(new IntInput(1)); Assert.Equal(4, value); Assert.Equal("456", result); } } #region Input & Handlers public interface IValueable<TValue> { TValue Value { get; } void Increment(); } public class IntInput : IValueable<int> { public int Value { get; set; } public IntInput(int value) { Value = value; } public void Increment() { Value++; } public override string ToString() { return Value.ToString(); } } public class ValueableHandler<TValueable, TValue> where TValueable : IValueable<TValue> { public static TValue? Value; public void Handle(TValueable input) { input.Increment(); Value = input.Value; } public Task HandleAsync(TValueable input) { input.Increment(); Value = input.Value; return Task.CompletedTask; } } public class ResultableHandler<TValueable, TValue> where TValueable : IValueable<TValue> { public static TValue? Value; public string Handle(TValueable input) { input.Increment(); Value = input.Value; return input.ToString()!; } public Task<string> HandleAsync(TValueable input) { input.Increment(); Value = input.Value; return Task.FromResult(input.ToString()!); } } public class MethodsGetter<T> { public static MethodInfo[] GetSyncMethods() => typeof(T) .GetMethods() .Where(m => m.Name.Contains("Handle", StringComparison.OrdinalIgnoreCase) && !m.Name.Contains("Async", StringComparison.OrdinalIgnoreCase)) .ToArray(); public static MethodInfo[] GetAsyncMethods() => typeof(T) .GetMethods() .Where(m => m.Name.Contains("Handle", StringComparison.OrdinalIgnoreCase) && m.Name.Contains("Async", StringComparison.OrdinalIgnoreCase)) .ToArray(); } #endregion #region T01 & T02 & T03 public class DecoratorHandler_In { public void Handle1(IntInput input, Action next) { input.Increment(); next(); } public void Handle2(IntInput input, Action next) { input.Increment(); next(); } } public class DecoratorHandlerAsync_In { public Task HandleAsync1(IntInput input, Func<Task> next, CancellationToken token) { input.Increment(); return next(); } public Task HandleAsync2(IntInput input, Func<Task> next, CancellationToken token) { input.Increment(); return next(); } } public class DecoratorHandlerAsyncWithoutCancellationToken_In { public Task HandleAsync1(IntInput input, Func<Task> next) { input.Increment(); return next(); } public Task HandleAsync2(IntInput input, Func<Task> next) { input.Increment(); return next(); } } #endregion #region T04 & T05 & T06 public class DecoratorHandler_InOut { public string Handle1(IntInput input, Func<string> next) { input.Increment(); var result = next(); input.Increment(); return result + input.ToString(); } public string Handle2(IntInput input, Func<string> next) { input.Increment(); var result = next(); input.Increment(); return result + input.ToString(); } } public class DecoratorHandlerAsync_InOut { public async Task<string> HandleAsync1(IntInput input, Func<Task<string>> next, CancellationToken token) { input.Increment(); var result = await next(); input.Increment(); return result + input.ToString(); } public async Task<string> HandleAsync2(IntInput input, Func<Task<string>> next, CancellationToken token) { input.Increment(); var result = await next(); input.Increment(); return result + input.ToString(); } } public class DecoratorHandlerAsyncWithoutCancellationToken_InOut { public async Task<string> HandleAsync1(IntInput input, Func<Task<string>> next) { input.Increment(); var result = await next(); input.Increment(); return result + input.ToString(); } public async Task<string> HandleAsync2(IntInput input, Func<Task<string>> next) { input.Increment(); var result = await next(); input.Increment(); return result + input.ToString(); } } #endregion }
33.882979
137
0.544741
a92289bc927627e57ff289602780eb99e53c262e
1,001
css
CSS
src/styles/_user-management.css
vijayasankar/ML2.0
8715949b3c99527a7d2685563e0e832909feec86
[ "MIT" ]
null
null
null
src/styles/_user-management.css
vijayasankar/ML2.0
8715949b3c99527a7d2685563e0e832909feec86
[ "MIT" ]
null
null
null
src/styles/_user-management.css
vijayasankar/ML2.0
8715949b3c99527a7d2685563e0e832909feec86
[ "MIT" ]
null
null
null
/* .user-management__current-user-title { */ /* color: var(--black-4); */ /* font-size: 16px; */ /* line-height: 20px; */ /* } */ /* */ /* .user-management__current-user-text { */ /* color: var(--black-2); */ /* font-size: 16px; */ /* font-weight: var(--bold); */ /* line-height: 20px; */ /* padding-bottom: 10px; */ /* } */ .user-management__registered-users-row-heading { border: none; color: var(--black-2); font-weight: var(--bold); } .user-management__registered-users-row { border-bottom: 1px solid var(--grey-4); padding: 10px 0; } .user-management__registered-users-row-col { line-height: 30px; } .user-management__registered-users-trigger.is-remove { color: var(--green-3); cursor: pointer; } .user-management__create-user-trigger.is-submit { background: var(--green-3); border: 1px solid var(--green-3); color: var(--grey-5); position: relative; border-radius: 4px; &:hover { background: var(--green-2); color: var(--grey-5); } }
21.297872
54
0.62038
f62ea6aed389d2f91dcc32f5992bb286e7a61b01
2,636
cpp
C++
modules/core/engine/src/EngineServiceManager.cpp
syl22-00/aac-sdk
79696da55b0bca09a4c68f361ef1f47efb8f717e
[ "Apache-2.0" ]
4
2018-08-29T08:16:52.000Z
2019-05-17T02:04:56.000Z
modules/core/engine/src/EngineServiceManager.cpp
syl22-00/aac-sdk
79696da55b0bca09a4c68f361ef1f47efb8f717e
[ "Apache-2.0" ]
null
null
null
modules/core/engine/src/EngineServiceManager.cpp
syl22-00/aac-sdk
79696da55b0bca09a4c68f361ef1f47efb8f717e
[ "Apache-2.0" ]
1
2020-05-18T02:02:47.000Z
2020-05-18T02:02:47.000Z
/* * Copyright 2017-2018 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" file accompanying this file. This file 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. */ #include "AACE/Engine/Core/EngineServiceManager.h" #include "AACE/Engine/Core/EngineMacros.h" namespace aace { namespace engine { namespace core { // String to identify log entries originating from this file. static const std::string TAG("aace.core.EngineServiceManager"); std::shared_ptr<EngineServiceManager> EngineServiceManager::s_instance = nullptr; std::shared_ptr<EngineServiceManager> EngineServiceManager::getInstance() { if( s_instance == nullptr ) { s_instance = std::shared_ptr<EngineServiceManager>( new EngineServiceManager() ); } return s_instance; } bool EngineServiceManager::registerService( const ServiceDescription& description, std::function<std::shared_ptr<EngineService>(const ServiceDescription&)> constructor ) { try { auto type = description.getType(); ThrowIfNot( getInstance()->m_serviceMap.find( type ) == getInstance()->m_serviceMap.end(), "serviceAlreadyRegistered" ); getInstance()->m_serviceMap[type] = ServiceFactory::create( description, constructor ); return true; } catch( std::exception& ex ) { AACE_ERROR(LX(TAG,"registerService").d("reason", ex.what())); return false; } } EngineServiceManager::ServiceMap::iterator EngineServiceManager::registryBegin() { return getInstance()->m_serviceMap.begin(); } EngineServiceManager::ServiceMap::iterator EngineServiceManager::registryEnd() { return getInstance()->m_serviceMap.end(); } // // ServiceFactory // std::shared_ptr<ServiceFactory> ServiceFactory::create( const ServiceDescription& description, std::function<std::shared_ptr<EngineService>(const ServiceDescription&)> constructor ) { auto factory = std::shared_ptr<ServiceFactory>( new ServiceFactory() ); factory->m_description = description; factory->m_constructor = constructor; return factory; } std::shared_ptr<EngineService> ServiceFactory::newInstance() { return m_constructor( m_description ); } } // aace::engine::core } // aace::engine } // aace
31.380952
181
0.724583
25526653162e39662f5472801cae59fe18637026
78,826
cs
C#
backend/Thread .NET.DAL/Migrations/20200920081719_Change_Coords_Type.Designer.cs
denispostilnyak/web-technology
f86114130f23552b1882c3c01bfda429c3ba24f9
[ "MIT" ]
1
2021-02-22T14:48:44.000Z
2021-02-22T14:48:44.000Z
backend/Thread .NET.DAL/Migrations/20200920081719_Change_Coords_Type.Designer.cs
denispostilnyak/web-technology
f86114130f23552b1882c3c01bfda429c3ba24f9
[ "MIT" ]
null
null
null
backend/Thread .NET.DAL/Migrations/20200920081719_Change_Coords_Type.Designer.cs
denispostilnyak/web-technology
f86114130f23552b1882c3c01bfda429c3ba24f9
[ "MIT" ]
null
null
null
// <auto-generated /> using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Thread_.NET.DAL.Context; namespace Thread_.NET.DAL.Migrations { [DbContext(typeof(ThreadContext))] [Migration("20200920081719_Change_Coords_Type")] partial class Change_Coords_Type { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "3.1.7") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("Thread_.NET.DAL.Entities.Comment", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<int>("AuthorId") .HasColumnType("int"); b.Property<string>("Body") .HasColumnType("nvarchar(max)"); b.Property<DateTime>("CreatedAt") .HasColumnType("datetime2"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<int>("PostId") .HasColumnType("int"); b.Property<DateTime>("UpdatedAt") .HasColumnType("datetime2"); b.HasKey("Id"); b.HasIndex("AuthorId"); b.HasIndex("PostId"); b.ToTable("Comments"); b.HasData( new { Id = 1, AuthorId = 6, Body = "Sunt et officia odit consequuntur velit ad.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(1749), IsDeleted = false, PostId = 11, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(3639) }, new { Id = 2, AuthorId = 20, Body = "Quia aut voluptates consequatur asperiores officiis quod officiis voluptas enim.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(5672), IsDeleted = false, PostId = 19, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(5744) }, new { Id = 3, AuthorId = 7, Body = "Incidunt et enim dolorem ab pariatur.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(6063), IsDeleted = false, PostId = 6, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(6091) }, new { Id = 4, AuthorId = 14, Body = "Mollitia fugiat rem.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(6316), IsDeleted = false, PostId = 6, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(6348) }, new { Id = 5, AuthorId = 5, Body = "Et deleniti qui placeat autem saepe cum dolorem aliquam.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(6638), IsDeleted = false, PostId = 13, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(6654) }, new { Id = 6, AuthorId = 7, Body = "Laudantium quod quo.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(6787), IsDeleted = false, PostId = 14, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(6819) }, new { Id = 7, AuthorId = 6, Body = "Illo ex cum vel.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(7407), IsDeleted = false, PostId = 5, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(7450) }, new { Id = 8, AuthorId = 8, Body = "Incidunt et dolorem quia architecto sed.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(7738), IsDeleted = false, PostId = 12, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(7767) }, new { Id = 9, AuthorId = 10, Body = "Dolore commodi est dolorem sed atque iste voluptatem illo ut.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(8101), IsDeleted = false, PostId = 17, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(8125) }, new { Id = 10, AuthorId = 5, Body = "Occaecati sit ad qui nostrum animi recusandae ipsum illum.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(8411), IsDeleted = false, PostId = 8, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(8442) }, new { Id = 11, AuthorId = 14, Body = "Natus ut excepturi sapiente dolor.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(8683), IsDeleted = false, PostId = 6, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(8713) }, new { Id = 12, AuthorId = 13, Body = "Similique dolores aliquid animi cupiditate inventore.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(8961), IsDeleted = false, PostId = 17, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(8988) }, new { Id = 13, AuthorId = 18, Body = "Possimus enim autem officia iure aut.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(9373), IsDeleted = false, PostId = 19, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(9396) }, new { Id = 14, AuthorId = 1, Body = "Et quod facilis est et consequuntur commodi pariatur natus eius.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(9799), IsDeleted = false, PostId = 7, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 182, DateTimeKind.Local).AddTicks(9828) }, new { Id = 15, AuthorId = 3, Body = "Corporis sequi molestiae ad accusantium voluptatibus tempore et ut accusantium.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 183, DateTimeKind.Local).AddTicks(166), IsDeleted = false, PostId = 16, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 183, DateTimeKind.Local).AddTicks(193) }, new { Id = 16, AuthorId = 4, Body = "Delectus similique est.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 183, DateTimeKind.Local).AddTicks(397), IsDeleted = false, PostId = 4, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 183, DateTimeKind.Local).AddTicks(422) }, new { Id = 17, AuthorId = 5, Body = "Doloremque dolore nihil sed omnis nulla et modi.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 183, DateTimeKind.Local).AddTicks(706), IsDeleted = false, PostId = 14, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 183, DateTimeKind.Local).AddTicks(730) }, new { Id = 18, AuthorId = 3, Body = "Ex possimus aut aut delectus rerum neque.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 183, DateTimeKind.Local).AddTicks(1123), IsDeleted = false, PostId = 2, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 183, DateTimeKind.Local).AddTicks(1145) }, new { Id = 19, AuthorId = 3, Body = "Quaerat voluptatem aut quo excepturi delectus quis neque quibusdam.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 183, DateTimeKind.Local).AddTicks(1439), IsDeleted = false, PostId = 8, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 183, DateTimeKind.Local).AddTicks(1458) }, new { Id = 20, AuthorId = 19, Body = "Quis ad et.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 183, DateTimeKind.Local).AddTicks(1666), IsDeleted = false, PostId = 13, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 183, DateTimeKind.Local).AddTicks(1692) }); }); modelBuilder.Entity("Thread_.NET.DAL.Entities.CommentReaction", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<int>("CommentId") .HasColumnType("int"); b.Property<DateTime>("CreatedAt") .HasColumnType("datetime2"); b.Property<bool>("IsLike") .HasColumnType("bit"); b.Property<DateTime>("UpdatedAt") .HasColumnType("datetime2"); b.Property<int>("UserId") .HasColumnType("int"); b.HasKey("Id"); b.HasAlternateKey("CommentId", "UserId"); b.HasIndex("UserId"); b.ToTable("CommentReactions"); }); modelBuilder.Entity("Thread_.NET.DAL.Entities.Image", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreatedAt") .HasColumnType("datetime2"); b.Property<string>("URL") .HasColumnType("nvarchar(max)"); b.Property<DateTime>("UpdatedAt") .HasColumnType("datetime2"); b.HasKey("Id"); b.ToTable("Images"); b.HasData( new { Id = 1, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 798, DateTimeKind.Local).AddTicks(9194), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/gauchomatt/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 799, DateTimeKind.Local).AddTicks(9207) }, new { Id = 2, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(983), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/craighenneberry/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(1064) }, new { Id = 3, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(1191), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/claudioguglieri/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(1224) }, new { Id = 4, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(1329), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/kaysix_dizzy/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(1363) }, new { Id = 5, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(1453), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/doooon/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(1486) }, new { Id = 6, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(1592), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/bargaorobalo/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(1623) }, new { Id = 7, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(1714), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/andrewofficer/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(1746) }, new { Id = 8, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(1841), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/tweetubhai/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(1863) }, new { Id = 9, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(2076), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/kevinjohndayy/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(2109) }, new { Id = 10, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(2205), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/kevinoh/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(2237) }, new { Id = 11, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(2335), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/carlosjgsousa/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(2364) }, new { Id = 12, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(2461), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/raphaelnikson/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(2492) }, new { Id = 13, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(2603), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/alagoon/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(2627) }, new { Id = 14, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(2678), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/rehatkathuria/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(2689) }, new { Id = 15, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(2744), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/jayrobinson/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(2776) }, new { Id = 16, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(2883), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/vitor376/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(2915) }, new { Id = 17, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(3033), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/sydlawrence/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(3045) }, new { Id = 18, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(3156), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/davidcazalis/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(3176) }, new { Id = 19, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(3273), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/danpliego/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(3304) }, new { Id = 20, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(3366), URL = "https://s3.amazonaws.com/uifaces/faces/twitter/chrisstumph/128.jpg", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 800, DateTimeKind.Local).AddTicks(3378) }, new { Id = 21, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(1714), URL = "https://picsum.photos/640/480/?image=96", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(2885) }, new { Id = 22, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(3487), URL = "https://picsum.photos/640/480/?image=743", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(3551) }, new { Id = 23, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(3627), URL = "https://picsum.photos/640/480/?image=515", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(3641) }, new { Id = 24, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(3696), URL = "https://picsum.photos/640/480/?image=462", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(3709) }, new { Id = 25, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(3763), URL = "https://picsum.photos/640/480/?image=908", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(3776) }, new { Id = 26, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(3828), URL = "https://picsum.photos/640/480/?image=155", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(3840) }, new { Id = 27, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(3894), URL = "https://picsum.photos/640/480/?image=1023", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(3908) }, new { Id = 28, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(3964), URL = "https://picsum.photos/640/480/?image=44", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(3977) }, new { Id = 29, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4031), URL = "https://picsum.photos/640/480/?image=1046", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4045) }, new { Id = 30, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4098), URL = "https://picsum.photos/640/480/?image=194", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4111) }, new { Id = 31, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4162), URL = "https://picsum.photos/640/480/?image=368", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4174) }, new { Id = 32, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4242), URL = "https://picsum.photos/640/480/?image=394", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4256) }, new { Id = 33, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4311), URL = "https://picsum.photos/640/480/?image=575", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4325) }, new { Id = 34, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4382), URL = "https://picsum.photos/640/480/?image=389", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4399) }, new { Id = 35, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4455), URL = "https://picsum.photos/640/480/?image=290", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4469) }, new { Id = 36, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4523), URL = "https://picsum.photos/640/480/?image=595", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4536) }, new { Id = 37, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4590), URL = "https://picsum.photos/640/480/?image=957", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4601) }, new { Id = 38, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4657), URL = "https://picsum.photos/640/480/?image=783", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4669) }, new { Id = 39, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4726), URL = "https://picsum.photos/640/480/?image=756", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4739) }, new { Id = 40, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4793), URL = "https://picsum.photos/640/480/?image=985", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 814, DateTimeKind.Local).AddTicks(4807) }); }); modelBuilder.Entity("Thread_.NET.DAL.Entities.Post", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<int>("AuthorId") .HasColumnType("int"); b.Property<string>("Body") .HasColumnType("nvarchar(max)"); b.Property<DateTime>("CreatedAt") .HasColumnType("datetime2"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.Property<int?>("PreviewId") .HasColumnType("int"); b.Property<DateTime>("UpdatedAt") .HasColumnType("datetime2"); b.HasKey("Id"); b.HasIndex("AuthorId"); b.HasIndex("PreviewId"); b.ToTable("Posts"); b.HasData( new { Id = 1, AuthorId = 2, Body = "Sequi aut laborum sit dolorem nam autem modi ut quaerat.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 168, DateTimeKind.Local).AddTicks(7755), IsDeleted = false, PreviewId = 30, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 168, DateTimeKind.Local).AddTicks(8637) }, new { Id = 2, AuthorId = 12, Body = "Ea quidem neque ut quis accusamus corrupti incidunt nemo.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(154), IsDeleted = false, PreviewId = 30, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(203) }, new { Id = 3, AuthorId = 9, Body = "qui", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(815), IsDeleted = false, PreviewId = 25, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(834) }, new { Id = 4, AuthorId = 20, Body = @"At vitae vero voluptatem voluptas sint. Sed laboriosam voluptatem quidem voluptas. Nostrum possimus doloribus quibusdam laboriosam. Ipsam eum est.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(5446), IsDeleted = false, PreviewId = 29, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(5490) }, new { Id = 5, AuthorId = 12, Body = "Itaque itaque ipsum qui qui dolor. Eius ea alias. Accusamus est repudiandae.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(7302), IsDeleted = false, PreviewId = 37, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(7328) }, new { Id = 6, AuthorId = 5, Body = "mollitia", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(7419), IsDeleted = false, PreviewId = 30, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(7428) }, new { Id = 7, AuthorId = 9, Body = "rem", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(7484), IsDeleted = false, PreviewId = 35, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(7493) }, new { Id = 8, AuthorId = 2, Body = "voluptate", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(7547), IsDeleted = false, PreviewId = 24, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(7555) }, new { Id = 9, AuthorId = 11, Body = "harum", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(7612), IsDeleted = false, PreviewId = 39, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(7621) }, new { Id = 10, AuthorId = 10, Body = @"Mollitia dolorem dignissimos vel veritatis quaerat. In doloribus possimus.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(7762), IsDeleted = false, PreviewId = 30, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(7771) }, new { Id = 11, AuthorId = 17, Body = "Beatae modi voluptas laboriosam earum tempora totam.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(7877), IsDeleted = false, PreviewId = 24, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(7886) }, new { Id = 12, AuthorId = 15, Body = "Recusandae aut est quasi cupiditate et est. Labore commodi dolor dolor in recusandae dolor. Placeat est deserunt. Omnis perspiciatis dolorem voluptate id quia est vel rerum in.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(8337), IsDeleted = false, PreviewId = 29, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(8348) }, new { Id = 13, AuthorId = 19, Body = "Voluptas explicabo tempore sint incidunt tempora.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(8528), IsDeleted = false, PreviewId = 38, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(8572) }, new { Id = 14, AuthorId = 11, Body = "Odio perspiciatis earum aut quae reprehenderit ducimus fugit.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(9410), IsDeleted = false, PreviewId = 24, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(9459) }, new { Id = 15, AuthorId = 20, Body = "Ipsam laudantium aliquid omnis quibusdam omnis voluptas sapiente aut. Tenetur est vitae in eum quam. Quasi eos labore qui delectus. Ut soluta voluptas.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(9829), IsDeleted = false, PreviewId = 32, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 169, DateTimeKind.Local).AddTicks(9840) }, new { Id = 16, AuthorId = 2, Body = "Sint mollitia recusandae nostrum ex blanditiis debitis.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 170, DateTimeKind.Local).AddTicks(231), IsDeleted = false, PreviewId = 34, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 170, DateTimeKind.Local).AddTicks(248) }, new { Id = 17, AuthorId = 13, Body = "Possimus laboriosam neque doloribus in sapiente.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 170, DateTimeKind.Local).AddTicks(371), IsDeleted = false, PreviewId = 40, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 170, DateTimeKind.Local).AddTicks(380) }, new { Id = 18, AuthorId = 8, Body = @"Doloribus voluptatem ex aliquid voluptate sed. Aperiam repellat saepe cum officia totam ea tempore autem. Autem ut est. Excepturi omnis eligendi. Eveniet dolore minima et natus sit officia impedit. Id repellendus recusandae consequatur quae omnis et.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 170, DateTimeKind.Local).AddTicks(1037), IsDeleted = false, PreviewId = 21, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 170, DateTimeKind.Local).AddTicks(1048) }, new { Id = 19, AuthorId = 10, Body = @"Optio et qui ipsum tenetur labore sequi sed ea. Autem distinctio quisquam molestias officiis deserunt.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 170, DateTimeKind.Local).AddTicks(1285), IsDeleted = false, PreviewId = 25, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 170, DateTimeKind.Local).AddTicks(1295) }, new { Id = 20, AuthorId = 14, Body = @"Tenetur facere necessitatibus vero aperiam sit dolor rerum ut dolorem. Laborum officiis sed et.", CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 170, DateTimeKind.Local).AddTicks(1548), IsDeleted = false, PreviewId = 32, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 170, DateTimeKind.Local).AddTicks(1557) }); }); modelBuilder.Entity("Thread_.NET.DAL.Entities.PostReaction", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreatedAt") .HasColumnType("datetime2"); b.Property<bool>("IsLike") .HasColumnType("bit"); b.Property<int>("PostId") .HasColumnType("int"); b.Property<DateTime>("UpdatedAt") .HasColumnType("datetime2"); b.Property<int>("UserId") .HasColumnType("int"); b.HasKey("Id"); b.HasAlternateKey("PostId", "UserId"); b.HasIndex("UserId"); b.ToTable("PostReactions"); b.HasData( new { Id = 1, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 205, DateTimeKind.Local).AddTicks(8139), IsLike = false, PostId = 20, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 205, DateTimeKind.Local).AddTicks(9666), UserId = 9 }, new { Id = 2, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(1213), IsLike = false, PostId = 19, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(1273), UserId = 10 }, new { Id = 3, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(1407), IsLike = false, PostId = 8, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(1435), UserId = 15 }, new { Id = 4, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(1541), IsLike = false, PostId = 20, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(1987), UserId = 4 }, new { Id = 5, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(2183), IsLike = false, PostId = 2, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(2199), UserId = 12 }, new { Id = 6, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(2305), IsLike = true, PostId = 16, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(2330), UserId = 18 }, new { Id = 7, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(2463), IsLike = false, PostId = 17, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(2493), UserId = 9 }, new { Id = 8, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(2622), IsLike = true, PostId = 14, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(2642), UserId = 19 }, new { Id = 9, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(2735), IsLike = true, PostId = 11, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(2748), UserId = 10 }, new { Id = 10, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(2813), IsLike = true, PostId = 8, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(2840), UserId = 7 }, new { Id = 11, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(2963), IsLike = false, PostId = 2, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(2993), UserId = 6 }, new { Id = 12, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(3072), IsLike = true, PostId = 14, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(3099), UserId = 11 }, new { Id = 13, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(3212), IsLike = true, PostId = 17, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(3238), UserId = 3 }, new { Id = 14, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(3405), IsLike = true, PostId = 1, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(3420), UserId = 6 }, new { Id = 15, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(3500), IsLike = true, PostId = 4, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(3514), UserId = 7 }, new { Id = 16, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(3631), IsLike = true, PostId = 12, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(3655), UserId = 19 }, new { Id = 17, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(3766), IsLike = true, PostId = 12, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(3792), UserId = 21 }, new { Id = 18, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(3901), IsLike = false, PostId = 10, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(3921), UserId = 15 }, new { Id = 19, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(4029), IsLike = false, PostId = 11, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(4052), UserId = 9 }, new { Id = 20, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(4163), IsLike = true, PostId = 20, UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 206, DateTimeKind.Local).AddTicks(4189), UserId = 15 }); }); modelBuilder.Entity("Thread_.NET.DAL.Entities.RefreshToken", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime>("CreatedAt") .HasColumnType("datetime2"); b.Property<DateTime>("Expires") .HasColumnType("datetime2"); b.Property<string>("Token") .HasColumnType("nvarchar(max)"); b.Property<DateTime>("UpdatedAt") .HasColumnType("datetime2"); b.Property<int>("UserId") .HasColumnType("int"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("RefreshTokens"); }); modelBuilder.Entity("Thread_.NET.DAL.Entities.User", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<int?>("AvatarId") .HasColumnType("int"); b.Property<DateTime>("CreatedAt") .HasColumnType("datetime2"); b.Property<string>("Email") .HasColumnType("nvarchar(max)"); b.Property<double>("Latitude") .HasColumnType("float"); b.Property<double>("Longitude") .HasColumnType("float"); b.Property<string>("Password") .HasColumnType("nvarchar(max)"); b.Property<string>("Salt") .HasColumnType("nvarchar(max)"); b.Property<DateTime>("UpdatedAt") .HasColumnType("datetime2"); b.Property<string>("UserName") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("AvatarId"); b.ToTable("Users"); b.HasData( new { Id = 1, AvatarId = 3, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 887, DateTimeKind.Local).AddTicks(477), Email = "Valerie56@gmail.com", Latitude = 0.0, Longitude = 0.0, Password = "RAxVJjBw4VaA/Fgv7vDzBWIFiGXcZ9FGyRnEDhxmeL4=", Salt = "ndxv+T8eHj53x/F1jxkBQcEfuyS2pK3yNawhVXE7h6E=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 887, DateTimeKind.Local).AddTicks(1394), UserName = "Paula98" }, new { Id = 2, AvatarId = 18, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 900, DateTimeKind.Local).AddTicks(4885), Email = "Sheridan.Moore33@gmail.com", Latitude = 0.0, Longitude = 0.0, Password = "GpDjx1ocDWbhKENKpI2NMhCvA3Dk/5kCGUQjaavvM5c=", Salt = "nUhYYm3I/t0wnQUNnoy+Pc1xeslVcNOs1hhoyGjKqhA=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 900, DateTimeKind.Local).AddTicks(4995), UserName = "Lawson_Paucek49" }, new { Id = 3, AvatarId = 13, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 912, DateTimeKind.Local).AddTicks(9014), Email = "Flavie_Bednar@yahoo.com", Latitude = 0.0, Longitude = 0.0, Password = "VQ+SPBcPjryL3yl1ZpWW788wyuUis9cvqAhqkckQ8tg=", Salt = "IwAzQC2ApY3OJsjT5IS0XursX0tkx1LrqtRzAVd3vN0=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 912, DateTimeKind.Local).AddTicks(9102), UserName = "Alden.Boehm85" }, new { Id = 4, AvatarId = 14, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 925, DateTimeKind.Local).AddTicks(9163), Email = "Trinity.Rosenbaum50@gmail.com", Latitude = 0.0, Longitude = 0.0, Password = "8vyo0HfCynGLXb0cSPkd9hsAWdlYnjaLVPb2IwDBjdc=", Salt = "E4xtHJwHxeJ+GOd9vV0VZNNTyGxFB8CPmu96c+qQ2E4=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 925, DateTimeKind.Local).AddTicks(9254), UserName = "Juliana92" }, new { Id = 5, AvatarId = 15, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 939, DateTimeKind.Local).AddTicks(7905), Email = "Zoila.Simonis@hotmail.com", Latitude = 0.0, Longitude = 0.0, Password = "L49seZKXb2UasfxwvcEGU32m2SiYtflO1Qu+1vY4rec=", Salt = "RzwpXNdaueDQ4sE62tAGujW+SQ/KXv9ZmX8f0t9cNjo=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 939, DateTimeKind.Local).AddTicks(8025), UserName = "Buck62" }, new { Id = 6, AvatarId = 20, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 953, DateTimeKind.Local).AddTicks(4987), Email = "Joannie_Block@yahoo.com", Latitude = 0.0, Longitude = 0.0, Password = "MogqDbTQ1BTiCK497biWL8kYw9CVIsO0WdO3LTQysOE=", Salt = "ix8C02PCzSsxK2TCe0brWA5dxu0QbOithKd2/+kKXn8=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 953, DateTimeKind.Local).AddTicks(5078), UserName = "Junior40" }, new { Id = 7, AvatarId = 9, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 966, DateTimeKind.Local).AddTicks(2820), Email = "Elinore_Smith68@gmail.com", Latitude = 0.0, Longitude = 0.0, Password = "9KEKTBGbJ/B8Z9FQqA5lPXGpEjwV6K7ZejmhybT/Avw=", Salt = "m2X1ivMu7fMs3ls9UkuBQ6+PJEEmXaj3Z2JuJ3Ws/+U=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 966, DateTimeKind.Local).AddTicks(2913), UserName = "Trey34" }, new { Id = 8, AvatarId = 20, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 980, DateTimeKind.Local).AddTicks(8184), Email = "Cyrus2@gmail.com", Latitude = 0.0, Longitude = 0.0, Password = "Vi27zYFWx6YHy4IDz/aFQtc+Vn0WK0uoM9mO4D4RX/M=", Salt = "fYpsB2ss9TieY6Pz12qKjMefZ9tJ2g6KKZAWjrId/W4=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 980, DateTimeKind.Local).AddTicks(8280), UserName = "Breanna.OReilly" }, new { Id = 9, AvatarId = 18, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 993, DateTimeKind.Local).AddTicks(2522), Email = "Aniya44@hotmail.com", Latitude = 0.0, Longitude = 0.0, Password = "OQlq7plKykKSe2H7hzH1vSqu8SqXUVtC9HgN98ssUJI=", Salt = "MMSIBD94Q6lH/vtW6fLLyhTDeUWYY5OM7oq6FYUenG0=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 17, 993, DateTimeKind.Local).AddTicks(2607), UserName = "Ken76" }, new { Id = 10, AvatarId = 10, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 5, DateTimeKind.Local).AddTicks(5822), Email = "Wellington88@yahoo.com", Latitude = 0.0, Longitude = 0.0, Password = "MYy344dQuZLX/5RnpdWGA11SendqS+rMgnZBRxkO+rE=", Salt = "V7e4KQohtRMo3bLQu5Q1WG9nECGSVbM72+Kr63CiYOA=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 5, DateTimeKind.Local).AddTicks(5895), UserName = "Maggie96" }, new { Id = 11, AvatarId = 7, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 18, DateTimeKind.Local).AddTicks(407), Email = "Joelle.Kessler@gmail.com", Latitude = 0.0, Longitude = 0.0, Password = "4G+HdO5KtBDDyj7lB9xpz/gnElLvQo6uDXZhig69l9E=", Salt = "QKwPTPy0BAtC35Hzo1xPNv3MaoIkQ9TISygWkh7JsJk=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 18, DateTimeKind.Local).AddTicks(480), UserName = "Keenan_West" }, new { Id = 12, AvatarId = 19, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 30, DateTimeKind.Local).AddTicks(530), Email = "Bethany0@yahoo.com", Latitude = 0.0, Longitude = 0.0, Password = "GxGT8rORMR/FAezpNqdRdp8iT+jROnLzAb7lfgeb8zI=", Salt = "p66EVyirY/rY1Zb6iNF4jrAtW5ktx1AMrfW/2DyPc3o=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 30, DateTimeKind.Local).AddTicks(580), UserName = "Dora27" }, new { Id = 13, AvatarId = 9, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 42, DateTimeKind.Local).AddTicks(674), Email = "Mason69@gmail.com", Latitude = 0.0, Longitude = 0.0, Password = "1GW+NwS9m6538bWIV3iYA9XCh0zuJE09L99VEAoC/VA=", Salt = "GgqwJzUK24yIZMMSB78IbcZCu9Dym7dJKjs0ivnJ0kk=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 42, DateTimeKind.Local).AddTicks(739), UserName = "Steve33" }, new { Id = 14, AvatarId = 8, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 53, DateTimeKind.Local).AddTicks(7762), Email = "Sidney.Bogan60@gmail.com", Latitude = 0.0, Longitude = 0.0, Password = "/qYBGRprbzZTWvKsKA1TXE0nL9XyO1xe2YyXf58MrYw=", Salt = "T1uKSU8BEGe4G4vW7PtmcE1a+t84t/lrbz4jI3HNqg8=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 53, DateTimeKind.Local).AddTicks(7786), UserName = "Ethan.Ondricka13" }, new { Id = 15, AvatarId = 14, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 65, DateTimeKind.Local).AddTicks(9146), Email = "Garrison16@hotmail.com", Latitude = 0.0, Longitude = 0.0, Password = "LVgX7OqPFtq+YLKxomGcFC6LasbPqdlenien71+lL3o=", Salt = "zolREQL0AN9b1WRlvdv2eT5P5Q66oJO/LPw3QDsUU8s=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 65, DateTimeKind.Local).AddTicks(9215), UserName = "Furman.Renner" }, new { Id = 16, AvatarId = 6, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 77, DateTimeKind.Local).AddTicks(9634), Email = "Kieran29@gmail.com", Latitude = 0.0, Longitude = 0.0, Password = "chYLeSY5qV9IYXsSQVutytPQGN59ooqjP808d2HjPIo=", Salt = "MxIHEXRpwOcHiBAgIfN0uaeZ2PCfkU4Xu12ERi7iWaw=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 77, DateTimeKind.Local).AddTicks(9697), UserName = "Alejandrin43" }, new { Id = 17, AvatarId = 14, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 90, DateTimeKind.Local).AddTicks(4022), Email = "Montana_Herman@hotmail.com", Latitude = 0.0, Longitude = 0.0, Password = "pIvx49jIlJQEokvDBaG8AnhdICSkF1eb9Z1cbA/dPGw=", Salt = "ZRURuae5KV+gNH9FfPZGpa0za0D7wwzYyzJft2IVkA0=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 90, DateTimeKind.Local).AddTicks(4105), UserName = "Brandyn.Gleason" }, new { Id = 18, AvatarId = 7, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 102, DateTimeKind.Local).AddTicks(7387), Email = "Hershel_Luettgen@hotmail.com", Latitude = 0.0, Longitude = 0.0, Password = "jI34/NiK1caJuE9bD2taeDL7lGQrvurQmIukbVp+PDo=", Salt = "KvTkcC87Xa4tzfvuYbyljIce3RNTlOtIWN0XlL6ttpw=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 102, DateTimeKind.Local).AddTicks(7434), UserName = "Arnold36" }, new { Id = 19, AvatarId = 6, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 115, DateTimeKind.Local).AddTicks(5716), Email = "Theron73@hotmail.com", Latitude = 0.0, Longitude = 0.0, Password = "vwrUFnOl01h8LO9BCF2hh35IbNoBktiRUmas5fd4gQs=", Salt = "yVuMt3fV0/o2UaDTOnx5irXH5yY34cS09aeY+Qec6V0=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 115, DateTimeKind.Local).AddTicks(5796), UserName = "Angelica_Von" }, new { Id = 20, AvatarId = 16, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 133, DateTimeKind.Local).AddTicks(3592), Email = "Rafael33@yahoo.com", Latitude = 0.0, Longitude = 0.0, Password = "b8RCgln97mJ5oKm7R4SLlxerCwBnOAq8RYzinunO3TU=", Salt = "x1C70iCTL62OhvAuee3M/lnnKDE8fxPHG/xbdjxgFlM=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 133, DateTimeKind.Local).AddTicks(4918), UserName = "Suzanne.Kautzer" }, new { Id = 21, CreatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 149, DateTimeKind.Local).AddTicks(7621), Email = "test@gmail.com", Latitude = 0.0, Longitude = 0.0, Password = "drOsGCT3T3sTIlj6+b388G+vaCr2HhQepdnHBSFHUME=", Salt = "8yii0fqnVOMdrzhHjfYbEaEVl6pXdqKWJ6g9S0bnHGw=", UpdatedAt = new DateTime(2020, 9, 20, 11, 17, 18, 149, DateTimeKind.Local).AddTicks(7621), UserName = "testUser" }); }); modelBuilder.Entity("Thread_.NET.DAL.Entities.Comment", b => { b.HasOne("Thread_.NET.DAL.Entities.User", "Author") .WithMany() .HasForeignKey("AuthorId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Thread_.NET.DAL.Entities.Post", "Post") .WithMany("Comments") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); }); modelBuilder.Entity("Thread_.NET.DAL.Entities.CommentReaction", b => { b.HasOne("Thread_.NET.DAL.Entities.Comment", "Comment") .WithMany("Reactions") .HasForeignKey("CommentId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Thread_.NET.DAL.Entities.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Thread_.NET.DAL.Entities.Post", b => { b.HasOne("Thread_.NET.DAL.Entities.User", "Author") .WithMany() .HasForeignKey("AuthorId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Thread_.NET.DAL.Entities.Image", "Preview") .WithMany() .HasForeignKey("PreviewId") .OnDelete(DeleteBehavior.Restrict); }); modelBuilder.Entity("Thread_.NET.DAL.Entities.PostReaction", b => { b.HasOne("Thread_.NET.DAL.Entities.Post", "Post") .WithMany("Reactions") .HasForeignKey("PostId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Thread_.NET.DAL.Entities.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Thread_.NET.DAL.Entities.RefreshToken", b => { b.HasOne("Thread_.NET.DAL.Entities.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Thread_.NET.DAL.Entities.User", b => { b.HasOne("Thread_.NET.DAL.Entities.Image", "Avatar") .WithMany() .HasForeignKey("AvatarId"); }); #pragma warning restore 612, 618 } } }
53.405149
214
0.396443
da1fe7fe74fbc4d954a9e1e6727402b9d4639354
3,900
php
PHP
resources/views/contact/index.blade.php
asatbek2000/Uzbekisatan
3998ad029a23887bc21be39749d029d4cde9ffaf
[ "MIT" ]
1
2021-05-11T10:20:03.000Z
2021-05-11T10:20:03.000Z
resources/views/contact/index.blade.php
asatbek2000/Uzbekisatan
3998ad029a23887bc21be39749d029d4cde9ffaf
[ "MIT" ]
null
null
null
resources/views/contact/index.blade.php
asatbek2000/Uzbekisatan
3998ad029a23887bc21be39749d029d4cde9ffaf
[ "MIT" ]
null
null
null
@extends('layouts.body') @section('title') <title>{{__('lang.uzbekistan')}} | {{__('lang.contact')}}</title> @endsection @section('content') <section class="contact"> <div class="container"> <div class="contact__main"> <div class="row"> <div class="col-md-6"> <div class="contact__map-container"> <div> <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d193719.60372944287!2d72.09064282123765!3d40.654822238128894!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x38bc8e7e79c1f5c5%3A0xefe3af9c366863df!2z0JDRgdCw0LrQuNC90YHQutC40Lkg0YDQsNC50L7QvSwg0KPQt9Cx0LXQutC40YHRgtCw0L0!5e0!3m2!1sru!2s!4v1618053026633!5m2!1sru!2s" width="100%" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe> </div><!-- .contact__map --> </div> </div><!-- .col --> <div class="col-md-6"> @if ($errors->any()) <div class="warning-msg"> <ul style="list-style:none;"> @foreach ($errors->all() as $error) <li><i class="fa fa-warning"></i> {{ $error }}</li> @endforeach </ul> </div> @elseif (session('success')) <div class="success-msg"> <i class="fa fa-check"></i> {{ session('success') }} </div> @endif <h2 class="contact__title">{{__('lang.send_us_msg')}}</h2> <div class="contact__desc"> </div> <form class="contact-form contact-form--no-padding" method="POST" action="{{ route('contacts.store') }}"> @csrf <div class="contact-form__body"> <div class="row"> <div class="col-md-12"> <input type="text" class="contact-form__field contact-form__field--contact" placeholder="{{__('lang.name')}}" name="name" required> </div> <div class="col-md-12"> <input type="tel" class="contact-form__field contact-form__field--contact" placeholder="+(998)__-___-____" id="phone" name="phone_number"> </div> </div> <textarea class="contact-form__field contact-form__comment contact-form__field--contact" cols="30" rows="4" placeholder="{{__('lang.message')}}.." name="message" required></textarea> </div><!-- .contact-form__body --> <div class="contact-form__footer"> <input type="submit" class="contact-form__submit contact-form__submit--contact" value="{{__('lang.send')}}"> </div><!-- .contact-form__footer --> </form><!-- .contact-form --> </div><!-- .col --> </div><!-- .row --> </div><!-- .contact__main --> </div> </section><!-- .contact --> @endsection
51.315789
363
0.401026
7fc73e701b59e3a484d9a7f266ce8458a7446861
237
sql
SQL
Famoser.Telemetry.Api/src/Assets/sql/applications/test.sql
famoser/Telemetry
5d35808b706bc109a56ddb8f64bdbbdabf36ff01
[ "MIT" ]
null
null
null
Famoser.Telemetry.Api/src/Assets/sql/applications/test.sql
famoser/Telemetry
5d35808b706bc109a56ddb8f64bdbbdabf36ff01
[ "MIT" ]
null
null
null
Famoser.Telemetry.Api/src/Assets/sql/applications/test.sql
famoser/Telemetry
5d35808b706bc109a56ddb8f64bdbbdabf36ff01
[ "MIT" ]
null
null
null
INSERT INTO applications (id, guid, name, description, projectUrl) VALUES (0, '29685dba-b863-4538-9127-2b4612034fdc', 'Test Application', 'This Application is used to test the telemetry API', 'https://github.com/famoser/Telemetry')
59.25
96
0.755274
0597ae74f246c6e783fe9f84a6702109ad2f556d
1,627
swift
Swift
Project 03 - FacebookMe/FacebookMe/TableKeys.swift
elppaaa/Study-Swift-30-Projects
d5b941755668e5a0b891c5bde2e00318995c90c7
[ "Apache-2.0" ]
null
null
null
Project 03 - FacebookMe/FacebookMe/TableKeys.swift
elppaaa/Study-Swift-30-Projects
d5b941755668e5a0b891c5bde2e00318995c90c7
[ "Apache-2.0" ]
null
null
null
Project 03 - FacebookMe/FacebookMe/TableKeys.swift
elppaaa/Study-Swift-30-Projects
d5b941755668e5a0b891c5bde2e00318995c90c7
[ "Apache-2.0" ]
null
null
null
// // TableKeys.swift // FacebookMe // // Copyright © 2017 Yi Gu. All rights reserved. // import Foundation public struct TableKeys { init() { } static let image = RowKey.image static let title = RowKey.title static let subtitle = RowKey.subTitle static func populate2(withUser user: FBMeUser) -> [TableSectionData] { return [ TableSectionData(sectionName: nil, rows: [ [image: user.avatarName, title: user.name, subtitle: "View your profile"], ]), TableSectionData(sectionName: nil, rows: [ [image: Specs.imageName.friends, title: "Friends"], [image: Specs.imageName.events, title: "Events"], [image: Specs.imageName.groups, title: "Groups"], [image: Specs.imageName.education, title: user.education], [image: Specs.imageName.townHall, title: "Town Hall"], [image: Specs.imageName.instantGames, title: "Instant Games"], [title: Specs.String.seeMore] ]), TableSectionData(sectionName: "FAVORITES", rows: [ [title: Specs.String.addFavorites] ]), TableSectionData(sectionName: nil, rows: [ [image: Specs.imageName.settings, title: "Settings"], [image: Specs.imageName.privacyShortcuts, title: "Privacy Shortcuts"], [image: Specs.imageName.helpSupport, title: "Help and Support"] ]), TableSectionData(sectionName: nil, rows: [ [title: Specs.String.logout] ]), ] } } enum RowKey { case image, title, subTitle } typealias RowModel = [RowKey: String] struct TableSectionData { let sectionName: String? let rows: [RowModel] }
27.116667
82
0.646589
3d564088bd852573fa0521ea749cbbf37a1d4c08
13,954
sql
SQL
db/e-healt.sql
irfanard27/e-healt
36db53148f2d65bc60409a9f70745c38e9c77b8b
[ "BSD-3-Clause" ]
null
null
null
db/e-healt.sql
irfanard27/e-healt
36db53148f2d65bc60409a9f70745c38e9c77b8b
[ "BSD-3-Clause" ]
null
null
null
db/e-healt.sql
irfanard27/e-healt
36db53148f2d65bc60409a9f70745c38e9c77b8b
[ "BSD-3-Clause" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 4.5.2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jan 04, 2018 at 04:01 PM -- Server version: 10.1.13-MariaDB -- PHP Version: 7.0.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `e-health` -- -- -------------------------------------------------------- -- -- Table structure for table `action` -- CREATE TABLE `action` ( `id` int(11) NOT NULL, `menu` int(11) NOT NULL, `action` varchar(100) NOT NULL, `role` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `action` -- INSERT INTO `action` (`id`, `menu`, `action`, `role`) VALUES (43, 5, 'update', 1), (42, 5, 'create', 1), (41, 5, 'view', 1), (40, 5, 'index', 1), (39, 4, 'registeruser', 1), (38, 4, 'delete', 1), (37, 4, 'update', 1), (36, 4, 'create', 1), (35, 4, 'view', 1), (34, 4, 'index', 1), (33, 3, 'setting', 1), (32, 3, 'delete', 1), (31, 3, 'update', 1), (30, 3, 'create', 1), (29, 3, 'view', 1), (28, 3, 'index', 1), (27, 2, 'delete', 1), (26, 2, 'update', 1), (25, 2, 'create', 1), (24, 2, 'view', 1), (23, 2, 'index', 1), (44, 5, 'delete', 1), (275, 32, 'delete', 2), (274, 32, 'update', 2), (273, 32, 'create', 2), (272, 32, 'view', 2), (271, 32, 'index', 2), (270, 33, 'delete', 2), (269, 33, 'update', 2), (268, 33, 'create', 2), (267, 33, 'view', 2), (266, 33, 'index', 2), (265, 34, 'delete', 2), (264, 34, 'update', 2), (263, 34, 'create', 2), (262, 34, 'view', 2), (261, 34, 'index', 2), (260, 35, 'delete', 2), (259, 35, 'update', 2), (258, 35, 'create', 2), (257, 35, 'view', 2), (256, 35, 'index', 2), (255, 36, 'delete', 2), (254, 36, 'update', 2), (253, 36, 'create', 2), (252, 36, 'view', 2), (251, 36, 'index', 2); -- -------------------------------------------------------- -- -- Table structure for table `dokter` -- CREATE TABLE `dokter` ( `id` int(11) NOT NULL, `nama_dokter` varchar(200) NOT NULL, `spesialis` varchar(200) NOT NULL, `alamat` varchar(200) NOT NULL, `telepon` varchar(200) NOT NULL, `priv` varchar(200) NOT NULL, `id_user` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `dokter` -- INSERT INTO `dokter` (`id`, `nama_dokter`, `spesialis`, `alamat`, `telepon`, `priv`, `id_user`) VALUES (1, 'Andi malaranggeng', 'kulit', 'Surabaya', '9080728748', 'bagus', 13); -- -------------------------------------------------------- -- -- Table structure for table `menu` -- CREATE TABLE `menu` ( `id` int(11) NOT NULL, `menu` varchar(100) NOT NULL, `icon` varchar(100) NOT NULL, `parent` varchar(100) NOT NULL, `module` varchar(100) NOT NULL, `controller` varchar(100) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `menu` -- INSERT INTO `menu` (`id`, `menu`, `icon`, `parent`, `module`, `controller`) VALUES (1, 'Setting', 'fa fa-gear', '', '2', ''), (2, 'Menu Backend', 'fa fa-align-justify', '1', '2', 'menu'), (3, 'Role', 'fa fa-check-circle', '1', '2', 'role'), (4, 'User', 'fa fa-users', '', '2', 'user'), (5, 'Module Aplikasi', 'fa fa-asterisk', '', '2', 'module'), (36, 'Surat Rujukan', 'fa fa-send', '', '2', 'surat-rujukan'), (35, 'Resume Medis', 'fa fa-th-list', '', '2', 'resume-medis'), (34, 'Rumah Sakit', 'fa fa-stethoscope', '31', '2', 'rumah-sakit'), (33, 'dokter', 'fa fa-user-md', '31', '2', 'dokter'), (32, 'pasien', 'fa fa-user', '31', '2', 'pasien'), (31, 'master', 'fa fa-align-justify', '', '2', ''); -- -------------------------------------------------------- -- -- Table structure for table `migration` -- CREATE TABLE `migration` ( `version` varchar(180) NOT NULL, `apply_time` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `migration` -- INSERT INTO `migration` (`version`, `apply_time`) VALUES ('m000000_000000_base', 1479231545), ('m140506_102106_rbac_init', 1479231864); -- -------------------------------------------------------- -- -- Table structure for table `module` -- CREATE TABLE `module` ( `id` int(11) NOT NULL, `module` varchar(100) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `module` -- INSERT INTO `module` (`id`, `module`) VALUES (1, 'frontend'), (2, 'backend'); -- -------------------------------------------------------- -- -- Table structure for table `pasien` -- CREATE TABLE `pasien` ( `id` int(11) NOT NULL, `nama_pasien` varchar(200) NOT NULL, `jenis_kelamin` varchar(100) NOT NULL, `ttl` varchar(100) NOT NULL, `status_perkawinan` varchar(100) NOT NULL, `alamat_pasien` varchar(200) NOT NULL, `telepon` varchar(12) NOT NULL, `tanggal` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `pasien` -- INSERT INTO `pasien` (`id`, `nama_pasien`, `jenis_kelamin`, `ttl`, `status_perkawinan`, `alamat_pasien`, `telepon`, `tanggal`) VALUES (1, 'Michele Buoti', 'laki-laki', 'Mojokerto, 18-03-1996', 'belum kawin', 'surabaya', '087437387483', '0000-00-00'), (2, 'vika ramadani', 'perempuan', 'Mojokerto, 18-03-1996', 'kawin', 'surabaya', '087437387483', '1996-03-12'); -- -------------------------------------------------------- -- -- Table structure for table `resume_medis` -- CREATE TABLE `resume_medis` ( `id` int(11) NOT NULL, `id_resume_medis` varchar(100) NOT NULL, `pasien` int(11) NOT NULL, `diagnosa_awal` varchar(200) NOT NULL, `diagnosa_akhir` varchar(200) NOT NULL, `operasi` int(11) NOT NULL, `riwayat_penyakit` text NOT NULL, `pemeriksaan_fisik` varchar(200) NOT NULL, `hasil_lab` varchar(200) NOT NULL, `perkembangan` varchar(200) NOT NULL, `keismpulan` text NOT NULL, `tgl_masuk` varchar(100) NOT NULL, `tgl_keluar` varchar(200) NOT NULL, `nama_dokter` int(11) NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `resume_medis` -- INSERT INTO `resume_medis` (`id`, `id_resume_medis`, `pasien`, `diagnosa_awal`, `diagnosa_akhir`, `operasi`, `riwayat_penyakit`, `pemeriksaan_fisik`, `hasil_lab`, `perkembangan`, `keismpulan`, `tgl_masuk`, `tgl_keluar`, `nama_dokter`, `created_at`, `updated_at`) VALUES (1, 'RMD-1514472595', 1, 'kanker', 'kanker', 1, 'dsds', 'tidak tau', 'tidak tau', 'baik', 'dsds', '20-12-2017', '27-12-2017', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (2, 'RMD-1514473029', 2, 'kanker', 'kanker', 1, 'sasa', 'sasa', 'sas', 'sasa', 'sasa', '26-12-2017', '26-12-2017', 1, '2017-12-28 14:57:13', '0000-00-00 00:00:00'); -- -------------------------------------------------------- -- -- Table structure for table `role` -- CREATE TABLE `role` ( `id` int(11) NOT NULL, `role` varchar(100) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `role` -- INSERT INTO `role` (`id`, `role`) VALUES (1, 'developer'), (2, 'administrator'), (3, 'dokter'); -- -------------------------------------------------------- -- -- Table structure for table `role_menu` -- CREATE TABLE `role_menu` ( `id` int(11) NOT NULL, `role` int(11) NOT NULL, `menu` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `role_menu` -- INSERT INTO `role_menu` (`id`, `role`, `menu`) VALUES (90, 1, 5), (89, 1, 4), (88, 1, 3), (87, 1, 2), (86, 1, 1), (154, 2, 31), (153, 2, 32), (152, 2, 33), (151, 2, 34), (150, 2, 35), (149, 2, 36); -- -------------------------------------------------------- -- -- Table structure for table `rumah_sakit` -- CREATE TABLE `rumah_sakit` ( `id` int(11) NOT NULL, `kode` varchar(200) NOT NULL, `nama_faskes` varchar(200) NOT NULL, `tipe_faskes` varchar(200) NOT NULL, `alamat` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `rumah_sakit` -- INSERT INTO `rumah_sakit` (`id`, `kode`, `nama_faskes`, `tipe_faskes`, `alamat`) VALUES (1, 'RSK-001', 'RUMAH SAKIT CITRA MEDIKA', 'tes', 'tes'), (2, 'RSK-002', 'RUMAH SAKIT KUNCORO GENI', 'tes', 'tes'), (3, 'RSK-003', 'RUMAH SAKIT SAMPUN WARAS', 'tes', 'tes'); -- -------------------------------------------------------- -- -- Table structure for table `surat_rujukan` -- CREATE TABLE `surat_rujukan` ( `id` int(11) NOT NULL, `resume_medis` int(11) NOT NULL, `kode_rujukan` varchar(100) NOT NULL, `keadaan` varchar(100) NOT NULL, `rs_asal` int(11) NOT NULL, `rs_tujuan` int(11) NOT NULL, `nama_dokter` int(11) NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `surat_rujukan` -- INSERT INTO `surat_rujukan` (`id`, `resume_medis`, `kode_rujukan`, `keadaan`, `rs_asal`, `rs_tujuan`, `nama_dokter`, `created_at`, `updated_at`) VALUES (1, 1, 'RJK-1514902153', 'hsjahsa', 1, 2, 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `id` int(11) NOT NULL, `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `auth_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `password_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `password_reset_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `status` smallint(6) NOT NULL DEFAULT '10', `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, `role` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id`, `username`, `auth_key`, `password_hash`, `password_reset_token`, `email`, `status`, `created_at`, `updated_at`, `role`) VALUES (1, 'developer', 'hX2iXXGf-6-jNoAidotAxlhUBZxhgNdS', '$2y$13$0N.Ruj8ZRE8GifJVTvAhyefdXX2qHMYhhlGih1O5Avy/z5WJGugI.', NULL, 'developer@mail.com', 10, 1477197448, 1479234102, 1), (2, 'admin', '1RnIfzw1x4lVoRBWnVyxKex7C2Yzz53j', '$2y$13$2Sv7RcTDAiEfhqtgkZvRA.4Am./iM3Pdt7djQsxMsklGSvwpxwm0u', NULL, 'admin@siakad.com', 10, 1480135793, 1480135793, 2), (13, 'hendra', 'mbyzvGZZjK7rOimEmO7a1DVdFLtQSwh-', '$2y$13$JZe4zlgo8U5mKU91d7906O6KUcwGuEJcMRIW.G61smlFzyMAY62Dq', NULL, 'hendra@mail.com', 10, 1514466942, 1514466942, 0); -- -- Indexes for dumped tables -- -- -- Indexes for table `action` -- ALTER TABLE `action` ADD PRIMARY KEY (`id`), ADD KEY `role` (`role`), ADD KEY `menu` (`menu`); -- -- Indexes for table `dokter` -- ALTER TABLE `dokter` ADD PRIMARY KEY (`id`), ADD KEY `id_user` (`id_user`); -- -- Indexes for table `menu` -- ALTER TABLE `menu` ADD PRIMARY KEY (`id`), ADD KEY `module` (`module`); -- -- Indexes for table `migration` -- ALTER TABLE `migration` ADD PRIMARY KEY (`version`); -- -- Indexes for table `module` -- ALTER TABLE `module` ADD PRIMARY KEY (`id`); -- -- Indexes for table `pasien` -- ALTER TABLE `pasien` ADD PRIMARY KEY (`id`); -- -- Indexes for table `resume_medis` -- ALTER TABLE `resume_medis` ADD PRIMARY KEY (`id`), ADD KEY `pasien` (`pasien`), ADD KEY `nama_dokter` (`nama_dokter`); -- -- Indexes for table `role` -- ALTER TABLE `role` ADD PRIMARY KEY (`id`); -- -- Indexes for table `role_menu` -- ALTER TABLE `role_menu` ADD PRIMARY KEY (`id`), ADD KEY `role` (`role`), ADD KEY `menu` (`menu`); -- -- Indexes for table `rumah_sakit` -- ALTER TABLE `rumah_sakit` ADD PRIMARY KEY (`id`); -- -- Indexes for table `surat_rujukan` -- ALTER TABLE `surat_rujukan` ADD PRIMARY KEY (`id`), ADD KEY `resume_medis` (`resume_medis`), ADD KEY `nama_dokter` (`nama_dokter`), ADD KEY `rs_tujuan` (`rs_tujuan`), ADD KEY `rs_asal` (`rs_asal`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `username` (`username`), ADD UNIQUE KEY `email` (`email`), ADD UNIQUE KEY `password_reset_token` (`password_reset_token`), ADD KEY `role` (`role`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `action` -- ALTER TABLE `action` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=276; -- -- AUTO_INCREMENT for table `dokter` -- ALTER TABLE `dokter` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `menu` -- ALTER TABLE `menu` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37; -- -- AUTO_INCREMENT for table `module` -- ALTER TABLE `module` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `pasien` -- ALTER TABLE `pasien` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `resume_medis` -- ALTER TABLE `resume_medis` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `role` -- ALTER TABLE `role` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `role_menu` -- ALTER TABLE `role_menu` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=155; -- -- AUTO_INCREMENT for table `rumah_sakit` -- ALTER TABLE `rumah_sakit` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `surat_rujukan` -- ALTER TABLE `surat_rujukan` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; /*!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 */;
26.88632
269
0.623477
878183b53e239175f5efdcec10922a9977d7c62e
5,906
sql
SQL
sql/_27_banana_qa/issue_5765_timezone_support/_04_existing_functions/_02_type_casting_functions/_02_to_char/cases/_11_vi_VN_ts.sql
Zhaojia2019/cubrid-testcases
475a828e4d7cf74aaf2611fcf791a6028ddd107d
[ "BSD-3-Clause" ]
9
2016-03-24T09:51:52.000Z
2022-03-23T10:49:47.000Z
sql/_27_banana_qa/issue_5765_timezone_support/_04_existing_functions/_02_type_casting_functions/_02_to_char/cases/_11_vi_VN_ts.sql
Zhaojia2019/cubrid-testcases
475a828e4d7cf74aaf2611fcf791a6028ddd107d
[ "BSD-3-Clause" ]
173
2016-04-13T01:16:54.000Z
2022-03-16T07:50:58.000Z
sql/_27_banana_qa/issue_5765_timezone_support/_04_existing_functions/_02_type_casting_functions/_02_to_char/cases/_11_vi_VN_ts.sql
Zhaojia2019/cubrid-testcases
475a828e4d7cf74aaf2611fcf791a6028ddd107d
[ "BSD-3-Clause" ]
38
2016-03-24T17:10:31.000Z
2021-10-30T22:55:45.000Z
--test to_char function with TIMESTAMP(L)TZ columns, with vi_VN language --+ holdcas on; set system parameters 'tz_leap_second_support=yes'; set system parameters 'intl_date_lang=vi_VN'; set names utf8; create table tz_test(id int primary key, ts timestamp, tsltz timestamp with local time zone, tstz timestamp with time zone); set time zone 'America/Sao_Paulo'; -- -3:00, DST insert into tz_test values(1, '2025-12-31 22:30:45', '2025-12-31 22:30:45 -2:25', '2025-12-31 22:30:45 America/Sao_Paulo'); set time zone 'America/Mexico_City'; -- -6:00, DST insert into tz_test values(2, timestamp'2014-06-30 7:30:21 PM', timestamptz'2014-06-30 7:30:21 PM +10:30', timestamptz'2014-06-30 7:30:21 PM America/New_York'); set time zone 'Asia/Shanghai'; insert into tz_test values(3, '2014-06-30 7:30:21', '2014-06-30 7:30:21 +10:00', '2014-06-30 7:30:21 Asia/Seoul'); set time zone 'Europe/London'; -- 0:00, DST insert into tz_test values(4, '2009-01-01 12:59:59 AM', '2008-12-31 23:59:59 UTC', '2009-01-01 12:59:59 AM Europe/London'); set time zone 'America/Sao_Paulo'; -- -3:00, DST --test: new tokens select id, to_char(ts, 'TZR') ts, to_char(tsltz, 'TZR') tstz1, to_char(tstz, 'TZR') tstz2 from tz_test order by id; select id, to_char(ts, 'TZR TZD') ts, to_char(tsltz, 'TZR TZD') tstz1, to_char(tstz, 'TZR TZD') tstz2 from tz_test order by id; select id, to_char(ts, 'TZH') ts, to_char(tsltz, 'TZH') tstz1, to_char(tstz, 'TZH') tstz2 from tz_test order by id; select id, to_char(ts, 'TZH:TZM') ts, to_char(tsltz, 'TZH:TZM') tstz1, to_char(tstz, 'TZH:TZM') tstz2 from tz_test order by id; --test: [er] unsupported combination select id, to_char(ts, 'TZH TZR') ts from tz_test order by id; select id, to_char(tsltz, 'TZD:TZM') from tz_test order by id; select id, to_char(ts, 'TZH:TZM TZR TZD') from tz_test order by id; --test: default format select id, to_char(ts), to_char(tsltz), to_char(tstz) from tz_test order by 1; --test: ps, with format argument prepare st from 'select id, to_char(ts, ?), to_char(tsltz, ?), to_char(tstz, ?) from tz_test order by 1'; execute st using 'CC, YY/MM/DD HH:MI:SS.FF A.M.', 'CC, YY/MM/DD HH:MI:SS.FF A.M.', 'CC, YY/MM/DD HH:MI:SS.FF A.M.'; execute st using 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZR', 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZR', 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZR'; execute st using 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZR TZD', 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZR TZD', 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZR TZD'; execute st using 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZH:TZM', 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZH:TZM', 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZH:TZM'; set time zone '-6:23'; execute st using 'CC, YY/MM/DD HH:MI:SS A.M. TZR', 'CC, YY/MM/DD HH:MI:SS A.M. TZR', 'CC, YY/MM/DD HH:MI:SS A.M. TZR'; execute st using 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZD', 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZD', 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZD'; execute st using 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZH:TZM', 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZH:TZM', 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZH:TZM'; execute st using 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZR TZD', 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZR TZD', 'CC, YY/MM/DD HH:MI:SS.FF A.M. TZR TZD'; set time zone 'America/Mexico_City'; -- -6:00, DST execute st using 'DD"th", YYYY; DY/d HH24:MI:SS', 'DD"th", YYYY; DY/d HH24:MI:SS', 'DD"th", YYYY; DY/d HH24:MI:SS'; execute st using 'DD"th", YYYY; DY/d HH24:MI:SS TZR', 'DD"th", YYYY; DY/d HH24:MI:SS TZR', 'DD"th", YYYY; DY/d HH24:MI:SS TZR'; execute st using 'DD"th", YYYY; DY/d HH24:MI:SS TZR TZD', 'DD"th", YYYY; DY/d HH24:MI:SS TZR TZD', 'DD"th", YYYY; DY/d HH24:MI:SS TZR TZD'; execute st using 'DD"th", YYYY; DY/d HH24:MI:SS TZH', 'DD"th", YYYY; DY/d HH24:MI:SS TZH', 'DD"th", YYYY; DY/d HH24:MI:SS TZH'; execute st using 'DD"th", YYYY; DY/d HH24:MI:SS TZH TZM', 'DD"th", YYYY; DY/d HH24:MI:SS TZH TZM', 'DD"th", YYYY; DY/d HH24:MI:SS TZH TZM'; set time zone 'Asia/Shanghai'; --test: with date_lang_string_literal argument set system parameters 'intl_date_lang=ko_KR'; prepare st from 'select id, to_char(ts, ?, ''vi_VN''), to_char(tsltz, ?, ''vi_VN''), to_char(tstz, ?, ''vi_VN'') from tz_test order by 1'; execute st using 'YYYY "Quarter " Q, MONTH-DD DAY HH:MI:SS.FF PM', 'YYYY "Quarter " Q, MONTH-DD DAY HH:MI:SS.FF PM', 'YYYY "Quarter " Q, MONTH-DD DAY HH:MI:SS.FF PM'; execute st using 'YYYY "Quarter " Q, MONTH-DD DAY HH:MI:SS.FF PM TZR', 'YYYY "Quarter " Q, MONTH-DD DAY HH:MI:SS.FF PM TZR', 'YYYY "Quarter " Q, MONTH-DD DAY HH:MI:SS.FF PM TZR'; execute st using 'YYYY "Quarter " Q, MONTH-DD DAY HH:MI:SS.FF PM TZR TZD', 'YYYY "Quarter " Q, MONTH-DD DAY HH:MI:SS.FF PM TZR TZD', 'YYYY "Quarter " Q, MONTH-DD DAY HH:MI:SS.FF PM TZR TZD'; execute st using 'YYYY "Quarter " Q, MONTH-DD DAY HH:MI:SS.FF PM TZH', 'YYYY "Quarter " Q, MONTH-DD DAY HH:MI:SS.FF PM TZH', 'YYYY "Quarter " Q, MONTH-DD DAY HH:MI:SS.FF PM TZH'; execute st using 'YYYY "Quarter " Q, MONTH-DD DAY HH:MI:SS.FF PM TZH:TZM', 'YYYY "Quarter " Q, MONTH-DD DAY HH:MI:SS.FF PM TZH:TZM', 'YYYY "Quarter " Q, MONTH-DD DAY HH:MI:SS.FF PM TZH:TZM'; --test: leap seconds set time zone 'Europe/London'; -- 0:00, DST prepare st from 'select id, to_char(ts+1, ?, ''vi_VN''), to_char(tsltz+1, ?, ''vi_VN''), to_char(tstz+1, ?, ''vi_VN'') from tz_test order by 1'; execute st using 'MM/DD/YYYY HH24:MI:SS.FF TZR', 'MM/DD/YYYY HH24:MI:SS.FF TZR', 'MM/DD/YYYY HH24:MI:SS.FF TZR'; execute st using 'MM/DD/YYYY HH24:MI:SS.FF TZR;TZD', 'MM/DD/YYYY HH24:MI:SS.FF TZR;TZD', 'MM/DD/YYYY HH24:MI:SS.FF TZR;TZD'; execute st using 'MM/DD/YYYY HH24:MI:SS.FF TZH:TZM', 'MM/DD/YYYY HH24:MI:SS.FF TZH:TZM', 'MM/DD/YYYY HH24:MI:SS.FF TZH:TZM'; execute st using 'MM/DD/YYYY HH24:MI:SS.FF TZD', 'MM/DD/YYYY HH24:MI:SS.FF TZD', 'MM/DD/YYYY HH24:MI:SS.FF TZD'; deallocate prepare st; drop table tz_test; set time zone '+0:00'; set system parameters 'intl_date_lang=en_US'; set names iso88591; set system parameters 'tz_leap_second_support=no'; --+ holdcas off;
64.901099
190
0.673552
4b446b279ff75ca89e0b5f0006220913a7103f83
5,807
rs
Rust
src/document/mod.rs
nanocryk/arquery
1941394f144689e0e0f8ef840d3c0aa1d492cb9f
[ "MIT" ]
3
2020-05-14T15:46:30.000Z
2020-08-13T05:44:38.000Z
src/document/mod.rs
nanocryk/arquery
1941394f144689e0e0f8ef840d3c0aa1d492cb9f
[ "MIT" ]
null
null
null
src/document/mod.rs
nanocryk/arquery
1941394f144689e0e0f8ef840d3c0aa1d492cb9f
[ "MIT" ]
null
null
null
use std::{ collections::HashMap, fs::File, io::{BufReader, Read}, path::Path, }; use xml::reader::{EventReader, XmlEvent}; use super::{Element, SelectError}; /// The various errors that can happen when creating a document. #[derive(Clone, Debug)] pub enum DocumentError { UnableToOpenFile(String), ParseError(String), } /// The DOM tree representation of the parsed document. #[derive(Clone, Debug)] pub struct Document { root: Element, } impl Document { /// Creates a new document from a byte stream. pub fn new_from_xml_stream<R: Read>(stream: R) -> Result<Document, DocumentError> { let event_reader = EventReader::new(stream); let mut elements: Vec<Element> = Vec::new(); let mut next_node_index = 1; for event in event_reader { match event { Ok(XmlEvent::StartElement { ref name, ref attributes, .. }) => { let attr_map = attributes .iter() .fold(HashMap::new(), |mut hash_map, attribute| { hash_map.insert( attribute.name.local_name.clone(), attribute.value.clone(), ); return hash_map; }); elements.push(Element { node_index: next_node_index, children: None, tag_name: name.local_name.clone(), attr_map: attr_map, text: String::new(), }); next_node_index = next_node_index + 1; } Ok(XmlEvent::EndElement { ref name, .. }) if elements.last().unwrap().tag_name() == name.local_name => { let child_node = elements.pop().unwrap(); if let Some(mut parent) = elements.pop() { if let Some(ref mut children) = parent.children { children.push(child_node); } else { parent.children = Some(vec![child_node]); } elements.push(parent); } else { return Ok(Document { root: Element { node_index: 0, tag_name: "[root]".to_string(), children: Some(vec![child_node]), attr_map: HashMap::new(), text: String::new(), }, }); } } Ok(XmlEvent::Characters(string)) => { elements.last_mut().unwrap().text.push_str(&string); } Ok(XmlEvent::Whitespace(string)) => { elements.last_mut().unwrap().text.push_str(&string); } Err(error) => { return Err(DocumentError::ParseError(error.to_string())); } Ok(_) => {} } } panic!("Root element was not properly returned!"); } /// Creates a new document from a string. pub fn new_from_xml_string(string: &str) -> Result<Document, DocumentError> { Document::new_from_xml_stream(string.as_bytes()) } /// Creates a new document from a file. pub fn new_from_xml_file(filename: &str) -> Result<Document, DocumentError> { let path = Path::new(filename); if let Ok(file) = File::open(path) { let reader = BufReader::new(file); Document::new_from_xml_stream(reader) } else { Err(DocumentError::UnableToOpenFile( path.to_str().unwrap().to_string(), )) } } /// Returns the total number of elements in the document. pub fn number_of_elements(&self) -> usize { self.root.subtree_size() - 1 } /// Searches the document for elements matching the given CSS selector. pub fn select_all<'a>( &'a self, selector: &str, ) -> Result<Box<dyn Iterator<Item = &'a Element> + 'a>, SelectError> { self.root.select_all(selector) } /// Just like `select_all` but only returns the first match. pub fn select<'a>(&'a self, selector: &str) -> Result<&'a Element, SelectError> { self.root.select(selector) } } #[test] fn it_assigns_node_indices_in_monotonically_increasing_order() { let document = Document::new_from_xml_string( r#" <?xml version="1.0" encoding="UTF-8"?> <sample type="simple"> This is some text <!-- This is a comment --> <title>Simple Sample</title> <note long="false">Some unrecognisable scribbling</note> <related> <!-- This is another comment --> <item id="1"> <title>Another Sample</title> <ref>http://path.to.somewhere</ref> </item> <item id="2"> <title>Other Sample</title> <ref>http://some.other.path</ref> </item> </related> <!-- div soup goodness --> <div></div> <div> <other> <div></div> </other> <div> <div></div> <div> <div></div> <div></div> </div> </div> </div> </sample> "#, ) .unwrap(); assert_eq!(document.root.node_index, 0); document.root.children_deep_iter().fold(0, |index, child| { assert!(index < child.node_index); child.node_index }); }
29.627551
87
0.482349
c3514f256074864e13d5b137a8a83e82d0d04845
920
cs
C#
src/Lumina/Data/Attributes/FileExtensionAttribute.cs
attickdoor/Lumina
c6967c7294666ca187c2940fed057f9b634bfe71
[ "WTFPL" ]
48
2019-10-26T03:47:48.000Z
2022-03-23T15:58:37.000Z
src/Lumina/Data/Attributes/FileExtensionAttribute.cs
attickdoor/Lumina
c6967c7294666ca187c2940fed057f9b634bfe71
[ "WTFPL" ]
15
2020-03-17T16:48:42.000Z
2021-12-28T00:32:17.000Z
src/Lumina/Data/Attributes/FileExtensionAttribute.cs
attickdoor/Lumina
c6967c7294666ca187c2940fed057f9b634bfe71
[ "WTFPL" ]
36
2020-02-16T09:16:44.000Z
2022-03-02T21:44:36.000Z
using System; namespace Lumina.Data.Attributes { /// <summary> /// Allows for a <see cref="FileResource"/> to indicate what the extension of the file it reads is /// </summary> [AttributeUsage( AttributeTargets.Class )] public class FileExtensionAttribute : Attribute { /// <summary> /// The extension of the file that the <see cref="FileResource"/> handles. Includes the leading <code>.</code> /// </summary> public readonly string Extension; /// <summary> /// Allows for a <see cref="FileResource"/> to indicate what the extension of the file it reads is /// </summary> /// <param name="extension">The extension that the <see cref="FileResource"/> supports. Include the leading period <code>.</code></param> public FileExtensionAttribute( string extension ) { Extension = extension; } } }
36.8
145
0.625