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 |
|---|---|---|---|---|---|---|---|
Ruby | UTF-8 | 1,225 | 3.578125 | 4 | [] | no_license | # Module that can be included (mixin) to create and parse TSV data
module TsvBuddy
# @data should be a data structure that stores information
# from TSV or Yaml files. For example, it could be an Array of Hashes.
attr_accessor :data
# take_tsv: converts a String with TSV data into @data
# parameter: tsv - a... |
Markdown | UTF-8 | 1,213 | 3.015625 | 3 | [] | no_license | ---
layout: post
title: The best place to put script tags in HTML
date: '2017-01-17T20:53:00.000+07:00'
tags:
- Frontend
- HTML
---
When browsing a web page, browser will fetch HTML page. It then parses sequentially line by line, and shows HTML
components to user (like title, head...). When encounters a `<script>` tag... |
Markdown | UTF-8 | 1,623 | 2.9375 | 3 | [] | no_license | ---
title: Happy new year - New promises for 2016
layout: post
---

Happy New Year! Welcome to 2016
I've been away over the festive period focusing on my family and trying desperately to unwind for the 9-5 grind. During the run up to christmas I wasn't fee... |
Shell | UTF-8 | 1,316 | 2.8125 | 3 | [] | no_license | #!/bin/sh
SERVERS=(iodine passenger puma Rhebok thin unicorn)
# stop servers
pkill -f ruby &> /dev/null
# seeds
ruby ./setup.rb &> /dev/null
# clear old performance data
rm -R performance
# run servers
for i in "${!SERVERS[@]}"; do
mkdir -p "performance/${SERVERS[$i]}"
bundler exec rackup -s ${SERVERS[$i]} --p... |
C++ | UTF-8 | 3,781 | 3.78125 | 4 | [] | no_license | ///
/// @file multimap.cc
/// @author bigfei775655478@qq.com)
/// @date 2019-01-23 20:16:13
///
#include <math.h>
#include <map>
#include <string>
#include <iostream>
using std::cout;
using std::multimap;
using std::string;
using std::endl;
template <class Container>
void display(const Container & c)
{
f... |
C# | UTF-8 | 670 | 2.515625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WallSpikes : MonoBehaviour {
[SerializeField]
private bool isActive;
[SerializeField]
private int damageToGive;
private Animator anim;
void Start()
{
anim = GetComponent<Animator> ();
}
void OnTriggerEnter2D(Coll... |
Go | UTF-8 | 3,529 | 3.578125 | 4 | [
"Apache-2.0"
] | permissive | package rstack
import (
"fmt"
"strings"
"testing"
)
var cases = []struct {
name string
initialStackSlice []interface{}
action func(s *RStack) (*RStack, interface{}, error)
expectedStackString string
expectedValue string
}{
{
name: "Push one on empty",
init... |
JavaScript | UTF-8 | 1,677 | 3.46875 | 3 | [] | no_license |
var ImageManager = function(){
//Holds all your loaded images
this.library = {};
}
//TODO: make it so that the names is extracted from the paths?
//Takes an array of pathnames or a single path, a name array/single
//name and a callback fnction to run after images has loaded
ImageManager.prototype.load = function(... |
Java | UTF-8 | 898 | 3.71875 | 4 | [] | no_license | import java.util.regex.Matcher;
public class StringCalculator {
private final int NUMBER_LIMITER = 1000;
/*
* Sum the numbers present in the string
*/
public int add(String number) {
int sum = 0;
int temp = 0;
if(number.length() == 0) {
return 0;
}
Matcher m = RegexUtil.getNumberByRegex(nu... |
Markdown | ISO-8859-1 | 1,537 | 2.890625 | 3 | [
"MIT"
] | permissive | # asw-655-docker-composizione
Questo progetto contiene alcune applicazioni che esemplificano
il rilascio di applicazioni composte da uno o pi servizi,
da eseguire su un nodo [docker](../../environments/docker/)
oppure in un cluster [docker-swarm](../../environments/docker-swarm/).
In particolare, le applicazioni... |
Java | UTF-8 | 918 | 2.03125 | 2 | [] | no_license | package weimakeji.pojo;
public class LinkMan {
private Integer linkid;
private String lkmName;
private String lkmGender;
private String lkmPhone;
private String lkmMobile;
private Integer clid;
public Integer getLinkid() {
return linkid;
}
public void setLinkid(Integer linkid) {
this.linkid = linkid;
}
p... |
Python | UTF-8 | 519 | 2.921875 | 3 | [] | no_license | result=[]
ls=[]
instruct=[]
n=int(input())
for i in range(n):
instruct.append(input().split(" "))
if instruct[i][0]=="Q":
instruct[i][1]=int(instruct[i][1])-1
elif instruct[i][0]=="U":
instruct[i][1]=int(instruct[i][1])
for i in range(n):
if instruct[i][0]=="T":
ls.append(instruc... |
Markdown | UTF-8 | 5,160 | 3.15625 | 3 | [
"MIT"
] | permissive | # Ekko
[](https://packagist.org/packages/laravelista/ekko)
[](https://packagist.org/packages/laravelista/ekko)
[](htt... |
C++ | UTF-8 | 2,940 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <random>
#include <ctime>
int main(){
int turnScore = 0;
int roll;
int compScore;
int playerScore;
int running = 0;
srand(time(NULL));
int selection;
int whatever;
int game = 1;
//game turn
while (game == 1)
{
while (runni... |
C# | UTF-8 | 506 | 2.90625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _09抽象类特点
{
class Program
{
static void Main(string[] args)
{
}
}
abstract class Person
{
public abstract int SayHello(string name);
... |
Java | UTF-8 | 6,242 | 2.03125 | 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 mappers;
import beans.programaEsBean;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
*
* @author pedro
*/
pu... |
PHP | UTF-8 | 285 | 2.671875 | 3 | [] | no_license | <?php
class SpeSkillTest{
function find($a) {
$odds = [];
$evens = [];
foreach ($a as $n) {
if ($n % 2) array_push($odds, $n);
else array_push($evens, $n);
}
return count($evens) === 1 ? $evens[0] : $odds[0];
}
}
?> |
Java | UTF-8 | 1,214 | 3.28125 | 3 | [] | no_license | package modelo.juego;
import java.util.Comparator;
import static java.lang.Math.abs;
import static java.lang.Math.max;
public class Coordenada {
int row;
int col;
public Coordenada(int row, int col){
this.row = row;
this.col = col;
}
public int getCol() {
return col;
... |
Python | UTF-8 | 3,871 | 2.609375 | 3 | [] | no_license | #!/bin/env python
import pandas as pd
from sqlalchemy import create_engine
import scipy.stats as stats
import sys
import pylab
import matplotlib.pyplot as plt
# ---- IMPORT CONSTANTS
UN, PW, H, DB, PORT = "", "", "", "", ""
WRITE_PATH = ""
try:
from settings import *
from bias.scripts import trimmed_mean
exc... |
Java | UTF-8 | 316 | 2.015625 | 2 | [] | no_license |
public class TrocaDeSalas extends SistemadeCurso{
public static void main(String[] args) {
}
// private String;
private static String troca() {
if (x % 2 == 0) {
sala2[y] = sala1[x];
} else {
if (y % 2 == 1) {
sala1[x] = sala2[y];
}
}
return null;
}
}
|
Java | UTF-8 | 631 | 1.835938 | 2 | [] | no_license | package com.jd.cms.dao.appManagement;
import com.jd.cms.domain.appManagement.ArrCountObj;
import com.jd.cms.domain.clientmanager.SalerActive;
import com.jd.cms.domain.clientmanager.SalerActiveParameter;
import java.util.List;
/**
* Created by YYF on 14-5-9.
*/
public interface SalerActiveDao {
/**
* 促销员活跃... |
Python | UTF-8 | 9,414 | 2.734375 | 3 | [] | no_license | #Cube using primitives and truncation
#Made by:- Vandit Sheth
import sys
from OpenGL.GLUT import *
from OpenGL.GL import *
from OpenGL.GLU import *
#Flag for mode switching
flag=0
#Here the value of sets how deep th cut will be
a = 1
b = 0.3
c = a - b
#Setting defaults for rotation and truncation
press = 0
press1 =... |
Java | UTF-8 | 5,062 | 2 | 2 | [] | no_license | package com.bdtd.card.generator.web.config;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;... |
Markdown | UTF-8 | 7,235 | 3.15625 | 3 | [] | no_license | # **FindFlix**
[FindFlix](https://ariannasantiago.github.io/SES-app/) helps moviewatchers find film information and details. Users can view search results in the form of a set of movie cards/posters.
This website pulls data about movies using the [OMDB API](https://www.omdbapi.com), was bootstrapped with [Create Reac... |
C# | UTF-8 | 3,242 | 2.6875 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections;
using System.Reflection;
using System.Text;
using Google.Protobuf;
using UnityEngine;
namespace ETModel
{
public static class Dumper
{
private static readonly StringBuilder _text = new StringBuilder("", 1024);
private static void AppendIndent(int num)
... |
Java | UTF-8 | 1,321 | 2.234375 | 2 | [] | no_license | package com.root.wishlist.adapters;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.root.wishlist.pojo.search.SearchResult;
import com.root.wishlist.R;
import jav... |
PHP | UTF-8 | 985 | 2.6875 | 3 | [] | no_license | <?php
namespace spec\DesignPatterns\Builder;
use DesignPatterns\Builder\CurlCommand;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
class CurlBuilderSpec extends ObjectBehavior
{
function let()
{
$this->beConstructedWithUrl('google.com');
}
function it_can_build_a_CurlCommand()
{
... |
Java | UTF-8 | 2,111 | 3.046875 | 3 | [
"MIT"
] | permissive | package matrix;
import datastructures.util.InputUtil;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertArrayEquals;
public class TestCircularMatrix {
private static String inputFile = "input_files/matrix/circular_matrix/test_case";
private... |
Markdown | UTF-8 | 1,681 | 2.65625 | 3 | [
"MIT"
] | permissive | <!-- Source: https://github.com/kiloforce/markdowntest/README.md -->
# This is an h1 level tag
## This is an h2 level tag
###### This is an h6 level tag
<!-- This is a
comment, has to be on a new line! -->
<!-- line breaks are merged -->
Roses are Red
Violets are Blue
Text Styles:
*This text will be italic*
_T... |
Python | UTF-8 | 2,471 | 3.421875 | 3 | [] | no_license | """
Dungeon setup file
"""
from modules import Room, Enemy, Friend, Item, RPGInfo
def init():
room_objects = {}
room_data = {
"Kitchen": {
"description": "A dank and dirty room buzzing with flies"
,
"links": {"Dining Hall": "south"}
},
"Ballroom": {
... |
Java | UTF-8 | 16,584 | 1.5 | 2 | [
"MIT"
] | permissive | /*
* oxTrust is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
*
* Copyright (c) 2014, Gluu
*/
package org.gluu.oxtrust.ldap.service;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.Stateless;
import javax.inject.Inje... |
Python | UTF-8 | 7,528 | 2.71875 | 3 | [] | no_license | import unittest
from Supervisor import BaseSupervisor
from Agent import BaseAgent
from mesa.time import RandomActivation
import numpy as np
from MeasurementGen import *
from DecisionLogic import *
from RewardLogic import *
from EvaluationLogic import *
class TestBaseSupervisor(unittest.TestCase):
"""
This clas... |
Go | UTF-8 | 990 | 3.375 | 3 | [] | no_license | package lex
import (
"bufio"
"fmt"
"github.com/vyevs/gojson/tok"
)
// attempts to read "true" or "false" and returns the corresponding token
// if not successful in reading the bool literal, returns an invalid token
// with the literal encountered instead
func readBoolToken(r *bufio.Reader) tok.Token {
literal, ... |
Markdown | UTF-8 | 2,554 | 3.0625 | 3 | [] | no_license | # IDEA2020.3详细破解教程
以下为自己破解教程记录
教程参考博主:(包含补丁下载)
https://www.exception.site/essay/idea-reset-eval
## 1.安装IDEA
选择试用期运行IDEA
新建一个普通项目
然后将ide-eval-resetter-2.1.6.zip拖到IDEA中

插件安装成功后,会提示如下:

{
string fileName = "test.txt"; // имя файла которого мы будем создавать
... |
C++ | UTF-8 | 5,126 | 2.6875 | 3 | [] | no_license | #include "SpecialCollectable.h"
#include "Constants.h"
#include "Stage.h"
using namespace cocos2d;
static int totalNumberOfCollectables = 20;
static int currentCollectableIndex = 0;
SpecialCollectable::SpecialCollectable(Stage const& stage){
_origin = Director::getInstance()->getVisibleOrigin();
_visibleSiz... |
Java | UTF-8 | 1,650 | 2.21875 | 2 | [] | no_license | package com.experis.formacion.alexa.poc.service.dto;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
public class FormacionesSugeridasDTO extends FormacionesDTO implements Serializable {
private List<String> habilidadesRelacionadas;
private List<String> interesesRelacionados;
... |
Markdown | UTF-8 | 466 | 3.375 | 3 | [] | no_license | # Pattern 20
1. You are given a number n.
2. You've to write code to print the pattern given in output format below.
## Input Format
A number n
## Output Format

## Constraints
1 <= n <= 10
Also, n is odd.
#... |
C# | UTF-8 | 492 | 2.515625 | 3 | [] | no_license | using System;
using System.Windows.Forms;
namespace Assignment_4
{
public partial class OrderView : UserControl
{
public OrderView()
{
InitializeComponent();
}
private void OrderView_Load(object sender, EventArgs e)
{
labelTimer.Text = DateTime.... |
Java | UTF-8 | 638 | 2.109375 | 2 | [] | no_license | package com.boot.springboot.controller;
import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author: Michael J H Duan
* @Date... |
PHP | UTF-8 | 2,308 | 2.875 | 3 | [] | no_license | <?php
namespace App\Services;
use App\Http\Resources\ApiError;
use App\Repositories\PokemonRepository;
use App\Http\Resources\PokemonDetail;
use App\Http\Resources\Pokemon as PokemonCollection;
use App\Repositories\Interfaces\PokemonRepositoryInterface;
class PokemonService implements Interfaces\PokemonServiceInter... |
Java | UTF-8 | 3,048 | 2.625 | 3 | [] | no_license | package entu.timer.timers;
import static entu.timer.timers.Timer.currentRunId;
import static java.time.LocalDateTime.ofInstant;
import static java.time.ZoneId.systemDefault;
import entu.timer.output.Output;
import entu.timer.persistence.Json;
import java.io.IOException;
import java.time.Instant;
import java.time.Loca... |
Python | UTF-8 | 1,602 | 2.71875 | 3 | [] | no_license | import tensorflow as tf
import select
import sys
def isIterableNotString(o):
if isinstance(o, str):
return False
try:
for e in o:
return True
except TypeError:
return False
def cartesian_product(a, b):
len_a = tf.shape(a)
len_b = tf.shape(b)
new_a = tf.resh... |
Python | UTF-8 | 103 | 2.546875 | 3 | [] | no_license | import sys
sys.stdout=open("code.in","w")
print(1)
print(1,200000)
for i in range(200000):
print(1,1)
|
Markdown | UTF-8 | 889 | 2.984375 | 3 | [] | no_license | ## 63. 오류를 놓치지 않도록 조심하라.
nodejs를 사용한다면 다음과 같이 아래 체크를 하자. ( 콜백헬 @.@;; )
```js
function onError(error){
console.error( 'Error : ' + error );
}
downloadAsync('a.txt', function(a){
downloadAsync('b.txt', function(b){
downloadAsync('c.txt', function(c){
console.log('contents : ' + a + b + c );
}, onErro... |
Java | UTF-8 | 655 | 2.234375 | 2 | [] | no_license | package com.llk.therapist.util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
@Configuration
public class ConfigUtility {
@Autowired
private Environment env;
public String getP... |
C++ | UTF-8 | 1,934 | 2.578125 | 3 | [
"BSD-2-Clause-Views"
] | permissive | #include <MCSInputWidget.h>
#include <QLineEdit>
#include <QComboBox>
#include <QVBoxLayout>
#include <QLabel>
#include <QValidator>
#include <QJsonObject>
MCSInputWidget::MCSInputWidget(QWidget *parent)
: UQ_MethodInputWidget(parent)
{
auto layout = new QGridLayout();
// create layout label and entry for # s... |
Markdown | UTF-8 | 2,639 | 3.140625 | 3 | [] | no_license | PACKAGE DOCUMENTATION
package acfmgr
import "./acfmgr"
Package acfmgr is a package to manage entries in an AWS credentials file
Sample AWS creds file format:
[default]
output = json
region = us-east-1
aws_access_key_id = QOWIASOVNALKNVCIE
aws_secret_access_key = zgylMqe64havoaoinweofnviUHqQKYHMGzFM... |
C++ | UTF-8 | 963 | 3.25 | 3 | [] | no_license | #include "Vector.h"
namespace triangles
{
float crossProduct(const Vector<2>& lhs, const Vector<2>& rhs)
{
return lhs[0] * rhs[1] - lhs[1] * rhs[0];
}
float crossProductN(const Vector<2>& lhs, const Vector<2>& rhs)
{
return crossProduct(lhs, rhs) / lhs.getLength() / rhs.getLeng... |
Python | UTF-8 | 190 | 2.734375 | 3 | [] | no_license | from enum import IntEnum, Enum
class Pieces(IntEnum):
EMPTY = 0
WHITE = 1
WHITE_PROMOTED = 2
BLACK = 3
BLACK_PROMOTED = 4
class Color(Enum):
WHITE = 1
BLACK = 2 |
Shell | UTF-8 | 1,047 | 3.640625 | 4 | [] | no_license | #!/bin/bash
#bclient <machine> <port> <file> <N-threads> <N-cycles>
#Indicates the name or IP address where the server is running
MACHINE=$1
#The port number of the corresponding server
PORT=$2
#The path to the file that is going to be transferred
#(it could be a text file or an image of any size)
FILE=$3
#Number ... |
Python | UTF-8 | 738 | 2.59375 | 3 | [] | no_license | import selenium
from selenium.webdriver.support.select import Select
print("001_Exercise")
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome(executable_path="C:\Selenium Browser driver\chromedriver.exe")
driver.get("https://letskodeit.teachable.com/p/pr... |
Java | UTF-8 | 1,274 | 2.078125 | 2 | [] | no_license | package com.example.mdevt;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Header;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
public interface UploadApi {
@Multipart
@POST("sub_age... |
Java | UTF-8 | 888 | 3.90625 | 4 | [] | no_license | //Robert Roche
package module3_roche_assignment1;
import java.util.Stack;
/**
*
* @author Bobby
*/
public class Module3_Roche_Assignment1 {
public static void main(String[] args) {
System.out.println("The first 50 numbers in the fibbonaci sequence are: \n");
Stack <Long> fib = new Stack <Long>... |
Java | UTF-8 | 1,165 | 3.25 | 3 | [] | no_license | package JDBC_test.Exer;
import JDBC_test.Utils.CommonUtil;
import JDBC_test.Utils.JDBC_Utils;
import org.junit.Test;
import java.util.Scanner;
import java.sql.Date;
/**
* 题目1:从控制台向数据库的表customers中插入一条数据,表结构如下
*/
public class Topic01 {
public static void main(String[] args) {
// 1. 获取控制台输入的信息
Sca... |
Python | UTF-8 | 1,310 | 3.921875 | 4 | [] | no_license | class Player(object):
def __init__(self, name, turn, score, numOfPlayer):
if isinstance(name, str) and isinstance(turn, bool) and isinstance(score and numOfPlayer, int or float):
self.name = name
self.turn = turn
self.score = score
self.numOfPlayer = numOfPla... |
SQL | UTF-8 | 4,583 | 3.125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.5.1
-- http://www.phpmyadmin.net
--
-- Client : 127.0.0.1
-- Généré le : Jeu 25 Août 2016 à 22:46
-- Version du serveur : 5.7.11
-- Version de PHP : 5.6.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... |
Java | UTF-8 | 869 | 3.4375 | 3 | [] | no_license | package com.oracle.section8;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
public class ArrayTest {
public static void main(String[] args) throws FileNotFoundException{
int [] a = new int[4];
a[0] = 10;
a[1] = 20;
a[2] = 30;
a[3] = 40;
... |
Markdown | UTF-8 | 13,531 | 2.921875 | 3 | [] | no_license | ---
author:
name: tyleryoung
picture: 110161
body: Here is my latest brainstorm on the navigation metaphor that Reveleare has created.
The three screens represent three hypothetical levels of the site, in the order
they appear. <BR> <BR>The small logo on the second two levels fades-in once the
root level is p... |
C# | UTF-8 | 1,574 | 3.375 | 3 | [] | no_license | using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JustFun.Models
{
public class QueueReconstructionByHeight
{
public int[][] Solve(int[][] arr)
{
Array.Sort(arr, new HeightComparer... |
C++ | WINDOWS-1251 | 720 | 3.484375 | 3 | [] | no_license | /* 3(g)
n x. y:
y= -1/x + 1/2x - 1/3x + ... + 1/nx .*/
#include "iostream"
#include <fstream>
#include <cmath>
using namespace std;
void countValue(int n, float x, float &y);
void writeFile(float &y);
int main() {
setlocale(LC_ALL, "Russian");
int n;
float x;
float y = 0;
cin >> n >> x;
countValue(n, x,... |
Python | UTF-8 | 1,575 | 2.53125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
# vim: syntax=python tabstop=2 expandtab
# coding: utf-8
#------------------------------------------------------------------------------
# Convert CSV with read counts to PyClone-VI input TSV file.
#------------------------------------------------------------------------------
# author : Harald... |
PHP | UTF-8 | 1,182 | 2.75 | 3 | [] | no_license | <html>
<body>
<?php
$connect = mysqli_connect('localhost', 'root', '', 'SIM')
or die('Error connecting to the server: ' . mysqli_error($connect));
$sql = 'SELECT * FROM USERS WHERE USERNAME = "' . $_POST['username'] . '"';
$result = mysqli_query($connect, $sql) or die('The query faile... |
Python | UTF-8 | 1,411 | 2.5625 | 3 | [] | no_license | #!/usr/bin/env python3
"""
Simple script for creating a key using KMS and applying a policy to it
__author__ = "Eddie Atkinson"
__copyright__ = "Copyright 2020"
"""
import boto3
import json
KEY_DESC = "22487668-testkey"
ALIAS = "22487668Key"
key_exists = False
JSON_FILE = "policy.json"
policy = ""
kms = boto3.client(... |
Java | UTF-8 | 10,003 | 1.65625 | 2 | [] | no_license | package com.app.ui;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.text.method.HideReturnsTransformationMethod;
import android.text.method.PasswordTransformationMethod;
import android.... |
SQL | UTF-8 | 250 | 2.640625 | 3 | [] | no_license | -- 1
SELECT DATETIME from ANIMAL_INS order by DATETIME desc limit 1
-- 2
SELECT DATETIME From ANIMAL_INS order by DATETIME asc limit 1
-- 3
SELECT COUNT(*) FROM ANIMAL_INS
-- 4
SELECT COUNT(distinct NAME) as cnt from ANIMAL_INS where NOT NAME IS NULL |
C# | UTF-8 | 1,129 | 2.59375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
using voa_ps_data_stub.Helpers;
namespace voa_ps_data_stub.Tests.Helpers
{
public class URLDataTests
{
[Fact]
public void ShouldReturnCorrectPath()
{
string directory = "/some/dir/";
... |
C++ | UTF-8 | 4,644 | 2.734375 | 3 | [] | no_license | #pragma once
#include <vector>
#include <unordered_map>
#include "Artifice/Core/Core.h"
#include "Artifice/Core/Log.h"
#include "RenderGraphResourceCache.h"
class RenderGraphRegistry
{
private:
RenderGraphTextureCache m_TextureCache;
RenderGraphBufferCache m_BufferCache;
std::unordered_map<std::st... |
Markdown | UTF-8 | 886 | 2.59375 | 3 | [
"MIT"
] | permissive | # email-parser
Parser written in Java to extract and organize e-mails from an input file. User can write an e-mail using the application and save it into a file. User can also open a file and display its contents in the application. The save format below can also be found in the src folder.
--------------------------... |
C++ | UTF-8 | 2,053 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
vector<vector<double>> cost;
vector<vector<double>> minCost;
vector<int> have;
vector<double> diff;
int s, n, m, p;
int start = 0;
double calcMinCost(int st, int av)
{
if (av & 1 || av == (1 << (p + 1)) - 1)
return 0.0;
if (mi... |
C# | UTF-8 | 848 | 2.796875 | 3 | [] | no_license | //USING THE STATEMNET USING IT WILL TAKE CARE TO DISPOSE CONNECTION AND PLACE TRY CATCH WITHIN PROCS
{
using (SqlConnection cnn = new SqlConnection(ConfigurationManager.AppSettings("connectionString"))) {
if (cnn.State == System.Data.ConnectionState.Closed)
cnn.Open();
using (SqlCommand cmd = new SqlCom... |
C++ | UTF-8 | 476 | 3.078125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
int atoi(char num[])
{
int n,i,j,len=-1;
while(num[++len]!=0);
n=0;
for(i=0;i<len;i++)
{
n*=10;
n+=num[i]-48;
}
return n;
}
int main()
{
int n;
char num[12];
printf("Ingrese una cadena de caracteres: \n")... |
Java | UTF-8 | 10,737 | 2.171875 | 2 | [] | no_license | package org.mifosplatform.portfolio.savingsdepositproduct.domain;
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.apache.commons.lang.StringUtils;
im... |
Markdown | UTF-8 | 5,848 | 2.65625 | 3 | [
"MIT"
] | permissive | ---
date: 2019-07-23
title: "Live Stellar Wallet for Testing Smart Contracts"
published: false
tags: ["react", "projects", "css", "javascript"]
canonical_url:
cover_image: ../../images/coverImages/2019-07-23-cover-image.jpeg
---
I am very happy to announce the [Live](https://stellar-wallet.netlify.com) version of my o... |
C++ | UHC | 638 | 3.21875 | 3 | [] | no_license | /*
* ex.15-11.cpp
*
* Created on: 2018. 11. 12.
* Author: kgall305
*/
#include <iostream>
using namespace std;
int main() {
int n, sum, average;
while(true) {
cout << " Էϼ : ";
cin >> sum;
cout << "ο Էϼ : ";
cin >> n;
try {
if (n<=0)
throw n;
else ... |
Java | UTF-8 | 2,076 | 2.09375 | 2 | [] | no_license | package taro.service;
import taro.app.logger.gps.auto.LogInfo;
import android.app.Service;
import android.content.Intent;
import android.location.Location;
import android.os.Binder;
import android.os.Handler;
import android.os.IBinder;
import android.provider.Settings;
import android.provider.Settings.Secure;
import a... |
JavaScript | UTF-8 | 1,952 | 3.125 | 3 | [] | no_license | function LikeButton() {
const [liked, setLiked] = React.useState(false);
const text = liked ? '좋아요 취소' : '좋아요';
// return React.createElement(
// 'button', // keyof ReactHTML
// { onClick: () => setLiked(!liked) }, // ...children : 이하 children 속성
// text,
// );
return <butt... |
Java | WINDOWS-1250 | 2,487 | 2.0625 | 2 | [] | no_license | package br.com.sicoob.sisbr.sicoobdda.entidades;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import br.com.sicoob.sisbr.sicoobdda.entidades.anotacao.Conversor;
/**
* SituacaoProcessamentoArquivo responsvel por
*
* @author Francis... |
Python | UTF-8 | 1,328 | 3.140625 | 3 | [] | no_license | import tkinter as tk
class nom_fichier(tk.Toplevel):
def __init__(self, parent, titre='titre', message='message'):
tk.Toplevel.__init__(self, parent)
self.title = titre
self.entry = tk.Entry(self, width=50)
self.entry.grid(row=1, columnspan=2, padx=2, pady=5)
tk.Button(self... |
Python | UTF-8 | 660 | 2.6875 | 3 | [] | no_license | from util.data import recordings, shows, productions
def find_recordings_by_show_title(title):
if title not in shows:
return []
title = shows[title]
if title in recordings:
return [item for sublist in list(recordings[title].values()) for item in sublist]
return []
def find_recordings... |
C++ | UTF-8 | 2,135 | 3.609375 | 4 | [] | no_license | #include <iostream>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <string>
using namespace std;
/*
Given two English words of the same length, say, "HEAD" and "TAIL", come up with a
sequence of valid English words, starting with "HEAD", and ending with "TAIL", such
that each word is for... |
Ruby | UTF-8 | 2,970 | 3.78125 | 4 | [] | no_license | ### String・シンボル・配列
## 文字列のencoding
a = "Ruby"
p a.encoding #=>'#<Encoding:UTF-8>
b = a.encode("SJIS")
p b.encoding #=>#<Encoding:Windows-31J>
## 文字列の比較
p 'a' < 'b' #=> true
p 'ab' < 'ac' #=> true
p 'ab' < 'ab' #=> false
p 'ab' == 'ab' #=> true
p 'ab' <=> 'ab' #=> 0
p 'a' <=> 'b' #=> -1
## シンボル
p sym1 = :'symbol' #=>... |
C | UTF-8 | 210 | 2.921875 | 3 | [] | no_license | #include <stdio.h>
int main(void)
{
int *arr;
int *tmp;
arr = malloc(sizeof(int) * 6);
/* if error */
tmp = realloc(arr, sizeof(int) * 8);
if (tmp == NULL) {
}
arr = tmp;
free(arr);
return 0;
}
|
Python | UTF-8 | 148 | 2.515625 | 3 | [] | no_license | #!/usr/bin/python
from Core.CoreCommand import CoreCommand
class PrintStringCommand(CoreCommand):
def execute(self):
print(self._obj)
|
Swift | UTF-8 | 577 | 2.53125 | 3 | [
"MIT"
] | permissive | //
// MeshMessage.swift
//
// Created by wesgoodhoofd on 2019-01-22.
//
import UIKit
import ObjectMapper
public class MeshMessage: RBSMessage {
public var triangles: MeshTriangleMessage[]? = [MeshTriangleMessage[]]()
public var vertices: PointMessage[]? = [PointMessage[]]()
public override init() {
super.... |
Java | ISO-8859-1 | 2,587 | 2 | 2 | [] | no_license | package gcom.gui.relatorio.atendimentopublico;
import gcom.gui.atendimentopublico.registroatendimento.ConsultarRegistroAtendimentoActionForm;
import gcom.relatorio.ExibidorProcessamentoTarefaRelatorio;
import gcom.relatorio.atendimentopublico.RelatorioConsultarRegistroAtendimento;
import gcom.seguranca.acesso.usu... |
Python | UTF-8 | 702 | 3.3125 | 3 | [] | no_license |
import math
def fuel_equation(mass):
amount = math.floor(mass / 3) - 2
return (amount if (amount > 0) else 0)
def first(input):
return sum([fuel_equation(n) for n in input])
def second(input):
def add_fuel(fuel):
amount = fuel_equation(fuel)
return (amount + add_fuel(amount) if amount > 0 else 0)
... |
Java | UTF-8 | 370 | 1.507813 | 2 | [] | no_license | package rm.tabou2.storage.tabou.dao.operation;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.CrudRepository;
import rm.tabou2.storage.tabou.entity.operation.TypeAmenageurEntity;
public interface TypeAmenageurDao extends CrudRepository<TypeAmenageurEntity, Lo... |
Java | UTF-8 | 1,294 | 2.8125 | 3 | [
"MIT"
] | permissive | import org.junit.Assert;
import org.junit.Test;
public class SolutionTest {
@Test
public void testCase0() {
final int[][] arr = {
{1, 1, 1, 0, 0, 0},
{0, 1, 0, 0, 0, 0},
{1, 1, 1, 0, 0, 0},
{0, 0, 2, 4, 4, 0},
{0, 0, 0, 2,... |
TypeScript | UTF-8 | 1,166 | 2.65625 | 3 | [] | no_license | import { getRepository, Repository } from 'typeorm';
import IUsersRepository from '../../repositories/IUsersRepository';
import ICreateUserDTO from '../../dtos/ICreateUserDTO';
import Users from '../entities/Users';
class UsersRepository implements IUsersRepository {
private ormRepository: Repository<Users>;
co... |
C++ | UTF-8 | 1,884 | 3.84375 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
struct Node{
int data;
struct Node* next;
};
struct Node* head;
void Insert(int data){
Node* newNode = new Node();
newNode->data = data;
newNode->next = NULL;
if(head == NULL){
head = newNode;
}
else{
Node* prevNode ... |
C++ | UTF-8 | 1,900 | 2.765625 | 3 | [] | no_license | #pragma once
#include <Windows.h>
#include <TlHelp32.h>
#include <string>
#include <comdef.h>
#include "PModule.hpp"
class Memory {
private:
HANDLE _process;
DWORD _pId;
public:
inline bool Attach(const char* pName, DWORD dwAccess) {
HANDLE handle = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
PROCESSE... |
Python | UTF-8 | 496 | 2.9375 | 3 | [
"MIT"
] | permissive | def dfs(G, S, stack, u):
if u in S: return
global cyc
S.add(u)
stack.add(u)
print(u)
for v in G[u]:
if cyc: return
if v in stack:
cyc = True
dfs(G, S, stack, v)
stack.discard(u)
cyc = False
G = {0: {1, 3}, 1:{}, 2:{0, 1}, 3:{2}}
S = set()
for u in G:
... |
C++ | UTF-8 | 4,958 | 4.0625 | 4 | [] | no_license | // Kellie Henderson, Dr_T, Unit 7 assignment
#include <iostream>
#include<string>
#include<sstream> //for overriding toString()
using namespace std;
//Declare the structs of Unit 7
struct timeOfDay
{
short Hour;
short Minute;
short Second;
};
struct appDate
{
short dayOfMonth;
short month;
int yea... |
Ruby | UTF-8 | 1,216 | 2.625 | 3 | [] | no_license | class API::RouteTable
class << self
attr_accessor :table_items
def make(routes, descriptions)
@table_items = []
@descriptions = descriptions
routes.each do |route|
create_table_item(route, find_description(route))
end
end
def html
table_html = ""
@table_i... |
JavaScript | UTF-8 | 1,306 | 3.1875 | 3 | [] | no_license | /**
* 枚举
*/
var Direction;
(function (Direction) {
Direction[Direction["Up"] = 1] = "Up";
Direction[Direction["Down"] = 2] = "Down";
Direction[Direction["Left"] = 3] = "Left";
Direction[Direction["Right"] = 4] = "Right";
})(Direction || (Direction = {}));
console.log(Direction.Up);
var Direction2;
(func... |
Swift | UTF-8 | 6,542 | 2.53125 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | //
// EarthquakeDetailController.swift
// Flatland
//
// Created by Stuart Rankin on 7/6/20.
// Copyright © 2020 Stuart Rankin. All rights reserved.
//
import Foundation
import AppKit
class EarthquakeDetailController: NSViewController, NSTableViewDelegate, NSTableViewDataSource
{
override func viewDidLoad()
... |
PHP | UTF-8 | 9,416 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace WebAction\Maghead;
use WebAction\Param\Param;
use WebAction\Param\ImageParam;
use WebAction\Param\FileParam;
use WebAction\Action;
use WebAction\RecordAction\BaseRecordAction;
use WebAction\RecordAction\CreateRecordAction;
use WebAction\RecordAction\UpdateRecordAction;
use WebAction\RecordAction\Dele... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.