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 |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 658 | 2.609375 | 3 | [] | no_license | iOS界面跳转
方法一:
1.First ViewController(FVC)
在storyboard中设置SVC的ID,如图:

storyboard中已经有界面的情况下,跳转代码如下:
```Objective-C
// 通过在“Main.storyboard"中查找ID为 kWEBVIEW 的SVC
WebViewController* next = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewC... |
Markdown | UTF-8 | 768 | 2.515625 | 3 | [] | no_license | # CurrentAfricanPresidents
The app, Current African Presidents quizes users on some current African presidents with six questions.
The app consist of a LinearLayout parent view with a Scrollview enclosing the other child views which include TextViews,
RadioGroups, RadioButtons, Textviews, EditText, CheckBoxes and a B... |
Java | UTF-8 | 4,833 | 2.765625 | 3 | [
"MIT"
] | permissive | package farm.bsg.data.types;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import org.joda.time.DateTimeConstants;
import farm.bsg.data.Type;
import farm.bsg.data.contracts.ProjectionProvider;
import farm.bsg.data.contracts.SingleCharacterBitmaskProvider;
publ... |
C++ | GB18030 | 3,080 | 2.59375 | 3 | [] | no_license |
#include <stdio.h>
#include <stdlib.h>
#include "client.h"
#include "common.h"
#include "data.h"
//50 channels wide={1,4,10,20} client=1000 miu=0.2 lamd={0~}
//Ҫ
// ımiuֵЧԸıleavetimeļ㷽ɴֱӷʱ̶ 0.01
double simulate(double lanmd)
{
double stuck;//
//__________________________________________________________________... |
Java | UTF-8 | 3,340 | 2.0625 | 2 | [] | no_license | package com.jeju.client.review.controller;
import java.io.IOException;
import java.util.List;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
impo... |
C++ | UTF-8 | 590 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N;
string word;
int main()
{
cin >> N;
cin >> word;
if (N == 1)
{
if (word[0] == '?')
word[0] = 'a';
}
else
{
for (int i = 0; i < N / 2; i++)
{
if (word[i] == '?')
{
if (word[N - i - 1] == '?')
{
w... |
C++ | UTF-8 | 3,272 | 3.265625 | 3 | [
"MIT"
] | permissive | #pragma once
#include <iostream>
class User
{
private:
char* name;
int age;
double cash;
int vodkas;
int whiskeys;
char* music;
void SetName(const char*);
void SetAge(int);
void SetVodkas(int);
void SetWhiskeys(int);
void SetMusic(const char*);
void CopyFrom(const User&);
void Free();
public:
User(con... |
C# | UTF-8 | 8,639 | 3.40625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
namespace _02Ladybugs
{
class Program
{
//private static void MoveLadyBug(int[] ladyBugs, int ladyBugIndex, string directions, int count)
//{
// if (directions == "left")
// {
// count = -co... |
Java | UTF-8 | 797 | 1.90625 | 2 | [] | no_license | //package com.j1902.beststore.config;
//
//import com.j1902.beststore.interceptor.AutoLogin;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSuppor... |
Python | UTF-8 | 1,192 | 3.390625 | 3 | [
"Apache-2.0"
] | permissive | counter = 0
for i in range(10):
num = int(input())
if num > 10:
counter = counter + 1
print('Было введено', counter, 'чисел, больших 10.')
# несколько счетчиков. Модифицируем предыдущую программу:
# посчитаем еще и количество нулей среди введенных чисел.
counter1 = 0
counter2 = 0
for i in range(10):
... |
Python | UTF-8 | 1,931 | 2.53125 | 3 | [] | no_license | from selenium import webdriver
import unittest
from pubile import login
import xml.dom.minidom
import time
print ("GG")
dom=xml.dom.minidom.parse('C:\\Users\\Administrator\\PycharmProjects\\untitled2\\126test\\test_date\\login_data.xml')
root=dom.documentElement
testaaa=root.getElementsByTagName('explain')
GG=testa... |
Java | UTF-8 | 952 | 1.992188 | 2 | [] | no_license | package com.xxx.willing.model.http.js;
import java.io.Serializable;
public class ShopJsVo implements Serializable{
private int id;
private int num;
private int colorId;
private int sizeId;
private double zgviPrice;
public double getPrice() {
return zgviPrice;
... |
Go | UTF-8 | 1,621 | 2.953125 | 3 | [] | no_license | package upnp
import (
"log"
"gitlab.com/NebulousLabs/go-upnp"
)
/*
uPNP Module
This module handles uPNP Connections to the gateway router and create a port forward entry
for the host system at the given port (set with -port paramter)
*/
type UPnPClient struct{
Connection *upnp.IGD //UPnP conenction object
E... |
C++ | UTF-8 | 743 | 2.5625 | 3 | [] | no_license | #include<bits/stdc++.h>
# define max1 1000
using namespace std;
int a[max1][max1];
int n,m;
int region(int i,int j)
{
if((i<0)||(j<0)||(i>n-1)||(j>m-1)||(a[i][j]!=1))
{
return 0;
}
a[i][j]=-1;
return region(i-1,j)+region(i+1,j)+region(i,j-1)+region(i,j+1)+1;
}
int main()
{
... |
TypeScript | UTF-8 | 2,177 | 2.8125 | 3 | [] | no_license | import { SES } from 'aws-sdk'
import {
SendTemplatedEmailRequest,
SendTemplatedEmailResponse,
} from 'aws-sdk/clients/ses'
import { ParsedMailbox, parseOneAddress } from 'email-addresses'
import config from '../configs/ses'
const { NODE_ENV } = process.env
interface Recipient {
email: string
name: string
}
... |
Java | UTF-8 | 14,006 | 2.578125 | 3 | [] | no_license | package example.listeners;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Type;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;... |
Java | UTF-8 | 1,106 | 1.890625 | 2 | [] | no_license | package fr.unice.polytech.si5.al.creditrama.teamd.clientservice.client;
import fr.unice.polytech.si5.al.creditrama.teamd.clientservice.model.BankAccount;
import fr.unice.polytech.si5.al.creditrama.teamd.clientservice.model.BankAccountRequest;
import fr.unice.polytech.si5.al.creditrama.teamd.clientservice.model.CardReq... |
Java | UTF-8 | 5,070 | 2.03125 | 2 | [] | no_license | package com.coinbase.android.ui;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.View;
import android.widg... |
Shell | UTF-8 | 477 | 3.453125 | 3 | [] | no_license | # .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Help me out if zsh exists and I have no control over my shell for some reason
ZSH_EXECUTABLE=$(grep zsh /etc/shells)
if [ $? -eq 0 ]; then
if [[ $- == *i* ]]; then
if ! echo ${BASH_EXECUTION_STRING} | grep -E '^scp.*|^rsync.... |
TypeScript | UTF-8 | 3,282 | 2.75 | 3 | [
"MIT"
] | permissive | import { bytesToBase64 } from "@tendermint/belt"
import { TxMsg } from "./tx-msg"
import { validateServiceURL, validatePublicKey } from './../../../utils'
/**
* Model representing a MsgNodeStake to stake as an Node in the Pocket Network
*/
export class MsgNodeStake extends TxMsg {
public readonly AMINO_KEY: stri... |
PHP | UTF-8 | 1,495 | 2.859375 | 3 | [] | no_license | <?php
$servername = "juanfonsecam.com";
$username = "juanfons_msc_gmt";
$password = "msc;gmt28";
$dbname = "juanfons_trafficexperiments";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_e... |
PHP | UTF-8 | 565 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Service;
class BuildThreeService
{
public function build(array &$elements, $parentId = null) {
$branch = array();
foreach ($elements as &$element) {
if ($element['parent_id'] == $parentId) {
$children = $this->build($elements, $element['id']);
... |
JavaScript | UTF-8 | 1,958 | 2.59375 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import { connect } from 'react-redux'
import Train from './Train'
import '../styles/IncomingTrains.scss';
import axios from 'axios'
function IncomingTrains() {
const [trainsList, setTrainsList] = useState([])
useEffect(() => getTrains(), [])
/* function handle... |
Java | UTF-8 | 534 | 1.679688 | 2 | [] | no_license | package com.hawk.admin.persistence.dao;
import com.hawk.admin.persistence.entity.SysMenu;
import com.hawk.admin.persistence.entity.SysUserRole;
import com.hawk.mybatis.base.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @Title: SysUserRoleMapper
* @ProjectName spring-safety-t... |
Java | UTF-8 | 736 | 2.78125 | 3 | [] | no_license | package com.msp.spring.bean;
public class Student {
private String name;
private Integer age;
private String sex;
private Car car;
public Car getCar() {
return car;
}
public void setCar(Car car) {
this.car = car;
}
public String getName() {
return name;
}
@Override
public String toString() {
retu... |
Python | UTF-8 | 1,629 | 2.53125 | 3 | [] | no_license | #!/usr/bin/python3
import argparse, os, configparser, datetime, sys
from pathlib import Path
# Create config directory of it does not exist
homedir = str(Path.home())
configdir = os.path.join(homedir, '.backupsql')
if not os.path.exists(configdir):
os.makedirs(configdir)
print("creating {}".format(configdir))
... |
Java | UTF-8 | 12,335 | 3.46875 | 3 | [] | no_license |
public class App {
public static void main(String[] args) {
int op = 1;
int id = 0;
boolean found;
do {
showMenu();
op = Console.lerInt("Enter an option: ");
switch(op) {
case 1: //Cadastrando viagem de carro
S... |
Python | UTF-8 | 2,580 | 2.828125 | 3 | [] | no_license | import numpy as np
import os
import matplotlib.pyplot as plt
import math
import scipy.stats as stats
import scipy
# this file contains python functions
# for visualization of EM steps for Gaussian Mixture Model
def plot_pdf(u_arr, sigma_arr):
x = np.linspace(-1, 3, 1000)
plt.rcParams['figure.figsize']=(9,3)
... |
Java | UTF-8 | 323 | 2.96875 | 3 | [] | no_license | package com.hillel.lesson_10.ex;
public class Bonus {
public static void main(String[] args) {
Object o1 = new Object();
Object o2 = new Object();
System.out.println(o1 == o2);
System.out.println(o1.equals(o2));
System.out.println(o1);
System.out.println(o2);
}... |
Java | UTF-8 | 112 | 2.46875 | 2 | [] | no_license | package App;
public class Luggage {
int weight;
public Luggage(int weight) {
this.weight = weight;
}
}
|
C++ | UTF-8 | 1,229 | 3.328125 | 3 | [
"MIT"
] | permissive | #ifndef _SCENE_STATE_MACHINE_H_
#define _SCENE_STATE_MACHINE_H_
#include <memory>
#include <unordered_map>
#include "Scene.h"
#include "Window.h"
class SceneStateMachine
{
public:
SceneStateMachine();
// ProcessInput, Update, LateUpdate, and Draw will simply be
// pass through methods. They will call t... |
Python | UTF-8 | 512 | 4 | 4 | [] | no_license | #this one is like your scripts with argv
def print_two(*args):
arg1, arg2 = args
print "arg1: %r, arg2: %r" %(arg1, arg2)
#that *args is actually pointless, we can just do this
def print_two_again(arg1, arg2):
print"arg1: %r, arg2: %r" %(arg1, arg2)
#this just takes one argument
def print_one(arg1):
p... |
Python | UTF-8 | 11,242 | 2.84375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 7 18:31:12 2019
@author: seung & billy
"""
######################################################################
#Control variables
analyze_videos = True
######################################################################
import deeplabcut
import os
impo... |
Java | UHC | 338 | 2.84375 | 3 | [] | no_license |
public class if_01 {
public static void main(String[] args) {
int jumsu=79;
if(jumsu>80)
{
System.out.println("հԴϴ.");
System.out.println(" Ƶ ˴ϴ.");
System.out.println("ϱ Ƶ ˴ϴ.");
}
else
{
System.out.println(" Դϴ.");
}
}
}
|
Java | UTF-8 | 1,450 | 2.546875 | 3 | [] | no_license | package br.com.dextra.harrypotterapi.vo;
import br.com.dextra.harrypotterapi.model.Characters;
import br.com.dextra.harrypotterapi.model.Houses;
import javax.validation.constraints.NotBlank;
/**
*
* @author Priscila Albertini
*/
public class CharactersDTO {
@NotBlank(message = "{name.not.blank}")
priv... |
JavaScript | UTF-8 | 803 | 3.71875 | 4 | [] | no_license | var sorteados = sorteio();
var output = document.querySelector("#output");
var msg = "";
msg += "<p>numeros sorteados: </p>"
msg += "<p>"+ sorteados.join(", ")+"</p>"
var meusNumeros = [4, 50, 36, 41, 8, 10];
for(var i = 0; i < meusNumeros.length; i++){
msg += "<p>"+meusNumeros[i]+": ";
//ifelse ternario
... |
JavaScript | UTF-8 | 5,091 | 2.796875 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from 'axios';
import DatePicker from 'react-datepicker';
import "react-datepicker/dist/react-datepicker.css";
export default class CreateTodo extends Component{
//Add a constructor and initialize this.state with a hashMap
constructor(props){
super(props);
/*... |
PHP | UTF-8 | 12,036 | 2.578125 | 3 | [] | no_license | <?php
namespace Parhomenko\Olx\Api;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException;
use Parhomenko\Olx\Exceptions\BadRequestException;
use Parhomenko\Olx\Exceptions\ExceptionFactory;
class Adverts
{
const API_VERSION = '2.0';
const OLX_ADVERTS_URL = '/api/partner/adverts';
private $user... |
Markdown | UTF-8 | 795 | 2.71875 | 3 | [] | no_license | # Confusing a Recursive Disassembler
Write another program, this time so that it tricks your favorite recursive
disassembler’s function detection algorithm. There are various ways to do
this. For instance, you could create a tail-called function or a function
that has a switch with multiple return cases. See how far y... |
Java | UTF-8 | 1,221 | 2.96875 | 3 | [] | no_license | package nekrocode.chessgame.chess.chessboard;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import nekrocode.chessgame.chess.ChessColor;
import nekrocode.chessgame.chess.visualrepresentations.ChessboardPanel;
// TODO Need a better system to initialize its graphical components.
public ... |
Java | UTF-8 | 1,194 | 2.296875 | 2 | [] | no_license | package User.Logic;
import User.Logic.DatabaseFront;
import java.util.ArrayList;
public class userFront {
DatabaseFront DBF = null;
public Object getSearchOrder;
public userFront() {
try {
this.DBF = new DatabaseFront();
} catch (Exception ex) {
ex.printStackTrace... |
JavaScript | UTF-8 | 938 | 3.390625 | 3 | [] | no_license |
let myNumber = 50;
if (typeof myNumber !== 'number'){
console.log('This is not a number');
}
else if (myNumber %3===0){
console.log ('GEN');
}
else if (myNumber %5===0){
console.log ( 'Buzz');
}
else ... |
Python | UTF-8 | 19,981 | 2.796875 | 3 | [
"MIT"
] | permissive | """
DBSCAN or HDBSCAN clustering. This class also performs a greedy search in 2 DBSCAN/HDBSCAN parameter assed as first-param-name
and second-param-name
author: Cristina Luna, Ricardo Kleinlein
date: 05/2020
Usage:
python3 ClusterScan.py
--root-path-MTCNN-results ~/DATASET_GOOGLE_IMGS/VIDEO_DB_MTCNN
... |
Swift | UTF-8 | 1,906 | 2.578125 | 3 | [] | no_license | //
// TranslateHintView.swift
// English
//
// Created by Сергей Гаврилко on 24/02/2019.
// Copyright © 2019 gavrilko. All rights reserved.
//
import UIKit
class TranslateHintView: UIView {
let label = UILabel(
text: "Нажимайте на слова, чтобы выбрать другой вариант перевода",
color: UIColor(... |
C | UTF-8 | 8,823 | 2.625 | 3 | [
"MIT"
] | permissive | /*
* PNG-parts
* parts of a Portable Network Graphics implementation
* Copyright 2018-2019 Cody Licorish
*
* Licensed under the MIT License.
*
* test-pngread.c
* png reader test program
*/
#include "../src/pngread.h"
#include "../src/zread.h"
#include "../src/inflate.h"
#include <stdio.h>
#include <errno.h>
#... |
Java | UTF-8 | 2,139 | 2.375 | 2 | [] | no_license | package org.example.imagecollector.collector;
import com.flickr4java.flickr.Flickr;
import com.flickr4java.flickr.REST;
import com.flickr4java.flickr.photos.Photo;
import com.flickr4java.flickr.photos.PhotoList;
import com.flickr4java.flickr.photos.SearchParameters;
import org.slf4j.Logger;
import org.slf4j.LoggerFact... |
Python | UTF-8 | 676 | 3.90625 | 4 | [] | no_license | ### 11 - Gerenciando e criando exceções customizadas com try, except, else e finally
lista = [1, 10]
#a = ""
arquivo = open('teste.txt', 'r')
try:
divisao = 10/ 1
numero = lista[1]
x = a
except ZeroDivisionError:
print(" Divisão por Zero não é possivel: ")
except ArithmeticError:
print("Houve err... |
Java | UTF-8 | 75 | 1.554688 | 2 | [] | no_license | package org.me.app.factory.abstact;
public enum CpuType {
INTEL,AMD
}
|
Shell | UTF-8 | 1,586 | 2.984375 | 3 | [] | no_license | #!/bin/bash
#SBATCH -p pgsb
#SBATCH --cpus-per-task 2
#SBATCH --mem-per-cpu=2G
#SBATCH --job-name=fastQC
#SBATCH --output=/home/pgsb/vanda.marosi/slurm/logs/%x.%j.%a.out
#SBATCH --error=/home/pgsb/vanda.marosi/slurm/logs/%x.%j.%a.err
#SBATCH --array=1-35
#SBATCH --ntasks=1
source ~/.bash_profile
source ~/.bashrc
PROJ... |
Python | UTF-8 | 858 | 3.046875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
# coding: utf-8
# # 1006_Vielseitige Kunststoffe
#
# **4h**
#
# ## Leitfragen
#
# - Warum werden bestimmte Kunststoffe im Alltag verwendet?
#
# ## Inhaltsfelder & Inhaltliche Schwerpunkte
#
# - **IF10: Organische Chemie**
# - Makromoleküle: ausgewählte Kunststoffe
#
# ## Schwerpunkte der ... |
Java | UTF-8 | 1,329 | 2.609375 | 3 | [] | no_license | package pack1;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import javax.swing.JLabel;
public class Label extends JLabel {
/**
*
*/
private static final long serialVersionUID = 1L;
protected void paintComponent(Graphics g) {
... |
Java | UTF-8 | 4,696 | 1.984375 | 2 | [] | no_license | package com.wwb.paotui.bean;
public class FinishOrder {
/**
* id : d38c5aab-f169-4e05-9443-575c2f3c690a
* trackingNumber : 15355934222257350
* buyerName : 李白
* buyerTelnum : 13202908144
* distance : 2.82
* commissionCalculate : 10.46
* courierName : null
* courierTelNum : n... |
Markdown | UTF-8 | 2,649 | 3.625 | 4 | [] | no_license | ---
weight: 347
title: "347 Top K Frequent Elements"
date: 2021-03-17T00:00:00+08:00
draft: false
tags: ["leetcode", "lc_medium", "lc_heap"]
---
Given a non-empty array of integers, return the _**k**_ most frequent elements.
**Example 1:**
```
Input: nums = [1,1,1,2,2,3], k = 2
Output: [1,2]
```
**Example 2:**
```
In... |
SQL | UTF-8 | 2,750 | 3.1875 | 3 | [
"MIT"
] | permissive | /* aggs_for_arrays--1.3.2.sql */
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION aggs_for_arrays" to load this file. \quit
CREATE OR REPLACE FUNCTION
array_to_hist(anyarray, anyelement, anyelement, int)
RETURNS int[]
AS 'aggs_for_arrays', 'array_to_hist'
LANGUAG... |
Markdown | UTF-8 | 2,599 | 2.921875 | 3 | [] | no_license | # Fake-News-Detection
In this project, Using libraries from scikit-learn API, the training of DataFrames, which were retrieved by using pandas and pydrive libraries, was accomplished.
This project was learnt in Coursera and is for anyone with foundation in programming and machine learning who wants to develop Data sci... |
C++ | UTF-8 | 723 | 2.5625 | 3 | [] | no_license | //Name of class: CStationHackedEvent
//Main author: Toyan Green
//Summary: This class is used to broadcast a message that the game was paused
// in the game.
//
//Functions: GetHackID
#ifndef _CSTATIONHACKEDEVENT_H_
#define _CSTATIONHACKEDEVENT_H_
class CStationHackedEvent
{
public:
CStationHackedEven... |
PHP | UTF-8 | 287 | 2.578125 | 3 | [] | no_license | <?php
namespace softmetrix\Smooth\Interpolator;
class InterpolatorLinear extends Interpolator
{
public function interpolate($i)
{
$k = floor($i);
$r = $i - $k;
return (1 - $r) * $this->getClippedInput($k) + $r * $this->getClippedInput($k + 1);
}
}
|
Java | UTF-8 | 2,184 | 2.140625 | 2 | [
"MIT"
] | permissive | /**
*
*/
package br.com.swconsultoria.efd.contribuicoes.bo.blocoD;
import br.com.swconsultoria.efd.contribuicoes.registros.blocoD.RegistroD350;
import br.com.swconsultoria.efd.contribuicoes.util.Util;
/**
* @author Yuri Lemes
*
*/
public class GerarRegistroD350 {
public static StringBuilder gerar(RegistroD350... |
Python | UTF-8 | 7,426 | 2.890625 | 3 | [] | no_license | import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import seaborn as sns
import itertools
from mpl_toolkits.mplot3d import Axes3D
def plot_correlations(correlations):
f = plt.figure(figsize=(20,5))
ax = f.add_subplot(1,1,1)
plt.bar(correlations.index, correlations)
for i in rang... |
Java | UTF-8 | 4,086 | 2.125 | 2 | [] | no_license | package com.gudeng.commerce.gd.home.service.impl;
import java.net.MalformedURLException;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.caucho.hessian.client.HessianProxyFactory;
import com.gudeng.c... |
PHP | UTF-8 | 1,157 | 3.125 | 3 | [
"MIT"
] | permissive | <?php
namespace Lib\Ctct\Components\EmailMarketing;
use Lib\Ctct\Components\Component;
/**
* Represents a click through detail
*
* @package EmailMarketing
* @subpackage Campaigns
* @author Constant Contact
*/
class ClickThroughDetails extends Component
{
/**
* the actual url that was... |
Python | UTF-8 | 1,263 | 3 | 3 | [] | no_license | from collections import defaultdict
import csv
import numpy as np
from random import choice
kaggle_file = "/cs/usr/tamar.yov/Desktop/final_project/" \
"Data-Science---Final-Project/data/Game of Thrones/kaggle_cleaned.csv"
TOP_CHARACTERS_AMOUNT = 30
def find_top_characters(reader):
speaker_counter =... |
Markdown | UTF-8 | 867 | 2.65625 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: "First post ever: Hello, Web!"
date: 2014-09-15 08:46:19 +0000
comments: true
categories:
---
I'm thinking about creating my own blog for years.
Today, I'm married for 1 month, I'm working as developer in a great startup, and the tech part I have in charge at church is on its good road.
If it c... |
SQL | UTF-8 | 5,799 | 2.84375 | 3 | [] | no_license |
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Dumping data for table `contests_contest`
--... |
JavaScript | UTF-8 | 23,047 | 2.828125 | 3 | [] | no_license | var PlayerAnimation = {
NONE: {
restart_frame: 0,
frame: [{ image: 0, ticks: 1 }]
},
RUN: {
restart_frame: 0,
frame: [{ image: 0, ticks: 4 }, { image: 1, ticks: 4 }, { image: 2, ticks: 4 }, { image: 3, ticks: 4 }]
},
JUMPUP: {
restart_frame: 0,
frame: [{ image: 4, tick: 1 }]
},
JUMPDOWN: {
restart_... |
Java | UTF-8 | 2,812 | 2.25 | 2 | [
"Apache-2.0"
] | permissive | package us.ihmc.pathPlanning.visibilityGraphs.tools;
import org.junit.jupiter.api.Test;
import us.ihmc.commons.RandomNumbers;
import us.ihmc.euclid.geometry.ConvexPolygon2D;
import us.ihmc.euclid.transform.RigidBodyTransform;
import us.ihmc.euclid.tuple2D.Point2D;
import us.ihmc.euclid.tuple3D.Point3D;
import us.ihmc.... |
Python | UTF-8 | 782 | 3.625 | 4 | [] | no_license | class Node():
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution():
def BTfromInPre(self, A, B):
head = self.get_BT(A, B)
return head
def get_BT(self, A, B):
if not A:
return None
node = Node(A[0])
... |
Java | UTF-8 | 1,624 | 3.203125 | 3 | [] | no_license | // Copyright (C) 2022 by iamslash
import java.util.*;
class ListNode {
int val;
ListNode next;
ListNode() {}
ListNode(int val) { this.val = val; }
ListNode(int val, ListNode next) { this.val = val; this.next = next; }
}
// 26ms 45.58% 123.2MB 63.70%
// list
// O(N) O(N)
class Solutio... |
Markdown | UTF-8 | 71 | 2.578125 | 3 | [] | no_license | Testing out terraform with aws working through udemy terraform course
|
Java | UTF-8 | 554 | 2.078125 | 2 | [] | no_license | package shoplist.project.kz.sportshop.response;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.List;
import shoplist.project.kz.sportshop.model.DataAddProduct;
/**
* Created by Andrey on 3/27/2017.
*/
public class AddFavoriteResponse {
@Seriali... |
C++ | UTF-8 | 430 | 2.546875 | 3 | [] | no_license | using namespace std;
class Fecha
{
private:
int d;
int m;
int a;
static bool esBisiesto(int a);
static int cantDiasMes(int m, int a);
static bool validarFecha(int d, int m, int a);
public:
Fecha(int d=0, int m=0, int a=0);
int getDia()const;
int getMes()const;
int getAnio()const;... |
Markdown | UTF-8 | 964 | 2.609375 | 3 | [] | no_license | # IITG-Form-Creating-Portal
a Form creating portal in DJANGO framework with user having full control over the form fields and fields type, option of file upload, what content is displayed and IITG webmail authentication for enhanced security. The portal can be utilised to automate tasks like feedback collection etc wit... |
JavaScript | UTF-8 | 10,304 | 2.6875 | 3 | [] | no_license | "use strict";
class Gene {
constructor(geneBits, currentPos) {
this.geneBits = geneBits; //基因,数组
this.fitness = 100;
this.cf = 0;
this.step = 0;
this.currentPos = currentPos;
this.brokenPos = [0, 0];
this.geneXY = [];
}
}
class Maze {
constructor() {
//最大进化代数
thi... |
C++ | UTF-8 | 1,262 | 2.96875 | 3 | [] | no_license | #include "Berserk.h"
/*
YOU MUST WRITE THE IMPLEMENTATIONS OF THE REQUESTED FUNCTIONS
IN THIS FILE. START YOUR IMPLEMENTATIONS BELOW THIS LINE
*/
#include<iostream>
Berserk::Berserk(uint id, int x, int y):Player(id,x,y){
name = "Berserk";
PriorityList = {ATTACK, UP, LEFT, DOWN, RIGHT };
armor = WOODEN;
weapon... |
C# | UTF-8 | 2,569 | 2.828125 | 3 | [] | no_license | using System.ComponentModel;
using System.Runtime.Serialization;
namespace Midway.ObjectModel
{
/// <summary>
/// Статус обработки заявки на издание сертификата.
/// </summary>
[DataContract]
public enum CertificateIssueStatus
{
/// <summary>
/// Создана.
/// </summary>... |
Java | UTF-8 | 5,725 | 2.4375 | 2 | [] | no_license | package com.stx.controller;
import com.stx.entity.*;
import com.stx.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframew... |
Java | UTF-8 | 5,136 | 2.515625 | 3 | [] | 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 servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.ParseException;
import java.text.SimpleDateF... |
Java | UTF-8 | 1,077 | 3.53125 | 4 | [] | no_license | package algorithm.backjoon.linkedlist;
import java.util.LinkedList;
import java.util.Scanner;
//조세퍼스 문제
public class Quiz1158 {
public static void solution(int N, int M) { // N - 인원수, M - M번째 제거
int cnt = 1;
LinkedList<Integer> list = new LinkedList<Integer>();
for (int i = 1; i <= N; i++)... |
Markdown | UTF-8 | 5,880 | 2.828125 | 3 | [
"MIT"
] | permissive | ---
layout: default
title: Terms and Conditions
nav_order: 1
description: "Developer Student Clubs OMG Tweet Contest Terms and Conditions"
permalink: /
---
# Developer Student Clubs OMG - Tweets Contest - Terms and Conditions
Interested in being a part of the Developer Student Clubs OMG - Tweets Contest? We are happ... |
Python | UTF-8 | 2,335 | 2.765625 | 3 | [] | no_license | #Xndir_1
def Xndir_1(func_1):
sum=0
n=int(input())
def rec_1(n,sum):
if n==0:
return
sum +=n
print(sum)
rec_1(n-1,sum)
rec_1(n,sum)
#Xndir_2
def Xndir_2(func_2):
a=input("")
def rec_2(a):
b=len(a)
if len(a)==0:
return
... |
JavaScript | UTF-8 | 1,079 | 2.703125 | 3 | [] | no_license | import React from 'react'
function Form({inputText,setInputText,todos,setTodos}) {
const submitTodoHandler = (event) => {
event.preventDefault();
if(inputText !== "")
{
setTodos(
[...todos,{
id: Date.now(),
item: in... |
Java | UTF-8 | 263 | 1.773438 | 2 | [
"Apache-2.0"
] | permissive | package mb.flowspec.runtime.solver;
import org.immutables.value.Value.Immutable;
import org.immutables.value.Value.Parameter;
@Immutable
public abstract class TupleType extends Type {
@Parameter abstract Type left();
@Parameter abstract Type right();
}
|
C++ | UTF-8 | 1,021 | 3.90625 | 4 | [] | no_license | #pragma once
#include <string>
#include <list>
using namespace std;
/**
* Estructura para representar símbolos de la tabla de cadenas
* list<string> tabla
*/
struct tablacadenas {
list<string> tabla;
/**
* Constructor vacío
* @return tablacadenas
*/
tablacadenas(){}
/**
* Constructor con parám... |
C# | UTF-8 | 4,334 | 2.796875 | 3 | [
"CC0-1.0"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace POOI_Exercices_Supp_Soccer_BL.partie
{
public class Tournoi
{
private List<Partie> m_parties;
private List<StatistiquesEquipePhaseDeGroupe> m_statistiquesPhaseDeGroupe;
public T... |
PHP | UTF-8 | 2,391 | 3.046875 | 3 | [] | no_license | <?php
session_start();//запуск сессии
if ($_SESSION['a']) {
$a = $_SESSION["a"]; // управление сессией, загадывание числа
}
else {
$_SESSION["pop"] = 0; //начало игры, первая попытка
$a = rand(0, 100);//загаданное чило генерирует случайное образом
$_SESSION['a'] = $a;//загаданное число зависит от сессии
echo "ло... |
C# | UTF-8 | 7,533 | 2.515625 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
using ArduinoDriver.SerialEngines;
using ArduinoDriver.SerialProtocol;
using NLog;
namespace ArduinoDriver
{
/// <summary>
/// An ArduinoDriver can be ... |
C | UTF-8 | 2,090 | 3.890625 | 4 | [] | no_license | #include "complex.h"
#include "stdio.h"
/**
* @brief Addition of two Complex Numbers
*
* @param complex_number_1
* @param complex_number_2
* @return complex_t
*/
complex_t sum(complex_t complex_number_1, complex_t complex_number_2)
{
complex_t result;
result.real = (complex_number_1.real + complex_nu... |
C++ | UTF-8 | 3,413 | 2.515625 | 3 | [
"MIT"
] | permissive | #include "drawarea.h"
#include "command.h"
#include "floodfill.h"
#include <QCloseEvent>
#include <QEvent>
#include <QPainter>
#include <algorithm>
namespace DrawApp {
DrawArea::DrawArea(QUndoStack *undoStack, QWidget *parent)
: QWidget(parent), _undoStack(undoStack), _strokeWidth(1),
_strokeColor(Qt::bla... |
Markdown | UTF-8 | 2,964 | 2.578125 | 3 | [] | no_license |
Formats: [HTML](/news/2012/09/17/lawyers-for-the-duke-and-duchess-of-cambridge-begin-civil-proceedings-in-a-french-court-to-halt-further-publication-of-topless-images-of-the.html) [JSON](/news/2012/09/17/lawyers-for-the-duke-and-duchess-of-cambridge-begin-civil-proceedings-in-a-french-court-to-halt-further-publicatio... |
C++ | UTF-8 | 3,067 | 2.75 | 3 | [] | no_license | static const int SHOT_COUNT = 8;
static const pixel_t SHOT_W = 16;
static const pixel_t SHOT_H = 16;
struct CShots : public EntitiesTopleft<SHOT_COUNT> {
int unknown[SHOT_COUNT];
// A shot slot can be considered "alive" if either of these are nonzero.
bool moving[SHOT_COUNT];
unsigned char decay_frame[SHOT_COUNT]... |
Markdown | UTF-8 | 728 | 2.78125 | 3 | [] | no_license | # Arweave Stream
Uses [this gist](https://gist.github.com/CDDelta/e2af7e02314b2e0c3b5f9eb616c645a6) by [CDDelta](https://gist.github.com/CDDelta)
Library for creating, signing and posting transactions using NodeJS streams
## Create, sign and post transaction
```ts
const stream1 = fs.createReadStream("somefile");
c... |
Java | UTF-8 | 1,379 | 3.484375 | 3 | [
"Apache-2.0"
] | permissive | package ru.job4j.createmenu;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
/**
* Class contains root menu elements
* and actions on them.
* @author shaplov
* @since 19.04.2019
*/
public class MenuControl {
private final Consumer<String> output;
/**
* root e... |
Python | UTF-8 | 136 | 2.828125 | 3 | [] | no_license | n,k=map(int,raw_input().split())
m=map(int,raw_input().split())
emp=[]
for a in m:
if a+k<=5:
emp.append(a)
print len(emp)/3 |
Java | UTF-8 | 372 | 1.921875 | 2 | [] | no_license | package com.example.springsecurityguide.repository;
import com.example.springsecurityguide.domain.Member;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
public interface MemberRepository extends JpaRepository<Member, Long> {
... |
Java | UTF-8 | 3,320 | 3.3125 | 3 | [] | no_license | package game;
import java.util.ArrayList;
import java.util.Random;
import edu.monash.fit2099.engine.Actor;
import edu.monash.fit2099.engine.Display;
import edu.monash.fit2099.engine.GameMap;
import edu.monash.fit2099.engine.World;
/**
* Class for adding endings to the world class
* @author Josh
*
*/
... |
Python | UTF-8 | 1,713 | 2.5625 | 3 | [
"MIT"
] | permissive | from django.db import models
from decimal import Decimal
import re
# Create your models here.
def user_exists(email):
return User.objects.filter(email=email).exists()
class Coupon(models.Model):
name=models.CharField(null=False, max_length=100)
def calculate_price(self, original_price):
"""
... |
C++ | UTF-8 | 461 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
using namespace std;
int x, y, c;
int main() {
#ifndef ONLINE_JUDGE
freopen("in", "r", stdin);
#endif
scanf("%d%d%d", &x, &y, &c);
if (x + y < c) {
puts("Impossible");
return 0;
}
if (x >= c) {
printf("%d %d\n", c, 0);
retur... |
JavaScript | UTF-8 | 2,393 | 2.53125 | 3 | [] | no_license | import React from 'react';
import './App.css';
const DropDown = (props) => {
if(props.data === "*"){return null}
if (props.data !== null) {
let label = props.type.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());
let optionsOutput = Object.keys(props.data).m... |
JavaScript | UTF-8 | 823 | 2.6875 | 3 | [
"MIT"
] | permissive | var MessageInput = React.createClass({
getInitialState: function(){
return {
text:"",
// anti-pattern
// user: this.props.user
}
},
handleSubmit: function(e){
e.preventDefault()
var message = {
user: this.props.user,
text: this.state.text,
date: Date.now()
}
this.props.onMessageSubmit(m... |
Python | UTF-8 | 2,261 | 2.671875 | 3 | [
"MIT"
] | permissive | import click
import numpy as np
import pandas as pd
def only(x):
assert len(x) == 1, f"Length is {len(x)}"
return list(x)[0]
click_in_path = click.Path(exists=True, dir_okay=False, resolve_path=True)
click_out_path = click.Path(exists=False, dir_okay=False, resolve_path=True)
@click.command()
@click.argum... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.