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 | 865 | 2.75 | 3 | [] | no_license | import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public class Table {
public String table_name;
public int num_atts;
public List<String[]> atts_details;
public int num_records;
public int old_num_of_records;
Table(String name, HashM... |
PHP | UTF-8 | 2,038 | 2.65625 | 3 | [] | no_license | <?php
namespace Pandora\Service;
use Pandora\Config;
use Pandora\Http\Client;
final class LogDbService {
private $repoName;
private $auth;
public function __construct($repoName, $auth) {
$this->repoName = $repoName;
$this->auth = $auth;
}
/**
* @param string $queryString ... |
C# | UTF-8 | 2,034 | 2.546875 | 3 | [] | no_license | using System;
using Leaf.Parsing.AST.StatementNodes;
using Leaf.Parsing.AST.FunctionNodes;
using System.Collections.Immutable;
using System.Collections.Generic;
using System.CodeDom.Compiler;
using System.Linq;
using Leaf.Parsing.Grammar;
namespace Leaf.Parsing.AST.ValueNodes
{
public class FunctionCallNode : ValueNo... |
Python | UTF-8 | 4,547 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | """
filename: MultiStrokeFeatureObserver.py
description:
Doctest Examples:
"""
#-------------------------------------
import os
import math
import pdb
from Utils import GeomUtils
from Utils import Logger
from SketchFramework import Point
from SketchFramework import Stroke
from SketchFramework... |
Java | UTF-8 | 1,702 | 3.34375 | 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 Student;
import java.util.Scanner;
/**
*
* @author hi
*/
public class Student implements Comparable<Student>{... |
C++ | UTF-8 | 7,020 | 3.40625 | 3 | [] | no_license | #include "identificativo.h"
#include <algorithm>
const std::string Identificativo::VOCALI("AEIOU");
Identificativo::Identificativo() : Sesso(), nome(""), cognome("") {}
Identificativo::Identificativo(std::string n, std::string c) : Sesso(), nome(n), cognome(c) {}
Identificativo::Identificativo(const Identificat... |
Java | UTF-8 | 3,359 | 1.820313 | 2 | [] | no_license | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.adsdk.sdk.video;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import androi... |
Java | UTF-8 | 14,838 | 1.773438 | 2 | [
"Apache-2.0"
] | permissive | package com.wisdom.acm.szxm.service.doc.impl;
import com.alibaba.nacos.client.logger.Logger;
import com.alibaba.nacos.client.logger.LoggerFactory;
import com.github.pagehelper.PageInfo;
import com.google.common.base.Stopwatch;
import com.google.common.collect.Maps;
import com.wisdom.acm.szxm.common.SzxmCommonUtil;
imp... |
Markdown | UTF-8 | 834 | 2.796875 | 3 | [] | no_license | # 第三次实验
## 1.实验目标
掌握在Android应用中使用图片等资源的方法。
## 2.实验步骤
阅读实验要求:https://github.com/hzuapps/android-labs-2018/labels/Lab
## 3.实验要求
1.在界面上显示至少一张图片(按照自己的题目添加);
2.提交res/drawable及图片使用的代码;
3.提交res/values, res/layout等其他代码;
4.将应用运行结果截图,放到实验报告中;
5.点击图片(或按钮)时,打开另一个Activity。
6.在电脑上Android Studio编写代码
// 代码要可以运行!
## 4.实验结果

with open(sys.argv[1], 'r') as f:
lines = [[int(d) for d in e] for e in [a.split(" ") for a in f][:-1]]
for i in range(len(lines)-1, 0, -1):
lines[i-1] = [lines[i-1][j]+max(lines[i][j], lines[i][j+1]) for j in range(0,... |
Java | UTF-8 | 1,025 | 2.625 | 3 | [] | no_license | package contacts.parser;
import contacts.Contact;
import java.io.File;
import java.util.ArrayList;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
public class Parser {
public ArrayList<Contact> getContacts(... |
C# | UTF-8 | 1,161 | 2.75 | 3 | [] | no_license | using UnityEngine;
namespace Assets.Data
{
public class CameraController : MonoBehaviour
{
float mainSpeed = 100.0f; //regular speed
private float totalRun = 1.0f;
void Update()
{
//Keyboard commands
Vector3 p = GetBaseInput();
totalRun = Ma... |
C++ | UTF-8 | 7,516 | 2.9375 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using Block=vector<vector<int>>;
using Board=vector<vector<int>>;
struct Point{
int y,x;
};
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};//縦横のマス
const int ex[]={1,1,-1,-1},ey[]={-1,1,1,-1};//斜めのマス
//点数計算の仕組みを考える
//ブロックリストを作る
const vector<Bl... |
Java | UTF-8 | 11,733 | 2.0625 | 2 | [] | no_license | package tk.zielony.materialrecents;
import android.content.*;
import android.content.res.*;
import android.graphics.*;
import android.graphics.drawable.*;
import android.util.*;
import android.view.*;
import android.view.animation.*;
import android.widget.*;
import com.meui.SwipeRecentApps.*;
import com.noas.animation... |
Java | UTF-8 | 701 | 1.867188 | 2 | [] | no_license | package com.songm.dormrepair.fragment.myorder;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import ... |
Java | UTF-8 | 1,751 | 2.234375 | 2 | [
"Apache-2.0"
] | permissive | package jpuppeteer.cdp.client.entity.indexeddb;
/**
* Key range.
* experimental
*/
public class KeyRange {
/**
* Lower bound.
*/
private jpuppeteer.cdp.client.entity.indexeddb.Key lower;
/**
* Upper bound.
*/
private jpuppeteer.cdp.client.entity.indexeddb.Key upper;
/**
* If ... |
Java | UTF-8 | 1,713 | 2.546875 | 3 | [] | no_license | /**
*
*/
package it.ogeo.rest;
import it.ogeo.model.Person;
import it.ogeo.persistence.FakeDb;
import java.util.Collection;
import java.util.logging.Logger;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Pat... |
Swift | UTF-8 | 690 | 2.796875 | 3 | [] | no_license | //
// DataCache.swift
// SwiftFlickrSearch
//
// Created by suraj poudel on 24/8/19.
// Copyright © 2019 suraj poudel. All rights reserved.
//
import Foundation
import UIKit
class DataCache:NSObject{
static let shared = DataCache()
private(set) var cache:NSCache<AnyObject,AnyObject> = NSCache()
... |
C# | UTF-8 | 1,048 | 2.6875 | 3 | [
"MIT"
] | permissive | using Akrual.DDD.Utils.Application.Messaging;
namespace Akrual.DDD.Utils.Application.UseCaseFunctions
{
/// <summary>
/// Every application class should basically receive an input data from the presentation layer and return
/// an output to the presentation layer. So it should implement this inter... |
C# | UTF-8 | 738 | 2.65625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RSS_DB
{
public class Element
{
public string ProductName { get; set; }
public byte Status { get; set; }
public double Cost { get; set; }
public int Qua... |
C++ | UTF-8 | 1,083 | 3.125 | 3 | [] | no_license | #include"Solutions.h"
// need to find the dimension of the matrix first
// use four paramters to 'PIN' the matrix
// only two caes there: left null or left with just one element
vector<vector<int>> p59::generateMatrix(int n) {
vector <vector<int>> ans(n, vector<int>(n, 0));
int top = 0, left = 0, right = n - 1, bott... |
Markdown | UTF-8 | 717 | 2.953125 | 3 | [] | no_license | # eBtn
An Arduino library to create buttons and handle events using callbacks.
The library handle the following events:
- press
- release
- longPress
Please, see https://github.com/t3db0t/Button
for a better solution
Patrick
**Usage**
eBtn btn = eBtn(btnPin);
btn.on("press",pressFunc);
btn.on("re... |
JavaScript | UTF-8 | 804 | 3.25 | 3 | [] | no_license | $(document).ready(function() {
var checkboxes = [];
$('ul.checkboxes li').each(function(index) {
if ($(this).attr('role') == 'checkbox') {
checkboxes[index] = new checkbox($(this));
}
});
}); // end ready()
// Function toggleState() is a member function to toggle a checkbox state. This function ... |
C++ | UTF-8 | 1,189 | 3.921875 | 4 | [] | no_license | #include<stdio.h>
int main()
{
int num1,num2,num3,n,fact=1,c;
printf("-------Menu-------");
printf("\n 1.Factorial of a number");
printf("\n 2.Prime or not");
printf("\n 3.Even or odd");
printf("\n 4.Exit");
printf("Enterr the choice :");
scanf("%d",&n);
switch(n)
{
case 1:
printf("Enter th... |
Swift | UTF-8 | 1,569 | 3.015625 | 3 | [] | no_license | //
// RayTests.swift
// ray tracer unit tests
//
// Created by Christopher Paterson on 03/09/2018.
// Copyright © 2018 Christopher Paterson. All rights reserved.
//
import XCTest
class RayTests: XCTestCase {
func testCreateAndQueryRay() {
let origin = Point(x: 1, y: 2, z: 3)
let direction = V... |
C# | UTF-8 | 1,568 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | // Copyright (c) 2014-2020 DataStax Inc.
// Copyright (c) 2020, Rafael Almeida (ralmsdevelper)
// Licensed under the Apache License, Version 2.0. See LICENCE in the project root for license information.
using System;
using System.Collections.Generic;
namespace Scylla.Net.Collections
{
internal interface IThreadS... |
C++ | UTF-8 | 14,270 | 2.703125 | 3 | [] | no_license | #include "api.h"
#include "classes.h"
#include <iostream>
#include <sys/stat.h>
#include <string>
#include <sqlite3.h>
db_communicator::db_communicator(unsigned int players){
//lets name the dbs -> poker_db_X.db
struct stat buffer;
db_name = "/home/fivosts/poker_db_" + std::to_string(players) + ".db";
bool file_... |
Python | UTF-8 | 11,451 | 2.875 | 3 | [] | no_license | """
Importing everything here instead of in functions
to import once and speed up REST calls
"""
import pandas as pd
import numpy as np
import pandas.tseries.offsets as pdo
#import pickle
import json
# from sklearn import preprocessing
# from sklearn.cluster import AgglomerativeClustering
from math import radians, cos,... |
Markdown | UTF-8 | 24,460 | 2.703125 | 3 | [] | no_license | <title>暗器使</title>
<meta name="GENERATOR" content="WinCHM">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<br>
<br>无论是在武侠,魔幻世界,甚至多元宇宙,使用投掷类武器的总是少数。在战斗中,威力不及火器,处于劣势地位的投掷武器,仅仅是作为量产的爆炸性质消耗品,或者独门的战斗风格技术而被使用。
<br>主神选取了三个代表性的魔幻与特异本质的暗器使用者,并把他们的技术统一整合。
<br>三个暗器使分别代表:
<br>体流:通过三次元甚至四次元的急停,瞬动,配合暗器的使用的格... |
PHP | UTF-8 | 1,582 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: chuch
* Date: 7/17/2017
* Time: 10:43 PM
*/
use App\Album;
use Illuminate\Database\Seeder;
class AlbumTableSeeder extends Seeder
{
public function run()
{
DB::table('albums')->delete();
Album::create(array(
'artist_id'=> 1,
... |
Go | UTF-8 | 4,406 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | package client
import (
"bytes"
"context"
"github.com/redresseur/loggerservice/utils/ioutils"
"github.com/redresseur/loggerservice/utils/sturcture"
"io"
"io/ioutil"
"os"
"runtime"
"sync/atomic"
"time"
)
var(
gChannelIO *channelIO
)
// 还要再封装一层
// 用channel封装一层
type channelIO struct {
// 加一个大的缓存队列
io *stru... |
JavaScript | UTF-8 | 288 | 3.015625 | 3 | [] | no_license | ready(function(){
affichage(document.querySelectorAll('.rubrique')[0].id)
});
function affichage(id) {
var blocks = document.querySelectorAll('.rubrique');
for (var i=0;i<blocks.length;i++){
blocks[i].style.display= "none";
}
document.getElementById(id).style.display = 'block';
} |
TypeScript | UTF-8 | 842 | 2.515625 | 3 | [] | no_license | import { Unknown } from './UnknownParam';
import { InfraSettings } from './Settings';
export class DataStoreSizeCal {
private unknown = new Unknown();
private settings: InfraSettings;
constructor(settings: InfraSettings) {
this.settings = settings;
}
datastoreSize(): number {
const monthDays = 30... |
Java | UTF-8 | 3,480 | 2.34375 | 2 | [] | no_license | package com.swpu.sharebook.service.impl;
import com.swpu.sharebook.entity.UserRole;
import com.swpu.sharebook.mapper.RoleMapper;
import com.swpu.sharebook.service.RoleService;
import com.swpu.sharebook.shiro.util.UserUtil;
import com.swpu.sharebook.util.Tools;
import com.swpu.sharebook.util.returnvalue.ResponseResult;... |
Markdown | UTF-8 | 5,622 | 3.28125 | 3 | [] | no_license | # Django REST Framework & Docker
A Beginner’s Guide to Docker
- With Docker it doesn’t matter if you are using a Mac, Windows, or Linux computer anymore. The entire development environment is isolated: programming language, software packages, databases, and more.
- With Docker we now longer have to mess around with v... |
Python | UTF-8 | 53 | 3.0625 | 3 | [] | no_license | name = raw_input('input name')
print 'name is ', name |
Java | UTF-8 | 2,143 | 2.328125 | 2 | [
"MIT"
] | permissive | package smsfrompc.com.smsfrompc.Adapters;
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 androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import ja... |
Shell | UTF-8 | 988 | 3.84375 | 4 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | #!/usr/bin/env bash
# Starts a GCS cluster, runs scripts, then deletes the cluster.
# The cluster is only deleted if all the scripts run successfully, to allow for debugging.
# The cluster will automatically be deleted in any case after 3 hours.
if [ -z "$GCS_CLUSTER" ]; then
echo "Please set the GCS_CLUSTER enviro... |
Java | UTF-8 | 1,043 | 2.15625 | 2 | [
"MIT"
] | permissive | package mod.badores.ore;
import cpw.mods.fml.relauncher.Side;
import mod.badores.util.FakePlayerDetection;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import java.util.L... |
C | UTF-8 | 321 | 3.65625 | 4 | [] | no_license | #include<stdio.h>
#include<math.h>
int main()
{
double i;
for(i=1.0; i<101.0; i++)
{
printf("The Square root of %lf is %lf\n",i,sqrt(i));
printf("Whole Number part: %d",(int)sqrt(i));
printf("Fractional part: %lf\n",sqrt(i)-(int)sqrt(i));
printf("\n");
}
return 0;
}
... |
Markdown | UTF-8 | 188 | 2.671875 | 3 | [] | no_license | # simple-shop
Simple shop is a basic beginner level JAVA application , which uses mysql as its database<br>
# Requirements <br>
JAVA compiler<br>
MYSQL <br>
Any IDE(Netbeans is preferred)
|
Python | UTF-8 | 2,355 | 2.859375 | 3 | [] | no_license | import tensorflow as tf
import tensorflow.keras as keras
import numpy as np
class Mymodel(keras.Model):
def __init__(self):
super(Mymodel, self).__init__()
self.CRNN = keras.Sequential([
## CNN layers
keras.layers.Conv2D(filters=64, kernel_size=3,activation='re... |
PHP | UTF-8 | 5,109 | 2.6875 | 3 | [] | no_license | <?php
require_once __DIR__ . '/../services/__require__.php';
require_once __DIR__ . '/../models/__require__.php';
require_once __DIR__ . '/Service.php';
/**
* @property User $user
* @property AppData $data
*
* @property WalkerData $walkerData;
* @property UserData $userData;
* @property UserMessages $userMessage... |
Markdown | UTF-8 | 3,593 | 2.8125 | 3 | [
"MIT"
] | permissive | # Last.fm Top 10 Album Image Generator [](http://stillmaintained.com/yesdevnull/Lastfm-Album-Image-Generator)
By Dan Barrett - [yesdevnull.net/lastfm](http://yesdevnull.net/lastfm)
Easily get images for a top 10 list for your Last... |
JavaScript | UTF-8 | 2,978 | 2.796875 | 3 | [
"MIT"
] | permissive | import {encodeForAjax} from './utils.js';
window.addEventListener('load', function() {
let form = document.getElementById('search_form');
form.onsubmit = function() {
let date1 = document.querySelector('input[name="start_date"]').value;
let date2 = document.querySelector('input[name="end_date"... |
Python | UTF-8 | 466 | 3.765625 | 4 | [] | no_license | import sys
values = input("Digite um sequencia de numeros separado por espaço:")
values_list = values.split(" ")
invalid_value = ""
final_value = 0
for value in values_list:
if not value.isdigit():
invalid_value = value
else:
final_value += int(value)
if invalid_value != "":
print(
... |
Markdown | UTF-8 | 2,444 | 3.75 | 4 | [] | no_license | # Tic Tac Toe
### Contributors:
- [Christina Cook](https://github.com/christina-cook)
### Technologies Used:
- JavaScript
- HTML
- CSS
### Overview
The main learning goals of this project centered around solidifying and demonstrating an understanding of local storage, event delegation, and DRY JavaScript. There w... |
Java | UTF-8 | 599 | 2.390625 | 2 | [] | no_license | package window.view.components.buttons;
import javafx.scene.control.Button;
import javafx.scene.layout.Pane;
import org.kordamp.ikonli.javafx.FontIcon;
import window.Theme;
public class AcceptButton extends Button {
public AcceptButton(Pane rootPane) {
FontIcon icon = new FontIcon();
icon.setIco... |
Java | UTF-8 | 1,140 | 2.203125 | 2 | [] | no_license | package com.decode.skapaBooking;
import static org.junit.Assert.assertEquals;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.decode.objects.Pago;
import com.decode.objects.Usuario;
public class TestPago {
@Before
public void setUp() throws Exception {
}
@After
public voi... |
C# | UTF-8 | 520 | 2.78125 | 3 | [] | no_license | using System;
namespace Bdf
{
[Serializable]
public class BdfException : Exception
{
public BdfException():base()
{ }
public BdfException(string message)
: base(message)
{
}
public BdfException(string message, Exception innerException)
... |
Python | UTF-8 | 235 | 3.65625 | 4 | [] | no_license | import string
x,y,z= "apple" , "orange" ,"limon"
basket = x + y + z
print(basket)
print(basket.split('e',3))
n = 5
print([basket[i:i+n] for i in range(0, len(basket), n)])
basket = x +" "+ y+" " + z
print(basket)
print(basket.split())
|
Rust | UTF-8 | 13,750 | 2.84375 | 3 | [
"MIT"
] | permissive | #[macro_use]
mod macros;
test!(
basic_toplevel,
"@media foo {\n a {\n color: red;\n }\n}\n",
"@media foo {\n a {\n color: red;\n }\n}\n"
);
error!(
no_params,
"@media {\n a {\n color: red;\n }\n}\n", "Error: Expected identifier."
);
test!(
basic_nested,
"a {\n @media foo {\n... |
Markdown | UTF-8 | 514 | 2.71875 | 3 | [] | no_license | 使用early-stopping策略确定迭代次数
问:什么是early-stopping策略?
答:early-stopping策略是指当验证数据集的准确率达到饱和时停止迭代。
问:怎样算达到饱和?
答:例如最近10次迭代的准确率都没有提升。
问:为什么是10次?
10是一个经验数字。一开始可以稍微小一点。到后面应该适当调大。
早期不需要使用early-stoping策略停止迭代,因为需要overfitting的结果来调正则化参数。 |
Java | UTF-8 | 4,125 | 2.4375 | 2 | [] | no_license | package com.assignment.payroll.generator.render;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.s... |
PHP | UTF-8 | 4,817 | 2.78125 | 3 | [] | no_license | <?php
/**
* Competency ACL implementation
*
* This is not yet used throughout the entire competency module, but it's a
* start at least.
*/
class competencyAcl {
/**
* User currently logged in
* @var array User record
*/
protected $user;
/**
* Constructor
*/
public funct... |
Java | UTF-8 | 3,001 | 2.609375 | 3 | [] | no_license | package cn.jly.hadoop.mapreduce;
import cn.jly.hadoop.hdfs.BaseConfig;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.a... |
PHP | UTF-8 | 765 | 2.609375 | 3 | [] | no_license | <?php
/**
* @author Duc Nguyen <ducntq@gmail.com>
* @link https://github.com/ducntq/Element
* @copyright Copyright © 2013-2013 GL Software
* @license https://github.com/ducntq/Element/License
*/
/**
* Controller class file
*
* Controller is a class that has no real actual code, but merely
* exists to hel... |
Markdown | UTF-8 | 2,886 | 3.59375 | 4 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | # Brutetime
Let's say that you have something that you want to keep secret from yourself or a friend for a fixed period of time. At the time of this writing, there aren't any encryption methods that only allow decryption after a certain period of time. How then do we solve this issue?
Well, current encryption methods... |
Java | UTF-8 | 849 | 2.09375 | 2 | [] | no_license | package com.podtube.repositories;
import com.podtube.common.UserRole;
import com.podtube.models.User;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import java.util.List;
public interface UserRepository
extends CrudRepository<User, Integer> {
//A... |
C# | UTF-8 | 583 | 2.921875 | 3 | [] | no_license | // Listing of CalcService.cs
using System;
using System.ServiceModel;
using System.Text;
namespace WCFCalcLib
{
public class CalcService : ICalcService
{
public double Add(double a, double b)
{
return (a + b);
}
public double Subtract(double a, double b)
{... |
Markdown | UTF-8 | 2,800 | 3.515625 | 4 | [
"MIT"
] | permissive | ## 两数相加
这道题难度是 medium ,AC 后我觉得完全没有昨天的 Easy 好做,开始怀疑 LeetCode 是不是搞错了哈哈。做的过程没有感觉到有多困难,但是最后输出 finalNode 的时候只丢出来了最后一个节点,突然想起来这是因为一直都在让 finalNode = finalNode.next ,然后开始陷入纠结中,稍微找到了点思路,肯定要用一个中间 node 去记录当前链,然后把每次生成的新节点添加到中间 node 上去,最后再把中间 node 每次都赋值给 finalNode 。但是这样也有问题,维护这几个 node 的成本太大,差点没绕晕我。
最后还是看了参考答案,整体框架跟我写的都是一致的,只不过在我最纠... |
JavaScript | UTF-8 | 1,421 | 2.515625 | 3 | [] | no_license | /**
* Created by nant on 2014/7/28.
*/
exports.version = '0.1';
exports.name = 'localstorage';
exports.module = function(pagetimeline, callback){
var browser = pagetimeline.model.browser;
var timeout = pagetimeline.getParam( 'timeout' );
var domreadytimeout = pagetimeline.model.domreadyTimeout;
browser.onLoadEv... |
Python | UTF-8 | 282 | 2.828125 | 3 | [] | no_license | import pandas as pd
course=pd.read_csv("Data/course.csv")
course_new=course[(course.course_type=="专业必修")|(course.course_type=="公共必修")|(course.course_type=="公共选修")|(course.course_type=="专业选修")]
course_new.to_csv("course_new.csv",encoding="utf-8") |
Python | UTF-8 | 4,175 | 3.1875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 11 10:10:31 2018
@author: yuxi
"""
import torch
def guassian_kernel(source, target, kernel_mul=2.0, kernel_num=5, fix_sigma=None):
'''
将源域数据和目标域数据转化为核矩阵,即上文中的K
Params:
source: 源域数据(n * len(x))
target: 目标域数据(m * len(y))
... |
Java | UTF-8 | 707 | 1.726563 | 2 | [
"Apache-2.0"
] | permissive | package org.xmlcml.norma.cproject;
import java.io.File;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.eclipse.jetty.util.log.Log;
import org.junit.Test;
import org.xmlcml.cmine.files.CContainer;
import org.xmlcml.cmine.files.CProject;
import org.xmlcml.norma.NormaFixtures;
import org.xmlcm... |
Java | UTF-8 | 1,318 | 1.945313 | 2 | [] | no_license | package com.ezdi.audioplayer.solr;
import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.impl.HttpSolrServer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
... |
C++ | UTF-8 | 8,154 | 3.375 | 3 | [] | no_license | #ifndef _LIST_H_
#define _LIST_H_
#include "Node.h"
#include <algorithm>
template<typename T>
class List {
public:
List() {
init();
}
~List() {
clear();
delete head;
delete tail;
}
void insert(const T& x) {
}
void erase(T& x) {
}
void clear(PtrToList L) {
while (!empty())... |
Java | UTF-8 | 454 | 1.710938 | 2 | [] | no_license | package com.wufumall.example.b.dao;
import org.springframework.stereotype.Repository;
import com.wufumall.example.b.model.TxExampleB;
@Repository
public interface TxExampleBMapper {
int deleteByPrimaryKey(Long id);
int insert(TxExampleB record);
int insertSelective(TxExampleB record);
TxExampleB s... |
Java | UTF-8 | 10,916 | 2.15625 | 2 | [] | no_license | package cn.hexing.dlms.protocol.comm;
import android.os.SystemClock;
import cn.hexing.EventMsg;
import cn.hexing.HexStringUtil;
import cn.hexing.iComm.AbsCommAction;
import cn.hexing.dlms.IHexListener;
import cn.hexing.model.CommPara;
import com.android.SerialPort.SerialPort;
import org.greenrobot.eventbus.EventBu... |
C++ | UTF-8 | 1,823 | 2.8125 | 3 | [] | no_license | #include "stdafx.h"
#define _WINSOCK_DEPRECATED_NO_WARNINGS
#include<stdio.h>
#include<winsock2.h>
#include<io.h>
#include<iostream>
#include<fstream>
using namespace std;
#pragma comment(lib,"ws2_32") //Winsock Library
int main(int argc, char *argv[])
{
WSADATA wsa;
SOCKET s;
struct sockaddr_in server;
//char *me... |
Python | UTF-8 | 340 | 3.03125 | 3 | [] | no_license | n=int(input())
l=[]
jump=False
for i in range(n):
l.append(list(map(int,input().split())))
for i in range(n):
for j in range(i+1,n):
if l[i][0]<l[j][0]:
if l[i][1]>l[j][1]:
print("Happy Alex")
jump=True
break
if jump:
break
else:
... |
Java | UTF-8 | 1,814 | 2.3125 | 2 | [] | no_license | package by.verdeth.servlets;
import by.verdeth.dao.bookDao.BookDaoImplSingleton;
import by.verdeth.dao.genreDao.GenreDaoImplSingleton;
import by.verdeth.models.Book;
import by.verdeth.models.Genre;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet... |
C# | UTF-8 | 1,814 | 2.828125 | 3 | [] | no_license | using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Threading;
namespace Smasher.JobLib
{
public class JobManager
{
public JobManager ()
{
mQueueLocker = new object();
mJobQueue = new Queue<Job>();
}
public void EnqueueJob (Job job)
{
lock (mQueueLocker)
{
... |
JavaScript | UTF-8 | 1,456 | 3.6875 | 4 | [] | no_license | // 二叉搜索树--测试用例
// Binary Search Tree -- test cases
// https://www.jianshu.com/p/ce4f46cd9372
// const BinarySearchTree = require('./01-binary-search-tree.js')
import BinarySearchTree from './01-binary-search-tree.js'
// console.log('BinarySearchTree', BinarySearchTree)
describe('BST 算法', () => {
let tree = new Bin... |
C | UTF-8 | 2,808 | 3.53125 | 4 | [] | no_license | /**
* C program to solve the two-dimensional Poisson equation on
* a unit square using one-dimensional eigenvalue decompositions
* and fast sine transforms.
*
* Einar M. Rønquist
* NTNU, October 2000
* Revised, October 2001
* Revised by Eivind Fonn, February 2015
*/
#include <stdlib.h>
#include <stdio.h>
#inc... |
Java | UTF-8 | 1,573 | 1.882813 | 2 | [] | no_license | package com.example.avrwizard;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class GeneratedProgram extends AppCompatActivity {
@Override
protected void ... |
TypeScript | UTF-8 | 1,118 | 2.53125 | 3 | [] | no_license | import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {Token} from '../../models/Token';
import {tap} from "rxjs/operators";
import {Observable} from "rxjs";
@Injectable({
providedIn: 'root'
})
export class TokenService {
BASE_URL = 'http://localhost:8080/api/'
con... |
PHP | UTF-8 | 2,170 | 3.578125 | 4 | [] | no_license | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ejercicio 02 - Parte 01</title>
</head>
<body>
<!--
Cada línea representa la política y la contra... |
Markdown | UTF-8 | 17,240 | 3.109375 | 3 | [] | no_license | - I can’t afford to have thoughts in my head about me that God doesn’t have in His.
- Royalty is my identity. Servanthood is my assignment. Intimacy with God is my life source.
- Don’t let your past dictate your future.
- We owe the world an encounter with God.
- Great faith doesn’t come out of great effort, but o... |
Java | UTF-8 | 746 | 3.6875 | 4 | [] | no_license | package linkedlist.practice;
class Node{
int data;
Node next;
Node(int data){
this.data= data;
next=null;
}
}
public class LinkedListPractice {
static Node head;
public static void main(String[] args) {
//linkedListPractice.push(1);
// linkedListPractice.printLi... |
Java | UTF-8 | 4,217 | 2.921875 | 3 | [] | no_license | package com.hap.trip.util;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import com.hap.trip.R;
import com.hap.trip.TripApplication;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.util.Calendar;
import java.util.Date;
import jav... |
C++ | UTF-8 | 1,225 | 3.40625 | 3 | [] | no_license | /** @file StackL.cpp */
#include <iostream>
#include "StackA.h" // header file
Stack::Stack()
{
max = 4;
top = 0;
size = 0;
array = StackItemType[max];
} // end default constructor
Stack::Stack(const Stack& aStack)
{
} // end copy constructor
Stack::~Stack()
{
delete [] array;
} // end destructor... |
Python | UTF-8 | 514 | 2.578125 | 3 | [] | no_license | import cv2
import numpy as np
img = cv2.imread("img/bingbing_is_mine.jpg")
kernel = np.ones((5,5),np.uint8)
imgGray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
imgBlur = cv2.GaussianBlur(imgGray,(5,5),0)
imgCanny = cv2.Canny(imgBlur,50,100)
imgDialation = cv2.dilate(imgCanny,kernel,iterations=1)
imgEroded = c... |
Markdown | UTF-8 | 2,226 | 3.328125 | 3 | [] | no_license | # exerciciosJavaLista1
Lista de exercicios simples em java, envolvendo funções, expressões aritméticas e lógica
**Exercicio 1**: Faça uma função para calcular o volume de um cubo.
**Exercicio 2**: Um posto de abastecimento vende uma mistura de combustível composta de 75% de gasolina e 25% de álcool. Faça uma função ... |
JavaScript | UTF-8 | 3,523 | 3.421875 | 3 | [] | no_license | var vp=document.getElementById("villaplatzi"); //llamar al id creado en .html
var papel = vp.getContext("2d"); //donde se dibujara
//objeto con varios atributos
var fondo= {
url: "tile.png",
cargaOK: false //para verificar el cargado de imagen y que no se sobrepongan
};
var vaca = {
url: "vaca.png",
cargaOK: fals... |
C# | UTF-8 | 2,116 | 2.96875 | 3 | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | #region License
// /*
// See license included in this library folder.
// */
#endregion
using System.Collections.Generic;
namespace Sqloogle.Libs.NLog.Targets
{
/// <summary>
/// Writes log messages to an ArrayList in memory for programmatic retrieval.
/// </summary>
/// <seealso href="http://nlog-... |
JavaScript | UTF-8 | 721 | 3 | 3 | [] | no_license | class Obstacle {
constructor(x,y,obstacleimg){
this.x = x
this.y = y
this.scale = 0.1;
this.body = createSprite(this.x,this.y,50,50)
this.body.addImage(obstacleimg);
this.body.scale = this.scale;
this.body.visible = false;
this.body.isStatic ... |
Shell | UTF-8 | 624 | 3 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env bash
# Usage for V8: sh build-linux.sh -DV8_DIR=${HOME}/v8
# Usage for Node: sh build-linux.sh -DNODE_DIR=${HOME}/node
JAVET_VERSION=1.0.0
rm -rf build
mkdir build
cd build
mkdir -p ../../src/main/resources
mkdir -p ../../build/libs
cmake ../ -DJAVET_VERSION=${JAVET_VERSION} "$@" \
&& make -j4 \
&& ... |
Python | UTF-8 | 193 | 3.65625 | 4 | [] | no_license | estudante_texto = input('Quantos alunos são? ')
estudante_pizza_int = int (estudante_texto)
nPizzas = int (estudante_pizza_int/1.5) + 1
print("Iremos precisar de ", nPizzas , " pizzas")
|
Java | UHC | 1,034 | 2.359375 | 2 | [] | no_license | package bank;
public class BankMessage {
public static final String MSG_HELLO = " ȯմϴ";
public static final String MSG_SELECT_MENU = " ּ\n 1. 2.ܾȸ 3.Ա 4. 0. \n";
public static final String MSG_CREATE_ACCOUNT_RESIDENTREGISTRATIONNUMBER = " ֹεϹȣ Էּ :";
public static final String MSG_GET_ACCOUNT_NUMBER = " ȣ %dԴ... |
Java | GB18030 | 552 | 3.34375 | 3 | [] | no_license | package hotel;
/*
* 徭
* Աһ,ûVIP
* Լн
* */
public class Manager extends Employee{
public Manager() {
super();
}
public Manager(String name, String id, double money) {
super(name, id);
this.money = money;
}
//影
private double money;
public double getMoney() {
return money;
}
public v... |
Python | UTF-8 | 626 | 3.171875 | 3 | [
"MIT"
] | permissive | """
Nozomi
URL Parameter Module
author: hugh@blinkybeach.com
"""
from typing import Any
from nozomi.ancillary.immutable import Immutable
class URLParameter:
"""A single URL parameter, e.g. beep=boop"""
def __init__(
self,
key: str,
value: Any
) -> None:
assert isinstance(k... |
Python | UTF-8 | 1,049 | 3.3125 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/1/2 14:23
# @Author : liuhu
# @File : split_and_compare_version.py
# @Software: PyCharm
# @github :https://github.com/Max-Liuhu
# old_version= '3.4.3.0105'
old_version= '3.4.3.c'
new_version= '3.4.5.0908'
def compare_version(old_version,new_version)... |
TypeScript | UTF-8 | 320 | 3.15625 | 3 | [] | no_license | /**
* Runs Array.map asyncronously.
*
* @param list The array to map
* @param executor The function to run for each
*/
export const asyncMap = async <T, K>(
list: T[],
executor: (element: T, index: number, array: T[]) => Promise<K>
): Promise<K[]> => {
return Promise.all(list.map(executor))
}
// {asyncMap}
|
Markdown | UTF-8 | 4,330 | 2.75 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | # Neonio Theme for Grav

# Built on:
* Bootstrap
# Features:
* HTML5 and CSS3
* Fully Responsive
* Attractive and modern design
* Little effects thats let your layout looks super sexy
# Installation
Installing the Neonio theme can be done in one of two ways. The GPM (Grav Package Manag... |
JavaScript | UTF-8 | 9,642 | 3.203125 | 3 | [] | no_license | /**
* This script is responsible for initializing all radio buttons and text fields
* with the appropriate onClick or onSubmit functions. Each of these functions
* responds to user click by saving the appropriate values in localStorage. This
* has all been moved into its own script to prevent clutter in the HTML fi... |
Java | UTF-8 | 9,670 | 1.78125 | 2 | [] | no_license | /**
*/
package com.mimacom.ddd.pub.proto.impl;
import com.mimacom.ddd.pub.proto.ProtoDocumentSegment;
import com.mimacom.ddd.pub.proto.ProtoPackage;
import com.mimacom.ddd.pub.proto.PublicationClass;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import or... |
TypeScript | UTF-8 | 1,844 | 3.65625 | 4 | [
"Apache-2.0"
] | permissive | import curryN from './curryN';
import reduce from '../array/reduce';
import pluck from '../array/pluck';
import map from '../array/map';
interface ConvergeAfterFn {
(...args: any[]): any;
}
interface ConvergeArgFn {
(...args: any[]): any;
}
interface Converge {
(after: ConvergeAfterFn, fns: ConvergeArgFn[]): C... |
Java | UHC | 933 | 2.84375 | 3 | [] | no_license | package com.kwon.db.main;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class ConnectMain {
public static void main(String[] args) {
// OracleDriver ְ : ojdbc8.jar
Connection con = null;
try {
// DBּ( DBĿ ٸ)
String url = "jdbc:oracle:thin:@192.168.0.46:... |
C++ | UTF-8 | 2,520 | 3.59375 | 4 | [
"MIT"
] | permissive | //
// main.cpp
// Hw9-2
// Find Substring From Dictionary (Vector of Char)
//
// Created by Tomy Hsieh on 2017/11/21.
// Copyright © 2017年 Tomy Hsieh. All rights reserved.
//
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
// prints all English words which are contiguous substrings ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.