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 |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 4,311 | 3.359375 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
from numpy import tan
from numpy import pi
class Drone :
def __init__(self):
self.launch()
def launch(self):
self.setHeight(1.5)
def setHeight(self, height):
self.height=height
def rotateSelf(self):
return True
def rot... |
SQL | UTF-8 | 4,994 | 3.328125 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 18-Nov-2020 às 18:18
-- Versão do servidor: 10.4.14-MariaDB
-- versão do PHP: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... |
C++ | UTF-8 | 1,490 | 3.328125 | 3 | [] | no_license | #include "LongestCommonPrefix.h"
inline int minStr(string &s1,string &s2)
{
return (s1.size() > s2.size()) ? s2.size() : s1.size();
};
string longestCommonPrefix(vector<string>& strs)
{
string theLongest="";
int longest=0;
vector<string>::iterator it_first;
vector<string>::iterator it_second;
int minStrSize;
t... |
Java | UTF-8 | 16,151 | 2.140625 | 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 login;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.Socket;
import java.util.logging.Level;
import ... |
Python | UTF-8 | 3,318 | 2.640625 | 3 | [] | no_license | __author__ = 'Zac, Shawyn Kane'
import Graphics, pygame, sys, GameState, Pieces, AI
from pygame.locals import *
pygame.init()
myDisplay = pygame.display.set_mode(Graphics.resolution, 0, 32)
gameState = GameState.GameState()
fpsClock = pygame.time.Clock()
while True:
if AI.is_checked(gameState):
gameSta... |
JavaScript | UTF-8 | 6,460 | 2.640625 | 3 | [] | no_license | const express = require( 'express' );
const bodyParser = require('body-parser');
const morgan = require('morgan');
const uuid = require('uuid');
const {Bookmarks} = require('./bookmarkModel');
const mongoose = require('mongoose');
const {DATABASE_URL, PORT} = require('./config');
const apiKEY = "2abbf7c3-245b-404f-947... |
SQL | UTF-8 | 511 | 3.46875 | 3 | [] | no_license |
-- +goose Up
ALTER TABLE entries
DROP COLUMN user_id;
CREATE TABLE journals (
id serial not null primary key,
user_id integer not null references users(id),
created date not null,
updated date not null,
name text not null
);
ALTER TABLE entries
ADD COLUMN journal_id integer not null references journals... |
Markdown | UTF-8 | 11,291 | 2.8125 | 3 | [] | no_license | ---
title: Handling JAX-RS and Bean Validation Errors with MVC
author: Michal Gajdoš
type: post
date: 2014-01-28T09:35:12+00:00
url: /handling-jax-rs-and-bean-validation-errors-with-mvc/
aliases: /2014/01/28/handling-jax-rs-and-bean-validation-errors-with-mvc/
categories:
- Jersey
tags:
- jax-rs
- jersey
- mvc
... |
Python | UTF-8 | 2,630 | 2.53125 | 3 | [] | no_license | # -*-coding:utf-8-*-
import pymysql
DB_CONFIG = {
'user': 'root',
'password': '',
'host': '127.0.0.1',
'charset': 'utf8mb4'
}
DB_NAME = 'joboffer'
CREATE_TABLE_JOB = """
CREATE TABLE IF NOT EXISTS `JOB`(
`ID` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`KEYWORD` VARCHAR(100... |
Markdown | UTF-8 | 978 | 3.046875 | 3 | [
"Apache-2.0"
] | permissive | # What are you building
This demo create a project into an organization.
# Steps to run
## Requirements
1. Terraform installed on your machine
2. a Service Account with `Resource Manager` > `Organization Viewer` and `Resource Manager` > `Project Creator` IAM rules on your organization
## Run it
Before starting,... |
Python | UTF-8 | 878 | 2.6875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri May 21 22:21:57 2021
@author: kunal
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.svm import SVC
import pickle
import json
def SVM(Symptom1, Symptom2, Symptom3, Symptom4, Symptom5... |
PHP | UTF-8 | 5,236 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | <?php
session_start();
$_SESSION['pays']['Cle']= array();
$_SESSION['pays']['Cle']['Code']=array();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="Style.css">
<link re... |
C# | UTF-8 | 2,481 | 3.515625 | 4 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BankingDatabase;
namespace UnitTests
{
//Excecutes Unit tests for the bankingDatabase VS Project.
class UnitTestExe
{
//The main/only method used for doing unit tes... |
PHP | UTF-8 | 1,035 | 3.21875 | 3 | [] | no_license | <?php
namespace App\Entity;
class Airport {
private $id;
private $code;
private $name;
/**
* Airport constructor.
* @param $id
* @param $code
* @param $name
*/
public function __construct($id, $code, $name) {
$this->id = $id;
$this->code = $code;
... |
C# | UTF-8 | 1,676 | 2.546875 | 3 | [
"MIT"
] | permissive | // Copyright (c) 2007-2018 Thong Nguyen (tumtumtum@gmail.com)
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace Shaolinq.Persistence.Linq.Expressions
{
/// <summary>
/// Represents an SQL function call such as DATE, YEAR, SUBSTRING or ISNULL.
/// </summary>
public... |
Java | UTF-8 | 530 | 2.671875 | 3 | [] | no_license | package business.validation;
import java.util.ArrayList;
import java.util.List;
public class BusinessValidationImpl implements BusinessInvalidation {
private List<BusinessRule> rules = new ArrayList<>();
public BusinessValidationImpl() {}
public BusinessValidationImpl(BusinessRule rule) {
withRule(rule);
}... |
Java | UTF-8 | 234 | 2.109375 | 2 | [] | no_license | package cn.edu.nju.software.game.fighting.model.role.equipment.exception;
public class FullEquipmentTypeException extends Exception {
public FullEquipmentTypeException() {
super("该装备类型的槽位已满");
}
}
|
JavaScript | UTF-8 | 2,600 | 2.875 | 3 | [] | no_license | 'use strict';
/*
Módosítsd a Storage nevű modul 3. feladatát úgy,
hogy amennyiben a kérés során bármilyen hiba van, szintén a localStorage-ból olvassa ki az adatokat a program!
Ilyenkor jeleníts meg egy üzenetet, hogy az alkalmazás offline!
Amennyiben a localStorage is üres, jelents meg egy szabadon választott hibaüz... |
Java | UTF-8 | 6,133 | 2.671875 | 3 | [] | no_license | package com.thenewprogramming.Bukkit.Vote4TempBan;
import java.util.ArrayList;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class Vote4TempBan extends JavaPlugin{
//begin defining variables (made like this so i... |
C++ | UTF-8 | 1,433 | 3.296875 | 3 | [] | no_license | #pragma once
#include <unordered_map>
#include <boost\thread.hpp>
class Dictionary {
private:
std::unordered_map<std::string, size_t> wordToIdMap_;
std::unordered_map<size_t, std::string> IdToWordMap_;
boost::shared_mutex mutex_;
size_t IdCounter_;
size_t getNewId() {
return IdCounter_++;
}... |
Java | UTF-8 | 314 | 2.5 | 2 | [] | no_license | package entity.gameboard;
import java.awt.Color;
public class Company extends Field {
public Company(String navn, String description, Color color, int price, int index, int pawnValue) {
super(navn, description, color, index);
this.isOwned = false;
this.price = price;
this.pawnValue = pawnValue;
}
}
|
Markdown | UTF-8 | 9,151 | 2.859375 | 3 | [] | no_license | + 默认全局配置文件
+ application.properties
```
server.port = 8888
```
+ 对于如果想要针对不同场景使用不同的properties文件(比如存在以下三个配置文件)
+ application.properties
+ application-dev.properties
+ application-prod.properties
```
如果进行配置,系统会默认选择第一个配置文件
如果想要指定第二... |
C | UTF-8 | 238 | 3.09375 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
struct s {
int a;
int b;
char *c;
};
int main()
{
struct s x={19,83,"Zhang"};
struct s *px=&x;
printf("%d,%d,%s,",px->a,(*px).b, px->c);
printf("%c,%s\n",*px->c-1, &px->c[1]);
return 0;
} |
Java | UTF-8 | 367 | 2.09375 | 2 | [] | no_license | package cn.zw.spring.aop.advice;
import java.lang.reflect.Method;
import org.springframework.aop.AfterReturningAdvice;
public class HiZwAfterMethod implements AfterReturningAdvice{
public void afterReturning(Object returnValue, Method method, Object[] arg2,
Object target) throws Throwable {
System.out.println... |
Markdown | UTF-8 | 2,828 | 3.515625 | 4 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | # Bar series
A bar chart shows price movements in the form of bars.
Vertical line length of a bar is limited by the highest and lowest price values.
Open & Close values are represented by tick marks, on the left & right hand side of the bar respectively.
{
if($id != ''){
$book = do_query_obj("SELECT * FROM chapters WHERE id=$id", LMS_Database);
if(isset($book->id)){
foreach($book as $key =>$value){
$this->$key = $value;
}
return $this;
} else {
return false;
... |
Python | UTF-8 | 3,624 | 2.5625 | 3 | [
"MIT"
] | permissive | import sys
import os
import shapefile
from shapely import geometry
#from shapely.geometry import shape
import pprint
pp = pprint.PrettyPrinter(indent = 4)
import zipfile
import tempfile
import shutil
class Chorpleth:
def __init__(self, the_type):
assert the_type in ['state', 'county']
if the_type ... |
Java | UTF-8 | 272 | 1.75 | 2 | [] | no_license | package lesson_1.homework_1;
import lombok.*;
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class Telefon {
private int id;
private String Brend;
private String Model;
private double DisplaySize;
private int MemorySize;
}
|
PHP | UTF-8 | 1,053 | 2.546875 | 3 | [] | no_license | <?php
namespace Paypal\Api;
include_once('AbstractRequestType.php');
class DoReauthorizationRequestType extends AbstractRequestType
{
/**
* @var string $AuthorizationID
* @access public
*/
public $AuthorizationID = null;
/**
* @var BasicAmountType $Amount
* @access public
... |
Swift | UTF-8 | 2,804 | 3.453125 | 3 | [] | no_license | //
// String+Extensions.swift
// Mestika Dashboard
//
// Created by Prima Jatnika on 26/10/20.
//
import Foundation
import UIKit
extension String {
var digits: [Int] {
var result = [Int]()
for char in self {
if let number = Int(String(char)) {
result.append(... |
Java | UTF-8 | 174 | 1.859375 | 2 | [
"MIT"
] | permissive | package org.home.polukeev.model;
import java.util.EventListener;
public interface ModelListener extends EventListener {
void modelChanged(ModelEvent event);
}
|
Python | UTF-8 | 90 | 2.640625 | 3 | [] | no_license | k = int(input())
s = [int(x) for x in list(str(k))]
S = sum(s)
print(S)
for k in K
|
C++ | UTF-8 | 1,741 | 2.875 | 3 | [
"MIT"
] | permissive | #ifndef CMAKE_CMAKEFUNCTION_H
#define CMAKE_CMAKEFUNCTION_H
#include <memory>
#include <string>
#include <vector>
namespace cmake {
struct FilePosition {
unsigned int line_;
unsigned int column_;
};
struct CmakeFunctionArgument {
CmakeFunctionArgument(std::string value);
CmakeFunctionArgument(std::string val... |
Python | UTF-8 | 2,231 | 2.9375 | 3 | [] | no_license | import pandas as pd
import logging
import requests
from flask import current_app
log = logging.getLogger('demo.covidapiclient')
# covid-api client
class CovidApiClient:
countries_df = None
# init method or constructor
def __init__(self, countries_df):
self.countries_df = countries_df
# G... |
Java | UTF-8 | 422 | 1.523438 | 2 | [] | no_license | package com.google.zxing.client.android;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
/**
* Created by xiong on 2018/2/1.
*/
public class aaa extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInsta... |
Java | UTF-8 | 1,928 | 2.234375 | 2 | [] | no_license | package com.mpa.leaderboard;
import android.os.Parcel;
import android.os.Parcelable;
import android.widget.ImageView;
import androidx.databinding.BindingAdapter;
import androidx.databinding.ObservableField;
import com.mpa.leaderboard.Leader;
import com.squareup.picasso.Picasso;
public class IqLeader ... |
SQL | GB18030 | 10,708 | 3.484375 | 3 | [] | no_license | CREATE OR REPLACE PROCEDURE P_TMP_CHEAT_USER_ALARM_D(V_DATE VARCHAR2,
V_RETCODE OUT VARCHAR2,
V_RETINFO OUT VARCHAR2) IS
/*****************************************************************
* --%NAME:P_TMP_CHE... |
Shell | UTF-8 | 1,091 | 3.03125 | 3 | [
"CC0-1.0"
] | permissive | GetIconDir() { echo './src/00_denv/01_md/00_icon'; }
GetIconPath() { echo "$(GetIconDir)/${1,,}.svg"; }
#https://github.com/ytyaru/Image.Icon.20191120145829/src/00_denv/01_md/00_icon
GetRootAbsDir() {
local dir="${1:-$(GetThisDir)}"
local name="$(basename $dir)"
local abs_parent="$(cd $(dirname $dir); pwd)"
[ '/' =... |
Python | UTF-8 | 349 | 3 | 3 | [] | no_license | class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
remain = {}
for i in range(len(nums)):
if nums[i] in remain:
# note that checking if nums[i] exists in key is O(1)
return [remain[nums[i]], i]
else:
re... |
Markdown | UTF-8 | 2,739 | 2.9375 | 3 | [] | no_license | # emscripten-sdl2-ogles2
*OpenGL to WebGL using Emscripten*
Demonstrates the basics of porting desktop graphics to the web using Emscripten, via a collection of code samples. Code is written in C++, SDL2, and OpenGLES2 and transpiled into Javascript and WebGL by Emscripten.
### [Run Hello Triangle](https://erik-larse... |
JavaScript | UTF-8 | 666 | 2.734375 | 3 | [] | no_license | class dustbin
{
constructor(){
this.bottomBody=Bodies.rectangle(1100,530,200,20, {isStatic:true})
this.leftWallBody=Bodies.rectangle(990,490,20,100,{isStatic:true})
this.rightWallBody=Bodies.rectangle(1200,490,20,100,{isStatic:true})
World.add(world, this.bottomBody)
World.add(world, this.leftWallBody)
... |
Java | UTF-8 | 2,952 | 2.234375 | 2 | [] | no_license | package com.jikgorae.api.organization.application;
import static com.jikgorae.api.fixture.OrganizationFixture.*;
import static com.jikgorae.api.organization.domain.RandomOrganizationCodeGenerator.*;
import static com.jikgorae.api.organization.exception.OrganizationAlreadyExistsException.*;
import static org.assertj.co... |
Java | UTF-8 | 520 | 2.296875 | 2 | [
"MIT"
] | permissive | package com.sdet.auto.pageObjects;
import static com.sdet.auto.seleniumExtensions.WebDriverExtensions.getElementBySelector;
public class ForgetPasswordPage {
private final static String txtEmail = "#email";
private final static String btnRetrievePassword = ".icon-2x.icon-signin";
public static void Ente... |
Java | UTF-8 | 997 | 3.8125 | 4 | [] | no_license | package iterator;
import java.util.ArrayList;
import java.util.Iterator;
//下面是输出的例子
public class DeepIteratorImp {
public static Iterator getIterator(ArrayList lists) {
return new DeepIterator(lists);
}
public static void main(String[] args) {
ArrayList finalLists = new ArrayList();
finalLists.add(0);
A... |
Java | UTF-8 | 7,326 | 1.898438 | 2 | [] | no_license | package com.giveu.shoppingmall.me.view.activity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;
import com.android.volley.mynet.BaseBean;
import com.android.volle... |
Shell | UTF-8 | 6,366 | 3.46875 | 3 | [] | no_license | #!/bin/bash
#
# Wocker環境かどうか
#
read -p "Is Wocker? [y/n]" ANSWER
case $ANSWER in
"" | "Y" | "y" | "yes" | "Yes" | "YES" )
PREFIX="wocker";;
*)
PREFIX="";;
esac
#
# Download sample text files
# 別にtxtファイルを用意した場合に上書きされるのを防ぐため、ダウンロードするか選択式に。
#
read -p "Download Sample Text Files? [y/n]" DOWNLOAD_ANSWER
#
... |
C | UTF-8 | 5,210 | 3.5625 | 4 | [] | no_license | // Joshua Johnson
// R11486776
// CS1412-001
// Puzzle Game in C
// 12/6/16
// Scaffold for puzzle problem
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define MAX_FILE_LENGTH 30
#define PUZZLE_SIDE 4
#define EMPTY_SLOT 0
void loadPuzzle(int puzzle[][PUZZLE_SIDE], FILE *fin);
int getMove();
void printPuzz... |
C# | UTF-8 | 1,005 | 3.203125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HtmlSharp.Elements;
namespace HtmlSharp.Css
{
public class AttributeExactFilter : AttributeFilter
{
string text;
public AttributeExactFilter(string type, string text)
: base(type)
{... |
Python | UTF-8 | 6,942 | 2.953125 | 3 | [
"MIT"
] | permissive | class Node:
def __init__(self, var, posCof, negCof):
self.var = var
self.posCof = posCof
self.negCof = negCof
class Formula:
def __init__(self, node, compBit):
self.node = node
self.compBit = compBit
class ROBDD:
# init
def __init__(self, varSeq):
self.v... |
Markdown | UTF-8 | 991 | 3.890625 | 4 | [] | no_license | # ALGORITHMS
This repository contains codes of various algorithms required for coding interview preparation
## KADANE'S ALGORITHM:
kadane's algorithm helps us to compute maximum subarray sum in linear time -> O(N); where N is the size of the input array.
According to kadane's algorithm , we don't need to co... |
Java | UTF-8 | 899 | 2.234375 | 2 | [
"MIT"
] | permissive | package com.barbershop.com.security;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
... |
Java | UTF-8 | 7,056 | 2.1875 | 2 | [] | no_license | package org.hedera.io.etl;
import static org.hedera.io.input.WikiRevisionInputFormat.SKIP_NON_ARTICLES;
import static org.hedera.io.input.WikiRevisionInputFormat.SKIP_REDIRECT;
import static org.hedera.io.input.WikiRevisionInputFormat.START_TITLE;
import static org.hedera.io.input.WikiRevisionInputFormat.END_TITLE;
im... |
JavaScript | UTF-8 | 7,667 | 2.734375 | 3 | [] | no_license | var planetNames = ["Su", "Mo", "Ev", "Gi", "Ke", "Mu", "Mi", "Du", "Ik", "Dr", "Jo", "La", "Ty", "Va", "Bo", "Po", "Ee"];
var planetFullNames = ["Sun-Kerbol", "Moho", "Eve", "Gilly", "Kerbin", "Mun", "Minmus", "Duna", "Ike", "Dres", "Jool", "Laythe", "Tylo", "Vall", "Bop", "Pol", "Eeloo"];
var planetFillColors = ['#ffe... |
Java | UTF-8 | 350 | 2.265625 | 2 | [] | no_license | package shop.jpa.domain;
import lombok.Getter;
import javax.persistence.Embeddable;
@Embeddable
@Getter
public class Address {
private String address;
private String postcode;
protected Address() {
}
public Address(String address, String postcode) {
this.address = address;
this... |
Java | UTF-8 | 573 | 3.140625 | 3 | [] | no_license | /* Created by IntelliJ IDEA.
* User: Divyansh Bhardwaj (dbc2201)
* Date: 22/10/20
* Time: 3:15 PM
* File Name : Example1.java
* */
package sectionI.thread.examples;
public class Example1 {
private static final int LIMIT = 10;
public static void main(String[] args) {
for (int index = 0; index ... |
Java | UTF-8 | 5,614 | 2.5625 | 3 | [] | no_license | package uk.calebwhiting.tk.bus;
import com.google.common.eventbus.Subscribe;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import uk.calebwhiting.tk.annotations.Destructor;
import uk.calebwhiting.tk.annotations.EventHandler;
import uk.calebwhiting.tk.annotations.Initiali... |
Markdown | UTF-8 | 9,119 | 2.625 | 3 | [] | no_license | # 1.*zk进阶--集群--分布式管理--注册中心--分布式JOB--分布式锁**
| ID | Problem |
| --- | --- |
| 000 |分布式集群管理 |
| 001 |分布式注册中心 |
| 002 |分布式JOB |
| 003 |分布式锁 |
## 一、 分布式集群管理
---
### **分布式集群管理的需求**
1. 主动查看线上服务节点
2. 查看服务节点资源使用情况
3. 服务离线通知
4. 服务资源(CPU、内存、硬盘)超出阀值通知
### **架构设计**

# italy = airports.select {|x| x["iso_country"] == "IT"}
# large_airports = italy.select {|x| x["type"] == "large_airport"}
# 2.1.2 :090 > airports.headers
# => ["id", "ident", "type", "... |
C# | UTF-8 | 10,124 | 2.953125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
using System.Globalization;
using UnityEngine;
using System.IO;
using System.Security.Cryptography;
/// <summary>
/// A collection of utility Methods useful for saving and loading data.
/// </summary>
public class SaveUtility
{
#region Data Type... |
C++ | UTF-8 | 826 | 3.21875 | 3 | [] | no_license | #ifndef PIECE_H
#define PIECE_H
#include <cstring>
#include <map>
#include <iostream>
using namespace std;
enum Classification
{
n_a,
king,
queen,
knight,
bishop,
castle,
pawn
};
class Piece {
protected:
/**ATTRIBUTES**/
Classification type;
bool white_color;
bool first_move;
public:
//CONSTRUCTOR... |
Python | UTF-8 | 1,095 | 4.34375 | 4 | [] | no_license | """
As we'll see in subsequent lectures, everything in Python is an object.
Objects are special because we can associate special functions, referred to as
object methods, with the object. In this problem you'll be working with string
objects, and their built-in methods.
As we'll see in subsequent lectures, everything ... |
C++ | UTF-8 | 1,886 | 3.828125 | 4 | [] | no_license | #include <iostream>
#include <string>
#include "Stack.h"
using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::stod;
int main() {
Stack s;
while (true) {
// read a word (token) from input
string token;
cin >> token;
if (isdigit(token[0]) || token[0] ==... |
Java | UTF-8 | 903 | 2.109375 | 2 | [
"Unlicense"
] | permissive | package net.timxekhach.operation.data.entity;
// ____________________ ::IMPORT_SEPARATOR:: ____________________ //
import lombok.Getter;
import lombok.Setter;
import net.timxekhach.operation.data.mapped.Buss_MAPPED;
import net.timxekhach.utility.XeStringUtils;
import javax.persistence.Entity;
import java.util.List;
i... |
Ruby | UTF-8 | 1,059 | 4.3125 | 4 | [] | no_license | # PEDAC
# Problem
# Find the sum of all the natural numbers below an input number that are multiples of 3 or 5. If the number
# is a multiple of both 3 and 5, only count it once.
# input = integer, output = integer
# Assumptions
# if there are no multiples of 3 or 5 below the input number, return 0
# Examples / T... |
Python | UTF-8 | 821 | 2.65625 | 3 | [] | no_license | import zmq
import time
import json
port = str(5555)
context = zmq.Context()
socket = context.socket(zmq.PAIR)
socket.bind("tcp://*:%s" % port)
while True:
print("Job executor is waiting for a new job request.")
msg = socket.recv()
print("Job executor has received a new job request.")
msg_dict = json.l... |
PHP | UTF-8 | 16,869 | 2.59375 | 3 | [] | no_license | <?php
require_once ("php_action/core.php");
//conexion a la BD para obtener la info
require_once("config/db.php");
/** Se agrega la libreria PHPExcel */
require_once("classes/lib/PHPExcel/PHPExcel.php");
//obtengo un array de lo que hay en la tabla actualmente
require_once("classes/conversor.php");
//conexion a la BD ... |
PHP | UTF-8 | 349 | 2.65625 | 3 | [
"MIT"
] | permissive | --TEST--
imagehistgram() function
--SKIPIF--
--FILE--
<?php
chdir(dirname(__FILE__));
$im = imagecreatefromjpeg('../examples/images/mosaic.jpg');
$histgram = imagehistgram($im);
if (is_array($histgram) && count($histgram) === 3 &&
is_array($histgram[0]) && count($histgram[0]) == 256) {
echo 'OK';
} else {
e... |
Swift | UTF-8 | 1,281 | 2.59375 | 3 | [] | no_license | //
// LittleCategoryCell.swift
// itvTask
//
// Created by Jahongir Nematov on 6/15/19.
// Copyright © 2019 Jahongir Nematov. All rights reserved.
//
import UIKit
class LittleCategoryCell : CategoryCell {
private let littleItemCellId = "littleItemCellId"
override func setupView() {
super... |
Markdown | UTF-8 | 1,586 | 2.9375 | 3 | [] | no_license | # DjangoTest
Python Django Framework test project
# Info:
Ці команди вводяться в git bash або в консолі якщо ви при установці вказали роботу з гітом через консоль;
перед введенням команд потрібно перейти в директорію вашого проекту (якщо через баш то можна перейти в папку там пкм і вибрати git bash)
# Для новог... |
Java | UTF-8 | 1,235 | 2.34375 | 2 | [
"MIT"
] | permissive | package com.wuhulala.rabbitmq.chapter2.persistence;
import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Channel;
import com.wuhulala.rabbitmq.util.ChannelFactory;
import java.io.IOException;
/**
* 0_0 o^o
*
* @author wuhulala<br>
* @date 2019/5/27<br>
* @d... |
Java | UTF-8 | 293 | 3.375 | 3 | [] | no_license | import java.util.*;
public class strrev
{
public static void main(String args[])
{
System.out.println(stringreverse("qwe").toString());
}
public static String stringreverse(String a)
{
String rev="";
for(int i=a.length()-1;i>=0;i--)
{
rev+=a.charAt(i);
}
return rev;
}
} |
Markdown | UTF-8 | 2,801 | 2.609375 | 3 | [
"MIT"
] | permissive | ---
author: Bela Seeger
date: 2015-11-10 10:00:56
image:
src : /static/images/projects/openbudgets.png
layout: post
tags:
- Transparenz
title: "OpenBudgets - OKF DE will contribute to advance fiscal
transparency in Europe"
type: post
---
[**OpenBudgets.eu**](http://openbudgets.eu/), a new project promoting transpar... |
Markdown | UTF-8 | 2,158 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | # Sensors
## Sensors - Get All
```shell
curl -X GET "https://cloud.verisolutions.co/api/v7/sensors"
-H "Authorization: Basic <token>"
-H "Content-Type: application/vnd.api+json"
```
This endpoint retrieves all Sensors that you have access to.
### Filtering
Almost all attributes are filterable. The following co... |
C++ | UTF-8 | 881 | 2.703125 | 3 | [] | no_license | #include <sstream>
#include "Subte.h"
Subte::Subte (std::string datos){
this->leerInformacion(datos);
}
void Subte::leerInformacion(std::string datos){
std::stringstream registro;
std::string dato;
std::string longitud, latitud;
registro<<datos;
unsigned int columnaLeida=1;
while(getline(registro,dato,'... |
Python | UTF-8 | 260 | 2.75 | 3 | [] | no_license | import urllib.request
data = {}
data['word'] = 'Jinx'
url_values = urllib.parse.urlencode(data)
url = "http://www.baidu.com/s?"
full_url = url + url_values
print(full_url)
data = urllib.request.urlopen(full_url).read()
data = data.decode('UTF-8')
print(data) |
PHP | UTF-8 | 6,215 | 2.921875 | 3 | [
"MIT"
] | permissive | <?php
namespace Pletfix\Ldap\Services;
use Pletfix\Ldap\Exceptions\LdapException;
use Pletfix\Ldap\Services\Contracts\Ldap as LdapContract;
/**
* LDAP is the Lightweight Directory Access Protocol, and is a protocol used to access a Active Directory Servers.
*
* @see http://de2.php.net/manual/en/book.ldap.php for ... |
C++ | UTF-8 | 4,798 | 2.734375 | 3 | [] | no_license | float correlation(ImagePtr I1, ImagePtr I2, int &xx, int &yy) {
// init vars to suppress compiler warnings
int dx = 0;
int dy = 0;
float corr = 0;
// image dimensions
int w = I1->width ();
int h = I1->height();
// template dimensions
int ww = I2->width ();
int hh = I2->height();
// error checking: ... |
C++ | UTF-8 | 1,277 | 3 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#define INF 0x7FFFFFF
#define PIG_WEIGHT 10001
#define SIZE 501
using namespace std;
typedef struct Node {
int value;
int weight;
} coin;
coin arr[SIZE];
int dp[PIG_WEIGHT];
int main()
{
ios::sync_with_stdio(fa... |
PHP | UTF-8 | 213 | 3.03125 | 3 | [] | no_license | <?php
class Solution
{
/**
* @param String $address
* @return String
*/
function defangIPaddr($address)
{
$res = str_replace('.', '[.]', $address);
return $res;
}
}
|
C | UTF-8 | 657 | 2.671875 | 3 | [] | no_license | #include "test_driver.h"
int testPeople(int* failed) {
struct gameState g;
int k[10] = {smithy,adventurer,gardens,embargo,cutpurse,mine,ambassador,
outpost,baron,tribute};
int r = initializeGame(2, k, 5, &g);
myassert(failed, r == 0, "No duplicates, 2 players, should succeed");
int k2[10] = ... |
C# | UTF-8 | 830 | 2.921875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using SurrealistGames.GameLogic;
namespace GameLogic.Tests.cs
{
[TestFixture]
public class AnswerFormatterTests
{
[TestCa... |
C# | UTF-8 | 1,680 | 3.28125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestDeck_ImageGenerator
{
public class FileDelimeter
{
public static DataTable DataFromTextFile(string location, char delimeter)
{
... |
Java | UTF-8 | 690 | 2.15625 | 2 | [] | no_license | package com.cos.blogapp2.web.dto;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import com.cos.blogapp2.domain.user.User;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@NoArgsConstructor
@AllArgsConstructor
@G... |
JavaScript | UTF-8 | 1,782 | 2.9375 | 3 | [
"MIT"
] | permissive | define(() => {
'use strict';
const scoreSorter = (a, b) => {
if(a.disqualified !== b.disqualified) {
return a.disqualified ? 1 : -1;
}
if(a.food !== b.food) {
return b.food - a.food;
}
return b.workers - a.workers;
};
return {
score: (config, {teams}) => {
const gameTeamScores = teams.map((te... |
C | UTF-8 | 1,220 | 4.03125 | 4 | [] | no_license | #include <stdio.h>
#define MAS 100 // Maximum Array size
int main()
{ // Start main()
int Arr[MAS], n, i, j, k ,l=0, temp,gap;
label:
printf("Enter number of elements in the Array (max %d) : ",MAS);
scanf("%d", &n);
if(n<1||n>100)
{ printf("Please enter a valid Ar... |
JavaScript | UTF-8 | 427 | 2.75 | 3 | [] | no_license | $(document).ready(function () {
$('.tweet-field').on('input', function () {
const tweetLength = this.value.length;
const tweetCounter = $(this).siblings('.counter');
const errorMessage = $('.error-msg');
tweetCounter.html(140 - tweetLength);
tweetCounter.css({color: '#4a5a9b'});
errorMessage... |
Java | UTF-8 | 3,689 | 2.546875 | 3 | [
"MIT"
] | permissive | package tech.yaog.utils.statemachine;
import org.junit.Before;
import org.junit.Test;
import java.util.Arrays;
import java.util.List;
import static org.junit.Assert.*;
/**
* Created by ygl_h on 2017/7/17.
*/
public class StateMachineTest {
private StateMachine<Integer, Integer> tradeStateMachine;
private... |
Go | UTF-8 | 1,319 | 3.515625 | 4 | [] | no_license | package main
import (
"fmt"
"math"
)
// 验证二叉搜索树
func isValidBST(root *TreeNode) bool {
return checkBST(root, math.MinInt64, math.MaxInt64)
}
func checkBST(node *TreeNode, minValue int, maxValue int) bool {
if node == nil {
return true
}
if node.Val <= minValue || node.Val >= maxValue {
return false
}
ret... |
Markdown | UTF-8 | 5,795 | 2.625 | 3 | [] | no_license | ---
manual:WebAPI
version:0
lang:zh
rawUrl:https://developer.mozilla.org/zh-CN/docs/Web/API/Animation/finish
---
<bdi>我们的志愿者还没有将这篇文章翻译为<bdi>中文 (简体)</bdi>。[加入我们帮助完成翻译]22626 "")<br></br>您也可以阅读此文章的[English (US)]14091 "")版。</bdi>
**This is an[experimental technology]3404 "")**<br></br>Check the[Browser compatibili... |
C# | UTF-8 | 2,325 | 2.546875 | 3 | [] | no_license | using FluentAssertions;
using Game;
using Game.Geometry;
using NUnit.Framework;
namespace UnitTests
{
[TestFixture]
public class FastCoord_Neighbor_Test
{
[OneTimeSetUp]
public void SetUp()
{
FastCoord.Init();
}
[TestCase(0)]
[TestCase(1)]
[TestCase(2)]
[TestCase(3)]
[TestCase(4)]
[TestCase(... |
PHP | UTF-8 | 512 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace verbb\cpnav\records;
use craft\db\ActiveRecord;
use yii\db\ActiveQueryInterface;
class Layout extends ActiveRecord
{
// Public Static Methods
// =========================================================================
public static function tableName(): string
{
return '{{%c... |
TypeScript | UTF-8 | 1,671 | 2.734375 | 3 | [] | no_license | export class Database {
private db: IDBDatabase;
constructor() {
this.db = null;
}
public init(dbName: string, version?: number): Promise<IDBDatabase> {
return new Promise((resolve, reject) => {
const iDb = window.indexedDB;
const openRequest = iDb.open(dbName, version);
openRequest.... |
Python | UTF-8 | 2,326 | 3.5625 | 4 | [] | no_license | from game_of_life import next_board_state
from game_of_life import render
"""
TODO: there's a lot of repeated code here. Can
you move some of into reusable functions to
make it shorter and neater?
"""
def test(test_num, expected_next_state, actual_next_state):
if expected_next_state == actual_next_state:
... |
PHP | UTF-8 | 528 | 2.90625 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Seeder;
//para trabajar con un modelo lo incluimos
use LaraDex\Role;
class RoleTableSeeder extends Seeder
{
/**
* creacion de un nuevo rol
* le almaceno informacion por defecto a la BDD.
*/
public function run()
{
$role = new Role();
$role->name... |
Java | UTF-8 | 2,066 | 2.515625 | 3 | [] | no_license | package com.payee.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import com.payee.domain.BankAccount;
import com.payee.domain.Use... |
PHP | UTF-8 | 600 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace app\models;
use yii\db\ActiveRecord;
class TokenModel extends ActiveRecord
{
public static function tableName() {
return 'tokens';
}
public function rules()
{
return [
[['user_id', 'token'], 'required'],
[['user_id'], 'integer'],
[... |
C++ | UTF-8 | 1,315 | 2.578125 | 3 | [] | no_license | #include <LEDDisplay.h>
LEDDisplay led;
//Diese Include-Datei hat die Bitmaps und zwei Funktionen
//Sie erwartet, dass es "led" gibt
#include <wuerfel.h>
void setup(void) {
led.begin();
/*
Default Mode of the LED display is
"FIFO_DISPLAY"
adding something to the display moves existing
cont... |
Java | UTF-8 | 492 | 2.984375 | 3 | [] | no_license | package com.gui.part02_layout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
public class GridLayoutTest extends JFrame{
public static void main(String[] args) {
JFrame mf = new JFrame();
mf.setSize(600 , 400);
mf.setLayout(new GridLayout(5 , 5));
for(int i=1; i... |
Markdown | UTF-8 | 1,409 | 3.859375 | 4 | [] | no_license | # Time_Travel_Search_Algorithms
## Project description
The goal in this project is to use AI search algorithms in the 3D space to reach from an initial location to a target location with the optimal shortest path under some constratins. The constraints for every fixed z are as following: 1) the space is considered t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.