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
Java
UTF-8
5,891
2.359375
2
[ "MIT" ]
permissive
package spacesurvival.view.game.utilities; import spacesurvival.model.World; import spacesurvival.model.collision.bounding.CircleBoundingBox; import spacesurvival.model.common.Pair; import spacesurvival.model.gameobject.GameObject; import spacesurvival.model.gameobject.fireable.Boss; import spacesurvival.model.gameobj...
Ruby
UTF-8
3,491
3.109375
3
[]
no_license
# -*- coding: utf-8 -*- # vi: fenc=utf-8:expandtab:ts=2:sw=2:sts=2 # # Author:: Petr Kovar (mailto:pejuko@gmail.com) # Copyright:: Copyright (c) 2011 Petr Kovář # License:: Distributes under the same terms as Ruby module ScanEnhancer class Box STROKE = "#f00f" FILL = "#fff0" attr_accessor :left, ...
Shell
UTF-8
43,156
2.53125
3
[]
no_license
#!/bin/bash # edit by hackjackyer #因为这个程序基于py的,所以需要安装py环境 rpm -qa |grep python 1>/etc/null 2>&1 && echo "python has already installed" || yum -y install python sleep 3 #将py指令输出到speedtest.py文件 echo "#!/usr/bin/env python" >>speedtest.py echo "# -*- coding: utf-8 -*-" >>speedtest.py echo "# Copyright 2012-2015 Matt Martz...
C#
UTF-8
1,411
2.59375
3
[ "MIT" ]
permissive
using System; using System.Linq; using System.Threading; using System.Timers; using channelbot_2.Interfaces; using channelbot_2.Models; using Microsoft.EntityFrameworkCore; namespace channelbot_2 { public class RedditPostMaker : IPoller { // Post messages every 30m, check for it (incase the reddit req...
PHP
UTF-8
3,569
2.765625
3
[ "MIT" ]
permissive
<?php namespace Commercetools\Core\Builder\Update; use Commercetools\Core\Error\InvalidArgumentException; use Commercetools\Core\Request\AbstractAction; use Commercetools\Core\Request\Extensions\Command\ExtensionChangeDestinationAction; use Commercetools\Core\Request\Extensions\Command\ExtensionChangeTriggersAction; ...
Shell
UTF-8
5,637
3.671875
4
[]
permissive
#!/usr/bin/env bash # # NOTE: # - $! is tested in background.test.sh # - $- is tested in sh-options # # TODO: It would be nice to make a table, like: # # $$ $BASHPID $PPID $SHLVL $BASH_SUBSHELL # X # (Subshell, Command Sub, Pipeline, Spawn $0) # # And see whether the variable changed. #### $PWD is set # Jus...
Java
UTF-8
748
2.25
2
[]
no_license
package com.yutai.audio.model.dao.user; import java.util.List; import com.yutai.audio.model.beans.user.User; public interface IUserDAO { //注册 public abstract boolean addUser(User user); //根据ID查找用户 public abstract User selectUserByID(int user_id); //根据手机号查找用户 public abstract User selectUserByPhone(String use...
PHP
UTF-8
1,668
2.796875
3
[ "Apache-2.0" ]
permissive
<?php include_once("../config.inc.php"); include_once("../db.inc.php"); include_once("../utils.inc.php"); $input = json_decode(file_get_contents('php://input'),true); $uploadOk = true; // Verify parameter of the song. if(empty($input['trackName']) || empty($input['artist']) || !is_int($input['genre'])) { logErro...
Java
UTF-8
1,945
2.296875
2
[]
no_license
package com.movie.pitang.models.results; import java.util.Set; public abstract class ProgramaResult { private String poster_path; private String overview; private Set<Integer> genre_ids; private long id; private String original_language; private String backdrop_path; private double popular...
Java
UTF-8
18,287
2.40625
2
[]
no_license
package an.xacml.policy.function; import static an.xacml.policy.AttributeValue.FALSE; import static an.xacml.policy.AttributeValue.TRUE; import java.math.BigInteger; import java.net.URI; import java.util.HashSet; import java.util.Set; import an.xacml.Constants; import an.xacml.IndeterminateException; imp...
Java
UTF-8
170
1.796875
2
[]
no_license
package com.jajahome.service; import com.jajahome.po.User; public interface UserService { User selectUserByUserAndPass(User user); int insert(User record); }
Java
UTF-8
9,174
2.109375
2
[]
no_license
package ru.zzsdeo.mymoneybalance; import android.app.DialogFragment; import android.app.Fragment; import android.app.LoaderManager.LoaderCallbacks; import android.content.ComponentName; import android.content.ContentValues; import android.content.CursorLoader; import android.content.Intent; import android.content.Load...
Java
UTF-8
2,159
3.296875
3
[]
no_license
public class Solution { public String minWindow(String S, String T) { int cnt = 0; // Used for finding the first window int len = 0; // Length of current window int min = 0; boolean found = false; String result = ""; Map<Character, Integer> needToFind = new Ha...
Java
UTF-8
3,703
2.40625
2
[]
no_license
package com.zealot.boss.base.service.authorize.impl; import java.util.*; import javax.annotation.Resource; import org.springframework.stereotype.Service; import com.zealot.boss.base.dao.authorize.DepartmentDao; import com.zealot.boss.base.entity.authorize.Department; import com.zealot.boss.base.service.au...
Python
UTF-8
369
2.75
3
[]
no_license
from microbit import * def display_acc_data(): my_send = accelerometer.get_values() display.scroll("x") display.scroll(str(my_send[0])) display.scroll("y") display.scroll(str(my_send[1])) display.scroll("z") display.scroll(str(my_send[2])) sleep(800) while True: i...
C++
UTF-8
1,272
2.578125
3
[]
no_license
#include <utilities/config.h> using namespace utilities; Config::Config(std::string package_name) : package_name(package_name) { } void Config::loadParam(ros::NodeHandle *nh, std::string name, std::string &param, std::string default_param) { nh->param<std::string>(name, param, default_param); ROS_INFO("[%s::Co...
C++
UTF-8
1,946
2.546875
3
[ "MIT" ]
permissive
/************************************************************************ STM32F746 Discovery show SD-card directory on TFT Required libraries: GFX, Adafruit Installation Instructions: 1. Import the Adadruit library in the menue Sketch=>Include Libraries=>Manage Libraries => Adafruit ILI9341 2. Impo...
Go
UTF-8
2,362
3.078125
3
[ "BSD-3-Clause" ]
permissive
package ast // superGlobalScope represents the scope containing superglobals such as $_GET type SuperGlobalScope struct { Identifiers []Variable } // globalScope represents the global scope on which functions and classes are // defined. This is always within a namespace, but in many cases that may just // be the def...
JavaScript
UTF-8
2,586
2.90625
3
[]
no_license
const MoveState = cc.Enum({ NONE : -1, IDLE : -1, UP : -1, RIGHT : -1, LEFT : -1, DOWN : -1 }); cc.Class({ extends : cc.Component, properties: { moveSpeed : 0, }, statics : { MoveState : MoveState }, //use node on to react with ev...
Java
UTF-8
349
1.695313
2
[ "MIT" ]
permissive
package de.rieckpil.learning.codingchallenges; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class CodingChallengesApplication { public static void main(String[] args) { SpringApplication.run(CodingChallengesAp...
C++
UHC
4,077
2.640625
3
[ "Apache-2.0" ]
permissive
// *************************************************************** // UIRectString version: 1.0 ? date: 08/01/2008 // ------------------------------------------------------------- // Ͽ ؽƮ ϴ ƾ // ------------------------------------------------------------- // Copyright (C) 2008 - All Rights Reserved // *****...
Markdown
UTF-8
1,370
2.53125
3
[]
no_license
--- layout: post title: laravel5.2で検索結果の詳細表示 date: 2016-03-29 05:52:14 categories: laravel laravel-5 --- <p>お世話になります。<br> <a href="http://qiita.com/zaburo/items/9fefa3f6834b2e79b734" rel="nofollow">http://qiita.com/zaburo/items/9fefa3f6834b2e79b734</a><br> こちらを参考にし、laravelで検索を実装することができました。</p> <p>しかしながら検索の詳細表示ができず困ってい...
SQL
UTF-8
2,201
3.90625
4
[]
no_license
create table user (id int not null primary key auto_increment, name char(20) not null , age tinyint not null default 20, sex enum('m','w') default 'm' ); create table friend_circle (id int not null primary key auto_increment, uid int not null, content text default null, place char(20) default null, posted_time dateti...
Java
UTF-8
10,243
2.015625
2
[]
no_license
/** BamSeqChksum Copyright (C) 2009-2014 German Tischler Copyright (C) 2011-2014 Genome Research Limited This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of th...
Shell
UTF-8
1,505
3.40625
3
[]
no_license
#!/bin/sh exec >/dev/null __devroot() { [ ! -e /dev/root ] || return 0 export $(tr " " "\n" < /proc/cmdline | grep root=) [ -n "$root" ] || root=/dev/mmcblk0p2 [ $root = /dev/nfs ] || ln -s $root /dev/root 2>/dev/null| : } __devroot t="$2" b=$1 remount=no tp="" [ "$b" = /dev/root ] && export $(tr ...
Java
UTF-8
5,178
2.484375
2
[]
permissive
/* Copyright (C) 2005-2011 Fabio Riccardi */ package com.lightcrafts.ui.editor; import com.lightcrafts.image.BadImageFileException; import com.lightcrafts.image.ImageInfo; import com.lightcrafts.image.UnknownImageTypeException; import com.lightcrafts.image.types.ImageType; import com.lightcrafts.image.types.LZNDocume...
Go
UTF-8
780
2.625
3
[ "MIT" ]
permissive
package main import ( "bytes" "github.com/bcmk/go-smtpd/smtpd" "github.com/jhillyerd/enmime" ) type env struct { *smtpd.BasicEnvelope from smtpd.MailAddress data []byte mime *enmime.Envelope rcpts []smtpd.MailAddress ch chan<- *env } // Close implements smtpd.Envelope.Close func (e *env) Close() erro...
Python
UTF-8
13,047
3.515625
4
[]
no_license
import json import numpy import utils from math import exp from random import random """ ######################### DIMENSIONS ################################ Here are the different matrices: self.matrix_weights1 -> INPUT_SIZE * HIDDEN_LAYER_SIZE (takes in input, outputs input for hidden layer) self.matrix_weights2 ...
Markdown
UTF-8
485
2.703125
3
[]
no_license
# Catch-the-monkey 🐒 Minigame idealized for me while I was creating a sliding ad. The object of the game is to catch the crazy monkey that appears randomly on the screen. ## Starting There is no need to install anything, as this game was created with HTML, CSS and pure JS. You can access the [game link](https://luca...
Java
UTF-8
565
1.671875
2
[]
no_license
package com.yiban.yiban_application.web.service.empl; import com.yiban.yiban_application.javabean.Wall_trends; import com.yiban.yiban_application.web.service.IndexServiceInterface; import org.springframework.stereotype.Service; import java.util.List; @Service public class IndexService implements IndexServiceInterfac...
Markdown
UTF-8
7,448
3.421875
3
[]
no_license
## [Biology Meets Programming: Bioinformatics for Beginners](https://www.coursera.org/learn/bioinformatics?) <b>Course description:</b><br> This course will cover algorithms for solving various biological problems along with a handful of programming challenges helping you implement these algorithms in Python. It off...
TypeScript
UTF-8
2,053
3.671875
4
[ "MIT" ]
permissive
/** * Take input from [0, n] and return it as [0, 1] * @hidden */ export function bound01(n: any, max: number) { if (isOnePointZero(n)) { n = '100%'; } const processPercent = isPercentage(n); n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n))); // Automatically convert percentage into num...
Java
UTF-8
2,147
2.3125
2
[]
no_license
package mgplugin.generator.entity; /** * <pre> * @programName : 프로그램명 * @description : 프로그램_처리내용 * @history * ---------- --------------- ------------------------------------------------------------------ * 수정일 수정자 수정내용 * ---------- --------------- ------------------------------...
Python
UTF-8
651
4.1875
4
[]
no_license
#!/usr/bin/python print("You find yourself in a room with eight doors.") print("Each door is numbered starting at 1.") print("") myDoor = input("Select a door 1-8: ") # Example use of in as a condition # The list used here is a predefined list; but could be a variable instead if myDoor in (1,3,6,8): print("You ent...
Java
UTF-8
1,137
2.296875
2
[]
no_license
package com.stfl.service; import com.stfl.user.ApplicationUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.crypto.bcrypt.BCryptPasswor...
Markdown
UTF-8
435
3.296875
3
[ "MIT" ]
permissive
# thread-first Like the thread first macro in clojure https://clojure.org/guides/threading_macros # install `npm install thread-first` # usage ```javascript var threadFirst = require('thread-first') function head (array) { return Array.isArray(array) && array[0] } var text = 'abcd' var X = threadFirst(...
Java
UTF-8
308
1.835938
2
[]
no_license
package org.gradle.test.performancenull_134; import static org.junit.Assert.*; public class Testnull_13303 { private final Productionnull_13303 production = new Productionnull_13303("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
Swift
UTF-8
7,234
2.859375
3
[]
no_license
// // ViewController.swift // SearchRank // // Created by hanwe on 2021/07/19. // import Cocoa class ViewController: NSViewController { override func viewDidLoad() { super.viewDidLoad() print("1: \(solution(["java backend junior pizza 150","python frontend senior chicken 210","python ...
Python
UTF-8
4,799
3.296875
3
[]
no_license
# /usr/bin/env python # __author__ = 'P0WER1ISA' # __homepage__ = 'https://github.com/P0WER1ISA' # __builddate__:2017/8/9 12:44 # 6.1 读写CSV数据 import csv from collections import namedtuple with open('data/stocks.csv') as f: f_csv = csv.reader(f) headings = next(f_csv) # 读取成元组序列 print(headings) Row = n...
Python
UTF-8
382
4.3125
4
[]
no_license
# -*- encoding=utf8 -*- # 提示用户输入分数,获取用户输入内容,并保存到变量 data data = input('请输入分数:') # 将用户输入分数从字符串转成整数数值,并保存到变量 score score = int(data) if score >= 90: print('优秀') elif score >= 70: print('良好') elif score >= 60: print('及格') else: print('不及格')
SQL
UTF-8
2,312
4.09375
4
[]
no_license
#achar todos os contatos de todas as listas de contatos de um usuario COM VIEW SELECT DISTINCT LDC.NOME, U.* FROM USUARIO_SIMPLES DONO JOIN LISTA_DE_CONTATOS LDC ON DONO.USUARIO_ID = DONO JOIN USUARIO_SIMPLES U ON U.USUARIO_ID = LDC.USUARIO_ID WHERE DONO.USUARIO_ID = 1 ORDER BY LDC.NOME; #achar todas as mensagens de ...
Python
UTF-8
2,278
4.21875
4
[]
no_license
################## # Built-in Lists # ################## # Initialize peoples = ["Mao", "Chou", "Liu"] print peoples print peoples[0] # >> First Element: "Mao" print peoples[-1] # >> Last Element: "Liu" print len(peoples) # >> 3 # Everything fits jianguo = [1949, "Beijing", "China", peoples] print jianguo # Add Elem...
C++
UTF-8
322
2.796875
3
[]
no_license
/* * *** ***** ******* ********* */ #include<iostream> using namespace std; int main(){ int i,j,k; int s =1; for (i=4; i >= 0 ; i--){ for (j=0; j <= i ; j++){ cout << " "; } for (k=0; k<s ; k++){ cout << "*"; } s = s+ 2; cout <<endl; } return 0; }...
Java
UTF-8
9,086
2.078125
2
[]
no_license
package top.leonx.vanity.data; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import io.netty.handler.codec.DecoderException; import io.netty.handler.codec.EncoderException; import net.minecraft.crash.CrashReport; import net.minecraft.crash.CrashReportCategory; import net.minecraft.cras...
Markdown
UTF-8
398
3.109375
3
[]
no_license
# My Movie List This mini project is a vanilla JavaScript movie list in which you will be able to add movies (title, director and genre) and delete them. # Motivation * Implementing ES6 classes. * Interacting with local storage. * Dealing with Events. # Screenshot Check out the end result :point_right: [MyMovieL...
C#
UTF-8
298
2.953125
3
[]
no_license
public Employee(Person person) { // clone property values foreach (var property in person.GetType().GetProperties().Where(property => property.CanRead && property.CanWrite)) { property.SetValue(this, property.GetValue(user, null), null); } }
Python
UTF-8
2,284
3.4375
3
[]
no_license
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ class Node(object): def __init__(self,data=0,which_T=None): self.leaf = [] self.data=data self.which_T=[] class SuffixTree(object): def __init__(self): self.root = Node() def add...
Java
UTF-8
614
1.96875
2
[]
no_license
package com.sb.demo.security1.domain; import java.io.Serializable; /** * security 权限demo第一套 * * @date 2020年3月27日 下午11:11:36 * @author jdr */ public class SysUserRole1 implements Serializable { private static final long serialVersionUID = 1L; private Integer userId; private Integer r...
JavaScript
UTF-8
1,334
2.953125
3
[]
no_license
const $ = document.querySelector.bind(document) const $$ = document.querySelectorAll.bind(document) /* 1. Next/Prev 2. Auto next 3. Nav Active 4. Click Nav Active */ const IMAGE_WIDTH = 980 const silderContent = $('.slider-content') const sliderItem = $$('.slider-item') const nextBtn = $('.control.ne...
C++
UTF-8
986
3
3
[]
no_license
class Solution { public: vector<vector<int>> combinationSum(vector<int>& candidates, int target) { int len = candidates.size(); vector<vector<int>> res; if(!len) return res; vector<int> comb; sort(candidates.begin(), candidates.end()); comb_target...
Python
UTF-8
526
4.25
4
[]
no_license
# Faça um Programa que leia três números e mostre-os em ordem decrescente. n = int(input("Informe um numero: ")) n1 = int(input("Informe um numero: ")) n2 = int(input("Informe um numero: ")) if n > n1 and n > n2 and n1 > n2: ordem = n, n1, n2 elif n > n2 and n > n1 and n1 < n2: ordem = n, n2, n1 elif n1 > n2 ...
Swift
UTF-8
1,488
2.609375
3
[ "MIT" ]
permissive
// // PacketSpec.swift // TunnelPacketKit // // Created by Zhuhao Wang on 16/1/20. // Copyright © 2016年 Zhuhao Wang. All rights reserved. // import Foundation import Nimble import Quick @testable import TunnelPacketKit class IPPacketSpec: QuickSpec { override func spec() { var packetData: NSData! ...
TypeScript
UTF-8
343
3.5625
4
[]
no_license
/** * 647. 回文子串 * https://leetcode-cn.com/problems/palindromic-substrings/ */ export default function PalindromicSubstrings() { } PalindromicSubstrings(); /** * 计算这个字符串中有多少个回文子串 * @param {string} s * @return {number} {number} */ function countSubstrings(s: string): number { return 0; }
Python
UTF-8
986
3.375
3
[]
no_license
# Uses python3 import numpy def edit_distance(s1, s2): len_1 = len(s1) len_2 = len(s2) dpresult = numpy.zeros((len_1+1 , len_2+1)) # a martix for i in range(len_2+1): # edit distance for a null string and another string is just length of string dpresult[0][i] = i for i in range(len_1+1): ...
JavaScript
UTF-8
1,056
2.6875
3
[]
no_license
import React, { Component } from 'react' import axios from "axios"; class Person extends Component { constructor() { super(); this.state = { person: {} } } componentDidMount() { axios.get(`https://swapi.co/api/people/${this.props.match.params.id}`) .t...
JavaScript
UTF-8
369
2.734375
3
[]
no_license
var BulletMixin = Base => class extends Base { shooted() { var bullet = this; this.interval_id = setInterval(function() { bullet.pattern(); }, 1000 / _fps); } pattern() { // some pattern this.move_next(); } move_next() { this.x += this.vector.x; this.y += this.vector.y; } destro...
Java
UTF-8
1,355
2.1875
2
[]
no_license
package com.lover.service.imp; import com.lover.dao.MessageDao; import com.lover.entity.Constant; import com.lover.entity.Feedback; import com.lover.entity.Message; import com.lover.entity.Result; import com.lover.service.MessageService; import org.springframework.beans.factory.annotation.Autowired; import org.springf...
TypeScript
UTF-8
1,135
2.828125
3
[ "MIT" ]
permissive
import { Injectable } from '@angular/core'; @Injectable() export class IDialogService { alert(message: string): void { return void (0); }; error(error: any): string { return ''; }; prompt(message: string): string { return ''; }; } @Injectable() export class DialogService implements IDialogService { al...
Ruby
UTF-8
669
3.5625
4
[]
no_license
# Random sorted arrays class Random class << self def int_array(size: 0, max: 0, sort: true) arr = [] while arr.size < size elem = rand(max) arr << elem unless arr.include?(elem) end return arr unless sort arr.sort end def str_array(size: 0, str_len: 0, sort...
Python
UTF-8
9,856
2.6875
3
[ "MIT" ]
permissive
from libsaas.services import base from libsaas import http, parsers class Link(base.Resource): path = 'link' def __init__(self, parent, link): self.parent = parent self.object_id = link def get_url(self): return '{0}/{1}'.format(self.parent.get_url(), self.path) def _get(sel...
Markdown
UTF-8
10,179
3.15625
3
[]
no_license
# MVVM-Sample-Android-App ** MVVM with Data Binding on Android has the benefits of easier testing and modularity, while also reducing the amount of glue code that we have to write to connect the view + model. Let’s examine the parts of MVVM. ## Model The model is the Data + State + Business logic of our Tic-Tac-Toe ...
Markdown
UTF-8
4,977
2.546875
3
[]
no_license
--- author: name: Hildebrant picture: 110392 body: 'Hello to all... it&#39;s been some while since I had much opportunity to contribute. Good to have a free moment to get back in the community. <BR> <BR>I&#39;m looking for some ideas, along the lines of type suggestions for an identity I &#40;we&#41; are deve...
Java
UTF-8
1,589
3.359375
3
[]
no_license
package com.apisero; import java.util.Date; public class Example2 { public static int add(int a, int b) { return a + b; } protected static int subtract(int a, int b) { return a - b; } static int multiply(int a, int b) { return a * b; } private static float divide(int a, int b) { return (float) a / b; } ...
C
UTF-8
1,734
2.515625
3
[]
no_license
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_conversion_format_check.c :+: :+: :+: ...
SQL
UTF-8
718
3.84375
4
[]
no_license
DELIMITER ;; DROP PROCEDURE IF EXISTS most_expensive_products;; CREATE PROCEDURE most_expensive_products() BEGIN DECLARE parameter INT; SELECT value INTO parameter FROM ad.parameter WHERE name = 'MOST_EXPENSIVE'; SELECT pc.name, top5.price FROM productcategory AS pc INNER JOIN ( SELEC...
JavaScript
UTF-8
1,351
2.671875
3
[]
no_license
import React, { Component } from "react"; class ValidatingForm extends Component { state = { user: '' } handleChange = event => { this.setState({ user: event.target.value }) } handleSubmit = event => { let a = 'a'; event.preventDefault(); alert(...
JavaScript
UTF-8
8,124
2.6875
3
[]
no_license
/** * @file 轮播 * @author musicode */ define(function (require, exports, module) { 'use strict'; var toNumber = require('../function/toNumber'); var Switchable = require('../helper/Switchable'); var Iterator = require('../helper/Iterator'); var lifeUtil = require('../util/life'); /** ...
Java
UTF-8
968
2.765625
3
[ "Apache-2.0" ]
permissive
package bit.operations; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class BitsCountTest extends TestCase { /** * Create the test case * * @param testName * name of the test case */ public BitsCountT...
Java
UTF-8
1,402
2.375
2
[]
no_license
package com.google.firebase.codelab.friendlychat; import android.util.Log; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.databa...
C
GB18030
988
4.03125
4
[]
no_license
// дһû֣ȻҪûϡ // һдӡһдӡÿеĸĸ // ĸӦֵĽβ룬ʾ // Melissa Honeybee // 7 8 // ȻӡͬϢĸӦʵĿʼ롣 // Melissa Honeybee // 7 8 #include <stdio.h> #include <string.h> int main() { char first_name[21]; char last_name[21]; int count_first; int count_last; printf("type your first name : "); scanf("%s",...
Python
UTF-8
8,504
2.859375
3
[]
no_license
# import the necessary packages #import four_point_transform function from transform_new.py file from four import * from crop_test import * from ellipse import * import numpy as np import cv2 ################################################################################ ## The following code is strongly derived fro...
Java
UTF-8
859
2.109375
2
[]
no_license
package com.appium.screen.flows; import com.appium.config.CommonAppiumTest; import com.appium.config.DeviceInterface; import com.appium.page.objects.HomePageObject; import com.appium.pages.Login; import io.appium.java_client.AppiumDriver; import io.appium.java_client.MobileElement; import java.io.IOException; public...
JavaScript
UTF-8
517
3.6875
4
[]
no_license
function solution(people, limit) { people.sort((a, b) => a - b); // 그냥 sort하면 2자리 이상일 때 정렬안됨 let count = 0; let l = 0; let r = people.length - 1; while (l <= r) { if (people[l] + people[r] <= limit) l++; count++; r--; //최소값과 최댓값이 limit보다 크면 최댓값을 보트태워보낸다 } return count; } console.log(solution...
Java
UTF-8
3,446
2.328125
2
[]
no_license
package test; import static materialkomponente.BauteilNr.bauteilNr; import materialkomponente.BauteilNr; import materialkomponente.IMaterialServicesFuerFertigung; import materialkomponente.MaterialKomponente; import persistenz.DatabaseConnection; import persistenz.IPersistenzService; import utilities.KeineInventurAto...
C++
UTF-8
969
3.109375
3
[]
no_license
#ifndef SCREEN_H #define SCREEN_H #include <string> #include <vector> #include <iostream> #include "Window_mgr.h" class Screen { public: typedef std::string::size_type pos; typedef std::vector<Screen>::size_type ScreenIndex; public: friend class Window_mgr; friend void Window_mgr::clear(ScreenInd...
Python
UTF-8
2,204
3.09375
3
[]
no_license
import pygame from math import sin, cos, atan, pi from settings import * class Bullet: def __init__(self, x, y, tilesize, direction, t_bullet=False, destination=None): self.speed = 10 self.center = [x, y] self.startpos = self.center[:] self.radius = 4 self.hitbox = pygame.R...
C++
UTF-8
404
3.0625
3
[ "CC0-1.0" ]
permissive
#include "iostream" #include "vector" #include "string" using namespace std; int main() { int num1, num2; while (cin >> num1 >> num2) { try { if (!num2) throw range_error("invalid == 0"); cout << num1 / num2 << endl; } catch (range_error err) { cout << err.wha...
Python
UTF-8
1,755
2.53125
3
[]
no_license
from django.test import TestCase from django.contrib.auth import get_user_model class EmployeeManagerTestCase(TestCase): """ CommonUser model tests. """ def setUp(self): self.User = get_user_model() def test_create_user_ok(self): user = self.User.objects.create_user( ...
Go
UTF-8
1,736
2.9375
3
[]
no_license
package controller import ( "encoding/json" "net/http" "site/backend/model" ) type ProdutoController struct { } func NewProdutoController() *ProdutoController { return &ProdutoController{} } func (produtoC *ProdutoController) BuscarCategorias(w http.ResponseWriter, r *http.Request) { categoria1 := model.Cate...
Go
UTF-8
3,409
2.65625
3
[ "MIT" ]
permissive
package server import ( "encoding/json" "errors" "fmt" "io/ioutil" "net/http" "os" "path" "github.com/ActiveState/tail" ) var tempBuild = path.Join(os.TempDir(), "build") const maxQueue = 20 //Server is an HTTP server accepting requests //for cross-compilation type Server struct { Port string count ...
JavaScript
UTF-8
1,331
2.703125
3
[]
no_license
'use strict'; var request = require("request"); const http = require('http'); const agent = new http.Agent({maxSockets: 30}); // 5 concurrent connections per origin //Promessify la lib request, pour garder le style de codage function request_promise(url, options){ return new Promise( (resolve, reject)=>{ ...
PHP
UTF-8
4,056
2.53125
3
[ "MIT" ]
permissive
<?php error_reporting(E_ALL); ini_set('display_errors', 1); $name = filter_input(INPUT_POST, 'formName', FILTER_SANITIZE_SPECIAL_CHARS); $tel = filter_input(INPUT_POST, 'formTel', FILTER_SANITIZE_SPECIAL_CHARS); $email = filter_input(INPUT_POST, 'formEmail', FILTER_SANI...
C#
UTF-8
5,267
2.703125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.Entity; using System.Linq.Expressions; using System.Reflection; using System.Configuration; using System.Data.Entity.Infrastructure; using System.Data.Objects; namespace MealsToGo.Repository { } // publi...
Markdown
UTF-8
1,056
3.203125
3
[]
no_license
# Verlet Integration This repo uses verlet integration to simulate a world with: - Points - Sticks connecting points - A cloth - A (swinging) block It was mostly inspired by [this paper by Thomas Jakobsen](http://graphics.cs.cmu.edu/nsp/course/15-869/2006/papers/jakobsen.htm). I [wrote a blog](https://040code.githu...
JavaScript
UTF-8
673
2.578125
3
[]
no_license
const message = '<div>Hi {{candidate.name}} !</div><div><br></div><div>Thank you for applying! We have received your application and will keep you updated on the process as soon as your application status changes.</div><div><a href="http://Happo">Happo</a></div><div><br></div><div><a href="http://Happo">Happo</a></div>...
PHP
UTF-8
193
2.625
3
[]
no_license
<?php namespace RonteLtd\Zmq; interface Client { /** * Send message to Queue. * * @return bool Success/Unsuccess */ public function send(string $message): bool; }
JavaScript
UTF-8
1,090
3.703125
4
[ "MIT" ]
permissive
/** * what * * @author GuoBin on */ 'use strict'; function log(param) { console.log(param); } log(parseInt('2')); // [1, NaN, NaN] log(['1', '2', '3'].map(parseInt)); log(['1', '2', '3'].map((val, index, arr) => { console.log(index); // console.log(arr); return parseInt(val, 10); })); // 'object', false l...
C++
UTF-8
683
2.59375
3
[]
no_license
#include "Icon.hpp" #include <cstdlib> Icon::Icon(std::string pathToFile) : pathToFile(pathToFile) { WORD pWord; ICONINFO iconinfo; HICON hIcon = ExtractAssociatedIcon(GetModuleHandle(NULL), pathToFile.c_str(), &pWord); GetIconInfo(hIcon, &iconinfo); hBitmap = iconinfo.hbmColor; if (!hBitmap) exit(1); } ...
Markdown
UTF-8
2,628
2.71875
3
[]
no_license
### Resources ### Parameters (can be referenced via Fn::Ref or !Ref) Example define parameter: ``` Parameters: SecurityGroupDescription: Description: Security Group Description Type: String ``` Example use parameter: ``` ServerSecurityGroup: Type: AWS::EC2::SecurityGroup Properties: GroupDe...
Java
UTF-8
2,330
2.734375
3
[]
no_license
package com.ada.proyectoFinal.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table (name= "Producto") public class Producto { // ATRIBUTOS @Id @Generat...
Ruby
UTF-8
947
3.484375
3
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
def roll_call_dwarves(dwarfs) # takes an array of dwarfs and prints out a numbered list of dwarfs dwarfs.each_with_index {|dwarf, index| puts "#{index + 1} #{dwarf}"} end def summon_captain_planet(planeteer_calls) # takes an array of planeteer calls and returns an array of each planeteer_call # capitalized wit...
Java
UTF-8
2,180
2.140625
2
[]
no_license
package com.pnp; import java.util.ArrayList; import java.util.List; import org.kymjs.aframe.ui.BindView; import org.kymjs.aframe.ui.activity.BaseActivity; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.ListView; import android.widget.TextView; impor...
C#
UTF-8
1,393
2.71875
3
[]
no_license
using CarWebApplication.Models; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace CarWebApplication.Services { public interface IUserData { LoginViewModel UserViewModel { get; set; } IDataSource DataSource { get; set; } bool Chec...
Java
UTF-8
41,540
1.640625
2
[ "Apache-2.0" ]
permissive
// Generated from KafkaSql.g4 by ANTLR 4.7.2 package com.looboo.kafkasql.parser; import org.antlr.v4.runtime.atn.*; import org.antlr.v4.runtime.dfa.DFA; import org.antlr.v4.runtime.*; import org.antlr.v4.runtime.misc.*; import org.antlr.v4.runtime.tree.*; import java.util.List; import java.util.Iterator; import java.ut...
Python
UTF-8
430
2.796875
3
[]
no_license
import psycopg2 class DAO: def __init__(self): self.c = None self.connection = None def connect(self): try: self.c = psycopg2.connect\ ("dbname='simple_blog' user='postgres' host='localhost' password='123456' port='5432'") self.connection = self.c....
Swift
UTF-8
1,197
3.0625
3
[]
no_license
// // Bruker.swift // MemoFrame // // Created by Christopher Reyes on 22.03.2017. // Copyright © 2017 Christopher Reyes. All rights reserved. // import Foundation struct Bruker { /*init (epost: String, alder: Int, kjonn: String, land: String, passord: String) { self.epost = epost ...
Markdown
UTF-8
2,813
2.515625
3
[ "CC-BY-4.0", "MIT" ]
permissive
--- title: Guia de programação (LINQ to DataSet) ms.date: 03/30/2017 ms.assetid: 977aedd7-0084-46a0-b56f-345787a55da1 ms.openlocfilehash: dc13af06cf6c439d739d76904f206ebc50ba3187 ms.sourcegitcommit: 7bc6887ab658550baa78f1520ea735838249345e ms.translationtype: MT ms.contentlocale: pt-BR ms.lasthandoff: 01/03/2020 ms.loc...
Python
UTF-8
831
2.53125
3
[]
no_license
import dynamixel, time portName = "/dev/ttyUSB0" baudRate = 9600 serial = dynamixel.SerialStream(port = portName, baudrate = baudRate, timeout = 1) print "connect" net = dynamixel.DynamixelNetwork(serial) net.scan(1, 1) myActuators = list() pos = 0 print "Scanning for Dynamixels..." #print net.get_dynamixels() for ...
Python
UTF-8
458
2.625
3
[]
no_license
H,W=map(int,input().split()) s=[list(map(int, list(input().replace('#','1').replace('.','0')))) for _ in range(H)] padded = [[0 for i in range(W+2)] for j in range(H+2)] for i in range(H): for j in range(W): padded[i+1][j+1] = s[i][j] for i in range(1,H+1): for j in range(1,W+1): if padded[i][j]==1: ...
C#
UTF-8
10,621
2.515625
3
[]
no_license
using System; using System.Data.Entity; using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; using EmaTours.DAL.Factory; using System.Data.Entity.Validation; using System.Collections; using System.Collections.Generic; using System.Data; using EmaTours.Entities; using System.Data.Entity.Migra...