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 |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 420 | 3.328125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import requests
url = "https://www.baidu.com"
response = requests.get(url) # 发送get请求
#print(response) #返回的是一个状态码
# 获取网页的html的字符串
# response.encoding = 'utf-8'
# print(response.text)
# 获取网页的二进制编码格式
# print(response.content)
# 将上述响应的字节流转换成str类型
print(response.content.decode(... |
PHP | UTF-8 | 3,109 | 2.78125 | 3 | [] | no_license | <?php
namespace App\Http\Controllers\Leads;
use App\Leads\Lead;
use App\Contacts\Contact;
use App\Companies\Company;
use App\Http\Controllers\BaseController;
class LeadsController extends BaseController
{
/**
* Lead Model.
*/
protected $model;
/**
* Company Model.
*/
protected $c... |
C++ | UTF-8 | 454 | 3.140625 | 3 | [] | no_license | #include<iostream>
using namespace std;
class A
{
int x;
static int y;
public:
void get(int a)
{
x=a;
y++;
}
void disp()
{
cout<<x<<" "<<y<<endl;
}
static void PR()
{
cout<<"\n"<<y<<endl;
}... |
Java | UTF-8 | 2,664 | 3.28125 | 3 | [] | no_license | package algorithm.forbidden;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* Created by HunJin on 2016-11-23.
*/
public class XHAENEUNG {
public static void main(String[] args) throws IOException {
String[] numbers = {"zero", "one", "two", "three", "fou... |
Go | UTF-8 | 4,274 | 2.65625 | 3 | [] | no_license | package player
import (
"fmt"
"github.com/hajimehoshi/ebiten"
"github.com/hajimehoshi/ebiten/ebitenutil"
"github.com/joshjiang/go-gundam/pkg/piece"
"github.com/joshjiang/go-gundam/pkg/piece/village"
"log"
"math"
)
// Player ...
type Player struct {
currentImage, imageDown, imageUp, imageLeft, imageRight,
ima... |
C# | UTF-8 | 403 | 3.109375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
namespace Shapes3d
{
public class Ball : Shape
{
public Ball(double r)
{
_r = r;
}
double _r = 0;
double R
{
get => _r;
}
public override double ... |
Java | UTF-8 | 167 | 1.664063 | 2 | [] | no_license | package GameZone3;
public class Test {
public static void main(String[] args) {
FullDeck mazo = new FullDeck();
mazo.imrpimirFullDeck();
}
}
|
Markdown | UTF-8 | 890 | 3.65625 | 4 | [] | no_license | ---
title: "配列を逆順にする (array_reverse)"
date: "2012-12-24"
---
array_reverse の使い方
----
配列の要素を逆順に並び替えるには、`array_reverse` 関数を使用します。
~~~ php
$arr = array(2, 1, 3);
$arr = array_reverse($arr); // => [3, 1, 2]
~~~
`array_reverse` は渡した配列の内容を変更せず、逆順にした配列を戻り値として返します。
引数で渡した配列自体を変更したい場合は、上記のように、戻り値を自分自身に代入する必要があります。
`array_... |
C++ | UTF-8 | 6,771 | 3.78125 | 4 | [] | no_license | /*
Assignment_4 - Safe Matrix
Prepared for Dr. Waxman, June 9, 2015
CS780 Advanced OOP in C++
by Alex White
*/
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
template <class T>
class SafeArray
{
public:
/* Default Constructor*/
SafeArray() :... |
Java | UTF-8 | 31,140 | 2.1875 | 2 | [] | no_license | package com.cart.model;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import org.springframework.jdbc.core.... |
Java | UTF-8 | 2,070 | 1.898438 | 2 | [] | no_license | /*
* @(#)CategoryDao.java
*
* Copyright 2011 Xinhua Online, Inc. All rights reserved.
*/
/**
*
*/
package com.winxuan.ec.dao;
import java.util.List;
import java.util.Map;
import com.winxuan.ec.model.channel.Channel;
import com.winxuan.ec.model.channel.ChannelUploadHistory;
import com.winxuan.framework.dynamicd... |
C# | UTF-8 | 3,665 | 2.828125 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MaterialDesignExtensionsBuildUtility
{
public class Program
{
public static void Main(string[] args)
{
try
... |
Markdown | UTF-8 | 1,280 | 2.703125 | 3 | [] | no_license | # Attempting Voynich manuscript due to COVID-19-induced boredom
At the moment methods based on unsupervised machine translation are being implemented.
Roughtly speaking, the idea is to train monolingual word embeddings (their optimal dimensionality
[can be estimated](http://papers.nips.cc/paper/7368-on-the-dimensional... |
Python | UTF-8 | 526 | 2.90625 | 3 | [] | no_license | import random
sum = 0
for i in range(1000):
p = [[random.randint(1,80) for j in range(5)] for j in range(100)]
w = False
pinakas = []
while w == False:
R = random.randint(1,80)
if R not in pinakas:
pinakas.append(R)
for player in p:
if R... |
Java | UTF-8 | 776 | 3.65625 | 4 | [] | no_license | import java.util.Scanner;
public class main {
public static void main(String[] args) {
Scanner Input = new Scanner(System.in);
String animal = "Cat";
String guess = "";
int guessCount = 0;
int guessLimit = 3;
boolean noMoreGuess = false;
while (!guess.equal... |
C++ | UTF-8 | 4,239 | 3.015625 | 3 | [
"Apache-2.0"
] | permissive | #include "snake.h"
#include <time.h>
#include <unistd.h>
extern int width;
extern int height;
extern int score;
extern int first_tiles;
snake::snake()
{
Init();
}
snake::~snake()
{
}
void snake::Init()
{
snake_part* s = new snake_part;
s->gen_x_y(1, height-1);
list_snake.push_back(s);
spawn_... |
PHP | UTF-8 | 4,891 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace frontend\controllers;
use Yii;
use yii\web\UploadedFile;
use yii\filters\AccessControl;
use yii\web\Controller;
use yii\web\Response;
use yii\filters\VerbFilter;
use app\models\Dataimportone;
class ScriptOneUserImportfileController extends Controller
{
public function actionEntry()
{
... |
Python | UTF-8 | 3,337 | 3.453125 | 3 | [] | no_license | import L9_BoardGame as L9
class Token:
def __init__(self, color, pos_x=0, pos_y=0):
self.color = color # array [peasant symbol, King symbol ] or [O, Ô]
self.status = "peasant" # array [ alive / dead, king / peasant]
self.pos_x = pos_x
self.pos_y = pos_y
self.symbol = colo... |
Python | UTF-8 | 494 | 3.59375 | 4 | [] | no_license | # counter = 156
# while counter < 166:
# n = counter - 155
# print(n)
# counter = counter + 1
sum = 0
n = int(input("enter the input number : "))
i = 1
while i <=n:
num = int(input("enter the valu : "))
sum = sum + num
i = i + 1
print(sum)
# sum = 0
# n = int(input("enter the number : "))
#... |
C++ | UTF-8 | 1,819 | 2.859375 | 3 | [] | no_license | #include "RocketBooster.h"
/**
* @brief Construct a new Rocket Booster:: Rocket Booster object
*
* @param id is the booseter name/id
* @param NumberOfEngines the number of engines to add to the booster
*/
RocketBooster::RocketBooster(string id, int NumberOfEngines) : Engine(id, 845, "PX/L1") {
numEn... |
PHP | UTF-8 | 2,537 | 2.515625 | 3 | [] | no_license | <?php
include "includes/header.php";
//echo "<h2>Add Advantages</h2>";
if(isset($_REQUEST['updat']))
{
$res=mysql_fetch_array(mysql_query("select * from bus_delivery where bus_id='$_REQUEST[updat]'"))or die(mysql_error());
}
//echo "testing";
if(isset($_REQUEST['submit']))
{
//echo "testing";
$state=$_REQUEST['st... |
Markdown | UTF-8 | 2,365 | 3.46875 | 3 | [
"MIT"
] | permissive | # [589. N 叉树的前序遍历](https://leetcode-cn.com/problems/n-ary-tree-preorder-traversal)
[English Version](https://github.com/yanglr/leetcode-ac/blob/master/assets/0500-0599/0589.N-ary%20Tree%20Preorder%20Traversal/README_EN.md)
## 题目描述
<!-- 这里写题目描述 -->
<p>给定一个 N 叉树,返回其节点值的<strong> 前序遍历</strong> 。</p>
<p>N 叉树 在输入中按层序遍历进... |
Java | UTF-8 | 570 | 3.046875 | 3 | [] | no_license | package hw4;
public class Solution52 {
public String binToStr(double num){
if(num>1||num<0){
return "ERROR";
}
StringBuffer str = new StringBuffer();
str.append("0.");
while(num>0){
if(str.length()>32)
return "ERROR";
double temp = num*2;
if(temp>=1){
str.append(1);
num=temp-1;
... |
Java | UTF-8 | 1,138 | 2.453125 | 2 | [] | no_license | package org.javenstudio.android.entitydb;
import org.javenstudio.cocoka.database.SQLiteEntityDB;
import org.javenstudio.common.entitydb.IEntity;
import org.javenstudio.common.entitydb.IIdentity;
import org.javenstudio.common.entitydb.type.LongIdentity;
public class TAccountUpdater extends SQLiteEntityDB.TUpdater {
... |
Java | UTF-8 | 1,682 | 2.1875 | 2 | [] | no_license | package com.lingdian.dangjian.ui.presenter;
import com.lingdian.dangjian.api.Api;
import com.lingdian.dangjian.base.RxPresenter;
import com.lingdian.dangjian.ui.bean.Sanhui;
import com.lingdian.dangjian.ui.contract.SanhuiContract;
import javax.inject.Inject;
import rx.Observer;
import rx.Subscription;
import rx.and... |
Markdown | UTF-8 | 1,680 | 2.875 | 3 | [] | no_license | ---
layout: page
title: Conway Game of Life
description: A Code Generation in Game of Life for JavaFX and Java with Maven
img: /assets/img/gol-screenshot.png
date: September 2, 2019
comments: true
---
I read an interesting article about Conway's Game of Life about unique pattern in zero-player game. To interact with G... |
Python | UTF-8 | 5,020 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | import requests
import json
import urllib
import datetime
from .models import CarDealer, DealerReview
from requests.auth import HTTPBasicAuth
from .local_settings import NLU_API_KEY, NLU_API_URL
def get_request(url, api_key=None, **kwargs):
print(kwargs)
print("GET from {} ".format(url))
try:
# Ca... |
Java | UTF-8 | 3,844 | 1.992188 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] | permissive | /*
* Copyright (c) 2016-2017 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the L... |
Java | UTF-8 | 7,372 | 2.03125 | 2 | [] | no_license | package com.maklersoft.springbe.models;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Field;
import java.util.ArrayList;
@Data
public class Request {
/*private Long id;
private Long accountId;
private Long agentId;
private User agent;
private Long personId;
pr... |
Python | UTF-8 | 69 | 2.671875 | 3 | [] | no_license | from pylab import *
i = 20
while i >= 0:
print(i)
i = i - 1 |
Markdown | UTF-8 | 3,989 | 2.765625 | 3 | [] | no_license | # Porres's Puredata tutorial (Developer Guidelines)
Porres made the original work. Lunhani make a "translation", in sense that PD patchs can be executed in [WebPD]({{ webpd.website }}) environment (or at least, the available [things](https://github.com/sebpiq/WebPd/#list-of-implemented-objects-and-other-limitations)).... |
C++ | UTF-8 | 680 | 3.671875 | 4 | [] | no_license | // 50. Pow(x, n)
// https://leetcode-cn.com/problems/powx-n/
// 由于整型的正数比负数少了一位,因此最小值不能直接取负
// 必须要转换一下类型
class Solution {
public:
double myPow(double x, int n) {
int flag = 0;
long long N = (long long)n;
if (N < 0){
N = - N;
flag = 1;
}
return flag =... |
Java | UTF-8 | 354 | 3.09375 | 3 | [] | no_license | public class Token {
protected int type;
protected String lexeme;
protected int line;
public Token(int type,String lexeme,int line){
this.type=type;
this.lexeme=lexeme;
this.line=line;
}
public int getLine(){
return this.line;
}
public int getType(){
return this.type;
}
public String getLex... |
Java | UTF-8 | 596 | 2.546875 | 3 | [] | no_license | package test;
import battleship.EmptySea;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class EmptySeaTest {
@Test
void shootAt() {
EmptySea emptySea = new EmptySea();
emptySea.setBowRow(1);
emptySea.setBowColumn(2);
assertFalse(emptySea... |
C++ | UTF-8 | 2,675 | 2.671875 | 3 | [] | no_license | #include "include/mathfunction.hpp"
namespace Icarus
{
double mathfunction::eval(double x, double y, double z, int plane)
{
switch (_type)
{
case 0: return _val;
// 1: u, 2: f, 3: dirichlet, 4: neumann
case 1: return (0.5-x)*(0.5-y)*(0.5-z);
case 2: return 0.0;
case 3: return (0.5-x)*(0.5-... |
Python | UTF-8 | 10,593 | 3.40625 | 3 | [] | no_license | from typing import List, Set, Callable
DIRECTIONS = ["north", "northeast", "east", "southeast", "south", "southwest", "west", "northwest"]
class Board:
"""TODO"""
def __init__(self, dimensions: int=8):
assert dimensions % 2 == 0
self.dimensions = dimensions
self.layout = []
se... |
Java | UTF-8 | 5,075 | 2.578125 | 3 | [] | no_license | package no.uib.cipr.rs.upscale;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import no.uib.cipr.matrix.DenseVector;
import no.uib.cipr.matrix.Matrices;
import no.uib.cipr.matrix.Matrix;
import no.uib.cipr.matrix.Vector;
import no.uib.cipr.mat... |
Python | UTF-8 | 3,297 | 3.09375 | 3 | [
"BSD-3-Clause"
] | permissive | '''
Utility Functions for evaluation scenario
'''
import numpy as np
import torch
from sklearn.preprocessing import StandardScaler
'''
get_latent_space:
This function takes a model and dataloader object,
feeds all samples through the model and extracts and concatenates
samples from the required space an... |
JavaScript | UTF-8 | 466 | 2.515625 | 3 | [
"MIT"
] | permissive | window.ViewUtils = (function () {
function showUnshowRenderer (selector) {
return {
render () {
Array.from(document.querySelectorAll(selector)).forEach(function (el) {
el.classList.remove('hidden');
});
},
unrender () {
Array.from(document.querySelectorAll(selec... |
C | UTF-8 | 137 | 2.53125 | 3 | [] | no_license | #include<stdio.h>
int f1();
void main(){
int res;
res=sum();
printf("%d",res);
}int sum(){
int a=2,b=3,sum;
sum=a+b;
return sum;
}
|
C++ | UTF-8 | 3,009 | 3.453125 | 3 | [] | no_license | #include "Bresenham.h"
void Bresenham(int x1, int y1, int x2, int y2, std::vector<Location>& locationVec)
{
bool swapflag = false;
if (x1 > x2){
int tmpx = x1;
int tmpy = y1;
x1 = x2;
y1 = y2;
x2 = tmpx;
y2 ... |
Java | UTF-8 | 1,864 | 2.09375 | 2 | [
"Apache-2.0"
] | permissive | package models;
import java.util.List;
/**
* Created by John Edison on 23/04/2017.
*/
public interface IFachada {
/**
* Datos del Paciente
*/
public String getName();
public void setName(String name);
public String getAddress();
public void setAddress(String address);
public S... |
C | UTF-8 | 958 | 3.484375 | 3 | [] | no_license | /* SYSC 2006 Winter 2019 Lab 10
*
* circular_queue.h - circular linked-list implementation of a queue.
*/
/* A queue consists of exactly one instance of the queue_t struct,
* which points to a linked list containing 0 or more instances of the
* node_t struct.
* All instances are allocated from the h... |
C | UTF-8 | 6,212 | 2.53125 | 3 | [] | no_license | #include "robotapp.h"
#include <stdbool.h>
//writen by Dries Blontrock
void RobotApp(int argc, char *argv[])
{
// Variables
int Speed = 85;
int result = -1;
//deactiveert deel van de code in verband met lift
bool picker = false;
//debug false zorgt er voor dat er packeten moeten ontvangen word... |
Java | UTF-8 | 1,094 | 2.546875 | 3 | [
"MIT"
] | permissive | package com.company.automation.pagemodels;
import com.magenic.jmaqs.selenium.BaseSeleniumPageModel;
import com.magenic.jmaqs.selenium.SeleniumConfig;
import com.magenic.jmaqs.selenium.SeleniumTestObject;
import com.magenic.jmaqs.selenium.factories.UIWaitFactory;
import org.openqa.selenium.By;
/**
* The type Home pag... |
C# | UTF-8 | 1,596 | 2.59375 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace ScottPlo... |
Java | UTF-8 | 3,859 | 2.078125 | 2 | [
"MIT"
] | permissive | package com.postbox.config.security;
import com.postbox.config.security.CustomAuthenticationFailureHandler;
import com.postbox.config.security.CustomAuthenticationSuccessHandler;
import com.postbox.config.security.CustomLogoutSuccessHandler;
import com.postbox.config.security.CustomUserDetailsService;
import org.sprin... |
C++ | UTF-8 | 832 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
using namespace std;
inline int read ()
{
char c;
int n = 0;
while ((c = getchar_unlocked ()) < 48);
n += (c - '0');
while ((c = getchar_unlocked ()) >= 48)
n = n * 10 + (c - '0');
return n;
}
int fibo[1000000] = {0};
void generate_fibonacci_numbers()
{
int f0 = 0... |
JavaScript | UTF-8 | 912 | 2.6875 | 3 | [] | no_license | function Iron (params) {
var self = this;
var maxBits = 128;
var bitIntervalTime = 10000;
var interval = void 0;
self._id = params._id;
self.place = params.place;
self.bits = params.bits;
self.name = "iron";
function bitInterval() {
if (self.bits < maxBits) {
self... |
Java | UTF-8 | 1,432 | 4.09375 | 4 | [] | no_license | package com.company;
///*Create a method that returns the pricing for a requested number of books. Five books at $20.00 should return $100, if they are in stock. If they are not in stock, that should be handled appropriately (hint - you decide).*
import java.util.Scanner;
public class BookclassApp {
public stati... |
Java | UTF-8 | 696 | 2.21875 | 2 | [] | no_license | package com.model;
public class VideoModel {
private String id;
private String Title;
private String Path;
private String Region;
private String RegionId;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTitle() {
return Title;
}
public void setTi... |
Markdown | UTF-8 | 5,590 | 3.03125 | 3 | [
"MIT"
] | permissive | ---
layout: post # 使用的布局(不需要改)
title: React 的优势 # 标题
subtitle: #副标题
date: 2018-11-12 # 时间
author: liangping # 作者
header-img: img/react.jpg #这篇文章标题背景图片
catalog: true # 是否归档
tags: #标签
- React
---
# React优势
1. 声明式的写法,不需要关心如何渲染,只需要声明渲染什么
2. React.js 相对于直接操作原... |
Java | UTF-8 | 2,861 | 2.921875 | 3 | [] | no_license | package core.connect.database;
import java.sql.*;
public class DatabaseCommands {
private final String url = "jdbc:postgresql://localhost/mediator";
private final String user = "postgres";
private final String password = "123";
private Connection connection = null;
public DatabaseCommands() {
... |
Java | GB18030 | 863 | 3.984375 | 4 | [] | no_license | /*
3࣬һ Person ࣬һ Gun ࡣ Gun һ(int )ʼΪ 5
һװӵķ pushӵķ popPerson һʵ shoot
Gun popôģһ˿ǹḶ́װӵװ˾Ͳװ
ûӵװӵȥ
:
(1)һPerson, һʵshoot()
(2)һGun, һ(int )ʼΪ 5һװӵķ pushӵķ pop
*/
package cn.onedull.expand03;
public class Demo {
public static void main(String[] args) {
Person person = new Person();
//װӵ
person.gun.push();
... |
JavaScript | UTF-8 | 4,754 | 2.6875 | 3 | [] | no_license | const express = require("express");
const router = express.Router();
const Todo = require("../models/todo");
const Container = require("../models/container");
const Board = require("../models/board");
/* TODO ROUTES */
// Create new Todo
router.post("/api/todo/new", async (req, res) => {
const todo = new Todo(req.bod... |
Java | UTF-8 | 1,775 | 2.421875 | 2 | [] | no_license | package ru.itis.scheduleplatform.services.handlers;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import ru.itis.scheduleplatform.constants.Const;
import ru.itis.scheduleplatform.dto.GeneratorParameters;
import ru.itis.scheduleplatform.dto.ScheduleParameters;
import ru.itis.schedulep... |
JavaScript | UTF-8 | 974 | 2.625 | 3 | [] | no_license | var modal = document.getElementById('myModal');
var reviewText = document.getElementById("review-text");
var reviewTitle = document.getElementById("review-title");
var bgImage = document.getElementById("bg-image");
var span = document.getElementsByClassName("close")[0];
function reviewButton_onClick(elem) {
revie... |
Markdown | UTF-8 | 5,064 | 4.125 | 4 | [
"MIT"
] | permissive | ---
layout: post
title: "Math"
permalink: /math/
date: 2019-02-01 12:33
image: ../assets/images/mean.png
categories: math python code
---
In this blogpost I will be talking about the how we can represent math in code. The similarities and differences and how code can make summnation easier to understand Also in th... |
Markdown | UTF-8 | 2,101 | 3.765625 | 4 | [] | no_license | ### CLASS 05
## LYNKED LIST
#### What's a Linked List?
- A linked list is alinear data structure similar to an array but unlike arrays
elemets are not stored in a particular index rather each element is a separate
object that contains a pointer or a link to the next object to the list.
- Each element common... |
Java | UTF-8 | 1,271 | 2.265625 | 2 | [] | no_license | package com.henri.couchbench;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import org.apache.log4j.Logger;
import com.four... |
Python | UTF-8 | 2,640 | 2.828125 | 3 | [] | no_license | #!/usr/bin/env python
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
# 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 without restriction, including without limitation
# the r... |
Java | UTF-8 | 384 | 2.015625 | 2 | [] | no_license | package inserts.create_user;
import adt.sql.Insert;
import java.sql.Connection;
import java.sql.SQLException;
public class InsertUserShipping extends Insert {
public InsertUserShipping(Connection conn, Integer shippingInfoId, Integer userId) throws SQLException {
super(conn, "create_user/insert_user_shi... |
C# | UTF-8 | 2,387 | 2.859375 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ArtnetDisplay {
class DataGridViewBarColumn : DataGridViewImageColumn {
public DataGridViewBarColum... |
C# | UTF-8 | 1,047 | 2.546875 | 3 | [
"MIT"
] | permissive | using System.Collections.Generic;
using Assets.Scripts.GameLogic.ActionLoop.ActionEffects;
namespace Assets.Scripts.GameLogic.ActionLoop.Actions
{
public class DisplaceAction : GameAction
{
public ActorData DisplacedActor { get; private set; }
public DisplaceAction(ActorData actorData, ActorData displacedActor... |
C | UTF-8 | 490 | 3.84375 | 4 | [] | no_license | #include <stdio.h>
int main()
{
int n,i;
printf("Enter the array size - ");
scanf("%d",&n);
printf("Enter the elements - ");
int a[n];
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
int start=0,end=n-1,temp;
while(start<end)
{
temp=a[start];
a[start]=a[end];... |
C | UTF-8 | 412 | 4.4375 | 4 | [] | no_license | #include <stdio.h>
//a program that finds and displays the alphabetically first letter
//in a sequence of three characters
int main()
{
char a, b, c, winner;
printf("Enter 3 random letters (all uppercase or lowercase): ");
scanf("%c%c%c", &a, &b, &c);
if(a > b)
winner = c > b ? b : c;
else
winner = ... |
Python | UTF-8 | 261 | 2.765625 | 3 | [] | no_license |
import time
import urllib.request
from bs4 import BeautifulSoup
url = 'https://en.wikipedia.org/wiki/List_of_Wheeler_Dealers_episodes'
response = requests.get(url)
soup = BeautifulSoup(response.text,'html.parser')
rows = soup.find_all('tr')
print(rows[:10])
|
PHP | UTF-8 | 475 | 2.734375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: zhaoyu
* Date: 2019/7/17
* Time: 10:32 AM
*/
namespace app\models;
/**
* 集合接口
* Interface SetInterface
* @package app\models
*/
interface SetInterface
{
public function insert($value);
public function update($index,$value);
public function delete($value... |
JavaScript | UTF-8 | 924 | 2.859375 | 3 | [] | no_license | /**
* Downloads league logos from league dump
*/
const fs = require('fs');
const request = require('request');
const leaguesDump = require('../dumps/leagues_11052019.json');
const leagues = leaguesDump.api.leagues;
/**
* Downloads logo
* @param {string} uri Image url
* @param {string} filename Full path to ima... |
Markdown | UTF-8 | 1,734 | 2.875 | 3 | [
"MIT"
] | permissive | # async-asset
Asynchronously load front-end assets. And with async, we mean truly async.
Loading scripts async isn't that hard but loading a CSS file fully async in
a cross browser manner can be utterly painful. Especially when you try to do
this in the front-end's worst enemy, Internet Explorer. It has limitations on... |
JavaScript | UTF-8 | 622 | 2.828125 | 3 | [] | no_license | export class Song {
static id (song) {
let src = song.src instanceof Array
? encodeURI(song.src[0])
: encodeURI(song.src)
let good = decodeURI(src)
while (good !== src) {
src = good
good = decodeURI(src)
}
return encodeURI(good)
}
}
export class TimeRanges {
static to... |
Java | UTF-8 | 5,354 | 1.859375 | 2 | [] | no_license | /**
*
* Copyright (c) 2014, Openflexo
*
* This file is part of Flexo-foundation, a component of the software infrastructure
* developed at Openflexo.
*
*
* Openflexo is dual-licensed under the European Union Public License (EUPL, either
* version 1.1 of the License, or any later version ), which is avail... |
Python | UTF-8 | 3,473 | 3.046875 | 3 | [] | no_license |
class TextConstants():
@staticmethod
def menu_productError_amount():
return "NO HAY SUFICIENTE STOCK DE ESTE PRODUCTO, SELECCIONE OTRA CANTIDAD. QUEDAN: "
@staticmethod
def discount_yes():
return "yes"
@staticmethod
def discount_no():
return "no... |
C | UTF-8 | 1,985 | 3.59375 | 4 | [] | no_license | #ifndef MATRICES_H
#define MATRICES_H
/*
Cette fonction alloue de la place pour stocker une structure
matrice, un tableau de lignes, ainsi que chaque ligne.
*/
struct matrice_s * creation_matrice ( int nb_lignes , int nb_colonnes ) ;
/*
Cette fonction libère toute la mémoire qui a été allouée dans la
fonctio... |
Shell | UTF-8 | 273 | 2.5625 | 3 | [
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"Apache-2.0"
] | permissive | #!/bin/bash
set -euo pipefail
IFS=$'\n\t'
if [ "$(which clang-format)" == "" ]; then brew install clang-format; fi
if [ "$(which oclint-json-compilation-database)" == "" ]; then brew install oclint --cask; fi
if [ "$(which python3)" == "" ]; then brew install python3; fi
|
C++ | UTF-8 | 3,992 | 2.8125 | 3 | [
"MIT"
] | permissive | /* Copyright (C) 2010-2019, The Regents of The University of Michigan.
All rights reserved.
This software was developed as part of the The Vulcan project in the Intelligent Robotics Lab
under the direction of Benjamin Kuipers, kuipers@umich.edu. Use of this code is governed by an
MIT-style License that can be foun... |
C# | UTF-8 | 385 | 2.59375 | 3 | [] | no_license | using static _globals;
static class _globals
{
[MethodImpl(MethodImplOptions.NoInlining), DebuggerHidden]
public static void Nop<T>(out T x) => x = default(T);
};
class Program
{
static void Main()
{
int i; // unreferenced variable
/// ... |
C | UTF-8 | 2,494 | 2.90625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* strip_line.c :+: :+: :+: ... |
Python | UTF-8 | 288 | 3.265625 | 3 | [] | no_license | #Criando um dicionario para acessar valores atraves
#de uma chave
#Estrutura de dados: Chave-Valor, Tabela Hash, HashTable
jogo = {'time': 'Bahia de Feira'}
jogo['estádio'] = 'Jóia da Princesa'
#JSON = Java Script Object Notation
jogo['jogadores'] = ['Caça rato', 'Raul', 'Antõnio Adão']
print(jogo) |
C | UTF-8 | 1,945 | 3.015625 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2017
** my_sokoban
** File description:
** Contains functions that handles the map string.
*/
#include <stdlib.h>
#include "my.h"
#include "my_sokoban.h"
char *create_str(FILE * const file)
{
char *str = NULL;
char *line = NULL;
size_t alloc = 0;
while (getline(&line, &alloc, file) != -1) ... |
Markdown | UTF-8 | 5,857 | 3.296875 | 3 | [] | no_license | ---
layout: review
title: "Path-SGD: Path-Normalized Optimization in Deep Neural Networks"
tags: optimization
author: "Marco Armenta"
cite:
authors: "Behnam Neyshabur, Rusland Salakhutdinov, Nathan Srebro"
title: "Path-SGD: Path-Normalized Optimization in Deep Neural Networks"
venue: "NEURIPS 2015"
pdf:... |
Python | UTF-8 | 8,365 | 3 | 3 | [
"MIT"
] | permissive | import torch
import numpy as np
from PIL import Image
import torch.nn.functional as F
from scheduler import Scheduler
from lr_scheduler import CustomLRScheduler
from torch.optim.lr_scheduler import ExponentialLR, LambdaLR
def add_batch_dimension(state: np.ndarray):
return np.expand_dims(state, axis=0)
def simul... |
SQL | UTF-8 | 3,812 | 3.453125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 本地
Source Server Version : 50521
Source Host : localhost:3306
Source Database : jfw_2016
Target Server Type : MYSQL
Target Server Version : 50521
File Encoding : 65001
Date: 2016-05-12 22:50:47
*/
SET FOREIGN_KEY_CHECKS=0;
-- -------... |
C++ | UTF-8 | 511 | 3.984375 | 4 | [] | no_license | #include <iostream>
using namespace std;
void zeroBoth(int &var1, int &var2) { // Parameters pass-by-reference; Function change values to 0
var1 = 0;
var2 = 0;
}
int main(int argc, char **argv) { // Make sure to put in command line input for number 1 and number 2
int num1 = atoi(argv[1]); // Command Line ... |
PHP | UTF-8 | 771 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
/**
* Class PostValidator
*
* @author Anthony Umpad
*/
namespace App\Services;
use Validator;
use App\Exceptions\ValidationException;
/**
* Class PostValidator
*
* Source for rules to validate a posts
*/
class PostValidator extends BaseValidator
{
public $rules = [
'uid' => ['required'],
... |
Java | UTF-8 | 1,007 | 3.484375 | 3 | [] | no_license | package com.leetcoode.problems;
import java.util.HashMap;
import java.util.Map;
public class SingleNumber {
public int singleNumber(int[] nums) {
int len = nums.length;
if (len == 1) {
return nums[0];
}
Map<Integer, Integer> map = new HashMap<>();
int res = nums... |
Ruby | UTF-8 | 655 | 2.90625 | 3 | [] | no_license | # The Smalltalk product, upon which MagLev is based, comes with a simple
# code and statistics browser written in Smalltalk. This ruby script
# registers that code into the Ruby namespace, and then starts the
# application. Once it is running, it will print a URL to connect to.
# Register the Smalltalk WebTools ... |
Java | UTF-8 | 2,495 | 2.34375 | 2 | [] | no_license | package com.xinpianchang.fakemiss;
import com.unity3d.player.UnityPlayer;
import com.unity3d.player.UnityPlayerActivity;
import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import andro... |
Markdown | UTF-8 | 3,366 | 3.484375 | 3 | [] | no_license | ---
layout: post
title: Java 自定义参数验证器
categories: Java Validate
---
在服务器端开发过程中,经常需要对一些参数进行验证。比如参数不能为 null ,email 那么必须符合 email 的格式,如果手动进行 if 判断则会导致开发效率太慢,于是就有了 bean validation 框架。
## bean validation 框架验证介绍
validation bean 是基于 JSR-303 标准开发出来的,使用注解方式实现,及其方便,但其实一个接口,没有具体实现。如果使用 SpringBoot 开发的话无需添加该接口的实现,否则需要添加依赖,如: Hibe... |
Java | UTF-8 | 777 | 2.296875 | 2 | [] | no_license | package com.javabase.entity;
import java.io.*;
/**
* 实体bean
*
* @author bruce
*
*/
@SuppressWarnings("serial")
public class SysSourcesRoles implements Serializable {
private final long serialVersionUID = 1L;
private Integer sourceId;// 资源id
private Integer roleId;// 角色id
public SysSou... |
JavaScript | UTF-8 | 12,584 | 3.171875 | 3 | [] | no_license | // Tic Tac Toe Logic
//
// let origBoard;
// const huPlayer = "X";
// const aiPlayer = "O";
// let currentPlayer = huPlayer;
//
//
// const board = [ null, null, null, null, null, null, null, null, null ];
//
// let boardState = null;
//
// const switchPlayer = function() {
// if (currentPlayer === huPlayer) {
// ... |
Python | UTF-8 | 223 | 3.78125 | 4 | [] | no_license | p=float(input("Enter the Principle Amount: "))
n=float(input("Enter the Duration(in years) : "))
r=float(input("Enter the Rate of Interest: "))
simple_interest=(p*n*r)/100
print("The simple interest is: ",simple_interest)
|
Markdown | UTF-8 | 6,302 | 2.90625 | 3 | [
"MIT"
] | permissive | ---
title: Haskell Learners' Group (Session 1)
author: Walker Malling and Richard Cook
layout: learners
categories: learners
date: 2018-04-04
---
A recap of what we talked about during the first meeting of the all-new
Haskell Learners' Group in Seattle
<!--more-->
### Introductions
We went round the room to introduc... |
Java | UTF-8 | 153 | 1.640625 | 2 | [] | no_license | package bv.dev.aspanta.livecoininfo;
// interface for dialog fragments in main activity
public interface IDialogFragmentCallback {
void onDone();
}
|
PHP | UTF-8 | 1,250 | 2.5625 | 3 | [] | no_license | <?php
/**
* Installs the plugin.
*
* @since {{VERSION}}
*
* @package ClientDash
* @subpackage ClientDash/core
*/
defined( 'ABSPATH' ) || die;
/**
* Class ClientDash_Install
*
* Installs the plugin.
*
* @since {{VERSION}}
*/
class ClientDash_Install {
/**
* Loads the install functions.
*
* @since ... |
Python | UTF-8 | 292 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | from .abstract_pin_render import PinRender
class RaspberyPinsRender(PinRender):
def __init__(self, pinout):
self._pinout = [pin for pin in pinout]
def __call__(self, state):
for idx, pin in enumerate(self._pinout):
pin.on() if state[idx] else pin.off()
|
C++ | UTF-8 | 584 | 2.703125 | 3 | [] | no_license | #include<iostream>
#include<string.h>
using namespace std;
int main()
{
char arr[51];
int p,l,i,count,co,j;
while(scanf("%s %d",&arr,&p)!=EOF)
{
count=0;
co=0;
l = strlen(arr);
for(i=0; i<l; i++){
if(arr[i]=='R'){
if(co==0){
... |
Python | UTF-8 | 279 | 3.625 | 4 | [] | no_license | user1=int(input("enter the user1"))
user2=int(input("enter the user2"))
user3=int(input("enter the user3"))
if user1==user2==user3:
print("it is eqvilater")
elif user1==user2 or user2==user3:
print("it is isocale")
else:
print("it is scalane")
|
C++ | UTF-8 | 2,724 | 2.859375 | 3 | [] | no_license | #pragma once
#include <Circe/Circe.h>
#include <map>
#include <string>
#include <memory>
#include <utility>
#include <iostream>
namespace Medusa
{
using namespace std;
template<typename R> class ResourceLoader;
template<typename ResHandle, typename R, typename RLoader> class ResourceManager;
template<typename... |
Java | UTF-8 | 2,068 | 3.5625 | 4 | [] | no_license | package com.msh.solutions._215_Kth_Largest_Element_in_an_Array;
import java.util.Comparator;
import java.util.PriorityQueue;
/**
* Created by monkeysayhi on 2018/1/5.
*/
public class Solution {
// solution 2:维护大小为k的最小堆,碰到大于等于的元素就出队入队,最后取堆顶
// 稳定O(nlogk)
public int findKthLargest(int[] nums, int k) {
// no... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.