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
Shell
UTF-8
2,587
2.515625
3
[]
no_license
#!/bin/sh echo "================================================================================" >> /home/kit/kit/uploads/snk/kitvm/log_rc-local.txt echo "================================================================================" >> /home/kit/kit/uploads/snk/kitvm/log_rc-local.txt echo "\n\n\t\t$0" >> /home...
C++
UTF-8
3,440
2.703125
3
[]
no_license
#define BOOST_TEST_MAIN #include <boost/test/included/unit_test.hpp> #include "../src/neuron/neuron.hpp" #include "../src/layers/layer.hpp" #include "../src/neuralNetwork/neuralNetwork.hpp" BOOST_AUTO_TEST_SUITE(testNeuralNetwork) BOOST_AUTO_TEST_CASE(testGetNeuronQuantity) { NeuralNetwork neuralNetwork({1,...
Java
UTF-8
2,432
2.296875
2
[]
no_license
package com.gzzhwl.rest.springmvc.annotation.support; import java.util.Map; import javax.servlet.ServletException; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.MethodParameter; import org.springframework.web.context.reques...
PHP
UTF-8
1,303
2.796875
3
[]
no_license
<?php namespace Models; class FriendRequestAcceptHandler { public static function getDB() { require ("Cread.php"); return new \PDO("mysql:dbname={$creden['database']};host={$creden['host']}" , $creden['username'] , $creden['password']); } public static function acceptFR($user1 , $user2) { ...
Python
UTF-8
1,913
3.125
3
[]
no_license
# Lane Detection in images using mouse click event """ Right click -- To see your ROI Left click -- To detect lanes """ import cv2 import numpy as np def click_event(event, x,y,flags,param): if event == cv2.EVENT_LBUTTONDOWN: img = cv2.imread('road.jpg') roi_ver = [(0, height), (x,...
Shell
UTF-8
3,088
2.71875
3
[]
no_license
#------------------# #--- Env Distns ---# #------------------# wd=~/projects/ms1/analysis/huj_eobs src=~/projects/ms1/src panelOut=figs/env_dist figOut=~/projects/ms1/docs/ms/submission_natcom/submission_3/v25/figs cd $wd #Generate distributions for environmental variables dat=~/projects/ms1/data/derived/obs_anno....
TypeScript
UTF-8
979
2.609375
3
[ "Apache-2.0" ]
permissive
/*! * Copyright 2021 Cognite AS */ import * as THREE from 'three'; import { vec3 } from 'gl-matrix'; import { Box3 } from './Box3'; export function toThreeVector3(out: THREE.Vector3, v: vec3): THREE.Vector3 { out.set(v[0], v[1], v[2]); return out; } function fromThreeVector3(out: vec3, m: THREE.Vector3): vec3 ...
PHP
UTF-8
742
2.6875
3
[]
no_license
<?php include("libs/LIB_parse.php"); # Include parse library include("libs/LIB_http.php"); # Include PHP/CURL library // Download the page $web_page = http_get($target="http://www.pals.gr", $referer=""); // Remove all JavaScript $noformat = remove($web_page['FILE'], "<script", "</script>"); // Strip out all HTML...
C
UTF-8
302
2.96875
3
[]
no_license
#include <ctype.h> #include <stdio.h> #include <stdlib.h> #include "libft.h" int main(int ac, char **av) { if (ac > 1) { printf("Num : %d (%c)\n", atoi(av[1]), (char)atoi(av[1])); printf("Libc : %d\n", isascii(atoi(av[1]))); printf("Out : %d\n", ft_isascii(atoi(av[1]))); } return (0); }
Python
UTF-8
566
2.546875
3
[]
no_license
from django import template from colour import Color register = template.Library() @register.filter(name='npc_kill_colour') def npc_kill_colour(value): colors = [ Color('white'), Color('#54C45E'), Color('#76A654'), Color('#98884A'), Color('#BA6B41'), Color('#DC4D37...
Shell
UTF-8
519
2.5625
3
[]
no_license
#!/bin/bash -eux # --disable-vmmraw: disable building 32-bit guest additions iso ./configure \ --target-arch=amd64 \ --target-cpu=k8 \ --with-linux="$(echo /lib/modules/*.x86_64/build/)" \ --disable-hardening \ --disable-java \ --disable-docs \ --disable-vmmraw source ./env.sh kmk all cd ./out/linux.amd64/rel...
JavaScript
UTF-8
1,298
3.046875
3
[]
no_license
var paragraphError; var inputs; function validateError(){ var comparationDays = (dateFinishValue>dateStartValue) if((dateStartValue == "")||(comparationDays == false)){ inputs = document.querySelector("#error-date-start"); addError(); paragraphError.textContent = "Data de início inválid...
C++
UTF-8
398
3.28125
3
[]
no_license
// // Created by carmen on 13/08/2015. // #include <iostream> int main() { bool a{true}; bool b{false}; std::cout << "Is 4 = 4 (true or false)?\n"; std::cin >> std::boolalpha >> a; std::cout << "Is 3 = 4 (true or false)?\n"; std:: cin >> std::noboolalpha >> b; std::cout << "a = " << std:...
C
UTF-8
2,034
3.046875
3
[]
no_license
/* ************************************************************************** */ /* */ /* :::::::: */ /* ft_strtrim.c :+: :+: ...
C++
UTF-8
1,258
3.328125
3
[]
no_license
/** * @file:NumberFileGenerator.h * @author: Tim Elvart * KUID: 2760606 * Email: telvart@ku.edu * @date:10.26.15 * @brief:A class that will create .txt files to be used in the creation of arrays */ #ifndef NUMBERFILEGENERATOR_H #define NUMBERFILEGENERATOR_H #include <string> #include <fstream> #include <chrono> #inclu...
PHP
UTF-8
1,313
2.984375
3
[]
no_license
<?php class UserListBuilder { protected $db; protected $usrObj; public function __construct($db, $usrObj) { $this->db = $db; $this->usrObj = $usrObj; } public function buildList() { $count = $this->getUserCount(); $array = $this->usrObj->getActiveUser(); $html = ''; for ($i = 0; $i < $count; $i++)...
Markdown
UTF-8
3,558
3.046875
3
[]
no_license
# testing MANUAL TESTING 1. Software testing is a process of evaluating a system by manual or automatic means and verify that it satisfies specified requirements or identify differences between expected and actual results. Need of software testing. • To check the reliability of software. • To check the so...
Java
UTF-8
1,317
2.484375
2
[]
no_license
/*- * Copyright © 2009 Diamond Light Source Ltd., Science and Technology * Facilities Council * * This file is part of GDA. * * GDA is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License version 3 as published by the Free * Software Foundation. * * GDA i...
PHP
UTF-8
414
2.625
3
[ "BSD-4-Clause-UC", "BSD-3-Clause", "LicenseRef-scancode-other-permissive", "TCL", "ISC", "Zlib", "LicenseRef-scancode-public-domain", "BSD-2-Clause", "blessing", "MIT" ]
permissive
--TEST-- Bug #41815 (Concurrent read/write fails when EOF is reached) --FILE-- <?php $filename = dirname(__FILE__)."/concur_rw.txt"; @unlink($filename); $writer = fopen($filename, "wt"); $reader = fopen($filename, "r"); fread($reader, 1); fwrite($writer, "foo"); if (strlen(fread($reader, 10)) > 0) { echo "OK\n"; } ...
Java
UTF-8
1,548
2.640625
3
[]
no_license
package com.example.demodddaccount.boundaries.account.application; import com.example.demodddaccount.boundaries.account.domain.*; public class AccountUseCase implements AccountService { final AccountRepository repository; public AccountUseCase(AccountRepository repository) { this.repository = repos...
Java
UTF-8
661
2.21875
2
[]
no_license
package com.qby.servlet; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; /** * 监听项目的启动 停止 * @author qby * @date 2020/6/16 11:01 */ public class UserListener implements ServletContextListener { // 监听 ServletContext 销毁 @Override public void contextInitialized(Serv...
SQL
UTF-8
346
3.296875
3
[]
no_license
drop database if exists network_chess; create database network_chess; use network_chess; CREATE USER `chess_user`@`localhost` IDENTIFIED BY 'chess_user'; GRANT ALL PRIVILEGES ON network_chess.* TO `chess_user`@`localhost` WITH GRANT OPTION; create table user_stat ( user_id varchar(100), wins int, losses int, ...
Java
UTF-8
769
3.71875
4
[]
no_license
package pattern.part4.chapter14.pattern; /** * Date: 2010-8-15 * Time: 12:27:49 */ public class InstitutionalInvestor implements StockBuyer { private String name; private float maxPrice; private float minPrice; public InstitutionalInvestor(String name, float maxPrice, float minPrice, Sto...
Markdown
UTF-8
1,016
2.828125
3
[ "MIT" ]
permissive
## MOSAD_HW0 #### 介绍 个人作业0-用于测试 #### 开发环境 xxxxxx #### DeadLine: x月x日 **xx** 点 #### 场景描述 xxxxxx #### 实现要求 - xxxxxx #### 提交要求及命名格式 - /src 存放项目文件 - /report 存放项目报告 ### 个人项目提交方式 1. 布置的个人项目先fork到个人仓库下; 2. clone自己仓库的个人项目到本地目录; 3. 在个人项目中,在src、report目录下,新建个人目录,目录名为“学号+姓名”,例如“**12345678WangXiaoMing**”; 4. 在“src\123456...
Markdown
UTF-8
4,495
2.765625
3
[]
no_license
--- author: name: elaptics body: "Hi All,\r\n\r\nI'm new here, and new to typography in general. Though I've been interested in design for several years, I'm much more of a developer than designer but after watching a documentary about Gutenberg I've been bitten by the typography bug.\r\n\r\nAs I'm still very m...
JavaScript
UTF-8
327
2.625
3
[]
no_license
function validate(){ var username = document.getElementById("username").value; var password = document.getElementById("password").value; if ( username == "Najoua" && password == "web123456") { alert ("Connexion Réussie"); // Redirecting to other page. return false; } else alert("Impossible de se connecter"); return fal...
Shell
UTF-8
2,167
3.515625
4
[ "MIT" ]
permissive
#/bin/bash ( SERVER=amd012.utah.cloudlab.us USER=$USER LOG=/tmp/_tas_exp_log.txt OUTDIR=/tmp/out/ if [ ! -d $OUTDIR ]; then mkdir $OUTDIR fi function run_local { (sudo ./run.py --client --cores 8 --duration 30) } function run_remote { ssh $USER@$SERVER << EOF sudo pkill --signal SIGINT run.py sleep 1 cd /proj...
PHP
UTF-8
467
2.578125
3
[]
no_license
<?php require_once 'IAwsHelper.php'; class Ec2Helper implements IAwsHelper { static public function list_names( $client ) { $results = $client->describeInstances(); $names = array(); foreach ( $results['Reservations'] AS $reservations ) { foreach ( $reservations['In...
Rust
UTF-8
5,373
2.859375
3
[ "MIT" ]
permissive
use std::collections::HashMap; use std::hash::BuildHasher; use std::io; use std::rc::Rc; use crate::builtins_util::*; use crate::environment::*; use crate::shell::*; use crate::types::*; fn builtin_str_trim(environment: &mut Environment, args: &[Expression]) -> io::Result<Expression> { if args.len() != 1 { ...
Markdown
UTF-8
2,799
2.5625
3
[ "Apache-2.0", "EPL-1.0", "BSD-3-Clause", "CPL-1.0", "LicenseRef-scancode-generic-export-compliance", "MPL-1.1", "Apache-1.1" ]
permissive
# Layout of the filebased repository ## Typical layout Typically, all TOSCA components have the path `componenttype/ns/id`. ## Directory `imports` This directory stores files belonging to a CSAR. That means, when a definitions points to an external reference, the file has to be stored at the external location and n...
PHP
UTF-8
1,189
2.546875
3
[]
no_license
<?php namespace app\models; use Yii; /** * This is the model class for table "areeSosta". * * @property integer $id * @property string $nomeArea * @property string $descrizione * @property string $comune * @property string $latitudine * @property string $longitudine */ class AreeSosta extends \yii\db\Active...
Java
UTF-8
893
2.953125
3
[]
no_license
public class Persona { private String nombre; private String apellido; private Domicilio casa; public Persona() { super(); casa = new Domicilio(); System.out.println("YA HAY UNA REFERENCIA A DOMICILIO"); } public Persona(String nombre, String apellido) { super(); this.nombre = nombre; this.apellido = apellido...
Java
UTF-8
233
1.609375
2
[]
no_license
package com.suhid.practice.repository; import com.suhid.practice.model.CourseModel; import org.springframework.data.jpa.repository.JpaRepository; public interface CourseRepository extends JpaRepository<CourseModel,Long> { }
Java
UTF-8
1,678
2.234375
2
[ "MIT" ]
permissive
package org.kidneyomics.fluidigm; import org.junit.Assert; import java.io.File; import java.net.URL; import org.apache.log4j.Logger; import org.junit.Test; public class TestMakeFile { Logger logger = Logger.getLogger(TestMakeFile.class); @Test public void testWriteCommands1() { URL templateDirectory = Cla...
C++
UTF-8
2,442
2.640625
3
[]
no_license
// // Created by serdok on 05/03/19. // #include "StartScreen.h" StartScreen::StartScreen( Castle* const castle, Translation* const trans ) : Texture( "Image Accueil.png", true ), _castle( castle ), _translation( trans) { _inputs = InputsManager::GetInstance(); _shopText = new Texture( "1 : " + _translation...
C++
UTF-8
17,842
2.96875
3
[]
no_license
#pragma once #include <vector> #include <fstream> //https://stackoverflow.com/a/217605 #include <algorithm> #include <functional> #include <Eigen/Geometry> #include <Eigen/StdVector> // //loguru #include <loguru.hpp> typedef std::vector<float> row_type_f; typedef std::vector<row_type_f> matrix_type_f; typedef st...
Python
UTF-8
1,385
2.703125
3
[]
no_license
import sys import os def readMap(): wrong_map = {} with open('wrong_map.txt', 'r') as f: for line in f: # print line wrong_index, index = map(int, line.split(' ')) # print wrong_index, index wrong_map[wrong_index] = index return wrong_map def getli...
PHP
UTF-8
2,224
2.515625
3
[]
no_license
<?php namespace App\Jobs; use App\Processors\PasswordProcessor; use Carbon\Carbon; use Cookie; use Exception; use Illuminate\{ Bus\Queueable, Contracts\Queue\ShouldQueue, Foundation\Bus\Dispatchable, Http\UploadedFile, Queue\InteractsWithQueue, Queue\SerializesModels}; class PasswordQueue imp...
C++
UTF-8
1,713
2.65625
3
[]
no_license
#include <iostream> #include <cstdio> #include <cstdlib> #include <string> #include <fstream> #include "common_inline.h" #include "chordDB.h" using namespace std; int interval = 1; int error(const string& msg); int main(){ string filenameChordDB = "chords2.csv"; string filenameTestChords = "to_test.txt";...
Java
UTF-8
1,281
2.015625
2
[]
no_license
package com.scheduleyoga.dao; import java.util.HashMap; import java.util.Map; public class StudioOld { static public final int STUDIO_ID_BABTISTE = 1; static public final int STUDIO_ID_KAIAYOGA = 2; static public final int STUDIO_ID_JOSCHI_NYC = 3; static public final int STUDIO_ID_JIVAMUKTIYOGA = 4; st...
TypeScript
UTF-8
25,465
2.578125
3
[ "MIT" ]
permissive
/** * TestReport Module */ import * as primitives from "@tangdrew/primitives"; import * as t from "io-ts"; import { Extension, ExtensionOutputType } from "./Extension"; import { Identifier, IdentifierOutputType } from "./Identifier"; import { Meta, MetaOutputType } from "./Meta"; import { Narrative, NarrativeOutputT...
Java
UTF-8
3,632
2.296875
2
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
/* * Copyright (c) 2019 Cerus * File created at 13.04.19 18:02 * Last modification: 13.04.19 18:02 * All rights reserved. */ package de.cerus.toastbot.tasks; import com.electronwill.nightconfig.core.file.CommentedFileConfig; import de.cerus.toastbot.event.VoteEventCaller; import de.cerus.toastbot.util.VoteUtil; ...
PHP
UTF-8
6,907
2.640625
3
[ "MIT" ]
permissive
<?php namespace Chadicus\Marvel\Api\Entities; use Chadicus\Marvel\Api\Client; use Chadicus\Marvel\Api\Assets\CharacterHandler; use GuzzleHttp\Client as GuzzleClient; /** * Unit tests for the Character class. * * @coversDefaultClass \Chadicus\Marvel\Api\Entities\Character * @covers ::<protected> */ final class Ch...
C++
UTF-8
776
3.140625
3
[]
no_license
/********************************************************************* ** Program name:Zoo Tycoon ** Author: Derek Yang ** Date:10/14/2017 ** Description:This is the reusable menu class. This creates a vector for the menu and allows the user to input as many menu options as they want. *********************************...
C
UTF-8
610
3.0625
3
[]
no_license
#include <stdio.h> #include <string.h> #define IMAP_QUOTAROOT_NONEXISTENT (2390157849L) int return_an_error(const char *s) { if (!strcmp(s, "foo")) return IMAP_QUOTAROOT_NONEXISTENT; return 0; } void check_an_error(const char *s) { int r; printf("check_an_error(%s)\n", s); r = retu...
Java
UTF-8
217
1.609375
2
[]
no_license
package Pages; import java.io.IOException; public class Test { public static void main(String[] args) throws IOException { LazadaHomePage homepage=new LazadaHomePage(); homepage.navigateToURL(); } }
Java
UTF-8
1,262
2.5
2
[ "BSD-2-Clause" ]
permissive
package org.notalgodemons.tokenservice.api; import com.twilio.Twilio; import com.twilio.base.ResourceSet; import com.twilio.rest.api.v2010.account.Message; import org.notalgodemons.tokenservice.wrappers.Course; import java.util.ArrayList; import java.util.List; public class Example { public static final String A...
PHP
UTF-8
806
2.59375
3
[]
no_license
<?php App::uses('AppModel', 'Model'); /** * Category Model * * @property Post $Post */ class Category extends AppModel { /** * Behaviours * * @var array */ public $actsAs = array('Containable'); /** * Validation rules * * @var array */ public $validate = array( 'name' => array( 'notEmpty' => array(...
C++
UTF-8
1,393
3.6875
4
[]
no_license
#include <iostream> #include <cmath> using namespace std; double Mean(double x[], int N); double StdDev(double x[], double mean, int N); void instrucciones(int&); void SoliData(double x[], int);//esta función guarda los datos en el arreglo x[] //el arreglo se pasa a la función como de costumbre //a...
JavaScript
UTF-8
3,091
2.796875
3
[]
no_license
const config = require('../config'); const {callFunctionCode} = require('../utils'); function generateRandomJsKeySelector(length = 6) { const charCodes = config.payloadVariablePrefix.split('').map(c => c.charCodeAt(0)).join(); const randomNumber = Math.random().toString().slice(-length); return `String.fro...
Java
UTF-8
2,370
2.75
3
[]
no_license
package ua.kpi.training.model.entity; /** * Created by Anya on 14.05.2017. */ public class Communications { /** * The {@link Communications#phoneNumberHome} field representing the number of member's home phone. */ private String phoneNumberHome; /** * The {@link Communications#phoneNumberM...
C
UTF-8
1,028
3.890625
4
[]
no_license
/* amountcalculator_extended.c a program that reads in three real inputs: an account balance, an annual interest rate expressed as percentage and the time of investment. then display the peroid, interest made and the new balance during that year. (we are looking may at compounded interest) */ #include...
Markdown
UTF-8
2,078
2.75
3
[]
no_license
![](https://steemitimages.com/0x0/https://steemitimages.com/0x0/https://steemitimages.com/0x0/https://steemitimages.com/DQmXuu2Skv5DF1W5ePrmQ9caKHKDyN6xC4XjddHqKcknbgy/Idiom%20of%20the%20day-min.png) 오늘의 Idiom은 <center><b> beat around the bush </b></center> <center><b> beat about the bush </b></center> 입니다. If you ...
Ruby
UTF-8
537
4.28125
4
[]
no_license
# unpacks ARGV and assigns it to three variables first, second, third = ARGV puts "Your first variable is #{first}" puts "Your second variable is #{second}" puts "Your third variable is #{third}" puts "Do something..." variable = $stdin.gets.chomp puts "Your variable is #{variable}" puts "Try this..." variable2 = g...
Markdown
UTF-8
710
2.828125
3
[]
no_license
# textoverflow - android ### Built With: - Phonegap ### Dependencies: - Cordova ### Synopsis Are you friends constantly on their phones at dinner? Use this app to get them off their phones by mass texting a series of photos of your choosing. ### Motivation I wanted to make my friends get off their phones at...
Python
UTF-8
3,100
2.515625
3
[]
no_license
import re from insn_type import InsnTypeInt, InsnType, InsnTypeChar, InsnTypeFloat, InsnTypeDouble REGS = [ # 8-bit general-purpose reg 'AL', 'BL', 'CL', 'DL', 'AH', 'BH', 'CH', 'DH', 'DIL', 'SIL', 'BPL', 'SPL', 'R8L', 'R9L', 'R10L', 'R11L', 'R12L', 'R13L', 'R14L', 'R15L', # 16-bit general-purpose...
Markdown
UTF-8
2,620
3.265625
3
[ "MIT" ]
permissive
# Delete objects {#concept_91924_zh .concept} This topic describes how to delete objects. **Warning:** Delete objects with caution because deleted objects cannot be recovered. For the complete code of deleting objects, see [GitHub](https://github.com/aliyun/aliyun-oss-csharp-sdk/blob/master/samples/Samples/DeleteObj...
C
UTF-8
960
2.6875
3
[]
no_license
#include<stdio.h> void typeline(int n,char *f) { FILE *fp; int c=0,cnt=0; char str[80]; fp=fopen(f,"r"); if(n>0) { printf("The line are:\n"); while(fgets(str,80,fp)) { printf("%s\n",str); c++; if(c==n) break; } } else if(n<0) { while(fgets(str,80,fp)) { c++; } fclose(fp); ...
PHP
UTF-8
564
2.671875
3
[]
no_license
<?php include 'archivo.class.php'; /** * */ class Imagen extends Archivo { public function imagenImprimir($ruta,$title,$tipos) { if($tipos==1) { $tipos='img-rounded'; } else if($tipos==2) { $tipos='img-circle'; } else if($tipos==3) { $tipos='img-thumbnail'; } $this->...
C++
UTF-8
9,019
2.546875
3
[]
no_license
//================================================================================================= // // Bx Engine // bxs3514 @ 2016 - 2018 // // All code licensed under the MIT license // //================================================================================================ #if BX_OPENGL #include "Op...
JavaScript
UTF-8
855
3.046875
3
[]
no_license
var Box = Newton.createClass({ getInitialState: function(){ return {visible: true}; }, render: function(){ return $('div', {className: 'box'}); } }); var Circle = Newton.createClass({ getInitialState: function(){ return {visible: true}; }, render: function(){ return $('div', {classN...
Java
UTF-8
419
2.828125
3
[]
no_license
package entities; public class StateModel { private double reward = 0.000; private boolean isWall = false; public StateModel(double reward) { this.reward = reward; } public double getReward() { return reward; } public void setReward(double reward) { this.reward = reward; } public boolean getIsWa...
JavaScript
UTF-8
796
2.953125
3
[]
no_license
const WORLD = { /* largura escolhida para ser bem maior que a tela */ width: 2400, height: 506, backgroundColor: "#0a79f1", gravity : Vector2D(0, .005), xOffSet: 0, yOffSet: 0, inside: [], }; WORLD.update = function() { for (let element of this.inside) { OPERATIONS.update[el...
C#
UTF-8
1,553
3.078125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Caching; using System.Text; using System.Threading.Tasks; namespace Kapsch.Core.Caching { public class MemoryCache<T> : ICache<T> where T : class { private string _name; public MemoryCache(string name) ...
C#
UTF-8
1,512
2.890625
3
[ "MIT" ]
permissive
using ExchangeRateResolver.Models; using System; using System.Collections.Generic; using System.Text; namespace ExchangeRateResolver.Parsers { public class PriceUpdaterParser : IParser { private PriceUpdate _data; public PriceUpdaterParser() { } public obj...
C#
UTF-8
929
3.46875
3
[]
no_license
using System; using System.Linq; namespace AdventLibrary.Day2 { public class DifferenceGridChecksumCalculator { public int CalculateFor(string input) { var accumulated = 0; var lines = input.Split(new []{'\n','\r'}, StringSplitOptions.RemoveEmptyEntries); f...
SQL
UTF-8
1,313
2.96875
3
[]
no_license
CREATE TABLE ITEM ( ID VARCHAR(3) PRIMARY KEY, NAME VARCHAR(40) NOT NULL, PRICE DECIMAL(8,2) NOT NULL, DESCRIPTION VARCHAR(255), IMAGE VARCHAR(40) ); CREATE TABLE T_USER ( ID VARCHAR(50) PRIMARY KEY, PASSWORD VARCHAR(255) NOT NULL ); CREATE ...
JavaScript
UTF-8
858
3.546875
4
[]
no_license
function removeDuplicates(arr) { var len = arr.length var unique = [], position = [], str = [] // Finding the position of duplicates in the array for(var i = 0; i < len; i++){ str[i] = arr[i] for(var j = i + 1; j < len; j++){ if(str[i] == arr[j]){ position.pus...
C#
UTF-8
704
2.609375
3
[ "MIT" ]
permissive
 namespace PopFree.Pop3 { /// <summary> /// Possible responses received from the server when performing an Authentication /// </summary> public enum AuthenticationResponse { /// <summary> /// Authentication succeeded /// </summary> Success = 0, //...
Markdown
UTF-8
628
2.75
3
[]
no_license
The project consists of three files: my-cat.c, my-sed.c, and my-uniq.c. All files function indepently. my.cat reads a file as specified by the user and prints its contents. ex. ./my-cat filename my.sed will only be used to find and replace it with the exact given string. It will find the first instance of a string ...
Python
UTF-8
1,384
2.796875
3
[]
no_license
from urllib.request import urlopen from bs4 import BeautifulSoup import csv import json def crawl(url): html = urlopen(url) soup = BeautifulSoup(html, "html.parser") body = soup.select('#bodyContent') return(body[0].text) crawl('https://en.wikipedia.org/wiki/Norberto_Alonso') if __name__ == '__main_...
Python
UTF-8
4,011
3.15625
3
[]
no_license
import random import time run = 32 def merge(arr, l, m, r): # print (l, " ",m," " ,r) n1 = m - l + 1 n2 = r - m # create temp arrays L = [0] * (n1) R = [0] * (n2) # Copy data to temp arrays L[] and R[] for i in range(0 , n1): L[i] = arr[l + i] for j in range(0 , n2...
JavaScript
UTF-8
550
4.59375
5
[]
no_license
/* Given two numbers, say x and y, write a program that determines if the numbers are either between the range of 0-20 or 80-100 , which includes the edges of the limit: 0, 20, 80, and 100. withinLimits(10, 99) // => true withinLimits(21, 81) // => false */ let withinLimits = (a, b) => { let r1 = 0, r2 = 20; ...
C++
UTF-8
4,331
3.09375
3
[]
no_license
#include "Add.hpp" #include "Cpu.hpp" #include "MemoryController.hpp" unsigned short PerformAdd8(Cpu* cpu, unsigned char lh, unsigned char rh, bool addCarry) { unsigned short result = lh + rh; if (addCarry) { if (cpu->TestFlag(cpu::Flag::Carry)) { result++; } } if ((rh & 0xF) + (lh & 0xF) > 0x...
JavaScript
UTF-8
3,903
2.578125
3
[ "MIT" ]
permissive
App.Views.Punkt = Backbone.View.extend({ initialize: function(){ //this.model.on("change", this.render, this); }, tagName: 'li', render: function(){ this.$el.html( this.model.get('rejimRab')+ '<br>'+ this.model.get('phone')+ '<br>' + this.model.get('addr')+ '<br>'+this.model.get('name')); return this; } })...
Python
UTF-8
3,147
2.5625
3
[]
no_license
# -*- coding: UTF-8 -*- import gtk import os from widgets import ComboFunciones, MatrizLeds class Window: FRECUENCIA = 0.3 ON_OFF_BTN_ON = 'Parar' ON_OFF_BTN_OFF = 'Continuar' def __init__(self, mods_horizontales, mods_verticales): self.build_glade_ui() self.init_matriz_leds(int(mod...
Java
UTF-8
1,555
2.984375
3
[]
no_license
package com.homeWork; public class Phone { String name; String model; int year; String os; void security() { System.out.println(name + " " + model + " have more security."); } void lesssecurity() { System.out.println(name + " " + model + " have less security."); } void camera() { System.out.p...
Markdown
UTF-8
825
3.71875
4
[]
no_license
#List of problems: - Problem 1 - Problem 2 - Problem 4 #Problem 1 Complexity rotate() function: - Line {3} use Array.prototype.reverse, that will take O(n) complexity - Line {2} has a loop with O(n-1) complexity - Line {1} also has a loop with O(n-1) complexity - Line {4} is a recursion considered as...
Java
UTF-8
1,425
3.359375
3
[]
no_license
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedHashMap; import java.util.regex.Matcher; import java.util.regex.Pattern; public class P07_PhoneNumber { public static void main(String[] args) throws IOException, IOException { BufferedReade...
Java
UTF-8
737
1.703125
2
[]
no_license
package com.google.android.gms.internal.measurement; import android.os.RemoteException; /* renamed from: com.google.android.gms.internal.measurement.e reason: case insensitive filesystem */ final class C0349e extends a { /* renamed from: e reason: collision with root package name */ private final /* syntheti...
JavaScript
UTF-8
609
2.515625
3
[]
no_license
import React, { Component } from 'react'; import './App.css'; class OptionSelecter extends Component { render() { const { options } = this.props.options; const optionsList = options.map(option => { return ( <option value={option.value}>{option.txt}</option> )...
Java
UTF-8
3,211
2.3125
2
[]
no_license
package com.micro.android316.housekeeping.adapter; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; import com.micro.android316.housekeeping.C...
C++
WINDOWS-1258
1,425
3.859375
4
[]
no_license
/*Given an index k, return the kth row of the Pascals triangle. Pascals triangle : To generate A[C] in row R, sum up A[C] and A[C-1] from previous row R - 1. NOTE : k is 0 based. k = 0, corresponds to the row [1]. Note:Could you optimize your algorithm to use only O(k) extra space? Example: Input : k = 3 Ans: [1,3,3,1...
Java
UTF-8
4,547
2.125
2
[ "Apache-2.0" ]
permissive
package org.noear.water.dso; import org.noear.snack.ONode; import org.noear.water.WW; import org.noear.water.WaterAddress; import org.noear.water.WaterClient; import org.noear.water.WaterSetting; import org.noear.water.log.Level; import org.noear.water.log.LogEvent; import org.noear.water.utils.*; import java.util.Ha...
Markdown
UTF-8
4,452
2.765625
3
[ "DOC" ]
permissive
# Maya Reference Edit Router Documentation The Maya USD plugin supports hosting a Maya reference inside the USD scene. This Maya reference can be edited as Maya data and then cached as USD prims. The caching process supports customization of its behaviour, even a full replacement of its logic through an `edit router`....
C++
UTF-8
445
3.171875
3
[]
no_license
/* 题目:尾部的零 容易 题目大意: 给定一个n,求n!的尾部的0有多少个 解题思路: 直接算 遇到的问题: 老问题,没有问题 */ class Solution { public: // param n : description of n // return: description of return long long trailingZeros(long long n) { long long ans = 0; while (n > 0) { n /= 5; ans += n; } ...
PHP
UTF-8
4,084
2.84375
3
[]
no_license
<?php /** * Created by PhpStorm. * User: Ice * Date: 06.03.2017 * Time: 3:20. */ namespace App\Model; use App\Engine\Model; /** * Class Comment. */ class Comment extends Model { /** * @param array $posts * * @return array */ public function getComments(array $posts) { $...
Java
UTF-8
5,181
2.078125
2
[]
no_license
/* * Conditions Of Use * * This software was developed by employees of the National Institute of * Standards and Technology (NIST), an agency of the Federal Government. * Pursuant to title 15 Untied States Code Section 105, works of NIST * employees are not subject to copyright protection in the United States * and are...
Markdown
UTF-8
2,748
3.71875
4
[ "MIT" ]
permissive
### [Maximum Score from Performing Multiplication Operations](https://leetcode.com/problems/maximum-score-from-performing-multiplication-operations) <p>You are given two <strong>0-indexed</strong> integer arrays <code>nums</code> and <code>multipliers</code><strong> </strong>of size <code>n</code> and <code>m</code> r...
C++
UTF-8
7,233
3.515625
4
[]
no_license
#include "matrix.h" /**< ****************************************************/ /**< C-tors & D-tors */ Matrix::Matrix(const Matrix& matr) { *this = matr; } Matrix::Matrix(size_t rows, size_t cols) { //ctor this->matr = std::vector<std::vector<double>>(rows, std::vector<double>(cols)); } Matrix::Matrix(d...
JavaScript
UTF-8
1,209
3.359375
3
[]
no_license
//songs array var songs = []; songs[songs.length] = "Legs > by Z*ZTop on the album Eliminator"; songs[songs.length] = "The Logical Song > by Supertr@amp on the album Breakfast in America"; songs[songs.length] = "Another Brick in the Wall > by Pink Floyd on the album The Wall"; songs[songs.length] = "Welco(me to the ...
Python
UTF-8
647
3.0625
3
[]
no_license
## ## FractalImaging.py ## Apply fractal to image ## Michael Menz ## from numpy import array, sin, cos, zeros, absolute, amax, isnan, pi from scipy.misc import imread, imsave from PIL import Image im_path = '/Users/menz/Desktop/Screenshots/waldos.png' image_array = imread(im_path, 1) real = sin(image_array/255 * pi...
Shell
UTF-8
5,323
4.15625
4
[]
no_license
#!/usr/bin/env bash set -eu -o pipefail : <<DESC Validate the format of a commit message DESC : <<HELP One can specify the git config value ${c_value}hooks.format.long-line-regex${c_reset} to provide a regex for lines to be omitted from the message body line-length check. HELP # Get our useful functions (be sure to ...
Swift
UTF-8
1,858
2.546875
3
[]
no_license
// // PageVC.swift // OverPowered // // Created by Bright Future on 22/07/2017. // Copyright © 2017 Bright Future. All rights reserved. // import UIKit class PageVC: UIPageViewController, UIPageViewControllerDataSource { var viewModel: ConversationViewModel! lazy var viewControllersToAdd: [UIVie...
Python
UTF-8
2,184
3.390625
3
[]
no_license
# Package: model.game # Description: structure of board # Artificial Intelligence, II Semester 2018 # Project: Connect 4 # Author : Jonathan Martinez C. # E-mail: jonathan.gerad@hotmail.com # Version: 0.0.0 # IMPORT SECTION import argparse from model.game.agent import Agent from model.game.human import Human from mod...
Markdown
UTF-8
282
2.9375
3
[]
no_license
#### PYTHON EXERCISES #### - [Coma Code](lists/comma_code.py): given a list, returns a string with all items separated by ', ' and ' and ' before the last item. > Example: 'me, myself, irene' returns 'me, myself and irene' - [Tic-Tac-Toe](dict/tic-tactoe.py): Tic-Tac-Toe game
Java
UTF-8
144
1.6875
2
[]
no_license
package aqa.core.lesson10.lpylypenko; public class InvalidAgeException extends RuntimeException { public InvalidAgeException () { } }
Python
UTF-8
793
2.921875
3
[]
no_license
from typing import Dict from pydantic import BaseModel class UsuarioInDB(BaseModel): nombre: str # usuarioInDB.nombre = "diego" mejorpuntaje: int ultimopuntaje: int database_usuarios = Dict[str, UsuarioInDB] # {"nombre": "diego", } database_usuarios = {"Diego": UsuarioInDB(**{"nombre":"Diego", ...
C++
UTF-8
737
2.96875
3
[]
no_license
// Source: https://leetcode.com/problems/find-and-replace-in-string/ // Author: Miao Zhang // Date: 2021-03-16 class Solution { public: string findReplaceString(string S, vector<int>& indexes, vector<string>& sources, vector<string>& targets) { vector<pair<int, int>> idx; for (int i = 0; i < inde...
Java
UTF-8
3,247
2.890625
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 shoppinginthesupermarket; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import shoppinginthe...