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
JavaScript
UTF-8
1,026
2.5625
3
[]
no_license
import React from 'react'; function Form ({ onSubmit, selectedCity, handleChange, handleUnitChange, unit }){ return ( <form onSubmit={onSubmit}> <div className="formContainer"> {/* --- city input begins --- */} <div className="input_container flexRow"> <label htmlFor="...
Swift
UTF-8
3,005
2.578125
3
[ "MIT" ]
permissive
// // SetUpRecoveryCodeWording.swift // falcon // // Created by Manu Herrera on 04/09/2020. // Copyright © 2020 muun. All rights reserved. // import UIKit // This enum is used for all the conditional wording of the set up email + password flow enum SetUpRecoveryCodeWording { case emailNotSetup case emailS...
Swift
UTF-8
338
2.65625
3
[]
no_license
// // Photo.swift // maple // // Created by Murray Toews on 2017-08-07. // Copyright © 2017 mapleon. All rights reserved. // import Foundation struct Photo { var id: String? var index: Int var imageUrl: String init(index: Int, image: String) { self.index = index self.imag...
TypeScript
UTF-8
860
2.53125
3
[]
no_license
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; @Component({ selector: 'ui-checkbox', templateUrl: './checkbox.component.html', styleUrls: ['./checkbox.component.css'] }) export class CheckboxComponent implements OnInit { @Input() public disabled: boolean = false; @Input()...
Python
UTF-8
1,772
3.265625
3
[]
no_license
from os.path import join, dirname import pandas as pd class CsvPriceLoader: """ Load historical prices from csv file Parameters ---------- csv_path : string, location of csv file to load Returns ------- HistPriceCollection """ def __init__(self, csv_path): self.path ...
Java
UTF-8
933
2.640625
3
[]
no_license
package Dominio; import java.io.Serializable; public class ReciboFicto implements Serializable{ private String nombre; private int sueldo; private int IRPF; public String getNombre() { return nombre; } public void setNombre(String unNombre) { this.nombre = unN...
C#
UTF-8
372
3.3125
3
[]
no_license
class Program { static void Main(string[] args) { using (WebClient client = new WebClient()) using (Stream stream = client.OpenRead("http://www.google.com")) using (StreamReader reader = new StreamReader(stream)) { Console.WriteLine...
Markdown
UTF-8
7,160
3.0625
3
[ "MIT" ]
permissive
--- --- Redovisning kmom04 ========================= Detta innehåll är skrivet i markdown och du hittar innehållet i filen `content/redovisning/04_kmom04.md`. Att skriva ett litet research paper var en intressant och givande uppgift, samt ett bra sätt att tillämpa de kunskaper som man har tillägnats sig under moment...
Markdown
UTF-8
2,066
2.84375
3
[]
no_license
# Udacity_CloudArchitect_Project2 Project: To Design, Provision and Monitor AWS Infrastructure at Scale #### Making Tradeoffs per cost allocation scenarios. * **Scenario 1:** If the monthly bill target should not exceed $8000 - $10,000? - [Initial Cost Estimate](https://calculator.aws/#/estimate?id=e9b8d9187e38b54de4...
Python
UTF-8
159
4
4
[]
no_license
import math print("Find the area of your Circle") r = float(input("Enter your Circle's radius")) Area = math.pi * r ** 2 print("your circle's Area is",Area)
Ruby
UTF-8
4,288
2.671875
3
[]
no_license
require "test_require" describe "SearchItem" do before(:each) do @to_be_searched = double("Searched Item") @search_item = SearchItem.create(@to_be_searched, "SearchItem", [:method1, :method2, :method3]) @system = double("system") DAOAccount.stub(:instance).and_return(@system) DAOItem.stub(:instan...
TypeScript
UTF-8
5,172
2.890625
3
[]
no_license
import "reflect-metadata"; import { isUndefined, isFunction, isObject, isNullOrUndefined } from './utilities'; export const getPropertyMetadata = Symbol("Metadata"); const metadataName = "dataAnnotations"; export function required(target: any, propertyKey: string) { setPropertyAnnotation(target, propertyKey, "re...
Python
UTF-8
3,132
2.78125
3
[]
no_license
from PyQt5.QtWidgets import QApplication, QPushButton, QWidget, QMainWindow, QTableWidget, QTableWidgetItem, \ QInputDialog, QMessageBox import sys class Table(QWidget): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.initUi() self.btn.clicked.conne...
Markdown
UTF-8
396
2.609375
3
[]
no_license
# Transaction-Management-System A transaction Management System, based on the concept of multithreading, built in java, capable of processing multiple transactions at a single moment, using locally made database. Consurrency management using two phase locking scheme, also comparing the difference between the rate of tr...
Java
UTF-8
1,047
2.171875
2
[]
no_license
//Deobfuscated with https://github.com/PetoPetko/Minecraft-Deobfuscator3000 using mappings "1.12 stable mappings"! // // Decompiled by Procyon v0.5.36 // package me.ka1.vulcan.module.modules.render; import me.ka1.vulcan.setting.Setting; import net.minecraft.client.renderer.ItemRenderer; import me.ka1.vulcan.module...
Shell
UTF-8
2,160
4.625
5
[ "Unlicense" ]
permissive
#!/bin/bash dotfile_dir=$(realpath "$(dirname "$(realpath "$0")")/../dotfiles") error() { printf 'Error: %s\n' "$1" >&2 exit 1 } status() { printf '%s\n' "$1" } usage() { printf '%s\n' "Usage: dotcat add <file> <category> Add <file> to <category> dotcat link [category0 category1 ...] ...
Java
UTF-8
610
2.734375
3
[]
no_license
package bl.mock; import vo.DateVO; /** * Date的Mock类 * @author CROFF * @version 2016-11-05 16:40 */ public class MockDate extends DateVO { private int year, month, day; /** * MockDate的构造方法 * @param year 年 * @param month 月 * @param day 日 */ public MockDate(int year, int month, int day) { super(year...
C#
UTF-8
5,215
3.046875
3
[]
no_license
using System; using System.Globalization; using System.Linq; using NUnit.Framework; namespace UtvDotNet.Lib.Tests { public class Tests { private static Func<long, Func<long, bool>> lt = max => x => x < max; private static Func<long, bool> isEven = x => x % 2 == 0; private static Func<lo...
Java
UTF-8
5,842
2.734375
3
[]
no_license
package MazeGame; import java.awt.Color; import java.awt.Graphics; import java.awt.Image; import java.awt.List; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Scanner; import...
Python
UTF-8
603
3.171875
3
[]
no_license
import numpy as np import matplotlib.pyplot as plt Import scipy.optimize import minimize #f(x,y)=5exp[-(x-1)**2 - 2*(y-3)**2] + 3exp[-2*(x-4)**2 - (y-1)**2] #maxima (1,3) 5 #maxima (4,1) 3 def funky(x, y): a = 5*np.exp(-(x-1)**2 - 2*(y-3)**2) b = 3*np.exp(-2*(x-4)**2 - (y-1)**2) c = a + b return c xs ...
Java
UTF-8
3,398
3.546875
4
[]
no_license
/** * @author Abby Sassel, Jacopo Scotti * @since 08/11/2014 * * Coursework3 * - Simulates a simple elevator. * - Shows how different strategies can affect the efficiency of an elevator. * */ public class Customer { private int currentFloor; private int destinationFloor; private boolean inElevatorStatus; ...
C
UTF-8
3,144
3.28125
3
[]
no_license
#include <stdlib.h> #include <stdio.h> #include <math.h> #include "simulation.h" #include "track.h" void displayResults(int error, Point *p, Point *TD, long double T1, long double T2); void printPoint (FILE* output, Point *p); void printTimes (FILE* output, long double T1, long double T2); double computeError(Point...
Java
UTF-8
415
3.1875
3
[]
no_license
package codeDemoLs10; import java.util.TreeSet; public class TreeSetDemo { public static void main(String[] args) { TreeSet<Integer> treeSet = new TreeSet<Integer>(); treeSet.add(14); treeSet.add(5); treeSet.add(9); treeSet.add(14); System.out.println(treeSet); ...
Markdown
UTF-8
2,218
2.859375
3
[ "MIT" ]
permissive
--- templateKey: blog-post title: Spring Cleaning – already!! …and does that just go in the trash? date: 2020-03-28T22:00:58.118Z description: >- Annie Haul wants help you ethically dispose of your stuff. We recycle as much as we can, donating with dignity! featuredpost: false featuredimage: img/Annie Haul Truck ph...
C++
UTF-8
737
3.0625
3
[]
no_license
// Serial Parse Using C functionsto be read by Arduino //Uses page 103 of Arduino Cookbook int index = 0; //index variable const int ledPin = 13; int value = 0; int blinkRate = 0; void setup() { Serial.begin(9600); pinMode(ledPin,OUTPUT); digitalWrite(ledPin,LOW); } void loop(){ if(Serial.available()) // is ...
Ruby
UTF-8
605
2.5625
3
[ "MIT" ]
permissive
module Anor module Routing class Namespace attr_reader :router, :name def initialize(router, name, &block) @router = router @name = name instance_eval(&block) if block_given? end %i(get post patch put delete).each do |verb| define_method(verb) do |url, op...
Python
UTF-8
7,098
2.546875
3
[]
no_license
from SNAPI import SNREST from SNAPI.PMTemplateUtility import TemplateUtility from SNAPI.PMUtility import PreventativeMaintenance from SNAPI.PMTypeUtility import PMType import pandas as pd from math import isnan def main_template(filename): dev = SNREST() templates = pd.read_excel(filename) for index, tem...
Markdown
UTF-8
17,967
3.46875
3
[]
no_license
# Completely Opinionated with respect to my comments and notes # # Goal # There are numerous reads for ML and DL fundamental aspects. The goal here is to touch upon all the elementary and important ones with simple and short explanation in plain english so that it will help us to remember all that by taking a quick l...
Swift
UTF-8
2,625
2.796875
3
[]
no_license
// // LocationManager.swift // GoogleMapImplementation // // Created by Syed Hasnain on 02/09/2017. // Copyright © 2017 Devclan. All rights reserved. // import UIKit import CoreLocation import GoogleMaps class LocationManager: NSObject, CLLocationManagerDelegate, GMSMapViewDelegate{ // Make it singelton class...
SQL
UTF-8
5,350
3.46875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.6.4 -- https://www.phpmyadmin.net/ -- -- Client : 127.0.0.1 -- Généré le : Jeu 22 Juin 2017 à 20:27 -- Version du serveur : 5.7.14 -- Version de PHP : 5.6.25 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE...
Java
UTF-8
413
3.484375
3
[]
no_license
package p2_2; import java.awt.Rectangle; public class Exercise2_2 { public static void main(String [] args) { Rectangle r1 = new Rectangle( 5, 10, 10, 40); double perimeter = 2 * (r1.getWidth() + r1.getHeight() ); System.out.println("perimeter: " + perimeter + " units" ); } } /* revi...
Java
UTF-8
2,662
2.09375
2
[]
no_license
package com.violet; import android.app.ActivityManager; import android.app.Application; import android.content.Context; import android.content.res.Configuration; import com.violet.grape.VioletGrape; import com.violet.module.IModule; import java.util.List; /** * Created by kan212 on 2018/4/12. */ public abstract ...
Python
UTF-8
4,261
2.90625
3
[]
no_license
#!/usr/bin/env python ########### # IMPORTS # ########### from __future__ import print_function import sys import argparse import os from libnmap.parser import NmapParser ############# # FUNCTIONS # ############# def error(*objects): print("[!]", *objects, file=sys.stderr) def info(*objects): print("[+]"...
C++
UTF-8
505
2.84375
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; if(n>=1 && n<=4)cout<<"few"<<endl; else if(n>=5&&n<=9)cout<<"several"<<endl; else if(n>=10&&n<=19)cout<<"pack"<<endl; else if(n>=20 && n<=49)cout<<"lots"<<endl; else if(n>=50 && n<=99)cout<<"horde"<<endl; else if...
Markdown
UTF-8
2,063
2.640625
3
[ "Apache-2.0" ]
permissive
mJson is an extremely lightweight Java JSON library with a very concise API. The source code is a single Java file. The license is Apache 2.0. Because of its tiny size, it's well-suited for any application aiming at a small footprint such as mobile/Android applications. It was originally developed in the context of th...
C++
UTF-8
1,231
3.578125
4
[]
no_license
// // main.cpp // Bunker Array // // Created by Santosh Raj Bista on 11/10/17. // Copyright © 2017 Santosh Raj Bista. All rights reserved. // #include <iostream> int isPrime(int n) { bool isPrimeNumber = false; for (int i = 2; i <= n/2; i++) { if (n % i == 0) { isPrimeNumber = true; ...
TypeScript
UTF-8
761
2.84375
3
[ "MIT" ]
permissive
import { BadRequestException, createParamDecorator, ExecutionContext } from "@nestjs/common"; export const isNum = createParamDecorator( (data: string, ctx: ExecutionContext)=>{ const request = ctx.switchToHttp().getRequest(); if (!Number.isInteger(request.body[data])){ throw new BadRe...
JavaScript
UTF-8
2,239
2.640625
3
[ "MIT" ]
permissive
const bsv = require('bsv') const Run = require('../dist/run.node.min') async function main () { class Princess extends Jig { send (to) { this.owner = to } } class Gold extends Jig { send (to) { this.owner = to } } class TxFees extends Jig { init(satoshis) { this.satoshis = satoshis } } cla...
Java
UTF-8
1,914
2.375
2
[]
no_license
package countnote.web; import java.io.IOException; import java.sql.SQLException; import java.util.List; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;...
Shell
UTF-8
906
3.765625
4
[]
no_license
#!/bin/sh # # analyse # # input variables # # $1: version of data (subdir) # $2: name of template card # if [ -z $1 ]; then echo "" echo "Please give data-version and template card" echo "" echo "Usage: analyse [version] [template]" echo "" exit fi if [ -z $2 ]; then echo "" echo "Please...
Java
UTF-8
7,262
2.015625
2
[ "LicenseRef-scancode-free-unknown", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
/* * Copyright 2003-2022 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
Markdown
UTF-8
1,116
3.078125
3
[]
no_license
# UniversalSales Final assignment to be submitted via Blackboard for C# class Demonstrate usage of multi-dimensional array matrices ## Example output (name not found) ``` $ dotnet bin/Debug/netcoreapp2.1/UniversalSales.dll ************************ Display all sales Name Jan Feb Mar Collier 2500 35000 ...
Python
UTF-8
498
3.203125
3
[]
no_license
def hw2bPractice (): smallestNumber = 100 biggestNumber = 0 setOfNums = input("Enter some numbers seperated by a comma ") setOfNums = setOfNums.split(',') print(setOfNums) #while setOfNums != ' ' : for i in range (0, len(setOfNums)) : if ((setOfNums[i]) <= smallestNumbe...
Java
UTF-8
1,282
3.484375
3
[]
no_license
package model; import java.io.IOException; import java.net.Socket; /** * A class modelling a human player in a game of spectrangle. * @author Alina Maximova, s2032074 */ public class HumanPlayer extends Player { /** * Creates a new HumanPlayer with the specified name, socket and preference. * @param name the...
Java
UTF-8
530
2.09375
2
[]
no_license
import lk.ijse.dep.AssetManagement.business.BOFactory; import lk.ijse.dep.AssetManagement.business.custom.ManageVendorsBO; import lk.ijse.dep.AssetManagement.dto.VendorDTO; public class vendortest { public static void main(String[] args) throws Exception { ManageVendorsBO manageVendorsBO= BOFactory.getInst...
Swift
UTF-8
3,605
3.0625
3
[]
no_license
// // BirdData.swift // Ios Assessment 2 // // Created by Macy on 6/5/18. // Copyright © 2018 James Owen. All rights reserved. // import Foundation import MapKit; //list of keys for storing data struct PropertyKey{ static let name = "Name"; static let locations = "Locs"; static let description = "Description"...
C
UTF-8
2,026
3.609375
4
[]
no_license
#include <stdlib.h> #include <stdio.h> #include <math.h> #include "pgm_io.h" int main (int argc, char **argv) { unsigned char *original, *image1, *image2, *diff; int rows, rows1, rows2, cols, cols1, cols2, x, y; float mse1 = 0, mse2 = 0; float temp1, temp2; if (argc < 5) { printf("Usage: %s <original> <im...
Shell
EUC-JP
1,070
3.421875
3
[ "BSD-3-Clause" ]
permissive
#!/bin/bash myname=$0 cd ${myname%/*} source ./revisionup_ebuild.sh # BOARD̵׵᤹ if [ -z "${BOARD}" ]; then echo Please set BOARD. Abort. exit 1 fi # ~/trunk/src/third_party/portage_stable˥̵֥к cd ~/trunk/src/third_party/portage-stable b=`repo branches | grep portage-stable` if [ -z "$b" ]; then echo create b...
Markdown
UTF-8
2,622
2.9375
3
[]
no_license
# Backend ## Routes ### Users | Status | Type | Parameters | URL | Response | |---------------------------- |-------- |------------------------------------- |----------- |--------------------------------------------...
Java
UTF-8
9,048
2.3125
2
[]
no_license
package managedbean; import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import jav...
C#
UTF-8
2,216
2.765625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using System.Configuration; namespace SiteB.Business { public class Login { private string ConnectionString = ConfigurationManager.ConnectionStrings["DBConnection"].ConnectionString; public...
Java
UTF-8
5,914
2.109375
2
[]
no_license
package com.sogilis.sogimailer.db; import android.content.ContentValues; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import com.sogilis.sogimailer.SogiMailerApplication; import com.sogilis.sogimailer.dude.NotFoundException; import com.sogilis.sogimailer.dude.TooManyException; import...
Java
UTF-8
4,253
2.296875
2
[]
no_license
package com.recipe.r.ui.adapter.order; import android.app.Activity; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.recipe.r.R; import com.recipe.r.ba...
PHP
UTF-8
2,307
2.78125
3
[ "Apache-2.0", "MIT" ]
permissive
<?php namespace Auth0\Tests\Api\Helpers\State; use Auth0\SDK\API\Helpers\State\SessionStateHandler; use Auth0\SDK\Store\SessionStore; /** * Class SessionStateHandlerTest * * @package Auth0\Tests\Api\Helpers\State */ class SessionStateHandlerTest extends \PHPUnit_Framework_TestCase { /** * Storage engine...
C++
UTF-8
297
2.53125
3
[]
no_license
// Mux.h #ifndef _MUX_h #define _MUX_h #include "arduino.h" class MuxClass { protected: int S0, S1, S2, Z; public: MuxClass( int _S0, int _S1, int _S2, int _Z) { S0 = _S0; S1 = _S1; S2 = _S2; Z = _Z; }; int readInputAnalog(int pin); int readInputDigital(int pin); }; #endif
Java
UTF-8
1,758
2.125
2
[]
no_license
package com.example.shortcoursebms.repositories; import com.example.shortcoursebms.models.Role; import com.example.shortcoursebms.models.User; import com.example.shortcoursebms.repositories.providers.UserProvider; import org.apache.ibatis.annotations.*; import org.springframework.stereotype.Repository; import java.ut...
JavaScript
UTF-8
3,066
2.65625
3
[]
no_license
define(['./nls/fr'], function(i18nStrings) { 'use strict'; class Util { /** * Helper function to get a DOM node from an id. * @param {string} id for DOM node to find. * @returns {DOMNode} */ static $(id){ return document.getElementById(id); } /** * Helper function to attach an event to a ...
Java
UTF-8
1,087
2.5
2
[]
no_license
package com.farshad.openFinDesk.infrastructure.commandCategory.CommandListeners; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.lang.reflect.Method; import java.util.ArrayList; @Comp...
C++
UTF-8
973
2.921875
3
[ "Apache-2.0" ]
permissive
#include <iostream> using namespace std; int definer(char ch) { if (ch == '/') { return 1; } if (ch == '*') { return 2; } return 0; } int main() { // s / * int matrix[5][3] = {}; FILE *textState = fopen("state.txt", "r"); if (textState == nullptr) { cout << "Don't open file"...
Java
UTF-8
444
1.679688
2
[]
no_license
package com.css.processor; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; @ComponentScan(basePackages = {"com.css.processor"}) @SpringBootApplication public class OrderProcessorApplica...
Java
UTF-8
655
2.921875
3
[]
no_license
package thecollector.model; /** * An Enum to represent the different status codes that the application can use. * * @author Ian Claridge */ public enum StatusCodes { OK (0), WARNING (100), SETTINGS_ERROR (200), MISC_ERROR (300), DATABASE_ERROR (400), SEVERE_ERROR (1000); private final int returnCode...
Markdown
UTF-8
1,169
2.984375
3
[]
no_license
Scaling microservices using Kubernetes and Docker ## Key terms * Microservices * 12 Factor Rules (Or guidelines) for developing good and reliable applications * JWT - JSON Web Tokens * Docker * Why do we even need Docker? * Our OSs do a terrible job in running multiple instances or multiple versions of the same a...
Python
UTF-8
1,353
2.96875
3
[]
no_license
# Python Json parser for Node as Mesh Path counter by Eloy Gil & Hao Wu # {eloy,hao.wu}@ac.upc.edu # MIRI - DS - FIB (UPC) # Note: Requires simplejson -> pip install simplejson from collections import Counter import simplejson as json mesh = Counter() inet = Counter() # Printing "mesh" / "inet" | Showing the number of...
Python
UTF-8
3,179
2.890625
3
[]
no_license
from abc import abstractmethod import operator class Contract: def __init__(self): pass @abstractmethod def check_prerequisites(self, stakeholders: list, product): pass @abstractmethod def enact_contract(self, stakeholders: list, product): pass class SimpleSellingContr...
Markdown
UTF-8
678
2.546875
3
[ "MIT" ]
permissive
# Access project details # ### Assumptions ### - fastlane.ci already setup - User logged in - User at dashboard - At least one project set up ### Steps ### 1. At the dashboard, user clicks on a project they wish to edit 1. User taken to `project details` - Show project name - Be able to rebuild a build ...
Java
UTF-8
1,890
2.375
2
[]
no_license
package com.clay_rock.hrims.model.employee; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "emp_educatio...
C
UTF-8
700
3.140625
3
[]
no_license
#include<stdio.h> #include<string.h> #define MAX 100000 int main() { int t; scanf("%d",&t); while(t!=0) { char input[MAX]; long long int count=0,group=0; int flag=0; scanf("%s",input); count=strlen(input); for(int i=0;i<count;i++) { ...
C++
UTF-8
12,788
2.78125
3
[]
no_license
/** \file This file contains stream classes for binary i/o inherited from ifstream and ofstream. Operators << and >> are overloaded for all built-in data types and littleEndian / bigEndian swapping is already considered. \author Frank Delonge ...
C++
UTF-8
647
3.875
4
[]
no_license
// 189. Rotate Array #include <algorithm> #include <iostream> #include <vector> class Solution { public: void rotate(std::vector<int>& nums, int k) { //O(N) int len = nums.size(); if (len <= 1) return; k %= len; std::reverse(nums.b...
Markdown
UTF-8
1,007
3.8125
4
[]
no_license
# 349. Intersection of Two Arrays {% embed url="https://leetcode.com/problems/intersection-of-two-arrays/" %} 方法一:扫一遍数组1并用set记下来,扫一遍数组2找交集。方法二:先排序两个数组,两个指针遍历找相同元素。 ```javascript /** * @param {number[]} nums1 * @param {number[]} nums2 * @return {number[]} */ // var intersection = function(nums1, nums2) { // let...
Java
UTF-8
1,452
2.359375
2
[]
no_license
package com.example.tallerandroidmoviles2019; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; public class Men...
Python
UTF-8
389
3.90625
4
[]
no_license
def fact(x): if x == 1: return 1 else: return x * fact(x-1) print(fact(5)) def fibo(x): if x == 0: return 0 elif x == 1: return 1 else: return fibo(x-1) + fibo(x-2) print(fibo(5)) def fibo_2(x): prev, curr = 0, 1 for _ in range(x): yield...
Java
UTF-8
2,028
3.046875
3
[]
no_license
package server; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.Socket; public class MainServer { public static void main(String[] args) { Socket socket = null; Server servidor = null; int puerto = 50; int maximoConexiones = 15; ...
Python
UTF-8
873
2.546875
3
[]
no_license
from models.Handler import Handler from models.Comment import Comment def remove_user_comment(user, comment): ''' removes the comment from the user ''' index = user.comments.index(comment.key) user.comments.pop(index) user.put() class CommentPage(Handler): ''' Class for handling Commen...
Markdown
UTF-8
1,404
2.78125
3
[ "MIT" ]
permissive
Packages ------- Contains Javascript packages for interacting with the frontend easily. - DOM reconciling - Polyfills ## Building To build Markup typescript sources into javascript using the `commonjs` module system, simply execute: ```bash npm run build ``` We use [Browserify](http://browserify.org/) to make t...
JavaScript
UTF-8
3,023
4.5625
5
[]
no_license
const myName = "Noi" const greeting = "Hello everyone! My name is " + myName + ". Nice meeting you!" //document.querySelector("li.normalCase").innerHTML = ("original .... " + greeting) //document.querySelector("li.lowerCase").innerHTML = ("lowercase .... " + greeting.toLowerCase()) // document.querySelect...
C#
UTF-8
2,633
2.84375
3
[]
no_license
using System.Collections; using System.Collections.Generic; using UnityEngine; public class VoxelData { bool[,,] patternData = new bool[,,] {// just the output voxels pattern { {true, true, true, true}, {true, true, true, true}, {true, true, true, true}, ...
C++
UTF-8
14,838
2.75
3
[ "MIT" ]
permissive
#include <glm/glm.hpp> #include <glm/gtx/quaternion.hpp> #include <zombye/ecs/abstract_property.hpp> #include <zombye/ecs/value_pack.hpp> #include <zombye/ecs/typed_value.hpp> #include <zombye/utils/assign.hpp> #include <zombye/utils/logger.hpp> namespace zombye { std::string to_string(const Json::Value& value) {...
PHP
UTF-8
800
2.65625
3
[ "MIT" ]
permissive
<?php namespace Codesleeve\AssetPipeline\Filters; use Assetic\Asset\AssetInterface; use Assetic\Filter\FilterInterface; use CoffeeScript\Compiler; class CoffeeScriptFilter implements FilterInterface { /** * [filterLoad description] * @param AssetInterface $asset [description] * @return [type] ...
TypeScript
UTF-8
1,394
2.578125
3
[ "Apache-2.0" ]
permissive
import { ProjectSettingsTabRoutes } from "constants/routes"; import { FormToGqlFunction, GqlToFormFunction } from "../types"; type Tab = ProjectSettingsTabRoutes.Variables; export const gqlToForm = ((data) => { if (!data) return null; const { vars: { adminOnlyVars, privateVars, vars }, } = data; return ...
Markdown
UTF-8
107,129
3.078125
3
[]
no_license
# Overview I regularly play in CTF (Capture The Flag) games to keep my offensive security skills sharp and learn new techniques. Around June last year a new challenge appeared on [HackTheBox](https://hackthebox.eu) and it presented a significant challenge: ![RopeTwo Information Card](./ropetwo.png) Much like the nam...
TypeScript
UTF-8
747
2.640625
3
[]
no_license
import { Proveedor } from './Proveedor'; export class Materiales{ /** * * @param Id Id de la entidad * @param Nombre Nombre del material * @param Descripcion Descripción del material * @param Precio Precio unitario del producto * @param Categoria Categoria del producto * @pa...
Python
UTF-8
2,453
3.734375
4
[]
no_license
''' Facebook_Medium 11.06 11:29pm ''' from collections import deque class WordDictionary(object): def __init__(self): """ Initialize your data structure here. """ self.root = Trie('') def addWord(self, word): """ Adds a word into the data structure. :ty...
Python
UTF-8
1,367
2.6875
3
[]
no_license
import unittest from training.app import app from training.extensions import db class SetUpAndTearDown(unittest.TestCase): """ Solution from: https://gist.github.com/twolfson/13f5f5784f67fd49b245 The following code offers the possibility to have a common setUp and a tearDown, and also add a particul...
Python
UTF-8
418
4.0625
4
[]
no_license
a, b = 1, 2 # данные числа geom = (a + b) / 2 # находим среднее геометрическое arth = (a * b) ** 0.5 # находим среднее арифметическое # вывод результатов print("a =", a) print("b =", b) print("Среднее арифметическое: ", arth) print("Среднее геометрическое: ", geom)
Swift
UTF-8
623
2.546875
3
[ "MIT" ]
permissive
// // UIKitSpellBook.swift // UIKitSpellBook // // Created by Steve Sheets on 1/10/21. // Copyright © 2021 Steve Sheets. All rights reserved. import Foundation import UIKit import SwiftSpellBook // MARK: - Struct /// Abstract extension for name space of typealias & static functions. public struct UIKitSpellBook ...
C#
UTF-8
1,404
2.75
3
[ "MIT" ]
permissive
namespace Plugin.LocalNotification { /// <summary> /// NotificationRequest for iOS /// </summary> public class iOSOptionsBuilder { private bool HideForegroundAlert; private bool PlayForegroundSound; internal iOSOptionsBuilder() { } /// <summary> ...
Java
UTF-8
1,455
2.453125
2
[]
no_license
package com.zsw.zeng.helloapplication.widget; import android.app.Dialog; import android.content.Context; import com.zsw.zeng.helloapplication.R; /** * @author ZengSuWa * @Description:加载圈 * @Company:众鑫贷 * @Created time:2017/3/10 14:41 */ public class ProgressDialog { private Dialog dialog; private Conte...
C++
UTF-8
2,977
2.71875
3
[]
no_license
/******************************************************************************* * File: color_f.cpp * Author: Tycoon (tycoon@planetdescent.com) * Date: 3 December 2003 *******************************************************************************/ /////////////////////////////////////////////////////////////...
C++
UTF-8
2,118
3.0625
3
[]
no_license
#include "cltime.h" using namespace std; /* all represented in seconds */ double clMinute = 60; double clHour = 60 * clMinute; double clDay = 24 * clHour; double durationFromUnit(double n, string unit) { if (unit == "d") { return n * clDay; } else if (unit == "h") { return n * clHour; } else if (un...
C++
UTF-8
313
2.59375
3
[]
no_license
#include <terminalCandidato.h> terminalCandidato::terminalCandidato(polo *reference) { this->reference = reference; } int terminalCandidato::getIndex() { return index; } void terminalCandidato::setIndex(int index) { this->index = index; } polo *terminalCandidato::getReference() { return reference; }
Python
UTF-8
376
2.90625
3
[]
no_license
from wand.image import Image from wand.drawing import Drawing import os import shutil import pprint def make_thumbs(): img = Image(filename='square.jpg') w, h = img.size with Drawing() as draw: draw.line((0, 0), (w, h)) draw.line((0, h), (w , 0)) draw(img) img.format = 'jpeg'...
C#
UTF-8
10,526
3.0625
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using Epam.Task7.BLL.Interface; using Epam.Task7.Common; using Epam.Task7.Entities; using Epam.Task7.Entities.Exceptions; namespace Epam.Task7.UsersAndAwards { ...
C
UTF-8
877
3.765625
4
[]
no_license
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int extOddDigits1(int num); void extOddDigits2(int num, int *result); int main() { int number, result = -1; printf("Enter the number: \n"); scanf("%d", &number); printf("extOddDigits1(): %d\n", extOddDigits1(number)); extOddDigits2(number, &result); ...
Markdown
UTF-8
1,277
3.84375
4
[]
no_license
`Atomics.wait()`方法的使用格式如下。 ```javascript Atomics.wait(sharedArray, index, value, timeout) ``` 它的四个参数含义如下。 - sharedArray:共享内存的视图数组。 - index:视图数据的位置(从0开始)。 - value:该位置的预期值。一旦实际值等于预期值,就进入休眠。 - timeout:整数,表示过了这个时间以后,就自动唤醒,单位毫秒。该参数可选,默认值是`Infinity`,即无限期的休眠,只有通过`Atomics.wake()`方法才能唤醒。 `Atomics.wait()`的返回值是一个...
Python
UTF-8
1,822
2.625
3
[]
no_license
# -*- coding: utf-8 -*- ''' 作者: 郑阔 日期: 2018.05.23 版本: 1.0 完成该网站的爬虫程序 该网站为投诉类网站 需要采集的字段有 投诉信息 title user_name date comment_num main_body 评论信息 user_name time main_body ''' from scrapy import Request from vivo_public_modules.spiders.vivo_base_spider import VivoBaseSpider class IndiaConsumerForumSpider(VivoBaseSpider): ...
Python
UTF-8
710
4.53125
5
[]
no_license
fish = "halibut" # Loop through each letter in the string # and push to an array letters = [] print(letters) # List comprehensions provide concise syntax for creating lists print(letters) # We can manipulate each element as we go capital_letters = [] for letter in fish: capital_letters.append(letter.upper())...
JavaScript
UTF-8
15,343
2.890625
3
[]
no_license
/****** Imports and Necessary DOM Elements ******/ import { ariaHideModal, ariaShowModal } from './modals.js' const newPostToggle = document.querySelector('.new-post-button') const editPostToggle = document.querySelector('.edit-post-button') const newPostForm = document.querySelector('#new-form') const editPostForm = d...
PHP
UTF-8
2,069
2.796875
3
[]
no_license
<?php namespace Dyn\TrafficManagement\Record; class NAPTR extends AbstractRecord { /** * @var string */ protected $type = 'PX'; /** * Sets priority for processing records of the same type. Lowest value is processed first. * * @var string */ protected $preference; /*...
C++
UTF-8
2,198
2.6875
3
[ "Apache-2.0" ]
permissive
#include "TimerWheel.h" #include "LinuxTimer.h" #include "TransactionContext.h" #include "log.h" #include <ostream> #include <cassert> TimerWheel::TimerWheel() : head_(0) { // empty } void TimerWheel::store_context(TransactionContext* const ctx) { assert(ctx); // Calculate bucket. Fine grained adjustment...