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 | 978 | 2.34375 | 2 | [] | no_license | package com.ryklief;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;
public class shapesTest {
shapes shape = new shapes();
@Test (timeout = 1000)
@Before
public void setUp() throws Exception {
shape.calcAr... |
PHP | UTF-8 | 1,773 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: yuhanghe
* Date: 2019/5/12
* Time: 下午8:39
*/
defined('BASEPATH') OR exit('No direct script access allowed');
require APPPATH.'models/OrderModel.php';
require APPPATH.'models/ProductionModel.php';
class OrderService
{
public function insertOrder($token, $content, $addres... |
JavaScript | UTF-8 | 2,397 | 3.078125 | 3 | [] | no_license | // HACK: Monkey patch the language so WET widgets work properly.
// WET determines the current language based on the value of
// document.documentElement.lang. It then uses that language to set the text
// in some of its widgets (e.g. the social media Share button and popup)
// since the WET scripts need to run before ... |
C# | UTF-8 | 1,209 | 3.453125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Flower_Shop
{
class Program
{
static void Main(string[] args)
{
int countOfMagnolia = int.Parse(Console.ReadLine());
int countOfzyumbul = int.Pa... |
Python | UTF-8 | 1,304 | 2.640625 | 3 | [] | no_license | import os
from os import listdir
from os.path import isfile, join
data = "NP.txt"
### print possible datasets ###
if os.path.exists('./dbase'):
cwd = os.getcwd()
datasets = [f for f in listdir('./dbase/raw') if isfile(join('./dbase/raw/', f))]
print('\n'+'#'*50+'\n\n'"Possible datasets are:\n")
for f... |
Markdown | UTF-8 | 968 | 2.765625 | 3 | [] | no_license | Here is another skeletal document.
There really isn't much more to say, other than that this is the basic skeleton of a new document.
I am going to add some text to this markdown editor. We will see what happens.
I need more practice with git diff. I am also still completely in the dark about files that are in the p... |
Java | UTF-8 | 3,971 | 3.75 | 4 | [] | no_license | public class RobotManager {
//Метод автоматического перемещения робота в заданную позицию
public static void moveRobot(Robot robot, int toX, int toY) {
int nowX = robot.getX();
int nowY = robot.getY();
boolean needXplus = (nowX < toX);
boolean needXminus = (nowX > toX);
... |
Python | UTF-8 | 743 | 3 | 3 | [] | no_license | #!/usr/bin/python
# coding=utf-8
import numpy as np
import cv2
# 创建一块黑板
img = np.zeros((512, 512, 3), np.uint8)
# Draw Line
img = cv2.line(img, (0, 0), (511, 511), (255, 0, 0), 5)
# Drawing Rectangle
img = cv2.rectangle(img, (384, 0), (510, 128), (0, 255, 0), 1)
# Drawing Circle
img = cv2.circle(img, (447, 63), 63, ... |
Python | UTF-8 | 791 | 2.578125 | 3 | [
"MIT"
] | permissive | import json
REGISTER_PACKETS_NAME = b"RGTR"
class RegisterPackets:
def __init__(self, name: str = None, email: str = None, password: str = None, data=None):
self.name, self.email, self.password = name, email, password
self.jdict = dict()
if data is not None:
self.jdict = json.... |
C++ | UTF-8 | 581 | 2.53125 | 3 | [] | no_license | long fang(long x);
void main()
{
long sum,a,b,i,t,s,p;
sum=0;
scanf("%d",&a);
i=4;
p=10000;
s=a/p; // s=a/p; b=a%p;
while(s==0)
{
i=i-1;
p=fang(i);
s=a/p; // s=b/p; b=b%p;
}
t=i;
while(t>=0)
{
... |
Java | UTF-8 | 1,108 | 2.25 | 2 | [] | no_license | package Back;
import Back.FolderManager.CompareIdentTOExcelList;
import Back.FolderManager.GetList;
import Back.FolderManager.Task.Task;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class CertificateTas... |
Java | UTF-8 | 728 | 2.421875 | 2 | [] | no_license | package yarangi.game.harmonium.enemies;
import yar.quadraturin.objects.IBehavior;
public class ElementalDarknessBehavior implements IBehavior<ElementalDarkness>
{
public boolean behave(double time, ElementalDarkness entity, boolean isVisible)
{
// AABB aabb = entity.getAABB();
// aabb.x += entity... |
Ruby | UTF-8 | 2,959 | 2.859375 | 3 | [] | no_license | =begin
This little spider will collect security oriented change log data from all of the most
popular plugins on WordPress.org.
Copyright (C) 2013 Joshua Reynolds
This program 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 ... |
C# | UTF-8 | 936 | 2.625 | 3 | [] | no_license | using Microsoft.EntityFrameworkCore;
using registru_auto.Contexts;
using registru_auto.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace registru_auto.Services.Repositories
{
public class CarRepository : Repository<Cars>, ICarRepository
{
... |
Python | UTF-8 | 121 | 2.9375 | 3 | [] | no_license | A, B, C = map(int, input().split())
ABC = sorted([A, B, C], reverse=True)
print(int(str(ABC[0]) + str(ABC[1])) + ABC[2])
|
JavaScript | UTF-8 | 3,235 | 2.515625 | 3 | [
"MIT"
] | permissive | /*global $*/
function Ebay(config) {
var callbackName = "";
if ($.type(config) === "string") {
callbackName = config;
config = {};
config.callbackName = callbackName;
}
this.setParameters(config);
}
Ebay.prototype.setParameters = function (config) {
this.baseUrl = config.url... |
Python | UTF-8 | 1,826 | 3.953125 | 4 | [] | no_license | ### hangman.
### 1st make sure this file and the file of words are saved in the same folder
def oneW(letter,word,sentlist):
empty=True
for ii in range(0,len(word)):
if word[ii]==letter:
sentlist[ii]=word[ii]
empty=False
return sentlist,empty
def hangman(name_of_file):
#... |
JavaScript | UTF-8 | 3,804 | 3.140625 | 3 | [] | no_license |
function getToken() {
var username = "3b264586439c0c3af05fa5c857aa9a95";
var password = "e35b17d041dfb51c209012248750ae54";
var token = username + ":" + password;
var hash = btoa(token);
return hash;
}
function loadConstructs(statementName, ticker) {
var hash = getToken();
var req = new ... |
Markdown | UTF-8 | 13,156 | 2.59375 | 3 | [] | no_license | ---
title: ०८३
---
द्रौपदीं प्रति श्रीकृष्णपत्नीनां स्वस्वोद्वाहवृत्तांतवर्णनम् -
अथ त्र्यशीतितमोऽध्यायः 10.83
श्रीशुक उवाच
तथानुगृह्य भगवान्गोपीनां स गुरुर्गतिः
युधिष्ठिरमथापृच्छत्सर्वांश्च सुहृदोऽव्ययम् १
त एवं लोकनाथेन परिपृष्टाः सुसत्कृताः
प्रत्यूचुर्हृष्टमनसस्तत्पादेक्षाहतांहसः २
कुतोऽशिवं त्... |
C# | UTF-8 | 902 | 2.703125 | 3 | [] | no_license | using System;
using System.Threading.Tasks;
using Newtonsoft.Json;
using System.Net.Http;
namespace PokeForms.Helpers
{
public class PokeApiData
{
static PokeApiData _default;
public static PokeApiData Default {
get{
if (_default == null)
_default = new PokeApiData ();
return _default;
}
}... |
Python | UTF-8 | 813 | 2.828125 | 3 | [] | no_license | import os
from PIL import Image, ImageStat
from pathlib import Path
# -- Variables -- #
FOLDER_IMAGES = r"C:\Images"
EXTENSION = "jpg"
# --- Functions -- #
def hash_image(image_path):
img = Image.open(image_path).resize((8, 8), Image.LANCZOS).convert(mode="L")
mean = ImageStat.Stat(img).mean[0]
sum_aux =... |
Java | UTF-8 | 1,454 | 2.390625 | 2 | [] | no_license | package com.codecool.shop.controller;
import com.codecool.shop.dao.implementation.UserDaoMem;
import com.codecool.shop.model.User;
import spark.ModelAndView;
import spark.Request;
import spark.Response;
import java.util.HashMap;
import java.util.Map;
public class LoginController {
private static LoginControlle... |
C++ | UTF-8 | 591 | 3.4375 | 3 | [] | no_license | #include "note.h"
/*! Genera una nota desde un string respetando el formato
* asignado para guardar las notas
* RETURNS:
* < 0 on error
* 0 if success
*/
int Note::fromString(string &str)
{
cout << "estamos parseando una nota: "<< str << endl;
this->note = str;
return 0;
}
/*! Convierte una nota en un string lis... |
C++ | UTF-8 | 1,019 | 3.375 | 3 | [] | no_license | //
// Created by ali5 on 11/5/18.
//
#include "AST/ASTNodes/TerminalNodes/NullNode.h"
NullNode::NullNode(int line) :ASTNode(line) {
setType(NULLTY);
this->vector = new std::vector<std::string>;
this->vector->push_back("null");
}
void NullNode::pushType(std::string type) {
this->vector->push_back(type... |
C | UTF-8 | 386 | 3.796875 | 4 | [] | no_license | #include<stdio.h>
void main()
{
int a,b,c;
printf("enter three numbers a,b,c respectively");
scanf("%d%d%d",&a,&b,&c);
if(a=b=c)
printf("all numbers are equal");
else if(a=b)
printf("%d",c);
else if(b=c)
printf("%d",a);
else if(c=a)
printf("%d",b)... |
Markdown | UTF-8 | 1,859 | 3.171875 | 3 | [] | no_license | # SBF (Simple Binary Format) v0.2.0
A simple binary format for storing data.
SBF files are designed to be as braindead as possible,
i.e. easy to write, easy to read.
# Why?
It's nice to have a simple binary data format
for straightforward applications that don't have complex
requirements. (e.g. HDF5, netCDF etc.) ... |
Markdown | UTF-8 | 3,841 | 2.703125 | 3 | [
"MIT"
] | permissive | ---
author: "Fanny COURTIN"
author_url: ""
date: "2017-10-27 14:00:00 +0000 UTC"
location: "Amphi G. Besse"
title: "Soutenance de thèse: Étude de l'incinération du plutonium en REP MOX sur support d'uranium enrichi avec le code de simulation dynamique du cycle CLASS"
author_filiation: "Subatech (groupe Neutrino)"
autho... |
Markdown | UTF-8 | 4,293 | 2.546875 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: GitHub Enterprise Server-Releases
intro: '{% data variables.product.company_short %} veröffentlicht regelmäßig neue Versionen von {% data variables.product.product_name %}. Du kannst die unterstützten Versionen überprüfen, das Datum der Veralterung einsehen und die Dokumentation für das von dir bereitgestell... |
Python | UTF-8 | 1,650 | 2.578125 | 3 | [] | no_license | from datetime import datetime, timedelta
import pytz
from apps.subject.models import Semester
from tests.conftest import TestCase
class TestCourseLookup(TestCase):
@classmethod
def setUp(cls):
super().setUpClass()
values = [
{"year": 2020, "semester": 1},
{"year": 201... |
PHP | UTF-8 | 1,182 | 2.546875 | 3 | [] | no_license | <?php
if(isset($_SESSION['chatuser'])){
$q = new apm_Database_Query ();
$q->addTable ( 'forum_chat_chatters' );
$q->addQuery ( '*' );
$q->addWhere('name='.$_SESSION['chatuser']);
$q->exec ();
$row = $q->fetchRow ();
if (!empty($row[0])) {
$q = new apm_Database_Query ();
$q->addTable ( 'forum_chat_chatter... |
Python | UTF-8 | 714 | 2.59375 | 3 | [] | no_license | from google.auth.transport import requests
from google.oauth2 import id_token
CLIENT_ID = "508553430731-3sjtbacd9na89labelop5fii28h4ho1m.apps.googleusercontent.com"
def get_google_user_from_google_token(token):
try:
# Specify the CLIENT_ID of the app that accesses the backend:
idinfo = id_token.v... |
C++ | UTF-8 | 1,180 | 2.640625 | 3 | [] | no_license | #include "chatserverwidget.h"
#include <QHBoxLayout>
#include <QLabel>
#include <QMessageBox>
ChatServerWidget::ChatServerWidget(QWidget *parent) :
QWidget(parent)
{
QLabel *label = new QLabel(tr("port"));
m_linePort = new QLineEdit;
m_buttonListen = new QPushButton(tr("listen"));
m_buttonStop = n... |
C# | UTF-8 | 405 | 2.59375 | 3 | [] | no_license | using System;
// server's copy of the client
public class ServerClientHandle
{
public int id;
private NetGameConnection m_connection;
public ServerClientHandle(int idIn)
{
this.id = idIn;
m_connection = null;
}
public void SetGameConnection(NetGameConnection connectionIn)
{
m_connection = connectionIn;... |
C | UTF-8 | 638 | 2.671875 | 3 | [] | no_license | #include <SDL2/SDL.h>
void constant(char name[], int value) {
printf("public export\n");
printf("%s : Bits32\n", name);
printf("%s = %d\n\n", name, value);
}
int main(int argc, char *argv[]) {
/*
printf("sizeof(enum Fred) = %lu\n", sizeof(enum Fred));
int keyUp = 1073741906;
printf("keyUp = %d\n", keyUp)... |
C# | UTF-8 | 1,833 | 2.96875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//After we add all models to Models folder we have to add ".Models" after TrackerLibrary
//if you create a new class from the Models file ".Models" will added automaticlly
//but becasue we create our mo... |
C# | UTF-8 | 541 | 2.625 | 3 | [] | no_license | using SavasLibrary.Abstract;
using System;
using System.Drawing;
namespace SavasLibrary.Concrete
{
internal class Mermi : Cisim
{
public Mermi(Size hareketAlaniBoyutlari, int namluOrtasiX) : base(hareketAlaniBoyutlari)
{
BaslangicKonumunuAyarla(namluOrtasiX);
HareketMes... |
Markdown | UTF-8 | 1,336 | 2.578125 | 3 | [
"CC0-1.0"
] | permissive | ## Screenshots during Execution of the Code
### Rules and Instructions of the game:

### Player Info:
,
date_created DATETIME DEFAULT NOW(),
description VARCHAR(200),
id INTEGER NOT NULL AUTO_INCREMENT,
price INTEGER,
PRIMARY KEY (id),
);
CREATE TABLE order
(
class_id INTEGER NOT NULL,
child_first_name VARCHAR(30),
child_last_name VARCHAR(30),
... |
Python | UTF-8 | 3,433 | 2.71875 | 3 | [] | no_license | import numpy as np
import cPickle as pickle
import random
from logProgress import *
'''
Description : The file builds the ARCmtDataset using the ChildrenDict. The output
from this file is in comment_name format. To convert the output to
text_format, use buildARCmtDatasetText.py
Ouput : ARCmtDatas... |
Markdown | UTF-8 | 882 | 2.625 | 3 | [] | no_license | # Article D546-4
Lorsque le prévenu n'était pas présent à l'audience, la décision du juge de l'application des peines prévue par le troisième
alinéa de l'article 741-2 doit intervenir dans un délai de quatre mois à compter de la date à laquelle la condamnation lui a
été notifiée.
**Nota:**
Aux termes du premier alin... |
Swift | UTF-8 | 429 | 2.921875 | 3 | [] | no_license | //
// Reward.swift
// Rewardr
//
// Created by Kenny on 4/19/20.
// Copyright © 2020 Hazy Studios. All rights reserved.
//
import Foundation
//MARK: - Codable -
typealias RewardRep = [UUID:Reward]
//MARK: - Object -
struct Reward: Codable, Equatable {
let id: UUID
let name: String
var points: Int
... |
Java | UTF-8 | 625 | 3 | 3 | [
"MIT"
] | permissive | package db;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import logging.Logger;
public class FileOperations {
public static void writeFile(String file, String text, boolean append) {
BufferedWriter fileWriter = null;
try {
fileWriter = new BufferedWriter... |
Shell | UTF-8 | 1,782 | 4.0625 | 4 | [] | no_license | #!/bin/bash
#Script to identify java VM. Also modifies classpath on cygwin.
#Also used to instantiate headless version of Mesquite.
#Written by Travis Wheeler (www.traviswheeler.com)
#If you find bugs or modify the script to improve functionality,
# please let us know so we can improve the script for everyone
# Tha... |
Markdown | UTF-8 | 2,102 | 2.59375 | 3 | [] | no_license | # WES upload
CIDC Whole Exome Pipeline is a computational workflow for identifying somatic variants from tumor sample. The pipeline includes
tools for quality control (QC) and characterization of paired (tumor/normal) whole exome sequencing data.
## WES Workflow Overview
1. The CIMAC technician who is performing th... |
Java | UTF-8 | 1,497 | 3.296875 | 3 | [] | no_license | import java.util.LinkedList;
//这是一个Trie树
public class TT {
private class node {
char con;
boolean isE;
int count;
LinkedList<node> son;
public node(char ch){
son = new LinkedList<node>();
isE = false;
con = ch;
count = 0;
... |
C++ | UTF-8 | 1,394 | 3.03125 | 3 | [] | no_license | #ifndef MONSTER
#define MONSTER
#include "humanoids.h"
#include <iostream> //include input output stream library
#include <vector> //include the vector library
#include <cmath> //include the c math library
#include <cstdlib> //include the c standard library
#include <string> //include string library
//using commonly... |
C++ | UTF-8 | 10,988 | 3.421875 | 3 | [] | no_license | #pragma once
#include "Vector3D.h"
#include "Vector4D.h"
namespace ae
{
//------------------------------------------------------------------
inline uint getAlpha(uint Color)
{
return Color >> 24;
}
inline uint getRed(uint Color)
{
return (Color >> 16) & 0xFF;
}
inline uint getGreen(uint C... |
Markdown | UTF-8 | 759 | 2.671875 | 3 | [] | no_license | (83) Afin de déterminer ce que signifie le fait de communiquer l’information en temps utile avant le moment spécifié dans la présente directive, il convient que l’entreprise d’investissement prenne en considération, en tenant compte de l’urgence de la situation, le besoin qu’a le client de disposer de suffisamment de t... |
C# | UTF-8 | 3,909 | 2.734375 | 3 | [] | no_license | /**
* Created by KanishkaUdapitiya on 10/22/2016.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Cafe_Management_System
{
class Cafe
{
// Default Constructor
public Cafe()
{
newlatte_Coff = 0.0;
newespress... |
C# | UTF-8 | 588 | 3.09375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Division : Operacion
{
private int num1;
private int num2;
public Division()
{
this.num1 = 0;
this.num2 = 0;... |
Markdown | UTF-8 | 5,775 | 3.09375 | 3 | [] | no_license | #### Guide to UIST 2019
###### General goals
* What problems are you solving or what opportunities are you seizing?
*Problems:*
1. Assessment of user experience in 3D while interacting with objects at different levels of depth.
2. It is unclear how to switch seamlessly between multiple interactive co... |
C# | UTF-8 | 5,691 | 3 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Windows.Forms;
using QuanLyDayDep;
// Sử dụng đối tượng MessageBox
namespace QuanLyDayDep
{
//string sql;
class Functions
{
public static SqlConnecti... |
Java | UTF-8 | 4,747 | 1.976563 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-gutenberg-2020",
"CC0-1.0",
"BSD-3-Clause"
] | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... |
PHP | UTF-8 | 5,676 | 2.796875 | 3 | [] | no_license | <?php
require_once("config.php");
?>
<?php
$sid = $_POST['sid'];
$res= mysqli_query($con,"select distinct class_id , courses_enrolled from student where sid='$sid'");
while($row= mysqli_fetch_array($res))
{
$res2= mysqli_query($con,"select table_name from information_schema.tables where table_type='base table' and t... |
Rust | UTF-8 | 10,645 | 2.78125 | 3 | [] | no_license | #![warn(const_err, clippy::all)]
use parser::section::ByteSection;
use parser::tokenizer::{compress_next_token, utils::is_whitespace, Token};
use parser::validator::{ValidationContext, ValidationError, ValidationState, Validator};
use parser::{JsonPath, JsonPathSegment, JsonType};
use log::*;
use std::borrow::Cow;
us... |
Java | UTF-8 | 630 | 2.921875 | 3 | [] | no_license | package com.kodilla.rps;
import java.util.Objects;
public class Shape {
private final String shape;
public Shape(String shape) {
this.shape = shape;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Shape)) return false;
... |
Python | UTF-8 | 723 | 3.296875 | 3 | [] | no_license | from flask import jsonify
def resposta(status, message, http_code=200, dados=None):
"""
devolve um string json com formato especifico para as respostas dos endpoints
:param status: True ou False
:param message: string
:param http_code=200: código da requisição
:param dados=None... |
Shell | UTF-8 | 492 | 3.296875 | 3 | [] | no_license | #!/bin/bash
if [[ $1 == "" ]] || [[ $2 == "" ]] || [[ $3 == "" ]]; then
echo "Usage: $0 <player_max> <min_pop> <max_pop>"
exit
fi
player_max=$1
min_pop_i=$2
max_pop_i=$(($3 - 1))
max_pop_j=$3
for n in $(seq 1 $player_max); do
for i in $(seq $min_pop_i $max_pop_i); do
min_pop_j=$((i + 1))
for j in $(seq $mi... |
Markdown | UTF-8 | 270 | 2.546875 | 3 | [] | no_license | A program to name organic chemical compounds according to the IUPAC guidelines.
Currently supports simple alkanes, alkenes, alkynes and branched forms of them.
The inputs must be in the form of "CCC(C)C=C" (without quotes) and the branches must be the shortest group.
|
Markdown | UTF-8 | 700 | 2.71875 | 3 | [] | no_license | # Android_Adapter_Intent_Most_Populated_Country
using adapter intent and serialisation to pass object around in Android
ListView Custom ArrayAdapter Homework
Learning objectives
Practise creating a listView using a custom ArrayAdapter in an Android App
Task
Create a new Android app that displays a collection of you... |
Java | UTF-8 | 573 | 2.421875 | 2 | [] | no_license | package com.jiuxian.example1_sample;
import java.time.LocalDateTime;
/**
* @author: liuzejun
* *
* @email: 857591294@qq.com
* *
* @date: 2019-05-28 12:57:26
* *
* @description: 场景类
**/
public class Main {
public static void main(String[] args) {
IGamePlayer proxy = new GamePlayerProxy(new GamePl... |
C# | UTF-8 | 1,405 | 2.8125 | 3 | [] | no_license | using System;
namespace DataStores
{
public abstract class OrderLine
{
protected OrderLine(Guid id, GoodsType goodsType, int sKU, string? remark)
{
Id = id;
GoodsType = goodsType;
SKU = sKU;
Remark = remark;
}
public Guid Id { get... |
Java | UTF-8 | 1,879 | 2.28125 | 2 | [] | no_license | /*
* Copyright 2010 Ivan Bogicevic, Markus Knauß, Daniel Kulesz, Holger Röder, Matthias Wetzel
*
* This file is part of Jabi.
*
* Jabi 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 ... |
Swift | UTF-8 | 1,676 | 3.390625 | 3 | [] | no_license | //
// main.swift
// 0915
//
// Created by 조윤영 on 2021/09/08.
//
import Foundation
var N = 0
var M = 0
var board: [[Int]] = []
var chickens: [(y: Int, x: Int)] = []
var houses: [(y: Int, x: Int)] = []
var answer: Int = 5000
func input() {
let inputList = readLine()!.split(separator: " ").map{ Int($0)! }
N =... |
Python | UTF-8 | 1,603 | 3.859375 | 4 | [] | no_license | """
============================
Author:柠檬班-木森
Time:2020/2/15 12:15
E-mail:3247119728@qq.com
Company:湖南零檬信息技术有限公司
============================
"""
"""
break:强制跳出循环
continue:中止当前本轮循环,直接进行下一轮循环的条件判断
pass:没有具体的语义,用来占行,执行到改行代码直接通过,执行下一行
"""
#
# n = 0
# while n < 100:
# n += 1
# print("这是第{}打印:hello python".f... |
PHP | UTF-8 | 2,582 | 2.703125 | 3 | [] | no_license | <?php
$path = realpath(__DIR__);
$dbfile = 'last.db';
include $path.'/config.php';
date_default_timezone_set("Europe/Istanbul"); // set PDT
$x = simplexml_load_file($rssurl);
$file = 'last.db';
if(!is_file($file)){
$contents = ''; // Some simple example content.
file_put_contents($file, $contents)... |
JavaScript | UTF-8 | 514 | 2.53125 | 3 | [] | no_license | // TODO 正则表达式匹配用户id 和密码 返回bool值
// 传进的参数值是否是字符串
// user_id【8位数字】
export function is_userID(user_id) {
return true;
}
// password【6-18位,数字+大小写字母】
export function is_password(password) {
return true;
}
// course_id 正整数
export function is_courseID(course_id) {
return true;
}
// student_id 【8位数字】
export function ... |
Python | UTF-8 | 10,149 | 2.78125 | 3 | [
"MIT"
] | permissive | import pandas as pd
import numpy as np
from datetime import datetime, date, timedelta
import requests
import matplotlib.pyplot as plt
from countries import countries_dict
import matplotlib.dates as mdates
import matplotlib.ticker as ticker
def continents ():
date_url = date.today().strftime('%m-%d-%Y')... |
TypeScript | UTF-8 | 1,080 | 3.640625 | 4 | [
"MIT"
] | permissive | import { Tuple } from "./tuple";
export class Vector extends Tuple {
constructor(public x = 0, public y = 0, public z = 0, public w = 0) {
super(x, y, z, w);
}
static toVector(t: Tuple): Vector {
return new Vector(t.x, t.y, t.z);
}
magnitude(): number {
return Math.sqrt(
Math.pow(this.x, ... |
C# | UTF-8 | 969 | 2.734375 | 3 | [
"MIT"
] | permissive | namespace patience.core
{
public interface ICommand
{
void Do(Layout layout);
void Undo(Layout layout);
}
public class DealCommand : ICommand
{
public int From { get; set; }
public int To { get; set; }
public void Do(Layout layout)
{
layo... |
Markdown | UTF-8 | 9,194 | 2.859375 | 3 | [] | no_license | ---
title: Android开发艺术(1)——Activity的生命周期和启动模式
date: 2017-09-06 20:26:22
tags:
categories: 阅读笔记
---
# Activity生命周期的分析
从两种情况来分析
- 典型情况(用户正常参与的情况)
- 异常情况(由于内存不足,被系统杀掉、Configuration改变等)
## 典型情况下的生命周期分析
- onPause不能太耗时,因为上一个Activity执行完之后 下个Activity的onCreate/onStart/onResume/onResume才能执行,所以不要在onPause中执行耗时才做,使新的Activity... |
Java | UTF-8 | 1,392 | 2.640625 | 3 | [
"MIT"
] | permissive | package com.easydlna.dlna.dlnaclient;
import android.util.Log;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;
public class DlnaUtil {
static public String TAG = "DlnaUtil";
static public boolean isNetAccesible() {
if (getHostIp() == null... |
Java | UTF-8 | 1,600 | 3.03125 | 3 | [] | no_license | package com.lingb.mystudy.datastructure.day08;
import org.junit.Test;
import java.util.HashMap;
/**
* Created by lingb on 9/14/2018
*/
public class MyHashMapTest {
@Test
public void test1() {
HashMap<String, Integer> map = new HashMap<>();
map.put(null, null);
map.put("AA"... |
Java | UTF-8 | 966 | 2.109375 | 2 | [] | no_license | package com.binzhou.zhy.mapper;
import com.binzhou.zhy.entity.Logistics;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
* LogisticsMapper数据库操作接口类
*
**/
public interface LogisticsMapper{
/**
*
* 查询(根据主键ID查询)
*
**/
public Logistics selectByPrimaryKey(@Param("id") Long id)... |
Java | UTF-8 | 337 | 2.46875 | 2 | [] | no_license | package com.gmail.jarmusik.kamil.impl.number;
public class FibonacciLongObjectNode extends FibonacciNode<Long> {
public FibonacciLongObjectNode(Long[] data) {
super(data);
}
@Override
public FibonacciNode<Long> create(Long a, Long b) {
return new FibonacciLongObjectNode(new Long[]{b, ... |
Java | UTF-8 | 1,516 | 1.84375 | 2 | [] | no_license | package com.ihelin.car.controller.h5;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.ihelin.car.config.CommonConfig;
import com.ih... |
Shell | UTF-8 | 295 | 3.21875 | 3 | [] | no_license | #!/usr/bin/env bash
set -e
INPUT=$(readlink -f "${1}")
# https://unix.stackexchange.com/a/84980
TMP_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
cd $TMP_DIR
ffmpeg -i "${INPUT}" -vf "fps=15" "frame%04d.png"
gifski --fps 20 --quality 80 -o "${INPUT}.gif" frame*.png
rm -r $TMP_DIR
|
C# | UTF-8 | 1,419 | 2.625 | 3 | [
"MIT"
] | permissive | using System;
using System.Linq.Expressions;
namespace Z3.ObjectTheorem
{
public class ConstraintBuilder
{
private ObjectTheoremContext _objectTheorem;
internal ConstraintBuilder(ObjectTheoremContext objectTheorem)
{
_objectTheorem = objectTheorem;
}
publi... |
JavaScript | UTF-8 | 2,422 | 2.546875 | 3 | [] | no_license | import React from 'react'
import { convertToRupiah } from '../Helpers'
import { changeJumlah } from '../actions/productActions'
import { connect } from 'react-redux'
import PropTypes from 'prop-types'
class ProductListItem extends React.Component {
state = {
id: this.props.product.id,
nama: this.props.produc... |
C | UTF-8 | 4,708 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | # include "lib/common.h"
# define MAXLINE 4096
/**
*
* @param argc
* @param argv
* @return
*/
int main(int argc, char **argv) {
if (argc != 2) {
error(1, 0, "usage: graceclient <IPaddress>");
}
/* 创建 TCP 套接字,设置 IPv4 地址(清零、设置地址族,指定端口,转换地址),绑定指定的 IP 和端口 */
int socket_fd;
struct sockadd... |
C++ | UTF-8 | 1,445 | 3.4375 | 3 | [] | no_license | #include"hash_table2.h"
using sfils_csc212::hash_table2;
int main() {
//All requirements completed
// Advantages of this implementation:
/*
For a system like a student information system where the key is a number and the item is an student object
Ex: hash_table2<int,Student> CCNY_STUDENT_SYSTEM ;
searchi... |
JavaScript | UTF-8 | 2,038 | 3.609375 | 4 | [] | no_license | function Dictionary(cap) {
var buckets = new Array(cap)
var entries = new Array(cap)
var count = 0;
this.add = function (k, v) {
var idx = k % buckets.length;
var next = buckets[idx]
buckets[idx] = count;
var item = {
key: k,
value: v,
... |
C# | UTF-8 | 2,521 | 2.5625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DoNet.Common.DbUtility.Proxy
{
/// <summary>
/// 数据库访问的远程代理
/// </summary>
public class DBHelper:IDBHelper
{
/// <summary>
/// 生成本地访问实例
/// </summary>
/// <param name="db... |
C++ | UTF-8 | 1,357 | 3.046875 | 3 | [] | no_license | //
// Copyright (c) 2016 by Voaz Charov. All Rights Reserved.
//
#include <algorithm>
#include "Group.h"
Group::Group(int width) : width(width) {}
bool Group::addIndex(int group, int index) {
auto it = cellGroup.find(group);
if (it != cellGroup.end()) {
if (std::find(it->second.begin(),
it->... |
Markdown | UTF-8 | 20,688 | 3.25 | 3 | [] | no_license | 四七
瓦西里公爵不去周密地考虑自己的计划,他更少地想到谋求私利和作出危害他人的事。他不过是个上流社会人士,在上流社会中颇有造诣,并且习惯于借取这样的成就。他经常斟酌情形,在与人们建立密切关系时拟订出各种计划,提出自己的见解,他自己虽然不太了解,但是它们却已构成他的生活中的一种情趣。不是一两个,而是几十个这样的计划和设想常常付诸实施,其中有一些在他脑际开始浮现,另一些正在实行,还有一些要被废除。比如,他没有对自己说过这种话:“目前这个人有权有势,我应该获得他的信任,与他建立友谊关系,借助于他捞到一笔津贴;”或者说,他没有对自己说过这种话:“皮埃尔十分富有,我应该勾引他来娶我的幼女,借到我所需要的四万卢布”但他遇见这个... |
C++ | UTF-8 | 4,944 | 2.875 | 3 | [] | no_license | #include "algo/stepgen.hpp"
using namespace algo;
void stepgen::stepgen::speedup() {
uint32_t denom = 4 * _speed + 1;
_delay -= ((2 * _delay + denom / 2) / denom);
_speed++;
}
void stepgen::stepgen::slowdown() {
_speed--;
uint32_t denom = 4 * _speed - 1;
_delay += ((2 * _delay + denom / 2) / ... |
Markdown | UTF-8 | 2,497 | 2.921875 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | ---
title: JS Bin for Collaborative JavaScript Debugging
date: '2008-10-06 14:54:51'
published: true
tags:
- code
- code
- javascript
- project
- web
modified: '2014-09-03 16:15:12'
---
# JS Bin for Collaborative JavaScript Debugging
The weekend before last (28-Sep 2008) I blitzed through an idea I had on th... |
Java | UTF-8 | 1,433 | 3.015625 | 3 | [] | no_license | /*
* This Java source file was generated by the Gradle 'init' task.
*/
package linter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
public class App {
public String getGreeting() {
retur... |
Python | UTF-8 | 416 | 3.25 | 3 | [
"MIT"
] | permissive | from constants import *
# creates laser class
class Laser(pygame.sprite.Sprite):
def __init__(self, x, y):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.Surface((5, 10))
self.image.fill(WHITE)
self.rect = self.image.get_rect()
self.rect.centerx = x
self.rec... |
C++ | UTF-8 | 1,740 | 3.46875 | 3 | [] | no_license | //***************************************************************
// File: StockBST.h
//
// Purpose: Header file for Stock Binary Search Tree
//
// BCS 370 - Data Structures Homework #5
//
// Written By: Michael Kruger
//
// Compiler: Visual C++ 2015\
//***************************************************************
#... |
C# | UTF-8 | 1,990 | 3.578125 | 4 | [] | no_license | using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CLOP_TEST
{
class MyDictionary : IEnumerable
{
// Не пригодилось
private List<DictionaryItem> Items = new List<DictionaryItem>();
pu... |
Markdown | UTF-8 | 3,259 | 4.125 | 4 | [] | no_license | ## 02条件语句和while循环
三目运算
```python
a = 6
#原判断语句
if a > 5:
print(True)
else:
print(False)
#三目运算
print(True if a >5 else False)
```
## 逻辑运算
1. 三种逻辑运算
与逻辑 and
两边为真则为真
或逻辑 or
一边为真则为真
非逻辑
not 逻辑值取反
优先级: not > and > or
2.逻辑短路
```python
# and 逻辑短路
a = 3 #没有对b赋值,但程序不会报错... |
Java | UTF-8 | 1,845 | 2.375 | 2 | [] | no_license | package com.developer.edu.app_arco.bd;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class DB_OpemHelper extends SQLiteOpenHelper {
private static final String nomeBD = "DB01";
private static final int versaoBD = 1;
... |
C# | UTF-8 | 1,464 | 3.59375 | 4 | [] | no_license | using System;
using System.Globalization;
namespace _05_ExercicioContaBanco
{
public class Conta
{
private int TaxaSaque = 5;
public int Numero { get; private set; }
public string Titular { get; set; }
public double Saldo { get; private set; }
public Conta() {}
... |
Python | UTF-8 | 3,995 | 3.71875 | 4 | [] | no_license | '''
Homework-2-CS515
author Zimu Jiao
'''
'''
Q1: dot(L,K): Return the sim of dot product of to list, if the length of two list are different, the result is option-
-al,
Assume the length are equal. And the output should be 0.0 when two list are empty
Example:... |
PHP | UTF-8 | 1,044 | 2.5625 | 3 | [] | no_license | <?php
namespace Nemundo\Content\App\Website\Content\Webpage;
use Nemundo\Content\App\Website\Data\Webpage\WebpageModel;
use Nemundo\Content\Form\AbstractContentForm;
use Nemundo\Package\Bootstrap\FormElement\BootstrapLargeTextBox;
use Nemundo\Package\Bootstrap\FormElement\BootstrapTextBox;
class WebpageContentForm e... |
C++ | UTF-8 | 2,017 | 2.796875 | 3 | [] | no_license | #include "ZMTY.h"
#include <stdio.h>
#include <math.h>
#define PI 3.14159265358979
void ZMTY::ZMTYInitial(int newW,int newH,int newn)
{
W=newW;
H=newH;
n=newn;
hfov=2*PI/n;
f=W/2/tan(hfov/2);
}
/////////////////////////////////////////////////
void ZMTY::ZMTYCaculate1(double newx,double newy)
{
x=newx,y=newy;
t... |
Markdown | UTF-8 | 1,369 | 2.8125 | 3 | [
"MIT",
"BSD-3-Clause",
"Apache-2.0"
] | permissive | ---
title: Screen tracking for analytics
---
import { FileTree } from '~/ui/components/FileTree';
Unlike React Navigation, Expo Router always has access to a URL. This means screen tracking is as easy as the web.
1. Create a higher-order component that observes the currently selected URL
2. Track the URL in your ana... |
Java | UTF-8 | 976 | 2.515625 | 3 | [] | no_license | /**
* Copyright © 2013/2014, Veljko Zivkovic
* All rights reserved.
*
* No portion of this file may be reproduced in any form, or by any means, without the prior written
* consent of the author.
*/
package com.tirion.db.sql.parser;
import java.io.File;
import junit.framework.TestCase;
import com.tirion.common.... |
Java | UTF-8 | 3,065 | 2.421875 | 2 | [] | no_license | /*******************************************************************************
* @author Reika Kalseki
*
* Copyright 2016
*
* All rights reserved.
* Distribution of the software in any form is only allowed with
* explicit, prior permission from the owner.
****************************************************... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.