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
1,263
2.828125
3
[]
no_license
#include <cstdio> #include <vector> #include <map> #include <algorithm> #include <cassert> int main() { std::vector<char> step; while (true) { char c; scanf(" %c", &c); if (c == 'P') continue; if (c == 'K') break; step.push_back(c); } if (step.empty()) { puts("0"); return 0; } s...
Java
UTF-8
8,921
1.773438
2
[ "Apache-2.0" ]
permissive
package com.kzmen.sczxjf.ui.fragment.kzmessage; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android....
Python
UTF-8
517
3.65625
4
[]
no_license
def solucao(frase): letras = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] count = 0 for i in letras: if frase.find(i) != -1: count += 1 if count == 26: return "frase completa" ...
Markdown
UTF-8
4,812
2.578125
3
[]
no_license
## About Currently this framework has been developed to run scripts on Chrome Browser and windows Platform To run the suite on different browser and platform changes in "wdio.conf.js" file will be required. ### Tech Stack * [Selenium Service] - This is a node based CLI library for launching Selenium with WebDrivers ...
Markdown
UTF-8
878
2.609375
3
[ "Apache-2.0" ]
permissive
##### How to import from a URL Any publicly accessible CSV or JSON file can be uploaded via import. An import allows you to load any size file as opposed to the 1MB limit on uploaded files. The import will run in the background via the Nexosis API and should complete within a minute or two depending on file size. Our A...
Java
UTF-8
2,812
1.585938
2
[]
no_license
package com.google.android.exoplayer2.text.p135f; import android.text.TextUtils; import com.google.android.exoplayer2.p126c.C2175k; import com.google.android.exoplayer2.text.C2348d; import com.google.android.exoplayer2.text.C4693b; import com.google.android.exoplayer2.text.SubtitleDecoderException; import com.google.a...
JavaScript
UTF-8
2,032
3.25
3
[]
no_license
var $ = require("jquery"); $("document").ready(function() { var va1, va2, va3, vb1, vb2, vb3, vc1, vc2, vc3 = ''; function vales() { va1 = $(".a1").html(); va2 = $(".a2").html(); va3 = $(".a3").html(); vb1 = $(".b1").html(); vb2 = $(".b2").html(); vb3 = $(".b3").html(); vc1 = $(".c1").h...
C++
UTF-8
2,655
2.90625
3
[ "MIT" ]
permissive
#include <algorithm> #include <numeric> #include <utility> #include <vector> #include <glm/glm.hpp> #include "kaacore/exceptions.h" #include "kaacore/geometry.h" namespace kaacore { int8_t compare_points(const glm::dvec2 p, const glm::dvec2 q) { if (p.x < q.x) { return -1; } else if (p.x > q.x) { ...
Java
UTF-8
322
2.4375
2
[]
no_license
package designPatterns.singleton; /** * @author non * @version 1.0 * @date 2019/9/18 11:21 */ public class HungrySingleton { private static HungrySingleton singleton = new HungrySingleton(); private HungrySingleton(){ } public static HungrySingleton getInstance(){ return singleton; } ...
C
UTF-8
196
2.984375
3
[]
no_license
#include<stdio.h> int main() { int i=10; char ch='a'; float f=23.5f; void *p; p=&i; printf("%d\n",*(int *)p); p=&ch; printf("%c\n",*(char *)p); p=&f; printf("%f\n",*(float *)p); return 0; }
Java
UTF-8
473
1.882813
2
[]
no_license
package com.sftc.web.model.vo.swaggerRequest; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; /** * Created by xf on 2017/10/18. */ @ApiModel(value = "更新通知消息已读请求包装类") public class UpdateIsReadVO { @Getter @Setter @ApiModelP...
PHP
UTF-8
2,309
3.203125
3
[]
no_license
<?php namespace App\Domain\Measurement; use App\Domain\Cycle\Cycle; use JsonSerializable; use DateTime; class Measurement implements JsonSerializable{ private $id; private $cycle; private $temperature; private $humidity; private $date; /** * Measurement constructor. * @param $id ...
Markdown
UTF-8
3,602
3.453125
3
[ "MIT" ]
permissive
title:如何编写高扩展且可维护的 JavaScript disc:如何编写高扩展且可维护的 JavaScript :模块 type:JavaScript ------------------ ##通常的 JavaScript 模块 使用原生 JavaScript 实现模块是相对容易的,但是已经存在很多的模式随便你使用。每种模式可以说是各有利弊。这里会包含这些模式中的几个,但没有顾及那个最适合你的选择。多数时候,会取决于你的偏好以及哪个在你指定的场景下工作的最好。对于哪个模块实现是最好的,网上没有什么明确的意见。所以,如果不确定可以随便去搜索一下。 ##我们现在开始。 JavaScript 模块可以像 JavaScript...
C#
UTF-8
1,959
3.109375
3
[ "MIT" ]
permissive
using SEDC.Exercise.TryBeingFit.Domain; using SEDC.Exercise.TryBeingFit.Domain.Core.Enums; using SEDC.Exercise.TryBeingFit.Services.Helpers; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SEDC.Exercise.TryBeingFit.Services.Services { public class UIService { ...
Java
UTF-8
2,020
2.671875
3
[]
no_license
package com.twparser.processing; import javax.net.ssl.HttpsURLConnection; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.CookieHandler; import java.net.CookieManager; import java.net.URL; import java.util.List; /** * handles */ public class URLManager { private static String ur...
Java
UTF-8
4,442
2.140625
2
[ "Apache-2.0" ]
permissive
package com.google.inject.spi; import com.google.inject.AbstractModule; import com.google.inject.Binder; import com.google.inject.Module; import junit.framework.TestCase; /** Tests for {@link ModuleSource}. */ public class ModuleSourceTest extends TestCase { private static final StackTraceElement BINDER_INSTALL = ...
Markdown
UTF-8
671
2.609375
3
[ "MIT" ]
permissive
# How can I store and review all my ideas of new business ideas? An interesting approach for developing new or documenting existing business models on a single page is the Business Model Canvas - Wikipedia, which was developed by Alexander Osterwalder. You can download a PDF template for it: https://canvanizer.com/d...
C#
UTF-8
1,007
2.546875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace AdviesOpMaatASP.NET.Classes { public class Gebruiker { public string Gebruikersnaam { get; set; } public string Wachtwoord { get; set; } public string Rol { get; set; } p...
Java
UTF-8
1,375
2.265625
2
[ "MIT" ]
permissive
package net.foreworld.util.verifycode; import java.io.IOException; import javax.servlet.Servlet; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import net...
C
GB18030
8,698
2.75
3
[]
no_license
//ܣ༭ؼĩβı //1༭ //2ַָ //3ӺǷ BOOL AddTextToEdit(HWND hEdit,char *szTxt,BOOL bNextLine) { static char NextLine[]={13,10,0}; SendMessage(hEdit,EM_SETSEL,-2,-1); SendMessage(hEdit,EM_REPLACESEL,0,(long)szTxt); if(bNextLine) SendMessage(hEdit,EM_REPLACESEL,0,(long)NextLine); return 1; } //ܣִCMDܵţִһԵ̣ /...
Swift
UTF-8
1,075
3.21875
3
[ "MIT" ]
permissive
// // MedicineTimings.swift // MedTracker // // Created by Shakti Prakash Srichandan on 23/06/21. // import Foundation import UIKit enum MedicineTimings: String, CaseIterable { case morning = "Morning" case afternoon = "AfterNoon" case night = "Night" func getReminderMessageAndTime() -> ...
C++
UTF-8
1,469
3.140625
3
[]
no_license
//////////////////////////////////////////////////////////////////////////////// // Filename: inputclass.cpp //////////////////////////////////////////////////////////////////////////////// #include "inputclass.h" InputClass::InputClass() { } InputClass::InputClass(const InputClass& other) { } InputClass::~InputC...
Java
UTF-8
534
2.546875
3
[]
no_license
package escudos; import javax.swing.Icon; import javax.swing.ImageIcon; public class Escudo_Madera extends Escudo{ public static final String TIPOBBDD = "Escudo de madera"; public Escudo_Madera() { } @Override public String nombre() { return "Escudo de madera"; } @Override public int bonusDef() { retu...
C#
UTF-8
692
2.546875
3
[]
no_license
using System; using JetBrains.Annotations; namespace Gamefication.PeriodicTasks { public static class PeriodicTaskRunnerExtensions { public static void Register([NotNull] this IPeriodicTaskRunner periodicTaskRunner, [NotNull] string taskId, TimeSpan period, [NotNull] Action taskAction) ...
JavaScript
UTF-8
2,259
3.703125
4
[]
no_license
let x=10; const y=20; console.log(x); x="Hello world"; console.log(x); x=[1,2,3,4,5,6,7]; console.log(x); console.log(x.length); console.log(x[2]); console.log("This i sa string"); console.log('A'); console.table(x) console.error("error message"); console.debug("Debug Message") console.time("myForLoop"); for(let i=0...
Ruby
UTF-8
952
3.015625
3
[ "MIT" ]
permissive
# Caption class that contains all the variables needed to render a caption class Caption def initialize(label, figure) if figure.key?("custom") @label = label @custom = figure["custom"] @img = figure["img"] else @label = label @artist = figure["artist"] @title = figure["title"] ...
JavaScript
UTF-8
1,025
2.96875
3
[]
no_license
let elems = document.querySelectorAll('input, textarea'); window.onload = () => { if ('serviceWorker' in navigator) { navigator.serviceWorker.register('./service-worker.js', { scope: './' }) .then((reg) => { reg.update().catch(err => console.warn(err)); }).catch((error) => { console.warn...
Python
UTF-8
872
3
3
[]
no_license
#!/usr/bin/env python3 import numpy as np from scipy.optimize import leastsq import matplotlib.pyplot as plt def real_func(x): return np.sin(2 * np.pi * x) def fit_func(p, x): f = np.poly1d(p) return f(x) def residuals_func(p, x, y): ret = fit_func(p, x) - y return ret x_points = np.linspace(0, ...
Python
UTF-8
578
2.984375
3
[]
no_license
# # @lc app=leetcode.cn id=322 lang=python3 # # [322] 零钱兑换 # # @lc code=start class Solution: def coinChange(self, coins: List[int], amount: int) -> int: # 记录表中amount+1等价于无穷大 table = [(amount + 1) for _ in range(amount + 1)] table[0] = 0 for i in range(1, amount + 1): f...
Markdown
UTF-8
5,061
3.890625
4
[ "MIT" ]
permissive
# JavaScript 展開與其餘 ![](https://firebasestorage.googleapis.com/v0/b/casper-de5d5.appspot.com/o/images%2Fblog%2F201712%2F18_ironman_cover_21.jpg?alt=media&token=dc0c2214-73bf-4ad6-be70-257e52f337e7) 這兩個分別稱為 展開運算子(`spread operator`) 及 其餘運算子 (`rest operator`,也可稱為其餘參數),這兩個運算符有個兩個特點,就是都與陣列有關係,除此之外他都是 `...`;第一次看到這樣的符號出現在 J...
Java
UTF-8
1,250
2.71875
3
[]
no_license
//@author A0114463M package logic; import java.util.ArrayList; import application.Task; /** * All handlers that performs changes to memory (such as add, delete or edit) * shall extend this class. UndoHandlers and RedoHandlers shall also extend this * class to access the changes and be able to revoke them. * Undo...
C++
UTF-8
516
2.875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int ones(int arr[], int n){ if(arr[0] == 0){ return 0; } int low = 0; int high = n-1; while(low<=high){ int mid = (low+high)/2; if(arr[mid]==1){ if(arr[mid+1]==0){ return mid+1; }else{ ...
Python
UTF-8
3,134
2.78125
3
[]
no_license
#!/usr/bin/env python # coding: utf-8 # In[58]: def ratingdrv(data): import pandas as pd import numpy as np data = pd.read_csv("/home/ramanan/Documents/Work/26dec/Day26trips/date26trip4.csv") data = data[~(data['speed'] <= 5)] speed = data['speed'] speed = speed.dropna() maxspeed = ...
C#
UTF-8
1,397
2.734375
3
[]
no_license
using TouchForFood.Models; using System.Linq; using System; using TouchForFood.Exceptions; using System.Data; using System.Collections.Generic; using TouchForFood.Mappers.Abstract; namespace TouchForFood.Mappers { public class WaiterOM : GenericOM { public WaiterOM() :base(){} public WaiterOM(...
PHP
UTF-8
1,242
2.71875
3
[ "MIT" ]
permissive
<?php declare(strict_types=1); namespace PhpImplementations\Cli; use Auryn\Injector; use League\CLImate\CLImate; use League\CLImate\TerminalObject\Dynamic\Progress; use PhpImplementations\Url\Parser\MathiasBynens as MathiasBynensParser; use PhpImplementations\Url\Retriever\MathiasBynens as MathiasBynensRetriever; re...
C#
UTF-8
3,228
2.671875
3
[ "Zlib", "MIT" ]
permissive
using System; using System.IO; using Gibbed.Helpers; namespace Gibbed.Illusion.FileFormats { public class SdsConfigFile { public void Deserialize(Stream input) { if (input.ReadValueU32() != 0x73647370) { throw new FormatException("not an SDS config file"...
JavaScript
UTF-8
473
3.0625
3
[]
no_license
// Emulate the code academy environment so that laser cats can run in jsc // Defines a 'console' like class that has a log function that utilizes jsc's 'debug' // funtion to print strings to the terminal var console = { log: function(output) { debug(output) } }; // Defines a new prompt function based on j...
Swift
UTF-8
3,459
2.578125
3
[]
no_license
// // MapViewController.swift // BillMates // // Created by Lucas Rocali on 6/8/15. // Copyright (c) 2015 Lucas Rocali. All rights reserved. // import UIKit import CoreLocation import MapKit class MapViewController: UIViewController, CLLocationManagerDelegate { var model = Model.sharedInstance @...
JavaScript
UTF-8
178
2.59375
3
[ "MIT" ]
permissive
var overlays = document.querySelectorAll('.meter_overlay'); for(var i = 0; i < overlays.length; i++) { var overlay = overlays[i]; overlay.parentNode.removeChild(overlay); }
C
UTF-8
405
2.921875
3
[]
no_license
#include <stdint.h> #include "Compatibility.h" /* XXX I don't like the name of this file */ typedef enum { NUM_DIGITS = 5, } NumDigits; inline void GetDigits(uint16_t n, uint8_t *digits) { uint8_t i = NUM_DIGITS - 1; while (1) { uint16_t newN = n / 10; digits[i] = n - newN * 10; ...
Python
UTF-8
1,764
3.625
4
[]
no_license
#!/usr/bin/python3 """unit_test.py: Testing to make sure that the unweighted undirected graph class functions are working """ import unittest from node import Node from graph import Graph class UnitTest(unittest.TestCase): """UnitTest""" def test_add_node(self): """test_add_node: Testing adding a ne...
Java
UTF-8
866
2.46875
2
[]
no_license
package com.wellsfargo.fsd.jw.servlet; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebSer...
Java
UTF-8
1,612
2.921875
3
[]
no_license
package Pontos; /** * * @author a15023 */ /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ import Dados.Dados; import java.awt.*; import java.awt.event.*; import java.awt.geom.*;...
JavaScript
UTF-8
2,635
2.953125
3
[]
no_license
import challenges from "../assets/challenges.json"; let countdownTimeout; export const state = () => ({ //challenges level: 1, currentExperience: 0, challengesCompleted: 0, activeChallenge: null, experienceToNextLevel: 64, isLevelUpModalOpen: false, //countdown time: 25 * 60, isActive: false, ha...
SQL
UTF-8
7,436
4.375
4
[]
no_license
------------------- QUESTION 1 ----------------------------------------------------------- -- 1. Show the total sales (quantity sold and dollar value) for each customer. -- -- This is a strange query...why would I want to track the quantity and not track the product. -- Quantity of what? Let's see highest sales.. --...
Python
UTF-8
3,639
2.859375
3
[]
no_license
# coding=UTF-8 import vk from vk_parsing.parser import send_message # Several tokens for 1 user don't work. Need to buy more vk pages. _user_tokens = ['put your user token here', 'like this' ] _service_tokens = [ 'put your service tokens here', 'as much as possible'] # Split...
TypeScript
UTF-8
2,698
3.171875
3
[ "Apache-2.0" ]
permissive
import { Guard } from "./guard"; const message: string = "Unhandled exception"; describe("Shared", () => { describe("Guard", () => { describe("throwIfObjectUndefined", () => { it("should throw for undefined object", () => { expect(() => Guard.throwIfObjectUndefined(undefined, me...
Java
UTF-8
7,645
1.945313
2
[ "Apache-2.0" ]
permissive
package yhao.micro.service.surety.business.apilist.model; import io.swagger.annotations.ApiModelProperty; import yhao.infra.common.model.Entity; import yhao.micro.service.surety.business.apilist.form.guarantee.LoanDetailsSaveForm; import yhao.micro.service.surety.business.apilist.form.guarantee.LoanGeneralSaveForm; i...
Java
UTF-8
132
1.914063
2
[ "MIT" ]
permissive
package com.javasummerschool.multiple_interfaces; public interface IStudent extends IWork, IIntership { void bagToTeacher(); }
Markdown
UTF-8
1,322
2.921875
3
[ "MIT" ]
permissive
# Laravel 5.1 benchmarks Quick-and-dirty Laravel 5.1 Benchmarks for Cache, DB, Session, etc. To see exactly what this benchmark is doing, look at [`resources/views/benchmark.php`](resources/views/benchmark.php) -- it is a standalone file running on stock Laravel 5.1. Sample run on Linode with xdebug disabled: ![Sampl...
C#
UTF-8
1,521
2.921875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestPerson { class Program { static void Main(string[] args) { Person person1 = new Player("Florin", "Nicorici", "chaos28"); System.Console.Wri...
PHP
UTF-8
11,676
2.546875
3
[ "BSD-3-Clause" ]
permissive
<?php defined('SYSPATH') OR die('No direct script access.'); use Omnipay\Common\GatewayInterface; /** * @package Openbuildings\Purchases * @author Ivan Kerin <ikerin@gmail.com> * @copyright (c) 2013 OpenBuildings Ltd. * @license http://spdx.org/licenses/BSD-3-Clause */ class Kohana_Model_Payment exten...
TypeScript
UTF-8
203
2.546875
3
[ "MIT" ]
permissive
export default interface ILogger { fatal: (message: any) => void; error: (message: any) => void; warning: (message: any) => void; info: (message: any) => void; debug: (message: any) => void; }
Java
UTF-8
1,103
2.1875
2
[]
no_license
package com.muzihok.web.entity; import java.util.Date; public class BoardView extends Board { private int commentCount; public BoardView() { super(); } public BoardView(int commentCount) { super(); this.commentCount = commentCount; } public BoardView(int id, String title, String write...
Java
UTF-8
1,538
2.359375
2
[]
no_license
package com.nationwide.individualproject.data; import javax.persistence.*; @Entity @Table(name="`lead`") public class Lead { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; private String grade; private String height; private String dateNum; private String location...
C++
UTF-8
1,125
3.453125
3
[]
no_license
#include<iostream> #include<chrono> struct Timer { std::chrono::steady_clock::time_point start, end; std::chrono::duration<float> duration; const char* name; Timer(const char* name) :name(name) { start = std::chrono::high_resolution_clock::now(); } ~Timer() { end = std::chrono::high_resolution_clock::now(); ...
Java
WINDOWS-1252
2,593
2.078125
2
[]
no_license
package spring.myapp.shoppingmall.service; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import or...
C++
UTF-8
275
2.75
3
[]
no_license
#include <iostream> #include <stdlib.h> using namespace std; int main() { cout<<"segmento codigo: "<<(void *) main<<"\r\n"; cout<<"segmento heap : "<<(void *) malloc(1)<<"\r\n"; int x = 3; cout<<"segmento stack: "<<(void *) &x<<"\r\n"; sleep(6000); return 0; }
Java
UTF-8
3,276
2.578125
3
[]
no_license
package be.kdg.se3.transportss.adapters.in; import be.kdg.se3.proxy.ConveyorServiceProxy; import be.kdg.se3.transportss.adapters.in.entity.Conveyor; import be.kdg.se3.transportss.routing.entity.ConveyorTimes; import be.kdg.se3.transportss.routing.service.ConveyorService; import be.kdg.se3.transportss.simulator.service...
Shell
UTF-8
683
2.984375
3
[ "Apache-2.0" ]
permissive
#!/usr/bin/env bash <% if link('routing_api_db').p('release_level_backup') %> set -ex JOB_PATH="/var/vcap/jobs/bbr-routingdb" SDK_PATH="/var/vcap/jobs/database-backup-restorer" # Anything placed in the BBR_ARTIFACT_DIRECTORY by the backup script will be available to the restore script at restore time. # The BBR CLI i...
Java
UTF-8
520
1.859375
2
[ "Apache-2.0" ]
permissive
package com.kloia.evented; import com.datastax.driver.core.querybuilder.Clause; import java.util.List; import java.util.UUID; /** * Created by zeldalozdemir on 23/02/2017. */ public interface Query<T extends Entity> { T queryEntity(String entityId) throws EventStoreException; List<T> queryByOpId(UUID opI...
JavaScript
UTF-8
5,383
3.359375
3
[]
no_license
import {Matrix} from "../Math/Matrix"; import {Vector2f} from "../Math/Vector2f"; export class AutoTile { /** * GroupedTile constructor. * * @param name * @param tiles */ constructor(name, tiles) { this.name = name; this.tiles = new Matrix(new Vector2f(3, 4)); ...
C#
UTF-8
691
3.734375
4
[ "MIT" ]
permissive
using System; class DecimalToBinary { static void Main() { Console.Write("Please enter the decimal number you want to convert: "); int number = int.Parse(Console.ReadLine()); int devided = number; int remainder = 0; string reversedBinNum = string.Empty; while (d...
Markdown
UTF-8
3,104
3
3
[]
no_license
--- title: "Adding Last-Modified response header to Haskell Servant API" tags: ['code', 'haskell', 'servant'] date: 2018-09-30 layout: 'post' --- Given the following [Servant API](https://haskell-servant.github.io/) (boilerplate redacted for brevity): ``` haskell type MyAPI = "some-api" :> Get '[JSON] NoContent some...
Shell
UTF-8
857
2.953125
3
[]
no_license
#!/bin/bash # Run pre-removal scripts on upgrade if defined if [ $1 = upgrade ] && [ -n $2 ] ; then : no preremove scripts provided fi # Run pre-removal scripts on removal if defined if [ $1 = remove ] && [ -z $2 ] ; then : no preremove scripts provided fi # switch based on systemd vs systemv # if [ "$1" = remov...
C#
UTF-8
593
2.546875
3
[]
no_license
using AdapterPatternApp.Classes; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AdapterPatternApp { class AdapterPatternDemo { static void Main(string[] args) { AudioPlayer _audioPlayer = new AudioPlayer...
Java
UTF-8
2,087
2.40625
2
[ "Apache-2.0" ]
permissive
package com.chen.schart.http; import java.io.IOException; import java.util.concurrent.TimeUnit; import okhttp3.Interceptor; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; import okhttp3.logging.HttpLoggingInterceptor; import retrofit2.Retrofit; import retrofit2.adapter.rxjava2.RxJava2Ca...
Markdown
UTF-8
372
3.4375
3
[ "MIT" ]
permissive
# Description Given an integers array `A`. Define `B[i] = A[0] * ... * A[i-1] * A[i+1] * ... * A[n-1]`, calculate B **WITHOUT** divide operation.Out put `B` # Example ## Example 1 ``` Input: A = [1, 2, 3] Output: [6, 3, 2] Explanation:B[0] = A[1] * A[2] = 6; B[1] = A[0] * A[2] = 3; B[2] = A[0] * A[1] = 2 ``` Example ...
PHP
UTF-8
1,014
2.625
3
[]
no_license
<?php namespace WikidataSearch\Console; use WikibaseDumpProcessor\Services; use WikidataSearch\Console\Commands\BuildMappingCommand; use WikidataSearch\Console\Commands\CreateIndexCommand; use WikidataSearch\Console\Commands\DeleteIndexCommand; use WikidataSearch\Console\Commands\ProcessDumpCommand; class CommandReg...
JavaScript
UTF-8
1,258
3.203125
3
[]
no_license
const users = ['Perfil 1','Alguien','Nicolái']; const memberDiv = document.querySelector('.memberDiv'); const addIcon = document.querySelector('.addIcon'); const userIcons = () => { users.reverse(); users.map((curElem) => { memberDiv.insertAdjacentHTML('afterbegin', ` <button class="btn"><sp...
JavaScript
UTF-8
3,257
3.96875
4
[]
no_license
// List of words to guess var wordArray = ["ACDC", "AEROSMITH", "RADIOHEAD", "METALLICA", "NIRVANA", "PRINCE", "COLDPLAY", "TRAIN", "EMINEM", "BEYONCE"]; // Word to guess var ...
JavaScript
UTF-8
409
3.71875
4
[ "MIT" ]
permissive
// // Generate the Fibonacci sequence up to the maximum 32 bits signed integer // var x0 = 0, x1 = 1, x; try { var i = 1; while (1) { // Check whether the next sum will overflow or not if (0x7fffffff - x1 <= x0) { throw 1; // overflow } x = x1 + x0; x0 = x1; x1 = x; printf("%2d | %1...
Java
UTF-8
526
2.03125
2
[]
no_license
package custom.zUtil.io; import basic.zBasic.ExceptionZZZ; import basic.zUtil.io.KernelFileExpansionZZZ; public class FileExpansionZZZ extends KernelFileExpansionZZZ{ public FileExpansionZZZ() throws ExceptionZZZ { super(); } public FileExpansionZZZ(char cFilling, int iExpansionLength) { super(cFilling, iExpan...
TypeScript
UTF-8
753
2.625
3
[]
no_license
// const response = await fetch("http://my.json.host/data.json"); // console.log(response.status); // e.g. 200 // console.log(response.statusText); // e.g. "OK" // const jsonData = await response.json(); // async function downloadData(){ // const response = await fetch("https://api.spacexdata.com/v4/launches",{me...
JavaScript
UTF-8
1,704
2.59375
3
[ "MIT" ]
permissive
import User from '../models/user'; import Helper from '../helper/helper'; const { comparePassword, generateToken, hashPassword } = Helper; /** * * * @export * @class UserService */ export default class UserService { /** * * Handles the logic to login user * @static * @param {Objeect} credential the...
C++
UTF-8
2,822
2.859375
3
[]
no_license
#ifndef ADV_HUFFMAN_H #define ADV_HUFFMAN_H #include "Node.h" #include <QString> #include <iostream> using namespace std; class AdvHuffman { public: AdvHuffman(); void Decoding(const char* inputFile, QString outPath); void Encoding(const char* inputFile, const char* outputFile, double *entrpy, double *bp...
C
UTF-8
2,332
3.390625
3
[]
no_license
//1: //Which storage classes create variables local to the function containing them? //automatic, internal linkage, block scope //2: //Which storage classes create variables that persist for the duration of the containing program? //any class that has static duration //3: //Which storage class creates variables t...
C++
GB18030
6,077
2.890625
3
[]
no_license
#include "MathMethod.h" #include "Math.h" #include "ObjectManager.h" #include "PD.h" #include <algorithm> bool MathMethod::equal(double a, double b, double speed){ return (fabs(a - b) <= speed / 2); } int MathMethod::smaller(int a, int b){ if (a<b) return a; else return b; } int MathMethod::bigger(int a, int...
C
UTF-8
1,214
3.859375
4
[]
no_license
/* Lab 4a Task 3 */ #include <stdio.h> int main (void) { /*Step a): Try to predict the result of the following do loop: */ //result: 9834, 938, 93, 9 int i = 9384; do { printf("%d \n", i); i /= 10; } while (i>0); printf("\n\n\n"); /* Test you predict...
Python
UTF-8
25,205
2.609375
3
[]
no_license
import pygame as pg import pygame as pg from os import path from rocket import * from enums import * from physics import * from planet import * from obstacles import * import sys class Game: def __init__(self): pg.init() self.WIDTH, self.HEIGHT = 800, 1000 self.screen = pg.display.set_mode...
Python
UTF-8
2,258
2.84375
3
[ "MIT" ]
permissive
from primitives import * from io import StringIO import pickle import csv import re class BaseParser: data = "" def __init__(self): self._str_ops = [] self._s2l_ops = [] self._clean_ops = [] def load_data(self, filename): stream = open(filename) self.data = stream...
C#
UTF-8
10,377
2.75
3
[]
no_license
using System; using System.ComponentModel; using System.Windows.Controls; using Coding4Fun.Phone.Controls; using Microsoft.Phone.Scheduler; //for the reminders. Pretty sure they shouldn't be in this class? where do they fit in mvvm? using PAX7.Utilicode; //settings namespace PAX7.Model { public class Event : INo...
JavaScript
UTF-8
373
2.671875
3
[ "MIT" ]
permissive
const ingredientsReducerDefaultState = []; export default (state = ingredientsReducerDefaultState, action) => { switch (action.type) { case 'SET_INGREDIENTS': return action.ingredients; case 'DELETE_INGREDIENT': return state.filter((ingredient) => ingredient.id != action.id)...
C#
UTF-8
1,446
2.734375
3
[]
no_license
using Imposto.Core.ValueObjects; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Imposto.Core.Domain { public class PedidoItem : IValidator { public PedidoItem(string nomeProduto, string codigoProduto, decimal valorItemPedid...
Markdown
UTF-8
7,397
2.734375
3
[]
no_license
第四十三回 毅力虔心十年待知己 盗名欺世一旦现原形(4) 曾静见问不出所以然来,也便罢了。那两名武士要了曾静左右的两间房间,吃过饭后,二更时分,装作同路人来访,进入曾静房间,悄悄说道:“曾老先生,令晚你可得小心点儿!”曾静吓道:“你们两位发现了什么不妥吗?你们可得救救我的性命,我说,不如换了客店吧!” 那两名武士乃是年羹尧的心腹武土,惧有非常武艺,听了曾静之言,淡淡笑道:“替你定房的人不问可知,定是吕留良的遗孽,我们定要等他到来,怎好换店?”曾静不好言语,心中暗暗吃惊。想道:“这两人不知是不是吕四娘的对手?咳,吕四娘杀了他们固然不好,他们杀了吕四娘更不好。吕家兄弟和我到底是生前知交,我怎忍见他家被斩草除根。...
JavaScript
UTF-8
3,877
2.875
3
[]
no_license
var mysql = require('mysql'); module.exports = { init : function(host, user, password){ init(host, user, password); }, insert_site: function (site, callback) { insert_site(site, callback); }, insert_photo: function (photo, callback) { insert_photo(photo, callback); }, terminate : function(){ ...
C++
UTF-8
1,148
3.015625
3
[]
no_license
#pragma once #pragma once #include "Slot.h" using namespace std; class Player ; #define INTEREST 20//2000% enum city_group {City1 = 1, City2, City3, City4 }; class Asset : public Slot { city_group city; const int house_price; int rent_price; Player* ownership; int pawned_years; public: Asset(st...
Java
UTF-8
1,211
2.734375
3
[]
no_license
import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.net.Socket; public class RPCClient { public static void main(String[] args) { HelloService helloService = getClient(H...
Java
UTF-8
5,496
2.421875
2
[]
no_license
package study.spring.goodspring.service.impl; import java.util.List; import org.apache.ibatis.session.SqlSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import lombok.extern.slf4j.Slf4j; import study.spring.goodspring.model.AdminInquiry; import s...
Java
UTF-8
4,571
1.734375
2
[]
no_license
/* * This content is generated from the API File Info. * (Alt+Shift+Ctrl+I). * * @desc * @file artboard_15 * @date 0 * @title Artboard 15 * @author * @keywords * @generator Export Kit v1.2.8.xd * */ package exportkit.xd; import android.app.Activity; import android.os.Bundl...
Java
UTF-8
7,671
1.726563
2
[ "GPL-1.0-or-later", "GPL-3.0-only", "Apache-2.0", "LicenseRef-scancode-public-domain", "LGPL-2.1-only", "LicenseRef-scancode-unknown-license-reference" ]
permissive
/* ### * IP: GHIDRA * * 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 agreed to in writin...
Java
UTF-8
2,390
2.8125
3
[]
no_license
package com.codetest.customerapp.DAO; import java.util.List; import org.apache.log4j.Logger; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.stereotype.Repository; import com.codetest.customerapp.model.Customer; /** * The Class CustomerDAOImpl. */ @Repository public c...
C#
UTF-8
584
2.515625
3
[ "MIT" ]
permissive
using System.Collections.Generic; using PEG.Cst; namespace PEG.SyntaxTree { public abstract class Terminal : Expression, ICstTerminalNode { Terminal ICstTerminalNode.Terminal { get { return this; } } public IEnumerable<OutputRecord> AsResult(int position) { ...
Java
UTF-8
742
2.578125
3
[]
no_license
package cpscala.TSolver.CpUtil; import java.lang.*; public class SingleBitSet { long value = JConstants.ALLONELONG; int capacity; public SingleBitSet(int size) { capacity = size; value <<= (JConstants.BITSIZE - capacity); } public void clear() { value = 0L; } pub...
PHP
UTF-8
6,054
2.8125
3
[]
no_license
<?php include("funciones/func_mysql.php"); conectar(); //mysql_query("SET NAMES 'utf8'"); //-------------------------------------------------------------------------------- function redim($ruta1,$ruta2,$ancho,$alto) { # se obtene la dimension y tipo de imagen $datos=getimagesize ($ruta1); $ancho_ori...
Markdown
UTF-8
242
2.890625
3
[]
no_license
# Sorting Sorting musical notes in a specific arrangement This program sorts a variety of numbers in a given array using sorting methods like selection sort, and corresponds the given numbers to musical notes to create a crescendo of music.
JavaScript
UTF-8
7,733
2.609375
3
[ "MIT" ]
permissive
import Piedra from "./piedra.js"; import Coin from "./coins.js"; const stepLimit = 200; export default class Enemy extends Phaser.GameObjects.Sprite { constructor(scene, x, y, mapa, tipo) { super(scene, x, y, tipo); this.scene.add.existing(this); this.scene.physics.add.existing(this); ...
Python
UTF-8
7,814
2.609375
3
[]
no_license
# Released under cc licence: https://creativecommons.org/ # Made by @hedgehog125 on github.com and scratch.mit.edu # On Github: https://github.com/hedgehog125/AutoUpdate_v2/tree/master import urllib.request, os, shutil, ast, math from time import sleep database = "unknown" changeAmount = 0 done = False def parse(stri...
Markdown
UTF-8
9,905
2.703125
3
[ "Apache-2.0" ]
permissive
# Google Exposure Notification Server ## Functional requirements This documents the functional requirements for building a decentralized exposure notification system. For deployment strategies, see [Server Deployment Options](server_deployment_options.md). ### System Components The Exposure Notification Server's ar...
PHP
UTF-8
396
2.640625
3
[ "MIT" ]
permissive
<?php namespace App; use Illuminate\Database\Eloquent\Model; /** * Class Message * @package App */ class Message extends Model { /** * @var string */ protected $table = 'message'; /** * @author Jerry * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public fu...