language
stringclasses
15 values
src_encoding
stringclasses
34 values
length_bytes
int64
6
7.85M
score
float64
1.5
5.69
int_score
int64
2
5
detected_licenses
listlengths
0
160
license_type
stringclasses
2 values
text
stringlengths
9
7.85M
Python
UTF-8
1,130
2.578125
3
[ "MIT" ]
permissive
import numpy as np import cv2 import os import img_rec as im face_recognizer=cv2.face.LBPHFaceRecognizer_create() face_recognizer.read(r'C:\Users\pabhi\PycharmProjects\asish_py\trainingData.yml') cap=cv2.VideoCapture(0) #If you want to recognise face from a video then replace 0 with video path name={0:...
Java
UTF-8
418
2.546875
3
[]
no_license
package com.epam; import java.util.List; import java.util.Scanner; import java.util.stream.Collectors; public class StringTask { static final Scanner scanner = new Scanner(System.in); static List<String> filter(List<String> list) { return list. stream(). filter(str -> ...
C
UTF-8
215
2.859375
3
[]
no_license
#include<stdio.h> #include"data.h" void set_age(struct data *p,int age) { p->age = age; } static void datashow(struct data *p) { printf("age=%d\n",p->age); } void show (struct data *p) { datashow(p); }
JavaScript
UTF-8
2,649
2.5625
3
[]
no_license
import {WebGLRenderer, sRGBEncoding, OrthographicCamera } from 'three'; import * as TWEEN from "@tweenjs/tween.js/dist/tween.amd"; import Scene1 from './scenes/Scene1'; import {OrbitControls} from 'three/examples/jsm/controls/OrbitControls' import Observer, { EVENTS } from './Observer'; export class App { constructo...
Ruby
UTF-8
444
3.15625
3
[]
no_license
filename = ARGV.first puts "Please hit RETURN to start the survey" $stdin.gets.chomp target = open(filename, 'w') print "How old are you?" line1 = $stdin.gets.chomp print "What is your favorite color?" line2 = $stdin.gets.chomp print "What time is it right now?" line3 = $stdin.gets.chomp target.write line1 target....
SQL
UTF-8
1,345
3.265625
3
[]
no_license
''' MIT License Copyright (c) 2019 Arshdeep Bahga and Vijay Madisetti Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, mo...
Python
UTF-8
2,411
4.21875
4
[]
no_license
''' Note that for every forward function, there is a corresponding backward function. That is why at every step of your forward module you will be storing some values in a cache. The cached values are useful for computing gradients. In the backpropagation module you will then use the cache to calculate the gradients. T...
Java
UTF-8
1,529
1.664063
2
[]
no_license
//$Header: /gestionale/org.activebpel.rt.bpel/src/org/activebpel/rt/bpel/impl/addressing/IAeWsAddressingFactory.java,v 1.1 2009/09/23 13:08:42 zampognaro Exp $ ///////////////////////////////////////////////////////////////////////////// //PROPRIETARY RIGHTS STATEMENT //The contents of this file represent confidenti...
Markdown
UTF-8
54,815
3.15625
3
[]
no_license
In the Society: From Economics to Politics ========================================== Let us begin our discussion on social issues with the basic part of any society: work. Work ---- There are two aspects to work: 1- Its value as a means: Products or results can only be achieved through work. There are no exception...
C++
UTF-8
7,584
3.140625
3
[]
no_license
#include "ListBase.h" #include "Product.h" #include <queue> #ifndef PRODUCTLISTARRAY_H #define PRODUCTLISTARRAY_H using namespace std; const int SIZE=100; //list array template class template <class T> class ProductListArray: public ListBase<T> { private: T* item; int ArraySize; int** Indexes...
C++
UTF-8
2,695
3.46875
3
[]
no_license
/** * @file neuron.hpp * @author Jonathan Haab * @date Automn, 2017 * @brief class that describe a neuron */ #include <iostream> #include <vector> #include <cmath> #include "constants.hpp" #ifndef NEURON_H #define NEURON_H /// State of the neuron : Active or Refractory enum State {ACTIVE, REFRACTORY, st...
Shell
UTF-8
2,552
3
3
[]
no_license
#!/bin/bash # # This script will configure the partially built debian system. # It is expected to be run as root, in a chroot, using the target # architecture, after multistrap has been run root_pwd="root" user_name="debian" user_pwd="tmppwd" hostname="octavo_install" export DEBIAN_FRONTEND=noninteractive DEBCONF_NON...
PHP
UTF-8
5,701
2.53125
3
[]
no_license
<?php namespace App\Controllers; use App\Classes\CSRFToken; use App\Classes\Request; use App\Classes\Cart; use App\Classes\Session; use App\Classes\Mail; use App\Models\Product; use App\Models\Order; use App\Models\Payment; use Stripe\Customer; use Stripe\Charge; /** * */ class CartController extends BaseControll...
Markdown
UTF-8
1,994
3.15625
3
[]
no_license
--- title: 'Evaluation Process for On-Going Volunteers' taxonomy: category: - docs visible: true --- **Ongoing Mentoring of Volunteer Leadership Team** Because the volunteer positions in youth ministry are highly relational, each volunteer will be mentored in a relational manner. It is difficult to quanti...
Java
ISO-8859-1
5,764
2.390625
2
[]
no_license
import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JMenuBar; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.sql.*; import javax.swing.JButton; import java.awt.Co...
C++
UTF-8
639
3.328125
3
[ "MIT" ]
permissive
#include <iostream> #include <string> using namespace std; /* void lexiSmallestString(string &str) { for (int i = str.length() - 2; i >= 0; i--) { if (str[i] > str[i + 1]) { str.erase(str.begin() + i); break; } } } */ void lexiSmallestString(string &str, int i...
Java
UTF-8
4,827
2.34375
2
[]
no_license
package demo.shiro.realm.dao; import demo.shiro.realm.entity.User; import demo.shiro.realm.orm.JdbcTemplateUtils; import org.springframework.jdbc.core.BeanPropertyRowMapper; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.PreparedStatementCreator; import org.springframework.jdbc...
Shell
UTF-8
269
3.109375
3
[]
no_license
#!/bin/bash x=0 load_balancer_url=$1 while [[ true ]]; do curl $load_balancer_url printf "\n" if [[ `expr $x % 2` = 0 ]]; then printf "+\n" else printf "*\n" fi x=`expr $x + 1` sleep 0.5 done
JavaScript
UTF-8
5,615
2.75
3
[ "BSD-3-Clause" ]
permissive
var parser = require("./main"); describe("Test AST structure", function() { it('fix #127 - echo statements', function() { var ast = parser.parseEval('echo "hello"; ?> world'); ast.children.length.should.be.exactly(2); ast.children[0].kind.should.be.exactly("echo"); ast.children[1].kind.should.be.exa...
JavaScript
UTF-8
2,150
2.984375
3
[ "MIT" ]
permissive
"use strict"; window.addEventListener("load", (function () { const commonUnitsTime = document.getElementById("cu-time"); const percentOfToday = document.getElementById("cu-percent"); const progressLoader = document.getElementById("progress-loader"); const siDate = document.getElementById("si-time").querySelector('...
Java
UTF-8
2,679
3.90625
4
[]
no_license
package duke; import duke.task.Task; /** * A class in charge of the interaction to {@code Duke} users. */ public class Ui { private static final String GREETING_TEXT = "Hello, I'm Duke!\n" + "How can I help you?"; private static final String FAREWELL_TEXT = "Why do you choose to leave me!"; ...
Markdown
UTF-8
1,872
2.640625
3
[ "MIT" ]
permissive
# React App Starter Kit This is a simple React App starter kit with the essential dependencies that I would use for development. After experimenting with Create React App, I thought it was really good, but missing a few things, so I have created something similar, but with a few extra's. I have also included my LE...
Java
UTF-8
660
2.5
2
[]
no_license
package com.leo.test.neural.network.activators; import java.io.Serializable; public class HyperbolicTangentActivationStrategy implements ActivationStrategy, Serializable { private static final long serialVersionUID = -268299068707852082L; public double activate(double weightedSum) { double a = Math.e...
Python
UTF-8
170
3.03125
3
[]
no_license
import calculate number1 = 10 number2 = 2 print(calculate.add(10, 2)) print(calculate.subtract(10, 2)) print(calculate.multiplied(10, 2)) print(calculate.divide(10, 2))
Java
UTF-8
624
2.875
3
[]
no_license
public class EmailErrorHandler implements Receiver { private Receiver receiver; @Override public boolean handleMessage(Message message) { if(message.msg.contains("Email")){ System.out.println(" EmailErrorHandler processed "+message.messagePriority+ " priority issue: "+message.msg); ...
Java
UTF-8
356
2.109375
2
[]
no_license
package com.nav.springbootstarter.topic; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; @ResponseStatus(value=HttpStatus.NOT_FOUND) class TopicNotFoundException extends RuntimeException { public TopicNotFoundException(String topicId) { super("could not f...
C#
UTF-8
2,148
2.546875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging;...
Java
UTF-8
179
1.90625
2
[]
no_license
package friends.reader.parser; import java.util.List; public interface FileLinesParser<T> { List<String> getLines(); void add(String line); List<T> retrieve(); }
C
UTF-8
1,206
3.296875
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <dirent.h> #include <errno.h> #define DEAD(mess){perror(mess);exit(-1);} #define DEATH(mess){printf("%s\n",mess);return 1;} void realrm(const char *filename){ stru...
C++
UTF-8
2,785
3.234375
3
[]
no_license
#include "Nunchuck.hpp" // everything related to talking with the nunchuck namespace Nunchuck { // anonymous namespace -> everything inside Nunchuck can see the contents, everything outside cannot namespace { // array to store nunchuck data uint8_t buf[6]; uint8_t address = 0x52; // sends a data requ...
Python
UTF-8
2,466
2.921875
3
[ "Apache-2.0" ]
permissive
# -*- coding: utf-8 -*- import numpy as np from sklearn.datasets import make_classification from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split from mabwiser.mab import MAB, LearningPolicy ##############################################################################...
PHP
UTF-8
2,841
3.09375
3
[]
no_license
<!DOCTYPE html> <html> <head> <title></title> </head> <body> <?php $ceu = array( "Italy"=>"Rome", "Luxembourg"=>"Luxembourg", "Belgium"=> "Brussels", "Denmark"=>"Copenhagen", "Finland"=>"Helsinki", "France" => "Paris", "Slovakia"=>"Bratislava", "Slovenia"=>"Ljubljana", "Germany" => "Berlin", "Greece" => "Athens", "Ir...
Java
UTF-8
2,372
1.898438
2
[ "Apache-2.0" ]
permissive
/* * Copyright 2000-2016 JetBrains s.r.o. * * 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 agre...
C++
UTF-8
1,333
4.03125
4
[]
no_license
//#include<cstring>,该头文件下的函数参数大多为char * ptr。 #include <iostream> #include <cstring> using namespace std; int main () { char str1[11] = "Hello"; //字符串赋值形式 char str2[11] = "World"; char str3[11]; int len; //复制 str1 到 str3 , 返回str3。 strcpy( str3, str1); cout << "strcpy(str3 , str1) : " << str3 << endl; char s ...
Python
UTF-8
954
3.984375
4
[]
no_license
# Use an import statement at the top import random word_file = "words.txt" word_list = [] #fill up the word_list with open(word_file,'r') as words: for line in words: # remove white space and make everything lowercase word = line.strip().lower() # don't include words that are too long or too short if 3 < l...
Python
UTF-8
640
3.125
3
[]
no_license
def ordered_word(word): l = len(word) for i in range(l): next = i + 1 temp = word[next] if word[i] < temp: if i + 1 < l: continue else: return False return true def crypto_words(word): l = len(word) crypto_pairs = [] pair = ["", 1] for i in range(l): pair[0] = word[i] ...
Python
UTF-8
3,642
2.515625
3
[]
no_license
# # 共通関数 # import os import datetime import csv import json def get_setting(itm,key): setting_info = json.load(open('info.json', 'r', encoding='utf-8')) return setting_info[itm][key] def make_dir(path): if not os.path.isdir(path): os.makedirs(path,exist_ok=True) def dsp_msg(title,msg,lvl): i...
Ruby
UTF-8
487
3.296875
3
[]
no_license
def bubble_sort arr j=(arr.size)-1 while j>=0 i=0 while i<j if(arr[i]>arr[i+1]) arr[i],arr[i+1]=arr[i+1],arr[i] end i+=1 end j-=1 end arr end def bubble_sort_by arr j=(arr.size)-1 while j>=0 i=0 while i<j if( yield(arr[i],arr[i+1]) >0) arr[i],arr[i+1]=arr[i+1],arr[i] end i+=1 ...
Java
UTF-8
700
1.5
2
[ "Apache-2.0" ]
permissive
package com.alibaba.alink.operator.common.fm; import java.io.Serializable; import com.alibaba.alink.operator.common.fm.BaseFmTrainBatchOp.FmDataFormat; import com.alibaba.alink.operator.common.fm.BaseFmTrainBatchOp.Task; /** * Fm model data. */ public class FmModelData implements Serializable { private static fi...
Java
UTF-8
2,473
2.609375
3
[]
no_license
package com.example.consumer; import org.apache.kafka.clients.consumer.CommitFailedException; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.clients.consumer.ConsumerRecords; import org.apache.kafka.clients.consumer.KafkaConsumer; import org.apache.kafka.common.TopicPartition; import ...
Markdown
UTF-8
1,070
2.703125
3
[]
no_license
### Sample project to figure out how to use expo Docs found here: https://expo.io/learn 1. Try the snack on the website 2. Download NodeJS if you do not have it already 3. Get the command line tool You will run this tool locally to package, serve, and publish your projects. `npm install expo-cli --global` m...
JavaScript
UTF-8
2,597
2.96875
3
[]
no_license
import { quarterOption, monthOption } from '../constant' /** * 获取从fromYear年开始到当前时间的前一年年份 * parameter 单位 */ export const yearFromLastYear = (fromYear, parameter = '') => { const ny = new Date().getFullYear() - 1 const yearNumber = ny - fromYear + 1 return new Array(yearNumber) .fill(1) .map((v, i) => {...
JavaScript
UTF-8
261
3.234375
3
[]
no_license
'use strict'; function indexOf(array, element, index) { typeof index === 'undefined' || typeof index === 'string' ? index = 0 : index; for(var i = index; i < array.length; i++){ if(array[i] === element) return i; } return -1; }
Markdown
UTF-8
4,967
2.9375
3
[]
no_license
#Welcome to the Banc Sabadell Blockchain Hackathon This is your team's base repository for the BS Hackathon, please clone it and upload all code and project resources here. ##Our Ethereum network In order to ease development during the event we've configured a private Ethereum network, this network is shared by all ...
Python
UTF-8
1,553
2.890625
3
[]
no_license
def start(): 云台灯(常量.云台所有, 黄色, 常量.效果常亮) 时间.睡眠(2) 云台灯(常量.云台左, 绿色, 常量.效果熄灭) 云台灯(常量.云台右, 红色, 常量.效果熄灭) for 序号 in range(1, 5): 云台单灯(常量.云台左, 序号 * 2 - 1, 常量.效果常亮) 云台单灯(常量.云台右, 序号 * 2, 常量.效果常亮) 时间.睡眠(1) 云台单灯(常量.云台左, 偶数, 常量.效果常亮) 云台单灯(常量.云台右, 奇数, 常量.效果常亮) 云台单灯(常量.云台左, 奇数, 常...
Java
UTF-8
1,416
3.203125
3
[]
no_license
package com.qa.test.Guru99Test; import static org.junit.Assert.assertEquals; import cucumber.api.PendingException; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; public class StackSteps { private StackExample myStack; private Object pushed; private Object p...
Python
UTF-8
9,472
2.859375
3
[]
no_license
""" Sample code for using webexteamsbot """ import os import requests from webexteamsbot import TeamsBot from webexteamsbot.models import Response import sys import json # Retrieve required details from environment variables bot_email = "smart2s@webex.bot" teams_token = "Yjc1N2I2YTMtYjFkZi00ZGIxLTg5MjYtY...
Python
UTF-8
8,906
2.75
3
[]
no_license
from twisted.trial import unittest from mdht import constants from mdht.contact import Node from mdht.kademlia import routing_table from mdht.kademlia.kbucket import KBucket from mdht.kademlia.routing_table import _TreeNode, TreeRoutingTable, \ SubsecondRoutingTable from mdht.t...
PHP
UTF-8
799
3.03125
3
[]
no_license
<?php require_once('../database/MysqlConnection.class.php'); // Model Parent class, all model classes should extend me // For actual production would add logging and potentially caching class Model { protected $table; private $pdo; public function __construct ($table) { $connection = MysqlConnection::getIn...
Swift
UTF-8
7,545
2.96875
3
[]
no_license
// // Extensions.swift // EsteticaFacial // // Created by Orlando Amorim on 15/04/16. // Copyright © 2016 Orlando Amorim. All rights reserved. // import Foundation import UIKit import RealmSwift extension String { func toInt() -> Int { return Int(self)! } func toDate() -> NSDate { let...
TypeScript
UTF-8
1,931
2.625
3
[ "MIT" ]
permissive
export const cpuUsage = `top -bn 1 -i | awk -F ',' 'NR == 3 {print $4}' | awk '{printf "CPU: \{ used: %s \}\\n", 100-$1}'` export const ramUsage = `top -bn 1 -i | awk '{if (NR == 4) printf "RAM: { free: %s, used: %s, cache: %s }\\n", $6, $8, $10}'` export const netUsage = `old="$(</sys/class/net/eth0/statistics/tx_by...
Java
UTF-8
2,232
2.453125
2
[]
no_license
package com.notification.challenge.dao; import static org.junit.Assert.assertEquals; import java.util.Date; import java.util.concurrent.atomic.AtomicLong; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.runners.MockitoJUnitRunner; i...
Python
UTF-8
441
2.640625
3
[ "MIT" ]
permissive
import numpy as np from abc import ABCMeta, abstractmethod class BaseResizer(metaclass=ABCMeta): def __init__(self, out_size: list or tuple): """ :param out_size: (width, height) """ self._out_size = out_size @abstractmethod def __call__(self, inputs, teachers) -> tuple: ...
Java
UTF-8
547
2.046875
2
[]
no_license
package stepDefinations; import java.io.IOException; import io.cucumber.java.Before; public class CucumberHooks { @Before //before condition of Cucumber and not junit public void beforeScenario() throws IOException { //execute this code only when place id is null LoginStepDefination sd = new LoginStepDefinat...
Python
UTF-8
1,176
3.1875
3
[]
no_license
import pygame from bird import bird from pipeManager import pipeManager import time pygame.init() width = 1440 height = 800 black = (0,0,0) bird_x = 300 bird_y = 400 clock = pygame.time.Clock() #make the pygame window display_surface = pygame.display.set_mode((width, height)) birdy = bird(bird_x, bird_y) pipeMana...
Java
UTF-8
3,419
3.75
4
[]
no_license
package model; import iterator.Iterator; import iterator.IteratorContainer; import observer.Observer; import observer.Subject; import java.util.ArrayList; public class Playlist implements Subject, IteratorContainer { private String title; private ArrayList<Song> songs; private ArrayList<Observer> obse...
Java
UTF-8
763
2.640625
3
[ "Apache-2.0" ]
permissive
package com.xiaogua.better.reflect; import java.util.ArrayList; import java.util.List; import org.junit.Assert; import org.junit.Test; public class TestGetClassCode { @Test public void testGetClass() throws Exception { Class<?> clz = this.getClass(); System.out.println(clz);// TestGetClassCode O...
Python
UTF-8
417
2.78125
3
[]
no_license
import csv openFile = open('/Users/leoniekruger/Downloads/VOCS2016-2017-HOUSEHOLD/VOCS2016-2017-HOUSEHOLD_F1.csv', 'r') csvFile = csv.reader(openFile) header = next(csvFile) headers = map((lambda x: ''+x+'`'), header) insert = 'INSERT INTO Table (' + ", ".join(headers) + ") VALUES " for row in csvFile: values = ma...
Java
ISO-8859-1
3,577
2.921875
3
[]
no_license
package Controleur; import Modele.Commande; import Modele.Objet; import Vue.Screen; import Vue.ScreenObserver; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import ja...
C
UTF-8
419
2.875
3
[]
no_license
#include <stdio.h> int main() { int i,j,t; scanf("%d",&t); for(i=0;i<t;i++) { int ng,nm,maxg=0,maxm=0,temp; scanf("%d",&ng); scanf("%d",&nm); for(j=0;j<ng;j++) { scanf("%d",&temp); if(temp>maxg) maxg=temp; } temp=0; for(j=0;j<nm;j++) { scanf("%d",&temp); if(temp>maxm) maxm=temp;...
Java
UTF-8
621
1.9375
2
[]
no_license
package com.facebook.profilo.core; public final class TraceEvents { public static boolean sInitialized; public static int sLastNameRefreshProvidersState; public static volatile int sProviders; public static native void nativeClearAllProviders(); public static native int nativeDisableProviders(int...
PHP
UTF-8
636
2.609375
3
[]
no_license
<?php /** * Verifcacion el login */ require("dbConex.php"); class dbverficacion_login extends conex{ /************************** * VERIFICAICION DEL LOGIN **************************/ public $estado; public $correo; public $id; function dbverificacion($user,$pass){ $Verif=mysql_query("select * from persona")...
Java
UTF-8
527
2.390625
2
[]
no_license
package com.blackflight.dof.data.entity; import com.blackflight.clean.data.entity.DataEntity; import java.util.UUID; /** * Created by peter on 11-11-16. */ public class BodyEntity implements DataEntity<UUID> { private final UUID mId; private final UUID mBodyTypeId; public BodyEntity(UUID id, UUID bod...
C#
UTF-8
8,998
2.734375
3
[]
no_license
using System; using System.Collections.Generic; using TheBank.DAL; using TheBank.Model; using TheBank.Model.DataContainer.Account; namespace DAL { public class DBStub : IDB { /* * Not part of obligatory #2 */ public bool changeTransaction(TransactionPresentation tp) ...
Ruby
UTF-8
3,502
2.890625
3
[ "MIT" ]
permissive
# frozen_string_literal: true require_relative 'scraping' require_relative 'urls' require_relative 'brewery/beer_list' module RateBeer # The brewery class represents one brewery found in RateBeer, with methods # for accessing information found about the brewery on the site. module Brewery class Brewery ...
Markdown
UTF-8
3,917
3.046875
3
[]
no_license
# Data flow analysis POC ## Copy Analysis **CopyToAnalysis** is a dataflow analysis to track `AnalysisEntity` instances that share the same value or reference. ### Examples ``` var x = new MyClass(); object y = x; ``` In this case there will be two `AnalysisEntity` instances, one for `x` and one for `y` and `CopyA...
C
UTF-8
1,067
3.03125
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <signal.h> int quitflag = 0; sigset_t mask; pthread_cond_t waitloc = PTHREAD_COND_INITIALIZER; pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; void* thr_fn(void* arg) { int err,signo; while(1) { err = sigwait(&mask,&signo); if(err != 0) ...
Java
UTF-8
7,555
2.21875
2
[]
no_license
package com.mobileapplicationdev.lab1; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Bitmap; import android.graphics.Matrix; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.preference.PreferenceManager; import android.pr...
C
UTF-8
747
2.875
3
[]
no_license
#include<sys/types.h> #include<sys/socket.h> #include<netdb.h> #include<string.h> size_t rio_readn(int fd, void *usrbuf, size_t n){ size_t nleft = n; size_t nread; char *bufp = usrbuf; while(nleft>0){ if((nread = read(fd, bufp, nleft))<0){ if(errno == EINTR){ nread = 0; // 被中断 }else{ return -1; }...
Python
UTF-8
1,428
3.1875
3
[]
no_license
import time print('# TCP') print('TCP---client') # # 导入socket库 # import socket # # # 创建一个socket # # AF_INET指定使用IPv4协议; SOCK_STREAM指定使用面向流的TCP协议 # socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # # # 建立连接 # # 80端口是Web服务的标准端口 # # connect()参数是一个tuple,包含地址host和端口号port # socket.connect(('www.baidu.com', 80)) #...
Java
UTF-8
310
2.21875
2
[]
no_license
package br.com.negocio; /** * * @author WILL-PC */ public interface ListaDupla { public void adicionar(Object objeto); public void adicionar(Object objeto, Integer posicao); public Boolean remover(Integer posicao); public String inverso(); public Boolean existe(Object objeto); }
TypeScript
UTF-8
2,425
2.734375
3
[]
no_license
import { Injectable, Inject } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; class Users{ fname: string; lname: string; email: string; password: string; constructor(fn: string, ln:string, e:string, p:string){ this.fname= fn; this.lname= ln; ...
JavaScript
UTF-8
1,040
2.625
3
[ "MIT" ]
permissive
// addEventBinder // -------------- // // Mixes in Backbone.Events to the target object, if it is not present // already. Also adjusts the listenTo method to accept a 4th parameter // for the callback context. (function(Backbone, Marionette, _){ // grab a reference to the original listenTo var listenTo = Backbone...
C++
UTF-8
540
2.78125
3
[]
no_license
#pragma once #include "unit.h" #include <memory> #include <string> class ClassUnit; class MethodUnit; class PrintOperatorUnit; class AbstractFactory { public: virtual std::shared_ptr<ClassUnit> CreateClassUnit(const std::string& name) const = 0; virtual std::shared_ptr<MethodUnit> CreateMethodUnit(const st...
Python
UTF-8
1,740
3.09375
3
[ "BSD-2-Clause" ]
permissive
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Name: immutable # Purpose: Abstract base class for immutable objects. # # Author: Michael Amrhein (michael@adrhinum.de) # # Copyright: (c) 2014 ff. Michael Amrhein # License: This program is pa...
Python
UTF-8
11,439
3.078125
3
[]
no_license
# Author: Robert Guthrie import torch import torch.autograd as autograd import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import sys, getopt, re, nltk, timeit, random torch.manual_seed(1) random.seed(6) RRule = random.random() ############################################################...
Ruby
UTF-8
1,486
2.859375
3
[ "MIT" ]
permissive
# encoding: utf-8 module Stefon # The editor is responsible for forming a team of surveyors and # asking for and combining their results. The editor decides what story # to run, i.e. to print recommendations or why recommendations are impossible class Editor attr_reader :options, :team attr_accessor :e...
C++
UTF-8
2,441
3.796875
4
[]
no_license
#include <iostream> #include <vector> #include <stack> using namespace std; template <typename StateType> class Machine { public: typedef StateType State; typedef std::stack<Machine<State> *, std::vector<Machine<State> *>> Stack; Machine (Stack &stack) : stack_ (stack) {} void st...
Markdown
UTF-8
53,555
2.71875
3
[]
no_license
# K8S概念 [TOC] ## 大纲 ### 组件 #### Master组件 1. api server:Kubernetes API的实现 2. etcd :存储集群数据 3. scheduler:负责Pods的调度,运行在哪些节点上 4. controler manager:控制器集合 1. Node Controller:当节点下线时,负责通知以及响应。 2. Replication Controller:维护Pods的正确数量 3. Endpoints Controller:填充终端对象 4. Service Account & Token Controller:负责新命名空间的账号创建...
Python
UTF-8
965
2.8125
3
[ "MIT" ]
permissive
from mc import Dict, List def chain(*callables): def f(arg): result = arg for c in callables: result = c(result) return result return f def mux(*callables, **kwcallables): if len(callables) == 0 and len(kwcallables) != 0: def f(arg): result = Di...
JavaScript
UTF-8
301
3.546875
4
[]
no_license
#!/usr/bin/node let num = parseInt(process.argv[2]); let neg = false; if (num < 0) { num *= -1; neg = true; } function factorial (a) { if (!a) { return 1; } if (a > 1) { a *= factorial(a - 1); } return a; } num = factorial(num); if (neg) { num *= -1; } console.log(num);
Java
UTF-8
1,046
2.53125
3
[]
no_license
package com.epam.training.ticketservice.presentation.cli.handler; import com.epam.training.ticketservice.presentation.cli.utils.SeatIntPairBuilder; import com.epam.training.ticketservice.utils.SeatIntPair; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import java.util.ArrayList; import j...
Shell
UTF-8
184
2.734375
3
[]
no_license
#!/usr/bin/env bash # load env variables if local .env file exist if [ -a .env ] ; then source .env; export DATABASE_URL=$DATABASE_URL; fi # migrate database sequelize db:migrate
Python
UTF-8
4,172
2.984375
3
[]
no_license
from random import choice, randint, shuffle from tkinter import * from tkinter import messagebox import pyperclip import json # ---------------------------- PASSWORD GENERATOR ------------------------------- # def passw_gen(): letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',...
Shell
UTF-8
2,025
3.609375
4
[]
no_license
#!/bin/bash -l ### COMP328: example batch script ### usage: "sbatch run.sh -c <num_cores_required> <sourcefile.c>" ### purpose: to OpenMP on requested number of cores ### restrictions: this script can only handle single nodes ### (c) mkbane, University of Liverpool (2020-2021) # Specific ...
Python
UTF-8
6,139
3.28125
3
[]
no_license
import pymysql #a=8 #if a<5: # print('你好') #else: # print('不好') #a=5 #b=8 #if b == a+3: # print('你好') #else: # print('hello') # a = input('请输入成绩') # b = int(a) # if b > 90 and b <= 100: # print('优秀') # elif b > 80 and b <= 90: # print('良好') # elif b >= 70 and b <= 80: # print('及格'...
Java
UTF-8
308
2.203125
2
[ "MIT" ]
permissive
package com.zlikun.jee.product.impl; import com.zlikun.jee.product.CPU; /** * @auther zlikun <zlikun-dev@hotmail.com> * @date 2017/6/8 11:05 */ public class AMDCPU implements CPU { @Override public int pins() { return 120; } @Override public String model() { return "AMD"; }...
C++
UTF-8
648
2.828125
3
[]
no_license
#pragma once #include <string> #include <list> class StateRequestStack; struct PopUpData { PopUpData() : mainMessage(L"error"), buttonMessage(L"error") {} PopUpData(std::wstring mainMess, std::wstring buttonMess) : mainMessage(mainMess), buttonMessage(buttonMess) {} std::wstring mainMessage; std::wstring buttonM...
Markdown
UTF-8
3,564
2.609375
3
[ "MIT" ]
permissive
# Official Python BEOWULF Library `beowulf-python` is the official Beowulf library for Python. It comes with a BIP38 encrypted wallet and a practical CLI utility called `beowulfpy`. This library currently works on Python 2.7, 3.5 and 3.6. Python 3.3 and 3.4 support forthcoming. ## Main Functions Supported 1. CHAIN ...
Python
UTF-8
2,615
3.28125
3
[]
no_license
from citis import Cities from collections import defaultdict import string import bs4 class DocParser: def __init__(self, doc_folder='files'): self.doc_dir = doc_folder self.city_utilities = Cities() self.city_map = self.city_utilities.load_look_up_table() def process_doc(self, doc_name): ''' There are t...
Python
UTF-8
10,251
2.515625
3
[]
no_license
import os, inspect import numpy as np import pybullet as p import time import pybullet_data # from utils.general import * # import utils.transformations as tf class Manipulator(object): """ Provides a pybullet API wrapper for simpler interfacing and manipulator-specific functions. The update() function ...
Markdown
UTF-8
5,090
2.59375
3
[]
no_license
--- layout: post title: "VHDL Simulation Workflow in macOS" date: 2019-02-01 23:54:23 +0300 categories: VHDL comments: true --- The [XILINX Vivado Design Suite](https://www.xilinx.com/products/design-tools/vivado.html) does not work natively on the macOS platform, so you can not download your code to your developme...
Java
UTF-8
2,990
3.03125
3
[]
no_license
/** * Listener.java * @asignatura Programacion de Aplicaciones Interactivas * @practica Practica * @author Aythami Torrado Cabrera <alu0100837018@ull.edu.es> * @date 30 mar. 2017 * */ package eventos; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import javax.swing.JButton; public cl...
Markdown
UTF-8
2,220
4.3125
4
[]
no_license
# C# - String the Exception - `String` and `string` are equivalent in C# - Strings are technically reference types but with some unique behaviours ## Value Type Behaviour - A `string` reference will always point to the original object, so modifying one reference will not affect other references - strings are _im...
Python
UTF-8
1,400
3.78125
4
[]
no_license
text = input() while True: tokens = input().split(' ') if tokens[0] == 'Finish': break command = tokens[0] if command == 'Replace': current_char = tokens[1] new_char = tokens[2] text = text.replace(current_char, new_char) print(text) elif command == 'Cut': ...
Python
UTF-8
771
4.40625
4
[]
no_license
""" This is program that asks the user for an 8-bit binary number and replies whether the parity bit checks OK. Parity bits are used as the simplest form of error detecting code. """ # Get a byte from the user. while True: bits_8 = input("Enter binary number: ") # Check if user inserted 8 bits. if (len(bi...
Python
UTF-8
539
3.796875
4
[]
no_license
SECONDS_DAY = 86400 SECONDS_HOUR = 3600 SECONDS_MINUTE = 60 seconds = int(input("Enter the number of seconds: ")) if seconds >= SECONDS_DAY: days = seconds // SECONDS_DAY seconds = seconds % SECONDS_DAY print("Days: ", days) if seconds >= SECONDS_HOUR: hours = seconds // SECONDS_HOUR seconds = sec...
Java
UTF-8
378
2.765625
3
[]
no_license
package abstractfactory; public class TestAbstractFactory { public static void main(String[] args) { Computer pc = ComputerFactory.getComputer(new PcFactory("16Mb", "1Tb", "CoreI7")); Computer server = ComputerFactory.getComputer(new ServerFactory("32Mb", "10Tb", "Xenon")); System.out.println("pc : " + pc...
C
UTF-8
2,849
2.640625
3
[ "MIT", "NCSA" ]
permissive
#include "cq-header.h" int sec(pd0) /* 6.2 Float and double */ /* 6.3 Floating and integral */ /* 6.4 Pointers and integers */ /* 6.5 Unsigned */ /* 6.6 ...
Java
UTF-8
4,230
2.09375
2
[]
no_license
package e.b.a.a.a.u; import e.b.a.a.a.m; import e.b.a.a.a.n; import e.b.a.a.a.t; import e.b.a.a.a.u.t.o; import e.b.a.a.a.u.t.u; import e.b.a.a.a.v.b; import e.b.a.a.a.v.c; import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; public class f { /* renamed from: d reason: collision wi...