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 |
|---|---|---|---|---|---|---|---|
PHP | UTF-8 | 892 | 2.640625 | 3 | [] | no_license | <?php
include_once ($_SERVER['DOCUMENT_ROOT'].'/ProjektiF/models/userMapper.php');
include_once ($_SERVER['DOCUMENT_ROOT'].'/ProjektiF/models/userModel.php');
class UserController
{
public function InsertUser($username,$email, $passwordU, $roli)
{
//therrasim funksionet qe bejne kalkulimin e kerkeses
... |
Java | UTF-8 | 1,186 | 1.953125 | 2 | [] | no_license | package com.snda.grand.mobile.as.rest.model;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.joda.time.DateTime;
@JsonIgnoreProperties(ignoreUnknown=true)
public class Authorization {
private String uid;
private String appId;
private String refreshToken;
private DateTime authorizedTime;
p... |
C# | UTF-8 | 2,098 | 2.84375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace FetchCurrentWeather
{
public class UazipnetRegionParser : IRegionParser
{
p... |
Markdown | UTF-8 | 963 | 3.53125 | 4 | [] | no_license | # JavaScript and DOM Manipulation
## Overview
This project takes UFO sighting data (including date, location and observations) and uses javascript to populate an HTML table. The table is filterable for select columns of the table.
### Level 1: Automatic Table and Date Search
* Creates a basic HTML web page.
* Uses ... |
Java | UTF-8 | 822 | 2.34375 | 2 | [] | no_license | package de.entrecode.datamanager_java_sdk.requests.tags;
import com.squareup.okhttp.Request;
import de.entrecode.datamanager_java_sdk.requests.ECDeleteRequest;
/**
* Created by simon, entrecode GmbH, Stuttgart (Germany) on 10.09.15.
*/
public class ECTagDeleteRequest extends ECDeleteRequest {
private final Stri... |
C++ | UTF-8 | 630 | 2.6875 | 3 | [
"MIT"
] | permissive | #pragma once
#include <memory>
class BaseMaterial;
class Vector;
class RNG;
class Ray;
class Object
{
public:
std::shared_ptr<BaseMaterial> material;
Object();
Object(std::shared_ptr<BaseMaterial> mat): material(mat) {}
virtual float intersect(const Ray& ray) const = 0;
virtual Vector getNormalAt(const V... |
Java | UTF-8 | 1,556 | 2.84375 | 3 | [] | no_license | package es.iespuertolacruz.developers.api;
import java.util.Objects;
public class Mercado {
Moneda moneda;
Wallet wallet;
Double cantidad;
/**
* Constructor vacio
*/
public Mercado() {
}
/**
* Constructor con todos los parametros de Mercado
* @param moneda
... |
Ruby | UTF-8 | 958 | 4.5 | 4 | [] | no_license | # Reversed Arrays (Part 2)
#
# Write a method that takes an Array, and returns a new Array with the elements of the original list in reverse order. Do not modify the original list.
#
# You may not use Array#reverse or Array#reverse!, nor may you use the method you wrote in the previous exercise.
def reverse(array)
r... |
Markdown | UTF-8 | 6,465 | 3.84375 | 4 | [] | no_license | ## 1920. 수찾기
전형적인 이분 탐색 문제
A배열을 정렬하고 M개의 숫자를 받을 때마다 이분탐색을 실행해서 해당 숫자가 존재하는지 아닌지를 판단했다.
```cpp
bool binary_search(int num){
int left = 0, right = n;
while(left <= right){
int mid = (left+right)/2;
if(arr[mid] == num)
return true;
if(arr[mid] <= num){
left = mid +... |
Java | UTF-8 | 2,226 | 3.4375 | 3 | [] | no_license | import java.util.Scanner;
/*
Sample Input :
2
3 <-no of bags
3 <- max capacity (weight)
1 2 3 <-weights
2 4 8 <-values
4
8
2 4 5 7
4 9 7 5
Sample output :
8
13
*/
public class Knapsack {
public static void main(String args[]) throws Exception {
//System.out.println(getCommon("ADDA","BDAA"));
... |
Markdown | UTF-8 | 7,321 | 2.5625 | 3 | [] | no_license | <ul id="nav">
<li class="nav_element" id="nav_Dom">
<a href="/Dom%26%23367%3B.htm" class="menu">Domů</a></li>
<li class="nav_element" id="nav_Manipultorznakyobrana">
<a href="/Manipul%E1tor-_-znaky%2C-obrana%2C-.--.--.-.htm" class="menu">Manipulátor - znaky, obrana,...</a></li>
<li class="nav_element" id="nav... |
PHP | UTF-8 | 5,521 | 2.90625 | 3 | [
"MIT"
] | permissive | <?php
namespace Wn\GitSplitter;
/**
* The entry point
*
* @param array $config
* @param array $args
* @return void
*/
function run($config, $args) {
echo shell_exec(handle($config, $args));
}
/**
* generates the shell code to be executed according to given arguments.
*
* @param array $config
* @param... |
Markdown | UTF-8 | 4,822 | 2.890625 | 3 | [
"BSD-2-Clause"
] | permissive | # Nginx Html Head Filter
A Simple Nginx Response Body Filter Module
## Introduction
The repository contains an Nginx Resonse Body Filter Module that will filter a HTTP response and insert a specific text string
after the html <head> tag. For example, it can insert a monitoring javascript after the <head> ... |
Python | UTF-8 | 7,444 | 2.890625 | 3 | [
"MIT"
] | permissive | '''
Class BLayerNormalizedLSTMCell:
Two parallele Layer Norm LSTM cell blocks that
share the same weights for each channel
Class LayerNormalizedLSTMCell:
adapted from BasicLSTMCell to use Layer Norm
'''
import numpy as np
import tensorflow as tf
import ipdb
from tensorflow.python.util import nest
from tenso... |
C++ | UTF-8 | 3,453 | 3.53125 | 4 | [] | no_license | //QCMs grid demo example for SFML & replit
#include <SFML/Graphics.hpp>
#include <cstdlib> // For rand() and srand()
#include <ctime> // For time()
#include <chrono> // For std::chrono
#include <thread> // For std::this_thread::sleep_for
int main()
{
// Seed the random number generator
std::srand(static_ca... |
Java | UTF-8 | 3,097 | 2.25 | 2 | [
"Apache-2.0"
] | permissive | package com.github.kubenext.uaa.service.mapper;
import com.github.kubenext.uaa.domain.Authority;
import com.github.kubenext.uaa.domain.User;
import com.github.kubenext.uaa.service.dto.CreateUserDTO;
import com.github.kubenext.uaa.service.dto.UpdateUserDTO;
import com.github.kubenext.uaa.service.dto.UserDTO;
import org... |
Markdown | UTF-8 | 916 | 2.953125 | 3 | [] | no_license | ## G.2 All Our ideas
### 
**Figura G.2.0:** Portada de [http://allourideas.org/](http://allourideas.org/)
*Cómo funciona una Encuesta Wiki*
1. *Crear: Empieza con una pregunta y unas ideas semilla, y puedes crear una encuesta wiki en un instante.*
2. *Participa: Los participantes qu... |
JavaScript | UTF-8 | 8,624 | 2.796875 | 3 | [] | no_license | import { Game } from "../../../src/server/model/game";
import { GameHand } from "../../../src/common/model/game-hand.model";
import { Card } from "../../../src/common/model/card.model";
import { Player } from '../../../src/common/model/player.model';
describe('Game Server Model', () => {
let game;
let playerDea... |
JavaScript | UTF-8 | 1,749 | 2.953125 | 3 | [
"MIT"
] | permissive | let buttonUserName = document.getElementById('id-button-username')
let userName = document.getElementById('userName')
let repeatUserName = document.getElementById('repeatUserName')
let oldPasswordUserName = document.getElementById('oldPasswordUserName')
let errorNewUserName = document.getElementById('errorNewUserName')... |
Markdown | UTF-8 | 7,959 | 3.375 | 3 | [] | no_license | ---
id: 1799
title: Writing unit test for Android with Easymock
date: 2013-11-07T00:44:53+00:00
author: adrian.ancona
layout: post
guid: http://ncona.com/?p=1799
permalink: /2013/11/writing-unit-test-for-android-with-easymock/
tags:
- android
- java
- mobile
- programming
- testing
---
I already wrote a post ... |
Java | UTF-8 | 2,070 | 2.3125 | 2 | [] | no_license | package com.example.sonu.jaquar.Models;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.constraint.ConstraintLayout;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.o... |
Java | UTF-8 | 1,840 | 3.09375 | 3 | [] | no_license |
package paquete1;
public class Estudiante {
// 1. Declarar
// se declaran datos o atributos con visibilidad protegido
// # nombresEstudiante: Cadena
protected String nombresEstudiante;
// # apellidosEstudiante: Cadena
protected String apellidosEstudiante;
// # identificacionEstudiante: Ca... |
C# | UTF-8 | 4,733 | 3.34375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
namespace Euro_diffusion
{
public static class UI
{
public static List<string[]> ConsoleReader()
{
Console.WriteLine($"Enter number of countries from {Constants... |
Python | UTF-8 | 2,028 | 4.1875 | 4 | [
"BSD-2-Clause"
] | permissive | """
Design a class to find the kth largest element in a stream. Note that it is the kth largest element
in the sorted order, not the kth distinct element. Your KthLargest class will have a constructor which
accepts an integer k and an integer array nums, which contains initial elements from the stream. For each
call... |
Java | UTF-8 | 1,339 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | package io.github.dunwu.tool.lang;
import io.github.dunwu.tool.text.StrSpliter;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.List;
/**
* {@link StrSpliter} 单元测试
*
* @author Looly
*/
public class StrSpliterTest {
@Test
public void splitByCharTest() {
... |
C++ | UTF-8 | 1,880 | 2.625 | 3 | [
"MIT"
] | permissive |
#include "WAVReader.h"
#include "AudioFile.h"
#include <stdint.h>
#include <string>
#include <stdlib.h>
AudioFile* WAVReader::getRawAudio(const char* relative_path, FILE* file){
//FILE* fp = fopen(fname,"rb");
if (file) {
char id[5];
short* bufferData;
unsigned long size;
sho... |
Swift | UTF-8 | 3,522 | 2.953125 | 3 | [
"MIT"
] | permissive | //
// CubicCurvedPath.swift
// Bezier
//
// Created by Чингиз Б on 02.07.17.
// Copyright © 2017 Y Media Labs. All rights reserved.
//
import UIKit
class CubicCurvedPath {
private var data: [CGPoint] = []
init(data : [CGPoint]) {
self.data = data
}
required init?(code... |
Python | UTF-8 | 11,510 | 2.75 | 3 | [] | no_license | from tkinter import *
from tkinter import ttk, messagebox
import socket
from time import sleep
import threading
import json
from db_connection import *
# network client
client = None
SERVER = '127.0.0.1'
PORT = 5050
FORMAT = 'utf-8'
board_checked_fields = []
your_turn = False
your_details = {
"name": "Player1",
... |
Java | UTF-8 | 803 | 2.0625 | 2 | [] | no_license | package com.amber.ShoppingApp.dao;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import com.amber.ShoppingApp.model.ProductBean;
public interface ProductDAO {
List<ProductBean> selectAll() throws SQLExcep... |
PHP | UTF-8 | 7,797 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php namespace Syscover\Pulsar\Libraries;
/**
* @package Pulsar
* @author Jose Carlos Rodríguez Palacín
* @copyright Copyright (c) 2015, SYSCOVER, SL.
* @license
* @link http://www.syscover.com
* @since Version 1.0
* @filesource Librarie that instance helper functions
*/
use Illuminate\Sup... |
C | UTF-8 | 1,945 | 2.90625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* test.c :+: :+: :+: ... |
Shell | UTF-8 | 341 | 3.359375 | 3 | [
"MPL-2.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #!/bin/sh
set -e
TEST_VERSION=${1:-canary}
for dir in $(ls -d -- */); do
test="${dir}run.sh"
echo "################################################"
echo "Now running $test"
echo "################################################"
echo ""
TEST_VERSION=$TEST_VERSION /bin/sh $test
echo ""
echo "$test pa... |
Python | UTF-8 | 7,005 | 2.703125 | 3 | [] | no_license | from elsie import SlideDeck, TextStyle as s
from branch_prediction import branch_prediction
from cache_conflicts import cache_conflicts
from denormals import denormals
from false_sharing import false_sharing
from utils import COLOR_NOTE, code, finish_slides, list_item, new_slide, new_slides, slide_header
COLOR1 = "bl... |
Markdown | UTF-8 | 5,017 | 2.921875 | 3 | [
"MIT"
] | permissive | ## Civil Air Patrol Fuel Reporting System
### Vision & Scope
### 1. Business Requirements
#### 1.1 Background
The Civil Air Patrol is the official auxiliary of the United States Air Force and a non-profit organization. CAP supports America’s communities through emergency/disaster relief, aerospace education for youth... |
Markdown | UTF-8 | 2,880 | 2.875 | 3 | [] | no_license | ---
type: post
title: "Vegan Eggplant Curry with Fresh Mint"
author: "nt_bella"
category: lunch
photo: "https://imagesvc.meredithcorp.io/v3/mm/image?url=https%3A%2F%2Fimages.media-allrecipes.com%2Fuserphotos%2F5454067.jpg"
prep_time: "P0DT0H20M"
cook_time: "P0DT0H15M"
recipe_yield: "2 servings"
rating_value: 4.25
revie... |
Python | UTF-8 | 988 | 4.03125 | 4 | [] | no_license | #i is an odd number generated.
#change i into a string
#revi will be the reverse of the number produced
#if i ==revi then the number is palindromic
#if i is palindromic check if dividing by 3,5,7,9,11 will produce a remainder. if not then i is NOT a prime if a remainder is formed then i is a prime.
N=eval(inp... |
Markdown | UTF-8 | 620 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | # spiderPlus
爬取网站文章到Excel
安装
go get github.com/PeterYangs/spiderPlus
使用
```go
import "github.com/PeterYangs/spiderPlus"
spiderPlus.Rule(
"https://www.azg168.cn",//域名
"/bazisuanming/index_[PAGE].html",//栏目,分页用[PAGE]替代
10,//爬取页数
2,//起始页面
"body > div.main.clearfix.w960 > div.main_left.fl.dream_box > ul > li",//列表选... |
JavaScript | UTF-8 | 370 | 2.640625 | 3 | [] | no_license | $(document).ready(function() {
var radiorel = 0;
$('input[name="radio-1"]').on('change', function(e) {
radiorel = e.target.value;
$('.task-link').each(function() {
var href = $(this).attr('href');
var value = href.replace(/(sort=)[^&]+/ig, '$1' + radiorel);
$(... |
C++ | UTF-8 | 539 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
vector <int> g[111];
bool used[111];
int cnt = 0;
void dfs(int v){
if (used[v]) return;
used[v] = 1;
cnt++;
for(int i = 0; i < g[v].size(); i++)
dfs(g[v][i]);
}
int main(){
int n, s;
cin >> n >> s;
for (int i = 1; i <=... |
C | UTF-8 | 805 | 3.609375 | 4 | [] | no_license | #include <stdio.h>
#include <string.h>
int Alphacode ( char digits[] )
{
int sum[100000];
int temp;
int length = strlen ( digits );
int i = 0;
if ( length == 1 ) return 1;
sum[i++] = 1;
if ( (digits[i]-'0' + (digits[i-1]-'0')*10) <= 26 && digits[i] != '0' )
sum[i++] = 2;
else
sum[i++] = 1;
/* Initiali... |
Java | UTF-8 | 762 | 2.078125 | 2 | [] | no_license | package pl.niewiemmichal.underhiseye.services;
import pl.niewiemmichal.underhiseye.commons.dto.VisitClosureDto;
import pl.niewiemmichal.underhiseye.commons.dto.VisitRegistrationDto;
import pl.niewiemmichal.underhiseye.commons.dto.VisitWithExaminationsDto;
import pl.niewiemmichal.underhiseye.entities.Visit;
import java... |
C++ | UTF-8 | 2,269 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | /*!
* Copyright (c) 2019 by Contributors if not otherwise specified
* \file random_file_order_sampler.cc
* \brief Randomly shuffle file order but not internal frame order
*/
#include "random_sampler.h"
#include <algorithm>
#include <dmlc/logging.h>
namespace decord {
namespace sampler {
RandomSampler::RandomS... |
JavaScript | UTF-8 | 2,721 | 3.265625 | 3 | [] | no_license | // hide any error messages + movie info
$(".desc").hide();
$(".errorMessage").hide();
$(".searchResults").hide();
$(".movieDetails").hide();
function displayInfo() {
// wipe out all existing html
$(".searchResults").html("");
$(".movieDetails").html("");
// first, a little validation to make sure there is some ... |
Java | GB18030 | 1,922 | 3.375 | 3 | [] | no_license | package other.basic.java.set;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.Spliterator;
/**
* <PRE>
*
* </PRE>
*
* ĿƣjavaStudy</BR>
* ֧֣㶫ͨƼɷ˾ (c) 2017</BR>
*
* @version 1.0 2019529
* @author xiangning
* @s... |
Markdown | UTF-8 | 3,288 | 2.578125 | 3 | [] | no_license | # Packet Tracer: Configuración inicial del router
## Parte 1: Verificar la configuración predeterminada del router
#### Paso 1: Establecer una conexión de consola con el R1
#### Paso 2: Ingresar al modo con privilegios y examinar la configuración actual.
~~~
enable
show running-config
show startup-config
~~~
##### c)
... |
Java | UTF-8 | 651 | 3.515625 | 4 | [
"MIT"
] | permissive | package Collection;
import java.util.ArrayList;
import java.util.Iterator;
public class ListDemo {
public static void getListDemo() {
System.out.println("List实例开始*************************");
ArrayList arraylist = new ArrayList();
arraylist.add("java");
arraylist.add("php");
// 使用Iterator遍历ArrayList
Itera... |
Python | UTF-8 | 263 | 2.796875 | 3 | [] | no_license | class Solution:
def sumZero(self, n: int) -> List[int]:
num, rem = n//2, n%2
answer = []
if rem != 0: answer.append(0)
for i in range(1, num+1):
answer.append(-i)
answer.append(i)
return answer
|
Java | UTF-8 | 449 | 1.921875 | 2 | [] | no_license | package com.nisum.employee.ref.repository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.stereotype.Repository;
import com.nisum.employee.ref.domain.InfoEntity;
@Repository
public class InformationRepository {
... |
Java | UTF-8 | 895 | 2.796875 | 3 | [] | no_license | package server;
import java.sql.DriverManager;
import java.sql.ResultSet;
import com.mysql.jdbc.Statement;
public class DB {
/*
* Connect the database
* Use singletone pattern
*/
private static DB db;
final static String ip ="jdbc:mysql://localhost?characterEncoding=utf-8";
final static String id ="root";
... |
Java | UTF-8 | 1,765 | 2.25 | 2 | [] | no_license | /**
* This class is generated by jOOQ
*/
package com.school.cbis.domain.tables.pojos;
import java.io.Serializable;
import javax.annotation.Generated;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
* This class is generated by jOOQ.
*/
@Generated(
value = {
"http:/... |
PHP | UTF-8 | 2,214 | 2.84375 | 3 | [
"MIT"
] | permissive | <!--
templete :https://getbootstrap.com/
login:https://www.tutorialrepublic.com/php-tutorial/php-mysql-login-system.php
login:https://www.tutorialspoint.com/php/php_mysql_login.htm
login:https://www.formget.com/login-form-in-php/
-->
<?php
session_start(); // Starting Session
$error=''; // Variable To Store Error Messa... |
Python | UTF-8 | 2,635 | 4.0625 | 4 | [] | no_license | """
Determine if a 9x9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:
Each row must contain the digits 1-9 without repetition.
Each column must contain the digits 1-9 without repetition.
Each of the 9 3x3 sub-boxes of the grid must contain the digits 1-9 without rep... |
C++ | UTF-8 | 1,379 | 3.25 | 3 | [] | no_license | #include <dictionary/DictionaryApplication.h>
#include <iostream>
#include <functional>
void DictionaryApplication::RequestTranslation(const std::string& wordToTranslate)
{
std::cout << "Неизвестное слово \"" << wordToTranslate << "\". Введите перевод или пустую строку для отказа.\n";
std::string userTranslat... |
TypeScript | UTF-8 | 1,989 | 3.484375 | 3 | [] | no_license | export const Day15 = {
id: '15',
star1,
star2
};
function star1 (lines: string[]): string {
const startingNumbers = parseStartingNumbers(lines[0]);
const turnHistory = playGame(startingNumbers, 2020);
return `${turnHistory.lastValue}`;
}
function star2 (lines: string[]): string {
const startingNumbers ... |
C# | UTF-8 | 1,215 | 2.703125 | 3 | [] | no_license | using System;
namespace Graphe.Collations.Commands
{
public class EditSacrumCommand : Command
{
#region Constructor
/// <summary>
/// Constructor for initializing the command.
/// </summary>
/// <param name="sacrum">The sacrum to be edited.</param>
... |
SQL | UTF-8 | 358 | 3.40625 | 3 | [] | no_license | -- Consulta da Ficha de Exercícios
SELECT
F.CD_FICHA 'Código',
F.CD_ALU 'Código Aluno',
A.NOME_ALU 'Nome Aluno',
F.NM_EXERCICIO 'Nome Exercício',
F.REPETICOES 'Repetições',
F.SERIES 'Séries',
F.TREINO 'Treino',
F.DATA_INICIO 'Data de Início'
FROM FICHA_EXERCICIOS F
LEFT OUTER JOIN ALUNO A
ON F.CD_ALU = A.CD... |
Java | UTF-8 | 336 | 2.703125 | 3 | [] | no_license | #include<iostream>
int main()
{
// Type your code here
int n, i, id, flag=0;
std::cin>>n;
int a[n];
for(i=0;i<n;i++)
{
std::cin>>a[i];
}
std::cin>>id;
for(i=0;i<n;i++)
{
if(a[i]==id)
flag=1;
}
if(flag==1)
std::cout<<"She passed her exam";
else
std::cout<<"She failed... |
Markdown | UTF-8 | 9,691 | 2.90625 | 3 | [
"CC-BY-NC-SA-4.0",
"CC-BY-NC-ND-4.0",
"MIT"
] | permissive | # HTTPS 概述与运行机制
在进行 HTTP 通信时,信息可能会监听、服务器或客户端身份伪装等安全问题,HTTPS 则能有效解决这些问题。在使用原始的 HTTP 连接的时候,因为服务器与用户之间是直接进行的明文传输,导致了用户面临着很多的风险与威胁。攻击者可以用中间人攻击来轻易的 截获或者篡改传输的数据。攻击者想要做些什么并没有任何的限制,包括窃取用户的 Session 信息、注入有害的代码等,乃至于修改用户传送至服务器的数据。
我们并不能替用户选择所使用的网络,他们很有可能使用一个开放的,任何人都可以窃听的网络,譬如一个咖啡馆或者机场里面的开放 WiFi 网络。普通的 用户很有可能被欺骗地随便连上一个叫免费热点的网络,或者... |
Python | UTF-8 | 1,326 | 4.09375 | 4 | [] | no_license | import random
# Limit number of guesses allowed
# Catch when someone submits a non-integer
# generate a random number between 1 and 10
def secret_num():
secret_num = random.randint(1, 10)
return secret_num
def get_guess_from_user():
while True:
try:
guess = int(input("Guess ... |
Markdown | UTF-8 | 3,201 | 3.03125 | 3 | [
"MIT"
] | permissive | ---
title: Operating at scale
outline:
problem: |
I have 300 sites to manage. Help!
draft: false
type: deck
notes:
title: |
Operating at scale doesn't just mean meeting the demands of a single application.
problem: |
As your business grows, you may have multiple application across an entire fle... |
C++ | UTF-8 | 3,451 | 2.609375 | 3 | [] | no_license | #include "Transform.h"
using namespace cv;
Mat cylinderTrans(Mat img, double focusSet)
{
int width = img.cols;
int height = img.rows;
double focus;
double fov;
if (focusSet > 0)
{
fov = focusSet / 360 * 3.1415926;
focus = width / 2 / tan(fov);
}
else
{
focus = sqrtf(img.rows * img.rows + img.cols * img.... |
Java | UTF-8 | 4,607 | 2.296875 | 2 | [] | no_license | package com.r.bigconf.core.processing;
import com.r.bigconf.core.model.ConferenceUsers;
import com.r.bigconf.core.processing.model.ConferenceChannelsData;
import com.r.bigconf.core.processing.model.ConferenceProcessData;
import com.r.bigconf.core.sound.wav.WavUtils;
import lombok.extern.slf4j.Slf4j;
import java.nio.B... |
Python | UTF-8 | 617 | 2.71875 | 3 | [] | no_license | import os, time, picamera
os.system("mkdir -p output && rm -rf output/*" )
with picamera.PiCamera() as camera:
camera.resolution = (1240, 1024)
camera.start_preview()
for i, filename in enumerate(camera.capture_continuous('output/image_{counter:03d}.jpg')):
print( f"[{i +1:02d}] filename = {filen... |
Java | UTF-8 | 2,789 | 2.59375 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* Copyright (c) 2012-2020 University Corporation for Atmospheric Research/Unidata.
* See LICENSE for license information.
*/
package edu.ucar.unidata.rosetta.util;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.FileReader;
import java.io.IOException;
import java.nio.file.Files;
import java.n... |
C++ | UTF-8 | 490 | 2.609375 | 3 | [] | no_license | #include<stdlib.h>
#include<unistd.h>
#include<stdio.h>
#include<sys/shm.h>
#include<fcntl.h>
#include<semaphore.h>
#include<iostream>
using namespace std;
int main()
{
cout<<"child opened"<<endl;
sem_t *S1 = sem_open("mysem1", 0);
sem_t *S2 = sem_open("mysem2", 0);
int rfd;
// int wfd;
// dup2(0, rfd);
// dup2... |
Java | UTF-8 | 1,337 | 2.265625 | 2 | [] | no_license | package com.project2.DAOImpl;
import java.util.List;
import javax.transaction.Transactional;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.proj... |
Python | UTF-8 | 896 | 4.40625 | 4 | [] | no_license | """
Daily Coding Problem - 10/23/2019 - Medium
This problem was asked by Google.
Given a string of parentheses, write a function to compute the minimum number of parentheses to be removed to make the string valid (i.e. each open parenthesis is eventually closed).
For example, given the string "()())()", you should re... |
Java | UTF-8 | 319 | 1.828125 | 2 | [] | no_license | package com.example.kapil.formtask1;
public class ApiUtils {
public ApiUtils() {}
public static final String BASE_URL = "http://api.shoocal.com/test/manager/democalltesting";
public static APIService getAPIService() {
return RetrofitClient.getClient(BASE_URL).create(APIService.class);
}
}
|
JavaScript | UTF-8 | 1,818 | 2.625 | 3 | [] | no_license | const initialState = {
access_token: localStorage.getItem('token'),
expiryTime: localStorage.getItem('expiry_time'),
userdata: localStorage.getItem('userdata'),
artist: [],
track: [],
playliste: localStorage.getItem('playliste'),
page: 'Home',
search: []
};
function Reducer(s... |
Python | UTF-8 | 293 | 2.90625 | 3 | [] | no_license | import sys
sys.stdin = open("0402회전.txt", "r")
T = int(input())
for tc in range(T):
N, M = map(int, input().split())
data = list(map(int, input().split()))
cnt = 0
while cnt < M:
data.append(data.pop(0))
cnt += 1
print("#{} {}".format(tc+1, data[0])) |
Java | UTF-8 | 2,482 | 1.9375 | 2 | [] | no_license | package com.apps.multiboo;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
... |
Markdown | UTF-8 | 367 | 2.71875 | 3 | [
"MIT"
] | permissive | ## Topic - News App
- This Repository consists of A Basic News app.
- Used API for fetching data of news.
## Softwares used
- HTML5
- CSS3
- JavaScript
## Software needed to run this app
- VSCode (as an editor)
- Google Chrome as browser
- Live Link: https://sumera222.github.io/NewsApp/
- Repository Lin... |
Python | UTF-8 | 680 | 2.859375 | 3 | [] | no_license | with open("day09.txt") as f:
instructions = [l.strip().split() for l in f.readlines()]
def sign(x):
return 1 if x > 0 else -1 if x < 0 else 0
DIRS = {
"U": 0 + 1j,
"D": 0 - 1j,
"R": 1 + 0j,
"L": -1+ 0j,
}
L = 10
knots = [0j for _ in range(L)]
visited = {0j}
for direction, x in instructions:... |
Markdown | UTF-8 | 2,961 | 2.734375 | 3 | [] | no_license | require; - стандартный модуль ноды
http.createServer().listen
createServer - стандартный метод
listen(3000) - метод с портом который мы будем слушать
http.createServer(function (request, responce) {
request - то что отправляем на сервер - запрос
responce - ответ сервера
})
// следующий шаг такой
http.createSe... |
C | UTF-8 | 1,998 | 2.5625 | 3 | [
"MIT"
] | permissive | /*
* lis.h
* Copyright (C) 2008, 2009 Tomasz Koziara (t.koziara AT gmail.com)
* --------------------------------------------------------------------
* list merge sort
*/
/* This file is part of Solfec.
* Solfec is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser Genera... |
Java | UTF-8 | 1,771 | 2.578125 | 3 | [] | no_license | package com.top_adv.myapplication1.Alarm;
import android.os.Parcel;
import android.os.Parcelable;
public class AlarmData implements Parcelable{
public int resource;
public String uri;
public String title;
public String message;
public String ticker;
public AlarmData() {
}
public AlarmData(Parcel in) {
... |
Java | UTF-8 | 8,367 | 2.1875 | 2 | [] | no_license | package cz.vity.freerapid.plugins.services.pinterest;
import cz.vity.freerapid.plugins.exceptions.ErrorDuringDownloadingException;
import cz.vity.freerapid.plugins.exceptions.PluginImplementationException;
import cz.vity.freerapid.plugins.exceptions.ServiceConnectionProblemException;
import cz.vity.freerapi... |
Swift | UTF-8 | 834 | 2.65625 | 3 | [] | no_license | //
// ChannelTableCell.swift
// QuickChat
//
// Created by thanhbh on 5/18/18.
// Copyright © 2018 vinicorp. All rights reserved.
//
import UIKit
class ChannelTableCell: UITableViewCell {
@IBOutlet weak var txtChannel: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// I... |
Python | UTF-8 | 260 | 2.953125 | 3 | [] | no_license | def commonChars(self, A):
"""
:type A: List[str]
:rtype: List[str]
"""
#Brute Force
#Create a dictionary for all all the strings to track the count of letters.
#Compare and keep the count of each letter.
|
Python | UTF-8 | 14,546 | 3.59375 | 4 | [
"MIT"
] | permissive | #!/usr/bin/env python
# coding: utf-8
# __Submitted by__: M. Hasnain Naeem (212728) from BSCS-7B, NUST
#
# # Digital Image Processing
# ## Lab 4 - Transformation Functions and Geometric Transforms from Scratch and using OpenCV
# __Objectives:__
# The objectives of this lab are:
# - To apply Log transformation ... |
Java | UTF-8 | 667 | 1.8125 | 2 | [] | no_license | package com.aiinterview.analysis.dao;
import java.util.List;
import java.util.Map;
import com.aiinterview.analysis.vo.KeywordAnalysisVO;
import com.aiinterview.analysis.vo.TalentAnalysisVO;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
@Mapper("keywordAnalysisMapper")
public interface KeywordAnalysisMapper... |
Java | UTF-8 | 521 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | package irvine.oeis.a067;
import irvine.math.z.Z;
import irvine.oeis.Sequence;
/**
* A067107 Smallest number whose sum of digits is n!.
* a(n) = concatenation of (n! mod 9 ) and ( n! div 9 ) nines.
* @author Georg Fischer
*/
public class A067107 implements Sequence {
private int mN = 0;
private Z mF = Z.ONE;... |
Java | UTF-8 | 2,572 | 2.25 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | package ie.gov.tracing.storage;
import android.content.Context;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import androidx.room.TypeConverters;
import net.sqlcipher.database.SupportFactory;
import java.util.Date;
import java.util.UUID;
import ie.gov.tracing.common.... |
Markdown | UTF-8 | 1,154 | 2.953125 | 3 | [] | no_license | ## 渲染流水线上: CSS如何影响首次加载时的白屏时间
## 渲染流水线为什么需要CSSSOM
- CSSOM的两个作用
- 为javaScript提供操作样式表的能力
- 为合成布局树提供基础样式信息
## 影响页面展示的因素和优化策略
- 首屏渲染的三个阶段
- 请求发出后,到提交数据阶段,这时页面仍展示之前页面的内容
- 提交数据后渲染进程会创建一个空白页面,又叫解析白屏。并等待CSS文件和javaScript文件加载完成,生成CSSOM和DOM,然后合成布局树,准备首屏渲染。
- 等首屏渲染完成后,开始进入完整页面的生成阶段,然后页面被一点点绘制出来
### 解析白屏
- 主要任务: 解析HT... |
C++ | UTF-8 | 1,477 | 3.203125 | 3 | [
"MIT"
] | permissive | /*
* Created by Francesco Frassineti on 06/12/2019.
* LIST OF EDITS (reverse chronological order - add last on top):
* +
* + Francesco Frassineti [06/12/19] - Basic creation
*/
#include "HealthComponent.hpp"
#include "AudioLocator.hpp"
#include <iostream>
HealthComponent::HealthComponent(GameObject* gameObject)
... |
Java | UTF-8 | 1,337 | 3.1875 | 3 | [] | no_license | class Account{
private int id;
private double balance;
private double annuallnterestRate = 0;
private String dateCreated;
public Account(){
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public double getBalance() {
... |
Python | UTF-8 | 2,941 | 2.875 | 3 | [] | no_license | from newspaper import Article, ArticleException
from newsapi.newsapi_client import NewsApiClient
import sys
import json
import time
import asyncio
def add_text_and_format(old_article):
formatted_article = {}
try:
newspaper_article = Article(old_article['url'])
newspaper_article.download()
... |
Markdown | UTF-8 | 18,120 | 2.78125 | 3 | [
"MIT"
] | permissive | ---
templateKey: blog-post
title: California Defamation Law
date: 2019-03-08T15:04:10.000Z
description: California defamation law consists of statutes and case law. Defamation law in California may include libel, slander, false light, intereference with business relations, and other torts.
tags:
- California defa... |
Ruby | UTF-8 | 2,258 | 2.796875 | 3 | [] | no_license | #!/usr/bin/ruby
require 'yaml'
require 'tzinfo'
load 'YahooGroupModerator.rb'
load 'GraphicsHelper.rb'
class Text_Helper
def print_text_report(title,date,data)
report = File.open(title,'w')
report.puts('============ Yahoo Groups Administration Report ============')
report.puts("\n\n")
rep... |
SQL | UTF-8 | 5,069 | 2.703125 | 3 | [] | no_license | CREATE OR REPLACE PACKAGE EcBp_Flowline_Theoretical IS
/****************************************************************
** Package : EcBp_Flowline_Theoretical, header part
**
** $Revision: 1.11 $
**
** Purpose : Calculates theoretical flowline values (rates etc)
**
** Documentation : www.energy-comp... |
Java | UTF-8 | 1,244 | 2.1875 | 2 | [] | no_license | package net.aesircraft.ManaBags.Items;
import java.util.logging.Level;
import net.aesircraft.ManaBags.Config.Config;
import net.aesircraft.ManaBags.ManaBags;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
import org.getspout.spoutapi.SpoutManager;
import org.getspout.spoutapi.inventory... |
Shell | UTF-8 | 937 | 3.890625 | 4 | [] | no_license | #!/bin/bash
# spawn.sh
PIDS=$(pgrep sh $0) # Process IDs of the various instances of this script.
P_array=( $PIDS ) # Put them in an array (why?).
echo $PIDS # Show process IDs of parent and child processes.
let "instances = ${#P_array[*]} - 1" # Count elements, less 1.
... |
Java | UTF-8 | 9,243 | 1.90625 | 2 | [] | no_license | package com.hongshi.wuliudidi.activity;
import java.util.ArrayList;
import java.util.List;
import net.tsz.afinal.http.AjaxParams;
import org.json.JSONException;
import org.json.JSONObject;
import com.alibaba.fastjson.JSON;
import com.hongshi.wuliudidi.CommonRes;
import com.hongshi.wuliudidi.DidiApp;
import com.hong... |
JavaScript | UTF-8 | 2,087 | 2.6875 | 3 | [] | no_license | import {
transformDate
} from "../../script/utils/transformDate.js";
export class CommitCard {
constructor(name, email, date, message, avatar_url) {
this.name = name;
this.email = email;
this.date = date;
this.message = message;
this.avatar_url = avatar_url;
thi... |
C++ | UTF-8 | 321 | 3.640625 | 4 | [] | no_license | //displaying 5 students marks using function
#include<iostream>
using namespace std;
void display(int mark[5])
int main()
{
int mark[5]={78,86,95,84,79};
display(mark);
return 0;
}
void display(int mark[5])
{
cout<<"5 students marks :"<<endl;
for(int i=0 ;int i<=5 ;i++)
{
cout<<"student "<<i+1<<mark[i];
}
}... |
Java | UTF-8 | 762 | 2.4375 | 2 | [] | no_license | package com.bcd.fraud.bpmn.rule;
import java.util.Calendar;
import com.bcd.fraud.Transaction;
public class CheckDatetimeRule extends FraudDetectionRule {
public CheckDatetimeRule(Transaction transaction) {
super(transaction);
}
@Override
public void execute() {
if (!isToday(getTransaction().g... |
C | UTF-8 | 2,956 | 3.546875 | 4 | [] | no_license | // program that computes P(O|M) for a given input utterance
// the utterance must be entered as a sequence of acoustic vectors
#include<stdio.h>
#include<stdlib.h>
#include "structs.h"
#include "showgmm.h"
#include "aposteriori.h"
#include "loadconfig.h"
#include "loadUtterance.h"
#include "loadGMM.h"
int main(int a... |
Markdown | UTF-8 | 11,233 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | # Cascading DropDownList in ASP.Net MVC
## Requires
- Visual Studio 2010
## License
- Apache License, Version 2.0
## Technologies
- ASP.NET MVC
- jQuery
- ASP.NET MVC 3
- ASP.NET MVC 4
## Topics
- User Interface
- Web Services
## Updated
- 01/09/2012
## Description
<h1>Introduction</h1>
<p>This sample shows how t... |
Go | UTF-8 | 1,874 | 3.140625 | 3 | [
"MIT"
] | permissive | package main
import "testing"
func TestIncrementMaliciousRequests(t *testing.T) {
a := attacker{maliciousRequests: 1}
a.incrementMaliciousRequests()
if got := a.maliciousRequests; got != 2 {
t.Errorf("Expecting 2 malicious requests, got %d.", got)
}
}
func TestUpdateStatusCodes(t *testing.T) {
a := attacker{s... |
Java | UTF-8 | 1,070 | 2.390625 | 2 | [] | no_license | package pages;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
public class LoginPage extends BasePage {
public LoginPage(WebDriver driver) {
super(driver);
}
By userNameBy = By.id("email");
By passwordBy = By.id("password");
By loginButtonBy = By.id("loginButton");
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.