language
stringclasses
15 values
src_encoding
stringclasses
34 values
length_bytes
int64
6
7.85M
score
float64
1.5
5.69
int_score
int64
2
5
detected_licenses
listlengths
0
160
license_type
stringclasses
2 values
text
stringlengths
9
7.85M
C++
UTF-8
675
3.046875
3
[]
no_license
#include <iostream> #include <string> using namespace std; int main () { string nim[5],nama[5],tanggal_lahir[5]; for (int i = 0; i < 5; ++i) { if (i == 3 || i == 4) { nim[3] = "190030462"; nama[3] = "cahyadi"; tanggal_lahir[3] = "2000-10-22"; nim[4] = "190030461"; nama[4] = "cahyadi2"; tan...
Python
UTF-8
2,308
2.640625
3
[]
no_license
from django.core.management.base import BaseCommand, CommandError from lyrics.models import Song, Artist, Lyrics import requests import bs4 from datetime import datetime, timedelta import time from tqdm import tqdm from lyrics.models import Song, Artist class Command(BaseCommand): def handle(self, *args, **options...
Markdown
UTF-8
3,236
2.78125
3
[]
no_license
This project contains automated e2e protractor tests that I wrote for a company app. It also contains api calls to our server, that will create an image of the product that our app runs on, and run the tests against it on that platform. It will then fetch and display the data nicely. # When first checking this projec...
Shell
UTF-8
2,185
3.8125
4
[ "MIT", "BSD-3-Clause" ]
permissive
#!/bin/bash # Exit with status 1 if any command below fails set -e # Exit if it's not a branch we're interested in being thorough about if echo $(git rev-parse --symbolic-full-name HEAD) | \ egrep -q '^refs/heads/(t/)'; then exit 0 fi # These are the locations I keep my temporary source and build trees in PR...
C++
UHC
923
3.078125
3
[]
no_license
/* : 踷 ȣ: 10799 Ǯ̹ : stack, ¥ : 18.10.04 Ÿ : */ #include<iostream> #include<vector> #include<algorithm> #include<string> #include<queue> using namespace std; vector<char> v; int main(void) { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); char c,save; int cnt = 0,res = 0; bool chk = false; while (ci...
Markdown
UTF-8
1,475
2.59375
3
[ "MIT" ]
permissive
--- title: Create --- # Create an Extension Add an ExtensionPackage to Extension to a Property. Installation is an asynchronous action. After performing a request to add an Extension to a Property, an Extension response will be returned with an `installation_status` of `pending`. When the installation task has comple...
Java
UTF-8
25,847
1.929688
2
[]
no_license
package com.uuzu.mktgo.service; import java.lang.reflect.Field; import java.util.*; import java.util.concurrent.Callable; import java.util.concurrent.CompletionService; import java.util.concurrent.ExecutorCompletionService; import java.util.concurrent.Future; import lombok.extern.slf4j.Slf4j; import org.apache.commo...
Python
UTF-8
1,972
2.625
3
[]
no_license
from datetime import datetime import psycopg2 import logging import sys log_filename = "log_{}.log".format(datetime.now().strftime('%d-%m-%Y')) logger = logging.getLogger('converter') hdlr = logging.FileHandler(log_filename) formatter = logging.Formatter('%(asctime)s %(levelname)s %(massage)s') hdlr....
JavaScript
UTF-8
782
2.859375
3
[ "MIT" ]
permissive
'use strict' const choiceMatrix = [ ['multi', 'expanded', 'checkboxes'], ['select', 'expanded', 'radio'], ['multi', 'collapsed', 'select'], ['select', 'collapsed', 'select'] ] module.exports = function (el) { if (el.type === 'boolean') { return el } if (el.options && el.type !== 'checkbox') { co...
JavaScript
UTF-8
1,306
2.53125
3
[ "MIT" ]
permissive
/** * Created by swx on 2018/1/31. * 用来格式化body的样式 */ 'use strict' const TAG = '[BODYFOMAT]' const creatError = require('http-errors') function isApiRequest(path) { return path && (path.indexOf('/api') === 0) } module.exports = options => { return async function (ctx, next) { try { await next() //...
C
UTF-8
1,202
3.671875
4
[]
no_license
/* * linkbintree.c * * Created on: 2018年8月27日 * Author: zhoubo */ #include "linkbintree.h" //创建二叉树 //返回:二叉树结构体指针 BinTree *BinTreeCreate(void) { BinTree *r; u8 ch; if((ch=getchar())=='#') return NULL; else { r=(BinTree *)malloc(sizeof(BinTree)); //申请空间 r->data=ch; //生成根节点 r->lc...
Python
UTF-8
522
4.34375
4
[]
no_license
''' Um comerciante comprou um produto e quer vendê-lo com um lucro de 45% se o valor da compra for menor que R$ 20,00; caso contrário, o lucro será de 30%. Elabore um algoritmo em Python que leia o valor do produto e mostre na tela o valor de venda para o produto. ''' valor_produto = float(input('Digite o valor do ...
C++
UTF-8
733
2.515625
3
[]
no_license
#include "Collision.h" #include <Engine.h> void thomas::Collision::Update(float aDeltaTime) { m_Sprite.Update(&m_Transform, aDeltaTime); } void thomas::Collision::Draw() { GetGraphic().Draw(m_Collider); m_Sprite.Draw(GetGraphic()); } void thomas::Collision::Start() { std::string tString = "collision.png"; int w...
Java
UTF-8
696
3.1875
3
[]
no_license
package sec04.exam06; import java.util.Scanner; public class MemberServiceExample { public static void main(String[] args) { MemberService memberService = new MemberService(); Scanner scanner = new Scanner(System.in); System.out.print("아이디를 입력하세요: "); String inputId = scanner.nextLine(); System.out....
Python
UTF-8
122
3.03125
3
[]
no_license
# -*- coding utf-8 -*- s1 = 72 s2 = 85 result = 'percent:(%d - %d)/100 = %.2f%%' % (s2, s1, (s2-s1)) print(result)
C
UTF-8
894
3.609375
4
[]
no_license
#include<stdio.h> int gap; void christmas_tree(int,int); int main() { int N,i,l=0; scanf("%d",&N); if(N<=1) printf("\nYou cannot generate Christmas tree"); else if(N>20) printf("\nThe Tree is no More\n"); else { // First One pyramid christmas_tree(1,N+1); // Others for(i=2;i<N;...
Markdown
UTF-8
11,215
2.625
3
[]
no_license
![](https://i.imgur.com/emcU0vv.gif) ***Installation:*** ``` npm i -g @halfhelix/kit ``` This is a toolkit that we use internally at Half Helix to develop our frontend Shopify themes. It enables us to develop websites the way that we want to, with a focus on modularity. > This package is currently in Beta. It is lik...
Shell
UTF-8
836
3.5625
4
[]
no_license
#!/bin/bash # PLEASE NOTE # # while this script has some safety measures (won't restart the node if other(s) are down) # you should *always* use `ansible -f 1 ...` for a gentle / rolling restart of the cluster # # Description: hackish rolling upgrade of a riak cluster for Debian/Ubuntu OS # drop the ball if riak/ria...
Python
UTF-8
1,635
3.671875
4
[]
no_license
# # @lc app=leetcode id=264 lang=python3 # # [264] Ugly Number II # # https://leetcode.com/problems/ugly-number-ii/description/ # # algorithms # Medium (35.66%) # Total Accepted: 98.5K # Total Submissions: 275.7K # Testcase Example: '10' # # Write a program to find the n-th ugly number. # # Ugly numbers are positi...
Java
UTF-8
939
2.25
2
[]
no_license
package com.example.duongthuhien.kltn.Adapter; import android.app.Activity; import android.content.Context; import android.support.annotation.NonNull; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import java.util.List; /** * Created...
Go
UTF-8
452
3.390625
3
[]
no_license
package main import "fmt" func asciiReverseString(s []byte) { l := len(s) for i := range s { if l/2 <= i { break } s[i],s[l-i-1] = s[l-i-1],s[i] } fmt.Println(string(s)) } func testReverseInt(s []int) { l := len(s) for i := range s { if l/2 <= i { break } fmt.Println(i,l-i-1) s[i],s[l...
Java
UTF-8
696
1.804688
2
[]
no_license
package com.mit.easyDonationBackendV6.Service; import com.mit.easyDonationBackendV6.Dto.*; import com.mit.easyDonationBackendV6.Model.HospitalRequirement; import java.util.List; public interface AdminService { void acceptRequirement(RequirementIdDto requirementIdDto); void rejectRequirement(RequirementIdDto ...
Python
UTF-8
1,077
3.75
4
[]
no_license
# filter map apply reduce array = [-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10] # new_array = filter(lambda x: x > 0, array) # # print(list(new_array)) # new_array = [i for i in array if i > 0] # # print(new_array) # ЗАДАНИЕ # написать функцию, которая на вход принимает массив и возвращает массив чисел,...
Python
UTF-8
1,117
3.6875
4
[]
no_license
from math import sqrt from time import time # ONE LINER (extremely slow) print(sum([x for x in range(2, 2000000) if not [y for y in range(2, int(sqrt(x))+1) if x % y == 0]])) prime_cache = [] def is_prime_dynamic(n): if n == 2: return True if n < 2 or not n % 2: return False for p in prime_cache: ...
PHP
UTF-8
2,552
2.5625
3
[ "Apache-2.0" ]
permissive
<?php class Version_model extends CI_Model { private $db; public function __construct() { parent::__construct(); $this->db = $this->load->database('default', TRUE); } public function removeFlash($id) { return $this->db->delete('client_flash', array('id' => $id)); } public function saveFla...
Markdown
UTF-8
1,835
2.65625
3
[]
no_license
--- title: C'était la première fois --- Bonjour ! Le vendredi dernier, j'avais une idée pour une petite nouvelle chanson, et une heure plus tard les paroles et la mélodie étaient finies ! La chanson s'appelle "C'était la première fois", je l'ai enregistré avec mon bon ami Ben (guitare) hier. Bon ben. {% include audio...
Java
WINDOWS-1252
692
2.078125
2
[]
no_license
package com.icss.entity; public class StCourse { private int scId;// private double scGrade;//ɼ private int coId; private int roId; private int clId; public int getScId() { return scId; } public void setScId(int scId) { this.scId = scId; } public double getScGrade() { return scGrade; } public void se...
Java
UTF-8
19,593
2.296875
2
[]
no_license
package com.Stranded.worldGeneration.warIsland; import com.Stranded.Files; import org.bukkit.*; import org.bukkit.block.*; import org.bukkit.block.banner.Pattern; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; import ...
Go
UTF-8
245
2.84375
3
[]
no_license
func isCovered(ranges [][]int, left int, right int) bool { t := [51]bool{} for _, r := range ranges { for i := r[0]; i <= r[1]; i++ { t[i] = true } } for i := left; i <= right; i++ { if !t[i] { return false } } return true }
Java
UTF-8
453
1.929688
2
[]
no_license
package com.github.experimental.strategy.embedded; import com.github.fluent.hibernate.annotations.FluentName; import javax.persistence.Embedded; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class Book { @Id private Long pid; @Embedded //@FluentName(prefix="first_auth...
Java
UTF-8
2,304
2.34375
2
[]
no_license
package com.pisyedilionline.actor; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.Group; import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.Touchable; import com.badlogic.gdx.scenes.scene2d.ui.Label; im...
PHP
UTF-8
1,189
2.546875
3
[ "MIT" ]
permissive
<?php //single.php – Định dạng trang hiển thị nội dung của tất cả các Post. namespace App\Controllers; use Sober\Controller\Controller; use WP_Query; class Single extends Controller { public function project() { return (object)[ 'name' => get_field('name',get_the_ID()), 'url' => get_field('u...
Python
UTF-8
987
2.9375
3
[]
no_license
import sys import json import pathlib def main(filename): with open(filename) as f: document = json.load(f) for node in document["nodes"]: del node["html_rep"] with open(filename, "w") as f: json.dump(document, f) def from_directory(directory): path = pathlib.Path(directory...
Java
UTF-8
2,327
1.671875
2
[ "Apache-2.0" ]
permissive
/* * Copyright 2017-2020 Alfresco Software, 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 ...
PHP
UTF-8
1,454
2.546875
3
[ "MIT" ]
permissive
<?php namespace App\Models; use CodeIgniter\Model; class Sales extends Model { public function saveBill($data){ $db = \Config\Database::connect(); $db->transBegin(); $bill = array( 'Tanggal' => $data->Tanggal, 'Jam' => $data->Jam, ...
C++
UTF-8
1,888
3.125
3
[ "CC-BY-4.0" ]
permissive
// Copyright 2020 Zinkov Artem #include <string> #include <sstream> #include <algorithm> #include <vector> #include "include/odd_even_batcher_merge.h" #include "include/merge_batcher_app.h" Merge_Batcher_App::Merge_Batcher_App() : message_("") {} void Merge_Batcher_App::help(const char* appname, const char* message...
C++
UTF-8
747
2.796875
3
[]
no_license
#include <fullscore/actions/Transforms/HalfDuration.hpp> #include <fullscore/models/Note.hpp> #include <fullscore/Transforms/HalfDurationTransform.hpp> Action::Transforms::HalfDuration::HalfDuration(Note *note) : Base("half_duration") , note(note) {} Action::Transforms::HalfDuration::~HalfDuration() ...
Markdown
UTF-8
5,991
2.671875
3
[]
no_license
--- title: TypeSafeで使いやすいJavaのハイレベルRESTクライアントRetrofit tags: ["Java", "Retrofit"] categories: ["Programming", "Java", "retrofit"] date: 2014-05-05T15:49:28+09:00 updated: 2014-05-06T00:12:21+09:00 --- JavaのRESTクライアントといれば * Spring FrameworkのRestClient * JAX-RS 2のClient API あたりがメジャーで使いやすい。 ただし、ちょっとboilerplateなコードが増えてしまう...
Java
UTF-8
2,043
4.25
4
[]
no_license
package day30_Arrays; public class StudentArray { public static void main(String[] args) { /*id index -0 firstName 1 lastName 2 batchNum 3 phoneNum 4 Declare student array and store5 String values */ String [] student1 = new String[5]; //when you do not k...
Markdown
UTF-8
2,352
3
3
[ "CC-BY-4.0", "MIT" ]
permissive
--- title: "/ZH (Hash algorithm for calculation of file checksum in debug info)" description: "Use the /ZH compiler option to enable MD5, SHA-1, or SHA-256 source file checksums in debug info" ms.date: "09/16/2019" f1_keywords: ["/ZH", "/ZH:MD5", "/ZH:SHA1", "/ZH:SHA_256"] helpviewer_keywords: ["/ZH", "/ZH:MD5", "/ZH:S...
Python
UTF-8
735
2.96875
3
[]
no_license
def mlbph(img1): source=img1 final = source[:] for y in range(len(source)): for x in range(y): final[y, x] = source[y, x] members = [source[0, 0]] * 9 for y in range(1, len(source) - 1): for x in range(1, y - 1): members[0] = source[y - 1, x - 1] ...
Java
UTF-8
6,781
2.03125
2
[]
no_license
package com.wanxg.mynotes.database; public class DataBaseQueries { public static final int TOKEN_INITIAL_ID = 100000000; /*************************************************DDL***************************************************/ public static final String SQL_CREATE_TABLE_LOCAL_USER = "CREATE TABLE I...
PHP
UTF-8
3,690
2.71875
3
[]
no_license
<?php error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); session_start(); include_once('../classes/Connect.php'); include_once('../classes/Upld.php'); include_once('../classes/FunctionAPI.php'); $api = new functionAPI; if (isset($_FILES["FileInput"]) && $_FILES["FileInput...
Markdown
UTF-8
599
3.09375
3
[ "MIT" ]
permissive
# Java Programming III Programming Projects Programming projects for Java Programming III, primarily based upon [Y. Daniel Liang's _Introduction to Java Programming and Data Structures_, 11th Edition](https://www.pearson.com/us/higher-education/product/Liang-Introduction-to-Java-Programming-and-Data-Structures-Comprehe...
Java
UTF-8
127
2.125
2
[]
no_license
package spendingPotential.spendingPotentialStates; public interface StateI { public void yesOrNoItem(String itemOrMoney); }
Java
UTF-8
1,990
2.125
2
[]
no_license
package com.fiuni.sd.bricks_management.controller; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; i...
C++
UTF-8
2,435
2.765625
3
[]
no_license
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* BulletList.cpp :+: :+: :+: ...
Java
UTF-8
612
2.984375
3
[]
no_license
package File_Handling; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; public class SerializeCar { public static void main(String[] args) throws IOException { Engine e = new Engine("AC6098IB",700); Car car1 = new Ca...
JavaScript
UTF-8
686
3.21875
3
[]
no_license
function checkAnswer(id){ if(id=="option5"){ document.getElementById(id).style.backgroundColor = "chartreuse"; } else{ document.getElementById(id).style.backgroundColor = "red"; } } function checkAnswer(){ let answer = document.getElementById("input").nodeValue.toLowerCase(); if(ans...
C#
UTF-8
1,040
3.015625
3
[]
no_license
namespace Business { public class Tile : ViewModelBase { public static Tile CreateTile(int number, int xAxis, int yAxis) { return new Tile { Number = number, XAxis = xAxis, YAxis = yAxis }; } private int _number; public int Number { get {...
JavaScript
UTF-8
1,861
3.390625
3
[ "MIT" ]
permissive
// Worker designed to generate a map of passable/unpassable terrain. // Send log messages back by message. var log = function(message) { postMessage({ log: "(mapgenerator) "+(new Date())+": "+message }); }; // When the map is done being generated, pass it back in chunks of rows. var sendMap ...
JavaScript
UTF-8
5,061
2.84375
3
[]
no_license
var grid = require('selenium-grid'); var webdriver = require('selenium-webdriver'); var async = require('async') //storage for all web drivers var drivers = []; //hub config var hub = { ip: 'http://localhost:5000/wd/hub' }; /* * list supported browsers * format: 'browserNameKey': {seleneium_settings_for_browser} */...
C++
UTF-8
3,126
2.9375
3
[]
no_license
#include "Probe.h" Probe::Probe(const std::string & port_name, int baud_rate) : sensor(), sensor_data(), last_accel_read{}, acceleration{}, velocity{}, position{}, should_terminate{false}, port_name{port_name}, baud_rate{baud_rate}, connected{false} {} void Probe...
Markdown
UTF-8
785
2.796875
3
[]
no_license
# Technical_Analysis_Indicators_with_Python In this repository, I have tried to implement some of the commonly used Technical Analysis Indicators using basic Python programming. Below is the list of Technical Indicators i have added included (Note: I plan on adding some more indicators to the notebook) 1. Moving Ave...
JavaScript
UTF-8
1,669
4.25
4
[]
no_license
/* const assertEqual = function(actual, expected) { if (actual === expected) { console.log("Assertion Passed: " + actual + " === " + expected); } else { console.log("Assertion Failed: " + actual + " !== " + expected); } }; const eqArrays = function(arr1, arr2) { if (arr1.length !== arr2.length) { re...
Python
UTF-8
332
3.703125
4
[]
no_license
""" Bisect: - "Built-in" binary search method in Python. - Can be used to search for an element in a sorted list. """ import bisect A = [-14, -10, 2, 108, 108, 243, 285, 285, 285, 401] print(bisect.bisect_left(A, 285)) print(bisect.bisect_right(A, 285)) print(bisect.bisect(A, 285)) print(A) bisect.insort_right(A, 1...
Java
UTF-8
4,948
1.96875
2
[]
no_license
package com.example.taiga.cleapp; import android.annotation.SuppressLint; import android.app.DownloadManager; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.net.Uri; import android.os.Environment; import android.support.design.widget.CoordinatorL...
JavaScript
UTF-8
311
2.890625
3
[ "MIT" ]
permissive
/** * Or logic condition * @param {Cond} cond */ var Cond = function () { this.conds = Array.prototype.slice.call(arguments, 0); } Cond.prototype.evaluate = function(bb) { for (var i = 0, n = this.conds.length; i < n; ++i) { if (this.conds[i].evaluate(bb)) return true; } }; module.exports = Cond;
Java
UTF-8
9,351
2.109375
2
[ "Apache-2.0" ]
permissive
/******************************************************************************* * Copyright 2009 Omnidroid - http://code.google.com/p/omnidroid * * 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 Lice...
Markdown
UTF-8
312
2.625
3
[]
no_license
Password Generator HW #3 Its tough choosing a new password for all of these new websites and apps. Well I solved that for you with this password generator you'll never have to come up with your own again! Just choose your own length what kind of characters and numbers you want and, BAM! Your passowrd is ready
Swift
UTF-8
564
2.9375
3
[]
no_license
// // StringExtension.swift // FuriganaApp // // Created by 出店 純一 on 2019/02/17. // Copyright © 2019年 出店 純一. All rights reserved. // import Foundation extension String { /// URLエンコード(エスケープ有) var urlEncoded: String { let charset = CharacterSet.alphanumerics.union(.init(charactersIn: "/?-._~")) ...
Java
UTF-8
2,029
2.265625
2
[]
no_license
package com.css.bdpfnew.web.controller; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; i...
Python
UTF-8
681
3.40625
3
[]
no_license
import unittest def exchange_bit_pair(input): tmp = input even_mask, odd_mask = 0, 0 while tmp: even_mask <<= 2 odd_mask <<= 2 even_mask |= 1 odd_mask |= 2 tmp >>= 2 return ((input & even_mask) << 1) | ((input & odd_mask) >> 1) def exchange_bit_pair2(input): ...
JavaScript
UTF-8
2,674
2.859375
3
[]
no_license
describe('decco.js', function(){ describe('Decco', function(){ it('After', function(){ var decco = new Decco(); var module = { add : function(a,b){ return a+b }, subtract : function(a,b){ ...
Python
UTF-8
1,390
4.40625
4
[]
no_license
# File: ex_7.9-calculate_Easter.py # Date: 2019-12-19 # Author: "Hannes Thiersen" <hannesthiersen@gmail.com> # Version: 0.1 # Description: # A formula for computing Easter in the years 1982 - 2048, inclusive, is as # follows: let a = year%19, b = year%4, c=year%7, d = (19a + 2...
Swift
UTF-8
898
2.921875
3
[]
no_license
// // DetailViewModel.swift // TestingWorkshop // // Created by Konrad Roj on 08/04/2019. // Copyright © 2019 Skyrise. All rights reserved. // import Foundation class DetailViewModel { private let service: MeasurementStationsServiceProtocol let station: Station var measurements = [MeasurementList]() ...
Java
UTF-8
923
2.125
2
[]
no_license
package com.mydataway.demo1.service; import com.mydataway.demo1.dao.Demo1Repo; import com.mydataway.demo1.api.Demo1Api; import com.mydataway.demo2.api.Demo2Api; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.b...
C++
UTF-8
397
2.828125
3
[]
no_license
#include<iostream> #include<string> using namespace std; int main() { string username,password; for(int i=1;i<=3;i++) { cout<<"Enter Username : "; getline(cin,username); cout<<"Enter pasword : "; getline(cin,password); { if(username=="abcd" && password=="pakistan") { cout<<"Login successul"; ...
C++
UTF-8
1,107
2.578125
3
[]
no_license
union CheckEndian_ { u32 bits32; u8 bytes[4]; }; inline u8 EndianUtil::GetEndian() { CheckEndian_ val; val.bytes[ 0 ] = 0; val.bytes[ 1 ] = 1; val.bytes[ 2 ] = 0; val.bytes[ 3 ] = 0; return ( val.bits32 == 256 ) ? 0 : 1; } inline void _Swap( u8 *pcA, u8 *pcB ) { skyMString acValue = pcA[ 0 ]; pcA[ 0 ...
Java
UTF-8
1,941
2.21875
2
[ "Apache-2.0" ]
permissive
package com.yi.github.login.controller; import me.zhyd.oauth.config.AuthConfig; import me.zhyd.oauth.request.AuthGiteeRequest; import me.zhyd.oauth.request.AuthGithubRequest; import me.zhyd.oauth.request.AuthRequest; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annot...
Shell
UTF-8
3,692
3.75
4
[ "CC-BY-4.0" ]
permissive
# funct_command_value # # Audit command output values # # Depending on the command_name send an appropriate check_command and set_command are set # If the current_value is not the correct_value then it is fixed if run in lockdown mode # A copy of the value is stored in a log file, which can be restored #. funct_comman...
JavaScript
UTF-8
1,484
2.734375
3
[ "Apache-2.0", "LicenseRef-scancode-free-unknown" ]
permissive
/* @flow strict-local */ import md5 from 'blueimp-md5'; import type { Message, Outbox, User } from '../types'; import { getFullUrl } from './url'; /** * When selecting the size of a gravatar we can pick any arbitrary * size we want. For server-uploaded avatars this is not the case. * We have only: * * default - ...
C#
UTF-8
3,177
2.65625
3
[]
no_license
using CharlyBeck.Mvi.Extensions; using CharlyBeck.Mvi.World; using Mvi.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CharlyBeck.Mvi.Models { using CColoredVertex = Tuple<CVector3Dbl, CVector3Dbl>; using CColor = CVector3Db...
Java
UTF-8
733
1.945313
2
[]
no_license
package lxs.pojo.qo.mp; import hg.common.component.BaseQo; @SuppressWarnings("serial") public class TouristQO extends BaseQo { /** * 订单ID */ private String orderID; /** * 票号 */ private String ticketNo; /** * 票号 */ private Integer localStatus; public Integer getLocalStatus...
Python
UTF-8
1,094
3.453125
3
[]
no_license
# coding: utf-8 from openpyxl import load_workbook, Workbook class Excel: def __init__(self, filename=None, write=False): self.filename = filename if write is False: self.wb = load_workbook(filename=filename) else: self.wb = Workbook() """ get_sheet...
Java
UTF-8
233
2.671875
3
[]
no_license
package epfl.sweng.util; public class Util { public static boolean isLetterOrDigit(String s) { for (int i=0;i<s.length();++i) { if (!Character.isLetterOrDigit(s.charAt(i))) { return false; } } return true; } }
Java
UTF-8
1,253
3.4375
3
[]
no_license
package IO_study; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class WriteDataUsingStream { public static void main(String[] args) { File dataFile = new File("F:\\javaeasy\\DataFileForOutputStream.txt"); if (dataFile...
C++
GB18030
930
3.3125
3
[]
no_license
#pragma once class Point { public: Point(float x = 0, float y = 0);//캯 void setPoint(float a, float b);//ֵ float getX()const//ȡx { return _x; } float getY()const//ȡy { return _y; } friend ostream& operator<<(ostream& _cout, const Point& p); protected: float _x; float _y; }; class Circle :public Point...
Python
UTF-8
2,891
2.890625
3
[]
no_license
''' A (very) basic test of the escaping. This script adapts 'pyduino_example.py' to send a number of different strings to the arduino. The arduino echoes them back and the script checks that they are the same (having been escaped to be sent and then unescaped and reescaped on the arduino and finally unescaped on the PI...
Python
UTF-8
3,678
3.71875
4
[]
no_license
######### Missing Values ######### import pandas as pd import numpy as np import matplotlib.pyplot as plt pip install matplotlib plt.style.use("seaborn") PATH = "./data/burritos.csv" df = pd.read_csv(PATH, header=None) df.info() df.head() #After: PATH = "./data/burritos.csv" df = pd.read_csv(PATH, header=None...
Ruby
UTF-8
273
2.796875
3
[]
no_license
class AccessControl def sample1 puts "This is public method" sample3 end protected def sample2 puts "This is protected method" end private def sample3 puts "This is private method" end end obj1=AccessControl.new obj1.sample1 #obj1.sample3
PHP
UTF-8
3,326
2.96875
3
[ "MIT" ]
permissive
<?php function validate($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } function isPica($data) { if (preg_match('/^[0-9]+(?i)p([0-1]?[0-9])?$/i', $data)) { return true; } return false; } function isPoint($data) { if...
Java
UTF-8
192
2.359375
2
[]
no_license
package lessons.innerclasses; /** * Created by user on 06.04.2015. */ public class B extends A { public final void doSomething (){ System.out.println("B class method"); } }
Java
GB18030
1,916
2.171875
2
[]
no_license
package com.hrm.provider; import java.util.Map; import org.apache.ibatis.jdbc.SQL; import com.hrm.domain.Dept; import com.hrm.domain.Job; public class JobDynaSqlProvider { //̬ public String selectJob(final Job job){ return new SQL(){{ SELECT("*"); FROM("job_inf"); if(job.getName()!=null&&!job.getName()...
PHP
UTF-8
3,877
2.609375
3
[ "MIT" ]
permissive
<?php namespace app\components; use app\base\Controller; use app\models\User; use Klein\DataCollection\RouteCollection; use Klein\Klein as Router; use Klein\Request; use Klein\Response; use Klein\Route; use PDO; class Application { protected string $name; protected Controller $controller; protected Req...
PHP
UTF-8
12,166
2.53125
3
[]
no_license
<?php namespace BREND\AGV\Models; use BREND\Constants\STATUS; use BREND\Constants\AGVSTATUS; use BREND\AGV\Models\AGV_request; use BREND\AGV\Models\AGV_response; use BREND\AGV\Exceptions\AGVException; class AGV{ protected $api_url; protected $AGV_name; protected $_Data = null; public function __cons...
C++
UTF-8
3,599
3.390625
3
[]
no_license
//----------------------------------------------------------------------------- // Copyright Ed Keenan 2017 // Optimized C++ //----------------------------------------------------------------------------- #include <vector> #include "Trace.h" #include <string> // Modify This File using std::vector; class Point { publ...
Ruby
UTF-8
5,055
3.046875
3
[]
no_license
# encoding: utf-8 $: << File.expand_path('../../lib', __FILE__) require 'set' require 'bundesstrasse' # This example demonstrates how a publisher can detect when there are # subscribers listening. When sending complex messages you may want to avoid # expensive serialization of messages unless there actually is anyo...
Python
UTF-8
559
2.5625
3
[]
no_license
#!/usr/bin/python # -*- coding: utf-8 -*- #Note! So far, this is code to initialize a fresh DB to muck with. #I'm usig a DB called "dantest". #Assumes Grid from -1000 to +1000 in x and y directions. import MySQLdb import generalDBQueries class Galaxy: def __init__(self): mydb = GalaxyDB() print ...
Python
UTF-8
1,128
3.265625
3
[]
no_license
class Solution: def threeSum(self, A): ''' :problem: Given an array of n integers, return all unique triplets [a,b,c] in the array such that a + b + c = 0 :type A: list of int :rtype: list of list of int ''' hashmap = {} for i in range(len(A)): ...
Python
UTF-8
271
2.765625
3
[]
no_license
import pygame class Settings(): def __init__(self): self.caption = "Rocket" self.screen_width = 720 self.screen_height = 480 self.bg_color = (0, 0, 59) def screen_size(self): return (self.screen_width, self.screen_height)
Java
UTF-8
933
2.09375
2
[]
no_license
package com.zjj.service.impl; import java.util.Map; import com.zjj.bean.UserBean; import com.zjj.dao.UserDao; import com.zjj.service.UserService; import com.zjj.util.common.Page; public class UserServiceImpl implements UserService { private UserDao userDao; @Override public boolean login(String ac...
Java
UTF-8
427
2.171875
2
[]
no_license
package com.techprimers.kafka.springbootkafkaconsumerexample.model; public class User { private String meetingId; // private String[] host = meetingId.split(":"); public String getMeetingId() { return meetingId; } public User() { } public User(String meetingId) { this.me...
Java
UTF-8
8,203
2.203125
2
[]
no_license
package com.leomara.delivery.doce_sabor.services; import com.leomara.delivery.doce_sabor.domain.Cliente; import com.leomara.delivery.doce_sabor.domain.Endereco; import com.leomara.delivery.doce_sabor.repositories.ClienteRepository; import com.leomara.delivery.doce_sabor.services.exception.DataIntegrityException; impor...
Java
UTF-8
1,048
3.265625
3
[]
no_license
import edu.princeton.cs.algs4.Quick3string; public class SuffixArray { private final String[] sa; private final int N; public SuffixArray(String text){ N=text.length(); sa = new String[N]; for(int i=0;i<N;i++) sa[i]=text.substring(i); Quick3string.sort(sa); } public int length(){ return N; } public...
JavaScript
UTF-8
6,321
3.75
4
[]
no_license
/*Logic I am using is I create a columns array which takes the first object of previous array as input I call the objects inside recursively using getDeeperKeys function After creating that, i push all this in the table with TH element Then I scan prev array. I create a rowArray which is basically an array of arrays. ...
Python
UTF-8
4,054
3.65625
4
[]
no_license
''' Given a list of accounts where each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements are emails representing emails of the account. Now, we would like to merge these accounts. Two accounts definitely belong to the same person if there is some ...
Python
UTF-8
1,731
3.859375
4
[]
no_license
from string import punctuation from string import whitespace Words = [] def ponctuation(s): for c in punctuation : if c in s: s = s.replace(c, "") return s def space(s): for c in whitespace: if c in s: s = s.replace(c, "") return s def frequency(items...
Python
UTF-8
1,876
2.703125
3
[]
no_license
from errors import MVMErr class Registers: REGS_SPECIAL = 32 REGS_TOTAL = 35 VALUE_MAX = 2**32 - 1 def __init__(self): self.regs = [0] * self.REGS_TOTAL def number(self,reg): if reg[0] == '$' and reg[1:].isdigit(): return int(reg[1:]) else: try: ...
C#
UTF-8
1,011
2.734375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.CSharp; using System.CodeDom.Compiler; using System.Diagnostics; namespace CSharpCompilerInCode { class Program { static void Main(string[] args) { CSharpCodeProvider c...