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,126 | 2.921875 | 3 | [
"MIT"
] | permissive | import re
import sys
from bs4 import BeautifulSoup
import requests
from epub import Epub
from global_variable import HAS_QT, SENDER, HEADERS
SINGLE_THREAD = False
def get_urls():
"""
Get urls from input or sys.argv
Return:
A string contains urls
"""
for i in sys.ar... |
PHP | UTF-8 | 239 | 3.140625 | 3 | [] | no_license | <?php
function simplecall() {
for ($i = 0; $i < 1000000; $i++)
strlen("hallo");
}
////////
$time_before = microtime(true);
simplecall();
$time_after = microtime(true);
printf('%.7f', $time_after - $time_before);
echo "\n";
?>
|
Python | UTF-8 | 72 | 3.546875 | 4 | [] | no_license | total = 0
for number in range(1, 101):
total += number
print(total) |
C# | UTF-8 | 2,153 | 2.84375 | 3 | [] | no_license | using System;
using System.IO;
using System.Linq;
using EF6Demo.CodeFirst.Entities;
namespace EF6Demo.CodeFirst
{
class Program
{
static void Main(string[] args)
{
//http://blogs.msdn.com/b/dataaccess/archive/2005/10/28/486273.aspx
AppDomain.CurrentDomain.SetData("DataD... |
Java | UTF-8 | 1,129 | 2.453125 | 2 | [] | no_license | package erik.study.net.netty.doc.demo.time.server.handler;
import erik.study.net.netty.doc.demo.time.pojo.UnixTime;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import lombok.ex... |
JavaScript | UTF-8 | 201 | 2.9375 | 3 | [] | no_license | function Mostrar()
{
var num=prompt()
var primo=true
for (i=2; i<num; i++)
{
if (num%i==0)
{
primo=false
break
}
}
if (primo)
{ alert ("Es primo")
}
}//FIN DE LA FUNCIÓN |
Markdown | UTF-8 | 2,817 | 3.453125 | 3 | [] | no_license | +++
date = "2015-10-14T15:05:14-07:00"
title = "Type, *Type, Receivers & Interfaces"
published=true
categories = ["go"]
keywords = ["go"]
tags = ["go"]
image = "images/typewriter-exploded.jpg"
+++
I've recently seen a bit of confusion around types, pointers to types, receivers for the two and interfaces. I'm going to ... |
Java | UTF-8 | 1,966 | 2.078125 | 2 | [] | no_license | package br.com.ilha.bean;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.view.ViewScoped;
import br.com.ilha.model.Produto;
import br.com.ilha.resources.ProdutoResource;
@ManagedBean
@ViewScoped
public class ProdutoBean {
private ProdutoResource produtoResource;
priva... |
TypeScript | UTF-8 | 862 | 2.765625 | 3 | [] | no_license | import { Request, Response } from 'express';
import { addGenre, allGenres } from '../services/genreServices';
async function newGenre(req:Request, res: Response) {
const { name } : {name: string}= req.body;
if(!name ) return res.sendStatus(400);
if(typeof name !== 'string') return res.sendStatus(404);
... |
Java | UTF-8 | 229 | 2.453125 | 2 | [] | no_license | import static java.lang.Math.*;
public class CalcMethod2 implements ICalcMethod {
public double calc(double a, double b, double c, double d) {
return (6 * pow(sin(abs(2*a)), log10(b))) + (sqrt(c*cosh(-d)));
}
}
|
Java | UTF-8 | 2,105 | 3 | 3 | [] | no_license | import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Scanner;
public class Calculator {
public static HashSet<String> setClassName=new HashSet<Stri... |
Java | UTF-8 | 629 | 3.578125 | 4 | [] | no_license | package es2;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class Shuffle {
public static <E> void swap(List<E> a, int i, int j) {
E tmp = a.get(i);
a.set(i, a.get(j));
a.set(j, tmp);
}
public static void shuffle(List<Integer> list, Random rnd) {
for (i... |
Python | UTF-8 | 2,085 | 2.671875 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | """ file: unmarshallers.py (pysiss.vocabulary.gml)
author: Jess Robertson
CSIRO Mineral Resources Flagship
date: Monday 25 August, 2014
description: Unmarshalling functions for GeoSciML/GML objects
"""
from shapely.geometry import Polygon, LineString
from ..namespaces import NamespaceRegis... |
Python | UTF-8 | 1,709 | 3.296875 | 3 | [] | no_license | import tensorflow as tf
"""
https://danijar.com/structuring-models/
"""
class DnCNN(tf.keras.Model):
def __init__(self,depth = 5,grayscale=True):
super(DnCNN,self).__init__()
# Network params
self.channels = 1 if grayscale else 3
self.depth = depth
def call(self,input_tenso... |
Python | UTF-8 | 368 | 2.953125 | 3 | [] | no_license | for t in range(int(input())):
N = int(input())
arr = list(map(int, input().split()))
for i in range(0, N - 1):
if i % 2 == 0:
if arr[i] > arr[i + 1]:
arr[i], arr[i + 1] = arr[i + 1], arr[i]
if i % 2 == 1:
if arr[i] < arr[i + 1]:
arr[i],... |
Python | UTF-8 | 2,500 | 2.8125 | 3 | [] | no_license | import subprocess
import cv2
import os
import argparse
import json
def split_video_to_parts(video_path, out_dir, segment_len_frames, overlap_percent, index_from=0):
filename = os.path.basename(video_path)[:-4]
dir_path = os.path.join(out_dir, filename)
if not os.path.exists(dir_path):
os.makedirs(... |
Java | UTF-8 | 7,818 | 2.34375 | 2 | [
"Apache-2.0"
] | permissive | package at.salzburgresearch.nodekeeper.tests.ruleEngineTests;
import at.salzburgresearch.nodekeeper.eca.*;
import at.salzburgresearch.nodekeeper.eca.function.CurrentNodeData;
import at.salzburgresearch.nodekeeper.eca.function.CurrentNodeLabel;
import at.salzburgresearch.nodekeeper.exception.NodeKeeperException;
import... |
Java | UTF-8 | 1,316 | 2.15625 | 2 | [] | no_license | package org.apache.log4j.jmx;
import com.sun.jdmk.comm.CommunicatorServer;
import com.sun.jdmk.comm.HtmlAdaptorServer;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
import javax.management.ObjectName;
import org.apache.log4j.Category;
import org.apache.log4j.Logger;
public class Age... |
Java | UTF-8 | 1,414 | 2.828125 | 3 | [] | no_license | package events;
import game.Die;
import game.GameData;
public class Nepotism extends Card {
public static int roll;
public static final int[] results = {0, 4, 4, 3, 3, 1, 1};
@Override
public void onEvent(int sp, String[] args) {
roll = new Die().roll();
GameData.dec = new Decision(1, 80);
GameData.txtco... |
C++ | UTF-8 | 993 | 2.578125 | 3 | [] | no_license | #include<SoftwareSerial.h>
#include <Servo.h>
SoftwareSerial BTSerial(10,11); //RX,TX
Servo hand1;
Servo hand2;
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
String dataIn;
int handposR;
void setup() {
pinMode(4, OUTPUT);
digitalWrite(4, LOW);
... |
Java | UTF-8 | 1,738 | 3.40625 | 3 | [] | no_license | public class Main {
//Sorting by counting:Comparison counting
public static void main(String[] args) {
int N = 16;
int[] keys = new int[17];
int[] COUNT = new int[17];
//Prepare the data
keys[1] = 503;
keys[2] = 87;
keys[3] = 512;
key... |
PHP | UTF-8 | 2,612 | 2.90625 | 3 | [] | no_license | <?php
declare(strict_types=1);
use PaulDawson\ContainerTest\Container;
use PaulDawson\ContainerTest\Dummy\Baz;
use PaulDawson\ContainerTest\Dummy\CustomFoo;
use PaulDawson\ContainerTest\Dummy\Foo;
use PaulDawson\ContainerTest\Dummy\Bar;
use PaulDawson\ContainerTest\Dummy\NestedBar;
use PaulDawson\ContainerTest\Dummy\... |
Java | UTF-8 | 127,374 | 1.757813 | 2 | [] | no_license | package com.cloudweb.oa.controller;
import cn.js.fan.db.ListResult;
import cn.js.fan.db.ResultIterator;
import cn.js.fan.db.ResultRecord;
import cn.js.fan.util.DateUtil;
import cn.js.fan.util.ErrMsgException;
import cn.js.fan.util.ParamUtil;
import cn.js.fan.util.StrUtil;
import com.cloudweb.oa.api.IModuleFieldSelectC... |
Python | UTF-8 | 27,967 | 2.828125 | 3 | [
"MIT"
] | permissive |
import numpy as np
from el_geometry import get_extrema_2loops,get_length_c, three_points_to_circle, define_perpendicular_bisector, get_distance_from_line_to_point, get_line_point_nearest2point, two_points_to_line
from math import sin, cos ,sqrt, fabs, atan, tan
import imagetools
import aplpy
from scipy.optimize... |
Rust | UTF-8 | 3,660 | 2.953125 | 3 | [] | no_license | use crate::pokemon::{ReadRequest, ReadResponse, WriteRequest, WriteResponse, p2p_server::P2p};
use tonic::{Request, Response, Status};
use tokio::sync::mpsc::UnboundedSender;
use std::sync::mpsc::channel;
use crate::model::{Commands, Responses};
//use crate::node::*;
//use libp2p::request_response::channel;
//use hell... |
C++ | UTF-8 | 1,085 | 2.859375 | 3 | [] | no_license | #include "SDL.h"
#include "Game.h"
Game* game = nullptr;
int main(int argc, char* argv[]) {
/*
// Draw a green window for 3 seconds
SDL_Init(SDL_INIT_EVERYTHING);
SDL_Window* window = SDL_CreateWindow("title", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 600, 400, SDL_WINDOW_SHOWN);
SDL_Renderer* renderer = ... |
PHP | UTF-8 | 769 | 2.546875 | 3 | [] | no_license | <?php
session_start();
mysql_connect("localhost","root","");
mysql_select_db("tg");
if(isset($_REQUEST["enrollment_no"]))
{
$enrollment_no=$_REQUEST["enrollment_no"];
echo $enrollment_no;
}
if(isset($_REQUEST["submit"]))
{
$entrance=$_REQUEST["entrance"];
//$admissionbase=$_REQUEST["admissionbase"];
//$schoo... |
Python | UTF-8 | 965 | 3.421875 | 3 | [] | no_license | class Game(object):
"""
This class controls a game and takes the logic to decide who wins
"""
def __init__(self, id_, player1, player2):
self.id = id_
self.player1 = player1
self.player2 = player2
self.is_done = False
self.winner = None
def set_winner(self):
... |
C++ | UTF-8 | 710 | 2.875 | 3 | [] | no_license | #include "Menor.h"
#include "ingreso.h"
string Menor::getMenor()
{
return menor;
}
void Menor::setMenor(string newMenor)
{
this->menor = newMenor;
}
void Menor::calcularMenor(int num_palabras)
{
string menor = "";
char primeraLetra;
string primeraPalabra;
string palabra;
string* palabras = new string[num_palab... |
JavaScript | UTF-8 | 2,406 | 2.515625 | 3 | [] | no_license | const width = 400;
const height = 400;
const dirName = "temp";
const { spawn } = require("child_process");
const chrome =
"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe";
const WebSocket = require("ws");
const args = [
"--no-first-run", //ようこそみたいなのが表示されるのを防止
"--disable-default-apps",... |
Java | UTF-8 | 747 | 3.375 | 3 | [] | no_license | public class Vector {
float x;
float y;
float z;
public Vector(float x, float y, float z){
this.x = x;
this.y = y;
this.z = z;
}
public Vector difference(Vector aVec){
float x = this.x - aVec.x;
float y = this.y - aVec.y;
float z = this.z - aVec.z;
return new Vector(x, y, z);
}
... |
Python | UTF-8 | 1,677 | 3.609375 | 4 | [] | no_license | # The socket Lib basically allows us establish
# A connection over the internet
import socket
# Install IPy using pip3 install IPy
# Use apt install python3-pip to install pip3
from IPy import IP
def scan(target):
converted_ip = check_ip(target)
print('\n' + '^_^ Scanning Target ^_^ ' + str(target))
for p... |
C# | UTF-8 | 1,532 | 2.953125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Check Property is used to validate field using other filds.
/// </summary>
[AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = true)]
public class vCheckPropertyAttribute : PropertyAttribute
{
[Serializable]... |
Java | UTF-8 | 971 | 2.078125 | 2 | [] | no_license | package com.pk.et.infra.util;
public class JSONRequest {
private boolean search;
private int page;
private int rows;
private String sortField;
private String sortOrder;
private SearchFilter searchFilter;
public boolean isSearch() {
return search;
}
public void setSearch(boolean search) {
this.search = s... |
Java | UTF-8 | 1,888 | 2.546875 | 3 | [] | no_license | package com.example.aet.data;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.UUID;
import com.example.aet.R;
/**
* @author swordy
* @email mryangjian@live.com
* @since Jan 20, 2014
* @version 1.0
*/
public class SimulateData extends BaseInfo{
public stat... |
C# | UTF-8 | 909 | 2.90625 | 3 | [
"MS-PL"
] | permissive | using System;
namespace Microsoft.Msagl.Drawing
{
/// <summary>
/// Size structure
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes"), Serializable]
public struct Size
{
double width;
/// <sum... |
Python | UTF-8 | 249 | 3.21875 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# https://leetcode.com/problems/find-the-difference/
# 1. get the length of s, and return the t[len+1:]
# s = "abcd"
# t = "abcde"
s = "ymbgaraibkfmvocpizdydugvalagaivdbfsfbepeyccqfepzvtpyxtbadkhmwmoswrcxnargtlswqemafandgkmydtimuzvjwxvlfwlhvkrgcsithaqlcvrihrwqkpjdhgfgre... |
Java | UTF-8 | 2,666 | 2.25 | 2 | [] | no_license | package com.test.demo.test.apiDemo.fragments;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.wid... |
Java | UTF-8 | 1,528 | 2.359375 | 2 | [] | no_license | package com.example.murodjonrahimov.hackathon.model;
/**
* Created by c4q on 3/3/18.
*/
public class TennisCourt {
private String Name;
private String Location;
private int image;
private String Phone;
private String Courts;
private String Indoor_Outdoor;
private String Tennis_Type;
... |
C++ | UTF-8 | 572 | 3.28125 | 3 | [] | no_license | /**
* https://leetcode.com/problems/find-all-duplicates-in-an-array/description/
* 2017/02
* 129 ms
*/
class Solution
{
public:
vector<int> findDuplicates(vector<int> & nums)
{
int n = nums.size();
vector<int> dups;
for(int idx = 0; idx < n; idx ++)
{
int counter... |
Python | UTF-8 | 3,204 | 2.78125 | 3 | [] | no_license | from . import (particle_dist, particle_is_compatible, particle_merge,
particle_evolve_up_to, contract, np, aer_particle)
class ParticleTracker():
""" A class that tracks a set of particles for one frequency. """
@contract(max_vel='>0', max_bound='>0')
def __init__(self, max_vel, max_bound):
... |
Python | UTF-8 | 413 | 3.421875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from __future__ import division
a=int(input('insira o valor de a:'))
b=int(input('insira o valor de b:'))
c=int(input('insira o valor de c:'))
cont=0
p=0
while p<=c:
q=1
while q<=c:
if c==((p*a)+(q*b)):
m=p
n=q
cont=cont+1
bre... |
C++ | UTF-8 | 2,857 | 2.9375 | 3 | [] | no_license | /*
* Console.cpp
*
* Created on: 18 de ago de 2016
* Author: doreis
*/
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string> // std::string
#include <iostream> // std::cout
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <Service/Convert.h>
#include "Conso... |
Go | UTF-8 | 3,221 | 3.015625 | 3 | [] | no_license | package main
import (
"fmt"
"log"
"sync"
"time"
"github.com/google/uuid"
pb "github.com/MarcGrol/go-training/examples/grpc/streaming/flightinfoapi"
)
const (
maxOutstandingCount = 100
)
type session struct {
uid string
internalChannel chan pb.Flight
externalChannel chan pb.Acknowl... |
Python | UTF-8 | 1,517 | 3.59375 | 4 | [] | no_license | # This file communicates with the load Arduino.
# The format for this is:
# setup by sending "L C R;"
# reset by sending "<char>"
import time
import serial
class LoadControl:
def __init__(self, device):
"""Open a specific device as a load controller. Device is
a tupl... |
Python | UTF-8 | 123 | 3.4375 | 3 | [] | no_license | x=input("enter some value:")
if x/2==0:
print("enterd value is zero")
else:
print("the enterd value is non-zero")
|
PHP | UTF-8 | 1,788 | 2.53125 | 3 | [] | no_license | <?php
namespace Test\ItemTest;
use App\Controller\GildedRose;
use App\Model\Item\Item;
use App\Model\Item\ItemTypes\ItemNormal;
use App\Model\ItemManager;
use PHPUnit\Framework\TestCase;
class ItemNormalTest extends TestCase
{
private $itemManager;
private $gildedRose;
public function setUp()
{
... |
JavaScript | UTF-8 | 5,178 | 2.578125 | 3 | [] | no_license | import { createSlice } from '@reduxjs/toolkit'
import { api } from 'api/index'
import { getLoggedInUserInfo } from 'utils/index';
const imagesSlice = createSlice({
name: 'images',
initialState: {
images: [],
isImagesLoading: false,
error: false
},
reducers: {
startLoadin... |
Markdown | UTF-8 | 1,662 | 3.484375 | 3 | [] | no_license | ---
title: Algorithmique -- MergeSort
author: Romain Gille
date: 30/03/2016
geometry: margin=1in
...
\newpage
# Dernier tri de tableau : MergeSort (tri fusion)
* Tri optimal (non stochastique) : $\Theta(n \log n)$
* Copie du tableau (ne trie pas "sur place")
* Approche "Diviser pour régner" (idem QuickSort)
```java... |
Python | UTF-8 | 599 | 2.78125 | 3 | [] | no_license | import sys
from heapq import heappush, heappushpop
X, Y, Z = map(int, input().split())
xyz = sorted([list(map(int,l.split()))for l in sys.stdin],key=lambda x:x[0]-x[1])
uq = []
cy = 0
for x, y, z in xyz[:Y]:
heappush(uq, y - z)
cy += y
Ly = [cy]
for x, y, z in xyz[Y:Y+Z]:
cy += y - heappushpop(... |
JavaScript | UTF-8 | 853 | 2.796875 | 3 | [
"MIT"
] | permissive | 'use strict';
function json(data, type) {
if ('application/json' !== type) {
throw new Error('Unsupported Content-Type: ' + type);
}
return JSON.parse(data);
}
function form(data, type) {
if ('application/form-data' !== type) {
throw new Error('Unsupported Content-Type: ' + type);
}
var payload ... |
C# | UTF-8 | 592 | 2.96875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
namespace day18
{
public struct Edge
{
public string Name;
public char[] Doors;
public int Cost;
public Edge(string name, RetraceData retraceData)
{
Name = name;
Doors = retraceD... |
Markdown | UTF-8 | 2,850 | 3.125 | 3 | [] | no_license | ---
layout: post
title: "Spark-Streaming day 5 (spark streaming window)"
date: 2018-06-15 08:44:17 +0800
categories: Spark-Streaming
---
#### 目標
算出每個時間區間的總數
#### StreamingWindowTest.scala
spark-streaming 每 5 秒觸發一次,
使用 reduceByWindow 這 function 會給 2 個參數,第一個是 window length,第二個是 sliding interval.
這邊的例子就是每 5 秒計算一次 10... |
PHP | UTF-8 | 3,029 | 2.921875 | 3 | [] | no_license | <?php
/**
* Contact.php
*
* Copyright (c) 2009 Fraise, Inc.
* All rights reserved.
*/
/**
* ユーザー側問い合わせクラス
* 問い合わせを管理するクラス
*
* @copyright 2009 Fraise, Inc.
* @author mitsuhiro nakamura
*/
class Contact extends ComCommon {
const SEND_MAIL_ADDRESS_ACCOUNT = "info@";
/** @var string エラーメッセージ ... |
Java | UTF-8 | 431 | 2.234375 | 2 | [] | no_license | //@author A0080415N
//Name : Steven Kester Yuwono
//Matric No. : A0080415N
//com.licensetokil.atypistcalendar.parser
package com.licensetokil.atypistcalendar.parser;
public class SyncGoogleAction extends GoogleAction{
public SyncGoogleAction(){
type = GoogleActionType.GOOGLE_SYNC;
}
publi... |
Rust | UTF-8 | 5,825 | 3.375 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | use {crate::ui::layout, reclutch::display as gfx};
/// A 2D position based on a relative offset and an absolute offset.
/// The `relative` offset is expressed as a fraction of the corresponding parent dimension for each component in `(x, y)`.
/// The `post_relative` offset is expressed as a fraction of the result of t... |
Java | UTF-8 | 866 | 3.0625 | 3 | [] | no_license | package teel;
import java.util.Arrays;
public class NumberOfLongestIncreasingSubsequences {
public int findNumberOfLIS(int[] nums) {
if (nums.length == 0) return 0;
if (nums.length == 1) return 1;
int []counts = new int [nums.length];
int []lengths = new int [nums.length];
Arrays.fill(counts, 1);
f... |
Java | UTF-8 | 1,971 | 4 | 4 | [] | no_license | package hu.bp.concurrency.visibility;
/**
* The following class demonstrates the visibility issue in multi-threaded Java
* programs.
*
* The main thread starts a new thread and then changes the stopperFlag variable
* to false. The other thread monitors this flag and if it becomes false, then
* it exits the whil... |
Java | UTF-8 | 1,094 | 2.03125 | 2 | [] | no_license | package spartons.com.frisbee.di.modules;
import dagger.Module;
import dagger.Provides;
import spartons.com.frisbee.collections.DriverCollection;
import spartons.com.frisbee.collections.MarkerCollection;
import spartons.com.frisbee.di.scopes.CustomApplicationScope;
import spartons.com.frisbee.repo.DriverRepo;
import sp... |
Rust | UTF-8 | 704 | 2.96875 | 3 | [] | no_license | use std::fmt::{self, Display};
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug)]
pub enum Error {
BadIdentity,
#[cfg(feature = "json")]
Serialisation(serde_json::Error),
}
impl Display for Error {
fn fmt(&self, w: &mut fmt::Formatter) -> fmt::Result {
use Error::*;
... |
Markdown | UTF-8 | 1,963 | 2.828125 | 3 | [] | no_license | #jQuery.RSlide
A simple, auto slide animation jQuery plugin for Desktop and Mobile
####Include
```javascript
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
```
#... |
C | UTF-8 | 20,492 | 2.953125 | 3 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <fcntl.h>
typedef struct{
char color[100];
}colores;
typedef struct{
char numero[100];
}numeros;
void crearArchivo(int jugador,c... |
C# | UTF-8 | 1,022 | 3.15625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
// Adding a System.Configuration namespace and reference allows us to connect to the Northwind database.
namespace Northwind.DataLayer.Config
{
public static class Settin... |
Markdown | UTF-8 | 881 | 2.671875 | 3 | [] | no_license | ## Setting up the virtual environemnt
Run the following commands in terminal
```
pipenv --three
pipenv install
pipenv shell
cd ./server
```
This will set-up the virtual environment for the file.
## Running the code
1. To start the database run the following command in terminal:
```npm run database```
2. Open another t... |
Markdown | UTF-8 | 1,825 | 2.671875 | 3 | [] | no_license | ---
title: 5 questions from kendokamel
author: Matt Stratton
layout: post
date: 2004-02-05T18:04:00+00:00
url: /life-in-general/5-questions-from-kendokamel
dsq_thread_id:
- 28239508
categories:
- Personal
---
As asked by :
_1. How did you first get involved in filmmaking?_
I studied theatre at <a href="https://w... |
Java | UTF-8 | 623 | 3.5625 | 4 | [] | no_license | public class RotateLeft {
public static void main(String[] args) {
rotateLeft(5, 4, new int[]{1, 2, 3, 4, 5});
}
static void rotateLeft(int n, int k, int[] arr) {
if (arr.length == 1)
System.out.print(arr[0]);
else if (arr.length > 1) {
int amountToRotate = k... |
Markdown | UTF-8 | 1,227 | 2.953125 | 3 | [] | no_license | # Progressive-Budget
# by Merdad Karkudi
# project repository link :
https://github.com/mkarkuody/Progressive-Budget
# Screenshots
<img src="Screenshot.jpg">
# demo video link :
# as a user;
I want to be able to track my expenses to make sure I don't go over my budget also to be able to track my withdrawals and depo... |
Java | UTF-8 | 163 | 1.914063 | 2 | [] | no_license | package com.example.jose.week1daydemo;
public class SampleClass {
public static void main(String[] args){
System.out.println("Hello There!");
}
}
|
Shell | UTF-8 | 911 | 3.359375 | 3 | [] | no_license | #!/bin/bash
/bin/mkdir -p /mnt/aws-codecommit-keys
while read username; do
random_pass=`openssl rand -base64 10`
echo $random_pass
ssh-keygen -t rsa -N "${random_pass}" -C "codecommit-${username}" -f /mnt/aws-codecommit-keys/${username}-key
pub_key=`cat /mnt/aws-codecommit-keys/${usern... |
Java | UTF-8 | 2,608 | 2.734375 | 3 | [] | no_license | package cn.lunzn.util;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import cn.lunzn.common.constant.Constant;
import cn.lunzn.common.enums.CommonResultCode;
import cn.lunzn.common.exception.MyRuntimeException;
import cn.lunzn.model.user.Employee;
/**
* @author clar... |
C | UTF-8 | 147 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
printf("%d",(int)(a * 0.2 + b * 0.3 + c * 0.5));
return 0;
} |
JavaScript | UTF-8 | 338 | 3.21875 | 3 | [] | no_license | char firstNotRepeatingCharacter(String s) {
int[] ascii = new int[256];
for(int i = 0; i < s.length(); ++i){
int numAsc = (int) s.charAt(i);
ascii[numAsc]++;
}
for(int x = 0; x < s.length(); ++x){
if(ascii[(int) s.charAt(x)] == 1){
return s.charAt(x);
}
}
... |
Java | UTF-8 | 638 | 2.0625 | 2 | [] | no_license | package com.fluidpay.sdk.models.customers;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* response from getting all of the customer's address tokens
*/
public class CustomerAddressesResponse {
private String status;
private String msg;
private CustomerAddressResponseData[] data;
@JsonPr... |
Ruby | UTF-8 | 3,671 | 3.984375 | 4 | [] | no_license | require 'active_support/all'
require './human.rb'
require './computer.rb'
class Game
attr_accessor :board, :side
def initialize
puts "Let's play Tic Tac Toe!"
set_up_game
end
def set_up_game
create_board
get_players
play_game
end
def get_players
puts "Would you like to play again... |
JavaScript | UTF-8 | 897 | 2.65625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
*
* HomePage reducer
*
*/
import { fromJS } from 'immutable';
import {
DEFAULT_ACTION,
GET_PHOTOS_ERROR,
GET_PHOTOS_SUCCESS,
GET_PHOTOS_REQUEST,
SET_PHOTOS
} from './constants';
const initialState = fromJS({
loading: false,
error: null,
photos: []
});
function homePageReducer(state = initialS... |
Java | UTF-8 | 2,258 | 2.140625 | 2 | [] | no_license | package com.cyztc.app.views.knowledge.adapter;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.cyztc.app.R;
import com.cyztc.app.adapter.BaseDataAdapter;
import com.cyztc.app.bean.BaseBean;
import com.... |
Java | UTF-8 | 1,299 | 1.84375 | 2 | [] | no_license | package com.kayak.qa.pages;
import com.kayak.qa.util.TestBase;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class SearchPage extends TestBase {
@FindBy(xpath="//div[@class='js-selection _iaf _idA _idj _iai _ia4 _iiM _ibc _... |
Java | UTF-8 | 110 | 1.75 | 2 | [] | no_license | package com.xworkz.equals.object_method;
public enum BagColor {
BLUE,BROWN,BLACK,GREEN,RED,YELLOW;
}
|
Java | UTF-8 | 15,338 | 1.6875 | 2 | [
"MIT"
] | permissive | package com.sciome.bmdexpress2.service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.commons.math3.util.Precision;
import com.sciome.bmdexpress2.mvp.model.DoseResponseExperiment;
import com.sciome.bmdexpress2.... |
SQL | UTF-8 | 6,113 | 2.859375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: ezeebizdb
-- ------------------------------------------------------
-- Server version 5.5.59
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/... |
Python | UTF-8 | 90 | 2.640625 | 3 | [] | no_license | def average_mark(*args):
average = sum(args) / len(args)
return round(average, 1)
|
JavaScript | UTF-8 | 2,138 | 3.5 | 4 | [] | no_license | let correct = Math.round(Math.random() * 10);
let retry = 3;
function loadEventListeners(){
const submit = document.querySelector("#submit");
submit.addEventListener("click", handleSubmit);
}
const handleSubmit = ()=>{
const input = document.querySelector("#input");
if(retry > 0)
{
if(... |
JavaScript | UTF-8 | 1,962 | 3.21875 | 3 | [] | no_license | function add(a, b) {
return a + b;
}
function sub(a, b) {
return a - b;
}
function mul(a, b) {
return a * b;
}
function div(a, b) {
return a / b;
}
function operator(x, y, op) {
switch (op) {
case "+":
return add(x, y);
break;
case "-":
... |
Java | UTF-8 | 4,998 | 2 | 2 | [] | no_license | package com.example.ole.oleandroid.controller;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.support.design.widget.TextInputEditText;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
impo... |
JavaScript | UTF-8 | 1,998 | 3.03125 | 3 | [] | no_license | function bin2ascii(array) {
var result = [];
for (var i = 0; i < array.length; ++i) {
result.push(String.fromCharCode( // hex2ascii part
parseInt(
('0' + (array[i] & 0xFF).toString(16)).slice(-2), // binary2hex part
16
)
));
}
retu... |
Java | UTF-8 | 1,370 | 1.898438 | 2 | [] | no_license | package com.sabrewinginfotech.reesguru.fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.sabrewinginfotech.reesguru.MainActivity;
import com.sa... |
Java | UTF-8 | 2,682 | 4 | 4 | [] | no_license | package _09_loops.java;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class _02_for {
public static void main(String[] args) {
// //TODO: If you've never done for loops, you will need a lot of practice. We recommend you study these
// until you can do one without ... |
PHP | UTF-8 | 4,419 | 2.828125 | 3 | [] | no_license | <?php defined('SYSPATH') or die('No direct script access.');
/**
* Class Widget
* Базовый класс виджета
* Фабрика виджетов
*
*/
class Widget {
protected $_controllers_folder = 'widgets'; // Название папки с контроллерами виджетов
protected $_config_filename = 'widgets'; // Название файла конфи... |
C++ | UTF-8 | 2,779 | 2.6875 | 3 | [] | no_license | #ifndef __UITEXTTEST_H
#define __UITEXTTEST_H
#include <cxxtest/TestSuite.h>
#include <UI/UIText.h>
#include <ResourceManager/ResourceManager.h>
#include <Renderer/SDLRenderer.h>
//
// A generated test suite: Just write tests!
//
class UITextTest : public CxxTest::TestSuite
{
private:
// any variabl... |
C# | UTF-8 | 1,463 | 2.984375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Newton.Data
{
/// <summary>
/// Class representing a structure key pair logger
/// </summary>
public abstract class StructuredLogger<T> : ILogger<T>
where T : class
{
#region... |
Markdown | UTF-8 | 7,198 | 3.0625 | 3 | [] | no_license | ---
layout: post
title: 《小狗钱钱》读书笔记
date: 2018-07-01 17:34:11.000000000 +09:00
category: Finance
tags: Notes
---
## 童话与理财
如果你想富有,请把自己变成一个小孩,因为小孩子的框框最少,他们诚实、快乐、乐于学习。
## 前言
1. 我们常常会过于迅速地得出结论:“这我已经知道了。”似乎认识几个关键词就足够了。这种想法很可能是一个陷阱,因为当我们发现对要学的东西早已熟悉时,可能就不会继续学习下去。因为我们觉得自己已经知道了,所以就对这些信息不再感兴趣。
2. 忽视财务问题,就是放弃成功的机会。财务自由是今天每个人都可能实... |
C | UTF-8 | 3,716 | 2.65625 | 3 | [
"Apache-2.0",
"MIT"
] | permissive |
#include <sightglass.h>
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SLOTS_LEN 100000
#define PERIOD 1000
#define PEAK 10
#define ITERATIONS 1000000
typedef struct RateLimiter_
{
unsigned int *slots;
uint64_t v0, v1;
size_t slots_mask;
si... |
Java | UTF-8 | 410 | 2.25 | 2 | [] | no_license | package org.cougaar.tools.techspecs.qos;
/**
* Similar to a delay measurement point, but useful for "tagging" individual elements.
* This is the same as the DelayMeasurementPoint, just plotted differently (e.g. a single bar
* per event.)
*/
public class EventDurationMeasurementPoint extends DelayMeasurementPoint
{... |
Markdown | UTF-8 | 2,953 | 2.765625 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: "The AppDevs are idiots"
date: 2013-12-20 23:28
comments: true
categories:
---
In my many years of Enterprise DBA servitude, there would be many instances of blanket 'the devs are idiots' statements. Sometimes by me, sometimes by others and from the perspective of the database it was usually ju... |
Markdown | UTF-8 | 8,920 | 2.96875 | 3 | [] | no_license | # Fun with Socket.io
## Step 1: Create app using express generator:
```bash
npx express-generator -v ejs socket-io
```
<br>
## Step 2: Rename app.js to server.js and adjust the bin/www file.
<br>
## Step 3: Install the socket.io node module:
```bash
npm i socket.io
```
<br>
## Step 4: Create a chat.js file tha... |
Java | UTF-8 | 5,705 | 1.921875 | 2 | [
"Apache-2.0"
] | permissive | package com.vaadin.server;
/*
* Copyright 2000-2014 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required... |
PHP | UTF-8 | 469 | 2.640625 | 3 | [] | no_license | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Support\Collection;
/**
* @method static self find(int $id)
* @property string $name
* @property Collection|Item[] $items
*... |
Java | UTF-8 | 4,489 | 2.9375 | 3 | [
"MIT"
] | permissive | package com.innovationchef.strategy;
import com.innovationchef.constant.Direction;
import com.innovationchef.gameplay.TrackVisit;
import com.innovationchef.model.Coordinate;
import com.innovationchef.model.Grid;
import lombok.ToString;
import java.util.Comparator;
import java.util.stream.Stream;
/**
* If the player... |
Java | UTF-8 | 2,454 | 2.515625 | 3 | [] | no_license | package sfs;
import dfsexceptions.DataBaseDfsException;
import sfs.storage.StorageManagerException;
import sfs.storage.Storage;
import sfs.stream.RemoteInFile;
import java.io.IOException;
import manager.dbmanager.DBManager;
import org.junit.Test;
import sfs.storage.StorageManager;
import static org.junit.Assert.*;
/*... |
C++ | UTF-8 | 11,052 | 2.671875 | 3 | [] | no_license | // The Screen class is a derivative of Window that writes the resulting
// data onto the physical screen
#include <sys/ioctl.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/uio.h>
#include <sys/socket.h> // Some libc/linux versions seem to have iovec there :(
#include "mcl.h"
#include "cui.h"
#include "Buffer.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.