language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Swift | UTF-8 | 2,221 | 2.578125 | 3 | [] | no_license | //
// OutroViewController.swift
//
// Created by Mo DeJong on 5/7/19.
// Copyright © 2019 Mo DeJong. All rights reserved.
//
import UIKit
import AlphaOverVideo
class OutroViewController: UIViewController {
@IBOutlet weak var mtkView: AOVMTKView!
var player: AOVPlayer?
@IBOutlet weak var textOverlay: UI... |
Java | UTF-8 | 651 | 2.640625 | 3 | [] | no_license | package sk.tuke.kpi.oop.game.items;
import sk.tuke.kpi.gamelib.graphics.Animation;
import sk.tuke.kpi.oop.game.Reactor;
import sk.tuke.kpi.oop.game.Repairable;
public class Hammer extends BreakableTool<Repairable> implements Collectible{
public Hammer() {
super(1);
setAnimation(new Animation("sp... |
PHP | UTF-8 | 1,015 | 2.703125 | 3 | [] | no_license | <?php
namespace App\Library\Services;
use App\Library\Services\Contracts\UpdatesInterface;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
class Updates implements UpdatesInterface
{
public function addProjectUpdate(Request $req)
{
$req->validate([
'projectId' =>... |
Python | UTF-8 | 298 | 4.0625 | 4 | [] | no_license | def odd_even_sum(num):
odd_sum = 0
even_sum = 0
for digits in number:
if int(digits) % 2 == 0:
even_sum += int(digits)
else:
odd_sum += int(digits)
print(f"Odd sum = {odd_sum}, Even sum = {even_sum}")
number = input()
odd_even_sum(number)
|
Java | UTF-8 | 1,946 | 2.09375 | 2 | [
"Apache-2.0"
] | permissive | package com.smartbear.readyapi4j.samples.java;
import com.smartbear.readyapi4j.TestRecipeBuilder;
import com.smartbear.readyapi4j.result.RecipeExecutionResult;
import org.junit.Test;
import static com.smartbear.readyapi4j.support.AssertionUtils.assertExecutionResult;
import static com.smartbear.readyapi4j.testengine.... |
PHP | UTF-8 | 3,131 | 2.625 | 3 | [] | no_license | <?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\Serializer\Encoder\XmlEncoder;
use Symfony\Component\Seriali... |
Markdown | UTF-8 | 2,752 | 2.953125 | 3 | [] | no_license | # Generator-funkcyjny
Projekt wykonany na płytce FRDM-KL05.
Generator działa w oparciu o przetwornik C/A, generuje przebiegi: sinusoidalny, falę trójkątną i prostokątną. Obsługiwany za pomocą dwóch przycisków (zmiana przebiegu, zmina trybu nastawiania) oraz pola dotykowego płytki KL05 (regulacja napięcia miedzyszczyto... |
SQL | UTF-8 | 1,237 | 4.1875 | 4 | [] | no_license | --1
SELECT employee.BusinessEntityID
,employee.JobTitle
,MAX(employeePayHistory.Rate) AS MaxRate
FROM HumanResources.Employee employee
LEFT JOIN HumanResources.EmployeePayHistory employeePayHistory ON employeePayHistory.BusinessEntityID = employee.BusinessEntityID
GROUP BY employee.BusinessEntityID
,employee.... |
Python | UTF-8 | 3,803 | 2.578125 | 3 | [] | no_license | #!/usr/bin/env python3
import os
import sys
import csv
from fdfgen import forge_fdf
def tail_shape(tail_value):
if tail_value == 'square':
return ('square', 'X')
elif tail_value == 'squash':
return ('squash', 'X')
elif tail_value == 'round':
return ('round', 'X')
elif tail_value == 'round pin':
return ('r... |
JavaScript | UTF-8 | 6,194 | 3.640625 | 4 | [] | no_license | import React,{useState} from 'react';
import Try from './Try';
//숫자 4개를 겹치지 않게 뽑는 함수
const getNumbers = () => {
const candidate = [0,1,2,3,4,5,6,7,8,9];
let arr = [];
for (let i=0;i<4;i++){
arr.push( candidate.splice(Math.floor( Math.random()*candidate.length ),1)[0] );
}
console.log(arr);
... |
Shell | UTF-8 | 302 | 3.265625 | 3 | [
"MIT"
] | permissive | #/bin/sh
forever="/user/local/bin/forever";
index="/index.js";
cmd="";
case "$1" in
start )
cmd="start";;
stop )
cmd="stop";;
restart )
cmd="restart";;
esac
if [ "${cmd}" = "" ]; then
echo "Please input cmd.";
exit 1;
i
fullCmd=${forever}" "${cmd}" "${index};
echo $fullCmd;
$fullCmd;
|
Java | UTF-8 | 404 | 3.171875 | 3 | [] | no_license | public class Carrer {
public static void main(String[]args){
System.out.println("Everyone wants to make their carrer good");
boolean x=5==5;
System.out.println(x);
Carrer myCarrer = new Carrer();
myCarrer.success();
}
public void success(){
System.out.prin... |
C# | UTF-8 | 2,073 | 2.546875 | 3 | [
"MIT"
] | permissive | using N3O.Umbraco.Data.Lookups;
using N3O.Umbraco.Data.Models;
using N3O.Umbraco.Extensions;
using N3O.Umbraco.Lookups;
using Newtonsoft.Json.Linq;
using System;
using OurDataTypes = N3O.Umbraco.Data.Lookups.DataTypes;
namespace N3O.Umbraco.Data.Parsing;
public class LookupParser : DataTypeParser<INamedLookup>, ILook... |
Python | UTF-8 | 192 | 2.609375 | 3 | [] | no_license | import numpy as np
weight = np.random.random((4,3))
bias = np.random.random((1,3))
wout = np.random.random((3,1))
bout = np.random.random((1,1))
print weight
print bias
print wout
print bout
|
Java | UTF-8 | 563 | 2.25 | 2 | [] | no_license | package com.itcodai.common;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.jms.Destination;
/**
* @author zhao_wj
* @version 1.0
* @date 2021/7/26 15:01
*/
@Service
public class MsgProducer {
@Resource
... |
Markdown | UTF-8 | 5,622 | 2.5625 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: Använda åtkomst principer i Azure HPC-cache
description: Skapa och använda anpassade åtkomst principer för att begränsa klient åtkomsten till lagrings mål i Azure HPC-cache
author: ekpgh
ms.service: hpc-cache
ms.topic: how-to
ms.date: 12/28/2020
ms.author: v-erkel
ms.openlocfilehash: 795b194eb7cd31e633128c22... |
C# | UTF-8 | 2,156 | 2.703125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DST
{
public class Solicitud
{
private string fechaSolicitud;
private string estadoSolicitud;
private string rutSolicitud;
private int idSeccionActual;
... |
Rust | UTF-8 | 1,683 | 2.640625 | 3 | [] | no_license | use bitcoin::blockdata::block::BlockHeader as BtcBlockHeader;
use crate::{
types::Result,
traits::DatabaseInterface,
btc_on_eos::btc::btc_state::BtcState,
constants::{
DEBUG_MODE,
CORE_IS_VALIDATING,
NOT_VALIDATING_WHEN_NOT_IN_DEBUG_MODE_ERROR,
},
};
fn validate_proof_of_wor... |
Java | UTF-8 | 1,518 | 3.59375 | 4 | [] | no_license | package LCQuestions;
public class _1000_MinimumCostToMergeStones {
public static void main(String[] args) {
_1000_MinimumCostToMergeStones c = new _1000_MinimumCostToMergeStones();
}
/*
So we need to know the minimum cost of merging left part to 1 pile, and minimum cost of merging right part to... |
C# | UTF-8 | 645 | 2.53125 | 3 | [] | no_license | using System.Configuration;
namespace TestConfigSettings
{
/// <summary>
///
/// </summary>
[ConfigurationCollection(typeof(FolderElement))]
public class FoldersCollection : ConfigurationElementCollection
{
protected override ConfigurationElement CreateNewElement()
{
... |
Markdown | UTF-8 | 978 | 3.125 | 3 | [
"MIT"
] | permissive | # Hometask: Quick select algorithm with random choosing pivot
## You should type on command line:
if you want to run:
-> make run
if you want to clear all created files:
-> make clear
#### Was given whole numbers sequence in range from [0, 1e9] with length n. You should ... |
JavaScript | UTF-8 | 546 | 3.171875 | 3 | [
"MIT"
] | permissive | export function getCardPosition(stack, card) {
return stack.indexOf(card)
}
export function doesStackIncludeCard(stack, card) {
return stack.includes(card)
}
export function isEachCardEven(stack) {
return stack.every((card) => card % 2 === 0)
}
export function doesStackIncludesOddCard(stack) {
return stack.s... |
C++ | UTF-8 | 742 | 2.78125 | 3 | [
"MIT"
] | permissive | #include "IterativeMethods.h"
// Create a new istance of this class
IterativeMethods::IterativeMethods(const Eigen::SparseMatrix<double>& _A, const Eigen::VectorXd& _b, StopCrit* _stopCrit)
: dimA(_A.rows()), A(_A), b(_b), stopCrit(_stopCrit){
}
// Compute the iterative method until stopCrit
void IterativeMethods::i... |
Markdown | UTF-8 | 3,697 | 2.765625 | 3 | [] | permissive | # Microsoft plans on showing off its 'Cloud Power'
The time has arrived for Microsoft to start 'showing off' it's much talked about 'cloud power'. There were quite a few technology <a href="http://www.advertisertalk.com/microsoft-outlines-opportunity-in-the-cloud-and-on-devices-at-professional-developers-conference-20... |
PHP | UTF-8 | 1,290 | 2.65625 | 3 | [] | no_license | <?php
include "connect.php";
if (isset($_POST['unos'])){
$ime=$_POST['ime'];
$prezime=$_POST['prezime'];
$email=$_POST['email'];
$password=$_POST['password'];
$username=$_POST['username'];
$telefon=$_POST['telefon'];
$adresa=$_POST['adresa'];
$sql=" INSERT INTO member(ime,prezime,email... |
Python | UTF-8 | 940 | 2.671875 | 3 | [] | no_license | #!/usr/bin/python3
def store(file, col, h=False):
dic = {}
f = open(file)
import csv
reader = csv.reader(f, delimiter = '\t')
if h: next(reader, None)
for row in reader:
dic[row[0]] = row[col-1]
return dic
def main():
import sys
import csv
import pandas as pd
if len(sys.argv) != 4:
sys.exit('pytho... |
TypeScript | UTF-8 | 1,043 | 3.296875 | 3 | [] | no_license | let city:string = 'Karachi';
let test: string = 'Hello World';
//let test: number = 5;
//let test: boolean = true;
//let test: any = {};
//let test: string | number = 444;
let testArr : string[] = ['asdas','Two']; // an array
let testArr2 : [string, number] = ['asdas', 30]; //these are called tuples for usage of... |
Markdown | UTF-8 | 10,987 | 2.71875 | 3 | [] | no_license | Варианты использования
====================================================================================

Сценарии
====================================================================================
Создание документа
--... |
Java | UTF-8 | 2,815 | 2 | 2 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package spa.presentacion.beans;
import java.util.ArrayList;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean... |
Shell | UTF-8 | 1,257 | 3.984375 | 4 | [
"Apache-2.0"
] | permissive | #!/bin/sh
# usage: ./release-prepare.sh <currentVersion> [<remote>]
if [ $# -lt 1 ]
then
echo usage: "./release-prepare.sh <releaseVersion> [<remote>]"
echo
echo "<releaseVersion> should be numeric version spec only. DO NOT add -SNAPSHOT"
echo "<remote> argument is optional. It will push t... |
Python | UTF-8 | 526 | 2.859375 | 3 | [
"MIT"
] | permissive | class Solution:
def getFolderNames(self, names: List[str]) -> List[str]:
res = []
d = collections.defaultdict(int)
for name in names:
if name in d:
i = d[name] + 1
while name+"({})".format(i) in d:
i += 1
d[n... |
Java | UTF-8 | 6,481 | 3.03125 | 3 | [] | no_license |
package com.Panels.GeneralPanels;
import com.GUIFrame.GUIFrame;
import com.Panels.WestPanelSections.WestPanelListeners.*;
import javax.swing.*;
import java.awt.*;
/**
* This Class is about west panel of our program,It has features:
* HOME: it shows list of albums and playlist in center panel.
* Library: it opens... |
PHP | UTF-8 | 574 | 2.734375 | 3 | [] | no_license | <?php
/*
-------Creado por-------
\(x.x )/ Anarchy \( x.x)/
------------------------
*/
// Yo tengo un sueño. El sueño de que mis hijos vivan en un mundo con un único lenguaje de programación. \\
include_once realpath('../../facade/Salud_pensionFacade.php');
$id = $_POST[... |
Python | UTF-8 | 108 | 2.6875 | 3 | [] | no_license | # Find keys in multidimensional dict based on value
{k: v for k, v in my_dict.items() if v['baz'] == 'abc'}
|
Java | UTF-8 | 3,808 | 2.359375 | 2 | [] | no_license | package org.pk.booklibrary.dao;
import java.util.List;
import org.pk.booklibrary.model.Book;
import org.pk.booklibrary.model.BookCategory;
import org.pk.booklibrary.model.Dashboard;
import org.pk.booklibrary.model.Education;
import org.pk.booklibrary.model.Fine;
import org.pk.booklibrary.model.IssuedBook;
import org.... |
TypeScript | UTF-8 | 11,227 | 2.90625 | 3 | [
"MIT"
] | permissive | import bus, { I2CBus, BufferCallback } from 'i2c-bus';
// Wrapper around the i2c bus, has the same functions
class MultiplexerChannel implements I2CBus {
public channelSwitch: Buffer;
constructor(public tca: Multiplexer, channel: number) {
// command to send to multiplexer via i2c
this.channelS... |
Java | UTF-8 | 144,910 | 1.84375 | 2 | [] | no_license | /*
* IFS Research & Development
*
* This program is protected by copyright law and by international
* conventions. All licensing, renting, lending or copying (including
* for private use), and all other use of the program, which is not
* expressively permitted by IFS Research & Development (IF... |
C++ | UTF-8 | 586 | 2.546875 | 3 | [] | no_license | /********************************************
* Filename:gofish.pp
* Author:faaiq waqar
* Date:02/04/2019
* Description:contains main function for go fish
* Input: header files
* Output: game running
*******************************************/
#include "card.hpp"
#include "deck.hpp"
#include "hand.hpp"
#includ... |
Java | UTF-8 | 57,611 | 2.890625 | 3 | [] | no_license | package org.modelexecution.quantitytypes.java;
import java.util.Arrays;
public class Unit implements Cloneable {
//************************
// ATTRIBUTES
//*************
protected double [] dimensions = new double [BaseUnits.values().length];
// exponents for each dimension.
// [Meter, Kilogram, Second, Am... |
Markdown | UTF-8 | 414 | 2.671875 | 3 | [] | no_license | ---
layout: page
title: Topics
permalink: /topics/
---
<ul id="cat-list">
{% for category in site.categories reversed %}
<li class="category"><h2>{{ category | first | upcase}}</h2>
<ul>
{% for posts in category %}
{% for post in posts %}
<li><a href="{{ post.url }}">{{ post.title }... |
Java | UTF-8 | 266 | 1.648438 | 2 | [] | no_license | package by.bntu.kharaneka.enrolleedocfillingmvp.repository;
import by.bntu.kharaneka.enrolleedocfillingmvp.entity.Address;
import org.springframework.data.jpa.repository.JpaRepository;
public interface AddressRepository extends JpaRepository<Address, Integer> {
}
|
Markdown | UTF-8 | 666 | 3.40625 | 3 | [] | no_license | ```js
class MyArray {
constructor() {
this.length = 0;
this.data = {};
}
get(index) {
return this.data[index];
}
push(item) {
this.data[this.length] = item;
++this.length;
return this.length;
}
pop() {
const lastItem = this.data[this.length - 1];
delete this.data[this.le... |
Java | UTF-8 | 625 | 2.09375 | 2 | [] | no_license | package com.pb.dashboard.monitoring.components.parameter;
/**
* Created by vlad
* Date: 05.01.15_9:12
*/
public enum MonitoringParam {
COUNTRY("country"),
COMPLEX("complex"),
INTERFACE("interface"),
METRIC("metric"),
RANGE("range"),
DATE("date"),
DATE_FROM("from"),
DATE_TO("to"),
... |
Python | UTF-8 | 3,709 | 2.96875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
'''
Cryptowat.ch API
https://cryptowat.ch/docs/api
https://api.cryptowat.ch/markets/gdax/btcusd/trades?limit=100 '''
import urllib.request, json, datetime, time
from pathlib import Path
from urllib.request import urlopen
exchanges = [
'bitfinex',
'gdax',
#'bitstamp',
#'kraken',
... |
C | UTF-8 | 1,296 | 4.5625 | 5 | [] | no_license | //Pandigital multiples-Problem 38
// Pandigital - numero que contém pelo menos um de cada dígito em sua base exemplo: 1749208365.
#include <stdio.h>
int pandigital(int n) //Função que verifica se é numero pandigital a partir da solução que vai receber.
{
int numeros[9] = {0}; // Array com espaço para um numero de 9... |
Python | UTF-8 | 1,233 | 2.734375 | 3 | [] | no_license | import json
from urllib.parse import unquote
def decode(value):
while "+" in value:
value = value.replace("+", " ")
return unquote(value)
def form_body_to_json(body):
elements = body.split("&")
data = dict()
for element in elements:
items = element.split("=")
name = decod... |
Java | UTF-8 | 2,065 | 2.96875 | 3 | [
"MIT"
] | permissive | package com.icroque.core.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
* Created by Rémi on 09/01/2016.
*/
public class WeatherCommand extends Command {
public WeatherCommand() {
super("weather", "core.weather", true);
}
@Override
public void comma... |
Python | UTF-8 | 261 | 3.65625 | 4 | [] | no_license | #3번문제 / C111061 박서연
def reverseList2(n):
lst2 = list(n)
lst2.remove(max(lst2))
lst2.reverse()
return lst2
def main():
lst = [20, 60, 40, 10, 50]
print(reverseList2(lst))
print(lst)
main() |
Java | UTF-8 | 291 | 1.851563 | 2 | [] | no_license | package com.tsb.dao;
import com.tsb.model.Organization;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface IOrganizationDao {
void insertOrg(Organization organization);
List<Organization> selectOrg(Organization organization);
} |
JavaScript | UTF-8 | 68 | 2.578125 | 3 | [] | no_license | export const abs = (num) => {
return num >= 0 ? num : - num;
};
|
Rust | UTF-8 | 699 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | use std::process::exit;
fn press_enter() {
// On windows, where installation happens in a console that may have opened just for this
// purpose, give the user an opportunity to see the error before the window closes.
if cfg!(windows) && atty::is(atty::Stream::Stdin) {
println!();
println!("... |
Java | UTF-8 | 504 | 2.921875 | 3 | [] | no_license | package raf;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
/**
从文件中读取文本内容
*/
public class ReadStringDemo {
public static void main(String[] args) throws IOException {
RandomAccessFile raf = new RandomAccessFile("note.txt","rw");
byte[] date = ... |
Swift | UTF-8 | 915 | 2.625 | 3 | [] | no_license | //
// FighterKnockbackState.swift
// spritekit-plataform
//
// Created by Thiago Valente on 11/03/19.
// Copyright © 2019 Bruno Rocha. All rights reserved.
//
import SpriteKit
import GameplayKit
class FighterKnockbackState: GKState {
var node: SKSpriteNode!
var stateAtlasTextures: [SKTexture] = []
... |
TypeScript | UTF-8 | 1,737 | 2.515625 | 3 | [
"MIT"
] | permissive | import { Loader } from './loader';
import { Indexer } from './indexer';
import * as shell from './shell';
import { HttpRequest } from './http-request';
import * as app from './app';
export class Api {
public loader: Loader;
private slug = ['@', '\\', '/', '>', '?', ':'];
constructor() {
const _co... |
Python | UTF-8 | 117 | 3.46875 | 3 | [
"MIT"
] | permissive | # 入力
S = input()
# 文字列比較で判定
ans = 'Heisei' if S <= '2019/04/30' else 'TBD'
# 出力
print(ans)
|
Python | UTF-8 | 1,109 | 3.546875 | 4 | [] | no_license | import time
from rpi_ws281x import * # 导入包
LED_COUNT = 60 # 激活的LED灯数量
LED_PIN = 18 # 灯带端口号
strip = PixelStrip(LED_COUNT, LED_PIN) # 创建灯带对象
strip.begin() # 灯带初始化
def colorWipe(strip, color, wait_ms=50):
"""将灯带全部刷成同一颜色"""
for i in range(strip.numPixels()):
strip.setPixelColor(i, color)
... |
Java | UTF-8 | 2,017 | 3.34375 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package tempserver2;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Serv... |
Python | UTF-8 | 801 | 3.859375 | 4 | [] | no_license | """CP1404 Practical - Guitars prac"""
from prac_06.guitar import Guitar
def main():
guitars = []
guitars.append(Guitar("Gibson L-5 CES", 1922, 16035.40))
guitars.append(Guitar("Line 6 JTV-59", 2010, 1512.9))
name = input("Name: ")
while name.strip() != "":
year = int(input("Year: "))
... |
Ruby | UTF-8 | 2,880 | 2.65625 | 3 | [
"MIT"
] | permissive | gem 'minitest'
require 'minitest/autorun'
require 'exits/rules'
class SomeController; end;
class User; end;
describe Exits::Rules do
def setup
@rules = Exits::Rules.new
end
describe Exits::Rules::Model do
def setup
@rule = Exits::Rules::Model.new
end
it 'should not authorize if no rules ... |
Markdown | UTF-8 | 2,373 | 3.5 | 4 | [] | no_license | # Random Word Generator
Takes a list of sample words, generates a frequency table for the next letter given the previous n characters, and makes words based on that frequency table.
## Usage
Create a new generator object. Pass either a preset name or a custom settings object into the constructor.
Then, use the `gen... |
Java | UTF-8 | 1,715 | 2.03125 | 2 | [] | no_license | package com.bpwizard.gateway.web.filter;
import com.bpwizard.gateway.plugin.api.result.GatewayResultEnum;
import com.bpwizard.gateway.plugin.base.utils.GatewayResultWrap;
import com.bpwizard.gateway.plugin.base.utils.WebFluxResultUtils;
import org.springframework.http.HttpStatus;
import org.springframework.http.server... |
C | UTF-8 | 2,142 | 3.84375 | 4 | [] | no_license | /*AUTHOR : Sayantan Banerjee (2018 IMT - 093)*/
#include<stdio.h>
#include<stdlib.h>
#include<malloc.h>
struct node{
int val;
struct node *next;
}*front=NULL,*rear=NULL;
struct node2{
int val;
struct node2 *next;
}*top=NULL;
int PUSH(int value)
{
struct node2 *current=(struct node2*)malloc(sizeof(struct node2));
... |
Shell | UTF-8 | 2,185 | 3.1875 | 3 | [] | no_license | #!/bin/bash
set -u
set -e
BLUE='\033[0;34m'
NC='\033[0m' # No Color
echo -e "${BLUE}Updating dependencies${NC} "
if [ ! -d crux ]; then
git clone https://github.com/blk-io/crux.git
else
cd crux && git pull && cd ..
fi
if [ ! -d blk-explorer-free ]; then
git clone https://github.com/blk-io/epirus-free.git... |
TypeScript | UTF-8 | 755 | 2.671875 | 3 | [] | no_license | it("maps from one shape to another", () => {
const original = {
company: {
devs: [
{
firstname: "Webber",
lastname: "Wang",
},
{
firstname: "Vien",
lastname: "Nguyen",
},
],
},
info: [
{
key: "user.address.nu... |
Shell | UTF-8 | 1,692 | 2.65625 | 3 | [] | no_license | #!/bin/sh
#@@example acy(300)
#@@purpose Generate axial lead through-hole component
#@@desc Generate axial lead through-hole component with 2 pins (typical use: resistor)
#@@params spacing,type,pol,dia
#@@param:spacing spacing between the two pins
#@@dim:spacing
#@@param:type silk symbol type
#@@enum:type:block eu... |
Java | UTF-8 | 1,335 | 3.390625 | 3 | [
"MIT"
] | permissive | package jsong00505.study.test.nile;
import java.util.ArrayList;
import java.util.Arrays;
public class HackerArtOne {
public static void main(String[] args) {
int num = 100;
// define list of zero holes
ArrayList zeroHoles = new ArrayList();
zeroHoles.add(1);
zeroHoles.add(2);
zeroHoles.a... |
Java | UTF-8 | 1,380 | 3.140625 | 3 | [] | no_license | package model;
public class TesterTest {
public String[] test1(Tester tester){ //自分が親の場合の計算
//ロン上がりとツモ上がりの2パターンを配列pointsに格納
String[] points = new String[2];
int oyako = Integer.parseInt(tester.getFu());
int fu = Integer.parseInt(tester.getFu());
int han = Integer.parseInt(tester.getHan());
if(tes... |
Java | UTF-8 | 800 | 2.921875 | 3 | [] | no_license | package pe.com.hatunsol.hatunsolmovil.util;
import java.io.File;
public class FileCache {
public static boolean clearCache(File dir) {
try {
if (dir != null && dir.isDirectory()) {
String[] children = dir.list();
for (String child : children) {
... |
JavaScript | UTF-8 | 847 | 2.578125 | 3 | [] | no_license | import React, { useEffect, useState } from 'react'
import Square from './Square'
const Plateau = ({ size, positionX, positionY, direction }) => {
const [table, setTable] = useState(null)
useEffect(() => {
setTable(generateTable())
}, [size, positionX, positionY, direction])
const renderRow = (y) => {
... |
Python | UTF-8 | 5,342 | 3.59375 | 4 | [] | no_license | '''
尽量用ProcessPoolExecutor进行多进程编程
'''
import multiprocessing as mp
import threading as td
import time,os
# def worker(sec,name):
# for i in range(3):
# time.sleep(sec)
# print(name)
#
# if __name__=='__main__': # windows下多进程必须在主函数中运行
# p=mp.Process(target=worker,args=(0.3,),kwargs={'name':'... |
Java | UTF-8 | 2,481 | 2.21875 | 2 | [] | no_license | package com.example.petmania.model;
import java.io.Serializable;
public class Doctors implements Serializable {
private int id,br_id,dr_show_no;
private String dr_email,dr_name,dr_phone,dr_pass,dr_desc,dr_speciality,dr_fee,error_msg;
public Doctors() {
}
public Doctors(int id, int br_id, int dr... |
Markdown | UTF-8 | 1,777 | 3.015625 | 3 | [] | no_license | ### Explore Bike Share Data
Use Python to explore data related to bike share systems for three major cities in the United States—Chicago, New York City, and Washington.
### Description
Over the past decade, bicycle-sharing systems have been growing in number and popularity in cities across the world. Bicycle-sharing ... |
C++ | UTF-8 | 377 | 3.34375 | 3 | [] | no_license | #include<iostream>
#include<ostream>
#include<cmath>
using namespace std;
double power(double m,int n);
int main()
{
int n=2;
double raised ,m;
cout<<"\nEnter the value of m:";
cin>>m;
cout<<"\nEnter the value of n:";
cin>>n;
raised=power(m,n);
cout<<"m raised to power n is="<<raised <<endl;
}
double power(do... |
C++ | UTF-8 | 748 | 2.53125 | 3 | [] | no_license | #include "user.h"
namespace mmp
{
user_signup_def::user_signup_def():m_gender(gender_unknown)
{
}
user_signup_def::~user_signup_def()
{
}
user_signin_def::user_signin_def()
{
}
user_signin_def::~user_signin_def()
{
}
user_trial_def::user_trial_def()
{
}
user_trial_def::~user_trial_def()
{
}
u... |
Shell | UTF-8 | 221 | 2.5625 | 3 | [
"MIT"
] | permissive | [ -z "$1" ] && { echo "convert.sh <file>"; exit 1; }
sed -i '/\\begin{verbatim}/{
a\
\\lstset{basicstyle=\\scriptsize,language=C}\
\\begin{lstlisting}
d
}
/\\end{verbatim}/{
i\
\\end{lstlisting}
s/\\end{verbatim}//
}' $1
|
TypeScript | UTF-8 | 1,294 | 2.671875 | 3 | [] | no_license | import { Injectable } from '@angular/core';
@Injectable()
export class CheckStatusGameService {
constructor() { }
private fieldSize: number | undefined;
patternWin = [0, /(1){5}/, /(2){5}/, /[01]*7[01]*/, /[02]*7[02]*/];
public checkStatus(x: number, y: number, fieldArray: Array<any>): boolean {
this.fi... |
C++ | UTF-8 | 5,540 | 2.765625 | 3 | [] | no_license | #include "LevelFactory.h"
#include <fstream>
#include <streambuf>
#include "BoardObjects/BoardObjectArrow.h"
#include "BoardObjects/BoardObjectEnemy.h"
#include "BoardObjects/BoardObjectGoal.h"
#include "BoardObjects/BoardObjectPerson.h"
#include "BoardObjects/BoardObjectPit.h"
#include "BoardObjects/BoardObjectRock.... |
C# | UTF-8 | 1,889 | 3.671875 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _443_string_compression
{
class Program
{
static void Main(string[] args)
{
var chars = "aabbccc".ToCharArray();
var result = Compress(chars);
... |
JavaScript | UTF-8 | 1,028 | 2.640625 | 3 | [] | no_license | import React, {useState, useRef,useEffect} from 'react';
import useWebAnimations from "@wellyshen/use-web-animations";
import './App.css';
function App() {
const {ref,playState,getAnimation} = useWebAnimations({
keyframes:[
{transform:"translateY(0px)" , backgroundColor:"blue"},
{transform:"translat... |
Shell | UTF-8 | 369 | 2.984375 | 3 | [] | no_license | #!/bin/bash
for num in 8 4 2 1
do
echo "$num Threads:"
export OMP_NUM_THREADS=$num
for i in $(ls ../public-instances/*.ini)
do
file_var=${i:20}
echo "./lcs-omp $i > ../result/Threads$num/test-$file_var.out"
./lcs-omp $i > ../result/Threads$num/test-$file_var.out
echo "DONE Exec"
... |
Java | UTF-8 | 817 | 2.203125 | 2 | [
"Apache-2.0"
] | permissive | package org.robobinding;
import org.robobinding.binder.InflatedViewWithRoot;
import org.robobinding.binder.ViewBindingLifecycle;
import org.robobinding.presentationmodel.AbstractPresentationModelObject;
import android.view.View;
/**
* @since 1.0
* @author Cheng Wei
*
*/
public class BindableView {
private final... |
Markdown | UTF-8 | 3,989 | 2.65625 | 3 | [] | no_license | # [FixInsight](http://sourceoddity.com/fixinsight/): static code analysis catching so much more than the compiler does.
[Nyborg, Denmark, 20151021](http://www.dapug.dk/2015/08/workshop-20.html)
- Examples: <https://bitbucket.org/jeroenp/besharp.net>
- Slides: <http://github.com/jpluimers/Conferences>
- Blog: <http://... |
SQL | UTF-8 | 472 | 3.609375 | 4 | [] | no_license | CREATE TABLE USER
(
ID BIGINT AUTO_INCREMENT PRIMARY KEY,
USERNAME VARCHAR(128) NOT NULL UNIQUE,
PASSWORD VARCHAR(256) NOT NULL,
BLOCKED BOOLEAN NOT NULL
);
CREATE TABLE AUTH_USER_GROUP
(
ID BIGINT AUTO_INCREMENT PRIMARY KEY,
USERNAME VARCHAR(128) NOT NULL,
AUTH_GROUP ... |
JavaScript | UTF-8 | 1,136 | 2.796875 | 3 | [] | no_license | function startGyro() {
var tempa=0,tempb=0,tempc=0,count=0;
var handleGyroData = function(alpha, beta, gamma){
count++;
// running averages of gyroscope values
tempa = ((tempa*(count-1)) + alpha)/count;
tempb = ((tempb*(count-1)) + beta)/count;
tempc = ((tempc*(count-1)) + gamma)/count;
};
wi... |
SQL | UTF-8 | 3,189 | 2.75 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] | permissive | -- Copyright 2020 The Nomulus Authors. 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 required by a... |
Java | UHC | 475 | 2.953125 | 3 | [] | no_license | import java.io.*;
public class Exam_14 {
public static void main(String[] args) throws IOException {
File dir = new File("C:\\Users\\Administrator\\Desktop\\߾ӱ");
File file = new File(dir,"text01.txt");
FileInputStream fis = new FileInputStream(file);
while(true)
{
int res = fis.read(); // Ͽ 1... |
C++ | UTF-8 | 1,208 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
int main() {
double a, b, c;
cout << "ax^2+bx+c=0 masodfoku egyenlet megoldasa.\n";
cout << "a: "; cin >> a;
if(a==0.) cout << "Ez nem egy masodfoku egyenlet!(Nigger)" << endl;
else {
cout << "b: "; cin >> b;
cout << "c: "; ... |
Markdown | UTF-8 | 4,343 | 2.578125 | 3 | [
"MIT"
] | permissive | ---
id: mail
label: Mail
title: Mail - Actions
type: action
description: "This add-on provides SMTP services so your rules and scripts can send e-mails."
source: https://github.com/openhab/openhab1-addons/blob/master/bundles/action/org.openhab.action.mail/README.md
since: 1x
install: auto
---
<!-- Attention authors: D... |
Swift | UTF-8 | 4,498 | 2.53125 | 3 | [] | no_license | //
// ArrivalsCell.swift
// CTA Train Tracker 2
//
// Created by Thomas Bart on 8/9/19.
// Copyright © 2019 Thomas Bart. All rights reserved.
//
import UIKit
class ArrivalsCell: BaseCell {
var route: Route? {
didSet {
if let station = route?.station {
stationLabel.text = st... |
Markdown | UTF-8 | 540 | 2.96875 | 3 | [
"MIT"
] | permissive | # auto-retryer
extend the automatic retry function for the Promise function
## Build Setup
``` bash
# install dependencies
npm install auto-retryer --save
# node test
cd node_modules/auto-retryer
npm run test
```
## Usage
```js
const AutoRetryer = require('auto-retryer')
const _fetch = require('node-fetch')
//max... |
Python | UTF-8 | 1,108 | 2.5625 | 3 | [] | no_license | import requests
import os
import random
import time
import requests_cache
from bs4 import BeautifulSoup
requests_cache.install_cache('demo_cache')
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 '
'Firefox/57.0'}
response = requests.get("http://ww... |
Markdown | UTF-8 | 854 | 2.546875 | 3 | [] | no_license | ---
author: Jacob Tomlinson
date: 2012-06-01T00:00:00+00:00
categories:
- Events
tags:
- Download Festival
- Google Docs
thumbnail: download-festival
title: Download Festival 2012 Timetable
aliases:
- /2012/06/01/download-2012-timetable/
---
Download have now released the times for Download Festival 2012 in th... |
Java | UTF-8 | 2,189 | 4.03125 | 4 | [] | no_license | package DiningPhilosopherProblem;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class App {
public static void main(String[] args) throws InterruptedException {
ExecutorService executorService = null;
Philosopher[] philosophers = null;
try{
... |
Python | UTF-8 | 503 | 3.15625 | 3 | [] | no_license | N = int(input())
LR = [list(map(int, input().split())) for _ in range(N)]
def calc_expect_by_two(LR1, LR2):
l1, r1 = LR1
l2, r2 = LR2
bunshi = 0
bunbo = 0
for i in range(1, 101):
for j in range(1, 101):
if l1 <= i <= r1 and l2 <= j <= r2:
bunbo += 1
... |
Python | UTF-8 | 8,316 | 2.765625 | 3 | [] | no_license | import csv
import numpy
import re
import nltk
import pandas
import pymysql
from parseSOAPI import extractAPI
from bs4 import BeautifulSoup
host = 'localhost'
username = 'root'
password = '123456'
database='github_issues'
#关键词
KWs=['fast','slow','efficient','scalable','expensive','intensive','quick','rapid','performa... |
SQL | UTF-8 | 2,436 | 3.71875 | 4 | [
"MIT"
] | permissive | /*
pco_powerplan_basic_attributes.sql
~~~~~~~~~~~~~~~~~~~
This query grabs any currently active powerplan and powerplan-level
attributes (such as default view, or copy forward) in addition to
reference text and powerplan commaents
*/
select powerplan = pwcat.description
, plan_type = uar_get_code_display(pwcat.pa... |
Markdown | UTF-8 | 2,053 | 2.515625 | 3 | [] | no_license | ---
title: L'équipe
---
</div>
</div>
<div class="hero" style="background-image:url('/images/header7.jpg')">
<div class="title">
<h1>L'équipe</h1>
<p>Autour de deux amis qui souhaitent partager leur passion pour les défis techniques et l'exploration:</p>
</div>
</div>
<div class="container"... |
Swift | UTF-8 | 7,207 | 2.78125 | 3 | [] | no_license | //
// PickPostTableViewCell.swift
// abseil
//
// Created by Ann McDonough on 4/25/20.
//
import UIKit
class PickPostTableViewCell: UITableViewCell {
@IBOutlet weak var usernameLabel: UILabel!
@IBOutlet weak var chosenTeamLineLabel: UILabel!
var likedAlready = false
var dislikedAlready = false
... |
C++ | UTF-8 | 571 | 2.9375 | 3 | [] | no_license | #pragma once
#include <iostream>
#define MAX_DEGREE 22
using namespace std;
class Polynomial {
private:
int degree;
double coeffecient[MAX_DEGREE];
public:
Polynomial();
Polynomial operator*(const Polynomial& aRight) const;
friend std::istream& operator>>(std::istream& aIStream, Polynomial& aP... |
Java | UTF-8 | 3,384 | 3.046875 | 3 | [] | no_license | import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Random;
public class Population {
float mutationRate;
DNA[] population;
ArrayList<DNA> matingPool;
int generations;
boolean finished;
int perfectSco... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.