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
Python
UTF-8
281
3.734375
4
[]
no_license
import turtle ws = turtle.Screen() geekyTurtle = turtle.Turtle() t = turtle.Turtle() for i in range(6): geekyTurtle.forward(90) geekyTurtle.left(300) t.right(95) t.forward(75) r = 50 t.circle(r) t.left(55) t.forward(15) s= 50 for _ in range(4): t.forward(s) t.left(90)
Shell
UTF-8
811
2.75
3
[]
no_license
#!/bin/bash echo "-- Preparing WWW files --" [[ -e html ]] && rm -r html mkdir -p html/img mkdir -p html/js mkdir -p html/css # Join scripts DD=html_orig/jssrc cat $DD/chibi.js \ $DD/utils.js \ $DD/modal.js \ $DD/appcommon.js \ $DD/term.js \ $DD/wifi.js > html/js/app.js sass --sourcemap=none html_orig/sass/app...
Rust
UTF-8
7,338
3.109375
3
[ "MIT" ]
permissive
//! Physical page allocator. use crate::addr::*; use crate::arch::PAGE_SIZE; use crate::error::*; use core::mem::{size_of, MaybeUninit}; use core::ops::{Deref, DerefMut}; use core::ptr::NonNull; use core::sync::atomic::{AtomicU64, Ordering}; use spin::Mutex; use core::convert::TryFrom; /// This number is chosen to en...
Markdown
UTF-8
634
2.890625
3
[]
no_license
# FizzBuzz-TDD iOS app of FizzBuzz game built in TDD The aim of the game is to count up as high as you can, starting at 0. - If the next number is a multiple of 3, tap the “Fizz” button. - If the next number is a multiple of 5, tap the “Buzz” button. - If the next number is a multiple of 3 AND 5, tap the “FizzBuzz” bu...
Python
UTF-8
1,378
2.5625
3
[]
no_license
import rospy from geometry_msgs.msg import Twist, Point, Quaternion #import tf #from math import math,radians, copysign, sqrt, pow, pi, atan2 #from tf.transformations import euler_from_quaternion #import numpy as np import sys import time import math class Run(): def __init__(self): prog_start_time = time....
PHP
UTF-8
675
3.1875
3
[]
no_license
<?php namespace Report\Model; class DimensionsModel implements DimensionsModelInterface { protected $dimensionsList = []; protected $allowed = [ 'dateFrom', 'dateTo', ]; /** * add * * @param string $name * @throws \InvalidArgumentException */ public func...
C++
UTF-8
1,114
2.625
3
[]
no_license
#ifndef _CAPP_H_ #define _CAPP_H_ #include "CEvent.h" #include "CMenu.h" #include "CCore.h" class CApp : public CEvent { private: bool Running; bool Paused; SDL_Window* Win_Display; // Main Window SDL_Renderer* Win_Renderer; // Main Renderer SDL_Texture* Win_Texture; // Canvas Texture publi...
Python
UTF-8
941
2.640625
3
[ "MIT" ]
permissive
import shutil import skflow from sklearn import datasets, metrics, cross_validation iris = datasets.load_iris() X_train, X_test, y_train, y_test = cross_validation.train_test_split(iris.data, iris.target, train_size=0.2, random_state=42) classifier = skflow.TensorFlowDNNClassifier(hidden_units=[10,20,30,20,10], n_cl...
Python
UTF-8
1,736
2.921875
3
[]
no_license
""" Intersect multiple community partitions into a single partition. Communities in this "intersection partition" are the collections of people who were categorized into the same community in all input partitions. """ import argparse import collections import networkit as nk import graph_tools import utils parser ...
C++
UTF-8
1,399
3.3125
3
[]
no_license
//Source code do curso Algoritmos com C++ por Fabio Galuppo //Ministrado em 2021 na Agit - https://www.agit.com.br/cursoalgoritmos.php //Fabio Galuppo - http://member.acm.org/~fabiogaluppo - fabiogaluppo@acm.org //Maio 2021 #ifndef SORTING_HEAPSORT_HPP #define SORTING_HEAPSORT_HPP #include "dynamic_array.hpp"...
TypeScript
UTF-8
3,339
3.015625
3
[]
no_license
import { Pirate } from "./pirate"; export class PirateShip { name: string; pirateCrew: Pirate[]; captain: Pirate; constructor(name: string) { this.name = name; } public fillShip() { this.captain = new Pirate(`Captain ${this.name}`, true); let randomNum = Math.floor(Math.random() * Math.floor(...
Shell
UTF-8
3,887
3.84375
4
[]
no_license
#!/bin/bash # mp - makepkg package building tasks # Activate debugging #set -x # Get local version and AUR version #aur_version() { # wget -q -O- "http://aur.archlinux.org/rpc.php?type=info&arg=${1}" | sed 's/.*"Version":"\([^"]*\)".*/\1/') #} #local_version() { # pacman -Q ${1} | cut -d\ -f2 #} # Text color var...
Markdown
UTF-8
1,861
2.90625
3
[]
no_license
# About This was written in 2020 in response to the COVID19 pandemic making my haptics robotics course going virtual. hapticAlt acts as a dummy api for source code intended for the OpenHaptics platform / Phantom Omni haptic device. This repo allows the user to define their own haptic rendering in the "hapticCallback...
Java
UTF-8
2,690
2.75
3
[]
no_license
package fi.tuni.cezaro; import fi.tuni.cezaro.exception.CredentialAcceptedExcepion; import fi.tuni.cezaro.exception.InvalidCredentialsException; import fi.tuni.cezaro.exception.UserNotFoundException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import...
Markdown
UTF-8
339
2.546875
3
[]
no_license
Differences between class method and instance method: You should use Class Methods when the functionality you are writing does not belong to an instance of that class. ENV: it's some sort of way of storing information about the current operating environment. We can use it to inform our program as to which environment...
Java
UTF-8
456
2.421875
2
[ "MIT" ]
permissive
package northwind.jpamodel; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class NextId { private String name; private long nextId; @Id @Column(length=50) public String getName() { return name; } public void setName(String name) { ...
Java
UTF-8
3,162
2.109375
2
[]
no_license
package com.intuit.billingcomm.billing.qbeshosting.jms; import com.intuit.billingcomm.billing.qbeshosting.TestHelpers; import com.intuit.billingcomm.billing.qbeshosting.exception.IncompleteEventException; import com.intuit.billingcomm.billing.qbeshosting.exception.UnsupportedEventException; import com.intuit.billingco...
Markdown
UTF-8
294
2.671875
3
[]
no_license
## Automated Amazon Price Tracker Check the price of a product on Amazon and notify the user through email, if it falls below a certain value. ### Keywords: * Webscraping * HTTP requests * SMTP (Simple Mail Transfer Protocol) ### Course: "100 Days of Code" by Dr. Angela Yu ### Coded by: Jacob Rymsza
Python
UTF-8
254
2.890625
3
[]
no_license
# city = "Banglore" # # # # assert city == "Bangalore" import browser.openChrome as op op.driver.get("https://www.google.com") pageTitle = op.driver.title print(pageTitle) # actual === excepted assert pageTitle == "Facebook" op.driver.quit()
JavaScript
UTF-8
641
2.671875
3
[]
no_license
const axios = require('axios'); const getLugarLatLong = async( direccion ) => { const encodedURL = encodeURI(direccion); const instance = axios.create({ baseURL: `https://devru-latitude-longitude-find-v1.p.rapidapi.com/latlon.php?location=${ encodedURL }`, headers: { 'X-RapidAPI-Key...
Java
UTF-8
2,872
3.140625
3
[]
no_license
package training.printing; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Created by sczerwinski on 2015-04-27. */ public class Printer<T extends ICartridge> implements Imachine {//extends Machine { private String modelNumber; private PaperTray paper...
Java
UTF-8
856
2.84375
3
[ "MIT" ]
permissive
class Solution { public int removed = 0; public int deleteTreeNodes(int nodes, int[] parent, int[] value) { List<Integer> [] tree = new ArrayList[nodes]; for(int i = 0; i < nodes; ++i) tree[i] = new ArrayList<>(); for(int i = 0; i < nodes; ++i) { if (parent[i] != -1) tree[par...
Java
UTF-8
881
2.671875
3
[]
no_license
package net.rainmore.platform.core.services.fixtures; import net.rainmore.platform.core.models.Person; import org.apache.commons.lang3.RandomStringUtils; import org.joda.time.LocalDate; import org.thymeleaf.util.StringUtils; import java.util.Random; public class PersonFixture { public Person getOne() { ...
Java
UTF-8
993
2.34375
2
[]
no_license
package com.example.springhibernate_23_01_2020; import javax.annotation.Generated; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import javax.validation.constraints.Email; import org.hiber...
C++
UTF-8
1,479
3.421875
3
[]
no_license
#include "vred.hpp" #include "vect.hpp" Vect::Vect(const float x, const float y, const float z): x(x), y(y), z(z) { } float Vect::operator[](const int n) const { switch (n) { case 0: return x; case 1: return y; default: return z; // TODO: if (n >= 3) raise Exception; } } float& Vect::operato...
Python
UTF-8
344
4.0625
4
[]
no_license
thisset = {"apple", "banana", "cherry"} thisset.remove("cherry") print(thisset) # Note: If the item to remove does not exist, remove() will raise an error. # You can also use the pop(), method to remove an item, but this method will remove the last item. # Remember that sets are unordered, so you will not know what...
C
UTF-8
1,390
3.359375
3
[ "Apache-2.0" ]
permissive
#include "openlibc/queue.h" /* * find the middle queue element if the queue has odd number of elements * or the first element of the queue's second part otherwise */ olc_queue_t * olc_queue_middle(olc_queue_t *queue) { olc_queue_t *middle, *next; middle = olc_queue_head(queue); if (middle == olc_que...
C++
UTF-8
1,490
2.953125
3
[ "MIT" ]
permissive
#pragma once #ifndef ALGORITHM_MOVE_H #define ALGORITHM_MOVE_H // =================================================================================================================== // Includes // =================================================================================================================== #in...
Markdown
UTF-8
1,515
2.71875
3
[ "Apache-2.0" ]
permissive
# TETRA Listener - Vagrant template This repository provides setup script to get [tetra-listener](https://github.com/itds-consulting/tetra-listener) up and running using Vagrant virtual environment manager ## Install Dependencies 1. Vagrant 1.6 and later 2. VMware Workstation or VMware Fusion (VirtualBox has bee...
Python
UTF-8
266
3.328125
3
[]
no_license
#python PAM while True: password=input("Enter password: ") if any(i.isdigit() for i in password) and any(i.upper() for i in password) and len(password) >= 5: print("Password is fine") break else: print("Password is not fine")
C
UTF-8
1,647
3.15625
3
[]
no_license
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* helpers.c :+: :+: :+: ...
Java
UTF-8
4,954
2.453125
2
[]
no_license
package com.example.proiectandroid; import android.os.AsyncTask; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputS...
C++
UTF-8
1,409
3.5625
4
[]
no_license
// Smallest Positive missing number // https://practice.geeksforgeeks.org/problems/smallest-positive-missing-number/0 #include <bits/stdc++.h> using namespace std; int segregate(int a[], int n) { int j = 0; int i; for (int i = 0; i < n; i++) { if (a[i] <= 0) { swap(a[i], a[...
C
UTF-8
1,332
3.765625
4
[]
no_license
/** * Example client program that uses thread pool. */ #include <stdio.h> #include <unistd.h> #include "threadpool.h" struct data { int a; int b; }; void add(void *param) { struct data *temp; temp = (struct data*)param; sleep(3); printf("I add two values %d and %d result = %d\n",temp->a, te...
C++
UTF-8
6,829
2.9375
3
[]
no_license
#ifndef SUMMERENGINE_SEEVENT_H #define SUMMERENGINE_SEEVENT_H ///SE includes: #include <ids/SystemAndManagerIDList.h> #include <utility/Math.h> #include <utility/Typedefs.h> #include <ids/ComponentTypeList.h> namespace se { union event_data //Size is sizeof(Mat4f) which with default precision is 64 bytes { SEchar se...
JavaScript
UTF-8
590
2.84375
3
[]
no_license
function createElement(type, props, ...children) { return { type, props: { ...props, children: children.map(child => { // 判断child是对象还是普通的文本 return typeof child === 'object' ? child : createTextElement(child) }) } } } fu...
Markdown
UTF-8
2,497
2.71875
3
[ "MIT" ]
permissive
# IVM-OFFLINE-SIMULATOR ## Required: * nodejs ~8.9.1-lts ## How to use ```bash $ npm install -g https://github.com/TianyiLi/IVM-simulator.git ``` * Start sample server > default is working path ```bash $ sample-server ``` * Start SMC service ```bash $ smc-service ``` Or ``` $ git clone https://github.com/Ti...
Java
UTF-8
1,284
2.296875
2
[]
no_license
package litestruts; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.Element; import org.dom4j.io.SAXReader; /** * Created by bdl19 on 2017/3/2. */ public class test { public static void main(String[] args) { SAXReader reader = new SAXReader(); try { Do...
PHP
UTF-8
591
2.546875
3
[]
no_license
<?php require_once("common.inc.php"); require_once("ApiControl.class.php"); class RequestGet { public function index() { if (isset($_GET["account"])) { try { $trade = new Trade(); $result = $trade->getTrade($_GET["account"]); $trade_info = array(); if (count($result) > 0) { $trade_info = ar...
Java
UTF-8
633
3.34375
3
[]
no_license
package synchronizedDemo; /** * 子类的同步方法调用父类的同步方法 * synchronized是可重复锁, 继承也是可以的 * @author ruwenbo * @version 1.0 * @date 2020/12/17 11:25 * @description */ public class Demo6 extends Parent { @Override synchronized void m() { System.out.println("child m start"); super.m(); System....
Java
UTF-8
1,699
2.046875
2
[]
no_license
/** * Copyright © 2018 eSunny Info. Tech Ltd. All rights reserved. * * 功能描述: * @Package: com.itstyle.mail.web * @author: Administrator * @date: 2018年12月2日 下午10:24:18 */ package com.itstyle.mail.web; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web...
TypeScript
UTF-8
813
2.8125
3
[]
no_license
import Mocked = jest.Mocked; export function createMockInstance<T>(ctor: new (...args: any[]) => T): Mocked<T> { return stubMethods<T>(Object.create(ctor.prototype)); } function stubMethods<T>(obj: Mocked<T>, mock: Mocked<T> = obj, stubbed: Set<string> = new Set()): Mocked<T> { for (const prop of Object.getOwnPro...
Python
UTF-8
367
3.46875
3
[]
no_license
import xlsxwriter # Create an new Excel file and add a worksheet. workbook = xlsxwriter.Workbook('images.xlsx') worksheet = workbook.add_worksheet() # Widen the first column to make the text clearer. worksheet.set_column('A:A', 30) # Insert an image. worksheet.write('A2', 'Insert an image in a cell:') worksheet.inse...
PHP
UTF-8
3,235
2.765625
3
[ "MIT" ]
permissive
<?php include_once "../../../security/authentication/jtc_permission_authentication.php"; include_once "../../../security/database/jtc_connection_database.php"; /* * DataTables example server-side processing script. * * Please note that this script is intentionally extremely simply to show how * server-...
Java
UTF-8
2,549
2.078125
2
[]
no_license
package com.example.sunflower_java.repository; import android.util.Config; import com.example.sunflower_java.App; import com.example.sunflower_java.config.DataBaseConfig; import com.example.sunflower_java.data.AppDataBase; import com.example.sunflower_java.data.Plant; import com.google.gson.Gson; import com.google.gs...
Python
UTF-8
5,118
2.65625
3
[]
no_license
import hashlib from cli.torrentLogger import logger import os from bitarray import bitarray from peer.constants import BLOCK_SIZE from typing import List from parsing.File import File class Block: start: int size: int def __init__(self, start: int, size: int): self.start = start self.siz...
PHP
UTF-8
1,028
2.5625
3
[]
no_license
<?php namespace App\Http\Controllers\Api\v1; use App\Http\Controllers\AbstractController; use App\Models\Profile; use App\Services\ProfileService; use Illuminate\Http\Request; class ProfileController extends AbstractController { /** * ProfileController constructor. * @param ProfileService $service ...
Java
UTF-8
388
1.789063
2
[]
no_license
package org.hongxi.spring.boot.service; import org.hongxi.spring.boot.OpenSpringAutoConfiguration; import org.hongxi.spring.boot.common.util.JarVersionUtils; /** * Created by shenhongxi on 2021/3/26. */ public class VersionService { public String getVersion() { return JarVersionUtils.getJarVersion(Open...
Java
UTF-8
705
2.171875
2
[]
no_license
package org.turings.investigationapplicqation.Entity; import java.io.Serializable; import java.util.List; public class TopicBigType implements Serializable { private String textTopic; private List<TopicType> list; public TopicBigType() { } public TopicBigType(String textTopic, List<TopicType> l...
C++
UTF-8
527
3.375
3
[]
no_license
#include<iostream> #include<algorithm> #include<array> using namespace std; int main(){ array<int,10> numbers; for(int i=0; i<numbers.size(); i++){ numbers[i] = rand()%1000; } cout << "original: "; for(int n: numbers){ cout << n << " "; } cout << ...
Markdown
UTF-8
714
2.53125
3
[]
no_license
# Phising-Game-Online # Mobile Legend & Clash of Clans tools phising untuk game : mobile legends & clash of clans => Installation : pkg install python2 -y pip2 install requests pkg install figlet -y pkg install nano -y pkg install git -y git clone https://github.com/CyberTCA/Fhising-Game => how to use : cd Phisin...
Python
UTF-8
1,886
2.890625
3
[]
no_license
''' Logsoftmax.py用于实现Log版本的softmax ''' import numpy as np from Module import Module class Logsoftmax(Module): def __init__(self): super(Logsoftmax, self).__init__() # input_shape=[batch, class_num] # 设置module打印格式 def extra_repr(self): s = () return s def cal_softmax(se...
C
GB18030
259
2.5625
3
[]
no_license
#include <stdio.h> int main() { int a = 10000; FILE* pf = fopen_s("test.txt", "w"); //ļָ fputc('a',pf);//дһַļ //fwrite(&a, 4, 1, pf);//Ƶʽдļ fclose_s(pf); pf = NULL; sysytem("pause"); return 0; }
Shell
UTF-8
2,071
2.953125
3
[]
no_license
# brew completions if [[ $(uname) == 'Darwin' ]]; then fpath=(/usr/local/share/zsh-completions $fpath) fi # The following lines were added by compinstall zstyle ':completion:*' auto-description 'specify: %d' zstyle ':completion:*' file-sort name zstyle ':completion:*' format 'Completing %d' zstyle ':completion:*' g...
JavaScript
UTF-8
4,339
3.078125
3
[]
no_license
import { nothing } from 'lit-html'; import { LitElement, html, css } from 'lit-element'; import { classMap } from 'lit-html/directives/class-map'; import { isEmpty as isArrayEmpty, insertItem } from './utils/array'; /** * <sortable-dnd> - Component for sortable Drag and Drop list. * Component implements HTML Drag a...
C++
UTF-8
802
3.0625
3
[]
no_license
// // main.cpp // 647 - Palindromic Substrings // // Created by Wu, Meng Ju on 2020/5/2. // Copyright © 2020 Pitt. All rights reserved. // #include <iostream> #include <string> using namespace std; class Solution { private: int expand(int i, int j, string s) { int candidates = 0; while (i...
Java
UTF-8
606
3.46875
3
[]
no_license
package algorithm.dayOfTheProgrammer; public class DayOfTheProgrammer { public static String dayOfProgrammer(int year) { String result = ""; if(year >= 1700 && year <= 1917) { result = year % 4 == 0 ? "12.09."+year : "13.09."+year; } else if(year == 1918) { /...
Ruby
UTF-8
845
2.890625
3
[ "MIT" ]
permissive
require 'necromancy' describe Necromancy do let(:l) { described_class.new } example do [:foo, :bar, :baz].map(&l.to_s . upcase). should == ["FOO", "BAR", "BAZ"] end example do [:foo, :hoge, :bar, :fuga].select(&l.to_s . length > 3). should == [:hoge, :fuga] end example do qstr =...
Python
UTF-8
1,907
4.0625
4
[]
no_license
def filter_six_digits(number) -> bool: return len(str(number)) == 6 def filter_adjacent_numbers(number) -> bool: #regex to match cases where some alphanumeric char appears atleast twice in row: # ((\d)\2{1,}) #modified from answer https://stackoverflow.com/a/7147979 import re return re.sear...
Java
UTF-8
1,795
2.15625
2
[]
no_license
package com.desheng.app.toucai.model; import android.os.Parcel; import android.os.Parcelable; public class XunibiAddressBean implements Parcelable { /** * address : 0xf4C5F928d485d60091f9FEB1d494e666e831Ae7b * createTime : 1599301326000 * id : 6 * uin : 5927 */ private String addres...
Python
UTF-8
1,412
2.921875
3
[ "MIT" ]
permissive
# Copyright 2009-2014 Ram Rachum. # This program is distributed under the MIT license. '''Defines various tools related to data structures.''' import collections import itertools import numbers from python_toolbox import nifty_collections @nifty_collections.LazyTuple.factory() def get_all_contained_counters(counte...
JavaScript
UTF-8
1,594
2.625
3
[ "MIT" ]
permissive
/** * responsemanager.js * * Response structure manager * * @package Parking Manager * @subpackage routers * @author Rahul N * @copyright 2020 Rahul * @version 0.0.1 * @since File available since Release 0.0.0 */ const info = { "Author" : process.env.AUTHOR, "Date" : new Date().toLocal...
C#
UTF-8
2,165
2.578125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using PDFService.Entities; using PDFService.Repository; namespace PDFService.Services.Entity { public sealed class TemplateEntityService { readonly ITemplateRepository _repository; pu...
C
UTF-8
328
2.96875
3
[]
no_license
/* Luiza de Almeida Gatti All rights reserved */ #include <stdio.h> #include <stdlib.h> void main() { char vendedor[100]; double salarioFixo, montante, final; scanf("%s", vendedor); scanf("%lf", &salarioFixo); scanf("%lf", &montante); final = (montante*0.15)+salarioFixo; printf("TOTAL =...
C#
UTF-8
2,167
3.25
3
[]
no_license
using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; namespace JMR.Common { public static class Extensions { public static int Count(this IList collection) { return collection == null ? 0 : collection.Cou...
Markdown
UTF-8
992
2.5625
3
[ "MIT" ]
permissive
<p align="center"><img src="assets/cuis_web_logo.png" width="150" alt="Cuis web logo"></p> **Cuis Web** is a microframework web for [Cuis Smalltalk](https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev) that includes everything needed to create web applications according to the [Model-View-Controller (MVC) pattern](ht...
C#
UTF-8
3,953
3.171875
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Linq; using System.IO; using System.Diagnostics; namespace IALab406 { [Serializable] public class GeneticAlgorithm { public void GeneratePopulation(int density) { _population = new LinkedList<RobotChromosome>(); ...
Python
UTF-8
872
3.15625
3
[]
no_license
import numpy as np class Dense: x = None def __init__(self, num1, num2, learning_rate=0.01, bias=True): self.mt = 2/num1 * np.random.randn(num1, num2) # new weights according to Andrew Ng self.bias = 2/num1 * np.random.randn(1, num2) self.lr = learning_rate def forward(self, d...
Java
UTF-8
1,939
3.875
4
[]
no_license
package kr.kirk.euler.p000; import java.util.ArrayList; import java.util.List; /* 어떤 수를 소수의 곱으로만 나타내는 것을 소인수분해라 하고, 이 소수들을 그 수의 소인수라고 합니다. 예를 들면 13195의 소인수는 5, 7, 13, 29 입니다. 600851475143의 소인수 중에서 가장 큰 수를 구하세요. The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of t...
JavaScript
UTF-8
350
2.6875
3
[]
no_license
class Hero{ constructor(x,y,width,height){ this.body= Bodies.rectangle(200,250,width,height); this.width= width; this.height=height; World.add(world,this.body); this.image=loadImage("spiderman1.png") } display(){ image(this.image, x,y, this.width...
Java
UTF-8
1,667
2.21875
2
[]
no_license
package fiit.hipstery.publisher.dto; import java.time.LocalDateTime; import java.util.Set; public class ArticleDetailedDTO extends AbstractDTO { protected String title; protected String content; protected LocalDateTime createdAt; protected Set<AppUserDTO> authors; protected Set<CategoryDTO> categories; protect...
Python
UTF-8
461
3.359375
3
[]
no_license
import numpy as np x_1 = np.arange(12).reshape(3, 4) x_2 = np.arange(12, 24).reshape(3, 4) # print(x_1, x_2) # t_1 = np.arange(3).reshape(3, 1) t_1 = np.array([0 for i in range(x_1.shape[0])]).reshape(3, 1) y_1 = np.hstack((x_1, t_1)) # print(y_1) #! 1. 全为0全为1的数值 #! 2. 最大值的位置:np.argmax(t,axis=0) # ? numpy中随机数组:产生个2行...
Java
UTF-8
145
2.359375
2
[]
no_license
package abstractFactoryDesignPatternHelper; public interface EnemyShipFactory { public ESEngine addEngine(); public ESWeapon addWeapon(); }
C++
UTF-8
9,675
2.953125
3
[]
no_license
#ifndef MVRMTXIO_H #define MVRMTXIO_H #include "mvriaTypedefs.h" #include "MvrRobot.h" /** @brief Interface to digital and analog I/O and switched power outputs on MTX * core (used in Pioneer LX and other MTX-based robots). On Linux this class uses the <code>mtx</code> driver to interface with the ...
Python
UTF-8
26,039
2.90625
3
[ "MIT" ]
permissive
# This has several modification relative to previous code. Namely, `Mutation` has been split out. import pyrosetta import re, os, csv, json from typing import Optional, List, Dict, Union, Any, Callable, Tuple class Mutation: """ A mutation is an object that has all the details of the mutation. A variant,...
PHP
UTF-8
1,009
3.90625
4
[]
no_license
<?php require_once('page.inc.php'); class Math { // Constantes de classes : // ----------------------- const pi = 3.14159; // Méthode statique : // ------------------ static function carre($valeur) { return $valeur * $valeur; } } echo "Math::pi = " . Math::pi . "\n"; ec...
Java
UTF-8
748
3.59375
4
[]
no_license
/** * Author : Zhaolong Zhong * Date : 2015 12:10:46 AM * Problem: * Remove all elements from a linked list of integers that have value val. */ package list; import linkedlist.ListNode; public class RemoveElements { public ListNode removeElements(ListNode head, int val) { if (head == null) return null; ...
JavaScript
UTF-8
1,666
4.28125
4
[]
no_license
// 2 - Pari e Dispari // L'utente sceglie pari o dispari e inserisce un numero da 1 a 5. // Generiamo un numero random (sempre da 1 a 5) per il computer (usando una funzione). // Sommiamo i due numeri // Stabiliamo se la somma dei due numeri è pari o dispari (usando una funzione) // Dichiariamo chi ha vinto. var primaS...
Python
UTF-8
931
3.34375
3
[]
no_license
# Time Complexity : O(N) # Space Complexity : O(1) # Did this code successfully run on Leetcode : Yes # Any problem you faced while coding this : Couldn't figure out a one pass solution :( # Your code here along with comments explaining your approach class Solution: def sortColors(self, nums: List[int]) -> None:...
Markdown
UTF-8
16,605
2.953125
3
[]
no_license
## 一、概念 幂等性, 通俗的说就是一个接口, 多次发起同一个请求, 必须保证操作只能执行一次 比如: - 订单接口, 不能多次创建订单 - 支付接口, 重复支付同一笔订单只能扣一次钱 - 支付宝回调接口, 可能会多次回调, 必须处理重复回调 - 普通表单提交接口, 因为网络超时等原因多次点击提交, 只能成功一次 等等 ## 二、常见解决方案 - 唯一索引 -- 防止新增脏数据 - token机制 -- 防止页面重复提交 - 悲观锁 -- 获取数据的时候加锁(锁表或锁行) - 乐观锁 -- 基于版本号version实现, 在更新数据那一刻校验数据 - 分布式锁 -- redis(jedis、redisson)或zook...
Java
UTF-8
944
3.421875
3
[]
no_license
package com.aca; public class Time { public static void main(String[] args) { int hour = 23; int minute = 02; int second = 0; int secondsInADay = 24 * 60 *60; System.out.println("total seconds in a day: " + secondsInADay); // number of seconds since midnight //convert hours to seconds int to...
Java
UTF-8
1,285
1.875
2
[]
no_license
package com.sjtu.adminanddealer.controller; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springfram...
Python
UTF-8
2,654
3.265625
3
[ "Python-2.0" ]
permissive
# -*- coding: utf-8 -*- """ Module qui permet de gerer l'encodage de certains arguments. Comme par exemple, l'encodage en base64 pour palier au probleme de caracteres speciaux non geres par les urls. """ from excalibur.exceptions import ArgumentError, DecodeAlgorithmNotFoundError import base64 class DecodeArguments(o...
JavaScript
UTF-8
3,501
2.734375
3
[]
no_license
/** * Avenue FB 登入相關方法集成 * * @param {string} appId [開發者的 appId] * @param {string} appVerifyUrl * [ * fb 個人資料完成後導向開發者 app 的 url, * 這邊會透過自動產生 form 的方式 已POST 傳送兩個參數 jAuthResponse 以及 jInformation, * 即驗證回傳物件以及個人資訊回傳物件的 JSON 字串 * ] * * @depend {jQuery, fos.routing.js} */ var AvenueFacebookHandler = ...
C#
UTF-8
1,288
2.625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ComponentModel; namespace RailwayCL { public class ShopUtils { private static ShopUtils shopUtils; private string cbValue = "Id"; private string cbDisplay = ...
C++
SHIFT_JIS
2,274
2.734375
3
[]
no_license
#pragma once //gpwb_[ #include"GameL\SceneObjManager.h" #include"math.h" //gpl[Xy[X using namespace GameL; #define HERO_FRONT (0)// #define HERO_BACK (1)//w #define HERO_RIGHT (2)//E #define HERO_LEFT (3)// #define HERO_XSPEED (5)//l̑xX #define HERO_YSPEED (5)//l̑xY //IuWFNg : l class CObjHero : public CObj { pub...
Java
UTF-8
415
3.328125
3
[]
no_license
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package stringrev; class Stringrev{ public static void main(String args[]){ String str[] = "He is the one".split(" "); String finalStr=""; for(int i = str.length-1; i>= 0 ;i--){ ...
C
UTF-8
528
3.6875
4
[]
no_license
#include <stdio.h> #include <stdlib.h> int buscaBinaria(int a[], int x, int lenght); int main(void){ int x = 31; int a[] = {1,3,4,5,8,9,17,18,31}; printf("%d", buscaBinaria(a, x,9)); return 0; }; int buscaBinaria(int a[], int x,int lenght){ int inicio = 0; int final = lenght; int meio = (inicio+final)/2; ...
Markdown
UTF-8
230
2.765625
3
[]
no_license
# awsstuff A small set of programs to upload a bunch of files on your computer into an s3 bucket. The files are stored in the bucket in the exact same way they are stored in your system (depending on the initial path you give).
JavaScript
UTF-8
2,968
2.515625
3
[]
no_license
$().ready(function() { // 在键盘按下并释放及提交后验证提交表单 $("#signinForm").validate({ rules: { username: { required: true, minlength: 3, maxlength:16, remote:{ type: "get", url: "/checkname", ...
Java
UTF-8
385
1.828125
2
[]
no_license
package mw56_sb55.game.api; import common.message.IChatMessage; import provided.datapacket.ADataPacket; import provided.datapacket.ADataPacketAlgoCmd; public interface IGameOver extends IChatMessage { /** * Show game over. */ public void ShowGameOver(); /** * Get the command * @return The command. *...
Python
UTF-8
16,943
2.9375
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- import numpy as np import scipy.sparse as sp import random def to_dense(X): '''Convert X to dense matrix if necessary.''' if isinstance(X, sp.csr_matrix): return X.todense() else: return X def project_L1(v, l=1., eps=.01): '''Perfoms eps-accurate projection of...
Java
UTF-8
1,010
2.546875
3
[]
no_license
import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import student.TestCase; /** * @author lihui * @version 1.0 */ public class HashTest extends TestCase { /** * set up test cases */ public void setUp() { // Nothing needed } /** * Read co...
Java
UTF-8
1,374
2.359375
2
[]
no_license
package softagi.mansour.firebase.models; public class userModel { private String name; private String email; private String mobile; private String address; private String imageUrl; private String Uid; public userModel(String name, String email, String mobile, String address, String imageUr...
C++
UTF-8
470
2.75
3
[]
no_license
#ifndef CPPHAT_MATH_H_ #define CPPHAT_MATH_H_ class Point { public: int X, Y; Point(int _x = 0, int _y = 0); Point operator+(const Point& op); Point& operator+=(const Point& op); Point operator-(const Point& op); Point& operator-=(const Point& op); bool operator<(const Point& op); bool operator<=(const Poin...
Ruby
UTF-8
1,370
2.90625
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
require 'config_volumizer/version' require 'config_volumizer/parser' require 'config_volumizer/generator' module ConfigVolumizer class << self # Parses keys within the {source} hash matching {base_name} # returning a hash with all the matched data under a string key matching the {base_name} # # @see...
Python
UTF-8
1,917
2.859375
3
[]
no_license
import string import random as rd import numpy as np import pandas as pd import sys from fastText import train_supervised data = pd.read_csv('spam.csv',encoding='ISO-8859-1'); stopwords = [ x.replace('\n', '') for x in open('stopwords.txt').readlines() ] valdata = data.values n_data = [] for x in valdata: value ...
Java
UTF-8
576
2.65625
3
[]
no_license
package com.revature.services; import java.util.List; import com.revature.daos.UserDAO; import com.revature.daos.UserDAOImpl; import com.revature.models.User; public class LoginService { UserService userservice = new UserService(); UserDAO userDAO = new UserDAOImpl(); public User login(String eMail, String pa...
Shell
UTF-8
1,313
3.953125
4
[]
no_license
#!/bin/bash # Renames the bundled 'app' to whatever you want. if [ -z $1 ]; then echo 'Need to specify new app name!' exit fi #Note that $0 contains the full path of the script being executed. script_path=`dirname $0` cd ${script_path} #Now go through each of the spots where we had to hardcode app and repla...
Python
UTF-8
4,349
2.609375
3
[]
no_license
import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets from torchvision.transforms import transforms from tensorboardX import SummaryWriter from torchvision.utils import save_image from tqdm import tqdm from model import VAE wri...