language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 279 | 1.914063 | 2 | [] | no_license | package com.example.codegym.service;
import com.example.codegym.model.PersonalCode;
public interface PersonalCodeService {
void save(PersonalCode personalCode);
PersonalCode findById(Integer id);
void delete(Integer id);
PersonalCode findByCode(String code);
}
|
JavaScript | UTF-8 | 1,267 | 2.703125 | 3 | [] | no_license | var NewPlane = React.createClass({
handleClick() {
var model_id = this.refs.model_id.value;
var description = this.refs.description.value;
var latitude = this.refs.latitude.value;
var longitude = this.refs.longitude.value;
var elevation = this.refs.elevation.value;
$.ajax({
url: '/ap... |
Java | UTF-8 | 3,994 | 2.21875 | 2 | [] | no_license | package mobi.uta.campussynergy.Fragment;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import andro... |
JavaScript | UTF-8 | 2,050 | 3.109375 | 3 | [] | no_license | // work on send/retrieve line 45
var price = 0;
$(document).ready(function(){
var baseFile = "https://my.api.mockaroo.com/jerseys.json?key=0a8afae0";
// setup links
$.getJSON(baseFile, function(data){
$("#product-list").empty(); // remove any old links
// data is an array of product objects
$.each(data, functi... |
Swift | UTF-8 | 1,070 | 2.71875 | 3 | [] | no_license | //
// MovieCell.swift
// PremierSwift
//
// Created by Gabriela Pittari on 13/10/2017.
//
import UIKit
import RxSwift
class MovieTableViewCell: UITableViewCell {
private var disposeBag = DisposeBag()
@IBOutlet var nameLabel: UILabel!
@IBOutlet var posterImageView: UIImageView!
@IBOutlet var de... |
PHP | UTF-8 | 283 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Eag\Banger\Validator;
use Eag\Banger\Exception\InvalidBankAccountNumber;
interface BankAccountValidator
{
/**
* @throws InvalidBankAccountNumber
*/
public function validate(string $bankAccount, string $country): void;
}
|
C# | UTF-8 | 4,025 | 2.53125 | 3 | [] | no_license | using Diploma.Files;
using Diploma.Models;
using Diploma.Utils;
using Diploma.Wrappers;
using GemBox.Document;
using Moq;
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
namespace Diploma.Tests
{
public class FileWriterTests
{
private StudentModel GetSampleStudentModel(... |
JavaScript | UTF-8 | 4,358 | 3.421875 | 3 | [
"MIT"
] | permissive | var cardValues = function() {
var cardValues = new Map();
cardValues.set("A", 11);
cardValues.set(2, 2);
cardValues.set(3, 3);
cardValues.set(4, 4);
cardValues.set(5, 5);
cardValues.set(6, 6);
cardValues.set(7, 7);
cardValues.set(8, 8);
cardValues.set(9, 9);
cardValues.set(10, 10);
cardValues.s... |
Markdown | UTF-8 | 2,544 | 3.328125 | 3 | [] | no_license |
## The challenge
Your challenge is to build out this GitHub user search app using the [GitHub users API](https://docs.github.com/en/rest/reference/users#get-a-user) and get it looking as close to the design as possible.
Your users should be able to:
- View the optimal layout for the app depending on their device's ... |
Java | UTF-8 | 2,200 | 1.914063 | 2 | [] | no_license | package com.junyou.bus.chenghao.configure.export;
import java.util.Map;
import com.kernel.data.dao.AbsVersion;
public class ChengHaoPeiZhiConfig extends AbsVersion {
/**
* 称号id
*/
private int id;
/**
* 称号所属类型 1:平台称号 2:成就称号
*/
private int type1;
/**
* 头衔名称
*/
private String name;
/**
* 资源
*/
p... |
Swift | UTF-8 | 9,371 | 2.890625 | 3 | [] | no_license | //
// IMMessage.swift
// IMDemo
//
// Created by 小白 on 2017/2/20.
// Copyright © 2017年 LinJian. All rights reserved.
//
import UIKit
struct IMImageObject {
/**
* 文件展示名
*/
var displayName: String?
/**
* 图片本地路径
* @discussion 目前 SDK 没有提供下载大图的方法,但推荐使用这个地址作为图片下载地址,APP 可以使用自... |
JavaScript | UTF-8 | 3,262 | 3.1875 | 3 | [] | no_license | 'use strict';
///////////////////////////////////////
// Modal window
const modal = document.querySelector('.modal');
const overlay = document.querySelector('.overlay');
const btnCloseModal = document.querySelector('.btn--close-modal');
const btnsOpenModal = document.querySelectorAll('.btn--show-modal');
const openM... |
Markdown | UTF-8 | 1,704 | 2.6875 | 3 | [] | no_license | # Factory
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/factory`. To experiment with that code, run `bin/console` for an interactive prompt.
TODO: Delete this and the text above, and describe your g... |
Java | UTF-8 | 975 | 1.945313 | 2 | [] | no_license | package bnym.casestudy.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestM... |
C++ | UTF-8 | 261 | 3.28125 | 3 | [] | no_license | #include <iostream>
using namespace std;
void prime(int a)
{
int i;
for (i=2;i<a;i++)
{
if (a%i==0)
break;
}
if (i==a)
cout<<"prime"<<endl;
else
cout<<"not prime"<<endl;
}
int main()
{
int a;
cin>>a;
prime(a);
return 0;
}
|
JavaScript | UTF-8 | 1,046 | 2.75 | 3 | [] | no_license | const PubSub = require('../helpers/pub_sub.js')
const GameLogic = function() {
this.tally = 0;
this.cards = [];
this.level = 0;
}
GameLogic.prototype.bindEvents = function () {
PubSub.subscribe('SquareView:card-clicked', (event) => {
const card = event.detail;
this.verifyMatch(card);
})
PubSub.su... |
C++ | GB18030 | 544 | 3.609375 | 4 | [] | no_license | //дһһά˳ʱת90
#include<iostream>
using namespace std;
double func(double a[][3]);
int main()
{
double a[3][3]={{1,2,3},{4,5,6},{7,8,9}};
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
cout<<a[i][j];
cout<<endl;
}
func(a);
cin.get();
return 0;
}
double func(double a[][3])
{
double b[3][3];
for(int i=0;i<3;i+... |
PHP | UTF-8 | 1,581 | 2.59375 | 3 | [] | no_license | <?php
/**
* @todo: write description
*/
namespace common\spec_parsers;
class FocalLengthSpecParser extends NumericSpecParser {
// These two attributes defines key of base_spec table and category id's the parser class is applicable to.
static public $keys = array('Фокусное расстояние');
static public $c... |
Go | UTF-8 | 957 | 3.109375 | 3 | [] | no_license | //This example uses multifile approach to emulate numpy example in the book
//https://go.dev/play/p/TdmXQvaD2iN
package main
import (
"fmt"
"play.ground/foo"
)
func main() {
inputs := []float64{1, 2, 3, 2.5}
weights := [][]float64{
{0.2, 0.8, -0.5, 1},
{0.5, -0.91, 0.26, -0.5},
{-0.26, -0.27, 0.17, 0.87},... |
Java | UTF-8 | 496 | 2.46875 | 2 | [] | no_license | package org.otw.archive;
import java.net.URL;
public class Creator {
private String name;
private String username;
private URL url;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUsername() {
return username;
}
publi... |
JavaScript | UTF-8 | 2,329 | 2.703125 | 3 | [] | no_license | function loadClient(){
apiAdapter.handleClientLoad();
}
var apiAdapter = {};
apiAdapter.apiKey = "AIzaSyCeKGMtbJLsVrdJX9gJ3fs3_c6GEn_1Gdk";
apiAdapter.clientId = "736158154921-0kh3ksre0i2s8banbektai9vkqo99oql.apps.googleusercontent.com";
apiAdapter.scopes = "https://www.googleapis.com/auth/calendar";
apiAdapter.prin... |
PHP | UTF-8 | 778 | 2.578125 | 3 | [] | no_license | <?php
// Name: Artruo Martinez
// Due: May 4, 2016
// Senior Project
// Purpose: This file will select all inofrmation from the JobsAssigned table, execpt for the ID. This information
// to the iOS app so that the foreman can whart jobs are assgined.
include("connect.php");
mysql_select_db("beachelect... |
Java | UTF-8 | 743 | 2.015625 | 2 | [] | no_license | package services.allRussianUniversities;
import dao.topRussianUniversities.TopRussianUniversitiesDao;
import entities.RussianUniversitiesInQS;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
... |
Python | UTF-8 | 2,995 | 4.5 | 4 | [] | no_license | #Q.1-Create a circle class and initialize it with radius. Make two methods getArea and getCircumference inside this class.
class Circle():
def __init__(self, r):
self.radius = r
def getarea(self):
return self.radius**2*3.14
def getcircumference(self):
return 2*self.radius*3.14
... |
PHP | UTF-8 | 447 | 3.125 | 3 | [] | no_license | <?php
namespace Core;
class Objectify {
private $__toString = '';
public function __construct($objects = null) {
if ($objects instanceof \Closure) {
$this->__toString = $objects;
return;
}
if ($objects) {
foreach ($objects as $key => $value) {
if (!property_exists($this, $key)) {
continue;... |
Ruby | UTF-8 | 717 | 4.53125 | 5 | [] | no_license | # In the previous two exercises, you developed methods that convert
# simple numeric strings to signed Integers. In this exercise and the next,
# you're going to reverse those methods.
# Write a method that takes a positive integer or zero, and converts
# it to a string representation.
# You may not use any of the st... |
Java | UTF-8 | 3,007 | 2.5 | 2 | [] | no_license | /*
* Created on Oct 9, 2006
*/
package orbe.model.style;
import java.awt.Color;
import java.net.URL;
import net.sf.doolin.util.ValueHandler;
import net.sf.doolin.util.xml.DigesterUtils;
import orbe.model.ColorUtils;
import org.apache.commons.digester.Digester;
public class DefaultRepositoryHexTerrain {
/**
* ... |
Python | UTF-8 | 3,822 | 2.78125 | 3 | [] | no_license |
if __name__ == "__main__":
#Importing some libraries
import numpy as np
import pandas as pd
2
#Getting rid of pesky warnings
def warn(*args, **kwargs):
pass
import warnings
warnings.warn = warn
np.warnings.filterwarnings('ignore')
#START HERE
column_names = [
... |
C++ | UTF-8 | 6,529 | 2.609375 | 3 | [
"MIT"
] | permissive | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* utils.cpp :+: :+: :+: ... |
PHP | UTF-8 | 2,430 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\Contact;
use App\Http\Resources\ContactCollection;
use Illuminate\Http\Request;
class ContactController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
... |
JavaScript | UTF-8 | 2,035 | 3.03125 | 3 | [] | no_license | //Grab the articles as a json
$.getJSON("/articles", function (data) {
for (var i = 0; i < data.length; i++) {
// $("#articles").append("<p data-id='" + data[i]._id + "'>" + data[i].title + "<br />" + data[i].link + "</p>");
$(".article").append("<div class='card'> <div class='card-body'><h5 class='... |
JavaScript | UTF-8 | 1,615 | 2.625 | 3 | [
"MIT"
] | permissive |
var mongodb = require('mongodb');
var compile = require('./compile');
var uuid = require('node-uuid');
var Schema = module.exports = function() {
};
Schema.prototype.translate = function(schema, value) {
var type = schema.subtype || schema.type;
switch(type) {
case 'UUID':
var uuid_text;
// Encoded by Base... |
C++ | UTF-8 | 2,838 | 2.875 | 3 | [] | no_license | #include <string>
#include <iostream>
#include <fstream>
#include "note.hpp"
#include "utils/util.h"
Note::Note() {
get_randomness(pk, 32);
get_randomness(rho, 32);
}
std::string Note::cm() const {
return computeCommitment(rho, pk, value);
}
std::string Note::spend_nf(const std::string& sk) const {
... |
C# | UTF-8 | 1,170 | 2.984375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Runtime.Serialization.Json;
using System.Threading.Tasks;
using WeatherApiMvcApp.Models.ApiModels;
namespace WeatherApiMvcApp.DAL
{
public class DataAccess : IDataAccess
{
private co... |
Java | UTF-8 | 4,771 | 2.296875 | 2 | [] | no_license | package com.example.demo;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;
import androidx.recyclervi... |
Java | UTF-8 | 4,849 | 1.546875 | 2 | [
"BSD-2-Clause"
] | permissive | import net.runelite.mapping.Export;
import net.runelite.mapping.Implements;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
@ObfuscatedName("bl")
@Implements("ApproximateRouteStrategy")
public class ApproximateRouteStrategy extends RouteStrategy {
@ObfuscatedName("bc")
@O... |
Python | UTF-8 | 130 | 3.375 | 3 | [] | no_license | # Largest prime factor
n = 600851475143
i = 2
while i ** 2 < n:
while n % i == 0:
n = n / i
i += 1
print(n) |
Java | UTF-8 | 2,417 | 2.921875 | 3 | [] | no_license | package lt.andrej.demo.serviceimpl;
import lt.andrej.demo.service.ActionsService;
import org.springframework.stereotype.Service;
import javax.swing.plaf.IconUIResource;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
@Service
public class ActionsServiceImpl implements ActionsService {
... |
Java | UTF-8 | 1,759 | 1.984375 | 2 | [] | no_license | package com.xrosscode.plugin.wechat.redenvelop;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceActivity;
/**
* @author johnsonlee
*/
public class SettingsActivity extends PreferenceActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
... |
Java | UTF-8 | 6,631 | 1.914063 | 2 | [] | no_license | package bhtech.com.cabbydriver.DrivingToCustomer;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.util.Log;
import com.google.android.gms.gcm.G... |
Python | UTF-8 | 2,001 | 2.640625 | 3 | [] | no_license | #!/user/bin/env python
# -*- encoding:utf-8 -*_
'''
@File:main.py
@Time:2020/02/27 22:34:58
@Author:zoudaokou
@Version:1.0
@Contact:wangchao0804@163.com
@desc:读取txt中的公司注册信息链接,解析数据,存入数据库
'''
from tqdm import tqdm
from EntClass import EntItem
from SaveDataToSql import save_to_sql
from HandleSqlData import handle_data
fr... |
Markdown | UTF-8 | 843 | 2.796875 | 3 | [] | no_license | ---
title: Simple HTTP Server
layout: post
tags:
- Linux
- Simple HTTP Server
---
localhost ‘ da simple HTTP Server kurulumu bir kaç farklı method ile yapılabilir.
#### **Grunt ya da Gulp**
Grunt ya da Gulp ile basit bir HTTP Server kurulumu gerceklestirilebilir.
Ayrıntı icin [buraya][1] tıklayınız.
#### *... |
Python | UTF-8 | 3,626 | 2.625 | 3 | [
"MIT"
] | permissive | from __future__ import print_function
from __future__ import print_function
import locale
from django.conf import settings
from django import template
from datetime import date
from itertools import groupby
import datetime
import calendar
register = template.Library()
def do_schedules(parser, token):
"""
The... |
Java | UTF-8 | 7,682 | 1.78125 | 2 | [
"MIT"
] | permissive | package com.simibubi.create.content.contraptions.actors.seat;
import java.util.List;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import com.google.common.base.Optional;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllShapes;
import com.simibubi.create.... |
Python | UTF-8 | 926 | 4.09375 | 4 | [] | no_license | lista= [3,5,9,4,1,7]
lista_texto=['gato', 'zebra', 'pato', 'rato', 'arara',]
lista.sort() #ordena em ordem crescente
lista_texto.sort() #ordena em ordem alfabética
print(lista)
print(lista_texto)
lista_texto.reverse() #ordena decresente alfabetica
print(lista_texto)
# print(lista_texto[1]) #irá imprimir o texto da 2... |
Java | UTF-8 | 238 | 1.703125 | 2 | [] | no_license | package com.itheima.jd.dao;
import java.util.List;
import com.itheima.jd.pojo.ProductModel;
import com.itheima.jd.vo.QueryVo;
public interface SolrDao {
public List<ProductModel> getResultModelFromSolr(QueryVo vo) throws Exception;
}
|
Java | UTF-8 | 274 | 2.75 | 3 | [] | no_license | package day1.basics;
public class Card {
private String face;
private String suit;
public Card(String cardFace,String cardSuit)
{
face=cardFace;
suit=cardSuit;
}
public String toString()
{
return face+" of "+suit;
}
}
|
C++ | UTF-8 | 781 | 3.125 | 3 | [] | no_license | #include<stdio.h>
#include<math.h>
#define PI 3.14
void nhap(int &a, int &b, int &c){
do
{
printf("Nhap a: ");
scanf("%d",&a);
} while (a==0);
printf("Nhap b,c: ");
scanf("%d%d",&b,&c);
}
void giaiPhuongTrinhBac2(int a,int b, int c){
float delta = pow(b,2)- 4*a*c;
if(delta < ... |
TypeScript | UTF-8 | 2,350 | 2.734375 | 3 | [] | no_license | import { Model, DataTypes, Optional } from 'sequelize';
import jwt from 'jsonwebtoken';
import bcrypt from 'bcrypt';
import sequelizeInstance from '../connection';
export interface UserAttributes {
id: number;
name: string;
email: string;
password: string;
createdAt: Date;
updatedAt: Date;
deletedAt: Dat... |
C# | UTF-8 | 1,156 | 2.609375 | 3 | [] | no_license | using System;
using System.Threading.Tasks;
using DotNetCore.CAP;
namespace Service.Sample
{
public interface ISampleRepository
{
Task<bool> CreateSample(ConsignCreatedResult consignCreatedResult);
}
public class SampleRepository : ICapSubscribe, ISampleRepository
{
private readonl... |
JavaScript | UTF-8 | 1,087 | 4.15625 | 4 | [] | no_license | function calcular() {
// Pega valor dos números e da operção
let n1 = parseFloat(document.getElementById('numero1').value);
let n2 = parseFloat(document.getElementById('numero2').value);
let op = parseFloat(document.getElementById('operacao').value);
let re = 0;
// Valida se realmente são valor... |
Python | UTF-8 | 1,403 | 3.375 | 3 | [] | no_license | # Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def reorderList(self, head):
"""
:type head: ListNode
:rtype: None Do not return anything, modify head in-place instead.
... |
TypeScript | UTF-8 | 2,760 | 2.59375 | 3 | [] | no_license | import { Injectable } from '@angular/core';
import { environment } from "../../environments/environment";
import { User, UserQuery, UserResponse } from "../models/users-response";
import { HttpClient, HttpErrorResponse, HttpHeaders, HttpParams } from "@angular/common/http";
import { throwError } from 'rxjs';
import {... |
C# | UTF-8 | 763 | 2.953125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp26
{
class Program
{
static void Main(string[] args)
{
Rect();
}
static void Rect()
{
int[,] Matrixs;
... |
Java | UTF-8 | 1,468 | 2.140625 | 2 | [] | no_license | package com.example.socialnetworkfortravellers.ApplicationLayer.Services.BaseServices.queriesGetDataServices;
import androidx.annotation.NonNull;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.googl... |
Python | UTF-8 | 1,372 | 3.78125 | 4 | [] | no_license | if __name__ == '__main__':
#1. Utwórz listę o nazwie marketing z elementami:
#-loyality program
#-client promotion
#-market research
marketing =['loyality program','client promotion','market research']
print(marketing)
#2. Dodaj do listy element 'public relations'
marketing.append('public relation')
... |
C# | UTF-8 | 6,054 | 2.515625 | 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 Tetris
{
public partial class SimpleGameForm : Form
{
Graphics graphic;
... |
Java | UTF-8 | 2,826 | 2.71875 | 3 | [] | no_license | package com.qc.my3DComputer.domain;
import java.io.Serializable;
/**
* position
* @author
*/
public class Position implements Serializable {
private Integer id;
/**
* 单位mm
*/
private Integer x;
private Integer y;
private Integer z;
private String state;
private static fi... |
Shell | UTF-8 | 381 | 3.203125 | 3 | [] | no_license | #!/bin/bash
[ -z $1 ] && echo 'sh check_tel.sh eth0' && exit 1
date=`date '+%Y-%m-%d %H:%M'`
pcap_path=/tmp/tel_$1.pcap
ssh -tt 127.0.0.1 "sudo /usr/sbin/tcpdump -i $1 -t -c 100 -s 0 -w $pcap_path > /dev/null 2>&1" 2>/dev/null
pcap_info=`/usr/sbin/capinfos -y $pcap_path | grep '^Data'`
traffic=`echo $pcap_info | awk ... |
Python | UTF-8 | 3,933 | 2.609375 | 3 | [] | no_license | #!/usr/bin/env python
'''
dyn_ip_chk
A dynamic IP checker script.
written by Jared Epstein
###
Planned Features:
-add daemonizing (-d)
-won't allow -o with daemon (only logging)
-add a new option that will alert (email?) if IP changes
###
Known Issues:
-must be run with sudo for logging to work... |
PHP | UTF-8 | 2,716 | 2.515625 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use App\Http\Resources\MaterialResource;
use App\Models\Material;
use App\Models\Supplier;
use Illuminate\Http\Request;
class MaterialController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
pub... |
SQL | UTF-8 | 5,105 | 3.953125 | 4 | [] | no_license | SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
CREATE SCHEMA IF NOT EXISTS `sistema` DEFAULT CHARACTER SET utf8 COLLATE utf8_spanish2_ci ;
CREATE TABLE IF NOT EXI... |
C++ | UTF-8 | 1,782 | 3.15625 | 3 | [] | no_license | #ifndef STRING_H_
#define STRING_H_
#include <iostream>
/*
* The next line is used because Codewarrior has a conflict with
* the STL string. Make sure to put the #include of this file
* AFTER all the system includes.
*/
#define string String
class StringIndexOutOfBounds {};
class string {
public:
string(const char... |
Java | UTF-8 | 7,196 | 4 | 4 | [] | no_license | package code02;
import org.apache.commons.lang.ArrayUtils;
import java.util.ArrayList;
import java.util.List;
public class ArrayUtil {
/**
* 给定一个整形数组a , 对该数组的值进行置换
例如: a = [7, 9 , 30, 3] , 置换后为 [3, 30, 9,7]
如果 a = [7, 9, 30, 3, 4] , 置换后为 [4,3, 30 , 9,7]
* @param origin
* @return
*/
public void r... |
C++ | UTF-8 | 1,686 | 2.796875 | 3 | [
"MIT"
] | permissive | #include "shared/runtime/iObject.hpp"
#include "shared/runtime/iStandardClass.hpp"
Runtime::iObject::iObject(Runtime::iStandardClass *klass)
{
this->klass = klass;
};
Runtime::iObject::iObject(std::string name)
{
// does nothing as we don't have a runtime setup/booted yet
};
Runtime::iObject::~iObject()
{
if (... |
SQL | UTF-8 | 574 | 2.78125 | 3 | [
"MIT"
] | permissive | CREATE DATABASE `appetiser-apps-testdb` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
CREATE TABLE `events` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`event` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`datefrom` date NOT NULL,
`dateto` date NOT NULL,
`active` int(11) NOT NULL,
`mon` int(11) N... |
PHP | UTF-8 | 1,790 | 2.6875 | 3 | [] | no_license | <?php
namespace Infira\omg\helper;
use Infira\Utils\RuntimeMemory as Rm;
use Infira\Utils\File;
use Infira\Utils\Variable;
use Infira\omg\Omg;
use Infira\console\Bin;
class Tpl
{
const REMOVE_LINE = '__REMOVE_LINE__';
public static function __callStatic($method, $args)
{
return self::Smarty()->$method(...$args... |
Java | UTF-8 | 1,532 | 2.875 | 3 | [] | no_license | package io.ruin.model.achievements.listeners.experienced;
import io.ruin.api.utils.NumberUtils;
import io.ruin.model.achievements.Achievement;
import io.ruin.model.achievements.AchievementListener;
import io.ruin.model.achievements.AchievementStage;
import io.ruin.model.entity.player.Player;
public class PracticeMake... |
C | UTF-8 | 825 | 3.1875 | 3 | [] | no_license | /*
int isspace(int x) { return (x == ' ' || x == '\t' || x == '\n' || x == '\v' || x == '\f' || x == '\r'); }
int isdigit(int x) { return (x >= '0' && x <= '9'); }
int isxdigit(int x) { return ((x >= 'A' && x <= 'F') && (x >= 'a' && x <= 'f') && (x >= '0' && x <= '9')); }
int isalpha(int x) { return (x >= 'A' && x <= '... |
C++ | UTF-8 | 2,680 | 2.53125 | 3 | [] | no_license | /* -*- C++ -*-
* Copyright (C) 2009 Trinity Core <http://www.trinitycore.org>
* Copyright (C) 2012 Morpheus
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the Licens... |
Markdown | UTF-8 | 2,631 | 3.203125 | 3 | [
"MIT"
] | permissive | ---
author: "joostdecock"
caption: "Пам'ятаєте, коли нам дозволили виходити на вулицю?"
date: "2021-01-17"
intro: "Ліф-блок Bella для жіночого одягу"
title: "Ліф-блок Bella для жіночого одягу"
---
Ми щойно опублікували нову викрійку на цьому сайті: [Белла, блок ліфа для жіночого одягу](/designs/bella/). Це блок з наг... |
C# | UTF-8 | 1,022 | 3.484375 | 3 | [] | no_license | using System;
public class CurrencyConverter
{
public static void Main()
{
decimal cash = decimal.Parse(Console.ReadLine());
string inn = Console.ReadLine();
string outt = Console.ReadLine();
const decimal usd = 1.79549m;
const decimal eur = 1.95583m;
const dec... |
Markdown | UTF-8 | 6,104 | 2.703125 | 3 | [] | no_license | ---
title: Lessons learnt from live streaming church
type: article
tags:
date: 2020-03-24
intro: On Sunday we all learnt a lot of lessons about livestreaming… Here are the lessons we learnt at The Globe Church.
---
**As we face further into lockdown of the UK, our churches have embraced livestreaming as a way of keepi... |
Java | UTF-8 | 299 | 2.03125 | 2 | [] | no_license | package com.Shop2Drop.Shop2Drop.repository;
import com.Shop2Drop.Shop2Drop.entity.User;
import org.springframework.data.repository.CrudRepository;
public interface UserRepository extends CrudRepository<User,Long> {
User findByUsername(String username);
User findByEmail(String email);
}
|
Markdown | UTF-8 | 1,659 | 2.65625 | 3 | [] | no_license | # Guidance on what to consider across the board for all projects.
1. Design a theoretical process for the pipeline which is efficient for the team to use in the project. CI/ CD
2. If required setup GitLAB server and Jenkins server
3. Create gitlab; accounts; branching strategy.
4. Create jenkins; accounts; access
... |
C++ | UTF-8 | 4,450 | 3.1875 | 3 | [] | no_license | /**
* Calculating the Sieve Eratosthenes to a given limit, Multithreding.
*
* @author
* Abdalrahman Ibrahim <a2ibrahim@edu.aau.at>
*/
#include <bits/stdc++.h>
#include <omp.h>
using namespace std;
class SieveEratosthenes
{
private:
public:
int _limit;
int p;
int i;
int x;
SieveEratosthe... |
C++ | UTF-8 | 8,092 | 2.796875 | 3 | [] | no_license | //
// Created by sapir on 10/12/17.
//
#include "FirstClient.h"
#include <iostream>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <string.h>
#include <unistd.h>
#include <limits>
#include <cstdlib>
#include <climits>
#include <sstream>
FirstClient::FirstClient(Boar... |
C | UTF-8 | 927 | 3.15625 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int number = 0;
scanf("%d",&number);
int numberlist[3] = {0};
char numberch[3];
sprintf(numberch,"%d",number);
for (int h = 0; h < 3; h ++)
{
numberlist[h] = (int)numberch[h] - 48;
}
if (numberlist[0] != 0)
{
while (1)
{
... |
Java | UTF-8 | 422 | 2.515625 | 3 | [] | no_license |
public class Controller {
public static void main(String[] args) {
Ponta ponta1 = new Ponta(0.7);
Ponta ponta2 = new Ponta(0.7);
Lapiseira c1 = new Lapiseira("BIC", ponta1);
c1.status();
c1.escrever();
c1.setPonta(ponta1);
c1.escrever();
c1.status();
c1.escrever();
c1.escrever();
c1.escrever... |
Markdown | UTF-8 | 12,665 | 2.9375 | 3 | [] | no_license | ---
layout: post
title: "Publishing a Ruby Gem with a React-based front end"
description: "Using Rack middleware in a Gem to serve assets from a React build"
date: 2021-05-30 08:43:00 -0400
comments: true
tags: [rails, rack, ruby, gem, rubygems, middleware, html]
---
## Motivation
As stated in the [last post](/2021/0... |
JavaScript | UTF-8 | 1,965 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | "use strict";
let assert = require('assert');
let CVHandler = require("../lib/cv-handler.js")
describe('CVHandler', () => {
before(() => {
});
after(() => {
});
it("should be able to collect correct population values and median", (done) =>{
var records = [{"IPP" : 1, "MSRPOPL" : 1 , "values": [2]},
... |
C# | UTF-8 | 2,947 | 3.125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Windows;
namespace Acme_Used_CarsWPFcs
{
public static class VehicleDB
{
public static List<Vehicle> GetVehicles()
{
SqlConnection con ... |
Java | UTF-8 | 1,059 | 2.75 | 3 | [] | no_license | package Processadores;
import java.util.Random;
import java.util.Vector;
import util.Processo;
public class GerenciadorHReceptor extends Gerenciador {
public GerenciadorHReceptor (int numProc) {
super (numProc);
proc_ = new Vector<Processador>();
for (int i = 0; i < nProc_; i++) {
proc_.add(new Processador... |
Java | UTF-8 | 576 | 1.859375 | 2 | [] | no_license | package com.spring.model;
import java.util.HashMap;
import java.util.List;
import javax.annotation.Resource;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;
@Repository
public class MapDAO implements InterMapDAO {
@Resource
private SqlSessionTemplate sqlsession;
... |
Go | UTF-8 | 771 | 4.40625 | 4 | [] | no_license | package main
import "fmt"
type myDb struct{}
func main() {
var a interface{}
a = 1 // Setting values as int
switching(a)
a = "Abc" // Setting values as string
switching(a)
a = myDb{} // Setting values as myDb
switching(a)
a = nil // Setting values as nil
switching(a)
a = 1.0 // Setting values as float... |
Python | UTF-8 | 905 | 3.046875 | 3 | [] | no_license | from collections import Counter
def output(t, res):
casestr = "Case #" + str(t+1) +": "
status = str(res) if res != None else "impossible"
outputLine = casestr+status
print outputLine
def main():
############################################1
T = int( raw_input() )
... |
PHP | UTF-8 | 3,846 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Departamentos;
class DepartamentosController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$departamentos = Departamentos:... |
JavaScript | UTF-8 | 1,246 | 2.796875 | 3 | [
"MIT"
] | permissive | import GenesisBlock from './genesisBlock.js';
export default class Blockchain {
constructor(wallet) {
this._blocks = new Map();
this.headOfChain = new GenesisBlock(wallet);
this._blocks.set(this.headOfChain.hash, this.headOfChain);
}
size() {
return this._blocks.size;
}
add(block) {
... |
Python | UTF-8 | 396 | 2.578125 | 3 | [
"MIT"
] | permissive | from unittest import TestCase
from qbo import utils
class TestUtils(TestCase):
def test_valid(self):
parsed = utils.parse_int("12345")
assert parsed == 12345
def test_invalid(self):
parsed = utils.parse_int("test")
assert parsed is None
def test_invalid_with_default(self... |
Markdown | UTF-8 | 7,952 | 3.25 | 3 | [
"Apache-2.0"
] | permissive | ---
layout: post
title: "Dates(!) and Hashes(?) and Names, Oh My!!: The Weekly Challenge #132"
author: "Dave Jacoby"
date: "2021-09-27 17:50:50 -0400"
categories: ""
---
[Weekly Challenge 12*11!](https://theweeklychallenge.org/blog/perl-weekly-challenge-132/)
### TASK #1 › Mirror Dates
> Submitted by: Mark Anderson ... |
Java | UTF-8 | 4,200 | 2.109375 | 2 | [] | no_license | package cn.merryyou.web.controller;
import cn.merryyou.dto.User;
import lombok.extern.slf4j.Slf4j;
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.context.SpringBootTest;
import org.spri... |
JavaScript | UTF-8 | 3,823 | 3 | 3 | [] | no_license | const fs = require('fs');
const http = require('http');
const $ = require('cheerio');
const createCsvWriter = require('csv-writer').createObjectCsvWriter;
/* Getting the current date. Code is taken from
https://stackoverflow.com/questions/1531093/how-do-i-get-the-current-date-in-javascript */
let dateObject = new Dat... |
C++ | UTF-8 | 766 | 3.234375 | 3 | [] | no_license | #include<iostream>
using namespace std;
#include<string.h>
int checkidentical(char *s1,char *s2)
{
int i,a=1;
for(i=0;s1[i]!='\0';i++)
{
if(s1[i]>=65 && s1[i]<=92)
{
s1[i]=s1[i]+32;
}
}
for(i=0;s2[i]!='\0';i++)
{
if(s2[i]>=65 && s2[i]<=92)
{
... |
Python | UTF-8 | 843 | 3.1875 | 3 | [] | no_license | def trap(height):
ans = 0
l = len(height)
for i in range(l):
max_left,max_right = 0,0
for j in range(i, -1, -1):
max_left = max(max_left, height[j])
for k in range(i, l):
max_right = max(max_right, height[k])
ans += min(max_left, max_right) - height[i]... |
C++ | UTF-8 | 1,126 | 2.828125 | 3 | [
"MIT"
] | permissive | /// @file test_invert.cc
/// @brief test invert
/// @author Jeff Perry <jeffsp@gmail.com>
/// @version 1.0
/// @date 2013-06-12
#include "horny_toad/horny_toad.h"
#include <iostream>
using namespace std;
using namespace jack_rabbit;
using namespace horny_toad;
void test1 (bool verbose)
{
raster<float> x (3, 3);
... |
JavaScript | UTF-8 | 5,273 | 2.625 | 3 | [] | no_license | (() => {
var addButton = document.getElementById('addBeerButton');
var beerList = document.getElementById('beerList');
//TODO: find out where to put these transformable env variables
var apiURI = 'https://shielded-coast-63607.herokuapp.com';
// var apiURI = 'http://localhost:5000';
const getBeerList = () =... |
Java | UTF-8 | 3,049 | 2.296875 | 2 | [] | no_license | package tramitedoc.concytec.action;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.serv... |
Python | UTF-8 | 4,550 | 2.75 | 3 | [] | no_license | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
import time
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from selenium.webdriver.chrome.options import Options
# block to send messages
... |
JavaScript | UTF-8 | 2,082 | 2.59375 | 3 | [] | no_license | const graphql = require('graphql');
const gameType = require('../../types/gameType');
const { Game, gameSchema } = require('../../../models/game');
const enums = require('../../../utils/enums');
const mutation = {
type: new graphql.GraphQLList(gameType.type),
args: {
input: {
type: new graphql.GraphQLLis... |
Python | UTF-8 | 679 | 2.578125 | 3 | [] | no_license | from pymongo import MongoClient
#############################################
class MongoConnection:
def __init__(self):
self.client = MongoClient(
host="localhost",
port=27017,
connect=False
)
#########################################
def connect_articles_db(self):
return self.client['article... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.