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 |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 1,838 | 2.90625 | 3 | [] | no_license | /*
* Copyright:
* License :
* The following code is deliver as is.
* I take care that code compile and work, but I am not responsible about any damage it may cause.
* You can use, modify, the code as your need for any usage.
* But you can't do any action that avoid me or other person use, modify this code.... |
C# | UTF-8 | 4,391 | 2.765625 | 3 | [] | no_license | using Client.Tools;
using GalaSoft.MvvmLight;
using Models.Models;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Client.... |
Markdown | UTF-8 | 1,607 | 3 | 3 | [] | no_license | ---
title: Mushroom FAQ
layout: default
category: EN
---
Have questions about Popsy? Check out the FAQ below to help you get started!
## **1. What is Popsy?**
Popsy is an app where you can live broadcast and hang out with friends, just like in real life but better. Everybody gets their own room and you can pull anyo... |
JavaScript | UTF-8 | 1,057 | 3.140625 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | let eastWest = [
'1st Avenue',
'2nd Avenue',
'3rd Avenue',
'Lexington Avenue',
'Park',
'Madison Avenue',
'5th Avenue'
];
class Driver{
constructor(name, startDate){
this.name = name
this.startDate = new Date(startDate)
}
yearsExperienceFromBeginningOf(endDate){
return new Date(endDate).... |
PHP | UTF-8 | 6,809 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
/**
* Nano Framework
*
* @package Nano
* @author Francesco Saccani <saccani.francesco@gmail.com>
* @copyright Copyright (c) 2019 Francesco Saccani
* @version 1.0
*/
declare(strict_types=1);
namespace Nano\Model\QueryBuilder;
use Nano\Database\Exception\InvalidArgumentException;
use Nano\Database\... |
Java | UTF-8 | 758 | 2.140625 | 2 | [] | no_license | package com.cmazxiaoma.mvp.bean;
import java.util.List;
/**
* Description: 沉梦昂志
* Data:2017/5/17-14:06
* Author: xiaoma
*/
public class ImageEvent {
private int currentPosition;
private List<String> imageUrls;
public ImageEvent(int currentPosition, List<String> imageUrls) {
this.currentPositi... |
Python | UTF-8 | 4,614 | 2.671875 | 3 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 14 15:16:43 2017
@author: jjcao
"""
import torch
import torch.nn as nn
from collections import OrderedDict
import functools
from .base_network import BoxBlock, UBoxBlock
# Defines the generator that consists of Resnet blocks between a few
# downsam... |
Java | UTF-8 | 676 | 3.078125 | 3 | [] | no_license | import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
public class TimeDemo {
public static void main(String[] args) {
long start = System.currentTimeMillis();
try {
for (int i = 0; i < 10000; i++) {
Thread.sleep(2);
... |
Java | UTF-8 | 5,227 | 2.625 | 3 | [] | no_license | package auction;
import java.io.File;
//the list of imports
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import logist.LogistSettings;
import logist.behavior.AuctionBehavior;
import logist.config.Parsers;
import logi... |
Markdown | UTF-8 | 4,813 | 3.21875 | 3 | [] | no_license | # Desafio Itaú
## Introdução
Este é um Projeto de Desafio do Itaú que consiste em criar uma API que irá expor um endpoint para verificar se uma determinada senha é válida, seguindo os critérios abaixo:
- Possuir nove ou mais caracteres
- Possuir ao menos 1 dígito numérico
- Possuir ao menos 1 letra minúscula
- Possu... |
SQL | UTF-8 | 533 | 3.453125 | 3 | [] | no_license | /*
* Basic Survey Website using php
* by Johan Setyobudi
* jsetyobudi@gmail.com
* sety0002@algonquinlive.com
* April 11, 2016
*/
CREATE DATABASE survey;
GRANT USAGE ON *.* TO survey@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON survey.* TO survey@localhost;
FLUSH PRIVILEGES;
USE survey;
C... |
Python | UTF-8 | 1,155 | 2.765625 | 3 | [] | no_license | #!/usr/bin/env python
import re
key = '02070D48030F1C294940041801181C0C140D0A0A20253A3B'
def decrypt( ep ):
"""Cisco Type 7 password decryption. Converted from perl code that was
written by jbash /|at|\ cisco.com"""
xlat = ( 0x64, 0x73, 0x66, 0x64, 0x3b, 0x6b, 0x66, 0x6f, 0x41, 0x2c,
0x2e, 0x69, 0x79, 0... |
Java | UTF-8 | 950 | 2.453125 | 2 | [] | no_license | package com.springboot.zero.web;
/**
* Created by hanxirui on 2017/2/21.
*/
import java.util.Map;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* 模板测试.
*
* @author Administrator
*/... |
Java | UTF-8 | 1,042 | 2.515625 | 3 | [] | no_license | package com.example.thagadur.android_session8_assignment3;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.GridView;
public class MainActivity extends AppCompatActivity {
//1. Declare the objects t... |
Markdown | UTF-8 | 6,441 | 2.53125 | 3 | [
"MIT"
] | permissive | # VisualLinter
# DEPRECATED
The development of this Visual Studio extension has been suspended since
1) I'm no longer is using this extension myself
2) I don't have as much time to dedicate into this project that I'd like
I'd like to thank everyone who helped contributing to this project in one way or another, wheth... |
Java | UTF-8 | 866 | 2.125 | 2 | [] | no_license | package com.winston.springcloud.controller;
import com.winston.springcloud.entities.Dept;
import com.winston.springcloud.service.DeptClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author Winston
* @title:... |
Java | UTF-8 | 1,776 | 2.125 | 2 | [] | no_license | package org.flexpay.httptester.outerrequest.request;
import org.apache.commons.digester3.Digester;
import org.flexpay.httptester.outerrequest.request.response.ReversalPayResponse;
import java.security.Signature;
import java.util.Properties;
public class ReversalPayRequest extends Request<ReversalPayResponse>... |
JavaScript | UTF-8 | 3,808 | 2.578125 | 3 | [] | no_license |
var resultsDiv;
function search(query) {
if (! query) return;
showSearch(query);
var loader = new HLoader(
function(s,r,c) {
displayResults(s,r,c);
},
function(s,e) {
alert("load failed: " + e);
}
);
loadAllRecords(query, null, loader);
}
function loadAllRecords(query, options, loader) {
var PAG... |
Java | UTF-8 | 6,344 | 2.203125 | 2 | [
"Apache-2.0"
] | permissive | /**
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
*
* 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 requ... |
Java | UTF-8 | 659 | 1.867188 | 2 | [] | no_license | package com.ssafy.IMS.controller;
import com.ssafy.IMS.service.ScheduleService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.... |
Java | UTF-8 | 5,022 | 1.710938 | 2 | [] | no_license | package com.example.jungle.weixin.Activity;
import android.support.v7.app.ActionBar;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
impo... |
JavaScript | UTF-8 | 1,856 | 2.546875 | 3 | [] | no_license | // Simple HTTP server that renders barcode images using bwip-js.
const http = require('http');
const bwipjs = require('bwip-js');
const DrawingSVG = require('./drawing-svg');
var url = require('url');
// This shows how to load the Inconsolata font, supplied with the bwip-js distribution.
// The path to your fonts wi... |
C++ | UTF-8 | 1,442 | 2.59375 | 3 | [] | no_license | /*
mjrenderable.h
Matthew Jee
mcjee@ucsc.edu
Abstract class meant to be subclassed before usage.
Definitely not the most efficient nor the most flexible,
but it is very convenient for this project.
*/
#ifndef MJ_RENDERABLE_H
#define MJ_RENDERABLE_H
#include "mjutil.h"
#include "mjmatrix.h"
#i... |
Java | UTF-8 | 1,820 | 2.265625 | 2 | [] | no_license |
package com.cire.apps.twitterclient.fragments;
import java.util.ArrayList;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import com.cire.apps.twit... |
Python | UTF-8 | 1,398 | 2.640625 | 3 | [] | no_license | #!/usr/bin/env python2
def emit_define(name, postfix, value):
if name.find("#") != -1 and value.find("#") != -1:
raise ValueError("Found processor metacharacters")
return "#define " + name + postfix + " " + value + "\n"
f = open("pins.def", "r").read()
fOut = open("pins.def.h", "w")
for line in f.spl... |
SQL | UTF-8 | 257 | 2.515625 | 3 | [] | no_license | DROP TABLE GATHERING_MEMBER;
CREATE TABLE GATHERING_MEMBER(
ID VARCHAR2(300) PRIMARY KEY,
PW VARCHAR2(300),
TEL VARCHAR2(300),
ADDR VARCHAR2(300),
EMAIL VARCHAR2(300)
)
SELECT * FROM GATHERING_MEMBER;
delete from GATHERING_MEMBER where id='lee' |
C++ | UTF-8 | 1,311 | 3.015625 | 3 | [] | no_license | #ifndef HMLIB_SHAREDMEMORY_INC
#define HMLIB_SHAREDMEMORY_INC 100
#
#include <boost/pool/object_pool.hpp>
#include <vector>
namespace hmLib{
template<class T>
class shared_memory{
typedef unsigned int size_type;
static boost::object_pool<T> Pool;
private:
T* Ptr;
public:
shared_memory()
:Ptr(Pool.constru... |
Java | UTF-8 | 39,945 | 2.09375 | 2 | [
"MIT",
"EPL-1.0",
"Apache-2.0"
] | permissive | /* Copyright 2002-2023 CS GROUP
* Licensed to CS GROUP (CS) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* CS licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may... |
PHP | UTF-8 | 3,648 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types = 1);
namespace Innmind\Reflection;
use Innmind\Reflection\{
InjectionStrategy\InjectionStrategies,
Instanciator\ReflectionInstanciator,
Exception\InvalidArgumentException,
};
use Innmind\Immutable\{
Map,
Set,
};
use function Innmind\Immutable\assertMap;
final class Ref... |
Python | UTF-8 | 383 | 3.671875 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sun May 9 12:53:59 2021
@author: Admin
"""
# dictionary comprehention with if else
# {1:'odd',2:'even}
d={num:('even' if num%2==0 else 'odd') for num in range(1,11)}
print(d)
a={i:i**3 for i in range(1,11)}
print(a)
c=[i**3 if (i%2==0) else (-i) for i in rang... |
Markdown | UTF-8 | 2,232 | 3.46875 | 3 | [] | no_license | Il est temps de parler des options.
Je reprends l'exemple du début :
`mkdir -v dossier1 dossier2 dossier4`{{execute}}
* La commande est `mkdir`
* Cette commande prend 4 arguments qui sont `-v`, `dossier1`, `dossier2` et `dossier4`.
En réalité, `-v` est un argument particulier : c'est une **option**.
# Ma... |
Markdown | UTF-8 | 706 | 2.609375 | 3 | [] | no_license | Internet Connection
===================
A small script that plays a beep when there is no Internet connection
## Installation
1. Download this repository using `git clone` or clicking on [this link](https://github.com/IonicaBizau/internet-connection/archive/master.zip).:
```
git clone git@github.com:IonicaBizau/int... |
Java | UTF-8 | 15,943 | 1.734375 | 2 | [] | no_license | package vistas;
import controlador.Disponibilidad;
import modelo.Archivos;
import controlador.ListaViaje;
import controlador.Publicacion;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import modelo.PAGO_VIAJE;
import modelo.PASAJERO;
public final class VentanaViaje extends javax.swing.JDialog {
List... |
JavaScript | UTF-8 | 4,732 | 3.265625 | 3 | [] | no_license | //Global variables
var scene, camera, renderer;
var geometry1, material1, mesh1;
var geometry2, material2, mesh2;
var geometry3, material3, mesh3;
var geometry4, material4, mesh4;
var geometry5, material5, mesh5;
var geometry6, material6, mesh6;
var geometry7, material7, mesh7;
var geometry8, material8, mesh8;
var geom... |
Python | UTF-8 | 743 | 2.859375 | 3 | [] | no_license | from .load_balancer import LoadBalancer
from utils import hash_fn
"""
Broken Load Balancer
Doesn't rebalance shards, it puts everything in the first shard
and fails to rebalance on removes
"""
class BrokenLoadBalancer(LoadBalancer):
# Initialize data structures
def __init__(self):
super().__init__()
... |
Python | UTF-8 | 1,046 | 4 | 4 | [] | no_license | #Farey Sequence
#Euler's Totient Function
#related problems: 069, 071
def makePrimes(n):
li = [True] * n
primes = []
li[0] = False
li[1] = False
for i in range(2, n):
if li[i]:
primes.append(i)
for j in range(i*i, n, i):
li[j] = False
return prim... |
C# | UTF-8 | 2,765 | 2.515625 | 3 | [] | no_license | using System;
using Foundation;
using UIKit;
using System.Collections.Generic;
using Xamarin.Essentials;
namespace WhereInTheFuckingWorld
{
public class TableSource : UITableViewSource
{
List<Option> options;
Option selected;
MapKit.MKMapView mapView;
public TableSource(List<O... |
C# | UTF-8 | 1,596 | 3.890625 | 4 | [
"Unlicense"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
namespace questions
{
// Question URL: https://leetcode.com/problems/group-anagrams
//Given an array of strings, group anagrams together.
//Example:
//Input: ["eat", "tea", "tan", "ate", "nat", "bat"],
//Output:
//[
// ["a... |
C++ | UTF-8 | 2,099 | 2.65625 | 3 | [] | no_license | #pragma once
#include "MiniginPCH.h"
#include <SDL.h>
#include <SDL_ttf.h>
#include <string>
#include <memory>
#pragma warning(push)
#pragma warning (disable:4201)
//#include <glm/vec3.hpp>
#include <glm/glm.hpp>
//#include "glm/vec2.hpp"
#pragma warning(pop)
#include "Renderer.h"
#include "Font.h"
#include "Texture2D... |
Markdown | UTF-8 | 488 | 2.765625 | 3 | [
"MIT"
] | permissive | ### Basic
The simplest usage of Steps.
```javascript
class Demo extends React.Component{
render(){
return (
<Steps currentIndex={1}>
<Steps.Step title="Step1" description="Step1 Description" />
<Steps.Step title="Step2" description=... |
JavaScript | UTF-8 | 11,103 | 2.890625 | 3 | [] | no_license |
// NOTE: HERE I AM CONSIDERING MAIN USER USER_ID 1 , but in other cases consider login user as a MAIN USER.
// IN MY CASE I HAVE THREE TYPE OF USER , 1) EXECUTIVE , 2) MANAGER , 3) BASIC USER.
/* THIS IS A TEMPLATE FOR MAIN USER */
var main_user = '<div class="form-group"><label class="col-sm-5">My Events</label><d... |
TypeScript | UTF-8 | 2,729 | 2.6875 | 3 | [] | no_license | import { useState } from 'react';
import {
FormChangeEvent,
FormSubmitEvent,
FieldState,
FormState,
FormConfig,
FormManagerBase,
FormManager,
runValidators
} from '.';
const getInitialState = (config: FormConfig): FormState => {
return {
isInvalid: false,
isDirty: false,
fields: config.m... |
SQL | UTF-8 | 63,347 | 3.09375 | 3 | [] | no_license | CREATE SCHEMA IF NOT EXISTS `dcps`;
USE `dcps`;
--
-- Table structure for table `apis`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `apis` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`company_id` ... |
Java | UTF-8 | 1,041 | 2.203125 | 2 | [] | no_license | package edu.ap.bol;
import org.restlet.resource.ClientResource;
public class BestellingenClient {
public static void main(String[] args) {
try {
ClientResource clientResource = new ClientResource("http://localhost:8087/bestellingen");
String bestelling1 = "<?xml version=\"1.0\" encoding=\"UTF-8\" standal... |
SQL | UTF-8 | 457 | 2.96875 | 3 | [] | no_license | DROP SCHEMA IF EXISTS lead_service;
CREATE SCHEMA lead_service;
USE lead_service;
CREATE TABLE `leads`(
id INT AUTO_INCREMENT NOT NULL,
`name` VARCHAR(255),
email VARCHAR(255),
company_name VARCHAR(255),
phone_number VARCHAR(255),
sales_rep_id INT,
PRIMARY KEY(id)
);
INSERT INTO `leads` (`name`, email, company_name, ... |
Java | UTF-8 | 1,280 | 2.828125 | 3 | [] | no_license | package qinkai.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class Demo02 extends HttpServlet {
protected void do... |
Java | UTF-8 | 659 | 2.4375 | 2 | [] | no_license | package database_query;
import java.util.Hashtable;
import java.util.concurrent.Callable;
import jpl.Atom;
import jpl.PrologException;
import jpl.Query;
import jpl.Term;
public class CustomCallable implements Callable<Term> {
private String queryString;
public CustomCallable(String queryString) {
this.queryStri... |
Java | UTF-8 | 172 | 1.671875 | 2 | [] | no_license | package edu.washington.cse.codestats;
public class Constant {
public static Constant of(final String string) {
// TODO Auto-generated method stub
return null;
}
}
|
Java | UTF-8 | 2,276 | 2.53125 | 3 | [] | no_license | package net.perspilling.asset.api;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.S... |
Markdown | UTF-8 | 11,781 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | # 附录
孔学新语自序
髫年入学,初课四书;壮岁穷经,终惭三学。虽游心于佛道,探性命之真如;犹输志于宏儒,乐治平之实际。况干戈扰攘,河山之面目全非;世变频仍,文教之精神隳裂。默言遁晦,灭迹何难。众苦煎熬,离群非计。故当夜阑昼午,每与二三子温故而知新。疑古证今,时感二十篇入奴而出主。讲述积久,笔记盈篇。朋辈咐嘱灾梨,自愧见囿窥管。好在宫墙外望,明堂揖让两庑。径道异行,云辇留连一乘。六篇先讲,相期欲尽全文。半部可安,会意何妨片羽。砖陈玉见,同扬洙泗之传薪。讽颂雅言,一任尼山之桂杖。是为序。
时岁次壬寅(一九六二年)孔圣诞辰南怀瑾序于台北寓居
孔学新语发凡
我们作为现代的一个人,既有很沉痛的悲惨遭遇,也有难逢难遇的幸运;使我们生... |
C++ | UTF-8 | 1,325 | 4.03125 | 4 | [] | no_license | /*
remove算法会通过移动来覆盖需要删除的元素,但是并不会缩减容器的容量,其返回新的终点位置,但原有的元素位置仍然有效
该程序同时展示了distance的用法
*/
#include <iostream>
#include <list>
#include <iterator>
#include <algorithm>
using namespace std;
template<class T>
void print(const std::string& prefix, const T& continer)
{
cout << prefix << ": ";
copy(continer.begin(), continer.e... |
Markdown | UTF-8 | 7,135 | 2.890625 | 3 | [] | no_license | # Member/v1 Documentation
## Retrieve a Member
Returns a specific Member object.
### URL
> GET /member/v1/{id}
> GET /member/v1/me
### Parameters
<table>
<thead>
<tr>
<th>Name</th>
<th>Required?</th>
<th>Type</th>
<th>Description</th>
</tr>
<... |
Java | UTF-8 | 269 | 2.359375 | 2 | [] | no_license | package MrWeatherSort;
public class LogMessage {
static StringBuffer message=new StringBuffer("");
public static StringBuffer getMessage() {
return message;
}
public static void setMessage(String s) {
message.append(s+"\n");
}
}
|
Python | UTF-8 | 5,601 | 2.71875 | 3 | [] | no_license | """
To override a function in this module, do the following:
import mtoa.hooks
def setupFilter(filter, aovName=None):
if aovName == "Occlusion":
filter.aiTranslator.set("guassian")
mtoa.hooks.setupFilter = setupFilter
There are copies of each function in this module that start with an ... |
Python | UTF-8 | 493 | 4.34375 | 4 | [] | no_license | #Range()function: It is a pre-defined function, whose range starts from
# 0 to given value(excluding)
#ex:- range(10)--->here values from 0 to 9 are generated and stored in an object.
x=range(10)
print(x)
print(type(x))
for p in x:
print(p)
y=range(10,20)
print(y)
print(type(y))
for q in y:
... |
SQL | UTF-8 | 99 | 2.5625 | 3 | [] | no_license | SELECT name, COUNT(NAME) COUNT
FROM animal_ins
GROUP BY name
HAVING COUNT(NAME) > 1
ORDER BY name;
|
Shell | UTF-8 | 152 | 3.09375 | 3 | [] | no_license | #!/usr/bin/env bash
#reading from etc passwd
cut -d: -f1 /etc/passwd | while IFS= read -r user
do
echo "$user"
# do something with $user
done
|
Shell | UTF-8 | 16,933 | 3.046875 | 3 | [] | no_license | #! /bin/bash
## Selamat datang di Soal Mudah
## ##Create Kuriyanto Adi ##
## *Perintah Dasar Linux* ##
clear
waktu=`date +%H:%M:%S`;
## Soal nomor 1
echo "1. Untuk melihat isi file dalam sebuah direktori dengan perintah ? "
echo -n " Jawaban : "
read jwb1
if [ ls = $jwb1 ]
then
nil1=1
echo "\033... |
JavaScript | UTF-8 | 8,617 | 2.578125 | 3 | [
"MIT"
] | permissive | const {escapeshellarg, sprintf, trim, isset, is_string, is_array, is_int, in_array, to_array, array_key_exists, count, array_shift, array_unshift, substr, strpos, strlen, str_replace, preg_match, implode, stripcslashes} = require('../PhpPolyfill');
const forEach = require('lodash/forEach');
const InputArgument = requi... |
Java | UTF-8 | 824 | 2.046875 | 2 | [] | no_license | package com.sumy.gamestore.service;
import java.time.LocalDate;
import java.time.LocalDateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sumy.gamestore.controller.MyPageController;
import com.sumy.gamestore.mapper.QuestionUserMapper;
im... |
PHP | UTF-8 | 32,367 | 2.828125 | 3 | [] | no_license | <?php
//Set the view as a new stdClass
$view = new stdClass();
//Set up the page's title
$view->pageTitle = 'GPS Page';
//Require from the huntListing class
require('Models/class.huntListing.php');
//Require from the updateListing class
require_once('Models/class.updateListing.php');
//Require the sessions c... |
Java | UTF-8 | 622 | 2.265625 | 2 | [] | no_license | package com.residencia.dell.services;
import com.residencia.dell.entities.Customers;
import com.residencia.dell.repositories.CustomersRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class CustomerService {
@Autowired
pr... |
Python | UTF-8 | 219 | 2.828125 | 3 | [] | no_license | from tkinter import *
root=Tk()
def hello():
print('hello!')
menubar=Menu(root)
filememu=Menu(menubar,tearoff=0)
filemenu.add_command(label='打开',command=hello)
filemenu.add_command(label='保存',command=hello) |
Python | UTF-8 | 600 | 3.078125 | 3 | [] | no_license | class Solution:
def merge(self, nums1, m: int, nums2, n: int) -> None:
i = 0
j = 0
end = len(nums1) - 1
# compare items from the end of nums1 and nums2,put max item to the end of nums1
while end >= 0:
if j == n or i < m and j < n and nums1[m-i-1] > nums2[n-j-1]:
... |
Rust | UTF-8 | 829 | 3 | 3 | [
"MIT"
] | permissive | use serde::Deserialize;
use std::error::Error;
use std::process::{Command, Output};
#[derive(Debug, Deserialize)]
struct RunFile {
cmd: Vec<Cmd>,
}
#[derive(Debug, Deserialize)]
struct Cmd {
name: String,
bin: String,
args: String,
}
pub fn run(command: &str) -> Result<Output, Box<dyn Error>> {
... |
C++ | UTF-8 | 1,073 | 2.5625 | 3 | [] | no_license | #include <string>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <assert.h>
#include <algorithm>
#include <queue>
using namespace std;
int main() {
int n;
cin >> n;
vector<long long> a;
vector<long long> b;
for (int i = 0; i < n; i++) {
long long x;
... |
C# | UTF-8 | 981 | 2.671875 | 3 | [] | no_license | using IdentityModel;
using Microsoft.AspNetCore.Http;
using System;
namespace Messaging.API.Services
{
public class IdentityService : IIdentityService
{
private IHttpContextAccessor _context;
public IdentityService(IHttpContextAccessor context)
{
_context = context ?? thro... |
Java | UTF-8 | 1,254 | 2.9375 | 3 | [] | no_license | import java.text.SimpleDateFormat;
import java.util.Date;
public class Match implements Comparable<Match> {
Date matchDate;
String teamOne;
String teamTwo;
public Date getMatchDate() {
return matchDate;
}
public void setMatchDate(Date matchDate) {
this.matchDate = matchDate;
}
public Stri... |
JavaScript | UTF-8 | 623 | 3.625 | 4 | [] | no_license | /* 元素和大于target的最短连续子序列
滑动窗口法
每轮循环 都将当前值加到sum上
sum>target 则记录一次最小长度 同时减去左边框 左边框+1 循环判断sum*
*/
function minSubArrayLen(arr, target) {
// 左边框
let i = 0;
let sum = 0;
let len = arr.length;
let flag = false
for (let j = 0; j < arr.length; j++) {
sum = sum + arr[j];
while (sum >= targe... |
JavaScript | UTF-8 | 2,255 | 3.421875 | 3 | [] | no_license | function checkForm() {
// Reset the background colour to white on each of the form elements
// The element's ids are name, address, memtype, magrad and agreepar
// Use document.getElementById("element-name").style.backgroundColor = "white";
var isFormOK = true;
var errorString = "The following... |
Java | UTF-8 | 2,256 | 2.375 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2014 Higher Frequency Trading http://www.higherfrequencytrading.com
*
* 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
*
* ... |
Java | UTF-8 | 1,435 | 2.875 | 3 | [] | no_license | package resources;
public class Operation {
private String name;
private int demand;
private CircuitBreaker circuitBreaker;
private Dependency[] dependencies;
private int dependingOperationCount = 0;
public Operation(String name) {
this.name = name;
}
public String getName() ... |
Python | UTF-8 | 400 | 3.421875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def main():
""" Для целого числа, если в нем больше трех разрядов,
используйте пробел, чтобы сгруппировать разряды по 3. """
# Code goes over here.
print("{:,}".format(int(input())).replace(',', ' '))
return 0
if __name__ == "__main__":
main()
|
JavaScript | UTF-8 | 7,114 | 2.796875 | 3 | [
"MIT"
] | permissive |
export const arr = [
{
language: "node",
title: 'start',
code: `npm install --save-dev jest babel-jest
/* Add to package.json */
"scripts": {
"test": "jest"
}
# Run your tests
npm test -- --watch`
},{
language: 'javascript',
title: 'enzyme',
code: `import React from 'react'
import App from './A... |
Shell | UTF-8 | 1,277 | 3.71875 | 4 | [] | no_license | set -e
# Feel free to change any of the following variables for your app:
APP_ROOT=/home/deployer/apps/deploytestp/
CMD="cd $APP_ROOT/current; bundle exec puma -C $APP_ROOT/shared/config/puma.rb -b unix://$APP_ROOT/shared/sockets/puma.sock -e production --control unix://$APP_ROOT/shared/sockets/pumactl.sock --state $A... |
Java | UTF-8 | 510 | 2.046875 | 2 | [] | no_license | package com.brotherhui.tcc.order.model.request;
import java.util.List;
/**
* @author xiaohui.c.liu
* @create 2018-04-13 3:39 PM
*/
public class OrderRequest {
private Integer amount;
private List<OrderItemRequest> items;
public Integer getAmount() {
return amount;
}
public void setAmount(Integer... |
Java | UTF-8 | 2,215 | 2.390625 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Copyright © 2009 HotPads (admin@hotpads.com)
*
* 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... |
Java | UTF-8 | 308 | 1.75 | 2 | [
"MIT"
] | permissive | package com.alibaba.sentinel.feign.controller;
import org.springframework.web.bind.annotation.*;
/**
* @author Lion Li
*/
@RestController
public class TestController {
@PostMapping("/test")
public String test(@RequestParam("name") String name) {
return "服务提供端::返回值 => " + name;
}
}
|
Markdown | UTF-8 | 593 | 2.875 | 3 | [] | no_license | ## Question 3 React Competency Test
Build a react app that calls an api and renders a random beer. You can use create-react-app or gatsby or any other starter template.
The api to use is the one you built in Question 2.
The requirements for this app are,
1. Display all fields from the api in your UI,
2. Have a “Next” b... |
C# | UTF-8 | 318 | 3.515625 | 4 | [] | no_license | string[] strNums = {"111","32","33","545","1","" ,"23",null};
var nums = strNums.Where( s =>
{
int result;
return !string.IsNullOrEmpty(s) && int.TryParse(s,out result);
}
)
.Select(s => int.Parse(s))
.OrderBy(n => n);
foreach(int num in nums)
{
Console.WriteLine(num);
}
|
JavaScript | UTF-8 | 3,020 | 2.8125 | 3 | [] | no_license | var about = document.getElementById("about");
var contact = document.getElementById("contact");
var contact_item = document.getElementById("contact-item");
var breadcrumbs = document.getElementById("breadcrumbs");
var mob_contact_item = document.getElementById("mob-contact-item");
var mob_contact = document.getElement... |
Shell | UTF-8 | 676 | 2.5625 | 3 | [] | no_license | #!/bin/bash
# Declare variables for certificate
gen CERT_DIR="/usr/local/osmosix/cert"
COUNTRY="US"
STATE="PA"
CITY="Pittsburgh"
ORG="REQLAB"
ORG_UNIT="Sales" COMMON_NAME="owncloud.threepings.com"
# Prepare certificates for HTTPS
sudo mkdir -p $CERT_DIR
sudo openssl req -nodes -newkey rsa:2048 -keyout $CERT_DIR/priva... |
C++ | UTF-8 | 481 | 3.75 | 4 | [] | no_license | #include <iostream>
using namespace std;
/* Ingresar 5 numeros y contar cuantos son pares e impares.
*/
int main()
{
int num,cpar,cimpar;
int conta=0;
cpar=0;cimpar=0;
while (conta<5)
{
cout<< "Ingrese el numero: "
cout<<endl;
cin>>num;
conta++;
if (num... |
Markdown | UTF-8 | 6,090 | 3.046875 | 3 | [
"CC0-1.0"
] | permissive | ---
title: '为你在 Bash 历史中执行过的每一项命令设置时间和日期'
date: 2019-01-24 2:30:11
hidden: true
slug: aspmydtljqn
categories: [reprint]
---
{{< raw >}}
<h1><a href="#为你在-bash-历史中执行过的每一项命令设置时间和日期"></a>为你在 Bash 历史中执行过的每一项命令设置时间和日期</h1>
<p>在默认情况下,所有通过 Bash 在命令行中执行过的命令都被存储在历史缓存区或者一个叫做 <code>~/.bash_history</code> 的文件里。这意味着系... |
Java | UTF-8 | 23,814 | 1.867188 | 2 | [] | no_license | package com.superdata.pm.activity.project.plan;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.... |
Java | UTF-8 | 521 | 2.109375 | 2 | [] | no_license | package org.dao;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.pojo.Classes;
import org.springframework.stereotype.Repository;
@Repository
public class ClassesDao {
@Resource
private SessionFactory sf;
pu... |
C# | UTF-8 | 1,073 | 2.921875 | 3 | [] | no_license | using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CustomerApp.Model;
namespace CustomerApp.Models
{
public class CustomerViewModel
{
public long Id { get; set; }
[Required]
[DisplayName("Name")]
public string Name { get; set; }
[Required]... |
C++ | UTF-8 | 7,776 | 2.546875 | 3 | [
"MIT"
] | permissive | #include "../include/json_generator.hpp"
#include "../../grammar/include/grammar.hpp"
#include "../../grammar/include/nonterminal.hpp"
#include "../../grammar/include/production.hpp"
#include "../../grammar/include/token.hpp"
#include "../../grammar/include/nonterminal.hpp"
#include "../../table/include/state.hpp"
#inc... |
C | UTF-8 | 3,436 | 2.984375 | 3 | [] | no_license | // bmp.c
#include "bmp.h"
// THIS CODE WAS TAKEN FROM HERE:
// https://stackoverflow.com/a/2654860
// I DID NOT WRITE IT MYSELF
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
void bmp_write (
char const* fname,
struct bmp bmp
) {
uint32_t h = bmp.height;
uint32_t w = bmp.width;
FILE *f;
int paddi... |
Java | UTF-8 | 11,812 | 2.03125 | 2 | [] | no_license | package com.ood.myorange.service.impl;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.HttpMethod;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.model.*;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.ood.my... |
Python | UTF-8 | 839 | 3.359375 | 3 | [
"Apache-2.0"
] | permissive | class Solution:
def __first_match(self, s, p, i, j):
return s[i] == p[j] or p[j] == '.'
def isMatch(self, s: str, p: str) -> bool:
s_len = len(s)
p_len = len(p)
dp = [[False for _ in range(p_len + 1)] for _ in range(s_len + 1)]
dp[0][0] = True
for j in range(2... |
Java | UTF-8 | 601 | 1.789063 | 2 | [
"Apache-2.0"
] | permissive | package com.mongodb.hadoop.examples.sensors;
import com.mongodb.hadoop.util.*;
import org.apache.commons.logging.*;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.mapreduce.*;
import org.apache.hadoop.util.*;
import org.bson.*;
public class Sensors extends MongoTool{
private static final Log log = Log... |
C# | UTF-8 | 13,998 | 2.734375 | 3 | [
"MIT"
] | permissive | using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using RentalData;
using RentalData.Models;
using RentalServices;
using Microsoft.EntityFrameworkCore;
using Moq;
using NUnit.Framework;
namespace UnitTests.Services
{
[TestFixture]
class GuitarServiceShould
{
[Test]
... |
Markdown | UTF-8 | 1,510 | 3.3125 | 3 | [] | no_license | ## input组件
包含了
- input输入框
- radio单选项
- select下拉框
- textarea文本域
组件接受多个参数:
- type(optional): 组件类型,包括textarea、select、radio,默认为text
- label(optional):label项,显示在input之前
- value(require):值
- name(optional):name选项
- options:在`type`等于`select`或`radio`时为必须项。
- placeholder(optional):原生属性
- required(optional):原生属性,是否必填
### Usage... |
Markdown | UTF-8 | 2,208 | 3.65625 | 4 | [] | no_license | # Root to Leaf Paths
## Easy
<div class="problem-statement">
<p></p><p><span style="font-size:18px">Given a Binary Tree of size N, you need to find all the possible paths from root node to all the leaf node's of the binary tree.</span></p>
<p><span style="font-size:18px"><strong>Example... |
Java | UTF-8 | 235 | 1.59375 | 2 | [] | no_license | package com.webosmotic.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import com.webosmotic.entity.ProductSummary;
public interface ProductSummaryRepository extends JpaRepository<ProductSummary, Long>{
}
|
PHP | UTF-8 | 548 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
$target_dir = "uploads/";
$target_file = $target_dir. basename($_FILES["fileToUpload"]["name"]);
while (file_exists($target_file)) {
$target_file = substr($target_file,0,strrpos($target_file,".",-1))."0".substr($target_file,strrpos($target_file,".",-1));
}
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_na... |
TypeScript | UTF-8 | 1,573 | 2.921875 | 3 | [] | no_license | import { Component, OnInit, OnDestroy } from '@angular/core';
import { interval, Subscription, Observable } from 'rxjs';
import { map, filter } from 'rxjs/operators';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent impleme... |
Java | UTF-8 | 9,645 | 2.203125 | 2 | [] | no_license | package com.appirio.service.member.manager;
import com.appirio.service.member.api.ExternalLinkURL;
import com.appirio.service.member.api.MemberExternalLink;
import com.appirio.service.member.api.MemberExternalLinkData;
import com.appirio.service.member.api.MemberProfile;
import com.appirio.service.member.dao.MemberExt... |
Python | UTF-8 | 431 | 3.296875 | 3 | [] | no_license | import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11,GPIO.OUT)
servo1 = GPIO.PWM(11,50) # note. pin 11 will output 50hz pulse
servo1.start(0)
time.sleep(2)
duty = 2
while duty <=12:
servo1.ChangeDutyCycle(duty)
time.sleep(1)
duty = duty + 1
time.sleep(2)
print ("turning bac... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.