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
C++
UTF-8
472
2.515625
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int maxCut(int n, int a, int b, int c, int memo[]) { if (n == 0) return 0; else if (n < 0) return -999999; else if (memo[n] != 0) return memo[n]; else memo[n] = 1 + (max(max(maxCut(n - a, a, b, c, memo), maxCut(n - b, a, b, c, memo)), maxCut(n - c, a, b, c, me...
Python
UTF-8
7,844
2.546875
3
[ "MIT" ]
permissive
import numpy as np import os import re import shutil import zipfile def extract_data(input_dir, output_dir): """ Extract zipfiles at input_dir into output_dir Code from https://github.com/NVIDIA/DIGITS/blob/master/examples/object-detection/prepare_kitti_data.py """ if os.path.isdir(o...
PHP
UTF-8
2,315
3.171875
3
[]
no_license
<?php /** * Created by PhpStorm. * User: Aliaksei Syrel * Date: 19.11.13 * Time: 18:18 */ require_once "Time.php"; class Interval { private $intervalID; private $timeFrom; private $timeTo; private $status; private $intervalDB; const INTERVAL_ID = "intervalID",TIME_FROM = "timeFrom", T...
Python
UTF-8
2,672
3.078125
3
[ "MIT" ]
permissive
""" Code taken from Hyperbolic Hierarchical Clustering (HypHC) by Chami et al. for more details visit https://github.com/HazyResearch/HypHC """ """Poincare utils functions.""" import torch from util.ml_and_math.math import arctanh, tanh MIN_NORM = 1e-15 BALL_EPS = {torch.float32: 4e-3, torch.float64: 1e-5} ...
C
UTF-8
985
3.40625
3
[]
no_license
#include "feedback.h" #include <stdio.h> void printTestString() { int x= testNumber(); int y = 15; printf("Test %d %d\n", x,y); } /* This formula comes formula (6.1) from my dissertation * pValue is the "a" value * iValue is the "b" value * currentError is the epsilon * totalError is the summation. * This ret...
Markdown
UTF-8
12,610
2.890625
3
[]
no_license
# Arbetsblad 3 !!! note "Viktigt" När **...** visas i programexemplen anger detta att det saknas kod som ni själva måste lägga till. Variabler och datastrukturer är bara exempel. Beroende på problemtyp kan man behöva andra datastrukturer än de som är beskrivna i kodexemplen. ## Allmänt I detta arbetsblad innehå...
Python
UTF-8
127
2.84375
3
[]
no_license
class Player: def __init__(self, playeer_id, x, y): self._id = playeer_id self.x = x self.y = y
Java
UTF-8
4,699
2.015625
2
[]
no_license
package Chat.MainComponent; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import org.zkoss.bind.BindUtils; import org.zkoss.bind.annotation.Init; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Desktop; import org.zkoss.zk.ui.Executions; import org.zkoss.zk.u...
Python
UTF-8
3,423
2.609375
3
[]
no_license
from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.chrome.options import Options from selenium.common.exceptions import NoSuchElementException import time class pytwitch: browser = None headless = False def __init__(self): browser_option...
Python
UTF-8
1,179
2.609375
3
[ "MIT" ]
permissive
import csv CorseOffSet = 0 def write_position(path, rec_time, w_loc, lat, lon, speed, course, aa, bb, x_acc, y_acc, z_acc): """ csvに測位結果を書き込みます. :param path: 書き込み先 :type path: str :param rec_time: 測位時刻 YYYYMMDD HH:mm:ss :type rec_time: str :param lat: 緯度 世界測地系 度数 :type lat: float :...
Markdown
UTF-8
1,445
2.828125
3
[]
no_license
--- layout: post title: 単項演算子の結合順序の意味について date: 2017-10-30 02:00:22 categories: c --- <p>四則演算の演算子や代入演算子など二項演算子については<br> 結合順序(左から右、右から左)が意味をなす場面が想像しやすいのですが、<br> 単項演算子の結合順序が意味をなす場面が想像しにくいです。</p> <p>どのような場合に意味があるのでしょうか?</p> <p>例えば、単項マイナスは</p> ``` -1-1 ``` <p>の場面に結合順序が意味をなしそうですが、<br> 実際には後者のマイナスは二項演算子のマイナスで、<br> 優先順位(単...
PHP
UTF-8
749
2.9375
3
[]
no_license
<?php declare(strict_types=1); namespace App\Command\DrawCommand; class DrawMacroCommand implements DrawCommand { /** * @var DrawCommand[] */ private $commands; public function __construct(DrawCommand...$commands) { $this->commands = $commands; } public function execute(): ...
Markdown
UTF-8
731
2.78125
3
[]
no_license
--- layout: module title: "More Practice: While Loops & If Statements" type: lecture draft: 0 points: 4 num: 9 description: - Practice using if / elif / else - Practice using while loops slides: - title: "Supplementary Slides for Live Lecture" url: https://docs.google.com/presentation/d/1Q25E7tk0wX5hFPdEHE...
Java
UTF-8
1,448
2.25
2
[]
no_license
package com.walgreens.batch.central.rowmapper; import java.sql.ResultSet; import java.sql.SQLException; import org.springframework.jdbc.core.RowMapper; import com.walgreens.batch.central.bean.CSVFileRoyaltyReportDataBean; public class RoyaltyReportRowmapper implements RowMapper<CSVFileRoyaltyReportDataBean> { @Ov...
C++
UTF-8
1,144
3.765625
4
[]
no_license
#include <iostream> using namespace std; class student { protected: int id; string name; public: student(int m, string n) { id = m; name = n; }; virtual void display(){}; }; class subject : public student { protected: string sub; public: subject(string s, int m, strin...
C#
UTF-8
1,906
2.578125
3
[]
no_license
using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; using WebStore.DAL.Context; using WebStore.Domain; using WebStore.Domain.DTO.Products; using WebStore.Domain.Entities; using WebStore.Interfaces.Services; using WebStore.Services.Mapping; namespace WebStore.Service...
Ruby
UTF-8
2,132
3.75
4
[]
no_license
#https://stackoverflow.com/questions/12966638/how-to-calculate-the-distance-between-two-gps-coordinates-without-using-google-m RAD_PER_DEG = Math::PI / 180 RM = 6371000 # Earth radius in meters #i got the distance between function from online, then i used that to make the algorithm acutally functional with location...
Java
UTF-8
15,432
2
2
[]
no_license
/* ------------------------------------------------------------------------- */ /* Copyright (C) 2012 Marius C. Silaghi Author: Marius Silaghi: msilaghi@fit.edu Florida Tech, Human Decision Support Systems Laboratory This program is free software; you can redistribute it and/or modify it under t...
Markdown
ISO-8859-1
726
2.796875
3
[]
no_license
###### SW'HAPPY SW'HAPPY est une application permettant de gagner des rductions en change de passer un peu de temps rpondre des questionnaire. Les entreprises s'enregistre et posent des questionnaires sur l'application web. Les utilisateurs tlcharge l'application SW'HAPPY. Ils arrivent directement sur la liste des ...
PHP
UTF-8
499
2.578125
3
[]
no_license
<?php namespace App\Responders; use Twig\Environment; use Symfony\Component\HttpFoundation\Response; class ResetPasswordRequestResponder { /** @var Twig */ private $twig; public function __construct(Environment $twig) { $this->twig = $twig; } public function response($form){ r...
C#
UTF-8
1,980
2.78125
3
[ "MIT" ]
permissive
using Mandarin.Common.Misc; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Color = Microsoft.Xna.Framework.Color; namespace Humper.Sample.Basic { public static class Debug { private static Texture2D _pixel; private static Texture2D GetPixel(this SpriteBatch sb) { if (_pixel...
C++
UTF-8
953
2.6875
3
[]
no_license
class Solution { public: vector<vector<string>> findDuplicate(vector<string>& paths) { vector<vector<string> > ans; unordered_map<string,vector<string> > mmap; //file content to file path map for(int i=0;i<paths.size();++i){ istringstream ss(paths[i]); string...
Java
UTF-8
862
3.390625
3
[ "MIT" ]
permissive
package jp.com.koto.sort; public class HowToUse { // HOT TO USE public static void main(String[] args) { // Give the specified array final int[] is = { 23, 9, 111, 28, 23, 22, 999, 1, 23, 66, 4, 5, 2, 22, 12, 3, 65, 91 }; EasySort specified = new EasySort(is); specified.bubble(...
Markdown
UTF-8
4,681
2.84375
3
[ "MIT" ]
permissive
# CarND-Controls-PID Self-Driving Car Engineer Nanodegree Program --- ## PID Tuning From [Wiki](https://en.wikipedia.org/wiki/PID_controller) Parameter|Rise time|Overshoot|Settling time|Steady-state error|Stability ---------|---------|---------|---------|---------|--------- K_p| Decrease |Increase| Small change| Decr...
PHP
UTF-8
1,174
2.84375
3
[ "Apache-2.0" ]
permissive
<?php function get_report_location($lat,$lng,&$placename) { $geoCodeURL = "http://nominatim.openstreetmap.org/reverse?format=xml&lat=".$lat."&lon=".$lng."&zoom=18&addressdetails=1"; $xml=@simplexml_load_file($geoCodeURL); foreach($xml->result[0]->attributes() as $a => $b) { if($a=="lat") { $lat_l...
JavaScript
UTF-8
3,114
2.84375
3
[]
no_license
'use strict'; window.pictures = (function () { var pictureTemplate = document.querySelector('#picture-template'); var picturesContainer = document.querySelector('.pictures'); var filters = document.querySelector('.filters'); var DATA_URL = 'https://intensive-javascript-server-pedmyactpq.now.sh/kekstagram/data'...
Java
UTF-8
277
1.835938
2
[]
no_license
package com.example.mapper; import com.example.pojo.HbFlight; import org.apache.ibatis.annotations.Mapper; import java.util.List; @Mapper public interface HbFlightMapper { /** * 查询航班信息列表 * @return */ List<HbFlight> findHbFlightList(); }
Java
UTF-8
1,047
3.203125
3
[]
no_license
package Atcoder.abc_past; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class C_064_ColorfulLeaderBoard { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int allnum = 0; Set<String> colorset = new HashSet<>(); for(int...
Python
UTF-8
4,499
2.78125
3
[ "MIT" ]
permissive
""" Acceptance test of searcing Brewery """ import unittest import hopsapp from bs4 import BeautifulSoup class TestAcceptBreweryProfile(unittest.TestCase): """ This class test all component of storeprofile when user search for beer """ def setUp(self): hopsapp.app.config['TESTING'] = True ...
Java
UTF-8
2,912
2.28125
2
[]
no_license
package superservice.steps; import io.qameta.allure.Step; import io.restassured.http.ContentType; import io.restassured.specification.RequestSpecification; import org.apache.http.HttpStatus; import superservice.EndPoints; import superservice.model.SaveDataRequest; import superservice.model.SaveDataResponse; public cl...
Markdown
UTF-8
1,917
2.984375
3
[]
no_license
# principle of Vuex vuex 核心其实就是总线型思想, 将组件的数据与状态集中起来, 方便管理与查看. 免去了兄弟组件之间的通信的层层传递, 也免去复杂组件间的复杂传递逻辑. 对于 Vuex 来说核心其实就是三个, state, actions, mutations. 其中 state 是存储数据的, 然后 actions 是用来处理异步操作的, 像 ajax 通常会放在这里, mutations 是用于同步操作的, 一般是用来改变 state 的状态的. 实际运用中 dispatch 是用来触发 actions 异步操作的, 然后 commit 是用来触发 mutations 同步操作的. vuex 在初始化...
SQL
UTF-8
2,423
4.28125
4
[]
no_license
-- Title: Keep Hydrated! -- Rank: 8 kyu -- Language Version: PostgreSQL 9.6 -- Instructions -- -- Nathan loves cycling. -- Because Nathan knows it is important to stay hydrated, he drinks 0.5 litres of water per hour of cycling. -- You get given the time in hours and you need to return the number of litres Nath...
Python
UTF-8
2,290
3.65625
4
[]
no_license
from course import Course from section import Section from itertools import product def generate_schedules(section_list): scheduleList = [] schedulePossible = True for schedule in product(*section_list): for sec in schedule: if not schedulePossible: break f...
PHP
UTF-8
3,026
3.140625
3
[]
no_license
<?php //author: Daniel Kasprowicz include_once '../includes/db_connect.php'; //if incorrect timezone is set in php.ini change the line date.timezone to "Europe/London" or use the command below //date_default_timezone_set("Europe/London"); //has to be run every time if timezone in php.ini is different if(!isset($_POST...
PHP
UTF-8
1,016
2.796875
3
[]
no_license
<?php if (isset($_POST["login"])) { $datenbank = mysqli_connect("localhost", "root", "", "rezepte"); mysqli_query($datenbank, "set names utf8"); // SQL-Injection verhindern $login = mysqli_real_escape_string($datenbank, $_POST["login"]); $passwort = mysqli_real_escape_string($datenbank, $_POST...
C#
UTF-8
2,823
3.015625
3
[]
no_license
using GSharp.Packager.Commons; using ICSharpCode.SharpZipLib.Core; using ICSharpCode.SharpZipLib.Zip; using System.IO; namespace GSharp.Packager.Utilities { static class CompressUtility { public static void Compress(ZipOutputStream zipStream, IPackageData data) { if (data is Packag...
Python
UTF-8
3,120
2.671875
3
[]
no_license
from ..items import * from ..str_filter import * from selenium import webdriver from selenium.webdriver.chrome.options import Options # 使用无头浏览器 #无头浏览器设置 chrome_options = Options() chrome_options.add_argument("--headless") chrome_options.add_argument("--disable-gpu") class Collection56(scrapy.Spider): name = "Coll...
JavaScript
UTF-8
5,720
2.65625
3
[]
no_license
import React, { useState } from 'react'; import { HashRouter, Route } from "react-router-dom"; import axios from 'axios'; import './App.css'; import SectionsItemList from './SectionsItemList'; import Navigation from './components/Nav'; import Pokemons from './views/Pokemons'; import Pokemon from './views/Pokemon'; impo...
Java
UTF-8
535
2.65625
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 Pawken; /** * * @author pawla */ public class TablicaFor { void petlaFor() { int[] tablicaFor = new ...
Python
UTF-8
4,345
3.125
3
[ "Apache-2.0", "BSD-3-Clause", "BSD-2-Clause" ]
permissive
#!/usr/bin/python2 import ConfigParser import pygame from shared import MAP_TILE_WIDTH, MAP_TILE_HEIGHT, MAP_CACHE class Level(object): """Load and store the map of the level, together with all the items.""" def __init__(self, filename="level.map"): self.tileset = '' self.map = [] se...
Java
UTF-8
6,150
2.265625
2
[]
no_license
package edu.stevens.cs522.databases; import edu.stevens.cs522.contracts.Contract; import edu.stevens.cs522.entities.ChatMessage; import edu.stevens.cs522.entities.Peer; import edu.stevens.cs522.providers.CloudProvider; import android.content.ContentValues; import android.content.Context; import android.database.Curso...
C
UTF-8
537
2.78125
3
[]
no_license
/* ** EPITECH PROJECT, 2021 ** B-NWP-400-STG-4-1-myftp-pierre.jeannin ** File description: ** get_ip_from_tab */ #include "ftp.h" char *get_ip_from_tab(char **tab) { char *str = malloc(sizeof(char) * (strlen(tab[0]) + strlen(tab[1]) + strlen(tab[2]) + strlen(tab[3]) + 5)); int i = 0; int j = 0; in...
Java
UTF-8
10,720
1.875
2
[ "Apache-2.0" ]
permissive
package org.infinispan.all.embedded; import static org.junit.Assert.assertEquals; import java.io.Serializable; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.Callable; import java.util.con...
Java
UTF-8
298
2.09375
2
[]
no_license
package aop_begin; public class MainProxy { public static void main(String[] args) { ExeTimeCalculator c1 = new ExeTimeCalculator(new ImpeCalculator()); System.out.println(c1.factorial(20)); c1 = new ExeTimeCalculator(new RecCalculator()); System.out.println(c1.factorial(20)); } }
Markdown
UTF-8
1,297
2.953125
3
[]
no_license
# Design Patterns in Ruby A collection of 10 of the GoF Design Patterns explained by examples found on different libraries and projects. These examples are meant to be representative of things that can be applied in the design of Ruby on Rails applications. ## What is a design pattern? *Is a general reusable soluti...
Markdown
UTF-8
1,473
2.6875
3
[]
no_license
# WirelessAPs WirelessAPs ## How to start applications ? 1. First of all, clone https://github.com/berkaykirmizioglu/WirelessAPs.git repository and follow the **README.md** commands. 2. Go into project directoy (WirelessAPs) 3. In terminal, just type in **order** ```` python3 server.py ```` This command will setup yo...
PHP
UTF-8
5,761
2.703125
3
[]
no_license
<?php namespace controller\backend; class ListCommentsController { protected $_session, $_commentsManager, $_user, $_pagination; public function __construct($session) { $this->_session = $session; $this->_commentsManager = new...
Java
UTF-8
1,090
1.742188
2
[]
no_license
/* * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by ap...
Java
UTF-8
233
2.296875
2
[]
no_license
package com.soyrobado.soyrobadoprd.OBJ; public final class CONSTANTES { public final String MAC =""; public String getMAC() { return MAC; } public void setMAC(String MAC) { MAC.concat(MAC); } }
Java
UTF-8
1,307
2.46875
2
[ "MIT" ]
permissive
package org.jeroen.ddd.specification; import java.util.Date; import java.util.GregorianCalendar; import org.jeroen.ddd.domain.Post; import org.jeroen.ddd.specification.basic.GreaterThanSpecification; import org.junit.Assert; import org.junit.Test; public class GreaterThanSpecificationTest { private final Date mi...
Java
UTF-8
670
2.359375
2
[ "MIT" ]
permissive
package com.suse.saltstack.netapi.client; import com.suse.saltstack.netapi.config.SaltStackClientConfig; import com.suse.saltstack.netapi.parser.SaltStackParser; /** * Describes an interface for creating instances of an HTTP connection implementation. */ public interface SaltStackConnectionFactory { /** * ...
Java
UTF-8
825
3.6875
4
[]
no_license
package alura.java.orientacao.objetos; public class Lesson implements Comparable<Lesson> { private final String name; private final Integer durationMinutes; public Lesson(String name, Integer durationMinutes) { if (name == null) { throw new NullPointerException("Name is required"); ...
Java
UTF-8
4,637
2.828125
3
[ "MIT" ]
permissive
package org.parchmentmc.compass.storage.input; import org.parchmentmc.feather.mapping.MappingDataBuilder; import java.io.IOException; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Reader for a simple and quickly editable input file format. * * @see <a href="https://g...
C++
UTF-8
2,011
2.796875
3
[ "MIT" ]
permissive
#pragma once #include <iostream> #ifdef GDT_NAMESPACE namespace GDT { #endif class Vector3f; class Vector4f { public: float x, y, z, w; Vector4f(); Vector4f(float x, float y, float z, float w); Vector4f(float xyz); Vector4f(float xyz, float w); Vector4...
PHP
UTF-8
5,948
2.578125
3
[]
no_license
<?php namespace Locale; class Base { private static $tree = array(); private static $cache = array(); public static function all() { $out = array(); $lang = \Locale\Config::get('default') ?: 'en'; $test = \Locale\Config::get('accept') ?: array('en'); $out[$lang] = 1; foreach ((array) ...
C#
UTF-8
2,755
2.609375
3
[]
no_license
using System; using System.Text; using System.IO; using Zeus; namespace Zeus.MicrosoftScript { /// <summary> /// Summary description for DotNetScriptEngine. /// </summary> public class MicrosoftScriptEngine : IZeusScriptingEngine { protected MicrosoftScriptCodeParser _microsoftScriptCodeParser = n...
C++
UTF-8
1,353
3.5625
4
[]
no_license
//reverse a dll #include<bits/stdc++.h> using namespace std; class Node { public: int data; Node* prev; Node *next; Node(){ prev= NULL; next=NULL; } }; class DLL{ Node *head; public: DLL(){ head= NULL; } No...
JavaScript
UTF-8
2,843
2.59375
3
[]
no_license
/** @jsx React.DOM */ /* show directly when only one candidate */ var titleList=Require("titlelist"); var titles=Require("titles"); var api=Require("api"); var inputs=Require("inputs"); var dataset=Require("dataset"); var authorList=React.createClass({ renderItem:function(author) { return <button data-author={au...
Python
UTF-8
20,959
3.078125
3
[]
no_license
"""Generates code for EmJetHistoMaker Conventions: user_XXX functions are used to define specfic instances of elements. generate_XXX functions are called from cog to generate code fragments. All other functions are used internally.""" standalone = False if __name__=='__main__': print "Running standalone mode - Pri...
Python
UTF-8
478
3.015625
3
[ "MIT" ]
permissive
class Solution: def isMonotonic(self, A): """ :type A: List[int] :rtype: bool """ inc = 0 for i in range(len(A) - 1): a, b = A[i], A[i + 1] if A[i] != A[i + 1]: if (inc == 1 and A[i + 1] < A[i]) or (inc == -1 an...
Markdown
UTF-8
2,373
2.734375
3
[]
no_license
# Task service ### Параметр запуска **-host** - адрес сервера и порт (стандартно ":8080") ## GET / Возвращается тестовая статическая страница ## POST /login Авторизация * **login** (string) - логин пользователя * **pass** (string) - пароль пользователя ## POST /password Смена пароля пользователя * ...
JavaScript
UTF-8
9,023
3.328125
3
[]
no_license
var canvas = document.getElementById("myCanvas"); var ctx = canvas.getContext("2d"); document.addEventListener("keydown", keyDownHandler, false); document.addEventListener("keyup", keyUpHandler, false); class Vector2d { constructor(x, y) { this.x = x; this.y = y; } } class Box { constructor(p...
C++
SHIFT_JIS
2,074
2.609375
3
[]
no_license
#pragma once #include "GraphicalObject.h" #include "TiledVector.h" #include "BattleParameter.h" #include "../Utility/PoolingSystem.h" #include "BattleParameter.h" class MapTile; class Character; class TiledObject : public GraphicalObject { public: TiledObject(TiledVector pos); virtual ~TiledObject(); ...
Java
UTF-8
1,971
2.421875
2
[ "Apache-2.0" ]
permissive
package spwrap.db; import spwrap.Caller; import spwrap.Caller.ParamType; import spwrap.Config; import spwrap.mappers.ResultSetMapper; import java.sql.CallableStatement; import java.sql.SQLException; import java.util.List; import static spwrap.Util.createCallableString; import static spwrap.Util.getParamsCount; /** ...
Java
UTF-8
13,329
3.46875
3
[]
no_license
//TRIAL FOR TRACKING EACH LOCATION'S VALUE // // // //values based on escape routes in each location, 2D array declared up above // // int locvalue[][] = new int[rows][columns]; // // //Initialize 2D array to all locations having 8 escape routes // for(int i=0; i < rows; i++) /...
Python
UTF-8
2,650
3.34375
3
[]
no_license
import math def rotate(obj,angle=[0,0,0]): return "rotate(["+str(angle[0])+","+str(angle[1])+","+str(angle[2])+"]) "+ obj def translate(obj, pos=[0,0,0]): return "translate(["+str(pos[0])+","+str(pos[1])+","+str(pos[2])+"]) "+obj def union(obj1,obj2): return """union() { """+obj1+obj2+"""} """ def diff...
Java
UTF-8
702
1.976563
2
[]
no_license
package br.ufes.inf.nemo.oled.ui.diagram.commands; import javax.swing.undo.AbstractUndoableEdit; import br.ufes.inf.nemo.oled.model.UmlProject; import br.ufes.inf.nemo.oled.util.Command; /** * Base class for all diagram commands * @author Antognoni Albuquerque * @version 1.0 */ public abstract class ...
Markdown
UTF-8
2,272
3.390625
3
[ "MIT" ]
permissive
# TD2 : Manipulation de structures complexes __But :__ Apprendre à manipuler les tableaux, les slices et les maps. __Difficulté :__ Intermédiaire __Connaissances à avoir :__ Structures, Tableaux, Slices, Maps, Méthodes, Pointeur. __Durée du TD :__ 1h30 - 1h45 ## Exercice 1 : Tableau, Slice et Tri 1. Créer une fo...
Java
UTF-8
1,356
2.203125
2
[]
no_license
import org.apache.storm.spout.SpoutOutputCollector; import org.apache.storm.task.TopologyContext; import org.apache.storm.topology.OutputFieldsDeclarer; import org.apache.storm.topology.base.BaseRichSpout; import org.apache.storm.tuple.Fields; import java.io.InputStream; import java.util.Collections; import java.util....
C++
UTF-8
10,474
3.34375
3
[]
no_license
#include "Database.h" Database::Database() { stree = new BST<Student>(); ftree = new BST<Faculty>(); } Database::~Database(){} Database::Database(BST<Student> &theStudDB, BST<Faculty> &theFacDB) { student_tree = &theStudDB; faculty_tree = &theFacDB; } //startProgram is used as an all in one function to reduce co...
C++
UTF-8
3,041
2.609375
3
[ "Apache-2.0" ]
permissive
/* * Copyright 2020 nPrint * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy * of the License at https://www.apache.org/licenses/LICENSE-2.0 */ #include <argp.h> #include <string> #include "dir.hpp" #include...
Shell
UTF-8
4,841
3.46875
3
[ "Apache-2.0" ]
permissive
#!/bin/bash # # Short: Common routines (shell) # Author: Mark J Swift # Version: 3.3.0 # Modified: 22-May-2022 # # This include defines some global variables and functions that are used in core scripts and utilities. # These variables and functions are not used the policy scripts, unless passed to the policy on t...
Python
UTF-8
4,707
3.34375
3
[ "Apache-2.0" ]
permissive
""" This module contains the definition of Preconditions which are related to attributes of a file or directory. """ from pathlib import Path from hammurabi.preconditions.base import Precondition class IsOwnedBy(Precondition): """ Check if the given file or directory has the required ownership. To chec...
Markdown
UTF-8
4,607
3.328125
3
[]
no_license
--- layout: post description: 别因为寂寞爱上网络上任何人 title: (转)别因寂寞爱上网络任何人 keywords: 寂寞 网络 爱上 真实 虚拟 category: diary --- 别因寂寞爱上谁,有时想想,寂寞真可怕。它会改变一个人的看法,它会去伤害很多人。网络等于寂寞?谁都无法找到答案。在网络中,我们可以随时的说出爱,说出感觉。网络爱情能维持多久?我曾经问过朋友,他给我的回答是那么的贴切。保质期最多三个月。因为过了三个月,如果还在一起,是因为彼此没找到更好的,所以无法离开。是因为彼此的习惯,习惯了彼此的陪伴,而不想再去寂寞的一个人生活。寂寞时的感情,只想要有人陪伴的感情,能...
Markdown
UTF-8
1,885
2.6875
3
[]
no_license
--- title: "Beam Katana Plus (Item) - Hyperdimension Neptunia Re;Birth1" --- [**Item Index**](/neptunia/rb1/item/index.html) - [Hyperdimension Neptunia Re;Birth1](/neptunia/rb1) ## Contents - [Basic information](#basic-information) - [Stats](#stats) - [Remake System plans which unlock **Beam Katana Plus** in shop](#...
PHP
UTF-8
232
3.671875
4
[]
no_license
<?php // function 能把 string 反轉 function str_reverse($str) { $str2 = ""; for ($i = strlen($str) - 1; $i >= 0; $i--) { //echo $str[$i]; $str2 .= $str[$i]; } echo $str2; } str_reverse("candy");
Java
UTF-8
3,242
2.890625
3
[]
no_license
package badcode; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; class RegisterBusinessFailTest { @Test @DisplayName("First name is null, it should be occur exception") public void case01() { RegisterBusiness register...
Java
UTF-8
174
2.03125
2
[]
no_license
package pl.edu.utp.po.services; import java.util.List; import pl.edu.utp.po.domain.Note; public interface NoteService { List<Note> listOfNotes(); void addNote(Note n); }
Java
UTF-8
2,089
2.578125
3
[]
no_license
package com.naikara_talk.logic; import java.sql.Connection; import org.apache.commons.lang3.StringUtils; import com.naikara_talk.dao.MessageMstDao; import com.naikara_talk.dto.MessageMstDto; import com.naikara_talk.exception.NaiException; import com.naikara_talk.util.NaikaraTalkConstants; /** * <b>システム...
JavaScript
UTF-8
3,745
3.90625
4
[]
no_license
// Iteration 1: All directors? - Get the array of all directors. function getAllDirectors(array) { return array.map(elm => elm.director) } // _Bonus_: It seems some of the directors had directed multiple movies so they will pop up multiple times in the array of directors. How could you "clean" a bit this array an...
Java
UTF-8
391
2.234375
2
[ "Apache-2.0" ]
permissive
package java.lang.invoke; public class MethodHandleProxies { public static <T> T asInterfaceInstance(Class<T> intfc, MethodHandle target) { return null; } public static boolean isWrapperInstance(Object x) { return false; } public static MethodHandle wrapperInstanceTarget(Object x) { return null; } publ...
PHP
UTF-8
4,786
2.5625
3
[]
no_license
<?php $servername = "localhost"; $dbUsername = "root"; $dbPassword = ""; $dbName = "parkathome_mobile"; // Cria a ligação à BD $conn = mysqli_connect($servername, $dbUsername, $dbPassword, $dbName); // Verifica se a ligação falhou (ou teve sucesso) if (!$conn) { die("Connection failed: " . mysqli_connect_error());...
Java
UTF-8
549
2.03125
2
[]
no_license
package com.moneyxx; import com.moneyxx.R; import android.os.Bundle; import android.app.Activity; import android.view.Menu; public class JackpotFormActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_ja...
Python
UTF-8
540
3.359375
3
[]
no_license
# my own class window from tkinter import * from tkinter import messagebox class Zealous(Tk): def __init__(self): Tk.__init__(self) self.title("MyOwnWindow") self.geometry("500x300") self.textbox=Entry(self,width=10,fg="blue",bg="red") self.textbox.pack(padx=0,pady=0,side=...
Java
UTF-8
5,122
2.09375
2
[]
no_license
package com.ljt.photocachedemo; import android.app.Activity; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.view.ViewTreeObserver; import android.widget.AbsListView; import android.widget.GridView; import android.widget.ListV...
Java
ISO-8859-1
5,338
2.328125
2
[]
no_license
package com.example.cylinderareacalc; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.widget.Butto...
C++
UTF-8
576
3.4375
3
[]
no_license
#include <stdio.h> #include <stdio.h> int main() { int array[7]; int max,min,i; printf("Enter the elements in the array:\n"); for(i=0;i<7;i++){ scanf("%d",&array[i]); } max=array[0]; min=array[0]; for(i=0;i<7;i++){ if(array[i]>=max){ max=array[...
C++
GB18030
1,624
3.234375
3
[]
no_license
#include<iostream> #include <string> using namespace std; class box // { public: class wrong { public: virtual void show() { cout << "wrong" << endl; } }; class big:public wrong { public: void show() { cout << "big wrong" << endl; } }; class small :public wrong { public: void show() ...
Swift
UTF-8
4,602
3.34375
3
[]
no_license
// // ContentView.swift // Memorize // // Created by 黄紫君 on 30/11/2020. // Copyright © 2020 CS193p intro. All rights reserved. // import SwiftUI // ALL UI stuff is in SwiftUI // struct has var, fun // constrain and gains :e.g. view struct EmojiMemoryGameView: View { @ObservedObject var viewModel: EmojiMemor...
Python
UTF-8
3,695
2.703125
3
[]
no_license
from typing import List from collections import Counter from utils.text_preprocessing import preprocess, categorize from parsers.report import Report class DatasetStat: def __init__(self): self.size = 0 self.words_frequency = Counter() self.words_frequency_by_label = {} self.tag_f...
Java
UTF-8
827
2.03125
2
[]
no_license
package com.rxjy.rxcompound.mvp.model; import com.rxjy.rxcompound.api.ApiEngine; import com.rxjy.rxcompound.mvp.contract.MessageTwoContract; import com.rxjy.rxcompound.rx.RxSchedulers; import rx.Observable; /** * Created by hjh on 2018/3/9. */ public class MessageTwoModel implements MessageTwoContract.Model{ ...
C++
UTF-8
2,183
2.84375
3
[]
no_license
#include "Rules.h" #include "SDL.h" #include "GlobalVariables.h" #include "SDL_ttf.h" #include <string> void Rules::renderText(const char *text, SDL_Color color, int xStart, int yStart, TTF_Font *font) { int width = SCREEN_WIDTH, height = SCREEN_HEIGHT; SDL_Surface *surfaceGroup =TTF_RenderUTF8_Blended(font, t...
C++
UTF-8
170
2.515625
3
[]
no_license
#include <stdio.h> #define PI 3.1415927 int main() { double n; while(scanf("%lf", &n) != EOF) printf("%.3lf\n", 4.0 / 3 * PI * n * n * n); return 0; }
Markdown
UTF-8
1,996
2.921875
3
[ "MIT" ]
permissive
--- ID: 1618 post_title: Stuck on a hard programming task? author: Shwuzzle post_date: 2011-04-27 09:25:36 post_excerpt: "" layout: post published: true aktt_notify_twitter: - 'yes' ratings_users: - "0" ratings_score: - "0" ratings_average: - "0" aktt_tweeted: - "1" --- Are you occasionally stuck on a really ...
C#
UTF-8
1,125
3.09375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Chess { class Pawn : Piece { public Pawn(string Position, int owner, int MoveCount) : base(Position, owner, MoveCount) { } public override string[] Mo...
PHP
UTF-8
1,745
2.8125
3
[]
no_license
<?php namespace App\Models; use Core\Validator; class User extends AppModel { use Validator; public $validationRules = [ 'username' => [ ['ruleName' => 'required'], ['ruleName' => 'isString'] ], 'password' => [ ['ruleName' => 'required'], ...
C
UTF-8
3,612
2.671875
3
[]
no_license
#include "common_impl.h" #include <sys/socket.h> #include <arpa/inet.h> #include <netinet/in.h> #include <poll.h> int creer_socket(u_short *port) { int sock = 0; int yes=1; struct sockaddr_in serveur_addr; int size_len = sizeof(struct sockaddr_in); // creation de la socket sock =socket(PF_INET,SOCK_STREA...
Markdown
UTF-8
3,236
3.0625
3
[]
no_license
--- title: "Follow my Journey" subtitle: "I need to change" author: "eatmeatandhodl" avatar: "img/authors/profile_pic.jpg" layout: default --- <!-- <h2 class="pageTitle">{{ page.title }}</h2> --> <h2 class="pageTitle">I'm done with diets</h2> <div class="post"> <p>Have you ever started a diet and failed? Have you...
C
UTF-8
666
3.109375
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> int main(int argc, const char *argv[]) { FILE *fp; char ch; #if 0 char filename[100] ; int i = 3; while(1) { sprintf(filename, "file%d", i); fp = fopen(filename, "w"); if (fp == NULL) { printf("fopen fail\n"); exit(-1); }...
Java
UTF-8
170
2.140625
2
[]
no_license
package sam02; public class MessagebeansKo implements MessageBean { public void sayHello(String name) { System.out.println(name+"! 안녕하세요"); } }