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
Markdown
UTF-8
2,385
3.1875
3
[]
no_license
1、StatelessWidget 2、StatefulWidget ``` 无状态静态的视图展示使用StatelessWidget,而有交互,需要动态变化的使用StatefulWidget. StatelessWidget初始化之后就无法改变,如果想改变,那便需要重新创建,new另一个StatelessWidget进行替换。但StatelessWidget因为是静态的,他没有办法重新创建自己。所以StatefulWidget便提供了这样的机制,通过调用`setState((){})`标记自身为dirty状态,以等待下一次系统的重绘检查。 1.Stateless widgets 是不可变的,这...
Ruby
UTF-8
2,072
3.0625
3
[]
no_license
require_relative 'manufacturer' require_relative 'validation' class Train include Manufacturer include InstanceCounter include Validation attr_reader :train_number, :train_type, :route, :current_route, :wagons, :current_station NUMBER_FORMAT = /^[а-я0-9]{3}-*[а-я0-9]{2}$/i.freeze validate :train_number, :...
PHP
UTF-8
4,935
2.609375
3
[ "MIT" ]
permissive
<?php namespace App\Entity; use App\Repository\UserRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Security\Core\User\UserInterface; /** * @...
Markdown
UTF-8
1,841
3.0625
3
[]
no_license
# I/O HW3 * Snapshot of C library’s execution time in 4B-sized and 4KB-sized. 4B: ![](https://i.imgur.com/Jp4U01o.png) 4KB: ![](https://i.imgur.com/x8JSH7V.png) * Snapshot of System Call’s execution time in 4B-sized and 4KB-sized. 4B: ![](https://i.imgur.com/hElTUjt.png) 4KB: ![](https://i.imgur.co...
Java
UTF-8
1,504
1.992188
2
[]
no_license
package com.panhong.service.impl; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Service; import com.panhong.dao.UserPropertyDao; import com.panhong.model.UserProperty; import com.panhong.service.UserPropertyService; @Service("userPropertyService") pub...
Markdown
UTF-8
3,695
2.640625
3
[ "BSD-2-Clause" ]
permissive
--- id: 62-pear-channels-and-frameworks author: matthew title: 'PEAR, Channels, and Frameworks' draft: false public: true created: '2005-04-11T21:32:20-04:00' updated: '2005-04-11T21:55:40-04:00' tags: - php --- [Greg Beaver writes in his blog](http://greg.chiaraquartet.net/comment.php?type=trackback&entry_id=38) a...
C++
UTF-8
434
3.109375
3
[]
no_license
#include <iostream> #include <string> #include <cmath> int main(int argc, char *argv[]) { std::string s; std::cin >> s; int x = 0, y = 0; for(int i = 0; i < s.length(); i++) { if(s[i] == 'U') { y++; } else if(s[i] == 'R') { x++; } else if(s[i] == 'D') { y--; } else if(s[i] == 'L') { x--; } ...
Java
UTF-8
273
3.015625
3
[]
no_license
public static void printInBin(int x){ StringBuilder sb = new StringBuilder(); System.out.print(x+ " in bin: "); for (int i=31;i>=0;i--){ if (x%2==0){ sb.append("0"); }else sb.append("1"); x>>>=1; } sb.reverse().append("\n"); System.out.print(sb); }
PHP
UTF-8
4,111
2.625
3
[ "LicenseRef-scancode-unknown-license-reference", "AFL-2.1", "AFL-3.0", "OSL-3.0", "MIT" ]
permissive
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Indexer\Model; /** * Provide functionality for executing user functions in multi-thread mode. */ class ProcessManager { /** * Threads count environment variable...
Java
UTF-8
1,434
2.890625
3
[]
no_license
package baekjoon; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; public class P2668 { static public boolean dfs(ArrayList<Integer>[] ar, int start) { Queue<Intege...
JavaScript
UTF-8
3,290
3.578125
4
[]
no_license
// Placing tests within the $() function to avoid running until DOM is ready. $(function() { describe('RSS Feeds', function() { it('are defined', function() { // Checks if allFeed variable has beedn defined expect(allFeeds).toBeDefined(); // Checkes if allFeed variable i...
Java
UTF-8
5,282
2.359375
2
[]
no_license
package com.jzl.search_service.service; import com.alibaba.dubbo.config.annotation.Service; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.jzl.api.ISearchService; import com.jzl.entity.TProduct; import com.jzl.mapper.TProductMapper; import com.jzl.vo.ResultBean; import org.a...
C++
UTF-8
21,273
2.96875
3
[]
no_license
#ifndef POLYNOM_H #define POLYNOM_H #include <iostream> #include <fstream> #include <sstream> #include <iomanip> #include <vector> #include <string> #include <cmath> #include <limits> #include <complex> #include <ctime> #include <stdexcept> namespace iat { enum class PolynomRootSearchMethod { BISECTION...
Markdown
UTF-8
2,506
2.875
3
[]
no_license
# Overview of application: The application has 3 parts: ## Frontend: Main Tech Stack: React.js, Redux(not really used it in this app), React Router V4, Webpack4, Babel. ## Backend: Main Tech Stack: Express.js, MySql, Pm2(for running node.js server) ## Deployment: Main Tech Stack: Docker ## Running a...
Java
UTF-8
1,316
2.390625
2
[]
no_license
package com.springboot.maven.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.ann...
Python
UTF-8
2,860
3.25
3
[]
no_license
"""CSC111 Final Project: Exploring Using Graph Based Data Structures to Implement a Connect 4 AI Module Description ================== This module contains functions that pertain to the creation and loading of a 'opening book' for the ComplexAIPlayer to use. An 'opening book' is a dictionary that maps board positions...
Python
UTF-8
422
4.3125
4
[]
no_license
""" Create a list with the names of friends and colleagues. Search for the name ‘John’ using a for a loop. Print ‘not found’ if you didn't find it. """ friend_list = ['John','SRK','Bomzi','Charlotte','','Shakira','Franziska'] search_keyword = input("Whom do you want to search?\n") for word in friend_list: if search...
Java
UTF-8
2,416
2.125
2
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
/* * Copyright 2019-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://www.apache.org/licenses/LICENSE-2.0 * * o...
Markdown
UTF-8
909
3.609375
4
[]
no_license
# Express ## Middleware Middleware functions have access to the request and response objects plus a special `next` function. When `next` is invoked it simply calls the next middleware function. If the current middleware function doesn't end the request/response cycle then you much call next otherwise the request wil...
Python
UTF-8
1,588
3.765625
4
[]
no_license
''' DMOJ CCC 2000 S3 - Surfing https://dmoj.ca/problem/ccc00s3 Jerry Cheng ''' import sys import re input = sys.stdin.readline link_format = re.compile("<A HREF=\"([^\"]*)\">") class Graph: def __init__(self, n): self.num_nodes = n self.num_edges = 0 self.edges = {} def add_edge(self...
Swift
UTF-8
2,599
2.921875
3
[]
no_license
// // NumberKeys.swift // Calculator // // Created by Joachim Neumann on 20/09/2021. // import SwiftUI struct NumberKeys: View { @ObservedObject var brain: Brain let t: TE var body: some View { VStack(spacing: t.spaceBetweenkeys) { HStack(spacing: t.spaceBetweenkeys) { ...
Java
UTF-8
4,216
2.671875
3
[]
no_license
package com.mastek.training.hrapp; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import java.util.List; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import...
Java
UTF-8
904
2.015625
2
[]
no_license
package com.codegym.services; import com.codegym.models.Product; import com.codegym.repositories.ProductRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Page...
PHP
UTF-8
945
2.59375
3
[]
no_license
<?php session_start(); include 'connect.php'; if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) { // UPDATE TABLE SET COLUMN = VALUE, COLUMN = VALUE,.... WHERE CONDITION; try { $date = new DateTime(); $date_time = $date->format('Y-m-d H:i:s'); // use proper indentation so code look clean $...
Markdown
UTF-8
1,270
2.53125
3
[]
no_license
## java 代理模式进行数据源的切换 通过代理模式,使用自定义注解实现当前数据源的动态切换,不使用aop的相关注解 ## 实现方式 主要是参考了事务tx在spring中间的运用,tx在应用系统调用声明了 @Transactional 的目标方法时,Spring Framework 默认使用 AOP 代理,在代码运行时生成一个代理对象,根据 @Transactional 的属性配置信息,这个代理对象决定该声明 @Transactional 的目标方法是否由拦截器 TransactionInterceptor 来使用拦截 下面是自定义注解需要注册的bean ![tp](https://github.com/fulln/pr...
Java
UTF-8
3,526
1.976563
2
[ "Apache-2.0" ]
permissive
package com.mooc.ppjoke.ui.home; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import andr...
Shell
UTF-8
1,414
3.015625
3
[ "Apache-2.0" ]
permissive
#!/bin/bash set -e TOPDIR=`pwd` # pegasus bin directory is needed to find keg BIN_DIR=`pegasus-config --bin` # build the dax generator PYTHONPATH=`pegasus-config --python` export PYTHONPATH=".:$PYTHONPATH" # generate the dax ./local_hierarchy.py > outer.dax echo "inner.dax $TOPDIR/inner.dax site=local" > rc.data ...
C#
UTF-8
881
3.765625
4
[]
no_license
using System; using static System.Console; namespace DivisibleSumPairs { class Program { static int DivisibleSumPairs(int k, int[] ar) { var divisiblePairCount = 0; for (int i = 0; i < ar.Length; i++) { for (int j = i + 1; j < ar.Length; j++) ...
Java
UTF-8
696
2.671875
3
[ "Apache-2.0" ]
permissive
package org.minimalj.example.erp.model; import java.math.BigDecimal; import org.minimalj.model.Keys; import org.minimalj.model.Rendering; import org.minimalj.model.annotation.Size; public class OfferArticle implements Rendering { public static final OfferArticle $ = Keys.of(OfferArticle.class); public ArticleVi...
Python
UTF-8
2,305
2.75
3
[]
no_license
#! /usr/bin/python #coding=utf-8 from __future__ import print_function from pyspark.sql import SparkSession from pyspark.mllib.recommendation import ALS,Rating,MatrixFactorizationModel import sys def SaveModel(sc): try: model.save(sc,Path+"ALSmodel") print("已存储Model在ALSmodel") except Exception...
PHP
UTF-8
674
2.53125
3
[]
no_license
<?php namespace Bookstore\Genre\Repositories; use Bookstore\Genre\Models\Genre; use Bookstore\Genre\Transformers\GenreTransformer; use Bookstore\Library\Exceptions\ItemNotDeletedException; use Bookstore\Library\Exceptions\ItemNotFoundException; use Bookstore\Library\Exceptions\ItemNotSavedException; use Bookstore\Lib...
Python
UTF-8
1,144
3.890625
4
[]
no_license
def index_equals_value_search(arr): # Sorted array - # return the first one # check arr[i] = i # left = 0 right = len(arr) - 1 mid = int((left + right) / 2) while (left <= right): if arr[mid] == mid: if arr[mid - 1] == mid - 1: right = mid - 1 ...
Java
UTF-8
6,251
2.1875
2
[ "Apache-2.0" ]
permissive
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you...
Ruby
UTF-8
2,800
2.59375
3
[]
no_license
#!/usr/bin/ruby-rvm-env 1.9.3 # encoding: UTF-8 raise "Please use Ruby 1.9.3 or later." if RUBY_VERSION < "1.9.3" require 'socket' require 'io/wait' require 'thread' require_relative 'packets' require_relative 'jumps_on_command' if File.exist? 'config.rb' require_relative 'config.rb' else require_relative 'defaul...
Java
UTF-8
1,172
1.945313
2
[]
no_license
package com.taixin.android.onvif.sdk.obj; public class MediaProfilesInfo { private String token; private String name; private String VSCToken; private String VSCName; private String videoSourceToken; private String VECToken; private String VECName; public MediaProfilesInfo(){ } public String getToken(...
PHP
UTF-8
1,141
2.59375
3
[]
no_license
<?php /** * @description * This script counts unevaluated letters for the status bar while saving letters as * acknowledgements. * * @author Chezre Fredericks * @date_created 14/04/2014 * @Changes * */ # BOOTSTRAP include("inc/globals.php"); # CALCULATE THE UNPROCESSED LETTERS $u = $_SESSION['dm...
Java
UTF-8
2,807
2.03125
2
[]
no_license
package com.gideondev.survey.feature.home; import android.support.v4.app.FragmentActivity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.gideondev.survey.FormModel; import com.gideondev.survey.databases.dao.FormDAO; import com.gideondev.survey.databases.dao.SqliteDAOFactory; imp...
Python
UTF-8
1,652
3.59375
4
[ "Apache-2.0" ]
permissive
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys """a test module """ __author__ = 'Michael Liao' def func1(): args = sys.argv print(args) if len(args) == 1: print('Hello, world!') elif len(args) == 2: print('Hello, %s!' % args[1]) else: print('Too many arguments...
SQL
UTF-8
1,215
3.796875
4
[]
no_license
-- Table definitions for the tournament project. -- -- Put your SQL 'create table' statements in this file; also 'create view' -- statements if you choose to use it. DROP DATABASE IF EXISTS tournament; CREATE DATABASE tournament; \c tournament; -- Create list of players in the current tournament. CREATE TABLE play...
Markdown
UTF-8
1,104
2.59375
3
[]
no_license
# Optym Search task project for inteview What is the objective ? 1. Read from a url every 8 secs and save it to a Database. Basisc CRUD 2. Design a basic UI with a text Box, 1 search button for basic search ; url/dropdown for Advanced search And clear button 3. Key based search on the “setup” and “ punchl...
Swift
UTF-8
4,154
2.5625
3
[]
no_license
// // DetailViewController.swift // Assignment1_PG // // Created by Aini Zahari on 5/04/2015. // Copyright (c) 2015 Siti Nur Aini Zahari. All rights reserved. // import Foundation import UIKit class DetailViewController: UITableViewController, UISearchBarDelegate, UISearchDisplayDelegate { var movieL = ModelMo...
PHP
UTF-8
1,937
3.46875
3
[]
no_license
<?php namespace Cart\Classes; class Cart { /** * @var $id */ private $id; /** * @var $name */ private $name; /** * @var $quantity */ private $quantity; /** * @var $price */ private $price; /** * @var $currency */ private $cur...
C++
UTF-8
847
3.25
3
[ "MIT" ]
permissive
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: vector<vector<int>> levelOrderBottom(TreeNode* root) { vector<vector<int>> ans; if(!r...
Markdown
UTF-8
2,622
2.703125
3
[ "MIT" ]
permissive
To view this unstyled markup visit [http://mrmrs.io/html](http://mrmrs.io/html) # HTML Common markup patterns I use for developing websites. # Features * All non-media elements in the HTML5 spec are included on one page and are ready to be styled. * Modular Structure - add your own patterns, or delete the ones you ...
Python
UTF-8
203
3.609375
4
[]
no_license
number_dogs = int(input()) number_animals = int(input()) dog_food_price = 2.5 animal_food_price = 4 result = number_dogs * dog_food_price + number_animals * animal_food_price print(f'{result} lv')
Java
UTF-8
6,233
3.46875
3
[]
no_license
import java.util.ArrayList; import java.util.Random; /** * Lab 6: Java Collection Framework, Skip List and Apache ANT <br /> * The {@code SkipList} class * @param <K> {@code K} key of each skip list node * @param <V> {@code V} value of each skip list node */ public class SkipList<K extends Com...
C++
UTF-8
392
2.8125
3
[]
no_license
#pragma once #include <GLFW/glfw3.h> #include <functional> typedef double time__; class Time{ time__ time, dt; public: bool Init(){ dt = 0; time = glfwGetTime(); return true; } void Update(std::function<void()> f){ dt = glfwGetTime() - time; if (dt <= 0) dt = 0; else{ f(); ...
Python
UTF-8
1,038
2.921875
3
[]
no_license
import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO.BOARD) Motor1A = 16 Motor1B = 18 Motor1E = 22 GPIO.setup(Motor1A,GPIO.OUT) GPIO.setup(Motor1B,GPIO.OUT) GPIO.setup(Motor1E,GPIO.OUT) print ("Going forwards") GPIO.output(Motor1A,GPIO.HIGH) GPIO.output(Motor1B,GPIO.LOW) GPIO.output(Motor1E,GPIO.HIGH) ...
Ruby
UTF-8
141
2.8125
3
[]
no_license
student_names = Array.new(24, "Student") student_names << "Test" student_names << "Grumpy Cat" puts student_names[1] puts student_names[25]
Python
UTF-8
2,353
3.53125
4
[]
no_license
import pandas as pd def store_list(): print("---------------------------------------------------------------------------------------------------") print(" STORE LIST ") store={'Item':['Chicken Strips','French Fries','Hamburger','Hotdog','Large Drink','Medium Drink','Milk Shake','Salad'...
PHP
UTF-8
406
2.609375
3
[ "MIT" ]
permissive
<?php namespace App\App\Traits; trait Sluggable { public function scopeBySlug($query,$slug) { return $query->where('slug',$slug); } public static function findBySlug($slug) { return static::where('slug',$slug)->first(); } public static function slugExists($slug,$id) {...
JavaScript
UTF-8
4,620
2.640625
3
[]
no_license
module.exports = async (Discord, interaction, axios, { get_role }) => { if (get_role(interaction)) { await interaction.reply("กำลังจัดโต๊ะสำหรับ Roulette") const get_countdown = interaction.options.getInteger("countdown") const get_point = interaction.options.getInteger("point") let mess = await...
Python
UTF-8
14,501
2.9375
3
[]
no_license
""" Hello this is created by majidabdulred. Below is the structural documentation of the program. Variables: recruits:[] To store id of recruits. data:{} To store the data of the recruits.It contains one more dict which has keys given below: steps: Stores the steps recruiter has completed. user...
Java
UTF-8
6,235
3.421875
3
[]
no_license
/** * Fabian Flores * Date created: 03/27/2020 * Last modified: 04/07/2020 * Table output aided by code found here -> * https://www.logicbig.com/how-to/code-snippets/jcode-java-cmd-command-line-table.html */ import java.io.*; import java.util.Scanner; import java.util.ArrayList; public class SJF { public SJ...
Python
UTF-8
3,491
2.65625
3
[]
no_license
# -*- coding: utf-8 -*- import re import requests from bs4 import BeautifulSoup import lxml import csv import codecs url = "http://repetitory.freeads.kz/ru-i-classifieds-i-page-i-31-4-i-index.html" voc = [u'язик', u'скому', u'цкому', u'цкий', u'ский', u'ского', u'цкого', ...
Python
UTF-8
4,278
3.125
3
[]
no_license
#!/usr/bin/env python # Chuck norris gets reincarnated before he dies ! import sys sys.setrecursionlimit(1000000) # this should be f*cking default parameter ! ############################################################################### # # The real stuff # ######################################################...
JavaScript
UTF-8
1,151
3.828125
4
[]
no_license
let name="wenting" /// test console.log(`hello ${name}`) // console.log("hello" + name) // Math package console.log(Math.trunc(3.64)) console.log(Math.round(3.64)) const day = "Monday" // If if (day === "Monday"){ console.log("Workday") } else { console.log("Not Monday") } // For and while const a = [1,...
Java
UTF-8
467
2.25
2
[]
no_license
package com.seniorproject.game.helpers; import com.badlogic.gdx.scenes.scene2d.ui.TextField; import com.seniorproject.game.ShooterGame; public class TextFieldHelper { TextField textField; public TextFieldHelper(int width, int height, ShooterGame game) { textField = new TextField("", game.defaultSkin); textFie...
JavaScript
UTF-8
1,149
3.078125
3
[]
no_license
// John Dulaney // This module creates a function that edits events. this is thrown together //┌(° ͜ʖ͡°)┘ const db = require("../Database") let editEvents = function(event) { console.log("im the edit function") const eventEl = document.getElementById("event__post") const btnId = event.target.id const ...
Markdown
UTF-8
2,286
2.609375
3
[]
no_license
--- layout: post title: "New year, new blog" date: 2016-02-12 categories: update --- Hi, my name's Zaran. I'm going to post updates on the projects I'm working on here. Let's see how the [Checkers AI](https://rcos.io/projects/zlalvani/checkers-learner/profile) pans out. For fun, here's the worst function I...
Markdown
UTF-8
2,483
2.6875
3
[]
no_license
# Rainforest Rainforest是一个围绕保险业务的生态系统,以区块链为基础,连接生态个参与方,主要包括保险中台系统(分为业务运营和销售平台)、区块链销售平台,区块链跨机构协作平台…… ## business operation platform 保险中台系统-业务运营平台 ​ 主要支持保险公司业务人员定义产品,发布产品,渠道管理,保单查询,客户查询,账单查询,理赔报案处理…… ## sales platform 保险中台系统-销售平台 ​ 主要支持保险公司在线报价,核保,承保,退保,客户报案…… ## product 保险中台系统-产品工厂 ​ 主要支持产品结构定义,保费计算定义,核保规则定义…… ...
C#
UTF-8
4,080
3.109375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using RecommenderSystem.Core.Helper; namespace RecommenderSystem.Core.Model { public class Time { public enum Period_Of_Day { All = 0, Morning = 1, Afternoon ...
Python
UTF-8
1,562
2.546875
3
[]
no_license
__author__ = "gabe" import cmdinterface from stockroles import Player from stockroles import roles_lookup class SerialKiller(Player): def __init__(self, name): super(SerialKiller, self).__init__(name, "Serial Killer") self.team = "Dark" self.night_action_rank = 5.0 self.purpose = "...
Swift
UTF-8
904
2.703125
3
[]
no_license
// // ViewController.swift // iFoodie_app // // Created by Victor Garcia Torres on 21/12/2019. // Copyright © 2019 iFoodieTeam. All rights reserved. // import UIKit var user: [String] = [] class RegisterController: UIViewController { @IBOutlet weak var passwordTF: UITextField! @IBOutlet weak var emailTF: ...
C#
UTF-8
2,366
3.671875
4
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Homework5 { class Complex { public double X { get; private set; } public double Y { get; private set; } public Complex(double x, double y) { this.X = x; this...
Python
UTF-8
3,705
2.703125
3
[]
no_license
# -*- coding:utf-8 -*- from __future__ import division from gensim.models import word2vec from sklearn.manifold import MDS from sklearn.manifold import TSNE from matplotlib import pyplot as plt from matplotlib.collections import LineCollection from sklearn.metrics import euclidean_distances from mpl_toolkits.mplot3d ...
C++
UTF-8
3,653
2.6875
3
[ "MIT" ]
permissive
#include "RT_Mesh.h" #include "RT_ArrayBuffer.h" #include "RT_IndexBuffer.h" #include "..\Abstract\RT_Material.h" #include "RT_Shader.h" #include "RT_Uniform.h" #include "RT_UniformType.h" #include <sstream> RT_Mesh::RT_Mesh() : indexBuffer(nullptr), id(0) { glGenVertexArrays(1, &id); } RT_Mesh::~RT_Mesh() ...
Markdown
UTF-8
772
2.71875
3
[]
no_license
# Divi Image Height Matcher When you insert images with different sizes in an html row dif, sometimes you want all of them to have the same height. What this plugin does is to force the height of all images to be the same, while keeping the aspect ratio. Height matcher is used in Wordpress Divi. When inserting more t...
C#
UTF-8
1,368
2.5625
3
[]
no_license
using System; using System.Drawing; using System.Windows.Forms; using Model; namespace UI { public partial class Main_Form : Form { private string tafelnr; private Werknemer huidigeGebruiker = new Werknemer(); public Main_Form(Werknemer huidigGebruiker_in) { ...
JavaScript
UTF-8
4,188
3.390625
3
[]
no_license
var winCount = 3; function checkRows(playerChosen, grid, gridLength) { for (let row = 0; row < gridLength; row++) { let count = 0; for (let col = 0; col < gridLength; col++) { if (grid[row][col] === playerChosen) { count++; } else { count = 0; } if (count === winCount)...
Python
UTF-8
493
2.90625
3
[]
no_license
import RPi.GPIO as GPIO import time class Luz(): def __init__(self): self.intensidad=0 GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(7, GPIO.OUT) self.foco=GPIO.PWM(7,100) self.foco.start(self.intensidad) def cambiarIntensidad(self, intensidad): self.intensidad=intensidad print("Inten...
Python
UTF-8
691
3.890625
4
[]
no_license
class Employee: name = "강감찬" count = 0 def __init__(self, name="없음"): # print(name, self.count) Employee.count += 1 print(Employee.count) #클래스의 변수를 출력할꺼면ㅡ def display(self, a = 0): print(self.count, a) def __del__(self): print("delete") cla...
Python
UTF-8
2,696
2.578125
3
[ "Apache-2.0" ]
permissive
# Copyright (c) 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
Java
UTF-8
1,541
2.21875
2
[]
no_license
package syn.pos.data.dao; import android.content.ContentValues; import android.content.Context; import syn.pos.data.model.Payment; public class PayType { private DataBaseHelper dbHelper; public PayType(Context context){ dbHelper = new DataBaseHelper(context); } public long insertPayType(Payment ...
Markdown
UTF-8
758
2.609375
3
[]
no_license
# Welcome! <br> <i> Conservation of Crop Wild Relatives (CWR) in Canada </i> is an app that lets you identify the native range of CWR, and the extent of those species’ ranges that are conserved ex situ in Canadian botanic gardens. From the left navigation panel you'll be able to access the maps and data concerning ...
Markdown
UTF-8
1,309
2.96875
3
[]
no_license
# Test Prioritisation Exercise We will implement a simple, additional greedy based Test Case Prioritisation (TCP) toolchain based on [coverage.py](https://coverage.readthedocs.io/en/coverage-5.5/) and [PyTest](https://docs.pytest.org/en/6.2.x/). The included `sample.py` contains examples of: 1. How to invoke `covera...
C#
UTF-8
1,634
2.515625
3
[]
no_license
using Pathfinding; using System.Collections; using System.Collections.Generic; using UnityEngine; public class HeartSystem : MonoBehaviour { public GameObject[] hearts; //[0] [1] [2] public int life; //3 private bool dead; public string script; public int MaxLife; public GameObject audio1; ...
Shell
UTF-8
379
3.234375
3
[ "MIT" ]
permissive
#!/usr/bin/env bash set -Eeuxo pipefail PROJECT_NAME= if [[ ! -d .container_home_dir ]]; then mkdir -p .container_home_dir fi touch .container_home_dir/.bash_history docker build --tag ${PROJECT_NAME} . docker run -it --rm \ -v $(pwd):/workdir \ -v $(pwd)/.container_home_dir:/home/user/.bash_history \ ...
SQL
UTF-8
1,408
3.203125
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : Achter Source Server Version : 50515 Source Host : localhost:3306 Source Database : shop Target Server Type : MYSQL Target Server Version : 50515 File Encoding : 65001 Date: 2020-05-31 20:52:55 */ SET FOREIGN_KEY_CHECKS=0; -- -------...
PHP
UTF-8
2,351
2.640625
3
[]
no_license
<?php /** * Created by PhpStorm. * User: ThinkPad * Date: 2015/10/25 * Time: 9:37 */ use Goutte\Client; use Symfony\Component\DomCrawler\Crawler; class kat_cr_Parser implements parserInterface { function __construct() { $this->client = new Client(); } public function parseTVSerialsinfo($u...
Java
UTF-8
3,762
2.15625
2
[]
no_license
package com.kpi.scineticle.model.subsystemOfDataBase.electronic_resource; import androidx.room.Entity; import androidx.room.PrimaryKey; import com.kpi.scineticle.model.subsystemOfDataBase.ScientWork; import java.io.Serializable; @Entity (tableName = "el_resource_table") public class ElectronicResource extends Scien...
C++
UTF-8
695
2.609375
3
[]
no_license
#include<cstdio> using namespace std; #define MAX 1001 #define MAX2 6*MAX #define DICE 6 double p[MAX][MAX2], prob = 1.0/6.0; double solve(int n, int k) { if(p[n][k] != -1.0) return p[n][k]; if(n == 0) { if(k != 0) return p[n][k] = 0.0; else return p[n][k] = 1.0; } p[n][k] = 0.0; for(int i=1; i<=...
Ruby
UTF-8
1,191
4.125
4
[]
no_license
require_relative 'human' class Samurai < Human @@how_many = 0 attr_accessor :strength, :intelligence, :stealth, :health def initialize @@how_many += 1 @strength = 3 @intelligence = 3 @stealth = 175 @health = 200 end def death_blow(enemy) args = method(...
Markdown
UTF-8
1,720
2.59375
3
[ "MIT" ]
permissive
--- layout: page title: Cameo Series Blue White Columbine --- <div class="row"> <div class="col-md-4"> <div class="plant-image plant-image-large" style="background-image: url(&quot;https://s3-us-west-1.amazonaws.com/images.plantwithbloom.com/cameo_series_blue_white_columbine.jpg&quot;);"></div> </div> <div ...
Markdown
UTF-8
593
2.53125
3
[ "MIT" ]
permissive
--- title: "Chart 模板指南" weight: 5 --- # Chart模板开发者指南 该指南提供Helm Chart模板的介绍,重点强调模板语言。 模板会生成manifest文件,使用Kubernetes可以识别的YAML格式描述。我们会看到模板是如何结构化的, 它们如何被使用,如何编写Go模板,以及如何调试你们的工作内容。 该指南聚焦于以下概念: - Helm模板语言 - values值的使用 - 使用模板工作的技术点 该指南面向学习Helm模板语言的来龙去脉。其他指南提供介绍性资料,示例和最佳实践。
TypeScript
UTF-8
366
2.671875
3
[ "MIT" ]
permissive
import type ICanvasContext from './ICanvasContext' export default interface IDrawable { /** * 绘制当前实例 * @param x 当前实例父容器左上角的 x 坐标 * @param y 当前实例父容器左上角的 y 坐标 * @param viewHeight 整个画布的高度 */ draw: (ctx: ICanvasContext, x: number, y: number, viewHeight: number) => void }
PHP
UTF-8
959
2.921875
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Menghubungkan CI dengan Database</title> <meta name="viewport" content="width=device-width, initial-scale=1"> ...
SQL
UTF-8
205
2.625
3
[ "MIT", "LicenseRef-scancode-proprietary-license" ]
permissive
--liquibase formatted sql --changeset uk.gov.pay:index_transaction_type_for_filtering runInTransaction:false CREATE INDEX CONCURRENTLY IF NOT EXISTS transaction_type_idx ON transaction USING btree(type);
Java
UTF-8
181
1.953125
2
[]
no_license
package com.example.design.mode.demo.abstr.factory; /** * @author liuxiaojing * @description * @date 2021/6/30 下午3:18 */ public interface Journal { String create(); }
Ruby
UTF-8
1,126
2.859375
3
[ "MIT" ]
permissive
require "test_helper" class ComplexityCalculatorTest < Minitest::Test def setup @calc = McClimate::ComplexityCalculator.new end def parse(source) RubyParser.for_current_ruby.parse("def foo; #{source}; end") end def test_empty_method_source sexp = parse("") assert_equal 1, @calc.score(sexp...
PHP
UTF-8
1,621
3.265625
3
[ "Apache-2.0" ]
permissive
<?php $precio = 1000; // Precio del producto $pagado = 2000; // Pagado por el cliente // array con los billetes y monedas disponibles $disponible = array(500, 200, 100, 50, 20, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05, 0.02, 0.01); $nodisponible = array(0.1, 0.2); $cambio = $pagado - $precio;// Calculamos el cambio que debe s...
Markdown
UTF-8
6,723
3.34375
3
[ "Apache-2.0" ]
permissive
# It's Not Magic This role playing game adventure takes you through a Wizard's Dungeon to find the invasion of an other worldly power. ## Table of Contents * **Psionics**: An introduction to the powers fueling this journey into insanity. * **Adventure Hooks**: Ideas on how to make the adventure more engaging for you...
Java
UTF-8
4,737
2.484375
2
[]
no_license
package org.cocome.storesservice.controller; import java.util.Collection; import java.util.LinkedList; import javax.ejb.EJB; import javax.enterprise.context.RequestScoped; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; import javax.ws.rs.NotFoundException; import javax.ws.rs.POST; imp...
C
UTF-8
169
3
3
[]
no_license
// Control Flow #include <stdio.h> int main() { int a = 10; if (a < 20) { printf("a is less than 20"); } else { return 0; } }
Python
UTF-8
1,298
2.53125
3
[]
no_license
#-*- coding:utf-8 -*- from __future__ import unicode_literals from datetime import datetime from django.db import models # Create your models here. class User(models.Model): """ 作者模型 """ name = models.CharField(verbose_name =u'姓名', max_length= 30) mail = models.EmailField(verbose_name = u'邮箱', max_...
PHP
UTF-8
213
2.546875
3
[]
no_license
<?php namespace ApiBundle\Provider; class HashProvider { /** * @param string $string * * @return string */ public function getHash($string) { return md5($string); } }
Swift
UTF-8
2,836
2.921875
3
[]
no_license
// // mosquedetails.swift // hw3 // // Created by sarah alshammari on 5/7/20. // Copyright © 2020 sarah. All rights reserved. // import SwiftUI struct mosquedetails: View { var mo : mousque var body: some View { ZStack{ Color.black .edgesIgnoringSafeArea(.all) ...
Python
UTF-8
594
3.359375
3
[]
no_license
correct = 0 soma = 0.0 while (True): x = float(input()) if (x < 0.0 or x > 10): print ("nota invalida") else: soma += x if (correct == 1): print ("media = {:.2f}".format(soma/2)) soma = 0 correct = 0 print ("novo calculo (1-sim 2-nao)")...
C#
UTF-8
2,188
2.921875
3
[ "BSD-3-Clause" ]
permissive
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace assignment3 { class Program { static void Main(string[] args) { Restaurantmenu.Chooseoption(); // Customer c = new Customer...
SQL
UTF-8
7,766
3.015625
3
[]
no_license
-- -------------------------------------------------------- -- Host: 192.168.0.101 -- Wersja serwera: 10.1.30-MariaDB - mariadb.org binary distribution -- Serwer OS: Win32 -- HeidiSQL Wersja: 9.5.0.5261 -- --------------------------------------------...