language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 2,824 | 1.75 | 2 | [
"Apache-2.0"
] | permissive | package com.yibairun.api.operations;
import com.android.volley.Response;
import com.yibairun.bean.InvitationCode;
import com.yibairun.bean.OrderlInfo;
import com.yibairun.bean.ProductDetailInfo;
import com.yibairun.bean.ProductInvestList;
import com.yibairun.bean.ProductList;
import com.yibairun.bean.StatusMessage;
im... |
JavaScript | UTF-8 | 1,343 | 2.578125 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import { useParams } from "react-router-dom";
import { readDeck, createCard } from "../utils/api";
import CardForm from "./CardForm.js";
import SubHeader from "../Layout/SubHeader.js";
export default function AddCard() {
const { deckId } = useParams();
const [dec... |
Java | UTF-8 | 751 | 2.25 | 2 | [] | no_license | package com.example.demo.entity;
import lombok.*;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table
@Entity
@Getter
@Setter
public class Employee {
@Id
@GeneratedValue
private int employeeId;
private String employeeName;
... |
C# | UTF-8 | 2,058 | 2.9375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace App
{
public class CoinChanger
{
private const int quarter = 25;
private const int dime = 10;
private const int nickel = 5;
private const int penny = ... |
Python | UTF-8 | 2,266 | 3.109375 | 3 | [] | no_license | import json
import requests
BASE_URL = 'https://github.com/simonepri/geo-maps/releases/latest/download/'
# Required countries
# UK - GBR, Ireland - IRL, Germany - DEU, Greece - GRC, Finland - FIN,
# Bulgaria - BGR, Hungary - HUN, Malta - MLT, Italy - ITA
COUNTRIES = [
['GBR', 'uk'],
['IRL', 'ierland'],
... |
Rust | UTF-8 | 5,737 | 2.625 | 3 | [] | no_license | mod cpu;
mod disk;
mod job;
mod ping;
mod ram;
mod shared;
use reqwest::blocking::{Client, RequestBuilder};
use serde::de::DeserializeOwned;
pub use cpu::CpuForm;
pub use disk::DiskForm;
pub use job::JobResp;
pub use ping::PingResp;
pub use ram::RamForm;
pub use shared::ReportResp;
use crate::shared::SharedCli;
use ... |
C++ | UTF-8 | 617 | 2.890625 | 3 | [] | no_license | #include<iostream>
#include<math.h>
using namespace std;
int main()
{
int t, h, a, H, A;
cin >> t;
while(t--)
{
while(cin >> h >> a >> H >> A)
{
int time = ceil(double(H)/a);//我需要几下打死怪兽,向上取整
if(time == 1)
{ //我先手,一次就ko,那可以无数次
cout << -1... |
Markdown | UTF-8 | 2,714 | 2.546875 | 3 | [] | no_license | ---
title: Substeps | Getting Started
layout: documentation
---
Getting Started with Substeps
=============================
Prerequisites
-------------
Substeps currently requires
* JDK 1.8.
* Maven 3 (or equivalent dependency management eg SBT or Ivy).
* The IntelliJ plugin (optional) depends on 2016 (Community or... |
Java | UTF-8 | 1,472 | 2.671875 | 3 | [] | no_license | import model.Book;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arr... |
Python | UTF-8 | 1,317 | 2.59375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from libs.graph import Graph
from libs.input_output import get_arguments
from os import path,makedirs
(items, frame, prior, codes, working_directory) = get_arguments(path.dirname(path.realpath(__file__)), True)
for item in items:
g = Graph(working_directory, frame, users=[int(item)], p... |
C++ | UTF-8 | 1,266 | 2.671875 | 3 | [] | no_license | #include "patient.h"
#include "airborne.h"
#include <gtest/gtest.h>
namespace{
class AirborneTest : public :: testing :: Test{
protected:
void SetUp(){
bptr = new Airborne(9,45,"likitha","9889568574","baroda",13,1500.0,"cough");
}
void TearDown(){
delete bptr;... |
Python | UTF-8 | 2,756 | 2.53125 | 3 | [] | no_license | import os
import sys
import sqlite3
import boto3
import requests
import feedparser
from bs4 import BeautifulSoup
from requests.auth import HTTPBasicAuth
URL = os.environ['FEED_URL']
USERNAME = os.environ['BASIC_AUTH_USERNAME']
PASSWORD = os.environ['BASIC_AUTH_PASSWORD']
FROM = os.environ['FROM_EMAIL_ADDRESS']
TO = ... |
PHP | UTF-8 | 979 | 2.84375 | 3 | [] | no_license | <?php
/**
* <b>Bairro [ MODEL ]</b>
* Responsavel por listar, cadastrar e editar os bairros
* @copyright (c) 2016, Diego Tesch
*/
class Bairro {
private $id;
private $dados;
private $error;
private $result;
/*function __construct($bairro {
$this->level = (int) $level;
}*/
... |
JavaScript | UTF-8 | 1,245 | 3.125 | 3 | [] | no_license | var aceSlider = document.getElementById("aceSlider");
var aceValue = document.getElementById("aceValue");
aceSlider.value = 0;
aceValue.innerHTML = 1;
aceSlider.oninput = function () { (this.value < 25) ? aceValue.innerHTML = "1" : aceValue.innerHTML = "11" }
var placeBet = document.getElementById("bPlace");
va... |
JavaScript | UTF-8 | 676 | 3.75 | 4 | [] | no_license | const Me = {
Name: "Ahmed",
Age: 14,
Parents: ["Anees", "Khyryh"],
Brothers: ["Laith", "Ghaith"],
Sisters: ["Sewar", "Sara"],
FavoriteColor: "black",
PhoneNumber: "0780325519"
};
console.log(Me);
// Put this code in the console
typeof Me;
Me.Age
Me.Name
Me.Parents
Me.Brother... |
Java | UTF-8 | 10,068 | 1.984375 | 2 | [] | no_license | package com.depression.service;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.depression.dao.PersonalityCharactersSimilarityMapper;
imp... |
Java | UTF-8 | 4,187 | 2.546875 | 3 | [] | no_license | package com.myretail.controller;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.V... |
JavaScript | UTF-8 | 2,460 | 2.765625 | 3 | [
"MIT"
] | permissive | var args = require('minimist')(process.argv.slice(2));
var cheerio = require('cheerio');
var request = require('request');
var fs = require('fs');
var request = require('request');
var mkdirp = require('mkdirp');
var progressbar = require('progress');
var folder = a... |
Java | UTF-8 | 584 | 3.375 | 3 | [
"MIT"
] | permissive | import java.util.Scanner;
public class Votacao{
public static void main(String[] args){
Scanner teclado = new Scanner(System.in);
System.out.print("Digite o ano que você nasceu: ");
int nasc = teclado.nextInt();
int idade = 2020 - nasc;
if(idade < 16){
System.out.... |
PHP | UTF-8 | 1,461 | 2.5625 | 3 | [] | no_license | <?php
use App\Core\Datastore\IdentityMap;
class Food extends App\Core\Datastore\Model { }
class IdentityMapTest extends TestCase
{
public function setUp()
{
$this->map = new IdentityMap();
}
public function testHas()
{
$this->assertFalse($this->map->has('food', 'chicken-bbq'));
... |
Markdown | UTF-8 | 6,912 | 2.65625 | 3 | [] | no_license | ---
layout: default
title: A New Recipe for Israeli Heroism
tags: [Ideas and Innovation,heroes,PT11]
created: 1278252004
changed: 1278420763
---
<p><a title="falafelman2 by PresenTense Group, on Flickr" href="http://www.flickr.com/photos/presentensegroup/4730448499/"><img width="354" height="500" align="right" alt="fal... |
Java | UTF-8 | 5,398 | 2.328125 | 2 | [] | no_license | package edu.upenn.cis350;
import java.util.ArrayList;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
impo... |
Python | UTF-8 | 1,254 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive |
import sys
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
def start_stdout_capture():
restore = sys.stdout
sys.stdout = StringIO()
return restore
def end_stdout_capture(restore):
output = sys.stdout.getvalue()
sys.stdout.close()
sys.stdout = restore
return output
de... |
Java | UTF-8 | 1,447 | 2.1875 | 2 | [] | no_license | package springapp.web.legal;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* General purpose class for display-only URLs
*
* @author judd
... |
Java | UTF-8 | 212 | 2.625 | 3 | [] | no_license |
public class AirplaneSeatAssignment {
public static double solve(int n) {
if(n==1) {
return 1.0;
}
return 0.5;
}
public static void main(String[] args) {
System.out.println(solve(2));
}
}
|
Swift | UTF-8 | 2,927 | 3.90625 | 4 | [] | no_license | import Foundation
class VendingMachineProduct {
var name: String
var amount: Int
var price: Double
init(name: String, amount: Int, price: Double) {
self.name = name
self.amount = amount
self.price = price
}
}
//TODO: Definir os erros
enum VendingMachineError: Error {
c... |
Python | UTF-8 | 343 | 4.25 | 4 | [] | no_license | #Project Euler - 20
#Keith Petro - 2016/10/20
#Problem Name: Factorial digit sum
#Description: Find the sum of the digits in the number 100!
def factorial(n):
factorial = 1
for i in range(1, n + 1):
factorial *= i
return factorial
def get_sum_of_digits(num):
return sum([int(i) for i in str(num)])
print(get_su... |
PHP | UTF-8 | 3,126 | 3.140625 | 3 | [
"MIT"
] | permissive | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SQL Injection - Parameterized queries</title>
</head>
<body style="font-family: sans-serif;">
<?php
function getDatabaseConnection() {
$servername = "localhost";
$username = "janani";
$password = "password";
$dbName = "booD... |
C | UTF-8 | 1,326 | 3.421875 | 3 | [] | no_license | #include "header.h" //include header
sl *delaftnum(sl *head) //delete at particular position function
{
int number; //position where th node is deleted
char *str = NULL; //pointer to take input position
int i = 0; //temporary variable to count number of nodes
sl *temp = NULL; //temporary pointer to access list
in... |
PHP | UTF-8 | 420 | 4.0625 | 4 | [] | no_license | <?php
//Дан массив с элементами 2, 5, 9, 15, 0, 4. С помощью цикла foreach и оператора if
//выведите на экран столбец тех элементов массива, которые больше 3х, но меньше 10.</p>
$arr = array(2, 5, 9, 15, 0, 4);
foreach($arr as $key) {
if ($key >3 && $key <10)
echo $key. "<br>";
} |
Markdown | UTF-8 | 727 | 3.015625 | 3 | [
"MIT"
] | permissive | # Spawner Component
## Purpose
Makes the prefab, selected in the Inspector, spawn at the location of the GameObject
that has the Spawner component.
## Inspector Values
| Setting | Purpose |
|---------|----------------------------------|
|Character Prefab To Spawn | A slot that takes a game ob... |
JavaScript | UTF-8 | 1,665 | 2.75 | 3 | [
"MIT"
] | permissive |
'use strict';
module.exports = (it, expect, form) => {
it('should be able to extend the base form prototype using a "macro"', () => {
expect(typeof form({ email: 'e@g.com' }).example_local_macro_method === 'undefined').to.eql(true);
form().macro('example_local_macro_method', function () {
return 'hello world... |
Java | UTF-8 | 35,142 | 2.171875 | 2 | [] | no_license | package l2open.gameserver.model;
import l2open.common.ThreadPoolManager;
import l2open.config.ConfigValue;
import l2open.gameserver.cache.Msg;
import l2open.gameserver.instancemanager.PartyRoomManager;
import l2open.gameserver.model.L2ObjectTasks.SoulConsumeTask;
import l2open.gameserver.model.base.Experience;
import ... |
C# | UTF-8 | 2,774 | 2.96875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.IO;
namespace SimpleConnect
{
class CTParameterFile
{
public void ReadActionXml(string inputFile)
{
bool step0 = false;
boo... |
PHP | UTF-8 | 1,026 | 3 | 3 | [] | no_license | <?php
/*
* 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.
*/
/**
* Description of Log
*
* @author Pablo
*/
class Log {
//put your code here
public function __construct() {
... |
Ruby | UTF-8 | 197 | 3.609375 | 4 | [] | no_license | a = ["r", "p", "s", "w"]#array
puts a
p a
b = a.index("p")#finding array index
puts b
c = a[2]#retrieve array elment using index
p c
d = ["a", "b","c","d","e","f","g","h","i"]
e = d[0,3]
p e
|
Markdown | UTF-8 | 1,056 | 3.234375 | 3 | [
"MIT"
] | permissive | Today we covered a ton of topics. One of those was "HTML elements," which are
special characters which start with & and appear as a special symbol on the page.
I also learned that the anchor tag, <a> can make just about anything into a link.
We also learned several new concepts for JS, including Conditional Statements,... |
Python | UTF-8 | 259 | 3.640625 | 4 | [] | no_license | outfile = open('golf.txt','w')
cont = 'y'
while cont == 'y' or cont == 'Y':
name = input("Enter golfer's name: ")
score = int(input("Score: "))
cont = input("Are there are more golfers? Enter y or Y for yes, anything else for no")
outfile.close() |
PHP | UTF-8 | 3,890 | 2.671875 | 3 | [] | no_license | <?php
/**
* @Author: zuoliguang
* @Date: 2018-08-17 16:51:08
* @Last Modified by: zuoliguang
* @Last Modified time: 2018-08-27 13:50:07
*/
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Catalog_model extends Base_Model
{
function __construct()
{
parent::__construct();
$this->... |
PHP | UTF-8 | 2,004 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php
namespace Tlr\Display\Assets\Output;
use Illuminate\Contracts\Routing\UrlGenerator;
use Tlr\Display\Assets\Components\AssetManager;
class TagInjector
{
/**
* The asset manager instnace
*
* @var \Tlr\Display\Assets\Components\AssetManager
*/
protected $assets;
/**
* The ur... |
Python | UTF-8 | 618 | 3.328125 | 3 | [] | no_license | #!/usr/bin/env/ python3
from pkg_resources import resource_string
import json
"""
Defines a room class and a fucntion used to create an instance of room class
"""
class Room():
def __init__(
self,
id = '1',
name = 'test name',
desc = 'test desc',
exits = {}):
self.id... |
Java | UTF-8 | 20,096 | 1.8125 | 2 | [] | no_license | package com.superdata.soho.activity.approvalcenter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONObject;
import androi... |
Java | UTF-8 | 2,660 | 2.96875 | 3 | [] | 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 hbm;
import org.hibernate.Session;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.SessionFactory;
impo... |
Python | UTF-8 | 7,965 | 2.671875 | 3 | [] | permissive | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 PAL Robotics SL.
# Released under the BSD License.
#
# Authors:
# * Siegfried-A. Gevatter
import curses
import math
import rospy
from geometry_msgs.msg import Twist
class Velocity(object):
def __init__(self, min_velocity, max_velocity, num... |
Python | UTF-8 | 5,229 | 2.625 | 3 | [] | no_license | import tensorflow as tf
from sklearn.model_selection import train_test_split
from tensorflow import keras
import numpy as np
import pickle
import matplotlib.pyplot as plt
def makedataset():
with open('log_word2vec/final_embeddings.pkl', 'rb') as f:
final_embeddings = pickle.load(f)
with open('log_word... |
Go | UTF-8 | 946 | 3.234375 | 3 | [] | no_license | package golangttdtextcalctravis
import (
"testing" // import the testing capability of go
)
func invoke_text_to_number(input string, expected_output int, t *testing.T) {
output := Text_to_number(input)
if output != expected_output {
t.Errorf("FAILED: text_to_number(%s) returned %d, expected %d", input, out... |
C++ | UTF-8 | 2,061 | 3.265625 | 3 | [] | no_license | // https://leetcode.com/problems/path-with-maximum-probability/
#include <vector>
#include <string>
using namespace std;
struct Node
{
public:
int connection;
double probability;
Node(int c, double p)
{
connection = c;
probability = p;
}
};
class Solution
{
public:
double maxProbability(int n, ve... |
JavaScript | UTF-8 | 342 | 2.546875 | 3 | [] | no_license | const authMiddleware = () => {
return(req, res, next)=>{
console.log(
`req.session.passport: ${JSON.stringify(req.session)}`
);
if(req.isAuthenticated()){
return next();
}else{
res.redirect("/users/login");
}
}
}
module.exp... |
Java | UTF-8 | 4,003 | 3 | 3 | [] | no_license | /*
*Apresenta um projeto com um conjunto de classes contendo documentação JavaDoc
*detalhando quais requisitos devem ser implementados para as classes e métodos
*disponibilizados.
*Os métodos possuem apenas a estrutura, sendo que a implementação deve ser
*desenvolvida pelo aluno, seguindo o processo TDD.
... |
Python | UTF-8 | 3,651 | 2.90625 | 3 | [] | no_license | """
Motivation: As in previous version, but using an 'effective' Pab1 concentration rather than an actual
Species: Pab, iPab, C, mRNAC, Pab_mRNAC
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
# Parameters
k1 = 166.8 # per min per au, client:hsp70 on rate
k3 = k1
k2 = 2.7... |
C++ | UTF-8 | 1,102 | 3.296875 | 3 | [] | no_license | #include "stdio.h"
#include "iostream"
#include "math.h"
using namespace std;
int main()
{
int cantidadnumeros;
int i,j;
long int numero;
long int sumadivisores=0;
cout<<"Ingrese la cantidad de numeros a leer: ";
cin>>cantidadnumeros;
for (j=0;j<cantidadnumeros;j++){
cout<<"\nI... |
Python | UTF-8 | 10,352 | 2.65625 | 3 | [] | no_license | ########## IMPORTS ##########
import cv2
import mediapipe as mp
from matplotlib import pyplot as plt
from PIL import Image
import numpy as np
import argparse
########## GLOBAL SETTINGS ##########
ap = argparse.ArgumentParser()
ap.add_argument("--source", type=str, default='./images/jim_carrey.jpg',
he... |
Java | UTF-8 | 154 | 2.21875 | 2 | [] | no_license | import lombok.Data;
@Data
public class Man {
private Godness godness;
public Man() {}
public Man(Godness godness) {
this.godness = godness;
}
}
|
PHP | UTF-8 | 3,886 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace Dskripchenko\OrchidExtra\Screens;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
use Illuminate\Support\Facades\DB;
use Orchid\Support\Facades\Alert;
use Throw... |
C# | UTF-8 | 3,315 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace TerrainGenerator
{
public class TerrainChunkGenerator : MonoBehaviour
{
public Material TerrainMaterial;
public Texture2D FlatTexture;
public Texture2D SteepTexture;
private TerrainChunkSettings... |
Markdown | UTF-8 | 877 | 3.046875 | 3 | [] | no_license | ### Idea
The service is designed with the clean architecture in mind.
- We have the app layer which handler the incoming requests, their validation, calling the service layer, serializing the response and error handling.
- The second layer is the service layer where we do our business logic. This layer also communica... |
Python | UTF-8 | 376 | 3.53125 | 4 | [] | no_license | # !/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Wangzhenqing <wangzhenqing1008@163.com>
"""
Problem 10: Write a function unique to find all the unique elements of a list.
"""
def unique(nums):
r_nums = []
for x in nums:
if x in r_nums:
continue
r_nums.append(x)
return ... |
C# | UTF-8 | 4,935 | 2.75 | 3 | [] | no_license | using CodeKingdom.Models;
using CodeKingdom.Models.Entities;
using CodeKingdom.Models.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
namespace CodeKingdom.Repositories
{
public class CollaboratorRepository
{
private readonly ... |
C++ | UTF-8 | 644 | 2.6875 | 3 | [
"MIT"
] | permissive | // Author: btjanaka (Bryon Tjanaka)
// Problem: (HackerRank) designer-pdf-viewer
// Title: Designer PDF Viewer
// Link: https://www.hackerrank.com/challenges/designer-pdf-viewer/problem
// Idea: Find the max height in each block of text.
// Difficulty: easy
// Tags: implementation
#include <bits/stdc++.h>
#define GET(x... |
C++ | UTF-8 | 1,274 | 3.03125 | 3 | [] | no_license | // -------------------------------------------------------------------
// Author: lfwu
// Date: December-27-2013
// Note:
// Email:zgwulongfei@gmail.com
// Blog:http://blog.csdn.net/hackmind
// -------------------------------------------------------------------
#include "utility.h"
#include <iostream>
#include <list>
#... |
JavaScript | UTF-8 | 453 | 4.125 | 4 | [] | no_license | function findOutlier(integers) {
var evenArr = [];
var oddArr = [];
for (let i = 0; i < integers.length; i++) {
if (integers[i] % 2 === 0) {
evenArr.push(integers[i]);
console.log("Evens", evenArr);
} else {
oddArr.push(integers[i]);
console.log("Odds", oddArr);
}
}
if (... |
Python | UTF-8 | 32,673 | 2.671875 | 3 | [] | no_license | import random
import itertools
import otreeutils
from otree.api import (
models,
widgets,
BaseConstants,
BaseSubsession,
BaseGroup,
BasePlayer,
ExtraModel,
Currency,
currency_range,
)
from .recipes import RECIPES
author = 'Dieter Smeulders'
doc = """
Experiment Sandwich Making and... |
C# | UTF-8 | 2,535 | 2.65625 | 3 | [
"MIT"
] | permissive | using iRentCar.UserActor.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
using InvoicesServiceInterfaces = iRentCar.InvoicesService.Interfaces;
namespace iRentCar.UserActor
{
internal static class Extensions
{
internal static UserInfo ToUserInfo(this UserData userData)
... |
Python | UTF-8 | 125 | 3.0625 | 3 | [] | no_license |
dict={1:2,3:4}
print("values",list(dict.values()))
print("keys:",list(dict.keys()))
print("key value",(dict.get(1)))
|
PHP | UTF-8 | 2,716 | 2.59375 | 3 | [] | no_license | <?php
class AccountController extends Controller{
public function actions() {
return array(
// page action renders "static" pages stored under 'protected/views/site/pages'
// They can be accessed via: index.php?r=site/page&view=FileName
'page' =>... |
Markdown | UTF-8 | 824 | 2.984375 | 3 | [] | no_license | # Client-Server Socket Programming
## How to run
- Open two windows of terminal.
- In one window run these commands.
```
cd server
gcc -o server server.c
./server
```
- In other window run these commands.
```
cd client
gcc -o client client .c
./client
```
- On client side, a `client>` prompt will appear. ... |
C++ | UTF-8 | 3,160 | 3.359375 | 3 | [] | no_license | #pragma once
#include "Quaternion.h"
Quaternion::Quaternion():
m_w(0),
m_x(0),
m_y(0),
m_z(0)
{
}
Quaternion::Quaternion(double w, double x, double y, double z):
m_w(w),
m_x(x),
m_y(y),
m_z(z)
{
}
Quaternion::Quaternion(Vector3 &V) :
m_w(0),
m_x(V.M_X()),
m_y(V.M_Y()),
m_z(V.M_Z())
{
}
double Quaterni... |
C# | UTF-8 | 12,859 | 3.25 | 3 | [
"Apache-2.0"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using Fluentatious.Extensions;
namespace Fluentatious.Patterns
{
/// <summary>
/// Implementation of <see cref="IPattern{TSubject, TResult}"/>
/// </summary>
/// <remarks>
/// - Has a fluent interface, hence almost all public ... |
C++ | UTF-8 | 2,164 | 3.125 | 3 | [] | no_license | #include <cmath>
#include <iostream>
#include "flock.h"
Flock::Flock()
: BAMF::Actor()
{}
Flock::~Flock() {}
void Flock::update(void)
{
std::vector<Zombie>::iterator iter;
for (iter = m_flock.begin(); iter != m_flock.end(); ++iter)
{
sf::Vector2f vel = guide(*iter) + rule1(*iter) + rule2(*it... |
JavaScript | UTF-8 | 1,468 | 3.25 | 3 | [] | no_license | console.log("=====no 1 ======");
console.log("==looping up==");
var i = 2;
while(i<=20){
console.log(i);
i+=2;
};
console.log("==looping down==");
var i = 20;
while(i>2){
console.log(i);
i-=2;
}
console.log("====soal 2 ====")
var santai = " - Santai"
var berkualitas = " - Berkualitas"
var loveCoding = " - I L... |
C# | UTF-8 | 1,626 | 2.984375 | 3 | [
"MIT"
] | permissive | namespace SolidRpc.OpenApi.Model.CSharp.Impl
{
/// <summary>
/// Implements a C# constructor
/// </summary>
public class CSharpConstructor : CSharpMember, ICSharpConstructor
{
/// <summary>
/// Creates a new instance
/// </summary>
/// <param name="parent"></param>
... |
Ruby | UTF-8 | 213 | 3.65625 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | def square_array(array)
squared_number = []
array.each do |number|
squared_number << number**2
end
squared_number
end
#test comment
#def square_array(array)
# array.collect{|number| number**2}
#end |
C++ | UTF-8 | 14,501 | 2.859375 | 3 | [] | no_license | #pragma once
#include "SymbolNodes.h"
#include "SymbolTable.h"
#include <iostream>
#include <set>
#include <algorithm>
// ======== IMPLEMENTATION OF METHODS ========
CCompileUnit::CCompileUnit(): STNode(NodeType::NT_COMPILEUNIT) {}
CCompileUnit::~CCompileUnit(){}
CStatements::CStatements(): STNode(NodeType::NT_STAT... |
Go | UTF-8 | 1,605 | 2.59375 | 3 | [
"MIT"
] | permissive | package server_test
import (
"net/http"
svcapi "github.com/dpb587/ssoca/service/uaaauth/api"
. "github.com/dpb587/ssoca/service/uaaauth/server"
svcconfig "github.com/dpb587/ssoca/service/uaaauth/server/config"
"github.com/dpb587/ssoca/server/service"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
v... |
Python | UTF-8 | 3,953 | 2.546875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | '''
This class is the framework of the web-app.
It is called and run (instantiated) in app.py.
'''
# import datetime
import streamlit as st
from apps.helpers.epw_helper import EPWHelper
from apps.helpers.ui_helper import UIHelper
import streamlit.components.v1 as components
class MultiApp:
def __init__(self):
... |
Python | UTF-8 | 447 | 3.96875 | 4 | [] | no_license | high = 100
low = 0
while True:
guess = (high + low)/2
print('Is your secret number ' + str(guess) + '?')
key = str(raw_input("Enter 'h' to indicate the guess is too high." +
" Enter 'l' to indicate the guess is too low." +
" Enter 'c' to indicate I guessed correctly."))
if key == "c":
print("Game ... |
Shell | UTF-8 | 1,247 | 3.015625 | 3 | [] | no_license | echo "Give tenant Name to create";
read tntname;
echo "Give any description if required or press enter "
read desc;
keystone tenant-create --name $tntname --description $desc;
echo "Give username to use this tenant";
read uname;
echo "Give password for user $uname ";
read upass;
echo "Give e-mail address for user ... |
Java | UTF-8 | 1,074 | 2.703125 | 3 | [
"MIT"
] | permissive | package eu.rex2go.chat2go.filter;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class AdvertisementFilter extends Filter {
private final Pattern ipRegex = Pattern.compile(
"(\\d+\\s*\\d*\\.\\s*\\d+\\s*\\d*\\.\\s*\\d+\\s*\\d*\... |
Java | UTF-8 | 937 | 3.484375 | 3 | [] | no_license | package apidata;
import java.time.LocalDateTime;
// wrapper for Local data time
// In: yyyy-mm-ddThh:mm:ss
// Out: yyyymmdd hhmmss
public class DateTime {
public static String time(LocalDateTime time) {
return parseTime(time);
}
// converts time format from LocalDateTime to the format in the... |
Go | UTF-8 | 1,738 | 2.59375 | 3 | [] | no_license | package app
import (
auth "github.com/koizr/go-todo-sample/auth/usecase"
"github.com/koizr/go-todo-sample/common"
"github.com/koizr/go-todo-sample/infra/persistent"
"github.com/koizr/go-todo-sample/task/domain"
"github.com/koizr/go-todo-sample/task/usecase"
"github.com/labstack/echo/v4"
"gorm.io/gorm"
"net/htt... |
C++ | UTF-8 | 422 | 3.15625 | 3 | [
"Unlicense"
] | permissive | // collisions will be between positive asteroid followed by negative
class Solution {
public:
vector<int> asteroidCollision(vector<int>& asteroids) {
bool right_found; // found first asteroid going right (positive sign)
vector<int> ret;
for (a : asteroids) {
if (a < 0 && !right_... |
Ruby | UTF-8 | 2,745 | 2.6875 | 3 | [
"MIT"
] | permissive | module HttpAcceptLanguage
# Returns a sorted array based on user preference in sent via
# the Accept-Language HTTP header. Don't think this is holy!
#
# Returns an empty array if the header does not contain any
# parsable language code.
#
# Example:
#
# Accept-Language: en;q=0.3, nl-NL, nl-be;q=0.9... |
Markdown | UTF-8 | 7,756 | 2.8125 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
description: Describes level 1, level 2, batch, and filter opportunistic locks.
ms.assetid: 06136348-0c08-4e9c-9c96-fd3af33cbdc0
title: Types of Opportunistic Locks
ms.topic: article
ms.date: 05/31/2018
---
# Types of Opportunistic Locks
The opportunistic lock operations work with four types of opportunistic lock... |
C# | UTF-8 | 383 | 2.640625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
namespace Capstone
{
public class ItemDrink : Item
{
public ItemDrink(string[] itemLine)
: base(itemLine)
{
}
public override string MakeSound()
{
string drinkSound = "Glug Glu... |
Python | UTF-8 | 677 | 3.015625 | 3 | [] | no_license | #!/usr/bin/env python
with open('companiesdonttest.txt', 'r') as fin, open('db_nontesting.txt', 'w') as fout:
for line in fin:
cols = str(line).split('\t')
category = 1
if cols[0] == 'V':
category = 3
elif cols[0] == 'L':
category = 4
elif cols[0] == ... |
C | UTF-8 | 6,071 | 2.78125 | 3 | [] | no_license | // heartbeat.c
// author: Christophe VG
#include <string.h>
#include <stdio.h>
#include "../sha1/sha1.h"
#include "moose/clock.h"
#include "heartbeat.h"
// a basic implementation of heartbeat-based neighbour availability monitoring
// internal data
// a heartbeat sequence counter
static uint8_t heartbeat;
// keep... |
Java | UTF-8 | 2,162 | 2.046875 | 2 | [
"Apache-2.0"
] | permissive | package com.hotcaffeine.dashboard.controller;
import java.util.Collections;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind... |
Java | UTF-8 | 426 | 2.421875 | 2 | [] | no_license | package uk.gov.homeofficedigital.swappr.model;
import static uk.gov.homeofficedigital.swappr.model.ShiftTypeLabel.*;
public enum ShiftType {
B1H(Early),
BFH(Early),
C1H(Mid),
CFH(Mid),
S1H(Late),
T1H(Late);
private final ShiftTypeLabel label;
private ShiftType(ShiftTypeLabel label) ... |
Python | UTF-8 | 885 | 4.40625 | 4 | [] | no_license | #crear 20 numeros aleatorio entre el 0 y el 100
#imprimir una lista de los numeros generados
#ordenados ascendentemente, primeros los pares y luego los impares
#ejemplo: si los num generados sin [4,3,5,6,2]
#el resulatdo sera: [2,4,6,3,5]
import random
lista_aleatorio = []
lista_par = []
lista_impar = []
for i in r... |
Markdown | UTF-8 | 5,612 | 3.453125 | 3 | [] | no_license | 三六
知念先环视了一圈,职员一共四十名左右吧。不过,相互银行与一般银行不同的地方是,前者是收款式的,所以现金交易的事务非常多。
知念逐一注视每张面孔,看不见安川,也没有田村的影子。
不过,这是意料中的事,安川当然不可能一下子就坐在总行办公室处理公事。因为是相互银行,可能先派任招揽存款的外勤工作。要是这样,反而方便请他出去。
知念走近窗口,询问其中一人:
“请问,这里有没有一位安川先生?”
“安川君在这里。”那男人爽直地回答。
“坐在哪儿?”
那男人转头探视了一会儿,回答说:
“大概走开了,请你坐在那边等一下,他回来我马上告诉他。”
等候处也是现... |
C++ | UTF-8 | 1,713 | 2.765625 | 3 | [] | no_license | #include "math_tools.h"
#include <math.h>
#include <assert.h>
#include <math.h>
#include <vector>
#include <stdio.h>
double gammaln(double x)
{
double y,tmp,ser;
static double cof[6] = {76.18009172947146,-86.50532032941677,24.01409824083091,-1.231739572450155,0.1208650973866179e-2,-0.5395239384953e-5 };
y... |
C++ | UTF-8 | 495 | 2.6875 | 3 | [] | no_license | #pragma once
#include <cinder/CinderGlm.h>
#include <vector>
class CubicSpline
{
public:
CubicSpline() = default;
CubicSpline(glm::vec3 a, glm::vec3 b, glm::vec3 c, glm::vec3 d);
//evaluate the point using a cubic equation
glm::vec3 getPointOnSpline(float s) const;
static st... |
Markdown | UTF-8 | 8,335 | 2.6875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT",
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-mit-old-style",
"HPND",
"HPND-sell-variant",
"LicenseRef-scancode-xfree86-1.0"
] | permissive | # User-configuration
This page describes how to add a custom layout or option so that it will be
parsed by libxkbcommon.
**The below requires libxkbcommon as keymap compiler and does not work in X**.
## Data locations
libxkbcommon searches the following paths for XKB configuration files:
- `$XDG_CONFIG_HOME/xkb/`, ... |
Python | UTF-8 | 5,359 | 3.140625 | 3 | [] | no_license | from textblob import TextBlob
from ToolPack import tools
from nltk.sentiment.vader import SentimentIntensityAnalyzer
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
import numpy as np
from collections import defaultdict
class ElectionSentiment:
def __init__(self):
# The keywords are produ... |
Go | UTF-8 | 795 | 3.578125 | 4 | [] | no_license | package main
import "fmt"
func reverse(s []byte) []byte {
left := 0
right := len(s) - 1
for left < right {
s[left], s[right] = s[right], s[left]
left++
right--
}
return s
}
func reverse2(s string) string {
str := []rune(s)
for i, j := 0, len(s)-1; i < j; i++ {
str[i], str[j] = str[j], str[i]
j--
}
... |
C++ | UTF-8 | 1,143 | 3.34375 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
bool isPalindrome(Lis... |
JavaScript | UTF-8 | 510 | 3.921875 | 4 | [] | no_license | // --------------------------------------let--------------------------------------
let x = 1;
if (x === 1) {
let x = 2;
console.log(x);
}
console.log(x);
// --------------------------------------var--------------------------------------
var z = 'global';
let y = 'global';
console.log(this.z);
console.log(this.y)... |
Swift | UTF-8 | 1,577 | 2.890625 | 3 | [] | no_license | //
// AppExtensions.swift
// Test_Jeebley
//
// Created by Shibili Areekara on 30/10/18.
// Copyright © 2018 Shibili Areekara. All rights reserved.
//
import Foundation
import UIKit
let imageCache = NSCache<AnyObject, AnyObject>()
extension UIImageView {
/// Load image from url String
func loadImage... |
C++ | UTF-8 | 809 | 2.78125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
map<int,int>parent;
map<int,int>sizes;
int finds(int a)
{
if(parent[a]==a)
return a;
return finds(parent[a]);
}
void init(int n)
{
for(int i=0; i<=n; i++)
{
parent[i]=i;
sizes[i]=1;
}
}
void unit(int a,int b)
... |
Java | UTF-8 | 1,851 | 2.546875 | 3 | [] | no_license | package lv.javaguru.java3.core.services.clients;
import lv.javaguru.java3.core.database.ClientRepository;
import lv.javaguru.java3.core.domain.Client;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InOrder;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.