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++
GB18030
1,119
2.765625
3
[]
no_license
#include "EventLoopThread.h" #include "EventLoop.h" using namespace kimgbo; using namespace kimgbo::net; EventLoopThread::EventLoopThread(const ThreadInitCallback& cb) : m_loop(NULL), m_exiting(false), m_thread(std::bind(&EventLoopThread::threadFunc, this)), m_mutex(), m_cond(m_mutex), m_callba...
Java
UTF-8
1,560
2.84375
3
[]
no_license
package clientlib; public enum Elements { NONE(' '), BATTLE_WALL('☼'), BANG('Ѡ'), CONSTRUCTION('╬'), CONSTRUCTION_DESTROYED_DOWN('╩'), CONSTRUCTION_DESTROYED_UP('╦'), CONSTRUCTION_DESTROYED_LEFT('╠'), CONSTRUCTION_DESTROYED_RIGHT('╣'), CONSTRUCTION_DESTROYED_DOWN_TWICE('╨'), ...
Python
UTF-8
1,182
2.828125
3
[ "LicenseRef-scancode-public-domain", "BSD-3-Clause" ]
permissive
import os from subprocess import run, PIPE, STDOUT import time def wait_for_job(status_ticker_queue): while True: p = run(["hetero", "jobs"], stdout=PIPE, stderr=STDOUT) if p.stdout.decode('ascii').rstrip() == "": for key in status_ticker_queue.keys(): if status_ticker_queue[key] == "failed": ...
Markdown
UTF-8
3,944
2.6875
3
[]
no_license
--- description: "Simple Way to Make Perfect Peanut Butter Cheesecake Brownies" title: "Simple Way to Make Perfect Peanut Butter Cheesecake Brownies" slug: 878-simple-way-to-make-perfect-peanut-butter-cheesecake-brownies date: 2021-02-15T22:59:15.775Z image: https://img-global.cpcdn.com/recipes/6585483939807232/680x482...
SQL
WINDOWS-1250
1,169
3.625
4
[]
no_license
/* Fecha: 24 SETIEMBRE 2018 Autor: Mariela Barrantes Descripcion: TABLA CATALOGO OCUPACION */ create table OCUPACION ( id_Ocupacion number(6), nombre varchar2(30) CONSTRAINT Ocupacion_nombre_NN NOT NULL, --Atributos Auditoria Fecha_creacion DATE, Usuario_creacion VARCHAR2(10), Fecha_ultima_modif...
Java
UTF-8
2,204
2.046875
2
[ "Apache-2.0", "CC-BY-3.0" ]
permissive
/* * Copyright (C) 2012 CONIT Co., Ltd. * * 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 a...
Python
UTF-8
150
3.140625
3
[]
no_license
class Solution: def mySqrt(self, x: int) -> int: return int(x**0.5) if __name__ == "__main__": s = Solution() print(s.mySqrt(8))
Markdown
UTF-8
784
3.171875
3
[]
no_license
# Celebrate Success If the project finishes a phase successfully \(e.g. first successful production release\) this should be celebrated. This is important because: * **Motivation** Celebrating success is a kind of appreciation to the people who did a good job in the past days. Appreciation is an important booster...
JavaScript
UTF-8
6,186
2.8125
3
[]
no_license
/* WebWorkerController.js Contains logic that is used to control the web worker processes that compute the values to color each pixel on the canvas. */ // jslint directive /*jslint browser: true, white: true*/ /*global Form, drawingFunctions, Progress, alert, Worker*/ (function () { 'use strict'; ...
C++
UTF-8
2,376
3.375
3
[]
no_license
/// main.cpp - Bubble Sort #include <iostream> #include <stdlib.h> #include <time.h> using namespace std; void ASMBubbleSort(long*, long); int main() { /// Fill an array with pseudorandom integers. const unsigned ARRAY_SIZE = 100000; long array[ARRAY_SIZE]; for(unsigned i = 0; i < ARRAY_SIZE; i++...
C#
UTF-8
3,271
3.671875
4
[]
no_license
using System; using System.Collections; using System.Linq; namespace EN_Lab_09 { public interface ISequenceDecorator { public string Description(); public IEnumerable Decorate(IEnumerable enumerable); } public class SequenceSum : ISequenceDecorator { public IEnumerable De...
Java
UTF-8
180
1.5625
2
[]
no_license
package challenges.strategy; public class PlusCameraApp extends PhoneCameraApp { public void edit() { } public void share() { shareStrategy.share(); } }
Python
UTF-8
1,791
4.03125
4
[]
no_license
#Mark Price #Learning Python #Fall 2011 """ This script prompts the user for an integer, and draws a grid the size (nxn) specified by the user """ def isEven (n): #Returns true if even false if odd if n%2 == 0 : return True else : return False def printLineAGrid (size): line = '+' if ...
Go
UTF-8
9,619
2.59375
3
[ "MIT" ]
permissive
package models import ( "errors" "regexp" "time" ) // Shipment wraps all the Fedex API fields needed for creating a shipment type Shipment struct { FromAndTo NotificationEmail string References []string Service string // MethodServiceLevel preserves the original shipping method service level...
PHP
UTF-8
5,244
2.625
3
[]
no_license
<?php namespace Drupal\iish_conference_lostpassword\Form; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\iish_conference\EasyProtection; use Drupal\iish_conference_lostpassword\API\ConfirmLostPasswordApi; /** * The confirm lost password form. */ class ConfirmLostPasswordForm ext...
C
UTF-8
1,317
3.71875
4
[]
no_license
//FIFO #include<stdio.h> #include<stdlib.h> struct node { int data; struct node* next; }; struct node* head = NULL; struct node* currNode = NULL; struct node* old = NULL; void enqueue(int num){ struct node* newNode = (struct node*)malloc(sizeof(struct node)); if(head == NULL){ newNode->data...
PHP
UTF-8
10,905
2.578125
3
[ "MIT" ]
permissive
<?php namespace Conv\Factory; use Conv\Structure\Attribute; use Conv\Structure\ColumnStructure; use Conv\Structure\IndexStructure; use Conv\Structure\PartitionLongStructure; use Conv\Structure\PartitionPartStructure; use Conv\Structure\PartitionShortStructure; use Conv\Structure\TableStructure; use Conv\Util\Config; ...
C++
UTF-8
1,042
2.625
3
[]
no_license
//#include <stdio.h> //#include <string.h> //#include <algorithm> // //using namespace std; //int Tree[1000]; //struct Edge{ // int a; // int b; // int lowCost; // int status; // bool operator < (const Edge &e) const{ // return lowCost < e.lowCost; // } // //}edge[1000]; // //int findRoot(int x) { //...
Java
UTF-8
1,075
2.140625
2
[]
no_license
package br.com.vehicle.delivery.configuration; import org.springframework.context.annotation.Configuration; import org.springframework.format.FormatterRegistry; import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; import org.springframework.http.MediaType; import org.springframework.web.serv...
JavaScript
UTF-8
380
2.890625
3
[ "MIT" ]
permissive
"use strict"; const swapi = function(num){ let url = "https://swapi.dev/api/people/"; fetch(url+num+"/").then(data => data.json()) .then(obj => { console.log(obj); return fetch(obj.homeworld) }) .then(hwdata => hwdata.json()) .then(hwObject => console.log(hwObj...
C++
UTF-8
1,819
2.890625
3
[]
no_license
// Runtime: 4 ms, faster than 96.56% of C++ // Memory Usage: 8.9 MB, less than 100.00% of C++ class Solution { public: string mostCommonWord(string paragraph, vector<string>& banned) { vector<string> v; vector<int> freq; string s = ""; int i, j, max = 0; bool isBanned =...
Python
UTF-8
547
3.15625
3
[]
no_license
import notas.nota as modelo class Acciones: def crear(self, usuario): print(f'\nOk {usuario[1]}!! vamos a crear una nota... ') titulo = input("Ingresa el titulo de la nota: ") descripcion = input("Ingresa la nota: ") nota = modelo.Nota(usuario[0], titulo, descripcion) gua...
JavaScript
UTF-8
2,446
3.15625
3
[]
no_license
'use strict' var gKeyWords = createArrOfKeys(); var gKeysCount = { happy: 4, asking: 46, sad: 15, amazed: 9, pink: 1, wonder: 18, complete: 3, mad: 19, smart: 30, man: 12, cat: 10, child: 2, victory: 15, suprised: 30, unsatisfied: 3, grass: 34, grumpy: 7, laugh: 20, sarcastic: 7 }; function filterByKeyWord(key) { ...
Python
UTF-8
16,379
2.515625
3
[]
no_license
__author__ = "Shourya S. Roy Burman" __email__ = "ssrburman@gmail.com" import os import argparse import numpy as np import pandas as pd import time from pymol import cmd, util """ The first two functions were borrowed from the PyMOL wiki: https://pymolwiki.org/index.php/FindSurfaceResidues """ def findSurfaceAtoms(s...
Java
UTF-8
30,437
2.5625
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 havabol.util; import havabol.builtins.types.*; import havabol.common.type.*; import havabol.classify.*; import havabol.eval.*;...
Python
UTF-8
998
2.859375
3
[]
no_license
import phonenumbers import folium # from test import number from phonenumbers import geocoder from phonenumbers import carrier from opencage.geocoder import OpenCageGeocode import random import pyautogui number = pyautogui.prompt("Enter a Phone Number (eg.+254712345678) : ") key = 'f0daa136d83f48f29e85601b69d9baa3' ...
Shell
UTF-8
3,644
4.40625
4
[ "MIT" ]
permissive
#!/bin/bash ## Install, uninstall and update .dotfiles ## https://github.com/bymathias/dotfiles set -e DOT_SYS=`uname -s` DOT_BAK=$(date +"%Y-%m-%d").bak DOT_DEP=(git curl vim) DOT_DIR=~/.dotfiles DOT_FLS=(.bashrc .bash_profile .gitconfig .vim .vimrc .tmux.conf .inputrc) echo_notice() { echo -e "\n\033[4;37m$1\03...
C#
UTF-8
1,077
2.59375
3
[]
no_license
using System; using System.Collections.Generic; using System.Web; /// <summary> /// 意见反馈 /// </summary> public class Feedback { /// <summary> /// 返回所有意见 /// </summary> public static IEnumerable<dynamic> GetAllFeedbacks() { var db = MyDB.Open(); var sql = @"Select * ...
C#
UTF-8
1,264
3.578125
4
[]
no_license
// Problem 2. Print Company Information // A company has name, address, phone number, fax number, web site and manager. // The manager has first name, last name, age and a phone number. // Write a program that reads the information about a company and its manager and prints it back on the console. using System; cla...
C
UTF-8
2,551
2.625
3
[]
no_license
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_display.c :+: :+: :+: ...
JavaScript
UTF-8
1,163
2.5625
3
[]
no_license
function DebugValidate() { var output = ValidateServerActive( {"WorldName":"blah", "ServerIP":"174.216.19.195", "Port":7777} ); Logger.log( "DebugValidate: "+output ); } function ValidateServerActive( server_data ) { /*var data = { "WorldName": server_data["WorldName"], "ServerIP": server_data["Server...
Markdown
UTF-8
2,030
3.6875
4
[]
no_license
2000 #Magic Squares <!--- tags: cpp --> A magic square here is a square matrix made of subsequent natural numbers, whose sums for each row, column, and the two main diagonals are equal. Magic squares such as those defined above are called 'perfect squares'. Example of magic square of n=3: |||| |-|-|-| |8|1|6 |3|5|...
Java
UTF-8
1,671
2
2
[]
no_license
package com.example.android.stickshiftdraft; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import static android.R.attr.button; public class MenuActivity extends AppCompatActivity { @Override ...
C
UTF-8
197
3.015625
3
[]
no_license
#include <stdio.h> #include<conio.h> #include <string.h> void main() { char a[15]; int b=0; clrscr(); printf("Enter a String: \n"); scanf("%s",a); b=strlen(a); printf("Length= %d\n",b); getch(); }
C#
UTF-8
264
2.765625
3
[]
no_license
namespace AoC2015.Solutions.Day01 { using System.Linq; public class Part01 : ISolution { public string Solve(string input) { return (input.Count(x => x == '(') - input.Count(x => x == ')')).ToString(); } } }
Java
UTF-8
8,208
2.453125
2
[]
no_license
package game; import javafx.application.Platform; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.input.KeyCode; import javafx.scene.layout.Pane; import javafx.scene.shape.Rectangle; import javafx.stage.Stage; import org.slf4j.Logger; import org.sl...
Java
UTF-8
371
1.65625
2
[]
no_license
package com.example.tjdwp.planiot; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; /** * Created by tjdwp on 2017-08-08. */ public class Dic_info extends AppCompatActivity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...
Java
UTF-8
1,364
3.03125
3
[]
no_license
package TCP_IP_in_Java; import java.io.IOException; import java.net.InetAddress; import java.util.List; /** * Created by tonytan on 10/8/15. * * */ public class LookupThread extends Thread{ private List entries; PooledWebLog log; public LookupThread(List entries, PooledWebLog log){ this.entr...
Java
UTF-8
192
1.671875
2
[]
no_license
package io.vilya.eurus.core.manager; /** * @author iamaprin * @time 2017年6月9日 下午10:11:52 */ public interface IManager { void startup(); void shutdown(); }
Markdown
UTF-8
4,803
2.96875
3
[]
no_license
``` package com.ksxing.util; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import java.util.List; /** * 200:表示成功 * 500:表示错误,错误信息在msg字段中 * 501:bean验证错误,不管多少个错误都以map形式返回 * 502:拦截器拦截到用户token出错 * 555:异常抛出信息 */ public class ResultJson { // 定义...
Java
UTF-8
8,337
1.976563
2
[]
no_license
package br.com.joncmuniz.microservices.api.web.hateoas; import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; ...
PHP
UTF-8
1,245
2.59375
3
[ "MIT" ]
permissive
<?php use Illuminate\Auth\UserTrait; use Illuminate\Auth\UserInterface; use Illuminate\Auth\Reminders\RemindableTrait; use Illuminate\Auth\Reminders\RemindableInterface; use LaravelBook\Ardent\Ardent; class User extends Ardent implements UserInterface, RemindableInterface { use UserTrait, RemindableTrait; publ...
Java
UTF-8
1,620
2.40625
2
[]
no_license
package it.cilea.osd.jdyna.validator; import it.cilea.osd.jdyna.model.Soggettario; import it.cilea.osd.jdyna.service.IValidatorClassificationService; import it.cilea.osd.jdyna.service.IValidatorSubjectService; import it.cilea.osd.jdyna.service.ValidatorService.ValidationResult; import org.apache.commons.loggin...
PHP
UTF-8
4,740
2.71875
3
[ "Apache-2.0" ]
permissive
<?php namespace FrontCore\ViewHelpers; use Zend\View\Helper\AbstractHelper; class FrontRenderSimpleHtmlTable extends AbstractHelper { /** * Default settings for table params * @var various */ protected $id = "dataTable1"; protected $class = "data-table mj3-table table table-striped dataTable no-foote...
Markdown
UTF-8
5,454
2.609375
3
[]
no_license
--- author: name: jshen picture: 113709 body: "[img:sites/default/files/old-images/TypeAmericana2_500pix_6520.jpg]\r\n\r\n\r\n<strong>First, A full day of talking about American type history<strong>\r\n\t\r\nFriday, May 4, 10am\u20135pm\r\n\r\nWe\u2018ve invited noted historians and practitioners of American ...
JavaScript
UTF-8
651
3.640625
4
[]
no_license
var fs = require('fs'); async function myReadFile() { try { console.log('Starting read'); let result = await fs.readFile('input.txt',function(err,data){ if (err) { return console.log(err); } console.log('Async read: '+ data.toString()); }) } catch (error) { con...
Markdown
UTF-8
4,055
2.703125
3
[]
no_license
--- title: "Créer votre première application web PHP dans Azure en 5 minutes | Microsoft Docs" description: "Découvrez la facilité avec laquelle vous pouvez exécuter des applications web dans App Service en déployant un exemple d’application PHP." services: app-service\web documentationcenter: author: cephalin m...
Markdown
UTF-8
4,587
3.09375
3
[ "0BSD" ]
permissive
--- title: JDSB Newsletter - Landing the Software Dev interview description: My thoughts on how to get called in date: 2020-11-12T18:52:51.159Z tags: - JDSB - Career published: true favorite: false --- I've a few conversations with community member recently about the frustration and distress of applying for positio...
C
UTF-8
518
3.859375
4
[]
no_license
#include <stdio.h> #include "fonction7.h" #include <stdbool.h> void fonction7() { int nb; printf("Veuillez saisir un nombre: "); scanf("%d", &nb); entier(nb); multiple(nb); divisible(nb); } void entier(int nb) { if(nb % 2 == 0) { printf("Il est pair \n"); } } void multipl...
Java
UTF-8
2,385
2.078125
2
[ "Apache-2.0" ]
permissive
/* * Copyright 2016 The Simple File Server Authors * * 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 applicabl...
Markdown
UTF-8
678
2.59375
3
[]
no_license
# what data should you be using to calculate the encodings based on stats These encodings are all based on statistics calculated from the dataset like counts and means. Considering this, what data should you be using to calculate the encodings? - Count Encoding - Target Encoding - Leave-one-out Encoding - CatBoost Enco...
Java
UTF-8
2,330
2.03125
2
[]
no_license
package com.icts.shortfilmfestival.tabgroup; import java.util.ArrayList; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickList...
C++
UTF-8
745
2.640625
3
[]
no_license
#include "DialogBox.h" #include <gtkmm/stock.h> #include <gtkmm/entry.h> #include <iostream> using namespace std; DialogBox::DialogBox(Gtk::Window & parentWindow, string title, string message) : Dialog( title, parentWindow, true, true ) { Gtk::Label messageLabel(message); // Obtain the dialog box's vertical alignm...
PHP
UTF-8
1,390
3.40625
3
[]
no_license
<?php class Aluno { public $matricula; public $nome; private $n1; private $n2; private $t1; public $media; public function getN1() { return $this->n1; } public function getN2() { return $this->n2; } public function getT1() { retur...
Python
UTF-8
3,229
2.953125
3
[]
no_license
import codecs import re import numpy as np from config import BATCH_SIZE as batch_size from config import TIME_STEPS as time_steps from sklearn.preprocessing import OneHotEncoder # =============== 读取文本内容 =============== f = codecs.open('./data/new.txt', 'r', encoding='utf-8') data = f.readlines() # data = ''.join(data...
Markdown
UTF-8
1,154
2.875
3
[]
no_license
--- layout: post title: "MySQL Integer Spickzettel" date: 2008-06-26 11:19:06 comments: true categories: MySQL --- So damit ich es mir endlich mal merke und nicht jedes mal nach schauen muss habe ich hier mal die 5 Integer Felder der MySQL Datenbank in einer Kurzzusammenfassung zusammengestellt mit Namen, dem Werteber...
C++
UTF-8
735
2.53125
3
[]
no_license
#include "../include.h" void facade_setup(); void facade_run(); void facade_clean(); // demo codes for facade design pattern // the child system has a lot of module and different APIs class screen{ public: void screen_on(); void screen_off(); }; class mainboard{ public: void mainboard_on(); void mainboard_off()...
C++
UTF-8
4,151
2.625
3
[]
no_license
#include <string> #include <bits/stdc++.h> #include <Eigenvalues> #include <cstring> #include "PCAHeaders.cpp" #include <time.h> using namespace Eigen; using namespace std; std::vector< std::vector<double> > A,MCD; int main(int argc, char const *argv[]) { //==============taking input from file and feeding it...
Java
UTF-8
1,038
3.46875
3
[]
no_license
package ru.downwine._2_SecondLab.Ex3; import java.util.Scanner; public class Main { public static void main(String[] args) { System.out.println("Введите цвет книги, автора книги, название книги, " + "количество страниц, высоту книги, ширину книги"); Scanner in = new Scanner(System...
Python
UTF-8
1,975
2.625
3
[ "Apache-2.0" ]
permissive
"""Models for statistics in the Recorder.""" from __future__ import annotations from datetime import datetime, timedelta from typing import Literal, TypedDict class StatisticResult(TypedDict): """Statistic result data class. Allows multiple datapoints for the same statistic_id. """ meta: StatisticM...
PHP
UTF-8
2,630
2.703125
3
[ "MIT" ]
permissive
<?php /** * Created by Noman Tufail. * User: waqas * Date: 3/21/2016 * Time: 9:22 AM */ namespace App\Http\Validators\Validators\UserValidators; use App\Http\Requests\Requests\Auth\RegistrationRequest; use App\Http\Validators\Interfaces\ValidatorsInterface; class AddUserValidator extends UserValidator implement...
Java
UTF-8
1,073
2.3125
2
[]
no_license
package cn.xlink.data.query.builder.json; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** * Created by Ghold on 2017/7/21. */ public class OrDimFilter implements DimFilter, Comparable{ @JsonProperty("type") private String type = "or"; @JsonProperty("fields") privat...
Java
UTF-8
653
3
3
[]
no_license
package mentoring.JUNITTEST.J; public class main { public char lastCharacter(String str){ return str.charAt( str.length()-1); } //ARRAYIN MAX ELEMANININ BULMAK public int maxNumberArray (int []arr){ int max=0; for (int i = 0; i <arr.length ; i++) { if (max<arr...
Java
UTF-8
4,376
2.203125
2
[]
no_license
package com.example.volunteer_matching; import android.annotation.SuppressLint; import android.graphics.Point; import android.support.v4.app.FragmentActivity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.widget.Toast; import com.google.android.gms....
Python
UTF-8
552
3.25
3
[]
no_license
# -*- coding: utf-8 -*- # @Author: Xia Hanyu (Humprey Chou) # @Date: 2021-01-19 10:48:47 # @Last Modified by: Xia Hanyu (Humprey Chou) # @Last Modified time: 2021-01-25 21:52:49 def Extend_Euclid(x, y): """ Args: x ([type]): [description] y ([type]): [description] Returns: [type...
Java
UTF-8
1,207
1.640625
2
[]
no_license
package app.component.cus.feign; import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import app.component.cus.entity.MfCusReputationInfo; import app.util.toolkit.Ipage; /** * Title: MfC...
C#
UTF-8
471
3
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MSPractice { class ExcelSheetName { public string ConvertToTitle(int n) { string result = ""; while (n > 0) { n--; ...
Ruby
UTF-8
1,345
2.625
3
[]
no_license
# frozen_string_literal: true class Seed def self.begin seed = Seed.new User.delete_all Project.destroy_all ProjectsUser.destroy_all Post.destroy_all seed.generate_users seed.generate_projects seed.add_users_to_projects seed.add_project_owners seed.add_posts_to_projects end ...
JavaScript
UTF-8
741
2.625
3
[]
no_license
import axios from "../../../axios"; import { FETCH_USER_DETAILS } from '../../Types'; export const storeUserDetails = userDetails => { return { type: FETCH_USER_DETAILS, userDetails }; }; export const fetchUserDetails = id => (dispatch, getState) => { const token = getState().userReducer...
Java
UTF-8
1,282
3.203125
3
[ "MIT" ]
permissive
package file; import java.awt.Color; import java.awt.Graphics; import java.awt.image.BufferedImage; public class Image_Layer extends Layer{ public BufferedImage image; public Image_Layer(int width, int height, int imageType, String nameT, Img mother_image) { super(width, height, imageType, nameT, mother_ima...
JavaScript
UTF-8
181
2.578125
3
[]
no_license
"use strict"; const doShortly = function(callback, delay, data) { setTimeout(() => { callback(data); }, delay); }; // Don't change below: module.exports = { doShortly };
Swift
UTF-8
2,444
2.65625
3
[ "MIT", "Apache-2.0" ]
permissive
// // AddToLibraryViewController.swift // AAPhotoLibrary // // Created by Armen Abrahamyan on 5/8/16. // Copyright © 2016 Armen Abrahamyan. All rights reserved. // import UIKit import Photos class AddToLibraryViewController: UIViewController { var currentCell: NewAssetImageCell? var currentPage:Int =...
Swift
UTF-8
2,672
2.65625
3
[]
no_license
// // CustomNavigationAnimationController.swift // TransitionsTutorial // // Created by admin on 9/4/18. // Copyright © 2018 cuongnv. All rights reserved. // import UIKit class CustomNavigationAnimationController: NSObject, UIViewControllerAnimatedTransitioning { var reverse: Bool = false f...
JavaScript
UTF-8
2,011
3.90625
4
[ "MIT" ]
permissive
/** * Partition logic work in following way. It takes low and high value from array * Then take first element as the pivoted element. Then iterating through * the array to check i-th value is greater than pivot then it get stopped. * The same way decrement j from the right side to check any values less than * pivot va...
Rust
UTF-8
366
3.296875
3
[ "Apache-2.0", "LLVM-exception", "NCSA", "BSD-2-Clause", "LicenseRef-scancode-unicode", "MIT", "LicenseRef-scancode-other-permissive" ]
permissive
use std::fmt::Debug; // Test to suggest boxing the return type, and the closure branch of the `if` fn print_on_or_the_other<'a>(a: i32, b: &'a String) -> dyn Fn() + 'a { //~^ ERROR return type cannot have an unboxed trait object if a % 2 == 0 { move || println!("{a}") } else { Box::new(mov...
Markdown
UTF-8
1,847
4.15625
4
[]
no_license
### Destructuring: unpacking elements from an array or properties from an object and assigning to new variables 1. array destructuring 2. object destructuring if variables are in same count as values ``` const [a, b] = [1, 2]; console.log(a) // 1 console.log(b) // 2 ``` if variables are more than values ``` const...
Java
UTF-8
4,852
1.976563
2
[]
no_license
package com.example.mysensorsapplication; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import android.Manifest; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import andro...
Python
UTF-8
1,236
3.296875
3
[]
no_license
# Flip stack from 0 to l as group def flip(stack, l): temp = stack[:l+1] temp.reverse() for i in xrange(l+1): stack[i] = 1 - temp[i] # flip def solve(stack): count = 0 n = len(stack) last_negative = n - 1 print 'start' print stack while last_negative >= 0: # update l...
PHP
UTF-8
10,155
2.640625
3
[]
no_license
<?php /*********************************************************************** * Author : Philippe Ku * School / Class : CFPT Informatique / I.FA-P3B * Date : 15.06.2016 * Programm : Event gestion website * File : controller.php * Description : This file is the controller that checks all the datas of my website...
C++
UTF-8
1,253
3.046875
3
[ "Apache-2.0" ]
permissive
#pragma once #include <Functions/IFunction.h> #include <Interpreters/Context_fwd.h> namespace DB { /// Creates an array, multiplying the column (the first argument) by the number of elements in the array (the second argument). /// Function may accept more then two arguments. If so, the first array with non-empty off...
JavaScript
UTF-8
2,331
2.640625
3
[]
no_license
import React, { useEffect, useState } from 'react'; import axios from 'axios'; import { Redirect } from 'react-router-dom'; const REACT_APP_SERVER_URL = process.env.REACT_APP_SERVER_URL; const AllUsers = (props) => { const [allUsers, setAllUsers] = useState('') const [follows, setFollows] = useState([]) ...
TypeScript
UTF-8
569
2.8125
3
[ "MIT" ]
permissive
let deprecationsSeen: { [key: string]: boolean } = {}; export const resetDeprecationsSeen = (): void => { deprecationsSeen = {}; }; const consoleWarn = (typeof console === 'object' && typeof console.warn === 'function') ? (...args: any[]) => console.warn(...args) : () => { }; export const deprecate = (msg: stri...
Python
UTF-8
1,411
3.796875
4
[]
no_license
def w_convert(): kg_lb = 2.2046228 st_lb = 14 st_kg = 6.3502927 conv_choice = input( "Choose from one of the following weight conversions:\n" "1. Pound (lb) <-> Kilogram (kg)\n" "2. Stone (st) <-> Pound (lb)\n" "3. Stone (st) <-> Kilogram ...
Java
UTF-8
3,643
1.765625
2
[]
no_license
package com.dvc.mybilibili.mvp.model.api.service.comment; import com.alibaba.fastjson.JSONObject; import com.dvc.mybilibili.app.retrofit2.BaseUrl; import com.dvc.mybilibili.mvp.model.api.response.GeneralResponse; import com.dvc.mybilibili.mvp.model.api.service.comment.entity.*; import java.util.Map; import io.reacti...
Java
UTF-8
388
1.632813
2
[]
no_license
package com.pathfinder.anup.todolist; import android.content.Context; /** * Created by Anup on 2/8/2017. */ public interface TodoMainViewPresenter { void onResume(Context context); void onItemClicked(int position); void onDestroy(); void onSuccess(); void addWishTodoInDB(Context context, int i...
Java
UTF-8
991
2.8125
3
[]
no_license
package com.dengzi.eventbus; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * @Title: 异步执行线程池 * @Author: djk * @Time: 2017/11/20 * @Version:1.0.0 */ public class AsyncPoster implements Runnable { Subscription subscription; Object event; private final static E...
JavaScript
UTF-8
5,324
2.546875
3
[]
no_license
import React, { useState } from 'react'; import { View, ScrollView, KeyboardAvoidingView, TouchableOpacity } from 'react-native'; import { SafeAreaView } from 'react-native-safe-area-context'; import { Text } from 'react-native-elements'; import ModalComponent from '../components/Modal' import InputComponent from '....
C++
UTF-8
928
2.59375
3
[]
no_license
#include<stdio.h> #include<iostream> #include<ctype.h> #include<string.h> #include<stdlib.h> #include<math.h> #include<string> #include<algorithm> #include<vector> #include<sstream> #include<stack> #include<queue> #include<map> #include<set> using namespace std; int n,i,gcd,lcm,arr[100]; int GCD(int a,...
JavaScript
UTF-8
4,981
2.765625
3
[]
no_license
// user와 관계된 라우터 // JWT 웹 토큰 방식 - JSON 토큰 안에 일정한 정보를 담아 로그인, 글 작성 할 때 오직 인증된 사람만 글을 쓸 수 있도록 하기 // 웹에서 토큰을 보내주면 서버에서 인증을 해서 만약 성공 시 글을 쓸 수 있거나 로그인을 하도록 함 //서버 측에서 유저가 로그인 했는지 보관하고 있을 필요 없고 단지 요청이 있을 때 토큰 값이 유효한지만 판단해 접근 여부 결정 // npm i bcryptjs jsonwebtoken import express from 'express' import bcrypt from 'bcryptjs' ...
JavaScript
UTF-8
1,172
2.53125
3
[]
no_license
// add React import React, { Component } from 'react'; import ReactDOM from 'react-dom'; // add components import Header from './components/header'; import LinkCreate from './components/link_create'; import { Links } from '../imports/collections/links'; import LinkList from './components/link_list'; // create App com...
C
UTF-8
530
3.8125
4
[]
no_license
/* 19. Faça um algoritmo que verifique a validade de uma senha fornecida pelo usuário. A senha correta é o número: 12345. O algoritmo deve imprimir mensagem de permissão ou negação de acesso. */ #include <stdio.h> int main(){ int senha; //Entrada de Dados printf("\nDigite a senha: "); scanf("%i", &s...
Java
UTF-8
623
3.859375
4
[]
no_license
package com.jerry.linkedlist; import java.util.ArrayList; /** * * 描述 * 输入一个链表的头节点,按链表从尾到头的顺序返回每个节点的值(用数组返回)。 * * 如输入{1,2,3}的链表如下图: * * 返回一个数组为[3,2,1] * * 0 <= 链表长度 <= 1000 * */ public class RverseList { public ArrayList<Integer> printListFromTailToHead(ListNode listNode){ ArrayList<Integer> list...
Python
UTF-8
699
2.78125
3
[ "LicenseRef-scancode-generic-cla", "MIT" ]
permissive
import sys def sub(filename,out, size): qids = {} with open(filename,'r') as f: for l in f: l = l.strip().split('\t')[0] qids[l]= 0 sample = list(qids)[:size] with open(filename,'r') as f: with open(out,'w') as w: for l ...
Java
UTF-8
5,226
2.15625
2
[ "BSD-3-Clause", "MPL-2.0", "Apache-2.0" ]
permissive
// *** WARNING: this file was generated by pulumi-java-gen. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package com.pulumi.azure.monitoring.inputs; import com.pulumi.core.Output; import com.pulumi.core.annotations.Import; import java.lang.Integer; import java.lang.String; imp...
Python
UTF-8
1,527
3.265625
3
[]
no_license
#encoding:utf-8 #@Time : 2017/7/30 14:28 #@Author : JackNiu import re from sklearn.feature_extraction.text import CountVectorizer from sklearn.model_selection import train_test_split from sklearn.naive_bayes import MultinomialNB class LanguageDetector(): def __init__(self, classifier=MultinomialNB()): s...
C#
UTF-8
1,371
2.703125
3
[]
no_license
using System.Threading.Tasks; using Supermarket.Core.Models; using Microsoft.EntityFrameworkCore; namespace Supermarket.Core.Helpers { public static class SeedHelper { public static async Task SeedCategories(DataContext context) { if (await context.Categories.AnyAsync()) ...
C++
UTF-8
1,834
2.90625
3
[]
no_license
#include "height_map.h" #include "SDL_image.h" HeightMap::~HeightMap() { } Uint32 HeightMap::GetPixel(int x, int y) { int bpp = surface->format->BytesPerPixel; /* Here p is the address to the pixel we want to retrieve */ Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp; switch(bpp...
C
UTF-8
583
2.984375
3
[]
no_license
#include "shell-header.h" /** * check_builtin - checks if the user has called one of our built-ins. * @token: the string we are checking * * Return: The function that was matched, or NULL. */ void (*check_builtin(char *token))(prm_t *) { sh_t bltin[] = { {"exit", exit_blt}, {"env", env_blt}, {"setenv", set...
Python
UTF-8
630
3.421875
3
[]
no_license
# Enter your code here. Read input from STDIN. Print output to STDOUT from collections import Counter if __name__ == '__main__': N = int(input()) shoeSize = list(map(int, input().split())) shoeSize = Counter(shoeSize) customers = [] earned = 0 while 1: try: val = list(m...
Python
UTF-8
1,836
2.65625
3
[ "MIT" ]
permissive
import itertools from typing import Dict, List import numpy as np import pretrainedmodels import torch def freeze(model: torch.nn.Module): """Freeze all model parameters.""" for param in model.parameters(): param.requires_grad = False def unfreeze(model: torch.nn.Module): """Unfreeze all model...