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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2a214423f46900ffbfcb48498a1785d4140ce92d | 3,980 | java | Java | FinalProjectCheckOutTest/src/lm44_xw47/chatRoom/controller/ChatRoomController.java | git-malu/OOP-Projects | 8a44e4acf60111acdc946dc8bcd39478cfa20621 | [
"MIT"
] | null | null | null | FinalProjectCheckOutTest/src/lm44_xw47/chatRoom/controller/ChatRoomController.java | git-malu/OOP-Projects | 8a44e4acf60111acdc946dc8bcd39478cfa20621 | [
"MIT"
] | null | null | null | FinalProjectCheckOutTest/src/lm44_xw47/chatRoom/controller/ChatRoomController.java | git-malu/OOP-Projects | 8a44e4acf60111acdc946dc8bcd39478cfa20621 | [
"MIT"
] | null | null | null | package lm44_xw47.chatRoom.controller;
import java.rmi.RemoteException;
import common.DataPacketCR;
import common.ICRCmd2ModelAdapter;
import common.ICRMessageType;
import common.IChatRoom;
import common.IComponentFactory;
import common.IReceiver;
import common.IUser;
import lm44_xw47.chatRoom.model.ChatRoomModel;
import lm44_xw47.chatRoom.model.IChatRoomModel2ViewAdapter;
import lm44_xw47.chatRoom.model.ILocalCRCmd2ModelAdapter;
import lm44_xw47.chatRoom.view.ChatRoomView;
import lm44_xw47.chatRoom.view.IChatRoomView2ModelAdapter;
import lm44_xw47.model.Receiver;
import lm44_xw47.view.MainViewFrame;
import provided.mixedData.MixedDataDictionary;
import provided.mixedData.MixedDataKey;
/**
* Following defines the class the chat room controller.
*
* @author Xiaojun Wu
* @author Lu Ma
*/
public class ChatRoomController {
/**
* The view of the chat room.
*/
private ChatRoomView chatRoomView;
/**
* The model of the chatroom.
*/
private ChatRoomModel chatRoomModel;
/**
* Constructor.
*
* @param chatRoom The chat room of this chat room MVC.
* @param receiver The local user's receiver stub.
* @param mainView The main view of the local system.
* @param receiverHost The local user's receiver server object.
*/
public ChatRoomController(IChatRoom chatRoom, IReceiver receiver, MainViewFrame<IUser> mainView, Receiver receiverHost) {
chatRoomModel = new ChatRoomModel(chatRoom, new IChatRoomModel2ViewAdapter() {
@Override
public void appendMsg(String msg) {
chatRoomView.appendMsg(msg);
}
@Override
public ICRCmd2ModelAdapter createCRCmd2ModelAdapter() {
return new ILocalCRCmd2ModelAdapter() {
private MixedDataDictionary dict = new MixedDataDictionary();
@Override
public String getName() {
// TODO Auto-generated method stub
return null;
}
@Override
public void appendMsg(String text, String name) {
chatRoomView.appendMsg(name + text);
}
@Override
public void buildScrollableComponent(IComponentFactory fac, String label) {
// TODO Auto-generated method stub
chatRoomView.getPanelOther().add(fac.makeComponent());
}
@Override
public void buildNonScrollableComponent(IComponentFactory fac, String label) {
// TODO Auto-generated method stub
chatRoomView.getPanelOther().add(fac.makeComponent());
}
@Override
public <T> T put(MixedDataKey<T> key, T value) {
// TODO Auto-generated method stub
return dict.put(key, value);
}
@Override
public <T> T get(MixedDataKey<T> key) {
// TODO Auto-generated method stub
return dict.get(key);
}
@Override
public <T extends ICRMessageType> void sendTo(IReceiver target, Class<T> id, T data) {
try {
target.receive(new DataPacketCR<T>(id, data, receiver));
} catch (RemoteException e) {
e.printStackTrace();
}
}
@Override
public <T extends ICRMessageType> void sendToChatRoom(Class<T> id, T data) {
chatRoom.sendPacket(new DataPacketCR<T>(id, data, receiver));
}
@Override
public void addReceiver(IReceiver receiver) {
chatRoomModel.addReceiver(receiver);
}
@Override
public void removeReceiver(IReceiver receiver) {
chatRoomModel.removeReceiver(receiver);
}
};
}
}, receiver, receiverHost);
chatRoomView = new ChatRoomView(new IChatRoomView2ModelAdapter() {
@Override
public void start() {
}
@Override
public void sendMsg(String msg) {
chatRoomModel.sendMsg(msg);
}
@Override
public void leave() {
chatRoomModel.leave();
// lobbyView.removeTeamView(chatRoomView.getContentPnl());
}
});
mainView.addMiniView(chatRoomView.getContentPnl(), chatRoom.getName());
// lobbyView.addTeamView(chatRoomView.getContentPnl());
}
/**
* Start the chat room MVC.
*/
public void start() {
chatRoomView.start();
}
}
| 26.357616 | 122 | 0.702261 |
e631e0c2c29183504a8821cfd5fe0ea79d0a9a7d | 3,018 | go | Go | internal/git/housekeeping/worktrees_test.go | zhangshuyun/gitaly | a928ebb0951f52bfccbfc2e67543abe8bc3f3963 | [
"MIT"
] | null | null | null | internal/git/housekeeping/worktrees_test.go | zhangshuyun/gitaly | a928ebb0951f52bfccbfc2e67543abe8bc3f3963 | [
"MIT"
] | null | null | null | internal/git/housekeeping/worktrees_test.go | zhangshuyun/gitaly | a928ebb0951f52bfccbfc2e67543abe8bc3f3963 | [
"MIT"
] | null | null | null | package housekeeping
import (
"os"
"path/filepath"
"testing"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v14/internal/git"
"gitlab.com/gitlab-org/gitaly/v14/internal/git/gittest"
"gitlab.com/gitlab-org/gitaly/v14/internal/git/localrepo"
"gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/v14/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/v14/internal/testhelper/testcfg"
)
func TestCleanupDisconnectedWorktrees_doesNothingWithoutWorktrees(t *testing.T) {
t.Parallel()
ctx := testhelper.Context(t)
cfg, repoProto, repoPath := testcfg.BuildWithRepo(t)
worktreePath := filepath.Join(testhelper.TempDir(t), "worktree")
failingGitCmdFactory := gittest.NewInterceptingCommandFactory(ctx, t, cfg, func(git.ExecutionEnvironment) string {
return `#!/usr/bin/env bash
exit 15
`
})
repo := localrepo.New(config.NewLocator(cfg), failingGitCmdFactory, nil, repoProto)
// If this command did spawn git-worktree(1) we'd see an error. It doesn't though because it
// detects that there aren't any worktrees at all.
require.NoError(t, cleanDisconnectedWorktrees(ctx, repo))
gittest.AddWorktree(t, cfg, repoPath, worktreePath)
// We have now added a worktree now, so it should detect that there are worktrees and thus
// spawn the Git command. We thus expect the error code we inject via the failing Git
// command factory.
require.EqualError(t, cleanDisconnectedWorktrees(ctx, repo), "exit status 15")
}
func TestRemoveWorktree(t *testing.T) {
t.Parallel()
cfg, repoProto, repoPath := testcfg.BuildWithRepo(t)
repo := localrepo.NewTestRepo(t, cfg, repoProto)
existingWorktreePath := filepath.Join(repoPath, worktreePrefix, "existing")
gittest.AddWorktree(t, cfg, repoPath, existingWorktreePath)
disconnectedWorktreePath := filepath.Join(repoPath, worktreePrefix, "disconnected")
gittest.AddWorktree(t, cfg, repoPath, disconnectedWorktreePath)
require.NoError(t, os.RemoveAll(disconnectedWorktreePath))
orphanedWorktreePath := filepath.Join(repoPath, worktreePrefix, "orphaned")
require.NoError(t, os.MkdirAll(orphanedWorktreePath, os.ModePerm))
for _, tc := range []struct {
worktree string
errorIs error
expectExists bool
}{
{
worktree: "existing",
expectExists: false,
},
{
worktree: "disconnected",
expectExists: false,
},
{
worktree: "unknown",
errorIs: errUnknownWorktree,
expectExists: false,
},
{
worktree: "orphaned",
errorIs: errUnknownWorktree,
expectExists: true,
},
} {
t.Run(tc.worktree, func(t *testing.T) {
ctx := testhelper.Context(t)
worktreePath := filepath.Join(repoPath, worktreePrefix, tc.worktree)
err := removeWorktree(ctx, repo, tc.worktree)
if tc.errorIs == nil {
require.NoError(t, err)
} else {
require.ErrorIs(t, err, tc.errorIs)
}
if tc.expectExists {
require.DirExists(t, worktreePath)
} else {
require.NoDirExists(t, worktreePath)
}
})
}
}
| 28.742857 | 115 | 0.724983 |
773313f1c93691cdcf68ca42a887cc8838e0e15c | 6,793 | rs | Rust | app/gui/language/ast/impl/src/known.rs | cmarincia/enso | d59710c3cd9e356ce470edfa186c56cdca80f9d9 | [
"Apache-2.0"
] | 3,834 | 2015-01-05T08:24:37.000Z | 2020-06-23T08:20:38.000Z | app/gui/language/ast/impl/src/known.rs | cmarincia/enso | d59710c3cd9e356ce470edfa186c56cdca80f9d9 | [
"Apache-2.0"
] | 816 | 2020-06-24T15:30:15.000Z | 2022-03-29T13:34:23.000Z | app/gui/language/ast/impl/src/known.rs | cmarincia/enso | d59710c3cd9e356ce470edfa186c56cdca80f9d9 | [
"Apache-2.0"
] | 147 | 2015-02-06T09:39:34.000Z | 2020-06-17T09:23:51.000Z | //! This module provides KnownAst<T> wrapper over Ast that allows expressing that we already
//! know what `Shape` variant is being stored within this `Ast` node.
use crate::prelude::*;
use crate::with_shape_variants;
use crate::Ast;
use crate::HasTokens;
use crate::Shape;
use crate::TokenConsumer;
use serde::Deserialize;
use serde::Deserializer;
use serde::Serialize;
use serde::Serializer;
// =================
// === Known AST ===
// =================
/// Wrapper for an AST node of known shape type that we can access.
/// Use `TryFrom<&Ast>` to obtain values.
///
/// Provides `Deref` implementation that allows accessing underlying shape `T` value.
#[derive(CloneRef, Derivative)]
#[derivative(Clone(bound = ""))]
#[derive(Debug, Eq, PartialEq)]
pub struct KnownAst<T> {
ast: Ast,
phantom: PhantomData<T>,
}
impl<T> KnownAst<T> {
/// Creates a new `KnownAst<T>` from ast node containing shape of variant `T`.
///
/// Note that this API requires caller to ensure that Ast stores proper shape. Violating this
/// rule will lead to panics later.
fn new_unchecked(ast: Ast) -> KnownAst<T> {
KnownAst { ast, phantom: default() }
}
/// Gets AST id.
pub fn id(&self) -> Option<crate::Id> {
self.ast.id
}
/// Returns a reference to the stored `Ast` with `Shape` of `T`.
pub fn ast(&self) -> &Ast {
&self.ast
}
}
impl<T, E> KnownAst<T>
where for<'t> &'t Shape<Ast>: TryInto<&'t T, Error = E>
{
/// Checks if the shape of given Ast node is compatible with `T`.
/// If yes, returns Ok with Ast node wrapped as KnownAst.
/// Otherwise, returns an error.
pub fn try_new(ast: Ast) -> Result<KnownAst<T>, E> {
if let Some(error_matching) = ast.shape().try_into().err() {
Err(error_matching)
} else {
Ok(KnownAst { ast, phantom: default() })
}
}
/// Returns the AST's shape.
pub fn shape(&self) -> &T
where E: Debug {
self.deref()
}
/// Updated self in place by applying given function on the stored Shape.
pub fn update_shape<R>(&mut self, f: impl FnOnce(&mut T) -> R) -> R
where
T: Clone + Into<Shape<Ast>>,
E: Debug, {
let mut shape = self.shape().clone();
let ret = f(&mut shape);
self.ast = self.ast.with_shape(shape);
ret
}
/// Create new instance of KnownAst with mapped shape.
pub fn with_shape<S, E1>(&self, f: impl FnOnce(T) -> S) -> KnownAst<S>
where
for<'t> &'t Shape<Ast>: TryInto<&'t S, Error = E1>,
T: Clone + Into<Shape<Ast>>,
S: Clone + Into<Shape<Ast>>,
E: Debug,
E1: Debug, {
let shape = self.shape().clone();
let new_shape = f(shape);
KnownAst::new_unchecked(self.ast.with_shape(new_shape))
}
}
impl<T: Into<Shape<Ast>>> KnownAst<T> {
/// Creates a new `KnownAst<T>` from `shape` with random ID if id=None.
pub fn new(shape: T, id: Option<crate::Id>) -> KnownAst<T> {
let ast = Ast::new(shape, id);
Self::new_unchecked(ast)
}
/// Creates a new `KnownAst<T>` from `shape` with no ID.
/// Should be only used on nodes that can't have ID because of scala AST design.
/// Example: Module, Section.opr, MacroMatchSegment.head
/// Tracking issue: https://github.com/enso-org/ide/issues/434
pub fn new_no_id(shape: T) -> KnownAst<T> {
let ast = Ast::new_no_id(shape);
Self::new_unchecked(ast)
}
}
impl<T, E> Deref for KnownAst<T>
where
for<'t> &'t Shape<Ast>: TryInto<&'t T, Error = E>,
E: Debug,
{
type Target = T;
fn deref(&self) -> &Self::Target {
let result = self.ast.shape().try_into();
// Below must never happen, as the only function for constructing values does check
// if the shape type matches the `T`.
result.expect("Internal Error: wrong shape in KnownAst.")
}
}
impl<T> AsRef<Ast> for KnownAst<T> {
fn as_ref(&self) -> &Ast {
&self.ast
}
}
impl<T, E> TryFrom<&Ast> for KnownAst<T>
where for<'t> &'t Shape<Ast>: TryInto<&'t T, Error = E>
{
type Error = E;
fn try_from(ast: &Ast) -> Result<KnownAst<T>, Self::Error> {
KnownAst::try_new(ast.clone())
}
}
impl<T, E> TryFrom<Ast> for KnownAst<T>
where for<'t> &'t Shape<Ast>: TryInto<&'t T, Error = E>
{
type Error = E;
fn try_from(ast: Ast) -> Result<KnownAst<T>, Self::Error> {
KnownAst::try_new(ast)
}
}
/// One can always throw away the knowledge.
impl<T> From<KnownAst<T>> for Ast {
fn from(known_ast: KnownAst<T>) -> Ast {
known_ast.ast
}
}
impl<'a, T> From<&'a KnownAst<T>> for &'a Ast {
fn from(known_ast: &'a KnownAst<T>) -> &'a Ast {
&known_ast.ast
}
}
impl<T> Serialize for KnownAst<T> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer {
self.ast.serialize(serializer)
}
}
impl<'de, T, E> Deserialize<'de> for KnownAst<T>
where
for<'t> &'t Shape<Ast>: TryInto<&'t T, Error = E>,
E: fmt::Display,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de> {
let ast = Ast::deserialize(deserializer)?;
Self::try_new(ast).map_err(serde::de::Error::custom)
}
}
impl<T> HasTokens for KnownAst<T> {
fn feed_to(&self, consumer: &mut impl TokenConsumer) {
self.ast.feed_to(consumer)
}
}
impl<T> Display for KnownAst<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Display::fmt(&self.ast, f)
}
}
// ===============
// === Aliases ===
// ===============
/// For input like `[Unrecognized] [Prefix Ast]` generates aliases like:
/// ```compile_fail
/// pub type Unrecognized = KnownAst<crate::Unrecognized>;
/// pub type Prefix = KnownAst<crate::Prefix<Ast>>;
/// // etc ...
/// ```
macro_rules! generate_alias {
( $([$name:ident $($tp:ty)? ])* ) => {$(
#[allow(missing_docs)]
pub type $name = KnownAst<crate::$name $(<$tp>)? >;
)*};
}
// Generates aliases for each Shape variant.
with_shape_variants!(generate_alias);
// =============
// === Tests ===
// =============
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_known_ast() {
let ast_var = crate::Ast::var("foo");
// This is truly var, so we can unwrap and directly access it's fields.
let known_var = Var::try_from(&ast_var).unwrap();
assert_eq!(known_var.name, "foo");
let known_var: Var = ast_var.clone().try_into().unwrap();
assert_eq!(known_var.name, "foo");
// This is not an Infix, so we won't get KnownAst object.
let known_infix_opt = Infix::try_from(&ast_var);
assert!(known_infix_opt.is_err());
}
}
| 27.502024 | 97 | 0.587075 |
3bafbc5d9cb0a48ced72f1ed24daccad9284d622 | 525 | html | HTML | src/app/documents/documents-list/document-list.component.html | leonidasyopan/wdd-430-cms-project | 957746af843cceac8a53f05298dbffabac827239 | [
"MIT"
] | null | null | null | src/app/documents/documents-list/document-list.component.html | leonidasyopan/wdd-430-cms-project | 957746af843cceac8a53f05298dbffabac827239 | [
"MIT"
] | null | null | null | src/app/documents/documents-list/document-list.component.html | leonidasyopan/wdd-430-cms-project | 957746af843cceac8a53f05298dbffabac827239 | [
"MIT"
] | null | null | null | <div class="panel panel-default">
<div class="panel-heading">
<div class="row pad-left-right">
<span class="pull-left title">Documents</span>
<a
class="btn btn-success pull-right"
routerLink="new"
(click)="onNewDocument()"
>Add Document</a>
</div>
</div>
<div class="panel-body">
<div class="center-panel">
<cms-document-item
*ngFor="let documentEl of documents"
[document]="documentEl"
></cms-document-item>
</div>
</div>
</div>
| 23.863636 | 52 | 0.575238 |
e9c4f19e62ef7145f00648f137af910314b13d32 | 188 | rb | Ruby | ruby/easy/contains_duplicate.rb | scaffeinate/leetcode | 750620f0ab9ed2eb17e0cd3065e51176e0dca77a | [
"MIT"
] | 6 | 2018-03-09T18:45:21.000Z | 2020-10-02T22:54:51.000Z | ruby/easy/contains_duplicate.rb | scaffeinate/leetcode | 750620f0ab9ed2eb17e0cd3065e51176e0dca77a | [
"MIT"
] | null | null | null | ruby/easy/contains_duplicate.rb | scaffeinate/leetcode | 750620f0ab9ed2eb17e0cd3065e51176e0dca77a | [
"MIT"
] | 1 | 2020-08-28T14:48:52.000Z | 2020-08-28T14:48:52.000Z | # @param {Integer[]} nums
# @return {Boolean}
def contains_duplicate(nums)
set = {}
nums.each do |num|
return true if set[num]
set[num] = true
end
false
end | 18.8 | 31 | 0.579787 |
ca0587b89ca4fb9c39b31ca2c325d3e69c07e197 | 3,282 | java | Java | inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/mapred/BitcoinTransactionRecordReader.java | Tech-Knight-Danny/hadoopcryptoledger | 495ba28b914b29b115c551c2eaaba5e437655968 | [
"Apache-2.0"
] | 160 | 2016-04-09T19:41:20.000Z | 2022-03-24T07:54:14.000Z | inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/mapred/BitcoinTransactionRecordReader.java | Tech-Knight-Danny/hadoopcryptoledger | 495ba28b914b29b115c551c2eaaba5e437655968 | [
"Apache-2.0"
] | 85 | 2016-11-10T08:19:12.000Z | 2022-03-25T23:11:10.000Z | inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/mapred/BitcoinTransactionRecordReader.java | Tech-Knight-Danny/hadoopcryptoledger | 495ba28b914b29b115c551c2eaaba5e437655968 | [
"Apache-2.0"
] | 55 | 2016-09-24T18:59:26.000Z | 2022-03-25T02:21:35.000Z | /**
* Copyright 2016 ZuInnoTe (Jörn Franke) <zuinnote@gmail.com>
*
* 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 org.zuinnote.hadoop.bitcoin.format.mapred;
import org.zuinnote.hadoop.bitcoin.format.exception.HadoopCryptoLedgerConfigurationException;
import org.zuinnote.hadoop.bitcoin.format.exception.BitcoinBlockReadException;
import java.io.IOException;
import org.apache.hadoop.io.BytesWritable;
import org.apache.hadoop.mapred.FileSplit;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.Reporter;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
import org.zuinnote.hadoop.bitcoin.format.common.*;
public class BitcoinTransactionRecordReader extends AbstractBitcoinRecordReader<BytesWritable, BitcoinTransactionWritable> {
private static final Log LOG = LogFactory.getLog(BitcoinBlockRecordReader.class.getName());
private int currentTransactionCounterInBlock=0;
private BitcoinBlock currentBitcoinBlock;
public BitcoinTransactionRecordReader(FileSplit split,JobConf job, Reporter reporter) throws IOException,HadoopCryptoLedgerConfigurationException,BitcoinBlockReadException {
super(split,job,reporter);
}
/**
*
* Create an empty key
*
* @return key
*/
@Override
public BytesWritable createKey() {
return new BytesWritable();
}
/**
*
* Create an empty value
*
* @return value
*/
@Override
public BitcoinTransactionWritable createValue() {
return new BitcoinTransactionWritable();
}
/**
*
* Read a next block.
*
* @param key is a 68 byte array (hashMerkleRoot, prevHashBlock, transActionCounter)
* @param value is a deserialized Java object of class BitcoinBlock
*
* @return true if next block is available, false if not
*/
@Override
public boolean next(BytesWritable key, BitcoinTransactionWritable value) throws IOException {
// read all the blocks, if necessary a block overlapping a split
while(getFilePosition()<=getEnd()) { // did we already went beyond the split (remote) or do we have no further data left?
if ((currentBitcoinBlock==null) || (currentBitcoinBlock.getTransactions().size()==currentTransactionCounterInBlock)){
try {
currentBitcoinBlock=getBbr().readBlock();
currentTransactionCounterInBlock=0;
} catch (BitcoinBlockReadException e) {
// log
LOG.error(e);
}
}
if (currentBitcoinBlock==null) {
return false;
}
BitcoinTransaction currentTransaction=currentBitcoinBlock.getTransactions().get(currentTransactionCounterInBlock);
// the unique identifier that is linked in other transaction is usually its hash
byte[] newKey = BitcoinUtil.getTransactionHash(currentTransaction);
key.set(newKey,0,newKey.length);
value.set(currentTransaction);
currentTransactionCounterInBlock++;
return true;
}
return false;
}
}
| 29.303571 | 173 | 0.78184 |
559065c1d287d30896ad8d7c8c032907456edf9a | 423 | swift | Swift | MyApp/Library/Ext/OptionalExt.swift | AsianTechInc/AT-Boilerplate-iOS-MVVM | c09059599efe759e71f05c1ff996b88c9dbeb3a8 | [
"MIT"
] | 22 | 2017-11-09T08:46:40.000Z | 2020-03-21T14:36:10.000Z | MyApp/Library/Ext/OptionalExt.swift | AsianTechInc/AT-Boilerplate-iOS-MVVM | c09059599efe759e71f05c1ff996b88c9dbeb3a8 | [
"MIT"
] | 1 | 2020-05-14T07:53:27.000Z | 2020-05-14T08:14:34.000Z | MyApp/Library/Ext/OptionalExt.swift | AsianTechInc/AT-Boilerplate-iOS-MVVM | c09059599efe759e71f05c1ff996b88c9dbeb3a8 | [
"MIT"
] | 8 | 2018-02-01T11:12:39.000Z | 2020-03-24T01:28:31.000Z | //
// OptionalExt.swift
// MyApp
//
// Created by Dai Ho V. on 5/14/20.
// Copyright © 2020 Asian Tech Co., Ltd. All rights reserved.
//
import Foundation
extension Optional {
func unwrapped(or defaultValue: Wrapped) -> Wrapped {
return self ?? defaultValue
}
func unwrapped(or error: Error) throws -> Wrapped {
guard let wrapped = self else { throw error }
return wrapped
}
}
| 21.15 | 62 | 0.631206 |
86a68e0b25da161d2ccbdc8cb6ceea387bc43f4f | 770 | rs | Rust | board/arduino-zero/src/lib.rs | thomasantony/bobbin-sdk | 37375ca40351352a029aceb8b0cf17650a3624f6 | [
"Apache-2.0",
"MIT"
] | null | null | null | board/arduino-zero/src/lib.rs | thomasantony/bobbin-sdk | 37375ca40351352a029aceb8b0cf17650a3624f6 | [
"Apache-2.0",
"MIT"
] | null | null | null | board/arduino-zero/src/lib.rs | thomasantony/bobbin-sdk | 37375ca40351352a029aceb8b0cf17650a3624f6 | [
"Apache-2.0",
"MIT"
] | null | null | null | #![no_std]
#![feature(use_extern_macros)]
extern crate panic_abort;
extern crate cortex_m_rt;
pub extern crate samd21 as mcu;
pub mod prelude;
pub mod led;
pub mod btn;
pub mod sys;
pub use mcu::bobbin_bits;
pub use mcu::bobbin_mcu;
pub use mcu::bobbin_hal;
pub use mcu::bobbin_sys;
pub use bobbin_sys::{print, println, abort};
pub use sys::init;
pub type Mcu = mcu::Samd21;
pub type Board = ArduinoZero;
pub struct ArduinoZero {}
impl bobbin_sys::board::Board for ArduinoZero {
fn id(&self) -> &'static str { "arduino-zero" }
}
cortex_m_rt::default_handler!(bobbin_sys::irq_dispatch::IrqDispatcher::<Mcu>::handle_exception);
cortex_m_rt::exception!(SYS_TICK, bobbin_sys::tick::Tick::tick);
cortex_m_rt::exception!(PENDSV, bobbin_sys::pend::Pend::pend); | 23.333333 | 96 | 0.737662 |
9ae1b2e874a7ecb2fb7fa64e36bc57cc100d7ce4 | 3,571 | asm | Assembly | Labs/POVS/POVS-6/led.asm | VerkhovtsovPavel/BSUIR_Labs | 8fb6d304189b714a30db7f8611ec29bbca775e7f | [
"MIT"
] | 1 | 2018-11-09T18:02:47.000Z | 2018-11-09T18:02:47.000Z | Labs/POVS/POVS-6/led.asm | VerkhovtsovPavel/BSUIR_Labs | 8fb6d304189b714a30db7f8611ec29bbca775e7f | [
"MIT"
] | null | null | null | Labs/POVS/POVS-6/led.asm | VerkhovtsovPavel/BSUIR_Labs | 8fb6d304189b714a30db7f8611ec29bbca775e7f | [
"MIT"
] | 1 | 2020-10-07T03:07:14.000Z | 2020-10-07T03:07:14.000Z | LIST p=16F84 ;tell assembler what chip we are using
include "P16F84.inc" ;include the defaults for the chip
__CONFIG _WDT_OFF
cblock 0x20 ;start of general purpose registers
MS_COUNT
WAIT_COUNTER
CMD_TEMP ;temp store for 4 bit mode
COUNTER
POSITION
LINE_FLAG
W_TEMP
STATUS_TEMP
INT_COUNTER
endc
LCD_PORT Equ PORTB
LCD_TRIS Equ TRISB
LCD_RS Equ 0x01 ;LCD handshake lines
LCD_RW Equ 0x02
LCD_E Equ 0x03
LCD_LINE Equ 0x00
org 0x00
goto Initialise
org 0x04
movwf W_TEMP
swapf STATUS, W
movwf STATUS_TEMP
btfsc INTCON, T0IF
call Timer_signal
btfsc INTCON, INTF
call Change_position
swapf STATUS_TEMP, W
movwf STATUS
swapf W_TEMP, F
swapf W_TEMP, W
retfie
Initialise
clrf PORTA
clrf PORTB
clrw
bsf STATUS, RP0 ;select bank 1
movwf LCD_TRIS
bcf STATUS, RP0 ;select bank 0
movlw 0x32
call Delay ;wait for LCD to settle
movlw 0x02 ;Set 4 bit mode
call LCD_Cmd
movlw 0x0E ;Set display character mode
call LCD_Cmd
movlw 0x28 ;Set double line mode
call LCD_Cmd
movlw 0x06 ;Set display shift
call LCD_Cmd
movlw 0x0C ;Set display on/off and cursor command
call LCD_Cmd
call LCD_Clr ;Clear display
bcf INTCON, GIE
bsf STATUS, RP0
clrw
movwf TRISB
bsf TRISB, RB0
clrf OPTION_REG
bsf OPTION_REG, PS2
bsf OPTION_REG, PS0
bcf STATUS, RP0
clrf TMR0
bsf INTCON, T0IE
bsf INTCON, INTE
clrf COUNTER
clrf LINE_FLAG
bsf INTCON, GIE
Loop
nop
goto Loop
Output
call LCD_Clr
call LCD_Position
movfw COUNTER
call Symbols ;get a character from the text table
call LCD_Char
return
LCD_Cmd
movwf CMD_TEMP ;send upper nibble
andlw 0xf0 ;clear upper 4 bits of W
movwf LCD_PORT
bcf LCD_PORT, LCD_RS ;RS line to 0
call Pulse_e ;Pulse the E line high
movfw CMD_TEMP
swapf CMD_TEMP, w ;send lower nibble
andlw 0xf0 ;clear upper 4 bits of W
movwf LCD_PORT
bcf LCD_PORT, LCD_RS ;RS line to 0
call Pulse_e ;Pulse the E line high
movlw 0x32
call Delay
return
LCD_Char
movwf CMD_TEMP ;send upper nibble
andlw 0xf0 ;clear upper 4 bits of W
movwf LCD_PORT
bsf LCD_PORT, LCD_RS ;RS line to 1
call Pulse_e ;Pulse the E line high
movfw CMD_TEMP ;send lower nibble
swapf CMD_TEMP, W
andlw 0xf0 ;clear upper 4 bits of W
movwf LCD_PORT
bsf LCD_PORT, LCD_RS ;RS line to 1
call Pulse_e ;Pulse the E line high
movlw 0x05
call Delay
return
Change_position
bcf INTCON, INTF
incf POSITION, F
movfw POSITION
sublw 0x10
btfsc STATUS, Z
call Change_row
call Output
return
Change_row
clrf POSITION
movfw LINE_FLAG
xorlw 0x01
movwf LINE_FLAG
clrf COUNTER
clrf TMR0
return
Timer_signal
bcf INTCON, T0IF
incf INT_COUNTER
movfw INT_COUNTER
sublw 0x4D
btfss STATUS, Z
return
clrf INT_COUNTER
incf COUNTER
movfw COUNTER
sublw 0x0A
btfsc STATUS, Z
clrf COUNTER
call Output
return
LCD_Position
movfw POSITION
btfss LINE_FLAG, LCD_LINE
addlw 0x80 ;move to 1st row, column W
btfsc LINE_FLAG, LCD_LINE
addlw 0xC0 ;move to 2nd row, column W
call LCD_Cmd
return
LCD_Clr
movlw 0x01 ;Clear display
call LCD_Cmd
return
Pulse_e
bsf LCD_PORT, LCD_E
nop
bcf LCD_PORT, LCD_E
return
Delay
movwf MS_COUNT
Internal_Delay
movlw 0xC7 ;delay 1mS
movwf WAIT_COUNTER
MiliSec_Delay
decfsz WAIT_COUNTER, F
goto MiliSec_Delay
decfsz MS_COUNT ,F
goto Internal_Delay
return
Symbols
addwf PCL, f
retlw b'00110000'
retlw b'00110001'
retlw b'00110010'
retlw b'00110011'
retlw b'00110100'
retlw b'00110101'
retlw b'00110110'
retlw b'00110111'
retlw b'00111000'
retlw b'00111001'
end | 17.334951 | 56 | 0.74601 |
73ce5e71e2e897d1597b96eb760b21c9c5e9b25b | 545 | swift | Swift | UnitTesting/FibonacciUtility/FibonacciUtility.swift | jayesh15111988/UnitTesting | 1d7aa05ef3428fb400360a9bac7089d166164059 | [
"MIT"
] | 1 | 2019-11-15T15:21:56.000Z | 2019-11-15T15:21:56.000Z | UnitTesting/FibonacciUtility/FibonacciUtility.swift | jayesh15111988/UnitTesting | 1d7aa05ef3428fb400360a9bac7089d166164059 | [
"MIT"
] | null | null | null | UnitTesting/FibonacciUtility/FibonacciUtility.swift | jayesh15111988/UnitTesting | 1d7aa05ef3428fb400360a9bac7089d166164059 | [
"MIT"
] | null | null | null | //
// FibonacciUtility.swift
// UnitTesting
//
// Created by Jayesh Kawli on 8/25/19.
// Copyright © 2019 Jayesh Kawli. All rights reserved.
//
import Foundation
enum FibonacciError: Error {
case invalidInput
}
final class FibonacciUtility {
func generateFibonacciNumber(for sequence: Int) throws -> Int {
guard sequence >= 0 else { throw FibonacciError.invalidInput }
var num1 = 0
var num2 = 1
for _ in 0..<sequence {
let num = num1 + num2
num1 = num2
num2 = num
}
return num1
}
}
| 17.03125 | 66 | 0.642202 |
4a657495d81a298034bcfda65d82b0d476a03c64 | 9,241 | html | HTML | html/webapp/modules/bbs/templates/default/bbs_view_edit_entry.html | epoc-software-open/csnc | 2cf64dfb7ca0568681809b5132e17b356768b4f6 | [
"BSD-2-Clause"
] | null | null | null | html/webapp/modules/bbs/templates/default/bbs_view_edit_entry.html | epoc-software-open/csnc | 2cf64dfb7ca0568681809b5132e17b356768b4f6 | [
"BSD-2-Clause"
] | 5 | 2020-04-10T05:30:45.000Z | 2021-02-27T16:00:22.000Z | html/webapp/modules/bbs/templates/default/bbs_view_edit_entry.html | epoc-software-open/csnc | 2cf64dfb7ca0568681809b5132e17b356768b4f6 | [
"BSD-2-Clause"
] | 1 | 2020-01-28T04:53:11.000Z | 2020-01-28T04:53:11.000Z | <{strip}>
<{* 掲示板登録画面用テンプレート *}>
<form id="bbs_form<{$id}>" action="#">
<input type="hidden" name="action" />
<input type="hidden" name="bbs_id" />
<table class="outer" summary="<{$smarty.const._SUMMARY_SETTINGFORM}>">
<tr class="row">
<th class="nowrap" scope="row">
<label for="bbs_name<{$id}>">
<{$lang.bbs_bbs_name|smarty:nodefaults}>
</label>
</th>
<td>
<input id="bbs_name<{$id}>" class="text" type="text" name="bbs_name" />
</td>
</tr>
<tr class="row">
<th class="nowrap" scope="row">
<{$lang.bbs_topic_authority|smarty:nodefaults}>
</th>
<td>
<label class="disable_lbl">
<input type="checkbox" disabled="disabled" checked="checked" />
<input type="hidden" name="topic_authority[<{$smarty.const._AUTH_CHIEF}>]" value="<{$smarty.const._ON}>" />
<{$smarty.const._AUTH_CHIEF_NAME}>
</label>
<label for="bbs_topic_authority<{$smarty.const._AUTH_MODERATE}><{$id}>">
<input id="bbs_topic_authority<{$smarty.const._AUTH_MODERATE}><{$id}>" type="checkbox" name="topic_authority[<{$smarty.const._AUTH_MODERATE}>]" value="<{$smarty.const._ON}>" onclick="commonCls.changeAuthority(this, '<{$id}>');" />
<{$smarty.const._AUTH_MODERATE_NAME}>
</label>
<label for="bbs_topic_authority<{$smarty.const._AUTH_GENERAL}><{$id}>">
<input id="bbs_topic_authority<{$smarty.const._AUTH_GENERAL}><{$id}>" type="checkbox" name="topic_authority[<{$smarty.const._AUTH_GENERAL}>]" value="<{$smarty.const._ON}>" onclick="commonCls.changeAuthority(this, '<{$id}>');" />
<{$smarty.const._AUTH_GENERAL_NAME}>
</label>
</td>
</tr>
<tr class="row">
<th class="nowrap" scope="row">
<{$lang.bbs_child_flag|smarty:nodefaults}>
</th>
<td>
<label for="bbs_child_flag<{$smarty.const._ON}><{$id}>">
<input id="bbs_child_flag<{$smarty.const._ON}><{$id}>" type="radio" name="child_flag" value="<{$smarty.const._ON}>" />
<{$lang.bbs_child_flag_on|smarty:nodefaults}>
</label>
<label for="bbs_child_flag<{$smarty.const._OFF}><{$id}>">
<input id="bbs_child_flag<{$smarty.const._OFF}><{$id}>" type="radio" name="child_flag" value="<{$smarty.const._OFF}>" />
<{$lang.bbs_child_flag_off|smarty:nodefaults}>
</label>
</td>
</tr>
<tr class="row">
<th class="nowrap" scope="row">
<{$lang.bbs_vote_flag|smarty:nodefaults}>
</th>
<td>
<label for="bbs_vote_flag<{$smarty.const._ON}><{$id}>">
<input id="bbs_vote_flag<{$smarty.const._ON}><{$id}>" type="radio" name="vote_flag" value="<{$smarty.const._ON}>" />
<{$lang.bbs_vote_flag_on|smarty:nodefaults}>
</label>
<label for="bbs_vote_flag<{$smarty.const._OFF}><{$id}>">
<input id="bbs_vote_flag<{$smarty.const._OFF}><{$id}>" type="radio" name="vote_flag" value="<{$smarty.const._OFF}>" />
<{$lang.bbs_vote_flag_off|smarty:nodefaults}>
</label>
</td>
</tr>
<tr class="row">
<th class="nowrap" scope="row">
<label for="bbs_new_period<{$id}>">
<{$lang.bbs_new_period|smarty:nodefaults}>
</label>
</th>
<td>
<select id="bbs_new_period<{$id}>" name="new_period">
<option value="0"><{$lang.bbs_new_period_none|smarty:nodefaults}></option>
<option value="1"><{$lang.bbs_new_period_unit|smarty:nodefaults|sprintf:"1"}></option>
<option value="2"><{$lang.bbs_new_period_unit|smarty:nodefaults|sprintf:"2"}></option>
<option value="5"><{$lang.bbs_new_period_unit|smarty:nodefaults|sprintf:"5"}></option>
<option value="7"><{$lang.bbs_new_period_unit|smarty:nodefaults|sprintf:"7"}></option>
<option value="30"><{$lang.bbs_new_period_unit|smarty:nodefaults|sprintf:"30"}></option>
<option value="90"><{$lang.bbs_new_period_unit|smarty:nodefaults|sprintf:"90"}></option>
</select>
</td>
</tr>
<tr class="row">
<th class="nowrap" scope="row">
<{$lang.bbs_mail_send|smarty:nodefaults}>
</th>
<td>
<label for="bbs_mail_send<{$smarty.const._ON}><{$id}>">
<input id="bbs_mail_send<{$smarty.const._ON}><{$id}>" type="radio" name="mail_send" value="<{$smarty.const._ON}>" onclick="bbsCls['<{$id}>'].changeMailSend(true);" />
<{$lang.bbs_mail_send_on|smarty:nodefaults}>
</label>
<label for="bbs_mail_send<{$smarty.const._OFF}><{$id}>">
<input id="bbs_mail_send<{$smarty.const._OFF}><{$id}>" type="radio" name="mail_send" value="<{$smarty.const._OFF}>" onclick="bbsCls['<{$id}>'].changeMailSend(false);" />
<{$lang.bbs_mail_send_off|smarty:nodefaults}>
</label>
<div id="bbs_mail_send_content<{$id}>" class="display-none">
<div class="hr"></div>
<{$lang.bbs_mail_authority|smarty:nodefaults}><br />
<label class="disable_lbl">
<input type="checkbox" disabled="disabled" checked="checked" />
<input type="hidden" name="mail_authority[<{$smarty.const._AUTH_CHIEF}>]" value="<{$smarty.const._ON}>" />
<{$smarty.const._AUTH_CHIEF_NAME}>
</label>
<label for="bbs_mail_authority<{$smarty.const._AUTH_MODERATE}><{$id}>">
<input id="bbs_mail_authority<{$smarty.const._AUTH_MODERATE}><{$id}>" type="checkbox" name="mail_authority[<{$smarty.const._AUTH_MODERATE}>]" value="<{$smarty.const._ON}>" onclick="commonCls.changeAuthority(this, '<{$id}>');" />
<{$smarty.const._AUTH_MODERATE_NAME}>
</label>
<label for="bbs_mail_authority<{$smarty.const._AUTH_GENERAL}><{$id}>">
<input id="bbs_mail_authority<{$smarty.const._AUTH_GENERAL}><{$id}>" type="checkbox" name="mail_authority[<{$smarty.const._AUTH_GENERAL}>]" value="<{$smarty.const._ON}>" onclick="commonCls.changeAuthority(this, '<{$id}>');" />
<{$smarty.const._AUTH_GENERAL_NAME}>
</label>
<label for="bbs_mail_authority<{$smarty.const._AUTH_GUEST}><{$id}>">
<input id="bbs_mail_authority<{$smarty.const._AUTH_GUEST}><{$id}>" type="checkbox" name="mail_authority[<{$smarty.const._AUTH_GUEST}>]" value="<{$smarty.const._ON}>" onclick="commonCls.changeAuthority(this, '<{$id}>');" />
<{$smarty.const._AUTH_GUEST_NAME}>
</label>
<div class="hr"></div>
<label for="bbs_mail_subject<{$id}>">
<{$lang.bbs_mail_subject|smarty:nodefaults}>
<input id="bbs_mail_subject<{$id}>" class="mail_subject" type="text" name="mail_subject" />
</label>
<div class="hr"></div>
<label for="bbs_mail_body<{$id}>">
<{$lang.bbs_mail_body|smarty:nodefaults}><br />
<textarea id="bbs_mail_body<{$id}>" class="mail_body" name="mail_body"></textarea>
</label>
<div class="note">
<{$lang.bbs_mail_note|smarty:nodefaults}>
</div>
</div>
</td>
</tr>
</table>
<div class="btn-bottom">
<input class="btn-width" type="button" value="<{$lang._regist|smarty:nodefaults}>" onclick="commonCls.sendPost('<{$id}>', Form.serialize($('bbs_form<{$id}>')), {'target_el':$('<{$id}>'),'focus_flag':true});" />
<input class="btn-width" type="button" value="<{$lang._cancel|smarty:nodefaults}>" onclick="commonCls.sendView('<{$id}>', 'bbs_view_edit_list');" />
</div>
</form>
<{include file = "../bbs_script.html"}>
<script class="nc_script" type="text/javascript">
var bbsForm = $("bbs_form<{$id}>");
bbsForm["action"].value = "bbs_action_edit_entry";
bbsForm["bbs_id"].value = "<{$action.bbs.bbs_id}>";
<{if empty($action.bbs.bbs_id|smarty:nodefaults)}>
bbsForm["bbs_name"].value = "<{$lang.bbs_new_name|smarty:nodefaults|sprintf:$action.bbsNumber}>";
<{else}>
bbsForm["bbs_name"].value = "<{$action.bbs.bbs_name|smarty:nodefaults|escape:"javascript"}>";
<{/if}>
bbsForm["new_period"].value = "<{$action.bbs.new_period}>";
<{if $action.bbs.child_flag == _ON}>
$("bbs_child_flag<{$smarty.const._ON}><{$id}>").checked = true;
<{else}>
$("bbs_child_flag<{$smarty.const._OFF}><{$id}>").checked = true;
<{/if}>
<{if $action.bbs.vote_flag == _ON}>
$("bbs_vote_flag<{$smarty.const._ON}><{$id}>").checked = true;
<{else}>
$("bbs_vote_flag<{$smarty.const._OFF}><{$id}>").checked = true;
<{/if}>
<{if $action.bbs.mail_send == _ON}>
$("bbs_mail_send<{$smarty.const._ON}><{$id}>").checked = true;
bbsCls["<{$id}>"].changeMailSend(true);
<{else}>
$("bbs_mail_send<{$smarty.const._OFF}><{$id}>").checked = true;
bbsCls["<{$id}>"].changeMailSend(false);
<{/if}>
<{if empty($action.bbs.bbs_id|smarty:nodefaults)}>
bbsForm["mail_subject"].value = "<{$lang.bbs_mail_subject_default|smarty:nodefaults}>";
bbsForm["mail_body"].value = "<{$lang.bbs_mail_body_default|smarty:nodefaults}>";
<{else}>
bbsForm["mail_subject"].value = "<{$action.bbs.mail_subject|smarty:nodefaults|escape:"javascript"}>";
bbsForm["mail_body"].value = "<{$action.bbs.mail_body|smarty:nodefaults|escape:"javascript"}>";
<{/if}>
if (bbsForm["topic_authority[<{$action.bbs.topic_authority}>]"]) {
bbsForm["topic_authority[<{$action.bbs.topic_authority}>]"].checked = true;
commonCls.changeAuthority(bbsForm["topic_authority[<{$action.bbs.topic_authority}>]"], "<{$id}>");
}
if (bbsForm["mail_authority[<{$action.bbs.mail_authority}>]"]) {
bbsForm["mail_authority[<{$action.bbs.mail_authority}>]"].checked = true;
commonCls.changeAuthority(bbsForm["mail_authority[<{$action.bbs.mail_authority}>]"], "<{$id}>");
}
bbsForm = null;
</script>
<{/strip}> | 44.859223 | 236 | 0.642896 |
868e7313e0dd57841572ae91e559873a636ab66f | 842 | go | Go | compiler/generator/visitElseIf.go | JonasNiestroj/elljo | cc59607ff948b10910aa69e857dda386ffc24a06 | [
"MIT"
] | null | null | null | compiler/generator/visitElseIf.go | JonasNiestroj/elljo | cc59607ff948b10910aa69e857dda386ffc24a06 | [
"MIT"
] | null | null | null | compiler/generator/visitElseIf.go | JonasNiestroj/elljo | cc59607ff948b10910aa69e857dda386ffc24a06 | [
"MIT"
] | null | null | null | package generator
import (
"elljo/compiler/parser"
"strconv"
)
func (self *Generator) VisitElseIf(children parser.Entry, current *Fragment) *Fragment {
renderer := "renderElseIfBlock_" + strconv.Itoa(self.elseIfCounter)
self.elseIfCounter++
return &Fragment{
UseAnchor: true,
Name: renderer,
Target: "target",
ContextChain: current.ContextChain,
InitStatements: []Statement{},
UpdateStatments: []Statement{},
TeardownStatements: []Statement{},
Counters: FragmentCounter{
Text: 0,
Anchor: 0,
Element: 0,
},
Parent: current,
UpdateContextChain: current.UpdateContextChain,
}
}
func (self *Generator) VisitElseIfAfter(current *Fragment) {
self.renderers = append(self.renderers, self.CreateRenderer(*current))
current = current.Parent
}
| 24.057143 | 88 | 0.675772 |
495398e8a2df11644d9e5ab88f4bcbbee5f65771 | 1,053 | asm | Assembly | sk/sfx/CA.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 9 | 2017-10-09T20:28:45.000Z | 2021-06-29T21:19:20.000Z | sk/sfx/CA.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 12 | 2018-08-01T13:52:20.000Z | 2022-02-21T02:19:37.000Z | sk/sfx/CA.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 2 | 2018-02-17T19:50:36.000Z | 2019-10-30T19:28:06.000Z | Sound_CA_Header:
smpsHeaderStartSong 3
smpsHeaderVoice Sound_CA_Voices
smpsHeaderTempoSFX $01
smpsHeaderChanSFX $01
smpsHeaderSFXChannel cFM3, Sound_CA_FM3, $F1, $08
; FM3 Data
Sound_CA_FM3:
smpsSetvoice $00
smpsModSet $01, $01, $7C, $95
Sound_CA_Loop00:
dc.b nB3, $07
smpsFMAlterVol $10
dc.b nB3, $07
smpsFMAlterVol $F0
smpsContinuousLoop Sound_CA_Loop00
smpsStop
Sound_CA_Voices:
; Voice $00
; $3B
; $04, $0D, $19, $02, $14, $14, $12, $14, $0C, $04, $04, $04
; $02, $02, $02, $03, $DF, $2F, $2F, $2F, $22, $24, $27, $80
smpsVcAlgorithm $03
smpsVcFeedback $07
smpsVcUnusedBits $00
smpsVcDetune $00, $01, $00, $00
smpsVcCoarseFreq $02, $09, $0D, $04
smpsVcRateScale $00, $00, $00, $00
smpsVcAttackRate $14, $12, $14, $14
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $04, $04, $04, $0C
smpsVcDecayRate2 $03, $02, $02, $02
smpsVcDecayLevel $02, $02, $02, $0D
smpsVcReleaseRate $0F, $0F, $0F, $0F
smpsVcTotalLevel $00, $27, $24, $22
| 25.682927 | 62 | 0.621083 |
573d2d9366e768e84fa047866b7d3c84ee4030fb | 755 | psm1 | PowerShell | src/Authentication/Authentication/Microsoft.Graph.Authentication.psm1 | msewaweru/msgraph-sdk-powershell | 6cbf2eba8d83886d8bf22062f194c1a8cb89fe70 | [
"MIT"
] | null | null | null | src/Authentication/Authentication/Microsoft.Graph.Authentication.psm1 | msewaweru/msgraph-sdk-powershell | 6cbf2eba8d83886d8bf22062f194c1a8cb89fe70 | [
"MIT"
] | null | null | null | src/Authentication/Authentication/Microsoft.Graph.Authentication.psm1 | msewaweru/msgraph-sdk-powershell | 6cbf2eba8d83886d8bf22062f194c1a8cb89fe70 | [
"MIT"
] | null | null | null |
# Load the module dll
$null = Import-Module -Name (Join-Path $PSScriptRoot 'Microsoft.Graph.Authentication.dll')
if (Test-Path -Path "$PSScriptRoot\StartupScripts" -ErrorAction Ignore)
{
Get-ChildItem "$PSScriptRoot\StartupScripts" -ErrorAction Stop | ForEach-Object {
. $_.FullName
}
}
$DependencyPath = (Join-Path $PSScriptRoot -ChildPath "Dependencies")
if (Test-Path $DependencyPath -ErrorAction Ignore)
{
try
{
Get-ChildItem -ErrorAction Stop -Path $DependencyPath -Filter "*.dll" | ForEach-Object {
try
{
Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null
}
catch {
Write-Verbose $_
}
}
}
catch {}
} | 26.964286 | 96 | 0.602649 |
5814741c2dfc382ef2dad41180886ad4dd765656 | 2,211 | h | C | xmcomp/src/queue.h | dotdoom/mukite | c771c7916ab219e1c462b6a9da3d49d329f95f53 | [
"BSD-3-Clause"
] | null | null | null | xmcomp/src/queue.h | dotdoom/mukite | c771c7916ab219e1c462b6a9da3d49d329f95f53 | [
"BSD-3-Clause"
] | null | null | null | xmcomp/src/queue.h | dotdoom/mukite | c771c7916ab219e1c462b6a9da3d49d329f95f53 | [
"BSD-3-Clause"
] | 1 | 2020-06-06T13:35:56.000Z | 2020-06-06T13:35:56.000Z | /*
* This is an implementation of a 2-stage queue
*/
#ifndef XMCOMP_QUEUE_H
#define XMCOMP_QUEUE_H
#include <pthread.h>
typedef struct StanzaEntry {
// A buffer that keeps actual data
char *buffer;
int
// Number of real data bytes in the buffer
data_size,
// Actual buffer size.
// Sometimes buffer is preallocated larger than data for performance reasons
buffer_size;
// Linked list
struct StanzaEntry *next;
} StanzaEntry;
typedef struct {
int
// Number of times a thread had to wait to enqueue an item
overflows,
// Parser thread had to wait for some work to appear
underflows,
// Single block reallocations to enlarge the dynamic buffer
realloc_enlarges,
// Reallocations to shorten the dynamic buffer
realloc_shortens,
// Initial block buffer memory allocations
mallocs,
// Number of times a data chunk (stanza) has been pushed into queue
data_pushes,
// Number of times a data chunk request has been satisfied
data_pops,
// Number of times free chunk is returned to the queue
free_pushes,
// Number of times free chunk request has been satisfied
free_pops;
} StanzaQueueStats;
typedef struct {
pthread_mutex_t data_queue_mutex;
pthread_mutex_t free_queue_mutex;
// Cond var signalling that the new portion of data is available for parsing
pthread_cond_t data_available_cv;
// Signals that a previously busy block is available for being filled
pthread_cond_t free_available_cv;
} StanzaQueueSync;
typedef struct {
StanzaEntry
// Stanza blocks filled with data ready to parse
*data_start_queue, *data_end_queue,
// Free blocks to receive data
*free_queue;
StanzaQueueStats stats;
StanzaQueueSync sync;
// When non-zero, this denotes the block size for every single item in the queue
int fixed_block_buffer_size;
// The desired size of a network buffer. MUST ALWAYS BE AT LEAST THE SIZE OF A SIGNLE STANZA
int network_buffer_size;
} StanzaQueue;
void queue_init(StanzaQueue *, int);
void queue_destroy(StanzaQueue *);
StanzaEntry *queue_pop_free(StanzaQueue *);
void queue_push_data(StanzaQueue *, StanzaEntry *);
StanzaEntry *queue_pop_data(StanzaQueue *);
void queue_push_free(StanzaQueue *, StanzaEntry *);
#endif
| 26.321429 | 93 | 0.763908 |
fb36cad4c9a932d615c69455b4b9885a03a451a3 | 13,985 | c | C | src/bcma/cint/core/cint_ast_debug.c | lguohan/SDKLT | 37acbc80e162bdfc7f7d5fb0833178f4f7a8afd4 | [
"Apache-2.0"
] | 2 | 2018-01-31T07:21:32.000Z | 2018-01-31T07:21:49.000Z | src/bcma/cint/core/cint_ast_debug.c | lguohan/SDKLT | 37acbc80e162bdfc7f7d5fb0833178f4f7a8afd4 | [
"Apache-2.0"
] | null | null | null | src/bcma/cint/core/cint_ast_debug.c | lguohan/SDKLT | 37acbc80e162bdfc7f7d5fb0833178f4f7a8afd4 | [
"Apache-2.0"
] | 3 | 2021-07-13T08:29:18.000Z | 2022-01-14T06:14:56.000Z | /*
* $Id: cint_ast_debug.c,v 1.16 2012/03/02 16:21:39 yaronm Exp $
* Copyright: (c) 2018 Broadcom. All Rights Reserved. "Broadcom" refers to
* Broadcom Limited and/or its subsidiaries.
*
* Broadcom Switch Software License
*
* This license governs the use of the accompanying Broadcom software. Your
* use of the software indicates your acceptance of the terms and conditions
* of this license. If you do not agree to the terms and conditions of this
* license, do not use the software.
* 1. Definitions
* "Licensor" means any person or entity that distributes its Work.
* "Software" means the original work of authorship made available under
* this license.
* "Work" means the Software and any additions to or derivative works of
* the Software that are made available under this license.
* The terms "reproduce," "reproduction," "derivative works," and
* "distribution" have the meaning as provided under U.S. copyright law.
* Works, including the Software, are "made available" under this license
* by including in or with the Work either (a) a copyright notice
* referencing the applicability of this license to the Work, or (b) a copy
* of this license.
* 2. Grant of Copyright License
* Subject to the terms and conditions of this license, each Licensor
* grants to you a perpetual, worldwide, non-exclusive, and royalty-free
* copyright license to reproduce, prepare derivative works of, publicly
* display, publicly perform, sublicense and distribute its Work and any
* resulting derivative works in any form.
* 3. Grant of Patent License
* Subject to the terms and conditions of this license, each Licensor
* grants to you a perpetual, worldwide, non-exclusive, and royalty-free
* patent license to make, have made, use, offer to sell, sell, import, and
* otherwise transfer its Work, in whole or in part. This patent license
* applies only to the patent claims licensable by Licensor that would be
* infringed by Licensor's Work (or portion thereof) individually and
* excluding any combinations with any other materials or technology.
* If you institute patent litigation against any Licensor (including a
* cross-claim or counterclaim in a lawsuit) to enforce any patents that
* you allege are infringed by any Work, then your patent license from such
* Licensor to the Work shall terminate as of the date such litigation is
* filed.
* 4. Redistribution
* You may reproduce or distribute the Work only if (a) you do so under
* this License, (b) you include a complete copy of this License with your
* distribution, and (c) you retain without modification any copyright,
* patent, trademark, or attribution notices that are present in the Work.
* 5. Derivative Works
* You may specify that additional or different terms apply to the use,
* reproduction, and distribution of your derivative works of the Work
* ("Your Terms") only if (a) Your Terms provide that the limitations of
* Section 7 apply to your derivative works, and (b) you identify the
* specific derivative works that are subject to Your Terms.
* Notwithstanding Your Terms, this license (including the redistribution
* requirements in Section 4) will continue to apply to the Work itself.
* 6. Trademarks
* This license does not grant any rights to use any Licensor's or its
* affiliates' names, logos, or trademarks, except as necessary to
* reproduce the notices described in this license.
* 7. Limitations
* Platform. The Work and any derivative works thereof may only be used, or
* intended for use, with a Broadcom switch integrated circuit.
* No Reverse Engineering. You will not use the Work to disassemble,
* reverse engineer, decompile, or attempt to ascertain the underlying
* technology of a Broadcom switch integrated circuit.
* 8. Termination
* If you violate any term of this license, then your rights under this
* license (including the license grants of Sections 2 and 3) will
* terminate immediately.
* 9. Disclaimer of Warranty
* THE WORK IS PROVIDED "AS IS" WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WARRANTIES OR CONDITIONS OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR
* NON-INFRINGEMENT. YOU BEAR THE RISK OF UNDERTAKING ANY ACTIVITIES UNDER
* THIS LICENSE. SOME STATES' CONSUMER LAWS DO NOT ALLOW EXCLUSION OF AN
* IMPLIED WARRANTY, SO THIS DISCLAIMER MAY NOT APPLY TO YOU.
* 10. Limitation of Liability
* EXCEPT AS PROHIBITED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL
* THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE
* SHALL ANY LICENSOR BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT,
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
* OR RELATED TO THIS LICENSE, THE USE OR INABILITY TO USE THE WORK
* (INCLUDING BUT NOT LIMITED TO LOSS OF GOODWILL, BUSINESS INTERRUPTION,
* LOST PROFITS OR DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY OTHER
* COMMERCIAL DAMAGES OR LOSSES), EVEN IF THE LICENSOR HAS BEEN ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGES.
*
*
*
* File: cint_ast_debug.c
* Purpose: CINT debug functions
*/
#include "cint_config.h"
#include "cint_porting.h"
#include "cint_internal.h"
#include "cint_ast.h"
static void
__indent(int count)
{
while(count--) CINT_PRINTF(" ");
}
static int
__print(int indent, const char* fmt, ...)
COMPILER_ATTRIBUTE((format (printf, 2, 3)));
static int
__print(int indent, const char* fmt, ...)
{
va_list args;
va_start(args, fmt);
__indent(indent);
CINT_VPRINTF(fmt, args);
va_end(args);
return 0;
}
static int
__start_member(int indent, const char* str)
{
return __print(indent, "{ %s\n", str);
}
static int
__end_member(int indent)
{
return __print(indent, "}\n");
}
static int
__member(int indent, const char* fmt, ...)
COMPILER_ATTRIBUTE((format (printf, 2, 3)));
static int
__member(int indent, const char* fmt, ...)
{
va_list args;
va_start(args, fmt);
__indent(indent);
CINT_PRINTF("{ ");
CINT_VPRINTF(fmt, args);
CINT_PRINTF(" }\n");
va_end(args);
return 0;
}
#define START(_str) __start_member(indent, _str)
#define END() __end_member(indent)
#define MEMBER(expr) __member expr
static void
__cint_ast_dump_Empty(cint_ast_t* ast, int indent)
{
}
static void
__cint_ast_dump_Integer(cint_ast_t* ast, int indent)
{
int i = ast->utype.integer.i;
__print(indent, "0x%x - %d - %u\n", i, i, i);
}
#if CINT_CONFIG_INCLUDE_LONGLONGS == 1
static void
__cint_ast_dump_LongLong(cint_ast_t* ast, int indent)
{
long long i = ast->utype._longlong.i;
char buf1[50], *s1;
char buf2[50], *s2;
char buf3[50], *s3;
s1 = cint_lltoa(buf1, sizeof(buf1), i, 0, 16, 16);
s2 = cint_lltoa(buf2, sizeof(buf2), i, 0, 10, 0);
s3 = cint_lltoa(buf3, sizeof(buf3), i, 0, 10, 0);
__print(indent, "0x%s - %s - %s\n", s1, s2, s3);
}
#endif
#if CINT_CONFIG_INCLUDE_DOUBLES == 1
static void
__cint_ast_dump_Double(cint_ast_t* ast, int indent)
{
double d = ast->utype._double.d;
__print(indent, "%f\n", d);
}
#endif
static void
__cint_ast_dump_String(cint_ast_t* ast, int indent)
{
__print(indent, "'%s'\n",
ast->utype.string.s);
}
static void
__cint_ast_dump_Type(cint_ast_t* ast, int indent)
{
__print(indent, "'%s'\n",
ast->utype.type.s);
}
static void
__cint_ast_dump_Identifier(cint_ast_t* ast, int indent)
{
__print(indent, "'%s'\n",
ast->utype.identifier.s);
}
static void
__cint_ast_dump_Initializer(cint_ast_t* ast, int indent)
{
cint_ast_dump(ast->utype.initializer.initializers, indent+4);
}
static void
__cint_ast_dump_Declaration(cint_ast_t* ast, int indent)
{
int dimension = 0;
START("TYPE");
cint_ast_dump(ast->utype.declaration.type, indent+4);
END();
MEMBER((indent, "PCOUNT %d", ast->utype.declaration.pcount));
START("DIMENSIONS");
for(dimension = 0;
dimension < CINT_CONFIG_ARRAY_DIMENSION_LIMIT;
++dimension) {
cint_ast_dump(
ast->utype.declaration.dimension_initializers[dimension],
indent+4);
}
END();
START("IDENT");
cint_ast_dump(ast->utype.declaration.identifier, indent+4);
END();
START("INIT");
cint_ast_dump(ast->utype.declaration.init, indent+4);
END();
MEMBER(
(indent,
"ARRAYDIMENSIONS %d",
ast->utype.declaration.num_dimension_initializers));
}
static void
__cint_ast_dump_Operator(cint_ast_t* ast, int indent)
{
MEMBER((indent, "OP = '%s'", cint_operator_name(ast->utype.operator.op)));
START("LEFT");
cint_ast_dump(ast->utype.operator.left, indent+4);
END();
START("RIGHT");
cint_ast_dump(ast->utype.operator.right, indent+4);
END();
START("EXTRA");
cint_ast_dump(ast->utype.operator.extra, indent+4);
END();
}
static void
__cint_ast_dump_Function(cint_ast_t* ast, int indent)
{
MEMBER((indent, "NAME = '%s'", ast->utype.function.name));
START("PARAMS");
cint_ast_dump(ast->utype.function.parameters, indent+4);
END();
}
static void
__cint_ast_dump_FunctionDef(cint_ast_t* ast, int indent)
{
START("DECLARATION");
cint_ast_dump(ast->utype.functiondef.declaration, indent+4);
END();
START("PARAMETERS");
cint_ast_dump(ast->utype.functiondef.parameters, indent+4);
END();
START("STATEMENTS");
cint_ast_dump(ast->utype.functiondef.statements, indent+4);
END();
}
static void
__cint_ast_dump_StructureDef(cint_ast_t* ast, int indent)
{
START("NAME");
cint_ast_dump(ast->utype.structuredef.name, indent+4);
END();
START("MEMBERS");
cint_ast_dump(ast->utype.structuredef.members, indent+4);
END();
}
static void
__cint_ast_dump_Elist(cint_ast_t* ast, int indent)
{
cint_ast_t* p;
for(p = ast->utype.elist.list; p; p = p->next) {
cint_ast_dump(p, indent);
}
}
static void
__cint_ast_dump_Enumerator(cint_ast_t* ast, int indent)
{
START("IDENTIFIER");
cint_ast_dump(ast->utype.enumerator.identifier, indent+4);
END();
START("VALUE");
cint_ast_dump(ast->utype.enumerator.value, indent+4);
END();
}
static void
__cint_ast_dump_EnumDef(cint_ast_t* ast, int indent)
{
START("IDENTIFIER");
cint_ast_dump(ast->utype.enumdef.identifier, indent+4);
END();
START("ENUMERATORS");
cint_ast_dump(ast->utype.enumdef.enumerators, indent+4);
END();
}
static void
__cint_ast_dump_While(cint_ast_t* ast, int indent)
{
MEMBER((indent, "ORDER = %d", ast->utype._while.order));
START("CONDITION");
cint_ast_dump(ast->utype._while.condition, indent+4);
END();
START("STATEMENTS");
cint_ast_dump(ast->utype._while.statements, indent+4);
END();
}
static void
__cint_ast_dump_For(cint_ast_t* ast, int indent)
{
START("PRE");
cint_ast_dump(ast->utype._for.pre, indent+4);
END();
START("CONDITION");
cint_ast_dump(ast->utype._for.condition, indent+4);
END();
START("POST");
cint_ast_dump(ast->utype._for.post, indent+4);
END();
START("STATEMENTS");
cint_ast_dump(ast->utype._for.statements, indent+4);
END();
}
static void
__cint_ast_dump_If(cint_ast_t* ast, int indent)
{
START("CONDITION");
cint_ast_dump(ast->utype._if.condition, indent+4);
END();
START("STATEMENTS");
cint_ast_dump(ast->utype._if.statements, indent+4);
END();
START("ELSE");
cint_ast_dump(ast->utype._if._else, indent+4);
END();
}
static void
__cint_ast_dump_Return(cint_ast_t* ast, int indent)
{
START("EXPR");
cint_ast_dump(ast->utype._return.expression, indent+4);
END();
}
static void
__cint_ast_dump_Continue(cint_ast_t* ast, int indent)
{
/* Nothing */
}
static void
__cint_ast_dump_Break(cint_ast_t* ast, int indent)
{
/* Nothing */
}
static void
__cint_ast_dump_Print(cint_ast_t* ast, int indent)
{
START("EXPR");
cint_ast_dump(ast->utype.print.expression, indent+4);
END();
}
static void
__cint_ast_dump_Cint(cint_ast_t* ast, int indent)
{
START("EXPR");
cint_ast_dump(ast->utype.cint.arguments, indent+4);
END();
}
static void
__cint_ast_dump_Switch(cint_ast_t* ast, int indent)
{
START("EXPR");
cint_ast_dump(ast->utype._switch.expression, indent+4);
END();
START("STATEMENTS");
cint_ast_dump(ast->utype._switch.statements, indent+4);
END();
}
static void
__cint_ast_dump_Case(cint_ast_t* ast, int indent)
{
START("EXPR");
cint_ast_dump(ast->utype._case.expression, indent+4);
END();
START("STATEMENTS");
cint_ast_dump(ast->utype._case.statements, indent+4);
END();
}
struct {
const char* name;
void (*dump)(cint_ast_t* node, int indent);
} __ast_table[] = {
#define CINT_AST_LIST_ENTRY(_entry) { #_entry, __cint_ast_dump_##_entry },
#include "cint_ast_entry.h"
{ NULL }
};
void
cint_ast_dump_single(cint_ast_t* ast, int indent)
{
cint_ast_type_t t;
if(ast == NULL) {
__print(indent, "NULL\n");
} else if (ast == CINT_AST_PTR_VOID) {
__print(indent, "VOID *\n");
} else if (ast == CINT_AST_PTR_AUTO) {
__print(indent, "AUTO\n");
} else {
t = ast->ntype;
if(!CINT_AST_TYPE_VALID(t)) {
__print(indent, "INVALID AST TYPE %d", t);
}
else {
__print(indent, "{ %s\n", __ast_table[t].name);
__ast_table[t].dump(ast, indent+4);
__print(indent, "}\n");
}
}
}
void
cint_ast_dump(cint_ast_t* ast, int indent)
{
cint_ast_dump_single(ast, indent);
if(ast &&
ast != CINT_AST_PTR_VOID &&
ast != CINT_AST_PTR_AUTO && ast->next) {
cint_ast_dump(ast->next, indent);
}
}
| 27.748016 | 79 | 0.67887 |
482d8b3a81d312a83e9a47f99f56e19abe6d13ac | 779 | dart | Dart | lib/data/EntryModel.dart | sdivakarrajesh/flutter-calculator | 833b97a90c4c3c1ebfeb8eba129d290706c07d33 | [
"Apache-2.0"
] | null | null | null | lib/data/EntryModel.dart | sdivakarrajesh/flutter-calculator | 833b97a90c4c3c1ebfeb8eba129d290706c07d33 | [
"Apache-2.0"
] | null | null | null | lib/data/EntryModel.dart | sdivakarrajesh/flutter-calculator | 833b97a90c4c3c1ebfeb8eba129d290706c07d33 | [
"Apache-2.0"
] | null | null | null | import 'dart:convert';
class Entry {
int id;
String num1;
String num2;
String operation;
String result;
Entry({this.id, this.num1, this.num2, this.operation, this.result});
factory Entry.fromMap(Map<String, dynamic> json) => new Entry(
id: json["id"],
num1: json["num1"],
num2: json["num2"],
operation: json["operation"],
result: json["result"],
);
Map<String, dynamic> toMap() => {
"id": id,
"num1": num1,
"num2": num2,
"operation": operation,
"result": result,
};
}
Entry entryFromJson(String str) {
final jsonData = json.decode(str);
return Entry.fromMap(jsonData);
}
String entryToJson(Entry data) {
final dyn = data.toMap();
return json.encode(dyn);
}
| 20.5 | 70 | 0.587933 |
fb07241cab11430f2747faa85f54ca9a6f26f618 | 800 | h | C | src/Earworm/Earworm.h | sppp/Earworm | e8529563722b575fde0aa7a7329a01945a177f9c | [
"MIT"
] | null | null | null | src/Earworm/Earworm.h | sppp/Earworm | e8529563722b575fde0aa7a7329a01945a177f9c | [
"MIT"
] | null | null | null | src/Earworm/Earworm.h | sppp/Earworm | e8529563722b575fde0aa7a7329a01945a177f9c | [
"MIT"
] | null | null | null | #ifndef _Earworm_Earworm_h
#define _Earworm_Earworm_h
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
#include "Scaper.h"
#include "MPlayer.h"
#include "Youtube.h"
#include "MediaPlayer.h"
#define LAYOUTFILE <Earworm/Earworm.lay>
#include <CtrlCore/lay.h>
#define IMAGECLASS Imgs
#define IMAGEFILE <Earworm/Earworm.iml>
#include <Draw/iml_header.h>
class Earworm : public WithEarwormLayout<TopWindow> {
MediaPlayer mediaplayer;
Scraper scraper;
Vector<String> opt_strs;
bool playing;
public:
typedef Earworm CLASSNAME;
Earworm();
void InitSongs();
void RefreshCharts();
void RefreshSongs();
void Play();
void QueueSelected();
void PlayNext();
void PostPlayNext() {PostCallback(THISBACK(PlayNext));}
void RefreshState();
};
#endif
| 19.047619 | 57 | 0.71375 |
35c733c5fd548ba01f8b412891a268ac6948ec10 | 3,239 | lua | Lua | scripts/DIFO-JP/c101108076.lua | chronogenexx/ygopro-pre-script | e645b3b3204bf96caaceb44cc25dc8a1ec9daf77 | [
"Unlicense"
] | 73 | 2016-01-10T03:33:05.000Z | 2022-03-16T18:21:12.000Z | scripts/DIFO-JP/c101108076.lua | chronogenexx/ygopro-pre-script | e645b3b3204bf96caaceb44cc25dc8a1ec9daf77 | [
"Unlicense"
] | 220 | 2016-01-08T18:50:47.000Z | 2022-03-31T03:13:22.000Z | scripts/DIFO-JP/c101108076.lua | chronogenexx/ygopro-pre-script | e645b3b3204bf96caaceb44cc25dc8a1ec9daf77 | [
"Unlicense"
] | 157 | 2016-02-11T01:16:24.000Z | 2022-02-15T05:55:37.000Z | --ホーンテッド・アンデット
--
--Script by Trishula9
function c101108076.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101108076,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TOKEN+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101108076)
e1:SetTarget(c101108076.target)
e1:SetOperation(c101108076.activate)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101108076,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101108076)
e2:SetTarget(c101108076.settg)
e2:SetOperation(c101108076.setop)
c:RegisterEffect(e2)
end
function c101108076.rmfilter(c)
return c:IsRace(RACE_ZOMBIE) and c:IsLevelAbove(1) and c:IsAbleToRemove()
and Duel.IsPlayerCanSpecialSummonMonster(tp,101108176,nil,TYPES_TOKEN_MONSTER,0,0,c:GetLevel(),RACE_ZOMBIE,ATTRIBUTE_DARK)
end
function c101108076.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingMatchingCard(c101108076.rmfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)
and not Duel.IsPlayerAffectedByEffect(tp,59822133) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,PLAYER_ALL,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
end
function c101108076.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=Duel.SelectMatchingCard(tp,c101108076.rmfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil):GetFirst()
if tc and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_REMOVED)
and Duel.IsPlayerCanSpecialSummonMonster(tp,101108176,nil,TYPES_TOKEN_MONSTER,0,0,tc:GetLevel(),RACE_ZOMBIE,ATTRIBUTE_DARK) then
for i=1,2 do
local token=Duel.CreateToken(tp,101108176)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(tc:GetLevel())
token:RegisterEffect(e1)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c101108076.setfilter(c)
return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and c:IsAbleToDeck()
end
function c101108076.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable()
and Duel.IsExistingMatchingCard(c101108076.setfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c101108076.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c101108076.setfilter,tp,LOCATION_REMOVED,0,1,1,nil)
if #g>0 and Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0
and c:IsRelateToEffect(e) and Duel.SSet(tp,c)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1)
end
end | 42.064935 | 130 | 0.808583 |
fbdd2875126513865fc17de4b70f0936759eec23 | 6,442 | lua | Lua | upload/garrysmod/gamemodes/clockwork/framework/derma/cl_quiz.lua | xRJx/Clockwork-1 | ebb049eb8b7b03b17f3e1d7d0c41789d0365da28 | [
"MIT"
] | 51 | 2015-01-12T07:30:34.000Z | 2022-02-14T15:37:17.000Z | upload/garrysmod/gamemodes/clockwork/framework/derma/cl_quiz.lua | xRJx/Clockwork-1 | ebb049eb8b7b03b17f3e1d7d0c41789d0365da28 | [
"MIT"
] | 327 | 2015-01-01T15:44:37.000Z | 2021-12-11T10:06:07.000Z | upload/garrysmod/gamemodes/clockwork/framework/derma/cl_quiz.lua | xRJx/Clockwork-1 | ebb049eb8b7b03b17f3e1d7d0c41789d0365da28 | [
"MIT"
] | 135 | 2015-01-12T07:30:35.000Z | 2022-03-27T20:08:56.000Z | --[[
� CloudSixteen.com do not share, re-distribute or modify
without permission of its author (kurozael@gmail.com).
Clockwork was created by Conna Wiles (also known as kurozael.)
http://cloudsixteen.com/license/clockwork.html
--]]
local Clockwork = Clockwork;
local RunConsoleCommand = RunConsoleCommand;
local pairs = pairs;
local ScrH = ScrH;
local ScrW = ScrW;
local table = table;
local vgui = vgui;
local math = math;
local PANEL = {};
-- Called when the panel is initialized.
function PANEL:Init()
local smallTextFont = Clockwork.option:GetFont("menu_text_small");
local scrH = ScrH();
local scrW = ScrW();
self.createTime = SysTime();
self:SetPos(0, 0);
self:SetSize(scrW, scrH);
self:SetPaintBackground(false);
self:SetMouseInputEnabled(true);
self:SetKeyboardInputEnabled(true);
self.scrollList = vgui.Create("DScrollPanel", self);
self.scrollList:SizeToContents();
self.panelList = vgui.Create("cwPanelList", self.scrollList);
self.panelList:SetPadding(4);
self.panelList:SetSpacing(4);
self.panelList:SizeToContents();
self.disconnectButton = vgui.Create("cwLabelButton", self);
self.disconnectButton:SetFont(smallTextFont);
self.disconnectButton:SetText(L("MenuDisconnect"));
self.disconnectButton:FadeIn(0.5);
self.disconnectButton:SetCallback(function(panel)
RunConsoleCommand("disconnect");
end);
self.disconnectButton:SizeToContents();
self.disconnectButton:SetMouseInputEnabled(true);
self.disconnectButton:SetPos((scrW * 0.2) - (self.disconnectButton:GetWide() / 2), scrH * 0.9);
self.continueButton = vgui.Create("cwLabelButton", self);
self.continueButton:SetFont(smallTextFont);
self.continueButton:SetText(L("MenuContinue"));
self.continueButton:FadeIn(0.5);
self.continueButton:SetCallback(function(panel)
Clockwork.datastream:Start("QuizCompleted", true);
end);
self.continueButton:SizeToContents();
self.continueButton:SetMouseInputEnabled(true);
self.continueButton:SetPos((scrW * 0.8) - (self.continueButton:GetWide() / 2), scrH * 0.9);
end;
-- Called when the panel is painted.
function PANEL:Paint(w, h)
Clockwork.kernel:RegisterBackgroundBlur(self, self.createTime);
Clockwork.kernel:DrawSimpleGradientBox(0, 0, 0, ScrW(), ScrH(), Color(0, 0, 0, 255));
return true;
end;
-- A function to populate the panel.
function PANEL:Populate()
local smallTextFont = Clockwork.option:GetFont("menu_text_small");
local quizQuestions = Clockwork.quiz:GetQuestions();
local quizEnabled = Clockwork.quiz:GetEnabled();
local langTable = Clockwork.lang:GetAll();
local scrH = ScrH();
local scrW = ScrW();
self.panelList:Clear(true);
self.questions = {};
self.language = CW_CONVAR_LANG:GetString();
self.languageForm = vgui.Create("cwBasicForm");
self.languageForm:SetAutoSize(true);
self.languageForm:SetText(L("Language"));
self.languageForm:SetPadding(8);
self.languageForm:SetSpacing(4);
local gmodLang = string.lower(GetConVarString("gmod_language"));
local panel = vgui.Create("DComboBox", self.languageForm);
for k, v in pairs(langTable) do
local native = Clockwork.lang:GetNative(k);
if (native) then
panel:AddChoice(k.. " ("..native..")", k);
else
panel:AddChoice(k, k);
end;
end;
if (!self.language or tostring(self.language) == "nil") then
self.language = Clockwork.lang.default;
end;
local gmodToCW = Clockwork.lang:GetFromCode(gmodLang);
if (gmodToCW) then
RunConsoleCommand("cwLang", gmodToCW);
panel:SetValue(gmodToCW);
else
panel:SetValue(self.language);
end;
function panel:OnSelect(index, value, data)
RunConsoleCommand("cwLang", data);
end;
self.languageForm:AddItem(panel);
self.panelList:AddItem(self.languageForm);
if (quizEnabled) then
for k, v in pairs(quizQuestions) do
self.questions[k] = {k, v};
end;
table.sort(self.questions, function(a, b)
return a[2].question < b[2].question;
end);
self:AddQuestions();
end;
end;
-- A function to add the quiz questions to the form.
function PANEL:AddQuestions()
if (!self.questionsForm) then
self.questionsForm = vgui.Create("cwBasicForm");
self.questionsForm:SetAutoSize(true);
self.questionsForm:SetText(L(Clockwork.quiz:GetName()));
self.questionsForm:SetPadding(8);
self.questionsForm:SetSpacing(4);
self.panelList:AddItem(self.questionsForm);
end;
self.questionsForm:Clear(true);
local label = vgui.Create("cwInfoText", self);
label:SetText(L("MenuQuizHelp"));
label:SetInfoColor("orange");
self.questionsForm:AddItem(label);
local colorWhite = Clockwork.option:GetColor("white");
local fontName = Clockwork.fonts:GetSize(
Clockwork.option:GetFont("menu_text_tiny"),
size or 18
);
for k, v in pairs(self.questions) do
local panel = vgui.Create("DComboBox", self.questionsForm);
local question = vgui.Create("DLabel", self.questionsForm);
local key = v[1];
self.questionsForm:AddItem(question);
question:SetFont(fontName);
question:SetTextColor(colorWhite);
question:SetText(L(v[2].question));
question:SizeToContents();
-- Called when an option is selected.
function panel:OnSelect(index, value, data)
Clockwork.datastream:Start("QuizAnswer", {key, index});
end;
for k2, v2 in pairs(v[2].possibleAnswers) do
panel:AddChoice(L(v2));
end;
self.questionsForm:AddItem(panel);
end;
end;
-- Called when the layout should be performed.
function PANEL:PerformLayout(w, h)
local scrW = ScrW();
local scrH = ScrH();
self.panelList:SetSize(scrW * 0.4, math.min(self.panelList.pnlCanvas:GetTall() + 4, ScrH() * 0.75));
self.panelList:SetPos(0, 0)
self.scrollList:SetSize(scrW * 0.4, ScrH() * 0.75);
self.scrollList:SetPos((scrW / 2) - (self.panelList:GetWide() / 2), (scrH / 2) - (self.panelList:GetTall() / 2));
derma.SkinHook("Layout", "Panel", self);
end;
-- Called each frame.
function PANEL:Think()
local quizEnabled = Clockwork.quiz:GetEnabled();
local language = CW_CONVAR_LANG:GetString();
if (self.language != language) then
self.language = language;
if (quizEnabled) then
self:AddQuestions();
end;
self.disconnectButton:SetText(L("MenuDisconnect"));
self.disconnectButton:SizeToContents();
self.continueButton:SetText(L("MenuContinue"));
self.continueButton:SizeToContents();
self.languageForm:SetText(L("Language"));
self.questionsForm:SetText(L(Clockwork.quiz:GetName()));
end;
self:InvalidateLayout(true);
end;
vgui.Register("cwQuiz", PANEL, "DPanel"); | 28.254386 | 114 | 0.728345 |
1d59ea21a401a051ec82fe32dc988178dd53e6a7 | 1,310 | kt | Kotlin | src/main/kotlin/me/aberrantfox/hotbot/database/MutedMemberTransactions.kt | Kewol/hotbot | 97dbac58fbfa200bb217f785473492f2a623014d | [
"MIT"
] | null | null | null | src/main/kotlin/me/aberrantfox/hotbot/database/MutedMemberTransactions.kt | Kewol/hotbot | 97dbac58fbfa200bb217f785473492f2a623014d | [
"MIT"
] | null | null | null | src/main/kotlin/me/aberrantfox/hotbot/database/MutedMemberTransactions.kt | Kewol/hotbot | 97dbac58fbfa200bb217f785473492f2a623014d | [
"MIT"
] | null | null | null | package me.aberrantfox.hotbot.database
import me.aberrantfox.hotbot.extensions.MuteRecord
import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.transactions.transaction
fun insertMutedMember(record: MuteRecord) =
transaction {
MutedMember.insert {
it[MutedMember.unmuteTime] = record.unmuteTime
it[MutedMember.reason] = record.reason
it[MutedMember.moderator] = record.moderator
it[MutedMember.member] = record.user
it[MutedMember.guildId] = record.guildId
}
}
fun deleteMutedMember(record: MuteRecord) =
transaction {
MutedMember.deleteWhere {
Op.build {
(MutedMember.member eq record.user) and (MutedMember.guildId eq record.guildId)
}
}
}
fun getAllMutedMembers() =
transaction {
val mutedMembers = mutableListOf<MuteRecord>()
val membersInDb = MutedMember.selectAll()
membersInDb.forEach {
mutedMembers.add(MuteRecord(
it[MutedMember.unmuteTime],
it[MutedMember.reason],
it[MutedMember.moderator],
it[MutedMember.member],
it[MutedMember.guildId]
))
}
mutedMembers
}
| 29.772727 | 95 | 0.606107 |
4123fba820bf8196b8f1bf86409d00e5f73ccc98 | 2,297 | sql | SQL | egov/egov-ptis/src/main/resources/db/migration/main/V20160125140518__ptis_defaultersreport_roleactionmappings.sql | getwasim/egov-smartcity-suites-test | 361238c743d046080d66b7fcbe44673a8a784be2 | [
"MIT"
] | 1 | 2019-07-25T12:44:57.000Z | 2019-07-25T12:44:57.000Z | egov/egov-ptis/src/main/resources/db/migration/main/V20160125140518__ptis_defaultersreport_roleactionmappings.sql | getwasim/egov-smartcity-suites-test | 361238c743d046080d66b7fcbe44673a8a784be2 | [
"MIT"
] | 13 | 2020-03-05T00:01:16.000Z | 2022-02-09T22:58:42.000Z | egov/egov-ptis/src/main/resources/db/migration/main/V20160125140518__ptis_defaultersreport_roleactionmappings.sql | getwasim/egov-smartcity-suites-test | 361238c743d046080d66b7fcbe44673a8a784be2 | [
"MIT"
] | 1 | 2021-02-22T21:09:08.000Z | 2021-02-22T21:09:08.000Z |
INSERT INTO EG_ACTION (ID,NAME,URL,QUERYPARAMS,PARENTMODULE,ORDERNUMBER,DISPLAYNAME,ENABLED,CONTEXTROOT,VERSION,CREATEDBY,CREATEDDATE,LASTMODIFIEDBY,LASTMODIFIEDDATE,APPLICATION) values
(NEXTVAL('SEQ_EG_ACTION'),'defaultersReport','/reports/defaultersReport-search.action', null,(select id from EG_MODULE where name = 'PTIS-Reports'),1,
'Defaulters Report','true','ptis',0,1,now(),1,now(),(select id from eg_module where name = 'Property Tax'));
INSERT INTO EG_ACTION (ID,NAME,URL,QUERYPARAMS,PARENTMODULE,ORDERNUMBER,DISPLAYNAME,ENABLED,CONTEXTROOT,VERSION,CREATEDBY,CREATEDDATE,LASTMODIFIEDBY,LASTMODIFIEDDATE,APPLICATION) values
(NEXTVAL('SEQ_EG_ACTION'),'defaultersReportResult','/reports/defaultersReport-getDefaultersList.action', null,(select id from EG_MODULE where name = 'PTIS-Reports'),1,
'defaultersReportResult','false','ptis',0,1,now(),1,now(),(select id from eg_module where name = 'Property Tax'));
INSERT INTO EG_ROLEACTION(actionid, roleid) values ((select id from eg_action where name = 'defaultersReport'),
(Select id from eg_role where name='ULB Operator'));
INSERT INTO EG_ROLEACTION(actionid, roleid) values ((select id from eg_action where name = 'defaultersReport'),
(Select id from eg_role where name='Super User'));
INSERT INTO EG_ROLEACTION(actionid, roleid) values ((select id from eg_action where name = 'defaultersReport'),
(Select id from eg_role where name='Property Verifier'));
INSERT INTO EG_ROLEACTION(actionid, roleid) values ((select id from eg_action where name = 'defaultersReport'),
(Select id from eg_role where name='Property Approver'));
INSERT INTO EG_ROLEACTION(actionid, roleid) values ((select id from eg_action where name = 'defaultersReportResult'),
(Select id from eg_role where name='ULB Operator'));
INSERT INTO EG_ROLEACTION(actionid, roleid) values ((select id from eg_action where name = 'defaultersReportResult'),
(Select id from eg_role where name='Super User'));
INSERT INTO EG_ROLEACTION(actionid, roleid) values ((select id from eg_action where name = 'defaultersReportResult'),
(Select id from eg_role where name='Property Verifier'));
INSERT INTO EG_ROLEACTION(actionid, roleid) values ((select id from eg_action where name = 'defaultersReportResult'),
(Select id from eg_role where name='Property Approver'));
| 69.606061 | 186 | 0.783631 |
20e385e3090a5b90fe61f6f1dae484e4dca36f51 | 475 | hpp | C++ | owdinnetwork/define.hpp | channprj/owdin-contract | 7c88818be753cefe330c4a8790359b2239acd3a9 | [
"MIT"
] | null | null | null | owdinnetwork/define.hpp | channprj/owdin-contract | 7c88818be753cefe330c4a8790359b2239acd3a9 | [
"MIT"
] | null | null | null | owdinnetwork/define.hpp | channprj/owdin-contract | 7c88818be753cefe330c4a8790359b2239acd3a9 | [
"MIT"
] | null | null | null | #pragma once
static constexpr uint8_t OBJECT_STORAGE = 0;
static constexpr uint8_t OBJECT_NETWORK = 1;
static constexpr uint8_t OBJECT_SYSTEM = 2;
static constexpr uint8_t OBJECT_PROCESS = 3;
static constexpr uint8_t OBJECT_USAGE = 4;
static constexpr uint8_t OBJECT_SECURITY = 5;
static constexpr uint8_t RSOURCE_STORAGE = 0;
static constexpr uint8_t RSOURCE_NETWORK = 1;
static constexpr uint8_t RSOURCE_CPU = 2;
static constexpr uint8_t RSOURCE_MEMORY = 3;
| 33.928571 | 45 | 0.793684 |
364ba488e7cc761cecf2972c273001cf7520629e | 4,321 | swift | Swift | swift/Tests/IpAddressTests/Prefix32Tests.swift | mabels/ipaddress | d39d02c97481dcf607617b2da7000f04a0fb3f70 | [
"MIT"
] | 11 | 2017-09-28T09:14:28.000Z | 2021-11-01T07:24:41.000Z | swift/Tests/IpAddressTests/Prefix32Tests.swift | mabels/ipaddress | d39d02c97481dcf607617b2da7000f04a0fb3f70 | [
"MIT"
] | 1 | 2016-08-31T06:55:54.000Z | 2016-08-31T06:55:54.000Z | swift/Tests/IpAddressTests/Prefix32Tests.swift | mabels/ipaddress | d39d02c97481dcf607617b2da7000f04a0fb3f70 | [
"MIT"
] | 4 | 2016-08-31T06:45:32.000Z | 2021-05-13T10:31:03.000Z |
import XCTest
//@testable import Swift
@testable import IpAddress
import BigInt
class Prefix32Test {
let netmask0: String = "0.0.0.0";
let netmask8: String = "255.0.0.0";
let netmask16: String = "255.255.0.0";
let netmask24: String = "255.255.255.0";
let netmask30: String = "255.255.255.252";
var netmasks: [String] = [String]();
var prefix_hash = [String: UInt8]();
var octets_hash = [UInt8: [UInt]]();
var u32_hash = [UInt8: BigUInt]();
}
func setup() -> Prefix32Test {
let p32t = Prefix32Test();
p32t.netmasks.append(p32t.netmask0);
p32t.netmasks.append(p32t.netmask8);
p32t.netmasks.append(p32t.netmask16);
p32t.netmasks.append(p32t.netmask24);
p32t.netmasks.append(p32t.netmask30);
p32t.prefix_hash["0.0.0.0"] = 0;
p32t.prefix_hash["255.0.0.0"] = 8;
p32t.prefix_hash["255.255.0.0"] = 16;
p32t.prefix_hash["255.255.255.0"] = 24;
p32t.prefix_hash["255.255.255.252"] = 30;
p32t.octets_hash[0] = [0, 0, 0, 0];
p32t.octets_hash[8] = [255, 0, 0, 0];
p32t.octets_hash[16] = [255, 255, 0, 0];
p32t.octets_hash[24] = [255, 255, 255, 0];
p32t.octets_hash[30] = [255, 255, 255, 252];
p32t.u32_hash[0] = BigUInt(0);
p32t.u32_hash[8] = BigUInt("4278190080");
p32t.u32_hash[16] = BigUInt("4294901760");
p32t.u32_hash[24] = BigUInt("4294967040");
p32t.u32_hash[30] = BigUInt("4294967292");
return p32t;
}
class Prefix32Tests: XCTestCase {
func test_attributes() {
for (_, e) in setup().prefix_hash {
let prefix = Prefix32.create(e)!;
XCTAssertEqual(e, prefix.num);
}
}
func test_parse_netmask_to_prefix() {
for (netmask, num) in setup().prefix_hash {
// console.log(e);
let prefix = IPAddress.parse_netmask_to_prefix(netmask)!;
XCTAssertEqual(num, prefix);
}
}
func test_method_to_ip() {
for (netmask, num) in setup().prefix_hash {
let prefix = Prefix32.create(num)!;
XCTAssertEqual(netmask, prefix.to_ip_str())
}
}
func test_method_to_s() {
let prefix = Prefix32.create(8)!;
XCTAssertEqual("8", prefix.to_s())
}
func test_method_bits() {
let prefix = Prefix32.create(16)!;
XCTAssertEqual("11111111111111110000000000000000", prefix.bits())
}
func test_method_to_u32() {
for (num, ip32) in setup().u32_hash {
XCTAssertEqual(ip32, Prefix32.create(num)!.netmask());
}
}
func test_method_plus() {
let p1 = Prefix32.create(8)!;
let p2 = Prefix32.create(10)!;
XCTAssertEqual(18, p1.add_prefix(p2)!.num);
XCTAssertEqual(12, p1.add(4)!.num)
}
func test_method_minus() {
let p1 = Prefix32.create(8)!;
let p2 = Prefix32.create(24)!;
XCTAssertEqual(16, p1.sub_prefix(p2)!.num);
XCTAssertEqual(16, p2.sub_prefix(p1)!.num);
XCTAssertEqual(20, p2.sub(4)!.num);
}
func test_initialize() {
XCTAssertNil(Prefix32.create(33));
XCTAssertNotNil(Prefix32.create(8));
}
func test_method_octets() {
for (pref, arr) in setup().octets_hash {
let prefix = Prefix32.create(pref)!;
XCTAssertEqual(prefix.ip_bits.parts(prefix.netmask()), arr);
}
}
func test_method_brackets() {
for (pref, arr) in setup().octets_hash {
let prefix = Prefix32.create(pref)!;
for index in stride(from:0, to:arr.count, by:1) {
// console.log("xxxx", prefix.netmask());
XCTAssertEqual(prefix.ip_bits.parts(prefix.netmask())[index], arr[index]);
}
}
}
func test_method_hostmask() {
let prefix = Prefix32.create(8)!;
// console.log(">>>>", prefix.host_mask());
XCTAssertEqual("0.255.255.255", Ipv4.from_int(prefix.host_mask(), 0)!.to_s());
}
static var allTests : [(String, (Prefix32Tests) -> () throws -> Void)] {
return [
("test_attributes", test_attributes),
("test_parse_netmask_to_prefix", test_parse_netmask_to_prefix),
("test_method_to_ip", test_method_to_ip),
("test_method_to_s", test_method_to_s),
("test_method_bits", test_method_bits),
("test_method_to_u32", test_method_to_u32),
("test_method_plus", test_method_plus),
("test_method_minus", test_method_minus),
("test_initialize", test_initialize),
("test_method_octets", test_method_octets),
("test_method_brackets", test_method_brackets),
("test_method_hostmask", test_method_hostmask),
]
}
}
| 31.772059 | 82 | 0.652395 |
f9a085fd8c3505de67150aba5777541406287149 | 3,262 | lua | Lua | ULX commands/customcommands.lua | katacola/ULX-Commands | a9acf33a3432ff017659d846eda9d1754e08ff14 | [
"MIT"
] | null | null | null | ULX commands/customcommands.lua | katacola/ULX-Commands | a9acf33a3432ff017659d846eda9d1754e08ff14 | [
"MIT"
] | null | null | null | ULX commands/customcommands.lua | katacola/ULX-Commands | a9acf33a3432ff017659d846eda9d1754e08ff14 | [
"MIT"
] | null | null | null | if (SERVER) then
util.AddNetworkString("target_ply")
util.AddNetworkString("friendlist")
net.Receive( "friendlist", function(len, ply)
local friends = net.ReadTable()
local friendstring = table.concat( friends, ", " )
ulx.fancyLogAdmin( nil, true, "#T is friends with: #s ", ply, friendstring )
end)
end
if CLIENT then
net.Receive("friendlist", function()
local friends = {}
for k, v in pairs(player.GetAll()) do
if v:GetFriendStatus() == "friend" then
table.insert( friends, v:Nick() )
end
end
net.Start("friendlist")
net.WriteTable(friends)
net.SendToServer()
end)
end
function ulx.listfriends(calling_ply, target_ply)
net.Start("friendlist")
net.Send(target_ply)
end
local listfriends = ulx.command("Essentials", "ulx listfriends", ulx.listfriends, "!friends",true)
listfriends:addParam{ type=ULib.cmds.PlayerArg }
listfriends:defaultAccess( ULib.ACCESS_ADMIN )
listfriends:help( "Check for friends playing on the server." )
function ulx.watch(calling_ply, target_ply,reason)
target_ply:SetPData("Watched","true")
target_ply:SetPData("WatchReason",reason)
ulx.fancyLogAdmin( calling_ply, true, "#A marked #T as watched: "..reason.. "" , target_ply )
end
local watch = ulx.command("Essentials", "ulx watch", ulx.watch, "!watch",true)
watch:addParam{ type=ULib.cmds.PlayerArg }
watch:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.takeRestOfLine }
watch:defaultAccess( ULib.ACCESS_ADMIN )
watch:help( "Puts a player on watch list." )
function ulx.unwatch(calling_ply, target_ply)
target_ply:SetPData("Watched","false")
target_ply:RemovePData("WatchReason")
ulx.fancyLogAdmin( calling_ply, true, "#A removed #T from watch list", target_ply )
end
local unwatch = ulx.command("Essentials", "ulx unwatch", ulx.unwatch, "!unwatch",true)
unwatch:addParam{ type=ULib.cmds.PlayerArg }
unwatch:defaultAccess( ULib.ACCESS_ADMIN )
unwatch:help( "Removes a player from watch list." )
function userAuthed( ply, stid, unid )
if ply:GetPData("Watched") == "true" then
ulx.fancyLogAdmin(nil, true, "#T ("..stid.. ") is on the watchlist: "..ply:GetPData("WatchReason").. "",ply)
end
end
hook.Add( "PlayerAuthed", "watchlisthook", userAuthed )
function ulx.watchlist(calling_ply)
watchlist = {}
for k, v in pairs(player.GetAll()) do
if v:GetPData("Watched") == "true" then
table.insert( watchlist, v:Nick())
table.insert(watchlist, v:GetPData("WatchReason"))
end
end
local watchstring = table.concat( watchlist, ", " )
ulx.fancyLogAdmin( nil, true, "Watchlist: #s ",watchstring )
end
local watchlist = ulx.command("Essentials", "ulx watchlist", ulx.watchlist, "!watchlist",true)
watchlist:defaultAccess( ULib.ACCESS_ADMIN )
watchlist:help( "Prints watch list." )
--[[
function leavemessage( ply )
ULib.tsayColor( nil, false, Color(0,200,0), ply:Nick(),Color(151,211,255)," has disconnected. ("..ply:SteamID().. ")")
end
hook.Add( "PlayerDisconnected", "leave message", leavemessage )
]]-- | 38.376471 | 121 | 0.657572 |
82e8dfc51dfe7a2a553d0506cdcf6127b308cac7 | 352 | sql | SQL | algamoney-api/src/main/resources/db/migration/V01__create_and_register_categories.sql | tiagoadmstz/angular-spring-algaworks | 15453acfc260e38b24677729272138ea22c9d3a6 | [
"MIT"
] | null | null | null | algamoney-api/src/main/resources/db/migration/V01__create_and_register_categories.sql | tiagoadmstz/angular-spring-algaworks | 15453acfc260e38b24677729272138ea22c9d3a6 | [
"MIT"
] | 18 | 2021-08-31T20:19:56.000Z | 2022-03-07T11:24:48.000Z | algamoney-api/src/main/resources/db/migration/V01__create_and_register_categories.sql | tiagoadmstz/angular-spring-algaworks | 15453acfc260e38b24677729272138ea22c9d3a6 | [
"MIT"
] | null | null | null | CREATE TABLE category (
id BIGINT(20) PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(50) NOT NULL
);
INSERT INTO category (name) values ('Lazer');
INSERT INTO category (name) values ('Alimentação');
INSERT INTO category (name) values ('Supermercado');
INSERT INTO category (name) values ('Farmárcia');
INSERT INTO category (name) values ('Outros');
| 32 | 52 | 0.727273 |
b7f8c0f154075eb0fc0f3edc63ddf8571b3d8502 | 178 | sql | SQL | 2/10.sql | gerenium/SQL | 107ffc727a449361cc02326d31de32907a0fb953 | [
"MIT"
] | null | null | null | 2/10.sql | gerenium/SQL | 107ffc727a449361cc02326d31de32907a0fb953 | [
"MIT"
] | null | null | null | 2/10.sql | gerenium/SQL | 107ffc727a449361cc02326d31de32907a0fb953 | [
"MIT"
] | null | null | null | SELECT name,
city,
date_first,
(DATEDIFF(date_last, date_first)+1)*per_diem AS Сумма
FROM trip
WHERE MONTH(date_first) IN(2,3)
ORDER BY name, Сумма DESC
| 22.25 | 61 | 0.668539 |
28acddd93e41c476506264cab69f77186343b848 | 3,175 | swift | Swift | Sources/Segment/Plugins/Metrics.swift | Jeehut/analytics-swift | 8b8ae5a1d3433cc691d40d354351e71e13be0f4c | [
"MIT"
] | null | null | null | Sources/Segment/Plugins/Metrics.swift | Jeehut/analytics-swift | 8b8ae5a1d3433cc691d40d354351e71e13be0f4c | [
"MIT"
] | null | null | null | Sources/Segment/Plugins/Metrics.swift | Jeehut/analytics-swift | 8b8ae5a1d3433cc691d40d354351e71e13be0f4c | [
"MIT"
] | null | null | null | //
// Metrics.swift
// Segment
//
// Created by Cody Garvin on 12/15/20.
//
import Foundation
public enum MetricType: Int {
case counter = 0 // Not Verbose
case gauge // Semi-verbose
func toString() -> String {
if self == .counter {
return "Counter"
} else {
return "Gauge"
}
}
static func fromString(_ string: String) -> Self {
if string == "Gauge" {
return .gauge
} else {
return .counter
}
}
}
public extension RawEvent {
mutating func addMetric(_ type: MetricType, name: String, value: Double, tags: [String]?, timestamp: Date) {
guard let metric = try? JSON(with: Metric(eventName: "\(Self.self)", metricName: name, value: value, tags: tags, type: type, timestamp: Date())) else {
exceptionFailure("Unable to add metric `\(name)`")
return
}
if self.metrics == nil {
metrics = [JSON]()
}
if let jsonEncoded = try? JSON(with: metric) {
metrics?.append(jsonEncoded)
} else {
exceptionFailure("Unable to encode metric `\(name)` to JSON.")
}
}
}
fileprivate struct Metric: Codable {
var eventName: String = ""
var metricName: String = ""
var value: Double = 0.0
var tags: [String]? = nil
var type: MetricType = .counter
var timestamp: Date = Date()
enum CodingKeys: String, CodingKey {
case eventName
case metricName
case value
case tags
case type
case timestamp
}
init(eventName: String, metricName: String, value: Double, tags: [String]?, type: MetricType, timestamp: Date) {
self.eventName = eventName
self.metricName = metricName
self.value = value
self.tags = tags
self.type = type
self.timestamp = timestamp
}
init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: CodingKeys.self)
eventName = try values.decode(String.self, forKey: .eventName)
metricName = try values.decode(String.self, forKey: .metricName)
value = try values.decode(Double.self, forKey: .value)
tags = try values.decode([String]?.self, forKey: .tags)
let timestampString = try values.decode(String.self, forKey: .timestamp)
if let timestampDate = timestampString.iso8601() {
timestamp = timestampDate
}
let typeString = try values.decode(String.self, forKey: .type)
type = MetricType.fromString(typeString)
}
func encode(to encoder: Encoder) throws {
var values = encoder.container(keyedBy: CodingKeys.self)
try values.encode(eventName, forKey: .eventName)
try values.encode(metricName, forKey: .metricName)
try values.encode(value, forKey: .value)
try values.encode(tags, forKey: .tags)
try values.encode(type.toString(), forKey: .type)
let timestampString = timestamp.iso8601()
try values.encode(timestampString, forKey: .timestamp)
}
}
| 30.528846 | 159 | 0.588346 |
95198177c92bd3e74e3b1bb393ada83c6d0e7fca | 7,902 | swift | Swift | TCBBarcode/Classes/TCBBarcodeObject.swift | TheCodingBug/TCBBarcode | 10091805b5cd6134d295555be7a85a75d06354c9 | [
"MIT"
] | null | null | null | TCBBarcode/Classes/TCBBarcodeObject.swift | TheCodingBug/TCBBarcode | 10091805b5cd6134d295555be7a85a75d06354c9 | [
"MIT"
] | null | null | null | TCBBarcode/Classes/TCBBarcodeObject.swift | TheCodingBug/TCBBarcode | 10091805b5cd6134d295555be7a85a75d06354c9 | [
"MIT"
] | null | null | null | //
// TCBBarcodeObject.swift
// TCBBarcode
//
// Created by Neil Francis Hipona on 5/21/21.
//
import Foundation
import CoreImage
public class TCBBarcodeObject: NSObject {
public enum TCBBarcodeObjectFillMode {
case originalSize // image size is retained
case aspectFit // contents scaled to fit with fixed aspect. remainder is transparent
case aspectFill // contents scaled to fill with fixed aspect. some portion of content may be clipped.
}
private var ciCode: CIImage!
private var transform: CGAffineTransform = .identity
private override init() {
super.init()
}
public var code: UIImage {
let output = ciCode.transformed(by: transform, highQualityDownsample: true)
return UIImage(ciImage: output)
}
convenience public init(barcode code: CIImage, transform t: CGAffineTransform) {
self.init()
ciCode = code
transform = t
}
}
// MARK: - Helpers
extension TCBBarcodeObject {
fileprivate func roundOff(value: CGFloat, decimal: Int = 2) -> CGFloat {
let power = pow(10, decimal)
let decimalFloat = NSDecimalNumber(decimal: power).floatValue
let decimal = CGFloat(decimalFloat)
let rounded = round(value * decimal) / decimal
return rounded
}
fileprivate func getScale(forCanvas canvas: CGFloat, itemSize: CGFloat) -> CGFloat {
return canvas / itemSize
}
fileprivate func getFitRatio(forCanvas canvas: CGSize, itemSize: CGSize) -> CGFloat {
let ratio = getScale(forCanvas: canvas.width, itemSize: itemSize.width)
// validate ratio to canvas size
let itemHeight = ratio * itemSize.height
let roundedItemHeight = roundOff(value: itemHeight)
let roundedCanvasHeight = roundOff(value: canvas.height)
if roundedItemHeight > roundedCanvasHeight { // invalid
// flip values
let flippedCanvas = CGSize(width: canvas.height, height: canvas.width)
let flippedItemSize = CGSize(width: itemSize.height, height: itemSize.width)
return getFitRatio(forCanvas: flippedCanvas, itemSize: flippedItemSize)
}
return ratio
}
fileprivate func getFillRatio(forCanvas canvas: CGSize, itemSize: CGSize) -> CGFloat {
let ratio = getScale(forCanvas: canvas.width, itemSize: itemSize.width)
// validate ratio to canvas size
let itemHeight = ratio * itemSize.height
let roundedItemHeight = roundOff(value: itemHeight)
let roundedCanvasHeight = roundOff(value: canvas.height)
if roundedItemHeight < roundedCanvasHeight { // invalid
// flip values
let flippedCanvas = CGSize(width: canvas.height, height: canvas.width)
let flippedItemSize = CGSize(width: itemSize.height, height: itemSize.width)
return getFillRatio(forCanvas: flippedCanvas, itemSize: flippedItemSize)
}
return ratio
}
fileprivate func getScale(for mode: TCBBarcodeObjectFillMode, withCanvas canvas: CGSize, itemSize: CGSize) -> CGFloat {
switch mode {
case .aspectFit:
return getFitRatio(forCanvas: canvas, itemSize: itemSize)
case .aspectFill:
return getFillRatio(forCanvas: canvas, itemSize: itemSize)
default:
return 1.0
}
}
fileprivate func applyCrop(for mode: TCBBarcodeObjectFillMode, imageCode: CIImage, itemSize: CGSize) -> CIImage {
switch mode {
case .aspectFill:
let cropRect = CGRect(x: 0, y: 0, width: itemSize.width, height: itemSize.height)
let output = imageCode.cropped(to: cropRect)
return output
default:
return imageCode
}
}
fileprivate func setCodeTransparent(_ ciCode: CIImage) -> CIImage? {
let params = [kCIInputImageKey: ciCode as Any]
guard let filter = CIFilter(name: "CIMaskToAlpha", parameters: params),
let output = filter.outputImage
else { return nil }
return output
}
fileprivate func setCodeColorInverted(_ ciCode: CIImage) -> CIImage? {
let params = [kCIInputImageKey: ciCode as Any]
guard let filter = CIFilter(name: "CIColorInvert", parameters: params),
let output = filter.outputImage
else { return nil }
return output
}
}
extension TCBBarcodeObject {
public func applyTransparent() {
if let output = setCodeTransparent(ciCode) {
ciCode = output // update original
}
}
public func applyInvert() {
if let output = setCodeColorInverted(ciCode) {
ciCode = output // update original
}
}
public func applyTint(color: UIColor) {
// apply color
let ciColor = CIColor(color: color)
let colorParams = [kCIInputColorKey: ciColor as Any]
guard let colorFilter = CIFilter(name: "CIConstantColorGenerator", parameters: colorParams),
let output = colorFilter.outputImage
else { return }
// if conversion fails, original code will not be affected
guard let inverted = setCodeColorInverted(ciCode) else { return } // flip color
guard let transparent = setCodeTransparent(inverted) else { return } // make solid color transparent
// apply composite
let compositeParams = [
kCIInputImageKey: transparent as Any,
kCIInputBackgroundImageKey: output as Any
]
guard let compositeFilter = CIFilter(name: "CIMultiplyCompositing", parameters: compositeParams),
let output2 = compositeFilter.outputImage
else { return }
ciCode = output2 // update original
}
public func applyBlend(withImage img: CGImage, fillMode mode: TCBBarcodeObjectFillMode = .aspectFill) {
let image = CIImage(cgImage: img)
let scale = getScale(for: mode, withCanvas: ciCode.extent.size, itemSize: image.extent.size)
let reScaleTransform = CGAffineTransform(scaleX: scale, y: scale)
let reScaledImage = image.transformed(by: reScaleTransform)
let params = [
kCIInputMaskImageKey: ciCode as Any,
kCIInputBackgroundImageKey: reScaledImage as Any
]
guard let filter = CIFilter(name: "CIBlendWithMask", parameters: params),
let output = filter.outputImage
else { return }
let cropped = applyCrop(for: mode, imageCode: output, itemSize: ciCode.extent.size)
ciCode = cropped // update original
}
public func applyLogo(withImage img: CGImage) {
let image = CIImage(cgImage: img)
let scale = getFitRatio(forCanvas: ciCode.extent.size, itemSize: image.extent.size) * 0.18 // set to 20% of the canvas
let reScaleTransform = CGAffineTransform(scaleX: scale, y: scale)
let reScaledLogo = image.transformed(by: reScaleTransform)
let logoMidX = reScaledLogo.extent.width / 2
let logoMidY = reScaledLogo.extent.height / 2
let midX = ciCode.extent.midX - logoMidX
let midY = ciCode.extent.midY - logoMidY
let imageTransform = CGAffineTransform(translationX: midX, y: midY)
let logo = reScaledLogo.transformed(by: imageTransform, highQualityDownsample: true)
let params = [
kCIInputImageKey: logo as Any,
kCIInputBackgroundImageKey: ciCode as Any
]
guard let filter = CIFilter(name: "CISourceOverCompositing", parameters: params),
let output = filter.outputImage
else { return }
ciCode = output // update original
}
}
| 37.450237 | 126 | 0.635409 |
df6541db0263d25798f2dfc3ca79afd5508679ca | 405 | sql | SQL | posda/posdatools/queries/sql/ActiveQueriesRunning.sql | UAMS-DBMI/PosdaTools | 7d33605da1b88e4787a1368dbecaffda1df95e5b | [
"Apache-2.0"
] | 6 | 2019-01-17T15:47:44.000Z | 2022-02-02T16:47:25.000Z | posda/posdatools/queries/sql/ActiveQueriesRunning.sql | UAMS-DBMI/PosdaTools | 7d33605da1b88e4787a1368dbecaffda1df95e5b | [
"Apache-2.0"
] | 23 | 2016-06-08T21:51:36.000Z | 2022-03-02T08:11:44.000Z | posda/posdatools/queries/sql/ActiveQueriesRunning.sql | UAMS-DBMI/PosdaTools | 7d33605da1b88e4787a1368dbecaffda1df95e5b | [
"Apache-2.0"
] | null | null | null | -- Name: ActiveQueriesRunning
-- Schema: posda_backlog
-- Columns: ['datname', 'pid', 'time_query_running', 'query']
-- Args: []
-- Tags: ['AllCollections', 'postgres_stats', 'postgres_query_stats']
-- Description: Get a list of collections and sites
--
select
datname, pid,
now() - query_start as time_query_running,
query
from pg_stat_activity
where
state = 'active'
order by datname, state
| 23.823529 | 69 | 0.71358 |
6115899c7504a2857d87390f769859da04ac7643 | 5,702 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1280.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1280.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1280.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r13
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x116a5, %rsi
lea addresses_WC_ht+0x183a5, %rdi
nop
nop
sub $49371, %r11
mov $38, %rcx
rep movsw
nop
nop
nop
cmp %rsi, %rsi
lea addresses_D_ht+0x9805, %rcx
nop
nop
nop
cmp $34039, %r12
movw $0x6162, (%rcx)
nop
nop
nop
dec %r13
lea addresses_normal_ht+0x58b6, %r12
nop
nop
nop
nop
add $59696, %rdi
mov (%r12), %cx
nop
xor %r12, %r12
lea addresses_UC_ht+0xdbd, %rdi
xor $39020, %rbp
movb (%rdi), %r13b
nop
nop
and %rcx, %rcx
lea addresses_D_ht+0x5ea5, %rbp
nop
nop
cmp $61581, %r12
mov $0x6162636465666768, %rsi
movq %rsi, %xmm3
movups %xmm3, (%rbp)
nop
nop
nop
nop
nop
xor %rdi, %rdi
lea addresses_normal_ht+0xfaa5, %r12
clflush (%r12)
nop
nop
nop
nop
cmp $19977, %rsi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm3
vmovups %ymm3, (%r12)
nop
nop
nop
nop
nop
and %r13, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r15
push %r9
push %rax
push %rbx
push %rcx
push %rdx
// Store
lea addresses_WC+0xa2a5, %r12
and %rax, %rax
mov $0x5152535455565758, %rdx
movq %rdx, %xmm0
movaps %xmm0, (%r12)
nop
inc %rdx
// Faulty Load
lea addresses_WC+0xa2a5, %r9
and $39949, %rbx
movups (%r9), %xmm3
vpextrq $1, %xmm3, %rdx
lea oracles, %rcx
and $0xff, %rdx
shlq $12, %rdx
mov (%rcx,%rdx,1), %rdx
pop %rdx
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r15
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_WC'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_normal_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 41.318841 | 2,999 | 0.659944 |
904b81074164e53dc40b854247bd35c38d9e668d | 409 | py | Python | pdfp-extract.py | shaunabanana/SquashNote | 1a2dfb9143ee9ef6df0505b7a83d5b297b678266 | [
"MIT"
] | 2 | 2020-10-28T12:56:56.000Z | 2021-01-28T01:20:27.000Z | pdfp-extract.py | shaunabanana/SquashNote | 1a2dfb9143ee9ef6df0505b7a83d5b297b678266 | [
"MIT"
] | null | null | null | pdfp-extract.py | shaunabanana/SquashNote | 1a2dfb9143ee9ef6df0505b7a83d5b297b678266 | [
"MIT"
] | null | null | null | import sys
import base64
import json
import os.path
if len(sys.argv) < 3:
print("USAGE: pdfp-extract.py [pdfp_path] [output_path]")
sys.exit()
f = open(sys.argv[1])
pdfp = f.read()
f.close()
pdfp = pdfp.replace("local_pdf(", "").replace(")", "")
pdfp = json.loads(pdfp)
pdf = base64.b64decode(pdfp['pdf'])
f = open(os.path.join(sys.argv[2], pdfp['slide'] + ".pdf"), 'wb')
f.write(pdf)
f.close() | 17.782609 | 65 | 0.633252 |
1935d203630d6b62241803381f2c8893d9c858ea | 223 | asm | Assembly | ImageLabeling/x64/Debug/.NETFramework,Version=v4.6.1.AssemblyAttributes.asm | BarisATAK/Yolo_Marking_Tool | ae34caa8e52cb7c3ccd62943d9a914e8f9a24d6a | [
"MIT"
] | 3 | 2020-05-14T16:14:40.000Z | 2020-05-21T14:40:05.000Z | ImageLabeling/x64/Debug/.NETFramework,Version=v4.6.1.AssemblyAttributes.asm | BarisATAK/Yolo_Marking_Tool | ae34caa8e52cb7c3ccd62943d9a914e8f9a24d6a | [
"MIT"
] | null | null | null | ImageLabeling/x64/Debug/.NETFramework,Version=v4.6.1.AssemblyAttributes.asm | BarisATAK/Yolo_Marking_Tool | ae34caa8e52cb7c3ccd62943d9a914e8f9a24d6a | [
"MIT"
] | null | null | null | ; Listing generated by Microsoft (R) Optimizing Compiler Version 19.16.27039.0
; Generated by VC++ for Common Language Runtime
.file "C:\Users\atakb\AppData\Local\Temp\.NETFramework,Version=v4.6.1.AssemblyAttributes.cpp"
| 44.6 | 93 | 0.784753 |
cb99326c9f70e10fe422b08118a404d209f16bd1 | 1,005 | go | Go | common/log.go | sipt/faygo-security | 26d552394b13b3bb0f9c9fd5db7a3ade1fdaf09b | [
"Apache-2.0"
] | 3 | 2017-09-27T01:47:29.000Z | 2019-09-08T15:47:57.000Z | common/log.go | sipt/faygo-security | 26d552394b13b3bb0f9c9fd5db7a3ade1fdaf09b | [
"Apache-2.0"
] | null | null | null | common/log.go | sipt/faygo-security | 26d552394b13b3bb0f9c9fd5db7a3ade1fdaf09b | [
"Apache-2.0"
] | null | null | null | package common
import (
"fmt"
"time"
)
func init() {
logger = new(Console)
}
//Console console log
type Console struct{}
//Info log info
func (Console) Info(args ...interface{}) {
fmt.Println(time.Now().Format("2006-01-02 15:04:05"), " [INFO] ", args)
}
//Warn log info
func (Console) Warn(args ...interface{}) {
fmt.Println(time.Now().Format("2006-01-02 15:04:05"), " [WARN] ", args)
}
//Error log info
func (Console) Error(args ...interface{}) {
fmt.Println(time.Now().Format("2006-01-02 15:04:05"), " [ERROR] ", args)
}
//ILogger logger interface
type ILogger interface {
Info(args ...interface{})
Warn(args ...interface{})
Error(args ...interface{})
}
//logger sigle logger entry
var logger ILogger
//Info log info
func Info(args ...interface{}) {
logger.Info(args)
}
//Warn log info
func Warn(args ...interface{}) {
logger.Info(args)
}
//Error log info
func Error(args ...interface{}) {
logger.Error(args)
}
//SetLogger custom logger
func SetLogger(l ILogger) {
logger = l
}
| 17.033898 | 73 | 0.657711 |
1b5dde1ee3c16d897d9255af75bf7f2704070f73 | 1,175 | sql | SQL | wpattern-rest-cdi/project_files/database_create.sql | bbranquinho/wpattern-rest-cdi | 524977b505c62aec925a8faf9bbb1e63d435e02f | [
"Apache-2.0"
] | null | null | null | wpattern-rest-cdi/project_files/database_create.sql | bbranquinho/wpattern-rest-cdi | 524977b505c62aec925a8faf9bbb1e63d435e02f | [
"Apache-2.0"
] | null | null | null | wpattern-rest-cdi/project_files/database_create.sql | bbranquinho/wpattern-rest-cdi | 524977b505c62aec925a8faf9bbb1e63d435e02f | [
"Apache-2.0"
] | null | null | null | -- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema cdi_rest
-- -----------------------------------------------------
DROP SCHEMA IF EXISTS `cdi_rest` ;
-- -----------------------------------------------------
-- Schema cdi_rest
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `cdi_rest` DEFAULT CHARACTER SET utf8 ;
USE `cdi_rest` ;
-- -----------------------------------------------------
-- Table `cdi_rest`.`tb_product`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `cdi_rest`.`tb_product` ;
CREATE TABLE IF NOT EXISTS `cdi_rest`.`tb_product` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(50) NOT NULL,
`description` VARCHAR(100) NOT NULL,
`price` DECIMAL(10,2) NOT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
| 33.571429 | 73 | 0.542979 |
f98004ff535bfbaed09c279293d127728cf2e215 | 1,494 | asm | Assembly | EjerciciosClase/examenPasado.asm | adeandak/OPC | 4384259c5f4e46d67a6c4417ea72953a62ccd901 | [
"MIT"
] | null | null | null | EjerciciosClase/examenPasado.asm | adeandak/OPC | 4384259c5f4e46d67a6c4417ea72953a62ccd901 | [
"MIT"
] | null | null | null | EjerciciosClase/examenPasado.asm | adeandak/OPC | 4384259c5f4e46d67a6c4417ea72953a62ccd901 | [
"MIT"
] | null | null | null | TITLE examenPasado.asm
; Ejemplo del segundo examen
; Irvine Library procedures and functions
INCLUDE \masm32\Irvine\Irvine32.inc
INCLUDELIB \masm32\Irvine\Irvine32.lib
INCLUDELIB \masm32\Irvine\User32.lib
INCLUDELIB \masm32\Irvine\Kernel32.lib
; End Irvine
myNull=0
.DATA
arrStr BYTE "on1", myNull
BYTE "tw2", myNull
BYTE "th3", myNull
BYTE "fo4", myNull
BYTE "fi5", myNull
BYTE "si6", myNull
BYTE "se7", myNull
BYTE "ei8", myNull
BYTE "ni9", myNull
BYTE "teA", myNull
texto BYTE "Soy AAK173347", 0
textoN BYTE "Teclee N:", 0
textoAux BYTE "Indique la posicion del 1o string:" ;sabemos que el string esta entre 1 y 10.
BYTE "Indique la posicion del 2o string:"
BYTE "Indique la posicion del 3o string:"
BYTE "Indique la posicion del 4o string:"
BYTE "Indique la posicion del 5o string:"
BYTE "Indique la posicion del 6o string:"
BYTE "Indique la posicion del 7o string:"
BYTE "Indique la posicion del 8o string:"
BYTE "Indique la posicion del 9o string:"
BYTE "Indique la posicion del 10o string:"
tot BYTE 0
.CODE
main PROC
;poner que soy andy
mov EDX, OFFSET texto
call WriteString
call CrLf
;preguntar cuantos elementos tiene el arreglo
mov EDX, OFFSET textoN
call WriteString
call CrLf
call ReadInt ;leo N y se guarda en eax
mov tot, EAX ;paso lo que tengo en EAX a la memoria
exit
main ENDP
END main
| 24.491803 | 93 | 0.670683 |
f3e774b5b805b2c849551fd611cf2c7ca8fd788a | 589 | lua | Lua | programs/lavafuel.lua | legostax/cc-packman | 354f60bd6e6e2385357b98b04719235bd8e597ad | [
"MIT"
] | null | null | null | programs/lavafuel.lua | legostax/cc-packman | 354f60bd6e6e2385357b98b04719235bd8e597ad | [
"MIT"
] | null | null | null | programs/lavafuel.lua | legostax/cc-packman | 354f60bd6e6e2385357b98b04719235bd8e597ad | [
"MIT"
] | null | null | null | local tArgs = {...}
if #tArgs < 2 then
print(fs.getName(shell.getRunningProgram()).." <spaces_out> <buckets>")
return
else
local spaces = tonumber(tArgs[1])
local buckets = tonumber(tArgs[2])
local fd = turtle.forward
local bk = turtle.back
local pl = turtle.placeDown
local rf = turtle.refuel
for i = 1,spaces do
fd()
end
for i = 1,buckets do
pl()
fd()
rf()
end
for i = 1,buckets do
bk()
end
for i = 1,spaces do
bk()
end
print("Fuel level: "..turtle.getFuelLevel())
end
| 19.633333 | 75 | 0.555178 |
7c6d4838d4bc98a367adcde9b2cebbc5258a8868 | 727 | swift | Swift | example/MyDataHelpsKit-Example/ProviderConnections/ProviderConnectionAuthViewRepresentable.swift | CareEvolution/MyDataHelpsKit-iOS | 8e5aeb3ed7355f24b7bc262c0717e2dbcabda5e3 | [
"Apache-2.0"
] | null | null | null | example/MyDataHelpsKit-Example/ProviderConnections/ProviderConnectionAuthViewRepresentable.swift | CareEvolution/MyDataHelpsKit-iOS | 8e5aeb3ed7355f24b7bc262c0717e2dbcabda5e3 | [
"Apache-2.0"
] | 20 | 2021-04-27T17:17:03.000Z | 2022-03-21T13:58:04.000Z | example/MyDataHelpsKit-Example/ProviderConnections/ProviderConnectionAuthViewRepresentable.swift | CareEvolution/MyDataHelpsKit-iOS | 8e5aeb3ed7355f24b7bc262c0717e2dbcabda5e3 | [
"Apache-2.0"
] | null | null | null | //
// ProviderConnectionAuthViewRepresentable.swift
// MyDataHelpsKit-Example
//
// Created by CareEvolution on 8/26/21.
//
import SwiftUI
import MyDataHelpsKit
import SafariServices
struct ProviderConnectionAuthViewRepresentable: UIViewControllerRepresentable {
typealias UIViewControllerType = SFSafariViewController
let url: URL
var presentation: Binding<ExternalAccountAuthorization?>
func makeUIViewController(context: Context) -> SFSafariViewController {
let safari = SFSafariViewController(url: url)
safari.dismissButtonStyle = .cancel
return safari
}
func updateUIViewController(_ uiViewController: SFSafariViewController, context: Context) {
}
}
| 26.925926 | 95 | 0.755158 |
4a2e45744376fbe277480758a2d47f38b2a27762 | 1,206 | js | JavaScript | app/smmry/downdrill/downdrill.service.js | deepakexcel/New-Angular-Test | b5d1a74bd73726202f0d99e4d0b102ef23811d64 | [
"MIT"
] | null | null | null | app/smmry/downdrill/downdrill.service.js | deepakexcel/New-Angular-Test | b5d1a74bd73726202f0d99e4d0b102ef23811d64 | [
"MIT"
] | null | null | null | app/smmry/downdrill/downdrill.service.js | deepakexcel/New-Angular-Test | b5d1a74bd73726202f0d99e4d0b102ef23811d64 | [
"MIT"
] | null | null | null | (function() {
'use strict';
angular.module('MMI.downDrill')
.factory('downDrillService', downDrillService);
function downDrillService(ajaxRequest) {
var service = {};
service.newTree = function(elem) {
var tree = new MMIIndentedTree(elem, {
barHeight: 40,
actionCallback: function(action, tree, node) {
console.log('[Callback] Action "' + action + '" performed: ', 'Explorer=', tree, 'Node=', node);
},
});
return tree;
}
service.getDrawdata = function(explorer, graph, param1, param2, param3) {
if (graph == undefined || graph == "") {
var item = ajaxRequest.apiGet('drilldown/crud');
} else {
var item = ajaxRequest.apiGet('drilldown/' + graph + '?param1=' + param1 + '¶m2=' + param2 + '¶m3=' + param3);
}
item.then(function(data) {
service.drawDownDrill(explorer, data);
});
}
service.drawDownDrill = function(explorer, data) {
explorer.draw(data);
}
return service;
}
})(); | 30.15 | 134 | 0.506633 |
53c69780d24567fb0f178d705aee6ce12a733c4c | 3,000 | java | Java | AHSMobile_Android/app/src/main/java/com/hsappdev/ahs/settingsActivities/Notif_Settings_Activity.java | AHSAppDevTeam/Arcadia-High-Mobile | f02da8b373175f6533eb7132fd8e6bd2f9d837b1 | [
"MIT"
] | 3 | 2020-10-17T17:32:43.000Z | 2021-01-18T18:42:32.000Z | AHSMobile_Android/app/src/main/java/com/hsappdev/ahs/settingsActivities/Notif_Settings_Activity.java | richardwei6/AHS2020app | a8613adb4ad6bab07ae27bcb74640ba98107fdc5 | [
"MIT"
] | 24 | 2020-12-03T02:12:17.000Z | 2021-03-03T02:24:01.000Z | AHSMobile_Android/app/src/main/java/com/hsappdev/ahs/settingsActivities/Notif_Settings_Activity.java | richardwei6/AHS2020app | a8613adb4ad6bab07ae27bcb74640ba98107fdc5 | [
"MIT"
] | 2 | 2020-10-17T17:32:46.000Z | 2020-10-17T18:12:52.000Z | package com.hsappdev.ahs.settingsActivities;
import android.os.Bundle;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.ImageView;
import androidx.appcompat.widget.SwitchCompat;
import com.hsappdev.ahs.R;
import com.hsappdev.ahs.Settings;
import com.hsappdev.ahs.misc.FullScreenActivity;
public class Notif_Settings_Activity extends FullScreenActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.settings_notif_layout);
ImageView backButton = findViewById(R.id.notif_settings_back_btn);
backButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
final SwitchCompat
asb_switch = findViewById(R.id.notif_settings_asb_switch),
district_switch = findViewById(R.id.notif_settings_district_switch),
general_switch = findViewById(R.id.notif_settings_general_switch),
bulletin_switch = findViewById(R.id.notif_settings_bulletin_switch);
final Settings settings = new Settings(getApplicationContext());
asb_switch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
settings.updateNotifSettings(Settings.NotifOption.ASB, isChecked, true);
}
});
asb_switch
.setChecked(settings.getNotifSetting(Settings.NotifOption.ASB));
district_switch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
settings.updateNotifSettings(Settings.NotifOption.DISTRICT, isChecked, true);
}
});
district_switch
.setChecked(settings.getNotifSetting(Settings.NotifOption.DISTRICT));
general_switch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
settings.updateNotifSettings(Settings.NotifOption.GENERAL, isChecked, true);
}
});
general_switch
.setChecked(settings.getNotifSetting(Settings.NotifOption.GENERAL));
bulletin_switch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
settings.updateNotifSettings(Settings.NotifOption.BULLETIN, isChecked, true);
}
});
bulletin_switch
.setChecked(settings.getNotifSetting(Settings.NotifOption.BULLETIN));
}
}
| 40.540541 | 97 | 0.688 |
85cf8eb5081b7d4995154506be7660ac9bd94a18 | 2,643 | h | C | samples/include/dt-bindings/clock/jz4780-cgu.h | yehudahs/silver-leaves | c3945f36466455dd1c54594f45d15026587b701b | [
"MIT"
] | 44 | 2022-03-16T08:32:31.000Z | 2022-03-31T16:02:35.000Z | samples/include/dt-bindings/clock/jz4780-cgu.h | yehudahs/silver-leaves | c3945f36466455dd1c54594f45d15026587b701b | [
"MIT"
] | 13 | 2021-07-10T04:36:17.000Z | 2022-03-03T10:50:05.000Z | samples/include/dt-bindings/clock/jz4780-cgu.h | yehudahs/silver-leaves | c3945f36466455dd1c54594f45d15026587b701b | [
"MIT"
] | 18 | 2022-03-19T04:41:04.000Z | 2022-03-31T03:32:12.000Z | /* SPDX-License-Identifier: GPL-2.0 */
/*
* This header provides clock numbers for the ingenic,jz4780-cgu DT binding.
*
* They are roughly ordered as:
* - external clocks
* - PLLs
* - muxes/dividers in the order they appear in the jz4780 programmers manual
* - gates in order of their bit in the CLKGR* registers
*/
#ifndef __DT_BINDINGS_CLOCK_JZ4780_CGU_H__
#define __DT_BINDINGS_CLOCK_JZ4780_CGU_H__
#define JZ4780_CLK_EXCLK 0
#define JZ4780_CLK_RTCLK 1
#define JZ4780_CLK_APLL 2
#define JZ4780_CLK_MPLL 3
#define JZ4780_CLK_EPLL 4
#define JZ4780_CLK_VPLL 5
#define JZ4780_CLK_OTGPHY 6
#define JZ4780_CLK_SCLKA 7
#define JZ4780_CLK_CPUMUX 8
#define JZ4780_CLK_CPU 9
#define JZ4780_CLK_L2CACHE 10
#define JZ4780_CLK_AHB0 11
#define JZ4780_CLK_AHB2PMUX 12
#define JZ4780_CLK_AHB2 13
#define JZ4780_CLK_PCLK 14
#define JZ4780_CLK_DDR 15
#define JZ4780_CLK_VPU 16
#define JZ4780_CLK_I2SPLL 17
#define JZ4780_CLK_I2S 18
#define JZ4780_CLK_LCD0PIXCLK 19
#define JZ4780_CLK_LCD1PIXCLK 20
#define JZ4780_CLK_MSCMUX 21
#define JZ4780_CLK_MSC0 22
#define JZ4780_CLK_MSC1 23
#define JZ4780_CLK_MSC2 24
#define JZ4780_CLK_UHC 25
#define JZ4780_CLK_SSIPLL 26
#define JZ4780_CLK_SSI 27
#define JZ4780_CLK_CIMMCLK 28
#define JZ4780_CLK_PCMPLL 29
#define JZ4780_CLK_PCM 30
#define JZ4780_CLK_GPU 31
#define JZ4780_CLK_HDMI 32
#define JZ4780_CLK_BCH 33
#define JZ4780_CLK_NEMC 34
#define JZ4780_CLK_OTG0 35
#define JZ4780_CLK_SSI0 36
#define JZ4780_CLK_SMB0 37
#define JZ4780_CLK_SMB1 38
#define JZ4780_CLK_SCC 39
#define JZ4780_CLK_AIC 40
#define JZ4780_CLK_TSSI0 41
#define JZ4780_CLK_OWI 42
#define JZ4780_CLK_KBC 43
#define JZ4780_CLK_SADC 44
#define JZ4780_CLK_UART0 45
#define JZ4780_CLK_UART1 46
#define JZ4780_CLK_UART2 47
#define JZ4780_CLK_UART3 48
#define JZ4780_CLK_SSI1 49
#define JZ4780_CLK_SSI2 50
#define JZ4780_CLK_PDMA 51
#define JZ4780_CLK_GPS 52
#define JZ4780_CLK_MAC 53
#define JZ4780_CLK_SMB2 54
#define JZ4780_CLK_CIM 55
#define JZ4780_CLK_LCD 56
#define JZ4780_CLK_TVE 57
#define JZ4780_CLK_IPU 58
#define JZ4780_CLK_DDR0 59
#define JZ4780_CLK_DDR1 60
#define JZ4780_CLK_SMB3 61
#define JZ4780_CLK_TSSI1 62
#define JZ4780_CLK_COMPRESS 63
#define JZ4780_CLK_AIC1 64
#define JZ4780_CLK_GPVLC 65
#define JZ4780_CLK_OTG1 66
#define JZ4780_CLK_UART4 67
#define JZ4780_CLK_AHBMON 68
#define JZ4780_CLK_SMB4 69
#define JZ4780_CLK_DES 70
#define JZ4780_CLK_X2D 71
#define JZ4780_CLK_CORE1 72
#define JZ4780_CLK_EXCLK_DIV512 73
#define JZ4780_CLK_RTC 74
#endif /* __DT_BINDINGS_CLOCK_JZ4780_CGU_H__ */
| 28.728261 | 79 | 0.795308 |
9671f58b3aa71574f6358110fccb5913cf29d87a | 381 | php | PHP | app/Exceptions/MyException.php | Mhakimamransyah/kurir | d734c9d59c7848580e4fdcc9a6b166552d15023c | [
"MIT"
] | 1 | 2021-09-02T06:41:35.000Z | 2021-09-02T06:41:35.000Z | app/Exceptions/MyException.php | Mhakimamransyah/kurir | d734c9d59c7848580e4fdcc9a6b166552d15023c | [
"MIT"
] | null | null | null | app/Exceptions/MyException.php | Mhakimamransyah/kurir | d734c9d59c7848580e4fdcc9a6b166552d15023c | [
"MIT"
] | null | null | null | <?php
namespace App\Exceptions;
use App\Http\Helper\ResponseBuilder;
use Exception;
use Illuminate\Http\Response;
class MyException extends Exception
{
private $param;
public function __construct($param)
{
$this->param = $param;
}
public function render()
{
return ResponseBuilder::result(false,$this->param['message'],[],400);
}
} | 16.565217 | 77 | 0.661417 |
0a0675218c8f15e332915dd97b840f5076668155 | 637 | ts | TypeScript | src/reports/reports.service.ts | Saxxone/nest-tutorial | c4037c9aca0b551db8066741b97523bb6b05b62e | [
"MIT"
] | null | null | null | src/reports/reports.service.ts | Saxxone/nest-tutorial | c4037c9aca0b551db8066741b97523bb6b05b62e | [
"MIT"
] | null | null | null | src/reports/reports.service.ts | Saxxone/nest-tutorial | c4037c9aca0b551db8066741b97523bb6b05b62e | [
"MIT"
] | null | null | null | import { Injectable } from '@nestjs/common';
import { CreateReportDto } from './dto/create-report.dto';
import { UpdateReportDto } from './dto/update-report.dto';
@Injectable()
export class ReportsService {
create(createReportDto: CreateReportDto) {
return 'This action adds a new report';
}
findAll() {
return `This action returns all reports`;
}
findOne(id: number) {
return `This action returns a #${id} report`;
}
update(id: number, updateReportDto: UpdateReportDto) {
return `This action updates a #${id} report`;
}
remove(id: number) {
return `This action removes a #${id} report`;
}
}
| 23.592593 | 58 | 0.6719 |
8eec277f6abb79ea50f7088aad48ef5754bc26d1 | 9,007 | sql | SQL | populateDB/testing/addTestData.sql | cityofaustin/ctxfloods-backend | fefb30800d849f8e66ec498df84d576453bdfef9 | [
"MIT"
] | 1 | 2019-01-20T10:03:20.000Z | 2019-01-20T10:03:20.000Z | populateDB/testing/addTestData.sql | cityofaustin/ctxfloods-backend | fefb30800d849f8e66ec498df84d576453bdfef9 | [
"MIT"
] | 20 | 2017-07-13T18:17:40.000Z | 2022-02-12T13:20:08.000Z | populateDB/testing/addTestData.sql | cityofaustin/ctxfloods-backend | fefb30800d849f8e66ec498df84d576453bdfef9 | [
"MIT"
] | 3 | 2018-06-30T17:43:51.000Z | 2019-05-27T19:07:14.000Z | begin;
-- Add communities
insert into floods.community (id, name, abbreviation, viewportgeojson) values
(1, 'All of Texas.', 'AOT', ST_AsGeoJSON(ST_MakeEnvelope(-106.422319, 26.829358, -94.490523, 36.956948))),
(2, 'Right near Zilker.', 'RNZ', ST_AsGeoJSON(ST_MakeEnvelope(-97.785240, 30.259219, -97.753574, 30.276096)));
alter sequence floods.community_id_seq restart with 3;
-- Set the jwt claim settings so the register user function works
-- Make sure they're local so we actually use the token outside of this script
select set_config('jwt.claims.community_id', '1', true);
select set_config('jwt.claims.role', 'floods_super_admin', true);
-- Add users
alter sequence floods.user_id_seq restart with 1;
select floods.register_user(text 'Super', text 'Admin', text 'Superhero, Administrator', integer '1', text '867-5309', text 'superadmin@flo.ods', text 'texasfloods', text 'floods_super_admin');
alter sequence floods.user_id_seq restart with 2;
select floods.register_user(text 'Community', text 'Admin', text 'Community Administrator', integer '1', text '867-5309', text 'admin@community.floods', text 'texasfloods', text 'floods_community_admin');
alter sequence floods.user_id_seq restart with 3;
select floods.register_user(text 'Community', text 'Editor', text 'Community Editor', integer '1', text '867-5309', text 'editor@community.floods', text 'texasfloods', text 'floods_community_editor');
alter sequence floods.user_id_seq restart with 4;
select floods.register_user(text 'Other Community', text 'Admin', text 'Community Administrator', integer '2', text '867-5309', text 'admin@othercommunity.floods', text 'texasfloods', text 'floods_community_admin');
alter sequence floods.user_id_seq restart with 5;
select floods.register_user(text 'Community', text 'Editor Too', text 'Community Editor Too', integer '1', text '867-5309', text 'editortoo@community.floods', text 'texasfloods', text 'floods_community_editor');
alter sequence floods.user_id_seq restart with 6;
select floods.register_user(text 'Inactive', text 'User', text 'Retired', integer '1', text '867-5309', text 'inactive@flo.ods', text 'texasfloods', text 'floods_community_editor');
alter sequence floods.user_id_seq restart with 7;
select floods.register_user(text 'Floods', text 'Graphql', text 'API', integer '1', text '000-0000', text 'graphql@flo.ods', text 'floods_graphql', text 'floods_super_admin', boolean 'true');
-- Add crossings
insert into floods.crossing (id, name, human_address, description, coordinates, geojson, community_ids) values
(1, 'Spurlock Valley', '605 Spurlock Valley · West Lake Hills, TX 78746', 'E of Intersection w/ Clifford', ST_MakePoint(-97.768, 30.267), ST_AsGeoJSON(ST_MakePoint(-97.768, 30.267)), '{1}'),
(2, 'school', 'at the school', 'Crossing at the school', ST_MakePoint(-97.668, 30.367), ST_AsGeoJSON(ST_MakePoint(-97.668, 30.367)), '{1}'),
(3, 'library', 'at the library', 'Crossing at the library', ST_MakePoint(-97.568, 30.467), ST_AsGeoJSON(ST_MakePoint(-97.568, 30.467)), '{1}'),
(4, 'capitol', 'at the capitol', 'Crossing at the capitol', ST_MakePoint(-97.468, 30.567), ST_AsGeoJSON(ST_MakePoint(-97.468, 30.567)), '{1}'),
(5, 'city hall', 'at city hall', 'Crossing at city hall', ST_MakePoint(-97.368, 30.667), ST_AsGeoJSON(ST_MakePoint(-97.368, 30.667)), '{1}'),
(6, 'coffee shop', 'at the coffee shop', 'Crossing at the coffee shop', ST_MakePoint(-97.268, 30.767), ST_AsGeoJSON(ST_MakePoint(-97.268, 30.767)), '{1}'),
(7, 'other community', 'in the other community', 'Crossing in the other community', ST_MakePoint(-97.168, 30.867), ST_AsGeoJSON(ST_MakePoint(-97.168, 30.867)), '{1,2}'),
(8, 'other community 2', 'another in the other community', 'Another crossing in the other community', ST_MakePoint(-97.068, 30.967), ST_AsGeoJSON(ST_MakePoint(-97.068, 30.967)), '{2}');
alter sequence floods.crossing_id_seq restart with 9;
-- Update community viewports based on crossings
update floods.community
set viewportgeojson = (select ST_AsGeoJSON(ST_Envelope(ST_Extent(c.coordinates))) from floods.crossing c where array_position(c.community_ids, 1) >= 0)
where id = 1;
update floods.community
set viewportgeojson = (select ST_AsGeoJSON(ST_Envelope(ST_Extent(c.coordinates))) from floods.crossing c where array_position(c.community_ids, 2) >= 0)
where id = 2;
-- Add statuses
insert into floods.status (id, name) values
(1, 'Open'),
(2, 'Closed'),
(3, 'Caution'),
(4, 'Long-Term Closure');
alter sequence floods.status_id_seq restart with 5;
-- Add status reasons
insert into floods.status_reason (id, status_id, name) values
(1, 2, 'Flooded'),
(2, 4, 'Bridge Broken'),
(3, 3, 'Unconfirmed Flooding');
alter sequence floods.status_reason_id_seq restart with 4;
-- Add status associations
insert into floods.status_association (id, status_id, detail, rule) values
(1, 1, 'reason', 'disabled'),
(2, 1, 'duration', 'disabled'),
(3, 2, 'reason', 'required'),
(4, 2, 'duration', 'disabled'),
(5, 3, 'reason', 'required'),
(6, 3, 'duration', 'disabled'),
(7, 4, 'reason', 'required'),
(8, 4, 'duration', 'required');
alter sequence floods.status_association_id_seq restart with 9;
-- Add status updates
insert into floods.status_update (id, status_id, creator_id, crossing_id, notes, status_reason_id, created_at) values
(1, 1, 1, 1, 'notes', null, '2017-05-03T09:27:57Z'),
(2, 2, 1, 1, 'notes', 1, '2017-05-04T09:27:57Z'),
(3, 1, 1, 2, 'notes', null, '2017-05-06T09:27:57Z'),
(4, 1, 1, 3, 'notes', null, '2017-05-08T09:27:57Z'),
(5, 1, 1, 5, 'notes', null, '2017-05-11T09:27:57Z'),
(6, 2, 1, 2, 'notes', 1, '2017-05-09T09:27:57Z'),
(7, 1, 1, 1, 'notes', null, '2017-05-09T09:27:57Z'),
(8, 2, 1, 3, 'notes', 1, '2017-05-12T09:27:57Z'),
(9, 1, 1, 4, 'notes', null, '2017-05-14T09:27:57Z'),
(10, 2, 1, 1, 'notes', 1, '2017-05-12T09:27:57Z'),
(11, 2, 1, 5, 'notes', 1, '2017-05-17T09:27:57Z'),
(12, 1, 1, 6, 'notes', null, '2017-05-19T09:27:57Z'),
(13, 1, 1, 5, 'notes', null, '2017-05-19T09:27:57Z'),
(14, 1, 1, 5, 'notes', null, '2017-05-20T09:27:57Z'),
(15, 1, 1, 4, 'notes', null, '2017-05-20T09:27:57Z'),
(16, 1, 1, 3, 'notes', null, '2017-05-20T09:27:57Z'),
(17, 1, 1, 1, 'notes', null, '2017-05-19T09:27:57Z'),
(18, 1, 1, 4, 'notes', null, '2017-05-23T09:27:57Z'),
(19, 2, 1, 5, 'notes', 1, '2017-05-25T09:27:57Z'),
(20, 2, 1, 3, 'notes', 1, '2017-05-24T09:27:57Z'),
(21, 1, 1, 2, 'notes', null, '2017-05-24T09:27:57Z'),
(22, 1, 1, 5, 'notes', null, '2017-05-28T09:27:57Z'),
(23, 2, 1, 1, 'notes', 1, '2017-05-25T09:27:57Z'),
(24, 2, 1, 6, 'notes', 1, '2017-05-31T09:27:57Z'),
(25, 1, 1, 1, 'notes', null, '2017-05-27T09:27:57Z'),
(26, 2, 1, 1, 'notes', 1, '2017-05-28T09:27:57Z'),
(27, 2, 1, 2, 'notes', 1, '2017-05-30T09:27:57Z'),
(28, 1, 1, 3, 'notes', null, '2017-06-01T09:27:57Z'),
(29, 2, 1, 5, 'notes', 1, '2017-06-04T09:27:57Z'),
(30, 1, 1, 2, 'notes', null, '2017-06-02T09:27:57Z'),
(31, 1, 4, 7, 'notes', null, '2017-06-02T09:27:57Z'),
(32, 1, 4, 8, 'notes', null, '2017-06-02T09:27:57Z');
alter sequence floods.status_update_id_seq restart with 33;
-- Add latest status updates
update floods.crossing set latest_status_update_id = 26 where id = 1;
update floods.crossing set latest_status_update_id = 30 where id = 2;
update floods.crossing set latest_status_update_id = 28 where id = 3;
update floods.crossing set latest_status_update_id = 18 where id = 4;
update floods.crossing set latest_status_update_id = 29 where id = 5;
update floods.crossing set latest_status_update_id = 24 where id = 6;
update floods.crossing set latest_status_update_id = 31 where id = 7;
update floods.crossing set latest_status_update_id = 32 where id = 8;
-- Add latest statuses
update floods.crossing set latest_status_id = 2 where id = 1;
update floods.crossing set latest_status_id = 1 where id = 2;
update floods.crossing set latest_status_id = 1 where id = 3;
update floods.crossing set latest_status_id = 1 where id = 4;
update floods.crossing set latest_status_id = 2 where id = 5;
update floods.crossing set latest_status_id = 2 where id = 6;
update floods.crossing set latest_status_id = 1 where id = 7;
update floods.crossing set latest_status_id = 1 where id = 8;
-- Add latest status times
update floods.crossing set latest_status_created_at = '2017-05-28T09:27:57Z' where id = 1;
update floods.crossing set latest_status_created_at = '2017-06-02T09:27:57Z' where id = 2;
update floods.crossing set latest_status_created_at = '2017-06-01T09:27:57Z' where id = 3;
update floods.crossing set latest_status_created_at = '2017-05-23T09:27:57Z' where id = 4;
update floods.crossing set latest_status_created_at = '2017-06-04T09:27:57Z' where id = 5;
update floods.crossing set latest_status_created_at = '2017-05-31T09:27:57Z' where id = 6;
update floods.crossing set latest_status_created_at = '2017-06-02T09:27:57Z' where id = 7;
update floods.crossing set latest_status_created_at = '2017-06-02T09:27:57Z' where id = 8;
commit;
| 62.986014 | 215 | 0.701565 |
264bf2fafd447fc75be87964fef6ff4efc7f3af2 | 865 | java | Java | Id.java | nabil0day/JAVA-Console-Based-Online-Courier-Management-System | 84c2d398472c92931fd2215bfe6def06c8fe0bba | [
"MIT"
] | 4 | 2021-09-03T03:42:24.000Z | 2021-10-07T07:50:15.000Z | Id.java | nabil-3mp1r3/Consol-Online-Courier-System- | 84c2d398472c92931fd2215bfe6def06c8fe0bba | [
"MIT"
] | null | null | null | Id.java | nabil-3mp1r3/Consol-Online-Courier-System- | 84c2d398472c92931fd2215bfe6def06c8fe0bba | [
"MIT"
] | 1 | 2021-12-06T20:16:22.000Z | 2021-12-06T20:16:22.000Z | public abstract class Id extends User{
private String mail;
private String password;
private int age;
public Id()
{
super("Unknown", "Unknown", "Unknown");
this.mail = "Unknown";
this.password = "Unknown";
}
public Id(String name, String address, String mobile, int age, String mail, String password)
{
super(name, address, mobile);
this.age = age;
this.mail = mail;
this.password = password;
}
public void setAge(int age)
{
this.age=age;
}
public int getAge()
{
return age;
}
public void setMail(String mail)
{
this.mail=mail;
}
public String getMail()
{
return mail;
}
public void setPassword(String password)
{
this.password=password;
}
public String getPassword()
{
return password;
}
public void showInfo()
{
super.showInfo();
}
} | 15.175439 | 94 | 0.618497 |
9f182907b96b63c6f1368d56184ea6f13382e8a3 | 7,854 | sql | SQL | src/main/resources/db/ddl.sql | x43125/self-blog | 5dcdf7ab68eeb6872c74d15f33c13a0aa76900b2 | [
"Apache-2.0"
] | 2 | 2021-08-03T08:50:50.000Z | 2021-12-05T14:39:17.000Z | src/main/resources/db/ddl.sql | x43125/self-blog | 5dcdf7ab68eeb6872c74d15f33c13a0aa76900b2 | [
"Apache-2.0"
] | null | null | null | src/main/resources/db/ddl.sql | x43125/self-blog | 5dcdf7ab68eeb6872c74d15f33c13a0aa76900b2 | [
"Apache-2.0"
] | null | null | null | create database if not exists selfblog;
use selfblog;
# 设置数据库不支持外键
SET FOREIGN_KEY_CHECKS=0;
drop table if exists blog;
drop table if exists blog_tag;
drop table if exists blog_tag_info;
drop table if exists role_permission;
drop table if exists role_permission_info;
drop table if exists user_info;
drop table if exists user_role;
drop table if exists user_role_info;
/*==============================================================*/
/* Table: blog */
/*==============================================================*/
create table blog
(
id bigint not null auto_increment,
name varchar(64) not null,
url varchar(255) not null,
content varchar(0) not null,
read_amount bigint not null default 0,
like_amount bigint not null default 0,
comment_amount bigint not null default 0,
create_time timestamp not null default CURRENT_TIMESTAMP,
update_time timestamp not null default CURRENT_TIMESTAMP,
upload_time timestamp not null default CURRENT_TIMESTAMP,
primary key (id)
);
alter table blog comment '博客信息表';
/*==============================================================*/
/* Table: blog_tag */
/*==============================================================*/
create table blog_tag
(
id bigint not null auto_increment,
blog_id bigint not null,
tag_id bigint not null,
create_time timestamp not null default CURRENT_TIMESTAMP,
update_time timestamp not null default CURRENT_TIMESTAMP,
primary key (id, blog_id, tag_id)
);
alter table blog_tag comment '博客标签关联表(一篇博客可以有多个标签)';
/*==============================================================*/
/* Table: blog_tag_info */
/*==============================================================*/
create table blog_tag_info
(
id bigint not null auto_increment,
name varchar(20) not null,
description varchar(64) not null,
create_time timestamp not null default CURRENT_TIMESTAMP,
update_time timestamp not null default CURRENT_TIMESTAMP,
primary key (id)
);
alter table blog_tag_info comment '博客标签表';
/*==============================================================*/
/* Table: role_permission */
/*==============================================================*/
create table role_permission
(
id bigint not null auto_increment,
role_id bigint not null,
perm_id bigint not null,
create_time timestamp not null default CURRENT_TIMESTAMP,
update_time timestamp not null default CURRENT_TIMESTAMP,
primary key (id, role_id, perm_id)
);
alter table role_permission comment '角色权限关联表
一个角色可能有多个权限';
/*==============================================================*/
/* Table: role_permission_info */
/*==============================================================*/
create table role_permission_info
(
id bigint not null auto_increment,
name varchar(20) not null,
url varchar(255) not null,
create_time timestamp not null default CURRENT_TIMESTAMP,
update_time timestamp not null default CURRENT_TIMESTAMP,
primary key (id)
);
alter table role_permission_info comment '角色权限表';
/*==============================================================*/
/* Table: user_info */
/*==============================================================*/
create table user_info
(
id bigint not null auto_increment,
user_name varchar(20) not null,
passwd varchar(64) not null,
salt varchar(255) not null,
phone varbinary(20),
email varchar(64),
create_time timestamp not null default CURRENT_TIMESTAMP,
update_time timestamp not null default CURRENT_TIMESTAMP,
primary key (id)
);
alter table user_info comment '用户表';
/*==============================================================*/
/* Table: user_role */
/*==============================================================*/
create table user_role
(
id bigint not null auto_increment,
user_id bigint not null,
role_id bigint not null,
create_time timestamp not null default CURRENT_TIMESTAMP,
update_time timestamp not null default CURRENT_TIMESTAMP,
primary key (id, user_id, role_id)
);
alter table user_role comment '用户角色关联表
一个用户可能有多个角色';
/*==============================================================*/
/* Table: user_role_info */
/*==============================================================*/
create table user_role_info
(
id bigint not null auto_increment,
name varchar(20) not null,
create_time timestamp not null default CURRENT_TIMESTAMP,
update_time timestamp not null default CURRENT_TIMESTAMP,
primary key (id)
);
alter table user_role_info comment '用户角色表';
# alter table blog_tag add constraint FK_Reference_6 foreign key (tag_id)
# references blog_tag_info (id) on delete restrict on update restrict;
#
# alter table blog_tag add constraint FK_Reference_7 foreign key (blog_id)
# references blog (id) on delete restrict on update restrict;
#
# alter table role_permission add constraint FK_Reference_10 foreign key (role_id)
# references user_role_info (id) on delete restrict on update restrict;
#
# alter table role_permission add constraint FK_Reference_4 foreign key (perm_id)
# references role_permission_info (id) on delete restrict on update restrict;
#
# alter table user_role add constraint FK_Reference_8 foreign key (user_id)
# references user_info (id) on delete restrict on update restrict;
#
# alter table user_role add constraint FK_Reference_9 foreign key (role_id)
# references user_role_info (id) on delete restrict on update restrict;
drop table if exists short_hand;
/*==============================================================*/
/* Table: short_hand */
/*==============================================================*/
create table short_hand
(
id bigint not null auto_increment,
short_hand_name varchar(20) not null,
create_time timestamp not null default CURRENT_TIMESTAMP,
update_time timestamp not null default CURRENT_TIMESTAMP,
primary key (id),
key AK_unique_short_hand_name (short_hand_name)
);
alter table short_hand comment 'record some in commonly use work';
drop table if exists short_hand_record;
/*==============================================================*/
/* Table: short_hand_record */
/*==============================================================*/
create table short_hand_record
(
id bigint not null auto_increment,
short_hand_id bigint not null,
short_hand_name varchar(20) not null,
create_time timestamp not null default CURRENT_TIMESTAMP,
update_time timestamp not null default CURRENT_TIMESTAMP,
primary key (id, short_hand_id)
);
# alter table short_hand_record add constraint FK_Reference_11 foreign key (short_hand_id)
# references short_hand (id) on delete restrict on update restrict;
| 37.942029 | 90 | 0.525974 |
62409bb19cd62fa1ced22a9a84a115291ed3af8f | 982 | swift | Swift | TweetSample/Tweet.swift | Frankacy/TweetSample | f93bfa8b0f222a2e0c3efad515c3a27c911f0935 | [
"MIT"
] | 2 | 2017-04-25T16:46:09.000Z | 2017-09-14T17:04:54.000Z | TweetSample/Tweet.swift | Frankacy/TweetSample | f93bfa8b0f222a2e0c3efad515c3a27c911f0935 | [
"MIT"
] | null | null | null | TweetSample/Tweet.swift | Frankacy/TweetSample | f93bfa8b0f222a2e0c3efad515c3a27c911f0935 | [
"MIT"
] | null | null | null | //
// Tweet.swift
// TweetSample
//
// Created by Francois Courville on 2017-01-12.
// Copyright © 2017 Francois Courville. All rights reserved.
//
import Foundation
import UIKit
protocol TweetDisplayable {
func header() -> String
func content() -> String
func tweetImage() -> UIImage?
}
struct Tweet : TweetDisplayable {
let name: String
let handle: String
let text: String
init?(json: [String: Any?]) {
guard let user = json["user"] as? [String: Any?],
let name = user["name"] as? String,
let handle = user["screen_name"] as? String,
let text = json["text"] as? String else {
return nil
}
self.name = name
self.handle = handle
self.text = text
}
func header() -> String {
return "\(name) - \(handle)"
}
func content() -> String {
return text
}
func tweetImage() -> UIImage? {
return nil
}
}
| 20.040816 | 61 | 0.55499 |
e78c817b82e98a0f3ddbc33137d9aa4c868cdfc6 | 3,094 | js | JavaScript | src/routes/baseConversion.js | ptarmiganlabs/butler | 7d529cc057881d015c660a34174dbf8b1428ee0c | [
"MIT"
] | 30 | 2018-02-09T23:41:56.000Z | 2022-03-16T21:34:13.000Z | src/routes/baseConversion.js | ptarmiganlabs/butler | 7d529cc057881d015c660a34174dbf8b1428ee0c | [
"MIT"
] | 172 | 2018-07-10T14:13:28.000Z | 2022-03-29T16:21:18.000Z | src/routes/baseConversion.js | mountaindude/butler | c0aca2ecfc65b035ca4dd031a33e729b40c608b8 | [
"MIT"
] | 5 | 2016-09-21T14:02:35.000Z | 2017-09-14T11:58:52.000Z | /* eslint-disable camelcase */
const httpErrors = require('http-errors');
const anyBase = require('any-base');
// Load global variables and functions
const globals = require('../globals');
const { logRESTCall } = require('../lib/logRESTCall');
const { apiGetBase16ToBase62, apiGetBase62ToBase16 } = require('../api/baseConversion');
const base62_to_Hex = anyBase('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', '0123456789abcdef');
const hex_to_base62 = anyBase('0123456789abcdef', '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');
async function handlerGetBase62ToBase16(request, reply) {
try {
logRESTCall(request);
if (request.query.base62 === undefined) {
// Required parameter is missing
reply.send(httpErrors(400, 'Required parameter missing'));
} else {
const base16 = base62_to_Hex(request.query.base62);
return { base62: request.query.base62, base16 };
}
return {
response: 'Butler reporting for duty',
butlerVersion: globals.appVersion,
};
} catch (err) {
globals.logger.error(
`BASECONVERT: Failed converting from base62 to base16: ${request.query.base62}, error is: ${JSON.stringify(
err,
null,
2
)}`
);
reply.send(httpErrors(500, 'Failed converting from base62 to base16'));
return null;
}
}
async function handlerGetBase16ToBase62(request, reply) {
try {
logRESTCall(request);
if (request.query.base16 === undefined) {
// Required parameter is missing
reply.send(httpErrors(400, 'Required parameter missing'));
} else {
const base62 = hex_to_base62(request.query.base16);
return { base16: request.query.base16, base62 };
}
return null;
} catch (err) {
globals.logger.error(
`BASECONVERT: Failed converting from base16 to base62: ${request.query.base16}, error is: ${JSON.stringify(
err,
null,
2
)}`
);
reply.send(httpErrors(500, 'Failed converting from base16 to base62'));
return null;
}
}
// eslint-disable-next-line no-unused-vars
module.exports = async (fastify, options) => {
if (
globals.config.has('Butler.restServerEndpointsEnable.base62ToBase16') &&
globals.config.get('Butler.restServerEndpointsEnable.base62ToBase16')
) {
globals.logger.debug('Registering REST endpoint GET /v4/base62tobase16');
fastify.get('/v4/base62tobase16', apiGetBase62ToBase16, handlerGetBase62ToBase16);
}
if (
globals.config.has('Butler.restServerEndpointsEnable.base16ToBase62') &&
globals.config.get('Butler.restServerEndpointsEnable.base16ToBase62')
) {
globals.logger.debug('Registering REST endpoint GET /v4/base16tobase62');
fastify.get('/v4/base16tobase62', apiGetBase16ToBase62, handlerGetBase16ToBase62);
}
};
| 35.563218 | 119 | 0.636716 |
d2951c53210512d63a37bda28a1a3127f6d795a2 | 438 | php | PHP | src/AdminPlugin/Card/Item/CardItemText.php | phpbe/be | 626ba35a4565a082c228691c06a4ab0825f0a0f3 | [
"MIT"
] | 1 | 2021-12-10T08:48:42.000Z | 2021-12-10T08:48:42.000Z | src/AdminPlugin/Card/Item/CardItemText.php | phpbe/be | 626ba35a4565a082c228691c06a4ab0825f0a0f3 | [
"MIT"
] | null | null | null | src/AdminPlugin/Card/Item/CardItemText.php | phpbe/be | 626ba35a4565a082c228691c06a4ab0825f0a0f3 | [
"MIT"
] | null | null | null | <?php
namespace Be\AdminPlugin\Card\Item;
/**
* 字段 文本
*/
class CardItemText extends CardItem
{
/**
* 获取html内容
*
* @return string
*/
public function getHtml()
{
$html = '<div class="card-item">';
if ($this->label) {
$html .= '<b>' . $this->label . '</b>:';
}
$html .= '{{item.'.$this->name.'}}';
$html .= '</div>';
return $html;
}
}
| 13.6875 | 52 | 0.431507 |
07eb47c2a5bf742c6790a62cb35d321506e7290f | 408 | swift | Swift | ZHCodable/Classes/Logger.swift | haoburongyi/ZHCodable | 392304b680cc83cfc4a1c3e572d4b9cb2c91c7c6 | [
"MIT"
] | 6 | 2021-11-23T02:42:39.000Z | 2022-02-14T04:30:34.000Z | ZHCodable/Classes/Logger.swift | haoburongyi/ZHCodable | 392304b680cc83cfc4a1c3e572d4b9cb2c91c7c6 | [
"MIT"
] | null | null | null | ZHCodable/Classes/Logger.swift | haoburongyi/ZHCodable | 392304b680cc83cfc4a1c3e572d4b9cb2c91c7c6 | [
"MIT"
] | null | null | null | //
// Logger.swift
// ZHCodable
//
// Created by 张淏 on 2022/2/10.
//
import Foundation
struct InternalLogger {
static func logDebug(_ items: Any..., separator: String = " ", terminator: String = "\n") {
#if DEBUG
print(items, separator: separator, terminator: terminator)
#endif
}
}
// print("\((file as NSString).lastPathComponent)[\(line)], \(method):\n \(message)")
| 19.428571 | 95 | 0.610294 |
ce09fbd5e344987db9ffdb7028feb109901a4fce | 709 | h | C | libtensor/ctf_block_tensor/impl/ctf_btod_set_impl.h | pjknowles/libtensor | f18e0e33c6c4512e4ea1dde31ed8d74fe536ed24 | [
"BSL-1.0"
] | 33 | 2016-02-08T06:05:17.000Z | 2021-11-17T01:23:11.000Z | libtensor/ctf_block_tensor/impl/ctf_btod_set_impl.h | pjknowles/libtensor | f18e0e33c6c4512e4ea1dde31ed8d74fe536ed24 | [
"BSL-1.0"
] | 5 | 2016-06-14T15:54:11.000Z | 2020-12-07T08:27:20.000Z | libtensor/ctf_block_tensor/impl/ctf_btod_set_impl.h | pjknowles/libtensor | f18e0e33c6c4512e4ea1dde31ed8d74fe536ed24 | [
"BSL-1.0"
] | 12 | 2016-05-19T18:09:38.000Z | 2021-02-24T17:35:21.000Z | #ifndef LIBTENSOR_CTF_BTOD_SET_IMPL_H
#define LIBTENSOR_CTF_BTOD_SET_IMPL_H
#include <libtensor/ctf_dense_tensor/ctf_tod_set.h>
#include "ctf_btod_set_symmetry.h"
#include "../ctf_btod_set.h"
namespace libtensor {
template<size_t N>
const char ctf_btod_set<N>::k_clazz[] = "ctf_btod_set<N>";
template<size_t N>
void ctf_btod_set<N>::perform(ctf_block_tensor_i<N, double> &bta) {
typedef ctf_block_tensor_i_traits<double> bti_traits;
m_gbto.perform(bta);
std::vector<size_t> blst;
gen_block_tensor_ctrl<N, bti_traits> ctrl(bta);
ctrl.req_nonzero_blocks(blst);
ctf_btod_set_symmetry<N>().perform(blst, bta);
}
} // namespace libtensor
#endif // LIBTENSOR_CTF_BTOD_SET_IMPL_H
| 22.15625 | 67 | 0.763047 |
268f281f300e68e752ed95aed90e6423304ffc43 | 3,047 | lua | Lua | units.plugins.lua | PleXone2019/ProDBG | c7042f32da9e54662c3c575725c4cd24a878a2de | [
"MIT"
] | null | null | null | units.plugins.lua | PleXone2019/ProDBG | c7042f32da9e54662c3c575725c4cd24a878a2de | [
"MIT"
] | null | null | null | units.plugins.lua | PleXone2019/ProDBG | c7042f32da9e54662c3c575725c4cd24a878a2de | [
"MIT"
] | null | null | null | require "tundra.syntax.glob"
require "tundra.path"
require "tundra.util"
require "tundra.syntax.rust-cargo"
local native = require('tundra.native')
-----------------------------------------------------------------------------------------------------------------------
local function get_rs_src(dir)
return Glob {
Dir = dir,
Extensions = { ".rs" },
Recursive = true,
}
end
-----------------------------------------------------------------------------------------------------------------------
SharedLibrary {
Name = "lldb_plugin",
Env = {
CPPPATH = {
"api/include",
"src/plugins/lldb",
},
CXXOPTS = { {
"-std=c++11",
"-Wno-padded",
"-Wno-documentation",
"-Wno-unused-parameter",
"-Wno-missing-prototypes",
"-Wno-unused-member-function",
"-Wno-switch",
"-Wno-switch-enum",
"-Wno-c++98-compat-pedantic",
"-Wno-missing-field-initializers"; Config = { "macosx-clang-*", "linux-*"} },
},
SHLIBOPTS = {
{ "-Fsrc/plugins/lldb/Frameworks", "-rpath src/plugins/lldb/Frameworks", "-lstdc++"; Config = "macosx-clang-*" },
},
CXXCOM = { "-stdlib=libc++"; Config = "macosx-clang-*" },
},
Sources = {
Glob {
Dir = "src/plugins/lldb",
Extensions = { ".c", ".cpp", ".m" },
},
},
Frameworks = { "LLDB" },
IdeGenerationHints = { Msvc = { SolutionFolder = "Plugins" } },
}
-----------------------------------------------------------------------------------------------------------------------
RustCrate {
Name = "prodbg_api",
CargoConfig = "api/rust/prodbg/Cargo.toml",
Sources = {
get_rs_src("api/rust/prodbg"),
},
}
-----------------------------------------------------------------------------------------------------------------------
RustSharedLibrary {
Name = "amiga_uae_plugin",
CargoConfig = "src/addons/amiga_uae_plugin/Cargo.toml",
Sources = {
get_rs_src("src/addons/amiga_uae_plugin"),
get_rs_src("src/crates/amiga_hunk_parser"),
get_rs_src("src/crates/gdb-remote"),
get_rs_src("api/rust/prodbg"),
}
}
-----------------------------------------------------------------------------------------------------------------------
SharedLibrary {
Name = "dummy_backend_plugin",
Env = {
CPPPATH = {
"api/include",
"src/native/external",
},
CXXOPTS = { { "-fPIC"; Config = "linux-gcc"; }, },
},
Sources = {
"src/plugins/dummy_backend/dummy_backend.c",
},
IdeGenerationHints = { Msvc = { SolutionFolder = "Plugins" } },
}
-----------------------------------------------------------------------------------------------------------------------
if native.host_platform == "macosx" then
Default "lldb_plugin"
end
--if native.host_platform == "windows" then
-- Default "dbgeng_plugin"
--end
Default "amiga_uae_plugin"
Default "dummy_backend_plugin"
-- vim: ts=4:sw=4:sts=4
| 25.181818 | 125 | 0.429275 |
1a72cb3a409f2d03b7e1035a69e5c3a0ee1f76ec | 685 | sql | SQL | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/aoco_alter/aoco_alter_sql_test/sql/multisegfile_toast_dropcol_nonnull.sql | lintzc/GPDB | b48c8b97da18f495c10065d0853db87960aebae2 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/aoco_alter/aoco_alter_sql_test/sql/multisegfile_toast_dropcol_nonnull.sql | lintzc/GPDB | b48c8b97da18f495c10065d0853db87960aebae2 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/aoco_alter/aoco_alter_sql_test/sql/multisegfile_toast_dropcol_nonnull.sql | lintzc/GPDB | b48c8b97da18f495c10065d0853db87960aebae2 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | --
-- @created 2014-05-19 12:00:00
-- @modified 2014-05-19 12:00:00
-- @tags storage
-- @description AOCO multi_segfile table : drop column with default value non NULL
alter table multi_segfile_toast ADD COLUMN added_col44 bytea default ("decode"(repeat('1234567890',10000),'escape'));
select count(*) as added_col44 from pg_attribute pa, pg_class pc where pa.attrelid = pc.oid and pc.relname='multi_segfile_toast' and attname='added_col44';
alter table multi_segfile_toast DROP COLUMN added_col44;
select count(*) as added_col44 from pg_attribute pa, pg_class pc where pa.attrelid = pc.oid and pc.relname='multi_segfile_toast' and attname='added_col44';
VACUUM multi_segfile_toast;
| 62.272727 | 155 | 0.783942 |
e7fca0855906e19926ef43a259b033f9d1d6ddb0 | 542 | py | Python | transform/indexed_transform.py | cviaai/unsupervised-heartbeat-anomaly-detection | 3586bf505256463c030422607e95e4cee40fa086 | [
"MIT"
] | 2 | 2020-10-14T05:50:25.000Z | 2021-05-11T03:42:02.000Z | transform/indexed_transform.py | cviaai/unsupervised-heartbeat-anomaly-detection | 3586bf505256463c030422607e95e4cee40fa086 | [
"MIT"
] | null | null | null | transform/indexed_transform.py | cviaai/unsupervised-heartbeat-anomaly-detection | 3586bf505256463c030422607e95e4cee40fa086 | [
"MIT"
] | null | null | null | from typing import Tuple, List
from transform.transformer import TimeSeriesTransformer
import numpy as np
class IndexedTransformer:
def __init__(self, transformer: TimeSeriesTransformer, padding: int, step: int):
self.transformer = transformer
self.padding = padding
self.step = step
def __call__(self, data: np.ndarray) -> Tuple[List[int], np.ndarray]:
tr_data = self.transformer(data)
indices = [self.padding + i * self.step for i in range(len(tr_data))]
return indices, tr_data
| 30.111111 | 84 | 0.695572 |
0bf5c83dc82755b211608c06da8f5a6ec0548bc6 | 143 | js | JavaScript | ecosystem.config.js | nandulaperera/ucsc-results-center | c817202f52d13cf55189a8f20ae796bd9adcf6bf | [
"MIT"
] | 10 | 2019-05-04T08:19:14.000Z | 2020-05-01T17:02:06.000Z | ecosystem.config.js | nandulaperera/ucsc-results-center | c817202f52d13cf55189a8f20ae796bd9adcf6bf | [
"MIT"
] | null | null | null | ecosystem.config.js | nandulaperera/ucsc-results-center | c817202f52d13cf55189a8f20ae796bd9adcf6bf | [
"MIT"
] | 7 | 2019-11-30T07:08:31.000Z | 2020-01-22T07:01:18.000Z | module.exports = {
apps : [
{
name : 'UCSC Results Center - Web',
script : 'index.js'
}]
}; | 20.428571 | 52 | 0.377622 |
905ab0fe61f0fb90d18d5ab4a86b7a79176f181e | 18,884 | py | Python | vr-xcon/xcon.py | michaelph/vrnetlab | 28c87756a291a754ed83f7e8860abe39c914717e | [
"MIT"
] | 1 | 2020-10-11T18:41:59.000Z | 2020-10-11T18:41:59.000Z | vr-xcon/xcon.py | michaelph/vrnetlab | 28c87756a291a754ed83f7e8860abe39c914717e | [
"MIT"
] | null | null | null | vr-xcon/xcon.py | michaelph/vrnetlab | 28c87756a291a754ed83f7e8860abe39c914717e | [
"MIT"
] | 2 | 2019-08-07T16:45:37.000Z | 2019-11-22T10:32:40.000Z | #!/usr/bin/env python3
import fcntl
import ipaddress
import logging
import os
import select
import signal
import socket
import struct
import subprocess
import sys
import time
def handle_SIGCHLD(signal, frame):
os.waitpid(-1, os.WNOHANG)
def handle_SIGTERM(signal, frame):
sys.exit(0)
signal.signal(signal.SIGINT, handle_SIGTERM)
signal.signal(signal.SIGTERM, handle_SIGTERM)
signal.signal(signal.SIGCHLD, handle_SIGCHLD)
class Tcp2Raw:
def __init__(self, raw_intf = 'eth1', listen_port=10001):
self.logger = logging.getLogger()
# setup TCP side
self.s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
self.s.bind(('::0', listen_port))
self.s.listen(1)
self.tcp = None
# track current state of TCP side tunnel. 0 = reading size, 1 = reading packet
self.tcp_state = 0
self.tcp_buf = b''
self.tcp_remaining = 0
# setup raw side
self.raw = socket.socket( socket.AF_PACKET , socket.SOCK_RAW , socket.ntohs(0x0003))
self.raw.bind((raw_intf, 0))
# don't block
self.raw.setblocking(0)
def work(self):
while True:
skts = [self.s, self.raw]
if self.tcp is not None:
skts.append(self.tcp)
ir = select.select(skts,[],[])[0][0]
if ir == self.s:
self.logger.debug("received incoming TCP connection, setting up!")
self.tcp, addr = self.s.accept()
elif ir == self.tcp:
self.logger.debug("received packet from TCP and sending to raw interface")
try:
buf = ir.recv(2048)
except (ConnectionResetError, OSError):
self.logger.warning("connection dropped")
continue
if len(buf) == 0:
self.logger.info("no data from TCP socket, assuming client hung up, closing our socket")
ir.close()
self.tcp = None
self.tcp_state = 0
self.tcp_buf = b''
self.tcp_remaining = 0
continue
self.tcp_buf += buf
self.logger.debug("read %d bytes from tcp, tcp_buf length %d" % (len(buf), len(self.tcp_buf)))
while True:
if self.tcp_state == 0:
# we want to read the size, which is 4 bytes, if we
# don't have enough bytes wait for the next spin
if not len(self.tcp_buf) > 4:
self.logger.debug("reading size - less than 4 bytes available in buf; waiting for next spin")
break
size = socket.ntohl(struct.unpack("I", self.tcp_buf[:4])[0]) # first 4 bytes is size of packet
self.tcp_buf = self.tcp_buf[4:] # remove first 4 bytes of buf
self.tcp_remaining = size
self.tcp_state = 1
self.logger.debug("reading size - pkt size: %d" % self.tcp_remaining)
if self.tcp_state == 1: # read packet data
# we want to read the whole packet, which is specified
# by tcp_remaining, if we don't have enough bytes we
# wait for the next spin
if len(self.tcp_buf) < self.tcp_remaining:
self.logger.debug("reading packet - less than remaining bytes; waiting for next spin")
break
self.logger.debug("reading packet - reading %d bytes" % self.tcp_remaining)
payload = self.tcp_buf[:self.tcp_remaining]
self.tcp_buf = self.tcp_buf[self.tcp_remaining:]
self.tcp_remaining = 0
self.tcp_state = 0
self.raw.send(payload)
else:
# we always get full packets from the raw interface
payload = self.raw.recv(2048)
buf = struct.pack("I", socket.htonl(len(payload))) + payload
if self.tcp is None:
self.logger.warning("received packet from raw interface but TCP not connected, discarding packet")
else:
self.logger.debug("received packet from raw interface and sending to TCP")
try:
self.tcp.send(buf)
except:
self.logger.warning("could not send packet to TCP session")
class Tcp2Tap:
def __init__(self, tap_intf = 'tap0', listen_port=10001):
self.logger = logging.getLogger()
# setup TCP side
self.s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
self.s.bind(('::0', listen_port))
self.s.listen(1)
self.tcp = None
# track current state of TCP side tunnel. 0 = reading size, 1 = reading packet
self.tcp_state = 0
self.tcp_buf = b''
self.tcp_remaining = 0
# setup tap side
TUNSETIFF = 0x400454ca
IFF_TUN = 0x0001
IFF_TAP = 0x0002
IFF_NO_PI = 0x1000
self.tap = os.open("/dev/net/tun", os.O_RDWR)
# we want a tap interface, no packet info and it should be called tap0
# TODO: implement dynamic name using tap%d, right now we assume we are
# only program in this namespace (docker container) that creates tap0
ifs = fcntl.ioctl(self.tap, TUNSETIFF, struct.pack("16sH", tap_intf.encode(), IFF_TAP | IFF_NO_PI))
# ifname - good for when we do dynamic interface name
ifname = ifs[:16].decode().strip("\x00")
def work(self):
while True:
skts = [self.s, self.tap]
if self.tcp is not None:
skts.append(self.tcp)
ir = select.select(skts,[],[])[0][0]
if ir == self.s:
self.logger.debug("received incoming TCP connection, setting up!")
self.tcp, addr = self.s.accept()
elif ir == self.tcp:
self.logger.debug("received packet from TCP and sending to tap interface")
try:
buf = ir.recv(2048)
except (ConnectionResetError, OSError):
self.logger.warning("connection dropped")
continue
if len(buf) == 0:
self.logger.info("no data from TCP socket, assuming client hung up, closing our socket")
ir.close()
self.tcp = None
self.tcp_state = 0
self.tcp_buf = b''
self.tcp_remaining = 0
continue
self.tcp_buf += buf
self.logger.debug("read %d bytes from tcp, tcp_buf length %d" % (len(buf), len(self.tcp_buf)))
while True:
if self.tcp_state == 0:
# we want to read the size, which is 4 bytes, if we
# don't have enough bytes wait for the next spin
if not len(self.tcp_buf) > 4:
self.logger.debug("reading size - less than 4 bytes available in buf; waiting for next spin")
break
size = socket.ntohl(struct.unpack("I", self.tcp_buf[:4])[0]) # first 4 bytes is size of packet
self.tcp_buf = self.tcp_buf[4:] # remove first 4 bytes of buf
self.tcp_remaining = size
self.tcp_state = 1
self.logger.debug("reading size - pkt size: %d" % self.tcp_remaining)
if self.tcp_state == 1: # read packet data
# we want to read the whole packet, which is specified
# by tcp_remaining, if we don't have enough bytes we
# wait for the next spin
if len(self.tcp_buf) < self.tcp_remaining:
self.logger.debug("reading packet - less than remaining bytes; waiting for next spin")
break
self.logger.debug("reading packet - reading %d bytes" % self.tcp_remaining)
payload = self.tcp_buf[:self.tcp_remaining]
self.tcp_buf = self.tcp_buf[self.tcp_remaining:]
self.tcp_remaining = 0
self.tcp_state = 0
os.write(self.tap, payload)
else:
# we always get full packets from the tap interface
payload = os.read(self.tap, 2048)
buf = struct.pack("I", socket.htonl(len(payload))) + payload
if self.tcp is None:
self.logger.warning("received packet from tap interface but TCP not connected, discarding packet")
else:
self.logger.debug("received packet from tap interface and sending to TCP")
try:
self.tcp.send(buf)
except:
self.logger.warning("could not send packet to TCP session")
class TcpBridge:
def __init__(self):
self.logger = logging.getLogger()
self.sockets = []
self.socket2remote = {}
self.socket2hostintf = {}
def hostintf2addr(self, hostintf):
hostname, interface = hostintf.split("/")
try:
res = socket.getaddrinfo(hostname, "100%02d" % int(interface))
except socket.gaierror:
raise NoVR("Unable to resolve %s" % hostname)
sockaddr = res[0][4]
return sockaddr
def add_p2p(self, p2p):
source, destination = p2p.split("--")
src_router, src_interface = source.split("/")
dst_router, dst_interface = destination.split("/")
src = self.hostintf2addr(source)
dst = self.hostintf2addr(destination)
left = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
right = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# dict to map back to hostname & interface
self.socket2hostintf[left] = "%s/%s" % (src_router, src_interface)
self.socket2hostintf[right] = "%s/%s" % (dst_router, dst_interface)
try:
left.connect(src)
except:
self.logger.info("Unable to connect to %s" % self.socket2hostintf[left])
try:
right.connect(dst)
except:
self.logger.info("Unable to connect to %s" % self.socket2hostintf[right])
# add to list of sockets
self.sockets.append(left)
self.sockets.append(right)
# dict for looking up remote in pair
self.socket2remote[left] = right
self.socket2remote[right] = left
def work(self):
while True:
try:
ir,_,_ = select.select(self.sockets, [], [])
except select.error as exc:
break
for i in ir:
remote = self.socket2remote[i]
try:
buf = i.recv(2048)
except ConnectionResetError as exc:
self.logger.warning("connection dropped, reconnecting to source %s" % self.socket2hostintf[i])
try:
i.connect(self.hostintf2addr(self.socket2hostintf[i]))
self.logger.debug("reconnect to %s successful" % self.socket2hostintf[i])
except Exception as exc:
self.logger.warning("reconnect failed %s" % str(exc))
continue
except OSError as exc:
self.logger.warning("endpoint not connected, connecting to source %s" % self.socket2hostintf[i])
try:
i.connect(self.hostintf2addr(self.socket2hostintf[i]))
self.logger.debug("connect to %s successful" % self.socket2hostintf[i])
except:
self.logger.warning("connect failed %s" % str(exc))
continue
if len(buf) == 0:
return
self.logger.debug("%05d bytes %s -> %s " % (len(buf), self.socket2hostintf[i], self.socket2hostintf[remote]))
try:
remote.send(buf)
except BrokenPipeError:
self.logger.warning("unable to send packet %05d bytes %s -> %s due to remote being down, trying reconnect" % (len(buf), self.socket2hostintf[i], self.socket2hostintf[remote]))
try:
remote.connect(self.hostintf2addr(self.socket2hostintf[remote]))
self.logger.debug("connect to %s successful" % self.socket2hostintf[remote])
except Exception as exc:
self.logger.warning("connect failed %s" % str(exc))
continue
class NoVR(Exception):
""" No virtual router
"""
class TapConfigurator(object):
def __init__(self, logger):
self.logger = logger
def _configure_interface_address(self, interface, address, default_route=None):
next_hop = None
net = ipaddress.ip_interface(address)
if default_route:
try:
next_hop = ipaddress.ip_address(default_route)
except ValueError:
self.logger.error("next-hop address {} could not be parsed".format(default_route))
sys.exit(1)
if default_route and next_hop not in net.network:
self.logger.error("next-hop address {} not in network {}".format(next_hop, net))
sys.exit(1)
subprocess.check_call(["ip", "-{}".format(net.version), "address", "add", str(net.ip) + "/" + str(net.network.prefixlen), "dev", interface])
if next_hop:
try:
subprocess.check_call(["ip", "-{}".format(net.version), "route", "del", "default"])
except:
pass
subprocess.check_call(["ip", "-{}".format(net.version), "route", "add", "default", "dev", interface, "via", str(next_hop)])
def configure_interface(self, interface='tap0', vlan=None,
ipv4_address=None, ipv4_route=None,
ipv6_address=None, ipv6_route=None):
# enable the interface
subprocess.check_call(["ip", "link", "set", interface, "up"])
interface_sysctl = interface
if vlan:
physical_interface = interface
interface_sysctl = '{}/{}'.format(interface, vlan)
interface = '{}.{}'.format(interface, vlan)
subprocess.check_call(["ip", "link", "add", "link", physical_interface, "name",
interface, "type", "vlan", "id", str(vlan)])
subprocess.check_call(["ip", "link", "set", interface, "up"])
if ipv4_address:
self._configure_interface_address(interface, ipv4_address, ipv4_route)
if ipv6_address:
# stupid hack for docker engine disabling IPv6. It's somewhere around
# version 17.04 that docker engine started disabling ipv6 on the sysctl
# net.ipv6.conf.all and net.ipv6.conf.default while eth0 and lo still has
# it, if docker engine is started with --ipv6. However, with the default at
# disable we have to specifically enable it for interfaces created after the
# container started...
subprocess.check_call(["sysctl", "net.ipv6.conf.{}.disable_ipv6=0".format(interface_sysctl)])
self._configure_interface_address(interface, ipv6_address, ipv6_route)
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(description='')
parser.add_argument('--debug', action="store_true", default=False, help='enable debug')
p2p = parser.add_argument_group('p2p')
p2p.add_argument('--p2p', nargs='+', help='point-to-point link between virtual routers')
raw = parser.add_argument_group('raw')
raw.add_argument('--raw-listen', help='raw to virtual router. Will listen on specified port for incoming connection; 1 for TCP/10001')
raw.add_argument('--raw-if', default="eth1", help='name of raw interface (use with other --raw-* arguments)')
tap = parser.add_argument_group('tap')
tap.add_argument('--tap-listen', help='tap to virtual router. Will listen on specified port for incoming connection; 1 for TCP/10001')
tap.add_argument('--tap-if', default="tap0", help='name of tap interface (use with other --tap-* arguments)')
tap.add_argument('--ipv4-address', help='IPv4 address to use on the tap interface')
tap.add_argument('--ipv4-route', help='default IPv4 route to use on the tap interface')
tap.add_argument('--ipv6-address', help='IPv6 address to use on the tap interface')
tap.add_argument('--ipv6-route', help='default IPv6 route to use on the tap interface')
tap.add_argument('--vlan', type=int, help='VLAN ID to use on the tap interface')
parser.add_argument('--trace', action="store_true", help="dummy, we don't support tracing but taking the option makes vrnetlab containers uniform")
args = parser.parse_args()
# sanity
if args.p2p and args.tap_listen:
print("--p2p and --tap-listen are mutually exclusive", file=sys.stderr)
sys.exit(1)
LOG_FORMAT = "%(asctime)s: %(module)-10s %(levelname)-8s %(message)s"
logging.basicConfig(format=LOG_FORMAT)
logger = logging.getLogger()
logger.setLevel(logging.INFO)
if args.debug:
logger.setLevel(logging.DEBUG)
if args.p2p:
tt = TcpBridge()
for p2p in args.p2p:
try:
tt.add_p2p(p2p)
except NoVR as exc:
print(exc, " Is it started and did you link it?")
sys.exit(1)
tt.work()
if args.tap_listen:
# init Tcp2Tap to create interface
t2t = Tcp2Tap(args.tap_if, 10000 + int(args.tap_listen))
# now (optionally) configure addressing
tc = TapConfigurator(logger)
tc.configure_interface(interface=args.tap_if, vlan=args.vlan,
ipv4_address=args.ipv4_address, ipv4_route=args.ipv4_route,
ipv6_address=args.ipv6_address, ipv6_route=args.ipv6_route)
t2t.work()
if args.raw_listen:
while True:
try:
t2r = Tcp2Raw(args.raw_if, 10000 + int(args.raw_listen))
t2r.work()
except Exception as exc:
print(exc)
time.sleep(1)
| 43.212815 | 195 | 0.55592 |
6b34583346e2bb62d3ae0f2321f8e8e6ac12a0f7 | 42,248 | html | HTML | data/html/static_practice_B86019.html | ebmdatalab/outliers | 31a79c5f6664724513e8087516a5e2c892d74708 | [
"MIT"
] | null | null | null | data/html/static_practice_B86019.html | ebmdatalab/outliers | 31a79c5f6664724513e8087516a5e2c892d74708 | [
"MIT"
] | 29 | 2020-01-13T12:46:09.000Z | 2022-03-14T13:46:27.000Z | data/html/static_practice_B86019.html | ebmdatalab/outliers | 31a79c5f6664724513e8087516a5e2c892d74708 | [
"MIT"
] | null | null | null | <html>
<head>
<link href="./static/vendor/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="./static/css/outliers.css" rel="stylesheet">
<meta charset="UTF-8">
</head>
<body>
<div class="container">
<h1>Static outliers for Rutland Lodge Medical Centre</h1>
<p>There is substantial variation in prescribing behaviours, across various different areas of medicine. Some variation can be explained by demographic changes, or local policies or guidelines, but much of the remaining variation is less easy to
explain. At <a href="https://openprescribing.net/">OpenPrescribing</a> we are piloting a number of data-driven approaches to identify unusual prescribing and collect feedback on this prescribing to inform development of new tools to support
prescribers and organisations to audit and review prescribing.</p>
<p>This report has been developed to automatically identify prescribing patterns at a chemical level which are furthest away from “typical prescribing” and can be classified as an “outlier”. We calculate the number of prescriptions for each chemical
in the <a href="https://www.thedatalab.org/blog/161/prescribing-data-bnf-codes">BNF coding system</a> using the BNF subparagraph as a denominator, for prescriptions dispensed between April 2021 and August 2021. We then calculate the
mean and standard deviation for each numerator and denominator pair across all practices/CCGs/PCNs/STPs. From this we can calculate the “z-score”, which is a measure of how many standard deviations a given practice/CCG/PCN/STP is from the
population mean. We then rank your “z-scores” to find the top 5 results where prescribing is an outlier for prescribing higher than its peers and those where it is an outlier for prescribing lower than its peers.
</p>
<p>It is important to remember that this information was generated automatically and it is therefore likely that some of the behaviour is warranted. This report seeks only to collect information about where this variation may be warranted and where
it might not. Our full analytical method code is openly available on GitHub <a href="https://github.com/ebmdatalab/outliers/">here</a>.
</p>
<p>The DataLab is keen to hear your feedback on the results. You can do this by completing the following <a href="https://docs.google.com/forms/d/e/1FAIpQLSeH4ai_qyetAY4UAgZSWGnYQHkXNr9efFBmQvdrBi5uuXvgnQ/viewform?usp=pp_url&entry.2016356131=practice+B86019">survey</a> or emailing us at <a href="mailto:ebmdatalab@phc.ox.ac.uk?subject=OpenPrescribing%20outliers%20feedback">ebmdatalab@phc.ox.ac.uk</a>. Please DO NOT INCLUDE IDENTIFIABLE PATIENT information in your feedback. All feedback is helpful, you can
send short or detailed feedback.
</p>
<h2>Prescribing where Rutland Lodge Medical Centre is higher than most</h2>
<table border="1" class="dataframe table thead-light table-bordered table-sm" id="table_high">
<thead>
<tr><th>BNF Chemical</th>
<th><abbr title="number of prescribed items containing this chemical">Chemical Items</abbr></th>
<th>BNF Subparagraph</th>
<th><abbr title="count of all prescribed items from this subparagraph">Subparagraph Items</abbr></th>
<th><abbr title="Ratio of chemical items to subparagraph items">Ratio</abbr></th>
<th><abbr title="Population mean number of chemical items prescribed">Mean</abbr></th>
<th><abbr title="Standard Deviation">std</abbr></th>
<th><abbr title="Number of standard deviations prescribed item count is away from the mean">Z_Score</abbr></th>
<th>Plots</th>
</tr></thead>
<tbody><tr>
<th><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0304010K0&denomIds=3.4.1&selectedTab=summary">Cyproheptadine hydrochloride</a><button type="button" data-toggle="collapse" data-target="#table_high_0_items" class="btn btn-default btn-xs">☰</button></th>
<td>20</td>
<td>Antihistamines</td>
<td>958</td>
<td>0.02</td>
<td>0.00</td>
<td>0.00</td>
<td>19.50</td>
<td><img class="zoom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPwAAABICAYAAADS8JgEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAEDklEQVR4nO3cPagcVRiH8eeoGFFUMBrBxsGgjYUp0sQiWKmwVqKCWBuwjuiCNjEWC1ZKBFEREW0SEJu1iJ+9QVRILJRkFFQUiUERQUhei93Ke693Nzln56zn+cGF+zF75n0Z/jtnzp2dFBFIasNlQxcgaXUMvNQQAy81xMBLDTHwUkMMvNQQAy81xMBLDTHwUkMMvNQQAy+tWkqD3c+eLfDdeHpnrrEklZFyfXimG09PAAHc109GZ7MMKv0fpRREpCF2ne0M309Ge4HTwJ5cY0rKK/c1/Gng1sxjSsokd+C/w8BL1SoR+C7zmJIyyR34Hs/wUrVyB/57DLxUrayB7yejP4GruvH08pzjSsqjxJ12PwC3FBhX0iUqEXgX7qRKlQq81/FShUoEvsfAS1VySi81xCm91BADLzUke+D7yegccH03nvpwDakypUL5M7Cr0NiSLlKpwPc4rZeqUyrwrtRLFSoZeM/wUmWc0ksNcUovNcQpvdSQUoH/FbixG08HeRSvpM0VCXw/GQVwFrihxPiSLk7Ju+F6vI6XqlIy8CeA/QXHl7SkkoE/CjxScHxJSyoZ+JPAdd146mq9VIligZ8v3B0DHiq1D0nLKf0R1mM4rZeqUTTw/WR0ErimG0+7kvuRtJhVPKTiKPDwCvYjaRurCLzTeqkSKSKK76QbT78CHgc+6yejC8V3KNUspSBikNvOr1jRfg4BLwJdN56eAX4Czhf+2uqNZbN3uK3e9dzWbbNv2wPdeHpvrnH7yeijLbbdINsZPqV0ICJezTLYQNa9h3WvH9a/h9rrz3kNfyDjWENZ9x7WvX5Y/x6qrt9HSUsNMfBSQ3IGvtrrliWsew/rXj+sfw9V17+Sf8tJqoNTeqkhS/0fPqW0H7gb+CUi3kgpPQjsBr5l9nHYx4DfgCPA8/OXPRMR5/OVfGmW6OFN4BXg/Yh4a6ByN9im/jPAJCLuTyntBJ4E/oqI54areKMletjDbNX7eES8N1zFG23Tw7n53/4A3qGi47DsGX5fREyAm+Y/3x4RLwB3ACNmId8B3AV8AHw4/74mi/ZwgVnwrx6kyq1tWX9EfAF8Ov/9PcDrwI8ppdqeLbhoD38zC01txwD+u4dPgAmwk8qOw7KB//cF/zouACzUQ0T8HhFPADtSSteWL2thLR2DUxHxNHBb+ZKWtl0PTwGvraiWhS21aDefxuxj9kTaz5k9e3438A3wNfAos7Piy8Dh+cuerXBKv0gP7zKb3u8CDkYlq5vb1P8l8BLwNrPZ1UFmU8nDm482jCV6OAU8AFwZEYeGqXZz2/RwM7AXOA58TEXHwVV6qSGu0ksNMfBSQwy81BADLzXEwEsNMfBSQwy81BADLzXEwEsNMfBSQwy81JB/AG4VkWTHxxnoAAAAAElFTkSuQmCC"></td>
</tr>
<tr id="table_high_0_items" class="collapse"><td colspan="9" class="hiddenRow"><div><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0304010K0AAABAB&denomIds=3.4.1&selectedTab=summary" target="_blank">Cyproheptadine 4mg tablets : 20</a></div></td></tr><tr>
<th><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0202010D0&denomIds=2.2.1&selectedTab=summary">Chlorothiazide</a><button type="button" data-toggle="collapse" data-target="#table_high_1_items" class="btn btn-default btn-xs">☰</button></th>
<td>8</td>
<td>Thiazides and related diuretics</td>
<td>415</td>
<td>0.02</td>
<td>0.00</td>
<td>0.00</td>
<td>12.73</td>
<td><img class="zoom" src="data:image/png;base64,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"></td>
</tr>
<tr id="table_high_1_items" class="collapse"><td colspan="9" class="hiddenRow"><div><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0202010D0AAAUAU&denomIds=2.2.1&selectedTab=summary" target="_blank">Chlorothiazide 250mg/5ml oral suspension : 8</a></div></td></tr><tr>
<th><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0501030V0&denomIds=5.1.3&selectedTab=summary">Tetracycline</a><button type="button" data-toggle="collapse" data-target="#table_high_2_items" class="btn btn-default btn-xs">☰</button></th>
<td>20</td>
<td>Tetracyclines</td>
<td>209</td>
<td>0.10</td>
<td>0.01</td>
<td>0.01</td>
<td>7.26</td>
<td><img class="zoom" src="data:image/png;base64,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"></td>
</tr>
<tr id="table_high_2_items" class="collapse"><td colspan="9" class="hiddenRow"><div><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0501030V0AAAFAF&denomIds=5.1.3&selectedTab=summary" target="_blank">Tetracycline 250mg tablets : 20</a></div></td></tr><tr>
<th><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=1103010AG&denomIds=11.3.1&selectedTab=summary">Levofloxacin</a><button type="button" data-toggle="collapse" data-target="#table_high_3_items" class="btn btn-default btn-xs">☰</button></th>
<td>10</td>
<td>Antibacterials</td>
<td>78</td>
<td>0.13</td>
<td>0.01</td>
<td>0.02</td>
<td>5.47</td>
<td><img class="zoom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPwAAABICAYAAADS8JgEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAEjUlEQVR4nO3dPYgcZRzH8e8kRo1KvBR2gkOCEnxpQkBjIUJExA0qWqmFhXAIggiCbqtYbLCJ2KiFYkBtRAK6WOSIYBU1WimiSbGCVXyJKULQvPwtZoOXdffuNvs8O3PO9wPDzu1z98z/jvvNzD777EwREUhqhw11FyBpfgy81CIGXmoRAy+1iIGXWsTASy1i4KUWMfBSixh4qUUMvNQiBl5rVxTOw17nZg582e0/kaIQSfmlOMK/Unb79yfoR1JmKQL/IPBW2e3vTNCXpIxmDvyg1/kJWAT2zV6OpJxSDdp9DtxedvsbE/UnKYMkgR/0OueAY8COFP1JyiPl23JHgDsT9icpsZSB/xIDLzVa6sDflbA/SYklC/yg1/kFWCi7/etS9SkprdRTa48CuxL3KSmR1IF34E5qsNSBd+BOarDUgf8G2FV2+0XifiUlkDTwg17nNPA7cGPKfiWlkePz8J7WSw2VI/BH8P14qZE8wkstkiPwPwLby25/U4a+Jc0geeAHvc4F4DvgjtR9S5pNrotYOgFHaqBcgfeDNFID5Qr8V3iElxonS+AHvc6vwMay29+ao39JlyfnjSg8yksNkzPwS8DejP1LmlLOwH8MPFR2+1dk3IakKWQL/KDXOQV8DezJtQ1J08l9M8kPAe89JzVE7sD3gT1lt78583YkrUHWwA96nTNUg3ednNuRtDbzuD/8B8Cz3oZKqt88An8I+BnY76WvpHplD/yg1wmqu8vuAF7IvT1JkxURMZcNld3+FuATYAE4SHUN+5PLlj+BM8MdhJqoKIIIz9LWsbkF/qKy298GPAzcCmwdLgvDx81AAKeodgAn+e9OYfn6XyPL36PPDXqd83P61f7/DPy6N/fAr6bs9jcAW/h3ZzBpuR64atly5YT1iy9bLv6jxnD9PHAWODdczo48jlu/sGyJka8nPTfN987686PPx3BhzPro46ptg317Pypf+vSxZW3jrNe2yNA2F4NeZ2mt3ztz4IuiWIyIt2fqpEbWXy/rn68Ug3aLCfqok/XXy/rnaB5vy0lqCAMvtUiKwK+b1y8TWH+9rH+OGjdKLykfT+mlFpnqajRFUdwD3A2ciIh3iqJ4FNgOHAe+B54ETkbE/uSVJrBK/QHsAg5HxOEay5xoTP2PAA9ExDOjbbUWOsEq9T9PdQD6IiKO1lroBGPqfwq4DfiMal5Ho//+MP0RfndE9IAbhl/fHBGvAbdQfQT2VarJLk21Uv2nqSbXXF1XcWtwSf0RcRAYjGtrqJXq/4NqwlSTL4k2Wv97wJvAttG2ppo28CvNMloPJtYfEYci4mVg53xLmsrlzipriok1RsSBYWDum2M907qk/qIorgWeBg6MtjXVVIN2w1Oa3VR742+Bm6hOiY8BPwCPU53Sv56+1NmtUv9vwL3AqYh4o64aVzKm/muAF4EesHHYdiIi3q2tyBWsUv8C1Uuq4xHxfm1FrmBM/c9RvRxcAjbR8L8/OEovtYqj9FKLGHipRQy81CIGXmoRAy+1iIGXWsTASy1i4KUWMfBSixh4qUUMvNQi/wC08bccV2pHkAAAAABJRU5ErkJggg=="></td>
</tr>
<tr id="table_high_3_items" class="collapse"><td colspan="9" class="hiddenRow"><div><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=1103010AGBBAAAA&denomIds=11.3.1&selectedTab=summary" target="_blank">Oftaquix 5mg/ml eye drops : 5</a><br><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=1103010AGBBACAC&denomIds=11.3.1&selectedTab=summary" target="_blank">Oftaquix 5mg/ml eye drops 0.3ml unit dose : 5</a></div></td></tr><tr>
<th><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0407041M0&denomIds=4.7.4&selectedTab=summary">Naratriptan hydrochloride</a><button type="button" data-toggle="collapse" data-target="#table_high_4_items" class="btn btn-default btn-xs">☰</button></th>
<td>42</td>
<td>Treatment of acute migraine</td>
<td>149</td>
<td>0.28</td>
<td>0.04</td>
<td>0.05</td>
<td>5.18</td>
<td><img class="zoom" src="data:image/png;base64,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"></td>
</tr>
<tr id="table_high_4_items" class="collapse"><td colspan="9" class="hiddenRow"><div><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0407041M0AAAAAA&denomIds=4.7.4&selectedTab=summary" target="_blank">Naratriptan 2.5mg tablets : 42</a></div></td></tr></tbody></table>
<h2>Prescribing where Rutland Lodge Medical Centre is lower than most</h2>
<table border="1" class="dataframe table thead-light table-bordered table-sm" id="table_low">
<thead>
<tr><th>BNF Chemical</th>
<th><abbr title="number of prescribed items containing this chemical">Chemical Items</abbr></th>
<th>BNF Subparagraph</th>
<th><abbr title="count of all prescribed items from this subparagraph">Subparagraph Items</abbr></th>
<th><abbr title="Ratio of chemical items to subparagraph items">Ratio</abbr></th>
<th><abbr title="Population mean number of chemical items prescribed">Mean</abbr></th>
<th><abbr title="Standard Deviation">std</abbr></th>
<th><abbr title="Number of standard deviations prescribed item count is away from the mean">Z_Score</abbr></th>
<th>Plots</th>
</tr></thead>
<tbody><tr>
<th><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0407041T0&denomIds=4.7.4&selectedTab=summary">Sumatriptan succinate</a><button type="button" data-toggle="collapse" data-target="#table_low_0_items" class="btn btn-default btn-xs">☰</button></th>
<td>60</td>
<td>Treatment of acute migraine</td>
<td>149</td>
<td>0.40</td>
<td>0.67</td>
<td>0.12</td>
<td>-2.17</td>
<td><img class="zoom" src="data:image/png;base64,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"></td>
</tr>
<tr id="table_low_0_items" class="collapse"><td colspan="9" class="hiddenRow"><div><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0407041T0AAAFAF&denomIds=4.7.4&selectedTab=summary" target="_blank">Sumatriptan 50mg tablets : 48</a><br><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0407041T0AAAIAI&denomIds=4.7.4&selectedTab=summary" target="_blank">Sumatriptan 6mg/0.5ml inj pre-filled disposable devices : 2</a><br><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0407041T0AAAHAH&denomIds=4.7.4&selectedTab=summary" target="_blank">Sumatriptan 10mg/0.1ml nasal spray unit dose : 3</a><br><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0407041T0AAACAC&denomIds=4.7.4&selectedTab=summary" target="_blank">Sumatriptan 100mg tablets : 7</a></div></td></tr><tr>
<th><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0103050P0&denomIds=1.3.5&selectedTab=summary">Omeprazole</a><button type="button" data-toggle="collapse" data-target="#table_low_1_items" class="btn btn-default btn-xs">☰</button></th>
<td>509</td>
<td>Proton pump inhibitors</td>
<td>3096</td>
<td>0.16</td>
<td>0.50</td>
<td>0.16</td>
<td>-2.06</td>
<td><img class="zoom" src="data:image/png;base64,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"></td>
</tr>
<tr id="table_low_1_items" class="collapse"><td colspan="9" class="hiddenRow"><div><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0103050P0AAAAAA&denomIds=1.3.5&selectedTab=summary" target="_blank">Omeprazole 20mg gastro-resistant capsules : 416</a><br><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0103050P0AAAEAE&denomIds=1.3.5&selectedTab=summary" target="_blank">Omeprazole 40mg gastro-resistant capsules : 45</a><br><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0103050P0BBAAAA&denomIds=1.3.5&selectedTab=summary" target="_blank">Losec 20mg gastro-resistant capsules : 2</a><br><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0103050P0AAANAN&denomIds=1.3.5&selectedTab=summary" target="_blank">Omeprazole 20mg dispersible gastro-resistant tablets : 1</a><br><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0103050P0AAAPAP&denomIds=1.3.5&selectedTab=summary" target="_blank">Omeprazole 40mg dispersible gastro-resistant tablets : 4</a><br><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0103050P0AABDBD&denomIds=1.3.5&selectedTab=summary" target="_blank">Omeprazole 20mg gastro-resistant tablets : 8</a><br><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0103050P0AAAFAF&denomIds=1.3.5&selectedTab=summary" target="_blank">Omeprazole 10mg gastro-resistant capsules : 26</a><br><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0103050P0AAAMAM&denomIds=1.3.5&selectedTab=summary" target="_blank">Omeprazole 10mg dispersible gastro-resistant tablets : 7</a></div></td></tr><tr>
<th><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=1001040C0&denomIds=10.1.4&selectedTab=summary">Allopurinol</a><button type="button" data-toggle="collapse" data-target="#table_low_2_items" class="btn btn-default btn-xs">☰</button></th>
<td>170</td>
<td>Gout and cytotoxic induced hyperiuicaemia</td>
<td>214</td>
<td>0.79</td>
<td>0.89</td>
<td>0.05</td>
<td>-1.87</td>
<td><img class="zoom" src="data:image/png;base64,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"></td>
</tr>
<tr id="table_low_2_items" class="collapse"><td colspan="9" class="hiddenRow"><div><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=1001040C0AAAAAA&denomIds=10.1.4&selectedTab=summary" target="_blank">Allopurinol 100mg tablets : 113</a><br><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=1001040C0AAABAB&denomIds=10.1.4&selectedTab=summary" target="_blank">Allopurinol 300mg tablets : 57</a></div></td></tr><tr>
<th><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=090401000&denomIds=9.4.1&selectedTab=summary">Other food for special diet preparations</a><button type="button" data-toggle="collapse" data-target="#table_low_3_items" class="btn btn-default btn-xs">☰</button></th>
<td>20</td>
<td>Foods for special diets</td>
<td>101</td>
<td>0.20</td>
<td>0.65</td>
<td>0.25</td>
<td>-1.81</td>
<td><img class="zoom" src="data:image/png;base64,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"></td>
</tr>
<tr id="table_low_3_items" class="collapse"><td colspan="9" class="hiddenRow"><div><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=090401000BBGWBA&denomIds=9.4.1&selectedTab=summary" target="_blank">Calogen emulsion neutral : 1</a><br><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=090401000BBGFA0&denomIds=9.4.1&selectedTab=summary" target="_blank">Fortijuce liquid (7 flavours) : 9</a><br><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=090401000BBADAL&denomIds=9.4.1&selectedTab=summary" target="_blank">Instant Carobel powder : 3</a><br><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=090401000BBTHA0&denomIds=9.4.1&selectedTab=summary" target="_blank">Nutramigen 2 with LGG powder : 7</a></div></td></tr><tr>
<th><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0407042Q0&denomIds=4.7.4&selectedTab=summary">Pizotifen malate</a><button type="button" data-toggle="collapse" data-target="#table_low_4_items" class="btn btn-default btn-xs">☰</button></th>
<td>4</td>
<td>Prophylaxis of migraine</td>
<td>21</td>
<td>0.19</td>
<td>0.65</td>
<td>0.26</td>
<td>-1.76</td>
<td><img class="zoom" src="data:image/png;base64,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"></td>
</tr>
<tr id="table_low_4_items" class="collapse"><td colspan="9" class="hiddenRow"><div><a href="https://openprescribing.net/analyse/#org=practice&orgIds=B86019&numIds=0407042Q0AAABAB&denomIds=4.7.4&selectedTab=summary" target="_blank">Pizotifen 500microgram tablets : 4</a></div></td></tr></tbody></table>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</body>
</html> | 238.689266 | 3,314 | 0.865201 |
e7ea14302b331a9466a14df8ced10e7042b53923 | 7,081 | py | Python | core/data/dataloader/upb_kitti.py | nemodrive/awesome-semantic-segmentation-pytorch | fa0e4174004822ace0560cc046c2fbdb81f1e1b9 | [
"Apache-2.0"
] | null | null | null | core/data/dataloader/upb_kitti.py | nemodrive/awesome-semantic-segmentation-pytorch | fa0e4174004822ace0560cc046c2fbdb81f1e1b9 | [
"Apache-2.0"
] | null | null | null | core/data/dataloader/upb_kitti.py | nemodrive/awesome-semantic-segmentation-pytorch | fa0e4174004822ace0560cc046c2fbdb81f1e1b9 | [
"Apache-2.0"
] | null | null | null | """Pascal VOC Semantic Segmentation Dataset."""
import os
import torch
import numpy as np
from PIL import Image
from .segbase import SegmentationDataset
class VOCSegmentation(SegmentationDataset):
"""Pascal VOC Semantic Segmentation Dataset.
Parameters
----------
root : string
Path to VOCdevkit folder. Default is './datasets/VOCdevkit'
split: string
'train', 'val' or 'test'
transform : callable, optional
A function that transforms the image
Examples
--------
>>> from torchvision import transforms
>>> import torch.utils.data as data
>>> # Transforms for Normalization
>>> input_transform = transforms.Compose([
>>> transforms.ToTensor(),
>>> transforms.Normalize([.485, .456, .406], [.229, .224, .225]),
>>> ])
>>> # Create Dataset
>>> trainset = VOCSegmentation(split='train', transform=input_transform)
>>> # Create Training Loader
>>> train_data = data.DataLoader(
>>> trainset, 4, shuffle=True,
>>> num_workers=4)
"""
BASE_DIR = 'labels'
NUM_CLASS = 1 # 1 for soft labels
def __init__(self, root='/HDD1_2TB/storage/kitti_self_supervised_labels', split='train', mode=None, transform=None,
**kwargs):
super(KITTISegmentation, self).__init__(root, split, mode, transform, **kwargs)
_voc_root = os.path.join(root, self.BASE_DIR)
_mask_dir = os.path.join(_voc_root, 'SegmentationClass')#os.path.join(_voc_root, 'JPEGImages')
_image_dir = os.path.join(_voc_root, 'JPEGImages')
_path_mask_dir = os.path.join(_voc_root, 'SoftRoadGaussianLabels')#os.path.join(_voc_root, 'JPEGImages')
# train/val/test splits are pre-cut
_splits_dir = os.path.join(_voc_root, 'ImageSets/Segmentation')
if split == 'train':
_split_f = os.path.join(_splits_dir, 'train')
elif split == 'val':
_split_f = os.path.join(_splits_dir, 'val') #'val_upb.txt'; with info has the files that are synched with the steering info files
elif split == 'test':
_split_f = os.path.join(_splits_dir, 'test')
else:
raise RuntimeError('Unknown dataset split.')
self.images = []
self.masks = []
self.path_masks = []
self.cmds = []
with open(os.path.join(_split_f), "r") as lines:
for line in lines:
file_name = line.split(',')[0]
cmd = line.split(',')[1]
_image = os.path.join(_image_dir, file_name)
assert os.path.isfile(_image)
_path_mask = os.path.join(_path_mask_dir, file_name.replace('/', '\\')) # doar filename pt eval
assert os.path.isfile(_path_mask)
self.images.append(_image)
self.path_masks.append(_path_mask)
self.cmds.append(cmd)
if split != 'test':
_mask = os.path.join(_mask_dir, file_name.replace('/', '\\')) # doar filename pt eval
assert os.path.isfile(_mask)
self.masks.append(_mask)
if split != 'test':
assert (len(self.images) == len(self.masks))
print('Found {} images in the folder {}'.format(len(self.images), _voc_root))
def __getitem__(self, index):
img = Image.open(self.images[index]).convert('RGB')
# print(self.cmds[index])
# img.show()
# time.sleep(8)
if self.mode == 'test':
img = self._img_transform(img)
if self.transform is not None:
img = self.transform(img)
return img, os.path.basename(self.images[index])
mask = Image.open(self.masks[index]).quantize(self.num_class + 1) # 1 for train or 2 for eval
path_mask = Image.open(self.path_masks[index]).convert('RGB')
# path_mask = np.load(self.path_masks[index], allow_pickle=True)
# path_mask = Image.fromarray(path_mask)
# mask.show()
# time.sleep(5)
# synchronized transform
if self.mode == 'train':
img, mask, path_mask = self._sync_transform(img, mask, path_mask)
elif self.mode == 'val':
img, mask, path_mask = self._val_sync_transform(img, mask, path_mask)
else:
assert self.mode == 'testval'
img, mask = self._img_transform(img), self._mask_transform(mask)
# general resize, normalize and toTensor
if self.transform is not None:
img = self.transform(img)
path_mask = transforms.ToTensor()(path_mask)
path_mask = path_mask[1].unsqueeze(0)
if path_mask.max() != 0:
path_mask = path_mask / path_mask.max()
return img, mask, path_mask, self.images[index]# os.path.basename(self.images[index])
def __len__(self):
return len(self.images)
def _mask_transform(self, mask):
target = np.array(mask).astype('int32')
target[target == 255] = -1
return torch.from_numpy(target).long()
@property
def classes(self):
"""Category names."""
return ('path', 'rest')
class KITTIImageSampler(Sampler):
def __init__(self, image_data, prob_weights):
self.image_data = image_data
# Get dataset length in terms of video frames and start frame for each video
self.start_frames = []
self.len = len(image_data)
self.seen = 0
self.samples_cmd = {0: [], 1: [], 2: [], 3: [], 4: [], 5: []}
self.samples_idx = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0}
self._population = [0, 1, 2, 3, 4, 5]
self._weights = prob_weights
self._split_samples()
for key in self.samples_cmd.keys():
np.random.shuffle(self.samples_cmd[key])
def __len__(self):
return self.len
def __iter__(self):
return self
def next(self):
return self.__next__()
def __next__(self):
# added this while because samples_cmd[sample_type] could be empty
while True:
sample_type = np.random.choice(self._population, p=self._weights)
if self.samples_cmd[sample_type]:
break
idx = self.samples_cmd[sample_type][self.samples_idx[sample_type]]
self.samples_idx[sample_type] += 1
if self.samples_idx[sample_type] >= len(self.samples_cmd[sample_type]):
self.samples_idx[sample_type] = 0
np.random.shuffle(self.samples_cmd[sample_type])
self.seen += 1
if self.seen >= self.len:
for key in self.samples_cmd.keys():
np.random.shuffle(self.samples_cmd[key])
self.samples_idx[key] = 0
self.seen = 0
raise StopIteration
return idx
def _split_samples(self):
index = 0
for j in range(len(self.image_data)):
cmd = self.image_data[j]
self.samples_cmd[cmd].append(index)
index += 1
if __name__ == '__main__':
dataset = KITTISegmentation()
| 36.880208 | 141 | 0.591018 |
1677b71e13f48c61742f9f0107dff7a8c2268fb9 | 246 | h | C | XNMVPDemo/XNMVPDemo/Main/View/XNLoginView.h | xunan623/XNMVP | 32ed07d96f44df80784600af4b2dfe543b38a64f | [
"MIT"
] | null | null | null | XNMVPDemo/XNMVPDemo/Main/View/XNLoginView.h | xunan623/XNMVP | 32ed07d96f44df80784600af4b2dfe543b38a64f | [
"MIT"
] | null | null | null | XNMVPDemo/XNMVPDemo/Main/View/XNLoginView.h | xunan623/XNMVP | 32ed07d96f44df80784600af4b2dfe543b38a64f | [
"MIT"
] | null | null | null | //
// XNLoginView.h
// XNMVPDemo
//
// Created by Dandre on 2018/3/12.
// Copyright © 2018年 Dandre. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol XNLoginView <NSObject>
- (void)onLoginResult:(NSString *)result;
@end
| 15.375 | 50 | 0.691057 |
283ad6c23a31a72a081cdc8638f3537756aa6993 | 3,172 | go | Go | plaid/model_transfer_sweep_status.go | visor-tax/plaid-go | e48373f735fba8dfd1ddaa1984c338c7e95f3c0e | [
"MIT"
] | null | null | null | plaid/model_transfer_sweep_status.go | visor-tax/plaid-go | e48373f735fba8dfd1ddaa1984c338c7e95f3c0e | [
"MIT"
] | null | null | null | plaid/model_transfer_sweep_status.go | visor-tax/plaid-go | e48373f735fba8dfd1ddaa1984c338c7e95f3c0e | [
"MIT"
] | null | null | null | /*
* The Plaid API
*
* The Plaid REST API. Please see https://plaid.com/docs/api for more details.
*
* API version: 2020-09-14_1.54.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package plaid
import (
"encoding/json"
"fmt"
)
// TransferSweepStatus The status of the sweep for the transfer. `unswept`: The transfer hasn't been swept yet. `swept`: The transfer was swept to the sweep account. `reverse_swept`: The transfer was reversed, funds were pulled back or pushed back to the sweep account. `null`: The transfer will never be swept (e.g. if the transfer is cancelled or reversed before being swept)
type TransferSweepStatus string
// List of TransferSweepStatus
const (
TRANSFERSWEEPSTATUS_NULL TransferSweepStatus = "null"
TRANSFERSWEEPSTATUS_UNSWEPT TransferSweepStatus = "unswept"
TRANSFERSWEEPSTATUS_SWEPT TransferSweepStatus = "swept"
TRANSFERSWEEPSTATUS_REVERSE_SWEPT TransferSweepStatus = "reverse_swept"
)
var allowedTransferSweepStatusEnumValues = []TransferSweepStatus{
"null",
"unswept",
"swept",
"reverse_swept",
}
func (v *TransferSweepStatus) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := TransferSweepStatus(value)
for _, existing := range allowedTransferSweepStatusEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid TransferSweepStatus", value)
}
// NewTransferSweepStatusFromValue returns a pointer to a valid TransferSweepStatus
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewTransferSweepStatusFromValue(v string) (*TransferSweepStatus, error) {
ev := TransferSweepStatus(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for TransferSweepStatus: valid values are %v", v, allowedTransferSweepStatusEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v TransferSweepStatus) IsValid() bool {
for _, existing := range allowedTransferSweepStatusEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to TransferSweepStatus value
func (v TransferSweepStatus) Ptr() *TransferSweepStatus {
return &v
}
type NullableTransferSweepStatus struct {
value *TransferSweepStatus
isSet bool
}
func (v NullableTransferSweepStatus) Get() *TransferSweepStatus {
return v.value
}
func (v *NullableTransferSweepStatus) Set(val *TransferSweepStatus) {
v.value = val
v.isSet = true
}
func (v NullableTransferSweepStatus) IsSet() bool {
return v.isSet
}
func (v *NullableTransferSweepStatus) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTransferSweepStatus(val *TransferSweepStatus) *NullableTransferSweepStatus {
return &NullableTransferSweepStatus{value: val, isSet: true}
}
func (v NullableTransferSweepStatus) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTransferSweepStatus) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
| 27.582609 | 377 | 0.756936 |
f93f289d58aa54e8b7041f471f2ed014599c493d | 291 | lua | Lua | Data/Resources/Materials/default_skybox_mat.lua | guimeixen/Engine | fcea39d2099b613b32b20462586e1c932bbb24fc | [
"MIT"
] | null | null | null | Data/Resources/Materials/default_skybox_mat.lua | guimeixen/Engine | fcea39d2099b613b32b20462586e1c932bbb24fc | [
"MIT"
] | 17 | 2021-03-12T18:19:07.000Z | 2021-08-06T21:25:35.000Z | Data/Resources/Materials/default_skybox_mat.lua | guimeixen/Engine | fcea39d2099b613b32b20462586e1c932bbb24fc | [
"MIT"
] | null | null | null | default_skybox_mat =
{
passes =
{
base =
{
shader="skybox",
frontFace="ccw",
cullface="front",
depthFunc="lequal",
--depthWrite="false"
}
},
resources =
{
skybox =
{
resType="textureCube",
uv="clamp_to_edge",
alpha=false,
useMipMaps=false
}
}
} | 12.125 | 25 | 0.57732 |
a0a0ac50580faf7190eaa46e8392988dba12e714 | 1,236 | sql | SQL | wqf-web/src/main/resources/dataBase.sql | 17602151495/fanfan | 86985b4239918940e6a9f95a451e129da27e1b65 | [
"MIT"
] | null | null | null | wqf-web/src/main/resources/dataBase.sql | 17602151495/fanfan | 86985b4239918940e6a9f95a451e129da27e1b65 | [
"MIT"
] | null | null | null | wqf-web/src/main/resources/dataBase.sql | 17602151495/fanfan | 86985b4239918940e6a9f95a451e129da27e1b65 | [
"MIT"
] | 1 | 2019-04-15T13:32:29.000Z | 2019-04-15T13:32:29.000Z | -- 报关-终端报文信息表 @author Zeyee --
DROP TABLE IF EXISTS apply_terminal;
CREATE TABLE apply_terminal
(
created_by BIGINT(20) NOT NULL COMMENT '创建人',
created_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
updated_by BIGINT(20) NOT NULL COMMENT '修改人',
updated_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
ver VARCHAR(3) NOT NULL COMMENT '版本',
teminal_id VARCHAR(32) NOT NULL COMMENT '唯一编码',
trans_post_id VARCHAR(32) NOT NULL COMMENT '传输报文id',
id BIGINT(20) AUTO_INCREMENT NOT NULL COMMENT '主键id,自增',
PRIMARY KEY(id)
)ENGINE=INNODB DEFAULT CHARSET=utf8 COMMENT='报关-终端报文表';
-- end --
-- 报关-传输报文信息表 @author Zeyee --
DROP TABLE IF EXISTS apply_transport;
CREATE TABLE apply_transport
(
created_by BIGINT(20) NOT NULL COMMENT'创建人',
created_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT'创建时间',
updated_by BIGINT(20) NOT NULL COMMENT'修改人',
updated_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT'修改时间',
ver VARCHAR(3) NOT NULL COMMENT '版本',
transpost_id VARCHAR(32) NOT NULL COMMENT '唯一编码',
id BIGINT(32) AUTO_INCREMENT NOT NULL COMMENT '主键id,自增',
PRIMARY KEY(id)
)ENGINE=INNODB DEFAULT CHARSET=utf8 COMMENT='报关-传输报文表';
-- end -- | 41.2 | 101 | 0.788026 |
c9b51bda5672fc128b8539a4a4ab2a43b535adc3 | 11,654 | asm | Assembly | s2/music-improved/8D - SCZ.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 9 | 2017-10-09T20:28:45.000Z | 2021-06-29T21:19:20.000Z | s2/music-improved/8D - SCZ.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 12 | 2018-08-01T13:52:20.000Z | 2022-02-21T02:19:37.000Z | s2/music-improved/8D - SCZ.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 2 | 2018-02-17T19:50:36.000Z | 2019-10-30T19:28:06.000Z | SCZ_Header:
smpsHeaderStartSong 2
smpsHeaderVoice SCZ_Voices
smpsHeaderChan $06, $03
smpsHeaderTempo $01, $5B
smpsHeaderDAC SCZ_DAC
smpsHeaderFM SCZ_FM1, $F4, $12
smpsHeaderFM SCZ_FM2, $E8, $0E
smpsHeaderFM SCZ_FM3, $F4, $09
smpsHeaderFM SCZ_FM4, $F4, $10
smpsHeaderFM SCZ_FM5, $DC, $24
smpsHeaderPSG SCZ_PSG1, $F4, $0C, $00, $00
smpsHeaderPSG SCZ_PSG2, $F9, $09, $00, $00
smpsHeaderPSG SCZ_PSG3, $00, $04, $00, fTone_04
; FM4 Data
SCZ_FM4:
smpsSetvoice $03
SCZ_Loop03:
smpsCall SCZ_Call07
smpsLoop $00, $02, SCZ_Loop03
SCZ_Jump03:
smpsPan panRight, $00
smpsAlterNote $FE
smpsAlterVol $14
smpsAlterPitch $E8
smpsSetvoice $04
smpsCall SCZ_Call05
smpsSetvoice $03
smpsAlterPitch $18
smpsAlterVol $EC
smpsAlterNote $00
smpsPan panCenter, $00
SCZ_Loop04:
smpsCall SCZ_Call07
smpsLoop $00, $08, SCZ_Loop04
smpsJump SCZ_Jump03
SCZ_Call07:
dc.b nB6, $06, nG6, nA6, nD6, nB6, nG6, nA6, nD6
smpsReturn
; FM5 Data
SCZ_FM5:
smpsSetvoice $04
dc.b nRst, $60
SCZ_Jump02:
smpsPan panLeft, $00
smpsAlterNote $02
smpsCall SCZ_Call05
smpsAlterNote $00
smpsPan panCenter, $00
smpsAlterVol $FB
smpsCall SCZ_Call06
dc.b nD6, $03, $03, $06, smpsNoAttack
smpsAlterVol $02
dc.b $02, smpsNoAttack
smpsAlterVol $02
dc.b $02, smpsNoAttack
smpsAlterVol $02
dc.b $02, nRst, $12, nC6, $06, nD6
smpsAlterVol $FA
smpsCall SCZ_Call06
dc.b nD6, $30
smpsAlterVol $05
smpsJump SCZ_Jump02
SCZ_Call05:
dc.b nG6, $30, nD6
smpsLoop $00, $04, SCZ_Call05
smpsReturn
SCZ_Call06:
dc.b nG6, $03, $03, $06, smpsNoAttack
smpsAlterVol $02
dc.b $02, smpsNoAttack
smpsAlterVol $02
dc.b $02, smpsNoAttack
smpsAlterVol $02
dc.b $02, nRst, $1E
smpsAlterVol $FA
dc.b nD6, $03, $03, $06, smpsNoAttack
smpsAlterVol $02
dc.b $02, smpsNoAttack
smpsAlterVol $02
dc.b $02, smpsNoAttack
smpsAlterVol $02
dc.b $02, nRst, $1E
smpsAlterVol $FA
dc.b nC6, $03, $03, $06, smpsNoAttack
smpsAlterVol $02
dc.b $02, smpsNoAttack
smpsAlterVol $02
dc.b $02, smpsNoAttack
smpsAlterVol $02
dc.b $02, nRst, $1E
smpsAlterVol $FA
smpsReturn
; FM1 Data
SCZ_FM1:
smpsSetvoice $06
dc.b nRst, $06, nG4, $03, nA4, nG4, $0C, nB4, $03, nC5, nB4, $0C
dc.b nD5, $03, nE5, nD5, $30
SCZ_Jump01:
dc.b nRst, $12, nE6, $03, nFs6, nG6, $06, nFs6, nE6, nD6, nB5, $30
dc.b nRst, $12, nE6, $03, nG6, nA6, $06, nG6, nFs6, nE6, nD6, $03
dc.b nE6, nD6, nB5, $27, nRst, $12, nE6, $03, nG6, nFs6, $06, nD6
dc.b nB5, nE6, nD6, $30, nRst, $12, nE6, $03, nG6, nA6, $06, nG6
dc.b nFs6, nE6, nD6, $03, nE6, nD6, nB5, $27
smpsSetvoice $00
smpsCall SCZ_Call04
dc.b nB4, $0C, nG4, nA4, nG4, $06, nA4
smpsCall SCZ_Call04
dc.b nB4, $30
smpsJump SCZ_Jump01
SCZ_Call04:
dc.b nB4, $0C, nG4, nA4, nD4
smpsLoop $00, $03, SCZ_Call04
smpsReturn
; FM3 Data
SCZ_FM3:
smpsAlterNote $02
smpsSetvoice $01
dc.b nRst, $06, nB4, $03, nC5, nB4, $0C, nD5, $03, nE5, nD5, $0C
dc.b nG5, $03, nA5, nG5, $30
SCZ_Jump00:
smpsSetvoice $05
smpsAlterVol $12
dc.b nRst, $12, nE6, $03, nFs6, nG6, $06, nFs6, nE6, nD6, nB5, $18
smpsSetvoice $01
smpsAlterVol $EE
smpsNoteFill $0B
dc.b nG5, $06, nD5, nE5, $03, nG5, $06
smpsNoteFill $00
dc.b $15
smpsSetvoice $05
smpsAlterVol $12
dc.b nE6, $03, nG6, nA6, $06, nG6, nFs6, nE6, nD6, $03, nE6, nD6
dc.b nB5, $0F
smpsSetvoice $01
smpsAlterVol $EE
dc.b nA5, $0C, nB5, nG5, $12
smpsSetvoice $05
smpsAlterVol $12
dc.b nE6, $03, nG6, nFs6, $06, nD6, nB5, nE6, nD6, $18
smpsSetvoice $01
smpsAlterVol $EE
smpsNoteFill $0B
dc.b nG5, $06, nD5, nE5, $03, nG5, $06
smpsNoteFill $00
dc.b $15
smpsSetvoice $05
smpsAlterVol $12
dc.b nE6, $03, nG6, nA6, $06, nG6, nFs6, nE6, nD6, $03, nE6
smpsSetvoice $01
smpsAlterVol $EE
dc.b nB4, $03, nC5, nB4, $0C, nD5, $03, nE5, nD5, $0C, nG5, $03
dc.b nA5
smpsAlterVol $FC
smpsCall SCZ_Call03
dc.b nG5, $2A, nA5, $03, nB5, $33
smpsCall SCZ_Call03
dc.b nG5, $24, nA5, $0C, nG5, $30
smpsAlterVol $04
smpsJump SCZ_Jump00
SCZ_Call03:
dc.b nRst, $12, nG5, $03, nA5, nB5, $0C, nC6, $03, nB5, nC6, nD6
dc.b $27, nE6, $0C
smpsReturn
; FM2 Data
SCZ_FM2:
smpsSetvoice $02
dc.b nRst, $51, nG3, $03, nA3, $06, nB3
SCZ_Loop02:
dc.b nC4, $03, $0F, $03, $0C, nG4, $03, nA4, $06, nG4, nG3, $03
dc.b $0F, $0F, nD4, $03, nE4, $06, nD4
smpsLoop $00, $04, SCZ_Loop02
smpsCall SCZ_Call02
dc.b nA3, $03, $0F, $0C, $09, $09, nG3, $03, $0F, $0C, $06, nA3
dc.b nB3
smpsCall SCZ_Call02
dc.b nA3, $03, $0F, $0C, $06, nB3, nA3, nG3, $30
smpsJump SCZ_Loop02
SCZ_Call02:
dc.b nC4, $03, $0F, $0C, $09, $09, nB3, $03, nB3, $0F, $0C, $06
dc.b nC4, nB3
smpsReturn
; DAC Data
SCZ_DAC:
smpsCall SCZ_Call00
smpsLoop $00, $02, SCZ_DAC
SCZ_Loop00:
smpsCall SCZ_Call00
smpsLoop $00, $03, SCZ_Loop00
smpsCall SCZ_Call01
smpsLoop $01, $03, SCZ_Loop00
SCZ_Loop01:
smpsCall SCZ_Call00
smpsLoop $00, $03, SCZ_Loop01
dc.b dKick, $0C, nRst, nRst, dSnare, $06, dSnare, $03, dSnare
smpsJump SCZ_Loop00
SCZ_Call00:
dc.b dKick, $03, dKick, nRst, $06, dSnare, dKick, nRst, dKick, dSnare, $03, dKick
dc.b $09
smpsReturn
SCZ_Call01:
dc.b dKick, $03, dKick, nRst, $06, dSnare, dKick, nRst, dKick, dSnare, dSnare, $03
dc.b dSnare
smpsReturn
; PSG1 Data
SCZ_PSG1:
dc.b nRst, $60
SCZ_Loop05:
dc.b nG4, $30, nFs4
smpsLoop $00, $04, SCZ_Loop05
smpsPSGAlterVol $FE
dc.b nG4, $03, $03, $06, nRst, $24, nFs4, $03, $03, $06, nRst, $24
dc.b nE4, $03, $03, $06, nRst, $24, nD4, $03, $03, $06, nRst, $18
dc.b nE4, $06, nFs4, nG4, $03, $03, $06, nRst, $24, nFs4, $03, $03
dc.b $06, nRst, $24, nE4, $03, $03, $06, nRst, $24, nFs4, $30
smpsPSGAlterVol $02
smpsJump SCZ_Loop05
; PSG2 Data
SCZ_PSG2:
dc.b nRst, $60
smpsPSGvoice fTone_08
SCZ_Jump05:
dc.b nRst, $12, nD6, $03, nD6, nD6, $06, nD6, nD6, nD6, nD6, $30
dc.b nRst, $12, nD6, $03, nD6, nD6, $06, nD6, nD6, nD6, nD6, $03
dc.b nD6, nD6, nD6, $27, nRst, $12, nD6, $03, nD6, nD6, $06, nD6
dc.b nD6, nD6, nD6, $30, nRst, $12, nD6, $03, nD6, nD6, $06, nD6
dc.b nD6, nD6, nD6, $03, nD6, nD6, nD6, $27
smpsPSGAlterVol $01
dc.b nB4, $03, $03, $06, nRst, $24, nA4, $03, $03, $06, nRst, $24
dc.b nG4, $03, $03, $06, nRst, $24, nFs4, $03, $03, $06, nRst, $18
dc.b nG4, $06, nA4, nB4, $03, $03, $06, nRst, $24, nA4, $03, $03
dc.b $06, nRst, $24, nG4, $03, $03, $06, nRst, $24, nD4, $30
smpsPSGAlterVol $FF
smpsJump SCZ_Jump05
; PSG3 Data
SCZ_PSG3:
smpsPSGform $E7
smpsNoteFill $09
SCZ_Jump04:
dc.b nMaxPSG, $0C
smpsJump SCZ_Jump04
SCZ_Voices:
; Voice $00
; $02
; $62, $01, $34, $01, $59, $59, $59, $51, $04, $04, $04, $07
; $01, $01, $01, $01, $12, $12, $12, $17, $1E, $19, $25, $80
smpsVcAlgorithm $02
smpsVcFeedback $00
smpsVcUnusedBits $00
smpsVcDetune $00, $03, $00, $06
smpsVcCoarseFreq $01, $04, $01, $02
smpsVcRateScale $01, $01, $01, $01
smpsVcAttackRate $11, $19, $19, $19
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $07, $04, $04, $04
smpsVcDecayRate2 $01, $01, $01, $01
smpsVcDecayLevel $01, $01, $01, $01
smpsVcReleaseRate $07, $02, $02, $02
smpsVcTotalLevel $00, $25, $19, $1E
; Voice $01
; $3A
; $11, $1A, $00, $11, $89, $59, $4F, $4F, $0A, $0D, $06, $09
; $00, $00, $00, $01, $1F, $FF, $0F, $5F, $20, $2E, $3B, $80
smpsVcAlgorithm $02
smpsVcFeedback $07
smpsVcUnusedBits $00
smpsVcDetune $01, $00, $01, $01
smpsVcCoarseFreq $01, $00, $0A, $01
smpsVcRateScale $01, $01, $01, $02
smpsVcAttackRate $0F, $0F, $19, $09
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $09, $06, $0D, $0A
smpsVcDecayRate2 $01, $00, $00, $00
smpsVcDecayLevel $05, $00, $0F, $01
smpsVcReleaseRate $0F, $0F, $0F, $0F
smpsVcTotalLevel $00, $3B, $2E, $20
; Voice $02
; $3D
; $01, $42, $02, $22, $1F, $1F, $1F, $1F, $07, $00, $00, $00
; $00, $0E, $0E, $0E, $24, $0F, $0F, $0F, $1C, $89, $89, $89
smpsVcAlgorithm $05
smpsVcFeedback $07
smpsVcUnusedBits $00
smpsVcDetune $02, $00, $04, $00
smpsVcCoarseFreq $02, $02, $02, $01
smpsVcRateScale $00, $00, $00, $00
smpsVcAttackRate $1F, $1F, $1F, $1F
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $00, $00, $00, $07
smpsVcDecayRate2 $0E, $0E, $0E, $00
smpsVcDecayLevel $00, $00, $00, $02
smpsVcReleaseRate $0F, $0F, $0F, $04
smpsVcTotalLevel $09, $09, $09, $1C
; Voice $03
; $04
; $57, $07, $74, $54, $1F, $1B, $1F, $1F, $00, $00, $00, $00
; $06, $0A, $00, $0D, $00, $0F, $00, $0F, $1A, $98, $25, $8F
smpsVcAlgorithm $04
smpsVcFeedback $00
smpsVcUnusedBits $00
smpsVcDetune $05, $07, $00, $05
smpsVcCoarseFreq $04, $04, $07, $07
smpsVcRateScale $00, $00, $00, $00
smpsVcAttackRate $1F, $1F, $1B, $1F
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $00, $00, $00, $00
smpsVcDecayRate2 $0D, $00, $0A, $06
smpsVcDecayLevel $00, $00, $00, $00
smpsVcReleaseRate $0F, $00, $0F, $00
smpsVcTotalLevel $0F, $25, $18, $1A
; Voice $04
; $07
; $06, $7C, $75, $0A, $1F, $1F, $1F, $1F, $00, $00, $00, $00
; $00, $00, $00, $00, $0F, $0F, $0F, $0F, $80, $80, $80, $80
smpsVcAlgorithm $07
smpsVcFeedback $00
smpsVcUnusedBits $00
smpsVcDetune $00, $07, $07, $00
smpsVcCoarseFreq $0A, $05, $0C, $06
smpsVcRateScale $00, $00, $00, $00
smpsVcAttackRate $1F, $1F, $1F, $1F
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $00, $00, $00, $00
smpsVcDecayRate2 $00, $00, $00, $00
smpsVcDecayLevel $00, $00, $00, $00
smpsVcReleaseRate $0F, $0F, $0F, $0F
smpsVcTotalLevel $00, $00, $00, $00
; Voice $05
; $01
; $05, $03, $05, $01, $0F, $0E, $CE, $10, $05, $02, $0B, $09
; $08, $03, $00, $0A, $FF, $3F, $0F, $FF, $23, $1A, $21, $83
smpsVcAlgorithm $01
smpsVcFeedback $00
smpsVcUnusedBits $00
smpsVcDetune $00, $00, $00, $00
smpsVcCoarseFreq $01, $05, $03, $05
smpsVcRateScale $00, $03, $00, $00
smpsVcAttackRate $10, $0E, $0E, $0F
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $09, $0B, $02, $05
smpsVcDecayRate2 $0A, $00, $03, $08
smpsVcDecayLevel $0F, $00, $03, $0F
smpsVcReleaseRate $0F, $0F, $0F, $0F
smpsVcTotalLevel $03, $21, $1A, $23
; Voice $06
; $3C
; $01, $02, $01, $02, $CF, $0D, $CF, $0C, $00, $08, $00, $08
; $00, $02, $00, $02, $02, $27, $02, $28, $1E, $80, $1F, $80
smpsVcAlgorithm $04
smpsVcFeedback $07
smpsVcUnusedBits $00
smpsVcDetune $00, $00, $00, $00
smpsVcCoarseFreq $02, $01, $02, $01
smpsVcRateScale $00, $03, $00, $03
smpsVcAttackRate $0C, $0F, $0D, $0F
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $08, $00, $08, $00
smpsVcDecayRate2 $02, $00, $02, $00
smpsVcDecayLevel $02, $00, $02, $00
smpsVcReleaseRate $08, $02, $07, $02
smpsVcTotalLevel $00, $1F, $00, $1E
| 29.135 | 83 | 0.5659 |
a5ce44252cdc860008627dd713d5305e6c0dd293 | 10,881 | lua | Lua | sims-2/coupled-hw/f1/f1-hw.lua | ammarhakim/ammar-simjournal | 85b64ddc9556f01a4fab37977864a7d878eac637 | [
"MIT",
"Unlicense"
] | 1 | 2019-12-19T16:21:13.000Z | 2019-12-19T16:21:13.000Z | sims-2/coupled-hw/f1/f1-hw.lua | ammarhakim/ammar-simjournal | 85b64ddc9556f01a4fab37977864a7d878eac637 | [
"MIT",
"Unlicense"
] | null | null | null | sims-2/coupled-hw/f1/f1-hw.lua | ammarhakim/ammar-simjournal | 85b64ddc9556f01a4fab37977864a7d878eac637 | [
"MIT",
"Unlicense"
] | 2 | 2020-01-08T06:23:33.000Z | 2020-01-08T07:06:50.000Z | -- Input file for Hasegawa-Wakatani
----------------------------------
-- Problem dependent parameters --
----------------------------------
polyOrder = 2
coupleCoeff = 0.3 -- adiabacity coefficient
cfl = 0.5/(2*polyOrder+1)
LX, LY = 40, 40 -- domain size
NX, NY = 32, 32 -- number of cells
------------------------------------------------
-- COMPUTATIONAL DOMAIN, DATA STRUCTURE, ETC. --
------------------------------------------------
grid = Grid.RectCart2D {
lower = {-LX/2, -LY/2},
upper = {LX/2, LY/2},
cells = {NX, NY},
periodicDirs = {0, 1},
}
basis = NodalFiniteElement2D.SerendipityElement {
onGrid = grid,
polyOrder = polyOrder,
}
-- vorticity
chi = DataStruct.Field2D {
onGrid = grid,
numComponents = basis:numNodes(),
ghost = {1, 1},
}
-- extra fields for performing RK updates
chiNew = DataStruct.Field2D {
onGrid = grid,
numComponents = basis:numNodes(),
ghost = {1, 1},
}
chi1 = DataStruct.Field2D {
onGrid = grid,
numComponents = basis:numNodes(),
ghost = {1, 1},
}
chiDup = DataStruct.Field2D {
onGrid = grid,
numComponents = basis:numNodes(),
ghost = {1, 1},
}
-- number density fluctuations
numDens = DataStruct.Field2D {
onGrid = grid,
numComponents = basis:numNodes(),
ghost = {1, 1},
}
-- extra fields for performing RK updates
numDensNew = DataStruct.Field2D {
onGrid = grid,
numComponents = basis:numNodes(),
ghost = {1, 1},
}
numDens1 = DataStruct.Field2D {
onGrid = grid,
numComponents = basis:numNodes(),
ghost = {1, 1},
}
numDensDup = DataStruct.Field2D {
onGrid = grid,
numComponents = basis:numNodes(),
ghost = {1, 1},
}
-- background number density (remains fixed)
numDensBack = DataStruct.Field2D {
onGrid = grid,
numComponents = basis:numNodes(),
ghost = {1, 1},
}
-- total number density
numDensTotal = DataStruct.Field2D {
onGrid = grid,
numComponents = basis:numNodes(),
ghost = {1, 1},
}
-- Poisson source term
poissonSrc = DataStruct.Field2D {
onGrid = grid,
numComponents = basis:numNodes(),
ghost = {1, 1},
}
-- discontinuous field for potential (for use in source term)
phiDG = DataStruct.Field2D {
onGrid = grid,
numComponents = basis:numNodes(),
ghost = {1, 1},
}
phiDGDup = DataStruct.Field2D {
onGrid = grid,
numComponents = basis:numNodes(),
ghost = {1, 1},
}
--------------------------------
-- INITIAL CONDITION UPDATERS --
--------------------------------
function oneVortex(x,y,z)
local r1 = x^2 + y^2
local s = 2.0
return math.exp(-r1/s^2)
end
function chiVortex(x,y,z)
local r1 = x^2 + y^2
local s = 2.0
local beta = 0.1
return 4*(r1-s^2)*math.exp(-r1/s^2)/s^4
end
-- create updater to initialize vorticity
initChi = Updater.EvalOnNodes2D {
onGrid = grid,
basis = basis,
shareCommonNodes = false, -- In DG, common nodes are not shared
evaluate = function (x,y,z,t)
return -chiVortex(x,y,z)
end
}
initChi:setOut( {chi} )
initChi:advance(0.0)
-- create updater to initialize background density
initNumDensBack = Updater.EvalOnNodes2D {
onGrid = grid,
basis = basis,
shareCommonNodes = false, -- In DG, common nodes are not shared
evaluate = function (x,y,z,t)
return x
end
}
initNumDensBack:setOut( {numDensBack} )
initNumDensBack:advance(0.0)
-- create updater to number density
initNumDens = Updater.EvalOnNodes2D {
onGrid = grid,
basis = basis,
shareCommonNodes = false, -- In DG, common nodes are not shared
evaluate = function (x,y,z,t)
return oneVortex(x,y,z)
end
}
initNumDens:setOut( {numDens} )
initNumDens:advance(0.0) -- time is irrelevant
----------------------
-- EQUATION SOLVERS --
----------------------
-- updater for Poisson bracket
pbSlvr = Updater.PoissonBracket {
onGrid = grid,
basis = basis,
cfl = cfl,
fluxType = "upwind",
hamilNodesShared = false,
onlyIncrement = true,
}
-- updater to solve Poisson equation
poissonSlvr = Updater.FemPoisson2D {
onGrid = grid,
basis = basis,
sourceNodesShared = false, -- default true
solutionNodesShared = false, -- solution is discontinous
periodicDirs = {0, 1}
}
-- updater to initialize chi
copyCToD = Updater.CopyContToDisCont2D {
onGrid = grid,
basis = basis,
}
-------------------------
-- Boundary Conditions --
-------------------------
-- function to apply copy boundary conditions
function applyBc(fld)
fld:sync()
end
-- apply BCs
applyBc(chi)
applyBc(numDens)
applyBc(phiDG)
----------------------
-- SOLVER UTILITIES --
----------------------
-- generic function to run an updater
function runUpdater(updater, currTime, timeStep, inpFlds, outFlds)
updater:setCurrTime(currTime)
if inpFlds then
updater:setIn(inpFlds)
end
if outFlds then
updater:setOut(outFlds)
end
return updater:advance(currTime+timeStep)
end
poissonSolveTime = 0.0 -- time spent in Poisson solve
-- function to solve Poisson equation
function solvePoissonEqn(srcFld, outFld)
local t1 = os.time() -- begin timer
-- set poissonSrc <- -srcFld
poissonSrc:combine(-1.0, srcFld)
local s, dt, msg = runUpdater(poissonSlvr, 0.0, 0.0, {poissonSrc}, {outFld})
if (s == false) then
Lucee.logError(string.format("Poisson solver failed to converge (%s)", msg))
end
applyBc(outFld)
poissonSolveTime = poissonSolveTime + os.difftime(os.time(), t1)
end
-- function to solve vorticity equations
function solveVorticityEqn(t, dt, vortIn, vortOut, phiIn)
local pbStatus, pbDt = runUpdater(pbSlvr, t, dt, {vortIn, phiIn}, {vortOut})
vortOut:scale(dt)
vortOut:accumulate(1.0, vortIn)
return pbStatus, pbDt
end
-- function to solve number density equations
function solveNumDensEqn(t, dt, numDensIn, numDensOut, phiIn)
-- accumulate background number density
numDensTotal:combine(1.0, numDensBack, 1.0, numDensIn)
local pbStatus, pbDt = runUpdater(pbSlvr, t, dt, {numDensTotal, phiIn}, {numDensOut})
numDensOut:scale(dt)
numDensOut:accumulate(1.0, numDensIn)
return pbStatus, pbDt
end
-- function to copy potential to DG field
function copyPotential(tCurr, dt, cgIn, dgOut)
copyCToD:setCurrTime(tCurr)
copyCToD:setIn( {cgIn} )
copyCToD:setOut( {dgOut} )
copyCToD:advance(tCurr+dt)
end
-- solve Poisson equation to determine initial potential
solvePoissonEqn(chi, phiDG)
-- function to compute diagnostics
function calcDiagnostics(tc, dt)
end
-- function to take a time-step using SSP-RK3 time-stepping scheme
function rk3(tCurr, myDt)
-- RK stage 1
solveNumDensEqn(tCurr, myDt, numDens, numDens1, phiDG)
local myStatus, myDtSuggested = solveVorticityEqn(tCurr, myDt, chi, chi1, phiDG)
-- accumulate source term into updated solutions
numDens1:accumulate(-coupleCoeff*myDt, phiDG, -coupleCoeff*myDt, numDens)
chi1:accumulate(-coupleCoeff*myDt, phiDG, -coupleCoeff*myDt, numDens)
-- check if step failed and return immediately if it did
if (myStatus == false) then
return myStatus, myDtSuggested
end
-- apply BCs
applyBc(chi1)
applyBc(numDens1)
-- solve Poisson equation to determine Potential
solvePoissonEqn(chi1, phiDG)
-- RK stage 2
solveNumDensEqn(tCurr, myDt, numDens1, numDensNew, phiDG)
local myStatus, myDtSuggested = solveVorticityEqn(tCurr, myDt, chi1, chiNew, phiDG)
-- accumulate source term into updated solutions
numDensNew:accumulate(-coupleCoeff*myDt, phiDG, -coupleCoeff*myDt, numDens1)
chiNew:accumulate(-coupleCoeff*myDt, phiDG, -coupleCoeff*myDt, numDens1)
-- check if step failed and return immediately if it did
if (myStatus == false) then
return myStatus, myDtSuggested
end
chi1:combine(3.0/4.0, chi, 1.0/4.0, chiNew)
numDens1:combine(3.0/4.0, numDens, 1.0/4.0, numDensNew)
-- apply BCs
applyBc(chi1)
applyBc(numDens1)
-- solve Poisson equation to determine Potential
solvePoissonEqn(chi1, phiDG)
-- RK stage 3
solveNumDensEqn(tCurr, myDt, numDens1, numDensNew, phiDG)
local myStatus, myDtSuggested = solveVorticityEqn(tCurr, myDt, chi1, chiNew, phiDG)
-- accumulate source term into updated solutions
numDensNew:accumulate(-coupleCoeff*myDt, phiDG, -coupleCoeff*myDt, numDens1)
chiNew:accumulate(-coupleCoeff*myDt, phiDG, -coupleCoeff*myDt, numDens1)
-- check if step failed and return immediately if it did
if (myStatus == false) then
return myStatus, myDtSuggested
end
chi1:combine(1.0/3.0, chi, 2.0/3.0, chiNew)
numDens1:combine(1.0/3.0, numDens, 2.0/3.0, numDensNew)
-- apply BCs
applyBc(chi1)
applyBc(numDens1)
-- copy over solution
chi:copy(chi1)
numDens:copy(numDens1)
-- solve Poisson equation to determine Potential
solvePoissonEqn(chi, phiDG)
return myStatus, myDtSuggested
end
-- function to advance solution from tStart to tEnd
function advanceFrame(tStart, tEnd, initDt)
local step = 1
local tCurr = tStart
local myDt = initDt
local lastGood = 0.0
-- main loop
while tCurr<=tEnd do
-- copy chi over
chiDup:copy(chi)
phiDGDup:copy(phiDG)
numDensDup:copy(numDens)
-- if needed adjust dt to hit tEnd exactly
if (tCurr+myDt > tEnd) then
myDt = tEnd-tCurr
end
Lucee.logInfo (string.format("Taking step %d at time %g with dt %g", step, tCurr, myDt))
-- take a time-step
local advStatus, advDtSuggested = rk3(tCurr, myDt)
lastGood = advDtSuggested
if (advStatus == false) then
-- time-step too large
Lucee.logInfo (string.format("** Time step %g too large! Will retake with dt %g", myDt, advDtSuggested))
-- copy in case current solutions were messed up
chi:copy(chiDup)
phiDG:copy(phiDGDup)
numDens:copy(numDensDup)
myDt = advDtSuggested
else
-- compute diagnostics
calcDiagnostics(tCurr, myDt)
tCurr = tCurr + myDt
myDt = advDtSuggested
step = step + 1
-- check if done
if (tCurr >= tEnd) then
break
end
end
end
return lastGood
end
-- write out data
function writeFields(frame)
phiDG:write( string.format("phi_%d.h5", frame) )
chi:write( string.format("chi_%d.h5", frame) )
numDens:write( string.format("numDens_%d.h5", frame) )
end
-- write out initial conditions
writeFields(0)
-- parameters to control time-stepping
tStart = 0.0
tEnd = 100.0
dtSuggested = 0.1*tEnd -- initial time-step to use (will be adjusted)
nFrames = 10
tFrame = (tEnd-tStart)/nFrames -- time between frames
tCurr = tStart
for frame = 1, nFrames do
Lucee.logInfo (string.format("-- Advancing solution from %g to %g", tCurr, tCurr+tFrame))
-- advance solution between frames
retDtSuggested = advanceFrame(tCurr, tCurr+tFrame, dtSuggested)
dtSuggested = retDtSuggested
-- write out data
writeFields(frame)
tCurr = tCurr+tFrame
Lucee.logInfo ("")
end
Lucee.logInfo (string.format("Poisson solves took %g seconds", poissonSolveTime))
| 25.907143 | 106 | 0.667586 |
62615eb4ff0753e24d2dcf7a6b0a11d3b93a3224 | 2,392 | rs | Rust | xngin-plan/src/scope.rs | jiangzhe/xngin | 57f3e2070a3bf52dbfda28750038302e330eca12 | [
"Apache-2.0",
"MIT"
] | 97 | 2022-01-17T06:10:25.000Z | 2022-03-28T02:27:51.000Z | xngin-plan/src/scope.rs | jiangzhe/xngin | 57f3e2070a3bf52dbfda28750038302e330eca12 | [
"Apache-2.0",
"MIT"
] | 90 | 2022-01-13T23:49:49.000Z | 2022-03-27T07:23:30.000Z | xngin-plan/src/scope.rs | jiangzhe/xngin | 57f3e2070a3bf52dbfda28750038302e330eca12 | [
"Apache-2.0",
"MIT"
] | null | null | null | use crate::alias::QueryAliases;
use fnv::FnvHashSet;
use indexmap::IndexMap;
use smol_str::SmolStr;
use std::ops::{Deref, DerefMut};
use xngin_expr::{Expr, QueryID};
// Scopes is stack-like environment for query blocks.
#[derive(Debug, Default)]
pub struct Scopes(Vec<Scope>);
impl Deref for Scopes {
type Target = [Scope];
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl DerefMut for Scopes {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl Scopes {
#[inline]
pub fn curr_scope(&self) -> &Scope {
self.0.last().unwrap()
}
#[inline]
pub fn curr_scope_mut(&mut self) -> &mut Scope {
self.0.last_mut().unwrap()
}
#[inline]
pub fn push(&mut self, scope: Scope) {
self.0.push(scope)
}
#[inline]
pub fn pop(&mut self) -> Option<Scope> {
self.0.pop()
}
}
/// Scope represents the namespace of query block.
/// There are two alias tables:
/// 1. table aliases
/// 2. column aliases
#[derive(Debug, Clone, Default)]
pub struct Scope {
/// CTE aliases will only contain row and subquery.
pub cte_aliases: QueryAliases,
/// Query aliases will only contain row and subqueries.
/// The source is FROM clause.
/// Row and derived table remain the same.
/// Any table present in FROM clause, will be converted to
/// a simple query automatically.
/// The converted query has a Proj operator upon Table operator,
/// and no other operator or query involved.
pub query_aliases: QueryAliases,
// output column list
// pub out_cols: Vec<(Expr, SmolStr)>,
// if set to true, unknown identifier can be passed to
// outer scope for search.
pub transitive: bool,
// Correlated variables in current scope.
pub cor_vars: FnvHashSet<(QueryID, u32)>,
// Correlated columns in current scope.
pub cor_cols: Vec<Expr>,
}
impl Scope {
#[inline]
pub fn new(transitive: bool) -> Self {
Scope {
transitive,
..Default::default()
}
}
#[inline]
pub fn restrict_from_aliases(&self, aliases: &[SmolStr]) -> QueryAliases {
let m: IndexMap<SmolStr, QueryID> = aliases
.iter()
.filter_map(|a| self.query_aliases.get(a).cloned().map(|p| (a.clone(), p)))
.collect();
QueryAliases::new(m)
}
}
| 25.72043 | 87 | 0.611622 |
4b2f7a87c4093fe9d143645688fc30e9f5375f5e | 1,418 | html | HTML | templates/main.html | abh1-ja1n/Lecture-Scheduling-web-app- | d200bafc14355588628790ae52bf1046b28ada41 | [
"MIT"
] | null | null | null | templates/main.html | abh1-ja1n/Lecture-Scheduling-web-app- | d200bafc14355588628790ae52bf1046b28ada41 | [
"MIT"
] | null | null | null | templates/main.html | abh1-ja1n/Lecture-Scheduling-web-app- | d200bafc14355588628790ae52bf1046b28ada41 | [
"MIT"
] | 2 | 2020-01-12T16:13:57.000Z | 2022-01-06T11:13:30.000Z | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="../static/main.css">
<title>Lecture-Scheduler</title>
</head>
<style>
.header h1 a{
color: #2e4756;
text-decoration: none;
}
.header {
opacity: 0.8;
}
</style>
<body>
<div class="header">
<div class="drop-down">
<img class="logo" src="../static/table-icon-15.jpg">
<div class="dropdown-content">
<ul>
<li><a href="{{url_for('select')}}">Open</a></li>
<li><a href="#">Manage</a>
<ul>
<li><a href="{{url_for('slots')}}">Slots</a></li>
<li><a href="{{url_for('subjects')}}">Subjects</a></li>
<li><a href="{{url_for('teachers')}}">Teachers</a></li>
<li><a href="{{url_for('classes')}}">Classes</a></li>
</ul>
</li>
<li><a href="{{url_for('help')}}">Help</a></li>
</ul>
</div>
</div>
<h1><a href="{{url_for('index')}}">LECTURE SCHEDULER</a></h1>
</div>
{% block content %}
{% endblock %}
</body>
</html> | 30.826087 | 83 | 0.441467 |
b15defda811f5afb0d341ec5d3b1a364c7b7589c | 688 | dart | Dart | lib/services/friendly_cards_service.dart | mirkancal/friendly-cards | dd52105b732d42c67cd30f52499b6085e3efac91 | [
"MIT"
] | 2 | 2022-03-07T16:03:42.000Z | 2022-03-08T20:00:35.000Z | lib/services/friendly_cards_service.dart | mirkancal/friendly-cards | dd52105b732d42c67cd30f52499b6085e3efac91 | [
"MIT"
] | null | null | null | lib/services/friendly_cards_service.dart | mirkancal/friendly-cards | dd52105b732d42c67cd30f52499b6085e3efac91 | [
"MIT"
] | null | null | null | import 'dart:convert';
import 'package:flutter/services.dart';
import 'package:friendly_cards/models/friendly_card.dart';
import 'package:friendly_cards/repositories/friendly_cards_repository.dart';
class FriendlyCardsService {
final friendlyCardsRepository = FriendlyCardsRepository();
Future<List<FriendlyCard>> getFriendlyCards() async {
try {
final rawString =
await rootBundle.loadString('assets/friendly_cards.json');
final data = (json.decode(rawString) as List)..shuffle();
final friendlyCards = data.map((e) => FriendlyCard.fromJson(e)).toList();
return friendlyCards;
} catch (e) {
print(e);
return [];
}
}
}
| 27.52 | 79 | 0.702035 |
873e0a964029c5e5e9b97c9f9d82490c0cb76f41 | 1,166 | ps1 | PowerShell | Private/Write-UserCollections.ps1 | Skatterbrainz/CMHealthCheck | 8ddfa399798deba9797e0a7146f3eb332d16e2ae | [
"MIT"
] | 31 | 2017-11-02T19:11:21.000Z | 2021-05-27T22:14:47.000Z | Private/Write-UserCollections.ps1 | Skatterbrainz/CMHealthCheck | 8ddfa399798deba9797e0a7146f3eb332d16e2ae | [
"MIT"
] | 51 | 2017-11-18T06:14:51.000Z | 2021-11-18T14:30:35.000Z | Private/Write-UserCollections.ps1 | Skatterbrainz/CMHealthCheck | 8ddfa399798deba9797e0a7146f3eb332d16e2ae | [
"MIT"
] | 10 | 2018-11-04T06:18:00.000Z | 2020-10-28T07:16:31.000Z | function Write-UserCollections {
param (
[parameter(Mandatory)][string] $FileName,
[parameter(Mandatory)][string] $TableName,
[parameter()][string] $SiteCode,
[parameter()][int] $NumberOfDays,
[parameter()][string] $LogFile,
[parameter()][string] $ServerName,
[parameter()][bool] $ContinueOnError = $true
)
Write-Log -Message "(Write-UserCollections)" -LogFile $logfile
try {
$query = "select Name, CollectionID, Comment, MemberCount from v_Collection where CollectionType = 1 order by Name"
$colls = @(Invoke-DbaQuery -SqlInstance $ServerName -Database $SQLDBName -Query $query)
if ($null -eq $colls) { return }
$Fields = @("Name","CollectionID","Comment","MemberCount")
$collDetails = New-CmDataTable -TableName $tableName -Fields $Fields
foreach ($coll in $colls) {
$row = $collDetails.NewRow()
$row.Name = $coll.Name
$row.CollectionID = $coll.CollectionID
$row.Comment = $coll.Comment
$row.MemberCount = [int]($coll.MemberCount)
$collDetails.Rows.Add($row)
}
, $collDetails | Export-CliXml -Path ($filename)
}
catch {
Write-Log -Message "$($_.Exception.Message)" -Category Error -Severity 2
}
} | 37.612903 | 117 | 0.686964 |
05eba4988d058abf811ac59fe19e59579f3588fe | 368 | html | HTML | website/_includes/editors/tickets/day-delegate.html | shooking/owasp-summit-2017 | 3a058c846f127510bb34a53dfe72dbd02ea31e9b | [
"Apache-2.0"
] | 101 | 2016-12-28T17:00:20.000Z | 2022-03-10T18:49:13.000Z | website/_includes/editors/tickets/day-delegate.html | shooking/owasp-summit-2017 | 3a058c846f127510bb34a53dfe72dbd02ea31e9b | [
"Apache-2.0"
] | 301 | 2016-12-19T12:46:47.000Z | 2020-05-08T20:23:44.000Z | website/_includes/editors/tickets/day-delegate.html | shooking/owasp-summit-2017 | 3a058c846f127510bb34a53dfe72dbd02ea31e9b | [
"Apache-2.0"
] | 247 | 2016-12-19T16:02:18.000Z | 2021-02-27T12:02:14.000Z |
<div class="tickets">
<div class="participants-table">
<h1>{{ page.title }}<a href="/pages/for-editors">Back to Editor's pages</a></h1>{% assign names = site.data.mapped.lodges.day_delegates %}
<p>here is the list of the current day delegates {{ names }}</p>
<ul>{% for name in names %}
<li>{{ name }}</li> {% endfor %}
</ul>
</div>
</div> | 36.8 | 142 | 0.592391 |
6b336e3b204508c4a8fabf9aade2c0d37fcff39d | 1,936 | rs | Rust | bee-api/bee-rest-api/src/endpoints/path_params.rs | grtlr/bee | cf1c35fdf61e6ac1b2e19dd891a59c6aef223d7b | [
"Apache-2.0"
] | null | null | null | bee-api/bee-rest-api/src/endpoints/path_params.rs | grtlr/bee | cf1c35fdf61e6ac1b2e19dd891a59c6aef223d7b | [
"Apache-2.0"
] | null | null | null | bee-api/bee-rest-api/src/endpoints/path_params.rs | grtlr/bee | cf1c35fdf61e6ac1b2e19dd891a59c6aef223d7b | [
"Apache-2.0"
] | null | null | null | // Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0
use crate::endpoints::rejection::CustomRejection;
use bee_gossip::PeerId;
use bee_message::{milestone::MilestoneIndex, output::OutputId, payload::transaction::TransactionId, MessageId};
use warp::{reject, Filter, Rejection};
pub(super) fn output_id() -> impl Filter<Extract = (OutputId,), Error = Rejection> + Copy {
warp::path::param().and_then(|value: String| async move {
value
.parse::<OutputId>()
.map_err(|_| reject::custom(CustomRejection::BadRequest("invalid output id".to_string())))
})
}
pub(super) fn message_id() -> impl Filter<Extract = (MessageId,), Error = Rejection> + Copy {
warp::path::param().and_then(|value: String| async move {
value
.parse::<MessageId>()
.map_err(|_| reject::custom(CustomRejection::BadRequest("invalid message id".to_string())))
})
}
pub(super) fn transaction_id() -> impl Filter<Extract = (TransactionId,), Error = Rejection> + Copy {
warp::path::param().and_then(|value: String| async move {
value
.parse::<TransactionId>()
.map_err(|_| reject::custom(CustomRejection::BadRequest("invalid transaction id".to_string())))
})
}
pub(super) fn milestone_index() -> impl Filter<Extract = (MilestoneIndex,), Error = Rejection> + Copy {
warp::path::param().and_then(|value: String| async move {
value
.parse::<u32>()
.map_err(|_| reject::custom(CustomRejection::BadRequest("invalid milestone index".to_string())))
.map(MilestoneIndex)
})
}
pub(super) fn peer_id() -> impl Filter<Extract = (PeerId,), Error = Rejection> + Copy {
warp::path::param().and_then(|value: String| async move {
value
.parse::<PeerId>()
.map_err(|_| reject::custom(CustomRejection::BadRequest("invalid peer id".to_string())))
})
}
| 37.960784 | 111 | 0.63688 |
9027b7303dcde90cd0d6667320f6220bcb314fce | 1,221 | lua | Lua | scripts/zones/Misareaux_Coast/npcs/Spatial_Displacement.lua | PaulAnthonyReitz/topaz | ffa3a785f86ffdb2f6a5baf9895b649e3e3de006 | [
"FTL"
] | 6 | 2021-06-01T04:17:10.000Z | 2021-06-01T04:32:21.000Z | scripts/zones/Misareaux_Coast/npcs/Spatial_Displacement.lua | PaulAnthonyReitz/topaz | ffa3a785f86ffdb2f6a5baf9895b649e3e3de006 | [
"FTL"
] | 5 | 2020-04-10T19:33:53.000Z | 2021-06-27T17:50:05.000Z | scripts/zones/Misareaux_Coast/npcs/Spatial_Displacement.lua | PaulAnthonyReitz/topaz | ffa3a785f86ffdb2f6a5baf9895b649e3e3de006 | [
"FTL"
] | 2 | 2020-04-11T16:56:14.000Z | 2021-06-26T12:21:12.000Z | -----------------------------------
-- Area: Misareaux Coast
-- NPC: Spacial Displacement
-- Entrance to Riverne Site #A01 and #B01
-----------------------------------
require("scripts/globals/missions");
-----------------------------------
function onTrade(player,npc,trade)
end;
function onTrigger(player,npc)
if (player:hasCompletedMission(COP,tpz.mission.id.cop.SHELTERING_DOUBT)) then
player:startEvent(551); -- Access to Sites A & B
elseif (player:getCurrentMission(COP) == tpz.mission.id.cop.ANCIENT_VOWS and player:getCharVar("PromathiaStatus") == 1) then
player:startEvent(8);
else
player:startEvent(550); -- Access to Site A Only
end
end;
function onEventUpdate(player,csid,option)
end;
function onEventFinish(player,csid,option)
if (csid == 8) then
player:setCharVar("PromathiaStatus",2);
player:setPos(732.55,-32.5,-506.544,90,30); -- Go to Riverne #A01 {R}
elseif ((csid == 551 or csid == 550) and option == 1) then
player:setPos(732.55,-32.5,-506.544,90,30); -- Go to Riverne #A01 {R}
elseif (csid == 551 and option == 2) then
player:setPos(729.749,-20.319,407.153,90,29); -- Go to Riverne #B01 {R}
end;
end;
| 31.307692 | 128 | 0.609337 |
96ecd0e0418c165ddfad9c813726df290975a104 | 4,035 | cpp | C++ | AI heuristics/UVA10181-15-Puzzle Problem/Code.cpp | adelnobel/Training-for-ACM-ICPC-problems | 8030d24ab3ce1f50821b22647bf9195b41f932b1 | [
"MIT"
] | 1 | 2020-03-05T09:09:36.000Z | 2020-03-05T09:09:36.000Z | AI heuristics/UVA10181-15-Puzzle Problem/Code.cpp | adelnobel/Training-for-ACM-ICPC-problems | 8030d24ab3ce1f50821b22647bf9195b41f932b1 | [
"MIT"
] | null | null | null | AI heuristics/UVA10181-15-Puzzle Problem/Code.cpp | adelnobel/Training-for-ACM-ICPC-problems | 8030d24ab3ce1f50821b22647bf9195b41f932b1 | [
"MIT"
] | null | null | null | #include <vector>
#include <cstdio>
#include <cstring>
#include <queue>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <bitset>
#include <map>
#include <complex>
#include <ctime>
#include <numeric>
#include <set>
using namespace std;
typedef struct puzzle{
int configuration[4][4];
short cost;
short heuristic;
short last;
short parent;
short zPlace;
char path[50];
puzzle(){};
puzzle(short c, short h){
cost = c;
heuristic = h;
last = 0;
}
bool operator<(const puzzle& p) const{
return cost + heuristic > p.cost + p.heuristic;
}
}puzzle;
int dirX[4] = {0, -1, 0, 1};
int dirY[4] = {-1, 0, 1, 0};
char dirs[] = "LURD";
pair<int, int> goal[17];
int countInversions(int arr[], int len){
int tot = 0;
for(int i = 0; i < len; i++){
for(int j = i-1; j >= 0; j--){
if(arr[j] > arr[i]) tot++;
}
}
return tot;
}
bool isSolvable(puzzle puzz){
int linearArray[15];
int c = 0;
for(int i = 0; i < 4; i++){
for(int j = 0; j < 4; j++){
if(puzz.configuration[i][j] == 0) continue;
linearArray[c++] = puzz.configuration[i][j];
}
}
int inversions = countInversions(linearArray, 15);
int zeroRow = 4 - ((puzz.zPlace / 4));//Rows are 1 indexed!
if(zeroRow % 2 == 0){ //if the zero is in an even row!
return inversions % 2; //then inversions must be odd if solvable!
}else{
return inversions % 2 == 0;
}
}
short manhattnDistance(int puzzle[][4]){
short tot = 0;
for(int i = 0; i < 4; i++){
for(int j = 0; j < 4; j++){
tot += abs(i - goal[puzzle[i][j]].first) + abs(j - goal[puzzle[i][j]].second);
}
}
return tot;
}
priority_queue<puzzle> pq;
string aStar(const puzzle& start){
while(!pq.empty())pq.pop();
pq.push(start);
while(!pq.empty()){
puzzle cur = pq.top(); pq.pop();
if(cur.cost < 50){
if(cur.heuristic == 0){
return string(cur.path);
}
for(int i = 0; i < 4; i++){
int row = cur.zPlace / 4 , col = cur.zPlace % 4;
if(row + dirX[i] < 0 || row + dirX[i] > 3 || col + dirY[i] < 0 || col + dirY[i] > 3) continue;
if(abs(i - cur.parent) == 2) continue;
puzzle newP;
newP.parent = i;
newP.cost = cur.cost + 1;
newP.last = cur.last;
memcpy(newP.path, cur.path, cur.last);
newP.path[newP.last++] = dirs[i]; newP.path[newP.last] = '\0';
memcpy(newP.configuration, cur.configuration, sizeof(cur.configuration));
swap(newP.configuration[row][col], newP.configuration[row+dirX[i]][col+dirY[i]]);
row += dirX[i]; col += dirY[i];
newP.heuristic = manhattnDistance(newP.configuration);
newP.zPlace = (row * 4) + col;
pq.push(newP);
}
}
}
return "";
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.in", "r", stdin);
#endif
int c = 1;
for(int i = 0; i < 4; i++){
for(int j = 0; j < 4; j++){
goal[c].first = i;
goal[c].second = j;
c++;
}
}
goal[0].first = goal[0].second = 3;
int t;
scanf("%d", &t);
while(t--){
puzzle start(0, 100);
short zPlace = 0;
for(int i = 0; i < 4; i++){
for(int j = 0; j < 4; j++){
scanf("%d", &start.configuration[i][j]);
if(start.configuration[i][j] == 0){
zPlace = (i * 4) + j;
}
}
}
start.zPlace = zPlace;
start.parent = -10;
if(isSolvable(start)){
printf("%s\n", aStar(start).c_str());
}else{
printf("This puzzle is not solvable.\n");
}
}
return 0;
} | 24.603659 | 110 | 0.477819 |
1b88992dad5310a9d17f4147c679fa7181be489d | 725 | asm | Assembly | oeis/254/A254659.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/254/A254659.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/254/A254659.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A254659: Numbers of words on alphabet {0,1,...,8} with no subwords ii, where i is from {0,1,2,3}.
; Submitted by Jamie Morken(s4)
; 1,9,77,661,5673,48689,417877,3586461,30781073,264180889,2267352477,19459724261,167014556473,1433415073089,12302393367077,105586222302061,906201745251873,7777545073525289,66751369314461677,572898679883319861,4916946285638867273,42200063684527537489,362185240904414636277,3108482245657954777661,26678784169785711402673,228972684586575465109689,1965175397541532277890877,16866266603265135548675461,144756009813828745778858073,1242379411526955643974241889,10662815341284788880688225477
mov $1,1
mov $3,1
lpb $0
sub $0,1
mov $2,$3
mul $2,5
mul $3,8
add $3,$1
mov $1,$2
lpe
mov $0,$3
| 45.3125 | 483 | 0.817931 |
a545012c6a6a5f4a6c4b47c3bd12fcc70bd83109 | 2,951 | sql | SQL | StoredProcedures/spLectureEventRead.sql | christoferpeterson/DCC-Database-Design | ca24d66c7a526300b949e0cd585a5e98bd45ebea | [
"MIT"
] | null | null | null | StoredProcedures/spLectureEventRead.sql | christoferpeterson/DCC-Database-Design | ca24d66c7a526300b949e0cd585a5e98bd45ebea | [
"MIT"
] | null | null | null | StoredProcedures/spLectureEventRead.sql | christoferpeterson/DCC-Database-Design | ca24d66c7a526300b949e0cd585a5e98bd45ebea | [
"MIT"
] | null | null | null | -- ==========================================================
-- Create Stored Procedure Template for Windows Azure SQL Database
-- ==========================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Peterson, Christofer
-- Create date: August 19, 2016
-- Description: Retrieve a single lecture event
-- =============================================
DROP PROCEDURE IF EXISTS spLectureEventRead;
GO
CREATE PROCEDURE spLectureEventRead
@eventid UNIQUEIDENTIFIER,
@includeHistory BIT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT
[event].eventid AS EventId,
[event].start AS Start,
[event].[end] AS [End],
[event].presenter AS Presenter,
[event].[description] AS [Description],
[event].location AS Location,
[event].[status] AS StatusId,
transStatus.[description] AS [Status],
modifier.ID AS ModifiedById,
modifier.Name AS ModifiedBy,
[event].inserted_date AS ModifiedDate,
created.ID AS CreatedById,
created.Name AS CreatedBy,
created.inserted_date AS CreatedDate
FROM [dbo].[inv.LectureSchedule] AS [event]
-- include the transaction status for display
LEFT JOIN [dbo].[ref.TransactionStatus] transStatus WITH (NOLOCK)
ON [event].[status] = transStatus.id
-- include lastest modifier of the event
LEFT JOIN [dbo].[DCCUsers] modifier WITH (NOLOCK)
ON [event].inserted_by = modifier.ID
-- look for the original transaction to display event creator
RIGHT JOIN (
SELECT
a.inserted_by,
a.inserted_date,
a.eventid,
a.previous_status,
b.ID,
b.Name
FROM [dbo].[inv.LectureSchedule] a
LEFT JOIN [dbo].[DCCUsers] b WITH (NOLOCK)
ON a.inserted_by = b.ID
WHERE a.previous_status = 6
) created
ON [event].eventid = created.eventid
-- exclude removed, replaced, and void transactions
WHERE [event].eventid = @eventid AND [event].[status] NOT IN (4,5,6,7);
IF @includeHistory = 1
BEGIN
SELECT
[event].eventid AS EventId,
[event].start AS Start,
[event].[end] AS [End],
[event].presenter AS Presenter,
[event].[description] AS [Description],
[event].location AS Location,
[event].[previous_status] AS StatusId,
transStatus.[description] AS [Status],
modifier.ID AS ModifiedById,
modifier.Name AS ModifiedBy,
[event].inserted_date AS [Timestamp]
FROM [dbo].[inv.LectureSchedule] AS [event]
-- include the transaction status for display
LEFT JOIN [dbo].[ref.TransactionStatus] transStatus WITH (NOLOCK)
ON [event].[previous_status] = transStatus.id
-- include lastest modifier of the event
LEFT JOIN [dbo].[DCCUsers] modifier WITH (NOLOCK)
ON [event].inserted_by = modifier.ID
-- exclude removed, replaced, and void transactions
WHERE [event].eventid = @eventid AND [event].[status] NOT IN (6,7);
END
END
GO | 29.808081 | 72 | 0.662826 |
0b8c281f2be1b5f006c8dd22b32012df4fb6d732 | 2,716 | py | Python | tigergraph/benchmark.py | yczhang1017/ldbc_snb_bi | 5b97da8b2596e88bc460d5568fc7b31587695b62 | [
"Apache-2.0"
] | null | null | null | tigergraph/benchmark.py | yczhang1017/ldbc_snb_bi | 5b97da8b2596e88bc460d5568fc7b31587695b62 | [
"Apache-2.0"
] | null | null | null | tigergraph/benchmark.py | yczhang1017/ldbc_snb_bi | 5b97da8b2596e88bc460d5568fc7b31587695b62 | [
"Apache-2.0"
] | null | null | null | import argparse
from pathlib import Path
from datetime import datetime, date, timedelta
from queries import run_queries, precompute, cleanup
from batches import run_batch_update
import os
import time
import re
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='LDBC TigerGraph BI workload Benchmark')
parser.add_argument('data_dir', type=Path, help='The directory to load data from')
parser.add_argument('--header', action='store_true', help='whether data has the header')
parser.add_argument('--cluster', action='store_true', help='load concurrently on cluster')
parser.add_argument('--skip', action='store_true', help='skip precompute')
parser.add_argument('--para', type=Path, default=Path('../parameters'), help='parameter folder')
parser.add_argument('--test', action='store_true', help='test mode only run one time')
parser.add_argument('--nruns', '-n', type=int, default=10, help='number of runs')
parser.add_argument('--endpoint', type=str, default = 'http://127.0.0.1:9000', help='tigergraph rest port')
args = parser.parse_args()
sf = os.environ.get("SF")
results_file = open('output/results.csv', 'w')
timings_file = open('output/timings.csv', 'w')
timings_file.write(f"tool|sf|q|parameters|time\n")
query_variants = ["1", "2a", "2b", "3", "4", "5", "6", "7", "8a", "8b", "9", "10a", "10b", "11", "12", "13", "14a", "14b", "15a", "15b", "16a", "16b", "17", "18", "19a", "19b", "20"]
query_nums = [int(re.sub("[^0-9]", "", query_variant)) for query_variant in query_variants]
start_date = date(2012, 11, 29)
end_date = date(2013, 1, 1)
batch_size = timedelta(days=1)
needClean = False
batch_date = start_date
while batch_date < end_date:
start = time.time()
duration = run_batch_update(batch_date, args)
# For SF-10k and larger, sleep time may be needed after batch update to release memory
# time.sleep(duration * 0.2)
if needClean:
for query_num in [19,20]:
if query_num in query_nums:
cleanup(query_num, args.endpoint)
needClean = False
for query_num in [4,6,19,20]:
if query_num in query_nums:
precompute(query_num, args.endpoint)
needClean = True
writes_time = time.time() - start
timings_file.write(f"TigerGraph|{sf}|writes|{batch_date}|{writes_time:.6f}\n")
reads_time = run_queries(query_variants, results_file, timings_file, args)
timings_file.write(f"TigerGraph|{sf}|reads|{batch_date}|{reads_time:.6f}\n")
batch_date = batch_date + batch_size
results_file.close()
timings_file.close()
| 48.5 | 186 | 0.654639 |
610ccd1f7dd7fea7fef5d54ad130da57c946e2d7 | 91 | css | CSS | css/style.css | JonathanHoffman/WikipediaSearcher | edd2bd0658eda22ae7c701a84817274c640f4668 | [
"MIT"
] | null | null | null | css/style.css | JonathanHoffman/WikipediaSearcher | edd2bd0658eda22ae7c701a84817274c640f4668 | [
"MIT"
] | null | null | null | css/style.css | JonathanHoffman/WikipediaSearcher | edd2bd0658eda22ae7c701a84817274c640f4668 | [
"MIT"
] | null | null | null | .searchmatch {
font-weight: bold;
}
.input-group {
max-width: 500px;
margin: auto;
} | 11.375 | 20 | 0.637363 |
e71e38a602bae1ca3eef7fe7cbecbd1097fa774e | 2,317 | js | JavaScript | tbk-mobile/src/static/queue.js | orange-resource/tbk_mobile_mall | 0a891becd13a063a0042d6701ef78255942a75ba | [
"MIT"
] | 27 | 2020-04-09T13:14:33.000Z | 2021-04-15T00:20:21.000Z | tbk-mobile/src/static/queue.js | orange-resource/tbk_mobile_mall | 0a891becd13a063a0042d6701ef78255942a75ba | [
"MIT"
] | 2 | 2020-06-18T17:24:32.000Z | 2020-07-20T04:45:49.000Z | tbk-mobile/src/static/queue.js | orange-resource/tbk_mobile_mall | 0a891becd13a063a0042d6701ef78255942a75ba | [
"MIT"
] | 20 | 2020-04-09T13:14:35.000Z | 2022-03-26T06:01:17.000Z | /**
* localStorage封装
* @author Orange软件
* @date 2019.3.10
*/
function local() {}
local.setJson = function(key,value) {
let jsonString = JSON.stringify(value);
localStorage.setItem(key,jsonString);
};
local.getJson = function (key) {
let jsonString = localStorage.getItem(key);
return JSON.parse(jsonString);
};
local.clear = function () {
localStorage.clear();
};
local.removeItem = function (key) {
localStorage.removeItem(key);
};
/**
* 队列封装
* @author Orange软件
* @date 2019.3.10
*/
function queue() {}
queue.get = function (key) { //获取队列里面全部的数据
let data = local.getJson(key);
if (data instanceof Array) {
return data;
}
return [];
};
queue.insert = function (param) { //队列插入数据
param.capacityNum = param.capacityNum || 100; //队列容量 默认队列中超过100条数据,自动删除尾部
let data = local.getJson(param.key);
if (data instanceof Array) {
if (data.length > param.capacityNum) {
let total = data.length - param.capacityNum;
for (let i = 0;i < total;i++) {
data.pop();
}
}
data.unshift(param.value);
} else {
data = [];
data.push(param.value);
}
local.setJson(param.key,data);
};
queue.clear = function () { //清空所有队列
localStorage.clear();
};
queue.removeItem = function (key,itemIds) { //提供itemIds数组 批量删除队列中的某项数据
let data = local.getJson(key);
if (data instanceof Array) {
for (let i = 0;i < itemIds.length;i++) {
for (let p = 0;p < data.length;p++) {
if (itemIds[i] == data[p].itemId) {
data.splice(p, 1);
break;
}
}
}
local.setJson(key,data);
}
};
queue.isExist = function (key,itemId) { //检测某条数据在队列中是否存在
let data = local.getJson(key);
if (data instanceof Array) {
for (let p = 0;p < data.length;p++) {
if (itemId == data[p].itemId) {
return true;
}
}
}
return false;
};
queue.remove = function (key) { //删除某条队列
localStorage.removeItem(key);
};
queue.getCount = function (key) { //获取队列中全部数据数量
let data = local.getJson(key);
if (data instanceof Array) {
return data.length;
}
return 0;
};
export {
local,queue
}
| 21.858491 | 77 | 0.556754 |
59954a7c7d47b8477ce098ea6c04eb02b25df8ce | 5,545 | swift | Swift | MockGeneratorTests/VariableTypeResolverTests.swift | Omar-Bassyouni/SwiftMockGeneratorForXcode | 52c6dcfce341d4419eb9452bd9334fb115fefd14 | [
"MIT"
] | 1 | 2018-11-07T10:14:05.000Z | 2018-11-07T10:14:05.000Z | MockGeneratorTests/VariableTypeResolverTests.swift | Omar-Bassyouni/SwiftMockGeneratorForXcode | 52c6dcfce341d4419eb9452bd9334fb115fefd14 | [
"MIT"
] | null | null | null | MockGeneratorTests/VariableTypeResolverTests.swift | Omar-Bassyouni/SwiftMockGeneratorForXcode | 52c6dcfce341d4419eb9452bd9334fb115fefd14 | [
"MIT"
] | null | null | null | import XCTest
import TestHelper
import AST
import Resolver
import UseCases
@testable import MockGenerator
class VariableTypeResolverTests: XCTestCase {
func test_shouldNotResolveUnsupportedItems() {
assertResolveNil("var a = unresolved")
assertResolveNil("var a = returnMethod()")
assertResolveNil("var a = ClassType.returnMethod()")
assertResolveNil("var a = ClassType.returnMethod[a: 0]")
assertResolveNil("var a = a?.b?.returnMethod?()")
assertResolveNil("var a = a!.b!.returnMethod!()")
assertResolveNil("var a = a.b.returnMethod?()")
assertResolveNil("var a = {}")
assertResolveNil("var a = { (a: A) in return B() }")
assertResolveNil("var a = a ?? 0")
assertResolveNil("var a = a && 0")
assertResolveNil("var a = a?")
assertResolveNil("var a = a ? 0 : 1")
assertResolveNil("var a = #colorLiteral()")
assertResolveNil("var a = #fileLiteral()")
assertResolveNil("var a = #imageLiteral()")
}
func test_shouldResolveTypeAnnotation() {
assertResolve("var a: A", "A")
}
func test_shouldResolveInitializerWithLiteral() {
assertResolve("var a = \"\"", "String")
assertResolve("var a = 0", "Int")
assertResolve("var a = true", "Bool")
assertResolve("var a = 0.1", "Double")
}
func test_shouldResolveInitializerWithArrayLiteral() {
assertResolveArray("var a = [\"abc\"]", "String")
assertResolveArray("var a = [0, 1]", "Int")
assertResolveArray("var a = [true]", "Bool")
assertResolveArray("var a = [0.1]", "Double")
assertResolveNil("var a = []")
}
func test_shouldResolveInitializerWithDictionaryLiteral() {
assertResolveDict("var a = [\"abc\": 0]", "String", "Int")
assertResolveNil("var a = [:]")
}
func test_shouldResolveInitializerWithArrayFunctionCall() {
assertResolveArray("var a = [ClassType]()", "ClassType")
}
func test_shouldResolveToClassType() {
assertResolve("var a = ClassType()", "ClassType")
}
func test_shouldResolveToStructType() {
assertResolve("var a = StructType()", "StructType")
}
func test_shouldResolveToEnumType() {
assertResolve("var a = EnumType()", "EnumType")
}
func test_shouldResolveInitializerWithDictionaryFunctionCall() {
assertResolveDict("var a = [ClassType: ClassType]()", "ClassType", "ClassType")
}
func test_shouldNotResolveToUnresolvableItem() {
assertResolveNil("var a = cannotResolve")
}
func test_shouldResolveAsPattern() {
assertResolve("var a = a as A", "A")
}
func test_shouldResolveAsArrayPattern() {
assertResolveArray("var a = a as [ClassType]", "ClassType")
}
func test_shouldResolveIsPattern() {
assertResolve("var a = a is A", "Bool")
}
func test_shouldResolveTuple() {
assertResolveTuple("var a = (0, false)", "Int", "Bool")
}
func test_shouldResolveEmptyTuple() {
assertResolveTuple("var a = ()")
}
func test_shouldResolveTupleElementToAnyWhenCannotResolve() {
assertResolveTuple("var a = (a, b, c)", "Any", "Any", "Any")
}
private func assertResolve(_ text: String, _ expected: String, line: UInt = #line) {
XCTAssertEqual(try resolve(text)?.text, expected, line: line)
}
private func assertResolveArray(_ text: String, _ expected: String, line: UInt = #line) {
let resolved = try! resolve(text)
XCTAssert(resolved is UseCasesArrayType, line: line)
let array = resolved as? UseCasesArrayType
XCTAssertEqual(array?.text, "[\(expected)]", line: line)
XCTAssertEqual(array?.type.text, expected, line: line)
}
private func assertResolveDict(_ text: String, _ expectedKey: String, _ expectedValue: String, line: UInt = #line) {
let resolved = try! resolve(text)
XCTAssert(resolved is UseCasesDictionaryType, line: line)
let dict = resolved as? UseCasesDictionaryType
XCTAssertEqual(dict?.text, "[\(expectedKey): \(expectedValue)]", line: line)
XCTAssertEqual(dict?.keyType.text, expectedKey, line: line)
XCTAssertEqual(dict?.valueType.text, expectedValue, line: line)
}
private func assertResolveTuple(_ text: String, _ expected: String..., line: UInt = #line) {
let resolved = try! resolve(text)
XCTAssert(resolved is UseCasesTupleType, line: line)
guard let tuple = resolved as? UseCasesTupleType else {
XCTFail("Expected tuple type", line: line)
return
}
XCTAssertEqual(tuple.text, "(\(expected.joined(separator: ", ")))", line: line)
zip(expected, tuple.types).forEach { expected, type in
XCTAssertEqual(type.text, expected, line: line)
}
}
private func assertResolveNil(_ text: String, line: UInt = #line) {
XCTAssertNil(try resolve(text), line: line)
}
private func resolve(_ text: String) throws -> UseCasesType? {
let fullText = """
\(text)
func returnMethod() -> ReturnMethodType {}
class ClassType {}
struct StructType {}
enum EnumType {}
"""
return VariableTypeResolver.resolve(try parse(fullText), resolver: ResolverFactory.createResolver(filePaths: []))
}
private func parse(_ text: String) throws -> Element {
return try ParserTestHelper.parseFile(from: text).children[0]
}
}
| 36.24183 | 121 | 0.631921 |
d3279232b16edff004bcd5b80ae626237e37915c | 1,076 | swift | Swift | SalesforceViews/SalesforceViewsDefaults.swift | quintonwall/SalesforceViews | 1071c3c4eeba6c777d8cd428e8dd7e36c55cec49 | [
"MIT"
] | 4 | 2016-12-01T23:36:32.000Z | 2019-07-24T07:06:34.000Z | SalesforceViews/SalesforceViewsDefaults.swift | quintonwall/SalesforceViews | 1071c3c4eeba6c777d8cd428e8dd7e36c55cec49 | [
"MIT"
] | null | null | null | SalesforceViews/SalesforceViewsDefaults.swift | quintonwall/SalesforceViews | 1071c3c4eeba6c777d8cd428e8dd7e36c55cec49 | [
"MIT"
] | null | null | null | //
// SalesforceViewsGlobals.swift
// SalesforceViews
//
// Created by QUINTON WALL on 4/8/17.
// Copyright © 2017 me.quinton. All rights reserved.
//
import Foundation
import UIKit
public final class SalesforceViewsDefaults {
public static let shared = SalesforceViewsDefaults()
}
public enum SalesforceViewError: Error {
case notificationObjectMismatch
}
public struct ColorPalette {
static let primaryDark: UIColor = UIColor(netHex: 0x397367)
static let primaryLight: UIColor = UIColor(netHex: 0x5DA38B)
static let secondaryDark: UIColor = UIColor(netHex: 0x42858C)
static let secondaryLight: UIColor = UIColor(netHex: 0x63CCCA)
static let tertiary: UIColor = UIColor(netHex: 0x35393C)
}
public struct ViewNotifications {
static let accountList : String = "sfv-account-list"
static let accountDetail : String = "sfv-account-detail"
static let accountInsert : String = "sfv-account-insert"
static let accountUpdate : String = "sfv-account-update"
static let accountDelete : String = "sfv-account-delete"
}
| 28.315789 | 66 | 0.736989 |
f4a6987a776a72e44a4d6f162709357728af7f20 | 954 | go | Go | internal/domain/player.go | daystram/caroline | a372d124c3da972e106ddafc1e81126c15ef66ea | [
"MIT"
] | 1 | 2022-03-05T14:18:52.000Z | 2022-03-05T14:18:52.000Z | internal/domain/player.go | daystram/caroline | a372d124c3da972e106ddafc1e81126c15ef66ea | [
"MIT"
] | 4 | 2022-03-18T10:58:30.000Z | 2022-03-18T11:04:22.000Z | internal/domain/player.go | daystram/caroline | a372d124c3da972e106ddafc1e81126c15ef66ea | [
"MIT"
] | null | null | null | package domain
import (
"time"
"github.com/bwmarrin/discordgo"
)
type PlayerStatus uint
const (
PlayerStatusPlaying PlayerStatus = iota
PlayerStatusStopped
PlayerStatusUninitialized
)
type Player struct {
GuildID string
VoiceChannel *discordgo.Channel
StatusChannel *discordgo.Channel
Conn *discordgo.VoiceConnection
Status PlayerStatus
LastStatusMessageID string
CurrentStartTime time.Time
}
type PlayerAction uint
const (
PlayerActionPlay PlayerAction = iota
PlayerActionSkip
PlayerActionStop
PlayerActionKick
)
type PlayerUseCase interface {
Play(s *discordgo.Session, vch, sch *discordgo.Channel) error
Get(guildID string) (*Player, error)
Stop(p *Player) error
Jump(p *Player, pos int) error
Move(p *Player, from, to int) error
Remove(p *Player, pos int) error
Reset(p *Player) error
Kick(p *Player) error
KickAll()
Count() int
TotalPlaytime() time.Duration
}
| 19.08 | 62 | 0.733753 |
3bb036b8a6ce6f0cdf60dff900aa99d4fca6852b | 6,499 | html | HTML | index.html | yyc12345/TenThousandWindows8 | e6e6b3222b729ac06f2bd0a49f5568777815ee4a | [
"MIT"
] | null | null | null | index.html | yyc12345/TenThousandWindows8 | e6e6b3222b729ac06f2bd0a49f5568777815ee4a | [
"MIT"
] | null | null | null | index.html | yyc12345/TenThousandWindows8 | e6e6b3222b729ac06f2bd0a49f5568777815ee4a | [
"MIT"
] | null | null | null | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>10000套Windows8</title>
<link rel="stylesheet" type="text/css" href="index.css">
<!-- script-->
<script src="core.js"></script>
<script src="welcome.js"></script>
<script src="menu.js"></script>
<script src="utilities.js"></script>
</head>
<body style="background: #ffffff">
<div class="gameWindow" id="menu">
<div class="gameContent">
<p id="menuDesc">10000套Windows8</p>
</div>
<div class="operation" id="menuOperation">
<button id="menuBtn" onclick="welcome()">开始游戏</button>
<button id="menuBtn" onclick="tutorial()">教程</button>
<button id="menuBtn" onclick="about()">关于</button>
</div>
</div>
<div class="gameWindow" id="tutorial" style="display: none">
<div class="gameContent">
<p>No tutorial currently.</p>
</div>
<div class="operation">
<button id="menuBtn" onclick="menu()">回到菜单</button>
</div>
</div>
<div class="gameWindow" id="about" style="display: none">
<div class="gameContent">
<p><b>10000 copies of Windows8</b></p>
<p>A interesting game.</p>
<br>
<p><b>Inspired from:</b></p>
<p>* <a href="http://tieba.baidu.com/p/2628820388">10000 apples</a></p>
<p>* <a href="http://tieba.baidu.com/p/3210081726">10000 eggs</a></p>
<p>* <i>Paper, Please</i></p>
</div>
<div class="operation">
<button id="menuBtn" onclick="menu()">回到菜单</button>
</div>
</div>
<div class="gameWindow" id="welcome" style="display: none">
<div class="gameContent">
<p id="welcomeDesc"></p>
</div>
<div class="operation" id="welcomeOperation">
<button id="welcomeBtn" onclick="welcomeCore()">了解</button>
</div>
</div>
<div class="gameWindow" id="stage" style="display: none">
<div>
<div id="stageDayDiv">
<p>
<span>
<img src="assets/time.png" style="width: 20px;height: 20px;" title="时间" />
</span>
<span style="color: #008CBA;">
<b>
第
<label id="stageDay">N/A</label>天
</b>
</span>
<span style="color: #008CBA;">
<label id="stageTime">N/A</label>
</span>
<span style="margin-left: 20px;">
<img id="stageWeather" src="assets/weatherSunny.png" style="width: 20px;height: 20px;" title="N/A"/>
</span>
</p>
</div>
<div id="stageCore" style="background:url(assets/stage.png);background-size: 800px 400px;">
<img id="stageGuestIcon" src="" style="width: 80px;height:80px;position: absolute;margin-top: 90px;margin-left: 90px;"/>
<div id="stageGuestDialog" style="color: #008CBA;overflow:scroll;position: absolute;margin-top: 70px;margin-left: 180px;width: 500px;height: 100px;">
</div>
<div id="stageOverlay" style="display: none;">
<div style="position: absolute;width: 800px;height: 400px;margin-left: 0;margin-top: 0;opacity: 0.7;background-color: black;"></div>
<div id="overlayContent" style="overflow:scroll;position: absolute;width: 600px;height: 300px;margin-left: 100px;margin-top: 50px;background:url(assets/paper.bmp);">
</div>
</div>
</div>
<div id="stageStatusTable">
<table style="width: inherit;height: inherit;">
<tr>
<td style="width: 20%;">
<img src="assets/windows.png" style="width: 20px;height: 20px;" title="剩余的Windows8" />
<label style="color: #008CBA;" id="stageWindowsCount">N/A</label>
</td>
<td style="width: 20%;">
<img src="assets/money.png" style="width: 20px;height: 20px;" title="钱" />
<label style="color: #008CBA;" id="stageMoney">N/A</label>
</td>
<td style="width: 20%;">
<img src="assets/package.png" style="width: 20px;height: 20px;" title="营养液" />
<label style="color: #008CBA;" id="stageMedicine">N/A</label>
</td>
<td style="width: 20%;">
<img src="assets/energy.png" style="width: 20px;height: 20px;" title="体力" />
<label style="color: #008CBA;" id="stageEnergy">N/A</label>
</td>
<td style="width: 20%;">
<img src="assets/mentalHealth.png" style="width: 20px;height: 20px;" title="心理健康" />
<label style="color: #008CBA;" id="stageMentalHealth">N/A</label>
</td>
</tr>
</table>
</div>
</div>
<div class="operation" id="stageOperation">
<button style="width: 50px" id="stageOperationGetup" onclick="bed(0)">起床</button>
<button style="width: 50px" id="stageOperationSleep" onclick="bed(1)">睡觉</button>
<label style="color: #008CBA;"> | </label>
<button style="width: 50px" id="stageOperationSell" onclick="guestProcess(0)">卖</button>
<button style="width: 50px" id="stageOperationAvoid" onclick="guestProcess(1)">不卖</button>
<button style="width: 50px" id="stageOperationBargain" onclick="guestProcess(2)">还价</button>
<button style="width: 50px" id="stageOperationEmerge" onclick="guestProcess(3)">报警</button>
<label style="color: #008CBA;"> | </label>
<button style="width: 100px" id="stageOperationTrade" onclick="showOverlay(0)">价格走势</button>
<button style="width: 100px" id="stageOperationPunishment" onclick="showOverlay(1)">处罚记录</button>
<button style="width: 100px" id="stageOperationRule" onclick="showOverlay(2)">售卖规则</button>
</div>
</div>
</body>
</html> | 43.912162 | 185 | 0.503924 |
66111bb2f04b9923bae66192c3f06f5ace00ac9f | 276 | cpp | C++ | src/bar_ros/ros2/src/bar_node.cpp | Levi-Armstrong/share_ros1_ros2_lib_demo | 185b44a8d9e0439472d5120ebb284fee63a33828 | [
"BSD-3-Clause"
] | 16 | 2019-07-12T01:20:24.000Z | 2022-02-25T06:21:10.000Z | src/bar_ros2/src/bar_node.cpp | Kyungpyo-Kim/share_ros1_ros2_lib_demo | 8a84d1ad3550453facddde9d57b384da4acad183 | [
"BSD-3-Clause"
] | 1 | 2022-01-20T13:00:44.000Z | 2022-01-20T13:00:44.000Z | src/bar_ros2/src/bar_node.cpp | Kyungpyo-Kim/share_ros1_ros2_lib_demo | 8a84d1ad3550453facddde9d57b384da4acad183 | [
"BSD-3-Clause"
] | 3 | 2020-01-30T03:53:59.000Z | 2020-08-19T01:56:31.000Z | #include <rclcpp/rclcpp.hpp>
#include <lib_foo/foo.h>
int main(int argc, char** argv)
{
rclcpp::init(argc, argv);
auto node = rclcpp::Node::make_shared("bar_node");
RCLCPP_INFO(node->get_logger(), "Use lib_foo from a ROS 2 node");
Foo foo;
return 0;
} | 18.4 | 69 | 0.644928 |
80bf56e1456c1eba38eb85660256c556f8daf74f | 209 | lua | Lua | ngx/lua/dbinfo.lua | grehujt/RestfulApiServer | 77ca05ba7c548394904a19702d62610d76c048d5 | [
"MIT"
] | null | null | null | ngx/lua/dbinfo.lua | grehujt/RestfulApiServer | 77ca05ba7c548394904a19702d62610d76c048d5 | [
"MIT"
] | null | null | null | ngx/lua/dbinfo.lua | grehujt/RestfulApiServer | 77ca05ba7c548394904a19702d62610d76c048d5 | [
"MIT"
] | null | null | null | local M = {}
M.mysqlconn = {
host = "127.0.0.1",
port = 3306,
user = "lbsuser",
password = "20lbsuserpass17"
}
M.connTimeout = 100000 -- 30s, pool idle timeout
M.connPoolSize = 100
return M
| 14.928571 | 48 | 0.607656 |
61b9ff215063bd971b2dd304ceca2e7272eaa0d5 | 317 | kt | Kotlin | app/src/main/java/com/linkedintools/da/web/linkedin/connections/Element.kt | JohannBlake/AndroidSampleAppLinkedIn | 66d7dc4b9266af3f26b941a045b2cfa0b561ddcf | [
"MIT",
"Unlicense"
] | null | null | null | app/src/main/java/com/linkedintools/da/web/linkedin/connections/Element.kt | JohannBlake/AndroidSampleAppLinkedIn | 66d7dc4b9266af3f26b941a045b2cfa0b561ddcf | [
"MIT",
"Unlicense"
] | null | null | null | app/src/main/java/com/linkedintools/da/web/linkedin/connections/Element.kt | JohannBlake/AndroidSampleAppLinkedIn | 66d7dc4b9266af3f26b941a045b2cfa0b561ddcf | [
"MIT",
"Unlicense"
] | null | null | null | package com.linkedintools.da.web.linkedin.connections
import com.google.gson.annotations.SerializedName
data class Element(
@SerializedName("createdAt")
val createdAt: Long?,
@SerializedName("entityUrn")
val entityUrn: String?,
@SerializedName("miniProfile")
val miniProfile: MiniProfile?
) | 24.384615 | 53 | 0.747634 |
bcc6368b1fb2c8e56491406dfc290229e0732a6f | 1,498 | js | JavaScript | src/Components/AddressSelect/AddressSelectView.js | pelcro-inc/react-pelcro-js | 8473a243d284d79b19552a7dedaa870cd9f32c7b | [
"MIT"
] | null | null | null | src/Components/AddressSelect/AddressSelectView.js | pelcro-inc/react-pelcro-js | 8473a243d284d79b19552a7dedaa870cd9f32c7b | [
"MIT"
] | 76 | 2021-07-01T17:29:17.000Z | 2022-03-23T07:17:52.000Z | src/Components/AddressSelect/AddressSelectView.js | pelcro-inc/react-pelcro-js | 8473a243d284d79b19552a7dedaa870cd9f32c7b | [
"MIT"
] | 1 | 2021-09-15T13:55:23.000Z | 2021-09-15T13:55:23.000Z | import React from "react";
import { useTranslation } from "react-i18next";
import { AddressSelectContainer } from "./AddressSelectContainer";
import { AddressSelectList } from "./AddressSelectList";
import { AddressSelectSubmit } from "./AddressSelectSubmit";
import { AlertWithContext } from "../../SubComponents/AlertWithContext";
import { Link } from "../../SubComponents/Link";
export const AddressSelectView = (props) => {
const { t } = useTranslation("address");
return (
<div id="pelcro-address-select-view">
<div className="plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper">
<h4 className="plc-text-2xl plc-font-semibold">
{t("selectAddressTitle")}
</h4>
<p>{t("selectAddressSubtitle")}</p>
</div>
<form
action="javascript:void(0);"
className="plc-mt-2 pelcro-form"
>
<AddressSelectContainer {...props}>
<AlertWithContext />
<AddressSelectList />
<div className="plc-flex plc-justify-center plc-mt-4">
<Link
id="pelcro-add-address"
onClick={props.onAddNewAddress}
>
{t("buttons.addAddress")}
</Link>
</div>
<AddressSelectSubmit
role="submit"
className="plc-mt-4 plc-w-full"
name={t("buttons.selectAddress")}
id="pelcro-submit"
/>
</AddressSelectContainer>
</form>
</div>
);
};
| 32.565217 | 87 | 0.583445 |
c1aed6ad18a713600671c69ddbf17a53f9de6931 | 1,228 | swift | Swift | ChemicalFormula/ChemicalFormula/ViewController.swift | NeoWangATX/APCS-xCode | 91c940e79c34687af6f3f26ca2ff6be6f5891550 | [
"MIT"
] | null | null | null | ChemicalFormula/ChemicalFormula/ViewController.swift | NeoWangATX/APCS-xCode | 91c940e79c34687af6f3f26ca2ff6be6f5891550 | [
"MIT"
] | null | null | null | ChemicalFormula/ChemicalFormula/ViewController.swift | NeoWangATX/APCS-xCode | 91c940e79c34687af6f3f26ca2ff6be6f5891550 | [
"MIT"
] | null | null | null | //
// ViewController.swift
// ChemicalFormula
//
// Created by Neo Wang on 10/23/19.
// Copyright © 2019 Neo Wang. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
var chemicals = [String:String]()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
chemicals["H2O"] = "DiHydrogen Monoxide"
chemicals["CO2"] = "Carbon Dioxide"
chemicals["O2"] = "Dioxide"
chemicals["H2"] = "DiHydrogen"
chemicals["N"] = "Nitrogen"
}
@IBOutlet weak var field: UITextField!
@IBOutlet weak var output: UILabel!
@IBAction func buttonclicked(_ sender: Any) {
/* let input = field.text!
if(input == "")
{
output.text = "NOT FOUND"
}
else
{
output.text = chemicals[input]
} */
/* another way to accomplish this same thing is to do this */
if(chemicals[field.text!] == nil)
{
output.text = "NOT FOUND"
}
else
{
output.text = chemicals[field.text!]
}
}
}
| 21.928571 | 69 | 0.51873 |
3f111033133416c8ab7ffc4addecac405c778d59 | 482 | kt | Kotlin | RickMortyAndroidApp/deeplink/src/main/kotlin/io/github/brunogabriel/rickmorty/deeplink/domain/DeeplinkHandler.kt | brunogabriel/rick-and-morty-app | a4fbb825b7eba4f4e41c5e05a8f005edb11a8439 | [
"MIT"
] | 3 | 2022-01-13T16:44:45.000Z | 2022-01-14T12:35:10.000Z | RickMortyAndroidApp/deeplink/src/main/kotlin/io/github/brunogabriel/rickmorty/deeplink/domain/DeeplinkHandler.kt | brunogabriel/rick-and-morty-app | a4fbb825b7eba4f4e41c5e05a8f005edb11a8439 | [
"MIT"
] | null | null | null | RickMortyAndroidApp/deeplink/src/main/kotlin/io/github/brunogabriel/rickmorty/deeplink/domain/DeeplinkHandler.kt | brunogabriel/rick-and-morty-app | a4fbb825b7eba4f4e41c5e05a8f005edb11a8439 | [
"MIT"
] | null | null | null | package io.github.brunogabriel.rickmorty.deeplink.domain
import android.content.Intent
import javax.inject.Inject
internal class DeeplinkHandlerImpl @Inject constructor(
private val processors: Set<@JvmSuppressWildcards DeeplinkProcessor>
) : DeeplinkHandler {
override fun process(deeplink: String) =
processors.firstOrNull {
it.matches(deeplink)
}?.execute(deeplink)
}
interface DeeplinkHandler {
fun process(deeplink: String): Intent?
} | 28.352941 | 72 | 0.751037 |
63153220a37f057a0508d6a3c887c59504d183e0 | 1,342 | lua | Lua | libs/InventoryUtils.lua | veden/FactorioItemCollector | 5af8f773e9613fbe41904c4584de2265f1d2c7fa | [
"Apache-2.0"
] | 1 | 2020-05-29T11:45:25.000Z | 2020-05-29T11:45:25.000Z | libs/InventoryUtils.lua | veden/FactorioItemCollector | 5af8f773e9613fbe41904c4584de2265f1d2c7fa | [
"Apache-2.0"
] | null | null | null | libs/InventoryUtils.lua | veden/FactorioItemCollector | 5af8f773e9613fbe41904c4584de2265f1d2c7fa | [
"Apache-2.0"
] | null | null | null | local inventoryUtils = {}
-- imported functions
local mMin = math.min
-- modules code
function inventoryUtils.swapItemInventory(inventory, src, dst)
if inventory and inventory.valid then
local itemCount = inventory.get_item_count(src)
if (itemCount > 0) then
inventory.remove({name = src, count = itemCount})
inventory.insert({name = dst, count = itemCount})
end
end
end
function inventoryUtils.topOffHand(inventory, handStack, src, dst)
if inventory and inventory.valid then
local itemCount = inventory.get_item_count(src)
if (itemCount > 0) then
if handStack and handStack.valid and handStack.valid_for_read and (handStack.prototype.name == dst) then
local remaining = mMin(itemCount, handStack.prototype.stack_size - handStack.count)
if (remaining > 0) then
local stack = { name = src, count = remaining + handStack.count }
if (handStack.can_set_stack(stack)) and handStack.set_stack(stack) then
inventory.remove({name = src, count = remaining})
end
end
end
end
end
end
function inventoryUtils.swapItemStack(stack, src, dst)
if stack and stack.valid_for_read and (stack.name == src) then
local item = { name = dst, count = stack.count }
if stack.can_set_stack(item) then
stack.set_stack(item)
end
end
end
return inventoryUtils
| 28.553191 | 109 | 0.714605 |
c42402d7cf8b9560399163661f64fb120b5dbe82 | 802 | h | C | detection_firmware/constants.h | 1MP3RAT0R/MetWatcher | ff1c7975b00af1d17dfb3b700709edc945d6075c | [
"MIT"
] | null | null | null | detection_firmware/constants.h | 1MP3RAT0R/MetWatcher | ff1c7975b00af1d17dfb3b700709edc945d6075c | [
"MIT"
] | null | null | null | detection_firmware/constants.h | 1MP3RAT0R/MetWatcher | ff1c7975b00af1d17dfb3b700709edc945d6075c | [
"MIT"
] | null | null | null | /*
* Constatnts to be initialized at the begin
*/
// debug mode enables Serial Connection, not to be used with powerbank
const boolean DEBUG_MODE = false;
// General
const int SERIAL_BAUD_RATE = 9600;
const String SD_DATAFILE_NAME = "data.txt";
const int SECONDS_BETWEEN_MEASUREMENTS = 240;
const int SECONDS_FOR_MEASUREMENT = 360;
const int MAX_HZ = 10;
// PINS Arduino Uno
/*
* Sign lED pins
*
* Measuring - 2
* Waiting - 3
*/
const int MEASURE_LED_PIN = 3;
const int WAITING_LED_PIN = 2;
/*
* Microphone Pins
*
* Digital out (DO) - Pin 7
*/
const int MICROPHONE_DO_PIN = 7;
/*
* SD CARD PINS
*
* MOSI - Digital 11
* MISO - Digital 12
* SCK - Digital 13
* CS - Digital 10
*/
const int SD_PIN_CS = 10;
/*
* DS3231 Pins
*
* SDA pin - Analog 4
* SCL pin - Analog 5
*/
| 16.04 | 70 | 0.669576 |
449371570ca1bb3944d7417a6280f70ded9a2f32 | 1,013 | swift | Swift | diplomado-proyecto-final/Controllers/DetailViewController.swift | alexs/diplomado-proyecto-final | 874f7e075e353c6da9d5cb36cb079e0a8990a1b3 | [
"Apache-2.0"
] | null | null | null | diplomado-proyecto-final/Controllers/DetailViewController.swift | alexs/diplomado-proyecto-final | 874f7e075e353c6da9d5cb36cb079e0a8990a1b3 | [
"Apache-2.0"
] | null | null | null | diplomado-proyecto-final/Controllers/DetailViewController.swift | alexs/diplomado-proyecto-final | 874f7e075e353c6da9d5cb36cb079e0a8990a1b3 | [
"Apache-2.0"
] | null | null | null | //
// DetailViewController.swift
// diplomado-proyecto-final
//
// Created by Alex on 2/22/20.
// Copyright © 2020 Alex. All rights reserved.
//
import UIKit
class DetailViewController: UIViewController {
var elemnto_general: Podcast!
@IBOutlet weak var elemento_titulo: UILabel!
@IBOutlet weak var elemento_desc: UITextView!
override func viewDidLoad() {
super.viewDidLoad()
if(elemnto_general != nil){
elemento_titulo.text = elemnto_general.title
elemento_desc.text = elemnto_general.desc
}
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
| 25.974359 | 106 | 0.654492 |
5945064d04b1cbbf6d65a22d17f01073a76c2c9d | 278 | hpp | C++ | Source/DrawPSF.hpp | iiKurt/Egg | 68371a017b80261c31258ef13c2ac2364ac44c02 | [
"MIT"
] | null | null | null | Source/DrawPSF.hpp | iiKurt/Egg | 68371a017b80261c31258ef13c2ac2364ac44c02 | [
"MIT"
] | 5 | 2022-01-03T05:18:28.000Z | 2022-01-03T05:25:19.000Z | Source/DrawPSF.hpp | iiKurt/Egg | 68371a017b80261c31258ef13c2ac2364ac44c02 | [
"MIT"
] | null | null | null | #pragma once
#include "Font/LoadPSF.hpp"
#include <SDL.h>
void PrintCharacter(SDL_Renderer* renderer, PSF1_FONT* font, char chr, unsigned int xOff, unsigned int yOff);
void PrintString(SDL_Renderer* renderer, PSF1_FONT* font, const char* str, unsigned int x, unsigned int y);
| 34.75 | 109 | 0.769784 |
2b2a2ab66e49e725e8dda3bf521aeb921104dc25 | 3,818 | ps1 | PowerShell | oh-my-posh/tools/chocolateyinstall.ps1 | vraravam/chocolatey-packages | 5d7c82dbf224b7b4d3a68a0c8821988978d61b9d | [
"MIT"
] | null | null | null | oh-my-posh/tools/chocolateyinstall.ps1 | vraravam/chocolatey-packages | 5d7c82dbf224b7b4d3a68a0c8821988978d61b9d | [
"MIT"
] | null | null | null | oh-my-posh/tools/chocolateyinstall.ps1 | vraravam/chocolatey-packages | 5d7c82dbf224b7b4d3a68a0c8821988978d61b9d | [
"MIT"
] | null | null | null | $ErrorActionPreference = 'Stop';
$pp = Get-PackageParameters
$InstallArgs = @{
PackageName = $env:ChocolateyPackageName
FileType = 'exe'
SilentArgs = '/VERYSILENT'
Url64bit = 'https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v6.27.1/install-amd64.exe'
Checksum64 = '57f2437fc00e084c6fea3c51910f213571b7ee34fcd8d15d88a9fa072a201c0cc573113e9b800b4847382172b0810a199ea00d11d1702dc61f32ecba1c318425'
ChecksumType64 = 'sha512'
}
Install-ChocolateyPackage @InstallArgs
Write-Output "PROFILE: $profile"
if (Test-Path $profile) {
$oldprofile = Get-Content $profile
$OhMyPoshInprofile = @(
($oldprofile | Select-String -SimpleMatch 'Import-Module oh-my-posh' | Select-Object -ExpandProperty Line)
($oldprofile | Select-String -SimpleMatch 'Invoke-Expression (oh-my-posh --init --shell pwsh' | Select-Object -ExpandProperty Line)
($oldprofile | Select-String -SimpleMatch 'Set-PoshPrompt' | Select-Object -ExpandProperty Line)
)
if ($pp['Theme']) {
$themeName = $pp['Theme']
if (Test-Path "$env:LocalAppDataPrograms/oh-my-posh/themes/$($themeName).omp.json") {
$ohMyPoshprofileLine = "Invoke-Expression (oh-my-posh --init --shell pwsh --config ""$env:LocalAppData/Programs/oh-my-posh/themes/$($themeName).omp.json"")"
# $ohMyPoshprofileLine = "Set-PoshPrompt -Theme $themeName" # Suggestion for possible alternative
if ($OhMyPoshInprofile) {
# If a theme is set, Overwrite old line to set new theme
foreach ($existingLine in $OhMyPoshInprofile) {
Write-Host "Overwriting Old Oh-My-Posh line: $existingLine with $ohMyPoshprofileLine"
$oldprofile | ForEach-Object { $_ -replace $existingLine, $ohMyPoshprofileLine } | Set-Content -Path $profile -Force
}
}
else {
Add-Content -Path $profile -Value $ohMyPoshprofileLine -Force
}
}
else {
Throw "Could not find Theme $themeName @ $env:LocalAppDataPrograms/oh-my-posh/themes/$($themeName).omp.json";
}
if (-Not($OhMyPoshInprofile)) {
Add-Content -Path $profile -Value "Invoke-Expression (oh-my-posh --init --shell pwsh --config ""$env:LocalAppData/Programs/oh-my-posh/themes/$($themeName).omp.json"")";
Add-Content -Path $profile -Value 'Use the command ''Get-PoshThemes'' to display every available theme in the current directory'
Add-Content -Path $profile -Value '# For information about setting your oh-my-posh themes: https://ohmyposh.dev/docs/installation#3-replace-your-existing-prompt'
}
if (-Not($OhMyPoshInProfile)) {
# Add-Content -Path $PROFILE -Value 'Invoke-Expression (oh-my-posh --init --shell pwsh --config "$(scoop prefix oh-my-posh)/themes/jandedobbeleer.omp.json")';
Add-Content -Path $PROFILE -Value 'Set-PoshPrompt -Theme jandedobbeleer'; # Newer method of setting theme
Add-Content -Path $PROFILE -Value 'Use the command ''Get-PoshThemes'' to display every available theme in the current directory'
Add-Content -Path $PROFILE -Value '# For information about setting your oh-my-posh themes: https://ohmyposh.dev/docs/installation#3-replace-your-existing-prompt'
}
}
Write-Host "oh-my-posh has been added to your profile. You may wish to append 'Set-PoshPrompt paradox' to set a theme"
}
else {
Write-Host "No Powershell profile was found. You may wish to create a profile and append 'Invoke-Expression (oh-my-posh --init --shell pwsh --config ""$env:LocalAppData/Programs/oh-my-posh/themes/themename.omp.json"")' to enable oh-my-posh. 'Get-PoshThemes' will list available themes for you"
}
| 59.65625 | 297 | 0.671556 |
2718e4367fecd4e0c5d91258a08a69c3ae927c85 | 25,528 | swift | Swift | Tests/RxCocoaTests/UICollectionView+RxTests.swift | JacksonJang/RxSwift | ba2ee6cec4844d989adac56f3c0b828a64f8b738 | [
"MIT"
] | 23,526 | 2015-08-06T19:09:28.000Z | 2022-03-31T15:54:19.000Z | Tests/RxCocoaTests/UICollectionView+RxTests.swift | JacksonJang/RxSwift | ba2ee6cec4844d989adac56f3c0b828a64f8b738 | [
"MIT"
] | 2,023 | 2015-08-06T19:04:34.000Z | 2022-03-30T08:23:53.000Z | Tests/RxCocoaTests/UICollectionView+RxTests.swift | JacksonJang/RxSwift | ba2ee6cec4844d989adac56f3c0b828a64f8b738 | [
"MIT"
] | 5,287 | 2015-08-06T21:30:50.000Z | 2022-03-31T08:01:22.000Z | //
// UICollectionView+RxTests.swift
// Tests
//
// Created by Krunoslav Zaher on 4/8/16.
// Copyright © 2016 Krunoslav Zaher. All rights reserved.
//
import RxSwift
import RxCocoa
import XCTest
// UICollectionView
final class UICollectionViewTests : RxTest {
func test_DelegateEventCompletesOnDealloc() {
let layout = UICollectionViewFlowLayout()
let createView: () -> UICollectionView = { UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout) }
ensureEventDeallocated(createView) { (view: UICollectionView) in view.rx.itemSelected }
ensureEventDeallocated(createView) { (view: UICollectionView) in view.rx.itemDeselected }
ensureEventDeallocated(createView) { (view: UICollectionView) in view.rx.modelSelected(Int.self) }
ensureEventDeallocated(createView) { (view: UICollectionView) in view.rx.modelDeselected(Int.self) }
#if os(tvOS)
ensureEventDeallocated(createView) { (view: UICollectionView) in view.rx.didUpdateFocusInContextWithAnimationCoordinator }
#endif
}
func test_itemSelected() {
let layout = UICollectionViewFlowLayout()
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
var resultIndexPath: IndexPath? = nil
let subscription = collectionView.rx.itemSelected
.subscribe(onNext: { indexPath in
resultIndexPath = indexPath
})
let testRow = IndexPath(row: 1, section: 0)
collectionView.delegate!.collectionView!(collectionView, didSelectItemAt: testRow)
XCTAssertEqual(resultIndexPath, testRow)
subscription.dispose()
}
func test_itemDeselected() {
let layout = UICollectionViewFlowLayout()
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
var resultIndexPath: IndexPath? = nil
let subscription = collectionView.rx.itemDeselected
.subscribe(onNext: { indexPath in
resultIndexPath = indexPath
})
let testRow = IndexPath(row: 1, section: 0)
collectionView.delegate!.collectionView!(collectionView, didDeselectItemAt: testRow)
XCTAssertEqual(resultIndexPath, testRow)
subscription.dispose()
}
func test_itemHighlighted() {
let layout = UICollectionViewFlowLayout()
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
var resultIndexPath: IndexPath? = nil
let subscription = collectionView.rx.itemHighlighted
.subscribe(onNext: { indexPath in
resultIndexPath = indexPath
})
let testRow = IndexPath(row: 1, section: 0)
collectionView.delegate!.collectionView!(collectionView, didHighlightItemAt: testRow)
XCTAssertEqual(resultIndexPath, testRow)
subscription.dispose()
}
func test_itemUnhighlighted() {
let layout = UICollectionViewFlowLayout()
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
var resultIndexPath: IndexPath? = nil
let subscription = collectionView.rx.itemUnhighlighted
.subscribe(onNext: { indexPath in
resultIndexPath = indexPath
})
let testRow = IndexPath(row: 1, section: 0)
collectionView.delegate!.collectionView!(collectionView, didUnhighlightItemAt: testRow)
XCTAssertEqual(resultIndexPath, testRow)
subscription.dispose()
}
func test_willDisplayCell() {
let layout = UICollectionViewFlowLayout()
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
var resultCell: UICollectionViewCell? = nil
var resultIndexPath: IndexPath? = nil
let subscription = collectionView.rx.willDisplayCell
.subscribe(onNext: {
let (cell, indexPath) = $0
resultCell = cell
resultIndexPath = indexPath
})
let testCell = UICollectionViewCell(frame: CGRect(x: 0, y: 0, width: 1, height: 1))
let testIndexPath = IndexPath(row: 1, section: 0)
collectionView.delegate!.collectionView!(collectionView, willDisplay: testCell, forItemAt: testIndexPath)
XCTAssertEqual(resultCell, testCell)
XCTAssertEqual(resultIndexPath, testIndexPath)
subscription.dispose()
}
func test_willDisplaySupplementaryView() {
let layout = UICollectionViewFlowLayout()
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
var resultSupplementaryView: UICollectionReusableView? = nil
var resultElementKind: String? = nil
var resultIndexPath: IndexPath? = nil
let subscription = collectionView.rx.willDisplaySupplementaryView
.subscribe(onNext: {
let (reuseableView, elementKind, indexPath) = $0
resultSupplementaryView = reuseableView
resultElementKind = elementKind
resultIndexPath = indexPath
})
let testSupplementaryView = UICollectionReusableView(frame: CGRect(x: 0, y: 0, width: 1, height: 1))
let testElementKind = UICollectionView.elementKindSectionHeader
let testIndexPath = IndexPath(row: 1, section: 0)
collectionView.delegate!.collectionView!(collectionView, willDisplaySupplementaryView: testSupplementaryView, forElementKind: testElementKind, at: testIndexPath)
XCTAssertEqual(resultSupplementaryView, testSupplementaryView)
XCTAssertEqual(resultElementKind, testElementKind)
XCTAssertEqual(resultIndexPath, testIndexPath)
subscription.dispose()
}
func test_didEndDisplayingCell() {
let layout = UICollectionViewFlowLayout()
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
var resultCell: UICollectionViewCell? = nil
var resultIndexPath: IndexPath? = nil
let subscription = collectionView.rx.didEndDisplayingCell
.subscribe(onNext: {
let (cell, indexPath) = $0
resultCell = cell
resultIndexPath = indexPath
})
let testCell = UICollectionViewCell(frame: CGRect(x: 0, y: 0, width: 1, height: 1))
let testRow = IndexPath(row: 1, section: 0)
collectionView.delegate!.collectionView!(collectionView, didEndDisplaying: testCell, forItemAt: testRow)
XCTAssertEqual(resultCell, testCell)
XCTAssertEqual(resultIndexPath, testRow)
subscription.dispose()
}
func test_didEndDisplayingSupplementaryView() {
let layout = UICollectionViewFlowLayout()
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
var resultSupplementaryView: UICollectionReusableView? = nil
var resultElementKind: String? = nil
var resultIndexPath: IndexPath? = nil
let subscription = collectionView.rx.didEndDisplayingSupplementaryView
.subscribe(onNext: {
let (reuseableView, elementKind, indexPath) = $0
resultSupplementaryView = reuseableView
resultElementKind = elementKind
resultIndexPath = indexPath
})
let testSupplementaryView = UICollectionReusableView(frame: CGRect(x: 0, y: 0, width: 1, height: 1))
let testElementKind = UICollectionView.elementKindSectionHeader
let testIndexPath = IndexPath(row: 1, section: 0)
collectionView.delegate!.collectionView!(collectionView, didEndDisplayingSupplementaryView: testSupplementaryView, forElementOfKind: testElementKind, at: testIndexPath)
XCTAssertEqual(resultSupplementaryView, testSupplementaryView)
XCTAssertEqual(resultElementKind, testElementKind)
XCTAssertEqual(resultIndexPath, testIndexPath)
subscription.dispose()
}
@available(iOS 10.0, tvOS 10.0, *)
func test_prefetchItems() {
let layout = UICollectionViewFlowLayout()
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
var indexPaths: [IndexPath] = []
let subscription = collectionView.rx.prefetchItems
.subscribe(onNext: {
indexPaths = $0
})
let testIndexPaths = [IndexPath(item: 1, section: 0), IndexPath(item: 2, section: 0)]
collectionView.prefetchDataSource!.collectionView(collectionView, prefetchItemsAt: testIndexPaths)
XCTAssertEqual(indexPaths, testIndexPaths)
subscription.dispose()
}
@available(iOS 10.0, tvOS 10.0, *)
func test_cancelPrefetchingForItems() {
let layout = UICollectionViewFlowLayout()
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
var indexPaths: [IndexPath] = []
let subscription = collectionView.rx.cancelPrefetchingForItems
.subscribe(onNext: {
indexPaths = $0
})
let testIndexPaths = [IndexPath(item: 1, section: 0), IndexPath(item: 2, section: 0)]
collectionView.prefetchDataSource!.collectionView!(collectionView, cancelPrefetchingForItemsAt: testIndexPaths)
XCTAssertEqual(indexPaths, testIndexPaths)
subscription.dispose()
}
@available(iOS 10.0, tvOS 10.0, *)
func test_PrefetchDataSourceEventCompletesOnDealloc() {
let layout = UICollectionViewFlowLayout()
let createView: () -> UICollectionView = { UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout) }
ensureEventDeallocated(createView) { (view: UICollectionView) in view.rx.prefetchItems }
ensureEventDeallocated(createView) { (view: UICollectionView) in view.rx.cancelPrefetchingForItems }
}
func test_DelegateEventCompletesOnDealloc1() {
let items: Observable<[Int]> = Observable.just([1, 2, 3])
let layout = UICollectionViewFlowLayout()
let createView: () -> (UICollectionView, Disposable) = {
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
let s = items.bind(to: collectionView.rx.items) { (cv, index: Int, item: Int) -> UICollectionViewCell in
return UICollectionViewCell(frame: CGRect(x: 1, y: 1, width: 1, height: 1))
}
return (collectionView, s)
}
ensureEventDeallocated(createView) { (view: UICollectionView) in view.rx.modelSelected(Int.self) }
}
func test_DelegateEventCompletesOnDealloc2() {
let items: Observable<[Int]> = Observable.just([1, 2, 3])
let layout = UICollectionViewFlowLayout()
let createView: () -> (UICollectionView, Disposable) = {
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
collectionView.register(NSClassFromString("UICollectionViewCell"), forCellWithReuseIdentifier: "a")
let s = items.bind(to: collectionView.rx.items(cellIdentifier: "a")) { (index: Int, item: Int, cell) in
}
return (collectionView, s)
}
ensureEventDeallocated(createView) { (view: UICollectionView) in view.rx.modelSelected(Int.self) }
}
func test_DelegateEventCompletesOnDealloc2_cellType() {
let items: Observable<[Int]> = Observable.just([1, 2, 3])
let layout = UICollectionViewFlowLayout()
let createView: () -> (UICollectionView, Disposable) = {
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
collectionView.register(NSClassFromString("UICollectionViewCell"), forCellWithReuseIdentifier: "a")
let s = items.bind(to: collectionView.rx.items(cellIdentifier: "a", cellType: UICollectionViewCell.self)) { (index: Int, item: Int, cell) in
}
return (collectionView, s)
}
ensureEventDeallocated(createView) { (view: UICollectionView) in view.rx.modelSelected(Int.self) }
}
func test_ModelSelected_itemsWithCellFactory() {
let items: Observable<[Int]> = Observable.just([1, 2, 3])
let layout = UICollectionViewFlowLayout()
layout.itemSize = CGSize(width: 20.0, height: 20.0)
let createView: () -> (UICollectionView, Disposable) = {
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 100, height: 100), collectionViewLayout: layout)
collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "a")
let s = items.bind(to: collectionView.rx.items) { (cv, index: Int, item: Int) -> UICollectionViewCell in
return collectionView.dequeueReusableCell(withReuseIdentifier: "a", for: IndexPath(item: index, section: 0))
}
return (collectionView, s)
}
let (collectionView, dataSourceSubscription) = createView()
var selectedItem: Int? = nil
let s = collectionView.rx.modelSelected(Int.self)
.subscribe(onNext: { (item: Int) in
selectedItem = item
})
collectionView.delegate!.collectionView!(collectionView, didSelectItemAt: IndexPath(row: 1, section: 0))
XCTAssertEqual(selectedItem, 2)
dataSourceSubscription.dispose()
s.dispose()
}
func test_ModelSelected_itemsWithCellIdentifier() {
let items: Observable<[Int]> = Observable.just([1, 2, 3])
let layout = UICollectionViewFlowLayout()
let createView: () -> (UICollectionView, Disposable) = {
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
collectionView.register(NSClassFromString("UICollectionViewCell"), forCellWithReuseIdentifier: "a")
let dataSourceSubscription = items.bind(to: collectionView.rx.items(cellIdentifier: "a")) { (index: Int, item: Int, cell) in
}
return (collectionView, dataSourceSubscription)
}
let (collectionView, dataSourceSubscription) = createView()
var selectedItem: Int? = nil
let s = collectionView.rx.modelSelected(Int.self)
.subscribe(onNext: { item in
selectedItem = item
})
collectionView.delegate!.collectionView!(collectionView, didSelectItemAt: IndexPath(row: 1, section: 0))
XCTAssertEqual(selectedItem, 2)
s.dispose()
dataSourceSubscription.dispose()
}
func test_ModelDeselected_itemsWithCellFactory() {
let items: Observable<[Int]> = Observable.just([1, 2, 3])
let layout = UICollectionViewFlowLayout()
layout.itemSize = CGSize(width: 20.0, height: 20.0)
let createView: () -> (UICollectionView, Disposable) = {
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 100, height: 100), collectionViewLayout: layout)
collectionView.register(NSClassFromString("UICollectionViewCell"), forCellWithReuseIdentifier: "a")
let s = items.bind(to: collectionView.rx.items) { (cv, index: Int, item: Int) -> UICollectionViewCell in
return collectionView.dequeueReusableCell(withReuseIdentifier: "a", for: IndexPath(item: index, section: 0))
}
return (collectionView, s)
}
let (collectionView, dataSourceSubscription) = createView()
var selectedItem: Int? = nil
let s = collectionView.rx.modelDeselected(Int.self)
.subscribe(onNext: { (item: Int) in
selectedItem = item
})
collectionView.delegate!.collectionView!(collectionView, didDeselectItemAt: IndexPath(row: 1, section: 0))
XCTAssertEqual(selectedItem, 2)
dataSourceSubscription.dispose()
s.dispose()
}
func test_ModelDeselected_itemsWithCellIdentifier() {
let items: Observable<[Int]> = Observable.just([1, 2, 3])
let layout = UICollectionViewFlowLayout()
let createView: () -> (UICollectionView, Disposable) = {
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
collectionView.register(NSClassFromString("UICollectionViewCell"), forCellWithReuseIdentifier: "a")
let dataSourceSubscription = items.bind(to: collectionView.rx.items(cellIdentifier: "a")) { (index: Int, item: Int, cell) in
}
return (collectionView, dataSourceSubscription)
}
let (collectionView, dataSourceSubscription) = createView()
var selectedItem: Int? = nil
let s = collectionView.rx.modelDeselected(Int.self)
.subscribe(onNext: { item in
selectedItem = item
})
collectionView.delegate!.collectionView!(collectionView, didDeselectItemAt: IndexPath(row: 1, section: 0))
XCTAssertEqual(selectedItem, 2)
s.dispose()
dataSourceSubscription.dispose()
}
func test_modelAtIndexPath_normal() {
let items: Observable<[Int]> = Observable.just([1, 2, 3])
let layout = UICollectionViewFlowLayout()
let createView: () -> (UICollectionView, Disposable) = {
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
collectionView.register(NSClassFromString("UICollectionViewCell"), forCellWithReuseIdentifier: "a")
let dataSource = SectionedViewDataSourceMock()
let dataSourceSubscription = items.bind(to: collectionView.rx.items(dataSource: dataSource))
return (collectionView, dataSourceSubscription)
}
let (collectionView, dataSourceSubscription) = createView()
let model: Int = try! collectionView.rx.model(at: IndexPath(item: 1, section: 0))
XCTAssertEqual(model, 2)
dataSourceSubscription.dispose()
}
// #if os(tvOS)
//
// func test_didUpdateFocusInContextWithAnimationCoordinator() {
// let items: Observable<[Int]> = Observable.just([1, 2, 3])
//
// let layout = UICollectionViewFlowLayout()
// let createView: () -> (UICollectionView, Disposable) = {
// let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
// collectionView.register(NSClassFromString("UICollectionViewCell"), forCellWithReuseIdentifier: "a")
// let dataSource = SectionedViewDataSourceMock()
// let dataSourceSubscription = items.bind(to: collectionView.rx.items(dataSource: dataSource))
//
// return (collectionView, dataSourceSubscription)
//
// }
//
// let (collectionView, dataSourceSubscription) = createView()
//
// var resultContext: UICollectionViewFocusUpdateContext? = nil
// var resultAnimationCoordinator: UIFocusAnimationCoordinator? = nil
//
// let subscription = collectionView.rx.didUpdateFocusInContextWithAnimationCoordinator
// .subscribe(onNext: { args in
// let (context, animationCoordinator) = args
// resultContext = context
// resultAnimationCoordinator = animationCoordinator
// })
//
// let context = UICollectionViewFocusUpdateContext()
// let animationCoordinator = UIFocusAnimationCoordinator()
//
// XCTAssertEqual(resultContext, nil)
// XCTAssertEqual(resultAnimationCoordinator, nil)
//
// collectionView.delegate!.collectionView!(collectionView, didUpdateFocusIn: context, with: animationCoordinator)
//
// XCTAssertEqual(resultContext, context)
// XCTAssertEqual(resultAnimationCoordinator, animationCoordinator)
//
// subscription.dispose()
// dataSourceSubscription.dispose()
// }
// #endif
}
extension UICollectionViewTests {
func testDataSourceIsBeingRetainedUntilDispose() {
var dataSourceDeallocated = false
var collectionViewOuter: UICollectionView? = nil
var dataSourceSubscription: Disposable!
collectionViewOuter?.becomeFirstResponder()
autoreleasepool {
let items: Observable<[Int]> = Observable.just([1, 2, 3])
let layout = UICollectionViewFlowLayout()
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "a")
collectionViewOuter = collectionView
let dataSource = SectionedViewDataSourceMock()
dataSourceSubscription = items.bind(to: collectionView.rx.items(dataSource: dataSource))
_ = dataSource.rx.deallocated.subscribe(onNext: { _ in
dataSourceDeallocated = true
})
}
XCTAssert(dataSourceDeallocated == false)
autoreleasepool { dataSourceSubscription.dispose() }
XCTAssert(dataSourceDeallocated == true)
}
func testDataSourceIsBeingRetainedUntilCollectionViewDealloc() {
var dataSourceDeallocated = false
autoreleasepool {
let items: Observable<[Int]> = Observable.just([1, 2, 3])
let layout = UICollectionViewFlowLayout()
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "a")
let dataSource = SectionedViewDataSourceMock()
_ = items.bind(to: collectionView.rx.items(dataSource: dataSource))
_ = dataSource.rx.deallocated.subscribe(onNext: { _ in
dataSourceDeallocated = true
})
XCTAssert(dataSourceDeallocated == false)
}
XCTAssert(dataSourceDeallocated == true)
}
func testSetDataSourceUsesWeakReference() {
var dataSourceDeallocated = false
let layout = UICollectionViewFlowLayout()
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
autoreleasepool {
collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "a")
let dataSource = SectionedViewDataSourceMock()
_ = collectionView.rx.setDataSource(dataSource)
_ = dataSource.rx.deallocated.subscribe(onNext: { _ in
dataSourceDeallocated = true
})
XCTAssert(dataSourceDeallocated == false)
}
XCTAssert(dataSourceDeallocated == true)
}
func testDataSourceIsResetOnDispose() {
var disposeEvents: [String] = []
let items: Observable<[Int]> = Observable.just([1, 2, 3]).concat(Observable.never())
.do(onDispose: {
disposeEvents.append("disposed")
})
let layout = UICollectionViewFlowLayout()
let createView: () -> (UICollectionView, Disposable) = {
let collectionView = UICollectionView(frame: CGRect(x: 0, y: 0, width: 1, height: 1), collectionViewLayout: layout)
collectionView.register(NSClassFromString("UICollectionViewCell"), forCellWithReuseIdentifier: "a")
let dataSource = SectionedViewDataSourceMock()
let dataSourceSubscription = items.bind(to: collectionView.rx.items(dataSource: dataSource))
let fakeVC = UIViewController()
fakeVC.view.addSubview(collectionView)
let window = UIWindow(frame: UIScreen.main.bounds)
window.rootViewController = fakeVC
window.makeKeyAndVisible()
return (collectionView, dataSourceSubscription)
}
let (collectionView, dataSourceSubscription) = createView()
XCTAssertTrue(collectionView.dataSource === RxCollectionViewDataSourceProxy.proxy(for: collectionView))
_ = collectionView.rx.sentMessage(#selector(UICollectionView.layoutIfNeeded)).subscribe(onNext: { _ in
disposeEvents.append("layoutIfNeeded")
})
_ = collectionView.rx.sentMessage(NSSelectorFromString("setDataSource:")).subscribe(onNext: { arguments in
let isNull = NSNull().isEqual(arguments[0])
disposeEvents.append("setDataSource:\(isNull ? "nil" : "nn")")
})
XCTAssertEqual(disposeEvents, [])
dataSourceSubscription.dispose()
XCTAssertEqual(disposeEvents, ["disposed", "layoutIfNeeded", "setDataSource:nil", "setDataSource:nn"])
XCTAssertTrue(collectionView.dataSource === collectionView.rx.dataSource)
}
}
| 41.986842 | 176 | 0.658688 |
b07d7bd8f4d90ad6ec7d41460504feb5741967e6 | 5,295 | html | HTML | Platform/submit.html | abhishek-arya1/ByteCode | 00ec4516f45324e681c25f4f5d3a5220d05b660a | [
"MIT"
] | null | null | null | Platform/submit.html | abhishek-arya1/ByteCode | 00ec4516f45324e681c25f4f5d3a5220d05b660a | [
"MIT"
] | null | null | null | Platform/submit.html | abhishek-arya1/ByteCode | 00ec4516f45324e681c25f4f5d3a5220d05b660a | [
"MIT"
] | null | null | null | <!DOCTYPE html>
<html lang="en">
<!-- ByteCode By Abhishek Arya -->
<head>
<title>ByteCode | Submit a Resource</title>
<link rel="shortcut icon" href="assets/img/favicon.png">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--===============================================================================================-->
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/animate/animate.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/animsition/css/animsition.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/daterangepicker/daterangepicker.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="css/util.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<!--===============================================================================================-->
</head>
<body>
<div class="container-contact100">
<div class="wrap-contact100">
<form action="submit_form.php" method="post" class="contact100-form validate-form">
<span class="contact100-form-title">
Submit a Resource
</span>
<div class="wrap-input100 validate-input" data-validate="Enter the name of the Resource">
<input class="input100" type="text" name="Name" placeholder="Name">
<span class="focus-input100"></span>
</div>
<div class="wrap-input100 validate-input" data-validate = "Please enter a Rating">
<input class="input100" type="text" name="Rating" placeholder="Rating">
<span class="focus-input100"></span>
</div>
<div class="wrap-input100 validate-input" data-validate = "Please enter Link">
<input class="input100" type="text" name="Link" placeholder="Link">
<span class="focus-input100"></span>
</div>
<div class="wrap-input100 validate-input" data-validate = "Please enter description">
<textarea class="input100" name="Des" placeholder="Description"></textarea>
<span class="focus-input100"></span>
</div>
<div class="wrap-input100 validate-input" data-validate = "Please enter category">
<input class="input100" name="Category" placeholder="Category/Tags">
<span class="focus-input100"></span>
</div>
<div class="container-contact100-form-btn">
<button class="contact100-form-btn">
<span>
<i class="fa fa-paper-plane-o m-r-6" aria-hidden="true"></i>
Submit
</span>
</button>
</div>
</form>
</div>
</div>
<div id="dropDownSelect1"></div>
<!--===============================================================================================-->
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/animsition/js/animsition.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/bootstrap/js/popper.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/select2/select2.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/daterangepicker/moment.min.js"></script>
<script src="vendor/daterangepicker/daterangepicker.js"></script>
<!--===============================================================================================-->
<script src="vendor/countdowntime/countdowntime.js"></script>
<!--===============================================================================================-->
<script src="js/main.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-23581568-13"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-23581568-13');
</script>
</body>
<!-- ByteCode By Abhishek Arya -->
</html>
| 44.495798 | 102 | 0.455713 |
32c097caf9ce4903eb8e40120320d608971f9f46 | 636 | swift | Swift | CleanStore/CleanStore/App/Scenes/SignUp/Router/SignUpRouter.swift | dangquochoi2007/cleancodeswift | 3e8cb4b844a7c0aaae7e8a48affc894b6d49e99b | [
"MIT"
] | 1 | 2020-12-10T15:04:02.000Z | 2020-12-10T15:04:02.000Z | CleanStore/CleanStore/App/Scenes/SignUp/Router/SignUpRouter.swift | dangquochoi2007/cleancodeswift | 3e8cb4b844a7c0aaae7e8a48affc894b6d49e99b | [
"MIT"
] | null | null | null | CleanStore/CleanStore/App/Scenes/SignUp/Router/SignUpRouter.swift | dangquochoi2007/cleancodeswift | 3e8cb4b844a7c0aaae7e8a48affc894b6d49e99b | [
"MIT"
] | 1 | 2020-12-10T15:04:07.000Z | 2020-12-10T15:04:07.000Z | //
// SignUpRouter.swift
// CleanStore
//
// Created by hoi on 16/6/17.
// Copyright (c) 2017 hoi. All rights reserved.
//
import UIKit
protocol SignUpRouterProtocol {
weak var viewController: SignUpViewController? { get }
func navigateToSomewhere()
}
final class SignUpRouter {
weak var viewController: SignUpViewController?
// MARK: - Initializers
init(viewController: SignUpViewController?) {
self.viewController = viewController
}
}
// MARK: - SignUpRouterProtocol
extension SignUpRouter: SignUpRouterProtocol {
// MARK: - Navigation
func navigateToSomewhere() {
}
}
| 14.790698 | 58 | 0.687107 |
84ad7ecbb7479ffb242fa75eb2ded18a068c183c | 6,842 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_101.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_101.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_101.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x2835, %rbp
nop
nop
nop
nop
sub %rdx, %rdx
movl $0x61626364, (%rbp)
and %rax, %rax
lea addresses_WT_ht+0x1ae75, %rbp
clflush (%rbp)
nop
nop
nop
nop
nop
xor %r11, %r11
movl $0x61626364, (%rbp)
nop
xor $44212, %r11
lea addresses_normal_ht+0xc56f, %r14
nop
nop
nop
nop
nop
and $3732, %rdx
mov $0x6162636465666768, %rbp
movq %rbp, %xmm2
and $0xffffffffffffffc0, %r14
movntdq %xmm2, (%r14)
nop
nop
nop
nop
dec %r14
lea addresses_WT_ht+0x1c1b, %rbp
nop
nop
nop
nop
and %rdi, %rdi
mov $0x6162636465666768, %r13
movq %r13, (%rbp)
nop
dec %rbp
lea addresses_UC_ht+0x1845b, %r14
nop
nop
nop
nop
inc %rdx
movb $0x61, (%r14)
xor $17388, %r11
lea addresses_normal_ht+0x1715, %rax
nop
inc %r13
mov $0x6162636465666768, %rdi
movq %rdi, (%rax)
nop
and $48177, %rax
lea addresses_WC_ht+0x35b, %rdi
nop
and %rdx, %rdx
mov (%rdi), %rax
nop
nop
nop
nop
cmp $22263, %r14
lea addresses_A_ht+0x373f, %rdx
nop
cmp %r13, %r13
movl $0x61626364, (%rdx)
nop
nop
nop
sub %rdi, %rdi
lea addresses_UC_ht+0x1ae5b, %rax
add $13950, %rdi
movb (%rax), %r11b
nop
nop
nop
nop
nop
add $1059, %rbp
lea addresses_WC_ht+0x17f5b, %r11
nop
nop
xor %rax, %rax
mov (%r11), %edx
nop
nop
nop
nop
inc %r13
lea addresses_D_ht+0xfd5b, %rsi
lea addresses_normal_ht+0xe03d, %rdi
dec %r13
mov $45, %rcx
rep movsq
nop
nop
nop
nop
nop
and $10549, %rax
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r8
push %r9
push %rbp
push %rdx
push %rsi
// Load
mov $0x9f3, %rbp
nop
cmp $61212, %rsi
movups (%rbp), %xmm1
vpextrq $1, %xmm1, %r9
nop
and %rsi, %rsi
// Faulty Load
lea addresses_PSE+0x1315b, %rdx
nop
nop
and $49998, %r14
movb (%rdx), %r10b
lea oracles, %r9
and $0xff, %r10
shlq $12, %r10
mov (%r9,%r10,1), %r10
pop %rsi
pop %rdx
pop %rbp
pop %r9
pop %r8
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_P', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 36.010526 | 2,999 | 0.656241 |
53c24a0b53b6acfdefdaefba67528cf04b46502e | 723 | java | Java | src/main/java/safeforhall/logic/parser/ExportCommandParser.java | gordonlzy/tp | 85de4e33e88a54cf9edfd5b034dec6973e61c5f4 | [
"MIT"
] | 1 | 2021-09-11T14:41:31.000Z | 2021-09-11T14:41:31.000Z | src/main/java/safeforhall/logic/parser/ExportCommandParser.java | gordonlzy/tp | 85de4e33e88a54cf9edfd5b034dec6973e61c5f4 | [
"MIT"
] | 167 | 2021-09-11T09:21:57.000Z | 2021-11-11T06:09:42.000Z | src/main/java/safeforhall/logic/parser/ExportCommandParser.java | gordonlzy/tp | 85de4e33e88a54cf9edfd5b034dec6973e61c5f4 | [
"MIT"
] | 5 | 2021-09-11T09:06:22.000Z | 2021-09-15T15:53:12.000Z | package safeforhall.logic.parser;
import static java.util.Objects.requireNonNull;
import safeforhall.logic.commands.ExportCommand;
import safeforhall.logic.parser.exceptions.ParseException;
public class ExportCommandParser implements Parser<ExportCommand> {
/**
* Parses the given {@code String} of arguments in the context of the ExportCommand
* and returns a ExportCommand object for execution.
* @throws ParseException if the user input does not conform the expected format
*/
public ExportCommand parse(String args) throws ParseException {
requireNonNull(args);
String fileName = ParserUtil.parseExportFileName(args);
return new ExportCommand(fileName);
}
}
| 32.863636 | 87 | 0.753804 |
a60d9d9374d7bc94c31dc411d818db8c5e022717 | 2,939 | swift | Swift | PeopleAndAppleStockPrices/PeopleAndAppleStockPrices/StocksViewController.swift | kcamp92/Pursuit-Core-iOS-Unit3-Assignment1 | eb23ae82c96834b72d2d77ceb73535aa0dca2cf6 | [
"MIT"
] | null | null | null | PeopleAndAppleStockPrices/PeopleAndAppleStockPrices/StocksViewController.swift | kcamp92/Pursuit-Core-iOS-Unit3-Assignment1 | eb23ae82c96834b72d2d77ceb73535aa0dca2cf6 | [
"MIT"
] | null | null | null | PeopleAndAppleStockPrices/PeopleAndAppleStockPrices/StocksViewController.swift | kcamp92/Pursuit-Core-iOS-Unit3-Assignment1 | eb23ae82c96834b72d2d77ceb73535aa0dca2cf6 | [
"MIT"
] | null | null | null | //
// StocksViewController.swift
// PeopleAndAppleStockPrices
//
// Created by Krystal Campbell on 9/6/19.
// Copyright © 2019 Pursuit. All rights reserved.
//
import UIKit
class StocksViewController: UIViewController, UITableViewDataSource {
@IBOutlet weak var StocksTableView: UITableView!
// var stockInfo = [Stocks]().sorted(by: {$0.date > $1.date}) {
// didSet{
// StocksTableView.reloadData()
// }
// }
//
var stockInfo = [StocksByMonthAndYear]()
override func viewDidLoad() {
super.viewDidLoad()
loadStockData()
StocksTableView.dataSource = self
StocksTableView.delegate = self
}
private func loadStockData() {
stockInfo = Stocks.getStocksSortedByMonthAndYear()
}
//
// func loadStockData() {
// guard let pathToData = Bundle.main.path(forResource: "applstockinfo", ofType:"json")
// else {
// fatalError("applstockinfo.json file not found")
// }
// let internalUrl = URL(fileURLWithPath: pathToData)
// do {
// let data = try Data(contentsOf: internalUrl)
// let stocksFromJSON = try
// stockInfo = Stocks.getStocksData()
// } catch {
// print(error)
// }
// }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// return stockInfo.count
return stockInfo[section].stocks.count
}
func numberOfSections(in tableView: UITableView) -> Int {
return stockInfo.count
}
func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
let stock = stockInfo[section]
return "\(stock.month) \(stock.year).AVG: \(stock.getMonthAverage())"
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// let rowToSetup = indexPath.row
//let currentSection = indexPath.section
// let dateAtRow = stockInfo[currentSection][rowToSetup]
let stock = stockInfo[indexPath.section].stocks[indexPath.row]
let cell = StocksTableView.dequeueReusableCell(withIdentifier: "stockCell", for: indexPath)
// let setupInfo = stockInfo[indexPath.row]
cell.textLabel?.text = "\(stock.day) \(stock.month) \(stock.year)"
cell.detailTextLabel?.text = "\(stock.open)"
return cell
}
}
extension StocksViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if let storyBoard = storyboard?.instantiateViewController(withIdentifier: "StockDetailViewController") as? StockDetailViewController{
storyBoard.allStocks = stockInfo[indexPath.section].stocks[indexPath.row]
navigationController?.pushViewController(storyBoard, animated: true)
}
}
}
| 33.397727 | 141 | 0.641375 |
6ca523f1c61d3bcfa4bc54975b73511e657a4ad6 | 584 | go | Go | mutation_options.go | ssor/dgraph_memory_loader | 8acb65ce8ac36a99afc283a6df108fb77e4a8913 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:10:14.000Z | 2021-04-16T07:10:14.000Z | mutation_options.go | ssor/dgraph_memory_loader | 8acb65ce8ac36a99afc283a6df108fb77e4a8913 | [
"Apache-2.0"
] | null | null | null | mutation_options.go | ssor/dgraph_memory_loader | 8acb65ce8ac36a99afc283a6df108fb77e4a8913 | [
"Apache-2.0"
] | null | null | null | package dgraph_live_client
import (
"context"
"math"
)
func NewBatchMutaionOptions(batchSize, concurrent int) BatchMutationOptions {
ctx := context.Background()
options := BatchMutationOptions{
Size: batchSize,
Pending: concurrent,
PrintCounters: true,
Ctx: ctx,
MaxRetries: math.MaxUint32,
}
return options
}
type BatchMutationOptions struct {
Size int
Pending int
PrintCounters bool
MaxRetries uint32
// User could pass a context so that we can stop retrying requests once context is done
Ctx context.Context
}
| 20.857143 | 88 | 0.705479 |
c4a4ec96f97a53a07d6ac8a96071f89e81d95c53 | 2,132 | h | C | usr/libexec/locationd/CMPedometerTable.h | lechium/tvOS130Headers | 6b47cdcd4a6f453b399aa9d742b5d0f7e3f732fd | [
"MIT"
] | 11 | 2019-11-06T04:48:48.000Z | 2022-02-09T17:48:15.000Z | usr/libexec/locationd/CMPedometerTable.h | lechium/tvOS130Headers | 6b47cdcd4a6f453b399aa9d742b5d0f7e3f732fd | [
"MIT"
] | 1 | 2020-04-16T01:41:56.000Z | 2020-04-16T04:32:00.000Z | usr/libexec/locationd/CMPedometerTable.h | lechium/tvOS130Headers | 6b47cdcd4a6f453b399aa9d742b5d0f7e3f732fd | [
"MIT"
] | 3 | 2019-12-22T20:17:53.000Z | 2021-01-25T09:47:49.000Z | /*
* This header is generated by classdump-dyld 1.0
* on Tuesday, November 5, 2019 at 3:11:45 PM Mountain Standard Time
* Operating System: Version 13.0 (Build 17J586)
* Image Source: /usr/libexec/locationd
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos.
*/
#import <locationd/locationd-Structs.h>
@class NSString, NSMutableArray;
@interface CMPedometerTable : NSObject {
NSString* _tableName;
NSString* _valueInName;
NSString* _valueOutName;
double _defaultValue;
vector<double, std::__1::allocator<double> >* _binBoundariesWalk;
vector<double, std::__1::allocator<double> >* _binBoundariesRun;
vector<double, std::__1::allocator<double> >* _binBoundaries;
BOOL _testMode;
CLPersistentStore* _persistentStore;
NSMutableArray* _bins;
}
+(id)convertToCMStrideCalibrationData:(id)arg1 ;
+(id)convertToCMPedometerBins:(id)arg1 ;
-(id)description;
-(void)dealloc;
-(BOOL)testMode;
-(void)logBins;
-(id)defaultBins;
-(unsigned long long)binIndexForValueIn:(double)arg1 ;
-(BOOL)isNativeValueOutAvailableInBinsFromIndex:(unsigned long long)arg1 withLength:(unsigned long long)arg2 ;
-(BOOL)isBin:(unsigned long long)arg1 sameActivityAsBin:(unsigned long long)arg2 ;
-(void)updateNativeBin:(unsigned long long)arg1 withAlpha:(double)arg2 valueOut:(double)arg3 ;
-(void)updateAdjacentBin:(unsigned long long)arg1 withAlpha:(double)arg2 valueOut:(double)arg3 nativeBin:(unsigned long long)arg4 ;
-(id)initWithTableName:(id)arg1 valueInName:(id)arg2 valueOutName:(id)arg3 defaultValue:(double)arg4 binBoundariesWalk:(vector<double, std::__1::allocator<double> >*)arg5 binBoundariesRun:(vector<double, std::__1::allocator<double> >*)arg6 testMode:(BOOL)arg7 ;
-(void)setBins:(id)arg1 ;
-(id)copyBins;
-(void)updateBinsWithValueOut:(double)arg1 valueIn:(double)arg2 alpha:(double)arg3 ;
-(BOOL)isWalkNativeValueOutAvailable;
-(BOOL)isRunNativeValueOutAvailable;
-(SCD_Struct_CL46)binIntervalForValueIn:(double)arg1 ;
-(double)valueOutForValueIn:(double)arg1 ;
-(BOOL)isValueInValid:(double)arg1 ;
-(BOOL)isValueInRun:(double)arg1 ;
-(void)binsDidChange;
-(unsigned long long)walkBinCount;
@end
| 40.226415 | 261 | 0.782364 |