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 | 3,692 | 2.671875 | 3 | [
"MIT"
] | permissive | class ServiceCentre(object):
"""
An information store for each service centre in the queueing network.
Contains all information that is independent of customer class:
- number of servers
- queueing capacity
- server schedules + preemtion status
- class change matrix
"""
def _... |
Markdown | UTF-8 | 1,955 | 3.375 | 3 | [] | no_license | # 控制流
```
# for
for(i in 1:3){
print(i)
}
# while
i <- 1
while(i <= 3){
print(i)
i <- i+1
}
# if...else if...else
x <- 0.1
if(x < -1){
print(-1)
} else if(x > 1){
print(1)
} else {
print(0)
}
# ifelse
ifelse(x>0,"positive","notpositive")
# switch
switch("2",
"1" = "hello",
"2" = "hi"... |
JavaScript | UTF-8 | 2,297 | 2.53125 | 3 | [] | no_license | var title = document.createElement("h1");
title.innerHTML = "Making Ice Cream Sandwiches";
document.body.appendChild(title);
title.style.color = "orange";
var para1 = document.createElement("p");
para1.innerHTML = "Kids and adults alike will be fighting over these big monster ice cream sandwiches! The best part about t... |
Python | UTF-8 | 2,819 | 3.265625 | 3 | [] | no_license | import sys
import numpy as np
from scipy import spatial
def NormalizeFeatureVectors(features):
# "features" is a 2-D array with the i'th row containing embedded speakers vector for the i'th superframe.
# superframe 0 c0, c1, c2, ...., c259
# superframe 1 c0, c1, c2, ...., c259
# superframe 2 c0,... |
C | UTF-8 | 2,220 | 3.015625 | 3 | [] | no_license | #include <pthread.h>
#include <stdio.h>
#define NUM_THREADS 2
#define LINHAS 3
#define COLUNAS 3
typedef struct par{
int indiceNzero;
double elemento;
}Par;
Par MatrizEsparsa[4][4];
void *threadCode(void *tid){
int i,j, k;
long threadId = (*(long *)tid);
for(i=threadId; i < LINHAS; i =... |
Java | UTF-8 | 2,690 | 1.960938 | 2 | [] | no_license | package quay.com.ipos.offerdiscount.Model;
import java.util.ArrayList;
/**
* Created by aditi.bhuranda on 16-07-2018.
*/
public class OfferDiscountModel {
String sName;
String sDescription;
String sDisplayName;
String sDisplayImage;
String sStartDate;
String sEndDate;
String sEntity;
... |
Python | UTF-8 | 2,394 | 2.578125 | 3 | [] | no_license | #_*_coding:utf-8_*_
import requests,re,random
import time,os
import conf
class download(object):
def __init__(self):
#拿到代理iplist
iprespon = requests.get('http://haoip.cc/tiqu.htm')
pattern = re.compile(r'r/>(.*?)<b',re.S)
ipresult = re.findall(pattern, iprespon.text)
s... |
C++ | UTF-8 | 1,850 | 3.109375 | 3 | [] | no_license | /**
* camera2D.hpp
*
* Author : Fatih Erol
* Date : 23.03.2010
*
* All rights reserved.
*/
#ifndef GRAPHICSLAB_CAMERA2D_HPP
#define GRAPHICSLAB_CAMERA2D_HPP
// Base class include
#include "camera.hpp"
GRAPHICSLAB_NAMESPACE_BEGIN
/** Class to simulate a 2D camera with orthogonal viewing volume */
cl... |
JavaScript | UTF-8 | 201 | 3.578125 | 4 | [] | no_license |
function hi() {
var test = "Abdellah";
var result = "";
for (var i = test.length; i>=0; i--) {
result+= test.charAt(i);
}
return result;
}
console.log(hi()); |
Python | UTF-8 | 1,045 | 3.1875 | 3 | [] | no_license | Characters:
Character.objects.count()
# Answer: 302
Fighter:
Fighter.objects.count()
# Answer: 68
Mage:
Mage.objects.count()
# Answer: 108
Cleric:
Cleric.objects.count()
# Answer: 75
Thief:
Thief.objects.count()
# Answer: 51
Necromancer:
Necromancer.objects.count()
# Answ... |
Python | UTF-8 | 131 | 3.28125 | 3 | [] | no_license | strn = "USA usa usa, usa USA?"
find = "USA"
temp = strn.lower()
count = temp.count(find.lower())
print("The USA count is:", count)
|
C++ | UTF-8 | 390 | 3.140625 | 3 | [] | no_license | template <class T>
void StraightSelectionSort(T* a, int n)
{
for (int i = 0; i < n - 1; i++)
{
T min = a[i];
int ixMin = i;
for (int k = i + 1; k < n; k++)
{
if (a[k] < min)
{
min = a[k];
ixMin = k;
... |
Java | UTF-8 | 2,005 | 1.90625 | 2 | [] | no_license | package com.proxair.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.w... |
C# | UTF-8 | 2,455 | 2.53125 | 3 | [
"MIT"
] | permissive | using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
namespace dashboard.Controllers
{
public class KPIController : ApiController
{
public async Task<JArray> GetKPIs(... |
Java | ISO-8859-9 | 191 | 1.789063 | 2 | [] | no_license | package Odev.GoogleHesap;
import Odev.entitites.concretes.User;
public class GoogleManager {
public void register(String message) {
System.out.println("Google ile kayt olundu" );
}
}
|
JavaScript | UTF-8 | 8,774 | 2.875 | 3 | [
"MIT"
] | permissive | var tabs = {};
function toggle(tab){
if(!tabs[tab.id])
addTab(tab.id);
else
removeTab(tab.id);
}
function addTab(id){
tabs[id] = Object.create(dimensions);
tabs[id].activate(id);
}
function removeTab(id){
tabs[id].deactivate();
for(var tabId in tabs){
if(tabId == id)
delete tabs[tabId]... |
Java | UTF-8 | 465 | 1.976563 | 2 | [
"Apache-2.0"
] | permissive | package com.sctt.cinema.api.business.entity.response;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SeatStatusDTO implements Serializable {
// ma ghe, vd A1...H1...
public String s... |
Markdown | UTF-8 | 5,963 | 3.71875 | 4 | [] | no_license | ## 对 PHP 中依赖注入和控制反转的理解
来源:<https://juejin.im/post/5b430952f265da0f66400a28>
时间:2018年07月09日
## 术语介绍
### IoC
* 控制反转(Inversion of Control)
* 依赖关系的转移
* 依赖抽象而非实践
### DI
* 依赖注入(Dependency Injection)
* 不必自己在代码中维护对象的依赖
* 容器自动根据配置,将依赖注入指定对象
### AOP
* Aspect-oriented programming
### 面向方面编程
* 无需修改任何一行程序代码,将功能加入至... |
Python | UTF-8 | 721 | 2.609375 | 3 | [] | no_license | from typing import Union
from .abstract import AbstractAsyncCachingBackend
import aioredis
class AsyncRedisCachingBackend(AbstractAsyncCachingBackend):
def __init__(self, redis_host):
self.redis_host = redis_host
async def get(self, key: Union[str, int]):
redis = await aioredis.create_redis(... |
C++ | UTF-8 | 2,178 | 3.78125 | 4 | [] | no_license | /*
You are given an integer array rolls of length n and an integer k. You roll a k sided dice numbered from 1 to k, n times, where the result of the ith roll is rolls[i].
Return the length of the shortest sequence of rolls that cannot be taken from rolls.
A sequence of rolls of length len is the result of ro... |
C++ | UTF-8 | 1,529 | 3.171875 | 3 | [] | no_license | int DIRECTIONA = 4;
int MOTORA = 5;
int DIRECTIONB = 7;
int MOTORB = 6;
void setup ()
{
pinMode(MOTORA, OUTPUT);
pinMode(DIRECTIONA, OUTPUT);
pinMode(MOTORB, OUTPUT);
pinMode(DIRECTIONB, OUTPUT);
}
int phase = 0;
int timeToGo;
unsigned long startTime;
void loop ()
{
// Defin... |
Java | UTF-8 | 3,489 | 2.34375 | 2 | [] | no_license | package tn.esprit.pidev.services;
import com.codename1.io.*;
import com.codename1.ui.events.ActionListener;
import tn.esprit.pidev.entities.Event;
import tn.esprit.pidev.utils.Database;
import tn.esprit.pidev.utils.LoginSession;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import jav... |
Markdown | UTF-8 | 2,268 | 3.03125 | 3 | [
"LicenseRef-scancode-generic-cla",
"MIT"
] | permissive | ---
unique-page-id: 1146897
description: Delete People in a Smart List or List - Marketo Docs - Product Documentation
title: Delete People in a Smart List or List
exl-id: 192e79e6-d816-44e3-84c4-212cd73eb3ce
---
# Delete People in a Smart List or List {#delete-people-in-a-smart-list-or-list}
You can quickly and easily... |
C | UTF-8 | 3,665 | 2.578125 | 3 | [] | no_license | #include <avr/io.h>
#include <util/delay.h>
#include "usb_gamepad.h"
/*
#define LED_CONFIG (DDRD |= (1<<6))
#define LED_OFF (PORTD &= ~(1<<6))
#define LED_ON (PORTD |= (1<<6))
*/
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
#define BTN_CROSS (1 << 0)
#define BTN_SQUARE (1 << 1)
#define BTN_TRIANGLE (1 <<... |
Java | UTF-8 | 3,952 | 2.453125 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
Copyright 2011-2016 Google Inc. All Rights Reserved.
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 t... |
C++ | UTF-8 | 568 | 2.578125 | 3 | [] | no_license | #include <pix5.h>
#include "elfgui5.h"
//constructor
Anchor::Anchor(bool t,int ty,bool b,int by,bool l,int lx,bool r,int rx)
{
top=t;
bottom=b;
left=l;
right=r;
top_y=ty;
bottom_y=by;
left_x=lx;
right_x=rx;
}
//SET
void Anchor::set(bool t,int ty,bool b,int by,bool l,int lx,bool r,int rx)
{
top=t;
bott... |
PHP | UTF-8 | 559 | 2.546875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: dokuen
* Date: 29.09.15
* Time: 11:49
*/
namespace Application\Model;
class Post
{
public $id_post;
public $idUser;
public $comment;
public $urlImg;
function exchangeArray($data)
{
$this->id_post = isset($data['id_post']) ? $data['id_post'... |
Python | UTF-8 | 11,291 | 2.828125 | 3 | [] | no_license | import class_Point as cP
def intersection(l1, l2):
x1, y1 = l1.ipt.x_cor, l1.ipt.y_cor
x2, y2 = l1.fpt.x_cor, l1.fpt.y_cor
x3, y3 = l2.ipt.x_cor, l2.ipt.y_cor
x4, y4 = l2.fpt.x_cor, l2.fpt.y_cor
denominator = round(((x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4)), 2)
x_temp = round(((x1 * y2 -... |
Java | UTF-8 | 1,301 | 2.890625 | 3 | [
"Apache-2.0",
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-public-domain",
"CC0-1.0",
"BSD-2-Clause"
] | permissive | package com.spacetimecat.java.lang.unexceptional;
import java.util.function.Function;
import java.util.function.Supplier;
public final class Ok<A> extends Risky<A>
{
private final A value;
public Ok (A value)
{
if (value == null) { throw new NullPointerException("value"); }
this.value = v... |
Python | UTF-8 | 426 | 2.921875 | 3 | [] | no_license | """
线上提交结果recall值及正确数计算
"""
value = "10.00000000% 0.09942639"
preferenceSet = 517
fscore = float(value.split(sep='% ')[0])
precision = float(value.split(sep='% ')[1])
recall = (fscore * precision / 100) / (2 * precision - fscore / 100)
tp = round(preferenceSet * recall)
predictionSet = round(tp / precision)
print... |
Shell | UTF-8 | 3,232 | 4.0625 | 4 | [
"Apache-2.0"
] | permissive | #!/bin/bash
# Script that sets up the docker environment to run the tests in and runs the
# tests.
# Pass --shell to run a shell in the test container.
# Failures should cause setup to fail
set -v -e -x
# Set PS4 so it's easier to differentiate between this script and run_tests.sh
# running
PS4="+ (test_env.sh): "
... |
Java | UTF-8 | 242 | 1.617188 | 2 | [] | no_license | package com.projeto.Transportadora.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import com.projeto.Transportadora.entities.Empresa;
public interface EmpresaRepository extends JpaRepository<Empresa, Long>{
}
|
Java | UTF-8 | 2,918 | 2.328125 | 2 | [] | no_license | package de.tina;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.con... |
PHP | UTF-8 | 1,197 | 2.71875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace App\Models;
class Setting extends BaseModel
{
public $table = 'settings';
public $incrementing = false;
public $fillable = [
'name',
'key',
'value',
'group',
'type',
'options',
'description',
];
public static $rules = [
... |
Markdown | UTF-8 | 1,219 | 2.640625 | 3 | [] | no_license | ---
title: Ennemi imaginaire de Rana
tags:
- Psychologie
---
Lorsque Rana parkourt férocement dans mon appartement où elle devrait bien penser à freiner avant d'accélérer, je me demande parfois si elle a un ennemi imaginaire dans sa tête.
[<img src="/assets/images/2021/03/rana.jpg" width="800px" />](https://www.ins... |
Go | UTF-8 | 440 | 3.96875 | 4 | [] | no_license | package main
import "fmt"
func main() {
// 구조체 익명 선언 및 활용
// type 구조체명 타입
car1 := struct {name, color string}{"520d", "red"}
fmt.Println("[Example 1] : ", car1)
fmt.Printf("[Example 1] : %#v\n", car1)
// Example 2
cars := []struct{name, color string}{{"520d", "red"}, {"530i", "white"}, {"528i", "blue"}}
fo... |
Python | UTF-8 | 2,314 | 3.6875 | 4 | [] | no_license | import numpy as np
def compute_error_for_line_given_points(b, w, points):
"""
compute the loss function of a linear regression
:param b: intersection
:param w: gradient
:param points: array of points [x_, y_]
:return: the average loss of the regression model
"""
total_loss = 0
for ... |
C++ | UTF-8 | 4,440 | 2.796875 | 3 | [] | no_license | /*
* Copyright (c) 2015 Vrije Universiteit Brussel
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify,... |
Java | UTF-8 | 3,568 | 2.515625 | 3 | [] | no_license | package com.study.springboot.oauth2;
import java.util.Map;
import lombok.Builder;
import lombok.Getter;
@Getter
public class OAuthAttributes {
private Map<String, Object> attributes;
private String nameAttributeKey;
private String name;
private String email;
private String picture;
@Builder
public OAuthAttri... |
Java | UTF-8 | 340 | 1.976563 | 2 | [] | no_license | package additional;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Date;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface TestAnnotation {
int value()... |
Java | UTF-8 | 1,147 | 2.296875 | 2 | [] | no_license | package backTesting;
import org.json.*;
import java.net.*;
import java.util.ArrayList;
import java.util.Map;
import java.io.*;
import java.util.*;
public class Algo1 {
public static String apiKey = "HA1B7557DRPRIY78";
public static void main(String[] args)
{
/*
* Get input from webpage
*/
String[] arg... |
JavaScript | UTF-8 | 3,863 | 2.625 | 3 | [] | no_license | import React, { Component } from 'react';
import { withRouter } from 'react-router-dom'
class Edit extends Component {
constructor(props) {
super(props);
this.state = { name: null, startDate: null, endDate: null, date: null, id: this.props.match.params.id }
}
componentDidMount() {
... |
C | UTF-8 | 10,778 | 3.28125 | 3 | [
"MIT"
] | permissive | #include "parser.h"
#include "lexer.h"
#include "variable.h"
#include <stdio.h>
#include <stdlib.h>
static Token parse_expression(void);
static void parse_variable_decl(void);
void parse_tokens(void){
Token *t;
Token exp_result;
Variable *var;
if(show_next_token(&t)){ // this is the first token we get, so there ... |
Java | UTF-8 | 1,594 | 3.734375 | 4 | [] | no_license | package Lec49;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
public class Generics_Demo {
public static void main(String[] args) {
// TODO Auto-generated method stub
ArrayList<Integer> list = new ArrayList<>();
//System.out.println(list);
Integer [] arr = {12,3,4,5,6,7};... |
Ruby | UTF-8 | 5,222 | 2.6875 | 3 | [] | no_license | require 'active_resource'
require 'thor'
require 'aeolus_cli/model/base'
require 'aeolus_cli/model/provider_type'
class AeolusCli::CommonCli < Thor
class_option :conductor_url, :type => :string
class_option :username, :type => :string
class_option :password, :type => :string
def initialize(*args)
super
... |
Java | UTF-8 | 2,337 | 2.5625 | 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 com.utf.grw.utfmaps.modelo.usuario;
import com.utf.grw.utfmaps.modelo.usuario.Usuario;
import com.utf.grw.utfmaps.util.Conexao... |
Java | UTF-8 | 1,752 | 2.28125 | 2 | [] | no_license | package com.xiaoming.dao.impl;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.SessionFactory;
import org.springframework.stereotype.Repository;
import com.xiaoming.base.impl.BaseDaoImpl;
import com.xiaoming.dao.FolderDao;
import com.xiaoming.domain.Folder;
... |
C++ | UTF-8 | 1,914 | 2.703125 | 3 | [] | no_license |
//Stores an ID3D11Buffer for a constant buffer of any type and its meta-data, automatically rounds the byte width to the 16 byte alignment
#pragma once
#include <d3d11.h>
#include <wrl/client.h>
#include "constant_buffer_types.h"
#include "../../utils/error_logger.h"
namespace hrzn::gfx
{
template<class T>
class... |
Java | UTF-8 | 7,009 | 1.757813 | 2 | [] | no_license | /**
*/
package org.hl7.fhir.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.hl7.fhir.CatalogEntryRelate... |
Shell | UTF-8 | 78 | 2.609375 | 3 | [] | no_license | filename=$1
touch "$filename"
mv "$filename" `echo "$filename"|sed 's/ /_/g'`
|
Markdown | UTF-8 | 267 | 2.671875 | 3 | [] | no_license | Python-2
1. Create the below pattern using nested for loop in Python.
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*
2. Write a Python program to reverse a word after accepting the input from the user. Sample Output:
Input word: ineuron
Output: norueni
|
Java | UTF-8 | 224 | 2.203125 | 2 | [] | no_license | package game.boardException;
import game.Coord;
/**
* Called when the user move out a legal position of piece
*/
public class IllegalMove extends Exception {
public IllegalMove(String message){ super (message); };
}
|
Python | UTF-8 | 2,342 | 2.53125 | 3 | [
"MIT"
] | permissive | # -*- encoding: utf-8 -*-
from django.db import models
from django.conf import settings
from django.utils import timezone
from django.contrib.auth.models import User
from django.urls import reverse
#Modelo para equipos
class Equipo(models.Model):
nombre = models.CharField(max_length=50)
fechaCreacion =... |
C# | UTF-8 | 902 | 2.78125 | 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;
namespace MyCalendar
{
public partial class TimeTape : Form
{
public TimeTape()
... |
C | UTF-8 | 611 | 2.96875 | 3 | [] | no_license | /* irqreturn.h */
#ifndef _LINUX_IRQRETURN_H
#define _LINUX_IRQRETURN_H
/*
* For 2.4.x compatibility, 2.4.x can use
*
* typedef void irqreturn_t;
* #define IRQ_NONE
* #define IRQ_HANDLED
* #define IRQ_RETVAL(x)
*
* To mix old-style and new-style irq handler returns.
*
* IRQ_NONE means we didn't... |
Java | UTF-8 | 5,265 | 2.234375 | 2 | [] | no_license | package com.gpdata.wanyou.ds.entity;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@Entity
@Table(name = "datasource_resource")
public class DataSourceResource implements Serializable {
private static final long ... |
Java | UTF-8 | 794 | 2.140625 | 2 | [] | no_license | package abcd.spc.sstreams.sg;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;
@Component
... |
Python | UTF-8 | 2,273 | 3.34375 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python
#
# Matrix-matrix multiplication in MATLAB.
# Both matrices here are square ( size x size ).
#
# Intended to demonstrate Automatic Offload to Xeon Phi MIC using
# Intel Math Kernel Library (MKL)
#
# djames (at) tacc.utexas.edu
# cproctor (at) tacc.utexas.edu
# 18 Aug 2014
#
# ---------------------... |
JavaScript | UTF-8 | 12,648 | 3.65625 | 4 | [
"MIT"
] | permissive | let mathEnforcer = {
addFive: function (num) {
if (typeof(num) !== 'number') {
return undefined;
}
return num + 5;
},
subtractTen: function (num) {
if (typeof(num) !== 'number') {
return undefined;
}
return num - 10;
},
sum: fun... |
Java | UTF-8 | 1,991 | 2.125 | 2 | [] | no_license | package com.echeng.resumeparser.server;
import java.util.Arrays;
import java.util.List;
import org.apache.log4j.PropertyConfigurator;
import com.echeng.resumeparser.common.Constant;
import com.echeng.resumeparser.common.utils.config.GlobalConfig;
import com.echeng.resumeparser.common.utils.config.ALConfig;
public a... |
C++ | UTF-8 | 10,420 | 3.015625 | 3 | [] | no_license | /*
* Antoine Carpentier
* 000324440
* BA2 informatique ULB 2013-2014
* Langages de programmation 2 - INFO-F-202
* Project C++
*
* main.cpp:
* Contient les tests
*/
#include <iostream>
#include <cstdlib>
#include <cassert>
#include <string>
#include "Vector.hpp"
#include "VectorString.hpp"
#include "VectorNum.... |
Java | UTF-8 | 1,387 | 2.375 | 2 | [] | no_license | package model.objects;
import java.util.ArrayList;
public class Usuario {
private Nivel nivel;
private String nome;
private String login;
private String senha;
private ArrayList<Sala> salas;
private ArrayList<Demonstrativo> demonstrativos;
public ArrayList<Sala> getSalas() {
return salas;
}... |
C++ | GB18030 | 879 | 2.9375 | 3 | [] | no_license | #include<iostream>
#include<cstring>
#include<cstdlib>
using namespace std;
int total = 0;
void dfs(int n, int num, int j, int a[]){ //j
if(num != n){
int i=1;
while(i<=n){
bool flag = true;
if(a[i]){ //
flag = false;
}
if(flag){
int ii=i,jj=j;
while(ii-1>=1&&jj-1>=1){ //
... |
Markdown | UTF-8 | 3,533 | 3.515625 | 4 | [] | no_license | # Money Shuffle
## *work in progress*
<br>
## Description
The Money Shuffle app is created for users who would like to keep better track of the money they spend. The app offers insight into how much budget is used for specific categories of expenses. The aim is to offer a straightforward and practical solution to ... |
C++ | UTF-8 | 10,536 | 2.53125 | 3 | [] | no_license | #define BOOST_TEST_MODULE Remora_MatrixProxy
#include <boost/test/unit_test.hpp>
#include <boost/test/floating_point_comparison.hpp>
#include <remora/proxy_expressions.hpp>
#include <remora/dense.hpp>
using namespace remora;
template<class M1>
double get(M1 const& m, std::size_t i, std::size_t j, row_major){
retu... |
PHP | UTF-8 | 889 | 2.640625 | 3 | [] | no_license | <?php
function insereProduto($conexao, $nome, $valor){
$comando = "insert into produtos(nome, valor) values ('{$nome}', {$valor})";
$resultado = mysqli_query($conexao, $comando);
return $resultado;
}
function listaProdutos($conexao){
return mysqli_query($conexao, "select * from produtos");
}
function... |
Java | UTF-8 | 11,165 | 2.34375 | 2 | [] | no_license | import java.io.*;
import java.math.*;
import java.util.*;
import static java.util.Arrays.*;
public class Main {
private static final int mod = (int)1e9+7;
final Random random = new Random(0);
final IOFast io = new IOFast();
/// MAIN CODE
public void run() throws IOException {
long[][] comb = ne... |
Python | UTF-8 | 2,614 | 2.65625 | 3 | [] | no_license | #-*- coding:utf-8 -*-
# AUTHOR: yaolili
# FILE: twoLayers.py
# ROLE: get properties of specific freebaseId
# CREATED: 2015-11-28 14:45:23
# MODIFIED: 2015-11-28 20:20:52
import sys
import os
import re
import MySQLdb
def connectDB(freebaseIdList):
result = {}
if not freebaseIdList:
return r... |
Java | UTF-8 | 241 | 2.578125 | 3 | [] | no_license | package com.github.lette1394.calculator;
public class PartialOperand implements Operand {
@Override
public Operand apply(Operator operator, Operand other) {
return null;
}
@Override
public long asLong() {
return 0;
}
}
|
Shell | UTF-8 | 1,027 | 3.359375 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env bash
NAME=calibre
CONTENT_SERVER_PORT=7777
PORT=10002
WAIT=4
if [ ! "$(docker ps -q -f name=$NAME)" ]; then
if [ "$(docker ps -aq -f status=exited -f name=$NAME)" ]; then
echo "Starting existing $NAME container..."
docker start $NAME
sleep $WAIT
open http://localhost:... |
C# | UTF-8 | 866 | 2.71875 | 3 | [] | no_license | public void InlineQueryWrite(Dictionary<Int32, PhaseMag> data)
{
using (var conn = new SqlConnection("conneciton string"))
{
conn.Open();
foreach (var bulk in data.Select((d, i) => new {d, i}).GroupBy(x => x.i % 10))
{
... |
Python | UTF-8 | 12,508 | 3.09375 | 3 | [] | no_license | # hardware control protocol imports:
import minimalmodbus
import serial
import visa
# --- abstract class which we want all innstrument classes to inherite ---
class Instrument():
"""Every instrument must inherite from the Instrument class and therefore must
implement:
-> the measure method
-> the open... |
Java | UTF-8 | 7,573 | 1.8125 | 2 | [] | no_license | package com.example.sofra.ui.activity;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.example.sofra.R;
import com.example.sofra.data.local.room.OrderItem;
import com.exam... |
JavaScript | UTF-8 | 5,926 | 2.53125 | 3 | [
"ISC"
] | permissive | import { getSuite } from '../node_modules/just-test/dist/just-test.min.js';
import * as DataTier from '../dist/data-tier.js';
const
suite = getSuite({ name: 'Testing model changes' }),
user = { name: 'some', age: 7, address: { street: 'str', apt: 9 } };
suite.runTest({ name: 'new model bound' }, async test => {
Da... |
Python | UTF-8 | 3,204 | 2.515625 | 3 | [] | no_license | import requests
import json
from helpers import *
from datetime import date, datetime
from datetime import timedelta
from dateutil import parser
config = load_config()
today = date.today()
maximum_time = date.today() + timedelta(config['maximum_time_delta'])
def get_5days_3hours_forcast_data(city_code='HaNoi', countr... |
JavaScript | UTF-8 | 561 | 3.015625 | 3 | [] | no_license | class Player {
constructor() {
this.height = 190;
this.width = 170;
this.x = 0;
this.y = height - this.height;
this.gravity = 0.2;
this.velocity = 0;
this.image;
}
drawPlayer() {
this.velocity += this.gravity;
this.y += this.velocity;
if (this.y >= height - this.height) {
... |
C++ | UTF-8 | 377 | 3.46875 | 3 | [
"Apache-2.0"
] | permissive | #include <iostream>
int main()
{
int lower,upper;
int v1, v2;
std::cout << "Input two numbers:" << std::endl;
std::cin >> v1 >> v2;
if(v1 <= v2)
{
lower = v1;
upper = v2;
}
else
{
lower = v2;
upper = v1;
}
for(int i = lower; i <= upper; i++)
... |
Java | UTF-8 | 486 | 2.359375 | 2 | [] | no_license | package org.nutz.mvc.param;
import org.nutz.mvc.annotation.Param;
import org.nutz.mvc.param.injector.NameInjector;
import org.nutz.mvc.param.injector.ObjectPairInjector;
public class PairAdaptor extends AbstractAdaptor {
@Override
protected ParamInjector evalInjector(Class<?> type, Param param) {
if (n... |
Python | UTF-8 | 4,618 | 4.46875 | 4 | [] | no_license | string1 = "this is a example string for learning python inbuilt string capability for"
print(35*'#')
print("Demonstrating Capatilize() Method ---> It capitalizes the first character of the String")
print(35*'#')
print("'{}' is the string before calling capatilize() Method".format(string1))
pr... |
Python | UTF-8 | 4,280 | 2.59375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/evn python3
# coding=utf-8
import math
from datetime import datetime
from dao.publish import PublishDAO
from dao.setting import SettingDAO
from service.base import BaseSrv
class PublishSrv(BaseSrv):
"""
# 对简历发布表增删改查
"""
@classmethod
def add_publish(
cls,
resume... |
Python | UTF-8 | 290 | 3.078125 | 3 | [] | no_license | class Solution:
# @param A : list of integers
# @return a list of list of integers
def permute(self, A):
x = [[]]
for n in A:
x = [l[:i]+[n]+l[i:]
for l in x
for i in xrange((l+[n]).index(n)+1)]
return x
|
Java | UTF-8 | 3,883 | 2.46875 | 2 | [] | no_license | package com.excilys.wrapper;
import java.util.List;
import com.excilys.om.Computer;
public class PageWrapper {
private int entitiesPerPage;
private int currentPagenumber;
private long numberOfComputer;
private long numberTotalOfComputer;
private int pageMax;
private String criteria;
private String order;
... |
Python | UTF-8 | 679 | 3.75 | 4 | [] | no_license | # Recursive
def findClosestValueInBst(tree, target):
return work(tree, target, tree.value)
def work (tree, target, closest):
# if at the end of the tree, return last closest value
print(closest)
if tree is None:
return closest
# check if the distance between the current closest and the target is more than the n... |
C# | UTF-8 | 1,032 | 3.140625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RSSClient.Exceptions
{
/// <summary>
/// Represent an invalid URL Source Exception
/// </summary>
public class DuplicatedSourceException : ApplicationException
{
//... |
Markdown | UTF-8 | 1,016 | 2.703125 | 3 | [] | no_license | **BIOS MBR DOS**
*-Antiguo* -> **BIOS MBR DOS** -> Admite hasta un máximo de 2 TB por cada partición existente.
*-Actual* -> **UEFI GPT** -> Admite hasta un máximo de 18 exabytes, que este es equivalente a 18,8 millones de TB
**Reglas MBR**
-Tiene un máximo de **4 particiones primaria... |
JavaScript | UTF-8 | 543 | 2.671875 | 3 | [] | no_license | import {AUTH, LOGOUT} from '../constants/actionContants';
const authReducer = (state={authData: null}, action) => {
switch(action.type) {
case AUTH:
const user = {profile: action.data.user, token: action.data.token};
localStorage.setItem("profile", JSON.stringify(user));
... |
JavaScript | UTF-8 | 1,023 | 2.625 | 3 | [] | no_license | import React, { useEffect, useState } from 'react'
import { Link } from 'react-router-dom'
import './movieList.css'
export const MovieList = () => {
const MovieURL = ('https://api.themoviedb.org/3/movie/popular?api_key=3bb2ad59c76c83daa1fd97f0b4effa78&language=en-US&page=1')
const [movieList, setMovieList] = useS... |
C++ | UHC | 280 | 3.0625 | 3 | [] | no_license | #include "pch.h"
#include <iostream>
#include <string>
using namespace std;
int main()
{
int a = 20000;
char c = a; // ٸ ٲ.
int b = c;
if (a != b)
{
cout << "̷: " << a << "!=" << b << '\n';
}
else
{
"Ϳ ڰ û ũ.\n";
}
} |
Python | UTF-8 | 613 | 2.96875 | 3 | [] | no_license | def unescaped_length(line):
line = line[1:len(line)-1]
length = 0
skip = 0
for i in range(0, len(line)):
if skip > 0:
skip -= 1
continue
c = line[i]
length += 1
if c == "\\":
d = line[i+1]
if d == '"':
skip = 1
elif d == "\\":
skip = 1
elif d == "x":
skip = 3
# print("'{}'... |
Java | UTF-8 | 1,640 | 2.890625 | 3 | [] | no_license | package test;
import static org.junit.Assert.*;
import java.util.NoSuchElementException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import set.ArraySet;
import set.RemoveDuplicates;
public class RemoveDuplicatesTest {
private RemoveDuplicates rd;
@Before
public void ... |
C# | UTF-8 | 4,064 | 2.796875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;
using System.Windows.Markup;
using System.Xml;
using System.IO;
namespace Library.Client.Wpf
{
public static class WpfExtensions
{
/// <summary>
/// find the ... |
Markdown | UTF-8 | 2,298 | 3.03125 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | ---
layout: post
title: "Apache Spark RDD operation examples"
date: 2014-10-23 16:00:00 +0200
comments: true
categories: [Spark, YARN]
author: Oliver Szabo
published: true
---
Recently we blogged about how you can write simple Apache Spark jobs and how to test them. Now we'd like to introduce all basic RDD operations ... |
C# | UTF-8 | 1,844 | 2.515625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CandleControl : MonoBehaviour
{
public Transform[] candleFires = null;
private float fev1;
private float fvc;
private float smallerNumber;
private float sizeBorder = 0.01f;
private int offNum = 0;
... |
Python | UTF-8 | 1,488 | 2.546875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import pendulum
from flask import Flask, Response
from flask_dataview import RangeTimeSeries, FlaskDataViews
class MyTestSeries(RangeTimeSeries):
def get_range(self):
d1 = pendulum.datetime(2000, 1, 1, 12, 0)
d2 = pendulum.datetime(2... |
Java | UTF-8 | 4,979 | 3.375 | 3 | [] | no_license | import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
public class Day11 {
public static void main(String[] args) throws Exception {
final char[][] seats = Files
.readAllLines(Paths.get("java-solutions", "input", "day11")).stream()
.map(String::tr... |
C++ | UTF-8 | 3,110 | 3.265625 | 3 | [
"MIT"
] | permissive | #ifndef AABB_HPP
#define AABB_HPP
#include <VBE/math.hpp>
#include <VBE/system/Log.hpp>
///
/// \brief Represents an Axis-Aliged Bounding Box
///
class AABB {
public:
///
/// \brief Default constructor
///
/// This AABB will be init with the maximum value
/// in all three e... |
JavaScript | UTF-8 | 1,243 | 2.78125 | 3 | [] | no_license | import React, {useState} from 'react';
import MovieCard from './MovieCard'
export default function SearchMovies() {
const [query, setQuery] = useState('');
const [movies, setMovies] = useState([]);
const searchMovies = async (event) => {
event.preventDefault();
const url = `https://api.themoviedb.org/3... |
Swift | UTF-8 | 3,610 | 2.5625 | 3 | [] | no_license | //
// MarqueeView.swift
// betlead
//
// Created by Victor on 2019/8/20.
// Copyright © 2019 vanness wu. All rights reserved.
//
import UIKit
import RxSwift
class MarqueeView: UIView {
private lazy var label1: UILabel = {
let lb = UILabel()
lb.tag = 1
lb.textColor = Themes.darkGre... |
JavaScript | UTF-8 | 864 | 2.625 | 3 | [] | no_license | const fs = require('fs')
const data = fs.readFileSync('linux_env', 'utf8')
const lines = data.split(/\r?\n/)
// console.log(lines.length)
const envVars = []
lines.map((line, i) => {
const separator = line.indexOf('=')
// console.log(i, separator)
envVars[i] = {
title: line
.slice(0, separator)
... |
Java | UTF-8 | 864 | 2.0625 | 2 | [] | no_license | package com.eloisapaz.cloud.microservice;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.