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 | 499 | 1.84375 | 2 | [] | no_license | package com.epc.web.facade.terdering.answer.handle;
import lombok.Data;
/**
* <p>Description : 回复问题
* <p>Date : 2018-09-20 15:06
* <p>@Author : wjq
*/
@Data
public class HandleReplyQuestion {
/**
* 回答内容
*/
private String answer;
/**
* 问题ID
*/
private Long id;
/**
* 操作... |
Java | UTF-8 | 9,019 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | package qux.lang;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkElementIndex;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkPositionIndex;
import static java.util.Array... |
Java | UTF-8 | 680 | 3 | 3 | [] | no_license | package th.pocket.gems;
public class FindOverlap {
public static String findOverlap(String a, String b) {
int[] flag = new int['z'-'A'+1];
StringBuilder result = new StringBuilder();
for(int i = 0; i < a.length(); i++) {
flag[a.charAt(i) - 'A']++;
}
for(int i = 0; i < b.length(); i++) {
if(flag[b.... |
C++ | UTF-8 | 9,427 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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 applic... |
PHP | UTF-8 | 421 | 3 | 3 | [] | no_license | <?php
namespace mvc\db;
use \PDO;
/**
* 数据库基类
*/
class Db{
protected $_dbHandle;
public function connect($host, $user, $pass, $dbname){
try {
$dsn = sprintf("mysql:host=%s;dbname=%s;charset=utf8", $host, $dbname);
$this->_dbHandle = new PDO($dsn, $user, $pass, array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FE... |
Java | UTF-8 | 1,577 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | package kotlin.collections;
import java.util.RandomAccess;
import org.jetbrains.annotations.NotNull;
public final class ArraysKt___ArraysJvmKt$asList$5 extends AbstractList<Float> implements RandomAccess {
final /* synthetic */ float[] $this_asList;
ArraysKt___ArraysJvmKt$asList$5(float[] fArr) {
... |
Java | UTF-8 | 5,169 | 2.453125 | 2 | [] | no_license | package reagodjj.example.com.sqlitestudent;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.CursorAdapter;
import android.widge... |
Markdown | UTF-8 | 2,624 | 3.140625 | 3 | [
"MIT"
] | permissive | # Inline-Importer
[](https://inline-importer.readthedocs.io/en/latest/?badge=latest)
Inline-Importer is a library for python projects that uses the PEP 302 import protocol to inline libraries into a single-file script.
## ... |
C# | UTF-8 | 3,944 | 3.53125 | 4 | [
"MIT"
] | permissive | using System;
using System.Linq;
namespace _7._Knight_Game
{
class Program
{
static void Main(string[] args)
{
int dimensions = int.Parse(Console.ReadLine());
char[,] chessBoard = ReadMatrix(dimensions, dimensions);
int knightCount = 0;
int kill... |
SQL | UTF-8 | 947 | 3.828125 | 4 | [] | no_license | USE sakila;
select * from film;
## todos os filmes
select title, release_year, rating from film;
## filmes, ano de lançamento e também a classificação
select count(title) from film;
## quantos filmes
select distinct last_name from actor;
## sobrenomes listados e não repetidos
select count(distinct last_name) from acto... |
Python | UTF-8 | 2,086 | 2.828125 | 3 | [] | no_license | import praw
import requests
import getpass
import datetime
import sys
# you need to get your client key and client secret after registering for the reddit API
client_key = ''
client_secret = ''
# reddit credentials. getpass() allows password entry on the command line in unix-style: no visibility
username = ''
password... |
Java | UTF-8 | 2,125 | 3.578125 | 4 | [] | no_license | package archive.algorithms;
import archive.domain.ListNode;
public class LinkedList {
void insert(ListNode head, int d) {
while (head.next != null) {
head = head.next;
}
head.next = new ListNode(d);
}
void insert(ListNode head, int d, int k) {
for (int i = 0; ... |
C# | UTF-8 | 8,430 | 2.609375 | 3 | [
"MIT"
] | permissive | namespace AgileObjects.AgileMapper.UnitTests.SimpleTypeConversion
{
using System.Collections.Generic;
using Common;
using Common.TestClasses;
using TestClasses;
#if !NET35
using Xunit;
#else
using Fact = NUnit.Framework.TestAttribute;
[NUnit.Framework.TestFixture]
#endif
public class W... |
JavaScript | UTF-8 | 458 | 3.796875 | 4 | [] | no_license | var currentDate = new Date();
var currentHour = currentDate.getHours();
var greeting = "";
if (currentHour < 12)
{ // Before noon. Good morning
greeting = 'Good Morning';
}
else if ((currentHour >= 12) && (currentHour < 17)) // Good afternoon
{
greeting = 'Good Afternoon';
}
else if ((hrs >= 17) && (hrs <= 24)) ... |
JavaScript | UTF-8 | 4,991 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | $(document).ready(function() {
if ($("form[name=entryform]").length > 0)
{
$("form[name=entryform]").submit(specifyWhichButton);
$("input[name=whichbutton]").val("save");
}
if ($("form[name=commentform]").length > 0)
{
$("textarea[name=commentarea]","#commentbox").val(... |
C# | UTF-8 | 1,142 | 2.546875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace NovosAres.WebUserControl
{
/// <summary>
/// Classe do UserControl Descricao.
/// </summary>
public partial class wucDescricao : System.Web.U... |
Go | UTF-8 | 498 | 3.296875 | 3 | [] | no_license | package main
import (
"flag"
"fmt"
)
// flag包的基本使用
func main() {
// 定义几个变量用于接受命令行的参数值
var user string
var pwd string
var host string
var port int
flag.StringVar(&user, "u", "", "用户名,默认为空")
flag.StringVar(&pwd, "pwd", "", "密码")
flag.StringVar(&host, "h", "localhost", "host")
flag.IntVar(&port, "p", 0, "po... |
C++ | UTF-8 | 744 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
void swap(char*,char*);
int main(int argc, char const *argv[])
{
int t;
cin>>t;
while(t--)
{
char* str = new char[101]();
cin.clear();
cin>>str;
//cout<<str<<endl;
int length = strlen(str);
int i = length-1;
while... |
C | UTF-8 | 1,590 | 3.390625 | 3 | [] | no_license |
/**
File: mmstack.c
Enter a description for this file.
*/
#include <assert.h>
#include "mmstack.h"
#include <stdlib.h>
#include <stdio.h>
struct llnode
{
int item;
struct llnode *next;
int minc;
int maxc;
};
struct mmstack
{
int len ;
struct llnode *topnode;
};
MMStack create_MMStack(void)
{
... |
Python | UTF-8 | 6,630 | 3.15625 | 3 | [] | no_license | import logging
import pandas as pd
class create_db:
def __init__(self):
logging.basicConfig(level=logging.DEBUG, format='\n %(asctime)s - %(levelname)s - %(message)s)')
self.skip_check = "no"
# Lists
self.train_class = []
self.test_class = []
self.classifiers = []... |
C | UTF-8 | 3,657 | 2.9375 | 3 | [
"MIT"
] | permissive | #ifndef _RTC_H_
#define _RTC_H_
#include <pc.h>
#include <dos.h>
#include "utypes.h"
/** @defgroup RealTimeController RealTimeController
* @{
*
* Real Time Controller related functions
*/
/** Time structure. Atributes in plain decimal
*/
typedef struct {
Byte hour, ///< The hour of the day
min, ///< T... |
Python | UTF-8 | 855 | 3.125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import sqlite3
conn = sqlite3.connect('dados.db')
cursor = conn.cursor()
print("--------Apagar: Livros--------")
while True:
id = int(input("Id: "))
cursor.execute("select * from livros where id == ?", [id])
result = cursor.fetchone()
print(result)
while T... |
Python | UTF-8 | 890 | 2.90625 | 3 | [] | no_license | from pathlib import Path
from pylatex import Document, Figure
from pylatex.figure import SubFigure
class ExportPdf:
def __init__(self):
images = self.separate_by_image(list(map(lambda x: str(x), Path("Output").rglob("*.png"))))
doc = Document('Output')
for group in images:
with... |
C# | UTF-8 | 441 | 2.609375 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Lan_Tic_Tac_Toe.GameComponents
{
class Player
{
public enum PlayerTypes
{
Spectator,
PlayerX,
PlayerO,
}
public PlayerTypes CurrentPlayer... |
PHP | UTF-8 | 1,983 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php declare(strict_types = 1);
namespace PHPStan\Rules\Deprecations;
use PhpParser\Node;
use PhpParser\Node\Expr\ConstFetch;
use PHPStan\Analyser\Scope;
use PHPStan\Reflection\ReflectionProvider;
use PHPStan\Rules\Rule;
use function sprintf;
use const PHP_VERSION_ID;
/**
* @implements Rule<ConstFetch>
*/
class F... |
JavaScript | UTF-8 | 2,345 | 3.6875 | 4 | [] | no_license | $(document).ready(onReady);
const employees = [];
function onReady() {
console.log('page is READY');
$('.js-btn-submit').on('click', submitEmployee);
// adding event listener for delete
$('.js-employee-list').on('click', '.js-btn-delete', deleteEmployee);
}
function deleteEmployee() {
// find individual e... |
JavaScript | UTF-8 | 1,637 | 2.78125 | 3 | [] | no_license | const StockPrice = require("../models/StockPrice");
const fetch = require("isomorphic-unfetch");
function StockController() {
this.handleOneStock = async function(stock, like, ip) {
// console.log(stock, like);
const stockData = await StockPrice.findOne({
stock: stock.toUpperCase()
});
if (!s... |
Python | UTF-8 | 260 | 3.015625 | 3 | [] | no_license | import string
def sort(data):
let_map = dict((key, 0) for key in string.ascii_lowercase)
for c in data.lower():
if c in let_map:
let_map[c] += 1
res = ""
for key in let_map:
res += key*let_map[key]
return res
|
Python | UTF-8 | 547 | 2.71875 | 3 | [] | no_license | from model.Publicacion import Publicacion
class Revista(Publicacion):
def __init__(self,any,nro,referencia, titol):
Publicacion.__init__(self, referencia, titol)
self.any = any
self.nro = nro
def get_any(self):
return self.any
def set_any(self,any):
self.any = any
... |
Python | UTF-8 | 2,201 | 2.96875 | 3 | [] | no_license | #authored by kchadha 03/20/2014
#simple Python Bot meant for logging purposes.
import socket
import sys
import datetime
import time
server = "ircserver.ece.arizona.edu" #settings
channel = "#acl"
botnick = "bot"
irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #defines the socket
print "connecting to... |
C++ | UTF-8 | 1,853 | 2.734375 | 3 | [] | no_license | #include "screen.h"
#include "screena.h"
#include <map>
#include <iostream>
namespace romeo{
Tile::Tile(){
}
Tile::Tile(sf::Texture* tex,sf::Vector3i loca,int Tile_Width){
TileWidth = Tile_Width;
bool done = false;
while(!done){
hitbox.setSize(sf::Vector2f(Tile_Width,Tile_Width));
... |
Java | UTF-8 | 6,025 | 3.65625 | 4 | [] | no_license | package aufgabe_4;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
public class MyHashTable implements HashTable4Dict {
// repraesentiert die Hashtabelle; eine Liste repraesentiert einen Bucket
private List<Object>[] data = null;
// welches Verfahren soll zur Bestimmung des Bucket... |
PHP | UTF-8 | 531 | 2.875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace App\Http\Collections;
use Illuminate\Support\Collection;
class PositionCollection
{
/**
* Prepare a collection of positions.
*
* @param mixed $positions
*
* @return Collection
*/
public static function prepare($positions): Collection
{
$positionCollec... |
Java | UTF-8 | 47,513 | 1.507813 | 2 | [] | no_license | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.google.android.gms.maps.internal;
import android.location.Location;
import android.os.Bundle;
import android.os.IBinder;
import andr... |
PHP | UTF-8 | 1,142 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of the nodika project.
*
* (c) Florian Moser <git@famoser.ch>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Model\EventLineGeneration\Nodika;
class EventTypeConfiguration
{
/**
... |
Markdown | UTF-8 | 461 | 2.859375 | 3 | [
"MIT"
] | permissive | ---
title: Plugin structure
order: 50
---
Plugins can do two things:
- They can use hooks
- They can provide macros
Your plugin should export an object with the following structure:
```js
{
name: 'myPlugin',
version: '1.0.0',
hooks: {},
macros: {}
};
```
The `name` and `version` attributes are self-exp... |
C++ | UTF-8 | 5,927 | 3.046875 | 3 | [
"MIT"
] | permissive | #include "spaceInvaders.h"
extern byte lost[];
extern byte up[];
/**
* Generates a new invader at position x,y by allocating memory for a point
* structure, and then adding the pointer to this point struct ot the invaders
* list.
*
* @param x: The x coord
* @param y: The y coord
* @param ll: pointer to the lin... |
JavaScript | UTF-8 | 2,326 | 3.0625 | 3 | [] | no_license | const express = require("express");
const cors = require("cors");
const { v4: uuid, validate: isUuid } = require('uuid');
const app = express();
app.use(express.json());
app.use(cors());
const repositories = [];
app.get("/repositories", (request, response) => {
// TODO
return response.status(200).json(reposit... |
TypeScript | UTF-8 | 1,510 | 2.640625 | 3 | [] | no_license | /* eslint-disable no-unused-vars */
/* eslint-disable no-undef */
/* eslint-disable prettier/prettier */
import { Request, Response} from "express";
import { where } from "sequelize/dist";
import { UserModel } from "../database/models/UserModels";
class UserController{
async findAll(req: Request, res: Response){
... |
Java | UTF-8 | 1,810 | 2.390625 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2016 Althaf K Backer
*
* 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 applicable law or agreed... |
Java | UTF-8 | 1,441 | 1.632813 | 2 | [] | no_license | package tencent.im.cs.smart_device_proxy;
import com.tencent.mobileqq.hotpatch.NotVerifyClass;
import com.tencent.mobileqq.pb.ByteStringMicro;
import com.tencent.mobileqq.pb.MessageMicro;
import com.tencent.mobileqq.pb.MessageMicro.FieldMap;
import com.tencent.mobileqq.pb.PBBytesField;
import com.tencent.mobileqq.pb.P... |
JavaScript | UTF-8 | 2,249 | 2.75 | 3 | [] | no_license | makeHandleEvent = (client, clientManager, chatroomManager) => {
ensureExists = (getter, rejectionMessage) => {
return new Promise((resolve, reject) => {
const res = getter();
return res ? resolve(res) : reject(rejectionMessage);
})
}
ensureValidChatroom = (chatroomN... |
Ruby | UTF-8 | 1,581 | 2.765625 | 3 | [] | no_license | require 'nokogiri'
require 'open-uri'
require 'pry'
require 'csv'
require 'rest-client'
require "selenium-webdriver"
require 'watir'
# MAIN_PAGE = 'https://eth.2miners.com/en/miners'
# url = 'https://btg.2miners.com/api/miners'
# response = RestClient.get(url, headers={})
# miners = JSON.parse(response.body)['miners'... |
Java | UTF-8 | 2,604 | 1.570313 | 2 | [] | no_license | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.ebay.mobile.recents;
import android.text.TextUtils;
import com.ebay.nautilus.domain.EbaySite;
import com.ebay.nautilus.domain.data.P... |
Java | UTF-8 | 92 | 1.90625 | 2 | [] | no_license | package dao;
import model.Order;
public interface OrderDao {
Long save(Order order);
}
|
TypeScript | UTF-8 | 782 | 2.6875 | 3 | [] | no_license | import Vue from 'vue'
import Vuex from 'vuex'
import axios from 'axios'
Vue.use(Vuex)
interface RootState {
results: Array<any>;
total: number | null;
}
const store = {
state: {
results: [],
total: null
},
getters: {},
mutations: {
SET_RESULTS(state, { items, total }) {
state.results ... |
Python | UTF-8 | 814 | 2.625 | 3 | [
"MIT"
] | permissive | class Account:
def __init__(self, twitter_handle='', name='', bio='',
following=False, followers=False, total_tweets=0):
self.id = -1
self.bio = bio
self.name = name
self.twitter_handle = twitter_handle
self.followers = followers
self.fol... |
C++ | UTF-8 | 877 | 3 | 3 | [
"MIT"
] | permissive | #pragma once
#include "GameConst.h"
#include "Evaluator.h"
class GameState
{
public:
GameState(void);
GameState(const GameState& state);
~GameState(void);
const GameState& operator=(const GameState& state);
void SetCurrentPlayer(int player_id) { m_playerId = player_id; };
int GetCurrentPlaye... |
Java | UTF-8 | 1,737 | 2.5625 | 3 | [] | no_license | import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.text.*;
import java.util.*;
public class updateProductsDB extends HttpServlet implements Serializable{
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setCo... |
Java | UTF-8 | 2,239 | 2.453125 | 2 | [] | no_license | package com.spring.mybatis;
public class User {
/**
* This field was generated by MyBatis Generator. This field corresponds to the database column user.id
* @mbg.generated Fri Apr 21 12:30:52 CST 2017
*/
private Integer id;
/**
* This field was generated by MyBatis Generator. This field correspo... |
TypeScript | UTF-8 | 3,363 | 2.578125 | 3 | [
"MIT"
] | permissive | "use strict";
import {Logger} from "../../src/logger";
import {Severity} from "../../src/interfaces";
describe("Test logger", () => {
it("should log message with 'trace' severity", () => {
const logger = new Logger('app');
const sourceMessage = "some log message";
const destMessage = {
... |
Python | UTF-8 | 1,903 | 3.921875 | 4 | [] | no_license | # -*- coding: utf-8 -*-
#Forklarer programmet til brukeren:
print("Dette programmet kan regne ut en bestand av dyr etter et bestemt antall år, hvis du vet endringsprosenten og nåværende bestand")
endring = input("Synker eller vokser bestanden?") #Det første brukeren ser - bestemmer hvilken "if"
synker=["Synke... |
Java | UTF-8 | 1,074 | 2.28125 | 2 | [] | no_license | package com.ss.stg;
import com.ss.stg.R;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
public class TourViewWrapper {
private View view;
private String id;
private ImageView statusImageView;
private TextView nameTextView;
private TextView dateTextView;
public Tour... |
Java | UTF-8 | 857 | 2.515625 | 3 | [] | no_license | private void run(final String prefix, final MessageDigest messageDigest) throws IOException {
if (inputs == null) {
println(prefix, DigestUtils.digest(messageDigest, System.in));
return;
}
for(final String source : inputs) {
final File file = new File(source);
if (file.isFile... |
Python | UTF-8 | 216 | 2.5625 | 3 | [] | no_license | import pandas as pd
import numpy as np
own = pd.read_csv('sub_cat_5.csv')
best = pd.read_csv('sub_gbm_4.csv')
alpha = 0.1
new = own*(1-alpha) + best*alpha
new.to_csv('stack_3.csv', index=False)
print(new.head())
|
JavaScript | UTF-8 | 4,144 | 2.984375 | 3 | [] | no_license | /*
jWidget Lib source file.
Copyright (C) 2015 Egor Nepomnyaschih
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later versi... |
Markdown | UTF-8 | 6,183 | 2.828125 | 3 | [] | no_license | ---
id: overrides
title: Overrides
sidebar_label: Overrides
---
When making a custom contract type, ideally you want to reuse as much logic as possible between the maps your custom contract type is used on. All common logic to build and power your custom contract type is in the `common.jsonc` file. See [Structure](../... |
PHP | UTF-8 | 2,339 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Service\Master;
use DB;
use Auth;
use Illuminate\Validation\Rule;
use App\Repository\Master\Sasaran;
class SasaranService
{
public static function get_validation($id = 0)
{
$rules = [
'id_program_kerja' => ['required']
];
if ($id == 0) {
$rules = array_merge(
... |
C++ | UTF-8 | 1,155 | 2.515625 | 3 | [] | no_license | #include<stdio.h>
#include<queue>
#include<memory.h>
using namespace std;
int dx[4] = { 0, 0, 1, -1 };
int dy[4] = { 1, -1, 0, 0 };
char map[55][55] = {};
int chk[55][55] = {};
int l, w;
queue<int>qx;
queue<int>qy;
int qstart(int x, int y) {
memset(chk, 40, sizeof(chk));
chk[x][y] = 0;
qx.push(x); qy.push(y);
whi... |
Java | UTF-8 | 2,310 | 2.78125 | 3 | [] | no_license | package com.angelo.androidprova.core;
import java.io.Serializable;
import android.util.Log;
class CPPMnode implements Serializable {
public CPPMnode child;
public CPPMnode next;
public CPPMnode vine;
public short count;
public int symbol;
public int id;
static int CPPMNOdeCount = 0;
/*
* CSFS: Found ... |
C++ | UTF-8 | 405 | 2.53125 | 3 | [] | no_license | #pragma once
#include "IWriter.h"
#include <string>
class MediaPlayer {
public:
MediaPlayer();
~MediaPlayer();
void setTitle(const std::string&);
std::string getTitle();
void setDuration(const double&);
double getDuration();
virtual void WriteTo(IWriter* w... |
Python | UTF-8 | 1,340 | 2.984375 | 3 | [
"MIT"
] | permissive | from typing import List
from matplotlib import pyplot as plt
FILE_NAME = 'cwnd_data.log'
with open(FILE_NAME, 'r') as f_in:
data: List[str] = f_in.readlines()
data: List[str] = [x.strip(' \n') for x in data]
initial_time = float(data[0].split(' ')[1])
data_time, data_cwnd, data_ssthresh = [], [], []
for lin... |
Java | UTF-8 | 2,618 | 2.578125 | 3 | [] | no_license | package com.yc.myTomcat;
import com.yc.javax.servlet.Servlet;
import com.yc.javax.servlet.http.HttpServlet;
import com.yc.javax.servlet.http.HttpServletRequest;
import com.yc.javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Map;... |
Python | UTF-8 | 1,923 | 2.53125 | 3 | [] | no_license |
__author__ = 'reiner'
import matplotlib.pyplot as plt
import numpy as np
import sequence_generation as sg
import ex3delitel as ex3
def mntkrleq():
#в предположении,что имеет смысл держать центр эллипса совмещённым с центром прямоугольника
global funcstrdict
global spreadvarslist, V
ksu2=0.955
... |
C++ | UTF-8 | 919 | 2.671875 | 3 | [] | no_license | #include "serialport.h"
#include <QIODevice>
SerialPort::SerialPort(QObject *parent) : BaseParent(parent)
{
serial = new QSerialPort(this);
connect(serial,&QSerialPort::readyRead,this,&SerialPort::handleReadyRead);
}
bool SerialPort::Open(Para *para)
{
if(serial->isOpen())
serial->close();
ser... |
C++ | UTF-8 | 3,957 | 3.609375 | 4 | [
"Apache-2.0"
] | permissive | #include<iostream>
#include<string>
#include<cctype>
using namespace std;
int Length(const string& str) {
int i =0;
for(i; str[i] != '\0'; i++) {}
return i;
}
void ToggleCaser(string& str) {
for(int i = 0; i < str.length(); i++) {
if(str[i] >= 65 && str[i] <= 90) {
str[i] = str[i] ... |
Rust | UTF-8 | 2,027 | 3.0625 | 3 | [] | no_license | use super::ray::Ray;
use super::vec::Vec3;
extern crate rand;
use rand::Rng;
pub fn drand48() -> f32 {
let random_float: f32 = rand::thread_rng().gen();
random_float
}
pub struct Camera {
origin: Vec3,
lower_left_corner: Vec3,
vertical: Vec3,
horizontal: Vec3,
u: Vec3,
v: Vec3,
w:... |
Markdown | UTF-8 | 4,781 | 2.9375 | 3 | [
"MIT"
] | permissive | # tko-subs
This tool allows:
* To check whether a subdomain can be taken over because it has:
* a dangling CNAME pointing to a CMS provider (Heroku, Github, Shopify, Amazon S3, Amazon CloudFront, etc.) that can be taken over.
* a dangling CNAME pointing to a non-existent domain name
* one or more wrong/typoed NS re... |
C++ | UTF-8 | 669 | 3.546875 | 4 | [] | no_license | #include <iostream>
#include <math.h>
using namespace std;
//71. Починаючи з деякого моменту часу пройшло k повних секунд. Визначити, скільки пройшло повних діб, годин, хвилин та секунд..
int main() {
int ksec;
cout << "Enter count of seconds: ";
cin >> ksec;
int sut = ksec / 86400;
int chas = (ksec % 86400... |
Markdown | UTF-8 | 1,106 | 2.59375 | 3 | [] | no_license | # README
## Thriftie ##
Thriftie is a Ruby on Rails application, the goal of which is to enable users the
ability to set and track financial goals. By its completion Thriftie should be able to
account for deposits and withdrawals, and report various details about a user's financial
plan (percentage complete, time to... |
Python | UTF-8 | 8,026 | 3.046875 | 3 | [] | no_license | import struct
import sys
from functions import call_function
SHOW_MESSAGES = False
def debug(msg):
if SHOW_MESSAGES:
print msg
class VirtualMachine:
def __init__(self, input_file):
with open(input_file, 'rb') as file:
self.memory = file.read()
self.cached_memory = {}
... |
Java | UTF-8 | 1,988 | 3.328125 | 3 | [] | no_license | package question113;
import java.util.ArrayList;
import java.util.List;
/**
* Created by duncan on 17-11-21.
*/
class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int x) { val = x; }
}
//判断路径上数之和,输出路径
public class Solution {
public void pathSum(TreeNode root, int sum, List<L... |
Markdown | UTF-8 | 5,674 | 2.78125 | 3 | [] | no_license | # Notes from conversation with Paul
more leaves fold better
what features might be breaking levinthal's?
the landscape must be funneled in order for these to fold
how can we make these landscapes funnel better
paul actually went to wales' group to make disconnectivity graphs
wales code is really unwieldy-- would... |
PHP | UTF-8 | 1,934 | 2.640625 | 3 | [
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-other-copyleft",
"GPL-2.0-or-later",
"LicenseRef-scancode-unknown-license-reference",
"GPL-2.0-only",
"Apache-2.0",
"MIT"
] | permissive | <?php
/**
* @file
* OG example selection handler.
*/
class OgExampleSelectionHandler extends OgSelectionHandler {
/**
* Overrides OgSelectionHandler::getInstance().
*/
public static function getInstance($field, $instance = NULL, $entity_type = NULL, $entity = NULL) {
return new OgExampleSelectionHa... |
Markdown | UTF-8 | 1,108 | 3.109375 | 3 | [] | no_license | # PEC 2
## Ejercicio 2
### a. Observad que se han creado funciones handle en el fichero controlador (todo.controller.js), las cuales son pasadas como parámetro. Esto es debido al problema con el cambio de contexto (this) que existe en JavaScript. Ahora mismo si no tienes muy claro que está sucediendo, revisa qué hacen ... |
C# | UTF-8 | 582 | 3.453125 | 3 | [] | no_license | using System;
namespace lab9
{
class Program
{
static void Main(string[] args)
{
string letters;
Console.WriteLine("Enter letters");
letters = Console.ReadLine();
ReconstructingArray(letters);
}
static string ReconstructingA... |
C | UTF-8 | 1,224 | 3.1875 | 3 | [] | no_license | /*
* datagramUnixClient.c
*/
// This program connects to a datagram UNIX domain socket
#include <sys/socket.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/un.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
char *socketPath = "named";
// create the socket
int ... |
Markdown | UTF-8 | 2,316 | 2.59375 | 3 | [] | no_license | ## Structure
In this folder we keep multiple different models that we use for prototyping and classification. All models inherit from a base model that provides the interface for training, evaluation and prediction.
```
.
├── checkpoints/ # artifactories from training
├── base_model.py ... |
Python | UTF-8 | 356 | 3.109375 | 3 | [] | no_license | from PIL import Image
import numba
left = int(input('pixels from left: '))
upper = int(input('pixels from upper: '))
right = int(input('pixels from right: '))
lower = int(input('pixels from down: '))
img_path = str(input('input path to the image: '))
open_img = Image.open(img_path)
crop_image = open_img.crop((left,u... |
Python | UTF-8 | 526 | 3.171875 | 3 | [] | no_license | import main
def test_add():
assert main.add(3, 4) == 7
assert main.add(3.5, 4) == 7
assert main.add(3.9, 4) == 7
assert main.add(3.9, 4.1) == 8
# def test_to_sentence():
# assert main.to_sentence('apple') == 'Apple.'
# assert main.to_sentence('Apple trees') == 'Apple trees.'
# assert mai... |
Python | UTF-8 | 3,485 | 3.015625 | 3 | [] | no_license | import numpy as np
rng = np.random
def clean_data(X, Y, flag=0):
# convert party names into one-hot vectors
one_hot_party = np.zeros((X.shape[0], 5))
for idx, party in enumerate(X[:, 0]):
if party == 'Centaur':
one_hot_party[idx, :] = [1, 0, 0, 0, 0]
elif party == 'Odyssey':
one_hot_party[idx, :] = [0, ... |
JavaScript | UTF-8 | 1,410 | 2.921875 | 3 | [] | no_license |
const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Body = Matter.Body;
const Constraint= Matter.Constraint;
var bobObject1, bobObject2, bobObject3, bobObject4, bobObject5;
var roof1;
var rope1, rope2, rope3, rope4, rope5;
function preload()
{
}
function setup() {
create... |
C# | UTF-8 | 2,673 | 3.078125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;
using Xunit;
namespace TDDKatas
{
public class WebshopTests
{
//[Theory]
//[InlineData("Laptop", 5.33, "Laptop 5,33")]
//[InlineData("Book", 100.55, "Book 100,55")]
//... |
C++ | UTF-8 | 5,142 | 2.875 | 3 | [] | no_license | #include "CommandManager.h"
#include "PlayerManager.h"
#include "GameManager.h"
#include "IInteractable.h"
#include "AnalyticsManager.h"
#include <iostream>
#include <sstream>
#include <vector>
#include <cctype>
void CommandManager::initialize()
{
if (!mInitialzed)
{
mSingleCommands.emplace("HELP", &CommandManager:... |
Markdown | UTF-8 | 1,810 | 4.40625 | 4 | [
"Apache-2.0"
] | permissive | Tutorial
--------
For loops in C are straightforward. They supply the ability to create a loop - a code block that runs multiple times.
For loops require an iterator variable, usually notated as `i`.
For loops give the following functionality:
* Initialize the iterator variable using an initial value
* Che... |
C | UTF-8 | 317 | 3.703125 | 4 | [] | no_license | #include <stdio.h>
int main (){
int n, i;
int soma = 0;
printf("\n\t Calculo dos n primeiros números naturais\n\n");
printf("Digite o valor de n: ");
scanf("%d",&n);
for (i = 0; i <= n; i++) {
soma = soma + i;
}
printf("Soma dos %d primeiros números naturais é %d \n\n", n, soma);
return 0;
} |
C++ | UTF-8 | 2,908 | 2.65625 | 3 | [] | no_license | #include <stdio.h>
#include <conio.h>
#include <math.h>
#include <allegro.h>
#include <list>
#include "Vec2f.hpp"
#include "Poly.hpp"
#include "DrawVec2f.hpp"
BITMAP* buffer;
#define PIXEL(bmp, x, y) ((long*)(bmp)->line[(y)])[(x)]
void init()
{
allegro_init();
install_mouse();
install_keyboard... |
JavaScript | UTF-8 | 801 | 2.515625 | 3 | [
"MIT"
] | permissive | /*
* pango-cairo.js
*/
const gi = require('../')
const Gtk = gi.require('Gtk', '3.0')
const Cairo = gi.require('cairo')
const Pango = gi.require('Pango')
const PangoCairo = gi.require('PangoCairo')
gi.startLoop()
Gtk.init()
const surface = new Cairo.ImageSurface(Cairo.Format.RGB24, 300, 300)
const cr = new Cairo.C... |
Java | UTF-8 | 905 | 2.421875 | 2 | [
"Apache-2.0"
] | permissive | package ch.hslu.swde.wda.service;
import ch.hslu.swde.wda.domain.City;
import ch.hslu.swde.wda.interfaces.CityService;
import ch.hslu.swde.wda.repository.CityRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import jav... |
Markdown | UTF-8 | 2,266 | 4.59375 | 5 | [] | no_license | # Java switch case 语句
switch case 语句判断一个变量与一系列值中某个值是否相等,每个值称为一个分支。
### 语法
switch case 语句语法格式如下:
```java
switch(expression){
case value :
//语句
break; //可选
case value :
//语句
break; //可选
//你可以有任意数量的case语句
default : //可选
//语句
}
```
switch cas... |
Python | UTF-8 | 51 | 2.90625 | 3 | [] | no_license | n = input("Enter number\n")
print('Hello',n)
|
Java | UTF-8 | 1,205 | 2.9375 | 3 | [
"Apache-2.0"
] | permissive | package platypus;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
import org.junit.Test;
public class DeloreanTest {
public interface Car {
String drive();
}
public interface Aircraft {
String fly();
}
public interface Delorean extend... |
Python | UTF-8 | 826 | 3.375 | 3 | [] | no_license | import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
dataset = pd.read_csv('mydata.csv')
x=dataset.iloc[:,:-1]
y=dataset.iloc[:,-1]
x_train,x_test,y_train,y_test=train_test_split(x,y,test_size=0.2,random_state=0)
re... |
Python | UTF-8 | 2,541 | 3.375 | 3 | [] | no_license | ''' Solves problem # 174 on https://projecteuler.net
Sergey Lisitsin. Mar 2020
'''
# def generate_squares(limit):
# squares = [ x**2 for x in range(1,limit+1)]
# return squares
#
#
# squares = generate_squares(100000)
# evens = [x for x in squares if not (x%2) ]
# odds = [x for x in squares if (x%... |
Shell | UTF-8 | 922 | 3.703125 | 4 | [] | no_license | #!/usr/bin/env bash
#
# Задать собственный поток ввода/вывода. У нас есть еще дескрипторы с 3 по 8 и мы можем задать их:
#
exec 3>>logfile
echo "This should be displayed on screen"
echo "This should be wrote in file" >&3
echo "And again this should be on screen"
#Перенаправить ввод в скрипте можно точно так же, как и ... |
TypeScript | UTF-8 | 1,322 | 2.75 | 3 | [] | no_license | import {
ADD_ACTORS,
ADD_ACTORS_REQUEST,
GET_ACTORS,
GET_ACTORS_REQUEST,
SEARCH_ACTORS,
ActorListActionTypes,
ACTOR_LOADING,
GET_ACTOR,
ActorItemActionTypes,
} from '../types/actorTypes';
export const actorListReducer = (
state = { actors: [] },
action: ActorListActionTypes
) => {
switch (action.type) {
... |
Python | UTF-8 | 440 | 3.484375 | 3 | [] | no_license | #!/usr/bin/python
# -*- coding:utf-8 -*-
#basic Judge sentences.
a =10
b=5
if a>0 and b >0 and a >b:
print "a is over b."
else:
print "a is below b."
#循环判断
alist = [34,56.32,455,"tets",'a']
for tt in alist:
print "get value is",tt
for index,value in enumerate(alist):
print "get i... |
Markdown | UTF-8 | 5,219 | 2.796875 | 3 | [] | no_license | # java-game-box-project-2-programandcontrolman
java-game-box-project-2-programandcontrolman created by GitHub Classroom
# Program & Control Man
Developed in house, Program & Control Man is a clone of the apple II game TaxMan developed by Hals Labs, which is a clone of the arcade game PacMan developed Bandai Namco.
##... |
C++ | UTF-8 | 1,203 | 2.875 | 3 | [] | no_license | #define accelerometerPinX A1 // x-axis of the accelerometer
float collisionThreshold = 1.35;
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// /////////////// //
// END GLOBAL ... |
Java | UTF-8 | 286 | 2.71875 | 3 | [] | no_license | package com.atn.kata.domain;
public enum GameStatus {
DEUCE("Deuce"),ADVANTAGE("Advantage"),WINNED("Winned"),START("Start");
private String value;
GameStatus(String value){
this.value=value;
}
public String getValue(){
return this.value;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.