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 | 208 | 3.0625 | 3 | [] | no_license | #AAAABBBBCCDDD->A4B4C2D3
line='ABBCDDD'
list1=[]
for i in line:
x=line.count(i)
if i not in list1:
list1.append(i)
list1.append(x)
x=''
for i in list1:
x+=str(i)
print(x)
|
Java | UTF-8 | 370 | 2.859375 | 3 | [] | no_license | class Solution {
public int countPrimes(int n) {
if (n <= 1) {
return 0;
}
int count = 0;
for(int i = 2; i < n; i++) {
boolean flag = true;
for(int j = 2; j < i; j++) {
if(i % j == 0) {
flag = false;
break;
}
}
if (flag == true) {
... |
Python | UTF-8 | 964 | 2.71875 | 3 | [] | no_license | #!/usr/bin/python2.7
#coding:utf-8
from sys import *
import requests
import re,string,random
# import hackhttp
host = argv[1]
port = int(argv[2])
timeout = 30
target = "http://%s:%s"%(host,port)
def randomString(stringLength=10):
"""Generate a random string of fixed length """
letters = string.ascii_lowercase... |
Java | UTF-8 | 2,359 | 2.5 | 2 | [] | no_license | package com.okry.amt.ui.animhoriscroll;
import android.content.Context;
import android.view.View;
import java.util.List;
/**
* Created by marui on 13-11-26.
*/
public abstract class BaseHoriScrollItemAdapter<T> {
protected List<T> mList;
private HoriDataSetObserver mDataSetObserver;
public abstract V... |
JavaScript | UTF-8 | 3,313 | 2.546875 | 3 | [] | no_license | /**
* @fileOverview Authentication (Signin and signup) action file
*
* @author Paradise Kelechi
*
* @requires NPM:axios
* @requires NPM:querystring
* @requires NPM:react-router
* @requires ../helpers/Constants
* @requires ../../tools/Routes
* @requires ../helpers/Alert
* @requires ../helpers/Authenticatio... |
Java | UTF-8 | 1,224 | 2.0625 | 2 | [] | no_license | package com.junyou.bus.xingkongbaozang.configure.export;
import java.util.Map;
import com.junyou.configure.vo.GoodsConfigureVo;
/**
*
* @description 七日开服活动配置表 (全民修仙)
*
* @author ZHONGDIAN
* @date 2013-12-12 11:43:48
*/
public class XkbzConfig {
private Integer id;
private Integer jifen;//消费类型具体值
//奖励物品-服... |
JavaScript | UTF-8 | 18,732 | 3.453125 | 3 | [
"MIT"
] | permissive | (function() {
function Vector(x, y, z) {
this.x = x || 0;
this.y = y || 0;
this.z = z || 0;
}
Vector.prototype = {
negative: function() {
return new Vector(-this.x, -this.y, -this.z);
},
add: function(v) {
if (v instanceof Vector) return new Vector(this.x + v.x, this.y + v.y, this.z + v.z);
... |
PHP | UTF-8 | 2,520 | 3.078125 | 3 | [
"MIT"
] | permissive | <?php
namespace AsyncAws\CloudWatch\ValueObject;
use AsyncAws\Core\Exception\InvalidArgument;
/**
* Represents a set of statistics that describes a specific metric.
*/
final class StatisticSet
{
/**
* The number of samples used for the statistic set.
*
* @var float
*/
private $sampleCou... |
PHP | UTF-8 | 510 | 2.65625 | 3 | [] | no_license | <?php
function update_new_password($token, $password){
try{
global $bdd;
$query = $bdd->prepare("UPDATE ifup_user SET ifup_user_password=:ifup_user_password WHERE ifup_user_password=:token");
$query->bindParam(':ifup_user_password',$password, PDO::PARAM_STR);
... |
Markdown | UTF-8 | 8,821 | 2.578125 | 3 | [] | no_license | [toc]
## **Servlet 是什么?**
Java Servlet 是运行在 Web 服务器或应用服务器上的程序,它是作为来自 Web 浏览器或其他 HTTP 客户端的请求和 HTTP 服务器上的数据库或应用程序之间的中间层。
==Servlet是一个Java编写的程序,此程序是基于Http协议的,在服务器端运行的(如tomcat),是按照Servlet规范编写的一个Java类。Servlet可以支持客户端和服务器之间的请求影响==
使用 Servlet,您可以收集来自网页表单的用户输入,呈现来自数据库或者其他源的记录,还可以动态创建网页。
Java Servlet 通常情况下与使用 CGI(Co... |
Java | UTF-8 | 138 | 1.765625 | 2 | [] | no_license | package com.example.mindtray.memo;
public class TextContent extends MemoContent {
public TextContent(String name) {
super(name);
}
}
|
JavaScript | UTF-8 | 366 | 2.59375 | 3 | [] | no_license | import { React, useEffect, useState } from 'react';
const useDebounce = (value, delay) => {
const [deValue, setDeValue] = useState(value);
useEffect(() => {
const timer = setTimeout(() => {
setDeValue(value);
}, delay);
return () => {
clearTimeout(timer);
};
}, [value, delay]);
re... |
Java | UTF-8 | 2,026 | 2.015625 | 2 | [] | no_license | package com.lab516.service.sys;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Query;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transa... |
Markdown | UTF-8 | 809 | 2.921875 | 3 | [
"MIT"
] | permissive | # plainjdbc
[](https://travis-ci.org/dohque/plainjdbc)
Small Scala library inspired by Spring JdbcTemplate to execute generated sql statements over plain jdbc.
This library has no dependencies and is extremely easy to use.
Just add PlainJDBC de... |
Java | UTF-8 | 13,173 | 2.171875 | 2 | [] | no_license | /*
* 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.
*/
package talabat.clone.project;
/**
*
* @author Aya
*/
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;
impor... |
C# | UTF-8 | 2,584 | 2.640625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Speech.Recognition;
using System.Speech.Synthesis;
using System.Speech.AudioFormat;
using System.Windows.Forms;
namespace domotica
{
public class SpeechToText
{
DictationGra... |
C# | UTF-8 | 633 | 2.6875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ClassLibrary1
{
public class Class1:IItf1,IItf2
{
void IItf1.Abc()
{
}
void IItf2.Abc()
{
}
private int aaa1;
}
class MyClasssub :Clas... |
Java | UTF-8 | 723 | 2.34375 | 2 | [] | no_license | package cn.com.do1.mock.util;
import cn.com.do1.mock.model.TUserInfo;
import lombok.extern.slf4j.Slf4j;
import java.util.HashMap;
import java.util.Map;
/**
* @Author huangKun
* @Date 2021/3/24
**/
@Slf4j
public class LocalCacheUtil {
public static Map<String, TUserInfo> USER_CACHE = new HashMap<>();
sta... |
JavaScript | UTF-8 | 406 | 3.09375 | 3 | [
"MIT"
] | permissive | /* Convert string to lower case.
*
* |Name |Desc |
* |------|------------------|
* |str |String to convert |
* |return|Lower cased string|
*/
/* example
* lowerCase('TEST'); // -> 'test'
*/
/* module
* env: all
*/
/* typescript
* export declare function lowerCase(str: string): string;
*/
... |
Swift | UTF-8 | 2,762 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | import UIKit
import main
@objc class ViewController: UIViewController, GameEngineCallbacks {
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var b11: UIButton!
@IBOutlet weak var b12: UIButton!
@IBOutlet weak var b13: UIButton!
@IBOutlet weak var b21: UIButton!
@IBOutlet weak v... |
JavaScript | UTF-8 | 10,157 | 3.0625 | 3 | [
"MIT"
] | permissive | /**
* Watcher for click, double-click, or long-click event for both mouse and touch
* @example
* import { clicked } from 'clicked'
*
* function handleClick()
* {
* console.log('I was clicked.')
* }
*
* const div = document.getElementById('clickme')
* const c = clicked(div, handleClick, { threshold: 15 })
... |
Java | UTF-8 | 1,147 | 2.625 | 3 | [] | no_license | package com.example.asuper.gesturerecognizer.sensor;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
public class SensorDataRegulatorTest {
@Test
public void correctAverageData() {
SensorDataRegulator regulator = new SensorDataRegulator();
r... |
Java | UTF-8 | 497 | 2.21875 | 2 | [] | no_license | package cn.mobiledaily.domain;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
public final class Converter {
private static final ObjectMapper MAPPER = new ObjectMapper();
public static String toJson(Object object) {
try {
re... |
JavaScript | UTF-8 | 1,907 | 2.953125 | 3 | [] | no_license | "use strict";
module.exports = {
guid: function() {
return Math.floor( ( 1 + Math.random() ) * 0x10000 ).toString( 16 );
},
clone: function( obj ){
var clone = {};
if( obj === null || typeof( obj ) !== "object" ){
return obj;
}
for( var i in obj ){
... |
C# | UTF-8 | 2,879 | 2.546875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UJEP_WinformPainting.Classes.ColorCon;
using UJEP_WinformPainting.Classes.Managers.LivePreview;
using UJEP_WinformPainting.Classes.Managers.Memory;
using UJEP_WinformPainting.... |
Go | UTF-8 | 1,169 | 2.515625 | 3 | [
"MIT"
] | permissive | // See swaybar-protocol(7).
package swaybar
// Header represents a swaybar-protocol header.
type Header struct {
Version int
ClickEvents bool
ContSignal int
StopSignal int
}
// Body represents a swaybar-protocol body.
type Body struct {
StatusLines []StatusLine
}
// StatusLine is a slice of Blocks represe... |
Java | UTF-8 | 611 | 2.796875 | 3 | [] | no_license | package com.github.peckb1.projecteuler.p011to020;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import java.time.LocalDate;
import java.time.Month;
public class Problem19Test {
private Problem19 problem19;
@Before
public void setUp() throws Exception {
this.problem19 ... |
Java | UTF-8 | 15,995 | 1.859375 | 2 | [
"MIT"
] | permissive | package cn.liangyongxiong.cordova.plugin.admob.tencent;
import android.app.Activity;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.text.TextUtils;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.util.Log;
import com.qq.e.ads.nativ.Native... |
JavaScript | UTF-8 | 848 | 3.78125 | 4 | [] | no_license | // link:https://leetcode.com/problems/rotated-digits/description/
/**
* @param {number} N
* @return {number}
*/
var rotatedDigits = function(N) {
let res = 0;
for (let i = 1; i <= N; ++i) {
if (isGood(i, false)) res++;
}
return res;
};
var isGood = (n, flag) => {
if (n == 0) return flag;
let d = Mat... |
Markdown | UTF-8 | 44,664 | 2.875 | 3 | [] | no_license | # Streaming-Workshop-with-HDF
# Contents
- [Introduction](#introduction) - Workshop Introduction
- [Use case](#use-case) - Building a 360 view for customers
- [Lab 1](#lab-1) - Cluster installation
- Create an HDF 3.2 cluster
- Access your cluster
- [Lab 2](#lab-2) - Simple flow management
- [Lab 3](#lab-3) - Plat... |
Markdown | UTF-8 | 2,293 | 3.546875 | 4 | [] | no_license | # Test the Registeration and Recovery API
### This test contains tests for the /register and /recover API endpoints of [customerpay.me](staging.api.customerpay.me)
To run the tests, you will need to have Nodejs installed on your chosen platform.
The test application uses the built-in 'https' Nodejs module to mak... |
JavaScript | UTF-8 | 337 | 4.1875 | 4 | [
"MIT"
] | permissive | //Object
//Criando um Objecto
const person = {
name: 'John', //nome
age: 30, //idade
weight:88.6, //peso
isAdmin: true
}
//Para pegar uma propriedade desse objeto e imprimir na tela
console.log(person)
console.log(person.name)
console.log(person.age)
console.log(`${person.name} tem ${p... |
Java | UTF-8 | 2,143 | 2.4375 | 2 | [] | no_license | package magazineIndex.controller;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired... |
Java | UTF-8 | 1,762 | 2.640625 | 3 | [] | no_license | package com.kindleparser.parser.entities;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "Book")
public class Book {
@Id
@GeneratedV... |
C | UTF-8 | 18,384 | 3.296875 | 3 | [] | no_license | /***************************
* フォントファイル処理
**************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stdarg.h>
#include "fontfile.h"
//=============================
// 基本処理
//=============================
/* オフセットテーブルを読み込み */
static void _read_offset_ta... |
Java | UTF-8 | 3,771 | 2.4375 | 2 | [] | no_license | package indi.qiaolin.security.core.validate.code.impl;
import indi.qiaolin.security.core.validate.code.*;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.ServletRequestBindingException;
import org.springframework.web.bind.Se... |
Java | UTF-8 | 1,086 | 2.515625 | 3 | [] | no_license | package Praktikum_PBO_5;
/*
* 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.
*/
/**
*
* @author LEGION
*/
public class Buku {
private String judul;
private int tahunpenerbitan;... |
Python | UTF-8 | 998 | 2.90625 | 3 | [
"BSD-3-Clause"
] | permissive | import simpy
import logging
from .structure_item import StructureItem
from .num_spec import NumSpec, Choice
class Select(StructureItem):
"""
Select is a call StructureItem that randomly (or per Branch selection probability)
executes one of the contained CallStructure items.
"""
def __init__(self,... |
Markdown | UTF-8 | 20,057 | 2.875 | 3 | [] | no_license | ## Tutorial 04 - Working with Projections
Projections enable us to represent the earth on a flat surface. The WGS84 Geographic Coordinate System is the default projection in QGIS.
### Datasets
This tutorial will incorporate two datasets, one provided by Natural Earth and one provided by the U.S. Census. First, downlo... |
Java | UTF-8 | 1,470 | 2.984375 | 3 | [] | no_license | package ca.concordia.encs.conquerdia.controller.command;
import ca.concordia.encs.conquerdia.exception.ValidationException;
import ca.concordia.encs.conquerdia.model.PhaseModel;
import ca.concordia.encs.conquerdia.model.player.Player;
import java.util.List;
/**
* AttackMove Command handler
*
*/
public class Attac... |
C | UTF-8 | 3,419 | 2.59375 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* history.c :+: :+: :+: ... |
C | UTF-8 | 1,107 | 3.421875 | 3 | [] | no_license | #include <stdio.h>
#define real double
int main()
{
/* Matrix Size */
int m = 15;
/* Main Diagonal */
real *b = (real*)malloc(m*sizeof(real));
/* Lower Off Diagonal */
real *a = (real*)malloc(m*sizeof(real));
/* Upper Off Diagonal */
real *c = (real*)malloc(m*sizeof(real));
/* Right Hand Si... |
Java | UTF-8 | 362 | 2.796875 | 3 | [
"Apache-2.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | package contest.coci;
import java.util.HashSet;
import java.util.Scanner;
public class COCI_2006_MODULO {
static Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
HashSet<Integer> set = new HashSet<Integer>();
for (int x = 0; x < 10; x++)
set.add(scan.nextInt() % 42);
... |
C++ | UTF-8 | 3,119 | 2.75 | 3 | [] | no_license | #define GLEW_STATIC
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <iostream>
#include "SOIL2\SOIL2.h"
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include "Shaders.h"
#include <vector>
#include <string>
using namespace std;
GLuint texture;
class Terrain
{
pu... |
TypeScript | UTF-8 | 511 | 2.765625 | 3 | [] | no_license | export class ApprenantMessageAuth{
constructor(
private _apprenantId:number,
private _message:string,
private _isAuth:boolean
){}
get apprenantId(){return this._apprenantId};
get message(){return this._message};
get isAuth(){return this._isAuth};
set apprenantId(id:... |
C++ | GB18030 | 708 | 3.046875 | 3 | [] | no_license | #pragma once
#ifndef CAMERA_H
#define CAMERA_H
#include"ray.h"
#include"vectors.h"
class Camera
{
public:
Camera() {};
~Camera() {};
virtual Ray generateRay(Vec2f point) = 0;
virtual float getTMin() const = 0;
private:
};
class OrthographicCamera :public Camera
{
public:
OrthographicCamera(Vec3f center, Vec3f ... |
Shell | UTF-8 | 1,734 | 4.0625 | 4 | [] | no_license | #!/bin/bash
usage() {
cat <<-EOF
upstream - Fetch and merge upstream/master branch from original github project to local branch.
Usage:
upstream [OPTIONS] URL
Options:
-u | --upstream-branch UBR - remote branch at original project to merge frome (default: "master")
-m | --mer... |
Swift | UTF-8 | 510 | 2.625 | 3 | [] | no_license | //
// UILabel+Extension.swift
// 06_UISlider
//
// Created by Maksim Nosov on 14/07/2018.
// Copyright © 2018 Maksim Nosov. All rights reserved.
//
import UIKit
extension UILabel {
public convenience init(title: String) {
self.init()
self.layer.cornerRadius = 5
self.textColor = UI... |
C# | UTF-8 | 2,023 | 2.65625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebApplication.Context;
using WebApplication.Helpers;
using WebApplication.Model;
using WebApplication.Models;
namespace WebApplication.Controllers
{
public class HomeController : BaseController
{
... |
C++ | UTF-8 | 3,230 | 3.0625 | 3 | [] | no_license | #include "PersonalBudget.h"
void PersonalBudget::userRegistration()
{
userManager.userRegistration();
}
void PersonalBudget::viewMainMenu()
{
system("cls");
cout << " MENU G\235\340WNE " << endl;
cout << "*****************************" << endl;
cout << "1. Rejestracja" << endl;
cout ... |
Markdown | UTF-8 | 3,697 | 3.15625 | 3 | [] | no_license | # Titanic_Predictor
Kaggle's "Titanic: Machine Learning from Disaster" Competition
This is my try at competition. Currently I am ranked 1208 of 9553. My best score is 79.904
## My Approach
### EDA
I tried working using all categorical features and all dummy features. This was done in the file **data_cleanup.py**. ... |
Java | UTF-8 | 751 | 3.28125 | 3 | [] | no_license | package com.sail.tree;
public class ReverseTree {
public static void reverseTree(TreeNode rootNode){
if (rootNode==null){return;}
TreeNode leftNode = rootNode.getLchild();
TreeNode rightNode = rootNode.getRchild();
rootNode.setRchild(leftNode);
rootNode.setLchild(rightNode... |
Python | UTF-8 | 2,162 | 3.71875 | 4 | [] | no_license | import pandas as pd
import numpy as np
############
#Given a list to be binned(input_list) and a list of bin values(bin_list,
#this function will the return where each element in the input_list falls
#belong to. If input_list is extremely long, writing a for loop or using
#pd.Series.apply may not be fast enough. T... |
C++ | UTF-8 | 2,533 | 3.53125 | 4 | [] | no_license | /********************************************************
* Programa que le uma cadeia de caracteres e mostra: *
* 1) a quantidade de vogais da cadeia; *
* 2) a quantidade de cada letra diferente *
********************************************************/
#include <stdio.h>
#include ... |
C# | UTF-8 | 1,596 | 2.859375 | 3 | [
"MIT"
] | permissive | using System;
using System.IO;
using Contracts = System.Diagnostics.Contracts;
#if CONTRACTS_FULL_SHIM
using Contract = System.Diagnostics.ContractsShim.Contract;
#else
using Contract = System.Diagnostics.Contracts.Contract; // SHIM'D
#endif
namespace KSoft.IO
{
/// <summary>Exposes the concept of a virtu... |
JavaScript | UTF-8 | 999 | 3.03125 | 3 | [] | no_license | /**
* An object with different URLs to fetch
* @param {Object} ORIGINS
*/
const ORIGINS = {
"swapi-proxy.truestack.workers.dev": "swapi.dev",
"api.starwars.run": "swapi.dev",
};
const regex = new RegExp("swapi.dev", "g");
async function handleRequest(request) {
const url = new URL(request.url);
// Check if ... |
Markdown | UTF-8 | 3,467 | 2.78125 | 3 | [] | no_license | 第十章 惊人邪力(3)
姬翠尖叫道:“他已受伤,不要杀他!”
凌渡宇正奇怪姬翠为何仍能保持清醒和行动的能力时,黑影聚闪,庞度·鲁南由地上窜起来。
凌渡宇见到的只是他双眼闪现的黄芒。
“小心!”
凌渡宇大喝一声,把姬翠拉到身旁。
“砰!”
庞度·鲁南的肩头硬撞到囚门处,囚门反弹出来,重重擅在凌渡宇和姬翠身上。
无可抗御的巨力像海潮般涌来,两人立时变作滚地葫芦。
在触地前,凌渡宇再发一枪。
他身手的高明和不受邪力影响的能耐,显然大出正在不断淌血的庞度·鲁南意料之外,他正要从地上拾起另一支自动机枪,一发枪弹及时击中他左肩。
庞度·鲁南像旋风般... |
JavaScript | UTF-8 | 2,653 | 2.625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] | permissive | // Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
JavaScript | UTF-8 | 911 | 3.5625 | 4 | [] | no_license | let clickers = 50;
let startTime = Date.now();
// position element in the DOM
function sync(dom, pos) {
dom.style.left = `${pos.x}px`;
dom.style.top = `${pos.y}px`;
}
function addClicker() {
const pos = {
x: Math.random() * 500,
y: Math.random() * 300
};
const img = new Image();
img.src = "res/ima... |
Java | ISO-8859-1 | 2,425 | 2.65625 | 3 | [] | no_license | package br.edu.ifsc.cds.DAO;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import br.edu.ifsc.cds.DAO.Singleton.EntityMagerFactorySingleton;
import br.edu.ifsc.cds.DAO.interfaces.IExercicioDAO;
import br.edu.ifsc.cds.classes.domai... |
C++ | UTF-8 | 627 | 2.734375 | 3 | [
"Zlib"
] | permissive |
#pragma once
class clan::NetGameConnection;
class clan::NetGameEvent;
class ServerPlayer
{
public:
ServerPlayer(clan::NetGameConnection *connection);
static ServerPlayer *get_player(clan::NetGameConnection *connection);
clan::NetGameConnection *get_connection() const { return connection; }
bool login(int play... |
C++ | UTF-8 | 3,149 | 2.765625 | 3 | [] | no_license | #include "TexturePack.h"
#include <ngl/rapidjson/document.h>
#include <fstream>
#include <iostream>
#include <ngl/Texture.h>
std::unordered_map<std::string,TexturePack::Textures> TexturePack::s_textures;
TexturePack::TexturePack()
{
}
TexturePack::~TexturePack()
{
}
TexturePack::Texture::Texture(GLint _location,... |
C++ | UTF-8 | 391 | 2.734375 | 3 | [] | no_license | #include<iostream.h>
#include<conio.h>
double power(double,int);
void main()
{
clrscr();
double n,r;
int p,b;
cout<<"enter the number=";
cin>>n;
cout<<"\nenter the power=";
cin>>p;
r=power(n,p);
cout<<" \nresult= "<<r;
r=power(n,b=2);
// cout<<"\nresult= "<<r;
getch();
}
double power(double a,int... |
Python | UTF-8 | 329 | 3.796875 | 4 | [] | no_license | """
Input example 1:
level
Output sample 1:
level
Yes
Input example 2:
1 + 2 = 2 + 1 =
Output sample 2:
1 + 2 = 2 + 1 =
No
"""
str = input()
flag = 1
for i in range(0,int(len(str)/2)):
if(str[i] != str[len(str) - 1 - i]):
flag = 0
if(flag == 1):
print(str)
print("Yes")
else:
print(str)
prin... |
JavaScript | UTF-8 | 1,713 | 3.03125 | 3 | [
"MIT"
] | permissive | 'use strict'
/**
* The FileSystem helper used by the FileSystem extension.
*
* @module extensions/snapshot/FileSystem
*/
const path = require('path')
const fs = require('fs-extra')
/**
* Loads file content.
*
* @param {string} file - File path
* @param {string} [encoding='utf8'] - Content encodi... |
Python | UTF-8 | 1,420 | 2.671875 | 3 | [] | no_license | import utility
import sys
import requests
import json
import csv
from bs4 import BeautifulSoup
def main():
utility.checkInput(["coursesFile", "outputFile", "quarterCode"],[])
utility.checkCred()
filename = sys.argv[1]
outputFilename = sys.argv[2]
quarterCode = sys.argv[3]
courses = utility... |
C++ | UTF-8 | 792 | 2.703125 | 3 | [
"MIT"
] | permissive | #include "beverage.h"
void CaffeineBeverage::boilWater ()
{
printf("Boiling water ...\n");
}
void CaffeineBeverage::pourInCup ()
{
printf("Pouring into cup ...\n");
}
void CaffeineBeverage::prepareRecipe ()
{
boilWater();
brew();
pourInCup();
addCondiments();
}
void CaffeineBeverageWithHook... |
Java | UTF-8 | 6,748 | 1.679688 | 2 | [] | no_license | package xgame.tools.config;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import freemarker.template.Configuration;
import freemarker.template.ObjectWrapper;
import freemarker.template.TemplateExceptionHandler;
public class ToolsConf {
/**js文件写入开关*/
public stati... |
JavaScript | UTF-8 | 650 | 3.15625 | 3 | [] | no_license | window.onload = () => {
const sha256input_str = document.querySelector("#sha256input");
const sha256btn = document.querySelector("#sha256button");
const sha256output_str = document.querySelector("#sha256output");
function sha256Encoder(input_str){
return crypto.createHash('sha1').update(JSON.str... |
Java | UTF-8 | 545 | 3.203125 | 3 | [] | no_license | package com.revature.wednesday;
public class Thursday {
public static boolean subString(String str,String str2) {
boolean a=false;
if (str2.length()>str.length()) {
a=false;
}
else {
for(int i=0;i<=(str.length()-str2.length());i++) {
if (str2.equals(str.substring(i, i+str2.length()))) {
a=... |
Java | UTF-8 | 429 | 2.4375 | 2 | [] | no_license | package com.fzy;
import java.awt.*;
/**
* @Author Dayang
* @Date 2021/8/9
* @Version 1.7
*/
public class Rock extends Object{
Rock(){
this.x=(int)(Math.random()*700);
this.y=(int)(Math.random()*550+300);
this.width=71;
this.height=71;
this.flag=false;
this.m =15... |
JavaScript | UTF-8 | 2,827 | 2.765625 | 3 | [] | no_license | import * as THREE from "three";
import Stats from "stats.js";
// 統計情報の追加
const stats = initStats();
// シーンの作成
const scene = new THREE.Scene();
// カメラの作成
const camera = new THREE.PerspectiveCamera(
45,
window.innerWidth / window.innerHeight,
0.1,
1000
);
const renderer = new THREE.WebGLRenderer();
renderer.s... |
Python | UTF-8 | 1,261 | 2.546875 | 3 | [] | no_license | import numpy
from amuse.lab import *
from amuse.ext.galactics_model import new_galactics_model
M_galaxy = 1.0e12 | units.MSun # Mass of the galaxy
R_galaxy = 10 | units.kpc # Radius of the galaxy
n_halo = 20000 # Number of particles for halo
n_bulge = 10000 # Number of particles for bulge
n_disk = 10000 # Number of... |
PHP | UTF-8 | 1,781 | 3.09375 | 3 | [] | no_license | <?php
class User
{
private $db;
/**
* User constructor.
*/
public function __construct()
{
// init database
$this->db = new Database();
}
/*public function findUsersByEmail($email){
$this->db->query('SELECT * FROM employees WHERE email = :email');
$th... |
Markdown | UTF-8 | 4,364 | 4.09375 | 4 | [] | no_license | # Chương 4: Functions
## Gọi function
Trong chương trình ta có sử dụng rất nhiều function. Để sử dụng một function ta gọi ra tên của function ví dụ như sau:
```
>>> type(32)
<class 'int'>
```
Như ví dụ trên tên của function là `type`. Các ký tự bên trong dấu `()` được gọi là đối số. Đối số có thể là giá trị hoặc bi... |
Java | UTF-8 | 3,899 | 2.375 | 2 | [] | no_license | package protese.dao.servico;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Query;
import protese.dao.cliente.ClienteDebitoDao;
import protese.jpa.interfaces.Dao;
import protese.model.cliente.Cliente;
import protese.model.cliente.ClienteDebito;
import protese.model.servico.Servico... |
C# | UTF-8 | 2,192 | 3.375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace lab8t1
{
class TTriangle
{
public double AB;
public double AC;
public double BC;
public double k;
TTriangle()
{
this.AB = ... |
Java | UTF-8 | 275 | 2.140625 | 2 | [] | no_license | package com.lsheep.common.core.utils;
public abstract class StringUtils extends org.springframework.util.StringUtils {
public static String captureName(String name) {
char[] character = name.toCharArray();
character[0] -= 32;
return String.valueOf(character);
}
}
|
Ruby | GB18030 | 1,496 | 2.609375 | 3 | [] | no_license | require 'socket'
##############################ѭִһtcpỰͻֹͣ
# A simple TCP server may look like:
# server_ip = "50.50.50.55"
# port = 2000
# server = TCPServer.new server_ip, port # Server bind to port 2000
# client = server.accept # Wait for a client to connect
# client.puts "Hello !"
# client.puts "Time is #... |
Java | UTF-8 | 4,507 | 2.46875 | 2 | [] | no_license | package cn.newgxu.bbs.web.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import java... |
Java | UTF-8 | 1,571 | 2.953125 | 3 | [] | no_license | package phase1.module4.Work.work03.server;
import phase1.module4.Work.ServerThread;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.*;
public class Server {
public static Map<String,Socket> sockets... |
C++ | GB18030 | 268 | 3.25 | 3 | [] | no_license | #pragma once
template <typename T>
void Vector<T> ::copyFrom(T const* A,Rank lo, Rank hi){
// 2¿ռ
_elem = new T[_capacity = 2 * (hi - lo)];
// ģ
_size = 0;
// һԪ
while(lo<hi){
_elem[_size++] = A[lo++];
}
} |
Shell | UTF-8 | 1,026 | 3.546875 | 4 | [] | no_license | #!/bin/bash
#This script runs a snoutscan benchmark on the data at $1 using different indicies and prints a
# tsv-like output with the resuling accuracy and time
# set -x
dataDir="$1"
#This is a list of strings that fully define a faiss index:
indexDefinitions=( "Flat"
"IVF1024,Flat"
... |
Ruby | UTF-8 | 230 | 2.625 | 3 | [] | no_license | require "fileutils"
include FileUtils::Verbose
def run(a, *b, **c)
pp [a, b, c]
end
run 10
run 10, 20
run 10, 20, 30, 40
run 10, 20, 30, 40, [50, 60]
run 10, 20, 30, 40, name: "akshay", age: 29
run 10, name: "akshay", age: 29
|
JavaScript | UTF-8 | 1,008 | 3.34375 | 3 | [] | no_license | // your code here!
var normalizeText = function(text){
return text.toLowerCase().trim();
}
var tokenizer = function(text){
return text.replace('/\r?\n|\r/','').split(' ');
}
var countAvgWordLength = function(token){
var str = token.join("");
return (str.length/token.length).toFixed(2);
}
var uniqueWordCount = f... |
C# | UTF-8 | 1,774 | 2.578125 | 3 | [] | no_license | using System;
using System.IO;
using System.Text.Json;
namespace Overstag.Core
{
public class Credentials
{
public string mailUsername { get; set; }
public string mailPass { get; set; }
public string mySqlConnectionString { get; set; }
public string msSqlConnectionString { get;... |
PHP | UTF-8 | 2,707 | 2.84375 | 3 | [
"AGPL-3.0-only",
"MIT",
"LGPL-2.0-or-later",
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"GPL-1.0-or-later",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"GPL-3.0-only"
] | permissive | <?php
declare(strict_types=1);
/*
* The MIT License (MIT)
*
* Copyright (c) 2018 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace CBOR\OtherObject;
use Assert\Assertion;
use CBOR\OtherObject as Base;
use Invali... |
Java | UTF-8 | 1,765 | 1.671875 | 2 | [] | no_license | // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode fieldsfirst
package net.minecraft.src;
// Referenced classes of package net.minecraft.src:
// RenderLiving, EntityPig, ModelBase, EntityLivi... |
PHP | UTF-8 | 694 | 2.53125 | 3 | [] | no_license | <?php
namespace Craft;
class DirectoryContents_FileModel extends BaseComponentModel
{
public function __toString()
{
return $this->path;
}
protected function defineAttributes()
{
return array(
'name' => AttributeType::String,
'niceName' => AttributeType::String,
'fileName' ... |
Java | UTF-8 | 3,443 | 2.234375 | 2 | [] | no_license | package pl.edu.agh.speedgame;
import org.json.JSONObject;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import pl.edu.agh.speedgame.dao.OurSessionReplacement;
import... |
Java | UTF-8 | 974 | 2.703125 | 3 | [] | no_license | package com.rmi.distance;
import java.util.ArrayList;
import java.util.List;
public class MapDistance {
private static double EARTH_RADIUS = 6378.137;
private static double rad(double d) {
return d * Math.PI / 180.0;
}
public static void main(String[] args) {
/*Double lat1 = 30.470476;
Double l... |
Java | UTF-8 | 5,457 | 1.71875 | 2 | [
"Apache-2.0"
] | permissive |
package com.capsilon.automation.aus.dto;
import com.fasterxml.jackson.annotation.*;
import java.util.HashMap;
import java.util.Map;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"first_pand_iqualifying",
"negative_net_rental",
"second_pand_i",
"subj_neg_cash_flow",
"hazard_insu... |
Python | UTF-8 | 296 | 2.859375 | 3 | [] | no_license | import pytest
from solutions.p3 import largest_prime_factor
def test_1():
assert largest_prime_factor(2) == 2
def test_2():
assert largest_prime_factor(25) == 5
def test_4():
assert largest_prime_factor(7833) == 373
def test_3():
assert largest_prime_factor(13195) == 29
|
JavaScript | UTF-8 | 797 | 2.703125 | 3 | [] | no_license |
const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Body = Matter.Body;
var papper;
var ground;
var box1,box2,box3;
function preload()
{
}
function setup() {
createCanvas(800, 700);
engine = Engine.create();
world = engine.world;
//Create the Bodies Here.
papper=... |
Java | UTF-8 | 5,555 | 2.171875 | 2 | [] | no_license | /*
* Copyright (c) 2002-2017 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundatio... |
JavaScript | UTF-8 | 354 | 3.453125 | 3 | [] | no_license | /**
* IIFE ('iffy')
* Immediately invoted function expression
*
* Immediately = right away
* Invoked = run
* Function = ...function...
* Expression = ...expression...
*
* A function that we write and run at the same time
*/
(function () {
window.addEventListener('load', function () {
console.l... |
Python | UTF-8 | 204 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | class contador():
def __init__(self,recuento):
self.recuento = recuento
def incrementar(self):
self.recuento +1
def decrementar(self):
self.recuento -1
c = contador(0)
|
Ruby | UTF-8 | 2,501 | 2.734375 | 3 | [
"MIT"
] | permissive | class StateWorkflow::StateDefinitions
#Specify the name of the var/method to be available in validations for reference the thing on which these state apply
def self.these_are_states_for(stateful_object_name)
self.class_eval do
cattr_accessor :stateful_object_name
end
self.stateful_object_name =... |
JavaScript | UTF-8 | 1,562 | 2.546875 | 3 | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] | permissive | //
// MonoHMD.js
//
// Created by Chris Collins on 10/5/15
// Copyright 2015 High Fidelity, Inc.
//
// This script allows you to switch between mono and stereo mode within the HMD.
// It will add adition menu to Tools called "IPD".
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying... |
Markdown | UTF-8 | 20,342 | 2.921875 | 3 | [] | no_license | # Paginação de Dados
Nesse repositório implementamos ==paginação== de dados com ASP.NET 5 Web API. Nesse projeto utilizamos o Padrão Repositório (*Repository Patern*) e Repositório Genérico (*GenericRepository*) junto ao ORM *Entity Framework* para acessar os dados no banco.
O projeto tem a seguinte estrutura:
```x... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.