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
C++
UTF-8
25,006
2.59375
3
[ "MIT" ]
permissive
#include <stdlib.h> #include <limits.h> #include <math.h> #include "utils.h" #include "solutions.h" SOLUTION* solveEmpty(const JOB * j);//empty implementation SOLUTION* solveBellmanFord(const JOB * j);//bellman ford shortest pathfinding algorithm SOLUTION* solveBellmanFordLimit(const JOB * j);//bellman ford s upravo...
Markdown
UTF-8
2,163
3.15625
3
[]
no_license
--- title: 二八定律与长尾理论 date: 2017-09-18 09:08:00 categories: - 数据分析思维 tags: - 数据分析思维 --- # 二八定律 前面,我们整理了[《帕累托的故事》](https://yuguiyang.github.io/2017/09/18/jotting-01/),里面有说过“帕累托法则”,就是这个二八定律,简单说来,就是 > 世界上20%的人占有80%的财富,即财富的分布式是不平衡的 这里理论不单单应用在经济学领域,其他领域也一样适用。比如: 在零售或销售行业,80%的利润可能来自20%的客户,所以运用该分析方法,就可以专注于维护这20%的客户,而不是将主要精力放在...
C++
UTF-8
589
2.53125
3
[]
no_license
#pragma once struct StuffFileEntry { dword fileSize; dword filenameLength; string filename; string stuffFilename; dword fileOffset; ifstream* handle; void Unstuff(CString path, CString start = "", int makedir=0); }; class StuffFile { public: dword filescount; bool loaded; vector<StuffFileEntry> files; ...
Markdown
UTF-8
809
2.65625
3
[ "Apache-2.0" ]
permissive
# Redoodle FAQ ## Table of Contents - [Is Redoodle a replacement for Redux? Do I need both?](#replacement) <a id="replacement"></a> ### Is Redoodle a replacement for Redux? Do I need both? Redoodle was **not** designed to be a replacement for the Redux library: Redux-powered applications can start integrating any ...
Ruby
UTF-8
2,049
4.03125
4
[]
no_license
def greetings puts "Hello, this is William's corner. May I know your name, please?" puts ">" $name = gets.chomp puts " Hi #{$name}!" puts "> Here's the menu! Please put your order." end def showMenu menu = [ {item: "Bottled Water", price: 10}, {item: "Cola", price: 20}, {item: "Fried Chicken", ...
C#
UTF-8
3,261
3.140625
3
[]
no_license
using System; using System.Collections.Generic; namespace Observer { /// <summary> /// Subject class /// </summary> internal abstract class HeadQuarters { private string _information; private List<IOperator> _operators=null; protected HeadQuarters(string information) ...
Java
UTF-8
1,063
2.09375
2
[]
no_license
package e.abimuliawans.p3l_mobile; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class CitiesDAO { @SerializedName("id") @Expose public String idCities; @SerializedName("province_id") @Expose public String province_id; @SerializedName...
Java
UTF-8
330
1.882813
2
[]
no_license
package com.pay.base.Dialect; import org.apache.ibatis.mapping.BoundSql; import org.apache.ibatis.session.Configuration; public abstract class Dialect { public abstract String getBoundSqlForPage(String sql); public abstract void addParameterToBoundSql(Configuration configuration, BoundSql boundSql, int offset, int...
C#
UTF-8
3,986
2.515625
3
[]
no_license
using System; using System.Data.SqlClient; using AdventureWorks2017.Models; namespace AdventureWorks2017.SqlServer.DataAccessObjects { public class ShoppingCartItemDao : AbstractDaoWithPrimaryKey<ShoppingCartItemModel,ShoppingCartItemModelPrimaryKey> { public override string SelectQuery => @"select ...
PHP
UTF-8
1,112
2.515625
3
[ "MIT" ]
permissive
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateCartOrdersTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('cart_orders'...
Markdown
UTF-8
610
2.828125
3
[]
no_license
# Face Amidst Beans ## Description: ## Instructions: * Ask audience to see how long it takes them to spot the face within the picture. * It is thought that those who spot the face within 3 seconds have a right-dominant brain. ## The Illusion ![alt text](FaceAmidstBeans.jpg "'Coffee Beans'") ## What Y...
C++
UTF-8
569
3.28125
3
[]
no_license
#include <iostream> int numbers[2]; int result; bool read_data() { bool flag = true; numbers[0] = numbers[1] = 0; std::cin >> numbers[0]; if (numbers[0] == 0) return false; std::cin >> numbers[1]; if (numbers[0] == 0 || numbers[1] == 0) flag = false; return flag; } void process_data() { result...
JavaScript
UTF-8
190
2.78125
3
[]
no_license
const {reverse}= require('./reverse'); // Index 2 holds the first actual command line argument let argument = process.argv[2]; console.log(argument); console.log( reverse(argument));
Shell
UTF-8
797
2.53125
3
[]
no_license
#!/bin/bash ## if [ -d /cgroup/cpu/user ]; then ## mkdir -m 0700 /cgroup/cpu/user/wm ## echo $$ > /cgroup/cpu/user/wm/tasks ## echo 2048 > /cgroup/cpu/user/wm/cpu.shares ## fi if [ -e /cgroup/blkio/tasks ]; then mkdir -m 0700 /cgroup/blkio/wm echo $$ > /cgroup/blkio/wm/tasks echo 1000 > /cgroup...
PHP
UTF-8
2,327
2.5625
3
[]
no_license
<?php namespace FormularioBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\NumberType; use Symfony\Component\Form\Forms; use Symfony\Comp...
Python
UTF-8
240
2.671875
3
[]
no_license
# print('one game') # temp=input('enter num:') # guess=int(temp) # if guess==8: # print('you good') # print('good no promgrm') # else: # print('you not meeting') # print('game over') # print(dir(__builtins__)) print(help(abs))
JavaScript
UTF-8
8,058
2.890625
3
[]
no_license
/* * Creates an content object * @param url the path to the content file * @param contentBaseUrlParam (optional) the path to the content base, this * is used to change the relative assets paths to absolute paths. if this * param is provided, it will change the assets paths, if it is not, it will * not change the ...
Java
UTF-8
4,166
2.6875
3
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package States; import Juego.EnumStates; import org.newdawn.slick.AngelCodeFont; import org.newdawn.slick.Color; import org.newdawn.sl...
C++
UTF-8
419
3.0625
3
[]
no_license
#include "header.h" long long int potencia(long int, long int); //función recursiva long long int hashing(long int key) { long long int num1, res; num1 = ((key / 1000) + 1) / 2; res = (potencia(key,num1) / 100); res = res % 100; return res; } long long int potencia(long int x, lon...
C++
UTF-8
392
2.9375
3
[]
no_license
#include "Arduino.h" #include "led.h" void initializeLED() { pinMode(LED_PIN, OUTPUT); } void blinkLED (int numberOfTimes, int delayTime) { int i; for (i = 0; i < numberOfTimes; i++) { Serial.print("LED Flashing.."); Serial.print(" "); Serial.println(i); digitalWrite(LED_PIN, HIGH); delay...
Python
UTF-8
497
3.328125
3
[]
no_license
''' Created on 2017. 10. 11. @author: jihye ''' import turtle def draw_rectangle(x,y,w,h,edge_color='black',fill_color=''): mypen=turtle.Turtle() mypen.begin_fill() mypen.pencolor(edge_color) mypen.fillcolor(fill_color) mypen.penup() mypen.goto(x,y) mypen.pendown() mypen.for...
SQL
ISO-8859-1
937
3.484375
3
[]
no_license
-- No puede haber dos o ms rallies con el mismo nombre. ALTER TABLE RALLY ADD CONSTRAINT rallyNombreUnico UNIQUE(nombre); -- El nmero de kilmetros de los que consta un tramo siempre tiene que ser mayor o igual que 20. ALTER TABLE TRAMO ADD CONSTRAINT tramoKmsValido CHECK(totalKms > 20); -- La fecha de celebracin de u...
Ruby
UTF-8
1,955
3.515625
4
[]
no_license
# Write a SQL query to get the second highest salary from the Employee table. # +----+--------+ # | Id | Salary | # +----+--------+ # | 1 | 100 | # | 2 | 200 | # | 3 | 300 | # +----+--------+ # For example, given the above Employee table, the query should return 200 as the second highest salary. If there i...
JavaScript
UTF-8
1,097
3.9375
4
[]
no_license
/* Callbacks In javascript, a callback is simply a function that is passed to another function as a parameter and is invoked or executed inside the other function. Here a function needs to wait for another function to execute or return value and this makes the chain of the functionalities (when X is completed, the...
Go
UTF-8
3,120
2.8125
3
[]
no_license
package sqlite import ( "context" "database/sql" "errors" "fmt" "time" "github.com/itiky/charge_scheduler/schema" ) func (s EventsStorage) GetSingleEvent(ctx context.Context, id int64) (retObj *schema.SingleEvent, retErr error) { dbObj := singleEvent{} err := s.Db.GetContext(ctx, &dbObj, "SELECT rowid, type,...
Java
UTF-8
708
2.46875
2
[ "Apache-2.0" ]
permissive
package controllers; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; public class LogoutController implements FrontController{ @Override public void ...
C++
UTF-8
4,985
2.96875
3
[]
no_license
#include "johnchess_app.h" #include <stdexcept> JohnchessApp::JohnchessApp(int argc, const char* argv[]) : m_app_opts(NULL), m_force_mode(false) { m_app_opts = parse_args(argc, argv); m_xboard_interface = new XBoardInterface(get_input_stream(), get_output_stream(), "Johnchess v0.1"); m_xboard_inter...
SQL
UTF-8
3,353
3.515625
4
[ "Apache-2.0" ]
permissive
library OpioidCDSREC12 version '2.0.0' using FHIR version '4.0.0' include FHIRHelpers version '4.0.0' called FHIRHelpers include OpioidCDSCommon version '2.0.0' called Common include OpioidCDSCommonConfig version '2.0.0' called Config /* ** ** Recommendation #12 ** Clinicians should offer or arrange evidence-bas...
Python
UTF-8
183
3.0625
3
[]
no_license
#!/usr/bin/python3 # -*- coding: UTF-8 -*- # filename:while.py # author: shuqing i = 0 while i < 10: print(i) i += 2 j = 0 while j in range(1, 9): print(j) j += 1
C#
UTF-8
486
2.96875
3
[]
no_license
 namespace TowerDefenseSpel { /// <summary> /// base class for all objects in the game. /// </summary> class Gameobject { protected int x; protected int y; public Gameobject(int x,int y) { this.x = x; this.y = y; } #region At...
Markdown
UTF-8
4,248
3.59375
4
[]
no_license
# Using Word2Vec to analyze Reddit Comments The Blog Post for this Repository can be viewed here on Medium: https://medium.com/ml-2-vec/using-word2vec-to-analyze-reddit-comments-28945d8cee57 In this post, I am going to go over Word2Vec. I will talk about some background of what the algorithm is, and how it can be use...
Swift
UTF-8
409
3.765625
4
[]
no_license
// 10-11 class Baby { var name: String var age: Int init?(name: String, age: Int) { if age < 0 { return nil } self.name = name self.age = age } } var cuteBaby = Baby(name: "小彼得", age: -1) if let cuteBaby = Baby(name: "小彼得", age: -1) { print("\(cute...
PHP
UTF-8
1,906
2.90625
3
[]
no_license
<?php /** * qFW - quick Framework, an PHP 7.2 Framework for speedup website development * * @mantainer Giovanni Manzoni (https://giovannimanzoni.com) * @license GNU GENERAL PUBLIC LICENSE Version 3 * */ declare(strict_types=1); namespace qFW\mvc\model\crypto\uniqid; /** * Class Uniqid * * -> http://php.net...
PHP
UTF-8
1,065
2.90625
3
[]
no_license
<?php $db_user = 'student'; $db_pass = 'pass.mysql'; $dbname = 'leveric'; $db_base = 'mysql:host=rp2.studenti.math.hr;dbname=' . $dbname . ';charset=utf8'; class DB { private static $db = null; final private function __construct() { } final private function __clone() { } public static...
PHP
UTF-8
11,827
2.625
3
[]
no_license
<?php $config = null; function load_config(&$config) { $config = simplexml_load_file(__DIR__ . '/etc/config.xml'); } load_config($config); const THUMBNAIL_IMAGE_MAX_WIDTH = 150; const THUMBNAIL_IMAGE_MAX_HEIGHT = 150; const LIMIT = 500; const TYPE_NEW = 1; const TYPE_UPD = 2; const TYPE_DEL = 3; require_once _...
Java
UTF-8
2,398
2.6875
3
[ "MIT" ]
permissive
package cmps252.HW4_2.UnitTesting; import static org.junit.jupiter.api.Assertions.*; import java.io.FileNotFoundException; import java.util.List; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import cmps252.HW4_2....
SQL
UTF-8
18,976
3.03125
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : localhost_3306 Source Server Version : 50720 Source Host : localhost:3306 Source Database : wulang Target Server Type : MYSQL Target Server Version : 50720 File Encoding : 65001 Date: 2019-02-28 18:37:53 */ SET FOREIGN_KEY_CHECKS=0; ...
Rust
UTF-8
3,347
2.78125
3
[]
no_license
use crate::synth::dsp::audionode::AudioNode; use std::thread; use std::sync::mpsc::channel; use std::sync::mpsc::{Sender, Receiver}; use piston_window::*; /* ========================================= Viz ========================================= */ #[derive(Clone)] pub struct ScopeNodeData { pub value: f32, pub...
Java
UTF-8
504
3.015625
3
[]
no_license
import java.util.InvalidPropertiesFormatException; /** * Created by Cube27 on 04.08.2017. * Пара от X1 до X2, будет хранится в Aggregate */ public class Pair { private int x; private int x2; public Pair(int x, int x2){ if(x2>x){ this.x=x; this.x2=x2; } else{ ...
Java
UTF-8
6,220
1.84375
2
[]
no_license
package com.firefighterscalendar.album; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.View; i...
Python
UTF-8
7,439
2.921875
3
[ "MIT" ]
permissive
"""Test the metrics.""" import unittest import numpy as np import pytest from aisdc.metrics import ( _div, _tpr_at_fpr, get_metrics, get_probabilities, min_max_disc, ) # pylint: disable = invalid-name PREDICTED_CLASS = np.array([0, 1, 0, 0, 1, 1]) TRUE_CLASS = np.array([0, 0, 0, 1, 1, 1]) PREDI...
Java
UTF-8
632
1.8125
2
[]
no_license
package com.github.rafaelsouzaf.prot.client.view.product; import java.util.List; import com.github.rafaelsouzaf.prot.client.util.FileModel; import com.google.gwt.user.client.rpc.AsyncCallback; public interface ProductServiceAsync { public abstract void getAll(AsyncCallback<List<ProductModel>> callbac...
C
ISO-8859-9
626
3.828125
4
[]
no_license
#include<stdio.h> void del(int A[], int size, int uw); int main() { //DZDEK STENMEYEN ELEMANI SLER int n=0; int x=0; printf("define the size of array:\n"); scanf("%d", &n); int arr[n]; int i; srand(time(NULL)); for(i=0; i<n; i++) { arr[i]=rand()%50; printf("%d. value: %d\n", i+1, arr[i]...
Java
UTF-8
2,317
2.28125
2
[]
no_license
package com.example.databasetest; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Toast; import java.util.concurrent.atomic.AtomicReference; import io.realm.Realm; import io.realm.RealmConfiguration; import io....
C#
UTF-8
6,513
2.640625
3
[]
no_license
using System; using System.Collections.Generic; using System.IO; using System.Linq; using AllTheRickAndMorty.Models; using Xamarin.Forms; namespace AllTheRickAndMorty { public partial class FavoritesTab : ContentPage { // Favorites tab brings in favorite characters and episodes and puts them in list v...
Markdown
UTF-8
620
3.140625
3
[ "MIT" ]
permissive
# Inertia.js Progress This package adds an [NProgress](https://ricostacruz.com/nprogress/) page loading indicator to your Inertia.js app. ## Installation ```bash npm install @inertiajs/progress yarn add @inertiajs/progress ``` Once it's been installed, initialize it in your app: ```js import Progress from '@inerti...
Java
UTF-8
746
2.3125
2
[]
no_license
package ejb.session.stateless; import entity.BookEntity; import java.util.List; import util.exception.BookNotFoundException; public interface BookEntitySessionBeanRemote { BookEntity createNewBook(BookEntity newBookEntity); List<BookEntity> retrieveAllBooks(); BookEntity retrieveBookByBookId(Lo...
JavaScript
UTF-8
2,517
3.5625
4
[ "MIT" ]
permissive
var magic_number = Math.floor(Math.random() * (100 - 1) + 1); var n_tries = 0; var output = ""; document.addEventListener("keydown", keyDownHandler, false); document.addEventListener("input", isNumber, false); function keyDownHandler(e) { if (e.keyCode == 13) { user_tries = document.getElementByI...
PHP
UTF-8
1,303
2.515625
3
[]
no_license
<?php namespace app\modules\yangiliklar\models; use Yii; /** * This is the model class for table "yangiliklar". * * @property int $id * @property int $b_id * @property int $m_id * @property string $nomi * @property string $matni * @property string $vaqti * @property int|null $yoqdi * @property int|null $yo...
Markdown
UTF-8
2,446
3.015625
3
[ "MIT" ]
permissive
# Intro to Nx Nx is a smart, fast and extensible build system with first class monorepo support and powerful integrations. ## Philosophy Nx has a similar design philosophy to Visual Studio Code. Code is a powerful text editor, and you can be very productive with it even if you don't install any extensions. The ecosy...
Markdown
UTF-8
794
3.0625
3
[ "MIT" ]
permissive
Hello World =========== by [liangqing](https://github.com/liangqing) ## Hello World Of Programming Languages * Javascript * Scala * Bash * C++ * PHP * Java ## Javascript [](rotate=90) ```javascript var a = 100; console.log("Hello World") ``` ## Scala[](rotate=180) ```scala val a = List(1, 2, 3) println("Hello...
PHP
UTF-8
1,670
2.921875
3
[]
no_license
<?php /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * Description of physical_hazards * * @author etbmx */ class physical_hazards { protected $_DisplayValues = array('Code', 'Name'); protected $_Headers = array('Code', 'Name'); public function __co...
Python
UTF-8
1,551
3.15625
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
''' See https://github.com/hms5232/CaiBiBa/tree/master/EricaCompanyBonus for more information. ''' ''' ...... ...... ...... 7 14 28 56 112 ...... 3 6 12 24 48 96 ...... 1 2 4 8 16 32 64 ...... -------------------------------- 1 5 17 49 129 ........ ? ''' # 計算「列」上第 n 個位置的...
Java
UTF-8
2,050
3.59375
4
[]
no_license
import java.util.Scanner; import java.util.*; public class Booking { static int ROWS = 3; static int COLUMNS = 5; boolean[][] booking = new boolean[ROWS][COLUMNS]; static Scanner userInput = new Scanner(System.in); public Booking() { } /** * Shows the booking of seats */ p...
JavaScript
UTF-8
592
2.828125
3
[]
no_license
const { fstat } = require("fs"); const fs = require("fs"); const colorData = require("./assets/colors.json"); //check if "Created With Node" exists or not and create one if does not present const dirName = "Test Files With Node"; if(!fs.existsSync(dirName)) { fs.mkdirSync(`./${dirName}`); } colorData.colorList....
Java
UTF-8
335
2.703125
3
[]
no_license
/** * Checked Exception thrown when requested food and drink are not available * @author mdalton31 * @version 1 */ public class FoodAndDrinkNotFoundException extends Exception { /** * Constructor * @param msg exception message */ public FoodAndDrinkNotFoundException(String msg) { supe...
Java
UTF-8
741
2.03125
2
[]
no_license
package org.minispm.sale.service; import org.minispm.sale.entity.Source; import org.minispm.sale.dao.SourceDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; /** * ...
PHP
UTF-8
364
2.5625
3
[ "MIT" ]
permissive
<?php namespace App; use Illuminate\Database\Eloquent\Model; class UserProfile extends Model { const MALE = "male"; const FEMALE = "female"; protected $table = 'user_profiles'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ '...
Python
UTF-8
964
3.953125
4
[]
no_license
import time def Task1(func): '''Function decorator which executes the passed in function and prints its execution time. Also, the decorator tracks the number of times the function was called. The original name of function and docstring will be preserved.''' # function call tracker count = 0 ...
Markdown
UTF-8
1,536
2.734375
3
[]
no_license
# mccloskey-portfolio Public portfolio for my data vizzes. # /ABOUT ME 👨‍💻 Hello and welcome to my portfolio! My name is Garrett McCloskey (he/him) and over the past few years, I have spent time pivoting from performer to administrator through various arts management roles. My arts management journey began at the N...
Markdown
UTF-8
482
2.734375
3
[ "MIT" ]
permissive
# Redux Custom project This is a project that you will conceive and build. The only requirements are: - It must be built with React - It must use Redux ## Scope Since class is only 6 weeks long and you will have other work and other classes you'll need to limit the scope of your project. It is okay to...
Python
UTF-8
3,305
3.09375
3
[]
no_license
#!/usr/bin/python # @mpalonso SharifCTF2016 - Forensic 150 (concatenate the part of flag) cadena2 = "cb13bbb59dde" partecadena1 = "95cd605b" parte2cadena1 = "9065f44530" #TEORIA 1 ############################################## #Si hacemos el bucle tenemos una longitud de: # 95cd605b (+1) 9065f44530 # 19 digitos en un...
TypeScript
UTF-8
1,444
2.78125
3
[]
no_license
import axios from 'axios'; import { API_PEOPLE } from '../config'; import { FilmsSuccessResponse, PersonsFilms } from '../types/films'; import { PeopleSuccessResponse, Person } from '../types/people'; import { PlanetsSuccessResponse } from '../types/planets'; async function genericFetch<T>(url: string): Promise<T> { ...
Java
UTF-8
1,295
3.515625
4
[]
no_license
package java8; import java.util.Arrays; import java.util.List; import java.util.function.Consumer; import java.util.function.Function; /** * todo * * @author zhouq * @email zhouqiao@gmail.com * @date 2018/8/4 17:00 */ public class MethodReference { private static <T> void useConsumer(Consumer<T> consumer,T ...
Java
UTF-8
5,374
2.203125
2
[]
no_license
package com.yangc.blog.service.impl; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import org.apache.commons.collections.MapUtils; import org.springframework.beans.factory.annotation.Autowired; ...
PHP
UTF-8
1,156
2.53125
3
[]
no_license
<?php use yii\db\Migration; /** * Class m200215_173611_fuel2types_ch4 */ class m200215_173611_fuel2types_ch4 extends Migration { /** * {@inheritdoc} */ public function safeUp() { try{ if(empty($this->getDb()->getSchema()->getTableSchema('fueltypes')->getColumn('EmissionCH4'...
Python
UTF-8
318
3.0625
3
[]
no_license
#!/usr/bin/python3 # -*- coding: utf-8 -*- def fib ( c ) : ''' возвращает числа Фибоначи ''' if C == 1 : return [ 0 ] if C == 1 : return [ 0, 1 ] Result = [ 0, 1 ] for k in range(2,C) : Result.append( Result[-2] + Result[-1] ) return Result
Go
UTF-8
2,530
3.09375
3
[ "Apache-2.0" ]
permissive
package dag import ( "fmt" "sync" "gitlab.com/alephledger/consensus-go/pkg/gomel" ) type fiberMap struct { content map[int]gomel.SlottedUnits width uint16 length int mx sync.RWMutex } type noSuchFiberError struct { value int } func newNoSuchFiberError(value int) *noSuchFiberError { return &noSuchF...
Markdown
UTF-8
9,740
3.3125
3
[]
no_license
## Лекция 17. Всего по-немногу про хранение объектов Темы на сегодня: * объектно-реляционные принципы хранения * убер-коллекции (модуль collections) * Структуры данных * Алгоритмы. Введение ***Задача:*** хотим узнать, каким образом можно сохранить информацию про объекты за пределами работающего кода? ### Шаг 1. Объек...
Python
UTF-8
1,021
3.421875
3
[]
no_license
#!/usr/bin/env python3 import wiki import redis def populate_from_category(redis_server, cat, level=0): """ Populates a redis set 'foo' with wikipedia subcategories. """ if not redis_server.sismember('foo', cat) and level < 5: redis_server.sadd('foo', cat) subcat = wiki.get_subcategori...
Java
UTF-8
976
2.171875
2
[]
no_license
package com.zf.servletInitializer; import com.zf.config.RootConfig; import com.zf.config.WebConfig; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; /** * @author 郑凡 * @create 2020-09-29 16:28 * web容器启动的时候创建对象 调用方法来初始化以前前端控制器 */ public class MyAbstractAnnotation...
JavaScript
UTF-8
1,075
3.65625
4
[ "BSD-3-Clause" ]
permissive
/** * 基于 {@link Color.spaces.rgb|rgb 色彩空间} ,获取或设置 Color 对象的红色值。 * @see {@link Color#green} * @see {@link Color#blue} * @see {@link Color#value} * @access public * @func Color.prototype.red * @param {number} [value] - 红色。取值范围为 `0 - 255` 。如果省略此参数则获取并返回当前值。否则将根据本参数修改当前值并返回当前 Color 对象。 * @param {boolean} [relative=false] ...
Java
UTF-8
4,585
1.640625
2
[ "Apache-2.0", "BSD-2-Clause", "Apache-1.1" ]
permissive
/* * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source c...
Python
UTF-8
575
3.921875
4
[]
no_license
# Program to print the numbers first which has highest frequency of appearance # e.g. Input: 2,3,2,2,2,3,3,3,4,3,4,4,4,5,4,4,4 # Output: 4,4,4,4,4,4,4,3,3,3,3,3,2,2,2,2,5 numbers = [int(x) for x in input().split(",")] num_count = {} count = len(numbers) for i in numbers: if i not in num_count.keys(): num_...
Python
UTF-8
17,755
3.46875
3
[]
no_license
import random from typing import List import os import time from prettytable import PrettyTable import numpy as np # Classes required for BlackJack # Card class that will represent each single card. class Card: CLUB = "\u2663" HEART = "\u2665" DIAMOND = "\u2666" SPADE = "\u2660" ...
TypeScript
UTF-8
5,741
3.09375
3
[ "MIT" ]
permissive
const DEFAULT_AUDIO_CONSTRAINTS = {}; const DEFAULT_VIDEO_CONSTRAINTS = { facingMode: 'user', frameRate: 30, height: 720, width: 1280 }; const FACING_MODES = [ 'user', 'environment' ]; const ASPECT_RATIO = 16 / 9; const STANDARD_OFFER_OPTIONS = { icerestart: 'IceRestart', offertoreceiveaudi...
C#
UTF-8
579
2.765625
3
[]
no_license
using System; using System.Collections.Generic; using System.Text; namespace HW6 { class AveragePriceTypeCommand:ICommand { AveragePriceTypeReceiver receiver; List<ProductCar> cars; string type; public AveragePriceTypeCommand(AveragePriceTypeReceiver receiver, List<ProductCar>...
Java
UTF-8
6,972
3.296875
3
[]
no_license
/*---------------------------------------------------------------------------- # File: Elevator.java # Date: Tue Sep 13 17:13:24 EDT 2011 # Author: Ellery Coleman <ellerycoleman@fas.harvard.edu> # Abstract: Implements an Elevator class for cscie160, hw1. #--------------------------------------------------------------...
JavaScript
UTF-8
1,758
3.3125
3
[]
no_license
function solve(input) { const collected = { shards: 0, fragments: 0, motes: 0 }; const junk = {}; const materials = input.split(' '); for (let i = 0; i < materials.length; i += 2) { const currentMaterial = materials[i + 1].toLowerCase(); const quanti...
C++
UTF-8
1,326
2.84375
3
[]
no_license
#include "server.h" string Server::readSocket(tcp::socket &socket) { streambuf buf; boost::system::error_code error; read_until(socket, buf, "\n", error); if (error && error != error::eof){ std::cerr << "Read error: " << error.message() << std::endl; return "Server couldn't read message...
C
UTF-8
711
3.390625
3
[]
no_license
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <ctype.h> #include "indocente.h" #include "inalumno.h" int main() { int opcion, contprof, contalum; printf("Este programa permite ingresar y mostrar a docentes y alumnos."); do { system("cls"); printf("Que desea hacer?\n...
Shell
UTF-8
1,050
3.875
4
[]
no_license
#!/bin/bash # ## build script for docu with asciidoc and daps ## (c) 2018 peters@suse.com # function usage() { echo "Usage: $0 asciidoc_filename_with_extention.adoc" exit 1; } #check for parameters if [ $# -eq 0 ] then echo "No arguments supplied."; usage; exit 1; fi while [ $# -gt 0 ]; do case "$1"...
Markdown
UTF-8
1,198
3.109375
3
[]
no_license
import { Meta, Canvas, Story } from '@storybook/addon-docs/blocks'; import Pagination from 'src/components/pagination'; <Meta title="Components/Pagination" component={Pagination} /> # Pagination Custom style for the pagination component integrated with pagy. ## Examples We currently only support one type of pagin...
C
UTF-8
16,738
2.578125
3
[]
no_license
/* * File: main.c * Author: Daniel Bradley * * Created on April 2, 2018, 3:00 PM */ #include <p18f8722.h> #include "Messages.h" #include "PIC18LCDDisplayDriver.h" #include <delays.h> #include <stdio.h> #include <stdlib.h> #pragma config OSC = HSPLL // Oscillator selection: HS with PLL enabled #pragma con...
Markdown
UTF-8
684
3.6875
4
[]
no_license
[question](https://leetcode.com/problems/maximum-subarray/) 求一个数组中连续几个相邻元素的和最大值,对于这一类问题没有太大的思路,看了视频讲解,这个问题是属于动态规划。思路也是很简单的。对于到当前元素要不要加到之前的和上,需要看之前和是否是大于零。 ```js /** * @param {number[]} nums * @return {number} */ var maxSubArray = function (nums) { const length = nums.length; const sumArr = new Array(length); ...
Ruby
UTF-8
1,199
2.71875
3
[ "MIT" ]
permissive
# frozen_string_literal: true module DeliveriesManager class ChaosGenerator NORMAL = [ [100, NoOp], ].freeze ADVANCED = [ [10, MessageDropper], [10, MessageReorder], [10, MessageDuplicator], [100, NoOp], ].freeze EXTREME = [ [4, MessageDropper], [4, Messa...
Java
UTF-8
1,917
2.21875
2
[]
no_license
package service; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework....
Java
UTF-8
3,279
2.703125
3
[]
no_license
package com.yc.wowo.user.controller; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.image.BufferedImage; import java.io.IOException; import java.util.Random; import javax.imageio.ImageIO; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSer...
C#
UTF-8
3,030
3.328125
3
[]
no_license
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Lesson30_10 { class Program { public static void Task2() { Console.WriteLine("Введите вашу строку: "); string str = Console.Rea...
Markdown
UTF-8
2,827
3.859375
4
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
###URL params plus input forms Users can submit information to the backend of an application via the address bar in their browser but that's not a very user friendly model and it's not very secure. Imagine if every time you submitted a password or credit card number to a website and it just lingered there in your navi...
Java
UTF-8
1,272
3.65625
4
[]
no_license
package exercicios2; import java.util.Scanner; public class ordem_crescente { public static void main(String[] args) { Scanner entrada = new Scanner(System.in); System.out.println("Digite o primeiro valor."); int valor1 = entrada.nextInt(); System.out.println("Digite o segundo valor"); int valor2 = entra...
Java
UTF-8
295
2.296875
2
[ "Apache-2.0" ]
permissive
package au.org.noojee.irrigation.weather.units; import java.math.BigDecimal; public class Latitude { BigDecimal latitude; public Latitude(String latitude) { this.latitude = new BigDecimal(latitude); } @Override public String toString() { return "Latitude=" + latitude; } }
Java
UTF-8
1,129
3.703125
4
[]
no_license
import java.util.Scanner; public class string7 { public static void main(String[] args) { // TODO Auto-generated method stub //ejercicio 7 programa que de una frase nos diga mayusculas minusculas y numeros que tiene*/ Scanner teclado = new Scanner(System.in); int i; int contamayus; contamayus=0;...
Shell
UTF-8
3,649
4.15625
4
[ "Apache-2.0" ]
permissive
#!/bin/bash # ============================================================================ # Script for creating appliances exported from SUSE Studio # (http://susestudio.com) on your local system. # # Requires kiwi (http://opensuse.github.com/kiwi/). # # Author: James Tan <jatan@suse.de> # Contact: feedback@susestudi...
Python
UTF-8
1,114
4.65625
5
[]
no_license
""" Any string is True, except empty strings. Any number is True, except 0. Any list, tuple, set, and dictionary are True, except empty ones. """ bool("mediate") #output: True #note: Functions can Return a Boolean """ Operators for booleans == Equal x == y != Not equal x != y > Greater than x > y < Less t...
C++
UTF-8
1,138
2.671875
3
[]
no_license
class TimerThread { public: struct Task; class Bucket; typedef uint64_t TaskId; const static TaskId INVALID_TASK_ID; TimerThread(); ~TimerThread(); // Start the timer thread. // This method should only be called once. // return 0 if success, errno otherwise. int start(const TimerThreadOptions* op...
C
UTF-8
626
2.71875
3
[]
no_license
#include <avr/io.h> void delay_timer0() { TCNT0 = 131; //load the timer counter register with 116 TCCR0A = 0x00; //set the Timer0 under normal mode TCCR0B = 0x04; //with 1:256 prescaler while ((TIFR0 & 0x01) == 0); //wait till timer overflow bit T0V0 is set TCCR0A = 0x00; //clear timer settings...
Java
UTF-8
444
1.835938
2
[]
no_license
package com.vdc.shop.dto; import lombok.Getter; import lombok.Setter; import java.util.List; @Getter @Setter public class ProductResponseDto { private String id; private String name; private long price; private String category; private BrandResponseDto brand; private List<IntAttributeDto> int...
C++
UTF-8
2,634
2.53125
3
[]
no_license
#pragma once #include <Framework.h> #include <RenderSystem.h> #include <CollisionSystem.h> #include <PhysicsSystem.h> #include <../dependancies/glm/glm.hpp> #include <../dependancies/glm/gtx/transform.hpp> namespace TransformChanges { static const Change position = 1 << 1; static const Change rotation = 1...
Java
UTF-8
1,484
2.25
2
[]
no_license
package com.enroll.service.services; import java.util.Optional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.enroll.service.entity.Enrollees; import com.enroll.service.exceptions.ResourceAlreadyExist; import com.enroll.service.exceptions.Res...