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 |
|---|---|---|---|---|---|---|---|
Ruby | UTF-8 | 1,943 | 2.796875 | 3 | [
"MIT"
] | permissive | # encoding: utf-8
module Dugout
module Math
module Model
##
# This is the model definition, however, it's loaded from other files in
# the dugout/math/model/ast directory, so this constant should _not_ be
# used in normal operation
Defn = model { }
# @return The set of all pri... |
Python | UTF-8 | 5,051 | 2.578125 | 3 | [] | no_license | import sys
import re
if len(sys.argv) != 2:
sys.exit("Usage: xtract /path/to/ssltrace")
try:
fp = open(sys.argv[1], "r")
except:
sys.exit("File open error")
currentrec = []
records = []
fds = []
keywds = []
#1) tokenization into records
for line in fp:
#print(line)
matchObj1 = re.match( r'.*\(... |
JavaScript | UTF-8 | 9,866 | 3.265625 | 3 | [] | no_license | /**
* Circle class defines those funky circles that emanate out from
* where an intersection happens.
*/
function Ball(x, y, radius, speed) {
var direction = Math.random() > 0.5;
var widthOfAngle = Math.PI / 2;
var angle = Math.random() * widthOfAngle - widthOfAngle / 2;
this.win = 0;
this.shap... |
JavaScript | UTF-8 | 2,312 | 2.921875 | 3 | [] | no_license | const body = document.querySelector('body');
const navTemplate = `
<nav>
<ul class="nav-items">
<li class="nav-item logo">Nicholas Klaene</li>
<li class="nav-item"><a href="index.html">Work</a></li>
<li class="nav-item"><a href="about.html">About</a></li>
<li ... |
Go | UTF-8 | 2,834 | 2.78125 | 3 | [] | no_license | // gettime project main.go
package main
import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"sort"
"strconv"
"strings"
)
func check(err error) {
if err != nil {
fmt.Println("err:", err)
}
}
type ST struct {
name string
age int
}
type STsl []ST
func (a STsl) Len() int { // 重写 Len() 方法
return len(a)
}
func (a ST... |
Swift | UTF-8 | 2,202 | 4.25 | 4 | [] | no_license | //: Playground - noun: a place where people can play
import UIKit
import Foundation
/*
同步遇到了串行
desc: 先执行任务1,接下来进入线程同步,main队列是是主队列,是串行队列;
任务3要等待任务2执行完后才能执行,任务2排在了任务3后面,以为这任务2要在任务3执行完毕以后才能执行,所以进入相互等待的死锁局面
*/
func case1() {
print("任务1")
DispatchQueue.main.sync {
print("任务2")
}
print("... |
JavaScript | UTF-8 | 2,667 | 3.53125 | 4 | [
"MIT"
] | permissive | let answer = document.getElementById('answer');
let attempt = document.getElementById('attempt');
function guess() {
let input = document.getElementById('user-guess');
if(!(answer.value && attempt.value) ){
setHiddenFields();
};
if(!validateInput(input.value)){
return false;
}
... |
Python | UTF-8 | 231 | 2.78125 | 3 | [] | no_license | import json
list1 = [1,2,3,4,5, 'qkl']
with open('file_json_dump.json', 'w') as file_object:
json.dump(list1, file_object)
with open('file_json_dump.json', 'r') as file_object:
tmpList1 = json.load(file_object)
print(tmpList1)
|
Shell | UTF-8 | 2,684 | 4.28125 | 4 | [] | no_license | #!/usr/bin/env bash
# author : Bilery Zoo(bilery.zoo@gmail.com)
# create_ts : 2020-01-01
# program : convert properties of a image file to be compatible with JAVA
# Image color profile cii of "Japan Color 2001 Coated" and colour space of "CMYK" is not compatible with JAVA
# thus causing program BUGs of our system... |
Java | UTF-8 | 894 | 4.1875 | 4 | [] | no_license | package chapter_03;
import java.util.Scanner;
/**
* (Geometry: points in triangle?) Suppose a right triangle is placed in a plane as
* shown below. The right-angle point is placed at (0, 0), and the other two points
* are placed at (200, 0), and (0, 100). Write a program that prompts the user to enter
* a point w... |
Markdown | UTF-8 | 3,863 | 3.390625 | 3 | [] | no_license | # AES-RSA-FileTransfer
## 0x00 简介
**windows下用AES,RSA来实现文件的加密安全传输**
具体使用python的`pycrypto`、`m2crypto`两个模块来实现
## 0x01 大概思路
Alice拥有: AES秘钥,Bob公钥,Alice的私钥
Bob拥有:Alice的公钥,Bob的私钥
大概思路就是Alice先用AES加密文件,然后拿Bob的RSA公钥加密AES秘钥;
Bob接收到加密文件之后,用自己的RSA私钥解密出AES秘钥,再解密文件。
另外还有MD5摘要,可以验证文件的完整性
发送者的签名,保证不可抵赖性
## 0x0... |
C++ | UTF-8 | 9,012 | 2.625 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-free-unknown"
] | permissive | #include "peano/utils/Loop.h"
#include "peano/utils/PeanoOptimisations.h"
//#include "tarch/la/Utilities.h"
namespace {
int dLinearisedNotOptimised( const tarch::la::Vector<DIMENSIONS,int> & counter, int max ) {
int result = counter(DIMENSIONS - 1);
assertion2(counter(DIMENSIONS - 1) >= 0, counter, max);
... |
PHP | UTF-8 | 2,728 | 2.921875 | 3 | [] | no_license | <?php
class HaloService
{
protected $host;
protected $port;
public $wait;
public function __construct($host, $port)
{
$this->host = $host;
$this->port = $port;
$this->wait = true;
}
public function postJson($data, $url)
{
return $this->... |
Python | UTF-8 | 4,190 | 2.84375 | 3 | [
"MIT"
] | permissive | import numpy as np
import torch as t
from torch.autograd import Variable
class Dataloader():
def __init__(self, data_path=''):
"""
:param data_path: path to data
"""
assert isinstance(data_path, str), \
'Invalid data_path type. Required {}, but {} found'.format(str, ty... |
Java | UTF-8 | 5,190 | 2.5 | 2 | [] | no_license | package com.fyg.cuadrillas.ws.service.empleado;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.... |
Java | UTF-8 | 704 | 2.84375 | 3 | [
"MIT"
] | permissive | package net.moznion.capture.output.stream;
import static org.junit.Assert.assertEquals;
import java.io.ByteArrayOutputStream;
import org.junit.Test;
public class StdoutCapturerTest {
@Test
public void shouldPass() {
ByteArrayOutputStream parentStealer = new ByteArrayOutputStream();
ByteArrayOutputStream child... |
Markdown | UTF-8 | 23,626 | 3.578125 | 4 | [
"MIT"
] | permissive | ---
title: "Management 3.0"
date: "2018-12-21"
tags: ["book", "notes"]
---
The notes I took for this book are LONG. Tons of highlights, in part due to lack of focus. The topic isn't so relevant to my current situation, so I didn't read it with any specific purpose in mind. And that shows. With that said though, it's a... |
C# | UTF-8 | 1,666 | 3.578125 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace Program
{
class Program
{
static void Main()
{
var names = Console.ReadLine()
.Split(new char[] { ',', ' ', '\t' }, StringSplitOption... |
C# | UTF-8 | 1,994 | 2.71875 | 3 | [] | no_license | using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using CSharpCalculator;
namespace MSTestCalculator
{
/// <summary>
/// Summary description for MSTest_IsNegative
/// </summary>
[TestClass]
public class MSTest_IsNegative
{
private Calculator testCalculator;
pri... |
Markdown | UTF-8 | 1,684 | 2.65625 | 3 | [
"MIT"
] | permissive | ---
hrs_structure:
division: '2'
volume: '11'
title: '27'
chapter: '490'
section: '490:8-504'
type: hrs_section
tags:
- Business
menu:
hrs:
identifier: HRS_0490-0008-0504
parent: HRS0490
name: '490:8-504 Duty of securities intermediary to maintain'
weight: 78320
title: Duty of securities inter... |
Shell | UTF-8 | 1,090 | 3.015625 | 3 | [
"Apache-2.0"
] | permissive | #!/bin/bash
# To be configured on auto boot-up
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
APPASS="password"
APSSID="SUSI.AI"
cat > /etc/dnsmasq.conf <<EOF
interface=wlan0
dhcp-range=10.0.0.2,10.0.0.5,255.255.255.0,12h
EOF
cat > /etc/hostapd/hostapd.conf <<EOF
interface=wlan0
hw_mode=g
channel=10
auth_... |
TypeScript | UTF-8 | 801 | 2.546875 | 3 | [] | no_license | import { Request, Response } from 'express'
import { User } from './user.model'
export const getProfile = async (req: Request, res: Response) => {
const { email } = req.user
try {
let user = await User.findOne({ email })
let userProfile
if (user) {
userProfile = user.sanitizeObject()
... |
Python | UTF-8 | 1,904 | 4.375 | 4 | [] | no_license | '''Program 3 - Consider the marks of 5 subjects obtained from user input.
Calculate the grade based on the criteria: >=90-A, >=80-B, >=70-C, >=60-D, >=50-E, <50-F.
Perform necessary validations on marks such as negative marks, non-numeric marks.
Finally display student name, rollno, total marks and grade.
Implement... |
Java | UTF-8 | 427 | 1.804688 | 2 | [] | no_license | package org.sqlbuilder.sl;
import org.sqlbuilder.common.DeSerialize;
import org.sqlbuilder.common.Resolver;
import org.sqlbuilder2.ser.Pair;
import java.io.File;
import java.io.IOException;
public class PbRoleResolver extends Resolver<Pair<String, String>, Pair<Integer, Integer>>
{
public PbRoleResolver(final Strin... |
Java | UTF-8 | 9,441 | 1.828125 | 2 | [] | no_license | package com.shtoone.shtw.activity.base;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;
import com.andro... |
Java | UTF-8 | 293 | 1.617188 | 2 | [] | no_license | package eetac.upc.edu.ea.yifeige.ejercicio.Ejercicio_Api;
public class MediaType
{
public final static String EJERCICIO_API_USER="application/vnd.ejercicio.Ejercicio_Api.user+json";
public final static String EJERCICIO_API_MESSAGE="application/vnd.ejercicio.Ejercicio_Api.message+json";
}
|
Java | UTF-8 | 1,456 | 2.078125 | 2 | [] | no_license | package com.example.dateme;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class Feed extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
s... |
Java | UTF-8 | 4,250 | 2.46875 | 2 | [] | no_license | package com.softlib.imatch.common;
import java.io.File;
import java.sql.SQLException;
import org.apache.commons.collections.ArrayStack;
import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import com.softlib.im... |
Ruby | UTF-8 | 906 | 2.8125 | 3 | [] | no_license | # frozen_string_literal: true
require 'translator'
describe Translator do
let(:translator) { Translator.new }
describe '#get_file_as_string' do
it 'turns a log file into a string' do
expect(translator.get_file_as_string('test_file.log')).to eq("/home_page 814\n/about 345\n")
end
end
describe '#... |
Go | UTF-8 | 2,518 | 2.921875 | 3 | [
"MIT"
] | permissive | package main
func init() {
addSolutions(12, problem12)
}
func problem12(ctx *problemContext) {
pos := []ivec3{
{1, 2, -9},
{-1, -9, -4},
{17, 6, 8},
{12, 4, 2},
}
vel := make([]ivec3, 4)
ctx.reportLoad()
m := moons{
pos: append([]ivec3(nil), pos...),
vel: append([]ivec3(nil), vel...),
}
for i := ... |
Python | UTF-8 | 3,978 | 3.515625 | 4 | [] | no_license | # KRUSKAL ALGHORITM
# Used to find the minimum spanning tree -> the tree (graph with no loop) that realizes an hamiltoniam graph on a loop one
# It works considering only edge of graph, since all nodes will be covered (hamiltonian graph)
from Graph_and_Trees.tree import *
from Graph_and_Trees.graph import *
def krusk... |
JavaScript | UTF-8 | 2,656 | 2.828125 | 3 | [] | no_license | import './../scss/vjslider.scss';
import Swipe from './swipe.js';
import Clones from './clones.js';
import Slider from './slider.js';
export default class VJSlider { // eslint-disable-line no-unused-vars
/**
* VJSlider constructor
* @param {HTMLElement} domElement
* @param {object} sliderOptions
... |
JavaScript | UTF-8 | 3,410 | 2.625 | 3 | [] | no_license | 'use strict';
const flash = require('express-flash');
const session = require('express-session');
const express = require('express');
const exphbs = require('express-handlebars');
const bodyParser = require('body-parser');
const greet = require('./greetMe');
const pg = require("pg");
const Pool = pg.Pool;
// should ... |
Python | UTF-8 | 902 | 3.328125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
# encoding: utf-8
from collections import deque
class FilterList(deque):
def __str__(self):
return str(list(self))
def __repr__(self):
return "%s(%r)" % (self.__class__.__name__, list(self))
def filter(self, func):
"""
Return a new FilterList which ... |
PHP | UTF-8 | 609 | 2.625 | 3 | [] | no_license | <?php
namespace App\EventListener;
use App\Entity\Article;
use Doctrine\ORM\Event\LifecycleEventArgs;
class ArticlePersistListener
{
/**
* Méthode qui sera appelée automatiquement à l'enregistrement d'un article
* grâce à un événement Doctrine
*
* @param Article $article
* @param Lifec... |
JavaScript | UTF-8 | 707 | 4.15625 | 4 | [] | no_license | "use strict";
//the below example specifically says this add function will always return a number
function addNumber(value1, value2) {
return value1 + value2;
}
//the below function uses void which means the function does not return any values
function printResult(sum) {
console.log('Sum:' + sum);
}
//the below... |
Markdown | UTF-8 | 2,669 | 4.09375 | 4 | [
"MIT"
] | permissive | #JavaScript Syntax
The principles by which sentences are constructed in a language.
## Variables
Things stored in the browser's memory
## Declaring Variables
var quantity
[var] is the variable keyword
[quantity] is the variable name
## Assigning Variables
var quantity = 3;
End all your statements in ;
; i... |
C++ | UTF-8 | 970 | 3.625 | 4 | [] | no_license | #include <iostream>
#include <stack>
#include <vector>
int main()
{
std::ios_base::sync_with_stdio(0);
std::cin.tie(0);
int n;
std::cin >> n;
std::stack<int> stack;
int i = 1;
std::vector<char> res;
for (int j = 0; j < n; j++)
{
int x;
std::cin >> x;
// stack에 x까지 1부터 안넣은 값들을 넣어준다.
while (i <= x)
... |
C++ | UTF-8 | 588 | 3.359375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <list>
using std::list;
using std::vector;
using std::cout;
using std::endl;
int main() {
list<int> l1{1, 2, 3, 4, 5};
vector<int> v2{1, 2, 3, 4, 5};
cout << (l1 == v2) << endl; //compilation error.
/* added:
what does this do?
vector<int>(l1.begin(),l1.end())
is th... |
C++ | UTF-8 | 6,378 | 2.734375 | 3 | [] | no_license | #include "../include/iputils.hpp"
#include <stddef.h>
namespace lib {
template<typename String, typename Char = typename String::value_type>
String do_get_ipv6_long_form(String short_address)
{
if (!short_address.empty() && short_address[0] == '[') {
if (short_address.back() != ']') {
return String();
}
sho... |
Java | UTF-8 | 1,101 | 2.96875 | 3 | [] | no_license | /*
*
*/
package tournoi;
/**
*
*/
public class ClassementJoueurs implements Comparable
{
private int numPoule = 0;
private int numJoueur = 0;
private int classement = 0;
public int getClassement()
{
return classement;
}
public int getNumJoueur()
{
return numJoueur;
}
public int getNumPoule()
{
r... |
Java | UTF-8 | 116 | 1.773438 | 2 | [] | no_license | package po;
import java.io.Serializable;
public enum Ordertype implements Serializable{
economical,normal,fast
}
|
Java | UTF-8 | 2,984 | 2.109375 | 2 | [] | no_license | package codingM.controller;
import java.io.IOException;
import java.util.HashMap;
import javax.servlet.ServletException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org... |
Python | UTF-8 | 1,669 | 2.890625 | 3 | [] | no_license | #!/usr/bin/python3
import csv
trener = ['', '','','','', '\\khis', '\\morev', '\\elis', '\\razor', '\\razzzzor', '\\tre', '\\gleb']
kur = ['\\olya','\\olya','\\olya','\\olya','\\olya', '\\olya', '\\olya', '\\olya', '\\sharich', '\\sharich', '\\sharich', '\\sharich']
with open('listm.csv','r') as f:
awards ... |
C# | UTF-8 | 3,759 | 2.65625 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using System.Linq;
using EFModels = maternity_benefits.Storage.EF.Models;
using esdc_simulation_base.Src.Classes;
using esdc_simulation_base.Src.Storage;
namespace maternity_benefits.Storage.EF.Store
{
public class MaternityBene... |
Python | UTF-8 | 392 | 2.828125 | 3 | [] | no_license | #!/bin/python3
import sys
# input = sys.stdin.readline
import math
if sys.platform =='ios':
sys.stdin=open('input1.txt')
def main():
n = list(map(int, input().strip().split()))[0]
s = [0] * n
for i in range(n):
s[i] = list(map(str, input().strip().split()))[0]
s = list(reversed(s))
result = 1
for i in rang... |
Python | UTF-8 | 88 | 3.1875 | 3 | [] | no_license | def sum(x, y):
return x + y
a = int(input(""))
b = int(input(""))
print(sum(a, b))
|
Java | UTF-8 | 517 | 1.992188 | 2 | [
"MIT"
] | permissive |
@Service
public class ROLEService extends BaseService {
@Autowired
private JdbcTemplate jdbcTemplate;
public List<Map> get(String userId) {
RoleMapper mapper = super.getSqlSession().getMapper(RoleMapper.class);
List<Map> right = mapper.get(userId);
return right;
}
pu... |
JavaScript | UTF-8 | 741 | 3 | 3 | [] | no_license | /**
* 의존성 배열을 입력하지 않는 대신
* 부수효과 함수 내에서 실행 시점을 조절할 수 있다.
* 함수의 실행 시점을 의존성 배열로 관리하지 않고, 부수 효과 함수 내에서 처리를 하면
* 이 부수효과 함수 안에서 사용하는 모든 변수는 최신화된 값을 참조하므로 안심할 수 있다.
* 이런 함수는 useCallback을 사용하지 않아도 된다.
*/
function Profile({ userId }) {
const [user, setUser] = useState();
async function fetchAndSetUser(needDetail) {
... |
Markdown | UTF-8 | 10,499 | 2.515625 | 3 | [] | no_license | ---
date: "2016-08-22T16:47:22-03:00"
tags:
- tag: Via-Campesina
- tag: presos-políticos
- tag: lutas-e-mobilizações
title: "“Não descansaremos enquanto não libertarmos todos os nossos presos políticos”, afirma Via Campesina"
support_line: "Em entrevista, Leandro Scalabrin, advogado popular do MAB, compartilha as... |
Python | UTF-8 | 3,044 | 3.890625 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 19 13:34:46 2018
@author: MrWormsy (AKA Antonin ROSA-MARTIN)
"""
from BinaryTree import BinaryNode
from BinaryTree import BinaryTree
def main():
"""
#Test de construction d'un ABR
n10 = BinaryTree.BinaryNode(10)
n9 = BinaryTree.... |
Java | UTF-8 | 2,939 | 2.15625 | 2 | [] | no_license | package com.bamin.woorder.order.presentation;
import com.bamin.woorder.common.exception.ParameterConditionException;
import com.bamin.woorder.common.utils.TypeUtils;
import com.bamin.woorder.order.dto.OrderConditionalRequestDto;
import org.springframework.core.MethodParameter;
import org.springframework.web.bind.suppo... |
Shell | UTF-8 | 2,245 | 4.3125 | 4 | [
"BSD-2-Clause"
] | permissive | #!/bin/bash
# This scripts builds the application. Be careful because it invalidates previous
# containers already stored in the docker server.
# It is designed to be a convenience wrapper to pass the right arguments to docker build,
# extracting them from the config file. It must be possible to perform the build anyw... |
C++ | UTF-8 | 7,194 | 2.875 | 3 | [] | no_license | #include "clipper.h"
#include <algorithm>
#include <iostream>
int counter = 0;
namespace rudolph {
using Point2D = geometry::Point2D;
int Clipper::region_code(Point2D p) {
int reg_code = 0;
if (p.x() < edge_left)
reg_code |= (int)RegionCode::LEFT;
else if (p.x() > edge_right)
reg_code |... |
Shell | UTF-8 | 7,921 | 2.828125 | 3 | [] | no_license | #!/bin/bash
sudo apt-get update -y
set -x
# Create Users
sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Prometheus Monitoring User" prometheus
sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Node Exporter User" node_exporter
sudo adduser --no-create-home --... |
Python | UTF-8 | 5,059 | 2.75 | 3 | [] | no_license | from __future__ import print_function # use python 3 syntax but make it compatible with python 2
from __future__ import division # ''
import csv
import easygopigo3 as easy
my_gopigo = easy.EasyGoPiGo3()
import time # import the time library for the sleep function
import gop... |
Java | UTF-8 | 1,480 | 2.265625 | 2 | [] | no_license | package com.gogglespace.framework.droid.db.entities;
import com.gogglespace.framework.droid.EntityAnnotation;
import com.gogglespace.framework.droid.EntityAttributeAnnotation;
import com.gogglespace.framework.droid.FieldType;
/**
* Entity class
* Created by Shahid Nawaz on 4/10/2015.
* @version 1.0
*/
... |
Java | UTF-8 | 727 | 1.742188 | 2 | [] | no_license | package sample;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import java.io.IOException;
public class SaveGameMenu {
@FXML
ImageView save ,dontsave;
@FXML
AnchorPane goBackPane;
@FXML
void tick() throws I... |
Java | UTF-8 | 965 | 3.5625 | 4 | [] | no_license | package com.coding.basic;
import java.lang.ArrayIndexOutOfBoundsException;
import java.util.EmptyStackException;
public class Stack {
private ArrayList elementData = new ArrayList();
public void push(Object o) {
elementData.add(o);
// System.out.println("size is " + elementData.size());
}
... |
JavaScript | UTF-8 | 8,502 | 2.921875 | 3 | [] | no_license | function createCube()
{
var tmp = {
vertexPositionBuffer : 0,
vertexTextureCoordBuffer : 0,
vertexIndexBuffer : 0
};
tmp.vertexPositionBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, tmp.vertexPositionBuffer);
vertices = [
// Front face
-1.0, -1.0, 1.0,
1.0, -1.0, 1.0,
1.0... |
Java | UTF-8 | 7,738 | 1.992188 | 2 | [] | no_license | package co.edu.usbcali.modelo;
// Generated 21-feb-2014 23:07:19 by Zathura powered by Hibernate Tools 3.2.4.GA
import java.util.Date;
/**
* ItemRotacion generated by Zathura powered by Hibernate-tools(hbm2java)
*/
public class ItemRotacion implements java.io.Serializable {
private Long idItro;
private Document... |
Markdown | UTF-8 | 4,328 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | [//]: # (title: Content negotiation and serialization)
The [ContentNegotiation](https://api.ktor.io/ktor-server/ktor-server-core/ktor-server-core/io.ktor.features/-content-negotiation/index.html) plugin (previously known as feature) serves two primary purposes:
* Negotiating media types between the client and server. ... |
Python | UTF-8 | 285 | 3.15625 | 3 | [
"MIT"
] | permissive | class Solution(object):
def arrayPairSum(self, a):
"""
:type nums: List[int]
:rtype: int
"""
n = len(a)
a.sort()
ans = 0
for i in range(0,n,2):
ans += a[i]
return ans
ob1 = Solution()
print(ob1.arrayPairSum([1,4,3,2]))
|
Java | UTF-8 | 1,981 | 4.03125 | 4 | [] | no_license | public class BinarySearch<T extends Comparable<? super T>> {
/**
* 二分查找
* @param arr 传入的数组必须为有序数组
* @return
*/
public int binarySearch(T[] arr, T target){
int l = 0;
int r = arr.length-1;
while (l<=r){
int mid = l+(r-l)/2; //避免使用l+r ... |
Markdown | UTF-8 | 1,145 | 3.171875 | 3 | [] | no_license | # house-snake
INTRODUCTION
This is House Snake, a HTTP Basic Authentication Brute Forcing tool that I created using
Python, frustration, and a lot of swearing. In Theory it will use a list of username and a list of
passwords to brute force past a HTTP Basic Authentication login. I named it house snake for
two reasons... |
Java | UTF-8 | 2,393 | 3 | 3 | [] | no_license | package TestingData;
/***
* An entry for presenting
* protein 1 | protein 2 | their resistence
* for further use it contains attributes for index and fragment of the proteins and their rmsd value
* @author Oron
*
*/
public class TestingEntry
{
/**
* protein 1
* protein 2
*/
private int ... |
Java | UTF-8 | 839 | 3.484375 | 3 | [] | no_license | package com.github.devcat24.util.string;
import java.util.Arrays;
import java.util.List;
import java.util.StringJoiner;
import java.util.stream.Collectors;
public class StringManipulator {
public void stringJoinerEx01 (){
StringJoiner fruits = new StringJoiner(", ");
fruits.add("Apple");
f... |
C | UTF-8 | 1,743 | 2.53125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* moving.c :+: :+: :+: ... |
Java | UTF-8 | 8,182 | 1.59375 | 2 | [] | no_license | package com.jkrm.education.ui.activity.me;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.hzw.baselib.base.AwMvpActivity;
import com.hzw.baselib.util.AwData... |
PHP | UTF-8 | 13,603 | 2.828125 | 3 | [] | no_license | <?php
namespace Et;
abstract class Data_Validator_Abstract extends Object {
const ERR_NOT_DEFINED = "not_defined";
const ERR_EMPTY = "empty";
const ERR_INVALID_FORMAT = "invalid_format";
const ERR_INVALID_TYPE = "invalid_type";
const ERR_NOT_ALLOWED_VALUE = "not_allowed_value";
const ERR_OTHER = "other";
const ... |
Markdown | UTF-8 | 9,199 | 2.703125 | 3 | [] | no_license | 一〇九
关小刀这才连连打咳坐起,头晕目眩使他难挨,甩甩头,醒醒脑,耳根仍嗡嗡生疼,心头却带着欣慰,直道要命。若再靠近几丈,可能会七孔流血而死。
他想着,在如此威力之下,难道还有活命可能?然而再想及司徒昆仑一身能耐,他不敢停留,登时跌跌撞撞,退出秘洞。
出口处,门主夫人早等在那里,待认出小刀之后。她欣喜道:“封住他了?”
关小刀笑道:“差不多啦,多谢夫人帮忙,现在可封住出口啦!”
夫人正为此而来,遂要丫鬟丢下炸药,轰声再起,终把假山、秘道同时炸去,以绝后患。
关小刀另有任务待办,不敢多做停留,赶忙告别离去,直奔宫外街头一角。
在那里,早已围住层层人影,除了胡三爷、七绝剑... |
TypeScript | UTF-8 | 1,590 | 2.953125 | 3 | [] | no_license | import * as passport from 'passport';
import { RequestHandler } from 'express'; // you can use RequestHandler to strong type the function itself instead of every parameter
export const hasToken: RequestHandler = (req, res, next) => {
passport.authenticate('jwt', (err, user, info) => {
if (err) {
... |
Java | UTF-8 | 392 | 2.25 | 2 | [
"MIT"
] | permissive | package yaplstack;
import yaplstack.ast.Node;
public class CodeSegment {
public final int maxStackSize;
public final Instruction[] instructions;
public final Node source;
public CodeSegment(int maxStackSize, Instruction[] instructions, Node source) {
this.maxStackSize = maxStackSize;
... |
Java | UTF-8 | 10,711 | 1.890625 | 2 | [] | no_license | package com.haoche51.sales.net;
/**
* 接口action常量
* Created by xuhaibo on 15/8/25.
*/
public class HttpConstants {
public static final int GET_LIST_REFRESH = 5;//刷新
public static final int GET_LIST_LOADMORE = 6;//加载更多
public static final int REQUEST_PAGESIZE = 10;//page size
/**
* 登录action 带加密
*/
public sta... |
C# | UTF-8 | 3,178 | 2.53125 | 3 | [] | no_license | using System;
using System.Runtime.InteropServices;
namespace System.Runtime.Remoting.Metadata.W3cXsd2001
{
/// <summary>Wraps an XSD <see langword="anyURI" /> type.</summary>
// Token: 0x020007C1 RID: 1985
[ComVisible(true)]
[Serializable]
public sealed class SoapAnyUri : ISoapXsd
{
/// <summary>Gets the XML... |
Python | UTF-8 | 2,188 | 2.5625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Tests to check point-source on a sphere
"""
import os
try:
os.chdir('beamshapes/tests')
except:
pass
import unittest
import numpy as np
import pandas as pd
from beamshapes import point_source_on_a_sphere_directivity
from beamshapes.point_source_on_a_sphe... |
Java | UTF-8 | 1,072 | 4.03125 | 4 | [] | no_license | package ch02;
public class Member {
public static void main(String[] args) {
//변수 선언
//데이터의 타입 식별 이름
//데이터 타입 -> 내가 다루어야 하는 데이터의 특징에 의해서 결정
//기본형 타입 8가지 -> 정수형 ,실수형 ,boolean , 문자
String name = "도용성";
int age = 3;
double height = 130.5d;
float weight = 45.8f;
boolean hasBook = true;
//S... |
Java | UTF-8 | 1,274 | 3.328125 | 3 | [] | no_license | package thread2;
import java.util.Arrays;
public class Street {
private Weapon[] box;
private boolean valueSet = true;
private Truck truck;
public Street() {
this.truck = new Truck();
}
synchronized public Weapon[] getHeap() {
while (valueSet) {
try {
... |
Python | UTF-8 | 1,006 | 2.625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
import dataiter as di
# Same as for documentation.
di.PRINT_MAX_WIDTH = 72
def parse_price(price):
return int(float(price.lstrip("$").replace(",", "")))
data = (
di.read_csv("orig/listings.csv")
.select("id",
"neighbourhood_group_cleansed",
"zipcode",
... |
Ruby | UTF-8 | 1,759 | 2.59375 | 3 | [] | no_license | #encoding: utf-8
class Produit < ActiveRecord::Base
################################
# INFO
# Pour récupérer la liste des tags : produit.tags ça retourne un tableau de tags
################################
validates_presence_of :ref, :nom, :prix, :description, :descriptionCourte, :urlFichier
v... |
Markdown | UTF-8 | 433 | 2.921875 | 3 | [] | no_license | # Function development
### Problem Explain
[programers src](https://programmers.co.kr/learn/courses/30/lessons/42586)
### solution
Queue is consist of rest date for release.
```javascript
const queue = progresses.map((per, i) => {
let j = 1;
while (per + j * speeds[i] < 100) {
j += 1;
}
return j;
})... |
PHP | UTF-8 | 1,395 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Kerox\Fcm\Api;
use Kerox\Fcm\Model\Message;
use Kerox\Fcm\Request\SendRequest;
use Kerox\Fcm\Response\SendResponse;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\Response;
/**
* Class Send.
*/
class SendLog extends AbstractApi
{
private $logger;
p... |
JavaScript | UTF-8 | 2,280 | 3.5 | 4 | [
"Apache-2.0"
] | permissive | let colorlist=['#f849cc','red','#f48720','yellow','#0cc656','#37a6eb','#940bda'];
let sleep = function (ms) {
return new Promise(resolve => setTimeout(resolve, ms));
};
let normalizeColor = function (color) {
let normalizedColor = color;
let temporaryElement = document.createElement('p');
temporary... |
Markdown | UTF-8 | 11,344 | 3.03125 | 3 | [
"MIT"
] | permissive | [Source](http://weblogs.asp.net/jongalloway//working-around-a-powershell-call-depth-disaster-with-trampolines "Permalink to Jon Galloway - Working around a Powershell Call Depth Disaster With Trampolines")
# Jon Galloway - Working around a Powershell Call Depth Disaster With Trampolines
[I just posted about an update... |
Java | UTF-8 | 4,648 | 2.5625 | 3 | [] | no_license | package services;
import dto.allotmentUser.AllotmentDto;
import dto.allotmentUser.UserAllotmentDto;
import model.dao.AllotmentRepositoryDAO;
import model.dao.AllotmentUserRepositoryDAO;
import model.entity.Allotment;
import model.entity.AllotmentUser;
import model.entity.User;
import org.springframework.beans.factory.... |
Java | UTF-8 | 993 | 3.09375 | 3 | [] | no_license | package algorithm.thread;
import org.junit.Test;
import java.util.ArrayList;
import java.util.concurrent.locks.LockSupport;
/**
* @author lsh
* @date 2023/6/20 20:16
* todo 复习
*/
public class PrintTest {
int start = 0;
ArrayList<Thread> list = new ArrayList<>();
@Test
public void test() throws Interrup... |
C# | UTF-8 | 2,224 | 2.59375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace safefunction
{
public partial class installForm : Form
... |
Swift | UTF-8 | 1,628 | 2.671875 | 3 | [] | no_license | //
// MaaSConfiguration.swift
// Carnival
//
// Created by Gabriel Morales on 10/19/17.
// Copyright © 2017 Phunware. All rights reserved.
//
import Foundation
import PWLocation
import PWMapKit
protocol MaaSConfigurable:class, Equatable {
var appID: String! { get set }
var accessKey: String! { get set }
... |
JavaScript | UTF-8 | 1,752 | 3 | 3 | [
"MIT"
] | permissive | import {Style} from "./Style";
import {GradientStyle} from "./GradientStyle";
import {Vector2} from "../../math/Vector2";
/**
* Linear gradient style, represents a gradient of colors from a point to another interpolating in between.
*
* Behind the of the two points used the color is solid.
*
* The get method retu... |
Python | UTF-8 | 600 | 2.875 | 3 | [
"MIT"
] | permissive |
#calss header
class _DIGITAL():
def __init__(self,):
self.name = "DIGITAL"
self.definitions = [u'recording or storing information as series of the numbers 1 and 0, to show that a signal is present or absent: ', u'using or relating to digital signals and computer technology : ', u'showing information in the form... |
Markdown | UTF-8 | 1,425 | 2.515625 | 3 | [] | no_license | # Productvisie RTL
Na een eerste gesprek met Vicky van der Spoel \(werknemer RTL Live Entertainment\), heeft zij laten weten wat haar productvisie is over het nieuwe platform van Healthy Fest.
**Oplossing RTL**
RTL heeft het plan om Healthy Fest groter te maken. In 2018 heeft Healthy Fest twee nieuwe evenementen b... |
C# | UTF-8 | 3,168 | 2.578125 | 3 | [] | no_license | using DotNetty.Codecs.Http;
using DotNetty.Transport.Channels;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
namespace EasyOperate.Web.DotNetty.Factory
{
public clas... |
Java | UTF-8 | 3,098 | 2.46875 | 2 | [
"Apache-2.0"
] | permissive | package org.rabix.common.json;
import java.io.File;
import java.io.IOException;
import org.rabix.common.helper.JSONHelper;
import org.rabix.common.json.processor.BeanProcessor;
import org.rabix.common.json.processor.BeanProcessorException;
import org.rabix.common.json.processor.BeanProcessorFactory;
import org.slf4j.... |
Java | UTF-8 | 1,370 | 2.015625 | 2 | [] | no_license | package com.incomm.vms.fileprocess.model;
import org.springframework.data.redis.core.RedisHash;
import org.springframework.data.redis.core.index.Indexed;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Tab... |
Java | UTF-8 | 675 | 1.914063 | 2 | [] | no_license | package com.douzone.df.payload;
public class ReportConverterRequest {
private String state;
private String content;
private Long id;
private String description;
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = descriptio... |
JavaScript | UTF-8 | 4,481 | 2.984375 | 3 | [
"MIT"
] | permissive | const { concat, difference, filter, flatMap, has, isArray, isEqual, isNumber, isObject, now, random, sampleSize, sortBy, shuffle } = require('lodash');
const uuid = require('uuid');
class Captcha {
constructor() {
this.captcha = {};
this.options = {
dataset: null,
expires: 1000 * 60,
solveI... |
C | UTF-8 | 696 | 3.390625 | 3 | [] | no_license | #include <stdio.h>
#include<conio.h>
float pxHoocner(float a[], int n, float c) {
float p = a[0];
for (int i = 1; i <= n; i++) p = p * c + a[i];
return p;
}
void NhapMang(float a[], int n) {
printf("Nhap cac he so cua p(x) : ");
for (int i = 0; i <= n; i++) {
scanf("%f", &a[i]);
}
}
int main()
{
int n;
float... |
Java | UTF-8 | 3,520 | 2.390625 | 2 | [] | no_license | package ar.edu.unlam.tallerweb1.servicios;
import java.util.List;
import javax.inject.Inject;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import ar.edu.unlam.tallerweb1.dao.JugadorDao;
import ar.edu.unlam.tallerweb1.modelo.Amonestacion;
import ar.e... |
PHP | UTF-8 | 687 | 3.171875 | 3 | [] | no_license | <?php
include_once ('OOPHPClass.php');
define('BR', '<' . 'BR' . '>');
echo 'TESTING OOPHPClass' . BR;
echo BR;
echo 'test 1 - create a class' . BR;
$classOne = new OOPHPClass();
echo 'default name: ' . $classOne -> getName();
echo BR;
$classOne -> setName("Harold");
echo 'name after set: ' . $classOne -> getName()... |
C | UTF-8 | 1,294 | 3.265625 | 3 | [] | no_license | #include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <wait.h>
#define VALUE_PID_FOR_CHILD_PROCESS 0
void Print_Identifier_Parent_And_Child_Process()
{
pid_t temp_pid = getpid();
pid_t temp_ppid = getppid();
printf("PPID == %d PID == %d\n", temp_ppid, temp_pid);
}
int main()
{
pid_t pid_two;
pi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.