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
2,229
2.46875
2
[]
no_license
package com.example.noteproject; import android.content.Context; import android.content.Intent; import android.widget.Toast; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; impo...
C
UTF-8
1,327
3.84375
4
[]
no_license
//16进制转10进制 #include<stdio.h> #include<string.h> int convert(char *p) { int n; if(*p >= '0'&&*p <= '9') { n = *p-'0'; p++; } else if (*p =='a'||*p =='A') { n = 10; p++; } else if(*p =='b'||*p =='B') { n = 11; p++; } else if(*p =='c'||*p =='C') { n = 12; ...
C
UTF-8
27,019
2.71875
3
[]
no_license
// // main.c // homework_NN2 // // Created by 末廣勇祐 on 2020/04/16. // Copyright © 2020 末廣勇祐. All rights reserved. // #include <stdio.h> #include <stdlib.h> #include <time.h> #include <math.h> #define COUNT_SIZE 20000 void input_data(int *num); //データの入力をする関数 void output_w(int innum, int outnum, int mid_width,...
PHP
UTF-8
590
2.515625
3
[]
no_license
<?php include("../funciones/librerias.php"); extract($_GET); $conexion = conectar(); $sql="SELECT * FROM personal WHERE id = " .$p." "; $result = consultar($conexion,$sql); $row = asociativo($result); echo "<table border='1'> <tr> <th>Firstname:</th> <th>Lastname</th> <th>Age</th> <th>Hometown</th> <th>Job</th> </tr...
PHP
UTF-8
267
2.625
3
[]
no_license
<?php class View { function __construct() { } function render($carp,$vista){ $file='Views/'.$carp.'/'.$vista.'.php'; if (file_exists($file)) { include_once $file; }else{ echo "404"; } } } ?>
JavaScript
UTF-8
145
3.65625
4
[]
no_license
let fahrenheit = 50 let celsius = (fahrenheit - 32) * 5 / 9 console.log(celsius) let kelvin = (fahrenheit + 459.67) * 5 / 9 console.log(kelvin)
Markdown
UTF-8
1,682
2.546875
3
[]
no_license
##项目运营形式 1.成员自愿参与 2.成员下载代码进行代码修改 (修改方式见 "编写和修改方式” 一节)。 3.成员fork 我的git代码 修改提交后,经审核后合并到主体包中。 4.团队氛围:团队以文字沟通为主,有问题直接提出(写在/doc/...文件夹下)。 5.联系方式:要参加的成员把 S[编号]_微信号_手机号 发给shawn,shawn进行统一整理。 ##工程信息 1.github 地址:https://github.com/shawnxjf1/scalersForum.git -(成员fork后请替换成自己的地址) 2.下载代码 git clone https://github.com/shawnxjf1/sc...
Java
GB18030
6,650
2.875
3
[]
no_license
package jlist; import java.awt.BorderLayout; import java.awt.Button; import java.awt.Color; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.beans.PropertyChangeEvent; import java.beans.P...
Python
UTF-8
1,434
3.265625
3
[]
no_license
#!/usr/bin/env python import rospy from rospy_tutorials.srv import AddTwoInts, AddTwoIntsResponse, AddTwoIntsRequest # Messages used in the node must be imported. rospy.init_node('service_client_node_py',anonymous=True) #initialzing the node with name "service_client_node_py". The second arugument "anonymous" is opti...
Markdown
UTF-8
9,707
3.09375
3
[]
no_license
#肥皂水的效应:将批评夹在赞美中   美国前总统约翰•卡尔文•柯立芝提出肥皂水效应:**评夹在赞美中**。对他人的批评夹裹在前后肯定的话语之中,减少批评的负面效应,使被批评者愉快地接受对自己的批评。以赞美的形式巧妙地取代批评,以看似间接的方式达到直接的目的。 ## 肥皂水效应的来源   约翰•卡尔文•柯立芝于1923年成为美国总统,他有一位漂亮的女秘书,人虽长得很好,但工作中却常因粗心而出错。一天早晨,柯立芝看见秘书走进办公室,便对她说:“今天你穿的这身衣服真漂亮,正适合你这样漂亮的小姐。”这句话出自柯立芝口中,简直让女秘书受宠若惊。柯立芝接着说:“但也不要骄傲,我相信你同样能把公文处理得像你一样漂亮的。”果然从那天起,女秘书...
Java
UTF-8
2,775
3.1875
3
[]
no_license
import BreezySwing.*; import java.awt.Font; import javax.swing.*; @SuppressWarnings("serial") public class ItemCompareDialog extends GBDialog{ //class objects private Library lib; private JLabel instructions = addLabel("Click item to compare it",1,1,1,1); private JList<String> itemList = addList(2,1,1,1); p...
Java
UTF-8
900
2.90625
3
[]
no_license
package com.mlx.administrator.myapplication; import java.util.Arrays; import java.util.Collections; public class Test { int a=1000,b=600; @org.junit.Test public void main(){ testReverse(); } private void testReverse() { System.out.println(System.currentTimeMillis()); Syst...
Python
UTF-8
2,420
2.9375
3
[]
no_license
#!/usr/bin/python3 ######################################################################################### # Simple server ... almost ######################################################################################### import socket import json import base64 S_IP = "192.168.0.13" S_PORT = 9091 class Serve...
C++
UTF-8
8,101
2.59375
3
[]
no_license
/* _ (_)___ ____ _____ ____ ___ ____ _ / / __ \/ __ `/ __ \/ __ `__ \/ __ `/ / / / / / /_/ / /_/ / / / / / / /_/ / __/ /_/ /_/\__, /\____/_/ /_/ /_/\__,_/ /___/ /____/ */ # include "../include/sound.hpp" # include <iostream> # include <unistd.h> //Foreward declerations void playSFX(sf::...
C#
UTF-8
1,829
3.125
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; using WindowsFormsApp1.Classes; namespace WindowsFormsApp1.Classes { class Validation { ...
C
UTF-8
103
2.734375
3
[]
no_license
#include<stdio.h> int main() { int no; scanf("%d",&no); (no%7==0)?printf("yes"):printf("no"); }
Swift
UTF-8
2,339
2.75
3
[]
no_license
// // LabelTableViewCell.swift // IssueTracker // // Created by 임승혁 on 2020/06/11. // Copyright © 2020 Cloud. All rights reserved. // import UIKit final class LabelTableViewCell: UITableViewCell { // MARK: - Properties static let identifier: String = "LabelTableViewCell" private var label: BadgeL...
Python
UTF-8
4,400
4.53125
5
[]
no_license
# 04_type3.py ''' 5. 딕셔너리(Dictionary) 사전!! 형태 : {key1:value1, key2:value2, ...} > key와 value는 한 쌍 key = 단어, value = 뜻 - 문자열 포매팅 함수(format)에서 {키워드} 사용했었음 "{name}".format(name="한수창") 이와 비슷한 느낌! - 요소가 여러 개 나열된 자료형이긴 한데... 문자열,리스트,튜플은 '순서'가 있어서 인덱스로...
Java
UTF-8
719
2.515625
3
[]
no_license
package com.gdkm.converter; import com.gdkm.dto.CourseCommentDto; import com.gdkm.model.CourseComment; import org.springframework.beans.BeanUtils; import java.util.List; import java.util.stream.Collectors; public class CourseToCourseDotConverter { public static CourseCommentDto convert(CourseComment courseComm...
C#
UTF-8
798
2.734375
3
[]
no_license
using System.Diagnostics; namespace TraceHogger { class Program { static void Main(string[] args) { const int repeats = 3; for (var i = 0; i < repeats; i++) { var witcher = new Stopwatch(); witcher.Start(); ...
Markdown
UTF-8
2,642
2.515625
3
[]
no_license
# Markdown文件 http://markdown.tw/#img < span style="color:red;"> 這裡是紅色… < /span> This is [an example](http://example.com/ "Title") inline link. ------ I get 10 times more traffic from [Google] [1] than from [Yahoo] [2] or [MSN] [3]. [1]: http://google.com/ "Google" [2]: http://search.yahoo.com/ "Yahoo ...
Java
UTF-8
5,802
2.96875
3
[]
no_license
package cn.zz.NIO.compareBuffer; import java.io.*; import java.nio.ByteBuffer; import java.nio.MappedByteBuffer; import java.nio.channels.FileChannel; import java.util.Date; public class TestIONIO { public static void main(String[] args) throws IOException { File file = new File("F:\\testIO\\1.mp4"); ...
C++
UTF-8
1,599
2.625
3
[]
no_license
#include "Missile.hpp" Missile::Missile(int x, int y, int speed, std::string pattern, e_type type) : AGameEntity(x, y, speed, type) { std::string *tsprite = new std::string[1]; tsprite[0] = "+=-"; this->_pattern.set(pattern); this->_moveCtrl = MoveController(this->_pos, this->_pattern); this->_hb.setWidth(0); ...
Java
UTF-8
1,515
3.140625
3
[ "MIT" ]
permissive
package de.m_bleil.javafx.layout; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.layout.*; import javafx.stage.Stage; public class StackAndFlowPaneDemo extends Application { @Override public void start(Stage primaryStage) { StackPane defau...
C++
UTF-8
3,203
2.5625
3
[]
no_license
#include "modeling_model.h" #include "modeling_object.h" #include "serial.h" #include "platform.h" #include <stdlib.h> #include <stdio.h> #include <assert.h> Serial file = serial_make((char *)malloc(10000), 10000); static void _serialize_former(Former *former) { serial_write_f32(&file, &former->x, 1); /* former ...
Java
UTF-8
3,824
2.03125
2
[]
no_license
package com.galinc.hardtraining2.ui; import androidx.annotation.NonNull; import androidx.appcompat.app.ActionBarDrawerToggle; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.core.view.GravityCompat; import androidx.drawerlayout.widget.DrawerLayout; import andr...
PHP
UTF-8
1,946
2.640625
3
[]
no_license
<?php namespace app\models; use Yii; /** * This is the model class for table "themes". * * @property int $id * @property int|null $parental_id * @property string|null $title * @property string|null $info * * @property Themesbulletins[] $themesbulletins */ class ThemesRecord extends \yii\db\ActiveRecord { ...
Java
UTF-8
572
2.296875
2
[]
no_license
package com.linkwee.web.enums; /** * * @描述:投资者新手任务 * * */ public enum InvestorNewcomerTaskEnum { INVESTOR_INVITE_CUSTOMER("INVESTOR_INVITE_CUSTOMER","邀请客户"), FIRST_INVEST("FIRST_INVEST","首次投资"), BIND_CARD("BIND_CARD","绑卡认证"); InvestorNewcomerTaskEnum(String code,String message){ this...
Java
UTF-8
2,383
3.34375
3
[]
no_license
package com.company; class Car { private String name; private boolean engine; private int cylinders; private int wheel; public Car(String name, int cylinders) { this.name = name; this.cylinders = cylinders; this.wheel = 4; this.engine = true; } public int g...
C#
UTF-8
907
2.65625
3
[]
no_license
using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Linq; namespace Service.Migrations { public partial class InitialData : Migration { protected override void Up(MigrationBuilder migrationBuilder) { var random = new Random(); const int intervalIn...
Java
UTF-8
1,278
2.28125
2
[]
no_license
package com.css.msgcenter.common; /** * IM 消息内容 * * @author wfm * */ public class IMMessage { private String title = "";//标题 private String text = "";//正文 private String targetUser = "";//接收方用户id private String selfUser = "";//发送方 private String realName = "";//发送方真实姓名 private String type = "";//消息类型 7 8 9...
Python
UTF-8
946
2.90625
3
[]
no_license
# -*- coding:utf-8 -*- import urllib import urllib2 def loadPage(url,filename): print '正在下载'+filename headers = {'User-Agent':"Mozilla/5.0"} request = urllib2.Request(url,headers=headers) return urllib2.urlopen(request).read() def writePage(html,filename): with open(filename,"w") as f: f...
Markdown
UTF-8
628
2.90625
3
[]
no_license
# redux-thunk-state-adapter A utility to provide a facade of getState to an externally owned thunk. This is useful when you are sharing action creators which compose selectors that assume a certain state shape. ## Usage ```javascript import { createThunkAdapter } from 'redux-thunk-state-adapter'; import { externalTh...
Java
UTF-8
3,199
2.25
2
[]
no_license
package com.njuse.uctaserver.controller; import com.njuse.uctaserver.dto.PlaceCommentDTO; import com.njuse.uctaserver.model.entity.PlaceComment; import com.njuse.uctaserver.service.CommentService; import io.swagger.annotations.*; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.anno...
Java
UTF-8
1,067
2.265625
2
[ "MIT" ]
permissive
/* Copyright (c) 2011-2013 GZapps Grzegorz Żur */ package com.gzapps.shopping.app.fragment; import com.gzapps.shopping.core.Product; import com.gzapps.shopping.core.Shopping; import java.util.List; import static com.gzapps.shopping.app.ShoppingApplication.CORRELATION; public class SuggestionsAdapter extends Prod...
Java
UTF-8
495
2.25
2
[]
no_license
package Config; import Services.Impl.Circle; import Services.Impl.Rectangle; import Services.Shape; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * Created by student on 2016/03/27. */ @Configuration public class AppConfig { @Bean(name = "Re...
C
UTF-8
3,797
2.953125
3
[ "BSD-3-Clause" ]
permissive
#include <stdio.h> #include <stdlib.h> #include <getopt.h> #include <stdbool.h> #include <time.h> #include "../../src/AwFmIndexStruct.h" #include "../../src/AwFmIndex.h" #include "../../src/AwFmOccurrence.h" uint32_t numQueries = 0; uint32_t dbSizeInWindows = 0; bool requestOccupancyPrefetching = false; void pars...
Java
UTF-8
1,453
2.140625
2
[]
no_license
package com.dneonline.stepdefinitions; import com.dneonline.questions.ElResultado; import com.dneonline.tasks.EnviarSuma; import cucumber.api.java.Before; import cucumber.api.java.es.Cuando; import cucumber.api.java.es.Entonces; import net.serenitybdd.screenplay.actors.OnStage; import net.serenitybdd.screenplay.actor...
C++
UTF-8
388
2.953125
3
[]
no_license
#include <stdio.h> main() { int input,i,b,count=0; printf("Enter length of array : "); scanf("%d",&input); int num[input]; for(i=1;i<=input;i++) { printf("\nEnter The number %d = ",i); scanf("%d",&num[i]); } for( i=1;i<=input;i++) { printf("\n%d is on position %d",num[i],i); count=count+1; ...
Python
UTF-8
5,849
2.578125
3
[]
no_license
import sys import tensorflow as tf import numpy as np import math import inspect from models.base import Model from models.rwa_cell import RWACell from models.ran_cell import RANCell from tensorflow.contrib import rnn from tensorflow.contrib.layers import batch_norm class SwitchableDropoutWrapper(rnn.DropoutWrapper):...
Java
UTF-8
14,313
2.125
2
[]
no_license
package com.zamer.zamer; import java.util.ArrayList; import java.util.List; import com.zamer.parser.JSONParser; import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.a...
C#
UTF-8
3,656
2.6875
3
[ "MS-PL" ]
permissive
using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Threading.Tasks; using MugenMvvmToolkit.Infrastructure.Validation; using MugenMvvmToolkit.Interfaces.Validation; namespace MugenMvvmToolkit.Test.TestModels { public class SpyValidator : ManualValida...
Python
UTF-8
1,294
4.25
4
[ "MIT" ]
permissive
# 思维不清debug # 小强认识了一个新朋友叫旺财,他想让你给他取个外号,但他很不喜欢别人叫他小狗和汪汪, # 于是写了一个程序让自己避免叫他这两个外号中的一个,可是不知为什么叫他小狗程序也没有警告。 not_bad_word = True while not_bad_word: x = input('请给旺财取个外号:') if x == '小狗' and x == '汪汪': not_bad_word = False print('我生气了,不想理你了!') print('对不起,以后我不会这么叫你了') # 练习 not_bad_word = True names = ...
Java
UTF-8
2,875
2.21875
2
[]
no_license
package com.amuse.frameone.common.aop; import com.amuse.frameone.common.Enum.SystemEnum; import com.amuse.frameone.common.exception.BusinessException; import com.amuse.frameone.common.model.Jwt; import com.amuse.frameone.common.util.JwtUtil; import com.amuse.frameone.common.util.ResultUtil; import io.jsonwebtoken.Clai...
TypeScript
UTF-8
812
2.75
3
[]
no_license
import baseWidget from './base.widget'; interface bufferInf { [key: string]: baseWidget; } export default class Register { private static _instance: Register = new Register(); private static buffer: bufferInf; private constructor() { if(Register._instance){ throw new Error("Error: I...
TypeScript
UTF-8
522
3.578125
4
[]
no_license
function add(n1: number, n2: number): number { return n1 + n2; } function printResult(num: number): void { console.log('Result: ' + num); } function addAndHandle(a: number, b: number, cb: (num: number) => void) { const result = add(a, b); cb(result); } printResult(add(5, 10)); console.log('XD'); let...
Java
UTF-8
424
1.742188
2
[]
no_license
package com.cskaoyan.mall.mapper; import com.cskaoyan.mall.bean.AdminOrderGoods; public interface AdminOrderGoodsMapper { int deleteByPrimaryKey(Integer id); int insert(AdminOrderGoods record); int insertSelective(AdminOrderGoods record); AdminOrderGoods selectByPrimaryKey(Integer id); int upd...
Java
UTF-8
1,432
3.84375
4
[]
no_license
package medium; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.Random; class InsertDeleteGetRandomO1 { class RandomizedSet { ArrayList<Integer> nums; Map<Integer, Integer> pos; Random r; /** Initialize your data structure here. */ public RandomizedSet(...
C#
UTF-8
420
2.9375
3
[]
no_license
// create template matching algorithm's instance // use zero similarity to make sure algorithm will provide anything ExhaustiveTemplateMatching tm = new ExhaustiveTemplateMatching(0); // compare two images TemplateMatch[] matchings = tm.ProcessImage(image1, image2); // check similarity level ...
TypeScript
UTF-8
1,779
2.703125
3
[ "MIT" ]
permissive
import { ipcRenderer } from "electron"; import { IRendererEventBus, RendererEvents } from "./"; import { MainEvents } from "../../main/services/enumerations"; /** * Wraps the ipcRenderer electron event emitter to provide additional functionality. */ export const RendererEventBus: IRendererEventBus = { on(event: ...
Python
UTF-8
598
3.25
3
[]
no_license
class NPC: """ Basic parent class for any non player controlled characters """ def __init__(self, name, hp, damage): self.name = name self.hp = hp self.damage = damage def is_alive(self): """ Returns if NPC is alive or not """ if self.hp > 0: return True ...
Java
UTF-8
740
2.65625
3
[]
no_license
package com.guilin.demo.boot.hello; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @RestController 等价于 @Controller和@RequestBody * Created by guilin1 on 15/12/9. */ @RestController public class SampleController { @RequestMappi...
Python
UTF-8
1,205
2.75
3
[]
no_license
# -*- coding: utf-8 -*- from __future__ import unicode_literals from nose.tools import istest from compmake.utils import wildcard_to_regexp from . import CompmakeTest @istest class Simple(CompmakeTest): def mySetUp(self): pass def testExists1(self): key = 'not-existent' assert (not ...
PHP
UTF-8
601
3.671875
4
[]
no_license
<?php function addingMatrix($a, $b) { $sum = []; for ($row = 0; $row < sizeof($a); $row++) { $temp = []; for ($col = 0; $col < sizeof($a[0]); $col++) { $temp[$col] = $a[$row][$col] + $b[$row][$col]; } $sum[] = $temp; } return $sum; } function multiplyingMatrix($a, $b) { $result = []; ...
C++
UTF-8
1,375
3.484375
3
[]
no_license
#ifndef BOARD_H #define BOARD_H #include <iostream> #include <ctime> #include <vector> template <class T> class Board{ private: std::vector<std::vector<T> > board; public: // Constructor Board(int size){ board.resize(size, std::vector<T>(size, 0)); } // Update board vo...
TypeScript
UTF-8
1,596
2.8125
3
[]
no_license
/** * This component used to handle error messages for input field (formControl) * https://stackoverflow.com/questions/52771445/best-way-to-show-error-messages-for-angular-reactive-forms-one-formcontrol-mult */ import { Component, Input } from '@angular/core'; import { FormControl } from '@angular/forms'; @Compone...
Python
UTF-8
467
3.84375
4
[]
no_license
#En una granja se contaron 94 patas y 35 cabezas de animales #Se sabe que hay conejos y gallinas #Cuantos animales hay de cada tipo conejos=1 total=conejos*4 indicador=True patas=94-total patasGallina= patas/2 while(indicador): patasConejos=conejos*4 gallinas=((94-patasConejos)/2) if((con...
C#
UTF-8
2,283
3.171875
3
[]
no_license
using System; using System.Collections.Generic; using System.Text; class NFA { char[] m_re; DirectedGraph m_g; int m_m; public NFA(string regexp) { Stack<int> ops = new Stack<int>(); m_re = regexp.ToCharArray(); m_m = m_re.Length; m_g = new DirectedGraph(m_m + 1...
Java
UTF-8
2,731
3.28125
3
[]
no_license
package com.siwoo.algo.sedgewick.collection; import com.siwoo.algo.util.AppConfig; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.util.Random; import java.util.Scanner; /** * [algo] [mst] * spanning tree 은 순환 경로가 없으면서 모든 정점이 연결된 서브그래프이다. (tree = E = V-1 ...
Java
UTF-8
3,350
1.960938
2
[]
no_license
package com.ck.platform.business.weixin.service; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @desc: 微信业务接口Service * @author:lyq * @date:2014-6-5 */ @SuppressWarnings("rawtypes") public interface WeixinInteractService { /** * 获取口令 * @return */ public HashMap updateGetAccess...
Java
UTF-8
28,888
1.835938
2
[]
no_license
/* * Copyright Georgia Tech Research Institute * Sep 28, 2011 * * All rights reserved. */ package gov.lexs.subscribenotify; import gov.lexs.AbstractTest; import gov.ulex.searchretrieve.v20.XmlGetCapabilitiesRequestDocumentBean; import gov.ulex.searchretrieve.v20.XmlGetCapabilitiesResponseDocumentBean; i...
C++
UTF-8
1,241
3.203125
3
[]
no_license
#include "../header/myheader.h" class LT0853 { public: // D D //for (int i = 0; i < pos.size(); i++) m[-pos[i]] = (double)(target - pos[i]) / speed[i]; // 取负,保存耗时。 // vector<pair<int, int>> v; // sort(begin(v), end(v), greater<pair<int,int>>()); //Runtime: 88 ms, faster than 49.89% of C++ online submissions fo...
C#
UTF-8
22,170
2.625
3
[]
no_license
using System.Collections.Generic; using System.Threading.Tasks; using Basket.Models; using Basket.Services; using FluentAssertions; using Models.Customers.Models; using Models.Products.Models; using Moq; using Xunit; namespace BasketTest { public class BasketServiceTests { [Fact] public async ...
JavaScript
UTF-8
485
3.453125
3
[]
no_license
function setup() { createCanvas(400, 300) background(215); //noFill(); } function draw() { for ( var i = 30; i > 0; i--) { circle(200, 150, i * 10); } } //code examples from lecture //var randColor = Math.random() * 255; //fill(randColor); /...
Java
UTF-8
4,725
2.0625
2
[]
no_license
package cn.deepcoding.util; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import com.dingtalk.api.DefaultDingTalkClient; import com.dingtalk.api.DingTalkClient; import com.dingtalk.api.request.CorpRoleSimplelistRequest; import com.dingtalk.api.request.OapiDepartmen...
Python
UTF-8
5,195
2.703125
3
[]
no_license
from collections import OrderedDict from enum import Enum __all__ = ['Permission', 'preset_for_superuser', 'preset_for_author'] class Group: flags = [] name = None def __init__(self, name, flags): self.name = name self.flags = flags class Flag: value = None description = None ...
JavaScript
UTF-8
773
4.6875
5
[]
no_license
function reverseAnArrayOfNumbers(index, inputArr) { let outputArr = []; for (let i = 0; i < index; i++) { outputArr.push(inputArr[i]); } let result = outputArr.reverse().toString().replace(/[/,/]/g," "); console.log(result); } reverseAnArrayOfNumbers(3, [10, 20, 30, 40, 50]); reverseAnArr...
Python
UTF-8
303
4.09375
4
[]
no_license
#generator is an iterator def week(): days_of_week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] for day in days_of_week: yield day c = week() print(next(c)) print(next(c)) print(next(c)) print(next(c)) print(next(c)) print(next(c)) print(next(c))
Markdown
UTF-8
6,477
3.265625
3
[ "Apache-2.0" ]
permissive
# tkthread Easy multithreading with Tkinter on CPython 2.7/3.x and PyPy 2.7/3.x. import tkthread; tkthread.patch() # do this before importing tkinter ## Background The Tcl/Tk language that comes with Python follows a different threading model than Python itself which can raise obtuse errors when mixing Python...
Shell
UTF-8
2,727
4.25
4
[]
no_license
# /bin/sh function help() { echo "This is a simple wrapper around trash-cli: https://github.com/andreafrancia/trash-cli" echo echo "Usage:" echo " trash [ACTION] [OPTIONS]... [FILE]..." echo echo "Actions available:" echo " put, list, empty, restore, uninstall, help" echo echo "Example usage:" echo " tr...
C
UTF-8
1,683
3.1875
3
[]
no_license
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_memccpy.c :+: :+: :+: ...
PHP
UTF-8
561
2.59375
3
[]
no_license
<?php require_once dirname(__FILE__) . '/MySQL.php'; require_once dirname(__FILE__) . '/Job.php'; class Follower extends MySQL { public $table = 'follower'; public $schema = array( 'facebook_id' => '', 'name' => 'No name', 'power' => 0, 'money' => 0, 'pic' => '', 'job_name' => 'NEET' // 仮置き...
PHP
UTF-8
2,234
2.53125
3
[]
no_license
<?php if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' ); class Post_model extends CI_Model { public function create($text,$image,$posttype,$link) { $data = array( 'text' => $text, 'posttype' => $posttype, 'link' => $link, 'image' => $image ); $query=$this->db->insert( 'post',...
C++
UTF-8
2,411
3.625
4
[ "MIT" ]
permissive
/* Yehuda Neumann 305539066 */ /* Adiel Matuf 307895268 */ #include "Player.h" Player :: Player(string name, int num_of_cards): _name(name), _num_of_cards (num_of_cards){ // create a vector of cards. for (int i = 0; i < _num_of_cards; i++) { this->_vec_of_cards.push_back(Card...
Java
UTF-8
3,871
2.25
2
[]
no_license
package net.cactii.target; import java.io.File; import java.text.DateFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; import net.cactii.target.SavedGame.SavedGameState; import android.app.Activity; import android.app.AlertDialog; import android.app...
Python
UTF-8
1,270
2.734375
3
[]
no_license
import numpy as np import cv2 as cv import argparse import sys cap = cv.VideoCapture(0) if (cap.isOpened()== False): print("\nUnable to read camera feed") while(cap.isOpened()): # Capture frame-by-frame ret, frame = cap.read() gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY) # Video capture timest...
PHP
UTF-8
1,075
2.609375
3
[]
no_license
<?php class Signup_model extends CI_Model{ function __construct() { parent::__construct (); } public function add_signup() { date_default_timezone_set('UTC'); $now = date("Y-m-d H:i:s"); $data = array( 'username' => $this->input->post('username'), ...
Java
UTF-8
5,483
4.125
4
[]
no_license
package epam.fundamentals.task2; /* * Упорядочить строки (столбцы) матрицы в порядке возрастания значений элементов k-го столбца (строки) */ import java.util.Random; public class App1 { public static void sortRandomNumbers(int[][] numbers) { System.out.println("\n*Упорядочить строки (столбцы) матрицы ...
PHP
UTF-8
1,383
2.578125
3
[]
no_license
<?php namespace rain1208\tags; use Deceitya\MiningLevel\Event\MiningLevelUpEvent; use Deceitya\MiningLevel\MiningLevelAPI; use pocketmine\event\Listener; use pocketmine\event\player\PlayerJoinEvent; use pocketmine\plugin\PluginBase; use pocketmine\utils\Config; class Main extends PluginBase implements Listener { ...
Python
UTF-8
16,421
2.59375
3
[]
no_license
from django.test import TestCase # Create your tests here. from catalog.models import Director from django.urls import reverse class DirectorListViewTest(TestCase): @classmethod def setUpTestData(cls): # Create directors for pagination tests number_of_directors = 13 for director_id...
Markdown
UTF-8
1,378
3.953125
4
[]
no_license
# 如何跳出双重循环? ``` java for (Type type : types) { for (Type t : types2) { if (some condition) { // Do something and break... break; // Breaks out of the inner loop } } } ``` 上面的break只能跳出第一重循环 ## Answer 你可以给循环添加一个label ``` java outLoop: for (int i = 0; i < 4; i++) { fo...
Java
UTF-8
470
1.726563
2
[]
no_license
package com.example.avi_pc.weatherdemo.injection.component; import com.example.avi_pc.weatherdemo.activity.home.HomeActivity; import com.example.avi_pc.weatherdemo.injection.PerActivity; import com.example.avi_pc.weatherdemo.injection.module.ActivityModule; import dagger.Component; @PerActivity @Component(dependen...
PHP
UTF-8
1,073
3.8125
4
[]
no_license
<?php //public :公開 //private :非公開(その設計図内のみ) //protected :継承したクラスにのみ公開 //Ptoductクラスという設計図から「negima」「hatsu」という2つの実体ができた //Productクラス内で新たにProductクラスをコピーした新たなクラス「DrinkProduct」という設計図ができた class Product { public $name; public $stock; public function getStock(){ $message = $this->name . "の在庫は" . $this->stock . "個です。...
PHP
UTF-8
611
2.890625
3
[ "Apache-2.0" ]
permissive
<?php // Initialize the command line output array $speedtestcli_outputs = array(); // Initialize the returning array which will be reprsented as json $json = array(); // Execute the speedtest tool and receive output exec("speedtest-cli --list", $speedtestcli_outputs); // Remove first line... Description text of outp...
JavaScript
UTF-8
2,648
3.015625
3
[]
no_license
import React, { Component } from 'react' //import firebase import firebase, {auth, provider} from '../firebase.js'; //this is a class component class UseFirebase extends Component { //initialize the state constructor(props){ super(props) this.state = { name : "", address : "", items: [] ...
C
UTF-8
1,477
3.625
4
[]
no_license
#include <stdio.h> #include <math.h> #include <stdlib.h> int main() { float principal, interstRate, monthlyInterestRate; float emi, startingBalance, interest, principalPaid, endingBalance; int numOfMonths, month; float interestArr[30], principalPaidArr[30], endingBalanceArr[30]; printf("Enter amou...
Swift
UTF-8
3,266
2.625
3
[]
no_license
@testable import ABA_Music import DataSourceController import XCTest class SearchResultTableViewModelTests: XCTestCase { func testViewModelPublicAPI() { let artist = Artist.generateArtist(index: 5) let delegate = MockSearchResultTableDelegate() let viewModel = SearchResultTableViewModel(art...
Markdown
UTF-8
500
2.59375
3
[]
no_license
# Food * **Creatine** - has a number of positive effects * Is produced by body \(production is stessful\) * Contained in red meat, pork, fish * **Ketone** \(by-product of fat metabolism\) * **MCT** \(medium-chain triglyceride\) * dietary fat helping to increase amount of ketone in the blood * There are MC...
C#
UTF-8
584
3.125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Calculator { class Class1 { public void demoTryParse() { string val = null; int result; bool ifSuccess = int.TryParse(val, out res...
Java
UTF-8
1,545
2.671875
3
[ "MIT" ]
permissive
package jmvc.model; import java.util.HashMap; import java.util.Map; import static gblibx.Util.isNonNull; public class ColumnInfo { public ColumnInfo( Database dbase, Table table, String name, int type, int size, int position, String defaultVal, boolean isPrimaryKey) { ...
PHP
UTF-8
6,918
2.6875
3
[]
no_license
<?php /** * * @author Bighetti * */ use \Sys\DB; use \Sys\Validation; class BlockRefused_Model extends \Sys\Model { public $id; public $excluido; public $block_id; public $client_id; public $date_refuse; public $reason; public $invoice_id; function _...
Python
UTF-8
1,309
2.90625
3
[]
no_license
from ..message_types import * from ..datamodel.structures.utility import * class Message: """A simple class to hold data as a message. Operation is the key used by subscribers to be notified of the message. >>> m = Message("dummy_create", row=[1, 2, 3]) >>> m["row"] [1, 2, 3] """ def _...
Python
UTF-8
436
2.796875
3
[]
no_license
from flask import Flask,request app = Flask(__name__) # @app.route('/',methods=['GET','POST']) # def index(): # responce = 'request context \n' # responce += f"request method : {request.method}\n" # responce += f"request GET args : {request.form}\n" # return responce @app.route('/',methods=['GET','P...
PHP
UTF-8
2,621
2.71875
3
[]
no_license
<?php use Drush\Sql\SqlBase; /** * These are deprecated functions that we keep around just to ease the transition * to current Drush version. They may not work the same as they did in prior * versions. If they aren't working for you, consider upgrading your commandfile * so that it works with modern Drush. * * @...
Swift
UTF-8
1,288
2.546875
3
[ "MIT" ]
permissive
// // CountryDetailedVC.swift // ConcurrencyLab // // Created by David Lin on 12/9/19. // Copyright © 2019 David Lin (Passion Proj). All rights reserved. // import UIKit class CountryDetailedVC: UIViewController { var countryDetails: CountryList! @IBOutlet weak var flagImage: UIImageView! @I...
Python
UTF-8
939
4.46875
4
[]
no_license
#私有属性和方法是无法被继承的 class Animal: def __init__(self,name="动物",color="白色"): #私有属性 self.__name=name #非私有属性 self.color=color #私有方法 def __test(self): print(self.__name) print(self.color) #非私有方法,比较区别 def test(self): print(self.__name) print(self...
C#
UTF-8
884
2.546875
3
[]
no_license
using System.Runtime.Serialization; namespace MemoryGame.MemoryGameService.DataTransferObjects { /// <summary> /// The <c>PlayerDto</c> class. /// It is used to map the information of a Player entity. /// </summary> [DataContract] public class PlayerDto { /// <summary> /// ...
JavaScript
UTF-8
182
3.484375
3
[]
no_license
let c1 = { x: 5, y: 10, }; let c2 = { x: 45, y: 235, }; function printCoordinates() { console.log(this.x + ',' + this.y); } let c1func = printCoordinates(c1); c1func();
C#
UTF-8
650
3.953125
4
[ "MIT" ]
permissive
using System; namespace _6.PathToOne { class PathToOne { static void Main() { uint n = uint.Parse(Console.ReadLine()); int steps = Divide(n); Console.WriteLine(steps); } public static int Divide(uint n, int depth = 0) { ...
Python
UTF-8
759
3.390625
3
[]
no_license
''' ----------------------------------------------- ----------------------------------------------- Author: Nishant Tewari ID: 190684430 Email: tewa4430@mylaurier.ca __updated__ = "2020-02-27" ----------------------------------------------- ''' # Imports # Constants from List_linked import List lst_li...