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
3,725
2.53125
3
[]
no_license
import React, { useState } from "react"; import Alert from "react-bootstrap/Alert"; import Form from "react-bootstrap/Form"; import Button from "react-bootstrap/Button"; import DropdownButton from "react-bootstrap/DropdownButton"; import Dropdown from "react-bootstrap/Dropdown"; import "./Signup.css"; export default f...
Python
UTF-8
351
3.28125
3
[]
no_license
from collections import Counter def company_logo(string_): return sorted(Counter(string_).most_common(), key = lambda x: (-x[1], x[0]))[:3] if __name__ == '__main__': string_ = input() orded_s = company_logo(string_) print('\n'.join([letter_count[0]+ ' '+ str(letter_count[1])...
TypeScript
UTF-8
2,049
2.609375
3
[]
no_license
import { Request, Response } from "express"; import { getMongoRepository } from "typeorm"; import { classToClass } from "class-transformer"; import { ObjectID } from 'mongodb' import { isAfter, isBefore } from "date-fns"; import { User } from "../database/schemas/User"; import { Appointment } from "../database/schemas...
PHP
UTF-8
920
2.53125
3
[ "BSD-3-Clause" ]
permissive
<?php namespace service\tasks\product; use common\helper\EsProductHelper; use common\models\product\Product; use framework\components\ToolsAbstract; use service\tasks\TaskService; /** * @see MQAbstract::MSG_GROUP_SUB_PRODUCT_UPDATE * @package service\mq_processor\product */ class productDeleteProcess extends Task...
Java
UTF-8
469
2.328125
2
[ "MIT" ]
permissive
package remote.client; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import example.SomeApplicationException; @Path("/") public interface IEndpoint { @GET @Path("get/{id}") @Produces(MediaType.TEXT_PLAIN) public Stri...
Python
UTF-8
1,014
4
4
[]
no_license
from sys import argv script, filename = argv print "We're going to erase %r." % filename #let's user know we are erasing filename in this script print "If you don't want that, hit CTRL-C (^C)." #gives directions to not delete filename print "If you do want that, hit RETURN." #gives directions to delete filename...
Python
UTF-8
1,165
4.28125
4
[]
no_license
# p108 Computer Projects 1 p = int(input('Input the truth value of p : ')) q = int(input('Input the truth value of q : ')) def conjunction(p, q): if p == 1 and q == 1: print('The truth value of conjunction of p & q is : true') else: print('The truth value of conjunction of p & q is : false') def d...
Java
UTF-8
10,194
2.609375
3
[]
no_license
// specify the package package userinterface; // system imports import javafx.event.Event; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.Button; i...
Java
UTF-8
10,773
1.789063
2
[]
no_license
package com.ffcs.inapppaylib; class PayHelper$2 { void a() { int a; a=0;// .class Lcom/ffcs/inapppaylib/PayHelper$2; a=0;// .super Lcom/lidroid/xutils/http/callback/RequestCallBack; a=0;// .source "PayHelper.java" a=0;// a=0;// a=0;// # annotations a=0;// .annotation system Ldalvik/annotation/EnclosingMethod; a=0;// ...
C++
UTF-8
562
2.734375
3
[]
no_license
#include "ElseIfStatementList.h" void ElseIfStatementList::prependElseIfStm(ConditionExpression* condition, CompoundStatement* body) { mElseStatements.push_front(ElseStm(condition, body)); } void ElseIfStatementList::appendElseIfStm(ConditionExpression* condition, CompoundStatement* body) { mElseStatements.push_bac...
JavaScript
UTF-8
2,405
3.953125
4
[]
no_license
var cards = ["jack", "ace", "queen", "king", "ace", "king", "queen", "jack"]; var cardsInPlay = []; function isTwoCards(){ // add card to array of cards in play // 'this' hasn't been covered in this prework, but // for now, just know it gives you access to the card the user clicked on var card = this.getAttrib...
Python
UTF-8
277
2.765625
3
[]
no_license
import sys from itertools import combinations while True: c, n = map(int, raw_input().split()) if c == n == 0: break # sum(cC3) == 9 count = 0 for i in combinations(range(1, c + 1),3): if sum(i) == n: count += 1 print count
SQL
UTF-8
12,370
3.09375
3
[ "Apache-2.0" ]
permissive
-- MySQL dump 10.13 Distrib 5.7.19, for Linux (x86_64) -- -- Host: localhost Database: weilai -- ------------------------------------------------------ -- Server version 5.7.19-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET...
Markdown
UTF-8
3,505
3.078125
3
[ "MIT" ]
permissive
### Generic Event Parser This project is a Google Dataflow pipeline that process generic JSON messages from Google PubSub or Apache Kafka and writes it parsed to Google BigQuery. #### How does it work? The pipeline will read JSON messages. The expected format is something like: ```json { "Id": "an-ulid-string", ...
PHP
UTF-8
1,735
2.53125
3
[]
no_license
<?php /** * This file is part of the github-api-test package. * * (c) Mátyás Somfai <somfai.matyas@gmail.com> * Created at 2016.09.09. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace AppBundle\Command; use Github\Api\R...
Java
UTF-8
833
2.234375
2
[]
no_license
package com.onlinehocam.ozel.ders.okul; class Comment { String questionClass; String questionLesson; String studentName; String tutorName; String commentText; int studentID; int tutorUserID; int questionRequestID; double rating; public Comment(String questionClass, String quest...
JavaScript
UTF-8
763
2.734375
3
[]
no_license
// for the user const jwt = require('jsonwebtoken') const { JWT_SECRET, JWT_EXP } = process.env const createToken = async (data) => { try { let payload={ _id: data.id, email: data.email, userName: data.userName } const token = await jwt.sign({ data: payload},JWT_...
JavaScript
UTF-8
864
2.71875
3
[]
no_license
import {templFooter} from '../templates/footer.js' function main () { const btn = document.querySelector('#b_acceder') if(btn){ btn.addEventListener('click', onClick) } document.querySelector('footer').innerHTML = templFooter function onClick () { const formLogin = document...
C#
UTF-8
540
2.59375
3
[]
no_license
var sharedItem = await graphClient.Drives[driveId].Items[folderItemId].Request().Expand(i => i.Children).GetAsync(); foreach (var item in sharedItem.Children) { if (item.File != null) { var fileContent = await graphClient.Drives[item.ParentReference.DriveId].Items[item.Id].Conten...
Java
UTF-8
1,704
1.976563
2
[]
no_license
package com.example.bilgideposu.Aktiviteler; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.Toast; import com.example.bilgideposu.R; public class Sorular extends AppCompatActivity { private Button buttonBa...
Java
UTF-8
5,688
1.90625
2
[]
no_license
package comp6231.shared; public class Constants { public static final String NULL_STRING = "Null String"; public static final String DILIMITER_STRING = "*%#$@#!"; public static final String ONE_WAY = "ONE WAY MESSAGE"; //IP CONFIG public static final String LOCAL_IP = "127.0.0.1"; // public static final Strin...
Java
UTF-8
1,433
2.75
3
[]
no_license
package me.service.Impl; import com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException; import me.dao.impl.DBConnectionImpl; import me.domain.ErrorMess; import me.service.IModifyCourseNameService; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java...
Java
UTF-8
1,223
2.359375
2
[]
no_license
package elte.softwaretechnology.stockprices.collectors; import elte.softwaretechnology.exceptions.NotImplementedException; import elte.softwaretechnology.stockprices.collectors.implementations.NewYorkTimesDataCollector; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env....
C++
UTF-8
6,065
3.625
4
[]
no_license
template<typename ItemType> DoublyLinkedList<ItemType>::DoublyLinkedList() : current_size_{0}, head_{nullptr}, tail_{nullptr} {} template<typename ItemType> DoublyLinkedList<ItemType>::DoublyLinkedList(const DoublyLinkedList<ItemType> &old_list) { current_size_ = old_list.getSize(); head_ = new DoubleNode<Item...
Shell
UTF-8
2,828
3.5
4
[ "MIT" ]
permissive
#!/bin/bash set -e input=$1 lowerInput=$(echo $input | tr "[A-Z]" "[a-z]") mkdir src/components/${input} mkdir src/components/${input}/__test__ mkdir src/components/${input}/stories touch src/components/${input}/index.ts touch src/components/${input}/${input}.tsx touch src/components/${input}/README.md touch src/co...
PHP
UTF-8
909
2.640625
3
[ "MIT" ]
permissive
<?php declare(strict_types=1); namespace WayOfDev\RQL\Bridge\Cycle\Criteria; use Cycle\ORM\Select; use WayOfDev\RQL\Bridge\Cycle\Exceptions\ValidationException; use WayOfDev\RQL\Requests\Components\OrderBy as Order; use function preg_match; final class OrderBy implements CriteriaInterface { private const ALLOW...
Java
UTF-8
2,882
2.078125
2
[ "Apache-2.0" ]
permissive
/** * (C) Copyright IBM Corp. 2006, 2012 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Eclipse Public License from ...
Java
UTF-8
17,681
1.671875
2
[]
no_license
package com.sourcetrace.eses.adapter.core; import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import javax.activation.DataHandler; import org.apache.commons.codec.binary.Base64; import org.apache.commo...
Java
UTF-8
4,235
1.976563
2
[]
no_license
package cn.com.infosec.netseal.webserver.controller.monitor; import java.lang.management.MemoryUsage; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import javax.servlet.http.HttpServletRequest; import org.hyperic.sigar.SigarException; import org.springframework.beans.fa...
Shell
UTF-8
1,556
3.71875
4
[ "MIT", "LicenseRef-scancode-proprietary-license", "LicenseRef-scancode-free-unknown" ]
permissive
#!/bin/sh . ./trace.sh notify_web() { trace "Entering notify_web()..." local url=${1} local tor=${3} # Let's encode the body to base64 so we won't have to escape the special chars... local body=$(echo "${2}" | base64 | tr -d '\n') local returncode local response local http_code local curl_code ...
Ruby
UTF-8
1,981
3.484375
3
[]
no_license
#!/usr/bin/env ruby # Requires Ruby 1.9 and "gnuplot" gem require 'gnuplot' X0 = 0.0 XN = 0.4 Y0 = 2.0 # the differential equation definition # f(x, y) = dy / dx def f(x, y); (1.0 + y * y) / (1.0 + x * x); end # the analytic solution of the differential equation def y(x); Math.tan(Math.atan(x) + Math.atan(2)); end...
Markdown
UTF-8
1,684
2.8125
3
[]
no_license
# General information Name: Nguyễn Đăng Huỳnh Long \ Student ID: 18127136 \ Deployed: https://nguyendonghuynhlang26123.github.io/classroom-frontend/ \ [![deployed](https://github.com/nguyendonghuynhlang26123/classroom-frontend/actions/workflows/deploy.yml/badge.svg)](https://github.com/nguyendonghuynhlang26123/classr...
Ruby
UTF-8
764
2.53125
3
[ "MIT" ]
permissive
require_relative 'table' module DbDumper class QueryBuilder # Wrapper under ActiveRecord::Relation class Query attr_reader :table, :ar def initialize(raw_table, exist_ar = nil) @table = Table.from(raw_table) @ar = exist_ar || table.ar.all end def where(*args) ...
Java
UTF-8
993
3.453125
3
[]
no_license
package com.interview; import java.util.ArrayList; import java.util.List; public class Board<T> { List<List<T>> grid = new ArrayList<>(); public List<List<T>> getGrid() { return this.grid; } public void updateGrid(Location location, T currentPlayer) { this.grid.get(location.getI())....
Markdown
UTF-8
2,586
2.671875
3
[]
no_license
--- title: "Scripting Open Excel Sheets in Separate Windows" date: 2018-08-07T20:42:51-04:00 draft: false categories: [] tags: [archive] author: "Josh Rickard" --- If you work in an environment similar to my previous position, then you would know how often you hear certain complaints after upgrading people to new appl...
Python
UTF-8
1,513
3.171875
3
[]
no_license
''' Created on Nov 12, 2012 @author: Ted Carancho ''' import xml.etree.ElementTree as ET xml = ET.parse('xmlTest.xml') # Get individual settings print(xml.find("./Settings/DefaultComPort").text) print(float(xml.find("./Settings/BootUpDelay").text)) print(float(xml.find("./Settings/CommTimeOut").text)) ...
Python
UTF-8
2,013
2.9375
3
[ "MIT" ]
permissive
from bs4 import BeautifulSoup import requests import json def getHTML(url): response = requests.get(url) return BeautifulSoup(response.content,'html.parser') def parsePersons(persons): names = [] if isinstance(persons,dict): names.append(persons['name']) return names for pers...
PHP
UTF-8
824
3.171875
3
[]
no_license
<?php namespace Tnq\Services; class StringService { public function sort_alphabet($sentence) { $utfSentence = mb_convert_encoding($sentence, 'UTF-8', 'auto'); $strings = explode(' ', $utfSentence); $alphaStrings = []; foreach ($strings as $key => $string) { $stringParts = $this->utf8_str_split(mb_co...
Java
UTF-8
308
2.40625
2
[]
no_license
package cn.com.song.design.pattern.command; /** * @author songchengjun * @date 2018/1/12 17:18 */ public class Invoker { private Command command; public void setCommand(Command command) { this.command = command; } public void action() { this.command.execute(); } }
JavaScript
UTF-8
574
3.890625
4
[ "MIT" ]
permissive
/* Description: Given a string of integers, return the number of odd-numbered substrings that can be formed. For example, in the case of "1341", they are 1, 1, 3, 13, 41, 341, 1341, a total of 7 numbers. solve("1341") = 7. See test cases for more examples. Good luck! */ const BigNumber = require("bignumber.js"); fun...
Markdown
UTF-8
5,898
3.4375
3
[]
no_license
# Virtual Machine Setup If you are not running a UNIX system like Mac OS or Linux natively, it is useful to configure a virtual machine for development purposes. This allows for a consistent environment between development and deployment, making configuring and testing simpler and more reliable. This guide will expl...
Python
UTF-8
770
3.40625
3
[ "MIT" ]
permissive
"""an example of a more intense pytest""" import pytest from wallet import Wallet, InsufficientAmount def test_default_initial_amount(): """Testing balance is zero""" wallet = Wallet() assert wallet.balance == 0 def test_setting_initial_amount(): """Testing constructor initial balance""" wallet = ...
JavaScript
UTF-8
3,233
2.578125
3
[]
no_license
import React, { useState, useEffect } from 'react'; import CustomerService from '../services/CustomerService'; const CreateHook = (props) => { const [name, setName] = useState(''); const [address, setAddress] = useState(''); const [email, setEmail] = useState(''); const id = props.match.params.id; ...
C++
UTF-8
1,328
3.515625
4
[]
no_license
#ifndef STACK_H #define STACK_H #include <iostream> // Стек на массиве using namespace std; template <class Node> class stack { private: int size; Node *data; public: stack(); stack(const stack &obj); ~stack(); void push(Node data); Node pop(); Node top(); int get_size(); }; template <class Node>...
JavaScript
UTF-8
1,450
2.703125
3
[]
no_license
const timeZone = document.getElementById("timezoneInfo") timeZone.innerText = Intl.DateTimeFormat().resolvedOptions().timeZone const time = document.getElementById("time") const weatherImg = document.getElementById("weatherImg") const weatherList = { Default:"img/clear_sky.jpg", Clouds:{ few_clouds: "...
C++
UTF-8
2,233
2.796875
3
[]
no_license
#include "stdafx.h" #include "Engine\Debugging\CommandLineParameters.h" namespace ENGINE_NAMESPACE { CommandLineParameters * CommandLineParameters::ourInstance = nullptr; CommandLineParameters::CommandLineParameters() { } CommandLineParameters::~CommandLineParameters() { } void CommandLineParameters::Creat...
Java
UTF-8
1,066
2.328125
2
[ "MIT" ]
permissive
package io.muun.apollo.presentation.ui.adapter.holder; import io.muun.apollo.R; import io.muun.apollo.domain.model.Contact; import io.muun.apollo.presentation.ui.adapter.viewmodel.ContactViewModel; import io.muun.apollo.presentation.ui.view.ProfilePictureView; import android.view.View; import android.widget.TextView;...
Shell
UTF-8
999
3.4375
3
[]
no_license
#!/bin/sh # get the url via `terraform output` URL=`make output | grep base_url | awk -F '=' '{print $2}' | awk '{$1=$1};1'` PUBLIC_URL="https://castlewebhook-test.optimizely.com/v1" JSON="../test.json" HMAC=`cat $JSON | openssl dgst -binary -sha256 -hmac "$TF_VAR_hmac_secret" | openssl base64` echo "Test 1: Calling ...
Markdown
UTF-8
9,043
2.96875
3
[]
no_license
[TOC] # 使用 umi 和 dva ## redux-saga 更好的再redux中管理异步数据,具有更强大的异步数据管理功能 于`redux-thunk`不同的是 + `redux-thunk`返回的是一个函数 ### 在store文件夹新建sagas.js ```react /** * call: 调用异步函数 * put: 当异步函数执行有结果了,去通知状态进行更新 * takeEvery: 负责在全局监听action */ import { call, put, takeEvery } from 'redux-saga/effects' // 登录的api调用 const userServi...
JavaScript
UTF-8
1,873
2.875
3
[]
no_license
/** * Parses and validates data from formObject, then it updates Tariff. * * @param formObject Object received from client's browser form. * @param {Object} opts received URL params and loaded data * @return {Object} object which designates success or failure (in a case form had nonvalid data) * @throws Exception...
Java
UTF-8
4,137
3
3
[]
no_license
package ru.dkuleshov.service; import com.threed.jpct.SimpleVector; /** * Created by dkuleshov3 on 09.06.2017. */ public class SimpleMath { public static class Point2D { public float x; public float y; public Point2D(float _x, float _y) {x = _x; y = _y;} public Point2D() {x = ...
JavaScript
UTF-8
452
2.546875
3
[]
no_license
function check_val(input) { $(input).val() != "" ? $(input).addClass("has_value") : $(input).removeClass("has_value"); } $(document).ready(function(){ $(".check_val").each(function(){ check_val(this); }).on("keyup click blur focus change paste", function(){ check_val(this); }); $("input, select, textarea").o...
Shell
UTF-8
1,620
3.484375
3
[ "BSD-2-Clause", "LicenseRef-scancode-generic-cla" ]
permissive
#!/usr/bin/env sh # Create the imagenet lmdb inputs # N.B. set the path to the imagenet train + val data dirs jsonData="`cat $1`" RESIZE_VAL=`echo $jsonData | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["RESIZE"]'` TRAIN_FILE=`echo $jsonData | python -c 'import json,sys;obj=json.load(sys.stdin);print...
C++
UTF-8
347
2.515625
3
[]
no_license
#pragma once #ifndef SOCCER_MESSAGES_H #define SOCCER_MESSAGES_H #include <string> //An easy translator for the message send-receive by the entities enum MessageType { Msg_ReceiveBall, Msg_PassToMe, Msg_SupportAttacker, Msg_GoHome, Msg_Wait }; //converts an enumerated value to a string inline std::string Message...
Java
UTF-8
1,804
2.015625
2
[]
no_license
package smartshop.com.smartshop.helpers; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import org.powermock.api.mockito.Pow...
Java
UTF-8
591
2.65625
3
[ "Apache-2.0" ]
permissive
package saivenky.neural.c; /** * Created by saivenky on 2/19/17. */ public class ReluLayer extends Layer { public ReluLayer(Layer previousLayer) { shape = previousLayer.shape; int size = previousLayer.shape[0] * previousLayer.shape[1] * previousLayer.shape[2]; nativeLayerPtr = create(siz...
C#
UTF-8
3,210
2.703125
3
[]
no_license
//Inspired by this thread: https://forum.unity.com/threads/simple-udp-implementation-send-read-via-mono-c.15900/ //thanks OP la1n //thanks MattijsKneppers for letting me know that I also need to lock my queue while enqueuing //adapted during projects according to my needs using System; using System.Net; using System....
PHP
UTF-8
2,611
2.65625
3
[]
no_license
<?php $config['hostname'] = "localhost"; $config['dbuser'] = "root"; $config['dbpassword'] = ""; $config['dbname'] = "hoonigan"; $name = ""; $email = ""; $msg = ""; $errors = array(); $db = mysqli_connect($config['hostname'], $config['dbuser'], $config['dbpassword'], $config['dbname']...
Python
UTF-8
196
3.015625
3
[]
no_license
from pandas import DataFrame, Series pop = {'Nevada': {2001: 2.4, 2002: 2.9}, 'Ohio': {2000: 1.5, 2001: 1.7, 2002: 3.6}} frame = DataFrame(pop) print(frame) frame = frame.T print(frame)
C
UTF-8
949
3.421875
3
[]
no_license
#include <sys/stat.h> #include <unistd.h> #include <time.h> #include <stdio.h> #include <stdlib.h> char * get_binary(int n) { int i = 8; char * s; s = malloc(sizeof(char) * 9); while (n) { if (n & 1) { if ((i % 3) == 0) { * (s + i) = 'r'; } if ((i % 3) == 1) { * (s + i) = 'w'; } if ((i % ...
JavaScript
UTF-8
2,086
2.890625
3
[]
no_license
import React from "react"; //import GetWordOfDay from "../../util/getWordOfDayHelper"; import { getWordOfDay } from "../../util/getWordOfDayHelper"; import { Link } from "react-router-dom"; import './WordOfDay.css'; class WordOfDay extends React.Component { constructor() { super(); this.state = { ...
PHP
UTF-8
17,239
2.609375
3
[]
no_license
<?php if(isset($_GET['place_id'])){ $place=$_GET['place_id']; $place_request=file_get_contents("https://maps.googleapis.com/maps/api/place/details/json?placeid=".$place."&key=AIzaSyCkQkQOa6xaqAu3Is6yhQBla6Jj-icdj8A"); $place_json=json_decode($place_request,true); $response=array("results"=>getReviews...
JavaScript
UTF-8
896
3.4375
3
[]
no_license
//************************************************** // // Javascript homework // Lecture Loops // author Viktor Ivanov // date: 15.13.2012 // editor: Visual Studio 2012 // //************************************************** //************************************************** //task 8 //****************************...
C#
UTF-8
932
2.78125
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Text; namespace UniRx { public interface IConnectableObservable<T> : IObservable<T> { IDisposable Connect(); } public static partial class Observable { class ConnectableObservable<T> : IConnectableObservable<T> {...
C++
UTF-8
1,888
2.671875
3
[]
no_license
// // GameObject.h // CATLIEN // // Created by Wander on 8/19/12. // // #ifndef __CATLIEN__GameObject__ #define __CATLIEN__GameObject__ #include "cocos2d.h" #include "Box2D.h" #include "../Graphics/AnimationTexture.h" #include <string> // GameObject types typedef enum { GameObjectTypeNone, GameObjectTypeP...
Ruby
UTF-8
785
2.640625
3
[ "MIT" ]
permissive
# frozen_string_literal: true module PagesCore module PubSub class << self def publish(name, payload = {}) subscribers.select { |s| s.name == name } .each { |s| s.call(payload) } end def subscribe(name, &block) subscriber = PagesCore::PubSub::Subscriber.new(n...
SQL
UTF-8
917
3.875
4
[]
no_license
# agores pou eginan me karta apo ton pelath me onoma... SELECT * FROM Transaction AS T, Customer as C WHERE C.Card_number = 1 AND T.Card_number = C.Card_number ORDER BY T.DateTime; # agores pou eginan sto katasthma me kwdiko i DROP TABLE IF EXISTS Agores_i; CREATE TABLE Agores_i SELECT * FROM Transaction AS T WHERE T....
Java
UTF-8
1,252
2
2
[]
no_license
package com.coldchain.project.business.user.vo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * 企业注册参数 */ @Data public class RegisterVo { /** * 用户名 */ @ApiModelProperty(name = "username", value = "用户名", dataType = "String", example = "ntsitech") private String userna...
C++
UTF-8
476
2.5625
3
[]
no_license
#include "Booster.h" const int Booster::SCORE; Booster::Booster( void ) : Object('*', 3, true, false, false) {} int Booster::Update( const int &timeDiff ) { return 0; } bool Booster::Destroy( int &power ) { m_Destroyed = true; return false; } bool Booster::PickUp( int &power, int &bombCnt, bool &confu...
Java
UTF-8
344
1.539063
2
[]
no_license
package com.company.pizza.web.screens.pizzarecipe; import com.haulmont.cuba.gui.screen.*; import com.company.pizza.entity.PizzaRecipe; @UiController("pizza_PizzaRecipe.edit") @UiDescriptor("pizza-recipe-edit.xml") @EditedEntityContainer("pizzaRecipeDc") @LoadDataBeforeShow public class PizzaRecipeEdit extends Standar...
TypeScript
UTF-8
1,532
2.5625
3
[ "MIT" ]
permissive
import { it } from 'angular2/testing'; import {EncryptionSchemeResolverService} from '../resolver/encryption-scheme.resolver.service'; import {EncryptionSchemeProviderService} from './encryption-scheme.provider.service'; describe('encryption-scheme-provider', () => { let encryptionSchemeResolverService = ja...
Markdown
UTF-8
14,482
2.6875
3
[]
no_license
# Laravel Valet - Introdução - Valet ou Homestead - Instalação - Atualizando - Servindo Sites - O comando "Park" - O comando "Link" - Protegendo sites com TLS - Compartilhamento de sites - Valet Drivers personalizados - Drivers Locais - Outros Comandos do Valet ## Introdução Valet é um ambiente de dese...
Python
UTF-8
7,228
3.421875
3
[]
no_license
import pandas as pd from os import path import sys # name_filter list containing elements acceptable to have within last names (add to it if desired) name_filter = ['jr', 'sr', 'von', 'van', 'mac', 'st', 'mc', 'de', 'la', 'du', 'le', '2nd', '3rd', 'ii', 'iii', 'lodge', 'admission', 'admissions', '...
C++
UTF-8
2,606
3.65625
4
[]
no_license
#ifndef EMISSOR_H #define EMISSOR_H #include <string> #include <regex> #include <iostream> /** * @file Emissor.h * @author Lívia Gomes Costa Fonseca * @author Natalia Oliveira Borges * * Esse arquivo contém a implementação da classe de domínio Emissor. Essa classe armazena o atributo emissor no formato * de uma strin...
C#
UTF-8
1,532
2.703125
3
[]
no_license
using Application.Common.MeetingRooms.Factory; using Application.Interfaces; using Serilog; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Application.MeetingRooms.UpdateMeetingRoom { public class UpdateMeetingRoomCommand : IUpdateMeetingRoomCommand { p...
C
UTF-8
298
3.703125
4
[]
no_license
#include<stdio.h> int main(){ int n,i; float sum; printf("s=1+1/2+1/3+1/4.........\n"); printf("Enter number of term till series continue :\n"); scanf("%d",&n); i=1; while(i<=n){ sum=sum+1/(float)i; i++; } printf("Calculated value of series till %d is :%f \n",n,sum); return 0; }
C#
UTF-8
1,213
2.59375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Backend.Domain.Entities { public class Patient { public string name { get; set; } public string lastname { get; set; } public string documentType { get; set; } public stri...
C++
UTF-8
1,523
2.578125
3
[ "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
//Download by http://www.NewXing.com #ifndef CRYPTOPP_HAVAL_H #define CRYPTOPP_HAVAL_H #include "iterhash.h" NAMESPACE_BEGIN(CryptoPP) class HAVAL : public IteratedHash<word32> { public: enum {DIGESTSIZE = 32, DATASIZE = 128, VERSION = 1}; // digestSize can be 16, 20, 24, 28, or 32 // pass can be 3, 4 or 5 HAVA...
JavaScript
UTF-8
725
2.546875
3
[]
no_license
const { form, buyOnline, numberInput, colorChoices: chooseColor, sizeChoices: chooseSize, buttons, addToCartBtn, } = domSelectors(); // annonymous functions form.addEventListener('submit', (e) => { e.preventDefault(); notifyUser(); }); buyOnline.addEventListener('click', (e) => { e.preventDefault...
Python
UTF-8
2,298
3.125
3
[]
no_license
#!/usr/bin/env python # coding: utf-8 # In[ ]: # In[1]: # Importing all important libraries needed import pandas as pd import matplotlib.pyplot as plt from sklearn.feature_extraction.text import TfidfVectorizer from sklearn import model_selection from sklearn.linear_model import LogisticRegression from sklea...
C++
WINDOWS-1252
1,287
2.640625
3
[]
no_license
/** * @file shared_lock_guard.h * @author wangcong(a1e2w3@126.com) * @date 2018-01-31 16:00:37 * @brief д * **/ #ifndef WRPC_UTILS_SHARED_LOCK_GUARD_H_ #define WRPC_UTILS_SHARED_LOCK_GUARD_H_ #include <pthead.h> namespace wrpc { class SharedMutex { public: SharedMutex() { pthread_rwlock_init(&_rw_lock...
C++
UTF-8
799
3.6875
4
[]
no_license
/* * Name : derived_main.cpp * Author : Luke Sathrum * Description : Testing our derived and base class. This file uses person.h, * baseball_player.h, employee.h and supervisor.h */ #include <iostream> #include "person.h" #include "baseball_player.h" using std::cout; using std...
JavaScript
UTF-8
1,315
2.640625
3
[ "MIT" ]
permissive
import React, { useState, useEffect } from "react"; import axios from "axios"; import RequestError from "./RequestError"; export default function ShipDetails(props) { const [ship, setShip] = useState(null); const [shipDetailsID, setShipDetailsID] = useState(props.shipDetailsID); const [requestError, setReq...
C
UTF-8
1,214
2.890625
3
[ "Apache-2.0" ]
permissive
#pragma once #include <stdbool.h> #include <stdint.h> #include <stdlib.h> #include <openssl/evp.h> #include <openssl/rsa.h> /*! * Get size of Full Domain Hash result. */ size_t openssl_fdh_len(RSA *key); /*! * Compute Full Domain Hash. * * \param[in] data Input data. * \param[in] data_len Length of th...
Python
UTF-8
145
2.859375
3
[]
no_license
#!/usr/bin/env python3 N, A, X, Y = map(int,(input().split())) if N > A: ans = A * X + (N-A) * Y else: ans = N * X print(ans)
Java
UTF-8
275
1.625
2
[]
no_license
package com.benghuai3.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class GushiController { @RequestMapping("gushi.html") public String gushi() { return "gushi"; } }
JavaScript
UTF-8
4,932
2.578125
3
[]
no_license
{ let view = { el: '.page>main', template: ` <form class="form"> <div class="row"> <label>歌名</label> <input name="name" type="text" value="__name__"> <input name="id" type="hidden" value="__id__"> </div> <div...
Java
UTF-8
1,319
2.265625
2
[]
no_license
package com.plusultra.puppyland.utils; import com.badlogic.gdx.math.Vector2; import com.plusultra.puppyland.stages.GameStage; public class Constants { public static final Vector2 WORLD_GRAVITY = new Vector2(0, -10); public static final float LEVEL_SPACING = GameStage.VIEWPORT_HEIGHT / 3; public static ...
Java
UTF-8
1,022
1.9375
2
[]
no_license
package com.meiyuan.catering.order.dto.splitbill; import com.meiyuan.catering.order.enums.TradeStatusEnum; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.time.LocalDateTime; /** * @author GongJunZheng * @date 2020/10/09 15:10 * @description ...
Java
UTF-8
7,622
1.804688
2
[]
no_license
package com.phincon.talents.app.model.hr; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; import com.phincon.talents.app.model.AbstractEntity; @Entity @Table(name = "hr_request_type") public class RequestType extends AbstractEntity { @Column(name = "mod...
Ruby
UTF-8
228
2.578125
3
[ "MIT" ]
permissive
require "validatessn/version" module Validatessn def validate(number) return false unless number.length == 9 if number.match(/^[0-8]\d{2}-\d{2}-\d{4}$/) return true else return false end end end
Markdown
UTF-8
759
3
3
[]
no_license
# Twitter Simulation This project simulates posting and retrieving tweets as the Twitter application would do. It was built as a Java API with two current implementations using different databases, one with Postgres and one with Redis. Read/write speeds were tested and documented for each implementation, then compare...
JavaScript
UTF-8
641
3.78125
4
[]
no_license
var deck = ["2 Heart", "3 Heart", "4 Heart", "5 Heart", "2 Spade", "3 Spade", "4 Spade", "5 Spade", "2 Club", "3 Club", "4 Club", "5 Club", "2 Diamond", "3 Diamond", "4 Diamond", "5 Diamond"]; var chosenCards = []; function drawCard() { var randomNum = Math.floor(Math.random() ...
Java
UTF-8
11,753
2.109375
2
[]
no_license
package co.quchu.quchu.net; import android.content.Context; import android.content.Intent; import android.widget.Toast; import com.android.volley.DefaultRetryPolicy; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; i...
Java
UTF-8
1,528
3.390625
3
[]
no_license
package com.cs360.chess.piece; import com.cs360.chess.Board; public final class Queen extends Piece { private static final int points = 9; private static final int id = 5; public Queen(int id, boolean isBlack, int column, int row) { super(id, isBlack, column, row); } public Queen(int id...
Java
UTF-8
457
2.390625
2
[]
no_license
package nsy209.cnam.seldesave.validator; import nsy209.cnam.seldesave.validator.helper.EnumCheck; /** * Created by lavive on 08/06/17. */ public class NumberValidator implements IValidator { private final String regex = "^([1-9][0-9]*)|0$"; @Override public EnumCheck validate(String stringToValidate) ...
C#
UTF-8
3,178
2.734375
3
[]
no_license
using UnityEngine; public class EnemySpawner : MonoBehaviour { private bool movingRight = false; public GameObject enemyPrefab; public float width = 10f; public float height = 5f; public float speed = 5f; public float xMin; public float xMax; public float spawnDelay = 5f; // At start, runs foreach transfor...
Java
UTF-8
1,523
2.421875
2
[]
no_license
package com.example.figuras; import android.os.Bundle; import android.app.Activity; import android.content.Intent; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.Toast; public class Cubo extends Activity { private EditText txtarista; @Override protected vo...
Java
UTF-8
1,292
1.828125
2
[]
no_license
@Override public boolean onFragmentCreate(){ currentChat=MessagesController.getInstance(currentAccount).getChat(chatId); if (currentChat == null) { final CountDownLatch countDownLatch=new CountDownLatch(1); MessagesStorage.getInstance(currentAccount).getStorageQueue().postRunnable(() -> { currentChat=...
Markdown
UTF-8
673
2.78125
3
[ "MIT" ]
permissive
# Reddit-Top-Level-Comments Chrome Extension: Only view 1 top-level Reddit comment thread at a time. This is how I usually browse reddit, and I always had trouble finding the TLCs (top level comments) to start a new "story" of comments and responses again. ### Reasoning I sometimes get lost in a long thread of comment...