text stringlengths 1 1.05M |
|---|
#!/usr/bin/env bash
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-----------------... |
<filename>src-rx/src/components/Utils.js
/**
* Copyright 2018-2021 bluefox <<EMAIL>>
*
* MIT License
*
**/
import React from 'react';
import I18n from '@iobroker/adapter-react/i18n';
const NAMESPACE = 'material';
const days = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];
const months = ['Jan', 'Feb', 'Mar', 'Apr', ... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IllegalArgumentError = void 0;
const client_error_js_1 = require("./client.error.js");
class IllegalArgumentError extends client_error_js_1.ClientError {
constructor(message, paramName) {
super(`Illegal argument${paramName ... |
// pages/destination/destination.js
Page({
data:{
hotcity:["热门","周边","香港","澳门","海南","云南"],
nearbyCity:["昆明","红河","西双版纳","大理","文山","楚雄","丽江","香港"],
active:5,
hotView:[{
title:"大理三塔",
imgUrl:"/images/destination/view1.png"
},{
title:"丽江古城",
imgUrl:"/images/destination/view2.p... |
import torch
from torchvision.datasets import FashionMNIST
from torchvision import transforms
FASHION_MNIST_CLASSES = [
"T-shirt/top", "Trouser", "Pullover", "Dress", "Coat",
"Sandal", "Shirt", "Sneaker", "Bag", "Ankle boot"
]
def output_label(label):
output_mapping = {i: value for i, value in enumerate(F... |
#!/usr/bin/env bash
set -e
echo "Enter release version: "
read VERSION
read -p "Releasing $VERSION - are you sure? (y/n)" -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Releasing $VERSION ..."
# npm test
VERSION=$VERSION npm run build
# commit
git add -A
git commit -... |
import { formatFlux } from '../util/format';
export interface IAccount {
id: string,
username: string,
idToken: string,
//TODO source of bug? on check auth need to check expiresIn also?
//Actually get a 401 so better with a account action that triggers a redirect to login and resets all stat... |
import { css } from '@emotion/react';
import { useTheme } from '@mui/material';
export const useStyles = () => {
const theme = useTheme();
const getLabel = ({ hasError }: { hasError: boolean }) => css`
display: block;
margin-bottom: 4px;
${hasError && `color: ${theme.palette.error.main};`};
`;
c... |
#!/bin/bash
set -e
#set -o xtrace
mkdir "$HOME/static-libs"
cp "$HOME/ltsmin-deps/lib/libzmq.a" "$HOME/static-libs"
cp "$HOME/ltsmin-deps/lib/libczmq.a" "$HOME/static-libs"
cp /usr/local/lib/libgmp.a "$HOME/static-libs"
cp /usr/local/lib/libpopt.a "$HOME/static-libs"
libxml2_version=$(brew list --versions libxml2 | c... |
#! /bin/bash
# This script expects to be executed with the current working directory:
#
# kgtk/datasets/time-machine-20101201
source common.sh
# ==============================================================================
echo -e "\nCount the properties in ${DATADIR}/${WIKIDATA_ALL_EDGES}-sorted.tsv."
kgtk ${KGTK_F... |
#!/bin/sh
echo
echo "### Cleaning the Draft folder"
echo
echo "* offset: $3 (Number of Nightly revision to keep)"
echo
revisionToDelete=$(slicer_package_manager_client --api-url $1 --api-key $2 draft list Slicer --offset $3 | tail -n +3 | cut -d' ' -f1)
echo "List of resource to delete:"
echo
for rev in $revisionTo... |
<reponame>huangjianqin/bigdata<filename>kin-jraft/kin-jraft-starter/src/test/java/org/kin/jraft/springboot/counter/server/CounterRaftServiceSpringBootTest.java<gh_stars>1-10
package org.kin.jraft.springboot.counter.server;
import org.kin.jraft.NodeStateChangeListener;
import org.kin.jraft.RaftServiceFactory;
import or... |
#!/bin/bash
set -eo pipefail
SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd)
PROJECT_DIR=$1
shift
"$@" ./src/play/play \
RQEJDEN \
"${SCRIPT_DIR}/tiles.txt" \
"${PROJECT_DIR}/boards/wwf_challenge.txt"
|
<reponame>gcusnieux/jooby
package morphia;
import javax.inject.Inject;
import org.mongodb.morphia.annotations.PreLoad;
public class MyListener {
private Service service;
@Inject
public MyListener(final Service service) {
this.service = service;
}
@PreLoad void preLoad(final Beer object) {
servic... |
#!/bin/bash
dr=/home/stream_vid/Dokumente/latex/Script_Diff_Gal
if [ "$1" == "" ]
then
dr="$dr"07/
echo "No path adjunct, checking:"
echo $dr
fl=$dr/script_diff_gal.tks
if [ -e $fl ]
then
echo "opening $fl as texmaker session file"
texmaker $fl &
else
echo "No such file found: $fl"
... |
<filename>kattis/backspace.cc
// https://open.kattis.com/problems/backspace
#include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
string s2;
for (auto c : s) {
if (c == '<') {
if (!s.empty()) s2.pop_back();
} else s2.push_back(c);
}
cout << s2 << endl;
}
|
<gh_stars>1-10
# encoding: utf-8
require 'logstash/devutils/rspec/spec_helper'
require 'logstash/outputs/adls'
describe 'outputs/adls' do
let(:adls_fqdn) { 'XXXXXXXXXXX.azuredatalakestore.net' }
let(:adls_token_endpoint) { 'https://login.microsoftonline.com/<KEY>' }
let(:adls_client_id) { '00000000-0000-0000-00... |
<gh_stars>10-100
import createFakeElement from 'tests/createFakeElement'
import { Anchor, createAnchorWithPoint } from './anchor';
import { DIRECTION } from './consts';
test('createAnchorWithPoint direction top', () => {
const anchor: Anchor = {
node: createFakeElement({
x: 750,
y: 450,
width: ... |
package tree.symbols;
import tree.DefaultTreeNodeSymbol;
public class TSBraceRight extends DefaultTreeNodeSymbol {
public static int id = BRACE_RIGHT;
public static String text = "}";
public TSBraceRight() {
super(text, id);
}
}
|
<gh_stars>1-10
import { Component, OnInit } from '@angular/core';
import { FormBuilder,FormGroup,Validators } from '@angular/forms';
import Swal from 'sweetalert2';
import { flyInOut , expand} from '../../Utilities/animations/animation';
import { SharingService } from 'src/app/services/sharing.service';
@Component({
... |
<gh_stars>0
from clip import Clip
class User:
def __init__(self, *args):
if isinstance(args[0], str):
self.login = args[0]
self.clips_recent = []
self.clips_trending = []
self.clips_ignored = []
self.mu = 0
self.std = 0
elif is... |
package sportsstore.dto;
public class ImportedProductDTO {
private ProductDTO product;
private int quantity;
public ProductDTO getProduct() {
return product;
}
public void setProduct(ProductDTO product) {
this.product = product;
}
public int getQuantity() {
return... |
<filename>tournament/origins.js
module.exports = function(deck) {
allowedCards = ("4sa 4sj 4sk 4sl 4sm 4sn 4so 4sp 4sq 4sr 4ss 4st 4su 4t3 4t4 4t5 4vc 4vd 4ve 4vf 4vg 4vh 4vi 4vj 4vk 4vl 4vm 52g 52h 52i 52j 52k 52l 52m 52n 52o 52p 52q 52r 55k 55l 55m 55n 55o 55p 55q 55r 55s 55t 55u 58o 58p 58q 58r 58s 58t 58u 58v 590 ... |
/*
recast4j copyright (c) 2021 <NAME> <EMAIL>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applic... |
#!/bin/bash
PDIR=env/occo
echo "Reseting '$PDIR'"
rm -rf "$PDIR"
virtualenv -p python3 "$PDIR"
source "$PDIR"/bin/activate
pip install -r requirements_test.txt --find-links https://pip3.lpds.sztaki.hu/packages --no-index
#cat /etc/grid-security/certificates/*.pem >> $(python -m requests.certs)
set +ex
echo "It's ... |
#!/usr/bin/env bash
# Copyright 2020 Chaos Mesh Authors.
#
# 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 ... |
package com.github.shimmerjordan.common.security.utils;
import com.github.shimmerjordan.common.core.utils.SpringContextHolder;
import com.github.shimmerjordan.common.security.constant.SecurityConstant;
import com.github.shimmerjordan.common.security.tenant.TenantContextHolder;
import lombok.extern.slf4j.Slf4j;
import ... |
<reponame>rockenbf/ze_oss<filename>imp_core/include/imp/core/roi.hpp
// Copyright (c) 2015-2016, ETH Zurich, <NAME>, Zurich Eye
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistr... |
#!/bin/bash
# Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
#include "app_mainwindow.h"
#include <lib/fpconv.h>
namespace M
{
namespace App
{
MainWindow::MainWindow ()
{
setupUi (this);
setMinimumWidth (3 * logicalDpiX ());
connect (_input_wgt, &QLineEdit::textChanged, this, &MainWindow::updateNumber);
connect (_prec_wgt, static_cast <void... |
<filename>app/src/main/java/sample/sadashiv/examplerealmmvp/ui/adapter/BookGridAdapter.java
package sample.sadashiv.examplerealmmvp.ui.adapter;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
im... |
package db
import (
"context"
"errors"
"github.com/golark/utaskdaemon/dbcontainer"
log "github.com/sirupsen/logrus"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)
// MongoConn
// db connection
type MongoConn struct {
uri string
... |
#include <gtest/gtest.h>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <vector>
#include <gbwtgraph/algorithms.h>
#include <gbwtgraph/gfa.h>
#include "shared.h"
using namespace gbwtgraph;
namespace
{
//------------------------------------------------------------------------------
class Co... |
#!/usr/bin/env bash
#== Import script args ==
timezone=$(echo "$1")
#== Bash helpers ==
function info {
echo " "
echo "--> $1"
echo " "
}
#== Provision script ==
info "Provision-script user: `whoami`"
export DEBIAN_FRONTEND=noninteractive
info "Adding EPEL repos"
yum update -y
yum install epel-release yum... |
(function() {
var APP_name = 343,
test_name = 4,
me,
that,
self;
console.log( A, Gone, Expected );
That = this;
self = this;
That = self = this;
me = this;
try {
} catch( e ) {
}
}); |
#!/bin/bash
#SBATCH --account=def-dkulic
#SBATCH --mem=8000M # memory per node
#SBATCH --time=23:00:00 # time (DD-HH:MM)
#SBATCH --output=/project/6001934/lingheng/Double_DDPG_Job_output/continuous_RoboschoolHopper-v1_ddpg_softcopy_epsilon_greedy_seed4_run9_%N-%j.out # %N for node name, %j for job... |
<reponame>isandlaTech/cohorte-runtime<gh_stars>1-10
/**
* Copyright 2014 isandlaTech
*
* 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
... |
#!/bin/bash
cd /home/ros2/leogate/ros2-native
source /home/ros2/leogate/ros2-native/install/setup.bash
colcon build |
// All commands converted to Javascript by using "tsc"
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const discord_js_1 = require("discord.js");
exports.default = {
name: 'customembed',
description: 'Customembed | code in desc!',
usage: 'customembed <title> <desc>',
alias... |
package com.digirati.taxman.rest.server.taxonomy.mapper;
import com.digirati.taxman.common.rdf.RdfModelException;
import com.digirati.taxman.common.rdf.RdfModelFactory;
import com.digirati.taxman.common.taxonomy.ConceptSchemeModel;
import com.digirati.taxman.rest.server.taxonomy.identity.ConceptIdResolver;
import com.... |
#!/bin/bash
# sb --gres=gpu:titan_xp:rtx --cpus-per-task=16 --mem=100G coco_run.sh
export MASTER_ADDR="0.0.0.0"
export MASTER_PORT="8088"
export NODE_RANK=0
#SBATCH --mail-type=ALL # mail configuration: NONE, BEGIN, END, FAIL, REQUEUE, ALL
#SBATCH --output=%j.out # where to store the... |
def is_armstrong_number(num):
digits_sum = 0
num_string = str(num)
for digit in num_string:
digits_sum += int(digit)**len(num_string)
return digits_sum == num |
#!/usr/bin/env bash
export PATH=$PATH:$(dirname $0)
input=$1
min_window=$2
max_window=$3
false_num=$4
output=$5
pass "$input" "$min_window" "$max_window" "$false_num" "$output" >/dev/null
sed -i -e 's/\t\t*/\t/g' "$output"
|
package com.yoga.points.summary.service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yoga.core.base.BaseService;
import com.yoga.core.data.tuple.TwoTuple;
import com.yoga.core.exception.BusinessException;
import com.yoga.core.mybatis.MapperQuery;
import com.yoga.logging.... |
import Foundation
class ThreadSafeLogger {
private var privateByteCounter: UInt64 = 0
private var privateModificationTracker: TimeInterval = 0
private let lockQueue = DispatchQueue(label: "com.example.logQueue", attributes: .concurrent)
/// The size of this log file in bytes.
var sizeInBytes: UInt... |
import React, { Component } from 'react';
import { Card, Icon, Image } from 'semantic-ui-react'
import DefaultAvatar from '../../assets/default-avatar.png'
class UserInfo extends Component {
render(){
return(
<Card>
<Image src={DefaultAvatar} />
<Card.Content>
<Card.Header>{this.... |
<reponame>Codernauti/Sweetie<filename>app/src/main/java/com/codernauti/sweetie/couple/CoupleDetailsContract.java
package com.codernauti.sweetie.couple;
import android.net.Uri;
import java.util.Date;
public interface CoupleDetailsContract {
interface View {
void setPresenter(Presenter presenter);
... |
<reponame>Hannah-Abi/python-pro-21
import unittest
from unittest.mock import patch
from tmc import points
from tmc.utils import load, load_module, reload_module, get_stdout, check_source
from functools import reduce
import os
import textwrap
exercise = 'src.everything_reversed'
function = 'everything_reversed'
def g... |
<reponame>liuzhiyi1992/UCToutiaoClone
//
// UCTWebViewController.h
// UCToutiaoClone
//
// Created by zhiyi on 16/10/12.
// Copyright © 2016年 lzy. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "UCTViewController.h"
@interface UCTWebViewController : UCTViewController
- (instancetype)initWithRequestUrlStr... |
/*
* Copyright (c) CERN 2013-2015
*
* Copyright (c) Members of the EMI Collaboration. 2010-2013
* See http://www.eu-emi.eu/partners for details on the copyright
* holders.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*... |
import {AnimationData, AsynchronousAnimator, SynchronousAnimator, TextAnimation} from "../index";
class GSAPAsyncAnimator implements AsynchronousAnimator {
private readonly sync: SynchronousAnimator;
constructor(syncAnimator: SynchronousAnimator) {
this.sync = syncAnimator;
}
AnimateText(e: Element, text: ... |
package com.chankin.ssms.core.feature.orm.dataSources;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
public class DataSourceTypeManager extends AbstractRoutingDataSource {
private static final ThreadLocal<DataSources> dataSourceTypes = new ThreadLocal<DataSources>() {
@Overr... |
package org.jeecg.modules.bim.mapper;
import java.util.List;
import org.jeecg.modules.bim.entity.BimModelAttrsCategoriesProps;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/**
* @Description: 模型属性类别属性
* @Author: jeecg-boot
* @Date: 2021-12-25
* @Version: V1... |
#!/usr/bin/env bash
set -e
# TODO: Set to URL of git repo.
PROJECT_GIT_URL='https://github.com/jyojk/DjangoREST.git'
PROJECT_BASE_PATH='/usr/local/apps/profiles-rest-api'
echo "Installing dependencies..."
apt-get update
apt-get install -y python3-dev python3-venv sqlite python-pip supervisor nginx git
# Create pro... |
<gh_stars>0
import { Vector2 } from '@daign/math';
import { SvgConstants } from '../svg-constants';
import { SvgNodeObject } from '../svg-node-object';
export class BasicCircle extends SvgNodeObject {
public node: any;
public constructor( c: Vector2, r: number ) {
super();
this.node = document.createElem... |
/* eslint-disable no-console */
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const config = require('./webpack.dev');
const server = new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true,
stats: { colors... |
package edu.mdamle.beans;
import java.util.Map;
import edu.mdamle.beans.User.Role;
public abstract class TrmsMessage {
public static enum MessageTypes {
INFOREQ, DENIALRES, TRRCHANGE
}
//protected String head;
protected String body;
protected String senderUsername;
protected Role senderRole;
protected Map<S... |
<gh_stars>10-100
package com.gank.gankly.ui.discovered.video;
import com.gank.gankly.bean.ResultsBean;
import com.gank.gankly.mvp.IFetchPresenter;
import com.gank.gankly.mvp.IFetchView;
import java.util.List;
/**
* Create by LingYan on 2017-01-03
* Email:<EMAIL>
*/
public interface VideoContract {
interface ... |
import threading
# Create a lock to ensure atomicity and thread safety
session_lock = threading.Lock()
def interruptor():
if not interrupted:
# Acquire the lock before creating the session
with session_lock:
try:
session2 = db_session.session_factory()
s... |
package com.wpisen.trace.server.dao.entity;
import java.util.Date;
public class Project {
private Integer proId;
private String name;
private String proKey;
private String proSecret;
private String describes;
private String belongsWay;
private Integer belongsId;
private Date cre... |
<gh_stars>1-10
require 'open3'
require 'tempfile'
class BinTest_MrubyBinDebugger
@debug1=false
@debug2=true
@debug3=true
def self.test(rubysource, testcase)
script, bin = Tempfile.new(['test', '.rb']), Tempfile.new(['test', '.mrb'])
# .rb
script.write rubysource
script.flush
... |
# Import python libs
import secrets
# Import local libs
import rend.exc
def __init__(hub):
hub.pop.sub.add(dyne_name='output')
def standalone(hub):
'''
Execute the render system onto a single file, typically to test basic
functionality
'''
hub.pop.conf.integrate('rend', cli='rend')
hub.p... |
<gh_stars>1-10
package de.ids_mannheim.korap.constant;
/** Defines some predefined roles used in the system.
*
* @author margaretha
*
*/
public enum PredefinedRole {
USER_GROUP_ADMIN(1), USER_GROUP_MEMBER(2), VC_ACCESS_ADMIN(3), VC_ACCESS_MEMBER(4),
QUERY_ACCESS_ADMIN(5), QUERY_ACCESS_MEMBER(6);
... |
package json
import (
"time"
"github.com/go-faster/jx"
)
const (
dateLayout = "2006-01-02"
timeLayout = "15:04:05"
)
func DecodeDate(i *jx.Decoder) (v time.Time, err error) {
s, err := i.Str()
if err != nil {
return v, err
}
return time.Parse(dateLayout, s)
}
func EncodeDate(s *jx.Writer, v time.Time) {
... |
module Geometry
=begin
Bézier curves are like lines, but curvier.
http://en.wikipedia.org/wiki/Bézier_curve
== Constructors
Bezier.new [0,0], [1,1], [2,2] # From control points
== Usage
To get a point on the curve for a particular value of t, you can use the subscript operator
bezier[0.5] # => [1,1]
=end... |
//
// IUpgradeViewController.h
// IUpgrade
//
// Created by felix.lin on 07/31/2016.
// Copyright (c) 2016 felix.lin. All rights reserved.
//
@import UIKit;
@interface IUpgradeViewController : UIViewController
@end
|
from django.http import HttpResponse
import json
def validate_data(request_data):
# Your implementation of data validation logic goes here
# Return validated data and any validation errors
# For example:
validated_data = {} # Placeholder for validated data
errors = {} # Placeholder for validation... |
<reponame>youngzhu/golab<filename>effective/iprint/iprint.go
package iprint
import "fmt"
// Sprintf 调用的是 类型的 String 方法
// 所以,下面的方法是错误的,导致无限循环
type MyString string
func (m MyString) String() string {
// 编译时就有提示
//return fmt.Sprintf("MyString=%s", m)
return fmt.Sprintf("MyString=%s", string(m)) // 正确
}
|
const express = require('express')
const Keto = require('../src/ketogenic')
console.verbose = console.info
const app = express()
const keto = Keto({
logger: console,
verbose: true,
chaos: true
})
const {
__KETO: { utils: { loadRoutes, set } }
} = keto(app)
set('myExtra', function () {
console.log('Hello f... |
#!/bin/bash -i
#####################################################################################################
### CONFIG VARS #####################################################################################
declare LLTEST_CMD="/app/srcds_run -game tf2classic +map ctf_2fort -insecure -norestart +sv_lan 1";
... |
package com.gu.mediaservice.lib.elasticsearch
import com.sksamuel.elastic4s.requests.analysis.{Analysis, CustomAnalyzer, PathHierarchyTokenizer, StandardTokenizer, StemmerTokenFilter, StopTokenFilter, TokenFilter}
import com.sksamuel.elastic4s.requests.analyzers.{AsciiFoldingTokenFilter, LowercaseTokenFilter}
import o... |
import pandas as pd
# create dataframe
df = pd.DataFrame({'Name':['John', 'Jane'],
'Age':[30, 25],
'Gender':['Male', 'Female']})
print(df) |
docker build -t "justinrmiller/github-actions-test" .
|
The for loop in Java increments the iterator after executing its body because the loop typically checks, at the beginning of each iteration, to see if the control variable has reached its limit. By incrementing the control variable after the iteration, the loop can use the next iteration to process the last item in the... |
#!/bin/bash
#SBATCH --job-name=/data/unibas/boittier/test-neighbours2
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --partition=short
#SBATCH --output=/data/unibas/boittier/test-neighbours2_%A-%a.out
hostname
# Path to scripts and executables
cubefit=/home/unibas/boittier/fdcm_project/mdcm_bin/cubefit.x
fdcm=/home/uni... |
import * as Promise from "bluebird"
import * as utils from "./utils"
import * as WinReg from "winreg"
import * as which from "which"
import {each as asyncEach} from "async"
import {join, basename} from "path"
import {unique} from "underscore"
import {execFile} from "child_process"
import {inspect} from "util"
export c... |
<gh_stars>100-1000
#include <stdlib.h>
#include <stdint.h>
#include <arm_neon.h>
#include <assert.h>
/* Routine optimized for shuffling a buffer for a type size of 4 bytes. */
static void
shuffle4_neon(uint8_t* const dest, const uint8_t* const src,
const size_t vectorizable_elements, const size_t total_e... |
#!/usr/bin/bash
curl -XPUT "${ES_HOST}:9200/_template/metrics?pretty" -H 'Content-Type: application/json' -d'
{
"template": "metrics*",
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"measurement": {
"_source": {
"enabled": true
},
"propertie... |
<filename>src/app/dashboard/student-dashboard/student-reportcard/student-report-card.component.ts
import {Component, OnDestroy, OnInit} from '@angular/core'
import {ActivatedRoute} from '@angular/router'
import {ReportCardEntryService} from '../../../services/report-card-entry.service'
import {EMPTY, of, Subscription, ... |
<reponame>Frayo44/WikiGame---A-Wikipedia-Game<filename>app/src/main/java/com/yoavfranco/wikigame/adapters/AboutAdapter.java<gh_stars>1-10
package com.yoavfranco.wikigame.adapters;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android... |
def array_sum(arr):
sum = 0
for i in range(len(arr)):
for j in range(len(arr[i])):
sum += arr[i][j]
return sum
array_sum([[1,2,3],[4,5,6]]) |
"""
#Develop a code generation task to perform a linear search through an unsorted array for a given Integer
def linear_search(array, search_element):
for i in range(len(array)):
if array[i] == search_element:
return i
return -1
if __name__ == '__main__':
array = [20, 15, 25, 11, 55]
... |
<reponame>Jose-Bustamante/EmailsFieldVanilla
export function checkBrowser() {
var c = navigator.userAgent.search("Chrome");
var f = navigator.userAgent.search("Firefox");
var ie11 = navigator.userAgent.indexOf("Trident/7.0") > -1;
var browser;
if (c > -1) {
browser = "Chrome";
} else if (f > -1) {
b... |
<gh_stars>0
//
// FSInventoryController.h
// myhome
//
// Created by FudonFuchina on 2018/2/3.
// Copyright © 2018年 fuhope. All rights reserved.
//
#import "FSShakeBaseController.h"
@interface FSInventoryController : FSShakeBaseController
@property (nonatomic,copy) NSString *table;
@end
|
package timely.api.response.timeseries;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
public class SearchLookupResponse {
public static class Resul... |
import XCTest
class Calculator {
func add(_ a: Int, _ b: Int) -> Int {
return a + b
}
func subtract(_ a: Int, _ b: Int) -> Int {
return a - b
}
func multiply(_ a: Int, _ b: Int) -> Int {
return a * b
}
func divide(_ a: Int, _ b: Int) -> Int {
return a / b
... |
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
# author: Hanzhang Yang
REPO_PATH=/Users/yuang/PA_tech/text_corrector/ChineseBert/csc_correct_task_yuang
BERT_PATH=/Users/yuang/PA_tech/text_corrector/ChineseBert/ChineseBERT-base
CHECKPOINT_PATH=/Users/yuang/PA_tech/text_corrector/ChineseBert/csc_correct_task_yuang/results... |
<reponame>nabeelkhan/Oracle-DBA-Life
REM FILE NAME: db_tbl8.sql
REM LOCATION: Object Management\Tables\Reports
REM FUNCTION: Generate table report
REM CATEGORY:
REM TESTED ON: 8.0.4.1, 8.1.5, 8.1.7, 9.0.1
REM PLATFORM: non-specific
REM REQUIRES: dba_tables
REM
REM This is a part of the Knowledge Xpert for... |
<reponame>marcocanopoli/laravel-boolpress<gh_stars>0
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
import PageBlog from './pages/PageBlog.vue';
import PageBlogPost from './pages/PageBlogPost.vue';
import PageHome from './pages/PageHome.vue';
import PageAbout from './pages/PageAbout.vue';... |
def multiply(nums):
result = []
for i in range(len(nums)):
for j in range(i+1, len(nums)):
result.append(nums[i] * nums[j])
return result |
export LSCOLORS="exfxcxdxbxegedabagacad"
export CLICOLOR=true
export COMPLETION_WAITING_DOTS=true
fpath=($ZSH/functions $fpath)
autoload -U $ZSH/functions/*(:t)
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt NO_BG_NICE # don't nice background tasks
setopt NO_HUP
setopt NO_LIST_BEEP
setopt LOCAL_OPTION... |
#!/usr/bin/env bash
source default-build-config
set -eux
CUR_DIR=`pwd`
MAKE_DIR=${CUR_DIR}/../
BUILD_DIR=${CUR_DIR}/build
test -e ${BUILD_DIR} || mkdir ${BUILD_DIR}
cd ${BUILD_DIR} && test -e ab-mruby || git clone --recursive https://github.com/matsumoto-r/ab-mruby.git
cd ${BUILD_DIR}/ab-mruby && make
|
<filename>js/consortium.js<gh_stars>0
$(document).ready(function() {
var libraryList = [];
function finalizeSelect() {
// Sort alphabetically. https://stackoverflow.com/questions/6712034/sort-array-by-firstname-alphabetically-in-javascript
libraryList.sort(function(a, b){
var nameA=a... |
<reponame>zettca/pacex2
import React from 'react';
import DataStore from '../stores/DataStore';
class InputPace extends React.Component {
constructor(props) {
super(props);
this.state = {
units: DataStore.getUnits(),
input: DataStore.getPace(),
};
}
componentWillMount() {
this.handl... |
from . util import _get_Z, _get_name, _get_isotopes
class Element:
def __init__(self, constructor):
if type(constructor) == str:
self.Z = _get_Z(constructor)
self.name = constructor
elif type(constructor) == int or type(constructor) == float:
self.name = _get_n... |
<reponame>Himenon/dependents-view
import { View, OriginLibrary } from "@app/interface";
export const isViewLibrary = (displayLibrary: View.Library | OriginLibrary[] | undefined): displayLibrary is View.Library => {
if (!displayLibrary) {
return false;
}
if (Array.isArray(displayLibrary)) {
return false;
... |
def find_second_largest(arr):
largest = arr[0]
second_largest = -float('inf')
for num in arr:
if num > largest:
second_largest = largest
largest = num
elif num > second_largest and num < largest:
second_largest = num
return second_largest |
package cassandra;
import com.datastax.driver.mapping.annotations.PartitionKey;
import com.datastax.driver.mapping.annotations.Table;
@Table(name = "beer")
public class Beer {
@PartitionKey
public String id;
public String name;
public String getId() {
return id;
}
public void setId(final String id... |
parseFloat.length = {};
parseFloat.name = {};
|
// interaction with the graph
// set up svg
// click location
// click label
var svgMode = false;
var automataIndex;
var stateIndex;
var labelIndex;
function setSvgMode (){
svgMode = true;
}
function clearBuffer (){
automataIndex = null;
stateIndex = null;
labelIndex = null;
}
var ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.