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
TypeScript
UTF-8
539
2.625
3
[]
no_license
import { useState, useEffect } from 'react' export function useDimensions() { function getWindowDimensions() { return { width: window.innerWidth, height: window.innerHeight } } const [dimensions, setDimensions] = useState(getWindowDimensions()) useEffect(() => { function updateWindowDimensions() { ...
JavaScript
UTF-8
300
3.8125
4
[]
no_license
/** * Write a JavaScript program to * replace every character in a given string * with the character following it in the alphabet */ const moveChars = (str) => str .split("") .map((char) => String.fromCharCode(char.charCodeAt(0) + 1)) .join(""); console.log(moveChars("amdfj"));
C#
UTF-8
442
2.546875
3
[ "MIT" ]
permissive
using System; using System.Reflection; namespace Explosuress { internal class FieldAdapter : FieldOrPropertyAdapter { private readonly FieldInfo _field; public FieldAdapter(FieldInfo field) { _field = field ?? throw new ArgumentNullException(nameof(field)); } ...
Swift
UTF-8
1,799
2.78125
3
[]
no_license
// // Database.swift // DailyHub // // Created by Joe Salter on 4/3/17. // Copyright © 2017 Luke Petruzzi. All rights reserved. // import Foundation import AWSS3 import AWSDynamoDB import AWSSQS import AWSSNS import AWSCognito class Database { class func getDatabaseInfo(completionHandler:@escaping (Strin...
Python
UTF-8
2,030
2.90625
3
[]
no_license
#Text Extractor Service By Ganesh Ghag import re import nltk from nltk.corpus import stopwords stop = stopwords.words('english') def extract_phone_numbers(string): r = re.compile(r'(\d{3}[-\.\s]??\d{3}[-\.\s]??\d{4}|\(\d{3}\)\s*\d{3}[-\.\s]??\d{4}|\d{3}[-\.\s]??\d{4})') phone_numbers = r.findall(string) re...
Java
UTF-8
426
3.359375
3
[]
no_license
public class CarLambda{ public static void main(String [] args){ Car basicCar = () -> { return " Adding features of "; }; Car sportsCar = () -> basicCar.assemble() + "Sports Car."; System.out.println(sportsCar.assemble()); System.out.println("\n*****"); Car sportsLuxuryCar = () -> basicCar.asse...
Java
UTF-8
305
1.984375
2
[]
no_license
package it.solvingteam.course.olimpiadinfinite.dto.messages; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; public class SportDto { @NotNull(message = "The id doesn't exist!") private Long id; @NotEmpty(message = "Required field") private String name; }
Python
UTF-8
2,099
2.8125
3
[]
no_license
import sys import cv2 import numpy as np def cropBorder(srcLength, dstLength): center = srcLength//2 half = divmod(dstLength, 2) begin = center - half[0] end = center + half[0] if half[1]: end += 1 return begin, end def isOut(radius, thickness, limit): graphBorder = radius + thick...
Java
UTF-8
74
1.679688
2
[]
no_license
package com.haubui.common; public enum Operator { SUM,SUB,MUL,DIV,MOD }
Python
UTF-8
8,059
2.828125
3
[]
no_license
import math import os import random import string script_dir = os.path.dirname(__file__) def get_max_hp(class_name): if class_name in ['Berserker']: return(12) elif class_name in ['Fighter', 'Paladin', 'Dark Knight', 'Battlemaster']: return(10) elif class_name in ['Barbarian', ...
PHP
UTF-8
297
2.65625
3
[ "MIT" ]
permissive
<?php class slink { public static function to($link) { $locale = slang::get(); $string = $locale."/".$link; if (Request::secure()) { return secure_asset($string); } else { return asset($string); } } public static function path($link) { return asset($link); } }
Java
UTF-8
1,573
2.0625
2
[]
no_license
package com.frankgreen.apdu.command; import com.acs.smartcard.Reader; import com.acs.smartcard.ReaderException; import com.frankgreen.NFCReader; import com.frankgreen.apdu.OnGetResultListener; import com.frankgreen.apdu.Result; import com.frankgreen.task.BaseParams; /** * Created by kevin on 5/27/15. */ public clas...
Java
UTF-8
840
3.578125
4
[ "MIT" ]
permissive
package recursionProblems; import java.util.Scanner; public class MaxofAnArray { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("Enter n"); int n=sc.nextInt(); int index; int[] arr=new int[n]; for(index=0;index<n;index++) { arr[index]=sc.nextInt(); ...
PHP
UTF-8
1,454
2.90625
3
[]
no_license
<?php /** * Created by IntelliJ IDEA. * User: luthfi * Date: 2/23/16 * Time: 12:09 AM */ namespace Model; use Exception; use DateTime; class Comment extends Model { private $table = "comments"; private $userModel; public function __construct() { parent::__construct(); $this->use...
C++
UTF-8
709
3.0625
3
[]
no_license
#include <iostream> #include <cstring> using namespace std; int main(int argc, char *argv[]) { char str[300]; cin >> str; int len = strlen(str); bool flag = false; for (int i = 0; i < len; ++ i) { if (i + 2 < len) { if (str[i] == 'W' && str[i+1] == 'U' && str[i+2] ==...
Java
UTF-8
6,009
2.875
3
[ "Apache-2.0" ]
permissive
package org.g4.certificate.utilities; import org.junit.Test; import org.junit.Before; import org.junit.After; import java.io.*; import java.util.List; import static org.junit.Assert.*; /** * Unit test for FileUtil * * @author Johnson Jiang * @version 1.0 * @since 1.0 */ public class FileUtilTest { String ...
TypeScript
UTF-8
3,903
2.6875
3
[]
no_license
module egret3d { /** * @private * 粒子初始化的尺寸大小 */ export class ParticleScale extends AnimationNode { private _scaleValue: ConstRandomValueShape; private _animationState: ParticleAnimationState; private _node: ParticleDataScaleBirth; constructor() { super(...
SQL
UTF-8
266
3.25
3
[]
no_license
Select First_Name, Last_name, Title, EpName from Actors AS a join Casting AS b on b.ActorId = a.Id join Episodes AS c on c.EpNumber = b.EpisodeId and c.Season = b.Season join Programs AS d on d.Id = c.ProgramId Where c.Season = 2 and c.EpNumber = 1
JavaScript
UTF-8
3,652
3.15625
3
[]
no_license
var questions = [ { question: "What is 8 * 9?", answers: { a: "17", b: "71", c: "72", d: "27"}, correctAnswer: "c"}, { question: "What is 15 / 3?", answers: { a: "5", b: "-5", c: "3", d: "-3"}, correctAnswer: "a"}, { question: "What is 3 + 4?", answers: { a: "43", b: "34", c: "-7", d: "7"}, correctAnswer: "...
Markdown
UTF-8
1,707
2.9375
3
[]
no_license
# Slack AD Checker A Python/Powershell util script for checking to see that everyone in a Slack group has a corresponding email in Active Directory ### Why? This is a little utility script you could use to remind admins to remove people from slack (basically if you don't wanna pay for full AD sync) ### Install/Setup...
C++
UTF-8
633
2.65625
3
[]
no_license
#include<string> #include<iostream> #include<algorithm> using namespace std; int str[100]; bool cmp(const int&A,const int&B){ return A<B?true:false; } int main() { int n,sum,tmp1,tmp2; scanf("%d",&n); while(~scanf("%d",&n)){ for(int i=1;i<=n;i++){ scanf("%d",&str[i]); } sort(&str[1],str+n+1,cmp); sum=0; wh...
Java
UTF-8
550
2.265625
2
[]
no_license
package com.habbib.customer.util; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import org.springframework.stereotype.Component; @Component public class Utilities { public Date convertDateFormate(Date date) { SimpleDateFormat formate = new SimpleDateForma...
Java
UTF-8
627
3.015625
3
[]
no_license
public class Sort012{ public static void sort012(int[] arr){ int indexOf0 = 0; int IndexOf2 = arr.length -1; int i = 1; int temp = 0; while(i < arr.length ) { if(arr[i] == 0 && i > indexOf0) { temp = arr[i]; arr[i] = arr[indexOf0]; ...
Markdown
UTF-8
642
2.796875
3
[]
no_license
--- title: Preload types: - string --- # Preload Adds a string to the preload buffer. ## Declaration ```jass native Preload takes string filename returns nothing ``` ## Parameters `string filename`{!language=jass} : The string to be added to the buffer.Should probably not be named`filename`. ## Notes The data w...
C#
UTF-8
721
4.34375
4
[]
no_license
using System; class PerimeterAndAreaOfCircle { static void Main() { //Write a program that reads the radius r of a circle and prints its perimeter and area. Console.Write("Please insert the radius of the circle - "); double radius = double.Parse(Console.ReadLine()); // Reads the number...
Shell
UTF-8
302
3.546875
4
[ "Apache-2.0" ]
permissive
#!/usr/bin/env bash # Written by: Bilal Jooma for d in */ ; do cd $d BRANCH=$( git branch | grep \* | cut -d ' ' -f2 ) echo "##== Updating: $d ==##" if [ "$BRANCH" != "master" ] then echo "Only supported for Master Branch: $d" else git pull fi echo cd .. done
Java
UTF-8
1,756
2.671875
3
[]
no_license
package test; import org.junit.Test; import static org.junit.Assert.*; import static.org.junit.Assert.assertTrue; import static.org.junit.Assert.assertFalse; import static.org.junit.Assert.add; import org.junit.Before; import static.org.junit.Assert.assertEquals; public class BalancedBracketsTest { //TODO: add ...
Python
UTF-8
395
3.140625
3
[]
no_license
import pandas as pd import numpy as np df = pd.DataFrame(np.random.randn(10, 4), index = pd.date_range('1/1/2000', periods=10), columns = ['A', 'B', 'C', 'D']) print (df) r = df.rolling(window=3,min_periods=1) print (r.aggregate(np.sum)) print (r['A'].aggregate(np.sum)) print (r['A','B'].aggreg...
C++
UTF-8
279
2.8125
3
[]
no_license
#include <algorithm> #include <string> #include <iostream> int main() { std::string s = "acb"; // что переставляем std::sort(s.begin(), s.end()); do { std::cout << s << std::endl; } while(std::next_permutation(s.begin(), s.end())); }
C++
UTF-8
2,925
2.828125
3
[]
no_license
#include "simpleArbiter.h" namespace manifold { namespace iris { //#################################################################### // SimpleArbiter //#################################################################### SimpleArbiter::SimpleArbiter(unsigned nch) : no_channels(nch), requested(nch) { ...
C++
UTF-8
10,152
2.59375
3
[]
no_license
/* Diffie-Hellman key exchange (without HMAC) aka ECDH_anon in RFC4492 1. Alice picks a (secret) random natural number 'a', calculates P = a * G and sends P to Bob. 'a' is Alice's private key. 'P' is Alice's public key. 2. Bob picks a (secret) random natural number 'b', calculates Q = b * G and sen...
PHP
UTF-8
5,796
2.828125
3
[]
no_license
<?php require_once( "pagination.php"); require_once("session.php"); require_once("nice.php"); $status_msg = array(10 => "Created: entry record created in database", 20 => "Uploaded: ready to be unzipped and compiled", 30 => "Compiling: compiling and running tests", ...
C#
UTF-8
1,406
3.5625
4
[ "MIT" ]
permissive
namespace ValidUsernames { using System; using System.Linq; using System.Text; class Program { static void Main() { string[] userName = Console.ReadLine() .Split(", ") .ToArray(); StringBuilder validUserName = new StringBuild...
Java
UTF-8
1,593
2.359375
2
[ "Apache-2.0" ]
permissive
package com.eclubprague.iot.android.weissmydeweiss.cloud.sensors; import com.eclubprague.iot.android.weissmydeweiss.cloud.hubs.Hub; import com.eclubprague.iot.android.weissmydeweiss.cloud.sensors.supports.NameValuePair; import com.eclubprague.iot.android.weissmydeweiss.cloud.sensors.supports.SensorType; import com.ec...
Java
UTF-8
1,523
3.25
3
[ "MIT" ]
permissive
/* * 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 am_utils; /** * * @author NThering */ public final class CUtils { /** If we're allowing debug messages and features *...
PHP
UTF-8
1,084
2.8125
3
[ "MIT" ]
permissive
<?php namespace App\Libraries; use App\Libraries\Crud_core; use CodeIgniter\HTTP\RequestInterface; class Crud extends Crud_core { function __construct($params, RequestInterface $request) { parent::__construct($params, $request); } function form() { return $this->parent_form(); ...
Python
UTF-8
98
2.6875
3
[ "MIT-Modern-Variant", "MIT", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
def from_monad(m): """ Returns the value of a monad """ return m >> (lambda x: x)
Python
UTF-8
428
3.125
3
[]
no_license
from tkinter import* import webbrowser win=Tk() win.title('Search Bar') def bt_on(): url=entry.get() webbrowser.open(url) label= Label(win,text='Enter url: ',font=('arial',14,'bold')) label.grid(row=0,column=0) entry = Entry(win,width=35) entry.grid(row=0,column=1) button =Button(wi...
Python
UTF-8
70
3.03125
3
[]
no_license
a,b,c=input().split() x=int(a) y=int(b) z=int(c) m=((x*y)%z) print(m)
Shell
UTF-8
756
3.78125
4
[ "MIT" ]
permissive
#!/bin/sh # wait until nginx is running while [ ! -f /run/nginx/nginx.pid ]; do sleep 1 done # make sure the /services key is set in etcd before we start for ETCD_URL in ${ETCD_PEERS//,/ }; do curl -s -f $ETCD_URL/v2/keys/services -XPUT -d dir=true if [ "$?" = "0" ]; then break fi done # atte...
Java
UTF-8
1,647
4.125
4
[]
no_license
/** * TP01Q03 PALINDROMO * * @author Thiago Henrique de Castro Oliveira * @version 1 08/2019 Este algoritmo testa se uma string é um palindromo */ class TP01Q03Palindromo { public static void main(String[] args) { String[] input = new String[1000]; int inputIndex = 0; MyIO.setCharset(...
Python
UTF-8
1,109
2.734375
3
[]
no_license
#! /usr/bin/env python3 import sys import os import logging from traceback import format_exc from argparse import ArgumentParser from reporting.report import who_in_space logging.basicConfig(filename='profusion.log', level=logging.INFO) def main(argv=None): """ Main function that calls who_in_space function. ...
Markdown
UTF-8
1,612
2.5625
3
[ "MIT" ]
permissive
--- layout: post title: "Representation Balancing MDPs for Off-Policy Policy Evaluation" date: 2018-05-23 10:43:16 categories: arXiv_AI tags: arXiv_AI author: Yao Liu, Omer Gottesman, Aniruddh Raghu, Matthieu Komorowski, Aldo Faisal, Finale Doshi-Velez, Emma Brunskill mathjax: true --- * content {:toc} ##### Abstract...
Java
UTF-8
1,044
3.03125
3
[]
no_license
package net.rayfall.TankAI; import java.util.ArrayList; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; public class Map { private Number mapSizeX; private Number mapSizeY; private ArrayList<Terrain> terrainList; public Map(JSONObject map) { try{ JSONArray hold = map...
C++
UTF-8
492
3.109375
3
[]
no_license
#include <iostream> using namespace std; int main() { string hajjName, hajjFullName; int caseNo = 1; while(1) { cin>>hajjName; if(hajjName == "*") { break; } else if(hajjName == "Hajj") { hajjFullName = "Hajj-e-Akbar"; } else if(hajj...
Java
UTF-8
499
1.992188
2
[]
no_license
package com.hemeiyue.common; import java.util.Map; public class ResultCount extends ResultBean{ private Map<String, Long> count; public ResultCount() { super(); // TODO Auto-generated constructor stub } public ResultCount(boolean result, String code, String message) { super(result, code, message); // ...
Java
UTF-8
1,304
1.976563
2
[]
no_license
package com.wondersgroup.scxj.portal.modules.sys.web.mobile; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.stereotype.Controller; import org.springframework.we...
C
UTF-8
1,045
2.875
3
[]
no_license
#include<stdio.h> #include<fcntl.h> #include<stdlib.h> #include<unistd.h> #include<sys/stat.h> #include<semaphore.h> #include<sys/mman.h> int main(void) { int fd; int *mmap_addr; int *ptr; int ptr1 = 0; int pid; int i = 0; int zero = 0; sem_t *sem_addr; int sem_count; fd = shm_open("/shmq",O_RDWR|O_CREAT,077...
JavaScript
UTF-8
892
3.203125
3
[]
no_license
/* Treehouse Techdegree: FSJS Project 2 - Data Pagination and Filtering */ /* Create the `showPage` function This function will create and insert/append the elements needed to display a "page" of nine students */ function createElement(elementName, appendTo) { const element = document.createElement(elemen...
Java
UTF-8
4,741
1.789063
2
[ "Apache-2.0" ]
permissive
/** * Copyright 2014 Fernando Rincon Martin <frm.rincon@gmail.com> * * 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 requ...
PHP
UTF-8
1,025
2.515625
3
[ "MIT" ]
permissive
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class Locations extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('customer_locations', function (Blueprint $table) { ...
Markdown
UTF-8
2,903
2.6875
3
[]
no_license
2431 - STUDENT ACTIVITIES DURING HOLIDAY PERIODS ================================================ The Board of Education recognizes the importance of family unity during holiday periods, the educational value of family vacations and the importance of religious services. It is, therefore, the policy of the Board that a...
C#
UTF-8
1,591
2.625
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.Tasks; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class UpdateBookForm : Form { privat...
JavaScript
UTF-8
2,962
3.390625
3
[]
no_license
import './App.css'; import {useState, useEffect} from 'react' import Square from './Components/Square' import { Patterns } from './Components/patterns' function App() { // STATES const [board, setBoard] = useState(["","","","","","","","",""]) // GAME BOARD const [player, setPlayer] = useState('X') // PLAYER TUR...
Markdown
UTF-8
2,497
2.984375
3
[ "MIT" ]
permissive
--- title: Nick Davis awarded Honorary Life Membership of Liffey Valley Athletics Club location: Phoenix Park, Dublin --- Tonight, we presented an Honorary Life Membership of Liffey Valley Athletics Club Award to Nick Davis to officially recognise the long-term commitment, dedication, support and the significant contr...
JavaScript
UTF-8
4,815
3.171875
3
[]
no_license
var experience_array = ["None",">= 6 months",">= 1 years",">= 2 years",">= 5 years",">= 10 years"]; var qualification_array = ["10th","12th","B.C.A","M.sc(IT)","Ph.D."]; function Friend(name,isEnabled){ this.name=name; this.isEnabled=isEnabled; } var languages = [ new Friend("C/C++",false), new Frien...
Python
UTF-8
3,423
3.734375
4
[]
no_license
#!/usr/local/bin/python3 ''' Title: malaria.py Date: 2020-10-11 Author: Linnea Olsson Description: This program will appended protein descriptions from a blast file to the end of the fasta id line in. The program puts the output in a file designated by the user. If there is no protein name indicated...
PHP
UTF-8
1,679
2.78125
3
[ "PHP-3.0", "Apache-2.0" ]
permissive
<?php /** * 时间工具类 */ namespace app\common\utils; use app\common\bean\ListMap; class TimeUtil extends BaseUtil { static $_self = null; public static function getInstance(){ if(empty(self::$_self)){ self::$_self = new TimeUtil(); } return self::$_self; } /** 获取时间...
PHP
UTF-8
363
2.546875
3
[ "MIT" ]
permissive
<?php namespace Concrete\Core\User\Group\Command\Traits; trait ExistingGroupTrait { protected $groupID; /** * @return mixed */ public function getGroupID() { return $this->groupID; } /** * @param mixed $groupID */ public function setGroupID($groupID) { ...
Java
UTF-8
1,586
2.09375
2
[]
no_license
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedCondition; import org.openqa.selenium.support.ui.WebDriverWait; import sun.applet.Main; public class LoginPage { private By loginLink = By.cssSelector("[tabinde...
C++
UTF-8
1,087
3.171875
3
[]
no_license
#include <iostream> #include <algorithm> using namespace std; const int maxn = 10005; int n, g, k; struct Stu { int rank{}; string username; int grade{}; } stu[10005]; bool cmp(const Stu& a, const Stu& b) { if (a.grade == b.grade) { return a.username < b.username; } return a.grade >...
Go
UTF-8
701
3.25
3
[ "MIT" ]
permissive
package ntlmv2hash import ( "encoding/binary" "fmt" "golang.org/x/crypto/md4" "unicode/utf16" ) // NTPasswordHash computes the NTLM v2 password hash. // // The output is password-equivalent and easy to reverse. It must be // guarded just as well as the original password. func NTPasswordHash(password string) strin...
TypeScript
UTF-8
689
3.765625
4
[]
no_license
'use strict'; enum Colors { Orange, Yellow, Brown, Red } let selectedColor = Colors.Red; //regular if, else if, else statement if (selectedColor == Colors.Yellow) { console.log('Yellow'); } else if (selectedColor == Colors.Orange) { console.log('Orange'); } else if (selecte...
Python
UTF-8
234
2.53125
3
[]
no_license
import abc class FormatterInterface: """ Interface ot implement different formatter types depending on requirements """ __metaclass__ = abc.ABCMeta @abc.abstractmethod def __call__(self, state): pass
Markdown
UTF-8
2,093
3.09375
3
[]
no_license
--- layout: post title: "Using CSS to hide evil things" style: csshack date: 2020-07-21 --- ## Topic Good evening neighbors, <br /> Quickie: Today I'd like to talk to you about a thing everyone does but no one pays a lot of attention to it. > __Copy/Pasting things from the internet into your terminal__ One ...
Python
UTF-8
635
3.1875
3
[]
no_license
import pygame # create list of buttons class buttons: buttonlist = [] # add buttons to list def add(self, bt): self.buttonlist.append(bt) # draw all buttons def draw(self, win): for bt in self.buttonlist: bt.draw(win, (0, 0, 0)) # process events for all buttons def...
Java
UTF-8
7,270
3.015625
3
[]
no_license
package model; import java.util.ArrayList; public class Animal{ //Constantes public static final String GATO = "Gato"; public static final String PERRO = "Perro"; public static final String AVE = "Ave"; public static final String OTRO = "Otro"; //Attributes private String name; private double heigh...
Java
UTF-8
1,586
3.796875
4
[]
no_license
import java.io.*; import java.util.*; public class KDifference { public static void main(String[] args) throws Exception { Reader rd; if(args.length == 0) rd = new InputStreamReader(System.in); else rd = new FileReader(args[0]); new KDifference().run(rd); } private ...
Java
UTF-8
1,431
1.9375
2
[]
no_license
package com.ys.idatrix.metacube.metamanage.service; import com.ys.idatrix.metacube.metamanage.domain.*; import com.ys.idatrix.metacube.metamanage.vo.request.AlterSqlVO; import com.ys.idatrix.metacube.metamanage.vo.request.DBViewVO; import com.ys.idatrix.metacube.metamanage.vo.request.MySqlTableVO; import java.util.Ar...
Java
UTF-8
617
2.0625
2
[ "MIT" ]
permissive
package es.upm.miw.apaw_ep_jesus_garceran.sponsor_resource; import es.upm.miw.apaw_ep_jesus_garceran.exceptions.NotFoundException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @Controller public class SponsorBusinessController { private SponsorD...
Python
UTF-8
2,210
2.53125
3
[]
no_license
from django.db import models # Add description for Submissions and Comments in the 2nd phase class Subreddit(models.Model): id = models.CharField(primary_key=True, max_length=20) display_name = models.CharField(max_length=30, blank=False, default="") title = models.CharField(max_length=100, blank=False, de...
Java
UTF-8
2,088
1.703125
2
[]
no_license
// isComment package org.wheelmap.android.fragment; import org.wheelmap.android.app.WheelmapApp; import org.wheelmap.android.model.Extra; import org.wheelmap.android.online.R; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.widget.EditText; import android.widget.R...
Markdown
UTF-8
7,727
2.546875
3
[]
no_license
# Download Song of Angels (Kei Yadosh) Video and Lyrics | Dunsin Oyekan [Music](https://estheradeniyi.com/category/music/) # Download Song of Angels (Kei Yadosh) Video and Lyrics | Dunsin Oyekan by [Esther Adeniyi](https://estheradeniyi.com/author/esther-adeniyi/)on [October 17, 2018October 17, 2018](https://estherad...
Markdown
UTF-8
1,598
2.796875
3
[]
no_license
#Radio_Performance.py ## A tool for monitoring radio performance using NMEA Messages ### Usage >Radio_Performance.py [-h] [--version] [-T] [-c] [-d DURATION] [-v] host port [name [name ...]] ####positional arguments: > host: GNSS Receiver IP or name > port: ...
Java
UTF-8
1,522
4.28125
4
[]
no_license
package LeetCode; /** * LeetCode 191 * 题意: * 编写一个函数,输入是一个无符号整数,返回其二进制表达式中数字位数为 ‘1’ 的个数(也被称为汉明重量)。 * 输入:00000000000000000000000000001011 * 输出:3 * 解释:输入的二进制串 00000000000000000000000000001011 中,共有三位为 '1'。 * 输入:11111111111111111111111111111101 * 输出:31 * 解释:输入的二进制串 11111111111111111111111111111101 中,共有 31 位为 '1'。 ...
Java
UTF-8
1,278
2.140625
2
[]
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 telus.test.voting.serviceImpl; import java.util.ArrayList; import org.springframework.beans.factory.annotation.Autowired; impo...
Java
UTF-8
8,412
1.679688
2
[]
no_license
package hba; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import common.FormatDateText; import layout.MenuModel; import model.CustomerContact; im...
Java
UTF-8
2,925
2.515625
3
[]
no_license
package com.buu.se.s55160026.mysqlite_student; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.EditText; public class DetailActivity extends Activity { private StudentOper...
Python
UTF-8
2,747
2.828125
3
[]
no_license
import torch import torch.nn as nn import torch.nn.functional as F class DCGAN(nn.Module): ''' DCGAN model based on Pytorch DCGAN tutorial. Modules: Generator (z -> x), Distriminator (x, x_rec -> {0,1}) ''' def __init__(self, device, g, d, size_z, lr_g=0.0002, lr_d=0.0002, smoothing=0.0): s...
Markdown
UTF-8
2,782
3.328125
3
[ "Apache-2.0" ]
permissive
--- title: 並べ替えによるGraphQLクエリ description: GraphQL クエリでソートを実装する方法 --- このガイドでは、GraphQL 変換ライブラリを使用してGraphQL APIでソートを実装する方法を説明します。 ### 概要 始めるには、Todo アプリの基本的なGraphQLスキーマから始めましょう。 ```graphql type Todo @model { id: ID! title: String! } ``` API が `@model` ディレクティブで作成されると、次のクエリが自動的に作成されます。 ```graphql type Query { get...
Java
UTF-8
322
2.109375
2
[]
no_license
package cartesianplane.engine; import javafx.scene.shape.Shape; /** * User: hugo_<br/> * Date: 18/10/2017<br/> * Time: 23:40<br/> */ public class RelativeShape { Shape shape; Coord coord; public RelativeShape(Shape shape, Coord coord) { this.shape = shape; this.coord = coord; } ...
Python
UTF-8
480
3.140625
3
[]
no_license
class Solution(object): def clumsy(self, N): """ :type N: int :rtype: int """ n = N infix = "" c = 0 ops = ["*", "//", "+", "-"] while n > 1: infix += str(n) n -= 1 k = c % 4 infix += ops[k] ...
Python
UTF-8
218
3.984375
4
[]
no_license
#ELI PRUSHANSKY 151019 import turtle #This turtle moves forward 200 units, then turns left 144 degrees 5 times each to make a five pointed star star=turtle.Turtle() for x in range(5): star.forward(200) star.left(144)
Java
UTF-8
1,902
2.203125
2
[]
no_license
package com.task; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.Robolectric; import org.robolectric.RobolectricTestRunner; import static org.hamcrest.CoreMatchers.equalT...
Markdown
UTF-8
2,623
3.171875
3
[]
no_license
# 动态变量 运行时才能决定的变量 ##### 申请 ```C++ int * ptr = new int ``` ptr本身在展空间,但是同时申请了一个它指向的空间 ```c++ (int *)malloc(sizeof(int) * 10) new int[10] ``` 函数只知道空间,不知道类型 ##### 差别 * 强制类型转换 * 如果是对于OO,new自动调用构造函数。 * new作为操作符,可以进行重载。 new的时候可能不成功,要做有效性判断,要看返回的是不是null。失败了要做异常处理。申请资源可能失败 new_handler() 代替系统处理,要注意能退出去 ##### 归还 free...
Markdown
UTF-8
960
4.03125
4
[]
no_license
# Inorder List ## Motivation Algorithm Inorder(tree) 1. Traverse the left subtree, i.e., call Inorder(left-subtree) 2. Visit the root. 3. Traverse the right subtree, i.e., call Inorder(right-subtree) # Problem Description Given the following Binary tree definition: ''' class Node: def __init__(self,key,left=None,r...
Java
UTF-8
1,142
3.640625
4
[]
no_license
import java.lang.Math; import java.util.Scanner; class CompletingSquare { public static void main(String[] args) { System.out.println("Welcome to the CompletingSquare Finder !! :: "); Scanner sc1 = new Scanner(System.in); Scanner sc2 = new Scanner(System.in); Scanner sc3 = new Scan...
Python
UTF-8
5,530
3.21875
3
[]
no_license
# from bs4 import BeautifulSoup # # html = ''' # <html><head><title>The Dormouse's story</title></head> # <body> # <p class="title"><b>The Dormouse's story</b></p> # # <p class="story">Once upon a time there were three little sisters; and their names were # <a href="http://example.com/elsie" class="sister" id="link1">E...
Python
UTF-8
1,687
2.640625
3
[]
no_license
import analyser as als import sys import os import subprocess import traceback os_logo = " @@@ @@@@@@ @@@ @@@ @@@ @@@@@@ @@@ @@@ @@@ @@@@@@\n @@@ @@@@@@@@ @@@@ @@@ @@@ @@@@@@@ @@@ @@@ @@@ @@@@@@@@\n @@! @@! @@@ @@!@!@@@ @@! !@@ @@! @@! @@! @@! @@@\n !@! !...
C++
UTF-8
1,999
3.03125
3
[]
no_license
// Rational Sum (20) // 时间限制 1000 ms 内存限制 65536 KB 代码长度限制 100 KB 判断程序 Standard (来自 小小) // 题目描述 // Given N rational numbers in the form "numerator/denominator", you are supposed to calculate their sum. // 输入描述: // Each input file contains one test case. Each case starts with a positive integer N (<=100), // followed i...
Markdown
UTF-8
481
2.515625
3
[]
no_license
# Infinite Scroll Blog Posts This little project made with by **Vanilla Javascript**. # Files Inside of my repository, I have created and used it the two folder which is **js & css!** > As a matter of fact, this little project is in order to use in my some others project such as travel blogging which is one of my ...
C++
UTF-8
948
2.90625
3
[]
no_license
#include "IDataIO.h" #include "../BotException.h" unsigned int IDataIO::getPos() const { return pos; } unsigned int IDataIO::getSize() const { return size; } void IDataIO::setPos(unsigned int position) { isPosOK(position); pos = position; } void IDataIO::advancePos(int amount) { isPosOK(pos + am...
Java
UTF-8
2,247
2.109375
2
[]
no_license
package org.consume.com.user.service; import com.github.pagehelper.Page; import org.apache.ibatis.annotations.Param; import org.consume.com.user.model.UserModel; import java.util.List; /** * @name 人员资料接口 */ public interface UserService { /** * add * * @param model UserModel * @return int ...
SQL
UTF-8
3,472
3.484375
3
[]
no_license
/***** Database QuanLyHoaDon *****/ CREATE DATABASE QuanLyHoaDon USE QuanLyHoaDon CREATE TABLE KHACHHANG ( MAKH char(10) PRIMARY KEY, HO nvarchar(20) NOT NULL, TEN nvarchar(20) NOT NULL, NGSINH SMALLDATETIME NOT NULL, DUONG nvarchar(40) NOT NULL, QUAN nvarchar(40) NOT NULL, TPHO nvarchar(40) NOT NULL, DTHOAI ...
C++
UTF-8
413
2.71875
3
[]
no_license
// // ListNode.cpp // Assignment 8 // // Created by zane saul on 12/9/17. // Copyright © 2017 zane saul. All rights reserved. // #include "ListNode.h" ListNode::ListNode( ) { next= nullptr; } ListNode *ListNode::getNext( ){ return next; } void ListNode::setNext( ListNode *newnode ){ next = newnode; } int ...
Python
UTF-8
4,539
3.34375
3
[]
no_license
# -*- coding: utf-8 -*- ######################## # Phylogenetic Trees # ######################## class PhylNode: def __init__(self, distance = None, ch=[]): self.children = ch self.distance = distance def get_children(self): ch=[] for i in self.children: ch.append(...
C#
UTF-8
3,553
2.6875
3
[]
no_license
using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Net.Http; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; using St_Dogmaels.Models; using Xamarin.Forms; namespace St_Dogmaels.Services { class AzureDataStore : IDataStore<Place> { ...
Java
UTF-8
9,443
2.015625
2
[]
no_license
package de.tomsplayground.peanuts.client.editors.security; import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDate; import java.time.temporal.ChronoUnit; import java.time.temporal.TemporalUnit; import java.util.ArrayList; import java.util.List; import org.eclipse.core.runtime.IProgressM...
PHP
UTF-8
1,451
2.8125
3
[]
no_license
<?php namespace App\Services\Employees; use App\Services\Companies\CompanyService; use App\Repositories\Employees\EmployeeRepository; use Symfony\Component\HttpKernel\Exception\UnprocessableEntityHttpException; class EmployeeService { private $employeeRepository; private $companyService; public functio...
JavaScript
UTF-8
5,060
2.578125
3
[]
no_license
/* **** For create a new Scene **** * * @step 1 Copy the content of this file in a new .js document. * ---------------------------------------------------------------------------------------------------------------------------- * @step 2 Save the new file in Assets/Javascript/Scenes/NameOfYourScene.js . ...