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,565 | 2.5 | 2 | [] | no_license | package com.example.tiago.appbank;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import java.util.List;
/**
* Created by Tiago on 17/02/2017.
*/
public class BandaAdapt... |
C | UTF-8 | 816 | 2.5625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <omp.h>
#define MAXN 10240
int DP[2][1000000 + 5];
int max(int a, int b) {
return a > b? a : b;
}
int main (void) {
int N, M;
int W[MAXN] = {0}, V[MAXN] = {0};
scanf("%d %d", &N, &M);
for (int i = 0; i < N; i++) {
scanf("%d %d", &W[i], ... |
C | UTF-8 | 1,984 | 3.03125 | 3 | [] | no_license | /*
* DAC.c
*
* Created on: Nov 9, 2020
* Author: yamanshrestha
*/
/*
* InitializeDACPins
*
* Set up the direction registers and initial states for the output pins used to interface with the DAC
*
* No arguments
*
* Return type: Void
*/
//void InitializeDACPins(void)
//{
// DISABLE_DAC_CS;
// S... |
Java | UTF-8 | 2,062 | 3.53125 | 4 | [] | no_license | package com.fullofinspiration.github.leetcode;
public class _0045_JumpGame2 {
/**
* https://leetcode.com/problems/jump-game-ii/solutions/18023/single-loop-simple-java-solution/comments/18012
* 1 得到某个节点前能走的最远距离
* 2 如果到达了上个节点走的最远距离,count++, prev更新为当前的最远距离
* 错误
* 原因1:终止条件应该是:i < nums.length-... |
JavaScript | UTF-8 | 535 | 2.703125 | 3 | [] | no_license | import React from 'react'
export const AgeInput = ({age, setAge}) => {
return (
<div className="input input-age">
<h3>How old are you?</h3>
<p>
We can't give a result to under 5s.
</p>
<div className="radio-buttons">
<input type="number" inputMode="numeric" min="5" max... |
JavaScript | UTF-8 | 1,409 | 3.359375 | 3 | [] | no_license | const gitHubForm = document.getElementById('gitHubForm'); //dohvatanje GitHub username input forme
gitHubForm.addEventListener('submit', (e) => {
e.preventDefault(); //prevent default form action
let usernameInput=document.getElementById('usernameInput'); //dohvatanje GitHub username
let gitHubUsername =... |
Markdown | UTF-8 | 2,982 | 2.734375 | 3 | [] | no_license |
# My Educated Guess on the Hardness of Factoring: Not as Hard!
* **Reason 1:** Factoring is in the intersection of NP and coNP, which means that it is (extremely) unlikely to be NP-complete because otherwise NP=coNP which is (in my assessment) less likely to be true than factoring being hard.
* **Reason 2:** Other p... |
Java | UTF-8 | 4,698 | 1.859375 | 2 | [
"MIT"
] | permissive | package mekanism.client.jei.machine;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import mekanism.api.annotations.NonNull;
import mekanism.api.chemical.gas.GasStack;
import mekanism.api.math.FloatingLong;
import mekanism.api.recipes.NucleosynthesizingRecipe;
import mekanism.client.g... |
PHP | UTF-8 | 962 | 2.796875 | 3 | [] | no_license | <?php
namespace App\Security;
use App\Entity\User;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\UserCheckerInterface;
use Symfony\Component\Security\Core\Exception\CustomUserMessageAccountStatusException;
class UserChecker implements UserCheckerInterface
{
pub... |
C++ | UTF-8 | 636 | 2.71875 | 3 | [
"MIT"
] | permissive | #pragma once
#include <SFML\Graphics.hpp>
namespace mu
{
const float PI = 3.141599265f;
const float TWO_PI = PI * 2;
const sf::Vector2f polarToRectangular(const sf::Vector2f &polarCoordinates);
const sf::Vector2f polarToRectangular(const float &radius, const float &theta);
const sf::Vector2f rectangularToPolar(c... |
Java | UTF-8 | 798 | 2.9375 | 3 | [] | no_license | /*
* 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.
*/
package PunyaAlwi;
import java.util.Scanner;
public class assign2 {
public static void main(String[] args) {
Scanner inpu... |
JavaScript | UTF-8 | 2,358 | 2.578125 | 3 | [
"MIT"
] | permissive | const user = require('../models/user.model');
const validateId = require('../validateObjectId');
exports.getAll = function (req, res) {
if (req.user.role !== 'admin') {
// only admins can get all users
return res.status(403).send('Unauthorized resource access. User does not have valid credentials to perform ... |
Python | UTF-8 | 4,340 | 2.65625 | 3 | [] | no_license | #graphSims
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal
from mpldatacursor import datacursor
simZinE1 = pd.read_csv("simZinE1.csv")
simZinE2 = pd.read_csv("simZinE2.csv")
simZoutE1 = pd.read_csv("simZoutE1.csv")
simZoutE2 = pd.read_csv("simZoutE2.csv")
simGanE1 = pd.... |
Java | UTF-8 | 10,392 | 2.0625 | 2 | [] | no_license | /*
* 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. change
*/
package XML_Utils;
import Rules_Methods.Rule;
import java.io.File;
import java.io.IOException;
import java.net.UR... |
C++ | UTF-8 | 436 | 3.515625 | 4 | [] | no_license | #include <iostream>
using namespace std;
void double_data(int *int_ptr){
*int_ptr *= 2;
}
int main(){
int value{10};
int *int_ptr{nullptr};
cout<< "Value : " << value << endl;
double_data(&value);
cout << "Value is " << value << endl;
cout << "__________________________" << endl;
int_ptr=&value;
do... |
Markdown | UTF-8 | 4,576 | 3.0625 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: 再见2018:我的个人总结
subtitle: 年初定的flag,你都实现了?
date: 2018-12-31
author: jessehzx
header-img: img/pexels-photo-1654495.jpeg
catalog: true
tags:
- review
---
> 版权声明:本文为 jessehzx 原创文章,支持转载,但必须在明确位置注明出处!!!
2018年即将结束,今年你是否收获满满,年初定的flag都实现了么... |
PHP | UTF-8 | 488 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
require('connect.php');
$sql = "CREATE TABLE IF NOT EXISTS BUNDESLIGA (
bund_id INT(15) NOT NULL,
user_id INT (11) UNSIGNED NOT NULL,
season INT (4),
matchweek INT (2),
bundarray VARCHAR(510) NOT NULL,
PRIMARY KEY(bund_id),
FOREIGN KEY(user_id) REFERENCES User(user_id)
)ENGINE=InnoDB";
if ($c... |
PHP | UTF-8 | 3,469 | 2.515625 | 3 | [] | no_license | <?php
/**
* TClientScript class file
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
* @copyright Copyright © 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id: TClientScript.php 2348 2013-12-20 10:20:54Z arun $
* @package System.Web.UI.WebCon... |
C# | UTF-8 | 1,050 | 3.75 | 4 | [] | no_license | using System;
using System.Collections.Generic;
namespace School
{
public class Teacher : People
{
private IList<Discipline> disciplines;
public Teacher(string name, IList<Discipline> disciplines, string details)
: base(name, details)
{
this.Disciplines = disci... |
C++ | UTF-8 | 784 | 3.515625 | 4 | [] | no_license | #include <iostream>
#include <random>
using namespace std;
default_random_engine gen(0); //set seed to be 0- useful to debug
//get rid of 0 once you know it works
void fillRandom(int a[], int n ) { //set location array a[] and n elements
uniform_int_distribution<int> distribution(1,n);
for (int i = 0; i < n; ... |
C | UTF-8 | 1,449 | 3.46875 | 3 | [] | no_license | /*
* 信号量级的简单实用
* 首先创建一个值为5的信号量级,在创建10个进程,这10个进程只有5个进程可以同时工作
* 每有一个进程开始工作,信号量的值就减去1,每当有一个进程工作完毕,信号量的值则、
* 自动回复(+1);
* 注意:只有在对信号量+1/-1操作是将sb.sem_flg设置为SEM_UNDO时,在进程结束后信号量
* 的值才会自动回复。
*/
#include <sys/ipc.h>
#include <sys/sem.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#de... |
Python | UTF-8 | 479 | 3.796875 | 4 | [] | no_license | from datetime import date
print('---------------Analise da idade de pessoas-------------')
ano_atual= date.today().year
maior = 0
menor = 0
for i in range(1, 7):
data = int(input("Em que ano você nasceu? "))
idade = ano_atual - data
print("sua idade é {}.".format(idade))
if idade >= 18:
... |
Python | UTF-8 | 1,474 | 2.734375 | 3 | [] | no_license | import openpyxl as xl
import os
from models import StaticVariables, ComparisonRecord
# Update Excel
app_dir = os.path.dirname(__file__)
file_path = os.path.join(app_dir, 'data_file.xlsx')
data_file = xl.load_workbook(file_path)
data_sheet = data_file.worksheets[0]
# data_sheet.cell(row=1, column=1).value = "test wri... |
Java | UTF-8 | 384 | 2.640625 | 3 | [] | no_license | package mistra.com.StringTest.parameterTransfer;
/**
* Created by Mistra
* Date: 2018/1/25/025
* Time: 23:11
*/
/**
* String传参测试
*/
public class ParameterTransferTest2 {
public static void main(String [] args){
String str = "a";
change(str);
System.out.println(str);
}
public ... |
Java | UTF-8 | 1,233 | 2.140625 | 2 | [] | no_license | package com.Requestproject.RequestProject.Service;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.co... |
PHP | UTF-8 | 559 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php namespace App\Forms;
use Distilleries\FormBuilder\FormValidator;
class VenueForm extends FormValidator
{
public static $rules = [];
public static $rules_update = null;
public function buildForm()
{
$this
->add('name', 'textarea')
->add('address', 'address_picker', [
'default_value' => [
... |
Python | UTF-8 | 191 | 2.90625 | 3 | [] | no_license | # 创建临时文件夹和临时文件
import tempfile
dirpath = tempfile.mkdtemp()
print(dirpath)
f = tempfile.NamedTemporaryFile(prefix='haha-', dir=dirpath, delete=False)
print(f.name)
|
C++ | UTF-8 | 10,180 | 2.78125 | 3 | [] | no_license | #include "config.h"
#include "asearch.h"
#include "math.h"
#include <vector>
#include <cstring>
#include <stdio.h>
#include <iostream>
#include <queue>
#include <stack>
#include <tuple>
using namespace std;
aStar::aStar(vector<Obstacle> obstacles, int maxDistFromBorder): maxDistFromBorder(maxDistFromBorder){
grid... |
Java | UTF-8 | 2,103 | 2.640625 | 3 | [] | no_license | /*
* 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.
*/
package logica;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.time.DateTimeException;
... |
Java | UTF-8 | 883 | 2.609375 | 3 | [] | no_license | package console_user_registration;
public class User {
private long Id;
private String login;
private String password;
private UserRole role;
public User() {}
public User(String login, String password,long Id)
{
this.login = login;
this.password = password;
this.Id = Id;
this.role = UserRole.User;
}... |
Java | UTF-8 | 1,106 | 1.921875 | 2 | [] | no_license | /**
* null
*/
package com.cosmicsms.api.sdk.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.cosmicsms.api.sdk.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* Ge... |
C# | UTF-8 | 3,981 | 2.828125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
namespace UniversalAutomaticPackage.Configuration
{
public class StandardConfigurationFile
{
public static readonly Version FileStandardVersion = new Version(1, 0, 0, 0);
Dictionary<string, List<string>> Data = new Dictionary<str... |
Markdown | UTF-8 | 17,356 | 2.671875 | 3 | [] | no_license | 谎言也有善意的吗?或许有吧。当“神巫先生”接过陆青递来的不知名杖子时,张世宁从先生的神情中察觉到一丝异样,这令他不安。不过当他意识到对方不太有威胁自己的动机时,心神又舒缓了下来。法杖的震动极有规律,世宁心想,若是自己稍加点拨,听懂这个节律应该不难。先生不愧是先生,他同样察觉到了世宁的微表情,轻声念出了法杖震动的节律:“滴哒滴滴哒滴哒哒哒——”
先生收起法杖,又交还给陆青,说:“马先生无忧了,过几日便会回来。”
山寨一行人吃完饭便收兵回寨,临行前袁先生还叮嘱让世宁收拾停当就尽快过来。世宁当然不会放过这个向大师学习的机会,他帮陈叔家忙完几日的农活,便准备上山。子惜也觉得先生新奇,遂欲上山,两人便一同出了门。
未几,两人来到山... |
PHP | UTF-8 | 1,761 | 2.9375 | 3 | [] | no_license | <?php session_start();
if (isset($_POST['Logout'])) //True if user clicked the logout button
{
session_unset();
session_destroy();
header("location:index.php");
exit();
}?>
<html>
<body>
<form action="index.php" method="post">
User ID: <input type="text" placeholder="Enter user ID" name="ID"><br>
Passwo... |
Ruby | UTF-8 | 155 | 2.578125 | 3 | [] | no_license | puts "Bonjour, monde !"
#puts "Et avec une voix sexy, ça donne : Bonjour, monde !"
#En ajouter un hashtag devant la ligne celle-ci devient un commentaire |
C++ | UTF-8 | 1,101 | 2.609375 | 3 | [
"MIT"
] | permissive |
#include <gtest/gtest.h>
#include <fstream>
#include "graph.hpp"
#include "errors.hpp"
TEST(GraphTest, SimpleGraphShortestPath) {
ga::Graph::pretty_print_flag(true);
bool set_connected = false;
bool set_use_color = true;
bool set_use_style = true;
bool set_show_labels = true;
bool set_landsca... |
Java | UTF-8 | 6,200 | 2.296875 | 2 | [] | no_license | package com.financialassets.entity;
import com.financialassets.apiclient.IEXQuoteClient;
import com.financialassets.apiclient.IEXQuoteResponse;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import jav... |
C++ | UTF-8 | 8,397 | 3.03125 | 3 | [] | no_license | // CCarTests.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "../ConsoleApplication1/Car.h"
struct CCarFixture
{
CCar carTest;
};
/*
ТЕСТЫ:
- Двигатель автомобиля может находиться как во включенном состоянии, так и в выключенном.
- В автомобиле может быть включена одна... |
C++ | UTF-8 | 689 | 2.734375 | 3 | [] | no_license | #ifndef TRAVELLINGPATH_H
#define TRAVELLINGPATH_H
#include<bits/stdc++.h>
using namespace std;
class TravellingPath
{
private:
vector<int > path;
int startingCity;
int fitness;
public :
static int numberOfCities;
static int travelCost[350][350];
Tra... |
Python | UTF-8 | 13,860 | 3.078125 | 3 | [] | no_license | #! /usr/bin/env python
#
# Fade an LED (or one color of an RGB LED) using GPIO's PWM capabilities.
#
# Usage:
# sudo python colors.py 255 255 255
#
# @author Jeff Geerling, 2015
import sys
import termios
import tty
import csv
import sys
import socket
import numpy as np
from scipy import stats
from sklearn import l... |
Swift | UTF-8 | 2,296 | 2.84375 | 3 | [] | no_license | //
// AppTheme.swift
// SNY
//
// Created by Thanh-Tam Le on 13/04/2019.
// Copyright © 2019 Thanh-Tam Le. All rights reserved.
//
import UIKit
class AppTheme {
class var statusBarStyle: UIStatusBarStyle {
return .lightContent
}
class var primaryColor: UIColor {
return #color... |
Java | UTF-8 | 5,944 | 1.875 | 2 | [] | no_license | /************************************************************************************
* @File name : GroupServiceImpl.java
*
* @Author : XuYanbo
*
* @Date : 2014年11月4日
*
* @Copyright Notice:
* Copyright (c) 2014 Hunantv.com. All Rights Reserved.
* This software is published under... |
Swift | UTF-8 | 8,188 | 2.671875 | 3 | [
"MIT"
] | permissive | //
// UIImage+JLExtension.swift
// JLKit_Swift
//
// Created by Jangsy on 2018. 4. 11..
// Copyright © 2018년 Dalkomm. All rights reserved.
//
#if canImport(UIKit)
import UIKit
/*
참고 : https://github.com/melvitax/ImageHelper
*/
extension UIImage {
public enum UIImageResizeMode {
case aspectFit
... |
Markdown | UTF-8 | 2,300 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | # Dinivas
[](https://travis-ci.org/dinivas/dinivas)
AWS, GCP alternative on premise. Dinivas manage your private Cloud (OpenStack) infrastructure by providing many features base on popular Open Source projects [https://dinivas.github.io/dinivas]... |
Java | UTF-8 | 34,437 | 2.546875 | 3 | [] | no_license | /**
* For each node, make a list of Nearest Neighbors and then compare with
* other nodes to find those with common NNs.
* Output is a #nodes x #nodes table showing the number of common NN's for
* every pair of nodes in the network, and a text output of node pairs with
* both a high number of nearest neighbo... |
Ruby | UTF-8 | 2,104 | 2.53125 | 3 | [
"MIT"
] | permissive | require 'apidoco'
#
# ApidocoGenerator
#
# @author sufinsha
#
class ApidocoGenerator < Rails::Generators::Base
desc 'This generator creates empty folder for api versions'
def create_apidoco_folder
resource = args[0]
resource_actions = actions(args[1..-1])
resource_actions.each do |action|
creat... |
Swift | UTF-8 | 496 | 2.65625 | 3 | [] | no_license | //
// SearchRepository.swift
// AppSearchForRx
//
// Created by hyunjun yang on 06/04/2019.
// Copyright © 2019 hyunjun yang. All rights reserved.
//
import UIKit
import RxCocoa
import RxSwift
class SearchRepository {
let network = Networking()
var searchData = PublishSubject<SearchResponse>()
f... |
Markdown | UTF-8 | 4,125 | 3.078125 | 3 | [] | no_license | # TrabajoPractico
Para ejecutar el programa se debe acceder desde la consola a la direccion ...\VirtualDreams\Ejercicio5 y ejecutar el comando node index.js para iniciar el servidor, luego de esto se puede acceder a la carpeta Ejercicio6 para abrir el archivo html con un navegador.
Ejercicio 2: (abrir readme para pod... |
C# | UTF-8 | 1,142 | 3.046875 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
namespace Xyperico.Base.Crypto
{
public static class RandomStringGenerator
{
public const string ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
public const string NUMERIC = "0123456... |
Python | UTF-8 | 1,986 | 2.890625 | 3 | [] | no_license | #!/usr/bin/python
# -*-coding:Utf-8 -*-
from difflib import ndiff
def dictToCsv(dictInfos, sites):
csv = "Site;"
for category in dictInfos.keys():
csv += category.split("/")[0] + ";"
csv += "\n"
for site in sites.keys():
csv += site.split("/")[1] + ";"
for category in dictInfo... |
PHP | UTF-8 | 3,559 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\v1;
use Illuminate\Support\Facades\Hash;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\User;
use Illuminate\Support\Str;
class AuthController extends Controller
{
public function __construct()
{
$this->call = new ResponseControl... |
PHP | UTF-8 | 7,446 | 2.578125 | 3 | [] | no_license | <?php
class KeyInsert extends Model{
private $db;
private $user;
private $pageTitle;
private $pageHeading;
private $postArray;
private $panelHead_1;
private $panelContent_1;
private $SESSION;
private $pageID;
private $conte... |
JavaScript | UTF-8 | 683 | 2.65625 | 3 | [] | no_license | class Rope{
constructor(body1,body2,offsetX,offsetY){
this.offsetX=offsetX
this.offsetY=offsetY
var options = {
bodyA : body1,
bodyB : body2,
pointB:{x:this.offsetX,y:this.offsetY}
}
this.rope = Constraint.create(optio... |
C++ | UTF-8 | 10,764 | 3.75 | 4 | [] | no_license | #include <iostream>
#include <stdlib.h>
#include <time.h>
#include <chrono>
using namespace std::chrono;
//----------Random Number Generator--------------------
int* randomNumberGenerator(int arraySize, int newSort[]){
//Planting random seed
srand((unsigned)time(NULL));
//Creating array o... |
Swift | UTF-8 | 647 | 3.140625 | 3 | [] | no_license | import UIKit
//https://leetcode-cn.com/problems/friend-circles/
func findCircleNum(_ M: [[Int]]) -> Int {
if M.count == 0 || M[0].count == 0 { return 0 }
let n = M.count
var count = 0
var visited = Array(repeating: false, count: n)
for i in 0..<n {
if !visited[i] {
dfs(i, &visi... |
PHP | UTF-8 | 13,329 | 2.59375 | 3 | [] | no_license | <?php
namespace CommanderZiltoid\lempmetrics;
class Metrics {
private $_access_log_path;
private $_log_lines = [];
private $_logs_to_read;
private $_access_log = [];
private $_callbacks = [];
public function __construct($path='') {
// If no path given, assume default... |
Java | UTF-8 | 81,746 | 2.046875 | 2 | [
"BSD-3-Clause"
] | permissive | //
// The contents of this file are subject to the Mozilla Public
// License Version 1.1 (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.mozilla.org/MPL/
//
// Software distributed under the License is distributed on an
// "AS IS... |
Java | UTF-8 | 2,458 | 2.40625 | 2 | [
"Apache-2.0",
"MIT",
"BSD-3-Clause",
"CDDL-1.0",
"CDDL-1.1",
"ANTLR-PD",
"LGPL-2.0-or-later",
"LicenseRef-scancode-unicode",
"CPL-1.0",
"GPL-2.0-only",
"Classpath-exception-2.0",
"CC-BY-SA-3.0",
"BSD-2-Clause",
"LicenseRef-scancode-other-copyleft",
"LicenseRef-scancode-proprietary-licens... | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... |
Python | UTF-8 | 871 | 3.015625 | 3 | [] | no_license | class Solution(object):
def myAtoi(self, str):
"""
:type str: str
:rtype: int
"""
result_str = ""
for char in str:
if ord(char) in range(48,58) :
result_str+=char
elif result_str=="" and (ord(char) == 45 or ord(cha... |
Java | UTF-8 | 8,568 | 1.757813 | 2 | [
"MIT"
] | permissive | /*******************************************************************************
* The MIT License
*
* Copyright (c) 2019 knokko
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software with... |
Python | UTF-8 | 1,693 | 3.546875 | 4 | [
"MIT"
] | permissive | from collections import deque
def have_enough_firework_punches(fireworks):
return all([value >= 3 for value in fireworks.values()])
firework_effects = deque(list(map(int, input().split(', '))))
explosive_power = list(map(int, input().split(', ')))
fireworks = {
'Palm Fireworks': 0,
'Willow Fireworks': ... |
Java | UTF-8 | 1,510 | 2.359375 | 2 | [] | no_license | package usonsonate.com.tukybirth.SQLite;
import java.io.Serializable;
public class DetalleCiclo implements Serializable {
private String id_detalle = "";
private String id_ciclo = "";
private String fecha_introduccion = "";
private String severidad = "";
private String detalle = "";
public D... |
Python | UTF-8 | 422 | 4.3125 | 4 | [] | no_license | print('\nLisitng 4.5: Better Feedback')
dividend, divisor = eval(input('Please enter two numbers to divide: '))
if divisor != 0:
print(dividend, '/', divisor, '=', dividend/divisor)
else:
print('Division by zero is not allowed')
print('\nListing 4.6: Same different')
d1 = 1.11 - 1.10
d2 = 2.11 - 2... |
Python | UTF-8 | 847 | 2.515625 | 3 | [
"MIT"
] | permissive | import ast
from functools import wraps
from typing import Callable
from pynano.interfaces import NanoError, Scope, Scopes
class Compiler(ast.NodeTransformer):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._scope = Scopes.MODULE
self._symbol_table = Scope()
... |
PHP | UTF-8 | 4,275 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use phpDocumentor\Reflection\Types\Static_;
use Symfony\Component\DomCrawler\Crawler;
class ParsedPost extends Model
{
protected $fillable= ['title','parsed_body'];
public function parsedTags()
{
return $this->belongsToMany('App\Parsed... |
Java | UTF-8 | 4,994 | 2.28125 | 2 | [] | no_license | package com.berk2s.authorizationserver.services.impl;
import com.berk2s.authorizationserver.domain.oauth.Client;
import com.berk2s.authorizationserver.domain.oauth.GrantType;
import com.berk2s.authorizationserver.repository.ClientRepository;
import com.berk2s.authorizationserver.security.SecurityUserDetails;
import co... |
Python | UTF-8 | 2,299 | 2.53125 | 3 | [] | no_license | from lib.data_loader.atlas_settings import super_regions_atlas
import nibabel as nib
import settings
import numpy as np
import csv
def load_atlas_mri():
img = nib.load(settings.mri_atlas_path)
img_data = img.get_data()
atlasdata = img_data.flatten()
bckvoxels = np.where(atlasdata != 0) #Sacamos los in... |
Python | UTF-8 | 4,085 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive |
"""
Fully define a 'random' generated setup for the players per specified conditions
"""
import random
import re
from sc2simulator import constants as c
from sc2simulator.scenarioMgr import Scenario, parseBankXml, getBankFilepath
from sc2simulator.setup import mapLocations
from sc2simulator.setup.mapLocations import... |
Java | UTF-8 | 3,394 | 4.0625 | 4 | [] | no_license | package offer40;
import java.util.Arrays;
import java.util.Random;
/**
* @author wall
* @date 2019/1/20 15:54
* @description 最小的k个数
* 题目:输入n个整数,找出其中最小的k个数。
*/
public class GetLeastNumbers {
//测试
public static void main(String[] args) {
int [] data = new int[]{4,5,1,6,2,7,3,8,9,10,15,12,4,4,4,4};... |
C++ | UTF-8 | 1,634 | 3.234375 | 3 | [] | no_license | class Solution {
public:
vector<vector<int>> matrixBlockSum(vector<vector<int>>& mat, int k) {
int n = mat.size(), m = mat[0].size();
vector<vector<int>> ans(n, vector<int>(m, 0));
vector<vector<int>> dp(n+1, vector<int>(m+1, 0)); // 1-based indexing <-- prefix sums,˘
// com... |
Java | UTF-8 | 9,546 | 2 | 2 | [
"BSD-3-Clause"
] | permissive | package org.yinwang.rubysonar;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.apache.commons.cli.BasicParser;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.Options;
import org.jetbrains.annotations.NotNull;
import ... |
Markdown | UTF-8 | 2,630 | 2.8125 | 3 | [] | no_license | ---
title: "Paul Du Noyer: Classic Albums Students Should Still Be Listening To"
slug: "paul-du-noyer-classic-albums-students-should-still-be-listening-to"
date: "2015-09-17"
author: "Matt Hacke"
rating: "undefined"
---
I have interviewed many hundreds of musicians down the years, including Madonna, Morrissey, U2, and... |
PHP | UTF-8 | 2,966 | 2.796875 | 3 | [] | no_license | <!DOCTYPE html>
<!--
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.
-->
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<pre>
<form ac... |
Shell | UTF-8 | 231 | 3.890625 | 4 | [
"MIT"
] | permissive | #!/bin/bash
# Print a file excluding comments
if [[ -z "$1" ]]; then
echo "Usage: $0 <file>" >&2
exit 1
fi
# check valid file
if [ ! -f "$1" ]; then
echo "File does not exist: $1" >&2
exit 1
fi
grep -v '^$\|^\s*\#' "$1"
|
Shell | UTF-8 | 2,048 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env bash
# Copyright 2017 The Kubernetes Authors.
#
# 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 applicab... |
Java | UTF-8 | 579 | 2.65625 | 3 | [] | no_license | package com.example.bishe.Util;
import android.util.Log;
import static androidx.constraintlayout.widget.Constraints.TAG;
public class NumberToChn {
static String CHN_NUMBER[] = {" ", "一", "二", "三", "四", "五", "六", "七", "八", "九"};
public static String inttoCHn(int i) {
Log.e(TAG, "inttoCHn: " + i);
... |
Java | UTF-8 | 10,096 | 2.1875 | 2 | [] | no_license | package com.camsys.carmonic.networking;
import com.camsys.carmonic.constants.Constants;
import java.security.cert.CertificateException;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
im... |
Python | UTF-8 | 33,567 | 3.09375 | 3 | [] | no_license | import cv2
import numpy as np
import tensorflow as tf
import config
import util
############################################################################################################
# seg_gt calculation #
####################... |
SQL | UTF-8 | 1,157 | 4.03125 | 4 | [] | no_license | CREATE DEFINER=`administrator`@`localhost` FUNCTION `is_active`(DID INT) RETURNS tinyint(1)
BEGIN
-- Check if deal is active, returning 1 if true or 0 if false.
-- Select Deal Type then check if active based on whether deal is recurring or limited.
SELECT bdv.deal_type into @type
FROM business_deals_view bdv
... |
Java | UTF-8 | 1,083 | 2.390625 | 2 | [] | no_license | package com.ifc.myelinflow.dto;
import java.io.Serializable;
import java.util.Objects;
import java.util.Set;
public class SourceSchemas implements Serializable {
private String key;
private Set<String> schemas;
public SourceSchemas(String key, Set<String> schemas) {
this.key = key;
this.... |
C# | UTF-8 | 991 | 2.625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraRotate : MonoBehaviour
{
private enum RotationAxis
{
MouseX = 1,
MouseY = 2
}
[SerializeField] private RotationAxis axis = RotationAxis.MouseX;
private float minimumVert = -90f;
... |
JavaScript | UTF-8 | 444 | 3.28125 | 3 | [] | no_license | var http = require('http');
var underscore = require('underscore');
//variable declaration
var num = [1, 2, 3];
var newNum = [];
var server = http.createServer(function (request, response) {
response.writeHead(200, { "content-type": "text/plain" });
underscore.map(num, function(num){
newNum.push(num *... |
JavaScript | UTF-8 | 2,554 | 2.59375 | 3 | [
"MIT"
] | permissive | const path = require('path');
const fs = require('fs-extra-promise');
const matchAll = require('string.prototype.matchall');
const baseDir = path.join(__dirname, 'src');
const selectedFiles = [];
const processFile = async function(filePath) {
const stats = await fs.statAsync(filePath);
if(stats.isDirectory()) {
... |
Python | UTF-8 | 1,245 | 2.78125 | 3 | [] | no_license | import random
from Items import *
from Classes import *
def Online_Combat(AtkPlayer, DefPlayer, skill):
if skill != "melee" and skill != "magic" and skill != "range":
#if skill != 0:
if AtkPlayer.skilltree[skill][4] == 0:
return random.randint(int(AtkPlayer.skilltree[skill][0]/3), int(... |
C++ | UTF-8 | 3,230 | 2.578125 | 3 | [
"MIT"
] | permissive | /*
* Copyright (C) 2012-2014 Alexey Shcherbakov
* Copyright (C) 2014-2015 Matt Broadstone
* Contact: https://github.com/mbroadst/qamqp
*
* This file is part of the QAMQP Library.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* Lic... |
C | UTF-8 | 1,403 | 3.296875 | 3 | [] | no_license |
#include <stdio.h>
#include <time.h>
#include <omp.h>
#include <stdlib.h>
// generate a random between low to high inclusive
int generateRandom(int low, int high)
{
int n = high - low + 1;
int rd = rand();
int ret = rd%n + low;
return ret;
}
int main(int argc, char *argv[])
{
srand((unsigned int... |
JavaScript | UTF-8 | 924 | 2.703125 | 3 | [] | no_license | import React, { PureComponent,createRef,forwardRef } from "react";
class Home extends PureComponent {
render() {
return <div>
<h2>Home</h2>
</div>;
}
}
const EnhanceAbout = forwardRef(
function(props,ref){
return(
<p ref={ref}>About</p>
)
}
)
export default cla... |
Python | UTF-8 | 2,273 | 2.921875 | 3 | [] | no_license | #!/usr/bin/env python3
"""Script for Tkinter GUI chat client."""
import socket
from socket import AF_INET, SOCK_STREAM
from threading import Thread
from tkinter import *
firstclick = True
def on_entry_click(event):
"""function that gets called whenever entry1 is clicked"""
global firstclick
if firstclick... |
C# | UTF-8 | 1,510 | 2.8125 | 3 | [
"MIT"
] | permissive | using System;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
namespace BuildsAppReborn.Infrastructure
{
public static class HttpRequestHelper
{
#region Public Static Methods
public static async Task<HttpResponseMessage>... |
JavaScript | UTF-8 | 978 | 2.515625 | 3 | [] | no_license | /**
* Created by Matt on 4/14/2016.
*/
var SchedulerProcess1 = function(counter)
{
switch(counter)
{
case 0:
console.log("case 0 Processes 1");
OS.FS.create("file", "file Content");
//this.program_counter++;
break;
case 1:
console.l... |
PHP | UTF-8 | 2,777 | 2.5625 | 3 | [] | no_license | <?php
session_start();
if (isset($_GET['deleteId'])) {
$id= $_GET['deleteId'];
include_once("../const/mysqli-connection.php");
$query = "DELETE FROM interviews WHERE id =$id";
$result = mysqli_query($dbConnection, $query);
if ($result==true) {
$_SESSION['inte... |
Python | UTF-8 | 2,118 | 2.75 | 3 | [] | no_license | from django.db import models
from search.models import *
from account.models import *
def put_offer(offer):
'''Put offer in table of offers, and update table of users
'''
# create offer
new_offer = Offer(**offer)
# put in table of offers
new_offer.save()
course = offer['course']
... |
C++ | UTF-8 | 10,021 | 3.765625 | 4 | [] | no_license | /**
* Howon Kim
* CIS 22C
* List.cpp
*/
#include <iostream>
#include <cstdlib>
#include "List.h"
using namespace std;
/*
//**************************************************
// Constructor *
// Initialize the fields inside the list class *
//********************... |
Markdown | UTF-8 | 8,208 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | # Sola V2
A simple golang web framwork based middleware.
+ [Change Log](./CHANGELOG.md)
## 内部错误(无法修复)
+ v2.1.0 & v2.1.1 内部版本号变量误标记为 `2.0.0`
## Quick Start
基本的 sola 程序 (Hello World) 如下:
```go
package main
import (
"net/http"
"github.com/ddosakura/sola/v2"
)
// handler
func hw(c sola.Context) error {
// 输出 H... |
Java | UTF-8 | 664 | 2.71875 | 3 | [] | no_license | public class LogicaVenda {
private Custo iv = new CustoValorTotal();
private Custo taxa;
public Custo getSeguro() {
return taxa;
}
public void setSeguro(Custo taxa) {
this.taxa = taxa;
}
public double calcularTotal(Venda venda) {
venda.setTotal(0.0);
... |
C# | UTF-8 | 1,465 | 3.359375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Day_12
{
class Program
{
static void Main(string[] args)
{
var lines = File.ReadLines("./input.txt");
IDictionary<int, ICollection<int>> pipes = new Dictionary<int, ICollectio... |
C# | UTF-8 | 1,514 | 2.515625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Mp3TagLib;
using Mp3TagLib.Operations;
using Mp3TagLib.Plan;
using Mp3TagLib.Sync;
namespace mp3tager.Operations
{
class LateSync:Operation
{
public const int ID =... |
Python | UTF-8 | 1,988 | 2.65625 | 3 | [
"MIT"
] | permissive | import queue
import threading
import logging
import time
import math
import win32api
import engine.worlds.message as world
logger = logging.getLogger(__name__)
class SimpleInput(threading.Thread):
def __init__(self, queue_world):
threading.Thread.__init__(self)
self.event_end = threading.Event()
... |
C# | UTF-8 | 2,515 | 2.859375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Data.Entity.Validation;
using System.Text;
using DataAccessLayer.Entities;
using DataAccessLayer.Repostiory;
namespace DataAccessLayer.UnitOfWork
{
public class UnitOfWork : IUnitOfWork
{
public FinalWordLearn Context { get; set; ... |
Python | UTF-8 | 1,589 | 3.046875 | 3 | [] | no_license | import gviz_api
from flight_scraper.utils.scraper import get_prices_by_query_dates
def graph_prices(flight_scraper):
"""
This function creates a Google Visualizations DataTable JSON object.
It is then passed to the Google Visualizations API to be rendered.
"""
description = {"query_date" :... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.