language
stringclasses
15 values
src_encoding
stringclasses
34 values
length_bytes
int64
6
7.85M
score
float64
1.5
5.69
int_score
int64
2
5
detected_licenses
listlengths
0
160
license_type
stringclasses
2 values
text
stringlengths
9
7.85M
JavaScript
UTF-8
2,988
2.6875
3
[]
no_license
import React, { Component } from 'react'; import Header from '../header'; import SearchPanel from '../search-panel'; import TodoList from '../todo-list'; import AddItemPanel from '../add-item-panel'; import './App.css'; export default class App extends Component { state = { filter: '', text: '', todos:...
Java
UTF-8
1,402
3.03125
3
[]
no_license
package be.ac.umons.stratego.pawn; import be.ac.umons.stratego.board.BaseBoard; import java.io.*; /** * Created by marco on 13/05/15. */ /** * this class contains methods for save the game or load the game */ public class SaveLoad implements Serializable{ /** * Save the board contains in BaseBoard ...
C#
UTF-8
2,015
2.5625
3
[]
no_license
using System; using ForkusHotel.Api.Solution.Persistence; using System.Linq; // ReSharper disable ClassNeverInstantiated.Global namespace ForkusHotel.Api.Solution.ReadModels { internal class BookingQueries : IBookingQueries { private readonly BookingStore _bookingStore; public BookingQueries(B...
Java
UTF-8
720
1.921875
2
[]
no_license
package com.kh.myapp; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.te...
Java
UTF-8
2,530
3.375
3
[]
no_license
import java.util.Scanner; public class Saque { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Digite seu saldo atual: "); Float saldoAtual = sc.nextFloat(); sc.close(); if (saldoAtual <= 500) { Ali aliquota = ne...
C#
UTF-8
1,853
3.5625
4
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _6.Forum_Topics { class Program { static void Main(string[] args) { var dict = new Dictionary<string, List<string>>(); string input = Console.Re...
Python
UTF-8
469
2.84375
3
[]
no_license
import numpy as np sigmoid = lambda z : 1/(1+np.exp(-z)) sigmoid_grad = lambda z : z*(1-z) relu = lambda z: (z>0)*z relu_grad = lambda z : (z>0)*1 softmax = lambda z: np.exp(z)/np.sum(np.exp(z)) softmax_grad = lambda z: z*(1-z) tanh = lambda z : np.tanh(z) tanh_grad = lambda z : 1-z*z activation_dict...
Go
UTF-8
2,069
3.15625
3
[]
no_license
package main import ( "encoding/json" "fmt" "io/ioutil" "log" "net/http" "sort" "strings" "github.com/julienschmidt/httprouter" "github.com/rs/cors" ) var create = func(addr string, handler http.Handler) listener { return &http.Server{Addr: addr, Handler: handler} } type listener interface { ListenAndSer...
Python
UTF-8
1,714
3.296875
3
[]
no_license
from typing import List class Solution: def largestRectangleArea(self, heights: List[int]) -> int: maxarea = 0 hlen = len(heights) height_stack = [0] * hlen index_stack = [0] * hlen stack_index = -1 if hlen == 0: return 0 for i ...
Markdown
UTF-8
3,096
3.1875
3
[ "Apache-2.0" ]
permissive
# `kustomization_resource` Resource Resource to provision JSON encoded Kubernetes manifests as produced by the `kustomization_build` or `kustomization_overlay` data sources on a Kubernetes cluster. Uses client-go dynamic client and uses server side dry runs to determine the Terraform plan for changing a resource. ###...
Python
UTF-8
625
3.15625
3
[]
no_license
import threading cv = threading.Condition() alist = [] def product(): global alist cv.acquire() print('producer acquire lock') for i in range(10): alist.append(i) cv.release() print('producer release lock') def consumer(): cv.acquire() print('consumer acquire lock') while ...
JavaScript
UTF-8
786
2.546875
3
[]
no_license
const { GeneralError } = require("../error/errors"); const handleErrors = (err, req, res, next) => { if (err instanceof GeneralError) { const errCode = err.getCode(); return res.status(errCode).json({ status: errCode, errorCode: nameToErrorCode(err) }); } return res.status(500).json({ ...
C#
UTF-8
1,747
3.953125
4
[]
no_license
/* Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note that your returned answers (both index1 and index2) are not zero-based...
Python
UTF-8
155
2.828125
3
[]
no_license
#ugugdsun toog palendrom esehiig shalga a = input("vvedite chislo: ") c = a[::-1] if a==c: print("palendrome") else: print("palendrome bish")
Python
UTF-8
2,301
2.984375
3
[]
no_license
from Ports.abstractPort import abstractPort import random # Ein Dummy Port, der random Analog Inputs generiert. class DummyAnalogInputPort(abstractPort): description = "Ein Analoger Dummy Port, der zufällig Integer zwischen den beiden angegebenen Zahlen generiert." options = { "randomSeed": { ...
C++
UTF-8
2,555
2.78125
3
[]
no_license
#include <pigpio.h> #ifndef __cplusplus extern "C++" { #endif //#ifdef __cplusplus #include "SG90.h" #include <cmath> const double minAngle = -90.0; const double maxAngle = 90.0; const double angleRange = 180.0; // Degrees the servo is able to move const unsigned int operatingFreq = 50; const double realMaxDuty = PI_HW...
Java
UTF-8
320
2.8125
3
[]
no_license
package PracaDomowa2701; public class NajwiekszyWspolnyDzielnik { public static void main(String[] args) { int n = 21; int k = 7; while (n != k){ if (n > k) n -= k; else k -= n; } System.out.println("NWD "+n); } }
Java
UTF-8
1,175
2
2
[ "Apache-2.0", "LicenseRef-scancode-proprietary-license" ]
permissive
/* * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
Java
UTF-8
8,629
1.9375
2
[]
no_license
package network; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.util.ArrayList; import java.util.Properties; import network.Protocols; import network.Confi...
Java
UTF-8
4,758
2.09375
2
[]
no_license
package com.gxz.sys.controller; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody...
TypeScript
UTF-8
689
2.640625
3
[ "MIT" ]
permissive
import { expect, should } from 'chai'; should(); import { unescape } from '../unescape'; describe('unescape()', () => { it('should replace `&colon;` with `:` in given string', () => { unescape('hellow &colon; world').should.equal('hellow : world'); }); it('should replace `&#number;` with the respective ch...
Java
UTF-8
1,809
3.03125
3
[]
no_license
package model; import org.joda.time.IllegalFieldValueException; import org.joda.time.LocalDate; import org.joda.time.Years; import exceptions.BadAgumentsException; import pattern.Person; public class Employee extends Person { private String job; private Integer salary; private LocalDate start; private LocalDat...
Java
UTF-8
554
2.65625
3
[ "Apache-2.0" ]
permissive
package org.ovirt.engine.core.utils; import java.util.function.Supplier; /** * This is similar to Google's Suppliers#MemoizingSupplier but is not thread-safe */ public class MemoizingSupplier<T> implements Supplier<T> { private final Supplier<T> delegate; private boolean initialized; private T value; ...
C++
UTF-8
127
2.625
3
[]
no_license
#include <iostream> int main() { int a=1; int db=0; while (a!=0) { a<<=1; ++db; } std::cout<<db<<std::endl; }
Java
UTF-8
259
1.78125
2
[]
no_license
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package joliex.java; /** * * @author balint */ public class formatExeption extends Exception { public formatExeption() { super("Error"); } }
Markdown
UTF-8
378
2.671875
3
[]
no_license
# Frame A simple loader that is able to load in-memory dlls. # Usage ```C #include "frame.h" // Loading a dll from memory. pvDll being the in-memory dll. HMODULE hDll = FRAME_LoadLibrary(pvDll); // Getting the address of an exported function from the loaded dll. FARPROC pfnProc = FRAME_GetProcAddress(hDll, "Functio...
C
UTF-8
2,088
3.265625
3
[]
no_license
#include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/times.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> void handler(int sig) { printf("Odebralem sygnal %d\tPID: %d\n", sig, getpid()); } int main(int argc, char* argv[]) { if (argc < 2) { p...
Java
UTF-8
2,634
2.515625
3
[]
no_license
package com.makarenko.sqlcmd.commands; import com.makarenko.sqlcmd.model.DatabaseManager; import com.makarenko.sqlcmd.view.Message; import com.makarenko.sqlcmd.view.MessageColor; import org.junit.Before; import org.junit.Test; import static junit.framework.TestCase.*; import static org.mockito.Mockito.mock; import st...
Python
UTF-8
1,009
3.125
3
[]
no_license
def areaforn(r, n): return (n)*(4*r+4*(n-1)+2)/2 def solve(fIn, testNum): line = fIn.readline() (r,t) = (int(x) for x in line.split()) n = 32 ans = False low = 1 high = n mid = (low+high)/2 a = areaforn(r, n) if a<t : print "error" a = areaforn(r, mid) while not ans: if a < t: ...
Markdown
UTF-8
1,620
3.046875
3
[ "MIT" ]
permissive
> Note: Future updates will be committed in a private repository but the live site will stay up-to-date ## Live site :rocket: The live site can be found [here](https://www.shanemaglangit.com/) ## Rebuild locally :hammer: 1. **Install Gatsby CLI** Use the following command to install gatsby-cli. This requires you to...
C#
UTF-8
1,323
2.578125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data.Entity; using System.Data.Entity.ModelConfiguration; using Projeto.Entity.Entities; using System.ComponentModel.DataAnnotations.Schema; namespace Projeto.DAL.Configuration { public...
Java
UTF-8
520
2.875
3
[]
no_license
package Practice; import java.util.Collections; import java.util.Comparator; import java.util.PriorityQueue; /** * Created by intelliswift on 12/16/18. */ public class HeapSortUse { public static void main (String[]args){ PriorityQueue<Integer>p = new PriorityQueue<>(new PriorityQueue<Integer>(Collectio...
PHP
UTF-8
432
3.9375
4
[]
no_license
<?php //Code to calculate a number of days between any two dates function calcDays($sdate, $edate) { $diff = abs($edate-$sdate); $days = $diff/(60*60*24); return $days; } $sdate = '1997-09-24'; $edate = '2021-01-01'; $sdate = strtotime($sdate); $edate = strtotime...
Python
UTF-8
572
2.9375
3
[]
no_license
import numpy as np import pandas as pd import matplotlib.pyplot as plt data = pd.read_csv("Position_Salaries.csv") X = data.iloc[:, 1:2].values Y = data.iloc[:, 2].values from sklearn.tree import DecisionTreeRegressor reg = DecisionTreeRegressor(random_state=0) reg.fit(X,Y) ypred= reg.predict(X) #print(ypred) #pl...
JavaScript
UTF-8
4,236
3.0625
3
[]
no_license
var toDoList = angular.module("toDoList", []); toDoList.controller('mainController', ['$scope', function ($scope) { $scope.item = { id: "", value: "", isComplete: false, editing: false }; // Initializing a empty object /* * Setting the default value of the item-conta...
Java
UTF-8
13,444
1.984375
2
[]
no_license
package com.liftindia.app.caldroid; import android.content.Context; import android.content.res.Resources; import android.graphics.Color; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextVie...
Python
UTF-8
2,689
3.171875
3
[]
no_license
get_ipython().magic('matplotlib notebook') import matplotlib.pyplot as plt import pandas as pd import numpy as np from calendar import month_abbr def get_data(): df = pd.read_csv('data/C2A2_data/BinnedCsvs_d400/fb441e62df2d58994928907a91895ec62c2c42e6cd075c2700843b89.csv') df['Data_Value'] = df['Data_Value']...
Java
UTF-8
967
1.929688
2
[]
no_license
package com.example.leaderboard; import android.os.Bundle; import android.view.View; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; public class SubmitActivity extends AppCompatActivity { private Toolbar toolbar2; @Override protected void onCreate(Bundle saved...
Python
UTF-8
197
3.40625
3
[]
no_license
jari_jari = input("Masukkan nilai: ") jari_jari = int(jari_jari) rumus = (jari_jari*jari_jari*22/7) print("Luas lingkaran dengan jari-jari ",jari_jari, "cm adalah {0:.2f} cm\u00b2.".format(rumus))
Markdown
UTF-8
2,061
2.59375
3
[]
no_license
# Qt4.8.6-my-modified-version 自用修改版Qt4.8.6 #QtCore 主要对QObject::connect进行修改 enum ConnectionType { AutoConnection, DirectConnection, QueuedConnection, AutoCompatConnection, BlockingQueuedConnection, ParallelBlockingQueuedConnection, //like Block...
PHP
UTF-8
822
2.5625
3
[ "Apache-2.0" ]
permissive
<?php namespace Craft; /** * The class name is the UTC timestamp in the format of mYYMMDD_HHMMSS_migrationName */ class m141126_000001_user_week_start_day extends BaseMigration { /** * Any migration code in here is wrapped inside of a transaction. * * @return bool */ public function safeUp() { Craft::lo...
Python
UTF-8
1,491
2.9375
3
[]
no_license
import face_recognition from PIL import Image, ImageDraw image_of_me = face_recognition.load_image_file('img/known/Dimitris_Pallas.jpg') dimitris_face_encoding = face_recognition.face_encodings(image_of_me)[0] # Create and array of encodings and names known_face_encoding = [ dimitris_face_encoding ] known_face_...
Java
UTF-8
1,176
2.0625
2
[]
no_license
/** * */ package com.zappos.rest; import java.util.List; import com.google.gson.Gson; import com.zappos.domain.ProductResponse; import com.zappos.domain.SearchResponse; import com.zappos.restconnector.WebServiceConnector; import com.zappos.util.PropertiesHandler; /** * @author satyaswaroop * */ public class Re...
Python
UTF-8
919
3.015625
3
[]
no_license
import numpy as np from utils import SkillType, BaseAttr, DynamicAttr class Skill: def __init__(self): self.type = SkillType.getRandomType() self.attr = DynamicAttr.getRandomType(4) self.target = DynamicAttr.getRandomType(3) self.ratio = np.random.randint(2,10) / 100.0 class Per...
Python
UTF-8
1,435
3.328125
3
[]
no_license
import sys sys.stdin = open("1208.txt", "r") # 버블 정렬 # 카운팅 정렬 def my_max(): max_height = box_height[0] max_index = 0 # 초기값 index 0인 첫번째 값, 인덱스는 0 설정 for i in range(len(box_height)): if box_height[i] > max_height: max_height = box_height[i] max_index = i return max_i...
JavaScript
UTF-8
1,595
2.765625
3
[]
no_license
function assertCSTTZ() { // NOTE: Verify that we are not sproofing Time Zone, as the rest call depends // on locale. UTC doesn't make sense here as we need local time var timeZoneOffset = - ( (new Date()).getTimezoneOffset() / 60 ); if ( timeZoneOffset !== 8 ) { console.error(`* Error: Time...
Ruby
UTF-8
279
3.265625
3
[]
no_license
unsorted_array = [5, 3, 42, 398, 28, 2, 20, 5, 2, 0, -20, 4] class Array def quicksort return self if size <= 1 pivot = self.sample left_array select{|x| x < pivot}.quicksort + [pivot] + select{|x| x > pivot}.quicksort end end puts unsorted_array.quicksort
Python
UTF-8
2,138
2.703125
3
[ "MIT" ]
permissive
from discord import Embed, ChannelType from discord.ext import commands config_file = 'extensions/inquisition_channel_id.txt' class Inquisition(commands.Cog): """Runs the Inquisition channel.""" def __init__(self, bot, channel_id): self.bot = bot self.channel = bot.get_channel(channel_id) ...
Java
UTF-8
2,473
2.375
2
[]
no_license
package connectEchoNest; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.List; public class dbHandler { static String URL = "jdbc:mysql://" + "127.0.0.1:8889/exercise_myp?useUnicode=true&characterEnco...
SQL
UTF-8
10,040
3.09375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Hôte : 127.0.0.1:3306 -- Généré le : mer. 24 juil. 2019 à 18:06 -- Version du serveur : 5.7.23 -- Version de PHP : 7.2.10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 S...
C
UTF-8
1,157
3.75
4
[]
no_license
/** * generate.c * * Generates pseudorandom numbers in [0,MAX), one per line. * * Usage: generate n [s] * * where n is number of pseudorandom numbers to print * and s is an optional seed */ #define _XOPEN_SOURCE #include <cs50.h> #include <stdio.h> #include <stdlib.h> #include <time.h> // upper limit on ran...
Java
UTF-8
5,911
1.546875
2
[]
no_license
package com.arteriatech.emami.mbo; import java.io.Serializable; /** * Created by e10526 on 06-07-2018. */ public class InvoiceCreateBean implements Serializable { String CPNo = ""; String PaymentModeID = ""; String CPGUID32 = ""; String ParentTypeID = ""; String ParentName = ""; String comi...
Markdown
UTF-8
1,470
2.6875
3
[]
no_license
# Note * Here we are using EC2 and Route53. * NS and SOA records will be present by default. ## Simple Routing Policy * One record with multiple IPs. 1. Note down the IPs of the EC2 instances you wish to use. 2. Goto Services > Route53 > Hosted Zones > Create Record 3. Select Simple routing 4. Configur...
PHP
UTF-8
1,750
3.4375
3
[]
no_license
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <h1> Coding exercise </h1> <p>In the following example, we will create an abstract ...
JavaScript
UTF-8
1,300
4.125
4
[]
no_license
/** * 寄生式继承 继承原型 * 传递参数 subClass 子类 * 传递参数 superClass 父类 */ function inheritObject(o){ //声明一个过渡函数 function F(){} //过渡对象的原型继承父对象 F.prototype = o; return new F(); } function inheritPrototype(subClass,superClass){ //复制一份父类的原型副本保存在变量 var p = inheritObject(superClass.prototype); //修正因为重写子类原型导致子类的constructor指向父类 ...
Java
UTF-8
479
2.46875
2
[]
no_license
import javax.swing.JFrame; public class ApplicationMain extends JFrame { public ApplicationMain(){ AsciiPanel panel = new AsciiPanel(80, 24); add(panel); GuiController gui = new GuiController(panel, new PlayerController(null)); addKeyListener(gui); gui.startScreen(); ...
Java
UTF-8
1,327
2.671875
3
[]
no_license
import java.awt.Color; import java.awt.Font; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTable; public class RegistrationComplete extends GUIDesign { JLabel stringLabel; String[] columns = { "Course Code", "Title", "...
C
UHC
2,361
4
4
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <time.h> // 丮 ϱ int factorial(int n) { if (n <= 1) return 1; else return n * factorial(n - 1); } // x n ϱ double power(int x, int n) { if (n == 0) return 1; else return (double)x * (double)power(x, n - 1); } // Ǻġ ϱ int fibonacci(int n) { if (n < 2) re...
Python
UTF-8
1,805
3
3
[]
no_license
''' find underrated businesses - have a low average review, but only because reviewers of that business tended to be harsher critics ''' from objects import * from networkx import * from helpers import * import load_data import re def run(): businesses = load_data.load_objects("business") users = load_d...
Python
UTF-8
1,005
4.0625
4
[]
no_license
# 给定一个序列[1, 2, 3, ... , n],其长度为n(n为1至9),给定一个数k(k为1至n!),输出该序列全排列中的第k个序列 # Input: n = 4, k = 9 # Output: 2314 # 思路: # 首位数每个数字重复次数为(n - 1)! # 第二位数每个数字重复次数为(n - 2)! # ...... # 末位数字每个数字重复次数为1 # 用除法和取余操作上述步骤,放弃减法和乘法!!! import math class Solution: def getPermutation(self, n, k): fact = [1] * n nums = [x...
PHP
UTF-8
3,083
2.59375
3
[]
no_license
<?php class Admin_model extends CI_Model{ public function can_login($email, $password) { $this->db->where('email', $email); $this->db->where('password', $password); $query = $this->db->get('users'); if($query->num_rows() > 0) ...
C#
UTF-8
517
2.515625
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; public class Session { private static Session _instance = null; public static Session Instance { get { if (_instance == null) _instance = new Session(); return _i...
Java
UTF-8
1,309
2.984375
3
[]
no_license
package com.hrms.practice; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.List; import org.junit.Test; public class JdbsTask1Way2 { // retrieve all data, store in array list ...
JavaScript
UTF-8
4,673
2.59375
3
[]
no_license
/** * Bootstrap * (sails.config.bootstrap) * * An asynchronous bootstrap function that runs just before your Sails app gets lifted. * > Need more flexibility? You can also do this by creating a hook. * * For more information on bootstrapping your app, check out: * https://sailsjs.com/config/bootstrap */ modu...
Python
UTF-8
4,556
2.953125
3
[ "BSD-3-Clause", "CC-BY-4.0" ]
permissive
# SPDX-FileCopyrightText: 2021 Lukas Schrangl <lukas.schrangl@tuwien.ac.at> # # SPDX-License-Identifier: BSD-3-Clause import math from typing import Optional, Union from PyQt5 import QtCore, QtGui, QtQml, QtQuick import numpy as np class PyImage(QtQuick.QQuickPaintedItem): """QtQuick item that displays an image...
Python
UTF-8
749
2.921875
3
[]
no_license
from threading import current_thread class CurrentRequest(object): ''' get_request can also be staticmethod ''' _request_dict = {} @classmethod def get_request(cls): try: return cls._request_dict[current_thread()] except KeyError: return None def p...
PHP
UTF-8
1,868
3.09375
3
[]
no_license
<?php class user { /* CREATE TABLE IF NOT EXISTS user ( id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, name VARCHAR(390) NOT NULL, pass VARCHAR(390) NOT NULL, register VARCHAR(390) NOT NULL, role ENUM("watcher", "writer", "wizard")) */ public ...
TypeScript
UTF-8
4,910
3.015625
3
[ "ISC" ]
permissive
declare var require; export class DateUtilities { public static locale = require('../locale/en.json');; public static loadLocale(locale): void { this.locale = locale; //this.locale = require("i18n!./locale/ru.json"); // this.locale = require('bundle?name=[path][name].[ext]!./locale/' ...
Java
UTF-8
1,055
2.4375
2
[]
no_license
package com.example.barungsofthomehwrk.repository.customer; import com.example.barungsofthomehwrk.model.Customer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import java.util.List; @Repository public class CustomerRepositoryImpl implements CustomerR...
PHP
UTF-8
1,901
2.90625
3
[]
no_license
<?php namespace UACapabilities; use Symfony\Component\Yaml\Yaml; class Translator { private $yamlParser; public function __construct() { $this->yamlParser = new Yaml(); } public function translate($yamlRegexData) { $data = $this->yamlParser->parse($yamlRegexData); ...
C
UTF-8
1,820
4.03125
4
[]
no_license
// 피보나치 검색 // 정렬된 데이터에서 피보나치(Fibonacci) 수열을 이용하는 방법. 피보나치수열이란 F(0) = 0, F(1) = 1, (F2) = F(0) + F(1), ... , F(i) = F(i-2)+F(i-1) // 즉 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... /* [검색 순서] (1) fiboNum[k]<n을 만족하는 가장 큰 k를 구한다. (2) 비교위치(pos) = index + fiboNum[--k] //index 초기값은 0 (3) pos 위치에 찾을 값이 있으면 완료 (4) pos가 찾을 범위를 벗...
Python
UTF-8
668
3.328125
3
[]
no_license
class Solution: """ 1. j starts from 1 2. whenever does a write at j, move j to the next """ def compress(self, chars: List[str]) -> int: count, j = 0, 1 for i, c in enumerate(chars): if i > 0 and c != chars[i - 1]: if count > 1: ...
JavaScript
UTF-8
986
2.640625
3
[]
no_license
'use strict' var sentence = require('./sentence'); var maths = require('./maths.js'); var request = require('request'); var http = require('http'); var md5 = require('md5'); var server = http.createServer(function(req, res){ var params = req.url.split('/'); var operatorID = params[1]; // console.log('params:'...
Java
UTF-8
9,262
2.03125
2
[]
no_license
package com.example.sina.specificcontact; import android.app.ActivityOptions; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Color; import android.graphics.Typeface; import android.graphics.drawable.ColorDrawable...
PHP
UTF-8
1,558
2.78125
3
[ "Apache-2.0" ]
permissive
<?php /** * This file is part of amfPHP * * LICENSE * * This source file is subject to the license that is bundled * with this package in the file license.txt. * @package Amfphp__BackOffice_ClientGenerator * */ /** * loads the generators * * @author Ariel Sommeria-klein * @package Amfphp__BackOffice_C...
C++
UTF-8
8,925
2.859375
3
[]
no_license
// #include <SoftwareSerial.h> #include <FastLED.h> #define NUM_LEDS 398 #define NUM_BARNACLES 43 #define NUM_SENSORS 7 #define DATA_PIN 13 #define BRIGHTNESS 255 #define FRAMES_PER_SECOND 50 CRGB leds[NUM_LEDS]; class Barnacle { public: int type; // sm = 1, md = 2, lg = 3 int center; ...
Markdown
UTF-8
2,441
2.546875
3
[]
no_license
# 科学网—某大学勤工助学岗位每人每天15元 - 徐传胜的博文 # 某大学勤工助学岗位每人每天15元 已有 1814 次阅读2013-9-25 18:01|系统分类:[生活其它](http://blog.sciencenet.cn/home.php?mod=space&do=blog&view=all&uid=542302&catid=4)|关键词:大学|[大学](misc.php?mod=tag&id=270) 2013年“国庆节”校内勤工助学工作安排通知 各单位: 根据我校实际,现将“国庆节”期间校内勤工助学工作安排事宜通知如下: **一、岗位设置数...
Java
UTF-8
1,069
3.21875
3
[]
no_license
/* package whatever; // don't place package name! */ import java.util.regex.*; /* Name of the class has to be "Main" only if the class is public. */ class Ideone { public static void main (String[] args) throws java.lang.Exception { String text = "#include<stdio.h>\n#comment\nnot comment yet # now comment" + ...
Python
UTF-8
489
2.6875
3
[]
no_license
import unittest from json_to_html import json_to_html class TestJsonToHtmlConverter(unittest.TestCase): def test(self): data = {"p.my-class#my-id": "hello", "p.my-class1.my-class2": "example<a>asd</a>"} example = json_to_html() data = json_to_html.list_checking(data) self.assertE...
SQL
UTF-8
1,327
3.640625
4
[]
no_license
Use ADPPCTU2012 -- create temp table create table #ManagerList( Tnum varchar (6), UserID int, Tman varchar (6), ManID Int, Mion varchar (200), CID int) Insert into #ManagerList (Tnum,Tman) SELECT [T Number], SUBSTRING(Manager, CHARINDEX('=', Manager) + 1, CHARINDEX(',', Manager) - CHARINDEX('=', M...
C#
UTF-8
3,329
2.75
3
[]
no_license
using AutoMapper; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using WeatherApi.Dto; using WeatherApi.Entity; using WeatherApi.Models; namespace WeatherApi.Controlle...
PHP
UTF-8
9,754
2.6875
3
[ "MIT" ]
permissive
<?php /** * @package StartupAPI * @subpackage Subscriptions */ require_once(__DIR__ . '/Account.php'); require_once(__DIR__ . '/StartupAPIModule.php'); /** * Abstract class representing payment engines users can use to pay for subscription */ abstract class PaymentEngine extends StartupAPIModule { /** * @var...
Java
UTF-8
2,747
2.8125
3
[]
no_license
package test.traffic; import com.hokageinc.models.Orbit; import com.hokageinc.models.Place; import com.hokageinc.models.Vehicle; import com.hokageinc.traffic.MinimumTimeTracker; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; public class MinimumTimeTrackerTest {...
Python
UTF-8
1,670
2.671875
3
[]
no_license
# -*- coding:utf8 -*- from myGlobal.myCls.BrokerCls import Broker from myGlobal.myCls.Stock import Stock from myGlobal.myCls.msql import DBHelper from multiprocessing.dummy import Pool as ThreadPool from functools import partial import myGlobal.myTime as myTime import datetime from myGlobal.myCls.multiProcess import t...
Java
UTF-8
2,953
2.8125
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 grabdatafromdb.megamillions; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; i...
TypeScript
UTF-8
2,092
2.671875
3
[]
no_license
import { createAsyncThunk, createSlice } from "@reduxjs/toolkit"; import { CREW_OPEN_CHANGE, API_KEY } from "../constants"; const initialState = { isCrewOpen: false, fetchingFilm: false, data: { info: {}, people: [], known: [], images: [], }, }; interface InputsType { selectedMovie: any; la...
Python
UTF-8
327
4.75
5
[]
no_license
''' Write a script that prints out all the squares of numbers from a user inputed lower to a user inputed upper bound. Use a for loop that demonstrates the use of the range function. ''' lower = int(input("type a number ")) upper = int(input ("type a higher number ")) + 1 for num in range(lower, upper): print(nu...
JavaScript
UTF-8
2,291
3.25
3
[]
no_license
const fs = require('fs'); const input = fs.readFileSync('input', 'utf8'); const IntcodeComputer = require('../shared/IntcodeComputer'); const program = input.split(',').map(Number); const droid = new IntcodeComputer(program); const map = {}; const pathStack = []; const getKey = (x, y) => `${x}.${y}`; const setTile ...
C++
UTF-8
987
2.703125
3
[]
no_license
// Ball.h /* #pragma once should always be at the top of your header files * it prevents other headers like "ofMain.h" from being included more than once in your app * (note that ofMain.h is also included in ofApp.h) */ #pragma once #include "ofMain.h" // ofMain.h lets our Ball "see" openFrameworks #include "Bu...
C#
UTF-8
1,810
2.890625
3
[ "MIT" ]
permissive
using System.Collections.Generic; using System.Linq; using System.Reflection; namespace Futuclass.EventBus { internal static class HandlerFinder { internal static MethodInfo[] GetPublicInstanceMethods(object eventProxy) { var proxyType = eventProxy.GetType(); return pr...
Ruby
UTF-8
3,893
2.90625
3
[ "LicenseRef-scancode-generic-cla", "BSD-3-Clause" ]
permissive
require 'spec_helper_min' require 'minitest/autorun' require_relative '../../../structures/collection' include DataRepository describe Collection do before do @repository = DataRepository::Repository.new @dummy_class = Class.new do attr_accessor :id def initialize(arguments={}); self.id = argume...
C#
UTF-8
1,522
2.6875
3
[ "MIT" ]
permissive
using Faturamento.Api.Infra; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Faturamento.Api.Dominio.Comandos { public class CriarPedidoComando { public CriarPedidoComando(string processoId, int socioId, List<Item> itens) { ProcessoId = ...
Python
UTF-8
373
2.5625
3
[ "BSD-2-Clause" ]
permissive
try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest from django.template import Library register = Library() @register.filter def slice(items, group_size=1): args = [iter(items)] * group_size return (filter(None, group) ...
Java
UTF-8
6,055
1.8125
2
[]
no_license
package com.megvii.meglive_sdk.volley.toolbox; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.widget.ImageView; import com.megvii.meglive_sdk.volley.AbstractC1628m; import com.megvii.meglive_sdk.volley.C1620e; import com.megvii.meglive_sdk.volley.C1625j; import com.megvii.meglive...
Java
UTF-8
3,476
1.992188
2
[]
no_license
package online.kingdomkeys.kingdomkeys.client.render.entity; import javax.annotation.Nullable; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.rend...
C++
UTF-8
1,372
2.671875
3
[]
no_license
#include<bits/stdc++.h> #define ll long long int using namespace std; int main() { int t; cin>>t; for(int i=1;i<=t;i++) { stack<string>backward; stack<string>forward; string current="http://www.lightoj.com/"; string s; printf("Case %d:\n",...
PHP
UTF-8
2,278
2.84375
3
[ "MIT" ]
permissive
<?php namespace lajax\translatemanager\services; use yii\helpers\Console; use lajax\translatemanager\services\Scanner; use lajax\translatemanager\models\LanguageSource; /** * Optimizer class for optimizing database tables * * @author Lajos Molnár <lajax.m@gmail.com> * @since 1.0 */ class Optimizer { /** ...
JavaScript
UTF-8
1,417
2.734375
3
[]
no_license
const initState={ posts:[], post:null } const getPostsReducer=(state=initState,action)=>{ switch(action.type){ case "GET_POSTS": return{ ...state, posts:action.posts } case "GET_POST": return{ ...state, ...
Java
GB18030
71,452
2.734375
3
[]
no_license
package strategy9Enhance; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.List; impo...
Ruby
UTF-8
5,330
3.046875
3
[]
no_license
# frozen_string_literal: true require 'pry' require_relative '../paragraph_parser' RSpec.describe ParagraphParser do let(:paragraph) do <<~PGH Cupcake ipsum dolor sit amet. Soufflé liquorice pastry pie croissant soufflé jelly. Halvah croissant gummi bears. Jelly beans cake liquorice apple pie. Lemon drops...