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 |
|---|---|---|---|---|---|---|---|
C | UTF-8 | 1,813 | 3.375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
#include "headers.h"
/** Le r�le de cet fonction est de revenir au menu principale **/
void QUITTER_menu(void)
{
system("cls"); /// Sa sert � effacer tout ce qu'il y a � ... |
JavaScript | UTF-8 | 6,184 | 3.015625 | 3 | [] | no_license | window.onload = function(){
//Gets bell sound
var snd = new Audio("img/bell.mp3");
snd.volume = .4;
/* This change view object has four methods to choose from: init, reset, toPom, toBreak */
var changeView = {
toInit: function() {
clocks.render.breakClock = false;
clocks.render.arrows = false;
i... |
Shell | UTF-8 | 2,754 | 3.875 | 4 | [] | no_license | #!/bin/bash
# link-files
prgname="WEECHAT"
echo -e "\e[1;36mInstalling ... ${prgname} ... configuration files ...\e[0m"
sleep 1
source INSTALL_ALL/config.bash
wcpath=""
srcpath=""
# Config
if [[ ${HOSTNAME} == "botis" ]] ; then # check if it is my only Mac Os Machine by hostname
wcpath="/Users/${USER... |
Java | UTF-8 | 655 | 2.25 | 2 | [] | no_license | package com.cellsgame.game.module.func.impl.checker;
import com.cellsgame.game.core.excption.LogicException;
import com.cellsgame.game.module.func.FuncParam;
import com.cellsgame.game.module.func.IChecker;
import com.cellsgame.game.module.player.msg.CodePlayer;
import com.cellsgame.game.module.player.vo.PlayerVO... |
Java | UTF-8 | 2,513 | 2.359375 | 2 | [] | no_license | package pl.kata.yahtzee;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.InetAddress;
import java.net.UnknownHostException;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;... |
PHP | UTF-8 | 271 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Charges extends Model
{
protected $table='charges';
protected $fillable=['code','description','charge_type'];
public function getDateFormat()
{
return 'Y-m-d H:i:s.u';
}
}
|
Java | UTF-8 | 5,051 | 2.34375 | 2 | [] | no_license | package mvp.jorge.com.rxretrofit20170214.http;
import android.annotation.SuppressLint;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* Created by math on 2017/1/19.
*/
/**
* {"userId":"","height":"1920"... |
JavaScript | UTF-8 | 1,467 | 4 | 4 | [] | no_license | const escola = "Cod3r"
console.log(escola.charAt(4)) //pega o caracter na posição
console.log(escola.charAt(5)) // não da erro caso o valor não seja correto, apenas um espaço vazio, já que ele não encontrou nada
console.log(escola.charCodeAt(3)) // o códido desse caracter na tabela ASCII (alt+51= 3)
console.log(escola... |
Java | UTF-8 | 6,362 | 1.867188 | 2 | [] | no_license |
package com.delphi_tech.ows.policy;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for CommissionType complex type.
... |
Java | UTF-8 | 1,111 | 2.6875 | 3 | [] | no_license | package ch.usi.inf.ds.nfsclient.client;
import ch.usi.inf.ds.nfsclient.files.FileWatcherListener;
import java.io.File;
import java.io.FileInputStream;
public class NFSFileListener implements FileWatcherListener {
private final Client client;
public NFSFileListener(final Client client) {
this.clien... |
Markdown | UTF-8 | 4,290 | 2.8125 | 3 | [] | no_license | # Hotmaps wiki
This image offers an easy way to deploy any git-based wiki repository.
Just tell where your wiki is located and it will deploy a web application that allows to edit/add/remove pages. A basic authentication system is preinstalled and can be configured to only allow certain users to make changes to the wi... |
JavaScript | UTF-8 | 467 | 2.921875 | 3 | [] | no_license | //https://www.hackerrank.com/challenges/drawing-book/problem
function pageCount(n,p){
let forward = (p-1)/2;
if(p%2 == 0){
forward = Math.ceil(forward);
}
let backward = ((n-p)/2);
if(n%2 != 0 && p%2 == 0){
backward = Math.floor(backward);
}
else if(n%2 == 0 && p%2 != 0){... |
Java | UTF-8 | 539 | 3.046875 | 3 | [] | no_license |
public class Person
{
String fName, lName;
int age;
public Person()
{
}
public Person(String fn ,String ln, int theAge)
{
this.fName = fn;
this.lName = ln;
this.age = theAge;
}
public String getfName()
{
return fName;
}
public void setfName(String fName)
{
this.fName = fName;
}
pu... |
Java | UTF-8 | 1,785 | 2.75 | 3 | [] | no_license | package lesson_7;
import org.openqa.selenium.*;
import org.openqa.selenium.support.ui.ExpectedCondition;
import javax.annotation.Nullable;
import java.util.List;
public class CustomConditions {
public static ExpectedCondition<List<WebElement>> listNthElementHasText(By locator , int nthElement, String hasText) {
... |
PHP | UTF-8 | 1,402 | 2.65625 | 3 | [] | no_license | <?php
require "../h.php";
$response = "ERROR: no accetable parameters were set.";
// build the sql query
// Gets a list of persons at the given event and orders them by their score seperated by gauge class
if( isset( $_GET['event_id'] ) && isset( $_GET['shooters'] ) ){
$sql = "SELECT person.team_name, person.first... |
C++ | UTF-8 | 1,124 | 3.1875 | 3 | [
"MIT"
] | permissive | #include "adventhelper.h"
char* AdventHelper::stringToCString(string str){
int len = str.length();
char *cstr = new char[len+1];
strcpy(cstr, str.c_str());
return cstr;
}
int AdventHelper::instancesOfCharInCString(char c, const char* cstr){
int count = 0;
int i = -1;
do {
i++;
if(cstr[i] ... |
Markdown | UTF-8 | 5,316 | 3.546875 | 4 | [] | no_license | # java-custom-dependency-injection
This library was heavily based on Spring Boot and .Net Core dependency injection syntax.

[](https://ci... |
JavaScript | UTF-8 | 5,555 | 2.90625 | 3 | [] | no_license | var MYLIBRARY = MYLIBRARY || (function(){
var _args = {}; // private
chart = {};
svg = {};
return {
init : function(Args) {
_args = Args;
// some other initialising
},
helloWorld : function(Args) {
var padding = 30;
var margin = {top: 20, right: 20, bot... |
Java | UTF-8 | 1,569 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | package accident.service;
import accident.model.Accident;
import accident.repository.AccidentMem;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* AccidentService.
*
* @author Maxim Vanny
* @version 5.0
* @since 6/4/2020
*/
@Service
public class AccidentService {
/**
* field ... |
Java | UTF-8 | 363 | 2.5 | 2 | [] | no_license | import org.junit.Test;
import static junit.framework.Assert.assertEquals;
/**
* User: igen322
* Date: 1/24/11
* Time: 8:34 AM
*/
public class SillyWalksTest {
@Test
public void walkSilly() throws Exception {
SillyWalk walkies = new SillyWalk("Egyptian");
assertEquals("Eg... |
C# | UTF-8 | 1,325 | 2.734375 | 3 | [] | no_license | using Galeria.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Galeria.DAL.Repositories
{
public class UsersRep : GenericRepository<User>
{
public UsersRep(GaleriaContext context) : base(context)
{
}
... |
PHP | UTF-8 | 1,433 | 2.609375 | 3 | [] | no_license | <?php
/**
* Pack Thrift-bin with extension
* User: moyo
* Date: 10/22/15
* Time: 3:23 PM
*/
namespace Kdt\Iron\Nova\Protocol\Packer;
use Kdt\Iron\Nova\Protocol\Container;
use Exception as SysException;
class Extension extends Abstracts
{
/**
* @var Container
*/
private $container = null;
... |
Python | UTF-8 | 2,618 | 3.046875 | 3 | [] | no_license | import pygame
import data.game_func as gff
class Tank(pygame.sprite.Sprite):
def __init__(self, who, settings, screen, bullets):
super().__init__()
self.settings = settings
self.screen = screen
self.animation = gff.GameFunc.load_anim(who)
self.now_img = self.animation[0]
... |
TypeScript | UTF-8 | 107 | 2.671875 | 3 | [
"MIT"
] | permissive | /**
* Represent a string in multiple languages.
*/
export type Literal = { [language: string]: string };
|
TypeScript | UTF-8 | 1,150 | 2.703125 | 3 | [] | no_license | import {Component, OnInit} from '@angular/core';
import {interval, Observable} from 'rxjs';
@Component({
selector: 'app-clock',
templateUrl: './clock.component.html',
styleUrls: ['./clock.component.css']
})
export class ClockComponent implements OnInit {
private timer: Observable<number>;
public timestr = ... |
Python | UTF-8 | 7,357 | 3.28125 | 3 | [
"Apache-2.0"
] | permissive | import pygame
import random
import os
from pygame import mixer
#________________________importing Music____________________:-
pygame.mixer.init()
pygame.init()
screen_height = 600
screen_width = 900
gameWindow = pygame.display.set_mode((screen_width,screen_height))
pygame.display.set_caption("Sn... |
Markdown | UTF-8 | 2,664 | 2.734375 | 3 | [
"CC-BY-4.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | ---
title: Setting Up Kernel-Mode Debugging in Visual Studio
description: You can use Microsoft Visual Studio to set up and perform kernel-mode debugging of Windows.
ms.assetid: 38E57F45-71D9-4467-BECF-42769563751E
keywords: ["Kernel-mode debugging, Visual Studio", "Setting up kernel-mode debugging, Visual Studio"]
ms.... |
Python | UTF-8 | 421 | 4.8125 | 5 | [] | no_license | """
Instructions:
Welcome. In this kata, you are asked to square every digit of a number.
For example, if we run 9119 through the function, 811181 will come out, because 92 is 81 and 12 is 1.
Note: The function accepts an integer and returns an integer
"""
def square_digits(num):
return int(''.join(str(int(i)... |
Markdown | UTF-8 | 3,124 | 3.15625 | 3 | [] | no_license | # create a new repository on the command line
### echo "# practice" >> README.md
### git init
### git add README.md
### git commit -m "first commit"
### git remote add origin https://github.com/gowtham551/practice.git ---versioning
### git push -u origin master --the data from local repo to remote repository
### git... |
PHP | UTF-8 | 920 | 3.53125 | 4 | [] | no_license | <?php
namespace DotArray;
/**
* Extract
*
* Simple class to extract values from a key using dot-notation.
*
* ```
* $value = DotArray\Extract::keyFromArray('a.b.c', ['a' => ['b'=>['c' => 'hello world']]]);
* echo $value; // 'hello world';
* ```
*/
class Extract {
public static function keyFromArray(s... |
JavaScript | UTF-8 | 1,214 | 2.53125 | 3 | [] | no_license | var data = require('../employer_prof.json');
var user;
exports.view = function(req, res){
if(!req.session.user){
res.redirect('/log_in');
res.send();
}
console.log("profile data :: ");
console.log("session user is " + req.session.user);
// user = req.params.user;
res.ren... |
PHP | UTF-8 | 1,142 | 2.59375 | 3 | [] | no_license | <?php
/*
* Index file for the gymstat_manager folder. Will contain switch
* to direct where the user needs to go.
*/
require_once ('../Model/database.php');
require_once('../Model/gymstat_db.php');
$patrons = get_total_patrons();
$action = filter_input(INPUT_POST, 'action');
$total_patrons = count($patrons);
$ma... |
Python | UTF-8 | 2,816 | 2.84375 | 3 | [] | no_license | import sys
import csv
import json
from collections import OrderedDict;
out_file = sys.argv[1];
data = OrderedDict();
def read_parts (in_file, attr_name):
data[attr_name] = []
with open(in_file, 'rb') as fd:
reader = csv.reader(fd, quoting=csv.QUOTE_NONE)
next(reader, None)
for row in... |
Java | WINDOWS-1252 | 893 | 2.46875 | 2 | [] | no_license | package de.chas0r.androidtest;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
public class AndroidService extends Service {
public AndroidService() {
}
@Override
public int onStartCommand(Intent intent, int flags... |
SQL | UTF-8 | 877 | 3.125 | 3 | [] | no_license | SELECT product_id, order_date,
LAG (order_date,1) OVER (ORDER BY order_date) AS prev_order_date
FROM orders;
/*
ORDER_DATE PRODUCT_ID QTY
2007/09/25 1000 20
2007/09/26 2000 15
2007/09/27 1000 8
2007/09/28 2000 12
2007/09/29 2000 2
2007/09/30 1000 4
***RESULT***
PRODUCT_ID ORDER_DATE PREV_ORDER_DATE
1000 2007/... |
PHP | UTF-8 | 3,684 | 2.734375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* This file is part of the BEAR.Sunday package
*
* @package BEAR.Sunday
* @license http://opensource.org/licenses/bsd-license.php BSD
*/
namespace BEAR\Sunday\Output;
use BEAR\Resource\Object as ResourceObject;
use Symfony\Component\Console\Output\ConsoleOutput;
use Guzzle\Parser\UriTemplate\UriTemplate... |
Python | UTF-8 | 5,112 | 2.671875 | 3 | [] | no_license | import click
import numpy as np
import pandas as pd
from itertools import islice
from pathlib import Path
from datetime import datetime
from operator import itemgetter
from collections import defaultdict
from itertools import combinations
from sklearn.cluster import AgglomerativeClustering
def get_partitions(Z, burn_... |
JavaScript | UTF-8 | 1,206 | 3.390625 | 3 | [
"MIT"
] | permissive | function ShapeDraw(){
this.x=0;
this.y=0;
// rect
// ellipse
this.shape = "rect";
this.width=0;
this.height=0;
this.angle=0;
this.fillcolour="black";
this.fillOpacity=1;
this.lineColour;
this.lineWidth;
this.defineRect = function(anX, anY, aWidth, aHeight, anAn... |
C# | UTF-8 | 756 | 4 | 4 | [] | no_license | using System;
using System.Linq;
namespace _05._Magic_exchangeable_words
{
class Program
{
static void Main(string[] args)
{
var text = Console.ReadLine().Split(' ').ToArray();
var word = text[0];
var word2 = text[1];
Console.WriteLine(IsExchang... |
Java | UTF-8 | 694 | 2.09375 | 2 | [] | no_license | package com.soul.mapper;
import com.soul.pojo.User;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.io.IOException;
import java.util.List;
public class Use... |
Java | UTF-8 | 728 | 2.59375 | 3 | [] | no_license | package br.com.gsn.sysbusapp.util;
import java.util.regex.Pattern;
/**
* Created by Geison on 12/08/2015.
*/
public final class RegexValidatorUtil {
private static final String EMAIL_PATTERN = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
priv... |
JavaScript | UTF-8 | 282 | 2.546875 | 3 | [] | no_license | const formatCourses = courses => {
if (courses[0] === null) {
return null
}
else {
const formattedCourses = {}
courses.forEach(course => formattedCourses[course._id] = course)
return formattedCourses
}
}
export default formatCourses; |
C++ | UTF-8 | 452 | 3 | 3 | [] | no_license | #pragma once
#include <sstream>
#include <vector>
#include <iostream>
#include <string>
enum class TokenType {
ARITHMETIC_OP,
VARNAME,
DATA,
UPPER,
PAREN_LEFT,
PAREN_RIGHT,
COS,
SIN,
EXP,
LOG,
};
struct Token {
const std::string value;
const TokenType type;
};
std::vector<Token> Tokenize(std::istream& i... |
Markdown | UTF-8 | 1,049 | 2.53125 | 3 | [] | no_license | ---
ID: 321
post_title: Windsurfing Skills
author: admin-uisce
post_excerpt: ""
layout: page
permalink: >
https://uisce.ie/courses/week-long-skills/windsurfing-skills/
published: true
post_date: 2014-01-14 17:43:50
---
<h2>Improvers Course</h2>
Availability: 6 Places<img class=" wp-image-703 alignright" src="https://... |
Python | UTF-8 | 922 | 3.984375 | 4 | [] | no_license | import random
def play():
CompNum = random.randint(1,100)
userAnswer = -1
GuessCount = 0
while userAnswer != CompNum:
try:
userAnswer = int(raw_input('Whats your guess? '))
if userAnswer < CompNum:
print 'Too low'
GuessCount = GuessCount +... |
Java | UTF-8 | 6,350 | 1.96875 | 2 | [] | no_license | package com.tumi.testcases;
import java.util.Map;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.asserts... |
JavaScript | UTF-8 | 705 | 3.0625 | 3 | [] | no_license | const App = Vue.createApp({
data() {
return {
loading: true,
title: '',
typ: '',
joke: ''
}
},
methods: {
async fetchJoke() {
this.loading = true;
const response = await fetch('http://localhost:8080/random');
... |
Markdown | UTF-8 | 2,954 | 2.625 | 3 | [] | no_license |
Formats: [HTML](/news/2006/02/10/the-2006-winter-olympics-open-in-turin-italy-with-the-opening-ceremony-at-the-stadio-olimpico-it-is-the-20th-winter-games-and-the-second.html) [JSON](/news/2006/02/10/the-2006-winter-olympics-open-in-turin-italy-with-the-opening-ceremony-at-the-stadio-olimpico-it-is-the-20th-winter-ga... |
Markdown | UTF-8 | 13,966 | 4 | 4 | [
"MIT"
] | permissive | ---
layout: post
title: Golang 泛型实践
description: Go 1.18 正式发布泛型,可以考虑用起来了。
category: blog
---
## 泛型
### 泛型是什么
> 开宗明义,泛型,类型形参和类型实参
在函数定义中,定义要求的参数叫形参,实际传入的参数叫实参,在强类型编程语言中要求形参和实参的类型一致。
这样就会有一个问题,导致我们的函数限制非常强,特别是在 Golang 的数字类型有很多种的情况下。
```go
package main
import "fmt"
func MinInt(a, b int) int {
if a <= b {
... |
Python | UTF-8 | 4,299 | 2.859375 | 3 | [] | no_license | import time
from functools import wraps
from collections import defaultdict, Counter
import sys
import copy
import numpy as np
from collections import defaultdict, Counter
import sys
import copy
import numpy as np
best_score = -1
def timer(func):
@wraps(func)
def wrapper(*args, **kwargs):
start = time.... |
Python | UTF-8 | 592 | 2.703125 | 3 | [] | no_license | import sys
input = lambda:sys.stdin.readline().strip()
n,m = map(int, input().split())
edge = [[]]
room = [0 for i in range(m+1)]
check = [0 for i in range(m+1)]
for i in range(n):
edge.append(list(map(int, input().split()))[1:])
ret = 0
def func(v):
if visit[v]:
return 0
visit[v] = 1
for ele... |
Python | UTF-8 | 1,478 | 2.53125 | 3 | [] | no_license | from flask import request
from flask_restplus import Resource
from app.main.service.user_service import get_all_users, \
get_user, \
update_user, \
delete_user, \
save_new_user
from app.main.util.dto import UserDto
api = UserDto.api
_user = UserDto.user
@api.route('/')
class UserList(Resource):
... |
C | UTF-8 | 2,557 | 3.421875 | 3 | [] | no_license | #include "problem4.h"
extern int NEGLIM;
int main(int argc, char **argv) {
char fileName[MAXFILELEN];
char *input;
char message[MAXFILELEN];
int result;
btNode *root;
if (argc > 1)
ERROR("Too many arguments. Usage: ./problem4.exe");
printf("Enter name of input text file: ");
if (gets(fileName) == NULL) {
... |
Java | UTF-8 | 35,458 | 1.554688 | 2 | [] | no_license |
package nl.webservices.soap;
import java.math.BigDecimal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for DNBEnterpriseManagement complex type.
*
* <p>... |
Python | UTF-8 | 783 | 3.015625 | 3 | [] | no_license | '''
Created on 2015. 12. 11.
@author: cpslab
'''
import util.MPlot as mp
class gl:
xl=[]
vl=[]
def clear():
gl.xl=[]
gl.vl=[]
def add_p(x,y):
gl.xl.append(x)
gl.vl.append(y)
def add_d(x,y1,y2):
gl.xl.append(x-0.01)
gl.vl.append(y1)
gl.xl.append(x)
gl.vl.... |
PHP | UTF-8 | 776 | 2.65625 | 3 | [] | no_license | <?php
namespace app\common\library;
use think\Session;
/**
* Class ApiAuthHandler
* API授权助手
* @package app\common\library
*/
class ApiAuthHandler
{
/**
* 获取验证的session
* @return mixed
*/
public static function getWebToken()
{
if(! Session::has('index_web_token', 'common'))
... |
C | UTF-8 | 566 | 3.8125 | 4 | [] | no_license | #include "binary_trees.h"
/**
* binary_tree_height - measures the height of a binary tree
* @tree: node of tree
* Return: size
*/
size_t binary_tree_height(const binary_tree_t *tree)
{
int countRight = 0;
int countLeft = 0;
if (tree == NULL)
return (0);
/* compute the height of each subtree */
if (tree->l... |
Python | UTF-8 | 10,141 | 3.109375 | 3 | [] | no_license | #Midterm Project
#Pelican Collective Brief Members
#Daniel Howe, Rogelio Moreno, Jiwan Sandhu
######################
# Modifiers of Color #
######################
def shadesTriColor(picture):
#Apply color transformation to each pixel in for loop
for x in range (0,getWidth(picture)):
for y in range (0, getHeigh... |
PHP | UTF-8 | 1,408 | 3.203125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: user
* Date: 14.12.15
* Time: 12:54
*/
namespace AbstractIterator;
class ObjectList
{
protected $objects = [];
protected $index = 0;
public function add(AbstractObject $object)
{
$this->objects[$this->index++] = $object;
}
public functio... |
JavaScript | UTF-8 | 4,165 | 2.96875 | 3 | [] | no_license | import { createNDimensionArray } from "./GlobalFunctions";
import { ImageBuff } from "./ImageBuff";
/**
* 1枚の画像から複数のチップ画像を生成するクラス
* @param i {number} チップ1枚の横幅
* @param j {number} チップ1枚の高さ
* @param k {number} チップが横に並ぶ数
* @param l {number} チップが縦に並ぶ数
* @param bufferedimage {ImageBuff} オリジナルの画像
* @constructor
*/
f... |
Java | UTF-8 | 185 | 2.0625 | 2 | [] | no_license | package com.csvcounter.spring.dao;
import com.csvcounter.spring.domain.MyData;
public interface MyDataDAO extends GenericDAO<MyData>{
public MyData fetchMyDataById(Integer id);
}
|
Python | UTF-8 | 9,234 | 2.578125 | 3 | [] | no_license | # _*_coding:utf-8_*_
# Author:Jaye He
import re
import os
def sql_parse(sql, key_lis):
'''
解析sql命令字符串,按照key_lis列表里的元素分割sql得到字典形式的命令sql_dic
:param sql:
:param key_lis:
:return:
'''
sql_list = []
sql_dic = {}
for i in key_lis:
b = [j.strip() for j in sql.split... |
Java | UTF-8 | 193 | 1.507813 | 2 | [
"Apache-2.0"
] | permissive | package org.iglooproject.wicket.more.jqplot.util;
import nl.topicus.wqplot.data.AbstractSeries;
public class LabelledSeries<K, V> extends AbstractSeries<K, V, LabelledSeriesEntry<K, V>> {
}
|
JavaScript | UTF-8 | 338 | 3.578125 | 4 | [] | no_license | // Stampa il cubo dei primi N numeri, dove N è un numero
// indicato dall’utente.
var numero = parseInt(prompt('Inserisci un numero'));
var serieCubi = [];
for (var i = 1; i <= numero; i++) {
var numCubo = Math.pow(i, 3); //numero * numero * numero;
console.log(numCubo);
serieCubi.push(numCubo);
}
console.l... |
C++ | UHC | 2,112 | 2.8125 | 3 | [] | no_license | #include "BlockManager.h"
#include "BlockInfo.h"
#include "Game.h"
#include "TextureManager.h"
#include <time.h>
const char BlockManager::blockShape[SHAPE_COUNT][FIELD_WIDTH][FIELD_HEIGHT] =
{
//
1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,
//
1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,
//''
0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,
//''
... |
C# | UTF-8 | 804 | 2.84375 | 3 | [] | no_license | using RefactorToParallel.Analysis.ControlFlow;
namespace RefactorToParallel.Analysis.DataFlow {
/// <summary>
/// Describes a data flow transition between two nodes.
/// </summary>
public class FlowTransition {
/// <summary>
/// Gets the node coming first in the flow.
/// </summary>
internal F... |
Markdown | UTF-8 | 3,218 | 2.890625 | 3 | [] | no_license | # Line follower bot using 8051 Microcontroller
<p align="center">
<img width="650" height="500" src="https://user-images.githubusercontent.com/32802845/54489921-628bac00-48d7-11e9-8de6-ece69e4cb6e1.png">
</p>
As the name indicates, line follower bot follows a specific line, as it is designed to,
but we have used a... |
Java | UTF-8 | 1,344 | 2.3125 | 2 | [] | no_license | package com.producersmarket.blog.model;
public interface Menuable {
/*
private int id;
private String name;
private String hyphenatedName;
private String parentPath;
private String pathInfo; // the HTTP Path Info that was used to select this product
private String servletPath; // the HTTP ... |
PHP | UTF-8 | 3,158 | 3.046875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Services;
use App\Repositories\BookRepository;
use App\Repositories\AuthorsBookRepository;
class BookService
{
/**
* @var $bookRepository
* @var $authorsBookRepository
*/
protected $bookRepository;
protected $authorsBookRepository;
/**
* Construct.
*
... |
Markdown | UTF-8 | 808 | 2.9375 | 3 | [] | no_license | # Build
After we develop Pyctures software with Python 2.7, we have some .py files.<br>
But the client works on Windows, so it requires to deliver an .exe file.
## How to build it ?
To build our application to an exe file you need to have Python 2.7.<br>
In our case Python is installed in C:\Python27.<br>
After that... |
Python | UTF-8 | 2,377 | 2.671875 | 3 | [] | no_license | #coding=utf-8
import xlwt,xlrd,requests,time,sys
from xlutils.copy import copy
from Common.logger import Logger
import ConfigParser
from read_config import readconfig
reload(sys)
sys.setdefaultencoding('utf-8')
class ExcelHanding(object):
def __init__(self):
self.headers=readconfig('TEST_HEADERS','HEADERS... |
Java | UTF-8 | 1,618 | 2.625 | 3 | [] | no_license | package io.javalab.serialization;
import java.io.Serializable;
public class Card implements Serializable {
private static final long serialVersionUID = 7611757324916349377L;
int cardNumber;
static String type;
String holderName;
transient boolean isActive;
double avlBalance;
public Card... |
PHP | UTF-8 | 19,169 | 2.828125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php defined('SYSPATH') or die('No direct script access.');
class Model_Item extends Model_Database {
public function __construct()
{
/*
/ Purpose: Create item model
/
/ Parms:
/ [NONE]
/
/ Returns:
/ [NONE]
*/
parent::__construct();
$this->table_name = 'item';
$this->tab... |
Java | UTF-8 | 614 | 3.390625 | 3 | [] | no_license | package Recaps.Inheritence;
public class ConstructorCalling {
String name;
String surname;
int age;
public ConstructorCalling(String name, String surname) {
this.name = name;
this.surname = surname;
}
public ConstructorCalling (String name, String surname, int age){
... |
Python | UTF-8 | 928 | 3.25 | 3 | [] | no_license | from flask import Flask
from flask import request
app = Flask(__name__)
@app.route("/")
def index():
celsius = request.args.get("celsius", "")
if celsius:
fahrenheit = fahrenheit_from(celsius)
else:
fahrenheit = ""
return (
"""<form action="" method="get">
... |
Python | UTF-8 | 3,451 | 2.796875 | 3 | [] | no_license | import datetime as dt
import matplotlib.pyplot as plt
from matplotlib import style
import sqlite3 as db
import argparse
from dateutil.relativedelta import relativedelta
import sys
import pandas as pd
def get_start_date(period):
if (period=='Max'):
return dt.datetime(1970, 1, 1)
elif (period=='5Y'):
... |
SQL | UTF-8 | 4,560 | 3.28125 | 3 | [] | no_license | SELECT
ability_link, ability_cmd_index, cmd_flags,
point_x IS NOT NULL AS pointx,
COUNT(ability_link)
FROM cmd_event
GROUP BY ability_link, ability_cmd_index, pointx, cmd_flags
ORDER BY pointx, ability_link, cmd_flags;
-- zagara ability, target point, count
-- abilty 367 can be both targeted and not!
351|0|... |
Markdown | UTF-8 | 631 | 2.546875 | 3 | [] | no_license | ## Useful commands
**Format all files in current directory and all subdirectories**
```shell script
terraform fmt -recursive
```
**Show providers used in current configuration**
```shell script
terraform providers
```
**Show current state in human-readable format**
```shell script
terraform show
```
**List all r... |
Markdown | UTF-8 | 919 | 3.296875 | 3 | [] | no_license | # Section 7.2-4
```
Answer questions a{d for the graph defined by the following sets:
• N = f1; 2; 3; 4g
• N0 = f1g • Nf = f4g
• E = f(1; 2); (2; 3); (3; 2); (2; 4)
```
a, Draw Graph
/Assets/Graph 7.2-4.png
b, If possible, list test paths that achieve Node Coverage, but not Edge Coverage. If not possible, explai... |
Java | GB18030 | 2,314 | 1.90625 | 2 | [] | no_license | ///**
// * $ļ˵$
// *
// * @author wuxla
// * @version 6.0
// * @see
// * @since 6.0
// * @time 2010-9-13 03:40:17
// */
package nc.ui.pu.m21.billref.pu.m4t;
//
//import java.util.List;
//
//import nc.ui.pubapp.uif2app.query2.refregion.AbstractCommonListener;
//import nc.ui.querytemplate.CriteriaChangedEvent;
//import... |
Python | UTF-8 | 5,178 | 2.5625 | 3 | [] | no_license | import json
import re
import unicodedata
import numpy as np
import nltk
import collections
import string
from sklearn import linear_model
from nltk.collocations import *
def unicodize(seg):
if re.match(r'\\u[0-9a-f]{4}', seg):
return seg.decode('unicode-escape')
return seg.decode('utf-8')
y=''
bigra... |
C# | UTF-8 | 568 | 3.125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Practical4
{
class Program
{
public static void Main(string[] args)
{
MyClass myclass = new MyClass();
String infix = "(a+b)*(c+d)";
... |
Swift | UTF-8 | 1,075 | 2.734375 | 3 | [] | no_license | //
// ForecastWeatherHeader.swift
// Test
//
// Created by Дмитрий Разуев on 26.06.21.
//
import UIKit
class ForecastWeatherHeader: UITableViewHeaderFooterView {
private let titleLabel = UILabel()
override init(reuseIdentifier: String?) {
super.init(reuseIdentifier: reuseIdentifier)
... |
Ruby | UTF-8 | 1,157 | 2.5625 | 3 | [
"MIT"
] | permissive | require 'hashie'
require 'nokogiri'
require 'open-uri'
require 'time'
module Openfoodfacts
class Press < Hashie::Mash
# TODO: Add more locales
LOCALE_PATHS = {
'fr' => 'revue-de-presse-fr'
}
LOCALE_DATE_FORMATS = {
'fr' => '%d/%m/%Y'
}
class << self
def items(locale: 'fr'... |
C++ | UTF-8 | 2,703 | 2.671875 | 3 | [] | no_license | /* ************************************************************************** */
/* LE - / */
/* / */
/* Fixed.hpp .:: .:/ . .:: ... |
Shell | UTF-8 | 201 | 3.09375 | 3 | [
"MIT"
] | permissive | DATABASE=$1
if [ $DATABASE == 'postgresql' ]
then
pg_ctl -D /usr/local/var/postgres stop -s -m fast
fi
if [ $DATABASE == 'mongodb' ]
then
echo 'killing mongod'
PID=$(pgrep mongo)
kill $PID
fi |
Java | UTF-8 | 171 | 2.75 | 3 | [] | no_license | package tutelab3.birds;
public class Eagle extends AbstractFlyingBird {
@Override
public void fly() {
System.out.println("The eagle is soaring");
}
}
|
C# | UTF-8 | 497 | 3.3125 | 3 | [] | no_license | using System;
namespace ObsoleteClass
{
class Program
{
static void Main(string[] args)
{
MethodA();
MethodB();
Console.Read();
}
[Obsolete("Use MethodB Instead")]
static void MethodA()
{
}
static void Metho... |
SQL | UTF-8 | 2,307 | 4 | 4 | [] | no_license | WITH PATIENTS AS (
SELECT DISTINCT
ENCOUNTER.ENCNTR_ID,
ENCOUNTER.PERSON_ID
FROM
ENCOUNTER
WHERE
ENCOUNTER.ENCNTR_ID IN @prompt('Enter value(s) for Encntr Id','A',,Multi,Free,Persistent,,User:0)
), INS_OUTS AS (
SELECT DISTINCT
PATIENTS.ENCNTR_ID,
pi_from_gmt(CLINICAL_EVENT.EVENT_END_DT_TM, 'America/... |
C# | UTF-8 | 1,736 | 2.625 | 3 | [] | no_license | using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public abstract class TimeBehaviour : MonoBehaviour
{
private List<(float time, Func<IEnumerator> func)> actions = new List<(float time, Func<IEnumerator> func)>();
protected void RegisterActionReletive(float time, Fu... |
Java | UTF-8 | 4,314 | 2.234375 | 2 | [] | no_license | package com.longkai.stcarcontrol.st_exp.service;
import android.os.Handler;
import android.util.Log;
import com.longkai.stcarcontrol.st_exp.communication.ServiceManager;
import com.longkai.stcarcontrol.st_exp.communication.commandList.BaseResponse;
import com.longkai.stcarcontrol.st_exp.communication.commandList.CMDF... |
Java | UTF-8 | 4,783 | 2.3125 | 2 | [] | no_license | package com.zy.sualianwb.module;
import com.zy.sualianwb.Constants;
import com.zy.sualianwb.util.L;
import com.zy.sualianwb.util.PosUrlUtil;
import org.joda.time.DateTime;
import java.sql.Timestamp;
import java.util.Date;
/**
* Created by zz on 15/12/24.
*/
public class ShowTime3 {
/**
* src : xxx.jpg
... |
Shell | UTF-8 | 107 | 2.984375 | 3 | [] | no_license | #!/bin/bash
cd ${JARVIS_VIDEO}
if [ -f FILM_PID ]; then
pid=`cat FILM_PID`
kill ${pid}
fi
exit 0 |
Java | UTF-8 | 1,765 | 2.765625 | 3 | [] | no_license | import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
public class ModeleBigramme {
static String[] parts;
static int occu2;
static int occu3,n;
static double s=0;
static... |
Python | UTF-8 | 930 | 2.984375 | 3 | [
"MIT"
] | permissive | # Script to add Age and Gender variables to the master participants.tsv
import glob
import pandas as pd
# read in demographics.tsv files as pd data frames
data = ['/research/cisc2/projects/critchley_adie/BIDS_data/derivatives/phenotype/controls/demographics.tsv', \
'/research/cisc2/projects/critchley_adie/BIDS_data/d... |
Markdown | UTF-8 | 6,974 | 2.765625 | 3 | [
"MIT"
] | permissive | # Journal scraper maker log
### Background
When developing scraping software, a major challenge is ensuring its compatibility across a wide range of resources. Building a general tool to scrape a variety of sources - each with a different layout and range of information - is labour intensive, and adding an additional... |
TypeScript | UTF-8 | 1,986 | 2.609375 | 3 | [
"MIT"
] | permissive | import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { PostsEntity } from 'src/posts/posts.entity';
import { DeleteResult, EntityRepository, Repository, UpdateResult } from 'typeorm';
import { CommentsEntity } from './comments.entity';
@EntityRepository(CommentsEntity... |
PHP | UTF-8 | 463 | 2.5625 | 3 | [] | no_license | <?php
use Phinx\Migration\AbstractMigration;
class CreateTableMenuContent extends AbstractMigration
{
/**
* Migrate Up.
*/
public function up()
{
$users = $this->table('menu_content');
$users->addColumn('id_menu', 'integer')
->addColumn('id_recipe', 'integer')
... |
C++ | UHC | 1,882 | 3.5 | 4 | [] | no_license | #pragma once
/*
* Constructor https://modoocode.com/188#page-heading-4
*
* (char) ڿ , C ڿ (char *)
* ڿ ̸ ϴ Լ
* ڿ ڿ ٸ ڿ ̱(append)
* ڿ ԵǾ ִ ڿ ϱ
* ڿ
* ڿ ũ ( )
*/
namespace jtd {
class MyString {
public:
MyString(const char single_character, const unsigned int duplicate_count = 1);
MyString(const char* sr... |
Markdown | UTF-8 | 198 | 2.609375 | 3 | [] | no_license | # Vehicles price regression
This project is about predicting used cars sales prices using Random Forest Regressor model
You can visit this [website](http://alis-estimator.com) to check it out live
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.