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,243 | 2.65625 | 3 | [] | no_license | from __future__ import print_function
from keras.models import Model
from keras.layers import Input, LSTM, Dense
import numpy as np
import seq2seq
import utils
import sklearn
import numpy as np
import sys
from itertools import chain
import time
def hamming_dist(s1, s2):
assert len(s1) == len(s2)
return sum(c1... |
Java | UTF-8 | 5,133 | 1.851563 | 2 | [] | no_license | package com.ooyala.sample.lists;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import andro... |
Shell | UTF-8 | 742 | 3.015625 | 3 | [] | no_license | # grc overides for ls
# Made possible through contributions from generous benefactors like
# `brew install coreutils`
if $(gls &>/dev/null)
then
alias ls="gls -F --color"
alias l="gls -lAh --color"
alias ll="gls -l --color"
alias la='gls -A --color'
fi
# Always enable colored `grep` output
# Note: `GREP_OP... |
Python | UTF-8 | 23,387 | 2.65625 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | # This script imports the .dac index file. It is modified from
# the slycat-csv-parser.
#
# S. Martin
# 4/4/2017
import csv
import numpy
import slycat.web.server
# zip file manipulation
import io
import zipfile
import os
# background thread does all the work on the server
import threading
import traceback
# for da... |
C | UTF-8 | 1,429 | 2.875 | 3 | [] | no_license |
/*
DDRB = 0b00001111; //0->Input,1->Output (PB7,PB6,PB5,PB4,PB3,PB2,PB1,PB0)
//Both are Same
DDRB &= ~((1<<PINB7) | (1<<PB6) | (1<<PB5) | (1<<PB4)); //Setting as input
DDRB |= ( (1<<PB3) | (1<<PB2) |(1<<PB1) |(1<<PB0) ); //setting as Output
PORTB &= ~((1<<PB3) | (1<<PB2) | (1<<PB1) | (1<<PB0)); //cle... |
Markdown | UTF-8 | 1,512 | 2.921875 | 3 | [] | no_license | # vscode-pylint-wrapper
Wrapper for executing pylint in vscode to avoid hung processes and runaway memory usage
When using pylint with vscode, it seems to suffer from two problems:
- the pylint processes never exit, leading to hundreds or thousands of pylint processes after a few hours
- the pylint processes th... |
Java | UTF-8 | 2,458 | 2.28125 | 2 | [] | no_license | package com.edisoninteractive.inrideads.Receivers;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiManager;
import android.util.Log;
import com.edisoninteractive.inrideads.Entities.WifiConnectionPo... |
Markdown | UTF-8 | 2,836 | 3.703125 | 4 | [] | no_license | # 196. 删除重复的电子邮箱
https://leetcode-cn.com/problems/delete-duplicate-emails/ <br/>
```wiki
编写一个 SQL 查询,来删除 Person 表中所有重复的电子邮箱,重复的邮箱里只保留 Id 最小 的那个。
+----+------------------+
| Id | Email |
+----+------------------+
| 1 | john@example.com |
| 2 | bob@example.com |
| 3 | john@example.com |
+----+-----------... |
Java | UTF-8 | 1,883 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | package com.bigboxer23.garage;
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.info.Contact;
import io.swagger.v3.oas.annotations.info.Info;
import java.io.IOException;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.... |
C | UTF-8 | 238 | 2.765625 | 3 | [] | no_license | #include "../include/lexer.h"
struct Token* lex(FILE *file) {
struct Token * tokens = calloc(10, sizeof(struct Token));
tokens[0].type = INT;
strcpy(tokens[0].string, "main");
printf("%d\n", tokens[0].type);
return tokens;
} |
Python | UTF-8 | 330 | 3.828125 | 4 | [
"MIT"
] | permissive | '''
Probem Task: Create a function that takes a list and finds the integer which appears an odd number of times.
Problem Link: https://edabit.com/challenge/9TcXrWEGH3DaCgPBs
'''
def oddInteger(intList):
xoredValue = intList[0]
for ele in intList[1:]:
xoredValue = (xoredValue ^ ele)
return x... |
C++ | UTF-8 | 1,428 | 2.875 | 3 | [] | no_license | #include<stdio.h>
#include<cstring>
#include<fstream>
#include<string>
#include<iostream>
using namespace std;
int H, W;
const int coverType[4][3][2] = {
{{0,0},{1,0},{0,1}},
{{0,0},{0,1},{1,1}},
{{0,0},{1,0},{1,1}},
{{0,0},{1,0},{1,-1}}
};
int board[20][20];
void getinfo() {
string temp;
memset(board, 0, s... |
C++ | UTF-8 | 1,122 | 2.71875 | 3 | [] | no_license | #ifndef __ZDNN_SOFTMAX__
#define __ZDNN_SOFTMAX__
#include "activate.h"
namespace zdnn {
class Softmax: public Activation {
public:
virtual void Activate(Node* node) {
for (int col=0; col < node->batch_; col++) {
// sum = sigma(exp(-x))
double sum = 0;
double* temp_value = new do... |
Java | UTF-8 | 2,740 | 2.984375 | 3 | [] | no_license | package parkinsonbenjamin.doglibrary.processor;
import org.json.simple.JSONArray;
import parkinsonbenjamin.doglibrary.dal.DoggoDal;
import parkinsonbenjamin.doglibrary.dataobjects.Dog;
import parkinsonbenjamin.doglibrary.dataobjects.User;
import parkinsonbenjamin.doglibrary.dataobjects.Withdrawal;
import parkinsonbenj... |
Java | UTF-8 | 2,081 | 2.78125 | 3 | [
"MIT"
] | permissive | /*
* 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 co.edu.uniandes.csw.viajes.ejb;
import co.edu.uniandes.csw.viajes.entities.OficinaEntity;
import co.edu.uniandes.csw.viajes.pe... |
C++ | UTF-8 | 2,414 | 2.859375 | 3 | [] | no_license | #include "vex.h"
using namespace vex;
using namespace std;
// defining variables
float pi = 3.14159265359;
const double wheelDiameter = 3.25;
const float wheelCircumference = wheelDiameter * pi;
const float turningDiameter = 18.0; // distance (in inches) from top-left wheel to bottom-right wheel
const float gearRati... |
C++ | UTF-8 | 296 | 2.609375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main(){
string str;
cin>>str;
char s=str[0];
int ans = 0, temp = 0;
for(auto x: str){
if(s==x){
temp++;
}
else if(x!=s){
ans = max(ans, temp);
temp = 1;
s = x;
}
}
ans = max(ans, temp);
cout<<ans;
return 0;
} |
Markdown | UTF-8 | 538 | 2.5625 | 3 | [] | no_license | # MEAN-stack-and-Fusioncharts-MVC-application
Simple MVC application using MEAN stack framework and Fusioncharts showing how we can visualize data by reading values from database.
Make sure that you have following modules installed in the local node-modules folder:
1.body-parser
2.express
3.mongojs
Values to be pu... |
Java | UTF-8 | 512 | 1.789063 | 2 | [] | no_license | package com.maz.store.model.delivery;
import com.maz.store.model.customer.CustomerDto;
import com.maz.store.model.order.OrderDto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Bu... |
Python | UTF-8 | 6,374 | 2.765625 | 3 | [
"MIT"
] | permissive | import pandas as pd
import pyexcel_ods
from datetime import datetime
import math
import numpy
import utils
import pathlib
import sys
import os
def read_data(path):
try:
data = pd.read_excel(path, engine='odf')
return data
except Exception as excep:
sys.stderr.write("'Não foi possível le... |
Java | UTF-8 | 2,133 | 2.265625 | 2 | [] | no_license | package com.chanjet.ccs.ccp.base.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import com.chanjet.ccs.base.entity.BaseEntity;
//TODO MEMO 修改了createTime,原先是time,及表中的create_time
@Entity
@Table(name = "t_report")
public class Report extends BaseEntity {
... |
Java | UTF-8 | 8,391 | 2.3125 | 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 autores.controladores;
import autores.modelos.Alumno;
import interfaces.IControladorAMAlumno;
import autores.modelos.GestorAut... |
C# | UTF-8 | 7,831 | 2.515625 | 3 | [
"MIT"
] | permissive | // This file is part of SharpNEAT; Copyright Colin D. Green.
// See LICENSE.txt for details.
namespace SharpNeat.Neat.Reproduction.Asexual.Strategy;
/// <summary>
/// A NEAT genome asexual reproduction strategy based on deletion of a single connection.
/// </summary>
/// <typeparam name="T">Connection weight data typ... |
PHP | UTF-8 | 1,062 | 2.8125 | 3 | [] | no_license | <?php
// Variables
$from = htmlspecialchars($_POST["email"]);
$to = "solen-jini@hotmail.fr";
$subject = htmlspecialchars($_POST["subject"]);
$message = htmlspecialchars($_POST["message"]);
// Saut de ligne
if (!preg_match("#^[a-z0-9._-]+@(hotmail|live|msn).[a-z]{2,4}$#", $to)) {
$br = "\r\n";
}
else {
$br = "... |
Java | UTF-8 | 360 | 1.9375 | 2 | [] | no_license | package com.WiltonZhan.leetcode.l657RobotReturnToOrigin;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class SolutionTest {
private final Solution solution = new Solution();
@Test
void judgeCircle() {
assertTrue(solution.judgeCircle("UD"));
assertFa... |
C++ | UTF-8 | 968 | 3.296875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
char respuesta;
int cont_A=0, cont_B=0, cont_C=0;
cout<<"PARTIDOS CANDIDATOS\n"
<<" A. Partido A.\n"
<<" B. Partido B.\n"
<<" C. Partido C.\n"
<<"Voto (fin -> F): ";
cin>>respuesta;
cout<<endl;
while(resp... |
JavaScript | UTF-8 | 2,712 | 2.515625 | 3 | [] | no_license | import "./ProjectItem.css";
import DemoModal from "./DemoModal";
import { useState } from "react";
function ProjectItem(props){
const [showDemoModal, setShowDemoModal] = useState(false);
const [demoIframe, setDemoIframe] = useState("<iframe></iframe>");
function handleMouseEnter(e){
let element =... |
C++ | UTF-8 | 1,028 | 3.21875 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include "mylist.h"
using namespace std;
#define TAB "\t"
List<int>* make_list(int amount) {
List<int> *l = new List<int>(amount+1);
for(int i = 0; i < amount; i++){
l->insert(rand());
}
return l;
}
int main(int argc, char **argv){
List<int> *l;
int repeats;
int nu... |
Markdown | UTF-8 | 8,249 | 2.53125 | 3 | [
"MIT"
] | permissive | # trailpack
[![Gitter][gitter-image]][gitter-url]
[![NPM version][npm-image]][npm-url]
[![Build status][ci-image]][ci-url]
[![Dependency Status][daviddm-image]][daviddm-url]
[![Code Climate][codeclimate-image]][codeclimate-url]
[![Follow @trailsjs on Twitter][twitter-image]][twitter-url]
Trailpack Interface. Trailpac... |
Markdown | UTF-8 | 4,620 | 2.90625 | 3 | [] | no_license | ### 统一配置管理
> 思路: zk 节点存储配置信息, 配置信息修改,通知客户端更新配置.
> 实现: spring 可通过自定义 ConfigurableEnvironment 接口实现, 自定义propertySource接口实现
### 同步互斥功能.
- barrier
> 多个进程需要等到某一条件满足时,才能开始执行. 如两个任务之间有先后关系,可以考虑使用
实现流程:
1. 首先有个/barrier 的根节点.每个需要同步协同的进程都监听这个根节点
2. 每个进程都创建子节点然后 同步等待 (Object.wait),
3. 因为其他的进程也是同样的操作(创建子节点), 故每个进程会接收到通... |
C++ | UTF-8 | 986 | 3.234375 | 3 | [] | no_license | // https://leetcode.com/problems/path-sum-iii/
// 437. Path Sum III
#include <bits/stdc++.h>
using namespace std;
#include "../utils/BinaryTree.h"
#include "../utils/Graph.h"
#include "../utils/LinkedList.h"
#include "../utils/Util.h"
class Solution {
public:
int pathSum(TreeNode *root, int sum) {
if (!ro... |
Python | UTF-8 | 1,538 | 3.84375 | 4 | [] | no_license | '''
Exercise: Write a module bag.py that defines a class named bag. A bag (also
called a multiset) is a collection without order (like a set) but with
repetition (unlike a set) --- an element can appear one or more times
in a bag. Implement bag as a subclass of dictionary where each bag
element is a key and its value... |
Shell | UTF-8 | 526 | 2.625 | 3 | [] | no_license | #!/bin/bash
for nombre in "Ada" "background" "c++" "deadpool";
do
mkdir Corrida-$nombre-compresion
mkdir Corrida-$nombre-descompresion
g++ -g ../../HuffmanModificado/*.cpp -fpermissive -o HuffmanCompressor
cp ../../../ArchivosDePrueba/* ./
sleep 2
valgrind --leak-check=full --log-file=./Resultados$nombre-compre... |
PHP | UTF-8 | 1,354 | 2.640625 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: Bright
* Date: 5/22/2016
* Time: 12:26 PM
*/
namespace Aforance\Http\Controllers\Policy\Funeral;
use Aforance\Aforance\Contracts\Repository\FuneralPolicyRepositoryInterface;
use Aforance\Aforance\Repository\CustomerRepository;
use Aforance\Http\Controllers\Controller;
c... |
Python | UTF-8 | 3,476 | 2.546875 | 3 | [] | no_license | import cv2
import numpy as np
def get_rigid_transform(tra, rot):
tra = np.reshape(tra, (3,1))
rigid_transformation = np.append(rot, tra, axis=1)
return rigid_transformation
def get_rottra_from_rigid(rigid):
rot = rigid[0:3,0:3]
tra = rigid.T[3,0:3]
return rot, tra
def fill_holes(mask):
... |
Java | UTF-8 | 2,432 | 2.0625 | 2 | [] | no_license | /**
*
*/
package edu.iiitb.ebay.action;
import java.util.ArrayList;
import java.util.Map;
import org.apache.log4j.Logger;
import com.opensymphony.xwork2.ActionSupport;
import edu.iiitb.ebay.dao.DealsDAO;
import edu.iiitb.ebay.model.entity.CategoryModel;
import edu.iiitb.ebay.model.entity.DealModel;
import edu.ii... |
JavaScript | UTF-8 | 3,802 | 2.546875 | 3 | [] | no_license | import React, { Component } from "react";
import axios from "axios";
import "./Profile.css";
// import { Route, Link } from "react-router-dom";
class Profile extends Component {
constructor(props) {
super(props);
this.state = {
playerImg: [],
stats: []
};
}
componentDidMount = async () =... |
TypeScript | UTF-8 | 6,680 | 2.625 | 3 | [] | no_license | module trl.backend.vm {
export class JSExecutionContexts {
public executionContexts: JSExecutionContext[];
public globalEnvironment: JSLexicalEnvironment;
public objectPrototypeObject: JSObjectPrototypeObject;
public functionPrototypeObject: JSFunctionPrototypeObject;
const... |
Markdown | UTF-8 | 2,696 | 2.796875 | 3 | [] | no_license | ---
author:
name: Topy
body: "I have a bunch of alternative glyphs named incorrectly. For example, there
is a \"four_onum.alt\". \r\n\r\n-Is the correct way to name this four.onum.alt or
maybe four.onum_alt would be better? From what I understand, four.onum1 is preferred,
but it is not that descriptive as I wou... |
Python | UTF-8 | 395 | 3.5 | 4 | [] | no_license | # Given a binary tree, return the inorder traversal of its nodes' values.
class Solution:
def inorderTraversal(self, root: TreeNode) -> List[int]:
return self.helper(root, [])
def helper(self, root, result):
if root is None:
return result
self.helper(root.left, result)
... |
C++ | UTF-8 | 2,499 | 3.5625 | 4 | [] | no_license |
#include <iostream>
#include <complex> //*for complex
#include <tuple>
#include <string>
#include <functional> //*for ref()
int main(int argc, char const *argv[])
{
//std::tuple<std::string, int, int, std::complex<double>> t;
//*************************Test tuple get value and compare*************************... |
C++ | UTF-8 | 1,034 | 2.8125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
char s[105], t[105];
int schars[26], tchars[26];
int automaton()
{
int flag2= 0, j = 0;
for(int i = 0; i < strlen(s); i++)
{
if(s[i] == t[j])
j++;
}
if(j == strlen(t))
flag2 = 1;
return flag2;
}
int suffixarray()
{
for(int i = 0; i < strlen(s); i++)
scha... |
C | UTF-8 | 678 | 4.65625 | 5 | [] | no_license | /*
* C言語のサンプルプログラム - Webkaru
* - 3つの数値から一番大きい数値を探す -
*/
#include <stdio.h>
int main(void)
{
float a, b, c;
printf("異なる3つの数値を入力してください。\n");
printf("1つ目の数値: a = ");
scanf("%f", &a);
printf("2つ目の数値: b = ");
scanf("%f", &b);
printf("3つ目の数値: c = ");
scanf("%f", &c);
if(a>b && a>c)... |
Python | UTF-8 | 1,481 | 2.546875 | 3 | [] | no_license | """
.. :module:: apps.accounts.tasks.ssh
:synopsis: Tasks related to user accounts
"""
import logging
from celery import shared_task
from celery.result import AsyncResult
# pylint: disable=invalid-name
logger = logging.getLogger(__name__)
# pylint: enable=invalid-name
@shared_task(
max_retries=None,
time... |
C# | UTF-8 | 5,353 | 2.59375 | 3 | [] | no_license | using FunBooksAndVideos.Common.Models;
using FunBooksAndVideos.Common.Rules;
using FunBooksAndVideos.Common.Services;
using Moq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FunBooksAndVideos.Tests
{
public class TestFactory
{
... |
JavaScript | UTF-8 | 2,308 | 3.25 | 3 | [] | no_license | function mouseOver(id){
var element = document.getElementById(id);
element.style.color='white';
element.style.backgroundColor='orange';
}
function mouseOut(id){
var element = document.getElementById(id);
element.style.color='orange';
element.style.backgroundColor='white';
}
var intervalFlag = f... |
Markdown | UTF-8 | 3,443 | 2.59375 | 3 | [] | no_license | ---
title: Forrest Bradford's Platform
#x subtitle:
background-image: url("/assets/images/cover platform.jpg")
---
<b>Environment:</b> We must act now to stave off the negative effects Global Warming will have on our children and future generations.
<a href="/environment.html"><small>Read More</small></a>
<... |
Python | UTF-8 | 543 | 3.796875 | 4 | [] | no_license | """
Create a function that returns the determinant of a given square matrix.
### Examples
determinant([[3]]) ➞ 3
determinant([[1, 0], [5, 4]]) ➞ 4
determinant([[3, 0], [2, 2]]) ➞ 6
determinant([[4, 8, 6], [2, 4, 3], [6, 2, 1]]) ➞ 0
### Notes
All inputs are square integer matrices.
... |
Java | UTF-8 | 3,980 | 3.25 | 3 | [] | no_license | package com.lf;
import java.sql.*;
import java.util.HashMap;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.Scanner;
/**
* @ClassName: JdbcLogin
* @Description:使用JDBC实现登陆功能 这种情况下存在sql注入问题 ,解决SQL注入问题
* @Author: 李峰
* @Date: 2021 年 03月 02 18:13
* @Version 1.0
*/
/*
* 1.使用powerDesiginer完成数据库... |
C++ | UTF-8 | 2,537 | 2.640625 | 3 | [] | no_license | // * Question Link -> https://www.hackerrank.com/challenges/the-quickest-way-up/problem
#include <iostream>
#include <unordered_map>
#include <list>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <string>
#include <climits>
#include <utility>
using namespace std;
#define mp make_pa... |
Markdown | UTF-8 | 3,670 | 2.625 | 3 | [] | no_license | ---
layout: post
date: 0014-11-01
name: team-member-nationality-requirements
title: "California: Team Member Nationality Requirements"
category: california
comments: true
---
Note: this is the same information as for other jurisdictions in the US.
Foreigners wanting to start a business of any type in the U.S. follow t... |
Java | UTF-8 | 1,867 | 2.859375 | 3 | [] | no_license | package yelp;
public class ScoreObj
{
private int S1;
private int s2;
private int s3;
private int s4;
private int s5;
private int s6;
private int s7;
private int s8;
private int s9;
private String name;
private String category;
public ScoreObj()
{
S1=-1;... |
C# | UTF-8 | 3,366 | 2.625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LawAgendaApi.Data;
using LawAgendaApi.Data.Entities;
using LawAgendaApi.Data.Queries.Search;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Internal;
namespace LawAgendaApi.Repositories.User... |
Markdown | UTF-8 | 1,856 | 3.625 | 4 | [] | no_license | # Apply Method [](https://travis-ci.com/kazztac/apply_method)
## Overview
Allows you to apply any function given as a parameter to the object.
As you are able to connect operations to the object with chains, it allow you to describe the
se... |
Python | UTF-8 | 15,976 | 2.546875 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Hae-in Lim, haeinous@gmail.com
Models and database functions for Hae-in's Hackbright project."""
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import Index
db = SQLAlchemy()
#####################################################################
... |
PHP | UTF-8 | 5,789 | 3 | 3 | [] | no_license | <?php
/*
* Copyright (C) Phonogram Inc 2012
* Licensed Under the MIT license http://www.opensource.org/licenses/mit-license.php
*/
/*
* class BaseModel
* モデルを代表するクラス。主にデータベースのレコードかフォームのデータになります。
*/
class BaseModel
{
private static $IS_INITIALIZED = false;
private static $CLASS_MODEL_DEFINITIONS;
... |
JavaScript | UTF-8 | 2,165 | 3.046875 | 3 | [
"MIT"
] | permissive | var Toucan = module.exports = function(){
var locked = false;
var perms = {}
var _permit = function(permission){
if(locked)
{
throw new Error("Cannot add permissions after token has been locked");
}
perms[permission] = true;
}
var _deny = function(perm... |
Ruby | UTF-8 | 906 | 3.78125 | 4 | [] | no_license | def translate(words)
many_words = words.split(" ")
finally = []
if many_words.length == 1
return pig_latin_one_word(words)
else
many_words.each do |word|
finally << pig_latin_one_word(word)
end
end
return finally.join(" ")
end
def pig_lat... |
Swift | UTF-8 | 3,185 | 2.515625 | 3 | [] | no_license | //
// AnnounceList.swift
// KeepChild
//
// Created by Clément Martin on 13/09/2019.
// Copyright © 2019 Clément Martin. All rights reserved.
//
import Foundation
import FirebaseFirestore
import CodableFirebase
class AnnounceList {
var delegateAnnounceList: AnnounceListDelegate?
var announceRefe... |
SQL | UTF-8 | 12,256 | 2.890625 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.17, for Win32 (AMD64)
--
-- Host: localhost Database: ihome
-- ------------------------------------------------------
-- Server version 5.7.17-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*... |
Ruby | UTF-8 | 3,652 | 3.375 | 3 | [
"MIT"
] | permissive | require 'drudge/errors'
require 'drudge/parsers'
require 'drudge/parsers/types'
class Drudge
# Describes a command and helps executing it
#
# The command is defined by a name and a list of arguments (see class Param).
# The body of the command is a lambda that accepts exactly the arguments
class Command
... |
C | UTF-8 | 1,400 | 2.671875 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2018
** my_defender
** File description:
** map_load
*/
#include "defender.h"
sfVector2f get_castle_pos(tiles_t *tile_list)
{
sfVector2f error = {0, 0};
for (tiles_t *tile = tile_list; tile != NULL; tile = tile->next) {
if (tile->type == 'G') {
return (tile->visual->... |
Java | UTF-8 | 295 | 2.875 | 3 | [
"MIT"
] | permissive | package util;
public class AddressRange {
public final long start;
public final long end;
public AddressRange(long startAddress, long endAddress) {
start = startAddress;
end = endAddress;
}
public Boolean contains(long address) {
return (address >= start && address < end);
}
}
|
Java | UTF-8 | 828 | 2.4375 | 2 | [] | no_license | package com.hit.server;
import com.google.gson.Gson;
@SuppressWarnings("serial")
public class Request<T>
extends java.lang.Object
implements java.io.Serializable {
private java.util.Map<java.lang.String, java.lang.String> headers;
T body;
public Request(java.util.Map<java.lang.String,java.lang.Stri... |
C# | UTF-8 | 1,711 | 2.625 | 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.Windows.Forms;
namespace VehicleSimulator
{
public partial class frmChangeVehicleODO : Form
{
public double? NewODO { get; private s... |
Java | UTF-8 | 906 | 2.859375 | 3 | [] | no_license | package lcwu;
public class Solution88 {
public void merge(int[] nums1, int m, int[] nums2, int n) {
int sum[]=new int[m+n];
int i =0;
for(;i<m;i++){
sum[i]=nums1[i];
}
for(i =0;i<n;i++){
sum[i+m]=nums2[i];
}
int temp=0;
for(int ... |
Markdown | UTF-8 | 7,588 | 2.546875 | 3 | [
"MIT"
] | permissive | [](https://badge.fury.io/js/cdk-apig-utility)
[](https://coveralls.io/github/A-Kurimoto/cdk-apig-utility?branch=master)
cdk-apig-utility
====
Have you e... |
Python | UTF-8 | 6,870 | 4 | 4 | [
"BSD-3-Clause"
] | permissive | """
Investigation of Euler method for integrating ODE: error vs number of steps.
It shows that for unstable cases, increasing the number of steps does not always improve the approximation.
"""
import numpy as np
import matplotlib.pyplot as plt
def euler_met_1(f, xa, xb, ya, n, verbose=False, y_ground=None, return_all... |
Java | UTF-8 | 7,211 | 2 | 2 | [] | no_license | package io.cran.trippy.activities;
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Intent;
import android.media.Image;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AppCompatActivity;
import android... |
Markdown | UTF-8 | 6,974 | 3.25 | 3 | [] | no_license | # 15生成数据
## 15.2绘制简单的折线图
mpl_squares.py
`import matplotlib.pyplot as plt`导入matplotlib.pyplot
变量`fig`表示整张图片。变量`ax`表示图片中的各个图表
方法`plot()`,它尝试根据给定的数据以有意义的方式绘制图表
函数`plt.show()`打开Matplotlib查看器并显示绘制的图表
## 15.2.1修改标签文字和线条粗细
参数`linewidth`决定了`plot()` 绘制的线条粗细。
参数`fontsize`指定图表中各种文字的大小
方法`set_xlabel()` 和`set_ylabel()` 让你能够为每条轴设... |
C++ | GB18030 | 1,856 | 3.25 | 3 | [] | no_license | #include "p532ϰ2_ͷļ.h"
#include <cstring>
#include <iostream>
using namespace std;
Cd::Cd(char * s1, char * s2, int n, double x)
{
performers = new char[strlen(s1) + 1];
strcpy(performers, s1);
label = new char[strlen(s2) + 1];
strcpy(label, s2);
selections = n;
playtime = x;
}
Cd::Cd(const Cd & d)
{
perform... |
Java | UTF-8 | 3,751 | 2.5 | 2 | [] | no_license |
package org.spinachtree.gist;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.util.*;
class Transform {
private Map<String,Method> ruleMethod = new HashMap<String,Method>();
private static final Class[] parameterTypes={Object[].class};
private Parser parser;
... |
C# | UTF-8 | 4,374 | 2.671875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using DnDApp.Models;
using DnDApp.Models.Data;
namespace DnDApp.Controllers
... |
Markdown | UTF-8 | 845 | 2.6875 | 3 | [] | no_license | # Odometry
Odometry is the use of data from motion sensors to estimate change in position over time.
This ROS node provides position estimates based on the following sources:
* [x] wheel velocities (dead reckoning)
* [ ] IMU sensor readings
* [ ] control inputs and robot dynamics
## Error
### Dead Reckoning
Th... |
Python | UTF-8 | 1,570 | 2.75 | 3 | [] | no_license | import logging
from telegram.ext import Updater
from telegram.ext import CommandHandler, MessageHandler, Filters
# creates a variable to store the bot token
updater = Updater(token='401734925:AAFDIy_Z48vlnf1p0LDRO7OR_olpz0m3lXc')
dispatcher = updater.dispatcher
# add logging
logging.basicConfig(
format='%(ascti... |
Java | UTF-8 | 1,004 | 2.625 | 3 | [] | no_license | package sonhv.com.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "BOOK")
public class Book {
// member variables
@Id
@GeneratedValue
@Column(name = "BOOK_ID")
p... |
PHP | UTF-8 | 651 | 2.65625 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: Renatas Narmontas
* Date: 07/04/16
* Time: 00:03
*/
namespace Nfq\WeatherBundle\Provider;
use Exception;
class WeatherProviderException extends Exception
{
/**
* WeatherProviderException constructor.
* @param string $message
* @param int $code
* @... |
Java | UTF-8 | 2,295 | 3.71875 | 4 | [] | no_license | import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.stream.Stream;
/**
* Clase Main
* Se encarga de la interacción coon el usuario, coloca el documento txt, lol lee y devuelve el resultado.
*
* @a... |
C++ | UTF-8 | 2,093 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <optional>
#include <base/types.h>
#include <Storages/MergeTree/MergeTreeDataPartType.h>
#include <Disks/IDisk.h>
#include <Storages/MergeTree/IDataPartStorage.h>
namespace DB
{
class MergeTreeData;
/** Various types of mark files are stored in files with various extensions:
* .mrk, .mrk2, ... |
Java | UTF-8 | 1,037 | 2.421875 | 2 | [] | no_license | package service;
import model.Book;
import java.util.List;
/**
* author:丁雯雯
* time:2019/01/22
* 管理书籍的方法
*/
public interface BookManageService {
/**
* function:根据书籍的ID获得书籍的基本信息
* from tables: book
* */
public Book getBookInfoById(String id);
/**
* function:添加书籍的信息入库
* change... |
Java | UTF-8 | 4,935 | 2.40625 | 2 | [
"Apache-2.0"
] | permissive | package io.github.privacystreams.device;
import android.Manifest;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiManager;
im... |
JavaScript | UTF-8 | 12,668 | 2.953125 | 3 | [
"MIT"
] | permissive | /*
This module provides the dialogs for managing decision knowledge. The user can
* create a new decision knowledge element,
* edit an existing decision knowledge element,
* delete an existing knowledge element,
* create a new link between two knowledge elements,
* delete a link between two knowledge elements,
*... |
Java | UTF-8 | 83 | 1.59375 | 2 | [] | no_license | package xyz.lebster.node;
public @interface SpecificationURL {
String value();
}
|
PHP | UTF-8 | 382 | 3 | 3 | [] | no_license | <?php
// get the q parameter from URL
$q = $_REQUEST["q"];
//Checks if the URL has "www.linkedin.com" for validation
if ($q !== "") {
$q = strtolower($q);
if (strpos($q, 'www.linkedin.com') !== false) {
echo '<span class="col-25" style="color:green;">Valid URL</span>';
}else{
echo '<span cla... |
C | UTF-8 | 2,331 | 2.578125 | 3 | [] | no_license | /*
* file.c
*
* Created on: May 23, 2021
* Author: cory
*/
#include "../lib/file.h"
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <linux/fs.h>
#include <sys/ioctl.h>
#include <stdio.h>
#define SET_FLAG(field, flag, attr) field = ((flag & attr) ? 1 : 0)
#define SAVE_FLAG(field, flag, a... |
C# | UTF-8 | 12,793 | 2.6875 | 3 | [] | no_license | //**********************************************************************************
//* Copyright (C) 2007,2016 Hitachi Solutions,Ltd.
//**********************************************************************************
#region Apache License
//
// Licensed under the Apache License, Version 2.0 (the "License");
// y... |
C++ | UTF-8 | 3,254 | 3.109375 | 3 | [] | no_license | /** @file LockTable.hpp
* LockTable stores all the file locks in system,
* and provide fast lookup from filename and it's owner.
*
* @author PengBo
* @date 24 7 2007
*
* design notes: <br>
* 1. it is a collection data structure supporting fast lookup ability, <br>
* such as map/hash_map. <br>
* ... |
JavaScript | UTF-8 | 2,429 | 2.703125 | 3 | [] | no_license | import React, { Component } from 'react';
class DeviceInfo extends Component {
constructor(props) {
super(props);
this.state = {
deviceState: this.props.device_info.state,
deviceStateArr:[{
"state": this.props.device_info.type,
"time... |
C | UHC | 3,319 | 3.734375 | 4 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
/*
"abcabcdede" , ڸ 2 ڸ ab/ca/bc/de/de̹Ƿ ̸ ϸ "abcabc2de
, 3 ڸٸ abc/abc/ded/e̹Ƿ "2abcdede Ǿ 3 ª
˴ϴ. ( ڸ ڵ ״ ٿָ ȴ)
ڿ s Ű ־ , 1 ̻ ڿ ߶ Ͽ
ǥ ڿ * ª ̸ return *ϵ Լ ϼּ.
#1
aabbaccc
7
#2
ababcdcdababcdcd
9
#3
abcabcdede
8
#4
abcabcabcabcdededededede
... |
Python | UTF-8 | 1,514 | 3.640625 | 4 | [] | no_license | import random
from bokeh.plotting import figure, show
def tirar_dado(numero_de_intentos):
secuencia_de_tiros = []
for _ in range(numero_de_tiros):
tiro = random.choice([1,2,3,4,5,6])
secuencia_de_tiros.append(tiro)
return secuencia_de_tiros
def graficar(x,y):
grafica = figure(title = '... |
Python | UTF-8 | 936 | 3.546875 | 4 | [] | no_license | #-*- coding:utf8 -*-
#author : Lenovo
#date: 2018/9/17
a=1
print('a:{}'.format(id(a)))
def fun(a):
a=2
print('fun_a:{}'.format(id(a)))
fun(a)
print('a:{}'.format(id(a)))
print(a)
#上面代码可以看到a的值还是1 说明函数并没有对a起作用
#python中对象有两种 不可变对象 string tuple number 可变对象 list dict set
#当函数中对一个不可变对象赋值时 并不会发生改变
b=[]
def funb... |
Java | UTF-8 | 308 | 1.765625 | 2 | [] | no_license | package org.gradle.test.performancenull_173;
import static org.junit.Assert.*;
public class Testnull_17228 {
private final Productionnull_17228 production = new Productionnull_17228("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} |
Shell | UTF-8 | 799 | 3.328125 | 3 | [
"MIT"
] | permissive | #!/bin/bash
# simple TODO list using [todoman](https://github.com/pimutils/todoman) and [vdirsyncer](https://github.com/pimutils/vdirsyncer)
sync(){
[[ "$failed_sync" ]] && return
if ! error="$(vdirsyncer sync calendar 2>&1 > /dev/null)"; then
failed_sync="true"
notify-send -a todo -u low -i t... |
Java | UTF-8 | 1,532 | 2.34375 | 2 | [] | no_license | package com.youhone.yjsboilingmachine.guide;
import com.youhone.yjsboilingmachine.R;
import java.util.Arrays;
import java.util.List;
/**
* Created by Glen Luengen on 4/13/2018.
*/
public class MeattypeStation {
public static MeattypeStation get() {return new MeattypeStation();}
private MeattypeStation()... |
Java | UTF-8 | 574 | 2.015625 | 2 | [] | no_license | package com.javaee.fabiola.acoes.services;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.javaee.fabiola.acoes.repositories.MensagemRepository;
import com.javaee.fabiola.acoes.domain.Mensagem;
//import com.javaee.fabiola.acoes.repositories.Men... |
Shell | UTF-8 | 136 | 2.8125 | 3 | [] | no_license | #!/usr/bin/env bash
# File: array_sum.sh
arr1=(pa ra pa pa)
arr2=(beep boop beep boop)
sum=$(expr ${#arr1[*]} + ${#arr2[*]})
echo $sum
|
SQL | UTF-8 | 796 | 3.515625 | 4 | [] | no_license | SELECT
*
FROM
kaoqin
WHERE
ename = '朱伟亮'
AND EXTRACT(
YEAR_MONTH
FROM
'2015-8-9'
) = EXTRACT(
YEAR_MONTH
FROM
clock
)
ORDER BY
clock ASC;
SELECT
*
FROM
kaoqin
WHERE
ename = '朱伟亮'
AND clock BETWEEN '2015/08/01' A... |
PHP | UTF-8 | 2,156 | 2.625 | 3 | [] | no_license | <?php
namespace Arbor\Model\UkDfe;
use Arbor\Resource\UkDfe\ResourceType;
use Arbor\Query\Query;
use Arbor\Model\Collection;
use Arbor\Model\Exception;
use Arbor\Model\ModelBase;
class LocalAuthority extends ModelBase
{
public const AUTHORITY_CODE = 'authorityCode';
public const AUTHORITY_CODE_PRE2011 = 'au... |
Java | UTF-8 | 406 | 1.789063 | 2 | [] | no_license | package LanchoneteFactory.lanchonetes;
/*
* 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 emers
*/
public class Main {
public static void main(String[] args) {
... |
JavaScript | UTF-8 | 613 | 4.3125 | 4 | [] | no_license | // Is unique
/*
use hashtable
Itterate over characeters add to map
if character is in map then we fail
else add character to map
Sort method
sort characters
if neighbors are equal return false
*/
const isUnique = function (str) {
if (str.length > 128) {
return false;
}
const ch... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.