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
458
1.96875
2
[]
no_license
package com.revature.data; import java.util.List; import java.util.UUID; import com.revature.beans.Form; import com.revature.beans.Inbox; import com.revature.beans.User; public interface UserDAO { void addUser(User user); List<User> getUsers(); User getUser(String username); void updateUser(User user); ...
Go
UTF-8
1,460
2.953125
3
[]
no_license
package core import ( "fmt" "github.com/domac/kapok/util" "time" ) type Stats struct { Url string RespSize int64 Duration time.Duration MinRequestTime time.Duration MaxRequestTime time.Duration NumRequests int NumErrs int Num5X int Num2X int } //输出统计信息 f...
Python
UTF-8
178
2.609375
3
[]
no_license
file = open('big1.txt', 'w') file1=open('aniketsh_input.txt', 'r') data = file1.readlines() for i in range(2000): file.write(str(data)) file1.close() file.close()
Markdown
UTF-8
7,150
3.109375
3
[]
no_license
# Operating Systems and Networks Assignment 3 ## `CASH`: Cliché Average SHell ### Build and Run: The file already contains the precompiled files and you can launch the shell just by running `./cash`. If however, you wish to recompile the shell, run the following commands ```bash make clean make ./cash ``` `make clean`...
Markdown
UTF-8
3,961
2.546875
3
[]
no_license
--- description: How to fetch a collection of shipping methods via API --- # List all shipping methods To fetch a collection of shipping methods, send a `GET` request to the `/api/shipping_methods` endpoint. {% page-ref page="../../fetching-resources.md" %} ## Request **GET** https://<i></i>yourdomain.commercelaye...
JavaScript
UTF-8
292
3.640625
4
[]
no_license
var myString = "I yam what I yam and always will be what I yam"; splitString = myString.split(" "); console.log(splitString) var yam = {}; splitString.forEach(function(word) { if (word in yam) { yam[word] += 1; } else { yam[word] = 1 } } ) console.log(yam)
C++
UTF-8
1,163
3.6875
4
[]
no_license
#include <iostream> #include <climits> using namespace std; /** * 输出四种整形的最大值,最小值,和对应类型占据内存大小 */ void number_max_min_byte(){ short n_short_max = SHRT_MAX; int n_int_max = INT_MAX; long n_long_max = LONG_MAX; long long n_llong_max = LLONG_MAX; cout<<"short byte:"<< sizeof n_short_max<< " short max:...
Python
UTF-8
1,363
3
3
[]
no_license
import numpy as np import matplotlib.pyplot as plt #均匀分割二阶插值方法,num是间隔数,f是源 def FinE(min,max,f,num): t=np.linspace(0,max-min,num+1);n=len(t) h=t[1]-t[0] u=np.zeros(n) x=np.zeros(n) b=np.zeros(n) a=np.zeros(n) if n - 1 > 0: c = np.zeros(n - 1); c[1] = -1/2 else...
PHP
UTF-8
343
2.734375
3
[]
no_license
<?php namespace Erik\Sample\Supplier\Client; class BarRestClient { /** * @param string $string * @param array $toArray * @return int */ public function call(string $string, array $toArray): int { // do things. // validate response // return order number ...
C#
UTF-8
882
3.453125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static void Main() { string text = Console.ReadLine(); int start = text.IndexOf("<upcase>"); int end = text.IndexOf("</upcase>") + 9; while (star...
Python
UTF-8
2,520
3
3
[]
no_license
from PS6.load_names import all_categories, category_lines, n_letters, n_categories from PS6.char_to_tensor import lineToTensor from PS6.rnn import RNN import math import random import time import torch import torch.nn as nn n_hidden = 128 rnn = RNN(n_letters, n_hidden, n_categories) criterion = nn.NLLLoss()...
TypeScript
UTF-8
1,918
2.765625
3
[]
no_license
import { Either, Err, Ok } from '../src/either'; import { Interpreter, IOHandle, LangError } from '../src/lang/interpreter'; import * as rt from '../src/lang/runtime'; import * as ast from '../src/lang/ast'; import Big from 'big.js'; import { assert } from 'chai'; import { inspect } from 'util'; import { pureIOHandle, ...
Java
UTF-8
11,100
2.84375
3
[]
no_license
package work.leetcode;/* * Author: park.yq@alibaba-inc.com * Date: 2019/1/21 下午3:44 */ import com.google.common.collect.Maps; import org.apache.flink.shaded.guava18.com.google.common.collect.Queues; import work.common.Node; import work.common.Tree; import java.util.ArrayDeque; import java.util.Arrays; import java....
C++
WINDOWS-1251
632
2.953125
3
[]
no_license
#include <iostream> #include "Vector.h" using namespace std; int main() { setlocale(LC_ALL, "Russian"); Vector a(5),b(10),c(10); cout << a << endl; cin >> a; cout <<" - " << a << endl; a[2] = 228; cout << a << endl; cout << "Vector b - " << b << endl; cout << "Vector b=a - " << (b=a) << end...
SQL
GB18030
590
2.703125
3
[]
no_license
delete from HtmlLabelIndex where id=126572 / delete from HtmlLabelInfo where indexid=126572 / INSERT INTO HtmlLabelIndex values(126572,'Ȩ޲鿴, ѱǿջػɾ') / INSERT INTO HtmlLabelInfo VALUES(126572,'Ȩ޲鿴, ѱǿջػɾ',7) / INSERT INTO HtmlLabelInfo VALUES(126572,'You do not have permission to view this workflow, it may have been...
Python
UTF-8
226
2.9375
3
[]
no_license
#!/usr/bin/env python for i in [1,2,3,4,5,6]: print i, print "" for i in (1,2,3,4,5,6,7): print i, print "" for i in {1,2,3,4,5,6,7}: print i, print "" for i in {'a':1,'b':2,'c':3,'m':4}: print i, print ""
Java
UTF-8
793
1.914063
2
[]
no_license
package com.test.task; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.se...
JavaScript
UTF-8
3,937
2.953125
3
[ "ISC" ]
permissive
'use strict'; var Readable = require('stream').Readable; var util = require('util'); function AssimilationState(stream) { this.source = null; this.waiting = false; this.encoding = stream._readableState.encoding; } function extractThenMethod(x) { if (!x || typeof x !== 'object' && typeof x !== 'function') { ...
SQL
UTF-8
193
2.875
3
[]
no_license
USE employees; SELECT CONCAT(first_name, ' ', last_name)FROM employees WHERE first_name = 'Maya' ORDER BY last_name; SELECT DAYOFMONTH(hire_date) FROM employees WHERE first_name = 'Maya';
TypeScript
UTF-8
3,292
2.640625
3
[]
no_license
import CustomerStatementsReport from "../model/customerStatementsReport"; import { parse } from '@fast-csv/parse'; import CustomerStatement from "../model/customerStatement"; import CustomerStatementReportItem from "../model/customerStatementReportItem"; import {isValidIBAN} from "ibantools"; export default class Cus...
Go
UTF-8
856
2.953125
3
[ "Apache-2.0" ]
permissive
package state import ( "github.com/stretchr/testify/assert" "testing" ) func TestValue_InitalStateNotChanged(t *testing.T) { s := CreateState(nil, "fuel", 100) assert.Equal(t, 100, s.Get()) assert.False(t, s.Changed()) } func TestUninitializedValue_StateChanged(t *testing.T) { s := CreateState(nil, "fuel", 100...
JavaScript
UTF-8
450
2.59375
3
[]
no_license
function formValidation(formData) { const expected_params = ["food", "time", "location", "number_of_ducks", "food_amount"]; for ( const key of expected_params) { if (! formData.hasOwnProperty(key) || formData[key] == "") { let key_friendly = key.split("_").join(" "); return {val...
TypeScript
UTF-8
15,699
3.171875
3
[ "MIT" ]
permissive
import {AbstractValidator, ValidationResult} from "./"; import {Severity, ValidationFailure} from "./shared"; class TestPerson { name?: string; xpInYears?: number; address?: TestAddress; email?: string; dateOfBirth?: Date; } class TestAddress { street: string; number?: string; city: st...
Java
UTF-8
185
1.984375
2
[]
no_license
package shared.exceptions; public class CannotCollectResourcesException extends Exception { public CannotCollectResourcesException(String message) { super(message); } }
Java
UTF-8
824
2.15625
2
[]
no_license
package service.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import mapper.UserMapper; import pojo.User; import service.UserService; @Component("userService") public class UserServiceImpl implements UserServi...
Markdown
UTF-8
1,533
3
3
[]
no_license
## Notice boxes You can make `info`, `warning` and `alert` boxes like this. Examples of what they look like can be found here: https://squidfunk.github.io/mkdocs-material/getting-started/ **Info box** ``` !!! info "Call for Contributions: Add languages/translations to Material" Help translate Material into more...
PHP
UTF-8
3,578
2.75
3
[]
no_license
<?php namespace App\Entity; use App\Repository\SpeciesRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\Entity(repositoryClass=SpeciesRepository::class) */ class...
JavaScript
UTF-8
381
3.921875
4
[]
no_license
function increment(number) { let carry = 1; for (let i = number.length - 1; i >= 0; i--) { if (number[i] + 1 === 10) { number[i] = 0; carry = 1; } else { number[i]++; carry = 0; break; } } if (carry) number.unshift(carry); return number; } console.log(increment([9...
C#
UTF-8
3,293
2.578125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using AutoMapper; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Planner.Data; using Planner.Dto.Models; using Planner.Models; using Planner.Services.Contract; u...
Java
UTF-8
458
2.5
2
[]
no_license
package com.globeshanghai.backend.exceptions; /** * Created by stijnergeerts on 23/04/17. */ public class UserNotFoundException extends RuntimeException { /** * This exception is thrown when no content is found. * @param id The userId that is not linked to a {@link com.globeshanghai.backend.dom.user.U...
Markdown
UTF-8
5,772
2.75
3
[]
no_license
# Résumé Le projet de compilation a pour but la réalisation d'un compilateur d'un mini langage appelé pour l'occasion myC vers du code C à 3 adresses. Le langage source proposé, un mini langage C, devra donc être compilé en C à 3 adresses. Il a été réalisé par Reda CHAGUER et Houssam BAHHOU, élèves à l'Enseirb-Ma...
PHP
UTF-8
1,114
2.65625
3
[]
no_license
<?php use Illuminate\Database\Seeder; use App\User; use App\Post; use App\Comment; class CommentSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { // $faker = Faker\Factory::create(); $limit = 10; $users =...
Java
UTF-8
1,083
1.992188
2
[]
no_license
package ms55.moreplates.common.plugin; import static ms55.moreplates.common.enumeration.EnumMaterials.BLACK_IRON; import static ms55.moreplates.common.enumeration.EnumMaterials.CRYSTALTINE; import static ms55.moreplates.common.enumeration.EnumMaterials.ENDER; import static ms55.moreplates.common.enumeration.EnumM...
Rust
UTF-8
398
3.890625
4
[]
no_license
fn main() { let arr = [1, 2, 3, 4, 5]; let arr_type: [i32; 5] = [1, 2, 3, 4, 5]; // same thing as above // element; length let arr_default = [2; 400] // a array with default values in it // arr[2] // 3 // arr[1] // 2 // looping and array for n in arr.iter() { println!("{}", n...
Python
UTF-8
3,294
3.84375
4
[]
no_license
import unittest # naive solution- take product between each number # and every other number # def get_products_of_all_ints_except_at_index(nums): # if len(nums) == 0 or len(nums) == 1: # raise Exception("Invalid input!") # products = [] # for i in range(len(nums)): # product = 1 # f...
Python
UTF-8
2,066
2.78125
3
[ "MIT" ]
permissive
import pandas as pd from matchreporter.analysis.events import is_origin_of_play_event, is_outcome_of_play_event, \ is_transition_play_event, is_middle_play_event, transpose_outcome from matchreporter.analysis.play import get_play CLOCK = 'clock' PLAYID = 'playid' KPI = 'kpi' REDUCED_ORIGIN = 'reduced_origin' REDU...
Markdown
UTF-8
9,341
3.375
3
[]
no_license
--- title: "Basics of Technical Analysis" date: 2021-09-04T18:45:47+08:00 draft: false categories: - Trading tags: - technical analysis --- In this entry, we'll be talking about the fundamentals of reading the trend of a given market. By understanding the trend of a market, we gain knowledge of its behaviour. ...
C#
UTF-8
2,843
2.78125
3
[]
no_license
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Bcompression { sealed public partial class Imagecompress : Form { public Imagec...
Java
UTF-8
2,012
2.171875
2
[ "Apache-2.0" ]
permissive
package io.renren.modules.sys.service.impl; import io.renren.common.constants.Constants; import org.springframework.stereotype.Service; import java.util.List; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.exten...
Java
UTF-8
2,132
3.5
4
[]
no_license
package hackrank; import java.util.Scanner; /** * https://www.hackerrank.com/challenges/electronics-shop/problem * * Best solution: * https://github.com/RyanFehr/HackerRank/blob/master/Algorithms/Implementation/Electronics%20Shop/Solution.java */ public class ElectronicsShop { static int getMoneySpent(int[...
Python
UTF-8
13,131
2.875
3
[]
no_license
from collections import defaultdict import math import numpy as np import torch def one_cold(i, n): """Inverse one-hot encoding.""" x = torch.ones(n, dtype=torch.bool) x[i] = 0 return x class HiddenStateMLPPooling(torch.nn.Module): def __init__(self, hidden_dim=128, mlp_dim=128, mlp_dim_spatial...
PHP
UTF-8
802
2.625
3
[]
no_license
<?php $p_columnax=$_POST["param1"]; $p_columnay=$_POST["param2"]; include '../../../dbcon/conectar_mysql.php'; $db = new ConectarMySQL(); $resultado=$db->traer_matriz($db->sentencia("CALL analisis_correlacion('$p_columnax','$p_columnay');")); $R=round($resultado[0][0],4); if ($R>0.5) { $msj='La correlacio...
Python
UTF-8
287
3.3125
3
[]
no_license
import calendar import math import random cal = calendar.month(2020, 3) print(cal) result = math.sqrt(49) print(result) number = random.randint(1000, 2000) print(number) movies = ["Aladdin", "Toy story", "Avenger: Endgame", "Lion King"] watch = random.choice(movies) print(watch)
Java
UTF-8
2,322
1.992188
2
[]
no_license
package org.miq.test.middleware; import java.util.ArrayList; import java.util.List; import org.miq.test.common.BaseProvider; import org.miq.test.common.Kwargs; import org.miq.test.webui.AngularSelect; import org.miq.test.webui.Form; import org.miq.test.webui.FormButton; import org.miq.test.webui.Input; import org.miq...
Java
UTF-8
800
3.484375
3
[]
no_license
package main.java.composite.demo001; /** * 组合模式:用树状结构表示“部分-整体”的层次结构,以便部分和整体保持一致性,共有类似的逻辑</br> * * <b>使用场合:</b>需求中体现部分和整体的关系,希望用户可以以统一的方式访问整体和部分,复用逻辑,就应该考虑使用组合模式</br> * @author wangjiuliang * */ public class CompositeTest { public static void main(String[] args) { Component root = new Composite("root"); ro...
Markdown
UTF-8
5,994
3.546875
4
[ "MIT" ]
permissive
# Bounce Algorithm [University of Applied Sciences Potsdam](http://www.fh-potsdam.de/) Semester: Winter 2015/16 Course: [11EG-B: Eingabe/Ausgabe (Steel Ant)](https://incom.org/workspace/6176) Supervisor: [Fabian Morón Zirfas](https://fhp.incom.org/profil/270) This Project was realized with [P5js](http://p5js.or...
Java
UTF-8
2,433
1.851563
2
[]
no_license
/** * Copyright 2007 Verticon, Inc. All Rights Reserved. * * $Id$ */ package com.verticon.tracker; import com.verticon.osgi.metatype.OCD; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Generic Event I...
C++
UTF-8
2,595
3.03125
3
[ "MIT" ]
permissive
#include "MapManager.hpp" namespace mv { MapManager* MapManager::instance; void MapManager::createWorld(uint8_t defaultStateNumber) { for (int j = 0; j < unitWorldSize.y; j++) { for (int i = 0; i < unitWorldSize.x; i++) { map.emplace_back(sf::Vector2i{i,j}, cellDimensions, defaultStateNumber); } ...
C
UTF-8
243
3.21875
3
[]
no_license
#include <stdio.h> #include <stdlib.h> int main(void) { setbuf(stdout, NULL); char nombre[20]; printf("Ingrese nombre: "); fflush(stdin); scanf("%s", nombre); printf("Usted ingreso: %s\n\n", nombre); system("PAUSE"); return 0; }
Python
UTF-8
49
3.140625
3
[]
no_license
#x=int(input()) for y in range(1,8): print(y)
JavaScript
UTF-8
348
3.6875
4
[]
no_license
'use strict' module.exports = function filterForNumbers(iterable) { // loop over iterable, adding numeric values to a new array let numberArray = [] for(let item of iterable){ if(typeof item === 'number'){ numberArray.push(item) } } // then return the new array of numbe...
Markdown
UTF-8
7,434
2.671875
3
[]
no_license
# KSDG ASP.NET MVC Workshop #1 # ## 簡介 ## 這是一個簡單的 MVC 留言板程式,它有下列功能: 1. 留言與回覆留言。 2. 編輯與刪除留言與回覆。 3. 整合Facebook登入。 4. 切換主版。 5. 在 Validate Request = true 的情況下允許 HTML 內容。 6. 使用 Bootstrap, Bootsnipp 以及 Fontawesome 簡單美化。 ## 環境與前置需求 ## - Visual Studio 2013 Community Edition, Professional or Ultimate Edition - SQL Server E...
Java
UTF-8
4,347
2.390625
2
[]
no_license
package com.sicredi.service; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Service; import java.io.F...
Java
UTF-8
245
1.648438
2
[]
no_license
package com.koncana.validation.entity.repository; import org.springframework.data.repository.CrudRepository; import com.koncana.validation.entity.models.Modules; public interface IModuleRepository extends CrudRepository<Modules, Integer>{ }
Markdown
UTF-8
1,903
3.265625
3
[]
no_license
--- layout: post title: Looking for a Place To Call Home? tags: - Home Buyer Tips - Real Estate excerpt: Everyone needs a place they can come home to at the end of the day. enclosure: pullquote: We’ve helped people find their home for the past 20 years. enclosure_type: video/mp4 enclosure_time: use_youtube_image: f...
JavaScript
UTF-8
10,019
2.953125
3
[]
no_license
/** * Common database helper functions. */ class DBHelper { static get DB_PROMISE() { // If the browser doesn't support service worker, // we don't care about having a database if (!navigator.serviceWorker) { return Promise.resolve(); } return idb.open('restaturant-reviews'...
C++
UTF-8
5,826
2.78125
3
[ "MIT" ]
permissive
/** * ofxSoundObject.cpp * * Created by Marek Bereza on 10/08/2013. */ #include "ofxSoundMixer.h" //---------------------------------------------------- ofxSoundMixer::ofxSoundMixer():ofxSoundObject(OFX_SOUND_OBJECT_PROCESSOR){ chanMod = OFX_SOUND_OBJECT_CHAN_MIXER; masterVolume = 1.0f; masterPan = 0.5f...
Java
UTF-8
1,107
3.015625
3
[]
no_license
package org.freecode.demo; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.TimeZone; public class TimeConverter { public static void main(String[] args) { //Calendar cal = new GregorianCalend...
C++
UTF-8
2,966
3.421875
3
[]
no_license
// // 18_11.cpp // // // Created by Pengyan Qin on 7/28/15. // // #include <iostream> #include <fstream> using namespace std; // 1 represents black, 0 represents white // time complexity: O(n) bool is_valid(int *A, int n, int k){ for(int i = 0; i <= k; i += k){ // only 2 times for(int j = 0; j <= k;...
Java
UTF-8
5,952
2.328125
2
[]
no_license
package hoopsnake.geosource.data; import android.app.Activity; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.RelativeLayout; import android.widget.TextView; import java.io.IOException; import java.io.InvalidObjectException; import java.io.ObjectInputStream; im...
Java
UTF-8
348
1.882813
2
[ "Apache-2.0" ]
permissive
package com.couchbase.client.spring.cache.wiring.xml; import java.util.List; public class CouchbaseCluster { public static final com.couchbase.client.java.CouchbaseCluster create(List<String> nodes, String username, String password) { return com.couchbase.client.java.CouchbaseCluster.create(nodes).authenticate...
C#
UTF-8
1,077
2.640625
3
[ "MIT" ]
permissive
using System; using Microsoft.EntityFrameworkCore; using System.ComponentModel.DataAnnotations; namespace MiModeloMVC.Models { public class Clientes { // {get; } Consultar su valor // {set; } Establecer su valor public int ID {get; set;} [StringLength (60, MinimumLength...
C#
UTF-8
533
2.765625
3
[ "MIT" ]
permissive
using System.ComponentModel; using System.Runtime.CompilerServices; namespace DynamicNotifyPropertyChanged { /// <summary> /// Empty class that implements <see cref="INotifyPropertyChanged"/>. /// </summary> public abstract class BaseNotifyPropertyChangedClass : INotifyPropertyChanged { public event PropertyCh...
Python
UTF-8
9,501
2.828125
3
[]
no_license
# Tomer Shay, 323082701 import hashlib import os import random import matplotlib.pyplot as plt import numpy as np import sys if len(sys.argv) < 2: print("not enough arguments!") exit(-1) img_file_name = sys.argv[1] if len(sys.argv) < 3: print("you must enter the number of colors (k)!") exit(-1) k = in...
Markdown
UTF-8
2,978
2.9375
3
[]
no_license
TECHNICAL DESCRIPTION. This is a description of the class design and its tests. * This is an Objective-C project using the Sprite Kit framework. I have been writing Objective-C code for 3 months so I would still count myself as a newbie, and I haven't (yet) paid much attention to coding standards or stylistic e...
PHP
UTF-8
3,055
3.609375
4
[]
no_license
<?php use Modules\Module; namespace Modules; class Date extends Module{ /** * Checks to see if a time overlaps a list of times * @param date $start_time * @param date $end_time * @param array $times * @return boolean */ public function timeOverlap($start_time, $e...
Markdown
UTF-8
4,479
2.5625
3
[]
no_license
--- author: Il Gorgonauta comments: true date: 2013-05-07 17:31:06+00:00 layout: post link: http://www.atomodelmale.it/2013/05/07/prime-visioni-tutte-le-uscite-al-cinema-di-maggio-2013/ slug: prime-visioni-tutte-le-uscite-al-cinema-di-maggio-2013 title: Prime visioni, tutte le uscite al cinema di maggio 2013 wordpress_...
Python
UTF-8
11,318
2.625
3
[]
no_license
from flask import Flask from flask import request, jsonify from tinydb import TinyDB, Query import requests app = Flask(__name__) # Use TinyDB db = TinyDB('db.json') DB = Query() # Initialize important constants LIST_URL = 'http://172.17.0.55/list-demo' MAX_TRANSFER_AMOUNT = 1000000000 ZERO_QUORUM = 0 HALF_QUORUM = ...
C
UTF-8
3,953
3.046875
3
[]
no_license
/** * tx - disk-send * * XMODEM-512 (512K block) routines * * Thomas Cherryhomes <thom.cherryhomes@gmail.com> * * Licensed under GPL Version 3.0 */ #include <i86.h> #include <stdio.h> #include <stdlib.h> #include "xmodem-send.h" #include "int14.h" #include "int13.h" #define START_DELAY_TIME_MS 3000 // approx...
C#
UTF-8
1,839
2.53125
3
[ "Apache-2.0" ]
permissive
using LLM; using LLMListView_Sample.Models; using LLMListView_Sample.ViewModels; using System.Linq; using Windows.UI.Xaml.Controls; namespace LLMListView_Sample.Views { /// <summary> /// An empty page that can be used on its own or navigated to within a Frame. /// </summary> public sealed partial clas...
JavaScript
UTF-8
2,219
3
3
[]
no_license
import DisjointSetItem from './DisjointSetItem' export default class DisjointSet { /** * 并查集 * @param {function(value:*)} keyCallback */ constructor(keyCallback) { this.keyCallback = keyCallback // 集合中的元素 this.items = {} } /** * 构造并查集中的元素 * @param {*} itemValue * @returns {Disjoin...
Java
UTF-8
3,321
2.328125
2
[]
no_license
package biai.main.execute; import biai.models.TestData; import biai.models.TrainingData; import biai.neuralnet.NeuralNet; import biai.testdatapreparer.TestDataPreparer; import org.encog.Encog; import org.encog.ml.data.MLDataSet; import org.encog.neural.networks.BasicNetwork; import org.springframework.beans.factory.an...
Python
UTF-8
364
3.703125
4
[]
no_license
string_a = "{}".format(10) print(string_a) print(type(string_a)) format_a = "{}만 원".format(5000) format_b = "파이썬 열공하여 첫 연봉 {}만 원 만들기".format(5000) format_c = "{} {} {}".format(3000, 4000, 5000) format_d = "{} {} {}".format(1, "문자열", True) print(format_a) print(format_b) print(format_c) print(format_d)...
C#
UTF-8
2,424
3.609375
4
[]
no_license
using System; using System.Collections.Generic; using System.Text; namespace AnalysisOfEnvelopes { class View { public double InputFirstSide() { Console.WriteLine("Enter A side:"); double aSide = double.Parse(Console.ReadLine()); while ((aSide <= 0) || (aSid...
Markdown
UTF-8
341
2.609375
3
[]
no_license
# Very-Simple-CRUD A very simple CRUD console application with storing data in an "Arraylist". I'm using: Java 8, IntelliJ IDEA, GitHub / Git, JUnit Очень простое консольное приложение CRUD с сохранением данных в "Arraylist". Использую: Java 8, IntelliJ IDEA, GitHub/Git, JUnit
Swift
UTF-8
5,768
2.59375
3
[]
no_license
// // TripListTableViewController.swift // sally201UI // // Created by Sally on 4/20/19. // Copyright © 2019 Sally. All rights reserved. // import UIKit import MapKit class TripListTableViewController: UITableViewController { let shared = TripDataModel.sharedInstance let user = User(username: LoggedInUse...
Markdown
UTF-8
10,730
2.515625
3
[]
no_license
--- date: 2020-12-2T17:09:00-04:00 title: "Mengumpulkan Review Konsumen Tidak Pernah Semudah Ini" categories: - Blog tags: - Machine Learning - Artificial Intelligence - Web Scrape - Home Tester - Market Research - Konsumen - Review Konsumen - Research - RVest - Tutorial --- Di dunia *market rese...
Markdown
UTF-8
1,877
2.96875
3
[]
no_license
--- permalink: /finding-mods/ --- # Finding Mods There are two primary places to acquire mods for BL2 and TPS: Github and Nexus Mods. Github has been the primary place to store mods for some time now, but more modders have been using Nexus recently. ## ModCabinet The ModCabinet wiki is a place where github mods get...
Shell
UTF-8
378
3.703125
4
[]
no_license
#!/bin/sh for selected_jpg in *.jpg do new_suffix='.png' #echo "$selected_jpg" selected_filename=` echo $selected_jpg | cut -d. -f1 ` selected_png=${selected_filename}${new_suffix} #echo "$selected_png" if [ -e "$selected_png" ] then echo "$selected_png" already exists exit ...
Python
UTF-8
3,191
2.671875
3
[ "Apache-2.0" ]
permissive
import logging import os from functools import partial from pathlib import Path from gluonts.dataset.common import TrainDatasets, load_datasets from gluonts.dataset.repository._lstnet import generate_lstnet_dataset from gluonts.dataset.repository._m4 import generate_m4_dataset m4_freq = "Hourly" pandas_freq = "H" dat...
Python
UTF-8
3,106
3.125
3
[]
no_license
""" Program author name: Analia Treviño-Flitton - This function opens and reads in a file with the results from a local BLASTx search. It parses the document for the Best Hit, the E-value, and the Identities then saves them to a text document. """ def blast_parser(file): # Regex for query import re ...
C++
UTF-8
2,445
2.5625
3
[]
no_license
#include <stdlib.h> //#include <random> #include <opencv2/opencv.hpp> //#include <float.h> #include "imio.hpp" using namespace cv; //using namespace std; float mean_c[3] = {104,117,123}; int img_in(char* file_path, float** pdst, int* c, int* h, int* w){ Mat img; img = imread(file_path); if(!img.data){ return -1...
Java
UTF-8
7,112
2.09375
2
[]
no_license
package com.service.imp; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.log4j.Logger; import com.dao.IBugDB; import com.pojo.Bug; import com.pojo.Comment; import com.pojo.Project; import com.pojo.User; import com.service.IBugsService; public class BugsService...
Python
UTF-8
7,903
2.65625
3
[ "MIT" ]
permissive
from typing import Callable, Optional, Union, Sequence import numpy as np import torch from torch.nn import Module from torch.nn.utils import clip_grad_norm_ from torch.optim import Optimizer from ..im.utils import identity, dmap, zip_equal, collect from .utils import * __all__ = 'optimizer_step', 'train_step', 'inf...
Markdown
UTF-8
5,300
2.546875
3
[]
no_license
### AVT Vimba与OpenCV环境配置 近来,由于项目需求,需要使用AVT的一款相机采集图像并进行相应的算法处理。环境的配置过程较为复杂,特此记录,以做备忘。也给有需要的小伙伴们一些key point的分享。 **搭建环境:Windows7 + Python2.7 + OpenCV3.0** ##### 1. Python2.7 由于平时的工作基本都是Mac或Linux平台,很少用到Windows,这次也把在Windows上面安装Python的过程做简单记录。 (1) 这里选择软件支持效果较好的Python2.7,[Python官网](https://www.python.org/downloads/)直接下载安装。...
Java
UTF-8
523
3.234375
3
[]
no_license
package com.sam.design_patterns.interpreter; import org.apache.commons.lang3.StringUtils; public class NumberExpression implements Expression { private Integer number = 0; NumberExpression(int number) { this.number=number; } NumberExpression(String stringNumber) { if(!StringUtils.isEmpty(stringNumber)) ...
PHP
UTF-8
1,378
2.6875
3
[]
no_license
<?php namespace App; /** * @author * Web Design Enterprise * Website: www.webdesignenterprise.com * E-mail: info@webdesignenterprise.com * * @copyright * This work is licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License. * To view a copy of this license, ...
JavaScript
UTF-8
1,511
3.03125
3
[]
no_license
function tab() { //Tabs let tab = document.getElementsByClassName('info-header-tab'), tabContent = document.getElementsByClassName('info-tabcontent'), info = document.getElementsByClassName('info-header')[0]; /*Скрываем контент (если а=0, то весь; если а=1, то всё, кроме 1-ой статьи (используется при перво...
C
UTF-8
1,171
2.65625
3
[]
no_license
#include "pitch_pid.h" PID_CONFIG pitchPIDConfig; PID_STATUS pitchPIDStatus; float pitchPIDErrorIntegral; float pitchPIDLastError; float pitchPIDTarget; float lastTimeUpdate; void PITCH_PID_START(PID_CONFIG config){ pitchPIDConfig = config; pitchPIDStatus.error = 0.0f; pitchPIDStatus.errorIntegral = 0.0f;...
Rust
UTF-8
2,950
2.78125
3
[ "MIT" ]
permissive
use std::io::Read; use std::io::Write; use std::net::SocketAddr; use std::net::{TcpListener, TcpStream}; use std::str::FromStr; use std::thread; extern crate chrono; use chrono::prelude::*; use ntp; pub fn run_server_udp(addr: &str, is_verbose: bool) { use std::mem::size_of; use std::net::UdpSocket; let...
Java
UTF-8
12,052
1.976563
2
[]
no_license
package com.example.kevinhan.forgetaboutit; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothSocket; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import...
Markdown
UTF-8
5,990
2.703125
3
[ "BSD-2-Clause-Views", "BSD-2-Clause" ]
permissive
# PHP Transmission API [![Build Status](https://travis-ci.org/transmission-php/transmission-php.png)](https://travis-ci.org/transmission-php/transmission-php) This library provides an interface to the [Transmission](http://transmissionbt.com) bit-torrent downloader. It provides means to get and remove torrents from t...
Java
UTF-8
1,164
2.3125
2
[]
no_license
package com.redsun.social.dao.mapper; import java.sql.ResultSet; import java.sql.SQLException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.RowMapper; import org.springframework.stereotype.Component; import com.redsun.social.entities.FileSharing; @Co...
C#
UTF-8
489
2.9375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Eticaret.Entities.Concrete { public class Cart { public Cart() { CartLines = new List<CartLine>(); //hiçbir ürün yokken null hatası almamak için. } public List<CartLine>C...
Python
UTF-8
501
2.65625
3
[ "MIT" ]
permissive
import requests import json base_url = "https://jobs.github.com/positions.json" #Extracting results from multiple pages results = [] for index in range(10): response = requests.get(base_url, params= {"description":"python", "location":"new york","page": index+1}) print(response.url) # print(response...
Markdown
UTF-8
2,096
3.359375
3
[]
no_license
--- title: "Engineering careers at graze" author: andy-worsley image: src: /content/images/2017/11/Engineering_Role_Rainbow.png alt: Engineering Role Rainbow tags: [ careers ] --- Graze is a great place to develop as a professional. We're big on giving people responsibility and seeing how far they can go with it. ...
Ruby
UTF-8
732
3.21875
3
[]
no_license
class CookbookView def display(recipes, marmiton = false) if marmiton puts "Looking on Marmiton..." else puts "Cookbook recipes:" end recipes.each_with_index do |recipe, index| mark = recipe.tested ? "[X]" : "[ ]" puts "#{mark unless marmiton} #{index + 1} - #{recipe.name} - #{...
Ruby
UTF-8
1,818
2.6875
3
[]
no_license
class Gemfile < ActiveRecord::Base has_many :gem_uses has_many :gem_instances, through: :gem_use has_many :votes belongs_to :user validate :validate_source validates :name, presence: true after_save :extract_gem_uses GEM_NAME = 0 GEM_VERSION = 1 def extract_gem_uses included_gems = extract...
Java
UTF-8
904
1.929688
2
[]
no_license
package com.privilege.service.resource.template; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlType; import java.util.HashSet; import java.util.Set; /** */ @XmlType public class Parameters { private Set<Parameter> includes = ...
Python
UTF-8
286
2.78125
3
[]
no_license
#Importamos los modulos necesarios from reportlab.pdfgen import canvas doc = canvas.Canvas("Hola Mundo.pdf") #Inseratmos la imagen en el documento doc.drawImage("https://udemy-images.udemy.com/course/750x422/433798_1de9_4.jpg", -50, 500) #Guardamos el documento doc.save()