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
JavaScript
UTF-8
573
3.328125
3
[]
no_license
function Mostrar() { alert('iteración while'); var contador = 0; /* Manera erronea if(contador < 10){ alert("manzana " + contador); contador = contador + 1; } if(contador < 10){ alert("poroto " + contador); contador = contador + 1; } */ //while(contador < 3){ while(1){ // 1 es lo mismo que true...
PHP
UTF-8
710
2.53125
3
[]
no_license
<?php require 'connectdb.php'; $name = $_REQUEST['name']; $district = $_REQUEST['district']; $address = $_REQUEST['address']; $id = $_REQUEST['id']; $city = $_REQUEST['city']; $zip = $_REQUEST['zip']; $state = $_REQUEST['state']; $sql = "update Schools set schoolname='$name', district = '$district', address = '$addre...
Java
UTF-8
731
2.5625
3
[]
no_license
package Commands; public class GetAkkCommand implements Command { private static final String CACHE_NAME = "AkkCommand"; @Override public Object execute() { if (CacheDatabase.getCache(CACHE_NAME) == null || CacheDatabase.getCache(CACHE_NAME).getCache() == null) { String message = "---...
TypeScript
UTF-8
929
2.515625
3
[]
no_license
import { apiBase } from '../serviceFramework/apiBase'; import { Status } from '../interface/Status'; const axios = require('axios'); export class puppyApi extends apiBase { constructor() { super(); } public async getRecipesList(ingredientList: string[]): Promise<any> { try { i...
C++
UTF-8
1,325
3.0625
3
[]
no_license
/** @file beta_instance.cpp @author Benjamin Godin @date 2019-02-14 @version 1.0.0 @note Developed for C++17 @breif implementation of BetaInstance */ #include "beta_instance.hpp" using namespace std; BetaInstance::BetaInstance(BetaClass * clas, std::list<Variable::pointer_type> data) { clas_ = clas; // add cl...
C#
UTF-8
7,780
3.015625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Runtime.Serialization; using System.Xml.Serialization; using System.Runtime.Serialization.Formatters.Binary; using System.IO; namespace program1 { class MyException : Exception { ...
C++
GB18030
2,260
3.578125
4
[]
no_license
#include <iostream> #include <iomanip> #include <cstdlib> #include "3-1.h" using namespace std; int main() { int row, column, key; cout << "ά" << endl; cout << "" << endl; cin >> row; cout << "" << endl; cin >> column; cout << "鿴 ʵorʵ֣(ʵּ1ʵּ2)" << endl; cin >> key; if (key == 1) func1(row, column); else func...
C#
UTF-8
3,894
2.53125
3
[]
no_license
using CapiSample.CommonClasses; using CapiSample.Interfaces; using System; using System.IO; namespace CapiSample.FormSix.SectionTwo { internal class RentPaymentQuestion : BaseControl<AnswerData>, IControl { public RentPaymentQuestion(string connection) : base(connection) { } public void Execu...
Java
UTF-8
486
3.1875
3
[]
no_license
package day11abstract.door; /** * 智能门类 * */ public class AiDoor extends AbstractDoor implements IFace { @Override public boolean faceRecogition() { return true; } @Override public void openDoor() { if (faceRecogition()){ System.out.println("门已开"); }else{ ...
Python
UTF-8
4,796
2.5625
3
[ "MIT" ]
permissive
#!/usr/bin/env python ## Message Queue Abstraction import pika import uuid import sys import logging logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.CRITICAL) class MessageQueue(object): def __init__(self, node_name, # the name of node user_id="guest", # the user ...
Java
UTF-8
3,507
2.46875
2
[]
no_license
package com.example.projek3; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; public class Main2Activity ext...
Java
UTF-8
2,800
2.953125
3
[]
no_license
package com.zuPadawan; import java.util.Calendar; import java.util.HashMap; import java.util.Map; public class PracticeRealStuff { public static String bmi(double weight, double height) { double bmi = Math.pow(height,2)/weight; if (bmi <= 18.5){ return "Underweight"; ...
C
GB18030
1,605
3.203125
3
[]
no_license
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> //#include<stdlib.h> /*int main() { int i = 0; scanf("%d", &i); printf("i = %d\n", i); system("pause"); return 0; }*/ /*int main(void) { int i = 0; printf(""); scanf("%d", &i); printf("i = %d\n", i); system("pause"); return 0; }*/ /*int main(v...
TypeScript
UTF-8
652
3.03125
3
[]
no_license
import longestCommonPrefix from "../src/d01-longest-common-prefix"; test("longestCommonPrefix", () => { let l = [ { in: ["flower", "flow", "flight"], expected: "fl", }, { in: ["dog", "racecar", "car"], expected: "", }, { in: [], expected: "", }, { ...
Python
UTF-8
881
2.8125
3
[]
no_license
import requests import cv2 import os import sys import json image_path = sys.argv[1] url = "http://localhost:5000/detect" image = cv2.imread(image_path) payload = {"input": open(image_path, "rb")} response = requests.post(url, files=payload).json() # print "Face Present: " + str(response["face_present"]) # print "...
C#
UTF-8
968
2.578125
3
[]
no_license
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Life : MonoBehaviour { public float Speed = 12.0f; private float _finalScale; private float _maxScale = 5.4f; private Vector3 _tempScale; private bool _increase; void Start() { _tempScale = transform.localScale; ...
Java
UTF-8
198
1.6875
2
[]
no_license
package br.com.involves.selecao.excecao; public class ConstantesExcecao { public static final String COMANDO_INVALIDO = "Comando enviado não corresponde ao comando de filtrar propriedade!"; }
Java
UTF-8
279
2.328125
2
[]
no_license
package com.stk.controller.test; public class Test { public static void main(String[] args) { int[] arr=new int[]{3,1,7,9,8}; int [] index=new int[]{1,0,1,1,2,2,1,1,3,4,2}; String tel=""; for(int i:index){ tel+=arr[i]; } System.err.println("电话:"+tel); } }
C#
UTF-8
5,673
2.78125
3
[]
no_license
using System; using System.Collections.Generic; using System.IO; using MySql.Data.MySqlClient; namespace Geldautomat { class ContainerData { List<Container> ContainerList = new(); public BankNote SmallestNote { get { return ContainerList[^1].ContentType; } } ...
Java
UTF-8
5,360
2.546875
3
[]
no_license
package view; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import javax.swing.GroupLayout; import javax.swing.GroupLayout.Alignment; import java.awt.Color; import java.awt.EventQueue; import javax.swing.border.TitledBorder; import controller.KhachHangController; import...
C#
UTF-8
2,408
3.203125
3
[]
no_license
using Dapper; using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Windows.Forms; namespace DapperDemo { public class DataAccess { /// <summary> /// Connects to database and search for last names according to given text in form "lastName...
PHP
UTF-8
976
2.671875
3
[]
no_license
<?php require("../assets/db.php"); session_start(); //Recuperer les POST $pseudo = !empty($_POST['pseudo']) ? trim($_POST['pseudo']) : null; $email = !empty($_POST['email']) ? trim($_POST['email']) : null; $pass = !empty($_POST['password']) ? trim($_POST['password']) : null; $sql = "SELECT * FR...
Java
UTF-8
1,092
2.828125
3
[]
no_license
package avaliacao.importar; import java.util.HashMap; import java.util.Map; import avaliacao.entidade.Biblioteca; import avaliacao.entidade.Livro; public enum Elemento { LIVRO("http://www.biblioteca.com.br/livro") { @Override public void adicionarLivro(Biblioteca biblioteca, Livro livro) {} }, AUTOR("http:/...
PHP
UTF-8
1,085
2.765625
3
[]
no_license
<?php session_start(); /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ $eventid = (int) $_GET["id"]; $hostname='localhost'; $username='root'; $password=''; $dbh = ''; try { $d...
Java
UTF-8
657
2.46875
2
[]
no_license
package testNG; import org.testng.annotations.Test; public class groupingmethod { @Test(groups= {"apple"}) public void apple1(){ System.out.println("apple1 print"); } @Test(groups= {"apple"}) public void apple2(){ System.out.println("apple2 print"); } @Test(groups= {"vivo"}) public void vi...
SQL
UTF-8
219
3.328125
3
[]
no_license
--12)Find user who left both rating and comment? select m.fullname from member m inner join rating r on m.member_id = r.member_id inner join comments c on m.member_id = c.member_id group by m.fullname
Python
UTF-8
661
3.296875
3
[]
no_license
"""Generating color swaths to train our network on.""" import numpy as np import random import matplotlib.pyplot as plt im_dim = 28 def generate_swath(rgb_vector): swath = np.zeros((im_dim, im_dim, 3)) for i in range(im_dim): for j in range(im_dim): swath[i][j] = rgb_vecto...
C#
UTF-8
266
3.015625
3
[]
no_license
using System; namespace _3.Sqrt { class Sqrt { static void Main() { Console.WriteLine("The square of 12345 is " + Math.Pow(12345,2)); Console.WriteLine("The square root is " + Math.Sqrt(12345)); } } }
Java
UTF-8
364
3.15625
3
[ "Apache-2.0" ]
permissive
package operators; public class BitWiseOperator { public static void main(String[] args) { // int a = 5; // int b = 6; // int c = a&b; // System.out.println(c); // int a = 12; int b = 2; // int c = a|b; // int c = b>>2; int c = b<<2; int d = 2<<b; System.out.println(c); ...
Python
UTF-8
3,562
2.578125
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jun 4 15:43:56 2020 @author: root https://saralgyaan.com/posts/python-realtime-plotting-matplotlib-tutorial-chapter-9-35-36/ """ import time import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation import requests,datetime,copy,...
Markdown
UTF-8
810
3.875
4
[]
no_license
# Mathematics ## Find Number of Digits in a Number - Given an integral number N. The task is to find the count of digits present in this number. - 2 Solutions 1 is O(digitscount) and other O(1) ```cpp // O(digitscount) #include <iostream> using namespace std; int main() { int num; cin >> num; int coun...
C
UTF-8
5,996
3.59375
4
[]
no_license
/* * Miguel Calderon * CSC 381 UNIX w/ C * Professor O'Rourke * Date: 11/19/19 * Last Modified 11/19/19 */ //Libraries #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> //Constants #define TRUE 1 #define FALSE 0 #define MAX_BITS 31 #define MAX_DIGITS 15 //Prototyp...
PHP
UTF-8
2,244
2.609375
3
[]
no_license
<?php namespace App\Http\Requests; use Illuminate\Http\JsonResponse; use App\Tournamentkings\Entities\Models\User; use Illuminate\Contracts\Validation\Validator; use Illuminate\Http\Exceptions\HttpResponseException; use App\TournamentKings\Entities\Data\PlatformNetworkType; class CreateUserRequest extends BaseAPIReq...
Markdown
UTF-8
8,354
2.765625
3
[ "MIT" ]
permissive
## Sku 商品购买组件 ### 使用指南 ```javascript import { Sku } from 'healen-x-ui'; Vue.use(Sku); ``` ### 代码演示 #### 基础用法 ```html <x-sku v-model="showBase" :sku="sku" :goods="goods" :goods-id="goodsId" :hide-stock="sku.hide_stock" :quota="quota" :quota-used="quotaUsed" :reset-stepper-on-hide="resetStepperOnHide"...
Java
UTF-8
2,749
3.6875
4
[]
no_license
package uebungen.uebung5_nochmal; import java.util.Random; public class Uebung5 { public static int throwDice() { Random r = new Random(); int wurf = r.nextInt(6) + 1; return wurf; } public static void printThrow(int cast) { String s = String.format("Es wurde eine %d gewuerfelt.", cast); System.out.p...
Python
UTF-8
2,099
2.609375
3
[ "MIT" ]
permissive
#! /usr/bin/python # coding = utf-8 import os import sys import binhex import json class ReadDict: def __init__(self, file_dir): self.file_dir = file_dir def read_from_json(self, mode='r'): dic = {} with open(self.file_dir, mode) as fp: dic = fp.read() dic =...
C++
UTF-8
3,085
2.875
3
[]
no_license
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Contact.cpp :+: :+: :+: ...
C
UTF-8
4,064
2.703125
3
[]
no_license
#ifndef REACTOR_CODE_SNIPPETS_H #define REACTOR_CODE_SNIPPETS_H #define rb_b_ary_each_index(ary, name) for (int name = 0; name < NUM2INT(rb_f_size(ary)); name++) /// @brief Calls the to_s method. /// @param[in] obj Object to use. #define rb_f_to_s(obj) rb_funcall_0(obj, "to_s") /// @brief Calls the to_sym method. ///...
Ruby
UTF-8
102
2.796875
3
[]
no_license
n, a = gets.chomp.split.map(&:to_f) x = gets.chomp.split.map(&:to_i) puts x.sum/n == a ? 'YES' : 'NO'
PHP
UTF-8
5,087
2.53125
3
[]
no_license
<?php /** * $URL: svn://svn.subversion.ru/usr/local/svn/mzz/branches/orm/system/mapper.php $ * * MZZ Content Management System (c) 2005-2009 * Website : http://www.mzz.ru * * This program is free software and released under * the GNU/GPL License (See /docs/GPL.txt). * * @link http://www.mzz.ru * @version $Id:...
TypeScript
UTF-8
1,715
3.28125
3
[ "MIT" ]
permissive
export type Transform = [ number, number, number, number, number, number ]; export function transform(dest: Transform, src: Transform): void; export function transform(dest: Transform, a: number, b: number, c: number, d: number, e: number, f: number): void; export f...
Markdown
UTF-8
1,556
2.96875
3
[]
no_license
# Presentation Python / Pandas Talk sur la base de la manipulation / traitement de données en python * présentation de pandas * utilisation pour manipuler et nettoyer des timeseries ## Utilisation * pour lancer le notebook : `jupyter notebook` * pour voir la présentation statique : * accessible ici : http://fal...
Swift
UTF-8
670
3.71875
4
[]
no_license
struct Position { let x: Int let y: Int init(x: Int, y: Int) { self.x = x self.y = y } } class Point { var asteroid: Bool var position: Position init(asteroid: Bool, position: Position) { self.asteroid = asteroid self.position = position } } struct Grid { var grid: [[Point]] = [] func printG...
Java
UTF-8
2,966
2.4375
2
[]
no_license
package com.example.jpa.controller; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframew...
JavaScript
UTF-8
1,585
2.703125
3
[]
no_license
import {useEffect, useState} from "react"; import api from "../helpers/axiosInstance"; import { useParams } from 'react-router-dom'; import CommentForm from "../components/CommentForm"; function Post() { const {postId} = useParams(); const [post, setPost] = useState(''); const [comments, setComments] = useState([...
Markdown
UTF-8
1,540
3.078125
3
[]
no_license
# Face-Social-Attributes-Scoring-by-SVM How do we measure the social dimensions of faces in political elections and social networks? Face Social Attribute Scoring by SVM Objective: This project is an exercise for studying the social attributes of human faces using Support Vector Machines. We have collected a set of...
Python
UTF-8
2,243
2.984375
3
[]
no_license
#!/usr/bin/env python import rospy from geometry_msgs.msg import Twist from turtlesim.msg import Pose import numpy as np is_init_pose = False is_init_degree = False turnCCW = False initPose = [] currentPose = [] turtleVelX = 0.75 turtleAngZ = 0.5 squareDist = 2.0 status = "" def poseReceived(position_data): #call...
C
UTF-8
185
2.984375
3
[]
no_license
factorial(int n); void main(){ int s; s=factorial(6); printf("%d",s); getch(); } factorial(int n){ int f; if(n==1){ return 1; } else{ n*factorial(n-1); } return f; }
JavaScript
UTF-8
723
2.8125
3
[]
no_license
const Engine = Matter.Engine; const World = Matter.World; const Bodies = Matter.Bodies; const Body = Matter.Body; var engine, world; var ground, ball,wall1,wall2,wall3; var ballBody function setup() { var canvas = createCanvas(800, 700); engine = Engine.create(); world = engine.world; //Create the Bodies He...
Java
UTF-8
4,550
1.984375
2
[ "Apache-2.0" ]
permissive
package io.github.cloudiator.rest.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.github.cloudiator.rest.model.DataSink; import io.github.cloudiator.rest.model.MonitoringTarget; import io.github.cloudiator.rest.model....
PHP
UTF-8
408
2.59375
3
[]
no_license
<table> <tr> <th>Title</th> <th>Location</th> <th>Date</th> </tr> <?php foreach ($events as $event) : ?> <tr> <td><a href=<?= "/admin/events?q=".$event->EventId ?>><?= $event->Title ?></a></td> <td><?= $event->Location ?></td> <td><?= date(...
Swift
UTF-8
3,686
3.1875
3
[]
no_license
// // AlertController.swift // GenericDemo // // Created by Knoxpo MacBook Pro on 24/03/21. // import SwiftUI struct AlertController: UIViewControllerRepresentable { @Binding var textString: String @Binding var showAlert: Bool var title: String var message: String func ...
JavaScript
UTF-8
1,049
3.796875
4
[]
no_license
/** * Definition for a binary tree node. * function TreeNode(val) { * this.val = val; * this.left = this.right = null; * } */ /** * @param {number[]} nums * @return {TreeNode} */ var sortedArrayToBST = function (nums) { return dfs(0, nums.length - 1); function dfs(start, end) { if (sta...
Shell
UTF-8
3,302
3.84375
4
[]
no_license
#!/bin/bash # github的客户端开发环境安装配置脚本(解决繁琐的github客户端手动配置问题) # curl https://bxjs.github.io/cmd_setup_mac_github.sh | sh -s -- -u 老储 -m 2903710916@qq.com # 更新github的ssh的本地配置密钥,-u更改为自己的昵称,-m更改为自己的github注册邮箱。 # ------------------- # git 改文件名大小写无法手动更改,需要用这个命令修改,git才能进行版本管理 #用法提示 usage() { echo "Usage:" echo " cmd_s...
Python
UTF-8
1,289
2.625
3
[ "LicenseRef-scancode-cecill-b-en" ]
permissive
# -*- coding: utf-8 -*- """ This Python script is a typical example of a what someone who want to analysis TS/WEST database would do. This is the basic example on which the internal IRFM Python crash course is based on. This example is supposed to be run within the pylab mode, with all the pywed lib imported. @a...
JavaScript
UTF-8
2,341
2.828125
3
[ "MIT" ]
permissive
var Worker = require('./worker') /** * Tracks worker state across runs. */ function WorkerManager () { this._pollHandle = null this.workers = {} this.isPolling = false this.shouldShutdown = false } WorkerManager.prototype.registerWorker = function registerWorker (workerData) { if (this.workers[workerData....
Java
UTF-8
2,456
2.984375
3
[]
no_license
package wgqproject.demo.util; import com.csvreader.CsvWriter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.nio.charset.Charset; import java.util.Collection; import java.util.Iterator; public class CSVUtil { private static fi...
Python
UTF-8
7,094
2.984375
3
[]
no_license
import numpy as np import math as m import matplotlib.pyplot as plt import sys num_mesh = 21 #number of mesh points L= 0.6 #Length of the rod q = 1000000 #Source Term del_x=L/((num_mesh-1.0)) # mesh size (Delta_x) xmesh = np.zeros(num_mesh) ...
Shell
UTF-8
512
3.359375
3
[ "MIT" ]
permissive
#!/bin/bash # setAttack.abdmodule # AresBD # # Copyright (c) 2015 Stsosz Systems. All rights reserved. # Don't use this without permission. I'm not responsible # for any stupid stuff you do with AresBD. setAttack() { PS3=$attackprompt select opt in "${attackoptions[@]}" do case $opt in "Shell") ...
JavaScript
UTF-8
5,658
2.71875
3
[ "MIT" ]
permissive
const jwt = require("jsonwebtoken"); /** * option values: * - privateKey => "......" * - needAuthPaths => ["^/*"] * - needAuthPathsExcept => ["^/auth/*", "^/public/*"] * - expiresIn => 1 (millisecond) | 1ms (millisecond) | 1s (second) | 1m (minute) | 1h (hour) | 1d (day) | 1w (week) | 1y (year) * - algorithm => ...
C
UTF-8
509
3.171875
3
[]
no_license
#include<stdio.h> #include<stdlib.h> int main() { float nota1, nota2, mediaPond; printf("MEDIA PONDERADA ENTRE DUAS NOTAS"); printf("\nDigite a primeira nota: "); scanf("%f", &nota1); printf("Digite a segunda nota: "); scanf("%f", &nota2); mediaPond = (nota1*0.3)+(nota2*0,7)/1; printf("\n====...
Ruby
UTF-8
257
3.890625
4
[]
no_license
#!/usr/bin/ruby # Bob exercise class Bob def hey(what) what.strip! return 'Woah, chill out!' if what==what.upcase && what!=what.downcase return 'Sure.' if what[-1]=='?' return 'Fine. Be that way!' if what.empty? 'Whatever.' end end
C
UTF-8
13,239
2.609375
3
[ "Zlib", "LicenseRef-scancode-unknown-license-reference" ]
permissive
#include "common.h" #include "value.h" #include "vm.h" #include "fruity.h" #include <gc/gc.h> #include <stdarg.h> void* fpAlloc(u32 size) { return GC_MALLOC(size); } void* fpAllocData(u32 size) { return GC_MALLOC_ATOMIC(size); } bool fpRequire(VM* vm, const char* sig) { assert(0 && "deprecated"); #if 0 ...
PHP
UTF-8
10,549
2.6875
3
[ "MIT" ]
permissive
<?php namespace TheLion\OutoftheBox; class Thumbnail { /** * @var App */ private $_app; /** * @var \Kunnu\Dropbox\Dropbox */ private $_client; /** * @var Processor */ private $_processor; /** * @var Entry */ private $_entry; /** * @v...
C++
UTF-8
8,713
2.671875
3
[]
no_license
#include "Material.h" #include <fstream> #include <cmath> #include "GraphicsController.h" #include <Windows.h> #include <iostream> void RenderPass::LoadVS(std::wstring filename, std::string entry, D3D11_INPUT_ELEMENT_DESC* inputDesc, int numElements) { if (vs != nullptr) vs->Release(); ID3D10Blob *buff = nullptr,...
JavaScript
UTF-8
1,380
3.34375
3
[]
no_license
/** * # Table * * */ var containerRef = document.getElementById('container'); getData(function (error, rows) { if (error) { console.error(error); return alert('Error occoured :('); } var table = document.createElement('table'); var thead = table.createTHead(); var tbody = table.createTBody(); ...
C#
UTF-8
3,833
2.703125
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; using Formularios.Libreria; namespace Facultad.Formulario.Consola { public partial class Form1 : For...
C
UTF-8
628
4.09375
4
[ "MIT" ]
permissive
#include <stdlib.h> #include <time.h> #include <stdio.h> /** * main - Check sign on int * * Return: 0 */ int main(void) { int n; int lastone; /*Generating a random number*/ srand(time(0)); n = rand() - RAND_MAX / 2; /*print the last digit of the number stored in the variable n*/ lastone = n % 10; if (lastone >...
Ruby
UTF-8
1,871
3.109375
3
[ "MIT" ]
permissive
module Furigana module Formatter class Base SURFACE_FORM, READING = 0, 1 def initialize(text, kanji_tokens) @text = text @kanji_tokens = kanji_tokens end def render reset @text.each_char do |char| if no_more_kanji_tokens? @new_text +...
Python
UTF-8
3,980
2.546875
3
[]
no_license
#!/usr/bin/env python import roslib import io roslib.load_manifest('serial_comm') import rospy import serial import math import time from IRIS_msgs.msg import RobotCommandStamped from IRIS_msgs.msg import RobotStatusStamped from sensor_msgs.msg import Joy from std_msgs.msg import Bool ''' This is is mainly to test ser...
PHP
UTF-8
538
2.640625
3
[]
no_license
<?php require 'Mail.php'; if(!isset($_POST['name']) || !isset($_POST['email']) ){ die('Access Denied'); }else{ $Nome = $_POST["name"]; $Email = $_POST["email"]; $Mensagem = $_POST["message"]; } $mailer = new Mail(); $mensagem = "Nome: $Nome\n\nE-mail: $Email\n\nMensagem: $Mensagem\n"; if ($mailer->send('jcra...
Swift
UTF-8
2,912
3
3
[ "MIT" ]
permissive
// // LoginStateTranslator.swift // LoginRedux // // Created by GIB on 7/28/18. // Copyright © 2018 Xmen. All rights reserved. // import Foundation class LoginStateTranslator { // MARK:- Public Properties var usernameErrorHidden: Bool var passwordErrorHidden: Bool var usernameErrorText: Strin...
Markdown
UTF-8
1,799
2.546875
3
[]
no_license
<!--1630456262000--> [金价因美元疲软上涨 市场等待8月非农就业数据](https://cn.reuters.com/article/global-precious-0831-tues-idCNKBS2FX29Z) ------ <div><i>2021-09-01T00:27:46Z</i></div><p>路透8月31日 - 金价周二因美元走软而上扬,但涨幅放缓,因部分投资者在美国8月非农就业数据本周晚些时候公布前持观望态度。</p><p>1801 GMT,现货金上涨0.2%,报每盎司1,814.42美元,周一创下1,822.92美元的8月4日以来最高。美国期金收涨0.3%,报每盎司1,818.1美元。</...
JavaScript
UTF-8
266
3.375
3
[]
no_license
let div = document.querySelector('#main'); let url = 'http://localhost:3000/data'; fetch(url) .then( response => response.json()) .then( data => { div.innerHTML = Object.entries(data); }) .catch( error => div.innerHTML = `There was an error: ${error}`);
C++
UTF-8
9,671
2.828125
3
[ "CC0-1.0" ]
permissive
#pragma once #include<windows.h> #include<cassert> #include<iostream> #include<string> #include <Windows.h> #include<fstream> #include <cwchar> #include<atlstr.h> #include<vector> #include<cmath> #include<fcntl.h> #include<io.h> #define NOMINMAX #define WIN32_LEAN_AND_MEAN //#define _WIN32_WINNT 0x0500 using namesp...
C++
UTF-8
1,910
2.75
3
[]
no_license
#include "maincrypt.h" #include "ui_maincrypt.h" #include "crypt_class.h" #include "RSA_key.h" QString MainCrypt::encrypted; MainCrypt::MainCrypt(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainCrypt) { ui->setupUi(this); } MainCrypt::~MainCrypt() { delete ui; } /** * @brief MainCrypt::on_pu...
Java
UTF-8
5,830
2.671875
3
[]
no_license
// // Copyright (c) 2003,2004 , Caltha - Gajda, Krzewski, Mach, Potempski Sp.J. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the ...
Java
UTF-8
584
1.546875
2
[]
no_license
package com.zhys.admin; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.netflix.zuul.EnableZuulServer; /** * zhys 服务治理service * @Author: d...
Java
UTF-8
949
3.546875
4
[]
no_license
package Domain; public class Order { private final int idOrder; private final Computer[] computers; private static int orderCounter; private int computerCounter; private static final int MAX_COMPUTER=10; public Order(){ this.idOrder=++Order.orderCounter; this.computers = new C...
Markdown
UTF-8
2,428
2.890625
3
[]
no_license
======================================================================================================================================== Getting and Cleaning Data Course Project on wearable computing data analysis from the accelerometers of the Samsung Galaxy S smartphone ===============================================...
Java
UTF-8
1,511
2.078125
2
[]
no_license
package sgh.mansilla.modelo.negocio.facturacion.Abm; import java.util.List; import javax.transaction.Transactional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.fact...
C++
UTF-8
390
2.703125
3
[]
no_license
#include <type_traits> template <class T> using is_scoped_enum = std::integral_constant<bool, !std::is_convertible<T,int>{} && std::is_enum<T>{}>; enum e {}; enum class e2 {}; static_assert( is_scoped_enum<e2>::value, "" ); static_assert( !is_scoped_enum<e>::value, "...
Java
UTF-8
931
1.710938
2
[]
no_license
package com.baidu.mobads; import android.webkit.WebChromeClient; import android.webkit.WebView; import com.baidu.mobads.AppActivity.C1904a; /* renamed from: com.baidu.mobads.d */ class C1930d extends WebChromeClient { final /* synthetic */ C1904a f6767a; final /* synthetic */ AppActivity f6768b; C1930d(A...
Python
UTF-8
253
2.75
3
[]
no_license
import tensorflow as tf # argmax,取tensor里面最大的那个数 argmax_r = tf.argmax(tf.constant([[0.1,0.9,0.3],[0.0,0.2,0.8]]), 1) print(argmax_r) # equal equal_r = tf.equal(tf.constant([1, 2, 3, 4],1),tf.constant([1,1,1,1],1)) print(equal_r)
SQL
UTF-8
676
3.703125
4
[]
no_license
CREATE TABLE `user_block` ( `block_id` int(11) NOT NULL AUTO_INCREMENT, `blocking_user_id` varchar(50) NOT NULL, `blocked_user_id` varchar(50) NOT NULL, `block_created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`block_id`), UNIQUE KEY `block_user_combo1` (`blocking_user_id`,`blocked_user_...
Java
ISO-8859-13
5,720
2.65625
3
[]
no_license
package progetto.archiviato; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.Set; import progetto.data.Database; import progetto.data.schema.CaricaDatabaseSchema; import progetto.data.schema.DatabaseSchema; import progetto.data.schema.RelSchema; import pr...
JavaScript
UTF-8
1,405
3.96875
4
[]
no_license
function ArrayList() { this.array = [] ArrayList.prototype.swap = function(num1, num2) { var temp = this.array[num1] this.array[num1] =this.array[num2] this.array[num2] = temp } ArrayList.prototype.median = function(left, right) { //取出中间的数 var mid = Math.floor((left + right) / 2) if(t...
C++
UTF-8
7,113
2.5625
3
[]
no_license
#pragma once #include "stdafx.h" template<class puz_state, bool directed = true, bool shortest_paths_only = true, bool first_paths_only = true> class puz_solver_bfs { typedef boost::property<boost::vertex_color_t, boost::default_color_type, boost::property<boost::vertex_distance_t, unsigned int, b...
JavaScript
UTF-8
11,697
2.796875
3
[]
no_license
/* * SupaMind in JavaScript, html5, css3 * * This file is part of SupaMind * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) a...
Java
UTF-8
1,860
2.109375
2
[ "MIT" ]
permissive
package com.yitao.core.model; import javax.persistence.Entity; import javax.persistence.ManyToOne; import javax.ws.rs.FormParam; import com.fasterxml.jackson.annotation.JsonBackReference; @Entity public class Photo extends BaseModel { /** * */ private static final long serialVersionUID = -500640707400723...
Java
UTF-8
553
1.671875
2
[ "Apache-2.0", "MIT" ]
permissive
/* * Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. * * Copyright (c) 2020, Janssen Project */ package io.jans.fido2.client; import jakarta.ws.rs.GET; import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.Response; /** * The endpoint ...
Python
UTF-8
333
2.65625
3
[]
no_license
import sys [_,fai,window]=sys.argv window=int(window) with open(fai,'r') as f: for line in f: dat=line.split("\t") CHR=dat[0] END=int(dat[1]) i=1 while True: print(CHR+'\t'+str(i)+'\t'+str(i+window-1)) i+=window if i+window-1>=END: ...
TypeScript
UTF-8
704
2.890625
3
[ "BSD-3-Clause" ]
permissive
import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'buttonSelect' }) export class ButtonSelectTitleCasePipe implements PipeTransform { /** * @param value The string to transform to title case. */ transform(value: string): string { if (!value || typeof value !== 'string') { return ...
C++
UTF-8
444
3.046875
3
[]
no_license
/** * @file carta.h * @author Brizuela M, Morera B * @date 1 Noviembre 2016 * @brief Clase Carta. */ #ifndef Carta_H #define Carta_H /** @brief Clase Carta * * Clase posee dos constructores, uno que no posee parametros y otro que recibe como parametro el valor de la carta asignada; ademas un destructor. * */...
Markdown
UTF-8
1,357
2.71875
3
[ "Unlicense", "MIT" ]
permissive
--- ### CONTENT ### # The question you want to ask text: What is the main concern of your complaint? # The answer options and page name of destination associated with each answer # Add as many as you need. answers: - text: "My privacy rights were violated" path: question-3 - text: "I have not been given acces...
Python
UTF-8
16,929
2.546875
3
[ "MIT" ]
permissive
#!/usr/bin/env python # -*- coding: utf-8 -*- """ """ # | - Import Modules import os import re import numpy as np import pandas as pd from pathlib import Path import matplotlib.pyplot as plt # __| class PDOS_Plotting(): """ """ # | - PDOS_Plotting *********************************** def __ini...
C++
UTF-8
913
2.828125
3
[]
no_license
#include "Light.h" #include <string> const std::string Light::ambientStr = "ambient"; const std::string Light::diffuseStr = "diffuse"; const std::string Light::specularStr = "specular"; Light::Light() { ambient = glm::vec3(1); diffuse = glm::vec3(1); specular = glm::vec3(1); lightStr = "light"; } Light::~Light...
PHP
UTF-8
711
2.796875
3
[]
no_license
<?php namespace IrRegular\Itinerant\NodeAdapter; interface NodeAdapterInterface { /** * Get node (value+children) in the original shape, children unwrapped. * * @return mixed */ public function getNode(); /** * Get node value. * * @return mixed */ public functi...
C#
UTF-8
1,425
2.515625
3
[]
no_license
// // Copyright (c) NiazeRooz. All rights reserved. // using System; using System.Collections.Generic; using System.Linq; using System.Text; // // It is maybe Used For any class (View, Partial, ...) then // Add To Global System namespace (No Need Add reference in class header...) // namespace Sys...
C#
UTF-8
666
2.84375
3
[ "MIT" ]
permissive
using System; namespace Online_Shop.Models { public class AccountModel { public int ID { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string Nickname { get; set; } public string EmailAddress { get; set; } public st...