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
Python
UTF-8
8,971
3.0625
3
[]
no_license
from enum import Enum import json import random import sys import time # Support for PyInstaller --onefile. It creates an archive exe that # unpacks to a temp directory. We need to convince all our file I/O # to use that directoy as the application base dir. chdir is the # easiest way, if we use relative paths for eve...
SQL
UTF-8
1,218
3.765625
4
[]
no_license
drop table final_race_db; drop table final_reason_db; drop table final_gender_db; drop table final_result_db; drop table final_action_db; create table final_reason_db ( stop_id int primary key, reason_for_stop text, reason_for_stopcode text, reason_for_stop_detail text, reason_for_stop_explanation text ); create tabl...
TypeScript
UTF-8
552
2.609375
3
[]
no_license
export class OverallRatingsForBook { overallRating: number; overallOriginalityRating: number; overallWritingQualityRating: number; overallPageTurnerRating: number; constructor(overallRating: number, overallOriginalityRating: number, overallWritingQualityRating: number, overallPageTurnerRating: number) { ...
Python
UTF-8
651
3.609375
4
[]
no_license
#打开调取文本文件 f1 = open("test.txt","r") content= f1.read() f1.close() #删除文本文件所有符号 import string translator = str.maketrans('', '', string.punctuation) z=content.translate(translator) #转为列表 a=z.split() #用字典统计各个单词使用次数 #列表转为集合,去除重复项 set1=set(a) #集合转为列表 b=list(set1) #新建空字典 dir1={} for x in range(len(b)): dir1[b[x]]...
Rust
UTF-8
696
2.78125
3
[]
no_license
use reqwest; use std::thread; use std::time::Duration; #[allow(dead_code)] // Now the API is called from a free cron-job pub async fn call_every_hour(addr: String, paths: Vec<&'static str>) { let paths: Vec<_> = paths .into_iter() .map(|path| "http://".to_owned() + addr.as_str() + path) .collect(); th...
Java
UTF-8
737
1.664063
2
[ "Apache-2.0" ]
permissive
package com.rbkmoney.newway.kafka; import com.rbkmoney.newway.service.WalletService; import org.junit.Test; import org.mockito.Mockito; import org.springframework.boot.test.mock.mockito.MockBean; import java.util.concurrent.TimeUnit; import static org.mockito.ArgumentMatchers.anyList; public class WalletKafkaListen...
C
UTF-8
2,486
2.984375
3
[ "MIT" ]
permissive
#include <stdio.h> #include <errno.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <sys/stat.h> #include <sys/mman.h> #include <sys/types.h> #include <sys/fcntl.h> #include <lz4frame.h> /* * unframe-lz4 * * example of using lz4's framing api * * on ubuntu, first install: * sudo apt i...
Python
UTF-8
618
4.53125
5
[]
no_license
import random heads = 0 tails = 0 count = 0 # Initializes heads, tails and count at zero. while count < 100: coin = random.randint(1, 2) if coin == 1: print("Heads!\n") heads += 1 count +=1 # While the program hasn't reached 100, assign a random integer to COIN # If coin is e...
Markdown
UTF-8
2,169
3.53125
4
[]
no_license
# 1. Introduction ## What is React As per their [website](https://reactjs.org/) react is "A library for building user interfaces". If we dig into that statment a little deeper we can say that React allows you to build complex user interfaces from smaller isolated pieces of code called "components". These small piece...
Java
UTF-8
2,265
2.640625
3
[]
no_license
package com.mcmo.z.commonlibrary.permisson; import java.util.ArrayList; public class PermissionProcess { protected String[] permissions; protected PermissionCallback cb; private String[] grantedPermissions;//已授权 private String[] deniedPermissions;//未授权 private String[] donotAskAgainPermissions;//...
Java
UTF-8
1,196
3.53125
4
[]
no_license
package be.intecbrussel.eatables; public class Magnum implements Eatable { private MagnumType type; //create constructors public Magnum() { } public Magnum(MagnumType type) { this.type = type; } //implement eat method for magni. prints the type you picked. @Override pub...
JavaScript
UTF-8
400
3.03125
3
[]
no_license
// Extended goodie 'class' Cell = function (game, x, y, cellx, celly) { Phaser.Sprite.call(this, game, x, y, 'mazewall0'); this.cellx = cellx; this.celly = celly; this.exits = {north: true, east: true, south: true, west: true}; }; Cell.prototype = Object.create(Phaser.Sprite.prototype); C...
Java
UTF-8
3,933
2.15625
2
[ "MIT" ]
permissive
package com.example.testmvpapp.sections.main.personal; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.La...
Markdown
UTF-8
1,461
3.15625
3
[ "MIT" ]
permissive
# nunjucks-markdown A nunjuck extension that adds a markdown tag ## Install ``` bash npm install marked --save ``` ## Usage Register the extension with nunjucks ``` js var nunjucks = require('nunjucks'), markdown = require('nunjucks-markdown'); var env = nunjucks.configure('views'); markdown.register(env); ...
Swift
UTF-8
2,254
2.5625
3
[]
no_license
// // DetailTableViewController.swift // PizzaMe // // Copyright © 2016 Charles Schwab & Co., Inc. All rights reserved. // import UIKit class DetailTableViewController: UITableViewController { private var viewModel: DetailViewModel? func configureView() { self.title = viewModel?.title } ...
JavaScript
UTF-8
1,476
2.6875
3
[]
no_license
import React from 'react'; import { connect } from 'react-redux'; import { opToExpression, num1ToExpression, num2ToExpression } from '../actions/currentExpression'; import { addHistoryItem } from '../actions/history'; const numbers1 = [0, 1, 2, 3, 4]; const numbers2 = [5, 6, 7, 8, 9]; const operations = ['-', '+', '÷'...
Markdown
UTF-8
3,523
2.765625
3
[ "MIT" ]
permissive
--- layout: post title: "In Defense of: Indiana Jones and the Kingdom of the Crystal Skull" excerpt: "Pop Culture" categories: popculture comments: false share: true --- ![](http://cdn-static.denofgeek.com/sites/denofgeek/files/styles/main_wide/public/indiana_jones_and_the_kingdom_of_the_crystal_skull_poster.jpg?itok=...
C++
UTF-8
3,637
2.578125
3
[ "BSD-3-Clause", "LicenseRef-scancode-public-domain" ]
permissive
#include "UnitTest/UnitTest.h" #include <rengine/file/File.h> #include <algorithm> using namespace std; using namespace rengine; std::string const test_filename("unit_test_data/xml_test.xml"); std::string const test_filename_unix(test_filename); std::string const test_filename_windows("unit_test_data\\xml_test.xml"...
Java
UTF-8
242
2.09375
2
[]
no_license
package runners; import goalBasedProblems.models.State; import java.util.ArrayList; /** * Created by emran on 11/10/16. */ public interface StateFoundListener extends SolveFinishedListener { void pathFound(ArrayList<State> path); }
C
UTF-8
3,588
3.75
4
[]
no_license
/* Worst Fit Joshua Joseph 11/22/2015 */ #include <stdio.h> #include <time.h> //worst fit void worstFit(int numProcesses,int memSlot[10],int process[10],int numMemSlots) { int i, j, k, fit, unallocated=0; clock_t begin, end; double execTime; // Make a copy of the original memory slots int origMemo...
JavaScript
UTF-8
722
2.59375
3
[]
no_license
$(document).ready(function(){ //只执行一次,完美解决重复调用AJAX问题 $("#get-k8s-ns").one("click",function () { $.ajax({ async: true, type:'get', url:'/api/k8s/namespaces' , dataType:'json', success:function (data){ var thishtml = '' ...
Shell
UTF-8
537
3.390625
3
[]
no_license
#!/bin/sh #!/bin/sh ping_rst=0; ping_site=192.168.157.186 ping_detect() { ping_act=`ping -c 1 $ping_site | grep "1 packets received"` if [ "$ping_act" ]; then ping_rst=1 else ping_rst=0 fi } echo "" echo "" echo "" echo "######### Start to boot Pico ########" echo "" echo "" echo "" gpio_task -b #while...
C++
UTF-8
602
2.90625
3
[]
no_license
#include <iostream> #include <vector> using namespace std; int main() { int H, W; cin >> H >> W; vector<vector<int>> A(H, vector<int>(W)); for (int h = 0; h < H; h++) { for (int w = 0; w < W; w++) cin >> A[h][w]; } int min_a = 999; for (int i = 0; i < H; i++) { for (int j = ...
Java
GB18030
185
2.9375
3
[ "MIT" ]
permissive
package day03; //ѧ public class Student { String name; int age; public void study(String course){ System.out.println(name+"ѧϰ"+course); } }
JavaScript
UTF-8
307
2.640625
3
[]
no_license
function roundTo(number, roundToValue) { roundToValue = roundToValue || 1; roundToValue = 1 / roundToValue; return Math.round(number * roundToValue) / roundToValue; } function roundCurrency(value) { return roundTo(value + 0.0001, 0.01); } export default { roundTo, roundCurrency };
C#
UTF-8
946
3.15625
3
[]
no_license
using System.Collections.Generic; namespace Chess.Pieces { class Knight: ChessPieceRaw { public override string GetIcon() { return GetIconPrefix() + "knight.png"; } public override IEnumerable<GridCell> PossibleMoves() { for (int i = 0; i <= 1; ...
Java
UTF-8
7,262
1.945313
2
[]
no_license
package com.facebook.appevents.internal; import android.app.Application; import android.content.Context; import android.os.Bundle; import android.support.annotation.Nullable; import android.util.Log; import com.android.billingclient.api.BillingClient; import com.facebook.FacebookSdk; import com.facebook.appevents.AppE...
Go
UTF-8
1,256
3.03125
3
[]
no_license
package discrete import ( "math" "code.google.com/p/liblundis/lmath/util/cont" ) func Max(values []float64) (max float64, index int) { max = values[0] index = 0 for i, v := range values { if v > max { max = v index = i } } return max, index } func ...
JavaScript
UTF-8
587
3.046875
3
[]
no_license
export function sym(...arg) { const arrArgs = arg; function compareArrays(arr1, arr2) { const arr1red = arr1.reduce(function(collect, current) { if (!arr2.includes(current) && !collect.includes(current)) { collect.push(current); } return collect; }, []); const arr2red = arr2....
Python
UTF-8
186
3.171875
3
[]
no_license
numbers = sorted(map(int, open("numbers.txt").read().split(","))) for i in range(len(numbers)): if int(numbers[i]) != i+1: print("number missing: %d" % (i+1)) break
JavaScript
UTF-8
3,964
2.65625
3
[]
no_license
define(['instructionrow', 'valorregister', 'mapper'], function(InstructionRow, ValOrRegister, Mapper) { var InstructionRowEntry = function(parent, instructionset, registers) { this.instructionset = instructionset; this.parent = parent; this.registers = registers; }; InstructionRowE...
Java
UTF-8
24,312
2.09375
2
[]
no_license
package com.lwm.guesssong.ui; import android.app.Activity; import android.graphics.Color; import android.os.Bundle; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.view.animati...
Go
UTF-8
5,122
2.609375
3
[]
no_license
package nqubits import ( "github.com/waman/qwave/system" "github.com/waman/qwave/system/nqubits/nbasis" "github.com/waman/qwave/system/nqubits/nket" "github.com/waman/qwave/system/nqubits/nop" "github.com/waman/qwave/system/qubit" "github.com/waman/qwave/system/qubit/basis" "github.com/waman/qwave/system/qubit/...
C++
UTF-8
2,623
2.609375
3
[]
no_license
#include "Adafruit_Sensor.h" #include "Adafruit_LSM9DS0.h" #include "Adafruit_Simple_AHRS.h" #include "debug.h" #include <SC_PlugIn.h> #include <thread> // written with reference to the chapter "Writing Unit Generator Plug-ins" in The SuperCollider Book // and also http://doc.sccode.org/Guides/WritingUGens.html a...
C++
UTF-8
9,126
3.46875
3
[]
no_license
/* File: main Author: Joseph Camacho Created on December 12, 2016 Purpose: Project 2 */ //System Libraries #include <iostream> //Input/Output objects #include <cstdlib> //Random #include <ctime> //Time #include <string> //String using namespace std; //Name-space used in the ...
C#
UTF-8
1,436
2.765625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Xml.Serialization; using System.Reflection; namespace Carnival.DBL { [Serializable] public class ReadWriteFile { public static List<T> Read<T>() { ...
Java
UTF-8
441
1.914063
2
[]
no_license
package vladyslav.shuhai.psyhology.repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import vladyslav.shuhai.psyhology.entity.Admin; import vladyslav.shuhai.psyhology.entity.User; import java.util.Optional; public interface UserRepository exte...
Markdown
UTF-8
2,770
4.0625
4
[ "Apache-2.0" ]
permissive
# 3.1.1. Numbers The interpreter acts as a simple calculator: you can type an expression at it and it will write the value. Expression syntax is straightforward: the operators +, -, * and / work just like in most other languages (for example, Pascal or C); parentheses (()) can be used for grouping. For example: >>> >...
C#
UTF-8
612
2.546875
3
[]
no_license
using UnityEngine; using UnityEngine.UI; public class Score : MonoBehaviour { public Transform player; public Text scoreText; public double answer; public Transform groundCheck; public float groundDistance = 0.4f; public LayerMask groundMask; bool isGrounded; // Update i...
Rust
UTF-8
10,146
2.828125
3
[ "Apache-2.0", "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
///Description, creation and opening of the shared memory structure used ///to communicate between the server and the app to profile. Note that ///I should have used MaybeUninit everywhere here, but I got really lazy... use std::sync::atomic::{AtomicBool, Ordering, spin_loop_hint}; use std::thread::yield_now; use std:...
PHP
UTF-8
1,796
3.046875
3
[]
no_license
<?php session_start(); //session_destroy(); mysql_connect('localhost', 'dig4530c_group04', 'dig4530cgroup04') or die (mysql_error()); mysql_select_db('dig4530c_group04') or die (mysql_error()); //If "ADD" is clicked if(isset($_GET['add'])){ //Must prevent the user from adding more than we have in stock. //To pr...
C++
UTF-8
2,998
3.625
4
[]
no_license
#include <iostream> using namespace std; const char KEY_SAVE = 's'; const char KEY_PAY = 'p'; const char KEY_LIST = 'd'; const char KEY_QUIT = 'q'; class eCash { private: int Money; string ID; public: eCash(); void login(string); void logout(); void store(int m); void pay(int m); void...
Python
UTF-8
2,419
3.40625
3
[ "Unlicense" ]
permissive
# -*- coding: utf-8 -*- """ Package: venn Module: draw This package provides functions for computing all sections of Venn diagrams. Functionality for drawing the diagrams in SVG format is also provided. Input can be sets or lists. The length of the input, i.e., the number of individual sets/lists is arbitrary. Howeve...
Python
UTF-8
300
2.953125
3
[]
no_license
import random import sys number_of_input_entries = int(sys.argv[1]) max_number = int(sys.argv[2]) file_name = sys.argv[3] inputFile = open(file_name, 'w') for i in range(number_of_input_entries): inputFile.write(str(random.randint(0, max_number))+"\n") inputFile.close()
Java
UTF-8
9,048
2.953125
3
[]
no_license
package controller; import java.awt.EventQueue; import java.util.EnumMap; import java.util.Map; import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import marker.BreadCrumbs; import marker.ForwardGeodesic; import marker.Marker...
C++
UTF-8
3,144
2.53125
3
[]
no_license
#ifndef DATAEXTRACTOR_H #define DATAEXTRACTOR_H #include <QWidget> #include <QObject> #include <QNetworkAccessManager> #include <QNetworkRequest> #include <QNetworkReply> #include <QWebPage> //////////////////////////////////////////////////////////// // Class representing extractor which extract...
C
UTF-8
792
3.15625
3
[ "MIT" ]
permissive
#include <stdio.h> #include <limits.h> /** read a line from stdin **/ char * gets(char *s) { /* RETURN_SUCCESS(ARGUMENT(s)); RETURN_FAILURE(CONSTANT(NULL)); */ return fgets(s, INT_MAX, stdin); } /*** does no bounds checking, is marked obsolete in ISO/IEC 9899:1999, and has been removed from ISO/IEC 9899:2011. I...
Ruby
UTF-8
3,334
2.828125
3
[ "MIT" ]
permissive
module Scribble class Method def initialize receiver, call, context @receiver, @call, @context = receiver, call, context end class << self attr_reader :method_name, :receiver_class, :signature # Setup instance variables def setup receiver_class, method_name, signature ra...
Markdown
UTF-8
2,554
2.59375
3
[]
no_license
--- title: 返校-Detention catalog: true author: DK header-img: /img/home-bg.jpg date: 2018-08-27 20:28:35 tags: - Game --- ##### 序章 魏仲延视角: 游戏开篇是课堂上老师讲课,后来有个叫白国峰的向殷老师询问是否见过一张书单。 主角在课堂睡着了,醒来发现教室空无一人,黑板上写着“台风警报,请同学尽速返家” 通过主角反应,我们知道这个季节有台风是件不寻常的事。 主角后桌上有张纸条,是询问殷老师请假事宜,收录在周记本里 主角教室在2楼 左边第一间教室窗台拾取一张纸条:大榕树下的速写, 主角所在班级:二年仁...
Java
UTF-8
3,664
2.671875
3
[ "Apache-2.0" ]
permissive
package org.apache.ojb.broker.prevayler.demo; /* Copyright 2003-2005 The Apache Software 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.or...
Python
UTF-8
82
2.734375
3
[]
no_license
''' One way to do it - one liner ''' def mySqrt(self, x): return int(x**0.5)
C#
UTF-8
8,046
2.828125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Schema; namespace Revit.IFC.Common.Utility { /// <summary> /// A Class that represent a node in the Ifc schema entity tree /// </summary> public class IfcSchemaEntityNode ...
Java
UTF-8
619
2.921875
3
[]
no_license
package spring_framework.wideskills_com.lesson_08.xml; public class MessageBean { private String message; public MessageBean() { System.out.println("Constructor of bean is called !! "); } public void init() throws Exception { System.out.println("custom custom init method of bean i...
C#
UTF-8
1,600
2.8125
3
[]
no_license
#region using System; using System.Diagnostics; using System.IO; using SQLite; #endregion namespace ProcessDashboard.DBWrapper { public class DbManager { private const string DbName = "pdash.db3"; private static DbManager _instance; private static SQLiteConnection _db; public ...
Java
UTF-8
5,285
2.1875
2
[]
no_license
package com.kasun.userapp.inventory.controller; import java.util.ArrayList; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; impor...
Markdown
UTF-8
385
2.53125
3
[]
no_license
# Fitness-Tracker # Description This is an application that allows a user to log and keep track of various exercises during a workout. This application uses MongoDB, Mongoose.js and Express.js. [Fitness Tracker](https://calm-basin-11411.herokuapp.com/) ![Portfolio Site](images/screenshot1.png) ![Portfolio Site](imag...
JavaScript
UTF-8
1,232
2.609375
3
[ "Apache-2.0" ]
permissive
'use strict'; import { VertexObjectDescriptor } from '../core'; class SpriteFactory { constructor ( parentFactory = null ) { this.registry = new Map; this.parentFactory = parentFactory; } createDescriptor (name, ...args) { if (this.getDescriptor(name)) { throw new ...
Markdown
UTF-8
694
2.78125
3
[]
no_license
# penguin Repo for a tutorial on setting up c++ project with cmake and ninja Requirements: CMake : https://cmake.org/ Ninja : https://ninja-build.org/ #### Steps to build the project: 1. Install **cmake ** 1. On Mac OS, `brew install cmake` 2. Install the **ninja** build system 1. On Mac OS, `brew install ninj...
Markdown
UTF-8
3,548
3.078125
3
[]
no_license
--- layout: post title: "[Python] python으로 이미지 다루기 예제" headline: Python15 modified: 2017-04-06 categories: Python_for_Everyone Elmo Python comments: true featured: true --- # 1 냥냥이 그림 클래스 속 sum함수와 그냥 sum함수 ``` python from skimage import novice,data class MyPic(): def __init__(self,filename): self.pic = n...
Java
UTF-8
597
3.28125
3
[]
no_license
package WildFarm.animals; import WildFarm.foods.Food; import WildFarm.foods.Vegetable; public class Tiger extends Felime { public Tiger(String name, String type, double weight, String livingRegion) { super(name, type, weight, livingRegion); } @Override public void eat(Food food) { if ...
Java
UTF-8
281
1.726563
2
[]
no_license
package com.example.iga.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; @Controller public class PagesController { @GetMapping(value="/") public String homepage(){ return "test"; } }
Python
GB18030
1,919
2.890625
3
[]
no_license
''' @author: fightingliu ''' import copy, numpy as np from conv import mini_batch_size from numpy import random from astropy.units import nb class Network(object): def __init__(self, sizes): self.num_layers = len(sizes) self.sizes = sizes self.biases = [np.random.randn(y, 1) for y in size...
Python
UTF-8
1,892
2.890625
3
[]
no_license
#!/usr/bin/env python3 class CheckArgs(): #class that checks arguments and ultimately returns a validated set of arguments to the main program def __init__(self): import argparse import os parser = argparse.ArgumentParser() parser.add_argument("-f", "--variantPickleFile", help...
Java
UTF-8
4,731
2.53125
3
[]
no_license
package com.androidexample.chenn.androidclient.msgservice; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.util.Log; import org.w3c.dom.Document; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import java.io.IOException; import java.io.InputStream; imp...
Java
UTF-8
304
1.640625
2
[]
no_license
package ru.innovat.models.utils; import lombok.*; @Builder @AllArgsConstructor @NoArgsConstructor @Getter public class Connect { private int event_Id; private int project_Id; private int organization_Id; private int typeEvent_id; private int person_id; private int role_id; }
Markdown
UTF-8
1,315
3.0625
3
[ "Apache-2.0" ]
permissive
--- layout: default title: xls2xlsx(xlsFile,xlsxFile) parent: excel tags: command excel xls xlsx comments: true --- ### Description This command converts an Excel file in XLS format (pre-2007 format) to the XLSX format (2007 and after). The target can either be a fully qualified file name or a directory where the con...
Python
UTF-8
8,750
2.71875
3
[]
no_license
from filter import Filter from GeoMetDemo import dumps as dumpWKT from shapely import wkt import numpy as np import copy from setting import INTERSECT_AREA_PARTION class Cover: """ 指定空间范围、时间范围和分辨率范围的最优影像覆盖分析 """ items = [] def __init__(self, itemList): self.items = itemList def _round_...
JavaScript
UTF-8
2,764
2.515625
3
[ "MIT" ]
permissive
import React from "react"; import { Text, View, Button, ImageBackground} from 'react-native'; import styles from "../screens/styles/manage.js"; function changeState(i,ref) { if(i == 1) { if(ref.state.x1 === 0)ref.setState({x1: 1}); else ref.setState({x1: 0}); if(ref.state.y1 === 0)ref.setState({y1: 1})...
Python
UTF-8
3,211
3.1875
3
[]
no_license
#!/usr/bin/env python # don't forget to "conda activate bgmp_py3" on the command line import re import matplotlib.pyplot as plt FILE = "/home/afo/bgmp/Bi621/PS6/KMER49/contigs_49_cov_cutoff_500.fa" KMER_LEN = 49 # mean depth coverage for contigs, must solve for C # Ck = C * (L - K + 1) / L (original equation) # Ck ...
Python
UTF-8
2,367
3.609375
4
[]
no_license
# -*- encoding: utf-8 -*- # Return all such possible sentences. # # For example, given # s = "catsanddog", # dict = ["cat", "cats", "and", "sand", "dog"]. # # A solution is ["cats and dog", "cat sand dog"]. # 递归:超时 class Solution(object): def wordBreak(self, s, wordDict): # edge case if len(s) == 0 ...
C++
UTF-8
677
2.65625
3
[]
no_license
/******************************************************************************/ /*! \file singletontemplate.h \author Lee Sek Heng \par email: 150629Z@mymail.nyp.edu.sg \brief A template for all classes that needs to be a singleton */ /*********************************************************...
C++
UTF-8
690
2.671875
3
[]
no_license
#ifndef HEADER_BINARYKEYPAD #define HEADER_BINARYKEYPAD #include "Header.h" class BinaryKeypad { public: BinaryKeypad(); ~BinaryKeypad(); // Mutators void SetKeyValue(); // Calculates the value of the key pressed void PauseUntilButtonPressed(); // Pauses until a button is presse...
Java
UTF-8
5,380
2.5625
3
[]
no_license
package com.zd.book.ui; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Label; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Timer; import java.util.TimerTask; import org.ec...
Rust
UTF-8
1,875
2.515625
3
[ "MIT" ]
permissive
use std::net; use std::path::PathBuf; use argh::FromArgs; use nakamoto_client::Network; use nakamoto_node::{logger, Domain}; #[derive(FromArgs)] /// A Bitcoin light client. pub struct Options { /// connect to the specified peers only #[argh(option)] pub connect: Vec<net::SocketAddr>, /// listen on o...
C#
UTF-8
1,861
2.703125
3
[ "MIT" ]
permissive
using AutoMapper; using ECommerce.Domain.Entities; using ECommerce.Domain.Repositories; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; namespace Ecommerce.Application.Categories { public class CategoryService : ICa...
Python
UTF-8
422
2.796875
3
[]
no_license
import re from ..utils import format_next entrance_regex = r"^G(\d):(\d+)-(\d+);([CRS]\d+)$" def is_entrance(str): return re.search(entrance_regex, str) def generate_entrance(raw): groups = re.search(entrance_regex, raw).groups() return { "type": "entrance", "id": int(groups[0]), ...
Python
UTF-8
1,170
2.71875
3
[]
no_license
import requests import os import time os.system('clear') print('\033[01;35mSeja Bem Vindo Consulta IP By:OdinModder ϟ') print('\033[01;36m=========================================') ip = input('\033[01;34m>>> ') r = requests.get('http://ip-api.com/json/{}'.format(ip));data = r.json( ) print('\033[01;33mConsulta Reali...
C++
UTF-8
5,185
2.59375
3
[]
no_license
#include <bits/stdc++.h> using namespace std; long long N, M, Q, grid[1010][1010]; long long sums[1010][1010]; int find(int x, int y) { if (x <= N && y <= M) return grid[x - 1][y - 1]; long long p = N, q = M; while (p * 2 < x || q * 2 < y) p *= 2, q *= 2; if (p < x && q < y) return fin...
Markdown
UTF-8
1,437
2.9375
3
[]
no_license
# Article 3 Les épreuves écrites d'admissibilité sont les suivantes : 1° Une composition portant sur un sujet d'ordre général relatif aux problèmes politiques, économiques, culturels et sociaux du monde contemporain permettant de vérifier les qualités de rédaction, d'analyse et de réflexion du candidat (durée : quatr...
Java
UTF-8
1,074
3.0625
3
[]
no_license
/* * Copyright 2020. Androsaces. All rights reserved. */ package com.androsaces.javaessentials.issue252; import java.time.LocalDate; import java.util.Comparator; import java.util.Objects; import java.util.Spliterator; import java.util.function.Consumer; public class YearSpliterator implements Spliterator<LocalDate...
TypeScript
UTF-8
442
3.5
4
[]
no_license
/** * @param {string} str * @param {number} precision * @returns {string} trimmed string * @example trimStringDecimals("0.12345", 2); // "0.12" */ export const trimStringDecimals = (str: string, precision: number) => { if (!str || !str.includes(".")) { return str; } const [integer, decimals] = str.split(...
JavaScript
UTF-8
3,556
2.546875
3
[ "MIT" ]
permissive
const mongoose = require('mongoose'); const Schema = mongoose.Schema; const UserModel = require('./UserModel') const validateShortName = require('../lib/validateShortName') function toLower(v) { return v.toLowerCase().split(' ').join(''); } const MenuSchema = new Schema({ propietario: { type: Schema.Types.Ob...
Java
UTF-8
1,305
2.359375
2
[]
no_license
package dream.orientation.model; import javax.persistence.Entity; import java.io.Serializable; import javax.persistence.Id; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Column; import javax.persistence.Version; import java.lang.Override; import dream.or...
Java
UTF-8
1,057
2.28125
2
[ "Apache-2.0" ]
permissive
package sample.weather; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.Rest...
Ruby
UTF-8
1,738
2.609375
3
[]
no_license
class Customer attr_reader :id, :first_name, :last_name, :created_at, :updated_at, :customer_repository, :fields def initialize(input_data, customer_repository) @id = input_data[0].to_i @first_name = input_data[1] @last_name = input_data[2] @created_at = input_data[3] @updated_at = input_data...
Java
UTF-8
883
1.898438
2
[]
no_license
package com.digihealth.sysMng.service; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.digihealth.common.formbean.SystemSearchFormBean; import com.digihealth.sysMng.dao.BasUserDao; import com.digihealth.sysMng.entity.BasU...
Java
UTF-8
256
1.578125
2
[]
no_license
package com.serdariince.hrms.dataAccess.abstracts; import org.springframework.data.jpa.repository.JpaRepository; import com.serdariince.hrms.entities.conretes.SystemAdmin; public interface SystemAdminDao extends JpaRepository<SystemAdmin, Integer> { }
Java
UTF-8
2,908
2.546875
3
[]
no_license
package com.xt.servlet; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.servlet.ServletFileUpload; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; ...
Java
UTF-8
2,106
2.71875
3
[]
no_license
package org.serverwizard.reactor; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; import java.util.Objects; class TransformTest { @DisplayName("Mono에서 map operator 사용법을 확인한다.") ...
C
UTF-8
578
2.921875
3
[]
no_license
void merge(int* nums1, int nums1Size, int m, int* nums2, int nums2Size, int n) { int numIndex1 = m - 1; int numIndex2 = n - 1; int tmp = m + n - 1; while (numIndex1 >= 0 && numIndex2 >= 0) { if (nums1[numIndex1] >= nums2[numIndex2]) { nums1[tmp] = nums1[numIndex1]; tmp--;...
C#
UTF-8
578
2.5625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace tehtävä04 { class Program { static void Main(string[] args) { Vehicle vehicle = new Vehicle(); // uusi ajoneuvo // ajoneuvon tiedot kirjataan t...
Python
UTF-8
137
3.859375
4
[ "MIT" ]
permissive
def fibonacci(num): return num if num <= 1 else fibonacci(num - 1) + fibonacci(num - 2) for i in range(10): print(fibonacci(i))
Python
UTF-8
876
3.375
3
[]
no_license
import sys input = sys.stdin.readline n, m = map(int, input().split()) INF = int(1e9) # 모든 vertex 쌍의 v1 -> v2 최단경로 담는 array distance = [[INF]*(n+1) for _ in range(n+1)] for i in range(1, n+1): distance[i][i] = 0 # append edges for _ in range(m): a, b = map(int,input().split()) distance[a][b] = 1 ...
C
UTF-8
1,704
3.78125
4
[]
no_license
#include "vectores.h" //// FUNCIONES PARA TRABAJAR CON VECTORES ////////////////////////////////// void imprimir_vector(float **v, size_t filas, size_t columnas){ size_t i, j; for(i=0; i<filas; i++){ for(j=0; j<columnas; j++) printf("% 7f\t", v[i][j]); printf("\n"); } } void destruir_vector(floa...
Python
UTF-8
4,219
3.078125
3
[]
no_license
""" This is a vanilla neural network, written from scratch by me. I adapted this from a series of blog posts on neural networks: http://iamtrask.github.io/2015/07/12/basic-python-network/ You'll notice that this network is a generalization of the one found in the above blog post How to use: Example: num_hidden_no...
Python
UTF-8
806
3.71875
4
[]
no_license
# *args - словарь,*kwargs - список def min(*args, **kwargs): key = kwargs.get("key", None) print(args) return None def max(*args, **kwargs): key = kwargs.get("key", None) print(len(args)) if args[0] is str: print("args is string") else: "no" maximum = args[0] print...
C++
UTF-8
3,518
2.640625
3
[ "MIT" ]
permissive
#include <cstdio> #include <cstring> #include <algorithm> const int maxn = 100001, maxm = 10001; int n, m, q, sqn, a[maxn], b[maxn], pos[maxn]; struct Block { int pre, nxt; int sta, len; bool rev; void access() { if(rev) { int *A = a + sta; std::reverse(A, A + len); rev = 0; } } void sort() { int *...
PHP
UTF-8
4,708
2.921875
3
[]
no_license
<?php class User{ protected $userID; protected $username; protected $email; protected $company; protected $logo; public $db; public function __construct($db){ $this->db=$db; } public function setCompany($company){ $this->company = $company; $_SESSION['company'] = $company; } public function setName($...
C#
UTF-8
1,521
2.984375
3
[]
no_license
using System; using System.Linq; using System.Data.SqlClient; using WpfApp.DAL.DataContext; using WpfApp.DataProtocol; using System.Collections.Generic; namespace WpfApp.DAL { public class UsersService { public IEnumerable<User> Users { get { using (var ...
Java
UTF-8
14,448
1.96875
2
[]
no_license
/* * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version * 2 only, as published by the Free Software ...