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 | WINDOWS-1252 | 7,994 | 2.6875 | 3 | [] | no_license |
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import javax.swing.JFileChooser;
import java.io.FileReader;
import java.util.Iterator;
import java.util.Scanner;
public class GraphicUserInterface extends javax.swing.JFrame {
String path;
private javax... |
Java | UTF-8 | 1,216 | 2.796875 | 3 | [] | no_license | package com.zl.concurrency.example.concurrent;
import com.zl.concurrency.example.temp.AbstractCountDownLunchTemp;
import lombok.extern.slf4j.Slf4j;
import java.util.Set;
import java.util.concurrent.ConcurrentSkipListSet;
import java.util.concurrent.CopyOnWriteArraySet;
/**
* ConcurrentSkipListSet验证--->是Tr... |
Python | UTF-8 | 1,592 | 3.109375 | 3 | [] | no_license | import pygame
import pygame.freetype as freetype
import numpy as np
from pygame import Color
from pygame.locals import *
from game import Game, GameObject
class Body(GameObject):
TRACE_PRECISION=2**2 # Minimal distance of two trace points squared
def __init__(self, game, name, mass, position, speed, radius, ... |
Java | UTF-8 | 1,372 | 3.203125 | 3 | [] | no_license | package com.test01;
import java.util.*;
public class TestService {
TestDAO dao = new TestDAO();
//출력 액션 메소드
public void list() {
List<Test>temp = dao.list();
StringBuilder sb = new StringBuilder();
for(Test t : temp) {
sb.append(String.format("%s%n", t.toString()));
}
sb.insert(0, St... |
PHP | UTF-8 | 604 | 2.796875 | 3 | [] | no_license | <?php
/**
* This is a generated class based on the schema.org type catalog.
*
* @license MIT
*/
declare(strict_types=1);
namespace EFrane\SchemaObjects;
/**
* The legal availability status of a medical drug.
*/
class DrugLegalStatus extends MedicalIntangible
{
/**
* The location in which the status a... |
Java | UTF-8 | 2,923 | 2.09375 | 2 | [] | no_license | /*******************************************************************************
* Copyright (c) 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is a... |
Python | UTF-8 | 1,550 | 2.53125 | 3 | [] | no_license | import threading
import cv2
import numpy as np
import tensorflow as tf
from skimage.feature import hog
from torch.autograd import Variable
from torchvision.transforms import transforms
def predict_using_cnn(img, classifier):
test_input = tf.estimator.inputs.numpy_input_fn(
x={"x": img},
num_epoch... |
Java | UTF-8 | 3,025 | 2.359375 | 2 | [] | no_license | package com.lan.bjgh;
import com.arronlong.httpclientutil.HttpClientUtil;
import com.arronlong.httpclientutil.common.HttpConfig;
import com.arronlong.httpclientutil.exception.HttpProcessException;
import com.fasterxml.jackson.databind.ObjectMapper;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf... |
C++ | UTF-8 | 725 | 2.625 | 3 | [] | no_license | // Bai029.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <conio.h>
#include <stdio.h>
#include <math.h>
#include <iostream>
using namespace std;
void main()
{
float a,b,c;
cout<<"Nhap a:"<<endl;
cin>>a;
cout<<"Nhap b:"<<endl;
cin>>b;
cout<<"Nhap c:"<<endl;
cin>... |
Markdown | UTF-8 | 4,005 | 3.578125 | 4 | [] | no_license | ---
title: jQuery、HTML、CSS中的小细节汇总(一)
tags:
- jQuery
- CSS
categories: 前端开发
index_img: /img/css.jpg
date: 2020-04-15 22:33:57
---
这个博客其中一个目的,是一边开发前端页面,一边记录下自己遇到的问题,很多是非常有tricks的,之后也可能会频繁用到。
下边主要总结的是 jQuery 和 CSS 中的一些小细节,之后如果积累了更多的点,再补充第二篇。
<!-- more -->
<br>
# HTML 中获取 `<span>` 标签内的值 - jQuery
在 jQuery 中,获取 HT... |
Java | UTF-8 | 1,629 | 2.75 | 3 | [] | no_license | package angry1980.audio.dao;
import angry1980.audio.model.TrackHash;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.stream.Collectors;
public class TrackHashDAOInMemoryImpl implements Tra... |
Markdown | UTF-8 | 1,509 | 2.890625 | 3 | [] | no_license | ---
id: 463
title: Puppet filebucketing fail with NFS
date: 2012-09-27T14:09:28+00:00
author: Andy Botting
layout: post
permalink: /puppet-filebucketing-fail-with-nfs
aktt_notify_twitter:
- 'no'
categories:
- Personal
---
I’ve got back to Australia and I’m continuing my UK job from home.
So yesterday, ... |
PHP | UTF-8 | 1,840 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
/*******************************************************************************
*
* CrystalPHP Framework by Crystal Collective
* An open source application development framework for PHP
*
* This file is part of CrystalPHP which is released under the MIT License (MIT)
*
* Copyright (c) 2019 - 2019,... |
JavaScript | UTF-8 | 936 | 2.84375 | 3 | [] | no_license | // Create section.container
document.write('<section class="container">');
for(let i=1; i<=30; i++){
var id = String(i);
document.write('<div class="box unlocked" id="_' + id + '"><i class="fa fa-unlock-alt" onclick=lock("_' + id + '");></i><p onclick=copy(' + id + ');></p></div>');
}
docu... |
Java | UTF-8 | 431 | 1.890625 | 2 | [] | no_license | package zalex.person.com.frameworklib.location;
import android.content.Context;
import com.baidu.location.BDAbstractLocationListener;
/**
* Created by zhouweinan on 2018/5/2.
*/
public abstract class LocationInterface extends BDAbstractLocationListener {
public abstract void init(Context context);
publi... |
PHP | UTF-8 | 2,405 | 2.953125 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of the sfMediaBrowser package.
*
* (c) 2010 Vincent Agnano <vincent.agnano@particul.es>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* sfValidatorMediaBrowser validates a directory.
*
* @pac... |
C++ | UTF-8 | 3,384 | 3.15625 | 3 | [] | no_license | #include "matrix.h"
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <thread>
void MatrixProduct(const MyMatrix& matrix_a, const MyMatrix& matrix_b, MyMatrix *matrix_result, const int& start, const int& end);
int main(int argc, char* argv[]){
clock_t start, end;
double resu... |
Markdown | UTF-8 | 1,181 | 3.53125 | 4 | [
"MIT"
] | permissive | ---
categories:
- Java
- Beginning
date: 2019-04-20 16:37:53
tag: Java
title: Java-条件
---
# Java 条件语句
## if-else 语句
Java 的 `if` 条件语句和 C 完全一致。
```java
if (expression_0) {
// statements
} else if (expression_1) {
// statements
} else {
// statements
}
```
~~无需解释~~
## switch-case 语句
```java
switch(expre... |
PHP | UTF-8 | 4,631 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\TraitClass;
use Illuminate\Http\Request;
trait GetListTrait
{
public $rq;
public $isGetListData;
/**
* 列表数据
* limit 分页数
* @param Request $request
* @return array|\Illuminate\Http\JsonResponse|string
*/
public function getList(Request $request)
{
... |
Python | UTF-8 | 3,216 | 2.90625 | 3 | [] | no_license | '''
The lepspho (LEPS plus harmonic oscillator) potential module plus two Gaussians.
'''
import numpy
import lepspho_
class lepspho:
'''
The lepspho (LEPS plus harmonic oscillator) potential class.
'''
def __init__(self):
'''
Initialize the lepspho (LEPS plus harmonic oscilla... |
C++ | UTF-8 | 822 | 2.671875 | 3 | [] | no_license | #pragma once
#include "Engine\Math\IntVector2.hpp"
#include "Engine\Core\Rgba.hpp"
#include "Engine\Math\Matrix4.hpp"
#include "Engine\Renderer\RHI\SpriteSheet2D.hpp"
//Forward Declares
class Character;
//Enums
enum StatusEffectType
{
STATUS_WALL = 0,
STATUS_CHARM,
STATUS_CONFUSE,
STATUS_POISON,
NUM_STATUS_EFF... |
Markdown | UTF-8 | 2,944 | 3.03125 | 3 | [
"Apache-2.0"
] | permissive | # ZenSwitch GPIO
## Overview
Mongoose OS library for GPIO-enabled ZenSwitches.
## GET STARTED
Build up your own device in few minutes just starting from one of the following samples.
|Sample|Notes|
|--|--|
|[zswitch-gpio-demo](https://github.com/zendiy-mgos/zswitch-gpio-demo)|Mongoose OS demo firmware for using GPIO-e... |
Markdown | UTF-8 | 1,261 | 2.859375 | 3 | [
"MIT"
] | permissive | ## British Columbia: Who should I contact if I think I have COVID-19?
If you have traveled to an affected area or develop symptoms, avoid contact with others and call ahead to a health-care professional. Do the same if you develop symptoms and have been in contact with a confirmed case or a traveller returning from th... |
Python | UTF-8 | 154 | 3.796875 | 4 | [] | no_license | #using the input function
name=input("Enter your name:")
regno=int(input("Enter your regno:"))
print("My name is ",name)
print("My regno is ",regno) |
Java | UTF-8 | 1,163 | 2.34375 | 2 | [] | no_license | package com.shaw.blog.model;
import com.shaw.blog.core.BaseEntity;
import javax.persistence.*;
@Table(name = "article_sort")
public class ArticleSort extends BaseEntity {
/**
* 文章类别自增ID
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
*... |
C# | UTF-8 | 2,805 | 2.59375 | 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;
using System.Net;
using System.IO;
using System.Web;
using System.Net.Http;
using System.Net.Http.Headers... |
Java | ISO-8859-1 | 3,806 | 3.34375 | 3 | [] | no_license | package id3;
import java.util.HashMap;
import java.util.LinkedList;
public class ExampleSet {
LinkedList<Example> l;
HashMap<Category,LinkedList<Example>> hm;
int size;
/*
* Le constructeur standard
*/
public ExampleSet(LinkedList<Example> l) {
this.l = new LinkedList<Example>(l);
... |
JavaScript | UTF-8 | 4,407 | 3.15625 | 3 | [] | no_license | (function(){
var canvas,
ctx,
map,
tileWidth = 48,
tileHeight = 48,
player,
lastRenderTime,
currentKey,
createCanvas = function()
{
canvas = document.createElement( 'CANVAS' );
screen.container.appendChild( canvas );
canvas.width = map.width * tileWidth;
canvas.height = map.height * ... |
Markdown | UTF-8 | 1,469 | 2.9375 | 3 | [
"MIT"
] | permissive | # ExcelImporter
The purpose of the ExcelImporter is to speed development of etl tasks where an Excel spreadsheet file is the data source. By passing the Importer class a path and file name and an ImportDefinition class, the Importer will return an ImportResult object. This object will contain a collection of ImportedRo... |
C# | UTF-8 | 3,724 | 3.3125 | 3 | [] | no_license | using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NewtonsoftJsonSample
{
class Program
{
static void Main(string[] args)
{
serializeJson();
deserialize();
Cons... |
Python | UTF-8 | 23,102 | 2.796875 | 3 | [] | no_license | ## @package maker_bus
#
# MakerBus serial communication package
#
# This package provides the software needed to send and receive
# MakerBus protocol packets.
from serial import *
import sys
import glob
import time
## @class Maker_Bus_Base
#
# Provide the shared interface to the MakerBus.
#
# *Maker_Bus_Base* provide... |
TypeScript | UTF-8 | 3,419 | 3.65625 | 4 | [
"MIT"
] | permissive | import { ComparableData } from '../interfaces/comparable-data-type';
import { valuesComparer } from '../_internals/valuesComparer.util';
/**
* @description
* Updates one or multiple items in an array T[].
* For comparison you can provide key, array of keys or a custom comparison function that should return true if ... |
Shell | UTF-8 | 4,159 | 3.0625 | 3 | [] | no_license | # Copyright (c) 2018 Serge Guex
# Distributable under the terms of The New BSD License
# that can be found in the LICENSE file.
BLACK=$(tput setaf 0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
LIME_YELLOW=$(tput setaf 190)
POWDER_BLUE=$(tput setaf 153)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5... |
PHP | UTF-8 | 657 | 3.046875 | 3 | [] | no_license | <?php
namespace libKML;
/**
* Location class
*/
require_once("KMLObject.php");
class Location extends KMLObject {
private $longitude;
private $latitude;
private $altitude;
public function setLongitude($longitude) {
$this->longitude = $longitude;
}
public function getLongitude() {
retu... |
SQL | UTF-8 | 765 | 4.125 | 4 | [] | no_license | create table ACCOUNT (
ACCOUNT_ID bigint IDENTITY not null,
CREATE_TIME TIMESTAMP DEFAULT NOW(),
BALANCE DECIMAL(16,2),
primary key (ACCOUNT_ID)
);
create table PAYMENT (
PAYMENT_ID bigint IDENTITY not null,
CREATE_TIME TIMESTAMP DEFAULT NOW(),
AMOUNT DECIMAL(16,2),
LEFT_ACCOUNT_ID bigint not null,
R... |
Python | UTF-8 | 1,698 | 3.015625 | 3 | [] | no_license | # predict.py ini adalah uji coba model dalam menprediksi aktivitas pada video
import cv2
import numpy as np
from keras.models import load_model
scenario = 1 # 1 (3D-CNN) / 2 (C-RNN) / 3 (Pose-RNN)
frame_sequences = 20
actions = ['walking', 'handwaving', 'boxing']
# membuka data video
cap = cv2.VideoCapture('dataset/... |
Markdown | UTF-8 | 2,120 | 3.4375 | 3 | [] | no_license | # quickCourse_Blockchain
Skills improvement course given by [SENAI](https://portalead.sp.senai.br/).
In this 20h course, you will know what Blockchain is, how it works and the possibilities that this technology brings to the business world.
You will see:
1. What is Blockchain.
2. What are cryptocurrencies.
3. The c... |
Java | UTF-8 | 6,780 | 2.515625 | 3 | [] | no_license | package com.finra.finraAssessment;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.*;
import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactor... |
C++ | UTF-8 | 634 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | #ifndef __INC_LEDBOW_DISPLAYMODEISR_H
#define __INC_LEDBOW_DISPLAYMODEISR_H
class DisplayModeIsr {
public:
DisplayModeIsr() {
interrupted = false;
lastInterruptTime = 0;
mode = 0;
}
void onInterrupt(unsigned long interruptTime) {
if (interruptTime - lastInterruptTime > 200) {
lastInterrupt... |
Go | UTF-8 | 2,052 | 2.921875 | 3 | [] | no_license | package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"log"
"os"
"github.com/google/go-github/v33/github"
"golang.org/x/oauth2"
)
var (
githubToken = flag.String("token", "", "GitHub API token.")
)
func main() {
flag.Parse()
if *githubToken == "" {
log.Fatal("Missing GitHub API token")
}
ctx... |
Java | UTF-8 | 700 | 2.109375 | 2 | [] | no_license | package com.example.tvshowapp.viewmodels;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModel;
import com.example.tvshowapp.repositories.MostPopularTVShowsRepositories;
import com.example.tvshowapp.responses.TVShowsResponse;
//вывод программ
public class MostPopularTVShowsViewModel extends ViewMo... |
Python | UTF-8 | 2,464 | 2.796875 | 3 | [] | no_license | import gym
import tensorflow as tf
import re
import numpy as np
from skimage.color import rgb2gray
from skimage.transform import resize
from collections import Counter, deque
from constants import FRAME_WIDTH_SIZE
from constants import FRAME_HEIGHT_SIZE
class GameWrapper:
def __init__(self, game):
self.e... |
Java | UTF-8 | 1,467 | 2.78125 | 3 | [
"MIT"
] | permissive | package com.example.lifecycle;
import java.util.logging.Logger;
import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;
import org.apache.catalina.core.StandardContext;
/**
* A broken listener that makes a context failed during its start event. U... |
Java | UTF-8 | 14,264 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | package com.artechra.jcacalculator.impl;
import com.artechra.jcacalculator.*;
import javax.resource.spi.work.Work;
import javax.resource.spi.work.WorkException;
import javax.resource.spi.work.WorkEvent;
import javax.resource.spi.*;
import javax.resource.ResourceException;
import javax.security.auth.Subject;
import ja... |
Markdown | UTF-8 | 4,865 | 2.796875 | 3 | [] | no_license | ## Aktueller Stand 2016-04-26 ##
Hier ein kurzer Überblick über den aktuellen Stand des Fräsenprojektes.
### Überblick über die Maschine ###
Bei der Maschine handelt es sich um eine umgebaute Drehbank. Der Werkzeugschlitten wurde mit zwei Servo-Motoren versehen (X-Achse für Bewegungen normal zur Spindelachse - Z-Ach... |
Java | UTF-8 | 1,111 | 2.265625 | 2 | [] | no_license | package bootcamp;
import bootcamp.api.v1.model.ArtistDTO;
import bootcamp.api.v1.model.ArtistListDTO;
import bootcamp.api.v1.model.SongDTO;
import bootcamp.api.v1.model.SongListDTO;
import bootcamp.services.SongService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import ... |
Markdown | UTF-8 | 965 | 3.046875 | 3 | [] | no_license | ### Background
One of the most controversial issues in the U.S. educational system is the efficacy of standardized tests, and whether they're unfair to certain groups. Given our prior knowledge of this topic, investigating the correlations between SAT scores and demographics might be an interesting angle to take. We co... |
Java | UTF-8 | 617 | 1.921875 | 2 | [] | no_license | package service;
import javafx.collections.ObservableList;
import model.Notification;
import model.Product;
import util.Constants;
import util.DBConnection;
import util.QueryUtil;
/**
* @author Fernando G.U.S
* @author IT18027884
* <p>
* This is ProductManagerService
* @see DBConnection
* @see QueryUtil
* @see... |
JavaScript | UTF-8 | 1,806 | 2.703125 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import { useParams } from "react-router";
import { Link } from "react-router-dom";
import { createCard, readDeck } from "../../utils/api";
import { CardForm } from "./CardForm";
export function NewCard() {
//set up hooks
const { deckId } = useParams();
//create... |
Java | UTF-8 | 1,084 | 3.03125 | 3 | [
"MIT"
] | permissive | package com.github.sangalaa.facerecognitionapp;
/**
* {@link FaceData} represents a single face.
* Each FaceData object has
*/
public class FaceData {
private double height;
private double width;
private double left;
private double top;
private String gender;
private long minAge;
... |
TypeScript | UTF-8 | 858 | 3.484375 | 3 | [] | no_license | interface Heroe {
nombre: string;
poder?: string;
arma?: string;
}
let superman: Heroe = {
nombre: 'Super man',
poder: 'Super fuerza'
}
let ironman: Heroe = {
nombre: "Iron man"
poder: "Mark One"
}
let thor: Heroe = {
nombre: 'Thor'
poder: 'Rayo'
arma: 'Mart... |
C++ | UTF-8 | 2,538 | 3.015625 | 3 | [] | no_license | // *** command: g++ -fopenmp -o 2.out -std=c++11 2.cpp
#include <iostream>
#include "omp.h"
#include <ctime>
#include <cstdlib>
#include <string>
#include <iomanip>
#include <chrono>
using namespace std;
// ** Const **
const unsigned int matrixN = 500;
const unsigned int threadsN = 8;
void printMatrix(double** Mat) {... |
Markdown | UTF-8 | 9,767 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | # Create an Arch Linux utility machine
NOTE: this document is not applicable to the current setup. We are not using Arch Linux.
We are keeping this document here because it's a nice guide to setting up Arch Linux in general.
## Acquire a machine
It should:
* be capable of running on its own without a keyboard/mous... |
Python | UTF-8 | 374 | 2.90625 | 3 | [
"MIT"
] | permissive | class Solution:
def reverse(self, x: int) -> int:
result = 0
num = abs(x)
while num != 0:
result = (result*10) + (num%10)
num //= 10
if x<0 and (result*-1 > -1*(2**31)):
return -1*result
if x>0 and result < (2**31 - 1):
... |
Java | UTF-8 | 1,822 | 3.53125 | 4 | [] | no_license | public class LRUCache {
class DLinkedNode {
int key; // This is required while addding new element when the cache is full
int value; // Storing the actual value
DLinkedNode prev, next;
}
DLinkedNode head;
DLinkedNode tail;
private void addNodeAthead(DLinkedNode node) {
node.prev = head;
node.next... |
Python | UTF-8 | 3,682 | 2.671875 | 3 | [] | no_license | import numpy as np
import math
import cv2
import os
#Overlay_Tester.py
#Test code for image placement, will place features and save them as an image
#
#
#
#
#
#
def malt_overlay_path(multiplier, x_pos_mult, y_pos_mult, image_1, str_foreground, count):
print(count)
image_3 = cv2.imread(str_foreground, cv2.IMR... |
C++ | ISO-8859-1 | 3,178 | 3.375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <ctime>
using namespace std;
int main(int argc, char* args[]) // funo principal do seu programa
{
bool sair = false; // usando o lao para sair
string jog1, jog2; // salvando o nome dos jogadores
int vida1 = 20, vida2 = 20; // quantidade de vida do jogador no inicio
... |
PHP | UTF-8 | 1,210 | 2.5625 | 3 | [] | no_license | <?php
class TeacherController extends Controller
{
public function actionIndex()
{
$models=Teacher::model()->findAll();
$this->render('index',array('models'=>$models));
}
public function actionView($id)
{
$model=Teacher::model()->findByPk($id);
$id_p = null;
$teacher = null;
... |
C# | UTF-8 | 1,859 | 2.65625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
namespace SpaceProject
{
public class AutoSaveHandler
{
private readonly string AutoSaveMessage = "The game has been saved.";
private rea... |
Ruby | UTF-8 | 1,227 | 3.515625 | 4 | [
"MIT"
] | permissive | class Anagram
def initialize(word_one, word_two)
@word_one = word_one
@word_two = word_two
@word_one = @word_one.gsub(/[\s[:punct:]]/, '').downcase.split('').sort
@word_two = @word_two.gsub(/[\s[:punct:]]/, '').downcase.split('').sort
@return_statement = ""
def anagram_finder
if @word_... |
Java | UTF-8 | 1,284 | 1.640625 | 2 | [] | no_license | package kotlin.reflect.jvm.internal.impl.resolve.constants;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import kotlin.reflect.jvm.internal.impl.builtins.g;
import kotlin.reflect.jvm.internal.impl.descriptors.ao;
import kotlin.reflect.jvm.internal.impl.descriptors.f;
import kotlin.re... |
C# | UTF-8 | 2,514 | 3.328125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace Exercise
{
class Program
{
static void Main(string[] args)
{
List<string> inputs = new List<string>();
List<string> messages = new List<string>();
List<string> bro... |
Python | UTF-8 | 2,953 | 2.9375 | 3 | [] | no_license | filein = open('socdist1.in','r')
fileout = open('socdist1.out','w')
# scan input
text = filein.readlines()
N = int(text[0].strip())
del text[0]
# make list of stalls and breaks
text = text[0].strip()
stalls = []
num1s = 0
for i in range(N):
if int(text[i]):
stalls.append(1)
num1s += 1
else:
... |
TypeScript | UTF-8 | 2,077 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | // Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The SFC licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you m... |
Python | UTF-8 | 1,369 | 4.09375 | 4 | [] | no_license |
def max_list_iter(int_list): # must use iteration not recursion
"""finds the max of a list of numbers and returns the value (not the index)
If int_list is empty, returns None. If list is None, raises ValueError"""
if int_list == None:
raise ValueError("Must be list")
else:
if len(int_list) < 1... |
Python | UTF-8 | 2,652 | 3.75 | 4 | [] | no_license | # take a typical RXC maze wehre S is the start and E is the end
# rocks are indicated by #
# the objective is to find the shortest path between S and E.
graph = [
['S', '.', '.', '#', '.', '.', '.'],
['.', '#', '.', '.', '.', '#', '.'],
['.', '#', '.', '.', '.', '.', '.'],
['.', '.', '#', '#', '.', '.',... |
PHP | UTF-8 | 3,090 | 3 | 3 | [] | no_license | <?php
$method = $_SERVER['REQUEST_METHOD'];
if ($method == 'GET') {
// Handle GET request
if ($_GET['load']) { // If I set load to false, this won't execute
$jsonData = file_get_contents('../orders.json');
echo $jsonData;
}
}
if ($method == 'POST')... |
PHP | UTF-8 | 1,007 | 3.046875 | 3 | [
"MIT"
] | permissive | <?php
namespace Tests\Unit;
use App\Rules\AgeCalculator;
use PHPUnit\Framework\TestCase;
class ValidationTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function test_example()
{
$this->assertTrue(true);
}
public function test_CalculateA... |
Java | ISO-8859-1 | 735 | 3.1875 | 3 | [] | no_license | /*4 - Escreva um programa que informe se existe estoque para atender um pedido
feito a uma fbrica. O programa dever receber como entradas o nmero de itens
em estoque e o nmero de itens a serem fornecidos, e dar como sada o estoque
atualizado (itens em estoque menos itens a ser fornecidos) ou uma mensagem
indicando ... |
Python | UTF-8 | 942 | 3.234375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 17 09:32:00 2015
@author: Keith J. Wojciechowski (KJW)
"""
from pylab import *
font = {'family' : 'serif',
'weight' : 'normal',
'size' : 16}
# Interval width, h = (b-a)/(n-1), given this grid spacing:
# x[0] = -4, x[100] = -3, x[200] = -2, ..., x[700] =... |
Java | UTF-8 | 2,327 | 2.1875 | 2 | [] | no_license | package com.example.laundryapp;
import androidx.appcompat.app.AppCompatActivity;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import androi... |
C++ | UTF-8 | 2,712 | 3.53125 | 4 | [] | no_license | #include <iostream>
using namespace std;
/**
* 并查集:是一种维护集合的数据结构
* 他的名字中并、查、集分别是合并、查找、集合这3个单词,并查集的实现使用一个数组即可:
* int fath[N], father[i]表示元素i的父节点
* father[1] = 1:1的父节点是1
* father[2] = 3:2的父节点是3
* father[3] = 1;3的父节点是1
* 说明1和3的父节点是相同的,在一个集合中。
* 初始化:
* for(int i=0;i<n;i++)
* {
* father[i... |
TypeScript | UTF-8 | 652 | 2.59375 | 3 | [] | no_license | import { Application, Router } from 'https://deno.land/x/oak/mod.ts';
let idSet: Array<number> = [];
for (let i = 0; i < 100; i++) {
idSet.push(i);
}
const router = new Router();
router.get('/', ctx => {
ctx.response.body = 'Hello World!';
}).get('/ids', ctx => {
ctx.response.body = idSet;
}).get('/ids/:id', ctx =... |
C# | UTF-8 | 2,348 | 2.515625 | 3 | [
"MIT"
] | permissive | using System.Collections.Generic;
using System.Linq;
using Inshapardaz.Desktop.Api.Model;
using Inshapardaz.Desktop.Common.Models;
namespace Inshapardaz.Desktop.Api.Renderers
{
public interface IRenderWordPage
{
PageView<WordView> Render(PageRendererArgs<WordModel> source);
}
public class Pag... |
SQL | UTF-8 | 5,495 | 3.359375 | 3 | [] | no_license | create database dynasty;
use dynasty;
drop table manager;
create table manager(
`id` bigint(11) auto_increment,
`name` VARCHAR(128) NOT NULL,
PRIMARY KEY(`id`)
);
alter table manager
add column email varchar(128) NOT NULL;
truncate manager;
insert ignore into `manager` VALUES
(1, "Mark", ""),
(2, "Matty", ""),
(... |
Java | UTF-8 | 891 | 3.609375 | 4 | [] | no_license | package LinkedList;
import LinkedList.HasCycle_E.ListNode;
public class Insert_E {
class ListNode {
public int value;
public ListNode next;
public ListNode(int value) {
this.value = value;
next = null;
}
}
public ListNode insert(ListNode head, int value) {
// Write your solution here
ListNode ... |
C | UTF-8 | 2,180 | 2.765625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* utils.c :+: :+: :+: ... |
Python | UTF-8 | 3,555 | 3.09375 | 3 | [] | no_license | # file to run the simulation multiple times
# a file name containg a bunch of configurations is expected as a command line argument
# this file should be of the form
# header line: max_iter,state,log,graphics,initial_state,pos_stdv,ang_stdv,num_agents,alpha,perceived_weight,threshold,velocity
# <config 1>
# <config 2>
... |
Ruby | UTF-8 | 1,410 | 4.875 | 5 | [] | no_license | #Mammal > Cat (everything mammal has cat also has)
#Mammal > Dog > Beagle >...
#Dog and Cat are siblings, inheriting from Mammal but different
#Beagle is a grandchild of mammal, it inherits from mammal and dog
#parent can also be called ROOT
class Mammal
#with attr_accessor able to read and write ie. see the nam... |
Python | UTF-8 | 884 | 3.0625 | 3 | [] | no_license | import sys
sys.stdin = open('input.txt', 'r')
def DFS(v, visited):
stack = []
stack.append(v)
while stack:
v = stack.pop()
if not visited[v]:
visited[v] = 1
print(v, end=' ')
for w in edges[v]:
if not visited[w]:
stac... |
Markdown | UTF-8 | 3,628 | 3.140625 | 3 | [] | no_license | ---
layout: php
breadcrumb:
- "basic"
- "code"
- "semicolon"
---
# 세미콜론(;)
---
PHP는 `C언어`나 `자바`처럼 프로그래밍 언어 중에서도 `고급 언어`에 속합니다.
<br>
## 고급언어
---
고급 언어란 컴퓨터가 이해하는 기계어 나 어셈블리어처럼 마이크로프로세서 중심의 언어로 작성되는 것이 아닌, 사람이 일반적인 언어처럼 쉽게 문장을 이해할 수 있는 형태의 언어 구조를 말합니다. 대표적인 고급 언어로는 C 언어, 베이직, PHP, 자바 등이 이에 속합니다.
<br>
## 명령어의 구분... |
TypeScript | UTF-8 | 1,025 | 2.828125 | 3 | [] | no_license | import { Reducer } from 'redux'
import { ActionsTypes as ProfileActionsTypes} from './profileActions'
import { ActionsTypes as AuthActionsTypes } from '../../auth/authActions'
export interface ProfileState {
messageEdit: {
threadId: string,
messageId: string
} | null,
}
export const getInitialState = () ... |
Java | UTF-8 | 2,680 | 2.671875 | 3 | [
"MIT"
] | permissive | package gaarason.database.contract.model;
import gaarason.database.contract.eloquent.Record;
/**
* 事件
* 查询 : retrieving -> retrieved
* 新增 : saving -> creating -> created -> saved
* 更新 : saving -> updating -> updated -> saved
* 删除 : deleting -> deleted
* 恢复 : restoring -> restored
* <p>
* 其中以 record 为参数的事件, 仅在... |
PHP | UTF-8 | 1,143 | 2.9375 | 3 | [] | no_license | <?php
namespace App;
require __DIR__ . '/vendor/autoload.php';
use src\{
Validate,
Search,
TreatApiReturn
};
class App
{
private $verifyPost;
public $result;
public function __construct(){
$this->verifyPost = isset($_POST['action']) AND !empty($_... |
TypeScript | UTF-8 | 6,023 | 3.453125 | 3 | [
"MIT"
] | permissive | enum BlockPhraseType
{
CONTAIN = 0, EXACTWORD, WORDCONTAINING, REGEX
}
enum BlockPhraseScope
{
URL= 0, BODY, ANY
}
export interface PhraseFilter {
Scope : BlockPhraseScope,
Type : BlockPhraseType,
Phrase: string
}
let BlockedPhrases : Array<PhraseFilter> = [];
export function setBlockedPhrases(p... |
Java | UTF-8 | 1,314 | 2.875 | 3 | [] | no_license | package com.tieto.training;
import com.tieto.training.person.Person;
import com.tieto.training.person.PersonComparatorNameOnly;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import static com.tiet... |
Java | UTF-8 | 1,832 | 2.59375 | 3 | [] | no_license | package uk.ac.ucl.servlets;
import uk.ac.ucl.model.Model;
import uk.ac.ucl.model.ModelFactory;
import uk.ac.ucl.model.dataframes.FrameException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.... |
Markdown | UTF-8 | 676 | 2.828125 | 3 | [] | no_license | **Classes**
- An abstract class Bee is added to be inherited by othery Bee type classes
- Chose abstract class instead of interface so that method implementations could be shared.
- Health property's set section is set as private so that it is not accessible from outside of the class and only be manipulated using Bee ... |
C# | UTF-8 | 939 | 3.171875 | 3 | [] | no_license | using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
namespace ObservableCollectionWithRange
{
partial class Program
{
public class ObservableCollectionWithRange<T> : ObservableCollection<T>
{
#region Constructors
... |
JavaScript | UTF-8 | 1,038 | 2.921875 | 3 | [] | no_license | export const initialState = {
active: [], completed: [], others: [],
currentNote: '', currentStatus: '', showList:false
}
const getObjWithId = (payload) => {
let obj = { ...payload, id: new Date().getTime() }
return obj;
}
export const NotesReducer = (state, action) => {
switch (action.type.toLowerCase()) {
case... |
C | UTF-8 | 10,270 | 2.59375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | /* vi:set ts=4 sw=4 expandtab:
*
* Copyright 2016, Chris Leishman (http://github.com/cleishm)
*
* 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/LI... |
Java | UTF-8 | 714 | 2.328125 | 2 | [
"MIT"
] | permissive |
package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
/**
*
* @author Loki
*/
public final class WanderingOnes extends CardImpl {
public WanderingOnes (UUID ownerId, CardSetI... |
Rust | UTF-8 | 1,634 | 2.5625 | 3 | [
"MIT"
] | permissive |
use {
anyhow::Result,
crate::{
app::{
NewCampaignCommand,
PackCampaignCommand,
},
persist::{
self,
Bag,
SerdeFormat,
},
},
};
mod campaign;
mod loaded_campaign;
pub use {
campaign::Campaign,
loaded_campaig... |
Markdown | UTF-8 | 2,121 | 2.9375 | 3 | [] | no_license | +++
title = "Timelapse"
date = 2020-09-05T21:01:22-07:00
tags = ["programming", "time", "video", "long-now", "diy"]
+++
I have a fascination with time. Two years ago, our family planted a tree in our back yard. A few months
prior, my dad and I built an overhang that provides shade.
{{<img "img/overhang.jpg">}}
I u... |
Java | UTF-8 | 58,932 | 2.359375 | 2 | [] | no_license |
package wordmatch;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JOptionPane;
/**
*
* @author Tasnim Akther, ID: 150103020027
* @author Monira Enam Heya, ID: 150103020045
* @author Md Mahadi Hasan Nahid, nahid@neub.edu.bd
*/
public class St... |
Python | UTF-8 | 239 | 2.5625 | 3 | [] | no_license | import numpy as np
import math
import sys
sys.setrecursionlimit(10000000)
def main():
K, X = map(int, input().split())
for i in range(X - K + 1, K + X):
print(i, end=" ")
print()
if __name__ == '__main__':
main() |
Python | UTF-8 | 1,072 | 2.6875 | 3 | [] | no_license | from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer,TfidfVectorizer
from sklearn.pipeline import Pipeline
from sklearn.linear_model import SGDClassifier
from sklearn.svm import LinearSVC
import re
import numpy as np
x_train=[]
y_train=[]
def words(t... |
Python | UTF-8 | 13,420 | 2.890625 | 3 | [] | no_license | import discord
from discord.ext import commands
from asyncio import sleep
import os
me = commands.Bot(command_prefix='.', self_bot=True)
@me.event
async def on_ready():
print("----------")
print("Logged in as:")
print(" "+str(me.user.name))
print(" "+str(me.user.id))
print... |
Python | UTF-8 | 1,515 | 3.9375 | 4 | [] | no_license | from collections import deque
def hanoi(piles):
deplacements = []
# (Notation sous pseudocode avec indices à partir de 1)
#
# Pré-condition: - les trois piles sont valides (c.-à-d. ordonnées)
# - |piles[src]| ≥ k
# - piles[src][1:k] est empilable par-dessus pil... |
Python | UTF-8 | 3,222 | 3.265625 | 3 | [] | no_license | import sys
import numpy as np
import seaborn as sns
import scipy.io as scyio
from functions import find_closest_centroid
from functions import compute_centroids
from functions import run_kmean_algo
from scipy.misc import imread
from numpy import double
from functions import kmeans_init_centroids
import matplo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.