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 | 380 | 2.53125 | 3 | [] | no_license | # 此函数不应被前端调用,如有后端需要,其中权限问题将由后端依据实际情况完善
def create_user(cursor, db, usr, password):
sql1 = "create user \"{}\" with password '{}'".format(usr, password)
cursor.execute(sql1)
sql2 = "grant all privileges on database {} to \"{}\"".format(db, usr)
cursor.execute(sql2)
return cursor.rowcount
|
Java | UTF-8 | 287 | 2.09375 | 2 | [] | no_license | package mk.ukim.finki.wp.lab.service;
import mk.ukim.finki.wp.lab.model.Teacher;
import java.util.List;
import java.util.Optional;
public interface TeacherService {
List<Teacher> findAll();
Teacher findById(Long id);
Optional<Teacher> save(String name, String surname);
}
|
Java | UTF-8 | 4,356 | 1.789063 | 2 | [] | no_license | package com.pages;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.PageFactory;
import io.cucumber.java.en.Then;
public class SpicejetFlightPage {
WebDriver driver;
By BookFlight = By.xpath("//*[@id=\"content-change\"]/div[2]");//Click on Flights Icon
B... |
TypeScript | UTF-8 | 245 | 2.515625 | 3 | [
"MIT"
] | permissive | import _ from 'lodash';
import * as Types from '../types/graphql';
export const formatAddress = ({street, building}: Pick<Types.Poi, 'street' | 'building'>) =>
[_.get(street, 'name'), building]
.filter(Boolean)
.join(', ');
|
Java | UTF-8 | 23,313 | 1.726563 | 2 | [] | no_license | package sk.insomnia.rowingRace.ui.controller;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.scene.c... |
C++ | UTF-8 | 742 | 3.59375 | 4 | [] | no_license | /*
File Name: 169MajorityElement.cpp
Xiaolong Zhang
Question:
Given an array of size n, find the majority element.
The majority element is the element that appears more
than ⌊ n/2 ⌋ times.
You may assume that the array is non-empty and the
majority element always exist in the array.
++++++++++++... |
Java | UTF-8 | 903 | 2.53125 | 3 | [] | no_license | package NutriaDao;
import com.j256.ormlite.jdbc.JdbcConnectionSource;
import com.j256.ormlite.support.ConnectionSource;
import java.io.FileInputStream;
import java.util.Properties;
/**
*
* @author Ariel
*/
public class DbConnection {
private ConnectionSource conn;
public DbConnection() {
... |
JavaScript | UTF-8 | 943 | 2.71875 | 3 | [] | no_license | // load the things we need
var mongoose = require('mongoose');
var bcrypt = require('bcrypt-nodejs');
// define the schema for our user model
var userSchema = mongoose.Schema({
local : {
username : String,
password : String,
},
currentClass : String,
classes: [
... |
Shell | UTF-8 | 2,135 | 3.609375 | 4 | [] | no_license | #!/bin/sh
MAIN_EXE='xyipk'
base_path=$(dirname $0)
cd ${base_path}
ulimit -c ulimited
SOFTMODE=`fw_printenv xl_softmode | awk -F "=" '{print $2}'`
stop_app ()
{
ps | grep xyipk_daemon | grep -v grep | awk '{print $1}' | xargs kill -9
killall xyipkd
killall ${MAIN_EXE}
}
start_app ()
{
cd ${base_p... |
C++ | UTF-8 | 7,023 | 2.859375 | 3 | [] | no_license | /**
* bn40.cpp for Clique3
* Copyright (C) 2018, Gu Jun
*
* This file is part of Clique3.
* Clique3 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any ... |
Java | UTF-8 | 3,327 | 2.09375 | 2 | [] | no_license | package com.bec.merchantmanager.fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import... |
Java | UTF-8 | 557 | 1.867188 | 2 | [] | no_license | package com.yumu.hexie.model.commonsupport.info;
import javax.persistence.Entity;
import com.yumu.hexie.model.BaseModel;
@Entity
public class ProductRule extends BaseModel {
/**
*
*/
private static final long serialVersionUID = -7072087262127364609L;
private long productId;
private long ruleId;
public... |
Java | UTF-8 | 386 | 3.046875 | 3 | [] | no_license | package academy.everyonecodes.java.week6.set2.exercise2;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class IntegersLeftShifter {
public List<Integer> shiftOne(List<Integer> numbers) {
List<Integer> numbersMutable = new ArrayList<>(numbers);
Collections.r... |
Shell | UTF-8 | 2,471 | 4.28125 | 4 | [] | no_license | #!/bin/bash
# replaygain.sh - A wrapper for mp3gain
# Homepage: https://github.com/rucker/scripts
# Author: Rick Ucker
#
# Run this script to add mp3gain values to mp3 files in a directory
# and its subdirectories. Both album mode and track mode are supported.
#
# Dependencies:
# mp3gain (http://mp3gain.source... |
Java | UTF-8 | 629 | 2.3125 | 2 | [] | no_license | package Servlets;
import Controller.Agent;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class GetAgent extends HttpServlet {
... |
Markdown | UTF-8 | 926 | 2.75 | 3 | [] | no_license | # Async HTTP Sample
This is a sample project to check the potential integration of async HTTP client into an existing non reactive Spring Boot application.
We wanted to check whether an async HTTP client behaves in a production-like environment, having callbacks writing to a database.
It is actually as simple as wit... |
Python | UTF-8 | 2,957 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | import erdos
import numpy as np
from pylot.prediction.messages import PredictionMessage
from pylot.prediction.obstacle_prediction import ObstaclePrediction
from pylot.utils import Location, Rotation, Transform
class LinearPredictorOperator(erdos.Operator):
"""Operator that takes in past (x,y) locations of agents... |
TypeScript | UTF-8 | 512 | 2.515625 | 3 | [
"MIT"
] | permissive | import { Injectable, HttpService } from '@nestjs/common';
import { Weather } from './interfaces/weather.interface';
@Injectable()
export class WeatherService {
constructor(private httpService: HttpService) {}
async getWeather(): Promise<Weather> {
const weather = await this.httpService.get('https://api.openwe... |
Python | UTF-8 | 224 | 2.8125 | 3 | [] | no_license | import pygame
import settings
class Camera:
def __init__(self):
# This is the viewing Area, also known as the Screen Size
self.camera = pygame.Rect(0, 0, settings.SCREEN_WIDTH, settings.SCREEN_HEIGHT)
|
Python | UTF-8 | 265 | 3.5 | 4 | [] | no_license | """
project euler 1
by: Nir
Multiples of 3 and 5
"""
def sum_and_div_35(to=int(input("add ur num"))):
result = 0
for i in range(1, to):
if i % 3 == 0 or i % 5 == 0:
result += i
return result
print(sum_and_div_35())
|
Java | UTF-8 | 767 | 2.859375 | 3 | [] | no_license | package ru.netology;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
public class Client {
private static final String HOST = "localhost";
private static final int PORT = Server.SERVER_PORT;
public static vo... |
C++ | UTF-8 | 730 | 2.5625 | 3 | [] | no_license | #ifdef __APPLE__
#include <OpenCL/cl.hpp>
#else
#include <CL/cl.hpp>
#endif
#include "cl_tools.hpp"
#include <iostream>
#include <tuple>
int main()
{
// To execute the program, we need context and device.
auto [program, context, device] = program_builder("../kernels/helloworld.cl");
char buff[16];
c... |
JavaScript | UTF-8 | 7,350 | 2.921875 | 3 | [] | no_license | var y=document.getElementById('text-content');
function ahah(url, target) {
document.getElementById(target).innerHTML = ' Fetching data...';
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
if (req != undefin... |
Java | UTF-8 | 934 | 2.921875 | 3 | [] | no_license | package com.hyxy.viary;
public class DiaryItem {
private int year;//年份
private int month;//月份
private int day;//日期
private String diaryContent;//日记内容
public DiaryItem(int year, int month, int day, String content){
this.year=year;
this.month=month;
this.day=day;
this... |
C | UTF-8 | 1,227 | 3.765625 | 4 | [] | no_license | /*
CH-230-A
a7p4.c
Erlisa Kulla
e.kulla@jacobs-university.de
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
//capitalizing all letters
char* upper(char* str) {
int i;
for (i = 0; str[i]; i++)
str[i] = toupper(str[i]);
return str;
}
//converting t... |
Python | UTF-8 | 2,135 | 2.796875 | 3 | [] | no_license | import numpy as np
from sklearn.base import ClassifierMixin, BaseEstimator
from keras.layers import Dense, Input, Add, Concatenate
from keras.models import Model
from keras.optimizers import Adam
from keras.wrappers.scikit_learn import KerasClassifier
from constants import *
class BaselineClassifierTitanic(BaseEstim... |
Python | UTF-8 | 2,011 | 3.53125 | 4 | [] | no_license | # 세그먼트 트리
# https://upcount.tistory.com/12
import sys
# 세그먼트 트리 생성
def init(node, start ,end):
# node가 leaf node인 경우 배열의 원소 값 반환.
if start == end:
tree[node] = arr[start]
return tree[node]
# 재귀 함수를 이용하여 왼쪽/오른쪽 자식 트리를 만들고 합을 저장.
else:
mid = (start + end) // 2
tree[node] ... |
C# | UTF-8 | 1,320 | 3.359375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SmartPacMan
{
/// <summary>
/// Main charatcer class in game. Controlled by user.
/// </summary>
public class Pacman : Character
{
public Pacman()
{
state = PacmanState.Closed;
lastMove = Path... |
Java | UTF-8 | 100,794 | 1.5625 | 2 | [] | no_license | // $Id: RGroupTool.java 3864 2009-12-18 22:09:45Z nguyenda $
package gov.nih.ncgc.rgroup;
import chemaxon.formats.MolImporter;
import chemaxon.marvin.beans.MViewPane;
import chemaxon.struc.MolAtom;
import chemaxon.struc.Molecule;
import com.jgoodies.looks.plastic.Plastic3DLookAndFeel;
import com.jidesoft.swing.CheckBo... |
PHP | UTF-8 | 1,881 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | <?php declare(strict_types = 1);
/**
* SensorRange.php
*
* @license More in LICENSE.md
* @copyright https://www.fastybird.com
* @author Adam Kadlec <adam.kadlec@fastybird.com>
* @package FastyBird:ShellyConnector!
* @subpackage Entities
* @since 1.0.0
*
* @date ... |
JavaScript | UTF-8 | 827 | 2.6875 | 3 | [
"MIT"
] | permissive | 'use strict';
export default class RewardList {
constructor(el) {
this.el = el;
this.newClass = 'is-new';
this.removeNewSticker = this.removeNewSticker.bind(this);
[].forEach.call(this.el.querySelectorAll('.js-reward-list-item.is-new'), item => {
item.addEventListener('mouseenter', this.onMou... |
C# | UTF-8 | 3,859 | 2.953125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Net.Http;
using System.Threading.Tasks;
using BoilerController.Common.Helpers;
using BoilerController.Common.Models;
using Newtonsoft.Json;
namespace BoilerController.Common.Services
{
public class BoilerServerServi... |
JavaScript | UTF-8 | 3,856 | 2.75 | 3 | [
"MIT"
] | permissive | const path = require('path');
const https = require('https');
const fs = require('fs');
const keyword = process.argv[2]; // 搜索的正则表达式关键字
const url = 'https://raw.githubusercontent.com/any86/any-rule/master/packages/www/src/RULES.js';
function fetchData() {
return new Promise((resolve, reject) => {
https.ge... |
C | UTF-8 | 2,394 | 2.671875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_condition.c :+: :+: :+: ... |
Swift | UTF-8 | 802 | 3.46875 | 3 | [] | no_license | //
// Reorder.swift
// DSAlgo
//
// Created by Shilpa M on 15/06/21.
//
//1->2->3->4->nil
//Reord to
//1->4->2->3->nil
//get to middle of the list and saperate it
// 1-> 2
// 3->4
// reverse the second list
//4->3
// merge 1st and 2nd list
func reorderList(_ node : NodeL) {
if node == nil || node.next ==... |
Python | UTF-8 | 596 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from classes.Price_Bond_Regular import PriceBondRegular
def test_px_bond_reg_one():
test = PriceBondRegular(9, 20, 6, 12, 1000)
assert round(test.calculate()) == 774, "Should be $774"
def test_px_bond_p... |
Python | UTF-8 | 579 | 3.453125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
# @Time : 2019/11/18 15:45
# @Author : 赵金林
# @Site :
# @File : test.py
import sys
# line = sys.stdin.readline().strip()
# print(line) # 输出的字符串
#
# n = int(input())
# print(n) # 输出为数字
#
# l = list(map(int, input().split(" ")))
# print(l) # 单行输入输出为数组
if __name__ == "__ma... |
C# | UTF-8 | 220 | 3.09375 | 3 | [] | no_license | public static void Main()
{
C c = new C();
var a = c;
Console.WriteLine(a.GetType()); // It still is of `C` type
a.Show(); // Prints out "C.Show"
c.Show(); // Prints out "C.Show"
Console.ReadLine();
}
|
C# | UTF-8 | 8,718 | 3.203125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataManager;
using Scene;
namespace IO
{
class GetValue
{
public static int GetIntAnswer(string question, int min, int max)
{
string strAnswer;
int intAnswer;
string... |
Python | UTF-8 | 382 | 3.171875 | 3 | [] | no_license | #Euler Project 72
#Thinginitself
import math
fac = [0] * 10 ** 7
f = [0] * 10 ** 7
def getEulerfuc(size):
for i in xrange(2,size):
if fac[i]!=0:
tmp = i/fac[i]
if tmp%fac[i]==0:
f[i] = f[tmp]*fac[i]
else:
f[i] = f[tmp]*(fac[i]-1)
else:
f[i] = i-1
for j in xrange(i*i,size,i):
if fac[j... |
Java | UTF-8 | 1,640 | 2.484375 | 2 | [] | no_license | package edu.sdsu.cs.ramya.ratetheinstructor;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.RelativeLayout;
import android.widget.TextView;
import ... |
Swift | UTF-8 | 4,672 | 2.765625 | 3 | [] | no_license | //
// DetailsView.swift
// ClaroChallenge
//
// Created by Andre Luis Campopiano on 26/06/2018.
// Copyright © 2018 Andre Luis Campopiano. All rights reserved.
//
import UIKit
class DetailsView: UIView {
@IBOutlet weak var bannerImage: UIImageView?
@IBOutlet weak var titleLabel: UILabel?
@IBOutle... |
Java | UTF-8 | 197 | 2.1875 | 2 | [] | no_license | package com.excepciones.Factura;
public class InsertandoFacturaException extends Exception{
public InsertandoFacturaException(){
super("Ha ocurrido un error ingresando factura");
}
}
|
SQL | UTF-8 | 787 | 3.53125 | 4 | [] | no_license | SELECT * FROM PRODUCT
LEFT JOIN VINYL_PRODUCT
ON VINYL_PRODUCT.VINYLPRODUCT_ID = PRODUCT.PRODUCT_ID
LEFT JOIN CD_PRODUCT
ON CD_PRODUCT.CDPRODUCT_ID = PRODUCT.PRODUCT_ID
LEFT JOIN ALBUM_MP3_PRODUCT
ON ALBUM_MP3_PRODUCT.ALBUM_MP3_PRODUCT_ID = PRODUCT.PRODUCT_ID
LEFT JOIN TRACK_MP3_PRODUCT
ON TRACK_MP3_PRODUCT.TRACK_MP3_P... |
C++ | UTF-8 | 2,677 | 2.875 | 3 | [] | no_license | #include "PLCValueEvent.hpp"
#define PLCValueEvent_Constructor(name,littletype,valuetype) \
PLCValueEvent PLCValueEvent::name(littletype value)\
{\
union PLCValue data;\
data.valuetype = value;\
struct timeval tv;\
gettimeofday(&tv, NULL);\
struct PLCTime time = PLCValueEvent::TimevalToTime(tv);\
return PLCValue... |
Java | UTF-8 | 417 | 2.40625 | 2 | [] | no_license | package top.kanetah.planH.info;
/**
* created by kane on 2017/08/11
*
* 信息报表枚举类接口
*/
public interface InfoEnumInterface {
/**
* 执行信息类的一个方法
* @param object 被执行的信息类对象
* @return 返回值
*/
Object invokeMargetMethod(Object object);
/**
* 获取枚举值
*
* @return 枚举值
*/
St... |
C# | UTF-8 | 3,309 | 3.640625 | 4 | [] | no_license | using System;
namespace LeetCodeNote.Array
{
/// <summary>
/// 1385. 两个数组间的距离值
/// https://leetcode-cn.com/problems/find-the-distance-value-between-two-arrays/
/// </summary>
public class Solution_1385
{
// method 1
// 暴力
public int FindTheDistanceValue_0(int[] arr1, ... |
PHP | UTF-8 | 2,442 | 3.28125 | 3 | [] | no_license | <?php
class Database
{
private $connection;
/**
* Database constructor.
*
* Baut die Verbindung zur Datenbank auf
*/
public function __construct()
{
// MySQL-Zugangsdaten
// Hier: Automatisch auslesen aus .my.cnf. Sonst einfach von Hand eintragen
... |
Markdown | UTF-8 | 2,256 | 3.484375 | 3 | [] | no_license | # 长期分支
----
因为 Git 使用简单的三方合并,所以就算在一段较长的时间内,反复把一个分支合并入另一个分支,也不是什 么难事。 也就是说,在整个项目开发周期的不同阶段,你可以同时拥有多个开放的分支;你可以定期地把某些 特性分支合并入其他分支中。
许多使用 Git 的开发者都喜欢使用这种方式来工作,比如只在 `master` 分支上保留完全稳定的代码——有可能仅 仅是已经发布或即将发布的代码。 他们还有一些名为 `develop` 或者 `next` 的平行分支,被用来做后续开发或者 测试稳定性——这些分支不必保持绝对稳定,但是一旦达到稳定状态,它们就可以被合并入 `master `分支了。 这 样,在确保这些已完成的... |
Java | UTF-8 | 1,432 | 2.234375 | 2 | [] | no_license | package org.molsbee.movie.model.web;
import lombok.Data;
import org.molsbee.movie.model.database.Movie;
import org.molsbee.movie.omdb.Type;
import java.util.List;
@Data
public class CreateMovieRequest {
private String title;
private String year;
private String rating;
private String releaseDate;
... |
C++ | UTF-8 | 852 | 2.90625 | 3 | [] | no_license | #include <vector>
#include <chrono>
#include <algorithm>//修正点1
#include "number.h"
using namespace std;
using namespace std::chrono;
int main() {
auto t0 = high_resolution_clock::now();
const int N = 400000;
vector<int> primes;
#pragma omp parallel //修正点2
#pragma omp for sched... |
C++ | GB18030 | 371 | 2.53125 | 3 | [] | no_license | #include"event.h"
#include"../../render/render.h"
//(뵱ǰڵĹϵ˵)
class EventMouse:public Event
{
public:
//λ
MOUSEMSG m;
//ϵвʱд
EventMouse(MOUSEMSG m);
MOUSEMSG getMouse();
Vec2 getPosition(){ return Vec2(m.x,m.y);}
static EventMouse* create(MOUSEMSG m);
}; |
C++ | UTF-8 | 1,126 | 2.59375 | 3 | [] | no_license | //
// Created by munk on 15-02-17.
//
#ifndef CLIENT_SERVER_SOCKET_TCPSERVER_H
#define CLIENT_SERVER_SOCKET_TCPSERVER_H
#define QUEUESIZE 4
#include <iostream>
#include <netdb.h>
#include <sys/socket.h>
class TCPServer {
public:
/*!
* Setup constants
*/
TCPServer();
/*!
* Setup the ser... |
Markdown | UTF-8 | 729 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | # ams-cfn-lint-custom-rules
CFN Lint custom rules to validate CFN templates for ingestion into AWS Managed Services (AMS). The rules are used in combination with [CloudFormation Linter package](https://github.com/aws-cloudformation/cfn-python-lint) and will help you determine if your custom CloudFormation template can... |
JavaScript | UTF-8 | 442 | 3.6875 | 4 | [] | no_license | function nome(numero1, numero2, numero3){
if(numero1>numero2){
if(numero1>numero3){
return numero1
} else{
return numero3
}
} else{
if(numero2>numero3){
return numero2
} else{
return numero3
}
}
}
var numero1=... |
Java | GB18030 | 9,772 | 1.703125 | 2 | [] | no_license | package com.sino.soa.td.srv.assetretire.servlet;
import com.sino.ams.bean.OrgOptionProducer;
import com.sino.ams.newasset.constant.AssetsWebAttributes;
import com.sino.ams.system.user.dto.SfUserDTO;
import com.sino.base.constant.db.QueryConstant;
import com.sino.base.db.conn.DBManager;
import com.sino.base.dto.... |
C | UTF-8 | 1,145 | 3.0625 | 3 | [
"Apache-2.0"
] | permissive | #define BUF_SIZE 300
void reverse(char *buf, int sz)
{
/* TODO: Reverse list. */
}
int is_zero(char *buf, int sz)
{
/* TODO: Check if number is zero.*/
return 0;
}
void num_div(char *num, int num_sz, char *div, int *div_sz, int *rem)
{
/* TODO: Divide num by 255. Put result to div and the remainder t... |
TypeScript | UTF-8 | 2,600 | 2.609375 | 3 | [
"MIT"
] | permissive | import { ThemeVariants } from '../../shared/theme';
import * as fromThemeActions from './theme.actions';
import * as fromThemeReducers from './theme.reducers';
describe(' Theme Reducers', () => {
const state = {
"themes":{
"appleTheme":{
"primary":{"baseColor":"yellow"}, "primaryAccent":{"baseCol... |
JavaScript | UTF-8 | 4,190 | 2.75 | 3 | [] | no_license | //Load required modules
var Pos = require('./sPos');
var Cell = require('./sCell');
var Map = require('./sMap');
var Player = require('./sPlayer');
//Configure server
var port = 4242;
var logLevel = 1;
var io = require('socket.io').listen(port);
io.set('log level',logLevel);
//Create map
var map = new Map();
var lig... |
Python | UTF-8 | 140 | 3.359375 | 3 | [] | no_license | from numpy import *
string = input("digite a string: ")
copy = ""
for i in string:
if(i != "a" and i != "A"):
copy = copy + i
print(copy) |
Java | UTF-8 | 677 | 3.3125 | 3 | [] | no_license | class Student
{
// instance variable
//they came into memory when object is object
private int rollNo;
private String name;
// camel case
private String courseName;
private int marks;
// local variable
public void input(int rollNo,String name ,String courseName , int marks)
{
if (rollNo >0)
{
this.rol... |
C++ | UTF-8 | 1,468 | 3.640625 | 4 | [] | no_license | #include <iostream>
using namespace std;
void sort(int*, int);
int main(){
//Number of test cases
int t;
cin>>t;
for(int i = 0; i < t; i++){
//Order of the square matrix
int n;
cin>>n;
int elements[n*n]={0};
//Store the elements in a 1D array
for(int j = 0; j < n; j++){
for(int k = 0; k < n... |
TypeScript | UTF-8 | 513 | 2.859375 | 3 | [] | no_license | import {
GET_AUTHOR_BY_UID,
SET_ERROR_AUTHOR_BY_UID_TRUE
} from "../actions/types";
export const initialState: object = {};
export default function(
state = initialState,
action: { type: string; payload?: any }
) {
switch (action.type) {
case GET_AUTHOR_BY_UID:
return {
...state,
.... |
Markdown | UTF-8 | 1,047 | 3.328125 | 3 | [] | no_license | 1913 · Query Student Enrollment Information
Write a SQL query, the condition: no matter whether the student has a student enrollment information, student needs to provide the following information based on the above two tables:
student_name,
phone,
hometown,
address
Table definition 1: students
| Column Name | Type... |
Java | UTF-8 | 2,181 | 1.679688 | 2 | [] | no_license | /* */ package com.bright.assetbank.application.action;
/* */
/* */ import com.bn2web.common.action.Bn2Action;
/* */ import com.bn2web.common.exception.Bn2Exception;
/* */ import com.bright.assetbank.application.constant.AssetBankConstants;
/* */ import com.bright.assetbank.application.constant.AssetB... |
Java | UTF-8 | 46,842 | 1.625 | 2 | [] | no_license | package instrument.analysis;
import static org.codehaus.groovy.gjit.DebugUtils.dump;
import static org.codehaus.groovy.gjit.DebugUtils.print;
import static org.codehaus.groovy.gjit.DebugUtils.println;
import static org.codehaus.groovy.gjit.DebugUtils.toggle;
import java.util.ArrayList;
import java.util.HashMap;
impor... |
Markdown | UTF-8 | 189 | 2.78125 | 3 | [] | no_license | # Website-builder
A website builder to make it easier for myself and other developers to design and create simple websites that can be easily added onto and customized with HTML CSS and JS
|
C | UTF-8 | 1,208 | 3.109375 | 3 | [] | no_license | #include<stdio.h>
#include<math.h>
#define N 1000000
unsigned long long int prime[N];
void primetabel()
{
int i,j,root;
for(i=2;i<=N;i++)
prime[i]=1;
prime[1]=0;
prime[0]=0;
root=sqrt(N);
for(i=2;i<=root;i++)
if(prime[i]==1)
for(j=i*i;j<=N;j+=i)
prime[j]=0... |
C# | UTF-8 | 526 | 3.421875 | 3 | [] | no_license | static void Main(string[] args)
{
Salutation hello = new Salutation();
hello.OtherParty = "World";
hello.GreetingDelegate = new AddressDelegate(HelloSayer);
hello.GreetingDelegate(hello.OtherParty);
Console.ReadKey();
}
pu... |
Markdown | WINDOWS-1250 | 2,796 | 2.546875 | 3 | [] | no_license |
Formats: [HTML](/news/2010/03/6/the-chilean-navy-removes-commander-mariano-rojas-head-of-the-oceanography-service-from-his-post-following-his-failure-to-warn-of-the-tsuna.html) [JSON](/news/2010/03/6/the-chilean-navy-removes-commander-mariano-rojas-head-of-the-oceanography-service-from-his-post-following-his-failure-... |
Java | UTF-8 | 1,624 | 2.34375 | 2 | [] | no_license | package edu.shtanko.unarea.app.days_week_b;
import android.app.Activity;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import edu.shtanko.unarea.app.R;
import edu.shtanko.unarea.app.weeks.week_b.friday_lessons_week_b.*;
public class Friday exte... |
Markdown | UTF-8 | 1,323 | 3.359375 | 3 | [] | no_license | 1) Learning HTML was completly new to me. I had heard of HTML, but hadn't ever learned what it was or why it was used. One of my favorite things I learned from HTML was how to embed a photo or a map. I never knew the amount of work that went into putting a picture on a website. Another things I learned about html was h... |
Markdown | UTF-8 | 2,369 | 2.515625 | 3 | [
"MIT"
] | permissive | # JMNotifyView
一行代码实现通知视图,零耦合, 适配iPhone X及以上机型
* 超强性能、零耦合
* 默认集成四种通用样式
* 高度自定义
# 版本
* 2018-01-21 初始版本
# 演示

# 如何安装
### 通过CocoaPods导入
```
pod 'JMNotifyView'
```
### 手动导入
```
直接下载工程把JMNotifyView文件夹拖入工程中即可使用
```
# 如何使用
### 1、导入头文件
```
... |
Java | UTF-8 | 951 | 3.140625 | 3 | [] | no_license | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.Queue;
import java.util.StringTokenizer;
public class PasswordGenerator_1225 {
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
public static void main(String[] args) throws ... |
Python | UTF-8 | 2,735 | 2.640625 | 3 | [] | no_license | #sjParseJson.py
#from http://www.plugshare.com/
#import Modules
import json, string, os, codecs, sys
#banner
print "***\nWORKING WITH PLUGSHARE\nhttp://www.plugshare.com/\n\nSusan Jones\n19 July 2016\n"
print "json to CSV Parsing\n***"
#todo: hardcode the parameters
n = 0
jsonFile = r'd:\Tmp\worksi... |
Java | UTF-8 | 5,885 | 2.1875 | 2 | [] | no_license | package com.icss.tjfx.total.structure.vo;
/**
* 总量情况结构VO
* @author lcx
*
*/
public class PriceClassVO {
private String C_CLASS;//价类编码
private String CLASS_NAME;
private String CIG_NAME;//规格名称
//产量
private String produceNum_bq;//本期
private String produceNum_tq;//同期
private String produceNum_bl;//+-量
pri... |
Java | UTF-8 | 1,540 | 3.890625 | 4 | [
"Apache-2.0"
] | permissive | package org.zongjieli.leetcode.question.daily.year2021.month9.week2;
/**
* 一个班级里有 n 个学生,编号为 0 到 n - 1
* 每个学生会依次回答问题,编号为 0 的学生先回答,,然后是编号为 1 的学生,以此类推
* 直到编号为 n - 1 的学生,然后老师会重复这个过程,重新从编号为 0 的学生开始回答问题
*
* 给一个长度为 n 且下标从 0 开始的整数数组 chalk 和一个整数 k
* 一开始粉笔盒里总共有 k 支粉笔
* 当编号为 i 的学生回答问题时,他会消耗 chalk[i] 支粉笔
* 如果剩余粉笔数量严格小于 cha... |
Python | UTF-8 | 600 | 2.640625 | 3 | [] | no_license | import sklearn
import pickle
import numpy as np
from random import randint
filename = 'finalized_model.sav'
loaded_model = pickle.load(open(filename, 'rb'))
input_file = open("data_clean_imputed.csv","r")
lines = input_file.readlines()
CLASSIFICATION_TYPE = 2
NUM_PCA = 270;
X = []
for line in lines:
tokens = line... |
Java | UTF-8 | 522 | 2 | 2 | [] | no_license | package main;
import edu.wpi.first.wpilibj.Talon;
import lib.joystick.XboxController;
public interface HardwareAdapter extends Constants {
//DriveTrain Talon's
public static final Talon forwardTalon = new Talon(DRIVETRAIN_TALON_FORWARD_PWM_OUT);
public static final Talon leftTalon = new Talon(DRIVETRAIN_TALON_LEFT... |
SQL | UTF-8 | 1,658 | 3.671875 | 4 | [] | no_license | -- drop table nut_coffee.recipe_ingredients;
CREATE TABLE nut_coffee.recipe_ingredients
(
recipe_id bigint unsigned NOT NULL COMMENT 'id продаваемого товара',
ingredient_id bigint unsigned NOT NULL COMMENT 'id ингредиента',
measurement_unit_id bigint unsigned NOT NULL COMMENT 'id единицы изм... |
Java | UTF-8 | 727 | 2.84375 | 3 | [] | no_license | package domain.entity;
public class Liceu {
private final String nume;
private final String adresa;
private final String localitate;
public Liceu(String nume, String adresa, String localitate) {
this.nume = nume;
this.adresa = adresa;
this.localitate = localitate;
... |
Java | UTF-8 | 3,953 | 2.359375 | 2 | [] | no_license | package edu.uga.cs4300.logiclayer;
import java.io.InputStream;
import java.sql.Blob;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import edu.uga.cs4300.objectlayer.Recipe;
import edu.uga.cs4300.objectlayer.User;
import edu.uga.cs4300.persistlayer.RecipePersistImpl;
public class R... |
Markdown | UTF-8 | 2,148 | 2.53125 | 3 | [] | no_license | # Bouncing Line

## 원본
파일 구조와, 코드 스타일을 변경했습니다. 원본을 참고하고 싶으시면 아래 링크를 이용해주세요.
- **원작자**: Interactive Developer
- **링크**: [HTML5 Canvas Tutorial : 자바스크립트로 줄 튕기는 효과 만들기](https://www.youtube.com/watch?v=dXhAQbE8iBg&list=PLGf_tBShGSDNGHhFBT4pKFRMpiBrZJXCm&index=3)
## 개선점
### 1. 상... |
C++ | UTF-8 | 1,715 | 2.84375 | 3 | [] | no_license | #include "Alien.h"
#include "SpawnSystem.h"
Alien::Alien()
{
CreatePoints();
alive = false;
transform.SetVelocity(_speed, 0);
collisionFunction = std::bind(&Alien::Collide, this);
}
Alien::Alien(Player* player) : _player(player)
{
collisionFunction = std::bind(&Alien::Collide, this);
transform.SetVelocity(_sp... |
Java | UTF-8 | 1,928 | 2.4375 | 2 | [] | no_license | package com.stackroute.musicservice.repository;
import com.stackroute.musicservice.domain.Track;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boo... |
C++ | GB18030 | 1,616 | 3.25 | 3 | [] | no_license | // poj 1041.John's trip
// ŷ· ڽӾǵͱߵĹϵ
// references:
// http://blog.csdn.net/xymscau/article/details/6450657
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int graph[50][2000]; //[][öı] = һ
int vis[2000];
int degree[50];
int maxEdge;
int stack[2000];
int top;
void... |
Java | UTF-8 | 591 | 1.921875 | 2 | [
"Apache-2.0"
] | permissive | package features;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.noear.solon.test.HttpTester;
import org.noear.solon.test.SolonJUnit4ClassRunner;
import org.noear.solon.test.SolonTest;
import webapp.App;
/**
* @author noear 2023/6/13 created
*/
@RunWith(SolonJUnit4ClassRunner.class)
@SolonTest(A... |
JavaScript | UTF-8 | 4,472 | 3.71875 | 4 | [] | no_license | /**
* 格式化时间
* type:1 return 2018/05/01 01:01:01
* type:2 return 2018-05-01
* type:3 return 刚刚 xx分钟前 昨天
*/
let formatTime = (date, type = 1) => {
date = formatTimeZone(date, 0)
let year = date.getFullYear()
let month = date.getMonth() + 1
let day = date.getDate()
let hour = date.getHours()
let minute = ... |
Markdown | UTF-8 | 273 | 2.5625 | 3 | [
"MIT"
] | permissive | ---
title: "Are science and spirituality the same?"
date: 2021-02-19
---
So today's topic is how when does science transform into spirituality?
Traditinal science had always told us that everything in reality is composed by particles formed by a nucleos that yields matter
|
Java | UTF-8 | 321 | 1.617188 | 2 | [
"Apache-2.0"
] | permissive | package org.ifinal.finalframework.dashboard.web.entity;
import java.io.Serializable;
import lombok.Data;
/**
* @author likly
* @version 1.0.0
* @since 1.0.0
*/
@Data
public class ResultMapping implements Serializable {
private String name;
private Class<?> type;
private boolean required = true;
}
... |
JavaScript | UTF-8 | 2,533 | 2.84375 | 3 | [
"MIT"
] | permissive | $( document ).ready( function () {
// TOPHEADER
// -------------------------------------------------------------
var topNavLink = document.querySelector( '#topNavLink' );
var topHeader = document.querySelector( '#topHeader' );
topNavLink.addEventListener( 'click', function ( event ) {
event... |
Java | UTF-8 | 1,553 | 2.953125 | 3 | [] | no_license | package core.java.chapter9.linkedList;
import com.sun.xml.internal.bind.v2.TODO;
import java.util.*;
/**
* @author: huakaimay
* @since: 2020-11-03
*/
public class LinkedListTest {
public static void main(String[] args) {
LinkedList<String> a = new LinkedList<>();
a.addLast("Amy");
a.ad... |
Python | UTF-8 | 211 | 2.984375 | 3 | [] | no_license | # coding: utf-8
# 对unicode码进行排序
import pyuca
coll = pyuca.Collator()
fruits = ['caju', 'atemoia', 'cajá', 'açaí', 'acerola']
sorted_fruits = sorted(fruits, key=coll.sort_key)
print(sorted_fruits)
|
C++ | UTF-8 | 4,719 | 3.765625 | 4 | [
"BSD-3-Clause"
] | permissive | #pragma once
#include <stdint.h>
//
// Declaration
//
template< typename Type, uint8_t Capacity >
class Queue
{
public:
static_assert(Capacity > 0, "Attempt to create a Queue with Capacity less than 1");
static_assert(Capacity < 128, "Attempt to create a Queue with Capacity greater than 127");
using ItemType = T... |
Java | UTF-8 | 309 | 1.75 | 2 | [] | no_license | package com.demo.nspl.restaurantlite.SMS;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;
public interface InterfaceCheckCustCreditSMS {
@GET("DeveloperApiV1/CheckCustCreditSMS")
Call<ClsCheckCustCreditSMSParams> value(@Query("CustomerCode") String CustomerCode);
}
|
Java | UTF-8 | 1,406 | 2.5625 | 3 | [] | no_license | package com.project.spring.app.employeeSkill;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
@Entity
@Table(na... |
Java | UTF-8 | 653 | 2.96875 | 3 | [] | no_license | package objects;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
/**
* Class for a (non-blocking) park
*/
public class Park extends Block {
/**
* Creates a new park
*
* @param pos_x X index starting at 0 (will get transformed to coordinate after level-init)
* @param ... |
C++ | UTF-8 | 1,983 | 2.53125 | 3 | [] | no_license | #ifndef BtaCandListIterator_hh
#define BtaCandListIterator_hh
//////////////////////////////////////////////////////////////////////////
// //
// BtaCandListIterator //
// //
/... |
Java | UTF-8 | 3,121 | 2.5625 | 3 | [
"MIT"
] | permissive | package de.digitalcollections.prosemirror.model.jackson.contentblocks;
import de.digitalcollections.prosemirror.model.api.contentblocks.Heading;
import de.digitalcollections.prosemirror.model.api.contentblocks.Text;
import de.digitalcollections.prosemirror.model.impl.contentblocks.HeadingImpl;
import de.digitalcollect... |
JavaScript | UTF-8 | 385 | 3.5 | 4 | [] | no_license | var imgUrl = null, degree = null
do {imgUrl = prompt('Enter link')} while (!imgUrl.startsWith('http'))
do {degree = prompt('Enter degree')} while (isNaN(degree))
var startDegree = 0
for ( var i = 1; i <= 5; i++) {
var img = document.createElement('img')
img.src = imgUrl
document.body.appendChild(img)
startDegree... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.