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
C++
UTF-8
1,488
3.1875
3
[ "MIT" ]
permissive
// https://www.urionlinejudge.com.br/judge/en/problems/view/1243 #include <iostream> #include <string> #include <vector> using namespace std; bool correct_word(string word) { string not_word_part = "0123456789 ."; for (int j = 0; j < word.size(); j++) if (not_word_part.find(word[j]) != -1) return false; return tr...
Java
UTF-8
1,707
3.109375
3
[]
no_license
package bg.fmi.mjt.lab.coffee_machine; import java.util.List; import bg.fmi.mjt.lab.coffee_machine.container.Container; import bg.fmi.mjt.lab.coffee_machine.container.PremiumContainer; import bg.fmi.mjt.lab.coffee_machine.supplies.Beverage; public class PremiumCoffeeMachine implements CoffeeMachine { private Contai...
TypeScript
UTF-8
403
2.625
3
[]
no_license
import { Pipe, PipeTransform } from "@angular/core"; import { student } from "../model/student"; @Pipe({ name: 'stdFilter' }) export class TextFilter implements PipeTransform { transform(items: student[], filter: any) { if (!items || !filter) { return items; } return items.f...
Java
UTF-8
3,895
2.1875
2
[]
no_license
package com.example.pranav.splitdo; import android.app.IntentService; import android.appwidget.AppWidgetManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.support.annotation.Nullable; import android.util.Log; import com.firebase.ui.auth.data.mo...
Java
UTF-8
826
3.171875
3
[]
no_license
package Model; public class sprinter extends Athlete implements Run { public sprinter(String ID, String name, String age, String state) { super(ID, name, age, state); // TODO Auto-generated constructor stub } @Override public String getClassName(){ return "Sprinter"...
Python
UTF-8
517
4.46875
4
[]
no_license
# 创建一个空的bytes b1 = bytes() print("b1是:", b1) # 创建一个空的bytes值 b2 = b'' print("b2是:", b1) # 通过b前缀指定hello是bytes类型的值 b3 = b'hello' print("b3是:",b3) print("b3-2是:",b3[0]) print("b3-3是:",b3[2:4]) # 调用bytes()方法将字符串转换成bytes对象 b4 = bytes('我爱Python编程!', encoding = 'utf-8') print("b4是:",b4) # 利用字符串的encode()方法编码成bytes b5 = "学习Py...
Java
UTF-8
410
1.742188
2
[]
no_license
package com.time.plan.mapper; import com.time.plan.common.MyMapperSupport; import com.time.plan.model.SysMenu; import org.apache.ibatis.annotations.Param; import java.util.List; public interface SysMenuMapper extends MyMapperSupport<SysMenu> { List<SysMenu> selectByParentId(@Param("parentId") Long parentId); ...
Java
UTF-8
350
3.234375
3
[]
no_license
package commandpattern.device; public class CeilingFan { private final String room; public CeilingFan(final String room) { this.room = room; } public void on() { System.out.println(String.format("%s ceiling fan is On", room)); } public void off() { System.out.println(String.format("%s ceili...
Markdown
UTF-8
9,455
2.71875
3
[ "MIT" ]
permissive
--- heading: Sage One seo: Events | Sage One | Cloud Elements API Docs title: Events description: Enable Sage One events for your application. layout: sidebarelementdoc breadcrumbs: /docs/elements.html elementId: 3458 elementKey: sageone parent: Back to Element Guides order: 25 --- # Events Cloud Elements supports ev...
Java
UTF-8
5,523
3.921875
4
[]
no_license
package interviewQuestions.SortingAndSearching; public class Test2 { // =============================== binary Search =================================================================== public static int binarySearch(int[] array , int left , int right , int element){ if(right>=1){ // Wh...
Java
UTF-8
1,345
1.726563
2
[]
no_license
package com.tedu.base.ftl.controller; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework....
JavaScript
UTF-8
7,699
2.59375
3
[ "MIT" ]
permissive
import * as THREE from "three"; // http://stackoverflow.com/a/40251527 import Cacheable from "./cacheable.js"; import structure from "./structure.js"; let colors = new Cacheable(color => new THREE.Color(color)); let presets = Object.create({ get(el) { return this.hasOwnProperty(el) ? this[el] : this._def;...
Python
UTF-8
4,498
2.515625
3
[ "MIT" ]
permissive
# vim: ft=python fileencoding=utf-8 sw=4 et sts=4 """Tag tests for vimiv's test suite.""" import os from unittest import main from gi import require_version require_version('Gtk', '3.0') from vimiv.helpers import read_file, get_user_data_dir from vimiv_testcase import VimivTestCase class TagsTest(VimivTestCase): ...
Python
UTF-8
340
3.1875
3
[]
no_license
N = int(input()) data = [] for i in range(N): data.append([j for j in map(int, input().split())]) result = [] for i in range(N): x, y = data[i] count = 1 for j in range(N): p, q = data[j-1] if x < p and y < q: count += 1 result.append(str(count)) pri...
JavaScript
UTF-8
985
3.875
4
[]
no_license
const array = [{ name: "张三", age: 15 }, , { name: "李四", age: 25 }, { name: "王五", age: 36 }]; //some const isExist = array.some((item, index, arr) => { console.log("some index:", index); return item && item.age > 24; }); console.log("array some:", isExist); //find const item = array.find((item, index, arr) => ...
Java
UTF-8
390
3.625
4
[]
no_license
import java.util.List; import java.util.ArrayList; public class ListDemo { public static void main(String[] args){ // (a) List<String> lst = new ArrayList<String>(5); String[] elements = {"one", "two", "three", "four", "five"}; for(int i=0; i<elements.length; i++){ lst.add(elements[i]); } // (b) f...
JavaScript
UTF-8
1,238
2.5625
3
[]
no_license
import axios from 'axios'; const ADDED_ART = 'ADDED_ART'; const addedArt = artwork => ({ type: 'ADDED_ART', artwork, }); export const addArt = (artwork,uid) => { return async dispatch => { try { const { title, date, medium, dimension, img1 } = artwork; console.log('in addArt thunk , uid is', ui...
SQL
UTF-8
3,295
2.53125
3
[]
no_license
INSERT INTO regiones (nombre) VALUES ('Sudamérica'); INSERT INTO regiones (nombre) VALUES ('Centroamérica'); INSERT INTO regiones (nombre) VALUES ('Norteamérica'); INSERT INTO regiones (nombre) VALUES ('Europa'); INSERT INTO regiones (nombre) VALUES ('Asia'); INSERT INTO regiones (nombre) VALUES ('Africa'); INSERT INTO...
Python
UTF-8
8,091
2.84375
3
[ "MIT" ]
permissive
import os from builtins import print from ntpath import basename, split import atexit import sys from cryptography.fernet import InvalidToken from PasswordManager.Account import Account import os from PyQt5.QtWidgets import QMessageBox dbModulePath, _ = split(__file__) defaultFileName = "myDB.pass" default...
JavaScript
UTF-8
972
3.65625
4
[]
no_license
alert('Lets do Nummers!'); var num = prompt('Pick a number'); var num = parseFloat(num); var numTwo = prompt('Pick another one'); var num = parseFloat(num); var numTwo = parseFloat(numTwo); var add = num + numTwo; var Mult = num * numTwo; var subtract = num - numTwo; var divide = num/numTwo; var message = ' Doing numme...
JavaScript
UTF-8
989
4.1875
4
[]
no_license
alert("This is a JavaScript calculator"); document.getElementById("compute").addEventListener("click", function () { let first_value = document.getElementById("first-value").value; let second_value = document.getElementById("second-value").value; function set_result(x) { document.getElementById("result").in...
Java
UTF-8
439
2.484375
2
[]
no_license
package ejerciciosExtra.builderCine; public class PaqueteMediano extends Builder{ @Override public void buildPipocas() { combo.setPipocas(new Pipocas("Mixto",3,"Grande")); } @Override public void buildRefrescos() { combo.setRefrescos(new Refrescos(false,2,"Mediano")); } @...
Markdown
UTF-8
646
2.953125
3
[ "Apache-2.0" ]
permissive
--- title: "Monte Carlo Approximiation" author: 'www.njtierney.com' date: '2013-06-26' slug: monte-carlo-approximiation categories: - bloglink tags: - njtierneycom --- There are a lot of explanations of Monte Carlo approximation out there. Here is one that worked for me. A famous mathematician named Stan Ulam liked ...
Python
UTF-8
5,388
2.84375
3
[]
no_license
import pandas as pd import numpy as np import time from sklearn import preprocessing max_user_id = 49 number_of_users = max_user_id + 1 def cos_sim(a, b): #https://masongallo.github.io/machine/learning,/python/2016/07/29/cosine-similarity.html dot_product = np.dot(a, b) norm_a = np.linalg.norm(a) ...
Java
UTF-8
12,161
1.882813
2
[]
no_license
package tw.edu.chit.struts.action.AMS; import java.sql.Date; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; impo...
JavaScript
UTF-8
706
2.578125
3
[]
no_license
var mysql = require('mysql'); var inquirer = require('inquirer'); var connection = mysql.createConnection({ host: 'localhost', port: 3306, user: 'root', password: 'JkdiwLj23@#$!DFIJ()kd2', database: 'bamazondb' }) connection.connect(function(err) { var newProduct = { productName: 'Lawn Mower', departmentN...
JavaScript
UTF-8
1,939
2.640625
3
[]
no_license
import Immutable from 'immutable' import { DFPreTraversal, TreeStore } from './treeStore.js' import Random from './random.js' export default class Outline { static fromTreeStore(treeStore, rootid) { let s = '' function traverer(tree, depth) { const title = tree.node.title Im...
C#
UTF-8
6,744
2.53125
3
[]
no_license
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; using Memory; namespace SA_Trainer_1 { public partial class Form1 : Form ...
Java
ISO-8859-1
675
3.71875
4
[]
no_license
package opAritmticos; import java.util.Scanner; public class OpAritmticos { public static void main(String[] args) { Scanner entrada = new Scanner(System.in); double a, b, c, resultado1, resultado2; System.out.println("Digite el nmero A"); a=entrada.nextDouble(); System.out.println("Digite el nme...
C++
UTF-8
773
2.921875
3
[]
no_license
#include "simple_tests.hpp" #include <iostream> template<typename... Ts> struct overloaded_lambda : Ts... { using Ts::operator()...; }; // deduction guide template<typename... Ts> overloaded_lambda(Ts...) -> overloaded_lambda<Ts...>; int main(void) { auto visit = overloaded_lambda{ [](int){ std::cout...
Python
UTF-8
408
2.890625
3
[]
no_license
import math def calcSpeedX(angle,speed): speedX = math.cos(angle) * speed return speedX def calcSpeedY(angle,speed): speedX = math.sin(angle) * speed return speedX def doesIntersect(circleRadius, circleX, cicrleY, rectX,rectY,rectLenght, rectWidth): pass assert calcSpeedX(angle=0,spee...
Java
UTF-8
3,136
2.546875
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 projekpraktikum; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JOptionPane; /** ...
Java
UTF-8
1,281
2.09375
2
[ "MIT" ]
permissive
package ru.vyarus.dropwizard.guice.module.installer.install; import io.dropwizard.core.setup.Environment; /** * Marker interface must be used together with {@code FeatureInstaller}. * Used for installers which require extension instance for installation. * Instance created using {@code injector.getInstance()}. *...
JavaScript
UTF-8
1,473
2.9375
3
[]
no_license
function init_phone(){ canvas.addEventListener("touchstart", function (e) { TouchStart(e); }); canvas.addEventListener("touchmove", function (e) { TouchMove(e); }); canvas.addEventListener("touchend", function (e) { TouchEnd(e, "green"); }); canvas.addEventListener("touchcancel", function (e) { TouchEnd...
Python
UTF-8
3,641
2.703125
3
[]
no_license
import cv2 import os, shutil import numpy as np #Paths main_dir="/media/ujwal/My files/Work/Non ML/Flowchart/" input_dir=main_dir+"Input" data_dir=main_dir+"Data" #Constants kernel=np.ones((5,5),np.uint8) upper=float("inf") lower=4000 threshold=5 def isreasonable(value): if value>lower and value< upper: retu...
Java
UTF-8
1,918
2.09375
2
[]
no_license
package entities; import java.io.Serializable; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; @Entity public class Mati...
PHP
UTF-8
2,899
2.734375
3
[]
no_license
<?php /** * This is the model class for table "sale". * * The followings are the available columns in table 'sale': * @property integer $sale_cust_id * @property integer $sale_item_id * @property integer $sale_store_id * @property integer $sale_emp_id * * The followings are the available model relations: * @...
Markdown
UTF-8
1,104
2.546875
3
[]
no_license
# 安裝python的grpc 1. 開啟一個虛擬環境 2. 使用pip安裝grpcio==1.19.0 3. pip install grpcio-tools==1.19.0 # 編譯一個協定溝通用的proto檔案 1. 詳細的定義參照: https://reurl.cc/nv541 2. 根據官網的範例定義helloworld.proto ``` syntax = "proto3"; option java_multiple_files = true; option java_package = "io.grpc.examples.helloworld"; option java_outer_classname = "Hel...
PHP
UTF-8
2,270
2.578125
3
[ "BSD-3-Clause" ]
permissive
<?php namespace backend\widget; use yii; use yii\base\InvalidCallException; use yii\base\Widget; use yii\base\Model; use yii\helpers\ArrayHelper; use yii\helpers\Url; use yii\helpers\Html; use yii\helpers\Json; use backend\widget\DateTimeAsset; /** * 日期时间选择控件 */ class DateTimeControl extends Widget { /** * 时间选...
JavaScript
UTF-8
91
2.890625
3
[]
no_license
const a=4; const b=6; let resultado = undefined; resultado = a * b; console.log(resultado);
Java
UTF-8
5,763
2.09375
2
[]
no_license
package co.stayzeal.contact; import java.util.List; import co.stayzeal.contact.R; import co.stayzeal.contact.constant.MyColor; import co.stayzeal.contact.model.CallLogInfo; import co.stayzeal.util.CallLogOperation; import co.stayzeal.util.DateFormatUtil; import android.app.Activity; import android.c...
JavaScript
UTF-8
1,854
2.8125
3
[]
no_license
class Enemigo extends Modelo { constructor(x, y, imagen) { super(imagen, x, y); this.ancho = 40*factorRedimension; this.alto = 40*factorRedimension; } actualizar() { this.animacion.actualizar(); } dibujar() { this.animacion.dibujar(this.x, this.y); } ...
C
UTF-8
3,909
3.375
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <math.h> //#define DEBUG //uncomment this line if you wish to see computing proccess /* Newton-Rapson x0 estimativa inicial f função cuja raiz se deseja encontrar fl derivada de f p precisão da raiz r endereço da variável que receberá a raiz por referência */ int Newton...
Java
UTF-8
1,093
2.21875
2
[]
no_license
package com.kite.reactive.r2dbc.controller; import com.kite.reactive.r2dbc.entity.File; import com.kite.reactive.r2dbc.service.FileService; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; import reactor.core.publisher.Flux; import rea...
JavaScript
UTF-8
1,473
3.921875
4
[]
no_license
//创建节点 function Node(data,left,right){ this.data = data; this.left = left; this.right = right; } Node.prototype.show = function(){ return this.data; } //创建二叉树 function BST(){ this.root = null; } BST.prototype.insert = function(data){ var node = new Node(data,null,null) if(this.root == null){ this....
TypeScript
UTF-8
796
2.59375
3
[]
no_license
export class Patient { patientId: string; bedId: number; name: string; age: number; gender: string; temperatureAlert: boolean; spo2Alert: boolean; pulseRateAlert: boolean; alerts: any; public constructor( patientId: string, bedId: number, name: string, ...
Java
UTF-8
827
2.375
2
[]
no_license
package demo6.impl; import demo6.AnimalService; import demo6.DogService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.context.annotation.S...
Java
UTF-8
387
3.078125
3
[]
no_license
package recusion; public class powerSet { public static void main(String[] args) { String s = "abc"; String curr = ""; System.out.println(find(s, 0, curr)); } public static int find(String s , int i, String curr) { if(i == s.length()) { System.out.println(curr); return i; } else { ...
C++
UTF-8
5,661
3.296875
3
[]
no_license
#ifndef PQALGO_BSTREE_H #define PQALGO_BSTREE_H #include <iostream> #include "list.h" namespace pqalgo { template <typename K, typename V> struct BSTreeNode { BSTreeNode() : left(nullptr), right(nullptr) {} BSTreeNode(const K& _key, const V& _value) : left(nullptr), right(nullptr), key(_key), value(...
Java
UTF-8
937
2.3125
2
[]
no_license
package com.google.firebase.samples.apps.mlkit.ui.gallery; import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; import java.util.ArrayList; public class GalleryViewModel extends ViewModel { private MutableLiveData<String> mText; private ArrayLis...
PHP
UTF-8
3,205
2.609375
3
[]
no_license
<?php /** * 返回ajax数据 * * @param bool $status * @param string $info * @param array $data */ function ajaxJSON($status=true,$info="OK",$data = array()){ echo json_encode(array("status"=>$status,"msg"=>$info,"dict"=>$data)); exit(0); } global $boxMac , $userMac , $ip; $ip = $_SERVER['REMOTE_ADDR']; //==获...
Swift
UTF-8
476
2.75
3
[]
no_license
// // House.swift // multipleViewControllers // // Created by C4Q on 11/8/18. // Copyright © 2018 C4Q. All rights reserved. // import UIKit class House { var name: String var banner: UIImage var words: String var backgroundColor: UIColor init(name:String,banner:UIImage,words:String,background...
C++
UTF-8
919
3.1875
3
[]
no_license
#include "TextureManager.h" TextureManager::~TextureManager() { for (TextureMap::const_iterator it = textures.begin(); (it != textures.end()); it++) delete it->second; } Texture* TextureManager::getTexture(const std::string& id) { TextureMap::const_iterator it = textures.find(id); if (it == textur...
Python
UTF-8
3,259
3.5625
4
[ "MIT" ]
permissive
import calendar import datetime import requests import json import re class TurkishText(): text = "" l = ['ı', 'ğ', 'ü', 'ş', 'i', 'ö', 'ç'] u = ['I', 'Ğ', 'Ü', 'Ş', 'İ', 'Ö', 'Ç'] def __init__(self, text): self.text = text def upper(self): res = "" for i in self.text: ...
Python
UTF-8
3,950
3.34375
3
[]
no_license
from collections import deque from package import Package from bottle import Bottle class Machine: def process(self, incoming_production_line): print("----------------------") print("Machine {} started working.".format( self.__class__.__name__)) class BottleModulator(Machine): de...
C#
UTF-8
294
2.953125
3
[]
no_license
using System; namespace countTest { class count { static void Main(string[] args) { int sum = 0; for (int i = 0; i < 100000000; i++) { sum += i; } Console.WriteLine(sum); } } }
Java
ISO-8859-1
3,443
2.296875
2
[]
no_license
package atorsoft.libreria.provider; import java.util.HashMap; import android.content.ContentProvider; import android.content.ContentValues; import android.content.UriMatcher; import android.database.Cursor; import android.net.Uri; import android.text.TextUtils; import atorsoft.libreria.database.LibreriaDBHelper; impo...
Python
UTF-8
955
3.328125
3
[]
no_license
# 백준 1003 피보나치 # 다이나믹 프로그래밍 # 실버 3 ############### # version 1 ############### import sys def check_count(number): count_0, count_1 = 1, 0 iter_count = 0 while iter_count < number: tmp = count_0 + count_1 count_0 = count_1 count_1 = tmp iter_count += 1 return count_0...
Python
UTF-8
79
3.34375
3
[]
no_license
print("print Hello!") i=10 while i>=2: if i%2 == 0: print("print",i) i=i-1
C++
UTF-8
1,968
2.65625
3
[]
no_license
#pragma once #include "ServerLib.h" namespace Anarchy { struct EntityState { public: entityid_t NetworkId; prefab_t PrefabId; int HeightLevel; int DimensionId; Vector2i TilePosition; Vector2i TileSize; int Level; std::string Name; float CurrentHealth; float MaxHealth; float CurrentShield; };...
Java
UTF-8
2,127
1.945313
2
[]
no_license
package api.model; /** * Created by yangshiyou on 2017/12/8. */ public class ShareInfo { private int id; private int uid; private int platform; private String platformname; private String content; private String url; private int imageid; private String imageurl; private...
Java
UTF-8
143
2.453125
2
[]
no_license
package com.answer1991.design.factory; public abstract class AbstractCarFactory { public abstract <T extends Car> T createCar(Class<T> c); }
C++
UHC
3,041
2.71875
3
[]
no_license
////////////////////////////////////////////////////////////////////// // // Filename : GCStatusCurrentHP.h // Written By : Reiot // Description : // ////////////////////////////////////////////////////////////////////// #ifndef __GC_STATUS_CURRENT_HP_H__ #define __GC_STATUS_CURRENT_HP_H__ // include files #i...
C#
UTF-8
1,023
2.5625
3
[]
no_license
using Autofac; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; namespace Linked_List { public static class ContainerConfig { public static IContainer Container; public static IContainer Configure() { var builder = new ContainerBuilder(); bu...
C++
UTF-8
5,440
2.8125
3
[]
no_license
#include "TimerQueue.h" #include "Logger.h" #include "Timer.h" #include "EventLoop.h" #include "TimerId.h" #include "Timestamp.h" #include <sys/timerfd.h> #include <unistd.h> #include <string.h> bool operator<(const Timestamp &lhs, const Timestamp &rhs) { return lhs.getSeconds() < rhs.getSeconds(); } static int ...
Go
UTF-8
3,979
2.765625
3
[ "Apache-2.0" ]
permissive
package tools import ( "fmt" "os" "strconv" "strings" "time" "go.uber.org/zap/zapcore" "github.com/paulbellamy/ratecounter" "github.com/spf13/viper" ) func getBlockRangeFromFlag() (out BlockRange, err error) { stringRange := viper.GetString("range") if stringRange == "" { return } rawRanges := string...
Ruby
UTF-8
937
2.515625
3
[]
no_license
# coding: utf-8 module PersonHelper def get_head_icon_url(account_id) end # 根据账户ID获取一个账户 def get_account(account_id) UserAccount.find_by_account_id(account_id) end # 根据刘洋创建时间与现在时间对比,给出留言的时间显示 def get_memory_time(created_time) diff_time = (Time.now - created_time).to_i if diff_time < 36000 ...
Markdown
UTF-8
989
3.15625
3
[]
no_license
# Saussure A "hyper" blog application. A mini-CMS. An application for working with small units of information networked with various metadata - denotations and connotations of terms, examples, exigeses, icons and symbols, synonyms, antonyms, etc. The goal is to allow complex topics to be exposed in a non-linear manner...
Python
UTF-8
1,079
3.5
4
[]
no_license
class User: userListe = [] def __init__(self, kullaciNick, kullaniciPass) -> None: self.kullaniciNick = kullaciNick self.kullaniciPass = kullaniciPass User.ekle(self) @classmethod def ekle(cls, us): cls.userListe.append(us) @classmethod def olustur(cls, strin...
JavaScript
UTF-8
1,765
3.71875
4
[]
no_license
// Un objeto es un elemento que abstarae caracteristicas // o atributos en comun o que guardan relacion let objPersona = { nombre: "Jorge", apellido: "Garnica", edad: 28, peso: 72, casado: false }; // forma 1 de ACCEDER a los atributos console.log(objPersona.nombre); // forma 2 de ACCEDER a los atri...
Python
UTF-8
682
4.3125
4
[]
no_license
# from collections.abc import Iterable # 迭代器的原理介绍,调用__iter__方法后,再调用__next__方法 class TestIterator(object): def __init__(self, x): self.x = x self.count = 0 # 只要重写了__iter__方法就是一个可迭代对象 def __iter__(self): return self def __next__(self): # 每一次for...in都会调用一次__next__方法,获取返回值...
Java
UTF-8
204
1.726563
2
[]
no_license
package com.yuntravel.dao; import org.apache.ibatis.annotations.Param; public interface TypesMapper { String getNameById(@Param("typeId") int typeId); int getId(@Param("expen") Float expen); }
Rust
UTF-8
721
2.65625
3
[ "MIT" ]
permissive
use crate::model::hitogata::Hitogata; use crate::omomuki::{self, Omomuki, Result, Type}; use crate::Tumori; #[derive(Clone, Debug)] pub struct Ganbaru {} pub fn new(omomuki: &Omomuki) -> Option<Box<dyn Tumori>> { match &omomuki.nakami { Type::Suru(suru) => { if suru.doushita.suru == "頑張る" { ...
C++
UTF-8
2,624
3.453125
3
[]
no_license
#include "Statuses.h" /* This page contains all the methods that can be use for the "Status" object */ Status::Status(typeStatus type, char* bodyStatus) : type(type) { std::time_t t = std::time(0); // get time now std::tm* now = std::localtime(&t); int hour = now->tm_hour; int min = now->tm_min; Date tmpDate(n...
Python
UTF-8
3,403
2.78125
3
[]
no_license
#!/usr/bin/python3 #author: Fan Luo import numpy as np import string from collections import Counter import train # train.py # Sigmoid function def sigmoid(z): if(z < -20): return 0 else: return 1 / (1 + np.exp(-z)) def DevelData_preprocess(datafile): with open(datafile, 'r') as d...
PHP
UTF-8
655
2.90625
3
[]
no_license
<?php abstract class Base { private PDO $pdo; private string $config = __DIR__."/data/woo_options.ini"; private array $stmts = []; public function __construct() { $reg = Registry::instance(); $options = parse_ini_file($this->config, true); $conf = new Conf($options['config...
Python
UTF-8
129
2.640625
3
[]
no_license
f = file("D:/obstacle_ESSA_-_Copy.csv") myList = [] for line in f: myList.append(line) print(myList) f.close()
Markdown
UTF-8
1,990
2.609375
3
[]
no_license
# Article L180 Pour les droits d'enregistrement, la taxe de publicité foncière, les droits de timbre, ainsi que les taxes, redevances et autres impositions assimilées, le droit de reprise de l'administration s'exerce jusqu'à l'expiration de la troisième année suivant celle de l'enregistrement d'un acte ou d'une déclar...
C#
UTF-8
465
3.109375
3
[]
no_license
using System; namespace ObserverMode.Implements { public class Account : Interfaces.IObserver<CreditCard> { private float _accountAmount; public Account(float accountAmount) { _accountAmount = accountAmount; } public void Update(object sender, CreditCard e)...
Python
UTF-8
1,227
3.25
3
[]
no_license
# Dan Billmann's demonstration of file mastery import os import pandas # 1. use a for loop to creat n text files folderPath = "/Users/danielbillmann/Dropbox/Developing/python_dev/udemy_py_data/file_work" originFile = "/Users/danielbillmann/Dropbox/Developing/python_dev/udemy_py_data/Space-Separated.txt" for i in rang...
Java
UTF-8
225
1.882813
2
[]
no_license
package com.mlb.game.processor.service; import com.mlb.game.processor.model.PlayerStatsResponse; public interface GameDataService { PlayerStatsResponse getPlayerData(String playerName, String year, String statGroup); }
C
UTF-8
2,893
3.8125
4
[]
no_license
/* * randFromKey.c * * Generates a random input file of specified size using the input characters of a key (usually one generated with keyGen.c) * * Parameters: * [key] [outputFileSize] [outputFile] */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> int keyIdentifier(FILE * ifp,char *inp...
PHP
UTF-8
2,078
2.828125
3
[]
no_license
<?php class Core_DbMapper_Type implements Core_DbMapper_Type_TypeInterface { public static $_loadHandlers = array(); public static $_dumpHandlers = array(); public static $_adapterType = 'string'; public static $_adapterOptions = array(); /** * Cast given value to type required */ p...
Python
UTF-8
219
3
3
[]
no_license
def myinput1(a,b): assert a==b, 'input are not same' def myinput2(a,b): try: assert a==b, 'inputs are not same' except AssertionError as ae: print "Error :",ae myinput1(2,3) #myinput2(2,3)
Markdown
UTF-8
4,635
2.78125
3
[]
no_license
--- jupyter: jupytext: formats: ipynb,md text_representation: extension: .md format_name: markdown format_version: '1.1' jupytext_version: 1.2.2 kernelspec: display_name: Python 3 language: python name: python3 --- ```python import numpy as np import matplotlib.pyplot as...
Java
UTF-8
5,090
2.71875
3
[]
no_license
package com.solution.goncharova.dao; import com.solution.goncharova.entity.Users; import org.jetbrains.annotations.NotNull; import java.sql.*; import java.sql.Connection; public class UsersDao implements DAO<Users, String> { /** * Connection of database. */ @NotNull private Connection connect...
JavaScript
UTF-8
1,551
2.796875
3
[]
no_license
import { tween } from "./tween.js"; async function handleCallback() { const words = [...this.children]; const word = words[this._index]; if (word == null) return; this._index = this._index === (words.length - 1) ? 0 : this._index + 1; const factor = Math.random() * 0.003; const holderElement = this.shad...
Markdown
UTF-8
3,198
3.25
3
[]
no_license
**难度:中等** 在上次打劫完一条街道之后和一圈房屋后,小偷又发现了一个新的可行窃的地区。这个地区只有一个入口,我们称之为“根”。 除了“根”之外,每栋房子有且只有一个“父“房子与之相连。一番侦察之后,聪明的小偷意识到“这个地方的所有房屋的排列类似于一棵二叉树”。 如果两个直接相连的房子在同一天晚上被打劫,房屋将自动报警。 计算在不触动警报的情况下,小偷一晚能够盗取的最高金额。 示例 1: ``` 输入: [3,2,3,null,3,null,1] 3 / \ 2 3 \ \ 3 1 输出: 7 解释: 小偷一晚能够盗取的最高金额 = 3 + 3 + 1 ...
Markdown
UTF-8
1,126
2.75
3
[]
no_license
--- layout: post title: Black Shirt Brewery tagline: date: 2015-01-03 17:47 comments: true published: true categories: [Beer] tags: [] permalink: --- [Off Their Own Backs — Black Shirt Brewing in Denver, Colorado](http://goodbeerhunting.com/blog/2014/11/26/built-off-their-own-backs-black-shirt-brewing-in-denver-colorad...
Java
UTF-8
3,638
3.59375
4
[]
no_license
package lineales.dinamicas; /** * @author */ public class Pila { //TDA de pila dinamica private Nodo tope; //Constructor public Pila(){ this.tope = null; } //Operaciones public boolean apilar(Object elemento){ //Crea un Nodo con el elemento ingresa...
Java
UTF-8
105
1.804688
2
[]
no_license
package Exceptions; public class AttemptingToPlayWithDeltedPlayerException extends RuntimeException { }
JavaScript
UTF-8
2,410
2.671875
3
[]
no_license
function getTrainingRequests(dateFrom, dateTo, orderBy, userId){ $.ajax( { type: 'post', url: 'php/classes/ajax.php', dataType: 'json', data: { dateFrom: dateFrom, dateTo: dateTo, order: orderBy, trainingRequests: userId }, beforeSend: function(b){ $('#trainingSpinner').show(); }, su...
Java
UTF-8
13,659
2.09375
2
[]
no_license
package at.ac.tuwien.sepm.groupphase.backend.unittests.service; import at.ac.tuwien.sepm.groupphase.backend.basetest.TestData; import at.ac.tuwien.sepm.groupphase.backend.entity.ApplicationUser; import at.ac.tuwien.sepm.groupphase.backend.entity.EditedUser; import at.ac.tuwien.sepm.groupphase.backend.entity.Ticket; im...
JavaScript
UTF-8
3,472
3.453125
3
[]
no_license
// JavaScript Document var scene = new THREE.Scene(); //Scene()构造函数创建了一个scene场景,它代表了我们尝试显示的整个3D世界 var camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); //创建camera,在3D图像中它代表viewer在世界上的位置 /*PerspectiveCamera()构造函数有四个参数:1.视野...
Python
UTF-8
1,714
2.84375
3
[]
no_license
import serial import array import threading import time import datetime import os import sys #---------------------------------------------------------------- port = input("COM-Port: ") w = 1 while w: try: ser = serial.Serial("Com" + port,19200,timeout=0) w = 0 except: print("Fehler bei ...
C#
UTF-8
1,904
2.703125
3
[]
no_license
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace WeddingPlanner.Models { public class Wedding { public int WeddingId {get; set;} [Required(ErrorMessage="WedderOne is required.")] [Display(Name="Wedder One: ")] public...
Java
UTF-8
1,334
1.882813
2
[]
no_license
package kredit.web.kiva.model; public class KivaGroupModel { String groupAccNo; String branchCode; String refGrp; Integer mbr; String leaderName; String cbName; Integer cycle; String village; String filter = ""; public String getGroupAccNo() { return groupAccNo; } public void setGroupAccNo(String gro...
Ruby
UTF-8
623
2.515625
3
[]
no_license
require 'time_utils' class ElectricityReading < ActiveRecord::Base cattr_reader :per_page @@per_page = 50 #validates_presence_of :meter, :start_time, :end_time, :electricity_value belongs_to :electricity_upload belongs_to :meter belongs_to :user def validate if(start_time != nil and end_time != ...
Java
UTF-8
516
2.03125
2
[]
no_license
package services.impl; import dao.IVWebsideEveDao; import entity.VWebsideEve; import services.IVWebsideEveServices; public class VWebsideEveServicesImpl implements IVWebsideEveServices{ private IVWebsideEveDao sideeveDao; public void setSideeveDao(IVWebsideEveDao sideeveDao) { this.sideeveDao = side...
C++
UTF-8
2,207
2.921875
3
[]
no_license
#include "stdafx.h" #include <iostream> #include <algorithm> #include <vector> #include <iterator> #include <functional> using namespace std; template<class T> void print(T tmp) { cout << tmp << " "; }; template<class T> class printx : public unary_function<T, void> { public: void operator()(T& x){ cout << x <<...