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 |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 1,606 | 3.453125 | 3 | [] | no_license | # Answers
1. What is React JS and what problems does it try and solve?
React JS is a Javascript Library for building complex and dynamic intercaes. React uses a virtual DOM so it can compare against the real DOM and only update single parts instead of the entire page every time. This also means it allows a website... |
C++ | UTF-8 | 8,425 | 3.640625 | 4 | [] | no_license | #include "graph.h"
using namespace std;
//Zach Li
//Table class supports building, traversing graph structures. There are
//three ways of traversing and diplay the structure of the graph: display
//adjacency list and connection of each vertices, DFS and BFS.The menu class handles the
//client program with simple dis... |
Markdown | UTF-8 | 627 | 3.109375 | 3 | [] | no_license | # [ B L O C K S ]
`blocks-dot-js` `[].js`
*blocks/prototypes === default-constructor === implicit-base*
>> 
---
# Syntax
*Block* := `["classes", "name", {config}, Block[]];`
* **classes** - (comma- and/or) whitespace-seperated list of class names
* **name** - the name for t... |
Java | UTF-8 | 1,366 | 3.8125 | 4 | [] | no_license | package algorithm;
import java.util.*;
public class MapValueSort {
public static void main(String[] args) {
Map<String, Integer> map = new HashMap<>();
map.put("three", 3);
map.put("nine", 9);
map.put("zero", 0);
map.put("five", 5);
map.put("two", 2);
map.pu... |
Java | UTF-8 | 1,077 | 2.765625 | 3 | [] | no_license | package com.example.pruebasjuego.Screen;
import android.content.Context;
public class ScreenDivider {
private int w,h,boxSizeX,boxSizeY;
private Box[] boxes;
public ScreenDivider(int initX, int finalX, int initY, int finalY, int div, Context context) {
this.w = finalX-initX;
this.h = fina... |
Python | UTF-8 | 5,327 | 2.765625 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import numpy as np
from nitime import descriptors as desc
from nitime import timeseries as ts
from nitime import algorithms as tsa
# To support older versions of numpy that don't have tril_indices:
from nitime.index_utils import tril_indices
from .base import BaseAnalyzer
class CorrelationAnalyzer(BaseAnalyzer):
... |
Java | UTF-8 | 418 | 2.046875 | 2 | [] | no_license | package kodlamaio.hrms.business.abstracts;
import java.util.List;
import kodlamaio.hrms.core.utilities.results.DataResult;
import kodlamaio.hrms.core.utilities.results.Result;
import kodlamaio.hrms.entities.concretes.CvTalent;
public interface CvTalentService {
DataResult<List<CvTalent>> getAll();
DataResult<CvTal... |
Java | UTF-8 | 87 | 2.203125 | 2 | [] | no_license | @Override protected final String defaultAsString(){
return asString(defaultValue);
}
|
Python | UTF-8 | 128 | 3.1875 | 3 | [] | no_license | #!/usr/bin/env Python3
counter = 1
fac = 1
while counter < 1001 :
fac = fac * counter
counter += 1
print(fac)
print('Done!')
|
Markdown | UTF-8 | 1,659 | 2.5625 | 3 | [] | no_license | # CleanApp
**This is a work in progress experimental project and is not intended as production-ready code**. It's currently in a development process and many more features will be implemented soon.
## Purpose
The main purpose of this project is to provide an easy house cleaning service to its users. The app has two ... |
Markdown | UTF-8 | 16,121 | 2.53125 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: 规划 Azure 用户主体名称(UPN)更改并对其进行故障排除
description: 了解 UPN 更改的已知问题和缓解措施
services: active-directory
ms.service: active-directory
ms.subservice: hybrid
ms.topic: how-to
ms.date: 03/13/2020
ms.author: baselden
author: barbaraselden
manager: daveba
ms.reviewer: jsimmons
ms.collection: M365-identity-device-management
ms... |
Java | UTF-8 | 1,484 | 1.953125 | 2 | [] | no_license | ///******************************************************************************
// * Copyright (C) 2016 Wuhan Medical union Co.Ltd All Rights Reserved.
// * 本软件为武汉水象科技有限公司开发研制。 未经本公司正式书面同意,其他任何个人、
// * 团体不得使用、复制、修改或发布本软件.
// *****************************************************************************/
//package com... |
Java | UTF-8 | 180 | 1.828125 | 2 | [] | no_license | package com.axpresslogistics.it2.axpresslogisticapp.presenter;
public interface MainPresenter<T> {
void init();
void subscribe(T t);
void unSubscribe();
}
|
SQL | UTF-8 | 359 | 3.234375 | 3 | [] | no_license | create keyspace if not exists datastax_shared_session_demo with replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
use datastax_shared_session_demo;
CREATE TABLE if not exists timeline (
userid uuid,
time timeuuid,
follower_id uuid,
message text,
PRIMARY KEY (userid, time)
) WITH CLUSTERING O... |
Java | UTF-8 | 531 | 2.109375 | 2 | [] | no_license | package ce.pucmm.edu.vaadin.Data;
import ce.pucmm.edu.vaadin.Model.CalendarEvent;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.Date;
import java.util.List;
public interface EventRepository extends JpaRepository<CalendarEvent, Lon... |
PHP | UTF-8 | 1,578 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Foundation\Auth\User as Authenticatable;
use App\AdminRole;
use Illuminate\Notifications\Notifiable;
class AdminUser extends Authenticatable
{
use Notifiable;
protected $rememberTokenName = '';
/**
* The attributes that are mass assignable.
*
* @var arr... |
Python | UTF-8 | 194 | 2.984375 | 3 | [] | no_license | N = int(input())
data = [0]*(N+1)
data[1]=1
def fibo(N,data):
for i in range(2,N+1):
data[i]=data[i-1]+data[i-2]
return(data[N])
fibo(N,data)
print(4*data[N]+2*data[N-1]) |
Java | UTF-8 | 2,838 | 2.328125 | 2 | [] | no_license | package com.bit.struts.model;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import com.bit.struts.model.entity.Struts06Vo;
public class Struts06Dao {... |
JavaScript | UTF-8 | 553 | 2.78125 | 3 | [] | no_license | import React, {Component} from 'react';
import './App.css';
class App extends Component {
state = {
name: "Shuva"
}
changeName = () => {
this.setState({
name: "Shuv"
})
}
removeName = () => {
this.setState({
name: ""
})
}
render() {
return (
<div className="App">
<br/>
<br/>... |
Markdown | UTF-8 | 3,816 | 2.53125 | 3 | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] | permissive | # TensorFlowObjectDetector (TFOD) for FTC
[](
https://www.youtube.com/watch?v=PJrMLcY_Es4&list=PL7jOvcu8grvvO54G4f0QdUCyg8loid5Wd&index=1 "Seek Example Videos")
## What is this?
This repository contains an Android library which enable... |
C# | UTF-8 | 1,942 | 2.71875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System... |
JavaScript | UTF-8 | 2,584 | 3.703125 | 4 | [] | no_license | // 完成的功能是合并多个对象到第一个对象中去
// 第一个参数如果是一个布尔值,那么可以用来区分是浅拷贝还是深拷贝
// extend(true, obj1, obj2, obj3)
import { isArray, isPlainObject } from "../../utils";
// 深度扩展的核心有两点
// 1、如果待拷贝属性值是一个对象,那么就不能直接赋值,要深度合并
// 2、如果待拷贝属性值是对象,那么已有值需要和其类型一致(要么都是数组、要么都是对象)
// 如果不一致,就要对clone进行重新赋值使其类型一致
export default function extend() {
// 默认不进行... |
Python | UTF-8 | 1,238 | 3.09375 | 3 | [] | no_license | import math
import numpy as np
from configs import *
from wall import Wall
def createGoodWall(finishPos):
wall = Wall(finishPos[0]-5, finishPos[1]-5, finishPos[2], finishPos[3])
wall.image.fill(pg.Color('red'))
good_wall_list.add(wall)
def randomAngle():
angle = np.random.uniform(0, 2.0*math.pi)
#angle = (np.ran... |
PHP | WINDOWS-1251 | 207 | 2.859375 | 3 | [] | no_license | <?php
$s=600;
$t=10;
echo " = $s/$t = " . $s/$t .' /;<br>';
echo " = $s/$t*1000/(10*60) = " . ($s/$t*1000/(10*60)) .' /;';
?> |
Python | UTF-8 | 4,463 | 3.359375 | 3 | [] | no_license | #huffman.py
"""contains the huffmannode class and all of the functions dedicated to implementing the huffman codes, decoding and encoding
"""
class HuffmanNode:
def __init__(self, char, freq):
self.char = char # actually the character code
self.freq = freq
self.left = None
self.right... |
Swift | UTF-8 | 2,965 | 2.78125 | 3 | [] | no_license | //
// FlightDocsAPIService.swift
// FlightDocsInventory
//
// Created by PRADIP on 2021-06-15.
//
import Foundation
typealias Request = (Result<Array<Any>, NetwrokError>) -> Void
class FlightDocsAPIService {
static let shared = FlightDocsAPIService()
private let urlSession = URLSession.shared
priv... |
Go | UTF-8 | 4,087 | 2.890625 | 3 | [] | no_license | package main
import (
"fmt"
"net/http"
"strconv"
"github.com/labstack/echo/v4"
"gorm.io/driver/mysql"
"gorm.io/gorm"
)
var (
DB *gorm.DB
)
func init() {
InitDB()
InitialMigration()
}
type Config struct {
DB_Username string
DB_Password string
DB_Port string
DB_Host string
DB_Name string
}
... |
Python | UTF-8 | 13,506 | 2.515625 | 3 | [] | no_license | from Team import Team
import warnings, random
from VocabList import VocabList
import random, os, socket, sys, pickle
import pygame
import tkinter
import tkinter.filedialog
import matplotlib.pyplot as plt
import pandas as pd
root = tkinter.Tk()
root.withdraw()
pygame.init()
## get size of an
def sizeof(obj):
size =... |
Markdown | UTF-8 | 2,714 | 2.859375 | 3 | [] | no_license | # IMAGE-CLASSISICATION using CIFAR-10 DATSET
## Datasets:
The CIFAR-10 dataset consists of 60000 32x32 colour images in 10 classes, with 6000 images per class. There are 50000
training images and 10000 test images.
The dataset is divided into five training batches and one test batch, each with 10000 images.
The t... |
C++ | UTF-8 | 548 | 3.4375 | 3 | [] | no_license | class Solution {
public:
int size(ListNode* head) {
int res = 0;
while(head) {
res++;
head = head->next;
}
return res;
}
TreeNode* build(ListNode *& head, int l, int r) {
if(l > r) {
return NULL;
}
int mid = (l + r) >> 1;
TreeNode* root = new TreeNode(0);
if(l <= mid) root->left = build(h... |
C# | UTF-8 | 550 | 2.859375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace InterfacePolymorphism_App
{
class Man : IMannerable,IEmotionable
{
public void depart()
{
Console.WriteLine("Man Depart");
}
public void wish()
{
Con... |
Python | UTF-8 | 629 | 3.421875 | 3 | [] | no_license | def main():
f = open("input.txt", 'r')
line = f.readline().replace("0", " ")
rows = 6
columns = 25
n = rows * columns
layers = [line[i:i + n] for i in range(0, len(line), n)]
pict = list(map(lambda it: some(it, layers), range(0, n)))
one = ''.join(pict)
pictrows = [one[i:i + colu... |
Java | UTF-8 | 9,230 | 2.671875 | 3 | [] | no_license | package com.prs.main;
import com.prs.abstraction.enumic.ConstraintTypes;
import com.prs.abstraction.interfaces.IOption;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.stream.Collectors;
public class ParserHelper {
public static void checkUnsupported(String[] arg... |
Python | UTF-8 | 545 | 2.96875 | 3 | [] | no_license | class Solution:
def majorityElement(self, nums: List[int]) -> int:
dic = {}
for i, element in enumerate(nums):
if element not in dic:
dic[element] = 1
else:
dic[element] += 1
# print(dic)
return max(dic, key=dic.ge... |
Ruby | UTF-8 | 677 | 4.125 | 4 | [] | no_license | catch(:done) do
puts "This is done"
end
catch(:finished) do
puts "This is finished"
end
# catch(:taken) do
# print "Enter number: "
# num = gets.chomp.to_i
# throw(:taken) if num == 0
# puts "Your number is #{num}"
# end
# puts "You're finished!"
def do_things(num)
i = 0
while true
puts "I'm doin... |
C# | UTF-8 | 821 | 3.328125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
namespace ImtiazAdar
{
class SortByLength
{
//static void Main(string[] args)
//{
// int N = int.Parse(Console.ReadLine());
// while(N-- > 0)
// {
// ... |
Go | UTF-8 | 454 | 2.53125 | 3 | [] | no_license | package main
import (
"flag"
"fmt"
"log"
gs "github.com/mllu/go-ssh"
)
func main() {
cmd := flag.String("cmd", "pwd", "command to execute on remote server")
sc := gs.NewConfig()
sc.ParseCommandLine()
sess, err := sc.NewSSHClientSession()
if err != nil {
log.Fatal(err)
}
defer sess.Close()
rsp, err := ... |
PHP | UTF-8 | 2,886 | 2.84375 | 3 | [] | no_license | <?php
session_start();
include("class/db.php");
if (isset ($_POST['index']) ) {
$arr_newdata = sort_data("ISBN", 0);
print_table($arr_newdata);
}
if (isset ($_POST['select_1']) || isset ($_POST['select_2']) ) {
$choose = $_POST['select_1'];
$sort = $_POST['select_2'];
$arr_newdata = sort_d... |
PHP | UTF-8 | 1,407 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Laravel\Passport\HasApiTokens;
class User extends Authenticatable
{
use Notifiable;
use HasApiTokens, Notifiable;
use Sluggable;
/**
... |
C | UTF-8 | 321 | 3.015625 | 3 | [] | no_license | //
// main.c
// dev1
//
// Created by 今林 毅一郎 on 2016/09/25.
// Copyright © 2016年 今林 毅一郎. All rights reserved.
//
#include <stdio.h>
int main(void)
{
int i;
for (i=1;i<=10;i++)
{
printf("%2d:hello !\n",i);
}
printf("goodby World!\n");
return 0;
}
|
C++ | UHC | 1,371 | 2.953125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int n, m, a[510][510], dy[510][510];
int mx[4] = { -1, 1, 0, 0 }, my[4] = { 0, 0, -1, 1 };
int DFS(int x, int y)
{
int i;
if (x == n && y == m)
return 1;
if (dy[x][y] >= 0)
return dy[x][y];
if (dy[x][y] == -1)
dy[x][y] = 0;
for (i = 0; i < 4; i++)
{
int nx = x + ... |
TypeScript | UTF-8 | 186 | 2.84375 | 3 | [] | no_license | export interface IOrganism {
id?: number;
organismName?: string;
}
export class Organism implements IOrganism {
constructor(public id?: number, public organismName?: string) {}
}
|
JavaScript | UTF-8 | 1,461 | 2.84375 | 3 | [] | no_license | module.exports.distance = function(x1, y1, x2, y2) {
return Math.sqrt(Math.pow(x2-x1, 2) + Math.pow(y2-y1, 2));
};
module.exports.getCriticalPath = function(tasks) {
var endTasks = getEndTasks(tasks);
// Trace forward to find worst path
var maxTime = 0;
var worstPath = [];
var recurse = function(task, already... |
Markdown | UTF-8 | 51,752 | 3.421875 | 3 | [
"MIT"
] | permissive |
## black-bible
一些常用的Javascript工具函数,可以简化我们日常的很多操作
## Install
```
npm i black-bible -S
```
## Usage
在Node环境下:
```javascript
const _ = require('black-bible');
function f (a, b,c) {
return a + b + c;
}
_.curry(f, 1)(2)(3); // 6
```
使用ES6模块:
```javascript
import _ from 'black-bible';
function f (a, b,c) {
... |
Python | UTF-8 | 4,733 | 3.03125 | 3 | [
"MIT"
] | permissive | '''
Creates the client GUI and processes the requests
'''
import tkinter
from tkinter.scrolledtext import ScrolledText
class Spacer(tkinter.Label): # pylint: disable=too-many-ancestors
'''
Loads a blank space by putting a label in
'''
def __init__(self, root):
'''
Loads the blank spa... |
PHP | UTF-8 | 2,946 | 2.78125 | 3 | [] | no_license | <?php
if (!defined('__ROOT__')) {
define('__ROOT__', dirname(__FILE__, 2));
}
require_once(__ROOT__ . '/Models/Usuario.php');
require_once(__ROOT__ . '/Services/UsuarioService.php');
if (session_id() == '') {
session_start();
}
if (isset($_POST["metodoUsuario"])) {
$controller = new UsuarioController();... |
Markdown | UTF-8 | 1,985 | 3.40625 | 3 | [
"MIT"
] | permissive | # map.setPadding()
Set map paddings. The same as the padding property of CSS.
```typescript
map.setPadding(top, right, bottom, left)
```
## Parameters
name | type | description
------------|---------|---------------------------------------
top | number | padding of top in pixels
right | num... |
C# | UTF-8 | 1,450 | 2.5625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
namespace ExceptionBreaker.Options.ImprovedComponentModel {
public class ImprovedTypeDescriptor : CustomTypeDescriptor {
public ImprovedTypeDescriptor(ICustomTypeDescriptor parent) : base(parent) {
}
pub... |
Java | UTF-8 | 498 | 1.664063 | 2 | [] | no_license | package com.zarate.event.resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.zarate.event.service.ViaAemiliaService;... |
Shell | UTF-8 | 169 | 2.90625 | 3 | [] | no_license | #!/usr/bin/env bash
chars=('_' '.' '+') ; for ((i=0; i<1000; i+=$(($RANDOM%10)))); do printf "%$((RANDOM%$(($(tput cols)/2))))s\n" ${chars[RANDOM%${#chars[@]}]} ; done
|
TypeScript | UTF-8 | 10,388 | 2.703125 | 3 | [] | no_license | /**
* Is actually resource-utilities
*/
import * as PathfindingUtilities from "../utilities/Pathfinding";
import {RoomLevel} from "../enums/roomlevel";
import * as RoomRepository from "../repository/Room";
import * as IntelLib from "../lib/intel";
export function getTiersRequiredForPioneerMining(tier: number, p... |
Java | UTF-8 | 3,350 | 2.109375 | 2 | [] | no_license | package org.bigjava.test;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.PackageConf... |
Markdown | UTF-8 | 6,378 | 2.65625 | 3 | [] | no_license | # Distribuidos-Parcial2
# Balanceador de cargas
Balanceador de cargas automatizado
Daniel Steven Ocampo
A00053980
https://github.com/DanielOcampo23/Distribuidos-Parcial2
# Objetivos
-Realizar de forma autónoma el aprovisionamiento automático de infraestructura
-Diagnosticar y ejecutar de forma autónoma las acci... |
Java | UTF-8 | 1,024 | 3.265625 | 3 | [
"Unlicense"
] | permissive | public class IfStatement {
public static void main(String[] args) {
boolean isBluetoothEnable = false;
int fileSend = 0;
if (isBluetoothEnable){
System.out.println("Sending the file");
fileSend++;
}else if (fileSend == 0){
System.out.println("N... |
Java | UTF-8 | 3,197 | 1.984375 | 2 | [] | no_license |
package com.olukoye.hannah.bakingapp.UserInterface;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.La... |
Java | UTF-8 | 1,021 | 2.15625 | 2 | [] | no_license | package com.xyl.mmall.itemcenter.dao.category;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.xyl.mmall.framework.dao.PolicyObjectDaoSqlBaseOfAutowired;
import com.xyl.mmall.itemcenter.intf.DaoInitialInterface;
import com.xyl.mmall.... |
JavaScript | UTF-8 | 558 | 2.546875 | 3 | [] | no_license | const PubSub = require('../helpers/pub_sub.js');
const DetailView = require('./details_view.js');
const ListView = function (element) {
this.element = element;
}
ListView.prototype.bindEvents = function () {
PubSub.subscribe('Munros:region-ready', (event) => {
this.data = event.detail;
this.element.inner... |
Java | UTF-8 | 918 | 2.765625 | 3 | [] | no_license | package com.cloudfly.algorithm.juc.thread;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
public class Test_3_ScheduledThreadPoolExecutor {
public static void main(String[] args) {
ScheduledExecutorServi... |
Markdown | UTF-8 | 2,852 | 2.640625 | 3 | [
"MIT"
] | permissive | ---
layout: post-light-feature
title: "Rads and Camping"
description: "Last Friday I completed 15 daily sessions of Radiotherapy, and then went camping for the weekend."
category: articles
tags: [doctors, therapy, drugs]
comments: true
---
The actual treatment itself wasn't too bad, especially once I got on top of the... |
Shell | UTF-8 | 953 | 2.90625 | 3 | [] | no_license | # Maintainer: Anatol Pomozov <anatol@google.com>
pkgname=google-coredumper
pkgver=1.2.1
pkgrel=1
pkgdesc='Library can be compiled into applications to create core dumps of the running program -- without terminating.'
url='https://code.google.com/p/google-coredumper/'
license=(GPL)
arch=(i686 x86_64)
# Upstream is curre... |
PHP | UTF-8 | 1,547 | 3.203125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Contains the Reflection meta class.
*
* @author Lukas Rezek <lukas@miratronix.com>
* @license MIT
* @filesource
* @version GIT: $Id$
*/
namespace LRezek\Arachnid\Meta;
/**
* Deals with converting english property names to real ones through singularization.
*
* @package Arachnid
* @subpackage Met... |
C# | UTF-8 | 1,607 | 2.671875 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Animation3D : MonoBehaviour
{
private Animator anim;
GameObject thePlayer;
[SerializeField] float theDist;
[SerializeField] string boolForPlay;
bool playIsHappening = false;
AudioSource mySound;
... |
Python | UTF-8 | 642 | 3.71875 | 4 | [] | no_license | # Polymorphism
# an object can take on many from
# 1 the same class method works in a similiar way for different classes
# using method overriding by having a method in base or parent class that is overridden by a subclass
# each subclass will have a different implementation of the method
class Animal:
def speak(sel... |
JavaScript | UTF-8 | 306 | 2.546875 | 3 | [] | no_license | // server.js
const http = require("http");
const quotes= require('./quotes');
const onRequest= (request, response) => {
response.writeHead(200, { "Content-Type": "text/plain" });
response.write(`${quotes.randomQuote().quote}`);
response.end();
}
http.createServer(onRequest).listen(3000); |
Java | UTF-8 | 760 | 2.234375 | 2 | [] | no_license | package com.rjsoft.uums.api.controller.vo.dict;
import com.rjsoft.common.vo.BaseVO;
import com.rjsoft.uums.facade.dict.entity.UmsDictionaryType;
public class DictTypeForSelectVO implements BaseVO {
private String id;
private String name;
@Override
public void convertPOToVO(Object poObj) {
if(poObj != n... |
Java | UTF-8 | 1,949 | 2.171875 | 2 | [] | no_license | package com.zibowh.config;
import com.zibowh.constants.AppConstants;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@ConfigurationProperties(prefix = "spring.redis")
@Component
public class Redis... |
Python | UTF-8 | 4,565 | 2.703125 | 3 | [
"MIT"
] | permissive | import os
import yaml
def multiqc_config(self):
"""Make sure basic multiQC plugins are installed and plots are exported
Basic template:
.. code-block:: yaml
report_comment: >
This report has been generated by the <a href="https://github.com/nf-core/quantms" target="_blank">nf-core/qu... |
Java | UTF-8 | 2,554 | 2.328125 | 2 | [] | no_license | package br.com.pismo.transactions.config;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.FieldError;
import org... |
C++ | UTF-8 | 773 | 2.53125 | 3 | [
"MIT"
] | permissive | #pragma once
#include "LogSink.h"
#include "LogMessage.h"
#include <vector>
namespace dode
{
class Logger
{
public:
void AddSink(LogSink _Sink);
void RemoveAllSinks();
inline LogMessage CreateMessage(LogLevel _Level, std::string _File, uint32 _Line)
{
return L... |
C | UTF-8 | 161 | 2.859375 | 3 | [] | no_license | #include<stdio.h>
int incr(int i)
{
static int count=0;
count=count+i;
return (count);
}
int main()
{
int i,j;
for(i=0;i<=4;i++)
j=incr(i);
}
|
C++ | UTF-8 | 2,575 | 3.453125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <utility>
#include <vector>
#include <math.h>
#define MOD 1000000007
using namespace std;
int cache[101];
/*
비 대칭 타일링: https://algospot.com/judge/problem/read/ASYMTILING
이 문제는 비 대칭인 타일들의 개수를 구하는 문제이다.
다시 생... |
Java | UTF-8 | 552 | 2.015625 | 2 | [] | no_license | package com.bms.order.services;
import org.springframework.transaction.annotation.Transactional;
import com.bms.order.archive.impl.Operator;
import com.bms.order.bean.param.ORDR0901IBean;
/**
* 买手退货单创建接口Service
*
* @author li_huiqian
*/
public interface ORDR0901IService {
/**
* 接收买手退货信息,创建买手退货订单
*
... |
Java | UTF-8 | 603 | 2.109375 | 2 | [] | no_license | package com.ericsson.dto.request;
public class LinkProfileRequestDTO {
private String requesterDeviceId;
private String userName;
public String getRequesterDeviceId() {
return requesterDeviceId;
}
public void setRequesterDeviceId(String requesterDeviceId) {
this.requesterDeviceId = requesterDeviceId;
}... |
Java | UTF-8 | 670 | 2.71875 | 3 | [] | no_license | package cz.sam.cubix.util;
public class MathHelper {
public static int ceiling_double_int(double d) {
int i = (int)d;
return d > (double)i ? i + 1 : i;
}
public static long floor_double_long(double par0) {
long i = (long)par0;
return par0 < (double)i ? i - 1L : i;
}
public stati... |
Python | UTF-8 | 2,765 | 2.546875 | 3 | [] | no_license | import json
from selenium import webdriver as wd
import requests
from bs4 import BeautifulSoup
import time
def get_tag(code):
url = 'https://www.youtube.com/'+code
driver = wd.Chrome(executable_path='chromedriver.exe')
driver.get(url)
time.sleep(2)
html = driver.page_source
driver.quit()
... |
Java | UTF-8 | 485 | 2.828125 | 3 | [] | no_license | package SerializationEx;
public class Employee {
private String name;
private String dept;
private String title;
public Employee(String name, String dept, String title) {
super();
this.name = name;
this.dept = dept;
this.title = title;
}
public String toString() {
return name+":"+dept+":"+title;
... |
Go | UTF-8 | 242 | 2.703125 | 3 | [] | no_license | package main
import (
"fmt"
"github.com/acharyab15/test-with-go/math"
)
func main() {
sum := math.Sum([]int{10, -2, 3})
if sum != 11 {
msg := fmt.Sprintf("FAIL: Wanted 11 but received %d", sum)
panic(msg)
}
fmt.Println("PASS")
}
|
C++ | UTF-8 | 9,614 | 2.609375 | 3 | [] | no_license | #define D1c 0
#define D1d 1
#define D1e 2
#define D1g 3
#define D1f 4
#define D1b 5
#define D1a 6
#define D2f 7
#define D2b 8
#define D2a 9
#define D2c 10
#define D2g 11
#define D2d 12
#define D2e 13
int COUNT = 0;//count integer for 0-9 increment
int COUNT2 = 1;//count integer for 0-9 increment
void setup(){
for (... |
Python | UTF-8 | 2,071 | 2.78125 | 3 | [] | no_license | import re
import arrow
from reddit_api import reddit_api
import datetime
from datetime import timedelta
import time
from .cleaner.banned_words import banned_words
from .cleaner.clean_word import clean_word
from .cleaner.remove_space import remove_space
from app import session
from app.models import *
subs = ['bitcoi... |
Ruby | UTF-8 | 1,012 | 2.671875 | 3 | [] | no_license | require 'rbcoremidi.bundle'
module CoreMIDI
module API
MidiPacket = Struct.new(:timestamp, :data)
end
# Unused, but left here for documentation
def self.number_of_sources
API.get_num_sources
end
class Packet
attr_accessor :type, :note, :volume
def initialize(api_packet)
self.type ... |
Java | UTF-8 | 651 | 2.28125 | 2 | [] | no_license | package com.waldo.inventory.gui.dialogs.editprojectdialog;
import com.waldo.inventory.classes.dbclasses.ProjectObject;
public class ProjectObjectPreview {
private final ProjectObject projectObject;
private boolean addToProject;
public ProjectObjectPreview(ProjectObject projectObject) {
this.proj... |
C | UTF-8 | 273 | 3.28125 | 3 | [] | no_license | #include <stdio.h>
void main(){
float n1,n2,media;
for(int x = 1;x<=10;x++){
scanf("%f %f",&n1,&n2);
media = (n1+n2)/2;
if(media >= 7){
printf("Passou direto!");
}else{
printf("Nao passou direto!");
}
printf("Media Final: %.2f",media);
}
return;
} |
Python | UTF-8 | 491 | 2.890625 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 25 15:24:50 2019
@author: alexrandall
"""
import pyautogui, time
time.sleep(5)
pyautogui.click()
distance = 100
while distance > 0:
pyautogui.dragRel(distance, 0, duration = 0.001)
distance = distance - 5
pyautogui.drag... |
Java | UTF-8 | 588 | 3.578125 | 4 | [] | no_license | package designPatterns.State;
/**
* @author wql
* @desc PeacefulState
* @date 2021/5/31
* @lastUpdateUser wql
* @lastUpdateDesc
* @lastUpdateTime 2021/5/31
*/
public class PeacefulState implements State {
private final Mammoth mammoth;
public PeacefulState(Mammoth mammoth) {
this.mammoth = mam... |
Python | UTF-8 | 5,179 | 2.90625 | 3 | [] | no_license | #!/usr/bin/python
#-*-coding:utf-8-*-
import urlparse
import requests
import time
class domainRecorder():
'''
用来记录域名,判断子域名的可用性,
记录在同一个域名下的路径
记录子域名的个数
'''
def __time(self):
return time.strftime("%H:%M:%S",time.localtime(time.time()))
... |
Markdown | UTF-8 | 1,014 | 2.71875 | 3 | [] | no_license | # Frontend Mentor - Order summary card solution
This is a solution to the [Order summary card challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/order-summary-component-QlPmajDUj). Frontend Mentor challenges help you improve your coding skills by building realistic projects.
## Table of contents
... |
Java | UTF-8 | 3,553 | 2.109375 | 2 | [
"MIT"
] | permissive | package ee.tuleva.onboarding.mandate.content.thymeleaf;
import ee.tuleva.onboarding.epis.contact.ContactDetails;
import ee.tuleva.onboarding.fund.Fund;
import ee.tuleva.onboarding.mandate.FundTransferExchange;
import ee.tuleva.onboarding.mandate.Mandate;
import ee.tuleva.onboarding.mandate.application.ApplicationType;... |
Markdown | UTF-8 | 5,587 | 2.625 | 3 | [] | no_license |
# Getting Started
Learn the essentials of iOS app development by building a fully functional app using SwiftUI.
Before you start the course, take a few minutes to familiarize yourself with the background requirements, key concepts behind SwiftUI, and the app that you’ll build.
<!---->
5 min Estimated Time
<!---->... |
Python | UTF-8 | 3,164 | 2.640625 | 3 | [] | no_license | #!/usr/bin/env python3
# coding: utf-8
# File: chatBot.py
# Author: lhy<lhy_in_blcu@126.com,https://huangyong.github.io>
# Date: 19-3-29
import urllib.request
from urllib.parse import quote_plus
from lxml import etree
import json
class ZhidaoChatbot:
def __init__(self):
return
'''获取搜索页'''
def get... |
C++ | UTF-8 | 574 | 2.6875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin >> n >> k;
int arr[n];
for(int i=0;i<n;i++){
cin >> arr[i];
}
sort(arr,arr+n);
int ans = arr[n-1] - arr[0];
int small = arr[0] + k;
int big = arr[n-1] - k;
if(small > big){
swap(small,big);
}
for(int i=1;i<n-1;i++)... |
JavaScript | UTF-8 | 1,266 | 2.5625 | 3 | [] | no_license | /* eslint-disable */
import createElement from "../../../js/Utils/createElement";
import Helpers from "../../../js/Utils/Helpers";
export function MainInit() {
const main = createElement("div", "main-container");
document.body.prepend(main);
}
function createParsedUrl(request) {
return (
(request.... |
Python | UTF-8 | 1,806 | 3.5 | 4 | [] | no_license | class Coffee_Machine_Handler:
def __init__(self, coffee_machine):
self.coffee_machine = coffee_machine
def check_resources(self, coffee):
issues = []
if self.coffee_machine.water < coffee.water:
issues.append("Not Enough Water")
if self.coffee_machine.milk < coffee.m... |
JavaScript | UTF-8 | 1,249 | 4.125 | 4 | [] | no_license | //Esercizi-3 js
//write a funciton that randomizes two numbers and prints the smallest number that is greater than one,
//such that both numbers are divided by it with no remainder.
//For instance, for 9 and 6 you should print 3. If there isn't one a proper note should be printed
//************************ GENERAZIO... |
Go | UTF-8 | 3,145 | 3.046875 | 3 | [] | no_license | package wet
import (
"os"
"compress/gzip"
"bufio"
"regexp"
"strconv"
"strings"
)
type WETEntry struct {
Version string
Headers map[string]string
Body []byte
}
type WETReader struct {
reader *bufio.Reader
gzip *gzip.Reader
header *WETEntry
}
/**
* Builds a new WETRea... |
Markdown | UTF-8 | 630 | 3.015625 | 3 | [
"Vim"
] | permissive | # vim-hugo
Blogging from the command line should not be tedious.
This script is intended to automate the process of creating
[Hugo](https://gohugo.io/) blog posts from within
[vim](http://www.vim.org/).
This is a complete rewrite of
[parkr/vim-jekyll](https://github.com/parkr/vim-jekyll)
## Commands
The `:HugoPost... |
JavaScript | UTF-8 | 1,316 | 2.84375 | 3 | [] | no_license | function button_handler() {
let elem = document.getElementById("textarea");
let currentSize = getComputedStyle(elem, null).fontSize
let intCurrentSize = parseInt(currentSize);
elem.style.fontSize = (intCurrentSize + 2) + "pt";
}
function button_click() {
setInterval(button_handler, 500);
}... |
Shell | UTF-8 | 1,711 | 3.859375 | 4 | [] | no_license | #!/usr/bin/env bash
echo "Member leave/join script triggered" >> /var/log/serf.log
BACKEND_UNREGISTERED=false
# We iterate over stdin
while read -a values; do
# We extract the hostname, the ip, the role of each line and the tags
HOSTNAME=${values[0]}
HOSTIP=${values[1]}
HOSTROLE=${values[2]}
HOSTTAGS=${val... |
Java | UTF-8 | 3,527 | 2.671875 | 3 | [] | no_license | public class mainHtmlPrint
{
String htmlOneTestServ = "<html>\n"+"<head>\n"+"<title>\n"+"Das Schwarze Hahnchen\n"+"</title>\n"+"<style>\n"+
"\n"+"td{\n"+"font-style: italic;\n"+"position: relative;\n"+"text-align: center;\n"+"}\n"+"\n"
+"body {\n"+"background-color: #93B874;\n"... |
C++ | UTF-8 | 3,019 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include "datamanipulation.h"
template <class INPUT, class OUTPUT>
void Convert_2(const std::string & s_input, const std::string & s_output)
{
std::vector<INPUT > vec_in = read_vector<INPUT>(s_input);
std::vector<OUTPUT> vec_out;
for (const auto& elem : vec_in)
vec_out.push_b... |
Python | UTF-8 | 4,158 | 3.03125 | 3 | [
"BSD-3-Clause"
] | permissive | """Tests for the Frank-Wolfe algorithm."""
import numpy as np
import pytest
from scipy import optimize
import copt as cp
np.random.seed(0)
n_samples, n_features = 20, 16
A = np.random.randn(n_samples, n_features)
w = np.random.randn(n_features)
b = A.dot(w) + np.random.randn(n_samples)
# we will use a logistic loss, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.