text stringlengths 1 1.05M |
|---|
class MinHeap:
def __init__(self):
self.heap = []
def _heapify(self, index):
smallest = index
left = 2 * index + 1
right = 2 * index + 2
if left < len(self.heap) and self.heap[left] < self.heap[smallest]:
smallest = left
if right < len(self.heap) an... |
<gh_stars>0
import fs from 'fs';
import {buildComponentTests} from './_auto-render';
const componentsToLoad = ['icon', 'toolbar', 'card', 'panel'];
componentsToLoad.forEach(c => {
const componentsProps = require(`../../fixtures/${c}`);
const files = fs.readdirSync(`${__dirname}/../../../src/app/components/${c}/`).m... |
import gulp from 'gulp';
import { join } from 'path';
import loadPlugins from 'gulp-load-plugins';
import { src, dest } from '../config';
const p = loadPlugins();
/**
* This task has the function of only copying what doesn't require any treatment
*/
gulp.task('dist:copy', ['dist:copy:markup'], function() {
var ... |
#!/usr/bin/env python3
import algorithms
bag = algorithms.NodeBag(89)
bag.printBag()
|
def sum_even_numbers(nums):
total = 0
for num in nums:
if num % 2 == 0:
total += num
return total
result = sum_even_numbers([3, 9, 12, 5])
print(result) |
<gh_stars>0
/*
* Copyright [2020-2030] [https://www.stylefeng.cn]
*
* 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 b... |
<filename>MSDaPl_Web_App/WebRoot/js/comparison.js
// ---------------------------------------------------------------------------------------
// AJAX DEFAULTS
// ---------------------------------------------------------------------------------------
$.ajaxSetup({
type: 'POST',
//timeout: 5000,
dataType: 'html... |
#include <algorithm>
void sortArray(int arr[], int len) {
std::sort(arr, arr + len);
} |
package com.marcus.reactnative.lib.task;
import com.marcus.reactnative.lib.base.MMErrorCode;
/*!
* Copyright(c) 2009-2017 <NAME>
* E-mail:<EMAIL>
* GitHub : https://github.com/MarcusMa
* MIT Licensed
*/
class CommonTaskResult {
private int errorCode;
private String errorMessage;
private Object data;... |
#!/usr/bin/bash -e
if [ $# -lt 1 ] || ! [ -f "$1" ]; then
echo Missing job file
exit 1
fi
if [ "$2" == "--rm" ]; then
CLEAN=true
shift
fi
JOB_FILE="$1.tmp"
cp "$1" $JOB_FILE
shift
for named_arg in $@; do
NAME=$(echo $named_arg | cut -d= -f1)
ARG=$(echo $named_arg | cut -d= -f2)
sed -i "s/\$$NAME/$ARG/... |
<reponame>Ashindustry007/competitive-programming
// https://www.codechef.com/FEB18/problems/CHEFPTNT
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, m, x, k;
cin >> n >> m >> x >> k;
string s;
cin >> s;
int e = count(s.begin(),... |
<reponame>soarqin/blitzd
#include "Mutex_POSIX.h"
#include "Timestamp.h"
#include <sys/select.h>
#include <unistd.h>
#include <sys/time.h>
#if defined(_POSIX_TIMEOUTS) && (_POSIX_TIMEOUTS - 200112L) >= 0L
#if defined(_POSIX_THREADS) && (_POSIX_THREADS - 200112L) >= 0L
#define HAVE_MUTEX_TIMEOUT
#endif
#endif
namesp... |
#!/bin/bash
function docker_tag_exists() {
EXISTS=$(curl -s https://hub.docker.com/v2/repositories/$1/tags/?page_size=10000 | jq -r "[.results | .[] | .name == \"$2\"] | any")
test $EXISTS = true
}
if docker_tag_exists svenruppert/maven-3.1.1-zulu 1.6.93; then
echo skip building, image already existing - ... |
#!/bin/bash
# Keras Tensorflow Backend using tf.keras
# Credit:
# Script modified from TensoFlow Benchmark repo:
# https://github.com/tensorflow/benchmarks/blob/keras-benchmarks/scripts/keras_benchmarks/run_tf_backend.sh
python -c "from keras import backend"
KERAS_BACKEND=tensorflow
sed -i -e 's/"backend":[[:space:]]*... |
<filename>Python/Current_Season.py
import pandas as pd
from Player import Player, s, bran, eli, mal, sab
import math
import matplotlib.pyplot as plt
season = 2022
def player_season_standings():
summary = pd.DataFrame()
summary["Year"] = [season] * 4
summary["Player"] = [sab.player_name, mal.player_name, ... |
<reponame>dorranh/clowdr-web-app<filename>src/components/Pages/Admin/Registration/Registration.tsx
import { Registration } from "@clowdr-app/clowdr-db-schema";
import assert from "assert";
import Parse from "parse";
import React, { useState } from "react";
import { Redirect } from "react-router-dom";
import { addError,... |
<reponame>lhbruneton/taormina
import { Injectable } from '@angular/core';
import { select, Store } from '@ngrx/store';
import * as LandsPileCardsActions from './lands-pile-cards.actions';
import * as LandsPileCardsFeature from './lands-pile-cards.reducer';
import * as LandsPileCardsSelectors from './lands-pile-cards.s... |
#!/bin/sh
mkdir -p data temp
wget http://www.kdd.org/cupfiles/KDDCup2000.zip -P temp
unzip temp/KDDCup2000.zip assoc/BMS-POS.dat.gz -d temp
gunzip temp/assoc/BMS-POS.dat.gz -c > data/bms-pos.dat
wget http://fimi.ua.ac.be/data/kosarak.dat -P data
wget https://archive.org/download/AOL_search_data_leak_2006/AOL_search... |
#!/bin/sh
#/Applications/myapps/jetty/jetty-distribution-9.2.6.v20141205/bin/jetty.sh start
#!/bin/sh
export JETTY_HOME=/c/temp/automon/jetty
export JAVA_OPTIONS=' -server -Xms256m -Xmx512m -Dorg.aspectj.weaver.loadtime.configuration=file:C:/temp/automon/examples/config/automon-aop.xml -javaagent:C:/temp/automon/exampl... |
/*
* Copyright 2011 the original author or 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 applica... |
/*
XTal = 16MHz
Toggle LED using General Purpose Timer Register
Here we use TIMER2 which is 32bit timer attached to APB1 bus
*/
#include "stm32f4xx.h" // Device header
int main(void){
RCC->AHB1ENR |=0x1; //Enable GPIOA
GPIOA->MODER |=0x400; //Enable OUTPUT mode
RCC->APB... |
<reponame>bertmaher/tvm<filename>vta/apps/tsim_example/tests/python/add_by_one.py<gh_stars>10-100
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF ... |
def loss(self, prediction_dict, groundtruth_lists):
"""Compute scalar loss tensors with respect to provided groundtruth.
Args:
prediction_dict: A dictionary holding prediction tensors.
groundtruth_lists: A dict of tensors holding groundtruth
information, with one entry for each imag... |
import { HTTPTransport, HTTPRequestEncoder } from '@alicloud/mpserverless-core';
import { QueryService } from './query';
export interface TransactionJSONObject {
transactionId: string;
}
export declare enum TransactionStatus {
INIT = "init",
COMMIT = "commit",
ROLLBACK = "rollback"
}
export declare clas... |
<gh_stars>0
/**************************************************************************
*
* Copyright (c) 2012-2017 <NAME> All Rights Reserved.
*
**************************************************************************/
"use strict";
/**
* A simple Assynchronous Module Definition implementation. Intended
* o... |
echo "Getting login token..."
curlRequest1=$(curl --form client_id=$CONSUMER_KEY \
--form client_secret=$CONSUMER_SECRET \
--form grant_type=password \
--form username=$USERNAME\
--form password=$PASSWORD \
https://login.salesforce.com/services/oauth2/token)
authToken=$(jq -r '.access_token' ... |
angular
.module('pulse')
.controller('memberCtl', memberCtl);
function memberCtl($scope, API, $location) {
var brandId = $location.search()['brandid'];
var memberId = $location.search()['memberid'];
var name = $location.search().name;
var phone = $location.search().phone;
var page = $locatio... |
// Copyright 2019 BlueCat Networks. All rights reserved.
// JavaScript for your page goes in here.
content_box = $("#data_display")
for (var ip in content) {
console.log(ip)
records = ""
for (var record in content[ip]) {
records += content[ip][record] + " "
}
content_box.append("<p>"+ip + " ... |
<reponame>CMPUT301W21T02/Kotlout
package xyz.kotlout.kotlout.model.experiment.trial;
import xyz.kotlout.kotlout.model.geolocation.Geolocation;
/**
* A trial with a binary (true or false) outcome
*/
public class BinomialTrial extends Trial {
private boolean result;
/**
* Default public constructor for Fireb... |
<filename>register-order-models_test.go
package cdek
import "testing"
func TestOrderResp_GetError(t *testing.T) {
type fields struct {
Error Error
DispatchNumber *int
Number *string
}
tests := []struct {
name string
fields fields
wantErr bool
}{
{
name: "err",
fields: fiel... |
function selector(x) {
switch (x) {
case 1:
document.getElementsByClassName("gamecards-container")[0].children[x - 1].children[0].src = "../images/games/snake3dS.png";
break;
case 2:
document.getElementsByClassName("gamecards-container")[0].children[x - 1].childre... |
package io.opensphere.core.util.javafx;
import java.util.function.Consumer;
import javafx.beans.InvalidationListener;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
/**
* Thread-safe {@link SimpleBooleanProperty}.
*/
public c... |
<gh_stars>0
const { MessageEmbed } = require("discord.js");
const { getGuildById } = require("../../utils/functions");
module.exports = {
name: "messageUpdate",
async execute(bot, oldMsg, newMsg) {
if (!newMsg.guild) return;
if (!newMsg.guild.me.hasPermission("MANAGE_WEBHOOKS")) {
return;
}
c... |
<filename>server/config/instagram.js
var passport = require('passport'),
InstagramStrategy = require('passport-instagram');
module.exports = function() {
passport.serializeUser(function(user, done) {
done(null, user);
});
passport.deserializeUser(function(obj, done) {
done(null, obj);
});
... |
import AuthActions from '../Actions/AuthActions';
import Options from '../Utils/Options';
export default{
getAccessToken: (code) => {
fetch('http://www.reddit.api/api/proxy/token', {
mode: 'same-origin',
method: 'post',
headers: {
"Content-Type": "applica... |
module.exports = {
extends: ['../.eslintrc',],
plugins: ['cypress'],
env: {
'cypress/globals': true,
},
// TODO: change first two to error and fix.
rules: {
'cypress/no-assigning-return-values': 'warn',
'cypress/no-unnecessary-waiting': 'warn',
'cypress/assertion-before-screenshot': 'warn',
... |
#!/bin/bash
##########################################################################
# This is the EOSIO automated install script for Linux and Mac OS.
# This file was downloaded from https://github.com/EOSIO/eos
#
# Copyright (c) 2017, Respective Authors all rights reserved.
#
# After June 1, 2018 this software is a... |
<reponame>lkc-adm/databricks-terraform<filename>vendor/github.com/terraform-providers/terraform-provider-azuread/azuread/helpers/graph/replication.go
package graph
import (
"fmt"
"time"
"github.com/Azure/go-autorest/autorest"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/terraform-prov... |
#!/bin/bash
cd ../src/main/ui/
NODE_ENV="LOCAL" LOCAL_SPRING_API="http://localhost:8080/api/" npm start
|
public class ArraySorter {
public static int[] sortArrayAsc(int[] arr) {
// Bubble sort algorithm
for (int i = 0; i < arr.length; i++) {
for (int j = 0; j < arr.length - i - 1; j++) {
if (arr[j] > arr[j + 1]) {
int temp = arr[j];
a... |
<reponame>gfpaiva/iddogs
const Categories = [
{
category: 'husky',
key: 'husky',
name: 'Husky',
},
{
category: 'labrador',
key: 'labrador',
name: 'Labrador',
},
{
category: 'hound',
key: 'hound',
name: 'Hound',
},
{
category: 'pug',
key: 'pug',
name: 'Pug',
... |
import React, { Component } from "react";
import Dropzone from "../dropzone/Dropzone";
import "./Upload.css";
import Progress from "../progress/Progress";
// import axios from "axios";
class Upload extends Component {
constructor(props) {
super(props);
this.state = {
files: [],
uploadi... |
<reponame>marvelperseus/Real-Estate-website-frontend
import React, { Component } from 'react';
import { observer } from 'mobx-react';
import { withStyles } from 'material-ui/styles';
import ArrowDownIcon from '@material-ui/icons/KeyboardArrowDown';
import MainListingFilters from '../MainListingFilters';
const styles =... |
#!/bin/bash
export API_PATH="$1"
export MLP_API_BASEPATH="http://127.0.0.1:8081/v1"
export MERLIN_API_BASEPATH="http://127.0.0.1:8080/v1"
kubectl port-forward --namespace=mlp svc/mlp 8081:8080 &
MLP_SVC_PID=$!
kubectl port-forward --namespace=mlp svc/merlin 8080 &
MERLIN_SVC_PID=$!
sleep 15
echo "Creating merlin p... |
GPUID=0
OUTDIR=outputs/permuted_MNIST_incremental_domain_100
REPEAT=10
N_PERMUTATION=100
mkdir -p $OUTDIR
IBATCHLEARNPATH=/home/hikmat/Desktop/JWorkspace/CL/Continuum/ContinuumBenchmarks/MNIST/Continual-Learning-Benchmark
EPOCHS=10
BATCH_SIZE=128 #128
python -u ${IBATCHLEARNPATH}/iBatchLearn.py --outdir $OUTDIR --gpu... |
// create the web component
const MyDataList = {
// render the component
render: () => {
// create a container element
const element = document.createElement('div');
// get the list of data
const data = MyDataList.data;
// create a list element
const list = docu... |
<reponame>1thorsten/timeset
// Package for time related functions (ntp - gettime, windows - settime)
package handleTime
|
<reponame>parmarsuraj99/objax<gh_stars>1-10
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.archive = void 0;
var archive = {
"viewBox": "0 0 1792 1792",
"children": [{
"name": "path",
"attribs": {
"d": "M1088 832q0-26-19-45t-45-19h-256q-26 0-45 19t-19 45 19 45 45 19h256q26 0 45-19t19-45zM1664 640v960q0 2... |
#!/bin/bash
sudo apt-get install python3-pil python3-pil.imagetk
sudo pip3 install evdev
sudo groupadd uinput
sudo usermod -a -G uinput pi
sudo cp 98-keyboard.rules /etc/udev/rules.d/
sudo udevadm control --reload
sudo udevadm trigger
sudo modprobe uinput
echo "You should see these permissions: crw-rw---- 1 root uinp... |
<reponame>heylenz/python27
#!/usr/bin/env python
############################################################################
##
## Copyright (C) 2004-2005 Trolltech AS. All rights reserved.
##
## This file is part of the example classes of the Qt Toolkit.
##
## This file may be used under the terms of the GNU General... |
#!/bin/bash
if [ "$1" != "" ]; then
echo "joining network: $2 with interface $1"
#sudo ifdown $1
sudo su <<EOF
ifdown $1
#ifup $1
rm /var/run/wpa_supplicant/$1
wpa_supplicant -i $1 -c /home/pi/$1.conf -Dnl80211,wext
dhclient $1
EOF
iwconfig
else
echo "Usage: join_network.sh device ssid password"
fi
|
import Vue from 'vue'
import Vuex from 'vuex'
import trackService from '@/services/track'
Vue.use(Vuex)
const store = new Vuex.Store({
state: {
track: {},
trackList: [],
searchQuery: '',
showNotification: false,
notificationIsError: false,
notificationText: '',
showLoader: false,
sh... |
package br.com.tasklist.core.endpoint;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
//tasklist - 19/01/2018 - SUPERO
@ApplicationPath("/api")
public class ApplicationEndpoint extends Application {
}
|
function ResetScoreboard() {
let table = document.getElementsByTagName("table")[0];
table.getElementsByTagName("tbody")[0].innerHTML = table.rows[0].innerHTML;
let tableOuter = document.getElementsByClassName("table")[0];
tableOuter.scrollTop = 0;
}
function AddPlayer(id, accountid, name, ping, job, h... |
<reponame>ChaituKNag/react-form-element-hook<gh_stars>0
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useReactFormElement = void 0;
var _react = _interopRequireWildcard(require("react"));
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else ... |
<reponame>wuximing/dsshop
import { __assign, __extends } from "tslib";
import GroupComponent from '../abstract/group-component';
import Theme from '../util/theme';
import { regionToBBox } from '../util/util';
var RegionAnnotation = /** @class */ (function (_super) {
__extends(RegionAnnotation, _super);
function... |
function hideelement( el, swapel, speed ) {
var seconds = speed/2000;
el.style.transition = "opacity "+seconds+"s ease";
el.style.opacity = 0;
setTimeout(function() {
el.style.display = 'none';
//bring in the new element after first one is collapsed
swapel.style.display = 'flex... |
package de.otto.edison.mongo.configuration;
import com.mongodb.*;
import com.mongodb.event.CommandListener;
import de.otto.edison.status.domain.Datasource;
import org.bson.codecs.configuration.CodecRegistry;
import org.slf4j.Logger;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org... |
#!/bin/bash
set -e
CONF="/usr/local/etc/zabbix_server.conf.d"
if [ -z ${DB_HOST} ]; then
echo "No Default DB Host Provided. Assuming 'db'"
DB_HOST="db"
fi
if [ -z ${DB_PORT} ]; then
echo "No Default port for Db Provided. Assuming 5432."
DB_PORT=5432
fi
if [ -z ${DB_USER} ]; then
echo "No Defaul... |
#!/bin/sh
curl -s -XDELETE "http://localhost:9200/test"
echo
curl -s -XPUT "http://localhost:9200/test/" -d '{
"settings": {
"index.number_of_shards": 1,
"index.number_of_replicas": 0
},
"mappings": {
"type1": {
"properties": {
"name": {
... |
// For loop to print numbers from 0 to 10
for(int i = 0; i <= 10; i++) {
cout << i << endl;
} |
<filename>src/core/createRefectStore.js
import createRefectEnhancer from './enhancer';
import createDefaultTaskMiddleware from './middleware';
import { compose, applyMiddleware, createStore } from 'redux';
import { combineRefectReducer, parseRefectEffects } from './parseRefect';
import { identity } from '../utils';
co... |
#!/bin/bash
set -e
if [ -x "$(command -v c_rehash)" ]; then
# c_rehash is run here instead of update-ca-certificates because the latter requires root privileges
# and the aks-operator container is run as non-root user.
c_rehash
fi
aks-operator |
/*
Info: JavaScript for JavaScript Basics Lesson 3, JavaScript Loops, Arrays, Strings, Task 17*, Extract Element Content
Author: Removed for reasons of anonymity
Successfully checked as valid in JSLint Validator at: http://www.jslint.com/ and JSHint Validator at: http://www.jshint.com/
*/
'use strict';
function buildSt... |
<reponame>jibrelnetwork/jibrel-contracts-jsapi<filename>src/utils/txUtils.js
/**
* @file Manages helper functions for sending of transactions
* @author <NAME> <<EMAIL>>
*/
import Promise from 'bluebird'
import Tx from 'ethereumjs-tx'
import config from '../config'
import add0x from '../utils/add0x'
/**
* @functi... |
#!/bin/bash
puppet apply --modulepath ./modules manifests/default.pp |
#!/usr/bin/env bash
# Color files
PFILE="$HOME/.config/polybar/material/colors.ini"
RFILE="$HOME/.config/polybar/material/scripts/rofi/colors.rasi"
# Change colors
change_color() {
# polybar
sed -i -e 's/background = #.*/background = #FFFFFF/g' $PFILE
sed -i -e 's/foreground = #.*/foreground = #2E2E2E/g' $PFILE
s... |
package net.community.chest.net;
import java.io.IOException;
import java.io.InputStream;
import java.net.Socket;
import java.net.SocketException;
import java.nio.channels.SocketChannel;
/**
* Copyright 2007 as per GPLv2
*
* Provides some default implementations for the {@link NetConnection} interface
*
* @author... |
import React, { useState } from 'react';
// useState - função do React que retorna um Array de dois elementos
// o primeiro elemento é um valor e o segundo uma função que controla esse valor
const UseStateBasics = () => {
const [title, setTitle] = useState("Ficar com certeza");
const onClickHandler = () => {
... |
import { gql } from 'apollo-server-express';
export default gql`
extend type Mutation {
addForward(input: AddForwardInput): AddForwardPayload!
}
type Forward {
id: ID!
createdAt: DateTime!
user: User!
url: String!
method: String!
statusCode: Int!
success: Boolean!
headers: [K... |
#!/bin/bash -e -o pipefail
source ~/utils/invoke-tests.sh
# MongoDB object-value database
# installs last version of MongoDB Community Edition
# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/v
echo "Installing mongodb..."
brew tap mongodb/brew
brew install mongodb-community
invoke_tests "Common" ... |
<filename>src/js/components/BoardSquare.js
/**
* Created by huangling on 21/01/2017.
*/
import React, {Component} from 'react';
import update from 'react/lib/update';
import {ItemTypes} from '../constants';
import {DropTarget, DragDropContext} from 'react-dnd';
import HTML5Backend from 'react-dnd-html5-backend';
impo... |
<filename>minos-security-demo/src/main/java/cm/xxx/minos/leetcode/Solution6.java
package cm.xxx.minos.leetcode;
/**
* Description: 滑动窗口 算法
* Author: lishangmin
* Created: 2018-08-23 10:16
*/
public class Solution6 {
public int reverse(int x) {
String temp = String.valueOf(x);
StringBuilder bui... |
import { ControllerTestData } from "../types";
export declare type ShieldTestData = ControllerTestData & {
workerName?: string;
};
export declare const initShield: (shieldInstance: any, data?: ShieldTestData) => ShieldTestData;
|
from flask_restx import Api
from flask import Blueprint
from .main.controller.login_controller import api as login_ns
from .main.controller.logout_controller import api as logout_ns
from .main.controller.users_controller import api as users_ns
from .main.controller.registration_controller import api as register_ns
fro... |
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { Task } from '../task.model';
import { map } from 'rxjs/operators';
@Injectable()
export class TaskService {
constructor(private http: Http) { }
// Store all tasks in this array.
tasks: Task[] = [];
// Implement this m... |
import getStorageMock from './getStorageMock';
const clearCompletedMock = (todos) => {
const newTodos = todos.filter((el) => el.completed === false);
getStorageMock.setItem('todos', newTodos);
return newTodos;
};
export default clearCompletedMock; |
<filename>packageA/pages/matchBrand/matchBrand.js
const util = require('../../../utils/util.js');
const api = require('../../../config/api.js');
import Toast from '../../../lib/vant-weapp/toast/toast';
const citys = {
// '浙江': ['杭州', '宁波', '温州', '嘉兴', '湖州'],
// '福建': [{name:'福州',code:11111}, {name:'厦门'}],
};
Page... |
package endpoint
import (
"github.com/emilhauk/identity-api/store"
"net/http"
)
type Endpoints struct {
LoginHandler http.HandlerFunc
JwtHandler http.HandlerFunc
LogoutHandler http.HandlerFunc
WebHandler http.HandlerFunc
PublicKeyHandler http.HandlerFunc
RegisterHandler http.HandlerFunc
}
func NewEndp... |
import React, { Component } from 'react';
import CitizenService from '../../../services/CitizenService'
import './taskList.css'
class TaskList extends Component {
constructor(props) {
super(props)
this.state = {
taskList: [],
govtEntityAddress: '',
title: '',
description: '',
expectedSt... |
<reponame>uwplse/stng
from stencil_ir import *
import asp.codegen.ast_tools as ast_tools
import sympy
import random
import re
import logging
ARRAYSIZE = 10000
AOFFSET = 99
def is_int(x):
try:
a = int(x)
return True
except Exception:
return False
class Interpreter(ast_tools.NodeVisitor):
"""
A con... |
<gh_stars>10-100
//#####################################################################
// Copyright 2004-2012, <NAME>, <NAME>.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################... |
<filename>2019/08-kosen/cry-kurukuru/solve.py<gh_stars>10-100
f = open('encrypted')
enc = f.read().strip()
f.close()
L = len(enc)
for k in range(1, L):
for a in range(L):
for b in range(L):
if a == b:
continue
flag = list(enc)
i = k
for _ in r... |
def deleteHashTableEntry(key, hashTable):
if key in hashTable:
del hashTable[key]
hashTable = {
"abc": [2, 3],
"def": [4, 5]
}
deleteHashTableEntry("abc", hashTable)
print(hashTable) |
import React, { Component } from 'react';
import axios from 'axios';
class App extends Component {
constructor(){
super();
this.state = {
orders: [],
};
this.onOrderSubmit = this.onOrderSubmit.bind(this);
}
onOrderSubmit(order) {
axios.post('/orders', order)
.then(response => {
... |
import React, { ReactElement } from 'react';
import { Layout, Menu } from 'antd';
import { Link, history } from 'umi';
import styles from './index.less';
// import BreadCrumb from '@/components/BreadCrumb/BreadCrumb';
const { SubMenu, Item } = Menu;
const { Header, Footer, Sider, Content } = Layout;
interface Props {}
... |
#!/bin/bash
echo "Creating directories and files..."
echo "--"
mkdir ~/.config/nvim
mkdir ~/.config/nvim/general
mkdir ~/.config/nvim/lua
touch ~/.config/nvim/init.vim
touch ~/.config/nvim/init.vim
touch ~/.config/nvim/general/settings.vim
touch ~/.config/nvim/general/maps.vim
touch ~/.config/nvim/general/plugins.vim
... |
#!/bin/sh
set -e
[ -z "${GITHUB_PAT}" ] && exit 0
[ "${TRAVIS_BRANCH}" != "master" ] && exit 0
git config --global user.email "alex@brodersen.io"
git config --global user.name "Alex Brodersen"
git clone -b gh-pages https://${GITHUB_PAT}@github.com/${TRAVIS_REPO_SLUG}.git book-output
cd book-output
cp -r ../_book/* ... |
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
OCLDIR=$DIR/gpu-rodinia/opencl
bm="backprop bfs cfd gaussian hotspot hotspot3D hybridsort lud \
nn nw pathfinder srad streamcluster"
OUTDIR=$DIR/results-cpu
mkdir $OUTDIR &>/dev/null
cd $OCLDIR
exe() { echo "++ $@" |& tee -a $OUTDIR/$b.... |
<reponame>yjfnypeu/Router-RePlugin
package com.lzh.remote;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.lzh.nonview.router.Router;
import com.lzh.nonview.router.anno.RouterRule;
@RouterRule("main")
public class MainActivity extends Activity... |
<filename>java/ql/src/Likely Bugs/Nullness/NullAlways.java
public void createDir(File dir) {
if (dir != null || !dir.exists()) // BAD
dir.mkdir();
}
public void createDir(File dir) {
if (dir != null && !dir.exists()) // GOOD
dir.mkdir();
}
|
<reponame>jhonatanlteodoro/Crawler_Infojobs<filename>main.py
from get_links_vagas import GetLinksVagas as glv
from get_info_vagas import GetInfoVagas as giv
links = glv()
#Como exemplo vamos passar 3 links
vagas = []
for vaga in range(3):
vagas.append(giv(links.list_links_vagas[vaga]))
print(vagas[0].nome)
print... |
//Defining map as a global variable to access from other functions
var map;
// https://kevinchoppin.dev/blog/animating-google-maps-directions-with-multiple-waypoints-in-javascript
const directions = [
{ lat: 34.7563765 , lng: -92.3318309 },
{ lat: 35.1263774 , lng: -89.8045423 },
// ... |
package org.datacontract.schemas._2004._07.EEN_Merlin_Backend_Core_BO_PODService;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlType;
/**
* <p>J... |
from flask import url_for
from app.config import EMAIL_DOMAIN
from app.dashboard.views.custom_alias import (
signer,
verify_prefix_suffix,
available_suffixes,
)
from app.extensions import db
from app.models import Mailbox, CustomDomain, Alias
from app.utils import random_word
from tests.utils import login
... |
#!/usr/bin/env bash
set -e
set -o pipefail
set -u
# dynamic environment variables:
# VERSION_TAG={determined automatically}: Version tag in format ios-vX.X.X-pre.X
# GITHUB_RELEASE=true: Upload to github
# environment variables and dependencies:
# - You must run "mbx auth ..." before running
# - Set ... |
<filename>typedb/stream/response_collector.py
#
# Copyright (C) 2021 Vaticle
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
... |
#!/usr/bin/env bash
set -e
# colours
YELLOW='\033[1;33m'
NC='\033[0m' # no colour - reset console colour
DOMAIN='m.thegulocal.com'
SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
dev-nginx setup-cert ${DOMAIN}
dev-nginx link-config ${SOURCE_DIR}/frontend.conf
dev-nginx restart-nginx
echo -e "💯 Done... |
#!/bin/bash
echo "Analyzing dart:ui library..."
echo "Using analyzer from `which dartanalyzer`"
dartanalyzer --version
RESULTS=`dartanalyzer \
--options flutter/analysis_options.yaml \
--enable-experiment=non-nullable ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.