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
JavaScript
UTF-8
2,611
2.609375
3
[]
no_license
function goto () { this.closest('form').style.display = 'none' ; document.querySelector(this.getAttribute('href')).style.display = ''; } function submitForm(evt) { evt.stopPropagation(); evt.preventDefault(); let els = this.querySelectorAll('input, select, textarea') ; let datas = {} ; for (var i in els)...
Java
UTF-8
10,282
2.140625
2
[]
no_license
package my.aws.java.sandbox.application.aws.iam; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.AWSCredentialsProvider; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.regions.Regions; import com.amazonaws.services.identitymanagement.AmazonIdentityManagement; import co...
Java
UTF-8
2,628
1.945313
2
[]
no_license
package com.ryj.yuyue.bean; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; /** * 查询用户评分 * @author Thor * */ public class ScoreResult { private Integer id; private Integer uId; private String uName; private Integer claId; private String classKName; pr...
Rust
UTF-8
2,303
2.796875
3
[ "MIT" ]
permissive
// Backup configuration structs // // Copyright (c) 2016 by William R. Fraser // use std::collections::btree_map::{BTreeMap, Entry, IterMut}; #[derive(Debug)] pub struct Backup { pub filename_base: String, pub volume: String, pub start_snapshot: Option<String>, pub end_snapshot: Option<Str...
Python
UTF-8
911
2.53125
3
[]
no_license
from flask import Flask,render_template,request, make_response, redirect, url_for app = Flask(__name__) @app.route('/') def user_login(): return render_template('login.html') @app.route('/set', methods = ['POST','GET']) def set_user_cookie(): if request.method == 'POST': username = request.form['use...
Java
UTF-8
3,581
2.109375
2
[]
no_license
package com.google.android.gms.measurement.internal; import android.os.Parcel; import android.os.Parcelable.Creator; import com.google.android.gms.common.internal.Preconditions; import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable; import com.google.android.gms.common.internal.safeparcel.Saf...
Java
UTF-8
11,234
3.359375
3
[]
no_license
package controller.inventory; import controller.itemsAndPuzzle.Weapon; import controller.itemsAndPuzzle.Armor; import controller.itemsAndPuzzle.Elixir; import view.View; /** * author: JJ Lindsay * version: 2.0 * Course: ITEC 3860 Fall 2014 * Written: 11/16/2014 * * This class represents an inventory. * * Purp...
Java
UTF-8
1,061
2.03125
2
[]
no_license
package com.talend.components.source.details; import java.io.Serializable; import com.talend.components.source.TCompStore; import org.talend.sdk.component.api.configuration.Option; import org.talend.sdk.component.api.configuration.type.DataSet; import org.talend.sdk.component.api.configuration.ui.layout.GridLayout; i...
JavaScript
UTF-8
1,307
2.65625
3
[]
no_license
const fs = require('fs'); const path = require('path'); // 模拟浏览器向网站发送请求 const superagent = require("superagent"); // 服务器端的 jQuery,相当于 html中的 jQuery const cheerio = require("cheerio"); // 1.爬取的请求地址:丁香园 const url = 'https://ncov.dxy.cn/ncovh5/view/pneumonia'; superagent.get(url) .then(res => { // console.log(res.t...
Ruby
UTF-8
1,981
2.796875
3
[]
no_license
require('minitest/autorun') require('minitest/reporters') require_relative('../sport_team.rb') Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new() class TestTeam < Minitest::Test def test_team_name new_team = Team.new("The Wildcats", ["Ross", "Bob", "Jess", "Lucy"], "Arnold Palmer") ...
JavaScript
UTF-8
2,670
3.359375
3
[]
no_license
document.addEventListener('DOMContentLoaded', () => { }) const BASEURL = `http://localhost:3000/dogs/`; //get all the dogs function getDogs(){ debugger return fetch(BASEURL) .then(resp => resp.json()) } //edit a dog function updateDog (dog) { return fetch(BASEURL + `/${dog.id}`, { method: 'PAT...
C#
UTF-8
207
2.796875
3
[]
no_license
WorkOrder w = new WorkOrder(); Type t = typeof(WorkOrder); foreach (XmlNode xl in myXML) { PropertyInfo pi = t.GetProperty(xl.Name); pi.SetValue(w, xl.InnerText, null); }
Python
UTF-8
24,501
2.5625
3
[]
no_license
# Import generic packages import time import configparser # Import multi-threading capacity from multiprocessing import Queue from threading import Thread, Event # Import GUI packages import tkinter as tk import tkinter.font as tkFont import tkinter.ttk as ttk font_collection = {} class gui_manager(Thread): ...
PHP
UTF-8
1,348
2.515625
3
[ "MIT" ]
permissive
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class AddUnderlyingDisease extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('patient', function(Blueprint $table) { $table->boolean('ards'); $table-...
C#
UTF-8
2,913
2.78125
3
[]
no_license
using System.Collections; using System.Collections.Generic; using UnityEngine; public class WeaponModel { public int Id { get; set; }//武器编号 public string Name { get; set; }//武器名字 public WeaponType Type { get; set; }//武器类型 public string Description { get; set; } public int Atk { get; set; }//武器攻击力...
Rust
UTF-8
559
2.8125
3
[]
no_license
extern crate num; use self::num::bigint::{ToBigInt, BigInt}; use self::num::One; fn dig_sum(n: BigInt) -> u64 { n.to_string().into_bytes().iter().fold(0, |acc, &x| acc + (x - 48) as u64) } pub fn go() -> String { let mut max = 0u64; for a in 95..100 { let mut q = BigInt::one(); let p = a....
Java
UTF-8
1,637
2.40625
2
[]
no_license
package com.res.sqlite; import android.content.Context; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; import static android.database.sqlite.SQLiteDatabase.CursorFactory; /** * Class Descriptio...
Python
UTF-8
46,255
3
3
[]
no_license
# -*- coding: utf-8 -*- # ============================================================================== # implementations.py # ------------------------------------------------------------------------------ # authors: Patrick Ley, Joel Fischer # date: 10.10.201...
Java
UTF-8
1,082
2.515625
3
[]
no_license
package VirtualFileSystem; import junit.framework.Assert; import org.junit.Test; /** * Created with IntelliJ IDEA. * User: Serv * Date: 01.07.13 * Time: 14:27 * To change this template use File | Settings | File Templates. */ public class FileTest { @Test public void createFile () { ...
Java
GB18030
812
3.09375
3
[]
no_license
package com.xms.javase.day12.p; import java.util.Random; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.FutureTask; public class Thread2 { public static void main(String[] args) throws InterruptedException, ExecutionException { Test t=new ...
JavaScript
UTF-8
6,872
2.5625
3
[]
no_license
import React, {useState} from 'react'; const ContactForm = ({ displayContactForm }) => { const [companyEmail, setCompanyEmail] = useState(""); const [typeOfOrg, setTypeOfOrg] = useState(""); const [orgLocation, setOrgLocation] = useState(""); const [error, setError] = useState({}); const [success...
Java
UTF-8
273
1.976563
2
[]
no_license
package one; public class NimingTest { public static void main(String[] args){ Thread th=new Thread(){ @Override public void run() { System.out.println("匿名类"); } }; th.start(); } }
Python
UTF-8
4,507
3
3
[ "MIT" ]
permissive
""" Example code for reproducing some of the results from the accompanying paper. For a particular RGG ensemble we pick a set of parameters. We then draw some samples from the algebraic connectivity distriution and: 1) display the mean and Coefficient of Variation. 2) Plot a histogram (see figure 4). """ #Stand...
C#
UTF-8
5,759
3.328125
3
[]
no_license
using System; using System.Collections.Generic; namespace textGame { class Program { static int width = 100; static int height = 50; static int count = 5; static string search = "Hospital"; static List<CrossPoint> points = new List<CrossPoint>(); static List<Ro...
PHP
UTF-8
4,199
2.703125
3
[]
no_license
<?php require_once '../../connection.php'; require_once '../../function.php'; require_once '../backend.php'; require_once 'header_login.php'; if (isset($_POST['daftar'])) { $pdo->beginTransaction(); try { $username = $userData['username']; $fullname = $userData['full_name']; $usia =...
Python
UTF-8
1,465
2.625
3
[ "AFL-3.0" ]
permissive
from flask import Flask,render_template,request,redirect,session app = Flask(__name__) # 一个Flask类的对象 app.secret_key = 'u2jksidjflsduwerjl' app.debug = True USER_DICT = { '1': {'name':'志军','age':18}, '2': {'name':'大伟','age':48}, '3': {'name':'梅凯','age':38}, } @app.route('/login',methods=['GET',"POST"]) def...
Markdown
UTF-8
1,886
2.8125
3
[]
no_license
# Sollevamento e trasporto Il tuo punteggio di forza determina la quantità di peso che puoi sopportare. I seguenti termini definiscono ciò che puoi sollevare o trasportare. ### Capacità di carico. La tua capacità di carico massimo è il tuo punteggio di Forza moltiplicato per 15. Questo è il peso (in libbre) che puo...
Python
UTF-8
81
3.8125
4
[]
no_license
a = int(input('enter A: ')) b = int(input('Enter B: ')) print('Sum is: ', a + b)
Java
UTF-8
972
2.234375
2
[]
no_license
package com.example.kailashsaravanan.projectfalconofficial; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import androidx.annotation.Nullable; import android.widget.ImageView; import com.squareup.picasso.Picasso; public class DisplayImageActivity extends Activity{ private ...
Markdown
UTF-8
4,190
3.53125
4
[]
no_license
--- title: 二级索引与联合索引 date: 2020-06-15 categories: mysql --- > 上周在公司内部分享了关于索引的一些相关概念,在会议最后,有两位同事想我提出了若干问题,这里就单独抽出来聊一聊 > 原问题:二级高效还是联合高效,还是根据场景来定? 谈到索引,主要分几大类,**聚簇索引**、**二级索引**、**联合索引**,先回顾一下这三种索引对应的概念 ### 聚簇索引 聚簇索引就是以主键值作为索引而建立的一颗 b+ 树,子节点包含**记录完整的数据**,举例说明 ``` - 创建表 issues CREATE TABLE `issues`( `id` INT UNSIGNED ...
Java
UTF-8
719
2.109375
2
[]
no_license
package cn.app.smartbook; import android.os.Bundle; import android.app.Activity; import android.content.Intent; import android.view.Menu; import android.view.View; public class LoginActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); se...
JavaScript
UTF-8
4,605
3.046875
3
[ "MIT" ]
permissive
import {getRandomIntInclusive} from "./_utilities"; if (document.getElementById("services")) { (function () { // cards variables const cards = document.querySelectorAll(".services-intro__card"); const numberOfCards = cards.length; // carousel variables const carousel = docu...
Markdown
UTF-8
1,566
2.8125
3
[ "MIT" ]
permissive
#### Travis CI: [![Build Status](https://travis-ci.com/CkCreative/fff.svg?branch=dev)](https://travis-ci.com/CkCreative/fff) Better Code: [![BCH compliance](https://bettercodehub.com/edge/badge/CkCreative/fff?branch=release)](https://bettercodehub.com/) Coveralls: [![Coverage Status](https://coveralls.io/repos/github/C...
Python
UTF-8
2,793
3.8125
4
[]
no_license
''' 188. 买卖股票的最佳时机 IV 给定一个整数数组 prices ,它的第 i 个元素 prices[i] 是一支给定的股票在第 i 天的价格。 设计一个算法来计算你所能获取的最大利润。你最多可以完成 k 笔交易。 注意:你不能同时参与多笔交易(你必须在再次购买前出售掉之前的股票)。 示例 1: 输入:k = 2, prices = [2,4,1] 输出:2 解释:在第 1 天 (股票价格 = 2) 的时候买入,在第 2 天 (股票价格 = 4) 的时候卖出,这笔交易所能获得利润 = 4-2 = 2 。 示例 2: 输入:k = 2, prices = [3,2,6,5,0,3] 输出:7 解释:在第 2 天 ...
C#
UTF-8
1,897
3.265625
3
[]
no_license
using System; using System.Windows.Forms; namespace snake_program { public abstract class Enemy { // true if snake can eat the enemy public bool CanEat(ContinuousSnake snake) { double unitsLength = (double)snake.Length / BodyPart.SIZE;// get the snake length in body part si...
Swift
UTF-8
727
2.90625
3
[]
no_license
// // ContentView.swift // SwiftUINavStackRadar // // Created by Simon Rice on 22/12/2019. // Copyright © 2019 Simon Rice. All rights reserved. // import SwiftUI struct MasterView: View { private var items: [String] { (1 ... 100).map { "Item \($0)" } } var body: some View { Navigation...
Java
ISO-8859-1
673
1.898438
2
[]
no_license
package com.example.curso05072012_2; import android.app.Activity; import android.app.NotificationManager; import android.content.Context; import android.os.Bundle; import android.widget.TextView; public class Notificacao extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { ...
Python
UTF-8
994
3
3
[]
no_license
# coding=utf-8 ''' Created on 2016年5月9日 @author: 李健博 程序作用: 从bigFile中删除smallFile中出现的行 ''' from __future__ import division from __future__ import unicode_literals import sys reload(sys) sys.setdefaultencoding('utf-8') # @UndefinedVariable bigFile="minus_4.txt" smallFile="1.txt" newFile="minus_5.txt" lis_write=[] with...
Shell
UTF-8
1,207
3.21875
3
[]
no_license
#!/bin/bash # Rackspace Cloud Queues / Openstack Zaqar Service # Usage: cq [METHOD] [ENDPOINT] [BODY] # # This service is compatible with Rackspace Cloud Queues and the Openstack # Zaqar REST API. More information about the API can be found here: # # https://developer.rackspace.com/docs/cloud-queues/v1/developer-g...
Markdown
UTF-8
1,367
2.546875
3
[ "BSD-3-Clause" ]
permissive
This started out as example code for odd decoding of utf-8 in java vs jni This is because of: http://banachowski.com/deprogramming/2012/02/working-around-jni-utf-8-strings/ It now also contains code that will help generate code for shclepping things between jni and java. Mostly to work around the UTF-8 issue of string...
Java
UTF-8
3,226
1.75
2
[]
no_license
package com.multipz.kc.Model; /** * Created by Admin on 26-09-2017. */ public class GetStaffAsPerTypeModel { private String attendance_id, user_id, date, amount, name, work_type_id, mobile, profile_img, proof_img, password, user_type, salary, salary_based_type, created_date, modified_date, is_status, is_delete,...
JavaScript
UTF-8
3,999
2.6875
3
[]
no_license
//クッキーの取得 function GetCookies2(response){ var headers = response.getAllHeaders(); var cookies = []; if ( typeof headers['Set-Cookie'] !== 'undefined' ) { // Set-Cookieヘッダーが2つ以上の場合はheaders['Set-Cookie']の中身は配列 var cookies = typeof headers['Set-Cookie'] == 'string' ? [ headers['Set-Cookie'] ] : heade...
Python
UTF-8
1,486
2.9375
3
[]
no_license
import tensorflow as tf from tensorflow.keras import layers def conv2d_bn(x, filters, filter_shape, padding='valid', strides=(1, 1), data_format='channels_first', name=None): """Utility function to apply conv + BN. # Arguments...
C++
UTF-8
3,926
3.1875
3
[]
no_license
/******************************************************************************* * @File : 097_interleaving_string.cpp * @Author: Zhang Zixuan * @Email : zixuan.zhang.victor@gmail.com * @Blog : www.noathinker.com * @Date : 2016年03月21日 星期一 21时10分01秒 *********************************************************...
Shell
UTF-8
298
2.640625
3
[]
no_license
#!/bin/bash source fs-setup.sh ./mkfs_lvm.sh ./mountfs_lvm.sh mkdir -p /mnt/temp start=`fdisk -l /vm/guest0.img | tail -n 1 | awk '{print $3}'` mount -o loop,offset=$(($start * 512)) /vm/guest0.img /mnt/temp pushd /mnt/vm cp -a /mnt/temp/* . popd ./unmountfs_lvm.sh ./reinstall-grub.sh
JavaScript
UTF-8
807
2.78125
3
[]
no_license
import React from 'react'; class ClockTimer extends React.Component { constructor (props) { super(props) this.state={count: 0} this.tick = this.tick.bind(this) this.state={value: this.props.value} } componentDidMount (){ this.interval = setInterval(this.tick, 1000) } tic...
Java
UTF-8
885
3.5625
4
[]
no_license
package practice; import java.util.Scanner; public class PrimeNo { public static void main(String[] args) { //String str1; // Scanner in = new Scanner(System.in); System.out.println("Enter your String"); //str1 = in.nextLine(); int a = Integer.parseInt(new Scanner(System.in...
Python
UTF-8
1,896
2.765625
3
[]
no_license
import logging import time, sys import socket import threading, queue import hashlib from jim.convert import json_to_bytes, bytes_to_json logger = logging.getLogger('root') send_queue = queue.Queue() class Client(): username = '' def __init__(self, host, port): self._host = host self._port ...
Java
UTF-8
5,620
2.515625
3
[]
no_license
package DAO; import DAOInterfaces.AdresDAO; import DAOInterfaces.OVChipkaartDAO; import DAOInterfaces.ReizigerDAO; import Domein.Reiziger; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; public ...
Java
UTF-8
2,811
2.0625
2
[]
no_license
package com.beisheng.synews.fragment; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.v4.app.F...
Java
UTF-8
408
1.757813
2
[]
no_license
package spring.service; import java.util.List; import spring.beans.Teachers; public interface ITeachersService { Teachers findTeacherByNumber(String tnumber); void delTeacherById(int id); List<Teachers> findTeachers(int collId); void addOrupdateTeacher(Teachers teacher); int countPhone(String tphone); Te...
Python
UTF-8
1,133
2.515625
3
[ "MIT" ]
permissive
import mongoengine from demo2.model.base_model import BaseModel class Article(BaseModel, mongoengine.Document): title = mongoengine.StringField(required=True, default='') added = mongoengine.DateTimeField(required=True, default='') url = mongoengine.StringField(required=True, unique=True, default='') ...
Swift
UTF-8
2,247
3.25
3
[]
no_license
// // CalcOperations.swift // Calculator // // Created by SHIVAM SHAH on 27/09/17. // Copyright © 2017 Centennial College. All rights reserved. // /* import Foundation class CalcOperations { private var accumulator: Double = 0.0 func setOperand (operand: Double) {...
JavaScript
UTF-8
590
2.546875
3
[]
no_license
import React from "react"; import { Select } from "../components/Select"; export default class MultipleSelect extends React.Component { state = { value: this.props.value, }; onChooseItem = (items) => { const value = items.join(", ").slice(0, 20); this.setState({ value: value === items.join(", ...
Markdown
UTF-8
1,830
3.765625
4
[ "MIT" ]
permissive
--- layout: leetcode date: 2016-07-15 title: Intersection of Two Linked Lists tags: [Linked List] --- * Contents {:toc #toc_of_keans_blog} ## Question Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: <pre> A: ...
Java
UHC
3,296
3.0625
3
[]
no_license
package SwingMember2; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Iterator; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; public class MemberDelete { MemberMgmUI main; //Field JPan...
Shell
UTF-8
5,951
3.84375
4
[ "Apache-2.0" ]
permissive
#!/bin/bash -x die() { if [[ "$1" = "" ]] ; then echo "Exiting program due to error." else echo $1 fi exit 1 } function usage() { echo "upgrader v0.3" echo "" echo "upgrader.sh OPTIONS DASHBOARD_NAME" echo "" echo "Valid options:" echo " -b --dashboardname The dashboard...
Markdown
UTF-8
5,875
3.4375
3
[]
no_license
# Java基础系列10: 回调机制 本文是作者的读书笔记和心得整理,部分内容来源于网络,如有侵权,请联系作者。 ## 几种调用机制 ### 同步调用 同步调用是最基本并且最简单的一种调用方式,类A的方法a()调用类B的方法b(),一直等待b()方法执行完毕,a()方法继续往下走。这种调用方式适用于方法b()执行时间不长的情况,因为b()方法执行时间一长或者直接阻塞的话,a()方法的余下代码是无法执行下去的,这样会造成整个流程的阻塞 ### 异步调用 类A的方法a()通过新建立一个线程的方式调用类B的方法b(),代码继续往后执行. 这种方法不确定什么时候能拿到b返回的结果,所以需要监听b ### 回调 回调的定义:A调用B执...
C++
UTF-8
894
3.140625
3
[]
no_license
#include <bitset> #include <iostream> #include <set> #include <vector> using namespace std; inline int odd(int x) { return bitset<12>(x).count() % 2; } int main() { int t; cin >> t; for (int case_num = 1; case_num <= t; ++case_num) { cout << "Case #" << case_num << ": "; int n, q; cin >> n >> q; ...
JavaScript
UTF-8
5,442
3.453125
3
[]
no_license
// 利用scheduler 调度器来控制副作用函数的执行时机和方式、 // 用全局变量存储被注册的副作用函数 let activeEffect const effectStack = [] const bucket = new WeakMap() const data = {foo: 1, bar: 2} const obj = new Proxy(data, { get(target, key) { track(target, key) return target[key] }, set(target, key, newVal) { target[key] = newVal t...
Python
UTF-8
1,415
3.125
3
[]
no_license
#!/usr/bin/env python # encoding: utf-8 # A sample for turnstile state # for python 2.7 to python 3.4 state_table = { "locked":{ "coin":{ "next_state": "unlocked", "output": "Release turnstile so customer can push through" }, "push":{ ...
Java
UTF-8
228
1.640625
2
[]
no_license
package com.liujia.config; import lombok.Data; /** * @author ex_111806190 * @since 2020-9-21 16:35 */ @Data public class ConfigBean { private String id; public ConfigBean(String id) { this.id = id; } }
PHP
UTF-8
2,348
2.609375
3
[ "MIT" ]
permissive
<?php declare(strict_types=1); namespace Imatic\Bundle\ViewBundle\Templating\Helper\Html; use Imatic\Bundle\ViewBundle\Templating\Utils\StringUtil; class HtmlElement { protected static $emptyElements = ['img' => 1, 'hr' => 1, 'br' => 1, 'input' => 1, 'meta' => 1, 'area' => 1, 'embed' => 1, 'keygen' => 1, ...
Java
UTF-8
744
2.5625
3
[]
no_license
package org.mkab.chatapp.model; public class Information { private String title; private String type; private String fileName; public Information(String title, String type, String fileName) { super(); this.title = title; this.type = type; this.fileName = fileName; ...
Java
UTF-8
1,222
2.234375
2
[]
no_license
package com.caitou.bean; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; @Table(name="t_dyndata") public class DynData { @Id @GeneratedValue(generator="JDBC") private Integer id; private String url; private String title; private Integer d...
Markdown
UTF-8
1,222
2.921875
3
[ "Apache-2.0", "CC-BY-4.0" ]
permissive
# Using DVC Commands DVC is a command line tool. Here we provide the specifications, complete descriptions, and comprehensive usage examples for `dvc` commands. For a list of commands, type `dvc -h`. 💡 To execute any DVC command in a different directory, use `dvc --cd <path> ...` before the actual command and it's o...
C#
UTF-8
591
2.75
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BankDemo { // een abstracte class vind ik hier handiger want Deposit()/Withdraw() zijn hetzelfde bij de // subclasses // testbaarheid: unittests => interfaces komen hier ook veel terug p...
C#
UTF-8
563
4
4
[]
no_license
//Write a program to convert binary numbers to hexadecimal numbers (directly). using System; class BinaryToHexadecimal { static void Main(string[] args) { Console.Write("Numbers: "); int numbers = int.Parse(Console.ReadLine()); for (int i = 0; i < numbers; i++) { ...
Markdown
UTF-8
4,496
3.578125
4
[ "MIT", "CC-BY-4.0" ]
permissive
# createComponent A HoC ([Higher-order Component](https://medium.com/@dan_abramov/mixins-are-dead-long-live-higher-order-components-94a0d2f9e750#.njbld18x8)) that creates a presentational React component using the rendered `rule` as className. It automatically composes rules and passed props for nested Fela component...
Python
UTF-8
1,047
3.625
4
[]
no_license
# Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def upsideDownBinaryTree(self, root): """ :type root: TreeNode :rtype: TreeNode """ def fl...
Markdown
UTF-8
3,556
2.53125
3
[]
no_license
<p align="center"> <img src="https://github.com/0x25/piTurtle/blob/master/piturtle.png" alt="piTurtle"> </p> # piTurtle automatic open remote shell on an internal network with raspberryPI # need - stunnel - ssh - vps or server on internet - raspberry # subject Create a stunnel connection (ssl 443) to the a se...
Python
UTF-8
566
3
3
[]
no_license
import csv import json def csvToJson(file): out = [] with open(file) as f: reader = csv.DictReader(f) for row in reader: out.append(row) return out def writeToFile(data, filename): file = open(filename, "w") file.write(json.dumps(data)) file.close() def generateFro...
Python
UTF-8
341
3.5
4
[ "MIT" ]
permissive
class Accumulator: """Sum a list of numbers over time.""" def __init__(self, n): self.data = [0.0] * n def add(self, *args): self.data = [a+float(b) for a, b in zip(self.data, args)] def reset(self): self.data = [0.0] * len(self.data) def __getitem__(self, idx): r...
Python
UTF-8
2,699
3.765625
4
[]
no_license
import matplotlib.pyplot as plt #Para visualizacao dos dados e do erro import numpy as np #Biblioteca de manipulacao de arrays Numpy from matplotlib.colors import ListedColormap #Lista de cores para plotagens import pandas as pd ### Carregar iris dataset df = pd.read_csv("/home/davi/Área de Trabalho/workspace/logatti...
Python
UTF-8
216
3.25
3
[]
no_license
# This is practice using nested conditionals def binomial_coeff(n, k): return 1 if k == 0 return 0 if n == 0 res = binomial_coeff(n-1, k) + binomial_coeff(n-1, k-1) return res binomial_coeff(0, 1)
Java
UTF-8
4,328
2.015625
2
[]
no_license
package com.tw.controller; import com.tw.common.base.AppResultBuilder; import com.tw.common.base.ResponseObject; import com.tw.helper.Page; import com.tw.model.Goods; import com.tw.model.GoodsGallery; import com.tw.model.GoodsSku; import com.tw.model.GoodsSkuCompose; import com.tw.service.ApiAttributeService; import c...
C++
UTF-8
5,945
2.625
3
[]
no_license
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QMessageBox> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); ui->lineEdit->setText(""); ui->lineEdit_2->setText(""); ui->lineEdit_3->setText(""); ui->lineEdit->setVisible(true);...
C++
UTF-8
1,323
3.6875
4
[]
no_license
#include <iostream> #include <conio.h> #include <iomanip> #include <fstream> #include <new> using namespace std; int main() { //Local Variables for main int ArraySize = 0; int Total = 0; //Ask user how big the array is going to be cout << "How many numbers do you wish to enter? (Whole numbers onl...
C++
UTF-8
1,009
3.046875
3
[]
no_license
//nhap ma tran A mxn Bmxn tinh tong C=A+B #include<stdio.h> #include<conio.h> #include<stdlib.h> void nhap(int*a,int m,int n) { for(int i=0;i<m;i++) for(int j=0;j<n;j++) { printf("a[%d][%d]=",i,j); scanf("%d",(a+n*i+j)); } } void xuat(int*a,int m,int n) { printf("ma tran vua nhap la:\n"); for(...
C++
ISO-8859-1
1,133
2.765625
3
[]
no_license
#ifndef SCHACHBRETTANZEIGE_H #define SCHACHBRETTANZEIGE_H #include <vector> #include <QHBoxLayout> #include <QVBoxLayout> #include "Schachfeld.h" #include "Zug.h" using namespace std; /** Erzeugt das Schachbrett mit seinen 64 Schachfeldern und aktualisiert diese. @author Arne Maier */ class SchachbrettAnzei...
JavaScript
UTF-8
402
4.1875
4
[]
no_license
/*Write a script that shows the sign (+, - or 0) of the product of three real numbers, without calculating it. Use a sequence of if operators.*/ var a=-2; var b=-2; var c=1; var product=a*b*c; console.log('a='+a); console.log('b='+b); console.log('c='+c); console.log('product='+product); if(product>0){ console.log...
C++
UTF-8
4,482
3.21875
3
[]
no_license
#include <SFML/Graphics.hpp> #include <iostream> #include <string> using namespace sf; struct Cell { bool isAlive; int neighborCount; RectangleShape Rect; int Width; int Height; bool dirty; Cell(int size = 16) { Width = size; Height = size; std::cout << Width << " " << Height << std::endl; ...
C++
UTF-8
12,622
3.09375
3
[]
no_license
#include "bignumber.h" BigNumber::BigNumber(uint64_t base, std::string value) : base_(base) { if (value[0] == '-') { value = value.substr(1, value.length() - 1); sign_ = sign_flag::NEGATIVE; } else sign_ = sign_flag::POSITIVE; while (value.length() > static_cast<uint64_t>(log10(base))) { value_.pus...
Markdown
UTF-8
1,094
2.53125
3
[ "Apache-2.0" ]
permissive
# Analyzing Movie Reviews using LDA models. Pycones2018 Resources used for my talk at [*Pycon Spain 2018*](https://2018.es.pycon.org/talk/y-hoyque-vemos-analizando-reviews-de-peliculas-con-python) The main objective of the talk was to introduce the audience into the gensim library for Topic Modelling through a use ca...
Java
UTF-8
357
1.859375
2
[ "Apache-2.0" ]
permissive
package com.xfl.pingguopai.dao; import com.xfl.pingguopai.common.Mapper; import com.xfl.pingguopai.model.OrderTask; import com.xfl.pingguopai.model.User; import org.apache.ibatis.annotations.Select; public interface OrderTaskMapper extends Mapper<OrderTask> { @Select("select * from t_order_task where id=#{id}") ...
Ruby
UTF-8
3,646
3.265625
3
[]
no_license
module Planning # a class for complex conditions class Condition def eval context end end class ConditionVariable < Condition def initialize name @name=name end def eval context context[@name] end end class ConditionConst < Condition...
C++
UTF-8
3,441
2.890625
3
[]
no_license
// PrePolygon.hpp // // by Janice Richards, Mar 17, 2018 // //---------------------------------------- #ifndef PREPOLYGON_HPP_ #define PREPOLYGON_HPP_ #include <algorithm> // std::sort #include <string> #include <iostream> #include <vector> #include <map> #include <cstdio> #include <math.h> namespace GeoStar { ...
Java
UTF-8
2,571
3.21875
3
[]
no_license
package nl.tudelft.ti2206.group9.shop.soundtrack; import nl.tudelft.ti2206.group9.audio.SoundtrackPlayer; import nl.tudelft.ti2206.group9.shop.ShopItem; /** * The abstract shop item class for soundtracks, based on the * requirements from the ShopItem interface. * Besides, every soundtrack item has it's own Soundtr...
Java
UTF-8
1,703
3.171875
3
[]
no_license
package com.cfyj.design.pattern.template; import lombok.extern.slf4j.Slf4j; /** * * 维护动态线路信息模版方法设计模式: * 1.获取当前线路信息, * 2.解析线路信息--抽象,因为获取的渠道有多种 * 3.根据解析好的线路维护系统内部的动态线路表(当前站,下一站,当前行驶方向,当前时间) * 4.将动态行驶线路持久化 * * @author lius * */ @Slf4j public abstract class AbstractTemplateUpdateStationIn...
C
UTF-8
721
2.8125
3
[]
no_license
/** * @file * @author Mark Said Camilleri * @version 20170521. */ #include "network_server.h" #include "arena.h" pthread_mutex_t gameLockWhenPlayerAddedMutex = PTHREAD_MUTEX_INITIALIZER; void delay(unsigned int secs) { unsigned int retTime = time(NULL) + secs; // Get finishing time. while (time(NULL) <...
Java
UTF-8
734
3.484375
3
[]
no_license
/** * Write a description of class Player here. * * @author (your name) * @version (a version number or a date) */ public class Player { private String name; private int numberTaken; public Player(String name){ this.name = name; numberTaken = 0; } public boolea...
SQL
UTF-8
5,720
2.890625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Apr 11, 2021 at 09:20 PM -- Server version: 10.4.17-MariaDB -- PHP Version: 8.0.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIEN...
Java
UTF-8
1,724
2.359375
2
[]
no_license
package com.coolbook.erp.repository.specs; import com.coolbook.erp.entity.PettyCashEntity; import org.springframework.data.jpa.domain.Specification; import javax.persistence.Tuple; import javax.persistence.criteria.*; import java.text.ParseException; import java.util.Date; public class PettyCashSearchSpecification e...
PHP
ISO-8859-1
466
3.4375
3
[]
no_license
<?php /** * Lanza una excepcin por defecto */ $miLado = -3; function areaCuadrado($lado){ if ($lado < 0){ // Lanzamos una excepcin throw new Exception ('Debes insertar un nmero positivo'); } return $lado * $lado; } try { areaCuadrado($miLado); } catch (Exception $e) { print 'Ha ...
Java
UTF-8
2,671
2.15625
2
[]
no_license
/* * Copyright 2010, 2011 Institut Pasteur. * * This file is part of ICY. * * ICY is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any l...
Shell
UTF-8
1,397
4.21875
4
[]
no_license
#!/bin/bash # Script to create a MySQL image with a phpMyAdmin image # Usage function usage() { echo "Usage: $0 image_name mysql_password path_to_data host_mysql_port host_admin_port" exit 1 } if [ $# -lt 5 ] ; then usage exit 1 fi if [[ "$OSTYPE" == "darwin"* ]]; then command -v greadlink >/dev/...
C#
UTF-8
511
2.5625
3
[]
no_license
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Spawner : MonoBehaviour { int RandX; int RandY; public GameObject ball; void Start () { Spawn (); } void Update () { if(Input.GetMouseButtonDown(0) ) { Spawn(); } } void CreateRandomPosition() { Ran...
Python
UTF-8
380
3.3125
3
[]
no_license
def main(): while True: # Keep prompting for input untill valid try: height = int(input("Height: ")) if height > 0: break except ValueError: pass for space,star in zip(range(height-1,-1,-1), range(1,height+1)): print (" "*space+"#"...
SQL
UTF-8
42,200
3.65625
4
[]
no_license
/** * * SQL file for the Automotive Repair Shop for CECS 323 Term Project. * The tables in this file was constructed based on our class diagrams and relation schemes. * After creating our tables, we inserted fictional data that we created to help us generate * queries and views. * * Author: Abram Villanueva <a...
C#
UTF-8
624
3.015625
3
[]
no_license
using System; using Common; using System.IO; namespace Sender { class Program { static void Main(string[] args) { var pipe = PipeHelper.CreateClient(PipeNames.Sender); var writer = new StreamWriter(pipe); while (true) { Console...