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
PHP
UTF-8
2,721
2.953125
3
[]
no_license
<?php /* Database credentials. Assuming you are running MySQL server with default setting (user 'root' with no password) */ /*define('DB_SERVER', 'localhost'); define('DB_USERNAME', 'root'); define('DB_PASSWORD', ''); define('DB_NAME', 'demo');*/ define('DB_SERVER', 'localhost'); define('DB_USERNAME', 'testuser...
Markdown
UTF-8
1,767
3.109375
3
[ "MIT" ]
permissive
# How To Check Your Balance ## Goal Check your token balance. ## Steps The operation can be performed in two ways - using the site `golos.io` and using explorer `cyberway.io`. ### Way 1: Check your balance using the site golos.io #### Step 1.1 Go to the page `https://golos.io/<account name>`. Let the account name i...
C++
UTF-8
2,368
2.875
3
[]
no_license
# include <math.h> # include <stdio.h> # include "glutapp.h" # include "draw.h" void draw_triangle(Vec v1, Vec v2, Vec v3) { glEnable(GL_COLOR_MATERIAL); if(App->wireframe){glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);} else glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glColor3f(1.0, 1.0, 1.0); if(App->smooth) ...
JavaScript
UTF-8
1,945
2.75
3
[ "LicenseRef-scancode-proprietary-license", "MIT" ]
permissive
const fs = require('fs') const path = require('path') const os = require('os') const exec = require('./exec').exec const skipOnWindows = (fn) => { if (os.platform() !== 'win32') { fn() } } describe('exec', () => { it('should be able to create and delete files', async () => { const fileName = 'this-is-a...
C++
UTF-8
11,200
2.640625
3
[]
no_license
#include "SinglePlayer.h" #include <iostream> void SinglePlayer::draw(const sf::Time dt) { //this->game->window.clear(sf::Color::Red); this->game->window.draw(background); for (size_t i = 0; i < playerCards.size(); i++) { playerCards[i].sprite.setPosition(sf::Vector2f(0 + 40 * i, 152)); this->game->window....
Java
UTF-8
10,914
3.03125
3
[]
no_license
/////////////////////////////////////////////////////////////////////////////// // ALL STUDENTS COMPLETE THESE SECTIONS // Title: (PokemonGo.java) // Files: (list of source files) // Semester: (CS 367: Introduction to Data Structures) Fall 2016 // // Author: ...
Markdown
UTF-8
12,944
3.203125
3
[ "Apache-2.0" ]
permissive
# Chained Verifiable Credentials This is an experimental implementation of using Verifiable Credential (VC) for delegation. It uses the following information and dependencies: * [Chained Credentials](https://github.com/hyperledger/aries-rfcs/tree/master/concepts/0104-chained-credentials) * [Indirect Control](https://gi...
C#
UTF-8
776
3
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Text; namespace Hotel { public class Room { public Hotel hotel; public int roomNumber; public bool tv; public string roomType; public int numberOfBeds; public bool balcony; public int roomID; ...
Go
UTF-8
918
2.671875
3
[ "MIT" ]
permissive
package resolvers import ( "context" "fmt" "github.com/GibJob-ai/GObjob/handler" "github.com/GibJob-ai/GObjob/model" ) // GetUser resolver func (r *Resolvers) GetUser(ctx context.Context) (*UserResponse, error) { userID := ctx.Value(handler.ContextKey("userID")) if userID == nil { return nil, &getUserError{...
Markdown
UTF-8
1,082
2.828125
3
[ "Apache-2.0" ]
permissive
# AI-Utility-Based-Markov-Decision-Process By using of utility approach for path finding in AI, the script prints the optimal states to follow with arrows UP, DOWN, RIGHT or LEFT. WALL is wall (you can type any word less than 10 length instead of |), . is empty space, +1 positive reward and -1 negative reward Map...
JavaScript
UTF-8
224
2.671875
3
[]
no_license
const name = "Ernest Nnamdi" const hng_id = "HNG-03858" const email = "ernestnamdi66@gmail.com" const language = "javascript" console.log("Hello world, this is " + name + " with HNGi7 ID " + hng_id + " using " + language + " for stage 2 task");
C#
UTF-8
6,287
2.71875
3
[ "MIT" ]
permissive
using System; using WpdMtpLib.DeviceProperty; namespace WpdMtpLib { public class DevicePropDesc { public MtpDevicePropCode DevicePropCode { get; private set; } public DataType DataType { get; private set; } public byte GetSet { get; private set; } public dynamic FactoryDefaultV...
Java
UTF-8
1,795
2.09375
2
[ "MIT" ]
permissive
package com.sensorberg.sdk.receivers; import com.sensorberg.sdk.Logger; import com.sensorberg.sdk.SensorbergService; import android.content.Context; import android.content.Intent; import android.os.Bundle; import static com.sensorberg.SensorbergSdk.blocked; public class GenericBroadcastReceiver extends SensorbergBr...
JavaScript
UTF-8
263
3.15625
3
[ "MIT" ]
permissive
function Calc () {} /** * Agora adicionamos a nossa Calculadora uma * função de Soma. * * Ela irá receber dois parâmetros (a, b) e * então retornar a soma dos mesmos. */ Calc.prototype.soma = function(a, b) { return a + b; }; module.exports = Calc;
Python
UTF-8
1,726
4
4
[]
no_license
""" We must split nums into k groups. Every group has at least one element, and it is made by adjacent elements. If we have to create at most k groups. let best_avg[index][k] a matrix containing the best average of k groups of nums[i: ]. The answer of the problem is best_avg[0][k]. Base case: k = 1, the answer is the a...
C#
UTF-8
589
2.984375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ClassLibrary1 { public class VeblenGood : Product { public VeblenGood() { } public VeblenGood(string id, string name, double costPrice):base(id, name, ...
Java
UTF-8
506
1.703125
2
[]
no_license
package oicq.wlogin_sdk.tlv_type; public class tlv_tc extends tlv_t { public tlv_tc() { this._cmd = 12; } public void get_tlv_tc(byte[] paramArrayOfByte, int paramInt) { set_buf(paramArrayOfByte, paramInt); } public Boolean verify() { if (this._body_len < 14) return Boolean.valueOf(...
C++
UTF-8
1,400
2.71875
3
[]
no_license
#ifndef TIMERFD_H #define TIMERFD_H #include <unistd.h> #include <sys/timerfd.h> #include <functional> #include <core/coresynchronize.h> class TimerFD : public iot::core::Synchronizer::Callback { public: typedef std::function<void(void) > VoidCallback; TimerFD() { _timerfd = timerfd_create(CLOCK_...
Ruby
UTF-8
985
3.546875
4
[]
no_license
suma1=0 #suma de los divisores del numero a suma2=0 #suma de los divisores del numero b i=1 d1=1 #divisores de a d2=1 #divisores de b for i in 1...1000000 while d1 <= i/2 #se divide entre dos porque los divisores de un numero "a" no son mayores que de que la mitad de este numero (a) (sin contarse a si mism...
Java
UTF-8
331
1.945313
2
[ "Apache-2.0" ]
permissive
package com.softpian.redditvm.network; import com.softpian.redditvm.model.RedditNewsResponse; import retrofit2.Call; import retrofit2.http.GET; import retrofit2.http.Query; public interface RedditApi { @GET("top.json") Call<RedditNewsResponse> getTopPosts(@Query("after") String after, @Query("limit") String...
Markdown
UTF-8
5,246
2.890625
3
[ "MIT" ]
permissive
# Milestones Package A common practice in MDW workflows is to modularize by designing processes to invoke subprocesses (see the [Invoke Subprocess](https://centurylinkcloud.github.io/mdw/docs/help/InvokeSubProcessActivity.html) and [Invoke Multiple Subprocesses](https://centurylinkcloud.github.io/mdw/docs/help/InvokeMu...
Python
UTF-8
231
3.09375
3
[]
no_license
def root2(n): if n<0: return 'number should be natural.' else: from math import sqrt return round(sqrt(n), 4) def root3(n): return round(-((-n) ** (1/3)), 4) if n < 0 else round(n ** (1/3), 4)
Java
UTF-8
1,357
2.40625
2
[]
no_license
package com.appspot.splitbill.client.widgets.table; import java.util.Arrays; import java.util.Comparator; import java.util.List; import com.google.gwt.user.client.ui.Widget; public abstract class EntryTableModel<E extends Entry<E,C>, C extends Column> extends AbstractTableModel<E> { private E ...
JavaScript
UTF-8
1,023
2.578125
3
[]
no_license
const Engine = Matter.Engine; const World = Matter.world; const Bodies = Matter.World; const Canstraint = Matter.Canstraint; var tanker,ground,shootingball,bubble; var world,engine; function setup() { createCanvas(400,400) engine = Engine.create(); world = engine.world; ground = new Gr...
PHP
UTF-8
2,415
2.65625
3
[]
no_license
<?php // Query filters and template includes at bottom of page /** * Create new CPT - Events */ class Gallery_CPT extends CPT_Core { /** * Register Custom Post Types. See documentation in CPT_Core, and in wp-includes/post.php */ public function __construct() { $this->post_type = 'gallery'...
PHP
UTF-8
810
3.375
3
[]
no_license
<html> <head> <title>Sum of digits</title> </head> <body> <form action="" method="post"> <label for="input">Input string:</label> <input type="text" name="input" id="input"/> <input type="submit" value="Submit"/> </form> </body> </ht...
Java
UTF-8
1,084
2.234375
2
[]
no_license
package com.example.myapplication.Network; import com.example.myapplication.Models.MovieTrailerModel; import com.example.myapplication.Models.MoviesModel; import com.example.myapplication.Models.ReviewModel; import retrofit2.Call; import retrofit2.http.GET; import retrofit2.http.Path; import retrofit2.http.Query; pu...
Python
UTF-8
1,933
2.609375
3
[]
no_license
#!/usr/bin/env python import sys, argparse, tempfile, subprocess, shutil, os, string, errno class Git( object ): def __init__( self, repository, path=None ): self._repository = repository self._path = path or tempfile.mkdtemp( '_nav_git' ) def __enter__( self ): p = subprocess.call([ '...
Markdown
UTF-8
1,065
3.15625
3
[]
no_license
# resource_scheduling The INPUTS for the model are: • Employee ID • Start Date • End Date • Project • Shift 1. Morning 2. Evening 3. Night Constraints • Not more than 40 hours worked per day. • If worker work that morning, cannot work that day. • If worker working that evening, until next evening. • If worker worki...
Python
UTF-8
1,338
3.859375
4
[]
no_license
"""https://www.codewars.com/kata/spelling-bee/train/python""" """v2 - Using cool short rotate logic""" def how_many_bees(hive): bee_count = 0 if hive: hive_rotated = list(zip(*hive[::-1])) for lst in (hive, hive_rotated): for row in lst: for step in (1, -1): bee_count += ''.join(ro...
C++
UTF-8
1,020
2.859375
3
[]
no_license
#include <iostream> #include <list> #include "../SharedPtr.h" #include <ctime> using namespace std; using namespace ds; // const int maxn = 2000; // template <typename L> // void test() // { // L *l2; // { // clock_t beg = clock(); // L lst; // for (int i = 0; i < maxn; ++i) // lst.push_back(i...
Java
UTF-8
690
1.890625
2
[]
no_license
package xyz.youjieray.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.quartz.SchedulerFactoryBean; /** * created by IntelliJ IDEA * * @author leihz * @date 2017/7/5 16:54 */ @Configuration public class ...
Java
UTF-8
363
1.648438
2
[]
no_license
package com.sda.shop.controllers; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @Controller @RequestMapping("/gameswebgl") public class GamesController { @GetMapping() public String g...
C
UTF-8
631
3.671875
4
[]
no_license
#include<stdio.h> #include<stdlib.h> #define size 10 int binary_search(int *input,int target){ int L = 0; int R = size - 1; while (L <= R){ int M; M = (L + R) / 2; if(input[M]==target){ return M;} else if(input[M]>target) R = M - 1; else ...
Markdown
UTF-8
1,386
2.875
3
[ "Apache-2.0" ]
permissive
Flatdata Usage Examples ======================= This folder contains examples of flatdata usage. Those are meant to show how to use serialization/deserialization APIs and different resource types available. Binary Layout Example --------------------- This example writes a simple not aligned data structure (23 bits l...
Markdown
UTF-8
3,360
2.703125
3
[ "MIT" ]
permissive
# Pilotes macOS pour le nouveau clavier AZERTY normalisé Utilisez votre clavier existant pour tester la nouvelle disposition des symboles. Vous pouvez l’apprendre en vous aidant du clavier virtuel de macOS ou du site <https://norme-azerty.fr>. Une transcription de la norme NF Z 71‐300 A est utilisée pour générer le p...
TypeScript
UTF-8
1,262
2.65625
3
[ "MIT" ]
permissive
import { execSync, StdioOptions } from "child_process"; export const getPRNumber = (msg: string) => { const num = / \(#(?<prNumber>[0-9]+)\)$/m.exec(msg)?.groups?.prNumber; return num ? parseInt(num, 10) : undefined; }; const chunks = <T>(commits: T[]): T[][] => { const batches: T[][] = []; for (let i = 0; i...
C#
UTF-8
19,323
3.0625
3
[]
no_license
/* Program: COIS 3020 Assignment 2 * Author: Ryland Whillans * SN: 0618437 * Date: 2019-03-06 * Purpose: * Implements and tests an InRange function for augmented treap * Implements/Augments and tests treap to support MinGap function and * Implements and tests rope dat...
Markdown
UTF-8
733
2.703125
3
[]
no_license
# Vertis Timesheet ## [View here](https://vertis-time-sheet.herokuapp.com/) ## Stack Used + **Server Framework & Environment**: Express & Node + **Authentication and Authorization**: JSON Web Tokens + **Database**: MongoDb (hosted on [mLab](https://mlab.com/)) + **Frontend Framework**: React ## Other libraries use...
PHP
UTF-8
2,850
3.078125
3
[]
no_license
<?php /** * Landing Page Engine * * @package Gm\LandingPageEngine * @subpackage Form\Validator * @link https://bitbucket.org/sudtanadevteam/landing-page-engine * @copyright Copyright (c) 2016 */ namespace Gm\LandingPageEngine\Form\Validator; class StringLength extends AbstractValidator { const STRING_LENGTH...
Markdown
UTF-8
581
3.046875
3
[ "Apache-2.0" ]
permissive
# Else & Elif Er is ook een `else` clausule die gebruikt wordt telkens dat de eerste conditie niet waar is. Dit is een handig hulpmiddel als je overal op wilt reageren maar een aparte handeling wilt uitvoeren voor één ding: ```python land = 'Engeland' if land == 'England': parapluNodig = True else: parapluNo...
C#
UTF-8
1,979
3.65625
4
[]
no_license
using System; namespace Lemonade_Stand{ public class Weather{ public int weatherNumber; public int currentTemp; public int tempratureNumber; public string currentWeather; public string currentTemprature; public void SetWeather(){ //Generate a number betw...
JavaScript
UTF-8
3,486
2.65625
3
[]
no_license
$(document).ready(function() { $('form.single-task-form div.switch input').change(function(){ var task_id = $(this).parent().parent().data('task-id'); var finished_value = $(this).attr('value'); $.ajax({ type: 'POST', url: '/edit/' + task_id, data: { finished: finished_value }, success: function( ...
Markdown
UTF-8
19,813
2.515625
3
[]
no_license
# Observability demo for Sumo Logic Using Telegraf ![topn](docs/linux-dash-topn.png) ![linuxdash1](docs/linux-dash-1-cpumem.png) <!-- vscode-markdown-toc --> * 1. [Overview](#Overview) * 1.1. [highlights](#highlights) * 2. [Design Considerations](#DesignConsiderations) * 2.1. [collection](#collection) * 2.2. [sumo ...
Java
UTF-8
607
1.570313
2
[ "MIT" ]
permissive
package com.springboot.demo.shiro_redis_token.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.springboot.demo.shiro_redis_token.entity.RolePermission; import com.springboot.demo.shiro_redis_token.mapper.RolePermissionMapper; import com.springboot.demo.shiro_redis_token.serv...
Java
UTF-8
892
2.328125
2
[]
no_license
package com.tideseng.springbootquick._8_starter; import com.tideseng.format.starter.FormatTemplate; import com.tideseng.springbootquick.User; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ConfigurableApplicatio...
Python
UTF-8
729
3.96875
4
[]
no_license
from math import factorial """ Going from the top left vertex to another, counting how many paths exist, I noticed it resembled a Pascal's triangle in the form 1 1 1 1 1 1 1 1 2 3 4 5 6 1 3 6 10 15 1 4 10 20 1 5 15 1 6 1 The bottom right vertex is at the level 2n where n ...
Shell
UTF-8
420
2.984375
3
[ "Unlicense" ]
permissive
#!/usr/bin/env bats RHOST="$(fxy rhost | cut -d' ' -f 4)" @test "fxy ping 1" { # save rhost RHOST="$(fxy rhost | cut -d' ' -f 4)" build/fxy r 127.0.0.1 result="$(build/fxy ping 1)" # restore previous rhost build/fxy r "$RHOST" [[ "$result" =~ "1 packets transmitted" ]] } @test "fx...
JavaScript
UTF-8
1,141
2.84375
3
[]
no_license
var env = process.env.NODE_ENV || 'development'; //Note that these statements are only for local environments : 'development' and 'test' //Heroku environment has PORT and MONGODB_URI set automatically, although we have to provide it with JWT_SECRET through command line //heroku config//heroku config:set JWT_SECRET=erj...
Python
UTF-8
2,546
2.703125
3
[]
no_license
# Standard imports import cv2 import numpy import constants from algos import algo1 low = constants.low_red high = constants.high_red def callback(val): n = cv2.getTrackbarPos('Image', 'Control') img1 = cv2.imread("../output/output" + str(8*n) + ".png") img2 = cv2.imread("../output/output" + str(8*n+1) +...
Python
UTF-8
161
3.140625
3
[]
no_license
def fib(n): if n <= 1: return n return fib(n-1) + fib(n-2) # Returns no. of ways to # reach sth stair def climbStairs(s): return fib(s + 1)
Markdown
UTF-8
817
2.984375
3
[]
no_license
Simple format for new item: * Year, Company or Product Name, Article title, The link to the article If there is a link to Hacker News, please add them at the end * Year, Company or Product Name, Article title, The link to the article, The link to Hacker New post If possible please use the official link/arti...
Markdown
UTF-8
1,791
2.8125
3
[ "LicenseRef-scancode-generic-cla", "MIT" ]
permissive
--- languages: - csharp products: - power-platform - power-apps page_type: sample description: "This sample shows how to perform a bulk deletion of records that were previously exported from Microsoft Dataverse by using the Export to Excel option. [SOAP]" --- # Bulk delete exported records This sample shows how to pe...
JavaScript
UTF-8
6,309
3.359375
3
[]
no_license
function getForecastByID(cityId) { //const cityId = 5604473; const apiKey = "7947d641816320463b620644081ccc3f"; const cityForecastUrl = "https://api.openweathermap.org/data/2.5/weather?units=imperial&id=" + cityId + "&appid=" + apiKey; const cityFiveDayForecastUrl = "https://api.openweathermap.org/data/...
JavaScript
UTF-8
2,184
2.546875
3
[]
no_license
// const initState = { // count:0, // loading:false, // messages:[] // }; const initState = { messages:null, //这个是临时传送的消息 currentChatter:null, unReadCount:0, cacheMessages:{}, //缓存初始信息,用户不用每次加载,大于1000则清空 cacheMessagesCount:{} }; const reducer = (state=initState,action)=>{ switch (a...
Markdown
UTF-8
611
2.90625
3
[]
no_license
##多币种货币实例 测试驱动开发 需要在WyCash系统创建多币种对象,生成多币种报表 单币种 | 股票 | 数量 | 股价 |总计 | | ------ | ------ | ------ | ------ | | IBM | 1000 | 25 | 25000 | | GE | 400 | 100 | 40000 | | | | 总计 | 65000 | 美元、瑞郎 | 股票 | 数量 | 股价 |总计 | | ------ | ------ | ------ | ------ | | IBM | 1000 | 25USD(美元) | 25000 USD(美元)| | Novartis | 400 | 150...
Java
UTF-8
887
3.171875
3
[]
no_license
package cars; import java.util.ArrayList; public class Car { private String brand; private String model; private short year; private ArrayList<Part> parts = new ArrayList<Part>(); public Car(String brand, String model, short year) { setBrand(brand); setModel(model); setYear(year); } ...
Java
UTF-8
4,051
2.875
3
[]
no_license
package edu.wm.cs.cs301.amazebytheochambers.gui; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.SeekBar; import a...
TypeScript
UTF-8
742
2.90625
3
[]
no_license
// declare var $: any import { PI, add } from './math'; import axios from 'axios'; console.log(PI); let sum:number = add(12, 24); console.log(sum); type ServerOutput = { exchange: string, value: number }; $().ready(() => { $('#sensexbutton').on("click", () => { axios .get<ServerOutput>("/sens...
Python
UTF-8
489
3.984375
4
[ "MIT" ]
permissive
import random x = random.randint(0, 2) # Version 1: # 1. Player one input: rock | paper | scissors # 2. Player two input: rock | paper | scissors # rock vs paper: paper # scissors vs rock: rock # scissors vs paper: paper # Who is the winner? Player 1 or Player 2 Version 2: rock Play against the computer Enter ...
Java
UTF-8
1,127
2.453125
2
[]
no_license
/** * <pre> * 1. 패키지명 : config.security3_1 * 2. 타입명 : MUser.java * 3. 작성일 : 2017. 12. 16. 오후 7:39:42 * 4. 저자 : 최준호 * * </pre> * */ package config.security_sample_3_1; import java.util.Collection; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.User; pu...
C++
UTF-8
2,142
2.703125
3
[]
no_license
//#include <opencv2/core.hpp> //#include <opencv2/imgcodecs.hpp> //#include <opencv2/highgui.hpp> #include "opencv2/opencv.hpp" #include <iostream> #include <string> using namespace cv; using namespace std; int main(int argc, char** argv) { //Windows Environment, OPENCV_OPENCL_DEVICE="Intel:GPU:0" ...
Swift
UTF-8
307
2.65625
3
[]
no_license
// // Books.swift // BooksApp // // Created by 市村健太 on 2018/06/01. // Copyright © 2018年 GeekSalon. All rights reserved. // import UIKit struct Book { var title: String var imagePath: String? var author: String? init(title: String) { self.title = title } }
Markdown
UTF-8
1,669
3.25
3
[]
no_license
# liri-node-app (LIRI Bot) ### Overview LIRI Bot is a command line application using Node.js and several modules installed using NPM. [![Liri Bot](http://img.youtube.com/vi/k4QeRQAnSho/0.jpg)](https://www.youtube.com/watch?v=k4QeRQAnSho) 1. LIRI was created to perform searches: Bands in Town for concerts, and OMDB ...
Python
UTF-8
2,066
3.9375
4
[]
no_license
# !/usr/bin/python # -*- coding: utf-8 -*- # author : Tao Qitian # email : taoqt@mail2.sysu.edu.cn # datetime : 2021/3/22 23:19 # filename : solution.py # description : LC 300 最长递增子序列 class Solution: def lengthOfLIS(self, nums: List[int]) -> int: """ 动态规划 """ n = len(nums) ...
PHP
UTF-8
401
2.53125
3
[]
no_license
<?php namespace user; include_once('user/Authentication.php'); include_once('user/User.php'); $auth = new Authentication(); $auth->prepare($_POST); $userexits = $auth->isUserExisted(); if (!$userexits){ $user = new \user\User(); $user->prepare($_POST); $user->insertNewUserIntoDB(); }else{ $json['suc...
Python
UTF-8
5,516
2.578125
3
[]
no_license
''' # Author: Tamara Ouspenskaia # Date: 01/14/2020 # Objective: This script calculates the sequencing coverage at variant sites ''' # This script requires: <br> # - a BAM file of aligned reads # - the .annot file generated by the variant_to_protein.sh script # - the analysis.tab file generated by the variant_analysi...
Java
UTF-8
4,116
2.015625
2
[]
no_license
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you...
Python
UTF-8
4,827
2.84375
3
[ "BSD-3-Clause" ]
permissive
from unittest import TestCase from nose.tools import assert_equal from nose.tools import assert_false try: from nose.tools import assert_count_equal except ImportError: from nose.tools import assert_items_equal as assert_count_equal from nose.tools import assert_true from nose.tools import raises import netwo...
JavaScript
UTF-8
735
2.875
3
[]
no_license
import { useEffect, useState } from 'react'; export default function useHexToRgb(hex) { const [rgb, setRgb] = useState(''); const [isError, setIsError] = useState(false); const hexToRgb = (hex) => { return hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i , (m, r, g, b) => '#' + r + r + g + g + b + b) ...
C++
UTF-8
301
3.125
3
[]
no_license
#include "Tracing.h" #include <iostream> void sum(int& a, double& b); int main() { std::string str("Hello"); double num = 0.8932; int n = 8; doTrace(n + num) doTrace(str) sum(n,num); doTrace(n) doTrace(num) return 0; } void sum(int& a, double& b) { a = 9; b = 0.9999; doTrace(a + b) }
Java
UTF-8
639
3.453125
3
[]
no_license
package fr.diginamic.operations; public class CalculMoyenne { double[] moyenne; public CalculMoyenne(double[] moyenne) { this.moyenne = moyenne; } @Override public String toString() { return "a pour moyenne :"+ this.calcul(); } public float calcul(){ System.out.pr...
PHP
UTF-8
1,382
2.5625
3
[]
no_license
<?php require_once 'libraries/database.php'; require_once 'libraries/utils.php'; require_once 'libraries/security.php'; $task = $_GET['task']; switch($task){ case 'orderForm': showOrderForm(); break; case 'saveOrder': saveOrder(); break; case 'confirmOrder': ...
C++
UTF-8
534
2.75
3
[]
no_license
#ifndef GEOMETRY_H #define GEOMETRY_H class PointArray { int size; Point *points; void resize( int size); public : PointArray(); PointArray( const Point pts[], const int size); PointArray( const PointArray &pv); ~PointArray(); void clear(); int getSize() const { return size;} void...
Java
UTF-8
299
3.03125
3
[]
no_license
package prog01; import java.util.Scanner; public class sumnum { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("enter value of n"); int n=sc.nextInt(); int sum=0; for(int i=1;i<=n ;i++) { sum+=i; } System.out.println(sum); sc.close(); } }
Markdown
UTF-8
6,651
2.828125
3
[]
no_license
# Authentication Management ## Check Username Authentication Information ### URI GET /auth_username ### Request Message None ### Response Message | Name | Type | Description | | :------------------- | :--------------- | :------------------------------------...
JavaScript
UTF-8
5,482
2.625
3
[]
no_license
//TODO: Add pods for displaying images. //TODO: Look into AJAX calls. //TODO: Add lightbox viewer. $(document).ready(function(){ //Intial page rendering instructions $('.vline').height(0); //Retract animation duration (ms). var animationLength = 700; //Tracks tree depth during recursive calls of checkChild...
C++
UTF-8
1,143
3.75
4
[]
no_license
#include <iostream> #include <vector> #include <stack> using namespace std; vector<int> getNSL(vector<int> in) { stack<int> s; vector<int> out; for(auto v : in) { if(s.empty()) { out.push_back(-1); } else if(s.top() < v) { out.push_back(s.top()); } else { ...
Markdown
UTF-8
1,342
3.421875
3
[ "BSD-2-Clause" ]
permissive
In Flash all DisplayObjects share the the same stage. With dartflash you can use multiple layers of stages. The advantage with this approach is that you can add your DisplayObjects to different stages (and therefore display lists). You will get better performance as soon as you can suspend the render loop on one of tho...
C
UTF-8
686
3.984375
4
[]
no_license
#include <stdio.h> #include <stdlib.h> void ary_copy(int a[], const int b[], int n); int main() { int num; int *x, *y; printf("要素数は:"); scanf("%d", &num); x = malloc(sizeof(int)); y = malloc(sizeof(int)); printf("%d個の整数を入力してください。\n", num); for (int i = 0; i < num; i++) { ...
Python
UTF-8
118
3.09375
3
[]
no_license
import math def array_shift(arr, val): half = math.ceil( len(arr) / 2 ) return arr[:half] + [val] + arr[half:]
JavaScript
UTF-8
4,436
3.203125
3
[]
no_license
var minMaxFilterEditor = function (cell, onRendered, success, cancel, editorParams) { var end; var container = document.createElement("span"); var start = document.createElement("input"); start.setAttribute("type", "number"); start.setAttribute("placeholder", "Min"); start.setAttribute("min", 0)...
Java
UTF-8
792
2.078125
2
[]
no_license
package br.cin.ufpe.dass.matchers.core; /** * Created by diego on 08/03/17. */ public class PerformanceMetrics { private long executionTimeInMillis; private long memoryUsed; private long diskSpaceUsed; public long getExecutionTimeInMillis() { return executionTimeInMillis; } publi...
Java
UTF-8
910
1.789063
2
[]
no_license
/* * Decompiled with CFR 0_100. */ package com.google.android.gms.drive.metadata.internal; import android.os.Bundle; import com.google.android.gms.common.data.DataHolder; import com.google.android.gms.drive.metadata.a; public class f extends a<Integer> { public f(String string, int n) { super(string, n)...
Java
UTF-8
9,179
1.507813
2
[]
no_license
package com.google.android.gms.common.api; import android.app.Activity; import android.content.Context; import android.os.Handler; import android.os.Looper; import com.google.android.gms.c.f; import com.google.android.gms.c.g; import com.google.android.gms.common.api.a; import com.google.android.gms.common.api.a.C0065...
Markdown
UTF-8
5,343
2.671875
3
[ "BSD-3-Clause" ]
permissive
# Moduled Nano MIDI controlled modular LED synthesizer (8 hp). Setup LED animations using MIDI data on your modular rack. <p align="center"><img src="assets/img/moduled/moduled-nano-front.png" width="100"></p> ## DIY ## Hardware ### What you need - 1x Arduino Nano - 1x 8x8 LED matrix - 1x Neopixel LED ring (8 LEDs)...
Java
UTF-8
1,597
2.703125
3
[]
no_license
package com.ipartek.formacion.ejemplofinal.entidades; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDate; import java.util.HashSet; import java.util.Set; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor;...
Java
UTF-8
6,609
1.929688
2
[ "MIT" ]
permissive
package com.ameron32.apps.demo.codegen.messaging; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.*; import com.ameron32.apps.demo.codegen.R; import com.backendless.Backendless; import com.backendless.BackendlessCollection; import c...
Java
UTF-8
1,923
3.90625
4
[]
no_license
package com.example.redisdemo.arithAndData; /** * 求两个数的最大公约数 * @author wc * @date 2020/10/15 14:05 */ public class MaxCommonDivisor { /** * 辗转相除法求最大公约数 * @param lawNumber 小得数 * @param upperNumber 大一点的数 * @return 最大公约数 */ public static Integer mod(int lawNumber,int upperNumber){ ...
C
UTF-8
576
3.03125
3
[]
no_license
#ifndef _MY_H_ #define _MY_H_ void out(port, val) { asm(LL,8); asm(LBL,16); asm(BOUT); } void putchar(char ch) { out(1, ch); } void puts(char *s) { int i = 0; while (s[i] != 0) { putchar(s[i++]); } } void printinteger(int n) { // All variables must be defined up front, or the...
Go
UTF-8
653
3.65625
4
[]
no_license
package models import ( "fmt" "sort" "strings" ) // Ingredients represents many ingredients in the domain model. type Ingredients []string const maxIngredientsAllowed = 3 // ParseIngredients parses a comma separeted list of strings // into a sorted slice of ingredients (Ingredients). func ParseIngredients(ingred...
C
UTF-8
372
3.40625
3
[]
no_license
#include<stdio.h> int sum(int a,int b){ return a+b; } int sub(int a,int b) { return a-b; } int evalute(int (*operation)(int,int),int a,int b ) { return (operation)(a,b); } int main(){ int a=10,b=20; int (*p_opr)(int,int)=NULL; p_opr=&sum; printf("\nThe Sum is : %d",evalute(p_opr,a,b)); p_opr=&sub; printf("\nT...
Java
UTF-8
357
1.976563
2
[]
no_license
package com.lti.core.daos; import java.util.*; import com.lti.core.entities.Employee; import com.lti.core.exception.EmpException; public interface EmpDao { public List<Employee> getAllEmps() throws EmpException; //public Employee getEmpOnId(int empId) throws EmpException; //public int insertNewEmployee(...
Java
UTF-8
1,074
2.8125
3
[]
no_license
package parser.node.statement; import exceptions.AlreadyDeclaredException; import exceptions.IncorrectTypeException; import exceptions.ReturnTypeMismatchException; import exceptions.UndeclaredException; import parser.node.ASTNode; import parser.node.expression.identifier.ASTAbstractIdentifier; import parser.node.expre...
C++
UTF-8
745
3
3
[ "Apache-2.0" ]
permissive
#ifndef NTRP_CONTEXT_ASSIGNMENT_H #define NTRP_CONTEXT_ASSIGNMENT_H /** * @file Assignment.h Definition of parsed context::Assignment class */ #include "Statement.h" #include "Value.h" #include <boost/shared_ptr.hpp> #include <string> namespace context { /** * @brief Assignment statement, encapsulating id=value...
Java
UTF-8
854
3.4375
3
[]
no_license
import java.util.ArrayList; public class Player { private String name; private ArrayList<Card> hands; public Player(String name){ this.name = name; this.hands = new ArrayList<>(); } public int totalHand(){ return this.hands.size(); } public void addCardtoPlayer(Deck...
Swift
UTF-8
1,509
3.453125
3
[]
no_license
// // List.swift // H100DaysOfSwiftUI // // Created by MANAS VIJAYWARGIYA on 29/01/21. // import SwiftUI struct Lists: View { let people = ["Finn", "Leia", "Luke", "Rey"] var body: some View { //TODO: 1 type - mix with static and dynamic data // List{ // Section(header: Text("Sect...
Java
UTF-8
866
2.203125
2
[]
no_license
package com.sadi.asm2.model.Order; import javax.persistence.*; @Entity @Table(name="irn_detail") public class IRNDetail { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private int id; @ManyToOne @JoinColumn (name="irn_id",referencedColumnName="id",nullable=false,unique=false) private InventoryRece...
Shell
UTF-8
638
3.078125
3
[ "Apache-2.0" ]
permissive
# This script is used to update the a repository containing the starter kit # https://github.com/carbon-design-system/gatsby-starter-carbon-theme # This project should be located in the same directory as the starter project # Copy all files in the example directory to the starter (except for .DS_Store) find ./package...
PHP
UTF-8
957
2.8125
3
[ "MIT" ]
permissive
<h2>Data Operator</h2> <div class="table table-responsive"> <table class="table table-bordered"> <thead> <tr> <th>No</th> <th>Username</th> <th>Password</th> <th>Email</th> <th>User Level</th> </tr> </thead> <tbody> <!-- Proses menampilkan sekaligus melakukan perulangan (looping) dat...