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 |
|---|---|---|---|---|---|---|---|
JavaScript | UTF-8 | 806 | 2.71875 | 3 | [] | no_license | (function(birdmin){
function HistoryController()
{
var page = 0;
var state = function(n) {
return {page:n};
};
this.popped = false;
/**
* Push a URL into the history.
* @param url string
* @returns {Object}
*/
this... |
Java | UTF-8 | 647 | 3.5 | 4 | [] | no_license | package java02;
public class ja02_12_ASCII코드 {
public static void main(String[] args) {
int x = '4'; //문자가 숫자로 변환됨, ASCII:52
int y = '5'; //문자가 숫자로 변환됨, ASCII:53
int res = 0;
res = x + y;
System.out.println(res);
... |
Python | UTF-8 | 62 | 3.140625 | 3 | [] | no_license | def multiply(num):
x = num * num
print x
multiply(100) |
Java | UTF-8 | 1,139 | 3.65625 | 4 | [] | no_license | package collectionFramework.maps;
import java.util.*;
import java.util.HashSet;
class marker{
int price;
String colour;
public marker(int x,String s) {
price = x;
colour =s;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((colour == null) ? 0 : colour.hashCode(... |
Ruby | UTF-8 | 1,477 | 2.984375 | 3 | [
"MIT"
] | permissive | # frozen_string_literal: true
module Chatrix
class Bot
module Plugins
# Plugin to query various information about the bot.
class Info < Plugin
TIME_MULTS = [24, 60, 60, 1].freeze
register_command 'info', nil, 'Provides info about the bot',
handler: :info
... |
C# | UTF-8 | 241 | 2.734375 | 3 | [] | no_license | foreach (DataGridViewCell selectedCell in dataGridView1.SelectedCells)
{
foreach (DataGridViewCell cell in selectedCell.OwningRow.Cells)
{
if (cell.ColumnIndex > selectedCell.ColumnIndex)
cell.Value = selectedCell.Value;
}
}
|
C++ | UTF-8 | 1,077 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include "nodei.h"
using namespace std;
int main()
{
int choice,n,m,position,i;
NodeImplementation obj;
while(1)
{
cout<<endl<<"1. Create List"<<endl;
cout<<"2. EnQueue"<<endl;
cout<<"3. DeQueue"<<endl;
cout<<"4. Display"<<endl;
cout<<"5. ShowSize"<<endl;
cout<<"6. PEEK"<<endl;
co... |
Python | UTF-8 | 970 | 2.796875 | 3 | [] | no_license | import speech_recognition as sr
from gtts import gTTS
from translation import evaluate
from SentimentAnalysis import predict
import os
from time import sleep
import pyglet
from sarcasm import predict_text
import playsound
import numpy as np
def translate():
r = sr.Recognizer()
with sr.Microphone() as source:
... |
Java | UTF-8 | 1,379 | 2.515625 | 3 | [] | no_license | package db;
import java.sql.Connection;
import java.sql.PreparedStatement;
public class DBassignproject {
public String insert(int fname,int lname) {
try{
Connection con= DBConnect.getConnect();
String query="update add_employee set application_id=?,status=? where employee_id... |
JavaScript | UTF-8 | 3,490 | 3.265625 | 3 | [] | no_license | /* global $, boardDetails */
'use strict';
const playMechanics = (function(){
// initial state of gamePlay
const state = {
seqArr: [],
respArr: [],
strictMode: false,
count: 0,
inPlay: false
};
//render function
// -- checks for strict mode
// -- check status of seqArr vs respArr --> ... |
Java | UTF-8 | 5,810 | 1.664063 | 2 | [
"Apache-2.0"
] | permissive | begin_unit|revision:0.9.5;language:Java;cregit-version:0.0.1
begin_comment
comment|/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you u... |
Java | UTF-8 | 940 | 2.359375 | 2 | [] | no_license | package servicio;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import model.Contacto;
@Service
public class ServicioContactosImpl implements ServicioContactos {
@Autowired
RestTemplate rt... |
Java | UTF-8 | 699 | 1.859375 | 2 | [] | no_license | package android.text.method;
public class Touch
{
Touch() { throw new RuntimeException("Stub!"); }
public static void scrollTo(android.widget.TextView widget, android.text.Layout layout, int x, int y) { throw new RuntimeException("Stub!"); }
public static boolean onTouchEvent(android.widget.TextView widget, android.t... |
Python | UTF-8 | 1,128 | 3.234375 | 3 | [] | no_license | from typing import ItemsView
def validIPAddress(string):
ipAddressesFound = []
for i in range(1, min(len(string), 4)):
print(len(string))
currentIPAddress = ["","","",""]
currentIPAddress[0] = string[:i]
if not isValid(currentIPAddress[0]):
continue
for ... |
Markdown | UTF-8 | 1,164 | 3.046875 | 3 | [
"MIT"
] | permissive | # Component_pin_net_mapping
A small script that takes a netlist created in Orcad and creates a pin-net mapping for components, connectors and testpoints.
In order for this to work, the following naming conventions need to be set:
* Components need to have the letter "U".
* Connectors need to have the letter "J".
* Tes... |
Java | UTF-8 | 1,704 | 3.25 | 3 | [
"Apache-2.0"
] | permissive | package org.seasar.doma;
import org.seasar.doma.internal.util.StringUtil;
/**
* Defines naming convention rules for the keys contained in a {@code Map<Object, String>} object.
*
* <p>The key name is resolved from a column name by applying this convention.
*/
public enum MapKeyNamingType {
/** Does nothing. */
... |
TypeScript | UTF-8 | 1,125 | 2.703125 | 3 | [] | no_license | import { Interruptions } from "./interruptions"
export class Observer {
subscriber: any[] = []
subscribe(who: any, what: any, cb: any) {
if (!this.subscriber[what]) {
this.subscriber[what] = [];
}
for (var i = 0; i < this.subscriber[what].length; i++) {
var o =... |
C | UTF-8 | 1,472 | 3.59375 | 4 | [] | no_license | #include <stdio.h>
#include "bmi.h"
void calculate_bmi_imperial() {
UserInfo user_info;
float ft, in;
printf("---\n");
printf("Enter your weight (lbs): ");
scanf(" %f", &user_info.weight);
printf("Enter your height:\n");
printf(" Feet: ");
scanf(" %f", &ft);
printf(" Inches: ");
... |
C++ | UTF-8 | 110 | 2.515625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int x[5]={0,1,2,3,4};
string y = char(x);
cout<<y;
} |
Rust | UTF-8 | 681 | 2.765625 | 3 | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | //! Unix-specific extensions.
use heim_common::prelude::BoxFuture;
use crate::ProcessResult;
mod signal;
pub use self::signal::Signal;
/// Unix-specific extension to [Process].
///
/// [Process]: ../../struct.Process.html
pub trait ProcessExt {
/// Send the signal to process.
///
/// Since `-> impl Tra... |
Java | UTF-8 | 2,351 | 2.6875 | 3 | [
"Apache-2.0",
"WTFPL"
] | permissive | package eu.ha3.matmos.editor;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.util.ArrayList;
import java.util.Map;
import javax.swing.AbstractListModel;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
im... |
Python | UTF-8 | 241 | 3.09375 | 3 | [] | no_license | # https://codeforces.com/problemset/problem/888/A
n = int(input())
a = tuple(map(int, input().split()))
ans = 0
for i in range(1, n-1):
if a[i] < a[i+1] and a[i] < a[i-1] or a[i] > a[i+1] and a[i] > a[i-1]:
ans += 1
print(ans) |
Shell | UTF-8 | 8,453 | 2.875 | 3 | [] | no_license | #!/usr/bin/haserl
<%
# This program is copyright © 2008-2013 Eric Bishop and is distributed under the terms of the GNU GPL
# version 2.0 with a special clarification/exception that permits adapting the program to
# configure proprietary "back end" software provided that all modifications to the web interface
# itse... |
Markdown | UTF-8 | 897 | 3.265625 | 3 | [] | no_license | # Angular Dynamic Overflow Menu
[**Read the full post about this menu on my blog**](https://jcs.wtf/angular-dynamic-overflow-menu/)
> An "angular" approach to a very DRY dynamic overflow menu using [@angular/cdk](https://github.com/angular/components)s awesome portals.
**Problem:** You need to develop a hotizontal t... |
Python | UTF-8 | 1,057 | 3.03125 | 3 | [
"MIT"
] | permissive | from abc import ABC, abstractmethod
class MAB(ABC):
"""
Abstract class that represents a multi-armed bandit (MAB)
"""
@abstractmethod
def play(self, tround, context):
"""
Play a round
Arguments
=========
tround : int
positive integer... |
Java | UTF-8 | 737 | 3.625 | 4 | [] | no_license | package DataStructure;
import java.util.LinkedHashMap;
import java.util.Map;
public class FirstNonRepeatingElement {
public static void main(String[] args) {
FirstNonRepeatingElement obj = new FirstNonRepeatingElement();
System.out.println(obj.methodFirstNonRepeating("Inzamamul"));
}
public Character methodF... |
Markdown | UTF-8 | 698 | 2.65625 | 3 | [] | no_license | # mustBeFile
**Filetype:** _MATLAB® function_
**Synopsis:** _Validate value is a filename (or set of filenames) on the path_
MUSTBEFILE is a validation function
which wraps to isfile() and issues an error if the input argument is not comprised solely of
existing files on the path. (The input can be a string arra... |
Java | UTF-8 | 875 | 2.5 | 2 | [
"Apache-2.0"
] | permissive | package com.example.nekonekocats;
import android.app.Activity;
import android.content.res.Configuration;
import androidx.appcompat.app.AppCompatDelegate;
public class AppColorTheme {
// Toggle the color theme of this app
public static void toggle(Activity activity) {
int currentNightMode = activity.g... |
JavaScript | UTF-8 | 442 | 4.0625 | 4 | [] | no_license | Math.floor(Math.random() * 11); // [0 ,11[
// 1) Crear arreglo 5 elementos
const arreglo = [];
const arreglo2 = [];
// 2) Cada elemento 1 o 0
for (let indice = 0; indice < 10; indice++) {
arreglo[indice] = Math.floor(Math.random() * 2);
}
console.log(arreglo);
for (let i = 0; i < 10; i++) {
arreglo.push(Math.fl... |
PHP | UTF-8 | 1,474 | 2.546875 | 3 | [] | no_license | <?php
$sitegroup = '';
$env = '';
$sites = array(
);
$backup_location = '/tmp/dumps';
$data = date('YmdHi');
// Create the backup directory.
create_dir($backup_location);
foreach ($sites as $uri) {
$db_name = vget('gardens_db_name');
// Archive the themes and files to the backup directory.
$files_dir = "/var/... |
Java | UTF-8 | 377 | 1.8125 | 2 | [] | no_license | package com.john.cloud.provider.repositories;
import com.john.cloud.provider.model.Good;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* Created by cjl20 on 2017/5/16.
*/
public interface GoodRepository extends JpaRepository<Good, Long> {
... |
C# | UTF-8 | 2,921 | 2.84375 | 3 | [] | no_license | using InternetBankingApp.Interfaces;
using InternetBankingApp.Models;
using InternetBankingApp.Utilities;
using Microsoft.Data.SqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace InternetBankingApp.Managers
{
public class Custome... |
Markdown | UTF-8 | 2,713 | 2.75 | 3 | [] | no_license | # Express application using ES6
## 1. Pre Requisites
```sh
1. Install Node JS
2. Install NPM (Node Package Manager)
```
## 2. Scaffolding
```sh
npm init -y
touch README.md
touch .gitignore
touch .flowconfig
touch gulpfile.config.js
touch .babelrc
mkdir src
mkdir dist
```
## 3. Development
#### 3.1 Install Gulp
```sh
np... |
PHP | UTF-8 | 239 | 2.859375 | 3 | [] | no_license | <?php
namespace DesignPattern\Structural\DependencyInjection;
class Feed {
private $feed;
public function __construct(FeedInterface $feed) {
$this->feed = $feed;
}
public function get(){
return $this->feed->getMessages();
}
} |
Java | UTF-8 | 1,818 | 3.21875 | 3 | [] | no_license | package fileIO;
import java.io.IOException;
import java.util.Scanner;
public class SignUpService {
//1.Get username and check it is exist or not (to prevent the user re-sign-up with registered credentials)
//2.Get password and re-writing of password
//3.After success message of sign-up redirect user to s... |
Java | UTF-8 | 3,111 | 2.78125 | 3 | [] | no_license | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import javax.swing.*;
import org.json.*;
public class CollegeMain
{
private static JFrame new_frame;
public stat... |
Java | UTF-8 | 4,020 | 1.835938 | 2 | [
"Apache-2.0"
] | permissive | /**
* Copyright 2010-2012 by PHP-maven.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... |
Python | UTF-8 | 1,161 | 3.65625 | 4 | [] | no_license | """
You are given a **list of binary integers** and `k`, the **number of flips**
allowed.
Write a function that returns the indices of zeroes of which, when flipped,
return the **longest contiguous sequence of ones**.
### Examples
zero_indices([1, 0, 1, 1, 0, 0, 0, 1], 1) ➞ [1]
zero_indices([1, 0, 0,... |
Markdown | UTF-8 | 4,188 | 3 | 3 | [
"MIT"
] | permissive | # tqdm-ruby
[](https://github.com/powerpak/tqdm-ruby/actions/workflows/ruby-ci.yml?query=event%3Apush+branch%3Amaster) [](https://badge.fu... |
C++ | UTF-8 | 746 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <cmath>
float original(float x);
//float mejor(float x);
float mejor2(float x);
float a = 0.01;
int main(void)
{
std::cout.precision(8); std::cout.setf(std::ios::scientific);
std::cout << "Grupo:\n";
std::cout << "Jorge Palmar Velasco\n";
std::cout << "Jorge Palmar Velasco\n";... |
Markdown | UTF-8 | 856 | 2.515625 | 3 | [] | no_license | Strangelove is a creative agency based in Amsterdam for the "always on" world. By using their business acumen they aim to provide solutions that are relevant, human-friendly, memorable and above all, simple.
Working as a full-stack developer my first order of business was to give the company website a much-needed make... |
Java | ISO-8859-1 | 497 | 3.796875 | 4 | [] | no_license | package cynthia_urbano.laboratorio4;
import java.util.Scanner;
//Escribir un programa para comprobar si el nmero ingresado por el usuario es positivo o negativo
public class NumeroPositivoNegativo {
public static void main(String[] args) {
Scanner sc = new Scanner (System.in);
int num;
System.out.println("... |
C | UTF-8 | 548 | 3.015625 | 3 | [
"MIT"
] | permissive | /* Inspired by the same problem under:
* https://github.com/tiny656/PAT */
#include <stdio.h>
int fav[201], dp[201];
int main()
{
int n, m, l, x;
scanf("%d\n%d", &n, &m);
for (int i = 1; i <= m; i++)
scanf("%d", &fav[i]);
scanf("%d", &l);
for (int i = 0; i < l; i++) {
scanf("%d", ... |
Shell | UTF-8 | 1,617 | 3.5625 | 4 | [
"MIT"
] | permissive | #!/bin/bash
# GENERATE AND WRITE ROOT PW
#===============================================================================
function f_set_root_pw() {
# remove root from shadow file
awk '{ if($1 !~ /root/) print }' /mnt/etc/shadow > /mnt/etc/new_shadow
# generate and add root pasword to the new shadow file
openssl... |
JavaScript | UTF-8 | 709 | 3.203125 | 3 | [] | no_license | /*
This tests file contains sample demonstrating custom commands and its usage.
*/
/*
Adding a custom command to the browser instance
*/
browser.addCommand("getPageTitleAndUrl", function (){
return {
url: browser.getUrl(),
title : browser.getTitle()
};
});
/*
Usage of custom command
*/
describe("Usage... |
Swift | UTF-8 | 989 | 2.640625 | 3 | [] | no_license | //
// PersonTableViewCell.swift
// Test1
//
// Created by eCOM-arjun.tp on 15/09/21.
//
import UIKit
class PersonTableViewCell: UITableViewCell {
@IBOutlet weak var name: UILabel!
@IBOutlet weak var age: UILabel!
@IBOutlet weak var termDate: UILabel!
@IBOutlet weak var termFee: UILabel!
v... |
Python | UTF-8 | 367 | 3.21875 | 3 | [] | no_license | # A palindromic number reads the same both ways.
# The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 c397 99.
# Find the largest palindrome made from the product of two 3-digit numbers.
from decorators import *
import numpy as np
import math
def v1():
print()
@timer
def main():
... |
Java | UTF-8 | 12,610 | 1.820313 | 2 | [] | no_license | package com.dayal.xmpptest2;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.app.ActivityManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.Inte... |
PHP | UTF-8 | 1,369 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace app\modules\admin\models;
use Yii;
/**
* This is the model class for table "userstable".
*
* @property int $id
* @property string $login
* @property string $f_name
* @property string $l_name
* @property string $m_name
* @property string $password
* @property int $type
*
* @property Results... |
JavaScript | UTF-8 | 416 | 3.421875 | 3 | [] | no_license | const body = document.querySelector('body');
const colorName = document.querySelector('.color');
const button = document.querySelector('.change-color');
button.addEventListener('click', () => {
const newColor = getRandomHexColor();
body.style.backgroundColor = newColor;
colorName.textContent = newColor;
});
fun... |
Java | UTF-8 | 373 | 1.851563 | 2 | [] | no_license | package com.gopawpaw.erp.hibernate.p;
/**
* PlMstrId entity. @author MyEclipse Persistence Tools
*/
public class PlMstrId extends AbstractPlMstrId implements java.io.Serializable {
// Constructors
/** default constructor */
public PlMstrId() {
}
/** full constructor */
public PlMstrId(String plDomain, Strin... |
Markdown | UTF-8 | 1,875 | 4.03125 | 4 | [
"MIT"
] | permissive | # Recipe 14.11, Filtering a Map
## Mutable maps
Use `filterInPlace`:
```scala
val x = collection.mutable.Map(
1 -> 100,
2 -> 200,
3 -> 300
)
x.filterInPlace((k,v) => k > 1) // x: HashMap(2 -> b, 3 -> c)
x.filterInPlace((k,v) => v > 200) // x: HashMap(3 -> 300)
```
## Mutable and immutable maps
... |
Python | UTF-8 | 1,464 | 2.96875 | 3 | [] | no_license | """
This module contains tests for the Region class
"""
from unittest import TestCase
from mock import MagicMock, patch
from doboto import Region
class TestRegion(TestCase):
"""
This class implements unittests for the Region class
"""
def setUp(self):
"""
Define resources usable by a... |
C++ | UTF-8 | 755 | 2.828125 | 3 | [] | no_license | // Problem link: https://leetcode.com/problems/unique-paths-ii/
class Solution {
public:
int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {
int m = obstacleGrid.size();
int n = obstacleGrid[0].size();
vector<vector<long long>> dp(m);
for (int i=0; i<m; i++) {
... |
Java | UTF-8 | 823 | 2.546875 | 3 | [] | no_license | package com.wiseassblog.androidcleanguiarchitecture;
public interface IViewContract {
enum UpdateViewEvent {
UPDATE_LEFT_TEXT_LABEL,
UPDATE_RIGHT_TEXT_LABEL,
UPDATE_LEFT_SWITCH,
UPDATE_RIGHT_SWITCH,
UPDATE_LEFT_PROGRESS_BAR,
UPDATE_RIGHT_PROGRESS_BAR
}
inte... |
PHP | UTF-8 | 1,839 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace Tests\Feature\Queries;
use Tests\TestCase;
class UsersTest extends TestCase
{
/**
* @var \App\User
*/
private $user;
public function setUp(): void
{
parent::setUp();
$this->user = factory(\App\User::class)->create([
'name' => 'test1',
... |
TypeScript | UTF-8 | 3,600 | 2.671875 | 3 | [] | no_license | /// <reference path="../../typings/node/node.d.ts"/>
// Configuration:
// None
//
// Commands:
// hubot brb and I'm back - move cards to in development list or paused
//
// Author:
// Juan Jose Guevara, Aida Martinez <juanjose@acklenavenue.com, >
var httpClient = require('request-promise');
var key = "797802d6... |
Python | UTF-8 | 1,380 | 2.5625 | 3 | [
"MIT"
] | permissive | from django.test import TestCase
from rest_framework.reverse import reverse
class SeriesTestCase(TestCase):
fixtures = ['series.json']
def test_series_list(self):
resp = self.client.get(reverse('api:v1:series-list'))
self.assertEqual(resp.status_code, 200)
self.assertIsInstance(resp.... |
Java | UTF-8 | 6,031 | 2.375 | 2 | [
"MIT"
] | permissive | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package assignmentone_magazine;
import java.util.HashMap;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before... |
JavaScript | UTF-8 | 278 | 2.65625 | 3 | [] | no_license | // JavaScript Document
/*
* 打印机效果
* Copyright (c) 2013 某年某月
* Date: 2013-05-20
*
*/
function PrintWord() {
if (count <= str.length) {
obj.innerHTML = str.substring(0, count);
count++;
} else {
clearInterval(time);
}
} |
Python | UTF-8 | 1,707 | 3.203125 | 3 | [] | no_license | import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
from matplotlib.patches import Patch
# read csv
X = pd.read_csv("congress-terms.csv", thousands=',')
# form data frame from csv
df = pd.DataFrame(X)
# only for the state of Wyoming
df = df.loc[df['state'] == 'WY']
# make smaller ... |
Java | UTF-8 | 191 | 2.78125 | 3 | [] | no_license | package Threads;
public class SecondThread implements Runnable {
@Override
public void run() {
System.out.println("Second thread is Running by Runnable interface");
}
}
|
C++ | UTF-8 | 657 | 2.734375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <queue>
using namespace std;
int main()
{
int fact[15];
fact[0] = 1;
for(int i = 1; i < 15; ++i)
fact[i] = i * fact[i - 1];
string v =... |
Markdown | UTF-8 | 929 | 3.5 | 4 | [] | no_license | # 元素垂直居中的几种实现方式
- 单行文本垂直居中 - line-height
- 利用 vertical-align 设置父级元素为 table-cell 以及 vertical-align:middle
- 通过新增元素来实现垂直居中(after 也行)
```css
.parent {
height: 300px;
font-size: 0px;
}
.child {
font-size: 14px;
display: inline-block;
vertical-align: middle;
}
.childAdd {
display: inline-block;
vertical-alig... |
C# | UTF-8 | 693 | 3.125 | 3 | [] | no_license | // See https://aka.ms/new-console-template for more information
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
Console.WriteLine("Hello, World!");
BenchmarkRunner.Run<HoistingAggregation>();
[MemoryDiagnoser]
public class HoistingAggregation
{
[Benchmark]
[Arguments(100, 10)]
public in... |
C | UTF-8 | 324 | 3.484375 | 3 | [] | no_license | #include<stdio.h>
void reverse(int *arr, int n){
int temp;
for (int i = 0; i < n/2; i++){
temp = arr[i];
arr [n-i+1] = temp;
}
}
int main();
int arr[] = {1,2,3,4,5,6,7};
reverse(arr, 7);
for (int i = 0; i < 7; i++){
printf ("the value of %d element is: %d/n" , i, arr [i);
}
return 0... |
Java | UTF-8 | 20,048 | 1.53125 | 2 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | /*
* Copyright (c) 2005-2010 Grameen Foundation USA
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unl... |
Python | UTF-8 | 157 | 3.03125 | 3 | [] | no_license | a = [10, 20]
b = [a, 30]
a.append(b)
print(a)
from copy import deepcopy
c = deepcopy(a)
print(c)
print(c[2])
print(c[2][0])
print(c[2][0][2])
d = c[2][0][2] |
Python | UTF-8 | 3,599 | 2.671875 | 3 | [
"MIT"
] | permissive | #!/bin/env python
import unittest
from datetime import date, timedelta
from dateutil.relativedelta import relativedelta
import context
from cash_flow.transaction import Transaction
from cash_flow.transaction_store import TransactionStore
from cash_flow.cash_flow import CashFlow
from cash_flow.money import Money
class... |
C++ | UTF-8 | 1,924 | 3.5 | 4 | [] | no_license | /*
You are given N jobs where every job is represented as:
1.Start Time
2.Finish Time
3.Profit Associated
Find the maximum profit subset of jobs such that no two jobs in the subset overlap.
Input
The first line of input contains one integer denoting N.
Next N lines contains three space separated integers denoting the s... |
PHP | UTF-8 | 5,364 | 2.75 | 3 | [] | no_license | <?php
class Api
{
const ERROR_NO_IMAGE_FOLDER = 'no_image_folder';
private $imageFolder;
private $metaFile;
private $rootFolder;
public function __construct(
string $imageFolder = DEFAULT_IMAGEFOLDER,
string $metaFile = DEFAULT_METAFILE,
string $rootFolder = ROOT_FOLDER
... |
Java | UTF-8 | 1,572 | 1.9375 | 2 | [] | no_license | package com.winterframework.firefrog.game.service.impl;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.winterframework.firefrog.common.util.GameContext;
import com.winterframework.fir... |
Java | UTF-8 | 6,035 | 2.578125 | 3 | [
"MIT"
] | permissive | package im.djm.coin.tx;
import java.util.ArrayList;
import java.util.List;
import com.google.common.primitives.Longs;
import im.djm.blockchain.BlockUtil;
import im.djm.coin.txhash.TxHash;
import im.djm.coin.txhash.TxSignature;
import im.djm.wallet.WalletAddress;
/**
* @author djm.im
*/
public class Tx {
private... |
C++ | UTF-8 | 2,561 | 3.21875 | 3 | [] | no_license | #include "florp/graphics/Mesh.h"
namespace florp {
namespace graphics {
Mesh::Mesh(void* vertices, size_t numVerts, const BufferLayout& layout, uint32_t* indices, size_t numIndices) {
myIndexCount = numIndices;
myVertexCount = numVerts;
// Cache the layout
myLayout = layout;
// Create and bind o... |
Markdown | UTF-8 | 2,341 | 3.640625 | 4 | [] | no_license | # LeetCode
# Stick to practice coding of algorithmic problems everyday and you would be a good algorithm engineer someday!
## 062_(不同路径)Unique Paths
## 1 问题描述、输入输出与样例
### 1.1 问题描述
一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为“Start” )。<br>
机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角(在下图中标记为“Finish”)。<br>
问总共有多少条不同的路径?(图可以参见[62 不同路径](https://... |
C++ | UTF-8 | 848 | 3.96875 | 4 | [] | no_license | // function to reverse a doubly linked list
// in groups of given size
Node* revListInGroupOfGivenSize(Node* head, int k)
{
Node *current = head;
Node* next = NULL;
Node* newHead = NULL;
int count = 0;
// reversing the current group of k
// or less than k nodes by adding
//... |
SQL | UTF-8 | 1,006 | 3.9375 | 4 | [] | no_license | WITH X AS
(SELECT f.con_id,
MAX(t.termination_letter_created ) AS cfw_create_termination_letter,
count( DISTINCT f.cfw_nu_num_installment ) AS total_cfw_dt_installment,
MIN(f.cfw_nu_num_installment ) AS cfw_nu_num_installment
FROM td_contract c
INNER JOIN td_cashflow f
ON... |
Markdown | UTF-8 | 607 | 3.015625 | 3 | [] | no_license | # App purpose
Payments signature app
User inputs payments, these are signed with a random 10 x 10 alphabetic matrix and local time, stored, and ready to be sent to an API.
# Modules
App is very small - one module can fit all the functionality (App Module)
# Pages
Generator page
Payments page
# Services
Signature gen... |
Java | UTF-8 | 2,205 | 4.09375 | 4 | [] | no_license | package array;
/**
* 给定一个数组,将数组中的元素向右移动 k 个位置,其中 k 是非负数。
示例 1:
输入: [1,2,3,4,5,6,7] 和 k = 3
输出: [5,6,7,1,2,3,4]
解释:
向右旋转 1 步: [7,1,2,3,4,5,6]
向右旋转 2 步: [6,7,1,2,3,4,5]
向右旋转 3 步: [5,6,7,1,2,3,4]
示例 2:
输入: [-1,-100,3,99] 和 k = 2
输出: [3,99,-1,-100]
解释:
向右旋转 1 步: [99,-1,-100,3]
向右旋... |
JavaScript | UTF-8 | 1,104 | 2.734375 | 3 | [] | no_license | import axios from 'axios'
const fetchPopularShows = async (page) => {
try {
// const {data: {tv_shows}} = await axios.get('https://www.episodate.com/api/most-popular?page=1')
let url = `https://www.episodate.com/api/most-popular?page=${page}`
const {data: {tv_shows}} = await axios.get(url)
... |
PHP | UTF-8 | 1,337 | 2.53125 | 3 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Data modification</title>
<link rel="stylesheet" type="text/css" href="css_modify_page_two.css">
</head>
<body>
<h1>Data modification</h1>
<?php
$conexion=mysqli_connect("localhost", "c0230365_6to2020", "pozo62moRA", "c0230365_6to2020") ... |
Java | UTF-8 | 1,334 | 2.125 | 2 | [] | no_license | package com.rz.httpapi.bean;
import java.io.Serializable;
/**
* Created by Administrator on 2017/9/18 0018.
*/
public class DataStatisticsBean implements Serializable {
private String custId;
private int articleNum; //文章数量
private int coterieNum; //私圈数量
private int offerNum; //悬赏数量
... |
PHP | UTF-8 | 234 | 2.6875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | <?php
declare(strict_types=1);
namespace Edde\Api\Protocol\Event;
interface IListener {
/**
* return/generate list of listeners for EventBus
*
* @return \Traversable|array
*/
public function getListenerList();
}
|
Java | UTF-8 | 234 | 1.914063 | 2 | [] | no_license | //package frc.team852.lib.callbacks;
//
//import frc.team852.DeepSpaceRobot.GaffeTape;
//
//public abstract class GaffeListener extends GenericListener<GaffeTape> {
// public GaffeListener() {
// super(GaffeTape.class);
// }
//}
|
C++ | UTF-8 | 6,959 | 3.265625 | 3 | [] | no_license | #include "position.h"
#include <map>
#include <iostream>
using namespace std;
const std::map<Direction, Direction> OPPOSITE_DIRECTIONS =
{ { Direction::N, Direction::S }, { Direction::S, Direction::N },
{ Direction::W, Direction::E }, { Direction::E, Direction::W },
{ Direction::NW, Direction::SE }, {... |
C | UTF-8 | 729 | 2.75 | 3 | [] | no_license |
#ifndef SOFTWAREPROJECT2_OTHELLOLIB_H
#define SOFTWAREPROJECT2_OTHELLOLIB_H
#include <stdbool.h>
#define MAX_STR_LEN 20
typedef struct {
char colour; //'B' and 'W' for placing their tokens on board
char team[6]; //"Black" for player1 and "White" for player2
int score;
char name[MAX_STR_LEN+1];
}play... |
C++ | UTF-8 | 564 | 2.71875 | 3 | [] | no_license | /*
* Player.cpp
*
* Created on: Aug 29, 2016
* Author: lenz
*/
#include "Player.h"
#include "../Session.h"
using namespace std;
Player::Player(int i,Session* mySess) {
this->position = i;
this->mySession = mySess;
}
Player::Player() {
}
Player::~Player() {
// TODO Auto-generated destructor stub
}
voi... |
C# | UTF-8 | 1,146 | 2.625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EntitiesLib
{
public class Contact
{
private int id;
private int id_personne;
private Personne personne;
public Contact() { }
public Contact(in... |
JavaScript | UTF-8 | 4,010 | 3.078125 | 3 | [
"MIT"
] | permissive | function Index() {
'use strict';
this.invertedIndex = {};
this.createIndex = function(filepath) {
/*
createIndex method reads the contents of a file whose path is passed as an
argument in the method. The method returns a promise.
*/
return fetch(filepath).then(function(response) {
return respons... |
Python | UTF-8 | 684 | 4.9375 | 5 | [] | no_license | # Write a function which takes a list as an input from the user [using the input()
# command] and returns the highest and the second highest elements of a list.
# Ex:
# Input 1:
# 1 2 3 4
# Output 1:
# 3 4
# Input 2:
# 1 2 3 8 7
# Output 2:
# 7 8
def list_pro():
a = input("Enter the list as space separated numbers... |
Markdown | UTF-8 | 681 | 2.578125 | 3 | [] | no_license | # Installation of Backend Instructions
## Notes
Please note that this is subject to change, as we may need more stuff to be installed on the backend later
## Instructions
1. Navigate to the Backend folder
2. run npm install babel-cli@6.26.0
3. run npm install babel-preset-env@1.7.0
4. run npm install babel-watch@2.... |
Java | UTF-8 | 2,357 | 2.265625 | 2 | [] | no_license | package com.couchbase.day.web;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.sprin... |
Python | UTF-8 | 167 | 3.53125 | 4 | [] | no_license | srtroka = input('Введите предложение\n')
itog = ''
for s in srtroka:
if s == 'о':
itog += "а"
else:
itog += s
print(itog)
|
C++ | UTF-8 | 311 | 3.03125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int powerK(int n, int k){
if(k == 1) return n;
int num;
if(k%2 ==0){
num = powerK(n, k/2);
}
else{
num = powerK(n. k/1)
}
return num*num;
}
int main(){
int n; cin >> n;
int k; cin>>k;
cout << powerK(n, k);
} |
Java | UTF-8 | 831 | 2.09375 | 2 | [] | no_license | package com.android.project.view.wall.di;
import com.android.project.api.RequestService;
import com.android.project.database.DatabaseManager;
import com.android.project.view.wall.WallPresenter;
import com.android.project.view.wall.WallPresenterImpl;
import dagger.Module;
import dagger.Provides;
/**
* Created by Lob... |
JavaScript | UTF-8 | 1,036 | 2.8125 | 3 | [] | no_license | import React from "react";
import "./App.css";
import { CardList } from "./components/card-list/card-list.componenets";
import { SearchBox } from "./components/search-box/search-box.component";
class App extends React.Component {
constructor() {
super();
this.state = {
locals: [],
searchField: "... |
TypeScript | UTF-8 | 1,120 | 3.234375 | 3 | [
"MIT"
] | permissive | import { Atributo } from "./Atributo";
export enum Etiqueta {
UNICA,
DOBLE,
HEADER
}
export class Objeto {
identificador: string;
texto: string;
listaAtributos: Array<Atributo>;
listaObjetos: Array<Objeto>;
linea: number;
columna: number;
etiqueta: Etiqueta;
textWithoutSpe... |
Python | UTF-8 | 1,172 | 3.125 | 3 | [] | no_license | import pygame
class Settings():
"""A class to store all settings for alien invasion."""
def __init__(self):
"""Initialize the game's settings"""
self.screen_width = 1200
self.screen_height = 800
self.image = pygame.image.load('images/night.jpg')
self.alien_image = pygam... |
Java | UTF-8 | 271 | 2.21875 | 2 | [] | no_license | package com.src;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
class AccountTest2 {
@Test
void testwithdraw() {
Account a=new Account("hello",456789123,5000);
boolean b=a.withdraw(2000, 100);
assertEquals(b,true);
}
}
|
C# | UTF-8 | 3,352 | 2.625 | 3 | [] | no_license | using HRMserver.Model;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
using System.Data;
using System.ComponentModel;
using System.Drawing;
namespace HRMserver.DAL
{
public class Dictionar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.